From 596ff1cd043a34d24aeff06806751cbbcc099cae Mon Sep 17 00:00:00 2001 From: Wout Mertens Date: Thu, 20 Jun 2024 01:05:52 +0000 Subject: [PATCH] 96ae4c6 fix(qrl): correct qrl loading in vite dev mode (#6579) https://github.com/QwikDev/qwik/commit/96ae4c6c00867d20b4285162c7211eddf56ac7c9 --- bindings/qwik.win32-x64-msvc.node | Bin 10331136 -> 10331136 bytes build/package.json | 2 +- cli.cjs | 4 ++-- core.cjs | 6 +++--- core.cjs.map | 2 +- core.d.ts | 2 +- core.min.mjs | 2 +- core.mjs | 6 +++--- core.mjs.map | 2 +- core.prod.cjs | 6 +++--- core.prod.mjs | 6 +++--- core/package.json | 2 +- jsx-dev-runtime/package.json | 2 +- jsx-runtime/package.json | 2 +- loader/package.json | 2 +- optimizer.cjs | 10 ++++++---- optimizer.mjs | 10 ++++++---- optimizer/package.json | 2 +- package.json | 2 +- prefetch/package.json | 2 +- server.cjs | 4 ++-- server.mjs | 4 ++-- server/package.json | 2 +- testing/index.cjs | 2 +- testing/index.mjs | 2 +- testing/package.json | 2 +- 26 files changed, 46 insertions(+), 42 deletions(-) diff --git a/bindings/qwik.win32-x64-msvc.node b/bindings/qwik.win32-x64-msvc.node index 1877e2953cf90832e974fb290ef79326d3a86c1d..3f29fb2ec850545a740c7cd597712bae2470ac67 100644 GIT binary patch delta 735 zcmXxZ$8*ea00r>*njG4XU~U?P*4%oL_Fjp@u_CbKAIHglNEJm#~2G8VFk zau&0Mr7UAPD_F@YRCidFy1qiam_!J%M19wnE2<0Mqh!gi#_B(<`HC-9-x~h@X#1Sarvo>*Nrqe8 uriDA)n)@4d|U4`keAla(vS z6+8clTRmCu&77G#_b$HdufHW(y5m7Klk7?axkOMDr4J?ar62u?F@S*#qLjguQBIs8 zBp6Bs!x+v8Mly=gjA1O}NK(moCNPmnOlAsGnZ|Ugn88eDF`GHerJ8xnX8{YTVG*?~ zW(jpHWf{v^!Ae%Knl;qZz*^R^o(-hfNF$qQVl!LV$~LyMgPrVRH+$I2KK65fgB;>8 zM>t9|$2iUjPSV0DPSeU6+DOyRS { for (let i = 0; i < text.length; i++) { @@ -7307,7 +7307,7 @@ Task Symbol: ${task.$qrl$.$symbol$} throwErrorAndStop('Sync QRL without containerState'); } } - let output = `${encodeURI(chunk)}#${symbol}`; + let output = `${chunk}#${symbol}`; const capture = qrl.$capture$; const captureRef = qrl.$captureRef$; if (captureRef && captureRef.length) { diff --git a/core.cjs.map b/core.cjs.map index c6c11eea..ffb94af5 100644 --- a/core.cjs.map +++ b/core.cjs.map @@ -1 +1 @@ -{"version":3,"file":"core.cjs","sources":["../../../dist-dev/tsc-out/packages/qwik/src/core/util/implicit_dollar.js","../../../dist-dev/tsc-out/packages/qwik/src/core/util/qdev.js","../../../dist-dev/tsc-out/packages/qwik/src/core/util/element.js","../../../dist-dev/tsc-out/packages/qwik/src/core/util/log.js","../../../dist-dev/tsc-out/packages/qwik/src/core/error/assert.js","../../../dist-dev/tsc-out/packages/qwik/src/core/error/error.js","../../../dist-dev/tsc-out/packages/qwik/src/core/platform/platform.js","../../../dist-dev/tsc-out/packages/qwik/src/core/util/types.js","../../../dist-dev/tsc-out/packages/qwik/src/core/util/promises.js","../../../dist-dev/tsc-out/packages/qwik/src/core/util/flyweight.js","../../../dist-dev/tsc-out/packages/qwik/src/core/util/dom.js","../../../dist-dev/tsc-out/packages/qwik/src/core/util/markers.js","../../../dist-dev/tsc-out/packages/qwik/src/core/state/constants.js","../../../dist-dev/tsc-out/packages/qwik/src/core/render/fast-calls.js","../../../dist-dev/tsc-out/packages/qwik/src/core/util/case.js","../../../dist-dev/tsc-out/packages/qwik/src/core/state/listeners.js","../../../dist-dev/tsc-out/packages/qwik/src/core/use/use-on.js","../../../dist-dev/tsc-out/packages/qwik/src/core/util/event.js","../../../dist-dev/tsc-out/packages/qwik/src/core/state/store.js","../../../dist-dev/tsc-out/packages/qwik/src/core/use/use-sequential-scope.js","../../../dist-dev/tsc-out/packages/qwik/src/core/use/use-context.js","../../../dist-dev/tsc-out/packages/qwik/src/core/render/error-handling.js","../../../dist-dev/tsc-out/packages/qwik/src/core/util/unitless_number.js","../../../dist-dev/tsc-out/packages/qwik/src/core/render/execute-component.js","../../../dist-dev/tsc-out/packages/qwik/src/core/version.js","../../../dist-dev/tsc-out/packages/qwik/src/core/util/hash_code.js","../../../dist-dev/tsc-out/packages/qwik/src/core/style/qrl-styles.js","../../../dist-dev/tsc-out/packages/qwik/src/core/render/ssr/render-ssr.js","../../../dist-dev/tsc-out/packages/qwik/src/core/qrl/inlined-fn.js","../../../dist-dev/tsc-out/packages/qwik/src/core/render/jsx/jsx-runtime.js","../../../dist-dev/tsc-out/packages/qwik/src/core/render/jsx/utils.public.js","../../../dist-dev/tsc-out/packages/qwik/src/core/render/dom/render-dom.js","../../../dist-dev/tsc-out/packages/qwik/src/core/container/resume.js","../../../dist-dev/tsc-out/packages/qwik/src/core/use/use-lexical-scope.public.js","../../../dist-dev/tsc-out/packages/qwik/src/core/render/dom/signals.js","../../../dist-dev/tsc-out/packages/qwik/src/core/render/dom/notify-render.js","../../../dist-dev/tsc-out/packages/qwik/src/core/use/use-signal.js","../../../dist-dev/tsc-out/packages/qwik/src/core/use/use-task.js","../../../dist-dev/tsc-out/packages/qwik/src/testing/html.js","../../../dist-dev/tsc-out/packages/qwik/src/core/state/context.js","../../../dist-dev/tsc-out/packages/qwik/src/core/use/use-locale.js","../../../dist-dev/tsc-out/packages/qwik/src/core/use/use-core.js","../../../dist-dev/tsc-out/packages/qwik/src/core/state/signal.js","../../../dist-dev/tsc-out/packages/qwik/src/core/container/container.js","../../../dist-dev/tsc-out/packages/qwik/src/core/render/dom/visitor.js","../../../dist-dev/tsc-out/packages/qwik/src/core/render/dom/operations.js","../../../dist-dev/tsc-out/packages/qwik/src/core/render/dom/virtual-element.js","../../../dist-dev/tsc-out/packages/qwik/src/core/container/pause.js","../../../dist-dev/tsc-out/packages/qwik/src/core/qrl/qrl.js","../../../dist-dev/tsc-out/packages/qwik/src/core/use/use-resource.js","../../../dist-dev/tsc-out/packages/qwik/src/core/render/jsx/slot.public.js","../../../dist-dev/tsc-out/packages/qwik/src/core/container/serializers.js","../../../dist-dev/tsc-out/packages/qwik/src/core/state/common.js","../../../dist-dev/tsc-out/packages/qwik/src/core/qrl/qrl-class.js","../../../dist-dev/tsc-out/packages/qwik/src/core/qrl/qrl.public.js","../../../dist-dev/tsc-out/packages/qwik/src/core/component/component.public.js","../../../dist-dev/tsc-out/packages/qwik/src/core/render/jsx/factory.js","../../../dist-dev/tsc-out/packages/qwik/src/core/render/dom/render.public.js","../../../dist-dev/tsc-out/packages/qwik/src/core/use/use-store.public.js","../../../dist-dev/tsc-out/packages/qwik/src/core/use/use-id.js","../../../dist-dev/tsc-out/packages/qwik/src/core/use/use-env-data.js","../../../dist-dev/tsc-out/packages/qwik/src/core/style/scoped-stylesheet.js","../../../dist-dev/tsc-out/packages/qwik/src/core/use/use-styles.js","../../../dist-dev/tsc-out/packages/qwik/src/core/use/use-error-boundary.js","../../../dist-dev/tsc-out/packages/qwik/src/core/components/prefetch.js"],"sourcesContent":["import { $ } from '../qrl/qrl.public';\n// \n// !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n// (edit ../readme.md#implicit$FirstArg instead)\n/**\n * Create a `____$(...)` convenience method from `___(...)`.\n *\n * It is very common for functions to take a lazy-loadable resource as a first argument. For this\n * reason, the Qwik Optimizer automatically extracts the first argument from any function which ends\n * in `$`.\n *\n * This means that `foo$(arg0)` and `foo($(arg0))` are equivalent with respect to Qwik Optimizer.\n * The former is just a shorthand for the latter.\n *\n * For example, these function calls are equivalent:\n *\n * - `component$(() => {...})` is same as `component($(() => {...}))`\n *\n * ```tsx\n * export function myApi(callback: QRL<() => void>): void {\n * // ...\n * }\n *\n * export const myApi$ = implicit$FirstArg(myApi);\n * // type of myApi$: (callback: () => void): void\n *\n * // can be used as:\n * myApi$(() => console.log('callback'));\n *\n * // will be transpiled to:\n * // FILE: \n * myApi(qrl('./chunk-abc.js', 'callback'));\n *\n * // FILE: chunk-abc.js\n * export const callback = () => console.log('callback');\n * ```\n *\n * @param fn - A function that should have its first argument automatically `$`.\n * @public\n */\n// \nexport const implicit$FirstArg = (fn) => {\n return function (first, ...rest) {\n return fn.call(null, $(first), ...rest);\n };\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW1wbGljaXRfZG9sbGFyLmpzIiwic291cmNlUm9vdCI6Ii4vIiwic291cmNlcyI6WyJwYWNrYWdlcy9xd2lrL3NyYy9jb3JlL3V0aWwvaW1wbGljaXRfZG9sbGFyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxDQUFDLEVBQVksTUFBTSxtQkFBbUIsQ0FBQztBQUVoRCxtREFBbUQ7QUFDbkQseUNBQXlDO0FBQ3pDLGdEQUFnRDtBQUNoRDs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7R0FtQ0c7QUFDSCxVQUFVO0FBQ1YsTUFBTSxDQUFDLE1BQU0saUJBQWlCLEdBQUcsQ0FDL0IsRUFBMkMsRUFDTCxFQUFFO0lBQ3hDLE9BQU8sVUFBVSxLQUFZLEVBQUUsR0FBRyxJQUFVO1FBQzFDLE9BQU8sRUFBRSxDQUFDLElBQUksQ0FBQyxJQUFJLEVBQUUsQ0FBQyxDQUFDLEtBQUssQ0FBQyxFQUFFLEdBQUcsSUFBSSxDQUFDLENBQUM7SUFDMUMsQ0FBQyxDQUFDO0FBQ0osQ0FBQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgJCwgdHlwZSBRUkwgfSBmcm9tICcuLi9xcmwvcXJsLnB1YmxpYyc7XG5cbi8vIDxkb2NzIG1hcmtkb3duPVwiLi4vcmVhZG1lLm1kI2ltcGxpY2l0JEZpcnN0QXJnXCI+XG4vLyAhIURPIE5PVCBFRElUIFRISVMgQ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IC8vIHR5cGUgb2YgbXlBcGkkOiAoY2FsbGJhY2s6ICgpID0+IHZvaWQpOiB2b2lkXG4gKlxuICogLy8gY2FuIGJlIHVzZWQgYXM6XG4gKiBteUFwaSQoKCkgPT4gY29uc29sZS5sb2coJ2NhbGxiYWNrJykpO1xuICpcbiAqIC8vIHdpbGwgYmUgdHJhbnNwaWxlZCB0bzpcbiAqIC8vIEZJTEU6IDxjdXJyZW50IGZpbGU+XG4gKiBteUFwaShxcmwoJy4vY2h1bmstYWJjLmpzJywgJ2NhbGxiYWNrJykpO1xuICpcbiAqIC8vIEZJTEU6IGNodW5rLWFiYy5qc1xuICogZXhwb3J0IGNvbnN0IGNhbGxiYWNrID0gKCkgPT4gY29uc29sZS5sb2coJ2NhbGxiYWNrJyk7XG4gKiBgYGBcbiAqXG4gKiBAcGFyYW0gZm4gLSBBIGZ1bmN0aW9uIHRoYXQgc2hvdWxkIGhhdmUgaXRzIGZpcnN0IGFyZ3VtZW50IGF1dG9tYXRpY2FsbHkgYCRgLlxuICogQHB1YmxpY1xuICovXG4vLyA8L2RvY3M+XG5leHBvcnQgY29uc3QgaW1wbGljaXQkRmlyc3RBcmcgPSA8RklSU1QsIFJFU1QgZXh0ZW5kcyBhbnlbXSwgUkVUPihcbiAgZm46IChxcmw6IFFSTDxGSVJTVD4sIC4uLnJlc3Q6IFJFU1QpID0+IFJFVFxuKTogKChxcmw6IEZJUlNULCAuLi5yZXN0OiBSRVNUKSA9PiBSRVQpID0+IHtcbiAgcmV0dXJuIGZ1bmN0aW9uIChmaXJzdDogRklSU1QsIC4uLnJlc3Q6IFJFU1QpOiBSRVQge1xuICAgIHJldHVybiBmbi5jYWxsKG51bGwsICQoZmlyc3QpLCAuLi5yZXN0KTtcbiAgfTtcbn07XG4iXX0=","export const qDev = globalThis.qDev !== false;\nexport const qInspector = globalThis.qInspector === true;\nexport const qSerialize = globalThis.qSerialize !== false;\nexport const qDynamicPlatform = globalThis.qDynamicPlatform !== false;\nexport const qTest = globalThis.qTest === true;\nexport const qRuntimeQrl = globalThis.qRuntimeQrl === true;\nexport const seal = (obj) => {\n if (qDev) {\n Object.seal(obj);\n }\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicWRldi5qcyIsInNvdXJjZVJvb3QiOiIuLyIsInNvdXJjZXMiOlsicGFja2FnZXMvcXdpay9zcmMvY29yZS91dGlsL3FkZXYudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsTUFBTSxDQUFDLE1BQU0sSUFBSSxHQUFHLFVBQVUsQ0FBQyxJQUFJLEtBQUssS0FBSyxDQUFDO0FBQzlDLE1BQU0sQ0FBQyxNQUFNLFVBQVUsR0FBRyxVQUFVLENBQUMsVUFBVSxLQUFLLElBQUksQ0FBQztBQUN6RCxNQUFNLENBQUMsTUFBTSxVQUFVLEdBQUcsVUFBVSxDQUFDLFVBQVUsS0FBSyxLQUFLLENBQUM7QUFDMUQsTUFBTSxDQUFDLE1BQU0sZ0JBQWdCLEdBQUcsVUFBVSxDQUFDLGdCQUFnQixLQUFLLEtBQUssQ0FBQztBQUN0RSxNQUFNLENBQUMsTUFBTSxLQUFLLEdBQUcsVUFBVSxDQUFDLEtBQUssS0FBSyxJQUFJLENBQUM7QUFDL0MsTUFBTSxDQUFDLE1BQU0sV0FBVyxHQUFHLFVBQVUsQ0FBQyxXQUFXLEtBQUssSUFBSSxDQUFDO0FBRTNELE1BQU0sQ0FBQyxNQUFNLElBQUksR0FBRyxDQUFDLEdBQVEsRUFBRSxFQUFFO0lBQy9CLElBQUksSUFBSSxFQUFFLENBQUM7UUFDVCxNQUFNLENBQUMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUFDO0lBQ25CLENBQUM7QUFDSCxDQUFDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgY29uc3QgcURldiA9IGdsb2JhbFRoaXMucURldiAhPT0gZmFsc2U7XG5leHBvcnQgY29uc3QgcUluc3BlY3RvciA9IGdsb2JhbFRoaXMucUluc3BlY3RvciA9PT0gdHJ1ZTtcbmV4cG9ydCBjb25zdCBxU2VyaWFsaXplID0gZ2xvYmFsVGhpcy5xU2VyaWFsaXplICE9PSBmYWxzZTtcbmV4cG9ydCBjb25zdCBxRHluYW1pY1BsYXRmb3JtID0gZ2xvYmFsVGhpcy5xRHluYW1pY1BsYXRmb3JtICE9PSBmYWxzZTtcbmV4cG9ydCBjb25zdCBxVGVzdCA9IGdsb2JhbFRoaXMucVRlc3QgPT09IHRydWU7XG5leHBvcnQgY29uc3QgcVJ1bnRpbWVRcmwgPSBnbG9iYWxUaGlzLnFSdW50aW1lUXJsID09PSB0cnVlO1xuXG5leHBvcnQgY29uc3Qgc2VhbCA9IChvYmo6IGFueSkgPT4ge1xuICBpZiAocURldikge1xuICAgIE9iamVjdC5zZWFsKG9iaik7XG4gIH1cbn07XG5cbmRlY2xhcmUgY29uc3QgZ2xvYmFsVGhpczogYW55O1xuIl19","export const isNode = (value) => {\n return value && typeof value.nodeType === 'number';\n};\nexport const isDocument = (value) => {\n return value.nodeType === 9;\n};\nexport const isElement = (value) => {\n return value.nodeType === 1;\n};\nexport const isQwikElement = (value) => {\n const nodeType = value.nodeType;\n return nodeType === 1 || nodeType === 111;\n};\nexport const isNodeElement = (value) => {\n const nodeType = value.nodeType;\n return nodeType === 1 || nodeType === 111 || nodeType === 3;\n};\nexport const isVirtualElement = (value) => {\n return value.nodeType === 111;\n};\nexport const isVirtualElementOpenComment = (value) => {\n return isComment(value) && value.data.startsWith('qv ');\n};\nexport const isText = (value) => {\n return value.nodeType === 3;\n};\nexport const isComment = (value) => {\n return value.nodeType === 8;\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZWxlbWVudC5qcyIsInNvdXJjZVJvb3QiOiIuLyIsInNvdXJjZXMiOlsicGFja2FnZXMvcXdpay9zcmMvY29yZS91dGlsL2VsZW1lbnQudHMiXSwibmFtZXMi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07XG5cbmV4cG9ydCBjb25zdCBpc0NvbW1lbnQgPSAodmFsdWU6IE5vZGUgfCBRd2lrRWxlbWVudCk6IHZhbHVlIGlzIENvbW1lbnQgPT4ge1xuICByZXR1cm4gKHZhbHVlIGFzIGFueSkubm9kZVR5cGUgPT09IDg7XG59O1xuIl19","import { isElement, isNode } from './element';\nimport { qDev, qTest } from './qdev';\nconst STYLE = qDev\n ? `background: #564CE0; color: white; padding: 2px 3px; border-radius: 2px; font-size: 0.8em;`\n : '';\nexport const logError = (message, ...optionalParams) => {\n return createAndLogError(false, message, ...optionalParams);\n};\nexport const throwErrorAndStop = (message, ...optionalParams) => {\n const error = createAndLogError(false, message, ...optionalParams);\n // eslint-disable-next-line no-debugger\n debugger;\n throw error;\n};\nexport const logErrorAndStop = (message, ...optionalParams) => {\n const err = createAndLogError(true, message, ...optionalParams);\n // eslint-disable-next-line no-debugger\n debugger;\n return err;\n};\nconst _printed = /*#__PURE__*/ new Set();\nexport const logOnceWarn = (message, ...optionalParams) => {\n if (qDev) {\n const key = 'warn' + String(message);\n if (!_printed.has(key)) {\n _printed.add(key);\n logWarn(message, ...optionalParams);\n }\n }\n};\nexport const logWarn = (message, ...optionalParams) => {\n if (qDev) {\n console.warn('%cQWIK WARN', STYLE, message, ...printParams(optionalParams));\n }\n};\nexport const logDebug = (message, ...optionalParams) => {\n if (qDev) {\n // eslint-disable-next-line no-console\n console.debug('%cQWIK', STYLE, message, ...printParams(optionalParams));\n }\n};\nexport const tryGetContext = (element) => {\n return element['_qc_'];\n};\nconst printParams = (optionalParams) => {\n if (qDev) {\n return optionalParams.map((p) => {\n if (isNode(p) && isElement(p)) {\n return printElement(p);\n }\n return p;\n });\n }\n return optionalParams;\n};\nconst printElement = (el) => {\n const ctx = tryGetContext(el);\n const isServer = /*#__PURE__*/ (() => typeof process !== 'undefined' && !!process.versions && !!process.versions.node)();\n return {\n tagName: el.tagName,\n renderQRL: ctx?.$componentQrl$?.getSymbol(),\n element: isServer ? undefined : el,\n ctx: isServer ? undefined : ctx,\n };\n};\nconst createAndLogError = (asyncThrow, message, ...optionalParams) => {\n const err = message instanceof Error ? message : new Error(message);\n // display the error message first, then the optional params, and finally the stack trace\n // the stack needs to be displayed last because the given params will be lost among large stack traces so it will\n // provide a bad developer experience\n console.error('%cQWIK ERROR', STYLE, err.message, ...printParams(optionalParams), err.stack);\n asyncThrow &&\n !qTest &&\n setTimeout(() => {\n // throwing error asynchronously to avoid breaking the current call stack.\n // We throw so that the error is delivered to the global error handler for\n // reporting it to a third-party tools such as Qwik Insights, Sentry or New Relic.\n throw err;\n }, 0);\n return err;\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9nLmpzIiwic291cmNlUm9vdCI6Ii4vIiwic291cmNlcyI6WyJwYWNrYWdlcy9xd2lrL3NyYy9jb3JlL3V0aWwvbG9nLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxFQUFFLE1BQU0sV0FBVyxDQUFDO0FBQzlDLE9BQU8sRUFBRSxJQUFJLEVBQUUsS0FBSyxFQUFFLE1BQU0sUUFBUSxDQUFDO0FBRXJDLE1BQU0sS0FBSyxHQUFHLElBQUk7SUFDaEIsQ0FBQyxDQUFDLDRGQUE0RjtJQUM5RixDQUFDLENBQUMsRUFBRSxDQUFDO0FBRVAsTUFBTSxDQUFDLE1BQU0sUUFBUSxHQUFHLENBQUMsT0FBYSxFQUFFLEdBQUcsY0FBcUIsRUFBRSxFQUFFO0lBQ2xFLE9BQU8saUJBQWlCLENBQUMsS0FBSyxFQUFFLE9BQU8sRUFBRSxHQUFHLGNBQWMsQ0FBQyxDQUFDO0FBQzlELENBQUMsQ0FBQztBQUVGLE1BQU0sQ0FBQyxNQUFNLGlCQUFpQixHQUFHLENBQUMsT0FBYSxFQUFFLEdBQUcsY0FBcUIsRUFBUyxFQUFFO0lBQ2xGLE1BQU0sS0F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IGJyZWFraW5nIHRoZSBjdXJyZW50IGNhbGwgc3RhY2suXG4gICAgICAvLyBXZSB0aHJvdyBzbyB0aGF0IHRoZSBlcnJvciBpcyBkZWxpdmVyZWQgdG8gdGhlIGdsb2JhbCBlcnJvciBoYW5kbGVyIGZvclxuICAgICAgLy8gcmVwb3J0aW5nIGl0IHRvIGEgdGhpcmQtcGFydHkgdG9vbHMgc3VjaCBhcyBRd2lrIEluc2lnaHRzLCBTZW50cnkgb3IgTmV3IFJlbGljLlxuICAgICAgdGhyb3cgZXJyO1xuICAgIH0sIDApO1xuICByZXR1cm4gZXJyO1xufTtcbiJdfQ==","import { isElement, isQwikElement } from '../util/element';\nimport { throwErrorAndStop } from '../util/log';\nimport { qDev } from '../util/qdev';\nconst ASSERT_DISCLAIMER = 'Internal assert, this is likely caused by a bug in Qwik: ';\nexport function assertDefined(value, text, ...parts) {\n if (qDev) {\n if (value != null) {\n return;\n }\n throwErrorAndStop(ASSERT_DISCLAIMER + text, ...parts);\n }\n}\nexport function assertEqual(value1, value2, text, ...parts) {\n if (qDev) {\n if (value1 === value2) {\n return;\n }\n throwErrorAndStop(ASSERT_DISCLAIMER + text, ...parts);\n }\n}\nexport function assertFail(text, ...parts) {\n if (qDev) {\n throwErrorAndStop(ASSERT_DISCLAIMER + text, ...parts);\n }\n}\nexport function assertTrue(value1, text, ...parts) {\n if (qDev) {\n if (value1 === true) {\n return;\n }\n throwErrorAndStop(ASSERT_DISCLAIMER + text, ...parts);\n }\n}\nexport function assertNumber(value1, text, ...parts) {\n if (qDev) {\n if (typeof value1 === 'number') {\n return;\n }\n throwErrorAndStop(ASSERT_DISCLAIMER + text, ...parts);\n }\n}\nexport function assertString(value1, text, ...parts) {\n if (qDev) {\n if (typeof value1 === 'string') {\n return;\n }\n throwErrorAndStop(ASSERT_DISCLAIMER + text, ...parts);\n }\n}\nexport function assertQwikElement(el) {\n if (qDev) {\n if (!isQwikElement(el)) {\n console.error('Not a Qwik Element, got', el);\n throwErrorAndStop(ASSERT_DISCLAIMER + 'Not a Qwik Element');\n }\n }\n}\nexport function assertElement(el) {\n if (qDev) {\n if (!isElement(el)) {\n console.error('Not a Element, got', el);\n throwErrorAndStop(ASSERT_DISCLAIMER + 'Not an Element');\n }\n }\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXNzZXJ0LmpzIiwic291cmNlUm9vdCI6Ii4vIiwic291cmNlcyI6WyJwYWNrYWdlcy9xd2lrL3NyYy9jb3JlL2Vycm9yL2Fzc2VydC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEVBQUUsU0FBUyxFQUFFLGFBQWEsRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBQzNELE9BQU8sRUFBRSxpQkFBaUIsRUFBRSxNQUFNLGFBQWEsQ0FBQztBQUNoRCxPQUFPLEVBQUUsSUFBSSxFQUFFLE1BQU0sY0FBYyxDQUFDO0FBRXBDLE1BQU0saUJBQWlCLEdBQUcsMkRBQTJELENBQUM7QUFFdEYsTUFBTSxVQUFVLGFBQWEsQ0FDM0IsS0FBUSxFQUNSLElBQVksRUFDWixHQUFHLEtBQVk7SUFFZixJQUFJLElBQUksRUFBRSxDQUFDO1FBQ1QsSUFBSSxLQUFLLElBQUksSUFBSSxFQUFFLENBQUM7WUFDbEIsT0FBTztRQUNULENBQUM7UUFDRCxpQkFBaUIsQ0FBQyxpQkFBaUIsR0FBRyxJQUFJLEVBQUUsR0FBRyxLQUFLLENBQUMsQ0FBQztJQUN4RCxDQUFDO0FBQ0gsQ0FBQztBQUVELE1BQU0sVUFBVSxXQUFXLENBQ3pCLE1BQVcsRUFDWCxNQUFXLEVBQ1gsSUFBWSxFQUNaLEdBQUcsS0FBWTtJQUVmLElBQUksSUFBSSxFQUFFLENBQUM7UUFDVCxJQUFJLE1BQU0sS0FBSyxNQUFNLEVBQUUsQ0FBQztZQUN0QixPQUFPO1FBQ1QsQ0FBQztRQUNELGl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XJ0cyBlbCBpcyBRd2lrRWxlbWVudCB7XG4gIGlmIChxRGV2KSB7XG4gICAgaWYgKCFpc1F3aWtFbGVtZW50KGVsKSkge1xuICAgICAgY29uc29sZS5lcnJvcignTm90IGEgUXdpayBFbGVtZW50LCBnb3QnLCBlbCk7XG4gICAgICB0aHJvd0Vycm9yQW5kU3RvcChBU1NFUlRfRElTQ0xBSU1FUiArICdOb3QgYSBRd2lrIEVsZW1lbnQnKTtcbiAgICB9XG4gIH1cbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGFzc2VydEVsZW1lbnQoZWw6IE5vZGUgfCBWaXJ0dWFsRWxlbWVudCk6IGFzc2VydHMgZWwgaXMgRWxlbWVudCB7XG4gIGlmIChxRGV2KSB7XG4gICAgaWYgKCFpc0VsZW1lbnQoZWwpKSB7XG4gICAgICBjb25zb2xlLmVycm9yKCdOb3QgYSBFbGVtZW50LCBnb3QnLCBlbCk7XG4gICAgICB0aHJvd0Vycm9yQW5kU3RvcChBU1NFUlRfRElTQ0xBSU1FUiArICdOb3QgYW4gRWxlbWVudCcpO1xuICAgIH1cbiAgfVxufVxuIl19","import { logErrorAndStop } from '../util/log';\nimport { qDev } from '../util/qdev';\nexport const codeToText = (code, ...parts) => {\n if (qDev) {\n // Keep one error, one line to make it easier to search for the error message.\n const MAP = [\n 'Error while serializing class attribute', // 0\n 'Can not serialize a HTML Node that is not an Element', // 1\n 'Runtime but no instance found on element.', // 2\n 'Only primitive and object literals can be serialized', // 3\n 'Crash while rendering', // 4\n 'You can render over a existing q:container. Skipping render().', // 5\n 'Set property {{0}}', // 6\n \"Only function's and 'string's are supported.\", // 7\n \"Only objects can be wrapped in 'QObject'\", // 8\n `Only objects literals can be wrapped in 'QObject'`, // 9\n 'QRL is not a function', // 10\n 'Dynamic import not found', // 11\n 'Unknown type argument', // 12\n `Actual value for useContext({{0}}) can not be found, make sure some ancestor component has set a value using useContextProvider(). In the browser make sure that the context was used during SSR so its state was serialized.`, // 13\n \"Invoking 'use*()' method outside of invocation context.\", // 14\n 'Cant access renderCtx for existing context', // 15\n 'Cant access document for existing context', // 16\n 'props are immutable', // 17\n '
component can only be used at the root of a Qwik component$()', // 18\n 'Props are immutable by default.', // 19\n `Calling a 'use*()' method outside 'component$(() => { HERE })' is not allowed. 'use*()' methods provide hooks to the 'component$' state and lifecycle, ie 'use' hooks can only be called synchronously within the 'component$' function or another 'use' method.\\nSee https://qwik.dev/docs/components/tasks/#use-method-rules`, // 20\n 'Container is already paused. Skipping', // 21\n '', // 22 -- unused\n 'When rendering directly on top of Document, the root node must be a ', // 23\n 'A node must have 2 children. The first one and the second one a ', // 24\n 'Invalid JSXNode type \"{{0}}\". It must be either a function or a string. Found:', // 25\n 'Tracking value changes can only be done to useStore() objects and component props', // 26\n 'Missing Object ID for captured object', // 27\n 'The provided Context reference \"{{0}}\" is not a valid context created by createContextId()', // 28\n ' is the root container, it can not be rendered inside a component', // 29\n 'QRLs can not be resolved because it does not have an attached container. This means that the QRL does not know where it belongs inside the DOM, so it cant dynamically import() from a relative path.', // 30\n 'QRLs can not be dynamically resolved, because it does not have a chunk path', // 31\n 'The JSX ref attribute must be a Signal', // 32\n ];\n let text = MAP[code] ?? '';\n if (parts.length) {\n text = text.replaceAll(/{{(\\d+)}}/g, (_, index) => {\n let v = parts[index];\n if (v && typeof v === 'object' && v.constructor === Object) {\n v = JSON.stringify(v).slice(0, 50);\n }\n return v;\n });\n }\n return `Code(${code}): ${text}`;\n }\n else {\n // cute little hack to give roughly the correct line number. Update the line number if it shifts.\n return `Code(${code}) https://github.com/QwikDev/qwik/blob/main/packages/qwik/src/core/error/error.ts#L${8 + code}`;\n }\n};\nexport const QError_stringifyClassOrStyle = 0;\nexport const QError_cannotSerializeNode = 1;\nexport const QError_runtimeQrlNoElement = 2;\nexport const QError_verifySerializable = 3;\nexport const QError_errorWhileRendering = 4;\nexport const QError_cannotRenderOverExistingContainer = 5;\nexport const QError_setProperty = 6;\nexport const QError_qrlOrError = 7;\nexport const QError_onlyObjectWrapped = 8;\nexport const QError_onlyLiteralWrapped = 9;\nexport const QError_qrlIsNotFunction = 10;\nexport const QError_dynamicImportFailed = 11;\nexport const QError_unknownTypeArgument = 12;\nexport const QError_notFoundContext = 13;\nexport const QError_useMethodOutsideContext = 14;\nexport const QError_missingRenderCtx = 15;\nexport const QError_missingDoc = 16;\nexport const QError_immutableProps = 17;\nexport const QError_hostCanOnlyBeAtRoot = 18;\nexport const QError_immutableJsxProps = 19;\nexport const QError_useInvokeContext = 20;\nexport const QError_containerAlreadyPaused = 21;\nexport const QError_unused_please_reuse = 22;\nexport const QError_rootNodeMustBeHTML = 23;\nexport const QError_strictHTMLChildren = 24;\nexport const QError_invalidJsxNodeType = 25;\nexport const QError_trackUseStore = 26;\nexport const QError_missingObjectId = 27;\nexport const QError_invalidContext = 28;\nexport const QError_canNotRenderHTML = 29;\nexport const QError_qrlMissingContainer = 30;\nexport const QError_qrlMissingChunk = 31;\nexport const QError_invalidRefValue = 32;\nexport const qError = (code, ...parts) => {\n const text = codeToText(code, ...parts);\n return logErrorAndStop(text, ...parts);\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXJyb3IuanMiLCJzb3VyY2VSb290IjoiLi8iLCJzb3VyY2VzIjpbInBhY2thZ2VzL3F3aWsvc3JjL2NvcmUvZXJyb3IvZXJyb3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGVBQWUsRUFBRSxNQUFNLGFBQWEsQ0FBQztBQUM5QyxPQUFPLEVBQUUsSUFBSSxFQUFFLE1BQU0sY0FBYyxDQUFDO0FBRXBDLE1BQU0sQ0FBQyxNQUFNLFVBQVUsR0FBRyxDQUFDLElBQVksRUFBRSxHQUFHLEtBQVksRUFBVSxFQUFFO0lBQ2xFLElBQUksSUFBSSxFQUFFLENBQUM7UUFDVCw4RUFBOEU7UUFDOUUsTUFBTSxHQUFHLEdBQUc7WU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CBjb25zdCBRRXJyb3JfcXJsTWlzc2luZ0NodW5rID0gMzE7XG5leHBvcnQgY29uc3QgUUVycm9yX2ludmFsaWRSZWZWYWx1ZSA9IDMyO1xuZXhwb3J0IGNvbnN0IHFFcnJvciA9IChjb2RlOiBudW1iZXIsIC4uLnBhcnRzOiBhbnlbXSk6IEVycm9yID0+IHtcbiAgY29uc3QgdGV4dCA9IGNvZGVUb1RleHQoY29kZSwgLi4ucGFydHMpO1xuICByZXR1cm4gbG9nRXJyb3JBbmRTdG9wKHRleHQsIC4uLnBhcnRzKTtcbn07XG4iXX0=","import { isServer } from '@builder.io/qwik/build';\nimport { qError, QError_qrlMissingChunk, QError_qrlMissingContainer } from '../error/error';\nimport { getSymbolHash } from '../qrl/qrl-class';\nimport { qDynamicPlatform } from '../util/qdev';\nexport const createPlatform = () => {\n return {\n isServer,\n importSymbol(containerEl, url, symbolName) {\n if (isServer) {\n const hash = getSymbolHash(symbolName);\n const regSym = globalThis.__qwik_reg_symbols?.get(hash);\n if (regSym) {\n return regSym;\n }\n }\n if (!url) {\n throw qError(QError_qrlMissingChunk, symbolName);\n }\n if (!containerEl) {\n throw qError(QError_qrlMissingContainer, url, symbolName);\n }\n const urlDoc = toUrl(containerEl.ownerDocument, containerEl, url).toString();\n const urlCopy = new URL(urlDoc);\n urlCopy.hash = '';\n urlCopy.search = '';\n const importURL = urlCopy.href;\n return import(/* @vite-ignore */ importURL).then((mod) => {\n return mod[symbolName];\n });\n },\n raf: (fn) => {\n return new Promise((resolve) => {\n requestAnimationFrame(() => {\n resolve(fn());\n });\n });\n },\n nextTick: (fn) => {\n return new Promise((resolve) => {\n setTimeout(() => {\n resolve(fn());\n });\n });\n },\n chunkForSymbol(symbolName, chunk) {\n return [symbolName, chunk ?? '_'];\n },\n };\n};\n/**\n * Convert relative base URI and relative URL into a fully qualified URL.\n *\n * @param base -`QRL`s are relative, and therefore they need a base for resolution.\n *\n * - `Element` use `base.ownerDocument.baseURI`\n * - `Document` use `base.baseURI`\n * - `string` use `base` as is\n * - `QConfig` use `base.baseURI`\n *\n * @param url - Relative URL\n * @returns Fully qualified URL.\n */\nexport const toUrl = (doc, containerEl, url) => {\n const baseURI = doc.baseURI;\n const base = new URL(containerEl.getAttribute('q:base') ?? baseURI, baseURI);\n return new URL(url, base);\n};\nlet _platform = /*#__PURE__ */ createPlatform();\n// \n// !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n// (edit ./readme.md#setPlatform instead)\n/**\n * Sets the `CorePlatform`.\n *\n * This is useful to override the platform in tests to change the behavior of,\n * `requestAnimationFrame`, and import resolution.\n *\n * @param doc - The document of the application for which the platform is needed.\n * @param platform - The platform to use.\n * @public\n */\n// \nexport const setPlatform = (plt) => (_platform = plt);\n// \n// !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n// (edit ./readme.md#getPlatform instead)\n/**\n * Retrieve the `CorePlatform`.\n *\n * The `CorePlatform` is also responsible for retrieving the Manifest, that contains mappings from\n * symbols to javascript import chunks. For this reason, `CorePlatform` can't be global, but is\n * specific to the application currently running. On server it is possible that many different\n * applications are running in a single server instance, and for this reason the `CorePlatform` is\n * associated with the application document.\n *\n * @param docOrNode - The document (or node) of the application for which the platform is needed.\n * @public\n */\n// \nexport const getPlatform = () => {\n return _platform;\n};\nexport const isServerPlatform = () => {\n if (qDynamicPlatform) {\n return _platform.isServer;\n }\n return false;\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGxhdGZvcm0uanMiLCJzb3VyY2VSb290IjoiLi8iLCJzb3VyY2VzIjpbInBhY2thZ2VzL3F3aWsvc3JjL2NvcmUvcGxhdGZvcm0vcGxhdGZvcm0udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLHdCQUF3QixDQUFDO0FBQ2xELE9BQU8sRUFBRSxNQUFNLEVBQUUsc0JBQXNCLEVBQUUsMEJBQTBCLEVBQUU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AgICAgaWYgKCFjb250YWluZXJFbCkge1xuICAgICAgICB0aHJvdyBxRXJyb3IoUUVycm9yX3FybE1pc3NpbmdDb250YWluZXIsIHVybCwgc3ltYm9sTmFtZSk7XG4gICAgICB9XG4gICAgICBjb25zdCB1cmxEb2MgPSB0b1VybChjb250YWluZXJFbC5vd25lckRvY3VtZW50LCBjb250YWluZXJFbCwgdXJsKS50b1N0cmluZygpO1xuICAgICAgY29uc3QgdXJsQ29weSA9IG5ldyBVUkwodXJsRG9jKTtcbiAgICAgIHVybENvcHkuaGFzaCA9ICcnO1xuICAgICAgdXJsQ29weS5zZWFyY2ggPSAnJztcbiAgICAgIGNvbnN0IGltcG9ydFVSTCA9IHVybENvcHkuaHJlZjtcbiAgICAgIHJldHVybiBpbXBvcnQoLyogQHZpdGUtaWdub3JlICovIGltcG9ydFVSTCkudGhlbigobW9kKSA9PiB7XG4gICAgICAgIHJldHVybiBtb2Rbc3ltYm9sTmFtZV07XG4gICAgICB9KTtcbiAgICB9LFxuICAgIHJhZjogKGZuKSA9PiB7XG4gICAgICByZXR1cm4gbmV3IFByb21pc2UoKHJlc29sdmUpID0+IHtcbiAgICAgICAgcmVxdWVzdEFuaW1hdGlvbkZyYW1lKCgpID0+IHtcbiAgICAgICAgICByZXNvbHZlKGZuKCkpO1xuICAgICAgICB9KTtcbiAgICAgIH0pO1xuICAgIH0sXG4gICAgbmV4dFRpY2s6IChmbikgPT4ge1xuICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKChyZXNvbHZlKSA9PiB7XG4gICAgICAgIHNldFRpbWVvdXQoKCkgPT4ge1xuICAgICAgICAgIHJlc29sdmUoZm4oKSk7XG4gICAgICAgIH0pO1xuICAgICAgfSk7XG4gICAgfSxcbiAgICBjaHVua0ZvclN5bWJvbChzeW1ib2xOYW1lLCBjaHVuaykge1xuICAgICAgcmV0dXJuIFtzeW1ib2xOYW1lLCBjaHVuayA/PyAnXyddO1xuICAgIH0sXG4gIH07XG59O1xuXG4vKipcbi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b2JhbCwgYnV0IGlzXG4gKiBzcGVjaWZpYyB0byB0aGUgYXBwbGljYXRpb24gY3VycmVudGx5IHJ1bm5pbmcuIE9uIHNlcnZlciBpdCBpcyBwb3NzaWJsZSB0aGF0IG1hbnkgZGlmZmVyZW50XG4gKiBhcHBsaWNhdGlvbnMgYXJlIHJ1bm5pbmcgaW4gYSBzaW5nbGUgc2VydmVyIGluc3RhbmNlLCBhbmQgZm9yIHRoaXMgcmVhc29uIHRoZSBgQ29yZVBsYXRmb3JtYCBpc1xuICogYXNzb2NpYXRlZCB3aXRoIHRoZSBhcHBsaWNhdGlvbiBkb2N1bWVudC5cbiAqXG4gKiBAcGFyYW0gZG9jT3JOb2RlIC0gVGhlIGRvY3VtZW50IChvciBub2RlKSBvZiB0aGUgYXBwbGljYXRpb24gZm9yIHdoaWNoIHRoZSBwbGF0Zm9ybSBpcyBuZWVkZWQuXG4gKiBAcHVibGljXG4gKi9cbi8vIDwvZG9jcz5cbmV4cG9ydCBjb25zdCBnZXRQbGF0Zm9ybSA9ICgpOiBDb3JlUGxhdGZvcm0gPT4ge1xuICByZXR1cm4gX3BsYXRmb3JtO1xufTtcblxuZXhwb3J0IGNvbnN0IGlzU2VydmVyUGxhdGZvcm0gPSAoKSA9PiB7XG4gIGlmIChxRHluYW1pY1BsYXRmb3JtKSB7XG4gICAgcmV0dXJuIF9wbGF0Zm9ybS5pc1NlcnZlcjtcbiAgfVxuICByZXR1cm4gZmFsc2U7XG59O1xuIl19","/** @private */\nexport const isHtmlElement = (node) => {\n return node ? node.nodeType === 1 : false;\n};\nexport const isSerializableObject = (v) => {\n const proto = Object.getPrototypeOf(v);\n return proto === Object.prototype || proto === null;\n};\nexport const isObject = (v) => {\n return !!v && typeof v === 'object';\n};\nexport const isArray = (v) => {\n return Array.isArray(v);\n};\nexport const isString = (v) => {\n return typeof v === 'string';\n};\nexport const isFunction = (v) => {\n return typeof v === 'function';\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9u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ub3duKTogdiBpcyBUID0+IHtcbiAgcmV0dXJuIHR5cGVvZiB2ID09PSAnZnVuY3Rpb24nO1xufTtcblxuLyoqXG4gKiBUeXBlIHJlcHJlc2VudGluZyBhIHZhbHVlIHdoaWNoIGlzIGVpdGhlciByZXNvbHZlIG9yIGEgcHJvbWlzZS5cbiAqXG4gKiBAcHVibGljXG4gKi9cbmV4cG9ydCB0eXBlIFZhbHVlT3JQcm9taXNlPFQ+ID0gVCB8IFByb21pc2U8VD47XG4iXX0=","export const isPromise = (value) => {\n // not using \"value instanceof Promise\" to have zone.js support\n return value && typeof value.then === 'function';\n};\nexport const safeCall = (call, thenFn, rejectFn) => {\n try {\n const promise = call();\n if (isPromise(promise)) {\n return promise.then(thenFn, rejectFn);\n }\n else {\n return thenFn(promise);\n }\n }\n catch (e) {\n return rejectFn(e);\n }\n};\nexport const maybeThen = (promise, thenFn) => {\n return isPromise(promise) ? promise.then(thenFn) : thenFn(promise);\n};\nexport const promiseAll = (promises) => {\n const hasPromise = promises.some(isPromise);\n if (hasPromise) {\n return Promise.all(promises);\n }\n return promises;\n};\nexport const promiseAllLazy = (promises) => {\n if (promises.length > 0) {\n return Promise.all(promises);\n }\n return promises;\n};\nexport const isNotNullable = (v) => {\n return v != null;\n};\nexport const delay = (timeout) => {\n return new Promise((resolve) => {\n setTimeout(resolve, timeout);\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvbWlzZXMuanMiLCJzb3VyY2VSb290IjoiLi8iLCJzb3VyY2VzIjpbInBhY2thZ2VzL3F3aWsvc3JjL2NvcmUvdXRpbC9wcm9taXNlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFJQSxNQUFNLENBQUMsTUFBTSxTQUFTLEdBQUcsQ0FBQyxLQUFVLEVBQXlCLEVBQUU7SUFDN0QsK0RBQStEO0lBQy9ELE9BQU8sS0FBSyxJQUFJLE9BQU8sS0FBSyxDQUFDLElBQUks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WFkb25seSB1bmtub3duW10gfCBbXT4oXG4gIHByb21pc2VzOiBUXG4pOiBWYWx1ZU9yUHJvbWlzZTx7IC1yZWFkb25seSBbUCBpbiBrZXlvZiBUXTogQXdhaXRlZDxUW1BdPiB9PiA9PiB7XG4gIGNvbnN0IGhhc1Byb21pc2UgPSBwcm9taXNlcy5zb21lKGlzUHJvbWlzZSk7XG4gIGlmIChoYXNQcm9taXNlKSB7XG4gICAgcmV0dXJuIFByb21pc2UuYWxsKHByb21pc2VzKTtcbiAgfVxuICByZXR1cm4gcHJvbWlzZXMgYXMgYW55O1xufTtcblxuZXhwb3J0IGNvbnN0IHByb21pc2VBbGxMYXp5ID0gPFQgZXh0ZW5kcyByZWFkb25seSB1bmtub3duW10gfCBbXT4oXG4gIHByb21pc2VzOiBUXG4pOiBWYWx1ZU9yUHJvbWlzZTx2b2lkPiA9PiB7XG4gIGlmIChwcm9taXNlcy5sZW5ndGggPiAwKSB7XG4gICAgcmV0dXJuIFByb21pc2UuYWxsKHByb21pc2VzKSBhcyBhbnk7XG4gIH1cbiAgcmV0dXJuIHByb21pc2VzIGFzIGFueTtcbn07XG5cbmV4cG9ydCBjb25zdCBpc05vdE51bGxhYmxlID0gPFQ+KHY6IFQpOiB2IGlzIE5vbk51bGxhYmxlPFQ+ID0+IHtcbiAgcmV0dXJuIHYgIT0gbnVsbDtcbn07XG5cbmV4cG9ydCBjb25zdCBkZWxheSA9ICh0aW1lb3V0OiBudW1iZXIpID0+IHtcbiAgcmV0dXJuIG5ldyBQcm9taXNlKChyZXNvbHZlKSA9PiB7XG4gICAgc2V0VGltZW91dChyZXNvbHZlLCB0aW1lb3V0KTtcbiAgfSk7XG59O1xuIl19","// import { qDev } from './qdev';\nimport { qDev } from './qdev';\nexport const EMPTY_ARRAY = [];\nexport const EMPTY_OBJ = {};\nif (qDev) {\n Object.freeze(EMPTY_ARRAY);\n Object.freeze(EMPTY_OBJ);\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmx5d2VpZ2h0LmpzIiwic291cmNlUm9vdCI6Ii4vIiwic291cmNlcyI6WyJwYWNrYWdlcy9xd2lrL3NyYy9jb3JlL3V0aWwvZmx5d2VpZ2h0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGlDQUFpQztBQUVqQyxPQUFPLEVBQUUsSUFBSSxFQUFFLE1BQU0sUUFBUSxDQUFDO0FBRTlCLE1BQU0sQ0FBQyxNQUFNLFdBQVcsR0FBRyxFQUFXLENBQUM7QUFDdkMsTUFBTSxDQUFDLE1BQU0sU0FBUyxHQUFHLEVBQXlCLENBQUM7QUFFbkQsSUFBSSxJQUFJLEVBQUUsQ0FBQztJQUNULE1BQU0sQ0FBQyxNQUFNLENBQUMsV0FBVyxDQUFDLENBQUM7SUFDM0IsTUFBTSxDQUFDLE1BQU0sQ0FBQyxTQUFTLENBQUMsQ0FBQztBQUMzQixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLy8gaW1wb3J0IHsgcURldiB9IGZyb20gJy4vcWRldic7XG5cbmltcG9ydCB7IHFEZXYgfSBmcm9tICcuL3FkZXYnO1xuXG5leHBvcnQgY29uc3QgRU1QVFlfQVJSQVkgPSBbXSBhcyBhbnlbXTtcbmV4cG9ydCBjb25zdCBFTVBUWV9PQkogPSB7fSBhcyBSZWNvcmQ8c3RyaW5nLCBhbnk+O1xuXG5pZiAocURldikge1xuICBPYmplY3QuZnJlZXplKEVNUFRZX0FSUkFZKTtcbiAgT2JqZWN0LmZyZWV6ZShFTVBUWV9PQkopO1xufVxuIl19","import { assertDefined } from '../error/assert';\nimport { qDynamicPlatform } from './qdev';\nexport const getDocument = (node) => {\n if (!qDynamicPlatform) {\n return document;\n }\n if (typeof document !== 'undefined') {\n return document;\n }\n if (node.nodeType === 9) {\n return node;\n }\n const doc = node.ownerDocument;\n assertDefined(doc, 'doc must be defined');\n return doc;\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJ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gPSAobm9kZTogUXdpa0VsZW1lbnQgfCBEb2N1bWVudCk6IERvY3VtZW50ID0+IHtcbiAgaWYgKCFxRHluYW1pY1BsYXRmb3JtKSB7XG4gICAgcmV0dXJuIGRvY3VtZW50O1xuICB9XG4gIGlmICh0eXBlb2YgZG9jdW1lbnQgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgcmV0dXJuIGRvY3VtZW50O1xuICB9XG4gIGlmIChub2RlLm5vZGVUeXBlID09PSA5KSB7XG4gICAgcmV0dXJuIG5vZGUgYXMgYW55IGFzIERvY3VtZW50O1xuICB9XG4gIGNvbnN0IGRvYyA9IG5vZGUub3duZXJEb2N1bWVudDtcbiAgYXNzZXJ0RGVmaW5lZChkb2MsICdkb2MgbXVzdCBiZSBkZWZpbmVkJyk7XG4gIHJldHVybiBkb2MhO1xufTtcbiJdfQ==","/** State factory of the component. */\nexport const OnRenderProp = 'q:renderFn';\n/** Component style host prefix */\nexport const ComponentStylesPrefixHost = '💎';\n/** Component style content prefix */\nexport const ComponentStylesPrefixContent = '⭐️';\n/** Prefix used to identify on listeners. */\nexport const EventPrefix = 'on:';\n/** Attribute used to mark that an event listener is attached. */\nexport const EventAny = 'on:.';\n/** `` */\nexport const QSlot = 'q:slot';\nexport const QSlotRef = 'q:sref';\nexport const QSlotS = 'q:s';\nexport const QStyle = 'q:style';\nexport const QScopedStyle = 'q:sstyle';\nexport const QCtxAttr = 'q:ctx';\nexport const QManifestHash = 'q:manifest-hash';\nexport const QInstance = 'q:instance';\nexport const QFuncsPrefix = 'qFuncs_';\nexport const getQFuncs = (document, hash) => {\n return document[QFuncsPrefix + hash] || [];\n};\nexport const QLocaleAttr = 'q:locale';\nexport const QContainerAttr = 'q:container';\nexport const QContainerSelector = '[q\\\\:container]';\nexport const ResourceEvent = 'qResource';\nexport const ComputedEvent = 'qComputed';\nexport const RenderEvent = 'qRender';\nexport const TaskEvent = 'qTask';\n/** `` */\nexport const QSlotInertName = '\\u0000';\nexport const ELEMENT_ID = 'q:id';\nexport const ELEMENT_ID_SELECTOR = '[q\\\\:id]';\nexport const ELEMENT_ID_PREFIX = '#';\nexport const INLINE_FN_PREFIX = '@';\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFya2Vycy5qcyIsInNvdXJjZVJvb3QiOiIuLyIsInNvdXJjZXMiOlsicGFja2FnZXMvcXdpay9zcmMvY29yZS91dGlsL21hcmtlcnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsc0NBQXNDO0FBQ3RDLE1BQU0sQ0FBQyxNQUFNLFlBQVksR0FBRyxZQUFZLENBQUM7QUFFekMsa0NBQWtDO0FBQ2xDLE1BQU0sQ0FBQyxNQUFNLHlCQUF5QixHQUFHLElBQUksQ0FBQztBQUU5QyxxQ0FBcUM7QUFDckMsTUFBTSxDQUFDLE1BQU0sNEJBQTRCLEdBQUcsSUFBSSxDQUFDO0FBRWpELDRDQUE0QztBQUM1QyxNQUFNLENBQUMsTUFBTSxXQUFXLEdBQUcsS0FBSyxDQUFDO0FBRWpDLGlFQUFpRTtBQUNqRSxNQUFNLENBQUMsTUFBTSxRQUFRLEdBQUcsTUFBTSxDQUFDO0FBQy9CLG9DQUFvQztBQUNwQyxNQUFNLENBQUMsTUFBTSxLQUFLLEdBQUcsUUFBUSxDQUFDO0FBQzlCLE1BQU0sQ0FBQyxNQUFNLFFBQVEsR0FBRyxRQUFRLENBQUM7QUFDakMsTUFBTSxDQUFDLE1BQU0sTUFBTSxHQUFHLEtBQUssQ0FBQztBQUM1QixNQUFNLENBQUMsTUFBTSxNQUFNLEdBQUcsU0FBUyxDQUFDO0FBQ2hDLE1BQU0sQ0FBQyxNQUFNLFlBQVksR0FBRyxVQUFVLENBQUM7QUFDdkMsTUFBTSxDQUFDLE1BQU0sUUFBUSxHQUFHLE9BQU8sQ0FBQztBQUNoQyxNQUFNLENBQUMsTUFBTSxhQUFhLEdBQUcsaUJBQWlCLENBQUM7QUFDL0M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V0UUZ1bmNzID0gKGRvY3VtZW50OiBEb2N1bWVudCwgaGFzaDogc3RyaW5nKTogRnVuY3Rpb25bXSA9PiB7XG4gIHJldHVybiAoZG9jdW1lbnQgYXMgYW55KVtRRnVuY3NQcmVmaXggKyBoYXNoXSB8fCBbXTtcbn07XG5cbmV4cG9ydCBjb25zdCBRTG9jYWxlQXR0ciA9ICdxOmxvY2FsZSc7XG5leHBvcnQgY29uc3QgUUNvbnRhaW5lckF0dHIgPSAncTpjb250YWluZXInO1xuXG5leHBvcnQgY29uc3QgUUNvbnRhaW5lclNlbGVjdG9yID0gJ1txXFxcXDpjb250YWluZXJdJztcblxuZXhwb3J0IGNvbnN0IFJlc291cmNlRXZlbnQgPSAncVJlc291cmNlJztcbmV4cG9ydCBjb25zdCBDb21wdXRlZEV2ZW50ID0gJ3FDb21wdXRlZCc7XG5leHBvcnQgY29uc3QgUmVuZGVyRXZlbnQgPSAncVJlbmRlcic7XG5leHBvcnQgY29uc3QgVGFza0V2ZW50ID0gJ3FUYXNrJztcblxuLyoqIGA8cTpzbG90IG5hbWU9XCIuLi5cIj5gICovXG5leHBvcnQgY29uc3QgUVNsb3RJbmVydE5hbWUgPSAnXFx1MDAwMCc7XG5cbmV4cG9ydCBjb25zdCBFTEVNRU5UX0lEID0gJ3E6aWQnO1xuZXhwb3J0IGNvbnN0IEVMRU1FTlRfSURfU0VMRUNUT1IgPSAnW3FcXFxcOmlkXSc7XG5leHBvcnQgY29uc3QgRUxFTUVOVF9JRF9QUkVGSVggPSAnIyc7XG5leHBvcnQgY29uc3QgSU5MSU5FX0ZOX1BSRUZJWCA9ICdAJztcbiJdfQ==","export const QObjectRecursive = 1 << 0;\nexport const QObjectImmutable = 1 << 1;\nexport const QOjectTargetSymbol = Symbol('proxy target');\nexport const QObjectFlagsSymbol = Symbol('proxy flags');\nexport const QObjectManagerSymbol = Symbol('proxy manager');\n/** @internal */\nexport const _IMMUTABLE = Symbol('IMMUTABLE');\nexport const _IMMUTABLE_PREFIX = '$$';\n/**\n * @internal\n * Key for the virtual element stored on qv comments\n */\nexport const VIRTUAL_SYMBOL = '__virtual';\n/**\n * @internal\n * Key for the `QContext` object stored on QwikElements\n */\nexport const Q_CTX = '_qc_';\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uc3RhbnRzLmpzIiwic291cmNlUm9vdCI6Ii4vIiwic291cmNlcyI6WyJwYWNrYWdlcy9xd2lrL3NyYy9jb3JlL3N0YXRlL2NvbnN0YW50cy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLENBQUMsTUFBTSxnQkFBZ0IsR0FBRyxDQUFDLElBQUksQ0FBQyxDQUFDO0FBQ3ZDLE1BQU0sQ0FBQyxNQUFNLGdCQUFnQixHQUFHLENBQUMsSUFBSSxDQUFDLENBQUM7QUFFdkMsTUFBTSxDQUFDLE1BQU0sa0JBQWtCLEdBQUcsTUFBTSxDQUFDLGNBQWMsQ0FBQyxDQUFDO0FBQ3pELE1BQU0sQ0FBQyxNQUFNLGtCQUFrQixHQUFHLE1BQU0sQ0FBQyxhQUFhLENBQUMsQ0FBQztBQUN4RCxNQUFNLENBQUMsTUFBTSxvQkFBb0IsR0FBRyxNQUFNLENBQUMsZUFBZSxDQUFDLENBQUM7QUFFNUQsZ0JBQWdCO0FBQ2hCLE1BQU0sQ0FBQyxNQUFNLFVBQVUsR0FBRyxNQUFNLENBQUMsV0FBVyxDQUFDLENBQUM7QUFFOUMsTUFBTSxDQUFDLE1BQU0saUJBQWlCLEdBQUcsSUFBSSxDQUFDO0FBRXRDOzs7R0FHRztBQUNILE1BQU0sQ0FBQyxNQUFNLGNBQWMsR0FBRyxXQUFXLENBQUM7QUFDMUM7OztHQUdHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sS0FBSyxHQUFHLE1BQU0sQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBjb25zdCBRT2JqZWN0UmVjdXJzaXZlID0gMSA8PCAwO1xuZXhwb3J0IGNvbnN0IFFPYmplY3RJbW11dGFibGUgPSAxIDw8IDE7XG5cbmV4cG9ydCBjb25zdCBRT2plY3RUYXJnZXRTeW1ib2wgPSBTeW1ib2woJ3Byb3h5IHRhcmdldCcpO1xuZXhwb3J0IGNvbnN0IFFPYmplY3RGbGFnc1N5bWJvbCA9IFN5bWJvbCgncHJveHkgZmxhZ3MnKTtcbmV4cG9ydCBjb25zdCBRT2JqZWN0TWFuYWdlclN5bWJvbCA9IFN5bWJvbCgncHJveHkgbWFuYWdlcicpO1xuXG4vKiogQGludGVybmFsICovXG5leHBvcnQgY29uc3QgX0lNTVVUQUJMRSA9IFN5bWJvbCgnSU1NVVRBQkxFJyk7XG5cbmV4cG9ydCBjb25zdCBfSU1NVVRBQkxFX1BSRUZJWCA9ICckJCc7XG5cbi8qKlxuICogQGludGVybmFsXG4gKiBLZXkgZm9yIHRoZSB2aXJ0dWFsIGVsZW1lbnQgc3RvcmVkIG9uIHF2IGNvbW1lbnRzXG4gKi9cbmV4cG9ydCBjb25zdCBWSVJUVUFMX1NZTUJPTCA9ICdfX3ZpcnR1YWwnO1xuLyoqXG4gKiBAaW50ZXJuYWxcbiAqIEtleSBmb3IgdGhlIGBRQ29udGV4dGAgb2JqZWN0IHN0b3JlZCBvbiBRd2lrRWxlbWVudHNcbiAqL1xuZXhwb3J0IGNvbnN0IFFfQ1RYID0gJ19xY18nO1xuIl19","export const directSetAttribute = (el, prop, value) => {\n return el.setAttribute(prop, value);\n};\nexport const directGetAttribute = (el, prop) => {\n return el.getAttribute(prop);\n};\nexport const directRemoveAttribute = (el, prop) => {\n return el.removeAttribute(prop);\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFzdC1jYWxscy5qcyIsInNvdXJjZVJvb3QiOiIuLyIsInNvdXJjZXMiOlsicGFja2FnZXMvcXdpay9zcmMvY29yZS9yZW5kZXIvZmFzdC1jYWxscy50cy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HByb3A6IHN0cmluZykgPT4ge1xuICByZXR1cm4gZWwucmVtb3ZlQXR0cmlidXRlKHByb3ApO1xufTtcbiJdfQ==","export const fromCamelToKebabCase = (text) => {\n return text.replace(/([A-Z])/g, '-$1').toLowerCase();\n};\nexport const fromKebabToCamelCase = (text) => {\n return text.replace(/-./g, (x) => x[1].toUpperCase());\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FzZS5qcyIsInNvdXJjZVJvb3QiOiIuLyIsInNvdXJjZXMiOlsicGFja2FnZXMvcXdpay9zcmMvY29yZS91dGlsL2Nhc2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsTUFBTSxDQUFDLE1BQU0sb0JBQW9CLEdBQUcsQ0FBQyxJQUFZLEVBQVUsRUFBRTtJQUMzRCxPQUFPLElBQUksQ0FBQyxPQUFPLENBQUMsVUFBVSxFQUFFLEtBQUssQ0FBQyxDQUFDLFdBQVcsRUFBRSxDQUFDO0FBQ3ZELENBQUMsQ0FBQztBQUVGLE1BQU0sQ0FBQyxNQUFNLG9CQUFvQixHQUFHLENBQUMsSUFBWSxFQUFVLEVBQUU7SUFDM0QsT0FBTyxJQUFJLENBQUMsT0FBTyxDQUFDLEtBQUssRUFBRSxDQUFDLENBQUMsRUFBRSxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLFdBQVcsRUFBRSxDQUFDLENBQUM7QUFDeEQsQ0FBQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGNvbnN0IGZyb21DYW1lbFRvS2ViYWJDYXNlID0gKHRleHQ6IHN0cmluZyk6IHN0cmluZyA9PiB7XG4gIHJldHVybiB0ZXh0LnJlcGxhY2UoLyhbQS1aXSkvZywgJy0kMScpLnRvTG93ZXJDYXNlKCk7XG59O1xuXG5leHBvcnQgY29uc3QgZnJvbUtlYmFiVG9DYW1lbENhc2UgPSAodGV4dDogc3RyaW5nKTogc3RyaW5nID0+IHtcbiAgcmV0dXJuIHRleHQucmVwbGFjZSgvLS4vZywgKHgpID0+IHhbMV0udG9VcHBlckNhc2UoKSk7XG59O1xuIl19","import { inflateQrl, parseQRL } from '../qrl/qrl';\nimport { assertQrl, isQrl } from '../qrl/qrl-class';\nimport { $ } from '../qrl/qrl.public';\nimport { isArray } from '../util/types';\nimport { assertTrue } from '../error/assert';\nimport { EMPTY_ARRAY } from '../util/flyweight';\nimport { qRuntimeQrl, qSerialize } from '../util/qdev';\nimport { fromCamelToKebabCase } from '../util/case';\nconst ON_PROP_REGEX = /^(on|window:|document:)/;\nexport const PREVENT_DEFAULT = 'preventdefault:';\nexport const isOnProp = (prop) => {\n return prop.endsWith('$') && ON_PROP_REGEX.test(prop);\n};\nexport const groupListeners = (listeners) => {\n if (listeners.length === 0) {\n return EMPTY_ARRAY;\n }\n if (listeners.length === 1) {\n const listener = listeners[0];\n return [[listener[0], [listener[1]]]];\n }\n const keys = [];\n for (let i = 0; i < listeners.length; i++) {\n const eventName = listeners[i][0];\n if (!keys.includes(eventName)) {\n keys.push(eventName);\n }\n }\n return keys.map((eventName) => {\n return [eventName, listeners.filter((l) => l[0] === eventName).map((a) => a[1])];\n });\n};\nexport const setEvent = (existingListeners, prop, input, containerEl) => {\n assertTrue(prop.endsWith('$'), 'render: event property does not end with $', prop);\n prop = normalizeOnProp(prop.slice(0, -1));\n if (input) {\n if (isArray(input)) {\n const processed = input\n .flat(Infinity)\n .filter((q) => q != null)\n .map((q) => [prop, ensureQrl(q, containerEl)]);\n existingListeners.push(...processed);\n }\n else {\n existingListeners.push([prop, ensureQrl(input, containerEl)]);\n }\n }\n return prop;\n};\nconst PREFIXES = ['on', 'window:on', 'document:on'];\nconst SCOPED = ['on', 'on-window', 'on-document'];\nexport const normalizeOnProp = (prop) => {\n let scope = 'on';\n for (let i = 0; i < PREFIXES.length; i++) {\n const prefix = PREFIXES[i];\n if (prop.startsWith(prefix)) {\n scope = SCOPED[i];\n prop = prop.slice(prefix.length);\n break;\n }\n }\n if (prop.startsWith('-')) {\n prop = fromCamelToKebabCase(prop.slice(1));\n }\n else {\n prop = prop.toLowerCase();\n }\n return scope + ':' + prop;\n};\nconst ensureQrl = (value, containerEl) => {\n if (qSerialize && !qRuntimeQrl) {\n assertQrl(value);\n value.$setContainer$(containerEl);\n return value;\n }\n const qrl = isQrl(value) ? value : $(value);\n qrl.$setContainer$(containerEl);\n return qrl;\n};\nexport const getDomListeners = (elCtx, containerEl) => {\n const attributes = elCtx.$element$.attributes;\n const listeners = [];\n for (let i = 0; i < attributes.length; i++) {\n const { name, value } = attributes.item(i);\n if (name.startsWith('on:') ||\n name.startsWith('on-window:') ||\n name.startsWith('on-document:')) {\n const urls = value.split('\\n');\n for (const url of urls) {\n const qrl = parseQRL(url, containerEl);\n if (qrl.$capture$) {\n inflateQrl(qrl, elCtx);\n }\n listeners.push([name, qrl]);\n }\n }\n }\n return listeners;\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGlzdGVuZXJzLmpzIiwic291cmNlUm9vdCI6Ii4vIiwic291cmNlcyI6WyJwYWNrYWdlcy9xd2lrL3NyYy9jb3JlL3N0YXRlL2xpc3RlbmVycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLFFBQVEsRUFBRSxNQUFNLFlBQVksQ0FBQztBQUNsRCxPQUFPLEVBQUUsU0FBUyxFQUFFLEtBQUssRUFBb0IsTUFBTSxrQkFBa0IsQ0FBQztBQUN0RSxPQUFPLEVBQUUsQ0FBQyxFQUFFLE1BQU0sbUJBQW1CLENBQUM7QUFDdEMsT0FBTyxFQUFFLE9BQU8sRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUN4QyxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFDN0MsT0FBTyxFQUFFLFdBQVcsRUFBRSxNQUFNL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sgaSA8IGF0dHJpYnV0ZXMubGVuZ3RoOyBpKyspIHtcbiAgICBjb25zdCB7IG5hbWUsIHZhbHVlIH0gPSBhdHRyaWJ1dGVzLml0ZW0oaSkhO1xuICAgIGlmIChcbiAgICAgIG5hbWUuc3RhcnRzV2l0aCgnb246JykgfHxcbiAgICAgIG5hbWUuc3RhcnRzV2l0aCgnb24td2luZG93OicpIHx8XG4gICAgICBuYW1lLnN0YXJ0c1dpdGgoJ29uLWRvY3VtZW50OicpXG4gICAgKSB7XG4gICAgICBjb25zdCB1cmxzID0gdmFsdWUuc3BsaXQoJ1xcbicpO1xuICAgICAgZm9yIChjb25zdCB1cmwgb2YgdXJscykge1xuICAgICAgICBjb25zdCBxcmwgPSBwYXJzZVFSTCh1cmwsIGNvbnRhaW5lckVsKSBhcyBMaXN0ZW5lclsxXTtcbiAgICAgICAgaWYgKHFybC4kY2FwdHVyZSQpIHtcbiAgICAgICAgICBpbmZsYXRlUXJsKHFybCwgZWxDdHgpO1xuICAgICAgICB9XG4gICAgICAgIGxpc3RlbmVycy5wdXNoKFtuYW1lLCBxcmxdKTtcbiAgICAgIH1cbiAgICB9XG4gIH1cbiAgcmV0dXJuIGxpc3RlbmVycztcbn07XG4iXX0=","import { assertQrl } from '../qrl/qrl-class';\nimport { getContext, HOST_FLAG_NEED_ATTACH_LISTENER } from '../state/context';\nimport { normalizeOnProp } from '../state/listeners';\nimport { useInvokeContext } from './use-core';\nimport {} from '../render/jsx/types/jsx-qwik-events';\n// \n// !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n// (edit ../readme.md#useOn instead)\n/**\n * Register a listener on the current component's host element.\n *\n * Used to programmatically add event listeners. Useful from custom `use*` methods, which do not\n * have access to the JSX. Otherwise, it's adding a JSX listener in the `
` is a better idea.\n *\n * @public\n * @see `useOn`, `useOnWindow`, `useOnDocument`.\n */\n// \nexport const useOn = (event, eventQrl) => {\n _useOn(createEventName(event, undefined), eventQrl);\n};\n// \n// !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n// (edit ../readme.md#useOnDocument instead)\n/**\n * Register a listener on `document`.\n *\n * Used to programmatically add event listeners. Useful from custom `use*` methods, which do not\n * have access to the JSX.\n *\n * @public\n * @see `useOn`, `useOnWindow`, `useOnDocument`.\n *\n * ```tsx\n * function useScroll() {\n * useOnDocument(\n * 'scroll',\n * $((event) => {\n * console.log('body scrolled', event);\n * })\n * );\n * }\n *\n * const Cmp = component$(() => {\n * useScroll();\n * return
Profit!
;\n * });\n * ```\n */\n//
\nexport const useOnDocument = (event, eventQrl) => {\n _useOn(createEventName(event, 'document'), eventQrl);\n};\n// \n// !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n// (edit ../readme.md#useOnWindow instead)\n/**\n * Register a listener on `window`.\n *\n * Used to programmatically add event listeners. Useful from custom `use*` methods, which do not\n * have access to the JSX.\n *\n * @public\n * @see `useOn`, `useOnWindow`, `useOnDocument`.\n *\n * ```tsx\n * function useAnalytics() {\n * useOnWindow(\n * 'popstate',\n * $((event) => {\n * console.log('navigation happened', event);\n * // report to analytics\n * })\n * );\n * }\n *\n * const Cmp = component$(() => {\n * useAnalytics();\n * return
Profit!
;\n * });\n * ```\n */\n//
\nexport const useOnWindow = (event, eventQrl) => {\n _useOn(createEventName(event, 'window'), eventQrl);\n};\nconst createEventName = (event, eventType) => {\n const formattedEventType = eventType !== undefined ? eventType + ':' : '';\n const res = Array.isArray(event)\n ? event.map((e) => `${formattedEventType}on-${e}`)\n : `${formattedEventType}on-${event}`;\n return res;\n};\nconst _useOn = (eventName, eventQrl) => {\n if (eventQrl) {\n const invokeCtx = useInvokeContext();\n const elCtx = getContext(invokeCtx.$hostElement$, invokeCtx.$renderCtx$.$static$.$containerState$);\n assertQrl(eventQrl);\n if (typeof eventName === 'string') {\n elCtx.li.push([normalizeOnProp(eventName), eventQrl]);\n }\n else {\n elCtx.li.push(...eventName.map((name) => [normalizeOnProp(name), eventQrl]));\n }\n elCtx.$flags$ |= HOST_FLAG_NEED_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jb250YWluZXJTdGF0ZSRcbiAgICApO1xuICAgIGFzc2VydFFybChldmVudFFybCBhcyBhbnkpO1xuICAgIGlmICh0eXBlb2YgZXZlbnROYW1lID09PSAnc3RyaW5nJykge1xuICAgICAgZWxDdHgubGkucHVzaChbbm9ybWFsaXplT25Qcm9wKGV2ZW50TmFtZSksIGV2ZW50UXJsXSBhcyBMaXN0ZW5lcik7XG4gICAgfSBlbHNlIHtcbiAgICAgIGVsQ3R4LmxpLnB1c2goLi4uZXZlbnROYW1lLm1hcCgobmFtZSkgPT4gW25vcm1hbGl6ZU9uUHJvcChuYW1lKSwgZXZlbnRRcmxdIGFzIExpc3RlbmVyKSk7XG4gICAgfVxuICAgIGVsQ3R4LiRmbGFncyQgfD0gSE9TVF9GTEFHX05FRURfQVRUQUNIX0xJU1RFTkVSO1xuICB9XG59O1xuIl19","import { isBrowser } from '@builder.io/qwik/build';\nimport { qTest } from './qdev';\nexport const emitEvent = (el, eventName, detail, bubbles) => {\n if (!qTest && (isBrowser || typeof CustomEvent === 'function')) {\n if (el) {\n el.dispatchEvent(new CustomEvent(eventName, {\n detail,\n bubbles: bubbles,\n composed: bubbles,\n }));\n }\n }\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXZlbnQuanMiLCJzb3VyY2VSb290IjoiLi8iLCJzb3VyY2VzIjpbInBhY2thZ2VzL3F3aWsvc3JjL2NvcmUvdXRpbC9ldmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFDbkQsT0FBTyxFQUFFLEtBQUssRUFBRSxNQUFNLFFBQVEsQ0FBQztBQUUvQixNQUFNLENBQUMsTUFBTSxTQUFTLEdBQUcsQ0FDdkIsRUFBdUIsRUFDdkIsU0FBaUIsRUFDakIsTUFBVyxFQUNYLE9BQWdCLEVBQ2hCLEVBQUU7SUFDRixJQUFJLENBQUMsS0FBSyxJQUFJLENBQUMsU0FBUyxJQUFJLE9BQU8sV0FBVyxLQUFLLFVBQVUsQ0FBQyxFQUFFLENBQUM7UUFDL0QsSUFBSSxFQUFFLEVBQUUsQ0FBQztZQUNQLEVBQUUsQ0FBQyxhQUFhLENBQ2QsSUFBSSxXQUFXLENBQUMsU0FBUyxFQUFFO2dCQUN6QixNQUFNO2dCQUNOLE9BQU8sRUFBRSxPQUFPO2dCQUNoQixRQUFRLEVBQUUsT0FBTzthQUNsQixDQUFDLENBQ0gsQ0FBQztRQUNKLENBQUM7SUFDSCxDQUFDO0FBQ0gsQ0FBQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgaXNCcm93c2VyIH0gZnJvbSAnQGJ1aWxkZXIuaW8vcXdpay9idWlsZCc7XG5pbXBvcnQgeyBxVGVzdCB9IGZyb20gJy4vcWRldic7XG5cbmV4cG9ydCBjb25zdCBlbWl0RXZlbnQgPSAoXG4gIGVsOiBFbGVtZW50IHwgdW5kZWZpbmVkLFxuICBldmVudE5hbWU6IHN0cmluZyxcbiAgZGV0YWlsOiBhbnksXG4gIGJ1YmJsZXM6IGJvb2xlYW5cbikgPT4ge1xuICBpZiAoIXFUZXN0ICYmIChpc0Jyb3dzZXIgfHwgdHlwZW9mIEN1c3RvbUV2ZW50ID09PSAnZnVuY3Rpb24nKSkge1xuICAgIGlmIChlbCkge1xuICAgICAgZWwuZGlzcGF0Y2hFdmVudChcbiAgICAgICAgbmV3IEN1c3RvbUV2ZW50KGV2ZW50TmFtZSwge1xuICAgICAgICAgIGRldGFpbCxcbiAgICAgICAgICBidWJibGVzOiBidWJibGVzLFxuICAgICAgICAgIGNvbXBvc2VkOiBidWJibGVzLFxuICAgICAgICB9KVxuICAgICAgKTtcbiAgICB9XG4gIH1cbn07XG4iXX0=","import { assertEqual, assertNumber, assertTrue } from '../error/assert';\nimport { qError, QError_immutableProps } from '../error/error';\nimport { tryGetInvokeContext } from '../use/use-core';\nimport { qDev, qSerialize } from '../util/qdev';\nimport { ComputedEvent, RenderEvent, ResourceEvent } from '../util/markers';\nimport { isArray, isObject, isSerializableObject } from '../util/types';\nimport { fastSkipSerialize, LocalSubscriptionManager, unwrapProxy, verifySerializable, } from './common';\nimport { isSignal } from './signal';\nimport { QObjectFlagsSymbol, QObjectImmutable, QObjectManagerSymbol, QObjectRecursive, QOjectTargetSymbol, _IMMUTABLE, _IMMUTABLE_PREFIX, } from './constants';\nimport { logError, logWarn } from '../util/log';\n/** Creates a proxy that notifies of any writes. */\nexport const getOrCreateProxy = (target, containerState, flags = 0) => {\n const proxy = containerState.$proxyMap$.get(target);\n if (proxy) {\n return proxy;\n }\n if (flags !== 0) {\n setObjectFlags(target, flags);\n }\n return createProxy(target, containerState, undefined);\n};\nexport const createProxy = (target, containerState, subs) => {\n assertEqual(unwrapProxy(target), target, 'Unexpected proxy at this location', target);\n assertTrue(!containerState.$proxyMap$.has(target), 'Proxy was already created', target);\n assertTrue(isObject(target), 'Target must be an object');\n assertTrue(isSerializableObject(target) || isArray(target), 'Target must be a serializable object');\n const manager = containerState.$subsManager$.$createManager$(subs);\n const proxy = new Proxy(target, new ReadWriteProxyHandler(containerState, manager));\n containerState.$proxyMap$.set(target, proxy);\n return proxy;\n};\nexport const createPropsState = () => {\n const props = {};\n setObjectFlags(props, QObjectImmutable);\n return props;\n};\nexport const setObjectFlags = (obj, flags) => {\n Object.defineProperty(obj, QObjectFlagsSymbol, { value: flags, enumerable: false });\n};\n/** @internal */\nexport const _restProps = (props, omit) => {\n const rest = {};\n for (const key in props) {\n if (!omit.includes(key)) {\n rest[key] = props[key];\n }\n }\n return rest;\n};\nexport class ReadWriteProxyHandler {\n constructor($containerState$, $manager$) {\n this.$containerState$ = $containerState$;\n this.$manager$ = $manager$;\n }\n deleteProperty(target, prop) {\n if (target[QObjectFlagsSymbol] & QObjectImmutable) {\n throw qError(QError_immutableProps);\n }\n if (typeof prop != 'string' || !delete target[prop]) {\n return false;\n }\n this.$manager$.$notifySubs$(isArray(target) ? undefined : prop);\n return true;\n }\n get(target, prop) {\n if (typeof prop === 'symbol') {\n if (prop === QOjectTargetSymbol) {\n return target;\n }\n if (prop === QObjectManagerSymbol) {\n return this.$manager$;\n }\n return target[prop];\n }\n const flags = target[QObjectFlagsSymbol] ?? 0;\n assertNumber(flags, 'flags must be an number');\n const invokeCtx = tryGetInvokeContext();\n const recursive = (flags & QObjectRecursive) !== 0;\n const immutable = (flags & QObjectImmutable) !== 0;\n const hiddenSignal = target[_IMMUTABLE_PREFIX + prop];\n let subscriber;\n let value;\n if (invokeCtx) {\n subscriber = invokeCtx.$subscriber$;\n }\n if (immutable && (!(prop in target) || immutableValue(target[_IMMUTABLE]?.[prop]))) {\n subscriber = null;\n }\n if (hiddenSignal) {\n assertTrue(isSignal(hiddenSignal), '$$ prop must be a signal');\n value = hiddenSignal.value;\n subscriber = null;\n }\n else {\n value = target[prop];\n }\n if (subscriber) {\n const isA = isArray(target);\n this.$manager$.$addSub$(subscriber, isA ? undefined : prop);\n }\n return recursive ? wrap(value, this.$containerState$) : value;\n }\n set(target, prop, newValue) {\n if (typeof prop === 'symbol') {\n target[prop] = newValue;\n return true;\n }\n const flags = target[QObjectFlagsSymbol] ?? 0;\n assertNumber(flags, 'flags must be an number');\n const immutable = (flags & QObjectImmutable) !== 0;\n if (immutable) {\n throw qError(QError_immutableProps);\n }\n const recursive = (flags & QObjectRecursive) !== 0;\n const unwrappedNewValue = recursive ? unwrapProxy(newValue) : newValue;\n if (qDev) {\n if (qSerialize) {\n verifySerializable(unwrappedNewValue);\n }\n const invokeCtx = tryGetInvokeContext();\n if (invokeCtx) {\n if (invokeCtx.$event$ === RenderEvent) {\n logError('State mutation inside render function. Move mutation to useTask$() or useVisibleTask$()', prop);\n }\n else if (invokeCtx.$event$ === ComputedEvent) {\n logWarn('State mutation inside useComputed$() is an antipattern. Use useTask$() instead', invokeCtx.$hostElement$);\n }\n else if (invokeCtx.$event$ === ResourceEvent) {\n logWarn('State mutation inside useResource$() is an antipattern. Use useTask$() instead', invokeCtx.$hostElement$);\n }\n }\n }\n const isA = isArray(target);\n if (isA) {\n target[prop] = unwrappedNewValue;\n this.$manager$.$notifySubs$();\n return true;\n }\n const oldValue = target[prop];\n target[prop] = unwrappedNewValue;\n if (oldValue !== unwrappedNewValue) {\n this.$manager$.$notifySubs$(prop);\n }\n return true;\n }\n has(target, property) {\n if (property === QOjectTargetSymbol) {\n return true;\n }\n const hasOwnProperty = Object.prototype.hasOwnProperty;\n if (hasOwnProperty.call(target, property)) {\n return true;\n }\n if (typeof property === 'string' && hasOwnProperty.call(target, _IMMUTABLE_PREFIX + property)) {\n return true;\n }\n return false;\n }\n ownKeys(target) {\n const flags = target[QObjectFlagsSymbol] ?? 0;\n assertNumber(flags, 'flags must be an number');\n const immutable = (flags & QObjectImmutable) !== 0;\n if (!immutable) {\n let subscriber = null;\n const invokeCtx = tryGetInvokeContext();\n if (invokeCtx) {\n subscriber = invokeCtx.$subscriber$;\n }\n if (subscriber) {\n this.$manager$.$addSub$(subscriber);\n }\n }\n if (isArray(target)) {\n return Reflect.ownKeys(target);\n }\n return Reflect.ownKeys(target).map((a) => {\n return typeof a === 'string' && a.startsWith(_IMMUTABLE_PREFIX)\n ? a.slice(_IMMUTABLE_PREFIX.length)\n : a;\n });\n }\n getOwnPropertyDescriptor(target, prop) {\n if (isArray(target) || typeof prop === 'symbol') {\n return Object.getOwnPropertyDescriptor(target, prop);\n }\n return {\n enumerable: true,\n configurable: true,\n };\n }\n}\nconst immutableValue = (value) => {\n return value === _IMMUTABLE || isSignal(value);\n};\nconst wrap = (value, containerState) => {\n if (isObject(value)) {\n if (Object.isFrozen(value)) {\n return value;\n }\n const nakedValue = unwrapProxy(value);\n if (nakedValue !== value) {\n // already a proxy return;\n return value;\n }\n if (fastSkipSerialize(nakedValue)) {\n return value;\n }\n if (isSerializableObject(nakedValue) || isArray(nakedValue)) {\n const proxy = containerState.$proxyMap$.get(nakedValue);\n return proxy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bHVlID09PSBfSU1NVVRBQkxFIHx8IGlzU2lnbmFsKHZhbHVlKTtcbn07XG5cbmNvbnN0IHdyYXAgPSA8VD4odmFsdWU6IFQsIGNvbnRhaW5lclN0YXRlOiBDb250YWluZXJTdGF0ZSk6IFQgPT4ge1xuICBpZiAoaXNPYmplY3QodmFsdWUpKSB7XG4gICAgaWYgKE9iamVjdC5pc0Zyb3plbih2YWx1ZSkpIHtcbiAgICAgIHJldHVybiB2YWx1ZTtcbiAgICB9XG4gICAgY29uc3QgbmFrZWRWYWx1ZSA9IHVud3JhcFByb3h5KHZhbHVlKTtcbiAgICBpZiAobmFrZWRWYWx1ZSAhPT0gdmFsdWUpIHtcbiAgICAgIC8vIGFscmVhZHkgYSBwcm94eSByZXR1cm47XG4gICAgICByZXR1cm4gdmFsdWU7XG4gICAgfVxuICAgIGlmIChmYXN0U2tpcFNlcmlhbGl6ZShuYWtlZFZhbHVlKSkge1xuICAgICAgcmV0dXJuIHZhbHVlO1xuICAgIH1cbiAgICBpZiAoaXNTZXJpYWxpemFibGVPYmplY3QobmFrZWRWYWx1ZSkgfHwgaXNBcnJheShuYWtlZFZhbHVlKSkge1xuICAgICAgY29uc3QgcHJveHkgPSBjb250YWluZXJTdGF0ZS4kcHJveHlNYXAkLmdldChuYWtlZFZhbHVlKTtcbiAgICAgIHJldHVybiBwcm94eSA/IHByb3h5IDogZ2V0T3JDcmVhdGVQcm94eShuYWtlZFZhbHVlIGFzIGFueSwgY29udGFpbmVyU3RhdGUsIFFPYmplY3RSZWN1cnNpdmUpO1xuICAgIH1cbiAgfVxuICByZXR1cm4gdmFsdWU7XG59O1xuIl19","import { verifySerializable } from '../state/common';\nimport { getContext } from '../state/context';\nimport { qDev, qSerialize } from '../util/qdev';\nimport { useInvokeContext } from './use-core';\n/**\n * @internal\n * The storage provider for hooks. Each invocation increases index i. Data is stored in an array.\n */\nexport const useSequentialScope = () => {\n const iCtx = useInvokeContext();\n const hostElement = iCtx.$hostElement$;\n const elCtx = getContext(hostElement, iCtx.$renderCtx$.$static$.$containerState$);\n const seq = (elCtx.$seq$ || (elCtx.$seq$ = []));\n const i = iCtx.$i$++;\n const set = (value) => {\n if (qDev && qSerialize) {\n verifySerializable(value);\n }\n return (seq[i] = value);\n };\n return {\n val: seq[i],\n set,\n i,\n iCtx,\n elCtx,\n };\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlLXNlcXVlbnRpYWwtc2NvcGUuanMiLCJzb3VyY2VSb290IjoiLi8iLCJzb3VyY2VzIjpbInBhY2thZ2VzL3F3aWsvc3JjL2NvcmUvdXNlL3VzZS1zZXF1ZW50aWFsLXNjb3BlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxrQkFBa0IsRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBQ3JELE9BQU8sRUFBRSxVQUFVLEVBQWlCLE1BQU0sa0JBQWtCLENBQUM7QUFDN0QsT0FBTyxFQUFFLElBQUksRUFBRSxVQUFVLEVBQUUsTUFBTSxjQUFjLENBQUM7QUFDaEQsT0FBTyxFQUE0QixnQkFBZ0IsRUFBRSxNQUFNLFlBQVksQ0FBQztBQWF4RTs7O0dBR0c7QUFDSCxNQUFNLENBQUMsTUFBTSxrQkFBa0IsR0FBRyxHQUEwQixFQUFFO0lBQzVELE1BQU0sSUFBSSxHQUFHLGdCQUFnQixFQUFFLENBQUM7SUFDaEMsTUFBTSxXQUFXLEdBQUcsSUFBSSxDQUFDLGFBQWEsQ0FBQztJQUN2QyxNQUFNLEtBQUssR0FBRyxVQUFVLENBQUMsV0FBVyxFQUFFLElBQUksQ0FBQyxXQUFXLENBQUMsUUFBUSxDQUFDLGdCQUFnQixDQUFDLENBQUM7SUFDbEYsTUFBTSxHQUFHLEdBQUcsQ0FBQyxLQUFLLENBQUMsS0FBSyxLQUFYLEtBQUssQ0FBQyxLQUFLLEdBQUssRUFBRSxFQUFDLENBQUM7S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cmVhZG9ubHkgc2V0OiAodjogVCkgPT4gVDtcbiAgLyoqIEluZGV4IG9mIHRoZSBob29rICovXG4gIHJlYWRvbmx5IGk6IG51bWJlcjtcbiAgcmVhZG9ubHkgaUN0eDogUmVuZGVySW52b2tlQ29udGV4dDtcbiAgcmVhZG9ubHkgZWxDdHg6IFFDb250ZXh0O1xufVxuXG4vKipcbiAqIEBpbnRlcm5hbFxuICogVGhlIHN0b3JhZ2UgcHJvdmlkZXIgZm9yIGhvb2tzLiBFYWNoIGludm9jYXRpb24gaW5jcmVhc2VzIGluZGV4IGkuIERhdGEgaXMgc3RvcmVkIGluIGFuIGFycmF5LlxuICovXG5leHBvcnQgY29uc3QgdXNlU2VxdWVudGlhbFNjb3BlID0gPFQ+KCk6IFNlcXVlbnRpYWxTY29wZTxUPiA9PiB7XG4gIGNvbnN0IGlDdHggPSB1c2VJbnZva2VDb250ZXh0KCk7XG4gIGNvbnN0IGhvc3RFbGVtZW50ID0gaUN0eC4kaG9zdEVsZW1lbnQkO1xuICBjb25zdCBlbEN0eCA9IGdldENvbnRleHQoaG9zdEVsZW1lbnQsIGlDdHguJHJlbmRlckN0eCQuJHN0YXRpYyQuJGNvbnRhaW5lclN0YXRlJCk7XG4gIGNvbnN0IHNlcSA9IChlbEN0eC4kc2VxJCB8fD0gW10pO1xuICBjb25zdCBpID0gaUN0eC4kaSQrKztcblxuICBjb25zdCBzZXQgPSAodmFsdWU6IFQpID0+IHtcbiAgICBpZiAocURldiAmJiBxU2VyaWFsaXplKSB7XG4gICAgICB2ZXJpZnlTZXJpYWxpemFibGUodmFsdWUpO1xuICAgIH1cbiAgICByZXR1cm4gKHNlcVtpXSA9IHZhbHVlKTtcbiAgfTtcblxuICByZXR1cm4ge1xuICAgIHZhbDogc2VxW2ldLFxuICAgIHNldCxcbiAgICBpLFxuICAgIGlDdHgsXG4gICAgZWxDdHgsXG4gIH07XG59O1xuIl19","import { fromCamelToKebabCase } from '../util/case';\nimport { qError, QError_invalidContext, QError_notFoundContext } from '../error/error';\nimport { qDev, qSerialize } from '../util/qdev';\nimport { isObject } from '../util/types';\nimport { useSequentialScope } from './use-sequential-scope';\nimport { assertTrue } from '../error/assert';\nimport { verifySerializable } from '../state/common';\nimport { getContext } from '../state/context';\nimport { invoke } from './use-core';\nimport { getVirtualElement, } from '../render/dom/virtual-element';\nimport { isComment } from '../util/element';\nimport { Q_CTX, VIRTUAL_SYMBOL } from '../state/constants';\n// \n// !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n// (edit ../readme.md#createContextId instead)\n/**\n * Create a context ID to be used in your application. The name should be written with no spaces.\n *\n * Context is a way to pass stores to the child components without prop-drilling.\n *\n * Use `createContextId()` to create a `ContextId`. A `ContextId` is just a serializable identifier\n * for the context. It is not the context value itself. See `useContextProvider()` and\n * `useContext()` for the values. Qwik needs a serializable ID for the context so that the it can\n * track context providers and consumers in a way that survives resumability.\n *\n * ### Example\n *\n * ```tsx\n * // Declare the Context type.\n * interface TodosStore {\n * items: string[];\n * }\n * // Create a Context ID (no data is saved here.)\n * // You will use this ID to both create and retrieve the Context.\n * export const TodosContext = createContextId('Todos');\n *\n * // Example of providing context to child components.\n * export const App = component$(() => {\n * useContextProvider(\n * TodosContext,\n * useStore({\n * items: ['Learn Qwik', 'Build Qwik app', 'Profit'],\n * })\n * );\n *\n * return ;\n * });\n *\n * // Example of retrieving the context provided by a parent component.\n * export const Items = component$(() => {\n * const todos = useContext(TodosContext);\n * return (\n *
    \n * {todos.items.map((item) => (\n *
  • {item}
  • \n * ))}\n *
\n * );\n * });\n *\n * ```\n *\n * @param name - The name of the context.\n * @public\n */\n//
\nexport const createContextId = (name) => {\n assertTrue(/^[\\w/.-]+$/.test(name), 'Context name must only contain A-Z,a-z,0-9, _', name);\n return /*#__PURE__*/ Object.freeze({\n id: fromCamelToKebabCase(name),\n });\n};\n// \n// !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n// (edit ../readme.md#useContextProvider instead)\n/**\n * Assign a value to a Context.\n *\n * Use `useContextProvider()` to assign a value to a context. The assignment happens in the\n * component's function. Once assigned, use `useContext()` in any child component to retrieve the\n * value.\n *\n * Context is a way to pass stores to the child components without prop-drilling. Note that scalar\n * values are allowed, but for reactivity you need signals or stores.\n *\n * ### Example\n *\n * ```tsx\n * // Declare the Context type.\n * interface TodosStore {\n * items: string[];\n * }\n * // Create a Context ID (no data is saved here.)\n * // You will use this ID to both create and retrieve the Context.\n * export const TodosContext = createContextId('Todos');\n *\n * // Example of providing context to child components.\n * export const App = component$(() => {\n * useContextProvider(\n * TodosContext,\n * useStore({\n * items: ['Learn Qwik', 'Build Qwik app', 'Profit'],\n * })\n * );\n *\n * return ;\n * });\n *\n * // Example of retrieving the context provided by a parent component.\n * export const Items = component$(() => {\n * const todos = useContext(TodosContext);\n * return (\n *
    \n * {todos.items.map((item) => (\n *
  • {item}
  • \n * ))}\n *
