@webjsdev/core 0.7.50 → 0.7.51

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.
Files changed (57) hide show
  1. package/dist/webjs-core-browser.js +5 -5
  2. package/dist/webjs-core-browser.js.map +3 -3
  3. package/dist/webjs-core-testing.js +20 -20
  4. package/dist/webjs-core-testing.js.map +3 -3
  5. package/dist/webjs-core.js +7 -7
  6. package/dist/webjs-core.js.map +3 -3
  7. package/index-browser.js +1 -1
  8. package/index.d.ts +1 -1
  9. package/index.js +1 -1
  10. package/package.json +1 -1
  11. package/src/component/lifecycle.js +1481 -0
  12. package/src/component/reactive.js +171 -0
  13. package/src/component/server-element.js +248 -0
  14. package/src/component.js +2 -1896
  15. package/src/render-client/parts.js +2007 -0
  16. package/src/render-client/reconciler.js +388 -0
  17. package/src/render-client/template-compiler.js +525 -0
  18. package/src/render-client.js +1 -2938
  19. package/src/render-server/attrs.js +160 -0
  20. package/src/render-server/dsd.js +445 -0
  21. package/src/render-server/html-scan.js +402 -0
  22. package/src/render-server/slots.js +213 -0
  23. package/src/render-server/stream.js +163 -0
  24. package/src/render-server/template-renderer.js +923 -0
  25. package/src/render-server/text.js +163 -0
  26. package/src/render-server.js +6 -2405
  27. package/src/router-client/anchors.js +44 -0
  28. package/src/router-client/boundaries.js +221 -0
  29. package/src/router-client/constants.js +187 -0
  30. package/src/router-client/diagnostics.js +377 -0
  31. package/src/router-client/dom-differ.js +709 -0
  32. package/src/router-client/dom-parse.js +150 -0
  33. package/src/router-client/events.js +139 -0
  34. package/src/router-client/fetch-apply.js +387 -0
  35. package/src/router-client/form-encoder.js +135 -0
  36. package/src/router-client/frames.js +329 -0
  37. package/src/router-client/head-merge.js +344 -0
  38. package/src/router-client/nav-error.js +105 -0
  39. package/src/router-client/navigator.js +781 -0
  40. package/src/router-client/prefetch.js +824 -0
  41. package/src/router-client/scroll.js +259 -0
  42. package/src/router-client/snapshot-cache.js +97 -0
  43. package/src/router-client/state.js +92 -0
  44. package/src/router-client/stream.js +206 -0
  45. package/src/router-client/swap.js +451 -0
  46. package/src/router-client/upgrade.js +261 -0
  47. package/src/router-client/view-transition.js +223 -0
  48. package/src/router-client.d.ts +10 -1
  49. package/src/router-client.js +75 -5345
  50. package/src/slot/assignment.js +304 -0
  51. package/src/slot/interception.js +558 -0
  52. package/src/slot/polyfills.js +365 -0
  53. package/src/slot/project.js +432 -0
  54. package/src/slot/sensors.js +303 -0
  55. package/src/slot/state.js +245 -0
  56. package/src/slot/symbols.js +85 -0
  57. package/src/slot.js +7 -2199
