diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5da0a3cb4..bbbbeb0aa 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -17,6 +17,7 @@ Each tagged version of Datastar is accompanied by a release note. Read the [rele
- Whitespace is now maintained in merged fragments ([#658](https://github.com/starfederation/datastar/issues/658)).
- Attribute plugins now define a hash of their contents, preventing duplicate applies ([#691](https://github.com/starfederation/datastar/issues/691)).
- Attribute plugins are now applied to the `html` element instead of the `body` element ([#691](https://github.com/starfederation/datastar/issues/691)).
+- Removed Datastar singleton and export functions directly for `setAlias`, `load`, `apply`
### Fixed
diff --git a/README.md b/README.md
index 82bac51e3..a115c0f4c 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,7 @@
Datastar helps you build reactive web applications with the simplicity of server-side rendering and the power of a full-stack SPA framework.
-Getting started is as easy as adding a single 14.4 KiB script tag to your HTML.
+Getting started is as easy as adding a single 14.3 KiB script tag to your HTML.
```html
diff --git a/bundles/datastar-aliased.js b/bundles/datastar-aliased.js
index 5770599f8..e389a8dfc 100644
--- a/bundles/datastar-aliased.js
+++ b/bundles/datastar-aliased.js
@@ -1,13 +1,13 @@
// Datastar v1.0.0-beta.7
-var $e=/🖕JS_DS🚀/.source,he=$e.slice(0,5),Pe=$e.slice(4),D="datastar";var Ge="Datastar-Request",ve=300,Ue=1e3,Be="type module",ye=!1,je=!1,Ke=!0,W={Morph:"morph",Inner:"inner",Outer:"outer",Prepend:"prepend",Append:"append",Before:"before",After:"after",UpsertAttributes:"upsertAttributes"},Je=W.Morph,k={MergeFragments:"datastar-merge-fragments",MergeSignals:"datastar-merge-signals",RemoveFragments:"datastar-remove-fragments",RemoveSignals:"datastar-remove-signals",ExecuteScript:"datastar-execute-script"};var w=(r=>(r[r.Attribute=1]="Attribute",r[r.Watcher=2]="Watcher",r[r.Action=3]="Action",r))(w||{});var ae=`${D}-signals`;var K=t=>t.trim()==="true",le=t=>t.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,n)=>(n?"-":"")+e.toLowerCase()),Y=t=>le(t).replace(/-./g,e=>e[1].toUpperCase()),Ce=t=>le(t).replace(/-/g,"_"),hn=t=>Y(t).replace(/^./,e=>e[0].toUpperCase()),be=t=>new Function(`return Object.assign({}, ${t})`)(),J=t=>t.startsWith("$")?t.slice(1):t,vn={kebab:le,snake:Ce,pascal:hn};function V(t,e){for(let n of e.get("case")||[]){let r=vn[n];r&&(t=r(t))}return t}var yn="computed",ze={type:1,name:yn,keyReq:1,valReq:1,onLoad:({key:t,mods:e,signals:n,genRX:r})=>{t=V(t,e);let i=r();n.setComputed(t,i)}};var Ye={type:1,name:"signals",removeOnLoad:()=>!0,onLoad:t=>{let{key:e,mods:n,signals:r,value:i,genRX:s}=t,l=n.has("ifmissing");if(e!==""){let o=V(e,n),m=i===""?i:s()();l?r.upsertIfMissing(o,m):r.setValue(o,m)}else{let o=be(t.value);t.value=JSON.stringify(o);let S=s()();r.merge(S,l)}}};var Xe={type:1,name:"star",keyReq:2,valReq:2,onLoad:()=>{alert("YOU ARE PROBABLY OVERCOMPLICATING IT")}};var Z=class{#e=0;#t;constructor(e=D){this.#t=e}with(e){if(typeof e=="string")for(let n of e.split(""))this.with(n.charCodeAt(0));else typeof e=="boolean"?this.with(1<<(e?7:3)):this.#e=(this.#e<<5)-this.#e+e;return this}get value(){return this.#e}get string(){return this.#t+Math.abs(this.#e).toString(36)}};function Qe(t){if(t.id)return t.id;let e=new Z,n=t;for(;n;){if(e.with(n.tagName||""),n.id){e.with(n.id);break}let r=n?.parentNode;r&&e.with([...r.children].indexOf(n)),n=r}return e.string}function Ze(t,e){return new Z().with(t).with(e).value}function Ie(t,e){if(!t||!(t instanceof HTMLElement||t instanceof SVGElement))return null;let n=t.dataset;if("starIgnore"in n)return null;"starIgnore__self"in n||e(t);let r=t.firstElementChild;for(;r;)Ie(r,e),r=r.nextElementSibling}var bn="https://data-star.dev/errors";function Le(t,e,n={}){let r=new Error;r.name=`${D} ${t} error`;let i=Ce(e),s=new URLSearchParams({metadata:JSON.stringify(n)}).toString(),l=JSON.stringify(n,null,2);return r.message=`${e}
-More info: ${bn}/${t}/${i}?${s}
-Context: ${l}`,r}function $(t,e,n={}){return Le("internal",e,Object.assign({from:t},n))}function H(t,e,n={}){let r={plugin:{name:e.plugin.name,type:w[e.plugin.type]}};return Le("init",t,Object.assign(r,n))}function M(t,e,n={}){let r={plugin:{name:e.plugin.name,type:w[e.plugin.type]},element:{id:e.el.id,tag:e.el.tagName},expression:{rawKey:e.rawKey,key:e.key,value:e.value,validSignals:e.signals.paths(),fnContent:e.fnContent}};return Le("runtime",t,Object.assign(r,n))}var ee="preact-signals",Sn=Symbol.for("preact-signals"),G=1,te=2,ce=4,re=8,Se=16,ne=32;function De(){Te++}function ke(){if(Te>1){Te--;return}let t,e=!1;for(;ue!==void 0;){let n=ue;for(ue=void 0,Ve++;n!==void 0;){let r=n._nextBatchedEffect;if(n._nextBatchedEffect=void 0,n._flags&=~te,!(n._flags&re)&&tt(n))try{n._callback()}catch(i){e||(t=i,e=!0)}n=r}}if(Ve=0,Te--,e)throw t}var P;var ue,Te=0,Ve=0,Ae=0;function et(t){if(P===void 0)return;let e=t._node;if(e===void 0||e._target!==P)return e={_version:0,_source:t,_prevSource:P._sources,_nextSource:void 0,_target:P,_prevTarget:void 0,_nextTarget:void 0,_rollbackNode:e},P._sources!==void 0&&(P._sources._nextSource=e),P._sources=e,t._node=e,P._flags&ne&&t._subscribe(e),e;if(e._version===-1)return e._version=0,e._nextSource!==void 0&&(e._nextSource._prevSource=e._prevSource,e._prevSource!==void 0&&(e._prevSource._nextSource=e._nextSource),e._prevSource=P._sources,e._nextSource=void 0,P._sources._nextSource=e,P._sources=e),e}function C(t){this._value=t,this._version=0,this._node=void 0,this._targets=void 0}C.prototype.brand=Sn;C.prototype._refresh=()=>!0;C.prototype._subscribe=function(t){this._targets!==t&&t._prevTarget===void 0&&(t._nextTarget=this._targets,this._targets!==void 0&&(this._targets._prevTarget=t),this._targets=t)};C.prototype._unsubscribe=function(t){if(this._targets!==void 0){let e=t._prevTarget,n=t._nextTarget;e!==void 0&&(e._nextTarget=n,t._prevTarget=void 0),n!==void 0&&(n._prevTarget=e,t._nextTarget=void 0),t===this._targets&&(this._targets=n)}};C.prototype.subscribe=function(t){return Ee(()=>{let e=this.value,n=P;P=void 0;try{t(e)}finally{P=n}})};C.prototype.valueOf=function(){return this.value};C.prototype.toString=function(){return`${this.value}`};C.prototype.toJSON=function(){return this.value};C.prototype.peek=function(){let t=P;P=void 0;try{return this.value}finally{P=t}};Object.defineProperty(C.prototype,"value",{get(){let t=et(this);return t!==void 0&&(t._version=this._version),this._value},set(t){if(t!==this._value){if(Ve>100)throw $(ee,"SignalCycleDetected");let e=this._value,n=t;this._value=t,this._version++,Ae++,De();try{for(let r=this._targets;r!==void 0;r=r._nextTarget)r._target._notify()}finally{ke()}this?._onChange({old:e,revised:n})}}});function tt(t){for(let e=t._sources;e!==void 0;e=e._nextSource)if(e._source._version!==e._version||!e._source._refresh()||e._source._version!==e._version)return!0;return!1}function nt(t){for(let e=t._sources;e!==void 0;e=e._nextSource){let n=e._source._node;if(n!==void 0&&(e._rollbackNode=n),e._source._node=e,e._version=-1,e._nextSource===void 0){t._sources=e;break}}}function rt(t){let e=t._sources,n;for(;e!==void 0;){let r=e._prevSource;e._version===-1?(e._source._unsubscribe(e),r!==void 0&&(r._nextSource=e._nextSource),e._nextSource!==void 0&&(e._nextSource._prevSource=r)):n=e,e._source._node=e._rollbackNode,e._rollbackNode!==void 0&&(e._rollbackNode=void 0),e=r}t._sources=n}function X(t){C.call(this,void 0),this._fn=t,this._sources=void 0,this._globalVersion=Ae-1,this._flags=ce}X.prototype=new C;X.prototype._refresh=function(){if(this._flags&=~te,this._flags&G)return!1;if((this._flags&(ce|ne))===ne||(this._flags&=~ce,this._globalVersion===Ae))return!0;if(this._globalVersion=Ae,this._flags|=G,this._version>0&&!tt(this))return this._flags&=~G,!0;let t=P;try{nt(this),P=this;let e=this._fn();(this._flags&Se||this._value!==e||this._version===0)&&(this._value=e,this._flags&=~Se,this._version++)}catch(e){this._value=e,this._flags|=Se,this._version++}return P=t,rt(this),this._flags&=~G,!0};X.prototype._subscribe=function(t){if(this._targets===void 0){this._flags|=ce|ne;for(let e=this._sources;e!==void 0;e=e._nextSource)e._source._subscribe(e)}C.prototype._subscribe.call(this,t)};X.prototype._unsubscribe=function(t){if(this._targets!==void 0&&(C.prototype._unsubscribe.call(this,t),this._targets===void 0)){this._flags&=~ne;for(let e=this._sources;e!==void 0;e=e._nextSource)e._source._unsubscribe(e)}};X.prototype._notify=function(){if(!(this._flags&te)){this._flags|=ce|te;for(let t=this._targets;t!==void 0;t=t._nextTarget)t._target._notify()}};Object.defineProperty(X.prototype,"value",{get(){if(this._flags&G)throw $(ee,"SignalCycleDetected");let t=et(this);if(this._refresh(),t!==void 0&&(t._version=this._version),this._flags&Se)throw $(ee,"GetComputedError",{value:this._value});return this._value}});function it(t){return new X(t)}function st(t){let e=t._cleanup;if(t._cleanup=void 0,typeof e=="function"){De();let n=P;P=void 0;try{e()}catch(r){throw t._flags&=~G,t._flags|=re,Oe(t),$(ee,"CleanupEffectError",{error:r})}finally{P=n,ke()}}}function Oe(t){for(let e=t._sources;e!==void 0;e=e._nextSource)e._source._unsubscribe(e);t._fn=void 0,t._sources=void 0,st(t)}function Tn(t){if(P!==this)throw $(ee,"EndEffectError");rt(this),P=t,this._flags&=~G,this._flags&re&&Oe(this),ke()}function fe(t){this._fn=t,this._cleanup=void 0,this._sources=void 0,this._nextBatchedEffect=void 0,this._flags=ne}fe.prototype._callback=function(){let t=this._start();try{if(this._flags&re||this._fn===void 0)return;let e=this._fn();typeof e=="function"&&(this._cleanup=e)}finally{t()}};fe.prototype._start=function(){if(this._flags&G)throw $(ee,"SignalCycleDetected");this._flags|=G,this._flags&=~re,st(this),nt(this),De();let t=P;return P=this,Tn.bind(this,t)};fe.prototype._notify=function(){this._flags&te||(this._flags|=te,this._nextBatchedEffect=ue,ue=this)};fe.prototype._dispose=function(){this._flags|=re,this._flags&G||Oe(this)};function Ee(t){let e=new fe(t);try{e._callback()}catch(n){throw e._dispose(),n}return e._dispose.bind(e)}var ot="namespacedSignals",ie=t=>{document.dispatchEvent(new CustomEvent(ae,{detail:Object.assign({added:[],removed:[],updated:[]},t)}))};function at(t,e=!1){let n={};for(let r in t)if(Object.hasOwn(t,r)){if(e&&r.startsWith("_"))continue;let i=t[r];i instanceof C?n[r]=i.value:n[r]=at(i)}return n}function lt(t,e,n=!1){let r={added:[],removed:[],updated:[]};for(let i in e)if(Object.hasOwn(e,i)){if(i.match(/\_\_+/))throw $(ot,"InvalidSignalKey",{key:i});let s=e[i];if(s instanceof Object&&!Array.isArray(s)){t[i]||(t[i]={});let l=lt(t[i],s,n);r.added.push(...l.added.map(o=>`${i}.${o}`)),r.removed.push(...l.removed.map(o=>`${i}.${o}`)),r.updated.push(...l.updated.map(o=>`${i}.${o}`))}else{if(Object.hasOwn(t,i)){if(n)continue;let m=t[i];if(m instanceof C){let S=m.value;m.value=s,S!==s&&r.updated.push(i);continue}}let o=new C(s);o._onChange=()=>{ie({updated:[i]})},t[i]=o,r.added.push(i)}}return r}function ut(t,e){for(let n in t)if(Object.hasOwn(t,n)){let r=t[n];r instanceof C?e(n,r):ut(r,(i,s)=>{e(`${n}.${i}`,s)})}}function An(t,...e){let n={};for(let r of e){let i=r.split("."),s=t,l=n;for(let m=0;mn());this.setSignal(e,r)}value(e){return this.signal(e)?.value}setValue(e,n){let{signal:r}=this.upsertIfMissing(e,n),i=r.value;r.value=n,i!==n&&ie({updated:[e]})}upsertIfMissing(e,n){let r=e.split("."),i=this.#e;for(let m=0;m{ie({updated:[e]})},i[s]=o,ie({added:[e]}),{signal:o,inserted:!0}}remove(...e){if(!e.length){this.#e={};return}let n=Array();for(let r of e){let i=r.split("."),s=this.#e;for(let o=0;oe.push(n)),e}values(e=!1){return at(this.#e,e)}JSON(e=!0,n=!1){let r=this.values(n);return e?JSON.stringify(r,null,2):JSON.stringify(r)}toString(){return this.JSON()}};var xe=class{constructor(){this.aliasPrefix="";this.#e=new _e;this.#t=[];this.#r={};this.#s=[];this.#i=null;this.#n=new Map}#e;#t;#r;#s;#i;#n;get signals(){return this.#e}load(...e){let n=this;for(let r of e){let i={get signals(){return n.#e},effect:l=>Ee(l),actions:this.#r,plugin:r,apply:n.apply.bind(n)},s;switch(r.type){case 2:{let l=r;this.#s.push(l),s=l.onGlobalInit;break}case 3:{this.#r[r.name]=r;break}case 1:{let l=r;this.#t.push(l),s=l.onGlobalInit;break}default:throw H("InvalidPluginType",i)}s&&s(i)}this.#t.sort((r,i)=>{let s=i.name.length-r.name.length;return s!==0?s:r.name.localeCompare(i.name)})}apply(e=document.documentElement){Ie(e,n=>{let r=new Array,i=this.#n.get(n)||new Map,s=new Map([...i]),l=new Map;for(let o of Object.keys(n.dataset)){if(!o.startsWith(this.aliasPrefix))break;let m=n.dataset[o]||"",S=Ze(o,m);l.set(o,S),i.has(S)?s.delete(S):r.push(o)}for(let[o,m]of s)m();for(let o of r){let m=l.get(o);this.#a(n,o,m)}}),this.#o()}#o(){this.#i||(this.#i=new MutationObserver(e=>{let n=new Set,r=new Set;for(let{target:i,type:s,addedNodes:l,removedNodes:o}of e)switch(s){case"childList":{for(let m of o)n.add(m);for(let m of l)r.add(m)}break;case"attributes":{r.add(i);break}}for(let i of n){let s=this.#n.get(i);if(s){for(let[l,o]of s)o(),s.delete(l);s.size===0&&this.#n.delete(i)}}for(let i of r)this.apply(i)}),this.#i.observe(document.body,{attributes:!0,attributeOldValue:!0,childList:!0,subtree:!0}))}#a(e,n,r){let i=Y(n.slice(this.aliasPrefix.length)),s=this.#t.find(A=>i.startsWith(A.name));if(!s)return;e.id.length||(e.id=Qe(e));let[l,...o]=i.slice(s.name.length).split(/\_\_+/),m=l.length>0;m&&(l=Y(l));let S=e.dataset[n]||"",T=S.length>0,N=this,v={get signals(){return N.#e},apply:N.apply.bind(N),effect:A=>Ee(A),actions:this.#r,genRX:()=>this.#l(v,...s.argNames||[]),plugin:s,el:e,rawKey:i,key:l,value:S,mods:new Map},R=s.keyReq||0;if(m){if(R===2)throw M(`${s.name}KeyNotAllowed`,v)}else if(R===1)throw M(`${s.name}KeyRequired`,v);let y=s.valReq||0;if(T){if(y===2)throw M(`${s.name}ValueNotAllowed`,v)}else if(y===1)throw M(`${s.name}ValueRequired`,v);if(R===3||y===3){if(m&&T)throw M(`${s.name}KeyAndValueProvided`,v);if(!m&&!T)throw M(`${s.name}KeyOrValueRequired`,v)}for(let A of o){let[h,...a]=A.split(".");v.mods.set(Y(h),new Set(a.map(c=>c.toLowerCase())))}let E=s.onLoad(v);if(E){let A=this.#n.get(e);A||(A=new Map,this.#n.set(e,A)),A.set(r,E)}}#l(e,...n){let r="",i=/(\/(\\\/|[^\/])*\/|"(\\"|[^\"])*"|'(\\'|[^'])*'|`(\\`|[^`])*`|[^;])+/gm,s=e.value.trim().match(i);if(s){let y=s.length-1,E=s[y].trim();E.startsWith("return")||(s[y]=`return (${E});`),r=s.join(`;
-`)}let l=new Map,o=new RegExp(`(?:${he})(.*?)(?:${Pe})`,"gm");for(let y of r.matchAll(o)){let E=y[1],A=new Z("dsEscaped").with(E).string;l.set(A,E),r=r.replace(he+E+Pe,A)}let m=/@(\w*)\(/gm,S=r.matchAll(m),T=new Set;for(let y of S)T.add(y[1]);let N=new RegExp(`@(${Object.keys(this.#r).join("|")})\\(`,"gm");r=r.replaceAll(N,"ctx.actions.$1.fn(ctx,");let v=e.signals.paths();if(v.length){let y=new RegExp(`\\$(${v.join("|")})(\\W|$)`,"gm");r=r.replaceAll(y,"ctx.signals.signal('$1').value$2")}for(let[y,E]of l)r=r.replace(y,E);let R=`return (()=> {
-${r}
-})()`;e.fnContent=R;try{let y=new Function("ctx",...n,R);return(...E)=>{try{return y(e,...E)}catch(A){throw M("ExecuteExpression",e,{error:A.message})}}}catch(y){throw M("GenerateExpression",e,{error:y.message})}}};var ct=new xe;ct.load(Xe,Ye,ze);var de=ct;async function En(t,e){let n=t.getReader(),r;for(;!(r=await n.read()).done;)e(r.value)}function _n(t){let e,n,r,i=!1;return function(l){e===void 0?(e=l,n=0,r=-1):e=Rn(e,l);let o=e.length,m=0;for(;n0){let m=i.decode(l.subarray(0,o)),S=o+(l[o+1]===32?2:1),T=i.decode(l.subarray(S));switch(m){case"data":r.data=r.data?`${r.data}
-${T}`:T;break;case"event":r.event=T;break;case"id":t(r.id=T);break;case"retry":{let N=Number.parseInt(T,10);Number.isNaN(N)||e(r.retry=N);break}}}}}function Rn(t,e){let n=new Uint8Array(t.length+e.length);return n.set(t),n.set(e,t.length),n}function ft(){return{data:"",event:"",id:"",retry:void 0}}var wn="text/event-stream",dt="last-event-id";function pt(t,e,{signal:n,headers:r,onopen:i,onmessage:s,onclose:l,onerror:o,openWhenHidden:m,fetch:S,retryInterval:T=1e3,retryScaler:N=2,retryMaxWaitMs:v=3e4,retryMaxCount:R=10,...y}){return new Promise((E,A)=>{let h=0,a={...r};a.accept||(a.accept=wn);let c;function u(){c.abort(),document.hidden||b()}m||document.addEventListener("visibilitychange",u);let d=0;function g(){document.removeEventListener("visibilitychange",u),window.clearTimeout(d),c.abort()}n?.addEventListener("abort",()=>{g(),E()});let p=S??window.fetch,f=i??function(){};async function b(){c=new AbortController;try{let _=await p(e,{...y,headers:a,signal:c.signal});await f(_),await En(_.body,_n(xn(x=>{x?a[dt]=x:delete a[dt]},x=>{T=x},s))),l?.(),g(),E()}catch(_){if(!c.signal.aborted)try{let x=o?.(_)??T;window.clearTimeout(d),d=window.setTimeout(b,x),T*=N,T=Math.min(T,v),h++,h>=R?(g(),A(M("SseMaxRetries",t,{retryMaxCount:R}))):console.error(`Datastar failed to reach ${y.method}: ${e.toString()} retry in ${x}ms`)}catch(x){g(),A(x)}}}b()})}var se=`${D}-sse`,He=`${D}-settling`,Q=`${D}-swapping`,Re="started",we="finished",mt="error",gt="retrying";function U(t,e){document.addEventListener(se,n=>{if(n.detail.type!==t)return;let{argsRaw:r}=n.detail;e(r)})}function pe(t,e){document.dispatchEvent(new CustomEvent(se,{detail:{type:t,argsRaw:e}}))}var ht=t=>`${t}`.includes("text/event-stream"),B=async(t,e,n,r)=>{let{el:{id:i},el:s,signals:l}=t,{headers:o,contentType:m,includeLocal:S,selector:T,openWhenHidden:N,retryInterval:v,retryScaler:R,retryMaxWaitMs:y,retryMaxCount:E,abort:A}=Object.assign({headers:{},contentType:"json",includeLocal:!1,selector:null,openWhenHidden:!1,retryInterval:Ue,retryScaler:2,retryMaxWaitMs:3e4,retryMaxCount:10,abort:void 0},r),h=e.toLowerCase(),a=()=>{};try{if(pe(Re,{elId:i}),!n?.length)throw M("SseNoUrlProvided",t,{action:h});let c={};c[Ge]=!0,m==="json"&&(c["Content-Type"]="application/json");let u=Object.assign({},c,o),d={method:e,headers:u,openWhenHidden:N,retryInterval:v,retryScaler:R,retryMaxWaitMs:y,retryMaxCount:E,signal:A,onopen:async f=>{if(f.status>=400){let b=f.status.toString();pe(mt,{status:b})}},onmessage:f=>{if(!f.event.startsWith(D))return;let b=f.event,_={},x=f.data.split(`
-`);for(let F of x){let L=F.indexOf(" "),q=F.slice(0,L),j=_[q];j||(j=[],_[q]=j);let gn=F.slice(L+1);j.push(gn)}let I={};for(let[F,L]of Object.entries(_))I[F]=L.join(`
-`);pe(b,I)},onerror:f=>{if(ht(f))throw M("InvalidContentType",t,{url:n});f&&(console.error(f.message),pe(gt,{message:f.message}))}},g=new URL(n,window.location.origin),p=new URLSearchParams(g.search);if(m==="json"){let f=l.JSON(!1,!S);e==="GET"?p.set(D,f):d.body=f}else if(m==="form"){let f=T?document.querySelector(T):s.closest("form");if(f===null)throw T?M("SseFormNotFound",t,{action:h,selector:T}):M("SseClosestFormNotFound",t,{action:h});if(s!==f){let _=x=>x.preventDefault();f.addEventListener("submit",_),a=()=>f.removeEventListener("submit",_)}if(!f.checkValidity()){f.reportValidity(),a();return}let b=new FormData(f);if(e==="GET"){let _=new URLSearchParams(b);for(let[x,I]of _)p.set(x,I)}else d.body=b}else throw M("SseInvalidContentType",t,{action:h,contentType:m});g.search=p.toString();try{await pt(t,g.toString(),d)}catch(f){if(!ht(f))throw M("SseFetchFailed",t,{method:e,url:n,error:f})}}finally{pe(we,{elId:i}),a()}};var vt={type:3,name:"delete",fn:async(t,e,n)=>B(t,"DELETE",e,{...n})};var yt={type:3,name:"get",fn:async(t,e,n)=>B(t,"GET",e,{...n})};var bt={type:3,name:"patch",fn:async(t,e,n)=>B(t,"PATCH",e,{...n})};var St={type:3,name:"post",fn:async(t,e,n)=>B(t,"POST",e,{...n})};var Tt={type:3,name:"put",fn:async(t,e,n)=>B(t,"PUT",e,{...n})};var At={type:1,name:"indicator",keyReq:3,valReq:3,onLoad:({el:t,key:e,mods:n,signals:r,value:i})=>{let s=e?V(e,n):J(i),{signal:l}=r.upsertIfMissing(s,!1),o=m=>{let{type:S,argsRaw:{elId:T}}=m.detail;if(T===t.id)switch(S){case Re:l.value=!0;break;case we:l.value=!1;break}};return document.addEventListener(se,o),()=>{document.removeEventListener(se,o)}}};var Et={type:2,name:k.ExecuteScript,onGlobalInit:async t=>{U(k.ExecuteScript,({autoRemove:e=`${Ke}`,attributes:n=Be,script:r})=>{let i=K(e);if(!r?.length)throw H("NoScriptProvided",t);let s=document.createElement("script");for(let l of n.split(`
-`)){let o=l.indexOf(" "),m=o?l.slice(0,o):l,S=o?l.slice(o):"";s.setAttribute(m.trim(),S.trim())}s.text=r,document.head.appendChild(s),i&&s.remove()})}};var me=document,z=!!me.startViewTransition;var _t=function(){"use strict";let t=()=>{},e={morphStyle:"outerHTML",callbacks:{beforeNodeAdded:t,afterNodeAdded:t,beforeNodeMorphed:t,afterNodeMorphed:t,beforeNodeRemoved:t,afterNodeRemoved:t,beforeAttributeUpdated:t},head:{style:"merge",shouldPreserve:v=>v.getAttribute("im-preserve")==="true",shouldReAppend:v=>v.getAttribute("im-re-append")==="true",shouldRemove:t,afterHeadMorphed:t},restoreFocus:!0};function n(v,R,y={}){v=T(v);let E=N(R),A=S(v,E,y),h=i(A,()=>o(A,v,E,a=>a.morphStyle==="innerHTML"?(s(a,v,E),Array.from(v.childNodes)):r(a,v,E)));return A.pantry.remove(),h}function r(v,R,y){let E=N(R),A=Array.from(E.childNodes),h=A.indexOf(R),a=A.length-(h+1);return s(v,E,y,R,R.nextSibling),A=Array.from(E.childNodes),A.slice(h,A.length-a)}function i(v,R){if(!v.config.restoreFocus)return R();let y=document.activeElement;if(!(y instanceof HTMLInputElement||y instanceof HTMLTextAreaElement))return R();let{id:E,selectionStart:A,selectionEnd:h}=y,a=R();return E&&E!==document.activeElement?.id&&(y=v.target.querySelector(`#${E}`),y?.focus()),y&&!y.selectionEnd&&h&&y.setSelectionRange(A,h),a}let s=function(){function v(u,d,g,p=null,f=null){d instanceof HTMLTemplateElement&&g instanceof HTMLTemplateElement&&(d=d.content,g=g.content),p||=d.firstChild;for(let b of g.childNodes){if(p&&p!=f){let x=y(u,b,p,f);if(x){x!==p&&A(u,p,x),l(x,b,u),p=x.nextSibling;continue}}if(b instanceof Element&&u.persistentIds.has(b.id)){let x=h(d,b.id,p,u);l(x,b,u),p=x.nextSibling;continue}let _=R(d,b,p,u);_&&(p=_.nextSibling)}for(;p&&p!=f;){let b=p;p=p.nextSibling,E(u,b)}}function R(u,d,g,p){if(p.callbacks.beforeNodeAdded(d)===!1)return null;if(p.idMap.has(d)){let f=document.createElement(d.tagName);return u.insertBefore(f,g),l(f,d,p),p.callbacks.afterNodeAdded(f),f}else{let f=document.importNode(d,!0);return u.insertBefore(f,g),p.callbacks.afterNodeAdded(f),f}}let y=function(){function u(p,f,b,_){let x=null,I=f.nextSibling,F=0,L=b;for(;L&&L!=_;){if(g(L,f)){if(d(p,L,f))return L;x===null&&(p.idMap.has(L)||(x=L))}if(x===null&&I&&g(L,I)&&(F++,I=I.nextSibling,F>=2&&(x=void 0)),L.contains(document.activeElement))break;L=L.nextSibling}return x||null}function d(p,f,b){let _=p.idMap.get(f),x=p.idMap.get(b);if(!x||!_)return!1;for(let I of _)if(x.has(I))return!0;return!1}function g(p,f){let b=p,_=f;return b.nodeType===_.nodeType&&b.tagName===_.tagName&&(!b.id||b.id===_.id)}return u}();function E(u,d){if(u.idMap.has(d))c(u.pantry,d,null);else{if(u.callbacks.beforeNodeRemoved(d)===!1)return;d.parentNode?.removeChild(d),u.callbacks.afterNodeRemoved(d)}}function A(u,d,g){let p=d;for(;p&&p!==g;){let f=p;p=p.nextSibling,E(u,f)}return p}function h(u,d,g,p){let f=p.target.querySelector(`#${d}`)||p.pantry.querySelector(`#${d}`);return a(f,p),c(u,f,g),f}function a(u,d){let g=u.id;for(;u=u.parentNode;){let p=d.idMap.get(u);p&&(p.delete(g),p.size||d.idMap.delete(u))}}function c(u,d,g){if(u.moveBefore)try{u.moveBefore(d,g)}catch{u.insertBefore(d,g)}else u.insertBefore(d,g)}return v}(),l=function(){function v(a,c,u){return u.ignoreActive&&a===document.activeElement?null:(u.callbacks.beforeNodeMorphed(a,c)===!1||(a instanceof HTMLHeadElement&&u.head.ignore||(a instanceof HTMLHeadElement&&u.head.style!=="morph"?m(a,c,u):(R(a,c,u),h(a,u)||s(u,a,c))),u.callbacks.afterNodeMorphed(a,c)),a)}function R(a,c,u){let d=c.nodeType;if(d===1){let g=a,p=c,f=g.attributes,b=p.attributes;for(let _ of b)A(_.name,g,"update",u)||g.getAttribute(_.name)!==_.value&&g.setAttribute(_.name,_.value);for(let _=f.length-1;0<=_;_--){let x=f[_];if(x&&!p.hasAttribute(x.name)){if(A(x.name,g,"remove",u))continue;g.removeAttribute(x.name)}}h(g,u)||y(g,p,u)}(d===8||d===3)&&a.nodeValue!==c.nodeValue&&(a.nodeValue=c.nodeValue)}function y(a,c,u){if(a instanceof HTMLInputElement&&c instanceof HTMLInputElement&&c.type!=="file"){let d=c.value,g=a.value;E(a,c,"checked",u),E(a,c,"disabled",u),c.hasAttribute("value")?g!==d&&(A("value",a,"update",u)||(a.setAttribute("value",d),a.value=d)):A("value",a,"remove",u)||(a.value="",a.removeAttribute("value"))}else if(a instanceof HTMLOptionElement&&c instanceof HTMLOptionElement)E(a,c,"selected",u);else if(a instanceof HTMLTextAreaElement&&c instanceof HTMLTextAreaElement){let d=c.value,g=a.value;if(A("value",a,"update",u))return;d!==g&&(a.value=d),a.firstChild&&a.firstChild.nodeValue!==d&&(a.firstChild.nodeValue=d)}}function E(a,c,u,d){let g=c[u],p=a[u];if(g!==p){let f=A(u,a,"update",d);f||(a[u]=c[u]),g?f||a.setAttribute(u,""):A(u,a,"remove",d)||a.removeAttribute(u)}}function A(a,c,u,d){return a==="value"&&d.ignoreActiveValue&&c===document.activeElement?!0:d.callbacks.beforeAttributeUpdated(a,c,u)===!1}function h(a,c){return!!c.ignoreActiveValue&&a===document.activeElement&&a!==document.body}return v}();function o(v,R,y,E){if(v.head.block){let A=R.querySelector("head"),h=y.querySelector("head");if(A&&h){let a=m(A,h,v);return Promise.all(a).then(()=>{let c=Object.assign(v,{head:{block:!1,ignore:!0}});return E(c)})}}return E(v)}function m(v,R,y){let E=[],A=[],h=[],a=[],c=new Map;for(let d of R.children)c.set(d.outerHTML,d);for(let d of v.children){let g=c.has(d.outerHTML),p=y.head.shouldReAppend(d),f=y.head.shouldPreserve(d);g||f?p?A.push(d):(c.delete(d.outerHTML),h.push(d)):y.head.style==="append"?p&&(A.push(d),a.push(d)):y.head.shouldRemove(d)!==!1&&A.push(d)}a.push(...c.values());let u=[];for(let d of a){let g=document.createRange().createContextualFragment(d.outerHTML).firstChild;if(y.callbacks.beforeNodeAdded(g)!==!1){if("href"in g&&g.href||"src"in g&&g.src){let p,f=new Promise(function(b){p=b});g.addEventListener("load",function(){p()}),u.push(f)}v.appendChild(g),y.callbacks.afterNodeAdded(g),E.push(g)}}for(let d of A)y.callbacks.beforeNodeRemoved(d)!==!1&&(v.removeChild(d),y.callbacks.afterNodeRemoved(d));return y.head.afterHeadMorphed(v,{added:E,kept:h,removed:A}),u}let S=function(){function v(c,u,d){let{persistentIds:g,idMap:p}=h(c,u),f=R(d),b=f.morphStyle||"outerHTML";if(!["innerHTML","outerHTML"].includes(b))throw`Do not understand how to morph style ${b}`;return{target:c,newContent:u,config:f,morphStyle:b,ignoreActive:f.ignoreActive,ignoreActiveValue:f.ignoreActiveValue,restoreFocus:f.restoreFocus,idMap:p,persistentIds:g,pantry:y(),callbacks:f.callbacks,head:f.head}}function R(c){let u=Object.assign({},e);return Object.assign(u,c),u.callbacks=Object.assign({},e.callbacks,c.callbacks),u.head=Object.assign({},e.head,c.head),u}function y(){let c=document.createElement("div");return c.hidden=!0,document.body.insertAdjacentElement("afterend",c),c}function E(c){let u=Array.from(c.querySelectorAll("[id]"));return c.id&&u.push(c),u}function A(c,u,d,g){for(let p of g)if(u.has(p.id)){let f=p;for(;f;){let b=c.get(f);if(b==null&&(b=new Set,c.set(f,b)),b.add(p.id),f===d)break;f=f.parentElement}}}function h(c,u){let d=E(c),g=E(u),p=a(d,g),f=new Map;A(f,p,c,d);let b=u.__idiomorphRoot||u;return A(f,p,b,g),{persistentIds:p,idMap:f}}function a(c,u){let d=new Set,g=new Map;for(let{id:f,tagName:b}of c)g.has(f)?d.add(f):g.set(f,b);let p=new Set;for(let{id:f,tagName:b}of u)p.has(f)?d.add(f):g.get(f)===b&&p.add(f);for(let f of d)p.delete(f);return p}return v}(),{normalizeElement:T,normalizeParent:N}=function(){let v=new WeakSet;function R(h){return h instanceof Document?h.documentElement:h}function y(h){if(h==null)return document.createElement("div");if(typeof h=="string")return y(A(h));if(v.has(h))return h;if(h instanceof Node){if(h.parentNode)return E(h);{let a=document.createElement("div");return a.append(h),a}}else{let a=document.createElement("div");for(let c of[...h])a.append(c);return a}}function E(h){return{childNodes:[h],querySelectorAll:a=>{let c=h.querySelectorAll(a);return h.matches(a)?[h,...c]:c},insertBefore:(a,c)=>h.parentNode.insertBefore(a,c),moveBefore:(a,c)=>h.parentNode.moveBefore(a,c),get __idiomorphRoot(){return h}}}function A(h){let a=new DOMParser,c=h.replace(/