\n * );\n * });\n *\n * ```\n *\n * @param context - The context to assign a value to.\n * @param value - The value to assign to the context.\n * @public\n */\n//
\nexport const useContextProvider = (context, newValue) => {\n const { val, set, elCtx } = useSequentialScope();\n if (val !== undefined) {\n return;\n }\n if (qDev) {\n validateContext(context);\n }\n const contexts = (elCtx.$contexts$ || (elCtx.$contexts$ = new Map()));\n if (qDev && qSerialize) {\n verifySerializable(newValue);\n }\n contexts.set(context.id, newValue);\n set(true);\n};\n// \n// !!DO NOT EDIT THIS COMMENT DIRECTLY!!!\n// (edit ../readme.md#useContext instead)\n/**\n * Retrieve Context value.\n *\n * Use `useContext()` to retrieve the value of context in a component. To retrieve a value a parent\n * component needs to invoke `useContextProvider()` to assign a value.\n *\n * ### Example\n *\n * ```tsx\n * // Declare the Context type.\n * interface TodosStore {\n * items: string[];\n * }\n * // Create a Context ID (no data is saved here.)\n * // You will use this ID to both create and retrieve the Context.\n * export const TodosContext = createContextId('Todos');\n *\n * // Example of providing context to child components.\n * export const App = component$(() => {\n * useContextProvider(\n * TodosContext,\n * useStore({\n * items: ['Learn Qwik', 'Build Qwik app', 'Profit'],\n * })\n * );\n *\n * return ;\n * });\n *\n * // Example of retrieving the context provided by a parent component.\n * export const Items = component$(() => {\n * const todos = useContext(TodosContext);\n * return (\n *
    \n * {todos.items.map((item) => (\n *
  • {item}
  • \n * ))}\n *
