/opt/canhelp/node_modules/next/dist/client
NameSizeModeActions
app-dir/-0755rm
compat/-0755rm
components/-0755rm
dev/-0755rm
legacy/-0755rm
lib/-0755rm
portal/-0755rm
react-client-callbacks/-0755rm
request/-0755rm
tracing/-0755rm
add-base-path.d.ts790644editdlrm
add-base-path.js10100644editdlrm
add-base-path.js.map9730644editdlrm
add-locale.d.ts1210644editdlrm
add-locale.js10520644editdlrm
add-locale.js.map9000644editdlrm
app-bootstrap.d.ts2850644editdlrm
app-bootstrap.js27710644editdlrm
app-bootstrap.js.map39670644editdlrm
app-build-id.d.ts1110644editdlrm
app-build-id.js17670644editdlrm
app-build-id.js.map14610644editdlrm
app-call-server.d.ts910644editdlrm
app-call-server.js11640644editdlrm
app-call-server.js.map10170644editdlrm
app-find-source-map-url.d.ts900644editdlrm
app-find-source-map-url.js16620644editdlrm
app-find-source-map-url.js.map20920644editdlrm
app-globals.d.ts450644editdlrm
app-globals.js7080644editdlrm
app-globals.js.map5910644editdlrm
app-index.d.ts6250644editdlrm
app-index.js114290644editdlrm
app-index.js.map170630644editdlrm
app-link-gc.d.ts400644editdlrm
app-link-gc.js45430644editdlrm
app-link-gc.js.map51630644editdlrm
app-next-dev.d.ts240644editdlrm
app-next-dev.js12140644editdlrm
app-next-dev.js.map11980644editdlrm
app-next-turbopack.d.ts110644editdlrm
app-next-turbopack.js12910644editdlrm
app-next-turbopack.js.map16590644editdlrm
app-next.d.ts240644editdlrm
app-next.js12840644editdlrm
app-next.js.map12490644editdlrm
app-webpack.d.ts110644editdlrm
app-webpack.js31740644editdlrm
app-webpack.js.map32030644editdlrm
assign-location.d.ts3630644editdlrm
assign-location.js12590644editdlrm
assign-location.js.map15490644editdlrm
detect-domain-locale.d.ts1410644editdlrm
detect-domain-locale.js9220644editdlrm
detect-domain-locale.js.map7220644editdlrm
flight-data-helpers.d.ts14910644editdlrm
flight-data-helpers.js54390644editdlrm
flight-data-helpers.js.map86650644editdlrm
form-shared.d.ts28860644editdlrm
form-shared.js71320644editdlrm
form-shared.js.map107620644editdlrm
form.d.ts4890644editdlrm
form.js58160644editdlrm
form.js.map82650644editdlrm
get-domain-locale.d.ts2200644editdlrm
get-domain-locale.js15610644editdlrm
get-domain-locale.js.map24570644editdlrm
has-base-path.d.ts600644editdlrm
has-base-path.js8070644editdlrm
has-base-path.js.map6050644editdlrm
head-manager.d.ts10410644editdlrm
head-manager.js49810644editdlrm
head-manager.js.map83420644editdlrm
image-component.d.ts13370644editdlrm
image-component.js139610644editdlrm
image-component.js.map213850644editdlrm
index.d.ts7730644editdlrm
index.js334400644editdlrm
index.js.map525760644editdlrm
link.d.ts50620644editdlrm
link.js194570644editdlrm
link.js.map343670644editdlrm
next-dev-turbopack.d.ts110644editdlrm
next-dev-turbopack.js19400644editdlrm
next-dev-turbopack.js.map30020644editdlrm
next-dev.d.ts200644editdlrm
next-dev.js12230644editdlrm
next-dev.js.map11940644editdlrm
next-turbopack.d.ts480644editdlrm
next-turbopack.js14600644editdlrm
next-turbopack.js.map23300644editdlrm
next.d.ts1350644editdlrm
next.js7870644editdlrm
next.js.map8600644editdlrm
normalize-locale-path.d.ts1440644editdlrm
normalize-locale-path.js8830644editdlrm
normalize-locale-path.js.map8830644editdlrm
normalize-trailing-slash.d.ts1900644editdlrm
normalize-trailing-slash.js14500644editdlrm
normalize-trailing-slash.js.map17230644editdlrm
page-bootstrap.d.ts1230644editdlrm
page-bootstrap.js74270644editdlrm
page-bootstrap.js.map89990644editdlrm
page-loader.d.ts13700644editdlrm
page-loader.js75950644editdlrm
page-loader.js.map121060644editdlrm
remove-base-path.d.ts620644editdlrm
remove-base-path.js10800644editdlrm
remove-base-path.js.map11450644editdlrm
remove-locale.d.ts770644editdlrm
remove-locale.js11480644editdlrm
remove-locale.js.map13080644editdlrm
request-idle-callback.d.ts2650644editdlrm
request-idle-callback.js14490644editdlrm
request-idle-callback.js.map14320644editdlrm
resolve-href.d.ts3960644editdlrm
resolve-href.js55060644editdlrm
resolve-href.js.map78990644editdlrm
route-announcer.d.ts1150644editdlrm
route-announcer.js33120644editdlrm
route-announcer.js.map35530644editdlrm
route-loader.d.ts17360644editdlrm
route-loader.js139680644editdlrm
route-loader.js.map230120644editdlrm
route-params.d.ts11130644editdlrm
route-params.js82580644editdlrm
route-params.js.map108840644editdlrm
router.d.ts10780644editdlrm
router.js67160644editdlrm
router.js.map88230644editdlrm
script.d.ts9230644editdlrm
script.js140470644editdlrm
script.js.map187820644editdlrm
set-attributes-from-props.d.ts860644editdlrm
set-attributes-from-props.js23670644editdlrm
set-attributes-from-props.js.map31210644editdlrm
trusted-types.d.ts5440644editdlrm
trusted-types.js15280644editdlrm
trusted-types.js.map19570644editdlrm
use-client-disallowed.d.ts530644editdlrm
use-client-disallowed.js10060644editdlrm
use-client-disallowed.js.map7530644editdlrm
use-intersection.d.ts4120644editdlrm
use-intersection.js38450644editdlrm
use-intersection.js.map66460644editdlrm
use-merged-ref.d.ts1390644editdlrm
use-merged-ref.js24020644editdlrm
use-merged-ref.js.map34960644editdlrm
web-vitals.d.ts1560644editdlrm
web-vitals.js11090644editdlrm
web-vitals.js.map10080644editdlrm
webpack.d.ts110644editdlrm
webpack.js22820644editdlrm
webpack.js.map25350644editdlrm
with-router.d.ts5050644editdlrm
with-router.js14580644editdlrm
with-router.js.map19210644editdlrm
Edit: /opt/canhelp/node_modules/next/dist/client/script.js (14047B)
'use client'; "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); 0 && (module.exports = { default: null, handleClientScriptLoad: null, initScriptLoader: null }); function _export(target, all) { for(var name in all)Object.defineProperty(target, name, { enumerable: true, get: all[name] }); } _export(exports, { default: function() { return _default; }, handleClientScriptLoad: function() { return handleClientScriptLoad; }, initScriptLoader: function() { return initScriptLoader; } }); const _interop_require_default = require("@swc/helpers/_/_interop_require_default"); const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard"); const _jsxruntime = require("react/jsx-runtime"); const _reactdom = /*#__PURE__*/ _interop_require_default._(require("react-dom")); const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react")); const _headmanagercontextsharedruntime = require("../shared/lib/head-manager-context.shared-runtime"); const _setattributesfromprops = require("./set-attributes-from-props"); const _requestidlecallback = require("./request-idle-callback"); const ScriptCache = new Map(); const LoadCache = new Set(); const insertStylesheets = (stylesheets)=>{ // Case 1: Styles for afterInteractive/lazyOnload with appDir injected via handleClientScriptLoad // // Using ReactDOM.preinit to feature detect appDir and inject styles // Stylesheets might have already been loaded if initialized with Script component // Re-inject styles here to handle scripts loaded via handleClientScriptLoad // ReactDOM.preinit handles dedup and ensures the styles are loaded only once if (_reactdom.default.preinit) { stylesheets.forEach((stylesheet)=>{ _reactdom.default.preinit(stylesheet, { as: 'style' }); }); return; } // Case 2: Styles for afterInteractive/lazyOnload with pages injected via handleClientScriptLoad // // We use this function to load styles when appdir is not detected // TODO: Use React float APIs to load styles once available for pages dir if (typeof window !== 'undefined') { let head = document.head; stylesheets.forEach((stylesheet)=>{ let link = document.createElement('link'); link.type = 'text/css'; link.rel = 'stylesheet'; link.href = stylesheet; head.appendChild(link); }); } }; const loadScript = (props)=>{ const { src, id, onLoad = ()=>{}, onReady = null, dangerouslySetInnerHTML, children = '', strategy = 'afterInteractive', onError, stylesheets } = props; const cacheKey = id || src; // Script has already loaded if (cacheKey && LoadCache.has(cacheKey)) { return; } // Contents of this script are already loading/loaded if (ScriptCache.has(src)) { LoadCache.add(cacheKey); // It is possible that multiple `next/script` components all have same "src", but has different "onLoad" // This is to make sure the same remote script will only load once, but "onLoad" are executed in order ScriptCache.get(src).then(onLoad, onError); return; } /** Execute after the script first loaded */ const afterLoad = ()=>{ // Run onReady for the first time after load event if (onReady) { onReady(); } // add cacheKey to LoadCache when load successfully LoadCache.add(cacheKey); }; const el = document.createElement('script'); const loadPromise = new Promise((resolve, reject)=>{ el.addEventListener('load', function(e) { resolve(); if (onLoad) { onLoad.call(this, e); } afterLoad(); }); el.addEventListener('error', function(e) { reject(e); }); }).catch(function(e) { if (onError) { onError(e); } }); if (dangerouslySetInnerHTML) { // Casting since lib.dom.d.ts doesn't have TrustedHTML yet. el.innerHTML = dangerouslySetInnerHTML.__html || ''; afterLoad(); } else if (children) { el.textContent = typeof children === 'string' ? children : Array.isArray(children) ? children.join('') : ''; afterLoad(); } else if (src) { el.src = src; // do not add cacheKey into LoadCache for remote script here // cacheKey will be added to LoadCache when it is actually loaded (see loadPromise above) ScriptCache.set(src, loadPromise); } (0, _setattributesfromprops.setAttributesFromProps)(el, props); if (strategy === 'worker') { el.setAttribute('type', 'text/partytown'); } el.setAttribute('data-nscript', strategy); // Load styles associated with this script if (stylesheets) { insertStylesheets(stylesheets); } document.body.appendChild(el); }; function handleClientScriptLoad(props) { const { strategy = 'afterInteractive' } = props; if (strategy === 'lazyOnload') { window.addEventListener('load', ()=>{ (0, _requestidlecallback.requestIdleCallback)(()=>loadScript(props)); }); } else { loadScript(props); } } function loadLazyScript(props) { if (document.readyState === 'complete') { (0, _requestidlecallback.requestIdleCallback)(()=>loadScript(props)); } else { window.addEventListener('load', ()=>{ (0, _requestidlecallback.requestIdleCallback)(()=>loadScript(props)); }); } } function addBeforeInteractiveToCache() { const scripts = [ ...document.querySelectorAll('[data-nscript="beforeInteractive"]'), ...document.querySelectorAll('[data-nscript="beforePageRender"]') ]; scripts.forEach((script)=>{ const cacheKey = script.id || script.getAttribute('src'); LoadCache.add(cacheKey); }); } function initScriptLoader(scriptLoaderItems) { scriptLoaderItems.forEach(handleClientScriptLoad); addBeforeInteractiveToCache(); } /** * Load a third-party scripts in an optimized way. * * Read more: [Next.js Docs: `next/script`](https://nextjs.org/docs/app/api-reference/components/script) */ function Script(props) { const { id, src = '', onLoad = ()=>{}, onReady = null, strategy = 'afterInteractive', onError, stylesheets, ...restProps } = props; // Context is available only during SSR let { updateScripts, scripts, getIsSsr, appDir, nonce } = (0, _react.useContext)(_headmanagercontextsharedruntime.HeadManagerContext); // if a nonce is explicitly passed to the script tag, favor that over the automatic handling nonce = restProps.nonce || nonce; /** * - First mount: * 1. The useEffect for onReady executes * 2. hasOnReadyEffectCalled.current is false, but the script hasn't loaded yet (not in LoadCache) * onReady is skipped, set hasOnReadyEffectCalled.current to true * 3. The useEffect for loadScript executes * 4. hasLoadScriptEffectCalled.current is false, loadScript executes * Once the script is loaded, the onLoad and onReady will be called by then * [If strict mode is enabled / is wrapped in component] * 5. The useEffect for onReady executes again * 6. hasOnReadyEffectCalled.current is true, so entire effect is skipped * 7. The useEffect for loadScript executes again * 8. hasLoadScriptEffectCalled.current is true, so entire effect is skipped * * - Second mount: * 1. The useEffect for onReady executes * 2. hasOnReadyEffectCalled.current is false, but the script has already loaded (found in LoadCache) * onReady is called, set hasOnReadyEffectCalled.current to true * 3. The useEffect for loadScript executes * 4. The script is already loaded, loadScript bails out * [If strict mode is enabled / is wrapped in component] * 5. The useEffect for onReady executes again * 6. hasOnReadyEffectCalled.current is true, so entire effect is skipped * 7. The useEffect for loadScript executes again * 8. hasLoadScriptEffectCalled.current is true, so entire effect is skipped */ const hasOnReadyEffectCalled = (0, _react.useRef)(false); (0, _react.useEffect)(()=>{ const cacheKey = id || src; if (!hasOnReadyEffectCalled.current) { // Run onReady if script has loaded before but component is re-mounted if (onReady && cacheKey && LoadCache.has(cacheKey)) { onReady(); } hasOnReadyEffectCalled.current = true; } }, [ onReady, id, src ]); const hasLoadScriptEffectCalled = (0, _react.useRef)(false); (0, _react.useEffect)(()=>{ if (!hasLoadScriptEffectCalled.current) { if (strategy === 'afterInteractive') { loadScript(props); } else if (strategy === 'lazyOnload') { loadLazyScript(props); } hasLoadScriptEffectCalled.current = true; } }, [ props, strategy ]); if (strategy === 'beforeInteractive' || strategy === 'worker') { if (updateScripts) { scripts[strategy] = (scripts[strategy] || []).concat([ { id, src, onLoad, onReady, onError, ...restProps, nonce } ]); updateScripts(scripts); } else if (getIsSsr && getIsSsr()) { // Script has already loaded during SSR LoadCache.add(id || src); } else if (getIsSsr && !getIsSsr()) { loadScript({ ...props, nonce }); } } // For the app directory, we need React Float to preload these scripts. if (appDir) { // Injecting stylesheets here handles beforeInteractive and worker scripts correctly // For other strategies injecting here ensures correct stylesheet order // ReactDOM.preinit handles loading the styles in the correct order, // also ensures the stylesheet is loaded only once and in a consistent manner // // Case 1: Styles for beforeInteractive/worker with appDir - handled here // Case 2: Styles for beforeInteractive/worker with pages dir - Not handled yet // Case 3: Styles for afterInteractive/lazyOnload with appDir - handled here // Case 4: Styles for afterInteractive/lazyOnload with pages dir - handled in insertStylesheets function if (stylesheets) { stylesheets.forEach((styleSrc)=>{ _reactdom.default.preinit(styleSrc, { as: 'style' }); }); } // Before interactive scripts need to be loaded by Next.js' runtime instead // of native