@ssgoi/core 7.1.0-beta.3 → 7.1.0

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.
package/dist/internal.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var Fe=Object.defineProperty;var ze=(n,t,e)=>t in n?Fe(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var Y=(n,t,e)=>ze(n,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const fe=require("./resolve-transition-rule-BL12rDDu.cjs"),oe=require("./multi-animation-B5hEmEgN.cjs");class Le extends oe.Animation{constructor(){super(...arguments);Y(this,"child",null);Y(this,"_state","idle");Y(this,"_settled",!1);Y(this,"listeners",new Set)}attach(e){const o=this.child;if(this.child=e,this._settled=!1,o){const d=o.getPose();o.complete(),e.matchInto(d)}e.playbackRate=this.playbackRate;const a=e.onComplete;e.onComplete=()=>{a==null||a(),this.child===e&&(this.child=null,this._state="idle",this._settled=!0),this.notify()};const r=e.onUpdate;e.onUpdate=d=>{var s;r==null||r(d),(s=this.onUpdate)==null||s.call(this,d),this.notify()},this._state==="paused"?e.pause():this._state==="reversing"?e.reverse():(this._state="playing",e.play()),this.notify()}play(){var e;this._state="playing",this._settled=!1,(e=this.child)==null||e.play(),this.notify()}reverse(){var e;this._state="reversing",this._settled=!1,(e=this.child)==null||e.reverse(),this.notify()}pause(){var e;this._state="paused",(e=this.child)==null||e.pause(),this.notify()}complete(){var e;(e=this.child)==null||e.complete(),this.notify()}get isAnimating(){var e;return((e=this.child)==null?void 0:e.isAnimating)??!1}get isPaused(){return this._state==="paused"}get isComplete(){return this._settled&&!this.child}get isReversing(){var e;return((e=this.child)==null?void 0:e.isReversing)??this._state==="reversing"}get progress(){var e;return((e=this.child)==null?void 0:e.progress)??0}findTimeForProgress(e){var o;return((o=this.child)==null?void 0:o.findTimeForProgress(e))??null}get playbackRate(){return super.playbackRate}set playbackRate(e){super.playbackRate=e,this.child&&(this.child.playbackRate=e),this.notify()}getPose(){var e;return((e=this.child)==null?void 0:e.getPose())??[]}getTimeline(){var e;return((e=this.child)==null?void 0:e.getTimeline())??[]}matchInto(e){var o;(o=this.child)==null||o.matchInto(e)}get activeChild(){return this.child}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}notify(){for(const e of this.listeners)e()}}const Xe=(n,t)=>{var e;n.style.position="absolute",n.style.width="100%",n.style.top=`${-1*(((e=t==null?void 0:t.scrollOffset)==null?void 0:e.y)??0)}px`,n.style.left="0"},Ee=new Set(["auto","scroll","overlay"]),qe=n=>{let t=n.parentElement;for(;t&&t!==document.body;){const e=window.getComputedStyle(t);if(Ee.has(e.overflowY)||Ee.has(e.overflowX))return t;t=t.parentElement}return document.documentElement},$e=n=>{let t=n.parentElement;for(;t&&t!==document.body;){const e=window.getComputedStyle(t).position;if(e==="relative"||e==="absolute"||e==="fixed"||e==="sticky")return t;t=t.parentElement}return document.body};function Ge(n){const t=Object.keys(n);return Promise.all(t.map(e=>n[e])).then(e=>{const o={};return t.forEach((a,r)=>{o[a]=e[r]}),o})}const Ke=768,Ue=10,Ve=10;function Ye(n={}){const{resolvePath:t=m=>m}=n;let e=null,o=!1,a=!1;const r=()=>{const m=(e==null?void 0:e.clientWidth)??0,g=m>0?m:typeof window<"u"?window.innerWidth:0;return g>0&&g<Ke},d=()=>(a||(o=r(),a=!0),o),s=m=>`path:${t(m)}`;let p=null;const u=new Map;let y=null,h=!1,S=0,v=0,E=0;const N=()=>{e&&y&&!h&&u.set(s(y),{x:e.scrollLeft,y:e.scrollTop})},_=(m,g,R)=>{if(!e)return;const M=++v,D=s(m),A=g&&u.has(D)?u.get(D):{x:0,y:0};let L=0;const W=()=>{if(!e||R!==S||M!==v)return;g||u.set(D,A),e.scrollTo({top:A.y,left:A.x}),!(Math.abs(e.scrollTop-A.y)<1&&Math.abs(e.scrollLeft-A.x)<1)&&L<Ue&&(L++,requestAnimationFrame(W))};requestAnimationFrame(W)};return{initializeContext:(m,g,R)=>{h=!0;const M=y===g?S:++S;p=m,e||(e=qe(m),o=r(),a=!0,typeof ResizeObserver<"u"&&new ResizeObserver(()=>{o=r()}).observe(e),(e===document.documentElement?window:e).addEventListener("scroll",N,{passive:!0})),y=g;const D=s(g),A=u.get(D),L=F=>{M===S&&(E=M,F&&A&&u.set(D,A),_(g,F,M))};R!==void 0?L(R):requestAnimationFrame(()=>{E!==M&&M===S&&L(!1)});let W=0;const K=()=>{M===S&&(W++,W>=Ve?h=!1:requestAnimationFrame(K))};return requestAnimationFrame(K),L},calculateScrollOffset:(m,g,R=!1)=>{const M=m?s(m):null,D=M&&u.has(M)?u.get(M):{x:0,y:0},A=g&&R?s(g):null,L=A&&u.has(A)?u.get(A):{x:0,y:0};return{x:-L.x+D.x,y:-L.y+D.y}},evictScrollPosition:m=>{u.delete(s(m))},getScrollContainer:()=>e,getPositionedParentElement:()=>p?$e(p):document.body,getScrollPosition:(m,g=!0)=>{if(!g)return{x:0,y:0};const R=m?s(m):null;return R&&u.has(R)?u.get(R):{x:0,y:0}},getIsMobile:d}}const Se=30,Pe=8,Te=1.2,ke=30,je=600;function Ze(){let n=null,t=!1,e=!1,o=null,a=null,r=!1;const d=(b,P)=>{for(let x=0;x<b.length;x++){const O=b.item(x);if(O&&O.identifier===P)return O}return null},s=()=>{o!==null&&(clearTimeout(o),o=null)},p=()=>{a!==null&&(clearTimeout(a),a=null)},u=()=>{t=!0,e=!0,s(),p(),o=setTimeout(()=>{t=!1,e=!1,o=null},je)},y=b=>{if(b.touches.length!==1){n=null;return}const P=b.touches.item(0);if(!P){n=null;return}const x=window.innerWidth,O=P.clientX<=Se,B=P.clientX>=x-Se;if(!O&&!B){n=null;return}n={identifier:P.identifier,startX:P.clientX,startY:P.clientY,fromLeftEdge:O,moved:!1}},h=b=>{if(!n)return;if(b.touches.length!==1){n=null;return}const P=d(b.touches,n.identifier);if(!P){n=null;return}const x=P.clientX-n.startX,O=P.clientY-n.startY,B=Math.abs(x),m=Math.abs(O);if(m>Pe&&m>B*Te){n=null;return}const g=n.fromLeftEdge?x>0:x<0;B>Pe&&B>m*Te&&g&&(n.moved=!0)},S=b=>{if(!n)return;const P=d(b.changedTouches,n.identifier);if(!P){n=null;return}const x=P.clientX-n.startX,O=n.fromLeftEdge?x>0:x<0;if(n.moved&&O&&Math.abs(x)>=ke){u(),n=null;return}n.moved&&Math.abs(x)>=ke&&u(),n=null},v=()=>{n&&(n.moved&&u(),n=null)};return{initialize:()=>{if(typeof window>"u"||r)return;r=!0;const b={passive:!0,capture:!0};window.addEventListener("touchstart",y,b),window.addEventListener("touchmove",h,b),window.addEventListener("touchend",S,b),window.addEventListener("touchcancel",v,b)},destroy:()=>{if(typeof window>"u"||!r)return;r=!1;const b={capture:!0};window.removeEventListener("touchstart",y,b),window.removeEventListener("touchmove",h,b),window.removeEventListener("touchend",S,b),window.removeEventListener("touchcancel",v,b),s(),p(),n=null,t=!1,e=!1},isSwipeBack:()=>{const b=t||e;return b&&s(),b},onPageEnter:()=>{t=!1,s(),p(),a=setTimeout(()=>{e=!1,a=null},0)}}}const xe="__ssgoi_entry_v1",ue=new WeakMap,_e={read:()=>null,previous:()=>null,dispose(){}};function Je(){var r;if(typeof window>"u")return _e;const n=window.navigation;if((r=n==null?void 0:n.currentEntry)!=null&&r.key&&n.currentEntry.index>=0)return{read:()=>Re(n.currentEntry),previous:()=>{var s;const d=(s=n.currentEntry)==null?void 0:s.index;return Re(n.entries().find(p=>p.index===(d??0)-1))},dispose(){}};const t=window;let e=ue.get(t);e||(e=Qe(t),ue.set(t,e)),e.users++;const o=e;let a=!1;return{read:o.read,previous:o.previous,dispose(){a||(a=!0,--o.users===0&&(o.dispose(),ue.delete(t)))}}}function Re(n){return n&&typeof n.key=="string"&&typeof n.url=="string"&&Number.isSafeInteger(n.index)&&n.index>=0?{key:n.key,index:n.index,url:n.url}:null}function de(n){return n!==null&&typeof n=="object"&&Object.getPrototypeOf(n)===Object.prototype}function Qe(n){const t=n.history,e=t.pushState,o=t.replaceState,a=`${Date.now()}-${Math.random().toString(36).slice(2)}-`;let r=0,d=!0,s=null;const p=()=>{const v=t.state,E=de(v)?v[xe]:null;return!de(E)||typeof E.key!="string"||!E.key.startsWith(a)||!Number.isSafeInteger(E.index)?null:{key:E.key,index:E.index,url:n.location.href}},u=(v,E)=>v!==null&&!de(v)?v:{...v,[xe]:E},y=v=>({key:`${a}${++r}`,index:v});try{o.call(t,u(t.state,y(0)),"")}catch{return{..._e,users:0}}const h=function(v,E,N){if(!d)return e.call(this,v,E,N);const _=p(),$=y(((_==null?void 0:_.index)??0)+1);e.call(this,u(v,$),E,N),s=_},S=function(v,E,N){if(!d)return o.call(this,v,E,N);const _=p();o.call(this,u(v,_??y(0)),E,N)};return t.pushState=h,t.replaceState=S,{users:0,read:p,previous:()=>s,dispose(){d=!1,t.pushState===h&&(t.pushState=e),t.replaceState===S&&(t.replaceState=o)}}}function et(){let n=null,t=null;const e=new Set,o=r=>{r&&e.add(r.key),e.size>200&&e.delete(e.values().next().value)},a=()=>{n||(n=Je(),t=n.read(),o(t))};return{connect:a,resolve(r,d){a();const s=n.read();let p=t,u="unknown";if(p&&s&&(s.key===p.key||s.index===p.index?u="replace":s.index<p.index?u="back":u=e.has(s.key)?"forward":"push"),u==="push"){const y=n.previous();y&&y.index===s.index-1&&fe.normalizePath(new URL(y.url).pathname)===fe.normalizePath(r)&&(p=y)}return t=s,o(p),o(s),{kind:u,direction:u==="back"?"backward":"forward",from:p,to:s}},dispose(){n==null||n.dispose(),n=null,t=null,e.clear()}}}function tt(){const n=et(),t=new Map;return{connect:n.connect,resolve(e,o,a){var u,y;const r=n.resolve(e,o),d=(u=r.from)==null?void 0:u.key,s=(y=r.to)==null?void 0:y.key;if(r.kind==="back"&&d&&s){const h=t.get(d);if((h==null?void 0:h.source)===s&&h.from===o&&h.to===e)return h.rule?{...h.rule,direction:h.rule.direction==="forward"?"backward":"forward",preserveScroll:{from:h.rule.preserveScroll.to,to:h.rule.preserveScroll.from}}:null}if(r.kind==="forward"&&d&&s){const h=t.get(s);if((h==null?void 0:h.source)===d&&h.from===e&&h.to===o)return h.rule}const p=a(r.direction);if(s&&r.kind==="replace"&&t.delete(s),s&&d&&r.kind==="push"){for(const[h,S]of t)S.index>=r.to.index&&t.delete(h);t.set(s,{source:d,index:r.to.index,from:e,to:o,rule:p?{...p,preserveScroll:{...p.preserveScroll}}:null}),t.size>100&&t.delete(t.keys().next().value)}return p},dispose(){n.dispose(),t.clear()}}}function nt(n={}){let t=null,e=null;function o(){var r,d;t&&((r=t.out)==null||r.resolve(null),(d=t.in)==null||d.resolve(null),t=null)}function a(){if(t!=null&&t.out&&t.in){if(t.out.path===t.in.path){o();return}const r={from:t.out.path,to:t.in.path,out:t.out.payload,in:t.in.payload};e=r,t.out.resolve(r),t.in.resolve(r),t=null}}return{arrive(r,d,s){return new Promise(p=>{var S,v;const u=e===null?null:d==="out"?{path:e.from,payload:e.out}:{path:e.to,payload:e.in};if((u==null?void 0:u.path)===r){p(null);return}d==="out"&&((S=t==null?void 0:t.in)==null?void 0:S.path)===r&&!t.out&&(t.in.resolve(null),t.in=void 0);const y=t==null?void 0:t[d];y&&y.path!==r&&o(),t||(t={});const h=t[d];if(h){if(((v=n.keepCurrent)==null?void 0:v.call(n,{type:d,path:r,current:h.payload,next:s}))??!1){p(null);return}h.resolve(null)}t[d]={path:r,payload:s,resolve:p},a()})},cancel(r){(t!=null&&t.out&&r(t.out.payload)||t!=null&&t.in&&r(t.in.payload))&&o(),(e&&r(e.out)||e&&r(e.in))&&(e=null)}}}const ot={},G=new Map;let Q=null,Ae=!1;function De(n,t,e){n instanceof HTMLElement&&G.has(n)&&!n.isConnected&&e.set(n,{entry:G.get(n),anchor:t});for(const o of Array.from(n.childNodes))De(o,t,e)}function it(n){const t=new Set(Array.from(n.values(),({entry:e})=>e));for(const[e,{entry:o,anchor:a}]of n){G.delete(e);let r=o.parent,d=!1;for(;r;){if(r.group===o.group&&t.has(r)){d=!0;break}r=r.parent}queueMicrotask(()=>o.callback(a,{emit:!d}))}}function rt(){if(Ae||typeof document>"u")return;Ae=!0,Q=new MutationObserver(t=>{const e=new Map;for(const o of t){const a={parent:o.target,nextSibling:o.nextSibling};for(const r of Array.from(o.removedNodes))De(r,a,e)}it(e)});const n=()=>{Q==null||Q.observe(document.body,{childList:!0,subtree:!0})};document.body?n():document.addEventListener("DOMContentLoaded",n,{once:!0})}function st(n,t,e=ot){rt();let o=n.parentElement,a=null;for(;o;){const r=G.get(o);if((r==null?void 0:r.group)===e){a=r;break}o=o.parentElement}return G.set(n,{element:n,callback:t,group:e,parent:a}),()=>{G.delete(n)}}const pe=new WeakMap;let ee=null;const te="none !important";function j(n){const t=n.style.getPropertyValue("display");return n.style.getPropertyPriority("display")?`${t} !important`:t}function lt(){return ee||(ee=new MutationObserver(n=>{for(const t of n){const e=t.target,o=pe.get(e);if(!o)continue;const a=j(e);a!==o.accounted&&(o.accounted=a,a===te?(o.reactHidden=!0,o.onHide()):a!=="none"&&o.reactHidden&&(o.reactHidden=!1,o.onShow()))}}),ee)}function ct(n,t){const e=j(n),o={accounted:e,reactHidden:e===te,onHide:t.onHide,onShow:t.onShow};return pe.set(n,o),lt().observe(n,{attributes:!0,attributeFilter:["style"]}),{get isHidden(){return j(n)===te},setDisplay(a,r=!1){a===null?n.style.removeProperty("display"):n.style.setProperty("display",a,r?"important":""),o.accounted=j(n)},sync(){o.accounted=j(n),o.reactHidden=o.accounted===te},stop(){pe.delete(n)}}}function at(n,t={}){const{transitions:e=[],middleware:o=(i,l)=>({from:i,to:l})}=n,a=t.host??new Le,r={},d=nt({keepCurrent:({current:i,next:l})=>i.element.contains(l.element)}),s=tt(),p=typeof e=="function"?e:()=>e,u=Ze();u.initialize();const y=new Map,h=i=>{let l=y.get(i);return l===void 0&&(l=o(i,i).from,y.set(i,l)),l},{initializeContext:S,calculateScrollOffset:v,evictScrollPosition:E,getScrollContainer:N,getPositionedParentElement:_,getScrollPosition:$,getIsMobile:b}=Ye({resolvePath:h}),P=new Map,x=()=>{const i=b();let l=P.get(i);return l||(l=p({isMobile:i}),P.set(i,l)),l},O=new WeakMap,B=i=>{O.set(i,{parent:i.parentNode,nextSibling:i.nextSibling})},m=i=>{const l=O.get(i);return l||{parent:i.parentNode,nextSibling:i.nextSibling}},g=new WeakMap,R=new WeakMap;let M=0;const D=i=>{const l=typeof getComputedStyle<"u"?getComputedStyle(i).display:"";return l&&l!=="none"?l:"block"},A=(i,l)=>{l.visibleDisplay=i.style.getPropertyValue("display"),l.computedDisplay=D(i)},L=(i,l)=>{if(R.get(i)!==l)return;R.delete(i);const c=g.get(i);c&&(c.savedCss!==null&&(i.style.cssText=c.savedCss,c.savedCss=null),c.intent==="hidden"?c.vis.setDisplay("none",!0):c.visibleDisplay?(c.vis.setDisplay(c.visibleDisplay,!1),A(i,c)):(c.vis.setDisplay(null),A(i,c)))},W=(i,l)=>{if(i.mode!=="hidden")return;const c=Array.from(new Set([i.element,l==null?void 0:l.element].filter(Boolean))),T=++M;for(const f of c)R.set(f,T);a.complete();for(const f of c)L(f,T)},K=(i,l,c,T,f,w,k)=>{const C=f.element,H=w.element,z=(f.mode??"unmount")==="hidden",{parent:X,nextSibling:U}=f.parent?{parent:f.parent,nextSibling:f.nextSibling}:m(C),Z=v(c,T,k.to),re={direction:l,scrollOffset:Z,from:{scroll:$(c)},to:{scroll:$(T,k.to)},get scrollingElement(){return N()||document.documentElement},get positionedParent(){return _()}};let I;if(z){I=C,I.style.top=`${-1*((Z==null?void 0:Z.y)??0)}px`;const q=g.get(H);q&&q.savedCss===null&&(q.savedCss=H.style.cssText)}else I=C,Xe(I,re);k.from||E(c);const J=z?++M:0;z&&(R.set(H,J),R.set(C,J));const ve=Promise.resolve(I),be=Promise.resolve(H),we=[],We={from:ve,to:be,context:re,createElement:((q,se="div")=>{const V=document.createElement(se);return V.setAttribute("data-ssgoi-id",q),we.push(V),V})},Be=Promise.resolve(i.prepare?i.prepare(We):{});Ge({from:ve,to:be,extras:Be}).then(({from:q,to:se,extras:V})=>{!z&&X&&(U&&X.contains(U)?X.insertBefore(I,U):X.appendChild(I));const le=i.animation({from:q,to:se,context:re,...V}),ce=le.onComplete;le.onComplete=()=>{ce==null||ce(),z?(L(C,J),L(H,J)):I.parentNode&&I.parentNode.removeChild(I);for(const ae of we)ae.parentNode&&ae.parentNode.removeChild(ae)},a.attach(le)})},F=(i,l,c)=>{const T=u.isSwipeBack();d.arrive(i,l,c).then(f=>{var H,ie,z,X;if(l==="in"&&u.onPageEnter(),!f){l==="out"&&W(c);return}if(l!=="in")return;const{from:w,to:k}=o(f.from,f.to),C=s.resolve(f.from,f.to,U=>fe.resolveTransitionRule(w,k,x(),U));if(!C){(ie=(H=f.in).applyScrollPolicy)==null||ie.call(H,!1),E(f.from),W(f.out,f.in);return}if((X=(z=f.in).applyScrollPolicy)==null||X.call(z,C.preserveScroll.to),T){C.preserveScroll.from||E(f.from),W(f.out,f.in);return}K(C.transition,C.direction,f.from,f.to,f.out,f.in,C.preserveScroll)})},he=(i,l)=>{const c=g.get(i);if(!c)return;const T=c.intent==="hidden";if(c.intent="hidden",c.savedCss===null&&(c.savedCss=i.style.cssText),c.vis.setDisplay(c.computedDisplay||"block",!0),i.style.position="absolute",i.style.width="100%",i.style.left="0",T)return;const f=m(i),w={element:i,parent:f.parent,nextSibling:f.nextSibling,mode:"hidden"},k=c.pendingOutPath??c.currentPath??l;c.pendingOutPath=null,F(k,"out",w)},He=(i,l)=>{const c=g.get(i);if(!c||c.intent==="visible")return;c.intent="visible",c.currentPath=i.getAttribute("data-ssgoi-transition")??c.currentPath??l,c.pendingOutPath=null,c.pathRevision++,A(i,c),c.savedCss!==null&&(i.style.cssText=c.savedCss,c.visibleDisplay?c.vis.setDisplay(c.visibleDisplay,!1):c.vis.setDisplay(null));const T=c.currentPath,f=S(i,T),w={element:i,parent:i.parentElement,nextSibling:i.nextElementSibling,applyScrollPolicy:f};F(T,"in",w)},Ie=(i,l,c,T=!0)=>{const f=g.get(i),w=(f==null?void 0:f.pendingOutPath)??(f==null?void 0:f.currentPath)??l;if(f&&(f.vis.stop(),g.delete(i),R.delete(i),f.intent==="hidden")){d.cancel(H=>H.element===i);return}if(!T)return;const k=c??m(i),C={element:i,parent:k.parent,nextSibling:k.nextSibling,mode:"unmount"};F(w,"out",C)},ye=new WeakSet,me=(i,l,{enter:c=!0}={})=>{if(s.connect(),ye.has(l)){const w=g.get(l);if(w&&w.currentPath!==i){w.intent==="visible"&&w.pendingOutPath===null&&(w.pendingOutPath=w.currentPath),w.currentPath=i;const k=++w.pathRevision;queueMicrotask(()=>{w.pathRevision===k&&(w.pendingOutPath=null)})}return}ye.add(l),B(l);const T=ct(l,{onHide:()=>he(l,i),onShow:()=>He(l,i)}),f={vis:T,savedCss:null,intent:T.isHidden?"hidden":"visible",visibleDisplay:"",computedDisplay:"block",currentPath:i,pendingOutPath:null,pathRevision:0};if(g.set(l,f),!T.isHidden&&(A(l,f),c)){const w=S(l,i),k={element:l,parent:l.parentElement,nextSibling:l.nextElementSibling,applyScrollPolicy:w};F(i,"in",k)}st(l,(w,k)=>Ie(l,i,w,(k==null?void 0:k.emit)??!0),r)},ge=new Map;return{register:me,refFor:i=>{let l=ge.get(i);return l||(l=c=>{c&&me(i,c)},ge.set(i,l)),l},disconnect:s.dispose}}const Ne="data-ssgoi-root",ut=`[${Ne}]`,ne="data-ssgoi-transition",Me=`[${ne}]`,dt="[data-ssgoi-clone]";function ft(){return typeof MutationObserver<"u"&&typeof HTMLElement<"u"&&typeof Node<"u"}function pt(n){return n.nodeType===Node.ELEMENT_NODE}function ht(n){return n instanceof HTMLElement}function Oe(n){let t=0,e=n.parentElement;for(;e;)t++,e=e.parentElement;return t}function Ce(n,t,e=n){const o=Array.from(n).sort((a,r)=>Oe(a)-Oe(r));for(const a of o){const r=a.getAttribute(ne);if(r===null)continue;let d=a.parentElement,s=!1;for(;d;){if(e.has(d)){s=!0;break}d=d.parentElement}t.register(r,a,{enter:!s})}}function yt(n,t){if(!ft())return()=>{};n.setAttribute(Ne,"");const e=s=>s.closest(ut)===n,o=s=>!ht(s)||!e(s)||s.closest(dt)||s.getAttribute(ne)===null?null:s,a=(s,p)=>{if(pt(s)){if(s.matches(Me)){const u=o(s);u&&p.add(u)}for(const u of s.querySelectorAll(Me)){const y=o(u);y&&p.add(y)}}},r=new MutationObserver(s=>{const p=new Set,u=new Set;for(const y of s){if(y.type==="attributes"){const h=o(y.target);h&&p.add(h);continue}for(const h of y.addedNodes)a(h,u)}for(const y of u)p.add(y);Ce(p,t,u)});r.observe(n,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[ne]});const d=new Set;return a(n,d),Ce(d,t),()=>{var s;r.disconnect(),(s=t.disconnect)==null||s.call(t)}}exports.Animation=oe.Animation;exports.MultiAnimation=oe.MultiAnimation;exports.WebAnimation=oe.WebAnimation;exports.HostAnimation=Le;exports.createSggoiTransitionContext=at;exports.observeSsgoiTransitions=yt;
1
+ "use strict";var Fe=Object.defineProperty;var ze=(n,t,e)=>t in n?Fe(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var Y=(n,t,e)=>ze(n,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const fe=require("./resolve-transition-rule-BL12rDDu.cjs"),oe=require("./multi-animation-B5hEmEgN.cjs");class _e extends oe.Animation{constructor(){super(...arguments);Y(this,"child",null);Y(this,"_state","idle");Y(this,"_settled",!1);Y(this,"listeners",new Set)}attach(e){const o=this.child;if(this.child=e,this._settled=!1,o){const p=o.getPose();o.complete(),e.matchInto(p)}e.playbackRate=this.playbackRate;const c=e.onComplete;e.onComplete=()=>{c==null||c(),this.child===e&&(this.child=null,this._state="idle",this._settled=!0),this.notify()};const i=e.onUpdate;e.onUpdate=p=>{var s;i==null||i(p),(s=this.onUpdate)==null||s.call(this,p),this.notify()},this._state==="paused"?e.pause():this._state==="reversing"?e.reverse():(this._state="playing",e.play()),this.notify()}play(){var e;this._state="playing",this._settled=!1,(e=this.child)==null||e.play(),this.notify()}reverse(){var e;this._state="reversing",this._settled=!1,(e=this.child)==null||e.reverse(),this.notify()}pause(){var e;this._state="paused",(e=this.child)==null||e.pause(),this.notify()}complete(){var e;(e=this.child)==null||e.complete(),this.notify()}get isAnimating(){var e;return((e=this.child)==null?void 0:e.isAnimating)??!1}get isPaused(){return this._state==="paused"}get isComplete(){return this._settled&&!this.child}get isReversing(){var e;return((e=this.child)==null?void 0:e.isReversing)??this._state==="reversing"}get progress(){var e;return((e=this.child)==null?void 0:e.progress)??0}findTimeForProgress(e){var o;return((o=this.child)==null?void 0:o.findTimeForProgress(e))??null}get playbackRate(){return super.playbackRate}set playbackRate(e){super.playbackRate=e,this.child&&(this.child.playbackRate=e),this.notify()}getPose(){var e;return((e=this.child)==null?void 0:e.getPose())??[]}getTimeline(){var e;return((e=this.child)==null?void 0:e.getTimeline())??[]}matchInto(e){var o;(o=this.child)==null||o.matchInto(e)}get activeChild(){return this.child}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}notify(){for(const e of this.listeners)e()}}const Xe=(n,t)=>{var e;n.style.position="absolute",n.style.width="100%",n.style.top=`${-1*(((e=t==null?void 0:t.scrollOffset)==null?void 0:e.y)??0)}px`,n.style.left="0"},Se=new Set(["auto","scroll","overlay"]),qe=n=>{let t=n.parentElement;for(;t&&t!==document.body;){const e=window.getComputedStyle(t);if(Se.has(e.overflowY)||Se.has(e.overflowX))return t;t=t.parentElement}return document.documentElement},$e=n=>{let t=n.parentElement;for(;t&&t!==document.body;){const e=window.getComputedStyle(t).position;if(e==="relative"||e==="absolute"||e==="fixed"||e==="sticky")return t;t=t.parentElement}return document.body};function Ge(n){const t=Object.keys(n);return Promise.all(t.map(e=>n[e])).then(e=>{const o={};return t.forEach((c,i)=>{o[c]=e[i]}),o})}const Ke=768,Ue=10,Ve=10;function Ye(n={}){const{resolvePath:t=b=>b}=n;let e=null,o=!1,c=!1;const i=()=>{const b=(e==null?void 0:e.clientWidth)??0,w=b>0?b:typeof window<"u"?window.innerWidth:0;return w>0&&w<Ke},p=()=>(c||(o=i(),c=!0),o),s=b=>`path:${t(b)}`;let y=null;const u=new Map;let m=null,h=!1,P=0,O=0,L=0;const z=()=>{e&&m&&!h&&u.set(s(m),{x:e.scrollLeft,y:e.scrollTop})},X=(b,w,x)=>{if(!e)return;const M=++O,N=s(b),R=w&&u.has(N)?u.get(N):{x:0,y:0};let _=0;const W=()=>{if(!e||x!==P||M!==O)return;w||u.set(N,R),e.scrollTo({top:R.y,left:R.x}),!(Math.abs(e.scrollTop-R.y)<1&&Math.abs(e.scrollLeft-R.x)<1)&&_<Ue&&(_++,requestAnimationFrame(W))};requestAnimationFrame(W)};return{initializeContext:(b,w,x)=>{h=!0;const M=m===w?P:++P;y=b,e||(e=qe(b),o=i(),c=!0,typeof ResizeObserver<"u"&&new ResizeObserver(()=>{o=i()}).observe(e),(e===document.documentElement?window:e).addEventListener("scroll",z,{passive:!0})),m=w;const N=s(w),R=u.get(N),_=B=>{M===P&&(L=M,B&&R&&u.set(N,R),X(w,B,M))};x!==void 0?_(x):requestAnimationFrame(()=>{L!==M&&M===P&&_(!1)});let W=0;const K=()=>{M===P&&(W++,W>=Ve?h=!1:requestAnimationFrame(K))};return requestAnimationFrame(K),_},calculateScrollOffset:(b,w,x=!1)=>{const M=b?s(b):null,N=M&&u.has(M)?u.get(M):{x:0,y:0},R=w&&x?s(w):null,_=R&&u.has(R)?u.get(R):{x:0,y:0};return{x:-_.x+N.x,y:-_.y+N.y}},evictScrollPosition:b=>{u.delete(s(b))},getScrollContainer:()=>e,getPositionedParentElement:()=>y?$e(y):document.body,getScrollPosition:(b,w=!0)=>{if(!w)return{x:0,y:0};const x=b?s(b):null;return x&&u.has(x)?u.get(x):{x:0,y:0}},getIsMobile:p}}const Ee=30,Pe=8,Te=1.2,ke=30,je=600;function Ze(){let n=null,t=!1,e=!1,o=null,c=null,i=!1;const p=(f,g)=>{for(let S=0;S<f.length;S++){const A=f.item(S);if(A&&A.identifier===g)return A}return null},s=()=>{o!==null&&(clearTimeout(o),o=null)},y=()=>{c!==null&&(clearTimeout(c),c=null)},u=()=>{t=!0,e=!0,s(),y(),o=setTimeout(()=>{t=!1,e=!1,o=null},je)},m=f=>{if(f.touches.length!==1){n=null;return}const g=f.touches.item(0);if(!g){n=null;return}const S=window.innerWidth,A=g.clientX<=Ee,D=g.clientX>=S-Ee;if(!A&&!D){n=null;return}n={identifier:g.identifier,startX:g.clientX,startY:g.clientY,fromLeftEdge:A,moved:!1}},h=f=>{if(!n)return;if(f.touches.length!==1){n=null;return}const g=p(f.touches,n.identifier);if(!g){n=null;return}const S=g.clientX-n.startX,A=g.clientY-n.startY,D=Math.abs(S),b=Math.abs(A);if(b>Pe&&b>D*Te){n=null;return}const w=n.fromLeftEdge?S>0:S<0;D>Pe&&D>b*Te&&w&&(n.moved=!0)},P=f=>{if(!n)return;const g=p(f.changedTouches,n.identifier);if(!g){n=null;return}const S=g.clientX-n.startX,A=n.fromLeftEdge?S>0:S<0;if(n.moved&&A&&Math.abs(S)>=ke){u(),n=null;return}n.moved&&Math.abs(S)>=ke&&u(),n=null},O=()=>{n&&(n.moved&&u(),n=null)};return{initialize:()=>{if(typeof window>"u"||i)return;i=!0;const f={passive:!0,capture:!0};window.addEventListener("touchstart",m,f),window.addEventListener("touchmove",h,f),window.addEventListener("touchend",P,f),window.addEventListener("touchcancel",O,f)},destroy:()=>{if(typeof window>"u"||!i)return;i=!1;const f={capture:!0};window.removeEventListener("touchstart",m,f),window.removeEventListener("touchmove",h,f),window.removeEventListener("touchend",P,f),window.removeEventListener("touchcancel",O,f),s(),y(),n=null,t=!1,e=!1},isSwipeBack:()=>{const f=t||e;return f&&s(),f},onPageEnter:()=>{t=!1,s(),y(),c=setTimeout(()=>{e=!1,c=null},0)}}}const xe="__ssgoi_entry_v1",ue=new WeakMap,Le={read:()=>null,previous:()=>null,dispose(){}};function Je(){if(typeof window>"u")return Le;const n=window.navigation,t=window;let e=ue.get(t);e||(e=Qe(t,n),ue.set(t,e)),e.users++;const o=e;let c=!1;return{read:o.read,previous:o.previous,dispose(){c||(c=!0,--o.users===0&&(o.dispose(),ue.delete(t)))}}}function Re(n){return n&&typeof n.key=="string"&&typeof n.url=="string"&&Number.isSafeInteger(n.index)&&n.index>=0?{key:n.key,index:n.index,url:n.url}:null}function de(n){return n!==null&&typeof n=="object"&&Object.getPrototypeOf(n)===Object.prototype}function Qe(n,t){var X;const e=n.history,o=e.pushState,c=e.replaceState,i=`${Date.now()}-${Math.random().toString(36).slice(2)}-`;let p=0,s=!0,y=null,u=null;const m=()=>{const v=Re(t==null?void 0:t.currentEntry);return(v==null?void 0:v.url)===n.location.href?v:null},h=()=>{const v=e.state,f=de(v)?v[xe]:null;return!de(f)||typeof f.key!="string"||!f.key.startsWith(i)||!Number.isSafeInteger(f.index)?m():{key:f.key,index:f.index,url:n.location.href}},P=(v,f)=>v!==null&&!de(v)?v:{...v,[xe]:f},O=v=>({key:`${i}${++p}`,index:v});try{c.call(e,P(e.state,O(((X=m())==null?void 0:X.index)??0)),"")}catch{return{...Le,read:m,users:0}}const L=function(v,f,g){var D;if(!s)return o.call(this,v,f,g);const S=h(),A=O(((S==null?void 0:S.index)??0)+1);o.call(this,P(v,A),f,g),y=S,u=((D=h())==null?void 0:D.key)??null},z=function(v,f,g){if(!s)return c.call(this,v,f,g);const S=h();c.call(this,P(v,S??O(0)),f,g)};return e.pushState=L,e.replaceState=z,{users:0,read:h,previous:()=>{var f;if(((f=h())==null?void 0:f.key)===u)return y;const v=m();return v?Re(t==null?void 0:t.entries().find(g=>g.index===v.index-1)):null},dispose(){s=!1,e.pushState===L&&(e.pushState=o),e.replaceState===z&&(e.replaceState=c)}}}function et(){let n=null,t=null;const e=new Set,o=i=>{i&&e.add(i.key),e.size>200&&e.delete(e.values().next().value)},c=()=>{n||(n=Je(),t=n.read(),o(t))};return{connect:c,resolve(i,p){c();const s=n.read();let y=t,u="unknown";if(y&&s&&(s.key===y.key||s.index===y.index?u="replace":s.index<y.index?u="back":u=e.has(s.key)?"forward":"push"),u==="push"){const m=n.previous();m&&m.index===s.index-1&&fe.normalizePath(new URL(m.url).pathname)===fe.normalizePath(i)&&(y=m)}return t=s,o(y),o(s),{kind:u,direction:u==="back"?"backward":"forward",from:y,to:s}},dispose(){n==null||n.dispose(),n=null,t=null,e.clear()}}}function tt(){const n=et(),t=new Map;return{connect:n.connect,resolve(e,o,c){var u,m;const i=n.resolve(e,o),p=(u=i.from)==null?void 0:u.key,s=(m=i.to)==null?void 0:m.key;if(i.kind==="back"&&p&&s){const h=t.get(p);if((h==null?void 0:h.source)===s&&h.from===o&&h.to===e)return h.rule?{...h.rule,direction:h.rule.direction==="forward"?"backward":"forward",preserveScroll:{from:h.rule.preserveScroll.to,to:h.rule.preserveScroll.from}}:null}if(i.kind==="forward"&&p&&s){const h=t.get(s);if((h==null?void 0:h.source)===p&&h.from===e&&h.to===o)return h.rule}const y=c(i.direction);if(s&&i.kind==="replace"&&t.delete(s),s&&p&&i.kind==="push"){for(const[h,P]of t)P.index>=i.to.index&&t.delete(h);t.set(s,{source:p,index:i.to.index,from:e,to:o,rule:y?{...y,preserveScroll:{...y.preserveScroll}}:null}),t.size>100&&t.delete(t.keys().next().value)}return y},dispose(){n.dispose(),t.clear()}}}function nt(n={}){let t=null,e=null;function o(){var i,p;t&&((i=t.out)==null||i.resolve(null),(p=t.in)==null||p.resolve(null),t=null)}function c(){if(t!=null&&t.out&&t.in){if(t.out.path===t.in.path){o();return}const i={from:t.out.path,to:t.in.path,out:t.out.payload,in:t.in.payload};e=i,t.out.resolve(i),t.in.resolve(i),t=null}}return{arrive(i,p,s){return new Promise(y=>{var P,O;const u=e===null?null:p==="out"?{path:e.from,payload:e.out}:{path:e.to,payload:e.in};if((u==null?void 0:u.path)===i){y(null);return}p==="out"&&((P=t==null?void 0:t.in)==null?void 0:P.path)===i&&!t.out&&(t.in.resolve(null),t.in=void 0);const m=t==null?void 0:t[p];m&&m.path!==i&&o(),t||(t={});const h=t[p];if(h){if(((O=n.keepCurrent)==null?void 0:O.call(n,{type:p,path:i,current:h.payload,next:s}))??!1){y(null);return}h.resolve(null)}t[p]={path:i,payload:s,resolve:y},c()})},cancel(i){(t!=null&&t.out&&i(t.out.payload)||t!=null&&t.in&&i(t.in.payload))&&o(),(e&&i(e.out)||e&&i(e.in))&&(e=null)}}}const ot={},G=new Map;let Q=null,Ae=!1;function De(n,t,e){n instanceof HTMLElement&&G.has(n)&&!n.isConnected&&e.set(n,{entry:G.get(n),anchor:t});for(const o of Array.from(n.childNodes))De(o,t,e)}function rt(n){const t=new Set(Array.from(n.values(),({entry:e})=>e));for(const[e,{entry:o,anchor:c}]of n){G.delete(e);let i=o.parent,p=!1;for(;i;){if(i.group===o.group&&t.has(i)){p=!0;break}i=i.parent}queueMicrotask(()=>o.callback(c,{emit:!p}))}}function it(){if(Ae||typeof document>"u")return;Ae=!0,Q=new MutationObserver(t=>{const e=new Map;for(const o of t){const c={parent:o.target,nextSibling:o.nextSibling};for(const i of Array.from(o.removedNodes))De(i,c,e)}rt(e)});const n=()=>{Q==null||Q.observe(document.body,{childList:!0,subtree:!0})};document.body?n():document.addEventListener("DOMContentLoaded",n,{once:!0})}function st(n,t,e=ot){it();let o=n.parentElement,c=null;for(;o;){const i=G.get(o);if((i==null?void 0:i.group)===e){c=i;break}o=o.parentElement}return G.set(n,{element:n,callback:t,group:e,parent:c}),()=>{G.delete(n)}}const pe=new WeakMap;let ee=null;const te="none !important";function j(n){const t=n.style.getPropertyValue("display");return n.style.getPropertyPriority("display")?`${t} !important`:t}function lt(){return ee||(ee=new MutationObserver(n=>{for(const t of n){const e=t.target,o=pe.get(e);if(!o)continue;const c=j(e);c!==o.accounted&&(o.accounted=c,c===te?(o.reactHidden=!0,o.onHide()):c!=="none"&&o.reactHidden&&(o.reactHidden=!1,o.onShow()))}}),ee)}function ct(n,t){const e=j(n),o={accounted:e,reactHidden:e===te,onHide:t.onHide,onShow:t.onShow};return pe.set(n,o),lt().observe(n,{attributes:!0,attributeFilter:["style"]}),{get isHidden(){return j(n)===te},setDisplay(c,i=!1){c===null?n.style.removeProperty("display"):n.style.setProperty("display",c,i?"important":""),o.accounted=j(n)},sync(){o.accounted=j(n),o.reactHidden=o.accounted===te},stop(){pe.delete(n)}}}function at(n,t={}){const{transitions:e=[],middleware:o=(r,l)=>({from:r,to:l})}=n,c=t.host??new _e,i={},p=nt({keepCurrent:({current:r,next:l})=>r.element.contains(l.element)}),s=tt(),y=typeof e=="function"?e:()=>e,u=Ze();u.initialize();const m=new Map,h=r=>{let l=m.get(r);return l===void 0&&(l=o(r,r).from,m.set(r,l)),l},{initializeContext:P,calculateScrollOffset:O,evictScrollPosition:L,getScrollContainer:z,getPositionedParentElement:X,getScrollPosition:v,getIsMobile:f}=Ye({resolvePath:h}),g=new Map,S=()=>{const r=f();let l=g.get(r);return l||(l=y({isMobile:r}),g.set(r,l)),l},A=new WeakMap,D=r=>{A.set(r,{parent:r.parentNode,nextSibling:r.nextSibling})},b=r=>{const l=A.get(r);return l||{parent:r.parentNode,nextSibling:r.nextSibling}},w=new WeakMap,x=new WeakMap;let M=0;const N=r=>{const l=typeof getComputedStyle<"u"?getComputedStyle(r).display:"";return l&&l!=="none"?l:"block"},R=(r,l)=>{l.visibleDisplay=r.style.getPropertyValue("display"),l.computedDisplay=N(r)},_=(r,l)=>{if(x.get(r)!==l)return;x.delete(r);const a=w.get(r);a&&(a.savedCss!==null&&(r.style.cssText=a.savedCss,a.savedCss=null),a.intent==="hidden"?a.vis.setDisplay("none",!0):a.visibleDisplay?(a.vis.setDisplay(a.visibleDisplay,!1),R(r,a)):(a.vis.setDisplay(null),R(r,a)))},W=(r,l)=>{if(r.mode!=="hidden")return;const a=Array.from(new Set([r.element,l==null?void 0:l.element].filter(Boolean))),T=++M;for(const d of a)x.set(d,T);c.complete();for(const d of a)_(d,T)},K=(r,l,a,T,d,E,k)=>{const C=d.element,H=E.element,F=(d.mode??"unmount")==="hidden",{parent:q,nextSibling:U}=d.parent?{parent:d.parent,nextSibling:d.nextSibling}:b(C),Z=O(a,T,k.to),ie={direction:l,scrollOffset:Z,from:{scroll:v(a)},to:{scroll:v(T,k.to)},get scrollingElement(){return z()||document.documentElement},get positionedParent(){return X()}};let I;if(F){I=C,I.style.top=`${-1*((Z==null?void 0:Z.y)??0)}px`;const $=w.get(H);$&&$.savedCss===null&&($.savedCss=H.style.cssText)}else I=C,Xe(I,ie);k.from||L(a);const J=F?++M:0;F&&(x.set(H,J),x.set(C,J));const ge=Promise.resolve(I),be=Promise.resolve(H),we=[],We={from:ge,to:be,context:ie,createElement:(($,se="div")=>{const V=document.createElement(se);return V.setAttribute("data-ssgoi-id",$),we.push(V),V})},Be=Promise.resolve(r.prepare?r.prepare(We):{});Ge({from:ge,to:be,extras:Be}).then(({from:$,to:se,extras:V})=>{!F&&q&&(U&&q.contains(U)?q.insertBefore(I,U):q.appendChild(I));const le=r.animation({from:$,to:se,context:ie,...V}),ce=le.onComplete;le.onComplete=()=>{ce==null||ce(),F?(_(C,J),_(H,J)):I.parentNode&&I.parentNode.removeChild(I);for(const ae of we)ae.parentNode&&ae.parentNode.removeChild(ae)},c.attach(le)})},B=(r,l,a)=>{const T=u.isSwipeBack();p.arrive(r,l,a).then(d=>{var H,re,F,q;if(l==="in"&&u.onPageEnter(),!d){l==="out"&&W(a);return}if(l!=="in")return;const{from:E,to:k}=o(d.from,d.to),C=s.resolve(d.from,d.to,U=>fe.resolveTransitionRule(E,k,S(),U));if(!C){(re=(H=d.in).applyScrollPolicy)==null||re.call(H,!1),L(d.from),W(d.out,d.in);return}if((q=(F=d.in).applyScrollPolicy)==null||q.call(F,C.preserveScroll.to),T){C.preserveScroll.from||L(d.from),W(d.out,d.in);return}K(C.transition,C.direction,d.from,d.to,d.out,d.in,C.preserveScroll)})},he=(r,l)=>{const a=w.get(r);if(!a)return;const T=a.intent==="hidden";if(a.intent="hidden",a.savedCss===null&&(a.savedCss=r.style.cssText),a.vis.setDisplay(a.computedDisplay||"block",!0),r.style.position="absolute",r.style.width="100%",r.style.left="0",T)return;const d=b(r),E={element:r,parent:d.parent,nextSibling:d.nextSibling,mode:"hidden"},k=a.pendingOutPath??a.currentPath??l;a.pendingOutPath=null,B(k,"out",E)},He=(r,l)=>{const a=w.get(r);if(!a||a.intent==="visible")return;a.intent="visible",a.currentPath=r.getAttribute("data-ssgoi-transition")??a.currentPath??l,a.pendingOutPath=null,a.pathRevision++,R(r,a),a.savedCss!==null&&(r.style.cssText=a.savedCss,a.visibleDisplay?a.vis.setDisplay(a.visibleDisplay,!1):a.vis.setDisplay(null));const T=a.currentPath,d=P(r,T),E={element:r,parent:r.parentElement,nextSibling:r.nextElementSibling,applyScrollPolicy:d};B(T,"in",E)},Ie=(r,l,a,T=!0)=>{const d=w.get(r),E=(d==null?void 0:d.pendingOutPath)??(d==null?void 0:d.currentPath)??l;if(d&&(d.vis.stop(),w.delete(r),x.delete(r),d.intent==="hidden")){p.cancel(H=>H.element===r);return}if(!T)return;const k=a??b(r),C={element:r,parent:k.parent,nextSibling:k.nextSibling,mode:"unmount"};B(E,"out",C)},ye=new WeakSet,me=(r,l,{enter:a=!0}={})=>{if(s.connect(),ye.has(l)){const E=w.get(l);if(E&&E.currentPath!==r){E.intent==="visible"&&E.pendingOutPath===null&&(E.pendingOutPath=E.currentPath),E.currentPath=r;const k=++E.pathRevision;queueMicrotask(()=>{E.pathRevision===k&&(E.pendingOutPath=null)})}return}ye.add(l),D(l);const T=ct(l,{onHide:()=>he(l,r),onShow:()=>He(l,r)}),d={vis:T,savedCss:null,intent:T.isHidden?"hidden":"visible",visibleDisplay:"",computedDisplay:"block",currentPath:r,pendingOutPath:null,pathRevision:0};if(w.set(l,d),!T.isHidden&&(R(l,d),a)){const E=P(l,r),k={element:l,parent:l.parentElement,nextSibling:l.nextElementSibling,applyScrollPolicy:E};B(r,"in",k)}st(l,(E,k)=>Ie(l,r,E,(k==null?void 0:k.emit)??!0),i)},ve=new Map;return{register:me,refFor:r=>{let l=ve.get(r);return l||(l=a=>{a&&me(r,a)},ve.set(r,l)),l},disconnect:s.dispose}}const Ne="data-ssgoi-root",ut=`[${Ne}]`,ne="data-ssgoi-transition",Me=`[${ne}]`,dt="[data-ssgoi-clone]";function ft(){return typeof MutationObserver<"u"&&typeof HTMLElement<"u"&&typeof Node<"u"}function pt(n){return n.nodeType===Node.ELEMENT_NODE}function ht(n){return n instanceof HTMLElement}function Oe(n){let t=0,e=n.parentElement;for(;e;)t++,e=e.parentElement;return t}function Ce(n,t,e=n){const o=Array.from(n).sort((c,i)=>Oe(c)-Oe(i));for(const c of o){const i=c.getAttribute(ne);if(i===null)continue;let p=c.parentElement,s=!1;for(;p;){if(e.has(p)){s=!0;break}p=p.parentElement}t.register(i,c,{enter:!s})}}function yt(n,t){if(!ft())return()=>{};n.setAttribute(Ne,"");const e=s=>s.closest(ut)===n,o=s=>!ht(s)||!e(s)||s.closest(dt)||s.getAttribute(ne)===null?null:s,c=(s,y)=>{if(pt(s)){if(s.matches(Me)){const u=o(s);u&&y.add(u)}for(const u of s.querySelectorAll(Me)){const m=o(u);m&&y.add(m)}}},i=new MutationObserver(s=>{const y=new Set,u=new Set;for(const m of s){if(m.type==="attributes"){const h=o(m.target);h&&y.add(h);continue}for(const h of m.addedNodes)c(h,u)}for(const m of u)y.add(m);Ce(y,t,u)});i.observe(n,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[ne]});const p=new Set;return c(n,p),Ce(p,t),()=>{var s;i.disconnect(),(s=t.disconnect)==null||s.call(t)}}exports.Animation=oe.Animation;exports.MultiAnimation=oe.MultiAnimation;exports.WebAnimation=oe.WebAnimation;exports.HostAnimation=_e;exports.createSggoiTransitionContext=at;exports.observeSsgoiTransitions=yt;
package/dist/internal.js CHANGED
@@ -15,18 +15,18 @@ class Xe extends ze {
15
15
  attach(e) {
16
16
  const o = this.child;
17
17
  if (this.child = e, this._settled = !1, o) {
18
- const d = o.getPose();
19
- o.complete(), e.matchInto(d);
18
+ const p = o.getPose();
19
+ o.complete(), e.matchInto(p);
20
20
  }
21
21
  e.playbackRate = this.playbackRate;
22
- const a = e.onComplete;
22
+ const c = e.onComplete;
23
23
  e.onComplete = () => {
24
- a == null || a(), this.child === e && (this.child = null, this._state = "idle", this._settled = !0), this.notify();
24
+ c == null || c(), this.child === e && (this.child = null, this._state = "idle", this._settled = !0), this.notify();
25
25
  };
26
26
  const s = e.onUpdate;
27
- e.onUpdate = (d) => {
27
+ e.onUpdate = (p) => {
28
28
  var i;
29
- s == null || s(d), (i = this.onUpdate) == null || i.call(this, d), this.notify();
29
+ s == null || s(p), (i = this.onUpdate) == null || i.call(this, p), this.notify();
30
30
  }, this._state === "paused" ? e.pause() : this._state === "reversing" ? e.reverse() : (this._state = "playing", e.play()), this.notify();
31
31
  }
32
32
  play() {
@@ -125,172 +125,172 @@ function Ke(n) {
125
125
  const t = Object.keys(n);
126
126
  return Promise.all(t.map((e) => n[e])).then((e) => {
127
127
  const o = {};
128
- return t.forEach((a, s) => {
129
- o[a] = e[s];
128
+ return t.forEach((c, s) => {
129
+ o[c] = e[s];
130
130
  }), o;
131
131
  });
132
132
  }
133
133
  const Ue = 768, Ve = 10, Ye = 10;
134
134
  function je(n = {}) {
135
- const { resolvePath: t = (m) => m } = n;
136
- let e = null, o = !1, a = !1;
135
+ const { resolvePath: t = (b) => b } = n;
136
+ let e = null, o = !1, c = !1;
137
137
  const s = () => {
138
- const m = (e == null ? void 0 : e.clientWidth) ?? 0, g = m > 0 ? m : typeof window < "u" ? window.innerWidth : 0;
139
- return g > 0 && g < Ue;
140
- }, d = () => (a || (o = s(), a = !0), o), i = (m) => `path:${t(m)}`;
141
- let p = null;
138
+ const b = (e == null ? void 0 : e.clientWidth) ?? 0, w = b > 0 ? b : typeof window < "u" ? window.innerWidth : 0;
139
+ return w > 0 && w < Ue;
140
+ }, p = () => (c || (o = s(), c = !0), o), i = (b) => `path:${t(b)}`;
141
+ let y = null;
142
142
  const u = /* @__PURE__ */ new Map();
143
- let y = null, h = !1, S = 0, v = 0, E = 0;
144
- const N = () => {
145
- e && y && !h && u.set(i(y), {
143
+ let m = null, h = !1, P = 0, C = 0, L = 0;
144
+ const z = () => {
145
+ e && m && !h && u.set(i(m), {
146
146
  x: e.scrollLeft,
147
147
  y: e.scrollTop
148
148
  });
149
- }, _ = (m, g, R) => {
149
+ }, X = (b, w, x) => {
150
150
  if (!e) return;
151
- const O = ++v, D = i(m), M = g && u.has(D) ? u.get(D) : { x: 0, y: 0 };
152
- let L = 0;
151
+ const O = ++C, N = i(b), R = w && u.has(N) ? u.get(N) : { x: 0, y: 0 };
152
+ let _ = 0;
153
153
  const W = () => {
154
- if (!e || R !== S || O !== v)
154
+ if (!e || x !== P || O !== C)
155
155
  return;
156
- g || u.set(D, M), e.scrollTo({
157
- top: M.y,
158
- left: M.x
159
- }), !(Math.abs(e.scrollTop - M.y) < 1 && Math.abs(e.scrollLeft - M.x) < 1) && L < Ve && (L++, requestAnimationFrame(W));
156
+ w || u.set(N, R), e.scrollTo({
157
+ top: R.y,
158
+ left: R.x
159
+ }), !(Math.abs(e.scrollTop - R.y) < 1 && Math.abs(e.scrollLeft - R.x) < 1) && _ < Ve && (_++, requestAnimationFrame(W));
160
160
  };
161
161
  requestAnimationFrame(W);
162
162
  };
163
163
  return {
164
- initializeContext: (m, g, R) => {
164
+ initializeContext: (b, w, x) => {
165
165
  h = !0;
166
- const O = y === g ? S : ++S;
167
- p = m, e || (e = qe(m), o = s(), a = !0, typeof ResizeObserver < "u" && new ResizeObserver(() => {
166
+ const O = m === w ? P : ++P;
167
+ y = b, e || (e = qe(b), o = s(), c = !0, typeof ResizeObserver < "u" && new ResizeObserver(() => {
168
168
  o = s();
169
- }).observe(e), (e === document.documentElement ? window : e).addEventListener("scroll", N, {
169
+ }).observe(e), (e === document.documentElement ? window : e).addEventListener("scroll", z, {
170
170
  passive: !0
171
- })), y = g;
172
- const D = i(g), M = u.get(D), L = (F) => {
173
- O === S && (E = O, F && M && u.set(D, M), _(g, F, O));
171
+ })), m = w;
172
+ const N = i(w), R = u.get(N), _ = (B) => {
173
+ O === P && (L = O, B && R && u.set(N, R), X(w, B, O));
174
174
  };
175
- R !== void 0 ? L(R) : requestAnimationFrame(() => {
176
- E !== O && O === S && L(!1);
175
+ x !== void 0 ? _(x) : requestAnimationFrame(() => {
176
+ L !== O && O === P && _(!1);
177
177
  });
178
178
  let W = 0;
179
179
  const K = () => {
180
- O === S && (W++, W >= Ye ? h = !1 : requestAnimationFrame(K));
180
+ O === P && (W++, W >= Ye ? h = !1 : requestAnimationFrame(K));
181
181
  };
182
- return requestAnimationFrame(K), L;
182
+ return requestAnimationFrame(K), _;
183
183
  },
184
- calculateScrollOffset: (m, g, R = !1) => {
185
- const O = m ? i(m) : null, D = O && u.has(O) ? u.get(O) : { x: 0, y: 0 }, M = g && R ? i(g) : null, L = M && u.has(M) ? u.get(M) : { x: 0, y: 0 };
184
+ calculateScrollOffset: (b, w, x = !1) => {
185
+ const O = b ? i(b) : null, N = O && u.has(O) ? u.get(O) : { x: 0, y: 0 }, R = w && x ? i(w) : null, _ = R && u.has(R) ? u.get(R) : { x: 0, y: 0 };
186
186
  return {
187
- x: -L.x + D.x,
188
- y: -L.y + D.y
187
+ x: -_.x + N.x,
188
+ y: -_.y + N.y
189
189
  };
190
190
  },
191
- evictScrollPosition: (m) => {
192
- u.delete(i(m));
191
+ evictScrollPosition: (b) => {
192
+ u.delete(i(b));
193
193
  },
194
194
  getScrollContainer: () => e,
195
- getPositionedParentElement: () => p ? Ge(p) : document.body,
196
- getScrollPosition: (m, g = !0) => {
197
- if (!g) return { x: 0, y: 0 };
198
- const R = m ? i(m) : null;
199
- return R && u.has(R) ? u.get(R) : { x: 0, y: 0 };
195
+ getPositionedParentElement: () => y ? Ge(y) : document.body,
196
+ getScrollPosition: (b, w = !0) => {
197
+ if (!w) return { x: 0, y: 0 };
198
+ const x = b ? i(b) : null;
199
+ return x && u.has(x) ? u.get(x) : { x: 0, y: 0 };
200
200
  },
201
201
  // Exposed so a functional `transitions` config can branch on device class.
202
- getIsMobile: d
202
+ getIsMobile: p
203
203
  };
204
204
  }
205
205
  const Ee = 30, Se = 8, Pe = 1.2, Te = 30, Ze = 600;
206
206
  function Je() {
207
- let n = null, t = !1, e = !1, o = null, a = null, s = !1;
208
- const d = (b, P) => {
209
- for (let x = 0; x < b.length; x++) {
210
- const C = b.item(x);
211
- if (C && C.identifier === P) return C;
207
+ let n = null, t = !1, e = !1, o = null, c = null, s = !1;
208
+ const p = (f, g) => {
209
+ for (let E = 0; E < f.length; E++) {
210
+ const M = f.item(E);
211
+ if (M && M.identifier === g) return M;
212
212
  }
213
213
  return null;
214
214
  }, i = () => {
215
215
  o !== null && (clearTimeout(o), o = null);
216
- }, p = () => {
217
- a !== null && (clearTimeout(a), a = null);
216
+ }, y = () => {
217
+ c !== null && (clearTimeout(c), c = null);
218
218
  }, u = () => {
219
- t = !0, e = !0, i(), p(), o = setTimeout(() => {
219
+ t = !0, e = !0, i(), y(), o = setTimeout(() => {
220
220
  t = !1, e = !1, o = null;
221
221
  }, Ze);
222
- }, y = (b) => {
223
- if (b.touches.length !== 1) {
222
+ }, m = (f) => {
223
+ if (f.touches.length !== 1) {
224
224
  n = null;
225
225
  return;
226
226
  }
227
- const P = b.touches.item(0);
228
- if (!P) {
227
+ const g = f.touches.item(0);
228
+ if (!g) {
229
229
  n = null;
230
230
  return;
231
231
  }
232
- const x = window.innerWidth, C = P.clientX <= Ee, B = P.clientX >= x - Ee;
233
- if (!C && !B) {
232
+ const E = window.innerWidth, M = g.clientX <= Ee, D = g.clientX >= E - Ee;
233
+ if (!M && !D) {
234
234
  n = null;
235
235
  return;
236
236
  }
237
237
  n = {
238
- identifier: P.identifier,
239
- startX: P.clientX,
240
- startY: P.clientY,
241
- fromLeftEdge: C,
238
+ identifier: g.identifier,
239
+ startX: g.clientX,
240
+ startY: g.clientY,
241
+ fromLeftEdge: M,
242
242
  moved: !1
243
243
  };
244
- }, h = (b) => {
244
+ }, h = (f) => {
245
245
  if (!n) return;
246
- if (b.touches.length !== 1) {
246
+ if (f.touches.length !== 1) {
247
247
  n = null;
248
248
  return;
249
249
  }
250
- const P = d(b.touches, n.identifier);
251
- if (!P) {
250
+ const g = p(f.touches, n.identifier);
251
+ if (!g) {
252
252
  n = null;
253
253
  return;
254
254
  }
255
- const x = P.clientX - n.startX, C = P.clientY - n.startY, B = Math.abs(x), m = Math.abs(C);
256
- if (m > Se && m > B * Pe) {
255
+ const E = g.clientX - n.startX, M = g.clientY - n.startY, D = Math.abs(E), b = Math.abs(M);
256
+ if (b > Se && b > D * Pe) {
257
257
  n = null;
258
258
  return;
259
259
  }
260
- const g = n.fromLeftEdge ? x > 0 : x < 0;
261
- B > Se && B > m * Pe && g && (n.moved = !0);
262
- }, S = (b) => {
260
+ const w = n.fromLeftEdge ? E > 0 : E < 0;
261
+ D > Se && D > b * Pe && w && (n.moved = !0);
262
+ }, P = (f) => {
263
263
  if (!n) return;
264
- const P = d(b.changedTouches, n.identifier);
265
- if (!P) {
264
+ const g = p(f.changedTouches, n.identifier);
265
+ if (!g) {
266
266
  n = null;
267
267
  return;
268
268
  }
269
- const x = P.clientX - n.startX, C = n.fromLeftEdge ? x > 0 : x < 0;
270
- if (n.moved && C && Math.abs(x) >= Te) {
269
+ const E = g.clientX - n.startX, M = n.fromLeftEdge ? E > 0 : E < 0;
270
+ if (n.moved && M && Math.abs(E) >= Te) {
271
271
  u(), n = null;
272
272
  return;
273
273
  }
274
- n.moved && Math.abs(x) >= Te && u(), n = null;
275
- }, v = () => {
274
+ n.moved && Math.abs(E) >= Te && u(), n = null;
275
+ }, C = () => {
276
276
  n && (n.moved && u(), n = null);
277
277
  };
278
278
  return { initialize: () => {
279
279
  if (typeof window > "u" || s) return;
280
280
  s = !0;
281
- const b = { passive: !0, capture: !0 };
282
- window.addEventListener("touchstart", y, b), window.addEventListener("touchmove", h, b), window.addEventListener("touchend", S, b), window.addEventListener("touchcancel", v, b);
281
+ const f = { passive: !0, capture: !0 };
282
+ window.addEventListener("touchstart", m, f), window.addEventListener("touchmove", h, f), window.addEventListener("touchend", P, f), window.addEventListener("touchcancel", C, f);
283
283
  }, destroy: () => {
284
284
  if (typeof window > "u" || !s) return;
285
285
  s = !1;
286
- const b = { capture: !0 };
287
- window.removeEventListener("touchstart", y, b), window.removeEventListener("touchmove", h, b), window.removeEventListener("touchend", S, b), window.removeEventListener("touchcancel", v, b), i(), p(), n = null, t = !1, e = !1;
286
+ const f = { capture: !0 };
287
+ window.removeEventListener("touchstart", m, f), window.removeEventListener("touchmove", h, f), window.removeEventListener("touchend", P, f), window.removeEventListener("touchcancel", C, f), i(), y(), n = null, t = !1, e = !1;
288
288
  }, isSwipeBack: () => {
289
- const b = t || e;
290
- return b && i(), b;
289
+ const f = t || e;
290
+ return f && i(), f;
291
291
  }, onPageEnter: () => {
292
- t = !1, i(), p(), a = setTimeout(() => {
293
- e = !1, a = null;
292
+ t = !1, i(), y(), c = setTimeout(() => {
293
+ e = !1, c = null;
294
294
  }, 0);
295
295
  } };
296
296
  }
@@ -301,32 +301,17 @@ const ke = "__ssgoi_entry_v1", ae = /* @__PURE__ */ new WeakMap(), Ae = {
301
301
  }
302
302
  };
303
303
  function Qe() {
304
- var s;
305
304
  if (typeof window > "u") return Ae;
306
- const n = window.navigation;
307
- if ((s = n == null ? void 0 : n.currentEntry) != null && s.key && n.currentEntry.index >= 0)
308
- return {
309
- read: () => xe(n.currentEntry),
310
- previous: () => {
311
- var i;
312
- const d = (i = n.currentEntry) == null ? void 0 : i.index;
313
- return xe(
314
- n.entries().find((p) => p.index === (d ?? 0) - 1)
315
- );
316
- },
317
- dispose() {
318
- }
319
- };
320
- const t = window;
305
+ const n = window.navigation, t = window;
321
306
  let e = ae.get(t);
322
- e || (e = et(t), ae.set(t, e)), e.users++;
307
+ e || (e = et(t, n), ae.set(t, e)), e.users++;
323
308
  const o = e;
324
- let a = !1;
309
+ let c = !1;
325
310
  return {
326
311
  read: o.read,
327
312
  previous: o.previous,
328
313
  dispose() {
329
- a || (a = !0, --o.users === 0 && (o.dispose(), ae.delete(t)));
314
+ c || (c = !0, --o.users === 0 && (o.dispose(), ae.delete(t)));
330
315
  }
331
316
  };
332
317
  }
@@ -336,37 +321,53 @@ function xe(n) {
336
321
  function ue(n) {
337
322
  return n !== null && typeof n == "object" && Object.getPrototypeOf(n) === Object.prototype;
338
323
  }
339
- function et(n) {
340
- const t = n.history, e = t.pushState, o = t.replaceState, a = `${Date.now()}-${Math.random().toString(36).slice(2)}-`;
341
- let s = 0, d = !0, i = null;
342
- const p = () => {
343
- const v = t.state, E = ue(v) ? v[ke] : null;
344
- return !ue(E) || typeof E.key != "string" || !E.key.startsWith(a) || !Number.isSafeInteger(E.index) ? null : {
345
- key: E.key,
346
- index: E.index,
324
+ function et(n, t) {
325
+ var X;
326
+ const e = n.history, o = e.pushState, c = e.replaceState, s = `${Date.now()}-${Math.random().toString(36).slice(2)}-`;
327
+ let p = 0, i = !0, y = null, u = null;
328
+ const m = () => {
329
+ const v = xe(t == null ? void 0 : t.currentEntry);
330
+ return (v == null ? void 0 : v.url) === n.location.href ? v : null;
331
+ }, h = () => {
332
+ const v = e.state, f = ue(v) ? v[ke] : null;
333
+ return !ue(f) || typeof f.key != "string" || !f.key.startsWith(s) || !Number.isSafeInteger(f.index) ? m() : {
334
+ key: f.key,
335
+ index: f.index,
347
336
  url: n.location.href
348
337
  };
349
- }, u = (v, E) => v !== null && !ue(v) ? v : { ...v, [ke]: E }, y = (v) => ({ key: `${a}${++s}`, index: v });
338
+ }, P = (v, f) => v !== null && !ue(v) ? v : { ...v, [ke]: f }, C = (v) => ({ key: `${s}${++p}`, index: v });
350
339
  try {
351
- o.call(t, u(t.state, y(0)), "");
340
+ c.call(
341
+ e,
342
+ P(e.state, C(((X = m()) == null ? void 0 : X.index) ?? 0)),
343
+ ""
344
+ );
352
345
  } catch {
353
- return { ...Ae, users: 0 };
346
+ return { ...Ae, read: m, users: 0 };
354
347
  }
355
- const h = function(v, E, N) {
356
- if (!d) return e.call(this, v, E, N);
357
- const _ = p(), q = y(((_ == null ? void 0 : _.index) ?? 0) + 1);
358
- e.call(this, u(v, q), E, N), i = _;
359
- }, S = function(v, E, N) {
360
- if (!d) return o.call(this, v, E, N);
361
- const _ = p();
362
- o.call(this, u(v, _ ?? y(0)), E, N);
348
+ const L = function(v, f, g) {
349
+ var D;
350
+ if (!i) return o.call(this, v, f, g);
351
+ const E = h(), M = C(((E == null ? void 0 : E.index) ?? 0) + 1);
352
+ o.call(this, P(v, M), f, g), y = E, u = ((D = h()) == null ? void 0 : D.key) ?? null;
353
+ }, z = function(v, f, g) {
354
+ if (!i) return c.call(this, v, f, g);
355
+ const E = h();
356
+ c.call(this, P(v, E ?? C(0)), f, g);
363
357
  };
364
- return t.pushState = h, t.replaceState = S, {
358
+ return e.pushState = L, e.replaceState = z, {
365
359
  users: 0,
366
- read: p,
367
- previous: () => i,
360
+ read: h,
361
+ previous: () => {
362
+ var f;
363
+ if (((f = h()) == null ? void 0 : f.key) === u) return y;
364
+ const v = m();
365
+ return v ? xe(
366
+ t == null ? void 0 : t.entries().find((g) => g.index === v.index - 1)
367
+ ) : null;
368
+ },
368
369
  dispose() {
369
- d = !1, t.pushState === h && (t.pushState = e), t.replaceState === S && (t.replaceState = o);
370
+ i = !1, e.pushState === L && (e.pushState = o), e.replaceState === z && (e.replaceState = c);
370
371
  }
371
372
  };
372
373
  }
@@ -374,23 +375,23 @@ function tt() {
374
375
  let n = null, t = null;
375
376
  const e = /* @__PURE__ */ new Set(), o = (s) => {
376
377
  s && e.add(s.key), e.size > 200 && e.delete(e.values().next().value);
377
- }, a = () => {
378
+ }, c = () => {
378
379
  n || (n = Qe(), t = n.read(), o(t));
379
380
  };
380
381
  return {
381
- connect: a,
382
- resolve(s, d) {
383
- a();
382
+ connect: c,
383
+ resolve(s, p) {
384
+ c();
384
385
  const i = n.read();
385
- let p = t, u = "unknown";
386
- if (p && i && (i.key === p.key || i.index === p.index ? u = "replace" : i.index < p.index ? u = "back" : u = e.has(i.key) ? "forward" : "push"), u === "push") {
387
- const y = n.previous();
388
- y && y.index === i.index - 1 && be(new URL(y.url).pathname) === be(s) && (p = y);
386
+ let y = t, u = "unknown";
387
+ if (y && i && (i.key === y.key || i.index === y.index ? u = "replace" : i.index < y.index ? u = "back" : u = e.has(i.key) ? "forward" : "push"), u === "push") {
388
+ const m = n.previous();
389
+ m && m.index === i.index - 1 && be(new URL(m.url).pathname) === be(s) && (y = m);
389
390
  }
390
- return t = i, o(p), o(i), {
391
+ return t = i, o(y), o(i), {
391
392
  kind: u,
392
393
  direction: u === "back" ? "backward" : "forward",
393
- from: p,
394
+ from: y,
394
395
  to: i
395
396
  };
396
397
  },
@@ -403,11 +404,11 @@ function nt() {
403
404
  const n = tt(), t = /* @__PURE__ */ new Map();
404
405
  return {
405
406
  connect: n.connect,
406
- resolve(e, o, a) {
407
- var u, y;
408
- const s = n.resolve(e, o), d = (u = s.from) == null ? void 0 : u.key, i = (y = s.to) == null ? void 0 : y.key;
409
- if (s.kind === "back" && d && i) {
410
- const h = t.get(d);
407
+ resolve(e, o, c) {
408
+ var u, m;
409
+ const s = n.resolve(e, o), p = (u = s.from) == null ? void 0 : u.key, i = (m = s.to) == null ? void 0 : m.key;
410
+ if (s.kind === "back" && p && i) {
411
+ const h = t.get(p);
411
412
  if ((h == null ? void 0 : h.source) === i && h.from === o && h.to === e)
412
413
  return h.rule ? {
413
414
  ...h.rule,
@@ -418,24 +419,24 @@ function nt() {
418
419
  }
419
420
  } : null;
420
421
  }
421
- if (s.kind === "forward" && d && i) {
422
+ if (s.kind === "forward" && p && i) {
422
423
  const h = t.get(i);
423
- if ((h == null ? void 0 : h.source) === d && h.from === e && h.to === o)
424
+ if ((h == null ? void 0 : h.source) === p && h.from === e && h.to === o)
424
425
  return h.rule;
425
426
  }
426
- const p = a(s.direction);
427
- if (i && s.kind === "replace" && t.delete(i), i && d && s.kind === "push") {
428
- for (const [h, S] of t)
429
- S.index >= s.to.index && t.delete(h);
427
+ const y = c(s.direction);
428
+ if (i && s.kind === "replace" && t.delete(i), i && p && s.kind === "push") {
429
+ for (const [h, P] of t)
430
+ P.index >= s.to.index && t.delete(h);
430
431
  t.set(i, {
431
- source: d,
432
+ source: p,
432
433
  index: s.to.index,
433
434
  from: e,
434
435
  to: o,
435
- rule: p ? { ...p, preserveScroll: { ...p.preserveScroll } } : null
436
+ rule: y ? { ...y, preserveScroll: { ...y.preserveScroll } } : null
436
437
  }), t.size > 100 && t.delete(t.keys().next().value);
437
438
  }
438
- return p;
439
+ return y;
439
440
  },
440
441
  dispose() {
441
442
  n.dispose(), t.clear();
@@ -445,10 +446,10 @@ function nt() {
445
446
  function ot(n = {}) {
446
447
  let t = null, e = null;
447
448
  function o() {
448
- var s, d;
449
- t && ((s = t.out) == null || s.resolve(null), (d = t.in) == null || d.resolve(null), t = null);
449
+ var s, p;
450
+ t && ((s = t.out) == null || s.resolve(null), (p = t.in) == null || p.resolve(null), t = null);
450
451
  }
451
- function a() {
452
+ function c() {
452
453
  if (t != null && t.out && t.in) {
453
454
  if (t.out.path === t.in.path) {
454
455
  o();
@@ -464,31 +465,31 @@ function ot(n = {}) {
464
465
  }
465
466
  }
466
467
  return {
467
- arrive(s, d, i) {
468
- return new Promise((p) => {
469
- var S, v;
470
- const u = e === null ? null : d === "out" ? { path: e.from, payload: e.out } : { path: e.to, payload: e.in };
468
+ arrive(s, p, i) {
469
+ return new Promise((y) => {
470
+ var P, C;
471
+ const u = e === null ? null : p === "out" ? { path: e.from, payload: e.out } : { path: e.to, payload: e.in };
471
472
  if ((u == null ? void 0 : u.path) === s) {
472
- p(null);
473
+ y(null);
473
474
  return;
474
475
  }
475
- d === "out" && ((S = t == null ? void 0 : t.in) == null ? void 0 : S.path) === s && !t.out && (t.in.resolve(null), t.in = void 0);
476
- const y = t == null ? void 0 : t[d];
477
- y && y.path !== s && o(), t || (t = {});
478
- const h = t[d];
476
+ p === "out" && ((P = t == null ? void 0 : t.in) == null ? void 0 : P.path) === s && !t.out && (t.in.resolve(null), t.in = void 0);
477
+ const m = t == null ? void 0 : t[p];
478
+ m && m.path !== s && o(), t || (t = {});
479
+ const h = t[p];
479
480
  if (h) {
480
- if (((v = n.keepCurrent) == null ? void 0 : v.call(n, {
481
- type: d,
481
+ if (((C = n.keepCurrent) == null ? void 0 : C.call(n, {
482
+ type: p,
482
483
  path: s,
483
484
  current: h.payload,
484
485
  next: i
485
486
  })) ?? !1) {
486
- p(null);
487
+ y(null);
487
488
  return;
488
489
  }
489
490
  h.resolve(null);
490
491
  }
491
- t[d] = { path: s, payload: i, resolve: p }, a();
492
+ t[p] = { path: s, payload: i, resolve: y }, c();
492
493
  });
493
494
  },
494
495
  cancel(s) {
@@ -498,26 +499,26 @@ function ot(n = {}) {
498
499
  }
499
500
  const rt = {}, G = /* @__PURE__ */ new Map();
500
501
  let Q = null, Re = !1;
501
- function Le(n, t, e) {
502
+ function _e(n, t, e) {
502
503
  n instanceof HTMLElement && G.has(n) && !n.isConnected && e.set(n, { entry: G.get(n), anchor: t });
503
504
  for (const o of Array.from(n.childNodes))
504
- Le(o, t, e);
505
+ _e(o, t, e);
505
506
  }
506
507
  function st(n) {
507
508
  const t = new Set(
508
509
  Array.from(n.values(), ({ entry: e }) => e)
509
510
  );
510
- for (const [e, { entry: o, anchor: a }] of n) {
511
+ for (const [e, { entry: o, anchor: c }] of n) {
511
512
  G.delete(e);
512
- let s = o.parent, d = !1;
513
+ let s = o.parent, p = !1;
513
514
  for (; s; ) {
514
515
  if (s.group === o.group && t.has(s)) {
515
- d = !0;
516
+ p = !0;
516
517
  break;
517
518
  }
518
519
  s = s.parent;
519
520
  }
520
- queueMicrotask(() => o.callback(a, { emit: !d }));
521
+ queueMicrotask(() => o.callback(c, { emit: !p }));
521
522
  }
522
523
  }
523
524
  function it() {
@@ -525,12 +526,12 @@ function it() {
525
526
  Re = !0, Q = new MutationObserver((t) => {
526
527
  const e = /* @__PURE__ */ new Map();
527
528
  for (const o of t) {
528
- const a = {
529
+ const c = {
529
530
  parent: o.target,
530
531
  nextSibling: o.nextSibling
531
532
  };
532
533
  for (const s of Array.from(o.removedNodes))
533
- Le(s, a, e);
534
+ _e(s, c, e);
534
535
  }
535
536
  st(e);
536
537
  });
@@ -541,11 +542,11 @@ function it() {
541
542
  }
542
543
  function lt(n, t, e = rt) {
543
544
  it();
544
- let o = n.parentElement, a = null;
545
+ let o = n.parentElement, c = null;
545
546
  for (; o; ) {
546
547
  const s = G.get(o);
547
548
  if ((s == null ? void 0 : s.group) === e) {
548
- a = s;
549
+ c = s;
549
550
  break;
550
551
  }
551
552
  o = o.parentElement;
@@ -554,7 +555,7 @@ function lt(n, t, e = rt) {
554
555
  element: n,
555
556
  callback: t,
556
557
  group: e,
557
- parent: a
558
+ parent: c
558
559
  }), () => {
559
560
  G.delete(n);
560
561
  };
@@ -571,8 +572,8 @@ function ct() {
571
572
  for (const t of n) {
572
573
  const e = t.target, o = de.get(e);
573
574
  if (!o) continue;
574
- const a = j(e);
575
- a !== o.accounted && (o.accounted = a, a === te ? (o.reactHidden = !0, o.onHide()) : a !== "none" && o.reactHidden && (o.reactHidden = !1, o.onShow()));
575
+ const c = j(e);
576
+ c !== o.accounted && (o.accounted = c, c === te ? (o.reactHidden = !0, o.onHide()) : c !== "none" && o.reactHidden && (o.reactHidden = !1, o.onShow()));
576
577
  }
577
578
  }), ee);
578
579
  }
@@ -590,10 +591,10 @@ function at(n, t) {
590
591
  get isHidden() {
591
592
  return j(n) === te;
592
593
  },
593
- setDisplay(a, s = !1) {
594
- a === null ? n.style.removeProperty("display") : n.style.setProperty(
594
+ setDisplay(c, s = !1) {
595
+ c === null ? n.style.removeProperty("display") : n.style.setProperty(
595
596
  "display",
596
- a,
597
+ c,
597
598
  s ? "important" : ""
598
599
  ), o.accounted = j(n);
599
600
  },
@@ -606,211 +607,211 @@ function at(n, t) {
606
607
  };
607
608
  }
608
609
  function wt(n, t = {}) {
609
- const { transitions: e = [], middleware: o = (r, l) => ({ from: r, to: l }) } = n, a = t.host ?? new Xe(), s = {}, d = ot({
610
+ const { transitions: e = [], middleware: o = (r, l) => ({ from: r, to: l }) } = n, c = t.host ?? new Xe(), s = {}, p = ot({
610
611
  // Nested boundaries can be discovered in separate MutationObserver
611
612
  // batches (notably when Suspense reveals a child later). When the same
612
613
  // side/path repeats before pairing, the outermost DOM boundary owns it.
613
614
  keepCurrent: ({ current: r, next: l }) => r.element.contains(l.element)
614
- }), i = nt(), p = typeof e == "function" ? e : () => e, u = Je();
615
+ }), i = nt(), y = typeof e == "function" ? e : () => e, u = Je();
615
616
  u.initialize();
616
- const y = /* @__PURE__ */ new Map(), h = (r) => {
617
- let l = y.get(r);
618
- return l === void 0 && (l = o(r, r).from, y.set(r, l)), l;
617
+ const m = /* @__PURE__ */ new Map(), h = (r) => {
618
+ let l = m.get(r);
619
+ return l === void 0 && (l = o(r, r).from, m.set(r, l)), l;
619
620
  }, {
620
- initializeContext: S,
621
- calculateScrollOffset: v,
622
- evictScrollPosition: E,
623
- getScrollContainer: N,
624
- getPositionedParentElement: _,
625
- getScrollPosition: q,
626
- getIsMobile: b
627
- } = je({ resolvePath: h }), P = /* @__PURE__ */ new Map(), x = () => {
628
- const r = b();
629
- let l = P.get(r);
630
- return l || (l = p({ isMobile: r }), P.set(r, l)), l;
631
- }, C = /* @__PURE__ */ new WeakMap(), B = (r) => {
632
- C.set(r, {
621
+ initializeContext: P,
622
+ calculateScrollOffset: C,
623
+ evictScrollPosition: L,
624
+ getScrollContainer: z,
625
+ getPositionedParentElement: X,
626
+ getScrollPosition: v,
627
+ getIsMobile: f
628
+ } = je({ resolvePath: h }), g = /* @__PURE__ */ new Map(), E = () => {
629
+ const r = f();
630
+ let l = g.get(r);
631
+ return l || (l = y({ isMobile: r }), g.set(r, l)), l;
632
+ }, M = /* @__PURE__ */ new WeakMap(), D = (r) => {
633
+ M.set(r, {
633
634
  parent: r.parentNode,
634
635
  nextSibling: r.nextSibling
635
636
  });
636
- }, m = (r) => {
637
- const l = C.get(r);
637
+ }, b = (r) => {
638
+ const l = M.get(r);
638
639
  return l || {
639
640
  parent: r.parentNode,
640
641
  nextSibling: r.nextSibling
641
642
  };
642
- }, g = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakMap();
643
+ }, w = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap();
643
644
  let O = 0;
644
- const D = (r) => {
645
+ const N = (r) => {
645
646
  const l = typeof getComputedStyle < "u" ? getComputedStyle(r).display : "";
646
647
  return l && l !== "none" ? l : "block";
647
- }, M = (r, l) => {
648
- l.visibleDisplay = r.style.getPropertyValue("display"), l.computedDisplay = D(r);
649
- }, L = (r, l) => {
650
- if (R.get(r) !== l) return;
651
- R.delete(r);
652
- const c = g.get(r);
653
- c && (c.savedCss !== null && (r.style.cssText = c.savedCss, c.savedCss = null), c.intent === "hidden" ? c.vis.setDisplay("none", !0) : c.visibleDisplay ? (c.vis.setDisplay(c.visibleDisplay, !1), M(r, c)) : (c.vis.setDisplay(null), M(r, c)));
648
+ }, R = (r, l) => {
649
+ l.visibleDisplay = r.style.getPropertyValue("display"), l.computedDisplay = N(r);
650
+ }, _ = (r, l) => {
651
+ if (x.get(r) !== l) return;
652
+ x.delete(r);
653
+ const a = w.get(r);
654
+ a && (a.savedCss !== null && (r.style.cssText = a.savedCss, a.savedCss = null), a.intent === "hidden" ? a.vis.setDisplay("none", !0) : a.visibleDisplay ? (a.vis.setDisplay(a.visibleDisplay, !1), R(r, a)) : (a.vis.setDisplay(null), R(r, a)));
654
655
  }, W = (r, l) => {
655
656
  if (r.mode !== "hidden") return;
656
- const c = Array.from(
657
+ const a = Array.from(
657
658
  new Set([r.element, l == null ? void 0 : l.element].filter(Boolean))
658
659
  ), T = ++O;
659
- for (const f of c) R.set(f, T);
660
- a.complete();
661
- for (const f of c) L(f, T);
662
- }, K = (r, l, c, T, f, w, k) => {
663
- const A = f.element, H = w.element, z = (f.mode ?? "unmount") === "hidden", { parent: X, nextSibling: U } = f.parent ? { parent: f.parent, nextSibling: f.nextSibling } : m(A), Z = v(
664
- c,
660
+ for (const d of a) x.set(d, T);
661
+ c.complete();
662
+ for (const d of a) _(d, T);
663
+ }, K = (r, l, a, T, d, S, k) => {
664
+ const A = d.element, H = S.element, F = (d.mode ?? "unmount") === "hidden", { parent: $, nextSibling: U } = d.parent ? { parent: d.parent, nextSibling: d.nextSibling } : b(A), Z = C(
665
+ a,
665
666
  T,
666
667
  k.to
667
668
  ), re = {
668
669
  direction: l,
669
670
  scrollOffset: Z,
670
- from: { scroll: q(c) },
671
+ from: { scroll: v(a) },
671
672
  to: {
672
- scroll: q(T, k.to)
673
+ scroll: v(T, k.to)
673
674
  },
674
675
  get scrollingElement() {
675
- return N() || document.documentElement;
676
+ return z() || document.documentElement;
676
677
  },
677
678
  get positionedParent() {
678
- return _();
679
+ return X();
679
680
  }
680
681
  };
681
682
  let I;
682
- if (z) {
683
+ if (F) {
683
684
  I = A, I.style.top = `${-1 * ((Z == null ? void 0 : Z.y) ?? 0)}px`;
684
- const $ = g.get(H);
685
- $ && $.savedCss === null && ($.savedCss = H.style.cssText);
685
+ const q = w.get(H);
686
+ q && q.savedCss === null && (q.savedCss = H.style.cssText);
686
687
  } else
687
688
  I = A, $e(I, re);
688
- k.from || E(c);
689
- const J = z ? ++O : 0;
690
- z && (R.set(H, J), R.set(A, J));
691
- const me = Promise.resolve(I), ge = Promise.resolve(H), ve = [], He = {
689
+ k.from || L(a);
690
+ const J = F ? ++O : 0;
691
+ F && (x.set(H, J), x.set(A, J));
692
+ const me = Promise.resolve(I), ve = Promise.resolve(H), ge = [], He = {
692
693
  from: me,
693
- to: ge,
694
+ to: ve,
694
695
  context: re,
695
- createElement: (($, se = "div") => {
696
+ createElement: ((q, se = "div") => {
696
697
  const V = document.createElement(se);
697
- return V.setAttribute("data-ssgoi-id", $), ve.push(V), V;
698
+ return V.setAttribute("data-ssgoi-id", q), ge.push(V), V;
698
699
  })
699
700
  }, Ie = Promise.resolve(
700
701
  r.prepare ? r.prepare(He) : {}
701
702
  );
702
703
  Ke({
703
704
  from: me,
704
- to: ge,
705
+ to: ve,
705
706
  extras: Ie
706
- }).then(({ from: $, to: se, extras: V }) => {
707
- !z && X && (U && X.contains(U) ? X.insertBefore(I, U) : X.appendChild(I));
707
+ }).then(({ from: q, to: se, extras: V }) => {
708
+ !F && $ && (U && $.contains(U) ? $.insertBefore(I, U) : $.appendChild(I));
708
709
  const ie = r.animation({
709
- from: $,
710
+ from: q,
710
711
  to: se,
711
712
  context: re,
712
713
  ...V
713
714
  }), le = ie.onComplete;
714
715
  ie.onComplete = () => {
715
- le == null || le(), z ? (L(A, J), L(H, J)) : I.parentNode && I.parentNode.removeChild(I);
716
- for (const ce of ve)
716
+ le == null || le(), F ? (_(A, J), _(H, J)) : I.parentNode && I.parentNode.removeChild(I);
717
+ for (const ce of ge)
717
718
  ce.parentNode && ce.parentNode.removeChild(ce);
718
- }, a.attach(ie);
719
+ }, c.attach(ie);
719
720
  });
720
- }, F = (r, l, c) => {
721
+ }, B = (r, l, a) => {
721
722
  const T = u.isSwipeBack();
722
- d.arrive(r, l, c).then((f) => {
723
- var H, oe, z, X;
724
- if (l === "in" && u.onPageEnter(), !f) {
725
- l === "out" && W(c);
723
+ p.arrive(r, l, a).then((d) => {
724
+ var H, oe, F, $;
725
+ if (l === "in" && u.onPageEnter(), !d) {
726
+ l === "out" && W(a);
726
727
  return;
727
728
  }
728
729
  if (l !== "in") return;
729
- const { from: w, to: k } = o(
730
- f.from,
731
- f.to
730
+ const { from: S, to: k } = o(
731
+ d.from,
732
+ d.to
732
733
  ), A = i.resolve(
733
- f.from,
734
- f.to,
734
+ d.from,
735
+ d.to,
735
736
  (U) => Fe(
736
- w,
737
+ S,
737
738
  k,
738
- x(),
739
+ E(),
739
740
  U
740
741
  )
741
742
  );
742
743
  if (!A) {
743
- (oe = (H = f.in).applyScrollPolicy) == null || oe.call(H, !1), E(f.from), W(f.out, f.in);
744
+ (oe = (H = d.in).applyScrollPolicy) == null || oe.call(H, !1), L(d.from), W(d.out, d.in);
744
745
  return;
745
746
  }
746
- if ((X = (z = f.in).applyScrollPolicy) == null || X.call(z, A.preserveScroll.to), T) {
747
- A.preserveScroll.from || E(f.from), W(f.out, f.in);
747
+ if (($ = (F = d.in).applyScrollPolicy) == null || $.call(F, A.preserveScroll.to), T) {
748
+ A.preserveScroll.from || L(d.from), W(d.out, d.in);
748
749
  return;
749
750
  }
750
751
  K(
751
752
  A.transition,
752
753
  A.direction,
753
- f.from,
754
- f.to,
755
- f.out,
756
- f.in,
754
+ d.from,
755
+ d.to,
756
+ d.out,
757
+ d.in,
757
758
  A.preserveScroll
758
759
  );
759
760
  });
760
761
  }, fe = (r, l) => {
761
- const c = g.get(r);
762
- if (!c) return;
763
- const T = c.intent === "hidden";
764
- if (c.intent = "hidden", c.savedCss === null && (c.savedCss = r.style.cssText), c.vis.setDisplay(c.computedDisplay || "block", !0), r.style.position = "absolute", r.style.width = "100%", r.style.left = "0", T) return;
765
- const f = m(r), w = {
762
+ const a = w.get(r);
763
+ if (!a) return;
764
+ const T = a.intent === "hidden";
765
+ if (a.intent = "hidden", a.savedCss === null && (a.savedCss = r.style.cssText), a.vis.setDisplay(a.computedDisplay || "block", !0), r.style.position = "absolute", r.style.width = "100%", r.style.left = "0", T) return;
766
+ const d = b(r), S = {
766
767
  element: r,
767
- parent: f.parent,
768
- nextSibling: f.nextSibling,
768
+ parent: d.parent,
769
+ nextSibling: d.nextSibling,
769
770
  mode: "hidden"
770
- }, k = c.pendingOutPath ?? c.currentPath ?? l;
771
- c.pendingOutPath = null, F(k, "out", w);
771
+ }, k = a.pendingOutPath ?? a.currentPath ?? l;
772
+ a.pendingOutPath = null, B(k, "out", S);
772
773
  }, De = (r, l) => {
773
- const c = g.get(r);
774
- if (!c || c.intent === "visible") return;
775
- c.intent = "visible", c.currentPath = r.getAttribute("data-ssgoi-transition") ?? c.currentPath ?? l, c.pendingOutPath = null, c.pathRevision++, M(r, c), c.savedCss !== null && (r.style.cssText = c.savedCss, c.visibleDisplay ? c.vis.setDisplay(c.visibleDisplay, !1) : c.vis.setDisplay(null));
776
- const T = c.currentPath, f = S(r, T), w = {
774
+ const a = w.get(r);
775
+ if (!a || a.intent === "visible") return;
776
+ a.intent = "visible", a.currentPath = r.getAttribute("data-ssgoi-transition") ?? a.currentPath ?? l, a.pendingOutPath = null, a.pathRevision++, R(r, a), a.savedCss !== null && (r.style.cssText = a.savedCss, a.visibleDisplay ? a.vis.setDisplay(a.visibleDisplay, !1) : a.vis.setDisplay(null));
777
+ const T = a.currentPath, d = P(r, T), S = {
777
778
  element: r,
778
779
  parent: r.parentElement,
779
780
  nextSibling: r.nextElementSibling,
780
- applyScrollPolicy: f
781
+ applyScrollPolicy: d
781
782
  };
782
- F(T, "in", w);
783
- }, Ne = (r, l, c, T = !0) => {
784
- const f = g.get(r), w = (f == null ? void 0 : f.pendingOutPath) ?? (f == null ? void 0 : f.currentPath) ?? l;
785
- if (f && (f.vis.stop(), g.delete(r), R.delete(r), f.intent === "hidden")) {
786
- d.cancel((H) => H.element === r);
783
+ B(T, "in", S);
784
+ }, Ne = (r, l, a, T = !0) => {
785
+ const d = w.get(r), S = (d == null ? void 0 : d.pendingOutPath) ?? (d == null ? void 0 : d.currentPath) ?? l;
786
+ if (d && (d.vis.stop(), w.delete(r), x.delete(r), d.intent === "hidden")) {
787
+ p.cancel((H) => H.element === r);
787
788
  return;
788
789
  }
789
790
  if (!T) return;
790
- const k = c ?? m(r), A = {
791
+ const k = a ?? b(r), A = {
791
792
  element: r,
792
793
  parent: k.parent,
793
794
  nextSibling: k.nextSibling,
794
795
  mode: "unmount"
795
796
  };
796
- F(w, "out", A);
797
- }, pe = /* @__PURE__ */ new WeakSet(), he = (r, l, { enter: c = !0 } = {}) => {
797
+ B(S, "out", A);
798
+ }, pe = /* @__PURE__ */ new WeakSet(), he = (r, l, { enter: a = !0 } = {}) => {
798
799
  if (i.connect(), pe.has(l)) {
799
- const w = g.get(l);
800
- if (w && w.currentPath !== r) {
801
- w.intent === "visible" && w.pendingOutPath === null && (w.pendingOutPath = w.currentPath), w.currentPath = r;
802
- const k = ++w.pathRevision;
800
+ const S = w.get(l);
801
+ if (S && S.currentPath !== r) {
802
+ S.intent === "visible" && S.pendingOutPath === null && (S.pendingOutPath = S.currentPath), S.currentPath = r;
803
+ const k = ++S.pathRevision;
803
804
  queueMicrotask(() => {
804
- w.pathRevision === k && (w.pendingOutPath = null);
805
+ S.pathRevision === k && (S.pendingOutPath = null);
805
806
  });
806
807
  }
807
808
  return;
808
809
  }
809
- pe.add(l), B(l);
810
+ pe.add(l), D(l);
810
811
  const T = at(l, {
811
812
  onHide: () => fe(l, r),
812
813
  onShow: () => De(l, r)
813
- }), f = {
814
+ }), d = {
814
815
  vis: T,
815
816
  savedCss: null,
816
817
  intent: T.isHidden ? "hidden" : "visible",
@@ -820,29 +821,29 @@ function wt(n, t = {}) {
820
821
  pendingOutPath: null,
821
822
  pathRevision: 0
822
823
  };
823
- if (g.set(l, f), !T.isHidden && (M(l, f), c)) {
824
- const w = S(l, r), k = {
824
+ if (w.set(l, d), !T.isHidden && (R(l, d), a)) {
825
+ const S = P(l, r), k = {
825
826
  element: l,
826
827
  parent: l.parentElement,
827
828
  nextSibling: l.nextElementSibling,
828
- applyScrollPolicy: w
829
+ applyScrollPolicy: S
829
830
  };
830
- F(r, "in", k);
831
+ B(r, "in", k);
831
832
  }
832
833
  lt(
833
834
  l,
834
- (w, k) => Ne(l, r, w, (k == null ? void 0 : k.emit) ?? !0),
835
+ (S, k) => Ne(l, r, S, (k == null ? void 0 : k.emit) ?? !0),
835
836
  s
836
837
  );
837
838
  }, ye = /* @__PURE__ */ new Map();
838
839
  return { register: he, refFor: (r) => {
839
840
  let l = ye.get(r);
840
- return l || (l = (c) => {
841
- c && he(r, c);
841
+ return l || (l = (a) => {
842
+ a && he(r, a);
842
843
  }, ye.set(r, l)), l;
843
844
  }, disconnect: i.dispose };
844
845
  }
845
- const _e = "data-ssgoi-root", ut = `[${_e}]`, ne = "data-ssgoi-transition", Me = `[${ne}]`, dt = "[data-ssgoi-clone]";
846
+ const Le = "data-ssgoi-root", ut = `[${Le}]`, ne = "data-ssgoi-transition", Me = `[${ne}]`, dt = "[data-ssgoi-clone]";
846
847
  function ft() {
847
848
  return typeof MutationObserver < "u" && typeof HTMLElement < "u" && typeof Node < "u";
848
849
  }
@@ -860,50 +861,50 @@ function Oe(n) {
860
861
  }
861
862
  function Ce(n, t, e = n) {
862
863
  const o = Array.from(n).sort(
863
- (a, s) => Oe(a) - Oe(s)
864
+ (c, s) => Oe(c) - Oe(s)
864
865
  );
865
- for (const a of o) {
866
- const s = a.getAttribute(ne);
866
+ for (const c of o) {
867
+ const s = c.getAttribute(ne);
867
868
  if (s === null) continue;
868
- let d = a.parentElement, i = !1;
869
- for (; d; ) {
870
- if (e.has(d)) {
869
+ let p = c.parentElement, i = !1;
870
+ for (; p; ) {
871
+ if (e.has(p)) {
871
872
  i = !0;
872
873
  break;
873
874
  }
874
- d = d.parentElement;
875
+ p = p.parentElement;
875
876
  }
876
- t.register(s, a, { enter: !i });
877
+ t.register(s, c, { enter: !i });
877
878
  }
878
879
  }
879
880
  function Et(n, t) {
880
881
  if (!ft()) return () => {
881
882
  };
882
- n.setAttribute(_e, "");
883
- const e = (i) => i.closest(ut) === n, o = (i) => !ht(i) || !e(i) || i.closest(dt) || i.getAttribute(ne) === null ? null : i, a = (i, p) => {
883
+ n.setAttribute(Le, "");
884
+ const e = (i) => i.closest(ut) === n, o = (i) => !ht(i) || !e(i) || i.closest(dt) || i.getAttribute(ne) === null ? null : i, c = (i, y) => {
884
885
  if (pt(i)) {
885
886
  if (i.matches(Me)) {
886
887
  const u = o(i);
887
- u && p.add(u);
888
+ u && y.add(u);
888
889
  }
889
890
  for (const u of i.querySelectorAll(Me)) {
890
- const y = o(u);
891
- y && p.add(y);
891
+ const m = o(u);
892
+ m && y.add(m);
892
893
  }
893
894
  }
894
895
  }, s = new MutationObserver((i) => {
895
- const p = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set();
896
- for (const y of i) {
897
- if (y.type === "attributes") {
898
- const h = o(y.target);
899
- h && p.add(h);
896
+ const y = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set();
897
+ for (const m of i) {
898
+ if (m.type === "attributes") {
899
+ const h = o(m.target);
900
+ h && y.add(h);
900
901
  continue;
901
902
  }
902
- for (const h of y.addedNodes)
903
- a(h, u);
903
+ for (const h of m.addedNodes)
904
+ c(h, u);
904
905
  }
905
- for (const y of u) p.add(y);
906
- Ce(p, t, u);
906
+ for (const m of u) y.add(m);
907
+ Ce(y, t, u);
907
908
  });
908
909
  s.observe(n, {
909
910
  childList: !0,
@@ -911,8 +912,8 @@ function Et(n, t) {
911
912
  attributes: !0,
912
913
  attributeFilter: [ne]
913
914
  });
914
- const d = /* @__PURE__ */ new Set();
915
- return a(n, d), Ce(d, t), () => {
915
+ const p = /* @__PURE__ */ new Set();
916
+ return c(n, p), Ce(p, t), () => {
916
917
  var i;
917
918
  s.disconnect(), (i = t.disconnect) == null || i.call(t);
918
919
  };
@@ -1 +1 @@
1
- {"version":3,"file":"browser-history.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/browser-history.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAOvE,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,IAAI,YAAY,GAAG,IAAI,CAAC;IAC5B,QAAQ,IAAI,YAAY,GAAG,IAAI,CAAC;IAChC,OAAO,IAAI,IAAI,CAAC;CACjB,CAAC;AAWF,mFAAmF;AACnF,wBAAgB,qBAAqB,IAAI,cAAc,CAsCtD"}
1
+ {"version":3,"file":"browser-history.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/browser-history.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAOvE,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,IAAI,YAAY,GAAG,IAAI,CAAC;IAC5B,QAAQ,IAAI,YAAY,GAAG,IAAI,CAAC;IAChC,OAAO,IAAI,IAAI,CAAC;CACjB,CAAC;AAWF,mFAAmF;AACnF,wBAAgB,qBAAqB,IAAI,cAAc,CAyBtD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ssgoi/core",
3
- "version": "7.1.0-beta.3",
3
+ "version": "7.1.0",
4
4
  "description": "Core animation engine for SSGOI - Native app-like page transitions with spring physics",
5
5
  "private": false,
6
6
  "type": "module",