@webjsdev/core 0.7.40 → 0.7.42

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.
@@ -1,4 +1,4 @@
1
- var jo=Object.defineProperty;var B=(e,t)=>()=>(e&&(t=e(e=0)),t);var Bn=(e,t)=>{for(var n in t)jo(e,n,{get:t[n],enumerable:!0})};function Xn(){return typeof HTMLElement<"u"&&typeof HTMLSlotElement<"u"}function cs(){Yn||(Wt=Xn(),Wt&&(ve=HTMLSlotElement.prototype.assignedNodes,Vt=HTMLSlotElement.prototype.assignedElements,Ye=Object.getOwnPropertyDescriptor(Element.prototype,"assignedSlot"),HTMLSlotElement.prototype.assignedNodes=function(t){return this.hasAttribute(L)&&!Gn(this)?Kt(this,t):ve?ve.call(this,t):[]},HTMLSlotElement.prototype.assignedElements=function(t){return this.hasAttribute(L)&&!Gn(this)?Kt(this,t).filter(n=>n.nodeType===1):Vt?Vt.call(this,t):[]},Object.defineProperty(Element.prototype,"assignedSlot",{configurable:!0,enumerable:!0,get:function(){let t=Ye&&Ye.get?Ye.get.call(this):null;return t||ls(this)}}),Yn=!0))}function Gn(e){let t=e;for(let n=0;n<128;n++){let r=t.parentNode;if(!r||r===t)return!1;if(r.nodeType===11&&r.host)return!0;t=r}return!1}function Kt(e,t){if(e.getAttribute(M)===Qn)return[];let n=Array.from(e.childNodes);return!t||!t.flatten?n:Yt(n,new Set,0)}function Yt(e,t,n){if(n>=as)return e.slice();let r=[];for(let s of e)if(s.nodeType===1&&s.tagName==="SLOT"){let o=s;if(t.has(o))continue;if(t.add(o),o.hasAttribute(L)){let i=Kt(o,{flatten:!1});if(i.length>0)for(let a of Yt(i,t,n+1))r.push(a);else for(let a of Yt(Array.from(o.childNodes),t,n+1))r.push(a)}else if(ve){let i=ve.call(o,{flatten:!0});for(let a of i)r.push(a)}else r.push(s)}else r.push(s);return r}function ls(e){let t=e.parentElement;for(;t;){if(t.tagName==="SLOT"&&t.hasAttribute(L))return t.getAttribute(M)===K?t:null;t=t.parentElement}return null}function re(e){let t=e,n=t[R];return n||(n={assignedByName:new Map,lastSnapshot:new WeakMap},t[R]=n),n}function Gt(e){return!!e[R]}function Zn(e){let t=re(e);for(;e.firstChild;){let n=e.firstChild,r=us(n);fs(t.assignedByName,r,n),e.removeChild(n)}}function er(e){let t=re(e),n=e.querySelectorAll(`slot[${L}]`);for(let r of n){let s=r;if(s.getAttribute(M)!==K)continue;let o=oe(s.getAttribute("name"));if(!t.assignedByName.has(o)){let i=Array.from(s.childNodes);t.assignedByName.set(o,i),t.lastSnapshot.set(s,i.slice())}}}function oe(e){return e==null||e===""||e==="default"?null:e}function us(e){return e.nodeType!==1?null:oe(e.getAttribute("slot"))}function fs(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}function tr(e){let t={},n=e[R];if(!n)return t;for(let[r,s]of n.assignedByName)t[r??"default"]=s.slice();return t}function nr(e,t){let n=e[R];if(!n)return!1;let r=n.assignedByName.get(oe(t));return!!(r&&r.length)}function se(e,t,n){let r=re(e),s=oe(t),o=ds(e,n);o.length?r.assignedByName.set(s,o):r.assignedByName.delete(s),Jt(e)}function ds(e,t){if(t==null)return[];if(typeof t=="string"){let n=e.ownerDocument||(typeof document<"u"?document:null);return n?[n.createTextNode(t)]:[]}return Array.isArray(t)?t.filter(Boolean):[t]}function Jt(e){if(!Wt)return;let t=e[R];if(!t)return;let n=[];for(let o of e.querySelectorAll(`slot[${L}]`))hs(e,o)&&n.push(o);let r=new Map;for(let o of n){let i=oe(o.getAttribute("name")),a=r.get(i);a||(a=[],r.set(i,a)),a.push(o)}let s=[];for(let[o,i]of r){let a=t.assignedByName.get(o)||[];for(let c=0;c<i.length;c++){let l=i[c];c===0&&a.length>0?ps(t,l,a)&&s.push(l):ms(t,l)&&s.push(l)}}for(let o of s)bs(o)}function hs(e,t){for(let n=t.parentElement;n&&n!==e;n=n.parentElement)if(n.tagName.includes("-"))return!1;return!0}function ps(e,t,n){let r=t.getAttribute(M)!==K,s=e.lastSnapshot.get(t)||[];if(!r&&zt(s,n))return!1;if(!r&&zt(Array.from(t.childNodes),n))return e.lastSnapshot.set(t,n.slice()),!zt(s,n);let i=t[Ge];if(r&&i)for(;t.firstChild;)i.appendChild(t.firstChild);else for(;t.firstChild;)t.removeChild(t.firstChild);for(let a of n)t.appendChild(a);return t.setAttribute(M,K),e.lastSnapshot.set(t,n.slice()),!0}function ms(e,t){let n=t.getAttribute(M)===K;if(t.setAttribute(M,Qn),!n)return Jn(t),!1;for(e.lastSnapshot.delete(t);t.firstChild;)t.removeChild(t.firstChild);return Jn(t),!0}function Jn(e){let t=e[Ge];!t||t.childNodes.length===0||e.appendChild(t)}function rr(e,t){if(!Gt(e))return;let n=re(e),r=oe(t.getAttribute("name")),s=n.assignedByName.get(r);if(s)for(let o of s)o.parentNode===t&&t.removeChild(o);n.lastSnapshot.delete(t)}function bs(e){e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1}))}function zt(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}var Wt,R,L,M,K,Qn,Ge,as,ve,Vt,Ye,Yn,Je=B(()=>{Wt=Xn(),R=Symbol("webjs.slot.state"),L="data-webjs-light",M="data-projection",K="actual",Qn="fallback",Ge=Symbol("webjs.slot.fallbackFrag"),as=64,ve=null,Vt=null,Ye=null,Yn=!1;cs()});function yr(e,t,n){qs.has(t)?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}async function rn(e){return JSON.stringify(await gr(e))}function G(e){return _r(JSON.parse(e))}async function gr(e){let t=Vs();return await zs(e,t),Y(e,t)}function _r(e){return q(e,Gs())}function Vs(){return{refCount:new Map,idOf:new Map,emitted:new Set,nextId:0,blobBytes:new Map,fdEntries:new Map}}async function zs(e,t){let n=[e];for(;n.length;){let r=n.pop();if(!Xs(r))continue;let s=t.refCount.get(r)||0;if(t.refCount.set(r,s+1),!(s>0)){if(typeof Blob<"u"&&r instanceof Blob){let o=new Uint8Array(await r.arrayBuffer());t.blobBytes.set(r,o);continue}if(typeof FormData<"u"&&r instanceof FormData){let o=t.fdEntries.get(r)||[...r.entries()];t.fdEntries.set(r,o);for(let[,i]of o)typeof i!="string"&&n.push(i);continue}if(Array.isArray(r))for(let o=0;o<r.length;o++)n.push(r[o]);else if(r instanceof Map)for(let[o,i]of r)n.push(o),n.push(i);else if(r instanceof Set)for(let o of r)n.push(o);else if(Qs(r))for(let o in r)Object.prototype.hasOwnProperty.call(r,o)&&n.push(r[o])}}for(let[r,s]of t.refCount)s>1&&t.idOf.set(r,t.nextId++)}function Y(e,t){if(e===null)return null;if(e===void 0)return{[y]:"undef"};let n=typeof e;if(n==="string"||n==="boolean")return e;if(n==="number")return Number.isNaN(e)?{[y]:"NaN"}:e===1/0?{[y]:"Inf"}:e===-1/0?{[y]:"-Inf"}:Object.is(e,-0)?{[y]:"-0"}:e;if(n==="bigint")return{[y]:"BigInt",v:e.toString()};if(n==="symbol"){let o=Symbol.keyFor(e);if(o===void 0)throw new TypeError("Cannot serialize a local Symbol; only Symbol.for() registered symbols are supported.");return{[y]:"Sym",v:o}}if(n==="function")throw new TypeError("Cannot serialize a function.");let r=t.idOf.get(e);if(r!==void 0&&t.emitted.has(r))return{[y]:"Ref",v:r};r!==void 0&&t.emitted.add(r);let s;if(e instanceof Date)s={[y]:"Date",v:Number.isNaN(e.getTime())?null:e.toISOString()};else if(e instanceof Error)s={[y]:"Error",v:{name:e.name,message:e.message,stack:e.stack||null}};else if(typeof Blob<"u"&&e instanceof Blob){let o=t.blobBytes.get(e);typeof File<"u"&&e instanceof File?s={[y]:"File",v:Te(o),n:e.name,t:e.type||"",m:e.lastModified}:s={[y]:"Blob",v:Te(o),t:e.type||""}}else if(typeof FormData<"u"&&e instanceof FormData){let o=t.fdEntries.get(e)||[...e.entries()],i=[];for(let[a,c]of o)i.push([a,Y(c,t)]);s={[y]:"FD",v:i}}else if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)s=Ws(e);else if(e instanceof Map){let o=[];for(let[i,a]of e)o.push([Y(i,t),Y(a,t)]);s={[y]:"Map",v:o}}else if(e instanceof Set){let o=[];for(let i of e)o.push(Y(i,t));s={[y]:"Set",v:o}}else if(Array.isArray(e))s=e.map(o=>Y(o,t));else{s={};for(let o in e){if(!Object.prototype.hasOwnProperty.call(e,o))continue;let i=Zs(o)?"_"+o:o;yr(s,i,Y(e[o],t))}}if(r!==void 0){if(Array.isArray(s))return{[y]:"Arr",_id:r,v:s};s._id=r}return s}function Ws(e){if(e instanceof ArrayBuffer)return{[y]:"buf",v:Te(new Uint8Array(e))};if(e instanceof DataView)return{[y]:"dv",v:Te(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))};let t=e.constructor.name,n=Ks[t];if(!n)throw new TypeError(`Unsupported typed array: ${t}`);let r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return{[y]:n,v:Te(r)}}function Gs(){return{refs:new Map}}function q(e,t){if(e===null||typeof e!="object")return e;if(Array.isArray(e)){let o=[];for(let i=0;i<e.length;i++)o.push(q(e[i],t));return o}let n=e[y];if(typeof n=="string")return Js(e,n,t);let r={},s=e._id;typeof s=="number"&&t.refs.set(s,r);for(let o in e){if(!Object.prototype.hasOwnProperty.call(e,o)||o==="_id")continue;let i=ei(o)?o.slice(1):o;yr(r,i,q(e[o],t))}return r}function Js(e,t,n){let r=e._id,s=o=>(typeof r=="number"&&n.refs.set(r,o),o);switch(t){case"undef":return;case"NaN":return NaN;case"Inf":return 1/0;case"-Inf":return-1/0;case"-0":return-0;case"BigInt":return s(BigInt(e.v));case"Sym":return s(Symbol.for(e.v));case"Date":return s(e.v==null?new Date(NaN):new Date(e.v));case"Error":{let o=new Error(e.v.message);return o.name=e.v.name,e.v.stack&&(o.stack=e.v.stack),typeof r=="number"&&n.refs.set(r,o),o}case"Map":{let o=new Map;typeof r=="number"&&n.refs.set(r,o);for(let[i,a]of e.v)o.set(q(i,n),q(a,n));return o}case"Set":{let o=new Set;typeof r=="number"&&n.refs.set(r,o);for(let i of e.v)o.add(q(i,n));return o}case"Arr":{let o=[];typeof r=="number"&&n.refs.set(r,o);for(let i of e.v)o.push(q(i,n));return o}case"Ref":{let o=n.refs.get(e.v);if(o===void 0)throw new TypeError(`Dangling reference: id=${e.v}`);return o}case"Blob":{if(typeof Blob>"u")throw new TypeError("Blob is not available in this environment.");let o=Ee(e.v);return s(new Blob([o],{type:e.t||""}))}case"File":{if(typeof File>"u")throw new TypeError("File is not available in this environment.");let o=Ee(e.v);return s(new File([o],e.n,{type:e.t||"",lastModified:e.m}))}case"FD":{if(typeof FormData>"u")throw new TypeError("FormData is not available in this environment.");let o=new FormData;s(o);for(let[i,a]of e.v){let c=q(a,n);o.append(i,c)}return o}default:{if(t==="buf"){let i=Ee(e.v);return s(i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength))}if(t==="dv"){let i=Ee(e.v);return s(new DataView(i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength)))}let o=Ys[t];if(o){let i=Ee(e.v),a=i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength);return s(new o(a))}throw new TypeError(`Unknown serialization tag: ${t}`)}}}function Xs(e){return e!==null&&typeof e=="object"}function Qs(e){if(e===null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Zs(e){return/^_+\$wj$/.test(e)||/^_+id$/.test(e)}function ei(e){return/^__+\$wj$/.test(e)||/^__+id$/.test(e)}function Te(e){if(wr)return Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("base64");let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function Ee(e){if(wr){let r=Buffer.from(e,"base64");return new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}let t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}var y,qs,Ks,Ys,wr,ke=B(()=>{y="_$wj",qs=new Set(["__proto__","constructor","prototype"]);Ks={Int8Array:"i8",Uint8Array:"u8",Uint8ClampedArray:"u8c",Int16Array:"i16",Uint16Array:"u16",Int32Array:"i32",Uint32Array:"u32",Float32Array:"f32",Float64Array:"f64",BigInt64Array:"bi64",BigUint64Array:"bu64"},Ys={i8:Int8Array,u8:Uint8Array,u8c:Uint8ClampedArray,i16:Int16Array,u16:Uint16Array,i32:Int32Array,u32:Uint32Array,f32:Float32Array,f64:Float64Array,bi64:typeof BigInt64Array<"u"?BigInt64Array:null,bu64:typeof BigUint64Array<"u"?BigUint64Array:null};wr=typeof Buffer<"u"&&typeof Buffer.from=="function"});var Lr={};Bn(Lr,{observeLazy:()=>wi,observeViewportOnce:()=>vi});function Rr(e){let t=an.get(e);return t||(t=import(e).finally(()=>an.delete(e)),an.set(e,t),t)}function wi(e){for(let[t,n]of Object.entries(e))J.set(t.toLowerCase(),n);if(typeof IntersectionObserver>"u"){for(let t of J.values())Rr(t);J.clear();return}Ne||(Ne=new IntersectionObserver(Si,{rootMargin:"200px"})),jr(),typeof MutationObserver<"u"&&new MutationObserver(()=>jr()).observe(document.body,{childList:!0,subtree:!0})}function jr(){if(!(!Ne||!J.size))for(let e of J.keys())for(let t of document.querySelectorAll(e))Ne.observe(t)}function Si(e){for(let t of e){if(!t.isIntersecting)continue;let n=t.target.tagName.toLowerCase(),r=J.get(n);r&&(Rr(r),J.delete(n),Ne?.unobserve(t.target))}}function Ai(e){for(let t of e){if(!t.isIntersecting)continue;let n=it.get(t.target);it.delete(t.target),xe?.unobserve(t.target),n&&n()}}function vi(e,t){return typeof IntersectionObserver>"u"?(t(),()=>{}):(xe||(xe=new IntersectionObserver(Ai,{rootMargin:"200px"})),it.set(e,t),xe.observe(e),()=>{it.delete(e),xe?.unobserve(e)})}var J,Ne,an,xe,it,Or=B(()=>{J=new Map,Ne=null,an=new Map;xe=null,it=new WeakMap});var cn,ln=B(()=>{cn=typeof HTMLElement<"u"?class extends HTMLElement{constructor(){super(),this._webjsLoadedSrc=null,this._webjsLazyTeardown=null}static get observedAttributes(){return["src"]}connectedCallback(){this._webjsScheduleLoad()}disconnectedCallback(){this._webjsLazyTeardown&&(this._webjsLazyTeardown(),this._webjsLazyTeardown=null)}attributeChangedCallback(t,n,r){t==="src"&&this.isConnected&&this._webjsScheduleLoad()}_webjsScheduleLoad(){let t=this.getAttribute("src");if(!t){this._webjsLazyTeardown&&(this._webjsLazyTeardown(),this._webjsLazyTeardown=null),this._webjsLoadedSrc=null;return}let n=t;try{n=new URL(t,location.href).href}catch{}if(n===this._webjsLoadedSrc)return;this._webjsLazyTeardown&&(this._webjsLazyTeardown(),this._webjsLazyTeardown=null),(this.getAttribute("loading")||"eager").toLowerCase()==="lazy"?(this._webjsLoadedSrc=n,Promise.resolve().then(()=>(Or(),Lr)).then(({observeViewportOnce:s})=>{this._webjsLoadedSrc!==n||!this.isConnected||(this._webjsLazyTeardown=s(this,()=>{this._webjsLazyTeardown=null,this._webjsLoad(n)}))})):(this._webjsLoadedSrc=n,this._webjsLoad(n))}_webjsLoad(t){Promise.resolve().then(()=>(at(),Pr)).then(({loadFrame:n})=>{this._webjsLoadedSrc!==t||!this.isConnected||n(this,t)})}}:null;typeof customElements<"u"&&cn&&!customElements.get("webjs-frame")&&customElements.define("webjs-frame",cn)});function Ei(e,t,n){switch(e){case"append":n&&t.append(n);break;case"prepend":n&&t.prepend(n);break;case"before":n&&t.before(n);break;case"after":n&&t.after(n);break;case"replace":n&&t.replaceWith(n);break;case"update":n&&t.replaceChildren(n);break;case"remove":t.remove();break;default:break}}function fn(e,t){let n=t||(typeof document<"u"?document:null);if(!n)return;let r=null;if(typeof e=="string"){let o=n.createElement("template");o.innerHTML=e,r=o.content}else if(e&&e.nodeType)r=e;else return;let s=r.querySelectorAll?Array.from(r.querySelectorAll("webjs-stream")):[];if(s.length)for(let o of s)n.body.append(o);else n.body.append(r)}var Ci,un,ct=B(()=>{Ci=new Set(["append","prepend","before","after","replace","update"]);un=typeof HTMLElement<"u"?class extends HTMLElement{connectedCallback(){this._webjsApplied||(this._webjsApplied=!0,this._webjsApply())}_webjsApply(){let t=(this.getAttribute("action")||"").toLowerCase(),n=this.ownerDocument||document,r=[],s=this.getAttribute("target");if(s){let i=n.getElementById(s);i&&(r=[i])}else{let i=this.getAttribute("targets");if(i)try{r=Array.from(n.querySelectorAll(i))}catch{r=[]}}let o=Ci.has(t)?this.querySelector("template"):null;try{for(let i of r){let a=o?o.content.cloneNode(!0):null;Ei(t,i,a)}}finally{this.remove()}}}:null;typeof customElements<"u"&&un&&!customElements.get("webjs-stream")&&customElements.define("webjs-stream",un)});var Ir,Mr=B(()=>{Ir=typeof HTMLElement<"u"?class extends HTMLElement{connectedCallback(){this.style.display||(this.style.display="contents")}}:null;typeof customElements<"u"&&Ir&&!customElements.get("webjs-suspense")&&customElements.define("webjs-suspense",Ir)});function lt(e){let t=e||(typeof document<"u"?document:null);if(!(!t||typeof t.querySelectorAll!="function")){for(let n of t.querySelectorAll('script[type="application/json"]#__webjs-seeds, script[type="application/json"][data-webjs-seeds]'))Ur(n.textContent,n);for(let n of t.querySelectorAll("[data-webjs-seed]"))Ur(n.getAttribute("data-webjs-seed"),n,()=>n.removeAttribute("data-webjs-seed"))}}function Ur(e,t,n){if(e)try{let r=G(e);if(r&&typeof r=="object")for(let s in r)je.has(s)||je.set(s,r[s])}catch{}n?n():t.remove?.()}function Ti(e,t,n){Fr||(Fr=!0,lt());let r=`${e}/${t}/${n}`;if(je.has(r)){let s=je.get(r);return je.delete(r),s}return Br}var je,Br,Fr,dn=B(()=>{ke();je=new Map,Br=Symbol("webjs.seed.miss"),Fr=!1});var Pr={};Bn(Pr,{_FRAME_TOP:()=>eo,_LIVE_ATTRS:()=>wn,_activeFrameId:()=>Zr,_addNewHeadElements:()=>Sn,_applyStreamedResolve:()=>Co,_applySwap:()=>Ln,_blurOutgoingFocus:()=>dt,_buildHaveHeader:()=>Nn,_buildSubmitFormData:()=>Xr,_bumpNavToken:()=>ra,_clearFormBusy:()=>mo,_clearFrameBusy:()=>ho,_collectBoundaries:()=>be,_currentPageUrl:()=>oa,_diffElementInPlace:()=>_t,_eligibleAnchorHref:()=>pt,_findAnchorInPath:()=>Qr,_getSubmitAction:()=>Jr,_getSubmitMethod:()=>Gr,_isNonHtmlPath:()=>ca,_keyOf:()=>me,_markFormBusy:()=>po,_markFrameBusy:()=>fo,_mergeHead:()=>So,_navToken:()=>na,_onPopState:()=>Cn,_onSubmit:()=>En,_parseHTML:()=>An,_planBoundarySwap:()=>no,_prefetch:()=>ye,_prefetchCache:()=>w,_prefetchHasHoverPointer:()=>io,_prefetchInflightSize:()=>ea,_prefetchMode:()=>mt,_prefetchPeek:()=>Zi,_prefetchSaysSaveData:()=>jn,_prefetchSuppressed:()=>ao,_prefetchTake:()=>co,_reactivateScripts:()=>Ie,_readStreamedShell:()=>Ao,_reconcileChildren:()=>vt,_regraftPermanentElements:()=>yo,_regraftPermanentInSlice:()=>At,_resetParseProbe:()=>xi,_resetPrefetch:()=>ta,_resetWarnOnce:()=>ia,_resolveTargetFrameId:()=>Tn,_restoreOptimistic:()=>Re,_runWithTransition:()=>ft,_setCurrentPageUrl:()=>sa,_shouldFullLoadDuringParse:()=>aa,_snapshotCache:()=>C,_streamBoundariesProgressively:()=>Eo,_takeResolveUnit:()=>vo,_viewTransitionsEnabled:()=>bo,collectBoundaries:()=>be,disableClientRouter:()=>zr,enableClientRouter:()=>vn,loadFrame:()=>Ri,navigate:()=>Wr,planBoundarySwap:()=>no,revalidate:()=>Kr});function An(e){if(!/^\s*(?:<!doctype|<html)/i.test(e)&&typeof document<"u"&&document.implementation)try{let n=document.implementation.createHTMLDocument();if(typeof n.body.setHTMLUnsafe=="function")n.body.setHTMLUnsafe(e);else{let r=n.createElement("template");r.innerHTML=e,n.body.appendChild(r.content)}return n}catch{}return typeof Document<"u"&&typeof Document.parseHTMLUnsafe=="function"&&ki()?Document.parseHTMLUnsafe(e):Ni(e)}function ki(){if(ue!==null)return ue;try{ue=Document.parseHTMLUnsafe("<!doctype html><body><!--c--><i></i>")?.body?.firstChild?.nodeType===8}catch{ue=!1}return ue}function xi(){ue=null}function Ni(e){return typeof DOMParser>"u"?null:new DOMParser().parseFromString(e,"text/html")}function ji(){hn||typeof MutationObserver>"u"||typeof customElements>"u"||(hn=new MutationObserver(e=>{for(let t of e)for(let n of t.addedNodes){if(n.nodeType!==1)continue;let r=n;r.tagName?.includes("-")&&customElements.upgrade(r);for(let s of r.querySelectorAll("*"))s.tagName?.includes("-")&&customElements.upgrade(s)}}),hn.observe(document.body,{childList:!0,subtree:!0}))}function vn(){z||typeof document>"u"||(z=!0,document.addEventListener("click",Yr,!1),document.addEventListener("submit",En,!1),window.addEventListener("popstate",Cn),document.addEventListener("pointerover",pe,!0),document.addEventListener("focusin",pe,!0),document.addEventListener("touchstart",pe,{capture:!0,passive:!0}),document.addEventListener("pointerout",lo,!0),document.addEventListener("webjs:navigate",_n),ji(),_n(),typeof history<"u"&&"scrollRestoration"in history&&(ut=history.scrollRestoration,history.scrollRestoration="manual"),typeof location<"u"&&(I=location.href))}function zr(){z&&(z=!1,document.removeEventListener("click",Yr,!1),document.removeEventListener("submit",En,!1),window.removeEventListener("popstate",Cn),document.removeEventListener("pointerover",pe,!0),document.removeEventListener("focusin",pe,!0),document.removeEventListener("touchstart",pe,{capture:!0}),document.removeEventListener("pointerout",lo,!0),document.removeEventListener("webjs:navigate",_n),St(),Rn(),V&&(V.disconnect(),V=null),typeof history<"u"&&ut!==null&&(history.scrollRestoration=ut,ut=null),I=null)}async function Wr(e,t){let n=new URL(e,location.href);if(n.origin!==location.origin){location.href=e;return}await xn(n.href,t?.replace??!1,null)}async function Ri(e,t){if(typeof location>"u")return{ok:!1,status:null,aborted:!1};let n=e&&e.id;if(!n)return{ok:!1,status:null,aborted:!1};let r=new URL(t,location.href);if(r.origin!==location.origin)return{ok:!1,status:null,aborted:!1};k&&k.abort(),k=new AbortController;let s=k.signal,o=++S;return bt(r.href,n,!1,null,"GET",null,s,o)}function Kr(e){if(!e){C.clear(),w.clear();return}let t=new URL(e,location.href),n=t.pathname+t.search;C.delete(n),w.delete(n)}function Yr(e){if(!z||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=Qr(e);if(!t||t.hasAttribute("download")||t.hasAttribute("data-no-router")||t.target&&t.target!=="_self")return;let n=t.href;if(!n)return;let r=new URL(n);if(r.origin!==location.origin||r.pathname===location.pathname&&r.search===location.search&&r.hash||wt.test(r.pathname))return;e.preventDefault();let s=Tn(t);xn(n,!1,s)}function Cn(e){xn(location.href,!0,null)}function En(e){if(!z||e.defaultPrevented)return;let t=e.target;if(!t||t.nodeType!==1||t.tagName!=="FORM"||t.hasAttribute("data-no-router"))return;let n=e.submitter??null;if(n&&n.hasAttribute("data-no-router"))return;let r=n&&n.getAttribute("formtarget")||t.getAttribute("target")||"";if(r&&r!=="_self")return;let s=Gr(t,n);if(s==="dialog")return;let o=Jr(t,n),i;try{i=new URL(o,location.href)}catch{return}if(i.origin!==location.origin||wt.test(i.pathname))return;let a=Xr(t,n);e.preventDefault();let c=Tn(n||t);Pi(i.href,s,a,c,t)}function Gr(e,t){return(t&&t.getAttribute("formmethod")||e.getAttribute("method")||"get").toLowerCase()}function Jr(e,t){return t&&t.hasAttribute("formaction")?t.getAttribute("formaction")||"":e.getAttribute("action")||e.action||location.href}function Xr(e,t){try{return new FormData(e,t||void 0)}catch{let n=new FormData(e);return t&&t.getAttribute("name")&&n.append(t.getAttribute("name"),t.getAttribute("value")||""),n}}function Qr(e){for(let t of e.composedPath())if(t instanceof HTMLAnchorElement)return t;return null}function Zr(e){let t=e;for(;t;){let n=t.closest("webjs-frame");if(n&&n.id)return n.id;let r=t.getRootNode();if(r&&r.host)t=r.host;else break}return null}function Tn(e){if(!e)return null;let t=e.closest&&e.closest("[data-webjs-frame]"),n=t?t.dataset?t.dataset.webjsFrame:t.getAttribute("data-webjs-frame"):null;if(n!=null&&n!==""){if(n===eo)return null;let r=typeof document<"u"?document.getElementById(n):null;return r&&r.tagName&&r.tagName.toLowerCase()==="webjs-frame"?n:(kn(`webjs:frame-unresolved:${n}`,`[webjs] data-webjs-frame="${n}" did not match a live <webjs-frame id="${n}">; performing a normal navigation instead.`),null)}return Zr(e)}function kn(e,t){mn.has(e)||(mn.add(e),typeof console<"u"&&console.warn&&console.warn(t))}function to(e,t){return!e&&!t&&typeof document<"u"&&document.readyState==="loading"}function bn(e,t){typeof process<"u"&&process.env||kn(`fallback:${e}`,`[webjs] client router fell back to a full page load (${e}) navigating to ${t}. This is correct (no DOM corruption), just not a soft nav.`)}function $r(){if(typeof process<"u"&&process.env||yn||typeof document>"u"||typeof getComputedStyle!="function")return;let e=document.documentElement;if(!e)return;yn=!0;let t;try{t=getComputedStyle(e).scrollBehavior}catch{return}t==="smooth"&&kn("scroll-behavior-smooth-html","[webjs] Detected `scroll-behavior: smooth` on <html>. The client router scrolls to the top instantly on navigation (like a native page load), so route transitions are not affected by it. It still applies to in-page #anchor links. Pairing it with a sticky `backdrop-filter` header can also flash on iOS during navigation.")}function ht(e){if(typeof document>"u")return;let t=document.documentElement;if(!(!t||!t.hasAttribute("data-webjs-nav-progress")))try{e?t.setAttribute("data-navigating",""):t.removeAttribute("data-navigating")}catch{}}function be(e){let t=new Map,n=[],r=!1;function s(o){if(!r){if(o.nodeType===8){let i=o.data.trim();if(i.startsWith("wj:children:")){let a=i.slice(12),c=a.lastIndexOf(":");if(c<=0||c===a.length-1){r=!0;return}let l=a.slice(0,c),h=a.slice(c+1);if(t.has(l)||n.some(u=>u.segment===l)){r=!0;return}n.push({segment:l,routeKey:h,start:o});return}if(i.startsWith("/wj:children")){let a=i.slice(12).replace(/^:/,""),c=n.pop();if(!c||c.segment!==a){r=!0;return}if(c.start.parentNode!==o.parentNode){r=!0;return}{let l=c.start.parentNode.tagName;if(l==="TABLE"||l==="TBODY"||l==="THEAD"||l==="TFOOT"||l==="TR"){r=!0;return}}t.set(c.segment,{routeKey:c.routeKey,start:c.start,end:o});return}return}if(o.hasChildNodes&&o.hasChildNodes())for(let i=o.firstChild;i&&!r;i=i.nextSibling)s(i)}}return s(e),r||n.length>0?null:t}function no(e,t){let n=[...e.keys()].filter(i=>t.has(i)).sort((i,a)=>i.length-a.length);if(n.length===0)return null;for(let i of n)if(e.get(i).routeKey!==t.get(i).routeKey){let a=null;for(let c of n){if(c===i)break;i.startsWith(c==="/"?c:c+"/")&&(a=c)}return a?{mode:"replace",segment:a,live:e.get(a),incoming:t.get(a)}:null}let r=n[n.length-1],s=i=>{let a=null;for(let c of i.keys())(a===null||c.length>a.length)&&(a=c);return a};return{mode:s(e)===r&&s(t)===r?"morph":"replace",segment:r,live:e.get(r),incoming:t.get(r)}}function ro(e){let t=ee(e);document.dispatchEvent(new CustomEvent("webjs:before-cache",{detail:{url:e}})),C.has(t)&&C.delete(t);let n={html:document.documentElement.outerHTML,scrollX:typeof window<"u"&&window.scrollX||0,scrollY:typeof window<"u"&&window.scrollY||0};for(C.set(t,n);C.size>Li;){let r=C.keys().next().value;C.delete(r)}}function Oi(e){let t=ee(e),n=C.get(t);return n==null?null:(C.delete(t),C.set(t,n),typeof n=="string"?{html:n,scrollX:0,scrollY:0}:n)}function ee(e){let t=new URL(e,location.href);return t.pathname+t.search}async function xn(e,t,n){if(to(t,n)&&typeof location<"u"){bn("readyState-loading",e),location.href=e;return}k&&k.abort(),k=new AbortController;let r=k.signal,s=++S;I&&ro(I);let o=setTimeout(()=>{ht(!0),o=null},150),i=null;t||(i=go());try{if(t){let a=Oi(e);if(a){let c=An(a.html);if(c){Ln(c,n,!0,null),typeof window<"u"&&window.scrollTo({left:a.scrollX,top:a.scrollY,behavior:"instant"}),bt(e,n,!1,i,"GET",null,r,s,!0).catch(()=>{});return}}typeof window<"u"&&window.scrollTo({left:0,top:0,behavior:"instant"})}await bt(e,n,!t,i,"GET",null,r,s)}finally{o&&clearTimeout(o),s===S&&(ht(!1),typeof location<"u"&&(I=location.href))}}async function Pi(e,t,n,r,s){k&&k.abort(),k=new AbortController;let o=k.signal,i=++S,a=t==="get"||t==="head",c=new URL(e,location.href);if(a){c.search="";for(let[p,m]of n)c.searchParams.append(p,typeof m=="string"?m:m.name)}I&&ro(I);let l=setTimeout(()=>{ht(!0),l=null},150),h=go(),u=s?po(s,i,c.href):null,f=!1;try{let p=await bt(c.href,r,!0,h,a?"GET":t.toUpperCase(),a?null:n,o,i);f=!!(p&&p.ok),!a&&i===S&&(C.clear(),w.clear())}finally{u&&mo(u,i,c.href,f),l&&clearTimeout(l),i===S&&(ht(!1),typeof location<"u"&&(I=location.href))}}function Nn(){let e=be(document.body);return e?[...e.entries()].map(([t,n])=>`${t}:${n.routeKey}`).join(","):""}function jn(){try{let e=typeof navigator<"u"?navigator.connection:null;if(e&&(e.saveData===!0||typeof e.effectiveType=="string"&&/2g$/.test(e.effectiveType))||typeof matchMedia=="function"&&matchMedia("(prefers-reduced-data: reduce)").matches)return!0}catch{}return!1}function io(){try{if(typeof matchMedia=="function")return matchMedia("(hover: hover) and (pointer: fine)").matches}catch{}return!0}function Bi(e){let t=e.getAttribute("rel");return t?t.toLowerCase().split(/\s+/).filter(Boolean):[]}function pt(e){if(!e||!(e instanceof HTMLAnchorElement)||e.hasAttribute("download")||e.hasAttribute("data-no-router")||e.target&&e.target!=="_self")return null;let t=e.href;if(!t)return null;let n;try{n=new URL(t)}catch{return null}return n.origin!==location.origin||n.pathname===location.pathname&&n.search===location.search&&n.hash||wt.test(n.pathname)?null:t}function ao(e){if(e.hasAttribute("data-no-prefetch"))return!0;let t=Bi(e);return t.includes("external")||t.includes("no-prefetch")}function mt(e){if(ao(e))return"none";switch((e.getAttribute("data-prefetch")||"").toLowerCase().trim()){case"false":case"none":return"none";case"true":case"render":return"render";case"auto":case"viewport":return"viewport";case"intent":return"intent";default:return io()?"intent":"viewport"}}function ye(e){if(!z||typeof fetch!="function"||jn())return;let t=ee(e);if(X.has(t)||Le.has(t))return;let n=w.get(t);if(n&&gn()-n.at<oo)return;if(X.size>=so){for(Le.add(t),de.push(e);de.length>Mi;){let o=de.shift();Le.delete(ee(o))}return}let r=Nn();if(!r&&typeof document<"u"&&document.readyState==="loading")return;X.add(t);let s={"x-webjs-router":"1","x-webjs-prefetch":"1"};r&&(s["x-webjs-have"]=r),fetch(e,{method:"GET",headers:s,credentials:"same-origin"}).then(async o=>{let i=o.headers.get("content-type")||"";if(!/^text\/html\b/i.test(i)||o.status>=400)return;let a=o.headers.get("x-webjs-build"),c=o.headers.get("x-webjs-src"),l=typeof document<"u"?document.querySelector('script[type="importmap"]'):null,h=l?l.getAttribute("data-webjs-build"):null,u=l?l.getAttribute("data-webjs-src"):null;(a&&h&&a!==h||c&&u&&c!==u)&&(C.clear(),w.clear());let f=o.redirected&&o.url?o.url:e,p=await o.text();$i(t,{html:p,build:a,src:c,finalUrl:f,at:gn()})}).catch(()=>{}).finally(()=>{X.delete(t),Di()})}function Di(){for(;de.length&&X.size<so;){let e=de.shift();Le.delete(ee(e)),ye(e)}}function $i(e,t){for(w.has(e)&&w.delete(e),w.set(e,t);w.size>Ii;){let n=w.keys().next().value;w.delete(n)}typeof document<"u"&&document.dispatchEvent(new CustomEvent("webjs:prefetch",{detail:{url:t.finalUrl,key:e,from:"prefetch"}}))}function co(e){let t=ee(e),n=w.get(t);return!n||(w.delete(t),gn()-n.at>=oo)?null:n}function gn(){try{if(typeof performance<"u"&&typeof performance.now=="function")return performance.now()}catch{}return 0}function pe(e){if(!z)return;let t=uo(e.target);if(!t)return;let n=mt(t);if(n==="none"||n==="render")return;let r=pt(t);if(r){if(e.type==="touchstart"){ye(r);return}n==="intent"&&(Oe===t&&he||(St(),Oe=t,he=setTimeout(()=>{he=null,Oe=null,ye(r)},Fi)))}}function lo(e){let t=uo(e.target);t&&t===Oe&&St()}function St(){he&&(clearTimeout(he),he=null),Oe=null}function Rn(){for(let e of Pe)clearTimeout(e);Pe.clear(),fe=new WeakMap}function uo(e){let t=e;for(;t;){if(t instanceof HTMLAnchorElement)return t;let n=t.nodeType===1?t:null;if(n){let s=n.closest&&n.closest("a");if(s instanceof HTMLAnchorElement)return s}let r=t.getRootNode?t.getRootNode():null;t=r&&r.host?r.host:null}return null}function _n(){if(typeof document>"u"||jn())return;let e=typeof IntersectionObserver<"u";e&&(V?(V.disconnect(),Rn()):V=new IntersectionObserver(t=>{for(let n of t){let r=n.target;if(n.isIntersecting){if(fe.has(r))continue;let s=setTimeout(()=>{Pe.delete(s),fe.delete(r),V.unobserve(r);let o=pt(r);o&&mt(r)==="viewport"&&ye(o)},Ui);fe.set(r,s),Pe.add(s)}else{let s=fe.get(r);s&&(clearTimeout(s),Pe.delete(s),fe.delete(r))}}},{threshold:.5}));for(let t of document.querySelectorAll("a[href]")){let n=mt(t);if(n==="render"){let r=pt(t);r&&ye(r)}else n==="viewport"&&e&&V.observe(t)}}function Hi(e){if(typeof document>"u"||!document.body)return!1;let t=be(document.body);if(!t)return!1;let n,r=-1;for(let[c,l]of t)c.length>r&&(r=c.length,n=l);if(!n)return!1;let s=n.start.parentNode;if(!s||n.start.parentNode!==n.end.parentNode)return!1;let o=document.createElement("div");o.setAttribute("role","alert"),o.setAttribute("data-webjs-nav-error","");let i=e?`This page could not be loaded. (status ${e})`:"This page could not be loaded.";o.textContent=i;let a=document.createRange();return a.setStartAfter(n.start),a.setEndBefore(n.end),a.deleteContents(),s.insertBefore(o,n.end),!0}function pn(e,t,n){let r=new CustomEvent("webjs:navigation-error",{bubbles:!0,cancelable:!0,detail:{url:e,status:t??null,error:n||null}});if(typeof document<"u")try{document.dispatchEvent(r)}catch{}r.defaultPrevented||Hi(t)||typeof location<"u"&&(location.href=e)}async function bt(e,t,n,r,s,o,i,a,c){s=s||"GET";let l=typeof a=="number"?a:S,h,u=null,f=null,p=null,m=null,x=!1,g=e,d=t?fo(t,l):null;try{try{let b=s==="GET"&&!o&&!t?co(e):null;if(b)h=b.html,f=b.build,p=b.src,g=b.finalUrl,m=200,x=!0;else{let N={"x-webjs-router":"1"},_e=Nn();_e&&(N["x-webjs-have"]=_e),t&&(N["x-webjs-frame"]=t),o!=null&&s!=="GET"&&s!=="HEAD"&&(N.accept=Dr+", text/html");let W={method:s,headers:N,credentials:"same-origin"};i&&(W.signal=i),o!=null&&s!=="GET"&&s!=="HEAD"&&(W.body=o);let A=await fetch(e,W);m=A.status,x=A.ok;let v=A.headers.get("content-type")||"",xo=/^text\/html\b/i.test(v);if(v.toLowerCase().indexOf(Dr)===0){let No=await A.text();return l===S&&(Re(r),fn(No)),{ok:x,status:m,aborted:!1}}if(A.redirected&&A.url&&(g=A.url),A.status===204||A.status===205)return l===S&&n&&history.pushState(null,"",g),{ok:x,status:m,aborted:!1};if(!xo)return l===S&&(Re(r),pn(e,A.status,null)),{ok:!1,status:m,aborted:!1};f=A.headers.get("x-webjs-build"),p=A.headers.get("x-webjs-src");let Tt=await Ao(A);h=Tt.shell,Tt.streaming&&(u=Tt)}}catch(b){return b&&b.name==="AbortError"?{ok:!1,status:null,aborted:!0}:l!==S?{ok:!1,status:null,aborted:!0}:(Re(r),pn(e,null,b instanceof Error?b:new Error(String(b))),{ok:!1,status:null,aborted:!1})}if(l!==S){if(u&&u.reader)try{u.reader.cancel()}catch{}return{ok:!1,status:m,aborted:!0}}let U=An(h);if(!U)return Re(r),pn(e,null,new Error("navigation response did not parse as HTML")),{ok:!1,status:m,aborted:!1};if(Ln(U,t,!!c,g,f,p)==="discard"){if(u&&u.reader)try{u.reader.cancel()}catch{}return{ok:x,status:m,aborted:!1}}if(n&&history.pushState(null,"",g),n){let b=new URL(g);if(b.hash){let N=document.getElementById(b.hash.slice(1));N?N.scrollIntoView():($r(),window.scrollTo({left:0,top:0,behavior:"instant"}))}else $r(),window.scrollTo({left:0,top:0,behavior:"instant"})}return u&&(u.reader||u.rest)&&Eo(u.reader,u.dec,u.rest,()=>l===S),document.dispatchEvent(new CustomEvent("webjs:navigate",{detail:{url:g,frameId:t,from:"navigate"}})),{ok:x,status:m,aborted:!1}}finally{d&&ho(d,l)}}function fo(e,t){if(typeof document>"u")return null;let n=null;try{n=document.querySelector(`webjs-frame#${CSS.escape(e)}`)}catch{n=document.getElementById(e)}if(!n)return null;let r=yt.has(n);return yt.set(n,t),n.setAttribute("aria-busy","true"),r||n.dispatchEvent(new CustomEvent("webjs:frame-busy",{bubbles:!0,detail:{frameId:e,busy:!0}})),n}function ho(e,t){if(yt.get(e)!==t)return;yt.delete(e),e.setAttribute("aria-busy","false");let n=e.id||null;e.dispatchEvent(new CustomEvent("webjs:frame-busy",{bubbles:!0,detail:{frameId:n,busy:!1}}))}function po(e,t,n){let r=gt.has(e);return gt.set(e,t),e.setAttribute("aria-busy","true"),r||e.dispatchEvent(new CustomEvent("webjs:submit-start",{bubbles:!0,detail:{form:e,url:n}})),e}function mo(e,t,n,r){if(gt.get(e)!==t)return;gt.delete(e),e.setAttribute("aria-busy","false");let s=new CustomEvent("webjs:submit-end",{bubbles:!0,detail:{form:e,url:n,ok:!!r}});e.isConnected?e.dispatchEvent(s):typeof document<"u"?document.dispatchEvent(s):e.dispatchEvent(s)}function Hr(e){if(!e||!e.head)return"";let t=e.head.querySelectorAll('[data-webjs-track="reload"]');if(!t.length)return"";let n="";for(let r of t)n+=Q(r);return n}function bo(){if(typeof document>"u")return!1;let e=document.querySelector('meta[name="view-transition"]');return e?(e.getAttribute("content")||"").trim().toLowerCase()==="same-origin":!1}function ft(e,t){let n=typeof document<"u"?document.startViewTransition:void 0;if(bo()&&typeof n=="function"){let r=n.call(document,e);r&&r.finished&&typeof r.finished.then=="function"?r.finished.then(()=>{t&&t()}).catch(()=>{}):t&&t();return}e(),t&&t()}function yo(e,t){if(!e||!t||typeof e.querySelectorAll!="function")return;let n=e.querySelectorAll("[data-webjs-permanent][id]");for(let r of n){let s=r.id;if(!s)continue;let o=null;try{o=t.querySelector(`#${CSS.escape(s)}`)}catch{o=null}if(!o||!r.hasAttribute||!r.hasAttribute("data-webjs-permanent"))continue;let i=o.parentNode;i&&o!==r&&i.replaceChild(r,o)}}function At(e,t){let n=[];for(let r of e){if(r.nodeType!==1)continue;let s=r;if(s.hasAttribute&&s.hasAttribute("data-webjs-permanent")&&s.id&&n.push(s),typeof s.querySelectorAll=="function")for(let o of s.querySelectorAll("[data-webjs-permanent][id]"))n.push(o)}if(n.length)for(let r of n){let s=r.id;if(!s)continue;let o=qi(t,s);if(!o||o===r)continue;let i=o.parentNode;if(i)i.replaceChild(r,o);else{let a=t.indexOf(o);a!==-1&&(t[a]=r)}}}function qi(e,t){for(let n of e){if(n.nodeType!==1)continue;let r=n;if(r.id===t)return r;if(typeof r.querySelector=="function"){let s=null;try{s=r.querySelector(`#${CSS.escape(t)}`)}catch{s=null}if(s)return s}}return null}function Vi(e){if(!(!e||!e.start))for(let t=e.start.nextSibling;t&&t!==e.end;t=t.nextSibling)t.nodeType===1&&Z(t)}function Ln(e,t,n,r,s,o){try{lt(e)}catch{}try{typeof sessionStorage<"u"&&(!r||t||n)&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}if(r&&!t&&!n){let u=document.querySelector('script[type="importmap"]'),f=u?u.getAttribute("data-webjs-build"):null,p=!1;if(s&&f&&(p=s!==f),!p&&e.head&&e.head.children.length>0){let m=Hr(document),x=Hr(e);m!==x&&(p=!0)}if(p&&typeof location<"u"){C.clear(),w.clear();try{let m="webjs:importmap-reload";if(sessionStorage&&sessionStorage.getItem(m))sessionStorage.removeItem(m);else{sessionStorage&&sessionStorage.setItem(m,"1"),location.href=r;return}}catch{location.href=r;return}}else if(!p){let m=u?u.getAttribute("data-webjs-src"):null;o&&m&&o!==m&&(C.clear(),w.clear(),u&&u.setAttribute("data-webjs-src",o));try{typeof sessionStorage<"u"&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}}}if(t){let u=document.querySelector(`webjs-frame#${CSS.escape(t)}`),f=e.querySelector(`webjs-frame#${CSS.escape(t)}`);if(u&&f){Sn(e.head),ft(()=>{Xi(u,f),Ie(u),Z(u),dt()},()=>Z(u)),Vr(e.body);return}let p=new CustomEvent("webjs:frame-missing",{bubbles:!0,cancelable:!0,detail:{frameId:t,url:r||(typeof location<"u"?location.href:null),document:e}});(u||document).dispatchEvent(p),p.defaultPrevented||console.warn(`[webjs] frame "${t}" was not in the navigation response, leaving it unchanged. Handle "webjs:frame-missing" (preventDefault) to override.`);return}let i=be(document.body),a=be(e.body),c=i&&a?no(i,a):null;if(c){let{mode:u,live:f,incoming:p}=c;Sn(e.head),ft(()=>{u==="replace"?zi(f,p):Wi(f,p,e),dt()},()=>Vi(f)),Vr(e.body);return}if(r&&!n&&typeof location<"u"){bn(i?a?"no-shared-boundary":"incoming-boundaries-malformed":"live-boundaries-malformed",r),location.href=r;return}if(r&&n)return bn("revalidation-discarded",r),"discard";So(e.head),yo(document.body,e.body);let l=[...e.body.childNodes];ft(()=>{document.body.replaceChildren(...l),Ie(document.body),Z(document.body),dt()},()=>Z(document.body))}function dt(){let e=document.activeElement;!e||e===document.body||e===document.documentElement||typeof e.blur=="function"&&e.blur()}function zi(e,t){let n=e.start.parentNode;if(!n)return;let r=[];for(let o=e.start.nextSibling;o&&o!==e.end;o=o.nextSibling)r.push(o);let s=[];for(let o=t.start.nextSibling;o&&o!==t.end;o=o.nextSibling)s.push(document.importNode(o,!0));At(r,s);for(let o of r)o.parentNode===n&&n.removeChild(o);for(let o of s)n.insertBefore(o,e.end);for(let o=e.start.nextSibling;o&&o!==e.end;o=o.nextSibling)o.nodeType===1&&(Ie(o),Z(o))}function Wi(e,t,n){if(!e||!t)return;let r=e.start.parentNode;if(!r)return;let s=[];for(let i=e.start.nextSibling;i&&i!==e.end;i=i.nextSibling)s.push(i);let o=[];for(let i=t.start.nextSibling;i&&i!==t.end;i=i.nextSibling)o.push(document.importNode(i,!0));At(s,o),Ki(r,e.start,e.end,s,o);for(let i=e.start.nextSibling;i&&i!==e.end;i=i.nextSibling)i.nodeType===1&&(Ie(i),Z(i))}function Ki(e,t,n,r,s){let o=new Map;for(let c of r){if(c.nodeType!==1)continue;let l=me(c);l&&o.set(l,c)}let i=n,a=[];for(let c of s){if(c.nodeType===1){let l=me(c);if(l&&o.has(l)){let h=o.get(l);_t(h,c),a.push(h),o.delete(l);continue}}a.push(c)}for(let c of r)if(c.parentNode===e){if(c.nodeType===1&&a.includes(c))continue;e.removeChild(c)}for(let c of a)e.insertBefore(c,i)}function _t(e,t){if(e===t)return;if(e.tagName!==t.tagName){e.replaceWith(t);return}let n=new Set;for(let r of t.attributes)n.add(r.name),!wn.has(r.name)&&e.getAttribute(r.name)!==r.value&&e.setAttribute(r.name,r.value);for(let r of[...e.attributes])wn.has(r.name)||n.has(r.name)||e.removeAttribute(r.name);if(Yi(e)){Ji(e,t);return}vt(e,t)}function Yi(e){return e[Symbol.for("webjs.instance")]!=null}function Gi(e,t){for(let n=e.parentElement;n&&n!==t;n=n.parentElement)if(n.tagName.includes("-"))return!1;return!0}function qr(e){let t=new Map,n=`slot[${L}][${M}="${K}"]`;for(let r of e.querySelectorAll(n)){let s=r;if(!Gi(s,e))continue;let o=s.getAttribute("name")||null;t.has(o)||t.set(o,s)}return t}function Ji(e,t){if(!e[R])return;let n=qr(e),r=qr(t);if(n.size===0&&r.size===0)return;let s=new Set([...n.keys(),...r.keys()]);for(let o of s){let i=n.get(o),a=r.get(o);i&&a?(vt(i,a),se(e,o,[...i.childNodes])):a?se(e,o,[...a.childNodes].map(c=>document.importNode(c,!0))):se(e,o,null)}}function vt(e,t){let n=[...e.childNodes],r=[...t.childNodes].map(a=>document.importNode(a,!0));At(n,r);let s=new Map;for(let a of n){if(a.nodeType!==1)continue;let c=me(a);c&&s.set(c,a)}let o=[];for(let a=0;a<r.length;a++){let c=r[a];if(c.nodeType===1){let l=me(c);if(l&&s.has(l)){let u=s.get(l);_t(u,c),o.push(u),s.delete(l);continue}let h=n[a];if(h&&h.nodeType===1&&!me(h)&&h.tagName===c.tagName){_t(h,c),o.push(h);continue}}else if(c.nodeType===3){let l=n[a];if(l&&l.nodeType===3){l.nodeValue!==c.nodeValue&&(l.nodeValue=c.nodeValue),o.push(l);continue}}else if(c.nodeType===8){let l=n[a];if(l&&l.nodeType===8){l.nodeValue!==c.nodeValue&&(l.nodeValue=c.nodeValue),o.push(l);continue}}o.push(c)}let i=new Set(o);for(let a of n)!i.has(a)&&a.parentNode===e&&e.removeChild(a);for(let a=0;a<o.length;a++){let c=o[a];(c.parentNode!==e||e.childNodes[a]!==c)&&e.insertBefore(c,e.childNodes[a]||null)}}function me(e){let t=e.getAttribute("data-key");return t?`${e.tagName}:k:${t}`:e.id?`${e.tagName}:i:${e.id}`:null}function go(){let e=be(document.body);if(!e||e.size===0)return null;let t=[...e.keys()].sort((a,c)=>c.length-a.length),n=null,r=null;for(let a of t){let c=document.getElementById(`wj-loading:${a}`);if(c instanceof HTMLTemplateElement){n=a,r=c;break}}if(n===null||r===null)return null;let s=e.get(n),o=[];for(let a=s.start.nextSibling;a&&a!==s.end;a=a.nextSibling)o.push(a);let i=document.createRange();return i.setStartAfter(s.start),i.setEndBefore(s.end),i.deleteContents(),s.start.parentNode.insertBefore(r.content.cloneNode(!0),s.end),{slot:s,oldChildren:o,token:S}}function Re(e){if(!e||e.token!==S)return;let{slot:t,oldChildren:n}=e;if(t.start.parentNode!==t.end.parentNode)return;let r=document.createRange();r.setStartAfter(t.start),r.setEndBefore(t.end),r.deleteContents();for(let s of n)t.start.parentNode.insertBefore(s,t.end)}function Xi(e,t){vt(e,t)}function _o(){if(typeof document>"u")return"";let e=document.querySelector('meta[name="csp-nonce"]');return e&&e.getAttribute("content")||""}function On(e){let t=document.createElement("script");for(let r of e.attributes)r.name!=="nonce"&&t.setAttribute(r.name,r.value);let n=_o();return n&&t.setAttribute("nonce",n),t.textContent=e.textContent,t}function wo(e){if(!e.hasAttribute("nonce"))return e.cloneNode(!0);let t=e.cloneNode(!0),n=_o();return n?t.setAttribute("nonce",n):t.removeAttribute("nonce"),t}function Q(e){if(!e.hasAttribute("nonce"))return e.outerHTML;let t=e.cloneNode(!0);return t.removeAttribute("nonce"),t.outerHTML}function Sn(e){let t=e.querySelector("title");t&&(document.title=t.textContent||"");let n=new Set;for(let r of document.head.children)n.add(Q(r));for(let r of e.children)r.tagName==="SCRIPT"&&r.getAttribute("type")==="importmap"||r.tagName!=="BASE"&&r.tagName!=="TITLE"&&(n.has(Q(r))||(r.tagName==="SCRIPT"?document.head.appendChild(On(r)):document.head.appendChild(wo(r))))}function Qi(e){return e.tagName==="STYLE"?!0:e.tagName==="LINK"&&(e.getAttribute("rel")||"").toLowerCase().split(/\s+/).includes("stylesheet")}function So(e){let t=document.head,n=e.querySelector("title");n&&(document.title=n.textContent||"");let r=new Set;for(let o of t.children)o.tagName==="SCRIPT"&&o.getAttribute("type")==="importmap"||o.tagName!=="BASE"&&r.add(Q(o));let s=new Set;for(let o of e.children)o.tagName==="SCRIPT"&&o.getAttribute("type")==="importmap"||o.tagName!=="BASE"&&s.add(Q(o));for(let o of[...t.children])o.tagName==="SCRIPT"&&o.getAttribute("type")==="importmap"||o.tagName!=="BASE"&&o.tagName!=="TITLE"&&(Qi(o)||s.has(Q(o))||o.remove());for(let o of e.children)o.tagName==="SCRIPT"&&o.getAttribute("type")==="importmap"||o.tagName!=="BASE"&&o.tagName!=="TITLE"&&(r.has(Q(o))||(o.tagName==="SCRIPT"?t.appendChild(On(o)):t.appendChild(wo(o))))}function Z(e){typeof customElements>"u"||Pn(e)}function Pn(e){let t=e instanceof Element?[e,...e.querySelectorAll("*")]:[...e.querySelectorAll("*")];for(let n of t)n.tagName&&n.tagName.includes("-")&&(customElements.upgrade(n),n.shadowRoot&&Pn(n.shadowRoot))}function Vr(e){for(let t of e.querySelectorAll("template[data-webjs-resolve]"))document.body.appendChild(t.cloneNode(!0))}async function Ao(e){if(!e.body||typeof e.body.getReader!="function")return{shell:await e.text(),streaming:!1};let t=e.body.getReader(),n=new TextDecoder,r="",s="<template data-webjs-resolve",o="<!--wj-stream-shell-->",i=/<\/html\s*>/i;for(;;){let{value:a,done:c}=await t.read();a&&(r+=n.decode(a,{stream:!0})),c&&(r+=n.decode());let l=r.indexOf(o);if(l!==-1)return{shell:r.slice(0,l),streaming:!0,reader:c?null:t,dec:n,rest:r.slice(l+o.length)};let h=r.indexOf(s);if(h!==-1)return{shell:r.slice(0,h),streaming:!0,reader:c?null:t,dec:n,rest:r.slice(h)};if(c)return{shell:r,streaming:!1};let u=i.exec(r);if(u){let f=u.index+u[0].length;return{shell:r.slice(0,f),streaming:!0,reader:t,dec:n,rest:r.slice(f)}}}}function vo(e){let t=/<template\s+data-webjs-resolve="([^"]+)"\s*>/i.exec(e);if(!t)return null;let n=t[1],r=t.index+t[0].length,s=/<(\/?)template\b[^>]*>/gi;s.lastIndex=r;let o=1,i;for(;i=s.exec(e);)if(i[1]==="/"){if(o--,o===0)return{id:n,content:e.slice(r,i.index),rest:e.slice(i.index+i[0].length)}}else o++;return null}function Co(e,t){let n=document.getElementById(e);if(!n)return;let r=document.createElement("template");r.innerHTML=t;let s=[...r.content.childNodes];n.replaceWith(r.content);for(let o of s)o.nodeType===1&&Pn(o)}async function Eo(e,t,n,r){let s=n,o=()=>{let i;for(;i=vo(s);){if(!r())return!1;Co(i.id,i.content),s=i.rest}return!0};if(!e){o();return}try{for(;;){if(!o()){try{await e.cancel()}catch{}return}let{value:i,done:a}=await e.read();if(i&&(s+=t.decode(i,{stream:!0})),a){s+=t.decode(),o();return}}}catch{}}function Ie(e){for(let t of e.querySelectorAll("script"))t.replaceWith(On(t))}function Zi(e){return w.get(ee(e))||null}function ea(){return X.size}function ta(){w.clear(),X.clear(),de.length=0,Le.clear(),St(),Rn()}function na(){return S}function ra(){return++S}function oa(){return I}function sa(e){I=e}function ia(){mn.clear(),yn=!1}function aa(e,t){return to(e,t)}function ca(e){return wt.test(e)}var Dr,ue,z,k,S,hn,I,ut,wt,eo,mn,yn,Li,C,Ii,oo,so,Mi,Fi,Ui,w,X,de,Le,he,Oe,V,fe,Pe,yt,gt,wn,at=B(()=>{ln();ct();ct();Mr();dn();Je();Dr="text/vnd.webjs-stream.html";ue=null;z=!1,k=null,S=0,hn=null;I=null,ut=null;wt=/\.(?:pdf|zip|tar|gz|7z|rar|dmg|exe|msi|deb|rpm|apk|ipa|xlsx?|docx?|pptx?|csv|odt|ods|odp|rtf|epub|mobi|xml|json|rss|atom|txt|md|wasm|mp3|mp4|mov|avi|webm|ogg|flac|wav|m4a|m4v|mkv|png|jpe?g|gif|webp|avif|bmp|ico|svg|tiff?|heic)$/i;eo="_top";mn=new Set;yn=!1;Li=16,C=new Map;Ii=8,oo=3e4,so=3,Mi=24,Fi=100,Ui=250,w=new Map,X=new Set,de=[],Le=new Set,he=null,Oe=null,V=null,fe=new WeakMap,Pe=new Set;yt=new WeakMap;gt=new WeakMap;wn=new Set(["value","checked","selected","indeterminate","disabled","open","popover"]);(typeof window>"u"||window.__WEBJS_CLIENT_ROUTER__!==!1)&&vn()});function Ro(e,...t){return{_$webjs:"template",strings:e,values:t}}function T(e){return!!e&&typeof e=="object"&&e._$webjs==="template"}var _="wjm-";function Lo(e,...t){let n=e[0];for(let r=1;r<e.length;r++)n+=String(t[r-1]??"")+e[r];return{_$webjsCss:!0,text:n}}function kt(e){return!!e&&typeof e=="object"&&e._$webjsCss===!0}function xt(e,t){if(!(!t||!t.length))if("adoptedStyleSheets"in e&&typeof CSSStyleSheet<"u"){let n=t.map(r=>{let s=new CSSStyleSheet;return s.replaceSync(r.text),s});e.adoptedStyleSheets=n}else{let n=e,r=document.createElement("style");r.textContent=t.map(s=>s.text).join(`
2
- `),n.appendChild(r)}}function Oo(e){return!e||!e.length?"":`<style>${e.map(t=>t.text).join(`
3
- `)}</style>`}var Nt=Object.freeze({"@":"event",".":"prop","?":"bool"});function Dn(e){return Object.prototype.hasOwnProperty.call(Nt,e)}function Po(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Io(e){return String(e).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}var $n=Symbol.for("webjs.repeat");function Hn(e,t,n){return{[$n]:!0,items:[...e],keyFn:t,templateFn:n}}function Me(e){return!!e&&typeof e=="object"&&e[$n]===!0}function Mo(e){return{_$webjs:"unsafe-html",value:String(e??"")}}function jt(e){return!!e&&typeof e=="object"&&e._$webjs==="unsafe-html"}function Fo(e){return{_$webjs:"live",value:e}}function Rt(e){return!!e&&typeof e=="object"&&e._$webjs==="live"}function Uo(e,t){return{_$webjs:"keyed",key:e,value:t}}function Fe(e){return!!e&&typeof e=="object"&&e._$webjs==="keyed"}function Bo(e,t){return{_$webjs:"guard",deps:e,fn:t}}function Ue(e){return!!e&&typeof e=="object"&&e._$webjs==="guard"}function Do(e){return{_$webjs:"template-content",template:e}}function Lt(e){return!!e&&typeof e=="object"&&e._$webjs==="template-content"}function $o(e){return{_$webjs:"ref",target:e}}function Be(e){return!!e&&typeof e=="object"&&e._$webjs==="ref"}function Ho(){return{value:void 0}}function qo(e){return{_$webjs:"cache",value:e}}function De(e){return!!e&&typeof e=="object"&&e._$webjs==="cache"}function Vo(...e){return{_$webjs:"until",args:e}}function $e(e){return!!e&&typeof e=="object"&&e._$webjs==="until"}function zo(e,t){return{_$webjs:"async-append",iterable:e,mapper:t}}function Ot(e){return!!e&&typeof e=="object"&&e._$webjs==="async-append"}function Wo(e,t){return{_$webjs:"async-replace",iterable:e,mapper:t}}function Pt(e){return!!e&&typeof e=="object"&&e._$webjs==="async-replace"}function Ko(e){return{_$webjs:"watch",signal:e}}function He(e){return!!e&&typeof e=="object"&&e._$webjs==="watch"}var j=null,D=!1,ne=0,te=null,It=0,qn=(e,t)=>Object.is(e,t),Ve=()=>{},Vn=()=>!1;function zn(e,t){e.liveConsumers||(e.liveConsumers=new Set);let n=e.liveConsumers.size===0;if(e.liveConsumers.add(t),n){if(e.producers&&e.producers.length>0)for(let r of e.producers)zn(r,e);if(e.watched)try{e.watched.call(e.wrapper)}catch(r){console.error(r)}}}function we(e,t){if(e.liveConsumers&&(e.liveConsumers.delete(t),e.liveConsumers.size===0)){if(e.producers&&e.producers.length>0)for(let n of e.producers)we(n,e);if(e.unwatched)try{e.unwatched.call(e.wrapper)}catch(n){console.error(n)}}}function $t(e){if(D)throw new Error("Signal read during notification phase");if(j===null)return;let t=j,n=t.nextProducerIndex++;n<t.producers.length&&t.producers[n]!==e&&Ut(t)&&we(t.producers[n],t),t.producers[n]!==e&&(t.producers[n]=e,Ut(t)&&zn(e,t)),t.producerLastReadVersions[n]=e.version}function Ut(e){return e.consumerIsAlwaysLive||e.liveConsumers&&e.liveConsumers.size>0}function Wn(e){if(!e.liveConsumers||e.liveConsumers.size===0)return;let t=D;D=!0;try{for(let n of e.liveConsumers)n.dirty||Yo(n)}finally{D=t}}function Yo(e){e.dirty=!0,Wn(e),e.consumerMarkedDirty.call(e.wrapper||e)}function ze(e){if(!(!e.dirty&&e.lastCleanEpoch===ne)){if(!e.producerMustRecompute()&&!Go(e)){e.dirty=!1,e.lastCleanEpoch=ne;return}e.producerRecomputeValue(),e.dirty=!1,e.lastCleanEpoch=ne}}function Go(e){for(let t=0;t<e.producers.length;t++){let n=e.producers[t],r=e.producerLastReadVersions[t];if(r!==n.version||(ze(n),r!==n.version))return!0}return!1}function Bt(e){e&&(e.nextProducerIndex=0);let t=j;return j=e,t}function Dt(e,t){if(j=t,!!e){if(Ut(e))for(let n=e.nextProducerIndex;n<e.producers.length;n++)we(e.producers[n],e);for(;e.producers.length>e.nextProducerIndex;)e.producers.pop(),e.producerLastReadVersions.pop()}}var We=class{constructor(t,n){this.__value=t,this.version=0,this.lastCleanEpoch=ne,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.liveConsumers=void 0,this.consumerAllowSignalWrites=!0,this.consumerIsAlwaysLive=!1,this.producerMustRecompute=Vn,this.producerRecomputeValue=Ve,this.consumerMarkedDirty=Ve,this.wrapper=this,this.__isSignal=!0,this.__equal=n?.equals||qn,this.watched=n?.[Ht],this.unwatched=n?.[qt]}get(){return $t(this),this.__value}peek(){return this.__value}set(t){if(D)throw new Error("Signal write during notification phase");this.__equal.call(this,this.__value,t)||(this.__value=t,this.version++,ne++,te!==null?Kn(this):Wn(this))}};function Kn(e){let t=D;D=!0;try{if(!e.liveConsumers)return;for(let n of e.liveConsumers)n.dirty||(n.dirty=!0,n.__isWatcher?te.add(n):Kn(n))}finally{D=t}}var Mt=Symbol("unset"),Ft=Symbol("computing"),qe=Symbol("errored"),Se=class{constructor(t,n){this.__fn=t,this.__value=Mt,this.__error=null,this.version=0,this.lastCleanEpoch=-1,this.dirty=!0,this.producers=[],this.producerLastReadVersions=[],this.nextProducerIndex=0,this.liveConsumers=void 0,this.consumerAllowSignalWrites=!1,this.consumerIsAlwaysLive=!1,this.wrapper=this,this.__isSignal=!0,this.__isComputed=!0,this.__equal=n?.equals||qn,this.watched=n?.[Ht],this.unwatched=n?.[qt];let r=this;this.producerMustRecompute=function(){return r.__value===Mt||r.__value===Ft},this.producerRecomputeValue=function(){if(r.__value===Ft)throw new Error("Detected cycle in computations.");let s=r.__value;r.__value=Ft;let o=Bt(r),i,a=!1;try{i=r.__fn.call(r.wrapper)}catch(l){i=qe,r.__error=l,a=!0}finally{Dt(r,o)}if(!a&&(s!==Mt&&s!==qe)&&r.__equal.call(r.wrapper,s,i)){r.__value=s;return}r.__value=i,r.version++},this.consumerMarkedDirty=Ve}get(){if(ze(this),$t(this),this.__value===qe)throw this.__error;return this.__value}peek(){if(ze(this),this.__value===qe)throw this.__error;return this.__value}},Ke=class{constructor(t){this.__notify=t,this.version=0,this.lastCleanEpoch=ne,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.nextProducerIndex=0,this.liveConsumers=void 0,this.consumerAllowSignalWrites=!1,this.consumerIsAlwaysLive=!0,this.producerMustRecompute=Vn,this.producerRecomputeValue=Ve,this.wrapper=this,this.__isWatcher=!0;let n=this;this.consumerMarkedDirty=function(){n.__fire()}}__fire(){this.__notify&&this.__notify.call(this)}watch(...t){if(t.length===0){this.dirty=!1;return}let n=Bt(this);try{for(let r of t)$t(r),r.__isComputed&&ze(r)}finally{Dt(this,n)}this.dirty=!1}unwatch(...t){for(let n=this.producers.length-1;n>=0;n--)t.includes(this.producers[n])&&(we(this.producers[n],this),this.producers.splice(n,1),this.producerLastReadVersions.splice(n,1),this.nextProducerIndex=Math.min(this.nextProducerIndex,this.producers.length))}getPending(){return this.producers.filter(t=>t.__isComputed&&t.dirty)}observe(t){let n=Bt(this),r;try{r=t()}finally{Dt(this,n)}return this.dirty=!1,r}dispose(){for(let t of this.producers)we(t,this);this.producers=[],this.producerLastReadVersions=[],this.__notify=null}},Ht=Symbol("watched"),qt=Symbol("unwatched");function Jo(e){let t=j;j=null;try{return e()}finally{j=t}}function Xo(e){return e.producers.slice()}function Qo(e){return e.liveConsumers?[...e.liveConsumers]:[]}function Zo(e){return!!e.liveConsumers&&e.liveConsumers.size>0}function es(e){return e.producers.length>0}function ts(){return j&&j.__isComputed?j:null}function ns(e){It++,te===null&&(te=new Set);try{e()}finally{if(It--,It===0){let t=te;te=null;for(let n of t)n.__fire()}}}var Ae={State:We,Computed:Se,subtle:{Watcher:Ke,untrack:Jo,introspectSources:Xo,introspectSinks:Qo,hasSinks:Zo,hasSources:es,currentComputed:ts,watched:Ht,unwatched:qt}};function rs(e,t){return new We(e,t)}function os(e,t){return new Se(e,t)}function ss(e){return!!(e&&typeof e=="object"&&e.__isSignal===!0)}function is(e){let t=!1,n=!1,r=new Se(e),s=new Ke(()=>{t||n||(t=!0,queueMicrotask(()=>{if(t=!1,!n){try{r.get()}catch(o){console.error(o)}s.watch()}}))});s.watch(r);try{r.get()}catch(o){console.error(o)}return()=>{n||(n=!0,s.dispose())}}Je();var or=new WeakMap,Xt=Symbol.for("webjs.instance");function ce(e,t){let n=t,r=n[Xt];if(T(e)){let s=e;if(r&&r.strings===s.strings){ie(r,s.values);return}r&&sr(r,t);let o=t.firstChild;o&&o.nodeType===8&&o.data==="webjs-hydrate"&&o.remove();let i=_s(s,t);n[Xt]=i;return}if(r&&sr(r,t),n[Xt]=null,t.replaceChildren(),!(e==null||e===!1||e===!0)){if(Array.isArray(e)){for(let s of e){let o=document.createTextNode(String(s??""));t.appendChild(o)}return}t.appendChild(document.createTextNode(String(e)))}}function Qe(e){let{strings:t}=e,n=or.get(t);if(n)return n;let r=[],s="",o="text",i="",a=0,c="",l=0,h=null,u="",f="";for(let m=0;m<t.length;m++){let x=t[m];for(let g=0;g<x.length;g++){let d=x[g];switch(o){case"text":s+=d,d==="<"&&(o="tag-open");break;case"tag-open":s+=d,d==="!"?o="bang-1":d==="/"?(o="tag-name",u=""):/[a-zA-Z]/.test(d)?(o="tag-name",u=d.toLowerCase()):o="text";break;case"bang-1":s+=d,o=d==="-"?"bang-dash":"tag-name";break;case"bang-dash":s+=d,d==="-"?(o="comment",l=0):o="tag-name";break;case"comment":s+=d,d==="-"?l+=1:(d===">"&&l>=2&&(o="text"),l=0);break;case"tag-name":s+=d,d===">"?(o=u==="script"||u==="style"?"rawtext":"text",o==="rawtext"&&(f="")):/\s/.test(d)?o="in-tag":u+=d.toLowerCase();break;case"in-tag":s+=d,d===">"?(o=u==="script"||u==="style"?"rawtext":"text",o==="rawtext"&&(f="")):!/\s/.test(d)&&d!=="/"&&(o="attr-name",i=d,a=s.length-1);break;case"rawtext":s+=d,f=(f+d.toLowerCase()).slice(-9),(f.endsWith("<\/script>")||f.endsWith("</style>"))&&(o="text",f="",u="");break;case"attr-name":d==="="?(o="after-eq",s+=d):/\s/.test(d)?(o="in-tag",i="",s+=d):d===">"?(o="text",i="",s+=d):(i+=d,s+=d);break;case"after-eq":d==='"'||d==="'"?(o="attr-quoted",c=d,s+=d):/\s/.test(d)?(o="in-tag",i="",s+=d):d===">"?(o="text",i="",s+=d):(o="attr-unquoted",s+=d);break;case"attr-unquoted":/\s/.test(d)?(o="in-tag",i="",s+=d):(d===">"&&(o="text",i=""),s+=d);break;case"attr-quoted":s+=d,d===c&&(o="in-tag",i="");break;case"skip-attr":if(d===c){if(h){let U=h.firstPartIdx,E=[];for(let v=U;v<r.length;v++)(r[v].kind==="noop"||r[v].kind==="attr-mixed")&&E.push(v);let b=[],N=t[E[0]],_e=N.lastIndexOf(c);b.push(_e>=0?N.slice(_e+1):N);for(let v=1;v<E.length;v++)b.push(t[E[v]]);let W=t[E[E.length-1]+1],A=W.indexOf(c);b.push(A>=0?W.slice(0,A):W),r[U]={kind:"attr-mixed",path:[],name:h.name,statics:b,group:E};for(let v=1;v<E.length;v++)r[E[v]]={kind:"noop",path:[],mixedAnchor:U};h=null}o="in-tag",i=""}break}}if(m<t.length-1){let g=r.length;if(o==="comment"){l=0,r.push({kind:"noop",path:[]});continue}if(o==="rawtext"){f="",r.push({kind:"noop",path:[]});continue}if(o==="text")s+=`<!--${_}${g}-->`,r.push({kind:"child",path:[]});else if(o==="in-tag"){let d=`data-${_}${g}`;s+=`${d}=""`,r.push({kind:"element",path:[]})}else if(o==="after-eq"){let d=i[0],U=i.slice(1);if(Dn(d)){s=s.slice(0,a);let E=Nt[d],b=`data-${_}${g}`;s+=`${b}=""`,r.push({kind:E,path:[],name:U})}else{s=s.slice(0,a);let E=`data-${_}${g}`;s+=`${E}=""`,r.push({kind:"attr",path:[],name:i})}o="in-tag",i=""}else if(o==="attr-quoted"||o==="attr-unquoted"){s=s.slice(0,a);let d=`data-${_}${g}`;s+=`${d}=""`,h={name:i,firstPartIdx:g},r.push({kind:"noop",path:[]}),o="skip-attr"}else o==="skip-attr"&&r.push({kind:"noop",path:[]})}}let p=document.createElement("template");return p.innerHTML=s,ys(p.content,r),gs(p.content,r),n={templateEl:p,parts:r},or.set(t,n),n}function ys(e,t){let n=e.querySelectorAll("slot");for(let r of n){r.setAttribute(L,"");let s=t.length;r.setAttribute(`data-${_}${s}`,""),t.push({kind:"slot",path:[]})}}function gs(e,t){let n=[];function r(s){for(let o=0;o<s.childNodes.length;o++){let i=s.childNodes[o];if(n.push(o),i.nodeType===8){let a=i.data;if(a.startsWith(_)){let c=Number(a.slice(_.length));t[c]&&t[c].kind==="child"&&(t[c].path=n.slice())}}else if(i.nodeType===1){let a=i,c=[];for(let l of a.attributes)if(l.name.startsWith(`data-${_}`)){let h=Number(l.name.slice(`data-${_}`.length));t[h]&&t[h].kind!=="child"&&(t[h].path=n.slice()),c.push(l.name)}for(let l of c)a.removeAttribute(l);r(i)}n.pop()}}r(e)}function _s(e,t){let{templateEl:n,parts:r}=Qe(e),s=n.content.cloneNode(!0),o=document.createComment(`${_}s`),i=document.createComment(`${_}e`),a=r.map(l=>Ze(l,s)),c=[];for(let l=0;l<e.values.length;l++)H(a[l],e.values[l],void 0,e.values),c.push(e.values[l]);t.replaceChildren(o,...s.childNodes,i);for(let l of a)l.kind==="slot"&&H(l,void 0,void 0,[]);return{strings:e.strings,bound:a,lastValues:c,startNode:o,endNode:i}}function Ze(e,t){if(e.kind==="noop")return{kind:"noop",mixedAnchor:e.mixedAnchor};let n=t;for(let s of e.path)n=n.childNodes[s];if(e.kind==="child")return{kind:"child",marker:n};let r=n;if(e.kind==="event"){let s={kind:"event",el:r,name:e.name||"",handler:null,dispatcher(o){s.handler?.(o)}};return r.addEventListener(s.name,s.dispatcher),s}if(e.kind==="attr")return{kind:"attr",el:r,name:e.name||""};if(e.kind==="attr-mixed")return{kind:"attr-mixed",el:r,name:e.name||"",statics:e.statics||[],group:e.group||[]};if(e.kind==="prop")return{kind:"prop",el:r,name:e.name||""};if(e.kind==="bool")return{kind:"bool",el:r,name:e.name||""};if(e.kind==="element")return{kind:"element",el:r};if(e.kind==="slot")return{kind:"slot",slotEl:r,applied:!1};throw new Error(`unknown part kind ${e.kind}`)}function ie(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(Object.is(r,e.lastValues[n]))continue;let s=e.bound[n],o=s.mixedAnchor;s.kind==="noop"&&o!=null?H(e.bound[o],t[o],e.lastValues[o],t):H(s,r,e.lastValues[n],t),e.lastValues[n]=r}}function sr(e,t){for(let n of e.bound){if(n.kind==="event"&&n.el.removeEventListener(n.name,n.dispatcher),n.kind==="element"){let r=n.lastTarget;if(r){if(typeof r=="function")try{r(void 0)}catch{}else typeof r=="object"&&(r.value=void 0);n.lastTarget=void 0,n.__lastEl=void 0}}if(n.kind==="slot"){let r=Qt(n.slotEl);r&&rr(r,n.slotEl)}}t.replaceChildren()}function H(e,t,n,r){if(Rt(t)){let s=t.value;if(e.kind==="prop"&&e.el[e.name]===s||e.kind==="attr"&&e.el.getAttribute(e.name)===String(s)||e.kind==="bool"&&e.el.hasAttribute(e.name)===!!s)return;t=s}switch(e.kind){case"child":As(e,t);break;case"attr":{t==null||t===!1?e.el.removeAttribute(e.name):e.el.setAttribute(e.name,String(t));break}case"prop":e.el[e.name]=t;break;case"bool":t?e.el.setAttribute(e.name,""):e.el.removeAttribute(e.name);break;case"event":e.handler=typeof t=="function"?t:null;break;case"element":Ss(e,t);break;case"attr-mixed":{let s=e,o=s.statics[0];for(let i=0;i<s.group.length;i++)o+=String((r?r[s.group[i]]:t)??""),o+=s.statics[i+1]||"";e.el.setAttribute(e.name,o);break}case"slot":{if(e.applied)break;let s=e.slotEl,o=()=>{e.applied=!0;let a=Qt(s);if(!a||ws(s))return;let c=document.createDocumentFragment();for(;s.firstChild;)c.appendChild(s.firstChild);s[Ge]=c,queueMicrotask(()=>Jt(a))};Qt(s)?o():queueMicrotask(o);break}case"noop":break}}function Qt(e){let t=e.parentElement;for(;t;){if(t[R])return t;t=t.parentElement}return null}function ws(e){let t=e;for(let n=0;n<128;n++){let r=t.parentNode;if(!r||r===t)return!1;if(r.nodeType===11&&r.host)return!0;t=r}return!1}function Ss(e,t){let n=e,r=Be(t)?t.target:void 0,s=n.__refTarget,o=r!==s;if(o&&s)if(typeof s=="function")try{s(void 0)}catch{}else typeof s=="object"&&(s.value=void 0);if(o||n.__refElement!==e.el){if(n.__refTarget=r,r)if(typeof r=="function"){if(!o&&n.__refElement!==void 0)try{r(void 0)}catch{}try{r(e.el)}catch{}}else typeof r=="object"&&(r.value=e.el);n.__refElement=e.el,e.lastTarget=r}}function As(e,t){return Rs(e,t),O(e,t)}function O(e,t){let n=e.marker;if(jt(t)){$(e);let s=String(t.value??""),o=document.createElement("template");o.innerHTML=s;let i=[...o.content.childNodes],a=document.createDocumentFragment();for(let c of i)a.appendChild(c);n.parentNode?.insertBefore(a,n),e.child=i;return}if(Fe(t)){let s=t,o=e.__keyedKey;o!==void 0&&!Object.is(o,s.key)&&$(e),e.__keyedKey=s.key,O(e,s.value);return}if(Ue(t)){let s=t,o=e.__guardDeps,i=s.deps;if(o!==void 0&&(Array.isArray(o)&&Array.isArray(i)?js(o,i):Object.is(o,i)))return;e.__guardDeps=Array.isArray(i)?i.slice():i,O(e,s.fn());return}if(Lt(t)){$(e);let s=t.template;if(s&&s.content){let o=s.content.cloneNode(!0),i=[...o.childNodes];n.parentNode?.insertBefore(o,n),e.child=i}return}if(Be(t))return;if(De(t))return Ls(e,t.value);if($e(t))return Os(e,t.args);if(He(t))return Ps(e,t.signal);if(Ot(t))return Is(e,t);if(Pt(t))return Ms(e,t);if(Me(t)){if(e.child&&e.child.kind==="repeat"){Es(e,t);return}$(e);let s={kind:"repeat",map:new Map};e.child=s,Cs(n,s,t);return}if(Array.isArray(t)){if(e.child&&e.child.kind==="array"){xs(e,t);return}$(e);let s={kind:"array",items:[]};e.child=s,ks(n,s,t);return}if(e.child){let s=e.child;if(s.kind==="repeat")ir(s),e.child=void 0;else if(s.kind==="array")cr(s),e.child=void 0;else if(s.kind==="async-stream")dr(s),e.child=void 0;else if("strings"in e.child){let o=e.child;if(T(t)&&o.strings===t.strings){ie(o,t.values);return}ae(o.startNode,o.endNode),e.child=void 0}else{for(let o of e.child)o.parentNode&&o.parentNode.removeChild(o);e.child=void 0}}if(t==null||t===!1||t===!0)return;if(T(t)){let s=t,{templateEl:o,parts:i}=Qe(s),a=o.content.cloneNode(!0),c=document.createComment(`${_}s`),l=document.createComment(`${_}e`),h=i.map(p=>Ze(p,a)),u=[];for(let p=0;p<s.values.length;p++)H(h[p],s.values[p],void 0,s.values),u.push(s.values[p]);let f=[c,...a.childNodes,l];n.parentNode?.insertBefore(vs(f),n);for(let p of h)p.kind==="slot"&&H(p,void 0,void 0,[]);e.child={strings:s.strings,bound:h,lastValues:u,startNode:c,endNode:l};return}let r=document.createTextNode(String(t));n.parentNode?.insertBefore(r,n),e.child=[r]}function vs(e){let t=document.createDocumentFragment();for(let n of e)t.appendChild(n);return t}function ae(e,t){if(!e.parentNode)return;let n=e;for(;n&&n!==t;){let r=n.nextSibling;n.parentNode?.removeChild(n),n=r}t.parentNode===e.parentNode&&t.parentNode?.removeChild(t)}function en(e){let{templateEl:t,parts:n}=Qe(e),r=t.content.cloneNode(!0),s=document.createComment(`${_}s`),o=document.createComment(`${_}e`),i=n.map(l=>Ze(l,r)),a=[];for(let l=0;l<e.values.length;l++)H(i[l],e.values[l],void 0,e.values),a.push(e.values[l]);let c=document.createDocumentFragment();for(c.appendChild(s);r.firstChild;)c.appendChild(r.firstChild);return c.appendChild(o),{inst:{strings:e.strings,bound:i,lastValues:a,startNode:s,endNode:o},frag:c}}function Ce(e){for(let t of e.bound)if(t.kind==="event"&&t.el.removeEventListener(t.name,t.dispatcher),t.kind==="element"){let n=t.lastTarget;if(n){if(typeof n=="function")try{n(void 0)}catch{}else typeof n=="object"&&(n.value=void 0);t.lastTarget=void 0,t.__lastEl=void 0}}}function Cs(e,t,n){let{items:r,keyFn:s,templateFn:o}=n,i=e.parentNode;if(!i)return;let a=document.createDocumentFragment();for(let c=0;c<r.length;c++){let l=s(r[c],c),h=o(r[c],c);if(!T(h))continue;let{inst:u,frag:f}=en(h);t.map.set(l,u),a.appendChild(f)}i.insertBefore(a,e)}function Es(e,t){let n=e.marker,r=n.parentNode;if(!r)return;let s=e.child,{items:o,keyFn:i,templateFn:a}=t,c=new Map;for(let l=0;l<o.length;l++){let h=i(o[l],l),u=a(o[l],l);if(!T(u))continue;let f=s.map.get(h);if(f&&f.strings===u.strings)ie(f,u.values),Zt(f.startNode,f.endNode,r,n),c.set(h,f),s.map.delete(h);else{f&&(Ce(f),ae(f.startNode,f.endNode),s.map.delete(h));let{inst:p,frag:m}=en(u);r.insertBefore(m,n),c.set(h,p)}}for(let l of s.map.values())Ce(l),ae(l.startNode,l.endNode);s.map=c}function ir(e){for(let t of e.map.values())Ce(t),ae(t.startNode,t.endNode);e.map.clear()}function Ts(e){return e.type==="tpl"?e.inst.startNode:e.type==="text"?e.node:null}function Xe(e){e.type==="tpl"?(Ce(e.inst),ae(e.inst.startNode,e.inst.endNode)):e.type==="text"&&e.node.parentNode?.removeChild(e.node)}function ar(e){if(T(e)){let{inst:t,frag:n}=en(e);return{item:{type:"tpl",inst:t},frag:n}}if(e!=null&&e!==!1&&e!==!0){let t=document.createTextNode(String(e));return{item:{type:"text",node:t},frag:t}}return{item:{type:"empty"},frag:null}}function ks(e,t,n){let r=e.parentNode;if(!r)return;let s=document.createDocumentFragment(),o=[];for(let i of n){let{item:a,frag:c}=ar(i);c&&s.appendChild(c),o.push(a)}r.insertBefore(s,e),t.items=o}function xs(e,t){let n=e.marker,r=n.parentNode;if(!r)return;let s=e.child,o=s.items,i=[];for(let a=0;a<t.length;a++){let c=t[a],l=o[a];if(T(c)){let f=c;if(l&&l.type==="tpl"&&l.inst.strings===f.strings){ie(l.inst,f.values),i.push(l);continue}}else if(c!=null&&c!==!1&&c!==!0){if(l&&l.type==="text"){let f=String(c);l.node.data!==f&&(l.node.data=f),i.push(l);continue}}else{l&&Xe(l),i.push({type:"empty"});continue}let{item:h,frag:u}=ar(c);u&&r.insertBefore(u,Ns(o,a,n)),l&&Xe(l),i.push(h)}for(let a=t.length;a<o.length;a++)Xe(o[a]);s.items=i}function Ns(e,t,n){for(let r=t;r<e.length;r++){let s=Ts(e[r]);if(s&&s.parentNode)return s}return n}function cr(e){for(let t of e.items)Xe(t);e.items=[]}function Zt(e,t,n,r){if(t.nextSibling===r&&e.parentNode===n)return;let s=document.createDocumentFragment(),o=e;for(;o;){let i=o.nextSibling;if(s.appendChild(o),o===t)break;o=i}n.insertBefore(s,r)}function js(e,t){if(e===t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0}function $(e){let t=e;if(t.__untilState&&(t.__untilState.aborted=!0,t.__untilState=void 0),t.__watchSub&&lr(t),!e.child)return;let n=e.child;if(n.kind==="repeat")ir(n);else if(n.kind==="array")cr(n);else if(n.kind==="async-stream")dr(n);else if("strings"in n){let r=e.child;Ce(r),ae(r.startNode,r.endNode)}else for(let r of e.child)r.parentNode&&r.parentNode.removeChild(r);e.child=void 0}function Rs(e,t){let n=e;n.__untilState&&!$e(t)&&(n.__untilState.aborted=!0,n.__untilState=void 0),n.__guardDeps!==void 0&&!Ue(t)&&(n.__guardDeps=void 0),n.__cacheMap&&!De(t)&&(n.__cacheMap=void 0),n.__keyedKey!==void 0&&!Fe(t)&&(n.__keyedKey=void 0),n.__watchSub&&!He(t)&&lr(n)}function Ls(e,t){let n=e.marker,r=e,s=r.__cacheMap;s||(s=new Map,r.__cacheMap=s);let o=e.child;if(o&&"strings"in o){let a=o;if(T(t)&&a.strings===t.strings){ie(a,t.values);return}let c=document.createDocumentFragment();Zt(a.startNode,a.endNode,c,null),s.set(a.strings,{inst:a,holder:c}),e.child=void 0}if(T(t)){let a=t,c=s.get(a.strings);if(c){s.delete(a.strings),e.child&&$(e),Zt(c.inst.startNode,c.inst.endNode,n.parentNode,n),ie(c.inst,a.values),e.child=c.inst;return}}O(e,t)}function Os(e,t){let n=e,r=n.__untilState,s=n.__untilArgs,o=(f,p)=>!!(Object.is(f,p)||T(f)&&T(p)&&f.strings===p.strings),a=s&&s.length===t.length&&s.every((f,p)=>o(f,t[p]))&&r?r.highestResolved:1/0;r&&(r.aborted=!0),n.__untilArgs=t.slice();let c={aborted:!1,highestResolved:a};n.__untilState=c;let l=-1,h;for(let f=0;f<t.length;f++){let p=t[f];if(!p||typeof p.then!="function"){l=f,h=p;break}}l!==-1&&l<=c.highestResolved?(O(e,h),c.highestResolved=l):l===-1&&!n.__untilEverRendered&&O(e,""),n.__untilEverRendered=!0;let u=Math.min(l===-1?t.length:l,c.highestResolved);for(let f=0;f<u;f++){let p=t[f];!p||typeof p.then!="function"||Promise.resolve(p).then(m=>{c.aborted||f>=c.highestResolved||(c.highestResolved=f,O(e,m))},()=>{})}}function Ps(e,t){let n=e;if(n.__watchSig===t&&n.__watchSub){let o;n.__watchSub.observe(()=>{o=t.get()}),O(e,o);return}n.__watchSub&&(n.__watchSub.dispose(),n.__watchSub=void 0),n.__watchSig=t;let r=new Ae.subtle.Watcher(()=>{queueMicrotask(()=>{if(n.__watchSub!==r)return;let o;r.observe(()=>{o=t.get()}),O(e,o)})});n.__watchSub=r;let s;r.observe(()=>{s=t.get()}),O(e,s)}function lr(e){e.__watchSub&&(e.__watchSub.dispose(),e.__watchSub=void 0,e.__watchSig=void 0)}function Is(e,t){let n=e.child;if(n&&n.kind==="async-stream"&&n.mode==="append"&&n.iterable===t.iterable)return;$(e);let r=t.iterable[Symbol.asyncIterator](),s={kind:"async-stream",mode:"append",aborted:!1,iterable:t.iterable,iterator:r,nodes:[]};e.child=s,ur(s,e,t)}function Ms(e,t){let n=e.child;if(n&&n.kind==="async-stream"&&n.mode==="replace"&&n.iterable===t.iterable)return;$(e);let r=t.iterable[Symbol.asyncIterator](),s={kind:"async-stream",mode:"replace",aborted:!1,iterable:t.iterable,iterator:r,nodes:[]};e.child=s,ur(s,e,t)}async function ur(e,t,n){let r=t.marker,s=0;try{for(;!e.aborted;){let o=await e.iterator.next();if(e.aborted||o.done)break;let i=n.mapper?n.mapper(o.value,s):o.value,a=fr(i);if(e.mode==="replace"){for(let l of e.nodes)l.parentNode&&l.parentNode.removeChild(l);e.nodes=[]}let c=document.createDocumentFragment();for(let l of a)c.appendChild(l);r.parentNode?.insertBefore(c,r),e.nodes.push(...a),s++}}catch(o){typeof console<"u"&&console.error("[webjs] asyncStream error:",o)}}function fr(e){if(e==null||e===!1||e===!0)return[];if(T(e)){let t=e,{templateEl:n,parts:r}=Qe(t),s=n.content.cloneNode(!0),o=r.map(i=>Ze(i,s));for(let i=0;i<t.values.length;i++)H(o[i],t.values[i],void 0,t.values);return[...s.childNodes]}if(Array.isArray(e)){let t=[];for(let n of e)t.push(...fr(n));return t}return[document.createTextNode(String(e))]}function dr(e){e.aborted=!0;for(let t of e.nodes)t.parentNode&&t.parentNode.removeChild(t);e.nodes=[];try{e.iterator.return?.()?.catch?.(()=>{})}catch{}}var hr=null;function et(e){hr=e||null}function Fs(){return hr||void 0}var pr=Symbol.for("webjs:registry"),mr=Symbol.for("webjs:classToTag"),tt=globalThis,P=tt[pr]||(tt[pr]=new Map),br=tt[mr]||(tt[mr]=new WeakMap),nt=typeof window<"u"&&typeof customElements<"u";function tn(e,t){if(!e||typeof e!="string"||!e.includes("-"))throw new Error(`customElements.define: tag "${e}" must contain a hyphen (HTML spec)`);let n=t.lazy===!0,r=P.get(e);r?(r.cls=t,r.lazy=n):P.set(e,{cls:t,moduleUrl:null,lazy:n,tag:e}),br.set(t,e)}if(nt){let e=customElements.define.bind(customElements);customElements.define=function(t,n,r){customElements.get(t)||e(t,n,r),tn(t,n)}}if(!nt){let e=globalThis;e.customElements||(e.customElements={define(t,n){tn(t,n)},get(t){return P.get(t)?.cls},upgrade(){},whenDefined(t){let n=P.get(t);return Promise.resolve(n?.cls)}})}function nn(e,t){nt?customElements.define(e,t):tn(e,t)}function Us(e,t){if(nt)return;let n=P.get(e);if(n){n.moduleUrl=t;return}P.set(e,{cls:null,moduleUrl:t,lazy:!1,tag:e})}function Bs(e){return P.get(e)?.cls}function Ds(e){return P.get(e)?.moduleUrl||null}function $s(e){return P.get(e)?.lazy===!0}function rt(e){return br.get(e)}function Hs(){return[...P.keys()]}ke();Je();var vr=typeof window<"u"&&typeof HTMLElement<"u";function ti(e,t){return e!==t}function ni(){return{states:new Set,shadowRoot:null,form:null,labels:[],role:"",willValidate:!0,validity:{},validationMessage:"",setFormValue(){},setValidity(){},checkValidity(){return!0},reportValidity(){return!0}}}var ot=class{constructor(){this.__ssrAttrs=new Map,this.__internals=null}get attributes(){return[...this.__ssrAttrs].map(([t,n])=>({name:t,value:n}))}getAttribute(t){let n=this.__ssrAttrs.get(String(t).toLowerCase());return n===void 0?null:n}setAttribute(t,n){this.__ssrAttrs.set(String(t).toLowerCase(),String(n))}removeAttribute(t){this.__ssrAttrs.delete(String(t).toLowerCase())}hasAttribute(t){return this.__ssrAttrs.has(String(t).toLowerCase())}toggleAttribute(t,n){let r=String(t).toLowerCase(),s=this.__ssrAttrs.has(r);return(n===void 0?!s:n)?(this.__ssrAttrs.set(r,""),!0):(this.__ssrAttrs.delete(r),!1)}getAttributeNames(){return[...this.__ssrAttrs.keys()]}closest(t){let n=String(t).trim().toLowerCase();if(!/^[a-z][a-z0-9-]*$/.test(n))return null;if(this.__ssrTag===n)return this;let r=this.__ssrAncestors;if(!Array.isArray(r))return null;for(let s=r.length-1;s>=0;s--)if(r[s]&&r[s].__ssrTag===n)return r[s];return null}get dataset(){if(this.__dataset)return this.__dataset;let t=this,n=r=>"data-"+String(r).replace(/[A-Z]/g,s=>"-"+s.toLowerCase());return this.__dataset=new Proxy({},{get(r,s){if(typeof s!="string")return;let o=t.getAttribute(n(s));return o===null?void 0:o},set(r,s,o){return typeof s=="string"&&t.setAttribute(n(s),o),!0},has(r,s){return typeof s=="string"&&t.hasAttribute(n(s))},deleteProperty(r,s){return typeof s=="string"&&t.removeAttribute(n(s)),!0},ownKeys(){return t.getAttributeNames().filter(r=>r.startsWith("data-")).map(r=>r.slice(5).replace(/-([a-z])/g,(s,o)=>o.toUpperCase()))},getOwnPropertyDescriptor(r,s){if(typeof s=="string"&&t.hasAttribute(n(s)))return{enumerable:!0,configurable:!0,value:t.getAttribute(n(s))}}}),this.__dataset}get className(){return this.getAttribute("class")??""}set className(t){this.setAttribute("class",t)}get hidden(){return this.hasAttribute("hidden")}set hidden(t){this.toggleAttribute("hidden",!!t)}get id(){return this.getAttribute("id")??""}set id(t){this.setAttribute("id",t)}get title(){return this.getAttribute("title")??""}set title(t){this.setAttribute("title",t)}get slot(){return this.getAttribute("slot")??""}set slot(t){this.setAttribute("slot",t)}get role(){return this.getAttribute("role")}set role(t){t==null?this.removeAttribute("role"):this.setAttribute("role",t)}get tabIndex(){let t=this.getAttribute("tabindex");return t===null?-1:Number.parseInt(t,10)||0}set tabIndex(t){this.setAttribute("tabindex",String(t))}addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}attachInternals(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return this.__internals=ni(),this.__internals}},ri=["ariaAtomic","ariaAutoComplete","ariaBusy","ariaChecked","ariaColCount","ariaColIndex","ariaColSpan","ariaCurrent","ariaDescription","ariaDisabled","ariaExpanded","ariaHasPopup","ariaHidden","ariaInvalid","ariaKeyShortcuts","ariaLabel","ariaLevel","ariaLive","ariaModal","ariaMultiLine","ariaMultiSelectable","ariaOrientation","ariaPlaceholder","ariaPosInSet","ariaPressed","ariaReadOnly","ariaRequired","ariaRoleDescription","ariaRowCount","ariaRowIndex","ariaRowSpan","ariaSelected","ariaSetSize","ariaSort","ariaValueMax","ariaValueMin","ariaValueNow","ariaValueText"];for(let e of ri){let t="aria-"+e.slice(4).toLowerCase();Object.defineProperty(ot.prototype,e,{configurable:!0,get(){return this.getAttribute(t)},set(n){n==null?this.removeAttribute(t):this.setAttribute(t,String(n))}})}var oi=vr?HTMLElement:ot,Cr=Symbol("webjs.factoryProps"),Sr=new WeakSet,le=class e extends oi{static shadow=!1;static hydrate=void 0;static properties={};static styles=null;static register(t){nn(t,this)}static get observedAttributes(){let t=this.properties||{};return Object.keys(t).filter(n=>!(typeof t[n]=="object"&&t[n].state)).map(n=>typeof t[n]=="object"&&t[n].attribute||on(n))}constructor(){super(),this._renderRoot=null,this._scheduled=!1,this._connected=!1,this.__controllers=new Set,this.__firstRendered=!1,this._changedProperties=new Map,this._updateResolve=null,this._updatePromise=Promise.resolve(!0),this._isUpdating=!1,this._assertFactoryProperties(),this._initializeProperties()}_assertFactoryProperties(){let t=this.constructor;if(Sr.has(t))return;let n=t;for(;n&&n!==e;){if(Object.hasOwn(n,"properties")&&!Object.hasOwn(n,Cr)){let r=n.name||"a component";throw new Error(`${r}: \`static properties\` is no longer supported. Declare reactive properties via the factory instead: \`class ${r} extends WebComponent({ count: Number })\`. Use the \`prop()\` helper for options (\`prop(Number, { reflect: true })\`) and set defaults in the constructor after \`super()\`. See https://docs.webjs.dev/docs/components.`)}n=Object.getPrototypeOf(n)}Sr.add(t)}_initializeProperties(){let n=this.constructor.properties;if(!(!n||typeof n!="object")){this.__propValues={};for(let[r,s]of Object.entries(n)){let o=typeof s=="object"?s:{type:s},i=this[r];Object.defineProperty(this,r,{configurable:!0,enumerable:!0,get:()=>this.__propValues[r],set:a=>{let c=this.__propValues[r];(o.hasChanged||ti)(a,c)&&(this.__propValues[r]=a,o.reflect&&!o.state&&this._connected&&this._reflectAttribute(r,a,o),this.requestUpdate(r,c))}}),i!==void 0?this.__propValues[r]=i:o.default!==void 0&&(this.__propValues[r]=typeof o.default=="function"?o.default():o.default)}}}_reflectAttribute(t,n,r){let s=r.attribute||on(t);if(!this.__reflectingAttribute){this.__reflectingAttribute=!0;try{if(r.converter&&r.converter.toAttribute){let o=r.converter.toAttribute(n,r.type);o==null?this.removeAttribute(s):this.setAttribute(s,o)}else r.type===Boolean?n?this.setAttribute(s,""):this.removeAttribute(s):n==null?this.removeAttribute(s):r.type===Object||r.type===Array?this.setAttribute(s,JSON.stringify(n)):this.setAttribute(s,String(n))}finally{this.__reflectingAttribute=!1}}}connectedCallback(){if(!vr)return;if(this.__webjsPropsHydrated||(this.__webjsPropsHydrated=!0,this._hydratePropAttrs()),this.constructor.hydrate==="visible"&&typeof IntersectionObserver<"u"&&!this.__hydrationActivated){this.__hydrationActivated=!1,this.__hydrationObserver=new IntersectionObserver(n=>{for(let r of n)if(r.isIntersecting){this.__hydrationObserver.unobserve(this),this.__hydrationObserver.disconnect(),this.__hydrationObserver=null,this.__hydrationActivated=!0,this._activate();return}},{rootMargin:"200px"}),this.__hydrationObserver.observe(this);return}this._activate()}_hydratePropAttrs(){let t=[],n=this.attributes;for(let r=0;r<n.length;r++){let s=n[r].name;s.startsWith("data-webjs-prop-")&&t.push(s)}for(let r of t){let s=this.getAttribute(r);if(this.removeAttribute(r),s==null)continue;let o=Ar(r.slice(16));try{this[o]=G(s)}catch(i){console.warn(`[webjs] failed to decode ${r} on <${this.tagName.toLowerCase()}>: ${i&&i.message}`)}}}_activate(){this._connected=!0,this._reflectDeclaredAttributes();let t=this.constructor;if(t.shadow!==!0&&!this.hasAttribute("data-wj-host")&&this.setAttribute("data-wj-host",""),t.shadow===!0){let n=!!this.shadowRoot;this.shadowRoot||this.attachShadow({mode:"open"}),this._renderRoot=this.shadowRoot;let r=t.styles,s=Array.isArray(r)?r:kt(r)?[r]:[];if(s.length){if(n){let o=this.shadowRoot.querySelector("style");o&&o.remove()}xt(this._renderRoot,s)}}else this._renderRoot=this,t.styles&&console.warn(`[webjs] <${rt(t)||this.tagName?.toLowerCase()}> has static shadow = false AND static styles. static styles only works with shadow DOM (adoptedStyleSheets). For light DOM, use global CSS or <style> in render().`),Gt(this)||(this.__isHydrating()?(re(this),er(this)):Zn(this));for(let n of this.__controllers)n.hostConnected&&n.hostConnected();this._updateResolve===null&&(this._updatePromise=new Promise(n=>{this._updateResolve=n})),this._scheduled=!0,queueMicrotask(()=>{this._scheduled=!1;try{this._performRender()}catch(n){console.error("[webjs] lifecycle hook threw during initial render:",n)}})}get slots(){return tr(this)}hasSlot(t){return nr(this,t)}setSlotContent(t,n){se(this,t,n)}__isHydrating(){let t=this.firstChild,n=t!=null&&t.nodeType===8&&t.data==="webjs-hydrate";return n&&(this.__hydratedAtActivate=!0),n}disconnectedCallback(){this._connected=!1,this.__hydrationObserver&&(this.__hydrationObserver.disconnect(),this.__hydrationObserver=null),this.__signalWatcher&&(this.__signalWatcher.dispose(),this.__signalWatcher=void 0);for(let t of this.__controllers)t.hostDisconnected&&t.hostDisconnected()}attributeChangedCallback(t,n,r){if(this.__reflectingAttribute)return;let o=this.constructor.properties||{},i,a;for(let[h,u]of Object.entries(o))if(((typeof u=="object"?u:{type:u}).attribute||on(h))===t){i=h,a=u;break}if(a===void 0&&(i=Ar(t),a=o[i]||o[t]),a===void 0)return;let c=typeof a=="object"?a:{type:a},l;if(c.converter&&c.converter.fromAttribute)l=c.converter.fromAttribute(r,c.type);else if(c.type===Number)l=r==null?null:Number(r);else if(c.type===Boolean)l=r!=null&&r!=="false";else if(c.type===Object||c.type===Array)try{l=r==null?null:JSON.parse(r)}catch{l=r}else l=r;this[i]!==l&&(this[i]=l,this._connected&&this.requestUpdate())}requestUpdate(t,n){t!==void 0&&!this._changedProperties.has(t)&&this._changedProperties.set(t,n),this._scheduleUpdate()}_scheduleUpdate(){this._updateResolve===null&&(this._updatePromise=new Promise(t=>{this._updateResolve=t})),!this._isUpdating&&(this._scheduled||!this._connected||(this._scheduled=!0,queueMicrotask(()=>{this._scheduled=!1;try{this._performRender()}catch(t){console.error("[webjs] lifecycle hook threw during update cycle:",t)}})))}_performRender(){if(!this._renderRoot)return;let t=this._changedProperties;this._isUpdating=!0;let n=!1,r=null;try{if(this.shouldUpdate(t)){this.willUpdate(t);for(let s of this.__controllers)s.hostUpdate&&s.hostUpdate();this.__renderToken=(this.__renderToken||0)+1,this.__renderAbort&&this.__renderAbort.abort(),this.__renderAbort=typeof AbortController<"u"?new AbortController:null,et(this.__renderAbort?this.__renderAbort.signal:null);try{let s=this.update(t);s&&typeof s.then=="function"&&(r=s)}catch(s){this._handleRenderError(s)}finally{et(null)}if(!r){for(let s of this.__controllers)s.hostUpdated&&s.hostUpdated();n=!0}}}catch(s){console.error("[webjs] lifecycle hook threw during update phase:",s)}finally{this._isUpdating=!1,(n||r)&&(this._changedProperties=new Map)}if(r){let s=this.__renderToken;this.__pendingAsyncCommits=(this.__pendingAsyncCommits||0)+1,r.then(()=>{if(this.__pendingAsyncCommits--,s===this.__renderToken){for(let o of this.__controllers)o.hostUpdated&&o.hostUpdated();this._postCommit(t)}});return}n?this._postCommit(t):this.__pendingAsyncCommits||this._resolveUpdate()}_resolveUpdate(){if(this._updateResolve){let t=this._changedProperties.size===0;this._updateResolve(t),this._updateResolve=null}}performServerUpdate(){let t=this._changedProperties;this._isUpdating=!0;try{this.willUpdate(t);for(let n of this.__controllers)n.hostUpdate&&n.hostUpdate();this._reflectDeclaredAttributes()}finally{this._isUpdating=!1}}_reflectDeclaredAttributes(){let t=this.constructor.properties||{};for(let n of Object.keys(t)){let r=t[n];!r||!r.reflect||r.state||this._reflectAttribute(n,this[n],r)}}shouldUpdate(t){return!0}willUpdate(t){}update(t){this.__signalWatcher||(this.__signalWatcher=new Ae.subtle.Watcher(()=>{this._connected&&this.requestUpdate()}));let n;if(this.__signalWatcher.observe(()=>{n=this.render()}),n&&typeof n.then=="function")return this._commitAsync(n);ce(n,this._renderRoot)}_commitAsync(t){let n=this.__renderToken;if(this.__firstRendered&&this._overridesRenderFallback())try{let r=this.renderFallback();r!==void 0&&ce(r,this._renderRoot)}catch(r){console.error("[webjs] renderFallback() threw:",r)}return Promise.resolve(t).then(r=>{n===this.__renderToken&&ce(r,this._renderRoot)},r=>{n===this.__renderToken&&this._handleRenderError(r instanceof Error?r:new Error(String(r)))})}_overridesRenderFallback(){return this.renderFallback!==st.prototype.renderFallback}_handleRenderError(t){console.error(`[webjs] render error in <${rt(this.constructor)||this.tagName?.toLowerCase()}>:`,t);try{let n=this.renderError(t);n!==void 0&&ce(n,this._renderRoot)}catch(n){console.error("[webjs] renderError() also threw:",n)}}_postCommit(t){try{this.__firstRendered||(this.__firstRendered=!0,this.firstUpdated(t)),this.updated(t)}catch(n){console.error("[webjs] lifecycle hook threw during post-commit phase:",n)}finally{this._resolveUpdate()}}updated(t){}firstUpdated(t){}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._updatePromise}addController(t){this.__controllers.add(t),this._connected&&t.hostConnected&&t.hostConnected()}removeController(t){this.__controllers.delete(t)}render(){return""}renderError(t){}renderFallback(){}};function on(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function Ar(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function st(e){return new.target?Reflect.construct(le,arguments,new.target):class extends le{static properties=e;static[Cr]=!0}}Object.setPrototypeOf(st,le);st.prototype=le.prototype;function si(e,t={}){return e&&typeof e=="object"&&!("call"in e)&&(t=e,e=void 0),{...e?{type:e}:{},...t}}var Er=Symbol.for("webjs.notFound"),Tr=Symbol.for("webjs.redirect"),kr=Symbol.for("webjs.forbidden"),xr=Symbol.for("webjs.unauthorized");function ii(){let e=new Error("webjs: notFound()");throw e.__webjs=Er,e}function ai(){let e=new Error("webjs: forbidden()");throw e.__webjs=kr,e}function ci(){let e=new Error("webjs: unauthorized()");throw e.__webjs=xr,e}function li(e,t){let n=typeof t=="object"&&t!==null?t.status:t,r=new Error(`webjs: redirect(${e})`);throw r.__webjs=Tr,r.url=e,r.status=typeof n=="number"?n:void 0,r}function ui(e){return!!e&&e.__webjs===Er}function fi(e){return!!e&&e.__webjs===Tr}function di(e){return!!e&&e.__webjs===kr}function hi(e){return!!e&&e.__webjs===xr}var Nr=null;function pi(){if(!Nr)return"";try{return Nr()||""}catch{return""}}var lc=Symbol.for("webjs.suspense");function mi(e){return{_$webjsSuspense:!0,fallback:e.fallback,children:e.children}}function bi(e){return!!e&&typeof e=="object"&&e._$webjsSuspense===!0}function yi(e,t={}){let n=t.reconnect!==!1,r=0,s=!1,o=null,i=[];function a(){s||(o=new WebSocket(gi(e),t.protocols),o.onopen=c=>{for(r=0;i.length&&o&&o.readyState===WebSocket.OPEN;)o.send(i.shift());t.onOpen?.(c)},o.onmessage=c=>{let l=c.data;if(typeof l=="string")try{l=JSON.parse(l)}catch{}t.onMessage?.(l,c)},o.onerror=c=>{t.onError?.(c)},o.onclose=c=>{if(t.onClose?.(c),!s&&n){let l=Math.min(1e3*2**r++,3e4);setTimeout(a,l)}})}return a(),{send(c){let l=typeof c=="string"||c instanceof ArrayBuffer||ArrayBuffer.isView(c)?c:JSON.stringify(c);o&&o.readyState===WebSocket.OPEN?o.send(l):i.push(l)},close(c,l){s=!0;try{o?.close(c,l)}catch{}},get socket(){return o},get readyState(){return o?.readyState??3}}}function gi(e){if(/^wss?:\/\//i.test(e))return e;let t=typeof location<"u"&&location.protocol==="https:"?"wss:":"ws:",n=typeof location<"u"?location.host:"";return`${t}//${n}${e.startsWith("/")?e:"/"+e}`}ke();var sn="application/vnd.webjs+json";async function _i(e,t={}){let n=new Headers(t.headers||{});n.has("accept")||n.set("accept",sn);let r=t.body;r!=null&&typeof r=="object"&&!(r instanceof FormData)&&!(r instanceof Blob)&&!(r instanceof ArrayBuffer)&&!(r instanceof URLSearchParams)&&!(typeof ReadableStream<"u"&&r instanceof ReadableStream)&&!ArrayBuffer.isView(r)&&(r=await rn(r),n.has("content-type")||n.set("content-type",sn));let s=await fetch(e,{...t,headers:n,body:r}),o=s.headers.get("content-type")||"",i=await s.text(),a=o.includes(sn)?i?G(i):null:o.includes("application/json")?i?JSON.parse(i):null:i;if(!s.ok){let c=a&&a.error||`richFetch ${e} -> ${s.status}`,l=new Error(c);throw l.status=s.status,l.body=a,l}return a}ke();at();at();ln();ct();var In=class{constructor(t,n){this.host=t,this.options=n,this.updates=[],this._nextId=0}get value(){let t=this.options.source();if(!this.options.update)return this.updates.length>0?this.updates[this.updates.length-1].payload:t;for(let n of this.updates)t=this.options.update(t,n.payload);return t}add(t,n){let r=`opt-${++this._nextId}`;this.updates.push({id:r,payload:t}),this.host?.requestUpdate?.();let s=()=>{let o=this.updates.findIndex(i=>i.id===r);o!==-1&&(this.updates.splice(o,1),this.host?.requestUpdate?.())};return n&&typeof n.then=="function"&&(typeof n.finally=="function"?n.finally(()=>s()).catch(()=>{}):n.then(()=>s(),()=>s())),s}};async function la(e,t,n){let r=e.get();e.set(t);let s;try{s=await n()}catch(o){throw e.set(r),o}return s&&s.success===!1&&e.set(r),s}function ua(e,t,n){return e&&typeof e.get=="function"&&typeof e.set=="function"?la(e,t,n):new In(e,t)}dn();var Ct=0,To=new Map,ge=new Map,fa=1e3;function da(e){if(!(!Array.isArray(e)||!e.length)){Ct+=1;for(let t of e)t&&To.set(t,Ct)}}function ha(){return Ct}function pa(e,t,n){if(!(!Array.isArray(t)||!t.length)&&(ge.delete(e),ge.set(e,{tags:t.slice(),since:typeof n=="number"?n:Ct}),ge.size>fa)){let r=ge.keys().next().value;r!==void 0&&ge.delete(r)}}function ma(e){let t=ge.get(e);if(!t)return!1;for(let n of t.tags)if((To.get(n)||0)>t.since)return!0;return!1}function ba(e){return e?e.split(",").map(t=>t.trim()).filter(Boolean):[]}var ya="application/vnd.webjs+stream",ga=1,_a=2,wa=3,ko=new Uint8Array(0);function Sa(e,t){let n=t||ko,r=n.length,s=new Uint8Array(5+r);return s[0]=e&255,s[1]=r>>>24&255,s[2]=r>>>16&255,s[3]=r>>>8&255,s[4]=r&255,r&&s.set(n,5),s}function Aa(){let e=ko;return{push(t){if(t&&t.length){let r=new Uint8Array(e.length+t.length);r.set(e,0),r.set(t,e.length),e=r}let n=[];for(;e.length>=5;){let r=e[0],s=(e[1]<<24|e[2]<<16|e[3]<<8|e[4])>>>0;if(e.length<5+s)break;let o=e.slice(5,5+s);n.push({type:r,payload:o}),e=e.slice(5+s)}return n}}}var va=Symbol.for("webjs.context");function Ca(e){return{__context__:va,name:e}}var Et=class extends Event{constructor(t,n,r=!1){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.callback=n,this.subscribe=r}},Mn=class{constructor(t,{context:n,initialValue:r}){this._host=t,this._context=n,this._value=r,this._subscriptions=new Set,this._onRequest=s=>{let o=s;if(o.context===this._context)if(s.stopPropagation(),o.subscribe){let i={callback:o.callback},a=()=>{this._subscriptions.delete(i)};this._subscriptions.add(i),o.callback(this._value,a)}else o.callback(this._value)},typeof t.addController=="function"&&t.addController(this)}get value(){return this._value}setValue(t){if(!Object.is(this._value,t)){this._value=t;for(let n of this._subscriptions){let r=()=>{this._subscriptions.delete(n)};n.callback(t,r)}}}hostConnected(){this._host.addEventListener("context-request",this._onRequest)}hostDisconnected(){this._host.removeEventListener("context-request",this._onRequest),this._subscriptions.clear()}},Fn=class{constructor(t,{context:n,subscribe:r=!0}){this._host=t,this._context=n,this._subscribe=r,this._value=void 0,this._unsubscribe=void 0,typeof t.addController=="function"&&t.addController(this)}get value(){return this._value}hostConnected(){this._dispatchRequest()}hostDisconnected(){this._unsubscribe&&(this._unsubscribe(),this._unsubscribe=void 0)}_dispatchRequest(){let t=new Et(this._context,(n,r)=>{let s=this._value;this._value=n,r&&(this._unsubscribe=r),!Object.is(s,n)&&typeof this._host.requestUpdate=="function"&&this._host.requestUpdate()},this._subscribe);this._host.dispatchEvent(t)}};function Ea(){return typeof window<"u"}var F={INITIAL:0,PENDING:1,COMPLETE:2,ERROR:3},Un=class{constructor(t,{task:n,args:r,autoRun:s=!0}){this._host=t,this._taskFn=n,this._argsFn=r||(()=>[]),this._autoRun=s,this._status=F.INITIAL,this._value=void 0,this._error=void 0,this._abortController=null,this._prevArgs=null,typeof t.addController=="function"&&t.addController(this)}get status(){return this._status}get value(){return this._value}get error(){return this._error}async run(){this.abort();let t=new AbortController;this._abortController=t;let n=this._argsFn();this._prevArgs=n,this._status=F.PENDING,this._error=void 0,this._requestHostUpdate();try{let r=await this._taskFn(...n,{signal:t.signal});if(t.signal.aborted)return;this._value=r,this._status=F.COMPLETE,this._error=void 0}catch(r){if(t.signal.aborted)return;this._error=r,this._status=F.ERROR,this._value=void 0}finally{this._abortController===t&&(this._abortController=null)}this._requestHostUpdate()}abort(){this._abortController&&(this._abortController.abort(),this._abortController=null)}render(t={}){switch(this._status){case F.INITIAL:return t.initial?.();case F.PENDING:return t.pending?.();case F.COMPLETE:return t.complete?.(this._value);case F.ERROR:return t.error?.(this._error);default:return}}hostUpdate(){if(!this._autoRun||!Ea())return;let t=this._argsFn();this._argsEqual(this._prevArgs,t)||this.run()}hostUpdated(){}hostConnected(){}hostDisconnected(){this.abort()}_requestHostUpdate(){typeof this._host.requestUpdate=="function"&&this._host.requestUpdate()}_argsEqual(t,n){if(t===null||t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==n[r])return!1;return!0}};export{Fn as ContextConsumer,Mn as ContextProvider,Et as ContextRequestEvent,ga as FRAME_CHUNK,_a as FRAME_END,wa as FRAME_ERROR,_ as MARKER,Br as SEED_MISS,ya as STREAM_CONTENT_TYPE,Ae as Signal,mi as Suspense,Un as Task,F as TaskStatus,st as WebComponent,cn as WebjsFrame,un as WebjsStream,Fs as activeActionSignal,xt as adoptStyles,Hs as allTags,zo as asyncAppend,Wo as asyncReplace,ns as batch,qo as cache,os as computed,yi as connectWS,ma as consumeStale,Ca as createContext,Aa as createFrameDecoder,Ho as createRef,pi as cspNonce,Lo as css,_r as deserialize,zr as disableClientRouter,is as effect,vn as enableClientRouter,Sa as encodeFrame,Io as escapeAttr,Po as escapeText,ha as fetchMark,ai as forbidden,Bo as guard,Ro as html,Ot as isAsyncAppend,Pt as isAsyncReplace,kt as isCSS,De as isCache,di as isForbidden,Ue as isGuard,Fe as isKeyed,$s as isLazy,Rt as isLive,ui as isNotFound,fi as isRedirect,Be as isRef,Me as isRepeat,ss as isSignal,bi as isSuspense,T as isTemplate,Lt as isTemplateContent,hi as isUnauthorized,jt as isUnsafeHTML,$e as isUntil,He as isWatch,Uo as keyed,Fo as live,Bs as lookup,Ds as lookupModuleUrl,da as markStale,Wr as navigate,ii as notFound,ua as optimistic,G as parse,ba as parseTagHeader,Us as primeModuleUrl,si as prop,li as redirect,$o as ref,nn as register,pa as registerKeyTags,ce as render,fn as renderStream,Hn as repeat,Kr as revalidate,_i as richFetch,lt as scanSeeds,gr as serialize,et as setActiveActionSignal,rs as signal,rn as stringify,Oo as stylesToString,rt as tagOf,Ti as takeSeed,Do as templateContent,ci as unauthorized,Mo as unsafeHTML,Vo as until,Ko as watch};
1
+ var ms=Object.defineProperty;var G=(e,t)=>()=>(e&&(t=e(e=0)),t);var pr=(e,t)=>{for(var n in t)ms(e,n,{get:t[n],enumerable:!0})};function Tr(){return typeof HTMLElement<"u"&&typeof HTMLSlotElement<"u"}function Ys(){if(Ar||(X=Tr(),!X))return;Pe=HTMLSlotElement.prototype.assignedNodes,pn=HTMLSlotElement.prototype.assignedElements,lt=Object.getOwnPropertyDescriptor(Element.prototype,"assignedSlot"),HTMLSlotElement.prototype.assignedNodes=function(n){return this.hasAttribute(E)&&!mn(this)?wn(this,n):Pe?Pe.call(this,n):[]},HTMLSlotElement.prototype.assignedElements=function(n){return this.hasAttribute(E)&&!mn(this)?wn(this,n).filter(r=>r.nodeType===1):pn?pn.call(this,n):[]},Object.defineProperty(Element.prototype,"assignedSlot",{configurable:!0,enumerable:!0,get:function(){let n=lt&&lt.get?lt.get.call(this):null;return n||Er(this)}});let e=Object.getOwnPropertyDescriptor(Text.prototype,"assignedSlot");Object.defineProperty(Text.prototype,"assignedSlot",{configurable:!0,enumerable:!0,get:function(){let n=e&&e.get?e.get.call(this):null;return n||Er(this)}}),hn=HTMLSlotElement.prototype.assign,HTMLSlotElement.prototype.assign=function(...n){if(this.hasAttribute(E)&&!mn(this)){let r=Js(this);if(r){let o=V(r);o.manualAssign||(o.manualAssign=new Map);let s=n.filter(Boolean);for(let[i,a]of o.manualAssign){if(i===this)continue;let c=a.filter(l=>{let u=l.deref();return u!==void 0&&s.indexOf(u)===-1});c.length!==a.length&&(c.length?o.manualAssign.set(i,c):o.manualAssign.delete(i))}if(s.length?o.manualAssign.set(this,s.map(i=>new WeakRef(i))):o.manualAssign.delete(this),o.applying&&o.pendingRecordNodes)for(let i of s)o.pendingRecordNodes.add(i);else o.pendingRecordNodes=new Set(s);ge(o),z(r)}return}return hn?hn.apply(this,n):void 0},Ar=!0}function Cn(e,t){let n=e.manualAssign;if(!n||!n.size)return null;for(let[r,o]of n){let s=!1,i=o.filter(a=>{let c=a.deref();return c===void 0?!1:(c===t&&(s=!0),!0)});if(i.length!==o.length&&(i.length?n.set(r,i):n.delete(r)),s){let a=e.host;return a&&(r===a||a.contains(r))?r:null}}return null}function Js(e){for(let t=e.parentElement;t;t=t.parentElement)if(t[S])return W(t,e)?t:null;return null}function mn(e){let t=e;for(let n=0;n<128;n++){let r=t.parentNode;if(!r||r===t)return!1;if(r.nodeType===11&&r.host)return!0;t=r}return!1}function wn(e,t){if(e.getAttribute(L)!==D)return[];let n=Array.from(e.childNodes);return!t||!t.flatten?n:Sn(n,new Set,0)}function Sn(e,t,n){if(n>=Gs)return e.slice();let r=[];for(let o of e)if(o.nodeType===1&&o.tagName==="SLOT"){let s=o;if(t.has(s))continue;if(t.add(s),s.hasAttribute(E)){let i=wn(s,{flatten:!1});if(i.length>0)for(let a of Sn(i,t,n+1))r.push(a);else for(let a of Sn(Array.from(s.childNodes),t,n+1))r.push(a)}else if(Pe){let i=Pe.call(s,{flatten:!0});for(let a of i)r.push(a)}else r.push(o)}else r.push(o);return r}function Er(e){let t=e.parentElement;return t&&t.tagName==="SLOT"&&t.hasAttribute(E)&&t.getAttribute(L)===D?t:null}function V(e){let t=e,n=t[S];return n||(n={host:e,authored:[],assignedByName:new Map,lastSnapshot:new WeakMap},t[S]=n),n}function Tn(e){return!!e[S]}function Nr(e){let t=V(e);for(;e.firstChild;){let n=e.firstChild;t.authored.push(n),g.add(n),e.removeChild(n)}ge(t)}function ge(e){let t=e.assignedByName;t.clear();for(let n of e.authored)Xs(t,re(e,n),n)}function re(e,t){let n=Cn(e,t);if(n)return F(n.getAttribute("name"));if(e.adoptedKey){let r=e.adoptedKey.get(t);if(r!==void 0)return r}return kr(t)}function xr(e){let t=V(e);t.adopted=!0;let n=new Set,r=e.querySelectorAll(`slot[${E}]`);for(let o of r){let s=o;if(!W(e,s)||s.getAttribute(L)!==D||mt(t,e,s))continue;let i=F(s.getAttribute("name"));if(!n.has(i)){n.add(i);let a=Array.from(s.childNodes);for(let c of a)t.authored.push(c),kr(c)!==i&&(t.adoptedKey||(t.adoptedKey=new WeakMap),t.adoptedKey.set(c,i));t.lastSnapshot.set(s,a.slice())}}for(let o of e.querySelectorAll("wj-slot-park"))if(W(e,o)){for(let s of Array.from(o.childNodes))g.add(s),t.authored.push(s);o.remove()}ge(t)}function F(e){return e==null||e===""||e==="default"?null:e}function kr(e){return e.nodeType!==1?null:F(e.getAttribute("slot"))}function Xs(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}function ie(e,t,n){let r=V(e),o=F(t),s=Array.isArray(n)?n.filter(Boolean):n?[n]:[],i=r.authored.findIndex(c=>re(r,c)===o),a=r.authored.filter(c=>re(r,c)===o);r.authored=r.authored.filter(c=>re(r,c)!==o),(i===-1||i>r.authored.length)&&(i=r.authored.length);for(let c of s)c.nodeType===1&&!Cn(r,c)&&(o==null?c.removeAttribute("slot"):c.setAttribute("slot",o)),g.add(c);if(r.authored.splice(i,0,...s),r.applying&&r.pendingRecordNodes){for(let c of a)r.pendingRecordNodes.add(c);for(let c of s)r.pendingRecordNodes.add(c)}else r.pendingRecordNodes=new Set([...a,...s]);if(r.adoptedKey){for(let c of a)r.adoptedKey.delete(c);for(let c of s)r.adoptedKey.delete(c)}ge(r),z(e)}function Qs(){J||!X||(J=Node.prototype.appendChild,jr=Node.prototype.insertBefore,be=Node.prototype.removeChild,An=Node.prototype.replaceChild,Rr=Element.prototype.append,Or=Element.prototype.prepend,Lr=Element.prototype.replaceChildren,ut=Object.getOwnPropertyDescriptor(Element.prototype,"innerHTML"),En=Object.getOwnPropertyDescriptor(Node.prototype,"textContent"))}function pt(e,t){let n=e[x];e[x]=!0;try{return t()}finally{e[x]=n,n||Nn(e)}}function Mr(e){if(!X)return;let t=e,n=V(e);n.backstop||(n.backstop=new MutationObserver(r=>ht(e,n,r)),n.backstop.observe(e,{childList:!0,subtree:!1}),n.flipSensor=new MutationObserver(r=>Ir(e,r)),n.flipSensor.observe(e,{attributes:!0,attributeFilter:["slot","name"],subtree:!0}))}function ht(e,t,n){let r=e,o=r[se],s=r[Symbol.for("webjs.instance")],i=!1,a=new Set;for(let c of n){for(let l of c.addedNodes)if(a.add(l),l!==o&&!(s&&Dr(s,l))){if(t.authored.indexOf(l)!==-1){i=!0;continue}g.add(l),t.authored.push(l),i=!0}for(let l of c.removedNodes){let u=t.authored.indexOf(l);if(u===-1||e.contains(l))continue;g.has(l)&&l.parentNode==null&&!a.has(l)||(t.authored.splice(u,1),i=!0)}}i&&z(e)}function Nn(e){let t=e,n=t[S];if(!(n&&n.backstop))return;let r=n.backstop.takeRecords();(!(Symbol.for("webjs.instance")in t)||t[Symbol.for("webjs.instance")])&&ht(e,n,r)}function Ir(e,t){let n=e[S];if(!n)return;let r=!1;for(let o of t){if(o.type!=="attributes")continue;let s=o.target;o.attributeName==="name"?s.tagName==="SLOT"&&s.hasAttribute(E)&&W(e,s)&&(r=!0):o.attributeName==="slot"&&(n.adoptedKey&&n.adoptedKey.delete(s),n.authored.indexOf(s)!==-1&&(r=!0))}r&&z(e)}function Pr(e){let t=e[S];t&&(t.backstop&&(ht(e,t,t.backstop.takeRecords()),t.backstop.disconnect(),t.backstop=void 0),t.flipSensor&&(Ir(e,t.flipSensor.takeRecords()),t.flipSensor.disconnect(),t.flipSensor=void 0))}function Fr(e){if(!X)return;let t=e,n=t[S];if(!n)return;let r=t[Symbol.for("webjs.instance")],o=Symbol.for("webjs.instance")in t,s=!o&&n.adopted===!0,i=!1;for(let a of Array.from(e.childNodes))if(a!==t[se]){if(n.authored.indexOf(a)!==-1){i=!0;continue}o&&(!r||Dr(r,a))||!o&&s||(g.add(a),n.authored.push(a),i=!0)}i&&z(e)}function Dr(e,t){if(!e||!e.startNode||!e.endNode)return!1;if(t===e.startNode||t===e.endNode)return!0;for(let n=e.startNode.nextSibling;n&&n!==e.endNode;n=n.nextSibling)if(n===t)return!0;return!1}function Zs(e){let t=e,n=t[se];return(!n||!n.isConnected)&&(n||(n=e.ownerDocument.createElement("wj-slot-park"),n.setAttribute("hidden",""),n.style.display="none",t[se]=n),pt(e,()=>J.call(e,n))),n}function oe(e){return e instanceof Node||!!(e&&typeof e=="object"&&e.ownerDocument&&e.ownerDocument.defaultView&&e instanceof e.ownerDocument.defaultView.Node)}function yn(e,t,n){if(n&&!oe(t))return[e.ownerDocument.createTextNode(`${t}`)];if(!oe(t))throw new TypeError("Failed to execute insertion on the host: parameter is not of type Node.");if(t&&t.nodeType===11){let r=Array.from(t.childNodes);ft(e,r);for(let o of r)be.call(t,o);return r}return ft(e,[t]),[t]}function ft(e,t){ye(e,t);for(let n of t){if(!oe(n))throw new TypeError("Failed to execute insertion on the host: parameter is not of type Node.");let r=n.nodeType;if(r!==1&&r!==3&&r!==4&&r!==7&&r!==8&&r!==11)throw new DOMException("Failed to execute insertion on the host: the node type may not be inserted here.","HierarchyRequestError")}}function ye(e,t){for(let n of t)if(n===e||n.nodeType===1&&n.contains(e))throw new DOMException("Failed to execute insertion on the host: the new child contains the parent.","HierarchyRequestError")}function bn(e,t,n){let r=e.authored;for(let s of t){let i=r.indexOf(s);i!==-1&&r.splice(i,1)}let o=n==null?r.length:r.indexOf(n);o===-1&&(o=r.length),r.splice(o,0,...t)}function Br(e,t){let n=e[S];return n?mt(n,e,t):!1}function mt(e,t,n){for(let r=n;r&&r!==t;r=r.parentNode)if(e.authored.indexOf(r)!==-1)return!0;return!1}function gn(e,t){if(g.has(t))return!0;let n=t.parentNode;if(n==null)return!1;if(n===e||n===e[se])return!0;let r=e[S];return n.nodeType===1&&n.tagName==="SLOT"&&n.hasAttribute(E)&&(r&&r.lastSnapshot.has(n)||e.contains(n)&&W(e,n))}function _n(e,t){let n=[];for(let s of t)oe(s)?s.nodeType===11?n.push({frag:s}):n.push({node:s}):n.push({text:`${s}`});for(let s of n)s.frag?ye(e,Array.from(s.frag.childNodes)):s.node&&ft(e,[s.node]);let r=e.ownerDocument.createDocumentFragment();for(let s of n)if(s.text!==void 0)J.call(r,e.ownerDocument.createTextNode(s.text));else if(s.frag){let i=Array.from(s.frag.childNodes);ft(e,i);for(let a of i)J.call(r,a)}else s.node&&(ye(e,[s.node]),J.call(r,s.node));let o=Array.from(r.childNodes);ye(e,o);for(let s of o)be.call(r,s);return o}function q(e,t,n){if(t.applying&&t.pendingRecordNodes)for(let r of n||[])t.pendingRecordNodes.add(r);else t.pendingRecordNodes=new Set(n||[]);if(t.adoptedKey&&n)for(let r of n)t.adoptedKey.delete(r);ge(t),z(e)}function Ur(e){if(!X)return;let t=e;if(t[vr])return;Qs(),t[vr]=!0;let n=V(e);t.appendChild=function(r){if(t[x])return J.call(this,r);let o=yn(e,r,!1);for(let s of o)g.add(s);return bn(n,o,null),q(e,n,o),r},t.insertBefore=function(r,o){if(t[x])return jr.call(this,r,o);if(!oe(r))throw new TypeError("Failed to execute insertBefore on the host: parameter 1 is not of type Node.");if(o!=null&&!oe(o))throw new TypeError("Failed to execute insertBefore on the host: parameter 2 is not of type Node.");if(ye(e,r.nodeType===11?Array.from(r.childNodes):[r]),o!=null&&(n.authored.indexOf(o)===-1||!gn(e,o)))throw new DOMException("insertBefore: reference node is not an assigned child of this host","NotFoundError");if(r===o)return r;let s=yn(e,r,!1);for(let i of s)g.add(i);return bn(n,s,o||null),q(e,n,s),r},t.removeChild=function(r){if(t[x])return be.call(this,r);let o=n.authored.indexOf(r);if(o===-1)return be.call(this,r);if(!gn(e,r))throw new DOMException("removeChild: the node is not an assigned child of this host","NotFoundError");return n.authored.splice(o,1),q(e,n,[r]),r},t.replaceChild=function(r,o){if(t[x])return An.call(this,r,o);if(n.authored.indexOf(o)===-1)return An.call(this,r,o);if(!oe(r))throw new TypeError("Failed to execute replaceChild on the host: parameter 1 is not of type Node.");if(ye(e,r.nodeType===11?Array.from(r.childNodes):[r]),!gn(e,o))throw new DOMException("replaceChild: the node to be replaced is not an assigned child of this host","NotFoundError");if(r===o)return o;let i=yn(e,r,!1);for(let c of i)g.add(c);for(let c of i){if(c===o)continue;let l=n.authored.indexOf(c);l!==-1&&n.authored.splice(l,1)}let a=n.authored.indexOf(o);return n.authored.splice(a,1,...i),q(e,n,[...i,o]),o},t.append=function(...r){if(t[x])return Rr.apply(this,r);let o=_n(e,r);for(let s of o)g.add(s);bn(n,o,null),q(e,n,o)},t.prepend=function(...r){if(t[x])return Or.apply(this,r);let o=_n(e,r);for(let s of o)g.add(s);for(let s of o){let i=n.authored.indexOf(s);i!==-1&&n.authored.splice(i,1)}n.authored.unshift(...o),q(e,n,o)},t.replaceChildren=function(...r){if(t[x])return Lr.apply(this,r);let o=_n(e,r);for(let i of o)g.add(i);let s=n.authored;n.authored=o.slice(),q(e,n,[...s,...o])},Object.defineProperty(t,"innerHTML",{configurable:!0,get(){return ut.get.call(this)},set(r){if(t[x]){ut.set.call(this,r);return}let o=e.ownerDocument.createElement("div");ut.set.call(o,r===null?"":`${r}`);let s=Array.from(o.childNodes);for(let a of s)g.add(a);let i=n.authored;n.authored=s,q(e,n,[...i,...s])}}),Object.defineProperty(t,"textContent",{configurable:!0,get(){return En.get.call(this)},set(r){if(t[x]){En.set.call(this,r);return}let o=r==null||r===""?[]:[e.ownerDocument.createTextNode(`${r}`)];for(let i of o)g.add(i);let s=n.authored;n.authored=o,q(e,n,[...s,...o])}})}function z(e){if(!X)return;let t=e[S];if(t){if(t.applying){t.reapply=!0;return}t.applying=!0;try{do{t.reapply=!1;let n=t.pendingRecordNodes||ei;t.pendingRecordNodes=void 0,ti(e,t,n),ni(e,t),ge(t);let r=[],o=new Set;for(let u of e.querySelectorAll(`slot[${E}]`))if(W(e,u)&&!mt(t,e,u)){if(!u.hasAttribute(L)&&!(Fe in u)){o.add(F(u.getAttribute("name")));continue}r.push(u)}let s=new Map;for(let u of r){let f=F(u.getAttribute("name")),d=s.get(f);d||(d=[],s.set(f,d)),d.push(u)}let i=[];for(let[u,f]of s){let d=t.assignedByName.get(u)||[];for(let h=0;h<f.length;h++){let m=f[h],w=d.filter(p=>{let j=Cn(t,p);return j?j===m:h===0}),y=w.filter(p=>p===e||p.nodeType===1&&p.contains(e));if(y.length){for(let p of y)g.delete(p);w=w.filter(p=>y.indexOf(p)===-1)}w.length>0?oi(t,m,w)&&i.push(m):si(t,m)&&i.push(m)}}for(let u of i)ai(t,u);let a=new Set(s.keys());for(let u of o)a.add(u);let c=new Set;for(let u of t.authored)a.has(re(t,u))||c.add(u);let l=e[se];if(l)for(let u of Array.from(l.childNodes))c.has(u)||be.call(l,u);if(c.size){let u=Zs(e);for(let f of c)f.parentNode!==u&&(g.delete(f),pt(e,()=>J.call(u,f)))}if(t.backstop){let u=t.backstop.takeRecords();u.length&&ht(e,t,u)}}while(t.reapply)}finally{t.applying=!1}}}function ti(e,t,n){for(let r of e.querySelectorAll(`slot[${E}][${L}="${D}"]`)){if(!W(e,r)||mt(t,e,r))continue;let o=r,s=t.lastSnapshot.get(o);if(!s)continue;let i=Array.from(o.childNodes);if(vn(i,s))continue;let a=t.authored,c=F(o.getAttribute("name")),l=i.filter(m=>!n.has(m));for(let m of l)a.indexOf(m)===-1&&re(t,m)!==c&&(t.adoptedKey||(t.adoptedKey=new WeakMap),t.adoptedKey.set(m,c));for(let m of a){if(l.indexOf(m)!==-1||re(t,m)!==c)continue;let w=a.indexOf(m),y=0;for(let p=0;p<l.length;p++){let j=a.indexOf(l[p]);j!==-1&&j<w&&(y=p+1)}l.splice(y,0,m)}let u=new Set(l);for(let m of s)u.add(m);let f=-1,d=0;for(let m of a){if(u.has(m)){f===-1&&(f=d);continue}d+=1}let h=a.filter(m=>!u.has(m));(f===-1||f>h.length)&&(f=h.length),h.splice(f,0,...l),t.authored=h}}function ni(e,t){let n=e[se];t.authored=t.authored.filter(r=>{if(g.has(r))return!0;let o=r.parentNode;return o==null?!1:!!(o===e||o===n||o.nodeType===1&&o.tagName==="SLOT"&&o.hasAttribute(E)&&(t.lastSnapshot.has(o)||e.contains(o)&&W(e,o)))})}function $r(e){if(!X)return!1;for(let t of e.querySelectorAll(`slot[${E}][${L}]`))if(W(e,t))return!0;return!1}function W(e,t){let n=t[dt];if(n)return n===e;let r=typeof t.getAttribute=="function"?t.getAttribute(Ks):null;if(r){let o=ri(t,r);if(o)return o===e}for(let o=t.parentElement;o&&o!==e;o=o.parentElement)if(o.tagName.includes("-"))return!1;return!0}function ri(e,t){let n=t.toLowerCase();for(let r=e.parentElement;r;r=r.parentElement)if(r.tagName.toLowerCase()===n)return r;return null}function oi(e,t,n){for(let l of n)g.delete(l);let r=t.getAttribute(L)!==D,o=e.lastSnapshot.get(t)||[],s=r||!vn(o,n);if(!r&&vn(Array.from(t.childNodes),n))return e.lastSnapshot.set(t,n.slice()),s;let i=t[Fe];if(r&&i)for(;t.firstChild;)i.appendChild(t.firstChild);let a=new Set(n);for(let l of Array.from(t.childNodes))a.has(l)||t.removeChild(l);let c=t.firstChild;for(let l of n){if(l===c){c=c.nextSibling;continue}t.insertBefore(l,c)}return t.setAttribute(L,D),e.lastSnapshot.set(t,n.slice()),s}function si(e,t){let n=t.getAttribute(L)===D;if(t.setAttribute(L,zs),!n)return Cr(t),!1;for(e.lastSnapshot.delete(t);t.firstChild;)t.removeChild(t.firstChild);return Cr(t),!0}function Cr(e){let t=e[Fe];!t||t.childNodes.length===0||e.appendChild(t)}function Hr(e,t){if(!Tn(e))return;let n=V(e),r=F(t.getAttribute("name")),o=n.assignedByName.get(r);if(o)for(let s of o)s.parentNode===t&&(g.add(s),t.removeChild(s));n.lastSnapshot.delete(t)}function ii(e){e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1}))}function ai(e,t){e.pendingSlotChanges||(e.pendingSlotChanges=new Set),e.pendingSlotChanges.add(t),!e.slotChangeScheduled&&(e.slotChangeScheduled=!0,queueMicrotask(()=>{e.slotChangeScheduled=!1;let n=e.pendingSlotChanges||new Set;e.pendingSlotChanges=new Set;for(let r of n)ii(r)}))}function vn(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}var X,S,E,L,D,zs,Fe,dt,Ks,Gs,Pe,pn,lt,hn,Ar,x,vr,se,g,J,jr,be,An,Rr,Or,Lr,ut,En,ei,yt=G(()=>{X=Tr(),S=Symbol("webjs.slot.state"),E="data-webjs-light",L="data-projection",D="actual",zs="fallback",Fe=Symbol("webjs.slot.fallbackFrag"),dt=Symbol("webjs.slot.templateOwner"),Ks="data-wj-slot-owner",Gs=64,Pe=null,pn=null,lt=null,hn=null,Ar=!1;Ys();x=Symbol("webjs.slot.rendering"),vr=Symbol("webjs.slot.intercepted"),se=Symbol("webjs.slot.park"),g=new WeakSet,J=null,jr=null,be=null,An=null,Rr=null,Or=null,Lr=null,ut=null,En=null;ei=new Set});function ro(e,t,n){Ii.has(t)?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}async function On(e){return JSON.stringify(await oo(e))}function ce(e){return so(JSON.parse(e))}async function oo(e){let t=Pi();return await Fi(e,t),ae(e,t)}function so(e){return Z(e,$i())}function Pi(){return{refCount:new Map,idOf:new Map,emitted:new Set,nextId:0,blobBytes:new Map,fdEntries:new Map}}async function Fi(e,t){let n=[e];for(;n.length;){let r=n.pop();if(!qi(r))continue;let o=t.refCount.get(r)||0;if(t.refCount.set(r,o+1),!(o>0)){if(typeof Blob<"u"&&r instanceof Blob){let s=new Uint8Array(await r.arrayBuffer());t.blobBytes.set(r,s);continue}if(typeof FormData<"u"&&r instanceof FormData){let s=t.fdEntries.get(r)||[...r.entries()];t.fdEntries.set(r,s);for(let[,i]of s)typeof i!="string"&&n.push(i);continue}if(Array.isArray(r))for(let s=0;s<r.length;s++)n.push(r[s]);else if(r instanceof Map)for(let[s,i]of r)n.push(s),n.push(i);else if(r instanceof Set)for(let s of r)n.push(s);else if(Wi(r))for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&n.push(r[s])}}for(let[r,o]of t.refCount)o>1&&t.idOf.set(r,t.nextId++)}function ae(e,t){if(e===null)return null;if(e===void 0)return{[_]:"undef"};let n=typeof e;if(n==="string"||n==="boolean")return e;if(n==="number")return Number.isNaN(e)?{[_]:"NaN"}:e===1/0?{[_]:"Inf"}:e===-1/0?{[_]:"-Inf"}:Object.is(e,-0)?{[_]:"-0"}:e;if(n==="bigint")return{[_]:"BigInt",v:e.toString()};if(n==="symbol"){let s=Symbol.keyFor(e);if(s===void 0)throw new TypeError("Cannot serialize a local Symbol; only Symbol.for() registered symbols are supported.");return{[_]:"Sym",v:s}}if(n==="function")throw new TypeError("Cannot serialize a function.");let r=t.idOf.get(e);if(r!==void 0&&t.emitted.has(r))return{[_]:"Ref",v:r};r!==void 0&&t.emitted.add(r);let o;if(e instanceof Date)o={[_]:"Date",v:Number.isNaN(e.getTime())?null:e.toISOString()};else if(e instanceof Error)o={[_]:"Error",v:{name:e.name,message:e.message,stack:e.stack||null}};else if(typeof Blob<"u"&&e instanceof Blob){let s=t.blobBytes.get(e);typeof File<"u"&&e instanceof File?o={[_]:"File",v:$e(s),n:e.name,t:e.type||"",m:e.lastModified}:o={[_]:"Blob",v:$e(s),t:e.type||""}}else if(typeof FormData<"u"&&e instanceof FormData){let s=t.fdEntries.get(e)||[...e.entries()],i=[];for(let[a,c]of s)i.push([a,ae(c,t)]);o={[_]:"FD",v:i}}else if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)o=Di(e);else if(e instanceof Map){let s=[];for(let[i,a]of e)s.push([ae(i,t),ae(a,t)]);o={[_]:"Map",v:s}}else if(e instanceof Set){let s=[];for(let i of e)s.push(ae(i,t));o={[_]:"Set",v:s}}else if(Array.isArray(e))o=e.map(s=>ae(s,t));else{o={};for(let s in e){if(!Object.prototype.hasOwnProperty.call(e,s))continue;let i=Vi(s)?"_"+s:s;ro(o,i,ae(e[s],t))}}if(r!==void 0){if(Array.isArray(o))return{[_]:"Arr",_id:r,v:o};o._id=r}return o}function Di(e){if(e instanceof ArrayBuffer)return{[_]:"buf",v:$e(new Uint8Array(e))};if(e instanceof DataView)return{[_]:"dv",v:$e(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))};let t=e.constructor.name,n=Bi[t];if(!n)throw new TypeError(`Unsupported typed array: ${t}`);let r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return{[_]:n,v:$e(r)}}function $i(){return{refs:new Map}}function Z(e,t){if(e===null||typeof e!="object")return e;if(Array.isArray(e)){let s=[];for(let i=0;i<e.length;i++)s.push(Z(e[i],t));return s}let n=e[_];if(typeof n=="string")return Hi(e,n,t);let r={},o=e._id;typeof o=="number"&&t.refs.set(o,r);for(let s in e){if(!Object.prototype.hasOwnProperty.call(e,s)||s==="_id")continue;let i=zi(s)?s.slice(1):s;ro(r,i,Z(e[s],t))}return r}function Hi(e,t,n){let r=e._id,o=s=>(typeof r=="number"&&n.refs.set(r,s),s);switch(t){case"undef":return;case"NaN":return NaN;case"Inf":return 1/0;case"-Inf":return-1/0;case"-0":return-0;case"BigInt":return o(BigInt(e.v));case"Sym":return o(Symbol.for(e.v));case"Date":return o(e.v==null?new Date(NaN):new Date(e.v));case"Error":{let s=new Error(e.v.message);return s.name=e.v.name,e.v.stack&&(s.stack=e.v.stack),typeof r=="number"&&n.refs.set(r,s),s}case"Map":{let s=new Map;typeof r=="number"&&n.refs.set(r,s);for(let[i,a]of e.v)s.set(Z(i,n),Z(a,n));return s}case"Set":{let s=new Set;typeof r=="number"&&n.refs.set(r,s);for(let i of e.v)s.add(Z(i,n));return s}case"Arr":{let s=[];typeof r=="number"&&n.refs.set(r,s);for(let i of e.v)s.push(Z(i,n));return s}case"Ref":{let s=n.refs.get(e.v);if(s===void 0)throw new TypeError(`Dangling reference: id=${e.v}`);return s}case"Blob":{if(typeof Blob>"u")throw new TypeError("Blob is not available in this environment.");let s=Ue(e.v);return o(new Blob([s],{type:e.t||""}))}case"File":{if(typeof File>"u")throw new TypeError("File is not available in this environment.");let s=Ue(e.v);return o(new File([s],e.n,{type:e.t||"",lastModified:e.m}))}case"FD":{if(typeof FormData>"u")throw new TypeError("FormData is not available in this environment.");let s=new FormData;o(s);for(let[i,a]of e.v){let c=Z(a,n);s.append(i,c)}return s}default:{if(t==="buf"){let i=Ue(e.v);return o(i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength))}if(t==="dv"){let i=Ue(e.v);return o(new DataView(i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength)))}let s=Ui[t];if(s){let i=Ue(e.v),a=i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength);return o(new s(a))}throw new TypeError(`Unknown serialization tag: ${t}`)}}}function qi(e){return e!==null&&typeof e=="object"}function Wi(e){if(e===null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Vi(e){return/^_+\$wj$/.test(e)||/^_+id$/.test(e)}function zi(e){return/^__+\$wj$/.test(e)||/^__+id$/.test(e)}function $e(e){if(io)return Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("base64");let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function Ue(e){if(io){let r=Buffer.from(e,"base64");return new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}let t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}var _,Ii,Bi,Ui,io,He=G(()=>{_="_$wj",Ii=new Set(["__proto__","constructor","prototype"]);Bi={Int8Array:"i8",Uint8Array:"u8",Uint8ClampedArray:"u8c",Int16Array:"i16",Uint16Array:"u16",Int32Array:"i32",Uint32Array:"u32",Float32Array:"f32",Float64Array:"f64",BigInt64Array:"bi64",BigUint64Array:"bu64"},Ui={i8:Int8Array,u8:Uint8Array,u8c:Uint8ClampedArray,i16:Int16Array,u16:Uint16Array,i32:Int32Array,u32:Uint32Array,f32:Float32Array,f64:Float64Array,bi64:typeof BigInt64Array<"u"?BigInt64Array:null,bu64:typeof BigUint64Array<"u"?BigUint64Array:null};io=typeof Buffer<"u"&&typeof Buffer.from=="function"});var _o={};pr(_o,{observeLazy:()=>da,observeViewportOnce:()=>ma});function go(e){let t=In.get(e);return t||(t=import(e).finally(()=>In.delete(e)),In.set(e,t),t)}function da(e){for(let[t,n]of Object.entries(e))le.set(t.toLowerCase(),n);if(typeof IntersectionObserver>"u"){for(let t of le.values())go(t);le.clear();return}We||(We=new IntersectionObserver(pa,{rootMargin:"200px"})),bo(),typeof MutationObserver<"u"&&new MutationObserver(()=>bo()).observe(document.body,{childList:!0,subtree:!0})}function bo(){if(!(!We||!le.size))for(let e of le.keys())for(let t of document.querySelectorAll(e))We.observe(t)}function pa(e){for(let t of e){if(!t.isIntersecting)continue;let n=t.target.tagName.toLowerCase(),r=le.get(n);r&&(go(r),le.delete(n),We?.unobserve(t.target))}}function ha(e){for(let t of e){if(!t.isIntersecting)continue;let n=Nt.get(t.target);Nt.delete(t.target),qe?.unobserve(t.target),n&&n()}}function ma(e,t){return typeof IntersectionObserver>"u"?(t(),()=>{}):(qe||(qe=new IntersectionObserver(ha,{rootMargin:"200px"})),Nt.set(e,t),qe.observe(e),()=>{Nt.delete(e),qe?.unobserve(e)})}var le,We,In,qe,Nt,wo=G(()=>{le=new Map,We=null,In=new Map;qe=null,Nt=new WeakMap});var Pn,Fn=G(()=>{Pn=typeof HTMLElement<"u"?class extends HTMLElement{constructor(){super(),this._webjsLoadedSrc=null,this._webjsLazyTeardown=null}static get observedAttributes(){return["src"]}connectedCallback(){this._webjsScheduleLoad()}disconnectedCallback(){this._webjsLazyTeardown&&(this._webjsLazyTeardown(),this._webjsLazyTeardown=null)}attributeChangedCallback(t,n,r){t==="src"&&this.isConnected&&this._webjsScheduleLoad()}_webjsScheduleLoad(){let t=this.getAttribute("src");if(!t){this._webjsLazyTeardown&&(this._webjsLazyTeardown(),this._webjsLazyTeardown=null),this._webjsLoadedSrc=null;return}let n=t;try{n=new URL(t,location.href).href}catch{}if(n===this._webjsLoadedSrc)return;this._webjsLazyTeardown&&(this._webjsLazyTeardown(),this._webjsLazyTeardown=null),(this.getAttribute("loading")||"eager").toLowerCase()==="lazy"?(this._webjsLoadedSrc=n,Promise.resolve().then(()=>(wo(),_o)).then(({observeViewportOnce:o})=>{this._webjsLoadedSrc!==n||!this.isConnected||(this._webjsLazyTeardown=o(this,()=>{this._webjsLazyTeardown=null,this._webjsLoad(n)}))})):(this._webjsLoadedSrc=n,this._webjsLoad(n))}_webjsLoad(t){Promise.resolve().then(()=>(xt(),So)).then(({loadFrame:n})=>{this._webjsLoadedSrc!==t||!this.isConnected||n(this,t)})}}:null;typeof customElements<"u"&&Pn&&!customElements.get("webjs-frame")&&customElements.define("webjs-frame",Pn)});function ba(e,t,n){switch(e){case"append":n&&t.append(n);break;case"prepend":n&&t.prepend(n);break;case"before":n&&t.before(n);break;case"after":n&&t.after(n);break;case"replace":n&&t.replaceWith(n);break;case"update":n&&t.replaceChildren(n);break;case"remove":t.remove();break;default:break}}function Bn(e,t){let n=t||(typeof document<"u"?document:null);if(!n)return;let r=null;if(typeof e=="string"){let s=n.createElement("template");s.innerHTML=e,r=s.content}else if(e&&e.nodeType)r=e;else return;let o=r.querySelectorAll?Array.from(r.querySelectorAll("webjs-stream")):[];if(o.length)for(let s of o)n.body.append(s);else n.body.append(r)}var ya,Dn,kt=G(()=>{ya=new Set(["append","prepend","before","after","replace","update"]);Dn=typeof HTMLElement<"u"?class extends HTMLElement{connectedCallback(){this._webjsApplied||(this._webjsApplied=!0,this._webjsApply())}_webjsApply(){let t=(this.getAttribute("action")||"").toLowerCase(),n=this.ownerDocument||document,r=[],o=this.getAttribute("target");if(o){let i=n.getElementById(o);i&&(r=[i])}else{let i=this.getAttribute("targets");if(i)try{r=Array.from(n.querySelectorAll(i))}catch{r=[]}}let s=ya.has(t)?this.querySelector("template"):null;try{for(let i of r){let a=s?s.content.cloneNode(!0):null;ba(t,i,a)}}finally{this.remove()}}}:null;typeof customElements<"u"&&Dn&&!customElements.get("webjs-stream")&&customElements.define("webjs-stream",Dn)});var Ao,Eo=G(()=>{Ao=typeof HTMLElement<"u"?class extends HTMLElement{connectedCallback(){this.style.display||(this.style.display="contents")}}:null;typeof customElements<"u"&&Ao&&!customElements.get("webjs-suspense")&&customElements.define("webjs-suspense",Ao)});function jt(e){let t=e||(typeof document<"u"?document:null);if(!(!t||typeof t.querySelectorAll!="function")){for(let n of t.querySelectorAll('script[type="application/json"]#__webjs-seeds, script[type="application/json"][data-webjs-seeds]'))Co(n.textContent,n);for(let n of t.querySelectorAll("[data-webjs-seed]"))Co(n.getAttribute("data-webjs-seed"),n,()=>n.removeAttribute("data-webjs-seed"))}}function Co(e,t,n){if(e)try{let r=ce(e);if(r&&typeof r=="object")for(let o in r)Ve.has(o)||Ve.set(o,r[o])}catch{}n?n():t.remove?.()}function ga(e,t,n){vo||(vo=!0,jt());let r=`${e}/${t}/${n}`;if(Ve.has(r)){let o=Ve.get(r);return Ve.delete(r),o}return To}var Ve,To,vo,Un=G(()=>{He();Ve=new Map,To=Symbol("webjs.seed.miss"),vo=!1});var So={};pr(So,{_FRAME_TOP:()=>Uo,_LIVE_ATTRS:()=>Gn,_activeFrameId:()=>Bo,_addNewHeadElements:()=>Yn,_applyStreamedResolve:()=>ls,_applySwap:()=>ir,_blurOutgoingFocus:()=>Lt,_buildHaveHeader:()=>rr,_buildSubmitFormData:()=>Fo,_bumpNavToken:()=>Ja,_clearFormBusy:()=>es,_clearFrameBusy:()=>Qo,_collectBoundaries:()=>ke,_currentPageUrl:()=>Xa,_diffElementInPlace:()=>Ut,_eligibleAnchorHref:()=>It,_findAnchorInPath:()=>Do,_getSubmitAction:()=>Po,_getSubmitMethod:()=>Io,_isNonHtmlPath:()=>tc,_keyOf:()=>xe,_markFormBusy:()=>Zo,_markFrameBusy:()=>Xo,_mergeHead:()=>is,_navToken:()=>Ya,_onPopState:()=>Qn,_onSubmit:()=>Zn,_parseHTML:()=>Jn,_planBoundarySwap:()=>Ho,_prefetch:()=>je,_prefetchCache:()=>v,_prefetchHasHoverPointer:()=>zo,_prefetchInflightSize:()=>Ka,_prefetchMode:()=>Pt,_prefetchPeek:()=>za,_prefetchSaysSaveData:()=>or,_prefetchSuppressed:()=>Ko,_prefetchTake:()=>Go,_reactivateScripts:()=>Je,_readStreamedShell:()=>as,_reconcileChildren:()=>Vt,_regraftPermanentElements:()=>ns,_regraftPermanentInSlice:()=>Wt,_resetParseProbe:()=>wa,_resetPrefetch:()=>Ga,_resetWarnOnce:()=>Za,_resolveTargetFrameId:()=>er,_restoreOptimistic:()=>ze,_runWithTransition:()=>Ot,_setCurrentPageUrl:()=>Qa,_shouldFullLoadDuringParse:()=>ec,_snapshotCache:()=>k,_streamBoundariesProgressively:()=>us,_takeResolveUnit:()=>cs,_viewTransitionsEnabled:()=>ts,collectBoundaries:()=>ke,disableClientRouter:()=>Ro,enableClientRouter:()=>Xn,loadFrame:()=>Ea,navigate:()=>Oo,planBoundarySwap:()=>Ho,revalidate:()=>Lo});function Jn(e){if(!/^\s*(?:<!doctype|<html)/i.test(e)&&typeof document<"u"&&document.implementation)try{let n=document.implementation.createHTMLDocument();if(typeof n.body.setHTMLUnsafe=="function")n.body.setHTMLUnsafe(e);else{let r=n.createElement("template");r.innerHTML=e,n.body.appendChild(r.content)}return n}catch{}return typeof Document<"u"&&typeof Document.parseHTMLUnsafe=="function"&&_a()?Document.parseHTMLUnsafe(e):Sa(e)}function _a(){if(Ee!==null)return Ee;try{Ee=Document.parseHTMLUnsafe("<!doctype html><body><!--c--><i></i>")?.body?.firstChild?.nodeType===8}catch{Ee=!1}return Ee}function wa(){Ee=null}function Sa(e){return typeof DOMParser>"u"?null:new DOMParser().parseFromString(e,"text/html")}function Aa(){$n||typeof MutationObserver>"u"||typeof customElements>"u"||($n=new MutationObserver(e=>{for(let t of e)for(let n of t.addedNodes){if(n.nodeType!==1)continue;let r=n;r.tagName?.includes("-")&&customElements.upgrade(r);for(let o of r.querySelectorAll("*"))o.tagName?.includes("-")&&customElements.upgrade(o)}}),$n.observe(document.body,{childList:!0,subtree:!0}))}function Xn(){te||typeof document>"u"||(te=!0,document.addEventListener("click",Mo,!1),document.addEventListener("submit",Zn,!1),window.addEventListener("popstate",Qn),document.addEventListener("pointerover",Ne,!0),document.addEventListener("focusin",Ne,!0),document.addEventListener("touchstart",Ne,{capture:!0,passive:!0}),document.addEventListener("pointerout",Yo,!0),document.addEventListener("webjs:navigate",Kn),Aa(),Kn(),typeof history<"u"&&"scrollRestoration"in history&&(Rt=history.scrollRestoration,history.scrollRestoration="manual"),typeof location<"u"&&(H=location.href))}function Ro(){te&&(te=!1,document.removeEventListener("click",Mo,!1),document.removeEventListener("submit",Zn,!1),window.removeEventListener("popstate",Qn),document.removeEventListener("pointerover",Ne,!0),document.removeEventListener("focusin",Ne,!0),document.removeEventListener("touchstart",Ne,{capture:!0}),document.removeEventListener("pointerout",Yo,!0),document.removeEventListener("webjs:navigate",Kn),qt(),sr(),ee&&(ee.disconnect(),ee=null),typeof history<"u"&&Rt!==null&&(history.scrollRestoration=Rt,Rt=null),H=null)}async function Oo(e,t){let n=new URL(e,location.href);if(n.origin!==location.origin){location.href=e;return}await nr(n.href,t?.replace??!1,null)}async function Ea(e,t){if(typeof location>"u")return{ok:!1,status:null,aborted:!1};let n=e&&e.id;if(!n)return{ok:!1,status:null,aborted:!1};let r=new URL(t,location.href);if(r.origin!==location.origin)return{ok:!1,status:null,aborted:!1};M&&M.abort(),M=new AbortController;let o=M.signal,s=++C;return Ft(r.href,n,!1,null,"GET",null,o,s)}function Lo(e){if(!e){k.clear(),v.clear();return}let t=new URL(e,location.href),n=t.pathname+t.search;k.delete(n),v.delete(n)}function Mo(e){if(!te||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=Do(e);if(!t||t.hasAttribute("download")||t.hasAttribute("data-no-router")||t.target&&t.target!=="_self")return;let n=t.href;if(!n)return;let r=new URL(n);if(r.origin!==location.origin||r.pathname===location.pathname&&r.search===location.search&&r.hash||Ht.test(r.pathname))return;e.preventDefault();let o=er(t);nr(n,!1,o)}function Qn(e){nr(location.href,!0,null)}function Zn(e){if(!te||e.defaultPrevented)return;let t=e.target;if(!t||t.nodeType!==1||t.tagName!=="FORM"||t.hasAttribute("data-no-router"))return;let n=e.submitter??null;if(n&&n.hasAttribute("data-no-router"))return;let r=n&&n.getAttribute("formtarget")||t.getAttribute("target")||"";if(r&&r!=="_self")return;let o=Io(t,n);if(o==="dialog")return;let s=Po(t,n),i;try{i=new URL(s,location.href)}catch{return}if(i.origin!==location.origin||Ht.test(i.pathname))return;let a=Fo(t,n);e.preventDefault();let c=er(n||t);Ta(i.href,o,a,c,t)}function Io(e,t){return(t&&t.getAttribute("formmethod")||e.getAttribute("method")||"get").toLowerCase()}function Po(e,t){return t&&t.hasAttribute("formaction")?t.getAttribute("formaction")||"":e.getAttribute("action")||e.action||location.href}function Fo(e,t){try{return new FormData(e,t||void 0)}catch{let n=new FormData(e);return t&&t.getAttribute("name")&&n.append(t.getAttribute("name"),t.getAttribute("value")||""),n}}function Do(e){for(let t of e.composedPath())if(t instanceof HTMLAnchorElement)return t;return null}function Bo(e){let t=e;for(;t;){let n=t.closest("webjs-frame");if(n&&n.id)return n.id;let r=t.getRootNode();if(r&&r.host)t=r.host;else break}return null}function er(e){if(!e)return null;let t=e.closest&&e.closest("[data-webjs-frame]"),n=t?t.dataset?t.dataset.webjsFrame:t.getAttribute("data-webjs-frame"):null;if(n!=null&&n!==""){if(n===Uo)return null;let r=typeof document<"u"?document.getElementById(n):null;return r&&r.tagName&&r.tagName.toLowerCase()==="webjs-frame"?n:(tr(`webjs:frame-unresolved:${n}`,`[webjs] data-webjs-frame="${n}" did not match a live <webjs-frame id="${n}">; performing a normal navigation instead.`),null)}return Bo(e)}function tr(e,t){qn.has(e)||(qn.add(e),typeof console<"u"&&console.warn&&console.warn(t))}function $o(e,t){return!e&&!t&&typeof document<"u"&&document.readyState==="loading"}function Wn(e,t){typeof process<"u"&&process.env||tr(`fallback:${e}`,`[webjs] client router fell back to a full page load (${e}) navigating to ${t}. This is correct (no DOM corruption), just not a soft nav.`)}function xo(){if(typeof process<"u"&&process.env||Vn||typeof document>"u"||typeof getComputedStyle!="function")return;let e=document.documentElement;if(!e)return;Vn=!0;let t;try{t=getComputedStyle(e).scrollBehavior}catch{return}t==="smooth"&&tr("scroll-behavior-smooth-html","[webjs] Detected `scroll-behavior: smooth` on <html>. The client router scrolls to the top instantly on navigation (like a native page load), so route transitions are not affected by it. It still applies to in-page #anchor links. Pairing it with a sticky `backdrop-filter` header can also flash on iOS during navigation.")}function Mt(e){if(typeof document>"u")return;let t=document.documentElement;if(!(!t||!t.hasAttribute("data-webjs-nav-progress")))try{e?t.setAttribute("data-navigating",""):t.removeAttribute("data-navigating")}catch{}}function ke(e){let t=new Map,n=[],r=!1;function o(s){if(!r){if(s.nodeType===8){let i=s.data.trim();if(i.startsWith("wj:children:")){let a=i.slice(12),c=a.lastIndexOf(":");if(c<=0||c===a.length-1){r=!0;return}let l=a.slice(0,c),u=a.slice(c+1);if(t.has(l)||n.some(f=>f.segment===l)){r=!0;return}n.push({segment:l,routeKey:u,start:s});return}if(i.startsWith("/wj:children")){let a=i.slice(12).replace(/^:/,""),c=n.pop();if(!c||c.segment!==a){r=!0;return}if(c.start.parentNode!==s.parentNode){r=!0;return}{let l=c.start.parentNode.tagName;if(l==="TABLE"||l==="TBODY"||l==="THEAD"||l==="TFOOT"||l==="TR"){r=!0;return}}t.set(c.segment,{routeKey:c.routeKey,start:c.start,end:s});return}return}if(s.hasChildNodes&&s.hasChildNodes())for(let i=s.firstChild;i&&!r;i=i.nextSibling)o(i)}}return o(e),r||n.length>0?null:t}function Ho(e,t){let n=[...e.keys()].filter(i=>t.has(i)).sort((i,a)=>i.length-a.length);if(n.length===0)return null;for(let i of n)if(e.get(i).routeKey!==t.get(i).routeKey){let a=null;for(let c of n){if(c===i)break;i.startsWith(c==="/"?c:c+"/")&&(a=c)}return a?{mode:"replace",segment:a,live:e.get(a),incoming:t.get(a)}:null}let r=n[n.length-1],o=i=>{let a=null;for(let c of i.keys())(a===null||c.length>a.length)&&(a=c);return a};return{mode:o(e)===r&&o(t)===r?"morph":"replace",segment:r,live:e.get(r),incoming:t.get(r)}}function qo(e){let t=pe(e);document.dispatchEvent(new CustomEvent("webjs:before-cache",{detail:{url:e}})),k.has(t)&&k.delete(t);let n={html:document.documentElement.outerHTML,scrollX:typeof window<"u"&&window.scrollX||0,scrollY:typeof window<"u"&&window.scrollY||0};for(k.set(t,n);k.size>va;){let r=k.keys().next().value;k.delete(r)}}function Ca(e){let t=pe(e),n=k.get(t);return n==null?null:(k.delete(t),k.set(t,n),typeof n=="string"?{html:n,scrollX:0,scrollY:0}:n)}function pe(e){let t=new URL(e,location.href);return t.pathname+t.search}async function nr(e,t,n){if($o(t,n)&&typeof location<"u"){Wn("readyState-loading",e),location.href=e;return}M&&M.abort(),M=new AbortController;let r=M.signal,o=++C;H&&qo(H);let s=setTimeout(()=>{Mt(!0),s=null},150),i=null;t||(i=rs());try{if(t){let a=Ca(e);if(a){let c=Jn(a.html);if(c){ir(c,n,!0,null),typeof window<"u"&&window.scrollTo({left:a.scrollX,top:a.scrollY,behavior:"instant"}),Ft(e,n,!1,i,"GET",null,r,o,!0).catch(()=>{});return}}typeof window<"u"&&window.scrollTo({left:0,top:0,behavior:"instant"})}await Ft(e,n,!t,i,"GET",null,r,o)}finally{s&&clearTimeout(s),o===C&&(Mt(!1),typeof location<"u"&&(H=location.href))}}async function Ta(e,t,n,r,o){M&&M.abort(),M=new AbortController;let s=M.signal,i=++C,a=t==="get"||t==="head",c=new URL(e,location.href);if(a){c.search="";for(let[h,m]of n)c.searchParams.append(h,typeof m=="string"?m:m.name)}H&&qo(H);let l=setTimeout(()=>{Mt(!0),l=null},150),u=rs(),f=o?Zo(o,i,c.href):null,d=!1;try{let h=await Ft(c.href,r,!0,u,a?"GET":t.toUpperCase(),a?null:n,s,i);d=!!(h&&h.ok),!a&&i===C&&(k.clear(),v.clear())}finally{f&&es(f,i,c.href,d),l&&clearTimeout(l),i===C&&(Mt(!1),typeof location<"u"&&(H=location.href))}}function rr(){let e=ke(document.body);return e?[...e.entries()].map(([t,n])=>`${t}:${n.routeKey}`).join(","):""}function or(){try{let e=typeof navigator<"u"?navigator.connection:null;if(e&&(e.saveData===!0||typeof e.effectiveType=="string"&&/2g$/.test(e.effectiveType))||typeof matchMedia=="function"&&matchMedia("(prefers-reduced-data: reduce)").matches)return!0}catch{}return!1}function zo(){try{if(typeof matchMedia=="function")return matchMedia("(hover: hover) and (pointer: fine)").matches}catch{}return!0}function Ra(e){let t=e.getAttribute("rel");return t?t.toLowerCase().split(/\s+/).filter(Boolean):[]}function It(e){if(!e||!(e instanceof HTMLAnchorElement)||e.hasAttribute("download")||e.hasAttribute("data-no-router")||e.target&&e.target!=="_self")return null;let t=e.href;if(!t)return null;let n;try{n=new URL(t)}catch{return null}return n.origin!==location.origin||n.pathname===location.pathname&&n.search===location.search&&n.hash||Ht.test(n.pathname)?null:t}function Ko(e){if(e.hasAttribute("data-no-prefetch"))return!0;let t=Ra(e);return t.includes("external")||t.includes("no-prefetch")}function Pt(e){if(Ko(e))return"none";switch((e.getAttribute("data-prefetch")||"").toLowerCase().trim()){case"false":case"none":return"none";case"true":case"render":return"render";case"auto":case"viewport":return"viewport";case"intent":return"intent";default:return zo()?"intent":"viewport"}}function je(e){if(!te||typeof fetch!="function"||or())return;let t=pe(e);if(ue.has(t)||Ke.has(t))return;let n=v.get(t);if(n&&zn()-n.at<Wo)return;if(ue.size>=Vo){for(Ke.add(t),Ce.push(e);Ce.length>xa;){let s=Ce.shift();Ke.delete(pe(s))}return}let r=rr();if(!r&&typeof document<"u"&&document.readyState==="loading")return;ue.add(t);let o={"x-webjs-router":"1","x-webjs-prefetch":"1"};r&&(o["x-webjs-have"]=r),fetch(e,{method:"GET",headers:o,credentials:"same-origin"}).then(async s=>{let i=s.headers.get("content-type")||"";if(!/^text\/html\b/i.test(i)||s.status>=400)return;let a=s.headers.get("x-webjs-build"),c=s.headers.get("x-webjs-src"),l=typeof document<"u"?document.querySelector('script[type="importmap"]'):null,u=l?l.getAttribute("data-webjs-build"):null,f=l?l.getAttribute("data-webjs-src"):null;(a&&u&&a!==u||c&&f&&c!==f)&&(k.clear(),v.clear());let d=s.redirected&&s.url?s.url:e,h=await s.text();La(t,{html:h,build:a,src:c,finalUrl:d,at:zn()})}).catch(()=>{}).finally(()=>{ue.delete(t),Oa()})}function Oa(){for(;Ce.length&&ue.size<Vo;){let e=Ce.shift();Ke.delete(pe(e)),je(e)}}function La(e,t){for(v.has(e)&&v.delete(e),v.set(e,t);v.size>Na;){let n=v.keys().next().value;v.delete(n)}typeof document<"u"&&document.dispatchEvent(new CustomEvent("webjs:prefetch",{detail:{url:t.finalUrl,key:e,from:"prefetch"}}))}function Go(e){let t=pe(e),n=v.get(t);return!n||(v.delete(t),zn()-n.at>=Wo)?null:n}function zn(){try{if(typeof performance<"u"&&typeof performance.now=="function")return performance.now()}catch{}return 0}function Ne(e){if(!te)return;let t=Jo(e.target);if(!t)return;let n=Pt(t);if(n==="none"||n==="render")return;let r=It(t);if(r){if(e.type==="touchstart"){je(r);return}n==="intent"&&(Ge===t&&Te||(qt(),Ge=t,Te=setTimeout(()=>{Te=null,Ge=null,je(r)},ka)))}}function Yo(e){let t=Jo(e.target);t&&t===Ge&&qt()}function qt(){Te&&(clearTimeout(Te),Te=null),Ge=null}function sr(){for(let e of Ye)clearTimeout(e);Ye.clear(),ve=new WeakMap}function Jo(e){let t=e;for(;t;){if(t instanceof HTMLAnchorElement)return t;let n=t.nodeType===1?t:null;if(n){let o=n.closest&&n.closest("a");if(o instanceof HTMLAnchorElement)return o}let r=t.getRootNode?t.getRootNode():null;t=r&&r.host?r.host:null}return null}function Kn(){if(typeof document>"u"||or())return;let e=typeof IntersectionObserver<"u";e&&(ee?(ee.disconnect(),sr()):ee=new IntersectionObserver(t=>{for(let n of t){let r=n.target;if(n.isIntersecting){if(ve.has(r))continue;let o=setTimeout(()=>{Ye.delete(o),ve.delete(r),ee.unobserve(r);let s=It(r);s&&Pt(r)==="viewport"&&je(s)},ja);ve.set(r,o),Ye.add(o)}else{let o=ve.get(r);o&&(clearTimeout(o),Ye.delete(o),ve.delete(r))}}},{threshold:.5}));for(let t of document.querySelectorAll("a[href]")){let n=Pt(t);if(n==="render"){let r=It(t);r&&je(r)}else n==="viewport"&&e&&ee.observe(t)}}function Ma(e){if(typeof document>"u"||!document.body)return!1;let t=ke(document.body);if(!t)return!1;let n,r=-1;for(let[c,l]of t)c.length>r&&(r=c.length,n=l);if(!n)return!1;let o=n.start.parentNode;if(!o||n.start.parentNode!==n.end.parentNode)return!1;let s=document.createElement("div");s.setAttribute("role","alert"),s.setAttribute("data-webjs-nav-error","");let i=e?`This page could not be loaded. (status ${e})`:"This page could not be loaded.";s.textContent=i;let a=document.createRange();return a.setStartAfter(n.start),a.setEndBefore(n.end),a.deleteContents(),o.insertBefore(s,n.end),!0}function Hn(e,t,n){let r=new CustomEvent("webjs:navigation-error",{bubbles:!0,cancelable:!0,detail:{url:e,status:t??null,error:n||null}});if(typeof document<"u")try{document.dispatchEvent(r)}catch{}r.defaultPrevented||Ma(t)||typeof location<"u"&&(location.href=e)}async function Ft(e,t,n,r,o,s,i,a,c){o=o||"GET";let l=typeof a=="number"?a:C,u,f=null,d=null,h=null,m=null,w=!1,y=e,p=t?Xo(t,l):null;try{try{let b=o==="GET"&&!s&&!t?Go(e):null;if(b)u=b.html,d=b.build,h=b.src,y=b.finalUrl,m=200,w=!0;else{let I={"x-webjs-router":"1"},Oe=rr();Oe&&(I["x-webjs-have"]=Oe),t&&(I["x-webjs-frame"]=t),s!=null&&o!=="GET"&&o!=="HEAD"&&(I.accept=No+", text/html");let ne={method:o,headers:I,credentials:"same-origin"};i&&(ne.signal=i),s!=null&&o!=="GET"&&o!=="HEAD"&&(ne.body=s);let T=await fetch(e,ne);m=T.status,w=T.ok;let N=T.headers.get("content-type")||"",ps=/^text\/html\b/i.test(N);if(N.toLowerCase().indexOf(No)===0){let hs=await T.text();return l===C&&(ze(r),Bn(hs)),{ok:w,status:m,aborted:!1}}if(T.redirected&&T.url&&(y=T.url),T.status===204||T.status===205)return l===C&&n&&history.pushState(null,"",y),{ok:w,status:m,aborted:!1};if(!ps)return l===C&&(ze(r),Hn(e,T.status,null)),{ok:!1,status:m,aborted:!1};d=T.headers.get("x-webjs-build"),h=T.headers.get("x-webjs-src");let Gt=await as(T);u=Gt.shell,Gt.streaming&&(f=Gt)}}catch(b){return b&&b.name==="AbortError"?{ok:!1,status:null,aborted:!0}:l!==C?{ok:!1,status:null,aborted:!0}:(ze(r),Hn(e,null,b instanceof Error?b:new Error(String(b))),{ok:!1,status:null,aborted:!1})}if(l!==C){if(f&&f.reader)try{f.reader.cancel()}catch{}return{ok:!1,status:m,aborted:!0}}let j=Jn(u);if(!j)return ze(r),Hn(e,null,new Error("navigation response did not parse as HTML")),{ok:!1,status:m,aborted:!1};if(ir(j,t,!!c,y,d,h)==="discard"){if(f&&f.reader)try{f.reader.cancel()}catch{}return{ok:w,status:m,aborted:!1}}if(n&&history.pushState(null,"",y),n){let b=new URL(y);if(b.hash){let I=document.getElementById(b.hash.slice(1));I?I.scrollIntoView():(xo(),window.scrollTo({left:0,top:0,behavior:"instant"}))}else xo(),window.scrollTo({left:0,top:0,behavior:"instant"})}return f&&(f.reader||f.rest)&&us(f.reader,f.dec,f.rest,()=>l===C),document.dispatchEvent(new CustomEvent("webjs:navigate",{detail:{url:y,frameId:t,from:"navigate"}})),{ok:w,status:m,aborted:!1}}finally{p&&Qo(p,l)}}function Xo(e,t){if(typeof document>"u")return null;let n=null;try{n=document.querySelector(`webjs-frame#${CSS.escape(e)}`)}catch{n=document.getElementById(e)}if(!n)return null;let r=Dt.has(n);return Dt.set(n,t),n.setAttribute("aria-busy","true"),r||n.dispatchEvent(new CustomEvent("webjs:frame-busy",{bubbles:!0,detail:{frameId:e,busy:!0}})),n}function Qo(e,t){if(Dt.get(e)!==t)return;Dt.delete(e),e.setAttribute("aria-busy","false");let n=e.id||null;e.dispatchEvent(new CustomEvent("webjs:frame-busy",{bubbles:!0,detail:{frameId:n,busy:!1}}))}function Zo(e,t,n){let r=Bt.has(e);return Bt.set(e,t),e.setAttribute("aria-busy","true"),r||e.dispatchEvent(new CustomEvent("webjs:submit-start",{bubbles:!0,detail:{form:e,url:n}})),e}function es(e,t,n,r){if(Bt.get(e)!==t)return;Bt.delete(e),e.setAttribute("aria-busy","false");let o=new CustomEvent("webjs:submit-end",{bubbles:!0,detail:{form:e,url:n,ok:!!r}});e.isConnected?e.dispatchEvent(o):typeof document<"u"?document.dispatchEvent(o):e.dispatchEvent(o)}function ko(e){if(!e||!e.head)return"";let t=e.head.querySelectorAll('[data-webjs-track="reload"]');if(!t.length)return"";let n="";for(let r of t)n+=fe(r);return n}function ts(){if(typeof document>"u")return!1;let e=document.querySelector('meta[name="view-transition"]');return e?(e.getAttribute("content")||"").trim().toLowerCase()==="same-origin":!1}function Ot(e,t){let n=typeof document<"u"?document.startViewTransition:void 0;if(ts()&&typeof n=="function"){let r=n.call(document,e);r&&r.finished&&typeof r.finished.then=="function"?r.finished.then(()=>{t&&t()}).catch(()=>{}):t&&t();return}e(),t&&t()}function ns(e,t){if(!e||!t||typeof e.querySelectorAll!="function")return;let n=e.querySelectorAll("[data-webjs-permanent][id]");for(let r of n){let o=r.id;if(!o)continue;let s=null;try{s=t.querySelector(`#${CSS.escape(o)}`)}catch{s=null}if(!s||!r.hasAttribute||!r.hasAttribute("data-webjs-permanent"))continue;let i=s.parentNode;i&&s!==r&&i.replaceChild(r,s)}}function Wt(e,t){let n=[];for(let r of e){if(r.nodeType!==1)continue;let o=r;if(o.hasAttribute&&o.hasAttribute("data-webjs-permanent")&&o.id&&n.push(o),typeof o.querySelectorAll=="function")for(let s of o.querySelectorAll("[data-webjs-permanent][id]"))n.push(s)}if(n.length)for(let r of n){let o=r.id;if(!o)continue;let s=Ia(t,o);if(!s||s===r)continue;let i=s.parentNode;if(i)i.replaceChild(r,s);else{let a=t.indexOf(s);a!==-1&&(t[a]=r)}}}function Ia(e,t){for(let n of e){if(n.nodeType!==1)continue;let r=n;if(r.id===t)return r;if(typeof r.querySelector=="function"){let o=null;try{o=r.querySelector(`#${CSS.escape(t)}`)}catch{o=null}if(o)return o}}return null}function Pa(e){if(!(!e||!e.start))for(let t=e.start.nextSibling;t&&t!==e.end;t=t.nextSibling)t.nodeType===1&&de(t)}function ir(e,t,n,r,o,s){try{jt(e)}catch{}try{for(let f of e.querySelectorAll("[data-wj-host]"))f.setAttribute("data-wj-serialized","")}catch{}try{typeof sessionStorage<"u"&&(!r||t||n)&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}if(r&&!t&&!n){let f=document.querySelector('script[type="importmap"]'),d=f?f.getAttribute("data-webjs-build"):null,h=!1;if(o&&d&&(h=o!==d),!h&&e.head&&e.head.children.length>0){let m=ko(document),w=ko(e);m!==w&&(h=!0)}if(h&&typeof location<"u"){k.clear(),v.clear();try{let m="webjs:importmap-reload";if(sessionStorage&&sessionStorage.getItem(m))sessionStorage.removeItem(m);else{sessionStorage&&sessionStorage.setItem(m,"1"),location.href=r;return}}catch{location.href=r;return}}else if(!h){let m=f?f.getAttribute("data-webjs-src"):null;s&&m&&s!==m&&(k.clear(),v.clear(),f&&f.setAttribute("data-webjs-src",s));try{typeof sessionStorage<"u"&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}}}if(t){let f=document.querySelector(`webjs-frame#${CSS.escape(t)}`),d=e.querySelector(`webjs-frame#${CSS.escape(t)}`);if(f&&d){Yn(e.head),Ot(()=>{Wa(f,d),Je(f),de(f),Lt()},()=>de(f)),jo(e.body);return}let h=new CustomEvent("webjs:frame-missing",{bubbles:!0,cancelable:!0,detail:{frameId:t,url:r||(typeof location<"u"?location.href:null),document:e}});(f||document).dispatchEvent(h),h.defaultPrevented||console.warn(`[webjs] frame "${t}" was not in the navigation response, leaving it unchanged. Handle "webjs:frame-missing" (preventDefault) to override.`);return}let i=ke(document.body),a=ke(e.body),c=i&&a?Ho(i,a):null;if(c){let{mode:f,live:d,incoming:h}=c;Yn(e.head),Ot(()=>{f==="replace"?Fa(d,h):Da(d,h,e),Ha(d.start,h.start),Lt()},()=>Pa(d)),jo(e.body);return}if(r&&!n&&typeof location<"u"){Wn(i?a?"no-shared-boundary":"incoming-boundaries-malformed":"live-boundaries-malformed",r),location.href=r;return}if(r&&n)return Wn("revalidation-discarded",r),"discard";is(e.head),ns(document.body,e.body);let l=[...e.body.childNodes];Ot(()=>{document.body.replaceChildren(...l),Je(document.body),de(document.body),Lt()},()=>de(document.body))}function Lt(){let e=document.activeElement;!e||e===document.body||e===document.documentElement||typeof e.blur=="function"&&e.blur()}function Fa(e,t){let n=e.start.parentNode;if(!n)return;let r=[];for(let s=e.start.nextSibling;s&&s!==e.end;s=s.nextSibling)r.push(s);let o=[];for(let s=t.start.nextSibling;s&&s!==t.end;s=s.nextSibling)o.push(document.importNode(s,!0));Wt(r,o);for(let s of r)s.parentNode===n&&n.removeChild(s);for(let s of o)n.insertBefore(s,e.end);for(let s=e.start.nextSibling;s&&s!==e.end;s=s.nextSibling)s.nodeType===1&&(Je(s),de(s))}function Da(e,t,n){if(!e||!t)return;let r=e.start.parentNode;if(!r)return;let o=[];for(let i=e.start.nextSibling;i&&i!==e.end;i=i.nextSibling)o.push(i);let s=[];for(let i=t.start.nextSibling;i&&i!==t.end;i=i.nextSibling)s.push(document.importNode(i,!0));Wt(o,s),Ba(r,e.start,e.end,o,s);for(let i=e.start.nextSibling;i&&i!==e.end;i=i.nextSibling)i.nodeType===1&&(Je(i),de(i))}function Ba(e,t,n,r,o){let s=new Map;for(let c of r){if(c.nodeType!==1)continue;let l=xe(c);l&&s.set(l,c)}let i=n,a=[];for(let c of o){if(c.nodeType===1){let l=xe(c);if(l&&s.has(l)){let u=s.get(l);Ut(u,c),a.push(u),s.delete(l);continue}}a.push(c)}for(let c of r)if(c.parentNode===e){if(c.nodeType===1&&a.includes(c))continue;e.removeChild(c)}for(let c of a)e.insertBefore(c,i)}function Ut(e,t){if(e===t)return;if(e.tagName!==t.tagName){e.replaceWith(t);return}let n=new Set;for(let r of t.attributes)n.add(r.name),!Gn.has(r.name)&&r.name!=="data-wj-serialized"&&e.getAttribute(r.name)!==r.value&&e.setAttribute(r.name,r.value);for(let r of[...e.attributes])Gn.has(r.name)||n.has(r.name)||e.removeAttribute(r.name);if(Ua(e)){qa(e,t);return}Vt(e,t)}function Ua(e){let t=e;return t[Symbol.for("webjs.instance")]!=null||t[S]!=null}function $a(e,t){for(let n=e.parentElement;n&&n!==t;n=n.parentElement)if(n.tagName.includes("-"))return!1;return!0}function $t(e){let t=new Map,n=`slot[${E}][${L}="${D}"]`;for(let r of e.querySelectorAll(n)){let o=r;if(!$a(o,e)||Br(e,o))continue;let s=!1;for(let a=o.parentElement;a&&a!==e;a=a.parentElement)if(a.tagName==="SLOT"&&a.hasAttribute(E)&&a.getAttribute(L)===D){s=!0;break}if(s)continue;let i=F(o.getAttribute("name"));t.has(i)||t.set(i,o)}return t}function Ha(e,t){let n=e.parentNode;if(!n||n.nodeType!==1)return;let r=n;if(r.tagName!=="SLOT"||!r.hasAttribute(E))return;let o=null;for(let f=r.parentElement;f;f=f.parentElement){if(f[S]){o=f;break}if(f.tagName.includes("-"))return}if(!o)return;let s=F(r.getAttribute("name"));ie(o,s,[...r.childNodes]);let i=t.parentNode;if(!i||i.nodeType!==1)return;let a=i;if(a.tagName!=="SLOT")return;let c=null;for(let f=a.parentElement;f;f=f.parentElement)if(f.tagName.includes("-")){c=f;break}if(!c||c.tagName!==o.tagName)return;let l=$t(o),u=$t(c);for(let f of new Set([...l.keys(),...u.keys()])){if(f===s)continue;let d=u.get(f);d?ie(o,f,[...d.childNodes].map(h=>document.importNode(h,!0))):l.get(f)&&ie(o,f,null)}}function qa(e,t){if(!e[S])return;let n=$t(e),r=$t(t);if(n.size===0&&r.size===0)return;let o=new Set([...n.keys(),...r.keys()]);for(let s of o){let i=n.get(s),a=r.get(s);i&&a?(Vt(i,a),ie(e,s,[...i.childNodes])):a?ie(e,s,[...a.childNodes].map(c=>document.importNode(c,!0))):ie(e,s,null)}}function Vt(e,t){let n=[...e.childNodes],r=[...t.childNodes].map(a=>document.importNode(a,!0));Wt(n,r);let o=new Map;for(let a of n){if(a.nodeType!==1)continue;let c=xe(a);c&&o.set(c,a)}let s=[];for(let a=0;a<r.length;a++){let c=r[a];if(c.nodeType===1){let l=xe(c);if(l&&o.has(l)){let f=o.get(l);Ut(f,c),s.push(f),o.delete(l);continue}let u=n[a];if(u&&u.nodeType===1&&!xe(u)&&u.tagName===c.tagName){Ut(u,c),s.push(u);continue}}else if(c.nodeType===3){let l=n[a];if(l&&l.nodeType===3){l.nodeValue!==c.nodeValue&&(l.nodeValue=c.nodeValue),s.push(l);continue}}else if(c.nodeType===8){let l=n[a];if(l&&l.nodeType===8){l.nodeValue!==c.nodeValue&&(l.nodeValue=c.nodeValue),s.push(l);continue}}s.push(c)}let i=new Set(s);for(let a of n)!i.has(a)&&a.parentNode===e&&e.removeChild(a);for(let a=0;a<s.length;a++){let c=s[a];(c.parentNode!==e||e.childNodes[a]!==c)&&e.insertBefore(c,e.childNodes[a]||null)}}function xe(e){let t=e.getAttribute("data-key");return t?`${e.tagName}:k:${t}`:e.id?`${e.tagName}:i:${e.id}`:null}function rs(){let e=ke(document.body);if(!e||e.size===0)return null;let t=[...e.keys()].sort((a,c)=>c.length-a.length),n=null,r=null;for(let a of t){let c=document.getElementById(`wj-loading:${a}`);if(c instanceof HTMLTemplateElement){n=a,r=c;break}}if(n===null||r===null)return null;let o=e.get(n),s=[];for(let a=o.start.nextSibling;a&&a!==o.end;a=a.nextSibling)s.push(a);let i=document.createRange();return i.setStartAfter(o.start),i.setEndBefore(o.end),i.deleteContents(),o.start.parentNode.insertBefore(r.content.cloneNode(!0),o.end),{slot:o,oldChildren:s,token:C}}function ze(e){if(!e||e.token!==C)return;let{slot:t,oldChildren:n}=e;if(t.start.parentNode!==t.end.parentNode)return;let r=document.createRange();r.setStartAfter(t.start),r.setEndBefore(t.end),r.deleteContents();for(let o of n)t.start.parentNode.insertBefore(o,t.end)}function Wa(e,t){Vt(e,t)}function os(){if(typeof document>"u")return"";let e=document.querySelector('meta[name="csp-nonce"]');return e&&e.getAttribute("content")||""}function ar(e){let t=document.createElement("script");for(let r of e.attributes)r.name!=="nonce"&&t.setAttribute(r.name,r.value);let n=os();return n&&t.setAttribute("nonce",n),t.textContent=e.textContent,t}function ss(e){if(!e.hasAttribute("nonce"))return e.cloneNode(!0);let t=e.cloneNode(!0),n=os();return n?t.setAttribute("nonce",n):t.removeAttribute("nonce"),t}function fe(e){if(!e.hasAttribute("nonce"))return e.outerHTML;let t=e.cloneNode(!0);return t.removeAttribute("nonce"),t.outerHTML}function Yn(e){let t=e.querySelector("title");t&&(document.title=t.textContent||"");let n=new Set;for(let r of document.head.children)n.add(fe(r));for(let r of e.children)r.tagName==="SCRIPT"&&r.getAttribute("type")==="importmap"||r.tagName!=="BASE"&&r.tagName!=="TITLE"&&(n.has(fe(r))||(r.tagName==="SCRIPT"?document.head.appendChild(ar(r)):document.head.appendChild(ss(r))))}function Va(e){return e.tagName==="STYLE"?!0:e.tagName==="LINK"&&(e.getAttribute("rel")||"").toLowerCase().split(/\s+/).includes("stylesheet")}function is(e){let t=document.head,n=e.querySelector("title");n&&(document.title=n.textContent||"");let r=new Set;for(let s of t.children)s.tagName==="SCRIPT"&&s.getAttribute("type")==="importmap"||s.tagName!=="BASE"&&r.add(fe(s));let o=new Set;for(let s of e.children)s.tagName==="SCRIPT"&&s.getAttribute("type")==="importmap"||s.tagName!=="BASE"&&o.add(fe(s));for(let s of[...t.children])s.tagName==="SCRIPT"&&s.getAttribute("type")==="importmap"||s.tagName!=="BASE"&&s.tagName!=="TITLE"&&(Va(s)||o.has(fe(s))||s.remove());for(let s of e.children)s.tagName==="SCRIPT"&&s.getAttribute("type")==="importmap"||s.tagName!=="BASE"&&s.tagName!=="TITLE"&&(r.has(fe(s))||(s.tagName==="SCRIPT"?t.appendChild(ar(s)):t.appendChild(ss(s))))}function de(e){typeof customElements>"u"||cr(e)}function cr(e){let t=e instanceof Element?[e,...e.querySelectorAll("*")]:[...e.querySelectorAll("*")];for(let n of t)n.tagName&&n.tagName.includes("-")&&(customElements.upgrade(n),n.shadowRoot&&cr(n.shadowRoot))}function jo(e){for(let t of e.querySelectorAll("template[data-webjs-resolve]"))document.body.appendChild(t.cloneNode(!0))}async function as(e){if(!e.body||typeof e.body.getReader!="function")return{shell:await e.text(),streaming:!1};let t=e.body.getReader(),n=new TextDecoder,r="",o="<template data-webjs-resolve",s="<!--wj-stream-shell-->",i=/<\/html\s*>/i;for(;;){let{value:a,done:c}=await t.read();a&&(r+=n.decode(a,{stream:!0})),c&&(r+=n.decode());let l=r.indexOf(s);if(l!==-1)return{shell:r.slice(0,l),streaming:!0,reader:c?null:t,dec:n,rest:r.slice(l+s.length)};let u=r.indexOf(o);if(u!==-1)return{shell:r.slice(0,u),streaming:!0,reader:c?null:t,dec:n,rest:r.slice(u)};if(c)return{shell:r,streaming:!1};let f=i.exec(r);if(f){let d=f.index+f[0].length;return{shell:r.slice(0,d),streaming:!0,reader:t,dec:n,rest:r.slice(d)}}}}function cs(e){let t=/<template\s+data-webjs-resolve="([^"]+)"\s*>/i.exec(e);if(!t)return null;let n=t[1],r=t.index+t[0].length,o=/<(\/?)template\b[^>]*>/gi;o.lastIndex=r;let s=1,i;for(;i=o.exec(e);)if(i[1]==="/"){if(s--,s===0)return{id:n,content:e.slice(r,i.index),rest:e.slice(i.index+i[0].length)}}else s++;return null}function ls(e,t){let n=document.getElementById(e);if(!n)return;let r=document.createElement("template");r.innerHTML=t;let o=[...r.content.childNodes];n.replaceWith(r.content);for(let s of o)s.nodeType===1&&cr(s)}async function us(e,t,n,r){let o=n,s=()=>{let i;for(;i=cs(o);){if(!r())return!1;ls(i.id,i.content),o=i.rest}return!0};if(!e){s();return}try{for(;;){if(!s()){try{await e.cancel()}catch{}return}let{value:i,done:a}=await e.read();if(i&&(o+=t.decode(i,{stream:!0})),a){o+=t.decode(),s();return}}}catch{}}function Je(e){for(let t of e.querySelectorAll("script"))t.replaceWith(ar(t))}function za(e){return v.get(pe(e))||null}function Ka(){return ue.size}function Ga(){v.clear(),ue.clear(),Ce.length=0,Ke.clear(),qt(),sr()}function Ya(){return C}function Ja(){return++C}function Xa(){return H}function Qa(e){H=e}function Za(){qn.clear(),Vn=!1}function ec(e,t){return $o(e,t)}function tc(e){return Ht.test(e)}var No,Ee,te,M,C,$n,H,Rt,Ht,Uo,qn,Vn,va,k,Na,Wo,Vo,xa,ka,ja,v,ue,Ce,Ke,Te,Ge,ee,ve,Ye,Dt,Bt,Gn,xt=G(()=>{Fn();kt();kt();Eo();Un();yt();No="text/vnd.webjs-stream.html";Ee=null;te=!1,M=null,C=0,$n=null;H=null,Rt=null;Ht=/\.(?:pdf|zip|tar|gz|7z|rar|dmg|exe|msi|deb|rpm|apk|ipa|xlsx?|docx?|pptx?|csv|odt|ods|odp|rtf|epub|mobi|xml|json|rss|atom|txt|md|wasm|mp3|mp4|mov|avi|webm|ogg|flac|wav|m4a|m4v|mkv|png|jpe?g|gif|webp|avif|bmp|ico|svg|tiff?|heic)$/i;Uo="_top";qn=new Set;Vn=!1;va=16,k=new Map;Na=8,Wo=3e4,Vo=3,xa=24,ka=100,ja=250,v=new Map,ue=new Set,Ce=[],Ke=new Set,Te=null,Ge=null,ee=null,ve=new WeakMap,Ye=new Set;Dt=new WeakMap;Bt=new WeakMap;Gn=new Set(["value","checked","selected","indeterminate","disabled","open","popover"]);(typeof window>"u"||window.__WEBJS_CLIENT_ROUTER__!==!1)&&Xn()});function ys(e,...t){return{_$webjs:"template",strings:e,values:t}}function O(e){return!!e&&typeof e=="object"&&e._$webjs==="template"}var A="wjm-";function bs(e,...t){let n=e[0];for(let r=1;r<e.length;r++)n+=String(t[r-1]??"")+e[r];return{_$webjsCss:!0,text:n}}function Yt(e){return!!e&&typeof e=="object"&&e._$webjsCss===!0}function Jt(e,t){if(!(!t||!t.length))if("adoptedStyleSheets"in e&&typeof CSSStyleSheet<"u"){let n=t.map(r=>{let o=new CSSStyleSheet;return o.replaceSync(r.text),o});e.adoptedStyleSheets=n}else{let n=e,r=document.createElement("style");r.textContent=t.map(o=>o.text).join(`
2
+ `),n.appendChild(r)}}function gs(e){return!e||!e.length?"":`<style>${e.map(t=>t.text).join(`
3
+ `)}</style>`}var Xt=Object.freeze({"@":"event",".":"prop","?":"bool"});function hr(e){return Object.prototype.hasOwnProperty.call(Xt,e)}function _s(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function ws(e){return String(e).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}var mr=Symbol.for("webjs.repeat");function yr(e,t,n){return{[mr]:!0,items:[...e],keyFn:t,templateFn:n}}function Xe(e){return!!e&&typeof e=="object"&&e[mr]===!0}function Ss(e){return{_$webjs:"unsafe-html",value:String(e??"")}}function Qt(e){return!!e&&typeof e=="object"&&e._$webjs==="unsafe-html"}function As(e){return{_$webjs:"live",value:e}}function Zt(e){return!!e&&typeof e=="object"&&e._$webjs==="live"}function Es(e,t){return{_$webjs:"keyed",key:e,value:t}}function Qe(e){return!!e&&typeof e=="object"&&e._$webjs==="keyed"}function vs(e,t){return{_$webjs:"guard",deps:e,fn:t}}function Ze(e){return!!e&&typeof e=="object"&&e._$webjs==="guard"}function Cs(e){return{_$webjs:"template-content",template:e}}function en(e){return!!e&&typeof e=="object"&&e._$webjs==="template-content"}function Ts(e){return{_$webjs:"ref",target:e}}function et(e){return!!e&&typeof e=="object"&&e._$webjs==="ref"}function Ns(){return{value:void 0}}function xs(e){return{_$webjs:"cache",value:e}}function tt(e){return!!e&&typeof e=="object"&&e._$webjs==="cache"}function ks(...e){return{_$webjs:"until",args:e}}function nt(e){return!!e&&typeof e=="object"&&e._$webjs==="until"}function js(e,t){return{_$webjs:"async-append",iterable:e,mapper:t}}function tn(e){return!!e&&typeof e=="object"&&e._$webjs==="async-append"}function Rs(e,t){return{_$webjs:"async-replace",iterable:e,mapper:t}}function nn(e){return!!e&&typeof e=="object"&&e._$webjs==="async-replace"}function Os(e){return{_$webjs:"watch",signal:e}}function rt(e){return!!e&&typeof e=="object"&&e._$webjs==="watch"}var P=null,Y=!1,me=0,he=null,rn=0,br=(e,t)=>Object.is(e,t),st=()=>{},gr=()=>!1;function _r(e,t){e.liveConsumers||(e.liveConsumers=new Set);let n=e.liveConsumers.size===0;if(e.liveConsumers.add(t),n){if(e.producers&&e.producers.length>0)for(let r of e.producers)_r(r,e);if(e.watched)try{e.watched.call(e.wrapper)}catch(r){console.error(r)}}}function Le(e,t){if(e.liveConsumers&&(e.liveConsumers.delete(t),e.liveConsumers.size===0)){if(e.producers&&e.producers.length>0)for(let n of e.producers)Le(n,e);if(e.unwatched)try{e.unwatched.call(e.wrapper)}catch(n){console.error(n)}}}function un(e){if(Y)throw new Error("Signal read during notification phase");if(P===null)return;let t=P,n=t.nextProducerIndex++;n<t.producers.length&&t.producers[n]!==e&&an(t)&&Le(t.producers[n],t),t.producers[n]!==e&&(t.producers[n]=e,an(t)&&_r(e,t)),t.producerLastReadVersions[n]=e.version}function an(e){return e.consumerIsAlwaysLive||e.liveConsumers&&e.liveConsumers.size>0}function wr(e){if(!e.liveConsumers||e.liveConsumers.size===0)return;let t=Y;Y=!0;try{for(let n of e.liveConsumers)n.dirty||Ls(n)}finally{Y=t}}function Ls(e){e.dirty=!0,wr(e),e.consumerMarkedDirty.call(e.wrapper||e)}function it(e){if(!(!e.dirty&&e.lastCleanEpoch===me)){if(!e.producerMustRecompute()&&!Ms(e)){e.dirty=!1,e.lastCleanEpoch=me;return}e.producerRecomputeValue(),e.dirty=!1,e.lastCleanEpoch=me}}function Ms(e){for(let t=0;t<e.producers.length;t++){let n=e.producers[t],r=e.producerLastReadVersions[t];if(r!==n.version||(it(n),r!==n.version))return!0}return!1}function cn(e){e&&(e.nextProducerIndex=0);let t=P;return P=e,t}function ln(e,t){if(P=t,!!e){if(an(e))for(let n=e.nextProducerIndex;n<e.producers.length;n++)Le(e.producers[n],e);for(;e.producers.length>e.nextProducerIndex;)e.producers.pop(),e.producerLastReadVersions.pop()}}var at=class{constructor(t,n){this.__value=t,this.version=0,this.lastCleanEpoch=me,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.liveConsumers=void 0,this.consumerAllowSignalWrites=!0,this.consumerIsAlwaysLive=!1,this.producerMustRecompute=gr,this.producerRecomputeValue=st,this.consumerMarkedDirty=st,this.wrapper=this,this.__isSignal=!0,this.__equal=n?.equals||br,this.watched=n?.[fn],this.unwatched=n?.[dn]}get(){return un(this),this.__value}peek(){return this.__value}set(t){if(Y)throw new Error("Signal write during notification phase");this.__equal.call(this,this.__value,t)||(this.__value=t,this.version++,me++,he!==null?Sr(this):wr(this))}};function Sr(e){let t=Y;Y=!0;try{if(!e.liveConsumers)return;for(let n of e.liveConsumers)n.dirty||(n.dirty=!0,n.__isWatcher?he.add(n):Sr(n))}finally{Y=t}}var on=Symbol("unset"),sn=Symbol("computing"),ot=Symbol("errored"),Me=class{constructor(t,n){this.__fn=t,this.__value=on,this.__error=null,this.version=0,this.lastCleanEpoch=-1,this.dirty=!0,this.producers=[],this.producerLastReadVersions=[],this.nextProducerIndex=0,this.liveConsumers=void 0,this.consumerAllowSignalWrites=!1,this.consumerIsAlwaysLive=!1,this.wrapper=this,this.__isSignal=!0,this.__isComputed=!0,this.__equal=n?.equals||br,this.watched=n?.[fn],this.unwatched=n?.[dn];let r=this;this.producerMustRecompute=function(){return r.__value===on||r.__value===sn},this.producerRecomputeValue=function(){if(r.__value===sn)throw new Error("Detected cycle in computations.");let o=r.__value;r.__value=sn;let s=cn(r),i,a=!1;try{i=r.__fn.call(r.wrapper)}catch(l){i=ot,r.__error=l,a=!0}finally{ln(r,s)}if(!a&&(o!==on&&o!==ot)&&r.__equal.call(r.wrapper,o,i)){r.__value=o;return}r.__value=i,r.version++},this.consumerMarkedDirty=st}get(){if(it(this),un(this),this.__value===ot)throw this.__error;return this.__value}peek(){if(it(this),this.__value===ot)throw this.__error;return this.__value}},ct=class{constructor(t){this.__notify=t,this.version=0,this.lastCleanEpoch=me,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.nextProducerIndex=0,this.liveConsumers=void 0,this.consumerAllowSignalWrites=!1,this.consumerIsAlwaysLive=!0,this.producerMustRecompute=gr,this.producerRecomputeValue=st,this.wrapper=this,this.__isWatcher=!0;let n=this;this.consumerMarkedDirty=function(){n.__fire()}}__fire(){this.__notify&&this.__notify.call(this)}watch(...t){if(t.length===0){this.dirty=!1;return}let n=cn(this);try{for(let r of t)un(r),r.__isComputed&&it(r)}finally{ln(this,n)}this.dirty=!1}unwatch(...t){for(let n=this.producers.length-1;n>=0;n--)t.includes(this.producers[n])&&(Le(this.producers[n],this),this.producers.splice(n,1),this.producerLastReadVersions.splice(n,1),this.nextProducerIndex=Math.min(this.nextProducerIndex,this.producers.length))}getPending(){return this.producers.filter(t=>t.__isComputed&&t.dirty)}observe(t){let n=cn(this),r;try{r=t()}finally{ln(this,n)}return this.dirty=!1,r}dispose(){for(let t of this.producers)Le(t,this);this.producers=[],this.producerLastReadVersions=[],this.__notify=null}},fn=Symbol("watched"),dn=Symbol("unwatched");function Is(e){let t=P;P=null;try{return e()}finally{P=t}}function Ps(e){return e.producers.slice()}function Fs(e){return e.liveConsumers?[...e.liveConsumers]:[]}function Ds(e){return!!e.liveConsumers&&e.liveConsumers.size>0}function Bs(e){return e.producers.length>0}function Us(){return P&&P.__isComputed?P:null}function $s(e){rn++,he===null&&(he=new Set);try{e()}finally{if(rn--,rn===0){let t=he;he=null;for(let n of t)n.__fire()}}}var Ie={State:at,Computed:Me,subtle:{Watcher:ct,untrack:Is,introspectSources:Ps,introspectSinks:Fs,hasSinks:Ds,hasSources:Bs,currentComputed:Us,watched:fn,unwatched:dn}};function Hs(e,t){return new at(e,t)}function qs(e,t){return new Me(e,t)}function Ws(e){return!!(e&&typeof e=="object"&&e.__isSignal===!0)}function Vs(e){let t=!1,n=!1,r=new Me(e),o=new ct(()=>{t||n||(t=!0,queueMicrotask(()=>{if(t=!1,!n){try{r.get()}catch(s){console.error(s)}o.watch()}}))});o.watch(r);try{r.get()}catch(s){console.error(s)}return()=>{n||(n=!0,o.dispose())}}yt();function Vr(e,t){let n=e&&e[S]?e:null;return n?pt(n,t):t()}var qr=new WeakMap,bt=Symbol.for("webjs.instance");function Se(e,t){let n=t,r=n[x];n[x]=!0;try{let o=n[bt];if(O(e)){let s=e;if(o&&o.strings===s.strings){_e(o,s.values);return}o&&Wr(o,t);let i=t.firstChild;i&&i.nodeType===8&&i.data==="webjs-hydrate"&&i.remove(),n[bt]=null;let a=ui(s,t);n[bt]=a;return}if(o&&Wr(o,t),n[bt]=null,t.replaceChildren(),e==null||e===!1||e===!0)return;if(Array.isArray(e)){for(let s of e){let i=document.createTextNode(String(s??""));t.appendChild(i)}return}t.appendChild(document.createTextNode(String(e)))}finally{n[x]=r,r||Nn(n)}}function _t(e){let{strings:t}=e,n=qr.get(t);if(n)return n;let r=[],o="",s="text",i="",a=0,c="",l=0,u=null,f="",d="";for(let m=0;m<t.length;m++){let w=t[m];for(let y=0;y<w.length;y++){let p=w[y];switch(s){case"text":o+=p,p==="<"&&(s="tag-open");break;case"tag-open":o+=p,p==="!"?s="bang-1":p==="/"?(s="tag-name",f=""):/[a-zA-Z]/.test(p)?(s="tag-name",f=p.toLowerCase()):s="text";break;case"bang-1":o+=p,s=p==="-"?"bang-dash":"tag-name";break;case"bang-dash":o+=p,p==="-"?(s="comment",l=0):s="tag-name";break;case"comment":o+=p,p==="-"?l+=1:(p===">"&&l>=2&&(s="text"),l=0);break;case"tag-name":o+=p,p===">"?(s=f==="script"||f==="style"?"rawtext":"text",s==="rawtext"&&(d="")):/\s/.test(p)?s="in-tag":f+=p.toLowerCase();break;case"in-tag":o+=p,p===">"?(s=f==="script"||f==="style"?"rawtext":"text",s==="rawtext"&&(d="")):!/\s/.test(p)&&p!=="/"&&(s="attr-name",i=p,a=o.length-1);break;case"rawtext":o+=p,d=(d+p.toLowerCase()).slice(-9),(d.endsWith("<\/script>")||d.endsWith("</style>"))&&(s="text",d="",f="");break;case"attr-name":p==="="?(s="after-eq",o+=p):/\s/.test(p)?(s="in-tag",i="",o+=p):p===">"?(s="text",i="",o+=p):(i+=p,o+=p);break;case"after-eq":p==='"'||p==="'"?(s="attr-quoted",c=p,o+=p):/\s/.test(p)?(s="in-tag",i="",o+=p):p===">"?(s="text",i="",o+=p):(s="attr-unquoted",o+=p);break;case"attr-unquoted":/\s/.test(p)?(s="in-tag",i="",o+=p):(p===">"&&(s="text",i=""),o+=p);break;case"attr-quoted":o+=p,p===c&&(s="in-tag",i="");break;case"skip-attr":if(p===c){if(u){let j=u.firstPartIdx,R=[];for(let N=j;N<r.length;N++)(r[N].kind==="noop"||r[N].kind==="attr-mixed")&&R.push(N);let b=[],I=t[R[0]],Oe=I.lastIndexOf(c);b.push(Oe>=0?I.slice(Oe+1):I);for(let N=1;N<R.length;N++)b.push(t[R[N]]);let ne=t[R[R.length-1]+1],T=ne.indexOf(c);b.push(T>=0?ne.slice(0,T):ne),r[j]={kind:"attr-mixed",path:[],name:u.name,statics:b,group:R};for(let N=1;N<R.length;N++)r[R[N]]={kind:"noop",path:[],mixedAnchor:j};u=null}s="in-tag",i=""}break}}if(m<t.length-1){let y=r.length;if(s==="comment"){l=0,r.push({kind:"noop",path:[]});continue}if(s==="rawtext"){d="",r.push({kind:"noop",path:[]});continue}if(s==="text")o+=`<!--${A}${y}-->`,r.push({kind:"child",path:[]});else if(s==="in-tag"){let p=`data-${A}${y}`;o+=`${p}=""`,r.push({kind:"element",path:[]})}else if(s==="after-eq"){let p=i[0],j=i.slice(1);if(hr(p)){o=o.slice(0,a);let R=Xt[p],b=`data-${A}${y}`;o+=`${b}=""`,r.push({kind:R,path:[],name:j})}else{o=o.slice(0,a);let R=`data-${A}${y}`;o+=`${R}=""`,r.push({kind:"attr",path:[],name:i})}s="in-tag",i=""}else if(s==="attr-quoted"||s==="attr-unquoted"){o=o.slice(0,a);let p=`data-${A}${y}`;o+=`${p}=""`,u={name:i,firstPartIdx:y},r.push({kind:"noop",path:[]}),s="skip-attr"}else s==="skip-attr"&&r.push({kind:"noop",path:[]})}}let h=document.createElement("template");return h.innerHTML=o,ci(h.content,r),li(h.content,r),n={templateEl:h,parts:r},qr.set(t,n),n}function ci(e,t){let n=e.querySelectorAll("slot");for(let r of n){r.setAttribute(E,"");let o=t.length;r.setAttribute(`data-${A}${o}`,""),t.push({kind:"slot",path:[]})}}function li(e,t){let n=[];function r(o){for(let s=0;s<o.childNodes.length;s++){let i=o.childNodes[s];if(n.push(s),i.nodeType===8){let a=i.data;if(a.startsWith(A)){let c=Number(a.slice(A.length));t[c]&&t[c].kind==="child"&&(t[c].path=n.slice())}}else if(i.nodeType===1){let a=i,c=[];for(let l of a.attributes)if(l.name.startsWith(`data-${A}`)){let u=Number(l.name.slice(`data-${A}`.length));t[u]&&t[u].kind!=="child"&&(t[u].path=n.slice()),c.push(l.name)}for(let l of c)a.removeAttribute(l);r(i)}n.pop()}}r(e)}function ui(e,t){let{templateEl:n,parts:r}=_t(e),o=n.content.cloneNode(!0),s=document.createComment(`${A}s`),i=document.createComment(`${A}e`),a=r.map(u=>wt(u,o)),c=[];for(let u=0;u<e.values.length;u++)U(a[u],e.values[u],void 0,e.values),c.push(e.values[u]);t.replaceChildren(s,...o.childNodes,i);let l=t.nodeType===1&&t[S]?t:null;for(let u of a)u.kind==="slot"&&(l&&u.slotEl&&(u.slotEl[dt]=l),U(u,void 0,void 0,[]));return{strings:e.strings,bound:a,lastValues:c,startNode:s,endNode:i}}function wt(e,t){if(e.kind==="noop")return{kind:"noop",mixedAnchor:e.mixedAnchor};let n=t;for(let o of e.path)n=n.childNodes[o];if(e.kind==="child")return{kind:"child",marker:n};let r=n;if(e.kind==="event"){let o={kind:"event",el:r,name:e.name||"",handler:null,dispatcher(s){o.handler?.(s)}};return r.addEventListener(o.name,o.dispatcher),o}if(e.kind==="attr")return{kind:"attr",el:r,name:e.name||""};if(e.kind==="attr-mixed")return{kind:"attr-mixed",el:r,name:e.name||"",statics:e.statics||[],group:e.group||[]};if(e.kind==="prop")return{kind:"prop",el:r,name:e.name||""};if(e.kind==="bool")return{kind:"bool",el:r,name:e.name||""};if(e.kind==="element")return{kind:"element",el:r};if(e.kind==="slot")return{kind:"slot",slotEl:r,applied:!1};throw new Error(`unknown part kind ${e.kind}`)}function _e(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(Object.is(r,e.lastValues[n]))continue;let o=e.bound[n],s=o.mixedAnchor;o.kind==="noop"&&s!=null?U(e.bound[s],t[s],e.lastValues[s],t):U(o,r,e.lastValues[n],t),e.lastValues[n]=r}}function Wr(e,t){for(let n of e.bound){if(n.kind==="event"&&n.el.removeEventListener(n.name,n.dispatcher),n.kind==="element"){let r=n.lastTarget;if(r){if(typeof r=="function")try{r(void 0)}catch{}else typeof r=="object"&&(r.value=void 0);n.lastTarget=void 0,n.__lastEl=void 0}}if(n.kind==="slot"){let r=De(n.slotEl);r&&Hr(r,n.slotEl)}}t.replaceChildren()}function U(e,t,n,r){if(Zt(t)){let o=t.value;if(e.kind==="prop"&&e.el[e.name]===o||e.kind==="attr"&&e.el.getAttribute(e.name)===String(o)||e.kind==="bool"&&e.el.hasAttribute(e.name)===!!o)return;t=o}switch(e.kind){case"child":pi(e,t);break;case"attr":{t==null||t===!1?e.el.removeAttribute(e.name):e.el.setAttribute(e.name,String(t));break}case"prop":e.el[e.name]=t;break;case"bool":t?e.el.setAttribute(e.name,""):e.el.removeAttribute(e.name);break;case"event":e.handler=typeof t=="function"?t:null;break;case"element":di(e,t);break;case"attr-mixed":{let o=e,s=o.statics[0];for(let i=0;i<o.group.length;i++)s+=String((r?r[o.group[i]]:t)??""),s+=o.statics[i+1]||"";e.el.setAttribute(e.name,s);break}case"slot":{if(e.applied)break;let o=e.slotEl,s=()=>{let a=De(o);if(!a){e.applied=!0;return}if(!a.contains(o)){a.isConnected?queueMicrotask(s):e.applied=!0;return}if(e.applied=!0,fi(o))return;let c=document.createDocumentFragment();for(;o.firstChild;)c.appendChild(o.firstChild);o[Fe]=c,queueMicrotask(()=>z(a))},i=De(o);i&&i.contains(o)?s():queueMicrotask(s);break}case"noop":break}}function De(e){let t=e[dt];if(t&&t.isConnected)return t;let n=e.parentElement;for(;n;){if(n[S])return n;n=n.parentElement}return null}function fi(e){let t=e;for(let n=0;n<128;n++){let r=t.parentNode;if(!r||r===t)return!1;if(r.nodeType===11&&r.host)return!0;t=r}return!1}function di(e,t){let n=e,r=et(t)?t.target:void 0,o=n.__refTarget,s=r!==o;if(s&&o)if(typeof o=="function")try{o(void 0)}catch{}else typeof o=="object"&&(o.value=void 0);if(s||n.__refElement!==e.el){if(n.__refTarget=r,r)if(typeof r=="function"){if(!s&&n.__refElement!==void 0)try{r(void 0)}catch{}try{r(e.el)}catch{}}else typeof r=="object"&&(r.value=e.el);n.__refElement=e.el,e.lastTarget=r}}function pi(e,t){return Ei(e,t),B(e,t)}function B(e,t){return Vr(e.marker&&e.marker.parentNode,()=>hi(e,t))}function hi(e,t){let n=e.marker;if(Qt(t)){Q(e);let o=String(t.value??""),s=document.createElement("template");s.innerHTML=o;let i=[...s.content.childNodes],a=document.createDocumentFragment();for(let c of i)a.appendChild(c);n.parentNode?.insertBefore(a,n),e.child=i;return}if(Qe(t)){let o=t,s=e.__keyedKey;s!==void 0&&!Object.is(s,o.key)&&Q(e),e.__keyedKey=o.key,B(e,o.value);return}if(Ze(t)){let o=t,s=e.__guardDeps,i=o.deps;if(s!==void 0&&(Array.isArray(s)&&Array.isArray(i)?Ai(s,i):Object.is(s,i)))return;e.__guardDeps=Array.isArray(i)?i.slice():i,B(e,o.fn());return}if(en(t)){Q(e);let o=t.template;if(o&&o.content){let s=o.content.cloneNode(!0),i=[...s.childNodes];n.parentNode?.insertBefore(s,n),e.child=i}return}if(et(t))return;if(tt(t))return vi(e,t.value);if(nt(t))return Ci(e,t.args);if(rt(t))return Ti(e,t.signal);if(tn(t))return Ni(e,t);if(nn(t))return xi(e,t);if(Xe(t)){if(e.child&&e.child.kind==="repeat"){bi(e,t);return}Q(e);let o={kind:"repeat",map:new Map};e.child=o,yi(n,o,t);return}if(Array.isArray(t)){if(e.child&&e.child.kind==="array"){wi(e,t);return}Q(e);let o={kind:"array",items:[]};e.child=o,_i(n,o,t);return}if(e.child){let o=e.child;if(o.kind==="repeat")zr(o),e.child=void 0;else if(o.kind==="array")Gr(o),e.child=void 0;else if(o.kind==="async-stream")Qr(o),e.child=void 0;else if("strings"in e.child){let s=e.child;if(O(t)&&s.strings===t.strings){_e(s,t.values);return}we(s.startNode,s.endNode),e.child=void 0}else{for(let s of e.child)s.parentNode&&s.parentNode.removeChild(s);e.child=void 0}}if(t==null||t===!1||t===!0)return;if(O(t)){let o=t,{templateEl:s,parts:i}=_t(o),a=s.content.cloneNode(!0),c=document.createComment(`${A}s`),l=document.createComment(`${A}e`),u=i.map(h=>wt(h,a)),f=[];for(let h=0;h<o.values.length;h++)U(u[h],o.values[h],void 0,o.values),f.push(o.values[h]);let d=[c,...a.childNodes,l];n.parentNode?.insertBefore(mi(d),n);for(let h of u)h.kind==="slot"&&U(h,void 0,void 0,[]);e.child={strings:o.strings,bound:u,lastValues:f,startNode:c,endNode:l};return}let r=document.createTextNode(String(t));n.parentNode?.insertBefore(r,n),e.child=[r]}function mi(e){let t=document.createDocumentFragment();for(let n of e)t.appendChild(n);return t}function we(e,t){if(!e.parentNode)return;let n=e;for(;n&&n!==t;){let r=n.nextSibling;n.parentNode?.removeChild(n),n=r}t.parentNode===e.parentNode&&t.parentNode?.removeChild(t)}function kn(e){let{templateEl:t,parts:n}=_t(e),r=t.content.cloneNode(!0),o=document.createComment(`${A}s`),s=document.createComment(`${A}e`),i=n.map(l=>wt(l,r)),a=[];for(let l=0;l<e.values.length;l++)U(i[l],e.values[l],void 0,e.values),a.push(e.values[l]);for(let l of i)l.kind==="slot"&&U(l,void 0,void 0,[]);let c=document.createDocumentFragment();for(c.appendChild(o);r.firstChild;)c.appendChild(r.firstChild);return c.appendChild(s),{inst:{strings:e.strings,bound:i,lastValues:a,startNode:o,endNode:s},frag:c}}function Be(e){for(let t of e.bound)if(t.kind==="event"&&t.el.removeEventListener(t.name,t.dispatcher),t.kind==="element"){let n=t.lastTarget;if(n){if(typeof n=="function")try{n(void 0)}catch{}else typeof n=="object"&&(n.value=void 0);t.lastTarget=void 0,t.__lastEl=void 0}}}function yi(e,t,n){let{items:r,keyFn:o,templateFn:s}=n,i=e.parentNode;if(!i)return;let a=document.createDocumentFragment();for(let c=0;c<r.length;c++){let l=o(r[c],c),u=s(r[c],c);if(!O(u))continue;let{inst:f,frag:d}=kn(u);t.map.set(l,f),a.appendChild(d)}i.insertBefore(a,e)}function bi(e,t){let n=e.marker,r=n.parentNode;if(!r)return;let o=e.child,{items:s,keyFn:i,templateFn:a}=t,c=new Map;for(let l=0;l<s.length;l++){let u=i(s[l],l),f=a(s[l],l);if(!O(f))continue;let d=o.map.get(u);if(d&&d.strings===f.strings)_e(d,f.values),xn(d.startNode,d.endNode,r,n),c.set(u,d),o.map.delete(u);else{d&&(Be(d),we(d.startNode,d.endNode),o.map.delete(u));let{inst:h,frag:m}=kn(f);r.insertBefore(m,n),c.set(u,h)}}for(let l of o.map.values())Be(l),we(l.startNode,l.endNode);o.map=c}function zr(e){for(let t of e.map.values())Be(t),we(t.startNode,t.endNode);e.map.clear()}function gi(e){return e.type==="tpl"?e.inst.startNode:e.type==="text"?e.node:null}function gt(e){e.type==="tpl"?(Be(e.inst),we(e.inst.startNode,e.inst.endNode)):e.type==="text"&&e.node.parentNode?.removeChild(e.node)}function Kr(e){if(O(e)){let{inst:t,frag:n}=kn(e);return{item:{type:"tpl",inst:t},frag:n}}if(e!=null&&e!==!1&&e!==!0){let t=document.createTextNode(String(e));return{item:{type:"text",node:t},frag:t}}return{item:{type:"empty"},frag:null}}function _i(e,t,n){let r=e.parentNode;if(!r)return;let o=document.createDocumentFragment(),s=[];for(let i of n){let{item:a,frag:c}=Kr(i);c&&o.appendChild(c),s.push(a)}r.insertBefore(o,e),t.items=s}function wi(e,t){let n=e.marker,r=n.parentNode;if(!r)return;let o=e.child,s=o.items,i=[];for(let a=0;a<t.length;a++){let c=t[a],l=s[a];if(O(c)){let d=c;if(l&&l.type==="tpl"&&l.inst.strings===d.strings){_e(l.inst,d.values),i.push(l);continue}}else if(c!=null&&c!==!1&&c!==!0){if(l&&l.type==="text"){let d=String(c);l.node.data!==d&&(l.node.data=d),i.push(l);continue}}else{l&&gt(l),i.push({type:"empty"});continue}let{item:u,frag:f}=Kr(c);f&&r.insertBefore(f,Si(s,a,n)),l&&gt(l),i.push(u)}for(let a=t.length;a<s.length;a++)gt(s[a]);o.items=i}function Si(e,t,n){for(let r=t;r<e.length;r++){let o=gi(e[r]);if(o&&o.parentNode)return o}return n}function Gr(e){for(let t of e.items)gt(t);e.items=[]}function xn(e,t,n,r){if(t.nextSibling===r&&e.parentNode===n)return;let o=document.createDocumentFragment(),s=e;for(;s;){let i=s.nextSibling;if(o.appendChild(s),s===t)break;s=i}n.insertBefore(o,r)}function Ai(e,t){if(e===t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0}function Q(e){let t=e;if(t.__untilState&&(t.__untilState.aborted=!0,t.__untilState=void 0),t.__watchSub&&Yr(t),!e.child)return;let n=e.child;if(n.kind==="repeat")zr(n);else if(n.kind==="array")Gr(n);else if(n.kind==="async-stream")Qr(n);else if("strings"in n){let r=e.child;Be(r),we(r.startNode,r.endNode)}else for(let r of e.child)r.parentNode&&r.parentNode.removeChild(r);e.child=void 0}function Ei(e,t){let n=e;n.__untilState&&!nt(t)&&(n.__untilState.aborted=!0,n.__untilState=void 0),n.__guardDeps!==void 0&&!Ze(t)&&(n.__guardDeps=void 0),n.__cacheMap&&!tt(t)&&(n.__cacheMap=void 0),n.__keyedKey!==void 0&&!Qe(t)&&(n.__keyedKey=void 0),n.__watchSub&&!rt(t)&&Yr(n)}function vi(e,t){let n=e.marker,r=e,o=r.__cacheMap;o||(o=new Map,r.__cacheMap=o);let s=e.child;if(s&&"strings"in s){let a=s;if(O(t)&&a.strings===t.strings){_e(a,t.values);return}let c=document.createDocumentFragment();xn(a.startNode,a.endNode,c,null),o.set(a.strings,{inst:a,holder:c}),e.child=void 0}if(O(t)){let a=t,c=o.get(a.strings);if(c){o.delete(a.strings),e.child&&Q(e),xn(c.inst.startNode,c.inst.endNode,n.parentNode,n),_e(c.inst,a.values),e.child=c.inst;let l=new Set;for(let u=c.inst.startNode.nextSibling;u&&u!==c.inst.endNode;u=u.nextSibling){if(u.nodeType!==1)continue;let f=u;if(f.matches("slot[data-webjs-light]")){let d=De(f);d&&l.add(d)}for(let d of f.querySelectorAll("slot[data-webjs-light]")){let h=De(d);h&&l.add(h)}}for(let u of l)z(u);return}}B(e,t)}function Ci(e,t){let n=e,r=n.__untilState,o=n.__untilArgs,s=(d,h)=>!!(Object.is(d,h)||O(d)&&O(h)&&d.strings===h.strings),a=o&&o.length===t.length&&o.every((d,h)=>s(d,t[h]))&&r?r.highestResolved:1/0;r&&(r.aborted=!0),n.__untilArgs=t.slice();let c={aborted:!1,highestResolved:a};n.__untilState=c;let l=-1,u;for(let d=0;d<t.length;d++){let h=t[d];if(!h||typeof h.then!="function"){l=d,u=h;break}}l!==-1&&l<=c.highestResolved?(B(e,u),c.highestResolved=l):l===-1&&!n.__untilEverRendered&&B(e,""),n.__untilEverRendered=!0;let f=Math.min(l===-1?t.length:l,c.highestResolved);for(let d=0;d<f;d++){let h=t[d];!h||typeof h.then!="function"||Promise.resolve(h).then(m=>{c.aborted||d>=c.highestResolved||(c.highestResolved=d,B(e,m))},()=>{})}}function Ti(e,t){let n=e;if(n.__watchSig===t&&n.__watchSub){let s;n.__watchSub.observe(()=>{s=t.get()}),B(e,s);return}n.__watchSub&&(n.__watchSub.dispose(),n.__watchSub=void 0),n.__watchSig=t;let r=new Ie.subtle.Watcher(()=>{queueMicrotask(()=>{if(n.__watchSub!==r)return;let s;r.observe(()=>{s=t.get()}),B(e,s)})});n.__watchSub=r;let o;r.observe(()=>{o=t.get()}),B(e,o)}function Yr(e){e.__watchSub&&(e.__watchSub.dispose(),e.__watchSub=void 0,e.__watchSig=void 0)}function Ni(e,t){let n=e.child;if(n&&n.kind==="async-stream"&&n.mode==="append"&&n.iterable===t.iterable)return;Q(e);let r=t.iterable[Symbol.asyncIterator](),o={kind:"async-stream",mode:"append",aborted:!1,iterable:t.iterable,iterator:r,nodes:[]};e.child=o,Jr(o,e,t)}function xi(e,t){let n=e.child;if(n&&n.kind==="async-stream"&&n.mode==="replace"&&n.iterable===t.iterable)return;Q(e);let r=t.iterable[Symbol.asyncIterator](),o={kind:"async-stream",mode:"replace",aborted:!1,iterable:t.iterable,iterator:r,nodes:[]};e.child=o,Jr(o,e,t)}async function Jr(e,t,n){let r=t.marker,o=0;try{for(;!e.aborted;){let s=await e.iterator.next();if(e.aborted||s.done)break;let i=n.mapper?n.mapper(s.value,o):s.value,a=Xr(i);Vr(r.parentNode,()=>{if(e.mode==="replace"){for(let l of e.nodes)l.parentNode&&l.parentNode.removeChild(l);e.nodes=[]}let c=document.createDocumentFragment();for(let l of a)c.appendChild(l);r.parentNode?.insertBefore(c,r),e.nodes.push(...a)}),o++}}catch(s){typeof console<"u"&&console.error("[webjs] asyncStream error:",s)}}function Xr(e){if(e==null||e===!1||e===!0)return[];if(O(e)){let t=e,{templateEl:n,parts:r}=_t(t),o=n.content.cloneNode(!0),s=r.map(i=>wt(i,o));for(let i=0;i<t.values.length;i++)U(s[i],t.values[i],void 0,t.values);for(let i of s)i.kind==="slot"&&U(i,void 0,void 0,[]);return[...o.childNodes]}if(Array.isArray(e)){let t=[];for(let n of e)t.push(...Xr(n));return t}return[document.createTextNode(String(e))]}function Qr(e){e.aborted=!0;for(let t of e.nodes)t.parentNode&&t.parentNode.removeChild(t);e.nodes=[];try{e.iterator.return?.()?.catch?.(()=>{})}catch{}}var Zr=null;function St(e){Zr=e||null}function ki(){return Zr||void 0}var eo=Symbol.for("webjs:registry"),to=Symbol.for("webjs:classToTag"),At=globalThis,$=At[eo]||(At[eo]=new Map),no=At[to]||(At[to]=new WeakMap),Et=typeof window<"u"&&typeof customElements<"u";function jn(e,t){if(!e||typeof e!="string"||!e.includes("-"))throw new Error(`customElements.define: tag "${e}" must contain a hyphen (HTML spec)`);let n=t.lazy===!0,r=$.get(e);r?(r.cls=t,r.lazy=n):$.set(e,{cls:t,moduleUrl:null,lazy:n,tag:e}),no.set(t,e)}if(Et){let e=customElements.define.bind(customElements);customElements.define=function(t,n,r){customElements.get(t)||e(t,n,r),jn(t,n)}}if(!Et){let e=globalThis;e.customElements||(e.customElements={define(t,n){jn(t,n)},get(t){return $.get(t)?.cls},upgrade(){},whenDefined(t){let n=$.get(t);return Promise.resolve(n?.cls)}})}function Rn(e,t){Et?customElements.define(e,t):jn(e,t)}function ji(e,t){if(Et)return;let n=$.get(e);if(n){n.moduleUrl=t;return}$.set(e,{cls:null,moduleUrl:t,lazy:!1,tag:e})}function Ri(e){return $.get(e)?.cls}function Oi(e){return $.get(e)?.moduleUrl||null}function Li(e){return $.get(e)?.lazy===!0}function vt(e){return no.get(e)}function Mi(){return[...$.keys()]}He();yt();var lo=typeof window<"u"&&typeof HTMLElement<"u";function Ki(e,t){return e!==t}function Gi(){return{states:new Set,shadowRoot:null,form:null,labels:[],role:"",willValidate:!0,validity:{},validationMessage:"",setFormValue(){},setValidity(){},checkValidity(){return!0},reportValidity(){return!0}}}var Ct=class{constructor(){this.__ssrAttrs=new Map,this.__internals=null}get attributes(){return[...this.__ssrAttrs].map(([t,n])=>({name:t,value:n}))}getAttribute(t){let n=this.__ssrAttrs.get(String(t).toLowerCase());return n===void 0?null:n}setAttribute(t,n){this.__ssrAttrs.set(String(t).toLowerCase(),String(n))}removeAttribute(t){this.__ssrAttrs.delete(String(t).toLowerCase())}hasAttribute(t){return this.__ssrAttrs.has(String(t).toLowerCase())}toggleAttribute(t,n){let r=String(t).toLowerCase(),o=this.__ssrAttrs.has(r);return(n===void 0?!o:n)?(this.__ssrAttrs.set(r,""),!0):(this.__ssrAttrs.delete(r),!1)}getAttributeNames(){return[...this.__ssrAttrs.keys()]}closest(t){let n=String(t).trim().toLowerCase();if(!/^[a-z][a-z0-9-]*$/.test(n))return null;if(this.__ssrTag===n)return this;let r=this.__ssrAncestors;if(!Array.isArray(r))return null;for(let o=r.length-1;o>=0;o--)if(r[o]&&r[o].__ssrTag===n)return r[o];return null}get dataset(){if(this.__dataset)return this.__dataset;let t=this,n=r=>"data-"+String(r).replace(/[A-Z]/g,o=>"-"+o.toLowerCase());return this.__dataset=new Proxy({},{get(r,o){if(typeof o!="string")return;let s=t.getAttribute(n(o));return s===null?void 0:s},set(r,o,s){return typeof o=="string"&&t.setAttribute(n(o),s),!0},has(r,o){return typeof o=="string"&&t.hasAttribute(n(o))},deleteProperty(r,o){return typeof o=="string"&&t.removeAttribute(n(o)),!0},ownKeys(){return t.getAttributeNames().filter(r=>r.startsWith("data-")).map(r=>r.slice(5).replace(/-([a-z])/g,(o,s)=>s.toUpperCase()))},getOwnPropertyDescriptor(r,o){if(typeof o=="string"&&t.hasAttribute(n(o)))return{enumerable:!0,configurable:!0,value:t.getAttribute(n(o))}}}),this.__dataset}get className(){return this.getAttribute("class")??""}set className(t){this.setAttribute("class",t)}get hidden(){return this.hasAttribute("hidden")}set hidden(t){this.toggleAttribute("hidden",!!t)}get id(){return this.getAttribute("id")??""}set id(t){this.setAttribute("id",t)}get title(){return this.getAttribute("title")??""}set title(t){this.setAttribute("title",t)}get slot(){return this.getAttribute("slot")??""}set slot(t){this.setAttribute("slot",t)}get role(){return this.getAttribute("role")}set role(t){t==null?this.removeAttribute("role"):this.setAttribute("role",t)}get tabIndex(){let t=this.getAttribute("tabindex");return t===null?-1:Number.parseInt(t,10)||0}set tabIndex(t){this.setAttribute("tabindex",String(t))}addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}attachInternals(){if(this.__internals!==null)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return this.__internals=Gi(),this.__internals}},Yi=["ariaAtomic","ariaAutoComplete","ariaBusy","ariaChecked","ariaColCount","ariaColIndex","ariaColSpan","ariaCurrent","ariaDescription","ariaDisabled","ariaExpanded","ariaHasPopup","ariaHidden","ariaInvalid","ariaKeyShortcuts","ariaLabel","ariaLevel","ariaLive","ariaModal","ariaMultiLine","ariaMultiSelectable","ariaOrientation","ariaPlaceholder","ariaPosInSet","ariaPressed","ariaReadOnly","ariaRequired","ariaRoleDescription","ariaRowCount","ariaRowIndex","ariaRowSpan","ariaSelected","ariaSetSize","ariaSort","ariaValueMax","ariaValueMin","ariaValueNow","ariaValueText"];for(let e of Yi){let t="aria-"+e.slice(4).toLowerCase();Object.defineProperty(Ct.prototype,e,{configurable:!0,get(){return this.getAttribute(t)},set(n){n==null?this.removeAttribute(t):this.setAttribute(t,String(n))}})}var Ji=lo?HTMLElement:Ct,uo=Symbol("webjs.factoryProps"),ao=new WeakSet,Ae=class e extends Ji{static shadow=!1;static hydrate=void 0;static properties={};static styles=null;static register(t){Rn(t,this)}static get observedAttributes(){let t=this.properties||{};return Object.keys(t).filter(n=>!(typeof t[n]=="object"&&t[n].state)).map(n=>typeof t[n]=="object"&&t[n].attribute||Ln(n))}constructor(){super(),this._renderRoot=null,this._scheduled=!1,this._connected=!1,this.__controllers=new Set,this.__firstRendered=!1,this._changedProperties=new Map,this._updateResolve=null,this._updatePromise=Promise.resolve(!0),this._isUpdating=!1,this._assertFactoryProperties(),this._initializeProperties()}_assertFactoryProperties(){let t=this.constructor;if(ao.has(t))return;let n=t;for(;n&&n!==e;){if(Object.hasOwn(n,"properties")&&!Object.hasOwn(n,uo)){let r=n.name||"a component";throw new Error(`${r}: \`static properties\` is no longer supported. Declare reactive properties via the factory instead: \`class ${r} extends WebComponent({ count: Number })\`. Use the \`prop()\` helper for options (\`prop(Number, { reflect: true })\`) and set defaults in the constructor after \`super()\`. See https://docs.webjs.dev/docs/components.`)}n=Object.getPrototypeOf(n)}ao.add(t)}_initializeProperties(){let n=this.constructor.properties;if(!(!n||typeof n!="object")){this.__propValues={};for(let[r,o]of Object.entries(n)){let s=typeof o=="object"?o:{type:o},i=this[r];Object.defineProperty(this,r,{configurable:!0,enumerable:!0,get:()=>this.__propValues[r],set:a=>{let c=this.__propValues[r];(s.hasChanged||Ki)(a,c)&&(this.__propValues[r]=a,s.reflect&&!s.state&&this._connected&&this._reflectAttribute(r,a,s),this.requestUpdate(r,c))}}),i!==void 0?this.__propValues[r]=i:s.default!==void 0&&(this.__propValues[r]=typeof s.default=="function"?s.default():s.default)}}}_reflectAttribute(t,n,r){let o=r.attribute||Ln(t);if(!this.__reflectingAttribute){this.__reflectingAttribute=!0;try{if(r.converter&&r.converter.toAttribute){let s=r.converter.toAttribute(n,r.type);s==null?this.removeAttribute(o):this.setAttribute(o,s)}else r.type===Boolean?n?this.setAttribute(o,""):this.removeAttribute(o):n==null?this.removeAttribute(o):r.type===Object||r.type===Array?this.setAttribute(o,JSON.stringify(n)):this.setAttribute(o,String(n))}finally{this.__reflectingAttribute=!1}}}connectedCallback(){if(!lo)return;if(this.__webjsPropsHydrated||(this.__webjsPropsHydrated=!0,this._hydratePropAttrs()),this.constructor.hydrate==="visible"&&typeof IntersectionObserver<"u"&&!this.__hydrationActivated){this.__hydrationActivated=!1,this.__hydrationObserver=new IntersectionObserver(n=>{for(let r of n)if(r.isIntersecting){this.__hydrationObserver.unobserve(this),this.__hydrationObserver.disconnect(),this.__hydrationObserver=null,this.__hydrationActivated=!0,this._activate();return}},{rootMargin:"200px"}),this.__hydrationObserver.observe(this);return}this._activate()}_hydratePropAttrs(){let t=[],n=this.attributes;for(let r=0;r<n.length;r++){let o=n[r].name;o.startsWith("data-webjs-prop-")&&t.push(o)}for(let r of t){let o=this.getAttribute(r);if(this.removeAttribute(r),o==null)continue;let s=co(r.slice(16));try{this[s]=ce(o)}catch(i){console.warn(`[webjs] failed to decode ${r} on <${this.tagName.toLowerCase()}>: ${i&&i.message}`)}}}_activate(){this._connected=!0,this._reflectDeclaredAttributes();let t=this.constructor;if(t.shadow!==!0&&!this.hasAttribute("data-wj-host")&&this.setAttribute("data-wj-host",""),t.shadow===!0){let n=!!this.shadowRoot;this.shadowRoot||this.attachShadow({mode:"open"}),this._renderRoot=this.shadowRoot;let r=t.styles,o=Array.isArray(r)?r:Yt(r)?[r]:[];if(o.length){if(n){let s=this.shadowRoot.querySelector("style");s&&s.remove()}Jt(this._renderRoot,o)}}else this._renderRoot=this,t.styles&&console.warn(`[webjs] <${vt(t)||this.tagName?.toLowerCase()}> has static shadow = false AND static styles. static styles only works with shadow DOM (adoptedStyleSheets). For light DOM, use global CSS or <style> in render().`),Tn(this)?Fr(this):this.__isHydrating()||this.hasAttribute("data-wj-serialized")||$r(this)?(this.removeAttribute("data-wj-serialized"),V(this),xr(this)):Nr(this),Ur(this),Mr(this);for(let n of this.__controllers)n.hostConnected&&n.hostConnected();this._updateResolve===null&&(this._updatePromise=new Promise(n=>{this._updateResolve=n})),this._scheduled=!0,queueMicrotask(()=>{this._scheduled=!1;try{this._performRender()}catch(n){console.error("[webjs] lifecycle hook threw during initial render:",n)}})}__isHydrating(){let t=this.firstChild,n=t!=null&&t.nodeType===8&&t.data==="webjs-hydrate";return n&&(this.__hydratedAtActivate=!0),n}disconnectedCallback(){this._connected=!1,this.__hydrationObserver&&(this.__hydrationObserver.disconnect(),this.__hydrationObserver=null),Pr(this),this.__signalWatcher&&(this.__signalWatcher.dispose(),this.__signalWatcher=void 0);for(let t of this.__controllers)t.hostDisconnected&&t.hostDisconnected()}attributeChangedCallback(t,n,r){if(this.__reflectingAttribute)return;let s=this.constructor.properties||{},i,a;for(let[u,f]of Object.entries(s))if(((typeof f=="object"?f:{type:f}).attribute||Ln(u))===t){i=u,a=f;break}if(a===void 0&&(i=co(t),a=s[i]||s[t]),a===void 0)return;let c=typeof a=="object"?a:{type:a},l;if(c.converter&&c.converter.fromAttribute)l=c.converter.fromAttribute(r,c.type);else if(c.type===Number)l=r==null?null:Number(r);else if(c.type===Boolean)l=r!=null&&r!=="false";else if(c.type===Object||c.type===Array)try{l=r==null?null:JSON.parse(r)}catch{l=r}else l=r;this[i]!==l&&(this[i]=l,this._connected&&this.requestUpdate())}requestUpdate(t,n){t!==void 0&&!this._changedProperties.has(t)&&this._changedProperties.set(t,n),this._scheduleUpdate()}_scheduleUpdate(){this._updateResolve===null&&(this._updatePromise=new Promise(t=>{this._updateResolve=t})),!this._isUpdating&&(this._scheduled||!this._connected||(this._scheduled=!0,queueMicrotask(()=>{this._scheduled=!1;try{this._performRender()}catch(t){console.error("[webjs] lifecycle hook threw during update cycle:",t)}})))}_performRender(){if(!this._renderRoot)return;let t=this._changedProperties;this._isUpdating=!0;let n=!1,r=null;try{if(this.shouldUpdate(t)){this.willUpdate(t);for(let o of this.__controllers)o.hostUpdate&&o.hostUpdate();this.__renderToken=(this.__renderToken||0)+1,this.__renderAbort&&this.__renderAbort.abort(),this.__renderAbort=typeof AbortController<"u"?new AbortController:null,St(this.__renderAbort?this.__renderAbort.signal:null);try{let o=this.update(t);o&&typeof o.then=="function"&&(r=o)}catch(o){this._handleRenderError(o)}finally{St(null)}if(!r){for(let o of this.__controllers)o.hostUpdated&&o.hostUpdated();n=!0}}}catch(o){console.error("[webjs] lifecycle hook threw during update phase:",o)}finally{this._isUpdating=!1,(n||r)&&(this._changedProperties=new Map)}if(r){let o=this.__renderToken;this.__pendingAsyncCommits=(this.__pendingAsyncCommits||0)+1,r.then(()=>{if(this.__pendingAsyncCommits--,o===this.__renderToken){for(let s of this.__controllers)s.hostUpdated&&s.hostUpdated();this._postCommit(t)}});return}n?this._postCommit(t):this.__pendingAsyncCommits||this._resolveUpdate()}_resolveUpdate(){if(this._updateResolve){let t=this._changedProperties.size===0;this._updateResolve(t),this._updateResolve=null}}performServerUpdate(){let t=this._changedProperties;this._isUpdating=!0;try{this.willUpdate(t);for(let n of this.__controllers)n.hostUpdate&&n.hostUpdate();this._reflectDeclaredAttributes()}finally{this._isUpdating=!1}}_reflectDeclaredAttributes(){let t=this.constructor.properties||{};for(let n of Object.keys(t)){let r=t[n];!r||!r.reflect||r.state||this._reflectAttribute(n,this[n],r)}}shouldUpdate(t){return!0}willUpdate(t){}update(t){this.__signalWatcher||(this.__signalWatcher=new Ie.subtle.Watcher(()=>{this._connected&&this.requestUpdate()}));let n;if(this.__signalWatcher.observe(()=>{n=this.render()}),n&&typeof n.then=="function")return this._commitAsync(n);Se(n,this._renderRoot)}_commitAsync(t){let n=this.__renderToken;if(this.__firstRendered&&this._overridesRenderFallback())try{let r=this.renderFallback();r!==void 0&&Se(r,this._renderRoot)}catch(r){console.error("[webjs] renderFallback() threw:",r)}return Promise.resolve(t).then(r=>{n===this.__renderToken&&Se(r,this._renderRoot)},r=>{n===this.__renderToken&&this._handleRenderError(r instanceof Error?r:new Error(String(r)))})}_overridesRenderFallback(){return this.renderFallback!==Tt.prototype.renderFallback}_handleRenderError(t){console.error(`[webjs] render error in <${vt(this.constructor)||this.tagName?.toLowerCase()}>:`,t);try{let n=this.renderError(t);n!==void 0&&Se(n,this._renderRoot)}catch(n){console.error("[webjs] renderError() also threw:",n)}}_postCommit(t){try{this.__firstRendered||(this.__firstRendered=!0,this.firstUpdated(t)),this.updated(t)}catch(n){console.error("[webjs] lifecycle hook threw during post-commit phase:",n)}finally{this._resolveUpdate()}}updated(t){}firstUpdated(t){}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._updatePromise}addController(t){this.__controllers.add(t),this._connected&&t.hostConnected&&t.hostConnected()}removeController(t){this.__controllers.delete(t)}render(){return""}renderError(t){}renderFallback(){}};function Ln(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function co(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Tt(e){return new.target?Reflect.construct(Ae,arguments,new.target):class extends Ae{static properties=e;static[uo]=!0}}Object.setPrototypeOf(Tt,Ae);Tt.prototype=Ae.prototype;function Xi(e,t={}){return e&&typeof e=="object"&&!("call"in e)&&(t=e,e=void 0),{...e?{type:e}:{},...t}}var fo=Symbol.for("webjs.notFound"),po=Symbol.for("webjs.redirect"),ho=Symbol.for("webjs.forbidden"),mo=Symbol.for("webjs.unauthorized");function Qi(){let e=new Error("webjs: notFound()");throw e.__webjs=fo,e}function Zi(){let e=new Error("webjs: forbidden()");throw e.__webjs=ho,e}function ea(){let e=new Error("webjs: unauthorized()");throw e.__webjs=mo,e}function ta(e,t){let n=typeof t=="object"&&t!==null?t.status:t,r=new Error(`webjs: redirect(${e})`);throw r.__webjs=po,r.url=e,r.status=typeof n=="number"?n:void 0,r}function na(e){return!!e&&e.__webjs===fo}function ra(e){return!!e&&e.__webjs===po}function oa(e){return!!e&&e.__webjs===ho}function sa(e){return!!e&&e.__webjs===mo}var yo=null;function ia(){if(!yo)return"";try{return yo()||""}catch{return""}}var tl=Symbol.for("webjs.suspense");function aa(e){return{_$webjsSuspense:!0,fallback:e.fallback,children:e.children}}function ca(e){return!!e&&typeof e=="object"&&e._$webjsSuspense===!0}function la(e,t={}){let n=t.reconnect!==!1,r=0,o=!1,s=null,i=[];function a(){o||(s=new WebSocket(ua(e),t.protocols),s.onopen=c=>{for(r=0;i.length&&s&&s.readyState===WebSocket.OPEN;)s.send(i.shift());t.onOpen?.(c)},s.onmessage=c=>{let l=c.data;if(typeof l=="string")try{l=JSON.parse(l)}catch{}t.onMessage?.(l,c)},s.onerror=c=>{t.onError?.(c)},s.onclose=c=>{if(t.onClose?.(c),!o&&n){let l=Math.min(1e3*2**r++,3e4);setTimeout(a,l)}})}return a(),{send(c){let l=typeof c=="string"||c instanceof ArrayBuffer||ArrayBuffer.isView(c)?c:JSON.stringify(c);s&&s.readyState===WebSocket.OPEN?s.send(l):i.push(l)},close(c,l){o=!0;try{s?.close(c,l)}catch{}},get socket(){return s},get readyState(){return s?.readyState??3}}}function ua(e){if(/^wss?:\/\//i.test(e))return e;let t=typeof location<"u"&&location.protocol==="https:"?"wss:":"ws:",n=typeof location<"u"?location.host:"";return`${t}//${n}${e.startsWith("/")?e:"/"+e}`}He();var Mn="application/vnd.webjs+json";async function fa(e,t={}){let n=new Headers(t.headers||{});n.has("accept")||n.set("accept",Mn);let r=t.body;r!=null&&typeof r=="object"&&!(r instanceof FormData)&&!(r instanceof Blob)&&!(r instanceof ArrayBuffer)&&!(r instanceof URLSearchParams)&&!(typeof ReadableStream<"u"&&r instanceof ReadableStream)&&!ArrayBuffer.isView(r)&&(r=await On(r),n.has("content-type")||n.set("content-type",Mn));let o=await fetch(e,{...t,headers:n,body:r}),s=o.headers.get("content-type")||"",i=await o.text(),a=s.includes(Mn)?i?ce(i):null:s.includes("application/json")?i?JSON.parse(i):null:i;if(!o.ok){let c=a&&a.error||`richFetch ${e} -> ${o.status}`,l=new Error(c);throw l.status=o.status,l.body=a,l}return a}He();xt();xt();Fn();kt();var lr=class{constructor(t,n){this.host=t,this.options=n,this.updates=[],this._nextId=0}get value(){let t=this.options.source();if(!this.options.update)return this.updates.length>0?this.updates[this.updates.length-1].payload:t;for(let n of this.updates)t=this.options.update(t,n.payload);return t}add(t,n){let r=`opt-${++this._nextId}`;this.updates.push({id:r,payload:t}),this.host?.requestUpdate?.();let o=()=>{let s=this.updates.findIndex(i=>i.id===r);s!==-1&&(this.updates.splice(s,1),this.host?.requestUpdate?.())};return n&&typeof n.then=="function"&&(typeof n.finally=="function"?n.finally(()=>o()).catch(()=>{}):n.then(()=>o(),()=>o())),o}};async function nc(e,t,n){let r=e.get();e.set(t);let o;try{o=await n()}catch(s){throw e.set(r),s}return o&&o.success===!1&&e.set(r),o}function rc(e,t,n){return e&&typeof e.get=="function"&&typeof e.set=="function"?nc(e,t,n):new lr(e,t)}Un();var zt=0,fs=new Map,Re=new Map,oc=1e3;function sc(e){if(!(!Array.isArray(e)||!e.length)){zt+=1;for(let t of e)t&&fs.set(t,zt)}}function ic(){return zt}function ac(e,t,n){if(!(!Array.isArray(t)||!t.length)&&(Re.delete(e),Re.set(e,{tags:t.slice(),since:typeof n=="number"?n:zt}),Re.size>oc)){let r=Re.keys().next().value;r!==void 0&&Re.delete(r)}}function cc(e){let t=Re.get(e);if(!t)return!1;for(let n of t.tags)if((fs.get(n)||0)>t.since)return!0;return!1}function lc(e){return e?e.split(",").map(t=>t.trim()).filter(Boolean):[]}var uc="application/vnd.webjs+stream",fc=1,dc=2,pc=3,ds=new Uint8Array(0);function hc(e,t){let n=t||ds,r=n.length,o=new Uint8Array(5+r);return o[0]=e&255,o[1]=r>>>24&255,o[2]=r>>>16&255,o[3]=r>>>8&255,o[4]=r&255,r&&o.set(n,5),o}function mc(){let e=ds;return{push(t){if(t&&t.length){let r=new Uint8Array(e.length+t.length);r.set(e,0),r.set(t,e.length),e=r}let n=[];for(;e.length>=5;){let r=e[0],o=(e[1]<<24|e[2]<<16|e[3]<<8|e[4])>>>0;if(e.length<5+o)break;let s=e.slice(5,5+o);n.push({type:r,payload:s}),e=e.slice(5+o)}return n}}}var yc=Symbol.for("webjs.context");function bc(e){return{__context__:yc,name:e}}var Kt=class extends Event{constructor(t,n,r=!1){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.callback=n,this.subscribe=r}},ur=class{constructor(t,{context:n,initialValue:r}){this._host=t,this._context=n,this._value=r,this._subscriptions=new Set,this._onRequest=o=>{let s=o;if(s.context===this._context)if(o.stopPropagation(),s.subscribe){let i={callback:s.callback},a=()=>{this._subscriptions.delete(i)};this._subscriptions.add(i),s.callback(this._value,a)}else s.callback(this._value)},typeof t.addController=="function"&&t.addController(this)}get value(){return this._value}setValue(t){if(!Object.is(this._value,t)){this._value=t;for(let n of this._subscriptions){let r=()=>{this._subscriptions.delete(n)};n.callback(t,r)}}}hostConnected(){this._host.addEventListener("context-request",this._onRequest)}hostDisconnected(){this._host.removeEventListener("context-request",this._onRequest),this._subscriptions.clear()}},fr=class{constructor(t,{context:n,subscribe:r=!0}){this._host=t,this._context=n,this._subscribe=r,this._value=void 0,this._unsubscribe=void 0,typeof t.addController=="function"&&t.addController(this)}get value(){return this._value}hostConnected(){this._dispatchRequest()}hostDisconnected(){this._unsubscribe&&(this._unsubscribe(),this._unsubscribe=void 0)}_dispatchRequest(){let t=new Kt(this._context,(n,r)=>{let o=this._value;this._value=n,r&&(this._unsubscribe=r),!Object.is(o,n)&&typeof this._host.requestUpdate=="function"&&this._host.requestUpdate()},this._subscribe);this._host.dispatchEvent(t)}};function gc(){return typeof window<"u"}var K={INITIAL:0,PENDING:1,COMPLETE:2,ERROR:3},dr=class{constructor(t,{task:n,args:r,autoRun:o=!0}){this._host=t,this._taskFn=n,this._argsFn=r||(()=>[]),this._autoRun=o,this._status=K.INITIAL,this._value=void 0,this._error=void 0,this._abortController=null,this._prevArgs=null,typeof t.addController=="function"&&t.addController(this)}get status(){return this._status}get value(){return this._value}get error(){return this._error}async run(){this.abort();let t=new AbortController;this._abortController=t;let n=this._argsFn();this._prevArgs=n,this._status=K.PENDING,this._error=void 0,this._requestHostUpdate();try{let r=await this._taskFn(...n,{signal:t.signal});if(t.signal.aborted)return;this._value=r,this._status=K.COMPLETE,this._error=void 0}catch(r){if(t.signal.aborted)return;this._error=r,this._status=K.ERROR,this._value=void 0}finally{this._abortController===t&&(this._abortController=null)}this._requestHostUpdate()}abort(){this._abortController&&(this._abortController.abort(),this._abortController=null)}render(t={}){switch(this._status){case K.INITIAL:return t.initial?.();case K.PENDING:return t.pending?.();case K.COMPLETE:return t.complete?.(this._value);case K.ERROR:return t.error?.(this._error);default:return}}hostUpdate(){if(!this._autoRun||!gc())return;let t=this._argsFn();this._argsEqual(this._prevArgs,t)||this.run()}hostUpdated(){}hostConnected(){}hostDisconnected(){this.abort()}_requestHostUpdate(){typeof this._host.requestUpdate=="function"&&this._host.requestUpdate()}_argsEqual(t,n){if(t===null||t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==n[r])return!1;return!0}};export{fr as ContextConsumer,ur as ContextProvider,Kt as ContextRequestEvent,fc as FRAME_CHUNK,dc as FRAME_END,pc as FRAME_ERROR,A as MARKER,To as SEED_MISS,uc as STREAM_CONTENT_TYPE,Ie as Signal,aa as Suspense,dr as Task,K as TaskStatus,Tt as WebComponent,Pn as WebjsFrame,Dn as WebjsStream,ki as activeActionSignal,Jt as adoptStyles,Mi as allTags,js as asyncAppend,Rs as asyncReplace,$s as batch,xs as cache,qs as computed,la as connectWS,cc as consumeStale,bc as createContext,mc as createFrameDecoder,Ns as createRef,ia as cspNonce,bs as css,so as deserialize,Ro as disableClientRouter,Vs as effect,Xn as enableClientRouter,hc as encodeFrame,ws as escapeAttr,_s as escapeText,ic as fetchMark,Zi as forbidden,vs as guard,ys as html,tn as isAsyncAppend,nn as isAsyncReplace,Yt as isCSS,tt as isCache,oa as isForbidden,Ze as isGuard,Qe as isKeyed,Li as isLazy,Zt as isLive,na as isNotFound,ra as isRedirect,et as isRef,Xe as isRepeat,Ws as isSignal,ca as isSuspense,O as isTemplate,en as isTemplateContent,sa as isUnauthorized,Qt as isUnsafeHTML,nt as isUntil,rt as isWatch,Es as keyed,As as live,Ri as lookup,Oi as lookupModuleUrl,sc as markStale,Oo as navigate,Qi as notFound,rc as optimistic,ce as parse,lc as parseTagHeader,ji as primeModuleUrl,Xi as prop,ta as redirect,Ts as ref,Rn as register,ac as registerKeyTags,Se as render,Bn as renderStream,yr as repeat,Lo as revalidate,fa as richFetch,jt as scanSeeds,oo as serialize,St as setActiveActionSignal,Hs as signal,On as stringify,gs as stylesToString,vt as tagOf,ga as takeSeed,Cs as templateContent,ea as unauthorized,Ss as unsafeHTML,ks as until,Os as watch};
4
4
  //# sourceMappingURL=webjs-core-browser.js.map