@webjsdev/core 0.7.58 → 0.7.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/webjs-core-browser.js +4 -4
- package/dist/webjs-core-browser.js.map +2 -2
- package/dist/webjs-core-testing.js +13 -13
- package/dist/webjs-core-testing.js.map +2 -2
- package/dist/webjs-core.js +5 -5
- package/dist/webjs-core.js.map +2 -2
- package/package.json +1 -1
- package/src/attribute-reader.js +55 -7
- package/src/component/lifecycle.js +7 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var gc=Object.defineProperty;var w=(e,t)=>()=>(e&&(t=e(e=0)),t);var os=(e,t)=>{for(var n in t)gc(e,n,{get:t[n],enumerable:!0})};function Kt(e){return Object.prototype.hasOwnProperty.call(bo,e)}var bo,yo=w(()=>{bo=Object.freeze({"@":"event",".":"prop","?":"bool"})});function Ac(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function is(e){return String(e).replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<")}var go=w(()=>{});function wo(e){if(typeof e!="function")return null;let t=e[ss];return typeof t=="string"&&t?t:null}function Zn(e,t,n){if(typeof e!="function")return!1;let r=String(t).toLowerCase(),o=String(n||"").toLowerCase();return r==="action"?o==="form":r==="formaction"?o==="button"||o==="input":!1}function as(e,t,n=!0){if(!e||e===I&&n)return;let r=e===I?'a second "name" attribute':`name="${e}"`;throw new Error(`[webjs] formaction=\${action} on <${t||"button"}> cannot be used when the element already carries a "name" attribute (found ${r}). The action identity is submitted as the button's own name/value pair, so there is no room for a second one. Move the action to the enclosing <form action=\${action}> or drop the submitter's "name".`)}function cs(e,t){let n=String(e||"").toLowerCase(),r=t==null?null:String(t).toLowerCase();if(vc(n,r)){if(n==="input"&&r==="image")throw new Error('[webjs] formaction=${action} is not supported on <input type="image"> because image submitters submit coordinate pairs (name.x/name.y) instead of name=value, so the action identity would never arrive. Use a <button> instead.');if(n==="input")throw new Error('[webjs] formaction=${action} is not supported on <input type="submit"> because the action identity has to occupy the submitter\'s "value", which on this control is also its visible label, so the button would render captioned with the action\'s id and could not be given a real one. Use <button formaction=${action}>Publish</button>, whose label is its children.');return}throw new Error(`[webjs] formaction=\${action} on <${n}>${r?` type="${r}"`:""} requires a submitter control, and formaction is inert on anything else. Use <button formaction=\${action}>.`)}function vc(e,t){let n=t==null?null:String(t).toLowerCase();return e==="button"?n==null||n===""||n==="submit":e==="input"?n==="submit"||n==="image":!1}function ls(e){throw new Error(`[webjs] formaction=\${action} on <${e||"button"}> cannot be used when the element already carries a "value" attribute. The action identity is submitted as the button's own name/value pair, so both halves are taken. Drop the "value", or dispatch on it from one form-level action instead.`)}function us(e){throw new Error(`[webjs] a bound formaction=\${action} on <${e||"button"}> cannot also carry a plain formaction attribute: the two name different targets and the renderers resolve them differently. Drop the static attribute.`)}function fs(e){throw new Error(`[webjs] formaction=\${action} on <${e||"button"}> cannot be used with a "form" attribute, which re-points the submitter at a form other than the bound one it sits in. Keep the submitter inside its bound <form>.`)}function ds(e,t){if(e)throw new Error(`[webjs] two formaction=\${action} holes were found on one <${t||"button"}>. Only one can win, and the two renderers pick differently, so bind exactly one action per submitter.`)}function ps(e,t){let r=(e||[]).filter(o=>_o(o))[0];if(r)throw new Error(`[webjs] a <${t||"button"}> submitter binds .${r}=. That property is a reflected IDL attribute on a submitter, so a property binding is dropped at SSR and written to the attribute in the browser: the page would render on the server and throw on hydration. Write it as a plain attribute.`)}function _o(e){let t=String(e).toLowerCase();return t==="name"||t==="value"||t==="formaction"||t==="formmethod"||t==="formenctype"}function xc(e,t,n){let r=t==null?null:String(t),o=n==null?null:String(n);if(r!=null&&/^dialog$/i.test(r))throw new Error(`[webjs] formaction=\${action} on <${e}> cannot be combined with formmethod="dialog", which dismisses a <dialog> instead of submitting, so the bound action would never run. Drop one of the two.`);if(r!=null&&!/^post$/i.test(r))throw new Error(`[webjs] <${e} formmethod="${r}" formaction=\${action}> cannot work: a bound server action is submitted as a POST body, and a "${r}" submission sends none, so the action would never run. Drop the formmethod attribute (WebJs emits formmethod="post" on a bound submitter), or drop the binding.`);if(o!=null&&!ms.has(o.toLowerCase()))throw new Error(`[webjs] <${e} formenctype="${o}" formaction=\${action}> cannot work: a form submission is parsed as multipart/form-data or application/x-www-form-urlencoded, and a "${o}" body is neither, so the bound action could never read it. Drop the formenctype attribute (WebJs emits multipart/form-data on a bound submitter).`)}function zt(e,t,n){if(er(e)&&Oc(t))throw new Error(Lc(t,n))}function hs(e,t,n){Rc(t,n)&&zt(e,t,n)}function So(e,t){if(e)return e;let n=t==="button"||t==="input"?"formaction=":"action=";throw new Error(`[webjs] the function in ${n} on <${t||"form"}> is not a server action. Only a function imported from a 'use server' *.server.{js,ts} module can be bound to a form or a submitter, because the identity the browser submits has to resolve back to something the server can run. Move the handler into a server action and import it, or pass a url string.`)}function Ec(e,t){if(e!=null&&!/^post$/i.test(e))throw new Error(`[webjs] <form method="${e}" action=\${action}> cannot work: a bound server action is submitted as a POST body, and a "${e}" form sends no body. Drop the method attribute (WebJs emits method="post") or remove the bound action.`);if(t!=null&&!ms.has(t.toLowerCase()))throw new Error(`[webjs] <form enctype="${t}" action=\${action}> cannot work: a form submission is parsed as multipart/form-data or application/x-www-form-urlencoded, and a "${t}" body is neither, so the submission would run under JS and do nothing without it. Drop the enctype attribute (WebJs emits multipart/form-data).`)}function Tc(e){if(e.duplicateAction)throw new Error("[webjs] two action=${...} holes were found on one <form>. A form can carry only one action binding. Move one to a submit button's formaction=${action} or remove the duplicate.");if(e.staticAction)throw new Error('[webjs] a bound <form action=${action}> also carries a plain action="..." attribute. A bound form posts to the page\'s own url, so the two say different things: without JS the browser would post to the written url and with JS it would not. Drop the action attribute, or drop the binding.');let t=e.propAttrs&&e.propAttrs[0];if(t)throw new Error(`[webjs] a bound <form action=\${action}> also binds .${t}=. A property binding on a native element is dropped at SSR and applied in the browser, so the form would submit one way with JS and another way without it. Write it as a plain attribute.`)}function Nc(e,t){let n=e!==z&&e!=null,r=t!==z&&t!=null;return Ec(n?e:null,r?t:null),{method:n?null:"post",enctype:r?null:"multipart/form-data"}}function bs(e,t,n){let r=t!==z&&t!=null,o=n!==z&&n!=null;return xc(e,r?t:null,o?n:null),{formMethod:r?null:"post",formEnctype:o?null:"multipart/form-data"}}function ys(e,t,n,r,o){let i=typeof t=="function"?wo(t):null;if(!i){typeof t=="function"&&So(null,e.localName),kc(e,n,r,o.propAttrs);return}Tc(o);let s=Nc(n,r);e.removeAttribute("action"),Vt(e,"method",n,s.method),Vt(e,"enctype",r,s.enctype),Cc(e,i)}function Vt(e,t,n,r){if(r!==null){e.setAttribute(t,r);return}n!==z&&e.getAttribute(t)!==n&&e.setAttribute(t,n)}function Cc(e,t){let n=e.firstElementChild,r=n&&n.localName==="input"&&n.getAttribute("name")===I?n:null;if(!r){for(let o of e.children)if(o.localName==="input"&&o.getAttribute("name")===I){r=o;break}}r||(r=e.ownerDocument.createElement("input"),r.setAttribute("type","hidden"),r.setAttribute("name",I),e.insertBefore(r,e.firstChild)),r.getAttribute("value")!==t&&r.setAttribute("value",t)}function kc(e,t,n,r){let o=e.firstElementChild;if(o&&o.localName==="input"&&o.getAttribute("name")===I)o.remove();else for(let s of e.children)if(s.localName==="input"&&s.getAttribute("name")===I){s.remove();break}let i=s=>(r||[]).some(a=>{let c=String(a).toLowerCase();return c===s||s==="enctype"&&c==="encoding"});t===z&&!i("method")&&e.removeAttribute("method"),n===z&&!i("enctype")&&e.removeAttribute("enctype")}function gs(e,t,n,r){let o=i=>(r||[]).some(s=>String(s).toLowerCase()===i);t===z&&!o("formmethod")&&e.removeAttribute("formmethod"),n===z&&!o("formenctype")&&e.removeAttribute("formenctype")}function Rc(e,t){let n=String(e).toLowerCase();Kt(n[0])&&(n=n.slice(1));let r=String(t||"").toLowerCase();return n==="action"?r==="form":n==="formaction"?r==="button"||r==="input":!1}function er(e,t){if(typeof e=="function")return!0;if(!Array.isArray(e))return!1;let n=t||new Set;return n.has(e)?!1:(n.add(e),e.some(r=>er(r,n)))}function Oc(e){let t=String(e).toLowerCase();return Kt(t[0])&&(t=t.slice(1)),t==="action"||t==="formaction"}function Lc(e,t){return`[webjs] a function was interpolated into ${String(e).toLowerCase()}= on <${t||"form"}>. Stringifying a function into HTML would leak its source (a 'use server' action's body included) to every visitor, so this is refused. To run a server action from a form, write an unquoted action=\${action} on the <form> itself or a formaction=\${action} on a <button> inside a bound form. Anywhere else, pass a URL string.`}var I,ss,ms,z,_e=w(()=>{yo();go();I="__webjs_action",ss="$$webjsAction";ms=new Set(["multipart/form-data","application/x-www-form-urlencoded"]);z=Symbol("webjs.attr.absent")});var _,S,O,M,To,Se,De,No,Ss,C,Co,ie,A,Ae=w(()=>{_=Symbol("webjs.slot.state"),S="data-webjs-light",O="data-projection",M="actual",To="fallback",Se=Symbol("webjs.slot.fallbackFrag"),De=Symbol("webjs.slot.templateOwner"),No="data-wj-slot-owner",Ss=64,C=Symbol("webjs.slot.rendering"),Co=Symbol("webjs.slot.intercepted"),ie=Symbol("webjs.slot.park"),A=new WeakSet});function F(e){let t=e,n=t[_];return n||(n={host:e,authored:[],assignedByName:new Map,lastSnapshot:new WeakMap},t[_]=n),n}function Gt(e){return!!e[_]}function ko(e){let t=F(e);for(;e.firstChild;){let n=e.firstChild;t.authored.push(n),A.add(n),e.removeChild(n)}se(t)}function se(e){let t=e.assignedByName;t.clear();for(let n of e.authored)Kc(t,ve(e,n),n)}function ve(e,t){let n=Jt(e,t);if(n)return H(n.getAttribute("name"));if(e.adoptedKey){let r=e.adoptedKey.get(t);if(r!==void 0)return r}return As(t)}function Ro(e){let t=F(e);t.adopted=!0;let n=new Set,r=e.querySelectorAll(`slot[${S}]`);for(let o of r){let i=o;if(!$(e,i)||i.getAttribute(O)!==M||ut(t,e,i))continue;let s=H(i.getAttribute("name"));if(!n.has(s)){n.add(s);let a=Array.from(i.childNodes);for(let c of a)t.authored.push(c),As(c)!==s&&(t.adoptedKey||(t.adoptedKey=new WeakMap),t.adoptedKey.set(c,s));t.lastSnapshot.set(i,a.slice())}}for(let o of e.querySelectorAll("wj-slot-park"))if($(e,o)){for(let i of Array.from(o.childNodes))A.add(i),t.authored.push(i);o.remove()}se(t)}function H(e){return e==null||e===""||e==="default"?null:e}function As(e){return e.nodeType!==1?null:H(e.getAttribute("slot"))}function Kc(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}var $e=w(()=>{Ue();Yt();He();Ae()});function vs(){ae||!G||(ae=Node.prototype.appendChild,Oo=Node.prototype.insertBefore,xe=Node.prototype.removeChild,cr=Node.prototype.replaceChild,Lo=Element.prototype.append,jo=Element.prototype.prepend,Po=Element.prototype.replaceChildren,Xt=Object.getOwnPropertyDescriptor(Element.prototype,"innerHTML"),lr=Object.getOwnPropertyDescriptor(Node.prototype,"textContent"))}function qe(e,t){let n=e[C];e[C]=!0;try{return t()}finally{e[C]=n,n||ur(e)}}function Io(e){if(!G)return;let t=e,n=F(e);n.backstop||(n.backstop=new MutationObserver(r=>Qt(e,n,r)),n.backstop.observe(e,{childList:!0,subtree:!1}),n.flipSensor=new MutationObserver(r=>xs(e,r)),n.flipSensor.observe(e,{attributes:!0,attributeFilter:["slot","name"],subtree:!0}))}function Qt(e,t,n){let r=e,o=r[ie],i=r[Symbol.for("webjs.instance")],s=!1,a=new Set;for(let c of n){for(let l of c.addedNodes)if(a.add(l),l!==o&&!(i&&Bo(i,l))){if(t.authored.indexOf(l)!==-1){s=!0;continue}A.add(l),t.authored.push(l),s=!0}for(let l of c.removedNodes){let u=t.authored.indexOf(l);if(u===-1||e.contains(l))continue;A.has(l)&&l.parentNode==null&&!a.has(l)||(t.authored.splice(u,1),s=!0)}}s&&W(e)}function ur(e){let t=e,n=t[_];if(!(n&&n.backstop))return;let r=n.backstop.takeRecords();(!(Symbol.for("webjs.instance")in t)||t[Symbol.for("webjs.instance")])&&Qt(e,n,r)}function xs(e,t){let n=e[_];if(!n)return;let r=!1;for(let o of t){if(o.type!=="attributes")continue;let i=o.target;o.attributeName==="name"?i.tagName==="SLOT"&&i.hasAttribute(S)&&$(e,i)&&(r=!0):o.attributeName==="slot"&&(n.adoptedKey&&n.adoptedKey.delete(i),n.authored.indexOf(i)!==-1&&(r=!0))}r&&W(e)}function Mo(e){let t=e[_];t&&(t.backstop&&(Qt(e,t,t.backstop.takeRecords()),t.backstop.disconnect(),t.backstop=void 0),t.flipSensor&&(xs(e,t.flipSensor.takeRecords()),t.flipSensor.disconnect(),t.flipSensor=void 0))}function Fo(e){if(!G)return;let t=e,n=t[_];if(!n)return;let r=t[Symbol.for("webjs.instance")],o=Symbol.for("webjs.instance")in t,i=!o&&n.adopted===!0,s=!1;for(let a of Array.from(e.childNodes))if(a!==t[ie]){if(n.authored.indexOf(a)!==-1){s=!0;continue}o&&(!r||Bo(r,a))||!o&&i||(A.add(a),n.authored.push(a),s=!0)}s&&W(e)}var ae,Oo,xe,cr,Lo,jo,Po,Xt,lr,fr=w(()=>{Ue();Yt();He();Zt();$e();Ae();ae=null,Oo=null,xe=null,cr=null,Lo=null,jo=null,Po=null,Xt=null,lr=null});function Bo(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 Es(e){let t=e,n=t[ie];return(!n||!n.isConnected)&&(n||(n=e.ownerDocument.createElement("wj-slot-park"),n.setAttribute("hidden",""),n.style.display="none",t[ie]=n),qe(e,()=>ae.call(e,n))),n}function We(e){return e instanceof Node||!!(e&&typeof e=="object"&&e.ownerDocument&&e.ownerDocument.defaultView&&e instanceof e.ownerDocument.defaultView.Node)}function Do(e,t,n){if(n&&!We(t))return[e.ownerDocument.createTextNode(`${t}`)];if(!We(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);dr(e,r);for(let o of r)xe.call(t,o);return r}return dr(e,[t]),[t]}function dr(e,t){ft(e,t);for(let n of t){if(!We(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 ft(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 $o(e,t,n){let r=e.authored;for(let i of t){let s=r.indexOf(i);s!==-1&&r.splice(s,1)}let o=n==null?r.length:r.indexOf(n);o===-1&&(o=r.length),r.splice(o,0,...t)}function qo(e,t){let n=e[_];return n?ut(n,e,t):!1}function ut(e,t,n){for(let r=n;r&&r!==t;r=r.parentNode)if(e.authored.indexOf(r)!==-1)return!0;return!1}function Ho(e,t){if(A.has(t))return!0;let n=t.parentNode;if(n==null)return!1;if(n===e||n===e[ie])return!0;let r=e[_];return n.nodeType===1&&n.tagName==="SLOT"&&n.hasAttribute(S)&&(r&&r.lastSnapshot.has(n)||e.contains(n)&&$(e,n))}function Uo(e,t){let n=[];for(let i of t)We(i)?i.nodeType===11?n.push({frag:i}):n.push({node:i}):n.push({text:`${i}`});for(let i of n)i.frag?ft(e,Array.from(i.frag.childNodes)):i.node&&dr(e,[i.node]);let r=e.ownerDocument.createDocumentFragment();for(let i of n)if(i.text!==void 0)ae.call(r,e.ownerDocument.createTextNode(i.text));else if(i.frag){let s=Array.from(i.frag.childNodes);dr(e,s);for(let a of s)ae.call(r,a)}else i.node&&(ft(e,[i.node]),ae.call(r,i.node));let o=Array.from(r.childNodes);ft(e,o);for(let i of o)xe.call(r,i);return o}function be(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);se(t),W(e)}function Wo(e){if(!G)return;let t=e;if(t[Co])return;vs(),t[Co]=!0;let n=F(e);t.appendChild=function(r){if(t[C])return ae.call(this,r);let o=Do(e,r,!1);for(let i of o)A.add(i);return $o(n,o,null),be(e,n,o),r},t.insertBefore=function(r,o){if(t[C])return Oo.call(this,r,o);if(!We(r))throw new TypeError("Failed to execute insertBefore on the host: parameter 1 is not of type Node.");if(o!=null&&!We(o))throw new TypeError("Failed to execute insertBefore on the host: parameter 2 is not of type Node.");if(ft(e,r.nodeType===11?Array.from(r.childNodes):[r]),o!=null&&(n.authored.indexOf(o)===-1||!Ho(e,o)))throw new DOMException("insertBefore: reference node is not an assigned child of this host","NotFoundError");if(r===o)return r;let i=Do(e,r,!1);for(let s of i)A.add(s);return $o(n,i,o||null),be(e,n,i),r},t.removeChild=function(r){if(t[C])return xe.call(this,r);let o=n.authored.indexOf(r);if(o===-1)return xe.call(this,r);if(!Ho(e,r))throw new DOMException("removeChild: the node is not an assigned child of this host","NotFoundError");return n.authored.splice(o,1),be(e,n,[r]),r},t.replaceChild=function(r,o){if(t[C])return cr.call(this,r,o);if(n.authored.indexOf(o)===-1)return cr.call(this,r,o);if(!We(r))throw new TypeError("Failed to execute replaceChild on the host: parameter 1 is not of type Node.");if(ft(e,r.nodeType===11?Array.from(r.childNodes):[r]),!Ho(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 s=Do(e,r,!1);for(let c of s)A.add(c);for(let c of s){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,...s),be(e,n,[...s,o]),o},t.append=function(...r){if(t[C])return Lo.apply(this,r);let o=Uo(e,r);for(let i of o)A.add(i);$o(n,o,null),be(e,n,o)},t.prepend=function(...r){if(t[C])return jo.apply(this,r);let o=Uo(e,r);for(let i of o)A.add(i);for(let i of o){let s=n.authored.indexOf(i);s!==-1&&n.authored.splice(s,1)}n.authored.unshift(...o),be(e,n,o)},t.replaceChildren=function(...r){if(t[C])return Po.apply(this,r);let o=Uo(e,r);for(let s of o)A.add(s);let i=n.authored;n.authored=o.slice(),be(e,n,[...i,...o])},Object.defineProperty(t,"innerHTML",{configurable:!0,get(){return Xt.get.call(this)},set(r){if(t[C]){Xt.set.call(this,r);return}let o=e.ownerDocument.createElement("div");Xt.set.call(o,r===null?"":`${r}`);let i=Array.from(o.childNodes);for(let a of i)A.add(a);let s=n.authored;n.authored=i,be(e,n,[...s,...i])}}),Object.defineProperty(t,"textContent",{configurable:!0,get(){return lr.get.call(this)},set(r){if(t[C]){lr.set.call(this,r);return}let o=r==null||r===""?[]:[e.ownerDocument.createTextNode(`${r}`)];for(let s of o)A.add(s);let i=n.authored;n.authored=o,be(e,n,[...i,...o])}})}var Ts,Yt=w(()=>{Ue();He();Zt();fr();$e();Ae();Ts=new Set});function Ee(e,t,n){let r=F(e),o=H(t),i=Array.isArray(n)?n.filter(Boolean):n?[n]:[],s=r.authored.findIndex(c=>ve(r,c)===o),a=r.authored.filter(c=>ve(r,c)===o);r.authored=r.authored.filter(c=>ve(r,c)!==o),(s===-1||s>r.authored.length)&&(s=r.authored.length);for(let c of i)c.nodeType===1&&!Jt(r,c)&&(o==null?c.removeAttribute("slot"):c.setAttribute("slot",o)),A.add(c);if(r.authored.splice(s,0,...i),r.applying&&r.pendingRecordNodes){for(let c of a)r.pendingRecordNodes.add(c);for(let c of i)r.pendingRecordNodes.add(c)}else r.pendingRecordNodes=new Set([...a,...i]);if(r.adoptedKey){for(let c of a)r.adoptedKey.delete(c);for(let c of i)r.adoptedKey.delete(c)}se(r),W(e)}function W(e){if(!G)return;let t=e[_];if(t){if(t.applying){t.reapply=!0;return}t.applying=!0;try{do{t.reapply=!1;let n=t.pendingRecordNodes||Ts;t.pendingRecordNodes=void 0,Vc(e,t,n),zc(e,t),se(t);let r=[],o=new Set;for(let u of e.querySelectorAll(`slot[${S}]`))if($(e,u)&&!ut(t,e,u)){if(!u.hasAttribute(O)&&!(Se in u)){o.add(H(u.getAttribute("name")));continue}r.push(u)}let i=new Map;for(let u of r){let f=H(u.getAttribute("name")),p=i.get(f);p||(p=[],i.set(f,p)),p.push(u)}let s=[];for(let[u,f]of i){let p=t.assignedByName.get(u)||[];for(let d=0;d<f.length;d++){let m=f[d],b=p.filter(g=>{let h=Jt(t,g);return h?h===m:d===0}),y=b.filter(g=>g===e||g.nodeType===1&&g.contains(e));if(y.length){for(let g of y)A.delete(g);b=b.filter(g=>y.indexOf(g)===-1)}b.length>0?Ko(t,m,b)&&s.push(m):Vo(t,m)&&s.push(m)}}for(let u of s)zo(t,u);let a=new Set(i.keys());for(let u of o)a.add(u);let c=new Set;for(let u of t.authored)a.has(ve(t,u))||c.add(u);let l=e[ie];if(l)for(let u of Array.from(l.childNodes))c.has(u)||xe.call(l,u);if(c.size){let u=Es(e);for(let f of c)f.parentNode!==u&&(A.delete(f),qe(e,()=>ae.call(u,f)))}if(t.backstop){let u=t.backstop.takeRecords();u.length&&Qt(e,t,u)}}while(t.reapply)}finally{t.applying=!1}}}function Vc(e,t,n){for(let r of e.querySelectorAll(`slot[${S}][${O}="${M}"]`)){if(!$(e,r)||ut(t,e,r))continue;let o=r,i=t.lastSnapshot.get(o);if(!i)continue;let s=Array.from(o.childNodes);if(pr(s,i))continue;let a=t.authored,c=H(o.getAttribute("name")),l=s.filter(m=>!n.has(m));for(let m of l)a.indexOf(m)===-1&&ve(t,m)!==c&&(t.adoptedKey||(t.adoptedKey=new WeakMap),t.adoptedKey.set(m,c));for(let m of a){if(l.indexOf(m)!==-1||ve(t,m)!==c)continue;let b=a.indexOf(m),y=0;for(let g=0;g<l.length;g++){let h=a.indexOf(l[g]);h!==-1&&h<b&&(y=g+1)}l.splice(y,0,m)}let u=new Set(l);for(let m of i)u.add(m);let f=-1,p=0;for(let m of a){if(u.has(m)){f===-1&&(f=p);continue}p+=1}let d=a.filter(m=>!u.has(m));(f===-1||f>d.length)&&(f=d.length),d.splice(f,0,...l),t.authored=d}}function zc(e,t){let n=e[ie];t.authored=t.authored.filter(r=>{if(A.has(r))return!0;let o=r.parentNode;return o==null?!1:!!(o===e||o===n||o.nodeType===1&&o.tagName==="SLOT"&&o.hasAttribute(S)&&(t.lastSnapshot.has(o)||e.contains(o)&&$(e,o)))})}var Zt=w(()=>{Ue();Yt();He();fr();$e();Ae()});function ks(){return typeof HTMLElement<"u"&&typeof HTMLSlotElement<"u"}function Rs(){if(Ns||(G=ks(),!G))return;en=HTMLSlotElement.prototype.assignedNodes,Go=HTMLSlotElement.prototype.assignedElements,hr=Object.getOwnPropertyDescriptor(Element.prototype,"assignedSlot"),HTMLSlotElement.prototype.assignedNodes=function(n){return this.hasAttribute(S)&&!Jo(this)?Xo(this,n):en?en.call(this,n):[]},HTMLSlotElement.prototype.assignedElements=function(n){return this.hasAttribute(S)&&!Jo(this)?Xo(this,n).filter(r=>r.nodeType===1):Go?Go.call(this,n):[]},Object.defineProperty(Element.prototype,"assignedSlot",{configurable:!0,enumerable:!0,get:function(){let n=hr&&hr.get?hr.get.call(this):null;return n||Cs(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||Cs(this)}}),Yo=HTMLSlotElement.prototype.assign,HTMLSlotElement.prototype.assign=function(...n){if(this.hasAttribute(S)&&!Jo(this)){let r=Gc(this);if(r){let o=F(r);o.manualAssign||(o.manualAssign=new Map);let i=n.filter(Boolean);for(let[s,a]of o.manualAssign){if(s===this)continue;let c=a.filter(l=>{let u=l.deref();return u!==void 0&&i.indexOf(u)===-1});c.length!==a.length&&(c.length?o.manualAssign.set(s,c):o.manualAssign.delete(s))}if(i.length?o.manualAssign.set(this,i.map(s=>new WeakRef(s))):o.manualAssign.delete(this),o.applying&&o.pendingRecordNodes)for(let s of i)o.pendingRecordNodes.add(s);else o.pendingRecordNodes=new Set(i);se(o),W(r)}return}return Yo?Yo.apply(this,n):void 0},Ns=!0}function Jt(e,t){let n=e.manualAssign;if(!n||!n.size)return null;for(let[r,o]of n){let i=!1,s=o.filter(a=>{let c=a.deref();return c===void 0?!1:(c===t&&(i=!0),!0)});if(s.length!==o.length&&(s.length?n.set(r,s):n.delete(r)),i){let a=e.host;return a&&(r===a||a.contains(r))?r:null}}return null}function Gc(e){for(let t=e.parentElement;t;t=t.parentElement)if(t[_])return $(t,e)?t:null;return null}function Jo(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 Xo(e,t){if(e.getAttribute(O)!==M)return[];let n=Array.from(e.childNodes);return!t||!t.flatten?n:Qo(n,new Set,0)}function Qo(e,t,n){if(n>=Ss)return e.slice();let r=[];for(let o of e)if(o.nodeType===1&&o.tagName==="SLOT"){let i=o;if(t.has(i))continue;if(t.add(i),i.hasAttribute(S)){let s=Xo(i,{flatten:!1});if(s.length>0)for(let a of Qo(s,t,n+1))r.push(a);else for(let a of Qo(Array.from(i.childNodes),t,n+1))r.push(a)}else if(en){let s=en.call(i,{flatten:!0});for(let a of s)r.push(a)}else r.push(o)}else r.push(o);return r}function Cs(e){let t=e.parentElement;return t&&t.tagName==="SLOT"&&t.hasAttribute(S)&&t.getAttribute(O)===M?t:null}var G,en,Go,hr,Yo,Ns,He=w(()=>{Ue();Zt();$e();Ae();G=ks(),en=null,Go=null,hr=null,Yo=null,Ns=!1;Rs()});function Zo(e){if(!G)return!1;for(let t of e.querySelectorAll(`slot[${S}][${O}]`))if($(e,t))return!0;return!1}function $(e,t){let n=t[De];if(n)return n===e;let r=typeof t.getAttribute=="function"?t.getAttribute(No):null;if(r){let o=Yc(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 Yc(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 Ko(e,t,n){for(let l of n)A.delete(l);let r=t.getAttribute(O)!==M,o=e.lastSnapshot.get(t)||[],i=r||!pr(o,n);if(!r&&pr(Array.from(t.childNodes),n))return e.lastSnapshot.set(t,n.slice()),i;let s=t[Se];if(r&&s)for(;t.firstChild;)s.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(O,M),e.lastSnapshot.set(t,n.slice()),i}function Vo(e,t){let n=t.getAttribute(O)===M;if(t.setAttribute(O,To),!n)return Os(t),!1;for(e.lastSnapshot.delete(t);t.firstChild;)t.removeChild(t.firstChild);return Os(t),!0}function Os(e){let t=e[Se];!t||t.childNodes.length===0||e.appendChild(t)}function ei(e,t){if(!Gt(e))return;let n=F(e),r=H(t.getAttribute("name")),o=n.assignedByName.get(r);if(o)for(let i of o)i.parentNode===t&&(A.add(i),t.removeChild(i));n.lastSnapshot.delete(t)}function Ls(e){e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1}))}function zo(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)Ls(r)}))}function pr(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 Ue=w(()=>{He();$e();Ae()});var Ke=w(()=>{Ue();Yt();He();Zt();fr();$e();Ae()});function ta(e,t,n){Bl.has(t)?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}async function gi(e){return JSON.stringify(await na(e))}function Je(e){return ra(JSON.parse(e))}async function na(e){let t=Dl();return await $l(e,t),Ye(e,t)}function ra(e){return Ce(e,Wl())}function Dl(){return{refCount:new Map,idOf:new Map,emitted:new Set,nextId:0,blobBytes:new Map,fdEntries:new Map}}async function $l(e,t){let n=[e];for(;n.length;){let r=n.pop();if(!Vl(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 i=new Uint8Array(await r.arrayBuffer());t.blobBytes.set(r,i);continue}if(typeof FormData<"u"&&r instanceof FormData){let i=t.fdEntries.get(r)||[...r.entries()];t.fdEntries.set(r,i);for(let[,s]of i)typeof s!="string"&&n.push(s);continue}if(Array.isArray(r))for(let i=0;i<r.length;i++)n.push(r[i]);else if(r instanceof Map)for(let[i,s]of r)n.push(i),n.push(s);else if(r instanceof Set)for(let i of r)n.push(i);else if(zl(r))for(let i in r)Object.prototype.hasOwnProperty.call(r,i)&&n.push(r[i])}}for(let[r,o]of t.refCount)o>1&&t.idOf.set(r,t.nextId++)}function Ye(e,t){if(e===null)return null;if(e===void 0)return{[N]:"undef"};let n=typeof e;if(n==="string"||n==="boolean")return e;if(n==="number")return Number.isNaN(e)?{[N]:"NaN"}:e===1/0?{[N]:"Inf"}:e===-1/0?{[N]:"-Inf"}:Object.is(e,-0)?{[N]:"-0"}:e;if(n==="bigint")return{[N]:"BigInt",v:e.toString()};if(n==="symbol"){let i=Symbol.keyFor(e);if(i===void 0)throw new TypeError("Cannot serialize a local Symbol; only Symbol.for() registered symbols are supported.");return{[N]:"Sym",v:i}}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{[N]:"Ref",v:r};r!==void 0&&t.emitted.add(r);let o;if(e instanceof Date)o={[N]:"Date",v:Number.isNaN(e.getTime())?null:e.toISOString()};else if(e instanceof Error)o={[N]:"Error",v:{name:e.name,message:e.message,stack:e.stack||null}};else if(typeof Blob<"u"&&e instanceof Blob){let i=t.blobBytes.get(e);typeof File<"u"&&e instanceof File?o={[N]:"File",v:ln(i),n:e.name,t:e.type||"",m:e.lastModified}:o={[N]:"Blob",v:ln(i),t:e.type||""}}else if(typeof FormData<"u"&&e instanceof FormData){let i=t.fdEntries.get(e)||[...e.entries()],s=[];for(let[a,c]of i)s.push([a,Ye(c,t)]);o={[N]:"FD",v:s}}else if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)o=Hl(e);else if(e instanceof Map){let i=[];for(let[s,a]of e)i.push([Ye(s,t),Ye(a,t)]);o={[N]:"Map",v:i}}else if(e instanceof Set){let i=[];for(let s of e)i.push(Ye(s,t));o={[N]:"Set",v:i}}else if(Array.isArray(e))o=e.map(i=>Ye(i,t));else{o={};for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i))continue;let s=Gl(i)?"_"+i:i;ta(o,s,Ye(e[i],t))}}if(r!==void 0){if(Array.isArray(o))return{[N]:"Arr",_id:r,v:o};o._id=r}return o}function Hl(e){if(e instanceof ArrayBuffer)return{[N]:"buf",v:ln(new Uint8Array(e))};if(e instanceof DataView)return{[N]:"dv",v:ln(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))};let t=e.constructor.name,n=Ul[t];if(!n)throw new TypeError(`Unsupported typed array: ${t}`);let r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return{[N]:n,v:ln(r)}}function Wl(){return{refs:new Map}}function Ce(e,t){if(e===null||typeof e!="object")return e;if(Array.isArray(e)){let i=[];for(let s=0;s<e.length;s++)i.push(Ce(e[s],t));return i}let n=e[N];if(typeof n=="string")return Kl(e,n,t);let r={},o=e._id;typeof o=="number"&&t.refs.set(o,r);for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i)||i==="_id")continue;let s=Yl(i)?i.slice(1):i;ta(r,s,Ce(e[i],t))}return r}function Kl(e,t,n){let r=e._id,o=i=>(typeof r=="number"&&n.refs.set(r,i),i);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 i=new Error(e.v.message);return i.name=e.v.name,e.v.stack&&(i.stack=e.v.stack),typeof r=="number"&&n.refs.set(r,i),i}case"Map":{let i=new Map;typeof r=="number"&&n.refs.set(r,i);for(let[s,a]of e.v)i.set(Ce(s,n),Ce(a,n));return i}case"Set":{let i=new Set;typeof r=="number"&&n.refs.set(r,i);for(let s of e.v)i.add(Ce(s,n));return i}case"Arr":{let i=[];typeof r=="number"&&n.refs.set(r,i);for(let s of e.v)i.push(Ce(s,n));return i}case"Ref":{let i=n.refs.get(e.v);if(i===void 0)throw new TypeError(`Dangling reference: id=${e.v}`);return i}case"Blob":{if(typeof Blob>"u")throw new TypeError("Blob is not available in this environment.");let i=cn(e.v);return o(new Blob([i],{type:e.t||""}))}case"File":{if(typeof File>"u")throw new TypeError("File is not available in this environment.");let i=cn(e.v);return o(new File([i],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 i=new FormData;o(i);for(let[s,a]of e.v){let c=Ce(a,n);i.append(s,c)}return i}default:{if(t==="buf"){let s=cn(e.v);return o(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength))}if(t==="dv"){let s=cn(e.v);return o(new DataView(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)))}let i=ql[t];if(i){let s=cn(e.v),a=s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength);return o(new i(a))}throw new TypeError(`Unknown serialization tag: ${t}`)}}}function Vl(e){return e!==null&&typeof e=="object"}function zl(e){if(e===null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Gl(e){return/^_+\$wj$/.test(e)||/^_+id$/.test(e)}function Yl(e){return/^__+\$wj$/.test(e)||/^__+id$/.test(e)}function ln(e){if(oa)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 cn(e){if(oa){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 N,Bl,Ul,ql,oa,un=w(()=>{N="_$wj",Bl=new Set(["__proto__","constructor","prototype"]);Ul={Int8Array:"i8",Uint8Array:"u8",Uint8ClampedArray:"u8c",Int16Array:"i16",Uint16Array:"u16",Int32Array:"i32",Uint32Array:"u32",Float32Array:"f32",Float64Array:"f64",BigInt64Array:"bi64",BigUint64Array:"bu64"},ql={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};oa=typeof Buffer<"u"&&typeof Buffer.from=="function"});var Sa={};os(Sa,{observeLazy:()=>mu,observeViewportOnce:()=>gu});function _a(e){let t=Si.get(e);return t||(t=import(e).finally(()=>Si.delete(e)),Si.set(e,t),t)}function mu(e){for(let[t,n]of Object.entries(e))Xe.set(t.toLowerCase(),n);if(typeof IntersectionObserver>"u"){for(let t of Xe.values())_a(t);Xe.clear();return}hn||(hn=new IntersectionObserver(bu,{rootMargin:"200px"})),wa(),typeof MutationObserver<"u"&&new MutationObserver(()=>wa()).observe(document.body,{childList:!0,subtree:!0})}function wa(){if(!(!hn||!Xe.size))for(let e of Xe.keys())for(let t of document.querySelectorAll(e))hn.observe(t)}function bu(e){for(let t of e){if(!t.isIntersecting)continue;let n=t.target.tagName.toLowerCase(),r=Xe.get(n);r&&(_a(r),Xe.delete(n),hn?.unobserve(t.target))}}function yu(e){for(let t of e){if(!t.isIntersecting)continue;let n=kr.get(t.target);kr.delete(t.target),pn?.unobserve(t.target),n&&n()}}function gu(e,t){return typeof IntersectionObserver>"u"?(t(),()=>{}):(pn||(pn=new IntersectionObserver(yu,{rootMargin:"200px"})),kr.set(e,t),pn.observe(e),()=>{kr.delete(e),pn?.unobserve(e)})}var Xe,hn,Si,pn,kr,Aa=w(()=>{Xe=new Map,hn=null,Si=new Map;pn=null,kr=new WeakMap});var Ai,vi=w(()=>{Ai=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(()=>(Aa(),Sa)).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(()=>(Rr(),va)).then(({loadFrame:n})=>{this._webjsLoadedSrc!==t||!this.isConnected||n(this,t)})}}:null;typeof customElements<"u"&&Ai&&!customElements.get("webjs-frame")&&customElements.define("webjs-frame",Ai)});function _u(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 Ei(e,t){let n=t||(typeof document<"u"?document:null);if(!n)return;let r=null;if(typeof e=="string"){let i=n.createElement("template");i.innerHTML=e,r=i.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 i of o)n.body.append(i);else n.body.append(r)}var wu,xi,mn=w(()=>{wu=new Set(["append","prepend","before","after","replace","update"]);xi=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 s=n.getElementById(o);s&&(r=[s])}else{let s=this.getAttribute("targets");if(s)try{r=Array.from(n.querySelectorAll(s))}catch{r=[]}}let i=wu.has(t)?this.querySelector("template"):null;try{for(let s of r){let a=i?i.content.cloneNode(!0):null;_u(t,s,a)}}finally{this.remove()}}}:null;typeof customElements<"u"&&xi&&!customElements.get("webjs-stream")&&customElements.define("webjs-stream",xi)});var xa,Ea=w(()=>{xa=typeof HTMLElement<"u"?class extends HTMLElement{connectedCallback(){this.style.display||(this.style.display="contents")}}:null;typeof customElements<"u"&&xa&&!customElements.get("webjs-suspense")&&customElements.define("webjs-suspense",xa)});function Or(e,t){let n=typeof document<"u"?document:null,r=e||n;if(!r||typeof r.querySelectorAll!="function")return;if(t&&t.frame===!0){Ti(r,!0);return}Ca();let o=r===n,i=!!n&&!o&&typeof n.contains=="function"&&n.contains(r),s=!!n&&!o&&!i;s&&(Ti(n,!0),ke.clear(),Ci.clear()),(o||s)&&(Ni=!0);let a=L.ingested+L.replaced;vu(Ti(r),a)}function Ti(e,t){let n=null;for(let r of e.querySelectorAll('script[type="application/json"]#__webjs-seeds, script[type="application/json"][data-webjs-seeds]')){let o=Au(r.getAttribute?.("data-webjs-dev"));o!==null&&(n=o),Ta(t?null:r.textContent,r)}for(let r of e.querySelectorAll("[data-webjs-seed]"))Ta(t?null:r.getAttribute("data-webjs-seed"),r,()=>r.removeAttribute("data-webjs-seed"));return n}function Ta(e,t,n){if(e)try{let r=Je(e);if(r&&typeof r=="object")for(let o in r){ke.has(o)?L.replaced++:L.ingested++,ke.set(o,r[o]);let i=o.indexOf("/",o.indexOf("/")+1);i>0&&Ci.add(o.slice(0,i))}}catch{}n?n():t.remove?.()}function Au(e){return typeof e!="string"?null:e||"ok"}function vu(e,t){if(e===null)return;let n=++Su;wt={epoch:n,hits:L.hits,misses:L.misses,keyMisses:L.keyMisses,merged:t,marker:e};let r=()=>{!wt||wt.epoch!==n||Ca()};try{typeof requestIdleCallback=="function"?requestIdleCallback(r,{timeout:1e3}):setTimeout(r,250)}catch{wt=null}}function Ca(){let e=wt;if(wt=null,!!e)try{xu(e)}catch{}}function xu(e){let t=L.hits-e.hits,n=L.misses-e.misses,r=L.ingested+L.replaced-e.merged,o=L.keyMisses-e.keyMisses;if(n===0)return;let i=e.marker==="streamed"?"This page streams (a Suspense or <webjs-suspense> boundary), and a streamed render emits no seeds, so every action call on it goes to the network.":e.marker==="drop"?"The page's seeds could not be serialized, so the whole block was dropped. Something an action returned is not serializer-safe; the server response reports collected above emitted.":o===0?null:"The key is the action file hash plus the function name plus the serialized arguments, so an argument the SSR render never used misses (a deliberate refetch after hydration misses too, and is expected). A miss on an action this page never seeded is NOT counted here, because a mutation or a client-only read could never have been seeded.";if(i===null)return;let a=e.marker==="streamed"||e.marker==="drop"?`${n} of ${t+n} action call(s) in the hydration window went to the network`:`${o} action call(s) in the hydration window asked for a key this page seeded under DIFFERENT arguments`;console.warn(`[webjs] SSR action seeding: ${a} (${r} seed(s) on this page, ${ke.size} still unconsumed). ${i} See https://webjs.dev/docs/data-fetching for the seeding reference.`)}function Eu(e,t,n){Ni||(Ni=!0,Or());let r=`${e}/${t}/${n}`;if(ke.has(r)){let o=ke.get(r);return ke.delete(r),L.hits++,o}return L.misses++,Ci.has(`${e}/${t}`)&&L.keyMisses++,Na}function Tu(){return{...L,pending:ke.size}}var ke,Na,Ni,L,Ci,wt,Su,Lr=w(()=>{un();ke=new Map,Na=Symbol("webjs.seed.miss"),Ni=!1,L={ingested:0,replaced:0,hits:0,misses:0,keyMisses:0},Ci=new Set,wt=null,Su=0});function ki(e){if(!(!Array.isArray(e)||!e.length)){jr+=1;for(let t of e)t&&ka.set(t,jr)}}function Cu(){return jr}function ku(e,t,n){if(!(!Array.isArray(t)||!t.length)&&(_t.delete(e),_t.set(e,{tags:t.slice(),since:typeof n=="number"?n:jr}),_t.size>Nu)){let r=_t.keys().next().value;r!==void 0&&_t.delete(r)}}function Ru(e){let t=_t.get(e);if(!t)return!1;for(let n of t.tags)if((ka.get(n)||0)>t.since)return!0;return!1}function Ri(e){return e?e.split(",").map(t=>t.trim()).filter(Boolean):[]}var jr,ka,_t,Nu,Pr=w(()=>{jr=0,ka=new Map,_t=new Map,Nu=1e3});function Ra(e){return St.test(e)}var Oi,Li,St,bn,Qe,At,Ir,Oa,q=w(()=>{Oi="text/vnd.webjs-stream.html",Li=["wheel","touchmove","keydown","pointerdown"],St=/\.(?: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,bn="_top",Qe="webjs:nav-fallback",At=new Set(["value","checked","selected","indeterminate","disabled","open","popover"]),Ir="name=csp-nonce";Oa=250});function Re(e,t,n="warn"){if(ji.has(e)||(ji.add(e),typeof console>"u"))return;let r=n==="error"?console.error:console.warn;r&&r.call(console,t)}function ja(e,t,n,r){if(typeof process<"u"&&process.env||!r.has(I))return;let o="";try{o=new URL(e.getAttribute("action")||location.href,location.href).pathname}catch{o=location.pathname}if(n!=="post"){Re(`submit-nowhere:${o}:${n}`,`[webjs] this submission carries a bound server action's identity but submits as ${n.toUpperCase()}, which sends no body, so the identity rides the query string and the action never runs. A submitter's own formmethod overrides the form's, and WebJs honours it rather than refusing it, so check for a formmethod on the button that was pressed.`,"error");return}let i=t&&t.getAttribute("formenctype")||e.getAttribute("enctype")||"application/x-www-form-urlencoded";if(i.toLowerCase()==="text/plain"){Re(`submit-nowhere:${o}:${i}`,`[webjs] this submission carries a bound server action's identity but declares enctype="${i}", which the server cannot parse. The router declines to send it so both paths behave the same way, and both are answered with a 405. Drop the enctype and let the binding supply it.`,"error");return}o&&o!==location.pathname&&Re(`submit-elsewhere:${o}`,`[webjs] this submission carries a bound server action's identity but posts to "${o}" rather than this page, because the enclosing <form> declares its own action. A bound submitter emits no formaction, so the form's target wins, which is what native HTML does. The action runs only if "${o}" is a page route; against a route.ts or another origin the identity is ignored and nothing runs. Drop the form's action attribute to keep the submission on this page.`)}function Ii(e,t){return!e&&!t&&typeof document<"u"&&document.readyState==="loading"}function Mr(e,t,n,r){if(e!=="navigate"||!t||r&&r===n)return!1;try{return new URL(t).origin===new URL(n).origin}catch{return!1}}function Pa(){if(typeof location>"u"||La)return;La=!0;let e=null;try{e=sessionStorage.getItem(Qe),sessionStorage.removeItem(Qe)}catch{}let t="";try{let n=performance.getEntriesByType("navigation")[0];t=n?n.type:""}catch{}Mr(t,document.referrer,location.href,e)&&ee("pre-boot-navigation",location.href,!1)}function ee(e,t,n=!0){if(n)try{sessionStorage.setItem(Qe,t)}catch{}if(typeof document<"u"&&typeof CustomEvent<"u")try{document.dispatchEvent(new CustomEvent("webjs:navigation-fallback",{detail:{cause:e,href:t,willReload:n}}))}catch{}typeof process<"u"&&process.env||Re(`fallback:${e}`,n?`[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.`:`[webjs] client router degraded a soft navigation (${e}) for ${t}, without a full page load.`)}function Ia(e){typeof process<"u"&&process.env||Re(`stream-drop:${e}`,`[webjs] dropped a streamed Suspense resolve for "${e}": no #${e} boundary in the DOM. Benign if this navigation was superseded or degraded. A stuck skeleton here means the shell swap did not place the boundary.`)}function Ma(){if(typeof process<"u"&&process.env||Pi||typeof document>"u"||typeof getComputedStyle!="function")return;let e=document.documentElement;if(!e)return;Pi=!0;let t;try{t=getComputedStyle(e).scrollBehavior}catch{return}t==="smooth"&&Re("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 yn(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 Fa(){ji.clear(),Pi=!1}function Ba(e,t){return Ii(e,t)}var ji,La,Pi,te=w(()=>{_e();q();ji=new Set;La=!1;Pi=!1});function ne(e){let t=new Map,n=[],r=!1;function o(i){if(!r){if(i.nodeType===8){let s=i.data.trim();if(s.startsWith("wj:children:")){let a=s.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:i});return}if(s.startsWith("/wj:children")){let a=s.slice(12).replace(/^:/,""),c=n.pop();if(!c||c.segment!==a){r=!0;return}if(c.start.parentNode!==i.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:i});return}return}if(i.hasChildNodes&&i.hasChildNodes())for(let s=i.firstChild;s&&!r;s=s.nextSibling)o(s)}}return o(e),r||n.length>0?null:t}function gn(e,t){let n=[...e.keys()].filter(s=>t.has(s)).sort((s,a)=>s.length-a.length);if(n.length===0)return null;for(let s of n)if(e.get(s).routeKey!==t.get(s).routeKey){let a=null;for(let c of n){if(c===s)break;s.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=s=>{let a=null;for(let c of s.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 ue(){let e=ne(document.body);return e?[...e.entries()].map(([t,n])=>`${t}:${n.routeKey}`).join(","):""}var Oe=w(()=>{});function Da(e){fe=e||(t=>{location.href=t})}function $a(){return k}function Ha(){return++k}function Fr(){return++k}function Mi(e){K=e}function Ua(e){wn=e}function qa(e){let t=wn!==null&&wn===e;return wn=null,t}function Br(){wn=null}var k,fe,K,wn,ye=w(()=>{k=0,fe=e=>{location.href=e};K=!1;wn=null});function Ze(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"&&Ou()?Document.parseHTMLUnsafe(e):Lu(e)}function Ou(){if(vt!==null)return vt;try{vt=Document.parseHTMLUnsafe("<!doctype html><body><!--c--><i></i>")?.body?.firstChild?.nodeType===8}catch{vt=!1}return vt}function Fi(){vt=null}function Lu(e){return typeof DOMParser>"u"?null:new DOMParser().parseFromString(e,"text/html")}var vt,_n=w(()=>{vt=null});function Dr(e){for(let t of e.composedPath())if(t instanceof HTMLAnchorElement)return t;return null}function Bi(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}var $r=w(()=>{});function Sn(e,t){return((t&&t.hasAttribute("formmethod")?t.getAttribute("formmethod")||"":e.getAttribute("method")||"")||"get").toLowerCase()}function An(e,t){return t&&t.hasAttribute("formaction")?t.getAttribute("formaction")||"":e.getAttribute("action")||e.action||location.href}function ju(e){let t=String(e||"").toLowerCase();return t==="multipart/form-data"?"multipart/form-data":t==="text/plain"?"text/plain":"application/x-www-form-urlencoded"}function vn(e,t){return ju(t&&t.hasAttribute("formenctype")?t.getAttribute("formenctype"):e.getAttribute("enctype"))}function xn(e,t){if(t==="multipart/form-data")return e;let n=new URLSearchParams;for(let[r,o]of e)n.append(r,typeof o=="string"?o:o.name);return n}function En(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}}var Hr=w(()=>{});function Wa(){if(typeof document>"u")return"";let e=document.querySelector('meta[name="csp-nonce"]');return e&&e.getAttribute("content")||""}function Tn(e){let t=document.createElement("script");for(let r of e.attributes)r.name!=="nonce"&&t.setAttribute(r.name,r.value);let n=Wa();return n&&t.setAttribute("nonce",n),t.textContent=e.textContent,t}function Di(e){if(!e.hasAttribute("nonce"))return e.cloneNode(!0);let t=e.cloneNode(!0),n=Wa();return n?t.setAttribute("nonce",n):t.removeAttribute("nonce"),t}function de(e){if(!e.hasAttribute("nonce"))return e.outerHTML;let t=e.cloneNode(!0);return t.removeAttribute("nonce"),t.outerHTML}function Ur(e){let t=e.getAttribute("name");if(t)return"name="+t;let n=e.getAttribute("property");if(n)return"property="+n;let r=e.getAttribute("http-equiv");return r?"http-equiv="+r:e.hasAttribute("charset")?"charset":null}function Pu(e){if(!e.querySelector("meta"))return;let t=o=>{let i=new Map;for(let s of o.querySelectorAll("meta")){let a=Ur(s);if(!a||a===Ir)continue;let c=i.get(a);c?c.push(s):i.set(a,[s])}return i},n=t(e),r=t(document.head);for(let[o,i]of n){let s=r.get(o)||[],a=i.map(de).join(`
|
|
1
|
+
var wc=Object.defineProperty;var w=(e,t)=>()=>(e&&(t=e(e=0)),t);var os=(e,t)=>{for(var n in t)wc(e,n,{get:t[n],enumerable:!0})};function Kt(e){return Object.prototype.hasOwnProperty.call(bo,e)}var bo,yo=w(()=>{bo=Object.freeze({"@":"event",".":"prop","?":"bool"})});function vc(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function is(e){return String(e).replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<")}var go=w(()=>{});function wo(e){if(typeof e!="function")return null;let t=e[ss];return typeof t=="string"&&t?t:null}function Zn(e,t,n){if(typeof e!="function")return!1;let r=String(t).toLowerCase(),o=String(n||"").toLowerCase();return r==="action"?o==="form":r==="formaction"?o==="button"||o==="input":!1}function as(e,t,n=!0){if(!e||e===I&&n)return;let r=e===I?'a second "name" attribute':`name="${e}"`;throw new Error(`[webjs] formaction=\${action} on <${t||"button"}> cannot be used when the element already carries a "name" attribute (found ${r}). The action identity is submitted as the button's own name/value pair, so there is no room for a second one. Move the action to the enclosing <form action=\${action}> or drop the submitter's "name".`)}function cs(e,t){let n=String(e||"").toLowerCase(),r=t==null?null:String(t).toLowerCase();if(xc(n,r)){if(n==="input"&&r==="image")throw new Error('[webjs] formaction=${action} is not supported on <input type="image"> because image submitters submit coordinate pairs (name.x/name.y) instead of name=value, so the action identity would never arrive. Use a <button> instead.');if(n==="input")throw new Error('[webjs] formaction=${action} is not supported on <input type="submit"> because the action identity has to occupy the submitter\'s "value", which on this control is also its visible label, so the button would render captioned with the action\'s id and could not be given a real one. Use <button formaction=${action}>Publish</button>, whose label is its children.');return}throw new Error(`[webjs] formaction=\${action} on <${n}>${r?` type="${r}"`:""} requires a submitter control, and formaction is inert on anything else. Use <button formaction=\${action}>.`)}function xc(e,t){let n=t==null?null:String(t).toLowerCase();return e==="button"?n==null||n===""||n==="submit":e==="input"?n==="submit"||n==="image":!1}function ls(e){throw new Error(`[webjs] formaction=\${action} on <${e||"button"}> cannot be used when the element already carries a "value" attribute. The action identity is submitted as the button's own name/value pair, so both halves are taken. Drop the "value", or dispatch on it from one form-level action instead.`)}function us(e){throw new Error(`[webjs] a bound formaction=\${action} on <${e||"button"}> cannot also carry a plain formaction attribute: the two name different targets and the renderers resolve them differently. Drop the static attribute.`)}function fs(e){throw new Error(`[webjs] formaction=\${action} on <${e||"button"}> cannot be used with a "form" attribute, which re-points the submitter at a form other than the bound one it sits in. Keep the submitter inside its bound <form>.`)}function ds(e,t){if(e)throw new Error(`[webjs] two formaction=\${action} holes were found on one <${t||"button"}>. Only one can win, and the two renderers pick differently, so bind exactly one action per submitter.`)}function ps(e,t){let r=(e||[]).filter(o=>_o(o))[0];if(r)throw new Error(`[webjs] a <${t||"button"}> submitter binds .${r}=. That property is a reflected IDL attribute on a submitter, so a property binding is dropped at SSR and written to the attribute in the browser: the page would render on the server and throw on hydration. Write it as a plain attribute.`)}function _o(e){let t=String(e).toLowerCase();return t==="name"||t==="value"||t==="formaction"||t==="formmethod"||t==="formenctype"}function Ec(e,t,n){let r=t==null?null:String(t),o=n==null?null:String(n);if(r!=null&&/^dialog$/i.test(r))throw new Error(`[webjs] formaction=\${action} on <${e}> cannot be combined with formmethod="dialog", which dismisses a <dialog> instead of submitting, so the bound action would never run. Drop one of the two.`);if(r!=null&&!/^post$/i.test(r))throw new Error(`[webjs] <${e} formmethod="${r}" formaction=\${action}> cannot work: a bound server action is submitted as a POST body, and a "${r}" submission sends none, so the action would never run. Drop the formmethod attribute (WebJs emits formmethod="post" on a bound submitter), or drop the binding.`);if(o!=null&&!ms.has(o.toLowerCase()))throw new Error(`[webjs] <${e} formenctype="${o}" formaction=\${action}> cannot work: a form submission is parsed as multipart/form-data or application/x-www-form-urlencoded, and a "${o}" body is neither, so the bound action could never read it. Drop the formenctype attribute (WebJs emits multipart/form-data on a bound submitter).`)}function zt(e,t,n){if(er(e)&&Lc(t))throw new Error(jc(t,n))}function hs(e,t,n){Oc(t,n)&&zt(e,t,n)}function So(e,t){if(e)return e;let n=t==="button"||t==="input"?"formaction=":"action=";throw new Error(`[webjs] the function in ${n} on <${t||"form"}> is not a server action. Only a function imported from a 'use server' *.server.{js,ts} module can be bound to a form or a submitter, because the identity the browser submits has to resolve back to something the server can run. Move the handler into a server action and import it, or pass a url string.`)}function Tc(e,t){if(e!=null&&!/^post$/i.test(e))throw new Error(`[webjs] <form method="${e}" action=\${action}> cannot work: a bound server action is submitted as a POST body, and a "${e}" form sends no body. Drop the method attribute (WebJs emits method="post") or remove the bound action.`);if(t!=null&&!ms.has(t.toLowerCase()))throw new Error(`[webjs] <form enctype="${t}" action=\${action}> cannot work: a form submission is parsed as multipart/form-data or application/x-www-form-urlencoded, and a "${t}" body is neither, so the submission would run under JS and do nothing without it. Drop the enctype attribute (WebJs emits multipart/form-data).`)}function Nc(e){if(e.duplicateAction)throw new Error("[webjs] two action=${...} holes were found on one <form>. A form can carry only one action binding. Move one to a submit button's formaction=${action} or remove the duplicate.");if(e.staticAction)throw new Error('[webjs] a bound <form action=${action}> also carries a plain action="..." attribute. A bound form posts to the page\'s own url, so the two say different things: without JS the browser would post to the written url and with JS it would not. Drop the action attribute, or drop the binding.');let t=e.propAttrs&&e.propAttrs[0];if(t)throw new Error(`[webjs] a bound <form action=\${action}> also binds .${t}=. A property binding on a native element is dropped at SSR and applied in the browser, so the form would submit one way with JS and another way without it. Write it as a plain attribute.`)}function Cc(e,t){let n=e!==z&&e!=null,r=t!==z&&t!=null;return Tc(n?e:null,r?t:null),{method:n?null:"post",enctype:r?null:"multipart/form-data"}}function bs(e,t,n){let r=t!==z&&t!=null,o=n!==z&&n!=null;return Ec(e,r?t:null,o?n:null),{formMethod:r?null:"post",formEnctype:o?null:"multipart/form-data"}}function ys(e,t,n,r,o){let i=typeof t=="function"?wo(t):null;if(!i){typeof t=="function"&&So(null,e.localName),Rc(e,n,r,o.propAttrs);return}Nc(o);let s=Cc(n,r);e.removeAttribute("action"),Vt(e,"method",n,s.method),Vt(e,"enctype",r,s.enctype),kc(e,i)}function Vt(e,t,n,r){if(r!==null){e.setAttribute(t,r);return}n!==z&&e.getAttribute(t)!==n&&e.setAttribute(t,n)}function kc(e,t){let n=e.firstElementChild,r=n&&n.localName==="input"&&n.getAttribute("name")===I?n:null;if(!r){for(let o of e.children)if(o.localName==="input"&&o.getAttribute("name")===I){r=o;break}}r||(r=e.ownerDocument.createElement("input"),r.setAttribute("type","hidden"),r.setAttribute("name",I),e.insertBefore(r,e.firstChild)),r.getAttribute("value")!==t&&r.setAttribute("value",t)}function Rc(e,t,n,r){let o=e.firstElementChild;if(o&&o.localName==="input"&&o.getAttribute("name")===I)o.remove();else for(let s of e.children)if(s.localName==="input"&&s.getAttribute("name")===I){s.remove();break}let i=s=>(r||[]).some(a=>{let c=String(a).toLowerCase();return c===s||s==="enctype"&&c==="encoding"});t===z&&!i("method")&&e.removeAttribute("method"),n===z&&!i("enctype")&&e.removeAttribute("enctype")}function gs(e,t,n,r){let o=i=>(r||[]).some(s=>String(s).toLowerCase()===i);t===z&&!o("formmethod")&&e.removeAttribute("formmethod"),n===z&&!o("formenctype")&&e.removeAttribute("formenctype")}function Oc(e,t){let n=String(e).toLowerCase();Kt(n[0])&&(n=n.slice(1));let r=String(t||"").toLowerCase();return n==="action"?r==="form":n==="formaction"?r==="button"||r==="input":!1}function er(e,t){if(typeof e=="function")return!0;if(!Array.isArray(e))return!1;let n=t||new Set;return n.has(e)?!1:(n.add(e),e.some(r=>er(r,n)))}function Lc(e){let t=String(e).toLowerCase();return Kt(t[0])&&(t=t.slice(1)),t==="action"||t==="formaction"}function jc(e,t){return`[webjs] a function was interpolated into ${String(e).toLowerCase()}= on <${t||"form"}>. Stringifying a function into HTML would leak its source (a 'use server' action's body included) to every visitor, so this is refused. To run a server action from a form, write an unquoted action=\${action} on the <form> itself or a formaction=\${action} on a <button> inside a bound form. Anywhere else, pass a URL string.`}var I,ss,ms,z,_e=w(()=>{yo();go();I="__webjs_action",ss="$$webjsAction";ms=new Set(["multipart/form-data","application/x-www-form-urlencoded"]);z=Symbol("webjs.attr.absent")});var _,S,O,M,To,Se,De,No,Ss,C,Co,ie,A,Ae=w(()=>{_=Symbol("webjs.slot.state"),S="data-webjs-light",O="data-projection",M="actual",To="fallback",Se=Symbol("webjs.slot.fallbackFrag"),De=Symbol("webjs.slot.templateOwner"),No="data-wj-slot-owner",Ss=64,C=Symbol("webjs.slot.rendering"),Co=Symbol("webjs.slot.intercepted"),ie=Symbol("webjs.slot.park"),A=new WeakSet});function F(e){let t=e,n=t[_];return n||(n={host:e,authored:[],assignedByName:new Map,lastSnapshot:new WeakMap},t[_]=n),n}function Gt(e){return!!e[_]}function ko(e){let t=F(e);for(;e.firstChild;){let n=e.firstChild;t.authored.push(n),A.add(n),e.removeChild(n)}se(t)}function se(e){let t=e.assignedByName;t.clear();for(let n of e.authored)Vc(t,ve(e,n),n)}function ve(e,t){let n=Jt(e,t);if(n)return H(n.getAttribute("name"));if(e.adoptedKey){let r=e.adoptedKey.get(t);if(r!==void 0)return r}return As(t)}function Ro(e){let t=F(e);t.adopted=!0;let n=new Set,r=e.querySelectorAll(`slot[${S}]`);for(let o of r){let i=o;if(!$(e,i)||i.getAttribute(O)!==M||ut(t,e,i))continue;let s=H(i.getAttribute("name"));if(!n.has(s)){n.add(s);let a=Array.from(i.childNodes);for(let c of a)t.authored.push(c),As(c)!==s&&(t.adoptedKey||(t.adoptedKey=new WeakMap),t.adoptedKey.set(c,s));t.lastSnapshot.set(i,a.slice())}}for(let o of e.querySelectorAll("wj-slot-park"))if($(e,o)){for(let i of Array.from(o.childNodes))A.add(i),t.authored.push(i);o.remove()}se(t)}function H(e){return e==null||e===""||e==="default"?null:e}function As(e){return e.nodeType!==1?null:H(e.getAttribute("slot"))}function Vc(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}var $e=w(()=>{Ue();Yt();He();Ae()});function vs(){ae||!G||(ae=Node.prototype.appendChild,Oo=Node.prototype.insertBefore,xe=Node.prototype.removeChild,cr=Node.prototype.replaceChild,Lo=Element.prototype.append,jo=Element.prototype.prepend,Po=Element.prototype.replaceChildren,Xt=Object.getOwnPropertyDescriptor(Element.prototype,"innerHTML"),lr=Object.getOwnPropertyDescriptor(Node.prototype,"textContent"))}function qe(e,t){let n=e[C];e[C]=!0;try{return t()}finally{e[C]=n,n||ur(e)}}function Io(e){if(!G)return;let t=e,n=F(e);n.backstop||(n.backstop=new MutationObserver(r=>Qt(e,n,r)),n.backstop.observe(e,{childList:!0,subtree:!1}),n.flipSensor=new MutationObserver(r=>xs(e,r)),n.flipSensor.observe(e,{attributes:!0,attributeFilter:["slot","name"],subtree:!0}))}function Qt(e,t,n){let r=e,o=r[ie],i=r[Symbol.for("webjs.instance")],s=!1,a=new Set;for(let c of n){for(let l of c.addedNodes)if(a.add(l),l!==o&&!(i&&Bo(i,l))){if(t.authored.indexOf(l)!==-1){s=!0;continue}A.add(l),t.authored.push(l),s=!0}for(let l of c.removedNodes){let u=t.authored.indexOf(l);if(u===-1||e.contains(l))continue;A.has(l)&&l.parentNode==null&&!a.has(l)||(t.authored.splice(u,1),s=!0)}}s&&W(e)}function ur(e){let t=e,n=t[_];if(!(n&&n.backstop))return;let r=n.backstop.takeRecords();(!(Symbol.for("webjs.instance")in t)||t[Symbol.for("webjs.instance")])&&Qt(e,n,r)}function xs(e,t){let n=e[_];if(!n)return;let r=!1;for(let o of t){if(o.type!=="attributes")continue;let i=o.target;o.attributeName==="name"?i.tagName==="SLOT"&&i.hasAttribute(S)&&$(e,i)&&(r=!0):o.attributeName==="slot"&&(n.adoptedKey&&n.adoptedKey.delete(i),n.authored.indexOf(i)!==-1&&(r=!0))}r&&W(e)}function Mo(e){let t=e[_];t&&(t.backstop&&(Qt(e,t,t.backstop.takeRecords()),t.backstop.disconnect(),t.backstop=void 0),t.flipSensor&&(xs(e,t.flipSensor.takeRecords()),t.flipSensor.disconnect(),t.flipSensor=void 0))}function Fo(e){if(!G)return;let t=e,n=t[_];if(!n)return;let r=t[Symbol.for("webjs.instance")],o=Symbol.for("webjs.instance")in t,i=!o&&n.adopted===!0,s=!1;for(let a of Array.from(e.childNodes))if(a!==t[ie]){if(n.authored.indexOf(a)!==-1){s=!0;continue}o&&(!r||Bo(r,a))||!o&&i||(A.add(a),n.authored.push(a),s=!0)}s&&W(e)}var ae,Oo,xe,cr,Lo,jo,Po,Xt,lr,fr=w(()=>{Ue();Yt();He();Zt();$e();Ae();ae=null,Oo=null,xe=null,cr=null,Lo=null,jo=null,Po=null,Xt=null,lr=null});function Bo(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 Es(e){let t=e,n=t[ie];return(!n||!n.isConnected)&&(n||(n=e.ownerDocument.createElement("wj-slot-park"),n.setAttribute("hidden",""),n.style.display="none",t[ie]=n),qe(e,()=>ae.call(e,n))),n}function We(e){return e instanceof Node||!!(e&&typeof e=="object"&&e.ownerDocument&&e.ownerDocument.defaultView&&e instanceof e.ownerDocument.defaultView.Node)}function Do(e,t,n){if(n&&!We(t))return[e.ownerDocument.createTextNode(`${t}`)];if(!We(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);dr(e,r);for(let o of r)xe.call(t,o);return r}return dr(e,[t]),[t]}function dr(e,t){ft(e,t);for(let n of t){if(!We(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 ft(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 $o(e,t,n){let r=e.authored;for(let i of t){let s=r.indexOf(i);s!==-1&&r.splice(s,1)}let o=n==null?r.length:r.indexOf(n);o===-1&&(o=r.length),r.splice(o,0,...t)}function qo(e,t){let n=e[_];return n?ut(n,e,t):!1}function ut(e,t,n){for(let r=n;r&&r!==t;r=r.parentNode)if(e.authored.indexOf(r)!==-1)return!0;return!1}function Ho(e,t){if(A.has(t))return!0;let n=t.parentNode;if(n==null)return!1;if(n===e||n===e[ie])return!0;let r=e[_];return n.nodeType===1&&n.tagName==="SLOT"&&n.hasAttribute(S)&&(r&&r.lastSnapshot.has(n)||e.contains(n)&&$(e,n))}function Uo(e,t){let n=[];for(let i of t)We(i)?i.nodeType===11?n.push({frag:i}):n.push({node:i}):n.push({text:`${i}`});for(let i of n)i.frag?ft(e,Array.from(i.frag.childNodes)):i.node&&dr(e,[i.node]);let r=e.ownerDocument.createDocumentFragment();for(let i of n)if(i.text!==void 0)ae.call(r,e.ownerDocument.createTextNode(i.text));else if(i.frag){let s=Array.from(i.frag.childNodes);dr(e,s);for(let a of s)ae.call(r,a)}else i.node&&(ft(e,[i.node]),ae.call(r,i.node));let o=Array.from(r.childNodes);ft(e,o);for(let i of o)xe.call(r,i);return o}function be(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);se(t),W(e)}function Wo(e){if(!G)return;let t=e;if(t[Co])return;vs(),t[Co]=!0;let n=F(e);t.appendChild=function(r){if(t[C])return ae.call(this,r);let o=Do(e,r,!1);for(let i of o)A.add(i);return $o(n,o,null),be(e,n,o),r},t.insertBefore=function(r,o){if(t[C])return Oo.call(this,r,o);if(!We(r))throw new TypeError("Failed to execute insertBefore on the host: parameter 1 is not of type Node.");if(o!=null&&!We(o))throw new TypeError("Failed to execute insertBefore on the host: parameter 2 is not of type Node.");if(ft(e,r.nodeType===11?Array.from(r.childNodes):[r]),o!=null&&(n.authored.indexOf(o)===-1||!Ho(e,o)))throw new DOMException("insertBefore: reference node is not an assigned child of this host","NotFoundError");if(r===o)return r;let i=Do(e,r,!1);for(let s of i)A.add(s);return $o(n,i,o||null),be(e,n,i),r},t.removeChild=function(r){if(t[C])return xe.call(this,r);let o=n.authored.indexOf(r);if(o===-1)return xe.call(this,r);if(!Ho(e,r))throw new DOMException("removeChild: the node is not an assigned child of this host","NotFoundError");return n.authored.splice(o,1),be(e,n,[r]),r},t.replaceChild=function(r,o){if(t[C])return cr.call(this,r,o);if(n.authored.indexOf(o)===-1)return cr.call(this,r,o);if(!We(r))throw new TypeError("Failed to execute replaceChild on the host: parameter 1 is not of type Node.");if(ft(e,r.nodeType===11?Array.from(r.childNodes):[r]),!Ho(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 s=Do(e,r,!1);for(let c of s)A.add(c);for(let c of s){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,...s),be(e,n,[...s,o]),o},t.append=function(...r){if(t[C])return Lo.apply(this,r);let o=Uo(e,r);for(let i of o)A.add(i);$o(n,o,null),be(e,n,o)},t.prepend=function(...r){if(t[C])return jo.apply(this,r);let o=Uo(e,r);for(let i of o)A.add(i);for(let i of o){let s=n.authored.indexOf(i);s!==-1&&n.authored.splice(s,1)}n.authored.unshift(...o),be(e,n,o)},t.replaceChildren=function(...r){if(t[C])return Po.apply(this,r);let o=Uo(e,r);for(let s of o)A.add(s);let i=n.authored;n.authored=o.slice(),be(e,n,[...i,...o])},Object.defineProperty(t,"innerHTML",{configurable:!0,get(){return Xt.get.call(this)},set(r){if(t[C]){Xt.set.call(this,r);return}let o=e.ownerDocument.createElement("div");Xt.set.call(o,r===null?"":`${r}`);let i=Array.from(o.childNodes);for(let a of i)A.add(a);let s=n.authored;n.authored=i,be(e,n,[...s,...i])}}),Object.defineProperty(t,"textContent",{configurable:!0,get(){return lr.get.call(this)},set(r){if(t[C]){lr.set.call(this,r);return}let o=r==null||r===""?[]:[e.ownerDocument.createTextNode(`${r}`)];for(let s of o)A.add(s);let i=n.authored;n.authored=o,be(e,n,[...i,...o])}})}var Ts,Yt=w(()=>{Ue();He();Zt();fr();$e();Ae();Ts=new Set});function Ee(e,t,n){let r=F(e),o=H(t),i=Array.isArray(n)?n.filter(Boolean):n?[n]:[],s=r.authored.findIndex(c=>ve(r,c)===o),a=r.authored.filter(c=>ve(r,c)===o);r.authored=r.authored.filter(c=>ve(r,c)!==o),(s===-1||s>r.authored.length)&&(s=r.authored.length);for(let c of i)c.nodeType===1&&!Jt(r,c)&&(o==null?c.removeAttribute("slot"):c.setAttribute("slot",o)),A.add(c);if(r.authored.splice(s,0,...i),r.applying&&r.pendingRecordNodes){for(let c of a)r.pendingRecordNodes.add(c);for(let c of i)r.pendingRecordNodes.add(c)}else r.pendingRecordNodes=new Set([...a,...i]);if(r.adoptedKey){for(let c of a)r.adoptedKey.delete(c);for(let c of i)r.adoptedKey.delete(c)}se(r),W(e)}function W(e){if(!G)return;let t=e[_];if(t){if(t.applying){t.reapply=!0;return}t.applying=!0;try{do{t.reapply=!1;let n=t.pendingRecordNodes||Ts;t.pendingRecordNodes=void 0,zc(e,t,n),Gc(e,t),se(t);let r=[],o=new Set;for(let u of e.querySelectorAll(`slot[${S}]`))if($(e,u)&&!ut(t,e,u)){if(!u.hasAttribute(O)&&!(Se in u)){o.add(H(u.getAttribute("name")));continue}r.push(u)}let i=new Map;for(let u of r){let f=H(u.getAttribute("name")),p=i.get(f);p||(p=[],i.set(f,p)),p.push(u)}let s=[];for(let[u,f]of i){let p=t.assignedByName.get(u)||[];for(let d=0;d<f.length;d++){let m=f[d],b=p.filter(g=>{let h=Jt(t,g);return h?h===m:d===0}),y=b.filter(g=>g===e||g.nodeType===1&&g.contains(e));if(y.length){for(let g of y)A.delete(g);b=b.filter(g=>y.indexOf(g)===-1)}b.length>0?Ko(t,m,b)&&s.push(m):Vo(t,m)&&s.push(m)}}for(let u of s)zo(t,u);let a=new Set(i.keys());for(let u of o)a.add(u);let c=new Set;for(let u of t.authored)a.has(ve(t,u))||c.add(u);let l=e[ie];if(l)for(let u of Array.from(l.childNodes))c.has(u)||xe.call(l,u);if(c.size){let u=Es(e);for(let f of c)f.parentNode!==u&&(A.delete(f),qe(e,()=>ae.call(u,f)))}if(t.backstop){let u=t.backstop.takeRecords();u.length&&Qt(e,t,u)}}while(t.reapply)}finally{t.applying=!1}}}function zc(e,t,n){for(let r of e.querySelectorAll(`slot[${S}][${O}="${M}"]`)){if(!$(e,r)||ut(t,e,r))continue;let o=r,i=t.lastSnapshot.get(o);if(!i)continue;let s=Array.from(o.childNodes);if(pr(s,i))continue;let a=t.authored,c=H(o.getAttribute("name")),l=s.filter(m=>!n.has(m));for(let m of l)a.indexOf(m)===-1&&ve(t,m)!==c&&(t.adoptedKey||(t.adoptedKey=new WeakMap),t.adoptedKey.set(m,c));for(let m of a){if(l.indexOf(m)!==-1||ve(t,m)!==c)continue;let b=a.indexOf(m),y=0;for(let g=0;g<l.length;g++){let h=a.indexOf(l[g]);h!==-1&&h<b&&(y=g+1)}l.splice(y,0,m)}let u=new Set(l);for(let m of i)u.add(m);let f=-1,p=0;for(let m of a){if(u.has(m)){f===-1&&(f=p);continue}p+=1}let d=a.filter(m=>!u.has(m));(f===-1||f>d.length)&&(f=d.length),d.splice(f,0,...l),t.authored=d}}function Gc(e,t){let n=e[ie];t.authored=t.authored.filter(r=>{if(A.has(r))return!0;let o=r.parentNode;return o==null?!1:!!(o===e||o===n||o.nodeType===1&&o.tagName==="SLOT"&&o.hasAttribute(S)&&(t.lastSnapshot.has(o)||e.contains(o)&&$(e,o)))})}var Zt=w(()=>{Ue();Yt();He();fr();$e();Ae()});function ks(){return typeof HTMLElement<"u"&&typeof HTMLSlotElement<"u"}function Rs(){if(Ns||(G=ks(),!G))return;en=HTMLSlotElement.prototype.assignedNodes,Go=HTMLSlotElement.prototype.assignedElements,hr=Object.getOwnPropertyDescriptor(Element.prototype,"assignedSlot"),HTMLSlotElement.prototype.assignedNodes=function(n){return this.hasAttribute(S)&&!Jo(this)?Xo(this,n):en?en.call(this,n):[]},HTMLSlotElement.prototype.assignedElements=function(n){return this.hasAttribute(S)&&!Jo(this)?Xo(this,n).filter(r=>r.nodeType===1):Go?Go.call(this,n):[]},Object.defineProperty(Element.prototype,"assignedSlot",{configurable:!0,enumerable:!0,get:function(){let n=hr&&hr.get?hr.get.call(this):null;return n||Cs(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||Cs(this)}}),Yo=HTMLSlotElement.prototype.assign,HTMLSlotElement.prototype.assign=function(...n){if(this.hasAttribute(S)&&!Jo(this)){let r=Yc(this);if(r){let o=F(r);o.manualAssign||(o.manualAssign=new Map);let i=n.filter(Boolean);for(let[s,a]of o.manualAssign){if(s===this)continue;let c=a.filter(l=>{let u=l.deref();return u!==void 0&&i.indexOf(u)===-1});c.length!==a.length&&(c.length?o.manualAssign.set(s,c):o.manualAssign.delete(s))}if(i.length?o.manualAssign.set(this,i.map(s=>new WeakRef(s))):o.manualAssign.delete(this),o.applying&&o.pendingRecordNodes)for(let s of i)o.pendingRecordNodes.add(s);else o.pendingRecordNodes=new Set(i);se(o),W(r)}return}return Yo?Yo.apply(this,n):void 0},Ns=!0}function Jt(e,t){let n=e.manualAssign;if(!n||!n.size)return null;for(let[r,o]of n){let i=!1,s=o.filter(a=>{let c=a.deref();return c===void 0?!1:(c===t&&(i=!0),!0)});if(s.length!==o.length&&(s.length?n.set(r,s):n.delete(r)),i){let a=e.host;return a&&(r===a||a.contains(r))?r:null}}return null}function Yc(e){for(let t=e.parentElement;t;t=t.parentElement)if(t[_])return $(t,e)?t:null;return null}function Jo(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 Xo(e,t){if(e.getAttribute(O)!==M)return[];let n=Array.from(e.childNodes);return!t||!t.flatten?n:Qo(n,new Set,0)}function Qo(e,t,n){if(n>=Ss)return e.slice();let r=[];for(let o of e)if(o.nodeType===1&&o.tagName==="SLOT"){let i=o;if(t.has(i))continue;if(t.add(i),i.hasAttribute(S)){let s=Xo(i,{flatten:!1});if(s.length>0)for(let a of Qo(s,t,n+1))r.push(a);else for(let a of Qo(Array.from(i.childNodes),t,n+1))r.push(a)}else if(en){let s=en.call(i,{flatten:!0});for(let a of s)r.push(a)}else r.push(o)}else r.push(o);return r}function Cs(e){let t=e.parentElement;return t&&t.tagName==="SLOT"&&t.hasAttribute(S)&&t.getAttribute(O)===M?t:null}var G,en,Go,hr,Yo,Ns,He=w(()=>{Ue();Zt();$e();Ae();G=ks(),en=null,Go=null,hr=null,Yo=null,Ns=!1;Rs()});function Zo(e){if(!G)return!1;for(let t of e.querySelectorAll(`slot[${S}][${O}]`))if($(e,t))return!0;return!1}function $(e,t){let n=t[De];if(n)return n===e;let r=typeof t.getAttribute=="function"?t.getAttribute(No):null;if(r){let o=Jc(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 Jc(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 Ko(e,t,n){for(let l of n)A.delete(l);let r=t.getAttribute(O)!==M,o=e.lastSnapshot.get(t)||[],i=r||!pr(o,n);if(!r&&pr(Array.from(t.childNodes),n))return e.lastSnapshot.set(t,n.slice()),i;let s=t[Se];if(r&&s)for(;t.firstChild;)s.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(O,M),e.lastSnapshot.set(t,n.slice()),i}function Vo(e,t){let n=t.getAttribute(O)===M;if(t.setAttribute(O,To),!n)return Os(t),!1;for(e.lastSnapshot.delete(t);t.firstChild;)t.removeChild(t.firstChild);return Os(t),!0}function Os(e){let t=e[Se];!t||t.childNodes.length===0||e.appendChild(t)}function ei(e,t){if(!Gt(e))return;let n=F(e),r=H(t.getAttribute("name")),o=n.assignedByName.get(r);if(o)for(let i of o)i.parentNode===t&&(A.add(i),t.removeChild(i));n.lastSnapshot.delete(t)}function Ls(e){e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1}))}function zo(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)Ls(r)}))}function pr(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 Ue=w(()=>{He();$e();Ae()});var Ke=w(()=>{Ue();Yt();He();Zt();fr();$e();Ae()});function ra(e,t,n){Dl.has(t)?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}async function gi(e){return JSON.stringify(await oa(e))}function Je(e){return ia(JSON.parse(e))}async function oa(e){let t=$l();return await Hl(e,t),Ye(e,t)}function ia(e){return Ce(e,Kl())}function $l(){return{refCount:new Map,idOf:new Map,emitted:new Set,nextId:0,blobBytes:new Map,fdEntries:new Map}}async function Hl(e,t){let n=[e];for(;n.length;){let r=n.pop();if(!zl(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 i=new Uint8Array(await r.arrayBuffer());t.blobBytes.set(r,i);continue}if(typeof FormData<"u"&&r instanceof FormData){let i=t.fdEntries.get(r)||[...r.entries()];t.fdEntries.set(r,i);for(let[,s]of i)typeof s!="string"&&n.push(s);continue}if(Array.isArray(r))for(let i=0;i<r.length;i++)n.push(r[i]);else if(r instanceof Map)for(let[i,s]of r)n.push(i),n.push(s);else if(r instanceof Set)for(let i of r)n.push(i);else if(Gl(r))for(let i in r)Object.prototype.hasOwnProperty.call(r,i)&&n.push(r[i])}}for(let[r,o]of t.refCount)o>1&&t.idOf.set(r,t.nextId++)}function Ye(e,t){if(e===null)return null;if(e===void 0)return{[N]:"undef"};let n=typeof e;if(n==="string"||n==="boolean")return e;if(n==="number")return Number.isNaN(e)?{[N]:"NaN"}:e===1/0?{[N]:"Inf"}:e===-1/0?{[N]:"-Inf"}:Object.is(e,-0)?{[N]:"-0"}:e;if(n==="bigint")return{[N]:"BigInt",v:e.toString()};if(n==="symbol"){let i=Symbol.keyFor(e);if(i===void 0)throw new TypeError("Cannot serialize a local Symbol; only Symbol.for() registered symbols are supported.");return{[N]:"Sym",v:i}}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{[N]:"Ref",v:r};r!==void 0&&t.emitted.add(r);let o;if(e instanceof Date)o={[N]:"Date",v:Number.isNaN(e.getTime())?null:e.toISOString()};else if(e instanceof Error)o={[N]:"Error",v:{name:e.name,message:e.message,stack:e.stack||null}};else if(typeof Blob<"u"&&e instanceof Blob){let i=t.blobBytes.get(e);typeof File<"u"&&e instanceof File?o={[N]:"File",v:ln(i),n:e.name,t:e.type||"",m:e.lastModified}:o={[N]:"Blob",v:ln(i),t:e.type||""}}else if(typeof FormData<"u"&&e instanceof FormData){let i=t.fdEntries.get(e)||[...e.entries()],s=[];for(let[a,c]of i)s.push([a,Ye(c,t)]);o={[N]:"FD",v:s}}else if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)o=Ul(e);else if(e instanceof Map){let i=[];for(let[s,a]of e)i.push([Ye(s,t),Ye(a,t)]);o={[N]:"Map",v:i}}else if(e instanceof Set){let i=[];for(let s of e)i.push(Ye(s,t));o={[N]:"Set",v:i}}else if(Array.isArray(e))o=e.map(i=>Ye(i,t));else{o={};for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i))continue;let s=Yl(i)?"_"+i:i;ra(o,s,Ye(e[i],t))}}if(r!==void 0){if(Array.isArray(o))return{[N]:"Arr",_id:r,v:o};o._id=r}return o}function Ul(e){if(e instanceof ArrayBuffer)return{[N]:"buf",v:ln(new Uint8Array(e))};if(e instanceof DataView)return{[N]:"dv",v:ln(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))};let t=e.constructor.name,n=ql[t];if(!n)throw new TypeError(`Unsupported typed array: ${t}`);let r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return{[N]:n,v:ln(r)}}function Kl(){return{refs:new Map}}function Ce(e,t){if(e===null||typeof e!="object")return e;if(Array.isArray(e)){let i=[];for(let s=0;s<e.length;s++)i.push(Ce(e[s],t));return i}let n=e[N];if(typeof n=="string")return Vl(e,n,t);let r={},o=e._id;typeof o=="number"&&t.refs.set(o,r);for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i)||i==="_id")continue;let s=Jl(i)?i.slice(1):i;ra(r,s,Ce(e[i],t))}return r}function Vl(e,t,n){let r=e._id,o=i=>(typeof r=="number"&&n.refs.set(r,i),i);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 i=new Error(e.v.message);return i.name=e.v.name,e.v.stack&&(i.stack=e.v.stack),typeof r=="number"&&n.refs.set(r,i),i}case"Map":{let i=new Map;typeof r=="number"&&n.refs.set(r,i);for(let[s,a]of e.v)i.set(Ce(s,n),Ce(a,n));return i}case"Set":{let i=new Set;typeof r=="number"&&n.refs.set(r,i);for(let s of e.v)i.add(Ce(s,n));return i}case"Arr":{let i=[];typeof r=="number"&&n.refs.set(r,i);for(let s of e.v)i.push(Ce(s,n));return i}case"Ref":{let i=n.refs.get(e.v);if(i===void 0)throw new TypeError(`Dangling reference: id=${e.v}`);return i}case"Blob":{if(typeof Blob>"u")throw new TypeError("Blob is not available in this environment.");let i=cn(e.v);return o(new Blob([i],{type:e.t||""}))}case"File":{if(typeof File>"u")throw new TypeError("File is not available in this environment.");let i=cn(e.v);return o(new File([i],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 i=new FormData;o(i);for(let[s,a]of e.v){let c=Ce(a,n);i.append(s,c)}return i}default:{if(t==="buf"){let s=cn(e.v);return o(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength))}if(t==="dv"){let s=cn(e.v);return o(new DataView(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)))}let i=Wl[t];if(i){let s=cn(e.v),a=s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength);return o(new i(a))}throw new TypeError(`Unknown serialization tag: ${t}`)}}}function zl(e){return e!==null&&typeof e=="object"}function Gl(e){if(e===null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Yl(e){return/^_+\$wj$/.test(e)||/^_+id$/.test(e)}function Jl(e){return/^__+\$wj$/.test(e)||/^__+id$/.test(e)}function ln(e){if(sa)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 cn(e){if(sa){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 N,Dl,ql,Wl,sa,un=w(()=>{N="_$wj",Dl=new Set(["__proto__","constructor","prototype"]);ql={Int8Array:"i8",Uint8Array:"u8",Uint8ClampedArray:"u8c",Int16Array:"i16",Uint16Array:"u16",Int32Array:"i32",Uint32Array:"u32",Float32Array:"f32",Float64Array:"f64",BigInt64Array:"bi64",BigUint64Array:"bu64"},Wl={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};sa=typeof Buffer<"u"&&typeof Buffer.from=="function"});var Aa={};os(Aa,{observeLazy:()=>yu,observeViewportOnce:()=>_u});function Sa(e){let t=Si.get(e);return t||(t=import(e).finally(()=>Si.delete(e)),Si.set(e,t),t)}function yu(e){for(let[t,n]of Object.entries(e))Xe.set(t.toLowerCase(),n);if(typeof IntersectionObserver>"u"){for(let t of Xe.values())Sa(t);Xe.clear();return}hn||(hn=new IntersectionObserver(gu,{rootMargin:"200px"})),_a(),typeof MutationObserver<"u"&&new MutationObserver(()=>_a()).observe(document.body,{childList:!0,subtree:!0})}function _a(){if(!(!hn||!Xe.size))for(let e of Xe.keys())for(let t of document.querySelectorAll(e))hn.observe(t)}function gu(e){for(let t of e){if(!t.isIntersecting)continue;let n=t.target.tagName.toLowerCase(),r=Xe.get(n);r&&(Sa(r),Xe.delete(n),hn?.unobserve(t.target))}}function wu(e){for(let t of e){if(!t.isIntersecting)continue;let n=kr.get(t.target);kr.delete(t.target),pn?.unobserve(t.target),n&&n()}}function _u(e,t){return typeof IntersectionObserver>"u"?(t(),()=>{}):(pn||(pn=new IntersectionObserver(wu,{rootMargin:"200px"})),kr.set(e,t),pn.observe(e),()=>{kr.delete(e),pn?.unobserve(e)})}var Xe,hn,Si,pn,kr,va=w(()=>{Xe=new Map,hn=null,Si=new Map;pn=null,kr=new WeakMap});var Ai,vi=w(()=>{Ai=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(()=>(va(),Aa)).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(()=>(Rr(),xa)).then(({loadFrame:n})=>{this._webjsLoadedSrc!==t||!this.isConnected||n(this,t)})}}:null;typeof customElements<"u"&&Ai&&!customElements.get("webjs-frame")&&customElements.define("webjs-frame",Ai)});function Au(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 Ei(e,t){let n=t||(typeof document<"u"?document:null);if(!n)return;let r=null;if(typeof e=="string"){let i=n.createElement("template");i.innerHTML=e,r=i.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 i of o)n.body.append(i);else n.body.append(r)}var Su,xi,mn=w(()=>{Su=new Set(["append","prepend","before","after","replace","update"]);xi=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 s=n.getElementById(o);s&&(r=[s])}else{let s=this.getAttribute("targets");if(s)try{r=Array.from(n.querySelectorAll(s))}catch{r=[]}}let i=Su.has(t)?this.querySelector("template"):null;try{for(let s of r){let a=i?i.content.cloneNode(!0):null;Au(t,s,a)}}finally{this.remove()}}}:null;typeof customElements<"u"&&xi&&!customElements.get("webjs-stream")&&customElements.define("webjs-stream",xi)});var Ea,Ta=w(()=>{Ea=typeof HTMLElement<"u"?class extends HTMLElement{connectedCallback(){this.style.display||(this.style.display="contents")}}:null;typeof customElements<"u"&&Ea&&!customElements.get("webjs-suspense")&&customElements.define("webjs-suspense",Ea)});function Or(e,t){let n=typeof document<"u"?document:null,r=e||n;if(!r||typeof r.querySelectorAll!="function")return;if(t&&t.frame===!0){Ti(r,!0);return}ka();let o=r===n,i=!!n&&!o&&typeof n.contains=="function"&&n.contains(r),s=!!n&&!o&&!i;s&&(Ti(n,!0),ke.clear(),Ci.clear()),(o||s)&&(Ni=!0);let a=L.ingested+L.replaced;Eu(Ti(r),a)}function Ti(e,t){let n=null;for(let r of e.querySelectorAll('script[type="application/json"]#__webjs-seeds, script[type="application/json"][data-webjs-seeds]')){let o=xu(r.getAttribute?.("data-webjs-dev"));o!==null&&(n=o),Na(t?null:r.textContent,r)}for(let r of e.querySelectorAll("[data-webjs-seed]"))Na(t?null:r.getAttribute("data-webjs-seed"),r,()=>r.removeAttribute("data-webjs-seed"));return n}function Na(e,t,n){if(e)try{let r=Je(e);if(r&&typeof r=="object")for(let o in r){ke.has(o)?L.replaced++:L.ingested++,ke.set(o,r[o]);let i=o.indexOf("/",o.indexOf("/")+1);i>0&&Ci.add(o.slice(0,i))}}catch{}n?n():t.remove?.()}function xu(e){return typeof e!="string"?null:e||"ok"}function Eu(e,t){if(e===null)return;let n=++vu;wt={epoch:n,hits:L.hits,misses:L.misses,keyMisses:L.keyMisses,merged:t,marker:e};let r=()=>{!wt||wt.epoch!==n||ka()};try{typeof requestIdleCallback=="function"?requestIdleCallback(r,{timeout:1e3}):setTimeout(r,250)}catch{wt=null}}function ka(){let e=wt;if(wt=null,!!e)try{Tu(e)}catch{}}function Tu(e){let t=L.hits-e.hits,n=L.misses-e.misses,r=L.ingested+L.replaced-e.merged,o=L.keyMisses-e.keyMisses;if(n===0)return;let i=e.marker==="streamed"?"This page streams (a Suspense or <webjs-suspense> boundary), and a streamed render emits no seeds, so every action call on it goes to the network.":e.marker==="drop"?"The page's seeds could not be serialized, so the whole block was dropped. Something an action returned is not serializer-safe; the server response reports collected above emitted.":o===0?null:"The key is the action file hash plus the function name plus the serialized arguments, so an argument the SSR render never used misses (a deliberate refetch after hydration misses too, and is expected). A miss on an action this page never seeded is NOT counted here, because a mutation or a client-only read could never have been seeded.";if(i===null)return;let a=e.marker==="streamed"||e.marker==="drop"?`${n} of ${t+n} action call(s) in the hydration window went to the network`:`${o} action call(s) in the hydration window asked for a key this page seeded under DIFFERENT arguments`;console.warn(`[webjs] SSR action seeding: ${a} (${r} seed(s) on this page, ${ke.size} still unconsumed). ${i} See https://webjs.dev/docs/data-fetching for the seeding reference.`)}function Nu(e,t,n){Ni||(Ni=!0,Or());let r=`${e}/${t}/${n}`;if(ke.has(r)){let o=ke.get(r);return ke.delete(r),L.hits++,o}return L.misses++,Ci.has(`${e}/${t}`)&&L.keyMisses++,Ca}function Cu(){return{...L,pending:ke.size}}var ke,Ca,Ni,L,Ci,wt,vu,Lr=w(()=>{un();ke=new Map,Ca=Symbol("webjs.seed.miss"),Ni=!1,L={ingested:0,replaced:0,hits:0,misses:0,keyMisses:0},Ci=new Set,wt=null,vu=0});function ki(e){if(!(!Array.isArray(e)||!e.length)){jr+=1;for(let t of e)t&&Ra.set(t,jr)}}function Ru(){return jr}function Ou(e,t,n){if(!(!Array.isArray(t)||!t.length)&&(_t.delete(e),_t.set(e,{tags:t.slice(),since:typeof n=="number"?n:jr}),_t.size>ku)){let r=_t.keys().next().value;r!==void 0&&_t.delete(r)}}function Lu(e){let t=_t.get(e);if(!t)return!1;for(let n of t.tags)if((Ra.get(n)||0)>t.since)return!0;return!1}function Ri(e){return e?e.split(",").map(t=>t.trim()).filter(Boolean):[]}var jr,Ra,_t,ku,Pr=w(()=>{jr=0,Ra=new Map,_t=new Map,ku=1e3});function Oa(e){return St.test(e)}var Oi,Li,St,bn,Qe,At,Ir,La,q=w(()=>{Oi="text/vnd.webjs-stream.html",Li=["wheel","touchmove","keydown","pointerdown"],St=/\.(?: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,bn="_top",Qe="webjs:nav-fallback",At=new Set(["value","checked","selected","indeterminate","disabled","open","popover"]),Ir="name=csp-nonce";La=250});function Re(e,t,n="warn"){if(ji.has(e)||(ji.add(e),typeof console>"u"))return;let r=n==="error"?console.error:console.warn;r&&r.call(console,t)}function Pa(e,t,n,r){if(typeof process<"u"&&process.env||!r.has(I))return;let o="";try{o=new URL(e.getAttribute("action")||location.href,location.href).pathname}catch{o=location.pathname}if(n!=="post"){Re(`submit-nowhere:${o}:${n}`,`[webjs] this submission carries a bound server action's identity but submits as ${n.toUpperCase()}, which sends no body, so the identity rides the query string and the action never runs. A submitter's own formmethod overrides the form's, and WebJs honours it rather than refusing it, so check for a formmethod on the button that was pressed.`,"error");return}let i=t&&t.getAttribute("formenctype")||e.getAttribute("enctype")||"application/x-www-form-urlencoded";if(i.toLowerCase()==="text/plain"){Re(`submit-nowhere:${o}:${i}`,`[webjs] this submission carries a bound server action's identity but declares enctype="${i}", which the server cannot parse. The router declines to send it so both paths behave the same way, and both are answered with a 405. Drop the enctype and let the binding supply it.`,"error");return}o&&o!==location.pathname&&Re(`submit-elsewhere:${o}`,`[webjs] this submission carries a bound server action's identity but posts to "${o}" rather than this page, because the enclosing <form> declares its own action. A bound submitter emits no formaction, so the form's target wins, which is what native HTML does. The action runs only if "${o}" is a page route; against a route.ts or another origin the identity is ignored and nothing runs. Drop the form's action attribute to keep the submission on this page.`)}function Ii(e,t){return!e&&!t&&typeof document<"u"&&document.readyState==="loading"}function Mr(e,t,n,r){if(e!=="navigate"||!t||r&&r===n)return!1;try{return new URL(t).origin===new URL(n).origin}catch{return!1}}function Ia(){if(typeof location>"u"||ja)return;ja=!0;let e=null;try{e=sessionStorage.getItem(Qe),sessionStorage.removeItem(Qe)}catch{}let t="";try{let n=performance.getEntriesByType("navigation")[0];t=n?n.type:""}catch{}Mr(t,document.referrer,location.href,e)&&ee("pre-boot-navigation",location.href,!1)}function ee(e,t,n=!0){if(n)try{sessionStorage.setItem(Qe,t)}catch{}if(typeof document<"u"&&typeof CustomEvent<"u")try{document.dispatchEvent(new CustomEvent("webjs:navigation-fallback",{detail:{cause:e,href:t,willReload:n}}))}catch{}typeof process<"u"&&process.env||Re(`fallback:${e}`,n?`[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.`:`[webjs] client router degraded a soft navigation (${e}) for ${t}, without a full page load.`)}function Ma(e){typeof process<"u"&&process.env||Re(`stream-drop:${e}`,`[webjs] dropped a streamed Suspense resolve for "${e}": no #${e} boundary in the DOM. Benign if this navigation was superseded or degraded. A stuck skeleton here means the shell swap did not place the boundary.`)}function Fa(){if(typeof process<"u"&&process.env||Pi||typeof document>"u"||typeof getComputedStyle!="function")return;let e=document.documentElement;if(!e)return;Pi=!0;let t;try{t=getComputedStyle(e).scrollBehavior}catch{return}t==="smooth"&&Re("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 yn(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 Ba(){ji.clear(),Pi=!1}function Da(e,t){return Ii(e,t)}var ji,ja,Pi,te=w(()=>{_e();q();ji=new Set;ja=!1;Pi=!1});function ne(e){let t=new Map,n=[],r=!1;function o(i){if(!r){if(i.nodeType===8){let s=i.data.trim();if(s.startsWith("wj:children:")){let a=s.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:i});return}if(s.startsWith("/wj:children")){let a=s.slice(12).replace(/^:/,""),c=n.pop();if(!c||c.segment!==a){r=!0;return}if(c.start.parentNode!==i.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:i});return}return}if(i.hasChildNodes&&i.hasChildNodes())for(let s=i.firstChild;s&&!r;s=s.nextSibling)o(s)}}return o(e),r||n.length>0?null:t}function gn(e,t){let n=[...e.keys()].filter(s=>t.has(s)).sort((s,a)=>s.length-a.length);if(n.length===0)return null;for(let s of n)if(e.get(s).routeKey!==t.get(s).routeKey){let a=null;for(let c of n){if(c===s)break;s.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=s=>{let a=null;for(let c of s.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 ue(){let e=ne(document.body);return e?[...e.entries()].map(([t,n])=>`${t}:${n.routeKey}`).join(","):""}var Oe=w(()=>{});function $a(e){fe=e||(t=>{location.href=t})}function Ha(){return k}function Ua(){return++k}function Fr(){return++k}function Mi(e){K=e}function qa(e){wn=e}function Wa(e){let t=wn!==null&&wn===e;return wn=null,t}function Br(){wn=null}var k,fe,K,wn,ye=w(()=>{k=0,fe=e=>{location.href=e};K=!1;wn=null});function Ze(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"&&ju()?Document.parseHTMLUnsafe(e):Pu(e)}function ju(){if(vt!==null)return vt;try{vt=Document.parseHTMLUnsafe("<!doctype html><body><!--c--><i></i>")?.body?.firstChild?.nodeType===8}catch{vt=!1}return vt}function Fi(){vt=null}function Pu(e){return typeof DOMParser>"u"?null:new DOMParser().parseFromString(e,"text/html")}var vt,_n=w(()=>{vt=null});function Dr(e){for(let t of e.composedPath())if(t instanceof HTMLAnchorElement)return t;return null}function Bi(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}var $r=w(()=>{});function Sn(e,t){return((t&&t.hasAttribute("formmethod")?t.getAttribute("formmethod")||"":e.getAttribute("method")||"")||"get").toLowerCase()}function An(e,t){return t&&t.hasAttribute("formaction")?t.getAttribute("formaction")||"":e.getAttribute("action")||e.action||location.href}function Iu(e){let t=String(e||"").toLowerCase();return t==="multipart/form-data"?"multipart/form-data":t==="text/plain"?"text/plain":"application/x-www-form-urlencoded"}function vn(e,t){return Iu(t&&t.hasAttribute("formenctype")?t.getAttribute("formenctype"):e.getAttribute("enctype"))}function xn(e,t){if(t==="multipart/form-data")return e;let n=new URLSearchParams;for(let[r,o]of e)n.append(r,typeof o=="string"?o:o.name);return n}function En(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}}var Hr=w(()=>{});function Ka(){if(typeof document>"u")return"";let e=document.querySelector('meta[name="csp-nonce"]');return e&&e.getAttribute("content")||""}function Tn(e){let t=document.createElement("script");for(let r of e.attributes)r.name!=="nonce"&&t.setAttribute(r.name,r.value);let n=Ka();return n&&t.setAttribute("nonce",n),t.textContent=e.textContent,t}function Di(e){if(!e.hasAttribute("nonce"))return e.cloneNode(!0);let t=e.cloneNode(!0),n=Ka();return n?t.setAttribute("nonce",n):t.removeAttribute("nonce"),t}function de(e){if(!e.hasAttribute("nonce"))return e.outerHTML;let t=e.cloneNode(!0);return t.removeAttribute("nonce"),t.outerHTML}function Ur(e){let t=e.getAttribute("name");if(t)return"name="+t;let n=e.getAttribute("property");if(n)return"property="+n;let r=e.getAttribute("http-equiv");return r?"http-equiv="+r:e.hasAttribute("charset")?"charset":null}function Mu(e){if(!e.querySelector("meta"))return;let t=o=>{let i=new Map;for(let s of o.querySelectorAll("meta")){let a=Ur(s);if(!a||a===Ir)continue;let c=i.get(a);c?c.push(s):i.set(a,[s])}return i},n=t(e),r=t(document.head);for(let[o,i]of n){let s=r.get(o)||[],a=i.map(de).join(`
|
|
2
2
|
`),c=s.map(de).join(`
|
|
3
|
-
`);if(a!==c){if(i.length===1&&s.length===1){let l=s[0];for(let u of[...l.attributes])l.removeAttribute(u.name);for(let u of i[0].attributes)l.setAttribute(u.name,u.value);continue}for(let l of s)l.remove();for(let l of i)document.head.appendChild(Di(l))}}for(let[o,i]of r)if(!n.has(o))for(let s of i)s.remove()}function xt(e){let t=e.querySelector("title");t&&(document.title=t.textContent||"");let n=new Set;for(let r of document.head.children)n.add(de(r));for(let r of e.children)r.tagName==="SCRIPT"&&r.getAttribute("type")==="importmap"||r.tagName!=="BASE"&&r.tagName!=="TITLE"&&(r.tagName==="META"&&Ur(r)||n.has(de(r))||(r.tagName==="SCRIPT"?document.head.appendChild(Tn(r)):document.head.appendChild(Di(r))));Pu(e)}function Iu(e){return e.tagName==="STYLE"?!0:e.tagName==="LINK"&&(e.getAttribute("rel")||"").toLowerCase().split(/\s+/).includes("stylesheet")}function Nn(e){let t=document.head,n=e.querySelector("title");n&&(document.title=n.textContent||"");let r=new Set;for(let i of t.children)i.tagName==="SCRIPT"&&i.getAttribute("type")==="importmap"||i.tagName!=="BASE"&&r.add(de(i));let o=new Set;for(let i of e.children)i.tagName==="SCRIPT"&&i.getAttribute("type")==="importmap"||i.tagName!=="BASE"&&o.add(de(i));for(let i of[...t.children])i.tagName==="SCRIPT"&&i.getAttribute("type")==="importmap"||i.tagName!=="BASE"&&i.tagName!=="TITLE"&&(Iu(i)||i.tagName==="META"&&Ur(i)===Ir||o.has(de(i))||i.remove());for(let i of e.children)i.tagName==="SCRIPT"&&i.getAttribute("type")==="importmap"||i.tagName!=="BASE"&&i.tagName!=="TITLE"&&(i.tagName==="META"&&Ur(i)===Ir||r.has(de(i))||(i.tagName==="SCRIPT"?t.appendChild(Tn(i)):t.appendChild(Di(i))))}var Cn=w(()=>{q()});function Kr(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 re(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===bn)return null;let r=typeof document<"u"?document.getElementById(n):null;return r&&r.tagName&&r.tagName.toLowerCase()==="webjs-frame"?n:(Re(`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 Kr(e)}function $i(e){if(!e||typeof document>"u")return null;let t=null;try{t=document.querySelector(`webjs-frame#${CSS.escape(e)}`)}catch{t=document.getElementById(e)}return!t||!t.tagName||t.tagName.toLowerCase()!=="webjs-frame"?null:t}function kn(e,t){let n=$i(e);if(!n)return null;let r=qr.has(n);return qr.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 Rn(e,t){if(qr.get(e)!==t)return;qr.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 On(e,t,n){let r=Wr.has(e);return Wr.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 Ln(e,t,n,r){if(Wr.get(e)!==t)return;Wr.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 Hi(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+=de(r);return n}var qr,Wr,Le=w(()=>{q();te();Cn();qr=new WeakMap;Wr=new WeakMap});function za(e,t){if(typeof document>"u"||!document.documentElement)return()=>{};Y&&Y();let n=document.documentElement,r=n.style.getPropertyValue("overflow-anchor");n.style.setProperty("overflow-anchor","none");let o=null,i=typeof t=="number",a=i&&typeof setTimeout=="function"?setTimeout(()=>{i=!1},Oa):null,c=typeof t=="number"&&typeof window<"u"?()=>{i&&(Math.abs(window.scrollY-t)<=1&&Math.abs(window.scrollX-(e||0))<=1||window.scrollTo({left:e||0,top:t,behavior:"instant"}))}:null,l=()=>{if(Y===l){if(Y=null,o&&(clearTimeout(o),o=null),a&&clearTimeout(a),i=!1,typeof window<"u"){for(let u of Li)window.removeEventListener(u,l,{capture:!0});c&&window.removeEventListener("scroll",c)}r?n.style.setProperty("overflow-anchor",r):n.style.removeProperty("overflow-anchor")}};if(Y=l,o=setTimeout(l,2e3),typeof window<"u"){for(let u of Li)window.addEventListener(u,l,{capture:!0,passive:!0});c&&window.addEventListener("scroll",c,{passive:!0})}return l}function Ga(e){if(typeof document>"u"||!document.documentElement)return()=>{};if(J&&J(),!(e>0))return()=>{};let t=document.documentElement,n=t.style.getPropertyValue("min-height");t.style.setProperty("min-height",e+"px");let r=null,o=()=>{J===o&&(J=null,r&&(clearTimeout(r),r=null),n?t.style.setProperty("min-height",n):t.style.removeProperty("min-height"))};return J=o,r=setTimeout(o,2e3),o}function zr(e){if(typeof requestAnimationFrame!="function"){setTimeout(e,0);return}requestAnimationFrame(()=>requestAnimationFrame(e))}function Gr(){Vr+=1}function jn(e,t){let n=Ka(e)||Ka(t);return n?(n.getAttribute("data-preserve-scroll")||"").toLowerCase().trim()!=="false":!1}function Ka(e){return!e||typeof e.closest!="function"?null:e.closest("[data-preserve-scroll]")}var Y,J,Vr,Yr=w(()=>{q();Y=null;J=null;Vr=0});function Ui(e){if(!K||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=Dr(e);if(!t||t.hasAttribute("download")||t.target&&t.target!=="_self")return;let n=t.href;if(!n)return;let r=new URL(n);if(r.origin!==location.origin)return;if(r.pathname===location.pathname&&r.search===location.search&&r.href.includes("#")){Ua(r.href);return}if(t.hasAttribute("data-no-router")||St.test(r.pathname))return;e.preventDefault();let o=re(t);Pn(n,!1,o,{preserveScroll:jn(t)})}function Et(e){Ya(location.href)||Pn(location.href,!0,null)}function Tt(e){if(!K||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.hasAttribute("formtarget")?n.getAttribute("formtarget")||"":t.getAttribute("target")||"";if(r&&r!=="_self")return;let o=Sn(t,n);if(o==="dialog")return;let i=vn(t,n),s=o==="get"||o==="head",a=An(t,n),c;try{c=new URL(a,location.href)}catch{return}if(c.origin!==location.origin||St.test(c.pathname))return;let l=En(t,n);if(ja(t,n,o,l),!s&&i==="text/plain")return;let u=xn(l,i);e.preventDefault();let f=re(n||t),p=jn(n||t,t);Ja(c.href,o,u,f,t,{preserveScroll:p})}var Jr=w(()=>{$r();q();ye();te();Hr();Le();Yr();In()});function qi(e){let t=pe(e);document.dispatchEvent(new CustomEvent("webjs:before-cache",{detail:{url:e}})),E.has(t)&&E.delete(t);let n={html:document.documentElement.outerHTML,scrollX:typeof window<"u"&&window.scrollX||0,scrollY:typeof window<"u"&&window.scrollY||0,scrollHeight:typeof document<"u"&&document.documentElement&&document.documentElement.scrollHeight||0};for(E.set(t,n);E.size>16;){let r=E.keys().next().value;E.delete(r)}}function Xa(e){let t=pe(e),n=E.get(t);return n==null?null:(E.delete(t),E.set(t,n),typeof n=="string"?{html:n,scrollX:0,scrollY:0,scrollHeight:0}:n)}function pe(e,t){let n=new URL(e,location.href),r=n.pathname+n.search;return t?`${t} ${r}`:r}var E,Nt=w(()=>{q();E=new Map});function Uu(e){let t=he.get(e);return t==null?!1:$n()-t>=Wi?(he.delete(e),!1):!0}function jt(){he.clear()}function qu(e){for(he.has(e)&&he.delete(e),he.set(e,$n());he.size>Hu;)he.delete(he.keys().next().value)}function Hn(){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 Xr(){try{if(typeof matchMedia=="function")return matchMedia("(hover: hover) and (pointer: fine)").matches}catch{}return!0}function Wu(e){let t=e.getAttribute("rel");return t?t.toLowerCase().split(/\s+/).filter(Boolean):[]}function Ot(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.href.includes("#")||St.test(n.pathname)?null:t}function Qr(e){if(e.hasAttribute("data-no-prefetch"))return!0;let t=Wu(e);return t.includes("external")||t.includes("no-prefetch")}function Lt(e){if(Qr(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 Xr()?"intent":"viewport"}}function Pe(e,t){if(!K||typeof fetch!="function"||Hn())return;let n=pe(e,t);if(typeof location<"u"&&n===pe(location.href,t)||ge.has(n)||Mn.has(n))return;let r=v.get(n);if(r&&$n()-r.at<Wi||Uu(n))return;if(ge.size>=Qa){for(Mn.add(n),kt.push({href:e,frameId:t||null});kt.length>Bu;){let s=kt.shift();Mn.delete(pe(s.href,s.frameId))}return}let o=ue();if(!o&&typeof document<"u"&&document.readyState==="loading")return;ge.add(n);let i={"x-webjs-router":"1","x-webjs-prefetch":"1"};o&&(i["x-webjs-have"]=o),t&&(i["x-webjs-frame"]=t),fetch(e,{method:"GET",headers:i,credentials:"same-origin",cache:"no-cache"}).then(async s=>{let a=s.headers.get("content-type")||"";if(!/^text\/html\b/i.test(a)||s.status>=400)return;let c=s.headers.get("x-webjs-build"),l=s.headers.get("x-webjs-src"),u=typeof document<"u"?document.querySelector('script[type="importmap"]'):null,f=u?u.getAttribute("data-webjs-build"):null,p=u?u.getAttribute("data-webjs-src"):null;if((c&&f&&c!==f||l&&p&&l!==p)&&(E.clear(),tt(n),jt()),(s.headers.get("x-webjs-frame")||null)!==(t||null)){qu(n);return}let m=s.redirected&&s.url?s.url:e,b=await s.text();Dn.has(n)||Vu(n,{html:b,build:c,src:l,finalUrl:m,frameId:t||null,at:$n()})}).catch(()=>{}).finally(()=>{ge.delete(n),Dn.delete(n),Ku()})}function Ku(){for(;kt.length&&ge.size<Qa;){let{href:e,frameId:t}=kt.shift();Mn.delete(pe(e,t)),Pe(e,t)}}function Vu(e,t){for(v.has(e)&&v.delete(e),v.set(e,t);v.size>Fu;){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 Zr(e){let t=/<!--wj:children:([^>]*?)-->/.exec(e||"");return t?t[1]:null}function Un(e,t,n){let r=pe(e,n),o=v.get(r);if(!o)return null;if($n()-o.at>=Wi)return v.delete(r),null;if(o.frameId)return v.delete(r),$i(o.frameId)?o:null;let i=Zr(o.html);return i&&!new Set(String(t??(ue()||"")).split(",").filter(Boolean)).has(i)?(v.delete(r),null):(v.delete(r),o)}function $n(){try{if(typeof performance<"u"&&typeof performance.now=="function")return performance.now()}catch{}return 0}function et(e){if(!K)return;let t=Bi(e.target);if(!t)return;let n=Lt(t);if(n==="none"||n==="render")return;let r=Ot(t);if(r){if(e.type==="touchstart"){Pe(r,re(t));return}n==="intent"&&(Fn===t&&Rt||(qn(),Fn=t,Rt=setTimeout(()=>{Rt=null,Fn=null,Pe(r,re(t))},Du)))}}function Ki(e){let t=Bi(e.target);t&&t===Fn&&qn()}function qn(){Rt&&(clearTimeout(Rt),Rt=null),Fn=null}function eo(){for(let e of Bn)clearTimeout(e);Bn.clear(),Ct=new WeakMap}function to(){if(typeof document>"u"||Hn())return;let e=typeof IntersectionObserver<"u";e&&(je?(je.disconnect(),eo()):je=new IntersectionObserver(t=>{for(let n of t){let r=n.target;if(n.isIntersecting){if(Ct.has(r))continue;let o=setTimeout(()=>{Bn.delete(o),Ct.delete(r),je.unobserve(r);let i=Ot(r);i&&Lt(r)==="viewport"&&Pe(i,re(r))},$u);Ct.set(r,o),Bn.add(o)}else{let o=Ct.get(r);o&&(clearTimeout(o),Bn.delete(o),Ct.delete(r))}}},{threshold:.5}));for(let t of document.querySelectorAll("a[href]")){let n=Lt(t);if(n==="render"){let r=Ot(t);r&&Pe(r,re(t))}else n==="viewport"&&e&&je.observe(t)}}function tt(e){v.clear();for(let t of ge)t!==e&&Dn.add(t)}function Za(e,t){let n=pe(e,t);v.delete(n),ge.has(n)&&Dn.add(n)}function ec(e,t){return v.get(pe(e,t))||null}function tc(){return ge.size}function nc(){v.clear(),he.clear(),ge.clear(),Dn.clear(),kt.length=0,Mn.clear(),qn(),eo()}function rc(){je&&(je.disconnect(),je=null)}var Fu,Wi,Qa,Bu,Du,$u,v,he,Hu,ge,Dn,kt,Mn,Rt,Fn,je,Ct,Bn,nt=w(()=>{$r();Oe();q();Le();ye();Nt();Fu=8,Wi=3e4,Qa=3,Bu=24,Du=100,$u=250,v=new Map,he=new Map,Hu=16;ge=new Set,Dn=new Set,kt=[],Mn=new Set,Rt=null,Fn=null,je=null,Ct=new WeakMap,Bn=new Set});function Vi(e){for(let t of e.querySelectorAll("template[data-webjs-resolve]")){let n=t.cloneNode(!0);document.body.appendChild(n);let r=n.getAttribute("data-webjs-resolve"),o=window.__webjsResolve;r&&typeof o=="function"&&o(r)}}async function Wn(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",i="<!--wj-stream-shell-->",s=/<\/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(i);if(l!==-1)return{shell:r.slice(0,l),streaming:!0,reader:c?null:t,dec:n,rest:r.slice(l+i.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=s.exec(r);if(f){let p=f.index+f[0].length;return{shell:r.slice(0,p),streaming:!0,reader:t,dec:n,rest:r.slice(p)}}}}function no(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 i=1,s;for(;s=o.exec(e);)if(s[1]==="/"){if(i--,i===0)return{id:n,content:e.slice(r,s.index),rest:e.slice(s.index+s[0].length)}}else i++;return null}function ro(e,t){let n=document.getElementById(e);if(!n){Ia(e);return}let r=document.createElement("template");r.innerHTML=t;let o=[...r.content.childNodes];n.replaceWith(r.content);for(let i of o)i.nodeType===1&&oo(i)}async function Kn(e,t,n,r){let o=n,i=()=>{let s;for(;s=no(o);){if(!r())return!1;ro(s.id,s.content),o=s.rest}return!0};if(!e){i();return}try{for(;;){if(!i()){try{await e.cancel()}catch{}return}let{value:s,done:a}=await e.read();if(s&&(o+=t.decode(s,{stream:!0})),a){o+=t.decode(),i();return}}}catch{}}var Vn=w(()=>{te();Pt()});function Mt(){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 rt(e,t){let n=typeof document<"u"?document.startViewTransition:void 0;if(Mt()&&typeof n=="function"){let r=n.call(document,e);return r&&r.finished&&typeof r.finished.then=="function"?r.finished.then(()=>{t&&t()}).catch(()=>{}):t&&t(),r&&r.updateCallbackDone&&typeof r.updateCallbackDone.then=="function"?r.updateCallbackDone.catch(()=>{}):Promise.resolve()}return e(),t&&t(),Promise.resolve()}function zn(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 i=null;try{i=t.querySelector(`#${CSS.escape(o)}`)}catch{i=null}if(!i||!r.hasAttribute||!r.hasAttribute("data-webjs-permanent"))continue;let s=i.parentNode;s&&i!==r&&(s.replaceChild(r,i),It.add(r))}}function ot(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 i of o.querySelectorAll("[data-webjs-permanent][id]"))n.push(i)}if(n.length)for(let r of n){let o=r.id;if(!o)continue;let i=zu(t,o);if(!i||i===r)continue;let s=i.parentNode;if(s)s.replaceChild(r,i),It.add(r);else{let a=t.indexOf(i);a!==-1&&(t[a]=r,It.add(r))}}}function zu(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}var It,Ft=w(()=>{It=new WeakSet});function ct(e,t,n,r,o,i,s,a){let c=!1,l=()=>{if(!c){c=!0;try{Or(e,{frame:!!t})}catch{}}};try{for(let d of e.querySelectorAll("[data-wj-host]"))d.setAttribute("data-wj-serialized","")}catch{}try{typeof sessionStorage<"u"&&(!r||t||n)&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}if(r&&!t&&!n){let d=document.querySelector('script[type="importmap"]'),m=d?d.getAttribute("data-webjs-build"):null,b=!1;if(o&&m&&(b=o!==m),!b&&e.head&&e.head.children.length>0){let y=Hi(document),g=Hi(e);y!==g&&(b=!0)}if(b&&typeof location<"u"){E.clear(),tt(),jt();try{let y="webjs:importmap-reload";if(sessionStorage&&sessionStorage.getItem(y))sessionStorage.removeItem(y),ee("deploy-mismatch-reload-suppressed",r,!1);else return sessionStorage&&sessionStorage.setItem(y,"1"),ee("deploy-mismatch",r),fe(r),"none"}catch{return ee("deploy-mismatch",r),fe(r),"none"}}else if(!b){let y=d?d.getAttribute("data-webjs-src"):null;i&&y&&i!==y&&(E.clear(),tt(),jt(),d&&d.setAttribute("data-webjs-src",i));try{typeof sessionStorage<"u"&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}}}if(t){l();let d=document.querySelector(`webjs-frame#${CSS.escape(t)}`),m=e.querySelector(`webjs-frame#${CSS.escape(t)}`);if(d&&m){a&&a(),xt(e.head),it=rt(()=>{lc(d,m),Bt(d),st(d),Vi(e.body),at()},()=>st(d));return}let b=new CustomEvent("webjs:frame-missing",{bubbles:!0,cancelable:!0,detail:{frameId:t,url:r||(typeof location<"u"?location.href:null),document:e}});return(d||document).dispatchEvent(b),b.defaultPrevented||console.warn(`[webjs] frame "${t}" was not in the navigation response, leaving it unchanged. Handle "webjs:frame-missing" (preventDefault) to override.`),"none"}if(s==="shell"){l(),a&&a(),oc(e);return}let u=ne(document.body),f=ne(e.body),p=u&&f?gn(u,f):null;if(p){l(),a&&a();let{mode:d,live:m,incoming:b}=p;xt(e.head),it=rt(()=>{d==="replace"?sc(m,b):ac(m,b,e),cc(m.start,b.start),Vi(e.body),at()},()=>ic(m));return}if(r&&!n&&typeof location<"u")return ee(u?f?"no-shared-boundary":"incoming-boundaries-malformed":"live-boundaries-malformed",r),fe(r),"none";if(r&&n)return ee("revalidation-discarded",r,!1),"discard";l(),a&&a(),oc(e)}function oc(e){Nn(e.head),zn(document.body,e.body);let t=[...e.body.childNodes];it=rt(()=>{document.body.replaceChildren(...t),Bt(document.body),st(document.body),at()},()=>st(document.body))}var it,Gn=w(()=>{Lr();Oe();te();Dt();Le();Cn();nt();Nt();ye();Vn();Pt();Ft();it=Promise.resolve()});function uc(){zi||typeof MutationObserver>"u"||typeof customElements>"u"||(zi=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)}}),zi.observe(document.body,{childList:!0,subtree:!0}))}function ic(e){if(!(!e||!e.start))for(let t=e.start.nextSibling;t&&t!==e.end;t=t.nextSibling)t.nodeType===1&&st(t)}function st(e){typeof customElements>"u"||oo(e)}function oo(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&&oo(n.shadowRoot))}function Bt(e){if(e.tagName==="SCRIPT"){let n=Tn(e);return e.replaceWith(n),n}let t=[];It.has(e)&&t.push(e);for(let n of e.querySelectorAll("[data-webjs-permanent]"))It.has(n)&&t.push(n);for(let n of e.querySelectorAll("script"))t.length&&t.some(r=>r!==n&&r.contains(n))||n.replaceWith(Tn(n));return e}function Yn(e){let t=[];for(let n=e.start.nextSibling;n&&n!==e.end;n=n.nextSibling)n.nodeType===1&&t.push(n);for(let n of t){let r=Bt(n);r.isConnected!==!1&&st(r)}}var zi,Pt=w(()=>{Oe();q();te();Dt();_n();Jr();Hr();Le();Cn();nt();Nt();Vn();Gn();Ft();zi=null});function at(){let e=document.activeElement;!e||e===document.body||e===document.documentElement||typeof e.blur=="function"&&e.blur()}function sc(e,t){let n=e.start.parentNode;if(!n)return;let r=[];for(let i=e.start.nextSibling;i&&i!==e.end;i=i.nextSibling)r.push(i);let o=[];for(let i=t.start.nextSibling;i&&i!==t.end;i=i.nextSibling)o.push(document.importNode(i,!0));ot(r,o);for(let i of r)i.parentNode===n&&n.removeChild(i);for(let i of o)n.insertBefore(i,e.end);Yn(e)}function ac(e,t,n){if(!e||!t)return;let r=e.start.parentNode;if(!r)return;let o=[];for(let s=e.start.nextSibling;s&&s!==e.end;s=s.nextSibling)o.push(s);let i=[];for(let s=t.start.nextSibling;s&&s!==t.end;s=s.nextSibling)i.push(document.importNode(s,!0));ot(o,i),Gu(r,e.start,e.end,o,i),Yn(e)}function Gu(e,t,n,r,o){let i=new Map;for(let c of r){if(c.nodeType!==1)continue;let l=Ie(c);l&&i.set(l,c)}let s=n,a=[];for(let c of o){if(c.nodeType===1){let l=Ie(c);if(l&&i.has(l)){let u=i.get(l);$t(u,c),a.push(u),i.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,s)}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),!At.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])At.has(r.name)||n.has(r.name)||e.removeAttribute(r.name);if(Yu(e)){Xu(e,t);return}Ht(e,t)}function Yu(e){let t=e;return t[Symbol.for("webjs.instance")]!=null||t[_]!=null}function Ju(e,t){for(let n=e.parentElement;n&&n!==t;n=n.parentElement)if(n.tagName.includes("-"))return!1;return!0}function io(e){let t=new Map,n=`slot[${S}][${O}="${M}"]`;for(let r of e.querySelectorAll(n)){let o=r;if(!Ju(o,e)||qo(e,o))continue;let i=!1;for(let a=o.parentElement;a&&a!==e;a=a.parentElement)if(a.tagName==="SLOT"&&a.hasAttribute(S)&&a.getAttribute(O)===M){i=!0;break}if(i)continue;let s=H(o.getAttribute("name"));t.has(s)||t.set(s,o)}return t}function cc(e,t){let n=e.parentNode;if(!n||n.nodeType!==1)return;let r=n;if(r.tagName!=="SLOT"||!r.hasAttribute(S))return;let o=null;for(let f=r.parentElement;f;f=f.parentElement){if(f[_]){o=f;break}if(f.tagName.includes("-"))return}if(!o)return;let i=H(r.getAttribute("name"));Ee(o,i,[...r.childNodes]);let s=t.parentNode;if(!s||s.nodeType!==1)return;let a=s;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=io(o),u=io(c);for(let f of new Set([...l.keys(),...u.keys()])){if(f===i)continue;let p=u.get(f);p?Ee(o,f,[...p.childNodes].map(d=>document.importNode(d,!0))):l.get(f)&&Ee(o,f,null)}}function Xu(e,t){if(!e[_])return;let n=io(e),r=io(t);if(n.size===0&&r.size===0)return;let o=new Set([...n.keys(),...r.keys()]);for(let i of o){let s=n.get(i),a=r.get(i);s&&a?(Ht(s,a),Ee(e,i,[...s.childNodes])):a?Ee(e,i,[...a.childNodes].map(c=>document.importNode(c,!0))):Ee(e,i,null)}}function Ht(e,t){let n=[...e.childNodes],r=[...t.childNodes].map(a=>document.importNode(a,!0));ot(n,r);let o=new Map;for(let a of n){if(a.nodeType!==1)continue;let c=Ie(a);c&&o.set(c,a)}let i=[];for(let a=0;a<r.length;a++){let c=r[a];if(c.nodeType===1){let l=Ie(c);if(l&&o.has(l)){let f=o.get(l);$t(f,c),i.push(f),o.delete(l);continue}let u=n[a];if(u&&u.nodeType===1&&!Ie(u)&&u.tagName===c.tagName){$t(u,c),i.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),i.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),i.push(l);continue}}i.push(c)}let s=new Set(i);for(let a of n)!s.has(a)&&a.parentNode===e&&e.removeChild(a);for(let a=0;a<i.length;a++){let c=i[a];(c.parentNode!==e||e.childNodes[a]!==c)&&e.insertBefore(c,e.childNodes[a]||null)}}function Ie(e){let t=e.getAttribute("data-key");return t?`${e.tagName}:k:${t}`:e.id?`${e.tagName}:i:${e.id}`:null}function Ut(){let e=ne(document.body);if(!e||e.size===0)return null;let t=[...e.keys()].sort((c,l)=>l.length-c.length),n=null,r=null;for(let c of t){let l=document.getElementById(`wj-loading:${c}`);if(l instanceof HTMLTemplateElement){n=c,r=l;break}}if(n===null||r===null)return null;let o=e.get(n),i=ue(),s=[];for(let c=o.start.nextSibling;c&&c!==o.end;c=c.nextSibling)s.push(c);let a=document.createRange();return a.setStartAfter(o.start),a.setEndBefore(o.end),a.deleteContents(),o.start.parentNode.insertBefore(r.content.cloneNode(!0),o.end),{slot:o,oldChildren:s,token:k,haveKeys:i}}function Me(e){if(!e||e.token!==k)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 lc(e,t){Ht(e,t)}var Dt=w(()=>{Ke();Oe();q();ye();Pt();Ft()});function Qu(e){if(typeof document>"u"||!document.body)return!1;let t=ne(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 i=document.createElement("div");i.setAttribute("role","alert"),i.setAttribute("data-webjs-nav-error","");let s=e?`This page could not be loaded. (status ${e})`:"This page could not be loaded.";i.textContent=s;let a=document.createRange();return a.setStartAfter(n.start),a.setEndBefore(n.end),a.deleteContents(),o.insertBefore(i,n.end),!0}function so(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||Qu(t)||typeof location<"u"&&(ee("navigation-error-unrecoverable",e),fe(e))}var fc=w(()=>{Oe();te();ye()});async function Jn(e,t,n,r,o,i,s,a,c,l){o=o||"GET";let u=l&&l.refresh||void 0,f=!!(l&&l.noPrefetch),p=!!(l&&l.preserveScroll),d=typeof a=="number"?a:k,m,b=null,y=null,g=null,h=null,R=!1,x=e,me=t?kn(t,d):null;try{try{let B=o==="GET"&&!i&&!u&&!f?Un(e,r?r.haveKeys:void 0,t):null;if(B)m=B.html,y=B.build,g=B.src,x=B.finalUrl,h=200,R=!0;else{let Be={"x-webjs-router":"1"},ts=u?"":ue();ts&&(Be["x-webjs-have"]=ts),t&&(Be["x-webjs-frame"]=t),i!=null&&o!=="GET"&&o!=="HEAD"&&(Be.accept=Oi+", text/html");let fo={method:o,headers:Be,credentials:"same-origin",cache:"no-cache"};s&&(fo.signal=s),i!=null&&o!=="GET"&&o!=="HEAD"&&(fo.body=i);let D=await fetch(e,fo);h=D.status,R=D.ok;let ns=Ri(D.headers.get("x-webjs-invalidate"));ns.length&&ki(ns);let rs=D.headers.get("content-type")||"",bc=/^text\/html\b/i.test(rs);if(rs.toLowerCase().indexOf(Oi)===0){let yc=await D.text(),Qn=d===k;return Qn&&(Me(r),Ei(yc)),{ok:Qn&&R,status:h,aborted:!Qn,applied:Qn}}if(D.redirected&&D.url&&(x=D.url),D.status===204||D.status===205)return d===k&&n&&history.pushState(null,"",x),{ok:R,status:h,aborted:!1,applied:!1};if(!bc)return d===k&&(Me(r),so(e,D.status,null)),{ok:!1,status:h,aborted:!1,applied:!1};y=D.headers.get("x-webjs-build"),g=D.headers.get("x-webjs-src");let po=await Wn(D);m=po.shell,po.streaming&&(b=po)}}catch(B){return B&&B.name==="AbortError"?{ok:!1,status:null,aborted:!0,applied:!1}:d!==k?{ok:!1,status:null,aborted:!0,applied:!1}:(Me(r),so(e,null,B instanceof Error?B:new Error(String(B))),{ok:!1,status:null,aborted:!1,applied:!1})}if(d!==k){if(b&&b.reader)try{b.reader.cancel()}catch{}return{ok:!1,status:h,aborted:!0,applied:!1}}let lt=Ze(m);if(!lt)return Me(r),so(e,null,new Error("navigation response did not parse as HTML")),{ok:!1,status:h,aborted:!1,applied:!1};let qt=!1,Fe=n?()=>{qt||(qt=!0,history.pushState(null,"",x))}:null,Wt=ct(lt,t,!!c,x,y,g,u,Fe),j=Wt!=="none";if(Wt==="discard"){if(b&&b.reader)try{b.reader.cancel()}catch{}return{ok:R,status:h,aborted:!1,applied:!1}}if(Fe&&Fe(),n&&!t){let B=new URL(x),Be=B.hash?document.getElementById(B.hash.slice(1)):null;Be?Be.scrollIntoView():p||(Ma(),window.scrollTo({left:0,top:0,behavior:"instant"}))}return b&&(b.reader||b.rest)&&it.then(()=>Kn(b.reader,b.dec,b.rest,()=>d===k)),document.dispatchEvent(new CustomEvent("webjs:navigate",{detail:{url:x,frameId:t,from:"navigate"}})),{ok:R,status:h,aborted:!1,applied:j}}finally{me&&Rn(me,d)}}var dc=w(()=>{Pr();mn();Oe();q();te();Dt();_n();Le();fc();In();nt();ye();Vn();Gn()});function Ya(e){if(!qa(e)||!V)return!1;let t,n;try{t=new URL(V),n=new URL(e,location.href)}catch{return!1}return t.pathname!==n.pathname||t.search!==n.search?!1:(V=n.href,!0)}function Xn(){K||typeof document>"u"||(Mi(!0),globalThis.__webjsRefreshPage=lo,document.addEventListener("click",Ui,!1),document.addEventListener("submit",Tt,!1),window.addEventListener("popstate",Et),document.addEventListener("pointerover",et,!0),document.addEventListener("focusin",et,!0),document.addEventListener("touchstart",et,{capture:!0,passive:!0}),document.addEventListener("pointerout",Ki,!0),document.addEventListener("webjs:navigate",to),uc(),to(),typeof history<"u"&&"scrollRestoration"in history&&(ao=history.scrollRestoration,history.scrollRestoration="auto"),typeof location<"u"&&(V=location.href),Pa())}function Gi(){K&&(Mi(!1),document.removeEventListener("click",Ui,!1),document.removeEventListener("submit",Tt,!1),window.removeEventListener("popstate",Et),Br(),document.removeEventListener("pointerover",et,!0),document.removeEventListener("focusin",et,!0),document.removeEventListener("touchstart",et,{capture:!0}),document.removeEventListener("pointerout",Ki,!0),document.removeEventListener("webjs:navigate",to),qn(),eo(),rc(),typeof history<"u"&&ao!==null&&(history.scrollRestoration=ao,ao=null),Gr(),Y&&Y(),J&&J(),V=null,delete globalThis.__webjsRefreshPage)}async function Yi(e,t){let n=new URL(e,location.href);if(n.origin!==location.origin){fe(e);return}await Pn(n.href,t?.replace??!1,null,{preserveScroll:t?.scroll===!1})}async function Ji(e,t){if(typeof location>"u")return{ok:!1,status:null,aborted:!1,applied:!1};let n=e&&e.id;if(!n)return{ok:!1,status:null,aborted:!1,applied:!1};let r=new URL(t,location.href);if(r.origin!==location.origin)return{ok:!1,status:null,aborted:!1,applied:!1};X&&X.abort(),X=new AbortController;let o=X.signal,i=Fr(),s=await Jn(r.href,n,!1,null,"GET",null,o,i,!1,{noPrefetch:!0});return s&&s.applied&&Za(r.href,n),s}function co(e){if(!e){E.clear(),tt();return}let t=new URL(e,location.href),n=t.pathname+t.search;E.delete(n),v.delete(n);let r=` ${n}`;for(let o of[...v.keys()])o.endsWith(r)&&v.delete(o)}async function lo(e){if(!K||typeof location>"u")return!1;co(),jt();try{let t=await Pn(location.href,!1,null,{refresh:e==="shell"?"shell":"page"});return!t||t.aborted?!0:t.applied}catch{return!1}}async function Pn(e,t,n,r){Br();let o=r&&r.refresh||void 0,i=!!(r&&r.preserveScroll);if(Ii(t,n)&&typeof location<"u")return ee("readyState-loading",e),fe(e),null;X&&X.abort(),X=new AbortController;let s=X.signal,a=Fr();n||(Gr(),Y&&Y(),J&&J()),!o&&V&&qi(V);let c=setTimeout(()=>{yn(!0),c=null},150),l=null;!t&&!o&&(l=Ut());let u=!1;try{if(t){let p=Xa(e);if(p){let d=Ze(p.html);if(d){let m=Ga(p.scrollHeight);ct(d,n,!0,null);let b=()=>{};if(typeof window<"u"){let h=()=>{b=za(p.scrollX,p.scrollY)};if(Mt()&&typeof document.startViewTransition=="function"){let R=Vr;it.then(()=>{R!==Vr||!K||h()}).catch(()=>{})}else h()}let y=Jn(e,n,!1,l,"GET",null,s,a,!0).catch(()=>{}),g=new Promise(h=>setTimeout(h,500));return Promise.all([y,g]).then(()=>zr(()=>{b(),zr(m)})),null}}u=!0,typeof window<"u"&&window.scrollTo({left:0,top:0,behavior:"instant"})}let f=await Jn(e,n,!t&&!o,l,"GET",null,s,a,!1,{refresh:o,preserveScroll:i});return u&&f&&f.applied&&typeof window<"u"&&zr(()=>{a!==k||!K||window.scrollTo({left:0,top:0,behavior:"instant"})}),f}finally{c&&clearTimeout(c),a===k&&(yn(!1),typeof location<"u"&&(V=location.href))}}async function Ja(e,t,n,r,o,i){Br(),X&&X.abort(),X=new AbortController;let s=X.signal,a=Fr();r||(Gr(),Y&&Y(),J&&J());let c=t==="get"||t==="head",l=new URL(e,location.href);if(c){l.search="";for(let[m,b]of n)l.searchParams.append(m,typeof b=="string"?b:b.name)}V&&qi(V);let u=setTimeout(()=>{yn(!0),u=null},150),f=Ut(),p=o?On(o,a,l.href):null,d=!1;try{let m=await Jn(l.href,r,!0,f,c?"GET":t.toUpperCase(),c?null:n,s,a,!1,{preserveScroll:!!(i&&i.preserveScroll)});d=!!(m&&m.ok),!c&&a===k&&(E.clear(),tt())}finally{p&&Ln(p,a,l.href,d),u&&clearTimeout(u),a===k&&(yn(!1),typeof location<"u"&&(V=location.href))}}function pc(){return V}function hc(e){V=e}var X,V,ao,In=w(()=>{q();te();Dt();_n();Jr();dc();Le();nt();Yr();Nt();ye();Gn();Pt();Ft();X=null,V=null;ao=null});var va={};os(va,{_FALLBACK_MARKER_KEY:()=>Qe,_FRAME_TOP:()=>bn,_LIVE_ATTRS:()=>At,_activateSwappedRange:()=>Yn,_activeFrameId:()=>Kr,_addNewHeadElements:()=>xt,_applyOptimisticLoading:()=>Ut,_applyStreamedResolve:()=>ro,_applySwap:()=>ct,_blurOutgoingFocus:()=>at,_buildHaveHeader:()=>ue,_buildSubmitFormData:()=>En,_bumpNavToken:()=>Ha,_clearFormBusy:()=>Ln,_clearFrameBusy:()=>Rn,_collectBoundaries:()=>ne,_currentPageUrl:()=>pc,_diffElementInPlace:()=>$t,_eligibleAnchorHref:()=>Ot,_encodeSubmitBody:()=>xn,_findAnchorInPath:()=>Dr,_getSubmitAction:()=>An,_getSubmitEnctype:()=>vn,_getSubmitMethod:()=>Sn,_isNonHtmlPath:()=>Ra,_isPreBootNavigation:()=>Mr,_keyOf:()=>Ie,_markFormBusy:()=>On,_markFrameBusy:()=>kn,_mergeHead:()=>Nn,_navToken:()=>$a,_onPopState:()=>Et,_onSubmit:()=>Tt,_parseHTML:()=>Ze,_planBoundarySwap:()=>gn,_prefetch:()=>Pe,_prefetchAnchor:()=>Zr,_prefetchCache:()=>v,_prefetchHasHoverPointer:()=>Xr,_prefetchInflightSize:()=>tc,_prefetchMode:()=>Lt,_prefetchPeek:()=>ec,_prefetchSaysSaveData:()=>Hn,_prefetchSuppressed:()=>Qr,_prefetchTake:()=>Un,_reactivateScripts:()=>Bt,_readStreamedShell:()=>Wn,_reconcileChildren:()=>Ht,_regraftPermanentElements:()=>zn,_regraftPermanentInSlice:()=>ot,_resetParseProbe:()=>Fi,_resetPrefetch:()=>nc,_resetWarnOnce:()=>Fa,_resolvePreserveScroll:()=>jn,_resolveTargetFrameId:()=>re,_restoreOptimistic:()=>Me,_runWithTransition:()=>rt,_setCurrentPageUrl:()=>hc,_setHardNavigate:()=>Da,_shouldFullLoadDuringParse:()=>Ba,_snapshotCache:()=>E,_streamBoundariesProgressively:()=>Kn,_takeResolveUnit:()=>no,_viewTransitionsEnabled:()=>Mt,disableClientRouter:()=>Gi,enableClientRouter:()=>Xn,loadFrame:()=>Ji,navigate:()=>Yi,refreshPage:()=>lo,revalidate:()=>co});var Rr=w(()=>{vi();mn();mn();_e();Ea();Lr();Pr();Ke();In();q();te();In();nt();ye();Oe();q();te();Dt();_n();$r();Jr();Hr();Le();Cn();nt();Yr();Nt();Vn();Gn();Pt();Ft();(typeof window>"u"||window.__WEBJS_CLIENT_ROUTER__!==!1)&&Xn()});function wc(e,...t){return{_$webjs:"template",strings:e,values:t}}function P(e){return!!e&&typeof e=="object"&&e._$webjs==="template"}var T="wjm-";function _c(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 ho(e){return!!e&&typeof e=="object"&&e._$webjsCss===!0}function mo(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(`
|
|
4
|
-
`),n.appendChild(r)}}function
|
|
5
|
-
`)}</style>`}_e();var ws=Symbol.for("webjs.repeat");function _s(e,t,n){return{[ws]:!0,items:[...e],keyFn:t,templateFn:n}}function tr(e){return!!e&&typeof e=="object"&&e[ws]===!0}function jc(e){return{_$webjs:"unsafe-html",value:String(e??"")}}function Ao(e){return!!e&&typeof e=="object"&&e._$webjs==="unsafe-html"}function Pc(e){return{_$webjs:"live",value:e}}function oe(e){return!!e&&typeof e=="object"&&e._$webjs==="live"}function Ic(e,t){return{_$webjs:"keyed",key:e,value:t}}function nr(e){return!!e&&typeof e=="object"&&e._$webjs==="keyed"}function Mc(e,t){return{_$webjs:"guard",deps:e,fn:t}}function rr(e){return!!e&&typeof e=="object"&&e._$webjs==="guard"}function Fc(e){return{_$webjs:"template-content",template:e}}function vo(e){return!!e&&typeof e=="object"&&e._$webjs==="template-content"}function Bc(e){return{_$webjs:"ref",target:e}}function or(e){return!!e&&typeof e=="object"&&e._$webjs==="ref"}function Dc(){return{value:void 0}}function $c(e){return{_$webjs:"cache",value:e}}function ir(e){return!!e&&typeof e=="object"&&e._$webjs==="cache"}function Hc(...e){return{_$webjs:"until",args:e}}function sr(e){return!!e&&typeof e=="object"&&e._$webjs==="until"}function Uc(e,t){return{_$webjs:"async-append",iterable:e,mapper:t}}function xo(e){return!!e&&typeof e=="object"&&e._$webjs==="async-append"}function qc(e,t){return{_$webjs:"async-replace",iterable:e,mapper:t}}function Eo(e){return!!e&&typeof e=="object"&&e._$webjs==="async-replace"}function Wc(e){return{_$webjs:"watch",signal:e}}function ar(e){return!!e&&typeof e=="object"&&e._$webjs==="watch"}Ke();yo();_e();Ke();var mr=new WeakMap,br=new WeakMap,tn=Symbol.for("webjs.instance");function dt(e){let{strings:t}=e,n=mr.get(t);if(n)return n;let r=[],o="",i="text",s="",a=0,c="",l=0,u=null,f="",p="";for(let b=0;b<t.length;b++){let y=t[b];for(let g=0;g<y.length;g++){let h=y[g];switch(i){case"text":o+=h,h==="<"&&(i="tag-open");break;case"tag-open":o+=h,h==="!"?i="bang-1":h==="/"?(i="tag-name",f=""):/[a-zA-Z]/.test(h)?(i="tag-name",f=h.toLowerCase()):i="text";break;case"bang-1":o+=h,i=h==="-"?"bang-dash":"tag-name";break;case"bang-dash":o+=h,h==="-"?(i="comment",l=0):i="tag-name";break;case"comment":o+=h,h==="-"?l+=1:(h===">"&&l>=2&&(i="text"),l=0);break;case"tag-name":o+=h,h===">"?(i=f==="script"||f==="style"?"rawtext":"text",i==="rawtext"&&(p="")):/\s/.test(h)?i="in-tag":f+=h.toLowerCase();break;case"in-tag":o+=h,h===">"?(i=f==="script"||f==="style"?"rawtext":"text",i==="rawtext"&&(p="")):!/\s/.test(h)&&h!=="/"&&(i="attr-name",s=h,a=o.length-1);break;case"rawtext":o+=h,p=(p+h.toLowerCase()).slice(-9),(p.endsWith("<\/script>")||p.endsWith("</style>"))&&(i="text",p="",f="");break;case"attr-name":h==="="?(i="after-eq",o+=h):/\s/.test(h)?(i="in-tag",s="",o+=h):h===">"?(i="text",s="",o+=h):(s+=h,o+=h);break;case"after-eq":h==='"'||h==="'"?(i="attr-quoted",c=h,o+=h):/\s/.test(h)?(i="in-tag",s="",o+=h):h===">"?(i="text",s="",o+=h):(i="attr-unquoted",o+=h);break;case"attr-unquoted":/\s/.test(h)?(i="in-tag",s="",o+=h):(h===">"&&(i="text",s=""),o+=h);break;case"attr-quoted":o+=h,h===c&&(i="in-tag",s="");break;case"skip-attr":if(h===c){if(u){let R=u.firstPartIdx,x=[];for(let j=R;j<r.length;j++)(r[j].kind==="noop"||r[j].kind==="attr-mixed")&&x.push(j);let me=[],lt=t[x[0]],qt=lt.lastIndexOf(c);me.push(qt>=0?lt.slice(qt+1):lt);for(let j=1;j<x.length;j++)me.push(t[x[j]]);let Fe=t[x[x.length-1]+1],Wt=Fe.indexOf(c);me.push(Wt>=0?Fe.slice(0,Wt):Fe),r[R]={kind:"attr-mixed",path:[],name:u.name,statics:me,group:x};for(let j=1;j<x.length;j++)r[x[j]]={kind:"noop",path:[],mixedAnchor:R};u=null}i="in-tag",s=""}break}}if(b<t.length-1){let g=r.length;if(i==="comment"){l=0,r.push({kind:"noop",path:[]});continue}if(i==="rawtext"){p="",r.push({kind:"noop",path:[]});continue}if(i==="text")o+=`<!--${T}${g}-->`,r.push({kind:"child",path:[]});else if(i==="in-tag"){let h=`data-${T}${g}`;o+=`${h}=""`,r.push({kind:"element",path:[]})}else if(i==="after-eq"){let h=s[0],R=s.slice(1);if(Kt(h)){o=o.slice(0,a);let x=bo[h],me=`data-${T}${g}`;o+=`${me}=""`,r.push({kind:x,path:[],name:R})}else{o=o.slice(0,a);let x=`data-${T}${g}`;o+=`${x}=""`,r.push({kind:"attr",path:[],name:s})}i="in-tag",s=""}else if(i==="attr-quoted"||i==="attr-unquoted"){o=o.slice(0,a);let h=`data-${T}${g}`;o+=`${h}=""`,u={name:s,firstPartIdx:g},r.push({kind:"noop",path:[]}),i="skip-attr"}else i==="skip-attr"&&r.push({kind:"noop",path:[]})}}let d=document.createElement("template");d.innerHTML=o,Jc(d.content,r);let m=Xc(d.content,r);return n={templateEl:d,parts:r,formActions:m},mr.set(t,n),n}function Jc(e,t){let n=e.querySelectorAll("slot");for(let r of n){r.setAttribute(S,"");let o=t.length;r.setAttribute(`data-${T}${o}`,""),t.push({kind:"slot",path:[]})}}function Xc(e,t){let n=[],r=[];function o(i){for(let s=0;s<i.childNodes.length;s++){let a=i.childNodes[s];if(n.push(s),a.nodeType===8){let c=a.data;if(c.startsWith(T)){let l=Number(c.slice(T.length));t[l]&&t[l].kind==="child"&&(t[l].path=n.slice())}}else if(a.nodeType===1){let c=a,l=[],u=[];for(let f of c.attributes)if(f.name.startsWith(`data-${T}`)){let p=Number(f.name.slice(`data-${T}`.length));t[p]&&t[p].kind!=="child"&&(t[p].path=n.slice(),u.push({idx:p,kind:t[p].kind,name:t[p].name||""})),l.push(f.name)}if(c.localName==="form"||c.localName==="button"||c.localName==="input"){let f=Qc(c,u,t);f&&r.push(f)}for(let f of l)c.removeAttribute(f);o(a)}n.pop()}}return o(e),r.length?r:null}function Qc(e,t,n){let r=e.localName==="form",o=r?"action":"formaction",i=r?"method":"formmethod",s=r?"enctype":"formenctype",a=t.filter(y=>y.kind==="attr"&&y.name.toLowerCase()===o);if(!a.length)return null;let c=[],l=[],u=[],f=r?[]:t.filter(y=>y.name.toLowerCase()==="name"&&(y.kind==="attr"||y.kind==="attr-mixed"||y.kind==="bool")).map(y=>({i:y.idx,kind:y.kind})),p=!r&&e.hasAttribute("name"),d=!r&&e.hasAttribute("form"),m=!r&&e.hasAttribute("value"),b=r?[]:t.filter(y=>y.name.toLowerCase()==="value"&&(y.kind==="attr"||y.kind==="attr-mixed"||y.kind==="bool")).map(y=>({i:y.idx,kind:y.kind}));for(let y of t){let g=String(y.name).toLowerCase();if(y.kind==="prop"){r?(g==="method"||g==="enctype"||g==="encoding")&&u.push(y.name):_o(g)&&u.push(y.name);continue}if(g!==i&&g!==s||y.kind!=="attr"&&y.kind!=="attr-mixed"&&y.kind!=="bool")continue;let h=n[y.idx],R={i:y.idx,kind:y.kind};y.kind==="attr-mixed"&&(R.statics=h.statics||[],R.group=h.group||[]),(g===i?c:l).push(R)}return{isForm:r,tag:e.localName,actionIdxs:a.map(y=>y.idx),duplicateAction:a.length>1,staticAction:e.getAttribute(o)!=null,authoredName:p,authoredValue:m,authoredForm:d,propAttrs:u,nameParts:f,valueParts:b,staticMethod:e.getAttribute(i),staticEnctype:e.getAttribute(s),methodParts:c,enctypeParts:l}}_e();var Q=null,Te=!1,ht=0,pt=null,ti=0,js=(e,t)=>Object.is(e,t),gr=()=>{},Ps=()=>!1;function Is(e,t){e.liveConsumers||(e.liveConsumers=new Map);let n=e.liveConsumers.size===0;if(e.liveConsumers.set(t,(e.liveConsumers.get(t)||0)+1),n){if(e.producers&&e.producers.length>0)for(let r of e.producers)Is(r,e);if(e.watched)try{e.watched.call(e.wrapper)}catch(r){console.error(r)}}}function nn(e,t){if(!e.liveConsumers)return;let n=e.liveConsumers.get(t);if(n!==void 0){if(n>1){e.liveConsumers.set(t,n-1);return}if(e.liveConsumers.delete(t),e.liveConsumers.size===0){if(e.producers&&e.producers.length>0)for(let r of e.producers)nn(r,e);if(e.unwatched)try{e.unwatched.call(e.wrapper)}catch(r){console.error(r)}}}}function ai(e){if(Te)throw new Error("Signal read during notification phase");if(Q===null)return;let t=Q,n=t.nextProducerIndex++;n<t.producers.length&&t.producers[n]!==e&&oi(t)&&nn(t.producers[n],t),t.producers[n]!==e&&(t.producers[n]=e,oi(t)&&Is(e,t)),t.producerLastReadVersions[n]=e.version}function oi(e){return e.consumerIsAlwaysLive||e.liveConsumers&&e.liveConsumers.size>0}function Ms(e){if(!e.liveConsumers||e.liveConsumers.size===0)return;let t=Te;Te=!0;try{for(let n of e.liveConsumers.keys())n.dirty||Zc(n)}finally{Te=t}}function Zc(e){e.dirty=!0,Ms(e),e.consumerMarkedDirty.call(e.wrapper||e)}function wr(e){if(!(!e.dirty&&e.lastCleanEpoch===ht)){if(!e.producerMustRecompute()&&!el(e)){e.dirty=!1,e.lastCleanEpoch=ht;return}e.producerRecomputeValue(),e.dirty=!1,e.lastCleanEpoch=ht}}function el(e){for(let t=0;t<e.producers.length;t++){let n=e.producers[t],r=e.producerLastReadVersions[t];if(r!==n.version||(wr(n),r!==n.version))return!0}return!1}function ii(e){e&&(e.nextProducerIndex=0);let t=Q;return Q=e,t}function si(e,t){if(Q=t,!!e){if(oi(e))for(let n=e.nextProducerIndex;n<e.producers.length;n++)nn(e.producers[n],e);for(;e.producers.length>e.nextProducerIndex;)e.producers.pop(),e.producerLastReadVersions.pop()}}var _r=class{constructor(t,n){this.__value=t,this.version=0,this.lastCleanEpoch=ht,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.liveConsumers=void 0,this.consumerAllowSignalWrites=!0,this.consumerIsAlwaysLive=!1,this.producerMustRecompute=Ps,this.producerRecomputeValue=gr,this.consumerMarkedDirty=gr,this.wrapper=this,this.__isSignal=!0,this.__equal=n?.equals||js,this.watched=n?.[ci],this.unwatched=n?.[li]}get(){return ai(this),this.__value}peek(){return this.__value}set(t){if(Te)throw new Error("Signal write during notification phase");this.__equal.call(this,this.__value,t)||(this.__value=t,this.version++,ht++,pt!==null?Fs(this):Ms(this))}};function Fs(e){let t=Te;Te=!0;try{if(!e.liveConsumers)return;for(let n of e.liveConsumers.keys())n.dirty||(n.dirty=!0,n.__isWatcher?pt.add(n):Fs(n))}finally{Te=t}}var ni=Symbol("unset"),ri=Symbol("computing"),yr=Symbol("errored"),rn=class{constructor(t,n){this.__fn=t,this.__value=ni,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||js,this.watched=n?.[ci],this.unwatched=n?.[li];let r=this;this.producerMustRecompute=function(){return r.__value===ni||r.__value===ri},this.producerRecomputeValue=function(){if(r.__value===ri)throw new Error("Detected cycle in computations.");let o=r.__value;r.__value=ri;let i=ii(r),s,a=!1;try{s=r.__fn.call(r.wrapper)}catch(l){s=yr,r.__error=l,a=!0}finally{si(r,i)}if(!a&&(o!==ni&&o!==yr)&&r.__equal.call(r.wrapper,o,s)){r.__value=o;return}r.__value=s,r.version++},this.consumerMarkedDirty=gr}get(){if(wr(this),ai(this),this.__value===yr)throw this.__error;return this.__value}peek(){if(wr(this),this.__value===yr)throw this.__error;return this.__value}},Sr=class{constructor(t){this.__notify=t,this.version=0,this.lastCleanEpoch=ht,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.nextProducerIndex=0,this.liveConsumers=void 0,this.consumerAllowSignalWrites=!1,this.consumerIsAlwaysLive=!0,this.producerMustRecompute=Ps,this.producerRecomputeValue=gr,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=ii(this);try{for(let r of t)ai(r),r.__isComputed&&wr(r)}finally{si(this,n)}this.dirty=!1}unwatch(...t){for(let n=this.producers.length-1;n>=0;n--)t.includes(this.producers[n])&&(nn(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=ii(this),r;try{r=t()}finally{si(this,n)}return this.dirty=!1,r}dispose(){for(let t of this.producers)nn(t,this);this.producers=[],this.producerLastReadVersions=[],this.__notify=null}},ci=Symbol("watched"),li=Symbol("unwatched");function tl(e){let t=Q;Q=null;try{return e()}finally{Q=t}}function nl(e){return e.producers.slice()}function rl(e){return e.liveConsumers?[...e.liveConsumers.keys()]:[]}function ol(e){return!!e.liveConsumers&&e.liveConsumers.size>0}function il(e){return e.producers.length>0}function sl(){return Q&&Q.__isComputed?Q:null}function al(e){ti++,pt===null&&(pt=new Set);try{e()}finally{if(ti--,ti===0){let t=pt;pt=null;for(let n of t)n.__fire()}}}var on={State:_r,Computed:rn,subtle:{Watcher:Sr,untrack:tl,introspectSources:nl,introspectSinks:rl,hasSinks:ol,hasSources:il,currentComputed:sl,watched:ci,unwatched:li}};function cl(e,t){return new _r(e,t)}function ll(e,t){return new rn(e,t)}function ul(e){return!!(e&&typeof e=="object"&&e.__isSignal===!0)}function fl(e){let t=!1,n=!1,r=new rn(e),o=new Sr(()=>{t||n||(t=!0,queueMicrotask(()=>{if(t=!1,!n){try{r.get()}catch(i){console.error(i)}o.watch()}}))});o.watch(r);try{r.get()}catch(i){console.error(i)}return()=>{n||(n=!0,o.dispose())}}Ke();var U=null;function fi(e){U=e}function Ds(e,t){let n=e&&e[_]?e:null;return n?qe(n,t):t()}function vr(e){return e?e.nodeType===11&&e.host?e.host:e:null}function di(e,t){let n=e.__commitOwner,r=U;n&&(U=n);try{t()}finally{U=r}}function an(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(i){o.handler?.(i)}};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 Z(e,t,n,r,o){if(oe(t)){let i=t.value;if(e.kind==="prop"&&e.el[e.name]===i||e.kind==="attr"&&e.el.getAttribute(e.name)===String(i)||e.kind==="bool"&&e.el.hasAttribute(e.name)===!!i)return;t=i}switch(e.kind){case"child":hl(e,t,o);break;case"attr":{t==null||t===!1?e.el.removeAttribute(e.name):Zn(t,e.name,e.el.localName)||(zt(t,e.name,e.el.localName),e.el.setAttribute(e.name,String(t)));break}case"prop":hs(t,e.name,e.el.localName),e.el[e.name]=t;break;case"bool":zt(t,e.name,e.el.localName),t?e.el.setAttribute(e.name,""):e.el.removeAttribute(e.name);break;case"event":e.handler=typeof t=="function"?t:null;break;case"element":pl(e,t);break;case"attr-mixed":{let i=e,s=i.statics[0];for(let a=0;a<i.group.length;a++){let c=r?r[i.group[a]]:t;oe(c)&&(c=c.value),zt(c,e.name,e.el.localName),s+=String(c??""),s+=i.statics[a+1]||""}e.el.setAttribute(e.name,s);break}case"slot":{if(e.applied)break;let i=e.slotEl,s=()=>{let c=mt(i);if(!c){e.applied=!0;return}if(!c.contains(i)){c.isConnected?queueMicrotask(s):e.applied=!0;return}if(e.applied=!0,dl(i))return;let l=document.createDocumentFragment();for(;i.firstChild;)l.appendChild(i.firstChild);i[Se]=l,queueMicrotask(()=>W(c))},a=mt(i);a&&a.contains(i)?s():queueMicrotask(s);break}case"noop":break}}function mt(e){let t=e[De];if(t&&t.isConnected)return t;let n=e.parentElement;for(;n;){if(n[_])return n;n=n.parentElement}return null}function dl(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 pl(e,t){let n=e,r=or(t)?t.target:void 0,o=n.__refTarget,i=r!==o;if(i&&o)if(typeof o=="function")try{o(void 0)}catch{}else typeof o=="object"&&(o.value=void 0);if(i||n.__refElement!==e.el){if(n.__refTarget=r,r)if(typeof r=="function"){if(!i&&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 hl(e,t,n){return vl(e,t),ce(e,t,n)}function ce(e,t,n){return Ds(e.marker&&e.marker.parentNode,()=>$s(e,t,n))}function $s(e,t,n){let r=e.marker;if(oe(t))return $s(e,t.value,n);if(Ao(t)){Ne(e);let i=String(t.value??""),s=document.createElement("template");s.innerHTML=i;let a=[...s.content.childNodes],c=document.createDocumentFragment();for(let l of a)c.appendChild(l);r.parentNode?.insertBefore(c,r),e.child=a;return}if(nr(t)){let i=t,s=e.__keyedKey;s!==void 0&&!Object.is(s,i.key)&&Ne(e),e.__keyedKey=i.key,ce(e,i.value,n);return}if(rr(t)){let i=t,s=e.__guardDeps,a=i.deps;if(s!==void 0&&(Array.isArray(s)&&Array.isArray(a)?Al(s,a):Object.is(s,a)))return;let c=Array.isArray(a)?a.slice():a;ce(e,i.fn(),n),e.__guardDeps=c;return}if(vo(t)){Ne(e);let i=t.template;if(i&&i.content){let s=i.content.cloneNode(!0),a=[...s.childNodes];r.parentNode?.insertBefore(s,r),e.child=a}return}if(or(t))return;if(ir(t))return xl(e,t.value,n);if(sr(t))return El(e,t.args,n);if(ar(t))return Tl(e,t.signal,n);if(xo(t))return Nl(e,t,n);if(Eo(t))return Cl(e,t,n);if(tr(t)){if(e.child&&e.child.kind==="repeat"){yl(e,t,n);return}Ne(e);let i={kind:"repeat",map:new Map};e.child=i,bl(r,i,t,n);return}if(Array.isArray(t)){if(e.child&&e.child.kind==="array"){_l(e,t,n);return}Ne(e);let i={kind:"array",items:[]};e.child=i,wl(r,i,t,n);return}if(e.child){let i=e.child;if(i.kind==="repeat")Hs(i),e.child=void 0;else if(i.kind==="array")qs(i),e.child=void 0;else if(i.kind==="async-stream")zs(i),e.child=void 0;else if("strings"in e.child){let s=e.child;if(P(t)&&s.strings===t.strings){Ve(s,t.values,n);return}bt(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(P(t)){let i=t,{templateEl:s,parts:a,formActions:c}=dt(i),l=s.content.cloneNode(!0),u=document.createComment(`${T}s`),f=document.createComment(`${T}e`),p=a.map(b=>an(b,l)),d=[];for(let b=0;b<i.values.length;b++)Z(p[b],i.values[b],void 0,i.values,n),d.push(i.values[b]);n&&n(c,p,i.values);let m=[u,...l.childNodes,f];r.parentNode?.insertBefore(ml(m),r);for(let b of p)b.kind==="slot"&&Z(b,void 0,void 0,[],n);e.child={strings:i.strings,bound:p,lastValues:d,startNode:u,endNode:f};return}let o=document.createTextNode(String(t));r.parentNode?.insertBefore(o,r),e.child=[o]}function Ve(e,t,n){for(let r=0;r<t.length;r++){let o=t[r];if(Object.is(o,e.lastValues[r]))continue;let i=e.bound[r],s=i.mixedAnchor;try{i.kind==="noop"&&s!=null?Z(e.bound[s],t[s],e.lastValues[s],t,n):Z(i,o,e.lastValues[r],t,n)}catch(a){throw e.lastValues[r]=Bs,i.kind==="noop"&&s!=null&&(e.lastValues[s]=Bs),a}e.lastValues[r]=o}n&&n(mr.get(e.strings)?.formActions??null,e.bound,t)}var Bs=Symbol("webjs.commitFailed");function bt(e,t){let n=e.parentNode;if(!n)return;let r=e;for(;r&&r!==t;){let o=r.nextSibling;r.parentNode?.removeChild(r),r=o}t.parentNode===n&&n.removeChild(t)}function ml(e){let t=document.createDocumentFragment();for(let n of e)t.appendChild(n);return t}function pi(e,t){let{templateEl:n,parts:r,formActions:o}=dt(e),i=n.content.cloneNode(!0),s=document.createComment(`${T}s`),a=document.createComment(`${T}e`),c=r.map(f=>an(f,i)),l=[];for(let f=0;f<e.values.length;f++)Z(c[f],e.values[f],void 0,e.values,t),l.push(e.values[f]);t&&t(o,c,e.values);for(let f of c)f.kind==="slot"&&Z(f,void 0,void 0,[],t);let u=document.createDocumentFragment();for(u.appendChild(s);i.firstChild;)u.appendChild(i.firstChild);return u.appendChild(a),{inst:{strings:e.strings,bound:c,lastValues:l,startNode:s,endNode:a},frag:u}}function sn(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 if(typeof n=="object")try{n.value=void 0}catch{}t.lastTarget=void 0,t.__lastEl=void 0}}}function bl(e,t,n,r){let{items:o,keyFn:i,templateFn:s}=n,a=e.parentNode;if(!a)return;let c=document.createDocumentFragment();for(let l=0;l<o.length;l++){let u=i(o[l],l),f=s(o[l],l);if(!P(f))continue;let{inst:p,frag:d}=pi(f,r);t.map.set(u,p),c.appendChild(d)}a.insertBefore(c,e)}function yl(e,t,n){let r=e.marker,o=r.parentNode;if(!o)return;let i=e.child,{items:s,keyFn:a,templateFn:c}=t,l=new Map;try{for(let u=0;u<s.length;u++){let f=a(s[u],u),p=c(s[u],u);if(!P(p))continue;let d=i.map.get(f);if(d&&d.strings===p.strings)Ve(d,p.values,n),ui(d.startNode,d.endNode,o,r),l.set(f,d),i.map.delete(f);else{d&&(i.map.delete(f),sn(d),bt(d.startNode,d.endNode));let{inst:m,frag:b}=pi(p,n);o.insertBefore(b,r),l.set(f,m)}}for(let[u,f]of[...i.map]){i.map.delete(u);try{sn(f)}finally{bt(f.startNode,f.endNode)}}i.map=l}catch(u){for(let[f,p]of l)i.map.set(f,p);throw u}}function Hs(e){for(let[t,n]of[...e.map]){e.map.delete(t);try{sn(n)}finally{bt(n.startNode,n.endNode)}}e.map.clear()}function gl(e){return e.type==="tpl"?e.inst.startNode:e.type==="text"?e.node:null}function Ar(e){e.type==="tpl"?(sn(e.inst),bt(e.inst.startNode,e.inst.endNode)):e.type==="text"&&e.node.parentNode?.removeChild(e.node)}function Us(e,t){if(oe(e)&&(e=e.value),P(e)){let{inst:n,frag:r}=pi(e,t);return{item:{type:"tpl",inst:n},frag:r}}if(e!=null&&e!==!1&&e!==!0){let n=document.createTextNode(String(e));return{item:{type:"text",node:n},frag:n}}return{item:{type:"empty"},frag:null}}function wl(e,t,n,r){let o=e.parentNode;if(!o)return;let i=document.createDocumentFragment(),s=[];for(let a of n){let{item:c,frag:l}=Us(a,r);l&&i.appendChild(l),s.push(c)}o.insertBefore(i,e),t.items=s}function _l(e,t,n){let r=e.marker,o=r.parentNode;if(!o)return;let i=e.child,s=i.items,a=[],c=0;try{for(let l=0;l<t.length;l++){let u=t[l],f=oe(u)?u.value:u,p=s[l];if(P(f)){let b=f;if(p&&p.type==="tpl"&&p.inst.strings===b.strings){Ve(p.inst,b.values,n),a.push(p),c=l+1;continue}}else if(f!=null&&f!==!1&&f!==!0){if(p&&p.type==="text"){let b=String(f);p.node.data!==b&&(p.node.data=b),a.push(p),c=l+1;continue}}else{p&&Ar(p),a.push({type:"empty"}),c=l+1;continue}let{item:d,frag:m}=Us(f,n);m&&o.insertBefore(m,Sl(s,l,r)),a.push(d),p&&Ar(p),c=l+1}for(let l=t.length;l<s.length;l++)Ar(s[l]),c=l+1;i.items=a}catch(l){throw i.items=a.concat(s.slice(c)),l}}function Sl(e,t,n){for(let r=t;r<e.length;r++){let o=gl(e[r]);if(o&&o.parentNode)return o}return n}function qs(e){for(let t of e.items)Ar(t);e.items=[]}function ui(e,t,n,r){if(t.nextSibling===r&&e.parentNode===n)return;let o=document.createDocumentFragment(),i=e;for(;i;){let s=i.nextSibling;if(o.appendChild(i),i===t)break;i=s}n.insertBefore(o,r)}function Al(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 Ne(e){let t=e;if(t.__untilState&&(t.__untilState.aborted=!0,t.__untilState=void 0),t.__watchSub&&Ws(t),!e.child)return;let n=e.child;if(n.kind==="repeat")Hs(n);else if(n.kind==="array")qs(n);else if(n.kind==="async-stream")zs(n);else if("strings"in n){let r=e.child;sn(r),bt(r.startNode,r.endNode)}else for(let r of e.child)r.parentNode&&r.parentNode.removeChild(r);e.child=void 0}function vl(e,t){let n=e;n.__untilState&&!sr(t)&&(n.__untilState.aborted=!0,n.__untilState=void 0),n.__guardDeps!==void 0&&!rr(t)&&(n.__guardDeps=void 0),n.__cacheMap&&!ir(t)&&(n.__cacheMap=void 0),n.__keyedKey!==void 0&&!nr(t)&&(n.__keyedKey=void 0),n.__watchSub&&!ar(t)&&Ws(n)}function xl(e,t,n){let r=e.marker,o=e,i=o.__cacheMap;i||(i=new Map,o.__cacheMap=i);let s=e.child;if(s&&"strings"in s){let c=s;if(P(t)&&c.strings===t.strings){Ve(c,t.values,n);return}let l=document.createDocumentFragment();ui(c.startNode,c.endNode,l,null),i.set(c.strings,{inst:c,holder:l}),e.child=void 0}if(P(t)){let c=t,l=i.get(c.strings);if(l){i.delete(c.strings),e.child&&Ne(e),ui(l.inst.startNode,l.inst.endNode,r.parentNode,r),Ve(l.inst,c.values,n),e.child=l.inst;let u=new Set;for(let f=l.inst.startNode.nextSibling;f&&f!==l.inst.endNode;f=f.nextSibling){if(f.nodeType!==1)continue;let p=f;if(p.matches("slot[data-webjs-light]")){let d=mt(p);d&&u.add(d)}for(let d of p.querySelectorAll("slot[data-webjs-light]")){let m=mt(d);m&&u.add(m)}}for(let f of u)W(f);return}}ce(e,t,n)}function El(e,t,n){let r=e;U&&(r.__commitOwner=vr(U));let o=r.__untilState,i=r.__untilArgs,s=(d,m)=>!!(Object.is(d,m)||P(d)&&P(m)&&d.strings===m.strings),c=i&&i.length===t.length&&i.every((d,m)=>s(d,t[m]))&&o?o.highestResolved:1/0;o&&(o.aborted=!0),r.__untilArgs=t.slice();let l={aborted:!1,highestResolved:c};r.__untilState=l;let u=-1,f;for(let d=0;d<t.length;d++){let m=t[d];if(!m||typeof m.then!="function"){u=d,f=m;break}}u!==-1&&u<=l.highestResolved?(ce(e,f,n),l.highestResolved=u):u===-1&&!r.__untilEverRendered&&ce(e,"",n),r.__untilEverRendered=!0;let p=Math.min(u===-1?t.length:u,l.highestResolved);for(let d=0;d<p;d++){let m=t[d];!m||typeof m.then!="function"||Promise.resolve(m).then(b=>{if(!l.aborted&&!(d>=l.highestResolved)){try{di(e,()=>ce(e,b,n))}catch(y){hi(e,y);return}l.highestResolved=d}},()=>{})}}function hi(e,t){let n;try{n=t instanceof Error?t:new Error(String(t))}catch{n=new Error("render error (unstringifiable thrown value)")}let r=e.__commitOwner;if(r&&typeof r._handleRenderError=="function"){r._handleRenderError(n);return}throw n}function Tl(e,t,n){let r=e;if(U&&(r.__commitOwner=vr(U)),r.__watchSig===t&&r.__watchSub){let s;r.__watchSub.observe(()=>{s=t.get()}),ce(e,s,n);return}r.__watchSub&&(r.__watchSub.dispose(),r.__watchSub=void 0),r.__watchSig=t;let o=new on.subtle.Watcher(()=>{queueMicrotask(()=>{if(r.__watchSub!==o)return;let s;try{o.observe(()=>{s=t.get()}),di(e,()=>ce(e,s,n))}catch(a){hi(e,a)}})});r.__watchSub=o;let i;o.observe(()=>{i=t.get()}),ce(e,i,n)}function Ws(e){e.__watchSub&&(e.__watchSub.dispose(),e.__watchSub=void 0,e.__watchSig=void 0)}function Nl(e,t,n){let r=e;U&&(r.__commitOwner=vr(U));let o=e.child;if(o&&o.kind==="async-stream"&&o.mode==="append"&&o.iterable===t.iterable)return;Ne(e);let i=t.iterable[Symbol.asyncIterator](),s={kind:"async-stream",mode:"append",aborted:!1,iterable:t.iterable,iterator:i,nodes:[]};e.child=s,Ks(s,e,t,n)}function Cl(e,t,n){let r=e;U&&(r.__commitOwner=vr(U));let o=e.child;if(o&&o.kind==="async-stream"&&o.mode==="replace"&&o.iterable===t.iterable)return;Ne(e);let i=t.iterable[Symbol.asyncIterator](),s={kind:"async-stream",mode:"replace",aborted:!1,iterable:t.iterable,iterator:i,nodes:[]};e.child=s,Ks(s,e,t,n)}async function Ks(e,t,n,r){let o=t.marker,i=0;for(;!e.aborted;){let s,a;try{if(s=await e.iterator.next(),e.aborted||s.done)break;a=n.mapper?n.mapper(s.value,i):s.value}catch(c){typeof console<"u"&&console.error("[webjs] asyncStream error:",c);return}try{di(t,()=>{let c=Vs(a,r);Ds(o.parentNode,()=>{if(e.mode==="replace"){for(let u of e.nodes)u.parentNode&&u.parentNode.removeChild(u);e.nodes=[]}let l=document.createDocumentFragment();for(let u of c)l.appendChild(u);o.parentNode?.insertBefore(l,o),e.nodes.push(...c)})})}catch(c){e.aborted=!0;try{e.iterator.return?.()?.catch?.(()=>{})}catch{}hi(t,c);return}i++}}function Vs(e,t){if(oe(e)&&(e=e.value),e==null||e===!1||e===!0)return[];if(P(e)){let n=e,{templateEl:r,parts:o,formActions:i}=dt(n),s=r.content.cloneNode(!0),a=o.map(c=>an(c,s));for(let c=0;c<n.values.length;c++)Z(a[c],n.values[c],void 0,n.values,t);t&&t(i,a,n.values);for(let c of a)c.kind==="slot"&&Z(c,void 0,void 0,[],t);return[...s.childNodes]}if(Array.isArray(e)){let n=[];for(let r of e)n.push(...Vs(r,t));return n}return[document.createTextNode(String(e))]}function zs(e){e.aborted=!0;for(let t of e.nodes)t.parentNode&&t.parentNode.removeChild(t);e.nodes=[];try{e.iterator.return?.()?.catch?.(()=>{})}catch{}}function ze(e,t){let n=t,r=n[C];n[C]=!0;let o=U;fi(t);try{let i=n[tn];if(P(e)){let s=e;if(i&&i.strings===s.strings){Ve(i,s.values,Er);return}i&&Gs(i,t);let a=t.firstChild;a&&a.nodeType===8&&a.data==="webjs-hydrate"&&a.remove(),n[tn]=null;let c=Ol(s,t);n[tn]=c;return}if(i&&Gs(i,t),n[tn]=null,t.replaceChildren(),e==null||e===!1||e===!0)return;if(Array.isArray(e)){for(let s of e){let a=document.createTextNode(String(s??""));t.appendChild(a)}return}t.appendChild(document.createTextNode(String(e)))}finally{fi(o),n[C]=r,r||ur(n)}}function Er(e,t,n){if(e)for(let r of[!0,!1])for(let o of e){if(o.isForm!==r)continue;let i=o.actionIdxs[0],s=o.isForm?"action":"formaction";for(let l of o.actionIdxs)if(Zn(yt(n[l]),s,o.tag)){i=l;break}let a=t[i];if(!a||!a.el)continue;let c=yt(n[i]);if(o.isForm)ys(a.el,c,xr(o.methodParts,o.staticMethod,n),xr(o.enctypeParts,o.staticEnctype,n),o);else{let l=u=>u.some(f=>f.kind==="bool"?!!yt(n[f.i]):!0);Rl(a.el,c,o,l(o.nameParts),l(o.valueParts),xr(o.methodParts,o.staticMethod,n),xr(o.enctypeParts,o.staticEnctype,n))}}}function kl(e){(br.has(e)||e.getAttribute("name")===I)&&(e.getAttribute("name")===I&&e.removeAttribute("name"),e.removeAttribute("value"),br.delete(e))}function Rl(e,t,n,r,o,i,s){let a=typeof t=="function"?wo(t):null;if(!a){typeof t=="function"&&So(null,e.localName),kl(e),gs(e,i,s,n.propAttrs);return}ds(n.duplicateAction,e.localName),ps(n.propAttrs,e.localName),n.staticAction&&us(e.localName),(n.authoredValue||o)&&ls(e.localName),(n.authoredName||r)&&as(e.getAttribute("name")||I,e.localName,!1),(n.authoredForm||e.hasAttribute("form"))&&fs(e.localName),cs(e.localName,e.getAttribute("type"));let c=bs(e.localName,i,s);e.removeAttribute("formaction"),e.setAttribute("name",I),e.setAttribute("value",a),Vt(e,"formmethod",i,c.formMethod),Vt(e,"formenctype",s,c.formEnctype),br.set(e,a)}function xr(e,t,n){for(let r of e){if(r.kind==="bool")return yt(n[r.i])?"":z;if(r.kind==="attr"){let a=yt(n[r.i]);return a==null?"":String(a)}let o=r.statics||[],i=r.group||[],s=o[0]||"";for(let a=0;a<i.length;a++)s+=String(yt(n[i[a]])??""),s+=o[a+1]||"";return s}return t??z}function yt(e){return oe(e)?e.value:e}function Ol(e,t){let{templateEl:n,parts:r,formActions:o}=dt(e),i=n.content.cloneNode(!0),s=document.createComment(`${T}s`),a=document.createComment(`${T}e`),c=r.map(f=>an(f,i)),l=[];for(let f=0;f<e.values.length;f++)Z(c[f],e.values[f],void 0,e.values,Er),l.push(e.values[f]);Er(o,c,e.values),t.replaceChildren(s,...i.childNodes,a);let u=t.nodeType===1&&t[_]?t:null;for(let f of c)f.kind==="slot"&&(u&&f.slotEl&&(f.slotEl[De]=u),Z(f,void 0,void 0,[],Er));return{strings:e.strings,bound:c,lastValues:l,startNode:s,endNode:a}}function Gs(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 if(typeof r=="object")try{r.value=void 0}catch{}n.lastTarget=void 0,n.__lastEl=void 0}}if(n.kind==="slot"){let r=mt(n.slotEl);r&&ei(r,n.slotEl)}}t.replaceChildren()}function Ys(e,t){if(e.converter&&e.converter.fromAttribute)return e.converter.fromAttribute(t,e.type);if(e.type===Number)return t==null?null:Number(t);if(e.type===Boolean)return t!=null&&t!=="false";if(e.type===Object||e.type===Array){if(t==null)return null;try{return JSON.parse(t)}catch{return null}}return t}function Ll(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function Js(e,t){let n=e&&e.properties||{};for(let[r,o]of Object.entries(n)){let i=typeof o=="object"&&o!==null?o:{type:o};if(!i.state&&(i.attribute||Ll(r))===t)return{propName:r,def:i}}}var Xs=null;function Tr(e){Xs=e||null}function mi(){return Xs||void 0}_e();var Qs=Symbol.for("webjs:registry"),Zs=Symbol.for("webjs:classToTag"),Nr=globalThis,le=Nr[Qs]||(Nr[Qs]=new Map),ea=Nr[Zs]||(Nr[Zs]=new WeakMap),Cr=typeof window<"u"&&typeof customElements<"u";function bi(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=le.get(e);r?(r.cls=t,r.lazy=n):le.set(e,{cls:t,moduleUrl:null,lazy:n,tag:e}),ea.set(t,e)}if(Cr){let e=customElements.define.bind(customElements);customElements.define=function(t,n,r){customElements.get(t)||e(t,n,r),bi(t,n)}}if(!Cr){let e=globalThis;e.customElements||(e.customElements={define(t,n){bi(t,n)},get(t){return le.get(t)?.cls},upgrade(){},whenDefined(t){let n=le.get(t);return Promise.resolve(n?.cls)}})}function yi(e,t){Cr?customElements.define(e,t):bi(e,t)}function jl(e,t){if(Cr)return;let n=le.get(e);if(n){n.moduleUrl=t;return}le.set(e,{cls:null,moduleUrl:t,lazy:!1,tag:e})}function Pl(e){return le.get(e)?.cls}function Il(e){return le.get(e)?.moduleUrl||null}function Ml(e){return le.get(e)?.lazy===!0}function Ge(e){return ea.get(e)}function Fl(){return[...le.keys()]}un();Ke();function Jl(){return{states:new Set,shadowRoot:null,form:null,labels:[],role:"",willValidate:!0,validity:{},validationMessage:"",setFormValue(){},setValidity(){},checkValidity(){return!0},reportValidity(){return!0}}}var fn=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 i=t.getAttribute(n(o));return i===null?void 0:i},set(r,o,i){return typeof o=="string"&&t.setAttribute(n(o),i),!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,i)=>i.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=Jl(),this.__internals}},Xl=["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 Xl){let t="aria-"+e.slice(4).toLowerCase();Object.defineProperty(fn.prototype,e,{configurable:!0,get(){return this.getAttribute(t)},set(n){n==null?this.removeAttribute(t):this.setAttribute(t,String(n))}})}function ia(e,t){return e!==t}function sa(e){try{return String(e)}catch{return Object.prototype.toString.call(e)}}function wi(e,t,n){if(typeof console>"u"||!console.warn)return;let r=Ge(e.constructor)||e.tagName?.toLowerCase()||"unknown";console.warn(`[webjs] reflect:true property "${t}" on <${r}> holds a function (or an array carrying one), which has no HTML attribute representation. Removing "${n}" instead of stringifying it (a stringified function writes its source into the page, so a server action's body would ship to the browser). Pass a string, or drop reflect on this property.`)}function aa(e,t,n,r){if(typeof console>"u"||!console.warn)return;let o=Ge(e.constructor)||e.tagName?.toLowerCase()||"unknown";console.warn(`[webjs] reflect:true property "${t}" on <${o}> holds a value JSON.stringify cannot serialize (a cycle, a BigInt, or a throwing toJSON), so it has no HTML attribute representation. Removing "${n}" instead. Detail: ${r}`)}function ca(e,t={}){return e&&typeof e=="object"&&!("call"in e)&&(t=e,e=void 0),{...e?{type:e}:{},...t}}var fa=typeof window<"u"&&typeof HTMLElement<"u",Ql=fa?HTMLElement:fn,da=Symbol("webjs.factoryProps"),la=new WeakSet,gt=class e extends Ql{static shadow=!1;static hydrate=void 0;static properties={};static styles=null;static register(t){yi(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||ua(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(la.has(t))return;let n=t;for(;n&&n!==e;){if(Object.hasOwn(n,"properties")&&!Object.hasOwn(n,da)){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://webjs.dev/docs/components.`)}n=Object.getPrototypeOf(n)}la.add(t)}_initializeProperties(){let n=this.constructor.properties;if(!(!n||typeof n!="object")){this.__propValues={};for(let[r,o]of Object.entries(n)){let i=typeof o=="object"?o:{type:o},s=this[r];Object.defineProperty(this,r,{configurable:!0,enumerable:!0,get:()=>this.__propValues[r],set:a=>{let c=this.__propValues[r];(i.hasChanged||ia)(a,c)&&(this.__propValues[r]=a,i.reflect&&!i.state&&this._connected&&this._reflectAttribute(r,a,i),this.requestUpdate(r,c))}}),s!==void 0?this.__propValues[r]=s:i.default!==void 0&&(this.__propValues[r]=typeof i.default=="function"?i.default():i.default)}}}_reflectAttribute(t,n,r){let o=r.attribute||ua(t);if(!this.__reflectingAttribute){this.__reflectingAttribute=!0;try{if(r.converter&&r.converter.toAttribute){let i=r.converter.toAttribute(n,r.type);i==null?this.removeAttribute(o):this.setAttribute(o,i)}else if(typeof n=="function")this.removeAttribute(o),wi(this,t,o);else if(r.type===Boolean)n?this.setAttribute(o,""):this.removeAttribute(o);else if(n==null)this.removeAttribute(o);else if(r.type===Object||r.type===Array){let i,s=!0;try{i=JSON.stringify(n)}catch(a){s=!1,this.removeAttribute(o),aa(this,t,o,a&&a.message)}s&&this.setAttribute(o,i)}else er(n)?(this.removeAttribute(o),wi(this,t,o)):this.setAttribute(o,String(n))}finally{this.__reflectingAttribute=!1}}}connectedCallback(){if(!fa)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 i=Zl(r.slice(16));try{this[i]=Je(o)}catch(s){console.warn(`[webjs] failed to decode ${r} on <${this.tagName.toLowerCase()}>: ${s&&s.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:ho(r)?[r]:[];if(o.length){if(n){let i=this.shadowRoot.querySelector("style");i&&i.remove()}mo(this._renderRoot,o)}}else this._renderRoot=this,t.styles&&console.warn(`[webjs] <${Ge(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)?Fo(this):this.__isHydrating()||this.hasAttribute("data-wj-serialized")||Zo(this)?(this.removeAttribute("data-wj-serialized"),F(this),Ro(this)):ko(this),Wo(this),Io(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),Mo(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 o=Js(this.constructor,t);if(o===void 0)return;let{propName:i,def:s}=o,a=Ys(s,r);this[i]!==a&&(this[i]=a,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;try{let o=this.update(t);o&&typeof o.then=="function"&&(r=o)}catch(o){this._handleRenderError(o)}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;let i=()=>{if(this.__pendingAsyncCommits--,o===this.__renderToken){for(let s of this.__controllers)s.hostUpdated&&s.hostUpdated();this._postCommit(t)}};r.then(i,s=>{try{o===this.__renderToken&&this._handleRenderError(s instanceof Error?s:new Error(sa(s)))}finally{i()}});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 on.subtle.Watcher(()=>{this._connected&&this.requestUpdate()}));let n,r=mi();Tr(this.__renderAbort?this.__renderAbort.signal:null);try{this.__signalWatcher.observe(()=>{n=this.render()})}finally{Tr(r||null)}if(n&&typeof n.then=="function")return this._commitAsync(n);ze(n,this._renderRoot)}_commitAsync(t){let n=this.__renderToken;if(this.__firstRendered&&this._overridesRenderFallback())try{let r=this.renderFallback();r!==void 0&&ze(r,this._renderRoot)}catch(r){console.error("[webjs] renderFallback() threw:",r)}return Promise.resolve(t).then(r=>{if(n===this.__renderToken)try{ze(r,this._renderRoot)}catch(o){this._handleRenderError(o instanceof Error?o:new Error(String(o)))}},r=>{n===this.__renderToken&&this._handleRenderError(r instanceof Error?r:new Error(String(r)))})}_overridesRenderFallback(){return this.renderFallback!==dn.prototype.renderFallback}_handleRenderError(t){console.error(`[webjs] render error in <${Ge(this.constructor)||this.tagName?.toLowerCase()}>:`,t);try{let n=this.renderError(t);n!==void 0&&ze(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 ua(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function Zl(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function dn(e){return new.target?Reflect.construct(gt,arguments,new.target):class extends gt{static properties=e;static[da]=!0}}Object.setPrototypeOf(dn,gt);dn.prototype=gt.prototype;go();var pa=Symbol.for("webjs.notFound"),ha=Symbol.for("webjs.redirect"),ma=Symbol.for("webjs.forbidden"),ba=Symbol.for("webjs.unauthorized");function eu(){let e=new Error("webjs: notFound()");throw e.__webjs=pa,e}function tu(){let e=new Error("webjs: forbidden()");throw e.__webjs=ma,e}function nu(){let e=new Error("webjs: unauthorized()");throw e.__webjs=ba,e}function ru(e,t){let n=typeof t=="object"&&t!==null?t.status:t,r=new Error(`webjs: redirect(${e})`);throw r.__webjs=ha,r.url=e,r.status=typeof n=="number"?n:void 0,r}function ou(e){return!!e&&e.__webjs===pa}function iu(e){return!!e&&e.__webjs===ha}function su(e){return!!e&&e.__webjs===ma}function au(e){return!!e&&e.__webjs===ba}var ya=null;function cu(){if(!ya)return"";try{return ya()||""}catch{return""}}var ga=null;function lu(e){if(typeof e!="string"||!e||!ga)return e;try{return ga(e)||e}catch{return e}}_e();var up=Symbol.for("webjs.suspense");function uu(e){return{_$webjsSuspense:!0,fallback:e.fallback,children:e.children}}function fu(e){return!!e&&typeof e=="object"&&e._$webjsSuspense===!0}function du(e,t={}){let n=t.reconnect!==!1,r=0,o=!1,i=null,s=[];function a(){o||(i=new WebSocket(pu(e),t.protocols),i.onopen=c=>{for(r=0;s.length&&i&&i.readyState===WebSocket.OPEN;)i.send(s.shift());t.onOpen?.(c)},i.onmessage=c=>{let l=c.data;if(typeof l=="string")try{l=JSON.parse(l)}catch{}t.onMessage?.(l,c)},i.onerror=c=>{t.onError?.(c)},i.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);i&&i.readyState===WebSocket.OPEN?i.send(l):s.push(l)},close(c,l){o=!0;try{i?.close(c,l)}catch{}},get socket(){return i},get readyState(){return i?.readyState??3}}}function pu(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}`}un();var _i="application/vnd.webjs+json";async function hu(e,t={}){let n=new Headers(t.headers||{});n.has("accept")||n.set("accept",_i);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 gi(r),n.has("content-type")||n.set("content-type",_i));let o=await fetch(e,{...t,headers:n,body:r}),i=o.headers.get("content-type")||"",s=await o.text(),a=i.includes(_i)?s?Je(s):null:i.includes("application/json")?s?JSON.parse(s):null:s;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}un();Rr();Rr();vi();mn();var Xi=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 i=this.updates.findIndex(s=>s.id===r);i!==-1&&(this.updates.splice(i,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 ef(e,t,n){let r=e.get();e.set(t);let o;try{o=await n()}catch(i){throw e.set(r),i}return o&&o.success===!1&&e.set(r),o}function tf(e,t,n){return e&&typeof e.get=="function"&&typeof e.set=="function"?ef(e,t,n):new Xi(e,t)}Lr();Pr();var nf="application/vnd.webjs+stream",rf=1,of=2,sf=3,mc=new Uint8Array(0);function af(e,t){let n=t||mc,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 cf(){let e=mc;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 i=e.slice(5,5+o);n.push({type:r,payload:i}),e=e.slice(5+o)}return n}}}var lf=Symbol.for("webjs.context");function uf(e){return{__context__:lf,name:e}}var uo=class extends Event{constructor(t,n,r=!1){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.callback=n,this.subscribe=r}},Qi=class{constructor(t,{context:n,initialValue:r}){this._host=t,this._context=n,this._value=r,this._subscriptions=new Set,this._onRequest=o=>{let i=o;if(i.context===this._context)if(o.stopPropagation(),i.subscribe){let s={callback:i.callback},a=()=>{this._subscriptions.delete(s)};this._subscriptions.add(s),i.callback(this._value,a)}else i.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()}},Zi=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 uo(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 ff(){return typeof window<"u"}var we={INITIAL:0,PENDING:1,COMPLETE:2,ERROR:3},es=class{constructor(t,{task:n,args:r,autoRun:o=!0}){this._host=t,this._taskFn=n,this._argsFn=r||(()=>[]),this._autoRun=o,this._status=we.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=we.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=we.COMPLETE,this._error=void 0}catch(r){if(t.signal.aborted)return;this._error=r,this._status=we.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 we.INITIAL:return t.initial?.();case we.PENDING:return t.pending?.();case we.COMPLETE:return t.complete?.(this._value);case we.ERROR:return t.error?.(this._error);default:return}}hostUpdate(){if(!this._autoRun||!ff())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{Zi as ContextConsumer,Qi as ContextProvider,uo as ContextRequestEvent,I as FORM_ACTION_FIELD,ss as FORM_ACTION_ID_KEY,rf as FRAME_CHUNK,of as FRAME_END,sf as FRAME_ERROR,T as MARKER,Na as SEED_MISS,nf as STREAM_CONTENT_TYPE,on as Signal,uu as Suspense,es as Task,we as TaskStatus,dn as WebComponent,Ai as WebjsFrame,xi as WebjsStream,mi as activeActionSignal,mo as adoptStyles,Fl as allTags,lu as asset,Uc as asyncAppend,qc as asyncReplace,al as batch,$c as cache,ll as computed,du as connectWS,Ru as consumeStale,uf as createContext,cf as createFrameDecoder,Dc as createRef,cu as cspNonce,_c as css,ra as deserialize,Gi as disableClientRouter,fl as effect,Xn as enableClientRouter,af as encodeFrame,is as escapeAttr,Ac as escapeText,Cu as fetchMark,tu as forbidden,Mc as guard,wc as html,xo as isAsyncAppend,Eo as isAsyncReplace,ho as isCSS,ir as isCache,su as isForbidden,rr as isGuard,nr as isKeyed,Ml as isLazy,oe as isLive,ou as isNotFound,iu as isRedirect,or as isRef,tr as isRepeat,ul as isSignal,fu as isSuspense,P as isTemplate,vo as isTemplateContent,au as isUnauthorized,Ao as isUnsafeHTML,sr as isUntil,ar as isWatch,Ic as keyed,Pc as live,Ji as loadFrame,Pl as lookup,Il as lookupModuleUrl,ki as markStale,Yi as navigate,eu as notFound,tf as optimistic,Je as parse,Ri as parseTagHeader,jl as primeModuleUrl,ca as prop,ru as redirect,Bc as ref,lo as refreshPage,yi as register,ku as registerKeyTags,ze as render,Ei as renderStream,_s as repeat,co as revalidate,hu as richFetch,Or as scanSeeds,Tu as seedStats,na as serialize,Tr as setActiveActionSignal,cl as signal,gi as stringify,Sc as stylesToString,Ge as tagOf,Eu as takeSeed,Fc as templateContent,nu as unauthorized,jc as unsafeHTML,Hc as until,Wc as watch};
|
|
3
|
+
`);if(a!==c){if(i.length===1&&s.length===1){let l=s[0];for(let u of[...l.attributes])l.removeAttribute(u.name);for(let u of i[0].attributes)l.setAttribute(u.name,u.value);continue}for(let l of s)l.remove();for(let l of i)document.head.appendChild(Di(l))}}for(let[o,i]of r)if(!n.has(o))for(let s of i)s.remove()}function xt(e){let t=e.querySelector("title");t&&(document.title=t.textContent||"");let n=new Set;for(let r of document.head.children)n.add(de(r));for(let r of e.children)r.tagName==="SCRIPT"&&r.getAttribute("type")==="importmap"||r.tagName!=="BASE"&&r.tagName!=="TITLE"&&(r.tagName==="META"&&Ur(r)||n.has(de(r))||(r.tagName==="SCRIPT"?document.head.appendChild(Tn(r)):document.head.appendChild(Di(r))));Mu(e)}function Fu(e){return e.tagName==="STYLE"?!0:e.tagName==="LINK"&&(e.getAttribute("rel")||"").toLowerCase().split(/\s+/).includes("stylesheet")}function Nn(e){let t=document.head,n=e.querySelector("title");n&&(document.title=n.textContent||"");let r=new Set;for(let i of t.children)i.tagName==="SCRIPT"&&i.getAttribute("type")==="importmap"||i.tagName!=="BASE"&&r.add(de(i));let o=new Set;for(let i of e.children)i.tagName==="SCRIPT"&&i.getAttribute("type")==="importmap"||i.tagName!=="BASE"&&o.add(de(i));for(let i of[...t.children])i.tagName==="SCRIPT"&&i.getAttribute("type")==="importmap"||i.tagName!=="BASE"&&i.tagName!=="TITLE"&&(Fu(i)||i.tagName==="META"&&Ur(i)===Ir||o.has(de(i))||i.remove());for(let i of e.children)i.tagName==="SCRIPT"&&i.getAttribute("type")==="importmap"||i.tagName!=="BASE"&&i.tagName!=="TITLE"&&(i.tagName==="META"&&Ur(i)===Ir||r.has(de(i))||(i.tagName==="SCRIPT"?t.appendChild(Tn(i)):t.appendChild(Di(i))))}var Cn=w(()=>{q()});function Kr(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 re(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===bn)return null;let r=typeof document<"u"?document.getElementById(n):null;return r&&r.tagName&&r.tagName.toLowerCase()==="webjs-frame"?n:(Re(`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 Kr(e)}function $i(e){if(!e||typeof document>"u")return null;let t=null;try{t=document.querySelector(`webjs-frame#${CSS.escape(e)}`)}catch{t=document.getElementById(e)}return!t||!t.tagName||t.tagName.toLowerCase()!=="webjs-frame"?null:t}function kn(e,t){let n=$i(e);if(!n)return null;let r=qr.has(n);return qr.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 Rn(e,t){if(qr.get(e)!==t)return;qr.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 On(e,t,n){let r=Wr.has(e);return Wr.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 Ln(e,t,n,r){if(Wr.get(e)!==t)return;Wr.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 Hi(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+=de(r);return n}var qr,Wr,Le=w(()=>{q();te();Cn();qr=new WeakMap;Wr=new WeakMap});function Ga(e,t){if(typeof document>"u"||!document.documentElement)return()=>{};Y&&Y();let n=document.documentElement,r=n.style.getPropertyValue("overflow-anchor");n.style.setProperty("overflow-anchor","none");let o=null,i=typeof t=="number",a=i&&typeof setTimeout=="function"?setTimeout(()=>{i=!1},La):null,c=typeof t=="number"&&typeof window<"u"?()=>{i&&(Math.abs(window.scrollY-t)<=1&&Math.abs(window.scrollX-(e||0))<=1||window.scrollTo({left:e||0,top:t,behavior:"instant"}))}:null,l=()=>{if(Y===l){if(Y=null,o&&(clearTimeout(o),o=null),a&&clearTimeout(a),i=!1,typeof window<"u"){for(let u of Li)window.removeEventListener(u,l,{capture:!0});c&&window.removeEventListener("scroll",c)}r?n.style.setProperty("overflow-anchor",r):n.style.removeProperty("overflow-anchor")}};if(Y=l,o=setTimeout(l,2e3),typeof window<"u"){for(let u of Li)window.addEventListener(u,l,{capture:!0,passive:!0});c&&window.addEventListener("scroll",c,{passive:!0})}return l}function Ya(e){if(typeof document>"u"||!document.documentElement)return()=>{};if(J&&J(),!(e>0))return()=>{};let t=document.documentElement,n=t.style.getPropertyValue("min-height");t.style.setProperty("min-height",e+"px");let r=null,o=()=>{J===o&&(J=null,r&&(clearTimeout(r),r=null),n?t.style.setProperty("min-height",n):t.style.removeProperty("min-height"))};return J=o,r=setTimeout(o,2e3),o}function zr(e){if(typeof requestAnimationFrame!="function"){setTimeout(e,0);return}requestAnimationFrame(()=>requestAnimationFrame(e))}function Gr(){Vr+=1}function jn(e,t){let n=Va(e)||Va(t);return n?(n.getAttribute("data-preserve-scroll")||"").toLowerCase().trim()!=="false":!1}function Va(e){return!e||typeof e.closest!="function"?null:e.closest("[data-preserve-scroll]")}var Y,J,Vr,Yr=w(()=>{q();Y=null;J=null;Vr=0});function Ui(e){if(!K||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=Dr(e);if(!t||t.hasAttribute("download")||t.target&&t.target!=="_self")return;let n=t.href;if(!n)return;let r=new URL(n);if(r.origin!==location.origin)return;if(r.pathname===location.pathname&&r.search===location.search&&r.href.includes("#")){qa(r.href);return}if(t.hasAttribute("data-no-router")||St.test(r.pathname))return;e.preventDefault();let o=re(t);Pn(n,!1,o,{preserveScroll:jn(t)})}function Et(e){Ja(location.href)||Pn(location.href,!0,null)}function Tt(e){if(!K||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.hasAttribute("formtarget")?n.getAttribute("formtarget")||"":t.getAttribute("target")||"";if(r&&r!=="_self")return;let o=Sn(t,n);if(o==="dialog")return;let i=vn(t,n),s=o==="get"||o==="head",a=An(t,n),c;try{c=new URL(a,location.href)}catch{return}if(c.origin!==location.origin||St.test(c.pathname))return;let l=En(t,n);if(Pa(t,n,o,l),!s&&i==="text/plain")return;let u=xn(l,i);e.preventDefault();let f=re(n||t),p=jn(n||t,t);Xa(c.href,o,u,f,t,{preserveScroll:p})}var Jr=w(()=>{$r();q();ye();te();Hr();Le();Yr();In()});function qi(e){let t=pe(e);document.dispatchEvent(new CustomEvent("webjs:before-cache",{detail:{url:e}})),E.has(t)&&E.delete(t);let n={html:document.documentElement.outerHTML,scrollX:typeof window<"u"&&window.scrollX||0,scrollY:typeof window<"u"&&window.scrollY||0,scrollHeight:typeof document<"u"&&document.documentElement&&document.documentElement.scrollHeight||0};for(E.set(t,n);E.size>16;){let r=E.keys().next().value;E.delete(r)}}function Qa(e){let t=pe(e),n=E.get(t);return n==null?null:(E.delete(t),E.set(t,n),typeof n=="string"?{html:n,scrollX:0,scrollY:0,scrollHeight:0}:n)}function pe(e,t){let n=new URL(e,location.href),r=n.pathname+n.search;return t?`${t} ${r}`:r}var E,Nt=w(()=>{q();E=new Map});function Wu(e){let t=he.get(e);return t==null?!1:$n()-t>=Wi?(he.delete(e),!1):!0}function jt(){he.clear()}function Ku(e){for(he.has(e)&&he.delete(e),he.set(e,$n());he.size>qu;)he.delete(he.keys().next().value)}function Hn(){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 Xr(){try{if(typeof matchMedia=="function")return matchMedia("(hover: hover) and (pointer: fine)").matches}catch{}return!0}function Vu(e){let t=e.getAttribute("rel");return t?t.toLowerCase().split(/\s+/).filter(Boolean):[]}function Ot(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.href.includes("#")||St.test(n.pathname)?null:t}function Qr(e){if(e.hasAttribute("data-no-prefetch"))return!0;let t=Vu(e);return t.includes("external")||t.includes("no-prefetch")}function Lt(e){if(Qr(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 Xr()?"intent":"viewport"}}function Pe(e,t){if(!K||typeof fetch!="function"||Hn())return;let n=pe(e,t);if(typeof location<"u"&&n===pe(location.href,t)||ge.has(n)||Mn.has(n))return;let r=v.get(n);if(r&&$n()-r.at<Wi||Wu(n))return;if(ge.size>=Za){for(Mn.add(n),kt.push({href:e,frameId:t||null});kt.length>$u;){let s=kt.shift();Mn.delete(pe(s.href,s.frameId))}return}let o=ue();if(!o&&typeof document<"u"&&document.readyState==="loading")return;ge.add(n);let i={"x-webjs-router":"1","x-webjs-prefetch":"1"};o&&(i["x-webjs-have"]=o),t&&(i["x-webjs-frame"]=t),fetch(e,{method:"GET",headers:i,credentials:"same-origin",cache:"no-cache"}).then(async s=>{let a=s.headers.get("content-type")||"";if(!/^text\/html\b/i.test(a)||s.status>=400)return;let c=s.headers.get("x-webjs-build"),l=s.headers.get("x-webjs-src"),u=typeof document<"u"?document.querySelector('script[type="importmap"]'):null,f=u?u.getAttribute("data-webjs-build"):null,p=u?u.getAttribute("data-webjs-src"):null;if((c&&f&&c!==f||l&&p&&l!==p)&&(E.clear(),tt(n),jt()),(s.headers.get("x-webjs-frame")||null)!==(t||null)){Ku(n);return}let m=s.redirected&&s.url?s.url:e,b=await s.text();Dn.has(n)||Gu(n,{html:b,build:c,src:l,finalUrl:m,frameId:t||null,at:$n()})}).catch(()=>{}).finally(()=>{ge.delete(n),Dn.delete(n),zu()})}function zu(){for(;kt.length&&ge.size<Za;){let{href:e,frameId:t}=kt.shift();Mn.delete(pe(e,t)),Pe(e,t)}}function Gu(e,t){for(v.has(e)&&v.delete(e),v.set(e,t);v.size>Du;){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 Zr(e){let t=/<!--wj:children:([^>]*?)-->/.exec(e||"");return t?t[1]:null}function Un(e,t,n){let r=pe(e,n),o=v.get(r);if(!o)return null;if($n()-o.at>=Wi)return v.delete(r),null;if(o.frameId)return v.delete(r),$i(o.frameId)?o:null;let i=Zr(o.html);return i&&!new Set(String(t??(ue()||"")).split(",").filter(Boolean)).has(i)?(v.delete(r),null):(v.delete(r),o)}function $n(){try{if(typeof performance<"u"&&typeof performance.now=="function")return performance.now()}catch{}return 0}function et(e){if(!K)return;let t=Bi(e.target);if(!t)return;let n=Lt(t);if(n==="none"||n==="render")return;let r=Ot(t);if(r){if(e.type==="touchstart"){Pe(r,re(t));return}n==="intent"&&(Fn===t&&Rt||(qn(),Fn=t,Rt=setTimeout(()=>{Rt=null,Fn=null,Pe(r,re(t))},Hu)))}}function Ki(e){let t=Bi(e.target);t&&t===Fn&&qn()}function qn(){Rt&&(clearTimeout(Rt),Rt=null),Fn=null}function eo(){for(let e of Bn)clearTimeout(e);Bn.clear(),Ct=new WeakMap}function to(){if(typeof document>"u"||Hn())return;let e=typeof IntersectionObserver<"u";e&&(je?(je.disconnect(),eo()):je=new IntersectionObserver(t=>{for(let n of t){let r=n.target;if(n.isIntersecting){if(Ct.has(r))continue;let o=setTimeout(()=>{Bn.delete(o),Ct.delete(r),je.unobserve(r);let i=Ot(r);i&&Lt(r)==="viewport"&&Pe(i,re(r))},Uu);Ct.set(r,o),Bn.add(o)}else{let o=Ct.get(r);o&&(clearTimeout(o),Bn.delete(o),Ct.delete(r))}}},{threshold:.5}));for(let t of document.querySelectorAll("a[href]")){let n=Lt(t);if(n==="render"){let r=Ot(t);r&&Pe(r,re(t))}else n==="viewport"&&e&&je.observe(t)}}function tt(e){v.clear();for(let t of ge)t!==e&&Dn.add(t)}function ec(e,t){let n=pe(e,t);v.delete(n),ge.has(n)&&Dn.add(n)}function tc(e,t){return v.get(pe(e,t))||null}function nc(){return ge.size}function rc(){v.clear(),he.clear(),ge.clear(),Dn.clear(),kt.length=0,Mn.clear(),qn(),eo()}function oc(){je&&(je.disconnect(),je=null)}var Du,Wi,Za,$u,Hu,Uu,v,he,qu,ge,Dn,kt,Mn,Rt,Fn,je,Ct,Bn,nt=w(()=>{$r();Oe();q();Le();ye();Nt();Du=8,Wi=3e4,Za=3,$u=24,Hu=100,Uu=250,v=new Map,he=new Map,qu=16;ge=new Set,Dn=new Set,kt=[],Mn=new Set,Rt=null,Fn=null,je=null,Ct=new WeakMap,Bn=new Set});function Vi(e){for(let t of e.querySelectorAll("template[data-webjs-resolve]")){let n=t.cloneNode(!0);document.body.appendChild(n);let r=n.getAttribute("data-webjs-resolve"),o=window.__webjsResolve;r&&typeof o=="function"&&o(r)}}async function Wn(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",i="<!--wj-stream-shell-->",s=/<\/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(i);if(l!==-1)return{shell:r.slice(0,l),streaming:!0,reader:c?null:t,dec:n,rest:r.slice(l+i.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=s.exec(r);if(f){let p=f.index+f[0].length;return{shell:r.slice(0,p),streaming:!0,reader:t,dec:n,rest:r.slice(p)}}}}function no(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 i=1,s;for(;s=o.exec(e);)if(s[1]==="/"){if(i--,i===0)return{id:n,content:e.slice(r,s.index),rest:e.slice(s.index+s[0].length)}}else i++;return null}function ro(e,t){let n=document.getElementById(e);if(!n){Ma(e);return}let r=document.createElement("template");r.innerHTML=t;let o=[...r.content.childNodes];n.replaceWith(r.content);for(let i of o)i.nodeType===1&&oo(i)}async function Kn(e,t,n,r){let o=n,i=()=>{let s;for(;s=no(o);){if(!r())return!1;ro(s.id,s.content),o=s.rest}return!0};if(!e){i();return}try{for(;;){if(!i()){try{await e.cancel()}catch{}return}let{value:s,done:a}=await e.read();if(s&&(o+=t.decode(s,{stream:!0})),a){o+=t.decode(),i();return}}}catch{}}var Vn=w(()=>{te();Pt()});function Mt(){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 rt(e,t){let n=typeof document<"u"?document.startViewTransition:void 0;if(Mt()&&typeof n=="function"){let r=n.call(document,e);return r&&r.finished&&typeof r.finished.then=="function"?r.finished.then(()=>{t&&t()}).catch(()=>{}):t&&t(),r&&r.updateCallbackDone&&typeof r.updateCallbackDone.then=="function"?r.updateCallbackDone.catch(()=>{}):Promise.resolve()}return e(),t&&t(),Promise.resolve()}function zn(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 i=null;try{i=t.querySelector(`#${CSS.escape(o)}`)}catch{i=null}if(!i||!r.hasAttribute||!r.hasAttribute("data-webjs-permanent"))continue;let s=i.parentNode;s&&i!==r&&(s.replaceChild(r,i),It.add(r))}}function ot(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 i of o.querySelectorAll("[data-webjs-permanent][id]"))n.push(i)}if(n.length)for(let r of n){let o=r.id;if(!o)continue;let i=Yu(t,o);if(!i||i===r)continue;let s=i.parentNode;if(s)s.replaceChild(r,i),It.add(r);else{let a=t.indexOf(i);a!==-1&&(t[a]=r,It.add(r))}}}function Yu(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}var It,Ft=w(()=>{It=new WeakSet});function ct(e,t,n,r,o,i,s,a){let c=!1,l=()=>{if(!c){c=!0;try{Or(e,{frame:!!t})}catch{}}};try{for(let d of e.querySelectorAll("[data-wj-host]"))d.setAttribute("data-wj-serialized","")}catch{}try{typeof sessionStorage<"u"&&(!r||t||n)&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}if(r&&!t&&!n){let d=document.querySelector('script[type="importmap"]'),m=d?d.getAttribute("data-webjs-build"):null,b=!1;if(o&&m&&(b=o!==m),!b&&e.head&&e.head.children.length>0){let y=Hi(document),g=Hi(e);y!==g&&(b=!0)}if(b&&typeof location<"u"){E.clear(),tt(),jt();try{let y="webjs:importmap-reload";if(sessionStorage&&sessionStorage.getItem(y))sessionStorage.removeItem(y),ee("deploy-mismatch-reload-suppressed",r,!1);else return sessionStorage&&sessionStorage.setItem(y,"1"),ee("deploy-mismatch",r),fe(r),"none"}catch{return ee("deploy-mismatch",r),fe(r),"none"}}else if(!b){let y=d?d.getAttribute("data-webjs-src"):null;i&&y&&i!==y&&(E.clear(),tt(),jt(),d&&d.setAttribute("data-webjs-src",i));try{typeof sessionStorage<"u"&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}}}if(t){l();let d=document.querySelector(`webjs-frame#${CSS.escape(t)}`),m=e.querySelector(`webjs-frame#${CSS.escape(t)}`);if(d&&m){a&&a(),xt(e.head),it=rt(()=>{uc(d,m),Bt(d),st(d),Vi(e.body),at()},()=>st(d));return}let b=new CustomEvent("webjs:frame-missing",{bubbles:!0,cancelable:!0,detail:{frameId:t,url:r||(typeof location<"u"?location.href:null),document:e}});return(d||document).dispatchEvent(b),b.defaultPrevented||console.warn(`[webjs] frame "${t}" was not in the navigation response, leaving it unchanged. Handle "webjs:frame-missing" (preventDefault) to override.`),"none"}if(s==="shell"){l(),a&&a(),ic(e);return}let u=ne(document.body),f=ne(e.body),p=u&&f?gn(u,f):null;if(p){l(),a&&a();let{mode:d,live:m,incoming:b}=p;xt(e.head),it=rt(()=>{d==="replace"?ac(m,b):cc(m,b,e),lc(m.start,b.start),Vi(e.body),at()},()=>sc(m));return}if(r&&!n&&typeof location<"u")return ee(u?f?"no-shared-boundary":"incoming-boundaries-malformed":"live-boundaries-malformed",r),fe(r),"none";if(r&&n)return ee("revalidation-discarded",r,!1),"discard";l(),a&&a(),ic(e)}function ic(e){Nn(e.head),zn(document.body,e.body);let t=[...e.body.childNodes];it=rt(()=>{document.body.replaceChildren(...t),Bt(document.body),st(document.body),at()},()=>st(document.body))}var it,Gn=w(()=>{Lr();Oe();te();Dt();Le();Cn();nt();Nt();ye();Vn();Pt();Ft();it=Promise.resolve()});function fc(){zi||typeof MutationObserver>"u"||typeof customElements>"u"||(zi=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)}}),zi.observe(document.body,{childList:!0,subtree:!0}))}function sc(e){if(!(!e||!e.start))for(let t=e.start.nextSibling;t&&t!==e.end;t=t.nextSibling)t.nodeType===1&&st(t)}function st(e){typeof customElements>"u"||oo(e)}function oo(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&&oo(n.shadowRoot))}function Bt(e){if(e.tagName==="SCRIPT"){let n=Tn(e);return e.replaceWith(n),n}let t=[];It.has(e)&&t.push(e);for(let n of e.querySelectorAll("[data-webjs-permanent]"))It.has(n)&&t.push(n);for(let n of e.querySelectorAll("script"))t.length&&t.some(r=>r!==n&&r.contains(n))||n.replaceWith(Tn(n));return e}function Yn(e){let t=[];for(let n=e.start.nextSibling;n&&n!==e.end;n=n.nextSibling)n.nodeType===1&&t.push(n);for(let n of t){let r=Bt(n);r.isConnected!==!1&&st(r)}}var zi,Pt=w(()=>{Oe();q();te();Dt();_n();Jr();Hr();Le();Cn();nt();Nt();Vn();Gn();Ft();zi=null});function at(){let e=document.activeElement;!e||e===document.body||e===document.documentElement||typeof e.blur=="function"&&e.blur()}function ac(e,t){let n=e.start.parentNode;if(!n)return;let r=[];for(let i=e.start.nextSibling;i&&i!==e.end;i=i.nextSibling)r.push(i);let o=[];for(let i=t.start.nextSibling;i&&i!==t.end;i=i.nextSibling)o.push(document.importNode(i,!0));ot(r,o);for(let i of r)i.parentNode===n&&n.removeChild(i);for(let i of o)n.insertBefore(i,e.end);Yn(e)}function cc(e,t,n){if(!e||!t)return;let r=e.start.parentNode;if(!r)return;let o=[];for(let s=e.start.nextSibling;s&&s!==e.end;s=s.nextSibling)o.push(s);let i=[];for(let s=t.start.nextSibling;s&&s!==t.end;s=s.nextSibling)i.push(document.importNode(s,!0));ot(o,i),Ju(r,e.start,e.end,o,i),Yn(e)}function Ju(e,t,n,r,o){let i=new Map;for(let c of r){if(c.nodeType!==1)continue;let l=Ie(c);l&&i.set(l,c)}let s=n,a=[];for(let c of o){if(c.nodeType===1){let l=Ie(c);if(l&&i.has(l)){let u=i.get(l);$t(u,c),a.push(u),i.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,s)}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),!At.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])At.has(r.name)||n.has(r.name)||e.removeAttribute(r.name);if(Xu(e)){Zu(e,t);return}Ht(e,t)}function Xu(e){let t=e;return t[Symbol.for("webjs.instance")]!=null||t[_]!=null}function Qu(e,t){for(let n=e.parentElement;n&&n!==t;n=n.parentElement)if(n.tagName.includes("-"))return!1;return!0}function io(e){let t=new Map,n=`slot[${S}][${O}="${M}"]`;for(let r of e.querySelectorAll(n)){let o=r;if(!Qu(o,e)||qo(e,o))continue;let i=!1;for(let a=o.parentElement;a&&a!==e;a=a.parentElement)if(a.tagName==="SLOT"&&a.hasAttribute(S)&&a.getAttribute(O)===M){i=!0;break}if(i)continue;let s=H(o.getAttribute("name"));t.has(s)||t.set(s,o)}return t}function lc(e,t){let n=e.parentNode;if(!n||n.nodeType!==1)return;let r=n;if(r.tagName!=="SLOT"||!r.hasAttribute(S))return;let o=null;for(let f=r.parentElement;f;f=f.parentElement){if(f[_]){o=f;break}if(f.tagName.includes("-"))return}if(!o)return;let i=H(r.getAttribute("name"));Ee(o,i,[...r.childNodes]);let s=t.parentNode;if(!s||s.nodeType!==1)return;let a=s;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=io(o),u=io(c);for(let f of new Set([...l.keys(),...u.keys()])){if(f===i)continue;let p=u.get(f);p?Ee(o,f,[...p.childNodes].map(d=>document.importNode(d,!0))):l.get(f)&&Ee(o,f,null)}}function Zu(e,t){if(!e[_])return;let n=io(e),r=io(t);if(n.size===0&&r.size===0)return;let o=new Set([...n.keys(),...r.keys()]);for(let i of o){let s=n.get(i),a=r.get(i);s&&a?(Ht(s,a),Ee(e,i,[...s.childNodes])):a?Ee(e,i,[...a.childNodes].map(c=>document.importNode(c,!0))):Ee(e,i,null)}}function Ht(e,t){let n=[...e.childNodes],r=[...t.childNodes].map(a=>document.importNode(a,!0));ot(n,r);let o=new Map;for(let a of n){if(a.nodeType!==1)continue;let c=Ie(a);c&&o.set(c,a)}let i=[];for(let a=0;a<r.length;a++){let c=r[a];if(c.nodeType===1){let l=Ie(c);if(l&&o.has(l)){let f=o.get(l);$t(f,c),i.push(f),o.delete(l);continue}let u=n[a];if(u&&u.nodeType===1&&!Ie(u)&&u.tagName===c.tagName){$t(u,c),i.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),i.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),i.push(l);continue}}i.push(c)}let s=new Set(i);for(let a of n)!s.has(a)&&a.parentNode===e&&e.removeChild(a);for(let a=0;a<i.length;a++){let c=i[a];(c.parentNode!==e||e.childNodes[a]!==c)&&e.insertBefore(c,e.childNodes[a]||null)}}function Ie(e){let t=e.getAttribute("data-key");return t?`${e.tagName}:k:${t}`:e.id?`${e.tagName}:i:${e.id}`:null}function Ut(){let e=ne(document.body);if(!e||e.size===0)return null;let t=[...e.keys()].sort((c,l)=>l.length-c.length),n=null,r=null;for(let c of t){let l=document.getElementById(`wj-loading:${c}`);if(l instanceof HTMLTemplateElement){n=c,r=l;break}}if(n===null||r===null)return null;let o=e.get(n),i=ue(),s=[];for(let c=o.start.nextSibling;c&&c!==o.end;c=c.nextSibling)s.push(c);let a=document.createRange();return a.setStartAfter(o.start),a.setEndBefore(o.end),a.deleteContents(),o.start.parentNode.insertBefore(r.content.cloneNode(!0),o.end),{slot:o,oldChildren:s,token:k,haveKeys:i}}function Me(e){if(!e||e.token!==k)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 uc(e,t){Ht(e,t)}var Dt=w(()=>{Ke();Oe();q();ye();Pt();Ft()});function ef(e){if(typeof document>"u"||!document.body)return!1;let t=ne(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 i=document.createElement("div");i.setAttribute("role","alert"),i.setAttribute("data-webjs-nav-error","");let s=e?`This page could not be loaded. (status ${e})`:"This page could not be loaded.";i.textContent=s;let a=document.createRange();return a.setStartAfter(n.start),a.setEndBefore(n.end),a.deleteContents(),o.insertBefore(i,n.end),!0}function so(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||ef(t)||typeof location<"u"&&(ee("navigation-error-unrecoverable",e),fe(e))}var dc=w(()=>{Oe();te();ye()});async function Jn(e,t,n,r,o,i,s,a,c,l){o=o||"GET";let u=l&&l.refresh||void 0,f=!!(l&&l.noPrefetch),p=!!(l&&l.preserveScroll),d=typeof a=="number"?a:k,m,b=null,y=null,g=null,h=null,R=!1,x=e,me=t?kn(t,d):null;try{try{let B=o==="GET"&&!i&&!u&&!f?Un(e,r?r.haveKeys:void 0,t):null;if(B)m=B.html,y=B.build,g=B.src,x=B.finalUrl,h=200,R=!0;else{let Be={"x-webjs-router":"1"},ts=u?"":ue();ts&&(Be["x-webjs-have"]=ts),t&&(Be["x-webjs-frame"]=t),i!=null&&o!=="GET"&&o!=="HEAD"&&(Be.accept=Oi+", text/html");let fo={method:o,headers:Be,credentials:"same-origin",cache:"no-cache"};s&&(fo.signal=s),i!=null&&o!=="GET"&&o!=="HEAD"&&(fo.body=i);let D=await fetch(e,fo);h=D.status,R=D.ok;let ns=Ri(D.headers.get("x-webjs-invalidate"));ns.length&&ki(ns);let rs=D.headers.get("content-type")||"",yc=/^text\/html\b/i.test(rs);if(rs.toLowerCase().indexOf(Oi)===0){let gc=await D.text(),Qn=d===k;return Qn&&(Me(r),Ei(gc)),{ok:Qn&&R,status:h,aborted:!Qn,applied:Qn}}if(D.redirected&&D.url&&(x=D.url),D.status===204||D.status===205)return d===k&&n&&history.pushState(null,"",x),{ok:R,status:h,aborted:!1,applied:!1};if(!yc)return d===k&&(Me(r),so(e,D.status,null)),{ok:!1,status:h,aborted:!1,applied:!1};y=D.headers.get("x-webjs-build"),g=D.headers.get("x-webjs-src");let po=await Wn(D);m=po.shell,po.streaming&&(b=po)}}catch(B){return B&&B.name==="AbortError"?{ok:!1,status:null,aborted:!0,applied:!1}:d!==k?{ok:!1,status:null,aborted:!0,applied:!1}:(Me(r),so(e,null,B instanceof Error?B:new Error(String(B))),{ok:!1,status:null,aborted:!1,applied:!1})}if(d!==k){if(b&&b.reader)try{b.reader.cancel()}catch{}return{ok:!1,status:h,aborted:!0,applied:!1}}let lt=Ze(m);if(!lt)return Me(r),so(e,null,new Error("navigation response did not parse as HTML")),{ok:!1,status:h,aborted:!1,applied:!1};let qt=!1,Fe=n?()=>{qt||(qt=!0,history.pushState(null,"",x))}:null,Wt=ct(lt,t,!!c,x,y,g,u,Fe),j=Wt!=="none";if(Wt==="discard"){if(b&&b.reader)try{b.reader.cancel()}catch{}return{ok:R,status:h,aborted:!1,applied:!1}}if(Fe&&Fe(),n&&!t){let B=new URL(x),Be=B.hash?document.getElementById(B.hash.slice(1)):null;Be?Be.scrollIntoView():p||(Fa(),window.scrollTo({left:0,top:0,behavior:"instant"}))}return b&&(b.reader||b.rest)&&it.then(()=>Kn(b.reader,b.dec,b.rest,()=>d===k)),document.dispatchEvent(new CustomEvent("webjs:navigate",{detail:{url:x,frameId:t,from:"navigate"}})),{ok:R,status:h,aborted:!1,applied:j}}finally{me&&Rn(me,d)}}var pc=w(()=>{Pr();mn();Oe();q();te();Dt();_n();Le();dc();In();nt();ye();Vn();Gn()});function Ja(e){if(!Wa(e)||!V)return!1;let t,n;try{t=new URL(V),n=new URL(e,location.href)}catch{return!1}return t.pathname!==n.pathname||t.search!==n.search?!1:(V=n.href,!0)}function Xn(){K||typeof document>"u"||(Mi(!0),globalThis.__webjsRefreshPage=lo,document.addEventListener("click",Ui,!1),document.addEventListener("submit",Tt,!1),window.addEventListener("popstate",Et),document.addEventListener("pointerover",et,!0),document.addEventListener("focusin",et,!0),document.addEventListener("touchstart",et,{capture:!0,passive:!0}),document.addEventListener("pointerout",Ki,!0),document.addEventListener("webjs:navigate",to),fc(),to(),typeof history<"u"&&"scrollRestoration"in history&&(ao=history.scrollRestoration,history.scrollRestoration="auto"),typeof location<"u"&&(V=location.href),Ia())}function Gi(){K&&(Mi(!1),document.removeEventListener("click",Ui,!1),document.removeEventListener("submit",Tt,!1),window.removeEventListener("popstate",Et),Br(),document.removeEventListener("pointerover",et,!0),document.removeEventListener("focusin",et,!0),document.removeEventListener("touchstart",et,{capture:!0}),document.removeEventListener("pointerout",Ki,!0),document.removeEventListener("webjs:navigate",to),qn(),eo(),oc(),typeof history<"u"&&ao!==null&&(history.scrollRestoration=ao,ao=null),Gr(),Y&&Y(),J&&J(),V=null,delete globalThis.__webjsRefreshPage)}async function Yi(e,t){let n=new URL(e,location.href);if(n.origin!==location.origin){fe(e);return}await Pn(n.href,t?.replace??!1,null,{preserveScroll:t?.scroll===!1})}async function Ji(e,t){if(typeof location>"u")return{ok:!1,status:null,aborted:!1,applied:!1};let n=e&&e.id;if(!n)return{ok:!1,status:null,aborted:!1,applied:!1};let r=new URL(t,location.href);if(r.origin!==location.origin)return{ok:!1,status:null,aborted:!1,applied:!1};X&&X.abort(),X=new AbortController;let o=X.signal,i=Fr(),s=await Jn(r.href,n,!1,null,"GET",null,o,i,!1,{noPrefetch:!0});return s&&s.applied&&ec(r.href,n),s}function co(e){if(!e){E.clear(),tt();return}let t=new URL(e,location.href),n=t.pathname+t.search;E.delete(n),v.delete(n);let r=` ${n}`;for(let o of[...v.keys()])o.endsWith(r)&&v.delete(o)}async function lo(e){if(!K||typeof location>"u")return!1;co(),jt();try{let t=await Pn(location.href,!1,null,{refresh:e==="shell"?"shell":"page"});return!t||t.aborted?!0:t.applied}catch{return!1}}async function Pn(e,t,n,r){Br();let o=r&&r.refresh||void 0,i=!!(r&&r.preserveScroll);if(Ii(t,n)&&typeof location<"u")return ee("readyState-loading",e),fe(e),null;X&&X.abort(),X=new AbortController;let s=X.signal,a=Fr();n||(Gr(),Y&&Y(),J&&J()),!o&&V&&qi(V);let c=setTimeout(()=>{yn(!0),c=null},150),l=null;!t&&!o&&(l=Ut());let u=!1;try{if(t){let p=Qa(e);if(p){let d=Ze(p.html);if(d){let m=Ya(p.scrollHeight);ct(d,n,!0,null);let b=()=>{};if(typeof window<"u"){let h=()=>{b=Ga(p.scrollX,p.scrollY)};if(Mt()&&typeof document.startViewTransition=="function"){let R=Vr;it.then(()=>{R!==Vr||!K||h()}).catch(()=>{})}else h()}let y=Jn(e,n,!1,l,"GET",null,s,a,!0).catch(()=>{}),g=new Promise(h=>setTimeout(h,500));return Promise.all([y,g]).then(()=>zr(()=>{b(),zr(m)})),null}}u=!0,typeof window<"u"&&window.scrollTo({left:0,top:0,behavior:"instant"})}let f=await Jn(e,n,!t&&!o,l,"GET",null,s,a,!1,{refresh:o,preserveScroll:i});return u&&f&&f.applied&&typeof window<"u"&&zr(()=>{a!==k||!K||window.scrollTo({left:0,top:0,behavior:"instant"})}),f}finally{c&&clearTimeout(c),a===k&&(yn(!1),typeof location<"u"&&(V=location.href))}}async function Xa(e,t,n,r,o,i){Br(),X&&X.abort(),X=new AbortController;let s=X.signal,a=Fr();r||(Gr(),Y&&Y(),J&&J());let c=t==="get"||t==="head",l=new URL(e,location.href);if(c){l.search="";for(let[m,b]of n)l.searchParams.append(m,typeof b=="string"?b:b.name)}V&&qi(V);let u=setTimeout(()=>{yn(!0),u=null},150),f=Ut(),p=o?On(o,a,l.href):null,d=!1;try{let m=await Jn(l.href,r,!0,f,c?"GET":t.toUpperCase(),c?null:n,s,a,!1,{preserveScroll:!!(i&&i.preserveScroll)});d=!!(m&&m.ok),!c&&a===k&&(E.clear(),tt())}finally{p&&Ln(p,a,l.href,d),u&&clearTimeout(u),a===k&&(yn(!1),typeof location<"u"&&(V=location.href))}}function hc(){return V}function mc(e){V=e}var X,V,ao,In=w(()=>{q();te();Dt();_n();Jr();pc();Le();nt();Yr();Nt();ye();Gn();Pt();Ft();X=null,V=null;ao=null});var xa={};os(xa,{_FALLBACK_MARKER_KEY:()=>Qe,_FRAME_TOP:()=>bn,_LIVE_ATTRS:()=>At,_activateSwappedRange:()=>Yn,_activeFrameId:()=>Kr,_addNewHeadElements:()=>xt,_applyOptimisticLoading:()=>Ut,_applyStreamedResolve:()=>ro,_applySwap:()=>ct,_blurOutgoingFocus:()=>at,_buildHaveHeader:()=>ue,_buildSubmitFormData:()=>En,_bumpNavToken:()=>Ua,_clearFormBusy:()=>Ln,_clearFrameBusy:()=>Rn,_collectBoundaries:()=>ne,_currentPageUrl:()=>hc,_diffElementInPlace:()=>$t,_eligibleAnchorHref:()=>Ot,_encodeSubmitBody:()=>xn,_findAnchorInPath:()=>Dr,_getSubmitAction:()=>An,_getSubmitEnctype:()=>vn,_getSubmitMethod:()=>Sn,_isNonHtmlPath:()=>Oa,_isPreBootNavigation:()=>Mr,_keyOf:()=>Ie,_markFormBusy:()=>On,_markFrameBusy:()=>kn,_mergeHead:()=>Nn,_navToken:()=>Ha,_onPopState:()=>Et,_onSubmit:()=>Tt,_parseHTML:()=>Ze,_planBoundarySwap:()=>gn,_prefetch:()=>Pe,_prefetchAnchor:()=>Zr,_prefetchCache:()=>v,_prefetchHasHoverPointer:()=>Xr,_prefetchInflightSize:()=>nc,_prefetchMode:()=>Lt,_prefetchPeek:()=>tc,_prefetchSaysSaveData:()=>Hn,_prefetchSuppressed:()=>Qr,_prefetchTake:()=>Un,_reactivateScripts:()=>Bt,_readStreamedShell:()=>Wn,_reconcileChildren:()=>Ht,_regraftPermanentElements:()=>zn,_regraftPermanentInSlice:()=>ot,_resetParseProbe:()=>Fi,_resetPrefetch:()=>rc,_resetWarnOnce:()=>Ba,_resolvePreserveScroll:()=>jn,_resolveTargetFrameId:()=>re,_restoreOptimistic:()=>Me,_runWithTransition:()=>rt,_setCurrentPageUrl:()=>mc,_setHardNavigate:()=>$a,_shouldFullLoadDuringParse:()=>Da,_snapshotCache:()=>E,_streamBoundariesProgressively:()=>Kn,_takeResolveUnit:()=>no,_viewTransitionsEnabled:()=>Mt,disableClientRouter:()=>Gi,enableClientRouter:()=>Xn,loadFrame:()=>Ji,navigate:()=>Yi,refreshPage:()=>lo,revalidate:()=>co});var Rr=w(()=>{vi();mn();mn();_e();Ta();Lr();Pr();Ke();In();q();te();In();nt();ye();Oe();q();te();Dt();_n();$r();Jr();Hr();Le();Cn();nt();Yr();Nt();Vn();Gn();Pt();Ft();(typeof window>"u"||window.__WEBJS_CLIENT_ROUTER__!==!1)&&Xn()});function _c(e,...t){return{_$webjs:"template",strings:e,values:t}}function P(e){return!!e&&typeof e=="object"&&e._$webjs==="template"}var T="wjm-";function Sc(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 ho(e){return!!e&&typeof e=="object"&&e._$webjsCss===!0}function mo(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(`
|
|
4
|
+
`),n.appendChild(r)}}function Ac(e){return!e||!e.length?"":`<style>${e.map(t=>t.text).join(`
|
|
5
|
+
`)}</style>`}_e();var ws=Symbol.for("webjs.repeat");function _s(e,t,n){return{[ws]:!0,items:[...e],keyFn:t,templateFn:n}}function tr(e){return!!e&&typeof e=="object"&&e[ws]===!0}function Pc(e){return{_$webjs:"unsafe-html",value:String(e??"")}}function Ao(e){return!!e&&typeof e=="object"&&e._$webjs==="unsafe-html"}function Ic(e){return{_$webjs:"live",value:e}}function oe(e){return!!e&&typeof e=="object"&&e._$webjs==="live"}function Mc(e,t){return{_$webjs:"keyed",key:e,value:t}}function nr(e){return!!e&&typeof e=="object"&&e._$webjs==="keyed"}function Fc(e,t){return{_$webjs:"guard",deps:e,fn:t}}function rr(e){return!!e&&typeof e=="object"&&e._$webjs==="guard"}function Bc(e){return{_$webjs:"template-content",template:e}}function vo(e){return!!e&&typeof e=="object"&&e._$webjs==="template-content"}function Dc(e){return{_$webjs:"ref",target:e}}function or(e){return!!e&&typeof e=="object"&&e._$webjs==="ref"}function $c(){return{value:void 0}}function Hc(e){return{_$webjs:"cache",value:e}}function ir(e){return!!e&&typeof e=="object"&&e._$webjs==="cache"}function Uc(...e){return{_$webjs:"until",args:e}}function sr(e){return!!e&&typeof e=="object"&&e._$webjs==="until"}function qc(e,t){return{_$webjs:"async-append",iterable:e,mapper:t}}function xo(e){return!!e&&typeof e=="object"&&e._$webjs==="async-append"}function Wc(e,t){return{_$webjs:"async-replace",iterable:e,mapper:t}}function Eo(e){return!!e&&typeof e=="object"&&e._$webjs==="async-replace"}function Kc(e){return{_$webjs:"watch",signal:e}}function ar(e){return!!e&&typeof e=="object"&&e._$webjs==="watch"}Ke();yo();_e();Ke();var mr=new WeakMap,br=new WeakMap,tn=Symbol.for("webjs.instance");function dt(e){let{strings:t}=e,n=mr.get(t);if(n)return n;let r=[],o="",i="text",s="",a=0,c="",l=0,u=null,f="",p="";for(let b=0;b<t.length;b++){let y=t[b];for(let g=0;g<y.length;g++){let h=y[g];switch(i){case"text":o+=h,h==="<"&&(i="tag-open");break;case"tag-open":o+=h,h==="!"?i="bang-1":h==="/"?(i="tag-name",f=""):/[a-zA-Z]/.test(h)?(i="tag-name",f=h.toLowerCase()):i="text";break;case"bang-1":o+=h,i=h==="-"?"bang-dash":"tag-name";break;case"bang-dash":o+=h,h==="-"?(i="comment",l=0):i="tag-name";break;case"comment":o+=h,h==="-"?l+=1:(h===">"&&l>=2&&(i="text"),l=0);break;case"tag-name":o+=h,h===">"?(i=f==="script"||f==="style"?"rawtext":"text",i==="rawtext"&&(p="")):/\s/.test(h)?i="in-tag":f+=h.toLowerCase();break;case"in-tag":o+=h,h===">"?(i=f==="script"||f==="style"?"rawtext":"text",i==="rawtext"&&(p="")):!/\s/.test(h)&&h!=="/"&&(i="attr-name",s=h,a=o.length-1);break;case"rawtext":o+=h,p=(p+h.toLowerCase()).slice(-9),(p.endsWith("<\/script>")||p.endsWith("</style>"))&&(i="text",p="",f="");break;case"attr-name":h==="="?(i="after-eq",o+=h):/\s/.test(h)?(i="in-tag",s="",o+=h):h===">"?(i="text",s="",o+=h):(s+=h,o+=h);break;case"after-eq":h==='"'||h==="'"?(i="attr-quoted",c=h,o+=h):/\s/.test(h)?(i="in-tag",s="",o+=h):h===">"?(i="text",s="",o+=h):(i="attr-unquoted",o+=h);break;case"attr-unquoted":/\s/.test(h)?(i="in-tag",s="",o+=h):(h===">"&&(i="text",s=""),o+=h);break;case"attr-quoted":o+=h,h===c&&(i="in-tag",s="");break;case"skip-attr":if(h===c){if(u){let R=u.firstPartIdx,x=[];for(let j=R;j<r.length;j++)(r[j].kind==="noop"||r[j].kind==="attr-mixed")&&x.push(j);let me=[],lt=t[x[0]],qt=lt.lastIndexOf(c);me.push(qt>=0?lt.slice(qt+1):lt);for(let j=1;j<x.length;j++)me.push(t[x[j]]);let Fe=t[x[x.length-1]+1],Wt=Fe.indexOf(c);me.push(Wt>=0?Fe.slice(0,Wt):Fe),r[R]={kind:"attr-mixed",path:[],name:u.name,statics:me,group:x};for(let j=1;j<x.length;j++)r[x[j]]={kind:"noop",path:[],mixedAnchor:R};u=null}i="in-tag",s=""}break}}if(b<t.length-1){let g=r.length;if(i==="comment"){l=0,r.push({kind:"noop",path:[]});continue}if(i==="rawtext"){p="",r.push({kind:"noop",path:[]});continue}if(i==="text")o+=`<!--${T}${g}-->`,r.push({kind:"child",path:[]});else if(i==="in-tag"){let h=`data-${T}${g}`;o+=`${h}=""`,r.push({kind:"element",path:[]})}else if(i==="after-eq"){let h=s[0],R=s.slice(1);if(Kt(h)){o=o.slice(0,a);let x=bo[h],me=`data-${T}${g}`;o+=`${me}=""`,r.push({kind:x,path:[],name:R})}else{o=o.slice(0,a);let x=`data-${T}${g}`;o+=`${x}=""`,r.push({kind:"attr",path:[],name:s})}i="in-tag",s=""}else if(i==="attr-quoted"||i==="attr-unquoted"){o=o.slice(0,a);let h=`data-${T}${g}`;o+=`${h}=""`,u={name:s,firstPartIdx:g},r.push({kind:"noop",path:[]}),i="skip-attr"}else i==="skip-attr"&&r.push({kind:"noop",path:[]})}}let d=document.createElement("template");d.innerHTML=o,Xc(d.content,r);let m=Qc(d.content,r);return n={templateEl:d,parts:r,formActions:m},mr.set(t,n),n}function Xc(e,t){let n=e.querySelectorAll("slot");for(let r of n){r.setAttribute(S,"");let o=t.length;r.setAttribute(`data-${T}${o}`,""),t.push({kind:"slot",path:[]})}}function Qc(e,t){let n=[],r=[];function o(i){for(let s=0;s<i.childNodes.length;s++){let a=i.childNodes[s];if(n.push(s),a.nodeType===8){let c=a.data;if(c.startsWith(T)){let l=Number(c.slice(T.length));t[l]&&t[l].kind==="child"&&(t[l].path=n.slice())}}else if(a.nodeType===1){let c=a,l=[],u=[];for(let f of c.attributes)if(f.name.startsWith(`data-${T}`)){let p=Number(f.name.slice(`data-${T}`.length));t[p]&&t[p].kind!=="child"&&(t[p].path=n.slice(),u.push({idx:p,kind:t[p].kind,name:t[p].name||""})),l.push(f.name)}if(c.localName==="form"||c.localName==="button"||c.localName==="input"){let f=Zc(c,u,t);f&&r.push(f)}for(let f of l)c.removeAttribute(f);o(a)}n.pop()}}return o(e),r.length?r:null}function Zc(e,t,n){let r=e.localName==="form",o=r?"action":"formaction",i=r?"method":"formmethod",s=r?"enctype":"formenctype",a=t.filter(y=>y.kind==="attr"&&y.name.toLowerCase()===o);if(!a.length)return null;let c=[],l=[],u=[],f=r?[]:t.filter(y=>y.name.toLowerCase()==="name"&&(y.kind==="attr"||y.kind==="attr-mixed"||y.kind==="bool")).map(y=>({i:y.idx,kind:y.kind})),p=!r&&e.hasAttribute("name"),d=!r&&e.hasAttribute("form"),m=!r&&e.hasAttribute("value"),b=r?[]:t.filter(y=>y.name.toLowerCase()==="value"&&(y.kind==="attr"||y.kind==="attr-mixed"||y.kind==="bool")).map(y=>({i:y.idx,kind:y.kind}));for(let y of t){let g=String(y.name).toLowerCase();if(y.kind==="prop"){r?(g==="method"||g==="enctype"||g==="encoding")&&u.push(y.name):_o(g)&&u.push(y.name);continue}if(g!==i&&g!==s||y.kind!=="attr"&&y.kind!=="attr-mixed"&&y.kind!=="bool")continue;let h=n[y.idx],R={i:y.idx,kind:y.kind};y.kind==="attr-mixed"&&(R.statics=h.statics||[],R.group=h.group||[]),(g===i?c:l).push(R)}return{isForm:r,tag:e.localName,actionIdxs:a.map(y=>y.idx),duplicateAction:a.length>1,staticAction:e.getAttribute(o)!=null,authoredName:p,authoredValue:m,authoredForm:d,propAttrs:u,nameParts:f,valueParts:b,staticMethod:e.getAttribute(i),staticEnctype:e.getAttribute(s),methodParts:c,enctypeParts:l}}_e();var Q=null,Te=!1,ht=0,pt=null,ti=0,js=(e,t)=>Object.is(e,t),gr=()=>{},Ps=()=>!1;function Is(e,t){e.liveConsumers||(e.liveConsumers=new Map);let n=e.liveConsumers.size===0;if(e.liveConsumers.set(t,(e.liveConsumers.get(t)||0)+1),n){if(e.producers&&e.producers.length>0)for(let r of e.producers)Is(r,e);if(e.watched)try{e.watched.call(e.wrapper)}catch(r){console.error(r)}}}function nn(e,t){if(!e.liveConsumers)return;let n=e.liveConsumers.get(t);if(n!==void 0){if(n>1){e.liveConsumers.set(t,n-1);return}if(e.liveConsumers.delete(t),e.liveConsumers.size===0){if(e.producers&&e.producers.length>0)for(let r of e.producers)nn(r,e);if(e.unwatched)try{e.unwatched.call(e.wrapper)}catch(r){console.error(r)}}}}function ai(e){if(Te)throw new Error("Signal read during notification phase");if(Q===null)return;let t=Q,n=t.nextProducerIndex++;n<t.producers.length&&t.producers[n]!==e&&oi(t)&&nn(t.producers[n],t),t.producers[n]!==e&&(t.producers[n]=e,oi(t)&&Is(e,t)),t.producerLastReadVersions[n]=e.version}function oi(e){return e.consumerIsAlwaysLive||e.liveConsumers&&e.liveConsumers.size>0}function Ms(e){if(!e.liveConsumers||e.liveConsumers.size===0)return;let t=Te;Te=!0;try{for(let n of e.liveConsumers.keys())n.dirty||el(n)}finally{Te=t}}function el(e){e.dirty=!0,Ms(e),e.consumerMarkedDirty.call(e.wrapper||e)}function wr(e){if(!(!e.dirty&&e.lastCleanEpoch===ht)){if(!e.producerMustRecompute()&&!tl(e)){e.dirty=!1,e.lastCleanEpoch=ht;return}e.producerRecomputeValue(),e.dirty=!1,e.lastCleanEpoch=ht}}function tl(e){for(let t=0;t<e.producers.length;t++){let n=e.producers[t],r=e.producerLastReadVersions[t];if(r!==n.version||(wr(n),r!==n.version))return!0}return!1}function ii(e){e&&(e.nextProducerIndex=0);let t=Q;return Q=e,t}function si(e,t){if(Q=t,!!e){if(oi(e))for(let n=e.nextProducerIndex;n<e.producers.length;n++)nn(e.producers[n],e);for(;e.producers.length>e.nextProducerIndex;)e.producers.pop(),e.producerLastReadVersions.pop()}}var _r=class{constructor(t,n){this.__value=t,this.version=0,this.lastCleanEpoch=ht,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.liveConsumers=void 0,this.consumerAllowSignalWrites=!0,this.consumerIsAlwaysLive=!1,this.producerMustRecompute=Ps,this.producerRecomputeValue=gr,this.consumerMarkedDirty=gr,this.wrapper=this,this.__isSignal=!0,this.__equal=n?.equals||js,this.watched=n?.[ci],this.unwatched=n?.[li]}get(){return ai(this),this.__value}peek(){return this.__value}set(t){if(Te)throw new Error("Signal write during notification phase");this.__equal.call(this,this.__value,t)||(this.__value=t,this.version++,ht++,pt!==null?Fs(this):Ms(this))}};function Fs(e){let t=Te;Te=!0;try{if(!e.liveConsumers)return;for(let n of e.liveConsumers.keys())n.dirty||(n.dirty=!0,n.__isWatcher?pt.add(n):Fs(n))}finally{Te=t}}var ni=Symbol("unset"),ri=Symbol("computing"),yr=Symbol("errored"),rn=class{constructor(t,n){this.__fn=t,this.__value=ni,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||js,this.watched=n?.[ci],this.unwatched=n?.[li];let r=this;this.producerMustRecompute=function(){return r.__value===ni||r.__value===ri},this.producerRecomputeValue=function(){if(r.__value===ri)throw new Error("Detected cycle in computations.");let o=r.__value;r.__value=ri;let i=ii(r),s,a=!1;try{s=r.__fn.call(r.wrapper)}catch(l){s=yr,r.__error=l,a=!0}finally{si(r,i)}if(!a&&(o!==ni&&o!==yr)&&r.__equal.call(r.wrapper,o,s)){r.__value=o;return}r.__value=s,r.version++},this.consumerMarkedDirty=gr}get(){if(wr(this),ai(this),this.__value===yr)throw this.__error;return this.__value}peek(){if(wr(this),this.__value===yr)throw this.__error;return this.__value}},Sr=class{constructor(t){this.__notify=t,this.version=0,this.lastCleanEpoch=ht,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.nextProducerIndex=0,this.liveConsumers=void 0,this.consumerAllowSignalWrites=!1,this.consumerIsAlwaysLive=!0,this.producerMustRecompute=Ps,this.producerRecomputeValue=gr,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=ii(this);try{for(let r of t)ai(r),r.__isComputed&&wr(r)}finally{si(this,n)}this.dirty=!1}unwatch(...t){for(let n=this.producers.length-1;n>=0;n--)t.includes(this.producers[n])&&(nn(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=ii(this),r;try{r=t()}finally{si(this,n)}return this.dirty=!1,r}dispose(){for(let t of this.producers)nn(t,this);this.producers=[],this.producerLastReadVersions=[],this.__notify=null}},ci=Symbol("watched"),li=Symbol("unwatched");function nl(e){let t=Q;Q=null;try{return e()}finally{Q=t}}function rl(e){return e.producers.slice()}function ol(e){return e.liveConsumers?[...e.liveConsumers.keys()]:[]}function il(e){return!!e.liveConsumers&&e.liveConsumers.size>0}function sl(e){return e.producers.length>0}function al(){return Q&&Q.__isComputed?Q:null}function cl(e){ti++,pt===null&&(pt=new Set);try{e()}finally{if(ti--,ti===0){let t=pt;pt=null;for(let n of t)n.__fire()}}}var on={State:_r,Computed:rn,subtle:{Watcher:Sr,untrack:nl,introspectSources:rl,introspectSinks:ol,hasSinks:il,hasSources:sl,currentComputed:al,watched:ci,unwatched:li}};function ll(e,t){return new _r(e,t)}function ul(e,t){return new rn(e,t)}function fl(e){return!!(e&&typeof e=="object"&&e.__isSignal===!0)}function dl(e){let t=!1,n=!1,r=new rn(e),o=new Sr(()=>{t||n||(t=!0,queueMicrotask(()=>{if(t=!1,!n){try{r.get()}catch(i){console.error(i)}o.watch()}}))});o.watch(r);try{r.get()}catch(i){console.error(i)}return()=>{n||(n=!0,o.dispose())}}Ke();var U=null;function fi(e){U=e}function Ds(e,t){let n=e&&e[_]?e:null;return n?qe(n,t):t()}function vr(e){return e?e.nodeType===11&&e.host?e.host:e:null}function di(e,t){let n=e.__commitOwner,r=U;n&&(U=n);try{t()}finally{U=r}}function an(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(i){o.handler?.(i)}};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 Z(e,t,n,r,o){if(oe(t)){let i=t.value;if(e.kind==="prop"&&e.el[e.name]===i||e.kind==="attr"&&e.el.getAttribute(e.name)===String(i)||e.kind==="bool"&&e.el.hasAttribute(e.name)===!!i)return;t=i}switch(e.kind){case"child":ml(e,t,o);break;case"attr":{t==null||t===!1?e.el.removeAttribute(e.name):Zn(t,e.name,e.el.localName)||(zt(t,e.name,e.el.localName),e.el.setAttribute(e.name,String(t)));break}case"prop":hs(t,e.name,e.el.localName),e.el[e.name]=t;break;case"bool":zt(t,e.name,e.el.localName),t?e.el.setAttribute(e.name,""):e.el.removeAttribute(e.name);break;case"event":e.handler=typeof t=="function"?t:null;break;case"element":hl(e,t);break;case"attr-mixed":{let i=e,s=i.statics[0];for(let a=0;a<i.group.length;a++){let c=r?r[i.group[a]]:t;oe(c)&&(c=c.value),zt(c,e.name,e.el.localName),s+=String(c??""),s+=i.statics[a+1]||""}e.el.setAttribute(e.name,s);break}case"slot":{if(e.applied)break;let i=e.slotEl,s=()=>{let c=mt(i);if(!c){e.applied=!0;return}if(!c.contains(i)){c.isConnected?queueMicrotask(s):e.applied=!0;return}if(e.applied=!0,pl(i))return;let l=document.createDocumentFragment();for(;i.firstChild;)l.appendChild(i.firstChild);i[Se]=l,queueMicrotask(()=>W(c))},a=mt(i);a&&a.contains(i)?s():queueMicrotask(s);break}case"noop":break}}function mt(e){let t=e[De];if(t&&t.isConnected)return t;let n=e.parentElement;for(;n;){if(n[_])return n;n=n.parentElement}return null}function pl(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 hl(e,t){let n=e,r=or(t)?t.target:void 0,o=n.__refTarget,i=r!==o;if(i&&o)if(typeof o=="function")try{o(void 0)}catch{}else typeof o=="object"&&(o.value=void 0);if(i||n.__refElement!==e.el){if(n.__refTarget=r,r)if(typeof r=="function"){if(!i&&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 ml(e,t,n){return xl(e,t),ce(e,t,n)}function ce(e,t,n){return Ds(e.marker&&e.marker.parentNode,()=>$s(e,t,n))}function $s(e,t,n){let r=e.marker;if(oe(t))return $s(e,t.value,n);if(Ao(t)){Ne(e);let i=String(t.value??""),s=document.createElement("template");s.innerHTML=i;let a=[...s.content.childNodes],c=document.createDocumentFragment();for(let l of a)c.appendChild(l);r.parentNode?.insertBefore(c,r),e.child=a;return}if(nr(t)){let i=t,s=e.__keyedKey;s!==void 0&&!Object.is(s,i.key)&&Ne(e),e.__keyedKey=i.key,ce(e,i.value,n);return}if(rr(t)){let i=t,s=e.__guardDeps,a=i.deps;if(s!==void 0&&(Array.isArray(s)&&Array.isArray(a)?vl(s,a):Object.is(s,a)))return;let c=Array.isArray(a)?a.slice():a;ce(e,i.fn(),n),e.__guardDeps=c;return}if(vo(t)){Ne(e);let i=t.template;if(i&&i.content){let s=i.content.cloneNode(!0),a=[...s.childNodes];r.parentNode?.insertBefore(s,r),e.child=a}return}if(or(t))return;if(ir(t))return El(e,t.value,n);if(sr(t))return Tl(e,t.args,n);if(ar(t))return Nl(e,t.signal,n);if(xo(t))return Cl(e,t,n);if(Eo(t))return kl(e,t,n);if(tr(t)){if(e.child&&e.child.kind==="repeat"){gl(e,t,n);return}Ne(e);let i={kind:"repeat",map:new Map};e.child=i,yl(r,i,t,n);return}if(Array.isArray(t)){if(e.child&&e.child.kind==="array"){Sl(e,t,n);return}Ne(e);let i={kind:"array",items:[]};e.child=i,_l(r,i,t,n);return}if(e.child){let i=e.child;if(i.kind==="repeat")Hs(i),e.child=void 0;else if(i.kind==="array")qs(i),e.child=void 0;else if(i.kind==="async-stream")zs(i),e.child=void 0;else if("strings"in e.child){let s=e.child;if(P(t)&&s.strings===t.strings){Ve(s,t.values,n);return}bt(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(P(t)){let i=t,{templateEl:s,parts:a,formActions:c}=dt(i),l=s.content.cloneNode(!0),u=document.createComment(`${T}s`),f=document.createComment(`${T}e`),p=a.map(b=>an(b,l)),d=[];for(let b=0;b<i.values.length;b++)Z(p[b],i.values[b],void 0,i.values,n),d.push(i.values[b]);n&&n(c,p,i.values);let m=[u,...l.childNodes,f];r.parentNode?.insertBefore(bl(m),r);for(let b of p)b.kind==="slot"&&Z(b,void 0,void 0,[],n);e.child={strings:i.strings,bound:p,lastValues:d,startNode:u,endNode:f};return}let o=document.createTextNode(String(t));r.parentNode?.insertBefore(o,r),e.child=[o]}function Ve(e,t,n){for(let r=0;r<t.length;r++){let o=t[r];if(Object.is(o,e.lastValues[r]))continue;let i=e.bound[r],s=i.mixedAnchor;try{i.kind==="noop"&&s!=null?Z(e.bound[s],t[s],e.lastValues[s],t,n):Z(i,o,e.lastValues[r],t,n)}catch(a){throw e.lastValues[r]=Bs,i.kind==="noop"&&s!=null&&(e.lastValues[s]=Bs),a}e.lastValues[r]=o}n&&n(mr.get(e.strings)?.formActions??null,e.bound,t)}var Bs=Symbol("webjs.commitFailed");function bt(e,t){let n=e.parentNode;if(!n)return;let r=e;for(;r&&r!==t;){let o=r.nextSibling;r.parentNode?.removeChild(r),r=o}t.parentNode===n&&n.removeChild(t)}function bl(e){let t=document.createDocumentFragment();for(let n of e)t.appendChild(n);return t}function pi(e,t){let{templateEl:n,parts:r,formActions:o}=dt(e),i=n.content.cloneNode(!0),s=document.createComment(`${T}s`),a=document.createComment(`${T}e`),c=r.map(f=>an(f,i)),l=[];for(let f=0;f<e.values.length;f++)Z(c[f],e.values[f],void 0,e.values,t),l.push(e.values[f]);t&&t(o,c,e.values);for(let f of c)f.kind==="slot"&&Z(f,void 0,void 0,[],t);let u=document.createDocumentFragment();for(u.appendChild(s);i.firstChild;)u.appendChild(i.firstChild);return u.appendChild(a),{inst:{strings:e.strings,bound:c,lastValues:l,startNode:s,endNode:a},frag:u}}function sn(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 if(typeof n=="object")try{n.value=void 0}catch{}t.lastTarget=void 0,t.__lastEl=void 0}}}function yl(e,t,n,r){let{items:o,keyFn:i,templateFn:s}=n,a=e.parentNode;if(!a)return;let c=document.createDocumentFragment();for(let l=0;l<o.length;l++){let u=i(o[l],l),f=s(o[l],l);if(!P(f))continue;let{inst:p,frag:d}=pi(f,r);t.map.set(u,p),c.appendChild(d)}a.insertBefore(c,e)}function gl(e,t,n){let r=e.marker,o=r.parentNode;if(!o)return;let i=e.child,{items:s,keyFn:a,templateFn:c}=t,l=new Map;try{for(let u=0;u<s.length;u++){let f=a(s[u],u),p=c(s[u],u);if(!P(p))continue;let d=i.map.get(f);if(d&&d.strings===p.strings)Ve(d,p.values,n),ui(d.startNode,d.endNode,o,r),l.set(f,d),i.map.delete(f);else{d&&(i.map.delete(f),sn(d),bt(d.startNode,d.endNode));let{inst:m,frag:b}=pi(p,n);o.insertBefore(b,r),l.set(f,m)}}for(let[u,f]of[...i.map]){i.map.delete(u);try{sn(f)}finally{bt(f.startNode,f.endNode)}}i.map=l}catch(u){for(let[f,p]of l)i.map.set(f,p);throw u}}function Hs(e){for(let[t,n]of[...e.map]){e.map.delete(t);try{sn(n)}finally{bt(n.startNode,n.endNode)}}e.map.clear()}function wl(e){return e.type==="tpl"?e.inst.startNode:e.type==="text"?e.node:null}function Ar(e){e.type==="tpl"?(sn(e.inst),bt(e.inst.startNode,e.inst.endNode)):e.type==="text"&&e.node.parentNode?.removeChild(e.node)}function Us(e,t){if(oe(e)&&(e=e.value),P(e)){let{inst:n,frag:r}=pi(e,t);return{item:{type:"tpl",inst:n},frag:r}}if(e!=null&&e!==!1&&e!==!0){let n=document.createTextNode(String(e));return{item:{type:"text",node:n},frag:n}}return{item:{type:"empty"},frag:null}}function _l(e,t,n,r){let o=e.parentNode;if(!o)return;let i=document.createDocumentFragment(),s=[];for(let a of n){let{item:c,frag:l}=Us(a,r);l&&i.appendChild(l),s.push(c)}o.insertBefore(i,e),t.items=s}function Sl(e,t,n){let r=e.marker,o=r.parentNode;if(!o)return;let i=e.child,s=i.items,a=[],c=0;try{for(let l=0;l<t.length;l++){let u=t[l],f=oe(u)?u.value:u,p=s[l];if(P(f)){let b=f;if(p&&p.type==="tpl"&&p.inst.strings===b.strings){Ve(p.inst,b.values,n),a.push(p),c=l+1;continue}}else if(f!=null&&f!==!1&&f!==!0){if(p&&p.type==="text"){let b=String(f);p.node.data!==b&&(p.node.data=b),a.push(p),c=l+1;continue}}else{p&&Ar(p),a.push({type:"empty"}),c=l+1;continue}let{item:d,frag:m}=Us(f,n);m&&o.insertBefore(m,Al(s,l,r)),a.push(d),p&&Ar(p),c=l+1}for(let l=t.length;l<s.length;l++)Ar(s[l]),c=l+1;i.items=a}catch(l){throw i.items=a.concat(s.slice(c)),l}}function Al(e,t,n){for(let r=t;r<e.length;r++){let o=wl(e[r]);if(o&&o.parentNode)return o}return n}function qs(e){for(let t of e.items)Ar(t);e.items=[]}function ui(e,t,n,r){if(t.nextSibling===r&&e.parentNode===n)return;let o=document.createDocumentFragment(),i=e;for(;i;){let s=i.nextSibling;if(o.appendChild(i),i===t)break;i=s}n.insertBefore(o,r)}function vl(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 Ne(e){let t=e;if(t.__untilState&&(t.__untilState.aborted=!0,t.__untilState=void 0),t.__watchSub&&Ws(t),!e.child)return;let n=e.child;if(n.kind==="repeat")Hs(n);else if(n.kind==="array")qs(n);else if(n.kind==="async-stream")zs(n);else if("strings"in n){let r=e.child;sn(r),bt(r.startNode,r.endNode)}else for(let r of e.child)r.parentNode&&r.parentNode.removeChild(r);e.child=void 0}function xl(e,t){let n=e;n.__untilState&&!sr(t)&&(n.__untilState.aborted=!0,n.__untilState=void 0),n.__guardDeps!==void 0&&!rr(t)&&(n.__guardDeps=void 0),n.__cacheMap&&!ir(t)&&(n.__cacheMap=void 0),n.__keyedKey!==void 0&&!nr(t)&&(n.__keyedKey=void 0),n.__watchSub&&!ar(t)&&Ws(n)}function El(e,t,n){let r=e.marker,o=e,i=o.__cacheMap;i||(i=new Map,o.__cacheMap=i);let s=e.child;if(s&&"strings"in s){let c=s;if(P(t)&&c.strings===t.strings){Ve(c,t.values,n);return}let l=document.createDocumentFragment();ui(c.startNode,c.endNode,l,null),i.set(c.strings,{inst:c,holder:l}),e.child=void 0}if(P(t)){let c=t,l=i.get(c.strings);if(l){i.delete(c.strings),e.child&&Ne(e),ui(l.inst.startNode,l.inst.endNode,r.parentNode,r),Ve(l.inst,c.values,n),e.child=l.inst;let u=new Set;for(let f=l.inst.startNode.nextSibling;f&&f!==l.inst.endNode;f=f.nextSibling){if(f.nodeType!==1)continue;let p=f;if(p.matches("slot[data-webjs-light]")){let d=mt(p);d&&u.add(d)}for(let d of p.querySelectorAll("slot[data-webjs-light]")){let m=mt(d);m&&u.add(m)}}for(let f of u)W(f);return}}ce(e,t,n)}function Tl(e,t,n){let r=e;U&&(r.__commitOwner=vr(U));let o=r.__untilState,i=r.__untilArgs,s=(d,m)=>!!(Object.is(d,m)||P(d)&&P(m)&&d.strings===m.strings),c=i&&i.length===t.length&&i.every((d,m)=>s(d,t[m]))&&o?o.highestResolved:1/0;o&&(o.aborted=!0),r.__untilArgs=t.slice();let l={aborted:!1,highestResolved:c};r.__untilState=l;let u=-1,f;for(let d=0;d<t.length;d++){let m=t[d];if(!m||typeof m.then!="function"){u=d,f=m;break}}u!==-1&&u<=l.highestResolved?(ce(e,f,n),l.highestResolved=u):u===-1&&!r.__untilEverRendered&&ce(e,"",n),r.__untilEverRendered=!0;let p=Math.min(u===-1?t.length:u,l.highestResolved);for(let d=0;d<p;d++){let m=t[d];!m||typeof m.then!="function"||Promise.resolve(m).then(b=>{if(!l.aborted&&!(d>=l.highestResolved)){try{di(e,()=>ce(e,b,n))}catch(y){hi(e,y);return}l.highestResolved=d}},()=>{})}}function hi(e,t){let n;try{n=t instanceof Error?t:new Error(String(t))}catch{n=new Error("render error (unstringifiable thrown value)")}let r=e.__commitOwner;if(r&&typeof r._handleRenderError=="function"){r._handleRenderError(n);return}throw n}function Nl(e,t,n){let r=e;if(U&&(r.__commitOwner=vr(U)),r.__watchSig===t&&r.__watchSub){let s;r.__watchSub.observe(()=>{s=t.get()}),ce(e,s,n);return}r.__watchSub&&(r.__watchSub.dispose(),r.__watchSub=void 0),r.__watchSig=t;let o=new on.subtle.Watcher(()=>{queueMicrotask(()=>{if(r.__watchSub!==o)return;let s;try{o.observe(()=>{s=t.get()}),di(e,()=>ce(e,s,n))}catch(a){hi(e,a)}})});r.__watchSub=o;let i;o.observe(()=>{i=t.get()}),ce(e,i,n)}function Ws(e){e.__watchSub&&(e.__watchSub.dispose(),e.__watchSub=void 0,e.__watchSig=void 0)}function Cl(e,t,n){let r=e;U&&(r.__commitOwner=vr(U));let o=e.child;if(o&&o.kind==="async-stream"&&o.mode==="append"&&o.iterable===t.iterable)return;Ne(e);let i=t.iterable[Symbol.asyncIterator](),s={kind:"async-stream",mode:"append",aborted:!1,iterable:t.iterable,iterator:i,nodes:[]};e.child=s,Ks(s,e,t,n)}function kl(e,t,n){let r=e;U&&(r.__commitOwner=vr(U));let o=e.child;if(o&&o.kind==="async-stream"&&o.mode==="replace"&&o.iterable===t.iterable)return;Ne(e);let i=t.iterable[Symbol.asyncIterator](),s={kind:"async-stream",mode:"replace",aborted:!1,iterable:t.iterable,iterator:i,nodes:[]};e.child=s,Ks(s,e,t,n)}async function Ks(e,t,n,r){let o=t.marker,i=0;for(;!e.aborted;){let s,a;try{if(s=await e.iterator.next(),e.aborted||s.done)break;a=n.mapper?n.mapper(s.value,i):s.value}catch(c){typeof console<"u"&&console.error("[webjs] asyncStream error:",c);return}try{di(t,()=>{let c=Vs(a,r);Ds(o.parentNode,()=>{if(e.mode==="replace"){for(let u of e.nodes)u.parentNode&&u.parentNode.removeChild(u);e.nodes=[]}let l=document.createDocumentFragment();for(let u of c)l.appendChild(u);o.parentNode?.insertBefore(l,o),e.nodes.push(...c)})})}catch(c){e.aborted=!0;try{e.iterator.return?.()?.catch?.(()=>{})}catch{}hi(t,c);return}i++}}function Vs(e,t){if(oe(e)&&(e=e.value),e==null||e===!1||e===!0)return[];if(P(e)){let n=e,{templateEl:r,parts:o,formActions:i}=dt(n),s=r.content.cloneNode(!0),a=o.map(c=>an(c,s));for(let c=0;c<n.values.length;c++)Z(a[c],n.values[c],void 0,n.values,t);t&&t(i,a,n.values);for(let c of a)c.kind==="slot"&&Z(c,void 0,void 0,[],t);return[...s.childNodes]}if(Array.isArray(e)){let n=[];for(let r of e)n.push(...Vs(r,t));return n}return[document.createTextNode(String(e))]}function zs(e){e.aborted=!0;for(let t of e.nodes)t.parentNode&&t.parentNode.removeChild(t);e.nodes=[];try{e.iterator.return?.()?.catch?.(()=>{})}catch{}}function ze(e,t){let n=t,r=n[C];n[C]=!0;let o=U;fi(t);try{let i=n[tn];if(P(e)){let s=e;if(i&&i.strings===s.strings){Ve(i,s.values,Er);return}i&&Gs(i,t);let a=t.firstChild;a&&a.nodeType===8&&a.data==="webjs-hydrate"&&a.remove(),n[tn]=null;let c=Ll(s,t);n[tn]=c;return}if(i&&Gs(i,t),n[tn]=null,t.replaceChildren(),e==null||e===!1||e===!0)return;if(Array.isArray(e)){for(let s of e){let a=document.createTextNode(String(s??""));t.appendChild(a)}return}t.appendChild(document.createTextNode(String(e)))}finally{fi(o),n[C]=r,r||ur(n)}}function Er(e,t,n){if(e)for(let r of[!0,!1])for(let o of e){if(o.isForm!==r)continue;let i=o.actionIdxs[0],s=o.isForm?"action":"formaction";for(let l of o.actionIdxs)if(Zn(yt(n[l]),s,o.tag)){i=l;break}let a=t[i];if(!a||!a.el)continue;let c=yt(n[i]);if(o.isForm)ys(a.el,c,xr(o.methodParts,o.staticMethod,n),xr(o.enctypeParts,o.staticEnctype,n),o);else{let l=u=>u.some(f=>f.kind==="bool"?!!yt(n[f.i]):!0);Ol(a.el,c,o,l(o.nameParts),l(o.valueParts),xr(o.methodParts,o.staticMethod,n),xr(o.enctypeParts,o.staticEnctype,n))}}}function Rl(e){(br.has(e)||e.getAttribute("name")===I)&&(e.getAttribute("name")===I&&e.removeAttribute("name"),e.removeAttribute("value"),br.delete(e))}function Ol(e,t,n,r,o,i,s){let a=typeof t=="function"?wo(t):null;if(!a){typeof t=="function"&&So(null,e.localName),Rl(e),gs(e,i,s,n.propAttrs);return}ds(n.duplicateAction,e.localName),ps(n.propAttrs,e.localName),n.staticAction&&us(e.localName),(n.authoredValue||o)&&ls(e.localName),(n.authoredName||r)&&as(e.getAttribute("name")||I,e.localName,!1),(n.authoredForm||e.hasAttribute("form"))&&fs(e.localName),cs(e.localName,e.getAttribute("type"));let c=bs(e.localName,i,s);e.removeAttribute("formaction"),e.setAttribute("name",I),e.setAttribute("value",a),Vt(e,"formmethod",i,c.formMethod),Vt(e,"formenctype",s,c.formEnctype),br.set(e,a)}function xr(e,t,n){for(let r of e){if(r.kind==="bool")return yt(n[r.i])?"":z;if(r.kind==="attr"){let a=yt(n[r.i]);return a==null?"":String(a)}let o=r.statics||[],i=r.group||[],s=o[0]||"";for(let a=0;a<i.length;a++)s+=String(yt(n[i[a]])??""),s+=o[a+1]||"";return s}return t??z}function yt(e){return oe(e)?e.value:e}function Ll(e,t){let{templateEl:n,parts:r,formActions:o}=dt(e),i=n.content.cloneNode(!0),s=document.createComment(`${T}s`),a=document.createComment(`${T}e`),c=r.map(f=>an(f,i)),l=[];for(let f=0;f<e.values.length;f++)Z(c[f],e.values[f],void 0,e.values,Er),l.push(e.values[f]);Er(o,c,e.values),t.replaceChildren(s,...i.childNodes,a);let u=t.nodeType===1&&t[_]?t:null;for(let f of c)f.kind==="slot"&&(u&&f.slotEl&&(f.slotEl[De]=u),Z(f,void 0,void 0,[],Er));return{strings:e.strings,bound:c,lastValues:l,startNode:s,endNode:a}}function Gs(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 if(typeof r=="object")try{r.value=void 0}catch{}n.lastTarget=void 0,n.__lastEl=void 0}}if(n.kind==="slot"){let r=mt(n.slotEl);r&&ei(r,n.slotEl)}}t.replaceChildren()}function Ys(e,t){if(e.converter&&e.converter.fromAttribute)return e.converter.fromAttribute(t,e.type);if(e.type===Number)return t==null?null:Number(t);if(e.type===Boolean)return t!=null&&t!=="false";if(e.type===Object||e.type===Array){if(t==null)return null;try{return JSON.parse(t)}catch{return null}}return t}function jl(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function Js(e,t){let n;for(let{propName:r,def:o,primary:i,alias:s}of Qs(e)){if(i===t)return{propName:r,def:o};n===void 0&&s===t&&(n={propName:r,def:o})}return n}function Xs(e){let t=new Set,n=Qs(e);for(let{primary:r}of n)t.add(r);for(let{alias:r}of n)r&&t.add(r);return[...t]}function Qs(e){let t=e&&e.properties||{},n=[];for(let[r,o]of Object.entries(t)){let i=typeof o=="object"&&o!==null?o:{type:o};if(i.state)continue;let s=i.attribute||jl(r),a=r.toLowerCase(),c=!i.attribute&&a!==s?a:void 0;n.push({propName:r,def:i,primary:s,alias:c})}return n}var Zs=null;function Tr(e){Zs=e||null}function mi(){return Zs||void 0}_e();var ea=Symbol.for("webjs:registry"),ta=Symbol.for("webjs:classToTag"),Nr=globalThis,le=Nr[ea]||(Nr[ea]=new Map),na=Nr[ta]||(Nr[ta]=new WeakMap),Cr=typeof window<"u"&&typeof customElements<"u";function bi(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=le.get(e);r?(r.cls=t,r.lazy=n):le.set(e,{cls:t,moduleUrl:null,lazy:n,tag:e}),na.set(t,e)}if(Cr){let e=customElements.define.bind(customElements);customElements.define=function(t,n,r){customElements.get(t)||e(t,n,r),bi(t,n)}}if(!Cr){let e=globalThis;e.customElements||(e.customElements={define(t,n){bi(t,n)},get(t){return le.get(t)?.cls},upgrade(){},whenDefined(t){let n=le.get(t);return Promise.resolve(n?.cls)}})}function yi(e,t){Cr?customElements.define(e,t):bi(e,t)}function Pl(e,t){if(Cr)return;let n=le.get(e);if(n){n.moduleUrl=t;return}le.set(e,{cls:null,moduleUrl:t,lazy:!1,tag:e})}function Il(e){return le.get(e)?.cls}function Ml(e){return le.get(e)?.moduleUrl||null}function Fl(e){return le.get(e)?.lazy===!0}function Ge(e){return na.get(e)}function Bl(){return[...le.keys()]}un();Ke();function Xl(){return{states:new Set,shadowRoot:null,form:null,labels:[],role:"",willValidate:!0,validity:{},validationMessage:"",setFormValue(){},setValidity(){},checkValidity(){return!0},reportValidity(){return!0}}}var fn=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 i=t.getAttribute(n(o));return i===null?void 0:i},set(r,o,i){return typeof o=="string"&&t.setAttribute(n(o),i),!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,i)=>i.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=Xl(),this.__internals}},Ql=["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 Ql){let t="aria-"+e.slice(4).toLowerCase();Object.defineProperty(fn.prototype,e,{configurable:!0,get(){return this.getAttribute(t)},set(n){n==null?this.removeAttribute(t):this.setAttribute(t,String(n))}})}function aa(e,t){return e!==t}function ca(e){try{return String(e)}catch{return Object.prototype.toString.call(e)}}function wi(e,t,n){if(typeof console>"u"||!console.warn)return;let r=Ge(e.constructor)||e.tagName?.toLowerCase()||"unknown";console.warn(`[webjs] reflect:true property "${t}" on <${r}> holds a function (or an array carrying one), which has no HTML attribute representation. Removing "${n}" instead of stringifying it (a stringified function writes its source into the page, so a server action's body would ship to the browser). Pass a string, or drop reflect on this property.`)}function la(e,t,n,r){if(typeof console>"u"||!console.warn)return;let o=Ge(e.constructor)||e.tagName?.toLowerCase()||"unknown";console.warn(`[webjs] reflect:true property "${t}" on <${o}> holds a value JSON.stringify cannot serialize (a cycle, a BigInt, or a throwing toJSON), so it has no HTML attribute representation. Removing "${n}" instead. Detail: ${r}`)}function ua(e,t={}){return e&&typeof e=="object"&&!("call"in e)&&(t=e,e=void 0),{...e?{type:e}:{},...t}}var da=typeof window<"u"&&typeof HTMLElement<"u",Zl=da?HTMLElement:fn,pa=Symbol("webjs.factoryProps"),fa=new WeakSet,gt=class e extends Zl{static shadow=!1;static hydrate=void 0;static properties={};static styles=null;static register(t){yi(t,this)}static get observedAttributes(){return Xs(this)}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(fa.has(t))return;let n=t;for(;n&&n!==e;){if(Object.hasOwn(n,"properties")&&!Object.hasOwn(n,pa)){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://webjs.dev/docs/components.`)}n=Object.getPrototypeOf(n)}fa.add(t)}_initializeProperties(){let n=this.constructor.properties;if(!(!n||typeof n!="object")){this.__propValues={};for(let[r,o]of Object.entries(n)){let i=typeof o=="object"?o:{type:o},s=this[r];Object.defineProperty(this,r,{configurable:!0,enumerable:!0,get:()=>this.__propValues[r],set:a=>{let c=this.__propValues[r];(i.hasChanged||aa)(a,c)&&(this.__propValues[r]=a,i.reflect&&!i.state&&this._connected&&this._reflectAttribute(r,a,i),this.requestUpdate(r,c))}}),s!==void 0?this.__propValues[r]=s:i.default!==void 0&&(this.__propValues[r]=typeof i.default=="function"?i.default():i.default)}}}_reflectAttribute(t,n,r){let o=r.attribute||eu(t);if(!this.__reflectingAttribute){this.__reflectingAttribute=!0;try{if(r.converter&&r.converter.toAttribute){let i=r.converter.toAttribute(n,r.type);i==null?this.removeAttribute(o):this.setAttribute(o,i)}else if(typeof n=="function")this.removeAttribute(o),wi(this,t,o);else if(r.type===Boolean)n?this.setAttribute(o,""):this.removeAttribute(o);else if(n==null)this.removeAttribute(o);else if(r.type===Object||r.type===Array){let i,s=!0;try{i=JSON.stringify(n)}catch(a){s=!1,this.removeAttribute(o),la(this,t,o,a&&a.message)}s&&this.setAttribute(o,i)}else er(n)?(this.removeAttribute(o),wi(this,t,o)):this.setAttribute(o,String(n))}finally{this.__reflectingAttribute=!1}}}connectedCallback(){if(!da)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 i=tu(r.slice(16));try{this[i]=Je(o)}catch(s){console.warn(`[webjs] failed to decode ${r} on <${this.tagName.toLowerCase()}>: ${s&&s.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:ho(r)?[r]:[];if(o.length){if(n){let i=this.shadowRoot.querySelector("style");i&&i.remove()}mo(this._renderRoot,o)}}else this._renderRoot=this,t.styles&&console.warn(`[webjs] <${Ge(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)?Fo(this):this.__isHydrating()||this.hasAttribute("data-wj-serialized")||Zo(this)?(this.removeAttribute("data-wj-serialized"),F(this),Ro(this)):ko(this),Wo(this),Io(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),Mo(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 o=Js(this.constructor,t);if(o===void 0)return;let{propName:i,def:s}=o,a=Ys(s,r);this[i]!==a&&(this[i]=a,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;try{let o=this.update(t);o&&typeof o.then=="function"&&(r=o)}catch(o){this._handleRenderError(o)}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;let i=()=>{if(this.__pendingAsyncCommits--,o===this.__renderToken){for(let s of this.__controllers)s.hostUpdated&&s.hostUpdated();this._postCommit(t)}};r.then(i,s=>{try{o===this.__renderToken&&this._handleRenderError(s instanceof Error?s:new Error(ca(s)))}finally{i()}});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 on.subtle.Watcher(()=>{this._connected&&this.requestUpdate()}));let n,r=mi();Tr(this.__renderAbort?this.__renderAbort.signal:null);try{this.__signalWatcher.observe(()=>{n=this.render()})}finally{Tr(r||null)}if(n&&typeof n.then=="function")return this._commitAsync(n);ze(n,this._renderRoot)}_commitAsync(t){let n=this.__renderToken;if(this.__firstRendered&&this._overridesRenderFallback())try{let r=this.renderFallback();r!==void 0&&ze(r,this._renderRoot)}catch(r){console.error("[webjs] renderFallback() threw:",r)}return Promise.resolve(t).then(r=>{if(n===this.__renderToken)try{ze(r,this._renderRoot)}catch(o){this._handleRenderError(o instanceof Error?o:new Error(String(o)))}},r=>{n===this.__renderToken&&this._handleRenderError(r instanceof Error?r:new Error(String(r)))})}_overridesRenderFallback(){return this.renderFallback!==dn.prototype.renderFallback}_handleRenderError(t){console.error(`[webjs] render error in <${Ge(this.constructor)||this.tagName?.toLowerCase()}>:`,t);try{let n=this.renderError(t);n!==void 0&&ze(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 eu(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function tu(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function dn(e){return new.target?Reflect.construct(gt,arguments,new.target):class extends gt{static properties=e;static[pa]=!0}}Object.setPrototypeOf(dn,gt);dn.prototype=gt.prototype;go();var ha=Symbol.for("webjs.notFound"),ma=Symbol.for("webjs.redirect"),ba=Symbol.for("webjs.forbidden"),ya=Symbol.for("webjs.unauthorized");function nu(){let e=new Error("webjs: notFound()");throw e.__webjs=ha,e}function ru(){let e=new Error("webjs: forbidden()");throw e.__webjs=ba,e}function ou(){let e=new Error("webjs: unauthorized()");throw e.__webjs=ya,e}function iu(e,t){let n=typeof t=="object"&&t!==null?t.status:t,r=new Error(`webjs: redirect(${e})`);throw r.__webjs=ma,r.url=e,r.status=typeof n=="number"?n:void 0,r}function su(e){return!!e&&e.__webjs===ha}function au(e){return!!e&&e.__webjs===ma}function cu(e){return!!e&&e.__webjs===ba}function lu(e){return!!e&&e.__webjs===ya}var ga=null;function uu(){if(!ga)return"";try{return ga()||""}catch{return""}}var wa=null;function fu(e){if(typeof e!="string"||!e||!wa)return e;try{return wa(e)||e}catch{return e}}_e();var dp=Symbol.for("webjs.suspense");function du(e){return{_$webjsSuspense:!0,fallback:e.fallback,children:e.children}}function pu(e){return!!e&&typeof e=="object"&&e._$webjsSuspense===!0}function hu(e,t={}){let n=t.reconnect!==!1,r=0,o=!1,i=null,s=[];function a(){o||(i=new WebSocket(mu(e),t.protocols),i.onopen=c=>{for(r=0;s.length&&i&&i.readyState===WebSocket.OPEN;)i.send(s.shift());t.onOpen?.(c)},i.onmessage=c=>{let l=c.data;if(typeof l=="string")try{l=JSON.parse(l)}catch{}t.onMessage?.(l,c)},i.onerror=c=>{t.onError?.(c)},i.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);i&&i.readyState===WebSocket.OPEN?i.send(l):s.push(l)},close(c,l){o=!0;try{i?.close(c,l)}catch{}},get socket(){return i},get readyState(){return i?.readyState??3}}}function mu(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}`}un();var _i="application/vnd.webjs+json";async function bu(e,t={}){let n=new Headers(t.headers||{});n.has("accept")||n.set("accept",_i);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 gi(r),n.has("content-type")||n.set("content-type",_i));let o=await fetch(e,{...t,headers:n,body:r}),i=o.headers.get("content-type")||"",s=await o.text(),a=i.includes(_i)?s?Je(s):null:i.includes("application/json")?s?JSON.parse(s):null:s;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}un();Rr();Rr();vi();mn();var Xi=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 i=this.updates.findIndex(s=>s.id===r);i!==-1&&(this.updates.splice(i,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 nf(e,t,n){let r=e.get();e.set(t);let o;try{o=await n()}catch(i){throw e.set(r),i}return o&&o.success===!1&&e.set(r),o}function rf(e,t,n){return e&&typeof e.get=="function"&&typeof e.set=="function"?nf(e,t,n):new Xi(e,t)}Lr();Pr();var of="application/vnd.webjs+stream",sf=1,af=2,cf=3,bc=new Uint8Array(0);function lf(e,t){let n=t||bc,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 uf(){let e=bc;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 i=e.slice(5,5+o);n.push({type:r,payload:i}),e=e.slice(5+o)}return n}}}var ff=Symbol.for("webjs.context");function df(e){return{__context__:ff,name:e}}var uo=class extends Event{constructor(t,n,r=!1){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.callback=n,this.subscribe=r}},Qi=class{constructor(t,{context:n,initialValue:r}){this._host=t,this._context=n,this._value=r,this._subscriptions=new Set,this._onRequest=o=>{let i=o;if(i.context===this._context)if(o.stopPropagation(),i.subscribe){let s={callback:i.callback},a=()=>{this._subscriptions.delete(s)};this._subscriptions.add(s),i.callback(this._value,a)}else i.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()}},Zi=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 uo(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 pf(){return typeof window<"u"}var we={INITIAL:0,PENDING:1,COMPLETE:2,ERROR:3},es=class{constructor(t,{task:n,args:r,autoRun:o=!0}){this._host=t,this._taskFn=n,this._argsFn=r||(()=>[]),this._autoRun=o,this._status=we.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=we.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=we.COMPLETE,this._error=void 0}catch(r){if(t.signal.aborted)return;this._error=r,this._status=we.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 we.INITIAL:return t.initial?.();case we.PENDING:return t.pending?.();case we.COMPLETE:return t.complete?.(this._value);case we.ERROR:return t.error?.(this._error);default:return}}hostUpdate(){if(!this._autoRun||!pf())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{Zi as ContextConsumer,Qi as ContextProvider,uo as ContextRequestEvent,I as FORM_ACTION_FIELD,ss as FORM_ACTION_ID_KEY,sf as FRAME_CHUNK,af as FRAME_END,cf as FRAME_ERROR,T as MARKER,Ca as SEED_MISS,of as STREAM_CONTENT_TYPE,on as Signal,du as Suspense,es as Task,we as TaskStatus,dn as WebComponent,Ai as WebjsFrame,xi as WebjsStream,mi as activeActionSignal,mo as adoptStyles,Bl as allTags,fu as asset,qc as asyncAppend,Wc as asyncReplace,cl as batch,Hc as cache,ul as computed,hu as connectWS,Lu as consumeStale,df as createContext,uf as createFrameDecoder,$c as createRef,uu as cspNonce,Sc as css,ia as deserialize,Gi as disableClientRouter,dl as effect,Xn as enableClientRouter,lf as encodeFrame,is as escapeAttr,vc as escapeText,Ru as fetchMark,ru as forbidden,Fc as guard,_c as html,xo as isAsyncAppend,Eo as isAsyncReplace,ho as isCSS,ir as isCache,cu as isForbidden,rr as isGuard,nr as isKeyed,Fl as isLazy,oe as isLive,su as isNotFound,au as isRedirect,or as isRef,tr as isRepeat,fl as isSignal,pu as isSuspense,P as isTemplate,vo as isTemplateContent,lu as isUnauthorized,Ao as isUnsafeHTML,sr as isUntil,ar as isWatch,Mc as keyed,Ic as live,Ji as loadFrame,Il as lookup,Ml as lookupModuleUrl,ki as markStale,Yi as navigate,nu as notFound,rf as optimistic,Je as parse,Ri as parseTagHeader,Pl as primeModuleUrl,ua as prop,iu as redirect,Dc as ref,lo as refreshPage,yi as register,Ou as registerKeyTags,ze as render,Ei as renderStream,_s as repeat,co as revalidate,bu as richFetch,Or as scanSeeds,Cu as seedStats,oa as serialize,Tr as setActiveActionSignal,ll as signal,gi as stringify,Ac as stylesToString,Ge as tagOf,Nu as takeSeed,Bc as templateContent,ou as unauthorized,Pc as unsafeHTML,Uc as until,Kc as watch};
|
|
6
6
|
//# sourceMappingURL=webjs-core-browser.js.map
|