From 002b0dc24bd16b1a2cee777c2d73c25f9a37476d Mon Sep 17 00:00:00 2001 From: bigmistqke Date: Thu, 26 Sep 2024 18:50:46 +0000 Subject: [PATCH] deploy: bb4293fc2e49f4e3a0438fbd3ad66fcac6127ca2 --- assets/index-5d23e2b0.js | 284 +++++++++++++++++++++++++++++++++++++++ assets/index-80e03d37.js | 284 --------------------------------------- index.html | 2 +- 3 files changed, 285 insertions(+), 285 deletions(-) create mode 100644 assets/index-5d23e2b0.js delete mode 100644 assets/index-80e03d37.js diff --git a/assets/index-5d23e2b0.js b/assets/index-5d23e2b0.js new file mode 100644 index 0000000..d67e2d9 --- /dev/null +++ b/assets/index-5d23e2b0.js @@ -0,0 +1,284 @@ +(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();const ts=(t,e)=>t===e,Re=Symbol("solid-proxy"),Gn=Symbol("solid-track"),Fn={equals:ts};let ns=cs;const We=1,Un=2,rs={owned:null,cleanups:null,context:null,owner:null},gr={};var ce=null;let mr=null,Ra=null,le=null,_e=null,Xe=null,tr=0;function Je(t,e){const n=le,r=ce,i=t.length===0,o=e===void 0?r:e,s=i?rs:{owned:null,cleanups:null,context:o?o.context:null,owner:o},a=i?t:()=>t(()=>fe(()=>nr(s)));ce=s,le=null;try{return at(a,!0)}finally{le=n,ce=r}}function pe(t,e){e=e?Object.assign({},Fn,e):Fn;const n={value:t,observers:null,observerSlots:null,comparator:e.equals||void 0},r=i=>(typeof i=="function"&&(i=i(n.value)),as(n,i));return[ss.bind(n),r]}function Ri(t,e,n){const r=wn(t,e,!0,We);Et(r)}function Pe(t,e,n){const r=wn(t,e,!1,We);Et(r)}function Ee(t,e,n){ns=Ba;const r=wn(t,e,!1,We);(!n||!n.render)&&(r.user=!0),Xe?Xe.push(r):Et(r)}function de(t,e,n){n=n?Object.assign({},Fn,n):Fn;const r=wn(t,e,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Et(r),ss.bind(r)}function Ia(t){return t&&typeof t=="object"&&"then"in t}function Ye(t,e,n){let r,i,o;arguments.length===2&&typeof e=="object"||arguments.length===1?(r=!0,i=t,o=e||{}):(r=t,i=e,o=n||{});let s=null,a=gr,c=!1,u="initialValue"in o,h=typeof r=="function"&&de(r);const f=new Set,[d,T]=(o.storage||pe)(o.initialValue),[g,C]=pe(void 0),[k,m]=pe(void 0,{equals:!1}),[w,E]=pe(u?"ready":"unresolved");function A(y,p,b,S){return s===y&&(s=null,S!==void 0&&(u=!0),(y===a||p===a)&&o.onHydrated&&queueMicrotask(()=>o.onHydrated(S,{value:p})),a=gr,_(p,b)),p}function _(y,p){at(()=>{p===void 0&&T(()=>y),E(p!==void 0?"errored":u?"ready":"unresolved"),C(p);for(const b of f.keys())b.decrement();f.clear()},!1)}function l(){const y=ja,p=d(),b=g();if(b!==void 0&&!s)throw b;return le&&!le.user&&y&&Ri(()=>{k(),s&&(y.resolved||f.has(y)||(y.increment(),f.add(y)))}),p}function v(y=!0){if(y!==!1&&c)return;c=!1;const p=h?h():r;if(p==null||p===!1){A(s,fe(d));return}const b=a!==gr?a:fe(()=>i(p,{value:d(),refetching:y}));return Ia(b)?(s=b,"value"in b?(b.status==="success"?A(s,b.value,void 0,p):A(s,void 0,jr(b.value),p),b):(c=!0,queueMicrotask(()=>c=!1),at(()=>{E(u?"refreshing":"pending"),m()},!1),b.then(S=>A(b,S,void 0,p),S=>A(b,void 0,jr(S),p)))):(A(s,b,void 0,p),b)}return Object.defineProperties(l,{state:{get:()=>w()},error:{get:()=>g()},loading:{get(){const y=w();return y==="pending"||y==="refreshing"}},latest:{get(){if(!u)return l();const y=g();if(y&&!s)throw y;return d()}}}),h?Ri(()=>v(!1)):v(!1),[l,{refetch:v,mutate:T}]}function Ii(t,e=ts,n){const r=new Map,i=wn(o=>{const s=t();for(const[a,c]of r.entries())if(e(a,s)!==e(a,o))for(const u of c.values())u.state=We,u.pure?_e.push(u):Xe.push(u);return s},void 0,!0,We);return Et(i),o=>{const s=le;if(s){let a;(a=r.get(o))?a.add(s):r.set(o,a=new Set([s])),xe(()=>{a.delete(s),!a.size&&r.delete(o)})}return e(o,i.value)}}function ii(t){return at(t,!1)}function fe(t){if(le===null)return t();const e=le;le=null;try{return t()}finally{le=e}}function xa(t,e,n){const r=Array.isArray(t);let i,o=n&&n.defer;return s=>{let a;if(r){a=Array(t.length);for(let u=0;ue(a,i,s));return i=a,c}}function is(t){Ee(()=>fe(t))}function xe(t){return ce===null||(ce.cleanups===null?ce.cleanups=[t]:ce.cleanups.push(t)),t}function bt(){return le}function ft(){return ce}function os(t,e){const n=ce,r=le;ce=t,le=null;try{return at(e,!0)}catch(i){oi(i)}finally{ce=n,le=r}}function Na(t,e){const n=Symbol("context");return{id:n,Provider:Ga(n),defaultValue:t}}function Ma(t){let e;return ce&&ce.context&&(e=ce.context[t.id])!==void 0?e:t.defaultValue}function $a(t){const e=de(t),n=de(()=>Lr(e()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let ja;function ss(){if(this.sources&&this.state)if(this.state===We)Et(this);else{const t=_e;_e=null,at(()=>Hn(this),!1),_e=t}if(le){const t=this.observers?this.observers.length:0;le.sources?(le.sources.push(this),le.sourceSlots.push(t)):(le.sources=[this],le.sourceSlots=[t]),this.observers?(this.observers.push(le),this.observerSlots.push(le.sources.length-1)):(this.observers=[le],this.observerSlots=[le.sources.length-1])}return this.value}function as(t,e,n){let r=t.value;return(!t.comparator||!t.comparator(r,e))&&(t.value=e,t.observers&&t.observers.length&&at(()=>{for(let i=0;i1e6)throw _e=[],new Error},!1)),e}function Et(t){if(!t.fn)return;nr(t);const e=tr;La(t,t.value,e)}function La(t,e,n){let r;const i=ce,o=le;le=ce=t;try{r=t.fn(e)}catch(s){return t.pure&&(t.state=We,t.owned&&t.owned.forEach(nr),t.owned=null),t.updatedAt=n+1,oi(s)}finally{le=o,ce=i}(!t.updatedAt||t.updatedAt<=n)&&(t.updatedAt!=null&&"observers"in t?as(t,r):t.value=r,t.updatedAt=n)}function wn(t,e,n,r=We,i){const o={fn:t,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:e,owner:ce,context:ce?ce.context:null,pure:n};return ce===null||ce!==rs&&(ce.owned?ce.owned.push(o):ce.owned=[o]),o}function Wn(t){if(t.state===0)return;if(t.state===Un)return Hn(t);if(t.suspense&&fe(t.suspense.inFallback))return t.suspense.effects.push(t);const e=[t];for(;(t=t.owner)&&(!t.updatedAt||t.updatedAt=0;n--)if(t=e[n],t.state===We)Et(t);else if(t.state===Un){const r=_e;_e=null,at(()=>Hn(t,e[0]),!1),_e=r}}function at(t,e){if(_e)return t();let n=!1;e||(_e=[]),Xe?n=!0:Xe=[],tr++;try{const r=t();return Da(n),r}catch(r){n||(Xe=null),_e=null,oi(r)}}function Da(t){if(_e&&(cs(_e),_e=null),t)return;const e=Xe;Xe=null,e.length&&at(()=>ns(e),!1)}function cs(t){for(let e=0;e=0;e--)nr(t.owned[e]);t.owned=null}if(t.cleanups){for(e=t.cleanups.length-1;e>=0;e--)t.cleanups[e]();t.cleanups=null}t.state=0}function jr(t){return t instanceof Error?t:new Error(typeof t=="string"?t:"Unknown error",{cause:t})}function oi(t,e=ce){throw jr(t)}function Lr(t){if(typeof t=="function"&&!t.length)return Lr(t());if(Array.isArray(t)){const e=[];for(let n=0;ni=fe(()=>(ce.context={...ce.context,[t]:r.value},$a(()=>r.children))),void 0),i}}const Dr=Symbol("fallback");function zn(t){for(let e=0;e1?[]:null;return xe(()=>zn(o)),()=>{let c=t()||[],u=c.length,h,f;return c[Gn],fe(()=>{let T,g,C,k,m,w,E,A,_;if(u===0)s!==0&&(zn(o),o=[],r=[],i=[],s=0,a&&(a=[])),n.fallback&&(r=[Dr],i[0]=Je(l=>(o[0]=l,n.fallback())),s=1);else if(s===0){for(i=new Array(u),f=0;f=w&&A>=w&&r[E]===c[A];E--,A--)C[A]=i[E],k[A]=o[E],a&&(m[A]=a[E]);for(T=new Map,g=new Array(A+1),f=A;f>=w;f--)_=c[f],h=T.get(_),g[f]=h===void 0?-1:h,T.set(_,f);for(h=w;h<=E;h++)_=r[h],f=T.get(_),f!==void 0&&f!==-1?(C[f]=i[h],k[f]=o[h],a&&(m[f]=a[h]),f=g[f],T.set(_,f)):o[h]();for(f=w;fzn(o)),()=>{const u=t()||[],h=u.length;return u[Gn],fe(()=>{if(h===0)return a!==0&&(zn(o),o=[],r=[],i=[],a=0,s=[]),n.fallback&&(r=[Dr],i[0]=Je(d=>(o[0]=d,n.fallback())),a=1),i;for(r[0]===Dr&&(o[0](),o=[],r=[],i=[],a=0),c=0;cu[c]):c>=r.length&&(i[c]=Je(f));for(;ct(e||{}))}function On(){return!0}const Br={get(t,e,n){return e===Re?n:t.get(e)},has(t,e){return e===Re?!0:t.has(e)},set:On,deleteProperty:On,getOwnPropertyDescriptor(t,e){return{configurable:!0,enumerable:!0,get(){return t.get(e)},set:On,deleteProperty:On}},ownKeys(t){return t.keys()}};function yr(t){return(t=typeof t=="function"?t():t)?t:{}}function Ua(){for(let t=0,e=this.length;t=0;a--){const c=yr(t[a])[s];if(c!==void 0)return c}},has(s){for(let a=t.length-1;a>=0;a--)if(s in yr(t[a]))return!0;return!1},keys(){const s=[];for(let a=0;a=0;s--){const a=t[s];if(!a)continue;const c=Object.getOwnPropertyNames(a);for(let u=c.length-1;u>=0;u--){const h=c[u];if(h==="__proto__"||h==="constructor")continue;const f=Object.getOwnPropertyDescriptor(a,h);if(!r[h])r[h]=f.get?{enumerable:!0,configurable:!0,get:Ua.bind(n[h]=[f.get.bind(a)])}:f.value!==void 0?f:void 0;else{const d=n[h];d&&(f.get?d.push(f.get.bind(a)):f.value!==void 0&&d.push(()=>f.value))}}}const i={},o=Object.keys(r);for(let s=o.length-1;s>=0;s--){const a=o[s],c=r[a];c&&c.get?Object.defineProperty(i,a,c):i[a]=c?c.value:void 0}return i}function Ni(t,...e){if(Re in t){const i=new Set(e.length>1?e.flat():e[0]),o=e.map(s=>new Proxy({get(a){return s.includes(a)?t[a]:void 0},has(a){return s.includes(a)&&a in t},keys(){return s.filter(a=>a in t)}},Br));return o.push(new Proxy({get(s){return i.has(s)?void 0:t[s]},has(s){return i.has(s)?!1:s in t},keys(){return Object.keys(t).filter(s=>!i.has(s))}},Br)),o}const n={},r=e.map(()=>({}));for(const i of Object.getOwnPropertyNames(t)){const o=Object.getOwnPropertyDescriptor(t,i),s=!o.get&&!o.set&&o.enumerable&&o.writable&&o.configurable;let a=!1,c=0;for(const u of e)u.includes(i)&&(a=!0,s?r[c][i]=o.value:Object.defineProperty(r[c],i,o)),++c;a||(s?n[i]=o.value:Object.defineProperty(n,i,o))}return[...r,n]}const Wa=t=>`Stale read from <${t}>.`;function Mi(t){const e="fallback"in t&&{fallback:()=>t.fallback};return de(Fa(()=>t.each,t.children,e||void 0))}function Fr(t){const e=t.keyed,n=de(()=>t.when,void 0,{equals:(r,i)=>e?r===i:!r==!i});return de(()=>{const r=n();if(r){const i=t.children;return typeof i=="function"&&i.length>0?fe(()=>i(e?r:()=>{if(!fe(n))throw Wa("Show");return t.when})):i}return t.fallback},void 0,void 0)}const Ha=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],za=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...Ha]),qa=new Set(["innerHTML","textContent","innerText","children"]),Ka=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),Xa=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function Ja(t,e){const n=Xa[t];return typeof n=="object"?n[e]?n.$:void 0:n}const Ya=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),Va={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function Qa(t,e,n){let r=n.length,i=e.length,o=r,s=0,a=0,c=e[i-1].nextSibling,u=null;for(;sh-a){const g=e[s];for(;a{i=o,e===document?t():ai(e,t(),e.firstChild?null:void 0,n)},r.owner),()=>{i(),e.textContent=""}}function Qe(t,e,n){let r;const i=()=>{const s=document.createElement("template");return s.innerHTML=t,n?s.content.firstChild.firstChild:s.content.firstChild},o=e?()=>fe(()=>document.importNode(r||(r=i()),!0)):()=>(r||(r=i())).cloneNode(!0);return o.cloneNode=o,o}function ls(t,e=window.document){const n=e[$i]||(e[$i]=new Set);for(let r=0,i=t.length;ri.call(t,n[1],o))}else t.addEventListener(e,n)}function tc(t,e,n={}){const r=Object.keys(e||{}),i=Object.keys(n);let o,s;for(o=0,s=i.length;oi.children=jt(t,e.children,i.children)),Pe(()=>typeof e.ref=="function"&&_t(e.ref,t)),Pe(()=>ic(t,e,n,!0,i,!0)),i}function _t(t,e,n){return fe(()=>t(e,n))}function ai(t,e,n,r){if(n!==void 0&&!r&&(r=[]),typeof e!="function")return jt(t,e,r,n);Pe(i=>jt(t,e(),i,n),r)}function ic(t,e,n,r,i={},o=!1){e||(e={});for(const s in i)if(!(s in e)){if(s==="children")continue;i[s]=Li(t,s,null,i[s],n,o)}for(const s in e){if(s==="children"){r||jt(t,e.children);continue}const a=e[s];i[s]=Li(t,s,a,i[s],n,o)}}function oc(t){return t.toLowerCase().replace(/-([a-z])/g,(e,n)=>n.toUpperCase())}function ji(t,e,n){const r=e.trim().split(/\s+/);for(let i=0,o=r.length;i-1&&Va[e.split(":")[0]];f?Za(t,f,e,n):wt(t,Ka[e]||e,n)}return n}function sc(t){const e=`$$${t.type}`;let n=t.composedPath&&t.composedPath()[0]||t.target;for(t.target!==n&&Object.defineProperty(t,"target",{configurable:!0,value:n}),Object.defineProperty(t,"currentTarget",{configurable:!0,get(){return n||document}});n;){const r=n[e];if(r&&!n.disabled){const i=n[`${e}Data`];if(i!==void 0?r.call(n,i,t):r.call(n,t),t.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function jt(t,e,n,r,i){for(;typeof n=="function";)n=n();if(e===n)return n;const o=typeof e,s=r!==void 0;if(t=s&&n[0]&&n[0].parentNode||t,o==="string"||o==="number"){if(o==="number"&&(e=e.toString(),e===n))return n;if(s){let a=n[0];a&&a.nodeType===3?a.data!==e&&(a.data=e):a=document.createTextNode(e),n=Pt(t,n,r,a)}else n!==""&&typeof n=="string"?n=t.firstChild.data=e:n=t.textContent=e}else if(e==null||o==="boolean")n=Pt(t,n,r);else{if(o==="function")return Pe(()=>{let a=e();for(;typeof a=="function";)a=a();n=jt(t,a,n,r)}),()=>n;if(Array.isArray(e)){const a=[],c=n&&Array.isArray(n);if(Ur(a,e,n,i))return Pe(()=>n=jt(t,a,n,r,!0)),()=>n;if(a.length===0){if(n=Pt(t,n,r),s)return n}else c?n.length===0?Di(t,a,r):Qa(t,n,a):(n&&Pt(t),Di(t,a));n=a}else if(e.nodeType){if(Array.isArray(n)){if(s)return n=Pt(t,n,r,e);Pt(t,n,null,e)}else n==null||n===""||!t.firstChild?t.appendChild(e):t.replaceChild(e,t.firstChild);n=e}}return n}function Ur(t,e,n,r){let i=!1;for(let o=0,s=e.length;o=0;s--){const a=e[s];if(i!==a){const c=a.parentNode===t;!o&&!s?c?t.replaceChild(i,a):t.insertBefore(i,n):c&&a.remove()}else o=!0}}else t.insertBefore(i,n);return[i]}var ci=(t,e)=>{let n;const r=()=>clearTimeout(n);return ft()&&xe(r),Object.assign((...o)=>{n!==void 0&&r(),n=setTimeout(()=>t(...o),e)},{clear:r})};function ui(t){let e=0,n=!1;const[r,i]=pe(void 0,{equals:!1}),o=t(()=>{n=!0,i()});return()=>(n||(o(),r()),n?(n=!!e,!0):(bt()&&(e++,xe(()=>e--)),!1))}const ac=t=>t.split("/").pop()?.split(".")[1];class fs extends EventTarget{addEventListener(e,n,r){super.addEventListener(e,n,r)}removeEventListener(e,n,r){super.removeEventListener(e,n,r)}dispatchEvent(e){return super.dispatchEvent(e)}}class hs extends Event{constructor(e){super("url"),this.url=e}}class cc extends Event{constructor(e){super("source"),this.source=e}}class li extends fs{constructor(e,n,r){super(),this.runtime=e,this.path=n,[this.#e,this.#n]=pe(""),this.#r=()=>r!==void 0?r:!!e.config.controlled}#e;#n;#r;get source(){return this.#r()?this.runtime.config.files[this.path]:this.#e()}get extension(){return ac(this.path)}set(e){this.runtime.config.onFileChange?.(this.path,e),this.#r()||this.#n(e)}get(){return this.#r()?this.runtime.config.files[this.path]:this.#e()}moduleTransform(){const e=this.url;if(!e)throw`Currently module-url of ${this.path} is undefined.`;return e}onSource(e){return this.addEventListener("source",e),()=>this.removeEventListener("source",e)}onUrl(e){return this.addEventListener("url",e),()=>this.removeEventListener("url",e)}}function fi(t){Ee(()=>{t.dispatchEvent(new cc(t.source))}),Ee(()=>{t.url&&t.dispatchEvent(new hs(t.url))})}function uc(t,e){return` +import { dispose } from "@repl/std" +(() => { + let stylesheet = document.querySelector('[data-repl-css-id="${t}"]'); + if(!stylesheet){ + stylesheet = document.createElement('style') + stylesheet.setAttribute('data-repl-css-id', '${t}'); + document.head.appendChild(stylesheet) + dispose('${t}', () => stylesheet.remove()) + } + const styles = document.createTextNode(\`${e}\`) + stylesheet.innerHTML = '' + stylesheet.appendChild(styles) +})()`}class lc extends li{jsFile;type="css";constructor(e,n){super(e,n),this.jsFile=e.fs.create(n.replace(".css",".js"));const r=ui(i=>ci(i,250));Ee(()=>{r()&&this.jsFile.set(uc(n,this.get()))}),fi(this)}createObjectUrl(){return this.jsFile.createObjectUrl()}get url(){return this.jsFile.createObjectUrl()}}function hn(t,e,n){const r=typeof t=="function"?t():t;return r?e(r):n?n():void 0}function hi(t,e,n){return()=>hn(t,e,n)}function Bi(...t){function e(){const n=new Array(t.length);for(let r=0;r0?[...t.split("/").slice(0,-(n+1)),...e.split("/").slice(n)]:[...t.split("/").slice(0,-1),...e.split("/").slice(1)]).join("/")}const pi=t=>t.startsWith("blob:")||t.startsWith("http:")||t.startsWith("https:"),gi=t=>t.startsWith("."),fc=/(?:@?[^@\/]*\/)?([^@\/]+)@([^\s\/]+)/,Gi=t=>{const e=t.match(fc);if(e){const n=e[1],r=e[2];return[n,r]}else return};class hc extends Event{constructor(e){super("dependency-removed"),this.file=e}}class mt extends li{constructor(e,n){super(e,n),this.runtime=e,this.path=n;let r=!1;const i=ui(s=>ci(s,250)),o=hi(()=>(!r||i())&&this.source,s=>{if(r=!0,s==="")return"";if(Array.isArray(e.config.transform)){let a=s;try{return e.config.transform.forEach(c=>{a=c(a,n,e)}),a}catch(c){return console.error("Error while transforming js",{error:c,source:s,current:a}),null}}try{return e.config.transform(this.source,this.path,e)}catch(a){console.error("Error while transforming js",{error:a,source:s})}});this.#n=de(s=>hn(o,a=>{const c=[],u=new Set(fe(()=>this.dependencies));try{return ii(()=>e.config.transformModulePaths(a,h=>{if(pi(h))return h;const f=e.fs.alias[h];if(f||gi(h)){const d=e.fs.resolve(f||di(n,h));if(!d)throw`Could not resolve relative module-path to its virtual file. Are you sure ${h} exists?`;return c.push(d),u.delete(d),d.moduleTransform()}else return e.config.importExternalTypes&&e.types.import.fromPackageName(h),`${e.config.cdn}/${h}`}))}catch(h){return console.warn("error",h),s}finally{this.dependencies=c;for(const h of u)this.dispatchEvent(new hc(h))}},()=>s)),this.#e=de(s=>this.createObjectUrl()||s),fi(this)}dependencies=[];#e;#n;get url(){return this.#e()}get type(){switch(this.extension){case"js":return"javascript";case"jsx":return"javascript";case"ts":return"typescript";case"tsx":return"typescript";default:throw`Unknown extension ${this.extension}`}}resolveDependencies(){const e=new Set,n=[...this.dependencies];for(;n.length>0;){const r=n.pop();if(r&&!e.has(r)&&(e.add(r),r instanceof mt))for(const i of r.dependencies)e.has(i)||n.push(i)}return Array.from(e)}createObjectUrl(){const e=this.#n();if(e)return URL.createObjectURL(new Blob([e],{type:"application/javascript"}))}onDependencyRemoved(e){return this.addEventListener("dependency-removed",e),()=>this.removeEventListener("dependency-removed",e)}}const ds=(t,e)=>t.reduce((n,r,i)=>n+r+(e[i]||""),"");function ps(t,...e){const n=URL.createObjectURL(new Blob([ds(t,e)],{type:"text/html"}));return xe(()=>URL.revokeObjectURL(n)),n}function gs(t,...e){const n=URL.createObjectURL(new Blob([ds(t,e)],{type:"text/javascript"}));return xe(()=>URL.revokeObjectURL(n)),n}class dc extends li{#e;createObjectUrl;type="wasm";constructor(e,n,r){super(e,n,r);const i=ui(o=>ci(o,250));this.createObjectUrl=()=>{const o=this.get();if(!o)return;const s=Uint8Array.from(atob(o),a=>a.charCodeAt(0));return gs` +const wasmCode = new Uint8Array([${s.toString()}]); +export default (imports) => WebAssembly.instantiate(wasmCode, imports).then(result => result.instance); +`},this.#e=de(o=>{if(!i())return o;const s=this.createObjectUrl();return s?(this.dispatchEvent(new hs(s)),s):o}),fi(this)}get url(){return this.#e()}}function ms(t,e){return new Promise(n=>{const r=()=>{n(),t.removeEventListener(e,r)};t.addEventListener(e,r)})}class pc{constructor(e){this.iframe=e;const n=e.contentWindow;if(!n)throw"contentWindow is not defined!";this.contentWindow=n}contentWindow;reloading=!1;injectModuleUrl(e){const n=this.contentWindow.document.createElement("script");return n.type="module",n.src=e,this.contentWindow.document.head.appendChild(n),()=>{this.contentWindow.document.head.removeChild(n),URL.revokeObjectURL(e)}}injectFile(e){return Ee(xa(()=>e.url,()=>xe(()=>this.dispose(e.path)))),e instanceof mt&&e.onDependencyRemoved(({file:n})=>this.dispose(n.path)),hn(e.createObjectUrl(),n=>this.injectModuleUrl(n))}dispose(e){const n=this.contentWindow.repl?.dispose;if(typeof n=="function")return n(e)}reload(){return this.contentWindow.location.reload(),this.reloading=!0,ms(this.iframe,"load").then(()=>this.reloading=!1)}clearBody(){this.contentWindow.document.body.innerHTML=""}}class gc{async parse(e){e.startsWith(".")&&(e=new URL(e,window.location.href.toString()).href);const n=await fetch(`${e}/package.json`).then(o=>o.json()),r=typeof n.exports=="string"?n.exports:this.resolveExportPath(e,n.exports,"default","import")||n.module||n.main;if(!r)throw new Error("No valid module entry found for script.");const i=typeof n.exports!="string"&&this.resolveExportPath(e,n.exports,"default","types")||n.types||n.typings;return{typesUrl:i&&new URL(i,`${e}/`).href,scriptUrl:new URL(r,`${e}/`).href,packageName:n.name}}resolveExportPath(e,n,r,i){if(!n)return;function o(s,a){if(s)return typeof s=="string"?s:o(s[a],a)||o(s.default,a)}return o(n[r],r)||o(n[i],i)}}const Wr=Symbol("store-raw"),xt=Symbol("store-node"),ot=Symbol("store-has"),ys=Symbol("store-self");function vs(t){let e=t[Re];if(!e&&(Object.defineProperty(t,Re,{value:e=new Proxy(t,vc)}),!Array.isArray(t))){const n=Object.keys(t),r=Object.getOwnPropertyDescriptors(t);for(let i=0,o=n.length;it[Re][e]),n}function _s(t){bt()&&dn(Kn(t,xt),ys)()}function yc(t){return _s(t),Reflect.ownKeys(t)}const vc={get(t,e,n){if(e===Wr)return t;if(e===Re)return n;if(e===Gn)return _s(t),n;const r=Kn(t,xt),i=r[e];let o=i?i():t[e];if(e===xt||e===ot||e==="__proto__")return o;if(!i){const s=Object.getOwnPropertyDescriptor(t,e);bt()&&(typeof o!="function"||t.hasOwnProperty(e))&&!(s&&s.get)&&(o=dn(r,e,o)())}return qn(o)?vs(o):o},has(t,e){return e===Wr||e===Re||e===Gn||e===xt||e===ot||e==="__proto__"?!0:(bt()&&dn(Kn(t,ot),e)(),e in t)},set(){return!0},deleteProperty(){return!0},ownKeys:yc,getOwnPropertyDescriptor:mc};function Xn(t,e,n,r=!1){if(!r&&t[e]===n)return;const i=t[e],o=t.length;n===void 0?(delete t[e],t[ot]&&t[ot][e]&&i!==void 0&&t[ot][e].$()):(t[e]=n,t[ot]&&t[ot][e]&&i===void 0&&t[ot][e].$());let s=Kn(t,xt),a;if((a=dn(s,e,i))&&a.$(()=>n),Array.isArray(t)&&t.length!==o){for(let c=t.length;c1){r=e.shift();const s=typeof r,a=Array.isArray(t);if(Array.isArray(r)){for(let c=0;c1){nn(t[r],e,[r].concat(n));return}i=t[r],n=[r].concat(n)}let o=e[0];typeof o=="function"&&(o=o(i,n),o===i)||r===void 0&&o==null||(o=Lt(o),r===void 0||qn(i)&&qn(o)&&!Array.isArray(o)?bs(i,o):Xn(t,r,o))}function Jn(...[t,e]){const n=Lt(t||{}),r=Array.isArray(n),i=vs(n);function o(...s){ii(()=>{r&&s.length===1?_c(n,s[0]):nn(n,s)})}return[i,o]}const bc=`/** + * Standard library that is included in each FileSystem, aliased to \`@repl/std\` + */ + +const cleanups = new Map void>() +/** Add function to clean-up side-effects after module is reload. */ +export const dispose = (id: string, callback: () => void) => cleanups.set(id, callback) + +// Extend the Window interface in the same file +declare global { + interface Window { + repl?: { + dispose: (id?: string) => void + } + } +} + +window.repl = { + dispose(id?: string) { + if (id) { + cleanups.get(id)?.() + } else { + cleanups.forEach(cleanup => cleanup()) + } + }, +} +`;class wc extends Event{constructor(e){super("file"),this.file=e}}class Sc extends fs{constructor(e){super(),this.runtime=e;const[n,r]=Jn({});this.#e=n,this.#n=r,[this.alias,this.setAlias]=Jn({"@repl/std":"@repl/std.ts"}),xe(()=>this.#r.forEach(i=>i()))}alias;setAlias;#e;#n;#r=[];initialize(e){const n={...e,"@repl/std.ts":bc};for(const[r,i]of Object.entries(n))this.create(r).set(i)}toJSON(){return{sources:Object.fromEntries(Object.entries(this.#e).map(([e,n])=>[e,n.source])),alias:this.alias}}addProject(e){Object.entries(e).forEach(([n,r])=>{this.create(n).set(r)})}create(e){let n=null;for(const i in this.runtime.extensions)e.endsWith(i)&&i.length>(n?.length||0)&&(n=i);if(n===null)throw"extension type is not supported";const r=new this.runtime.extensions[n](this.runtime,e);return this.#n(e,r),this.dispatchEvent(new wc(r)),r}has(e){return e in this.#e}get(e){return this.#e[e]}getOrCreate(e){return this.runtime.fs.get(e)||this.runtime.fs.create(e)}resolve(e){return this.#e[e]||this.#e[`${e}/index.ts`]||this.#e[`${e}/index.tsx`]||this.#e[`${e}/index.d.ts`]||this.#e[`${e}/index.js`]||this.#e[`${e}/index.jsx`]||this.#e[`${e}.ts`]||this.#e[`${e}.tsx`]||this.#e[`${e}.d.ts`]||this.#e[`${e}.js`]||this.#e[`${e}.jsx`]}all(){return Object.fromEntries(Object.entries(this.#e).filter(([e])=>e.split("/")[0]!=="node_modules"))}remove(e){this.#n({[e]:void 0})}}class Ac{constructor(e){this.runtime=e}packageJsonParser=new gc;async fromPackageJson(e){const n=o=>pi(o)?new URL(o).pathname:o,[r]=Ye(()=>this.packageJsonParser.parse(e)),[i]=Ye(r,async({scriptUrl:o,packageName:s})=>{const a={},c=async u=>{const h=n(u),f=await fetch(u).then(g=>{if(g.status!==200)throw new Error(`Error while loading ${u}: ${g.statusText}`);return g.text()}),d=[],T=await this.runtime.config.transformModulePaths(f,g=>(gi(g)&&d.push(c(di(u,g))),g));if(!T)throw new Error(`Transform returned undefined for ${h}`);await Promise.all(d),a[h]=T};return await c(o),this.runtime.fs.setAlias(s,`node_modules${n(o)}`),a});Fe(r,({typesUrl:o,packageName:s})=>{o&&this.runtime.types.import.fromUrl(o,s)}),Fe(i,o=>Object.entries(o).forEach(([s,a])=>{this.runtime.fs.create(`node_modules${s}`).set(a)}))}}function ws(t,...e){return[`%c[REPL]%c ${t}`,"color: red","",...e]}class Cc{constructor(e,n){this.runtime=e,this.typeRegistry=n}cachedUrls=new Set;cachedPackageNames=new Set;initialize(e){e.sources&&Object.keys(e.sources).forEach(n=>{this.cachedUrls.add(n)}),e.alias&&Object.entries(e.alias).forEach(([n])=>{this.cachedPackageNames.add(n)})}async fromUrl(e,n){const r=this.getVirtualPath(e);if(n&&this.cachedPackageNames.has(n)||this.cachedUrls.has(r))return;this.cachedUrls.add(r),n&&this.cachedPackageNames.add(n);const i=async o=>{const s=this.getVirtualPath(o);if(this.typeRegistry.has(s))return;this.typeRegistry.set(s,null);const a=await fetch(o).then(h=>(h.status,h.text())),c=[],u=await this.runtime.config.transformModulePaths(a,h=>{if(gi(h)){if(c.push(i(di(o,h))),h.endsWith(".js"))return h=h.replace(".js",".d.ts"),h}else if(pi(h)){let f=this.getVirtualPath(h);return hn(Gi(f),([d,T])=>{for(const g of Object.keys(this.typeRegistry.sources))if(hn(Gi(g),([k,m])=>k===d?(T!==m&&(console.warn(`Conflicting version numbers: Overwriting version number of ${d} from ${T} to ${m}. +Accessed ${h} from ${o}.`),h=h.replace(T,m),f=f.replace(T,m)),!0):!1))break}),c.push(this.fromUrl(h)),this.typeRegistry.aliasPath(f,`file:///node_modules/${f}`),f}else c.push(this.fromPackageName(h));return h});if(!u)throw new Error(`Transform returned undefined for ${s}`);await Promise.all(c),this.typeRegistry.set(s,u)};await i(e),n&&(this.cachedPackageNames.add(n),this.typeRegistry.aliasPath(n,`file:///node_modules/${r}`))}async fromPackageName(e){if(this.cachedPackageNames.has(e))return;this.cachedPackageNames.add(e);const n=await fetch(`${this.runtime.config.cdn}/${e}`).then(i=>i.headers.get("X-TypeScript-Types")).catch(i=>{console.info(i)});if(!n){console.error(...ws("no type url was found for package",e));return}const r=this.getVirtualPath(n);await this.fromUrl(n),this.typeRegistry.aliasPath(e,`file:///node_modules/${r}`)}getVirtualPath(e){return e.replace(`${this.runtime.config.cdn}/`,"").replace("http://","").split("/").slice(1).join("/")}}class Ec{constructor(e){this.runtime=e,[this.sources,this.setSources]=Jn({}),[this.alias,this.setAlias]=Jn({}),this.import=new Cc(e,this)}sources;setSources;alias;setAlias;import;toJSON(){return{alias:this.alias,sources:this.sources}}initialize(e){ii(()=>{e.sources&&this.setSources(e.sources),e.alias&&(this.setAlias(e.alias),Object.entries(e.alias).forEach(([n,r])=>{this.aliasPath(n,r[0])}))}),this.import.initialize(e)}aliasPath(e,n){this.setAlias(e,[n])}set(e,n){this.setSources(e,n)}has(e){return e in this.sources}}class Tc{config;fs;types;import;get extensions(){return{css:lc,js:mt,jsx:mt,ts:mt,tsx:mt,wasm:dc,...this.config.extensions}}initialized=!1;constructor(e){this.config=Gr({cdn:"https://esm.sh"},e),this.fs=new Sc(this),this.import=new Ac(this),this.types=new Ec(this)}toJSON(){return{files:this.fs.toJSON(),types:this.types.toJSON()}}initialize(){return this.config.files&&this.fs.initialize(this.config.files),this.initialized=!0,this}download(e="repl.config.json"){const n=this.toJSON(),r=new Blob([JSON.stringify(n)],{type:"text/json"}),i=document.createElement("a");i.download=e,i.href=window.URL.createObjectURL(r),i.dataset.downloadurl=["text/json",i.download,i.href].join(":");const o=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0});i.dispatchEvent(o),i.remove()}getFile(e,n=!0){return this.fs.get(e)||fe(()=>n?this.fs.create(e):void 0)}setFile(e,n,r){return this.getFile(e,r)?.set(n)}}function kc(t){const[e,n]=pe(!0);return Ee(()=>e()&&t()),{stop:()=>n(!1),resume:()=>n(!0)}}function Oc(t){return class extends t{#e=new Set;createEffect(n){this.#s(n)}stopEffects(){this.#o()}#n(n){let r=null;r=kc(()=>{r&&this.#e.add(r),Ee(n),xe(()=>this.#e.delete(r))}),this.#e.add(r)}#r(){for(const n of this.#e)n.stop()}#t=null;#i=null;#s(n){if(!this.#t)Je(r=>{this.#t=ft(),this.#i=r,this.#s(n)});else{let r=ft();for(;r&&r!==this.#t;)r=r?.owner??null;if(r===this.#t)return Ee(n);os(this.#t,()=>Ee(n))}}#o(){this.#i?.()}}}function Ss(t,e){let n=t,r;for(;n;){if(r=Object.getOwnPropertyDescriptor(n,e),r)return r.owner=n,r;n=n.__proto__}}const Pn=new WeakMap;function Pc(t,...e){const n=e.length?e:Object.keys(t).concat(Object.getOwnPropertySymbols(t));for(const r of n)As(t,r);return t}let Fi=!1;function Rc(){if(Fi)throw new Error('Export "createSignalAccessor" is internal to classy-solid only.');return Fi=!0,As}const jn=new WeakMap;function Ic(t,e){return!!jn.get(t)?.has(e)}function Ui(t,e){jn.has(t)||jn.set(t,new Set),jn.get(t).add(e)}const Wi=new WeakSet;function As(t,e,n=fe(()=>t[e]),r=!1){if(!r&&Pn.get(t)?.has(e)||t[Re])return;let o=Ss(t,e),s,a;if(o){if(s=o.get,a=o.set,s&&Wi.has(s))return;if(s||a){if(!s||!a){console.warn(`The \`@signal\` decorator was used on an accessor named "${e.toString()}" which had a getter or a setter, but not both. Reactivity on accessors works only when accessors have both get and set. In this case the decorator does not do anything.`);return}delete o.get,delete o.set}else{if(n=o.value,!o.writable){console.warn(`The \`@signal\` decorator was used on a property named "${e.toString()}" that is not writable. Reactivity is not enabled for non-writable properties.`);return}delete o.value,delete o.writable}}const c=pe(n,{equals:!1});o={configurable:!0,enumerable:!0,...o,get:s?function(){return c[0](),s.call(this)}:function(){return c[0]()},set:a?function(u){a.call(this,u),Ui(this,e),typeof u=="function"?c[1](()=>u):c[1](u)}:function(u){Ui(this,e),typeof u=="function"?c[1](()=>u):c[1](u)}},Wi.add(o.get),Object.defineProperty(t,e,o),Pn.has(t)||Pn.set(t,new Set),Pn.get(t).add(e)}let rr=new Map,un=null;function xc(){if(un)throw new Error("Attempted use of classy-solid internals.");return un=Symbol(),un}function Nc(t){if(t!==un)throw new Error("Attempted use of classy-solid internals.");return rr}function Mc(t){if(t!==un)throw new Error("Attempted use of classy-solid internals.");rr=new Map}function $c(t){return"private"in t}function Hi(t,e){const{kind:n,name:r}=e,i=rr;if($c(e)){if(e.private)throw new Error("@signal is not supported on private fields yet.");if(e.static)throw new Error("@signal is not supported on static fields yet.")}if(n==="field")return i.set(r,{initialValue:void 0}),function(o){return i.get(r).initialValue=o,o};if(n==="getter"||n==="setter")i.set(r,{initialValue:void 0});else throw new Error("The @signal decorator is only for use on fields, getters, and setters. Auto accessor support is coming next if there is demand for it.");jc(i)}let vr=!1;function jc(t){vr||(vr=!0,queueMicrotask(()=>{if(vr=!1,t===rr)throw new Error(`Stray @signal-decorated properties detected: ${Array.from(t.keys()).join(", ")}. Did you forget to use the \`@reactive\` decorator on a class that has properties decorated with \`@signal\`?`)}))}const zi=xc(),Lc=Rc(),qi=Object.prototype.hasOwnProperty;function Dc(t,e){if(typeof t!="function"||e&&e.kind!=="class")throw new TypeError("The @reactive decorator is only for use on classes.");const n=t,r=Nc(zi);Mc(zi);class i extends n{constructor(...s){let a;bt()?fe(()=>a=Reflect.construct(n,s,new.target)):(super(...s),a=this);for(const[c,{initialValue:u}]of r){if(!(qi.call(a,c)||qi.call(n.prototype,c)))throw new Error(`Property "${c.toString()}" not found on instance of class decorated with \`@reactive\`. Did you forget to use the \`@reactive\` decorator on one of your classes that has a "${c.toString()}" property decorated with \`@signal\`?`);Lc(a,c,u,!0)}return a}}return i}var rn;let Yt;const Bc=globalThis.HTMLElement??class{constructor(){throw new Error("@lume/element needs a DOM to operate with! If this code is running during server-side rendering, it means your app is trying to instantiate elements when it shouldn't be, and should be refactored to avoid doing that when no DOM is present.")}};let Ve=class extends Oc(Bc){static elementName="";static defineElement(e,n=customElements){if(e){if(n.get(e))return console.warn(`defineElement(): An element class was already defined for tag name ${e}.`),this;{const r=class extends this{};return r.elementName=e,n.define(e,r),r}}else return e=this.elementName,n.get(e)?(console.warn(`defineElement(): An element class was already defined for tag name ${e}.`),this):(n.define(e,this),this)}static observedAttributes;#e(){const e=Object.keys(this);this._preUpgradeValues=new Map;for(const n of e){const r=Object.getOwnPropertyDescriptor(this,n);"value"in r&&(delete this[n],this._preUpgradeValues.set(n,r.value),queueMicrotask(()=>{if(Ic(this,n))return;n in this.__proto__&&(this[n]=r.value)}))}}#n=this.#e();hasShadow=!0;__root=null;get root(){return this.hasShadow?this.__root?this.__root:this.shadowRoot?this.__root=this.shadowRoot:this.__root=this.attachShadow({mode:"open"}):this}set root(e){if(!this.hasShadow)throw new Error("Can not set root, element.hasShadow is false.");if(this.__root||this.shadowRoot)throw new Error("Element root can only be set once if there is no ShadowRoot.");this.__root=e}get styleRoot(){return this.root}attachShadow(e){return this.__root&&console.warn("Element already has a root defined."),this.__root=super.attachShadow(e)}#r;connectedCallback(){const e=this.template;e&&(this.#r=si(typeof e=="function"?e.bind(this):()=>e,this.root)),this.#a()}disconnectedCallback(){this.stopEffects(),this.#r?.(),this.#c()}static __styleRootNodeRefCountPerTagName=new WeakMap;#t=null;#i=e=>`${e} { + display: block; + }`;static __elementId=0;#s=rn.__elementId++;#o=null;#a(){Yt=this.constructor;const e=typeof Yt.css=="function"?Yt.css=Yt.css():Yt.css||"",n=typeof this.css=="function"?this.css():this.css||"";if(this.hasShadow){const r=":host",i=document.createElement("style");i.innerHTML=` + ${this.#i(r)} + ${e} + ${n} + `,this.styleRoot.appendChild(i)}else{const r=this.getRootNode();this.#t=r===document?document.head:r;let i=rn.__styleRootNodeRefCountPerTagName.get(this.#t);i||rn.__styleRootNodeRefCountPerTagName.set(this.#t,i={});const o=i[this.tagName]||0;if(i[this.tagName]=o+1,o===0){const s=this.tagName.toLowerCase(),a=document.createElement("style");a.innerHTML=` + ${this.#i(s)} + ${e&&e.replaceAll(":host",s)} + `,a.id=this.tagName.toLowerCase(),this.#t.appendChild(a)}if(n){const s=this.tagName.toLowerCase()+"-"+this.#s;this.setAttribute(s,"");const a=this.#o=document.createElement("style");a.id=s,a.innerHTML=n.replaceAll(":host",`[${s}]`);const c=this.getRootNode();this.#t=c===document?document.head:c,this.#t.appendChild(a)}}}#c(){do{if(this.hasShadow)break;const e=rn.__styleRootNodeRefCountPerTagName.get(this.#t);if(!e)break;let n=e[this.tagName];if(n===void 0)break;e[this.tagName]=--n,n===0&&(delete e[this.tagName],this.#t.querySelector("#"+this.tagName)?.remove())}while(!1);this.#o&&this.#o.remove()}adoptedCallback(){}};rn=Ve;Symbol.metadata??=Symbol.for("Symbol.metadata");function Gc(t,...e){let n="";for(let r=0;rKi(r,i,n)}function Ki(t,e,n={}){const{kind:r,name:i,private:o,static:s,metadata:a}=e,u=!(Object.hasOwn(a,"noSignal")&&a.noSignal||void 0)?.has(i);if(typeof i=="symbol")throw new Error("@attribute is not supported on symbol fields yet.");if(o)throw new Error("@attribute is not supported on private fields yet.");if(s)throw new Error("@attribute is not supported on static fields.");if(Hr.push(h=>Cs(h,i,n)),r==="field"){const h=u?Hi(t,e):f=>f;return function(f){return f=h(f),"default"in n||(n.default=f),f}}else if(r==="getter"||r==="setter")u&&Hi(t,e);else throw new Error("@attribute is only for use on fields, getters, and setters. Auto accessor support is coming next if there is demand for it.")}function Cs(t,e,n){if(!t.observedAttributes||!t.hasOwnProperty("observedAttributes")){const i=t.__proto__.observedAttributes;if(i&&!Array.isArray(i))throw new TypeError("observedAttributes is in the wrong format. Did you forget to decorate your custom element class with the `@element` decorator?");Uc(t,"observedAttributes",[...i||[]])}if(!Array.isArray(t.observedAttributes))throw new TypeError("observedAttributes is in the wrong format. Maybe you forgot to decorate your custom element class with the `@element` decorator.");const r=Fc(e);t.observedAttributes.includes(r)||t.observedAttributes.push(r),Wc(t.prototype,r,e,n)}function Wc(t,e,n,r){if(!t.__hasAttributeChangedCallback){t.__hasAttributeChangedCallback=!0;const i=t.attributeChangedCallback;t.attributeChangedCallback=function(o,s,a){i?i.call(this,o,s,a):t.__proto__?.attributeChangedCallback?.call(this,o,s,a);const c=this.__attributesToProps&&this.__attributesToProps[o];if(c){const u=c.attributeHandler;this[c.name]=u?a===null?"default"in u?u.default:null:u.from?u.from(a):a:a}}}t.hasOwnProperty("__attributesToProps")||Object.defineProperty(t,"__attributesToProps",{value:{__proto__:t.__attributesToProps||Object.prototype}}),t.__attributesToProps[e]={name:n,attributeHandler:r}}const Hc=t=>t;pn.string=()=>({from:Hc});function Yn(t,e){return pn(pn.string())(t,e)}const zc=t=>+t;pn.number=()=>({from:zc});const qc=t=>t!=="false";pn.boolean=()=>({from:qc});function ir(t,e){let n="",r=!!(e??!0);return typeof t=="string"?(n=t,(s,a)=>Xi(s,a,n,r)):(r=!1,Xi(t,e,n,r))}function Xi(t,e,n,r){if(typeof t!="function"||e&&e.kind!=="class")throw new Error("@element is only for use on classes.");const{metadata:i={}}=e??{},o=Object.hasOwn(i,"noSignal")&&i.noSignal||void 0;let s=t;const a=s.observedAttributes;if(s.hasOwnProperty("elementName")?n=s.elementName||n:s.elementName=n,!Array.isArray(a)){if(a&&typeof a=="object"){s.observedAttributes=void 0;for(const f in a)Cs(s,f,a[f])}}s=Dc(s,e);class c extends s{constructor(...d){super(...d),fe(()=>{Kc(this);const T=[],g=c.prototype.__attributesToProps??{};for(const C of Object.values(g)){const k=C.name;!o?.has(k)&&T.push(k);const w=C.attributeHandler;w&&!("default"in w)&&(w.default=this[k])}T.length&&Pc(this,...T)})}}const u=[...Hr];Hr.length=0;function h(){for(const f of u)f(c);n&&r&&globalThis.window?.customElements?.define(n,c)}return e?.addInitializer?e.addInitializer(h):h(),c}function Kc(t){if(t instanceof Ve)for(const[e,n]of t._preUpgradeValues){if(!(e in t))continue;t._preUpgradeValues.delete(e);const r=Object.getOwnPropertyDescriptor(t,e);r&&"value"in r&&delete t[e],t[e]=n}}const Xc=Gc;function Jc(t,e){const[n,r]=pe(t,e);return function(i){return arguments.length===0?n():r(i)}}const _r=new WeakMap;function Vn(t,e){_r.has(t)||_r.set(t,new Set),_r.get(t).add(e)}const Ji=new WeakSet;function Es(t,e,n){let r=Ss(t,e),i,o;const s=!!(r?.get||r?.set);if(r){if(i=r.get,o=r.set,i&&Ji.has(i))return;if(s&&!(i&&o))return Yc(e);if(!s){if(!r.writable)return Vc(e);n=r.value}}const a=new WeakMap,c={configurable:!0,enumerable:r?.enumerable,get:s?function(){return ut(this,a,n)(),i.call(this)}:function(){return ut(this,a,n)()},set:s?function(u){o.call(this,u),Vn(this,e),ut(this,a,n)(typeof u=="function"?()=>u:u)}:function(u){Vn(this,e),ut(this,a,n)(typeof u=="function"?()=>u:u)}};Ji.add(c.get),Object.defineProperty(t,e,c)}function ut(t,e,n){let r=e.get(t);return r||e.set(t,r=Jc(n,{equals:!1})),r}function Yc(t){console.warn(`Cannot signalify property named "${String(t)}" which had a getter or a setter, but not both. Reactivity on accessors works only when accessors have both get and set. Skipped.`)}function Vc(t){console.warn(`The \`@signal\` decorator was used on a property named "${String(t)}" that is not writable. Reactivity is not enabled for non-writable properties.`)}let gn=new Map;function Qc(){gn=new Map}const Zc=Symbol();function St(t,e){const{kind:n,name:r,metadata:i}=e,o=gn;if(e.static)throw new Error("@signal is not supported on static fields yet.");if(eu(o),n==="field"){if(e.private&&r!=="#finalize")throw new Error("@signal is not supported on private fields yet.");return r==="#finalize"?gn=new Map:o.set(r,{initialValue:void 0,kind:n}),function(s){if(r==="#finalize"){if(this[Re])return this;for(const[c,u]of o){let h=u.initialValue;if(!Object.hasOwn(this,c))throw new tu(c);Es(this,c,h)}return}return o.get(r).initialValue=s,s}}else if(n==="accessor"){const{get:s,set:a}=t,c=new WeakMap;let u;return{init:function(h){return u=h,h},get:function(){return ut(this,c,u)(),s.call(this)},set:function(h){a.call(this,h),Vn(this,r),ut(this,c,u)(typeof h=="function"?()=>h:h)}}}else if(n==="getter"||n==="setter"){const s=t,a=Zc;Object.hasOwn(i,"signalStoragesPerProp")||(i.signalStoragesPerProp={});const c=i.signalStoragesPerProp;let u=c[r];u||(c[r]=u=new WeakMap),Object.hasOwn(i,"getterSetterPairs")||(i.getterSetterPairs={});const h=i.getterSetterPairs;return queueMicrotask(()=>{if(h[r]!==2)throw new nu(r)}),n==="getter"?(h[r]??=0,h[r]++,function(){return ut(this,u,a)(),s.call(this)}):(h[r]??=0,h[r]++,function(f){s.call(this,f),Vn(this,r),ut(this,u,a)(typeof f=="function"?()=>f:f)})}else throw new ru}let br=!1;function eu(t){br||(br=!0,queueMicrotask(()=>{if(br=!1,t===gn)throw new Error(`Stray @signal-decorated properties detected: ${Array.from(t.keys()).join(", ")}. Did you forget to use the \`@reactive\` decorator on a class that has properties decorated with \`@signal\`?`)}))}let tu=class extends Error{constructor(e){super(`Property "${String(e)}" not found on instance of class decorated with \`@reactive\`. Did you forget to use the \`@reactive\` decorator on one of your classes that has a "${String(e)}" property decorated with \`@signal\`?`)}};class nu extends Error{constructor(e){super(`Missing @signal decorator on setter or getter for property "${String(e)}". The @signal decorator will only work on a getter/setter pair with *both* getter and setter decorated with @signal.`)}}class ru extends Error{constructor(){super("The @signal decorator is only for use on fields, getters, setters, and auto accessors.")}}const Yi=Object.prototype.hasOwnProperty;function iu(t,e){if(typeof t!="function"||e&&e.kind!=="class")throw new TypeError("The @reactive decorator is only for use on classes.");const n=t,r=gn;Qc();class i extends n{constructor(...s){let a;if(bt()?fe(()=>a=Reflect.construct(n,s,new.target)):(super(...s),a=this),a[Re])return a;for(const[u,h]of r){let f=h.initialValue;if(!(Yi.call(a,u)||Yi.call(n.prototype,u)))throw new ou(u);Es(a,u,f)}return a}}return i}class ou extends Error{constructor(e){super(`Property "${String(e)}" not found on instance of class decorated with \`@reactive\`. Did you forget to use the \`@reactive\` decorator on one of your classes that has a "${String(e)}" property decorated with \`@signal\`?`)}}var Vi=Object.freeze,su=Object.defineProperty,au=(t,e)=>Vi(su(t,"raw",{value:Vi(e||t.slice())})),Qi;let Ts,ks,Os,Ps,Rs;var cu=Qe("