@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 +1 -1
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.ts +1 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +1 -1
- package/dist/errors.js.map +1 -1
- package/dist/ore.cjs +2 -2
- package/dist/ore.cjs.map +1 -1
- package/dist/ore.iife.js +2 -2
- package/dist/ore.iife.js.map +1 -1
- package/dist/ore.js +2 -2
- package/dist/ore.js.map +1 -1
- package/dist/template/compiler.cjs +1 -1
- package/dist/template/compiler.cjs.map +1 -1
- package/dist/template/compiler.d.ts.map +1 -1
- package/dist/template/compiler.js +1 -1
- package/dist/template/compiler.js.map +1 -1
- package/dist/testing/mount.cjs +1 -1
- package/dist/testing/mount.cjs.map +1 -1
- package/dist/testing/mount.d.ts.map +1 -1
- package/dist/testing/mount.js +1 -1
- package/dist/testing/mount.js.map +1 -1
- package/dist/testing/render-hook.cjs +1 -1
- package/dist/testing/render-hook.cjs.map +1 -1
- package/dist/testing/render-hook.d.ts.map +1 -1
- package/dist/testing/render-hook.js +1 -1
- package/dist/testing/render-hook.js.map +1 -1
- package/dist/testing/wait.cjs +1 -1
- package/dist/testing/wait.cjs.map +1 -1
- package/dist/testing/wait.d.ts.map +1 -1
- package/dist/testing/wait.js +1 -1
- package/dist/testing/wait.js.map +1 -1
- package/package.json +2 -2
package/dist/ore.iife.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var Ore=(function(e,t){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var n=e=>(0,t.computed)(()=>Object.entries(e).filter(([,e])=>typeof e==`function`?e():(0,t.isReactive)(e)?e.value:e).map(([e])=>e.replace(/\s+/g,``)).filter(Boolean).join(` `)),r=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}},i=class extends r{constructor(e){super(e)}},a=class extends r{constructor(e){super(e)}},o=class extends r{component;phase;constructor(e,t){super(e,{cause:t.cause}),this.component=t.component,this.phase=t.phase}};function s(e,t){`${e.component}${e.phase}`,e.cause,t.dispatchEvent(new CustomEvent(`ore:error`,{bubbles:!0,composed:!0,detail:e}))}var c=class extends r{},l={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 u(e,t){if(!e)throw new a(l.invariantViolated(t))}function d(){return(0,t.signal)(null)}var f=e=>{let t=Symbol.for(e);return{is:e=>typeof e==`object`&&!!e&&t in e,stamp:e=>Object.assign(e,{[t]:!0})}},p=f(`ore:directive`),m=e=>p.stamp({mount:e}),h=p.is,g=f(`ore:spread`),ee=e=>g.stamp({apply:e}),te=g.is,_=f(`ore:html-result`),v=_.is;function ne(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()},re=new Set([`action`,`cite`,`codebase`,`data`,`formaction`,`href`,`manifest`,`ping`,`poster`,`src`,`xlink:href`]),ie=/^\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(re.has(r)&&ie.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,ae=(e,n,r,i,a)=>{let o=(0,t.signal)(e),s=(0,t.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)},oe=(e,n,r,a,o,s)=>{let c=[],u=new Set;for(let e=0;e<n.length;e++){let t=String(r(n[e],e));if(u.has(t))throw new i(l.eachDuplicateKey(t,e));u.add(t),c.push(t)}for(let[t,n]of e)u.has(t)||(T(n),e.delete(t));let d=[];for(let r=0;r<n.length;r++){let i=c[r],l=e.get(i);if(l)(0,t.batch)(()=>{l.data.value=n[r],l.index.value=r}),d.push(l);else{let c=(0,t.untrack)(()=>ae(n[r],r,a,o,s));c.key=i,e.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 se(e,n,r,i){let a=Array.isArray(e)?(0,t.signal)(e):typeof e==`function`?(0,t.computed)(e):e;return m((e,o)=>{let s=e.parentNode;u(s,`each() anchor comment has no parent node`);let c=document.createComment(`each/end`);s.insertBefore(c,e.nextSibling);let l=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,t.effect)(()=>{let e=a.value??[];if(e.length===0){for(let e of(0,t.untrack)(()=>d))T(e);l=new Map,d=[],f||(0,t.untrack)(m);return}h();try{d=(0,t.untrack)(()=>oe(l,e,n,r,s,c))}catch(e){`${e instanceof Error?e.message:String(e)}`;for(let e of l.values())T(e);l=new Map,d=[]}});o(()=>g.dispose()),o(()=>{h();for(let e of d)T(e);c.remove()})})}var E=new WeakSet,ce=e=>(E.add(e),e),le=e=>typeof e==`object`&&!!e&&E.has(e);function ue(e){return ee((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,t.effect)(()=>{let t=e.value;if(c){let e=Array.isArray(t)?t:[],r=n;for(let t of r.options)t.selected=e.includes(t.value)}else a?i.checked=!!t:n.value=t==null?``:String(t)});r(()=>l.dispose()),r(S(n,s?`change`:`input`,t=>{let n=t.target;if(c){let n=t.target;e.value=Array.from(n.selectedOptions).map(e=>e.value)}else a?e.value=n.checked:o?e.value=n.value===``?0:Number(n.value):e.value=n.value}))})}var D=null,O=!1,de=e=>{D=e,e||(O=!1)},fe=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(e){if(typeof e==`function`){let n=(0,t.computed)(e);return m((e,t)=>{t(()=>n.dispose()),A(n).mount(e,t)})}return m((n,r)=>{let i=n.parentNode;u(i,`raw() anchor comment has no parent node`);let a=document.createComment(`raw/end`);if(i.insertBefore(a,n.nextSibling),(0,t.isReactive)(e)){let n=[],o=e,s=(0,t.effect)(()=>{b(n),n=k(fe(o.value),i,a)});r(()=>s.dispose()),r(()=>{b(n),a.remove()})}else k(fe(e),i,a),r(()=>a.remove())})}var pe=e=>{let n=typeof e==`function`?e():(0,t.isReactive)(e)?e.value:e;return n==null||n===!1?``:String(n).replace(/[;{}]/g,``)},me=/[;{}]/g,he=e=>(0,t.computed)(()=>{let t=[];for(let[n,r]of Object.entries(e)){let e=pe(r);if(!e)continue;let i=C(n).replace(me,``);i&&t.push(`${i}:${e}`)}return t.join(`;`)}),j=`when() anchor comment has no parent node`,M=(e,t,n,r)=>e.mount(t,n,r);function ge(e,n,r){return typeof e!=`function`&&!(0,t.isReactive)(e)?m((t,i)=>{let a=e?n():r?r():null;if(!a||!v(a))return;let o=t.parentNode;u(o,j);let s=M(a,o,t,i);i(()=>b(s))}):m((i,a)=>{let o=typeof e==`function`?(0,t.computed)(e):null,s=o??e;o&&a(()=>o.dispose());let c=i.parentNode;u(c,j);let l=document.createComment(`when/end`);c.insertBefore(l,i.nextSibling);let d=[],f=[],p=(0,t.effect)(()=>{let e=s.value;y(f),b(d),f=[],d=[];let i=e?n():r?r():null;if(!i||!v(i))return;let a=[];d=(0,t.untrack)(()=>M(i,c,l,e=>a.push(e))),f=a});a(()=>p.dispose()),a(()=>{y(f),b(d),l.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 i(`${e}: ${l.lifecycleOutsideSetup}`)},I=()=>F(`getHost`).element,L=e=>N?((0,t.onCleanup)(e),!0):!1,R=t.onCleanup,z=e=>{F(`onMounted`).mountCallbacks.push(e)},B=e=>{F(`onFormReset`).formResetCallbacks.push(e)},V=e=>{let n=(0,t.effect)(e),r=()=>n.dispose();return L(r),r};function _e(e,t,n,r){if(F(`onEvent`),!e)return;let i=S(e,t,n,r);L(i)||i()}var ve=(e,t)=>V(()=>{let n=e.value;if(n)return t(n)}),H=new WeakMap,ye=e=>{let t=e.el??I();if(!t.constructor.formAssociated)throw new i(l.defineFieldRequiresFormAssociated(t.localName));if(H.has(t))throw new i(`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 r=e.toFormValue??(t=>t==null?e.emptyStringForNull?``:null:t instanceof File||t instanceof FormData?t:String(t));V(()=>{n.setFormValue(r(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,be=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},xe=(e,t,n)=>{let r=U.get(e)??new Map;r.has(t)&&`${e.localName}`,r.set(t,n),U.set(e,r)},Se=(e,t)=>xe(I(),e,t),W=Symbol(`inject.not_found`),G=new WeakMap,Ce=(e,t)=>{let n=be(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=Ce(n.element,e);return r.set(i,a),a===W?t.length>0?t[0]:void 0:a}var we=e=>{let t=K(e,W);if(t!==W)return t;let n=I();throw new i(l.injectStrictFailed(String(e),n.localName))};function q(e){return Symbol(e)}var Te=q(`ore:form-context`);function Ee(e={}){let n=(0,t.signal)([]),r=(0,t.signal)(!1),i=(0,t.signal)(!1),a=(0,t.signal)(null);return{clearStatus:()=>{i.value=!1,a.value=null,e.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 t=>{if(t?.preventDefault(),!r.value){r.value=!0,a.value=null;try{await e.onSubmit?.(t),i.value=!1}catch(e){a.value=e}finally{r.value=!1}}},submitting:r,valid:(0,t.computed)(()=>n.value.every(e=>e.value))}}function De(e){return{default:e,parse:()=>e,reflect:!1}}var Oe={bool(e){return{default:e??!1,parse:e=>e!==null&&e!==`false`,reflect:!0}},data(e){return De(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}}},ke=e=>typeof e==`object`&&!!e&&`default`in e&&`parse`in e;function J(e,t){if(!ke(e))throw new i(`Prop "${t}" must use a prop.* helper (string/number/bool/json/oneOf). Received: ${typeof e}`);let n=e;if(!n.parse)throw new i(`Prop "${t}" must have a parse function. Use prop.* helpers.`);let r=n.reflect??!1;if(r&&w(n.default))throw new i(`Prop "${t}": ${l.propInvalidReflect}`);return{...n,reflect:r}}function Ae(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,je=(e,t)=>Y.get(e)?.get(t),Me=(e,t)=>typeof e==`string`?t(e):e,Ne=(e,n,r,i)=>{Y.has(e)||Y.set(e,new Map);let{default:a,parse:o,reflect:s=!1}=i,c=(0,t.signal)(a),l=Object.hasOwn(e,n),d=l?e[n]:void 0,f={parse:o,reflect:s,signal:c};l?(delete e[n],c.value=Me(d,o)):e.hasAttribute(r)&&(c.value=o(e.getAttribute(r)));let p=Y.get(e);return u(p,`propRegistry entry missing for <${e.localName}> — registerProp() must create it above`),p.set(r,f),Object.defineProperty(e,n,{configurable:!0,enumerable:!0,get:()=>c.value,set:e=>{c.value=Me(e,o)}}),s&&V(()=>{let t=c.value;t==null?e.removeAttribute(r):typeof t==`boolean`?e.toggleAttribute(r,t):x(e,r,t)}),c};function Pe(e,t){let n={};for(let[r,i]of Object.entries(t))n[r]=Ne(e,r,C(r),i);return n}var X={LOADING:`loading`,SETUP_DONE:`setup_done`,SETUP_RUNNING:`setup_running`,UNINITIALIZED:`uninitialized`,UNMOUNTED:`unmounted`},Z={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},ze=new Map,Be=e=>{if(e instanceof CSSStyleSheet)return e;let t=typeof e==`string`?e:e.content,n=ze.get(t);if(n)return n;let r=new CSSStyleSheet;try{r.replaceSync(t)}catch{}return ze.set(t,r),r},Ve=()=>({formResetCallbacks:[],generation:0,mountCallbacks:[],phase:X.UNINITIALIZED,scope:(0,t.scope)(),templateResult:null}),He=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=Ve()}connectedCallback(){(0,t.untrack)(()=>{this._component.phase===X.UNINITIALIZED&&this._runSetup(),this._init()}),this.dispatchEvent(new CustomEvent(Z.CONNECT,{bubbles:!1,composed:!1}))}attributeChangedCallback(e,n,r){if(n===r)return;let i=je(this,e);if(!i)return;let a=i.parse(r);Object.is((0,t.untrack)(()=>i.signal.value),a)||(i.signal.value=a)}disconnectedCallback(){this._component.generation++,this._component.phase=X.UNMOUNTED,this.dispatchEvent(new CustomEvent(Z.DISCONNECT,{bubbles:!1,composed:!1})),this._component.scope.dispose(),this._component.formResetCallbacks=[],this._component.mountCallbacks=[],this._component.phase=X.UNINITIALIZED,this._component.scope=(0,t.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 o(`<${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{}s(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?Pe(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(Be))}_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 Ue(e,t){if(!e)throw new i(l.defineRequiresTag);if(customElements.get(e))throw new i(l.defineDuplicate(e));let{props:n}=t,r=(()=>{if(!n)return;let t=Ae(n);if(t.length>0)throw new i(l.validationFailed(e,t));let r={};for(let[e,t]of Object.entries(n))r[e]=J(t,e);return r})(),a=r?Object.keys(r).map(C):[],o=class extends He{static _definition=t;static _normalizedPropDefs=r;static formAssociated=t.formAssociated??!1;static observedAttributes=a};Object.defineProperty(o,"name",{value:e}),customElements.define(e,o)}var We=`default`,Q=e=>e||We,Ge=e=>{let n=new Map,r=new Map,i=new Map,a=e=>{let r=n.get(e);return r||(r={elements:(0,t.signal)([]),presence:(0,t.signal)(!1)},n.set(e,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=()=>{e.shadowRoot?.querySelectorAll(`slot`).forEach(e=>c(e))},d=()=>{for(let e of r.keys())s(e)},f=null;return e.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(e.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}},Ke=new WeakMap,qe=()=>{let e=F(`useSlots`),t=Ke.get(e);return t||(t=Ge(e.element),Ke.set(e,t)),t},Je=e=>e===`role`||e.startsWith(`aria-`)?e:e.startsWith(`aria`)?`aria-${e.slice(4).toLowerCase()}`:`aria-${e}`,Ye=e=>e===`role`||e.startsWith(`aria-`)?e:e.startsWith(`aria`)?`aria-${e.slice(4).toLowerCase()}`:e,Xe=(e,t)=>{let n=t?.target??I(),r=[];if(e.attr)for(let[t,i]of Object.entries(e.attr)){let e=$e(n,Ze(t),i);e&&r.push(e)}if(e.class&&r.push(nt(n,e.class)),e.style)for(let[t,i]of Object.entries(e.style)){let e=tt(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},Ze=Ye,Qe=(e,n)=>{if(typeof e==`function`)return V(()=>n(e()));if((0,t.isReactive)(e))return V(()=>n(e.value));n(e)};function $e(e,t,n){return Qe(n,n=>x(e,t,n))}var et=/[;{}]/g;function tt(e,t,n){let r=(t.startsWith(`--`)?t:C(t)).replace(et,``);if(!r)return;let i=!1;return Qe(n,t=>{t!=null&&t!==``?(i=!0,e.style.setProperty(r,String(t).replace(et,``))):i&&e.style.removeProperty(r)})}function nt(e,n){let r=typeof n==`function`?n:()=>{let e={};for(let[r,i]of Object.entries(n))e[r]=typeof i==`function`?i():(0,t.isReactive)(i)?i.value:!!i;return e},i=new Set;return V(()=>{let t=new Set;for(let[n,a]of Object.entries(r()))a&&(t.add(n),i.has(n)||e.classList.add(n));for(let n of i)t.has(n)||e.classList.remove(n);i=t})}var rt=(e,t)=>{let n={};for(let[e,r]of Object.entries(t))n[Je(e)]=r;return Xe({attr:n},{target:e})},it={bubbles:!0,cancelable:!0,composed:!1},at=()=>{let e=I();return((t,...n)=>{let r=n.length>0?{...it,detail:n[0]}:it;return e.dispatchEvent(new CustomEvent(String(t),r))})},ot=(e,n,r)=>{let i=(0,t.effect)(()=>n(e.value));r(()=>i.dispose())},st=e=>e.value,ct=(e,t)=>{ot(e.signal,t=>{e.node.textContent=String(t??``)},t)},lt=e=>e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement,ut=(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))},dt=(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))},ft=(e,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,t.untrack)(()=>n.signal.value),a)||(n.signal.value=a),!n.reflect){if(w(i))return;r.mode===`bool`?e.toggleAttribute(r.name,!!i):x(e,r.name,i)}},pt=(e,n)=>{let{el:r,mode:i,name:a,propMeta:o}=e,s={last:void 0},c=n=>{if(o){ft(r,o,e,n);return}if(!(0,t.isReactive)(n)&&w(n)){a!==`__proto__`&&a!==`constructor`&&a!==`prototype`&&(r[a]=n);return}if(a===`value`&<(r)){ut(r,n,e.live,s);return}if(a===`checked`&&r instanceof HTMLInputElement){dt(r,n,e.live,s);return}i===`bool`?r.toggleAttribute(a,!!n):x(r,a,n)};`signal`in e?ot(e.signal,c,n):c(e.value)},mt=(e,t)=>{t(S(e.el,e.name,e.handler,e.options))},ht=(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})},gt=(e,t,n)=>{let r=[],i=t.parentNode;u(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},_t=(e,n)=>{let{anchor:r,signal:i}=e,a=[],o=()=>{y(a),a=[]},s=[],c=(0,t.effect)(()=>{let e=st(i);o(),b(s),s=[],!(e==null||e.length===0)&&(0,t.untrack)(()=>{s=gt(e,r,e=>a.push(e))})});n(()=>{c.dispose(),o(),b(s)})},vt=(e,t)=>{e.directive.mount(e.anchor,t)},yt=(e,t)=>{e.spread.apply(e.el,t)},bt=(e,t)=>{switch(e.type){case`attr`:pt(e,t);break;case`directive`:vt(e,t);break;case`event`:mt(e,t);break;case`html`:_t(e,t);break;case`ref`:ht(e,t);break;case`spread`:yt(e,t);break;case`text`:ct(e,t);break}},xt=(e,n,r,i)=>{let a=je(e,r);return le(i)?{el:e,live:!0,mode:n,name:r,propMeta:a,signal:i,type:`attr`}:typeof i==`function`?{el:e,mode:n,name:r,propMeta:a,signal:(0,t.computed)(i),type:`attr`}:(0,t.isReactive)(i)?{el:e,mode:n,name:r,propMeta:a,signal:i,type:`attr`}:{el:e,mode:n,name:r,propMeta:a,type:`attr`,value:i}},St=e=>e==null?``:String(e),Ct={prevent:e=>t=>{t.preventDefault(),e(t)},self:e=>t=>{t.target===t.currentTarget&&e(t)},stop:e=>t=>{t.stopPropagation(),e(t)}},wt=(e,t)=>{let n=e;for(let e of t){let t=Ct[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`},Tt=/\s+@([a-zA-Z_][-a-zA-Z0-9_.-]*)\s*=\s*["']?$/,Et=/\s+ref\s*=\s*["']?$/,Dt=/\s+\?([a-zA-Z_][-a-zA-Z0-9_]*)\s*=\s*["']?$/,Ot=/\s+:?([a-zA-Z_][-a-zA-Z0-9_]*)\s*=\s*["']?$/,kt=e=>{let t=e.lastIndexOf(`<`);return t<=e.lastIndexOf(`>`)?!1:e[t+1]!==`/`},At=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=Tt.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=Et.exec(e))?{kind:$.REF,prefix:e.slice(0,-t[0].length)}:(t=Dt.exec(e))?{kind:$.BOOL_ATTR,name:t[1],prefix:e.slice(0,-t[0].length)}:(t=Ot.exec(e))?{kind:$.ATTR,name:t[1],prefix:e.slice(0,-t[0].length)}:kt(e)?{kind:$.SPREAD,prefix:e.trimEnd()}:{kind:$.NODE,prefix:e}},jt=new WeakMap,Mt=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},Nt=(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++)Nt(i[e],[...t,e],n,r)},Pt=e=>{let t=Mt(e),n=``,r,i=0,a=0,o=[],s=[];for(let e=0;e<t.length-1;e++){let c=t[e],l=At(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++)Nt(d[e],[e],l,u);return{commentPaths:u,element:c,elementPaths:l,slots:o}},Ft=e=>{let t=jt.get(e);return t||(t=Pt(e),jt.set(e,t)),t},It=(e,t)=>{let n=e;for(let e of t)n=n.childNodes[e];return n},Lt="html`...`: node-slot comment anchor has no parent node",Rt=(e,n)=>{let r=Ft(e),a=r.element.content.cloneNode(!0),o=[],s=[],c=r.slots.map((e,t)=>{let i=n[t];if(e.kind===$.CLOSE_TAG)return{slot:e,value:i};if(e.kind===$.NODE){let t=r.commentPaths.get(e.commentId);return u(t,`compiled template is missing a comment path for node slot ${e.commentId}`),{comment:It(a,t),slot:e,value:i}}let o=r.elementPaths.get(e.elementId);return u(o,`compiled template is missing an element path for slot ${e.elementId}`),{el:It(a,o),slot:e,value:i}}),d=new Map;for(let{el:e,slot:t,value:n}of c){if(t.kind!==$.TAG_NAME)continue;let r=String(n);if(!/^[a-z][a-z0-9._-]*$/i.test(r))throw new i(l.invalidDynamicTagName(r));let a=document.createElement(r);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:e,el:n,slot:r,value:i}of c){if(r.kind===$.TAG_NAME||r.kind===$.CLOSE_TAG)continue;let a=n&&(d.get(n)??n);if(r.kind===$.NODE){let n=e;if(h(i)){o.push({anchor:n,directive:i,type:`directive`});continue}if(v(i)){let e=n.parentNode;for(u(e,Lt);i.fragment.firstChild;)e.insertBefore(i.fragment.firstChild,n);n.remove(),s.push(i.apply.bind(i));continue}if(typeof i==`function`){let e=(0,t.computed)(()=>{let e=i();return Array.isArray(e)?e:[e]});o.push({anchor:n,signal:e,type:`html`});continue}if((0,t.isReactive)(i)){let e=(0,t.computed)(()=>{let e=i.value;return Array.isArray(e)?e:[e]});o.push({anchor:n,signal:e,type:`html`});continue}if(Array.isArray(i)){let e=n.parentNode;u(e,Lt);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(St(t)),n);n.remove();continue}n.replaceWith(document.createTextNode(St(i)));continue}let c=a;if(r.kind===$.EVENT){if(typeof i==`function`){let{handler:e,options:t}=wt(i,r.modifiers??[]);o.push({el:c,handler:e,name:r.name,options:t,type:`event`})}else if((0,t.isReactive)(i)){let e=i,{handler:t,options:n}=wt(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){te(i)&&o.push({el:c,spread:i,type:`spread`});continue}o.push(xt(c,r.mode??`attr`,r.name,i))}return ne(a,e=>{for(let t of o)bt(t,e);for(let t of s)t(e)})},zt=(e,...t)=>Rt(e,t),Bt=0,Vt=0,Ht=Math.random().toString(36).slice(2,6);return e.FORM_CONTEXT_KEY=Te,e.OreApiError=i,e.OreError=r,e.OreInternalError=a,e.OreLifecycleError=o,e.OreTimeoutError=c,e.aria=rt,e.bind=Xe,e.classMap=n,e.createContext=q,e.createFormContext=Ee,e.createId=(e=`id`)=>`${e}-${++Bt}`,e.createStableId=(e=`id`)=>`${e}-${Ht}${++Vt}`,e.css=Re,e.define=Ue,e.each=se,e.getHost=I,e.html=zt,e.inject=K,e.injectStrict=we,e.intersectionObserver=(e,n)=>{let r=(0,t.signal)(null),i=new IntersectionObserver(([e])=>{e&&(r.value=e)},n);return i.observe(e),(0,t.onCleanup)(()=>i.disconnect()),r},e.live=ce,e.mediaObserver=e=>{let n=window.matchMedia(e),r=(0,t.signal)(n.matches),i=e=>{r.value=e.matches};return n.addEventListener(`change`,i),(0,t.onCleanup)(()=>n.removeEventListener(`change`,i)),r},e.model=ue,e.mutationObserver=(e,n={attributes:!0,characterData:!0,childList:!0,subtree:!0})=>{let r=(0,t.signal)({entries:[],latest:null}),i=new MutationObserver(e=>{r.value={entries:e,latest:e.length>0?e[e.length-1]:null}});return i.observe(e,n),(0,t.onCleanup)(()=>i.disconnect()),r},e.onCleanup=R,e.onElement=ve,e.onEvent=_e,e.onFormReset=B,e.onMounted=z,e.prop=Oe,e.provide=Se,e.raw=A,e.ref=d,e.resetIdCounter=()=>{Vt=0},e.resizeObserver=e=>{let n=(0,t.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(e),(0,t.onCleanup)(()=>r.disconnect()),n},e.setRawSanitizer=de,e.styleMap=he,e.useEmit=at,e.useField=ye,e.useSlots=qe,e.watchEffect=V,e.when=ge,e})({},Ripple);
|
|
1
|
+
var Ore=(function(e,t){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var n=e=>(0,t.computed)(()=>Object.entries(e).filter(([,e])=>typeof e==`function`?e():(0,t.isReactive)(e)?e.value:e).map(([e])=>e.replace(/\s+/g,``)).filter(Boolean).join(` `)),r=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}},i=class extends r{constructor(e){super(e)}},a=class extends r{constructor(e){super(e)}},o=class extends r{component;phase;constructor(e,t){super(e,{cause:t.cause}),this.component=t.component,this.phase=t.phase}};function s(e,t){`${e.component}${e.phase}`,e.cause,t.dispatchEvent(new CustomEvent(`ore:error`,{bubbles:!0,composed:!0,detail:e}))}var c=class extends r{},l={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 u(e,t){if(!e)throw new a(l.invariantViolated(t))}function d(){return(0,t.signal)(null)}var f=e=>{let t=Symbol.for(e);return{is:e=>typeof e==`object`&&!!e&&t in e,stamp:e=>Object.assign(e,{[t]:!0})}},p=f(`ore:directive`),m=e=>p.stamp({mount:e}),h=p.is,g=f(`ore:spread`),ee=e=>g.stamp({apply:e}),te=g.is,_=f(`ore:html-result`),v=_.is;function ne(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()},re=new Set([`action`,`cite`,`codebase`,`data`,`formaction`,`href`,`manifest`,`ping`,`poster`,`src`,`xlink:href`]),ie=/^\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(re.has(r)&&ie.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,ae=(e,n,r,i,a)=>{let o=(0,t.signal)(e),s=(0,t.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)},oe=(e,n,r,a,o,s)=>{let c=[],u=new Set;for(let e=0;e<n.length;e++){let t=String(r(n[e],e));if(u.has(t))throw new i(l.eachDuplicateKey(t,e));u.add(t),c.push(t)}for(let[t,n]of e)u.has(t)||(T(n),e.delete(t));let d=[];for(let r=0;r<n.length;r++){let i=c[r],l=e.get(i);if(l)(0,t.batch)(()=>{l.data.value=n[r],l.index.value=r}),d.push(l);else{let c=(0,t.untrack)(()=>ae(n[r],r,a,o,s));c.key=i,e.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 se(e,n,r,i){let a=Array.isArray(e)?(0,t.signal)(e):typeof e==`function`?(0,t.computed)(e):e;return m((e,o)=>{let s=e.parentNode;u(s,`each() anchor comment has no parent node`);let c=document.createComment(`each/end`);s.insertBefore(c,e.nextSibling);let l=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,t.effect)(()=>{let e=a.value??[];if(e.length===0){for(let e of(0,t.untrack)(()=>d))T(e);l=new Map,d=[],f||(0,t.untrack)(m);return}h();try{d=(0,t.untrack)(()=>oe(l,e,n,r,s,c))}catch(e){`${e instanceof Error?e.message:String(e)}`;for(let e of l.values())T(e);l=new Map,d=[]}});o(()=>g.dispose()),o(()=>{h();for(let e of d)T(e);c.remove()})})}var E=new WeakSet,ce=e=>(E.add(e),e),le=e=>typeof e==`object`&&!!e&&E.has(e);function ue(e){return ee((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,t.effect)(()=>{let t=e.value;if(c){let e=Array.isArray(t)?t:[],r=n;for(let t of r.options)t.selected=e.includes(t.value)}else a?i.checked=!!t:n.value=t==null?``:String(t)});r(()=>l.dispose()),r(S(n,s?`change`:`input`,t=>{let n=t.target;if(c){let n=t.target;e.value=Array.from(n.selectedOptions).map(e=>e.value)}else a?e.value=n.checked:o?e.value=n.value===``?0:Number(n.value):e.value=n.value}))})}var D=null,O=!1,de=e=>{D=e,e||(O=!1)},fe=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(e){if(typeof e==`function`){let n=(0,t.computed)(e);return m((e,t)=>{t(()=>n.dispose()),A(n).mount(e,t)})}return m((n,r)=>{let i=n.parentNode;u(i,`raw() anchor comment has no parent node`);let a=document.createComment(`raw/end`);if(i.insertBefore(a,n.nextSibling),(0,t.isReactive)(e)){let n=[],o=e,s=(0,t.effect)(()=>{b(n),n=k(fe(o.value),i,a)});r(()=>s.dispose()),r(()=>{b(n),a.remove()})}else k(fe(e),i,a),r(()=>a.remove())})}var pe=e=>{let n=typeof e==`function`?e():(0,t.isReactive)(e)?e.value:e;return n==null||n===!1?``:String(n).replace(/[;{}]/g,``)},me=/[;{}]/g,he=e=>(0,t.computed)(()=>{let t=[];for(let[n,r]of Object.entries(e)){let e=pe(r);if(!e)continue;let i=C(n).replace(me,``);i&&t.push(`${i}:${e}`)}return t.join(`;`)}),j=`when() anchor comment has no parent node`,M=(e,t,n,r)=>e.mount(t,n,r);function ge(e,n,r){return typeof e!=`function`&&!(0,t.isReactive)(e)?m((t,i)=>{let a=e?n():r?r():null;if(!a||!v(a))return;let o=t.parentNode;u(o,j);let s=M(a,o,t,i);i(()=>b(s))}):m((i,a)=>{let o=typeof e==`function`?(0,t.computed)(e):null,s=o??e;o&&a(()=>o.dispose());let c=i.parentNode;u(c,j);let l=document.createComment(`when/end`);c.insertBefore(l,i.nextSibling);let d=[],f=[],p=(0,t.effect)(()=>{let e=s.value;y(f),b(d),f=[],d=[];let i=e?n():r?r():null;if(!i||!v(i))return;let a=[];d=(0,t.untrack)(()=>M(i,c,l,e=>a.push(e))),f=a});a(()=>p.dispose()),a(()=>{y(f),b(d),l.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 i(`${e}: ${l.lifecycleOutsideSetup}`)},I=()=>F(`getHost`).element,L=e=>N?((0,t.onCleanup)(e),!0):!1,R=t.onCleanup,z=e=>{F(`onMounted`).mountCallbacks.push(e)},B=e=>{F(`onFormReset`).formResetCallbacks.push(e)},V=e=>{let n=(0,t.effect)(e),r=()=>n.dispose();return L(r),r};function _e(e,t,n,r){if(F(`onEvent`),!e)return;let i=S(e,t,n,r);L(i)||i()}var ve=(e,t)=>V(()=>{let n=e.value;if(n)return t(n)}),H=new WeakMap,ye=e=>{let t=e.el??I();if(!t.constructor.formAssociated)throw new i(l.defineFieldRequiresFormAssociated(t.localName));if(H.has(t))throw new i(`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 r=e.toFormValue??(t=>t==null?e.emptyStringForNull?``:null:t instanceof File||t instanceof FormData?t:String(t));V(()=>{n.setFormValue(r(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,be=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},xe=(e,t,n)=>{let r=U.get(e)??new Map;r.has(t)&&`${e.localName}`,r.set(t,n),U.set(e,r)},Se=(e,t)=>xe(I(),e,t),W=Symbol(`inject.not_found`),G=new WeakMap,Ce=(e,t)=>{let n=be(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=Ce(n.element,e);return r.set(i,a),a===W?t.length>0?t[0]:void 0:a}var we=e=>{let t=K(e,W);if(t!==W)return t;let n=I();throw new i(l.injectStrictFailed(String(e),n.localName))};function q(e){return Symbol(e)}var Te=q(`ore:form-context`);function Ee(e={}){let n=(0,t.signal)([]),r=(0,t.signal)(!1),i=(0,t.signal)(!1),a=(0,t.signal)(null);return{clearStatus:()=>{i.value=!1,a.value=null,e.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 t=>{if(t?.preventDefault(),!r.value){r.value=!0,a.value=null;try{await e.onSubmit?.(t),i.value=!1}catch(e){a.value=e}finally{r.value=!1}}},submitting:r,valid:(0,t.computed)(()=>n.value.every(e=>e.value))}}function De(e){return{default:e,parse:()=>e,reflect:!1}}var Oe={bool(e){return{default:e??!1,parse:e=>e!==null&&e!==`false`,reflect:!0}},data(e){return De(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}}},ke=e=>typeof e==`object`&&!!e&&`default`in e&&`parse`in e;function J(e,t){if(!ke(e))throw new i(`Prop "${t}" must use a prop.* helper (string/number/bool/json/oneOf). Received: ${typeof e}`);let n=e;if(!n.parse)throw new i(`Prop "${t}" must have a parse function. Use prop.* helpers.`);let r=n.reflect??!1;if(r&&w(n.default))throw new i(`Prop "${t}": ${l.propInvalidReflect}`);return{...n,reflect:r}}function Ae(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,je=(e,t)=>Y.get(e)?.get(t),Me=(e,t)=>typeof e==`string`?t(e):e,Ne=(e,n,r,i)=>{Y.has(e)||Y.set(e,new Map);let{default:a,parse:o,reflect:s=!1}=i,c=(0,t.signal)(a),l=Object.hasOwn(e,n),d=l?e[n]:void 0,f={parse:o,reflect:s,signal:c};l?(delete e[n],c.value=Me(d,o)):e.hasAttribute(r)&&(c.value=o(e.getAttribute(r)));let p=Y.get(e);return u(p,`propRegistry entry missing for <${e.localName}> — registerProp() must create it above`),p.set(r,f),Object.defineProperty(e,n,{configurable:!0,enumerable:!0,get:()=>c.value,set:e=>{c.value=Me(e,o)}}),s&&V(()=>{let t=c.value;t==null?e.removeAttribute(r):typeof t==`boolean`?e.toggleAttribute(r,t):x(e,r,t)}),c};function Pe(e,t){let n={};for(let[r,i]of Object.entries(t))n[r]=Ne(e,r,C(r),i);return n}var X={LOADING:`loading`,SETUP_DONE:`setup_done`,SETUP_RUNNING:`setup_running`,UNINITIALIZED:`uninitialized`,UNMOUNTED:`unmounted`},Z={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},ze=new Map,Be=e=>{if(e instanceof CSSStyleSheet)return e;let t=typeof e==`string`?e:e.content,n=ze.get(t);if(n)return n;let r=new CSSStyleSheet;try{r.replaceSync(t)}catch{}return ze.set(t,r),r},Ve=()=>({formResetCallbacks:[],generation:0,mountCallbacks:[],phase:X.UNINITIALIZED,scope:(0,t.scope)(),templateResult:null}),He=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=Ve()}connectedCallback(){(0,t.untrack)(()=>{this._component.phase===X.UNINITIALIZED&&this._runSetup(),this._init()}),this.dispatchEvent(new CustomEvent(Z.CONNECT,{bubbles:!1,composed:!1}))}attributeChangedCallback(e,n,r){if(n===r)return;let i=je(this,e);if(!i)return;let a=i.parse(r);Object.is((0,t.untrack)(()=>i.signal.value),a)||(i.signal.value=a)}disconnectedCallback(){this._component.generation++,this._component.phase=X.UNMOUNTED,this.dispatchEvent(new CustomEvent(Z.DISCONNECT,{bubbles:!1,composed:!1})),this._component.scope.dispose(),this._component.formResetCallbacks=[],this._component.mountCallbacks=[],this._component.phase=X.UNINITIALIZED,this._component.scope=(0,t.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 o(`<${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{}s(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?Pe(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(Be))}_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 Ue(e,t){if(!e)throw new i(l.defineRequiresTag);if(customElements.get(e))throw new i(l.defineDuplicate(e));let{props:n}=t,r=(()=>{if(!n)return;let t=Ae(n);if(t.length>0)throw new i(l.validationFailed(e,t));let r={};for(let[e,t]of Object.entries(n))r[e]=J(t,e);return r})(),a=r?Object.keys(r).map(C):[],o=class extends He{static _definition=t;static _normalizedPropDefs=r;static formAssociated=t.formAssociated??!1;static observedAttributes=a};Object.defineProperty(o,"name",{value:e}),customElements.define(e,o)}var We=`default`,Q=e=>e||We,Ge=e=>{let n=new Map,r=new Map,i=new Map,a=e=>{let r=n.get(e);return r||(r={elements:(0,t.signal)([]),presence:(0,t.signal)(!1)},n.set(e,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=()=>{e.shadowRoot?.querySelectorAll(`slot`).forEach(e=>c(e))},d=()=>{for(let e of r.keys())s(e)},f=null;return e.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(e.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}},Ke=new WeakMap,qe=()=>{let e=F(`useSlots`),t=Ke.get(e);return t||(t=Ge(e.element),Ke.set(e,t)),t},Je=e=>e===`role`||e.startsWith(`aria-`)?e:e.startsWith(`aria`)?`aria-${e.slice(4).toLowerCase()}`:`aria-${e}`,Ye=e=>e===`role`||e.startsWith(`aria-`)?e:e.startsWith(`aria`)?`aria-${e.slice(4).toLowerCase()}`:e,Xe=(e,t)=>{let n=t?.target??I(),r=[];if(e.attr)for(let[t,i]of Object.entries(e.attr)){let e=$e(n,Ze(t),i);e&&r.push(e)}if(e.class&&r.push(nt(n,e.class)),e.style)for(let[t,i]of Object.entries(e.style)){let e=tt(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},Ze=Ye,Qe=(e,n)=>{if(typeof e==`function`)return V(()=>n(e()));if((0,t.isReactive)(e))return V(()=>n(e.value));n(e)};function $e(e,t,n){return Qe(n,n=>x(e,t,n))}var et=/[;{}]/g;function tt(e,t,n){let r=(t.startsWith(`--`)?t:C(t)).replace(et,``);if(!r)return;let i=!1;return Qe(n,t=>{t!=null&&t!==``?(i=!0,e.style.setProperty(r,String(t).replace(et,``))):i&&e.style.removeProperty(r)})}function nt(e,n){let r=typeof n==`function`?n:()=>{let e={};for(let[r,i]of Object.entries(n))e[r]=typeof i==`function`?i():(0,t.isReactive)(i)?i.value:!!i;return e},i=new Set;return V(()=>{let t=new Set;for(let[n,a]of Object.entries(r()))a&&(t.add(n),i.has(n)||e.classList.add(n));for(let n of i)t.has(n)||e.classList.remove(n);i=t})}var rt=(e,t)=>{let n={};for(let[e,r]of Object.entries(t))n[Je(e)]=r;return Xe({attr:n},{target:e})},it={bubbles:!0,cancelable:!0,composed:!1},at=()=>{let e=I();return((t,...n)=>{let r=n.length>0?{...it,detail:n[0]}:it;return e.dispatchEvent(new CustomEvent(String(t),r))})},ot=(e,n,r)=>{let i=(0,t.effect)(()=>n(e.value));r(()=>i.dispose())},st=e=>e.value,ct=(e,t)=>{ot(e.signal,t=>{e.node.textContent=String(t??``)},t)},lt=e=>e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement,ut=(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))},dt=(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))},ft=(e,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,t.untrack)(()=>n.signal.value),a)||(n.signal.value=a),!n.reflect){if(w(i))return;r.mode===`bool`?e.toggleAttribute(r.name,!!i):x(e,r.name,i)}},pt=(e,n)=>{let{el:r,mode:i,name:a,propMeta:o}=e,s={last:void 0},c=n=>{if(o){ft(r,o,e,n);return}if(!(0,t.isReactive)(n)&&w(n)){a!==`__proto__`&&a!==`constructor`&&a!==`prototype`&&(r[a]=n);return}if(a===`value`&<(r)){ut(r,n,e.live,s);return}if(a===`checked`&&r instanceof HTMLInputElement){dt(r,n,e.live,s);return}i===`bool`?r.toggleAttribute(a,!!n):x(r,a,n)};`signal`in e?ot(e.signal,c,n):c(e.value)},mt=(e,t)=>{t(S(e.el,e.name,e.handler,e.options))},ht=(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})},gt=(e,t,n)=>{let r=[],i=t.parentNode;u(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},_t=(e,n)=>{let{anchor:r,signal:i}=e,a=[],o=()=>{y(a),a=[]},s=[],c=(0,t.effect)(()=>{let e=st(i);o(),b(s),s=[],!(e==null||e.length===0)&&(0,t.untrack)(()=>{s=gt(e,r,e=>a.push(e))})});n(()=>{c.dispose(),o(),b(s)})},vt=(e,t)=>{e.directive.mount(e.anchor,t)},yt=(e,t)=>{e.spread.apply(e.el,t)},bt=(e,t)=>{switch(e.type){case`attr`:pt(e,t);break;case`directive`:vt(e,t);break;case`event`:mt(e,t);break;case`html`:_t(e,t);break;case`ref`:ht(e,t);break;case`spread`:yt(e,t);break;case`text`:ct(e,t);break}},xt=(e,n,r,i)=>{let a=je(e,r);return le(i)?{el:e,live:!0,mode:n,name:r,propMeta:a,signal:i,type:`attr`}:typeof i==`function`?{el:e,mode:n,name:r,propMeta:a,signal:(0,t.computed)(i),type:`attr`}:(0,t.isReactive)(i)?{el:e,mode:n,name:r,propMeta:a,signal:i,type:`attr`}:{el:e,mode:n,name:r,propMeta:a,type:`attr`,value:i}},St=e=>e==null?``:String(e),Ct={prevent:e=>t=>{t.preventDefault(),e(t)},self:e=>t=>{t.target===t.currentTarget&&e(t)},stop:e=>t=>{t.stopPropagation(),e(t)}},wt=(e,t)=>{let n=e;for(let e of t){let t=Ct[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`},Tt=/\s+@([a-zA-Z_][-a-zA-Z0-9_.-]*)\s*=\s*["']?$/,Et=/\s+ref\s*=\s*["']?$/,Dt=/\s+\?([a-zA-Z_][-a-zA-Z0-9_]*)\s*=\s*["']?$/,Ot=/\s+:?([a-zA-Z_][-a-zA-Z0-9_]*)\s*=\s*["']?$/,kt=e=>{let t=e.lastIndexOf(`<`);return t<=e.lastIndexOf(`>`)?!1:e[t+1]!==`/`},At=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=Tt.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=Et.exec(e))?{kind:$.REF,prefix:e.slice(0,-t[0].length)}:(t=Dt.exec(e))?{kind:$.BOOL_ATTR,name:t[1],prefix:e.slice(0,-t[0].length)}:(t=Ot.exec(e))?{kind:$.ATTR,name:t[1],prefix:e.slice(0,-t[0].length)}:kt(e)?{kind:$.SPREAD,prefix:e.trimEnd()}:{kind:$.NODE,prefix:e}},jt=new WeakMap,Mt=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},Nt=(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++)Nt(i[e],[...t,e],n,r)},Pt=e=>{let t=Mt(e),n=``,r,a=0,o=0,s=[],c=[];for(let e=0;e<t.length-1;e++){let u=t[e],d=At(u);if(d.kind===$.TAG_NAME){let e=a++;r=e,c.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(c.length===0)throw new i(l.mismatchedDynamicCloseTag);let e=c.pop(),t=u.replace(/<\/\s*$/,``);n+=t+`</ore-dyn-${e}>`,s.push({kind:$.CLOSE_TAG}),r=void 0}else if(d.kind===$.NODE)n+=d.prefix+`<!--${o}-->`,s.push({commentId:o,kind:$.NODE}),o++,r=void 0;else{r===void 0||d.prefix.lastIndexOf(`<`)>d.prefix.lastIndexOf(`>`)?(r=a++,n+=`${d.prefix} u="${r}"`):n+=d.prefix;let e=d.kind===$.BOOL_ATTR?`bool`:d.kind===$.ATTR?`attr`:void 0;s.push({elementId:r,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++)Nt(p[e],[e],d,f);return{commentPaths:f,element:u,elementPaths:d,slots:s}},Ft=e=>{let t=jt.get(e);return t||(t=Pt(e),jt.set(e,t)),t},It=(e,t)=>{let n=e;for(let e of t)n=n.childNodes[e];return n},Lt="html`...`: node-slot comment anchor has no parent node",Rt=(e,n)=>{let r=Ft(e),a=r.element.content.cloneNode(!0),o=[],s=[],c=r.slots.map((e,t)=>{let i=n[t];if(e.kind===$.CLOSE_TAG)return{slot:e,value:i};if(e.kind===$.NODE){let t=r.commentPaths.get(e.commentId);return u(t,`compiled template is missing a comment path for node slot ${e.commentId}`),{comment:It(a,t),slot:e,value:i}}let o=r.elementPaths.get(e.elementId);return u(o,`compiled template is missing an element path for slot ${e.elementId}`),{el:It(a,o),slot:e,value:i}}),d=new Map;for(let{el:e,slot:t,value:n}of c){if(t.kind!==$.TAG_NAME)continue;let r=String(n);if(!/^[a-z][a-z0-9._-]*$/i.test(r))throw new i(l.invalidDynamicTagName(r));let a=document.createElement(r);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:e,el:n,slot:r,value:i}of c){if(r.kind===$.TAG_NAME||r.kind===$.CLOSE_TAG)continue;let a=n&&(d.get(n)??n);if(r.kind===$.NODE){let n=e;if(h(i)){o.push({anchor:n,directive:i,type:`directive`});continue}if(v(i)){let e=n.parentNode;for(u(e,Lt);i.fragment.firstChild;)e.insertBefore(i.fragment.firstChild,n);n.remove(),s.push(i.apply.bind(i));continue}if(typeof i==`function`){let e=(0,t.computed)(()=>{let e=i();return Array.isArray(e)?e:[e]});o.push({anchor:n,signal:e,type:`html`});continue}if((0,t.isReactive)(i)){let e=(0,t.computed)(()=>{let e=i.value;return Array.isArray(e)?e:[e]});o.push({anchor:n,signal:e,type:`html`});continue}if(Array.isArray(i)){let e=n.parentNode;u(e,Lt);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(St(t)),n);n.remove();continue}n.replaceWith(document.createTextNode(St(i)));continue}let c=a;if(r.kind===$.EVENT){if(typeof i==`function`){let{handler:e,options:t}=wt(i,r.modifiers??[]);o.push({el:c,handler:e,name:r.name,options:t,type:`event`})}else if((0,t.isReactive)(i)){let e=i,{handler:t,options:n}=wt(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){te(i)&&o.push({el:c,spread:i,type:`spread`});continue}o.push(xt(c,r.mode??`attr`,r.name,i))}return ne(a,e=>{for(let t of o)bt(t,e);for(let t of s)t(e)})},zt=(e,...t)=>Rt(e,t),Bt=0,Vt=0,Ht=Math.random().toString(36).slice(2,6);return e.FORM_CONTEXT_KEY=Te,e.OreApiError=i,e.OreError=r,e.OreInternalError=a,e.OreLifecycleError=o,e.OreTimeoutError=c,e.aria=rt,e.bind=Xe,e.classMap=n,e.createContext=q,e.createFormContext=Ee,e.createId=(e=`id`)=>`${e}-${++Bt}`,e.createStableId=(e=`id`)=>`${e}-${Ht}${++Vt}`,e.css=Re,e.define=Ue,e.each=se,e.getHost=I,e.html=zt,e.inject=K,e.injectStrict=we,e.intersectionObserver=(e,n)=>{let r=(0,t.signal)(null),i=new IntersectionObserver(([e])=>{e&&(r.value=e)},n);return i.observe(e),(0,t.onCleanup)(()=>i.disconnect()),r},e.live=ce,e.mediaObserver=e=>{let n=window.matchMedia(e),r=(0,t.signal)(n.matches),i=e=>{r.value=e.matches};return n.addEventListener(`change`,i),(0,t.onCleanup)(()=>n.removeEventListener(`change`,i)),r},e.model=ue,e.mutationObserver=(e,n={attributes:!0,characterData:!0,childList:!0,subtree:!0})=>{let r=(0,t.signal)({entries:[],latest:null}),i=new MutationObserver(e=>{r.value={entries:e,latest:e.length>0?e[e.length-1]:null}});return i.observe(e,n),(0,t.onCleanup)(()=>i.disconnect()),r},e.onCleanup=R,e.onElement=ve,e.onEvent=_e,e.onFormReset=B,e.onMounted=z,e.prop=Oe,e.provide=Se,e.raw=A,e.ref=d,e.resetIdCounter=()=>{Vt=0},e.resizeObserver=e=>{let n=(0,t.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(e),(0,t.onCleanup)(()=>r.disconnect()),n},e.setRawSanitizer=de,e.styleMap=he,e.useEmit=at,e.useField=ye,e.useSlots=qe,e.watchEffect=V,e.when=ge,e})({},Ripple);
|
|
3
3
|
//# sourceMappingURL=ore.iife.js.map
|