import{Y as x,q as F,aL as j,aD as B,aM as R,aN as A,J as U,I as $,w as C,a7 as H,U as G,aO as J,j as w,ae as L,aP as I,as as O,ad as g,a9 as b,a1 as h,a2 as V,aQ as S,aR as N,V as Q,af as X,aS as z,aT as K,au as Z,am as ee,aU as ae,_ as te,p as re,G as ne,X as se,d as ie}from"./7RXv2Ffc.js";const oe=["touchstart","touchmove"];function le(e){return oe.includes(e)}const P=new Set,D=new Set;function de(e,a,r,s={}){function i(t){if(s.capture||E.call(a,t),!t.cancelBubble)return j(()=>r?.call(this,t))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?F(()=>{a.addEventListener(e,i,s)}):a.addEventListener(e,i,s),i}function _e(e,a,r,s,i){var t={capture:s,passive:i},l=de(e,a,r,t);(a===document.body||a===window||a===document||a instanceof HTMLMediaElement)&&x(()=>{a.removeEventListener(e,l,t)})}function he(e){for(var a=0;a<e.length;a++)P.add(e[a]);for(var r of D)r(e)}let k=null;function E(e){var a=this,r=a.ownerDocument,s=e.type,i=e.composedPath?.()||[],t=i[0]||e.target;k=e;var l=0,f=k===e&&e.__root;if(f){var c=i.indexOf(f);if(c!==-1&&(a===document||a===window)){e.__root=a;return}var p=i.indexOf(a);if(p===-1)return;c<=p&&(l=c)}if(t=i[l]||e.target,t!==a){B(e,"currentTarget",{configurable:!0,get(){return t||r}});var m=$,u=C;R(null),A(null);try{for(var n,o=[];t!==null;){var v=t.assignedSlot||t.parentNode||t.host||null;try{var _=t["__"+s];if(_!=null&&(!t.disabled||e.target===t))if(U(_)){var[Y,...q]=_;Y.apply(t,[e,...q])}else _.call(t,e)}catch(T){n?o.push(T):n=T}if(e.cancelBubble||v===a||v===null)break;t=v}if(n){for(let T of o)queueMicrotask(()=>{throw T});throw n}}finally{e.__root=a,delete e.currentTarget,R(m),A(u)}}}let d;function ue(){d=void 0}function pe(e){let a=null,r=w;var s;if(w){for(a=h,d===void 0&&(d=V(document.head));d!==null&&(d.nodeType!==L||d.data!==I);)d=O(d);d===null?g(!1):d=b(O(d))}w||(s=document.head.appendChild(H()));try{G(()=>e(s),J)}finally{r&&(g(!0),d=h,b(a))}}function ve(e,a){var r=a==null?"":typeof a=="object"?a+"":a;r!==(e.__t??=e.nodeValue)&&(e.__t=r,e.nodeValue=r+"")}function fe(e,a){return W(e,a)}function ye(e,a){S(),a.intro=a.intro??!1;const r=a.target,s=w,i=h;try{for(var t=V(r);t&&(t.nodeType!==L||t.data!==I);)t=O(t);if(!t)throw N;g(!0),b(t),Q();const l=W(e,{...a,anchor:t});if(h===null||h.nodeType!==L||h.data!==X)throw z(),N;return g(!1),l}catch(l){if(l instanceof Error&&l.message.split(`
`).some(f=>f.startsWith("https://svelte.dev/e/")))throw l;return l!==N&&console.warn("Failed to hydrate: ",l),a.recover===!1&&K(),S(),Z(r),g(!1),fe(e,a)}finally{g(s),b(i),ue()}}const y=new Map;function W(e,{target:a,anchor:r,props:s={},events:i,context:t,intro:l=!0}){S();var f=new Set,c=u=>{for(var n=0;n<u.length;n++){var o=u[n];if(!f.has(o)){f.add(o);var v=le(o);a.addEventListener(o,E,{passive:v});var _=y.get(o);_===void 0?(document.addEventListener(o,E,{passive:v}),y.set(o,1)):y.set(o,_+1)}}};c(ee(P)),D.add(c);var p=void 0,m=ae(()=>{var u=r??a.appendChild(H());return te(()=>{if(t){re({});var n=ne;n.c=t}i&&(s.$$events=i),w&&se(u,null),p=e(u,s)||{},w&&(C.nodes_end=h),t&&ie()}),()=>{for(var n of f){a.removeEventListener(n,E);var o=y.get(n);--o===0?(document.removeEventListener(n,E),y.delete(n)):y.set(n,o)}D.delete(c),u!==r&&u.parentNode?.removeChild(u)}});return M.set(p,m),p}let M=new WeakMap;function ge(e,a){const r=M.get(e);return r?(M.delete(e),r(a)):Promise.resolve()}export{pe as a,he as d,_e as e,ye as h,fe as m,ve as s,ge as u};