@@ -1,6 +1,6 @@
1
- var ks=Object.defineProperty;var F=(e,t)=>()=>(e&&(t=e(e=0)),t);var ro=(e,t)=>{for(var n in t)ks(e,n,{get:t[n],enumerable:!0})};function Ke(e){return Object.prototype.hasOwnProperty.call(xn,e)}var xn,Tn=F(()=>{xn=Object.freeze({"@":"event",".":"prop","?":"bool"})});function Rs(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function oo(e){return String(e).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}var gt=F(()=>{});function jn(e){if(typeof e!="function")return null;let t=e[io];return typeof t=="string"&&t?t:null}function Rn(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 so(e,t,n=!0){if(!e||e===O&&n)return;let r=e===O?'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 ao(e,t){let n=String(e||"").toLowerCase(),r=t==null?null:String(t).toLowerCase();if(Os(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 Os(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 co(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 lo(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 uo(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 fo(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 po(e,t){let r=(e||[]).filter(o=>On(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 On(e){let t=String(e).toLowerCase();return t==="name"||t==="value"||t==="formaction"||t==="formmethod"||t==="formenctype"}function Ls(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&&!mo.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 Ge(e,t,n){if(wt(e)&&Bs(t))throw new Error(Us(t,n))}function ho(e,t,n){Ds(t,n)&&Ge(e,t,n)}function Ln(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 Ps(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&&!mo.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 Ms(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 Is(e,t){let n=e!==$&&e!=null,r=t!==$&&t!=null;return Ps(n?e:null,r?t:null),{method:n?null:"post",enctype:r?null:"multipart/form-data"}}function bo(e,t,n){let r=t!==$&&t!=null,o=n!==$&&n!=null;return Ls(e,r?t:null,o?n:null),{formMethod:r?null:"post",formEnctype:o?null:"multipart/form-data"}}function yo(e,t,n,r,o){let i=typeof t=="function"?jn(t):null;if(!i){typeof t=="function"&&Ln(null,e.localName),$s(e,n,r,o.propAttrs);return}Ms(o);let s=Is(n,r);e.removeAttribute("action"),Ye(e,"method",n,s.method),Ye(e,"enctype",r,s.enctype),Fs(e,i)}function Ye(e,t,n,r){if(r!==null){e.setAttribute(t,r);return}n!==$&&e.getAttribute(t)!==n&&e.setAttribute(t,n)}function Fs(e,t){let n=e.firstElementChild,r=n&&n.localName==="input"&&n.getAttribute("name")===O?n:null;if(!r){for(let o of e.children)if(o.localName==="input"&&o.getAttribute("name")===O){r=o;break}}r||(r=e.ownerDocument.createElement("input"),r.setAttribute("type","hidden"),r.setAttribute("name",O),e.insertBefore(r,e.firstChild)),r.getAttribute("value")!==t&&r.setAttribute("value",t)}function $s(e,t,n,r){let o=e.firstElementChild;if(o&&o.localName==="input"&&o.getAttribute("name")===O)o.remove();else for(let s of e.children)if(s.localName==="input"&&s.getAttribute("name")===O){s.remove();break}let i=s=>(r||[]).some(a=>{let c=String(a).toLowerCase();return c===s||s==="enctype"&&c==="encoding"});t===$&&!i("method")&&e.removeAttribute("method"),n===$&&!i("enctype")&&e.removeAttribute("enctype")}function go(e,t,n,r){let o=i=>(r||[]).some(s=>String(s).toLowerCase()===i);t===$&&!o("formmethod")&&e.removeAttribute("formmethod"),n===$&&!o("formenctype")&&e.removeAttribute("formenctype")}function Ds(e,t){let n=String(e).toLowerCase();Ke(n[0])&&(n=n.slice(1));let r=String(t||"").toLowerCase();return n==="action"?r==="form":n==="formaction"?r==="button"||r==="input":!1}function wt(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=>wt(r,n)))}function Bs(e){let t=String(e).toLowerCase();return Ke(t[0])&&(t=t.slice(1)),t==="action"||t==="formaction"}function Us(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 O,io,mo,$,Je=F(()=>{Tn();gt();O="__webjs_action",io="$$webjsAction";mo=new Set(["multipart/form-data","application/x-www-form-urlencoded"]);$=Symbol("webjs.attr.absent")});function jo(){return typeof HTMLElement<"u"&&typeof HTMLSlotElement<"u"}function ba(){if(No||(ie=jo(),!ie))return;et=HTMLSlotElement.prototype.assignedNodes,Kn=HTMLSlotElement.prototype.assignedElements,Lt=Object.getOwnPropertyDescriptor(Element.prototype,"assignedSlot"),HTMLSlotElement.prototype.assignedNodes=function(n){return this.hasAttribute(N)&&!Gn(this)?er(this,n):et?et.call(this,n):[]},HTMLSlotElement.prototype.assignedElements=function(n){return this.hasAttribute(N)&&!Gn(this)?er(this,n).filter(r=>r.nodeType===1):Kn?Kn.call(this,n):[]},Object.defineProperty(Element.prototype,"assignedSlot",{configurable:!0,enumerable:!0,get:function(){let n=Lt&&Lt.get?Lt.get.call(this):null;return n||ko(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||ko(this)}}),Yn=HTMLSlotElement.prototype.assign,HTMLSlotElement.prototype.assign=function(...n){if(this.hasAttribute(N)&&!Gn(this)){let r=ya(this);if(r){let o=Q(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);xe(o),Z(r)}return}return Yn?Yn.apply(this,n):void 0},No=!0}function ir(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 ya(e){for(let t=e.parentElement;t;t=t.parentElement)if(t[v])return X(t,e)?t:null;return null}function Gn(e){let t=e;for(let n=0;n<128;n++){let r=t.parentNode;if(!r||r===t)return!1;if(r.nodeType===11&&r.host)return!0;t=r}return!1}function er(e,t){if(e.getAttribute(I)!==V)return[];let n=Array.from(e.childNodes);return!t||!t.flatten?n:tr(n,new Set,0)}function tr(e,t,n){if(n>=ma)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(N)){let s=er(i,{flatten:!1});if(s.length>0)for(let a of tr(s,t,n+1))r.push(a);else for(let a of tr(Array.from(i.childNodes),t,n+1))r.push(a)}else if(et){let s=et.call(i,{flatten:!0});for(let a of s)r.push(a)}else r.push(o)}else r.push(o);return r}function ko(e){let t=e.parentElement;return t&&t.tagName==="SLOT"&&t.hasAttribute(N)&&t.getAttribute(I)===V?t:null}function Q(e){let t=e,n=t[v];return n||(n={host:e,authored:[],assignedByName:new Map,lastSnapshot:new WeakMap},t[v]=n),n}function sr(e){return!!e[v]}function Ro(e){let t=Q(e);for(;e.firstChild;){let n=e.firstChild;t.authored.push(n),_.add(n),e.removeChild(n)}xe(t)}function xe(e){let t=e.assignedByName;t.clear();for(let n of e.authored)ga(t,de(e,n),n)}function de(e,t){let n=ir(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 Lo(t)}function Oo(e){let t=Q(e);t.adopted=!0;let n=new Set,r=e.querySelectorAll(`slot[${N}]`);for(let o of r){let i=o;if(!X(e,i)||i.getAttribute(I)!==V||Dt(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),Lo(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(X(e,o)){for(let i of Array.from(o.childNodes))_.add(i),t.authored.push(i);o.remove()}xe(t)}function H(e){return e==null||e===""||e==="default"?null:e}function Lo(e){return e.nodeType!==1?null:H(e.getAttribute("slot"))}function ga(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}function me(e,t,n){let r=Q(e),o=H(t),i=Array.isArray(n)?n.filter(Boolean):n?[n]:[],s=r.authored.findIndex(c=>de(r,c)===o),a=r.authored.filter(c=>de(r,c)===o);r.authored=r.authored.filter(c=>de(r,c)!==o),(s===-1||s>r.authored.length)&&(s=r.authored.length);for(let c of i)c.nodeType===1&&!ir(r,c)&&(o==null?c.removeAttribute("slot"):c.setAttribute("slot",o)),_.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)}xe(r),Z(e)}function wa(){oe||!ie||(oe=Node.prototype.appendChild,Po=Node.prototype.insertBefore,ke=Node.prototype.removeChild,nr=Node.prototype.replaceChild,Mo=Element.prototype.append,Io=Element.prototype.prepend,Fo=Element.prototype.replaceChildren,Pt=Object.getOwnPropertyDescriptor(Element.prototype,"innerHTML"),rr=Object.getOwnPropertyDescriptor(Node.prototype,"textContent"))}function Ft(e,t){let n=e[T];e[T]=!0;try{return t()}finally{e[T]=n,n||ar(e)}}function $o(e){if(!ie)return;let t=e,n=Q(e);n.backstop||(n.backstop=new MutationObserver(r=>$t(e,n,r)),n.backstop.observe(e,{childList:!0,subtree:!1}),n.flipSensor=new MutationObserver(r=>Do(e,r)),n.flipSensor.observe(e,{attributes:!0,attributeFilter:["slot","name"],subtree:!0}))}function $t(e,t,n){let r=e,o=r[he],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&&Ho(i,l))){if(t.authored.indexOf(l)!==-1){s=!0;continue}_.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;_.has(l)&&l.parentNode==null&&!a.has(l)||(t.authored.splice(u,1),s=!0)}}s&&Z(e)}function ar(e){let t=e,n=t[v];if(!(n&&n.backstop))return;let r=n.backstop.takeRecords();(!(Symbol.for("webjs.instance")in t)||t[Symbol.for("webjs.instance")])&&$t(e,n,r)}function Do(e,t){let n=e[v];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(N)&&X(e,i)&&(r=!0):o.attributeName==="slot"&&(n.adoptedKey&&n.adoptedKey.delete(i),n.authored.indexOf(i)!==-1&&(r=!0))}r&&Z(e)}function Bo(e){let t=e[v];t&&(t.backstop&&($t(e,t,t.backstop.takeRecords()),t.backstop.disconnect(),t.backstop=void 0),t.flipSensor&&(Do(e,t.flipSensor.takeRecords()),t.flipSensor.disconnect(),t.flipSensor=void 0))}function Uo(e){if(!ie)return;let t=e,n=t[v];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[he]){if(n.authored.indexOf(a)!==-1){s=!0;continue}o&&(!r||Ho(r,a))||!o&&i||(_.add(a),n.authored.push(a),s=!0)}s&&Z(e)}function Ho(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 _a(e){let t=e,n=t[he];return(!n||!n.isConnected)&&(n||(n=e.ownerDocument.createElement("wj-slot-park"),n.setAttribute("hidden",""),n.style.display="none",t[he]=n),Ft(e,()=>oe.call(e,n))),n}function pe(e){return e instanceof Node||!!(e&&typeof e=="object"&&e.ownerDocument&&e.ownerDocument.defaultView&&e instanceof e.ownerDocument.defaultView.Node)}function Jn(e,t,n){if(n&&!pe(t))return[e.ownerDocument.createTextNode(`${t}`)];if(!pe(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);Mt(e,r);for(let o of r)ke.call(t,o);return r}return Mt(e,[t]),[t]}function Mt(e,t){Ne(e,t);for(let n of t){if(!pe(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 Ne(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 Xn(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[v];return n?Dt(n,e,t):!1}function Dt(e,t,n){for(let r=n;r&&r!==t;r=r.parentNode)if(e.authored.indexOf(r)!==-1)return!0;return!1}function Qn(e,t){if(_.has(t))return!0;let n=t.parentNode;if(n==null)return!1;if(n===e||n===e[he])return!0;let r=e[v];return n.nodeType===1&&n.tagName==="SLOT"&&n.hasAttribute(N)&&(r&&r.lastSnapshot.has(n)||e.contains(n)&&X(e,n))}function Zn(e,t){let n=[];for(let i of t)pe(i)?i.nodeType===11?n.push({frag:i}):n.push({node:i}):n.push({text:`${i}`});for(let i of n)i.frag?Ne(e,Array.from(i.frag.childNodes)):i.node&&Mt(e,[i.node]);let r=e.ownerDocument.createDocumentFragment();for(let i of n)if(i.text!==void 0)oe.call(r,e.ownerDocument.createTextNode(i.text));else if(i.frag){let s=Array.from(i.frag.childNodes);Mt(e,s);for(let a of s)oe.call(r,a)}else i.node&&(Ne(e,[i.node]),oe.call(r,i.node));let o=Array.from(r.childNodes);Ne(e,o);for(let i of o)ke.call(r,i);return o}function J(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);xe(t),Z(e)}function Wo(e){if(!ie)return;let t=e;if(t[xo])return;wa(),t[xo]=!0;let n=Q(e);t.appendChild=function(r){if(t[T])return oe.call(this,r);let o=Jn(e,r,!1);for(let i of o)_.add(i);return Xn(n,o,null),J(e,n,o),r},t.insertBefore=function(r,o){if(t[T])return Po.call(this,r,o);if(!pe(r))throw new TypeError("Failed to execute insertBefore on the host: parameter 1 is not of type Node.");if(o!=null&&!pe(o))throw new TypeError("Failed to execute insertBefore on the host: parameter 2 is not of type Node.");if(Ne(e,r.nodeType===11?Array.from(r.childNodes):[r]),o!=null&&(n.authored.indexOf(o)===-1||!Qn(e,o)))throw new DOMException("insertBefore: reference node is not an assigned child of this host","NotFoundError");if(r===o)return r;let i=Jn(e,r,!1);for(let s of i)_.add(s);return Xn(n,i,o||null),J(e,n,i),r},t.removeChild=function(r){if(t[T])return ke.call(this,r);let o=n.authored.indexOf(r);if(o===-1)return ke.call(this,r);if(!Qn(e,r))throw new DOMException("removeChild: the node is not an assigned child of this host","NotFoundError");return n.authored.splice(o,1),J(e,n,[r]),r},t.replaceChild=function(r,o){if(t[T])return nr.call(this,r,o);if(n.authored.indexOf(o)===-1)return nr.call(this,r,o);if(!pe(r))throw new TypeError("Failed to execute replaceChild on the host: parameter 1 is not of type Node.");if(Ne(e,r.nodeType===11?Array.from(r.childNodes):[r]),!Qn(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=Jn(e,r,!1);for(let c of s)_.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),J(e,n,[...s,o]),o},t.append=function(...r){if(t[T])return Mo.apply(this,r);let o=Zn(e,r);for(let i of o)_.add(i);Xn(n,o,null),J(e,n,o)},t.prepend=function(...r){if(t[T])return Io.apply(this,r);let o=Zn(e,r);for(let i of o)_.add(i);for(let i of o){let s=n.authored.indexOf(i);s!==-1&&n.authored.splice(s,1)}n.authored.unshift(...o),J(e,n,o)},t.replaceChildren=function(...r){if(t[T])return Fo.apply(this,r);let o=Zn(e,r);for(let s of o)_.add(s);let i=n.authored;n.authored=o.slice(),J(e,n,[...i,...o])},Object.defineProperty(t,"innerHTML",{configurable:!0,get(){return Pt.get.call(this)},set(r){if(t[T]){Pt.set.call(this,r);return}let o=e.ownerDocument.createElement("div");Pt.set.call(o,r===null?"":`${r}`);let i=Array.from(o.childNodes);for(let a of i)_.add(a);let s=n.authored;n.authored=i,J(e,n,[...s,...i])}}),Object.defineProperty(t,"textContent",{configurable:!0,get(){return rr.get.call(this)},set(r){if(t[T]){rr.set.call(this,r);return}let o=r==null||r===""?[]:[e.ownerDocument.createTextNode(`${r}`)];for(let s of o)_.add(s);let i=n.authored;n.authored=o,J(e,n,[...i,...o])}})}function Z(e){if(!ie)return;let t=e[v];if(t){if(t.applying){t.reapply=!0;return}t.applying=!0;try{do{t.reapply=!1;let n=t.pendingRecordNodes||Aa;t.pendingRecordNodes=void 0,Sa(e,t,n),va(e,t),xe(t);let r=[],o=new Set;for(let u of e.querySelectorAll(`slot[${N}]`))if(X(e,u)&&!Dt(t,e,u)){if(!u.hasAttribute(I)&&!(tt 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")),d=i.get(f);d||(d=[],i.set(f,d)),d.push(u)}let s=[];for(let[u,f]of i){let d=t.assignedByName.get(u)||[];for(let p=0;p<f.length;p++){let m=f[p],g=d.filter(y=>{let h=ir(t,y);return h?h===m:p===0}),b=g.filter(y=>y===e||y.nodeType===1&&y.contains(e));if(b.length){for(let y of b)_.delete(y);g=g.filter(y=>b.indexOf(y)===-1)}g.length>0?Ca(t,m,g)&&s.push(m):Na(t,m)&&s.push(m)}}for(let u of s)xa(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(de(t,u))||c.add(u);let l=e[he];if(l)for(let u of Array.from(l.childNodes))c.has(u)||ke.call(l,u);if(c.size){let u=_a(e);for(let f of c)f.parentNode!==u&&(_.delete(f),Ft(e,()=>oe.call(u,f)))}if(t.backstop){let u=t.backstop.takeRecords();u.length&&$t(e,t,u)}}while(t.reapply)}finally{t.applying=!1}}}function Sa(e,t,n){for(let r of e.querySelectorAll(`slot[${N}][${I}="${V}"]`)){if(!X(e,r)||Dt(t,e,r))continue;let o=r,i=t.lastSnapshot.get(o);if(!i)continue;let s=Array.from(o.childNodes);if(or(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&&de(t,m)!==c&&(t.adoptedKey||(t.adoptedKey=new WeakMap),t.adoptedKey.set(m,c));for(let m of a){if(l.indexOf(m)!==-1||de(t,m)!==c)continue;let g=a.indexOf(m),b=0;for(let y=0;y<l.length;y++){let h=a.indexOf(l[y]);h!==-1&&h<g&&(b=y+1)}l.splice(b,0,m)}let u=new Set(l);for(let m of i)u.add(m);let f=-1,d=0;for(let m of a){if(u.has(m)){f===-1&&(f=d);continue}d+=1}let p=a.filter(m=>!u.has(m));(f===-1||f>p.length)&&(f=p.length),p.splice(f,0,...l),t.authored=p}}function va(e,t){let n=e[he];t.authored=t.authored.filter(r=>{if(_.has(r))return!0;let o=r.parentNode;return o==null?!1:!!(o===e||o===n||o.nodeType===1&&o.tagName==="SLOT"&&o.hasAttribute(N)&&(t.lastSnapshot.has(o)||e.contains(o)&&X(e,o)))})}function Vo(e){if(!ie)return!1;for(let t of e.querySelectorAll(`slot[${N}][${I}]`))if(X(e,t))return!0;return!1}function X(e,t){let n=t[It];if(n)return n===e;let r=typeof t.getAttribute=="function"?t.getAttribute(ha):null;if(r){let o=Ea(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 Ea(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 Ca(e,t,n){for(let l of n)_.delete(l);let r=t.getAttribute(I)!==V,o=e.lastSnapshot.get(t)||[],i=r||!or(o,n);if(!r&&or(Array.from(t.childNodes),n))return e.lastSnapshot.set(t,n.slice()),i;let s=t[tt];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(I,V),e.lastSnapshot.set(t,n.slice()),i}function Na(e,t){let n=t.getAttribute(I)===V;if(t.setAttribute(I,pa),!n)return To(t),!1;for(e.lastSnapshot.delete(t);t.firstChild;)t.removeChild(t.firstChild);return To(t),!0}function To(e){let t=e[tt];!t||t.childNodes.length===0||e.appendChild(t)}function zo(e,t){if(!sr(e))return;let n=Q(e),r=H(t.getAttribute("name")),o=n.assignedByName.get(r);if(o)for(let i of o)i.parentNode===t&&(_.add(i),t.removeChild(i));n.lastSnapshot.delete(t)}function ka(e){e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1}))}function xa(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)ka(r)}))}function or(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 ie,v,N,I,V,pa,tt,It,ha,ma,et,Kn,Lt,Yn,No,T,xo,he,_,oe,Po,ke,nr,Mo,Io,Fo,Pt,rr,Aa,Bt=F(()=>{ie=jo(),v=Symbol("webjs.slot.state"),N="data-webjs-light",I="data-projection",V="actual",pa="fallback",tt=Symbol("webjs.slot.fallbackFrag"),It=Symbol("webjs.slot.templateOwner"),ha="data-wj-slot-owner",ma=64,et=null,Kn=null,Lt=null,Yn=null,No=!1;ba();T=Symbol("webjs.slot.rendering"),xo=Symbol("webjs.slot.intercepted"),he=Symbol("webjs.slot.park"),_=new WeakSet,oe=null,Po=null,ke=null,nr=null,Mo=null,Io=null,Fo=null,Pt=null,rr=null;Aa=new Set});function li(e,t,n){sc.has(t)?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}async function br(e){return JSON.stringify(await ui(e))}function ye(e){return fi(JSON.parse(e))}async function ui(e){let t=ac();return await cc(e,t),be(e,t)}function fi(e){return ae(e,dc())}function ac(){return{refCount:new Map,idOf:new Map,emitted:new Set,nextId:0,blobBytes:new Map,fdEntries:new Map}}async function cc(e,t){let n=[e];for(;n.length;){let r=n.pop();if(!hc(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(mc(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 be(e,t){if(e===null)return null;if(e===void 0)return{[A]:"undef"};let n=typeof e;if(n==="string"||n==="boolean")return e;if(n==="number")return Number.isNaN(e)?{[A]:"NaN"}:e===1/0?{[A]:"Inf"}:e===-1/0?{[A]:"-Inf"}:Object.is(e,-0)?{[A]:"-0"}:e;if(n==="bigint")return{[A]:"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{[A]:"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{[A]:"Ref",v:r};r!==void 0&&t.emitted.add(r);let o;if(e instanceof Date)o={[A]:"Date",v:Number.isNaN(e.getTime())?null:e.toISOString()};else if(e instanceof Error)o={[A]:"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={[A]:"File",v:st(i),n:e.name,t:e.type||"",m:e.lastModified}:o={[A]:"Blob",v:st(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,be(c,t)]);o={[A]:"FD",v:s}}else if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)o=lc(e);else if(e instanceof Map){let i=[];for(let[s,a]of e)i.push([be(s,t),be(a,t)]);o={[A]:"Map",v:i}}else if(e instanceof Set){let i=[];for(let s of e)i.push(be(s,t));o={[A]:"Set",v:i}}else if(Array.isArray(e))o=e.map(i=>be(i,t));else{o={};for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i))continue;let s=bc(i)?"_"+i:i;li(o,s,be(e[i],t))}}if(r!==void 0){if(Array.isArray(o))return{[A]:"Arr",_id:r,v:o};o._id=r}return o}function lc(e){if(e instanceof ArrayBuffer)return{[A]:"buf",v:st(new Uint8Array(e))};if(e instanceof DataView)return{[A]:"dv",v:st(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))};let t=e.constructor.name,n=uc[t];if(!n)throw new TypeError(`Unsupported typed array: ${t}`);let r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return{[A]:n,v:st(r)}}function dc(){return{refs:new Map}}function ae(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(ae(e[s],t));return i}let n=e[A];if(typeof n=="string")return pc(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=yc(i)?i.slice(1):i;li(r,s,ae(e[i],t))}return r}function pc(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(ae(s,n),ae(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(ae(s,n));return i}case"Arr":{let i=[];typeof r=="number"&&n.refs.set(r,i);for(let s of e.v)i.push(ae(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=it(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=it(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=ae(a,n);i.append(s,c)}return i}default:{if(t==="buf"){let s=it(e.v);return o(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength))}if(t==="dv"){let s=it(e.v);return o(new DataView(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)))}let i=fc[t];if(i){let s=it(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 hc(e){return e!==null&&typeof e=="object"}function mc(e){if(e===null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function bc(e){return/^_+\$wj$/.test(e)||/^_+id$/.test(e)}function yc(e){return/^__+\$wj$/.test(e)||/^__+id$/.test(e)}function st(e){if(di)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 it(e){if(di){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 A,sc,uc,fc,di,at=F(()=>{A="_$wj",sc=new Set(["__proto__","constructor","prototype"]);uc={Int8Array:"i8",Uint8Array:"u8",Uint8ClampedArray:"u8c",Int16Array:"i16",Uint16Array:"u16",Int32Array:"i32",Uint32Array:"u32",Float32Array:"f32",Float64Array:"f64",BigInt64Array:"bi64",BigUint64Array:"bu64"},fc={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};di=typeof Buffer<"u"&&typeof Buffer.from=="function"});var Ni={};ro(Ni,{observeLazy:()=>Uc,observeViewportOnce:()=>Wc});function Ci(e){let t=gr.get(e);return t||(t=import(e).finally(()=>gr.delete(e)),gr.set(e,t),t)}function Uc(e){for(let[t,n]of Object.entries(e))ge.set(t.toLowerCase(),n);if(typeof IntersectionObserver>"u"){for(let t of ge.values())Ci(t);ge.clear();return}lt||(lt=new IntersectionObserver(Hc,{rootMargin:"200px"})),Ei(),typeof MutationObserver<"u"&&new MutationObserver(()=>Ei()).observe(document.body,{childList:!0,subtree:!0})}function Ei(){if(!(!lt||!ge.size))for(let e of ge.keys())for(let t of document.querySelectorAll(e))lt.observe(t)}function Hc(e){for(let t of e){if(!t.isIntersecting)continue;let n=t.target.tagName.toLowerCase(),r=ge.get(n);r&&(Ci(r),ge.delete(n),lt?.unobserve(t.target))}}function qc(e){for(let t of e){if(!t.isIntersecting)continue;let n=Qt.get(t.target);Qt.delete(t.target),ct?.unobserve(t.target),n&&n()}}function Wc(e,t){return typeof IntersectionObserver>"u"?(t(),()=>{}):(ct||(ct=new IntersectionObserver(qc,{rootMargin:"200px"})),Qt.set(e,t),ct.observe(e),()=>{Qt.delete(e),ct?.unobserve(e)})}var ge,lt,gr,ct,Qt,ki=F(()=>{ge=new Map,lt=null,gr=new Map;ct=null,Qt=new WeakMap});var wr,_r=F(()=>{wr=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(()=>(ki(),Ni)).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(()=>(Zt(),xi)).then(({loadFrame:n})=>{this._webjsLoadedSrc!==t||!this.isConnected||n(this,t)})}}:null;typeof customElements<"u"&&wr&&!customElements.get("webjs-frame")&&customElements.define("webjs-frame",wr)});function zc(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 Sr(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 Vc,Ar,en=F(()=>{Vc=new Set(["append","prepend","before","after","replace","update"]);Ar=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=Vc.has(t)?this.querySelector("template"):null;try{for(let s of r){let a=i?i.content.cloneNode(!0):null;zc(t,s,a)}}finally{this.remove()}}}:null;typeof customElements<"u"&&Ar&&!customElements.get("webjs-stream")&&customElements.define("webjs-stream",Ar)});var Ti,ji=F(()=>{Ti=typeof HTMLElement<"u"?class extends HTMLElement{connectedCallback(){this.style.display||(this.style.display="contents")}}:null;typeof customElements<"u"&&Ti&&!customElements.get("webjs-suspense")&&customElements.define("webjs-suspense",Ti)});function tn(e,t){let n=typeof document<"u"?document:null,r=e||n;if(!r||typeof r.querySelectorAll!="function")return;if(t&&t.frame===!0){vr(r,!0);return}Li();let o=r===n,i=!!n&&!o&&typeof n.contains=="function"&&n.contains(r),s=!!n&&!o&&!i;s&&(vr(n,!0),ce.clear(),Cr.clear()),(o||s)&&(Er=!0);let a=j.ingested+j.replaced;Gc(vr(r),a)}function vr(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=Yc(r.getAttribute?.("data-webjs-dev"));o!==null&&(n=o),Ri(t?null:r.textContent,r)}for(let r of e.querySelectorAll("[data-webjs-seed]"))Ri(t?null:r.getAttribute("data-webjs-seed"),r,()=>r.removeAttribute("data-webjs-seed"));return n}function Ri(e,t,n){if(e)try{let r=ye(e);if(r&&typeof r=="object")for(let o in r){ce.has(o)?j.replaced++:j.ingested++,ce.set(o,r[o]);let i=o.indexOf("/",o.indexOf("/")+1);i>0&&Cr.add(o.slice(0,i))}}catch{}n?n():t.remove?.()}function Yc(e){return typeof e!="string"?null:e||"ok"}function Gc(e,t){if(e===null)return;let n=++Kc;Me={epoch:n,hits:j.hits,misses:j.misses,keyMisses:j.keyMisses,merged:t,marker:e};let r=()=>{!Me||Me.epoch!==n||Li()};try{typeof requestIdleCallback=="function"?requestIdleCallback(r,{timeout:1e3}):setTimeout(r,250)}catch{Me=null}}function Li(){let e=Me;if(Me=null,!!e)try{Jc(e)}catch{}}function Jc(e){let t=j.hits-e.hits,n=j.misses-e.misses,r=j.ingested+j.replaced-e.merged,o=j.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, ${ce.size} still unconsumed). ${i} See https://webjs.dev/docs/data-fetching for the seeding reference.`)}function Xc(e,t,n){Er||(Er=!0,tn());let r=`${e}/${t}/${n}`;if(ce.has(r)){let o=ce.get(r);return ce.delete(r),j.hits++,o}return j.misses++,Cr.has(`${e}/${t}`)&&j.keyMisses++,Oi}function Qc(){return{...j,pending:ce.size}}var ce,Oi,Er,j,Cr,Me,Kc,Nr=F(()=>{at();ce=new Map,Oi=Symbol("webjs.seed.miss"),Er=!1,j={ingested:0,replaced:0,hits:0,misses:0,keyMisses:0},Cr=new Set,Me=null,Kc=0});function kr(e){if(!(!Array.isArray(e)||!e.length)){nn+=1;for(let t of e)t&&Pi.set(t,nn)}}function el(){return nn}function tl(e,t,n){if(!(!Array.isArray(t)||!t.length)&&(Ie.delete(e),Ie.set(e,{tags:t.slice(),since:typeof n=="number"?n:nn}),Ie.size>Zc)){let r=Ie.keys().next().value;r!==void 0&&Ie.delete(r)}}function nl(e){let t=Ie.get(e);if(!t)return!1;for(let n of t.tags)if((Pi.get(n)||0)>t.since)return!0;return!1}function xr(e){return e?e.split(",").map(t=>t.trim()).filter(Boolean):[]}var nn,Pi,Ie,Zc,Tr=F(()=>{nn=0,Pi=new Map,Ie=new Map,Zc=1e3});var xi={};ro(xi,{_FALLBACK_MARKER_KEY:()=>cn,_FRAME_TOP:()=>es,_LIVE_ATTRS:()=>Ir,_activateSwappedRange:()=>Qr,_activeFrameId:()=>Zi,_addNewHeadElements:()=>$r,_applyOptimisticLoading:()=>Gr,_applyStreamedResolve:()=>Ss,_applySwap:()=>Yr,_blurOutgoingFocus:()=>sn,_buildHaveHeader:()=>yt,_buildSubmitFormData:()=>Xi,_bumpNavToken:()=>Hl,_clearFormBusy:()=>bs,_clearFrameBusy:()=>hs,_collectBoundaries:()=>We,_currentPageUrl:()=>ql,_diffElementInPlace:()=>mn,_eligibleAnchorHref:()=>un,_encodeSubmitBody:()=>Ji,_findAnchorInPath:()=>Qi,_getSubmitAction:()=>Yi,_getSubmitEnctype:()=>Gi,_getSubmitMethod:()=>Ki,_isNonHtmlPath:()=>Kl,_isPreBootNavigation:()=>ns,_keyOf:()=>qe,_markFormBusy:()=>ms,_markFrameBusy:()=>ps,_mergeHead:()=>ws,_navToken:()=>Ul,_onPopState:()=>Ur,_onSubmit:()=>Hr,_parseHTML:()=>Dr,_planBoundarySwap:()=>rs,_prefetch:()=>Ve,_prefetchAnchor:()=>ls,_prefetchCache:()=>S,_prefetchHasHoverPointer:()=>as,_prefetchInflightSize:()=>$l,_prefetchMode:()=>fn,_prefetchPeek:()=>Fl,_prefetchSaysSaveData:()=>Vr,_prefetchSuppressed:()=>cs,_prefetchTake:()=>us,_reactivateScripts:()=>wn,_readStreamedShell:()=>_s,_reconcileChildren:()=>vn,_regraftPermanentElements:()=>ys,_regraftPermanentInSlice:()=>Sn,_resetParseProbe:()=>ol,_resetPrefetch:()=>Dl,_resetWarnOnce:()=>Vl,_resolveTargetFrameId:()=>qr,_restoreOptimistic:()=>ut,_runWithTransition:()=>on,_setCurrentPageUrl:()=>Wl,_setHardNavigate:()=>Bl,_shouldFullLoadDuringParse:()=>zl,_snapshotCache:()=>R,_streamBoundariesProgressively:()=>vs,_takeResolveUnit:()=>As,_viewTransitionsEnabled:()=>Kr,disableClientRouter:()=>Hi,enableClientRouter:()=>Br,loadFrame:()=>Wi,navigate:()=>qi,revalidate:()=>Vi});function Dr(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"&&rl()?Document.parseHTMLUnsafe(e):il(e)}function rl(){if(Fe!==null)return Fe;try{Fe=Document.parseHTMLUnsafe("<!doctype html><body><!--c--><i></i>")?.body?.firstChild?.nodeType===8}catch{Fe=!1}return Fe}function ol(){Fe=null}function il(e){return typeof DOMParser>"u"?null:new DOMParser().parseFromString(e,"text/html")}function sl(){jr||typeof MutationObserver>"u"||typeof customElements>"u"||(jr=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)}}),jr.observe(document.body,{childList:!0,subtree:!0}))}function Ui(){if(typeof document>"u"||!document.documentElement)return()=>{};q&&q();let e=document.documentElement,t=e.style.getPropertyValue("overflow-anchor");e.style.setProperty("overflow-anchor","none");let n=null,r=()=>{if(q===r){if(q=null,n&&(clearTimeout(n),n=null),typeof window<"u")for(let o of an)window.removeEventListener(o,r,{capture:!0});t?e.style.setProperty("overflow-anchor",t):e.style.removeProperty("overflow-anchor")}};if(q=r,n=setTimeout(r,al),typeof window<"u")for(let o of an)window.addEventListener(o,r,{capture:!0,passive:!0});return r}function cl(e,t){if(typeof window>"u"||typeof requestAnimationFrame!="function")return;D&&D();let n=0,r=null,o=null,i=()=>{if(D===i){D=null,n&&cancelAnimationFrame(n),r&&(clearTimeout(r),r=null),o&&(o(),o=null);for(let a of an)window.removeEventListener(a,i,{capture:!0})}},s=()=>{if(D!==i)return;if(document.documentElement.scrollHeight-window.innerHeight>=e){window.scrollTo({left:t,top:e,behavior:"instant"}),o=Ui(),n&&(cancelAnimationFrame(n),n=0);return}n=requestAnimationFrame(s)};D=i;for(let a of an)window.addEventListener(a,i,{capture:!0,passive:!0});r=setTimeout(i,Bi),n=requestAnimationFrame(s)}function ll(e){if(typeof requestAnimationFrame!="function"){setTimeout(e,0);return}requestAnimationFrame(()=>requestAnimationFrame(e))}function Br(){te||typeof document>"u"||(te=!0,document.addEventListener("click",zi,!1),document.addEventListener("submit",Hr,!1),window.addEventListener("popstate",Ur),document.addEventListener("pointerover",He,!0),document.addEventListener("focusin",He,!0),document.addEventListener("touchstart",He,{capture:!0,passive:!0}),document.addEventListener("pointerout",fs,!0),document.addEventListener("webjs:navigate",Mr),sl(),Mr(),typeof history<"u"&&"scrollRestoration"in history&&(rn=history.scrollRestoration,history.scrollRestoration="manual"),typeof location<"u"&&(G=location.href),dl())}function Hi(){te&&(te=!1,document.removeEventListener("click",zi,!1),document.removeEventListener("submit",Hr,!1),window.removeEventListener("popstate",Ur),document.removeEventListener("pointerover",He,!0),document.removeEventListener("focusin",He,!0),document.removeEventListener("touchstart",He,{capture:!0}),document.removeEventListener("pointerout",fs,!0),document.removeEventListener("webjs:navigate",Mr),An(),zr(),ue&&(ue.disconnect(),ue=null),typeof history<"u"&&rn!==null&&(history.scrollRestoration=rn,rn=null),ft+=1,q&&q(),D&&D(),G=null)}async function qi(e,t){let n=new URL(e,location.href);if(n.origin!==location.origin){_e(e);return}await Wr(n.href,t?.replace??!1,null)}async function Wi(e,t){if(typeof location>"u")return{ok:!1,status:null,aborted:!1};let n=e&&e.id;if(!n)return{ok:!1,status:null,aborted:!1};let r=new URL(t,location.href);if(r.origin!==location.origin)return{ok:!1,status:null,aborted:!1};B&&B.abort(),B=new AbortController;let o=B.signal,i=++k;return dn(r.href,n,!1,null,"GET",null,o,i)}function Vi(e){if(!e){R.clear(),S.clear();return}let t=new URL(e,location.href),n=t.pathname+t.search;R.delete(n),S.delete(n)}function zi(e){if(!te||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=Qi(e);if(!t||t.hasAttribute("download")||t.hasAttribute("data-no-router")||t.target&&t.target!=="_self")return;let n=t.href;if(!n)return;let r=new URL(n);if(r.origin!==location.origin||r.pathname===location.pathname&&r.search===location.search&&r.hash||_n.test(r.pathname))return;e.preventDefault();let o=qr(t);Wr(n,!1,o)}function Ur(e){Wr(location.href,!0,null)}function Hr(e){if(!te||e.defaultPrevented)return;let t=e.target;if(!t||t.nodeType!==1||t.tagName!=="FORM"||t.hasAttribute("data-no-router"))return;let n=e.submitter??null;if(n&&n.hasAttribute("data-no-router"))return;let r=n&&n.hasAttribute("formtarget")?n.getAttribute("formtarget")||"":t.getAttribute("target")||"";if(r&&r!=="_self")return;let o=Ki(t,n);if(o==="dialog")return;let i=Gi(t,n),s=o==="get"||o==="head",a=Yi(t,n),c;try{c=new URL(a,location.href)}catch{return}if(c.origin!==location.origin||_n.test(c.pathname))return;let l=Xi(t,n);if(fl(t,n,o,l),!s&&i==="text/plain")return;let u=Ji(l,i);e.preventDefault();let f=qr(n||t);bl(c.href,o,u,f,t)}function Ki(e,t){return((t&&t.hasAttribute("formmethod")?t.getAttribute("formmethod")||"":e.getAttribute("method")||"")||"get").toLowerCase()}function Yi(e,t){return t&&t.hasAttribute("formaction")?t.getAttribute("formaction")||"":e.getAttribute("action")||e.action||location.href}function ul(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 Gi(e,t){return ul(t&&t.hasAttribute("formenctype")?t.getAttribute("formenctype"):e.getAttribute("enctype"))}function Ji(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 Xi(e,t){try{return new FormData(e,t||void 0)}catch{let n=new FormData(e);return t&&t.getAttribute("name")&&n.append(t.getAttribute("name"),t.getAttribute("value")||""),n}}function Qi(e){for(let t of e.composedPath())if(t instanceof HTMLAnchorElement)return t;return null}function Zi(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 qr(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===es)return null;let r=typeof document<"u"?document.getElementById(n):null;return r&&r.tagName&&r.tagName.toLowerCase()==="webjs-frame"?n:(Ae(`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 Zi(e)}function Ae(e,t,n="warn"){if(Or.has(e)||(Or.add(e),typeof console>"u"))return;let r=n==="error"?console.error:console.warn;r&&r.call(console,t)}function fl(e,t,n,r){if(typeof process<"u"&&process.env||!r.has(O))return;let o="";try{o=new URL(e.getAttribute("action")||location.href,location.href).pathname}catch{o=location.pathname}if(n!=="post"){Ae(`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"){Ae(`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&&Ae(`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 ts(e,t){return!e&&!t&&typeof document<"u"&&document.readyState==="loading"}function ns(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 dl(){if(typeof location>"u"||Ii)return;Ii=!0;let e=null;try{e=sessionStorage.getItem(cn),sessionStorage.removeItem(cn)}catch{}let t="";try{let n=performance.getEntriesByType("navigation")[0];t=n?n.type:""}catch{}ns(t,document.referrer,location.href,e)&&le("pre-boot-navigation",location.href,!1)}function le(e,t,n=!0){if(n)try{sessionStorage.setItem(cn,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||Ae(`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 pl(e){typeof process<"u"&&process.env||Ae(`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 Fi(){if(typeof process<"u"&&process.env||Lr||typeof document>"u"||typeof getComputedStyle!="function")return;let e=document.documentElement;if(!e)return;Lr=!0;let t;try{t=getComputedStyle(e).scrollBehavior}catch{return}t==="smooth"&&Ae("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 ln(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 We(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 rs(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 os(e){let t=fe(e);document.dispatchEvent(new CustomEvent("webjs:before-cache",{detail:{url:e}})),R.has(t)&&R.delete(t);let n={html:document.documentElement.outerHTML,scrollX:typeof window<"u"&&window.scrollX||0,scrollY:typeof window<"u"&&window.scrollY||0};for(R.set(t,n);R.size>hl;){let r=R.keys().next().value;R.delete(r)}}function ml(e){let t=fe(e),n=R.get(t);return n==null?null:(R.delete(t),R.set(t,n),typeof n=="string"?{html:n,scrollX:0,scrollY:0}:n)}function fe(e){let t=new URL(e,location.href);return t.pathname+t.search}async function Wr(e,t,n){if(ts(t,n)&&typeof location<"u"){le("readyState-loading",e),_e(e);return}B&&B.abort(),B=new AbortController;let r=B.signal,o=++k;n||(ft+=1,q&&q(),D&&D()),G&&os(G);let i=setTimeout(()=>{ln(!0),i=null},150),s=null;t||(s=Gr());try{if(t){let a=ml(e);if(a){let c=Dr(a.html);if(c){Yr(c,n,!0,null);let l=()=>{};if(typeof window<"u"){let d=()=>{window.scrollTo({left:a.scrollX,top:a.scrollY,behavior:"instant"}),window.scrollY>=a.scrollY-1?l=Ui():cl(a.scrollY,a.scrollX)};if(Kr()&&typeof document.startViewTransition=="function"){let p=ft;mt.then(()=>{p!==ft||!te||d()}).catch(()=>{})}else d()}let u=dn(e,n,!1,s,"GET",null,r,o,!0).catch(()=>{}),f=new Promise(d=>setTimeout(d,Bi));Promise.all([u,f]).then(()=>ll(l));return}}typeof window<"u"&&window.scrollTo({left:0,top:0,behavior:"instant"})}await dn(e,n,!t,s,"GET",null,r,o)}finally{i&&clearTimeout(i),o===k&&(ln(!1),typeof location<"u"&&(G=location.href))}}async function bl(e,t,n,r,o){B&&B.abort(),B=new AbortController;let i=B.signal,s=++k;r||(ft+=1,q&&q(),D&&D());let a=t==="get"||t==="head",c=new URL(e,location.href);if(a){c.search="";for(let[p,m]of n)c.searchParams.append(p,typeof m=="string"?m:m.name)}G&&os(G);let l=setTimeout(()=>{ln(!0),l=null},150),u=Gr(),f=o?ms(o,s,c.href):null,d=!1;try{let p=await dn(c.href,r,!0,u,a?"GET":t.toUpperCase(),a?null:n,i,s);d=!!(p&&p.ok),!a&&s===k&&(R.clear(),S.clear())}finally{f&&bs(f,s,c.href,d),l&&clearTimeout(l),s===k&&(ln(!1),typeof location<"u"&&(G=location.href))}}function yt(){let e=We(document.body);return e?[...e.entries()].map(([t,n])=>`${t}:${n.routeKey}`).join(","):""}function Vr(){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 as(){try{if(typeof matchMedia=="function")return matchMedia("(hover: hover) and (pointer: fine)").matches}catch{}return!0}function Al(e){let t=e.getAttribute("rel");return t?t.toLowerCase().split(/\s+/).filter(Boolean):[]}function un(e){if(!e||!(e instanceof HTMLAnchorElement)||e.hasAttribute("download")||e.hasAttribute("data-no-router")||e.target&&e.target!=="_self")return null;let t=e.href;if(!t)return null;let n;try{n=new URL(t)}catch{return null}return n.origin!==location.origin||n.pathname===location.pathname&&n.search===location.search&&n.hash||_n.test(n.pathname)?null:t}function cs(e){if(e.hasAttribute("data-no-prefetch"))return!0;let t=Al(e);return t.includes("external")||t.includes("no-prefetch")}function fn(e){if(cs(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 as()?"intent":"viewport"}}function Ve(e){if(!te||typeof fetch!="function"||Vr())return;let t=fe(e);if(typeof location<"u"&&t===fe(location.href)||we.has(t)||dt.has(t))return;let n=S.get(t);if(n&&Pr()-n.at<is)return;if(we.size>=ss){for(dt.add(t),Be.push(e);Be.length>gl;){let i=Be.shift();dt.delete(fe(i))}return}let r=yt();if(!r&&typeof document<"u"&&document.readyState==="loading")return;we.add(t);let o={"x-webjs-router":"1","x-webjs-prefetch":"1"};r&&(o["x-webjs-have"]=r),fetch(e,{method:"GET",headers:o,credentials:"same-origin",cache:"no-cache"}).then(async i=>{let s=i.headers.get("content-type")||"";if(!/^text\/html\b/i.test(s)||i.status>=400)return;let a=i.headers.get("x-webjs-build"),c=i.headers.get("x-webjs-src"),l=typeof document<"u"?document.querySelector('script[type="importmap"]'):null,u=l?l.getAttribute("data-webjs-build"):null,f=l?l.getAttribute("data-webjs-src"):null;(a&&u&&a!==u||c&&f&&c!==f)&&(R.clear(),S.clear());let d=i.redirected&&i.url?i.url:e,p=await i.text();vl(t,{html:p,build:a,src:c,finalUrl:d,at:Pr()})}).catch(()=>{}).finally(()=>{we.delete(t),Sl()})}function Sl(){for(;Be.length&&we.size<ss;){let e=Be.shift();dt.delete(fe(e)),Ve(e)}}function vl(e,t){for(S.has(e)&&S.delete(e),S.set(e,t);S.size>yl;){let n=S.keys().next().value;S.delete(n)}typeof document<"u"&&document.dispatchEvent(new CustomEvent("webjs:prefetch",{detail:{url:t.finalUrl,key:e,from:"prefetch"}}))}function ls(e){let t=/<!--wj:children:([^>]*?)-->/.exec(e||"");return t?t[1]:null}function us(e,t){let n=fe(e),r=S.get(n);if(!r)return null;if(Pr()-r.at>=is)return S.delete(n),null;let o=ls(r.html);return o&&!new Set(String(t??(yt()||"")).split(",").filter(Boolean)).has(o)?(S.delete(n),null):(S.delete(n),r)}function Pr(){try{if(typeof performance<"u"&&typeof performance.now=="function")return performance.now()}catch{}return 0}function He(e){if(!te)return;let t=ds(e.target);if(!t)return;let n=fn(t);if(n==="none"||n==="render")return;let r=un(t);if(r){if(e.type==="touchstart"){Ve(r);return}n==="intent"&&(pt===t&&Ue||(An(),pt=t,Ue=setTimeout(()=>{Ue=null,pt=null,Ve(r)},wl)))}}function fs(e){let t=ds(e.target);t&&t===pt&&An()}function An(){Ue&&(clearTimeout(Ue),Ue=null),pt=null}function zr(){for(let e of ht)clearTimeout(e);ht.clear(),$e=new WeakMap}function ds(e){let t=e;for(;t;){if(t instanceof HTMLAnchorElement)return t;let n=t.nodeType===1?t:null;if(n){let o=n.closest&&n.closest("a");if(o instanceof HTMLAnchorElement)return o}let r=t.getRootNode?t.getRootNode():null;t=r&&r.host?r.host:null}return null}function Mr(){if(typeof document>"u"||Vr())return;let e=typeof IntersectionObserver<"u";e&&(ue?(ue.disconnect(),zr()):ue=new IntersectionObserver(t=>{for(let n of t){let r=n.target;if(n.isIntersecting){if($e.has(r))continue;let o=setTimeout(()=>{ht.delete(o),$e.delete(r),ue.unobserve(r);let i=un(r);i&&fn(r)==="viewport"&&Ve(i)},_l);$e.set(r,o),ht.add(o)}else{let o=$e.get(r);o&&(clearTimeout(o),ht.delete(o),$e.delete(r))}}},{threshold:.5}));for(let t of document.querySelectorAll("a[href]")){let n=fn(t);if(n==="render"){let r=un(t);r&&Ve(r)}else n==="viewport"&&e&&ue.observe(t)}}function El(e){if(typeof document>"u"||!document.body)return!1;let t=We(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 Rr(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||El(t)||typeof location<"u"&&(le("navigation-error-unrecoverable",e),_e(e))}async function dn(e,t,n,r,o,i,s,a,c){o=o||"GET";let l=typeof a=="number"?a:k,u,f=null,d=null,p=null,m=null,g=!1,b=e,y=t?ps(t,l):null;try{try{let w=o==="GET"&&!i&&!t?us(e,r?r.haveKeys:void 0):null;if(w)u=w.html,d=w.build,p=w.src,b=w.finalUrl,m=200,g=!0;else{let L={"x-webjs-router":"1"},Se=yt();Se&&(L["x-webjs-have"]=Se),t&&(L["x-webjs-frame"]=t),i!=null&&o!=="GET"&&o!=="HEAD"&&(L.accept=Mi+", text/html");let ve={method:o,headers:L,credentials:"same-origin",cache:"no-cache"};s&&(ve.signal=s),i!=null&&o!=="GET"&&o!=="HEAD"&&(ve.body=i);let E=await fetch(e,ve);m=E.status,g=E.ok;let ze=xr(E.headers.get("x-webjs-invalidate"));ze.length&&kr(ze);let x=E.headers.get("content-type")||"",Cs=/^text\/html\b/i.test(x);if(x.toLowerCase().indexOf(Mi)===0){let Ns=await E.text();return l===k&&(ut(r),Sr(Ns)),{ok:g,status:m,aborted:!1}}if(E.redirected&&E.url&&(b=E.url),E.status===204||E.status===205)return l===k&&n&&history.pushState(null,"",b),{ok:g,status:m,aborted:!1};if(!Cs)return l===k&&(ut(r),Rr(e,E.status,null)),{ok:!1,status:m,aborted:!1};d=E.headers.get("x-webjs-build"),p=E.headers.get("x-webjs-src");let Cn=await _s(E);u=Cn.shell,Cn.streaming&&(f=Cn)}}catch(w){return w&&w.name==="AbortError"?{ok:!1,status:null,aborted:!0}:l!==k?{ok:!1,status:null,aborted:!0}:(ut(r),Rr(e,null,w instanceof Error?w:new Error(String(w))),{ok:!1,status:null,aborted:!1})}if(l!==k){if(f&&f.reader)try{f.reader.cancel()}catch{}return{ok:!1,status:m,aborted:!0}}let h=Dr(u);if(!h)return ut(r),Rr(e,null,new Error("navigation response did not parse as HTML")),{ok:!1,status:m,aborted:!1};if(Yr(h,t,!!c,b,d,p)==="discard"){if(f&&f.reader)try{f.reader.cancel()}catch{}return{ok:g,status:m,aborted:!1}}if(n&&history.pushState(null,"",b),n){let w=new URL(b);if(w.hash){let L=document.getElementById(w.hash.slice(1));L?L.scrollIntoView():(Fi(),window.scrollTo({left:0,top:0,behavior:"instant"}))}else Fi(),window.scrollTo({left:0,top:0,behavior:"instant"})}return f&&(f.reader||f.rest)&&mt.then(()=>vs(f.reader,f.dec,f.rest,()=>l===k)),document.dispatchEvent(new CustomEvent("webjs:navigate",{detail:{url:b,frameId:t,from:"navigate"}})),{ok:g,status:m,aborted:!1}}finally{y&&hs(y,l)}}function ps(e,t){if(typeof document>"u")return null;let n=null;try{n=document.querySelector(`webjs-frame#${CSS.escape(e)}`)}catch{n=document.getElementById(e)}if(!n)return null;let r=pn.has(n);return pn.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 hs(e,t){if(pn.get(e)!==t)return;pn.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 ms(e,t,n){let r=hn.has(e);return hn.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 bs(e,t,n,r){if(hn.get(e)!==t)return;hn.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 $i(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+=ee(r);return n}function Kr(){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 on(e,t){let n=typeof document<"u"?document.startViewTransition:void 0;if(Kr()&&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 ys(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),bt.add(r))}}function Sn(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=Cl(t,o);if(!i||i===r)continue;let s=i.parentNode;if(s)s.replaceChild(r,i),bt.add(r);else{let a=t.indexOf(i);a!==-1&&(t[a]=r,bt.add(r))}}}function Cl(e,t){for(let n of e){if(n.nodeType!==1)continue;let r=n;if(r.id===t)return r;if(typeof r.querySelector=="function"){let o=null;try{o=r.querySelector(`#${CSS.escape(t)}`)}catch{o=null}if(o)return o}}return null}function Nl(e){if(!(!e||!e.start))for(let t=e.start.nextSibling;t&&t!==e.end;t=t.nextSibling)t.nodeType===1&&De(t)}function Yr(e,t,n,r,o,i){let s=!1,a=()=>{if(!s){s=!0;try{tn(e,{frame:!!t})}catch{}}};try{for(let p of e.querySelectorAll("[data-wj-host]"))p.setAttribute("data-wj-serialized","")}catch{}try{typeof sessionStorage<"u"&&(!r||t||n)&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}if(r&&!t&&!n){let p=document.querySelector('script[type="importmap"]'),m=p?p.getAttribute("data-webjs-build"):null,g=!1;if(o&&m&&(g=o!==m),!g&&e.head&&e.head.children.length>0){let b=$i(document),y=$i(e);b!==y&&(g=!0)}if(g&&typeof location<"u"){R.clear(),S.clear();try{let b="webjs:importmap-reload";if(sessionStorage&&sessionStorage.getItem(b))sessionStorage.removeItem(b),le("deploy-mismatch-reload-suppressed",r,!1);else{sessionStorage&&sessionStorage.setItem(b,"1"),le("deploy-mismatch",r),_e(r);return}}catch{le("deploy-mismatch",r),_e(r);return}}else if(!g){let b=p?p.getAttribute("data-webjs-src"):null;i&&b&&i!==b&&(R.clear(),S.clear(),p&&p.setAttribute("data-webjs-src",i));try{typeof sessionStorage<"u"&&sessionStorage.removeItem("webjs:importmap-reload")}catch{}}}if(t){a();let p=document.querySelector(`webjs-frame#${CSS.escape(t)}`),m=e.querySelector(`webjs-frame#${CSS.escape(t)}`);if(p&&m){$r(e.head),mt=on(()=>{Pl(p,m),wn(p),De(p),Di(e.body),sn()},()=>De(p));return}let g=new CustomEvent("webjs:frame-missing",{bubbles:!0,cancelable:!0,detail:{frameId:t,url:r||(typeof location<"u"?location.href:null),document:e}});(p||document).dispatchEvent(g),g.defaultPrevented||console.warn(`[webjs] frame "${t}" was not in the navigation response, leaving it unchanged. Handle "webjs:frame-missing" (preventDefault) to override.`);return}let c=We(document.body),l=We(e.body),u=c&&l?rs(c,l):null;if(u){a();let{mode:p,live:m,incoming:g}=u;$r(e.head),mt=on(()=>{p==="replace"?kl(m,g):xl(m,g,e),Ol(m.start,g.start),Di(e.body),sn()},()=>Nl(m));return}if(r&&!n&&typeof location<"u"){le(c?l?"no-shared-boundary":"incoming-boundaries-malformed":"live-boundaries-malformed",r),_e(r);return}if(r&&n)return le("revalidation-discarded",r,!1),"discard";a(),ws(e.head),ys(document.body,e.body);let f=[...e.body.childNodes];mt=on(()=>{document.body.replaceChildren(...f),wn(document.body),De(document.body),sn()},()=>De(document.body))}function sn(){let e=document.activeElement;!e||e===document.body||e===document.documentElement||typeof e.blur=="function"&&e.blur()}function kl(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));Sn(r,o);for(let i of r)i.parentNode===n&&n.removeChild(i);for(let i of o)n.insertBefore(i,e.end);Qr(e)}function xl(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));Sn(o,i),Tl(r,e.start,e.end,o,i),Qr(e)}function Tl(e,t,n,r,o){let i=new Map;for(let c of r){if(c.nodeType!==1)continue;let l=qe(c);l&&i.set(l,c)}let s=n,a=[];for(let c of o){if(c.nodeType===1){let l=qe(c);if(l&&i.has(l)){let u=i.get(l);mn(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 mn(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),!Ir.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])Ir.has(r.name)||n.has(r.name)||e.removeAttribute(r.name);if(jl(e)){Ll(e,t);return}vn(e,t)}function jl(e){let t=e;return t[Symbol.for("webjs.instance")]!=null||t[v]!=null}function Rl(e,t){for(let n=e.parentElement;n&&n!==t;n=n.parentElement)if(n.tagName.includes("-"))return!1;return!0}function bn(e){let t=new Map,n=`slot[${N}][${I}="${V}"]`;for(let r of e.querySelectorAll(n)){let o=r;if(!Rl(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(N)&&a.getAttribute(I)===V){i=!0;break}if(i)continue;let s=H(o.getAttribute("name"));t.has(s)||t.set(s,o)}return t}function Ol(e,t){let n=e.parentNode;if(!n||n.nodeType!==1)return;let r=n;if(r.tagName!=="SLOT"||!r.hasAttribute(N))return;let o=null;for(let f=r.parentElement;f;f=f.parentElement){if(f[v]){o=f;break}if(f.tagName.includes("-"))return}if(!o)return;let i=H(r.getAttribute("name"));me(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=bn(o),u=bn(c);for(let f of new Set([...l.keys(),...u.keys()])){if(f===i)continue;let d=u.get(f);d?me(o,f,[...d.childNodes].map(p=>document.importNode(p,!0))):l.get(f)&&me(o,f,null)}}function Ll(e,t){if(!e[v])return;let n=bn(e),r=bn(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?(vn(s,a),me(e,i,[...s.childNodes])):a?me(e,i,[...a.childNodes].map(c=>document.importNode(c,!0))):me(e,i,null)}}function vn(e,t){let n=[...e.childNodes],r=[...t.childNodes].map(a=>document.importNode(a,!0));Sn(n,r);let o=new Map;for(let a of n){if(a.nodeType!==1)continue;let c=qe(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=qe(c);if(l&&o.has(l)){let f=o.get(l);mn(f,c),i.push(f),o.delete(l);continue}let u=n[a];if(u&&u.nodeType===1&&!qe(u)&&u.tagName===c.tagName){mn(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 qe(e){let t=e.getAttribute("data-key");return t?`${e.tagName}:k:${t}`:e.id?`${e.tagName}:i:${e.id}`:null}function Gr(){let e=We(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=yt(),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 ut(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 Pl(e,t){vn(e,t)}function gs(){if(typeof document>"u")return"";let e=document.querySelector('meta[name="csp-nonce"]');return e&&e.getAttribute("content")||""}function yn(e){let t=document.createElement("script");for(let r of e.attributes)r.name!=="nonce"&&t.setAttribute(r.name,r.value);let n=gs();return n&&t.setAttribute("nonce",n),t.textContent=e.textContent,t}function Jr(e){if(!e.hasAttribute("nonce"))return e.cloneNode(!0);let t=e.cloneNode(!0),n=gs();return n?t.setAttribute("nonce",n):t.removeAttribute("nonce"),t}function ee(e){if(!e.hasAttribute("nonce"))return e.outerHTML;let t=e.cloneNode(!0);return t.removeAttribute("nonce"),t.outerHTML}function gn(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 Ml(e){if(!e.querySelector("meta"))return;let t=o=>{let i=new Map;for(let s of o.querySelectorAll("meta")){let a=gn(s);if(!a||a===Fr)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(ee).join(`
2
- `),c=s.map(ee).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(Jr(l))}}for(let[o,i]of r)if(!n.has(o))for(let s of i)s.remove()}function $r(e){let t=e.querySelector("title");t&&(document.title=t.textContent||"");let n=new Set;for(let r of document.head.children)n.add(ee(r));for(let r of e.children)r.tagName==="SCRIPT"&&r.getAttribute("type")==="importmap"||r.tagName!=="BASE"&&r.tagName!=="TITLE"&&(r.tagName==="META"&&gn(r)||n.has(ee(r))||(r.tagName==="SCRIPT"?document.head.appendChild(yn(r)):document.head.appendChild(Jr(r))));Ml(e)}function Il(e){return e.tagName==="STYLE"?!0:e.tagName==="LINK"&&(e.getAttribute("rel")||"").toLowerCase().split(/\s+/).includes("stylesheet")}function ws(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(ee(i));let o=new Set;for(let i of e.children)i.tagName==="SCRIPT"&&i.getAttribute("type")==="importmap"||i.tagName!=="BASE"&&o.add(ee(i));for(let i of[...t.children])i.tagName==="SCRIPT"&&i.getAttribute("type")==="importmap"||i.tagName!=="BASE"&&i.tagName!=="TITLE"&&(Il(i)||i.tagName==="META"&&gn(i)===Fr||o.has(ee(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"&&gn(i)===Fr||r.has(ee(i))||(i.tagName==="SCRIPT"?t.appendChild(yn(i)):t.appendChild(Jr(i))))}function De(e){typeof customElements>"u"||Xr(e)}function Xr(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&&Xr(n.shadowRoot))}function Di(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 _s(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 d=f.index+f[0].length;return{shell:r.slice(0,d),streaming:!0,reader:t,dec:n,rest:r.slice(d)}}}}function As(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 Ss(e,t){let n=document.getElementById(e);if(!n){pl(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&&Xr(i)}async function vs(e,t,n,r){let o=n,i=()=>{let s;for(;s=As(o);){if(!r())return!1;Ss(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{}}function wn(e){if(e.tagName==="SCRIPT"){let n=yn(e);return e.replaceWith(n),n}let t=[];bt.has(e)&&t.push(e);for(let n of e.querySelectorAll("[data-webjs-permanent]"))bt.has(n)&&t.push(n);for(let n of e.querySelectorAll("script"))t.length&&t.some(r=>r!==n&&r.contains(n))||n.replaceWith(yn(n));return e}function Qr(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=wn(n);r.isConnected!==!1&&De(r)}}function Fl(e){return S.get(fe(e))||null}function $l(){return we.size}function Dl(){S.clear(),we.clear(),Be.length=0,dt.clear(),An(),zr()}function Bl(e){_e=e||(t=>{location.href=t})}function Ul(){return k}function Hl(){return++k}function ql(){return G}function Wl(e){G=e}function Vl(){Or.clear(),Lr=!1}function zl(e,t){return ts(e,t)}function Kl(e){return _n.test(e)}var Mi,Fe,te,B,k,jr,G,rn,al,Bi,an,q,D,ft,_n,_e,es,Or,cn,Ii,Lr,hl,R,yl,is,ss,gl,wl,_l,S,we,Be,dt,Ue,pt,ue,$e,ht,pn,hn,bt,mt,Ir,Fr,Zt=F(()=>{_r();en();en();Je();ji();Nr();Tr();Bt();Mi="text/vnd.webjs-stream.html";Fe=null;te=!1,B=null,k=0,jr=null;G=null,rn=null,al=2e3,Bi=500,an=["wheel","touchmove","keydown","pointerdown"],q=null;D=null,ft=0;_n=/\.(?: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,_e=e=>{location.href=e};es="_top";Or=new Set;cn="webjs:nav-fallback",Ii=!1;Lr=!1;hl=16,R=new Map;yl=8,is=3e4,ss=3,gl=24,wl=100,_l=250,S=new Map,we=new Set,Be=[],dt=new Set,Ue=null,pt=null,ue=null,$e=new WeakMap,ht=new Set;pn=new WeakMap;hn=new WeakMap;bt=new WeakSet;mt=Promise.resolve();Ir=new Set(["value","checked","selected","indeterminate","disabled","open","popover"]);Fr="name=csp-nonce";(typeof window>"u"||window.__WEBJS_CLIENT_ROUTER__!==!1)&&Br()});function xs(e,...t){return{_$webjs:"template",strings:e,values:t}}function P(e){return!!e&&typeof e=="object"&&e._$webjs==="template"}var C="wjm-";function Ts(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 Nn(e){return!!e&&typeof e=="object"&&e._$webjsCss===!0}function kn(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 js(e){return!e||!e.length?"":`<style>${e.map(t=>t.text).join(`
5
- `)}</style>`}Tn();gt();Je();var wo=Symbol.for("webjs.repeat");function _o(e,t,n){return{[wo]:!0,items:[...e],keyFn:t,templateFn:n}}function _t(e){return!!e&&typeof e=="object"&&e[wo]===!0}function Hs(e){return{_$webjs:"unsafe-html",value:String(e??"")}}function Pn(e){return!!e&&typeof e=="object"&&e._$webjs==="unsafe-html"}function qs(e){return{_$webjs:"live",value:e}}function At(e){return!!e&&typeof e=="object"&&e._$webjs==="live"}function Ws(e,t){return{_$webjs:"keyed",key:e,value:t}}function St(e){return!!e&&typeof e=="object"&&e._$webjs==="keyed"}function Vs(e,t){return{_$webjs:"guard",deps:e,fn:t}}function vt(e){return!!e&&typeof e=="object"&&e._$webjs==="guard"}function zs(e){return{_$webjs:"template-content",template:e}}function Mn(e){return!!e&&typeof e=="object"&&e._$webjs==="template-content"}function Ks(e){return{_$webjs:"ref",target:e}}function Et(e){return!!e&&typeof e=="object"&&e._$webjs==="ref"}function Ys(){return{value:void 0}}function Gs(e){return{_$webjs:"cache",value:e}}function Ct(e){return!!e&&typeof e=="object"&&e._$webjs==="cache"}function Js(...e){return{_$webjs:"until",args:e}}function Nt(e){return!!e&&typeof e=="object"&&e._$webjs==="until"}function Xs(e,t){return{_$webjs:"async-append",iterable:e,mapper:t}}function In(e){return!!e&&typeof e=="object"&&e._$webjs==="async-append"}function Qs(e,t){return{_$webjs:"async-replace",iterable:e,mapper:t}}function Fn(e){return!!e&&typeof e=="object"&&e._$webjs==="async-replace"}function Zs(e){return{_$webjs:"watch",signal:e}}function kt(e){return!!e&&typeof e=="object"&&e._$webjs==="watch"}var U=null,re=!1,Ce=0,Ee=null,$n=0,Ao=(e,t)=>Object.is(e,t),Tt=()=>{},So=()=>!1;function vo(e,t){e.liveConsumers||(e.liveConsumers=new Set);let n=e.liveConsumers.size===0;if(e.liveConsumers.add(t),n){if(e.producers&&e.producers.length>0)for(let r of e.producers)vo(r,e);if(e.watched)try{e.watched.call(e.wrapper)}catch(r){console.error(r)}}}function Xe(e,t){if(e.liveConsumers&&(e.liveConsumers.delete(t),e.liveConsumers.size===0)){if(e.producers&&e.producers.length>0)for(let n of e.producers)Xe(n,e);if(e.unwatched)try{e.unwatched.call(e.wrapper)}catch(n){console.error(n)}}}function Wn(e){if(re)throw new Error("Signal read during notification phase");if(U===null)return;let t=U,n=t.nextProducerIndex++;n<t.producers.length&&t.producers[n]!==e&&Un(t)&&Xe(t.producers[n],t),t.producers[n]!==e&&(t.producers[n]=e,Un(t)&&vo(e,t)),t.producerLastReadVersions[n]=e.version}function Un(e){return e.consumerIsAlwaysLive||e.liveConsumers&&e.liveConsumers.size>0}function Eo(e){if(!e.liveConsumers||e.liveConsumers.size===0)return;let t=re;re=!0;try{for(let n of e.liveConsumers)n.dirty||ea(n)}finally{re=t}}function ea(e){e.dirty=!0,Eo(e),e.consumerMarkedDirty.call(e.wrapper||e)}function jt(e){if(!(!e.dirty&&e.lastCleanEpoch===Ce)){if(!e.producerMustRecompute()&&!ta(e)){e.dirty=!1,e.lastCleanEpoch=Ce;return}e.producerRecomputeValue(),e.dirty=!1,e.lastCleanEpoch=Ce}}function ta(e){for(let t=0;t<e.producers.length;t++){let n=e.producers[t],r=e.producerLastReadVersions[t];if(r!==n.version||(jt(n),r!==n.version))return!0}return!1}function Hn(e){e&&(e.nextProducerIndex=0);let t=U;return U=e,t}function qn(e,t){if(U=t,!!e){if(Un(e))for(let n=e.nextProducerIndex;n<e.producers.length;n++)Xe(e.producers[n],e);for(;e.producers.length>e.nextProducerIndex;)e.producers.pop(),e.producerLastReadVersions.pop()}}var Rt=class{constructor(t,n){this.__value=t,this.version=0,this.lastCleanEpoch=Ce,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.liveConsumers=void 0,this.consumerAllowSignalWrites=!0,this.consumerIsAlwaysLive=!1,this.producerMustRecompute=So,this.producerRecomputeValue=Tt,this.consumerMarkedDirty=Tt,this.wrapper=this,this.__isSignal=!0,this.__equal=n?.equals||Ao,this.watched=n?.[Vn],this.unwatched=n?.[zn]}get(){return Wn(this),this.__value}peek(){return this.__value}set(t){if(re)throw new Error("Signal write during notification phase");this.__equal.call(this,this.__value,t)||(this.__value=t,this.version++,Ce++,Ee!==null?Co(this):Eo(this))}};function Co(e){let t=re;re=!0;try{if(!e.liveConsumers)return;for(let n of e.liveConsumers)n.dirty||(n.dirty=!0,n.__isWatcher?Ee.add(n):Co(n))}finally{re=t}}var Dn=Symbol("unset"),Bn=Symbol("computing"),xt=Symbol("errored"),Qe=class{constructor(t,n){this.__fn=t,this.__value=Dn,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||Ao,this.watched=n?.[Vn],this.unwatched=n?.[zn];let r=this;this.producerMustRecompute=function(){return r.__value===Dn||r.__value===Bn},this.producerRecomputeValue=function(){if(r.__value===Bn)throw new Error("Detected cycle in computations.");let o=r.__value;r.__value=Bn;let i=Hn(r),s,a=!1;try{s=r.__fn.call(r.wrapper)}catch(l){s=xt,r.__error=l,a=!0}finally{qn(r,i)}if(!a&&(o!==Dn&&o!==xt)&&r.__equal.call(r.wrapper,o,s)){r.__value=o;return}r.__value=s,r.version++},this.consumerMarkedDirty=Tt}get(){if(jt(this),Wn(this),this.__value===xt)throw this.__error;return this.__value}peek(){if(jt(this),this.__value===xt)throw this.__error;return this.__value}},Ot=class{constructor(t){this.__notify=t,this.version=0,this.lastCleanEpoch=Ce,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.nextProducerIndex=0,this.liveConsumers=void 0,this.consumerAllowSignalWrites=!1,this.consumerIsAlwaysLive=!0,this.producerMustRecompute=So,this.producerRecomputeValue=Tt,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=Hn(this);try{for(let r of t)Wn(r),r.__isComputed&&jt(r)}finally{qn(this,n)}this.dirty=!1}unwatch(...t){for(let n=this.producers.length-1;n>=0;n--)t.includes(this.producers[n])&&(Xe(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=Hn(this),r;try{r=t()}finally{qn(this,n)}return this.dirty=!1,r}dispose(){for(let t of this.producers)Xe(t,this);this.producers=[],this.producerLastReadVersions=[],this.__notify=null}},Vn=Symbol("watched"),zn=Symbol("unwatched");function na(e){let t=U;U=null;try{return e()}finally{U=t}}function ra(e){return e.producers.slice()}function oa(e){return e.liveConsumers?[...e.liveConsumers]:[]}function ia(e){return!!e.liveConsumers&&e.liveConsumers.size>0}function sa(e){return e.producers.length>0}function aa(){return U&&U.__isComputed?U:null}function ca(e){$n++,Ee===null&&(Ee=new Set);try{e()}finally{if($n--,$n===0){let t=Ee;Ee=null;for(let n of t)n.__fire()}}}var Ze={State:Rt,Computed:Qe,subtle:{Watcher:Ot,untrack:na,introspectSources:ra,introspectSinks:oa,hasSinks:ia,hasSources:sa,currentComputed:aa,watched:Vn,unwatched:zn}};function la(e,t){return new Rt(e,t)}function ua(e,t){return new Qe(e,t)}function fa(e){return!!(e&&typeof e=="object"&&e.__isSignal===!0)}function da(e){let t=!1,n=!1,r=new Qe(e),o=new Ot(()=>{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())}}Bt();function Go(e,t){let n=e&&e[v]?e:null;return n?Ft(n,t):t()}var cr=new WeakMap,lr=new WeakMap,Ut=Symbol.for("webjs.instance"),M=null;function Wt(e){return e?e.nodeType===11&&e.host?e.host:e:null}function fr(e,t){let n=e.__commitOwner,r=M;n&&(M=n);try{t()}finally{M=r}}function Oe(e,t){let n=t,r=n[T];n[T]=!0;let o=M;M=t;try{let i=n[Ut];if(P(e)){let s=e;if(i&&i.strings===s.strings){je(i,s.values);return}i&&Yo(i,t);let a=t.firstChild;a&&a.nodeType===8&&a.data==="webjs-hydrate"&&a.remove(),n[Ut]=null;let c=Pa(s,t);n[Ut]=c;return}if(i&&Yo(i,t),n[Ut]=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{M=o,n[T]=r,r||ar(n)}}function Vt(e){let{strings:t}=e,n=cr.get(t);if(n)return n;let r=[],o="",i="text",s="",a=0,c="",l=0,u=null,f="",d="";for(let g=0;g<t.length;g++){let b=t[g];for(let y=0;y<b.length;y++){let h=b[y];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"&&(d="")):/\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"&&(d="")):!/\s/.test(h)&&h!=="/"&&(i="attr-name",s=h,a=o.length-1);break;case"rawtext":o+=h,d=(d+h.toLowerCase()).slice(-9),(d.endsWith("<\/script>")||d.endsWith("</style>"))&&(i="text",d="",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 W=u.firstPartIdx,w=[];for(let x=W;x<r.length;x++)(r[x].kind==="noop"||r[x].kind==="attr-mixed")&&w.push(x);let L=[],Se=t[w[0]],ve=Se.lastIndexOf(c);L.push(ve>=0?Se.slice(ve+1):Se);for(let x=1;x<w.length;x++)L.push(t[w[x]]);let E=t[w[w.length-1]+1],ze=E.indexOf(c);L.push(ze>=0?E.slice(0,ze):E),r[W]={kind:"attr-mixed",path:[],name:u.name,statics:L,group:w};for(let x=1;x<w.length;x++)r[w[x]]={kind:"noop",path:[],mixedAnchor:W};u=null}i="in-tag",s=""}break}}if(g<t.length-1){let y=r.length;if(i==="comment"){l=0,r.push({kind:"noop",path:[]});continue}if(i==="rawtext"){d="",r.push({kind:"noop",path:[]});continue}if(i==="text")o+=`<!--${C}${y}-->`,r.push({kind:"child",path:[]});else if(i==="in-tag"){let h=`data-${C}${y}`;o+=`${h}=""`,r.push({kind:"element",path:[]})}else if(i==="after-eq"){let h=s[0],W=s.slice(1);if(Ke(h)){o=o.slice(0,a);let w=xn[h],L=`data-${C}${y}`;o+=`${L}=""`,r.push({kind:w,path:[],name:W})}else{o=o.slice(0,a);let w=`data-${C}${y}`;o+=`${w}=""`,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-${C}${y}`;o+=`${h}=""`,u={name:s,firstPartIdx:y},r.push({kind:"noop",path:[]}),i="skip-attr"}else i==="skip-attr"&&r.push({kind:"noop",path:[]})}}let p=document.createElement("template");p.innerHTML=o,Ta(p.content,r);let m=ja(p.content,r);return n={templateEl:p,parts:r,formActions:m},cr.set(t,n),n}function Ta(e,t){let n=e.querySelectorAll("slot");for(let r of n){r.setAttribute(N,"");let o=t.length;r.setAttribute(`data-${C}${o}`,""),t.push({kind:"slot",path:[]})}}function ja(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(C)){let l=Number(c.slice(C.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-${C}`)){let d=Number(f.name.slice(`data-${C}`.length));t[d]&&t[d].kind!=="child"&&(t[d].path=n.slice(),u.push({idx:d,kind:t[d].kind,name:t[d].name||""})),l.push(f.name)}if(c.localName==="form"||c.localName==="button"||c.localName==="input"){let f=Ra(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 Ra(e,t,n){let r=e.localName==="form",o=r?"action":"formaction",i=r?"method":"formmethod",s=r?"enctype":"formenctype",a=t.filter(b=>b.kind==="attr"&&b.name.toLowerCase()===o);if(!a.length)return null;let c=[],l=[],u=[],f=r?[]:t.filter(b=>b.name.toLowerCase()==="name"&&(b.kind==="attr"||b.kind==="attr-mixed"||b.kind==="bool")).map(b=>({i:b.idx,kind:b.kind})),d=!r&&e.hasAttribute("name"),p=!r&&e.hasAttribute("form"),m=!r&&e.hasAttribute("value"),g=r?[]:t.filter(b=>b.name.toLowerCase()==="value"&&(b.kind==="attr"||b.kind==="attr-mixed"||b.kind==="bool")).map(b=>({i:b.idx,kind:b.kind}));for(let b of t){let y=String(b.name).toLowerCase();if(b.kind==="prop"){r?(y==="method"||y==="enctype"||y==="encoding")&&u.push(b.name):On(y)&&u.push(b.name);continue}if(y!==i&&y!==s||b.kind!=="attr"&&b.kind!=="attr-mixed"&&b.kind!=="bool")continue;let h=n[b.idx],W={i:b.idx,kind:b.kind};b.kind==="attr-mixed"&&(W.statics=h.statics||[],W.group=h.group||[]),(y===i?c:l).push(W)}return{isForm:r,tag:e.localName,actionIdxs:a.map(b=>b.idx),duplicateAction:a.length>1,staticAction:e.getAttribute(o)!=null,authoredName:d,authoredValue:m,authoredForm:p,propAttrs:u,nameParts:f,valueParts:g,staticMethod:e.getAttribute(i),staticEnctype:e.getAttribute(s),methodParts:c,enctypeParts:l}}function ot(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(Rn(Te(n[l]),s,o.tag)){i=l;break}let a=t[i];if(!a||!a.el)continue;let c=Te(n[i]);if(o.isForm)yo(a.el,c,Ht(o.methodParts,o.staticMethod,n),Ht(o.enctypeParts,o.staticEnctype,n),o);else{let l=u=>u.some(f=>f.kind==="bool"?!!Te(n[f.i]):!0);La(a.el,c,o,l(o.nameParts),l(o.valueParts),Ht(o.methodParts,o.staticMethod,n),Ht(o.enctypeParts,o.staticEnctype,n))}}}function Oa(e){(lr.has(e)||e.getAttribute("name")===O)&&(e.getAttribute("name")===O&&e.removeAttribute("name"),e.removeAttribute("value"),lr.delete(e))}function La(e,t,n,r,o,i,s){let a=typeof t=="function"?jn(t):null;if(!a){typeof t=="function"&&Ln(null,e.localName),Oa(e),go(e,i,s,n.propAttrs);return}fo(n.duplicateAction,e.localName),po(n.propAttrs,e.localName),n.staticAction&&lo(e.localName),(n.authoredValue||o)&&co(e.localName),(n.authoredName||r)&&so(e.getAttribute("name")||O,e.localName,!1),(n.authoredForm||e.hasAttribute("form"))&&uo(e.localName),ao(e.localName,e.getAttribute("type"));let c=bo(e.localName,i,s);e.removeAttribute("formaction"),e.setAttribute("name",O),e.setAttribute("value",a),Ye(e,"formmethod",i,c.formMethod),Ye(e,"formenctype",s,c.formEnctype),lr.set(e,a)}function Pa(e,t){let{templateEl:n,parts:r,formActions:o}=Vt(e),i=n.content.cloneNode(!0),s=document.createComment(`${C}s`),a=document.createComment(`${C}e`),c=r.map(f=>zt(f,i)),l=[];for(let f=0;f<e.values.length;f++)K(c[f],e.values[f],void 0,e.values),l.push(e.values[f]);ot(o,c,e.values),t.replaceChildren(s,...i.childNodes,a);let u=t.nodeType===1&&t[v]?t:null;for(let f of c)f.kind==="slot"&&(u&&f.slotEl&&(f.slotEl[It]=u),K(f,void 0,void 0,[]));return{strings:e.strings,bound:c,lastValues:l,startNode:s,endNode:a}}function zt(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}`)}var Ko=Symbol("webjs.commitFailed");function je(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(Object.is(r,e.lastValues[n]))continue;let o=e.bound[n],i=o.mixedAnchor;try{o.kind==="noop"&&i!=null?K(e.bound[i],t[i],e.lastValues[i],t):K(o,r,e.lastValues[n],t)}catch(s){throw e.lastValues[n]=Ko,o.kind==="noop"&&i!=null&&(e.lastValues[i]=Ko),s}e.lastValues[n]=r}ot(cr.get(e.strings)?.formActions??null,e.bound,t)}function Yo(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=nt(n.slotEl);r&&zo(r,n.slotEl)}}t.replaceChildren()}function Ht(e,t,n){for(let r of e){if(r.kind==="bool")return Te(n[r.i])?"":$;if(r.kind==="attr"){let a=Te(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(Te(n[i[a]])??""),s+=o[a+1]||"";return s}return t??$}function Te(e){return At(e)?e.value:e}function K(e,t,n,r){if(At(t)){let o=t.value;if(e.kind==="prop"&&e.el[e.name]===o||e.kind==="attr"&&e.el.getAttribute(e.name)===String(o)||e.kind==="bool"&&e.el.hasAttribute(e.name)===!!o)return;t=o}switch(e.kind){case"child":Fa(e,t);break;case"attr":{t==null||t===!1?e.el.removeAttribute(e.name):Rn(t,e.name,e.el.localName)||(Ge(t,e.name,e.el.localName),e.el.setAttribute(e.name,String(t)));break}case"prop":ho(t,e.name,e.el.localName),e.el[e.name]=t;break;case"bool":Ge(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":Ia(e,t);break;case"attr-mixed":{let o=e,i=o.statics[0];for(let s=0;s<o.group.length;s++){let a=r?r[o.group[s]]:t;Ge(a,e.name,e.el.localName),i+=String(a??""),i+=o.statics[s+1]||""}e.el.setAttribute(e.name,i);break}case"slot":{if(e.applied)break;let o=e.slotEl,i=()=>{let a=nt(o);if(!a){e.applied=!0;return}if(!a.contains(o)){a.isConnected?queueMicrotask(i):e.applied=!0;return}if(e.applied=!0,Ma(o))return;let c=document.createDocumentFragment();for(;o.firstChild;)c.appendChild(o.firstChild);o[tt]=c,queueMicrotask(()=>Z(a))},s=nt(o);s&&s.contains(o)?i():queueMicrotask(i);break}case"noop":break}}function nt(e){let t=e[It];if(t&&t.isConnected)return t;let n=e.parentElement;for(;n;){if(n[v])return n;n=n.parentElement}return null}function Ma(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 Ia(e,t){let n=e,r=Et(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 Fa(e,t){return Ka(e,t),z(e,t)}function z(e,t){return Go(e.marker&&e.marker.parentNode,()=>$a(e,t))}function $a(e,t){let n=e.marker;if(Pn(t)){se(e);let o=String(t.value??""),i=document.createElement("template");i.innerHTML=o;let s=[...i.content.childNodes],a=document.createDocumentFragment();for(let c of s)a.appendChild(c);n.parentNode?.insertBefore(a,n),e.child=s;return}if(St(t)){let o=t,i=e.__keyedKey;i!==void 0&&!Object.is(i,o.key)&&se(e),e.__keyedKey=o.key,z(e,o.value);return}if(vt(t)){let o=t,i=e.__guardDeps,s=o.deps;if(i!==void 0&&(Array.isArray(i)&&Array.isArray(s)?za(i,s):Object.is(i,s)))return;let a=Array.isArray(s)?s.slice():s;z(e,o.fn()),e.__guardDeps=a;return}if(Mn(t)){se(e);let o=t.template;if(o&&o.content){let i=o.content.cloneNode(!0),s=[...i.childNodes];n.parentNode?.insertBefore(i,n),e.child=s}return}if(Et(t))return;if(Ct(t))return Ya(e,t.value);if(Nt(t))return Ga(e,t.args);if(kt(t))return Ja(e,t.signal);if(In(t))return Xa(e,t);if(Fn(t))return Qa(e,t);if(_t(t)){if(e.child&&e.child.kind==="repeat"){Ua(e,t);return}se(e);let o={kind:"repeat",map:new Map};e.child=o,Ba(n,o,t);return}if(Array.isArray(t)){if(e.child&&e.child.kind==="array"){Wa(e,t);return}se(e);let o={kind:"array",items:[]};e.child=o,qa(n,o,t);return}if(e.child){let o=e.child;if(o.kind==="repeat")Jo(o),e.child=void 0;else if(o.kind==="array")Qo(o),e.child=void 0;else if(o.kind==="async-stream")ni(o),e.child=void 0;else if("strings"in e.child){let i=e.child;if(P(t)&&i.strings===t.strings){je(i,t.values);return}Re(i.startNode,i.endNode),e.child=void 0}else{for(let i of e.child)i.parentNode&&i.parentNode.removeChild(i);e.child=void 0}}if(t==null||t===!1||t===!0)return;if(P(t)){let o=t,{templateEl:i,parts:s,formActions:a}=Vt(o),c=i.content.cloneNode(!0),l=document.createComment(`${C}s`),u=document.createComment(`${C}e`),f=s.map(m=>zt(m,c)),d=[];for(let m=0;m<o.values.length;m++)K(f[m],o.values[m],void 0,o.values),d.push(o.values[m]);ot(a,f,o.values);let p=[l,...c.childNodes,u];n.parentNode?.insertBefore(Da(p),n);for(let m of f)m.kind==="slot"&&K(m,void 0,void 0,[]);e.child={strings:o.strings,bound:f,lastValues:d,startNode:l,endNode:u};return}let r=document.createTextNode(String(t));n.parentNode?.insertBefore(r,n),e.child=[r]}function Da(e){let t=document.createDocumentFragment();for(let n of e)t.appendChild(n);return t}function Re(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 dr(e){let{templateEl:t,parts:n,formActions:r}=Vt(e),o=t.content.cloneNode(!0),i=document.createComment(`${C}s`),s=document.createComment(`${C}e`),a=n.map(u=>zt(u,o)),c=[];for(let u=0;u<e.values.length;u++)K(a[u],e.values[u],void 0,e.values),c.push(e.values[u]);ot(r,a,e.values);for(let u of a)u.kind==="slot"&&K(u,void 0,void 0,[]);let l=document.createDocumentFragment();for(l.appendChild(i);o.firstChild;)l.appendChild(o.firstChild);return l.appendChild(s),{inst:{strings:e.strings,bound:a,lastValues:c,startNode:i,endNode:s},frag:l}}function rt(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 Ba(e,t,n){let{items:r,keyFn:o,templateFn:i}=n,s=e.parentNode;if(!s)return;let a=document.createDocumentFragment();for(let c=0;c<r.length;c++){let l=o(r[c],c),u=i(r[c],c);if(!P(u))continue;let{inst:f,frag:d}=dr(u);t.map.set(l,f),a.appendChild(d)}s.insertBefore(a,e)}function Ua(e,t){let n=e.marker,r=n.parentNode;if(!r)return;let o=e.child,{items:i,keyFn:s,templateFn:a}=t,c=new Map;try{for(let l=0;l<i.length;l++){let u=s(i[l],l),f=a(i[l],l);if(!P(f))continue;let d=o.map.get(u);if(d&&d.strings===f.strings)je(d,f.values),ur(d.startNode,d.endNode,r,n),c.set(u,d),o.map.delete(u);else{d&&(o.map.delete(u),rt(d),Re(d.startNode,d.endNode));let{inst:p,frag:m}=dr(f);r.insertBefore(m,n),c.set(u,p)}}for(let[l,u]of[...o.map]){o.map.delete(l);try{rt(u)}finally{Re(u.startNode,u.endNode)}}o.map=c}catch(l){for(let[u,f]of c)o.map.set(u,f);throw l}}function Jo(e){for(let[t,n]of[...e.map]){e.map.delete(t);try{rt(n)}finally{Re(n.startNode,n.endNode)}}e.map.clear()}function Ha(e){return e.type==="tpl"?e.inst.startNode:e.type==="text"?e.node:null}function qt(e){e.type==="tpl"?(rt(e.inst),Re(e.inst.startNode,e.inst.endNode)):e.type==="text"&&e.node.parentNode?.removeChild(e.node)}function Xo(e){if(P(e)){let{inst:t,frag:n}=dr(e);return{item:{type:"tpl",inst:t},frag:n}}if(e!=null&&e!==!1&&e!==!0){let t=document.createTextNode(String(e));return{item:{type:"text",node:t},frag:t}}return{item:{type:"empty"},frag:null}}function qa(e,t,n){let r=e.parentNode;if(!r)return;let o=document.createDocumentFragment(),i=[];for(let s of n){let{item:a,frag:c}=Xo(s);c&&o.appendChild(c),i.push(a)}r.insertBefore(o,e),t.items=i}function Wa(e,t){let n=e.marker,r=n.parentNode;if(!r)return;let o=e.child,i=o.items,s=[],a=0;try{for(let c=0;c<t.length;c++){let l=t[c],u=i[c];if(P(l)){let p=l;if(u&&u.type==="tpl"&&u.inst.strings===p.strings){je(u.inst,p.values),s.push(u),a=c+1;continue}}else if(l!=null&&l!==!1&&l!==!0){if(u&&u.type==="text"){let p=String(l);u.node.data!==p&&(u.node.data=p),s.push(u),a=c+1;continue}}else{u&&qt(u),s.push({type:"empty"}),a=c+1;continue}let{item:f,frag:d}=Xo(l);d&&r.insertBefore(d,Va(i,c,n)),s.push(f),u&&qt(u),a=c+1}for(let c=t.length;c<i.length;c++)qt(i[c]),a=c+1;o.items=s}catch(c){throw o.items=s.concat(i.slice(a)),c}}function Va(e,t,n){for(let r=t;r<e.length;r++){let o=Ha(e[r]);if(o&&o.parentNode)return o}return n}function Qo(e){for(let t of e.items)qt(t);e.items=[]}function ur(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 za(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 se(e){let t=e;if(t.__untilState&&(t.__untilState.aborted=!0,t.__untilState=void 0),t.__watchSub&&Zo(t),!e.child)return;let n=e.child;if(n.kind==="repeat")Jo(n);else if(n.kind==="array")Qo(n);else if(n.kind==="async-stream")ni(n);else if("strings"in n){let r=e.child;rt(r),Re(r.startNode,r.endNode)}else for(let r of e.child)r.parentNode&&r.parentNode.removeChild(r);e.child=void 0}function Ka(e,t){let n=e;n.__untilState&&!Nt(t)&&(n.__untilState.aborted=!0,n.__untilState=void 0),n.__guardDeps!==void 0&&!vt(t)&&(n.__guardDeps=void 0),n.__cacheMap&&!Ct(t)&&(n.__cacheMap=void 0),n.__keyedKey!==void 0&&!St(t)&&(n.__keyedKey=void 0),n.__watchSub&&!kt(t)&&Zo(n)}function Ya(e,t){let n=e.marker,r=e,o=r.__cacheMap;o||(o=new Map,r.__cacheMap=o);let i=e.child;if(i&&"strings"in i){let a=i;if(P(t)&&a.strings===t.strings){je(a,t.values);return}let c=document.createDocumentFragment();ur(a.startNode,a.endNode,c,null),o.set(a.strings,{inst:a,holder:c}),e.child=void 0}if(P(t)){let a=t,c=o.get(a.strings);if(c){o.delete(a.strings),e.child&&se(e),ur(c.inst.startNode,c.inst.endNode,n.parentNode,n),je(c.inst,a.values),e.child=c.inst;let l=new Set;for(let u=c.inst.startNode.nextSibling;u&&u!==c.inst.endNode;u=u.nextSibling){if(u.nodeType!==1)continue;let f=u;if(f.matches("slot[data-webjs-light]")){let d=nt(f);d&&l.add(d)}for(let d of f.querySelectorAll("slot[data-webjs-light]")){let p=nt(d);p&&l.add(p)}}for(let u of l)Z(u);return}}z(e,t)}function Ga(e,t){let n=e;M&&(n.__commitOwner=Wt(M));let r=n.__untilState,o=n.__untilArgs,i=(d,p)=>!!(Object.is(d,p)||P(d)&&P(p)&&d.strings===p.strings),a=o&&o.length===t.length&&o.every((d,p)=>i(d,t[p]))&&r?r.highestResolved:1/0;r&&(r.aborted=!0),n.__untilArgs=t.slice();let c={aborted:!1,highestResolved:a};n.__untilState=c;let l=-1,u;for(let d=0;d<t.length;d++){let p=t[d];if(!p||typeof p.then!="function"){l=d,u=p;break}}l!==-1&&l<=c.highestResolved?(z(e,u),c.highestResolved=l):l===-1&&!n.__untilEverRendered&&z(e,""),n.__untilEverRendered=!0;let f=Math.min(l===-1?t.length:l,c.highestResolved);for(let d=0;d<f;d++){let p=t[d];!p||typeof p.then!="function"||Promise.resolve(p).then(m=>{if(!c.aborted&&!(d>=c.highestResolved)){try{fr(e,()=>z(e,m))}catch(g){pr(e,g);return}c.highestResolved=d}},()=>{})}}function pr(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 Ja(e,t){let n=e;if(M&&(n.__commitOwner=Wt(M)),n.__watchSig===t&&n.__watchSub){let i;n.__watchSub.observe(()=>{i=t.get()}),z(e,i);return}n.__watchSub&&(n.__watchSub.dispose(),n.__watchSub=void 0),n.__watchSig=t;let r=new Ze.subtle.Watcher(()=>{queueMicrotask(()=>{if(n.__watchSub!==r)return;let i;try{r.observe(()=>{i=t.get()}),fr(e,()=>z(e,i))}catch(s){pr(e,s)}})});n.__watchSub=r;let o;r.observe(()=>{o=t.get()}),z(e,o)}function Zo(e){e.__watchSub&&(e.__watchSub.dispose(),e.__watchSub=void 0,e.__watchSig=void 0)}function Xa(e,t){let n=e;M&&(n.__commitOwner=Wt(M));let r=e.child;if(r&&r.kind==="async-stream"&&r.mode==="append"&&r.iterable===t.iterable)return;se(e);let o=t.iterable[Symbol.asyncIterator](),i={kind:"async-stream",mode:"append",aborted:!1,iterable:t.iterable,iterator:o,nodes:[]};e.child=i,ei(i,e,t)}function Qa(e,t){let n=e;M&&(n.__commitOwner=Wt(M));let r=e.child;if(r&&r.kind==="async-stream"&&r.mode==="replace"&&r.iterable===t.iterable)return;se(e);let o=t.iterable[Symbol.asyncIterator](),i={kind:"async-stream",mode:"replace",aborted:!1,iterable:t.iterable,iterator:o,nodes:[]};e.child=i,ei(i,e,t)}async function ei(e,t,n){let r=t.marker,o=0;for(;!e.aborted;){let i,s;try{if(i=await e.iterator.next(),e.aborted||i.done)break;s=n.mapper?n.mapper(i.value,o):i.value}catch(a){typeof console<"u"&&console.error("[webjs] asyncStream error:",a);return}try{fr(t,()=>{let a=ti(s);Go(r.parentNode,()=>{if(e.mode==="replace"){for(let l of e.nodes)l.parentNode&&l.parentNode.removeChild(l);e.nodes=[]}let c=document.createDocumentFragment();for(let l of a)c.appendChild(l);r.parentNode?.insertBefore(c,r),e.nodes.push(...a)})})}catch(a){e.aborted=!0;try{e.iterator.return?.()?.catch?.(()=>{})}catch{}pr(t,a);return}o++}}function ti(e){if(e==null||e===!1||e===!0)return[];if(P(e)){let t=e,{templateEl:n,parts:r,formActions:o}=Vt(t),i=n.content.cloneNode(!0),s=r.map(a=>zt(a,i));for(let a=0;a<t.values.length;a++)K(s[a],t.values[a],void 0,t.values);ot(o,s,t.values);for(let a of s)a.kind==="slot"&&K(a,void 0,void 0,[]);return[...i.childNodes]}if(Array.isArray(e)){let t=[];for(let n of e)t.push(...ti(n));return t}return[document.createTextNode(String(e))]}function ni(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 ri(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 Za(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function oi(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||Za(r))===t)return{propName:r,def:i}}}var ii=null;function Kt(e){ii=e||null}function ec(){return ii||void 0}Je();var si=Symbol.for("webjs:registry"),ai=Symbol.for("webjs:classToTag"),Yt=globalThis,Y=Yt[si]||(Yt[si]=new Map),ci=Yt[ai]||(Yt[ai]=new WeakMap),Gt=typeof window<"u"&&typeof customElements<"u";function hr(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=Y.get(e);r?(r.cls=t,r.lazy=n):Y.set(e,{cls:t,moduleUrl:null,lazy:n,tag:e}),ci.set(t,e)}if(Gt){let e=customElements.define.bind(customElements);customElements.define=function(t,n,r){customElements.get(t)||e(t,n,r),hr(t,n)}}if(!Gt){let e=globalThis;e.customElements||(e.customElements={define(t,n){hr(t,n)},get(t){return Y.get(t)?.cls},upgrade(){},whenDefined(t){let n=Y.get(t);return Promise.resolve(n?.cls)}})}function mr(e,t){Gt?customElements.define(e,t):hr(e,t)}function tc(e,t){if(Gt)return;let n=Y.get(e);if(n){n.moduleUrl=t;return}Y.set(e,{cls:null,moduleUrl:t,lazy:!1,tag:e})}function nc(e){return Y.get(e)?.cls}function rc(e){return Y.get(e)?.moduleUrl||null}function oc(e){return Y.get(e)?.lazy===!0}function Le(e){return ci.get(e)}function ic(){return[...Y.keys()]}at();Bt();var bi=typeof window<"u"&&typeof HTMLElement<"u";function gc(e,t){return e!==t}function wc(e){try{return String(e)}catch{return Object.prototype.toString.call(e)}}function pi(e,t,n){if(typeof console>"u"||!console.warn)return;let r=Le(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 _c(e,t,n,r){if(typeof console>"u"||!console.warn)return;let o=Le(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 Ac(){return{states:new Set,shadowRoot:null,form:null,labels:[],role:"",willValidate:!0,validity:{},validationMessage:"",setFormValue(){},setValidity(){},checkValidity(){return!0},reportValidity(){return!0}}}var Jt=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=Ac(),this.__internals}},Sc=["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 Sc){let t="aria-"+e.slice(4).toLowerCase();Object.defineProperty(Jt.prototype,e,{configurable:!0,get(){return this.getAttribute(t)},set(n){n==null?this.removeAttribute(t):this.setAttribute(t,String(n))}})}var vc=bi?HTMLElement:Jt,yi=Symbol("webjs.factoryProps"),hi=new WeakSet,Pe=class e extends vc{static shadow=!1;static hydrate=void 0;static properties={};static styles=null;static register(t){mr(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||mi(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(hi.has(t))return;let n=t;for(;n&&n!==e;){if(Object.hasOwn(n,"properties")&&!Object.hasOwn(n,yi)){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)}hi.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||gc)(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||mi(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),pi(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),_c(this,t,o,a&&a.message)}s&&this.setAttribute(o,i)}else wt(n)?(this.removeAttribute(o),pi(this,t,o)):this.setAttribute(o,String(n))}finally{this.__reflectingAttribute=!1}}}connectedCallback(){if(!bi)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=Ec(r.slice(16));try{this[i]=ye(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:Nn(r)?[r]:[];if(o.length){if(n){let i=this.shadowRoot.querySelector("style");i&&i.remove()}kn(this._renderRoot,o)}}else this._renderRoot=this,t.styles&&console.warn(`[webjs] <${Le(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().`),sr(this)?Uo(this):this.__isHydrating()||this.hasAttribute("data-wj-serialized")||Vo(this)?(this.removeAttribute("data-wj-serialized"),Q(this),Oo(this)):Ro(this),Wo(this),$o(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),Bo(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=oi(this.constructor,t);if(o===void 0)return;let{propName:i,def:s}=o,a=ri(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,Kt(this.__renderAbort?this.__renderAbort.signal:null);try{let o=this.update(t);o&&typeof o.then=="function"&&(r=o)}catch(o){this._handleRenderError(o)}finally{Kt(null)}if(!r){for(let o of this.__controllers)o.hostUpdated&&o.hostUpdated();n=!0}}}catch(o){console.error("[webjs] lifecycle hook threw during update phase:",o)}finally{this._isUpdating=!1,(n||r)&&(this._changedProperties=new Map)}if(r){let o=this.__renderToken;this.__pendingAsyncCommits=(this.__pendingAsyncCommits||0)+1;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(wc(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 Ze.subtle.Watcher(()=>{this._connected&&this.requestUpdate()}));let n;if(this.__signalWatcher.observe(()=>{n=this.render()}),n&&typeof n.then=="function")return this._commitAsync(n);Oe(n,this._renderRoot)}_commitAsync(t){let n=this.__renderToken;if(this.__firstRendered&&this._overridesRenderFallback())try{let r=this.renderFallback();r!==void 0&&Oe(r,this._renderRoot)}catch(r){console.error("[webjs] renderFallback() threw:",r)}return Promise.resolve(t).then(r=>{if(n===this.__renderToken)try{Oe(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!==Xt.prototype.renderFallback}_handleRenderError(t){console.error(`[webjs] render error in <${Le(this.constructor)||this.tagName?.toLowerCase()}>:`,t);try{let n=this.renderError(t);n!==void 0&&Oe(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 mi(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function Ec(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Xt(e){return new.target?Reflect.construct(Pe,arguments,new.target):class extends Pe{static properties=e;static[yi]=!0}}Object.setPrototypeOf(Xt,Pe);Xt.prototype=Pe.prototype;function Cc(e,t={}){return e&&typeof e=="object"&&!("call"in e)&&(t=e,e=void 0),{...e?{type:e}:{},...t}}gt();var gi=Symbol.for("webjs.notFound"),wi=Symbol.for("webjs.redirect"),_i=Symbol.for("webjs.forbidden"),Ai=Symbol.for("webjs.unauthorized");function Nc(){let e=new Error("webjs: notFound()");throw e.__webjs=gi,e}function kc(){let e=new Error("webjs: forbidden()");throw e.__webjs=_i,e}function xc(){let e=new Error("webjs: unauthorized()");throw e.__webjs=Ai,e}function Tc(e,t){let n=typeof t=="object"&&t!==null?t.status:t,r=new Error(`webjs: redirect(${e})`);throw r.__webjs=wi,r.url=e,r.status=typeof n=="number"?n:void 0,r}function jc(e){return!!e&&e.__webjs===gi}function Rc(e){return!!e&&e.__webjs===wi}function Oc(e){return!!e&&e.__webjs===_i}function Lc(e){return!!e&&e.__webjs===Ai}var Si=null;function Pc(){if(!Si)return"";try{return Si()||""}catch{return""}}var vi=null;function Mc(e){if(typeof e!="string"||!e||!vi)return e;try{return vi(e)||e}catch{return e}}Je();var Ju=Symbol.for("webjs.suspense");function Ic(e){return{_$webjsSuspense:!0,fallback:e.fallback,children:e.children}}function Fc(e){return!!e&&typeof e=="object"&&e._$webjsSuspense===!0}function $c(e,t={}){let n=t.reconnect!==!1,r=0,o=!1,i=null,s=[];function a(){o||(i=new WebSocket(Dc(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 Dc(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}`}at();var yr="application/vnd.webjs+json";async function Bc(e,t={}){let n=new Headers(t.headers||{});n.has("accept")||n.set("accept",yr);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 br(r),n.has("content-type")||n.set("content-type",yr));let o=await fetch(e,{...t,headers:n,body:r}),i=o.headers.get("content-type")||"",s=await o.text(),a=i.includes(yr)?s?ye(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}at();Zt();Zt();_r();en();var Zr=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 Yl(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 Gl(e,t,n){return e&&typeof e.get=="function"&&typeof e.set=="function"?Yl(e,t,n):new Zr(e,t)}Nr();Tr();var Jl="application/vnd.webjs+stream",Xl=1,Ql=2,Zl=3,Es=new Uint8Array(0);function eu(e,t){let n=t||Es,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 tu(){let e=Es;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 nu=Symbol.for("webjs.context");function ru(e){return{__context__:nu,name:e}}var En=class extends Event{constructor(t,n,r=!1){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.callback=n,this.subscribe=r}},eo=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()}},to=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 En(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 ou(){return typeof window<"u"}var ne={INITIAL:0,PENDING:1,COMPLETE:2,ERROR:3},no=class{constructor(t,{task:n,args:r,autoRun:o=!0}){this._host=t,this._taskFn=n,this._argsFn=r||(()=>[]),this._autoRun=o,this._status=ne.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=ne.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=ne.COMPLETE,this._error=void 0}catch(r){if(t.signal.aborted)return;this._error=r,this._status=ne.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 ne.INITIAL:return t.initial?.();case ne.PENDING:return t.pending?.();case ne.COMPLETE:return t.complete?.(this._value);case ne.ERROR:return t.error?.(this._error);default:return}}hostUpdate(){if(!this._autoRun||!ou())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{to as ContextConsumer,eo as ContextProvider,En as ContextRequestEvent,O as FORM_ACTION_FIELD,io as FORM_ACTION_ID_KEY,Xl as FRAME_CHUNK,Ql as FRAME_END,Zl as FRAME_ERROR,C as MARKER,Oi as SEED_MISS,Jl as STREAM_CONTENT_TYPE,Ze as Signal,Ic as Suspense,no as Task,ne as TaskStatus,Xt as WebComponent,wr as WebjsFrame,Ar as WebjsStream,ec as activeActionSignal,kn as adoptStyles,ic as allTags,Mc as asset,Xs as asyncAppend,Qs as asyncReplace,ca as batch,Gs as cache,ua as computed,$c as connectWS,nl as consumeStale,ru as createContext,tu as createFrameDecoder,Ys as createRef,Pc as cspNonce,Ts as css,fi as deserialize,Hi as disableClientRouter,da as effect,Br as enableClientRouter,eu as encodeFrame,oo as escapeAttr,Rs as escapeText,el as fetchMark,kc as forbidden,Vs as guard,xs as html,In as isAsyncAppend,Fn as isAsyncReplace,Nn as isCSS,Ct as isCache,Oc as isForbidden,vt as isGuard,St as isKeyed,oc as isLazy,At as isLive,jc as isNotFound,Rc as isRedirect,Et as isRef,_t as isRepeat,fa as isSignal,Fc as isSuspense,P as isTemplate,Mn as isTemplateContent,Lc as isUnauthorized,Pn as isUnsafeHTML,Nt as isUntil,kt as isWatch,Ws as keyed,qs as live,Wi as loadFrame,nc as lookup,rc as lookupModuleUrl,kr as markStale,qi as navigate,Nc as notFound,Gl as optimistic,ye as parse,xr as parseTagHeader,tc as primeModuleUrl,Cc as prop,Tc as redirect,Ks as ref,mr as register,tl as registerKeyTags,Oe as render,Sr as renderStream,_o as repeat,Vi as revalidate,Bc as richFetch,tn as scanSeeds,Qc as seedStats,ui as serialize,Kt as setActiveActionSignal,la as signal,br as stringify,js as stylesToString,Le as tagOf,Xc as takeSeed,zs as templateContent,xc as unauthorized,Hs as unsafeHTML,Js as until,Zs as watch};
1
+ var sc=Object.defineProperty;var w=(e,t)=>()=>(e&&(t=e(e=0)),t);var Zi=(e,t)=>{for(var n in t)sc(e,n,{get:t[n],enumerable:!0})};function Ut(e){return Object.prototype.hasOwnProperty.call(lo,e)}var lo,uo=w(()=>{lo=Object.freeze({"@":"event",".":"prop","?":"bool"})});function uc(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function es(e){return String(e).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}var fo=w(()=>{});function po(e){if(typeof e!="function")return null;let t=e[ts];return typeof t=="string"&&t?t:null}function Jn(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 ns(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 rs(e,t){let n=String(e||"").toLowerCase(),r=t==null?null:String(t).toLowerCase();if(fc(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 fc(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 os(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 is(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 ss(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 as(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 cs(e,t){let r=(e||[]).filter(o=>ho(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 ho(e){let t=String(e).toLowerCase();return t==="name"||t==="value"||t==="formaction"||t==="formmethod"||t==="formenctype"}function dc(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&&!us.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 Kt(e,t,n){if(Xn(e)&&wc(t))throw new Error(_c(t,n))}function ls(e,t,n){gc(t,n)&&Kt(e,t,n)}function mo(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 pc(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&&!us.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 hc(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 mc(e,t){let n=e!==V&&e!=null,r=t!==V&&t!=null;return pc(n?e:null,r?t:null),{method:n?null:"post",enctype:r?null:"multipart/form-data"}}function fs(e,t,n){let r=t!==V&&t!=null,o=n!==V&&n!=null;return dc(e,r?t:null,o?n:null),{formMethod:r?null:"post",formEnctype:o?null:"multipart/form-data"}}function ds(e,t,n,r,o){let i=typeof t=="function"?po(t):null;if(!i){typeof t=="function"&&mo(null,e.localName),yc(e,n,r,o.propAttrs);return}hc(o);let s=mc(n,r);e.removeAttribute("action"),qt(e,"method",n,s.method),qt(e,"enctype",r,s.enctype),bc(e,i)}function qt(e,t,n,r){if(r!==null){e.setAttribute(t,r);return}n!==V&&e.getAttribute(t)!==n&&e.setAttribute(t,n)}function bc(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 yc(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===V&&!i("method")&&e.removeAttribute("method"),n===V&&!i("enctype")&&e.removeAttribute("enctype")}function ps(e,t,n,r){let o=i=>(r||[]).some(s=>String(s).toLowerCase()===i);t===V&&!o("formmethod")&&e.removeAttribute("formmethod"),n===V&&!o("formenctype")&&e.removeAttribute("formenctype")}function gc(e,t){let n=String(e).toLowerCase();Ut(n[0])&&(n=n.slice(1));let r=String(t||"").toLowerCase();return n==="action"?r==="form":n==="formaction"?r==="button"||r==="input":!1}function Xn(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=>Xn(r,n)))}function wc(e){let t=String(e).toLowerCase();return Ut(t[0])&&(t=t.slice(1)),t==="action"||t==="formaction"}function _c(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,ts,us,V,we=w(()=>{uo();fo();I="__webjs_action",ts="$$webjsAction";us=new Set(["multipart/form-data","application/x-www-form-urlencoded"]);V=Symbol("webjs.attr.absent")});var _,S,k,M,_o,_e,Fe,So,bs,C,Ao,re,A,Se=w(()=>{_=Symbol("webjs.slot.state"),S="data-webjs-light",k="data-projection",M="actual",_o="fallback",_e=Symbol("webjs.slot.fallbackFrag"),Fe=Symbol("webjs.slot.templateOwner"),So="data-wj-slot-owner",bs=64,C=Symbol("webjs.slot.rendering"),Ao=Symbol("webjs.slot.intercepted"),re=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 Vt(e){return!!e[_]}function vo(e){let t=F(e);for(;e.firstChild;){let n=e.firstChild;t.authored.push(n),A.add(n),e.removeChild(n)}oe(t)}function oe(e){let t=e.assignedByName;t.clear();for(let n of e.authored)jc(t,Ae(e,n),n)}function Ae(e,t){let n=Gt(e,t);if(n)return D(n.getAttribute("name"));if(e.adoptedKey){let r=e.adoptedKey.get(t);if(r!==void 0)return r}return ys(t)}function xo(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(k)!==M||at(t,e,i))continue;let s=D(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),ys(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()}oe(t)}function D(e){return e==null||e===""||e==="default"?null:e}function ys(e){return e.nodeType!==1?null:D(e.getAttribute("slot"))}function jc(e,t,n){let r=e.get(t);r||(r=[],e.set(t,r)),r.push(n)}var Be=w(()=>{De();zt();$e();Se()});function gs(){ie||!z||(ie=Node.prototype.appendChild,Eo=Node.prototype.insertBefore,ve=Node.prototype.removeChild,ir=Node.prototype.replaceChild,To=Element.prototype.append,No=Element.prototype.prepend,Co=Element.prototype.replaceChildren,Yt=Object.getOwnPropertyDescriptor(Element.prototype,"innerHTML"),sr=Object.getOwnPropertyDescriptor(Node.prototype,"textContent"))}function He(e,t){let n=e[C];e[C]=!0;try{return t()}finally{e[C]=n,n||ar(e)}}function ko(e){if(!z)return;let t=e,n=F(e);n.backstop||(n.backstop=new MutationObserver(r=>Jt(e,n,r)),n.backstop.observe(e,{childList:!0,subtree:!1}),n.flipSensor=new MutationObserver(r=>ws(e,r)),n.flipSensor.observe(e,{attributes:!0,attributeFilter:["slot","name"],subtree:!0}))}function Jt(e,t,n){let r=e,o=r[re],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&&Lo(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 f=t.authored.indexOf(l);if(f===-1||e.contains(l))continue;A.has(l)&&l.parentNode==null&&!a.has(l)||(t.authored.splice(f,1),s=!0)}}s&&q(e)}function ar(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")])&&Jt(e,n,r)}function ws(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&&q(e)}function Ro(e){let t=e[_];t&&(t.backstop&&(Jt(e,t,t.backstop.takeRecords()),t.backstop.disconnect(),t.backstop=void 0),t.flipSensor&&(ws(e,t.flipSensor.takeRecords()),t.flipSensor.disconnect(),t.flipSensor=void 0))}function Oo(e){if(!z)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[re]){if(n.authored.indexOf(a)!==-1){s=!0;continue}o&&(!r||Lo(r,a))||!o&&i||(A.add(a),n.authored.push(a),s=!0)}s&&q(e)}var ie,Eo,ve,ir,To,No,Co,Yt,sr,cr=w(()=>{De();zt();$e();Xt();Be();Se();ie=null,Eo=null,ve=null,ir=null,To=null,No=null,Co=null,Yt=null,sr=null});function Lo(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 _s(e){let t=e,n=t[re];return(!n||!n.isConnected)&&(n||(n=e.ownerDocument.createElement("wj-slot-park"),n.setAttribute("hidden",""),n.style.display="none",t[re]=n),He(e,()=>ie.call(e,n))),n}function Ue(e){return e instanceof Node||!!(e&&typeof e=="object"&&e.ownerDocument&&e.ownerDocument.defaultView&&e instanceof e.ownerDocument.defaultView.Node)}function jo(e,t,n){if(n&&!Ue(t))return[e.ownerDocument.createTextNode(`${t}`)];if(!Ue(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);lr(e,r);for(let o of r)ve.call(t,o);return r}return lr(e,[t]),[t]}function lr(e,t){ct(e,t);for(let n of t){if(!Ue(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 ct(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 Po(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 Fo(e,t){let n=e[_];return n?at(n,e,t):!1}function at(e,t,n){for(let r=n;r&&r!==t;r=r.parentNode)if(e.authored.indexOf(r)!==-1)return!0;return!1}function Io(e,t){if(A.has(t))return!0;let n=t.parentNode;if(n==null)return!1;if(n===e||n===e[re])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 Mo(e,t){let n=[];for(let i of t)Ue(i)?i.nodeType===11?n.push({frag:i}):n.push({node:i}):n.push({text:`${i}`});for(let i of n)i.frag?ct(e,Array.from(i.frag.childNodes)):i.node&&lr(e,[i.node]);let r=e.ownerDocument.createDocumentFragment();for(let i of n)if(i.text!==void 0)ie.call(r,e.ownerDocument.createTextNode(i.text));else if(i.frag){let s=Array.from(i.frag.childNodes);lr(e,s);for(let a of s)ie.call(r,a)}else i.node&&(ct(e,[i.node]),ie.call(r,i.node));let o=Array.from(r.childNodes);ct(e,o);for(let i of o)ve.call(r,i);return o}function me(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);oe(t),q(e)}function Bo(e){if(!z)return;let t=e;if(t[Ao])return;gs(),t[Ao]=!0;let n=F(e);t.appendChild=function(r){if(t[C])return ie.call(this,r);let o=jo(e,r,!1);for(let i of o)A.add(i);return Po(n,o,null),me(e,n,o),r},t.insertBefore=function(r,o){if(t[C])return Eo.call(this,r,o);if(!Ue(r))throw new TypeError("Failed to execute insertBefore on the host: parameter 1 is not of type Node.");if(o!=null&&!Ue(o))throw new TypeError("Failed to execute insertBefore on the host: parameter 2 is not of type Node.");if(ct(e,r.nodeType===11?Array.from(r.childNodes):[r]),o!=null&&(n.authored.indexOf(o)===-1||!Io(e,o)))throw new DOMException("insertBefore: reference node is not an assigned child of this host","NotFoundError");if(r===o)return r;let i=jo(e,r,!1);for(let s of i)A.add(s);return Po(n,i,o||null),me(e,n,i),r},t.removeChild=function(r){if(t[C])return ve.call(this,r);let o=n.authored.indexOf(r);if(o===-1)return ve.call(this,r);if(!Io(e,r))throw new DOMException("removeChild: the node is not an assigned child of this host","NotFoundError");return n.authored.splice(o,1),me(e,n,[r]),r},t.replaceChild=function(r,o){if(t[C])return ir.call(this,r,o);if(n.authored.indexOf(o)===-1)return ir.call(this,r,o);if(!Ue(r))throw new TypeError("Failed to execute replaceChild on the host: parameter 1 is not of type Node.");if(ct(e,r.nodeType===11?Array.from(r.childNodes):[r]),!Io(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=jo(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),me(e,n,[...s,o]),o},t.append=function(...r){if(t[C])return To.apply(this,r);let o=Mo(e,r);for(let i of o)A.add(i);Po(n,o,null),me(e,n,o)},t.prepend=function(...r){if(t[C])return No.apply(this,r);let o=Mo(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),me(e,n,o)},t.replaceChildren=function(...r){if(t[C])return Co.apply(this,r);let o=Mo(e,r);for(let s of o)A.add(s);let i=n.authored;n.authored=o.slice(),me(e,n,[...i,...o])},Object.defineProperty(t,"innerHTML",{configurable:!0,get(){return Yt.get.call(this)},set(r){if(t[C]){Yt.set.call(this,r);return}let o=e.ownerDocument.createElement("div");Yt.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,me(e,n,[...s,...i])}}),Object.defineProperty(t,"textContent",{configurable:!0,get(){return sr.get.call(this)},set(r){if(t[C]){sr.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,me(e,n,[...i,...o])}})}var Ss,zt=w(()=>{De();$e();Xt();cr();Be();Se();Ss=new Set});function xe(e,t,n){let r=F(e),o=D(t),i=Array.isArray(n)?n.filter(Boolean):n?[n]:[],s=r.authored.findIndex(c=>Ae(r,c)===o),a=r.authored.filter(c=>Ae(r,c)===o);r.authored=r.authored.filter(c=>Ae(r,c)!==o),(s===-1||s>r.authored.length)&&(s=r.authored.length);for(let c of i)c.nodeType===1&&!Gt(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)}oe(r),q(e)}function q(e){if(!z)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||Ss;t.pendingRecordNodes=void 0,Pc(e,t,n),Ic(e,t),oe(t);let r=[],o=new Set;for(let f of e.querySelectorAll(`slot[${S}]`))if($(e,f)&&!at(t,e,f)){if(!f.hasAttribute(k)&&!(_e in f)){o.add(D(f.getAttribute("name")));continue}r.push(f)}let i=new Map;for(let f of r){let u=D(f.getAttribute("name")),m=i.get(u);m||(m=[],i.set(u,m)),m.push(f)}let s=[];for(let[f,u]of i){let m=t.assignedByName.get(f)||[];for(let d=0;d<u.length;d++){let p=u[d],y=m.filter(g=>{let h=Gt(t,g);return h?h===p:d===0}),b=y.filter(g=>g===e||g.nodeType===1&&g.contains(e));if(b.length){for(let g of b)A.delete(g);y=y.filter(g=>b.indexOf(g)===-1)}y.length>0?$o(t,p,y)&&s.push(p):Do(t,p)&&s.push(p)}}for(let f of s)Ho(t,f);let a=new Set(i.keys());for(let f of o)a.add(f);let c=new Set;for(let f of t.authored)a.has(Ae(t,f))||c.add(f);let l=e[re];if(l)for(let f of Array.from(l.childNodes))c.has(f)||ve.call(l,f);if(c.size){let f=_s(e);for(let u of c)u.parentNode!==f&&(A.delete(u),He(e,()=>ie.call(f,u)))}if(t.backstop){let f=t.backstop.takeRecords();f.length&&Jt(e,t,f)}}while(t.reapply)}finally{t.applying=!1}}}function Pc(e,t,n){for(let r of e.querySelectorAll(`slot[${S}][${k}="${M}"]`)){if(!$(e,r)||at(t,e,r))continue;let o=r,i=t.lastSnapshot.get(o);if(!i)continue;let s=Array.from(o.childNodes);if(ur(s,i))continue;let a=t.authored,c=D(o.getAttribute("name")),l=s.filter(p=>!n.has(p));for(let p of l)a.indexOf(p)===-1&&Ae(t,p)!==c&&(t.adoptedKey||(t.adoptedKey=new WeakMap),t.adoptedKey.set(p,c));for(let p of a){if(l.indexOf(p)!==-1||Ae(t,p)!==c)continue;let y=a.indexOf(p),b=0;for(let g=0;g<l.length;g++){let h=a.indexOf(l[g]);h!==-1&&h<y&&(b=g+1)}l.splice(b,0,p)}let f=new Set(l);for(let p of i)f.add(p);let u=-1,m=0;for(let p of a){if(f.has(p)){u===-1&&(u=m);continue}m+=1}let d=a.filter(p=>!f.has(p));(u===-1||u>d.length)&&(u=d.length),d.splice(u,0,...l),t.authored=d}}function Ic(e,t){let n=e[re];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 Xt=w(()=>{De();zt();$e();cr();Be();Se()});function xs(){return typeof HTMLElement<"u"&&typeof HTMLSlotElement<"u"}function Es(){if(As||(z=xs(),!z))return;Qt=HTMLSlotElement.prototype.assignedNodes,Uo=HTMLSlotElement.prototype.assignedElements,fr=Object.getOwnPropertyDescriptor(Element.prototype,"assignedSlot"),HTMLSlotElement.prototype.assignedNodes=function(n){return this.hasAttribute(S)&&!Ko(this)?Wo(this,n):Qt?Qt.call(this,n):[]},HTMLSlotElement.prototype.assignedElements=function(n){return this.hasAttribute(S)&&!Ko(this)?Wo(this,n).filter(r=>r.nodeType===1):Uo?Uo.call(this,n):[]},Object.defineProperty(Element.prototype,"assignedSlot",{configurable:!0,enumerable:!0,get:function(){let n=fr&&fr.get?fr.get.call(this):null;return n||vs(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||vs(this)}}),qo=HTMLSlotElement.prototype.assign,HTMLSlotElement.prototype.assign=function(...n){if(this.hasAttribute(S)&&!Ko(this)){let r=Mc(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 f=l.deref();return f!==void 0&&i.indexOf(f)===-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);oe(o),q(r)}return}return qo?qo.apply(this,n):void 0},As=!0}function Gt(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 Mc(e){for(let t=e.parentElement;t;t=t.parentElement)if(t[_])return $(t,e)?t:null;return null}function Ko(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 Wo(e,t){if(e.getAttribute(k)!==M)return[];let n=Array.from(e.childNodes);return!t||!t.flatten?n:Vo(n,new Set,0)}function Vo(e,t,n){if(n>=bs)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=Wo(i,{flatten:!1});if(s.length>0)for(let a of Vo(s,t,n+1))r.push(a);else for(let a of Vo(Array.from(i.childNodes),t,n+1))r.push(a)}else if(Qt){let s=Qt.call(i,{flatten:!0});for(let a of s)r.push(a)}else r.push(o)}else r.push(o);return r}function vs(e){let t=e.parentElement;return t&&t.tagName==="SLOT"&&t.hasAttribute(S)&&t.getAttribute(k)===M?t:null}var z,Qt,Uo,fr,qo,As,$e=w(()=>{De();Xt();Be();Se();z=xs(),Qt=null,Uo=null,fr=null,qo=null,As=!1;Es()});function zo(e){if(!z)return!1;for(let t of e.querySelectorAll(`slot[${S}][${k}]`))if($(e,t))return!0;return!1}function $(e,t){let n=t[Fe];if(n)return n===e;let r=typeof t.getAttribute=="function"?t.getAttribute(So):null;if(r){let o=Fc(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 Fc(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 $o(e,t,n){for(let l of n)A.delete(l);let r=t.getAttribute(k)!==M,o=e.lastSnapshot.get(t)||[],i=r||!ur(o,n);if(!r&&ur(Array.from(t.childNodes),n))return e.lastSnapshot.set(t,n.slice()),i;let s=t[_e];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(k,M),e.lastSnapshot.set(t,n.slice()),i}function Do(e,t){let n=t.getAttribute(k)===M;if(t.setAttribute(k,_o),!n)return Ts(t),!1;for(e.lastSnapshot.delete(t);t.firstChild;)t.removeChild(t.firstChild);return Ts(t),!0}function Ts(e){let t=e[_e];!t||t.childNodes.length===0||e.appendChild(t)}function Go(e,t){if(!Vt(e))return;let n=F(e),r=D(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 Ns(e){e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1}))}function Ho(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)Ns(r)}))}function ur(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 De=w(()=>{$e();Be();Se()});var qe=w(()=>{De();zt();$e();Xt();cr();Be();Se()});function Ys(e,t,n){Cl.has(t)?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}async function fi(e){return JSON.stringify(await Js(e))}function Ge(e){return Xs(JSON.parse(e))}async function Js(e){let t=kl();return await Rl(e,t),ze(e,t)}function Xs(e){return Ne(e,Pl())}function kl(){return{refCount:new Map,idOf:new Map,emitted:new Set,nextId:0,blobBytes:new Map,fdEntries:new Map}}async function Rl(e,t){let n=[e];for(;n.length;){let r=n.pop();if(!Ml(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(Fl(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 ze(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:an(i),n:e.name,t:e.type||"",m:e.lastModified}:o={[N]:"Blob",v:an(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,ze(c,t)]);o={[N]:"FD",v:s}}else if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)o=Ol(e);else if(e instanceof Map){let i=[];for(let[s,a]of e)i.push([ze(s,t),ze(a,t)]);o={[N]:"Map",v:i}}else if(e instanceof Set){let i=[];for(let s of e)i.push(ze(s,t));o={[N]:"Set",v:i}}else if(Array.isArray(e))o=e.map(i=>ze(i,t));else{o={};for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i))continue;let s=Bl(i)?"_"+i:i;Ys(o,s,ze(e[i],t))}}if(r!==void 0){if(Array.isArray(o))return{[N]:"Arr",_id:r,v:o};o._id=r}return o}function Ol(e){if(e instanceof ArrayBuffer)return{[N]:"buf",v:an(new Uint8Array(e))};if(e instanceof DataView)return{[N]:"dv",v:an(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))};let t=e.constructor.name,n=Ll[t];if(!n)throw new TypeError(`Unsupported typed array: ${t}`);let r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return{[N]:n,v:an(r)}}function Pl(){return{refs:new Map}}function Ne(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(Ne(e[s],t));return i}let n=e[N];if(typeof n=="string")return Il(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=$l(i)?i.slice(1):i;Ys(r,s,Ne(e[i],t))}return r}function Il(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(Ne(s,n),Ne(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(Ne(s,n));return i}case"Arr":{let i=[];typeof r=="number"&&n.refs.set(r,i);for(let s of e.v)i.push(Ne(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=sn(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=sn(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=Ne(a,n);i.append(s,c)}return i}default:{if(t==="buf"){let s=sn(e.v);return o(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength))}if(t==="dv"){let s=sn(e.v);return o(new DataView(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)))}let i=jl[t];if(i){let s=sn(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 Ml(e){return e!==null&&typeof e=="object"}function Fl(e){if(e===null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Bl(e){return/^_+\$wj$/.test(e)||/^_+id$/.test(e)}function $l(e){return/^__+\$wj$/.test(e)||/^__+id$/.test(e)}function an(e){if(Qs)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 sn(e){if(Qs){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,Cl,Ll,jl,Qs,cn=w(()=>{N="_$wj",Cl=new Set(["__proto__","constructor","prototype"]);Ll={Int8Array:"i8",Uint8Array:"u8",Uint8ClampedArray:"u8c",Int16Array:"i16",Uint16Array:"u16",Int32Array:"i32",Uint32Array:"u32",Float32Array:"f32",Float64Array:"f64",BigInt64Array:"bi64",BigUint64Array:"bu64"},jl={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};Qs=typeof Buffer<"u"&&typeof Buffer.from=="function"});var ma={};Zi(ma,{observeLazy:()=>iu,observeViewportOnce:()=>cu});function ha(e){let t=hi.get(e);return t||(t=import(e).finally(()=>hi.delete(e)),hi.set(e,t),t)}function iu(e){for(let[t,n]of Object.entries(e))Ye.set(t.toLowerCase(),n);if(typeof IntersectionObserver>"u"){for(let t of Ye.values())ha(t);Ye.clear();return}dn||(dn=new IntersectionObserver(su,{rootMargin:"200px"})),pa(),typeof MutationObserver<"u"&&new MutationObserver(()=>pa()).observe(document.body,{childList:!0,subtree:!0})}function pa(){if(!(!dn||!Ye.size))for(let e of Ye.keys())for(let t of document.querySelectorAll(e))dn.observe(t)}function su(e){for(let t of e){if(!t.isIntersecting)continue;let n=t.target.tagName.toLowerCase(),r=Ye.get(n);r&&(ha(r),Ye.delete(n),dn?.unobserve(t.target))}}function au(e){for(let t of e){if(!t.isIntersecting)continue;let n=Tr.get(t.target);Tr.delete(t.target),fn?.unobserve(t.target),n&&n()}}function cu(e,t){return typeof IntersectionObserver>"u"?(t(),()=>{}):(fn||(fn=new IntersectionObserver(au,{rootMargin:"200px"})),Tr.set(e,t),fn.observe(e),()=>{Tr.delete(e),fn?.unobserve(e)})}var Ye,dn,hi,fn,Tr,ba=w(()=>{Ye=new Map,dn=null,hi=new Map;fn=null,Tr=new WeakMap});var mi,bi=w(()=>{mi=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(()=>(ba(),ma)).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(()=>(Nr(),ya)).then(({loadFrame:n})=>{this._webjsLoadedSrc!==t||!this.isConnected||n(this,t)})}}:null;typeof customElements<"u"&&mi&&!customElements.get("webjs-frame")&&customElements.define("webjs-frame",mi)});function uu(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 gi(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 lu,yi,pn=w(()=>{lu=new Set(["append","prepend","before","after","replace","update"]);yi=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=lu.has(t)?this.querySelector("template"):null;try{for(let s of r){let a=i?i.content.cloneNode(!0):null;uu(t,s,a)}}finally{this.remove()}}}:null;typeof customElements<"u"&&yi&&!customElements.get("webjs-stream")&&customElements.define("webjs-stream",yi)});var ga,wa=w(()=>{ga=typeof HTMLElement<"u"?class extends HTMLElement{connectedCallback(){this.style.display||(this.style.display="contents")}}:null;typeof customElements<"u"&&ga&&!customElements.get("webjs-suspense")&&customElements.define("webjs-suspense",ga)});function Cr(e,t){let n=typeof document<"u"?document:null,r=e||n;if(!r||typeof r.querySelectorAll!="function")return;if(t&&t.frame===!0){wi(r,!0);return}Aa();let o=r===n,i=!!n&&!o&&typeof n.contains=="function"&&n.contains(r),s=!!n&&!o&&!i;s&&(wi(n,!0),Ce.clear(),Si.clear()),(o||s)&&(_i=!0);let a=j.ingested+j.replaced;pu(wi(r),a)}function wi(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=du(r.getAttribute?.("data-webjs-dev"));o!==null&&(n=o),_a(t?null:r.textContent,r)}for(let r of e.querySelectorAll("[data-webjs-seed]"))_a(t?null:r.getAttribute("data-webjs-seed"),r,()=>r.removeAttribute("data-webjs-seed"));return n}function _a(e,t,n){if(e)try{let r=Ge(e);if(r&&typeof r=="object")for(let o in r){Ce.has(o)?j.replaced++:j.ingested++,Ce.set(o,r[o]);let i=o.indexOf("/",o.indexOf("/")+1);i>0&&Si.add(o.slice(0,i))}}catch{}n?n():t.remove?.()}function du(e){return typeof e!="string"?null:e||"ok"}function pu(e,t){if(e===null)return;let n=++fu;bt={epoch:n,hits:j.hits,misses:j.misses,keyMisses:j.keyMisses,merged:t,marker:e};let r=()=>{!bt||bt.epoch!==n||Aa()};try{typeof requestIdleCallback=="function"?requestIdleCallback(r,{timeout:1e3}):setTimeout(r,250)}catch{bt=null}}function Aa(){let e=bt;if(bt=null,!!e)try{hu(e)}catch{}}function hu(e){let t=j.hits-e.hits,n=j.misses-e.misses,r=j.ingested+j.replaced-e.merged,o=j.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, ${Ce.size} still unconsumed). ${i} See https://webjs.dev/docs/data-fetching for the seeding reference.`)}function mu(e,t,n){_i||(_i=!0,Cr());let r=`${e}/${t}/${n}`;if(Ce.has(r)){let o=Ce.get(r);return Ce.delete(r),j.hits++,o}return j.misses++,Si.has(`${e}/${t}`)&&j.keyMisses++,Sa}function bu(){return{...j,pending:Ce.size}}var Ce,Sa,_i,j,Si,bt,fu,kr=w(()=>{cn();Ce=new Map,Sa=Symbol("webjs.seed.miss"),_i=!1,j={ingested:0,replaced:0,hits:0,misses:0,keyMisses:0},Si=new Set,bt=null,fu=0});function Ai(e){if(!(!Array.isArray(e)||!e.length)){Rr+=1;for(let t of e)t&&va.set(t,Rr)}}function gu(){return Rr}function wu(e,t,n){if(!(!Array.isArray(t)||!t.length)&&(yt.delete(e),yt.set(e,{tags:t.slice(),since:typeof n=="number"?n:Rr}),yt.size>yu)){let r=yt.keys().next().value;r!==void 0&&yt.delete(r)}}function _u(e){let t=yt.get(e);if(!t)return!1;for(let n of t.tags)if((va.get(n)||0)>t.since)return!0;return!1}function vi(e){return e?e.split(",").map(t=>t.trim()).filter(Boolean):[]}var Rr,va,yt,yu,Or=w(()=>{Rr=0,va=new Map,yt=new Map,yu=1e3});function xa(e){return gt.test(e)}var xi,hn,gt,mn,Je,wt,Lr,U=w(()=>{xi="text/vnd.webjs-stream.html",hn=["wheel","touchmove","keydown","pointerdown"],gt=/\.(?: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,mn="_top",Je="webjs:nav-fallback",wt=new Set(["value","checked","selected","indeterminate","disabled","open","popover"]),Lr="name=csp-nonce"});function ke(e,t,n="warn"){if(Ei.has(e)||(Ei.add(e),typeof console>"u"))return;let r=n==="error"?console.error:console.warn;r&&r.call(console,t)}function Ta(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"){ke(`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"){ke(`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&&ke(`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 Ni(e,t){return!e&&!t&&typeof document<"u"&&document.readyState==="loading"}function jr(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 Na(){if(typeof location>"u"||Ea)return;Ea=!0;let e=null;try{e=sessionStorage.getItem(Je),sessionStorage.removeItem(Je)}catch{}let t="";try{let n=performance.getEntriesByType("navigation")[0];t=n?n.type:""}catch{}jr(t,document.referrer,location.href,e)&&Z("pre-boot-navigation",location.href,!1)}function Z(e,t,n=!0){if(n)try{sessionStorage.setItem(Je,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||ke(`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 Ca(e){typeof process<"u"&&process.env||ke(`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 Ci(){if(typeof process<"u"&&process.env||Ti||typeof document>"u"||typeof getComputedStyle!="function")return;let e=document.documentElement;if(!e)return;Ti=!0;let t;try{t=getComputedStyle(e).scrollBehavior}catch{return}t==="smooth"&&ke("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 bn(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 ka(){Ei.clear(),Ti=!1}function Ra(e,t){return Ni(e,t)}var Ei,Ea,Ti,ee=w(()=>{we();U();Ei=new Set;Ea=!1;Ti=!1});function te(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),f=a.slice(c+1);if(t.has(l)||n.some(u=>u.segment===l)){r=!0;return}n.push({segment:l,routeKey:f,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 yn(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 ce(){let e=te(document.body);return e?[...e.entries()].map(([t,n])=>`${t}:${n.routeKey}`).join(","):""}var Re=w(()=>{});function Oa(e){le=e||(t=>{location.href=t})}function La(){return R}function ja(){return++R}function Pr(){return++R}function ki(e){G=e}var R,le,G,be=w(()=>{R=0,le=e=>{location.href=e};G=!1});function Xe(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"&&Su()?Document.parseHTMLUnsafe(e):Au(e)}function Su(){if(_t!==null)return _t;try{_t=Document.parseHTMLUnsafe("<!doctype html><body><!--c--><i></i>")?.body?.firstChild?.nodeType===8}catch{_t=!1}return _t}function Ri(){_t=null}function Au(e){return typeof DOMParser>"u"?null:new DOMParser().parseFromString(e,"text/html")}var _t,gn=w(()=>{_t=null});function Ir(e){for(let t of e.composedPath())if(t instanceof HTMLAnchorElement)return t;return null}function Oi(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 Mr=w(()=>{});function wn(e,t){return((t&&t.hasAttribute("formmethod")?t.getAttribute("formmethod")||"":e.getAttribute("method")||"")||"get").toLowerCase()}function _n(e,t){return t&&t.hasAttribute("formaction")?t.getAttribute("formaction")||"":e.getAttribute("action")||e.action||location.href}function vu(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 Sn(e,t){return vu(t&&t.hasAttribute("formenctype")?t.getAttribute("formenctype"):e.getAttribute("enctype"))}function An(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 vn(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 Fr=w(()=>{});function Pa(){if(typeof document>"u")return"";let e=document.querySelector('meta[name="csp-nonce"]');return e&&e.getAttribute("content")||""}function xn(e){let t=document.createElement("script");for(let r of e.attributes)r.name!=="nonce"&&t.setAttribute(r.name,r.value);let n=Pa();return n&&t.setAttribute("nonce",n),t.textContent=e.textContent,t}function Li(e){if(!e.hasAttribute("nonce"))return e.cloneNode(!0);let t=e.cloneNode(!0),n=Pa();return n?t.setAttribute("nonce",n):t.removeAttribute("nonce"),t}function ue(e){if(!e.hasAttribute("nonce"))return e.outerHTML;let t=e.cloneNode(!0);return t.removeAttribute("nonce"),t.outerHTML}function Br(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 xu(e){if(!e.querySelector("meta"))return;let t=o=>{let i=new Map;for(let s of o.querySelectorAll("meta")){let a=Br(s);if(!a||a===Lr)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(ue).join(`
2
+ `),c=s.map(ue).join(`
3
+ `);if(a!==c){if(i.length===1&&s.length===1){let l=s[0];for(let f of[...l.attributes])l.removeAttribute(f.name);for(let f of i[0].attributes)l.setAttribute(f.name,f.value);continue}for(let l of s)l.remove();for(let l of i)document.head.appendChild(Li(l))}}for(let[o,i]of r)if(!n.has(o))for(let s of i)s.remove()}function St(e){let t=e.querySelector("title");t&&(document.title=t.textContent||"");let n=new Set;for(let r of document.head.children)n.add(ue(r));for(let r of e.children)r.tagName==="SCRIPT"&&r.getAttribute("type")==="importmap"||r.tagName!=="BASE"&&r.tagName!=="TITLE"&&(r.tagName==="META"&&Br(r)||n.has(ue(r))||(r.tagName==="SCRIPT"?document.head.appendChild(xn(r)):document.head.appendChild(Li(r))));xu(e)}function Eu(e){return e.tagName==="STYLE"?!0:e.tagName==="LINK"&&(e.getAttribute("rel")||"").toLowerCase().split(/\s+/).includes("stylesheet")}function En(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(ue(i));let o=new Set;for(let i of e.children)i.tagName==="SCRIPT"&&i.getAttribute("type")==="importmap"||i.tagName!=="BASE"&&o.add(ue(i));for(let i of[...t.children])i.tagName==="SCRIPT"&&i.getAttribute("type")==="importmap"||i.tagName!=="BASE"&&i.tagName!=="TITLE"&&(Eu(i)||i.tagName==="META"&&Br(i)===Lr||o.has(ue(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"&&Br(i)===Lr||r.has(ue(i))||(i.tagName==="SCRIPT"?t.appendChild(xn(i)):t.appendChild(Li(i))))}var Tn=w(()=>{U()});function Hr(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 ne(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===mn)return null;let r=typeof document<"u"?document.getElementById(n):null;return r&&r.tagName&&r.tagName.toLowerCase()==="webjs-frame"?n:(ke(`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 Hr(e)}function ji(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 Nn(e,t){let n=ji(e);if(!n)return null;let r=$r.has(n);return $r.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 Cn(e,t){if($r.get(e)!==t)return;$r.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 kn(e,t,n){let r=Dr.has(e);return Dr.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 Rn(e,t,n,r){if(Dr.get(e)!==t)return;Dr.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 Pi(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+=ue(r);return n}var $r,Dr,Oe=w(()=>{U();ee();Tn();$r=new WeakMap;Dr=new WeakMap});function Ii(e){if(!G||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=Ir(e);if(!t||t.hasAttribute("download")||t.hasAttribute("data-no-router")||t.target&&t.target!=="_self")return;let n=t.href;if(!n)return;let r=new URL(n);if(r.origin!==location.origin||r.pathname===location.pathname&&r.search===location.search&&r.hash||gt.test(r.pathname))return;e.preventDefault();let o=ne(t);On(n,!1,o)}function At(e){On(location.href,!0,null)}function vt(e){if(!G||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=wn(t,n);if(o==="dialog")return;let i=Sn(t,n),s=o==="get"||o==="head",a=_n(t,n),c;try{c=new URL(a,location.href)}catch{return}if(c.origin!==location.origin||gt.test(c.pathname))return;let l=vn(t,n);if(Ta(t,n,o,l),!s&&i==="text/plain")return;let f=An(l,i);e.preventDefault();let u=ne(n||t);Ia(c.href,o,f,u,t)}var Ur=w(()=>{Mr();U();be();ee();Fr();Oe();Ln()});function Mi(e){let t=fe(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};for(E.set(t,n);E.size>16;){let r=E.keys().next().value;E.delete(r)}}function Ma(e){let t=fe(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}:n)}function fe(e,t){let n=new URL(e,location.href),r=n.pathname+n.search;return t?`${t} ${r}`:r}var E,xt=w(()=>{U();E=new Map});function Lu(e){let t=de.get(e);return t==null?!1:Fn()-t>=Fi?(de.delete(e),!1):!0}function Rt(){de.clear()}function ju(e){for(de.has(e)&&de.delete(e),de.set(e,Fn());de.size>Ou;)de.delete(de.keys().next().value)}function Bn(){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 qr(){try{if(typeof matchMedia=="function")return matchMedia("(hover: hover) and (pointer: fine)").matches}catch{}return!0}function Pu(e){let t=e.getAttribute("rel");return t?t.toLowerCase().split(/\s+/).filter(Boolean):[]}function Ct(e){if(!e||!(e instanceof HTMLAnchorElement)||e.hasAttribute("download")||e.hasAttribute("data-no-router")||e.target&&e.target!=="_self")return null;let t=e.href;if(!t)return null;let n;try{n=new URL(t)}catch{return null}return n.origin!==location.origin||n.pathname===location.pathname&&n.search===location.search&&n.hash||gt.test(n.pathname)?null:t}function Kr(e){if(e.hasAttribute("data-no-prefetch"))return!0;let t=Pu(e);return t.includes("external")||t.includes("no-prefetch")}function kt(e){if(Kr(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 qr()?"intent":"viewport"}}function je(e,t){if(!G||typeof fetch!="function"||Bn())return;let n=fe(e,t);if(typeof location<"u"&&n===fe(location.href,t)||ye.has(n)||jn.has(n))return;let r=v.get(n);if(r&&Fn()-r.at<Fi||Lu(n))return;if(ye.size>=Fa){for(jn.add(n),Tt.push({href:e,frameId:t||null});Tt.length>Cu;){let s=Tt.shift();jn.delete(fe(s.href,s.frameId))}return}let o=ce();if(!o&&typeof document<"u"&&document.readyState==="loading")return;ye.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"),f=typeof document<"u"?document.querySelector('script[type="importmap"]'):null,u=f?f.getAttribute("data-webjs-build"):null,m=f?f.getAttribute("data-webjs-src"):null;if((c&&u&&c!==u||l&&m&&l!==m)&&(E.clear(),Ze(n),Rt()),(s.headers.get("x-webjs-frame")||null)!==(t||null)){ju(n);return}let p=s.redirected&&s.url?s.url:e,y=await s.text();Mn.has(n)||Mu(n,{html:y,build:c,src:l,finalUrl:p,frameId:t||null,at:Fn()})}).catch(()=>{}).finally(()=>{ye.delete(n),Mn.delete(n),Iu()})}function Iu(){for(;Tt.length&&ye.size<Fa;){let{href:e,frameId:t}=Tt.shift();jn.delete(fe(e,t)),je(e,t)}}function Mu(e,t){for(v.has(e)&&v.delete(e),v.set(e,t);v.size>Nu;){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 Wr(e){let t=/<!--wj:children:([^>]*?)-->/.exec(e||"");return t?t[1]:null}function $n(e,t,n){let r=fe(e,n),o=v.get(r);if(!o)return null;if(Fn()-o.at>=Fi)return v.delete(r),null;if(o.frameId)return v.delete(r),ji(o.frameId)?o:null;let i=Wr(o.html);return i&&!new Set(String(t??(ce()||"")).split(",").filter(Boolean)).has(i)?(v.delete(r),null):(v.delete(r),o)}function Fn(){try{if(typeof performance<"u"&&typeof performance.now=="function")return performance.now()}catch{}return 0}function Qe(e){if(!G)return;let t=Oi(e.target);if(!t)return;let n=kt(t);if(n==="none"||n==="render")return;let r=Ct(t);if(r){if(e.type==="touchstart"){je(r,ne(t));return}n==="intent"&&(Pn===t&&Nt||(Dn(),Pn=t,Nt=setTimeout(()=>{Nt=null,Pn=null,je(r,ne(t))},ku)))}}function Bi(e){let t=Oi(e.target);t&&t===Pn&&Dn()}function Dn(){Nt&&(clearTimeout(Nt),Nt=null),Pn=null}function Vr(){for(let e of In)clearTimeout(e);In.clear(),Et=new WeakMap}function zr(){if(typeof document>"u"||Bn())return;let e=typeof IntersectionObserver<"u";e&&(Le?(Le.disconnect(),Vr()):Le=new IntersectionObserver(t=>{for(let n of t){let r=n.target;if(n.isIntersecting){if(Et.has(r))continue;let o=setTimeout(()=>{In.delete(o),Et.delete(r),Le.unobserve(r);let i=Ct(r);i&&kt(r)==="viewport"&&je(i,ne(r))},Ru);Et.set(r,o),In.add(o)}else{let o=Et.get(r);o&&(clearTimeout(o),In.delete(o),Et.delete(r))}}},{threshold:.5}));for(let t of document.querySelectorAll("a[href]")){let n=kt(t);if(n==="render"){let r=Ct(t);r&&je(r,ne(t))}else n==="viewport"&&e&&Le.observe(t)}}function Ze(e){v.clear();for(let t of ye)t!==e&&Mn.add(t)}function Ba(e,t){let n=fe(e,t);v.delete(n),ye.has(n)&&Mn.add(n)}function $a(e,t){return v.get(fe(e,t))||null}function Da(){return ye.size}function Ha(){v.clear(),de.clear(),ye.clear(),Mn.clear(),Tt.length=0,jn.clear(),Dn(),Vr()}function Ua(){Le&&(Le.disconnect(),Le=null)}var Nu,Fi,Fa,Cu,ku,Ru,v,de,Ou,ye,Mn,Tt,jn,Nt,Pn,Le,Et,In,et=w(()=>{Mr();Re();U();Oe();be();xt();Nu=8,Fi=3e4,Fa=3,Cu=24,ku=100,Ru=250,v=new Map,de=new Map,Ou=16;ye=new Set,Mn=new Set,Tt=[],jn=new Set,Nt=null,Pn=null,Le=null,Et=new WeakMap,In=new Set});function $i(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 Hn(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 f=r.indexOf(o);if(f!==-1)return{shell:r.slice(0,f),streaming:!0,reader:c?null:t,dec:n,rest:r.slice(f)};if(c)return{shell:r,streaming:!1};let u=s.exec(r);if(u){let m=u.index+u[0].length;return{shell:r.slice(0,m),streaming:!0,reader:t,dec:n,rest:r.slice(m)}}}}function Gr(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 Yr(e,t){let n=document.getElementById(e);if(!n){Ca(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&&Jr(i)}async function Un(e,t,n,r){let o=n,i=()=>{let s;for(;s=Gr(o);){if(!r())return!1;Yr(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 qn=w(()=>{ee();Ot()});function jt(){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 tt(e,t){let n=typeof document<"u"?document.startViewTransition:void 0;if(jt()&&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 Kn(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),Lt.add(r))}}function nt(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=Fu(t,o);if(!i||i===r)continue;let s=i.parentNode;if(s)s.replaceChild(r,i),Lt.add(r);else{let a=t.indexOf(i);a!==-1&&(t[a]=r,Lt.add(r))}}}function Fu(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 Lt,Pt=w(()=>{Lt=new WeakSet});function st(e,t,n,r,o,i,s,a){let c=!1,l=()=>{if(!c){c=!0;try{Cr(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"]'),p=d?d.getAttribute("data-webjs-build"):null,y=!1;if(o&&p&&(y=o!==p),!y&&e.head&&e.head.children.length>0){let b=Pi(document),g=Pi(e);b!==g&&(y=!0)}if(y&&typeof location<"u"){E.clear(),Ze(),Rt();try{let b="webjs:importmap-reload";if(sessionStorage&&sessionStorage.getItem(b))sessionStorage.removeItem(b),Z("deploy-mismatch-reload-suppressed",r,!1);else return sessionStorage&&sessionStorage.setItem(b,"1"),Z("deploy-mismatch",r),le(r),"none"}catch{return Z("deploy-mismatch",r),le(r),"none"}}else if(!y){let b=d?d.getAttribute("data-webjs-src"):null;i&&b&&i!==b&&(E.clear(),Ze(),Rt(),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)}`),p=e.querySelector(`webjs-frame#${CSS.escape(t)}`);if(d&&p){a&&a(),St(e.head),rt=tt(()=>{Ga(d,p),It(d),ot(d),$i(e.body),it()},()=>ot(d));return}let y=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(y),y.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(),qa(e);return}let f=te(document.body),u=te(e.body),m=f&&u?yn(f,u):null;if(m){l(),a&&a();let{mode:d,live:p,incoming:y}=m;St(e.head),rt=tt(()=>{d==="replace"?Wa(p,y):Va(p,y,e),za(p.start,y.start),$i(e.body),it()},()=>Ka(p));return}if(r&&!n&&typeof location<"u")return Z(f?u?"no-shared-boundary":"incoming-boundaries-malformed":"live-boundaries-malformed",r),le(r),"none";if(r&&n)return Z("revalidation-discarded",r,!1),"discard";l(),a&&a(),qa(e)}function qa(e){En(e.head),Kn(document.body,e.body);let t=[...e.body.childNodes];rt=tt(()=>{document.body.replaceChildren(...t),It(document.body),ot(document.body),it()},()=>ot(document.body))}var rt,Wn=w(()=>{kr();Re();ee();Mt();Oe();Tn();et();xt();be();qn();Ot();Pt();rt=Promise.resolve()});function Ya(){Di||typeof MutationObserver>"u"||typeof customElements>"u"||(Di=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)}}),Di.observe(document.body,{childList:!0,subtree:!0}))}function Ka(e){if(!(!e||!e.start))for(let t=e.start.nextSibling;t&&t!==e.end;t=t.nextSibling)t.nodeType===1&&ot(t)}function ot(e){typeof customElements>"u"||Jr(e)}function Jr(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&&Jr(n.shadowRoot))}function It(e){if(e.tagName==="SCRIPT"){let n=xn(e);return e.replaceWith(n),n}let t=[];Lt.has(e)&&t.push(e);for(let n of e.querySelectorAll("[data-webjs-permanent]"))Lt.has(n)&&t.push(n);for(let n of e.querySelectorAll("script"))t.length&&t.some(r=>r!==n&&r.contains(n))||n.replaceWith(xn(n));return e}function Vn(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=It(n);r.isConnected!==!1&&ot(r)}}var Di,Ot=w(()=>{Re();U();ee();Mt();gn();Ur();Fr();Oe();Tn();et();xt();qn();Wn();Pt();Di=null});function it(){let e=document.activeElement;!e||e===document.body||e===document.documentElement||typeof e.blur=="function"&&e.blur()}function Wa(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));nt(r,o);for(let i of r)i.parentNode===n&&n.removeChild(i);for(let i of o)n.insertBefore(i,e.end);Vn(e)}function Va(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));nt(o,i),Bu(r,e.start,e.end,o,i),Vn(e)}function Bu(e,t,n,r,o){let i=new Map;for(let c of r){if(c.nodeType!==1)continue;let l=Pe(c);l&&i.set(l,c)}let s=n,a=[];for(let c of o){if(c.nodeType===1){let l=Pe(c);if(l&&i.has(l)){let f=i.get(l);Ft(f,c),a.push(f),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 Ft(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),!wt.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])wt.has(r.name)||n.has(r.name)||e.removeAttribute(r.name);if($u(e)){Hu(e,t);return}Bt(e,t)}function $u(e){let t=e;return t[Symbol.for("webjs.instance")]!=null||t[_]!=null}function Du(e,t){for(let n=e.parentElement;n&&n!==t;n=n.parentElement)if(n.tagName.includes("-"))return!1;return!0}function Xr(e){let t=new Map,n=`slot[${S}][${k}="${M}"]`;for(let r of e.querySelectorAll(n)){let o=r;if(!Du(o,e)||Fo(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(k)===M){i=!0;break}if(i)continue;let s=D(o.getAttribute("name"));t.has(s)||t.set(s,o)}return t}function za(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 u=r.parentElement;u;u=u.parentElement){if(u[_]){o=u;break}if(u.tagName.includes("-"))return}if(!o)return;let i=D(r.getAttribute("name"));xe(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 u=a.parentElement;u;u=u.parentElement)if(u.tagName.includes("-")){c=u;break}if(!c||c.tagName!==o.tagName)return;let l=Xr(o),f=Xr(c);for(let u of new Set([...l.keys(),...f.keys()])){if(u===i)continue;let m=f.get(u);m?xe(o,u,[...m.childNodes].map(d=>document.importNode(d,!0))):l.get(u)&&xe(o,u,null)}}function Hu(e,t){if(!e[_])return;let n=Xr(e),r=Xr(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?(Bt(s,a),xe(e,i,[...s.childNodes])):a?xe(e,i,[...a.childNodes].map(c=>document.importNode(c,!0))):xe(e,i,null)}}function Bt(e,t){let n=[...e.childNodes],r=[...t.childNodes].map(a=>document.importNode(a,!0));nt(n,r);let o=new Map;for(let a of n){if(a.nodeType!==1)continue;let c=Pe(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=Pe(c);if(l&&o.has(l)){let u=o.get(l);Ft(u,c),i.push(u),o.delete(l);continue}let f=n[a];if(f&&f.nodeType===1&&!Pe(f)&&f.tagName===c.tagName){Ft(f,c),i.push(f);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 Pe(e){let t=e.getAttribute("data-key");return t?`${e.tagName}:k:${t}`:e.id?`${e.tagName}:i:${e.id}`:null}function $t(){let e=te(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=ce(),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:R,haveKeys:i}}function Ie(e){if(!e||e.token!==R)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 Ga(e,t){Bt(e,t)}var Mt=w(()=>{qe();Re();U();be();Ot();Pt()});function Uu(e){if(typeof document>"u"||!document.body)return!1;let t=te(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 Qr(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||Uu(t)||typeof location<"u"&&(Z("navigation-error-unrecoverable",e),le(e))}var Ja=w(()=>{Re();ee();be()});async function zn(e,t,n,r,o,i,s,a,c,l,f){o=o||"GET";let u=typeof a=="number"?a:R,m,d=null,p=null,y=null,b=null,g=!1,h=e,W=t?Nn(t,u):null;try{try{let O=o==="GET"&&!i&&!l&&!f?$n(e,r?r.haveKeys:void 0,t):null;if(O)m=O.html,p=O.build,y=O.src,h=O.finalUrl,b=200,g=!0;else{let x={"x-webjs-router":"1"},Ji=l?"":ce();Ji&&(x["x-webjs-have"]=Ji),t&&(x["x-webjs-frame"]=t),i!=null&&o!=="GET"&&o!=="HEAD"&&(x.accept=xi+", text/html");let io={method:o,headers:x,credentials:"same-origin",cache:"no-cache"};s&&(io.signal=s),i!=null&&o!=="GET"&&o!=="HEAD"&&(io.body=i);let B=await fetch(e,io);b=B.status,g=B.ok;let Xi=vi(B.headers.get("x-webjs-invalidate"));Xi.length&&Ai(Xi);let Qi=B.headers.get("content-type")||"",oc=/^text\/html\b/i.test(Qi);if(Qi.toLowerCase().indexOf(xi)===0){let ic=await B.text(),Yn=u===R;return Yn&&(Ie(r),gi(ic)),{ok:Yn&&g,status:b,aborted:!Yn,applied:Yn}}if(B.redirected&&B.url&&(h=B.url),B.status===204||B.status===205)return u===R&&n&&history.pushState(null,"",h),{ok:g,status:b,aborted:!1,applied:!1};if(!oc)return u===R&&(Ie(r),Qr(e,B.status,null)),{ok:!1,status:b,aborted:!1,applied:!1};p=B.headers.get("x-webjs-build"),y=B.headers.get("x-webjs-src");let so=await Hn(B);m=so.shell,so.streaming&&(d=so)}}catch(O){return O&&O.name==="AbortError"?{ok:!1,status:null,aborted:!0,applied:!1}:u!==R?{ok:!1,status:null,aborted:!0,applied:!1}:(Ie(r),Qr(e,null,O instanceof Error?O:new Error(String(O))),{ok:!1,status:null,aborted:!1,applied:!1})}if(u!==R){if(d&&d.reader)try{d.reader.cancel()}catch{}return{ok:!1,status:b,aborted:!0,applied:!1}}let L=Xe(m);if(!L)return Ie(r),Qr(e,null,new Error("navigation response did not parse as HTML")),{ok:!1,status:b,aborted:!1,applied:!1};let he=!1,Me=n?()=>{he||(he=!0,history.pushState(null,"",h))}:null,Dt=st(L,t,!!c,h,p,y,l,Me),Ht=Dt!=="none";if(Dt==="discard"){if(d&&d.reader)try{d.reader.cancel()}catch{}return{ok:g,status:b,aborted:!1,applied:!1}}if(Me&&Me(),n){let O=new URL(h);if(O.hash){let x=document.getElementById(O.hash.slice(1));x?x.scrollIntoView():(Ci(),window.scrollTo({left:0,top:0,behavior:"instant"}))}else Ci(),window.scrollTo({left:0,top:0,behavior:"instant"})}return d&&(d.reader||d.rest)&&rt.then(()=>Un(d.reader,d.dec,d.rest,()=>u===R)),document.dispatchEvent(new CustomEvent("webjs:navigate",{detail:{url:h,frameId:t,from:"navigate"}})),{ok:g,status:b,aborted:!1,applied:Ht}}finally{W&&Cn(W,u)}}var Xa=w(()=>{Or();pn();Re();U();ee();Mt();gn();Oe();Ja();Ln();et();be();qn();Wn()});function Ui(){if(typeof document>"u"||!document.documentElement)return()=>{};Y&&Y();let e=document.documentElement,t=e.style.getPropertyValue("overflow-anchor");e.style.setProperty("overflow-anchor","none");let n=null,r=()=>{if(Y===r){if(Y=null,n&&(clearTimeout(n),n=null),typeof window<"u")for(let o of hn)window.removeEventListener(o,r,{capture:!0});t?e.style.setProperty("overflow-anchor",t):e.style.removeProperty("overflow-anchor")}};if(Y=r,n=setTimeout(r,2e3),typeof window<"u")for(let o of hn)window.addEventListener(o,r,{capture:!0,passive:!0});return r}function Qa(e,t){if(typeof window>"u"||typeof requestAnimationFrame!="function")return;K&&K();let n=0,r=null,o=null,i=()=>{if(K===i){K=null,n&&cancelAnimationFrame(n),r&&(clearTimeout(r),r=null),o&&(o(),o=null);for(let a of hn)window.removeEventListener(a,i,{capture:!0})}},s=()=>{if(K!==i)return;if(document.documentElement.scrollHeight-window.innerHeight>=e){window.scrollTo({left:t,top:e,behavior:"instant"}),o=Ui(),n&&(cancelAnimationFrame(n),n=0);return}n=requestAnimationFrame(s)};K=i;for(let a of hn)window.addEventListener(a,i,{capture:!0,passive:!0});r=setTimeout(i,500),n=requestAnimationFrame(s)}function Za(e){if(typeof requestAnimationFrame!="function"){setTimeout(e,0);return}requestAnimationFrame(()=>requestAnimationFrame(e))}function eo(){Zr+=1}var Y,K,Zr,ec=w(()=>{U();Y=null;K=null,Zr=0});function Gn(){G||typeof document>"u"||(ki(!0),globalThis.__webjsRefreshPage=ro,document.addEventListener("click",Ii,!1),document.addEventListener("submit",vt,!1),window.addEventListener("popstate",At),document.addEventListener("pointerover",Qe,!0),document.addEventListener("focusin",Qe,!0),document.addEventListener("touchstart",Qe,{capture:!0,passive:!0}),document.addEventListener("pointerout",Bi,!0),document.addEventListener("webjs:navigate",zr),Ya(),zr(),typeof history<"u"&&"scrollRestoration"in history&&(to=history.scrollRestoration,history.scrollRestoration="manual"),typeof location<"u"&&(pe=location.href),Na())}function qi(){G&&(ki(!1),document.removeEventListener("click",Ii,!1),document.removeEventListener("submit",vt,!1),window.removeEventListener("popstate",At),document.removeEventListener("pointerover",Qe,!0),document.removeEventListener("focusin",Qe,!0),document.removeEventListener("touchstart",Qe,{capture:!0}),document.removeEventListener("pointerout",Bi,!0),document.removeEventListener("webjs:navigate",zr),Dn(),Vr(),Ua(),typeof history<"u"&&to!==null&&(history.scrollRestoration=to,to=null),eo(),Y&&Y(),K&&K(),pe=null,delete globalThis.__webjsRefreshPage)}async function Ki(e,t){let n=new URL(e,location.href);if(n.origin!==location.origin){le(e);return}await On(n.href,t?.replace??!1,null)}async function Wi(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};J&&J.abort(),J=new AbortController;let o=J.signal,i=Pr(),s=await zn(r.href,n,!1,null,"GET",null,o,i,!1,void 0,!0);return s&&s.applied&&Ba(r.href,n),s}function no(e){if(!e){E.clear(),Ze();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 ro(e){if(!G||typeof location>"u")return!1;no(),Rt();try{let t=await On(location.href,!1,null,{refresh:e==="shell"?"shell":"page"});return!t||t.aborted?!0:t.applied}catch{return!1}}async function On(e,t,n,r){let o=r&&r.refresh||void 0;if(Ni(t,n)&&typeof location<"u")return Z("readyState-loading",e),le(e),null;J&&J.abort(),J=new AbortController;let i=J.signal,s=Pr();n||(eo(),Y&&Y(),K&&K()),!o&&pe&&Mi(pe);let a=setTimeout(()=>{bn(!0),a=null},150),c=null;!t&&!o&&(c=$t());try{if(t){let l=Ma(e);if(l){let f=Xe(l.html);if(f){st(f,n,!0,null);let u=()=>{};if(typeof window<"u"){let p=()=>{window.scrollTo({left:l.scrollX,top:l.scrollY,behavior:"instant"}),window.scrollY>=l.scrollY-1?u=Ui():Qa(l.scrollY,l.scrollX)};if(jt()&&typeof document.startViewTransition=="function"){let y=Zr;rt.then(()=>{y!==Zr||!G||p()}).catch(()=>{})}else p()}let m=zn(e,n,!1,c,"GET",null,i,s,!0).catch(()=>{}),d=new Promise(p=>setTimeout(p,500));return Promise.all([m,d]).then(()=>Za(u)),null}}typeof window<"u"&&window.scrollTo({left:0,top:0,behavior:"instant"})}return await zn(e,n,!t&&!o,c,"GET",null,i,s,!1,o)}finally{a&&clearTimeout(a),s===R&&(bn(!1),typeof location<"u"&&(pe=location.href))}}async function Ia(e,t,n,r,o){J&&J.abort(),J=new AbortController;let i=J.signal,s=Pr();r||(eo(),Y&&Y(),K&&K());let a=t==="get"||t==="head",c=new URL(e,location.href);if(a){c.search="";for(let[d,p]of n)c.searchParams.append(d,typeof p=="string"?p:p.name)}pe&&Mi(pe);let l=setTimeout(()=>{bn(!0),l=null},150),f=$t(),u=o?kn(o,s,c.href):null,m=!1;try{let d=await zn(c.href,r,!0,f,a?"GET":t.toUpperCase(),a?null:n,i,s);m=!!(d&&d.ok),!a&&s===R&&(E.clear(),Ze())}finally{u&&Rn(u,s,c.href,m),l&&clearTimeout(l),s===R&&(bn(!1),typeof location<"u"&&(pe=location.href))}}function tc(){return pe}function nc(e){pe=e}var J,pe,to,Ln=w(()=>{U();ee();Mt();gn();Ur();Xa();Oe();et();ec();xt();be();Wn();Ot();Pt();J=null,pe=null,to=null});var ya={};Zi(ya,{_FALLBACK_MARKER_KEY:()=>Je,_FRAME_TOP:()=>mn,_LIVE_ATTRS:()=>wt,_activateSwappedRange:()=>Vn,_activeFrameId:()=>Hr,_addNewHeadElements:()=>St,_applyOptimisticLoading:()=>$t,_applyStreamedResolve:()=>Yr,_applySwap:()=>st,_blurOutgoingFocus:()=>it,_buildHaveHeader:()=>ce,_buildSubmitFormData:()=>vn,_bumpNavToken:()=>ja,_clearFormBusy:()=>Rn,_clearFrameBusy:()=>Cn,_collectBoundaries:()=>te,_currentPageUrl:()=>tc,_diffElementInPlace:()=>Ft,_eligibleAnchorHref:()=>Ct,_encodeSubmitBody:()=>An,_findAnchorInPath:()=>Ir,_getSubmitAction:()=>_n,_getSubmitEnctype:()=>Sn,_getSubmitMethod:()=>wn,_isNonHtmlPath:()=>xa,_isPreBootNavigation:()=>jr,_keyOf:()=>Pe,_markFormBusy:()=>kn,_markFrameBusy:()=>Nn,_mergeHead:()=>En,_navToken:()=>La,_onPopState:()=>At,_onSubmit:()=>vt,_parseHTML:()=>Xe,_planBoundarySwap:()=>yn,_prefetch:()=>je,_prefetchAnchor:()=>Wr,_prefetchCache:()=>v,_prefetchHasHoverPointer:()=>qr,_prefetchInflightSize:()=>Da,_prefetchMode:()=>kt,_prefetchPeek:()=>$a,_prefetchSaysSaveData:()=>Bn,_prefetchSuppressed:()=>Kr,_prefetchTake:()=>$n,_reactivateScripts:()=>It,_readStreamedShell:()=>Hn,_reconcileChildren:()=>Bt,_regraftPermanentElements:()=>Kn,_regraftPermanentInSlice:()=>nt,_resetParseProbe:()=>Ri,_resetPrefetch:()=>Ha,_resetWarnOnce:()=>ka,_resolveTargetFrameId:()=>ne,_restoreOptimistic:()=>Ie,_runWithTransition:()=>tt,_setCurrentPageUrl:()=>nc,_setHardNavigate:()=>Oa,_shouldFullLoadDuringParse:()=>Ra,_snapshotCache:()=>E,_streamBoundariesProgressively:()=>Un,_takeResolveUnit:()=>Gr,_viewTransitionsEnabled:()=>jt,disableClientRouter:()=>qi,enableClientRouter:()=>Gn,loadFrame:()=>Wi,navigate:()=>Ki,refreshPage:()=>ro,revalidate:()=>no});var Nr=w(()=>{bi();pn();pn();we();wa();kr();Or();qe();Ln();U();ee();Ln();et();be();Re();U();ee();Mt();gn();Mr();Ur();Fr();Oe();Tn();et();xt();qn();Wn();Ot();Pt();(typeof window>"u"||window.__WEBJS_CLIENT_ROUTER__!==!1)&&Gn()});function ac(e,...t){return{_$webjs:"template",strings:e,values:t}}function P(e){return!!e&&typeof e=="object"&&e._$webjs==="template"}var T="wjm-";function cc(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 ao(e){return!!e&&typeof e=="object"&&e._$webjsCss===!0}function co(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 lc(e){return!e||!e.length?"":`<style>${e.map(t=>t.text).join(`
5
+ `)}</style>`}we();var hs=Symbol.for("webjs.repeat");function ms(e,t,n){return{[hs]:!0,items:[...e],keyFn:t,templateFn:n}}function Qn(e){return!!e&&typeof e=="object"&&e[hs]===!0}function Sc(e){return{_$webjs:"unsafe-html",value:String(e??"")}}function bo(e){return!!e&&typeof e=="object"&&e._$webjs==="unsafe-html"}function Ac(e){return{_$webjs:"live",value:e}}function Wt(e){return!!e&&typeof e=="object"&&e._$webjs==="live"}function vc(e,t){return{_$webjs:"keyed",key:e,value:t}}function Zn(e){return!!e&&typeof e=="object"&&e._$webjs==="keyed"}function xc(e,t){return{_$webjs:"guard",deps:e,fn:t}}function er(e){return!!e&&typeof e=="object"&&e._$webjs==="guard"}function Ec(e){return{_$webjs:"template-content",template:e}}function yo(e){return!!e&&typeof e=="object"&&e._$webjs==="template-content"}function Tc(e){return{_$webjs:"ref",target:e}}function tr(e){return!!e&&typeof e=="object"&&e._$webjs==="ref"}function Nc(){return{value:void 0}}function Cc(e){return{_$webjs:"cache",value:e}}function nr(e){return!!e&&typeof e=="object"&&e._$webjs==="cache"}function kc(...e){return{_$webjs:"until",args:e}}function rr(e){return!!e&&typeof e=="object"&&e._$webjs==="until"}function Rc(e,t){return{_$webjs:"async-append",iterable:e,mapper:t}}function go(e){return!!e&&typeof e=="object"&&e._$webjs==="async-append"}function Oc(e,t){return{_$webjs:"async-replace",iterable:e,mapper:t}}function wo(e){return!!e&&typeof e=="object"&&e._$webjs==="async-replace"}function Lc(e){return{_$webjs:"watch",signal:e}}function or(e){return!!e&&typeof e=="object"&&e._$webjs==="watch"}qe();uo();we();qe();var dr=new WeakMap,pr=new WeakMap,Zt=Symbol.for("webjs.instance");function lt(e){let{strings:t}=e,n=dr.get(t);if(n)return n;let r=[],o="",i="text",s="",a=0,c="",l=0,f=null,u="",m="";for(let y=0;y<t.length;y++){let b=t[y];for(let g=0;g<b.length;g++){let h=b[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",u=""):/[a-zA-Z]/.test(h)?(i="tag-name",u=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=u==="script"||u==="style"?"rawtext":"text",i==="rawtext"&&(m="")):/\s/.test(h)?i="in-tag":u+=h.toLowerCase();break;case"in-tag":o+=h,h===">"?(i=u==="script"||u==="style"?"rawtext":"text",i==="rawtext"&&(m="")):!/\s/.test(h)&&h!=="/"&&(i="attr-name",s=h,a=o.length-1);break;case"rawtext":o+=h,m=(m+h.toLowerCase()).slice(-9),(m.endsWith("<\/script>")||m.endsWith("</style>"))&&(i="text",m="",u="");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(f){let W=f.firstPartIdx,L=[];for(let x=W;x<r.length;x++)(r[x].kind==="noop"||r[x].kind==="attr-mixed")&&L.push(x);let he=[],Me=t[L[0]],Dt=Me.lastIndexOf(c);he.push(Dt>=0?Me.slice(Dt+1):Me);for(let x=1;x<L.length;x++)he.push(t[L[x]]);let Ht=t[L[L.length-1]+1],O=Ht.indexOf(c);he.push(O>=0?Ht.slice(0,O):Ht),r[W]={kind:"attr-mixed",path:[],name:f.name,statics:he,group:L};for(let x=1;x<L.length;x++)r[L[x]]={kind:"noop",path:[],mixedAnchor:W};f=null}i="in-tag",s=""}break}}if(y<t.length-1){let g=r.length;if(i==="comment"){l=0,r.push({kind:"noop",path:[]});continue}if(i==="rawtext"){m="",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],W=s.slice(1);if(Ut(h)){o=o.slice(0,a);let L=lo[h],he=`data-${T}${g}`;o+=`${he}=""`,r.push({kind:L,path:[],name:W})}else{o=o.slice(0,a);let L=`data-${T}${g}`;o+=`${L}=""`,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}=""`,f={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,Bc(d.content,r);let p=$c(d.content,r);return n={templateEl:d,parts:r,formActions:p},dr.set(t,n),n}function Bc(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 $c(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=[],f=[];for(let u of c.attributes)if(u.name.startsWith(`data-${T}`)){let m=Number(u.name.slice(`data-${T}`.length));t[m]&&t[m].kind!=="child"&&(t[m].path=n.slice(),f.push({idx:m,kind:t[m].kind,name:t[m].name||""})),l.push(u.name)}if(c.localName==="form"||c.localName==="button"||c.localName==="input"){let u=Dc(c,f,t);u&&r.push(u)}for(let u of l)c.removeAttribute(u);o(a)}n.pop()}}return o(e),r.length?r:null}function Dc(e,t,n){let r=e.localName==="form",o=r?"action":"formaction",i=r?"method":"formmethod",s=r?"enctype":"formenctype",a=t.filter(b=>b.kind==="attr"&&b.name.toLowerCase()===o);if(!a.length)return null;let c=[],l=[],f=[],u=r?[]:t.filter(b=>b.name.toLowerCase()==="name"&&(b.kind==="attr"||b.kind==="attr-mixed"||b.kind==="bool")).map(b=>({i:b.idx,kind:b.kind})),m=!r&&e.hasAttribute("name"),d=!r&&e.hasAttribute("form"),p=!r&&e.hasAttribute("value"),y=r?[]:t.filter(b=>b.name.toLowerCase()==="value"&&(b.kind==="attr"||b.kind==="attr-mixed"||b.kind==="bool")).map(b=>({i:b.idx,kind:b.kind}));for(let b of t){let g=String(b.name).toLowerCase();if(b.kind==="prop"){r?(g==="method"||g==="enctype"||g==="encoding")&&f.push(b.name):ho(g)&&f.push(b.name);continue}if(g!==i&&g!==s||b.kind!=="attr"&&b.kind!=="attr-mixed"&&b.kind!=="bool")continue;let h=n[b.idx],W={i:b.idx,kind:b.kind};b.kind==="attr-mixed"&&(W.statics=h.statics||[],W.group=h.group||[]),(g===i?c:l).push(W)}return{isForm:r,tag:e.localName,actionIdxs:a.map(b=>b.idx),duplicateAction:a.length>1,staticAction:e.getAttribute(o)!=null,authoredName:m,authoredValue:p,authoredForm:d,propAttrs:f,nameParts:u,valueParts:y,staticMethod:e.getAttribute(i),staticEnctype:e.getAttribute(s),methodParts:c,enctypeParts:l}}we();var X=null,Ee=!1,ft=0,ut=null,Yo=0,Cs=(e,t)=>Object.is(e,t),mr=()=>{},ks=()=>!1;function Rs(e,t){e.liveConsumers||(e.liveConsumers=new Set);let n=e.liveConsumers.size===0;if(e.liveConsumers.add(t),n){if(e.producers&&e.producers.length>0)for(let r of e.producers)Rs(r,e);if(e.watched)try{e.watched.call(e.wrapper)}catch(r){console.error(r)}}}function en(e,t){if(e.liveConsumers&&(e.liveConsumers.delete(t),e.liveConsumers.size===0)){if(e.producers&&e.producers.length>0)for(let n of e.producers)en(n,e);if(e.unwatched)try{e.unwatched.call(e.wrapper)}catch(n){console.error(n)}}}function ti(e){if(Ee)throw new Error("Signal read during notification phase");if(X===null)return;let t=X,n=t.nextProducerIndex++;n<t.producers.length&&t.producers[n]!==e&&Qo(t)&&en(t.producers[n],t),t.producers[n]!==e&&(t.producers[n]=e,Qo(t)&&Rs(e,t)),t.producerLastReadVersions[n]=e.version}function Qo(e){return e.consumerIsAlwaysLive||e.liveConsumers&&e.liveConsumers.size>0}function Os(e){if(!e.liveConsumers||e.liveConsumers.size===0)return;let t=Ee;Ee=!0;try{for(let n of e.liveConsumers)n.dirty||Hc(n)}finally{Ee=t}}function Hc(e){e.dirty=!0,Os(e),e.consumerMarkedDirty.call(e.wrapper||e)}function br(e){if(!(!e.dirty&&e.lastCleanEpoch===ft)){if(!e.producerMustRecompute()&&!Uc(e)){e.dirty=!1,e.lastCleanEpoch=ft;return}e.producerRecomputeValue(),e.dirty=!1,e.lastCleanEpoch=ft}}function Uc(e){for(let t=0;t<e.producers.length;t++){let n=e.producers[t],r=e.producerLastReadVersions[t];if(r!==n.version||(br(n),r!==n.version))return!0}return!1}function Zo(e){e&&(e.nextProducerIndex=0);let t=X;return X=e,t}function ei(e,t){if(X=t,!!e){if(Qo(e))for(let n=e.nextProducerIndex;n<e.producers.length;n++)en(e.producers[n],e);for(;e.producers.length>e.nextProducerIndex;)e.producers.pop(),e.producerLastReadVersions.pop()}}var yr=class{constructor(t,n){this.__value=t,this.version=0,this.lastCleanEpoch=ft,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.liveConsumers=void 0,this.consumerAllowSignalWrites=!0,this.consumerIsAlwaysLive=!1,this.producerMustRecompute=ks,this.producerRecomputeValue=mr,this.consumerMarkedDirty=mr,this.wrapper=this,this.__isSignal=!0,this.__equal=n?.equals||Cs,this.watched=n?.[ni],this.unwatched=n?.[ri]}get(){return ti(this),this.__value}peek(){return this.__value}set(t){if(Ee)throw new Error("Signal write during notification phase");this.__equal.call(this,this.__value,t)||(this.__value=t,this.version++,ft++,ut!==null?Ls(this):Os(this))}};function Ls(e){let t=Ee;Ee=!0;try{if(!e.liveConsumers)return;for(let n of e.liveConsumers)n.dirty||(n.dirty=!0,n.__isWatcher?ut.add(n):Ls(n))}finally{Ee=t}}var Jo=Symbol("unset"),Xo=Symbol("computing"),hr=Symbol("errored"),tn=class{constructor(t,n){this.__fn=t,this.__value=Jo,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||Cs,this.watched=n?.[ni],this.unwatched=n?.[ri];let r=this;this.producerMustRecompute=function(){return r.__value===Jo||r.__value===Xo},this.producerRecomputeValue=function(){if(r.__value===Xo)throw new Error("Detected cycle in computations.");let o=r.__value;r.__value=Xo;let i=Zo(r),s,a=!1;try{s=r.__fn.call(r.wrapper)}catch(l){s=hr,r.__error=l,a=!0}finally{ei(r,i)}if(!a&&(o!==Jo&&o!==hr)&&r.__equal.call(r.wrapper,o,s)){r.__value=o;return}r.__value=s,r.version++},this.consumerMarkedDirty=mr}get(){if(br(this),ti(this),this.__value===hr)throw this.__error;return this.__value}peek(){if(br(this),this.__value===hr)throw this.__error;return this.__value}},gr=class{constructor(t){this.__notify=t,this.version=0,this.lastCleanEpoch=ft,this.dirty=!1,this.producers=[],this.producerLastReadVersions=[],this.nextProducerIndex=0,this.liveConsumers=void 0,this.consumerAllowSignalWrites=!1,this.consumerIsAlwaysLive=!0,this.producerMustRecompute=ks,this.producerRecomputeValue=mr,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=Zo(this);try{for(let r of t)ti(r),r.__isComputed&&br(r)}finally{ei(this,n)}this.dirty=!1}unwatch(...t){for(let n=this.producers.length-1;n>=0;n--)t.includes(this.producers[n])&&(en(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=Zo(this),r;try{r=t()}finally{ei(this,n)}return this.dirty=!1,r}dispose(){for(let t of this.producers)en(t,this);this.producers=[],this.producerLastReadVersions=[],this.__notify=null}},ni=Symbol("watched"),ri=Symbol("unwatched");function qc(e){let t=X;X=null;try{return e()}finally{X=t}}function Kc(e){return e.producers.slice()}function Wc(e){return e.liveConsumers?[...e.liveConsumers]:[]}function Vc(e){return!!e.liveConsumers&&e.liveConsumers.size>0}function zc(e){return e.producers.length>0}function Gc(){return X&&X.__isComputed?X:null}function Yc(e){Yo++,ut===null&&(ut=new Set);try{e()}finally{if(Yo--,Yo===0){let t=ut;ut=null;for(let n of t)n.__fire()}}}var nn={State:yr,Computed:tn,subtle:{Watcher:gr,untrack:qc,introspectSources:Kc,introspectSinks:Wc,hasSinks:Vc,hasSources:zc,currentComputed:Gc,watched:ni,unwatched:ri}};function Jc(e,t){return new yr(e,t)}function Xc(e,t){return new tn(e,t)}function Qc(e){return!!(e&&typeof e=="object"&&e.__isSignal===!0)}function Zc(e){let t=!1,n=!1,r=new tn(e),o=new gr(()=>{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())}}qe();var H=null;function ii(e){H=e}function Ps(e,t){let n=e&&e[_]?e:null;return n?He(n,t):t()}function _r(e){return e?e.nodeType===11&&e.host?e.host:e:null}function si(e,t){let n=e.__commitOwner,r=H;n&&(H=n);try{t()}finally{H=r}}function on(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 Q(e,t,n,r,o){if(Wt(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":nl(e,t,o);break;case"attr":{t==null||t===!1?e.el.removeAttribute(e.name):Jn(t,e.name,e.el.localName)||(Kt(t,e.name,e.el.localName),e.el.setAttribute(e.name,String(t)));break}case"prop":ls(t,e.name,e.el.localName),e.el[e.name]=t;break;case"bool":Kt(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":tl(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;Kt(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=dt(i);if(!c){e.applied=!0;return}if(!c.contains(i)){c.isConnected?queueMicrotask(s):e.applied=!0;return}if(e.applied=!0,el(i))return;let l=document.createDocumentFragment();for(;i.firstChild;)l.appendChild(i.firstChild);i[_e]=l,queueMicrotask(()=>q(c))},a=dt(i);a&&a.contains(i)?s():queueMicrotask(s);break}case"noop":break}}function dt(e){let t=e[Fe];if(t&&t.isConnected)return t;let n=e.parentElement;for(;n;){if(n[_])return n;n=n.parentElement}return null}function el(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 tl(e,t){let n=e,r=tr(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 nl(e,t,n){return dl(e,t),se(e,t,n)}function se(e,t,n){return Ps(e.marker&&e.marker.parentNode,()=>rl(e,t,n))}function rl(e,t,n){let r=e.marker;if(bo(t)){Te(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(Zn(t)){let i=t,s=e.__keyedKey;s!==void 0&&!Object.is(s,i.key)&&Te(e),e.__keyedKey=i.key,se(e,i.value,n);return}if(er(t)){let i=t,s=e.__guardDeps,a=i.deps;if(s!==void 0&&(Array.isArray(s)&&Array.isArray(a)?fl(s,a):Object.is(s,a)))return;let c=Array.isArray(a)?a.slice():a;se(e,i.fn(),n),e.__guardDeps=c;return}if(yo(t)){Te(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(tr(t))return;if(nr(t))return pl(e,t.value,n);if(rr(t))return hl(e,t.args,n);if(or(t))return ml(e,t.signal,n);if(go(t))return bl(e,t,n);if(wo(t))return yl(e,t,n);if(Qn(t)){if(e.child&&e.child.kind==="repeat"){sl(e,t,n);return}Te(e);let i={kind:"repeat",map:new Map};e.child=i,il(r,i,t,n);return}if(Array.isArray(t)){if(e.child&&e.child.kind==="array"){ll(e,t,n);return}Te(e);let i={kind:"array",items:[]};e.child=i,cl(r,i,t,n);return}if(e.child){let i=e.child;if(i.kind==="repeat")Is(i),e.child=void 0;else if(i.kind==="array")Fs(i),e.child=void 0;else if(i.kind==="async-stream")Hs(i),e.child=void 0;else if("strings"in e.child){let s=e.child;if(P(t)&&s.strings===t.strings){Ke(s,t.values,n);return}pt(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}=lt(i),l=s.content.cloneNode(!0),f=document.createComment(`${T}s`),u=document.createComment(`${T}e`),m=a.map(y=>on(y,l)),d=[];for(let y=0;y<i.values.length;y++)Q(m[y],i.values[y],void 0,i.values,n),d.push(i.values[y]);n&&n(c,m,i.values);let p=[f,...l.childNodes,u];r.parentNode?.insertBefore(ol(p),r);for(let y of m)y.kind==="slot"&&Q(y,void 0,void 0,[],n);e.child={strings:i.strings,bound:m,lastValues:d,startNode:f,endNode:u};return}let o=document.createTextNode(String(t));r.parentNode?.insertBefore(o,r),e.child=[o]}function Ke(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?Q(e.bound[s],t[s],e.lastValues[s],t,n):Q(i,o,e.lastValues[r],t,n)}catch(a){throw e.lastValues[r]=js,i.kind==="noop"&&s!=null&&(e.lastValues[s]=js),a}e.lastValues[r]=o}n&&n(dr.get(e.strings)?.formActions??null,e.bound,t)}var js=Symbol("webjs.commitFailed");function pt(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 ol(e){let t=document.createDocumentFragment();for(let n of e)t.appendChild(n);return t}function ai(e,t){let{templateEl:n,parts:r,formActions:o}=lt(e),i=n.content.cloneNode(!0),s=document.createComment(`${T}s`),a=document.createComment(`${T}e`),c=r.map(u=>on(u,i)),l=[];for(let u=0;u<e.values.length;u++)Q(c[u],e.values[u],void 0,e.values,t),l.push(e.values[u]);t&&t(o,c,e.values);for(let u of c)u.kind==="slot"&&Q(u,void 0,void 0,[],t);let f=document.createDocumentFragment();for(f.appendChild(s);i.firstChild;)f.appendChild(i.firstChild);return f.appendChild(a),{inst:{strings:e.strings,bound:c,lastValues:l,startNode:s,endNode:a},frag:f}}function rn(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 il(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 f=i(o[l],l),u=s(o[l],l);if(!P(u))continue;let{inst:m,frag:d}=ai(u,r);t.map.set(f,m),c.appendChild(d)}a.insertBefore(c,e)}function sl(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 f=0;f<s.length;f++){let u=a(s[f],f),m=c(s[f],f);if(!P(m))continue;let d=i.map.get(u);if(d&&d.strings===m.strings)Ke(d,m.values,n),oi(d.startNode,d.endNode,o,r),l.set(u,d),i.map.delete(u);else{d&&(i.map.delete(u),rn(d),pt(d.startNode,d.endNode));let{inst:p,frag:y}=ai(m,n);o.insertBefore(y,r),l.set(u,p)}}for(let[f,u]of[...i.map]){i.map.delete(f);try{rn(u)}finally{pt(u.startNode,u.endNode)}}i.map=l}catch(f){for(let[u,m]of l)i.map.set(u,m);throw f}}function Is(e){for(let[t,n]of[...e.map]){e.map.delete(t);try{rn(n)}finally{pt(n.startNode,n.endNode)}}e.map.clear()}function al(e){return e.type==="tpl"?e.inst.startNode:e.type==="text"?e.node:null}function wr(e){e.type==="tpl"?(rn(e.inst),pt(e.inst.startNode,e.inst.endNode)):e.type==="text"&&e.node.parentNode?.removeChild(e.node)}function Ms(e,t){if(P(e)){let{inst:n,frag:r}=ai(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 cl(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}=Ms(a,r);l&&i.appendChild(l),s.push(c)}o.insertBefore(i,e),t.items=s}function ll(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 f=t[l],u=s[l];if(P(f)){let p=f;if(u&&u.type==="tpl"&&u.inst.strings===p.strings){Ke(u.inst,p.values,n),a.push(u),c=l+1;continue}}else if(f!=null&&f!==!1&&f!==!0){if(u&&u.type==="text"){let p=String(f);u.node.data!==p&&(u.node.data=p),a.push(u),c=l+1;continue}}else{u&&wr(u),a.push({type:"empty"}),c=l+1;continue}let{item:m,frag:d}=Ms(f,n);d&&o.insertBefore(d,ul(s,l,r)),a.push(m),u&&wr(u),c=l+1}for(let l=t.length;l<s.length;l++)wr(s[l]),c=l+1;i.items=a}catch(l){throw i.items=a.concat(s.slice(c)),l}}function ul(e,t,n){for(let r=t;r<e.length;r++){let o=al(e[r]);if(o&&o.parentNode)return o}return n}function Fs(e){for(let t of e.items)wr(t);e.items=[]}function oi(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 fl(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 Te(e){let t=e;if(t.__untilState&&(t.__untilState.aborted=!0,t.__untilState=void 0),t.__watchSub&&Bs(t),!e.child)return;let n=e.child;if(n.kind==="repeat")Is(n);else if(n.kind==="array")Fs(n);else if(n.kind==="async-stream")Hs(n);else if("strings"in n){let r=e.child;rn(r),pt(r.startNode,r.endNode)}else for(let r of e.child)r.parentNode&&r.parentNode.removeChild(r);e.child=void 0}function dl(e,t){let n=e;n.__untilState&&!rr(t)&&(n.__untilState.aborted=!0,n.__untilState=void 0),n.__guardDeps!==void 0&&!er(t)&&(n.__guardDeps=void 0),n.__cacheMap&&!nr(t)&&(n.__cacheMap=void 0),n.__keyedKey!==void 0&&!Zn(t)&&(n.__keyedKey=void 0),n.__watchSub&&!or(t)&&Bs(n)}function pl(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){Ke(c,t.values,n);return}let l=document.createDocumentFragment();oi(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&&Te(e),oi(l.inst.startNode,l.inst.endNode,r.parentNode,r),Ke(l.inst,c.values,n),e.child=l.inst;let f=new Set;for(let u=l.inst.startNode.nextSibling;u&&u!==l.inst.endNode;u=u.nextSibling){if(u.nodeType!==1)continue;let m=u;if(m.matches("slot[data-webjs-light]")){let d=dt(m);d&&f.add(d)}for(let d of m.querySelectorAll("slot[data-webjs-light]")){let p=dt(d);p&&f.add(p)}}for(let u of f)q(u);return}}se(e,t,n)}function hl(e,t,n){let r=e;H&&(r.__commitOwner=_r(H));let o=r.__untilState,i=r.__untilArgs,s=(d,p)=>!!(Object.is(d,p)||P(d)&&P(p)&&d.strings===p.strings),c=i&&i.length===t.length&&i.every((d,p)=>s(d,t[p]))&&o?o.highestResolved:1/0;o&&(o.aborted=!0),r.__untilArgs=t.slice();let l={aborted:!1,highestResolved:c};r.__untilState=l;let f=-1,u;for(let d=0;d<t.length;d++){let p=t[d];if(!p||typeof p.then!="function"){f=d,u=p;break}}f!==-1&&f<=l.highestResolved?(se(e,u,n),l.highestResolved=f):f===-1&&!r.__untilEverRendered&&se(e,"",n),r.__untilEverRendered=!0;let m=Math.min(f===-1?t.length:f,l.highestResolved);for(let d=0;d<m;d++){let p=t[d];!p||typeof p.then!="function"||Promise.resolve(p).then(y=>{if(!l.aborted&&!(d>=l.highestResolved)){try{si(e,()=>se(e,y,n))}catch(b){ci(e,b);return}l.highestResolved=d}},()=>{})}}function ci(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 ml(e,t,n){let r=e;if(H&&(r.__commitOwner=_r(H)),r.__watchSig===t&&r.__watchSub){let s;r.__watchSub.observe(()=>{s=t.get()}),se(e,s,n);return}r.__watchSub&&(r.__watchSub.dispose(),r.__watchSub=void 0),r.__watchSig=t;let o=new nn.subtle.Watcher(()=>{queueMicrotask(()=>{if(r.__watchSub!==o)return;let s;try{o.observe(()=>{s=t.get()}),si(e,()=>se(e,s,n))}catch(a){ci(e,a)}})});r.__watchSub=o;let i;o.observe(()=>{i=t.get()}),se(e,i,n)}function Bs(e){e.__watchSub&&(e.__watchSub.dispose(),e.__watchSub=void 0,e.__watchSig=void 0)}function bl(e,t,n){let r=e;H&&(r.__commitOwner=_r(H));let o=e.child;if(o&&o.kind==="async-stream"&&o.mode==="append"&&o.iterable===t.iterable)return;Te(e);let i=t.iterable[Symbol.asyncIterator](),s={kind:"async-stream",mode:"append",aborted:!1,iterable:t.iterable,iterator:i,nodes:[]};e.child=s,$s(s,e,t,n)}function yl(e,t,n){let r=e;H&&(r.__commitOwner=_r(H));let o=e.child;if(o&&o.kind==="async-stream"&&o.mode==="replace"&&o.iterable===t.iterable)return;Te(e);let i=t.iterable[Symbol.asyncIterator](),s={kind:"async-stream",mode:"replace",aborted:!1,iterable:t.iterable,iterator:i,nodes:[]};e.child=s,$s(s,e,t,n)}async function $s(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{si(t,()=>{let c=Ds(a,r);Ps(o.parentNode,()=>{if(e.mode==="replace"){for(let f of e.nodes)f.parentNode&&f.parentNode.removeChild(f);e.nodes=[]}let l=document.createDocumentFragment();for(let f of c)l.appendChild(f);o.parentNode?.insertBefore(l,o),e.nodes.push(...c)})})}catch(c){e.aborted=!0;try{e.iterator.return?.()?.catch?.(()=>{})}catch{}ci(t,c);return}i++}}function Ds(e,t){if(e==null||e===!1||e===!0)return[];if(P(e)){let n=e,{templateEl:r,parts:o,formActions:i}=lt(n),s=r.content.cloneNode(!0),a=o.map(c=>on(c,s));for(let c=0;c<n.values.length;c++)Q(a[c],n.values[c],void 0,n.values,t);t&&t(i,a,n.values);for(let c of a)c.kind==="slot"&&Q(c,void 0,void 0,[],t);return[...s.childNodes]}if(Array.isArray(e)){let n=[];for(let r of e)n.push(...Ds(r,t));return n}return[document.createTextNode(String(e))]}function Hs(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 We(e,t){let n=t,r=n[C];n[C]=!0;let o=H;ii(t);try{let i=n[Zt];if(P(e)){let s=e;if(i&&i.strings===s.strings){Ke(i,s.values,Ar);return}i&&Us(i,t);let a=t.firstChild;a&&a.nodeType===8&&a.data==="webjs-hydrate"&&a.remove(),n[Zt]=null;let c=_l(s,t);n[Zt]=c;return}if(i&&Us(i,t),n[Zt]=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{ii(o),n[C]=r,r||ar(n)}}function Ar(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(Jn(ht(n[l]),s,o.tag)){i=l;break}let a=t[i];if(!a||!a.el)continue;let c=ht(n[i]);if(o.isForm)ds(a.el,c,Sr(o.methodParts,o.staticMethod,n),Sr(o.enctypeParts,o.staticEnctype,n),o);else{let l=f=>f.some(u=>u.kind==="bool"?!!ht(n[u.i]):!0);wl(a.el,c,o,l(o.nameParts),l(o.valueParts),Sr(o.methodParts,o.staticMethod,n),Sr(o.enctypeParts,o.staticEnctype,n))}}}function gl(e){(pr.has(e)||e.getAttribute("name")===I)&&(e.getAttribute("name")===I&&e.removeAttribute("name"),e.removeAttribute("value"),pr.delete(e))}function wl(e,t,n,r,o,i,s){let a=typeof t=="function"?po(t):null;if(!a){typeof t=="function"&&mo(null,e.localName),gl(e),ps(e,i,s,n.propAttrs);return}as(n.duplicateAction,e.localName),cs(n.propAttrs,e.localName),n.staticAction&&is(e.localName),(n.authoredValue||o)&&os(e.localName),(n.authoredName||r)&&ns(e.getAttribute("name")||I,e.localName,!1),(n.authoredForm||e.hasAttribute("form"))&&ss(e.localName),rs(e.localName,e.getAttribute("type"));let c=fs(e.localName,i,s);e.removeAttribute("formaction"),e.setAttribute("name",I),e.setAttribute("value",a),qt(e,"formmethod",i,c.formMethod),qt(e,"formenctype",s,c.formEnctype),pr.set(e,a)}function Sr(e,t,n){for(let r of e){if(r.kind==="bool")return ht(n[r.i])?"":V;if(r.kind==="attr"){let a=ht(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(ht(n[i[a]])??""),s+=o[a+1]||"";return s}return t??V}function ht(e){return Wt(e)?e.value:e}function _l(e,t){let{templateEl:n,parts:r,formActions:o}=lt(e),i=n.content.cloneNode(!0),s=document.createComment(`${T}s`),a=document.createComment(`${T}e`),c=r.map(u=>on(u,i)),l=[];for(let u=0;u<e.values.length;u++)Q(c[u],e.values[u],void 0,e.values,Ar),l.push(e.values[u]);Ar(o,c,e.values),t.replaceChildren(s,...i.childNodes,a);let f=t.nodeType===1&&t[_]?t:null;for(let u of c)u.kind==="slot"&&(f&&u.slotEl&&(u.slotEl[Fe]=f),Q(u,void 0,void 0,[],Ar));return{strings:e.strings,bound:c,lastValues:l,startNode:s,endNode:a}}function Us(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=dt(n.slotEl);r&&Go(r,n.slotEl)}}t.replaceChildren()}function qs(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 Sl(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function Ks(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||Sl(r))===t)return{propName:r,def:i}}}var Ws=null;function vr(e){Ws=e||null}function Al(){return Ws||void 0}we();var Vs=Symbol.for("webjs:registry"),zs=Symbol.for("webjs:classToTag"),xr=globalThis,ae=xr[Vs]||(xr[Vs]=new Map),Gs=xr[zs]||(xr[zs]=new WeakMap),Er=typeof window<"u"&&typeof customElements<"u";function li(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=ae.get(e);r?(r.cls=t,r.lazy=n):ae.set(e,{cls:t,moduleUrl:null,lazy:n,tag:e}),Gs.set(t,e)}if(Er){let e=customElements.define.bind(customElements);customElements.define=function(t,n,r){customElements.get(t)||e(t,n,r),li(t,n)}}if(!Er){let e=globalThis;e.customElements||(e.customElements={define(t,n){li(t,n)},get(t){return ae.get(t)?.cls},upgrade(){},whenDefined(t){let n=ae.get(t);return Promise.resolve(n?.cls)}})}function ui(e,t){Er?customElements.define(e,t):li(e,t)}function vl(e,t){if(Er)return;let n=ae.get(e);if(n){n.moduleUrl=t;return}ae.set(e,{cls:null,moduleUrl:t,lazy:!1,tag:e})}function xl(e){return ae.get(e)?.cls}function El(e){return ae.get(e)?.moduleUrl||null}function Tl(e){return ae.get(e)?.lazy===!0}function Ve(e){return Gs.get(e)}function Nl(){return[...ae.keys()]}cn();qe();function Dl(){return{states:new Set,shadowRoot:null,form:null,labels:[],role:"",willValidate:!0,validity:{},validationMessage:"",setFormValue(){},setValidity(){},checkValidity(){return!0},reportValidity(){return!0}}}var ln=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=Dl(),this.__internals}},Hl=["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 Hl){let t="aria-"+e.slice(4).toLowerCase();Object.defineProperty(ln.prototype,e,{configurable:!0,get(){return this.getAttribute(t)},set(n){n==null?this.removeAttribute(t):this.setAttribute(t,String(n))}})}function Zs(e,t){return e!==t}function ea(e){try{return String(e)}catch{return Object.prototype.toString.call(e)}}function di(e,t,n){if(typeof console>"u"||!console.warn)return;let r=Ve(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 ta(e,t,n,r){if(typeof console>"u"||!console.warn)return;let o=Ve(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 na(e,t={}){return e&&typeof e=="object"&&!("call"in e)&&(t=e,e=void 0),{...e?{type:e}:{},...t}}var ia=typeof window<"u"&&typeof HTMLElement<"u",Ul=ia?HTMLElement:ln,sa=Symbol("webjs.factoryProps"),ra=new WeakSet,mt=class e extends Ul{static shadow=!1;static hydrate=void 0;static properties={};static styles=null;static register(t){ui(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||oa(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(ra.has(t))return;let n=t;for(;n&&n!==e;){if(Object.hasOwn(n,"properties")&&!Object.hasOwn(n,sa)){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)}ra.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||Zs)(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||oa(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),di(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),ta(this,t,o,a&&a.message)}s&&this.setAttribute(o,i)}else Xn(n)?(this.removeAttribute(o),di(this,t,o)):this.setAttribute(o,String(n))}finally{this.__reflectingAttribute=!1}}}connectedCallback(){if(!ia)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=ql(r.slice(16));try{this[i]=Ge(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:ao(r)?[r]:[];if(o.length){if(n){let i=this.shadowRoot.querySelector("style");i&&i.remove()}co(this._renderRoot,o)}}else this._renderRoot=this,t.styles&&console.warn(`[webjs] <${Ve(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().`),Vt(this)?Oo(this):this.__isHydrating()||this.hasAttribute("data-wj-serialized")||zo(this)?(this.removeAttribute("data-wj-serialized"),F(this),xo(this)):vo(this),Bo(this),ko(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),Ro(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=Ks(this.constructor,t);if(o===void 0)return;let{propName:i,def:s}=o,a=qs(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,vr(this.__renderAbort?this.__renderAbort.signal:null);try{let o=this.update(t);o&&typeof o.then=="function"&&(r=o)}catch(o){this._handleRenderError(o)}finally{vr(null)}if(!r){for(let o of this.__controllers)o.hostUpdated&&o.hostUpdated();n=!0}}}catch(o){console.error("[webjs] lifecycle hook threw during update phase:",o)}finally{this._isUpdating=!1,(n||r)&&(this._changedProperties=new Map)}if(r){let o=this.__renderToken;this.__pendingAsyncCommits=(this.__pendingAsyncCommits||0)+1;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(ea(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 nn.subtle.Watcher(()=>{this._connected&&this.requestUpdate()}));let n;if(this.__signalWatcher.observe(()=>{n=this.render()}),n&&typeof n.then=="function")return this._commitAsync(n);We(n,this._renderRoot)}_commitAsync(t){let n=this.__renderToken;if(this.__firstRendered&&this._overridesRenderFallback())try{let r=this.renderFallback();r!==void 0&&We(r,this._renderRoot)}catch(r){console.error("[webjs] renderFallback() threw:",r)}return Promise.resolve(t).then(r=>{if(n===this.__renderToken)try{We(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!==un.prototype.renderFallback}_handleRenderError(t){console.error(`[webjs] render error in <${Ve(this.constructor)||this.tagName?.toLowerCase()}>:`,t);try{let n=this.renderError(t);n!==void 0&&We(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 oa(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function ql(e){return e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function un(e){return new.target?Reflect.construct(mt,arguments,new.target):class extends mt{static properties=e;static[sa]=!0}}Object.setPrototypeOf(un,mt);un.prototype=mt.prototype;fo();var aa=Symbol.for("webjs.notFound"),ca=Symbol.for("webjs.redirect"),la=Symbol.for("webjs.forbidden"),ua=Symbol.for("webjs.unauthorized");function Kl(){let e=new Error("webjs: notFound()");throw e.__webjs=aa,e}function Wl(){let e=new Error("webjs: forbidden()");throw e.__webjs=la,e}function Vl(){let e=new Error("webjs: unauthorized()");throw e.__webjs=ua,e}function zl(e,t){let n=typeof t=="object"&&t!==null?t.status:t,r=new Error(`webjs: redirect(${e})`);throw r.__webjs=ca,r.url=e,r.status=typeof n=="number"?n:void 0,r}function Gl(e){return!!e&&e.__webjs===aa}function Yl(e){return!!e&&e.__webjs===ca}function Jl(e){return!!e&&e.__webjs===la}function Xl(e){return!!e&&e.__webjs===ua}var fa=null;function Ql(){if(!fa)return"";try{return fa()||""}catch{return""}}var da=null;function Zl(e){if(typeof e!="string"||!e||!da)return e;try{return da(e)||e}catch{return e}}we();var ep=Symbol.for("webjs.suspense");function eu(e){return{_$webjsSuspense:!0,fallback:e.fallback,children:e.children}}function tu(e){return!!e&&typeof e=="object"&&e._$webjsSuspense===!0}function nu(e,t={}){let n=t.reconnect!==!1,r=0,o=!1,i=null,s=[];function a(){o||(i=new WebSocket(ru(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 ru(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}`}cn();var pi="application/vnd.webjs+json";async function ou(e,t={}){let n=new Headers(t.headers||{});n.has("accept")||n.set("accept",pi);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 fi(r),n.has("content-type")||n.set("content-type",pi));let o=await fetch(e,{...t,headers:n,body:r}),i=o.headers.get("content-type")||"",s=await o.text(),a=i.includes(pi)?s?Ge(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}cn();Nr();Nr();bi();pn();var Vi=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 Ku(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 Wu(e,t,n){return e&&typeof e.get=="function"&&typeof e.set=="function"?Ku(e,t,n):new Vi(e,t)}kr();Or();var Vu="application/vnd.webjs+stream",zu=1,Gu=2,Yu=3,rc=new Uint8Array(0);function Ju(e,t){let n=t||rc,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 Xu(){let e=rc;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 Qu=Symbol.for("webjs.context");function Zu(e){return{__context__:Qu,name:e}}var oo=class extends Event{constructor(t,n,r=!1){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.callback=n,this.subscribe=r}},zi=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()}},Gi=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 oo(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 ef(){return typeof window<"u"}var ge={INITIAL:0,PENDING:1,COMPLETE:2,ERROR:3},Yi=class{constructor(t,{task:n,args:r,autoRun:o=!0}){this._host=t,this._taskFn=n,this._argsFn=r||(()=>[]),this._autoRun=o,this._status=ge.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=ge.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=ge.COMPLETE,this._error=void 0}catch(r){if(t.signal.aborted)return;this._error=r,this._status=ge.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 ge.INITIAL:return t.initial?.();case ge.PENDING:return t.pending?.();case ge.COMPLETE:return t.complete?.(this._value);case ge.ERROR:return t.error?.(this._error);default:return}}hostUpdate(){if(!this._autoRun||!ef())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{Gi as ContextConsumer,zi as ContextProvider,oo as ContextRequestEvent,I as FORM_ACTION_FIELD,ts as FORM_ACTION_ID_KEY,zu as FRAME_CHUNK,Gu as FRAME_END,Yu as FRAME_ERROR,T as MARKER,Sa as SEED_MISS,Vu as STREAM_CONTENT_TYPE,nn as Signal,eu as Suspense,Yi as Task,ge as TaskStatus,un as WebComponent,mi as WebjsFrame,yi as WebjsStream,Al as activeActionSignal,co as adoptStyles,Nl as allTags,Zl as asset,Rc as asyncAppend,Oc as asyncReplace,Yc as batch,Cc as cache,Xc as computed,nu as connectWS,_u as consumeStale,Zu as createContext,Xu as createFrameDecoder,Nc as createRef,Ql as cspNonce,cc as css,Xs as deserialize,qi as disableClientRouter,Zc as effect,Gn as enableClientRouter,Ju as encodeFrame,es as escapeAttr,uc as escapeText,gu as fetchMark,Wl as forbidden,xc as guard,ac as html,go as isAsyncAppend,wo as isAsyncReplace,ao as isCSS,nr as isCache,Jl as isForbidden,er as isGuard,Zn as isKeyed,Tl as isLazy,Wt as isLive,Gl as isNotFound,Yl as isRedirect,tr as isRef,Qn as isRepeat,Qc as isSignal,tu as isSuspense,P as isTemplate,yo as isTemplateContent,Xl as isUnauthorized,bo as isUnsafeHTML,rr as isUntil,or as isWatch,vc as keyed,Ac as live,Wi as loadFrame,xl as lookup,El as lookupModuleUrl,Ai as markStale,Ki as navigate,Kl as notFound,Wu as optimistic,Ge as parse,vi as parseTagHeader,vl as primeModuleUrl,na as prop,zl as redirect,Tc as ref,ro as refreshPage,ui as register,wu as registerKeyTags,We as render,gi as renderStream,ms as repeat,no as revalidate,ou as richFetch,Cr as scanSeeds,bu as seedStats,Js as serialize,vr as setActiveActionSignal,Jc as signal,fi as stringify,lc as stylesToString,Ve as tagOf,mu as takeSeed,Ec as templateContent,Vl as unauthorized,Sc as unsafeHTML,kc as until,Lc as watch};
6
6
  //# sourceMappingURL=webjs-core-browser.js.map