var Q=Object.defineProperty;var k=t=>{throw TypeError(t)};var V=(t,e,a)=>e in t?Q(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a;var U=(t,e,a)=>V(t,typeof e!="symbol"?e+"":e,a),Y=(t,e,a)=>e.has(t)||k("Cannot "+a);var r=(t,e,a)=>(Y(t,e,"read from private field"),a?a.call(t):e.get(t)),v=(t,e,a)=>e.has(t)?k("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,a),x=(t,e,a,s)=>(Y(t,e,"write to private field"),s?s.call(t,a):e.set(t,a),a);import{b3 as W,a2 as J,aD as F,aB as X,aR as j,ac as E,aN as ee,a5 as T,aE as te,Z as C,Q as G,_ as ae,al as M,ak as q,aA as se,aY as re,O as ne,aj as ie,k as fe,aK as ue,a_ as ce,aV as de,aW as $,ad as oe,aG as le,v as _e,aH as he,at as ve,G as be,D as ge,P as me,b6 as Se,av as pe,u as Pe,s as Ee,a3 as Z,a4 as Ae,t as Ie,S as Re,L as ye}from"./B630xGby.js";import{s as De,g as Oe}from"./D0McYYdM.js";let y=!1,N=Symbol("unmounted");function Le(t,e,a){const s=a[e]??(a[e]={store:null,source:X(void 0),unsubscribe:F});if(s.store!==t&&!(N in a))if(s.unsubscribe(),s.store=t??null,t==null)s.source.v=void 0,s.unsubscribe=F;else{var n=!0;s.unsubscribe=De(t,i=>{n?s.source.v=i:j(s.source,i)}),n=!1}return t&&N in a?Oe(t):E(s.source)}function ke(){const t={};function e(){W(()=>{for(var a in t)t[a].unsubscribe();J(t,N,{enumerable:!1,value:!0})})}return[t,e]}function Te(t){var e=y;try{return y=!1,[t(),y]}finally{y=e}}var l,h,o,b,A,I,D;class Me{constructor(e,a=!0){U(this,"anchor");v(this,l,new Map);v(this,h,new Map);v(this,o,new Map);v(this,b,new Set);v(this,A,!0);v(this,I,e=>{if(r(this,l).has(e)){var a=r(this,l).get(e),s=r(this,h).get(a);if(s)ee(s),r(this,b).delete(a);else{var n=r(this,o).get(a);n&&(r(this,h).set(a,n.effect),r(this,o).delete(a),n.fragment.lastChild.remove(),this.anchor.before(n.fragment),s=n.effect)}for(const[i,u]of r(this,l)){if(r(this,l).delete(i),i===e)break;const f=r(this,o).get(u);f&&(T(f.effect),r(this,o).delete(u))}for(const[i,u]of r(this,h)){if(i===a||r(this,b).has(i))continue;const f=()=>{if(Array.from(r(this,l).values()).includes(i)){var _=document.createDocumentFragment();se(u,_),_.append(C()),r(this,o).set(i,{effect:u,fragment:_})}else T(u);r(this,b).delete(i),r(this,h).delete(i)};r(this,A)||!s?(r(this,b).add(i),te(u,f,!1)):f()}}});v(this,D,e=>{r(this,l).delete(e);const a=Array.from(r(this,l).values());for(const[s,n]of r(this,o))a.includes(s)||(T(n.effect),r(this,o).delete(s))});this.anchor=e,x(this,A,a)}ensure(e,a){var s=ae,n=re();if(a&&!r(this,h).has(e)&&!r(this,o).has(e))if(n){var i=document.createDocumentFragment(),u=C();i.append(u),r(this,o).set(e,{effect:G(()=>a(u)),fragment:i})}else r(this,h).set(e,G(()=>a(this.anchor)));if(r(this,l).set(s,e),n){for(const[f,c]of r(this,h))f===e?s.unskip_effect(c):s.skip_effect(c);for(const[f,c]of r(this,o))f===e?s.unskip_effect(c.effect):s.skip_effect(c.effect);s.oncommit(r(this,I)),s.ondiscard(r(this,D))}else M&&(this.anchor=q),r(this,I).call(this,s)}}l=new WeakMap,h=new WeakMap,o=new WeakMap,b=new WeakMap,A=new WeakMap,I=new WeakMap,D=new WeakMap;function Ue(t,e,a=!1){var s;M&&(s=q,ie());var n=new Me(t),i=a?fe:0;function u(f,c){if(M){var _=ue(s);if(f!==parseInt(_.substring(1))){var m=ce();de(m),n.anchor=m,$(!1),n.ensure(f,c),$(!0);return}}n.ensure(f,c)}ne(()=>{var f=!1;e((c,_=0)=>{f=!0,u(_,c)}),f||u(-1,null)},i)}function Ye(t,e,a,s){var B;var n=!pe||(a&Pe)!==0,i=(a&me)!==0,u=(a&Ie)!==0,f=s,c=!0,_=void 0,m=()=>u&&n?(_??(_=Z(s)),E(_)):(c&&(c=!1,f=u?Se(s):s),f);let S;if(i){var z=Re in t||ye in t;S=((B=oe(t,e))==null?void 0:B.set)??(z&&e in t?d=>t[e]=d:void 0)}var p,w=!1;i?[p,w]=Te(()=>t[e]):p=t[e],p===void 0&&s!==void 0&&(p=m(),S&&(n&&le(),S(p)));var g;if(n?g=()=>{var d=t[e];return d===void 0?m():(c=!0,d)}:g=()=>{var d=t[e];return d!==void 0&&(f=void 0),d===void 0?f:d},n&&(a&_e)===0)return g;if(S){var H=t.$$legacy;return(function(d,R){return arguments.length>0?((!n||!R||H||w)&&S(R?g():d),d):g()})}var O=!1,P=((a&Ee)!==0?Z:Ae)(()=>(O=!1,g()));i&&E(P);var K=be;return(function(d,R){if(arguments.length>0){const L=R?E(P):n&&i?he(d):d;return j(P,L),O=!0,f!==void 0&&(f=L),d}return ve&&O||(K.f&ge)!==0?P.v:E(P)})}export{Me as B,Le as a,Ue as i,Ye as p,ke as s};