\n * );\n * });\n *\n * ```\n *\n * @param context - The context to retrieve a value from.\n * @public\n */\n//
\nexport const useContext = (context, defaultValue) => {\n const { val, set, iCtx, elCtx } = useSequentialScope();\n if (val !== undefined) {\n return val;\n }\n if (qDev) {\n validateContext(context);\n }\n const value = resolveContext(context, elCtx, iCtx.$renderCtx$.$static$.$containerState$);\n if (typeof defaultValue === 'function') {\n return set(invoke(undefined, defaultValue, value));\n }\n if (value !== undefined) {\n return set(value);\n }\n if (defaultValue !== undefined) {\n return set(defaultValue);\n }\n throw qError(QError_notFoundContext, context.id);\n};\n/** Find a wrapping Virtual component in the DOM */\nconst findParentCtx = (el, containerState) => {\n let node = el;\n let stack = 1;\n while (node && !node.hasAttribute?.('q:container')) {\n // Walk the siblings backwards, each comment might be the Virtual wrapper component\n while ((node = node.previousSibling)) {\n if (isComment(node)) {\n const virtual = node[VIRTUAL_SYMBOL];\n if (virtual) {\n const qtx = virtual[Q_CTX];\n if (node === virtual.open) {\n // We started inside this node so this is our parent\n return qtx ?? getContext(virtual, containerState);\n }\n // This is a sibling, check if it knows our parent\n if (qtx?.$parentCtx$) {\n return qtx.$parentCtx$;\n }\n // Skip over this entire virtual sibling\n node = virtual;\n continue;\n }\n if (node.data === '/qv') {\n stack++;\n }\n else if (node.data.startsWith('qv ')) {\n stack--;\n if (stack === 0) {\n return getContext(getVirtualElement(node), containerState);\n }\n }\n }\n }\n // No more siblings, walk up the DOM tree. The parent will never be a Virtual component.\n node = el.parentElement;\n el = node;\n }\n return null;\n};\nconst getParentProvider = (ctx, containerState) => {\n // `null` means there's no parent, `undefined` means we don't know yet.\n if (ctx.$parentCtx$ === undefined) {\n // Not fully resumed container, find context from DOM\n // We cannot recover $realParentCtx$ from this but that's fine because we don't need to pause on the client\n ctx.$parentCtx$ = findParentCtx(ctx.$element$, containerState);\n }\n /**\n * Note, the parentCtx is used during pause to to get the immediate parent, so we can't shortcut\n * the search for $contexts$ here. If that turns out to be needed, it needs to be cached in a\n * separate property.\n */\n return ctx.$parentCtx$;\n};\nexport const resolveContext = (context, hostCtx, containerState) => {\n const contextID = context.id;\n if (!hostCtx) {\n return;\n }\n let ctx = hostCtx;\n while (ctx) {\n const found = ctx.$contexts$?.get(contextID);\n if (found) {\n return found;\n }\n ctx = getParentProvider(ctx, containerState);\n }\n};\nexport const validateContext = (context) => {\n if (!isObject(context) || typeof context.id !== 'string' || context.id.length === 0) {\n throw qError(QError_invalidContext, context);\n }\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlLWNvbnRleHQuanMiLCJzb3VyY2VSb290IjoiLi8iLCJzb3VyY2VzIjpbInBhY2thZ2VzL3F3aWsvc3JjL2NvcmUvdXNlL3VzZS1jb250ZXh0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxvQkFBb0IsRUFBRSxNQUFNLGNBQWMsQ0FBQztBQUNwRCxPQUFPLEVBQUUsTUFBTSxFQUFFLHFCQUFxQixFQUFFLHNCQUFzQixFQUFFLE1BQU0sZ0JBQWdCLENBQUM7QUFDdkYsT0FBTyxFQUFFLElBQUksRUFBRSxVQUFVLEVBQUUsTUFBTSxjQUFjLENBQUM7QUFDaEQsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUN6QyxPQUFPLEVBQUUsa0JBQWtCLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUM1RCxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFDN0MsT0FBTyxFQUFFLGtCQUFrQixFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFDckQsT0FBTyxFQUFFLFVBQVUsRUFBaUI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cnR1YWwpIHtcbiAgICAgICAgICBjb25zdCBxdHggPSAodmlydHVhbCBhcyBhbnkpW1FfQ1RYXSBhcyBRQ29udGV4dCB8IHVuZGVmaW5lZDtcbiAgICAgICAgICBpZiAobm9kZSA9PT0gdmlydHVhbC5vcGVuKSB7XG4gICAgICAgICAgICAvLyBXZSBzdGFydGVkIGluc2lkZSB0aGlzIG5vZGUgc28gdGhpcyBpcyBvdXIgcGFyZW50XG4gICAgICAgICAgICByZXR1cm4gcXR4ID8/IGdldENvbnRleHQodmlydHVhbCwgY29udGFpbmVyU3RhdGUpO1xuICAgICAgICAgIH1cbiAgICAgICAgICAvLyBUaGlzIGlzIGEgc2libGluZywgY2hlY2sgaWYgaXQga25vd3Mgb3VyIHBhcmVudFxuICAgICAgICAgIGlmIChxdHg/LiRwYXJlbnRDdHgkKSB7XG4gICAgICAgICAgICByZXR1cm4gcXR4LiRwYXJlbnRDdHgkO1xuICAgICAgICAgIH1cbiAgICAgICAgICAvLyBTa2lwIG92ZXIgdGhpcyBlbnRpcmUgdmlydHVhbCBzaWJsaW5nXG4gICAgICAgICAgbm9kZSA9IHZpcnR1YWw7XG4gICAgICAgICAgY29udGludWU7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG5vZGUuZGF0YSA9PT0gJy9xdicpIHtcbiAgICAgICAgICBzdGFjaysrO1xuICAgICAgICB9IGVsc2UgaWYgKG5vZGUuZGF0YS5zdGFydHNXaXRoKCdxdiAnKSkge1xuICAgICAgICAgIHN0YWNrLS07XG4gICAgICAgICAgaWYgKHN0YWNrID09PSAwKSB7XG4gICAgICAgICAgICByZXR1cm4gZ2V0Q29udGV4dChnZXRWaXJ0dWFsRWxlbWVudChub2RlKSEsIGNvbnRhaW5lclN0YXRlKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG4gICAgLy8gTm8gbW9yZSBzaWJsaW5ncywgd2FsayB1cCB0aGUgRE9NIHRyZWUuIFRoZSBwYXJlbnQg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LiRwYXJlbnRDdHgkO1xufTtcblxuZXhwb3J0IGNvbnN0IHJlc29sdmVDb250ZXh0ID0gPFNUQVRFPihcbiAgY29udGV4dDogQ29udGV4dElkPFNUQVRFPixcbiAgaG9zdEN0eDogUUNvbnRleHQsXG4gIGNvbnRhaW5lclN0YXRlOiBDb250YWluZXJTdGF0ZVxuKTogU1RBVEUgfCB1bmRlZmluZWQgPT4ge1xuICBjb25zdCBjb250ZXh0SUQgPSBjb250ZXh0LmlkO1xuICBpZiAoIWhvc3RDdHgpIHtcbiAgICByZXR1cm47XG4gIH1cbiAgbGV0IGN0eCA9IGhvc3RDdHg7XG4gIHdoaWxlIChjdHgpIHtcbiAgICBjb25zdCBmb3VuZCA9IGN0eC4kY29udGV4dHMkPy5nZXQoY29udGV4dElEKTtcbiAgICBpZiAoZm91bmQpIHtcbiAgICAgIHJldHVybiBmb3VuZDtcbiAgICB9XG4gICAgY3R4ID0gZ2V0UGFyZW50UHJvdmlkZXIoY3R4LCBjb250YWluZXJTdGF0ZSkhO1xuICB9XG59O1xuXG5leHBvcnQgY29uc3QgdmFsaWRhdGVDb250ZXh0ID0gKGNvbnRleHQ6IENvbnRleHRJZDxhbnk+KSA9PiB7XG4gIGlmICghaXNPYmplY3QoY29udGV4dCkgfHwgdHlwZW9mIGNvbnRleHQuaWQgIT09ICdzdHJpbmcnIHx8IGNvbnRleHQuaWQubGVuZ3RoID09PSAwKSB7XG4gICAgdGhyb3cgcUVycm9yKFFFcnJvcl9pbnZhbGlkQ29udGV4dCwgY29udGV4dCk7XG4gIH1cbn07XG4iXX0=","import { isServerPlatform } from '../platform/platform';\nimport { tryGetContext } from '../state/context';\nimport { createContextId, resolveContext } from '../use/use-context';\nimport { isVirtualElement } from '../util/element';\nimport { qDev } from '../util/qdev';\nexport const ERROR_CONTEXT = /*#__PURE__*/ createContextId('qk-error');\nexport const handleError = (err, hostElement, rCtx) => {\n const elCtx = tryGetContext(hostElement);\n if (qDev) {\n // Clean vdom\n if (!isServerPlatform() && typeof document !== 'undefined' && isVirtualElement(hostElement)) {\n // (hostElement as any).$vdom$ = null;\n elCtx.$vdom$ = null;\n const errorDiv = document.createElement('errored-host');\n if (err && err instanceof Error) {\n errorDiv.props = { error: err };\n }\n errorDiv.setAttribute('q:key', '_error_');\n errorDiv.append(...hostElement.childNodes);\n hostElement.appendChild(errorDiv);\n }\n if (err && err instanceof Error) {\n if (!('hostElement' in err)) {\n err['hostElement'] = hostElement;\n }\n }\n if (!isRecoverable(err)) {\n throw err;\n }\n }\n if (isServerPlatform()) {\n throw err;\n }\n else {\n const errorStore = resolveContext(ERROR_CONTEXT, elCtx, rCtx.$static$.$containerState$);\n if (errorStore === undefined) {\n throw err;\n }\n errorStore.error = err;\n }\n};\nconst isRecoverable = (err) => {\n if (err && err instanceof Error) {\n if ('plugin' in err) {\n return false;\n }\n }\n return true;\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXJyb3ItaGFuZGxpbmcuanMiLCJzb3VyY2VSb290IjoiLi8iLCJzb3VyY2VzIjpbInBhY2thZ2VzL3F3aWsvc3JjL2NvcmUvcmVuZGVyL2Vycm9yLWhhbmRsaW5nLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLHNCQUFzQixDQUFDO0FBQ3hELE9BQU8sRUFBRSxhQUFhLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQztBQUNqRCxPQUFPLEVBQUUsZUFBZSxFQUFFLGNBQWMsRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBQ3JFLE9BQU8sRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBQ25ELE9BQU8sRUFBRSxJQUFJLEVBQUUsTUFBTSxjQUFjLENBQUM7QUFTcEMsTUFBTSxDQUFDLE1BQU0sYUFBYSxHQUFHLGFBQWEsQ0FBQyxlQUFlLENBQXFCLF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iB0cnVlO1xufTtcbiJdfQ==","/** CSS properties which accept numbers but are not in units of \"px\". */\nconst unitlessNumbers = new Set([\n 'animationIterationCount',\n 'aspectRatio',\n 'borderImageOutset',\n 'borderImageSlice',\n 'borderImageWidth',\n 'boxFlex',\n 'boxFlexGroup',\n 'boxOrdinalGroup',\n 'columnCount',\n 'columns',\n 'flex',\n 'flexGrow',\n 'flexShrink',\n 'gridArea',\n 'gridRow',\n 'gridRowEnd',\n 'gridRowStart',\n 'gridColumn',\n 'gridColumnEnd',\n 'gridColumnStart',\n 'fontWeight',\n 'lineClamp',\n 'lineHeight',\n 'opacity',\n 'order',\n 'orphans',\n 'scale',\n 'tabSize',\n 'widows',\n 'zIndex',\n 'zoom',\n 'MozAnimationIterationCount', // Known Prefixed Properties\n 'MozBoxFlex', // TODO: Remove these since they shouldn't be used in modern code\n 'msFlex',\n 'msFlexPositive',\n 'WebkitAnimationIterationCount',\n 'WebkitBoxFlex',\n 'WebkitBoxOrdinalGroup',\n 'WebkitColumnCount',\n 'WebkitColumns',\n 'WebkitFlex',\n 'WebkitFlexGrow',\n 'WebkitFlexShrink',\n 'WebkitLineClamp',\n]);\nexport const isUnitlessNumber = (name) => {\n return unitlessNumbers.has(name);\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidW5pdGxlc3NfbnVtYmVyLmpzIiwic291cmNlUm9vdCI6Ii4vIiwic291cmNlcyI6WyJwYWNrYWdlcy9xd2lrL3NyYy9jb3JlL3V0aWwvdW5pdGxlc3NfbnVtYmVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLHdFQUF3RTtBQUN4RSxNQUFNLGVBQWUsR0FBRyxJQUFJLEdBQUcsQ0FBQztJQUM5Qix5QkFBeUI7SUFDekIsYUFBYTtJQUNiLG1CQUFtQjtJQUNuQixrQkFBa0I7SUFDbEIsa0JBQWtCO0lBQ2xCLFNBQVM7SUFDVCxjQUFjO0lBQ2QsaU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b3J0IGNvbnN0IGlzVW5pdGxlc3NOdW1iZXIgPSAobmFtZTogc3RyaW5nKTogYm9vbGVhbiA9PiB7XG4gIHJldHVybiB1bml0bGVzc051bWJlcnMuaGFzKG5hbWUpO1xufTtcbiJdfQ==","import { assertDefined } from '../error/assert';\nimport { RenderEvent } from '../util/markers';\nimport { maybeThen, promiseAllLazy, safeCall } from '../util/promises';\nimport { newInvokeContext } from '../use/use-core';\nimport { isArray, isFunction, isString } from '../util/types';\nimport { intToStr } from '../container/container';\nimport { fromCamelToKebabCase } from '../util/case';\nimport { qError, QError_stringifyClassOrStyle } from '../error/error';\nimport { seal } from '../util/qdev';\nimport { SkipRender } from './jsx/utils.public';\nimport { handleError } from './error-handling';\nimport { HOST_FLAG_DIRTY, HOST_FLAG_MOUNTED } from '../state/context';\nimport { isSignal, SignalUnassignedException } from '../state/signal';\nimport { isJSXNode } from './jsx/jsx-runtime';\nimport { isUnitlessNumber } from '../util/unitless_number';\nimport { isServerPlatform } from '../platform/platform';\nimport { executeSSRTasks } from './dom/notify-render';\nimport { logWarn } from '../util/log';\nexport const executeComponent = (rCtx, elCtx, attempt) => {\n elCtx.$flags$ &= ~HOST_FLAG_DIRTY;\n elCtx.$flags$ |= HOST_FLAG_MOUNTED;\n elCtx.$slots$ = [];\n elCtx.li.length = 0;\n const hostElement = elCtx.$element$;\n const componentQRL = elCtx.$componentQrl$;\n const props = elCtx.$props$;\n const iCtx = newInvokeContext(rCtx.$static$.$locale$, hostElement, undefined, RenderEvent);\n const waitOn = (iCtx.$waitOn$ = []);\n assertDefined(componentQRL, `render: host element to render must have a $renderQrl$:`, elCtx);\n assertDefined(props, `render: host element to render must have defined props`, elCtx);\n // Set component context\n const newCtx = pushRenderContext(rCtx);\n newCtx.$cmpCtx$ = elCtx;\n newCtx.$slotCtx$ = undefined;\n // Invoke render hook\n iCtx.$subscriber$ = [0, hostElement];\n iCtx.$renderCtx$ = rCtx;\n // Resolve render function\n componentQRL.$setContainer$(rCtx.$static$.$containerState$.$containerEl$);\n const componentFn = componentQRL.getFn(iCtx);\n return safeCall(() => componentFn(props), (jsxNode) => {\n return maybeThen(isServerPlatform()\n ? maybeThen(promiseAllLazy(waitOn), () => \n // Run dirty tasks before SSR output is generated.\n maybeThen(executeSSRTasks(rCtx.$static$.$containerState$, rCtx), () => promiseAllLazy(waitOn)))\n : promiseAllLazy(waitOn), () => {\n if (elCtx.$flags$ & HOST_FLAG_DIRTY) {\n if (attempt && attempt > 100) {\n logWarn(`Infinite loop detected. Element: ${elCtx.$componentQrl$?.$symbol$}`);\n }\n else {\n return executeComponent(rCtx, elCtx, attempt ? attempt + 1 : 1);\n }\n }\n return {\n node: jsxNode,\n rCtx: newCtx,\n };\n });\n }, (err) => {\n if (err === SignalUnassignedException) {\n if (attempt && attempt > 100) {\n logWarn(`Infinite loop detected. Element: ${elCtx.$componentQrl$?.$symbol$}`);\n }\n else {\n return maybeThen(promiseAllLazy(waitOn), () => {\n return executeComponent(rCtx, elCtx, attempt ? attempt + 1 : 1);\n });\n }\n }\n handleError(err, hostElement, rCtx);\n return {\n node: SkipRender,\n rCtx: newCtx,\n };\n });\n};\nexport const createRenderContext = (doc, containerState) => {\n const ctx = {\n $static$: {\n $doc$: doc,\n $locale$: containerState.$serverData$.locale,\n $containerState$: containerState,\n $hostElements$: new Set(),\n $operations$: [],\n $postOperations$: [],\n $roots$: [],\n $addSlots$: [],\n $rmSlots$: [],\n $visited$: [],\n },\n $cmpCtx$: null,\n $slotCtx$: undefined,\n };\n seal(ctx);\n seal(ctx.$static$);\n return ctx;\n};\nexport const pushRenderContext = (ctx) => {\n const newCtx = {\n $static$: ctx.$static$,\n $cmpCtx$: ctx.$cmpCtx$,\n $slotCtx$: ctx.$slotCtx$,\n };\n return newCtx;\n};\nexport const serializeClassWithHost = (obj, hostCtx) => {\n if (hostCtx?.$scopeIds$?.length) {\n return hostCtx.$scopeIds$.join(' ') + ' ' + serializeClass(obj);\n }\n return serializeClass(obj);\n};\nexport const serializeClass = (obj) => {\n if (!obj) {\n return '';\n }\n if (isString(obj)) {\n return obj.trim();\n }\n const classes = [];\n if (isArray(obj)) {\n for (const o of obj) {\n const classList = serializeClass(o);\n if (classList) {\n classes.push(classList);\n }\n }\n }\n else {\n for (const [key, value] of Object.entries(obj)) {\n if (value) {\n classes.push(key.trim());\n }\n }\n }\n return classes.join(' ');\n};\nexport const stringifyStyle = (obj) => {\n if (obj == null) {\n return '';\n }\n if (typeof obj == 'object') {\n if (isArray(obj)) {\n throw qError(QError_stringifyClassOrStyle, obj, 'style');\n }\n else {\n const chunks = [];\n for (const key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n const value = obj[key];\n if (value != null) {\n if (key.startsWith('--')) {\n chunks.push(key + ':' + value);\n }\n else {\n chunks.push(fromCamelToKebabCase(key) + ':' + setValueForStyle(key, value));\n }\n }\n }\n }\n return chunks.join(';');\n }\n }\n return String(obj);\n};\nconst setValueForStyle = (styleName, value) => {\n if (typeof value === 'number' && value !== 0 && !isUnitlessNumber(styleName)) {\n return value + 'px';\n }\n return value;\n};\nexport const getNextIndex = (ctx) => {\n return intToStr(ctx.$static$.$containerState$.$elementIndex$++);\n};\nexport const setQId = (rCtx, elCtx) => {\n const id = getNextIndex(rCtx);\n elCtx.$id$ = id;\n};\nexport const jsxToString = (data) => {\n if (isSignal(data)) {\n return jsxToString(data.value);\n }\n return data == null || typeof data === 'boolean' ? '' : String(data);\n};\nexport function isAriaAttribute(prop) {\n return prop.startsWith('aria-');\n}\nexport const shouldWrapFunctional = (res, node) => {\n if (node.key) {\n return !isJSXNode(res) || (!isFunction(res.type) && res.key != node.key);\n }\n return false;\n};\nexport const static_listeners = 1 << 0;\nexport const static_subtree = 1 << 1;\nexport const dangerouslySetInnerHTML = 'dangerouslySetInnerHTML';\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXhlY3V0ZS1jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiLi8iLCJ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ZGVyIGhvb2tcbiAgaUN0eC4kc3Vic2NyaWJlciQgPSBbMCwgaG9zdEVsZW1lbnRdO1xuICBpQ3R4LiRyZW5kZXJDdHgkID0gckN0eDtcblxuICAvLyBSZXNvbHZlIHJlbmRlciBmdW5jdGlvblxuICBjb21wb25lbnRRUkwuJHNldENvbnRhaW5lciQockN0eC4kc3RhdGljJC4kY29udGFpbmVyU3RhdGUkLiRjb250YWluZXJFbCQpO1xuICBjb25zdCBjb21wb25lbnRGbiA9IGNvbXBvbmVudFFSTC5nZXRGbihpQ3R4KTtcblxuICByZXR1cm4gc2FmZUNhbGwoXG4gICAgKCkgPT4gY29tcG9uZW50Rm4ocHJvcHMpLFxuICAgIChqc3hOb2RlKSA9PiB7XG4gICAgICByZXR1cm4gbWF5YmVUaGVuKFxuICAgICAgICBpc1NlcnZlclBsYXRmb3JtKClcbiAgICAgICAgICA/IG1heWJlVGhlbihwcm9taXNlQWxsTGF6eSh3YWl0T24pLCAoKSA9PlxuICAgICAgICAgICAgICAvLyBSdW4gZGlydHkgdGFza3MgYmVmb3JlIFNTUiBvdXRwdXQgaXMgZ2VuZXJhdGVkLlxuICAgICAgICAgICAgICBtYXliZVRoZW4oZXhlY3V0ZVNTUlRhc2tzKHJDdHguJHN0YXRpYyQuJGNvbnRhaW5lclN0YXRlJCwgckN0eCksICgpID0+XG4gICAgICAgICAgICAgICAgcHJvbWlzZUFsbExhenkod2FpdE9uKVxuICAgICAgICAgICAgICApXG4gICAgICAgICAgICApXG4gICAgICAgICAgOiBwcm9taXNlQWxsTGF6eSh3YWl0T24pLFxuICAgICAgICAoKSA9PiB7XG4gICAgICAgICAgaWYgKGVsQ3R4LiRmbGFncyQgJiBIT1NUX0ZMQUdfRElSVFkpIHtcbiAgICAgICAgICAgIGlmIChhdHRlbXB0ICYmIGF0dGVtcHQgPiAxMDApIHtcbiAgICAgICAgICAgICAgbG9nV2FybihgSW5maW5pdGUgbG9vcCBkZXRlY3RlZC4gRWxlbWVudDogJHtlbEN0eC4kY29tcG9uZW50UXJsJD8uJHN5bWJvbCR9YCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICByZXR1cm4gZXhlY3V0ZUNvbXBvbmVudChyQ3R4LCBlbEN0eCwgYXR0ZW1wdCA/IGF0dGVtcHQgKyAxIDogMSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICBub2RlOiBqc3hOb2RlLFxuICAgICAgICAgICAgckN0eDogbmV3Q3R4LFxuICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICk7XG4gICAgfSxcbiAgICAoZXJyKSA9PiB7XG4gICAgICBpZiAoZXJyID09PSBTaWduYWxVbmFzc2lnbmVkRXhjZXB0aW9uKSB7XG4gICAgICAgIGlmIChhdHRlbXB0ICYmIGF0dGVtcHQgPiAxMDApIHtcbiAgICAgICAgICBsb2dXYXJuKGBJbmZpbml0ZSBsb29wIGRldGVjdGVkLiBFbGVtZW50OiAke2VsQ3R4LiRjb21wb25lbnRRcmwkPy4kc3ltYm9sJH1gKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICByZXR1cm4gbWF5YmVUaGVuKHByb21pc2VBbGxMYXp5KHdhaXRPbiksICgpID0+IHtcbiAgICAgICAgICAgIHJldHVybiBleGVjdXRlQ29tcG9uZW50KHJDdHgsIGVsQ3R4LCBhdHRlbXB0ID8gYXR0ZW1wdCArIDEgOiAxKTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgaGFuZGxlRXJyb3IoZXJyLCBob3N0RWxlbWVudCwgckN0eCk7XG4gICAgICByZXR1cm4ge1xuICAgICAgICBub2RlOiBTa2lwUmVuZGVyLFxuICAgICAgICByQ3R4OiBuZXdDdHgsXG4gICAgICB9O1xuICAgIH1cbiAgKTtcbn07XG5cbmV4cG9ydCBjb25zdCBjcmVhdGVSZW5kZXJDb250ZXh0ID0gKFxuICBk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Xhwb3J0IGNvbnN0IHN0YXRpY19zdWJ0cmVlID0gMSA8PCAxO1xuZXhwb3J0IGNvbnN0IGRhbmdlcm91c2x5U2V0SW5uZXJIVE1MID0gJ2Rhbmdlcm91c2x5U2V0SW5uZXJIVE1MJztcbiJdfQ==","/**\n * QWIK_VERSION\n *\n * @public\n */\nexport const version = globalThis.QWIK_VERSION;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmVyc2lvbi5qcyIsInNvdXJjZVJvb3QiOiIuLyIsInNvdXJjZXMiOlsicGFja2FnZXMvcXdpay9zcmMvY29yZS92ZXJzaW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7O0dBSUc7QUFDSCxNQUFNLENBQUMsTUFBTSxPQUFPLEdBQUksVUFBa0IsQ0FBQyxZQUFzQixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBRV0lLX1ZFUlNJT05cbiAqXG4gKiBAcHVibGljXG4gKi9cbmV4cG9ydCBjb25zdCB2ZXJzaW9uID0gKGdsb2JhbFRoaXMgYXMgYW55KS5RV0lLX1ZFUlNJT04gYXMgc3RyaW5nO1xuIl19","export const hashCode = (text, hash = 0) => {\n for (let i = 0; i < text.length; i++) {\n const chr = text.charCodeAt(i);\n hash = (hash << 5) - hash + chr;\n hash |= 0; // Convert to 32bit integer\n }\n return Number(Math.abs(hash)).toString(36);\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGFzaF9jb2RlLmpzIiwic291cmNlUm9vdCI6Ii4vIiwic291cmNlcyI6WyJwYWNrYWdlcy9xd2lrL3NyYy9jb3JlL3V0aWwvaGFzaF9jb2RlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE1BQU0sQ0FBQyxNQUFNLFFBQVEsR0FBRyxDQUFDLElBQVksRUFBRSxPQUFlLENBQUMsRUFBRSxFQUFFO0lBQ3pELEtBQUssSUFBSSxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsR0FBRyxJQUFJLENBQUMsTUFBTSxFQUFFLENBQUMsRUFBRSxFQUFFLENBQUM7UUFDckMsTUFBTSxHQUFHLEdBQUcsSUFBSSxDQUFDLFVBQVUsQ0FBQyxDQUFDLENBQUMsQ0FBQztRQUMvQixJQUFJLEdBQUcsQ0FBQyxJQUFJLElBQUksQ0FBQyxDQUFDLEdBQUcsSUFBSSxHQUFHLEdBQUcsQ0FBQztRQUNoQyxJQUFJLElBQUksQ0FBQyxDQUFDLENBQUMsMkJBQTJCO0lBQ3hDLENBQUM7SUFDRCxPQUFPLE1BQU0sQ0FBQyxJQUFJLENBQUMsR0FBRyxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsUUFBUSxDQUFDLEVBQUUsQ0FBQyxDQUFDO0FBQzdDLENBQUMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBjb25zdCBoYXNoQ29kZSA9ICh0ZXh0OiBzdHJpbmcsIGhhc2g6IG51bWJlciA9IDApID0+IHtcbiAgZm9yIChsZXQgaSA9IDA7IGkgPCB0ZXh0Lmxlbmd0aDsgaSsrKSB7XG4gICAgY29uc3QgY2hyID0gdGV4dC5jaGFyQ29kZUF0KGkpO1xuICAgIGhhc2ggPSAoaGFzaCA8PCA1KSAtIGhhc2ggKyBjaHI7XG4gICAgaGFzaCB8PSAwOyAvLyBDb252ZXJ0IHRvIDMyYml0IGludGVnZXJcbiAgfVxuICByZXR1cm4gTnVtYmVyKE1hdGguYWJzKGhhc2gpKS50b1N0cmluZygzNik7XG59O1xuIl19","import { ComponentStylesPrefixContent } from '../util/markers';\nimport { hashCode } from '../util/hash_code';\nimport { assertQrl } from '../qrl/qrl-class';\nexport const styleKey = (qStyles, index) => {\n assertQrl(qStyles);\n return `${hashCode(qStyles.$hash$)}-${index}`;\n};\nexport const styleHost = (styleId) => {\n return styleId;\n};\nexport const styleContent = (styleId) => {\n return ComponentStylesPrefixContent + styleId;\n};\nexport const serializeSStyle = (scopeIds) => {\n const value = scopeIds.join('|');\n if (value.length > 0) {\n return value;\n }\n return undefined;\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicXJsLXN0eWxlcy5qcyIsInNvdXJjZVJvb3QiOiIuLyIsInNvdXJjZXMiOlsicGFja2FnZXMvcXdpay9zcmMvY29yZS9zdHlsZS9xcmwtc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSw0QkFBNEIsRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBQy9ELE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQztBQUU3QyxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFFN0MsTUFBTSxDQUFDLE1BQU0sUUFBUSxHQUFHLENBQUMsT0FBb0IsRUFBRSxLQUFhLEVBQVUsRUFBRTtJQUN0RSxTQUFTLENBQUMsT0FBTyxDQUFDLENBQUM7SUFDbkIsT0FBTyxHQUFHLFFBQVEsQ0FBQyxPQUFPLENBQUMsTUFBTSxDQUFDLElBQUksS0FBSyxFQUFFLENBQUM7QUFDaEQsQ0FBQyxDQUFDO0FBRUYsTUFBTSxDQUFDLE1BQU0sU0FBUyxHQUFHLENBQUMsT0FBZSxFQUFVLEVBQUU7SUFDbkQsT0FBTyxPQUFPLENBQUM7QUFDakIsQ0FBQyxDQUFDO0FBRUYsTUFBTSxDQUFDLE1BQU0sWUFBWSxHQUFHLENBQUMsT0FBZSxFQUFVLEVBQUU7SUFDdEQsT0FBTyw0QkFBNEIsR0FBRyxPQUFPLENBQUM7QUFDaEQsQ0FBQyxDQUFDO0FBRUYsTUFBTSxDQUFDLE1BQU0sZUFBZSxHQUFHLENBQUMsUUFBa0IsRUFBRSxFQUFFO0lBQ3BELE1BQU0sS0FBSyxHQUFH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am9pbignfCcpO1xuICBpZiAodmFsdWUubGVuZ3RoID4gMCkge1xuICAgIHJldHVybiB2YWx1ZTtcbiAgfVxuICByZXR1cm4gdW5kZWZpbmVkO1xufTtcbiJdfQ==","var _a;\nimport { isPromise, maybeThen } from '../../util/promises';\nimport { newInvokeContext, invoke, trackSignal } from '../../use/use-core';\nimport { Virtual, _jsxC, _jsxQ, createJSXError, isJSXNode } from '../jsx/jsx-runtime';\nimport { isArray, isFunction, isString } from '../../util/types';\nimport { createRenderContext, executeComponent, getNextIndex, isAriaAttribute, jsxToString, pushRenderContext, serializeClass, shouldWrapFunctional, static_subtree, stringifyStyle, dangerouslySetInnerHTML, } from '../execute-component';\nimport { ELEMENT_ID, OnRenderProp, QScopedStyle, QSlot, QSlotS, QStyle } from '../../util/markers';\nimport { InternalSSRStream, SSRRaw } from '../jsx/utils.public';\nimport { logError, logWarn } from '../../util/log';\nimport { groupListeners, isOnProp, PREVENT_DEFAULT, setEvent, } from '../../state/listeners';\nimport { version } from '../../version';\nimport { createContainerState, setRef, getEventName, } from '../../container/container';\nimport { assertDefined } from '../../error/assert';\nimport { serializeSStyle } from '../../style/qrl-styles';\nimport { qDev, qInspector, seal } from '../../util/qdev';\nimport { qError, QError_canNotRenderHTML } from '../../error/error';\nimport { isSignal } from '../../state/signal';\nimport { serializeQRLs } from '../../qrl/qrl';\nimport { EMPTY_OBJ } from '../../util/flyweight';\nimport { createContext, HOST_FLAG_DIRTY, HOST_FLAG_NEED_ATTACH_LISTENER, HOST_FLAG_DYNAMIC, } from '../../state/context';\nimport { createPropsState, createProxy } from '../../state/store';\nimport { Q_CTX, _IMMUTABLE, _IMMUTABLE_PREFIX } from '../../state/constants';\nconst FLUSH_COMMENT = '';\nconst IS_HEAD = 1 << 0;\nconst IS_HTML = 1 << 2;\nconst IS_TEXT = 1 << 3;\nconst IS_INVISIBLE = 1 << 4;\nconst IS_PHASING = 1 << 5;\nconst IS_ANCHOR = 1 << 6;\nconst IS_BUTTON = 1 << 7;\nconst IS_TABLE = 1 << 8;\nconst IS_PHRASING_CONTAINER = 1 << 9;\nconst IS_IMMUTABLE = 1 << 10;\nclass MockElement {\n constructor(nodeType) {\n this.nodeType = nodeType;\n this[_a] = null;\n seal(this);\n }\n}\n_a = Q_CTX;\nconst createDocument = () => {\n return new MockElement(9);\n};\n/** @internal */\nexport const _renderSSR = async (node, opts) => {\n const root = opts.containerTagName;\n const containerEl = createMockQContext(1).$element$;\n const containerState = createContainerState(containerEl, opts.base ?? '/');\n containerState.$serverData$.locale = opts.serverData?.locale;\n const doc = createDocument();\n const rCtx = createRenderContext(doc, containerState);\n const headNodes = opts.beforeContent ?? [];\n if (qDev) {\n if (root in phasingContent ||\n root in emptyElements ||\n root in tableContent ||\n root in startPhasingContent ||\n root in invisibleElements) {\n throw new Error(`The \"containerTagName\" can not be \"${root}\". Please choose a different tag name like: \"div\", \"html\", \"custom-container\".`);\n }\n }\n const ssrCtx = {\n $static$: {\n $contexts$: [],\n $headNodes$: root === 'html' ? headNodes : [],\n $locale$: opts.serverData?.locale,\n $textNodes$: new Map(),\n },\n $projectedChildren$: undefined,\n $projectedCtxs$: undefined,\n $invocationContext$: undefined,\n };\n seal(ssrCtx);\n const locale = opts.serverData?.locale;\n const containerAttributes = opts.containerAttributes;\n const qRender = containerAttributes['q:render'];\n containerAttributes['q:container'] = 'paused';\n containerAttributes['q:version'] = version ?? 'dev';\n containerAttributes['q:render'] = (qRender ? qRender + '-' : '') + (qDev ? 'ssr-dev' : 'ssr');\n containerAttributes['q:base'] = opts.base || '';\n containerAttributes['q:locale'] = locale;\n containerAttributes['q:manifest-hash'] = opts.manifestHash;\n containerAttributes['q:instance'] = hash();\n const children = root === 'html' ? [node] : [headNodes, node];\n if (root !== 'html') {\n containerAttributes.class =\n 'qc📦' + (containerAttributes.class ? ' ' + containerAttributes.class : '');\n }\n const serverData = (containerState.$serverData$ = {\n ...containerState.$serverData$,\n ...opts.serverData,\n });\n serverData.containerAttributes = {\n ...serverData['containerAttributes'],\n ...containerAttributes,\n };\n const invokeCtx = (ssrCtx.$invocationContext$ = newInvokeContext(locale));\n invokeCtx.$renderCtx$ = rCtx;\n ssrCtx.$invocationContext$;\n const rootNode = _jsxQ(root, null, containerAttributes, children, HOST_FLAG_DIRTY | HOST_FLAG_NEED_ATTACH_LISTENER, null);\n containerState.$hostsRendering$ = new Set();\n await Promise.resolve().then(() => renderRoot(rootNode, rCtx, ssrCtx, opts.stream, containerState, opts));\n};\nconst hash = () => Math.random().toString(36).slice(2);\nconst renderRoot = async (node, rCtx, ssrCtx, stream, containerState, opts) => {\n const beforeClose = opts.beforeClose;\n await renderNode(node, rCtx, ssrCtx, stream, 0, beforeClose\n ? (stream) => {\n const result = beforeClose(ssrCtx.$static$.$contexts$, containerState, false, ssrCtx.$static$.$textNodes$);\n return processData(result, rCtx, ssrCtx, stream, 0, undefined);\n }\n : undefined);\n if (qDev) {\n if (ssrCtx.$static$.$headNodes$.length > 0) {\n logError('Missing . Global styles could not be rendered. Please render a element at the root of the app');\n }\n }\n return rCtx;\n};\nconst renderGenerator = async (node, rCtx, ssrCtx, stream, flags) => {\n stream.write(FLUSH_COMMENT);\n const generator = node.props.children;\n let value;\n if (isFunction(generator)) {\n const v = generator({\n write(chunk) {\n stream.write(chunk);\n stream.write(FLUSH_COMMENT);\n },\n });\n if (isPromise(v)) {\n return v;\n }\n value = v;\n }\n else {\n value = generator;\n }\n for await (const chunk of value) {\n await processData(chunk, rCtx, ssrCtx, stream, flags, undefined);\n stream.write(FLUSH_COMMENT);\n }\n};\nconst renderNodeVirtual = (node, elCtx, extraNodes, rCtx, ssrCtx, stream, flags, beforeClose) => {\n const props = node.props;\n const renderQrl = props[OnRenderProp];\n if (renderQrl) {\n elCtx.$componentQrl$ = renderQrl;\n return renderSSRComponent(rCtx, ssrCtx, stream, elCtx, node, flags, beforeClose);\n }\n let virtualComment = '';\n stream.write(virtualComment);\n const html = node.props[dangerouslySetInnerHTML];\n if (html) {\n stream.write(html);\n stream.write(CLOSE_VIRTUAL);\n return;\n }\n if (extraNodes) {\n for (const node of extraNodes) {\n // We trust that the attributes are strings\n renderNodeElementSync(node.type, node.props, stream);\n }\n }\n const promise = walkChildren(node.children, rCtx, ssrCtx, stream, flags);\n return maybeThen(promise, () => {\n // Fast path\n if (!isSlot && !beforeClose) {\n stream.write(CLOSE_VIRTUAL);\n return;\n }\n let promise;\n if (isSlot) {\n assertDefined(key, 'key must be defined for a slot');\n const content = ssrCtx.$projectedChildren$?.[key];\n if (content) {\n const [rCtx, sCtx] = ssrCtx.$projectedCtxs$;\n const newSlotRctx = pushRenderContext(rCtx);\n newSlotRctx.$slotCtx$ = elCtx;\n ssrCtx.$projectedChildren$[key] = undefined;\n promise = processData(content, newSlotRctx, sCtx, stream, flags);\n }\n }\n // Inject before close\n if (beforeClose) {\n promise = maybeThen(promise, () => beforeClose(stream));\n }\n return maybeThen(promise, () => {\n stream.write(CLOSE_VIRTUAL);\n });\n });\n};\nconst CLOSE_VIRTUAL = ``;\nconst renderAttributes = (attributes) => {\n let text = '';\n for (const prop in attributes) {\n if (prop === dangerouslySetInnerHTML) {\n continue;\n }\n const value = attributes[prop];\n if (value != null) {\n text += ' ' + (value === '' ? prop : prop + '=\"' + value + '\"');\n }\n }\n return text;\n};\nconst renderVirtualAttributes = (attributes) => {\n let text = '';\n for (const prop in attributes) {\n if (prop === 'children' || prop === dangerouslySetInnerHTML) {\n continue;\n }\n const value = attributes[prop];\n if (value != null) {\n text += ' ' + (value === '' ? prop : prop + '=' + value + '');\n }\n }\n return text;\n};\nconst renderNodeElementSync = (tagName, attributes, stream) => {\n stream.write('<' + tagName + renderAttributes(attributes) + '>');\n const empty = !!emptyElements[tagName];\n if (empty) {\n return;\n }\n // Render innerHTML\n const innerHTML = attributes[dangerouslySetInnerHTML];\n if (innerHTML != null) {\n stream.write(innerHTML);\n }\n stream.write(``);\n};\n/** Render a component$ */\nconst renderSSRComponent = (rCtx, ssrCtx, stream, elCtx, node, flags, beforeClose) => {\n const props = node.props;\n setComponentProps(rCtx, elCtx, props.props);\n return maybeThen(executeComponent(rCtx, elCtx), (res) => {\n const hostElement = elCtx.$element$;\n const newRCtx = res.rCtx;\n const iCtx = newInvokeContext(ssrCtx.$static$.$locale$, hostElement, undefined);\n iCtx.$subscriber$ = [0, hostElement];\n iCtx.$renderCtx$ = newRCtx;\n const newSSrContext = {\n $static$: ssrCtx.$static$,\n $projectedChildren$: splitProjectedChildren(node.children, ssrCtx),\n $projectedCtxs$: [rCtx, ssrCtx],\n $invocationContext$: iCtx,\n };\n const extraNodes = [];\n if (elCtx.$appendStyles$) {\n const isHTML = !!(flags & IS_HTML);\n const array = isHTML ? ssrCtx.$static$.$headNodes$ : extraNodes;\n for (const style of elCtx.$appendStyles$) {\n array.push(_jsxQ('style', {\n [QStyle]: style.styleId,\n [dangerouslySetInnerHTML]: style.content,\n hidden: '',\n }, null, null, 0, null));\n }\n }\n const newID = getNextIndex(rCtx);\n const scopeId = elCtx.$scopeIds$ ? serializeSStyle(elCtx.$scopeIds$) : undefined;\n const processedNode = _jsxC(node.type, {\n [QScopedStyle]: scopeId,\n [ELEMENT_ID]: newID,\n children: res.node,\n }, 0, node.key);\n elCtx.$id$ = newID;\n ssrCtx.$static$.$contexts$.push(elCtx);\n return renderNodeVirtual(processedNode, elCtx, extraNodes, newRCtx, newSSrContext, stream, flags, (stream) => {\n if (elCtx.$flags$ & HOST_FLAG_NEED_ATTACH_LISTENER) {\n const placeholderCtx = createMockQContext(1);\n const listeners = placeholderCtx.li;\n listeners.push(...elCtx.li);\n elCtx.$flags$ &= ~HOST_FLAG_NEED_ATTACH_LISTENER;\n placeholderCtx.$id$ = getNextIndex(rCtx);\n const attributes = {\n type: 'placeholder',\n hidden: '',\n 'q:id': placeholderCtx.$id$,\n };\n ssrCtx.$static$.$contexts$.push(placeholderCtx);\n const groups = groupListeners(listeners);\n for (const listener of groups) {\n const eventName = normalizeInvisibleEvents(listener[0]);\n attributes[eventName] = serializeQRLs(listener[1], rCtx.$static$.$containerState$, placeholderCtx);\n registerQwikEvent(eventName, rCtx.$static$.$containerState$);\n }\n renderNodeElementSync('script', attributes, stream);\n }\n const projectedChildren = newSSrContext.$projectedChildren$;\n let missingSlotsDone;\n if (projectedChildren) {\n const nodes = Object.keys(projectedChildren).map((slotName) => {\n const content = projectedChildren[slotName];\n // projectedChildren[slotName] = undefined;\n if (content) {\n return _jsxQ('q:template', { [QSlot]: slotName || true, hidden: true, 'aria-hidden': 'true' }, null, content, 0, null);\n }\n });\n const [_rCtx, sCtx] = newSSrContext.$projectedCtxs$;\n const newSlotRctx = pushRenderContext(_rCtx);\n newSlotRctx.$slotCtx$ = elCtx;\n missingSlotsDone = processData(nodes, newSlotRctx, sCtx, stream, 0, undefined);\n }\n return beforeClose\n ? maybeThen(missingSlotsDone, () => beforeClose(stream))\n : missingSlotsDone;\n });\n });\n};\nconst splitProjectedChildren = (children, ssrCtx) => {\n const flatChildren = flatVirtualChildren(children, ssrCtx);\n if (flatChildren === null) {\n return undefined;\n }\n const slotMap = {};\n for (const child of flatChildren) {\n let slotName = '';\n if (isJSXNode(child)) {\n slotName = child.props[QSlot] || '';\n }\n (slotMap[slotName] || (slotMap[slotName] = [])).push(child);\n }\n return slotMap;\n};\nconst createMockQContext = (nodeType) => {\n const elm = new MockElement(nodeType);\n return createContext(elm);\n};\nconst renderNode = (node, rCtx, ssrCtx, stream, flags, beforeClose) => {\n const tagName = node.type;\n const hostCtx = rCtx.$cmpCtx$;\n if (typeof tagName === 'string') {\n const key = node.key;\n const props = node.props;\n const immutable = node.immutableProps || EMPTY_OBJ;\n const elCtx = createMockQContext(1);\n const elm = elCtx.$element$;\n const isHead = tagName === 'head';\n let openingElement = '<' + tagName;\n let useSignal = false;\n let hasRef = false;\n let classStr = '';\n let htmlStr = null;\n const handleProp = (rawProp, value, isImmutable) => {\n if (rawProp === 'ref') {\n if (value !== undefined) {\n setRef(value, elm);\n hasRef = true;\n }\n return;\n }\n if (isOnProp(rawProp)) {\n setEvent(elCtx.li, rawProp, value, undefined);\n return;\n }\n if (isSignal(value)) {\n assertDefined(hostCtx, 'Signals can not be used outside the root');\n if (isImmutable) {\n value = trackSignal(value, [1, elm, value, hostCtx.$element$, rawProp]);\n }\n else {\n value = trackSignal(value, [2, hostCtx.$element$, value, elm, rawProp]);\n }\n useSignal = true;\n }\n if (rawProp === dangerouslySetInnerHTML) {\n htmlStr = value;\n return;\n }\n if (rawProp.startsWith(PREVENT_DEFAULT)) {\n registerQwikEvent(rawProp.slice(PREVENT_DEFAULT.length), rCtx.$static$.$containerState$);\n }\n let attrValue;\n const prop = rawProp === 'htmlFor' ? 'for' : rawProp;\n if (prop === 'class' || prop === 'className') {\n classStr = serializeClass(value);\n }\n else if (prop === 'style') {\n attrValue = stringifyStyle(value);\n }\n else if (isAriaAttribute(prop) || prop === 'draggable' || prop === 'spellcheck') {\n attrValue = value != null ? String(value) : null;\n value = attrValue;\n }\n else if (value === false || value == null) {\n attrValue = null;\n }\n else {\n attrValue = String(value);\n }\n if (attrValue != null) {\n if (prop === 'value' && tagName === 'textarea') {\n htmlStr = escapeHtml(attrValue);\n }\n else if (isSSRUnsafeAttr(prop)) {\n if (qDev) {\n logError('Attribute value is unsafe for SSR');\n }\n }\n else {\n openingElement +=\n ' ' + (value === true ? prop : prop + '=\"' + escapeAttr(attrValue) + '\"');\n }\n }\n };\n for (const prop in props) {\n let isImmutable = false;\n let value;\n if (prop in immutable) {\n isImmutable = true;\n value = immutable[prop];\n if (value === _IMMUTABLE) {\n value = props[prop];\n }\n }\n else {\n value = props[prop];\n }\n handleProp(prop, value, isImmutable);\n }\n for (const prop in immutable) {\n if (prop in props) {\n continue;\n }\n const value = immutable[prop];\n if (value !== _IMMUTABLE) {\n handleProp(prop, value, true);\n }\n }\n const listeners = elCtx.li;\n if (hostCtx) {\n if (qDev) {\n if (tagName === 'html') {\n throw qError(QError_canNotRenderHTML);\n }\n }\n if (hostCtx.$scopeIds$?.length) {\n const extra = hostCtx.$scopeIds$.join(' ');\n classStr = classStr ? `${extra} ${classStr}` : extra;\n }\n if (hostCtx.$flags$ & HOST_FLAG_NEED_ATTACH_LISTENER) {\n listeners.push(...hostCtx.li);\n hostCtx.$flags$ &= ~HOST_FLAG_NEED_ATTACH_LISTENER;\n }\n }\n // Reset HOST flags\n if (qDev) {\n if (flags & IS_PHASING && !(flags & IS_PHRASING_CONTAINER)) {\n if (!(tagName in phasingContent)) {\n throw createJSXError(`<${tagName}> can not be rendered because one of its ancestor is a

or a

.\\n\nThis goes against the HTML spec: https://html.spec.whatwg.org/multipage/dom.html#phrasing-content-2`, node);\n                }\n            }\n            if (tagName === 'table') {\n                flags |= IS_TABLE;\n            }\n            else {\n                if (flags & IS_TABLE && !(tagName in tableContent)) {\n                    throw createJSXError(`The  element requires that its direct children to be '', '', '' or '
' instead, '<${tagName}>' was rendered.`, node);\n }\n flags &= ~IS_TABLE;\n }\n if (tagName === 'button') {\n if (flags & IS_BUTTON) {\n throw createJSXError(`<${tagName}> can not be rendered because one of its ancestor is already a