@ssgoi/core 7.1.2 → 7.1.3-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.
Files changed (118) hide show
  1. package/README.md +58 -10
  2. package/dist/animation/animation.d.ts +20 -0
  3. package/dist/animation/animation.d.ts.map +1 -1
  4. package/dist/animation/integrator/double-spring-integrator.d.ts +3 -0
  5. package/dist/animation/integrator/double-spring-integrator.d.ts.map +1 -1
  6. package/dist/animation/integrator/inertia-integrator.d.ts +2 -2
  7. package/dist/animation/integrator/inertia-integrator.d.ts.map +1 -1
  8. package/dist/animation/integrator/spring-integrator.d.ts +2 -0
  9. package/dist/animation/integrator/spring-integrator.d.ts.map +1 -1
  10. package/dist/animation/multi-animation.d.ts +37 -9
  11. package/dist/animation/multi-animation.d.ts.map +1 -1
  12. package/dist/animation/web-animation.d.ts +20 -2
  13. package/dist/animation/web-animation.d.ts.map +1 -1
  14. package/dist/index-B_K3Vnj-.js +55 -0
  15. package/dist/index-CtyacfH7.cjs +1 -0
  16. package/dist/index.cjs +4 -4
  17. package/dist/index.d.ts +8 -1
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +1483 -1245
  20. package/dist/internal.cjs +1 -1
  21. package/dist/internal.d.ts +1 -0
  22. package/dist/internal.d.ts.map +1 -1
  23. package/dist/internal.js +5 -3
  24. package/dist/motion/index.d.ts +4 -0
  25. package/dist/motion/index.d.ts.map +1 -0
  26. package/dist/motion/presets.d.ts +13 -0
  27. package/dist/motion/presets.d.ts.map +1 -0
  28. package/dist/motion/spring.d.ts +46 -0
  29. package/dist/motion/spring.d.ts.map +1 -0
  30. package/dist/motion/with-override.d.ts +2 -0
  31. package/dist/motion/with-override.d.ts.map +1 -0
  32. package/dist/multi-animation-Du9W3ZS_.js +503 -0
  33. package/dist/multi-animation-hDUcfD7W.cjs +1 -0
  34. package/dist/page-motion-DF3fFkOw.cjs +1 -0
  35. package/dist/page-motion-MEazegOU.js +43 -0
  36. package/dist/provider-Cea0Pfm1.js +232 -0
  37. package/dist/provider-D9Q2URox.cjs +1 -0
  38. package/dist/runtime.cjs +1 -1
  39. package/dist/runtime.js +12 -12
  40. package/dist/transition/define-transition.d.ts +52 -0
  41. package/dist/transition/define-transition.d.ts.map +1 -0
  42. package/dist/transitions/animation-group.d.ts +7 -0
  43. package/dist/transitions/animation-group.d.ts.map +1 -0
  44. package/dist/transitions/axis/index.d.ts +3 -2
  45. package/dist/transitions/axis/index.d.ts.map +1 -1
  46. package/dist/transitions/axis/transition.d.ts +2 -2
  47. package/dist/transitions/axis/transition.d.ts.map +1 -1
  48. package/dist/transitions/blind/index.d.ts +3 -2
  49. package/dist/transitions/blind/index.d.ts.map +1 -1
  50. package/dist/transitions/blind/transition.d.ts +3 -10
  51. package/dist/transitions/blind/transition.d.ts.map +1 -1
  52. package/dist/transitions/drill/index.d.ts +3 -2
  53. package/dist/transitions/drill/index.d.ts.map +1 -1
  54. package/dist/transitions/drill/transition.d.ts +2 -2
  55. package/dist/transitions/drill/transition.d.ts.map +1 -1
  56. package/dist/transitions/fade/index.d.ts +3 -2
  57. package/dist/transitions/fade/index.d.ts.map +1 -1
  58. package/dist/transitions/fade/transition.d.ts +3 -2
  59. package/dist/transitions/fade/transition.d.ts.map +1 -1
  60. package/dist/transitions/film/index.d.ts +3 -2
  61. package/dist/transitions/film/index.d.ts.map +1 -1
  62. package/dist/transitions/film/transition.d.ts +2 -20
  63. package/dist/transitions/film/transition.d.ts.map +1 -1
  64. package/dist/transitions/hero/index.d.ts +5 -3
  65. package/dist/transitions/hero/index.d.ts.map +1 -1
  66. package/dist/transitions/hero/provider/chrome/fade.d.ts.map +1 -1
  67. package/dist/transitions/hero/provider/chrome/static.d.ts.map +1 -1
  68. package/dist/transitions/hero/transition.d.ts +2 -6
  69. package/dist/transitions/hero/transition.d.ts.map +1 -1
  70. package/dist/transitions/hero/types.d.ts +5 -3
  71. package/dist/transitions/hero/types.d.ts.map +1 -1
  72. package/dist/transitions/jaemin/index.d.ts +3 -2
  73. package/dist/transitions/jaemin/index.d.ts.map +1 -1
  74. package/dist/transitions/jaemin/transition.d.ts +3 -2
  75. package/dist/transitions/jaemin/transition.d.ts.map +1 -1
  76. package/dist/transitions/rotate/index.d.ts +3 -2
  77. package/dist/transitions/rotate/index.d.ts.map +1 -1
  78. package/dist/transitions/rotate/transition.d.ts +3 -2
  79. package/dist/transitions/rotate/transition.d.ts.map +1 -1
  80. package/dist/transitions/scroll/index.d.ts +3 -2
  81. package/dist/transitions/scroll/index.d.ts.map +1 -1
  82. package/dist/transitions/scroll/transition.d.ts +3 -2
  83. package/dist/transitions/scroll/transition.d.ts.map +1 -1
  84. package/dist/transitions/sheet/index.d.ts +3 -2
  85. package/dist/transitions/sheet/index.d.ts.map +1 -1
  86. package/dist/transitions/sheet/transition.d.ts +2 -6
  87. package/dist/transitions/sheet/transition.d.ts.map +1 -1
  88. package/dist/transitions/slide/index.d.ts +3 -2
  89. package/dist/transitions/slide/index.d.ts.map +1 -1
  90. package/dist/transitions/slide/transition.d.ts +3 -2
  91. package/dist/transitions/slide/transition.d.ts.map +1 -1
  92. package/dist/transitions/strip/index.d.ts +3 -2
  93. package/dist/transitions/strip/index.d.ts.map +1 -1
  94. package/dist/transitions/strip/transition.d.ts +3 -2
  95. package/dist/transitions/strip/transition.d.ts.map +1 -1
  96. package/dist/transitions/zoom/index.d.ts +3 -2
  97. package/dist/transitions/zoom/index.d.ts.map +1 -1
  98. package/dist/transitions/zoom/provider/blur.d.ts +2 -0
  99. package/dist/transitions/zoom/provider/blur.d.ts.map +1 -1
  100. package/dist/transitions/zoom/provider/expand.d.ts +1 -0
  101. package/dist/transitions/zoom/provider/expand.d.ts.map +1 -1
  102. package/dist/transitions/zoom/provider/static.d.ts +1 -0
  103. package/dist/transitions/zoom/provider/static.d.ts.map +1 -1
  104. package/dist/transitions/zoom/transition.d.ts +2 -3
  105. package/dist/transitions/zoom/transition.d.ts.map +1 -1
  106. package/dist/transitions/zoom/types.d.ts +2 -0
  107. package/dist/transitions/zoom/types.d.ts.map +1 -1
  108. package/dist/types/index.d.ts +5 -3
  109. package/dist/types/index.d.ts.map +1 -1
  110. package/dist/types.cjs +1 -1
  111. package/dist/types.js +2 -4
  112. package/package.json +1 -1
  113. package/dist/multi-animation-B5hEmEgN.cjs +0 -1
  114. package/dist/multi-animation-DyZGEfKy.js +0 -383
  115. package/dist/page-motion-gH3WomQO.cjs +0 -1
  116. package/dist/page-motion-wmW7PW6B.js +0 -204
  117. package/dist/timeline-L_vXntmP.js +0 -68
  118. package/dist/timeline-Zoo1I4XU.cjs +0 -1
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 _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;
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-hDUcfD7W.cjs"),Xe=require("./provider-D9Q2URox.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 qe=(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"]),$e=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},Ge=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 Ke(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 Ue=768,Ve=10,Ye=10;function je(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<Ue},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)&&_<Ve&&(_++,requestAnimationFrame(W))};requestAnimationFrame(W)};return{initializeContext:(b,w,x)=>{h=!0;const M=m===w?P:++P;y=b,e||(e=$e(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>=Ye?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?Ge(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,Ze=600;function Je(){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},Ze)},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 Qe(){if(typeof window>"u")return Le;const n=window.navigation,t=window;let e=ue.get(t);e||(e=et(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 et(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 tt(){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=Qe(),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 nt(){const n=tt(),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 ot(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 rt={},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: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 st(){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)}it(e)});const n=()=>{Q==null||Q.observe(document.body,{childList:!0,subtree:!0})};document.body?n():document.addEventListener("DOMContentLoaded",n,{once:!0})}function lt(n,t,e=rt){st();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 ct(){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 at(n,t){const e=j(n),o={accounted:e,reactHidden:e===te,onHide:t.onHide,onShow:t.onShow};return pe.set(n,o),ct().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 ut(n,t={}){const{transitions:e=[],middleware:o=(r,l)=>({from:r,to:l})}=n,c=t.host??new _e,i={},p=ot({keepCurrent:({current:r,next:l})=>r.element.contains(l.element)}),s=nt(),y=typeof e=="function"?e:()=>e,u=Je();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}=je({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,qe(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):{});Ke({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=at(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)}lt(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",dt=`[${Ne}]`,ne="data-ssgoi-transition",Me=`[${ne}]`,ft="[data-ssgoi-clone]";function pt(){return typeof MutationObserver<"u"&&typeof HTMLElement<"u"&&typeof Node<"u"}function ht(n){return n.nodeType===Node.ELEMENT_NODE}function yt(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 mt(n,t){if(!pt())return()=>{};n.setAttribute(Ne,"");const e=s=>s.closest(dt)===n,o=s=>!yt(s)||!e(s)||s.closest(ft)||s.getAttribute(ne)===null?null:s,c=(s,y)=>{if(ht(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.simulate=Xe.simulate;exports.HostAnimation=_e;exports.createSggoiTransitionContext=ut;exports.observeSsgoiTransitions=mt;
@@ -1,5 +1,6 @@
1
1
  export { createSggoiTransitionContext } from './ssgoi-transition/create-ssgoi-transition-context';
2
2
  export { observeSsgoiTransitions } from './ssgoi-transition/observe-ssgoi-transitions';
3
3
  export { Animation, WebAnimation, MultiAnimation, HostAnimation, } from './animation';
4
+ export { simulate } from './runtime/timeline';
4
5
  export type { SsgoiConfig, SsgoiContext, SsgoiTransitionRule, SsgoiOnTransitionRule, SsgoiPairTransitionRule, SsgoiOrderedTransitionRule, PathPatterns, NavigationDirection, TransitionConfig, PrepareArgs, AnimationFactoryArgs, CreateElement, SsgoiTransitionContext, Pose, Timeline, } from './types/index.ts';
5
6
  //# sourceMappingURL=internal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/lib/internal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oDAAoD,CAAC;AAClG,OAAO,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AACvF,OAAO,EACL,SAAS,EACT,YAAY,EACZ,cAAc,EACd,aAAa,GACd,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,oBAAoB,EACpB,aAAa,EACb,sBAAsB,EACtB,IAAI,EACJ,QAAQ,GACT,MAAM,QAAQ,CAAC"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/lib/internal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,oDAAoD,CAAC;AAClG,OAAO,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AACvF,OAAO,EACL,SAAS,EACT,YAAY,EACZ,cAAc,EACd,aAAa,GACd,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,YAAY,EACV,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,oBAAoB,EACpB,aAAa,EACb,sBAAsB,EACtB,IAAI,EACJ,QAAQ,GACT,MAAM,QAAQ,CAAC"}
package/dist/internal.js CHANGED
@@ -2,8 +2,9 @@ var We = Object.defineProperty;
2
2
  var Be = (n, t, e) => t in n ? We(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
3
  var Y = (n, t, e) => Be(n, typeof t != "symbol" ? t + "" : t, e);
4
4
  import { n as be, r as Fe } from "./resolve-transition-rule-DbkMu0rm.js";
5
- import { A as ze } from "./multi-animation-DyZGEfKy.js";
6
- import { M as Tt, W as kt } from "./multi-animation-DyZGEfKy.js";
5
+ import { A as ze } from "./multi-animation-Du9W3ZS_.js";
6
+ import { M as Tt, W as kt } from "./multi-animation-Du9W3ZS_.js";
7
+ import { s as Rt } from "./provider-Cea0Pfm1.js";
7
8
  class Xe extends ze {
8
9
  constructor() {
9
10
  super(...arguments);
@@ -924,5 +925,6 @@ export {
924
925
  Tt as MultiAnimation,
925
926
  kt as WebAnimation,
926
927
  wt as createSggoiTransitionContext,
927
- Et as observeSsgoiTransitions
928
+ Et as observeSsgoiTransitions,
929
+ Rt as simulate
928
930
  };
@@ -0,0 +1,4 @@
1
+ export { withOverride } from './with-override';
2
+ export { spring, easeIn, scale, describeIntegrator, ScaledIntegrator, type SpringInput, type EaseInInput, type IntegratorDescription, } from './spring';
3
+ export { smooth, snappy, bouncy, gentle, swift, accelerate } from './presets';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/motion/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EACL,MAAM,EACN,MAAM,EACN,KAAK,EACL,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,qBAAqB,GAC3B,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC"}
@@ -0,0 +1,13 @@
1
+ /** No overshoot, the default arriving feel. */
2
+ export declare const smooth: import('..').Integrator;
3
+ /** Short travel with a hint of elasticity for tab swaps. */
4
+ export declare const snappy: import('..').Integrator;
5
+ /** Visible overshoot for emphasis. */
6
+ export declare const bouncy: import('..').Integrator;
7
+ /** No overshoot for large surfaces such as sheets. */
8
+ export declare const gentle: import('..').Integrator;
9
+ /** No overshoot for opacity, blur, and fast exits. */
10
+ export declare const swift: import('..').Integrator;
11
+ /** Accelerating fall-away for outgoing surfaces. Reaches target in 0.20 s. */
12
+ export declare const accelerate: import('..').Integrator;
13
+ //# sourceMappingURL=presets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../../src/lib/motion/presets.ts"],"names":[],"mappings":"AAYA,+CAA+C;AAC/C,eAAO,MAAM,MAAM,yBAGjB,CAAC;AAEH,4DAA4D;AAC5D,eAAO,MAAM,MAAM,yBAGjB,CAAC;AAEH,sCAAsC;AACtC,eAAO,MAAM,MAAM,yBAGjB,CAAC;AAEH,sDAAsD;AACtD,eAAO,MAAM,MAAM,yBAGjB,CAAC;AAEH,sDAAsD;AACtD,eAAO,MAAM,KAAK,yBAGhB,CAAC;AAEH,8EAA8E;AAC9E,eAAO,MAAM,UAAU,yBAA4B,CAAC"}
@@ -0,0 +1,46 @@
1
+ import { SpringConfig } from '../types/index.ts';
2
+ import { Integrator, IntegratorState } from '../animation/integrator';
3
+ export declare function durationBounceToSpring(duration: number, bounce?: number): {
4
+ stiffness: number;
5
+ damping: number;
6
+ };
7
+ export declare function springToDurationBounce(stiffness: number, damping: number): {
8
+ duration: number;
9
+ bounce: number;
10
+ zeta: number;
11
+ };
12
+ export type SpringInput = SpringConfig;
13
+ /** Build a stateless spring from stiffness, damping and optional follower physics. */
14
+ export declare function spring(input: SpringInput): Integrator;
15
+ export type EaseInInput = {
16
+ /** Seconds until the value reaches its target. */
17
+ duration: number;
18
+ /** Quadratic drag; higher = lower terminal velocity. @default 1.5 */
19
+ resistance?: number;
20
+ restDelta?: number;
21
+ };
22
+ /**
23
+ * Accelerating ("ease-in") motion for outgoing surfaces. The acceleration is
24
+ * solved numerically so the 0 → 1 travel takes `duration` seconds under the
25
+ * given drag, at ssgoi's 60 fps simulation step.
26
+ */
27
+ export declare function easeIn(input: EaseInInput): Integrator;
28
+ export declare class ScaledIntegrator implements Integrator {
29
+ readonly inner: Integrator;
30
+ readonly factor: number;
31
+ constructor(inner: Integrator, factor: number);
32
+ step(state: IntegratorState, target: number, dt: number): IntegratorState;
33
+ isSettled(state: IntegratorState, target: number): boolean;
34
+ }
35
+ export declare function scale(integrator: Integrator, factor: number): Integrator;
36
+ export type IntegratorDescription = {
37
+ kind: "spring" | "double-spring" | "inertia" | "scaled" | "custom";
38
+ /** Perceptual duration in seconds (springs only). */
39
+ duration?: number;
40
+ bounce?: number;
41
+ zeta?: number;
42
+ /** Time until ssgoi considers the 0 → 1 run settled, in ms. */
43
+ settleMs: number;
44
+ };
45
+ export declare function describeIntegrator(integrator: Integrator): IntegratorDescription;
46
+ //# sourceMappingURL=spring.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spring.d.ts","sourceRoot":"","sources":["../../src/lib/motion/spring.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,EAKL,KAAK,UAAU,EACf,KAAK,eAAe,EACrB,MAAM,yBAAyB,CAAC;AAiBjC,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,EAChB,MAAM,SAAI,GACT;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAWxC;AAED,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GACd;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAMpD;AAED,MAAM,MAAM,WAAW,GAAG,YAAY,CAAC;AAEvC,sFAAsF;AACtF,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,UAAU,CAgBrD;AAMD,MAAM,MAAM,WAAW,GAAG;IACxB,kDAAkD;IAClD,QAAQ,EAAE,MAAM,CAAC;IACjB,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAWF;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,UAAU,CAkBrD;AAYD,qBAAa,gBAAiB,YAAW,UAAU;IAE/C,QAAQ,CAAC,KAAK,EAAE,UAAU;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM;gBADd,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,MAAM;IAMzB,IAAI,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,eAAe;IAczE,SAAS,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO;CAM3D;AAED,wBAAgB,KAAK,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,UAAU,CAExE;AAMD,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,QAAQ,GAAG,eAAe,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;IACnE,qDAAqD;IACrD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+DAA+D;IAC/D,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,UAAU,GACrB,qBAAqB,CAgCvB"}
@@ -0,0 +1,2 @@
1
+ export { withOverride } from '../transition/define-transition';
2
+ //# sourceMappingURL=with-override.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with-override.d.ts","sourceRoot":"","sources":["../../src/lib/motion/with-override.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC"}