uEdition-Editor 2.0.0b6__py3-none-any.whl → 2.0.0b8__py3-none-any.whl

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.

Potentially problematic release.


This version of uEdition-Editor might be problematic. Click here for more details.

@@ -1,17 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CodeMirrorEditor-BAn1Wzpi.js","assets/index-Vcq4gwWv.js","assets/CodeMirrorEditor-ddcHt3UE.css","assets/TeiEditor-CjT57X2c.js"])))=>i.map(i=>d[i]);
2
- var _f=Object.defineProperty;var Fo=t=>{throw TypeError(t)};var gf=(t,e,n)=>e in t?_f(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var gs=(t,e,n)=>gf(t,typeof e!="symbol"?e+"":e,n),bs=(t,e,n)=>e.has(t)||Fo("Cannot "+n);var T=(t,e,n)=>(bs(t,e,"read from private field"),n?n.call(t):e.get(t)),be=(t,e,n)=>e.has(t)?Fo("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),re=(t,e,n,r)=>(bs(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),$e=(t,e,n)=>(bs(t,e,"access private method"),n);var Oi=(t,e,n,r)=>({set _(i){re(t,e,i,n)},get _(){return T(t,e,r)}});(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 s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function ce(){}const ts=t=>t;function ne(t,e){for(const n in e)t[n]=e[n];return t}function na(t){return t()}function Po(){return Object.create(null)}function Te(t){t.forEach(na)}function Yn(t){return typeof t=="function"}function fe(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let Ai;function q0(t,e){return t===e?!0:(Ai||(Ai=document.createElement("a")),Ai.href=e,t===Ai.href)}function bf(t){return Object.keys(t).length===0}function so(t,...e){if(t==null){for(const r of e)r(void 0);return ce}const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function $r(t){let e;return so(t,n=>e=n)(),e}function x(t,e,n){t.$$.on_destroy.push(so(e,n))}function de(t,e,n,r){if(t){const i=ra(t,e,n,r);return t[0](i)}}function ra(t,e,n,r){return t[1]&&r?ne(n.ctx.slice(),t[1](r(e))):n.ctx}function me(t,e,n,r){if(t[2]&&r){const i=t[2](r(n));if(e.dirty===void 0)return i;if(typeof i=="object"){const s=[],o=Math.max(e.dirty.length,i.length);for(let u=0;u<o;u+=1)s[u]=e.dirty[u]|i[u];return s}return e.dirty|i}return e.dirty}function pe(t,e,n,r,i,s){if(i){const o=ra(e,n,r,s);t.p(o,i)}}function he(t){if(t.ctx.length>32){const e=[],n=t.ctx.length/32;for(let r=0;r<n;r++)e[r]=-1;return e}return-1}function yt(t){const e={};for(const n in t)n[0]!=="$"&&(e[n]=t[n]);return e}function Ke(t,e){const n={};e=new Set(e);for(const r in t)!e.has(r)&&r[0]!=="$"&&(n[r]=t[r]);return n}function Ue(t){return t&&Yn(t.destroy)?t.destroy:ce}const ia=typeof window<"u";let oo=ia?()=>window.performance.now():()=>Date.now(),lo=ia?t=>requestAnimationFrame(t):ce;const sr=new Set;function sa(t){sr.forEach(e=>{e.c(t)||(sr.delete(e),e.f())}),sr.size!==0&&lo(sa)}function uo(t){let e;return sr.size===0&&lo(sa),{promise:new Promise(n=>{sr.add(e={c:t,f:n})}),abort(){sr.delete(e)}}}function P(t,e){t.appendChild(e)}function oa(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function yf(t){const e=S("style");return e.textContent="/* empty */",vf(oa(t),e),e.sheet}function vf(t,e){return P(t.head||t,e),e.sheet}function w(t,e,n){t.insertBefore(e,n||null)}function E(t){t.parentNode&&t.parentNode.removeChild(t)}function fi(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}function S(t){return document.createElement(t)}function Fs(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function Z(t){return document.createTextNode(t)}function B(){return Z(" ")}function Se(){return Z("")}function G(t,e,n,r){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}function N(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}const kf=["width","height"];function ie(t,e){const n=Object.getOwnPropertyDescriptors(t.__proto__);for(const r in e)e[r]==null?t.removeAttribute(r):r==="style"?t.style.cssText=e[r]:r==="__value"?t.value=t[r]=e[r]:n[r]&&n[r].set&&kf.indexOf(r)===-1?t[r]=e[r]:N(t,r,e[r])}function Cf(t,e){Object.keys(e).forEach(n=>{Ef(t,n,e[n])})}function Ef(t,e,n){const r=e.toLowerCase();r in t?t[r]=typeof t[r]=="boolean"&&n===""?!0:n:e in t?t[e]=typeof t[e]=="boolean"&&n===""?!0:n:N(t,e,n)}function Vi(t){return/-/.test(t)?Cf:ie}function wf(t){return Array.from(t.childNodes)}function je(t,e){e=""+e,t.data!==e&&(t.data=e)}function it(t,e){t.value=e??""}function Lo(t,e,n){for(let r=0;r<t.options.length;r+=1){const i=t.options[r];if(i.__value===e){i.selected=!0;return}}(!n||e!==void 0)&&(t.selectedIndex=-1)}function Of(t){const e=t.querySelector(":checked");return e&&e.__value}function la(t,e,{bubbles:n=!1,cancelable:r=!1}={}){return new CustomEvent(t,{detail:e,bubbles:n,cancelable:r})}function Io(t,e){return new t(e)}const Ui=new Map;let Bi=0;function Af(t){let e=5381,n=t.length;for(;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}function Tf(t,e){const n={stylesheet:yf(e),rules:{}};return Ui.set(t,n),n}function Ki(t,e,n,r,i,s,o,u=0){const l=16.666/r;let a=`{
3
- `;for(let v=0;v<=1;v+=l){const g=e+(n-e)*s(v);a+=v*100+`%{${o(g,1-g)}}
4
- `}const f=a+`100% {${o(n,1-n)}}
5
- }`,c=`__svelte_${Af(f)}_${u}`,m=oa(t),{stylesheet:p,rules:d}=Ui.get(m)||Tf(m,t);d[c]||(d[c]=!0,p.insertRule(`@keyframes ${c} ${f}`,p.cssRules.length));const _=t.style.animation||"";return t.style.animation=`${_?`${_}, `:""}${c} ${r}ms linear ${i}ms 1 both`,Bi+=1,c}function ji(t,e){const n=(t.style.animation||"").split(", "),r=n.filter(e?s=>s.indexOf(e)<0:s=>s.indexOf("__svelte")===-1),i=n.length-r.length;i&&(t.style.animation=r.join(", "),Bi-=i,Bi||$f())}function $f(){lo(()=>{Bi||(Ui.forEach(t=>{const{ownerNode:e}=t.stylesheet;e&&E(e)}),Ui.clear())})}let Zr;function zr(t){Zr=t}function ci(){if(!Zr)throw new Error("Function called outside component initialization");return Zr}function ns(t){ci().$$.on_mount.push(t)}function rs(t){ci().$$.on_destroy.push(t)}function Sf(){const t=ci();return(e,n,{cancelable:r=!1}={})=>{const i=t.$$.callbacks[e];if(i){const s=la(e,n,{cancelable:r});return i.slice().forEach(o=>{o.call(t,s)}),!s.defaultPrevented}return!0}}function At(t,e){return ci().$$.context.set(t,e),e}function bt(t){return ci().$$.context.get(t)}function Oe(t,e){const n=t.$$.callbacks[e.type];n&&n.slice().forEach(r=>r.call(this,e))}const ir=[],Ce=[];let or=[];const Ps=[],ua=Promise.resolve();let Ls=!1;function aa(){Ls||(Ls=!0,ua.then(fa))}function Wt(){return aa(),ua}function at(t){or.push(t)}function Vt(t){Ps.push(t)}const ys=new Set;let xn=0;function fa(){if(xn!==0)return;const t=Zr;do{try{for(;xn<ir.length;){const e=ir[xn];xn++,zr(e),Rf(e.$$)}}catch(e){throw ir.length=0,xn=0,e}for(zr(null),ir.length=0,xn=0;Ce.length;)Ce.pop()();for(let e=0;e<or.length;e+=1){const n=or[e];ys.has(n)||(ys.add(n),n())}or.length=0}while(ir.length);for(;Ps.length;)Ps.pop()();Ls=!1,ys.clear(),zr(t)}function Rf(t){if(t.fragment!==null){t.update(),Te(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(at)}}function Df(t){const e=[],n=[];or.forEach(r=>t.indexOf(r)===-1?e.push(r):n.push(r)),n.forEach(r=>r()),or=e}let Ur;function ao(){return Ur||(Ur=Promise.resolve(),Ur.then(()=>{Ur=null})),Ur}function Wn(t,e,n){t.dispatchEvent(la(`${e?"intro":"outro"}${n}`))}const Mi=new Set;let xt;function _e(){xt={r:0,c:[],p:xt}}function ge(){xt.r||Te(xt.c),xt=xt.p}function b(t,e){t&&t.i&&(Mi.delete(t),t.i(e))}function y(t,e,n,r){if(t&&t.o){if(Mi.has(t))return;Mi.add(t),xt.c.push(()=>{Mi.delete(t),r&&(n&&t.d(1),r())}),t.o(e)}else r&&r()}const fo={duration:0};function Dn(t,e,n){const r={direction:"in"};let i=e(t,n,r),s=!1,o,u,l=0;function a(){o&&ji(t,o)}function f(){const{delay:m=0,duration:p=300,easing:d=ts,tick:_=ce,css:v}=i||fo;v&&(o=Ki(t,0,1,p,m,d,v,l++)),_(0,1);const g=oo()+m,h=g+p;u&&u.abort(),s=!0,at(()=>Wn(t,!0,"start")),u=uo(k=>{if(s){if(k>=h)return _(1,0),Wn(t,!0,"end"),a(),s=!1;if(k>=g){const A=d((k-g)/p);_(A,1-A)}}return s})}let c=!1;return{start(){c||(c=!0,ji(t),Yn(i)?(i=i(r),ao().then(f)):f())},invalidate(){c=!1},end(){s&&(a(),s=!1)}}}function Fn(t,e,n){const r={direction:"out"};let i=e(t,n,r),s=!0,o;const u=xt;u.r+=1;let l;function a(){const{delay:f=0,duration:c=300,easing:m=ts,tick:p=ce,css:d}=i||fo;d&&(o=Ki(t,1,0,c,f,m,d));const _=oo()+f,v=_+c;at(()=>Wn(t,!1,"start")),"inert"in t&&(l=t.inert,t.inert=!0),uo(g=>{if(s){if(g>=v)return p(0,1),Wn(t,!1,"end"),--u.r||Te(u.c),!1;if(g>=_){const h=m((g-_)/c);p(1-h,h)}}return s})}return Yn(i)?ao().then(()=>{i=i(r),a()}):a(),{end(f){f&&"inert"in t&&(t.inert=l),f&&i.tick&&i.tick(1,0),s&&(o&&ji(t,o),s=!1)}}}function Tn(t,e,n,r){let s=e(t,n,{direction:"both"}),o=r?0:1,u=null,l=null,a=null,f;function c(){a&&ji(t,a)}function m(d,_){const v=d.b-o;return _*=Math.abs(v),{a:o,b:d.b,d:v,duration:_,start:d.start,end:d.start+_,group:d.group}}function p(d){const{delay:_=0,duration:v=300,easing:g=ts,tick:h=ce,css:k}=s||fo,A={start:oo()+_,b:d};d||(A.group=xt,xt.r+=1),"inert"in t&&(d?f!==void 0&&(t.inert=f):(f=t.inert,t.inert=!0)),u||l?l=A:(k&&(c(),a=Ki(t,o,d,v,_,g,k)),d&&h(0,1),u=m(A,v),at(()=>Wn(t,d,"start")),uo($=>{if(l&&$>l.start&&(u=m(l,v),l=null,Wn(t,u.b,"start"),k&&(c(),a=Ki(t,o,u.b,u.duration,0,g,s.css))),u){if($>=u.end)h(o=u.b,1-o),Wn(t,u.b,"end"),l||(u.b?c():--u.group.r||Te(u.group.c)),u=null;else if($>=u.start){const C=$-u.start;o=u.a+u.d*g(C/u.duration),h(o,1-o)}}return!!(u||l)}))}return{run(d){Yn(s)?ao().then(()=>{s=s({direction:d?"in":"out"}),p(d)}):p(d)},end(){c(),u=l=null}}}function tn(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function Me(t,e){const n={},r={},i={$$scope:1};let s=t.length;for(;s--;){const o=t[s],u=e[s];if(u){for(const l in o)l in u||(r[l]=1);for(const l in u)i[l]||(n[l]=u[l],i[l]=1);t[s]=u}else for(const l in o)i[l]=1}for(const o in r)o in n||(n[o]=void 0);return n}function Ut(t,e,n){const r=t.$$.props[e];r!==void 0&&(t.$$.bound[r]=n,n(t.$$.ctx[r]))}function U(t){t&&t.c()}function H(t,e,n){const{fragment:r,after_update:i}=t.$$;r&&r.m(e,n),at(()=>{const s=t.$$.on_mount.map(na).filter(Yn);t.$$.on_destroy?t.$$.on_destroy.push(...s):Te(s),t.$$.on_mount=[]}),i.forEach(at)}function V(t,e){const n=t.$$;n.fragment!==null&&(Df(n.after_update),Te(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function Ff(t,e){t.$$.dirty[0]===-1&&(ir.push(t),aa(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function ye(t,e,n,r,i,s,o=null,u=[-1]){const l=Zr;zr(t);const a=t.$$={fragment:null,ctx:[],props:s,update:ce,not_equal:i,bound:Po(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(l?l.$$.context:[])),callbacks:Po(),dirty:u,skip_bound:!1,root:e.target||l.$$.root};o&&o(a.root);let f=!1;if(a.ctx=n?n(t,e.props||{},(c,m,...p)=>{const d=p.length?p[0]:m;return a.ctx&&i(a.ctx[c],a.ctx[c]=d)&&(!a.skip_bound&&a.bound[c]&&a.bound[c](d),f&&Ff(t,c)),m}):[],a.update(),f=!0,Te(a.before_update),a.fragment=r?r(a.ctx):!1,e.target){if(e.hydrate){const c=wf(e.target);a.fragment&&a.fragment.l(c),c.forEach(E)}else a.fragment&&a.fragment.c();e.intro&&b(t.$$.fragment),H(t,e.target,e.anchor),fa()}zr(l)}class ve{constructor(){gs(this,"$$");gs(this,"$$set")}$destroy(){V(this,1),this.$destroy=ce}$on(e,n){if(!Yn(n))return ce;const r=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return r.push(n),()=>{const i=r.indexOf(n);i!==-1&&r.splice(i,1)}}$set(e){this.$$set&&!bf(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Pf="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Pf);var Sr=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},wr=typeof window>"u"||"Deno"in globalThis;function Ht(){}function Lf(t,e){return typeof t=="function"?t(e):t}function Is(t){return typeof t=="number"&&t>=0&&t!==1/0}function ca(t,e){return Math.max(t+(e||0)-Date.now(),0)}function lr(t,e){return typeof t=="function"?t(e):t}function jt(t,e){return typeof t=="function"?t(e):t}function Mo(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:u}=t;if(o){if(r){if(e.queryHash!==co(o,e.options))return!1}else if(!Xr(e.queryKey,o))return!1}if(n!=="all"){const l=e.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof u=="boolean"&&e.isStale()!==u||i&&i!==e.state.fetchStatus||s&&!s(e))}function No(t,e){const{exact:n,status:r,predicate:i,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(n){if(qn(e.options.mutationKey)!==qn(s))return!1}else if(!Xr(e.options.mutationKey,s))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function co(t,e){return((e==null?void 0:e.queryKeyHashFn)||qn)(t)}function qn(t){return JSON.stringify(t,(e,n)=>Ms(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Xr(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(n=>!Xr(t[n],e[n])):!1}function da(t,e){if(t===e)return t;const n=Ho(t)&&Ho(e);if(n||Ms(t)&&Ms(e)){const r=n?t:Object.keys(t),i=r.length,s=n?e:Object.keys(e),o=s.length,u=n?[]:{};let l=0;for(let a=0;a<o;a++){const f=n?a:s[a];(!n&&r.includes(f)||n)&&t[f]===void 0&&e[f]===void 0?(u[f]=void 0,l++):(u[f]=da(t[f],e[f]),u[f]===t[f]&&t[f]!==void 0&&l++)}return i===o&&l===i?t:u}return e}function Wi(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function Ho(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Ms(t){if(!Vo(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!Vo(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function Vo(t){return Object.prototype.toString.call(t)==="[object Object]"}function If(t){return new Promise(e=>{setTimeout(e,t)})}function Ns(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?da(t,e):e}function Mf(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function Nf(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var mo=Symbol();function ma(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===mo?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var Nn,bn,cr,Qu,Hf=(Qu=class extends Sr{constructor(){super();be(this,Nn);be(this,bn);be(this,cr);re(this,cr,e=>{if(!wr&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){T(this,bn)||this.setEventListener(T(this,cr))}onUnsubscribe(){var e;this.hasListeners()||((e=T(this,bn))==null||e.call(this),re(this,bn,void 0))}setEventListener(e){var n;re(this,cr,e),(n=T(this,bn))==null||n.call(this),re(this,bn,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){T(this,Nn)!==e&&(re(this,Nn,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof T(this,Nn)=="boolean"?T(this,Nn):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Nn=new WeakMap,bn=new WeakMap,cr=new WeakMap,Qu),po=new Hf,dr,yn,mr,zu,Vf=(zu=class extends Sr{constructor(){super();be(this,dr,!0);be(this,yn);be(this,mr);re(this,mr,e=>{if(!wr&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){T(this,yn)||this.setEventListener(T(this,mr))}onUnsubscribe(){var e;this.hasListeners()||((e=T(this,yn))==null||e.call(this),re(this,yn,void 0))}setEventListener(e){var n;re(this,mr,e),(n=T(this,yn))==null||n.call(this),re(this,yn,e(this.setOnline.bind(this)))}setOnline(e){T(this,dr)!==e&&(re(this,dr,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return T(this,dr)}},dr=new WeakMap,yn=new WeakMap,mr=new WeakMap,zu),qi=new Vf;function Hs(){let t,e;const n=new Promise((i,s)=>{t=i,e=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),t(i)},n.reject=i=>{r({status:"rejected",reason:i}),e(i)},n}function Uf(t){return Math.min(1e3*2**t,3e4)}function pa(t){return(t??"online")==="online"?qi.isOnline():!0}var ha=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function vs(t){return t instanceof ha}function _a(t){let e=!1,n=0,r=!1,i;const s=Hs(),o=_=>{var v;r||(m(new ha(_)),(v=t.abort)==null||v.call(t))},u=()=>{e=!0},l=()=>{e=!1},a=()=>po.isFocused()&&(t.networkMode==="always"||qi.isOnline())&&t.canRun(),f=()=>pa(t.networkMode)&&t.canRun(),c=_=>{var v;r||(r=!0,(v=t.onSuccess)==null||v.call(t,_),i==null||i(),s.resolve(_))},m=_=>{var v;r||(r=!0,(v=t.onError)==null||v.call(t,_),i==null||i(),s.reject(_))},p=()=>new Promise(_=>{var v;i=g=>{(r||a())&&_(g)},(v=t.onPause)==null||v.call(t)}).then(()=>{var _;i=void 0,r||(_=t.onContinue)==null||_.call(t)}),d=()=>{if(r)return;let _;const v=n===0?t.initialPromise:void 0;try{_=v??t.fn()}catch(g){_=Promise.reject(g)}Promise.resolve(_).then(c).catch(g=>{var C;if(r)return;const h=t.retry??(wr?0:3),k=t.retryDelay??Uf,A=typeof k=="function"?k(n,g):k,$=h===!0||typeof h=="number"&&n<h||typeof h=="function"&&h(n,g);if(e||!$){m(g);return}n++,(C=t.onFail)==null||C.call(t,n,g),If(A).then(()=>a()?void 0:p()).then(()=>{e?m(g):d()})})};return{promise:s,cancel:o,continue:()=>(i==null||i(),s),cancelRetry:u,continueRetry:l,canStart:f,start:()=>(f()?d():p().then(d),s)}}function Bf(){let t=[],e=0,n=u=>{u()},r=u=>{u()},i=u=>setTimeout(u,0);const s=u=>{e?t.push(u):i(()=>{n(u)})},o=()=>{const u=t;t=[],u.length&&i(()=>{r(()=>{u.forEach(l=>{n(l)})})})};return{batch:u=>{let l;e++;try{l=u()}finally{e--,e||o()}return l},batchCalls:u=>(...l)=>{s(()=>{u(...l)})},schedule:s,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{r=u},setScheduler:u=>{i=u}}}var ut=Bf(),Hn,Gu,ga=(Gu=class{constructor(){be(this,Hn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Is(this.gcTime)&&re(this,Hn,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(wr?1/0:5*60*1e3))}clearGcTimeout(){T(this,Hn)&&(clearTimeout(T(this,Hn)),re(this,Hn,void 0))}},Hn=new WeakMap,Gu),pr,hr,Nt,kt,oi,Vn,Bt,sn,Yu,Kf=(Yu=class extends ga{constructor(e){super();be(this,Bt);be(this,pr);be(this,hr);be(this,Nt);be(this,kt);be(this,oi);be(this,Vn);re(this,Vn,!1),re(this,oi,e.defaultOptions),this.setOptions(e.options),this.observers=[],re(this,Nt,e.cache),this.queryKey=e.queryKey,this.queryHash=e.queryHash,re(this,pr,jf(this.options)),this.state=e.state??T(this,pr),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=T(this,kt))==null?void 0:e.promise}setOptions(e){this.options={...T(this,oi),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&T(this,Nt).remove(this)}setData(e,n){const r=Ns(this.state.data,e,this.options);return $e(this,Bt,sn).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){$e(this,Bt,sn).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,i;const n=(r=T(this,kt))==null?void 0:r.promise;return(i=T(this,kt))==null||i.cancel(e),n?n.then(Ht).catch(Ht):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(T(this,pr))}isActive(){return this.observers.some(e=>jt(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===mo||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!ca(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=T(this,kt))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=T(this,kt))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),T(this,Nt).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(T(this,kt)&&(T(this,Vn)?T(this,kt).cancel({revert:!0}):T(this,kt).cancelRetry()),this.scheduleGc()),T(this,Nt).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||$e(this,Bt,sn).call(this,{type:"invalidate"})}fetch(e,n){var l,a,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(T(this,kt))return T(this,kt).continueRetry(),T(this,kt).promise}if(e&&this.setOptions(e),!this.options.queryFn){const c=this.observers.find(m=>m.options.queryFn);c&&this.setOptions(c.options)}const r=new AbortController,i=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(re(this,Vn,!0),r.signal)})},s=()=>{const c=ma(this.options,n),m={queryKey:this.queryKey,meta:this.meta};return i(m),re(this,Vn,!1),this.options.persister?this.options.persister(c,m,this):c(m)},o={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(o),(l=this.options.behavior)==null||l.onFetch(o,this),re(this,hr,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((a=o.fetchOptions)==null?void 0:a.meta))&&$e(this,Bt,sn).call(this,{type:"fetch",meta:(f=o.fetchOptions)==null?void 0:f.meta});const u=c=>{var m,p,d,_;vs(c)&&c.silent||$e(this,Bt,sn).call(this,{type:"error",error:c}),vs(c)||((p=(m=T(this,Nt).config).onError)==null||p.call(m,c,this),(_=(d=T(this,Nt).config).onSettled)==null||_.call(d,this.state.data,c,this)),this.scheduleGc()};return re(this,kt,_a({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:c=>{var m,p,d,_;if(c===void 0){u(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(c)}catch(v){u(v);return}(p=(m=T(this,Nt).config).onSuccess)==null||p.call(m,c,this),(_=(d=T(this,Nt).config).onSettled)==null||_.call(d,c,this.state.error,this),this.scheduleGc()},onError:u,onFail:(c,m)=>{$e(this,Bt,sn).call(this,{type:"failed",failureCount:c,error:m})},onPause:()=>{$e(this,Bt,sn).call(this,{type:"pause"})},onContinue:()=>{$e(this,Bt,sn).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),T(this,kt).start()}},pr=new WeakMap,hr=new WeakMap,Nt=new WeakMap,kt=new WeakMap,oi=new WeakMap,Vn=new WeakMap,Bt=new WeakSet,sn=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...ba(r.data,this.options),fetchMeta:e.meta??null};case"success":return{...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=e.error;return vs(i)&&i.revert&&T(this,hr)?{...T(this,hr),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),ut.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),T(this,Nt).notify({query:this,type:"updated",action:e})})},Yu);function ba(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:pa(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function jf(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Yt,Zu,Wf=(Zu=class extends Sr{constructor(e={}){super();be(this,Yt);this.config=e,re(this,Yt,new Map)}build(e,n,r){const i=n.queryKey,s=n.queryHash??co(i,n);let o=this.get(s);return o||(o=new Kf({cache:this,queryKey:i,queryHash:s,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(o)),o}add(e){T(this,Yt).has(e.queryHash)||(T(this,Yt).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=T(this,Yt).get(e.queryHash);n&&(e.destroy(),n===e&&T(this,Yt).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){ut.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return T(this,Yt).get(e)}getAll(){return[...T(this,Yt).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>Mo(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>Mo(e,r)):n}notify(e){ut.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){ut.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ut.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Yt=new WeakMap,Zu),Zt,wt,Un,Xt,_n,Xu,qf=(Xu=class extends ga{constructor(e){super();be(this,Xt);be(this,Zt);be(this,wt);be(this,Un);this.mutationId=e.mutationId,re(this,wt,e.mutationCache),re(this,Zt,[]),this.state=e.state||ya(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){T(this,Zt).includes(e)||(T(this,Zt).push(e),this.clearGcTimeout(),T(this,wt).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){re(this,Zt,T(this,Zt).filter(n=>n!==e)),this.scheduleGc(),T(this,wt).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){T(this,Zt).length||(this.state.status==="pending"?this.scheduleGc():T(this,wt).remove(this))}continue(){var e;return((e=T(this,Un))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var i,s,o,u,l,a,f,c,m,p,d,_,v,g,h,k,A,$,C,F;re(this,Un,_a({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(R,K)=>{$e(this,Xt,_n).call(this,{type:"failed",failureCount:R,error:K})},onPause:()=>{$e(this,Xt,_n).call(this,{type:"pause"})},onContinue:()=>{$e(this,Xt,_n).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>T(this,wt).canRun(this)}));const n=this.state.status==="pending",r=!T(this,Un).canStart();try{if(!n){$e(this,Xt,_n).call(this,{type:"pending",variables:e,isPaused:r}),await((s=(i=T(this,wt).config).onMutate)==null?void 0:s.call(i,e,this));const K=await((u=(o=this.options).onMutate)==null?void 0:u.call(o,e));K!==this.state.context&&$e(this,Xt,_n).call(this,{type:"pending",context:K,variables:e,isPaused:r})}const R=await T(this,Un).start();return await((a=(l=T(this,wt).config).onSuccess)==null?void 0:a.call(l,R,e,this.state.context,this)),await((c=(f=this.options).onSuccess)==null?void 0:c.call(f,R,e,this.state.context)),await((p=(m=T(this,wt).config).onSettled)==null?void 0:p.call(m,R,null,this.state.variables,this.state.context,this)),await((_=(d=this.options).onSettled)==null?void 0:_.call(d,R,null,e,this.state.context)),$e(this,Xt,_n).call(this,{type:"success",data:R}),R}catch(R){try{throw await((g=(v=T(this,wt).config).onError)==null?void 0:g.call(v,R,e,this.state.context,this)),await((k=(h=this.options).onError)==null?void 0:k.call(h,R,e,this.state.context)),await(($=(A=T(this,wt).config).onSettled)==null?void 0:$.call(A,void 0,R,this.state.variables,this.state.context,this)),await((F=(C=this.options).onSettled)==null?void 0:F.call(C,void 0,R,e,this.state.context)),R}finally{$e(this,Xt,_n).call(this,{type:"error",error:R})}}finally{T(this,wt).runNext(this)}}},Zt=new WeakMap,wt=new WeakMap,Un=new WeakMap,Xt=new WeakSet,_n=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),ut.batch(()=>{T(this,Zt).forEach(r=>{r.onMutationUpdate(e)}),T(this,wt).notify({mutation:this,type:"updated",action:e})})},Xu);function ya(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var un,Kt,li,Ju,Qf=(Ju=class extends Sr{constructor(e={}){super();be(this,un);be(this,Kt);be(this,li);this.config=e,re(this,un,new Set),re(this,Kt,new Map),re(this,li,0)}build(e,n,r){const i=new qf({mutationCache:this,mutationId:++Oi(this,li)._,options:e.defaultMutationOptions(n),state:r});return this.add(i),i}add(e){T(this,un).add(e);const n=Ti(e);if(typeof n=="string"){const r=T(this,Kt).get(n);r?r.push(e):T(this,Kt).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(T(this,un).delete(e)){const n=Ti(e);if(typeof n=="string"){const r=T(this,Kt).get(n);if(r)if(r.length>1){const i=r.indexOf(e);i!==-1&&r.splice(i,1)}else r[0]===e&&T(this,Kt).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=Ti(e);if(typeof n=="string"){const r=T(this,Kt).get(n),i=r==null?void 0:r.find(s=>s.state.status==="pending");return!i||i===e}else return!0}runNext(e){var r;const n=Ti(e);if(typeof n=="string"){const i=(r=T(this,Kt).get(n))==null?void 0:r.find(s=>s!==e&&s.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){ut.batch(()=>{T(this,un).forEach(e=>{this.notify({type:"removed",mutation:e})}),T(this,un).clear(),T(this,Kt).clear()})}getAll(){return Array.from(T(this,un))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>No(n,r))}findAll(e={}){return this.getAll().filter(n=>No(e,n))}notify(e){ut.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return ut.batch(()=>Promise.all(e.map(n=>n.continue().catch(Ht))))}},un=new WeakMap,Kt=new WeakMap,li=new WeakMap,Ju);function Ti(t){var e;return(e=t.options.scope)==null?void 0:e.id}function Uo(t){return{onFetch:(e,n)=>{var f,c,m,p,d;const r=e.options,i=(m=(c=(f=e.fetchOptions)==null?void 0:f.meta)==null?void 0:c.fetchMore)==null?void 0:m.direction,s=((p=e.state.data)==null?void 0:p.pages)||[],o=((d=e.state.data)==null?void 0:d.pageParams)||[];let u={pages:[],pageParams:[]},l=0;const a=async()=>{let _=!1;const v=k=>{Object.defineProperty(k,"signal",{enumerable:!0,get:()=>(e.signal.aborted?_=!0:e.signal.addEventListener("abort",()=>{_=!0}),e.signal)})},g=ma(e.options,e.fetchOptions),h=async(k,A,$)=>{if(_)return Promise.reject();if(A==null&&k.pages.length)return Promise.resolve(k);const C={queryKey:e.queryKey,pageParam:A,direction:$?"backward":"forward",meta:e.options.meta};v(C);const F=await g(C),{maxPages:R}=e.options,K=$?Nf:Mf;return{pages:K(k.pages,F,R),pageParams:K(k.pageParams,A,R)}};if(i&&s.length){const k=i==="backward",A=k?zf:Bo,$={pages:s,pageParams:o},C=A(r,$);u=await h($,C,k)}else{const k=t??s.length;do{const A=l===0?o[0]??r.initialPageParam:Bo(r,u);if(l>0&&A==null)break;u=await h(u,A),l++}while(l<k)}return u};e.options.persister?e.fetchFn=()=>{var _,v;return(v=(_=e.options).persister)==null?void 0:v.call(_,a,{queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=a}}}function Bo(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function zf(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var nt,vn,kn,_r,gr,Cn,br,yr,xu,va=(xu=class{constructor(t={}){be(this,nt);be(this,vn);be(this,kn);be(this,_r);be(this,gr);be(this,Cn);be(this,br);be(this,yr);re(this,nt,t.queryCache||new Wf),re(this,vn,t.mutationCache||new Qf),re(this,kn,t.defaultOptions||{}),re(this,_r,new Map),re(this,gr,new Map),re(this,Cn,0)}mount(){Oi(this,Cn)._++,T(this,Cn)===1&&(re(this,br,po.subscribe(async t=>{t&&(await this.resumePausedMutations(),T(this,nt).onFocus())})),re(this,yr,qi.subscribe(async t=>{t&&(await this.resumePausedMutations(),T(this,nt).onOnline())})))}unmount(){var t,e;Oi(this,Cn)._--,T(this,Cn)===0&&((t=T(this,br))==null||t.call(this),re(this,br,void 0),(e=T(this,yr))==null||e.call(this),re(this,yr,void 0))}isFetching(t){return T(this,nt).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return T(this,vn).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=T(this,nt).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=T(this,nt).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(lr(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return T(this,nt).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),i=T(this,nt).get(r.queryHash),s=i==null?void 0:i.state.data,o=Lf(e,s);if(o!==void 0)return T(this,nt).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(t,e,n){return ut.batch(()=>T(this,nt).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=T(this,nt).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=T(this,nt);ut.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=T(this,nt),r={type:"active",...t};return ut.batch(()=>(n.findAll(t).forEach(i=>{i.reset()}),this.refetchQueries(r,e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=ut.batch(()=>T(this,nt).findAll(t).map(i=>i.cancel(n)));return Promise.all(r).then(Ht).catch(Ht)}invalidateQueries(t,e={}){return ut.batch(()=>{if(T(this,nt).findAll(t).forEach(r=>{r.invalidate()}),(t==null?void 0:t.refetchType)==="none")return Promise.resolve();const n={...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"};return this.refetchQueries(n,e)})}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=ut.batch(()=>T(this,nt).findAll(t).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(Ht)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Ht)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=T(this,nt).build(this,e);return n.isStaleByTime(lr(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Ht).catch(Ht)}fetchInfiniteQuery(t){return t.behavior=Uo(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Ht).catch(Ht)}ensureInfiniteQueryData(t){return t.behavior=Uo(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return qi.isOnline()?T(this,vn).resumePausedMutations():Promise.resolve()}getQueryCache(){return T(this,nt)}getMutationCache(){return T(this,vn)}getDefaultOptions(){return T(this,kn)}setDefaultOptions(t){re(this,kn,t)}setQueryDefaults(t,e){T(this,_r).set(qn(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...T(this,_r).values()],n={};return e.forEach(r=>{Xr(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){T(this,gr).set(qn(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...T(this,gr).values()];let n={};return e.forEach(r=>{Xr(t,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...T(this,kn).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=co(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===mo&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...T(this,kn).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){T(this,nt).clear(),T(this,vn).clear()}},nt=new WeakMap,vn=new WeakMap,kn=new WeakMap,_r=new WeakMap,gr=new WeakMap,Cn=new WeakMap,br=new WeakMap,yr=new WeakMap,xu),St,Ve,ui,Ot,Bn,vr,En,Jt,ai,kr,Cr,Kn,jn,wn,Er,Ye,qr,Vs,Us,Bs,Ks,js,Ws,qs,ka,ea,Gf=(ea=class extends Sr{constructor(e,n){super();be(this,Ye);be(this,St);be(this,Ve);be(this,ui);be(this,Ot);be(this,Bn);be(this,vr);be(this,En);be(this,Jt);be(this,ai);be(this,kr);be(this,Cr);be(this,Kn);be(this,jn);be(this,wn);be(this,Er,new Set);this.options=n,re(this,St,e),re(this,Jt,null),re(this,En,Hs()),this.options.experimental_prefetchInRender||T(this,En).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(T(this,Ve).addObserver(this),Ko(T(this,Ve),this.options)?$e(this,Ye,qr).call(this):this.updateResult(),$e(this,Ye,Ks).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Qs(T(this,Ve),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Qs(T(this,Ve),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,$e(this,Ye,js).call(this),$e(this,Ye,Ws).call(this),T(this,Ve).removeObserver(this)}setOptions(e,n){const r=this.options,i=T(this,Ve);if(this.options=T(this,St).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof jt(this.options.enabled,T(this,Ve))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");$e(this,Ye,qs).call(this),T(this,Ve).setOptions(this.options),r._defaulted&&!Wi(this.options,r)&&T(this,St).getQueryCache().notify({type:"observerOptionsUpdated",query:T(this,Ve),observer:this});const s=this.hasListeners();s&&jo(T(this,Ve),i,this.options,r)&&$e(this,Ye,qr).call(this),this.updateResult(n),s&&(T(this,Ve)!==i||jt(this.options.enabled,T(this,Ve))!==jt(r.enabled,T(this,Ve))||lr(this.options.staleTime,T(this,Ve))!==lr(r.staleTime,T(this,Ve)))&&$e(this,Ye,Vs).call(this);const o=$e(this,Ye,Us).call(this);s&&(T(this,Ve)!==i||jt(this.options.enabled,T(this,Ve))!==jt(r.enabled,T(this,Ve))||o!==T(this,wn))&&$e(this,Ye,Bs).call(this,o)}getOptimisticResult(e){const n=T(this,St).getQueryCache().build(T(this,St),e),r=this.createResult(n,e);return Zf(this,r)&&(re(this,Ot,r),re(this,vr,this.options),re(this,Bn,T(this,Ve).state)),r}getCurrentResult(){return T(this,Ot)}trackResult(e,n){const r={};return Object.keys(e).forEach(i=>{Object.defineProperty(r,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),n==null||n(i),e[i])})}),r}trackProp(e){T(this,Er).add(e)}getCurrentQuery(){return T(this,Ve)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=T(this,St).defaultQueryOptions(e),r=T(this,St).getQueryCache().build(T(this,St),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return $e(this,Ye,qr).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),T(this,Ot)))}createResult(e,n){var R;const r=T(this,Ve),i=this.options,s=T(this,Ot),o=T(this,Bn),u=T(this,vr),a=e!==r?e.state:T(this,ui),{state:f}=e;let c={...f},m=!1,p;if(n._optimisticResults){const K=this.hasListeners(),M=!K&&Ko(e,n),D=K&&jo(e,r,n,i);(M||D)&&(c={...c,...ba(f.data,e.options)}),n._optimisticResults==="isRestoring"&&(c.fetchStatus="idle")}let{error:d,errorUpdatedAt:_,status:v}=c;if(n.select&&c.data!==void 0)if(s&&c.data===(o==null?void 0:o.data)&&n.select===T(this,ai))p=T(this,kr);else try{re(this,ai,n.select),p=n.select(c.data),p=Ns(s==null?void 0:s.data,p,n),re(this,kr,p),re(this,Jt,null)}catch(K){re(this,Jt,K)}else p=c.data;if(n.placeholderData!==void 0&&p===void 0&&v==="pending"){let K;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(u==null?void 0:u.placeholderData))K=s.data;else if(K=typeof n.placeholderData=="function"?n.placeholderData((R=T(this,Cr))==null?void 0:R.state.data,T(this,Cr)):n.placeholderData,n.select&&K!==void 0)try{K=n.select(K),re(this,Jt,null)}catch(M){re(this,Jt,M)}K!==void 0&&(v="success",p=Ns(s==null?void 0:s.data,K,n),m=!0)}T(this,Jt)&&(d=T(this,Jt),p=T(this,kr),_=Date.now(),v="error");const g=c.fetchStatus==="fetching",h=v==="pending",k=v==="error",A=h&&g,$=p!==void 0,F={status:v,fetchStatus:c.fetchStatus,isPending:h,isSuccess:v==="success",isError:k,isInitialLoading:A,isLoading:A,data:p,dataUpdatedAt:c.dataUpdatedAt,error:d,errorUpdatedAt:_,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>a.dataUpdateCount||c.errorUpdateCount>a.errorUpdateCount,isFetching:g,isRefetching:g&&!h,isLoadingError:k&&!$,isPaused:c.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:k&&$,isStale:ho(e,n),refetch:this.refetch,promise:T(this,En)};if(this.options.experimental_prefetchInRender){const K=I=>{F.status==="error"?I.reject(F.error):F.data!==void 0&&I.resolve(F.data)},M=()=>{const I=re(this,En,F.promise=Hs());K(I)},D=T(this,En);switch(D.status){case"pending":e.queryHash===r.queryHash&&K(D);break;case"fulfilled":(F.status==="error"||F.data!==D.value)&&M();break;case"rejected":(F.status!=="error"||F.error!==D.reason)&&M();break}}return F}updateResult(e){const n=T(this,Ot),r=this.createResult(T(this,Ve),this.options);if(re(this,Bn,T(this,Ve).state),re(this,vr,this.options),T(this,Bn).data!==void 0&&re(this,Cr,T(this,Ve)),Wi(r,n))return;re(this,Ot,r);const i={},s=()=>{if(!n)return!0;const{notifyOnChangeProps:o}=this.options,u=typeof o=="function"?o():o;if(u==="all"||!u&&!T(this,Er).size)return!0;const l=new Set(u??T(this,Er));return this.options.throwOnError&&l.add("error"),Object.keys(T(this,Ot)).some(a=>{const f=a;return T(this,Ot)[f]!==n[f]&&l.has(f)})};(e==null?void 0:e.listeners)!==!1&&s()&&(i.listeners=!0),$e(this,Ye,ka).call(this,{...i,...e})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&$e(this,Ye,Ks).call(this)}},St=new WeakMap,Ve=new WeakMap,ui=new WeakMap,Ot=new WeakMap,Bn=new WeakMap,vr=new WeakMap,En=new WeakMap,Jt=new WeakMap,ai=new WeakMap,kr=new WeakMap,Cr=new WeakMap,Kn=new WeakMap,jn=new WeakMap,wn=new WeakMap,Er=new WeakMap,Ye=new WeakSet,qr=function(e){$e(this,Ye,qs).call(this);let n=T(this,Ve).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(Ht)),n},Vs=function(){$e(this,Ye,js).call(this);const e=lr(this.options.staleTime,T(this,Ve));if(wr||T(this,Ot).isStale||!Is(e))return;const r=ca(T(this,Ot).dataUpdatedAt,e)+1;re(this,Kn,setTimeout(()=>{T(this,Ot).isStale||this.updateResult()},r))},Us=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(T(this,Ve)):this.options.refetchInterval)??!1},Bs=function(e){$e(this,Ye,Ws).call(this),re(this,wn,e),!(wr||jt(this.options.enabled,T(this,Ve))===!1||!Is(T(this,wn))||T(this,wn)===0)&&re(this,jn,setInterval(()=>{(this.options.refetchIntervalInBackground||po.isFocused())&&$e(this,Ye,qr).call(this)},T(this,wn)))},Ks=function(){$e(this,Ye,Vs).call(this),$e(this,Ye,Bs).call(this,$e(this,Ye,Us).call(this))},js=function(){T(this,Kn)&&(clearTimeout(T(this,Kn)),re(this,Kn,void 0))},Ws=function(){T(this,jn)&&(clearInterval(T(this,jn)),re(this,jn,void 0))},qs=function(){const e=T(this,St).getQueryCache().build(T(this,St),this.options);if(e===T(this,Ve))return;const n=T(this,Ve);re(this,Ve,e),re(this,ui,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},ka=function(e){ut.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(T(this,Ot))}),T(this,St).getQueryCache().notify({query:T(this,Ve),type:"observerResultsUpdated"})})},ea);function Yf(t,e){return jt(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function Ko(t,e){return Yf(t,e)||t.state.data!==void 0&&Qs(t,e,e.refetchOnMount)}function Qs(t,e,n){if(jt(e.enabled,t)!==!1){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&ho(t,e)}return!1}function jo(t,e,n,r){return(t!==e||jt(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&ho(t,n)}function ho(t,e){return jt(e.enabled,t)!==!1&&t.isStaleByTime(lr(e.staleTime,t))}function Zf(t,e){return!Wi(t.getCurrentResult(),e)}var On,An,Rt,an,dn,Ni,zs,ta,Xf=(ta=class extends Sr{constructor(n,r){super();be(this,dn);be(this,On);be(this,An);be(this,Rt);be(this,an);re(this,On,n),this.setOptions(r),this.bindMethods(),$e(this,dn,Ni).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=T(this,On).defaultMutationOptions(n),Wi(this.options,r)||T(this,On).getMutationCache().notify({type:"observerOptionsUpdated",mutation:T(this,Rt),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&qn(r.mutationKey)!==qn(this.options.mutationKey)?this.reset():((i=T(this,Rt))==null?void 0:i.state.status)==="pending"&&T(this,Rt).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=T(this,Rt))==null||n.removeObserver(this)}onMutationUpdate(n){$e(this,dn,Ni).call(this),$e(this,dn,zs).call(this,n)}getCurrentResult(){return T(this,An)}reset(){var n;(n=T(this,Rt))==null||n.removeObserver(this),re(this,Rt,void 0),$e(this,dn,Ni).call(this),$e(this,dn,zs).call(this)}mutate(n,r){var i;return re(this,an,r),(i=T(this,Rt))==null||i.removeObserver(this),re(this,Rt,T(this,On).getMutationCache().build(T(this,On),this.options)),T(this,Rt).addObserver(this),T(this,Rt).execute(n)}},On=new WeakMap,An=new WeakMap,Rt=new WeakMap,an=new WeakMap,dn=new WeakSet,Ni=function(){var r;const n=((r=T(this,Rt))==null?void 0:r.state)??ya();re(this,An,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},zs=function(n){ut.batch(()=>{var r,i,s,o,u,l,a,f;if(T(this,an)&&this.hasListeners()){const c=T(this,An).variables,m=T(this,An).context;(n==null?void 0:n.type)==="success"?((i=(r=T(this,an)).onSuccess)==null||i.call(r,n.data,c,m),(o=(s=T(this,an)).onSettled)==null||o.call(s,n.data,null,c,m)):(n==null?void 0:n.type)==="error"&&((l=(u=T(this,an)).onError)==null||l.call(u,n.error,c,m),(f=(a=T(this,an)).onSettled)==null||f.call(a,void 0,n.error,c,m))}this.listeners.forEach(c=>{c(T(this,An))})})},ta);const er=[];function gt(t,e){return{subscribe:Fe(t,e).subscribe}}function Fe(t,e=ce){let n;const r=new Set;function i(u){if(fe(t,u)&&(t=u,n)){const l=!er.length;for(const a of r)a[1](),er.push(a,t);if(l){for(let a=0;a<er.length;a+=2)er[a][0](er[a+1]);er.length=0}}}function s(u){i(u(t))}function o(u,l=ce){const a=[u,l];return r.add(a),r.size===1&&(n=e(i,s)||ce),u(t),()=>{r.delete(a),r.size===0&&n&&(n(),n=null)}}return{set:i,update:s,subscribe:o}}function ze(t,e,n){const r=!Array.isArray(t),i=r?[t]:t;if(!i.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const s=e.length<2;return gt(n,(o,u)=>{let l=!1;const a=[];let f=0,c=ce;const m=()=>{if(f)return;c();const d=e(r?a[0]:a,o,u);s?o(d):c=Yn(d)?d:ce},p=i.map((d,_)=>so(d,v=>{a[_]=v,f&=~(1<<_),l&&m()},()=>{f|=1<<_}));return l=!0,m(),function(){Te(p),c(),l=!1}})}function Wo(t){return{subscribe:t.subscribe.bind(t)}}const Ca="$$_queryClient",Jf=()=>{const t=bt(Ca);if(!t)throw new Error("No QueryClient was found in Svelte context. Did you forget to wrap your component with QueryClientProvider?");return t},xf=t=>{At(Ca,t)},ec="$$_isRestoring",tc=()=>{try{const t=bt(ec);return t||gt(!1)}catch{return gt(!1)}};function nc(){return tc()}function Ct(t){return Jf()}function Ea(t){return"subscribe"in t&&typeof t.subscribe=="function"}function wa(){}function rc(t,e,n){const r=Ct(),i=nc(),s=Ea(t)?t:gt(t),o=ze([s,i],([f,c])=>{const m=r.defaultQueryOptions(f);return m._optimisticResults=c?"isRestoring":"optimistic",m}),u=new e(r,$r(o));o.subscribe(f=>{u.setOptions(f,{listeners:!1})});const l=ze(i,(f,c)=>{const m=f?wa:u.subscribe(ut.batchCalls(c));return u.updateResult(),m}),{subscribe:a}=ze([l,o],([f,c])=>(f=u.getOptimisticResult(c),c.notifyOnChangeProps?f:u.trackResult(f)));return{subscribe:a}}function Or(t,e){return rc(t,Gf)}function di(t,e){const n=Ct(),r=Ea(t)?t:gt(t),i=new Xf(n,$r(r));let s;r.subscribe(l=>{s=(a,f)=>{i.mutate(a,f).catch(wa)},i.setOptions(l)});const o=gt(i.getCurrentResult(),l=>i.subscribe(ut.batchCalls(a=>l(a)))),{subscribe:u}=ze(o,l=>({...l,mutate:s,mutateAsync:l.mutate}));return{subscribe:u}}function ic(t){let e;const n=t[2].default,r=de(n,t,t[1],null);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,[s]){r&&r.p&&(!e||s&2)&&pe(r,n,i,i[1],e?me(n,i[1],s,null):he(i[1]),null)},i(i){e||(b(r,i),e=!0)},o(i){y(r,i),e=!1},d(i){r&&r.d(i)}}}function sc(t,e,n){let{$$slots:r={},$$scope:i}=e,{client:s=new va}=e;return ns(()=>{s.mount()}),xf(s),rs(()=>{s.unmount()}),t.$$set=o=>{"client"in o&&n(0,s=o.client),"$$scope"in o&&n(1,i=o.$$scope)},[s,i,r]}class oc extends ve{constructor(e){super(),ye(this,e,sc,ic,fe,{client:0})}}var qo=Object.prototype.hasOwnProperty;function Qo(t,e,n){for(n of t.keys())if(ur(n,e))return n}function ur(t,e){var n,r,i;if(t===e)return!0;if(t&&e&&(n=t.constructor)===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===RegExp)return t.toString()===e.toString();if(n===Array){if((r=t.length)===e.length)for(;r--&&ur(t[r],e[r]););return r===-1}if(n===Set){if(t.size!==e.size)return!1;for(r of t)if(i=r,i&&typeof i=="object"&&(i=Qo(e,i),!i)||!e.has(i))return!1;return!0}if(n===Map){if(t.size!==e.size)return!1;for(r of t)if(i=r[0],i&&typeof i=="object"&&(i=Qo(e,i),!i)||!ur(r[1],e.get(i)))return!1;return!0}if(n===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(n===DataView){if((r=t.byteLength)===e.byteLength)for(;r--&&t.getInt8(r)===e.getInt8(r););return r===-1}if(ArrayBuffer.isView(t)){if((r=t.byteLength)===e.byteLength)for(;r--&&t[r]===e[r];);return r===-1}if(!n||typeof t=="object"){r=0;for(n in t)if(qo.call(t,n)&&++r&&!qo.call(e,n)||!(n in e)||!ur(t[n],e[n]))return!1;return Object.keys(e).length===r}}return t!==t&&e!==e}function z0(t,e,n,r=!0){const i=e-n;return i<=0?r?t[t.length-1]:t[0]:t[i]}function G0(t,e,n,r=!0){const i=e+n;return i>t.length-1?r?t[0]:t[t.length-1]:t[i]}function Y0(t,e,n=!0){return e===t.length-1?n?t[0]:t[e]:t[e+1]}function Z0(t,e,n=!0){return e<=0?n?t[t.length-1]:t[0]:t[e-1]}function lc(t){return t[t.length-1]}function uc(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function X0(t,e,n=ur){const r=e.findIndex(i=>n(i,t));return r!==-1?e.splice(r,1):e.push(t),e}function Ft(t){return Object.keys(t).reduce((e,n)=>t[n]===void 0?e:e+`${n}:${t[n]};`,"")}function Gr(t){return t?!0:void 0}Ft({position:"absolute",opacity:0,"pointer-events":"none",margin:0,transform:"translateX(-100%)"});function is(t){if(t!==null)return""}function zo(t){function e(n){return n(t),()=>{}}return{subscribe:e}}function J0(t){if(!mt)return null;const e=document.querySelector(`[data-melt-id="${t}"]`);return J(e)?e:null}const $i=t=>new Proxy(t,{get(e,n,r){return Reflect.get(e,n,r)},ownKeys(e){return Reflect.ownKeys(e).filter(n=>n!=="action")}}),Go=t=>typeof t=="function";Pe("empty");function Pe(t,e){const{stores:n,action:r,returned:i}=e??{},s=(()=>{if(n&&i)return ze(n,u=>{const l=i(u);if(Go(l)){const a=(...f)=>$i({...l(...f),[`data-melt-${t}`]:"",action:r??Qe});return a.action=r??Qe,a}return $i({...l,[`data-melt-${t}`]:"",action:r??Qe})});{const u=i,l=u==null?void 0:u();if(Go(l)){const a=(...f)=>$i({...l(...f),[`data-melt-${t}`]:"",action:r??Qe});return a.action=r??Qe,zo(a)}return zo($i({...l,[`data-melt-${t}`]:"",action:r??Qe}))}})(),o=r??(()=>{});return o.subscribe=s.subscribe,o}function Zn(t){const e=s=>s?`${t}-${s}`:t,n=s=>`data-melt-${t}${s?`-${s}`:""}`,r=s=>`[data-melt-${t}${s?`-${s}`:""}]`;return{name:e,attribute:n,selector:r,getEl:s=>document.querySelector(r(s))}}const mt=typeof document<"u",Oa=t=>typeof t=="function";function mi(t){return t instanceof Element}function J(t){return t instanceof HTMLElement}function x0(t){return t instanceof HTMLInputElement}function ey(t){return t instanceof HTMLLabelElement}function ty(t){return t instanceof HTMLButtonElement}function on(t){const e=t.getAttribute("aria-disabled"),n=t.getAttribute("disabled"),r=t.hasAttribute("data-disabled");return!!(e==="true"||n!==null||r)}function ny(t){return J(t)?t.isContentEditable:!1}function ac(t){return t!==null&&typeof t=="object"}function Aa(t){return ac(t)&&"subscribe"in t}function rt(...t){return(...e)=>{for(const n of t)typeof n=="function"&&n(...e)}}function Qe(){}function _t(t,e,n,r){const i=Array.isArray(e)?e:[e];return i.forEach(s=>t.addEventListener(s,n,r)),()=>{i.forEach(s=>t.removeEventListener(s,n,r))}}function ke(t,e,n,r){const i=Array.isArray(e)?e:[e];if(typeof n=="function"){const s=cc(o=>n(o));return i.forEach(o=>t.addEventListener(o,s,r)),()=>{i.forEach(o=>t.removeEventListener(o,s,r))}}return()=>void 0}function fc(t){const e=t.currentTarget;if(!J(e))return null;const n=new CustomEvent(`m-${t.type}`,{detail:{originalEvent:t},cancelable:!0});return e.dispatchEvent(n),n}function cc(t){return e=>{const n=fc(e);if(!(n!=null&&n.defaultPrevented))return t(e)}}function Gs(t){t.setAttribute("data-highlighted","")}function gn(t){t.removeAttribute("data-highlighted")}const Jr=t=>{try{ns(t)}catch{return t}},Ta=t=>{try{rs(t)}catch{return t}};function Rr(t,...e){const n={};for(const r of Object.keys(t))e.includes(r)||(n[r]=t[r]);return n}function ry(t,e,n){return Object.fromEntries(Object.entries(t).filter(([r,i])=>!ur(i,e)))}function dc(t){const e={};for(const n in t){const r=t[n];r!==void 0&&(e[n]=r)}return e}function Xe(t){return{...t,get:()=>$r(t)}}Xe.writable=function(t){const e=Fe(t);let n=t;return{subscribe:e.subscribe,set(r){e.set(r),n=r},update(r){const i=r(n);e.set(i),n=i},get(){return n}}};Xe.derived=function(t,e){const n=new Map,r=()=>{const s=Array.isArray(t)?t.map(o=>o.get()):t.get();return e(s)};return{get:r,subscribe:s=>{const o=[];return(Array.isArray(t)?t:[t]).forEach(l=>{o.push(l.subscribe(()=>{s(r())}))}),s(r()),n.set(s,o),()=>{const l=n.get(s);if(l)for(const a of l)a();n.delete(s)}}}};const ar=(t,e)=>{const n=Xe(t),r=(s,o)=>{n.update(u=>{const l=s(u);let a=l;return e&&(a=e({curr:u,next:l})),o==null||o(a),a})};return{...n,update:r,set:s=>{r(()=>s)}}};function fn(t){return new Promise(e=>setTimeout(e,t))}let mc="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",$a=(t=21)=>{let e="",n=t|0;for(;n--;)e+=mc[Math.random()*64|0];return e};function pc(){return $a(10)}function xr(t){return t.reduce((e,n)=>(e[n]=pc(),e),{})}const ae={ALT:"Alt",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",ARROW_UP:"ArrowUp",BACKSPACE:"Backspace",CAPS_LOCK:"CapsLock",CONTROL:"Control",DELETE:"Delete",END:"End",ENTER:"Enter",ESCAPE:"Escape",F1:"F1",F10:"F10",F11:"F11",F12:"F12",F2:"F2",F3:"F3",F4:"F4",F5:"F5",F6:"F6",F7:"F7",F8:"F8",F9:"F9",HOME:"Home",META:"Meta",PAGE_DOWN:"PageDown",PAGE_UP:"PageUp",SHIFT:"Shift",SPACE:" ",TAB:"Tab",CTRL:"Control",ASTERISK:"*",A:"a",P:"p"},hc=[ae.ARROW_DOWN,ae.PAGE_UP,ae.HOME],_c=[ae.ARROW_UP,ae.PAGE_DOWN,ae.END],Ys=[...hc,..._c],ei=[ae.ENTER,ae.SPACE],gc=(t="ltr",e="horizontal")=>({horizontal:t==="rtl"?ae.ARROW_LEFT:ae.ARROW_RIGHT,vertical:ae.ARROW_DOWN})[e],bc=(t="ltr",e="horizontal")=>({horizontal:t==="rtl"?ae.ARROW_RIGHT:ae.ARROW_LEFT,vertical:ae.ARROW_UP})[e],iy=(t="ltr",e="horizontal")=>({nextKey:gc(t,e),prevKey:bc(t,e)});function yc(t,e=500){let n=null;return function(...r){const i=()=>{n=null,t(...r)};n&&clearTimeout(n),n=setTimeout(i,e)}}const Sa=()=>typeof window<"u";function vc(){const t=navigator.userAgentData;return(t==null?void 0:t.platform)??navigator.platform}const Ra=t=>Sa()&&t.test(vc().toLowerCase()),kc=()=>Sa()&&!!navigator.maxTouchPoints,Cc=()=>Ra(/^mac/)&&!kc(),Ec=()=>Ra(/mac|iphone|ipad|ipod/i),wc=()=>Ec()&&!Cc(),ks="data-melt-scroll-lock";function Yo(t,e){if(!t)return;const n=t.style.cssText;return Object.assign(t.style,e),()=>{t.style.cssText=n}}function Oc(t,e,n){if(!t)return;const r=t.style.getPropertyValue(e);return t.style.setProperty(e,n),()=>{r?t.style.setProperty(e,r):t.style.removeProperty(e)}}function Ac(t){const e=t.getBoundingClientRect().left;return Math.round(e)+t.scrollLeft?"paddingLeft":"paddingRight"}function _o(t){const e=document,n=e.defaultView??window,{documentElement:r,body:i}=e;if(i.hasAttribute(ks))return Qe;i.setAttribute(ks,"");const o=n.innerWidth-r.clientWidth,u=()=>Oc(r,"--scrollbar-width",`${o}px`),l=Ac(r),a=n.getComputedStyle(i)[l],f=()=>Yo(i,{overflow:"hidden",[l]:`calc(${a} + ${o}px)`}),c=()=>{const{scrollX:p,scrollY:d,visualViewport:_}=n,v=(_==null?void 0:_.offsetLeft)??0,g=(_==null?void 0:_.offsetTop)??0,h=Yo(i,{position:"fixed",overflow:"hidden",top:`${-(d-Math.floor(g))}px`,left:`${-(p-Math.floor(v))}px`,right:"0",[l]:`calc(${a} + ${o}px)`});return()=>{h==null||h(),n.scrollTo(p,d)}},m=[u(),wc()?c():f()];return()=>{m.forEach(p=>p==null?void 0:p()),i.removeAttribute(ks)}}function Qi(t){const{open:e,forceVisible:n,activeTrigger:r}=t;return ze([e,n,r],([i,s,o])=>(i||s)&&o!==null)}function xe(t,e){let n;const r=ze(t,s=>{n==null||n(),n=e(s)}).subscribe(Qe),i=()=>{r(),n==null||n()};return Ta(i),i}function Lt(t){const e={};return Object.keys(t).forEach(n=>{const r=n,i=t[r];e[r]=Xe(Fe(i))}),e}function et(t){mt&&fn(1).then(()=>{const e=document.activeElement;!J(e)||e===t||(e.tabIndex=-1,t&&(t.tabIndex=0,t.focus()))})}function Da(){return Array.from(document.querySelectorAll('a[href]:not([tabindex="-1"]), button:not([disabled]):not([tabindex="-1"]), input:not([disabled]):not([tabindex="-1"]), select:not([disabled]):not([tabindex="-1"]), textarea:not([disabled]):not([tabindex="-1"]), [tabindex]:not([tabindex="-1"])'))}function Fa(t){const e=Da(),r=e.indexOf(t)+1,i=e[r];return r<e.length&&J(i)?i:null}function Pa(t){const e=Da(),r=e.indexOf(t)-1,i=e[r];return r>=0&&J(i)?i:null}const Tc=new Set(["Shift","Control","Alt","Meta","CapsLock","NumLock"]),$c={onMatch:et,getCurrentItem:()=>document.activeElement};function Sc(t={}){const e={...$c,...t},n=Xe(Fe([])),r=yc(()=>{n.update(()=>[])});return{typed:n,resetTyped:r,handleTypeaheadSearch:(s,o)=>{if(Tc.has(s))return;const u=e.getCurrentItem(),l=$r(n);if(!Array.isArray(l))return;l.push(s.toLowerCase()),n.set(l);const a=o.filter(v=>!(v.getAttribute("disabled")==="true"||v.getAttribute("aria-disabled")==="true"||v.hasAttribute("data-disabled"))),c=l.length>1&&l.every(v=>v===l[0])?l[0]:l.join(""),m=J(u)?a.indexOf(u):-1;let p=uc(a,Math.max(m,0));c.length===1&&(p=p.filter(v=>v!==u));const _=p.find(v=>(v==null?void 0:v.innerText)&&v.innerText.toLowerCase().startsWith(c.toLowerCase()));J(_)&&_!==u&&e.onMatch(_),r()}}}function Rc(t){let e=t.parentElement;for(;J(e)&&!e.hasAttribute("data-portal");)e=e.parentElement;return e||"body"}function Ar(t,e){return e!==void 0?e:Rc(t)==="body"?document.body:null}async function ti(t){const{prop:e,defaultEl:n}=t;if(await Promise.all([fn(1),Wt]),e===void 0){n==null||n.focus();return}const r=Oa(e)?e(n):e;if(typeof r=="string"){const i=document.querySelector(r);if(!J(i))return;i.focus()}else J(r)&&r.focus()}gt(void 0,t=>{function e(r){t(r),t(void 0)}return _t(document,"pointerup",e,{passive:!1,capture:!0})});const Dc=gt(void 0,t=>{function e(r){r&&r.key===ae.ESCAPE&&t(r),t(void 0)}return _t(document,"keydown",e,{passive:!1})}),ni=(t,e={})=>{let n=Qe;function r(i={}){n();const s={enabled:!0,...i},o=Aa(s.enabled)?s.enabled:gt(s.enabled);n=rt(Dc.subscribe(u=>{var a;if(!u||!$r(o))return;const l=u.target;if(!(!J(l)||l.closest("[data-escapee]")!==t)){if(u.preventDefault(),s.ignore){if(Oa(s.ignore)){if(s.ignore(u))return}else if(Array.isArray(s.ignore)&&s.ignore.length>0&&s.ignore.some(f=>f&&l===f))return}(a=s.handler)==null||a.call(s,u)}}),xe(o,u=>{u?t.dataset.escapee="":delete t.dataset.escapee}))}return r(e),{update:r,destroy(){t.removeAttribute("data-escapee"),n()}}},$n=Math.min,Dt=Math.max,zi=Math.round,Si=Math.floor,en=t=>({x:t,y:t}),Fc={left:"right",right:"left",bottom:"top",top:"bottom"},Pc={start:"end",end:"start"};function Zs(t,e,n){return Dt(t,$n(e,n))}function Dr(t,e){return typeof t=="function"?t(e):t}function Sn(t){return t.split("-")[0]}function Fr(t){return t.split("-")[1]}function La(t){return t==="x"?"y":"x"}function go(t){return t==="y"?"height":"width"}function Qn(t){return["top","bottom"].includes(Sn(t))?"y":"x"}function bo(t){return La(Qn(t))}function Lc(t,e,n){n===void 0&&(n=!1);const r=Fr(t),i=bo(t),s=go(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=Gi(o)),[o,Gi(o)]}function Ic(t){const e=Gi(t);return[Xs(t),e,Xs(e)]}function Xs(t){return t.replace(/start|end/g,e=>Pc[e])}function Mc(t,e,n){const r=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?s:o;default:return[]}}function Nc(t,e,n,r){const i=Fr(t);let s=Mc(Sn(t),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(Xs)))),s}function Gi(t){return t.replace(/left|right|bottom|top/g,e=>Fc[e])}function Hc(t){return{top:0,right:0,bottom:0,left:0,...t}}function Ia(t){return typeof t!="number"?Hc(t):{top:t,right:t,bottom:t,left:t}}function Yi(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function Zo(t,e,n){let{reference:r,floating:i}=t;const s=Qn(e),o=bo(e),u=go(o),l=Sn(e),a=s==="y",f=r.x+r.width/2-i.width/2,c=r.y+r.height/2-i.height/2,m=r[u]/2-i[u]/2;let p;switch(l){case"top":p={x:f,y:r.y-i.height};break;case"bottom":p={x:f,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:c};break;case"left":p={x:r.x-i.width,y:c};break;default:p={x:r.x,y:r.y}}switch(Fr(e)){case"start":p[o]-=m*(n&&a?-1:1);break;case"end":p[o]+=m*(n&&a?-1:1);break}return p}const Vc=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,u=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e));let a=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:c}=Zo(a,r,l),m=r,p={},d=0;for(let _=0;_<u.length;_++){const{name:v,fn:g}=u[_],{x:h,y:k,data:A,reset:$}=await g({x:f,y:c,initialPlacement:r,placement:m,strategy:i,middlewareData:p,rects:a,platform:o,elements:{reference:t,floating:e}});f=h??f,c=k??c,p={...p,[v]:{...p[v],...A}},$&&d<=50&&(d++,typeof $=="object"&&($.placement&&(m=$.placement),$.rects&&(a=$.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:i}):$.rects),{x:f,y:c}=Zo(a,m,l)),_=-1)}return{x:f,y:c,placement:m,strategy:i,middlewareData:p}};async function yo(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:s,rects:o,elements:u,strategy:l}=t,{boundary:a="clippingAncestors",rootBoundary:f="viewport",elementContext:c="floating",altBoundary:m=!1,padding:p=0}=Dr(e,t),d=Ia(p),v=u[m?c==="floating"?"reference":"floating":c],g=Yi(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(u.floating)),boundary:a,rootBoundary:f,strategy:l})),h=c==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,k=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u.floating)),A=await(s.isElement==null?void 0:s.isElement(k))?await(s.getScale==null?void 0:s.getScale(k))||{x:1,y:1}:{x:1,y:1},$=Yi(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:h,offsetParent:k,strategy:l}):h);return{top:(g.top-$.top+d.top)/A.y,bottom:($.bottom-g.bottom+d.bottom)/A.y,left:(g.left-$.left+d.left)/A.x,right:($.right-g.right+d.right)/A.x}}const Uc=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:s,platform:o,elements:u,middlewareData:l}=e,{element:a,padding:f=0}=Dr(t,e)||{};if(a==null)return{};const c=Ia(f),m={x:n,y:r},p=bo(i),d=go(p),_=await o.getDimensions(a),v=p==="y",g=v?"top":"left",h=v?"bottom":"right",k=v?"clientHeight":"clientWidth",A=s.reference[d]+s.reference[p]-m[p]-s.floating[d],$=m[p]-s.reference[p],C=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a));let F=C?C[k]:0;(!F||!await(o.isElement==null?void 0:o.isElement(C)))&&(F=u.floating[k]||s.floating[d]);const R=A/2-$/2,K=F/2-_[d]/2-1,M=$n(c[g],K),D=$n(c[h],K),I=M,O=F-_[d]-D,L=F/2-_[d]/2+R,W=Zs(I,L,O),q=!l.arrow&&Fr(i)!=null&&L!==W&&s.reference[d]/2-(L<I?M:D)-_[d]/2<0,oe=q?L<I?L-I:L-O:0;return{[p]:m[p]+oe,data:{[p]:W,centerOffset:L-W-oe,...q&&{alignmentOffset:oe}},reset:q}}}),Bc=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:u,platform:l,elements:a}=e,{mainAxis:f=!0,crossAxis:c=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:d="none",flipAlignment:_=!0,...v}=Dr(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const g=Sn(i),h=Qn(u),k=Sn(u)===u,A=await(l.isRTL==null?void 0:l.isRTL(a.floating)),$=m||(k||!_?[Gi(u)]:Ic(u)),C=d!=="none";!m&&C&&$.push(...Nc(u,_,d,A));const F=[u,...$],R=await yo(e,v),K=[];let M=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&K.push(R[g]),c){const L=Lc(i,o,A);K.push(R[L[0]],R[L[1]])}if(M=[...M,{placement:i,overflows:K}],!K.every(L=>L<=0)){var D,I;const L=(((D=s.flip)==null?void 0:D.index)||0)+1,W=F[L];if(W)return{data:{index:L,overflows:M},reset:{placement:W}};let q=(I=M.filter(oe=>oe.overflows[0]<=0).sort((oe,se)=>oe.overflows[1]-se.overflows[1])[0])==null?void 0:I.placement;if(!q)switch(p){case"bestFit":{var O;const oe=(O=M.filter(se=>{if(C){const z=Qn(se.placement);return z===h||z==="y"}return!0}).map(se=>[se.placement,se.overflows.filter(z=>z>0).reduce((z,le)=>z+le,0)]).sort((se,z)=>se[1]-z[1])[0])==null?void 0:O[0];oe&&(q=oe);break}case"initialPlacement":q=u;break}if(i!==q)return{reset:{placement:q}}}return{}}}};async function Kc(t,e){const{placement:n,platform:r,elements:i}=t,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Sn(n),u=Fr(n),l=Qn(n)==="y",a=["left","top"].includes(o)?-1:1,f=s&&l?-1:1,c=Dr(e,t);let{mainAxis:m,crossAxis:p,alignmentAxis:d}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:c.mainAxis||0,crossAxis:c.crossAxis||0,alignmentAxis:c.alignmentAxis};return u&&typeof d=="number"&&(p=u==="end"?d*-1:d),l?{x:p*f,y:m*a}:{x:m*a,y:p*f}}const jc=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:s,placement:o,middlewareData:u}=e,l=await Kc(e,t);return o===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},Wc=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:u={fn:v=>{let{x:g,y:h}=v;return{x:g,y:h}}},...l}=Dr(t,e),a={x:n,y:r},f=await yo(e,l),c=Qn(Sn(i)),m=La(c);let p=a[m],d=a[c];if(s){const v=m==="y"?"top":"left",g=m==="y"?"bottom":"right",h=p+f[v],k=p-f[g];p=Zs(h,p,k)}if(o){const v=c==="y"?"top":"left",g=c==="y"?"bottom":"right",h=d+f[v],k=d-f[g];d=Zs(h,d,k)}const _=u.fn({...e,[m]:p,[c]:d});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[m]:s,[c]:o}}}}}},qc=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:s,platform:o,elements:u}=e,{apply:l=()=>{},...a}=Dr(t,e),f=await yo(e,a),c=Sn(i),m=Fr(i),p=Qn(i)==="y",{width:d,height:_}=s.floating;let v,g;c==="top"||c==="bottom"?(v=c,g=m===(await(o.isRTL==null?void 0:o.isRTL(u.floating))?"start":"end")?"left":"right"):(g=c,v=m==="end"?"top":"bottom");const h=_-f.top-f.bottom,k=d-f.left-f.right,A=$n(_-f[v],h),$=$n(d-f[g],k),C=!e.middlewareData.shift;let F=A,R=$;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(R=k),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(F=h),C&&!m){const M=Dt(f.left,0),D=Dt(f.right,0),I=Dt(f.top,0),O=Dt(f.bottom,0);p?R=d-2*(M!==0||D!==0?M+D:Dt(f.left,f.right)):F=_-2*(I!==0||O!==0?I+O:Dt(f.top,f.bottom))}await l({...e,availableWidth:R,availableHeight:F});const K=await o.getDimensions(u.floating);return d!==K.width||_!==K.height?{reset:{rects:!0}}:{}}}};function ss(){return typeof window<"u"}function Pr(t){return Ma(t)?(t.nodeName||"").toLowerCase():"#document"}function It(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function rn(t){var e;return(e=(Ma(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Ma(t){return ss()?t instanceof Node||t instanceof It(t).Node:!1}function qt(t){return ss()?t instanceof Element||t instanceof It(t).Element:!1}function nn(t){return ss()?t instanceof HTMLElement||t instanceof It(t).HTMLElement:!1}function Xo(t){return!ss()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof It(t).ShadowRoot}function pi(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=Qt(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function Qc(t){return["table","td","th"].includes(Pr(t))}function os(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function vo(t){const e=ko(),n=qt(t)?Qt(t):t;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function zc(t){let e=Rn(t);for(;nn(e)&&!Tr(e);){if(vo(e))return e;if(os(e))return null;e=Rn(e)}return null}function ko(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Tr(t){return["html","body","#document"].includes(Pr(t))}function Qt(t){return It(t).getComputedStyle(t)}function ls(t){return qt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Rn(t){if(Pr(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Xo(t)&&t.host||rn(t);return Xo(e)?e.host:e}function Na(t){const e=Rn(t);return Tr(e)?t.ownerDocument?t.ownerDocument.body:t.body:nn(e)&&pi(e)?e:Na(e)}function ri(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Na(t),s=i===((r=t.ownerDocument)==null?void 0:r.body),o=It(i);if(s){const u=Js(o);return e.concat(o,o.visualViewport||[],pi(i)?i:[],u&&n?ri(u):[])}return e.concat(i,ri(i,[],n))}function Js(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Ha(t){const e=Qt(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=nn(t),s=i?t.offsetWidth:n,o=i?t.offsetHeight:r,u=zi(n)!==s||zi(r)!==o;return u&&(n=s,r=o),{width:n,height:r,$:u}}function Co(t){return qt(t)?t:t.contextElement}function fr(t){const e=Co(t);if(!nn(e))return en(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:s}=Ha(e);let o=(s?zi(n.width):n.width)/r,u=(s?zi(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!u||!Number.isFinite(u))&&(u=1),{x:o,y:u}}const Gc=en(0);function Va(t){const e=It(t);return!ko()||!e.visualViewport?Gc:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Yc(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==It(t)?!1:e}function zn(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=Co(t);let o=en(1);e&&(r?qt(r)&&(o=fr(r)):o=fr(t));const u=Yc(s,n,r)?Va(s):en(0);let l=(i.left+u.x)/o.x,a=(i.top+u.y)/o.y,f=i.width/o.x,c=i.height/o.y;if(s){const m=It(s),p=r&&qt(r)?It(r):r;let d=m,_=Js(d);for(;_&&r&&p!==d;){const v=fr(_),g=_.getBoundingClientRect(),h=Qt(_),k=g.left+(_.clientLeft+parseFloat(h.paddingLeft))*v.x,A=g.top+(_.clientTop+parseFloat(h.paddingTop))*v.y;l*=v.x,a*=v.y,f*=v.x,c*=v.y,l+=k,a+=A,d=It(_),_=Js(d)}}return Yi({width:f,height:c,x:l,y:a})}function Eo(t,e){const n=ls(t).scrollLeft;return e?e.left+n:zn(rn(t)).left+n}function Ua(t,e,n){n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=r.left+e.scrollLeft-(n?0:Eo(t,r)),s=r.top+e.scrollTop;return{x:i,y:s}}function Zc(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const s=i==="fixed",o=rn(r),u=e?os(e.floating):!1;if(r===o||u&&s)return n;let l={scrollLeft:0,scrollTop:0},a=en(1);const f=en(0),c=nn(r);if((c||!c&&!s)&&((Pr(r)!=="body"||pi(o))&&(l=ls(r)),nn(r))){const p=zn(r);a=fr(r),f.x=p.x+r.clientLeft,f.y=p.y+r.clientTop}const m=o&&!c&&!s?Ua(o,l,!0):en(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-l.scrollLeft*a.x+f.x+m.x,y:n.y*a.y-l.scrollTop*a.y+f.y+m.y}}function Xc(t){return Array.from(t.getClientRects())}function Jc(t){const e=rn(t),n=ls(t),r=t.ownerDocument.body,i=Dt(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=Dt(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Eo(t);const u=-n.scrollTop;return Qt(r).direction==="rtl"&&(o+=Dt(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:u}}function xc(t,e){const n=It(t),r=rn(t),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,u=0,l=0;if(i){s=i.width,o=i.height;const a=ko();(!a||a&&e==="fixed")&&(u=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:u,y:l}}function ed(t,e){const n=zn(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,s=nn(t)?fr(t):en(1),o=t.clientWidth*s.x,u=t.clientHeight*s.y,l=i*s.x,a=r*s.y;return{width:o,height:u,x:l,y:a}}function Jo(t,e,n){let r;if(e==="viewport")r=xc(t,n);else if(e==="document")r=Jc(rn(t));else if(qt(e))r=ed(e,n);else{const i=Va(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Yi(r)}function Ba(t,e){const n=Rn(t);return n===e||!qt(n)||Tr(n)?!1:Qt(n).position==="fixed"||Ba(n,e)}function td(t,e){const n=e.get(t);if(n)return n;let r=ri(t,[],!1).filter(u=>qt(u)&&Pr(u)!=="body"),i=null;const s=Qt(t).position==="fixed";let o=s?Rn(t):t;for(;qt(o)&&!Tr(o);){const u=Qt(o),l=vo(o);!l&&u.position==="fixed"&&(i=null),(s?!l&&!i:!l&&u.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||pi(o)&&!l&&Ba(t,o))?r=r.filter(f=>f!==o):i=u,o=Rn(o)}return e.set(t,r),r}function nd(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const o=[...n==="clippingAncestors"?os(e)?[]:td(e,this._c):[].concat(n),r],u=o[0],l=o.reduce((a,f)=>{const c=Jo(e,f,i);return a.top=Dt(c.top,a.top),a.right=$n(c.right,a.right),a.bottom=$n(c.bottom,a.bottom),a.left=Dt(c.left,a.left),a},Jo(e,u,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function rd(t){const{width:e,height:n}=Ha(t);return{width:e,height:n}}function id(t,e,n){const r=nn(e),i=rn(e),s=n==="fixed",o=zn(t,!0,s,e);let u={scrollLeft:0,scrollTop:0};const l=en(0);if(r||!r&&!s)if((Pr(e)!=="body"||pi(i))&&(u=ls(e)),r){const m=zn(e,!0,s,e);l.x=m.x+e.clientLeft,l.y=m.y+e.clientTop}else i&&(l.x=Eo(i));const a=i&&!r&&!s?Ua(i,u):en(0),f=o.left+u.scrollLeft-l.x-a.x,c=o.top+u.scrollTop-l.y-a.y;return{x:f,y:c,width:o.width,height:o.height}}function Cs(t){return Qt(t).position==="static"}function xo(t,e){if(!nn(t)||Qt(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return rn(t)===n&&(n=n.ownerDocument.body),n}function Ka(t,e){const n=It(t);if(os(t))return n;if(!nn(t)){let i=Rn(t);for(;i&&!Tr(i);){if(qt(i)&&!Cs(i))return i;i=Rn(i)}return n}let r=xo(t,e);for(;r&&Qc(r)&&Cs(r);)r=xo(r,e);return r&&Tr(r)&&Cs(r)&&!vo(r)?n:r||zc(t)||n}const sd=async function(t){const e=this.getOffsetParent||Ka,n=this.getDimensions,r=await n(t.floating);return{reference:id(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function od(t){return Qt(t).direction==="rtl"}const ld={convertOffsetParentRelativeRectToViewportRelativeRect:Zc,getDocumentElement:rn,getClippingRect:nd,getOffsetParent:Ka,getElementRects:sd,getClientRects:Xc,getDimensions:rd,getScale:fr,isElement:qt,isRTL:od};function ud(t,e){let n=null,r;const i=rn(t);function s(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function o(u,l){u===void 0&&(u=!1),l===void 0&&(l=1),s();const{left:a,top:f,width:c,height:m}=t.getBoundingClientRect();if(u||e(),!c||!m)return;const p=Si(f),d=Si(i.clientWidth-(a+c)),_=Si(i.clientHeight-(f+m)),v=Si(a),h={rootMargin:-p+"px "+-d+"px "+-_+"px "+-v+"px",threshold:Dt(0,$n(1,l))||1};let k=!0;function A($){const C=$[0].intersectionRatio;if(C!==l){if(!k)return o();C?o(!1,C):r=setTimeout(()=>{o(!1,1e-7)},1e3)}k=!1}try{n=new IntersectionObserver(A,{...h,root:i.ownerDocument})}catch{n=new IntersectionObserver(A,h)}n.observe(t)}return o(!0),s}function ad(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,a=Co(t),f=i||s?[...a?ri(a):[],...ri(e)]:[];f.forEach(g=>{i&&g.addEventListener("scroll",n,{passive:!0}),s&&g.addEventListener("resize",n)});const c=a&&u?ud(a,n):null;let m=-1,p=null;o&&(p=new ResizeObserver(g=>{let[h]=g;h&&h.target===a&&p&&(p.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var k;(k=p)==null||k.observe(e)})),n()}),a&&!l&&p.observe(a),p.observe(e));let d,_=l?zn(t):null;l&&v();function v(){const g=zn(t);_&&(g.x!==_.x||g.y!==_.y||g.width!==_.width||g.height!==_.height)&&n(),_=g,d=requestAnimationFrame(v)}return n(),()=>{var g;f.forEach(h=>{i&&h.removeEventListener("scroll",n),s&&h.removeEventListener("resize",n)}),c==null||c(),(g=p)==null||g.disconnect(),p=null,l&&cancelAnimationFrame(d)}}const fd=jc,cd=Wc,dd=Bc,md=qc,pd=Uc,hd=(t,e,n)=>{const r=new Map,i={platform:ld,...n},s={...i.platform,_c:r};return Vc(t,e,{...i,platform:s})},_d={strategy:"absolute",placement:"top",gutter:5,flip:!0,sameWidth:!1,overflowPadding:8},gd={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};function bd(t,e,n={}){if(!e||!t||n===null)return{destroy:Qe};const r={..._d,...n},i=e.querySelector("[data-arrow=true]"),s=[];r.flip&&s.push(dd({boundary:r.boundary,padding:r.overflowPadding}));const o=J(i)?i.offsetHeight/2:0;if(r.gutter||r.offset){const l=r.gutter?{mainAxis:r.gutter}:r.offset;(l==null?void 0:l.mainAxis)!=null&&(l.mainAxis+=o),s.push(fd(l))}s.push(cd({boundary:r.boundary,crossAxis:r.overlap,padding:r.overflowPadding})),i&&s.push(pd({element:i,padding:8})),s.push(md({padding:r.overflowPadding,apply({rects:l,availableHeight:a,availableWidth:f}){r.sameWidth&&Object.assign(e.style,{width:`${Math.round(l.reference.width)}px`,minWidth:"unset"}),r.fitViewport&&Object.assign(e.style,{maxWidth:`${f}px`,maxHeight:`${a}px`})}}));function u(){if(!t||!e||J(t)&&!t.ownerDocument.documentElement.contains(t))return;const{placement:l,strategy:a}=r;hd(t,e,{placement:l,middleware:s,strategy:a}).then(f=>{const c=Math.round(f.x),m=Math.round(f.y),[p,d]=yd(f.placement);if(e.setAttribute("data-side",p),e.setAttribute("data-align",d),Object.assign(e.style,{position:r.strategy,top:`${m}px`,left:`${c}px`}),J(i)&&f.middlewareData.arrow){const{x:_,y:v}=f.middlewareData.arrow,g=f.placement.split("-")[0];i.setAttribute("data-side",g),Object.assign(i.style,{position:"absolute",left:_!=null?`${_}px`:"",top:v!=null?`${v}px`:"",[g]:`calc(100% - ${o}px)`,transform:gd[g],backgroundColor:"inherit",zIndex:"inherit"})}return f})}return Object.assign(e.style,{position:r.strategy}),{destroy:ad(t,e,u)}}function yd(t){const[e,n="center"]=t.split("-");return[e,n]}/*!
6
- * tabbable 6.2.0
7
- * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
8
- */var ja=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Zi=ja.join(","),Wa=typeof Element>"u",Gn=Wa?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Xi=!Wa&&Element.prototype.getRootNode?function(t){var e;return t==null||(e=t.getRootNode)===null||e===void 0?void 0:e.call(t)}:function(t){return t==null?void 0:t.ownerDocument},Ji=function t(e,n){var r;n===void 0&&(n=!0);var i=e==null||(r=e.getAttribute)===null||r===void 0?void 0:r.call(e,"inert"),s=i===""||i==="true",o=s||n&&e&&t(e.parentNode);return o},vd=function(e){var n,r=e==null||(n=e.getAttribute)===null||n===void 0?void 0:n.call(e,"contenteditable");return r===""||r==="true"},qa=function(e,n,r){if(Ji(e))return[];var i=Array.prototype.slice.apply(e.querySelectorAll(Zi));return n&&Gn.call(e,Zi)&&i.unshift(e),i=i.filter(r),i},Qa=function t(e,n,r){for(var i=[],s=Array.from(e);s.length;){var o=s.shift();if(!Ji(o,!1))if(o.tagName==="SLOT"){var u=o.assignedElements(),l=u.length?u:o.children,a=t(l,!0,r);r.flatten?i.push.apply(i,a):i.push({scopeParent:o,candidates:a})}else{var f=Gn.call(o,Zi);f&&r.filter(o)&&(n||!e.includes(o))&&i.push(o);var c=o.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(o),m=!Ji(c,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(c&&m){var p=t(c===!0?o.children:c.children,!0,r);r.flatten?i.push.apply(i,p):i.push({scopeParent:o,candidates:p})}else s.unshift.apply(s,o.children)}}return i},za=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Mn=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||vd(e))&&!za(e)?0:e.tabIndex},kd=function(e,n){var r=Mn(e);return r<0&&n&&!za(e)?0:r},Cd=function(e,n){return e.tabIndex===n.tabIndex?e.documentOrder-n.documentOrder:e.tabIndex-n.tabIndex},Ga=function(e){return e.tagName==="INPUT"},Ed=function(e){return Ga(e)&&e.type==="hidden"},wd=function(e){var n=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return n},Od=function(e,n){for(var r=0;r<e.length;r++)if(e[r].checked&&e[r].form===n)return e[r]},Ad=function(e){if(!e.name)return!0;var n=e.form||Xi(e),r=function(u){return n.querySelectorAll('input[type="radio"][name="'+u+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=r(window.CSS.escape(e.name));else try{i=r(e.name)}catch(o){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",o.message),!1}var s=Od(i,e.form);return!s||s===e},Td=function(e){return Ga(e)&&e.type==="radio"},$d=function(e){return Td(e)&&!Ad(e)},Sd=function(e){var n,r=e&&Xi(e),i=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==e){var o,u,l;for(s=!!((o=i)!==null&&o!==void 0&&(u=o.ownerDocument)!==null&&u!==void 0&&u.contains(i)||e!=null&&(l=e.ownerDocument)!==null&&l!==void 0&&l.contains(e));!s&&i;){var a,f,c;r=Xi(i),i=(a=r)===null||a===void 0?void 0:a.host,s=!!((f=i)!==null&&f!==void 0&&(c=f.ownerDocument)!==null&&c!==void 0&&c.contains(i))}}return s},el=function(e){var n=e.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},Rd=function(e,n){var r=n.displayCheck,i=n.getShadowRoot;if(getComputedStyle(e).visibility==="hidden")return!0;var s=Gn.call(e,"details>summary:first-of-type"),o=s?e.parentElement:e;if(Gn.call(o,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof i=="function"){for(var u=e;e;){var l=e.parentElement,a=Xi(e);if(l&&!l.shadowRoot&&i(l)===!0)return el(e);e.assignedSlot?e=e.assignedSlot:!l&&a!==e.ownerDocument?e=a.host:e=l}e=u}if(Sd(e))return!e.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return el(e);return!1},Dd=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var n=e.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var i=n.children.item(r);if(i.tagName==="LEGEND")return Gn.call(n,"fieldset[disabled] *")?!0:!i.contains(e)}return!0}n=n.parentElement}return!1},xi=function(e,n){return!(n.disabled||Ji(n)||Ed(n)||Rd(n,e)||wd(n)||Dd(n))},xs=function(e,n){return!($d(n)||Mn(n)<0||!xi(e,n))},Fd=function(e){var n=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Pd=function t(e){var n=[],r=[];return e.forEach(function(i,s){var o=!!i.scopeParent,u=o?i.scopeParent:i,l=kd(u,o),a=o?t(i.candidates):u;l===0?o?n.push.apply(n,a):n.push(u):r.push({documentOrder:s,tabIndex:l,item:i,isScope:o,content:a})}),r.sort(Cd).reduce(function(i,s){return s.isScope?i.push.apply(i,s.content):i.push(s.content),i},[]).concat(n)},Ld=function(e,n){n=n||{};var r;return n.getShadowRoot?r=Qa([e],n.includeContainer,{filter:xs.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Fd}):r=qa(e,n.includeContainer,xs.bind(null,n)),Pd(r)},Id=function(e,n){n=n||{};var r;return n.getShadowRoot?r=Qa([e],n.includeContainer,{filter:xi.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=qa(e,n.includeContainer,xi.bind(null,n)),r},tr=function(e,n){if(n=n||{},!e)throw new Error("No node provided");return Gn.call(e,Zi)===!1?!1:xs(n,e)},Md=ja.concat("iframe").join(","),Es=function(e,n){if(n=n||{},!e)throw new Error("No node provided");return Gn.call(e,Md)===!1?!1:xi(n,e)};/*!
9
- * focus-trap 7.6.2
10
- * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
11
- */function eo(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Nd(t){if(Array.isArray(t))return eo(t)}function Hd(t,e,n){return(e=jd(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Vd(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Ud(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
12
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function nl(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?tl(Object(n),!0).forEach(function(r){Hd(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):tl(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Bd(t){return Nd(t)||Vd(t)||Wd(t)||Ud()}function Kd(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function jd(t){var e=Kd(t,"string");return typeof e=="symbol"?e:e+""}function Wd(t,e){if(t){if(typeof t=="string")return eo(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?eo(t,e):void 0}}var rl={activateTrap:function(e,n){if(e.length>0){var r=e[e.length-1];r!==n&&r.pause()}var i=e.indexOf(n);i===-1||e.splice(i,1),e.push(n)},deactivateTrap:function(e,n){var r=e.indexOf(n);r!==-1&&e.splice(r,1),e.length>0&&e[e.length-1].unpause()}},qd=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},Qd=function(e){return(e==null?void 0:e.key)==="Escape"||(e==null?void 0:e.key)==="Esc"||(e==null?void 0:e.keyCode)===27},Yr=function(e){return(e==null?void 0:e.key)==="Tab"||(e==null?void 0:e.keyCode)===9},zd=function(e){return Yr(e)&&!e.shiftKey},Gd=function(e){return Yr(e)&&e.shiftKey},il=function(e){return setTimeout(e,0)},Br=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return typeof e=="function"?e.apply(void 0,r):e},Ri=function(e){return e.target.shadowRoot&&typeof e.composedPath=="function"?e.composedPath()[0]:e.target},Yd=[],Zd=function(e,n){var r=(n==null?void 0:n.document)||document,i=(n==null?void 0:n.trapStack)||Yd,s=nl({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:zd,isKeyBackward:Gd},n),o={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},u,l=function(O,L,W){return O&&O[L]!==void 0?O[L]:s[W||L]},a=function(O,L){var W=typeof(L==null?void 0:L.composedPath)=="function"?L.composedPath():void 0;return o.containerGroups.findIndex(function(q){var oe=q.container,se=q.tabbableNodes;return oe.contains(O)||(W==null?void 0:W.includes(oe))||se.find(function(z){return z===O})})},f=function(O){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},W=L.hasFallback,q=W===void 0?!1:W,oe=L.params,se=oe===void 0?[]:oe,z=s[O];if(typeof z=="function"&&(z=z.apply(void 0,Bd(se))),z===!0&&(z=void 0),!z){if(z===void 0||z===!1)return z;throw new Error("`".concat(O,"` was specified but was not a node, or did not return a node"))}var le=z;if(typeof z=="string"){try{le=r.querySelector(z)}catch(Re){throw new Error("`".concat(O,'` appears to be an invalid selector; error="').concat(Re.message,'"'))}if(!le&&!q)throw new Error("`".concat(O,"` as selector refers to no known node"))}return le},c=function(){var O=f("initialFocus",{hasFallback:!0});if(O===!1)return!1;if(O===void 0||O&&!Es(O,s.tabbableOptions))if(a(r.activeElement)>=0)O=r.activeElement;else{var L=o.tabbableGroups[0],W=L&&L.firstTabbableNode;O=W||f("fallbackFocus")}else O===null&&(O=f("fallbackFocus"));if(!O)throw new Error("Your focus-trap needs to have at least one focusable element");return O},m=function(){if(o.containerGroups=o.containers.map(function(O){var L=Ld(O,s.tabbableOptions),W=Id(O,s.tabbableOptions),q=L.length>0?L[0]:void 0,oe=L.length>0?L[L.length-1]:void 0,se=W.find(function(Re){return tr(Re)}),z=W.slice().reverse().find(function(Re){return tr(Re)}),le=!!L.find(function(Re){return Mn(Re)>0});return{container:O,tabbableNodes:L,focusableNodes:W,posTabIndexesFound:le,firstTabbableNode:q,lastTabbableNode:oe,firstDomTabbableNode:se,lastDomTabbableNode:z,nextTabbableNode:function(st){var He=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,Y=L.indexOf(st);return Y<0?He?W.slice(W.indexOf(st)+1).find(function(X){return tr(X)}):W.slice(0,W.indexOf(st)).reverse().find(function(X){return tr(X)}):L[Y+(He?1:-1)]}}}),o.tabbableGroups=o.containerGroups.filter(function(O){return O.tabbableNodes.length>0}),o.tabbableGroups.length<=0&&!f("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(o.containerGroups.find(function(O){return O.posTabIndexesFound})&&o.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},p=function(O){var L=O.activeElement;if(L)return L.shadowRoot&&L.shadowRoot.activeElement!==null?p(L.shadowRoot):L},d=function(O){if(O!==!1&&O!==p(document)){if(!O||!O.focus){d(c());return}O.focus({preventScroll:!!s.preventScroll}),o.mostRecentlyFocusedNode=O,qd(O)&&O.select()}},_=function(O){var L=f("setReturnFocus",{params:[O]});return L||(L===!1?!1:O)},v=function(O){var L=O.target,W=O.event,q=O.isBackward,oe=q===void 0?!1:q;L=L||Ri(W),m();var se=null;if(o.tabbableGroups.length>0){var z=a(L,W),le=z>=0?o.containerGroups[z]:void 0;if(z<0)oe?se=o.tabbableGroups[o.tabbableGroups.length-1].lastTabbableNode:se=o.tabbableGroups[0].firstTabbableNode;else if(oe){var Re=o.tabbableGroups.findIndex(function(ht){var ct=ht.firstTabbableNode;return L===ct});if(Re<0&&(le.container===L||Es(L,s.tabbableOptions)&&!tr(L,s.tabbableOptions)&&!le.nextTabbableNode(L,!1))&&(Re=z),Re>=0){var st=Re===0?o.tabbableGroups.length-1:Re-1,He=o.tabbableGroups[st];se=Mn(L)>=0?He.lastTabbableNode:He.lastDomTabbableNode}else Yr(W)||(se=le.nextTabbableNode(L,!1))}else{var Y=o.tabbableGroups.findIndex(function(ht){var ct=ht.lastTabbableNode;return L===ct});if(Y<0&&(le.container===L||Es(L,s.tabbableOptions)&&!tr(L,s.tabbableOptions)&&!le.nextTabbableNode(L))&&(Y=z),Y>=0){var X=Y===o.tabbableGroups.length-1?0:Y+1,pt=o.tabbableGroups[X];se=Mn(L)>=0?pt.firstTabbableNode:pt.firstDomTabbableNode}else Yr(W)||(se=le.nextTabbableNode(L))}}else se=f("fallbackFocus");return se},g=function(O){var L=Ri(O);if(!(a(L,O)>=0)){if(Br(s.clickOutsideDeactivates,O)){u.deactivate({returnFocus:s.returnFocusOnDeactivate});return}Br(s.allowOutsideClick,O)||O.preventDefault()}},h=function(O){var L=Ri(O),W=a(L,O)>=0;if(W||L instanceof Document)W&&(o.mostRecentlyFocusedNode=L);else{O.stopImmediatePropagation();var q,oe=!0;if(o.mostRecentlyFocusedNode)if(Mn(o.mostRecentlyFocusedNode)>0){var se=a(o.mostRecentlyFocusedNode),z=o.containerGroups[se].tabbableNodes;if(z.length>0){var le=z.findIndex(function(Re){return Re===o.mostRecentlyFocusedNode});le>=0&&(s.isKeyForward(o.recentNavEvent)?le+1<z.length&&(q=z[le+1],oe=!1):le-1>=0&&(q=z[le-1],oe=!1))}}else o.containerGroups.some(function(Re){return Re.tabbableNodes.some(function(st){return Mn(st)>0})})||(oe=!1);else oe=!1;oe&&(q=v({target:o.mostRecentlyFocusedNode,isBackward:s.isKeyBackward(o.recentNavEvent)})),d(q||o.mostRecentlyFocusedNode||c())}o.recentNavEvent=void 0},k=function(O){var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;o.recentNavEvent=O;var W=v({event:O,isBackward:L});W&&(Yr(O)&&O.preventDefault(),d(W))},A=function(O){(s.isKeyForward(O)||s.isKeyBackward(O))&&k(O,s.isKeyBackward(O))},$=function(O){Qd(O)&&Br(s.escapeDeactivates,O)!==!1&&(O.preventDefault(),u.deactivate())},C=function(O){var L=Ri(O);a(L,O)>=0||Br(s.clickOutsideDeactivates,O)||Br(s.allowOutsideClick,O)||(O.preventDefault(),O.stopImmediatePropagation())},F=function(){if(o.active)return rl.activateTrap(i,u),o.delayInitialFocusTimer=s.delayInitialFocus?il(function(){d(c())}):d(c()),r.addEventListener("focusin",h,!0),r.addEventListener("mousedown",g,{capture:!0,passive:!1}),r.addEventListener("touchstart",g,{capture:!0,passive:!1}),r.addEventListener("click",C,{capture:!0,passive:!1}),r.addEventListener("keydown",A,{capture:!0,passive:!1}),r.addEventListener("keydown",$),u},R=function(){if(o.active)return r.removeEventListener("focusin",h,!0),r.removeEventListener("mousedown",g,!0),r.removeEventListener("touchstart",g,!0),r.removeEventListener("click",C,!0),r.removeEventListener("keydown",A,!0),r.removeEventListener("keydown",$),u},K=function(O){var L=O.some(function(W){var q=Array.from(W.removedNodes);return q.some(function(oe){return oe===o.mostRecentlyFocusedNode})});L&&d(c())},M=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(K):void 0,D=function(){M&&(M.disconnect(),o.active&&!o.paused&&o.containers.map(function(O){M.observe(O,{subtree:!0,childList:!0})}))};return u={get active(){return o.active},get paused(){return o.paused},activate:function(O){if(o.active)return this;var L=l(O,"onActivate"),W=l(O,"onPostActivate"),q=l(O,"checkCanFocusTrap");q||m(),o.active=!0,o.paused=!1,o.nodeFocusedBeforeActivation=r.activeElement,L==null||L();var oe=function(){q&&m(),F(),D(),W==null||W()};return q?(q(o.containers.concat()).then(oe,oe),this):(oe(),this)},deactivate:function(O){if(!o.active)return this;var L=nl({onDeactivate:s.onDeactivate,onPostDeactivate:s.onPostDeactivate,checkCanReturnFocus:s.checkCanReturnFocus},O);clearTimeout(o.delayInitialFocusTimer),o.delayInitialFocusTimer=void 0,R(),o.active=!1,o.paused=!1,D(),rl.deactivateTrap(i,u);var W=l(L,"onDeactivate"),q=l(L,"onPostDeactivate"),oe=l(L,"checkCanReturnFocus"),se=l(L,"returnFocus","returnFocusOnDeactivate");W==null||W();var z=function(){il(function(){se&&d(_(o.nodeFocusedBeforeActivation)),q==null||q()})};return se&&oe?(oe(_(o.nodeFocusedBeforeActivation)).then(z,z),this):(z(),this)},pause:function(O){if(o.paused||!o.active)return this;var L=l(O,"onPause"),W=l(O,"onPostPause");return o.paused=!0,L==null||L(),R(),D(),W==null||W(),this},unpause:function(O){if(!o.paused||!o.active)return this;var L=l(O,"onUnpause"),W=l(O,"onPostUnpause");return o.paused=!1,L==null||L(),m(),F(),D(),W==null||W(),this},updateContainerElements:function(O){var L=[].concat(O).filter(Boolean);return o.containers=L.map(function(W){return typeof W=="string"?r.querySelector(W):W}),o.active&&m(),D(),this}},u.updateContainerElements(e),u};function Ya(t={}){let e;const{immediate:n,...r}=t,i=Fe(!1),s=Fe(!1),o=c=>e==null?void 0:e.activate(c),u=c=>{e==null||e.deactivate(c)},l=()=>{e&&(e.pause(),s.set(!0))},a=()=>{e&&(e.unpause(),s.set(!1))};return{useFocusTrap:c=>(e=Zd(c,{...r,onActivate(){var m;i.set(!0),(m=t.onActivate)==null||m.call(t)},onDeactivate(){var m;i.set(!1),(m=t.onDeactivate)==null||m.call(t)}}),n&&o(),{destroy(){u(),e=void 0}}),hasFocus:Wo(i),isPaused:Wo(s),activate:o,deactivate:u,pause:l,unpause:a}}const Di=[],Za=(t,e)=>{let n=Qe;function r(){const s=Di.indexOf(t);s>=0&&Di.splice(s,1)}function i(s){n();const{open:o,onClose:u,shouldCloseOnInteractOutside:l,closeOnInteractOutside:a}=s;fn(100).then(()=>{o?Di.push(t):r()});function f(){return lc(Di)===t}function c(){f()&&u&&(u(),r())}function m(d){const _=d.target;mi(_)&&_&&f()&&(d.preventDefault(),d.stopPropagation(),d.stopImmediatePropagation())}function p(d){l!=null&&l(d)&&f()&&(d.preventDefault(),d.stopPropagation(),d.stopImmediatePropagation(),c())}n=Jd(t,{onInteractOutsideStart:m,onInteractOutside:a?p:void 0,enabled:o}).destroy}return i(e),{update:i,destroy(){r(),n()}}},Xd={floating:{},focusTrap:{},modal:{},escapeKeydown:{},portal:"body"},es=(t,e)=>{t.dataset.escapee="";const{anchorElement:n,open:r,options:i}=e;if(!n||!r||!i)return{destroy:Qe};const s={...Xd,...i},o=[];if(s.portal!==null&&o.push(us(t,s.portal).destroy),o.push(bd(n,t,s.floating).destroy),s.focusTrap!==null){const{useFocusTrap:l}=Ya({immediate:!0,escapeDeactivates:!1,allowOutsideClick:!0,returnFocusOnDeactivate:!1,fallbackFocus:t,...s.focusTrap});o.push(l(t).destroy)}s.modal!==null&&o.push(Za(t,{onClose:()=>{J(n)&&(r.set(!1),n.focus())},shouldCloseOnInteractOutside:l=>!(l.defaultPrevented||J(n)&&n.contains(l.target)),...s.modal}).destroy),s.escapeKeydown!==null&&o.push(ni(t,{enabled:r,handler:()=>{r.set(!1)},...s.escapeKeydown}).destroy);const u=rt(...o);return{destroy(){u()}}},us=(t,e="body")=>{let n;if(!J(e)&&typeof e!="string")return{destroy:Qe};async function r(s){if(e=s,typeof e=="string"){if(n=document.querySelector(e),n===null&&(await Wt(),n=document.querySelector(e)),n===null)throw new Error(`No element found matching css selector: "${e}"`)}else if(e instanceof HTMLElement)n=e;else throw new TypeError(`Unknown portal target type: ${e===null?"null":typeof e}. Allowed types: string (CSS selector) or HTMLElement.`);t.dataset.portal="",n.appendChild(t),t.hidden=!1}function i(){t.remove()}return r(e),{update:r,destroy:i}},Jd=(t,e)=>{let n=Qe,r=Qe,i=!1,s=!1,o=!1;function u(f){n(),r();const{onInteractOutside:c,onInteractOutsideStart:m,enabled:p}=f;if(!p)return;function d(g){c&&sl(g,t)&&(m==null||m(g));const h=g.target;mi(h)&&Xa(t,h)&&(s=!0),i=!0}function _(g){c==null||c(g)}const v=xd(t);if(typeof PointerEvent<"u"){const g=h=>{r();const k=A=>{l(A)&&_(A),a()};if(h.pointerType==="touch"){r=_t(v,"click",k,{capture:!0,once:!0});return}k(h)};n=rt(_t(v,"pointerdown",d,!0),_t(v,"pointerup",g,!0))}else{const g=k=>{o?o=!1:l(k)&&_(k),a()},h=k=>{o=!0,l(k)&&_(k),a()};n=rt(_t(v,"mousedown",d,!0),_t(v,"mouseup",g,!0),_t(v,"touchstart",d,!0),_t(v,"touchend",h,!0))}}function l(f){return!!(i&&!s&&sl(f,t))}function a(){i=!1,s=!1}return u(e),{update:u,destroy(){n(),r()}}};function sl(t,e){if("button"in t&&t.button>0)return!1;const n=t.target;if(!mi(n))return!1;const r=n.ownerDocument;return!r||!r.documentElement.contains(n)?!1:e&&!Xa(e,n)}function Xa(t,e){return t===e||t.contains(e)}function xd(t){return(t==null?void 0:t.ownerDocument)??document}function em(t){const e={};return Object.keys(t).forEach(n=>{const r=n,i=t[r];Aa(i)?e[r]=Xe(i):e[r]=Xe(gt(i))}),e}const tm={prefix:"",disabled:gt(!1),required:gt(!1),name:gt(void 0)};function sy(t){const e={...tm,...dc(t)},{name:n}=Zn(e.prefix),{value:r,name:i,disabled:s,required:o}=em(Rr(e,"prefix")),u=i;return Pe(n("hidden-input"),{stores:[r,u,s,o],returned:([a,f,c,m])=>({name:f,value:a==null?void 0:a.toString(),"aria-hidden":"true",hidden:!0,disabled:c,required:m,tabIndex:-1,style:Ft({position:"absolute",opacity:0,"pointer-events":"none",margin:0,transform:"translateX(-100%)"})}),action:a=>({destroy:r.subscribe(c=>{a.value=c,a.dispatchEvent(new Event("change",{bubbles:!0}))})})})}const nm={ltr:[...ei,ae.ARROW_RIGHT],rtl:[...ei,ae.ARROW_LEFT]},rm={ltr:[ae.ARROW_LEFT],rtl:[ae.ARROW_RIGHT]},ol=["menu","trigger"],im={arrowSize:8,positioning:{placement:"bottom"},preventScroll:!0,closeOnEscape:!0,closeOnOutsideClick:!0,portal:void 0,loop:!1,dir:"ltr",defaultOpen:!1,typeahead:!0,closeOnItemClick:!0,onOutsideClick:void 0};function sm(t){const{name:e,selector:n}=Zn(t.selector),{preventScroll:r,arrowSize:i,positioning:s,closeOnEscape:o,closeOnOutsideClick:u,portal:l,forceVisible:a,typeahead:f,loop:c,closeFocus:m,disableFocusFirstItem:p,closeOnItemClick:d,onOutsideClick:_}=t.rootOptions,v=t.rootOpen,g=t.rootActiveTrigger,h=t.nextFocusable,k=t.prevFocusable,A=Xe.writable(!1),$=Xe(Fe(0)),C=Xe(Fe(null)),F=Xe(Fe("right")),R=Xe(Fe(null)),K=Xe(ze([F,C],([Q,ee])=>te=>Q===(ee==null?void 0:ee.side)&&om(te,ee==null?void 0:ee.area))),{typed:M,handleTypeaheadSearch:D}=Sc(),I=Lt({...xr(ol),...t.ids}),O=Qi({open:v,forceVisible:a,activeTrigger:g}),L=Pe(e(),{stores:[O,l,I.menu,I.trigger],returned:([Q,ee,te,ue])=>({role:"menu",hidden:Q?void 0:!0,style:Ft({display:Q?void 0:"none"}),id:te,"aria-labelledby":ue,"data-state":Q?"open":"closed","data-portal":is(ee),tabindex:-1}),action:Q=>{let ee=Qe;const te=xe([O,g,s,u,l,o],([we,Je,vt,j,Le,We])=>{ee(),!(!we||!Je)&&Wt().then(()=>{ee(),jr(Q,n),ee=es(Q,{anchorElement:Je,open:v,options:{floating:vt,modal:{closeOnInteractOutside:j,shouldCloseOnInteractOutside:De=>{var Ie;return(Ie=_.get())==null||Ie(De),!(De.defaultPrevented||J(Je)&&Je.contains(De.target))},onClose:()=>{v.set(!1),Je.focus()},open:we},portal:Ar(Q,Le),escapeKeydown:We?void 0:null}}).destroy})}),ue=rt(ke(Q,"keydown",we=>{const Je=we.target,vt=we.currentTarget;if(!J(Je)||!J(vt)||!(Je.closest('[role="menu"]')===vt))return;if(Ys.includes(we.key)&&no(we,c.get()??!1),we.key===ae.TAB){we.preventDefault(),v.set(!1),to(we,h,k);return}const Le=we.key.length===1;!(we.ctrlKey||we.altKey||we.metaKey)&&Le&&f.get()===!0&&D(we.key,ln(vt))}));return{destroy(){te(),ue(),ee()}}}}),W=Pe(e("trigger"),{stores:[v,I.menu,I.trigger],returned:([Q,ee,te])=>({"aria-controls":ee,"aria-expanded":Q,"data-state":Q?"open":"closed",id:te,tabindex:0}),action:Q=>(Qr(Q),g.update(te=>te||Q),{destroy:rt(ke(Q,"click",te=>{const ue=v.get(),we=te.currentTarget;J(we)&&(ht(we),ue||te.preventDefault())}),ke(Q,"keydown",te=>{const ue=te.currentTarget;if(!J(ue)||!(ei.includes(te.key)||te.key===ae.ARROW_DOWN))return;te.preventDefault(),ht(ue);const we=ue.getAttribute("aria-controls");if(!we)return;const Je=document.getElementById(we);if(!Je)return;const vt=ln(Je);vt.length&&et(vt[0])}))})}),q=Pe(e("arrow"),{stores:i,returned:Q=>({"data-arrow":!0,style:Ft({position:"absolute",width:`var(--arrow-size, ${Q}px)`,height:`var(--arrow-size, ${Q}px)`})})}),oe=Pe(e("overlay"),{stores:[O],returned:([Q])=>({hidden:Q?void 0:!0,tabindex:-1,style:Ft({display:Q?void 0:"none"}),"aria-hidden":"true","data-state":am(Q)}),action:Q=>{let ee=Qe;o.get()&&(ee=ni(Q,{handler:()=>{v.set(!1);const we=g.get();we&&we.focus()}}).destroy);const te=xe([l],([ue])=>{if(ue===null)return Qe;const we=Ar(Q,ue);return we===null?Qe:us(Q,we).destroy});return{destroy(){ee(),te()}}}}),se=Pe(e("item"),{returned:()=>({role:"menuitem",tabindex:-1,"data-orientation":"vertical"}),action:Q=>(jr(Q,n),Qr(Q),{destroy:rt(ke(Q,"pointerdown",te=>{const ue=te.currentTarget;if(J(ue)&&on(ue)){te.preventDefault();return}}),ke(Q,"click",te=>{const ue=te.currentTarget;if(J(ue)){if(on(ue)){te.preventDefault();return}if(te.defaultPrevented){et(ue);return}d.get()&&fn(1).then(()=>{v.set(!1)})}}),ke(Q,"keydown",te=>{Nr(te)}),ke(Q,"pointermove",te=>{Ir(te)}),ke(Q,"pointerleave",te=>{Mr(te)}),ke(Q,"focusin",te=>{ct(te)}),ke(Q,"focusout",te=>{mn(te)}))})}),z=Pe(e("group"),{returned:()=>Q=>({role:"group","aria-labelledby":Q})}),le=Pe(e("group-label"),{returned:()=>Q=>({id:Q})}),Re={defaultChecked:!1,disabled:!1},st=Q=>{const ee={...Re,...Q},te=ee.checked??Fe(ee.defaultChecked??null),ue=ar(te,ee.onCheckedChange),we=Fe(ee.disabled),Je=Pe(e("checkbox-item"),{stores:[ue,we],returned:([Le,We])=>({role:"menuitemcheckbox",tabindex:-1,"data-orientation":"vertical","aria-checked":Hr(Le)?"mixed":Le?"true":"false","data-disabled":Gr(We),"data-state":_s(Le)}),action:Le=>(jr(Le,n),Qr(Le),{destroy:rt(ke(Le,"pointerdown",De=>{const Ie=De.currentTarget;if(J(Ie)&&on(Ie)){De.preventDefault();return}}),ke(Le,"click",De=>{const Ie=De.currentTarget;if(J(Ie)){if(on(Ie)){De.preventDefault();return}if(De.defaultPrevented){et(Ie);return}ue.update(hn=>Hr(hn)?!0:!hn),d.get()&&Wt().then(()=>{v.set(!1)})}}),ke(Le,"keydown",De=>{Nr(De)}),ke(Le,"pointermove",De=>{const Ie=De.currentTarget;if(J(Ie)){if(on(Ie)){pn(De);return}Ir(De,Ie)}}),ke(Le,"pointerleave",De=>{Mr(De)}),ke(Le,"focusin",De=>{ct(De)}),ke(Le,"focusout",De=>{mn(De)}))})}),vt=ze(ue,Le=>Le===!0),j=ze(ue,Le=>Le==="indeterminate");return{elements:{checkboxItem:Je},states:{checked:ue},helpers:{isChecked:vt,isIndeterminate:j},options:{disabled:we}}},He=(Q={})=>{const ee=Q.value??Fe(Q.defaultValue??null),te=ar(ee,Q.onValueChange),ue=Pe(e("radio-group"),{returned:()=>({role:"group"})}),we={disabled:!1},Je=Pe(e("radio-item"),{stores:[te],returned:([j])=>Le=>{const{value:We,disabled:De}={...we,...Le},Ie=j===We;return{disabled:De,role:"menuitemradio","data-state":Ie?"checked":"unchecked","aria-checked":Ie,"data-disabled":Gr(De),"data-value":We,"data-orientation":"vertical",tabindex:-1}},action:j=>(jr(j,n),{destroy:rt(ke(j,"pointerdown",We=>{const De=We.currentTarget;if(!J(De))return;const Ie=j.dataset.value;if(j.dataset.disabled||Ie===void 0){We.preventDefault();return}}),ke(j,"click",We=>{const De=We.currentTarget;if(!J(De))return;const Ie=j.dataset.value;if(j.dataset.disabled||Ie===void 0){We.preventDefault();return}if(We.defaultPrevented){if(!J(De))return;et(De);return}te.set(Ie),d.get()&&Wt().then(()=>{v.set(!1)})}),ke(j,"keydown",We=>{Nr(We)}),ke(j,"pointermove",We=>{const De=We.currentTarget;if(!J(De))return;const Ie=j.dataset.value;if(j.dataset.disabled||Ie===void 0){pn(We);return}Ir(We,De)}),ke(j,"pointerleave",We=>{Mr(We)}),ke(j,"focusin",We=>{ct(We)}),ke(j,"focusout",We=>{mn(We)}))})}),vt=ze(te,j=>Le=>j===Le);return{elements:{radioGroup:ue,radioItem:Je},states:{value:te},helpers:{isChecked:vt}}},{elements:{root:Y}}=km({orientation:"horizontal"}),X={...im,disabled:!1,positioning:{placement:"right-start",gutter:8}},pt=Q=>{const ee={...X,...Q},te=ee.open??Fe(!1),ue=ar(te,ee==null?void 0:ee.onOpenChange),we=Lt(Rr(ee,"ids")),{positioning:Je,arrowSize:vt,disabled:j}=we,Le=Xe(Fe(null)),We=Xe(Fe(null)),De=Xe(Fe(0)),Ie=Lt({...xr(ol),...ee.ids});Jr(()=>{const Be=document.getElementById(Ie.trigger.get());Be&&Le.set(Be)});const hn=Qi({open:ue,forceVisible:a,activeTrigger:Le}),mf=Pe(e("submenu"),{stores:[hn,Ie.menu,Ie.trigger],returned:([Be,dt,$t])=>({role:"menu",hidden:Be?void 0:!0,style:Ft({display:Be?void 0:"none"}),id:dt,"aria-labelledby":$t,"data-state":Be?"open":"closed","data-id":dt,tabindex:-1}),action:Be=>{let dt=Qe;const $t=xe([hn,Je],([Ee,Ze])=>{if(dt(),!Ee)return;const tt=Le.get();tt&&Wt().then(()=>{dt();const ot=Ei(tt);dt=es(Be,{anchorElement:tt,open:ue,options:{floating:Ze,portal:J(ot)?ot:void 0,modal:null,focusTrap:null,escapeKeydown:null}}).destroy})}),qe=rt(ke(Be,"keydown",Ee=>{if(Ee.key===ae.ESCAPE)return;const Ze=Ee.target,tt=Ee.currentTarget;if(!J(Ze)||!J(tt)||!(Ze.closest('[role="menu"]')===tt))return;if(Ys.includes(Ee.key)){Ee.stopImmediatePropagation(),no(Ee,c.get()??!1);return}const Xn=rm.ltr.includes(Ee.key),Jn=Ee.ctrlKey||Ee.altKey||Ee.metaKey,wi=Ee.key.length===1;if(Xn){const Do=Le.get();Ee.preventDefault(),ue.update(()=>(Do&&et(Do),!1));return}if(Ee.key===ae.TAB){Ee.preventDefault(),v.set(!1),to(Ee,h,k);return}!Jn&&wi&&f.get()===!0&&D(Ee.key,ln(tt))}),ke(Be,"pointermove",Ee=>{hs(Ee)}),ke(Be,"focusout",Ee=>{const Ze=Le.get();if(A.get()){const tt=Ee.target,ot=document.getElementById(Ie.menu.get());if(!J(ot)||!J(tt))return;!ot.contains(tt)&&tt!==Ze&&ue.set(!1)}else{const tt=Ee.currentTarget,ot=Ee.relatedTarget;if(!J(ot)||!J(tt))return;!tt.contains(ot)&&ot!==Ze&&ue.set(!1)}}));return{destroy(){$t(),dt(),qe()}}}}),pf=Pe(e("subtrigger"),{stores:[ue,j,Ie.menu,Ie.trigger],returned:([Be,dt,$t,qe])=>({role:"menuitem",id:qe,tabindex:-1,"aria-controls":$t,"aria-expanded":Be,"data-state":Be?"open":"closed","data-disabled":Gr(dt),"aria-haspopop":"menu"}),action:Be=>{jr(Be,n),Qr(Be),Le.update(qe=>qe||Be);const dt=()=>{ws(We),window.clearTimeout(De.get()),C.set(null)},$t=rt(ke(Be,"click",qe=>{if(qe.defaultPrevented)return;const Ee=qe.currentTarget;!J(Ee)||on(Ee)||(et(Ee),ue.get()||ue.update(Ze=>Ze||(Le.set(Ee),!Ze)))}),ke(Be,"keydown",qe=>{const Ee=M.get(),Ze=qe.currentTarget;if(!(!J(Ze)||on(Ze)||Ee.length>0&&qe.key===ae.SPACE)&&nm.ltr.includes(qe.key)){if(!ue.get()){Ze.click(),qe.preventDefault();return}const ot=Ze.getAttribute("aria-controls");if(!ot)return;const Xn=document.getElementById(ot);if(!J(Xn))return;const Jn=ln(Xn)[0];et(Jn)}}),ke(Be,"pointermove",qe=>{if(!Kr(qe)||(Ln(qe),qe.defaultPrevented))return;const Ee=qe.currentTarget;if(!J(Ee))return;um(Ie.menu.get())||et(Ee);const Ze=We.get();!ue.get()&&!Ze&&!on(Ee)&&We.set(window.setTimeout(()=>{ue.update(()=>(Le.set(Ee),!0)),ws(We)},100))}),ke(Be,"pointerleave",qe=>{if(!Kr(qe))return;ws(We);const Ee=document.getElementById(Ie.menu.get()),Ze=Ee==null?void 0:Ee.getBoundingClientRect();if(Ze){const tt=Ee==null?void 0:Ee.dataset.side,ot=tt==="right",Xn=ot?-5:5,Jn=Ze[ot?"left":"right"],wi=Ze[ot?"right":"left"];C.set({area:[{x:qe.clientX+Xn,y:qe.clientY},{x:Jn,y:Ze.top},{x:wi,y:Ze.top},{x:wi,y:Ze.bottom},{x:Jn,y:Ze.bottom}],side:tt}),window.clearTimeout(De.get()),De.set(window.setTimeout(()=>{C.set(null)},300))}else{if(ps(qe),qe.defaultPrevented)return;C.set(null)}}),ke(Be,"focusout",qe=>{const Ee=qe.currentTarget;if(!J(Ee))return;gn(Ee);const Ze=qe.relatedTarget;if(!J(Ze))return;const tt=Ee.getAttribute("aria-controls");if(!tt)return;const ot=document.getElementById(tt);ot&&!ot.contains(Ze)&&ue.set(!1)}),ke(Be,"focusin",qe=>{ct(qe)}));return{destroy(){dt(),$t()}}}}),hf=Pe(e("subarrow"),{stores:vt,returned:Be=>({"data-arrow":!0,style:Ft({position:"absolute",width:`var(--arrow-size, ${Be}px)`,height:`var(--arrow-size, ${Be}px)`})})});return xe([v],([Be])=>{Be||(Le.set(null),ue.set(!1))}),xe([C],([Be])=>{!mt||Be||window.clearTimeout(De.get())}),xe([ue],([Be])=>{if(mt&&(Be&&A.get()&&fn(1).then(()=>{const dt=document.getElementById(Ie.menu.get());if(!dt)return;const $t=ln(dt);$t.length&&et($t[0])}),!Be)){const dt=R.get(),$t=document.getElementById(Ie.trigger.get());if(dt&&fn(1).then(()=>{const qe=document.getElementById(Ie.menu.get());qe&&qe.contains(dt)&&gn(dt)}),!$t||document.activeElement===$t)return;gn($t)}}),{ids:Ie,elements:{subTrigger:pf,subMenu:mf,subArrow:hf},states:{subOpen:ue},options:we}};Jr(()=>{const Q=document.getElementById(I.trigger.get());J(Q)&&v.get()&&g.set(Q);const ee=[],te=()=>A.set(!1),ue=()=>{A.set(!0),ee.push(rt(_t(document,"pointerdown",te,{capture:!0,once:!0}),_t(document,"pointermove",te,{capture:!0,once:!0})))},we=Je=>{if(Je.key===ae.ESCAPE&&o.get()){v.set(!1);return}};return ee.push(_t(document,"keydown",ue,{capture:!0})),ee.push(_t(document,"keydown",we)),()=>{ee.forEach(Je=>Je())}}),xe([v,R],([Q,ee])=>{!Q&&ee&&gn(ee)}),xe([v],([Q])=>{if(mt&&!Q){const ee=g.get();if(!ee)return;const te=m.get();!Q&&ee&&ti({prop:te,defaultEl:ee})}}),xe([v,r],([Q,ee])=>{if(!mt)return;const te=[];return fn(1).then(()=>{const ue=document.getElementById(I.menu.get());if(ue&&Q&&A.get()){if(p.get()){et(ue);return}const we=ln(ue);if(!we.length)return;et(we[0])}}),()=>{te.forEach(ue=>ue())}}),xe(v,Q=>{if(!mt)return;const ee=()=>A.set(!1),te=ue=>{if(A.set(!0),ue.key===ae.ESCAPE&&Q&&o.get()){v.set(!1);return}};return rt(_t(document,"pointerdown",ee,{capture:!0,once:!0}),_t(document,"pointermove",ee,{capture:!0,once:!0}),_t(document,"keydown",te,{capture:!0}))});function ht(Q){v.update(ee=>{const te=!ee;return te&&(h.set(Fa(Q)),k.set(Pa(Q)),g.set(Q)),te})}function ct(Q){const ee=Q.currentTarget;if(!J(ee))return;const te=R.get();te&&gn(te),Gs(ee),R.set(ee)}function mn(Q){const ee=Q.currentTarget;J(ee)&&gn(ee)}function Ln(Q){Vr(Q)&&Q.preventDefault()}function pn(Q){if(Vr(Q))return;const ee=Q.target;if(!J(ee))return;const te=Ei(ee);te&&et(te)}function ps(Q){Vr(Q)&&Q.preventDefault()}function hs(Q){if(!Kr(Q))return;const ee=Q.target,te=Q.currentTarget;if(!J(te)||!J(ee))return;const ue=$.get(),we=ue!==Q.clientX;if(te.contains(ee)&&we){const Je=Q.clientX>ue?"right":"left";F.set(Je),$.set(Q.clientX)}}function Ir(Q,ee=null){if(!Kr(Q)||(Ln(Q),Q.defaultPrevented))return;if(ee){et(ee);return}const te=Q.currentTarget;J(te)&&et(te)}function Mr(Q){Kr(Q)&&pn(Q)}function Nr(Q){if(M.get().length>0&&Q.key===ae.SPACE){Q.preventDefault();return}if(ei.includes(Q.key)){Q.preventDefault();const ue=Q.currentTarget;if(!J(ue))return;ue.click()}}function Hr(Q){return Q==="indeterminate"}function _s(Q){return Hr(Q)?"indeterminate":Q?"checked":"unchecked"}function Vr(Q){return K.get()(Q)}function Ei(Q){const ee=Q.closest('[role="menu"]');return J(ee)?ee:null}return{elements:{trigger:W,menu:L,overlay:oe,item:se,group:z,groupLabel:le,arrow:q,separator:Y},builders:{createCheckboxItem:st,createSubmenu:pt,createMenuRadioGroup:He},states:{open:v},helpers:{handleTypeaheadSearch:D},ids:I,options:t.rootOptions}}function to(t,e,n){if(t.shiftKey){const r=n.get();r&&(t.preventDefault(),fn(1).then(()=>r.focus()),n.set(null))}else{const r=e.get();r&&(t.preventDefault(),fn(1).then(()=>r.focus()),e.set(null))}}function ln(t){return Array.from(t.querySelectorAll(`[data-melt-menu-id="${t.id}"]`)).filter(e=>J(e))}function Qr(t){!t||!on(t)||(t.setAttribute("data-disabled",""),t.setAttribute("aria-disabled","true"))}function ws(t){if(!mt)return;const e=t.get();e&&(window.clearTimeout(e),t.set(null))}function Kr(t){return t.pointerType==="mouse"}function jr(t,e){if(!t)return;const n=t.closest(`${e()}, ${e("submenu")}`);J(n)&&t.setAttribute("data-melt-menu-id",n.id)}function no(t,e){t.preventDefault();const n=document.activeElement,r=t.currentTarget;if(!J(n)||!J(r))return;const i=ln(r);if(!i.length)return;const s=i.filter(l=>!(l.hasAttribute("data-disabled")||l.getAttribute("disabled")==="true")),o=s.indexOf(n);let u;switch(t.key){case ae.ARROW_DOWN:e?u=o<s.length-1?o+1:0:u=o<s.length-1?o+1:o;break;case ae.ARROW_UP:e?u=o>0?o-1:s.length-1:u=o<0?s.length-1:o>0?o-1:0;break;case ae.HOME:u=0;break;case ae.END:u=s.length-1;break;default:return}et(s[u])}function om(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return lm(n,e)}function lm(t,e){const{x:n,y:r}=t;let i=!1;for(let s=0,o=e.length-1;s<e.length;o=s++){const u=e[s].x,l=e[s].y,a=e[o].x,f=e[o].y;l>r!=f>r&&n<(a-u)*(r-l)/(f-l)+u&&(i=!i)}return i}function um(t){const e=document.activeElement;if(!J(e))return!1;const n=e.closest(`[data-id="${t}"]`);return J(n)}function am(t){return t?"open":"closed"}const fm={isDateDisabled:void 0,isDateUnavailable:void 0,value:void 0,preventDeselect:!1,numberOfMonths:1,pagedNavigation:!1,weekStartsOn:0,fixedWeeks:!1,calendarLabel:"Event Date",locale:"en",minValue:void 0,maxValue:void 0,disabled:!1,readonly:!1,weekdayFormat:"narrow"};({...Rr(fm,"isDateDisabled","isDateUnavailable","value","locale","disabled","readonly","minValue","maxValue","weekdayFormat")});const{name:In}=Zn("dialog"),cm={preventScroll:!0,closeOnEscape:!0,closeOnOutsideClick:!0,role:"dialog",defaultOpen:!1,portal:void 0,forceVisible:!1,openFocus:void 0,closeFocus:void 0,onOutsideClick:void 0},dm=["content","title","description"];function mm(t){const e={...cm,...t},n=Lt(Rr(e,"ids")),{preventScroll:r,closeOnEscape:i,closeOnOutsideClick:s,role:o,portal:u,forceVisible:l,openFocus:a,closeFocus:f,onOutsideClick:c}=n,m=Xe.writable(null),p=Lt({...xr(dm),...e.ids}),d=e.open??Fe(e.defaultOpen),_=ar(d,e==null?void 0:e.onOpenChange),v=ze([_,l],([D,I])=>D||I);let g=Qe;function h(D){const I=D.currentTarget,O=D.currentTarget;!J(I)||!J(O)||(_.set(!0),m.set(O))}function k(){_.set(!1),ti({prop:f.get(),defaultEl:m.get()})}const A=Pe(In("trigger"),{stores:[_],returned:([D])=>({"aria-haspopup":"dialog","aria-expanded":D,type:"button"}),action:D=>({destroy:rt(ke(D,"click",O=>{h(O)}),ke(D,"keydown",O=>{O.key!==ae.ENTER&&O.key!==ae.SPACE||(O.preventDefault(),h(O))}))})}),$=Pe(In("overlay"),{stores:[v,_],returned:([D,I])=>({hidden:D?void 0:!0,tabindex:-1,style:Ft({display:D?void 0:"none"}),"aria-hidden":!0,"data-state":I?"open":"closed"}),action:D=>{let I=Qe;return i.get()&&(I=ni(D,{handler:()=>{k()}}).destroy),{destroy(){I()}}}}),C=Pe(In("content"),{stores:[v,p.content,p.description,p.title,_],returned:([D,I,O,L,W])=>({id:I,role:o.get(),"aria-describedby":O,"aria-labelledby":L,"aria-modal":D?"true":void 0,"data-state":W?"open":"closed",tabindex:-1,hidden:D?void 0:!0,style:Ft({display:D?void 0:"none"})}),action:D=>{let I=Qe,O=Qe;const L=rt(xe([_,s,i],([W,q,oe])=>{if(!W)return;const se=Ya({immediate:!1,escapeDeactivates:oe,clickOutsideDeactivates:q,allowOutsideClick:!0,returnFocusOnDeactivate:!1,fallbackFocus:D});I=se.activate,O=se.deactivate;const z=se.useFocusTrap(D);return z&&z.destroy?z.destroy:se.deactivate}),xe([s,_],([W,q])=>Za(D,{open:q,closeOnInteractOutside:W,onClose(){k()},shouldCloseOnInteractOutside(oe){var se;return(se=c.get())==null||se(oe),!oe.defaultPrevented}}).destroy),xe([i],([W])=>W?ni(D,{handler:k}).destroy:Qe),xe([v],([W])=>{Wt().then(()=>{W?I():O()})}));return{destroy:()=>{g(),L()}}}}),F=Pe(In("portalled"),{stores:u,returned:D=>({"data-portal":is(D)}),action:D=>{const I=xe([u],([O])=>{if(O===null)return Qe;const L=Ar(D,O);return L===null?Qe:us(D,L).destroy});return{destroy(){I()}}}}),R=Pe(In("title"),{stores:[p.title],returned:([D])=>({id:D})}),K=Pe(In("description"),{stores:[p.description],returned:([D])=>({id:D})}),M=Pe(In("close"),{returned:()=>({type:"button"}),action:D=>({destroy:rt(ke(D,"click",()=>{k()}),ke(D,"keydown",O=>{O.key!==ae.SPACE&&O.key!==ae.ENTER||(O.preventDefault(),k())}))})});return xe([_,r],([D,I])=>{if(mt){if(I&&D&&(g=_o()),D){const O=document.getElementById(p.content.get());ti({prop:a.get(),defaultEl:O})}return()=>{l.get()||g()}}}),{ids:p,elements:{content:C,trigger:A,title:R,description:K,overlay:$,close:M,portalled:F},states:{open:_},options:n}}const ll=[ae.ARROW_LEFT,ae.ARROW_RIGHT,ae.HOME,ae.END],{name:Os}=Zn("menubar"),pm={loop:!0,closeOnEscape:!0,preventScroll:!1},hm=["menubar"];function _m(t){const e={...pm,...t},n=Lt(Rr(e,"ids")),{loop:r,closeOnEscape:i,preventScroll:s}=n,o=Xe(Fe("")),u=Xe(Fe(null)),l=Xe(Fe(null)),a=Xe(Fe(null)),f=Xe(Fe(0));let c=!1;const m=Lt({...xr(hm),...e.ids}),p=Pe(Os(),{stores:[m.menubar],returned([A]){return{role:"menubar","data-melt-menubar":"","data-orientation":"horizontal",id:A}},action:A=>{const $=Array.from(A.querySelectorAll("[data-melt-menubar-trigger]"));return J($[0])?($[0].tabIndex=0,{destroy:Qe}):{}}}),d={positioning:{placement:"bottom-start"},arrowSize:8,dir:"ltr",loop:!1,closeOnEscape:!0,closeOnOutsideClick:!0,portal:void 0,forceVisible:!1,defaultOpen:!1,typeahead:!0,closeFocus:void 0,disableFocusFirstItem:!1,closeOnItemClick:!0,onOutsideClick:void 0},_=A=>{const $={...d,...A},C=Xe(Fe(!1)),F=Xe(Fe(null)),R=Lt($),{positioning:K,portal:M,forceVisible:D,closeOnOutsideClick:I,onOutsideClick:O}=R,L=sm({rootOptions:{...R,preventScroll:s},rootOpen:Xe(C),rootActiveTrigger:Xe(F),nextFocusable:Xe(u),prevFocusable:Xe(l),selector:"menubar-menu",removeScroll:!1}),W=Qi({open:C,forceVisible:D,activeTrigger:F}),q=Pe(Os("menu"),{stores:[W,M,L.ids.menu,L.ids.trigger,m.menubar],returned:([z,le,Re,st,He])=>({role:"menu",hidden:z?void 0:!0,style:Ft({display:z?void 0:"none"}),id:Re,"aria-labelledby":st,"data-state":z?"open":"closed","data-melt-scope":He,"data-portal":is(le),tabindex:-1}),action:z=>{let le=Qe;const Re=xe([C,F,K,M,I],([He,Y,X,pt,ht])=>{le(),He&&Y&&Wt().then(()=>{le(),le=es(z,{anchorElement:Y,open:C,options:{floating:X,portal:Ar(z,pt),modal:{closeOnInteractOutside:ht,shouldCloseOnInteractOutside:ct=>{var pn;if((pn=O.get())==null||pn(ct),ct.defaultPrevented)return!1;const mn=ct.target,Ln=document.getElementById(m.menubar.get());return!Ln||!mi(mn)?!0:!Ln.contains(mn)},onClose:()=>{o.set("")},open:He}}}).destroy})}),st=rt(ke(z,"keydown",He=>{const Y=He.target,X=He.currentTarget;if(!J(X)||!J(Y)||(ll.includes(He.key)&&v(He),!(Y.closest('[role="menu"]')===X)))return;Ys.includes(He.key)&&no(He),He.key===ae.TAB&&(He.preventDefault(),F.set(null),C.set(!1),to(He,u,l));const ht=He.key.length===1;!(He.ctrlKey||He.altKey||He.metaKey)&&ht&&L.helpers.handleTypeaheadSearch(He.key,ln(X))}));return{destroy(){Re(),st(),le()}}}}),oe=Pe(Os("trigger"),{stores:[C,L.ids.menu,L.ids.trigger],returned:([z,le,Re])=>({"aria-controls":le,"aria-expanded":z,"data-state":z?"open":"closed",id:Re,"aria-haspopup":"menu","data-orientation":"horizontal",role:"menuitem"}),action:z=>{Qr(z);const le=document.getElementById(m.menubar.get());if(!le)return{};const Re=Array.from(le.querySelectorAll("[data-melt-menubar-trigger]"));if(!Re.length)return{};const st=xe([a],([Y])=>{!Y&&Re[0]===z||Y===z?z.tabIndex=0:z.tabIndex=-1});Re[0]===z?z.tabIndex=0:z.tabIndex=-1;const He=rt(ke(z,"click",Y=>{const X=C.get(),pt=Y.currentTarget;J(pt)&&(se(pt),X||Y.preventDefault())}),ke(z,"keydown",Y=>{const X=Y.currentTarget;if(J(X)&&(ei.includes(Y.key)||Y.key===ae.ARROW_DOWN)){Y.preventDefault(),se(X);const pt=X.getAttribute("aria-controls");if(!pt)return;const ht=document.getElementById(pt);if(!ht)return;const ct=ln(ht);if(!ct.length)return;et(ct[0])}}),ke(z,"pointerenter",Y=>{const X=Y.currentTarget;if(!J(X))return;const pt=o.get(),ht=C.get();pt&&!ht&&(C.set(!0),o.set(L.ids.menu.get()),F.set(X))}));return{destroy(){He(),st()}}}});function se(z){C.update(le=>{const Re=!le;return Re?(u.set(Fa(z)),l.set(Pa(z)),F.set(z),o.set(L.ids.menu.get())):F.set(null),Re})}return xe([o],([z])=>{if(mt){if(z===L.ids.menu.get()){if(C.get())return;const le=document.getElementById(L.ids.trigger.get());if(!le)return;F.set(le),Gs(le),C.set(!0);return}if(z!==L.ids.menu.get()){if(!mt)return;if(C.get()){const le=document.getElementById(L.ids.trigger.get());if(!le)return;F.set(null),C.set(!1),gn(le)}return}}}),xe([C],([z])=>{if(!mt)return;const le=document.getElementById(L.ids.trigger.get());if(le){if(!z&&o.get()===L.ids.menu.get()){F.set(null),o.set(""),gn(le);return}z&&(a.set(le),Gs(le))}}),Jr(()=>{if(!mt)return;const z=document.getElementById(L.ids.trigger.get());J(z)&&C.get()&&F.set(z)}),{ids:L.ids,elements:{...L.elements,menu:q,trigger:oe},builders:L.builders,states:L.states,options:R}};function v(A){if(!mt)return;A.preventDefault();const $=A.currentTarget,C=A.target;if(!J(C)||!J($))return;const F=C.hasAttribute("data-melt-menubar-menu-subtrigger"),R=C.closest('[role="menu"]')!==$,K=ae.ARROW_LEFT,M=A.key===K;if(!M&&F||M&&R)return;const I=document.getElementById(m.menubar.get());if(!J(I))return;const O=g(I),L=$.getAttribute("aria-labelledby"),W=O.findIndex(z=>z.id===L);let q;switch(A.key){case ae.ARROW_RIGHT:q=W<O.length-1?W+1:0;break;case ae.ARROW_LEFT:q=W>0?W-1:O.length-1;break;case ae.HOME:q=0;break;case ae.END:q=O.length-1;break;default:return}const se=O[q].getAttribute("aria-controls");se&&o.set(se)}function g(A){const $=A.closest('[role="menubar"]');return J($)?Array.from($.querySelectorAll("[data-melt-menubar-trigger]")).filter(C=>J(C)):[]}function h(A){A.preventDefault();const $=document.activeElement,C=A.currentTarget;if(!J(C)||!J($))return;const F=g(C);if(!F.length)return;const R=F.filter(I=>!(I.hasAttribute("data-disabled")||I.getAttribute("disabled")==="true")),K=R.indexOf($);let M;const D=r.get();switch(A.key){case ae.ARROW_RIGHT:M=K<R.length-1?K+1:D?0:K;break;case ae.ARROW_LEFT:M=K>0?K-1:D?R.length-1:0;break;case ae.HOME:M=0;break;case ae.END:M=R.length-1;break;default:return}et(R[M])}Jr(()=>{if(!mt)return;const A=document.getElementById(m.menubar.get());if(!A)return;const $=rt(ke(A,"keydown",C=>{const F=C.target,R=C.currentTarget;!J(R)||!J(F)||!F.hasAttribute("data-melt-menubar-trigger")||ll.includes(C.key)&&h(C)}),_t(document,"keydown",C=>{i.get()&&C.key===ae.ESCAPE&&(window.clearTimeout(f.get()),o.set(""))}));return()=>{$()}});const k=[];return xe([o,s],([A,$])=>{!mt||!$||(A?c||(k.push(_o()),c=!0):(k.forEach(C=>C()),c=!1))}),Ta(()=>{k.forEach(A=>A())}),{ids:m,elements:{menubar:p},builders:{createMenu:_},options:n}}const gm={positioning:{placement:"bottom"},arrowSize:8,defaultOpen:!1,disableFocusTrap:!1,closeOnEscape:!0,preventScroll:!1,onOpenChange:void 0,closeOnOutsideClick:!0,portal:void 0,forceVisible:!1,openFocus:void 0,closeFocus:void 0,onOutsideClick:void 0},{name:Wr}=Zn("popover"),bm=["trigger","content"];function ym(t){const e={...gm,...t},n=Lt(Rr(e,"open","ids")),{positioning:r,arrowSize:i,disableFocusTrap:s,preventScroll:o,closeOnEscape:u,closeOnOutsideClick:l,portal:a,forceVisible:f,openFocus:c,closeFocus:m,onOutsideClick:p}=n,d=e.open??Fe(e.defaultOpen),_=ar(d,e==null?void 0:e.onOpenChange),v=Xe.writable(null),g=Lt({...xr(bm),...e.ids});Jr(()=>{v.set(document.getElementById(g.trigger.get()))});function h(){_.set(!1);const D=document.getElementById(g.trigger.get());ti({prop:m.get(),defaultEl:D})}const k=Qi({open:_,activeTrigger:v,forceVisible:f}),A=Pe(Wr("content"),{stores:[k,a,g.content],returned:([D,I,O])=>({hidden:D&&mt?void 0:!0,tabindex:-1,style:Ft({display:D?void 0:"none"}),id:O,"data-state":D?"open":"closed","data-portal":is(I)}),action:D=>{let I=Qe;const O=xe([k,v,r,s,u,l,a],([L,W,q,oe,se,z,le])=>{I(),!(!L||!W)&&Wt().then(()=>{I(),I=es(D,{anchorElement:W,open:_,options:{floating:q,focusTrap:oe?null:{returnFocusOnDeactivate:!1,clickOutsideDeactivates:z,allowOutsideClick:!0,escapeDeactivates:se},modal:{shouldCloseOnInteractOutside:C,onClose:h,open:L,closeOnInteractOutside:z},escapeKeydown:se?{handler:()=>{h()}}:null,portal:Ar(D,le)}}).destroy})});return{destroy(){O(),I()}}}});function $(D){_.update(I=>!I),D&&D!==v.get()&&v.set(D)}function C(D){var L;if((L=p.get())==null||L(D),D.defaultPrevented)return!1;const I=D.target,O=document.getElementById(g.trigger.get());return!(O&&mi(I)&&(I===O||O.contains(I)))}const F=Pe(Wr("trigger"),{stores:[k,g.content,g.trigger],returned:([D,I,O])=>({role:"button","aria-haspopup":"dialog","aria-expanded":D?"true":"false","data-state":ul(D),"aria-controls":I,id:O}),action:D=>({destroy:rt(ke(D,"click",()=>{$(D)}),ke(D,"keydown",O=>{O.key!==ae.ENTER&&O.key!==ae.SPACE||(O.preventDefault(),$(D))}))})}),R=Pe(Wr("overlay"),{stores:[k],returned:([D])=>({hidden:D?void 0:!0,tabindex:-1,style:Ft({display:D?void 0:"none"}),"aria-hidden":"true","data-state":ul(D)}),action:D=>{let I=Qe,O=Qe,L=Qe;return u.get()&&(I=ni(D,{handler:()=>{h()}}).destroy),O=xe([a],([W])=>{if(L(),W===null)return;const q=Ar(D,W);q!==null&&(L=us(D,q).destroy)}),{destroy(){I(),O(),L()}}}}),K=Pe(Wr("arrow"),{stores:i,returned:D=>({"data-arrow":!0,style:Ft({position:"absolute",width:`var(--arrow-size, ${D}px)`,height:`var(--arrow-size, ${D}px)`})})}),M=Pe(Wr("close"),{returned:()=>({type:"button"}),action:D=>({destroy:rt(ke(D,"click",O=>{O.defaultPrevented||h()}),ke(D,"keydown",O=>{O.defaultPrevented||O.key!==ae.ENTER&&O.key!==ae.SPACE||(O.preventDefault(),$())}))})});return xe([_,v,o],([D,I,O])=>{if(!mt)return;const L=[];if(D){I||Wt().then(()=>{const q=document.getElementById(g.trigger.get());J(q)&&v.set(q)}),O&&L.push(_o());const W=I??document.getElementById(g.trigger.get());ti({prop:c.get(),defaultEl:W})}return()=>{L.forEach(W=>W())}}),{ids:g,elements:{trigger:F,content:A,arrow:K,close:M,overlay:R},states:{open:_},options:n}}function ul(t){return t?"open":"closed"}const vm={orientation:"horizontal",decorative:!1},km=t=>{const e={...vm,...t},n=Lt(e),{orientation:r,decorative:i}=n;return{elements:{root:Pe("separator",{stores:[r,i],returned:([o,u])=>({role:u?"none":"separator","aria-orientation":o==="vertical"?o:void 0,"aria-hidden":u,"data-orientation":o})})},options:n}},Cm={loop:!0,orientation:"horizontal"},{name:Fi,selector:As}=Zn("toolbar"),Em=t=>{const e={...Cm,...t},n=Lt(e),{loop:r,orientation:i}=n,s=Pe(Fi(),{stores:i,returned:m=>({role:"toolbar","data-orientation":m})}),o=Pe(Fi("button"),{returned:()=>({role:"button",type:"button"}),action:m=>(Ts(m),{destroy:ke(m,"keydown",c)})}),u=Pe(Fi("link"),{returned:()=>({role:"link"}),action:m=>(Ts(m),{destroy:ke(m,"keydown",c)})}),l=Pe(Fi("separator"),{stores:i,returned:m=>({role:"separator","data-orientation":m==="horizontal"?"vertical":"horizontal","aria-orientation":m==="horizontal"?"vertical":"horizontal"})}),a={type:"single",disabled:!1},f=m=>{const p={...a,...m},d=Lt(p),{type:_,disabled:v}=d,g=p.defaultValue?p.defaultValue:p.type==="single"?void 0:[],h=p.value??Fe(g),k=ar(h,p==null?void 0:p.onValueChange),{name:A}=Zn("toolbar-group"),$=Pe(A(),{stores:i,returned:R=>({role:"group","data-orientation":R})}),C=Pe(A("item"),{stores:[v,_,k,i],returned:([R,K,M,D])=>I=>{const O=typeof I=="string"?I:I.value,L=typeof I=="string"?!1:!!I.disabled,W=R||L,q=Array.isArray(M)?M.includes(O):M===O,oe=K==="single",se=K==="multiple";return{disabled:Gr(W),pressed:q,"data-orientation":D,"data-disabled":Gr(W),"data-value":O,"data-state":q?"on":"off","aria-checked":oe?q:void 0,"aria-pressed":se?q:void 0,type:"button",role:oe?"radio":void 0,"data-melt-toolbar-item":""}},action:R=>{Ts(R);function K(){const I=R.dataset.value,O=R.dataset.disabled==="true";return{value:I,disabled:O}}function M(){const{value:I,disabled:O}=K();I===void 0||O||k.update(L=>Array.isArray(L)?L.includes(I)?L.filter(W=>W!==I):(L.push(I),L):L===I?void 0:I)}return{destroy:rt(ke(R,"click",()=>{M()}),ke(R,"keydown",I=>{if(I.key===ae.ENTER||I.key===ae.SPACE){I.preventDefault(),M();return}c(I)}))}}}),F=ze(k,R=>K=>Array.isArray(R)?R.includes(K):R===K);return{elements:{group:$,item:C},states:{value:k},helpers:{isPressed:F},options:d}};function c(m){const p=i.get(),d=r.get(),_={horizontal:ae.ARROW_RIGHT,vertical:ae.ARROW_DOWN}[p??"horizontal"],v={horizontal:ae.ARROW_LEFT,vertical:ae.ARROW_UP}[p??"horizontal"],g=m.currentTarget;if(!J(g))return;const h=g.closest("[data-melt-toolbar]");if(!J(h))return;const k=Ja(h),A=k.indexOf(g);if(m.key===_){m.preventDefault();const $=A+1;$>=k.length&&d?et(k[0]):et(k[$])}else if(m.key===v){m.preventDefault();const $=A-1;$<0&&d?et(k[k.length-1]):et(k[$])}else m.key===ae.HOME?(m.preventDefault(),et(k[0])):m.key===ae.END&&(m.preventDefault(),et(k[k.length-1]))}return{elements:{root:s,button:o,separator:l,link:u},builders:{createToolbarGroup:f},options:n}};function Ts(t){const e=t.closest("[data-melt-toolbar]");if(!J(e))return;Ja(e)[0]===t?t.tabIndex=0:t.tabIndex=-1}function Ja(t){return Array.from(t.querySelectorAll(`${As("item")}, ${As("button")}, ${As("link")}`)).filter(e=>J(e))}function ii(t,e){const n={};return e.forEach(r=>{n[r]={[`data-${t}-${r}`]:""}}),r=>n[r]}function wm(t){return t?{"aria-disabled":"true","data-disabled":""}:{"aria-disabled":void 0,"data-disabled":void 0}}function Pn(){const t=Sf();return e=>{const{originalEvent:n}=e.detail,{cancelable:r}=e,i=n.type;t(i,{originalEvent:n,currentTarget:n.currentTarget},{cancelable:r})||e.preventDefault()}}function hi(t){const e={};for(const n in t){const r=t[n];r!==void 0&&(e[n]=r)}return e}function _i(t){return function(e,n){if(n===void 0)return;const r=t[e];r&&r.set(n)}}function xa(t){return(e={})=>Om(t,e)}function Om(t,e){const r={...{side:"bottom",align:"center",sideOffset:0,alignOffset:0,sameWidth:!1,avoidCollisions:!0,collisionPadding:8,fitViewport:!1,strategy:"absolute",overlap:!1},...e};t.update(i=>({...i,placement:Am(r.side,r.align),offset:{...i.offset,mainAxis:r.sideOffset,crossAxis:r.alignOffset},gutter:0,sameWidth:r.sameWidth,flip:r.avoidCollisions,overflowPadding:r.collisionPadding,boundary:r.collisionBoundary,fitViewport:r.fitViewport,strategy:r.strategy,overlap:r.overlap}))}function Am(t,e){return e==="center"?t:`${t}-${e}`}function wo(){return{NAME:"menu",SUB_NAME:"menu-submenu",RADIO_GROUP_NAME:"menu-radiogroup",CHECKBOX_ITEM_NAME:"menu-checkboxitem",RADIO_ITEM_NAME:"menu-radioitem",GROUP_NAME:"menu-group",PARTS:["arrow","checkbox-indicator","checkbox-item","content","group","item","label","radio-group","radio-item","radio-indicator","separator","sub-content","sub-trigger","trigger"]}}function gi(){const{NAME:t}=wo();return bt(t)}function Tm(t){const{RADIO_GROUP_NAME:e}=wo(),{builders:{createMenuRadioGroup:n},getAttrs:r}=gi(),i=n(t);return At(e,{...i,getAttrs:r}),{...i,getAttrs:r}}function $m(t){const{RADIO_ITEM_NAME:e,RADIO_GROUP_NAME:n}=wo(),r=bt(n);return At(e,{...r,value:t}),{...r,value:t}}function Sm(t){const n={...{side:"bottom",align:"center"},...t},{options:{positioning:r}}=gi();xa(r)(n)}const Rm=t=>({builder:t&8}),al=t=>({builder:t[3]}),Dm=t=>({builder:t&8}),fl=t=>({builder:t[3]});function Fm(t){let e=t[1]?"a":"div",n,r,i=(t[1]?"a":"div")&&$s(t);return{c(){i&&i.c(),n=Se()},m(s,o){i&&i.m(s,o),w(s,n,o),r=!0},p(s,o){s[1],e?fe(e,s[1]?"a":"div")?(i.d(1),i=$s(s),e=s[1]?"a":"div",i.c(),i.m(n.parentNode,n)):i.p(s,o):(i=$s(s),e=s[1]?"a":"div",i.c(),i.m(n.parentNode,n))},i(s){r||(b(i,s),r=!0)},o(s){y(i,s),r=!1},d(s){s&&E(n),i&&i.d(s)}}}function Pm(t){let e;const n=t[11].default,r=de(n,t,t[10],fl);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,s){r&&r.p&&(!e||s&1032)&&pe(r,n,i,i[10],e?me(n,i[10],s,Dm):he(i[10]),fl)},i(i){e||(b(r,i),e=!0)},o(i){y(r,i),e=!1},d(i){r&&r.d(i)}}}function $s(t){let e,n,r,i;const s=t[11].default,o=de(s,t,t[10],al);let u=[{href:t[1]},t[3],t[6]],l={};for(let a=0;a<u.length;a+=1)l=ne(l,u[a]);return{c(){e=S(t[1]?"a":"div"),o&&o.c(),Vi(t[1]?"a":"div")(e,l)},m(a,f){w(a,e,f),o&&o.m(e,null),t[13](e),n=!0,r||(i=[Ue(t[3].action(e)),G(e,"m-click",t[5]),G(e,"m-focusin",t[5]),G(e,"m-focusout",t[5]),G(e,"m-keydown",t[5]),G(e,"m-pointerdown",t[5]),G(e,"m-pointerleave",t[5]),G(e,"m-pointermove",t[5]),G(e,"pointerenter",t[12])],r=!0)},p(a,f){o&&o.p&&(!n||f&1032)&&pe(o,s,a,a[10],n?me(s,a[10],f,Rm):he(a[10]),al),Vi(a[1]?"a":"div")(e,l=Me(u,[(!n||f&2)&&{href:a[1]},f&8&&a[3],f&64&&a[6]]))},i(a){n||(b(o,a),n=!0)},o(a){y(o,a),n=!1},d(a){a&&E(e),o&&o.d(a),t[13](null),r=!1,Te(i)}}}function Lm(t){let e,n,r,i;const s=[Pm,Fm],o=[];function u(l,a){return l[2]?0:1}return e=u(t),n=o[e]=s[e](t),{c(){n.c(),r=Se()},m(l,a){o[e].m(l,a),w(l,r,a),i=!0},p(l,[a]){let f=e;e=u(l),e===f?o[e].p(l,a):(_e(),y(o[f],1,1,()=>{o[f]=null}),ge(),n=o[e],n?n.p(l,a):(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r))},i(l){i||(b(n),i=!0)},o(l){y(n),i=!1},d(l){l&&E(r),o[e].d(l)}}}function Im(t,e,n){let r,i;const s=["href","asChild","disabled","el"];let o=Ke(e,s),u,{$$slots:l={},$$scope:a}=e,{href:f=void 0}=e,{asChild:c=!1}=e,{disabled:m=!1}=e,{el:p=void 0}=e;const{elements:{item:d},getAttrs:_}=gi();x(t,d,k=>n(9,u=k));const v=Pn();function g(k){Oe.call(this,t,k)}function h(k){Ce[k?"unshift":"push"](()=>{p=k,n(0,p)})}return t.$$set=k=>{e=ne(ne({},e),yt(k)),n(6,o=Ke(e,s)),"href"in k&&n(1,f=k.href),"asChild"in k&&n(2,c=k.asChild),"disabled"in k&&n(7,m=k.disabled),"el"in k&&n(0,p=k.el),"$$scope"in k&&n(10,a=k.$$scope)},t.$$.update=()=>{t.$$.dirty&512&&n(3,r=u),t.$$.dirty&128&&n(8,i={..._("item"),...wm(m)}),t.$$.dirty&264&&Object.assign(r,i)},[p,f,c,r,d,v,o,m,i,u,a,l,g,h]}class Pt extends ve{constructor(e){super(),ye(this,e,Im,Lm,fe,{href:1,asChild:2,disabled:7,el:0})}}const Mm=t=>({builder:t&4}),cl=t=>({builder:t[2]}),Nm=t=>({builder:t&4}),dl=t=>({builder:t[2]});function Hm(t){let e,n,r,i;const s=t[10].default,o=de(s,t,t[9],cl);let u=[t[2],t[5]],l={};for(let a=0;a<u.length;a+=1)l=ne(l,u[a]);return{c(){e=S("div"),o&&o.c(),ie(e,l)},m(a,f){w(a,e,f),o&&o.m(e,null),t[12](e),n=!0,r||(i=[Ue(t[2].action(e)),G(e,"m-click",t[4]),G(e,"m-focusin",t[4]),G(e,"m-focusout",t[4]),G(e,"m-keydown",t[4]),G(e,"m-pointerdown",t[4]),G(e,"m-pointerleave",t[4]),G(e,"m-pointermove",t[4]),G(e,"pointerenter",t[11])],r=!0)},p(a,f){o&&o.p&&(!n||f&516)&&pe(o,s,a,a[9],n?me(s,a[9],f,Mm):he(a[9]),cl),ie(e,l=Me(u,[f&4&&a[2],f&32&&a[5]]))},i(a){n||(b(o,a),n=!0)},o(a){y(o,a),n=!1},d(a){a&&E(e),o&&o.d(a),t[12](null),r=!1,Te(i)}}}function Vm(t){let e;const n=t[10].default,r=de(n,t,t[9],dl);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,s){r&&r.p&&(!e||s&516)&&pe(r,n,i,i[9],e?me(n,i[9],s,Nm):he(i[9]),dl)},i(i){e||(b(r,i),e=!0)},o(i){y(r,i),e=!1},d(i){r&&r.d(i)}}}function Um(t){let e,n,r,i;const s=[Vm,Hm],o=[];function u(l,a){return l[1]?0:1}return e=u(t),n=o[e]=s[e](t),{c(){n.c(),r=Se()},m(l,a){o[e].m(l,a),w(l,r,a),i=!0},p(l,[a]){let f=e;e=u(l),e===f?o[e].p(l,a):(_e(),y(o[f],1,1,()=>{o[f]=null}),ge(),n=o[e],n?n.p(l,a):(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r))},i(l){i||(b(n),i=!0)},o(l){y(n),i=!1},d(l){l&&E(r),o[e].d(l)}}}function Bm(t,e,n){let r;const i=["value","disabled","asChild","el"];let s=Ke(e,i),o,{$$slots:u={},$$scope:l}=e,{value:a}=e,{disabled:f=!1}=e,{asChild:c=!1}=e,{el:m=void 0}=e;const{elements:{radioItem:p},getAttrs:d}=$m(a);x(t,p,k=>n(8,o=k));const _=d("radio-item"),v=Pn();function g(k){Oe.call(this,t,k)}function h(k){Ce[k?"unshift":"push"](()=>{m=k,n(0,m)})}return t.$$set=k=>{e=ne(ne({},e),yt(k)),n(5,s=Ke(e,i)),"value"in k&&n(6,a=k.value),"disabled"in k&&n(7,f=k.disabled),"asChild"in k&&n(1,c=k.asChild),"el"in k&&n(0,m=k.el),"$$scope"in k&&n(9,l=k.$$scope)},t.$$.update=()=>{t.$$.dirty&448&&n(2,r=o({value:a,disabled:f})),t.$$.dirty&4&&Object.assign(r,_)},[m,c,r,p,v,s,a,f,o,l,u,g,h]}class Km extends ve{constructor(e){super(),ye(this,e,Bm,Um,fe,{value:6,disabled:7,asChild:1,el:0})}}const jm=t=>({builder:t&4}),ml=t=>({builder:t[2]});function Wm(t){let e,n,r,i=[t[3],t[5]],s={};for(let o=0;o<i.length;o+=1)s=ne(s,i[o]);return{c(){e=S("div"),ie(e,s)},m(o,u){w(o,e,u),t[8](e),n||(r=Ue(t[3].action(e)),n=!0)},p(o,u){ie(e,s=Me(i,[u&8&&o[3],u&32&&o[5]]))},i:ce,o:ce,d(o){o&&E(e),t[8](null),n=!1,r()}}}function qm(t){let e;const n=t[7].default,r=de(n,t,t[6],ml);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,s){r&&r.p&&(!e||s&68)&&pe(r,n,i,i[6],e?me(n,i[6],s,jm):he(i[6]),ml)},i(i){e||(b(r,i),e=!0)},o(i){y(r,i),e=!1},d(i){r&&r.d(i)}}}function Qm(t){let e,n,r,i;const s=[qm,Wm],o=[];function u(l,a){return l[1]?0:1}return e=u(t),n=o[e]=s[e](t),{c(){n.c(),r=Se()},m(l,a){o[e].m(l,a),w(l,r,a),i=!0},p(l,[a]){let f=e;e=u(l),e===f?o[e].p(l,a):(_e(),y(o[f],1,1,()=>{o[f]=null}),ge(),n=o[e],n?n.p(l,a):(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r))},i(l){i||(b(n),i=!0)},o(l){y(n),i=!1},d(l){l&&E(r),o[e].d(l)}}}function zm(t,e,n){let r;const i=["asChild","el"];let s=Ke(e,i),o,{$$slots:u={},$$scope:l}=e,{asChild:a=!1}=e,{el:f=void 0}=e;const{elements:{separator:c},getAttrs:m}=gi();x(t,c,_=>n(3,o=_));const p=m("separator");function d(_){Ce[_?"unshift":"push"](()=>{f=_,n(0,f)})}return t.$$set=_=>{e=ne(ne({},e),yt(_)),n(5,s=Ke(e,i)),"asChild"in _&&n(1,a=_.asChild),"el"in _&&n(0,f=_.el),"$$scope"in _&&n(6,l=_.$$scope)},t.$$.update=()=>{t.$$.dirty&8&&n(2,r=o),t.$$.dirty&4&&Object.assign(r,p)},[f,a,r,o,c,s,l,u,d]}class as extends ve{constructor(e){super(),ye(this,e,zm,Qm,fe,{asChild:1,el:0})}}const Gm=t=>({builder:t&4}),pl=t=>({builder:t[2]}),Ym=t=>({builder:t&4}),hl=t=>({builder:t[2]});function Zm(t){let e,n,r,i;const s=t[9].default,o=de(s,t,t[8],pl);let u=[t[2],t[4]],l={};for(let a=0;a<u.length;a+=1)l=ne(l,u[a]);return{c(){e=S("div"),o&&o.c(),ie(e,l)},m(a,f){w(a,e,f),o&&o.m(e,null),t[10](e),n=!0,r||(i=Ue(t[2].action(e)),r=!0)},p(a,f){o&&o.p&&(!n||f&260)&&pe(o,s,a,a[8],n?me(s,a[8],f,Gm):he(a[8]),pl),ie(e,l=Me(u,[f&4&&a[2],f&16&&a[4]]))},i(a){n||(b(o,a),n=!0)},o(a){y(o,a),n=!1},d(a){a&&E(e),o&&o.d(a),t[10](null),r=!1,i()}}}function Xm(t){let e;const n=t[9].default,r=de(n,t,t[8],hl);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,s){r&&r.p&&(!e||s&260)&&pe(r,n,i,i[8],e?me(n,i[8],s,Ym):he(i[8]),hl)},i(i){e||(b(r,i),e=!0)},o(i){y(r,i),e=!1},d(i){r&&r.d(i)}}}function Jm(t){let e,n,r,i;const s=[Xm,Zm],o=[];function u(l,a){return l[1]?0:1}return e=u(t),n=o[e]=s[e](t),{c(){n.c(),r=Se()},m(l,a){o[e].m(l,a),w(l,r,a),i=!0},p(l,[a]){let f=e;e=u(l),e===f?o[e].p(l,a):(_e(),y(o[f],1,1,()=>{o[f]=null}),ge(),n=o[e],n?n.p(l,a):(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r))},i(l){i||(b(n),i=!0)},o(l){y(n),i=!1},d(l){l&&E(r),o[e].d(l)}}}function xm(t,e,n){let r;const i=["value","onValueChange","asChild","el"];let s=Ke(e,i),o,{$$slots:u={},$$scope:l}=e,{value:a=void 0}=e,{onValueChange:f=void 0}=e,{asChild:c=!1}=e,{el:m=void 0}=e;const{elements:{radioGroup:p},states:{value:d},getAttrs:_}=Tm({defaultValue:a,onValueChange:({next:h})=>(h!=null&&h!==a&&(f==null||f(h),n(5,a=h)),h)});x(t,p,h=>n(7,o=h));const v=_("radio-group");function g(h){Ce[h?"unshift":"push"](()=>{m=h,n(0,m)})}return t.$$set=h=>{e=ne(ne({},e),yt(h)),n(4,s=Ke(e,i)),"value"in h&&n(5,a=h.value),"onValueChange"in h&&n(6,f=h.onValueChange),"asChild"in h&&n(1,c=h.asChild),"el"in h&&n(0,m=h.el),"$$scope"in h&&n(8,l=h.$$scope)},t.$$.update=()=>{t.$$.dirty&32&&a!==void 0&&d.set(a),t.$$.dirty&128&&n(2,r=o),t.$$.dirty&4&&Object.assign(r,v)},[m,c,r,p,s,a,f,o,l,u,g]}class ep extends ve{constructor(e){super(),ye(this,e,xm,Jm,fe,{value:5,onValueChange:6,asChild:1,el:0})}}function ef(){return{NAME:"popover",PARTS:["arrow","close","content","trigger"]}}function tp(t){const{NAME:e,PARTS:n}=ef(),r=ii(e,n),i={...ym({positioning:{placement:"bottom",gutter:0},...hi(t),forceVisible:!0}),getAttrs:r};return At(e,i),{...i,updateOption:_i(i.options)}}function Oo(){const{NAME:t}=ef();return bt(t)}function np(t){const n={...{side:"bottom",align:"center"},...t},{options:{positioning:r}}=Oo();xa(r)(n)}function tf(){return{NAME:"dialog",PARTS:["close","content","description","overlay","portal","title","trigger"]}}function rp(t){const{NAME:e,PARTS:n}=tf(),r=ii(e,n),i={...mm({...hi(t),role:"dialog",forceVisible:!0}),getAttrs:r};return At(e,i),{...i,updateOption:_i(i.options)}}function Lr(){const{NAME:t}=tf();return bt(t)}const ip=t=>({ids:t&1}),_l=t=>({ids:t[0]});function sp(t){let e;const n=t[12].default,r=de(n,t,t[11],_l);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,[s]){r&&r.p&&(!e||s&2049)&&pe(r,n,i,i[11],e?me(n,i[11],s,ip):he(i[11]),_l)},i(i){e||(b(r,i),e=!0)},o(i){y(r,i),e=!1},d(i){r&&r.d(i)}}}function op(t,e,n){let r,{$$slots:i={},$$scope:s}=e,{preventScroll:o=void 0}=e,{closeOnEscape:u=void 0}=e,{closeOnOutsideClick:l=void 0}=e,{portal:a=void 0}=e,{open:f=void 0}=e,{onOpenChange:c=void 0}=e,{openFocus:m=void 0}=e,{closeFocus:p=void 0}=e,{onOutsideClick:d=void 0}=e;const{states:{open:_},updateOption:v,ids:g}=rp({closeOnEscape:u,preventScroll:o,closeOnOutsideClick:l,portal:a,forceVisible:!0,defaultOpen:f,openFocus:m,closeFocus:p,onOutsideClick:d,onOpenChange:({next:k})=>(f!==k&&(c==null||c(k),n(2,f=k)),k)}),h=ze([g.content,g.description,g.title],([k,A,$])=>({content:k,description:A,title:$}));return x(t,h,k=>n(0,r=k)),t.$$set=k=>{"preventScroll"in k&&n(3,o=k.preventScroll),"closeOnEscape"in k&&n(4,u=k.closeOnEscape),"closeOnOutsideClick"in k&&n(5,l=k.closeOnOutsideClick),"portal"in k&&n(6,a=k.portal),"open"in k&&n(2,f=k.open),"onOpenChange"in k&&n(7,c=k.onOpenChange),"openFocus"in k&&n(8,m=k.openFocus),"closeFocus"in k&&n(9,p=k.closeFocus),"onOutsideClick"in k&&n(10,d=k.onOutsideClick),"$$scope"in k&&n(11,s=k.$$scope)},t.$$.update=()=>{t.$$.dirty&4&&f!==void 0&&_.set(f),t.$$.dirty&8&&v("preventScroll",o),t.$$.dirty&16&&v("closeOnEscape",u),t.$$.dirty&32&&v("closeOnOutsideClick",l),t.$$.dirty&64&&v("portal",a),t.$$.dirty&256&&v("openFocus",m),t.$$.dirty&512&&v("closeFocus",p),t.$$.dirty&1024&&v("onOutsideClick",d)},[r,h,f,o,u,l,a,c,m,p,d,s,i]}class si extends ve{constructor(e){super(),ye(this,e,op,sp,fe,{preventScroll:3,closeOnEscape:4,closeOnOutsideClick:5,portal:6,open:2,onOpenChange:7,openFocus:8,closeFocus:9,onOutsideClick:10})}}const lp=t=>({builder:t&8}),gl=t=>({builder:t[3]}),up=t=>({builder:t&8}),bl=t=>({builder:t[3]});function ap(t){let e=t[1],n,r,i=t[1]&&Ss(t);return{c(){i&&i.c(),n=Se()},m(s,o){i&&i.m(s,o),w(s,n,o),r=!0},p(s,o){s[1]?e?fe(e,s[1])?(i.d(1),i=Ss(s),e=s[1],i.c(),i.m(n.parentNode,n)):i.p(s,o):(i=Ss(s),e=s[1],i.c(),i.m(n.parentNode,n)):e&&(i.d(1),i=null,e=s[1])},i(s){r||(b(i,s),r=!0)},o(s){y(i,s),r=!1},d(s){s&&E(n),i&&i.d(s)}}}function fp(t){let e;const n=t[9].default,r=de(n,t,t[8],bl);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,s){r&&r.p&&(!e||s&264)&&pe(r,n,i,i[8],e?me(n,i[8],s,up):he(i[8]),bl)},i(i){e||(b(r,i),e=!0)},o(i){y(r,i),e=!1},d(i){r&&r.d(i)}}}function Ss(t){let e,n,r,i;const s=t[9].default,o=de(s,t,t[8],gl);let u=[t[3],t[5]],l={};for(let a=0;a<u.length;a+=1)l=ne(l,u[a]);return{c(){e=S(t[1]),o&&o.c(),Vi(t[1])(e,l)},m(a,f){w(a,e,f),o&&o.m(e,null),t[10](e),n=!0,r||(i=Ue(t[3].action(e)),r=!0)},p(a,f){o&&o.p&&(!n||f&264)&&pe(o,s,a,a[8],n?me(s,a[8],f,lp):he(a[8]),gl),Vi(a[1])(e,l=Me(u,[f&8&&a[3],f&32&&a[5]]))},i(a){n||(b(o,a),n=!0)},o(a){y(o,a),n=!1},d(a){a&&E(e),o&&o.d(a),t[10](null),r=!1,i()}}}function cp(t){let e,n,r,i;const s=[fp,ap],o=[];function u(l,a){return l[2]?0:1}return e=u(t),n=o[e]=s[e](t),{c(){n.c(),r=Se()},m(l,a){o[e].m(l,a),w(l,r,a),i=!0},p(l,[a]){let f=e;e=u(l),e===f?o[e].p(l,a):(_e(),y(o[f],1,1,()=>{o[f]=null}),ge(),n=o[e],n?n.p(l,a):(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r))},i(l){i||(b(n),i=!0)},o(l){y(n),i=!1},d(l){l&&E(r),o[e].d(l)}}}function dp(t,e,n){let r;const i=["level","asChild","id","el"];let s=Ke(e,i),o,{$$slots:u={},$$scope:l}=e,{level:a="h2"}=e,{asChild:f=!1}=e,{id:c=void 0}=e,{el:m=void 0}=e;const{elements:{title:p},ids:d,getAttrs:_}=Lr();x(t,p,h=>n(7,o=h));const v=_("title");function g(h){Ce[h?"unshift":"push"](()=>{m=h,n(0,m)})}return t.$$set=h=>{e=ne(ne({},e),yt(h)),n(5,s=Ke(e,i)),"level"in h&&n(1,a=h.level),"asChild"in h&&n(2,f=h.asChild),"id"in h&&n(6,c=h.id),"el"in h&&n(0,m=h.el),"$$scope"in h&&n(8,l=h.$$scope)},t.$$.update=()=>{t.$$.dirty&64&&c&&d.title.set(c),t.$$.dirty&128&&n(3,r=o),t.$$.dirty&8&&Object.assign(r,v)},[m,a,f,r,p,s,c,o,l,u,g]}class Tt extends ve{constructor(e){super(),ye(this,e,dp,cp,fe,{level:1,asChild:2,id:6,el:0})}}const mp=t=>({builder:t&4}),yl=t=>({builder:t[2]}),pp=t=>({builder:t&4}),vl=t=>({builder:t[2]});function hp(t){let e,n,r,i;const s=t[8].default,o=de(s,t,t[7],yl);let u=[t[2],{type:"button"},t[5]],l={};for(let a=0;a<u.length;a+=1)l=ne(l,u[a]);return{c(){e=S("button"),o&&o.c(),ie(e,l)},m(a,f){w(a,e,f),o&&o.m(e,null),e.autofocus&&e.focus(),t[9](e),n=!0,r||(i=[Ue(t[2].action(e)),G(e,"m-click",t[4]),G(e,"m-keydown",t[4])],r=!0)},p(a,f){o&&o.p&&(!n||f&132)&&pe(o,s,a,a[7],n?me(s,a[7],f,mp):he(a[7]),yl),ie(e,l=Me(u,[f&4&&a[2],{type:"button"},f&32&&a[5]]))},i(a){n||(b(o,a),n=!0)},o(a){y(o,a),n=!1},d(a){a&&E(e),o&&o.d(a),t[9](null),r=!1,Te(i)}}}function _p(t){let e;const n=t[8].default,r=de(n,t,t[7],vl);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,s){r&&r.p&&(!e||s&132)&&pe(r,n,i,i[7],e?me(n,i[7],s,pp):he(i[7]),vl)},i(i){e||(b(r,i),e=!0)},o(i){y(r,i),e=!1},d(i){r&&r.d(i)}}}function gp(t){let e,n,r,i;const s=[_p,hp],o=[];function u(l,a){return l[1]?0:1}return e=u(t),n=o[e]=s[e](t),{c(){n.c(),r=Se()},m(l,a){o[e].m(l,a),w(l,r,a),i=!0},p(l,[a]){let f=e;e=u(l),e===f?o[e].p(l,a):(_e(),y(o[f],1,1,()=>{o[f]=null}),ge(),n=o[e],n?n.p(l,a):(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r))},i(l){i||(b(n),i=!0)},o(l){y(n),i=!1},d(l){l&&E(r),o[e].d(l)}}}function bp(t,e,n){let r;const i=["asChild","el"];let s=Ke(e,i),o,{$$slots:u={},$$scope:l}=e,{asChild:a=!1}=e,{el:f=void 0}=e;const{elements:{close:c},getAttrs:m}=Lr();x(t,c,v=>n(6,o=v));const p=Pn(),d=m("close");function _(v){Ce[v?"unshift":"push"](()=>{f=v,n(0,f)})}return t.$$set=v=>{e=ne(ne({},e),yt(v)),n(5,s=Ke(e,i)),"asChild"in v&&n(1,a=v.asChild),"el"in v&&n(0,f=v.el),"$$scope"in v&&n(7,l=v.$$scope)},t.$$.update=()=>{t.$$.dirty&64&&n(2,r=o),t.$$.dirty&4&&Object.assign(r,d)},[f,a,r,c,p,s,o,l,u,_]}class Mt extends ve{constructor(e){super(),ye(this,e,bp,gp,fe,{asChild:1,el:0})}}const yp=t=>({builder:t&4}),kl=t=>({builder:t[2]}),vp=t=>({builder:t&4}),Cl=t=>({builder:t[2]});function kp(t){let e,n,r,i;const s=t[7].default,o=de(s,t,t[6],kl);let u=[t[2],t[4]],l={};for(let a=0;a<u.length;a+=1)l=ne(l,u[a]);return{c(){e=S("div"),o&&o.c(),ie(e,l)},m(a,f){w(a,e,f),o&&o.m(e,null),t[8](e),n=!0,r||(i=Ue(t[2].action(e)),r=!0)},p(a,f){o&&o.p&&(!n||f&68)&&pe(o,s,a,a[6],n?me(s,a[6],f,yp):he(a[6]),kl),ie(e,l=Me(u,[f&4&&a[2],f&16&&a[4]]))},i(a){n||(b(o,a),n=!0)},o(a){y(o,a),n=!1},d(a){a&&E(e),o&&o.d(a),t[8](null),r=!1,i()}}}function Cp(t){let e;const n=t[7].default,r=de(n,t,t[6],Cl);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,s){r&&r.p&&(!e||s&68)&&pe(r,n,i,i[6],e?me(n,i[6],s,vp):he(i[6]),Cl)},i(i){e||(b(r,i),e=!0)},o(i){y(r,i),e=!1},d(i){r&&r.d(i)}}}function Ep(t){let e,n,r,i;const s=[Cp,kp],o=[];function u(l,a){return l[1]?0:1}return e=u(t),n=o[e]=s[e](t),{c(){n.c(),r=Se()},m(l,a){o[e].m(l,a),w(l,r,a),i=!0},p(l,[a]){let f=e;e=u(l),e===f?o[e].p(l,a):(_e(),y(o[f],1,1,()=>{o[f]=null}),ge(),n=o[e],n?n.p(l,a):(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r))},i(l){i||(b(n),i=!0)},o(l){y(n),i=!1},d(l){l&&E(r),o[e].d(l)}}}function wp(t,e,n){let r;const i=["asChild","el"];let s=Ke(e,i),o,{$$slots:u={},$$scope:l}=e,{asChild:a=!1}=e,{el:f=void 0}=e;const{elements:{portalled:c},getAttrs:m}=Lr();x(t,c,_=>n(5,o=_));const p=m("portal");function d(_){Ce[_?"unshift":"push"](()=>{f=_,n(0,f)})}return t.$$set=_=>{e=ne(ne({},e),yt(_)),n(4,s=Ke(e,i)),"asChild"in _&&n(1,a=_.asChild),"el"in _&&n(0,f=_.el),"$$scope"in _&&n(6,l=_.$$scope)},t.$$.update=()=>{t.$$.dirty&32&&n(2,r=o),t.$$.dirty&4&&Object.assign(r,p)},[f,a,r,c,s,o,l,u,d]}class bi extends ve{constructor(e){super(),ye(this,e,wp,Ep,fe,{asChild:1,el:0})}}const Op=t=>({builder:t[0]&256}),El=t=>({builder:t[8]}),Ap=t=>({builder:t[0]&256}),wl=t=>({builder:t[8]}),Tp=t=>({builder:t[0]&256}),Ol=t=>({builder:t[8]}),$p=t=>({builder:t[0]&256}),Al=t=>({builder:t[8]}),Sp=t=>({builder:t[0]&256}),Tl=t=>({builder:t[8]}),Rp=t=>({builder:t[0]&256}),$l=t=>({builder:t[8]});function Dp(t){let e,n,r,i;const s=t[16].default,o=de(s,t,t[15],El);let u=[t[8],t[12]],l={};for(let a=0;a<u.length;a+=1)l=ne(l,u[a]);return{c(){e=S("div"),o&&o.c(),ie(e,l)},m(a,f){w(a,e,f),o&&o.m(e,null),t[56](e),n=!0,r||(i=[Ue(t[8].action(e)),G(e,"pointerdown",t[45]),G(e,"pointermove",t[46]),G(e,"pointerup",t[47]),G(e,"touchcancel",t[48]),G(e,"touchend",t[49]),G(e,"touchmove",t[50],{passive:!1}),G(e,"touchstart",t[51],{passive:!1})],r=!0)},p(a,f){o&&o.p&&(!n||f[0]&33024)&&pe(o,s,a,a[15],n?me(s,a[15],f,Op):he(a[15]),El),ie(e,l=Me(u,[f[0]&256&&a[8],f[0]&4096&&a[12]]))},i(a){n||(b(o,a),n=!0)},o(a){y(o,a),n=!1},d(a){a&&E(e),o&&o.d(a),t[56](null),r=!1,Te(i)}}}function Fp(t){let e,n,r,i,s;const o=t[16].default,u=de(o,t,t[15],wl);let l=[t[8],t[12]],a={};for(let f=0;f<l.length;f+=1)a=ne(a,l[f]);return{c(){e=S("div"),u&&u.c(),ie(e,a)},m(f,c){w(f,e,c),u&&u.m(e,null),t[55](e),r=!0,i||(s=[Ue(t[8].action(e)),G(e,"pointerdown",t[38]),G(e,"pointermove",t[39]),G(e,"pointerup",t[40]),G(e,"touchcancel",t[41]),G(e,"touchend",t[42]),G(e,"touchmove",t[43],{passive:!1}),G(e,"touchstart",t[44],{passive:!1})],i=!0)},p(f,c){t=f,u&&u.p&&(!r||c[0]&33024)&&pe(u,o,t,t[15],r?me(o,t[15],c,Ap):he(t[15]),wl),ie(e,a=Me(l,[c[0]&256&&t[8],c[0]&4096&&t[12]]))},i(f){r||(b(u,f),n&&n.end(1),r=!0)},o(f){y(u,f),f&&(n=Fn(e,t[5],t[6])),r=!1},d(f){f&&E(e),u&&u.d(f),t[55](null),f&&n&&n.end(),i=!1,Te(s)}}}function Pp(t){let e,n,r,i,s;const o=t[16].default,u=de(o,t,t[15],Ol);let l=[t[8],t[12]],a={};for(let f=0;f<l.length;f+=1)a=ne(a,l[f]);return{c(){e=S("div"),u&&u.c(),ie(e,a)},m(f,c){w(f,e,c),u&&u.m(e,null),t[54](e),r=!0,i||(s=[Ue(t[8].action(e)),G(e,"pointerdown",t[31]),G(e,"pointermove",t[32]),G(e,"pointerup",t[33]),G(e,"touchcancel",t[34]),G(e,"touchend",t[35]),G(e,"touchmove",t[36],{passive:!1}),G(e,"touchstart",t[37],{passive:!1})],i=!0)},p(f,c){t=f,u&&u.p&&(!r||c[0]&33024)&&pe(u,o,t,t[15],r?me(o,t[15],c,Tp):he(t[15]),Ol),ie(e,a=Me(l,[c[0]&256&&t[8],c[0]&4096&&t[12]]))},i(f){r||(b(u,f),f&&(n||at(()=>{n=Dn(e,t[3],t[4]),n.start()})),r=!0)},o(f){y(u,f),r=!1},d(f){f&&E(e),u&&u.d(f),t[54](null),i=!1,Te(s)}}}function Lp(t){let e,n,r,i,s,o;const u=t[16].default,l=de(u,t,t[15],Al);let a=[t[8],t[12]],f={};for(let c=0;c<a.length;c+=1)f=ne(f,a[c]);return{c(){e=S("div"),l&&l.c(),ie(e,f)},m(c,m){w(c,e,m),l&&l.m(e,null),t[53](e),i=!0,s||(o=[Ue(t[8].action(e)),G(e,"pointerdown",t[24]),G(e,"pointermove",t[25]),G(e,"pointerup",t[26]),G(e,"touchcancel",t[27]),G(e,"touchend",t[28]),G(e,"touchmove",t[29],{passive:!1}),G(e,"touchstart",t[30],{passive:!1})],s=!0)},p(c,m){t=c,l&&l.p&&(!i||m[0]&33024)&&pe(l,u,t,t[15],i?me(u,t[15],m,$p):he(t[15]),Al),ie(e,f=Me(a,[m[0]&256&&t[8],m[0]&4096&&t[12]]))},i(c){i||(b(l,c),c&&at(()=>{i&&(r&&r.end(1),n=Dn(e,t[3],t[4]),n.start())}),i=!0)},o(c){y(l,c),n&&n.invalidate(),c&&(r=Fn(e,t[5],t[6])),i=!1},d(c){c&&E(e),l&&l.d(c),t[53](null),c&&r&&r.end(),s=!1,Te(o)}}}function Ip(t){let e,n,r,i,s;const o=t[16].default,u=de(o,t,t[15],Tl);let l=[t[8],t[12]],a={};for(let f=0;f<l.length;f+=1)a=ne(a,l[f]);return{c(){e=S("div"),u&&u.c(),ie(e,a)},m(f,c){w(f,e,c),u&&u.m(e,null),t[52](e),r=!0,i||(s=[Ue(t[8].action(e)),G(e,"pointerdown",t[17]),G(e,"pointermove",t[18]),G(e,"pointerup",t[19]),G(e,"touchcancel",t[20]),G(e,"touchend",t[21]),G(e,"touchmove",t[22],{passive:!1}),G(e,"touchstart",t[23],{passive:!1})],i=!0)},p(f,c){t=f,u&&u.p&&(!r||c[0]&33024)&&pe(u,o,t,t[15],r?me(o,t[15],c,Sp):he(t[15]),Tl),ie(e,a=Me(l,[c[0]&256&&t[8],c[0]&4096&&t[12]]))},i(f){r||(b(u,f),f&&at(()=>{r&&(n||(n=Tn(e,t[1],t[2],!0)),n.run(1))}),r=!0)},o(f){y(u,f),f&&(n||(n=Tn(e,t[1],t[2],!1)),n.run(0)),r=!1},d(f){f&&E(e),u&&u.d(f),t[52](null),f&&n&&n.end(),i=!1,Te(s)}}}function Mp(t){let e;const n=t[16].default,r=de(n,t,t[15],$l);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,s){r&&r.p&&(!e||s[0]&33024)&&pe(r,n,i,i[15],e?me(n,i[15],s,Rp):he(i[15]),$l)},i(i){e||(b(r,i),e=!0)},o(i){y(r,i),e=!1},d(i){r&&r.d(i)}}}function Np(t){let e,n,r,i;const s=[Mp,Ip,Lp,Pp,Fp,Dp],o=[];function u(l,a){return l[7]&&l[9]?0:l[1]&&l[9]?1:l[3]&&l[5]&&l[9]?2:l[3]&&l[9]?3:l[5]&&l[9]?4:l[9]?5:-1}return~(e=u(t))&&(n=o[e]=s[e](t)),{c(){n&&n.c(),r=Se()},m(l,a){~e&&o[e].m(l,a),w(l,r,a),i=!0},p(l,a){let f=e;e=u(l),e===f?~e&&o[e].p(l,a):(n&&(_e(),y(o[f],1,1,()=>{o[f]=null}),ge()),~e?(n=o[e],n?n.p(l,a):(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r)):n=null)},i(l){i||(b(n),i=!0)},o(l){y(n),i=!1},d(l){l&&E(r),~e&&o[e].d(l)}}}function Hp(t,e,n){let r;const i=["transition","transitionConfig","inTransition","inTransitionConfig","outTransition","outTransitionConfig","asChild","id","el"];let s=Ke(e,i),o,u,{$$slots:l={},$$scope:a}=e,{transition:f=void 0}=e,{transitionConfig:c=void 0}=e,{inTransition:m=void 0}=e,{inTransitionConfig:p=void 0}=e,{outTransition:d=void 0}=e,{outTransitionConfig:_=void 0}=e,{asChild:v=!1}=e,{id:g=void 0}=e,{el:h=void 0}=e;const{elements:{content:k},states:{open:A},ids:$,getAttrs:C}=Lr();x(t,k,j=>n(14,o=j)),x(t,A,j=>n(9,u=j));const F=C("content");function R(j){Oe.call(this,t,j)}function K(j){Oe.call(this,t,j)}function M(j){Oe.call(this,t,j)}function D(j){Oe.call(this,t,j)}function I(j){Oe.call(this,t,j)}function O(j){Oe.call(this,t,j)}function L(j){Oe.call(this,t,j)}function W(j){Oe.call(this,t,j)}function q(j){Oe.call(this,t,j)}function oe(j){Oe.call(this,t,j)}function se(j){Oe.call(this,t,j)}function z(j){Oe.call(this,t,j)}function le(j){Oe.call(this,t,j)}function Re(j){Oe.call(this,t,j)}function st(j){Oe.call(this,t,j)}function He(j){Oe.call(this,t,j)}function Y(j){Oe.call(this,t,j)}function X(j){Oe.call(this,t,j)}function pt(j){Oe.call(this,t,j)}function ht(j){Oe.call(this,t,j)}function ct(j){Oe.call(this,t,j)}function mn(j){Oe.call(this,t,j)}function Ln(j){Oe.call(this,t,j)}function pn(j){Oe.call(this,t,j)}function ps(j){Oe.call(this,t,j)}function hs(j){Oe.call(this,t,j)}function Ir(j){Oe.call(this,t,j)}function Mr(j){Oe.call(this,t,j)}function Nr(j){Oe.call(this,t,j)}function Hr(j){Oe.call(this,t,j)}function _s(j){Oe.call(this,t,j)}function Vr(j){Oe.call(this,t,j)}function Ei(j){Oe.call(this,t,j)}function Q(j){Oe.call(this,t,j)}function ee(j){Oe.call(this,t,j)}function te(j){Ce[j?"unshift":"push"](()=>{h=j,n(0,h)})}function ue(j){Ce[j?"unshift":"push"](()=>{h=j,n(0,h)})}function we(j){Ce[j?"unshift":"push"](()=>{h=j,n(0,h)})}function Je(j){Ce[j?"unshift":"push"](()=>{h=j,n(0,h)})}function vt(j){Ce[j?"unshift":"push"](()=>{h=j,n(0,h)})}return t.$$set=j=>{e=ne(ne({},e),yt(j)),n(12,s=Ke(e,i)),"transition"in j&&n(1,f=j.transition),"transitionConfig"in j&&n(2,c=j.transitionConfig),"inTransition"in j&&n(3,m=j.inTransition),"inTransitionConfig"in j&&n(4,p=j.inTransitionConfig),"outTransition"in j&&n(5,d=j.outTransition),"outTransitionConfig"in j&&n(6,_=j.outTransitionConfig),"asChild"in j&&n(7,v=j.asChild),"id"in j&&n(13,g=j.id),"el"in j&&n(0,h=j.el),"$$scope"in j&&n(15,a=j.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&8192&&g&&$.content.set(g),t.$$.dirty[0]&16384&&n(8,r=o),t.$$.dirty[0]&256&&Object.assign(r,F)},[h,f,c,m,p,d,_,v,r,u,k,A,s,g,o,a,l,R,K,M,D,I,O,L,W,q,oe,se,z,le,Re,st,He,Y,X,pt,ht,ct,mn,Ln,pn,ps,hs,Ir,Mr,Nr,Hr,_s,Vr,Ei,Q,ee,te,ue,we,Je,vt]}class yi extends ve{constructor(e){super(),ye(this,e,Hp,Np,fe,{transition:1,transitionConfig:2,inTransition:3,inTransitionConfig:4,outTransition:5,outTransitionConfig:6,asChild:7,id:13,el:0},null,[-1,-1])}}const Vp=t=>({builder:t&256}),Sl=t=>({builder:t[8]});function Up(t){let e,n,r,i=[t[8],t[12]],s={};for(let o=0;o<i.length;o+=1)s=ne(s,i[o]);return{c(){e=S("div"),ie(e,s)},m(o,u){w(o,e,u),t[25](e),n||(r=[Ue(t[8].action(e)),G(e,"mouseup",t[20])],n=!0)},p(o,u){ie(e,s=Me(i,[u&256&&o[8],u&4096&&o[12]]))},i:ce,o:ce,d(o){o&&E(e),t[25](null),n=!1,Te(r)}}}function Bp(t){let e,n,r,i,s,o=[t[8],t[12]],u={};for(let l=0;l<o.length;l+=1)u=ne(u,o[l]);return{c(){e=S("div"),ie(e,u)},m(l,a){w(l,e,a),t[24](e),r=!0,i||(s=[Ue(t[8].action(e)),G(e,"mouseup",t[19])],i=!0)},p(l,a){t=l,ie(e,u=Me(o,[a&256&&t[8],a&4096&&t[12]]))},i(l){r||(n&&n.end(1),r=!0)},o(l){l&&(n=Fn(e,t[5],t[6])),r=!1},d(l){l&&E(e),t[24](null),l&&n&&n.end(),i=!1,Te(s)}}}function Kp(t){let e,n,r,i,s=[t[8],t[12]],o={};for(let u=0;u<s.length;u+=1)o=ne(o,s[u]);return{c(){e=S("div"),ie(e,o)},m(u,l){w(u,e,l),t[23](e),r||(i=[Ue(t[8].action(e)),G(e,"mouseup",t[18])],r=!0)},p(u,l){t=u,ie(e,o=Me(s,[l&256&&t[8],l&4096&&t[12]]))},i(u){u&&(n||at(()=>{n=Dn(e,t[3],t[4]),n.start()}))},o:ce,d(u){u&&E(e),t[23](null),r=!1,Te(i)}}}function jp(t){let e,n,r,i,s,o,u=[t[8],t[12]],l={};for(let a=0;a<u.length;a+=1)l=ne(l,u[a]);return{c(){e=S("div"),ie(e,l)},m(a,f){w(a,e,f),t[22](e),i=!0,s||(o=[Ue(t[8].action(e)),G(e,"mouseup",t[17])],s=!0)},p(a,f){t=a,ie(e,l=Me(u,[f&256&&t[8],f&4096&&t[12]]))},i(a){i||(a&&at(()=>{i&&(r&&r.end(1),n=Dn(e,t[3],t[4]),n.start())}),i=!0)},o(a){n&&n.invalidate(),a&&(r=Fn(e,t[5],t[6])),i=!1},d(a){a&&E(e),t[22](null),a&&r&&r.end(),s=!1,Te(o)}}}function Wp(t){let e,n,r,i,s,o=[t[8],t[12]],u={};for(let l=0;l<o.length;l+=1)u=ne(u,o[l]);return{c(){e=S("div"),ie(e,u)},m(l,a){w(l,e,a),t[21](e),r=!0,i||(s=[G(e,"mouseup",t[16]),Ue(t[8].action(e))],i=!0)},p(l,a){t=l,ie(e,u=Me(o,[a&256&&t[8],a&4096&&t[12]]))},i(l){r||(l&&at(()=>{r&&(n||(n=Tn(e,t[1],t[2],!0)),n.run(1))}),r=!0)},o(l){l&&(n||(n=Tn(e,t[1],t[2],!1)),n.run(0)),r=!1},d(l){l&&E(e),t[21](null),l&&n&&n.end(),i=!1,Te(s)}}}function qp(t){let e;const n=t[15].default,r=de(n,t,t[14],Sl);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,s){r&&r.p&&(!e||s&16640)&&pe(r,n,i,i[14],e?me(n,i[14],s,Vp):he(i[14]),Sl)},i(i){e||(b(r,i),e=!0)},o(i){y(r,i),e=!1},d(i){r&&r.d(i)}}}function Qp(t){let e,n,r,i;const s=[qp,Wp,jp,Kp,Bp,Up],o=[];function u(l,a){return l[7]&&l[9]?0:l[1]&&l[9]?1:l[3]&&l[5]&&l[9]?2:l[3]&&l[9]?3:l[5]&&l[9]?4:l[9]?5:-1}return~(e=u(t))&&(n=o[e]=s[e](t)),{c(){n&&n.c(),r=Se()},m(l,a){~e&&o[e].m(l,a),w(l,r,a),i=!0},p(l,[a]){let f=e;e=u(l),e===f?~e&&o[e].p(l,a):(n&&(_e(),y(o[f],1,1,()=>{o[f]=null}),ge()),~e?(n=o[e],n?n.p(l,a):(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r)):n=null)},i(l){i||(b(n),i=!0)},o(l){y(n),i=!1},d(l){l&&E(r),~e&&o[e].d(l)}}}function zp(t,e,n){let r;const i=["transition","transitionConfig","inTransition","inTransitionConfig","outTransition","outTransitionConfig","asChild","el"];let s=Ke(e,i),o,u,{$$slots:l={},$$scope:a}=e,{transition:f=void 0}=e,{transitionConfig:c=void 0}=e,{inTransition:m=void 0}=e,{inTransitionConfig:p=void 0}=e,{outTransition:d=void 0}=e,{outTransitionConfig:_=void 0}=e,{asChild:v=!1}=e,{el:g=void 0}=e;const{elements:{overlay:h},states:{open:k},getAttrs:A}=Lr();x(t,h,q=>n(13,o=q)),x(t,k,q=>n(9,u=q));const $=A("overlay");function C(q){Oe.call(this,t,q)}function F(q){Oe.call(this,t,q)}function R(q){Oe.call(this,t,q)}function K(q){Oe.call(this,t,q)}function M(q){Oe.call(this,t,q)}function D(q){Ce[q?"unshift":"push"](()=>{g=q,n(0,g)})}function I(q){Ce[q?"unshift":"push"](()=>{g=q,n(0,g)})}function O(q){Ce[q?"unshift":"push"](()=>{g=q,n(0,g)})}function L(q){Ce[q?"unshift":"push"](()=>{g=q,n(0,g)})}function W(q){Ce[q?"unshift":"push"](()=>{g=q,n(0,g)})}return t.$$set=q=>{e=ne(ne({},e),yt(q)),n(12,s=Ke(e,i)),"transition"in q&&n(1,f=q.transition),"transitionConfig"in q&&n(2,c=q.transitionConfig),"inTransition"in q&&n(3,m=q.inTransition),"inTransitionConfig"in q&&n(4,p=q.inTransitionConfig),"outTransition"in q&&n(5,d=q.outTransition),"outTransitionConfig"in q&&n(6,_=q.outTransitionConfig),"asChild"in q&&n(7,v=q.asChild),"el"in q&&n(0,g=q.el),"$$scope"in q&&n(14,a=q.$$scope)},t.$$.update=()=>{t.$$.dirty&8192&&n(8,r=o),t.$$.dirty&256&&Object.assign(r,$)},[g,f,c,m,p,d,_,v,r,u,h,k,s,o,a,l,C,F,R,K,M,D,I,O,L,W]}class vi extends ve{constructor(e){super(),ye(this,e,zp,Qp,fe,{transition:1,transitionConfig:2,inTransition:3,inTransitionConfig:4,outTransition:5,outTransitionConfig:6,asChild:7,el:0})}}const Gp=t=>({builder:t&4}),Rl=t=>({builder:t[2]}),Yp=t=>({builder:t&4}),Dl=t=>({builder:t[2]});function Zp(t){let e,n,r,i;const s=t[8].default,o=de(s,t,t[7],Rl);let u=[t[2],{type:"button"},t[5]],l={};for(let a=0;a<u.length;a+=1)l=ne(l,u[a]);return{c(){e=S("button"),o&&o.c(),ie(e,l)},m(a,f){w(a,e,f),o&&o.m(e,null),e.autofocus&&e.focus(),t[9](e),n=!0,r||(i=[Ue(t[2].action(e)),G(e,"m-click",t[4]),G(e,"m-keydown",t[4])],r=!0)},p(a,f){o&&o.p&&(!n||f&132)&&pe(o,s,a,a[7],n?me(s,a[7],f,Gp):he(a[7]),Rl),ie(e,l=Me(u,[f&4&&a[2],{type:"button"},f&32&&a[5]]))},i(a){n||(b(o,a),n=!0)},o(a){y(o,a),n=!1},d(a){a&&E(e),o&&o.d(a),t[9](null),r=!1,Te(i)}}}function Xp(t){let e;const n=t[8].default,r=de(n,t,t[7],Dl);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,s){r&&r.p&&(!e||s&132)&&pe(r,n,i,i[7],e?me(n,i[7],s,Yp):he(i[7]),Dl)},i(i){e||(b(r,i),e=!0)},o(i){y(r,i),e=!1},d(i){r&&r.d(i)}}}function Jp(t){let e,n,r,i;const s=[Xp,Zp],o=[];function u(l,a){return l[1]?0:1}return e=u(t),n=o[e]=s[e](t),{c(){n.c(),r=Se()},m(l,a){o[e].m(l,a),w(l,r,a),i=!0},p(l,[a]){let f=e;e=u(l),e===f?o[e].p(l,a):(_e(),y(o[f],1,1,()=>{o[f]=null}),ge(),n=o[e],n?n.p(l,a):(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r))},i(l){i||(b(n),i=!0)},o(l){y(n),i=!1},d(l){l&&E(r),o[e].d(l)}}}function xp(t,e,n){let r;const i=["asChild","el"];let s=Ke(e,i),o,{$$slots:u={},$$scope:l}=e,{asChild:a=!1}=e,{el:f=void 0}=e;const{elements:{trigger:c},getAttrs:m}=Lr();x(t,c,v=>n(6,o=v));const p=Pn(),d=m("trigger");function _(v){Ce[v?"unshift":"push"](()=>{f=v,n(0,f)})}return t.$$set=v=>{e=ne(ne({},e),yt(v)),n(5,s=Ke(e,i)),"asChild"in v&&n(1,a=v.asChild),"el"in v&&n(0,f=v.el),"$$scope"in v&&n(7,l=v.$$scope)},t.$$.update=()=>{t.$$.dirty&64&&n(2,r=o),t.$$.dirty&4&&Object.assign(r,d)},[f,a,r,c,p,s,o,l,u,_]}class ki extends ve{constructor(e){super(),ye(this,e,xp,Jp,fe,{asChild:1,el:0})}}const eh=t=>({builder:t[0]&256}),Fl=t=>({builder:t[8]}),th=t=>({builder:t[0]&256}),Pl=t=>({builder:t[8]}),nh=t=>({builder:t[0]&256}),Ll=t=>({builder:t[8]}),rh=t=>({builder:t[0]&256}),Il=t=>({builder:t[8]}),ih=t=>({builder:t[0]&256}),Ml=t=>({builder:t[8]}),sh=t=>({builder:t[0]&256}),Nl=t=>({builder:t[8]});function oh(t){let e,n,r,i;const s=t[28].default,o=de(s,t,t[27],Fl);let u=[t[8],t[13]],l={};for(let a=0;a<u.length;a+=1)l=ne(l,u[a]);return{c(){e=S("div"),o&&o.c(),ie(e,l)},m(a,f){w(a,e,f),o&&o.m(e,null),t[33](e),n=!0,r||(i=[Ue(t[8].action(e)),G(e,"m-keydown",t[12])],r=!0)},p(a,f){o&&o.p&&(!n||f[0]&134217984)&&pe(o,s,a,a[27],n?me(s,a[27],f,eh):he(a[27]),Fl),ie(e,l=Me(u,[f[0]&256&&a[8],f[0]&8192&&a[13]]))},i(a){n||(b(o,a),n=!0)},o(a){y(o,a),n=!1},d(a){a&&E(e),o&&o.d(a),t[33](null),r=!1,Te(i)}}}function lh(t){let e,n,r,i,s;const o=t[28].default,u=de(o,t,t[27],Pl);let l=[t[8],t[13]],a={};for(let f=0;f<l.length;f+=1)a=ne(a,l[f]);return{c(){e=S("div"),u&&u.c(),ie(e,a)},m(f,c){w(f,e,c),u&&u.m(e,null),t[32](e),r=!0,i||(s=[Ue(t[8].action(e)),G(e,"m-keydown",t[12])],i=!0)},p(f,c){t=f,u&&u.p&&(!r||c[0]&134217984)&&pe(u,o,t,t[27],r?me(o,t[27],c,th):he(t[27]),Pl),ie(e,a=Me(l,[c[0]&256&&t[8],c[0]&8192&&t[13]]))},i(f){r||(b(u,f),n&&n.end(1),r=!0)},o(f){y(u,f),f&&(n=Fn(e,t[5],t[6])),r=!1},d(f){f&&E(e),u&&u.d(f),t[32](null),f&&n&&n.end(),i=!1,Te(s)}}}function uh(t){let e,n,r,i,s;const o=t[28].default,u=de(o,t,t[27],Ll);let l=[t[8],t[13]],a={};for(let f=0;f<l.length;f+=1)a=ne(a,l[f]);return{c(){e=S("div"),u&&u.c(),ie(e,a)},m(f,c){w(f,e,c),u&&u.m(e,null),t[31](e),r=!0,i||(s=[Ue(t[8].action(e)),G(e,"m-keydown",t[12])],i=!0)},p(f,c){t=f,u&&u.p&&(!r||c[0]&134217984)&&pe(u,o,t,t[27],r?me(o,t[27],c,nh):he(t[27]),Ll),ie(e,a=Me(l,[c[0]&256&&t[8],c[0]&8192&&t[13]]))},i(f){r||(b(u,f),f&&(n||at(()=>{n=Dn(e,t[3],t[4]),n.start()})),r=!0)},o(f){y(u,f),r=!1},d(f){f&&E(e),u&&u.d(f),t[31](null),i=!1,Te(s)}}}function ah(t){let e,n,r,i,s,o;const u=t[28].default,l=de(u,t,t[27],Il);let a=[t[8],t[13]],f={};for(let c=0;c<a.length;c+=1)f=ne(f,a[c]);return{c(){e=S("div"),l&&l.c(),ie(e,f)},m(c,m){w(c,e,m),l&&l.m(e,null),t[30](e),i=!0,s||(o=[Ue(t[8].action(e)),G(e,"m-keydown",t[12])],s=!0)},p(c,m){t=c,l&&l.p&&(!i||m[0]&134217984)&&pe(l,u,t,t[27],i?me(u,t[27],m,rh):he(t[27]),Il),ie(e,f=Me(a,[m[0]&256&&t[8],m[0]&8192&&t[13]]))},i(c){i||(b(l,c),c&&at(()=>{i&&(r&&r.end(1),n=Dn(e,t[3],t[4]),n.start())}),i=!0)},o(c){y(l,c),n&&n.invalidate(),c&&(r=Fn(e,t[5],t[6])),i=!1},d(c){c&&E(e),l&&l.d(c),t[30](null),c&&r&&r.end(),s=!1,Te(o)}}}function fh(t){let e,n,r,i,s;const o=t[28].default,u=de(o,t,t[27],Ml);let l=[t[8],t[13]],a={};for(let f=0;f<l.length;f+=1)a=ne(a,l[f]);return{c(){e=S("div"),u&&u.c(),ie(e,a)},m(f,c){w(f,e,c),u&&u.m(e,null),t[29](e),r=!0,i||(s=[Ue(t[8].action(e)),G(e,"m-keydown",t[12])],i=!0)},p(f,c){t=f,u&&u.p&&(!r||c[0]&134217984)&&pe(u,o,t,t[27],r?me(o,t[27],c,ih):he(t[27]),Ml),ie(e,a=Me(l,[c[0]&256&&t[8],c[0]&8192&&t[13]]))},i(f){r||(b(u,f),f&&at(()=>{r&&(n||(n=Tn(e,t[1],t[2],!0)),n.run(1))}),r=!0)},o(f){y(u,f),f&&(n||(n=Tn(e,t[1],t[2],!1)),n.run(0)),r=!1},d(f){f&&E(e),u&&u.d(f),t[29](null),f&&n&&n.end(),i=!1,Te(s)}}}function ch(t){let e;const n=t[28].default,r=de(n,t,t[27],Nl);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,s){r&&r.p&&(!e||s[0]&134217984)&&pe(r,n,i,i[27],e?me(n,i[27],s,sh):he(i[27]),Nl)},i(i){e||(b(r,i),e=!0)},o(i){y(r,i),e=!1},d(i){r&&r.d(i)}}}function dh(t){let e,n,r,i;const s=[ch,fh,ah,uh,lh,oh],o=[];function u(l,a){return l[7]&&l[9]?0:l[1]&&l[9]?1:l[3]&&l[5]&&l[9]?2:l[3]&&l[9]?3:l[5]&&l[9]?4:l[9]?5:-1}return~(e=u(t))&&(n=o[e]=s[e](t)),{c(){n&&n.c(),r=Se()},m(l,a){~e&&o[e].m(l,a),w(l,r,a),i=!0},p(l,a){let f=e;e=u(l),e===f?~e&&o[e].p(l,a):(n&&(_e(),y(o[f],1,1,()=>{o[f]=null}),ge()),~e?(n=o[e],n?n.p(l,a):(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r)):n=null)},i(l){i||(b(n),i=!0)},o(l){y(n),i=!1},d(l){l&&E(r),~e&&o[e].d(l)}}}function mh(t,e,n){let r;const i=["transition","transitionConfig","inTransition","inTransitionConfig","outTransition","outTransitionConfig","asChild","id","side","align","sideOffset","alignOffset","collisionPadding","avoidCollisions","collisionBoundary","sameWidth","fitViewport","strategy","overlap","el"];let s=Ke(e,i),o,u,{$$slots:l={},$$scope:a}=e,{transition:f=void 0}=e,{transitionConfig:c=void 0}=e,{inTransition:m=void 0}=e,{inTransitionConfig:p=void 0}=e,{outTransition:d=void 0}=e,{outTransitionConfig:_=void 0}=e,{asChild:v=!1}=e,{id:g=void 0}=e,{side:h="bottom"}=e,{align:k="center"}=e,{sideOffset:A=0}=e,{alignOffset:$=0}=e,{collisionPadding:C=8}=e,{avoidCollisions:F=!0}=e,{collisionBoundary:R=void 0}=e,{sameWidth:K=!1}=e,{fitViewport:M=!1}=e,{strategy:D="absolute"}=e,{overlap:I=!1}=e,{el:O=void 0}=e;const{elements:{menu:L},states:{open:W},ids:q,getAttrs:oe}=gi();x(t,L,X=>n(26,u=X)),x(t,W,X=>n(9,o=X));const se=Pn(),z=oe("content");function le(X){Ce[X?"unshift":"push"](()=>{O=X,n(0,O)})}function Re(X){Ce[X?"unshift":"push"](()=>{O=X,n(0,O)})}function st(X){Ce[X?"unshift":"push"](()=>{O=X,n(0,O)})}function He(X){Ce[X?"unshift":"push"](()=>{O=X,n(0,O)})}function Y(X){Ce[X?"unshift":"push"](()=>{O=X,n(0,O)})}return t.$$set=X=>{e=ne(ne({},e),yt(X)),n(13,s=Ke(e,i)),"transition"in X&&n(1,f=X.transition),"transitionConfig"in X&&n(2,c=X.transitionConfig),"inTransition"in X&&n(3,m=X.inTransition),"inTransitionConfig"in X&&n(4,p=X.inTransitionConfig),"outTransition"in X&&n(5,d=X.outTransition),"outTransitionConfig"in X&&n(6,_=X.outTransitionConfig),"asChild"in X&&n(7,v=X.asChild),"id"in X&&n(14,g=X.id),"side"in X&&n(15,h=X.side),"align"in X&&n(16,k=X.align),"sideOffset"in X&&n(17,A=X.sideOffset),"alignOffset"in X&&n(18,$=X.alignOffset),"collisionPadding"in X&&n(19,C=X.collisionPadding),"avoidCollisions"in X&&n(20,F=X.avoidCollisions),"collisionBoundary"in X&&n(21,R=X.collisionBoundary),"sameWidth"in X&&n(22,K=X.sameWidth),"fitViewport"in X&&n(23,M=X.fitViewport),"strategy"in X&&n(24,D=X.strategy),"overlap"in X&&n(25,I=X.overlap),"el"in X&&n(0,O=X.el),"$$scope"in X&&n(27,a=X.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&16384&&g&&q.menu.set(g),t.$$.dirty[0]&67108864&&n(8,r=u),t.$$.dirty[0]&256&&Object.assign(r,z),t.$$.dirty[0]&67076608&&o&&Sm({side:h,align:k,sideOffset:A,alignOffset:$,collisionPadding:C,avoidCollisions:F,collisionBoundary:R,sameWidth:K,fitViewport:M,strategy:D,overlap:I})},[O,f,c,m,p,d,_,v,r,o,L,W,se,s,g,h,k,A,$,C,F,R,K,M,D,I,u,a,l,le,Re,st,He,Y]}class fs extends ve{constructor(e){super(),ye(this,e,mh,dh,fe,{transition:1,transitionConfig:2,inTransition:3,inTransitionConfig:4,outTransition:5,outTransitionConfig:6,asChild:7,id:14,side:15,align:16,sideOffset:17,alignOffset:18,collisionPadding:19,avoidCollisions:20,collisionBoundary:21,sameWidth:22,fitViewport:23,strategy:24,overlap:25,el:0},null,[-1,-1])}}function cs(){return{NAME:"menubar",MENU_NAME:"menu",SUB_NAME:"menu-submenu",PARTS:["arrow","checkbox-indicator","checkbox-item","content","group","item","label","radio-group","radio-item","separator","sub-content","sub-trigger","trigger"]}}function ph(t){const{NAME:e,PARTS:n,MENU_NAME:r}=cs(),i=ii(e,["root"]),s=ii(r,n),o={..._m(hi(t)),getAttrs:s,getMenubarAttrs:i};return At(e,o),{...o,updateOption:_i(o.options)}}function hh(){const{NAME:t}=cs();return bt(t)}function _h(t){const{MENU_NAME:e}=cs(),{builders:{createMenu:n},getAttrs:r}=hh(),i={...n({...hi(t),forceVisible:!1}),getAttrs:r};return At(e,i),{...i,updateOption:_i(i.options)}}function gh(){const{MENU_NAME:t}=cs();return bt(t)}const bh=t=>({builder:t&4,ids:t&8}),Hl=t=>({builder:t[2],ids:t[3]}),yh=t=>({builder:t&4,ids:t&8}),Vl=t=>({builder:t[2],ids:t[3]});function vh(t){let e,n,r,i;const s=t[13].default,o=de(s,t,t[12],Hl);let u=[t[2],t[6]],l={};for(let a=0;a<u.length;a+=1)l=ne(l,u[a]);return{c(){e=S("div"),o&&o.c(),ie(e,l)},m(a,f){w(a,e,f),o&&o.m(e,null),t[14](e),n=!0,r||(i=Ue(t[2].action(e)),r=!0)},p(a,f){o&&o.p&&(!n||f&4108)&&pe(o,s,a,a[12],n?me(s,a[12],f,bh):he(a[12]),Hl),ie(e,l=Me(u,[f&4&&a[2],f&64&&a[6]]))},i(a){n||(b(o,a),n=!0)},o(a){y(o,a),n=!1},d(a){a&&E(e),o&&o.d(a),t[14](null),r=!1,i()}}}function kh(t){let e;const n=t[13].default,r=de(n,t,t[12],Vl);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,s){r&&r.p&&(!e||s&4108)&&pe(r,n,i,i[12],e?me(n,i[12],s,yh):he(i[12]),Vl)},i(i){e||(b(r,i),e=!0)},o(i){y(r,i),e=!1},d(i){r&&r.d(i)}}}function Ch(t){let e,n,r,i;const s=[kh,vh],o=[];function u(l,a){return l[1]?0:1}return e=u(t),n=o[e]=s[e](t),{c(){n.c(),r=Se()},m(l,a){o[e].m(l,a),w(l,r,a),i=!0},p(l,[a]){let f=e;e=u(l),e===f?o[e].p(l,a):(_e(),y(o[f],1,1,()=>{o[f]=null}),ge(),n=o[e],n?n.p(l,a):(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r))},i(l){i||(b(n),i=!0)},o(l){y(n),i=!1},d(l){l&&E(r),o[e].d(l)}}}function Eh(t,e,n){let r;const i=["loop","closeOnEscape","asChild","id","preventScroll","el"];let s=Ke(e,i),o,u,{$$slots:l={},$$scope:a}=e,{loop:f=!0}=e,{closeOnEscape:c=!0}=e,{asChild:m=!1}=e,{id:p=void 0}=e,{preventScroll:d=void 0}=e,{el:_=void 0}=e;const{elements:{menubar:v},updateOption:g,ids:h,getMenubarAttrs:k}=ph({loop:f,closeOnEscape:c,preventScroll:d});x(t,v,F=>n(11,o=F));const A=ze([h.menubar],([F])=>({menubar:F}));x(t,A,F=>n(3,u=F));const $=k("root");function C(F){Ce[F?"unshift":"push"](()=>{_=F,n(0,_)})}return t.$$set=F=>{e=ne(ne({},e),yt(F)),n(6,s=Ke(e,i)),"loop"in F&&n(7,f=F.loop),"closeOnEscape"in F&&n(8,c=F.closeOnEscape),"asChild"in F&&n(1,m=F.asChild),"id"in F&&n(9,p=F.id),"preventScroll"in F&&n(10,d=F.preventScroll),"el"in F&&n(0,_=F.el),"$$scope"in F&&n(12,a=F.$$scope)},t.$$.update=()=>{t.$$.dirty&512&&p&&h.menubar.set(p),t.$$.dirty&128&&g("loop",f),t.$$.dirty&256&&g("closeOnEscape",c),t.$$.dirty&1024&&g("preventScroll",d),t.$$.dirty&2048&&n(2,r=o),t.$$.dirty&4&&Object.assign(r,$)},[_,m,r,u,v,A,s,f,c,p,d,o,a,l,C]}class wh extends ve{constructor(e){super(),ye(this,e,Eh,Ch,fe,{loop:7,closeOnEscape:8,asChild:1,id:9,preventScroll:10,el:0})}}const Oh=t=>({menuIds:t&1}),Ul=t=>({menuIds:t[0]});function Ah(t){let e;const n=t[15].default,r=de(n,t,t[14],Ul);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,[s]){r&&r.p&&(!e||s&16385)&&pe(r,n,i,i[14],e?me(n,i[14],s,Oh):he(i[14]),Ul)},i(i){e||(b(r,i),e=!0)},o(i){y(r,i),e=!1},d(i){r&&r.d(i)}}}function Th(t,e,n){let r,{$$slots:i={},$$scope:s}=e,{closeOnOutsideClick:o=void 0}=e,{closeOnEscape:u=void 0}=e,{portal:l=void 0}=e,{open:a=void 0}=e,{onOpenChange:f=void 0}=e,{loop:c=void 0}=e,{dir:m=void 0}=e,{typeahead:p=void 0}=e,{closeFocus:d=void 0}=e,{disableFocusFirstItem:_=void 0}=e,{closeOnItemClick:v=void 0}=e,{onOutsideClick:g=void 0}=e;const{states:{open:h},updateOption:k,ids:A}=_h({closeOnOutsideClick:o,closeOnEscape:u,portal:l,loop:c,dir:m,typeahead:p,closeFocus:d,disableFocusFirstItem:_,closeOnItemClick:v,onOutsideClick:g,onOpenChange:({next:C})=>(a!==C&&(f==null||f(C),n(2,a=C)),C)}),$=ze([A.menu,A.trigger],([C,F])=>({menu:C,trigger:F}));return x(t,$,C=>n(0,r=C)),t.$$set=C=>{"closeOnOutsideClick"in C&&n(3,o=C.closeOnOutsideClick),"closeOnEscape"in C&&n(4,u=C.closeOnEscape),"portal"in C&&n(5,l=C.portal),"open"in C&&n(2,a=C.open),"onOpenChange"in C&&n(6,f=C.onOpenChange),"loop"in C&&n(7,c=C.loop),"dir"in C&&n(8,m=C.dir),"typeahead"in C&&n(9,p=C.typeahead),"closeFocus"in C&&n(10,d=C.closeFocus),"disableFocusFirstItem"in C&&n(11,_=C.disableFocusFirstItem),"closeOnItemClick"in C&&n(12,v=C.closeOnItemClick),"onOutsideClick"in C&&n(13,g=C.onOutsideClick),"$$scope"in C&&n(14,s=C.$$scope)},t.$$.update=()=>{t.$$.dirty&4&&a!==void 0&&h.set(a),t.$$.dirty&8&&k("closeOnOutsideClick",o),t.$$.dirty&16&&k("closeOnEscape",u),t.$$.dirty&32&&k("portal",l),t.$$.dirty&128&&k("loop",c),t.$$.dirty&256&&k("dir",m),t.$$.dirty&1024&&k("closeFocus",d),t.$$.dirty&2048&&k("disableFocusFirstItem",_),t.$$.dirty&512&&k("typeahead",p),t.$$.dirty&4096&&k("closeOnItemClick",v),t.$$.dirty&8192&&k("onOutsideClick",g)},[r,$,a,o,u,l,f,c,m,p,d,_,v,g,s,i]}class ds extends ve{constructor(e){super(),ye(this,e,Th,Ah,fe,{closeOnOutsideClick:3,closeOnEscape:4,portal:5,open:2,onOpenChange:6,loop:7,dir:8,typeahead:9,closeFocus:10,disableFocusFirstItem:11,closeOnItemClick:12,onOutsideClick:13})}}const $h=t=>({builder:t&4}),Bl=t=>({builder:t[2]}),Sh=t=>({builder:t&4}),Kl=t=>({builder:t[2]});function Rh(t){let e,n,r,i;const s=t[9].default,o=de(s,t,t[8],Bl);let u=[t[2],{type:"button"},t[5]],l={};for(let a=0;a<u.length;a+=1)l=ne(l,u[a]);return{c(){e=S("button"),o&&o.c(),ie(e,l)},m(a,f){w(a,e,f),o&&o.m(e,null),e.autofocus&&e.focus(),t[10](e),n=!0,r||(i=[Ue(t[2].action(e)),G(e,"m-click",t[4]),G(e,"m-keydown",t[4]),G(e,"m-pointerenter",t[4])],r=!0)},p(a,f){o&&o.p&&(!n||f&260)&&pe(o,s,a,a[8],n?me(s,a[8],f,$h):he(a[8]),Bl),ie(e,l=Me(u,[f&4&&a[2],{type:"button"},f&32&&a[5]]))},i(a){n||(b(o,a),n=!0)},o(a){y(o,a),n=!1},d(a){a&&E(e),o&&o.d(a),t[10](null),r=!1,Te(i)}}}function Dh(t){let e;const n=t[9].default,r=de(n,t,t[8],Kl);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,s){r&&r.p&&(!e||s&260)&&pe(r,n,i,i[8],e?me(n,i[8],s,Sh):he(i[8]),Kl)},i(i){e||(b(r,i),e=!0)},o(i){y(r,i),e=!1},d(i){r&&r.d(i)}}}function Fh(t){let e,n,r,i;const s=[Dh,Rh],o=[];function u(l,a){return l[1]?0:1}return e=u(t),n=o[e]=s[e](t),{c(){n.c(),r=Se()},m(l,a){o[e].m(l,a),w(l,r,a),i=!0},p(l,[a]){let f=e;e=u(l),e===f?o[e].p(l,a):(_e(),y(o[f],1,1,()=>{o[f]=null}),ge(),n=o[e],n?n.p(l,a):(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r))},i(l){i||(b(n),i=!0)},o(l){y(n),i=!1},d(l){l&&E(r),o[e].d(l)}}}function Ph(t,e,n){let r;const i=["asChild","id","el"];let s=Ke(e,i),o,{$$slots:u={},$$scope:l}=e,{asChild:a=!1}=e,{id:f=void 0}=e,{el:c=void 0}=e;const{elements:{trigger:m},ids:p,getAttrs:d}=gh();x(t,m,h=>n(7,o=h));const _=Pn(),v=d("trigger");function g(h){Ce[h?"unshift":"push"](()=>{c=h,n(0,c)})}return t.$$set=h=>{e=ne(ne({},e),yt(h)),n(5,s=Ke(e,i)),"asChild"in h&&n(1,a=h.asChild),"id"in h&&n(6,f=h.id),"el"in h&&n(0,c=h.el),"$$scope"in h&&n(8,l=h.$$scope)},t.$$.update=()=>{t.$$.dirty&64&&f&&p.trigger.set(f),t.$$.dirty&128&&n(2,r=o),t.$$.dirty&4&&Object.assign(r,v)},[c,a,r,m,_,s,f,o,l,u,g]}class ms extends ve{constructor(e){super(),ye(this,e,Ph,Fh,fe,{asChild:1,id:6,el:0})}}const Lh=t=>({ids:t&1}),jl=t=>({ids:t[0]});function Ih(t){let e;const n=t[13].default,r=de(n,t,t[12],jl);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,[s]){r&&r.p&&(!e||s&4097)&&pe(r,n,i,i[12],e?me(n,i[12],s,Lh):he(i[12]),jl)},i(i){e||(b(r,i),e=!0)},o(i){y(r,i),e=!1},d(i){r&&r.d(i)}}}function Mh(t,e,n){let r,{$$slots:i={},$$scope:s}=e,{disableFocusTrap:o=void 0}=e,{closeOnEscape:u=void 0}=e,{closeOnOutsideClick:l=void 0}=e,{preventScroll:a=void 0}=e,{portal:f=void 0}=e,{open:c=void 0}=e,{onOpenChange:m=void 0}=e,{openFocus:p=void 0}=e,{closeFocus:d=void 0}=e,{onOutsideClick:_=void 0}=e;const{updateOption:v,states:{open:g},ids:h}=tp({disableFocusTrap:o,closeOnEscape:u,closeOnOutsideClick:l,preventScroll:a,portal:f,defaultOpen:c,openFocus:p,closeFocus:d,onOutsideClick:_,onOpenChange:({next:A})=>(c!==A&&(m==null||m(A),n(2,c=A)),A),positioning:{gutter:0,offset:{mainAxis:1}}}),k=ze([h.content,h.trigger],([A,$])=>({content:A,trigger:$}));return x(t,k,A=>n(0,r=A)),t.$$set=A=>{"disableFocusTrap"in A&&n(3,o=A.disableFocusTrap),"closeOnEscape"in A&&n(4,u=A.closeOnEscape),"closeOnOutsideClick"in A&&n(5,l=A.closeOnOutsideClick),"preventScroll"in A&&n(6,a=A.preventScroll),"portal"in A&&n(7,f=A.portal),"open"in A&&n(2,c=A.open),"onOpenChange"in A&&n(8,m=A.onOpenChange),"openFocus"in A&&n(9,p=A.openFocus),"closeFocus"in A&&n(10,d=A.closeFocus),"onOutsideClick"in A&&n(11,_=A.onOutsideClick),"$$scope"in A&&n(12,s=A.$$scope)},t.$$.update=()=>{t.$$.dirty&4&&c!==void 0&&g.set(c),t.$$.dirty&8&&v("disableFocusTrap",o),t.$$.dirty&16&&v("closeOnEscape",u),t.$$.dirty&32&&v("closeOnOutsideClick",l),t.$$.dirty&64&&v("preventScroll",a),t.$$.dirty&128&&v("portal",f),t.$$.dirty&512&&v("openFocus",p),t.$$.dirty&1024&&v("closeFocus",d),t.$$.dirty&2048&&v("onOutsideClick",_)},[r,k,c,o,u,l,a,f,m,p,d,_,s,i]}class Nh extends ve{constructor(e){super(),ye(this,e,Mh,Ih,fe,{disableFocusTrap:3,closeOnEscape:4,closeOnOutsideClick:5,preventScroll:6,portal:7,open:2,onOpenChange:8,openFocus:9,closeFocus:10,onOutsideClick:11})}}const Hh=t=>({builder:t[0]&256}),Wl=t=>({builder:t[8]}),Vh=t=>({builder:t[0]&256}),ql=t=>({builder:t[8]}),Uh=t=>({builder:t[0]&256}),Ql=t=>({builder:t[8]}),Bh=t=>({builder:t[0]&256}),zl=t=>({builder:t[8]}),Kh=t=>({builder:t[0]&256}),Gl=t=>({builder:t[8]}),jh=t=>({builder:t[0]&256}),Yl=t=>({builder:t[8]});function Wh(t){let e,n,r,i;const s=t[27].default,o=de(s,t,t[26],Wl);let u=[t[8],t[12]],l={};for(let a=0;a<u.length;a+=1)l=ne(l,u[a]);return{c(){e=S("div"),o&&o.c(),ie(e,l)},m(a,f){w(a,e,f),o&&o.m(e,null),t[32](e),n=!0,r||(i=Ue(t[8].action(e)),r=!0)},p(a,f){o&&o.p&&(!n||f[0]&67109120)&&pe(o,s,a,a[26],n?me(s,a[26],f,Hh):he(a[26]),Wl),ie(e,l=Me(u,[f[0]&256&&a[8],f[0]&4096&&a[12]]))},i(a){n||(b(o,a),n=!0)},o(a){y(o,a),n=!1},d(a){a&&E(e),o&&o.d(a),t[32](null),r=!1,i()}}}function qh(t){let e,n,r,i,s;const o=t[27].default,u=de(o,t,t[26],ql);let l=[t[8],t[12]],a={};for(let f=0;f<l.length;f+=1)a=ne(a,l[f]);return{c(){e=S("div"),u&&u.c(),ie(e,a)},m(f,c){w(f,e,c),u&&u.m(e,null),t[31](e),r=!0,i||(s=Ue(t[8].action(e)),i=!0)},p(f,c){t=f,u&&u.p&&(!r||c[0]&67109120)&&pe(u,o,t,t[26],r?me(o,t[26],c,Vh):he(t[26]),ql),ie(e,a=Me(l,[c[0]&256&&t[8],c[0]&4096&&t[12]]))},i(f){r||(b(u,f),n&&n.end(1),r=!0)},o(f){y(u,f),f&&(n=Fn(e,t[5],t[6])),r=!1},d(f){f&&E(e),u&&u.d(f),t[31](null),f&&n&&n.end(),i=!1,s()}}}function Qh(t){let e,n,r,i,s;const o=t[27].default,u=de(o,t,t[26],Ql);let l=[t[8],t[12]],a={};for(let f=0;f<l.length;f+=1)a=ne(a,l[f]);return{c(){e=S("div"),u&&u.c(),ie(e,a)},m(f,c){w(f,e,c),u&&u.m(e,null),t[30](e),r=!0,i||(s=Ue(t[8].action(e)),i=!0)},p(f,c){t=f,u&&u.p&&(!r||c[0]&67109120)&&pe(u,o,t,t[26],r?me(o,t[26],c,Uh):he(t[26]),Ql),ie(e,a=Me(l,[c[0]&256&&t[8],c[0]&4096&&t[12]]))},i(f){r||(b(u,f),f&&(n||at(()=>{n=Dn(e,t[3],t[4]),n.start()})),r=!0)},o(f){y(u,f),r=!1},d(f){f&&E(e),u&&u.d(f),t[30](null),i=!1,s()}}}function zh(t){let e,n,r,i,s,o;const u=t[27].default,l=de(u,t,t[26],zl);let a=[t[8],t[12]],f={};for(let c=0;c<a.length;c+=1)f=ne(f,a[c]);return{c(){e=S("div"),l&&l.c(),ie(e,f)},m(c,m){w(c,e,m),l&&l.m(e,null),t[29](e),i=!0,s||(o=Ue(t[8].action(e)),s=!0)},p(c,m){t=c,l&&l.p&&(!i||m[0]&67109120)&&pe(l,u,t,t[26],i?me(u,t[26],m,Bh):he(t[26]),zl),ie(e,f=Me(a,[m[0]&256&&t[8],m[0]&4096&&t[12]]))},i(c){i||(b(l,c),c&&at(()=>{i&&(r&&r.end(1),n=Dn(e,t[3],t[4]),n.start())}),i=!0)},o(c){y(l,c),n&&n.invalidate(),c&&(r=Fn(e,t[5],t[6])),i=!1},d(c){c&&E(e),l&&l.d(c),t[29](null),c&&r&&r.end(),s=!1,o()}}}function Gh(t){let e,n,r,i,s;const o=t[27].default,u=de(o,t,t[26],Gl);let l=[t[8],t[12]],a={};for(let f=0;f<l.length;f+=1)a=ne(a,l[f]);return{c(){e=S("div"),u&&u.c(),ie(e,a)},m(f,c){w(f,e,c),u&&u.m(e,null),t[28](e),r=!0,i||(s=Ue(t[8].action(e)),i=!0)},p(f,c){t=f,u&&u.p&&(!r||c[0]&67109120)&&pe(u,o,t,t[26],r?me(o,t[26],c,Kh):he(t[26]),Gl),ie(e,a=Me(l,[c[0]&256&&t[8],c[0]&4096&&t[12]]))},i(f){r||(b(u,f),f&&at(()=>{r&&(n||(n=Tn(e,t[1],t[2],!0)),n.run(1))}),r=!0)},o(f){y(u,f),f&&(n||(n=Tn(e,t[1],t[2],!1)),n.run(0)),r=!1},d(f){f&&E(e),u&&u.d(f),t[28](null),f&&n&&n.end(),i=!1,s()}}}function Yh(t){let e;const n=t[27].default,r=de(n,t,t[26],Yl);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,s){r&&r.p&&(!e||s[0]&67109120)&&pe(r,n,i,i[26],e?me(n,i[26],s,jh):he(i[26]),Yl)},i(i){e||(b(r,i),e=!0)},o(i){y(r,i),e=!1},d(i){r&&r.d(i)}}}function Zh(t){let e,n,r,i;const s=[Yh,Gh,zh,Qh,qh,Wh],o=[];function u(l,a){return l[7]&&l[9]?0:l[1]&&l[9]?1:l[3]&&l[5]&&l[9]?2:l[3]&&l[9]?3:l[5]&&l[9]?4:l[9]?5:-1}return~(e=u(t))&&(n=o[e]=s[e](t)),{c(){n&&n.c(),r=Se()},m(l,a){~e&&o[e].m(l,a),w(l,r,a),i=!0},p(l,a){let f=e;e=u(l),e===f?~e&&o[e].p(l,a):(n&&(_e(),y(o[f],1,1,()=>{o[f]=null}),ge()),~e?(n=o[e],n?n.p(l,a):(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r)):n=null)},i(l){i||(b(n),i=!0)},o(l){y(n),i=!1},d(l){l&&E(r),~e&&o[e].d(l)}}}function Xh(t,e,n){let r;const i=["transition","transitionConfig","inTransition","inTransitionConfig","outTransition","outTransitionConfig","asChild","id","side","align","sideOffset","alignOffset","collisionPadding","avoidCollisions","collisionBoundary","sameWidth","fitViewport","strategy","overlap","el"];let s=Ke(e,i),o,u,{$$slots:l={},$$scope:a}=e,{transition:f=void 0}=e,{transitionConfig:c=void 0}=e,{inTransition:m=void 0}=e,{inTransitionConfig:p=void 0}=e,{outTransition:d=void 0}=e,{outTransitionConfig:_=void 0}=e,{asChild:v=!1}=e,{id:g=void 0}=e,{side:h="bottom"}=e,{align:k="center"}=e,{sideOffset:A=0}=e,{alignOffset:$=0}=e,{collisionPadding:C=8}=e,{avoidCollisions:F=!0}=e,{collisionBoundary:R=void 0}=e,{sameWidth:K=!1}=e,{fitViewport:M=!1}=e,{strategy:D="absolute"}=e,{overlap:I=!1}=e,{el:O=void 0}=e;const{elements:{content:L},states:{open:W},ids:q,getAttrs:oe}=Oo();x(t,L,Y=>n(25,u=Y)),x(t,W,Y=>n(9,o=Y));const se=oe("content");function z(Y){Ce[Y?"unshift":"push"](()=>{O=Y,n(0,O)})}function le(Y){Ce[Y?"unshift":"push"](()=>{O=Y,n(0,O)})}function Re(Y){Ce[Y?"unshift":"push"](()=>{O=Y,n(0,O)})}function st(Y){Ce[Y?"unshift":"push"](()=>{O=Y,n(0,O)})}function He(Y){Ce[Y?"unshift":"push"](()=>{O=Y,n(0,O)})}return t.$$set=Y=>{e=ne(ne({},e),yt(Y)),n(12,s=Ke(e,i)),"transition"in Y&&n(1,f=Y.transition),"transitionConfig"in Y&&n(2,c=Y.transitionConfig),"inTransition"in Y&&n(3,m=Y.inTransition),"inTransitionConfig"in Y&&n(4,p=Y.inTransitionConfig),"outTransition"in Y&&n(5,d=Y.outTransition),"outTransitionConfig"in Y&&n(6,_=Y.outTransitionConfig),"asChild"in Y&&n(7,v=Y.asChild),"id"in Y&&n(13,g=Y.id),"side"in Y&&n(14,h=Y.side),"align"in Y&&n(15,k=Y.align),"sideOffset"in Y&&n(16,A=Y.sideOffset),"alignOffset"in Y&&n(17,$=Y.alignOffset),"collisionPadding"in Y&&n(18,C=Y.collisionPadding),"avoidCollisions"in Y&&n(19,F=Y.avoidCollisions),"collisionBoundary"in Y&&n(20,R=Y.collisionBoundary),"sameWidth"in Y&&n(21,K=Y.sameWidth),"fitViewport"in Y&&n(22,M=Y.fitViewport),"strategy"in Y&&n(23,D=Y.strategy),"overlap"in Y&&n(24,I=Y.overlap),"el"in Y&&n(0,O=Y.el),"$$scope"in Y&&n(26,a=Y.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&8192&&g&&q.content.set(g),t.$$.dirty[0]&33554432&&n(8,r=u),t.$$.dirty[0]&256&&Object.assign(r,se),t.$$.dirty[0]&33538560&&o&&np({side:h,align:k,sideOffset:A,alignOffset:$,collisionPadding:C,avoidCollisions:F,collisionBoundary:R,sameWidth:K,fitViewport:M,strategy:D,overlap:I})},[O,f,c,m,p,d,_,v,r,o,L,W,s,g,h,k,A,$,C,F,R,K,M,D,I,u,a,l,z,le,Re,st,He]}class Jh extends ve{constructor(e){super(),ye(this,e,Xh,Zh,fe,{transition:1,transitionConfig:2,inTransition:3,inTransitionConfig:4,outTransition:5,outTransitionConfig:6,asChild:7,id:13,side:14,align:15,sideOffset:16,alignOffset:17,collisionPadding:18,avoidCollisions:19,collisionBoundary:20,sameWidth:21,fitViewport:22,strategy:23,overlap:24,el:0},null,[-1,-1])}}const xh=t=>({builder:t&4}),Zl=t=>({builder:t[2]}),e1=t=>({builder:t&4}),Xl=t=>({builder:t[2]});function t1(t){let e,n,r,i;const s=t[12].default,o=de(s,t,t[11],Zl);let u=[t[2],{type:"button"},t[6]],l={};for(let a=0;a<u.length;a+=1)l=ne(l,u[a]);return{c(){e=S("button"),o&&o.c(),ie(e,l)},m(a,f){w(a,e,f),o&&o.m(e,null),e.autofocus&&e.focus(),t[13](e),n=!0,r||(i=[Ue(t[2].action(e)),G(e,"m-click",t[5]),G(e,"m-keydown",t[5])],r=!0)},p(a,f){o&&o.p&&(!n||f&2052)&&pe(o,s,a,a[11],n?me(s,a[11],f,xh):he(a[11]),Zl),ie(e,l=Me(u,[f&4&&a[2],{type:"button"},f&64&&a[6]]))},i(a){n||(b(o,a),n=!0)},o(a){y(o,a),n=!1},d(a){a&&E(e),o&&o.d(a),t[13](null),r=!1,Te(i)}}}function n1(t){let e;const n=t[12].default,r=de(n,t,t[11],Xl);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,s){r&&r.p&&(!e||s&2052)&&pe(r,n,i,i[11],e?me(n,i[11],s,e1):he(i[11]),Xl)},i(i){e||(b(r,i),e=!0)},o(i){y(r,i),e=!1},d(i){r&&r.d(i)}}}function r1(t){let e,n,r,i;const s=[n1,t1],o=[];function u(l,a){return l[1]?0:1}return e=u(t),n=o[e]=s[e](t),{c(){n.c(),r=Se()},m(l,a){o[e].m(l,a),w(l,r,a),i=!0},p(l,[a]){let f=e;e=u(l),e===f?o[e].p(l,a):(_e(),y(o[f],1,1,()=>{o[f]=null}),ge(),n=o[e],n?n.p(l,a):(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r))},i(l){i||(b(n),i=!0)},o(l){y(n),i=!1},d(l){l&&E(r),o[e].d(l)}}}function i1(t,e,n){let r,i;const s=["asChild","id","el"];let o=Ke(e,s),u,l,{$$slots:a={},$$scope:f}=e,{asChild:c=!1}=e,{id:m=void 0}=e,{el:p=void 0}=e;const{elements:{trigger:d},states:{open:_},ids:v,getAttrs:g}=Oo();x(t,d,$=>n(9,u=$)),x(t,_,$=>n(10,l=$));const h=Pn(),k=g("trigger");function A($){Ce[$?"unshift":"push"](()=>{p=$,n(0,p)})}return t.$$set=$=>{e=ne(ne({},e),yt($)),n(6,o=Ke(e,s)),"asChild"in $&&n(1,c=$.asChild),"id"in $&&n(7,m=$.id),"el"in $&&n(0,p=$.el),"$$scope"in $&&n(11,f=$.$$scope)},t.$$.update=()=>{t.$$.dirty&128&&m&&v.trigger.set(m),t.$$.dirty&1024&&n(8,r={...k,"aria-controls":l?v.content:void 0}),t.$$.dirty&512&&n(2,i=u),t.$$.dirty&260&&Object.assign(i,r)},[p,c,i,d,_,h,o,m,r,u,l,f,a,A]}class s1 extends ve{constructor(e){super(),ye(this,e,i1,r1,fe,{asChild:1,id:7,el:0})}}function nf(){return{NAME:"toolbar",GROUP_NAME:"toolbar-group",PARTS:["root","button","link","group","group-item"]}}function o1(t){const{NAME:e,PARTS:n}=nf(),r=ii(e,n),i={...Em(hi(t)),getAttrs:r};return At(e,i),{...i,updateOption:_i(i.options)}}function l1(){const{NAME:t}=nf();return bt(t)}const u1=t=>({builder:t&4}),Jl=t=>({builder:t[2]}),a1=t=>({builder:t&4}),xl=t=>({builder:t[2]});function f1(t){let e,n,r,i;const s=t[9].default,o=de(s,t,t[8],Jl);let u=[t[2],t[4]],l={};for(let a=0;a<u.length;a+=1)l=ne(l,u[a]);return{c(){e=S("div"),o&&o.c(),ie(e,l)},m(a,f){w(a,e,f),o&&o.m(e,null),t[10](e),n=!0,r||(i=Ue(t[2].action(e)),r=!0)},p(a,f){o&&o.p&&(!n||f&260)&&pe(o,s,a,a[8],n?me(s,a[8],f,u1):he(a[8]),Jl),ie(e,l=Me(u,[f&4&&a[2],f&16&&a[4]]))},i(a){n||(b(o,a),n=!0)},o(a){y(o,a),n=!1},d(a){a&&E(e),o&&o.d(a),t[10](null),r=!1,i()}}}function c1(t){let e;const n=t[9].default,r=de(n,t,t[8],xl);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,s){r&&r.p&&(!e||s&260)&&pe(r,n,i,i[8],e?me(n,i[8],s,a1):he(i[8]),xl)},i(i){e||(b(r,i),e=!0)},o(i){y(r,i),e=!1},d(i){r&&r.d(i)}}}function d1(t){let e,n,r,i;const s=[c1,f1],o=[];function u(l,a){return l[1]?0:1}return e=u(t),n=o[e]=s[e](t),{c(){n.c(),r=Se()},m(l,a){o[e].m(l,a),w(l,r,a),i=!0},p(l,[a]){let f=e;e=u(l),e===f?o[e].p(l,a):(_e(),y(o[f],1,1,()=>{o[f]=null}),ge(),n=o[e],n?n.p(l,a):(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r))},i(l){i||(b(n),i=!0)},o(l){y(n),i=!1},d(l){l&&E(r),o[e].d(l)}}}function m1(t,e,n){let r;const i=["loop","orientation","asChild","el"];let s=Ke(e,i),o,{$$slots:u={},$$scope:l}=e,{loop:a=!0}=e,{orientation:f=void 0}=e,{asChild:c=!1}=e,{el:m=void 0}=e;const{elements:{root:p},updateOption:d,getAttrs:_}=o1({loop:a,orientation:f});x(t,p,h=>n(7,o=h));const v=_("root");function g(h){Ce[h?"unshift":"push"](()=>{m=h,n(0,m)})}return t.$$set=h=>{e=ne(ne({},e),yt(h)),n(4,s=Ke(e,i)),"loop"in h&&n(5,a=h.loop),"orientation"in h&&n(6,f=h.orientation),"asChild"in h&&n(1,c=h.asChild),"el"in h&&n(0,m=h.el),"$$scope"in h&&n(8,l=h.$$scope)},t.$$.update=()=>{t.$$.dirty&32&&d("loop",a),t.$$.dirty&64&&d("orientation",f),t.$$.dirty&128&&n(2,r=o),t.$$.dirty&4&&Object.assign(r,v)},[m,c,r,p,s,a,f,o,l,u,g]}class p1 extends ve{constructor(e){super(),ye(this,e,m1,d1,fe,{loop:5,orientation:6,asChild:1,el:0})}}const h1=t=>({builder:t&4}),eu=t=>({builder:t[2]}),_1=t=>({builder:t&4}),tu=t=>({builder:t[2]});function g1(t){let e,n,r,i;const s=t[8].default,o=de(s,t,t[7],eu);let u=[t[2],{type:"button"},t[5]],l={};for(let a=0;a<u.length;a+=1)l=ne(l,u[a]);return{c(){e=S("button"),o&&o.c(),ie(e,l)},m(a,f){w(a,e,f),o&&o.m(e,null),e.autofocus&&e.focus(),t[10](e),n=!0,r||(i=[Ue(t[2].action(e)),G(e,"click",t[9]),G(e,"m-keydown",t[4])],r=!0)},p(a,f){o&&o.p&&(!n||f&132)&&pe(o,s,a,a[7],n?me(s,a[7],f,h1):he(a[7]),eu),ie(e,l=Me(u,[f&4&&a[2],{type:"button"},f&32&&a[5]]))},i(a){n||(b(o,a),n=!0)},o(a){y(o,a),n=!1},d(a){a&&E(e),o&&o.d(a),t[10](null),r=!1,Te(i)}}}function b1(t){let e;const n=t[8].default,r=de(n,t,t[7],tu);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,s){r&&r.p&&(!e||s&132)&&pe(r,n,i,i[7],e?me(n,i[7],s,_1):he(i[7]),tu)},i(i){e||(b(r,i),e=!0)},o(i){y(r,i),e=!1},d(i){r&&r.d(i)}}}function y1(t){let e,n,r,i;const s=[b1,g1],o=[];function u(l,a){return l[1]?0:1}return e=u(t),n=o[e]=s[e](t),{c(){n.c(),r=Se()},m(l,a){o[e].m(l,a),w(l,r,a),i=!0},p(l,[a]){let f=e;e=u(l),e===f?o[e].p(l,a):(_e(),y(o[f],1,1,()=>{o[f]=null}),ge(),n=o[e],n?n.p(l,a):(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r))},i(l){i||(b(n),i=!0)},o(l){y(n),i=!1},d(l){l&&E(r),o[e].d(l)}}}function v1(t,e,n){let r;const i=["asChild","el"];let s=Ke(e,i),o,{$$slots:u={},$$scope:l}=e,{asChild:a=!1}=e,{el:f=void 0}=e;const{elements:{button:c},getAttrs:m}=l1();x(t,c,g=>n(6,o=g));const p=Pn(),d=m("button");function _(g){Oe.call(this,t,g)}function v(g){Ce[g?"unshift":"push"](()=>{f=g,n(0,f)})}return t.$$set=g=>{e=ne(ne({},e),yt(g)),n(5,s=Ke(e,i)),"asChild"in g&&n(1,a=g.asChild),"el"in g&&n(0,f=g.el),"$$scope"in g&&n(7,l=g.$$scope)},t.$$.update=()=>{t.$$.dirty&64&&n(2,r=o),t.$$.dirty&4&&Object.assign(r,d)},[f,a,r,c,p,s,o,l,u,_,v]}class k1 extends ve{constructor(e){super(),ye(this,e,v1,y1,fe,{asChild:1,el:0})}}var oy="M12 2C17.5 2 22 6.5 22 12S17.5 22 12 22 2 17.5 2 12 6.5 2 12 2M12 4C10.1 4 8.4 4.6 7.1 5.7L18.3 16.9C19.3 15.5 20 13.8 20 12C20 7.6 16.4 4 12 4M16.9 18.3L5.7 7.1C4.6 8.4 4 10.1 4 12C4 16.4 7.6 20 12 20C13.9 20 15.6 19.4 16.9 18.3Z",C1="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z",E1="M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41 10.59L10 14.17L17.59 6.58L19 8L10 17Z",ly="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z",uy="M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z",ay="M7.41,15.41L12,10.83L16.59,15.41L18,14L12,8L6,14L7.41,15.41Z",w1="M20 6.91L17.09 4L12 9.09L6.91 4L4 6.91L9.09 12L4 17.09L6.91 20L12 14.91L17.09 20L20 17.09L14.91 12L20 6.91Z",O1="M15,9H5V5H15M12,19A3,3 0 0,1 9,16A3,3 0 0,1 12,13A3,3 0 0,1 15,16A3,3 0 0,1 12,19M17,3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V7L17,3Z",A1="M19,3H5C3.89,3 3,3.89 3,5V9H5V5H19V19H5V15H3V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M10.08,15.58L11.5,17L16.5,12L11.5,7L10.08,8.41L12.67,11H3V13H12.67L10.08,15.58Z",T1="M6 2C4.89 2 4 2.9 4 4V20C4 21.11 4.89 22 6 22H12V20H6V4H13V9H18V12H20V8L14 2M18 14C17.87 14 17.76 14.09 17.74 14.21L17.55 15.53C17.25 15.66 16.96 15.82 16.7 16L15.46 15.5C15.35 15.5 15.22 15.5 15.15 15.63L14.15 17.36C14.09 17.47 14.11 17.6 14.21 17.68L15.27 18.5C15.25 18.67 15.24 18.83 15.24 19C15.24 19.17 15.25 19.33 15.27 19.5L14.21 20.32C14.12 20.4 14.09 20.53 14.15 20.64L15.15 22.37C15.21 22.5 15.34 22.5 15.46 22.5L16.7 22C16.96 22.18 17.24 22.35 17.55 22.47L17.74 23.79C17.76 23.91 17.86 24 18 24H20C20.11 24 20.22 23.91 20.24 23.79L20.43 22.47C20.73 22.34 21 22.18 21.27 22L22.5 22.5C22.63 22.5 22.76 22.5 22.83 22.37L23.83 20.64C23.89 20.53 23.86 20.4 23.77 20.32L22.7 19.5C22.72 19.33 22.74 19.17 22.74 19C22.74 18.83 22.73 18.67 22.7 18.5L23.76 17.68C23.85 17.6 23.88 17.47 23.82 17.36L22.82 15.63C22.76 15.5 22.63 15.5 22.5 15.5L21.27 16C21 15.82 20.73 15.65 20.42 15.53L20.23 14.21C20.22 14.09 20.11 14 20 14M19 17.5C19.83 17.5 20.5 18.17 20.5 19C20.5 19.83 19.83 20.5 19 20.5C18.16 20.5 17.5 19.83 17.5 19C17.5 18.17 18.17 17.5 19 17.5Z",$1="M6,2A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6M6,4H13V9H18V20H6V4M8,12V14H16V12H8M8,16V18H13V16H8Z",S1="M23 18H20V15H18V18H15V20H18V23H20V20H23M6 2C4.89 2 4 2.9 4 4V20C4 21.11 4.89 22 6 22H13.81C13.45 21.38 13.2 20.7 13.08 20H6V4H13V9H18V13.08C18.33 13.03 18.67 13 19 13C19.34 13 19.67 13.03 20 13.08V8L14 2M8 12V14H16V12M8 16V18H13V16Z",R1="M14,2L20,8V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V4A2,2 0 0,1 6,2H14M18,20V9H13V4H6V20H18M17,13V19H7L12,14L14,16M10,10.5A1.5,1.5 0 0,1 8.5,12A1.5,1.5 0 0,1 7,10.5A1.5,1.5 0 0,1 8.5,9A1.5,1.5 0 0,1 10,10.5Z",D1="M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20Z",F1="M14,2L20,8V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V4A2,2 0 0,1 6,2H14M18,20V9H13V4H6V20H18M12,12L16,16H13.5V19H10.5V16H8L12,12Z",P1="M4 18H12.13L11 19.13V20H4C2.9 20 2 19.11 2 18V6C2 4.89 2.89 4 4 4H10L12 6H20C21.1 6 22 6.89 22 8V10.15C21.74 10.06 21.46 10 21.17 10C20.75 10 20.36 10.11 20 10.3V8H4V18M22.85 13.47L21.53 12.15C21.33 11.95 21 11.95 20.81 12.15L19.83 13.13L21.87 15.17L22.85 14.19C23.05 14 23.05 13.67 22.85 13.47M13 19.96V22H15.04L21.17 15.88L19.13 13.83L13 19.96Z",L1="M6.1,10L4,18V8H21A2,2 0 0,0 19,6H12L10,4H4A2,2 0 0,0 2,6V18A2,2 0 0,0 4,20H19C19.9,20 20.7,19.4 20.9,18.5L23.2,10H6.1M19,18H6L7.6,12H20.6L19,18Z",I1="M20,18H4V8H20M20,6H12L10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6Z",M1="M13 19C13 19.34 13.04 19.67 13.09 20H4C2.9 20 2 19.11 2 18V6C2 4.89 2.89 4 4 4H10L12 6H20C21.1 6 22 6.89 22 8V13.81C21.39 13.46 20.72 13.22 20 13.09V8H4V18H13.09C13.04 18.33 13 18.66 13 19M20 18V15H18V18H15V20H18V23H20V20H23V18H20Z",N1="M13 19C13 19.34 13.04 19.67 13.09 20H4C2.9 20 2 19.11 2 18V6C2 4.89 2.89 4 4 4H10L12 6H20C21.1 6 22 6.89 22 8V13.81C21.39 13.46 20.72 13.22 20 13.09V8H4V18H13.09C13.04 18.33 13 18.66 13 19M22.54 16.88L21.12 15.47L19 17.59L16.88 15.47L15.47 16.88L17.59 19L15.47 21.12L16.88 22.54L19 20.41L21.12 22.54L22.54 21.12L20.41 19L22.54 16.88Z",H1="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z",fy="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",V1="M13 14C9.64 14 8.54 15.35 8.18 16.24C9.25 16.7 10 17.76 10 19C10 20.66 8.66 22 7 22S4 20.66 4 19C4 17.69 4.83 16.58 6 16.17V7.83C4.83 7.42 4 6.31 4 5C4 3.34 5.34 2 7 2S10 3.34 10 5C10 6.31 9.17 7.42 8 7.83V13.12C8.88 12.47 10.16 12 12 12C14.67 12 15.56 10.66 15.85 9.77C14.77 9.32 14 8.25 14 7C14 5.34 15.34 4 17 4S20 5.34 20 7C20 8.34 19.12 9.5 17.91 9.86C17.65 11.29 16.68 14 13 14M7 18C6.45 18 6 18.45 6 19S6.45 20 7 20 8 19.55 8 19 7.55 18 7 18M7 4C6.45 4 6 4.45 6 5S6.45 6 7 6 8 5.55 8 5 7.55 4 7 4M17 6C16.45 6 16 6.45 16 7S16.45 8 17 8 18 7.55 18 7 17.55 6 17 6M17 14V17H14V19H17V22H19V19H22V17H19V14H17Z",U1="M13 14C9.64 14 8.54 15.35 8.18 16.24C9.25 16.7 10 17.76 10 19C10 20.66 8.66 22 7 22S4 20.66 4 19C4 17.69 4.83 16.58 6 16.17V7.83C4.83 7.42 4 6.31 4 5C4 3.34 5.34 2 7 2S10 3.34 10 5C10 6.31 9.17 7.42 8 7.83V13.12C8.88 12.47 10.16 12 12 12C14.67 12 15.56 10.66 15.85 9.77C14.77 9.32 14 8.25 14 7C14 5.34 15.34 4 17 4S20 5.34 20 7C20 8.34 19.12 9.5 17.91 9.86C17.65 11.29 16.68 14 13 14M7 18C6.45 18 6 18.45 6 19S6.45 20 7 20 8 19.55 8 19 7.55 18 7 18M7 4C6.45 4 6 4.45 6 5S6.45 6 7 6 8 5.55 8 5 7.55 4 7 4M17 6C16.45 6 16 6.45 16 7S16.45 8 17 8 18 7.55 18 7 17.55 6 17 6M20.12 14.46L18 16.59L15.88 14.47L14.47 15.88L16.59 18L14.47 20.12L15.88 21.54L18 19.41L20.12 21.54L21.54 20.12L19.41 18L21.54 15.88L20.12 14.46Z",B1="M13 14C9.64 14 8.54 15.35 8.18 16.24C9.25 16.7 10 17.76 10 19C10 20.66 8.66 22 7 22S4 20.66 4 19C4 17.69 4.83 16.58 6 16.17V7.83C4.83 7.42 4 6.31 4 5C4 3.34 5.34 2 7 2S10 3.34 10 5C10 6.31 9.17 7.42 8 7.83V13.12C8.88 12.47 10.16 12 12 12C14.67 12 15.56 10.66 15.85 9.77C14.77 9.32 14 8.25 14 7C14 5.34 15.34 4 17 4S20 5.34 20 7C20 8.34 19.12 9.5 17.91 9.86C17.65 11.29 16.68 14 13 14M7 18C6.45 18 6 18.45 6 19S6.45 20 7 20 8 19.55 8 19 7.55 18 7 18M7 4C6.45 4 6 4.45 6 5S6.45 6 7 6 8 5.55 8 5 7.55 4 7 4M17 6C16.45 6 16 6.45 16 7S16.45 8 17 8 18 7.55 18 7 17.55 6 17 6M18 13V14.5C20.21 14.5 22 16.29 22 18.5C22 19.32 21.75 20.08 21.33 20.71L20.24 19.62C20.41 19.28 20.5 18.9 20.5 18.5C20.5 17.12 19.38 16 18 16V17.5L15.75 15.25L15.72 15.22C15.78 15.17 15.85 15.13 18 13M18 24V22.5C15.79 22.5 14 20.71 14 18.5C14 17.68 14.25 16.92 14.67 16.29L15.76 17.38C15.59 17.72 15.5 18.1 15.5 18.5C15.5 19.88 16.62 21 18 21V19.5L20.25 21.75L20.28 21.78C20.22 21.83 20.15 21.87 18 24",zt="M12,18A6,6 0 0,1 6,12C6,11 6.25,10.03 6.7,9.2L5.24,7.74C4.46,8.97 4,10.43 4,12A8,8 0 0,0 12,20V23L16,19L12,15M12,4V1L8,5L12,9V6A6,6 0 0,1 18,12C18,13 17.75,13.97 17.3,14.8L18.76,16.26C19.54,15.03 20,13.57 20,12A8,8 0 0,0 12,4Z",K1="M6,2V8H6V8L10,12L6,16V16H6V22H18V16H18V16L14,12L18,8V8H18V2H6M16,16.5V20H8V16.5L12,12.5L16,16.5M12,11.5L8,7.5V4H16V7.5L12,11.5Z",cy="M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M9,8H11V17H9V8M13,8H15V17H13V8Z",j1="M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z";function W1(t){let e,n,r,i,s=t[0]!==null&&nu(t);return{c(){e=Fs("svg"),s&&s.c(),n=Fs("path"),N(n,"d",t[1]),N(e,"class",r="fill-current "+t[2]),N(e,"viewBox","0 0 24 24"),N(e,"aria-hidden",i=t[0]===null?"true":"false")},m(o,u){w(o,e,u),s&&s.m(e,null),P(e,n)},p(o,u){o[0]!==null?s?s.p(o,u):(s=nu(o),s.c(),s.m(e,n)):s&&(s.d(1),s=null),u&2&&N(n,"d",o[1]),u&4&&r!==(r="fill-current "+o[2])&&N(e,"class",r),u&1&&i!==(i=o[0]===null?"true":"false")&&N(e,"aria-hidden",i)},d(o){o&&E(e),s&&s.d()}}}function q1(t){let e,n;return{c(){e=S("span"),N(e,"class",n="block "+t[2])},m(r,i){w(r,e,i)},p(r,i){i&4&&n!==(n="block "+r[2])&&N(e,"class",n)},d(r){r&&E(e)}}}function nu(t){let e,n;return{c(){e=Fs("title"),n=Z(t[0])},m(r,i){w(r,e,i),P(e,n)},p(r,i){i&1&&je(n,r[0])},d(r){r&&E(e)}}}function Q1(t){let e;function n(s,o){return s[1]===null?q1:W1}let r=n(t),i=r(t);return{c(){i.c(),e=Se()},m(s,o){i.m(s,o),w(s,e,o)},p(s,[o]){r===(r=n(s))&&i?i.p(s,o):(i.d(1),i=r(s),i&&(i.c(),i.m(e.parentNode,e)))},i:ce,o:ce,d(s){s&&E(e),i.d(s)}}}function z1(t,e,n){let{label:r=null}=e,{path:i=null}=e,{class:s="w-6 h-6"}=e;return t.$$set=o=>{"label"in o&&n(0,r=o.label),"path"in o&&n(1,i=o.path),"class"in o&&n(2,s=o.class)},[r,i,s]}class Ne extends ve{constructor(e){super(),ye(this,e,z1,Q1,fe,{label:0,path:1,class:2})}}async function cn({queryKey:t}){if(t){const e=["/api"];for(const r of t)r!==""&&(r[0]==="?"||r[0]==="&"||e.push("/"),e.push(r));let n=await window.fetch(e.join(""));if(n.ok)return await n.json()}throw new Error("Could not fetch data")}function rf(t){if(t.type==="text")return t.text;{let e=[];for(let n of t.content)e.push(rf(n));return e.join("")}}function dy(t){return t.content&&t.content.length>0?rf(t.content[0]):"<Empty Document>"}function sf(t,e){let n=window.location.hash;n.startsWith("#")&&(n=n.substring(1));let r=new URLSearchParams(n);r.set(t,e),window.location.hash=r.toString()}function of(t){let e=window.location.hash;e.startsWith("#")&&(e=e.substring(1));let n=new URLSearchParams(e);return n.has(t)?n.get(t):null}function G1(t){let e=window.location.hash;e.startsWith("#")&&(e=e.substring(1));let n=new URLSearchParams(e);n.has(t)&&(n.delete(t),window.location.hash=n.toString())}const ft=Fe(null),Y1=Fe(null),ru=Fe(!1);ft.subscribe(t=>{t!==null&&sf("path",t.fullpath)});function Ci(){return bt("apiStatus")}function Ao(){return bt("currentUser")}function Et(){return bt("currentBranch")}function To(){return bt("branches")}function iu(t,e,n){const r=t.slice();return r[7]=e[n],r}function Z1(t){let e,n,r,i=t[0].length+t[1]+"",s,o,u;return e=new Ne({props:{path:zt,class:"w-4 h-4 animate-spin animate-reverse"}}),{c(){U(e.$$.fragment),n=B(),r=S("span"),s=Z(i),o=Z(" actions running"),N(r,"class","pl-2")},m(l,a){H(e,l,a),w(l,n,a),w(l,r,a),P(r,s),P(r,o),u=!0},p(l,a){(!u||a&3)&&i!==(i=l[0].length+l[1]+"")&&je(s,i)},i(l){u||(b(e.$$.fragment,l),u=!0)},o(l){y(e.$$.fragment,l),u=!1},d(l){l&&(E(n),E(r)),V(e,l)}}}function X1(t){let e,n,r,i;return e=new Ne({props:{path:zt,class:"w-4 h-4 animate-spin animate-reverse"}}),{c(){U(e.$$.fragment),n=B(),r=S("span"),r.textContent="1 action running",N(r,"class","pl-2")},m(s,o){H(e,s,o),w(s,n,o),w(s,r,o),i=!0},p:ce,i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){y(e.$$.fragment,s),i=!1},d(s){s&&(E(n),E(r)),V(e,s)}}}function J1(t){let e;return{c(){e=S("span"),e.textContent="Idle"},m(n,r){w(n,e,r)},p:ce,i:ce,o:ce,d(n){n&&E(e)}}}function x1(t){let e,n,r,i;const s=[J1,X1,Z1],o=[];function u(l,a){return l[0].length+l[1]===0?0:l[0].length+l[1]===1?1:2}return e=u(t),n=o[e]=s[e](t),{c(){n.c(),r=Se()},m(l,a){o[e].m(l,a),w(l,r,a),i=!0},p(l,a){let f=e;e=u(l),e===f?o[e].p(l,a):(_e(),y(o[f],1,1,()=>{o[f]=null}),ge(),n=o[e],n?n.p(l,a):(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r))},i(l){i||(b(n),i=!0)},o(l){y(n),i=!1},d(l){l&&E(r),o[e].d(l)}}}function e_(t){let e,n,r,i;return e=new Ne({props:{path:zt,class:"w-4 h-4 animate-spin animate-reverse"}}),{c(){U(e.$$.fragment),n=B(),r=S("span"),r.textContent="Saving file",N(r,"class","flex-1")},m(s,o){H(e,s,o),w(s,n,o),w(s,r,o),i=!0},i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){y(e.$$.fragment,s),i=!1},d(s){s&&(E(n),E(r)),V(e,s)}}}function t_(t){let e,n,r,i;return e=new Ne({props:{path:zt,class:"w-4 h-4 animate-spin animate-reverse"}}),{c(){U(e.$$.fragment),n=B(),r=S("span"),r.textContent="Loading file",N(r,"class","flex-1")},m(s,o){H(e,s,o),w(s,n,o),w(s,r,o),i=!0},i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){y(e.$$.fragment,s),i=!1},d(s){s&&(E(n),E(r)),V(e,s)}}}function su(t){let e,n,r,i;const s=[t_,e_],o=[];function u(l,a){return l[7].action==="LoadTextFile"?0:l[7].action==="SaveCurrentFile"?1:-1}return~(n=u(t))&&(r=o[n]=s[n](t)),{c(){e=S("li"),r&&r.c(),N(e,"class","flex flex-row items-center space-x-2 px-3 py-1 border-l border-r last:border-b first-border-t border-slate-300")},m(l,a){w(l,e,a),~n&&o[n].m(e,null),i=!0},p(l,a){let f=n;n=u(l),n!==f&&(r&&(_e(),y(o[f],1,1,()=>{o[f]=null}),ge()),~n?(r=o[n],r||(r=o[n]=s[n](l),r.c()),b(r,1),r.m(e,null)):r=null)},i(l){i||(b(r),i=!0)},o(l){y(r),i=!1},d(l){l&&E(e),~n&&o[n].d()}}}function ou(t){let e,n,r,i,s;return n=new Ne({props:{path:zt,class:"w-4 h-4 animate-spin animate-reverse"}}),{c(){e=S("li"),U(n.$$.fragment),r=B(),i=S("span"),i.textContent="Fetching branches",N(i,"class","flex-1"),N(e,"class","flex flex-row items-center space-x-2 px-3 py-1 border-l border-r last:border-b first-border-t border-slate-300")},m(o,u){w(o,e,u),H(n,e,null),P(e,r),P(e,i),s=!0},i(o){s||(b(n.$$.fragment,o),s=!0)},o(o){y(n.$$.fragment,o),s=!1},d(o){o&&E(e),V(n)}}}function n_(t){let e,n,r,i=tn(t[0]),s=[];for(let l=0;l<i.length;l+=1)s[l]=su(iu(t,i,l));const o=l=>y(s[l],1,1,()=>{s[l]=null});let u=t[2].isFetching&&ou();return{c(){e=S("ul");for(let l=0;l<s.length;l+=1)s[l].c();n=B(),u&&u.c()},m(l,a){w(l,e,a);for(let f=0;f<s.length;f+=1)s[f]&&s[f].m(e,null);P(e,n),u&&u.m(e,null),r=!0},p(l,a){if(a&1){i=tn(l[0]);let f;for(f=0;f<i.length;f+=1){const c=iu(l,i,f);s[f]?(s[f].p(c,a),b(s[f],1)):(s[f]=su(c),s[f].c(),b(s[f],1),s[f].m(e,n))}for(_e(),f=i.length;f<s.length;f+=1)o(f);ge()}l[2].isFetching?u?a&4&&b(u,1):(u=ou(),u.c(),b(u,1),u.m(e,null)):u&&(_e(),y(u,1,1,()=>{u=null}),ge())},i(l){if(!r){for(let a=0;a<i.length;a+=1)b(s[a]);b(u),r=!0}},o(l){s=s.filter(Boolean);for(let a=0;a<s.length;a+=1)y(s[a]);y(u),r=!1},d(l){l&&E(e),fi(s,l),u&&u.d()}}}function r_(t){let e,n,r,i;return e=new s1({props:{class:"inline-flex items-center",$$slots:{default:[x1]},$$scope:{ctx:t}}}),r=new Jh({props:{class:"z-50 bg-white shadow-lg",$$slots:{default:[n_]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=B(),U(r.$$.fragment)},m(s,o){H(e,s,o),w(s,n,o),H(r,s,o),i=!0},p(s,o){const u={};o&1027&&(u.$$scope={dirty:o,ctx:s}),e.$set(u);const l={};o&1029&&(l.$$scope={dirty:o,ctx:s}),r.$set(l)},i(s){i||(b(e.$$.fragment,s),b(r.$$.fragment,s),i=!0)},o(s){y(e.$$.fragment,s),y(r.$$.fragment,s),i=!1},d(s){s&&E(n),V(e,s),V(r,s)}}}function lu(t){let e,n;return e=new si({props:{open:!0,onOpenChange:t[6],$$slots:{default:[u_]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},p(r,i){const s={};i&1024&&(s.$$scope={dirty:i,ctx:r}),e.$set(s)},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){y(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function i_(t){let e;return{c(){e=Z("Saving failed")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function s_(t){let e;return{c(){e=Z("Close")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function o_(t){let e,n,r,i,s,o,u,l;return e=new Tt({props:{$$slots:{default:[i_]},$$scope:{ctx:t}}}),u=new Mt({props:{"data-button":!0,$$slots:{default:[s_]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=B(),r=S("div"),i=S("p"),i.textContent="Unfortunately saving the file failed.",s=B(),o=S("div"),U(u.$$.fragment),N(o,"data-dialog-buttons",""),N(r,"data-dialog-content-area","")},m(a,f){H(e,a,f),w(a,n,f),w(a,r,f),P(r,i),P(r,s),P(r,o),H(u,o,null),l=!0},p(a,f){const c={};f&1024&&(c.$$scope={dirty:f,ctx:a}),e.$set(c);const m={};f&1024&&(m.$$scope={dirty:f,ctx:a}),u.$set(m)},i(a){l||(b(e.$$.fragment,a),b(u.$$.fragment,a),l=!0)},o(a){y(e.$$.fragment,a),y(u.$$.fragment,a),l=!1},d(a){a&&(E(n),E(r)),V(e,a),V(u)}}}function l_(t){let e,n,r,i;return e=new vi({}),r=new yi({props:{$$slots:{default:[o_]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=B(),U(r.$$.fragment)},m(s,o){H(e,s,o),w(s,n,o),H(r,s,o),i=!0},p(s,o){const u={};o&1024&&(u.$$scope={dirty:o,ctx:s}),r.$set(u)},i(s){i||(b(e.$$.fragment,s),b(r.$$.fragment,s),i=!0)},o(s){y(e.$$.fragment,s),y(r.$$.fragment,s),i=!1},d(s){s&&E(n),V(e,s),V(r,s)}}}function u_(t){let e,n,r,i;return e=new ki({props:{class:"hidden"}}),r=new bi({props:{$$slots:{default:[l_]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=B(),U(r.$$.fragment)},m(s,o){H(e,s,o),w(s,n,o),H(r,s,o),i=!0},p(s,o){const u={};o&1024&&(u.$$scope={dirty:o,ctx:s}),r.$set(u)},i(s){i||(b(e.$$.fragment,s),b(r.$$.fragment,s),i=!0)},o(s){y(e.$$.fragment,s),y(r.$$.fragment,s),i=!1},d(s){s&&E(n),V(e,s),V(r,s)}}}function a_(t){let e,n,r,i;e=new Nh({props:{$$slots:{default:[r_]},$$scope:{ctx:t}}});let s=t[3]&&lu(t);return{c(){U(e.$$.fragment),n=B(),s&&s.c(),r=Se()},m(o,u){H(e,o,u),w(o,n,u),s&&s.m(o,u),w(o,r,u),i=!0},p(o,[u]){const l={};u&1031&&(l.$$scope={dirty:u,ctx:o}),e.$set(l),o[3]?s?(s.p(o,u),u&8&&b(s,1)):(s=lu(o),s.c(),b(s,1),s.m(r.parentNode,r)):s&&(_e(),y(s,1,1,()=>{s=null}),ge())},i(o){i||(b(e.$$.fragment,o),b(s),i=!0)},o(o){y(e.$$.fragment,o),y(s),i=!1},d(o){o&&(E(n),E(r)),V(e,o),s&&s.d(o)}}}const ro=Fe([]);let io=Fe(!1);function lf(t){t.status="active",ro.update(n=>n.concat([t]));let e=null;t.action==="LoadTextFile"?e=f_(t):t.action==="SaveCurrentFile"?e=c_(t):t.action==="SynchroniseBranches"&&(e=d_()),e!==null&&e.then(()=>{ro.update(n=>{const r=n.indexOf(t);return r>=0?n.slice(0,r).concat(n.slice(r+1)):n})})}async function f_(t){const e=await window.fetch("/api/branches/"+t.branch.id+"/files/"+t.filename);t.callback(await e.text())}async function c_(t){const e=new FormData;e.append("content",new Blob([t.data])),(await window.fetch("/api/branches/"+t.branch.id+"/files/"+t.filename,{method:"PUT",body:e})).ok?t.callback():io.set(!0)}async function d_(t){await window.fetch("/api/branches",{method:"PATCH"})}function m_(t,e,n){let r,i,s,o;x(t,ro,f=>n(0,r=f)),x(t,io,f=>n(3,o=f));const u=To();x(t,u,f=>n(2,s=f));const l=ze([u],f=>{let c=0;for(const m of f)m!==null&&m.isFetching&&(c=c+1);return c});return x(t,l,f=>n(1,i=f)),[r,i,s,o,u,l,f=>{f||io.set(!1)}]}let p_=class extends ve{constructor(e){super(),ye(this,e,m_,a_,fe,{})}};function h_(t){let e;const n=t[3].default,r=de(n,t,t[5],null);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,s){r&&r.p&&(!e||s&32)&&pe(r,n,i,i[5],e?me(n,i[5],s,null):he(i[5]),null)},i(i){e||(b(r,i),e=!0)},o(i){y(r,i),e=!1},d(i){r&&r.d(i)}}}function __(t){let e,n,r,i;return e=new vi({}),r=new yi({props:{$$slots:{default:[h_]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=B(),U(r.$$.fragment)},m(s,o){H(e,s,o),w(s,n,o),H(r,s,o),i=!0},p(s,o){const u={};o&32&&(u.$$scope={dirty:o,ctx:s}),r.$set(u)},i(s){i||(b(e.$$.fragment,s),b(r.$$.fragment,s),i=!0)},o(s){y(e.$$.fragment,s),y(r.$$.fragment,s),i=!1},d(s){s&&E(n),V(e,s),V(r,s)}}}function g_(t){let e,n,r,i;return e=new ki({props:{class:"hidden"}}),r=new bi({props:{$$slots:{default:[__]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=B(),U(r.$$.fragment)},m(s,o){H(e,s,o),w(s,n,o),H(r,s,o),i=!0},p(s,o){const u={};o&32&&(u.$$scope={dirty:o,ctx:s}),r.$set(u)},i(s){i||(b(e.$$.fragment,s),b(r.$$.fragment,s),i=!0)},o(s){y(e.$$.fragment,s),y(r.$$.fragment,s),i=!1},d(s){s&&E(n),V(e,s),V(r,s)}}}function b_(t){let e,n,r;function i(o){t[4](o)}let s={onOpenChange:t[1],$$slots:{default:[g_]},$$scope:{ctx:t}};return t[0]!==void 0&&(s.open=t[0]),e=new si({props:s}),Ce.push(()=>Ut(e,"open",i)),{c(){U(e.$$.fragment)},m(o,u){H(e,o,u),r=!0},p(o,[u]){const l={};u&32&&(l.$$scope={dirty:u,ctx:o}),!n&&u&1&&(n=!0,l.open=o[0],Vt(()=>n=!1)),e.$set(l)},i(o){r||(b(e.$$.fragment,o),r=!0)},o(o){y(e.$$.fragment,o),r=!1},d(o){V(e,o)}}}function y_(t,e,n){let{$$slots:r={},$$scope:i}=e;const s=null;let{open:o=!1}=e;function u(a){a||Ge.set(Ae.NONE)}ns(()=>{n(0,o=!0)});function l(a){o=a,n(0,o)}return t.$$set=a=>{"open"in a&&n(0,o=a.open),"$$scope"in a&&n(5,i=a.$$scope)},[o,u,s,r,l,i]}class Gt extends ve{constructor(e){super(),ye(this,e,y_,b_,fe,{onOpenChange:2,open:0})}get onOpenChange(){return this.$$.ctx[2]}}function v_(t){let e;return{c(){e=Z("Create a new branch")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function uu(t){let e,n;return{c(){e=S("span"),n=Z(t[2]),N(e,"data-form-field-error","")},m(r,i){w(r,e,i),P(e,n)},p(r,i){i&4&&je(n,r[2])},d(r){r&&E(e)}}}function k_(t){let e,n,r,i;return e=new Mt({props:{"data-button":!0,$$slots:{default:[E_]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=B(),r=S("button"),r.textContent="Create",N(r,"type","submit"),N(r,"data-button","")},m(s,o){H(e,s,o),w(s,n,o),w(s,r,o),i=!0},i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){y(e.$$.fragment,s),i=!1},d(s){s&&(E(n),E(r)),V(e,s)}}}function C_(t){let e,n,r,i;return n=new Ne({props:{path:zt,class:"block w-6 h-6 animate-spin"}}),{c(){e=S("span"),U(n.$$.fragment),r=S("span"),r.textContent="Creating...",N(e,"data-button",""),N(e,"class","inline-flex")},m(s,o){w(s,e,o),H(n,e,null),P(e,r),i=!0},i(s){i||(b(n.$$.fragment,s),i=!0)},o(s){y(n.$$.fragment,s),i=!1},d(s){s&&E(e),V(n)}}}function E_(t){let e;return{c(){e=Z("Don't create")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function w_(t){let e,n,r,i,s,o,u,l,a,f,c,m,p,d,_;e=new Tt({props:{$$slots:{default:[v_]},$$scope:{ctx:t}}});let v=t[2]&&uu(t);const g=[C_,k_],h=[];function k(A,$){return A[3].isPending?0:1}return c=k(t),m=h[c]=g[c](t),{c(){U(e.$$.fragment),n=B(),r=S("form"),i=S("label"),s=S("span"),s.textContent="New branch title",o=B(),u=S("input"),l=B(),v&&v.c(),a=B(),f=S("div"),m.c(),N(s,"data-form-field-label",""),N(u,"type","text"),N(u,"data-form-field-text",""),N(f,"data-dialog-buttons",""),N(r,"data-dialog-content-area","")},m(A,$){H(e,A,$),w(A,n,$),w(A,r,$),P(r,i),P(i,s),P(i,o),P(i,u),it(u,t[1]),P(i,l),v&&v.m(i,null),P(r,a),P(r,f),h[c].m(f,null),p=!0,d||(_=[G(u,"input",t[7]),G(r,"submit",t[6])],d=!0)},p(A,$){const C={};$&2048&&(C.$$scope={dirty:$,ctx:A}),e.$set(C),$&2&&u.value!==A[1]&&it(u,A[1]),A[2]?v?v.p(A,$):(v=uu(A),v.c(),v.m(i,null)):v&&(v.d(1),v=null);let F=c;c=k(A),c!==F&&(_e(),y(h[F],1,1,()=>{h[F]=null}),ge(),m=h[c],m||(m=h[c]=g[c](A),m.c()),b(m,1),m.m(f,null))},i(A){p||(b(e.$$.fragment,A),b(m),p=!0)},o(A){y(e.$$.fragment,A),y(m),p=!1},d(A){A&&(E(n),E(r)),V(e,A),v&&v.d(),h[c].d(),d=!1,Te(_)}}}function O_(t){let e,n,r;function i(o){t[8](o)}let s={onOpenChange:t[4],$$slots:{default:[w_]},$$scope:{ctx:t}};return t[0]!==void 0&&(s.open=t[0]),e=new Gt({props:s}),Ce.push(()=>Ut(e,"open",i)),{c(){U(e.$$.fragment)},m(o,u){H(e,o,u),r=!0},p(o,[u]){const l={};u&2062&&(l.$$scope={dirty:u,ctx:o}),!n&&u&1&&(n=!0,l.open=o[0],Vt(()=>n=!1)),e.$set(l)},i(o){r||(b(e.$$.fragment,o),r=!0)},o(o){y(e.$$.fragment,o),r=!1},d(o){V(e,o)}}}function A_(t,e,n){let r;const i=Ct(),s=Et();let o=!1,u="",l="";function a(d){d&&n(1,u="")}const f=di({mutationFn:async d=>{const _=await window.fetch("/api/branches",{method:"POST",body:JSON.stringify({title:d.title}),headers:{Accept:"application/json","Content-Type":"application/json"}});if(_.ok){i.invalidateQueries({queryKey:["branches"]});const v=await _.json();s.set(v),Ge.set(Ae.NONE)}else n(2,l=(await _.json()).detail[0].msg),n(2,l=l[0].toUpperCase()+l.substring(1))}});x(t,f,d=>n(3,r=d));async function c(d){d.preventDefault(),r.mutate({title:u})}function m(){u=this.value,n(1,u)}function p(d){o=d,n(0,o)}return[o,u,l,r,a,f,c,m,p]}class T_ extends ve{constructor(e){super(),ye(this,e,A_,O_,fe,{})}}function $_(t){let e;return{c(){e=Z("Delete the branch")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function au(t){let e,n;return{c(){e=S("span"),n=Z(t[2]),N(e,"data-form-field-error","")},m(r,i){w(r,e,i),P(e,n)},p(r,i){i&4&&je(n,r[2])},d(r){r&&E(e)}}}function S_(t){let e,n,r,i;return e=new Mt({props:{"data-button":!0,$$slots:{default:[D_]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=B(),r=S("button"),r.textContent="Delete",N(r,"type","submit"),N(r,"data-button","")},m(s,o){H(e,s,o),w(s,n,o),w(s,r,o),i=!0},i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){y(e.$$.fragment,s),i=!1},d(s){s&&(E(n),E(r)),V(e,s)}}}function R_(t){let e,n,r,i;return n=new Ne({props:{path:zt,class:"block w-6 h-6 animate-spin"}}),{c(){e=S("span"),U(n.$$.fragment),r=S("span"),r.textContent="Deleting...",N(e,"data-button",""),N(e,"class","inline-flex")},m(s,o){w(s,e,o),H(n,e,null),P(e,r),i=!0},i(s){i||(b(n.$$.fragment,s),i=!0)},o(s){y(n.$$.fragment,s),i=!1},d(s){s&&E(e),V(n)}}}function D_(t){let e;return{c(){e=Z("Don't delete")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function F_(t){var D;let e,n,r,i,s,o,u=((D=t[4])==null?void 0:D.title)+"",l,a,f,c,m,p,d,_,v,g,h,k,A,$,C;e=new Tt({props:{$$slots:{default:[$_]},$$scope:{ctx:t}}});let F=t[2]&&au(t);const R=[R_,S_],K=[];function M(I,O){return I[3].isPending?0:1}return h=M(t),k=K[h]=R[h](t),{c(){U(e.$$.fragment),n=B(),r=S("form"),i=S("p"),s=Z("Please confirm you wish to delete the branch "),o=S("span"),l=Z(u),a=Z(`. This cannot be undone. To confirm the action, please enter the name of
13
- the branch to delete.`),f=B(),c=S("label"),m=S("span"),m.textContent="Confirm branch name",p=B(),d=S("input"),_=B(),F&&F.c(),v=B(),g=S("div"),k.c(),N(o,"class","inline-block mx-1 px-2 border border-fuchsia-700 rounded font-bold"),N(i,"class","mb-4"),N(m,"data-form-field-label",""),N(d,"type","text"),N(d,"data-form-field-text",""),N(g,"data-dialog-buttons",""),N(r,"data-dialog-content-area","")},m(I,O){H(e,I,O),w(I,n,O),w(I,r,O),P(r,i),P(i,s),P(i,o),P(o,l),P(i,a),P(r,f),P(r,c),P(c,m),P(c,p),P(c,d),it(d,t[1]),P(c,_),F&&F.m(c,null),P(r,v),P(r,g),K[h].m(g,null),A=!0,$||(C=[G(d,"input",t[9]),G(r,"submit",t[8])],$=!0)},p(I,O){var q;const L={};O&4096&&(L.$$scope={dirty:O,ctx:I}),e.$set(L),(!A||O&16)&&u!==(u=((q=I[4])==null?void 0:q.title)+"")&&je(l,u),O&2&&d.value!==I[1]&&it(d,I[1]),I[2]?F?F.p(I,O):(F=au(I),F.c(),F.m(c,null)):F&&(F.d(1),F=null);let W=h;h=M(I),h!==W&&(_e(),y(K[W],1,1,()=>{K[W]=null}),ge(),k=K[h],k||(k=K[h]=R[h](I),k.c()),b(k,1),k.m(g,null))},i(I){A||(b(e.$$.fragment,I),b(k),A=!0)},o(I){y(e.$$.fragment,I),y(k),A=!1},d(I){I&&(E(n),E(r)),V(e,I),F&&F.d(),K[h].d(),$=!1,Te(C)}}}function P_(t){let e,n,r;function i(o){t[10](o)}let s={onOpenChange:t[6],$$slots:{default:[F_]},$$scope:{ctx:t}};return t[0]!==void 0&&(s.open=t[0]),e=new Gt({props:s}),Ce.push(()=>Ut(e,"open",i)),{c(){U(e.$$.fragment)},m(o,u){H(e,o,u),r=!0},p(o,[u]){const l={};u&4126&&(l.$$scope={dirty:u,ctx:o}),!n&&u&1&&(n=!0,l.open=o[0],Vt(()=>n=!1)),e.$set(l)},i(o){r||(b(e.$$.fragment,o),r=!0)},o(o){y(e.$$.fragment,o),r=!1},d(o){V(e,o)}}}function L_(t,e,n){let r,i;const s=Ct(),o=Et();x(t,o,_=>n(4,i=_));let u=!1,l="",a="";function f(_){_&&n(1,l="")}const c=di({mutationFn:async()=>{const _=await window.fetch("/api/branches/"+(i==null?void 0:i.id),{method:"DELETE",headers:{Accept:"application/json"}});_.ok?(s.invalidateQueries({queryKey:["branches"]}),o.set(null),Ge.set(Ae.NONE)):(n(2,a=(await _.json()).detail[0].msg),n(2,a=a[0].toUpperCase()+a.substring(1)))}});x(t,c,_=>n(3,r=_));function m(_){_.preventDefault(),(i==null?void 0:i.title)===l?(n(2,a=""),r.mutate()):n(2,a="Please enter the exact name of the branch to delete.")}function p(){l=this.value,n(1,l)}function d(_){u=_,n(0,u)}return[u,l,a,r,i,o,f,c,m,p,d]}class I_ extends ve{constructor(e){super(),ye(this,e,L_,P_,fe,{})}}function fu(t,e,n){const r=t.slice();return r[14]=e[n],r}function M_(t){let e;return{c(){e=Z("Import a remote branch")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function cu(t){let e,n=t[14].title+"",r,i;return{c(){e=S("option"),r=Z(n),e.__value=i=t[14].id,it(e,e.__value)},m(s,o){w(s,e,o),P(e,r)},p(s,o){o&16&&n!==(n=s[14].title+"")&&je(r,n),o&16&&i!==(i=s[14].id)&&(e.__value=i,it(e,e.__value))},d(s){s&&E(e)}}}function du(t){let e,n;return{c(){e=S("span"),n=Z(t[2]),N(e,"data-form-field-error","")},m(r,i){w(r,e,i),P(e,n)},p(r,i){i&4&&je(n,r[2])},d(r){r&&E(e)}}}function N_(t){let e,n,r,i;return e=new Mt({props:{"data-button":!0,$$slots:{default:[V_]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=B(),r=S("button"),r.textContent="Import",N(r,"type","submit"),N(r,"data-button","")},m(s,o){H(e,s,o),w(s,n,o),w(s,r,o),i=!0},i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){y(e.$$.fragment,s),i=!1},d(s){s&&(E(n),E(r)),V(e,s)}}}function H_(t){let e,n,r,i;return n=new Ne({props:{path:zt,class:"block w-6 h-6 animate-spin"}}),{c(){e=S("span"),U(n.$$.fragment),r=S("span"),r.textContent="Importing...",N(e,"data-button",""),N(e,"class","inline-flex")},m(s,o){w(s,e,o),H(n,e,null),P(e,r),i=!0},i(s){i||(b(n.$$.fragment,s),i=!0)},o(s){y(n.$$.fragment,s),i=!1},d(s){s&&E(e),V(n)}}}function V_(t){let e;return{c(){e=Z("Don't import")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function U_(t){let e,n,r,i,s,o,u,l,a,f,c,m,p,d,_;e=new Tt({props:{$$slots:{default:[M_]},$$scope:{ctx:t}}});let v=tn(t[4]),g=[];for(let C=0;C<v.length;C+=1)g[C]=cu(fu(t,v,C));let h=t[2]&&du(t);const k=[H_,N_],A=[];function $(C,F){return C[3].isPending?0:1}return c=$(t),m=A[c]=k[c](t),{c(){U(e.$$.fragment),n=B(),r=S("form"),i=S("label"),s=S("span"),s.textContent="New branch title",o=B(),u=S("select");for(let C=0;C<g.length;C+=1)g[C].c();l=B(),h&&h.c(),a=B(),f=S("div"),m.c(),N(s,"data-form-field-label",""),N(u,"data-form-field-text",""),t[1]===void 0&&at(()=>t[9].call(u)),N(f,"data-dialog-buttons",""),N(r,"data-dialog-content-area","")},m(C,F){H(e,C,F),w(C,n,F),w(C,r,F),P(r,i),P(i,s),P(i,o),P(i,u);for(let R=0;R<g.length;R+=1)g[R]&&g[R].m(u,null);Lo(u,t[1],!0),P(i,l),h&&h.m(i,null),P(r,a),P(r,f),A[c].m(f,null),p=!0,d||(_=[G(u,"change",t[9]),G(r,"submit",t[8])],d=!0)},p(C,F){const R={};if(F&131072&&(R.$$scope={dirty:F,ctx:C}),e.$set(R),F&16){v=tn(C[4]);let M;for(M=0;M<v.length;M+=1){const D=fu(C,v,M);g[M]?g[M].p(D,F):(g[M]=cu(D),g[M].c(),g[M].m(u,null))}for(;M<g.length;M+=1)g[M].d(1);g.length=v.length}F&18&&Lo(u,C[1]),C[2]?h?h.p(C,F):(h=du(C),h.c(),h.m(i,null)):h&&(h.d(1),h=null);let K=c;c=$(C),c!==K&&(_e(),y(A[K],1,1,()=>{A[K]=null}),ge(),m=A[c],m||(m=A[c]=k[c](C),m.c()),b(m,1),m.m(f,null))},i(C){p||(b(e.$$.fragment,C),b(m),p=!0)},o(C){y(e.$$.fragment,C),y(m),p=!1},d(C){C&&(E(n),E(r)),V(e,C),fi(g,C),h&&h.d(),A[c].d(),d=!1,Te(_)}}}function B_(t){let e,n,r;function i(o){t[10](o)}let s={onOpenChange:t[5],$$slots:{default:[U_]},$$scope:{ctx:t}};return t[0]!==void 0&&(s.open=t[0]),e=new Gt({props:s}),Ce.push(()=>Ut(e,"open",i)),{c(){U(e.$$.fragment)},m(o,u){H(e,o,u),r=!0},p(o,[u]){const l={};u&131102&&(l.$$scope={dirty:u,ctx:o}),!n&&u&1&&(n=!0,l.open=o[0],Vt(()=>n=!1)),e.$set(l)},i(o){r||(b(e.$$.fragment,o),r=!0)},o(o){y(e.$$.fragment,o),r=!1},d(o){V(e,o)}}}function K_(t,e,n){let r,i;const s=Ct(),o=Et(),u=To();let l=!1,a="",f="";function c(g){g&&n(1,a="")}const m=ze(u,g=>g.isSuccess?g.data.remote.filter(h=>{let k=!1;for(const A of g.data.local)if(h.id.endsWith("/"+A.id)){k=!0;break}return!k}).map(h=>({id:h.id.substring(h.id.indexOf("/")+1),title:h.title,nogit:!1})):[]);x(t,m,g=>n(4,i=g));const p=di({mutationFn:async g=>{const h=await window.fetch("/api/branches",{method:"POST",body:JSON.stringify({title:g.title}),headers:{Accept:"application/json","Content-Type":"application/json","X-UEditor-Import-Branch":"true"}});if(h.ok){s.invalidateQueries({queryKey:["branches"]});const k=await h.json();o.set(k),Ge.set(Ae.NONE)}else n(2,f=(await h.json()).detail[0].msg),n(2,f=f[0].toUpperCase()+f.substring(1))}});x(t,p,g=>n(3,r=g));async function d(g){g.preventDefault(),r.mutate({title:a})}function _(){a=Of(this),n(1,a)}function v(g){l=g,n(0,l)}return[l,a,f,r,i,c,m,p,d,_,v]}class j_ extends ve{constructor(e){super(),ye(this,e,K_,B_,fe,{})}}function W_(t){let e;return{c(){e=Z("Merge changes from the default branch")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function mu(t){let e,n;return{c(){e=S("p"),n=Z(t[1]),N(e,"data-form-field-error","")},m(r,i){w(r,e,i),P(e,n)},p(r,i){i&2&&je(n,r[1])},d(r){r&&E(e)}}}function q_(t){let e,n,r,i;return e=new Mt({props:{"data-button":!0,$$slots:{default:[z_]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=B(),r=S("button"),r.textContent="Merge",N(r,"type","submit"),N(r,"data-button","")},m(s,o){H(e,s,o),w(s,n,o),w(s,r,o),i=!0},i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){y(e.$$.fragment,s),i=!1},d(s){s&&(E(n),E(r)),V(e,s)}}}function Q_(t){let e,n,r,i;return n=new Ne({props:{path:zt,class:"block w-6 h-6 animate-spin"}}),{c(){e=S("span"),U(n.$$.fragment),r=S("span"),r.textContent="Merging...",N(e,"data-button",""),N(e,"class","inline-flex")},m(s,o){w(s,e,o),H(n,e,null),P(e,r),i=!0},i(s){i||(b(n.$$.fragment,s),i=!0)},o(s){y(n.$$.fragment,s),i=!1},d(s){s&&E(e),V(n)}}}function z_(t){let e;return{c(){e=Z("Don't merge")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function G_(t){var M;let e,n,r,i,s,o,u=t[4].data.git.default_branch+"",l,a,f,c=((M=t[3])==null?void 0:M.title)+"",m,p,d,_,v,g,h,k,A,$;e=new Tt({props:{$$slots:{default:[W_]},$$scope:{ctx:t}}});let C=t[1]&&mu(t);const F=[Q_,q_],R=[];function K(D,I){return D[2].isPending?0:1}return g=K(t),h=R[g]=F[g](t),{c(){U(e.$$.fragment),n=B(),r=S("form"),i=S("p"),s=Z("Please confirm you wish to merge all changes from the default branch "),o=S("span"),l=Z(u),a=Z(`
14
- into the current branch`),f=S("span"),m=Z(c),p=Z(". This cannot be undone."),d=B(),C&&C.c(),_=B(),v=S("div"),h.c(),N(o,"class","inline-block mx-1 px-2 border boder-fuchsia-700 rounded font-bold"),N(f,"class","inline-block mx-1 px-2 border border-fuchsia-700 rounded font-bold"),N(i,"class","mb-4"),N(v,"data-dialog-buttons",""),N(r,"data-dialog-content-area","")},m(D,I){H(e,D,I),w(D,n,I),w(D,r,I),P(r,i),P(i,s),P(i,o),P(o,l),P(i,a),P(i,f),P(f,m),P(i,p),P(r,d),C&&C.m(r,null),P(r,_),P(r,v),R[g].m(v,null),k=!0,A||($=G(r,"submit",t[9]),A=!0)},p(D,I){var W;const O={};I&8192&&(O.$$scope={dirty:I,ctx:D}),e.$set(O),(!k||I&16)&&u!==(u=D[4].data.git.default_branch+"")&&je(l,u),(!k||I&8)&&c!==(c=((W=D[3])==null?void 0:W.title)+"")&&je(m,c),D[1]?C?C.p(D,I):(C=mu(D),C.c(),C.m(r,_)):C&&(C.d(1),C=null);let L=g;g=K(D),g!==L&&(_e(),y(R[L],1,1,()=>{R[L]=null}),ge(),h=R[g],h||(h=R[g]=F[g](D),h.c()),b(h,1),h.m(v,null))},i(D){k||(b(e.$$.fragment,D),b(h),k=!0)},o(D){y(e.$$.fragment,D),y(h),k=!1},d(D){D&&(E(n),E(r)),V(e,D),C&&C.d(),R[g].d(),A=!1,$()}}}function Y_(t){let e,n,r;function i(o){t[10](o)}let s={onOpenChange:t[7],$$slots:{default:[G_]},$$scope:{ctx:t}};return t[0]!==void 0&&(s.open=t[0]),e=new Gt({props:s}),Ce.push(()=>Ut(e,"open",i)),{c(){U(e.$$.fragment)},m(o,u){H(e,o,u),r=!0},p(o,[u]){const l={};u&8222&&(l.$$scope={dirty:u,ctx:o}),!n&&u&1&&(n=!0,l.open=o[0],Vt(()=>n=!1)),e.$set(l)},i(o){r||(b(e.$$.fragment,o),r=!0)},o(o){y(e.$$.fragment,o),r=!1},d(o){V(e,o)}}}function Z_(t,e,n){let r,i,s;const o=Ct(),u=Ci();x(t,u,_=>n(4,s=_));const l=Et();x(t,l,_=>n(3,i=_));let a=!1,f="";function c(_){}const m=di({mutationFn:async()=>{const _=await window.fetch("/api/branches/"+(i==null?void 0:i.id)+"/merge-from-default",{method:"POST",headers:{Accept:"application/json"}});_.ok?(o.invalidateQueries({queryKey:["branches"]}),Ge.set(Ae.NONE)):(n(1,f=(await _.json()).detail[0].msg),n(1,f=f[0].toUpperCase()+f.substring(1)))}});x(t,m,_=>n(2,r=_));function p(_){_.preventDefault(),r.mutate()}function d(_){a=_,n(0,a)}return[a,f,r,i,s,u,l,c,m,p,d]}class X_ extends ve{constructor(e){super(),ye(this,e,Z_,Y_,fe,{})}}function J_(t){var s,o;let e,n=((s=t[3])!=null&&s.fullpath?(o=t[3])==null?void 0:o.fullpath:"/")+"",r,i;return{c(){e=Z('Create a new Folder in "'),r=Z(n),i=Z('"')},m(u,l){w(u,e,l),w(u,r,l),w(u,i,l)},p(u,l){var a,f;l&8&&n!==(n=((a=u[3])!=null&&a.fullpath?(f=u[3])==null?void 0:f.fullpath:"/")+"")&&je(r,n)},d(u){u&&(E(e),E(r),E(i))}}}function pu(t){let e,n;return{c(){e=S("span"),n=Z(t[2]),N(e,"data-form-field-error","")},m(r,i){w(r,e,i),P(e,n)},p(r,i){i&4&&je(n,r[2])},d(r){r&&E(e)}}}function x_(t){let e;return{c(){e=Z("Don't create")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function eg(t){let e,n,r,i,s,o,u,l,a,f,c,m,p,d,_,v;e=new Tt({props:{$$slots:{default:[J_]},$$scope:{ctx:t}}});let g=t[2]&&pu(t);return c=new Mt({props:{"data-button":!0,$$slots:{default:[x_]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=B(),r=S("form"),i=S("label"),s=S("span"),s.textContent="New Folder Name",o=B(),u=S("input"),l=B(),g&&g.c(),a=B(),f=S("div"),U(c.$$.fragment),m=B(),p=S("button"),p.textContent="Create",N(s,"data-form-field-label",""),N(u,"type","text"),N(u,"data-form-field-text",""),N(p,"type","submit"),N(p,"data-button",""),N(f,"data-dialog-buttons",""),N(r,"data-dialog-content-area","")},m(h,k){H(e,h,k),w(h,n,k),w(h,r,k),P(r,i),P(i,s),P(i,o),P(i,u),it(u,t[1]),P(i,l),g&&g.m(i,null),P(r,a),P(r,f),H(c,f,null),P(f,m),P(f,p),d=!0,_||(v=[G(u,"input",t[7]),G(r,"submit",t[5])],_=!0)},p(h,k){const A={};k&2056&&(A.$$scope={dirty:k,ctx:h}),e.$set(A),k&2&&u.value!==h[1]&&it(u,h[1]),h[2]?g?g.p(h,k):(g=pu(h),g.c(),g.m(i,null)):g&&(g.d(1),g=null);const $={};k&2048&&($.$$scope={dirty:k,ctx:h}),c.$set($)},i(h){d||(b(e.$$.fragment,h),b(c.$$.fragment,h),d=!0)},o(h){y(e.$$.fragment,h),y(c.$$.fragment,h),d=!1},d(h){h&&(E(n),E(r)),V(e,h),g&&g.d(),V(c),_=!1,Te(v)}}}function tg(t){let e,n,r;function i(o){t[8](o)}let s={onOpenChange:t[6],$$slots:{default:[eg]},$$scope:{ctx:t}};return t[0]!==void 0&&(s.open=t[0]),e=new Gt({props:s}),Ce.push(()=>Ut(e,"open",i)),{c(){U(e.$$.fragment)},m(o,u){H(e,o,u),r=!0},p(o,[u]){const l={};u&2062&&(l.$$scope={dirty:u,ctx:o}),!n&&u&1&&(n=!0,l.open=o[0],Vt(()=>n=!1)),e.$set(l)},i(o){r||(b(e.$$.fragment,o),r=!0)},o(o){y(e.$$.fragment,o),r=!1},d(o){V(e,o)}}}function ng(t,e,n){let r,i;x(t,ft,d=>n(3,i=d));const s=Ct(),o=Et();x(t,o,d=>n(9,r=d));let u=!1,l="",a="";async function f(d){if(d.preventDefault(),l.trim()==="")n(2,a="Please enter a folder name");else{const _=await fetch("/api/branches/"+(r==null?void 0:r.id)+"/files/"+(i==null?void 0:i.fullpath)+"/"+l.trim(),{method:"POST",headers:{"X-uEditor-New-Type":"folder"}});_.ok?(n(0,u=!1),s.invalidateQueries({queryKey:["branches",r==null?void 0:r.id,"files/"]}),Ge.set(Ae.NONE)):(n(2,a=(await _.json()).detail[0].msg),n(2,a=a[0].toUpperCase()+a.substring(1)))}}function c(d){d?(n(1,l=""),n(2,a="")):Ge.set(Ae.NONE)}function m(){l=this.value,n(1,l)}function p(d){u=d,n(0,u)}return[u,l,a,i,o,f,c,m,p]}let rg=class extends ve{constructor(e){super(),ye(this,e,ng,tg,fe,{})}};function ig(t){var s;let e,n,r=((s=t[3])==null?void 0:s.fullpath)+"",i;return{c(){e=Z("Delete "),n=S("span"),i=Z(r),N(n,"class","font-bold")},m(o,u){w(o,e,u),w(o,n,u),P(n,i)},p(o,u){var l;u&8&&r!==(r=((l=o[3])==null?void 0:l.fullpath)+"")&&je(i,r)},d(o){o&&(E(e),E(n))}}}function hu(t){let e,n;return{c(){e=S("span"),n=Z(t[1]),N(e,"data-form-field-error","")},m(r,i){w(r,e,i),P(e,n)},p(r,i){i&2&&je(n,r[1])},d(r){r&&E(e)}}}function sg(t){let e;return{c(){e=Z("Don't delete")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function og(t){var K;let e,n,r,i,s,o,u=((K=t[3])==null?void 0:K.fullpath)+"",l,a,f,c,m,p,d,_,v,g,h,k,A,$,C,F;e=new Tt({props:{class:"bg-rose-700",$$slots:{default:[ig]},$$scope:{ctx:t}}});let R=t[1]&&hu(t);return h=new Mt({props:{"data-button":!0,$$slots:{default:[sg]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=B(),r=S("form"),i=S("p"),s=Z("Please confirm you wish to delete the folder "),o=S("span"),l=Z(u),a=Z(`
15
- and all the files and folders within that. To confirm the action, please enter
16
- the name of the folder to delete.`),f=B(),c=S("label"),m=S("span"),m.textContent="Confirmation Folder Name",p=B(),d=S("input"),_=B(),R&&R.c(),v=B(),g=S("div"),U(h.$$.fragment),k=B(),A=S("button"),A.textContent="Delete",N(o,"class","inline-block mx-1 px-2 border border-fuchsia-700 rounded font-bold"),N(i,"class","mb-4"),N(m,"data-form-field-label",""),N(d,"type","text"),N(d,"data-form-field-text",""),N(c,"class","block"),N(A,"type","submit"),N(A,"data-button",""),N(A,"class","border-rose-700 hover:bg-rose-700 focus:bg-rose-700"),N(g,"data-dialog-buttons",""),N(r,"data-dialog-content-area","")},m(M,D){H(e,M,D),w(M,n,D),w(M,r,D),P(r,i),P(i,s),P(i,o),P(o,l),P(i,a),P(r,f),P(r,c),P(c,m),P(c,p),P(c,d),it(d,t[2]),P(c,_),R&&R.m(c,null),P(r,v),P(r,g),H(h,g,null),P(g,k),P(g,A),$=!0,C||(F=[G(d,"input",t[7]),G(r,"submit",t[5])],C=!0)},p(M,D){var L;const I={};D&2056&&(I.$$scope={dirty:D,ctx:M}),e.$set(I),(!$||D&8)&&u!==(u=((L=M[3])==null?void 0:L.fullpath)+"")&&je(l,u),D&4&&d.value!==M[2]&&it(d,M[2]),M[1]?R?R.p(M,D):(R=hu(M),R.c(),R.m(c,null)):R&&(R.d(1),R=null);const O={};D&2048&&(O.$$scope={dirty:D,ctx:M}),h.$set(O)},i(M){$||(b(e.$$.fragment,M),b(h.$$.fragment,M),$=!0)},o(M){y(e.$$.fragment,M),y(h.$$.fragment,M),$=!1},d(M){M&&(E(n),E(r)),V(e,M),R&&R.d(),V(h),C=!1,Te(F)}}}function lg(t){let e,n,r;function i(o){t[8](o)}let s={onOpenChange:t[6],$$slots:{default:[og]},$$scope:{ctx:t}};return t[0]!==void 0&&(s.open=t[0]),e=new Gt({props:s}),Ce.push(()=>Ut(e,"open",i)),{c(){U(e.$$.fragment)},m(o,u){H(e,o,u),r=!0},p(o,[u]){const l={};u&2062&&(l.$$scope={dirty:u,ctx:o}),!n&&u&1&&(n=!0,l.open=o[0],Vt(()=>n=!1)),e.$set(l)},i(o){r||(b(e.$$.fragment,o),r=!0)},o(o){y(e.$$.fragment,o),r=!1},d(o){V(e,o)}}}function ug(t,e,n){let r,i;x(t,ft,d=>n(3,i=d));const s=Ct(),o=Et();x(t,o,d=>n(9,r=d));let u=!1,l="",a="";async function f(d){d.preventDefault(),n(1,l=""),a===(i==null?void 0:i.fullpath)||a==(i==null?void 0:i.name)?(await fetch("/api/branches/"+(r==null?void 0:r.id)+"/files/"+i.fullpath,{method:"DELETE"})).ok&&(s.invalidateQueries({queryKey:["branches",r==null?void 0:r.id,"files/"]}),ft.set(null),n(0,u=!1),Ge.set(Ae.NONE)):n(1,l="Please check that you have typed in the correct name.")}function c(d){d?(n(2,a=""),n(1,l="")):Ge.set(Ae.NONE)}function m(){a=this.value,n(2,a)}function p(d){u=d,n(0,u)}return[u,l,a,i,o,f,c,m,p]}let uf=class extends ve{constructor(e){super(),ye(this,e,ug,lg,fe,{})}};function ag(t){var s,o;let e,n=((s=t[3])!=null&&s.fullpath?(o=t[3])==null?void 0:o.fullpath:"/")+"",r,i;return{c(){e=Z('Rename "'),r=Z(n),i=Z('"')},m(u,l){w(u,e,l),w(u,r,l),w(u,i,l)},p(u,l){var a,f;l&8&&n!==(n=((a=u[3])!=null&&a.fullpath?(f=u[3])==null?void 0:f.fullpath:"/")+"")&&je(r,n)},d(u){u&&(E(e),E(r),E(i))}}}function _u(t){let e,n;return{c(){e=S("span"),n=Z(t[2]),N(e,"data-form-field-error","")},m(r,i){w(r,e,i),P(e,n)},p(r,i){i&4&&je(n,r[2])},d(r){r&&E(e)}}}function fg(t){let e;return{c(){e=Z("Don't rename")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function cg(t){let e,n,r,i,s,o,u,l,a,f,c,m,p,d,_,v;e=new Tt({props:{$$slots:{default:[ag]},$$scope:{ctx:t}}});let g=t[2]&&_u(t);return c=new Mt({props:{"data-button":!0,$$slots:{default:[fg]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=B(),r=S("form"),i=S("label"),s=S("span"),s.textContent="New Folder Name",o=B(),u=S("input"),l=B(),g&&g.c(),a=B(),f=S("div"),U(c.$$.fragment),m=B(),p=S("button"),p.textContent="Rename",N(s,"data-form-field-label",""),N(u,"type","text"),N(u,"data-form-field-text",""),N(p,"type","submit"),N(p,"data-button",""),N(f,"data-dialog-buttons",""),N(r,"data-dialog-content-area","")},m(h,k){H(e,h,k),w(h,n,k),w(h,r,k),P(r,i),P(i,s),P(i,o),P(i,u),it(u,t[1]),P(i,l),g&&g.m(i,null),P(r,a),P(r,f),H(c,f,null),P(f,m),P(f,p),d=!0,_||(v=[G(u,"input",t[7]),G(r,"submit",t[5])],_=!0)},p(h,k){const A={};k&2056&&(A.$$scope={dirty:k,ctx:h}),e.$set(A),k&2&&u.value!==h[1]&&it(u,h[1]),h[2]?g?g.p(h,k):(g=_u(h),g.c(),g.m(i,null)):g&&(g.d(1),g=null);const $={};k&2048&&($.$$scope={dirty:k,ctx:h}),c.$set($)},i(h){d||(b(e.$$.fragment,h),b(c.$$.fragment,h),d=!0)},o(h){y(e.$$.fragment,h),y(c.$$.fragment,h),d=!1},d(h){h&&(E(n),E(r)),V(e,h),g&&g.d(),V(c),_=!1,Te(v)}}}function dg(t){let e,n,r;function i(o){t[8](o)}let s={onOpenChange:t[6],$$slots:{default:[cg]},$$scope:{ctx:t}};return t[0]!==void 0&&(s.open=t[0]),e=new Gt({props:s}),Ce.push(()=>Ut(e,"open",i)),{c(){U(e.$$.fragment)},m(o,u){H(e,o,u),r=!0},p(o,[u]){const l={};u&2062&&(l.$$scope={dirty:u,ctx:o}),!n&&u&1&&(n=!0,l.open=o[0],Vt(()=>n=!1)),e.$set(l)},i(o){r||(b(e.$$.fragment,o),r=!0)},o(o){y(e.$$.fragment,o),r=!1},d(o){V(e,o)}}}function mg(t,e,n){let r,i;x(t,ft,d=>n(3,i=d));const s=Ct(),o=Et();x(t,o,d=>n(9,r=d));let u=!1,l="",a="";async function f(d){if(d.preventDefault(),l.trim()==="")n(2,a="Please enter a folder name");else if(i!=null&&i.fullpath){const _=i.fullpath.split("/").slice(0,i.fullpath.split("/").length-1).join("/"),v=await fetch("/api/branches/"+(r==null?void 0:r.id)+"/files/"+_+"/"+l.trim(),{method:"POST",headers:{"X-uEditor-New-Type":"folder","X-uEditor-Rename-From":i==null?void 0:i.fullpath}});v.ok?(n(0,u=!1),s.invalidateQueries({queryKey:["branches",r==null?void 0:r.id,"files/"]}),ft.set(null),Ge.set(Ae.NONE)):(n(2,a=(await v.json()).detail[0].msg),n(2,a=a[0].toUpperCase()+a.substring(1)))}else n(2,a="Cannot rename the root folder")}function c(d){d?(n(1,l=""),n(2,a="")):Ge.set(Ae.NONE)}function m(){l=this.value,n(1,l)}function p(d){u=d,n(0,u)}return[u,l,a,i,o,f,c,m,p]}let pg=class extends ve{constructor(e){super(),ye(this,e,mg,dg,fe,{})}};function hg(t){var s,o;let e,n=((s=t[3])!=null&&s.fullpath?(o=t[3])==null?void 0:o.fullpath:"/")+"",r,i;return{c(){e=Z('Create a new File in "'),r=Z(n),i=Z('"')},m(u,l){w(u,e,l),w(u,r,l),w(u,i,l)},p(u,l){var a,f;l&8&&n!==(n=((a=u[3])!=null&&a.fullpath?(f=u[3])==null?void 0:f.fullpath:"/")+"")&&je(r,n)},d(u){u&&(E(e),E(r),E(i))}}}function gu(t){let e,n;return{c(){e=S("span"),n=Z(t[2]),N(e,"data-form-field-error","")},m(r,i){w(r,e,i),P(e,n)},p(r,i){i&4&&je(n,r[2])},d(r){r&&E(e)}}}function _g(t){let e;return{c(){e=Z("Don't create")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function gg(t){let e,n,r,i,s,o,u,l,a,f,c,m,p,d,_,v;e=new Tt({props:{$$slots:{default:[hg]},$$scope:{ctx:t}}});let g=t[2]&&gu(t);return c=new Mt({props:{"data-button":!0,$$slots:{default:[_g]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=B(),r=S("form"),i=S("label"),s=S("span"),s.textContent="New Filename",o=B(),u=S("input"),l=B(),g&&g.c(),a=B(),f=S("div"),U(c.$$.fragment),m=B(),p=S("button"),p.textContent="Create",N(s,"data-form-field-label",""),N(u,"type","text"),N(u,"data-form-field-text",""),N(p,"type","submit"),N(p,"data-button",""),N(f,"data-dialog-buttons",""),N(r,"data-dialog-content-area","")},m(h,k){H(e,h,k),w(h,n,k),w(h,r,k),P(r,i),P(i,s),P(i,o),P(i,u),it(u,t[1]),P(i,l),g&&g.m(i,null),P(r,a),P(r,f),H(c,f,null),P(f,m),P(f,p),d=!0,_||(v=[G(u,"input",t[7]),G(r,"submit",t[5])],_=!0)},p(h,k){const A={};k&2056&&(A.$$scope={dirty:k,ctx:h}),e.$set(A),k&2&&u.value!==h[1]&&it(u,h[1]),h[2]?g?g.p(h,k):(g=gu(h),g.c(),g.m(i,null)):g&&(g.d(1),g=null);const $={};k&2048&&($.$$scope={dirty:k,ctx:h}),c.$set($)},i(h){d||(b(e.$$.fragment,h),b(c.$$.fragment,h),d=!0)},o(h){y(e.$$.fragment,h),y(c.$$.fragment,h),d=!1},d(h){h&&(E(n),E(r)),V(e,h),g&&g.d(),V(c),_=!1,Te(v)}}}function bg(t){let e,n,r;function i(o){t[8](o)}let s={onOpenChange:t[6],$$slots:{default:[gg]},$$scope:{ctx:t}};return t[0]!==void 0&&(s.open=t[0]),e=new Gt({props:s}),Ce.push(()=>Ut(e,"open",i)),{c(){U(e.$$.fragment)},m(o,u){H(e,o,u),r=!0},p(o,[u]){const l={};u&2062&&(l.$$scope={dirty:u,ctx:o}),!n&&u&1&&(n=!0,l.open=o[0],Vt(()=>n=!1)),e.$set(l)},i(o){r||(b(e.$$.fragment,o),r=!0)},o(o){y(e.$$.fragment,o),r=!1},d(o){V(e,o)}}}function yg(t,e,n){let r,i;x(t,ft,d=>n(3,i=d));const s=Ct(),o=Et();x(t,o,d=>n(9,r=d));let u=!1,l="",a="";async function f(d){if(d.preventDefault(),l.trim()==="")n(2,a="Please enter a filename");else{const _=await fetch("/api/branches/"+(r==null?void 0:r.id)+"/files/"+(i==null?void 0:i.fullpath)+"/"+l,{method:"POST",headers:{"X-uEditor-New-Type":"file"}});_.ok?(n(0,u=!1),s.invalidateQueries({queryKey:["branches",r==null?void 0:r.id,"files/"]}),Ge.set(Ae.NONE)):(n(2,a=(await _.json()).detail[0].msg),n(2,a=a[0].toUpperCase()+a.substring(1)))}}function c(d){d?(n(1,l=""),n(2,a="")):Ge.set(Ae.NONE)}function m(){l=this.value,n(1,l)}function p(d){u=d,n(0,u)}return[u,l,a,i,o,f,c,m,p]}class vg extends ve{constructor(e){super(),ye(this,e,yg,bg,fe,{})}}function kg(t){var s;let e,n,r=((s=t[3])==null?void 0:s.fullpath)+"",i;return{c(){e=Z("Delete "),n=S("span"),i=Z(r),N(n,"class","font-bold")},m(o,u){w(o,e,u),w(o,n,u),P(n,i)},p(o,u){var l;u&8&&r!==(r=((l=o[3])==null?void 0:l.fullpath)+"")&&je(i,r)},d(o){o&&(E(e),E(n))}}}function bu(t){let e,n;return{c(){e=S("span"),n=Z(t[1]),N(e,"data-form-field-error","")},m(r,i){w(r,e,i),P(e,n)},p(r,i){i&2&&je(n,r[1])},d(r){r&&E(e)}}}function Cg(t){let e;return{c(){e=Z("Don't delete")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function Eg(t){var K;let e,n,r,i,s,o,u=((K=t[3])==null?void 0:K.fullpath)+"",l,a,f,c,m,p,d,_,v,g,h,k,A,$,C,F;e=new Tt({props:{class:"bg-rose-700",$$slots:{default:[kg]},$$scope:{ctx:t}}});let R=t[1]&&bu(t);return h=new Mt({props:{"data-button":!0,$$slots:{default:[Cg]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=B(),r=S("form"),i=S("p"),s=Z("Please confirm you wish to delete the file "),o=S("span"),l=Z(u),a=Z(". To confirm the action, please enter the name of the file to delete."),f=B(),c=S("label"),m=S("span"),m.textContent="Confirm filename",p=B(),d=S("input"),_=B(),R&&R.c(),v=B(),g=S("div"),U(h.$$.fragment),k=B(),A=S("button"),A.textContent="Delete",N(o,"class","inline-block mx-1 px-2 border border-fuchsia-700 rounded font-bold"),N(i,"class","mb-4"),N(m,"data-form-field-label",""),N(d,"type","text"),N(d,"data-form-field-text",""),N(c,"class","block"),N(A,"type","submit"),N(A,"data-button",""),N(A,"class","border-rose-700 hover:bg-rose-700 focus:bg-rose-700"),N(g,"data-dialog-buttons",""),N(r,"data-dialog-content-area","")},m(M,D){H(e,M,D),w(M,n,D),w(M,r,D),P(r,i),P(i,s),P(i,o),P(o,l),P(i,a),P(r,f),P(r,c),P(c,m),P(c,p),P(c,d),it(d,t[2]),P(c,_),R&&R.m(c,null),P(r,v),P(r,g),H(h,g,null),P(g,k),P(g,A),$=!0,C||(F=[G(d,"input",t[7]),G(r,"submit",t[5])],C=!0)},p(M,D){var L;const I={};D&2056&&(I.$$scope={dirty:D,ctx:M}),e.$set(I),(!$||D&8)&&u!==(u=((L=M[3])==null?void 0:L.fullpath)+"")&&je(l,u),D&4&&d.value!==M[2]&&it(d,M[2]),M[1]?R?R.p(M,D):(R=bu(M),R.c(),R.m(c,null)):R&&(R.d(1),R=null);const O={};D&2048&&(O.$$scope={dirty:D,ctx:M}),h.$set(O)},i(M){$||(b(e.$$.fragment,M),b(h.$$.fragment,M),$=!0)},o(M){y(e.$$.fragment,M),y(h.$$.fragment,M),$=!1},d(M){M&&(E(n),E(r)),V(e,M),R&&R.d(),V(h),C=!1,Te(F)}}}function wg(t){let e,n,r;function i(o){t[8](o)}let s={onOpenChange:t[6],$$slots:{default:[Eg]},$$scope:{ctx:t}};return t[0]!==void 0&&(s.open=t[0]),e=new Gt({props:s}),Ce.push(()=>Ut(e,"open",i)),{c(){U(e.$$.fragment)},m(o,u){H(e,o,u),r=!0},p(o,[u]){const l={};u&2062&&(l.$$scope={dirty:u,ctx:o}),!n&&u&1&&(n=!0,l.open=o[0],Vt(()=>n=!1)),e.$set(l)},i(o){r||(b(e.$$.fragment,o),r=!0)},o(o){y(e.$$.fragment,o),r=!1},d(o){V(e,o)}}}function Og(t,e,n){let r,i;x(t,ft,d=>n(3,i=d));const s=Ct(),o=Et();x(t,o,d=>n(9,r=d));let u=!1,l="",a="";async function f(d){d.preventDefault(),n(1,l=""),a===(i==null?void 0:i.fullpath)||a==(i==null?void 0:i.name)?(await fetch("/api/branches/"+(r==null?void 0:r.id)+"/files/"+i.fullpath,{method:"DELETE"})).ok&&(s.invalidateQueries({queryKey:["branches",r==null?void 0:r.id,"files/"]}),ft.set(null),n(0,u=!1),Ge.set(Ae.NONE)):n(1,l="Please check that you have typed in the correct name.")}function c(d){d?(n(2,a=""),n(1,l="")):Ge.set(Ae.NONE)}function m(){a=this.value,n(2,a)}function p(d){u=d,n(0,u)}return[u,l,a,i,o,f,c,m,p]}class Ag extends ve{constructor(e){super(),ye(this,e,Og,wg,fe,{})}}function Tg(t){var s,o;let e,n=((s=t[3])!=null&&s.fullpath?(o=t[3])==null?void 0:o.fullpath:"/")+"",r,i;return{c(){e=Z('Rename "'),r=Z(n),i=Z('"')},m(u,l){w(u,e,l),w(u,r,l),w(u,i,l)},p(u,l){var a,f;l&8&&n!==(n=((a=u[3])!=null&&a.fullpath?(f=u[3])==null?void 0:f.fullpath:"/")+"")&&je(r,n)},d(u){u&&(E(e),E(r),E(i))}}}function yu(t){let e,n;return{c(){e=S("span"),n=Z(t[2]),N(e,"data-form-field-error","")},m(r,i){w(r,e,i),P(e,n)},p(r,i){i&4&&je(n,r[2])},d(r){r&&E(e)}}}function $g(t){let e;return{c(){e=Z("Don't rename")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function Sg(t){let e,n,r,i,s,o,u,l,a,f,c,m,p,d,_,v;e=new Tt({props:{$$slots:{default:[Tg]},$$scope:{ctx:t}}});let g=t[2]&&yu(t);return c=new Mt({props:{"data-button":!0,$$slots:{default:[$g]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=B(),r=S("form"),i=S("label"),s=S("span"),s.textContent="New Filename",o=B(),u=S("input"),l=B(),g&&g.c(),a=B(),f=S("div"),U(c.$$.fragment),m=B(),p=S("button"),p.textContent="Rename",N(s,"data-form-field-label",""),N(u,"type","text"),N(u,"data-form-field-text",""),N(p,"type","submit"),N(p,"data-button",""),N(f,"data-dialog-buttons",""),N(r,"data-dialog-content-area","")},m(h,k){H(e,h,k),w(h,n,k),w(h,r,k),P(r,i),P(i,s),P(i,o),P(i,u),it(u,t[1]),P(i,l),g&&g.m(i,null),P(r,a),P(r,f),H(c,f,null),P(f,m),P(f,p),d=!0,_||(v=[G(u,"input",t[7]),G(r,"submit",t[5])],_=!0)},p(h,k){const A={};k&2056&&(A.$$scope={dirty:k,ctx:h}),e.$set(A),k&2&&u.value!==h[1]&&it(u,h[1]),h[2]?g?g.p(h,k):(g=yu(h),g.c(),g.m(i,null)):g&&(g.d(1),g=null);const $={};k&2048&&($.$$scope={dirty:k,ctx:h}),c.$set($)},i(h){d||(b(e.$$.fragment,h),b(c.$$.fragment,h),d=!0)},o(h){y(e.$$.fragment,h),y(c.$$.fragment,h),d=!1},d(h){h&&(E(n),E(r)),V(e,h),g&&g.d(),V(c),_=!1,Te(v)}}}function Rg(t){let e,n,r;function i(o){t[8](o)}let s={onOpenChange:t[6],$$slots:{default:[Sg]},$$scope:{ctx:t}};return t[0]!==void 0&&(s.open=t[0]),e=new Gt({props:s}),Ce.push(()=>Ut(e,"open",i)),{c(){U(e.$$.fragment)},m(o,u){H(e,o,u),r=!0},p(o,[u]){const l={};u&2062&&(l.$$scope={dirty:u,ctx:o}),!n&&u&1&&(n=!0,l.open=o[0],Vt(()=>n=!1)),e.$set(l)},i(o){r||(b(e.$$.fragment,o),r=!0)},o(o){y(e.$$.fragment,o),r=!1},d(o){V(e,o)}}}function Dg(t,e,n){let r,i;x(t,ft,d=>n(3,i=d));const s=Ct(),o=Et();x(t,o,d=>n(9,r=d));let u=!1,l="",a="";async function f(d){if(d.preventDefault(),l.trim()==="")n(2,a="Please enter a folder name");else if(i!=null&&i.fullpath){const _=i.fullpath.split("/").slice(0,i.fullpath.split("/").length-1).join("/"),v=await fetch("/api/branches/"+(r==null?void 0:r.id)+"/files/"+_+"/"+l.trim(),{method:"POST",headers:{"X-uEditor-New-Type":"file","X-uEditor-Rename-From":i==null?void 0:i.fullpath}});v.ok?(n(0,u=!1),s.invalidateQueries({queryKey:["branches",r==null?void 0:r.id,"files/"]}),ft.set(null),Ge.set(Ae.NONE)):(n(2,a=(await v.json()).detail[0].msg),n(2,a=a[0].toUpperCase()+a.substring(1)))}else n(2,a="Cannot rename the root folder")}function c(d){d?(n(1,l=""),n(2,a="")):Ge.set(Ae.NONE)}function m(){l=this.value,n(1,l)}function p(d){u=d,n(0,u)}return[u,l,a,i,o,f,c,m,p]}class Fg extends ve{constructor(e){super(),ye(this,e,Dg,Rg,fe,{})}}function vu(t,e,n){const r=t.slice();return r[21]=e[n][0],r[22]=e[n][1],r}function Pg(t){let e;return{c(){e=Z("Upload")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function Lg(t){let e;return{c(){e=Z("Uploading")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function Ig(t){var l,a;let e,n=((l=t[6])!=null&&l.fullpath?(a=t[6])==null?void 0:a.fullpath:"/")+"",r,i;function s(f,c){return f[4].length>0?Lg:Pg}let o=s(t),u=o(t);return{c(){u.c(),e=Z(' Files to "'),r=Z(n),i=Z('"')},m(f,c){u.m(f,c),w(f,e,c),w(f,r,c),w(f,i,c)},p(f,c){var m,p;o!==(o=s(f))&&(u.d(1),u=o(f),u&&(u.c(),u.m(e.parentNode,e))),c&64&&n!==(n=((m=f[6])!=null&&m.fullpath?(p=f[6])==null?void 0:p.fullpath:"/")+"")&&je(r,n)},d(f){f&&(E(e),E(r),E(i)),u.d(f)}}}function Mg(t){let e,n,r,i,s,o,u=tn(t[4]),l=[];for(let f=0;f<u.length;f+=1)l[f]=ku(vu(t,u,f));const a=f=>y(l[f],1,1,()=>{l[f]=null});return s=new Mt({props:{"data-button":!0,$$slots:{default:[Wg]},$$scope:{ctx:t}}}),{c(){e=S("div"),n=S("ul");for(let f=0;f<l.length;f+=1)l[f].c();r=B(),i=S("div"),U(s.$$.fragment),N(i,"data-dialog-buttons",""),N(e,"data-dialog-content-area","")},m(f,c){w(f,e,c),P(e,n);for(let m=0;m<l.length;m+=1)l[m]&&l[m].m(n,null);P(e,r),P(e,i),H(s,i,null),o=!0},p(f,c){if(c&144){u=tn(f[4]);let p;for(p=0;p<u.length;p+=1){const d=vu(f,u,p);l[p]?(l[p].p(d,c),b(l[p],1)):(l[p]=ku(d),l[p].c(),b(l[p],1),l[p].m(n,null))}for(_e(),p=u.length;p<l.length;p+=1)a(p);ge()}const m={};c&33554464&&(m.$$scope={dirty:c,ctx:f}),s.$set(m)},i(f){if(!o){for(let c=0;c<u.length;c+=1)b(l[c]);b(s.$$.fragment,f),o=!0}},o(f){l=l.filter(Boolean);for(let c=0;c<l.length;c+=1)y(l[c]);y(s.$$.fragment,f),o=!1},d(f){f&&E(e),fi(l,f),V(s)}}}function Ng(t){let e,n,r,i,s,o,u,l,a,f,c,m,p,d;return a=new Mt({props:{"data-button":!0,$$slots:{default:[qg]},$$scope:{ctx:t}}}),{c(){e=S("form"),n=S("label"),r=S("span"),r.textContent="Drop a file to upload or click to select a file to upload.",i=B(),s=S("input"),u=B(),l=S("div"),U(a.$$.fragment),f=B(),c=S("button"),c.textContent="Upload",N(s,"type","file"),N(s,"class","sr-only"),N(n,"class",o="flex justify-center items-center h-20 border-fuchsia-700 border-2 "+(t[2]?"border-solid":"border-dashed")+" rounded"),N(c,"type","submit"),N(c,"data-button",""),N(c,"class","sr-only"),N(l,"data-dialog-buttons",""),N(e,"data-dialog-content-area","")},m(_,v){w(_,e,v),P(e,n),P(n,r),P(n,i),P(n,s),t[12](s),P(e,u),P(e,l),H(a,l,null),P(l,f),P(l,c),t[16](c),m=!0,p||(d=[G(s,"change",t[13]),G(n,"drop",t[11]),G(n,"dragover",t[14]),G(n,"dragleave",t[15]),G(e,"submit",t[10])],p=!0)},p(_,v){(!m||v&4&&o!==(o="flex justify-center items-center h-20 border-fuchsia-700 border-2 "+(_[2]?"border-solid":"border-dashed")+" rounded"))&&N(n,"class",o);const g={};v&33554432&&(g.$$scope={dirty:v,ctx:_}),a.$set(g)},i(_){m||(b(a.$$.fragment,_),m=!0)},o(_){y(a.$$.fragment,_),m=!1},d(_){_&&E(e),t[12](null),V(a),t[16](null),p=!1,Te(d)}}}function Hg(t){let e,n,r,i;return r=new Ne({props:{path:w1,class:"w-6 h-6 text-rose-700"}}),{c(){e=S("span"),e.textContent="failed to upload",n=B(),U(r.$$.fragment),N(e,"class","sr-only")},m(s,o){w(s,e,o),w(s,n,o),H(r,s,o),i=!0},i(s){i||(b(r.$$.fragment,s),i=!0)},o(s){y(r.$$.fragment,s),i=!1},d(s){s&&(E(e),E(n)),V(r,s)}}}function Vg(t){let e,n,r,i;return r=new Ne({props:{path:C1,class:"w-6 h-6 text-lime-500"}}),{c(){e=S("span"),e.textContent="successfully uploaded",n=B(),U(r.$$.fragment),N(e,"class","sr-only")},m(s,o){w(s,e,o),w(s,n,o),H(r,s,o),i=!0},i(s){i||(b(r.$$.fragment,s),i=!0)},o(s){y(r.$$.fragment,s),i=!1},d(s){s&&(E(e),E(n)),V(r,s)}}}function Ug(t){let e,n,r,i;return r=new Ne({props:{path:zt,class:"w-6 h-6 animate-spin text-fuchsia-700"}}),{c(){e=S("span"),e.textContent="uploading",n=B(),U(r.$$.fragment),N(e,"class","sr-only")},m(s,o){w(s,e,o),w(s,n,o),H(r,s,o),i=!0},i(s){i||(b(r.$$.fragment,s),i=!0)},o(s){y(r.$$.fragment,s),i=!1},d(s){s&&(E(e),E(n)),V(r,s)}}}function Bg(t){let e,n,r,i;return r=new Ne({props:{path:K1}}),{c(){e=S("span"),e.textContent="waiting to upload",n=B(),U(r.$$.fragment),N(e,"class","sr-only")},m(s,o){w(s,e,o),w(s,n,o),H(r,s,o),i=!0},i(s){i||(b(r.$$.fragment,s),i=!0)},o(s){y(r.$$.fragment,s),i=!1},d(s){s&&(E(e),E(n)),V(r,s)}}}function ku(t){let e,n,r=t[21].name+"",i,s,o,u,l,a;const f=[Bg,Ug,Vg,Hg],c=[];function m(p,d){return p[22]===p[7].READY?0:p[22]==p[7].ACTIVE?1:p[22]===p[7].SUCCESS?2:p[22]===p[7].FAILED?3:-1}return~(o=m(t))&&(u=c[o]=f[o](t)),{c(){e=S("li"),n=S("span"),i=Z(r),s=B(),u&&u.c(),l=B(),N(n,"class","flex-1"),N(e,"class","flex flex-row space-x-4")},m(p,d){w(p,e,d),P(e,n),P(n,i),P(e,s),~o&&c[o].m(e,null),P(e,l),a=!0},p(p,d){(!a||d&16)&&r!==(r=p[21].name+"")&&je(i,r);let _=o;o=m(p),o!==_&&(u&&(_e(),y(c[_],1,1,()=>{c[_]=null}),ge()),~o?(u=c[o],u||(u=c[o]=f[o](p),u.c()),b(u,1),u.m(e,l)):u=null)},i(p){a||(b(u),a=!0)},o(p){y(u),a=!1},d(p){p&&E(e),~o&&c[o].d()}}}function Kg(t){let e;return{c(){e=Z("Cancel upload")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function jg(t){let e;return{c(){e=Z("Close")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function Wg(t){let e;function n(s,o){return s[5]?jg:Kg}let r=n(t),i=r(t);return{c(){i.c(),e=Se()},m(s,o){i.m(s,o),w(s,e,o)},p(s,o){r!==(r=n(s))&&(i.d(1),i=r(s),i&&(i.c(),i.m(e.parentNode,e)))},d(s){s&&E(e),i.d(s)}}}function qg(t){let e;return{c(){e=Z("Don't upload")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function Qg(t){let e,n,r,i,s,o;e=new Tt({props:{$$slots:{default:[Ig]},$$scope:{ctx:t}}});const u=[Ng,Mg],l=[];function a(f,c){return f[4].length===0?0:1}return r=a(t),i=l[r]=u[r](t),{c(){U(e.$$.fragment),n=B(),i.c(),s=Se()},m(f,c){H(e,f,c),w(f,n,c),l[r].m(f,c),w(f,s,c),o=!0},p(f,c){const m={};c&33554512&&(m.$$scope={dirty:c,ctx:f}),e.$set(m);let p=r;r=a(f),r===p?l[r].p(f,c):(_e(),y(l[p],1,1,()=>{l[p]=null}),ge(),i=l[r],i?i.p(f,c):(i=l[r]=u[r](f),i.c()),b(i,1),i.m(s.parentNode,s))},i(f){o||(b(e.$$.fragment,f),b(i),o=!0)},o(f){y(e.$$.fragment,f),y(i),o=!1},d(f){f&&(E(n),E(s)),V(e,f),l[r].d(f)}}}function zg(t){let e,n,r;function i(o){t[17](o)}let s={onOpenChange:t[9],$$slots:{default:[Qg]},$$scope:{ctx:t}};return t[3]!==void 0&&(s.open=t[3]),e=new Gt({props:s}),Ce.push(()=>Ut(e,"open",i)),{c(){U(e.$$.fragment)},m(o,u){H(e,o,u),r=!0},p(o,[u]){const l={};u&33554551&&(l.$$scope={dirty:u,ctx:o}),!n&&u&8&&(n=!0,l.open=o[3],Vt(()=>n=!1)),e.$set(l)},i(o){r||(b(e.$$.fragment,o),r=!0)},o(o){y(e.$$.fragment,o),r=!1},d(o){V(e,o)}}}function Gg(t,e,n){let r,i;x(t,ft,R=>n(6,i=R));var s=(R=>(R[R.READY=0]="READY",R[R.ACTIVE=1]="ACTIVE",R[R.SUCCESS=2]="SUCCESS",R[R.FAILED=3]="FAILED",R))(s||{});const o=Ct(),u=Et();x(t,u,R=>n(18,r=R));let l=null,a=null,f=!1,c=!1,m=[],p=!1;function d(R){R||Ge.set(Ae.NONE)}async function _(R){if(R.preventDefault(),l&&l.files){n(4,m=[]);for(let K of l.files)m.push([K,0]);m.length>0&&g()}}async function v(R){if(R.preventDefault(),n(4,m=[]),R.dataTransfer&&R.dataTransfer.items){for(let K of R.dataTransfer.items)if(K.kind==="file"){const M=K.getAsFile();M!==null&&m.push([M,0])}m.length>0&&g()}}async function g(){n(5,p=!1);for(let R of m){if(!c)break;if(R[1]=1,n(4,m),(await fetch("/api/branches/"+(r==null?void 0:r.id)+"/files/"+(i==null?void 0:i.fullpath)+"/"+R[0].name,{method:"POST",headers:{"X-uEditor-New-Type":"file"}})).ok){const M=new FormData;M.append("content",R[0]),(await fetch("/api/branches/"+(r==null?void 0:r.id)+"/files/"+(i==null?void 0:i.fullpath)+"/"+R[0].name,{method:"PUT",body:M})).ok?R[1]=2:R[1]=3,n(4,m)}else R[1]=3,n(4,m)}o.invalidateQueries({queryKey:["branches",r==null?void 0:r.id,"files/"]}),n(5,p=!0)}function h(R){Ce[R?"unshift":"push"](()=>{l=R,n(0,l)})}const k=()=>{a&&a.click()},A=R=>{R.preventDefault(),n(2,f=!0)},$=()=>{n(2,f=!1)};function C(R){Ce[R?"unshift":"push"](()=>{a=R,n(1,a)})}function F(R){c=R,n(3,c)}return[l,a,f,c,m,p,i,s,u,d,_,v,h,k,A,$,C,F]}class Yg extends ve{constructor(e){super(),ye(this,e,Gg,zg,fe,{})}}function Zg(t){let e,n;return e=new Yg({}),{c(){U(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){y(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function Xg(t){let e,n;return e=new Fg({}),{c(){U(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){y(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function Jg(t){let e,n;return e=new Ag({}),{c(){U(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){y(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function xg(t){let e,n;return e=new vg({}),{c(){U(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){y(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function eb(t){let e,n;return e=new pg({}),{c(){U(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){y(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function tb(t){let e,n;return e=new uf({}),{c(){U(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){y(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function nb(t){let e,n;return e=new rg({}),{c(){U(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){y(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function rb(t){let e,n;return e=new X_({}),{c(){U(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){y(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function ib(t){let e,n;return e=new I_({}),{c(){U(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){y(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function sb(t){let e,n;return e=new j_({}),{c(){U(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){y(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function ob(t){let e,n;return e=new T_({}),{c(){U(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){y(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function lb(t){let e,n,r,i;const s=[ob,sb,ib,rb,nb,tb,eb,xg,Jg,Xg,Zg],o=[];function u(l,a){return l[0]===Ae.UEDITOR_NEW_BRANCH?0:l[0]===Ae.UEDITOR_IMPORT_REMOTE_BRANCH?1:l[0]===Ae.UEDITOR_DELETE_BRANCH?2:l[0]===Ae.UEDITOR_MERGE_FROM_DEFAULT?3:l[0]===Ae.FOLDER_CREATE?4:l[0]===Ae.FOLDER_DELETE?5:l[0]===Ae.FOLDER_RENAME?6:l[0]===Ae.FILE_CREATE?7:l[0]===Ae.FILE_DELETE?8:l[0]===Ae.FILE_RENAME?9:l[0]===Ae.FILE_UPLOAD?10:-1}return~(e=u(t))&&(n=o[e]=s[e](t)),{c(){n&&n.c(),r=Se()},m(l,a){~e&&o[e].m(l,a),w(l,r,a),i=!0},p(l,[a]){let f=e;e=u(l),e!==f&&(n&&(_e(),y(o[f],1,1,()=>{o[f]=null}),ge()),~e?(n=o[e],n||(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r)):n=null)},i(l){i||(b(n),i=!0)},o(l){y(n),i=!1},d(l){l&&E(r),~e&&o[e].d(l)}}}var Ae=(t=>(t[t.NONE=1]="NONE",t[t.UEDITOR_NEW_BRANCH=2]="UEDITOR_NEW_BRANCH",t[t.UEDITOR_IMPORT_REMOTE_BRANCH=3]="UEDITOR_IMPORT_REMOTE_BRANCH",t[t.UEDITOR_DELETE_BRANCH=4]="UEDITOR_DELETE_BRANCH",t[t.UEDITOR_MERGE_FROM_DEFAULT=5]="UEDITOR_MERGE_FROM_DEFAULT",t[t.FOLDER_CREATE=6]="FOLDER_CREATE",t[t.FOLDER_DELETE=7]="FOLDER_DELETE",t[t.FOLDER_RENAME=8]="FOLDER_RENAME",t[t.FILE_CREATE=9]="FILE_CREATE",t[t.FILE_DELETE=10]="FILE_DELETE",t[t.FILE_RENAME=11]="FILE_RENAME",t[t.FILE_UPLOAD=12]="FILE_UPLOAD",t))(Ae||{});const Ge=Fe(1);function ub(t,e,n){let r,i=ce;return x(t,Ge,s=>n(0,r=s)),t.$$.on_destroy.push(()=>i()),[r]}let ab=class extends ve{constructor(e){super(),ye(this,e,ub,lb,fe,{})}};const fb="modulepreload",cb=function(t){return"/app/"+t},Cu={},Pi=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),u=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.allSettled(n.map(l=>{if(l=cb(l),l in Cu)return;Cu[l]=!0;const a=l.endsWith(".css"),f=a?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${f}`))return;const c=document.createElement("link");if(c.rel=a?"stylesheet":fb,a||(c.as="script"),c.crossOrigin="",c.href=l,u&&c.setAttribute("nonce",u),document.head.appendChild(c),a)return new Promise((m,p)=>{c.addEventListener("load",m),c.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${l}`)))})}))}function s(o){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=o,window.dispatchEvent(u),!u.defaultPrevented)throw o}return i.then(o=>{for(const u of o||[])u.status==="rejected"&&s(u.reason);return e().catch(s)})};function db(t){let e;return{c(){e=S("div"),e.textContent="Please select a file or folder from the file-browser on the left",N(e,"class","flex-1 relative px-2 py-1 text-gray-700")},m(n,r){w(n,e,r)},p:ce,i:ce,o:ce,d(n){n&&E(e)}}}function mb(t){let e,n,r,i;const s=[_b,hb,pb],o=[];function u(l,a){return l[2]!==null?0:l[0]?1:2}return e=u(t),n=o[e]=s[e](t),{c(){n.c(),r=Se()},m(l,a){o[e].m(l,a),w(l,r,a),i=!0},p(l,a){let f=e;e=u(l),e===f?o[e].p(l,a):(_e(),y(o[f],1,1,()=>{o[f]=null}),ge(),n=o[e],n?n.p(l,a):(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r))},i(l){i||(b(n),i=!0)},o(l){y(n),i=!1},d(l){l&&E(r),o[e].d(l)}}}function pb(t){let e,n,r=t[1].mimetype+"",i,s;return{c(){e=S("div"),n=Z("Unfortunately the μEditor does not know how to edit this file ("),i=Z(r),s=Z(")."),N(e,"class","flex-1 px-2 py-1 text-rose-700")},m(o,u){w(o,e,u),P(e,n),P(e,i),P(e,s)},p(o,u){u&2&&r!==(r=o[1].mimetype+"")&&je(i,r)},i:ce,o:ce,d(o){o&&E(e)}}}function hb(t){let e;return{c(){e=S("div"),e.textContent="Loading the editor. Please wait...",N(e,"class","flex-1 px-2 py-1")},m(n,r){w(n,e,r)},p:ce,i:ce,o:ce,d(n){n&&E(e)}}}function _b(t){let e=t[3].id,n,r,i=Eu(t);return{c(){i.c(),n=Se()},m(s,o){i.m(s,o),w(s,n,o),r=!0},p(s,o){o&8&&fe(e,e=s[3].id)?(_e(),y(i,1,1,ce),ge(),i=Eu(s),i.c(),b(i,1),i.m(n.parentNode,n)):i.p(s,o)},i(s){r||(b(i),r=!0)},o(s){y(i),r=!1},d(s){s&&E(n),i.d(s)}}}function Eu(t){let e,n,r;var i=t[2];function s(o,u){return{}}return i&&(e=Io(i,s())),{c(){e&&U(e.$$.fragment),n=Se()},m(o,u){e&&H(e,o,u),w(o,n,u),r=!0},p(o,u){if(u&4&&i!==(i=o[2])){if(e){_e();const l=e;y(l.$$.fragment,1,0,()=>{V(l,1)}),ge()}i?(e=Io(i,s()),U(e.$$.fragment),b(e.$$.fragment,1),H(e,n.parentNode,n)):e=null}},i(o){r||(e&&b(e.$$.fragment,o),r=!0)},o(o){e&&y(e.$$.fragment,o),r=!1},d(o){o&&E(n),e&&V(e,o)}}}function gb(t){let e,n,r,i;const s=[mb,db],o=[];function u(l,a){return l[1]!==null?0:1}return e=u(t),n=o[e]=s[e](t),{c(){n.c(),r=Se()},m(l,a){o[e].m(l,a),w(l,r,a),i=!0},p(l,[a]){let f=e;e=u(l),e===f?o[e].p(l,a):(_e(),y(o[f],1,1,()=>{o[f]=null}),ge(),n=o[e],n?n.p(l,a):(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r))},i(l){i||(b(n),i=!0)},o(l){y(n),i=!1},d(l){l&&E(r),o[e].d(l)}}}function bb(t,e,n){let r,i,s;x(t,ft,m=>n(1,r=m));let o=!1;const u=["application/gitignore","application/json","application/toml","application/yaml"],l=["application/tei+xml"],a=Et();x(t,a,m=>n(3,s=m));const f=ze(ft,m=>{if(m){if(m.type==="folder")return"Folder";if(u.indexOf(m.mimetype)>=0||m.mimetype.startsWith("text/"))return"CodeMirror";if(l.indexOf(m.mimetype)>=0)return"Tei";if(m.mimetype.startsWith("image/"))return"Image"}return null}),c=ze(f,(m,p)=>{let d=null;m==="Folder"?d=Pi(()=>import("./FolderEditor-BrlMJ9kW.js"),[]):m==="CodeMirror"?d=Pi(()=>import("./CodeMirrorEditor-BAn1Wzpi.js"),__vite__mapDeps([0,1,2])):m==="Tei"?d=Pi(()=>import("./TeiEditor-CjT57X2c.js"),__vite__mapDeps([3,1])):m==="Image"&&(d=Pi(()=>import("./ImageEditor-Byg6QDjZ.js"),[])),d?(n(0,o=!0),d.then(_=>{p(_.default),n(0,o=!1)},()=>{n(0,o=!1)})):p(null)},null);return x(t,c,m=>n(2,i=m)),[o,r,i,s,a,c]}let yb=class extends ve{constructor(e){super(),ye(this,e,bb,gb,fe,{})}};function vb(t){return t[t.length-1]}function af(t){return Object.keys(t).reduce((e,n)=>t[n]===void 0?e:e+`${n}:${t[n]};`,"")}af({position:"absolute",opacity:0,"pointer-events":"none",margin:0,transform:"translateX(-100%)"});function kb(t,...e){const n={};for(const r of Object.keys(t))e.includes(r)||(n[r]=t[r]);return n}function Li(t){const e={};for(const n in t){const r=t[n];r!==void 0&&(e[n]=r)}return e}function wu(t){function e(n){return n(t),()=>{}}return{subscribe:e}}function Ou(t,e){if(!Eb)return null;const n=document.querySelector(`[data-melt-id="${t}"]`);return $o(n)?n:null}const Ii=t=>new Proxy(t,{get(e,n,r){return Reflect.get(e,n,r)},ownKeys(e){return Reflect.ownKeys(e).filter(n=>n!=="action")}}),Au=t=>typeof t=="function";Hi("empty");function Hi(t,e){const{stores:n,action:r,returned:i}=e??{},s=(()=>{if(n&&i)return ze(n,u=>{const l=i(u);if(Au(l)){const a=(...f)=>Ii(Li({...l(...f),[`data-melt-${t}`]:"",action:r??nr}));return a.action=r??nr,a}return Ii(Li({...l,[`data-melt-${t}`]:"",action:r??nr}))});{const u=i,l=u==null?void 0:u();if(Au(l)){const a=(...f)=>Ii(Li({...l(...f),[`data-melt-${t}`]:"",action:r??nr}));return a.action=r??nr,wu(a)}return wu(Ii(Li({...l,[`data-melt-${t}`]:"",action:r??nr})))}})(),o=r??(()=>{});return o.subscribe=s.subscribe,o}function Cb(t){const e=s=>s?`${t}-${s}`:t,n=s=>`data-melt-${t}${s?`-${s}`:""}`,r=s=>`[data-melt-${t}${s?`-${s}`:""}]`;return{name:e,attribute:n,selector:r,getEl:s=>document.querySelector(r(s))}}const Eb=typeof document<"u",wb=t=>/^[a-z]$/i.test(t);function $o(t){return t instanceof HTMLElement}function Ob(t){return t.offsetParent===null}function Ab(...t){return(...e)=>{for(const n of t)typeof n=="function"&&n(...e)}}function nr(){}function Rs(t,e,n,r){const i=Array.isArray(e)?e:[e];if(typeof n=="function"){const s=$b(o=>n(o));return i.forEach(o=>t.addEventListener(o,s,r)),()=>{i.forEach(o=>t.removeEventListener(o,s,r))}}return()=>void 0}function Tb(t){const e=t.currentTarget;if(!$o(e))return null;const n=new CustomEvent(`m-${t.type}`,{detail:{originalEvent:t},cancelable:!0});return e.dispatchEvent(n),n}function $b(t){return e=>{const n=Tb(e);if(!(n!=null&&n.defaultPrevented))return t(e)}}function So(t){return{...t,get:()=>$r(t)}}So.writable=function(t){const e=Fe(t);let n=t;return{subscribe:e.subscribe,set(r){e.set(r),n=r},update(r){const i=r(n);e.set(i),n=i},get(){return n}}};So.derived=function(t,e){const n=new Map,r=()=>{const s=Array.isArray(t)?t.map(o=>o.get()):t.get();return e(s)};return{get:r,subscribe:s=>{const o=[];return(Array.isArray(t)?t:[t]).forEach(l=>{o.push(l.subscribe(()=>{s(r())}))}),s(r()),n.set(s,o),()=>{const l=n.get(s);if(l)for(const a of l)a();n.delete(s)}}}};const Sb=(t,e)=>{const n=So(t),r=(s,o)=>{n.update(u=>{const l=s(u);let a=l;return e&&(a=e({curr:u,next:l})),o==null||o(a),a})};return{...n,update:r,set:s=>{r(()=>s)}}};function Rb(){return $a(10)}function Db(t){return t.reduce((e,n)=>(e[n]=Rb(),e),{})}const lt={ALT:"Alt",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",ARROW_UP:"ArrowUp",BACKSPACE:"Backspace",CAPS_LOCK:"CapsLock",CONTROL:"Control",DELETE:"Delete",END:"End",ENTER:"Enter",ESCAPE:"Escape",F1:"F1",F10:"F10",F11:"F11",F12:"F12",F2:"F2",F3:"F3",F4:"F4",F5:"F5",F6:"F6",F7:"F7",F8:"F8",F9:"F9",HOME:"Home",META:"Meta",PAGE_DOWN:"PageDown",PAGE_UP:"PageUp",SHIFT:"Shift",SPACE:" ",TAB:"Tab",CTRL:"Control",ASTERISK:"*",A:"a",P:"p"};gt(!1),gt(!1),gt(void 0),gt(void 0);const Fb={isDateDisabled:void 0,isDateUnavailable:void 0,value:void 0,preventDeselect:!1,numberOfMonths:1,pagedNavigation:!1,weekStartsOn:0,fixedWeeks:!1,calendarLabel:"Event Date",locale:"en",minValue:void 0,maxValue:void 0,disabled:!1,readonly:!1,weekdayFormat:"narrow"};({...kb(Fb,"isDateDisabled","isDateUnavailable","value","locale","disabled","readonly","minValue","maxValue","weekdayFormat")});const Pb={forceVisible:!1,defaultExpanded:[]},rr={TABINDEX:"tabindex",EXPANDED:"aria-expanded",LABELLEDBY:"aria-labelledby",DATAID:"data-id"},{name:Ds}=Cb("tree-view");function Lb(t){const e={...Pb,...t},{forceVisible:n}=e,r=Fe(null),i=Fe(null),s=e.expanded??Fe(e.defaultExpanded),o=Sb(s,e==null?void 0:e.onExpandedChange),u=ze([i],([C])=>C==null?void 0:C.getAttribute("data-id")),l=ze([i],([C])=>F=>(C==null?void 0:C.getAttribute("data-id"))===F),a=ze([o],([C])=>F=>C.includes(F)),f=Db(["tree"]),c=Hi(Ds(),{returned:()=>({role:"tree","data-melt-id":f.tree})});let m=!1;const p=Hi(Ds("item"),{stores:[o,u,r],returned:([C,F,R])=>K=>{const{id:M,hasChildren:D}=K;let I=0;return R!==null&&(I=R===M?0:-1),{role:"treeitem","aria-selected":F===M,"data-id":M,tabindex:I,"aria-expanded":D?C.includes(M):void 0}},action:C=>{const F=Ab(Rs(C,"keydown",R=>{const{key:K}=R,M=wb(K);if(![lt.ARROW_DOWN,lt.ARROW_UP,lt.ARROW_LEFT,lt.ARROW_RIGHT,lt.ENTER,lt.SPACE,lt.END,lt.HOME,lt.ASTERISK].includes(K)&&!M||!Ou(f.tree)||!$o(C)||C.getAttribute("role")!=="treeitem")return;const O=g(),L=O.findIndex(W=>W===C);if(K!==lt.ENTER&&K!==lt.SPACE&&R.preventDefault(),K===lt.ENTER||K===lt.SPACE)v(C),m=!0;else if(K===lt.ARROW_DOWN&&L!==O.length-1){const W=O[L+1];if(!W)return;_(W)}else if(K===lt.ARROW_UP&&L!==0){const W=O[L-1];if(!W)return;_(W)}else if(K===lt.HOME&&L!==0){const W=O[0];if(!W)return;_(W)}else if(K===lt.END&&L!=O.length-1){const W=vb(O);if(!W)return;_(W)}else if(K===lt.ARROW_LEFT)if($(C))k(C);else{const W=C==null?void 0:C.closest('[role="group"]'),q=W==null?void 0:W.getAttribute("data-group-id"),oe=O.find(se=>se.getAttribute("data-id")===q);if(!oe)return;_(oe)}else if(K===lt.ARROW_RIGHT)if($(C)){const W=O[L+1];if(!W)return;_(W)}else A(C)&&k(C);else if(M){const W=O.map(se=>{var z;return{value:(z=se.textContent)==null?void 0:z.toLowerCase().trim(),id:se.getAttribute("data-id")}});let q=-1,oe=W.slice(L+1).some((se,z)=>{var le;return((le=se.value)==null?void 0:le.toLowerCase()[0])===K?(q=L+1+z,!0):!1});if(oe||(oe=W.slice(0,L).some((se,z)=>{var le;return((le=se.value)==null?void 0:le.toLowerCase().at(0))===K?(q=z,!0):!1})),oe&&W[q].id){const se=O[q];if(!se)return;_(se)}}}),Rs(C,"click",async()=>{v(C),_(C),m||k(C),m=!1}),Rs(C,"focus",()=>{r.update(R=>C.getAttribute("data-id")??R)}));return{destroy(){F()}}}}),d=Hi(Ds("group"),{stores:[o],returned:([C])=>F=>({role:"group","data-group-id":F.id,hidden:!n&&!C.includes(F.id)?!0:void 0,style:af({display:!n&&!C.includes(F.id)?"none":void 0})})});function _(C){r.update(F=>C.getAttribute("data-id")??F),C.focus()}function v(C){C.getAttribute(rr.DATAID)&&i.set(C)}function g(){let C=[];const F=Ou(f.tree);return F&&(C=Array.from(F.querySelectorAll('[role="treeitem"]')).filter(R=>!Ob(R))),C}function h(C){const F=C.hasAttribute(rr.EXPANDED),R=C.getAttribute(rr.EXPANDED),K=C.getAttribute(rr.DATAID);return{hasChildren:F,expanded:R,dataId:K}}function k(C){const{hasChildren:F,expanded:R,dataId:K}=h(C);!F||R===null||K===null||(R==="false"?o.update(M=>[...M,K]):o.update(M=>M.filter(D=>D!==K)))}function A(C){return C.hasAttribute(rr.EXPANDED)}function $(C){return C.getAttribute(rr.EXPANDED)==="true"}return{ids:f,elements:{tree:c,item:p,group:d},states:{expanded:o,selectedItem:i},helpers:{isExpanded:a,isSelected:l}}}var Ib=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Mb(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ff={exports:{}};(function(t,e){(function(n,r,i){t.exports=i(),t.exports.default=i()})("slugify",Ib,function(){var n=JSON.parse(`{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","¢":"cent","£":"pound","¤":"currency","¥":"yen","©":"(c)","ª":"a","®":"(r)","º":"o","À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","Þ":"TH","ß":"ss","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","þ":"th","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Č":"C","č":"c","Ď":"D","ď":"d","Đ":"DJ","đ":"dj","Ē":"E","ē":"e","Ė":"E","ė":"e","Ę":"e","ę":"e","Ě":"E","ě":"e","Ğ":"G","ğ":"g","Ģ":"G","ģ":"g","Ĩ":"I","ĩ":"i","Ī":"i","ī":"i","Į":"I","į":"i","İ":"I","ı":"i","Ķ":"k","ķ":"k","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ł":"L","ł":"l","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","Ō":"O","ō":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","Ŕ":"R","ŕ":"r","Ř":"R","ř":"r","Ś":"S","ś":"s","Ş":"S","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","Ť":"T","ť":"t","Ũ":"U","ũ":"u","Ū":"u","ū":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","Ə":"E","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Lj":"LJ","lj":"lj","Nj":"NJ","nj":"nj","Ș":"S","ș":"s","Ț":"T","ț":"t","ə":"e","˚":"o","Ά":"A","Έ":"E","Ή":"H","Ί":"I","Ό":"O","Ύ":"Y","Ώ":"W","ΐ":"i","Α":"A","Β":"B","Γ":"G","Δ":"D","Ε":"E","Ζ":"Z","Η":"H","Θ":"8","Ι":"I","Κ":"K","Λ":"L","Μ":"M","Ν":"N","Ξ":"3","Ο":"O","Π":"P","Ρ":"R","Σ":"S","Τ":"T","Υ":"Y","Φ":"F","Χ":"X","Ψ":"PS","Ω":"W","Ϊ":"I","Ϋ":"Y","ά":"a","έ":"e","ή":"h","ί":"i","ΰ":"y","α":"a","β":"b","γ":"g","δ":"d","ε":"e","ζ":"z","η":"h","θ":"8","ι":"i","κ":"k","λ":"l","μ":"m","ν":"n","ξ":"3","ο":"o","π":"p","ρ":"r","ς":"s","σ":"s","τ":"t","υ":"y","φ":"f","χ":"x","ψ":"ps","ω":"w","ϊ":"i","ϋ":"y","ό":"o","ύ":"y","ώ":"w","Ё":"Yo","Ђ":"DJ","Є":"Ye","І":"I","Ї":"Yi","Ј":"J","Љ":"LJ","Њ":"NJ","Ћ":"C","Џ":"DZ","А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ж":"Zh","З":"Z","И":"I","Й":"J","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"H","Ц":"C","Ч":"Ch","Ш":"Sh","Щ":"Sh","Ъ":"U","Ы":"Y","Ь":"","Э":"E","Ю":"Yu","Я":"Ya","а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ж":"zh","з":"z","и":"i","й":"j","к":"k","л":"l","м":"m","н":"n","о":"o","п":"p","р":"r","с":"s","т":"t","у":"u","ф":"f","х":"h","ц":"c","ч":"ch","ш":"sh","щ":"sh","ъ":"u","ы":"y","ь":"","э":"e","ю":"yu","я":"ya","ё":"yo","ђ":"dj","є":"ye","і":"i","ї":"yi","ј":"j","љ":"lj","њ":"nj","ћ":"c","ѝ":"u","џ":"dz","Ґ":"G","ґ":"g","Ғ":"GH","ғ":"gh","Қ":"KH","қ":"kh","Ң":"NG","ң":"ng","Ү":"UE","ү":"ue","Ұ":"U","ұ":"u","Һ":"H","һ":"h","Ә":"AE","ә":"ae","Ө":"OE","ө":"oe","Ա":"A","Բ":"B","Գ":"G","Դ":"D","Ե":"E","Զ":"Z","Է":"E'","Ը":"Y'","Թ":"T'","Ժ":"JH","Ի":"I","Լ":"L","Խ":"X","Ծ":"C'","Կ":"K","Հ":"H","Ձ":"D'","Ղ":"GH","Ճ":"TW","Մ":"M","Յ":"Y","Ն":"N","Շ":"SH","Չ":"CH","Պ":"P","Ջ":"J","Ռ":"R'","Ս":"S","Վ":"V","Տ":"T","Ր":"R","Ց":"C","Փ":"P'","Ք":"Q'","Օ":"O''","Ֆ":"F","և":"EV","ء":"a","آ":"aa","أ":"a","ؤ":"u","إ":"i","ئ":"e","ا":"a","ب":"b","ة":"h","ت":"t","ث":"th","ج":"j","ح":"h","خ":"kh","د":"d","ذ":"th","ر":"r","ز":"z","س":"s","ش":"sh","ص":"s","ض":"dh","ط":"t","ظ":"z","ع":"a","غ":"gh","ف":"f","ق":"q","ك":"k","ل":"l","م":"m","ن":"n","ه":"h","و":"w","ى":"a","ي":"y","ً":"an","ٌ":"on","ٍ":"en","َ":"a","ُ":"u","ِ":"e","ْ":"","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","پ":"p","چ":"ch","ژ":"zh","ک":"k","گ":"g","ی":"y","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","฿":"baht","ა":"a","ბ":"b","გ":"g","დ":"d","ე":"e","ვ":"v","ზ":"z","თ":"t","ი":"i","კ":"k","ლ":"l","მ":"m","ნ":"n","ო":"o","პ":"p","ჟ":"zh","რ":"r","ს":"s","ტ":"t","უ":"u","ფ":"f","ქ":"k","ღ":"gh","ყ":"q","შ":"sh","ჩ":"ch","ც":"ts","ძ":"dz","წ":"ts","ჭ":"ch","ხ":"kh","ჯ":"j","ჰ":"h","Ṣ":"S","ṣ":"s","Ẁ":"W","ẁ":"w","Ẃ":"W","ẃ":"w","Ẅ":"W","ẅ":"w","ẞ":"SS","Ạ":"A","ạ":"a","Ả":"A","ả":"a","Ấ":"A","ấ":"a","Ầ":"A","ầ":"a","Ẩ":"A","ẩ":"a","Ẫ":"A","ẫ":"a","Ậ":"A","ậ":"a","Ắ":"A","ắ":"a","Ằ":"A","ằ":"a","Ẳ":"A","ẳ":"a","Ẵ":"A","ẵ":"a","Ặ":"A","ặ":"a","Ẹ":"E","ẹ":"e","Ẻ":"E","ẻ":"e","Ẽ":"E","ẽ":"e","Ế":"E","ế":"e","Ề":"E","ề":"e","Ể":"E","ể":"e","Ễ":"E","ễ":"e","Ệ":"E","ệ":"e","Ỉ":"I","ỉ":"i","Ị":"I","ị":"i","Ọ":"O","ọ":"o","Ỏ":"O","ỏ":"o","Ố":"O","ố":"o","Ồ":"O","ồ":"o","Ổ":"O","ổ":"o","Ỗ":"O","ỗ":"o","Ộ":"O","ộ":"o","Ớ":"O","ớ":"o","Ờ":"O","ờ":"o","Ở":"O","ở":"o","Ỡ":"O","ỡ":"o","Ợ":"O","ợ":"o","Ụ":"U","ụ":"u","Ủ":"U","ủ":"u","Ứ":"U","ứ":"u","Ừ":"U","ừ":"u","Ử":"U","ử":"u","Ữ":"U","ữ":"u","Ự":"U","ự":"u","Ỳ":"Y","ỳ":"y","Ỵ":"Y","ỵ":"y","Ỷ":"Y","ỷ":"y","Ỹ":"Y","ỹ":"y","–":"-","‘":"'","’":"'","“":"\\"","”":"\\"","„":"\\"","†":"+","•":"*","…":"...","₠":"ecu","₢":"cruzeiro","₣":"french franc","₤":"lira","₥":"mill","₦":"naira","₧":"peseta","₨":"rupee","₩":"won","₪":"new shequel","₫":"dong","€":"euro","₭":"kip","₮":"tugrik","₯":"drachma","₰":"penny","₱":"peso","₲":"guarani","₳":"austral","₴":"hryvnia","₵":"cedi","₸":"kazakhstani tenge","₹":"indian rupee","₺":"turkish lira","₽":"russian ruble","₿":"bitcoin","℠":"sm","™":"tm","∂":"d","∆":"delta","∑":"sum","∞":"infinity","♥":"love","元":"yuan","円":"yen","﷼":"rial","ﻵ":"laa","ﻷ":"laa","ﻹ":"lai","ﻻ":"la"}`),r=JSON.parse('{"bg":{"Й":"Y","Ц":"Ts","Щ":"Sht","Ъ":"A","Ь":"Y","й":"y","ц":"ts","щ":"sht","ъ":"a","ь":"y"},"de":{"Ä":"AE","ä":"ae","Ö":"OE","ö":"oe","Ü":"UE","ü":"ue","ß":"ss","%":"prozent","&":"und","|":"oder","∑":"summe","∞":"unendlich","♥":"liebe"},"es":{"%":"por ciento","&":"y","<":"menor que",">":"mayor que","|":"o","¢":"centavos","£":"libras","¤":"moneda","₣":"francos","∑":"suma","∞":"infinito","♥":"amor"},"fr":{"%":"pourcent","&":"et","<":"plus petit",">":"plus grand","|":"ou","¢":"centime","£":"livre","¤":"devise","₣":"franc","∑":"somme","∞":"infini","♥":"amour"},"pt":{"%":"porcento","&":"e","<":"menor",">":"maior","|":"ou","¢":"centavo","∑":"soma","£":"libra","∞":"infinito","♥":"amor"},"uk":{"И":"Y","и":"y","Й":"Y","й":"y","Ц":"Ts","ц":"ts","Х":"Kh","х":"kh","Щ":"Shch","щ":"shch","Г":"H","г":"h"},"vi":{"Đ":"D","đ":"d"},"da":{"Ø":"OE","ø":"oe","Å":"AA","å":"aa","%":"procent","&":"og","|":"eller","$":"dollar","<":"mindre end",">":"større end"},"nb":{"&":"og","Å":"AA","Æ":"AE","Ø":"OE","å":"aa","æ":"ae","ø":"oe"},"it":{"&":"e"},"nl":{"&":"en"},"sv":{"&":"och","Å":"AA","Ä":"AE","Ö":"OE","å":"aa","ä":"ae","ö":"oe"}}');function i(s,o){if(typeof s!="string")throw new Error("slugify: string argument expected");o=typeof o=="string"?{replacement:o}:o||{};var u=r[o.locale]||{},l=o.replacement===void 0?"-":o.replacement,a=o.trim===void 0?!0:o.trim,f=s.normalize().split("").reduce(function(c,m){var p=u[m];return p===void 0&&(p=n[m]),p===void 0&&(p=m),p===l&&(p=" "),c+p.replace(o.remove||/[^\w\s$*_+~.()'"!\-:@]+/g,"")},"");return o.strict&&(f=f.replace(/[^A-Za-z0-9\s]/g,"")),a&&(f=f.trim()),f=f.replace(/\s+/g,l),o.lower&&(f=f.toLowerCase()),f}return i.extend=function(s){Object.assign(n,s)},i})})(ff);var Nb=ff.exports;const Hb=Mb(Nb);function Tu(t,e,n){var l;const r=t.slice();r[9]=e[n].name,r[10]=e[n].type,r[11]=e[n].fullpath,r[12]=e[n].content,r[13]=e[n].mimetype,r[19]=n;const i=`file-tree-${Hb(r[9],{strict:!0})}-${r[1]}-${r[19]}`;r[14]=i;const s=!!((l=r[12])!=null&&l.length);r[15]=s;const o=r[2]({id:r[14]});r[16]=o;const u=r[3]({id:r[14],hasChildren:r[15]});return r[17]=u,r}function Vb(t){let e,n,r,i,s;const o=[qb,Wb,jb,Kb],u=[];function l(a,f){return f&1&&(e=null),a[13]==="text/markdown"||a[13]==="application/tei+xml"?0:(e==null&&(e=!!a[13].startsWith("image/")),e?1:a[13]==="application/yaml"||a[13]==="application/toml"||a[13]==="application/gitignore"?2:3)}return n=l(t,-1),r=u[n]=o[n](t),{c(){r.c(),i=Se()},m(a,f){u[n].m(a,f),w(a,i,f),s=!0},p(a,f){let c=n;n=l(a,f),n!==c&&(_e(),y(u[c],1,1,()=>{u[c]=null}),ge(),r=u[n],r||(r=u[n]=o[n](a),r.c()),b(r,1),r.m(i.parentNode,i))},i(a){s||(b(r),s=!0)},o(a){y(r),s=!1},d(a){a&&E(i),u[n].d(a)}}}function Ub(t){let e,n;return e=new Ne({props:{path:I1}}),{c(){U(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},p:ce,i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){y(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function Bb(t){let e,n;return e=new Ne({props:{path:L1}}),{c(){U(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},p:ce,i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){y(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function Kb(t){let e,n;return e=new Ne({props:{path:D1}}),{c(){U(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){y(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function jb(t){let e,n;return e=new Ne({props:{path:T1}}),{c(){U(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){y(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function Wb(t){let e,n;return e=new Ne({props:{path:R1}}),{c(){U(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){y(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function qb(t){let e,n;return e=new Ne({props:{path:$1}}),{c(){U(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){y(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function $u(t){let e,n,r,i,s;n=new cf({props:{treeItems:t[12],level:t[1]+1}});let o=[t[16]],u={};for(let l=0;l<o.length;l+=1)u=ne(u,o[l]);return{c(){e=S("ol"),U(n.$$.fragment),ie(e,u)},m(l,a){w(l,e,a),H(n,e,null),r=!0,i||(s=Ue(t[16].action(e)),i=!0)},p(l,a){const f={};a&1&&(f.treeItems=l[12]),a&2&&(f.level=l[1]+1),n.$set(f),ie(e,u=Me(o,[a&7&&l[16]]))},i(l){r||(b(n.$$.fragment,l),r=!0)},o(l){y(n.$$.fragment,l),r=!1},d(l){l&&E(e),V(n),i=!1,s()}}}function Su(t){let e,n,r,i,s,o,u,l=t[9]+"",a,f,c,m,p,d,_;const v=[Bb,Ub,Vb],g=[];function h(C,F){return F&19&&(r=null),r==null&&(r=!!(C[10]==="folder"&&C[15]&&C[4](C[14]))),r?0:C[10]==="folder"?1:C[10]==="file"?2:-1}~(i=h(t,-1))&&(s=g[i]=v[i](t));let k=[{class:"flex items-center gap-1 p-1"},t[17],{"data-file-path":f=t[11]}],A={};for(let C=0;C<k.length;C+=1)A=ne(A,k[C]);let $=t[12]&&$u(t);return{c(){e=S("li"),n=S("button"),s&&s.c(),o=B(),u=S("span"),a=Z(l),c=B(),$&&$.c(),m=B(),N(u,"class","select-none"),ie(n,A),N(e,"role","none")},m(C,F){w(C,e,F),P(e,n),~i&&g[i].m(n,null),P(n,o),P(n,u),P(u,a),n.autofocus&&n.focus(),P(e,c),$&&$.m(e,null),P(e,m),p=!0,d||(_=Ue(t[17].action(n)),d=!0)},p(C,F){let R=i;i=h(C,F),i===R?~i&&g[i].p(C,F):(s&&(_e(),y(g[R],1,1,()=>{g[R]=null}),ge()),~i?(s=g[i],s?s.p(C,F):(s=g[i]=v[i](C),s.c()),b(s,1),s.m(n,o)):s=null),(!p||F&1)&&l!==(l=C[9]+"")&&je(a,l),ie(n,A=Me(k,[{class:"flex items-center gap-1 p-1"},F&11&&C[17],(!p||F&1&&f!==(f=C[11]))&&{"data-file-path":f}])),C[12]?$?($.p(C,F),F&1&&b($,1)):($=$u(C),$.c(),b($,1),$.m(e,m)):$&&(_e(),y($,1,1,()=>{$=null}),ge())},i(C){p||(b(s),b($),p=!0)},o(C){y(s),y($),p=!1},d(C){C&&E(e),~i&&g[i].d(),$&&$.d(),d=!1,_()}}}function Qb(t){let e,n,r=tn(t[0]),i=[];for(let o=0;o<r.length;o+=1)i[o]=Su(Tu(t,r,o));const s=o=>y(i[o],1,1,()=>{i[o]=null});return{c(){for(let o=0;o<i.length;o+=1)i[o].c();e=Se()},m(o,u){for(let l=0;l<i.length;l+=1)i[l]&&i[l].m(o,u);w(o,e,u),n=!0},p(o,[u]){if(u&31){r=tn(o[0]);let l;for(l=0;l<r.length;l+=1){const a=Tu(o,r,l);i[l]?(i[l].p(a,u),b(i[l],1)):(i[l]=Su(a),i[l].c(),b(i[l],1),i[l].m(e.parentNode,e))}for(_e(),l=r.length;l<i.length;l+=1)s(l);ge()}},i(o){if(!n){for(let u=0;u<r.length;u+=1)b(i[u]);n=!0}},o(o){i=i.filter(Boolean);for(let u=0;u<i.length;u+=1)y(i[u]);n=!1},d(o){o&&E(e),fi(i,o)}}}function zb(t,e,n){let r,i,s,{treeItems:o}=e,{level:u=1}=e;const{elements:{item:l,group:a},helpers:{isExpanded:f,isSelected:c}}=bt("tree");return x(t,l,m=>n(3,i=m)),x(t,a,m=>n(2,r=m)),x(t,f,m=>n(4,s=m)),t.$$set=m=>{"treeItems"in m&&n(0,o=m.treeItems),"level"in m&&n(1,u=m.level)},[o,u,r,i,s,l,a,f]}class cf extends ve{constructor(e){super(),ye(this,e,zb,Qb,fe,{treeItems:0,level:1})}}function Gb(t){let e,n,r,i,s;const o=t[1].default,u=de(o,t,t[0],null);return i=new Ne({props:{path:zt,class:"w-12 h-12 animate-spin animate-reverse"}}),{c(){e=S("div"),n=S("p"),u&&u.c(),r=B(),U(i.$$.fragment),N(n,"class","sr-only"),N(e,"class","absolute left-1/2 top-1/2 transform -translate-x-1/2 -translate-y-1/2")},m(l,a){w(l,e,a),P(e,n),u&&u.m(n,null),P(e,r),H(i,e,null),s=!0},p(l,[a]){u&&u.p&&(!s||a&1)&&pe(u,o,l,l[0],s?me(o,l[0],a,null):he(l[0]),null)},i(l){s||(b(u,l),b(i.$$.fragment,l),s=!0)},o(l){y(u,l),y(i.$$.fragment,l),s=!1},d(l){l&&E(e),u&&u.d(l),V(i)}}}function Yb(t,e,n){let{$$slots:r={},$$scope:i}=e;return t.$$set=s=>{"$$scope"in s&&n(0,i=s.$$scope)},[i,r]}class Zb extends ve{constructor(e){super(),ye(this,e,Yb,Gb,fe,{})}}function Xb(t){let e,n;return e=new Zb({props:{$$slots:{default:[xb]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},p(r,i){const s={};i&2048&&(s.$$scope={dirty:i,ctx:r}),e.$set(s)},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){y(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function Jb(t){let e,n,r;n=new cf({props:{treeItems:t[0].data}});let i=[t[1]],s={};for(let o=0;o<i.length;o+=1)s=ne(s,i[o]);return{c(){e=S("ol"),U(n.$$.fragment),ie(e,s)},m(o,u){w(o,e,u),H(n,e,null),r=!0},p(o,u){const l={};u&1&&(l.treeItems=o[0].data),n.$set(l),ie(e,s=Me(i,[u&2&&o[1]]))},i(o){r||(b(n.$$.fragment,o),r=!0)},o(o){y(n.$$.fragment,o),r=!1},d(o){o&&E(e),V(n)}}}function xb(t){let e;return{c(){e=Z("Loading the file list. Please wait...")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function e2(t){let e,n,r,i;const s=[Jb,Xb],o=[];function u(l,a){return l[0].isSuccess?0:l[0].isLoading?1:-1}return~(n=u(t))&&(r=o[n]=s[n](t)),{c(){e=S("nav"),r&&r.c(),N(e,"aria-label","Files"),N(e,"class","relative px-2 py-1 w-3/12 overflow-auto border-r border-gray-300")},m(l,a){w(l,e,a),~n&&o[n].m(e,null),i=!0},p(l,[a]){let f=n;n=u(l),n===f?~n&&o[n].p(l,a):(r&&(_e(),y(o[f],1,1,()=>{o[f]=null}),ge()),~n?(r=o[n],r?r.p(l,a):(r=o[n]=s[n](l),r.c()),b(r,1),r.m(e,null)):r=null)},i(l){i||(b(r),i=!0)},o(l){y(r),i=!1},d(l){l&&E(e),~n&&o[n].d()}}}function df(t,e){for(let n of t){if(n.fullpath===e)return n;if(n.content){const r=df(n.content,e);if(r!==null)return r}}return null}function t2(t){var n,r,i;const e=[];for(;t&&t.getAttribute("role")==="treeitem";)e.splice(0,0,t.getAttribute("data-id")),t=(i=(r=(n=t.parentElement)==null?void 0:n.parentElement)==null?void 0:r.parentElement)==null?void 0:i.querySelector(":scope > [role=treeitem]");return e}function n2(t,e,n){let r,i;const s=Et(),o=Ao(),u=ze([s,o],([d,_])=>d?{queryKey:["branches",d.id,"files/"],queryFn:cn,enabled:_.isSuccess}:{queryKey:["branches","-","files/"],queryFn:cn,enabled:!1}),l=Or(u);x(t,l,d=>n(0,r=d));const a=Lb({defaultExpanded:["file-tree--1-0"]});At("tree",a);const{elements:{tree:f},states:{selectedItem:c,expanded:m}}=a;x(t,f,d=>n(1,i=d));const p=c.subscribe(d=>{if(c!==null&&(d==null?void 0:d.getAttribute("data-file-path"))!==null&&r.isSuccess){const _=df(r.data,d==null?void 0:d.getAttribute("data-file-path"));ft.set(_)}else ft.set(null)});return rs(p),ns(()=>{let d;d=l.subscribe(_=>{if(_.isSuccess){const v=of("path");v&&Wt().then(()=>{const g=document.querySelector('[data-file-path="'+v+'"]');g&&(m.set(t2(g)),c.set(g))}),d&&d()}})}),[r,i,l,f]}class r2 extends ve{constructor(e){super(),ye(this,e,n2,e2,fe,{})}}function Ru(t,e,n){const r=t.slice();return r[14]=e[n],r}function Du(t){let e,n=t[0].title+"",r,i;return{c(){e=Z(" ("),r=Z(n),i=Z(")")},m(s,o){w(s,e,o),w(s,r,o),w(s,i,o)},p(s,o){o&1&&n!==(n=s[0].title+"")&&je(r,n)},d(s){s&&(E(e),E(r),E(i))}}}function i2(t){let e,n,r=t[0]!==null&&Du(t);return{c(){e=Z("μEditor"),r&&r.c(),n=Se()},m(i,s){w(i,e,s),r&&r.m(i,s),w(i,n,s)},p(i,s){i[0]!==null?r?r.p(i,s):(r=Du(i),r.c(),r.m(n.parentNode,n)):r&&(r.d(1),r=null)},d(i){i&&(E(e),E(n)),r&&r.d(i)}}}function Fu(t){let e,n,r,i,s,o,u,l,a,f;e=new Pt({props:{$$slots:{default:[s2]},$$scope:{ctx:t}}}),e.$on("click",t[8]);let c=t[2].isSuccess&&t[2].data.remote.length>0&&Pu(t);i=new Pt({props:{$$slots:{default:[l2]},$$scope:{ctx:t}}}),i.$on("click",t[10]),o=new as({});let m=t[3]!==null&&Lu(t),p=t[2].isSuccess&&t[2].data.local.length>0&&Nu(t);return{c(){U(e.$$.fragment),n=B(),c&&c.c(),r=B(),U(i.$$.fragment),s=B(),U(o.$$.fragment),u=B(),m&&m.c(),l=B(),p&&p.c(),a=Se()},m(d,_){H(e,d,_),w(d,n,_),c&&c.m(d,_),w(d,r,_),H(i,d,_),w(d,s,_),H(o,d,_),w(d,u,_),m&&m.m(d,_),w(d,l,_),p&&p.m(d,_),w(d,a,_),f=!0},p(d,_){const v={};_&131072&&(v.$$scope={dirty:_,ctx:d}),e.$set(v),d[2].isSuccess&&d[2].data.remote.length>0?c?_&4&&b(c,1):(c=Pu(d),c.c(),b(c,1),c.m(r.parentNode,r)):c&&(_e(),y(c,1,1,()=>{c=null}),ge());const g={};_&131072&&(g.$$scope={dirty:_,ctx:d}),i.$set(g),d[3]!==null?m?(m.p(d,_),_&8&&b(m,1)):(m=Lu(d),m.c(),b(m,1),m.m(l.parentNode,l)):m&&(_e(),y(m,1,1,()=>{m=null}),ge()),d[2].isSuccess&&d[2].data.local.length>0?p?(p.p(d,_),_&4&&b(p,1)):(p=Nu(d),p.c(),b(p,1),p.m(a.parentNode,a)):p&&(_e(),y(p,1,1,()=>{p=null}),ge())},i(d){f||(b(e.$$.fragment,d),b(c),b(i.$$.fragment,d),b(o.$$.fragment,d),b(m),b(p),f=!0)},o(d){y(e.$$.fragment,d),y(c),y(i.$$.fragment,d),y(o.$$.fragment,d),y(m),y(p),f=!1},d(d){d&&(E(n),E(r),E(s),E(u),E(l),E(a)),V(e,d),c&&c.d(d),V(i,d),V(o,d),m&&m.d(d),p&&p.d(d)}}}function s2(t){let e,n,r,i;return e=new Ne({props:{path:V1,class:"w-4 h-4"}}),{c(){U(e.$$.fragment),n=B(),r=S("span"),r.textContent="New Branch"},m(s,o){H(e,s,o),w(s,n,o),w(s,r,o),i=!0},p:ce,i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){y(e.$$.fragment,s),i=!1},d(s){s&&(E(n),E(r)),V(e,s)}}}function Pu(t){let e,n;return e=new Pt({props:{$$slots:{default:[o2]},$$scope:{ctx:t}}}),e.$on("click",t[9]),{c(){U(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){y(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function o2(t){let e,n,r,i;return e=new Ne({props:{class:"w-4 h-4"}}),{c(){U(e.$$.fragment),n=B(),r=S("span"),r.textContent="Import Branch"},m(s,o){H(e,s,o),w(s,n,o),w(s,r,o),i=!0},p:ce,i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){y(e.$$.fragment,s),i=!1},d(s){s&&(E(n),E(r)),V(e,s)}}}function l2(t){let e,n,r,i;return e=new Ne({props:{class:"w-4 h-4"}}),{c(){U(e.$$.fragment),n=B(),r=S("span"),r.textContent="Synchronise Branches"},m(s,o){H(e,s,o),w(s,n,o),w(s,r,o),i=!0},p:ce,i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){y(e.$$.fragment,s),i=!1},d(s){s&&(E(n),E(r)),V(e,s)}}}function Lu(t){let e,n,r,i=t[3].update_from_default&&Iu(t),s=t[1].data.git.default_branch!==t[3].id&&Mu(t);return{c(){i&&i.c(),e=B(),s&&s.c(),n=Se()},m(o,u){i&&i.m(o,u),w(o,e,u),s&&s.m(o,u),w(o,n,u),r=!0},p(o,u){o[3].update_from_default?i?(i.p(o,u),u&8&&b(i,1)):(i=Iu(o),i.c(),b(i,1),i.m(e.parentNode,e)):i&&(_e(),y(i,1,1,()=>{i=null}),ge()),o[1].data.git.default_branch!==o[3].id?s?(s.p(o,u),u&10&&b(s,1)):(s=Mu(o),s.c(),b(s,1),s.m(n.parentNode,n)):s&&(_e(),y(s,1,1,()=>{s=null}),ge())},i(o){r||(b(i),b(s),r=!0)},o(o){y(i),y(s),r=!1},d(o){o&&(E(e),E(n)),i&&i.d(o),s&&s.d(o)}}}function Iu(t){let e,n,r,i;return e=new Pt({props:{$$slots:{default:[u2]},$$scope:{ctx:t}}}),e.$on("click",t[11]),r=new as({}),{c(){U(e.$$.fragment),n=B(),U(r.$$.fragment)},m(s,o){H(e,s,o),w(s,n,o),H(r,s,o),i=!0},p(s,o){const u={};o&131074&&(u.$$scope={dirty:o,ctx:s}),e.$set(u)},i(s){i||(b(e.$$.fragment,s),b(r.$$.fragment,s),i=!0)},o(s){y(e.$$.fragment,s),y(r.$$.fragment,s),i=!1},d(s){s&&E(n),V(e,s),V(r,s)}}}function u2(t){let e,n,r,i,s=t[1].data.git.default_branch+"",o,u;return e=new Ne({props:{path:B1,class:"w-4 h-4"}}),{c(){U(e.$$.fragment),n=B(),r=S("span"),i=Z("Merge from "),o=Z(s)},m(l,a){H(e,l,a),w(l,n,a),w(l,r,a),P(r,i),P(r,o),u=!0},p(l,a){(!u||a&2)&&s!==(s=l[1].data.git.default_branch+"")&&je(o,s)},i(l){u||(b(e.$$.fragment,l),u=!0)},o(l){y(e.$$.fragment,l),u=!1},d(l){l&&(E(n),E(r)),V(e,l)}}}function Mu(t){let e,n,r,i;return e=new Pt({props:{$$slots:{default:[a2]},$$scope:{ctx:t}}}),e.$on("click",t[12]),r=new as({}),{c(){U(e.$$.fragment),n=B(),U(r.$$.fragment)},m(s,o){H(e,s,o),w(s,n,o),H(r,s,o),i=!0},p(s,o){const u={};o&131080&&(u.$$scope={dirty:o,ctx:s}),e.$set(u)},i(s){i||(b(e.$$.fragment,s),b(r.$$.fragment,s),i=!0)},o(s){y(e.$$.fragment,s),y(r.$$.fragment,s),i=!1},d(s){s&&E(n),V(e,s),V(r,s)}}}function a2(t){let e,n,r,i,s=t[3].title+"",o,u;return e=new Ne({props:{path:U1,class:"w-4 h-4"}}),{c(){U(e.$$.fragment),n=B(),r=S("span"),i=Z("Delete Branch "),o=Z(s)},m(l,a){H(e,l,a),w(l,n,a),w(l,r,a),P(r,i),P(r,o),u=!0},p(l,a){(!u||a&8)&&s!==(s=l[3].title+"")&&je(o,s)},i(l){u||(b(e.$$.fragment,l),u=!0)},o(l){y(e.$$.fragment,l),u=!1},d(l){l&&(E(n),E(r)),V(e,l)}}}function Nu(t){let e,n;return e=new ep({props:{onValueChange:t[13],$$slots:{default:[m2]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},p(r,i){const s={};i&4&&(s.onValueChange=r[13]),i&131077&&(s.$$scope={dirty:i,ctx:r}),e.$set(s)},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){y(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function f2(t){let e,n;return e=new Ne({props:{class:"w-4 h-4"}}),{c(){U(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){y(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function c2(t){let e,n;return e=new Ne({props:{path:E1,class:"w-4 h-4"}}),{c(){U(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){y(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function d2(t){let e,n,r,i,s=t[14].title+"",o,u,l;const a=[c2,f2],f=[];function c(m,p){return m[0]!==null&&m[0].id===m[14].id?0:1}return e=c(t),n=f[e]=a[e](t),{c(){n.c(),r=B(),i=S("span"),o=Z(s),u=B()},m(m,p){f[e].m(m,p),w(m,r,p),w(m,i,p),P(i,o),w(m,u,p),l=!0},p(m,p){let d=e;e=c(m),e!==d&&(_e(),y(f[d],1,1,()=>{f[d]=null}),ge(),n=f[e],n||(n=f[e]=a[e](m),n.c()),b(n,1),n.m(r.parentNode,r)),(!l||p&4)&&s!==(s=m[14].title+"")&&je(o,s)},i(m){l||(b(n),l=!0)},o(m){y(n),l=!1},d(m){m&&(E(r),E(i),E(u)),f[e].d(m)}}}function Hu(t){let e,n;return e=new Km({props:{value:t[14].id,$$slots:{default:[d2]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},p(r,i){const s={};i&4&&(s.value=r[14].id),i&131077&&(s.$$scope={dirty:i,ctx:r}),e.$set(s)},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){y(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function m2(t){let e,n,r=tn(t[2].data.local),i=[];for(let o=0;o<r.length;o+=1)i[o]=Hu(Ru(t,r,o));const s=o=>y(i[o],1,1,()=>{i[o]=null});return{c(){for(let o=0;o<i.length;o+=1)i[o].c();e=Se()},m(o,u){for(let l=0;l<i.length;l+=1)i[l]&&i[l].m(o,u);w(o,e,u),n=!0},p(o,u){if(u&5){r=tn(o[2].data.local);let l;for(l=0;l<r.length;l+=1){const a=Ru(o,r,l);i[l]?(i[l].p(a,u),b(i[l],1)):(i[l]=Hu(a),i[l].c(),b(i[l],1),i[l].m(e.parentNode,e))}for(_e(),l=r.length;l<i.length;l+=1)s(l);ge()}},i(o){if(!n){for(let u=0;u<r.length;u+=1)b(i[u]);n=!0}},o(o){i=i.filter(Boolean);for(let u=0;u<i.length;u+=1)y(i[u]);n=!1},d(o){o&&E(e),fi(i,o)}}}function p2(t){let e,n,r=t[1].isSuccess&&t[1].data.git.enabled&&Fu(t);return{c(){r&&r.c(),e=Se()},m(i,s){r&&r.m(i,s),w(i,e,s),n=!0},p(i,s){i[1].isSuccess&&i[1].data.git.enabled?r?(r.p(i,s),s&2&&b(r,1)):(r=Fu(i),r.c(),b(r,1),r.m(e.parentNode,e)):r&&(_e(),y(r,1,1,()=>{r=null}),ge())},i(i){n||(b(r),n=!0)},o(i){y(r),n=!1},d(i){i&&E(e),r&&r.d(i)}}}function h2(t){let e,n,r,i;return e=new ms({props:{$$slots:{default:[i2]},$$scope:{ctx:t}}}),r=new fs({props:{$$slots:{default:[p2]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=B(),U(r.$$.fragment)},m(s,o){H(e,s,o),w(s,n,o),H(r,s,o),i=!0},p(s,o){const u={};o&131073&&(u.$$scope={dirty:o,ctx:s}),e.$set(u);const l={};o&131087&&(l.$$scope={dirty:o,ctx:s}),r.$set(l)},i(s){i||(b(e.$$.fragment,s),b(r.$$.fragment,s),i=!0)},o(s){y(e.$$.fragment,s),y(r.$$.fragment,s),i=!1},d(s){s&&E(n),V(e,s),V(r,s)}}}function _2(t){let e,n;return e=new ds({props:{$$slots:{default:[h2]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},p(r,[i]){const s={};i&131087&&(s.$$scope={dirty:i,ctx:r}),e.$set(s)},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){y(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function g2(t,e,n){let r,i,s,o;const u=Ci();x(t,u,g=>n(1,i=g));const l=To();x(t,l,g=>n(2,s=g));const a=Et();x(t,a,g=>n(0,r=g));const f=ze([l,a],([g,h])=>{if(g.isSuccess&&h!==null){for(const k of g.data.local)if(k.id===h.id)return k}return null});return x(t,f,g=>n(3,o=g)),[r,i,s,o,u,l,a,f,()=>{Ge.set(Ae.UEDITOR_NEW_BRANCH)},()=>{Ge.set(Ae.UEDITOR_IMPORT_REMOTE_BRANCH)},()=>{lf({action:"SynchroniseBranches"})},()=>{Ge.set(Ae.UEDITOR_MERGE_FROM_DEFAULT)},()=>{Ge.set(Ae.UEDITOR_DELETE_BRANCH)},g=>{if(s.isSuccess)for(let h of s.data.local)h.id===g&&a.set(h)}]}class b2 extends ve{constructor(e){super(),ye(this,e,g2,_2,fe,{})}}function y2(t){let e;return{c(){e=Z("File")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function v2(t){let e,n,r,i;return e=new Ne({props:{path:H1,class:"w-4 h-4"}}),{c(){U(e.$$.fragment),n=B(),r=S("span"),r.textContent="Rename"},m(s,o){H(e,s,o),w(s,n,o),w(s,r,o),i=!0},p:ce,i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){y(e.$$.fragment,s),i=!1},d(s){s&&(E(n),E(r)),V(e,s)}}}function k2(t){let e,n,r,i;return e=new Ne({props:{path:j1,class:"w-4 h-4"}}),{c(){U(e.$$.fragment),n=B(),r=S("span"),r.textContent="Delete"},m(s,o){H(e,s,o),w(s,n,o),w(s,r,o),i=!0},p:ce,i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){y(e.$$.fragment,s),i=!1},d(s){s&&(E(n),E(r)),V(e,s)}}}function C2(t){let e,n,r,i;return e=new Pt({props:{$$slots:{default:[v2]},$$scope:{ctx:t}}}),e.$on("click",t[0]),r=new Pt({props:{$$slots:{default:[k2]},$$scope:{ctx:t}}}),r.$on("click",t[1]),{c(){U(e.$$.fragment),n=B(),U(r.$$.fragment)},m(s,o){H(e,s,o),w(s,n,o),H(r,s,o),i=!0},p(s,o){const u={};o&4&&(u.$$scope={dirty:o,ctx:s}),e.$set(u);const l={};o&4&&(l.$$scope={dirty:o,ctx:s}),r.$set(l)},i(s){i||(b(e.$$.fragment,s),b(r.$$.fragment,s),i=!0)},o(s){y(e.$$.fragment,s),y(r.$$.fragment,s),i=!1},d(s){s&&E(n),V(e,s),V(r,s)}}}function E2(t){let e,n,r,i;return e=new ms({props:{$$slots:{default:[y2]},$$scope:{ctx:t}}}),r=new fs({props:{$$slots:{default:[C2]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=B(),U(r.$$.fragment)},m(s,o){H(e,s,o),w(s,n,o),H(r,s,o),i=!0},p(s,o){const u={};o&4&&(u.$$scope={dirty:o,ctx:s}),e.$set(u);const l={};o&4&&(l.$$scope={dirty:o,ctx:s}),r.$set(l)},i(s){i||(b(e.$$.fragment,s),b(r.$$.fragment,s),i=!0)},o(s){y(e.$$.fragment,s),y(r.$$.fragment,s),i=!1},d(s){s&&E(n),V(e,s),V(r,s)}}}function w2(t){let e,n;return e=new ds({props:{$$slots:{default:[E2]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},p(r,[i]){const s={};i&4&&(s.$$scope={dirty:i,ctx:r}),e.$set(s)},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){y(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function O2(t){return[()=>{Ge.set(Ae.FILE_RENAME)},()=>{Ge.set(Ae.FILE_DELETE)}]}class A2 extends ve{constructor(e){super(),ye(this,e,O2,w2,fe,{})}}function T2(t){let e;return{c(){e=Z("Folder")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function $2(t){let e,n,r,i;return e=new Ne({props:{path:M1,class:"w4 h-4"}}),{c(){U(e.$$.fragment),n=B(),r=S("span"),r.textContent="New Folder"},m(s,o){H(e,s,o),w(s,n,o),w(s,r,o),i=!0},p:ce,i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){y(e.$$.fragment,s),i=!1},d(s){s&&(E(n),E(r)),V(e,s)}}}function S2(t){let e,n,r,i;return e=new Ne({props:{path:S1,class:"w4 h-4"}}),{c(){U(e.$$.fragment),n=B(),r=S("span"),r.textContent="New File"},m(s,o){H(e,s,o),w(s,n,o),w(s,r,o),i=!0},p:ce,i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){y(e.$$.fragment,s),i=!1},d(s){s&&(E(n),E(r)),V(e,s)}}}function R2(t){let e,n,r,i;return e=new Ne({props:{path:F1,class:"w4 h-4"}}),{c(){U(e.$$.fragment),n=B(),r=S("span"),r.textContent="Upload Files"},m(s,o){H(e,s,o),w(s,n,o),w(s,r,o),i=!0},p:ce,i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){y(e.$$.fragment,s),i=!1},d(s){s&&(E(n),E(r)),V(e,s)}}}function D2(t){let e,n,r,i;return e=new Ne({props:{path:P1,class:"w-4 h-4"}}),{c(){U(e.$$.fragment),n=B(),r=S("span"),r.textContent="Rename"},m(s,o){H(e,s,o),w(s,n,o),w(s,r,o),i=!0},p:ce,i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){y(e.$$.fragment,s),i=!1},d(s){s&&(E(n),E(r)),V(e,s)}}}function F2(t){let e,n,r,i;return e=new Ne({props:{path:N1,class:"w-4 h-4"}}),{c(){U(e.$$.fragment),n=B(),r=S("span"),r.textContent="Delete"},m(s,o){H(e,s,o),w(s,n,o),w(s,r,o),i=!0},p:ce,i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){y(e.$$.fragment,s),i=!1},d(s){s&&(E(n),E(r)),V(e,s)}}}function P2(t){let e,n,r,i,s,o,u,l,a,f,c,m;return e=new Pt({props:{$$slots:{default:[$2]},$$scope:{ctx:t}}}),e.$on("click",t[2]),r=new Pt({props:{$$slots:{default:[S2]},$$scope:{ctx:t}}}),r.$on("click",t[3]),s=new Pt({props:{$$slots:{default:[R2]},$$scope:{ctx:t}}}),s.$on("click",t[4]),u=new as({}),a=new Pt({props:{$$slots:{default:[D2]},$$scope:{ctx:t}}}),a.$on("click",t[5]),c=new Pt({props:{$$slots:{default:[F2]},$$scope:{ctx:t}}}),c.$on("click",t[6]),{c(){U(e.$$.fragment),n=B(),U(r.$$.fragment),i=B(),U(s.$$.fragment),o=B(),U(u.$$.fragment),l=B(),U(a.$$.fragment),f=B(),U(c.$$.fragment)},m(p,d){H(e,p,d),w(p,n,d),H(r,p,d),w(p,i,d),H(s,p,d),w(p,o,d),H(u,p,d),w(p,l,d),H(a,p,d),w(p,f,d),H(c,p,d),m=!0},p(p,d){const _={};d&256&&(_.$$scope={dirty:d,ctx:p}),e.$set(_);const v={};d&256&&(v.$$scope={dirty:d,ctx:p}),r.$set(v);const g={};d&256&&(g.$$scope={dirty:d,ctx:p}),s.$set(g);const h={};d&256&&(h.$$scope={dirty:d,ctx:p}),a.$set(h);const k={};d&256&&(k.$$scope={dirty:d,ctx:p}),c.$set(k)},i(p){m||(b(e.$$.fragment,p),b(r.$$.fragment,p),b(s.$$.fragment,p),b(u.$$.fragment,p),b(a.$$.fragment,p),b(c.$$.fragment,p),m=!0)},o(p){y(e.$$.fragment,p),y(r.$$.fragment,p),y(s.$$.fragment,p),y(u.$$.fragment,p),y(a.$$.fragment,p),y(c.$$.fragment,p),m=!1},d(p){p&&(E(n),E(i),E(o),E(l),E(f)),V(e,p),V(r,p),V(s,p),V(u,p),V(a,p),V(c,p)}}}function L2(t){let e,n,r,i;return e=new ms({props:{$$slots:{default:[T2]},$$scope:{ctx:t}}}),r=new fs({props:{$$slots:{default:[P2]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=B(),U(r.$$.fragment)},m(s,o){H(e,s,o),w(s,n,o),H(r,s,o),i=!0},p(s,o){const u={};o&256&&(u.$$scope={dirty:o,ctx:s}),e.$set(u);const l={};o&256&&(l.$$scope={dirty:o,ctx:s}),r.$set(l)},i(s){i||(b(e.$$.fragment,s),b(r.$$.fragment,s),i=!0)},o(s){y(e.$$.fragment,s),y(r.$$.fragment,s),i=!1},d(s){s&&E(n),V(e,s),V(r,s)}}}function Vu(t){let e,n;return e=new uf({}),e.$on("close",t[7]),{c(){U(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},p:ce,i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){y(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function I2(t){let e,n,r,i;e=new ds({props:{$$slots:{default:[L2]},$$scope:{ctx:t}}});let s=t[0]===t[1].Delete&&Vu(t);return{c(){U(e.$$.fragment),n=B(),s&&s.c(),r=Se()},m(o,u){H(e,o,u),w(o,n,u),s&&s.m(o,u),w(o,r,u),i=!0},p(o,[u]){const l={};u&256&&(l.$$scope={dirty:u,ctx:o}),e.$set(l),o[0]===o[1].Delete?s?(s.p(o,u),u&1&&b(s,1)):(s=Vu(o),s.c(),b(s,1),s.m(r.parentNode,r)):s&&(_e(),y(s,1,1,()=>{s=null}),ge())},i(o){i||(b(e.$$.fragment,o),b(s),i=!0)},o(o){y(e.$$.fragment,o),y(s),i=!1},d(o){o&&(E(n),E(r)),V(e,o),s&&s.d(o)}}}function M2(t,e,n){var r=(c=>(c[c.Nothing=1]="Nothing",c[c.Rename=2]="Rename",c[c.Move=3]="Move",c[c.Copy=4]="Copy",c[c.Delete=5]="Delete",c))(r||{});let i=1;return[i,r,()=>{Ge.set(Ae.FOLDER_CREATE)},()=>{Ge.set(Ae.FILE_CREATE)},()=>{Ge.set(Ae.FILE_UPLOAD)},()=>{Ge.set(Ae.FOLDER_RENAME)},()=>{Ge.set(Ae.FOLDER_DELETE)},()=>{console.log("Resetting action"),n(0,i=r.Nothing)}]}class N2 extends ve{constructor(e){super(),ye(this,e,M2,I2,fe,{})}}function Uu(t){let e,n;return e=new ds({props:{$$slots:{default:[B2]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},p(r,i){const s={};i&66&&(s.$$scope={dirty:i,ctx:r}),e.$set(s)},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){y(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function H2(t){var r;let e=((r=t[1].data)==null?void 0:r.name)+"",n;return{c(){n=Z(e)},m(i,s){w(i,n,s)},p(i,s){var o;s&2&&e!==(e=((o=i[1].data)==null?void 0:o.name)+"")&&je(n,e)},d(i){i&&E(n)}}}function V2(t){let e,n,r,i;return e=new Ne({props:{path:A1,class:"w-4 h-4"}}),{c(){U(e.$$.fragment),n=B(),r=S("span"),r.textContent="Logout"},m(s,o){H(e,s,o),w(s,n,o),w(s,r,o),i=!0},p:ce,i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){y(e.$$.fragment,s),i=!1},d(s){s&&(E(n),E(r)),V(e,s)}}}function U2(t){let e,n;return e=new Pt({props:{$$slots:{default:[V2]},$$scope:{ctx:t}}}),e.$on("click",t[4]),{c(){U(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},p(r,i){const s={};i&64&&(s.$$scope={dirty:i,ctx:r}),e.$set(s)},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){y(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function B2(t){let e,n,r,i;return e=new ms({props:{$$slots:{default:[H2]},$$scope:{ctx:t}}}),r=new fs({props:{$$slots:{default:[U2]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=B(),U(r.$$.fragment)},m(s,o){H(e,s,o),w(s,n,o),H(r,s,o),i=!0},p(s,o){const u={};o&66&&(u.$$scope={dirty:o,ctx:s}),e.$set(u);const l={};o&64&&(l.$$scope={dirty:o,ctx:s}),r.$set(l)},i(s){i||(b(e.$$.fragment,s),b(r.$$.fragment,s),i=!0)},o(s){y(e.$$.fragment,s),y(r.$$.fragment,s),i=!1},d(s){s&&E(n),V(e,s),V(r,s)}}}function K2(t){let e,n,r=t[0].isSuccess&&t[0].data.auth.provider!=="no-auth"&&Uu(t);return{c(){r&&r.c(),e=Se()},m(i,s){r&&r.m(i,s),w(i,e,s),n=!0},p(i,[s]){i[0].isSuccess&&i[0].data.auth.provider!=="no-auth"?r?(r.p(i,s),s&1&&b(r,1)):(r=Uu(i),r.c(),b(r,1),r.m(e.parentNode,e)):r&&(_e(),y(r,1,1,()=>{r=null}),ge())},i(i){n||(b(r),n=!0)},o(i){y(r),n=!1},d(i){i&&E(e),r&&r.d(i)}}}function j2(t,e,n){let r,i;const s=Ao();x(t,s,a=>n(1,i=a));const o=Ci();x(t,o,a=>n(0,r=a));const u=Ct();async function l(){(await window.fetch("/api/auth/login",{method:"DELETE"})).ok&&(u.cancelQueries(),u.invalidateQueries({queryKey:["auth"]}))}return[r,i,s,o,l]}class W2 extends ve{constructor(e){super(),ye(this,e,j2,K2,fe,{})}}function Bu(t){let e,n,r,i;const s=[Q2,q2],o=[];function u(l,a){return l[0].type==="file"?0:l[0].type==="folder"?1:-1}return~(e=u(t))&&(n=o[e]=s[e](t)),{c(){n&&n.c(),r=Se()},m(l,a){~e&&o[e].m(l,a),w(l,r,a),i=!0},p(l,a){let f=e;e=u(l),e!==f&&(n&&(_e(),y(o[f],1,1,()=>{o[f]=null}),ge()),~e?(n=o[e],n||(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r)):n=null)},i(l){i||(b(n),i=!0)},o(l){y(n),i=!1},d(l){l&&E(r),~e&&o[e].d(l)}}}function q2(t){let e,n;return e=new N2({}),{c(){U(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){y(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function Q2(t){let e,n;return e=new A2({}),{c(){U(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){y(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function z2(t){let e,n,r,i,s,o,u;e=new b2({});let l=t[0]&&Bu(t);return o=new W2({}),{c(){U(e.$$.fragment),n=B(),l&&l.c(),r=B(),i=S("span"),s=B(),U(o.$$.fragment),N(i,"class","flex-1")},m(a,f){H(e,a,f),w(a,n,f),l&&l.m(a,f),w(a,r,f),w(a,i,f),w(a,s,f),H(o,a,f),u=!0},p(a,f){a[0]?l?(l.p(a,f),f&1&&b(l,1)):(l=Bu(a),l.c(),b(l,1),l.m(r.parentNode,r)):l&&(_e(),y(l,1,1,()=>{l=null}),ge())},i(a){u||(b(e.$$.fragment,a),b(l),b(o.$$.fragment,a),u=!0)},o(a){y(e.$$.fragment,a),y(l),y(o.$$.fragment,a),u=!1},d(a){a&&(E(n),E(r),E(i),E(s)),V(e,a),l&&l.d(a),V(o,a)}}}function G2(t){let e,n;return e=new wh({props:{class:"border-b border-gray-300 px-2 pt-px",$$slots:{default:[z2]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},p(r,[i]){const s={};i&3&&(s.$$scope={dirty:i,ctx:r}),e.$set(s)},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){y(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function Y2(t,e,n){let r;return x(t,ft,i=>n(0,r=i)),[r]}class Z2 extends ve{constructor(e){super(),ye(this,e,Y2,G2,fe,{})}}function X2(t){let e,n;return e=new Ne({props:{path:O1}}),{c(){U(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},p:ce,i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){y(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function J2(t){let e,n;return e=new k1({props:{"aria-label":"Save",title:"Save","aria-disabled":t[0]!==null&&t[1]?null:"true",$$slots:{default:[X2]},$$scope:{ctx:t}}}),e.$on("click",t[3]),{c(){U(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},p(r,i){const s={};i&3&&(s["aria-disabled"]=r[0]!==null&&r[1]?null:"true"),i&128&&(s.$$scope={dirty:i,ctx:r}),e.$set(s)},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){y(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function x2(t){let e,n;return e=new p1({props:{class:"border-b border-gray-300",$$slots:{default:[J2]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},p(r,[i]){const s={};i&131&&(s.$$scope={dirty:i,ctx:r}),e.$set(s)},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){y(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function e0(t,e,n){let r,i,s,o;x(t,ft,f=>n(4,r=f)),x(t,Y1,f=>n(0,i=f)),x(t,ru,f=>n(1,o=f));const u=Ct(),l=Et();x(t,l,f=>n(5,s=f));function a(){r!==null&&i!==null&&lf({action:"SaveCurrentFile",branch:s,filename:r.fullpath,data:i,callback(){ru.set(!1),(r.name==="uEdition.yml"||r.name==="uEdition.yaml"||r.name==="uEditor.yml"||r.name==="uEditor.yaml")&&u.invalidateQueries({queryKey:["configs"]})}})}return[i,o,l,a]}class t0 extends ve{constructor(e){super(),ye(this,e,e0,x2,fe,{})}}function n0(t){let e;return{c(){e=S("div"),N(e,"class","flex-1")},m(n,r){w(n,e,r)},i:ce,o:ce,d(n){n&&E(e)}}}function r0(t){let e;return{c(){e=S("div"),e.innerHTML='<p class="px-4 py-2">Please select the branch you wish to work on from the μEditor menu.</p>',N(e,"class","flex-1")},m(n,r){w(n,e,r)},i:ce,o:ce,d(n){n&&E(e)}}}function i0(t){let e,n,r,i,s;return n=new r2({}),i=new yb({}),{c(){e=S("div"),U(n.$$.fragment),r=B(),U(i.$$.fragment),N(e,"class","flex flex-row flex-1 overflow-hidden")},m(o,u){w(o,e,u),H(n,e,null),P(e,r),H(i,e,null),s=!0},i(o){s||(b(n.$$.fragment,o),b(i.$$.fragment,o),s=!0)},o(o){y(n.$$.fragment,o),y(i.$$.fragment,o),s=!1},d(o){o&&E(e),V(n),V(i)}}}function Ku(t){let e=t[4].fullpath+"",n;return{c(){n=Z(e)},m(r,i){w(r,n,i)},p(r,i){i&16&&e!==(e=r[4].fullpath+"")&&je(n,e)},d(r){r&&E(n)}}}function s0(t){let e,n,r,i,s,o,u,l,a,f,c,m,p,d,_,v,g,h,k,A,$;document.title=e=t[0],o=new Z2({}),l=new t0({});const C=[i0,r0,n0],F=[];function R(M,D){return M[1]!==null&&M[3].isSuccess?0:M[1]===null?1:2}f=R(t),c=F[f]=C[f](t);let K=t[4]&&Ku(t);return h=new p_({}),A=new ab({}),{c(){n=S("link"),i=B(),s=S("main"),U(o.$$.fragment),u=B(),U(l.$$.fragment),a=B(),c.c(),m=B(),p=S("footer"),d=S("div"),K&&K.c(),_=B(),v=S("div"),g=B(),U(h.$$.fragment),k=B(),U(A.$$.fragment),N(n,"rel","stylesheet"),N(n,"href",r="/api/branches/"+(t[1]!==null?t[1].id:"-")+"/configs/ui-stylesheet?timestamp="+t[2]),N(d,"class","font-mono font-bold"),N(v,"class","flex-1"),N(p,"class","flex flex-row px-2 py-1 border-t border-slate-300 text-sm"),N(s,"class","flex flex-col w-screen h-screen overflow-hidden")},m(M,D){P(document.head,n),w(M,i,D),w(M,s,D),H(o,s,null),P(s,u),H(l,s,null),P(s,a),F[f].m(s,null),P(s,m),P(s,p),P(p,d),K&&K.m(d,null),P(p,_),P(p,v),P(p,g),H(h,p,null),w(M,k,D),H(A,M,D),$=!0},p(M,[D]){(!$||D&1)&&e!==(e=M[0])&&(document.title=e),(!$||D&6&&r!==(r="/api/branches/"+(M[1]!==null?M[1].id:"-")+"/configs/ui-stylesheet?timestamp="+M[2]))&&N(n,"href",r);let I=f;f=R(M),f!==I&&(_e(),y(F[I],1,1,()=>{F[I]=null}),ge(),c=F[f],c||(c=F[f]=C[f](M),c.c()),b(c,1),c.m(s,m)),M[4]?K?K.p(M,D):(K=Ku(M),K.c(),K.m(d,null)):K&&(K.d(1),K=null)},i(M){$||(b(o.$$.fragment,M),b(l.$$.fragment,M),b(c),b(h.$$.fragment,M),b(A.$$.fragment,M),$=!0)},o(M){y(o.$$.fragment,M),y(l.$$.fragment,M),y(c),y(h.$$.fragment,M),y(A.$$.fragment,M),$=!1},d(M){M&&(E(i),E(s),E(k)),E(n),V(o),V(l),F[f].d(),K&&K.d(),V(h),V(A,M)}}}function o0(t,e,n){let r,i,s,o,u;x(t,ft,p=>n(4,u=p));const l=bt("uEditionConfig"),a=bt("uEditorConfig");x(t,a,p=>n(3,o=p));const f=bt("currentBranch");x(t,f,p=>n(1,i=p));const c=ze(l,p=>p.isSuccess&&p.data.languages&&p.data.languages.length>0&&p.data.languages[0].code&&p.data.title&&p.data.title[p.data.languages[0].code]?"μEditor - "+p.data.title[p.data.languages[0].code]:"μEditor");x(t,c,p=>n(0,r=p));const m=ze(l,p=>new Date().getTime());return x(t,m,p=>n(2,s=p)),[r,i,s,o,u,a,f,c,m]}class l0 extends ve{constructor(e){super(),ye(this,e,o0,s0,fe,{})}}function Ro(t,{delay:e=0,duration:n=400,easing:r=ts}={}){const i=+getComputedStyle(t).opacity;return{delay:e,duration:n,easing:r,css:s=>`opacity: ${s*i}`}}function ju(t){let e;const n=t[2].default,r=de(n,t,t[3],null);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,s){r&&r.p&&(!e||s&8)&&pe(r,n,i,i[3],e?me(n,i[3],s,null):he(i[3]),null)},i(i){e||(b(r,i),e=!0)},o(i){y(r,i),e=!1},d(i){r&&r.d(i)}}}function u0(t){let e;return{c(){e=Z("μEditor not ready")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function a0(t){let e,n,r,i;return e=new Tt({props:{$$slots:{default:[u0]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=B(),r=S("div"),r.innerHTML=`<p>Unfortunately the μEditor server is not ready. Please check the server
17
- logs to determine what the issue is.</p>`,N(r,"data-dialog-content-area","")},m(s,o){H(e,s,o),w(s,n,o),w(s,r,o),i=!0},p(s,o){const u={};o&8&&(u.$$scope={dirty:o,ctx:s}),e.$set(u)},i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){y(e.$$.fragment,s),i=!1},d(s){s&&(E(n),E(r)),V(e,s)}}}function f0(t){let e,n,r,i;return e=new vi({props:{transition:Ro}}),r=new yi({props:{"data-dialog-role":"error",class:"flex flex-col overflow-hidden",$$slots:{default:[a0]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=B(),U(r.$$.fragment)},m(s,o){H(e,s,o),w(s,n,o),H(r,s,o),i=!0},p(s,o){const u={};o&8&&(u.$$scope={dirty:o,ctx:s}),r.$set(u)},i(s){i||(b(e.$$.fragment,s),b(r.$$.fragment,s),i=!0)},o(s){y(e.$$.fragment,s),y(r.$$.fragment,s),i=!1},d(s){s&&E(n),V(e,s),V(r,s)}}}function c0(t){let e,n,r,i;return e=new ki({props:{class:"hidden"}}),r=new bi({props:{$$slots:{default:[f0]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=B(),U(r.$$.fragment)},m(s,o){H(e,s,o),w(s,n,o),H(r,s,o),i=!0},p(s,o){const u={};o&8&&(u.$$scope={dirty:o,ctx:s}),r.$set(u)},i(s){i||(b(e.$$.fragment,s),b(r.$$.fragment,s),i=!0)},o(s){y(e.$$.fragment,s),y(r.$$.fragment,s),i=!1},d(s){s&&E(n),V(e,s),V(r,s)}}}function d0(t){let e,n,r,i=t[0].isSuccess&&ju(t);return n=new si({props:{open:t[0].isSuccess&&!t[0].data.ready,closeOnEscape:!1,closeOnOutsideClick:!1,$$slots:{default:[c0]},$$scope:{ctx:t}}}),{c(){i&&i.c(),e=B(),U(n.$$.fragment)},m(s,o){i&&i.m(s,o),w(s,e,o),H(n,s,o),r=!0},p(s,[o]){s[0].isSuccess?i?(i.p(s,o),o&1&&b(i,1)):(i=ju(s),i.c(),b(i,1),i.m(e.parentNode,e)):i&&(_e(),y(i,1,1,()=>{i=null}),ge());const u={};o&1&&(u.open=s[0].isSuccess&&!s[0].data.ready),o&8&&(u.$$scope={dirty:o,ctx:s}),n.$set(u)},i(s){r||(b(i),b(n.$$.fragment,s),r=!0)},o(s){y(i),y(n.$$.fragment,s),r=!1},d(s){s&&E(e),i&&i.d(s),V(n,s)}}}function m0(t,e,n){let r,{$$slots:i={},$$scope:s}=e;const o=Or({queryKey:[""],queryFn:cn,refetchInterval:6e4});return x(t,o,u=>n(0,r=u)),At("apiStatus",o),t.$$set=u=>{"$$scope"in u&&n(3,s=u.$$scope)},[r,o,i,s]}class p0 extends ve{constructor(e){super(),ye(this,e,m0,d0,fe,{})}}function h0(t){let e;return{c(){e=Z("Authenticating")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function _0(t){let e,n,r,i;return e=new Tt({props:{$$slots:{default:[h0]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=B(),r=S("div"),r.innerHTML="<p>You are being authenticated. Please wait.</p>",N(r,"data-dialog-content-area","")},m(s,o){H(e,s,o),w(s,n,o),w(s,r,o),i=!0},p(s,o){const u={};o&4096&&(u.$$scope={dirty:o,ctx:s}),e.$set(u)},i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){y(e.$$.fragment,s),i=!1},d(s){s&&(E(n),E(r)),V(e,s)}}}function g0(t){let e,n,r,i;return e=new vi({props:{transition:Ro,class:"z-40"}}),r=new yi({props:{class:"flex flex-col overflow-hidden z-50",$$slots:{default:[_0]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=B(),U(r.$$.fragment)},m(s,o){H(e,s,o),w(s,n,o),H(r,s,o),i=!0},p(s,o){const u={};o&4096&&(u.$$scope={dirty:o,ctx:s}),r.$set(u)},i(s){i||(b(e.$$.fragment,s),b(r.$$.fragment,s),i=!0)},o(s){y(e.$$.fragment,s),y(r.$$.fragment,s),i=!1},d(s){s&&E(n),V(e,s),V(r,s)}}}function b0(t){let e,n,r,i;return e=new ki({props:{class:"hidden"}}),r=new bi({props:{$$slots:{default:[g0]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=B(),U(r.$$.fragment)},m(s,o){H(e,s,o),w(s,n,o),H(r,s,o),i=!0},p(s,o){const u={};o&4096&&(u.$$scope={dirty:o,ctx:s}),r.$set(u)},i(s){i||(b(e.$$.fragment,s),b(r.$$.fragment,s),i=!0)},o(s){y(e.$$.fragment,s),y(r.$$.fragment,s),i=!1},d(s){s&&E(n),V(e,s),V(r,s)}}}function y0(t){let e;return{c(){e=Z("Login")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function v0(t){let e;return{c(){e=S("div"),e.innerHTML='<p>Click on the link below to log in via GitHub.</p> <div class="my-8 text-center"><a href="/api/auth/oidc/login" data-button="">Log in via GitHub</a></div>',N(e,"data-dialog-content-area","")},m(n,r){w(n,e,r)},p:ce,d(n){n&&E(e)}}}function k0(t){let e,n,r,i,s,o,u,l,a,f,c,m,p,d,_,v,g=t[4].isError&&Wu(),h=t[4].isError&&qu();function k(C,F){return C[4].isPending?E0:C0}let A=k(t),$=A(t);return{c(){e=S("form"),n=S("label"),r=S("span"),r.textContent="E-Mail",i=B(),s=S("input"),o=B(),g&&g.c(),u=B(),l=S("label"),a=S("span"),a.textContent="Password",f=B(),c=S("input"),m=B(),h&&h.c(),p=B(),d=S("div"),$.c(),N(r,"data-form-field-label",""),N(s,"type","text"),N(s,"data-form-field-text",""),N(a,"data-form-field-label",""),N(c,"type","password"),N(c,"data-form-field-text",""),N(d,"data-dialog-buttons",""),N(e,"data-dialog-content-area","")},m(C,F){w(C,e,F),P(e,n),P(n,r),P(n,i),P(n,s),it(s,t[0]),P(n,o),g&&g.m(n,null),P(e,u),P(e,l),P(l,a),P(l,f),P(l,c),it(c,t[1]),P(l,m),h&&h.m(l,null),P(e,p),P(e,d),$.m(d,null),_||(v=[G(s,"input",t[9]),G(c,"input",t[10]),G(e,"submit",t[11])],_=!0)},p(C,F){F&1&&s.value!==C[0]&&it(s,C[0]),C[4].isError?g||(g=Wu(),g.c(),g.m(n,null)):g&&(g.d(1),g=null),F&2&&c.value!==C[1]&&it(c,C[1]),C[4].isError?h||(h=qu(),h.c(),h.m(l,null)):h&&(h.d(1),h=null),A!==(A=k(C))&&($.d(1),$=A(C),$&&($.c(),$.m(d,null)))},d(C){C&&E(e),g&&g.d(),h&&h.d(),$.d(),_=!1,Te(v)}}}function Wu(t){let e;return{c(){e=S("span"),e.textContent="Incorred e-mail address or password",N(e,"data-form-field-error","")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function qu(t){let e;return{c(){e=S("span"),e.textContent="Incorred e-mail address or password",N(e,"data-form-field-error","")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function C0(t){let e;return{c(){e=S("button"),e.textContent="Login",N(e,"type","submit"),N(e,"data-button","")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function E0(t){let e;return{c(){e=S("span"),e.textContent="Logging in...",N(e,"data-button",""),N(e,"class","inline-flex")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function w0(t){let e,n,r,i;e=new Tt({props:{$$slots:{default:[y0]},$$scope:{ctx:t}}});function s(l,a){var f,c;if(((f=l[3].data)==null?void 0:f.auth.provider)==="email-password")return k0;if(((c=l[3].data)==null?void 0:c.auth.provider)==="github")return v0}let o=s(t),u=o&&o(t);return{c(){U(e.$$.fragment),n=B(),u&&u.c(),r=Se()},m(l,a){H(e,l,a),w(l,n,a),u&&u.m(l,a),w(l,r,a),i=!0},p(l,a){const f={};a&4096&&(f.$$scope={dirty:a,ctx:l}),e.$set(f),o===(o=s(l))&&u?u.p(l,a):(u&&u.d(1),u=o&&o(l),u&&(u.c(),u.m(r.parentNode,r)))},i(l){i||(b(e.$$.fragment,l),i=!0)},o(l){y(e.$$.fragment,l),i=!1},d(l){l&&(E(n),E(r)),V(e,l),u&&u.d(l)}}}function O0(t){let e,n,r,i;return e=new vi({props:{transition:Ro,class:"z-40"}}),r=new yi({props:{class:"flex flex-col overflow-hidden z-50",$$slots:{default:[w0]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=B(),U(r.$$.fragment)},m(s,o){H(e,s,o),w(s,n,o),H(r,s,o),i=!0},p(s,o){const u={};o&4123&&(u.$$scope={dirty:o,ctx:s}),r.$set(u)},i(s){i||(b(e.$$.fragment,s),b(r.$$.fragment,s),i=!0)},o(s){y(e.$$.fragment,s),y(r.$$.fragment,s),i=!1},d(s){s&&E(n),V(e,s),V(r,s)}}}function A0(t){let e,n,r,i;return e=new ki({props:{class:"hidden"}}),r=new bi({props:{$$slots:{default:[O0]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment),n=B(),U(r.$$.fragment)},m(s,o){H(e,s,o),w(s,n,o),H(r,s,o),i=!0},p(s,o){const u={};o&4123&&(u.$$scope={dirty:o,ctx:s}),r.$set(u)},i(s){i||(b(e.$$.fragment,s),b(r.$$.fragment,s),i=!0)},o(s){y(e.$$.fragment,s),y(r.$$.fragment,s),i=!1},d(s){s&&E(n),V(e,s),V(r,s)}}}function T0(t){let e,n,r,i,s;const o=t[8].default,u=de(o,t,t[12],null);return n=new si({props:{open:t[2]==="pending",closeOnEscape:!1,closeOnOutsideClick:!1,$$slots:{default:[b0]},$$scope:{ctx:t}}}),i=new si({props:{open:t[2]==="error",closeOnEscape:!1,closeOnOutsideClick:!1,$$slots:{default:[A0]},$$scope:{ctx:t}}}),{c(){u&&u.c(),e=B(),U(n.$$.fragment),r=B(),U(i.$$.fragment)},m(l,a){u&&u.m(l,a),w(l,e,a),H(n,l,a),w(l,r,a),H(i,l,a),s=!0},p(l,[a]){u&&u.p&&(!s||a&4096)&&pe(u,o,l,l[12],s?me(o,l[12],a,null):he(l[12]),null);const f={};a&4&&(f.open=l[2]==="pending"),a&4096&&(f.$$scope={dirty:a,ctx:l}),n.$set(f);const c={};a&4&&(c.open=l[2]==="error"),a&4123&&(c.$$scope={dirty:a,ctx:l}),i.$set(c)},i(l){s||(b(u,l),b(n.$$.fragment,l),b(i.$$.fragment,l),s=!0)},o(l){y(u,l),y(n.$$.fragment,l),y(i.$$.fragment,l),s=!1},d(l){l&&(E(e),E(r)),u&&u.d(l),V(n,l),V(i,l)}}}function $0(t,e,n){let r,i,s,{$$slots:o={},$$scope:u}=e;const l=Ct(),a=Ci();x(t,a,h=>n(3,i=h));const f=Or({queryKey:["auth","user"],queryFn:cn,retry:!1,refetchInterval:2e4});At("currentUser",f);const c=ze([a,f],([h,k])=>h.isSuccess?k.isSuccess?"authenticated":k.isError?h.data.auth.provider==="no-auth"||h.data.auth.provider==="email"?(window.fetch("/api/auth/login",{method:"POST"}).then(A=>{A.ok&&l.invalidateQueries({queryKey:["auth"]})}),"authenticating"):"error":k.status:h.status);x(t,c,h=>n(2,r=h));let m="",p="";const d=di({mutationFn:async([h,k])=>{if((await window.fetch("/api/auth/login",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({email:h,password:k})})).ok)l.invalidateQueries({queryKey:["auth"]}),l.invalidateQueries({queryKey:["branches"]}),n(0,m=""),n(1,p="");else throw"Authentication failed"}});x(t,d,h=>n(4,s=h));function _(){m=this.value,n(0,m)}function v(){p=this.value,n(1,p)}const g=h=>{h.preventDefault(),s.isPending||s.mutate([m,p])};return t.$$set=h=>{"$$scope"in h&&n(12,u=h.$$scope)},[m,p,r,i,s,a,c,d,o,_,v,g,u]}class S0 extends ve{constructor(e){super(),ye(this,e,$0,T0,fe,{})}}function R0(t){let e;const n=t[1].default,r=de(n,t,t[0],null);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,[s]){r&&r.p&&(!e||s&1)&&pe(r,n,i,i[0],e?me(n,i[0],s,null):he(i[0]),null)},i(i){e||(b(r,i),e=!0)},o(i){y(r,i),e=!1},d(i){r&&r.d(i)}}}function D0(t,e,n){let{$$slots:r={},$$scope:i}=e;const s=of("branch"),o=Ci(),u=Ao(),l=ze([o,u],([d,_])=>({queryKey:["branches"],queryFn:cn,refetchInterval:6e4,enabled:d.isSuccess&&d.data.ready&&_.isSuccess})),a=Or(l);At("branches",a);const f=Fe(null);At("currentBranch",f);const c=o.subscribe(d=>{d.isSuccess&&d.data.ready&&!d.data.git.enabled&&f.set({id:"-",nogit:!0,title:"All files"})}),m=f.subscribe(d=>{d!==null?sf("branch",d.id):G1("branch")}),p=a.subscribe(d=>{if(d.isSuccess){for(let _ of d.data.local)_.id===s&&f.set(_);p()}});return rs(()=>{m(),c()}),t.$$set=d=>{"$$scope"in d&&n(0,i=d.$$scope)},[i,r]}class F0 extends ve{constructor(e){super(),ye(this,e,D0,R0,fe,{})}}function P0(t){let e;const n=t[1].default,r=de(n,t,t[0],null);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,[s]){r&&r.p&&(!e||s&1)&&pe(r,n,i,i[0],e?me(n,i[0],s,null):he(i[0]),null)},i(i){e||(b(r,i),e=!0)},o(i){y(r,i),e=!1},d(i){r&&r.d(i)}}}function L0(t,e,n){let{$$slots:r={},$$scope:i}=e;const s=Et(),o=ze(s,f=>f!==null?{queryKey:["branches",f.id,"configs","uedition"],queryFn:cn}:{queryKey:["branches","-","configs","uedition"],queryFn:cn,enabled:f!==null}),u=Or(o);At("uEditionConfig",u);const l=ze(s,f=>f!==null?{queryKey:["branches",f.id,"configs","ueditor"],queryFn:cn}:{queryKey:["branches","-","configs","ueditor"],queryFn:cn,enabled:!1}),a=Or(l);return At("uEditorConfig",a),t.$$set=f=>{"$$scope"in f&&n(0,i=f.$$scope)},[i,r]}class I0 extends ve{constructor(e){super(),ye(this,e,L0,P0,fe,{})}}function M0(t){let e,n;return e=new l0({}),{c(){U(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){y(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function N0(t){let e,n;return e=new I0({props:{$$slots:{default:[M0]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},p(r,i){const s={};i&2&&(s.$$scope={dirty:i,ctx:r}),e.$set(s)},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){y(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function H0(t){let e,n;return e=new F0({props:{$$slots:{default:[N0]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},p(r,i){const s={};i&2&&(s.$$scope={dirty:i,ctx:r}),e.$set(s)},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){y(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function V0(t){let e,n;return e=new S0({props:{$$slots:{default:[H0]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},p(r,i){const s={};i&2&&(s.$$scope={dirty:i,ctx:r}),e.$set(s)},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){y(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function U0(t){let e,n;return e=new p0({props:{$$slots:{default:[V0]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},p(r,i){const s={};i&2&&(s.$$scope={dirty:i,ctx:r}),e.$set(s)},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){y(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function B0(t){let e,n;return e=new oc({props:{client:t[0],$$slots:{default:[U0]},$$scope:{ctx:t}}}),{c(){U(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},p(r,[i]){const s={};i&2&&(s.$$scope={dirty:i,ctx:r}),e.$set(s)},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){y(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function K0(t){return[new va]}class j0 extends ve{constructor(e){super(),ye(this,e,K0,B0,fe,{})}}new j0({target:document.getElementById("app")});export{ze as $,P1 as A,N1 as B,Ge as C,Ae as D,Ce as E,Se as F,ce as G,Sf as H,Ne as I,Y1 as J,Ct as K,Et as L,lf as M,ru as N,Ut as O,Vt as P,Zb as Q,J as R,ve as S,J0 as T,mi as U,ey as V,Pe as W,ke as X,Xe as Y,Fe as Z,ar as _,S1 as a,km as a$,Lt as a0,Rr as a1,Zn as a2,xr as a3,Sc as a4,Qi as a5,ur as a6,ac as a7,ry as a8,Gr as a9,Qe as aA,X0 as aB,_t as aC,ny as aD,iy as aE,ii as aF,hi as aG,At as aH,_i as aI,bt as aJ,xa as aK,de as aL,pe as aM,he as aN,me as aO,Ke as aP,Pn as aQ,ne as aR,yt as aS,Oe as aT,ie as aU,Ue as aV,Me as aW,Fn as aX,at as aY,Dn as aZ,Tn as a_,rt as aa,ae as ab,ty as ac,Wt as ad,lc as ae,Ys as af,on as ag,z0 as ah,G0 as ai,Z0 as aj,Y0 as ak,ni as al,Ft as am,xe as an,es as ao,Ar as ap,$r as aq,pc as ar,sy as as,Wo as at,Jr as au,mt as av,Gs as aw,gn as ax,_o as ay,x0 as az,F1 as b,tn as b0,fi as b1,uy as b2,ly as b3,Lb as b4,p1 as b5,k1 as b6,fy as b7,ay as b8,cy as b9,oy as ba,Ib as bb,dy as bc,Lo as bd,it as be,H1 as bf,si as bg,ki as bh,bi,vi as bj,yi as bk,Tt as bl,Mt as bm,q0 as bn,B as c,U as d,S as e,N as f,w as g,P as h,ye as i,H as j,je as k,G as l,M1 as m,b as n,_e as o,y as p,ge as q,E as r,fe as s,Z as t,V as u,Te as v,x as w,ft as x,ns as y,rs as z};