@vielzeug/ore 1.2.0 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/errors.cjs CHANGED
@@ -1,3 +1,3 @@
1
- const e=require("./_dev.cjs");var t=class e extends Error{constructor(e,t){super(e,t),this.name=new.target.name,Object.setPrototypeOf(this,new.target.prototype)}static is(t){return t instanceof e}},n=class extends t{constructor(e){super(e)}},r=class extends t{constructor(e){super(e)}},i=class extends t{component;phase;constructor(e,t){super(e,{cause:t.cause}),this.component=t.component,this.phase=t.phase}};function a(t,n){e.error(`<${t.component}> setup error (phase: ${t.phase}):`,t.cause),n.dispatchEvent(new CustomEvent(`ore:error`,{bubbles:!0,composed:!0,detail:t}))}var o=class extends t{},s={defineDuplicate:e=>`define('${e}') called twice — custom element already registered`,defineFieldRequiresFormAssociated:e=>`useField() requires define('${e}', { formAssociated: true })`,defineRequiresTag:`define() requires a tag name`,eachDuplicateKey:(e,t)=>`each() received duplicate key "${e}" at index ${t}`,injectStrictFailed:(e,t)=>`injectStrict() could not resolve key "${e}" in <${t}>`,invalidDynamicTagName:e=>`html\`...\`: dynamic tag name "${e}" is not a valid HTML element name`,invariantViolated:e=>`invariant violated: ${e}`,lifecycleOutsideSetup:`Lifecycle hooks must be called during component setup`,propInvalidReflect:`Structured props cannot use reflect:true — use prop.json() with reflect:false`,validationFailed:(e,t)=>`Validation failed for <${e}>:\n${t.join(`
1
+ const e=require("./_dev.cjs");var t=class e extends Error{constructor(e,t){super(e,t),this.name=new.target.name,Object.setPrototypeOf(this,new.target.prototype)}static is(t){return t instanceof e}},n=class extends t{constructor(e){super(e)}},r=class extends t{constructor(e){super(e)}},i=class extends t{component;phase;constructor(e,t){super(e,{cause:t.cause}),this.component=t.component,this.phase=t.phase}};function a(t,n){e.error(`<${t.component}> setup error (phase: ${t.phase}):`,t.cause),n.dispatchEvent(new CustomEvent(`ore:error`,{bubbles:!0,composed:!0,detail:t}))}var o=class extends t{},s={defineDuplicate:e=>`define('${e}') called twice — custom element already registered`,defineFieldRequiresFormAssociated:e=>`useField() requires define('${e}', { formAssociated: true })`,defineRequiresTag:`define() requires a tag name`,eachDuplicateKey:(e,t)=>`each() received duplicate key "${e}" at index ${t}`,injectStrictFailed:(e,t)=>`injectStrict() could not resolve key "${e}" in <${t}>`,invalidDynamicTagName:e=>`html\`...\`: dynamic tag name "${e}" is not a valid HTML element name`,invariantViolated:e=>`invariant violated: ${e}`,lifecycleOutsideSetup:`Lifecycle hooks must be called during component setup`,mismatchedDynamicCloseTag:"html`...`: dynamic closing tag has no matching dynamic opening tag",propInvalidReflect:`Structured props cannot use reflect:true — use prop.json() with reflect:false`,validationFailed:(e,t)=>`Validation failed for <${e}>:\n${t.join(`
2
2
  `)}`};function c(e,t){if(!e)throw new r(s.invariantViolated(t))}exports.ORE_ERRORS=s,exports.OreApiError=n,exports.OreError=t,exports.OreInternalError=r,exports.OreLifecycleError=i,exports.OreTimeoutError=o,exports.invariant=c,exports.reportRuntimeError=a;
3
3
  //# sourceMappingURL=errors.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.cjs","names":[],"sources":["../src/errors.ts"],"sourcesContent":["import { error as logError } from './_dev';\n\n// ─── Structured error types ───────────────────────────────────────────────────\n\n/** Base class for all Ore errors. Use `instanceof OreError` to catch any Ore-originated error. */\nexport class OreError extends Error {\n constructor(message: string, opts?: ErrorOptions) {\n super(message, opts);\n this.name = new.target.name;\n Object.setPrototypeOf(this, new.target.prototype);\n }\n\n static is(err: unknown): err is OreError {\n return err instanceof OreError;\n }\n}\n\n/** Thrown when Ore API is called incorrectly (e.g. outside setup, duplicate define, invalid prop). */\nexport class OreApiError extends OreError {\n constructor(message: string) {\n super(message);\n }\n}\n\n/**\n * Thrown when an internal invariant fails — e.g. compiled template metadata no\n * longer matching the DOM it was cloned from. Distinct from `OreApiError`: this\n * is never the caller's fault, it signals a bug in ore itself. See `invariant()`.\n */\nexport class OreInternalError extends OreError {\n constructor(message: string) {\n super(message);\n }\n}\n\n/**\n * The phase in which a component error occurred.\n * - `'setup'` — synchronous setup() threw\n * - `'async-setup'` — async setup() promise rejected\n * - `'mounted'` — an onMounted callback threw\n * - `'form-reset'` — an onFormReset callback threw\n */\nexport type OreErrorPhase = 'async-setup' | 'form-reset' | 'mounted' | 'setup';\n\n/**\n * Structured error thrown by the Ore runtime when component setup fails.\n * Provides component name and original cause for debugging.\n */\nexport class OreLifecycleError extends OreError {\n readonly component: string;\n readonly phase: OreErrorPhase;\n\n constructor(message: string, options: { cause: Error; component: string; phase: OreErrorPhase }) {\n super(message, { cause: options.cause });\n this.component = options.component;\n this.phase = options.phase;\n }\n}\n\n/**\n * Report a runtime error via the ore:error event and console.\n */\nexport function reportRuntimeError(error: OreLifecycleError, element: HTMLElement): void {\n logError(`<${error.component}> setup error (phase: ${error.phase}):`, error.cause);\n\n element.dispatchEvent(\n new CustomEvent('ore:error', {\n bubbles: true,\n composed: true,\n detail: error,\n }),\n );\n}\n\n// ─── Error message constants ─────────────────────────────────────────────────\n\n/** Thrown by `waitFor` and `waitForEvent` in the testing sub-path when a condition is not met within the timeout. */\nexport class OreTimeoutError extends OreError {}\n\nexport const ORE_ERRORS = {\n defineDuplicate: (tag: string): string => `define('${tag}') called twice — custom element already registered`,\n defineFieldRequiresFormAssociated: (tag: string): string =>\n `useField() requires define('${tag}', { formAssociated: true })`,\n defineRequiresTag: 'define() requires a tag name',\n eachDuplicateKey: (key: string, index: number): string => `each() received duplicate key \"${key}\" at index ${index}`,\n injectStrictFailed: (key: string, tag: string): string => `injectStrict() could not resolve key \"${key}\" in <${tag}>`,\n invalidDynamicTagName: (tagName: string): string =>\n `html\\`...\\`: dynamic tag name \"${tagName}\" is not a valid HTML element name`,\n invariantViolated: (message: string): string => `invariant violated: ${message}`,\n lifecycleOutsideSetup: 'Lifecycle hooks must be called during component setup',\n propInvalidReflect: 'Structured props cannot use reflect:true — use prop.json() with reflect:false',\n validationFailed: (tag: string, errors: string[]): string => `Validation failed for <${tag}>:\\n${errors.join('\\n')}`,\n} as const;\n\n/**\n * Assert an internal invariant that must always hold — e.g. compiled template\n * metadata staying in sync with the DOM it was cloned from. A failed invariant\n * means a bug in ore itself, never user input, so it throws `OreInternalError`\n * unconditionally (every build, never gated like `_dev.ts`'s `warn()`).\n *\n * Narrowing caveat: `asserts condition` only narrows the exact expression\n * passed in. Assign to a local `const` first — `invariant(el.parentNode, msg)`\n * does not narrow later reads of `el.parentNode`.\n */\nexport function invariant(condition: unknown, message: string): asserts condition {\n if (!condition) throw new OreInternalError(ORE_ERRORS.invariantViolated(message));\n}\n"],"mappings":"8BAKA,IAAa,EAAb,MAAa,UAAiB,KAAM,CAClC,YAAY,EAAiB,EAAqB,CAChD,MAAM,EAAS,CAAI,EACnB,KAAK,KAAO,IAAI,OAAO,KACvB,OAAO,eAAe,KAAM,IAAI,OAAO,SAAS,CAClD,CAEA,OAAO,GAAG,EAA+B,CACvC,OAAO,aAAe,CACxB,CACF,EAGa,EAAb,cAAiC,CAAS,CACxC,YAAY,EAAiB,CAC3B,MAAM,CAAO,CACf,CACF,EAOa,EAAb,cAAsC,CAAS,CAC7C,YAAY,EAAiB,CAC3B,MAAM,CAAO,CACf,CACF,EAea,EAAb,cAAuC,CAAS,CAC9C,UACA,MAEA,YAAY,EAAiB,EAAoE,CAC/F,MAAM,EAAS,CAAE,MAAO,EAAQ,KAAM,CAAC,EACvC,KAAK,UAAY,EAAQ,UACzB,KAAK,MAAQ,EAAQ,KACvB,CACF,EAKA,SAAgB,EAAmB,EAA0B,EAA4B,CACvF,EAAA,MAAS,IAAI,EAAM,UAAU,wBAAwB,EAAM,MAAM,IAAK,EAAM,KAAK,EAEjF,EAAQ,cACN,IAAI,YAAY,YAAa,CAC3B,QAAS,GACT,SAAU,GACV,OAAQ,CACV,CAAC,CACH,CACF,CAKA,IAAa,EAAb,cAAqC,CAAS,CAAC,EAElC,EAAa,CACxB,gBAAkB,GAAwB,WAAW,EAAI,qDACzD,kCAAoC,GAClC,+BAA+B,EAAI,8BACrC,kBAAmB,+BACnB,kBAAmB,EAAa,IAA0B,kCAAkC,EAAI,aAAa,IAC7G,oBAAqB,EAAa,IAAwB,yCAAyC,EAAI,QAAQ,EAAI,GACnH,sBAAwB,GACtB,kCAAkC,EAAQ,oCAC5C,kBAAoB,GAA4B,uBAAuB,IACvE,sBAAuB,wDACvB,mBAAoB,gFACpB,kBAAmB,EAAa,IAA6B,0BAA0B,EAAI,MAAM,EAAO,KAAK;CAAI,GACnH,EAYA,SAAgB,EAAU,EAAoB,EAAoC,CAChF,GAAI,CAAC,EAAW,MAAM,IAAI,EAAiB,EAAW,kBAAkB,CAAO,CAAC,CAClF"}
1
+ {"version":3,"file":"errors.cjs","names":[],"sources":["../src/errors.ts"],"sourcesContent":["import { error as logError } from './_dev';\n\n// ─── Structured error types ───────────────────────────────────────────────────\n\n/** Base class for all Ore errors. Use `instanceof OreError` to catch any Ore-originated error. */\nexport class OreError extends Error {\n constructor(message: string, opts?: ErrorOptions) {\n super(message, opts);\n this.name = new.target.name;\n Object.setPrototypeOf(this, new.target.prototype);\n }\n\n static is(err: unknown): err is OreError {\n return err instanceof OreError;\n }\n}\n\n/** Thrown when Ore API is called incorrectly (e.g. outside setup, duplicate define, invalid prop). */\nexport class OreApiError extends OreError {\n constructor(message: string) {\n super(message);\n }\n}\n\n/**\n * Thrown when an internal invariant fails — e.g. compiled template metadata no\n * longer matching the DOM it was cloned from. Distinct from `OreApiError`: this\n * is never the caller's fault, it signals a bug in ore itself. See `invariant()`.\n */\nexport class OreInternalError extends OreError {\n constructor(message: string) {\n super(message);\n }\n}\n\n/**\n * The phase in which a component error occurred.\n * - `'setup'` — synchronous setup() threw\n * - `'async-setup'` — async setup() promise rejected\n * - `'mounted'` — an onMounted callback threw\n * - `'form-reset'` — an onFormReset callback threw\n */\nexport type OreErrorPhase = 'async-setup' | 'form-reset' | 'mounted' | 'setup';\n\n/**\n * Structured error thrown by the Ore runtime when component setup fails.\n * Provides component name and original cause for debugging.\n */\nexport class OreLifecycleError extends OreError {\n readonly component: string;\n readonly phase: OreErrorPhase;\n\n constructor(message: string, options: { cause: Error; component: string; phase: OreErrorPhase }) {\n super(message, { cause: options.cause });\n this.component = options.component;\n this.phase = options.phase;\n }\n}\n\n/**\n * Report a runtime error via the ore:error event and console.\n */\nexport function reportRuntimeError(error: OreLifecycleError, element: HTMLElement): void {\n logError(`<${error.component}> setup error (phase: ${error.phase}):`, error.cause);\n\n element.dispatchEvent(\n new CustomEvent('ore:error', {\n bubbles: true,\n composed: true,\n detail: error,\n }),\n );\n}\n\n// ─── Error message constants ─────────────────────────────────────────────────\n\n/** Thrown by `waitFor` and `waitForEvent` in the testing sub-path when a condition is not met within the timeout. */\nexport class OreTimeoutError extends OreError {}\n\nexport const ORE_ERRORS = {\n defineDuplicate: (tag: string): string => `define('${tag}') called twice — custom element already registered`,\n defineFieldRequiresFormAssociated: (tag: string): string =>\n `useField() requires define('${tag}', { formAssociated: true })`,\n defineRequiresTag: 'define() requires a tag name',\n eachDuplicateKey: (key: string, index: number): string => `each() received duplicate key \"${key}\" at index ${index}`,\n injectStrictFailed: (key: string, tag: string): string => `injectStrict() could not resolve key \"${key}\" in <${tag}>`,\n invalidDynamicTagName: (tagName: string): string =>\n `html\\`...\\`: dynamic tag name \"${tagName}\" is not a valid HTML element name`,\n invariantViolated: (message: string): string => `invariant violated: ${message}`,\n lifecycleOutsideSetup: 'Lifecycle hooks must be called during component setup',\n mismatchedDynamicCloseTag: 'html`...`: dynamic closing tag has no matching dynamic opening tag',\n propInvalidReflect: 'Structured props cannot use reflect:true — use prop.json() with reflect:false',\n validationFailed: (tag: string, errors: string[]): string => `Validation failed for <${tag}>:\\n${errors.join('\\n')}`,\n} as const;\n\n/**\n * Assert an internal invariant that must always hold — e.g. compiled template\n * metadata staying in sync with the DOM it was cloned from. A failed invariant\n * means a bug in ore itself, never user input, so it throws `OreInternalError`\n * unconditionally (every build, never gated like `_dev.ts`'s `warn()`).\n *\n * Narrowing caveat: `asserts condition` only narrows the exact expression\n * passed in. Assign to a local `const` first — `invariant(el.parentNode, msg)`\n * does not narrow later reads of `el.parentNode`.\n */\nexport function invariant(condition: unknown, message: string): asserts condition {\n if (!condition) throw new OreInternalError(ORE_ERRORS.invariantViolated(message));\n}\n"],"mappings":"8BAKA,IAAa,EAAb,MAAa,UAAiB,KAAM,CAClC,YAAY,EAAiB,EAAqB,CAChD,MAAM,EAAS,CAAI,EACnB,KAAK,KAAO,IAAI,OAAO,KACvB,OAAO,eAAe,KAAM,IAAI,OAAO,SAAS,CAClD,CAEA,OAAO,GAAG,EAA+B,CACvC,OAAO,aAAe,CACxB,CACF,EAGa,EAAb,cAAiC,CAAS,CACxC,YAAY,EAAiB,CAC3B,MAAM,CAAO,CACf,CACF,EAOa,EAAb,cAAsC,CAAS,CAC7C,YAAY,EAAiB,CAC3B,MAAM,CAAO,CACf,CACF,EAea,EAAb,cAAuC,CAAS,CAC9C,UACA,MAEA,YAAY,EAAiB,EAAoE,CAC/F,MAAM,EAAS,CAAE,MAAO,EAAQ,KAAM,CAAC,EACvC,KAAK,UAAY,EAAQ,UACzB,KAAK,MAAQ,EAAQ,KACvB,CACF,EAKA,SAAgB,EAAmB,EAA0B,EAA4B,CACvF,EAAA,MAAS,IAAI,EAAM,UAAU,wBAAwB,EAAM,MAAM,IAAK,EAAM,KAAK,EAEjF,EAAQ,cACN,IAAI,YAAY,YAAa,CAC3B,QAAS,GACT,SAAU,GACV,OAAQ,CACV,CAAC,CACH,CACF,CAKA,IAAa,EAAb,cAAqC,CAAS,CAAC,EAElC,EAAa,CACxB,gBAAkB,GAAwB,WAAW,EAAI,qDACzD,kCAAoC,GAClC,+BAA+B,EAAI,8BACrC,kBAAmB,+BACnB,kBAAmB,EAAa,IAA0B,kCAAkC,EAAI,aAAa,IAC7G,oBAAqB,EAAa,IAAwB,yCAAyC,EAAI,QAAQ,EAAI,GACnH,sBAAwB,GACtB,kCAAkC,EAAQ,oCAC5C,kBAAoB,GAA4B,uBAAuB,IACvE,sBAAuB,wDACvB,0BAA2B,qEAC3B,mBAAoB,gFACpB,kBAAmB,EAAa,IAA6B,0BAA0B,EAAI,MAAM,EAAO,KAAK;CAAI,GACnH,EAYA,SAAgB,EAAU,EAAoB,EAAoC,CAChF,GAAI,CAAC,EAAW,MAAM,IAAI,EAAiB,EAAW,kBAAkB,CAAO,CAAC,CAClF"}
package/dist/errors.d.ts CHANGED
@@ -52,6 +52,7 @@ export declare const ORE_ERRORS: {
52
52
  readonly invalidDynamicTagName: (tagName: string) => string;
53
53
  readonly invariantViolated: (message: string) => string;
54
54
  readonly lifecycleOutsideSetup: "Lifecycle hooks must be called during component setup";
55
+ readonly mismatchedDynamicCloseTag: "html`...`: dynamic closing tag has no matching dynamic opening tag";
55
56
  readonly propInvalidReflect: "Structured props cannot use reflect:true — use prop.json() with reflect:false";
56
57
  readonly validationFailed: (tag: string, errors: string[]) => string;
57
58
  };
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAIA,kGAAkG;AAClG,qBAAa,QAAS,SAAQ,KAAK;gBACrB,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,YAAY;IAMhD,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,QAAQ;CAGzC;AAED,sGAAsG;AACtG,qBAAa,WAAY,SAAQ,QAAQ;gBAC3B,OAAO,EAAE,MAAM;CAG5B;AAED;;;;GAIG;AACH,qBAAa,gBAAiB,SAAQ,QAAQ;gBAChC,OAAO,EAAE,MAAM;CAG5B;AAED;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,aAAa,GAAG,YAAY,GAAG,SAAS,GAAG,OAAO,CAAC;AAE/E;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,QAAQ;IAC7C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;gBAElB,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE;QAAE,KAAK,EAAE,KAAK,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,aAAa,CAAA;KAAE;CAKhG;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,EAAE,OAAO,EAAE,WAAW,GAAG,IAAI,CAUvF;AAID,qHAAqH;AACrH,qBAAa,eAAgB,SAAQ,QAAQ;CAAG;AAEhD,eAAO,MAAM,UAAU;oCACE,MAAM,KAAG,MAAM;sDACG,MAAM,KAAG,MAAM;;qCAGhC,MAAM,SAAS,MAAM,KAAG,MAAM;uCAC5B,MAAM,OAAO,MAAM,KAAG,MAAM;8CACrB,MAAM,KAAG,MAAM;0CAEnB,MAAM,KAAG,MAAM;;;qCAGpB,MAAM,UAAU,MAAM,EAAE,KAAG,MAAM;CACjD,CAAC;AAEX;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAEhF"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAIA,kGAAkG;AAClG,qBAAa,QAAS,SAAQ,KAAK;gBACrB,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,YAAY;IAMhD,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,QAAQ;CAGzC;AAED,sGAAsG;AACtG,qBAAa,WAAY,SAAQ,QAAQ;gBAC3B,OAAO,EAAE,MAAM;CAG5B;AAED;;;;GAIG;AACH,qBAAa,gBAAiB,SAAQ,QAAQ;gBAChC,OAAO,EAAE,MAAM;CAG5B;AAED;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,aAAa,GAAG,YAAY,GAAG,SAAS,GAAG,OAAO,CAAC;AAE/E;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,QAAQ;IAC7C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;gBAElB,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE;QAAE,KAAK,EAAE,KAAK,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,aAAa,CAAA;KAAE;CAKhG;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,EAAE,OAAO,EAAE,WAAW,GAAG,IAAI,CAUvF;AAID,qHAAqH;AACrH,qBAAa,eAAgB,SAAQ,QAAQ;CAAG;AAEhD,eAAO,MAAM,UAAU;oCACE,MAAM,KAAG,MAAM;sDACG,MAAM,KAAG,MAAM;;qCAGhC,MAAM,SAAS,MAAM,KAAG,MAAM;uCAC5B,MAAM,OAAO,MAAM,KAAG,MAAM;8CACrB,MAAM,KAAG,MAAM;0CAEnB,MAAM,KAAG,MAAM;;;;qCAIpB,MAAM,UAAU,MAAM,EAAE,KAAG,MAAM;CACjD,CAAC;AAEX;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAEhF"}
package/dist/errors.js CHANGED
@@ -1,3 +1,3 @@
1
- import{error as e}from"./_dev.js";var t=class e extends Error{constructor(e,t){super(e,t),this.name=new.target.name,Object.setPrototypeOf(this,new.target.prototype)}static is(t){return t instanceof e}},n=class extends t{constructor(e){super(e)}},r=class extends t{constructor(e){super(e)}},i=class extends t{component;phase;constructor(e,t){super(e,{cause:t.cause}),this.component=t.component,this.phase=t.phase}};function a(t,n){e(`<${t.component}> setup error (phase: ${t.phase}):`,t.cause),n.dispatchEvent(new CustomEvent(`ore:error`,{bubbles:!0,composed:!0,detail:t}))}var o=class extends t{},s={defineDuplicate:e=>`define('${e}') called twice — custom element already registered`,defineFieldRequiresFormAssociated:e=>`useField() requires define('${e}', { formAssociated: true })`,defineRequiresTag:`define() requires a tag name`,eachDuplicateKey:(e,t)=>`each() received duplicate key "${e}" at index ${t}`,injectStrictFailed:(e,t)=>`injectStrict() could not resolve key "${e}" in <${t}>`,invalidDynamicTagName:e=>`html\`...\`: dynamic tag name "${e}" is not a valid HTML element name`,invariantViolated:e=>`invariant violated: ${e}`,lifecycleOutsideSetup:`Lifecycle hooks must be called during component setup`,propInvalidReflect:`Structured props cannot use reflect:true — use prop.json() with reflect:false`,validationFailed:(e,t)=>`Validation failed for <${e}>:\n${t.join(`
1
+ import{error as e}from"./_dev.js";var t=class e extends Error{constructor(e,t){super(e,t),this.name=new.target.name,Object.setPrototypeOf(this,new.target.prototype)}static is(t){return t instanceof e}},n=class extends t{constructor(e){super(e)}},r=class extends t{constructor(e){super(e)}},i=class extends t{component;phase;constructor(e,t){super(e,{cause:t.cause}),this.component=t.component,this.phase=t.phase}};function a(t,n){e(`<${t.component}> setup error (phase: ${t.phase}):`,t.cause),n.dispatchEvent(new CustomEvent(`ore:error`,{bubbles:!0,composed:!0,detail:t}))}var o=class extends t{},s={defineDuplicate:e=>`define('${e}') called twice — custom element already registered`,defineFieldRequiresFormAssociated:e=>`useField() requires define('${e}', { formAssociated: true })`,defineRequiresTag:`define() requires a tag name`,eachDuplicateKey:(e,t)=>`each() received duplicate key "${e}" at index ${t}`,injectStrictFailed:(e,t)=>`injectStrict() could not resolve key "${e}" in <${t}>`,invalidDynamicTagName:e=>`html\`...\`: dynamic tag name "${e}" is not a valid HTML element name`,invariantViolated:e=>`invariant violated: ${e}`,lifecycleOutsideSetup:`Lifecycle hooks must be called during component setup`,mismatchedDynamicCloseTag:"html`...`: dynamic closing tag has no matching dynamic opening tag",propInvalidReflect:`Structured props cannot use reflect:true — use prop.json() with reflect:false`,validationFailed:(e,t)=>`Validation failed for <${e}>:\n${t.join(`
2
2
  `)}`};function c(e,t){if(!e)throw new r(s.invariantViolated(t))}export{s as ORE_ERRORS,n as OreApiError,t as OreError,r as OreInternalError,i as OreLifecycleError,o as OreTimeoutError,c as invariant,a as reportRuntimeError};
3
3
  //# sourceMappingURL=errors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","names":[],"sources":["../src/errors.ts"],"sourcesContent":["import { error as logError } from './_dev';\n\n// ─── Structured error types ───────────────────────────────────────────────────\n\n/** Base class for all Ore errors. Use `instanceof OreError` to catch any Ore-originated error. */\nexport class OreError extends Error {\n constructor(message: string, opts?: ErrorOptions) {\n super(message, opts);\n this.name = new.target.name;\n Object.setPrototypeOf(this, new.target.prototype);\n }\n\n static is(err: unknown): err is OreError {\n return err instanceof OreError;\n }\n}\n\n/** Thrown when Ore API is called incorrectly (e.g. outside setup, duplicate define, invalid prop). */\nexport class OreApiError extends OreError {\n constructor(message: string) {\n super(message);\n }\n}\n\n/**\n * Thrown when an internal invariant fails — e.g. compiled template metadata no\n * longer matching the DOM it was cloned from. Distinct from `OreApiError`: this\n * is never the caller's fault, it signals a bug in ore itself. See `invariant()`.\n */\nexport class OreInternalError extends OreError {\n constructor(message: string) {\n super(message);\n }\n}\n\n/**\n * The phase in which a component error occurred.\n * - `'setup'` — synchronous setup() threw\n * - `'async-setup'` — async setup() promise rejected\n * - `'mounted'` — an onMounted callback threw\n * - `'form-reset'` — an onFormReset callback threw\n */\nexport type OreErrorPhase = 'async-setup' | 'form-reset' | 'mounted' | 'setup';\n\n/**\n * Structured error thrown by the Ore runtime when component setup fails.\n * Provides component name and original cause for debugging.\n */\nexport class OreLifecycleError extends OreError {\n readonly component: string;\n readonly phase: OreErrorPhase;\n\n constructor(message: string, options: { cause: Error; component: string; phase: OreErrorPhase }) {\n super(message, { cause: options.cause });\n this.component = options.component;\n this.phase = options.phase;\n }\n}\n\n/**\n * Report a runtime error via the ore:error event and console.\n */\nexport function reportRuntimeError(error: OreLifecycleError, element: HTMLElement): void {\n logError(`<${error.component}> setup error (phase: ${error.phase}):`, error.cause);\n\n element.dispatchEvent(\n new CustomEvent('ore:error', {\n bubbles: true,\n composed: true,\n detail: error,\n }),\n );\n}\n\n// ─── Error message constants ─────────────────────────────────────────────────\n\n/** Thrown by `waitFor` and `waitForEvent` in the testing sub-path when a condition is not met within the timeout. */\nexport class OreTimeoutError extends OreError {}\n\nexport const ORE_ERRORS = {\n defineDuplicate: (tag: string): string => `define('${tag}') called twice — custom element already registered`,\n defineFieldRequiresFormAssociated: (tag: string): string =>\n `useField() requires define('${tag}', { formAssociated: true })`,\n defineRequiresTag: 'define() requires a tag name',\n eachDuplicateKey: (key: string, index: number): string => `each() received duplicate key \"${key}\" at index ${index}`,\n injectStrictFailed: (key: string, tag: string): string => `injectStrict() could not resolve key \"${key}\" in <${tag}>`,\n invalidDynamicTagName: (tagName: string): string =>\n `html\\`...\\`: dynamic tag name \"${tagName}\" is not a valid HTML element name`,\n invariantViolated: (message: string): string => `invariant violated: ${message}`,\n lifecycleOutsideSetup: 'Lifecycle hooks must be called during component setup',\n propInvalidReflect: 'Structured props cannot use reflect:true — use prop.json() with reflect:false',\n validationFailed: (tag: string, errors: string[]): string => `Validation failed for <${tag}>:\\n${errors.join('\\n')}`,\n} as const;\n\n/**\n * Assert an internal invariant that must always hold — e.g. compiled template\n * metadata staying in sync with the DOM it was cloned from. A failed invariant\n * means a bug in ore itself, never user input, so it throws `OreInternalError`\n * unconditionally (every build, never gated like `_dev.ts`'s `warn()`).\n *\n * Narrowing caveat: `asserts condition` only narrows the exact expression\n * passed in. Assign to a local `const` first — `invariant(el.parentNode, msg)`\n * does not narrow later reads of `el.parentNode`.\n */\nexport function invariant(condition: unknown, message: string): asserts condition {\n if (!condition) throw new OreInternalError(ORE_ERRORS.invariantViolated(message));\n}\n"],"mappings":"kCAKA,IAAa,EAAb,MAAa,UAAiB,KAAM,CAClC,YAAY,EAAiB,EAAqB,CAChD,MAAM,EAAS,CAAI,EACnB,KAAK,KAAO,IAAI,OAAO,KACvB,OAAO,eAAe,KAAM,IAAI,OAAO,SAAS,CAClD,CAEA,OAAO,GAAG,EAA+B,CACvC,OAAO,aAAe,CACxB,CACF,EAGa,EAAb,cAAiC,CAAS,CACxC,YAAY,EAAiB,CAC3B,MAAM,CAAO,CACf,CACF,EAOa,EAAb,cAAsC,CAAS,CAC7C,YAAY,EAAiB,CAC3B,MAAM,CAAO,CACf,CACF,EAea,EAAb,cAAuC,CAAS,CAC9C,UACA,MAEA,YAAY,EAAiB,EAAoE,CAC/F,MAAM,EAAS,CAAE,MAAO,EAAQ,KAAM,CAAC,EACvC,KAAK,UAAY,EAAQ,UACzB,KAAK,MAAQ,EAAQ,KACvB,CACF,EAKA,SAAgB,EAAmB,EAA0B,EAA4B,CACvF,EAAS,IAAI,EAAM,UAAU,wBAAwB,EAAM,MAAM,IAAK,EAAM,KAAK,EAEjF,EAAQ,cACN,IAAI,YAAY,YAAa,CAC3B,QAAS,GACT,SAAU,GACV,OAAQ,CACV,CAAC,CACH,CACF,CAKA,IAAa,EAAb,cAAqC,CAAS,CAAC,EAElC,EAAa,CACxB,gBAAkB,GAAwB,WAAW,EAAI,qDACzD,kCAAoC,GAClC,+BAA+B,EAAI,8BACrC,kBAAmB,+BACnB,kBAAmB,EAAa,IAA0B,kCAAkC,EAAI,aAAa,IAC7G,oBAAqB,EAAa,IAAwB,yCAAyC,EAAI,QAAQ,EAAI,GACnH,sBAAwB,GACtB,kCAAkC,EAAQ,oCAC5C,kBAAoB,GAA4B,uBAAuB,IACvE,sBAAuB,wDACvB,mBAAoB,gFACpB,kBAAmB,EAAa,IAA6B,0BAA0B,EAAI,MAAM,EAAO,KAAK;CAAI,GACnH,EAYA,SAAgB,EAAU,EAAoB,EAAoC,CAChF,GAAI,CAAC,EAAW,MAAM,IAAI,EAAiB,EAAW,kBAAkB,CAAO,CAAC,CAClF"}
1
+ {"version":3,"file":"errors.js","names":[],"sources":["../src/errors.ts"],"sourcesContent":["import { error as logError } from './_dev';\n\n// ─── Structured error types ───────────────────────────────────────────────────\n\n/** Base class for all Ore errors. Use `instanceof OreError` to catch any Ore-originated error. */\nexport class OreError extends Error {\n constructor(message: string, opts?: ErrorOptions) {\n super(message, opts);\n this.name = new.target.name;\n Object.setPrototypeOf(this, new.target.prototype);\n }\n\n static is(err: unknown): err is OreError {\n return err instanceof OreError;\n }\n}\n\n/** Thrown when Ore API is called incorrectly (e.g. outside setup, duplicate define, invalid prop). */\nexport class OreApiError extends OreError {\n constructor(message: string) {\n super(message);\n }\n}\n\n/**\n * Thrown when an internal invariant fails — e.g. compiled template metadata no\n * longer matching the DOM it was cloned from. Distinct from `OreApiError`: this\n * is never the caller's fault, it signals a bug in ore itself. See `invariant()`.\n */\nexport class OreInternalError extends OreError {\n constructor(message: string) {\n super(message);\n }\n}\n\n/**\n * The phase in which a component error occurred.\n * - `'setup'` — synchronous setup() threw\n * - `'async-setup'` — async setup() promise rejected\n * - `'mounted'` — an onMounted callback threw\n * - `'form-reset'` — an onFormReset callback threw\n */\nexport type OreErrorPhase = 'async-setup' | 'form-reset' | 'mounted' | 'setup';\n\n/**\n * Structured error thrown by the Ore runtime when component setup fails.\n * Provides component name and original cause for debugging.\n */\nexport class OreLifecycleError extends OreError {\n readonly component: string;\n readonly phase: OreErrorPhase;\n\n constructor(message: string, options: { cause: Error; component: string; phase: OreErrorPhase }) {\n super(message, { cause: options.cause });\n this.component = options.component;\n this.phase = options.phase;\n }\n}\n\n/**\n * Report a runtime error via the ore:error event and console.\n */\nexport function reportRuntimeError(error: OreLifecycleError, element: HTMLElement): void {\n logError(`<${error.component}> setup error (phase: ${error.phase}):`, error.cause);\n\n element.dispatchEvent(\n new CustomEvent('ore:error', {\n bubbles: true,\n composed: true,\n detail: error,\n }),\n );\n}\n\n// ─── Error message constants ─────────────────────────────────────────────────\n\n/** Thrown by `waitFor` and `waitForEvent` in the testing sub-path when a condition is not met within the timeout. */\nexport class OreTimeoutError extends OreError {}\n\nexport const ORE_ERRORS = {\n defineDuplicate: (tag: string): string => `define('${tag}') called twice — custom element already registered`,\n defineFieldRequiresFormAssociated: (tag: string): string =>\n `useField() requires define('${tag}', { formAssociated: true })`,\n defineRequiresTag: 'define() requires a tag name',\n eachDuplicateKey: (key: string, index: number): string => `each() received duplicate key \"${key}\" at index ${index}`,\n injectStrictFailed: (key: string, tag: string): string => `injectStrict() could not resolve key \"${key}\" in <${tag}>`,\n invalidDynamicTagName: (tagName: string): string =>\n `html\\`...\\`: dynamic tag name \"${tagName}\" is not a valid HTML element name`,\n invariantViolated: (message: string): string => `invariant violated: ${message}`,\n lifecycleOutsideSetup: 'Lifecycle hooks must be called during component setup',\n mismatchedDynamicCloseTag: 'html`...`: dynamic closing tag has no matching dynamic opening tag',\n propInvalidReflect: 'Structured props cannot use reflect:true — use prop.json() with reflect:false',\n validationFailed: (tag: string, errors: string[]): string => `Validation failed for <${tag}>:\\n${errors.join('\\n')}`,\n} as const;\n\n/**\n * Assert an internal invariant that must always hold — e.g. compiled template\n * metadata staying in sync with the DOM it was cloned from. A failed invariant\n * means a bug in ore itself, never user input, so it throws `OreInternalError`\n * unconditionally (every build, never gated like `_dev.ts`'s `warn()`).\n *\n * Narrowing caveat: `asserts condition` only narrows the exact expression\n * passed in. Assign to a local `const` first — `invariant(el.parentNode, msg)`\n * does not narrow later reads of `el.parentNode`.\n */\nexport function invariant(condition: unknown, message: string): asserts condition {\n if (!condition) throw new OreInternalError(ORE_ERRORS.invariantViolated(message));\n}\n"],"mappings":"kCAKA,IAAa,EAAb,MAAa,UAAiB,KAAM,CAClC,YAAY,EAAiB,EAAqB,CAChD,MAAM,EAAS,CAAI,EACnB,KAAK,KAAO,IAAI,OAAO,KACvB,OAAO,eAAe,KAAM,IAAI,OAAO,SAAS,CAClD,CAEA,OAAO,GAAG,EAA+B,CACvC,OAAO,aAAe,CACxB,CACF,EAGa,EAAb,cAAiC,CAAS,CACxC,YAAY,EAAiB,CAC3B,MAAM,CAAO,CACf,CACF,EAOa,EAAb,cAAsC,CAAS,CAC7C,YAAY,EAAiB,CAC3B,MAAM,CAAO,CACf,CACF,EAea,EAAb,cAAuC,CAAS,CAC9C,UACA,MAEA,YAAY,EAAiB,EAAoE,CAC/F,MAAM,EAAS,CAAE,MAAO,EAAQ,KAAM,CAAC,EACvC,KAAK,UAAY,EAAQ,UACzB,KAAK,MAAQ,EAAQ,KACvB,CACF,EAKA,SAAgB,EAAmB,EAA0B,EAA4B,CACvF,EAAS,IAAI,EAAM,UAAU,wBAAwB,EAAM,MAAM,IAAK,EAAM,KAAK,EAEjF,EAAQ,cACN,IAAI,YAAY,YAAa,CAC3B,QAAS,GACT,SAAU,GACV,OAAQ,CACV,CAAC,CACH,CACF,CAKA,IAAa,EAAb,cAAqC,CAAS,CAAC,EAElC,EAAa,CACxB,gBAAkB,GAAwB,WAAW,EAAI,qDACzD,kCAAoC,GAClC,+BAA+B,EAAI,8BACrC,kBAAmB,+BACnB,kBAAmB,EAAa,IAA0B,kCAAkC,EAAI,aAAa,IAC7G,oBAAqB,EAAa,IAAwB,yCAAyC,EAAI,QAAQ,EAAI,GACnH,sBAAwB,GACtB,kCAAkC,EAAQ,oCAC5C,kBAAoB,GAA4B,uBAAuB,IACvE,sBAAuB,wDACvB,0BAA2B,qEAC3B,mBAAoB,gFACpB,kBAAmB,EAAa,IAA6B,0BAA0B,EAAI,MAAM,EAAO,KAAK;CAAI,GACnH,EAYA,SAAgB,EAAU,EAAoB,EAAoC,CAChF,GAAI,CAAC,EAAW,MAAM,IAAI,EAAiB,EAAW,kBAAkB,CAAO,CAAC,CAClF"}
package/dist/ore.cjs CHANGED
@@ -1,3 +1,3 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@vielzeug/ripple");var t=t=>(0,e.computed)(()=>Object.entries(t).filter(([,t])=>typeof t==`function`?t():(0,e.isReactive)(t)?t.value:t).map(([e])=>e.replace(/\s+/g,``)).filter(Boolean).join(` `)),n=class e extends Error{constructor(e,t){super(e,t),this.name=new.target.name,Object.setPrototypeOf(this,new.target.prototype)}static is(t){return t instanceof e}},r=class extends n{constructor(e){super(e)}},i=class extends n{constructor(e){super(e)}},a=class extends n{component;phase;constructor(e,t){super(e,{cause:t.cause}),this.component=t.component,this.phase=t.phase}};function o(e,t){`${e.component}${e.phase}`,e.cause,t.dispatchEvent(new CustomEvent(`ore:error`,{bubbles:!0,composed:!0,detail:e}))}var s=class extends n{},c={defineDuplicate:e=>`define('${e}') called twice — custom element already registered`,defineFieldRequiresFormAssociated:e=>`useField() requires define('${e}', { formAssociated: true })`,defineRequiresTag:`define() requires a tag name`,eachDuplicateKey:(e,t)=>`each() received duplicate key "${e}" at index ${t}`,injectStrictFailed:(e,t)=>`injectStrict() could not resolve key "${e}" in <${t}>`,invalidDynamicTagName:e=>`html\`...\`: dynamic tag name "${e}" is not a valid HTML element name`,invariantViolated:e=>`invariant violated: ${e}`,lifecycleOutsideSetup:`Lifecycle hooks must be called during component setup`,propInvalidReflect:`Structured props cannot use reflect:true — use prop.json() with reflect:false`,validationFailed:(e,t)=>`Validation failed for <${e}>:\n${t.join(`
2
- `)}`};function l(e,t){if(!e)throw new i(c.invariantViolated(t))}function u(){return(0,e.signal)(null)}var d=e=>{let t=Symbol.for(e);return{is:e=>typeof e==`object`&&!!e&&t in e,stamp:e=>Object.assign(e,{[t]:!0})}},f=d(`ore:directive`),p=e=>f.stamp({mount:e}),m=f.is,h=d(`ore:spread`),g=e=>h.stamp({apply:e}),ee=h.is,_=d(`ore:html-result`),v=_.is;function te(e,t){return _.stamp({apply:t,fragment:e,mount:(n,r,i)=>{let a=Array.from(e.childNodes);return n.insertBefore(e,r),t(i),a}})}var y=e=>{for(let t=e.length-1;t>=0;t--)e[t]()},b=e=>{for(let t of e)t.remove()},ne=new Set([`action`,`cite`,`codebase`,`data`,`formaction`,`href`,`manifest`,`ping`,`poster`,`src`,`xlink:href`]),re=/^\s*(?:(?:javascript|vbscript|blob):|data:(?:[^,]*\/(?:html|svg\+xml)|application\/(?:xhtml|xml)))/i,x=(e,t,n)=>{let r=t.toLowerCase();if(/^on[a-z]/i.test(t)){`${t}${t.slice(2)}`,e.removeAttribute(t);return}if(r===`srcdoc`){e.removeAttribute(t);return}if(n==null||n===!1){e.removeAttribute(t);return}let i=n===!0?`true`:String(n);if(ne.has(r)&&re.test(i)){`${t}`,e.removeAttribute(t);return}e.setAttribute(t,i)},S=(e,t,n,r)=>{if(!e)return()=>{};let i=n;return e.addEventListener(t,i,r),()=>e.removeEventListener(t,i,r)},C=e=>e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),w=e=>Array.isArray(e)||typeof e==`object`&&!!e,ie=(t,n,r,i,a)=>{let o=(0,e.signal)(t),s=(0,e.signal)(n),c=r(o,s),l=[];return{cleanups:l,data:o,index:s,key:``,nodes:c.mount(i,a,e=>l.push(e))}},T=e=>{y(e.cleanups),b(e.nodes)},ae=(t,n,i,a,o,s)=>{let l=[],u=new Set;for(let e=0;e<n.length;e++){let t=String(i(n[e],e));if(u.has(t))throw new r(c.eachDuplicateKey(t,e));u.add(t),l.push(t)}for(let[e,n]of t)u.has(e)||(T(n),t.delete(e));let d=[];for(let r=0;r<n.length;r++){let i=l[r],c=t.get(i);if(c)(0,e.batch)(()=>{c.data.value=n[r],c.index.value=r}),d.push(c);else{let c=(0,e.untrack)(()=>ie(n[r],r,a,o,s));c.key=i,t.set(i,c),d.push(c)}}let f=s;for(let e=d.length-1;e>=0;e--){let t=d[e],n=t.nodes[0];if(n&&n!==f.previousSibling)for(let e of t.nodes)o.insertBefore(e,f);f=n??f}return d};function oe(t,n,r,i){let a=Array.isArray(t)?(0,e.signal)(t):typeof t==`function`?(0,e.computed)(t):t;return p((t,o)=>{let s=t.parentNode;l(s,`each() anchor comment has no parent node`);let c=document.createComment(`each/end`);s.insertBefore(c,t.nextSibling);let u=new Map,d=[],f=null,p=[],m=()=>{i&&(f=i().mount(s,c,e=>p.push(e)))},h=()=>{f&&(y(p),b(f),f=null,p=[])},g=(0,e.effect)(()=>{let t=a.value??[];if(t.length===0){for(let t of(0,e.untrack)(()=>d))T(t);u=new Map,d=[],f||(0,e.untrack)(m);return}h();try{d=(0,e.untrack)(()=>ae(u,t,n,r,s,c))}catch(e){`${e instanceof Error?e.message:String(e)}`;for(let e of u.values())T(e);u=new Map,d=[]}});o(()=>g.dispose()),o(()=>{h();for(let e of d)T(e);c.remove()})})}var E=new WeakSet,se=e=>(E.add(e),e),ce=e=>typeof e==`object`&&!!e&&E.has(e);function le(t){return g((n,r)=>{let i=n,a=i.type===`checkbox`,o=i.type===`number`||i.type===`range`,s=n instanceof HTMLSelectElement,c=s&&n.multiple,l=(0,e.effect)(()=>{let e=t.value;if(c){let t=Array.isArray(e)?e:[],r=n;for(let e of r.options)e.selected=t.includes(e.value)}else a?i.checked=!!e:n.value=e==null?``:String(e)});r(()=>l.dispose()),r(S(n,s?`change`:`input`,e=>{let n=e.target;if(c){let n=e.target;t.value=Array.from(n.selectedOptions).map(e=>e.value)}else a?t.value=n.checked:o?t.value=n.value===``?0:Number(n.value):t.value=n.value}))})}var D=null,O=!1,ue=e=>{D=e,e||(O=!1)},de=e=>D?D(e):(e&&!O&&(O=!0),e),k=(e,t,n)=>{let r=document.createElement(`template`);r.innerHTML=e;let i=Array.from(r.content.cloneNode(!0).childNodes);for(let e of i)t.insertBefore(e,n);return i};function A(t){if(typeof t==`function`){let n=(0,e.computed)(t);return p((e,t)=>{t(()=>n.dispose()),A(n).mount(e,t)})}return p((n,r)=>{let i=n.parentNode;l(i,`raw() anchor comment has no parent node`);let a=document.createComment(`raw/end`);if(i.insertBefore(a,n.nextSibling),(0,e.isReactive)(t)){let n=[],o=t,s=(0,e.effect)(()=>{b(n),n=k(de(o.value),i,a)});r(()=>s.dispose()),r(()=>{b(n),a.remove()})}else k(de(t),i,a),r(()=>a.remove())})}var fe=t=>{let n=typeof t==`function`?t():(0,e.isReactive)(t)?t.value:t;return n==null||n===!1?``:String(n).replace(/[;{}]/g,``)},pe=/[;{}]/g,me=t=>(0,e.computed)(()=>{let e=[];for(let[n,r]of Object.entries(t)){let t=fe(r);if(!t)continue;let i=C(n).replace(pe,``);i&&e.push(`${i}:${t}`)}return e.join(`;`)}),j=`when() anchor comment has no parent node`,M=(e,t,n,r)=>e.mount(t,n,r);function he(t,n,r){return typeof t!=`function`&&!(0,e.isReactive)(t)?p((e,i)=>{let a=t?n():r?r():null;if(!a||!v(a))return;let o=e.parentNode;l(o,j);let s=M(a,o,e,i);i(()=>b(s))}):p((i,a)=>{let o=typeof t==`function`?(0,e.computed)(t):null,s=o??t;o&&a(()=>o.dispose());let c=i.parentNode;l(c,j);let u=document.createComment(`when/end`);c.insertBefore(u,i.nextSibling);let d=[],f=[],p=(0,e.effect)(()=>{let t=s.value;y(f),b(d),f=[],d=[];let i=t?n():r?r():null;if(!i||!v(i))return;let a=[];d=(0,e.untrack)(()=>M(i,c,u,e=>a.push(e))),f=a});a(()=>p.dispose()),a(()=>{y(f),b(d),u.remove()})})}var N=null,P=(e,t)=>{let n=N;N=e;try{return t()}finally{N=n}},F=e=>{if(N)return N;throw new r(`${e}: ${c.lifecycleOutsideSetup}`)},I=()=>F(`getHost`).element,L=t=>N?((0,e.onCleanup)(t),!0):!1,R=e.onCleanup,z=e=>{F(`onMounted`).mountCallbacks.push(e)},B=e=>{F(`onFormReset`).formResetCallbacks.push(e)},V=t=>{let n=(0,e.effect)(t),r=()=>n.dispose();return L(r),r};function ge(e,t,n,r){if(F(`onEvent`),!e)return;let i=S(e,t,n,r);L(i)||i()}var _e=(e,t)=>V(()=>{let n=e.value;if(n)return t(n)}),H=new WeakMap,ve=e=>{let t=e.el??I();if(!t.constructor.formAssociated)throw new r(c.defineFieldRequiresFormAssociated(t.localName));if(H.has(t))throw new r(`useField() was already called on <${t.localName}>. Call it only once per component.`);let n=t.attachInternals();H.set(t,n),R(()=>H.delete(t));let i=e.toFormValue??(t=>t==null?e.emptyStringForNull?``:null:t instanceof File||t instanceof FormData?t:String(t));V(()=>{n.setFormValue(i(e.value.value))});let a=e.disabled;if(a&&`states`in n){let e=n.states;V(()=>{a.value?e.add(`disabled`):e.delete(`disabled`)})}return e.validity&&V(()=>{let t=e.validity?.value??{},r=Object.values(t).some(Boolean),i=e.validationMessage?.value??``;if(r&&!i){n.setValidity(t,`Invalid value.`);return}n.setValidity(t,i)}),e.onReset&&B(e.onReset),{checkValidity:()=>n.checkValidity(),internals:n,reportValidity:()=>n.reportValidity(),setCustomValidity:e=>e?n.setValidity({customError:!0},e):n.setValidity({}),setValidity:n.setValidity.bind(n)}},U=new WeakMap,ye=e=>{let t=[],n=e;for(;n;){n instanceof HTMLElement&&t.push(n);let e=n.getRootNode();n=n.parentElement??(e instanceof ShadowRoot?e.host:null)}return t},be=(e,t,n)=>{let r=U.get(e)??new Map;r.has(t)&&`${e.localName}`,r.set(t,n),U.set(e,r)},xe=(e,t)=>be(I(),e,t),W=Symbol(`inject.not_found`),G=new WeakMap,Se=(e,t)=>{let n=ye(e);for(let e of n){let n=U.get(e);if(n?.has(t))return n.get(t)}return W};function K(e,...t){let n=F(`inject`),r=G.get(n);r||(r=new Map,G.set(n,r));let i=e;if(r.has(i)){let e=r.get(i);return e===W?t.length>0?t[0]:void 0:e}let a=Se(n.element,e);return r.set(i,a),a===W?t.length>0?t[0]:void 0:a}var Ce=e=>{let t=K(e,W);if(t!==W)return t;let n=I();throw new r(c.injectStrictFailed(String(e),n.localName))};function q(e){return Symbol(e)}var we=q(`ore:form-context`);function Te(t={}){let n=(0,e.signal)([]),r=(0,e.signal)(!1),i=(0,e.signal)(!1),a=(0,e.signal)(null);return{clearStatus:()=>{i.value=!1,a.value=null,t.onReset?.()},dirty:i,error:a,markDirty:()=>{i.value=!0},registerField:e=>(n.value=[...n.value,e],()=>{n.value=n.value.filter(t=>t!==e)}),submit:async e=>{if(e?.preventDefault(),!r.value){r.value=!0,a.value=null;try{await t.onSubmit?.(e),i.value=!1}catch(e){a.value=e}finally{r.value=!1}}},submitting:r,valid:(0,e.computed)(()=>n.value.every(e=>e.value))}}function Ee(e){return{default:e,parse:()=>e,reflect:!1}}var De={bool(e){return{default:e??!1,parse:e=>e!==null&&e!==`false`,reflect:!0}},data(e){return Ee(e)},json(e){return{default:e,parse:t=>{if(t==null||t===``)return e;try{return JSON.parse(t)}catch{return e}},reflect:!1}},number(e){let t=e===void 0?void 0:e;return{default:t,parse:e=>{if(e==null)return t;let n=Number(e);return Number.isNaN(n)?(`${e}${String(t)}`,t):n},reflect:!0}},oneOf(e,t){return{default:t,parse:n=>n!=null&&e.includes(n)?n:t,reflect:!0}},string(e){let t=e===void 0?void 0:e;return{default:t,parse:e=>e??t,reflect:!0}}},Oe=e=>typeof e==`object`&&!!e&&`default`in e&&`parse`in e;function J(e,t){if(!Oe(e))throw new r(`Prop "${t}" must use a prop.* helper (string/number/bool/json/oneOf). Received: ${typeof e}`);let n=e;if(!n.parse)throw new r(`Prop "${t}" must have a parse function. Use prop.* helpers.`);let i=n.reflect??!1;if(i&&w(n.default))throw new r(`Prop "${t}": ${c.propInvalidReflect}`);return{...n,reflect:i}}function ke(e){let t=[];for(let[n,r]of Object.entries(e))try{J(r,n)}catch(e){t.push(e instanceof Error?e.message:String(e))}return t}var Y=new WeakMap,Ae=(e,t)=>Y.get(e)?.get(t),je=(e,t)=>typeof e==`string`?t(e):e,Me=(t,n,r,i)=>{Y.has(t)||Y.set(t,new Map);let{default:a,parse:o,reflect:s=!1}=i,c=(0,e.signal)(a),u=Object.hasOwn(t,n),d=u?t[n]:void 0,f={parse:o,reflect:s,signal:c};u?(delete t[n],c.value=je(d,o)):t.hasAttribute(r)&&(c.value=o(t.getAttribute(r)));let p=Y.get(t);return l(p,`propRegistry entry missing for <${t.localName}> — registerProp() must create it above`),p.set(r,f),Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get:()=>c.value,set:e=>{c.value=je(e,o)}}),s&&V(()=>{let e=c.value;e==null?t.removeAttribute(r):typeof e==`boolean`?t.toggleAttribute(r,e):x(t,r,e)}),c};function Ne(e,t){let n={};for(let[r,i]of Object.entries(t))n[r]=Me(e,r,C(r),i);return n}var X={LOADING:`loading`,SETUP_DONE:`setup_done`,SETUP_RUNNING:`setup_running`,UNINITIALIZED:`uninitialized`,UNMOUNTED:`unmounted`},Pe={CONNECT:`ore:connect`,DISCONNECT:`ore:disconnect`},Fe=new WeakSet,Ie=e=>typeof e==`object`&&!!e&&Fe.has(e),Le=function(){return this.content},Re=(e,...t)=>{let n=``;for(let r=0;r<e.length;r++)if(n+=e[r],r<t.length){let e=t[r];n+=Ie(e)?e.content:String(e)}let r={content:n.trim(),toString:Le};return Fe.add(r),r},Z=new Map,ze=e=>{if(e instanceof CSSStyleSheet)return e;let t=typeof e==`string`?e:e.content,n=Z.get(t);if(n)return n;let r=new CSSStyleSheet;try{r.replaceSync(t)}catch{}return Z.set(t,r),r},Be=()=>({formResetCallbacks:[],generation:0,mountCallbacks:[],phase:X.UNINITIALIZED,scope:(0,e.scope)(),templateResult:null}),Ve=class extends HTMLElement{static _definition;static _normalizedPropDefs;static formAssociated=!1;static observedAttributes=[];_component;constructor(){super();let e=this.constructor._definition;e?.shadow!==!1&&this.attachShadow({mode:`open`,...e?.shadow}),this._component=Be()}connectedCallback(){(0,e.untrack)(()=>{this._component.phase===X.UNINITIALIZED&&this._runSetup(),this._init()}),this.dispatchEvent(new CustomEvent(Pe.CONNECT,{bubbles:!1,composed:!1}))}attributeChangedCallback(t,n,r){if(n===r)return;let i=Ae(this,t);if(!i)return;let a=i.parse(r);Object.is((0,e.untrack)(()=>i.signal.value),a)||(i.signal.value=a)}disconnectedCallback(){this._component.generation++,this._component.phase=X.UNMOUNTED,this.dispatchEvent(new CustomEvent(Pe.DISCONNECT,{bubbles:!1,composed:!1})),this._component.scope.dispose(),this._component.formResetCallbacks=[],this._component.mountCallbacks=[],this._component.phase=X.UNINITIALIZED,this._component.scope=(0,e.scope)(),this._component.templateResult=null}formResetCallback(){for(let e of this._component.formResetCallbacks)try{e()}catch(e){this._handleSetupError(e,`form-reset`)}}_handleSetupError(e,t=`setup`){let n=e instanceof Error?e:Error(String(e)),r=new a(`<${this.localName}> failed during ${this._component.phase} (${t})`,{cause:n,component:this.localName,phase:t}),i=this.constructor._definition;if(i?.onError)try{return i.onError(r,this)}catch{}o(r,this)}_runSetup(){this._component.phase=X.SETUP_RUNNING;let e=this.constructor._definition,t=this.constructor._normalizedPropDefs,n={element:this,formResetCallbacks:[],mountCallbacks:[]};try{let r;if(this._component.scope.run(()=>{r=P(n,()=>{let n=t?Ne(this,t):{};return e.setup(n)})}),this._component.mountCallbacks.push(...n.mountCallbacks),this._component.formResetCallbacks.push(...n.formResetCallbacks),r!=null&&typeof r.then==`function`){let t=this._component.mountCallbacks.splice(0);this._component.phase=X.LOADING,e.loading&&(this._component.templateResult=e.loading()),this._runSetupAsync(r,t,this._component.generation)}else this._component.templateResult=r??null,this._component.phase=X.SETUP_DONE}catch(e){let t=this._handleSetupError(e);if(t)this._component.templateResult=t,this._component.phase=X.SETUP_DONE;else throw this._component.phase=X.UNINITIALIZED,e}}_isStale(e){return this._component.generation!==e||!this.isConnected}async _runSetupAsync(e,t,n){try{let r=await e;if(this._isStale(n)){`${this.localName}`;return}this._component.templateResult=r??null,this._component.phase=X.SETUP_DONE,this._component.mountCallbacks.push(...t),r&&this._applyResult(r),this._scheduleMountCallbacks()}catch(e){if(this._isStale(n)){`${this.localName}`;return}let t=this._handleSetupError(e,`async-setup`);t?(this._component.templateResult=t,this._component.phase=X.SETUP_DONE,this._applyResult(t)):this._component.phase=X.UNINITIALIZED}}_applyResult(e){e&&((this.shadowRoot??this).replaceChildren(e.fragment),this._component.scope.run(()=>{e.apply(R)}))}_init(){this._applyStyles(),this._mountTemplate(),this._component.phase===X.SETUP_DONE&&this._scheduleMountCallbacks()}_applyStyles(){let e=this.constructor._definition;this.shadowRoot&&e?.styles?.length&&(this.shadowRoot.adoptedStyleSheets=e.styles.map(ze))}_mountTemplate(){let e=this._component.templateResult;e&&this._applyResult(e)}_scheduleMountCallbacks(){if(this._component.mountCallbacks.length===0)return;let e=this._component.generation;queueMicrotask(()=>{if(this._isStale(e))return;let t=this._component.mountCallbacks.splice(0);for(let e of t)try{let t={element:this,formResetCallbacks:[],mountCallbacks:[]};this._component.scope.run(()=>{P(t,()=>{let t=e();typeof t==`function`&&R(t)})}),t.mountCallbacks.length>0&&this._component.mountCallbacks.push(...t.mountCallbacks),t.formResetCallbacks.length>0&&this._component.formResetCallbacks.push(...t.formResetCallbacks)}catch(e){this._handleSetupError(e,`mounted`)}this._component.mountCallbacks.length>0&&this._scheduleMountCallbacks()})}};function He(e,t){if(!e)throw new r(c.defineRequiresTag);if(customElements.get(e))throw new r(c.defineDuplicate(e));let{props:n}=t,i=(()=>{if(!n)return;let t=ke(n);if(t.length>0)throw new r(c.validationFailed(e,t));let i={};for(let[e,t]of Object.entries(n))i[e]=J(t,e);return i})(),a=i?Object.keys(i).map(C):[],o=class extends Ve{static _definition=t;static _normalizedPropDefs=i;static formAssociated=t.formAssociated??!1;static observedAttributes=a};Object.defineProperty(o,"name",{value:e}),customElements.define(e,o)}var Ue=`default`,Q=e=>e||Ue,We=t=>{let n=new Map,r=new Map,i=new Map,a=t=>{let r=n.get(t);return r||(r={elements:(0,e.signal)([]),presence:(0,e.signal)(!1)},n.set(t,r)),r},o=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0},s=e=>{let t=Q(e),n=r.get(t),i=[];if(n)for(let e of n)i.push(...e.assignedElements({flatten:!0}));let s=a(t);o(s.elements.value,i)||(s.elements.value=i);let c=i.length>0;s.presence.value!==c&&(s.presence.value=c)},c=e=>{if(i.has(e))return;let t=Q(e.getAttribute(`name`)),n=r.get(t)??new Set;n.add(e),r.set(t,n);let a=()=>s(t);e.addEventListener(`slotchange`,a),i.set(e,()=>{e.removeEventListener(`slotchange`,a)}),s(t)},l=e=>{let t=i.get(e);if(!t)return;t(),i.delete(e);let n=Q(e.getAttribute(`name`)),a=r.get(n);a&&(a.delete(e),a.size===0&&r.delete(n)),s(n)},u=()=>{t.shadowRoot?.querySelectorAll(`slot`).forEach(e=>c(e))},d=()=>{for(let e of r.keys())s(e)},f=null;return t.shadowRoot&&(f=new MutationObserver(e=>{for(let t of e)for(let e of t.removedNodes)e instanceof HTMLSlotElement&&l(e);u(),d()}),f.observe(t.shadowRoot,{childList:!0,subtree:!0})),u(),z(()=>{u(),d()}),R(()=>{f?.disconnect(),f=null;for(let e of i.values())e();i.clear(),r.clear(),n.clear()}),{elements:e=>a(Q(e)).elements,has:e=>a(Q(e)).presence}},Ge=new WeakMap,Ke=()=>{let e=F(`useSlots`),t=Ge.get(e);return t||(t=We(e.element),Ge.set(e,t)),t},qe=e=>e===`role`||e.startsWith(`aria-`)?e:e.startsWith(`aria`)?`aria-${e.slice(4).toLowerCase()}`:`aria-${e}`,Je=e=>e===`role`||e.startsWith(`aria-`)?e:e.startsWith(`aria`)?`aria-${e.slice(4).toLowerCase()}`:e,Ye=(e,t)=>{let n=t?.target??I(),r=[];if(e.attr)for(let[t,i]of Object.entries(e.attr)){let e=Qe(n,Xe(t),i);e&&r.push(e)}if(e.class&&r.push(tt(n,e.class)),e.style)for(let[t,i]of Object.entries(e.style)){let e=et(n,t,i);e&&r.push(e)}if(e.on){let{target:i,...a}=t??{};for(let t of Object.keys(e.on)){let i=e.on[t];i&&r.push(S(n,t,i,a))}}let i=()=>{for(let e of r)e()};return L(i),i},Xe=Je,Ze=(t,n)=>{if(typeof t==`function`)return V(()=>n(t()));if((0,e.isReactive)(t))return V(()=>n(t.value));n(t)};function Qe(e,t,n){return Ze(n,n=>x(e,t,n))}var $e=/[;{}]/g;function et(e,t,n){let r=(t.startsWith(`--`)?t:C(t)).replace($e,``);if(!r)return;let i=!1;return Ze(n,t=>{t!=null&&t!==``?(i=!0,e.style.setProperty(r,String(t).replace($e,``))):i&&e.style.removeProperty(r)})}function tt(t,n){let r=typeof n==`function`?n:()=>{let t={};for(let[r,i]of Object.entries(n))t[r]=typeof i==`function`?i():(0,e.isReactive)(i)?i.value:!!i;return t},i=new Set;return V(()=>{let e=new Set;for(let[n,a]of Object.entries(r()))a&&(e.add(n),i.has(n)||t.classList.add(n));for(let n of i)e.has(n)||t.classList.remove(n);i=e})}var nt=(e,t)=>{let n={};for(let[e,r]of Object.entries(t))n[qe(e)]=r;return Ye({attr:n},{target:e})},rt={bubbles:!0,cancelable:!0,composed:!1},it=()=>{let e=I();return((t,...n)=>{let r=n.length>0?{...rt,detail:n[0]}:rt;return e.dispatchEvent(new CustomEvent(String(t),r))})},at=(t,n,r)=>{let i=(0,e.effect)(()=>n(t.value));r(()=>i.dispose())},ot=e=>e.value,st=(e,t)=>{at(e.signal,t=>{e.node.textContent=String(t??``)},t)},ct=e=>e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement,lt=(e,t,n,r)=>{let i=t==null?``:String(t);n&&r.last!==void 0&&!Object.is(e.value,r.last)&&!Object.is(e.value,i)||(e.value=i,n&&(r.last=i))},ut=(e,t,n,r)=>{let i=!!t;n&&r.last!==void 0&&e.checked!==!!r.last&&e.checked!==i||(e.checked=i,n&&(r.last=i))},dt=(t,n,r,i)=>{let a=w(i)?i:n.parse(r.mode===`bool`?i?``:null:i==null||i===!1?null:String(i));if(Object.is((0,e.untrack)(()=>n.signal.value),a)||(n.signal.value=a),!n.reflect){if(w(i))return;r.mode===`bool`?t.toggleAttribute(r.name,!!i):x(t,r.name,i)}},ft=(t,n)=>{let{el:r,mode:i,name:a,propMeta:o}=t,s={last:void 0},c=n=>{if(o){dt(r,o,t,n);return}if(!(0,e.isReactive)(n)&&w(n)){a!==`__proto__`&&a!==`constructor`&&a!==`prototype`&&(r[a]=n);return}if(a===`value`&&ct(r)){lt(r,n,t.live,s);return}if(a===`checked`&&r instanceof HTMLInputElement){ut(r,n,t.live,s);return}i===`bool`?r.toggleAttribute(a,!!n):x(r,a,n)};`signal`in t?at(t.signal,c,n):c(t.value)},pt=(e,t)=>{t(S(e.el,e.name,e.handler,e.options))},mt=(e,t)=>{let{el:n,ref:r}=e;if(typeof r==`function`){r(n),t(()=>r(null));return}r.value=n,t(()=>{r.value=null})},ht=(e,t,n)=>{let r=[],i=t.parentNode;l(i,`html binding anchor has no parent node`);for(let a of e)if(v(a)){let e=Array.from(a.fragment.childNodes);i.insertBefore(a.fragment,t),a.apply(n),r.push(...e)}else if(a!=null&&a!==!1){let e=document.createTextNode(String(a));i.insertBefore(e,t),r.push(e)}return r},gt=(t,n)=>{let{anchor:r,signal:i}=t,a=[],o=()=>{y(a),a=[]},s=[],c=(0,e.effect)(()=>{let t=ot(i);o(),b(s),s=[],!(t==null||t.length===0)&&(0,e.untrack)(()=>{s=ht(t,r,e=>a.push(e))})});n(()=>{c.dispose(),o(),b(s)})},_t=(e,t)=>{e.directive.mount(e.anchor,t)},vt=(e,t)=>{e.spread.apply(e.el,t)},yt=(e,t)=>{switch(e.type){case`attr`:ft(e,t);break;case`directive`:_t(e,t);break;case`event`:pt(e,t);break;case`html`:gt(e,t);break;case`ref`:mt(e,t);break;case`spread`:vt(e,t);break;case`text`:st(e,t);break}},bt=(t,n,r,i)=>{let a=Ae(t,r);return ce(i)?{el:t,live:!0,mode:n,name:r,propMeta:a,signal:i,type:`attr`}:typeof i==`function`?{el:t,mode:n,name:r,propMeta:a,signal:(0,e.computed)(i),type:`attr`}:(0,e.isReactive)(i)?{el:t,mode:n,name:r,propMeta:a,signal:i,type:`attr`}:{el:t,mode:n,name:r,propMeta:a,type:`attr`,value:i}},xt=e=>e==null?``:String(e),St={prevent:e=>t=>{t.preventDefault(),e(t)},self:e=>t=>{t.target===t.currentTarget&&e(t)},stop:e=>t=>{t.stopPropagation(),e(t)}},Ct=(e,t)=>{let n=e;for(let e of t){let t=St[e];t&&(n=t(n))}let r={};return t.includes(`capture`)&&(r.capture=!0),t.includes(`once`)&&(r.once=!0),t.includes(`passive`)&&(r.passive=!0),{handler:n,...Object.keys(r).length?{options:r}:{}}},$={ATTR:`attr`,BOOL_ATTR:`boolAttr`,CLOSE_TAG:`closeTag`,EVENT:`event`,NODE:`node`,REF:`ref`,SPREAD:`spread`,TAG_NAME:`tagname`},wt=/\s+@([a-zA-Z_][-a-zA-Z0-9_.-]*)\s*=\s*["']?$/,Tt=/\s+ref\s*=\s*["']?$/,Et=/\s+\?([a-zA-Z_][-a-zA-Z0-9_]*)\s*=\s*["']?$/,Dt=/\s+:?([a-zA-Z_][-a-zA-Z0-9_]*)\s*=\s*["']?$/,Ot=e=>{let t=e.lastIndexOf(`<`);return t<=e.lastIndexOf(`>`)?!1:e[t+1]!==`/`},kt=e=>{let t,n=e.trimEnd();if(n.endsWith(`</`))return{kind:$.CLOSE_TAG,prefix:e};if(n.endsWith(`<`))return{kind:$.TAG_NAME,prefix:e};if(t=wt.exec(e)){let n=e.slice(0,-t[0].length),r=t[1].split(`.`);return{kind:$.EVENT,modifiers:r.slice(1),name:r[0],prefix:n}}return(t=Tt.exec(e))?{kind:$.REF,prefix:e.slice(0,-t[0].length)}:(t=Et.exec(e))?{kind:$.BOOL_ATTR,name:t[1],prefix:e.slice(0,-t[0].length)}:(t=Dt.exec(e))?{kind:$.ATTR,name:t[1],prefix:e.slice(0,-t[0].length)}:Ot(e)?{kind:$.SPREAD,prefix:e.trimEnd()}:{kind:$.NODE,prefix:e}},At=new WeakMap,jt=e=>{let t=Array.from(e);for(let e=0;e<t.length-1;e++){let n=t[e],r=n[n.length-1];if(r===`"`||r===`'`){t[e]=n.slice(0,-1);let i=t[e+1];i.startsWith(r)&&(t[e+1]=i.slice(1))}if(t[e].trimEnd().endsWith(`</`)){let n=t[e+1];n.startsWith(`>`)&&(t[e+1]=n.slice(1))}}return t},Mt=(e,t,n,r)=>{if(e.nodeType===Node.ELEMENT_NODE){let r=e,i=r.getAttribute(`u`);i!==null&&(n.set(Number(i),[...t]),r.removeAttribute(`u`))}else if(e.nodeType===Node.COMMENT_NODE){let n=e.nodeValue;n!==null&&/^\d+$/.test(n)&&r.set(Number(n),[...t])}let i=e.childNodes;for(let e=0;e<i.length;e++)Mt(i[e],[...t,e],n,r)},Nt=e=>{let t=jt(e),n=``,r,i=0,a=0,o=[],s=[];for(let e=0;e<t.length-1;e++){let c=t[e],l=kt(c);if(l.kind===$.TAG_NAME){let e=i++;r=e,s.push(e);let t=c.replace(/<\s*$/,``);n+=t+`<ore-dyn-${e} u="${e}"`,o.push({elementId:e,kind:$.TAG_NAME})}else if(l.kind===$.CLOSE_TAG){let e=s.pop()??0,t=c.replace(/<\/\s*$/,``);n+=t+`</ore-dyn-${e}>`,o.push({kind:$.CLOSE_TAG}),r=void 0}else if(l.kind===$.NODE)n+=l.prefix+`<!--${a}-->`,o.push({commentId:a,kind:$.NODE}),a++,r=void 0;else{r===void 0||l.prefix.lastIndexOf(`<`)>l.prefix.lastIndexOf(`>`)?(r=i++,n+=`${l.prefix} u="${r}"`):n+=l.prefix;let e=l.kind===$.BOOL_ATTR?`bool`:l.kind===$.ATTR?`attr`:void 0;o.push({elementId:r,kind:l.kind,mode:e,modifiers:l.modifiers,name:l.name})}}n+=t[t.length-1]??``;let c=document.createElement(`template`);c.innerHTML=n;let l=new Map,u=new Map,d=c.content.childNodes;for(let e=0;e<d.length;e++)Mt(d[e],[e],l,u);return{commentPaths:u,element:c,elementPaths:l,slots:o}},Pt=e=>{let t=At.get(e);return t||(t=Nt(e),At.set(e,t)),t},Ft=(e,t)=>{let n=e;for(let e of t)n=n.childNodes[e];return n},It="html`...`: node-slot comment anchor has no parent node",Lt=(t,n)=>{let i=Pt(t),a=i.element.content.cloneNode(!0),o=[],s=[],u=i.slots.map((e,t)=>{let r=n[t];if(e.kind===$.CLOSE_TAG)return{slot:e,value:r};if(e.kind===$.NODE){let t=i.commentPaths.get(e.commentId);return l(t,`compiled template is missing a comment path for node slot ${e.commentId}`),{comment:Ft(a,t),slot:e,value:r}}let o=i.elementPaths.get(e.elementId);return l(o,`compiled template is missing an element path for slot ${e.elementId}`),{el:Ft(a,o),slot:e,value:r}}),d=new Map;for(let{el:e,slot:t,value:n}of u){if(t.kind!==$.TAG_NAME)continue;let i=String(n);if(!/^[a-z][a-z0-9._-]*$/i.test(i))throw new r(c.invalidDynamicTagName(i));let a=document.createElement(i);for(let t of Array.from(e.attributes))a.setAttribute(t.name,t.value);for(;e.firstChild;)a.appendChild(e.firstChild);e.replaceWith(a),d.set(e,a)}for(let{comment:t,el:n,slot:r,value:i}of u){if(r.kind===$.TAG_NAME||r.kind===$.CLOSE_TAG)continue;let a=n&&(d.get(n)??n);if(r.kind===$.NODE){let n=t;if(m(i)){o.push({anchor:n,directive:i,type:`directive`});continue}if(v(i)){let e=n.parentNode;for(l(e,It);i.fragment.firstChild;)e.insertBefore(i.fragment.firstChild,n);n.remove(),s.push(i.apply.bind(i));continue}if(typeof i==`function`){let t=(0,e.computed)(()=>{let e=i();return Array.isArray(e)?e:[e]});o.push({anchor:n,signal:t,type:`html`});continue}if((0,e.isReactive)(i)){let t=(0,e.computed)(()=>{let e=i.value;return Array.isArray(e)?e:[e]});o.push({anchor:n,signal:t,type:`html`});continue}if(Array.isArray(i)){let e=n.parentNode;l(e,It);for(let t of i)if(v(t)){for(;t.fragment.firstChild;)e.insertBefore(t.fragment.firstChild,n);s.push(t.apply.bind(t))}else e.insertBefore(document.createTextNode(xt(t)),n);n.remove();continue}n.replaceWith(document.createTextNode(xt(i)));continue}let c=a;if(r.kind===$.EVENT){if(typeof i==`function`){let{handler:e,options:t}=Ct(i,r.modifiers??[]);o.push({el:c,handler:e,name:r.name,options:t,type:`event`})}else if((0,e.isReactive)(i)){let e=i,{handler:t,options:n}=Ct(t=>{let n=e.value;typeof n==`function`&&n(t)},r.modifiers??[]);o.push({el:c,handler:t,name:r.name,options:n,type:`event`})}continue}if(r.kind===$.REF){i&&o.push({el:c,ref:i,type:`ref`});continue}if(r.kind===$.SPREAD){ee(i)&&o.push({el:c,spread:i,type:`spread`});continue}o.push(bt(c,r.mode??`attr`,r.name,i))}return te(a,e=>{for(let t of o)yt(t,e);for(let t of s)t(e)})},Rt=(e,...t)=>Lt(e,t),zt=0,Bt=0,Vt=Math.random().toString(36).slice(2,6),Ht=(e=`id`)=>`${e}-${++zt}`,Ut=(e=`id`)=>`${e}-${Vt}${++Bt}`,Wt=()=>{Bt=0},Gt=(t,n)=>{let r=(0,e.signal)(null),i=new IntersectionObserver(([e])=>{e&&(r.value=e)},n);return i.observe(t),(0,e.onCleanup)(()=>i.disconnect()),r},Kt=t=>{let n=window.matchMedia(t),r=(0,e.signal)(n.matches),i=e=>{r.value=e.matches};return n.addEventListener(`change`,i),(0,e.onCleanup)(()=>n.removeEventListener(`change`,i)),r},qt=(t,n={attributes:!0,characterData:!0,childList:!0,subtree:!0})=>{let r=(0,e.signal)({entries:[],latest:null}),i=new MutationObserver(e=>{r.value={entries:e,latest:e.length>0?e[e.length-1]:null}});return i.observe(t,n),(0,e.onCleanup)(()=>i.disconnect()),r},Jt=t=>{let n=(0,e.signal)({height:0,width:0}),r=new ResizeObserver(([e])=>{if(!e)return;let t=e.contentBoxSize[0];t&&(n.value={height:t.blockSize,width:t.inlineSize})});return r.observe(t),(0,e.onCleanup)(()=>r.disconnect()),n};exports.FORM_CONTEXT_KEY=we,exports.OreApiError=r,exports.OreError=n,exports.OreInternalError=i,exports.OreLifecycleError=a,exports.OreTimeoutError=s,exports.aria=nt,exports.bind=Ye,exports.classMap=t,exports.createContext=q,exports.createFormContext=Te,exports.createId=Ht,exports.createStableId=Ut,exports.css=Re,exports.define=He,exports.each=oe,exports.getHost=I,exports.html=Rt,exports.inject=K,exports.injectStrict=Ce,exports.intersectionObserver=Gt,exports.live=se,exports.mediaObserver=Kt,exports.model=le,exports.mutationObserver=qt,exports.onCleanup=R,exports.onElement=_e,exports.onEvent=ge,exports.onFormReset=B,exports.onMounted=z,exports.prop=De,exports.provide=xe,exports.raw=A,exports.ref=u,exports.resetIdCounter=Wt,exports.resizeObserver=Jt,exports.setRawSanitizer=ue,exports.styleMap=me,exports.useEmit=it,exports.useField=ve,exports.useSlots=Ke,exports.watchEffect=V,exports.when=he;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@vielzeug/ripple");var t=t=>(0,e.computed)(()=>Object.entries(t).filter(([,t])=>typeof t==`function`?t():(0,e.isReactive)(t)?t.value:t).map(([e])=>e.replace(/\s+/g,``)).filter(Boolean).join(` `)),n=class e extends Error{constructor(e,t){super(e,t),this.name=new.target.name,Object.setPrototypeOf(this,new.target.prototype)}static is(t){return t instanceof e}},r=class extends n{constructor(e){super(e)}},i=class extends n{constructor(e){super(e)}},a=class extends n{component;phase;constructor(e,t){super(e,{cause:t.cause}),this.component=t.component,this.phase=t.phase}};function o(e,t){`${e.component}${e.phase}`,e.cause,t.dispatchEvent(new CustomEvent(`ore:error`,{bubbles:!0,composed:!0,detail:e}))}var s=class extends n{},c={defineDuplicate:e=>`define('${e}') called twice — custom element already registered`,defineFieldRequiresFormAssociated:e=>`useField() requires define('${e}', { formAssociated: true })`,defineRequiresTag:`define() requires a tag name`,eachDuplicateKey:(e,t)=>`each() received duplicate key "${e}" at index ${t}`,injectStrictFailed:(e,t)=>`injectStrict() could not resolve key "${e}" in <${t}>`,invalidDynamicTagName:e=>`html\`...\`: dynamic tag name "${e}" is not a valid HTML element name`,invariantViolated:e=>`invariant violated: ${e}`,lifecycleOutsideSetup:`Lifecycle hooks must be called during component setup`,mismatchedDynamicCloseTag:"html`...`: dynamic closing tag has no matching dynamic opening tag",propInvalidReflect:`Structured props cannot use reflect:true — use prop.json() with reflect:false`,validationFailed:(e,t)=>`Validation failed for <${e}>:\n${t.join(`
2
+ `)}`};function l(e,t){if(!e)throw new i(c.invariantViolated(t))}function u(){return(0,e.signal)(null)}var d=e=>{let t=Symbol.for(e);return{is:e=>typeof e==`object`&&!!e&&t in e,stamp:e=>Object.assign(e,{[t]:!0})}},f=d(`ore:directive`),p=e=>f.stamp({mount:e}),m=f.is,h=d(`ore:spread`),g=e=>h.stamp({apply:e}),ee=h.is,_=d(`ore:html-result`),v=_.is;function te(e,t){return _.stamp({apply:t,fragment:e,mount:(n,r,i)=>{let a=Array.from(e.childNodes);return n.insertBefore(e,r),t(i),a}})}var y=e=>{for(let t=e.length-1;t>=0;t--)e[t]()},b=e=>{for(let t of e)t.remove()},ne=new Set([`action`,`cite`,`codebase`,`data`,`formaction`,`href`,`manifest`,`ping`,`poster`,`src`,`xlink:href`]),re=/^\s*(?:(?:javascript|vbscript|blob):|data:(?:[^,]*\/(?:html|svg\+xml)|application\/(?:xhtml|xml)))/i,x=(e,t,n)=>{let r=t.toLowerCase();if(/^on[a-z]/i.test(t)){`${t}${t.slice(2)}`,e.removeAttribute(t);return}if(r===`srcdoc`){e.removeAttribute(t);return}if(n==null||n===!1){e.removeAttribute(t);return}let i=n===!0?`true`:String(n);if(ne.has(r)&&re.test(i)){`${t}`,e.removeAttribute(t);return}e.setAttribute(t,i)},S=(e,t,n,r)=>{if(!e)return()=>{};let i=n;return e.addEventListener(t,i,r),()=>e.removeEventListener(t,i,r)},C=e=>e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),w=e=>Array.isArray(e)||typeof e==`object`&&!!e,ie=(t,n,r,i,a)=>{let o=(0,e.signal)(t),s=(0,e.signal)(n),c=r(o,s),l=[];return{cleanups:l,data:o,index:s,key:``,nodes:c.mount(i,a,e=>l.push(e))}},T=e=>{y(e.cleanups),b(e.nodes)},ae=(t,n,i,a,o,s)=>{let l=[],u=new Set;for(let e=0;e<n.length;e++){let t=String(i(n[e],e));if(u.has(t))throw new r(c.eachDuplicateKey(t,e));u.add(t),l.push(t)}for(let[e,n]of t)u.has(e)||(T(n),t.delete(e));let d=[];for(let r=0;r<n.length;r++){let i=l[r],c=t.get(i);if(c)(0,e.batch)(()=>{c.data.value=n[r],c.index.value=r}),d.push(c);else{let c=(0,e.untrack)(()=>ie(n[r],r,a,o,s));c.key=i,t.set(i,c),d.push(c)}}let f=s;for(let e=d.length-1;e>=0;e--){let t=d[e],n=t.nodes[0];if(n&&n!==f.previousSibling)for(let e of t.nodes)o.insertBefore(e,f);f=n??f}return d};function oe(t,n,r,i){let a=Array.isArray(t)?(0,e.signal)(t):typeof t==`function`?(0,e.computed)(t):t;return p((t,o)=>{let s=t.parentNode;l(s,`each() anchor comment has no parent node`);let c=document.createComment(`each/end`);s.insertBefore(c,t.nextSibling);let u=new Map,d=[],f=null,p=[],m=()=>{i&&(f=i().mount(s,c,e=>p.push(e)))},h=()=>{f&&(y(p),b(f),f=null,p=[])},g=(0,e.effect)(()=>{let t=a.value??[];if(t.length===0){for(let t of(0,e.untrack)(()=>d))T(t);u=new Map,d=[],f||(0,e.untrack)(m);return}h();try{d=(0,e.untrack)(()=>ae(u,t,n,r,s,c))}catch(e){`${e instanceof Error?e.message:String(e)}`;for(let e of u.values())T(e);u=new Map,d=[]}});o(()=>g.dispose()),o(()=>{h();for(let e of d)T(e);c.remove()})})}var E=new WeakSet,se=e=>(E.add(e),e),ce=e=>typeof e==`object`&&!!e&&E.has(e);function le(t){return g((n,r)=>{let i=n,a=i.type===`checkbox`,o=i.type===`number`||i.type===`range`,s=n instanceof HTMLSelectElement,c=s&&n.multiple,l=(0,e.effect)(()=>{let e=t.value;if(c){let t=Array.isArray(e)?e:[],r=n;for(let e of r.options)e.selected=t.includes(e.value)}else a?i.checked=!!e:n.value=e==null?``:String(e)});r(()=>l.dispose()),r(S(n,s?`change`:`input`,e=>{let n=e.target;if(c){let n=e.target;t.value=Array.from(n.selectedOptions).map(e=>e.value)}else a?t.value=n.checked:o?t.value=n.value===``?0:Number(n.value):t.value=n.value}))})}var D=null,O=!1,ue=e=>{D=e,e||(O=!1)},de=e=>D?D(e):(e&&!O&&(O=!0),e),k=(e,t,n)=>{let r=document.createElement(`template`);r.innerHTML=e;let i=Array.from(r.content.cloneNode(!0).childNodes);for(let e of i)t.insertBefore(e,n);return i};function A(t){if(typeof t==`function`){let n=(0,e.computed)(t);return p((e,t)=>{t(()=>n.dispose()),A(n).mount(e,t)})}return p((n,r)=>{let i=n.parentNode;l(i,`raw() anchor comment has no parent node`);let a=document.createComment(`raw/end`);if(i.insertBefore(a,n.nextSibling),(0,e.isReactive)(t)){let n=[],o=t,s=(0,e.effect)(()=>{b(n),n=k(de(o.value),i,a)});r(()=>s.dispose()),r(()=>{b(n),a.remove()})}else k(de(t),i,a),r(()=>a.remove())})}var fe=t=>{let n=typeof t==`function`?t():(0,e.isReactive)(t)?t.value:t;return n==null||n===!1?``:String(n).replace(/[;{}]/g,``)},pe=/[;{}]/g,me=t=>(0,e.computed)(()=>{let e=[];for(let[n,r]of Object.entries(t)){let t=fe(r);if(!t)continue;let i=C(n).replace(pe,``);i&&e.push(`${i}:${t}`)}return e.join(`;`)}),j=`when() anchor comment has no parent node`,M=(e,t,n,r)=>e.mount(t,n,r);function he(t,n,r){return typeof t!=`function`&&!(0,e.isReactive)(t)?p((e,i)=>{let a=t?n():r?r():null;if(!a||!v(a))return;let o=e.parentNode;l(o,j);let s=M(a,o,e,i);i(()=>b(s))}):p((i,a)=>{let o=typeof t==`function`?(0,e.computed)(t):null,s=o??t;o&&a(()=>o.dispose());let c=i.parentNode;l(c,j);let u=document.createComment(`when/end`);c.insertBefore(u,i.nextSibling);let d=[],f=[],p=(0,e.effect)(()=>{let t=s.value;y(f),b(d),f=[],d=[];let i=t?n():r?r():null;if(!i||!v(i))return;let a=[];d=(0,e.untrack)(()=>M(i,c,u,e=>a.push(e))),f=a});a(()=>p.dispose()),a(()=>{y(f),b(d),u.remove()})})}var N=null,P=(e,t)=>{let n=N;N=e;try{return t()}finally{N=n}},F=e=>{if(N)return N;throw new r(`${e}: ${c.lifecycleOutsideSetup}`)},I=()=>F(`getHost`).element,L=t=>N?((0,e.onCleanup)(t),!0):!1,R=e.onCleanup,z=e=>{F(`onMounted`).mountCallbacks.push(e)},B=e=>{F(`onFormReset`).formResetCallbacks.push(e)},V=t=>{let n=(0,e.effect)(t),r=()=>n.dispose();return L(r),r};function ge(e,t,n,r){if(F(`onEvent`),!e)return;let i=S(e,t,n,r);L(i)||i()}var _e=(e,t)=>V(()=>{let n=e.value;if(n)return t(n)}),H=new WeakMap,ve=e=>{let t=e.el??I();if(!t.constructor.formAssociated)throw new r(c.defineFieldRequiresFormAssociated(t.localName));if(H.has(t))throw new r(`useField() was already called on <${t.localName}>. Call it only once per component.`);let n=t.attachInternals();H.set(t,n),R(()=>H.delete(t));let i=e.toFormValue??(t=>t==null?e.emptyStringForNull?``:null:t instanceof File||t instanceof FormData?t:String(t));V(()=>{n.setFormValue(i(e.value.value))});let a=e.disabled;if(a&&`states`in n){let e=n.states;V(()=>{a.value?e.add(`disabled`):e.delete(`disabled`)})}return e.validity&&V(()=>{let t=e.validity?.value??{},r=Object.values(t).some(Boolean),i=e.validationMessage?.value??``;if(r&&!i){n.setValidity(t,`Invalid value.`);return}n.setValidity(t,i)}),e.onReset&&B(e.onReset),{checkValidity:()=>n.checkValidity(),internals:n,reportValidity:()=>n.reportValidity(),setCustomValidity:e=>e?n.setValidity({customError:!0},e):n.setValidity({}),setValidity:n.setValidity.bind(n)}},U=new WeakMap,ye=e=>{let t=[],n=e;for(;n;){n instanceof HTMLElement&&t.push(n);let e=n.getRootNode();n=n.parentElement??(e instanceof ShadowRoot?e.host:null)}return t},be=(e,t,n)=>{let r=U.get(e)??new Map;r.has(t)&&`${e.localName}`,r.set(t,n),U.set(e,r)},xe=(e,t)=>be(I(),e,t),W=Symbol(`inject.not_found`),G=new WeakMap,Se=(e,t)=>{let n=ye(e);for(let e of n){let n=U.get(e);if(n?.has(t))return n.get(t)}return W};function K(e,...t){let n=F(`inject`),r=G.get(n);r||(r=new Map,G.set(n,r));let i=e;if(r.has(i)){let e=r.get(i);return e===W?t.length>0?t[0]:void 0:e}let a=Se(n.element,e);return r.set(i,a),a===W?t.length>0?t[0]:void 0:a}var Ce=e=>{let t=K(e,W);if(t!==W)return t;let n=I();throw new r(c.injectStrictFailed(String(e),n.localName))};function q(e){return Symbol(e)}var we=q(`ore:form-context`);function Te(t={}){let n=(0,e.signal)([]),r=(0,e.signal)(!1),i=(0,e.signal)(!1),a=(0,e.signal)(null);return{clearStatus:()=>{i.value=!1,a.value=null,t.onReset?.()},dirty:i,error:a,markDirty:()=>{i.value=!0},registerField:e=>(n.value=[...n.value,e],()=>{n.value=n.value.filter(t=>t!==e)}),submit:async e=>{if(e?.preventDefault(),!r.value){r.value=!0,a.value=null;try{await t.onSubmit?.(e),i.value=!1}catch(e){a.value=e}finally{r.value=!1}}},submitting:r,valid:(0,e.computed)(()=>n.value.every(e=>e.value))}}function Ee(e){return{default:e,parse:()=>e,reflect:!1}}var De={bool(e){return{default:e??!1,parse:e=>e!==null&&e!==`false`,reflect:!0}},data(e){return Ee(e)},json(e){return{default:e,parse:t=>{if(t==null||t===``)return e;try{return JSON.parse(t)}catch{return e}},reflect:!1}},number(e){let t=e===void 0?void 0:e;return{default:t,parse:e=>{if(e==null)return t;let n=Number(e);return Number.isNaN(n)?(`${e}${String(t)}`,t):n},reflect:!0}},oneOf(e,t){return{default:t,parse:n=>n!=null&&e.includes(n)?n:t,reflect:!0}},string(e){let t=e===void 0?void 0:e;return{default:t,parse:e=>e??t,reflect:!0}}},Oe=e=>typeof e==`object`&&!!e&&`default`in e&&`parse`in e;function J(e,t){if(!Oe(e))throw new r(`Prop "${t}" must use a prop.* helper (string/number/bool/json/oneOf). Received: ${typeof e}`);let n=e;if(!n.parse)throw new r(`Prop "${t}" must have a parse function. Use prop.* helpers.`);let i=n.reflect??!1;if(i&&w(n.default))throw new r(`Prop "${t}": ${c.propInvalidReflect}`);return{...n,reflect:i}}function ke(e){let t=[];for(let[n,r]of Object.entries(e))try{J(r,n)}catch(e){t.push(e instanceof Error?e.message:String(e))}return t}var Y=new WeakMap,Ae=(e,t)=>Y.get(e)?.get(t),je=(e,t)=>typeof e==`string`?t(e):e,Me=(t,n,r,i)=>{Y.has(t)||Y.set(t,new Map);let{default:a,parse:o,reflect:s=!1}=i,c=(0,e.signal)(a),u=Object.hasOwn(t,n),d=u?t[n]:void 0,f={parse:o,reflect:s,signal:c};u?(delete t[n],c.value=je(d,o)):t.hasAttribute(r)&&(c.value=o(t.getAttribute(r)));let p=Y.get(t);return l(p,`propRegistry entry missing for <${t.localName}> — registerProp() must create it above`),p.set(r,f),Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get:()=>c.value,set:e=>{c.value=je(e,o)}}),s&&V(()=>{let e=c.value;e==null?t.removeAttribute(r):typeof e==`boolean`?t.toggleAttribute(r,e):x(t,r,e)}),c};function Ne(e,t){let n={};for(let[r,i]of Object.entries(t))n[r]=Me(e,r,C(r),i);return n}var X={LOADING:`loading`,SETUP_DONE:`setup_done`,SETUP_RUNNING:`setup_running`,UNINITIALIZED:`uninitialized`,UNMOUNTED:`unmounted`},Pe={CONNECT:`ore:connect`,DISCONNECT:`ore:disconnect`},Fe=new WeakSet,Ie=e=>typeof e==`object`&&!!e&&Fe.has(e),Le=function(){return this.content},Re=(e,...t)=>{let n=``;for(let r=0;r<e.length;r++)if(n+=e[r],r<t.length){let e=t[r];n+=Ie(e)?e.content:String(e)}let r={content:n.trim(),toString:Le};return Fe.add(r),r},Z=new Map,ze=e=>{if(e instanceof CSSStyleSheet)return e;let t=typeof e==`string`?e:e.content,n=Z.get(t);if(n)return n;let r=new CSSStyleSheet;try{r.replaceSync(t)}catch{}return Z.set(t,r),r},Be=()=>({formResetCallbacks:[],generation:0,mountCallbacks:[],phase:X.UNINITIALIZED,scope:(0,e.scope)(),templateResult:null}),Ve=class extends HTMLElement{static _definition;static _normalizedPropDefs;static formAssociated=!1;static observedAttributes=[];_component;constructor(){super();let e=this.constructor._definition;e?.shadow!==!1&&this.attachShadow({mode:`open`,...e?.shadow}),this._component=Be()}connectedCallback(){(0,e.untrack)(()=>{this._component.phase===X.UNINITIALIZED&&this._runSetup(),this._init()}),this.dispatchEvent(new CustomEvent(Pe.CONNECT,{bubbles:!1,composed:!1}))}attributeChangedCallback(t,n,r){if(n===r)return;let i=Ae(this,t);if(!i)return;let a=i.parse(r);Object.is((0,e.untrack)(()=>i.signal.value),a)||(i.signal.value=a)}disconnectedCallback(){this._component.generation++,this._component.phase=X.UNMOUNTED,this.dispatchEvent(new CustomEvent(Pe.DISCONNECT,{bubbles:!1,composed:!1})),this._component.scope.dispose(),this._component.formResetCallbacks=[],this._component.mountCallbacks=[],this._component.phase=X.UNINITIALIZED,this._component.scope=(0,e.scope)(),this._component.templateResult=null}formResetCallback(){for(let e of this._component.formResetCallbacks)try{e()}catch(e){this._handleSetupError(e,`form-reset`)}}_handleSetupError(e,t=`setup`){let n=e instanceof Error?e:Error(String(e)),r=new a(`<${this.localName}> failed during ${this._component.phase} (${t})`,{cause:n,component:this.localName,phase:t}),i=this.constructor._definition;if(i?.onError)try{return i.onError(r,this)}catch{}o(r,this)}_runSetup(){this._component.phase=X.SETUP_RUNNING;let e=this.constructor._definition,t=this.constructor._normalizedPropDefs,n={element:this,formResetCallbacks:[],mountCallbacks:[]};try{let r;if(this._component.scope.run(()=>{r=P(n,()=>{let n=t?Ne(this,t):{};return e.setup(n)})}),this._component.mountCallbacks.push(...n.mountCallbacks),this._component.formResetCallbacks.push(...n.formResetCallbacks),r!=null&&typeof r.then==`function`){let t=this._component.mountCallbacks.splice(0);this._component.phase=X.LOADING,e.loading&&(this._component.templateResult=e.loading()),this._runSetupAsync(r,t,this._component.generation)}else this._component.templateResult=r??null,this._component.phase=X.SETUP_DONE}catch(e){let t=this._handleSetupError(e);if(t)this._component.templateResult=t,this._component.phase=X.SETUP_DONE;else throw this._component.phase=X.UNINITIALIZED,e}}_isStale(e){return this._component.generation!==e||!this.isConnected}async _runSetupAsync(e,t,n){try{let r=await e;if(this._isStale(n)){`${this.localName}`;return}this._component.templateResult=r??null,this._component.phase=X.SETUP_DONE,this._component.mountCallbacks.push(...t),r&&this._applyResult(r),this._scheduleMountCallbacks()}catch(e){if(this._isStale(n)){`${this.localName}`;return}let t=this._handleSetupError(e,`async-setup`);t?(this._component.templateResult=t,this._component.phase=X.SETUP_DONE,this._applyResult(t)):this._component.phase=X.UNINITIALIZED}}_applyResult(e){e&&((this.shadowRoot??this).replaceChildren(e.fragment),this._component.scope.run(()=>{e.apply(R)}))}_init(){this._applyStyles(),this._mountTemplate(),this._component.phase===X.SETUP_DONE&&this._scheduleMountCallbacks()}_applyStyles(){let e=this.constructor._definition;this.shadowRoot&&e?.styles?.length&&(this.shadowRoot.adoptedStyleSheets=e.styles.map(ze))}_mountTemplate(){let e=this._component.templateResult;e&&this._applyResult(e)}_scheduleMountCallbacks(){if(this._component.mountCallbacks.length===0)return;let e=this._component.generation;queueMicrotask(()=>{if(this._isStale(e))return;let t=this._component.mountCallbacks.splice(0);for(let e of t)try{let t={element:this,formResetCallbacks:[],mountCallbacks:[]};this._component.scope.run(()=>{P(t,()=>{let t=e();typeof t==`function`&&R(t)})}),t.mountCallbacks.length>0&&this._component.mountCallbacks.push(...t.mountCallbacks),t.formResetCallbacks.length>0&&this._component.formResetCallbacks.push(...t.formResetCallbacks)}catch(e){this._handleSetupError(e,`mounted`)}this._component.mountCallbacks.length>0&&this._scheduleMountCallbacks()})}};function He(e,t){if(!e)throw new r(c.defineRequiresTag);if(customElements.get(e))throw new r(c.defineDuplicate(e));let{props:n}=t,i=(()=>{if(!n)return;let t=ke(n);if(t.length>0)throw new r(c.validationFailed(e,t));let i={};for(let[e,t]of Object.entries(n))i[e]=J(t,e);return i})(),a=i?Object.keys(i).map(C):[],o=class extends Ve{static _definition=t;static _normalizedPropDefs=i;static formAssociated=t.formAssociated??!1;static observedAttributes=a};Object.defineProperty(o,"name",{value:e}),customElements.define(e,o)}var Ue=`default`,Q=e=>e||Ue,We=t=>{let n=new Map,r=new Map,i=new Map,a=t=>{let r=n.get(t);return r||(r={elements:(0,e.signal)([]),presence:(0,e.signal)(!1)},n.set(t,r)),r},o=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0},s=e=>{let t=Q(e),n=r.get(t),i=[];if(n)for(let e of n)i.push(...e.assignedElements({flatten:!0}));let s=a(t);o(s.elements.value,i)||(s.elements.value=i);let c=i.length>0;s.presence.value!==c&&(s.presence.value=c)},c=e=>{if(i.has(e))return;let t=Q(e.getAttribute(`name`)),n=r.get(t)??new Set;n.add(e),r.set(t,n);let a=()=>s(t);e.addEventListener(`slotchange`,a),i.set(e,()=>{e.removeEventListener(`slotchange`,a)}),s(t)},l=e=>{let t=i.get(e);if(!t)return;t(),i.delete(e);let n=Q(e.getAttribute(`name`)),a=r.get(n);a&&(a.delete(e),a.size===0&&r.delete(n)),s(n)},u=()=>{t.shadowRoot?.querySelectorAll(`slot`).forEach(e=>c(e))},d=()=>{for(let e of r.keys())s(e)},f=null;return t.shadowRoot&&(f=new MutationObserver(e=>{for(let t of e)for(let e of t.removedNodes)e instanceof HTMLSlotElement&&l(e);u(),d()}),f.observe(t.shadowRoot,{childList:!0,subtree:!0})),u(),z(()=>{u(),d()}),R(()=>{f?.disconnect(),f=null;for(let e of i.values())e();i.clear(),r.clear(),n.clear()}),{elements:e=>a(Q(e)).elements,has:e=>a(Q(e)).presence}},Ge=new WeakMap,Ke=()=>{let e=F(`useSlots`),t=Ge.get(e);return t||(t=We(e.element),Ge.set(e,t)),t},qe=e=>e===`role`||e.startsWith(`aria-`)?e:e.startsWith(`aria`)?`aria-${e.slice(4).toLowerCase()}`:`aria-${e}`,Je=e=>e===`role`||e.startsWith(`aria-`)?e:e.startsWith(`aria`)?`aria-${e.slice(4).toLowerCase()}`:e,Ye=(e,t)=>{let n=t?.target??I(),r=[];if(e.attr)for(let[t,i]of Object.entries(e.attr)){let e=Qe(n,Xe(t),i);e&&r.push(e)}if(e.class&&r.push(tt(n,e.class)),e.style)for(let[t,i]of Object.entries(e.style)){let e=et(n,t,i);e&&r.push(e)}if(e.on){let{target:i,...a}=t??{};for(let t of Object.keys(e.on)){let i=e.on[t];i&&r.push(S(n,t,i,a))}}let i=()=>{for(let e of r)e()};return L(i),i},Xe=Je,Ze=(t,n)=>{if(typeof t==`function`)return V(()=>n(t()));if((0,e.isReactive)(t))return V(()=>n(t.value));n(t)};function Qe(e,t,n){return Ze(n,n=>x(e,t,n))}var $e=/[;{}]/g;function et(e,t,n){let r=(t.startsWith(`--`)?t:C(t)).replace($e,``);if(!r)return;let i=!1;return Ze(n,t=>{t!=null&&t!==``?(i=!0,e.style.setProperty(r,String(t).replace($e,``))):i&&e.style.removeProperty(r)})}function tt(t,n){let r=typeof n==`function`?n:()=>{let t={};for(let[r,i]of Object.entries(n))t[r]=typeof i==`function`?i():(0,e.isReactive)(i)?i.value:!!i;return t},i=new Set;return V(()=>{let e=new Set;for(let[n,a]of Object.entries(r()))a&&(e.add(n),i.has(n)||t.classList.add(n));for(let n of i)e.has(n)||t.classList.remove(n);i=e})}var nt=(e,t)=>{let n={};for(let[e,r]of Object.entries(t))n[qe(e)]=r;return Ye({attr:n},{target:e})},rt={bubbles:!0,cancelable:!0,composed:!1},it=()=>{let e=I();return((t,...n)=>{let r=n.length>0?{...rt,detail:n[0]}:rt;return e.dispatchEvent(new CustomEvent(String(t),r))})},at=(t,n,r)=>{let i=(0,e.effect)(()=>n(t.value));r(()=>i.dispose())},ot=e=>e.value,st=(e,t)=>{at(e.signal,t=>{e.node.textContent=String(t??``)},t)},ct=e=>e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement,lt=(e,t,n,r)=>{let i=t==null?``:String(t);n&&r.last!==void 0&&!Object.is(e.value,r.last)&&!Object.is(e.value,i)||(e.value=i,n&&(r.last=i))},ut=(e,t,n,r)=>{let i=!!t;n&&r.last!==void 0&&e.checked!==!!r.last&&e.checked!==i||(e.checked=i,n&&(r.last=i))},dt=(t,n,r,i)=>{let a=w(i)?i:n.parse(r.mode===`bool`?i?``:null:i==null||i===!1?null:String(i));if(Object.is((0,e.untrack)(()=>n.signal.value),a)||(n.signal.value=a),!n.reflect){if(w(i))return;r.mode===`bool`?t.toggleAttribute(r.name,!!i):x(t,r.name,i)}},ft=(t,n)=>{let{el:r,mode:i,name:a,propMeta:o}=t,s={last:void 0},c=n=>{if(o){dt(r,o,t,n);return}if(!(0,e.isReactive)(n)&&w(n)){a!==`__proto__`&&a!==`constructor`&&a!==`prototype`&&(r[a]=n);return}if(a===`value`&&ct(r)){lt(r,n,t.live,s);return}if(a===`checked`&&r instanceof HTMLInputElement){ut(r,n,t.live,s);return}i===`bool`?r.toggleAttribute(a,!!n):x(r,a,n)};`signal`in t?at(t.signal,c,n):c(t.value)},pt=(e,t)=>{t(S(e.el,e.name,e.handler,e.options))},mt=(e,t)=>{let{el:n,ref:r}=e;if(typeof r==`function`){r(n),t(()=>r(null));return}r.value=n,t(()=>{r.value=null})},ht=(e,t,n)=>{let r=[],i=t.parentNode;l(i,`html binding anchor has no parent node`);for(let a of e)if(v(a)){let e=Array.from(a.fragment.childNodes);i.insertBefore(a.fragment,t),a.apply(n),r.push(...e)}else if(a!=null&&a!==!1){let e=document.createTextNode(String(a));i.insertBefore(e,t),r.push(e)}return r},gt=(t,n)=>{let{anchor:r,signal:i}=t,a=[],o=()=>{y(a),a=[]},s=[],c=(0,e.effect)(()=>{let t=ot(i);o(),b(s),s=[],!(t==null||t.length===0)&&(0,e.untrack)(()=>{s=ht(t,r,e=>a.push(e))})});n(()=>{c.dispose(),o(),b(s)})},_t=(e,t)=>{e.directive.mount(e.anchor,t)},vt=(e,t)=>{e.spread.apply(e.el,t)},yt=(e,t)=>{switch(e.type){case`attr`:ft(e,t);break;case`directive`:_t(e,t);break;case`event`:pt(e,t);break;case`html`:gt(e,t);break;case`ref`:mt(e,t);break;case`spread`:vt(e,t);break;case`text`:st(e,t);break}},bt=(t,n,r,i)=>{let a=Ae(t,r);return ce(i)?{el:t,live:!0,mode:n,name:r,propMeta:a,signal:i,type:`attr`}:typeof i==`function`?{el:t,mode:n,name:r,propMeta:a,signal:(0,e.computed)(i),type:`attr`}:(0,e.isReactive)(i)?{el:t,mode:n,name:r,propMeta:a,signal:i,type:`attr`}:{el:t,mode:n,name:r,propMeta:a,type:`attr`,value:i}},xt=e=>e==null?``:String(e),St={prevent:e=>t=>{t.preventDefault(),e(t)},self:e=>t=>{t.target===t.currentTarget&&e(t)},stop:e=>t=>{t.stopPropagation(),e(t)}},Ct=(e,t)=>{let n=e;for(let e of t){let t=St[e];t&&(n=t(n))}let r={};return t.includes(`capture`)&&(r.capture=!0),t.includes(`once`)&&(r.once=!0),t.includes(`passive`)&&(r.passive=!0),{handler:n,...Object.keys(r).length?{options:r}:{}}},$={ATTR:`attr`,BOOL_ATTR:`boolAttr`,CLOSE_TAG:`closeTag`,EVENT:`event`,NODE:`node`,REF:`ref`,SPREAD:`spread`,TAG_NAME:`tagname`},wt=/\s+@([a-zA-Z_][-a-zA-Z0-9_.-]*)\s*=\s*["']?$/,Tt=/\s+ref\s*=\s*["']?$/,Et=/\s+\?([a-zA-Z_][-a-zA-Z0-9_]*)\s*=\s*["']?$/,Dt=/\s+:?([a-zA-Z_][-a-zA-Z0-9_]*)\s*=\s*["']?$/,Ot=e=>{let t=e.lastIndexOf(`<`);return t<=e.lastIndexOf(`>`)?!1:e[t+1]!==`/`},kt=e=>{let t,n=e.trimEnd();if(n.endsWith(`</`))return{kind:$.CLOSE_TAG,prefix:e};if(n.endsWith(`<`))return{kind:$.TAG_NAME,prefix:e};if(t=wt.exec(e)){let n=e.slice(0,-t[0].length),r=t[1].split(`.`);return{kind:$.EVENT,modifiers:r.slice(1),name:r[0],prefix:n}}return(t=Tt.exec(e))?{kind:$.REF,prefix:e.slice(0,-t[0].length)}:(t=Et.exec(e))?{kind:$.BOOL_ATTR,name:t[1],prefix:e.slice(0,-t[0].length)}:(t=Dt.exec(e))?{kind:$.ATTR,name:t[1],prefix:e.slice(0,-t[0].length)}:Ot(e)?{kind:$.SPREAD,prefix:e.trimEnd()}:{kind:$.NODE,prefix:e}},At=new WeakMap,jt=e=>{let t=Array.from(e);for(let e=0;e<t.length-1;e++){let n=t[e],r=n[n.length-1];if(r===`"`||r===`'`){t[e]=n.slice(0,-1);let i=t[e+1];i.startsWith(r)&&(t[e+1]=i.slice(1))}if(t[e].trimEnd().endsWith(`</`)){let n=t[e+1];n.startsWith(`>`)&&(t[e+1]=n.slice(1))}}return t},Mt=(e,t,n,r)=>{if(e.nodeType===Node.ELEMENT_NODE){let r=e,i=r.getAttribute(`u`);i!==null&&(n.set(Number(i),[...t]),r.removeAttribute(`u`))}else if(e.nodeType===Node.COMMENT_NODE){let n=e.nodeValue;n!==null&&/^\d+$/.test(n)&&r.set(Number(n),[...t])}let i=e.childNodes;for(let e=0;e<i.length;e++)Mt(i[e],[...t,e],n,r)},Nt=e=>{let t=jt(e),n=``,i,a=0,o=0,s=[],l=[];for(let e=0;e<t.length-1;e++){let u=t[e],d=kt(u);if(d.kind===$.TAG_NAME){let e=a++;i=e,l.push(e);let t=u.replace(/<\s*$/,``);n+=t+`<ore-dyn-${e} u="${e}"`,s.push({elementId:e,kind:$.TAG_NAME})}else if(d.kind===$.CLOSE_TAG){if(l.length===0)throw new r(c.mismatchedDynamicCloseTag);let e=l.pop(),t=u.replace(/<\/\s*$/,``);n+=t+`</ore-dyn-${e}>`,s.push({kind:$.CLOSE_TAG}),i=void 0}else if(d.kind===$.NODE)n+=d.prefix+`<!--${o}-->`,s.push({commentId:o,kind:$.NODE}),o++,i=void 0;else{i===void 0||d.prefix.lastIndexOf(`<`)>d.prefix.lastIndexOf(`>`)?(i=a++,n+=`${d.prefix} u="${i}"`):n+=d.prefix;let e=d.kind===$.BOOL_ATTR?`bool`:d.kind===$.ATTR?`attr`:void 0;s.push({elementId:i,kind:d.kind,mode:e,modifiers:d.modifiers,name:d.name})}}n+=t[t.length-1]??``;let u=document.createElement(`template`);u.innerHTML=n;let d=new Map,f=new Map,p=u.content.childNodes;for(let e=0;e<p.length;e++)Mt(p[e],[e],d,f);return{commentPaths:f,element:u,elementPaths:d,slots:s}},Pt=e=>{let t=At.get(e);return t||(t=Nt(e),At.set(e,t)),t},Ft=(e,t)=>{let n=e;for(let e of t)n=n.childNodes[e];return n},It="html`...`: node-slot comment anchor has no parent node",Lt=(t,n)=>{let i=Pt(t),a=i.element.content.cloneNode(!0),o=[],s=[],u=i.slots.map((e,t)=>{let r=n[t];if(e.kind===$.CLOSE_TAG)return{slot:e,value:r};if(e.kind===$.NODE){let t=i.commentPaths.get(e.commentId);return l(t,`compiled template is missing a comment path for node slot ${e.commentId}`),{comment:Ft(a,t),slot:e,value:r}}let o=i.elementPaths.get(e.elementId);return l(o,`compiled template is missing an element path for slot ${e.elementId}`),{el:Ft(a,o),slot:e,value:r}}),d=new Map;for(let{el:e,slot:t,value:n}of u){if(t.kind!==$.TAG_NAME)continue;let i=String(n);if(!/^[a-z][a-z0-9._-]*$/i.test(i))throw new r(c.invalidDynamicTagName(i));let a=document.createElement(i);for(let t of Array.from(e.attributes))a.setAttribute(t.name,t.value);for(;e.firstChild;)a.appendChild(e.firstChild);e.replaceWith(a),d.set(e,a)}for(let{comment:t,el:n,slot:r,value:i}of u){if(r.kind===$.TAG_NAME||r.kind===$.CLOSE_TAG)continue;let a=n&&(d.get(n)??n);if(r.kind===$.NODE){let n=t;if(m(i)){o.push({anchor:n,directive:i,type:`directive`});continue}if(v(i)){let e=n.parentNode;for(l(e,It);i.fragment.firstChild;)e.insertBefore(i.fragment.firstChild,n);n.remove(),s.push(i.apply.bind(i));continue}if(typeof i==`function`){let t=(0,e.computed)(()=>{let e=i();return Array.isArray(e)?e:[e]});o.push({anchor:n,signal:t,type:`html`});continue}if((0,e.isReactive)(i)){let t=(0,e.computed)(()=>{let e=i.value;return Array.isArray(e)?e:[e]});o.push({anchor:n,signal:t,type:`html`});continue}if(Array.isArray(i)){let e=n.parentNode;l(e,It);for(let t of i)if(v(t)){for(;t.fragment.firstChild;)e.insertBefore(t.fragment.firstChild,n);s.push(t.apply.bind(t))}else e.insertBefore(document.createTextNode(xt(t)),n);n.remove();continue}n.replaceWith(document.createTextNode(xt(i)));continue}let c=a;if(r.kind===$.EVENT){if(typeof i==`function`){let{handler:e,options:t}=Ct(i,r.modifiers??[]);o.push({el:c,handler:e,name:r.name,options:t,type:`event`})}else if((0,e.isReactive)(i)){let e=i,{handler:t,options:n}=Ct(t=>{let n=e.value;typeof n==`function`&&n(t)},r.modifiers??[]);o.push({el:c,handler:t,name:r.name,options:n,type:`event`})}continue}if(r.kind===$.REF){i&&o.push({el:c,ref:i,type:`ref`});continue}if(r.kind===$.SPREAD){ee(i)&&o.push({el:c,spread:i,type:`spread`});continue}o.push(bt(c,r.mode??`attr`,r.name,i))}return te(a,e=>{for(let t of o)yt(t,e);for(let t of s)t(e)})},Rt=(e,...t)=>Lt(e,t),zt=0,Bt=0,Vt=Math.random().toString(36).slice(2,6),Ht=(e=`id`)=>`${e}-${++zt}`,Ut=(e=`id`)=>`${e}-${Vt}${++Bt}`,Wt=()=>{Bt=0},Gt=(t,n)=>{let r=(0,e.signal)(null),i=new IntersectionObserver(([e])=>{e&&(r.value=e)},n);return i.observe(t),(0,e.onCleanup)(()=>i.disconnect()),r},Kt=t=>{let n=window.matchMedia(t),r=(0,e.signal)(n.matches),i=e=>{r.value=e.matches};return n.addEventListener(`change`,i),(0,e.onCleanup)(()=>n.removeEventListener(`change`,i)),r},qt=(t,n={attributes:!0,characterData:!0,childList:!0,subtree:!0})=>{let r=(0,e.signal)({entries:[],latest:null}),i=new MutationObserver(e=>{r.value={entries:e,latest:e.length>0?e[e.length-1]:null}});return i.observe(t,n),(0,e.onCleanup)(()=>i.disconnect()),r},Jt=t=>{let n=(0,e.signal)({height:0,width:0}),r=new ResizeObserver(([e])=>{if(!e)return;let t=e.contentBoxSize[0];t&&(n.value={height:t.blockSize,width:t.inlineSize})});return r.observe(t),(0,e.onCleanup)(()=>r.disconnect()),n};exports.FORM_CONTEXT_KEY=we,exports.OreApiError=r,exports.OreError=n,exports.OreInternalError=i,exports.OreLifecycleError=a,exports.OreTimeoutError=s,exports.aria=nt,exports.bind=Ye,exports.classMap=t,exports.createContext=q,exports.createFormContext=Te,exports.createId=Ht,exports.createStableId=Ut,exports.css=Re,exports.define=He,exports.each=oe,exports.getHost=I,exports.html=Rt,exports.inject=K,exports.injectStrict=Ce,exports.intersectionObserver=Gt,exports.live=se,exports.mediaObserver=Kt,exports.model=le,exports.mutationObserver=qt,exports.onCleanup=R,exports.onElement=_e,exports.onEvent=ge,exports.onFormReset=B,exports.onMounted=z,exports.prop=De,exports.provide=xe,exports.raw=A,exports.ref=u,exports.resetIdCounter=Wt,exports.resizeObserver=Jt,exports.setRawSanitizer=ue,exports.styleMap=me,exports.useEmit=it,exports.useField=ve,exports.useSlots=Ke,exports.watchEffect=V,exports.when=he;
3
3
  //# sourceMappingURL=ore.cjs.map