@ssgoi/core 7.0.3 → 7.1.0-beta.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/animation/animation.d.ts +4 -66
- package/dist/animation/animation.d.ts.map +1 -1
- package/dist/animation/integrator/provider.d.ts +1 -1
- package/dist/animation/integrator/provider.d.ts.map +1 -1
- package/dist/animation/web-animation.d.ts.map +1 -1
- package/dist/index.cjs +15 -15
- package/dist/index.js +1191 -1347
- package/dist/internal.cjs +1 -1
- package/dist/internal.js +543 -707
- package/dist/multi-animation-B5hEmEgN.cjs +1 -0
- package/dist/{multi-animation-ZFZBDBGr.js → multi-animation-DyZGEfKy.js} +72 -128
- package/dist/page-motion-gH3WomQO.cjs +1 -0
- package/dist/page-motion-wmW7PW6B.js +204 -0
- package/dist/resolve-transition-rule-BL12rDDu.cjs +1 -0
- package/dist/resolve-transition-rule-DbkMu0rm.js +160 -0
- package/dist/runtime/animation.d.ts +68 -0
- package/dist/runtime/animation.d.ts.map +1 -0
- package/dist/runtime/index.d.ts +12 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/motion-state.d.ts +25 -0
- package/dist/runtime/motion-state.d.ts.map +1 -0
- package/dist/runtime/page-motion.d.ts +27 -0
- package/dist/runtime/page-motion.d.ts.map +1 -0
- package/dist/runtime/physics.d.ts +30 -0
- package/dist/runtime/physics.d.ts.map +1 -0
- package/dist/runtime/presence.d.ts +20 -0
- package/dist/runtime/presence.d.ts.map +1 -0
- package/dist/runtime/resolve-transition-rule.d.ts +21 -0
- package/dist/runtime/resolve-transition-rule.d.ts.map +1 -0
- package/dist/runtime/timeline.d.ts +12 -0
- package/dist/runtime/timeline.d.ts.map +1 -0
- package/dist/runtime/types.d.ts +53 -0
- package/dist/runtime/types.d.ts.map +1 -0
- package/dist/runtime.cjs +1 -0
- package/dist/runtime.d.ts +2 -0
- package/dist/runtime.js +51 -0
- package/dist/ssgoi-transition/navigation-direction.d.ts +3 -4
- package/dist/ssgoi-transition/navigation-direction.d.ts.map +1 -1
- package/dist/ssgoi-transition/path-pattern.d.ts +1 -1
- package/dist/ssgoi-transition/path-pattern.d.ts.map +1 -1
- package/dist/ssgoi-transition/resolve-transition-rule.d.ts +2 -20
- package/dist/ssgoi-transition/resolve-transition-rule.d.ts.map +1 -1
- package/dist/timeline-L_vXntmP.js +68 -0
- package/dist/timeline-Zoo1I4XU.cjs +1 -0
- package/dist/transitions/fade/transition.d.ts.map +1 -1
- package/dist/transitions/slide/transition.d.ts.map +1 -1
- package/dist/types/index.d.ts +17 -147
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +7 -1
- package/dist/multi-animation-6124HEke.cjs +0 -1
package/dist/internal.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Bt=Object.defineProperty;var zt=(t,n,e)=>n in t?Bt(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e;var Z=(t,n,e)=>zt(t,typeof n!="symbol"?n+"":n,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const st=require("./multi-animation-6124HEke.cjs");class _t extends st.Animation{constructor(){super(...arguments);Z(this,"child",null);Z(this,"_state","idle");Z(this,"_settled",!1);Z(this,"listeners",new Set)}attach(e){const o=this.child;if(this.child=e,this._settled=!1,o){const u=o.getPose();o.complete(),e.matchInto(u)}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=u=>{var f;i==null||i(u),(f=this.onUpdate)==null||f.call(this,u),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 Xt=(t,n)=>{var e;t.style.position="absolute",t.style.width="100%",t.style.top=`${-1*(((e=n==null?void 0:n.scrollOffset)==null?void 0:e.y)??0)}px`,t.style.left="0"},wt=new Set(["auto","scroll","overlay"]),Gt=t=>{let n=t.parentElement;for(;n&&n!==document.body;){const e=window.getComputedStyle(n);if(wt.has(e.overflowY)||wt.has(e.overflowX))return n;n=n.parentElement}return document.documentElement},qt=t=>{let n=t.parentElement;for(;n&&n!==document.body;){const e=window.getComputedStyle(n).position;if(e==="relative"||e==="absolute"||e==="fixed"||e==="sticky")return n;n=n.parentElement}return document.body};function Ut(t){const n=Object.keys(t);return Promise.all(n.map(e=>t[e])).then(e=>{const o={};return n.forEach((c,i)=>{o[c]=e[i]}),o})}const Kt=768,Vt=10,$t=10;function Yt(t={}){const{resolvePath:n=g=>g}=t;let e=null,o=!1,c=!1;const i=()=>{const g=(e==null?void 0:e.clientWidth)??0,v=g>0?g:typeof window<"u"?window.innerWidth:0;return v>0&&v<Kt},u=()=>(c||(o=i(),c=!0),o),f=g=>`path:${n(g)}`;let h=null;const a=new Map;let p=null,y=!1,m=0,b=0,P=0;const M=()=>{e&&p&&!y&&a.set(f(p),{x:e.scrollLeft,y:e.scrollTop})},D=(g,v,O)=>{if(!e)return;const R=++b,I=f(g),x=v&&a.has(I)?a.get(I):{x:0,y:0};let _=0;const W=()=>{if(!e||O!==m||R!==b)return;v||a.set(I,x),e.scrollTo({top:x.y,left:x.x}),!(Math.abs(e.scrollTop-x.y)<1&&Math.abs(e.scrollLeft-x.x)<1)&&_<Vt&&(_++,requestAnimationFrame(W))};requestAnimationFrame(W)};return{initializeContext:(g,v,O)=>{y=!0;const R=p===v?m:++m;h=g,e||(e=Gt(g),o=i(),c=!0,typeof ResizeObserver<"u"&&new ResizeObserver(()=>{o=i()}).observe(e),(e===document.documentElement?window:e).addEventListener("scroll",M,{passive:!0})),p=v;const I=f(v),x=a.get(I),_=z=>{R===m&&(P=R,z&&x&&a.set(I,x),D(v,z,R))};O!==void 0?_(O):requestAnimationFrame(()=>{P!==R&&R===m&&_(!1)});let W=0;const $=()=>{R===m&&(W++,W>=$t?y=!1:requestAnimationFrame($))};return requestAnimationFrame($),_},calculateScrollOffset:(g,v,O=!1)=>{const R=g?f(g):null,I=R&&a.has(R)?a.get(R):{x:0,y:0},x=v&&O?f(v):null,_=x&&a.has(x)?a.get(x):{x:0,y:0};return{x:-_.x+I.x,y:-_.y+I.y}},evictScrollPosition:g=>{a.delete(f(g))},getScrollContainer:()=>e,getPositionedParentElement:()=>h?qt(h):document.body,getScrollPosition:(g,v=!0)=>{if(!v)return{x:0,y:0};const O=g?f(g):null;return O&&a.has(O)?a.get(O):{x:0,y:0}},getIsMobile:u}}const Tt=30,Pt=8,At=1.2,Ct=30,Zt=600;function jt(){let t=null,n=!1,e=!1,o=null,c=null,i=!1;const u=(S,w)=>{for(let C=0;C<S.length;C++){const L=S.item(C);if(L&&L.identifier===w)return L}return null},f=()=>{o!==null&&(clearTimeout(o),o=null)},h=()=>{c!==null&&(clearTimeout(c),c=null)},a=()=>{n=!0,e=!0,f(),h(),o=setTimeout(()=>{n=!1,e=!1,o=null},Zt)},p=S=>{if(S.touches.length!==1){t=null;return}const w=S.touches.item(0);if(!w){t=null;return}const C=window.innerWidth,L=w.clientX<=Tt,B=w.clientX>=C-Tt;if(!L&&!B){t=null;return}t={identifier:w.identifier,startX:w.clientX,startY:w.clientY,fromLeftEdge:L,moved:!1}},y=S=>{if(!t)return;if(S.touches.length!==1){t=null;return}const w=u(S.touches,t.identifier);if(!w){t=null;return}const C=w.clientX-t.startX,L=w.clientY-t.startY,B=Math.abs(C),g=Math.abs(L);if(g>Pt&&g>B*At){t=null;return}const v=t.fromLeftEdge?C>0:C<0;B>Pt&&B>g*At&&v&&(t.moved=!0)},m=S=>{if(!t)return;const w=u(S.changedTouches,t.identifier);if(!w){t=null;return}const C=w.clientX-t.startX,L=t.fromLeftEdge?C>0:C<0;if(t.moved&&L&&Math.abs(C)>=Ct){a(),t=null;return}t.moved&&Math.abs(C)>=Ct&&a(),t=null},b=()=>{t&&(t.moved&&a(),t=null)};return{initialize:()=>{if(typeof window>"u"||i)return;i=!0;const S={passive:!0,capture:!0};window.addEventListener("touchstart",p,S),window.addEventListener("touchmove",y,S),window.addEventListener("touchend",m,S),window.addEventListener("touchcancel",b,S)},destroy:()=>{if(typeof window>"u"||!i)return;i=!1;const S={capture:!0};window.removeEventListener("touchstart",p,S),window.removeEventListener("touchmove",y,S),window.removeEventListener("touchend",m,S),window.removeEventListener("touchcancel",b,S),f(),h(),t=null,n=!1,e=!1},isSwipeBack:()=>{const S=n||e;return S&&f(),S},onPageEnter:()=>{n=!1,f(),h(),c=setTimeout(()=>{e=!1,c=null},0)}}}const Qt=1e6,Ot=100,Jt=10,te=1;function ee(t){const n=t.trim(),e=n.indexOf("#"),o=n.indexOf("?"),c=[e,o].filter(i=>i>=0).reduce((i,u)=>Math.min(i,u),n.length);return n.slice(0,c)}function Q(t){const n=ee(t);try{if(/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n))return Q(new URL(n).pathname)}catch{}const o=(n.startsWith("/")?n:`/${n}`).replace(/\/+/g,"/");return(o.length>1?o.replace(/\/+$/g,""):o)||"/"}function ne(t){const n=t.trim();return n==="*"?"/**":Q(n)}function dt(t){return t==="/"?[]:t.slice(1).split("/")}function ie(t){return t.startsWith(":")||t.startsWith("[")&&t.endsWith("]")||t.startsWith("{")&&t.endsWith("}")}function oe(t,n){const e=Q(t),o=ne(n);if(e===o)return{matched:!0,specificity:Qt+dt(o).length*Ot,pattern:n};const c=dt(e),i=dt(o);let u=0;for(let f=0;f<i.length;f++){const h=i[f],a=c[f],p=f===i.length-1;if(h==="**")return{matched:p&&c.length>=f,specificity:u,pattern:n};if(a===void 0||h===void 0)return{matched:!1,specificity:0,pattern:n};if(h==="*"){u+=te;continue}if(ie(h)){u+=Jt;continue}if(h!==a)return{matched:!1,specificity:0,pattern:n};u+=Ot}return{matched:c.length===i.length,specificity:u,pattern:n}}function H(t,n){const e=typeof n=="string"?[n]:n;let o=null;for(const c of e){const i=oe(t,c);i.matched&&(!o||i.specificity>o.specificity)&&(o=i)}return o}const xt={from:!0,to:!1},se={from:!0,to:!0};function re(t,n){return n?t.priority!==n.priority?t.priority>n.priority:t.specificity!==n.specificity?t.specificity>n.specificity:t.ruleIndex<n.ruleIndex:!0}function ht(t,n){return n==="forward"?{from:t.from,to:t.to}:{from:t.to,to:t.from}}function ce(t,n,e,o){let c=null;return e.forEach((i,u)=>{const f=i.priority??0;let h=null;if(i.on!==void 0){const a=i.except!==void 0&&H(t,i.except)!==null,p=i.except!==void 0&&H(n,i.except)!==null,y=a?null:H(t,i.on),m=p?null:H(n,i.on);if(y||m){const b=!y&&m?"forward":y&&!m?"backward":o,P=!y&&m?"on-enter":y&&!m?"on-leave":"on-history",M=i.preserveScroll??xt;h={transition:i.transition,direction:b,ruleIndex:u,priority:f,specificity:Math.max((y==null?void 0:y.specificity)??0,(m==null?void 0:m.specificity)??0),reason:P,preserveScroll:P==="on-history"?{from:M.to,to:M.to}:ht(M,b)}}}else if(i.ordered!==void 0){let a=-1,p=-1,y=-1,m=-1;if(i.ordered.forEach((b,P)=>{const M=H(t,b);M&&M.specificity>y&&(a=P,y=M.specificity);const D=H(n,b);D&&D.specificity>m&&(p=P,m=D.specificity)}),a>=0&&p>=0&&a!==p){const b=a<p?"forward":"backward";h={transition:i.transition,direction:b,ruleIndex:u,priority:f,specificity:y+m,reason:"ordered",preserveScroll:ht(i.preserveScroll??se,b)}}}else{const a=H(t,i.from),p=H(n,i.to),y=i.bidirectional===!1?null:H(t,i.to),m=i.bidirectional===!1?null:H(n,i.from),b=a&&p,P=y&&m;if(b||P){const M=b?a.specificity+p.specificity:-1,D=P?y.specificity+m.specificity:-1,G=b&&P&&M===D?o:M>=D?"forward":"backward";h={transition:i.transition,direction:G,ruleIndex:u,priority:f,specificity:Math.max(M,D),reason:"pair",preserveScroll:ht(i.preserveScroll??xt,G)}}}h&&re(h,c)&&(c=h)}),c}function le(){const t=[];let n=!1;const e=()=>{n=!0};return typeof window<"u"&&window.addEventListener("popstate",e),{resolve(o,c){const i=Q(o),u=Q(c);if(t.length===0)t.push(i);else if(t[t.length-1]!==i){const a=t.lastIndexOf(i);a>=0?t.splice(a+1):t.push(i)}const f=t[t.length-2],h=n||f===u?"backward":"forward";if(n=!1,h==="backward"){const a=t.lastIndexOf(u);a>=0?t.splice(a+1):t.push(u)}else t[t.length-1]!==u&&t.push(u);return h},dispose(){typeof window<"u"&&window.removeEventListener("popstate",e)}}}function ae(t={}){let n=null,e=null;function o(){var i,u;n&&((i=n.out)==null||i.resolve(null),(u=n.in)==null||u.resolve(null),n=null)}function c(){if(n!=null&&n.out&&n.in){if(n.out.path===n.in.path){o();return}const i={from:n.out.path,to:n.in.path,out:n.out.payload,in:n.in.payload};e=i,n.out.resolve(i),n.in.resolve(i),n=null}}return{arrive(i,u,f){return new Promise(h=>{var m,b;const a=e===null?null:u==="out"?{path:e.from,payload:e.out}:{path:e.to,payload:e.in};if((a==null?void 0:a.path)===i){h(null);return}u==="out"&&((m=n==null?void 0:n.in)==null?void 0:m.path)===i&&!n.out&&(n.in.resolve(null),n.in=void 0);const p=n==null?void 0:n[u];p&&p.path!==i&&o(),n||(n={});const y=n[u];if(y){if(((b=t.keepCurrent)==null?void 0:b.call(t,{type:u,path:i,current:y.payload,next:f}))??!1){h(null);return}y.resolve(null)}n[u]={path:i,payload:f,resolve:h},c()})},cancel(i){(n!=null&&n.out&&i(n.out.payload)||n!=null&&n.in&&i(n.in.payload))&&o(),(e&&i(e.out)||e&&i(e.in))&&(e=null)}}}const ue={},V=new Map;let et=null,Mt=!1;function Dt(t,n,e){t instanceof HTMLElement&&V.has(t)&&!t.isConnected&&e.set(t,{entry:V.get(t),anchor:n});for(const o of Array.from(t.childNodes))Dt(o,n,e)}function fe(t){const n=new Set(Array.from(t.values(),({entry:e})=>e));for(const[e,{entry:o,anchor:c}]of t){V.delete(e);let i=o.parent,u=!1;for(;i;){if(i.group===o.group&&n.has(i)){u=!0;break}i=i.parent}queueMicrotask(()=>o.callback(c,{emit:!u}))}}function de(){if(Mt||typeof document>"u")return;Mt=!0,et=new MutationObserver(n=>{const e=new Map;for(const o of n){const c={parent:o.target,nextSibling:o.nextSibling};for(const i of Array.from(o.removedNodes))Dt(i,c,e)}fe(e)});const t=()=>{et==null||et.observe(document.body,{childList:!0,subtree:!0})};document.body?t():document.addEventListener("DOMContentLoaded",t,{once:!0})}function he(t,n,e=ue){de();let o=t.parentElement,c=null;for(;o;){const i=V.get(o);if((i==null?void 0:i.group)===e){c=i;break}o=o.parentElement}return V.set(t,{element:t,callback:n,group:e,parent:c}),()=>{V.delete(t)}}const pt=new WeakMap;let nt=null;const it="none !important";function j(t){const n=t.style.getPropertyValue("display");return t.style.getPropertyPriority("display")?`${n} !important`:n}function pe(){return nt||(nt=new MutationObserver(t=>{for(const n of t){const e=n.target,o=pt.get(e);if(!o)continue;const c=j(e);c!==o.accounted&&(o.accounted=c,c===it?(o.reactHidden=!0,o.onHide()):c!=="none"&&o.reactHidden&&(o.reactHidden=!1,o.onShow()))}}),nt)}function ye(t,n){const e=j(t),o={accounted:e,reactHidden:e===it,onHide:n.onHide,onShow:n.onShow};return pt.set(t,o),pe().observe(t,{attributes:!0,attributeFilter:["style"]}),{get isHidden(){return j(t)===it},setDisplay(c,i=!1){c===null?t.style.removeProperty("display"):t.style.setProperty("display",c,i?"important":""),o.accounted=j(t)},sync(){o.accounted=j(t),o.reactHidden=o.accounted===it},stop(){pt.delete(t)}}}function me(t,n={}){const{transitions:e=[],middleware:o=(s,r)=>({from:s,to:r})}=t,c=n.host??new _t,i={},u=ae({keepCurrent:({current:s,next:r})=>s.element.contains(r.element)}),f=le(),h=typeof e=="function"?e:()=>e,a=jt();a.initialize();const p=new Map,y=s=>{let r=p.get(s);return r===void 0&&(r=o(s,s).from,p.set(s,r)),r},{initializeContext:m,calculateScrollOffset:b,evictScrollPosition:P,getScrollContainer:M,getPositionedParentElement:D,getScrollPosition:G,getIsMobile:S}=Yt({resolvePath:y}),w=new Map,C=()=>{const s=S();let r=w.get(s);return r||(r=h({isMobile:s}),w.set(s,r)),r},L=new WeakMap,B=s=>{L.set(s,{parent:s.parentNode,nextSibling:s.nextSibling})},g=s=>{const r=L.get(s);return r||{parent:s.parentNode,nextSibling:s.nextSibling}},v=new WeakMap,O=new WeakMap;let R=0;const I=s=>{const r=typeof getComputedStyle<"u"?getComputedStyle(s).display:"";return r&&r!=="none"?r:"block"},x=(s,r)=>{r.visibleDisplay=s.style.getPropertyValue("display"),r.computedDisplay=I(s)},_=(s,r)=>{if(O.get(s)!==r)return;O.delete(s);const l=v.get(s);l&&(l.savedCss!==null&&(s.style.cssText=l.savedCss,l.savedCss=null),l.intent==="hidden"?l.vis.setDisplay("none",!0):l.visibleDisplay?(l.vis.setDisplay(l.visibleDisplay,!1),x(s,l)):(l.vis.setDisplay(null),x(s,l)))},W=(s,r)=>{if(s.mode!=="hidden")return;const l=Array.from(new Set([s.element,r==null?void 0:r.element].filter(Boolean))),A=++R;for(const d of l)O.set(d,A);c.complete();for(const d of l)_(d,A)},$=(s,r,l,A,d,E,T)=>{const F=d.element,k=E.element,X=(d.mode??"unmount")==="hidden",{parent:q,nextSibling:K}=d.parent?{parent:d.parent,nextSibling:d.nextSibling}:g(F),J=b(l,A,T.to),ct={direction:r,scrollOffset:J,from:{scroll:G(l)},to:{scroll:G(A,T.to)},get scrollingElement(){return M()||document.documentElement},get positionedParent(){return D()}};let N;if(X){N=F,N.style.top=`${-1*((J==null?void 0:J.y)??0)}px`;const U=v.get(k);U&&U.savedCss===null&&(U.savedCss=k.style.cssText)}else N=F,Xt(N,ct);T.from||P(l);const tt=X?++R:0;X&&(O.set(k,tt),O.set(F,tt));const St=Promise.resolve(N),Et=Promise.resolve(k),bt=[],Wt={from:St,to:Et,context:ct,createElement:((U,lt="div")=>{const Y=document.createElement(lt);return Y.setAttribute("data-ssgoi-id",U),bt.push(Y),Y})},Ft=Promise.resolve(s.prepare?s.prepare(Wt):{});Ut({from:St,to:Et,extras:Ft}).then(({from:U,to:lt,extras:Y})=>{!X&&q&&(K&&q.contains(K)?q.insertBefore(N,K):q.appendChild(N));const at=s.animation({from:U,to:lt,context:ct,...Y}),ut=at.onComplete;at.onComplete=()=>{ut==null||ut(),X?(_(F,tt),_(k,tt)):N.parentNode&&N.parentNode.removeChild(N);for(const ft of bt)ft.parentNode&&ft.parentNode.removeChild(ft)},c.attach(at)})},z=(s,r,l)=>{const A=a.isSwipeBack();u.arrive(s,r,l).then(d=>{var rt,X,q,K;if(r==="in"&&a.onPageEnter(),!d){r==="out"&&W(l);return}if(r!=="in")return;const{from:E,to:T}=o(d.from,d.to),F=f.resolve(E,T),k=ce(E,T,C(),F);if(!k){(X=(rt=d.in).applyScrollPolicy)==null||X.call(rt,!1),P(d.from),W(d.out,d.in);return}if((K=(q=d.in).applyScrollPolicy)==null||K.call(q,k.preserveScroll.to),A){k.preserveScroll.from||P(d.from),W(d.out,d.in);return}$(k.transition,k.direction,d.from,d.to,d.out,d.in,k.preserveScroll)})},yt=(s,r)=>{const l=v.get(s);if(!l)return;const A=l.intent==="hidden";if(l.intent="hidden",l.savedCss===null&&(l.savedCss=s.style.cssText),l.vis.setDisplay(l.computedDisplay||"block",!0),s.style.position="absolute",s.style.width="100%",s.style.left="0",A)return;const d=g(s),E={element:s,parent:d.parent,nextSibling:d.nextSibling,mode:"hidden"},T=l.pendingOutPath??l.currentPath??r;l.pendingOutPath=null,z(T,"out",E)},Nt=(s,r)=>{const l=v.get(s);if(!l||l.intent==="visible")return;l.intent="visible",l.currentPath=s.getAttribute("data-ssgoi-transition")??l.currentPath??r,l.pendingOutPath=null,l.pathRevision++,x(s,l),l.savedCss!==null&&(s.style.cssText=l.savedCss,l.visibleDisplay?l.vis.setDisplay(l.visibleDisplay,!1):l.vis.setDisplay(null));const A=l.currentPath,d=m(s,A),E={element:s,parent:s.parentElement,nextSibling:s.nextElementSibling,applyScrollPolicy:d};z(A,"in",E)},Ht=(s,r,l,A=!0)=>{const d=v.get(s),E=(d==null?void 0:d.pendingOutPath)??(d==null?void 0:d.currentPath)??r;if(d&&(d.vis.stop(),v.delete(s),O.delete(s),d.intent==="hidden")){u.cancel(k=>k.element===s);return}if(!A)return;const T=l??g(s),F={element:s,parent:T.parent,nextSibling:T.nextSibling,mode:"unmount"};z(E,"out",F)},mt=new WeakSet,gt=(s,r,{enter:l=!0}={})=>{if(mt.has(r)){const E=v.get(r);if(E&&E.currentPath!==s){E.intent==="visible"&&E.pendingOutPath===null&&(E.pendingOutPath=E.currentPath),E.currentPath=s;const T=++E.pathRevision;queueMicrotask(()=>{E.pathRevision===T&&(E.pendingOutPath=null)})}return}mt.add(r),B(r);const A=ye(r,{onHide:()=>yt(r,s),onShow:()=>Nt(r,s)}),d={vis:A,savedCss:null,intent:A.isHidden?"hidden":"visible",visibleDisplay:"",computedDisplay:"block",currentPath:s,pendingOutPath:null,pathRevision:0};if(v.set(r,d),!A.isHidden&&(x(r,d),l)){const E=m(r,s),T={element:r,parent:r.parentElement,nextSibling:r.nextElementSibling,applyScrollPolicy:E};z(s,"in",T)}he(r,(E,T)=>Ht(r,s,E,(T==null?void 0:T.emit)??!0),i)},vt=new Map;return{register:gt,refFor:s=>{let r=vt.get(s);return r||(r=l=>{l&>(s,l)},vt.set(s,r)),r}}}const It="data-ssgoi-root",ge=`[${It}]`,ot="data-ssgoi-transition",Rt=`[${ot}]`,ve="[data-ssgoi-clone]";function Se(){return typeof MutationObserver<"u"&&typeof HTMLElement<"u"&&typeof Node<"u"}function Ee(t){return t.nodeType===Node.ELEMENT_NODE}function be(t){return t instanceof HTMLElement}function Lt(t){let n=0,e=t.parentElement;for(;e;)n++,e=e.parentElement;return n}function kt(t,n,e=t){const o=Array.from(t).sort((c,i)=>Lt(c)-Lt(i));for(const c of o){const i=c.getAttribute(ot);if(i===null)continue;let u=c.parentElement,f=!1;for(;u;){if(e.has(u)){f=!0;break}u=u.parentElement}n.register(i,c,{enter:!f})}}function we(t,n){if(!Se())return()=>{};t.setAttribute(It,"");const e=f=>f.closest(ge)===t,o=f=>!be(f)||!e(f)||f.closest(ve)||f.getAttribute(ot)===null?null:f,c=(f,h)=>{if(Ee(f)){if(f.matches(Rt)){const a=o(f);a&&h.add(a)}for(const a of f.querySelectorAll(Rt)){const p=o(a);p&&h.add(p)}}},i=new MutationObserver(f=>{const h=new Set,a=new Set;for(const p of f){if(p.type==="attributes"){const y=o(p.target);y&&h.add(y);continue}for(const y of p.addedNodes)c(y,a)}for(const p of a)h.add(p);kt(h,n,a)});i.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[ot]});const u=new Set;return c(t,u),kt(u,n),()=>i.disconnect()}exports.Animation=st.Animation;exports.MultiAnimation=st.MultiAnimation;exports.WebAnimation=st.WebAnimation;exports.HostAnimation=_t;exports.createSggoiTransitionContext=me;exports.observeSsgoiTransitions=we;
|
|
1
|
+
"use strict";var _t=Object.defineProperty;var Nt=(n,e,t)=>e in n?_t(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var K=(n,e,t)=>Nt(n,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ht=require("./resolve-transition-rule-BL12rDDu.cjs"),ot=require("./multi-animation-B5hEmEgN.cjs");class Mt extends ot.Animation{constructor(){super(...arguments);K(this,"child",null);K(this,"_state","idle");K(this,"_settled",!1);K(this,"listeners",new Set)}attach(t){const i=this.child;if(this.child=t,this._settled=!1,i){const f=i.getPose();i.complete(),t.matchInto(f)}t.playbackRate=this.playbackRate;const c=t.onComplete;t.onComplete=()=>{c==null||c(),this.child===t&&(this.child=null,this._state="idle",this._settled=!0),this.notify()};const r=t.onUpdate;t.onUpdate=f=>{var u;r==null||r(f),(u=this.onUpdate)==null||u.call(this,f),this.notify()},this._state==="paused"?t.pause():this._state==="reversing"?t.reverse():(this._state="playing",t.play()),this.notify()}play(){var t;this._state="playing",this._settled=!1,(t=this.child)==null||t.play(),this.notify()}reverse(){var t;this._state="reversing",this._settled=!1,(t=this.child)==null||t.reverse(),this.notify()}pause(){var t;this._state="paused",(t=this.child)==null||t.pause(),this.notify()}complete(){var t;(t=this.child)==null||t.complete(),this.notify()}get isAnimating(){var t;return((t=this.child)==null?void 0:t.isAnimating)??!1}get isPaused(){return this._state==="paused"}get isComplete(){return this._settled&&!this.child}get isReversing(){var t;return((t=this.child)==null?void 0:t.isReversing)??this._state==="reversing"}get progress(){var t;return((t=this.child)==null?void 0:t.progress)??0}findTimeForProgress(t){var i;return((i=this.child)==null?void 0:i.findTimeForProgress(t))??null}get playbackRate(){return super.playbackRate}set playbackRate(t){super.playbackRate=t,this.child&&(this.child.playbackRate=t),this.notify()}getPose(){var t;return((t=this.child)==null?void 0:t.getPose())??[]}getTimeline(){var t;return((t=this.child)==null?void 0:t.getTimeline())??[]}matchInto(t){var i;(i=this.child)==null||i.matchInto(t)}get activeChild(){return this.child}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}notify(){for(const t of this.listeners)t()}}const It=(n,e)=>{var t;n.style.position="absolute",n.style.width="100%",n.style.top=`${-1*(((t=e==null?void 0:e.scrollOffset)==null?void 0:t.y)??0)}px`,n.style.left="0"},vt=new Set(["auto","scroll","overlay"]),Ft=n=>{let e=n.parentElement;for(;e&&e!==document.body;){const t=window.getComputedStyle(e);if(vt.has(t.overflowY)||vt.has(t.overflowX))return e;e=e.parentElement}return document.documentElement},Bt=n=>{let e=n.parentElement;for(;e&&e!==document.body;){const t=window.getComputedStyle(e).position;if(t==="relative"||t==="absolute"||t==="fixed"||t==="sticky")return e;e=e.parentElement}return document.body};function Wt(n){const e=Object.keys(n);return Promise.all(e.map(t=>n[t])).then(t=>{const i={};return e.forEach((c,r)=>{i[c]=t[r]}),i})}const Xt=768,qt=10,zt=10;function Gt(n={}){const{resolvePath:e=h=>h}=n;let t=null,i=!1,c=!1;const r=()=>{const h=(t==null?void 0:t.clientWidth)??0,p=h>0?h:typeof window<"u"?window.innerWidth:0;return p>0&&p<Xt},f=()=>(c||(i=r(),c=!0),i),u=h=>`path:${e(h)}`;let v=null;const d=new Map;let g=null,S=!1,C=0,L=0,H=0;const Y=()=>{t&&g&&!S&&d.set(u(g),{x:t.scrollLeft,y:t.scrollTop})},$=(h,p,T)=>{if(!t)return;const M=++L,x=u(h),A=p&&d.has(x)?d.get(x):{x:0,y:0};let k=0;const _=()=>{if(!t||T!==C||M!==L)return;p||d.set(x,A),t.scrollTo({top:A.y,left:A.x}),!(Math.abs(t.scrollTop-A.y)<1&&Math.abs(t.scrollLeft-A.x)<1)&&k<qt&&(k++,requestAnimationFrame(_))};requestAnimationFrame(_)};return{initializeContext:(h,p,T)=>{S=!0;const M=g===p?C:++C;v=h,t||(t=Ft(h),i=r(),c=!0,typeof ResizeObserver<"u"&&new ResizeObserver(()=>{i=r()}).observe(t),(t===document.documentElement?window:t).addEventListener("scroll",Y,{passive:!0})),g=p;const x=u(p),A=d.get(x),k=F=>{M===C&&(H=M,F&&A&&d.set(x,A),$(p,F,M))};T!==void 0?k(T):requestAnimationFrame(()=>{H!==M&&M===C&&k(!1)});let _=0;const G=()=>{M===C&&(_++,_>=zt?S=!1:requestAnimationFrame(G))};return requestAnimationFrame(G),k},calculateScrollOffset:(h,p,T=!1)=>{const M=h?u(h):null,x=M&&d.has(M)?d.get(M):{x:0,y:0},A=p&&T?u(p):null,k=A&&d.has(A)?d.get(A):{x:0,y:0};return{x:-k.x+x.x,y:-k.y+x.y}},evictScrollPosition:h=>{d.delete(u(h))},getScrollContainer:()=>t,getPositionedParentElement:()=>v?Bt(v):document.body,getScrollPosition:(h,p=!0)=>{if(!p)return{x:0,y:0};const T=h?u(h):null;return T&&d.has(T)?d.get(T):{x:0,y:0}},getIsMobile:f}}const bt=30,Et=8,wt=1.2,St=30,Vt=600;function Kt(){let n=null,e=!1,t=!1,i=null,c=null,r=!1;const f=(y,b)=>{for(let P=0;P<y.length;P++){const O=y.item(P);if(O&&O.identifier===b)return O}return null},u=()=>{i!==null&&(clearTimeout(i),i=null)},v=()=>{c!==null&&(clearTimeout(c),c=null)},d=()=>{e=!0,t=!0,u(),v(),i=setTimeout(()=>{e=!1,t=!1,i=null},Vt)},g=y=>{if(y.touches.length!==1){n=null;return}const b=y.touches.item(0);if(!b){n=null;return}const P=window.innerWidth,O=b.clientX<=bt,I=b.clientX>=P-bt;if(!O&&!I){n=null;return}n={identifier:b.identifier,startX:b.clientX,startY:b.clientY,fromLeftEdge:O,moved:!1}},S=y=>{if(!n)return;if(y.touches.length!==1){n=null;return}const b=f(y.touches,n.identifier);if(!b){n=null;return}const P=b.clientX-n.startX,O=b.clientY-n.startY,I=Math.abs(P),h=Math.abs(O);if(h>Et&&h>I*wt){n=null;return}const p=n.fromLeftEdge?P>0:P<0;I>Et&&I>h*wt&&p&&(n.moved=!0)},C=y=>{if(!n)return;const b=f(y.changedTouches,n.identifier);if(!b){n=null;return}const P=b.clientX-n.startX,O=n.fromLeftEdge?P>0:P<0;if(n.moved&&O&&Math.abs(P)>=St){d(),n=null;return}n.moved&&Math.abs(P)>=St&&d(),n=null},L=()=>{n&&(n.moved&&d(),n=null)};return{initialize:()=>{if(typeof window>"u"||r)return;r=!0;const y={passive:!0,capture:!0};window.addEventListener("touchstart",g,y),window.addEventListener("touchmove",S,y),window.addEventListener("touchend",C,y),window.addEventListener("touchcancel",L,y)},destroy:()=>{if(typeof window>"u"||!r)return;r=!1;const y={capture:!0};window.removeEventListener("touchstart",g,y),window.removeEventListener("touchmove",S,y),window.removeEventListener("touchend",C,y),window.removeEventListener("touchcancel",L,y),u(),v(),n=null,e=!1,t=!1},isSwipeBack:()=>{const y=e||t;return y&&u(),y},onPageEnter:()=>{e=!1,u(),v(),c=setTimeout(()=>{t=!1,c=null},0)}}}function Ut(){let n=!1;const e=()=>{n=!0};return typeof window<"u"&&window.addEventListener("popstate",e),{resolve(t,i){const c=n?"backward":"forward";return n=!1,c},dispose(){typeof window<"u"&&window.removeEventListener("popstate",e)}}}function Yt(n={}){let e=null,t=null;function i(){var r,f;e&&((r=e.out)==null||r.resolve(null),(f=e.in)==null||f.resolve(null),e=null)}function c(){if(e!=null&&e.out&&e.in){if(e.out.path===e.in.path){i();return}const r={from:e.out.path,to:e.in.path,out:e.out.payload,in:e.in.payload};t=r,e.out.resolve(r),e.in.resolve(r),e=null}}return{arrive(r,f,u){return new Promise(v=>{var C,L;const d=t===null?null:f==="out"?{path:t.from,payload:t.out}:{path:t.to,payload:t.in};if((d==null?void 0:d.path)===r){v(null);return}f==="out"&&((C=e==null?void 0:e.in)==null?void 0:C.path)===r&&!e.out&&(e.in.resolve(null),e.in=void 0);const g=e==null?void 0:e[f];g&&g.path!==r&&i(),e||(e={});const S=e[f];if(S){if(((L=n.keepCurrent)==null?void 0:L.call(n,{type:f,path:r,current:S.payload,next:u}))??!1){v(null);return}S.resolve(null)}e[f]={path:r,payload:u,resolve:v},c()})},cancel(r){(e!=null&&e.out&&r(e.out.payload)||e!=null&&e.in&&r(e.in.payload))&&i(),(t&&r(t.out)||t&&r(t.in))&&(t=null)}}}const $t={},z=new Map;let Q=null,Pt=!1;function Ot(n,e,t){n instanceof HTMLElement&&z.has(n)&&!n.isConnected&&t.set(n,{entry:z.get(n),anchor:e});for(const i of Array.from(n.childNodes))Ot(i,e,t)}function jt(n){const e=new Set(Array.from(n.values(),({entry:t})=>t));for(const[t,{entry:i,anchor:c}]of n){z.delete(t);let r=i.parent,f=!1;for(;r;){if(r.group===i.group&&e.has(r)){f=!0;break}r=r.parent}queueMicrotask(()=>i.callback(c,{emit:!f}))}}function Zt(){if(Pt||typeof document>"u")return;Pt=!0,Q=new MutationObserver(e=>{const t=new Map;for(const i of e){const c={parent:i.target,nextSibling:i.nextSibling};for(const r of Array.from(i.removedNodes))Ot(r,c,t)}jt(t)});const n=()=>{Q==null||Q.observe(document.body,{childList:!0,subtree:!0})};document.body?n():document.addEventListener("DOMContentLoaded",n,{once:!0})}function Jt(n,e,t=$t){Zt();let i=n.parentElement,c=null;for(;i;){const r=z.get(i);if((r==null?void 0:r.group)===t){c=r;break}i=i.parentElement}return z.set(n,{element:n,callback:e,group:t,parent:c}),()=>{z.delete(n)}}const ut=new WeakMap;let tt=null;const et="none !important";function U(n){const e=n.style.getPropertyValue("display");return n.style.getPropertyPriority("display")?`${e} !important`:e}function Qt(){return tt||(tt=new MutationObserver(n=>{for(const e of n){const t=e.target,i=ut.get(t);if(!i)continue;const c=U(t);c!==i.accounted&&(i.accounted=c,c===et?(i.reactHidden=!0,i.onHide()):c!=="none"&&i.reactHidden&&(i.reactHidden=!1,i.onShow()))}}),tt)}function te(n,e){const t=U(n),i={accounted:t,reactHidden:t===et,onHide:e.onHide,onShow:e.onShow};return ut.set(n,i),Qt().observe(n,{attributes:!0,attributeFilter:["style"]}),{get isHidden(){return U(n)===et},setDisplay(c,r=!1){c===null?n.style.removeProperty("display"):n.style.setProperty("display",c,r?"important":""),i.accounted=U(n)},sync(){i.accounted=U(n),i.reactHidden=i.accounted===et},stop(){ut.delete(n)}}}function ee(n,e={}){const{transitions:t=[],middleware:i=(o,s)=>({from:o,to:s})}=n,c=e.host??new Mt,r={},f=Yt({keepCurrent:({current:o,next:s})=>o.element.contains(s.element)}),u=Ut(),v=typeof t=="function"?t:()=>t,d=Kt();d.initialize();const g=new Map,S=o=>{let s=g.get(o);return s===void 0&&(s=i(o,o).from,g.set(o,s)),s},{initializeContext:C,calculateScrollOffset:L,evictScrollPosition:H,getScrollContainer:Y,getPositionedParentElement:$,getScrollPosition:j,getIsMobile:y}=Gt({resolvePath:S}),b=new Map,P=()=>{const o=y();let s=b.get(o);return s||(s=v({isMobile:o}),b.set(o,s)),s},O=new WeakMap,I=o=>{O.set(o,{parent:o.parentNode,nextSibling:o.nextSibling})},h=o=>{const s=O.get(o);return s||{parent:o.parentNode,nextSibling:o.nextSibling}},p=new WeakMap,T=new WeakMap;let M=0;const x=o=>{const s=typeof getComputedStyle<"u"?getComputedStyle(o).display:"";return s&&s!=="none"?s:"block"},A=(o,s)=>{s.visibleDisplay=o.style.getPropertyValue("display"),s.computedDisplay=x(o)},k=(o,s)=>{if(T.get(o)!==s)return;T.delete(o);const l=p.get(o);l&&(l.savedCss!==null&&(o.style.cssText=l.savedCss,l.savedCss=null),l.intent==="hidden"?l.vis.setDisplay("none",!0):l.visibleDisplay?(l.vis.setDisplay(l.visibleDisplay,!1),A(o,l)):(l.vis.setDisplay(null),A(o,l)))},_=(o,s)=>{if(o.mode!=="hidden")return;const l=Array.from(new Set([o.element,s==null?void 0:s.element].filter(Boolean))),w=++M;for(const a of l)T.set(a,w);c.complete();for(const a of l)k(a,w)},G=(o,s,l,w,a,m,E)=>{const N=a.element,R=m.element,B=(a.mode??"unmount")==="hidden",{parent:W,nextSibling:q}=a.parent?{parent:a.parent,nextSibling:a.nextSibling}:h(N),Z=L(l,w,E.to),st={direction:s,scrollOffset:Z,from:{scroll:j(l)},to:{scroll:j(w,E.to)},get scrollingElement(){return Y()||document.documentElement},get positionedParent(){return $()}};let D;if(B){D=N,D.style.top=`${-1*((Z==null?void 0:Z.y)??0)}px`;const X=p.get(R);X&&X.savedCss===null&&(X.savedCss=R.style.cssText)}else D=N,It(D,st);E.from||H(l);const J=B?++M:0;B&&(T.set(R,J),T.set(N,J));const yt=Promise.resolve(D),mt=Promise.resolve(R),gt=[],Lt={from:yt,to:mt,context:st,createElement:((X,rt="div")=>{const V=document.createElement(rt);return V.setAttribute("data-ssgoi-id",X),gt.push(V),V})},Dt=Promise.resolve(o.prepare?o.prepare(Lt):{});Wt({from:yt,to:mt,extras:Dt}).then(({from:X,to:rt,extras:V})=>{!B&&W&&(q&&W.contains(q)?W.insertBefore(D,q):W.appendChild(D));const lt=o.animation({from:X,to:rt,context:st,...V}),ct=lt.onComplete;lt.onComplete=()=>{ct==null||ct(),B?(k(N,J),k(R,J)):D.parentNode&&D.parentNode.removeChild(D);for(const at of gt)at.parentNode&&at.parentNode.removeChild(at)},c.attach(lt)})},F=(o,s,l)=>{const w=d.isSwipeBack();f.arrive(o,s,l).then(a=>{var it,B,W,q;if(s==="in"&&d.onPageEnter(),!a){s==="out"&&_(l);return}if(s!=="in")return;const{from:m,to:E}=i(a.from,a.to),N=u.resolve(m,E),R=Ht.resolveTransitionRule(m,E,P(),N);if(!R){(B=(it=a.in).applyScrollPolicy)==null||B.call(it,!1),H(a.from),_(a.out,a.in);return}if((q=(W=a.in).applyScrollPolicy)==null||q.call(W,R.preserveScroll.to),w){R.preserveScroll.from||H(a.from),_(a.out,a.in);return}G(R.transition,R.direction,a.from,a.to,a.out,a.in,R.preserveScroll)})},dt=(o,s)=>{const l=p.get(o);if(!l)return;const w=l.intent==="hidden";if(l.intent="hidden",l.savedCss===null&&(l.savedCss=o.style.cssText),l.vis.setDisplay(l.computedDisplay||"block",!0),o.style.position="absolute",o.style.width="100%",o.style.left="0",w)return;const a=h(o),m={element:o,parent:a.parent,nextSibling:a.nextSibling,mode:"hidden"},E=l.pendingOutPath??l.currentPath??s;l.pendingOutPath=null,F(E,"out",m)},kt=(o,s)=>{const l=p.get(o);if(!l||l.intent==="visible")return;l.intent="visible",l.currentPath=o.getAttribute("data-ssgoi-transition")??l.currentPath??s,l.pendingOutPath=null,l.pathRevision++,A(o,l),l.savedCss!==null&&(o.style.cssText=l.savedCss,l.visibleDisplay?l.vis.setDisplay(l.visibleDisplay,!1):l.vis.setDisplay(null));const w=l.currentPath,a=C(o,w),m={element:o,parent:o.parentElement,nextSibling:o.nextElementSibling,applyScrollPolicy:a};F(w,"in",m)},xt=(o,s,l,w=!0)=>{const a=p.get(o),m=(a==null?void 0:a.pendingOutPath)??(a==null?void 0:a.currentPath)??s;if(a&&(a.vis.stop(),p.delete(o),T.delete(o),a.intent==="hidden")){f.cancel(R=>R.element===o);return}if(!w)return;const E=l??h(o),N={element:o,parent:E.parent,nextSibling:E.nextSibling,mode:"unmount"};F(m,"out",N)},ft=new WeakSet,ht=(o,s,{enter:l=!0}={})=>{if(ft.has(s)){const m=p.get(s);if(m&&m.currentPath!==o){m.intent==="visible"&&m.pendingOutPath===null&&(m.pendingOutPath=m.currentPath),m.currentPath=o;const E=++m.pathRevision;queueMicrotask(()=>{m.pathRevision===E&&(m.pendingOutPath=null)})}return}ft.add(s),I(s);const w=te(s,{onHide:()=>dt(s,o),onShow:()=>kt(s,o)}),a={vis:w,savedCss:null,intent:w.isHidden?"hidden":"visible",visibleDisplay:"",computedDisplay:"block",currentPath:o,pendingOutPath:null,pathRevision:0};if(p.set(s,a),!w.isHidden&&(A(s,a),l)){const m=C(s,o),E={element:s,parent:s.parentElement,nextSibling:s.nextElementSibling,applyScrollPolicy:m};F(o,"in",E)}Jt(s,(m,E)=>xt(s,o,m,(E==null?void 0:E.emit)??!0),r)},pt=new Map;return{register:ht,refFor:o=>{let s=pt.get(o);return s||(s=l=>{l&&ht(o,l)},pt.set(o,s)),s}}}const Rt="data-ssgoi-root",ne=`[${Rt}]`,nt="data-ssgoi-transition",Tt=`[${nt}]`,oe="[data-ssgoi-clone]";function ie(){return typeof MutationObserver<"u"&&typeof HTMLElement<"u"&&typeof Node<"u"}function se(n){return n.nodeType===Node.ELEMENT_NODE}function re(n){return n instanceof HTMLElement}function At(n){let e=0,t=n.parentElement;for(;t;)e++,t=t.parentElement;return e}function Ct(n,e,t=n){const i=Array.from(n).sort((c,r)=>At(c)-At(r));for(const c of i){const r=c.getAttribute(nt);if(r===null)continue;let f=c.parentElement,u=!1;for(;f;){if(t.has(f)){u=!0;break}f=f.parentElement}e.register(r,c,{enter:!u})}}function le(n,e){if(!ie())return()=>{};n.setAttribute(Rt,"");const t=u=>u.closest(ne)===n,i=u=>!re(u)||!t(u)||u.closest(oe)||u.getAttribute(nt)===null?null:u,c=(u,v)=>{if(se(u)){if(u.matches(Tt)){const d=i(u);d&&v.add(d)}for(const d of u.querySelectorAll(Tt)){const g=i(d);g&&v.add(g)}}},r=new MutationObserver(u=>{const v=new Set,d=new Set;for(const g of u){if(g.type==="attributes"){const S=i(g.target);S&&v.add(S);continue}for(const S of g.addedNodes)c(S,d)}for(const g of d)v.add(g);Ct(v,e,d)});r.observe(n,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[nt]});const f=new Set;return c(n,f),Ct(f,e),()=>r.disconnect()}exports.Animation=ot.Animation;exports.MultiAnimation=ot.MultiAnimation;exports.WebAnimation=ot.WebAnimation;exports.HostAnimation=Mt;exports.createSggoiTransitionContext=ee;exports.observeSsgoiTransitions=le;
|