import{D as N,q as A,E as q,H as Y,aa as x,ab as B,ac as C,ad as U,ae as m,af as F,I as D,ag as M,ah as j,ai as k,aj as p,ak as w,K as z,a5 as H,z as Z,d as y,C as $,al as L,am as G,an as K,ao as X,g as R,a2 as J,ap as Q,b as V,j as W,aq as aa,X as ea,ar as ra,as as ia,at as ta,au as na,av as sa,aw as fa}from"./BZ0BXH4m.js";import{l as ua}from"./DIeogL5L.js";function ca(a,r,u=!1){A&&q();var s=a,t=null,e=null,d=j,c=u?Y:0,o=!1;const b=(_,n=!0)=>{o=!0,v(n,_)};var f=null;function I(){f!==null&&(f.lastChild.remove(),s.before(f),f=null);var _=d?t:e,n=d?e:t;_&&p(_),n&&w(n,()=>{d?e=null:t=null})}const v=(_,n)=>{if(d===(d=_))return;let E=!1;if(A){const P=x(s)===B;!!d===P&&(s=C(),U(s),m(!1),E=!0)}var g=k(),l=s;if(g&&(f=document.createDocumentFragment(),f.append(l=F())),d?t??=n&&D(()=>n(l)):e??=n&&D(()=>n(l)),g){var S=M,i=d?t:e,h=d?e:t;i&&S.skipped_effects.delete(i),h&&S.skipped_effects.add(h),S.add_callback(I)}else I();E&&m(!0)};N(()=>{o=!1,r(b),o||v(null,null)},c),A&&(s=z)}function O(a,r){return a===r||a?.[L]===r}function va(a={},r,u,s){return H(()=>{var t,e;return Z(()=>{t=e,e=[],y(()=>{a!==u(...e)&&(r(a,...e),t&&O(u(...t),a)&&r(null,...t))})}),()=>{$(()=>{e&&O(u(...e),a)&&r(null,...e)})}}),a}let T=!1;function da(a){var r=T;try{return T=!1,[a(),T]}finally{T=r}}function oa(a,r,u,s){var t=!ua||(u&ta)!==0,e=(u&ia)!==0,d=(u&sa)!==0,c=s,o=!0,b=()=>(o&&(o=!1,c=d?y(s):s),c),f;if(e){var I=L in a||fa in a;f=G(a,r)?.set??(I&&r in a?i=>a[r]=i:void 0)}var v,_=!1;e?[v,_]=da(()=>a[r]):v=a[r],v===void 0&&s!==void 0&&(v=b(),f&&(t&&K(),f(v)));var n;if(t?n=()=>{var i=a[r];return i===void 0?b():(o=!0,i)}:n=()=>{var i=a[r];return i!==void 0&&(c=void 0),i===void 0?c:i},t&&(u&X)===0)return n;if(f){var E=a.$$legacy;return(function(i,h){return arguments.length>0?((!t||!h||E||_)&&f(h?n():i),i):n()})}var g=!1,l=((u&na)!==0?J:Q)(()=>(g=!1,n()));e&&R(l);var S=ea;return(function(i,h){if(arguments.length>0){const P=h?R(l):t&&e?V(i):i;return W(l,P),g=!0,c!==void 0&&(c=P),i}return aa&&g||(S.f&ra)!==0?l.v:R(l)})}export{va as b,ca as i,oa as p};
