@ssgoi/core 7.0.2-beta → 7.0.3
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/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 MeurSyphus
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var te=Object.defineProperty;var ee=(e,t,n)=>t in e?te(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var E=(e,t,n)=>ee(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./multi-animation-6124HEke.cjs");class U{constructor(t){E(this,"omega");E(this,"zeta");E(this,"restDelta");E(this,"restSpeed");const{stiffness:n,damping:i}=t,s=1;this.omega=Math.sqrt(n/s),this.zeta=i/(2*Math.sqrt(n*s)),this.restDelta=t.restDelta??m.POSITION_THRESHOLD,this.restSpeed=t.restSpeed??m.VELOCITY_THRESHOLD}step(t,n,i){const s=Math.min(i,.033),{omega:o,zeta:r}=this,{position:l,velocity:c}=t,a=-2*s*r*o*c,p=s*o*o*(n-l),u=c+a+p;return{position:l+s*u,velocity:u}}isSettled(t,n){const i=Math.abs(n-t.position),s=Math.abs(t.velocity);return i<this.restDelta&&s<this.restSpeed}}class ne{constructor(t){E(this,"leader");E(this,"follower");E(this,"restDelta");E(this,"restSpeed");this.restDelta=t.restDelta??m.POSITION_THRESHOLD,this.restSpeed=t.restSpeed??m.VELOCITY_THRESHOLD,this.leader=new U({stiffness:t.stiffness,damping:t.damping,restDelta:this.restDelta,restSpeed:this.restSpeed});let n,i,s,o;typeof t.follower=="number"?(n=t.stiffness*t.follower,i=t.damping):t.follower?(n=t.follower.stiffness,i=t.follower.damping,s=t.follower.restDelta,o=t.follower.restSpeed):(n=t.stiffness,i=t.damping),this.follower=new U({stiffness:n,damping:i,restDelta:s??this.restDelta,restSpeed:o??this.restSpeed})}step(t,n,i){const o=t._leader??{position:t.position,velocity:t.velocity},r=this.leader.step(o,n,i),l=this.follower.step(t,r.position,i);return{position:l.position,velocity:l.velocity,_leader:r}}isSettled(t,n){const i=t,s=Math.abs(n-t.position)<this.restDelta&&Math.abs(t.velocity)<this.restSpeed;return i._leader?Math.abs(n-i._leader.position)<this.restDelta&&Math.abs(i._leader.velocity)<this.restSpeed&&s:s}}const ie=.01,se=500,oe=10;class re{constructor(t){E(this,"acceleration");E(this,"resistance");E(this,"resistanceType");E(this,"min");E(this,"max");E(this,"bounceStiffness");E(this,"bounceDamping");E(this,"restDelta");this.acceleration=t.acceleration,this.resistance=t.resistance,this.resistanceType=t.resistanceType??"quadratic",this.min=t.min,this.max=t.max,this.bounceStiffness=t.bounceStiffness??se,this.bounceDamping=t.bounceDamping??oe,this.restDelta=t.restDelta??ie}step(t,n,i){const s=Math.min(i,.033),{acceleration:o,resistance:r,resistanceType:l,min:c,max:a}=this,{position:p,velocity:u}=t,d=c!==void 0&&p<c,h=a!==void 0&&p>a;let f;if(d||h){const b=p-(d?c:a),$=-this.bounceStiffness*b,x=-this.bounceDamping*u;f=$+x}else{const S=n>p?1:-1;let b;l==="linear"?b=r*u:b=r*u*Math.abs(u),f=S*o-b}const y=u+f*s;let g=p+y*s;if(!d&&!h){const S=n>p?1:-1;(S>0&&g>n||S<0&&g<n)&&(g=n)}return{position:g,velocity:g===n?0:y}}isSettled(t,n){return Math.abs(n-t.position)<this.restDelta}}class w{static from(t){if(t.spring&&t.inertia)throw new Error("Cannot use both 'spring' and 'inertia' together. Choose one physics type.");if(t.inertia)return new re({acceleration:t.inertia.acceleration,resistance:t.inertia.resistance,resistanceType:t.inertia.resistanceType,min:t.inertia.min,max:t.inertia.max,bounceStiffness:t.inertia.bounceStiffness,bounceDamping:t.inertia.bounceDamping,restDelta:t.inertia.restDelta});const n=t.spring??{stiffness:300,damping:30};if(n.doubleSpring){const i=n.doubleSpring;let s;return typeof i=="number"?s=i:typeof i=="object"&&(s={stiffness:i.stiffness,damping:i.damping}),new ne({stiffness:n.stiffness,damping:n.damping,follower:s,restDelta:n.restDelta,restSpeed:n.restSpeed})}return new U({stiffness:n.stiffness,damping:n.damping,restDelta:n.restDelta,restSpeed:n.restSpeed})}static fromSpring(t){return w.from({spring:t})}}class ae{constructor(t){E(this,"durationSec");this.durationSec=Math.max(1/60,t.durationSec)}step(t,n,i){const s=n-t.position;if(s===0)return t;const o=Math.sign(s),r=Math.abs(s)/this.durationSec,l=o*r*i,c=t.position+l;return(o>0?c>=n:c<=n)?{position:n,velocity:0}:{position:c,velocity:o*r}}isSettled(t,n){return Math.abs(t.position-n)<m.POSITION_THRESHOLD}}function Y(e,t){function n(o){let r=0,l=0;const c=o.offsetWidth,a=o.offsetHeight;let p=o;for(;p;)r+=p.offsetTop,l+=p.offsetLeft,p=p.offsetParent;return r-=window.scrollY,l-=window.scrollX,{top:r,left:l,width:c,height:a}}const i=n(e),s=n(t);return new DOMRect(s.left-i.left,s.top-i.top,s.width,s.height)}function N(e,t){const n=e.getBoundingClientRect(),i=t.getBoundingClientRect(),s=e.offsetWidth>0?n.width/e.offsetWidth:1,o=e.offsetHeight>0?n.height/e.offsetHeight:1;return new DOMRect((i.left-n.left)/s,(i.top-n.top)/o,i.width/s,i.height/o)}function T(e,t){const{scrollingElement:n,positionedParent:i}=e,s=n!==i&&n.contains(i)?Y(n,i).top:0;return{top:e[t].scroll.y,left:0,width:n.clientWidth,height:n.clientHeight-s}}function Lt(e,t){const{scrollingElement:n,positionedParent:i}=e,s=n!==i&&n.contains(i)?Y(n,i).top:0;return{top:e[t].scroll.y-s,height:n.clientHeight}}const ct=8,pt={spring:{stiffness:600,damping:40,doubleSpring:1.2}};function le({direction:e}){const t=e==="forward"?ct:-ct;return{out:{willChange:"transform, opacity",startStyle:{},animate:n=>({opacity:`${1-n}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(${t}px, 0, 0)`,opacity:"0"},animate:n=>({transform:`translate3d(${t*(1-n)}px, 0, 0)`,opacity:`${n}`})}}}function ce(){return{outPhysics:pt,inPhysics:pt,composition:{mode:"parallel",startAt:[0,0]},build:le}}const ut=30,pe={inertia:{acceleration:150,resistance:1.5,restDelta:.1}},ue={spring:{stiffness:180,damping:34,restDelta:.1,restSpeed:.1}};function de({direction:e}){const t=e==="forward"?1:-1,n=-ut*t,i=ut*t;return{out:{willChange:"transform, opacity",startStyle:{},animate:s=>({transform:`translate3d(${n*s}px, 0, 0)`,opacity:`${1-s}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(${i}px, 0, 0)`,opacity:"0"},animate:s=>({transform:`translate3d(${i*(1-s)}px, 0, 0)`,opacity:`${s}`})}}}function fe(){return{outPhysics:pe,inPhysics:ue,composition:{mode:"sequence"},build:de}}const he={snappy:ce(),fluid:fe()},dt=8,ye={inertia:{acceleration:150,resistance:1.5,restDelta:.1}},me={spring:{stiffness:180,damping:34,restDelta:.1,restSpeed:.1}};function ge({direction:e}){const t=e==="forward"?1:-1,n=-dt*t,i=dt*t;return{out:{willChange:"transform, opacity",startStyle:{},animate:s=>({transform:`translate3d(0, ${n*s}px, 0)`,opacity:`${1-s}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(0, ${i}px, 0)`,opacity:"0"},animate:s=>({transform:`translate3d(0, ${i*(1-s)}px, 0)`,opacity:`${s}`})}}}function be(){return{outPhysics:ye,inPhysics:me,composition:{mode:"sequence"},build:ge}}const we=8,Se={inertia:{acceleration:150,resistance:1.5,restDelta:.1}},xe={spring:{stiffness:180,damping:34,restDelta:.1,restSpeed:.1}};function Ce(e){const t=we;return{out:{willChange:"opacity",startStyle:{},animate:n=>({opacity:`${1-n}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(0, ${t}px, 0)`,opacity:"0"},animate:n=>({transform:`translate3d(0, ${t*(1-n)}px, 0)`,opacity:`${n}`})}}}function $e(){return{outPhysics:Se,inPhysics:xe,composition:{mode:"sequence"},build:Ce}}const ft=be(),Ee={snappy:ft,directional:ft,"non-directional":$e()},ht={spring:{stiffness:280,damping:30,restDelta:.1,restSpeed:.1}},X=.1,B=1/3,yt=e=>Math.max(0,Math.min(1,e));function Ae({direction:e}){const t=e==="forward"?1:-1,n=1-t*X;return{out:{willChange:"transform, opacity",startStyle:{},animate:i=>({transform:`scale(${1+t*i*X})`,opacity:`${yt(1-i/B)}`})},in:{willChange:"transform, opacity",startStyle:{transform:`scale(${n})`,opacity:"0"},animate:i=>({transform:`scale(${n+t*i*X})`,opacity:`${yt((i-B)/(1-B))}`})}}}function Pe(){return{outPhysics:ht,inPhysics:ht,composition:{mode:"parallel"},build:Ae}}const mt={spring:{stiffness:280,damping:30,restDelta:.1,restSpeed:.1}},Z=.1,G=1/3,gt=e=>Math.max(0,Math.min(1,e));function _e(){return{out:{willChange:"opacity",startStyle:{},animate:e=>({opacity:`${gt(1-e/G)}`})},in:{willChange:"transform, opacity",startStyle:{transform:`scale(${1-Z})`,opacity:"0"},animate:e=>({transform:`scale(${1-Z+e*Z})`,opacity:`${gt((e-G)/(1-G))}`})}}}function Ie(){return{outPhysics:mt,inPhysics:mt,composition:{mode:"parallel"},build:_e}}const bt=Pe(),Re={snappy:bt,directional:bt,"non-directional":Ie()},Oe={x:he,y:Ee,z:Re};function ve(e,t){const n=Oe[e];return n[t]??n.snappy}const Te="x",De="snappy";function wt(e,t){e.style.willChange=t.willChange,e.style.backfaceVisibility="hidden",e.style.contain="layout paint";for(const[n,i]of Object.entries(t.startStyle))e.style[n]=i}function Yt(e){e.style.willChange="auto",e.style.backfaceVisibility="",e.style.contain="",e.style.transform="",e.style.opacity="",e.style.clipPath=""}function Fe(e){Yt(e),e.style.pointerEvents=""}const Me=(e={})=>{const t=e.type??Te,n=e.feel??De,i=ve(t,n);return{prepare:({from:s,to:o,context:r})=>{const l=i.build({direction:r.direction});return s.then(c=>{wt(c,l.out),c.style.pointerEvents="none"}),o.then(c=>{wt(c,l.in)}),{}},animation:({from:s,to:o,context:r})=>{const l=i.build({direction:r.direction});if(t==="z"){const p=T(r,"from"),u=T(r,"to");s.style.clipPath=`inset(${p.top}px 0 calc(100% - ${p.top+p.height}px) 0)`,o.style.clipPath=`inset(${u.top}px 0 calc(100% - ${u.top+u.height}px) 0)`}const c=new m.WebAnimation({element:s,integrator:w.from(i.outPhysics),style:p=>l.out.animate(p),onComplete:()=>Fe(s)}),a=new m.WebAnimation({element:o,integrator:w.from(i.inPhysics),style:p=>l.in.animate(p),onComplete:()=>Yt(o)});return new m.MultiAnimation([c,a],i.composition)}}};function Le(e,t,n){return e==="y"?t==="non-directional"?"non-directional":"directional":e!=="x"||t==="snappy"||n==="snappy"?"snappy":"fluid"}function Ye(e={}){const t=e.type??"x",n=e.variant,i=e.feel,s=Le(t,n,i);return Me({type:t,feel:s})}const ke={spring:{stiffness:200,damping:22}},He=10,Ne="horizontal",We="#000000";function St(e,t,n,i,s,o){window.getComputedStyle(e).position==="static"&&(e.style.position="relative");const l=document.createElement("div");l.style.cssText=`
|
|
1
|
+
"use strict";var te=Object.defineProperty;var ee=(e,t,n)=>t in e?te(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var E=(e,t,n)=>ee(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./multi-animation-6124HEke.cjs");class U{constructor(t){E(this,"omega");E(this,"zeta");E(this,"restDelta");E(this,"restSpeed");const{stiffness:n,damping:i}=t,s=1;this.omega=Math.sqrt(n/s),this.zeta=i/(2*Math.sqrt(n*s)),this.restDelta=t.restDelta??m.POSITION_THRESHOLD,this.restSpeed=t.restSpeed??m.VELOCITY_THRESHOLD}step(t,n,i){const s=Math.min(i,.033),{omega:o,zeta:r}=this,{position:l,velocity:c}=t,a=-2*s*r*o*c,p=s*o*o*(n-l),u=c+a+p;return{position:l+s*u,velocity:u}}isSettled(t,n){const i=Math.abs(n-t.position),s=Math.abs(t.velocity);return i<this.restDelta&&s<this.restSpeed}}class ne{constructor(t){E(this,"leader");E(this,"follower");E(this,"restDelta");E(this,"restSpeed");this.restDelta=t.restDelta??m.POSITION_THRESHOLD,this.restSpeed=t.restSpeed??m.VELOCITY_THRESHOLD,this.leader=new U({stiffness:t.stiffness,damping:t.damping,restDelta:this.restDelta,restSpeed:this.restSpeed});let n,i,s,o;typeof t.follower=="number"?(n=t.stiffness*t.follower,i=t.damping):t.follower?(n=t.follower.stiffness,i=t.follower.damping,s=t.follower.restDelta,o=t.follower.restSpeed):(n=t.stiffness,i=t.damping),this.follower=new U({stiffness:n,damping:i,restDelta:s??this.restDelta,restSpeed:o??this.restSpeed})}step(t,n,i){const o=t._leader??{position:t.position,velocity:t.velocity},r=this.leader.step(o,n,i),l=this.follower.step(t,r.position,i);return{position:l.position,velocity:l.velocity,_leader:r}}isSettled(t,n){const i=t,s=Math.abs(n-t.position)<this.restDelta&&Math.abs(t.velocity)<this.restSpeed;return i._leader?Math.abs(n-i._leader.position)<this.restDelta&&Math.abs(i._leader.velocity)<this.restSpeed&&s:s}}const ie=.01,se=500,oe=10;class re{constructor(t){E(this,"acceleration");E(this,"resistance");E(this,"resistanceType");E(this,"min");E(this,"max");E(this,"bounceStiffness");E(this,"bounceDamping");E(this,"restDelta");this.acceleration=t.acceleration,this.resistance=t.resistance,this.resistanceType=t.resistanceType??"quadratic",this.min=t.min,this.max=t.max,this.bounceStiffness=t.bounceStiffness??se,this.bounceDamping=t.bounceDamping??oe,this.restDelta=t.restDelta??ie}step(t,n,i){const s=Math.min(i,.033),{acceleration:o,resistance:r,resistanceType:l,min:c,max:a}=this,{position:p,velocity:u}=t,d=c!==void 0&&p<c,h=a!==void 0&&p>a;let f;if(d||h){const b=p-(d?c:a),$=-this.bounceStiffness*b,x=-this.bounceDamping*u;f=$+x}else{const S=n>p?1:-1;let b;l==="linear"?b=r*u:b=r*u*Math.abs(u),f=S*o-b}const y=u+f*s;let g=p+y*s;if(!d&&!h){const S=n>p?1:-1;(S>0&&g>n||S<0&&g<n)&&(g=n)}return{position:g,velocity:g===n?0:y}}isSettled(t,n){return Math.abs(n-t.position)<this.restDelta}}class w{static from(t){if(t.spring&&t.inertia)throw new Error("Cannot use both 'spring' and 'inertia' together. Choose one physics type.");if(t.inertia)return new re({acceleration:t.inertia.acceleration,resistance:t.inertia.resistance,resistanceType:t.inertia.resistanceType,min:t.inertia.min,max:t.inertia.max,bounceStiffness:t.inertia.bounceStiffness,bounceDamping:t.inertia.bounceDamping,restDelta:t.inertia.restDelta});const n=t.spring??{stiffness:300,damping:30};if(n.doubleSpring){const i=n.doubleSpring;let s;return typeof i=="number"?s=i:typeof i=="object"&&(s={stiffness:i.stiffness,damping:i.damping}),new ne({stiffness:n.stiffness,damping:n.damping,follower:s,restDelta:n.restDelta,restSpeed:n.restSpeed})}return new U({stiffness:n.stiffness,damping:n.damping,restDelta:n.restDelta,restSpeed:n.restSpeed})}static fromSpring(t){return w.from({spring:t})}}class ae{constructor(t){E(this,"durationSec");this.durationSec=Math.max(1/60,t.durationSec)}step(t,n,i){const s=n-t.position;if(s===0)return t;const o=Math.sign(s),r=Math.abs(s)/this.durationSec,l=o*r*i,c=t.position+l;return(o>0?c>=n:c<=n)?{position:n,velocity:0}:{position:c,velocity:o*r}}isSettled(t,n){return Math.abs(t.position-n)<m.POSITION_THRESHOLD}}function Y(e,t){function n(o){let r=0,l=0;const c=o.offsetWidth,a=o.offsetHeight;let p=o;for(;p;)r+=p.offsetTop,l+=p.offsetLeft,p=p.offsetParent;return r-=window.scrollY,l-=window.scrollX,{top:r,left:l,width:c,height:a}}const i=n(e),s=n(t);return new DOMRect(s.left-i.left,s.top-i.top,s.width,s.height)}function N(e,t){const n=e.getBoundingClientRect(),i=t.getBoundingClientRect(),s=e.offsetWidth>0?n.width/e.offsetWidth:1,o=e.offsetHeight>0?n.height/e.offsetHeight:1;return new DOMRect((i.left-n.left)/s,(i.top-n.top)/o,i.width/s,i.height/o)}function T(e,t){const{scrollingElement:n,positionedParent:i}=e,s=n!==i&&n.contains(i)?Y(n,i).top:0;return{top:e[t].scroll.y,left:0,width:n.clientWidth,height:n.clientHeight-s}}function Lt(e,t){const{scrollingElement:n,positionedParent:i}=e,s=n!==i&&n.contains(i)?Y(n,i).top:0;return{top:e[t].scroll.y-s,height:n.clientHeight}}const ct=8,pt={spring:{stiffness:600,damping:40,doubleSpring:1.2}};function le({direction:e}){const t=e==="forward"?ct:-ct;return{out:{willChange:"transform, opacity",startStyle:{},animate:n=>({opacity:`${1-n}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(${t}px, 0, 0)`,opacity:"0"},animate:n=>({transform:`translate3d(${t*(1-n)}px, 0, 0)`,opacity:`${n}`})}}}function ce(){return{outPhysics:pt,inPhysics:pt,composition:{mode:"parallel",startAt:[0,0]},build:le}}const ut=30,pe={inertia:{acceleration:150,resistance:1.5,restDelta:.1}},ue={spring:{stiffness:180,damping:34,restDelta:.1,restSpeed:.1}};function de({direction:e}){const t=e==="forward"?1:-1,n=-ut*t,i=ut*t;return{out:{willChange:"transform, opacity",startStyle:{},animate:s=>({transform:`translate3d(${n*s}px, 0, 0)`,opacity:`${1-s}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(${i}px, 0, 0)`,opacity:"0"},animate:s=>({transform:`translate3d(${i*(1-s)}px, 0, 0)`,opacity:`${s}`})}}}function fe(){return{outPhysics:pe,inPhysics:ue,composition:{mode:"sequence"},build:de}}const he={snappy:ce(),fluid:fe()},dt=8,ye={inertia:{acceleration:150,resistance:1.5,restDelta:.1}},me={spring:{stiffness:180,damping:34,restDelta:.1,restSpeed:.1}};function ge({direction:e}){const t=e==="forward"?1:-1,n=-dt*t,i=dt*t;return{out:{willChange:"transform, opacity",startStyle:{},animate:s=>({transform:`translate3d(0, ${n*s}px, 0)`,opacity:`${1-s}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(0, ${i}px, 0)`,opacity:"0"},animate:s=>({transform:`translate3d(0, ${i*(1-s)}px, 0)`,opacity:`${s}`})}}}function be(){return{outPhysics:ye,inPhysics:me,composition:{mode:"sequence"},build:ge}}const we=40,Se={inertia:{acceleration:150,resistance:1.5,restDelta:.1}},xe={spring:{stiffness:400,damping:30,doubleSpring:1.2,restDelta:.1,restSpeed:.1}};function Ce(e){const t=we;return{out:{willChange:"opacity",startStyle:{},animate:n=>({opacity:`${1-n}`})},in:{willChange:"transform, opacity",startStyle:{transform:`translate3d(0, ${t}px, 0)`,opacity:"0"},animate:n=>({transform:`translate3d(0, ${t*(1-n)}px, 0)`,opacity:`${n}`})}}}function $e(){return{outPhysics:Se,inPhysics:xe,composition:{mode:"parallel",startAt:[0,0]},build:Ce}}const ft=be(),Ee={snappy:ft,directional:ft,"non-directional":$e()},ht={spring:{stiffness:280,damping:30,restDelta:.1,restSpeed:.1}},X=.1,B=1/3,yt=e=>Math.max(0,Math.min(1,e));function Ae({direction:e}){const t=e==="forward"?1:-1,n=1-t*X;return{out:{willChange:"transform, opacity",startStyle:{},animate:i=>({transform:`scale(${1+t*i*X})`,opacity:`${yt(1-i/B)}`})},in:{willChange:"transform, opacity",startStyle:{transform:`scale(${n})`,opacity:"0"},animate:i=>({transform:`scale(${n+t*i*X})`,opacity:`${yt((i-B)/(1-B))}`})}}}function Pe(){return{outPhysics:ht,inPhysics:ht,composition:{mode:"parallel"},build:Ae}}const mt={spring:{stiffness:280,damping:30,restDelta:.1,restSpeed:.1}},Z=.1,G=1/3,gt=e=>Math.max(0,Math.min(1,e));function _e(){return{out:{willChange:"opacity",startStyle:{},animate:e=>({opacity:`${gt(1-e/G)}`})},in:{willChange:"transform, opacity",startStyle:{transform:`scale(${1-Z})`,opacity:"0"},animate:e=>({transform:`scale(${1-Z+e*Z})`,opacity:`${gt((e-G)/(1-G))}`})}}}function Ie(){return{outPhysics:mt,inPhysics:mt,composition:{mode:"parallel"},build:_e}}const bt=Pe(),Re={snappy:bt,directional:bt,"non-directional":Ie()},Oe={x:he,y:Ee,z:Re};function ve(e,t){const n=Oe[e];return n[t]??n.snappy}const Te="x",De="snappy";function wt(e,t){e.style.willChange=t.willChange,e.style.backfaceVisibility="hidden",e.style.contain="layout paint";for(const[n,i]of Object.entries(t.startStyle))e.style[n]=i}function Yt(e){e.style.willChange="auto",e.style.backfaceVisibility="",e.style.contain="",e.style.transform="",e.style.opacity="",e.style.clipPath=""}function Fe(e){Yt(e),e.style.pointerEvents=""}const Me=(e={})=>{const t=e.type??Te,n=e.feel??De,i=ve(t,n);return{prepare:({from:s,to:o,context:r})=>{const l=i.build({direction:r.direction});return s.then(c=>{wt(c,l.out),c.style.pointerEvents="none"}),o.then(c=>{wt(c,l.in)}),{}},animation:({from:s,to:o,context:r})=>{const l=i.build({direction:r.direction});if(t==="z"){const p=T(r,"from"),u=T(r,"to");s.style.clipPath=`inset(${p.top}px 0 calc(100% - ${p.top+p.height}px) 0)`,o.style.clipPath=`inset(${u.top}px 0 calc(100% - ${u.top+u.height}px) 0)`}const c=new m.WebAnimation({element:s,integrator:w.from(i.outPhysics),style:p=>l.out.animate(p),onComplete:()=>Fe(s)}),a=new m.WebAnimation({element:o,integrator:w.from(i.inPhysics),style:p=>l.in.animate(p),onComplete:()=>Yt(o)});return new m.MultiAnimation([c,a],i.composition)}}};function Le(e,t,n){return e==="y"?t==="non-directional"?"non-directional":"directional":e!=="x"||t==="snappy"||n==="snappy"?"snappy":"fluid"}function Ye(e={}){const t=e.type??"x",n=e.variant,i=e.feel,s=Le(t,n,i);return Me({type:t,feel:s})}const ke={spring:{stiffness:200,damping:22}},He=10,Ne="horizontal",We="#000000";function St(e,t,n,i,s,o){window.getComputedStyle(e).position==="static"&&(e.style.position="relative");const l=document.createElement("div");l.style.cssText=`
|
|
2
2
|
position: absolute;
|
|
3
3
|
top: 0;
|
|
4
4
|
left: 0;
|
|
@@ -32,4 +32,4 @@
|
|
|
32
32
|
${t.left+t.width}px ${t.top}px,
|
|
33
33
|
${t.left+t.width}px ${t.top+t.height}px,
|
|
34
34
|
${t.left}px ${t.top+t.height}px
|
|
35
|
-
)`}function K(e,t,n,i,s){const o=n/1e3;return new m.WebAnimation({element:e,integrator:new ae({durationSec:o}),lowerBound:0,upperBound:1,style:r=>i(pn(t,r)),onComplete:s})}const fn=(e={})=>{var s;const t=((s=e.border)==null?void 0:s.color)??an,n=rn,i=e.physics;return{prepare:({from:o,to:r,context:l})=>{const c=T(l,"from"),a=T(l,"to"),p=Y(document.body,l.positionedParent),u=dn(t,{...c,top:p.top});for(const d of["topLeft","topRight","bottomLeft","bottomRight"])l.positionedParent.appendChild(u[d]);return o.then(d=>{Et(d,c),At(d,c),d.style.transform=`translateY(${-c.top}px)`}),r.then(d=>{Et(d,a),At(d,a),d.style.transform=`translateY(${-a.top+a.height}px) scale(${n})`}),{borders:u,fromRect:c,toRect:a}},animation:({from:o,to:r,context:l,borders:c,fromRect:a,toRect:p})=>{const u=$t({rect:a,scale:n,direction:"out",override:i}),d=$t({rect:p,scale:n,direction:"in",override:i}),h=K(o,u.snapshots,u.totalDuration,b=>({transform:`translateY(${b.translateY}px) scale(${b.scale})`}),()=>{o.style.clipPath="",o.style.transformOrigin="",o.style.transform=""}),f=K(r,d.snapshots,d.totalDuration,b=>({transform:`translateY(${b.translateY}px) scale(${b.scale})`}),()=>{r.style.clipPath="",r.style.transformOrigin="",r.style.transform=""}),y=un.map(([b,$],x)=>{const C=["topLeft","topRight","bottomLeft","bottomRight"][x];return K(c[C],u.snapshots,u.totalDuration,_=>{const P=(a.width-a.width*_.scale)/2*.7*b,A=(a.height-a.height*_.scale)/2*.7*$;return{transform:`translate(${P}px, ${A}px)`}})}),g=new m.MultiAnimation([h,f,...y],{mode:"parallel"}),S=g.onComplete;return g.onComplete=()=>{S==null||S();const b=l.positionedParent;for(const $ of["topLeft","topRight","bottomLeft","bottomRight"]){const x=c[$];x.parentElement===b&&b.removeChild(x)}},g}}};function hn(e={}){const{options:t}=e,n=(t==null?void 0:t.borderColor)!==void 0?{border:{color:t.borderColor}}:void 0;return fn(n)}function yn(e){if(!e)return null;if(e.includes("/")){const n=e.split("/");if(n.length!==2)return null;const i=Number.parseFloat(n[0]??""),s=Number.parseFloat(n[1]??"");return Number.isFinite(i)&&Number.isFinite(s)&&i>0&&s>0?i/s:null}const t=Number.parseFloat(e);return Number.isFinite(t)&&t>0?t:null}function mn(e){return e==="contain"||e==="cover"?e:null}function st(e){return e.tagName==="IMG"}function gn(e){if(st(e))return e;if(e.tagName==="PICTURE"||e.tagName==="VIDEO")return null;const t=[];for(const n of Array.from(e.children)){const i=n;st(i)&&t.push(i)}return t.length===1?t[0]??null:null}function bn(e){var c,a;if(!st(e))return null;const t=e,n=t.naturalWidth,i=t.naturalHeight;if(typeof n=="number"&&typeof i=="number"&&Number.isFinite(n)&&Number.isFinite(i)&&n>0&&i>0)return n/i;const s=((c=e.getAttribute("width"))==null?void 0:c.trim())??"",o=((a=e.getAttribute("height"))==null?void 0:a.trim())??"",r=s===""?Number.NaN:Number(s),l=o===""?Number.NaN:Number(o);return Number.isFinite(r)&&Number.isFinite(l)&&r>0&&l>0?r/l:null}function wn(e){const t=e.trim().toLowerCase().replace(/\s+/g," ");return t===""||t==="center"||t==="center center"||t==="50% 50%"}function V(e){if(typeof getComputedStyle=="function")try{return getComputedStyle(e)}catch{}return e.style}function Sn(e){const t=V(e),n=wn(t.objectPosition??"");return{fit:n?mn(t.objectFit??null):null,centered:n}}function Ht(e){if(!e)return 0;const t=/^(-?(?:\d+\.?\d*|\.\d+))px$/.exec(e.trim());if(!t)return null;const n=Number.parseFloat(t[1]??"");return Number.isFinite(n)&&n>=0?n:null}function Pt(e){const t=V(e),n=[t.borderTopLeftRadius,t.borderTopRightRadius,t.borderBottomRightRadius,t.borderBottomLeftRadius].map(Ht),i=n[0];if(i==null)return{radius:0,supported:!1};const s=n.every(o=>o!==null&&Math.abs(o-i)<.001);return{radius:s?i:0,supported:s}}function xn(e,t){var s;if(!t)return null;const n=(s=e.getAttribute(t))==null?void 0:s.trim();if(n==null||n==="")return null;const i=Number.parseFloat(n);return Number.isFinite(i)&&i>=0?i:null}function Cn(e){const t=V(e);return[t.paddingTop,t.paddingRight,t.paddingBottom,t.paddingLeft,t.borderTopWidth,t.borderRightWidth,t.borderBottomWidth,t.borderLeftWidth].every(i=>i?Ht(i)===0:!0)}function $n(e){const t=V(e),n=i=>i==="hidden"||i==="clip";return n(t.overflowX)&&n(t.overflowY)}function O(e){return e.left+e.width/2}function v(e){return e.top+e.height/2}function lt(e,t){return{top:Math.max(0,t.top-e.top),right:Math.max(0,e.left+e.width-(t.left+t.width)),bottom:Math.max(0,e.top+e.height-(t.top+t.height)),left:Math.max(0,t.left-e.left)}}function En(e,t){const n=Math.max(e.left,t.left),i=Math.max(e.top,t.top),s=Math.min(e.left+e.width,t.left+t.width),o=Math.min(e.top+e.height,t.top+t.height);return s>n&&o>i?{left:n,top:i,width:s-n,height:o-i}:null}function _t(e,t){return Math.abs(e.left-t.left)<.01&&Math.abs(e.top-t.top)<.01&&Math.abs(e.width-t.width)<.01&&Math.abs(e.height-t.height)<.01}function An(e,t,n){const i=e.width/e.height;let s,o;return n==="contain"?i>t?(o=e.height,s=o*t):(s=e.width,o=s/t):i>t?(s=e.width,o=s/t):(o=e.height,s=o*t),{left:e.left+(e.width-s)/2,top:e.top+(e.height-o)/2,width:s,height:o}}function Nt(e,t,n){const i=t!==null&&n!==null&&e.width>0&&e.height>0?An(e,t,n):e,s=n==="contain"?i:e;return{bbox:e,content:i,window:s,clipInset:lt(i,s),aspectRatio:t,fit:n,radius:0,radiusSource:"none",bboxRadius:0,bboxRadiusSource:"none",contentAware:t!==null&&n!==null,mediaElement:null}}function ot(e,t,n){return{...Nt(e,null,null),radius:t,radiusSource:n,bboxRadius:t,bboxRadiusSource:n}}function Wt(e,t){const n=e.aspectRatio,i=t.aspectRatio;return e.contentAware&&t.contentAware&&n!==null&&i!==null&&Math.abs(n-i)/Math.max(n,i)<.01}function It(e){return ot(e.bbox,e.bboxRadius,e.bboxRadiusSource)}function zt(e,t){return Wt(e,t)?[e,t]:[It(e),It(t)]}function rt(e,t,n,i){const s=gn(e),o=s?n(s):t,r=i.legacyAspectRatioAttribute?yn(e.getAttribute(i.legacyAspectRatioAttribute)??(s==null?void 0:s.getAttribute(i.legacyAspectRatioAttribute))??null):null,l=r??(s?bn(s):null),c=s?Sn(s):{fit:null,centered:!0},a=c.centered&&(s===null||Cn(s))?c.fit??(r!==null?i.fallbackFit??null:null):null,p=Nt(o,l,a),u=$n(e),h=s!==null&&s!==e&&u?En(p.window,t):p.window,f=xn(e,i.legacyRadiusAttribute),y=s===e||u,g=y?Pt(e):{radius:0,supported:!0},S=f??g.radius,b=f!==null?"legacy":g.supported?g.radius>0?"computed":"none":"unsupported",$=[];h&&y&&_t(h,t)&&$.push(g),h&&s&&_t(h,o)&&$.push(Pt(s));const x=$.every(A=>A.supported),C=Math.max(0,...$.map(A=>A.radius)),_=f??C,P=f!==null?"legacy":x?C>0?"computed":"none":"unsupported";return!h||P==="unsupported"?ot(t,S,b):{...p,bbox:t,window:h,clipInset:lt(p.content,h),radius:_,radiusSource:P,bboxRadius:S,bboxRadiusSource:b,mediaElement:p.contentAware?s:null}}function Ut(e,t,n,i,s){const o=n.width/i,r=n.height/s;return{left:O(e)+(O(n)-O(t))/i-o/2,top:v(e)+(v(n)-v(t))/s-r/2,width:o,height:r}}const Pn={enter:"contain",exit:"cover",legacy:"contain"};function F(e){return Pn[e]}const Rt="data-hero-enter-key",Ot="data-hero-exit-key",J="data-hero-key";class _n{constructor(){E(this,"previousFromOpacity","")}prepare(t){t.from.then(n=>{this.previousFromOpacity=n.style.opacity,n.style.opacity="0"})}contribute(t){return t.onComplete(()=>{t.from.style.opacity=this.previousFromOpacity}),[]}}const In=()=>new _n;class Rn{contribute(t){const{from:n,to:i,physics:s,onComplete:o}=t,r=n.style.opacity,l=i.style.opacity,c=n.style.willChange,a=i.style.willChange;return i.style.opacity="0",n.style.willChange="opacity",i.style.willChange="opacity",o(()=>{n.style.opacity=r,i.style.opacity=l,n.style.willChange=c,i.style.willChange=a}),[new m.WebAnimation({element:n,integrator:w.from(s),style:(p,u)=>({opacity:u})}),new m.WebAnimation({element:i,integrator:w.from(s),style:p=>({opacity:p})})]}}const On=()=>new Rn,vn={static:In,fade:On},Tn={spring:{stiffness:320,damping:30}},Dn=()=>Tn,Fn={spring:{stiffness:300,damping:30,doubleSpring:1}},Mn=()=>Fn,Ln={default:Dn,smooth:Mn},Yn=700,kn="data-hero-aspect-ratio",Hn="data-hero-radius";function vt(e,t,n){const i=Y(e,t);return rt(t,i,s=>Y(e,s),{fallbackFit:n,legacyAspectRatioAttribute:kn,legacyRadiusAttribute:Hn})}function W(e,t){const n=new Map,i=e.querySelectorAll(`[${t}]`);for(const s of Array.from(i)){const o=s.getAttribute(t);o&&(n.has(o)||n.set(o,s))}return n}function Nn(e,t){const n=[],i=W(t,Rt),s=W(e,Ot);for(const[l,c]of i){const a=s.get(l);a&&n.push({key:l,fromEl:a,toEl:c,fromFit:F("exit"),toFit:F("enter")})}const o=W(e,Rt),r=W(t,Ot);for(const[l,c]of o){const a=r.get(l);a&&n.push({key:l,fromEl:c,toEl:a,fromFit:F("enter"),toFit:F("exit")})}return n}function Wn(e,t){const n=[],i=Array.from(t.querySelectorAll(`[${J}]`));for(const s of i){const o=s.getAttribute(J);if(!o)continue;const r=e.querySelector(`[${J}="${o}"]`);r&&n.push({key:o,fromEl:r,toEl:s,fromFit:F("legacy"),toFit:F("legacy")})}return n}function zn(e,t){const n=Nn(e,t);return n.length>0?n:Wn(e,t)}function Un(e,t){return zt(e,t)}function Vn(e,t){return e.radiusSource==="unsupported"||t.radiusSource==="unsupported"?!1:e.mediaElement!==null||t.mediaElement!==null||e.radiusSource==="computed"||e.radiusSource==="legacy"||t.radiusSource==="computed"||t.radiusSource==="legacy"}function Xn(e,t,n){const{fromEl:i,toEl:s}=t,[o,r]=Un(vt(e,i,t.fromFit),vt(e,s,t.toFit)),l=o.content,c=o.window,a=r.content,p=r.window,u=r.clipInset,d=o.radiusSource==="unsupported"||r.radiusSource==="unsupported",h=d?0:o.radius,f=d?0:r.radius;if(l.width===0||l.height===0||c.width===0||c.height===0||a.width===0||a.height===0||p.width===0||p.height===0)return null;const y=Math.max(l.width/a.width,l.height/a.height),g=O(l),S=v(l),b=O(a),$=v(a),x=g-b,C=S-$;if(Math.abs(C)>n)return null;const _=lt(a,Ut(a,l,c,y,y));return{toContent:a,fromVisualEl:o.mediaElement??i,toVisualEl:r.mediaElement??s,resetCloneRadius:Vn(o,r),styleFor:(P,A)=>{const k=A*x,M=A*C,H=P+A*y,jt=Math.max(0,h*A+f*P)/Math.max(Math.abs(H),1e-6),qt=_.top*A+u.top*P,Kt=_.right*A+u.right*P,Jt=_.bottom*A+u.bottom*P,Qt=_.left*A+u.left*P;return{transform:`translate(${k}px, ${M}px) scale(${H})`,clipPath:`inset(${qt}px ${Kt}px ${Jt}px ${Qt}px round ${jt}px)`}}}}function Bn(e,t){e.style.transform=t.transform,e.style.clipPath=t.clipPath}class Zn{contribute(t){const{resolved:n,physics:i,positionedParent:s,maxDistance:o,onComplete:r}=t,l=[];for(const c of n.pairs){const a=Xn(s,c,o);if(!a)continue;const{fromVisualEl:p,toVisualEl:u}=a,d=u.cloneNode(!0);d.style.position="absolute",d.style.left=`${a.toContent.left}px`,d.style.top=`${a.toContent.top}px`,d.style.width=`${a.toContent.width}px`,d.style.height=`${a.toContent.height}px`,d.style.margin="0",d.style.transformOrigin="center center",d.style.zIndex="1000",d.style.willChange="transform, clip-path",d.style.pointerEvents="none",d.style.maxWidth="none",d.style.maxHeight="none",a.resetCloneRadius&&(d.style.borderRadius="0"),Bn(d,a.styleFor(0,1)),s.appendChild(d);const h=p.style.opacity,f=u.style.opacity;p.style.opacity="0",u.style.opacity="0",r(()=>{p.style.opacity=h,u.style.opacity=f,d.parentElement&&d.parentElement.removeChild(d)}),l.push(new m.WebAnimation({element:d,integrator:w.from(i),style:a.styleFor}))}return l}}function Gn(e){return[new Zn,vn[e.type]()]}const jn=e=>{const t=Gn(e),n=Ln[e.variant](),i=Yn;return{prepare:s=>{var l;const o=Promise.all([s.from,s.to]).then(([c,a])=>({pairs:zn(c,a)})),r={from:s.from,to:s.to,resolved:o};for(const c of t)(l=c.prepare)==null||l.call(c,r);return o.then(c=>({resolved:c}))},animation:({from:s,to:o,context:r,resolved:l})=>{if(l.pairs.length===0)return new m.MultiAnimation([],{mode:"parallel"});const c=[],a=f=>{c.push(f)},p={from:s,to:o,resolved:l,physics:n,positionedParent:r.positionedParent,maxDistance:i,onComplete:a},u=[];for(const f of t)f.contribute&&u.push(...f.contribute(p));if(u.length===0)return new m.MultiAnimation([],{mode:"parallel"});const d=new m.MultiAnimation(u,{mode:"parallel"}),h=d.onComplete;return d.onComplete=()=>{h==null||h();for(const f of c)try{f()}catch(y){console.error("[hero] cleanup error",y)}},d}}};function qn(e={}){const t=e.type??"static",n=e.variant??"default";return jn({type:t,variant:n})}const Kn={spring:{stiffness:50,damping:30}},Jn={spring:{stiffness:80,damping:25}},Qn=(e={})=>{const t=e.physics??Kn,n=e.initialRotation??45,i=e.initialScale??.01,s=e.rotationTriggerPoint??.8;return{prepare:({from:o,to:r,context:l})=>(o.then(c=>{c.style.opacity="1"}),r.then(c=>{const a=T(l,"to"),p=Math.min(a.width,a.height)*.4;c.style.setProperty("--max-border-radius",`${p}px`),c.style.setProperty("--border-radius-scale","1"),c.style.willChange="transform",c.style.backfaceVisibility="hidden";const u=a.left+a.width/2,d=a.top+a.height/2;c.style.transformOrigin=`${u}px ${d}px`,c.style.position="fixed",c.style.top=`${a.top}px`,c.style.left=`${a.left}px`,c.style.width=`${a.width}px`,c.style.height=`${a.height}px`,c.style.zIndex="1000",c.style.overflow="hidden",c.style.transform=`rotate(${n}deg) scale(${i}) translateZ(0)`,c.style.borderRadius="calc(var(--max-border-radius) * var(--border-radius-scale))",c.style.opacity="1"}),{}),animation:({from:o,to:r})=>{const l=new m.WebAnimation({element:o,integrator:w.from(Jn),style:(a,p)=>({opacity:p}),onComplete:()=>{o.style.opacity=""}}),c=new m.WebAnimation({element:r,integrator:w.from(t),style:a=>{let p;if(a<=.05)p=i;else if(a<=s){const f=(a-.05)/(s-.05),y=Math.pow(f,9);p=i+(.8-i)*y}else{const f=(a-s)/(1-s);p=.8+.2*(1-Math.pow(1-f,3))}const u=.7;let d;if(a<=u)d=n;else{const f=(a-u)/(1-u),y=1-Math.pow(1-f,2);d=n*(1-y)}let h;if(a<=u)h=1;else{const f=(a-u)/(1-u);h=1-Math.pow(f,.5)}return{transform:`rotate(${d.toFixed(2)}deg) scale(${p.toFixed(4)}) translateZ(0)`,"--border-radius-scale":h.toFixed(4)}},onComplete:()=>{r.style.willChange="",r.style.backfaceVisibility="",r.style.removeProperty("--max-border-radius"),r.style.removeProperty("--border-radius-scale"),r.style.transform="",r.style.transformOrigin="",r.style.position="",r.style.zIndex="",r.style.top="",r.style.left="",r.style.width="",r.style.height="",r.style.overflow="",r.style.borderRadius=""}});return new m.MultiAnimation([l,c],{mode:"parallel"})}}};function ti(e={}){return Qn()}const ei={spring:{stiffness:100,damping:30}},ni=(e={})=>{const t=e.physics??ei;return{prepare:({from:n,to:i})=>(n.then(s=>{s.style.transformOrigin="center center",s.style.willChange="transform, opacity"}),i.then(s=>{s.style.opacity="0",s.style.transform="rotate(-180deg)",s.style.transformOrigin="center center",s.style.willChange="transform, opacity"}),{}),animation:({from:n,to:i})=>{const s=new m.WebAnimation({element:n,integrator:w.from(t),style:r=>({transform:`rotate(${r*180}deg)`,opacity:r<.5?1:0}),onComplete:()=>{n.style.willChange="auto",n.style.transform="",n.style.transformOrigin="",n.style.opacity=""}}),o=new m.WebAnimation({element:i,integrator:w.from(t),style:(r,l)=>({transform:`rotate(${-l*180}deg)`,opacity:r>.5?1:0}),onComplete:()=>{i.style.willChange="auto",i.style.transform="",i.style.transformOrigin="",i.style.opacity=""}});return new m.MultiAnimation([s,o],{mode:"parallel"})}}};function ii(e={}){return ni()}const si={spring:{stiffness:20,damping:8,doubleSpring:1,restDelta:.001,restSpeed:.001}},oi=(e={})=>{const t=e.physics??si,n=e.directional??!0;return{prepare:({from:i,to:s,context:o})=>{const r=!n||o.direction==="forward",l=r?I:R,c=r?R:I;return i.then(a=>{a.style.zIndex=l,a.style.willChange="transform",a.style.backfaceVisibility="hidden",a.style.contain="layout paint",a.style.pointerEvents="none"}),s.then(a=>{a.style.willChange="transform",a.style.backfaceVisibility="hidden",a.style.contain="layout paint",a.style.position="relative",a.style.zIndex=c}),{}},animation:({from:i,to:s,context:o})=>{const r=!n||o.direction==="forward",l=r?R:I,c=i.offsetHeight,a=s.offsetHeight,p=window.innerHeight,u=Math.max(Math.min(c,a),p),d=new m.WebAnimation({element:i,integrator:w.from(t),style:f=>({transform:`translate3d(0, ${r?-u*f:u*f}px, 0)`}),onComplete:()=>{i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain="",i.style.transform="",i.style.pointerEvents="",i.style.zIndex=""}}),h=new m.WebAnimation({element:s,integrator:w.from(t),style:(f,y)=>({transform:`translate3d(0, ${r?y*u:y*-u}px, 0)`}),onComplete:()=>{s.style.willChange="auto",s.style.backfaceVisibility="",s.style.contain="",s.style.transform="",s.style.position==="relative"&&(s.style.position=""),s.style.zIndex===l&&(s.style.zIndex="")}});for(const f of[d,h]){const y=f.onComplete;f.onComplete=()=>{y==null||y(),f.releaseFill()}}return new m.MultiAnimation([d,h],{mode:"parallel"})}}};function ri(e={}){const{type:t="directional"}=e;return oi({directional:t==="directional"})}const ai={spring:{stiffness:200,damping:24}},li={inertia:{acceleration:25,resistance:1.2}},Q=.2;function ci(){return{enterPhysics:ai,exitPhysics:li,background:{willChange:"transform, opacity",enterStyle:(e,t)=>({transform:`scale(${1-Q*e})`,opacity:t}),exitStyle:e=>({transform:`scale(${1-Q+Q*e})`,opacity:e})}}}const pi={spring:{stiffness:200,damping:24}},ui={inertia:{acceleration:25,resistance:1.2}},tt=.08,di=16,et=.6,fi=e=>`blur(${Math.max(0,e).toFixed(2)}px)`;function hi(){return{enterPhysics:pi,exitPhysics:ui,background:{willChange:"transform, opacity",enterStyle:e=>({transform:`scale(${1-tt*e})`,opacity:1-(1-et)*e}),exitStyle:e=>({transform:`scale(${1-tt+tt*e})`,opacity:et+(1-et)*e})},overlay:{willChange:"backdrop-filter",initialStyle:{position:"absolute",left:"0",width:"100%",pointerEvents:"none",backdropFilter:"blur(0px)",WebkitBackdropFilter:"blur(0px)"},style:(e,t)=>{const n=e==="enter"?t:1-t,i=fi(di*n);return{backdropFilter:i,WebkitBackdropFilter:i}}}}}const yi={spring:{stiffness:230,damping:25}},mi={spring:{stiffness:230,damping:25}};function gi(){return{enterPhysics:yi,exitPhysics:mi,background:{willChange:"",enterStyle:()=>({}),exitStyle:()=>({})}}}const bi={static:gi(),"background-scale":ci(),blur:hi()},wi="static",Si="transform",xi=(e={})=>{const t=bi[e.type??wi],n=t.background,i=t.overlay,s=n.willChange!=="";return{prepare:({from:o,to:r,context:l,createElement:c})=>{const a=l.direction==="forward"?"enter":"exit",p=a==="enter"?r:o,u=a==="enter"?o:r;p.then(h=>{h.style.willChange=Si,h.style.backfaceVisibility="hidden",h.style.contain="layout paint",h.style.zIndex=R,a==="enter"?h.style.position="relative":h.style.pointerEvents="none"}),u.then(h=>{s&&(h.style.willChange=n.willChange,h.style.backfaceVisibility="hidden",h.style.contain="layout paint"),h.style.zIndex=I,a==="enter"?h.style.pointerEvents="none":h.style.position="relative"});let d;return i&&(d=c("sheet-overlay"),Object.assign(d.style,i.initialStyle),d.style.willChange=i.willChange,l.positionedParent.appendChild(d)),{overlay:d}},animation:({from:o,to:r,context:l,overlay:c})=>{const a=l.direction==="forward"?"enter":"exit",p=a==="enter"?t.enterPhysics:t.exitPhysics,u=a==="enter"?r:o,d=a==="enter"?o:r,h=T(l,a==="enter"?"to":"from"),f=()=>{o.style.pointerEvents="",o.style.zIndex=""},y=()=>{const x=a==="enter"?R:I;r.style.position==="relative"&&(r.style.position=""),r.style.zIndex===x&&(r.style.zIndex="")},g=x=>{const C=x.onComplete;x.onComplete=()=>{C==null||C(),x.releaseFill()}};u.style.clipPath=`inset(${h.top}px 0 calc(100% - ${h.top+h.height}px) 0)`;const S=a==="enter"?(x,C)=>({transform:`translate3d(0, ${C*h.height}px, 0)`}):x=>({transform:`translate3d(0, ${x*h.height}px, 0)`}),b=new m.WebAnimation({element:u,integrator:w.from(p),style:S,onComplete:()=>{u.style.willChange="auto",u.style.backfaceVisibility="",u.style.contain="",u.style.clipPath="",u.style.transform="",f(),y()}});g(b);const $=[b];if(s){const x=d.scrollHeight;x>0&&(d.style.height=`${x}px`);const C=T(l,a==="enter"?"from":"to"),_=C.left+C.width/2,P=C.top+C.height/2;d.style.clipPath=`inset(${C.top}px 0 calc(100% - ${C.top+C.height}px) 0)`,d.style.transformOrigin=`${_}px ${P}px`;const A=a==="enter"?(M,H)=>n.enterStyle(M,H):M=>n.exitStyle(M),k=new m.WebAnimation({element:d,integrator:w.from(p),style:A,onComplete:()=>{d.style.willChange="auto",d.style.backfaceVisibility="",d.style.contain="",d.style.clipPath="",d.style.transformOrigin="",d.style.transform="",d.style.opacity="",d.style.height=""}});g(k),$.push(k)}if(c&&i){c.style.zIndex=kt;const x=Lt(l,"to");c.style.top=`${x.top}px`,c.style.height=`${x.height}px`,$.push(new m.WebAnimation({element:c,integrator:w.from(p),style:C=>i.style(a,C)}))}return new m.MultiAnimation($,{mode:"parallel"})}}};function Ci(e){return e==="scale"||e==="background-scale"?"background-scale":e==="blur"?"blur":"static"}function $i(e={}){const t=e.type,n=Ci(t);return xi({type:n})}const Ei={spring:{stiffness:170,damping:22,doubleSpring:.8}},Ai=(e={})=>{const t=e.physics??Ei;return{prepare:({from:n,to:i,context:s})=>{const o=s.direction==="forward";return n.then(r=>{r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint",r.style.pointerEvents="none"}),i.then(r=>{const l=o?100:-100;r.style.transform=`translate3d(${l}%, 0, 0)`,r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint"}),{}},animation:({from:n,to:i,context:s})=>{const o=s.direction==="forward",r=new m.WebAnimation({element:n,integrator:w.from(t),style:c=>({transform:`translate3d(${o?-100*c:100*c}%, 0, 0)`}),onComplete:()=>{n.style.willChange="auto",n.style.backfaceVisibility="",n.style.contain="",n.style.transform="",n.style.pointerEvents=""}}),l=new m.WebAnimation({element:i,integrator:w.from(t),style:(c,a)=>({transform:`translate3d(${o?a*100:a*-100}%, 0, 0)`}),onComplete:()=>{i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain="",i.style.transform=""}});return new m.MultiAnimation([r,l],{mode:"parallel"})}}};function Pi(e={}){return Ai()}const _i={spring:{stiffness:17,damping:6}},nt=20,z=800,Ii=(e={})=>{const t=e.physics??_i;return{prepare:({from:n,to:i})=>(n.then(s=>{s.style.willChange="transform",s.style.backfaceVisibility="hidden",s.style.contain="layout paint",s.style.pointerEvents="none",s.style.transform=`perspective(${z}px) rotateY(0deg) translate3d(0%, 0, 0)`}),i.then(s=>{s.style.willChange="transform",s.style.backfaceVisibility="hidden",s.style.contain="layout paint",s.style.transform=`perspective(${z}px) rotateY(${nt}deg) translate3d(-100%, 0, 0)`}),{}),animation:({from:n,to:i})=>{const s=new m.WebAnimation({element:n,integrator:w.from(t),style:r=>{const l=-r*nt,c=r*100;return{transform:`perspective(${z}px) rotateY(${l}deg) translate3d(${c}%, 0, 0)`}},onComplete:()=>{n.style.transform="",n.style.willChange="auto",n.style.backfaceVisibility="",n.style.contain="",n.style.pointerEvents=""}}),o=new m.WebAnimation({element:i,integrator:w.from(t),style:(r,l)=>{const c=l*nt,a=-l*100;return{transform:`perspective(${z}px) rotateY(${c}deg) translate3d(${a}%, 0, 0)`}},onComplete:()=>{i.style.transform="",i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain=""}});return new m.MultiAnimation([s,o],{mode:"sequence"})}}};function Ri(e={}){return Ii()}function Oi(e,t){return t.left>=e.left-.01&&t.top>=e.top-.01&&t.left+t.width<=e.left+e.width+.01&&t.top+t.height<=e.top+e.height+.01}function Vt(e){const t=()=>({enterContent:e.enterRect,exitContent:e.exitRect,startWindow:e.enterRect,scaleX:e.exitRect.width/e.enterRect.width,scaleY:e.exitRect.height/e.enterRect.height}),{enterMedia:n,exitMedia:i}=e;if(!n||!i||!Wt(n,i))return t();const s=n.content,o=i.content;if(s.width<=0||s.height<=0||o.width<=0||o.height<=0)return t();const r=o.width/s.width,l=o.height/s.height,c=Ut(s,o,i.window,r,l);return Oi(n.window,c)?{enterContent:s,exitContent:o,startWindow:c,scaleX:r,scaleY:l}:t()}function Xt(e,t){return{top:e.top/t.height*100,right:(t.width-(e.left+e.width))/t.width*100,bottom:(t.height-(e.top+e.height))/t.height*100,left:e.left/t.width*100}}function Bt(e,t,n){return{x:e/Math.max(Math.abs(t),1e-6),y:e/Math.max(Math.abs(n),1e-6)}}function vi(e){const{pageRect:t,scrollOffset:n,enterRadius:i,exitRadius:s}=e,o=Vt(e),{enterContent:r,exitContent:l,startWindow:c,scaleX:a,scaleY:p}=o,u=l.left-r.left+(l.width-r.width)/2-n.x,d=l.top-r.top+(l.height-r.height)/2-n.y,h=Xt(c,t);return{transformOrigin:`${O(r)}px ${v(r)}px`,animate:f=>{const y=1-f,g=1+(a-1)*y,S=1+(p-1)*y,b=Math.max(0,s*y+i*(1-y)),$=Bt(b,g,S);return{clipPath:`inset(${h.top*y}% ${h.right*y}% ${h.bottom*y}% ${h.left*y}% round ${$.x}px / ${$.y}px)`,transform:`translate(${u*y}px, ${d*y}px) scale(${g}, ${S})`}}}}function Ti(e){const{pageRect:t,scrollOffset:n,enterRadius:i,exitRadius:s}=e,o=Vt(e),{enterContent:r,exitContent:l,startWindow:c,scaleX:a,scaleY:p}=o,u=l.left-r.left+(l.width-r.width)/2+n.x,d=l.top-r.top+(l.height-r.height)/2+n.y,h=Xt(c,t);return{transformOrigin:`${O(r)}px ${v(r)}px`,animate:f=>{const y=1-f,g=1+(a-1)*y,S=1+(p-1)*y,b=Math.max(0,i*(1-y)+s*y),$=Bt(b,g,S);return{clipPath:`inset(${h.top*y}% ${h.right*y}% ${h.bottom*y}% ${h.left*y}% round ${$.x}px / ${$.y}px)`,transform:`translate(${u*y-n.x}px, ${d*y}px) scale(${g}, ${S})`}}}}const Di={spring:{stiffness:380,damping:30,doubleSpring:{stiffness:260,damping:30}}},Zt=.12,Fi=18;function Mi(){return{transformOrigin:"50% 50%",animate:e=>{const t=1-e;return{transform:`scale(${1-Zt*t})`}}}}function Li(){return{transformOrigin:"50% 50%",animate:e=>{const t=1-e;return{transform:`scale(${1-Zt*t})`}}}}const it={willChange:"backdrop-filter",initialStyle:{position:"absolute",left:"0",width:"100%",pointerEvents:"none",backdropFilter:"blur(0px)",WebkitBackdropFilter:"blur(0px)"},style:(e,t)=>{const n=e==="enter"?t:1-t,i=`blur(${Fi*n}px)`;return{backdropFilter:i,WebkitBackdropFilter:i}}};class Yi{constructor(){E(this,"physics",Di)}contribute(t){const{from:n,to:i,resolved:s,physics:o}=t,r=s.mode==="enter",l=r?n:i,c=r?Mi():Li();return c&&(l.style.transformOrigin=c.transformOrigin),[new m.WebAnimation({element:l,integrator:w.from(o),style:r?(a,p)=>c.animate(p):a=>c.animate(a)})]}}class ki{prepare(t){const n=t.createElement("zoom-overlay");return Object.assign(n.style,it.initialStyle),n.style.willChange=it.willChange,t.context.positionedParent.appendChild(n),{overlay:n}}contribute(t){const n=t.extras.overlay;if(!n)return[];n.style.zIndex=kt;const i=Lt(t.context,"to");return n.style.top=`${i.top}px`,n.style.height=`${i.height}px`,[new m.WebAnimation({element:n,integrator:w.from(t.physics),style:s=>it.style(t.resolved.mode,s)})]}}const Hi={spring:{stiffness:380,damping:30,doubleSpring:{stiffness:260,damping:30}}};function Ni({enterRect:e,exitRect:t,scrollOffset:n}){const i=e.left-t.left+(e.width-t.width)/2+n.x,s=e.top-t.top+(e.height-t.height)/2+n.y,o=e.width/t.width,r=e.height/t.height,l=Math.max(o,r);return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:c=>{const a=1-c;return{transform:`translate(${i*a-n.x}px, ${s*a}px) scale(${1+(l-1)*a})`}}}}function Wi({enterRect:e,exitRect:t,scrollOffset:n}){const i=e.left-t.left+(e.width-t.width)/2-n.x,s=e.top-t.top+(e.height-t.height)/2-n.y,o=e.width/t.width,r=e.height/t.height,l=Math.max(o,r);return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:c=>{const a=1-c;return{transform:`translate(${i*a}px, ${s*a}px) scale(${1+(l-1)*a})`}}}}class zi{constructor(){E(this,"physics",Hi)}contribute(t){const{from:n,to:i,resolved:s,input:o,physics:r}=t,l=s.mode==="enter",c=l?n:i,a=l?Ni(o):Wi(o);return a&&(c.style.transformOrigin=a.transformOrigin),[new m.WebAnimation({element:c,integrator:w.from(r),style:l?(p,u)=>a.animate(u):p=>a.animate(p)})]}}const Ui={spring:{stiffness:530,damping:34,doubleSpring:1}};class Vi{constructor(){E(this,"physics",Ui)}contribute(t){return[]}}const Xi={expand:()=>new zi,static:()=>new Vi,blur:()=>new Yi};function Bi(e){return Xi[e]()}const at="data-zoom-enter-key",Tt="data-zoom-exit-key",Dt="data-zoom-radius";function Zi(e,t){return Math.abs(e.left-t.left)<.01&&Math.abs(e.top-t.top)<.01&&Math.abs(e.width-t.width)<.01&&Math.abs(e.height-t.height)<.01}function Gi(e,t){const n=[];let i=t;for(;i&&i!==e;){const s=i.parentElement;if(!s)break;for(const o of Array.from(s.children))o!==i&&o instanceof HTMLElement&&n.push(o);i=s}return n}function Ft(e){const t=e.querySelectorAll(`[${at}]`);return t.length!==1?null:t[0]}function Mt(e,t){const n=e.querySelectorAll(`[${Tt}]`);for(const i of n)if(i.getAttribute(Tt)===t)return i;return null}function ji(e,t,n){if(n==="forward"){const r=Ft(t);if(!r)return null;const l=r.getAttribute(at);if(!l)return null;const c=Mt(e,l);return c?{mode:"enter",enterEl:r,exitEl:c}:null}const i=Ft(e);if(!i)return null;const s=i.getAttribute(at);if(!s)return null;const o=Mt(t,s);return o?{mode:"exit",enterEl:i,exitEl:o}:null}function qi(e,t,n,i){const s=e.mode==="enter"?n:t,o=e.mode==="enter"?t:n,r=N(s,e.enterEl),l=N(o,e.exitEl),c=rt(e.enterEl,r,g=>N(s,g),{legacyRadiusAttribute:Dt}),a=rt(e.exitEl,l,g=>N(o,g),{legacyRadiusAttribute:Dt}),[p,u]=zt(c,a),d=p.contentAware&&u.contentAware,h=e.mode==="enter"?n.getBoundingClientRect():t.getBoundingClientRect(),f={left:0,top:0,width:h.width,height:h.height},y=p.radiusSource==="legacy"||Zi(p.window,f)?p.radius:0;return{enterRect:r,exitRect:l,...d?{enterMedia:p,exitMedia:u}:{},pageRect:h,scrollOffset:i,enterRadius:y,exitRadius:u.radius}}class Ki{prepare(t){t.from.then(n=>{n.style.willChange="transform, clip-path, opacity",n.style.backfaceVisibility="hidden",n.style.contain="layout paint"})}contribute(t){const{from:n,to:i,resolved:s,input:o,physics:r,onComplete:l}=t,c=s.mode==="enter",a=c?vi(o):Ti(o),p=c?i:n,u=c?"t":"u";a&&(p.style.transformOrigin=a.transformOrigin);const d=c?I:R,h=c?R:I,f=n.style.zIndex;n.style.zIndex=d;const y=i.style.zIndex,g=i.style.position;return i.style.zIndex=h,i.style.position="relative",l(()=>{p.style.willChange="auto",p.style.backfaceVisibility="",p.style.transformOrigin="",p.style.contain="",n.style.zIndex=f,i.style.zIndex===h&&(i.style.zIndex=y),i.style.position==="relative"&&(i.style.position=g),i.style.transformOrigin="",n.style.willChange="auto",n.style.backfaceVisibility="",n.style.transformOrigin="",n.style.contain="",n.style.transform="",n.style.clipPath=""}),[new m.WebAnimation({element:p,integrator:w.from(r),style:u==="t"?S=>a.animate(S):(S,b)=>a.animate(b)})]}}class Ji{contribute(t){const{resolved:n,physics:i,from:s,to:o,onComplete:r}=t,l=n.mode==="enter"?o:s,c=Gi(l,n.enterEl);if(c.length===0)return[];const a=c.map(p=>p.style.opacity);if(n.mode==="enter")for(const p of c)p.style.opacity="0";return r(()=>{for(let p=0;p<c.length;p++){const u=c[p];u&&(u.style.opacity=a[p]??"")}}),c.map(p=>new m.WebAnimation({element:p,integrator:w.from(i),style:(u,d)=>({opacity:n.mode==="enter"?u:d})}))}}class Gt{contribute(){return[]}}const Qi={default:()=>new Gt,fade:()=>new Ji};function ts(e){return Qi[e]()}class es extends Gt{}function ns(e){const t=Bi(e.type);return{strategies:[new Ki,t,ts(e.variant),new es,...e.type==="blur"?[new ki]:[]],physics:t.physics}}const is=e=>{const{strategies:t,physics:n}=ns(e);return{prepare:i=>{const s={from:i.from,to:i.to,context:{positionedParent:i.context.positionedParent},createElement:i.createElement},o={};for(const r of t){if(!r.prepare)continue;const l=r.prepare(s);l&&Object.assign(o,l)}return o},animation:({from:i,to:s,context:o,...r})=>{const l=ji(i,s,o.direction);if(!l)return new m.MultiAnimation([],{mode:"parallel"});const c=qi(l,i,s,o.scrollOffset),a=[],u={from:i,to:s,resolved:l,input:c,physics:n,context:o,extras:r,onComplete:f=>{a.push(f)}},d=[];for(const f of t)f.contribute&&d.push(...f.contribute(u));const h=d[0];if(h){const f=h.onComplete;h.onComplete=()=>{f==null||f();for(const y of a)try{y()}catch(g){console.error("[zoom] cleanup error",g)}}}for(const f of d){if(!(f instanceof m.WebAnimation))continue;const y=f.onComplete;f.onComplete=()=>{y==null||y(),f.releaseFill()}}return new m.MultiAnimation(d,{mode:"parallel"})}}};function ss(e){const t=e.type??"static",n=e.variant??(e.fade?"fade":"default");return{type:t,variant:n}}function os(e={}){const t=ss(e);return is(t)}exports.Animation=m.Animation;exports.MultiAnimation=m.MultiAnimation;exports.WebAnimation=m.WebAnimation;exports.axis=Ye;exports.blind=Ue;exports.drill=tn;exports.fade=on;exports.film=hn;exports.hero=qn;exports.jaemin=ti;exports.rotate=ii;exports.scroll=ri;exports.sheet=$i;exports.slide=Pi;exports.strip=Ri;exports.zoom=os;
|
|
35
|
+
)`}function K(e,t,n,i,s){const o=n/1e3;return new m.WebAnimation({element:e,integrator:new ae({durationSec:o}),lowerBound:0,upperBound:1,style:r=>i(pn(t,r)),onComplete:s})}const fn=(e={})=>{var s;const t=((s=e.border)==null?void 0:s.color)??an,n=rn,i=e.physics;return{prepare:({from:o,to:r,context:l})=>{const c=T(l,"from"),a=T(l,"to"),p=Y(document.body,l.positionedParent),u=dn(t,{...c,top:p.top});for(const d of["topLeft","topRight","bottomLeft","bottomRight"])l.positionedParent.appendChild(u[d]);return o.then(d=>{Et(d,c),At(d,c),d.style.transform=`translateY(${-c.top}px)`}),r.then(d=>{Et(d,a),At(d,a),d.style.transform=`translateY(${-a.top+a.height}px) scale(${n})`}),{borders:u,fromRect:c,toRect:a}},animation:({from:o,to:r,context:l,borders:c,fromRect:a,toRect:p})=>{const u=$t({rect:a,scale:n,direction:"out",override:i}),d=$t({rect:p,scale:n,direction:"in",override:i}),h=K(o,u.snapshots,u.totalDuration,b=>({transform:`translateY(${b.translateY}px) scale(${b.scale})`}),()=>{o.style.clipPath="",o.style.transformOrigin="",o.style.transform=""}),f=K(r,d.snapshots,d.totalDuration,b=>({transform:`translateY(${b.translateY}px) scale(${b.scale})`}),()=>{r.style.clipPath="",r.style.transformOrigin="",r.style.transform=""}),y=un.map(([b,$],x)=>{const C=["topLeft","topRight","bottomLeft","bottomRight"][x];return K(c[C],u.snapshots,u.totalDuration,_=>{const P=(a.width-a.width*_.scale)/2*.7*b,A=(a.height-a.height*_.scale)/2*.7*$;return{transform:`translate(${P}px, ${A}px)`}})}),g=new m.MultiAnimation([h,f,...y],{mode:"parallel"}),S=g.onComplete;return g.onComplete=()=>{S==null||S();const b=l.positionedParent;for(const $ of["topLeft","topRight","bottomLeft","bottomRight"]){const x=c[$];x.parentElement===b&&b.removeChild(x)}},g}}};function hn(e={}){const{options:t}=e,n=(t==null?void 0:t.borderColor)!==void 0?{border:{color:t.borderColor}}:void 0;return fn(n)}function yn(e){if(!e)return null;if(e.includes("/")){const n=e.split("/");if(n.length!==2)return null;const i=Number.parseFloat(n[0]??""),s=Number.parseFloat(n[1]??"");return Number.isFinite(i)&&Number.isFinite(s)&&i>0&&s>0?i/s:null}const t=Number.parseFloat(e);return Number.isFinite(t)&&t>0?t:null}function mn(e){return e==="contain"||e==="cover"?e:null}function st(e){return e.tagName==="IMG"}function gn(e){if(st(e))return e;if(e.tagName==="PICTURE"||e.tagName==="VIDEO")return null;const t=[];for(const n of Array.from(e.children)){const i=n;st(i)&&t.push(i)}return t.length===1?t[0]??null:null}function bn(e){var c,a;if(!st(e))return null;const t=e,n=t.naturalWidth,i=t.naturalHeight;if(typeof n=="number"&&typeof i=="number"&&Number.isFinite(n)&&Number.isFinite(i)&&n>0&&i>0)return n/i;const s=((c=e.getAttribute("width"))==null?void 0:c.trim())??"",o=((a=e.getAttribute("height"))==null?void 0:a.trim())??"",r=s===""?Number.NaN:Number(s),l=o===""?Number.NaN:Number(o);return Number.isFinite(r)&&Number.isFinite(l)&&r>0&&l>0?r/l:null}function wn(e){const t=e.trim().toLowerCase().replace(/\s+/g," ");return t===""||t==="center"||t==="center center"||t==="50% 50%"}function V(e){if(typeof getComputedStyle=="function")try{return getComputedStyle(e)}catch{}return e.style}function Sn(e){const t=V(e),n=wn(t.objectPosition??"");return{fit:n?mn(t.objectFit??null):null,centered:n}}function Ht(e){if(!e)return 0;const t=/^(-?(?:\d+\.?\d*|\.\d+))px$/.exec(e.trim());if(!t)return null;const n=Number.parseFloat(t[1]??"");return Number.isFinite(n)&&n>=0?n:null}function Pt(e){const t=V(e),n=[t.borderTopLeftRadius,t.borderTopRightRadius,t.borderBottomRightRadius,t.borderBottomLeftRadius].map(Ht),i=n[0];if(i==null)return{radius:0,supported:!1};const s=n.every(o=>o!==null&&Math.abs(o-i)<.001);return{radius:s?i:0,supported:s}}function xn(e,t){var s;if(!t)return null;const n=(s=e.getAttribute(t))==null?void 0:s.trim();if(n==null||n==="")return null;const i=Number.parseFloat(n);return Number.isFinite(i)&&i>=0?i:null}function Cn(e){const t=V(e);return[t.paddingTop,t.paddingRight,t.paddingBottom,t.paddingLeft,t.borderTopWidth,t.borderRightWidth,t.borderBottomWidth,t.borderLeftWidth].every(i=>i?Ht(i)===0:!0)}function $n(e){const t=V(e),n=i=>i==="hidden"||i==="clip";return n(t.overflowX)&&n(t.overflowY)}function O(e){return e.left+e.width/2}function v(e){return e.top+e.height/2}function lt(e,t){return{top:Math.max(0,t.top-e.top),right:Math.max(0,e.left+e.width-(t.left+t.width)),bottom:Math.max(0,e.top+e.height-(t.top+t.height)),left:Math.max(0,t.left-e.left)}}function En(e,t){const n=Math.max(e.left,t.left),i=Math.max(e.top,t.top),s=Math.min(e.left+e.width,t.left+t.width),o=Math.min(e.top+e.height,t.top+t.height);return s>n&&o>i?{left:n,top:i,width:s-n,height:o-i}:null}function _t(e,t){return Math.abs(e.left-t.left)<.01&&Math.abs(e.top-t.top)<.01&&Math.abs(e.width-t.width)<.01&&Math.abs(e.height-t.height)<.01}function An(e,t,n){const i=e.width/e.height;let s,o;return n==="contain"?i>t?(o=e.height,s=o*t):(s=e.width,o=s/t):i>t?(s=e.width,o=s/t):(o=e.height,s=o*t),{left:e.left+(e.width-s)/2,top:e.top+(e.height-o)/2,width:s,height:o}}function Nt(e,t,n){const i=t!==null&&n!==null&&e.width>0&&e.height>0?An(e,t,n):e,s=n==="contain"?i:e;return{bbox:e,content:i,window:s,clipInset:lt(i,s),aspectRatio:t,fit:n,radius:0,radiusSource:"none",bboxRadius:0,bboxRadiusSource:"none",contentAware:t!==null&&n!==null,mediaElement:null}}function ot(e,t,n){return{...Nt(e,null,null),radius:t,radiusSource:n,bboxRadius:t,bboxRadiusSource:n}}function Wt(e,t){const n=e.aspectRatio,i=t.aspectRatio;return e.contentAware&&t.contentAware&&n!==null&&i!==null&&Math.abs(n-i)/Math.max(n,i)<.01}function It(e){return ot(e.bbox,e.bboxRadius,e.bboxRadiusSource)}function zt(e,t){return Wt(e,t)?[e,t]:[It(e),It(t)]}function rt(e,t,n,i){const s=gn(e),o=s?n(s):t,r=i.legacyAspectRatioAttribute?yn(e.getAttribute(i.legacyAspectRatioAttribute)??(s==null?void 0:s.getAttribute(i.legacyAspectRatioAttribute))??null):null,l=r??(s?bn(s):null),c=s?Sn(s):{fit:null,centered:!0},a=c.centered&&(s===null||Cn(s))?c.fit??(r!==null?i.fallbackFit??null:null):null,p=Nt(o,l,a),u=$n(e),h=s!==null&&s!==e&&u?En(p.window,t):p.window,f=xn(e,i.legacyRadiusAttribute),y=s===e||u,g=y?Pt(e):{radius:0,supported:!0},S=f??g.radius,b=f!==null?"legacy":g.supported?g.radius>0?"computed":"none":"unsupported",$=[];h&&y&&_t(h,t)&&$.push(g),h&&s&&_t(h,o)&&$.push(Pt(s));const x=$.every(A=>A.supported),C=Math.max(0,...$.map(A=>A.radius)),_=f??C,P=f!==null?"legacy":x?C>0?"computed":"none":"unsupported";return!h||P==="unsupported"?ot(t,S,b):{...p,bbox:t,window:h,clipInset:lt(p.content,h),radius:_,radiusSource:P,bboxRadius:S,bboxRadiusSource:b,mediaElement:p.contentAware?s:null}}function Ut(e,t,n,i,s){const o=n.width/i,r=n.height/s;return{left:O(e)+(O(n)-O(t))/i-o/2,top:v(e)+(v(n)-v(t))/s-r/2,width:o,height:r}}const Pn={enter:"contain",exit:"cover",legacy:"contain"};function F(e){return Pn[e]}const Rt="data-hero-enter-key",Ot="data-hero-exit-key",J="data-hero-key";class _n{constructor(){E(this,"previousFromOpacity","")}prepare(t){t.from.then(n=>{this.previousFromOpacity=n.style.opacity,n.style.opacity="0"})}contribute(t){return t.onComplete(()=>{t.from.style.opacity=this.previousFromOpacity}),[]}}const In=()=>new _n;class Rn{contribute(t){const{from:n,to:i,physics:s,onComplete:o}=t,r=n.style.opacity,l=i.style.opacity,c=n.style.willChange,a=i.style.willChange;return i.style.opacity="0",n.style.willChange="opacity",i.style.willChange="opacity",o(()=>{n.style.opacity=r,i.style.opacity=l,n.style.willChange=c,i.style.willChange=a}),[new m.WebAnimation({element:n,integrator:w.from(s),style:(p,u)=>({opacity:u})}),new m.WebAnimation({element:i,integrator:w.from(s),style:p=>({opacity:p})})]}}const On=()=>new Rn,vn={static:In,fade:On},Tn={spring:{stiffness:320,damping:30}},Dn=()=>Tn,Fn={spring:{stiffness:300,damping:30,doubleSpring:1}},Mn=()=>Fn,Ln={default:Dn,smooth:Mn},Yn=700,kn="data-hero-aspect-ratio",Hn="data-hero-radius";function vt(e,t,n){const i=Y(e,t);return rt(t,i,s=>Y(e,s),{fallbackFit:n,legacyAspectRatioAttribute:kn,legacyRadiusAttribute:Hn})}function W(e,t){const n=new Map,i=e.querySelectorAll(`[${t}]`);for(const s of Array.from(i)){const o=s.getAttribute(t);o&&(n.has(o)||n.set(o,s))}return n}function Nn(e,t){const n=[],i=W(t,Rt),s=W(e,Ot);for(const[l,c]of i){const a=s.get(l);a&&n.push({key:l,fromEl:a,toEl:c,fromFit:F("exit"),toFit:F("enter")})}const o=W(e,Rt),r=W(t,Ot);for(const[l,c]of o){const a=r.get(l);a&&n.push({key:l,fromEl:c,toEl:a,fromFit:F("enter"),toFit:F("exit")})}return n}function Wn(e,t){const n=[],i=Array.from(t.querySelectorAll(`[${J}]`));for(const s of i){const o=s.getAttribute(J);if(!o)continue;const r=e.querySelector(`[${J}="${o}"]`);r&&n.push({key:o,fromEl:r,toEl:s,fromFit:F("legacy"),toFit:F("legacy")})}return n}function zn(e,t){const n=Nn(e,t);return n.length>0?n:Wn(e,t)}function Un(e,t){return zt(e,t)}function Vn(e,t){return e.radiusSource==="unsupported"||t.radiusSource==="unsupported"?!1:e.mediaElement!==null||t.mediaElement!==null||e.radiusSource==="computed"||e.radiusSource==="legacy"||t.radiusSource==="computed"||t.radiusSource==="legacy"}function Xn(e,t,n){const{fromEl:i,toEl:s}=t,[o,r]=Un(vt(e,i,t.fromFit),vt(e,s,t.toFit)),l=o.content,c=o.window,a=r.content,p=r.window,u=r.clipInset,d=o.radiusSource==="unsupported"||r.radiusSource==="unsupported",h=d?0:o.radius,f=d?0:r.radius;if(l.width===0||l.height===0||c.width===0||c.height===0||a.width===0||a.height===0||p.width===0||p.height===0)return null;const y=Math.max(l.width/a.width,l.height/a.height),g=O(l),S=v(l),b=O(a),$=v(a),x=g-b,C=S-$;if(Math.abs(C)>n)return null;const _=lt(a,Ut(a,l,c,y,y));return{toContent:a,fromVisualEl:o.mediaElement??i,toVisualEl:r.mediaElement??s,resetCloneRadius:Vn(o,r),styleFor:(P,A)=>{const k=A*x,M=A*C,H=P+A*y,jt=Math.max(0,h*A+f*P)/Math.max(Math.abs(H),1e-6),qt=_.top*A+u.top*P,Kt=_.right*A+u.right*P,Jt=_.bottom*A+u.bottom*P,Qt=_.left*A+u.left*P;return{transform:`translate(${k}px, ${M}px) scale(${H})`,clipPath:`inset(${qt}px ${Kt}px ${Jt}px ${Qt}px round ${jt}px)`}}}}function Bn(e,t){e.style.transform=t.transform,e.style.clipPath=t.clipPath}class Zn{contribute(t){const{resolved:n,physics:i,positionedParent:s,maxDistance:o,onComplete:r}=t,l=[];for(const c of n.pairs){const a=Xn(s,c,o);if(!a)continue;const{fromVisualEl:p,toVisualEl:u}=a,d=u.cloneNode(!0);d.style.position="absolute",d.style.left=`${a.toContent.left}px`,d.style.top=`${a.toContent.top}px`,d.style.width=`${a.toContent.width}px`,d.style.height=`${a.toContent.height}px`,d.style.margin="0",d.style.transformOrigin="center center",d.style.zIndex="1000",d.style.willChange="transform, clip-path",d.style.pointerEvents="none",d.style.maxWidth="none",d.style.maxHeight="none",a.resetCloneRadius&&(d.style.borderRadius="0"),Bn(d,a.styleFor(0,1)),s.appendChild(d);const h=p.style.opacity,f=u.style.opacity;p.style.opacity="0",u.style.opacity="0",r(()=>{p.style.opacity=h,u.style.opacity=f,d.parentElement&&d.parentElement.removeChild(d)}),l.push(new m.WebAnimation({element:d,integrator:w.from(i),style:a.styleFor}))}return l}}function Gn(e){return[new Zn,vn[e.type]()]}const jn=e=>{const t=Gn(e),n=Ln[e.variant](),i=Yn;return{prepare:s=>{var l;const o=Promise.all([s.from,s.to]).then(([c,a])=>({pairs:zn(c,a)})),r={from:s.from,to:s.to,resolved:o};for(const c of t)(l=c.prepare)==null||l.call(c,r);return o.then(c=>({resolved:c}))},animation:({from:s,to:o,context:r,resolved:l})=>{if(l.pairs.length===0)return new m.MultiAnimation([],{mode:"parallel"});const c=[],a=f=>{c.push(f)},p={from:s,to:o,resolved:l,physics:n,positionedParent:r.positionedParent,maxDistance:i,onComplete:a},u=[];for(const f of t)f.contribute&&u.push(...f.contribute(p));if(u.length===0)return new m.MultiAnimation([],{mode:"parallel"});const d=new m.MultiAnimation(u,{mode:"parallel"}),h=d.onComplete;return d.onComplete=()=>{h==null||h();for(const f of c)try{f()}catch(y){console.error("[hero] cleanup error",y)}},d}}};function qn(e={}){const t=e.type??"static",n=e.variant??"default";return jn({type:t,variant:n})}const Kn={spring:{stiffness:50,damping:30}},Jn={spring:{stiffness:80,damping:25}},Qn=(e={})=>{const t=e.physics??Kn,n=e.initialRotation??45,i=e.initialScale??.01,s=e.rotationTriggerPoint??.8;return{prepare:({from:o,to:r,context:l})=>(o.then(c=>{c.style.opacity="1"}),r.then(c=>{const a=T(l,"to"),p=Math.min(a.width,a.height)*.4;c.style.setProperty("--max-border-radius",`${p}px`),c.style.setProperty("--border-radius-scale","1"),c.style.willChange="transform",c.style.backfaceVisibility="hidden";const u=a.left+a.width/2,d=a.top+a.height/2;c.style.transformOrigin=`${u}px ${d}px`,c.style.position="fixed",c.style.top=`${a.top}px`,c.style.left=`${a.left}px`,c.style.width=`${a.width}px`,c.style.height=`${a.height}px`,c.style.zIndex="1000",c.style.overflow="hidden",c.style.transform=`rotate(${n}deg) scale(${i}) translateZ(0)`,c.style.borderRadius="calc(var(--max-border-radius) * var(--border-radius-scale))",c.style.opacity="1"}),{}),animation:({from:o,to:r})=>{const l=new m.WebAnimation({element:o,integrator:w.from(Jn),style:(a,p)=>({opacity:p}),onComplete:()=>{o.style.opacity=""}}),c=new m.WebAnimation({element:r,integrator:w.from(t),style:a=>{let p;if(a<=.05)p=i;else if(a<=s){const f=(a-.05)/(s-.05),y=Math.pow(f,9);p=i+(.8-i)*y}else{const f=(a-s)/(1-s);p=.8+.2*(1-Math.pow(1-f,3))}const u=.7;let d;if(a<=u)d=n;else{const f=(a-u)/(1-u),y=1-Math.pow(1-f,2);d=n*(1-y)}let h;if(a<=u)h=1;else{const f=(a-u)/(1-u);h=1-Math.pow(f,.5)}return{transform:`rotate(${d.toFixed(2)}deg) scale(${p.toFixed(4)}) translateZ(0)`,"--border-radius-scale":h.toFixed(4)}},onComplete:()=>{r.style.willChange="",r.style.backfaceVisibility="",r.style.removeProperty("--max-border-radius"),r.style.removeProperty("--border-radius-scale"),r.style.transform="",r.style.transformOrigin="",r.style.position="",r.style.zIndex="",r.style.top="",r.style.left="",r.style.width="",r.style.height="",r.style.overflow="",r.style.borderRadius=""}});return new m.MultiAnimation([l,c],{mode:"parallel"})}}};function ti(e={}){return Qn()}const ei={spring:{stiffness:100,damping:30}},ni=(e={})=>{const t=e.physics??ei;return{prepare:({from:n,to:i})=>(n.then(s=>{s.style.transformOrigin="center center",s.style.willChange="transform, opacity"}),i.then(s=>{s.style.opacity="0",s.style.transform="rotate(-180deg)",s.style.transformOrigin="center center",s.style.willChange="transform, opacity"}),{}),animation:({from:n,to:i})=>{const s=new m.WebAnimation({element:n,integrator:w.from(t),style:r=>({transform:`rotate(${r*180}deg)`,opacity:r<.5?1:0}),onComplete:()=>{n.style.willChange="auto",n.style.transform="",n.style.transformOrigin="",n.style.opacity=""}}),o=new m.WebAnimation({element:i,integrator:w.from(t),style:(r,l)=>({transform:`rotate(${-l*180}deg)`,opacity:r>.5?1:0}),onComplete:()=>{i.style.willChange="auto",i.style.transform="",i.style.transformOrigin="",i.style.opacity=""}});return new m.MultiAnimation([s,o],{mode:"parallel"})}}};function ii(e={}){return ni()}const si={spring:{stiffness:20,damping:8,doubleSpring:1,restDelta:.001,restSpeed:.001}},oi=(e={})=>{const t=e.physics??si,n=e.directional??!0;return{prepare:({from:i,to:s,context:o})=>{const r=!n||o.direction==="forward",l=r?I:R,c=r?R:I;return i.then(a=>{a.style.zIndex=l,a.style.willChange="transform",a.style.backfaceVisibility="hidden",a.style.contain="layout paint",a.style.pointerEvents="none"}),s.then(a=>{a.style.willChange="transform",a.style.backfaceVisibility="hidden",a.style.contain="layout paint",a.style.position="relative",a.style.zIndex=c}),{}},animation:({from:i,to:s,context:o})=>{const r=!n||o.direction==="forward",l=r?R:I,c=i.offsetHeight,a=s.offsetHeight,p=window.innerHeight,u=Math.max(Math.min(c,a),p),d=new m.WebAnimation({element:i,integrator:w.from(t),style:f=>({transform:`translate3d(0, ${r?-u*f:u*f}px, 0)`}),onComplete:()=>{i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain="",i.style.transform="",i.style.pointerEvents="",i.style.zIndex=""}}),h=new m.WebAnimation({element:s,integrator:w.from(t),style:(f,y)=>({transform:`translate3d(0, ${r?y*u:y*-u}px, 0)`}),onComplete:()=>{s.style.willChange="auto",s.style.backfaceVisibility="",s.style.contain="",s.style.transform="",s.style.position==="relative"&&(s.style.position=""),s.style.zIndex===l&&(s.style.zIndex="")}});for(const f of[d,h]){const y=f.onComplete;f.onComplete=()=>{y==null||y(),f.releaseFill()}}return new m.MultiAnimation([d,h],{mode:"parallel"})}}};function ri(e={}){const{type:t="directional"}=e;return oi({directional:t==="directional"})}const ai={spring:{stiffness:200,damping:24}},li={inertia:{acceleration:25,resistance:1.2}},Q=.2;function ci(){return{enterPhysics:ai,exitPhysics:li,background:{willChange:"transform, opacity",enterStyle:(e,t)=>({transform:`scale(${1-Q*e})`,opacity:t}),exitStyle:e=>({transform:`scale(${1-Q+Q*e})`,opacity:e})}}}const pi={spring:{stiffness:200,damping:24}},ui={inertia:{acceleration:25,resistance:1.2}},tt=.08,di=16,et=.6,fi=e=>`blur(${Math.max(0,e).toFixed(2)}px)`;function hi(){return{enterPhysics:pi,exitPhysics:ui,background:{willChange:"transform, opacity",enterStyle:e=>({transform:`scale(${1-tt*e})`,opacity:1-(1-et)*e}),exitStyle:e=>({transform:`scale(${1-tt+tt*e})`,opacity:et+(1-et)*e})},overlay:{willChange:"backdrop-filter",initialStyle:{position:"absolute",left:"0",width:"100%",pointerEvents:"none",backdropFilter:"blur(0px)",WebkitBackdropFilter:"blur(0px)"},style:(e,t)=>{const n=e==="enter"?t:1-t,i=fi(di*n);return{backdropFilter:i,WebkitBackdropFilter:i}}}}}const yi={spring:{stiffness:230,damping:25}},mi={spring:{stiffness:230,damping:25}};function gi(){return{enterPhysics:yi,exitPhysics:mi,background:{willChange:"",enterStyle:()=>({}),exitStyle:()=>({})}}}const bi={static:gi(),"background-scale":ci(),blur:hi()},wi="static",Si="transform",xi=(e={})=>{const t=bi[e.type??wi],n=t.background,i=t.overlay,s=n.willChange!=="";return{prepare:({from:o,to:r,context:l,createElement:c})=>{const a=l.direction==="forward"?"enter":"exit",p=a==="enter"?r:o,u=a==="enter"?o:r;p.then(h=>{h.style.willChange=Si,h.style.backfaceVisibility="hidden",h.style.contain="layout paint",h.style.zIndex=R,a==="enter"?h.style.position="relative":h.style.pointerEvents="none"}),u.then(h=>{s&&(h.style.willChange=n.willChange,h.style.backfaceVisibility="hidden",h.style.contain="layout paint"),h.style.zIndex=I,a==="enter"?h.style.pointerEvents="none":h.style.position="relative"});let d;return i&&(d=c("sheet-overlay"),Object.assign(d.style,i.initialStyle),d.style.willChange=i.willChange,l.positionedParent.appendChild(d)),{overlay:d}},animation:({from:o,to:r,context:l,overlay:c})=>{const a=l.direction==="forward"?"enter":"exit",p=a==="enter"?t.enterPhysics:t.exitPhysics,u=a==="enter"?r:o,d=a==="enter"?o:r,h=T(l,a==="enter"?"to":"from"),f=()=>{o.style.pointerEvents="",o.style.zIndex=""},y=()=>{const x=a==="enter"?R:I;r.style.position==="relative"&&(r.style.position=""),r.style.zIndex===x&&(r.style.zIndex="")},g=x=>{const C=x.onComplete;x.onComplete=()=>{C==null||C(),x.releaseFill()}};u.style.clipPath=`inset(${h.top}px 0 calc(100% - ${h.top+h.height}px) 0)`;const S=a==="enter"?(x,C)=>({transform:`translate3d(0, ${C*h.height}px, 0)`}):x=>({transform:`translate3d(0, ${x*h.height}px, 0)`}),b=new m.WebAnimation({element:u,integrator:w.from(p),style:S,onComplete:()=>{u.style.willChange="auto",u.style.backfaceVisibility="",u.style.contain="",u.style.clipPath="",u.style.transform="",f(),y()}});g(b);const $=[b];if(s){const x=d.scrollHeight;x>0&&(d.style.height=`${x}px`);const C=T(l,a==="enter"?"from":"to"),_=C.left+C.width/2,P=C.top+C.height/2;d.style.clipPath=`inset(${C.top}px 0 calc(100% - ${C.top+C.height}px) 0)`,d.style.transformOrigin=`${_}px ${P}px`;const A=a==="enter"?(M,H)=>n.enterStyle(M,H):M=>n.exitStyle(M),k=new m.WebAnimation({element:d,integrator:w.from(p),style:A,onComplete:()=>{d.style.willChange="auto",d.style.backfaceVisibility="",d.style.contain="",d.style.clipPath="",d.style.transformOrigin="",d.style.transform="",d.style.opacity="",d.style.height=""}});g(k),$.push(k)}if(c&&i){c.style.zIndex=kt;const x=Lt(l,"to");c.style.top=`${x.top}px`,c.style.height=`${x.height}px`,$.push(new m.WebAnimation({element:c,integrator:w.from(p),style:C=>i.style(a,C)}))}return new m.MultiAnimation($,{mode:"parallel"})}}};function Ci(e){return e==="scale"||e==="background-scale"?"background-scale":e==="blur"?"blur":"static"}function $i(e={}){const t=e.type,n=Ci(t);return xi({type:n})}const Ei={spring:{stiffness:170,damping:22,doubleSpring:.8}},Ai=(e={})=>{const t=e.physics??Ei;return{prepare:({from:n,to:i,context:s})=>{const o=s.direction==="forward";return n.then(r=>{r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint",r.style.pointerEvents="none"}),i.then(r=>{const l=o?100:-100;r.style.transform=`translate3d(${l}%, 0, 0)`,r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint"}),{}},animation:({from:n,to:i,context:s})=>{const o=s.direction==="forward",r=new m.WebAnimation({element:n,integrator:w.from(t),style:c=>({transform:`translate3d(${o?-100*c:100*c}%, 0, 0)`}),onComplete:()=>{n.style.willChange="auto",n.style.backfaceVisibility="",n.style.contain="",n.style.transform="",n.style.pointerEvents=""}}),l=new m.WebAnimation({element:i,integrator:w.from(t),style:(c,a)=>({transform:`translate3d(${o?a*100:a*-100}%, 0, 0)`}),onComplete:()=>{i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain="",i.style.transform=""}});return new m.MultiAnimation([r,l],{mode:"parallel"})}}};function Pi(e={}){return Ai()}const _i={spring:{stiffness:17,damping:6}},nt=20,z=800,Ii=(e={})=>{const t=e.physics??_i;return{prepare:({from:n,to:i})=>(n.then(s=>{s.style.willChange="transform",s.style.backfaceVisibility="hidden",s.style.contain="layout paint",s.style.pointerEvents="none",s.style.transform=`perspective(${z}px) rotateY(0deg) translate3d(0%, 0, 0)`}),i.then(s=>{s.style.willChange="transform",s.style.backfaceVisibility="hidden",s.style.contain="layout paint",s.style.transform=`perspective(${z}px) rotateY(${nt}deg) translate3d(-100%, 0, 0)`}),{}),animation:({from:n,to:i})=>{const s=new m.WebAnimation({element:n,integrator:w.from(t),style:r=>{const l=-r*nt,c=r*100;return{transform:`perspective(${z}px) rotateY(${l}deg) translate3d(${c}%, 0, 0)`}},onComplete:()=>{n.style.transform="",n.style.willChange="auto",n.style.backfaceVisibility="",n.style.contain="",n.style.pointerEvents=""}}),o=new m.WebAnimation({element:i,integrator:w.from(t),style:(r,l)=>{const c=l*nt,a=-l*100;return{transform:`perspective(${z}px) rotateY(${c}deg) translate3d(${a}%, 0, 0)`}},onComplete:()=>{i.style.transform="",i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain=""}});return new m.MultiAnimation([s,o],{mode:"sequence"})}}};function Ri(e={}){return Ii()}function Oi(e,t){return t.left>=e.left-.01&&t.top>=e.top-.01&&t.left+t.width<=e.left+e.width+.01&&t.top+t.height<=e.top+e.height+.01}function Vt(e){const t=()=>({enterContent:e.enterRect,exitContent:e.exitRect,startWindow:e.enterRect,scaleX:e.exitRect.width/e.enterRect.width,scaleY:e.exitRect.height/e.enterRect.height}),{enterMedia:n,exitMedia:i}=e;if(!n||!i||!Wt(n,i))return t();const s=n.content,o=i.content;if(s.width<=0||s.height<=0||o.width<=0||o.height<=0)return t();const r=o.width/s.width,l=o.height/s.height,c=Ut(s,o,i.window,r,l);return Oi(n.window,c)?{enterContent:s,exitContent:o,startWindow:c,scaleX:r,scaleY:l}:t()}function Xt(e,t){return{top:e.top/t.height*100,right:(t.width-(e.left+e.width))/t.width*100,bottom:(t.height-(e.top+e.height))/t.height*100,left:e.left/t.width*100}}function Bt(e,t,n){return{x:e/Math.max(Math.abs(t),1e-6),y:e/Math.max(Math.abs(n),1e-6)}}function vi(e){const{pageRect:t,scrollOffset:n,enterRadius:i,exitRadius:s}=e,o=Vt(e),{enterContent:r,exitContent:l,startWindow:c,scaleX:a,scaleY:p}=o,u=l.left-r.left+(l.width-r.width)/2-n.x,d=l.top-r.top+(l.height-r.height)/2-n.y,h=Xt(c,t);return{transformOrigin:`${O(r)}px ${v(r)}px`,animate:f=>{const y=1-f,g=1+(a-1)*y,S=1+(p-1)*y,b=Math.max(0,s*y+i*(1-y)),$=Bt(b,g,S);return{clipPath:`inset(${h.top*y}% ${h.right*y}% ${h.bottom*y}% ${h.left*y}% round ${$.x}px / ${$.y}px)`,transform:`translate(${u*y}px, ${d*y}px) scale(${g}, ${S})`}}}}function Ti(e){const{pageRect:t,scrollOffset:n,enterRadius:i,exitRadius:s}=e,o=Vt(e),{enterContent:r,exitContent:l,startWindow:c,scaleX:a,scaleY:p}=o,u=l.left-r.left+(l.width-r.width)/2+n.x,d=l.top-r.top+(l.height-r.height)/2+n.y,h=Xt(c,t);return{transformOrigin:`${O(r)}px ${v(r)}px`,animate:f=>{const y=1-f,g=1+(a-1)*y,S=1+(p-1)*y,b=Math.max(0,i*(1-y)+s*y),$=Bt(b,g,S);return{clipPath:`inset(${h.top*y}% ${h.right*y}% ${h.bottom*y}% ${h.left*y}% round ${$.x}px / ${$.y}px)`,transform:`translate(${u*y-n.x}px, ${d*y}px) scale(${g}, ${S})`}}}}const Di={spring:{stiffness:380,damping:30,restDelta:.1,restSpeed:.1,doubleSpring:{stiffness:260,damping:30}}},Zt=.12,Fi=18;function Mi(){return{transformOrigin:"50% 50%",animate:e=>{const t=1-e;return{transform:`scale(${1-Zt*t})`}}}}function Li(){return{transformOrigin:"50% 50%",animate:e=>{const t=1-e;return{transform:`scale(${1-Zt*t})`}}}}const it={willChange:"backdrop-filter",initialStyle:{position:"absolute",left:"0",width:"100%",pointerEvents:"none",backdropFilter:"blur(0px)",WebkitBackdropFilter:"blur(0px)"},style:(e,t)=>{const n=e==="enter"?t:1-t,i=`blur(${Fi*n}px)`;return{backdropFilter:i,WebkitBackdropFilter:i}}};class Yi{constructor(){E(this,"physics",Di)}contribute(t){const{from:n,to:i,resolved:s,physics:o}=t,r=s.mode==="enter",l=r?n:i,c=r?Mi():Li();return c&&(l.style.transformOrigin=c.transformOrigin),[new m.WebAnimation({element:l,integrator:w.from(o),style:r?(a,p)=>c.animate(p):a=>c.animate(a)})]}}class ki{prepare(t){const n=t.createElement("zoom-overlay");return Object.assign(n.style,it.initialStyle),n.style.willChange=it.willChange,t.context.positionedParent.appendChild(n),{overlay:n}}contribute(t){const n=t.extras.overlay;if(!n)return[];n.style.zIndex=kt;const i=Lt(t.context,"to");return n.style.top=`${i.top}px`,n.style.height=`${i.height}px`,[new m.WebAnimation({element:n,integrator:w.from(t.physics),style:s=>it.style(t.resolved.mode,s)})]}}const Hi={spring:{stiffness:380,damping:30,doubleSpring:{stiffness:260,damping:30}}};function Ni({enterRect:e,exitRect:t,scrollOffset:n}){const i=e.left-t.left+(e.width-t.width)/2+n.x,s=e.top-t.top+(e.height-t.height)/2+n.y,o=e.width/t.width,r=e.height/t.height,l=Math.max(o,r);return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:c=>{const a=1-c;return{transform:`translate(${i*a-n.x}px, ${s*a}px) scale(${1+(l-1)*a})`}}}}function Wi({enterRect:e,exitRect:t,scrollOffset:n}){const i=e.left-t.left+(e.width-t.width)/2-n.x,s=e.top-t.top+(e.height-t.height)/2-n.y,o=e.width/t.width,r=e.height/t.height,l=Math.max(o,r);return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:c=>{const a=1-c;return{transform:`translate(${i*a}px, ${s*a}px) scale(${1+(l-1)*a})`}}}}class zi{constructor(){E(this,"physics",Hi)}contribute(t){const{from:n,to:i,resolved:s,input:o,physics:r}=t,l=s.mode==="enter",c=l?n:i,a=l?Ni(o):Wi(o);return a&&(c.style.transformOrigin=a.transformOrigin),[new m.WebAnimation({element:c,integrator:w.from(r),style:l?(p,u)=>a.animate(u):p=>a.animate(p)})]}}const Ui={spring:{stiffness:530,damping:34,doubleSpring:1}};class Vi{constructor(){E(this,"physics",Ui)}contribute(t){return[]}}const Xi={expand:()=>new zi,static:()=>new Vi,blur:()=>new Yi};function Bi(e){return Xi[e]()}const at="data-zoom-enter-key",Tt="data-zoom-exit-key",Dt="data-zoom-radius";function Zi(e,t){return Math.abs(e.left-t.left)<.01&&Math.abs(e.top-t.top)<.01&&Math.abs(e.width-t.width)<.01&&Math.abs(e.height-t.height)<.01}function Gi(e,t){const n=[];let i=t;for(;i&&i!==e;){const s=i.parentElement;if(!s)break;for(const o of Array.from(s.children))o!==i&&o instanceof HTMLElement&&n.push(o);i=s}return n}function Ft(e){const t=e.querySelectorAll(`[${at}]`);return t.length!==1?null:t[0]}function Mt(e,t){const n=e.querySelectorAll(`[${Tt}]`);for(const i of n)if(i.getAttribute(Tt)===t)return i;return null}function ji(e,t,n){if(n==="forward"){const r=Ft(t);if(!r)return null;const l=r.getAttribute(at);if(!l)return null;const c=Mt(e,l);return c?{mode:"enter",enterEl:r,exitEl:c}:null}const i=Ft(e);if(!i)return null;const s=i.getAttribute(at);if(!s)return null;const o=Mt(t,s);return o?{mode:"exit",enterEl:i,exitEl:o}:null}function qi(e,t,n,i){const s=e.mode==="enter"?n:t,o=e.mode==="enter"?t:n,r=N(s,e.enterEl),l=N(o,e.exitEl),c=rt(e.enterEl,r,g=>N(s,g),{legacyRadiusAttribute:Dt}),a=rt(e.exitEl,l,g=>N(o,g),{legacyRadiusAttribute:Dt}),[p,u]=zt(c,a),d=p.contentAware&&u.contentAware,h=e.mode==="enter"?n.getBoundingClientRect():t.getBoundingClientRect(),f={left:0,top:0,width:h.width,height:h.height},y=p.radiusSource==="legacy"||Zi(p.window,f)?p.radius:0;return{enterRect:r,exitRect:l,...d?{enterMedia:p,exitMedia:u}:{},pageRect:h,scrollOffset:i,enterRadius:y,exitRadius:u.radius}}class Ki{prepare(t){t.from.then(n=>{n.style.willChange="transform, clip-path, opacity",n.style.backfaceVisibility="hidden",n.style.contain="layout paint"})}contribute(t){const{from:n,to:i,resolved:s,input:o,physics:r,onComplete:l}=t,c=s.mode==="enter",a=c?vi(o):Ti(o),p=c?i:n,u=c?"t":"u";a&&(p.style.transformOrigin=a.transformOrigin);const d=c?I:R,h=c?R:I,f=n.style.zIndex;n.style.zIndex=d;const y=i.style.zIndex,g=i.style.position;return i.style.zIndex=h,i.style.position="relative",l(()=>{p.style.willChange="auto",p.style.backfaceVisibility="",p.style.transformOrigin="",p.style.contain="",n.style.zIndex=f,i.style.zIndex===h&&(i.style.zIndex=y),i.style.position==="relative"&&(i.style.position=g),i.style.transformOrigin="",n.style.willChange="auto",n.style.backfaceVisibility="",n.style.transformOrigin="",n.style.contain="",n.style.transform="",n.style.clipPath=""}),[new m.WebAnimation({element:p,integrator:w.from(r),style:u==="t"?S=>a.animate(S):(S,b)=>a.animate(b)})]}}class Ji{contribute(t){const{resolved:n,physics:i,from:s,to:o,onComplete:r}=t,l=n.mode==="enter"?o:s,c=Gi(l,n.enterEl);if(c.length===0)return[];const a=c.map(p=>p.style.opacity);if(n.mode==="enter")for(const p of c)p.style.opacity="0";return r(()=>{for(let p=0;p<c.length;p++){const u=c[p];u&&(u.style.opacity=a[p]??"")}}),c.map(p=>new m.WebAnimation({element:p,integrator:w.from(i),style:(u,d)=>({opacity:n.mode==="enter"?u:d})}))}}class Gt{contribute(){return[]}}const Qi={default:()=>new Gt,fade:()=>new Ji};function ts(e){return Qi[e]()}class es extends Gt{}function ns(e){const t=Bi(e.type);return{strategies:[new Ki,t,ts(e.variant),new es,...e.type==="blur"?[new ki]:[]],physics:t.physics}}const is=e=>{const{strategies:t,physics:n}=ns(e);return{prepare:i=>{const s={from:i.from,to:i.to,context:{positionedParent:i.context.positionedParent},createElement:i.createElement},o={};for(const r of t){if(!r.prepare)continue;const l=r.prepare(s);l&&Object.assign(o,l)}return o},animation:({from:i,to:s,context:o,...r})=>{const l=ji(i,s,o.direction);if(!l)return new m.MultiAnimation([],{mode:"parallel"});const c=qi(l,i,s,o.scrollOffset),a=[],u={from:i,to:s,resolved:l,input:c,physics:n,context:o,extras:r,onComplete:f=>{a.push(f)}},d=[];for(const f of t)f.contribute&&d.push(...f.contribute(u));const h=d[0];if(h){const f=h.onComplete;h.onComplete=()=>{f==null||f();for(const y of a)try{y()}catch(g){console.error("[zoom] cleanup error",g)}}}for(const f of d){if(!(f instanceof m.WebAnimation))continue;const y=f.onComplete;f.onComplete=()=>{y==null||y(),f.releaseFill()}}return new m.MultiAnimation(d,{mode:"parallel"})}}};function ss(e){const t=e.type??"static",n=e.variant??(e.fade?"fade":"default");return{type:t,variant:n}}function os(e={}){const t=ss(e);return is(t)}exports.Animation=m.Animation;exports.MultiAnimation=m.MultiAnimation;exports.WebAnimation=m.WebAnimation;exports.axis=Ye;exports.blind=Ue;exports.drill=tn;exports.fade=on;exports.film=hn;exports.hero=qn;exports.jaemin=ti;exports.rotate=ii;exports.scroll=ri;exports.sheet=$i;exports.slide=Pi;exports.strip=Ri;exports.zoom=os;
|
package/dist/index.js
CHANGED
|
@@ -200,7 +200,7 @@ function z(e, t) {
|
|
|
200
200
|
s.height / i
|
|
201
201
|
);
|
|
202
202
|
}
|
|
203
|
-
function
|
|
203
|
+
function F(e, t) {
|
|
204
204
|
const { scrollingElement: n, positionedParent: s } = e, o = n !== s && n.contains(s) ? k(n, s).top : 0;
|
|
205
205
|
return {
|
|
206
206
|
top: e[t].scroll.y,
|
|
@@ -342,10 +342,16 @@ function Ce() {
|
|
|
342
342
|
build: xe
|
|
343
343
|
};
|
|
344
344
|
}
|
|
345
|
-
const $e =
|
|
345
|
+
const $e = 40, Ee = {
|
|
346
346
|
inertia: { acceleration: 150, resistance: 1.5, restDelta: 0.1 }
|
|
347
347
|
}, Pe = {
|
|
348
|
-
spring: {
|
|
348
|
+
spring: {
|
|
349
|
+
stiffness: 400,
|
|
350
|
+
damping: 30,
|
|
351
|
+
doubleSpring: 1.2,
|
|
352
|
+
restDelta: 0.1,
|
|
353
|
+
restSpeed: 0.1
|
|
354
|
+
}
|
|
349
355
|
};
|
|
350
356
|
function _e(e) {
|
|
351
357
|
const t = $e;
|
|
@@ -374,7 +380,7 @@ function Ae() {
|
|
|
374
380
|
return {
|
|
375
381
|
outPhysics: Ee,
|
|
376
382
|
inPhysics: Pe,
|
|
377
|
-
composition: { mode: "
|
|
383
|
+
composition: { mode: "parallel", startAt: [0, 0] },
|
|
378
384
|
build: _e
|
|
379
385
|
};
|
|
380
386
|
}
|
|
@@ -446,7 +452,7 @@ function Oe() {
|
|
|
446
452
|
}
|
|
447
453
|
};
|
|
448
454
|
}
|
|
449
|
-
function
|
|
455
|
+
function De() {
|
|
450
456
|
return {
|
|
451
457
|
outPhysics: bt,
|
|
452
458
|
inPhysics: bt,
|
|
@@ -454,17 +460,17 @@ function Fe() {
|
|
|
454
460
|
build: Oe
|
|
455
461
|
};
|
|
456
462
|
}
|
|
457
|
-
const St = ve(),
|
|
463
|
+
const St = ve(), Fe = {
|
|
458
464
|
snappy: St,
|
|
459
465
|
directional: St,
|
|
460
|
-
"non-directional":
|
|
461
|
-
},
|
|
466
|
+
"non-directional": De()
|
|
467
|
+
}, Te = {
|
|
462
468
|
x: be,
|
|
463
469
|
y: Ie,
|
|
464
|
-
z:
|
|
470
|
+
z: Fe
|
|
465
471
|
};
|
|
466
472
|
function Me(e, t) {
|
|
467
|
-
const n =
|
|
473
|
+
const n = Te[e];
|
|
468
474
|
return n[t] ?? n.snappy;
|
|
469
475
|
}
|
|
470
476
|
const Ye = "x", Le = "snappy";
|
|
@@ -493,7 +499,7 @@ const He = (e = {}) => {
|
|
|
493
499
|
animation: ({ from: o, to: i, context: r }) => {
|
|
494
500
|
const l = s.build({ direction: r.direction });
|
|
495
501
|
if (t === "z") {
|
|
496
|
-
const p =
|
|
502
|
+
const p = F(r, "from"), d = F(r, "to");
|
|
497
503
|
o.style.clipPath = `inset(${p.top}px 0 calc(100% - ${p.top + p.height}px) 0)`, i.style.clipPath = `inset(${d.top}px 0 calc(100% - ${d.top + d.height}px) 0)`;
|
|
498
504
|
}
|
|
499
505
|
const c = new b({
|
|
@@ -807,7 +813,7 @@ const q = {
|
|
|
807
813
|
scaleDown: { stiffness: 20, damping: 7 },
|
|
808
814
|
translate: { stiffness: 15, damping: 7 },
|
|
809
815
|
scaleUp: { stiffness: 20, damping: 7 }
|
|
810
|
-
},
|
|
816
|
+
}, T = {
|
|
811
817
|
scaleDown: 0,
|
|
812
818
|
translate: 0.2,
|
|
813
819
|
scaleUp: 0.8
|
|
@@ -854,7 +860,7 @@ function Pt(e) {
|
|
|
854
860
|
const { rect: t, scale: n, direction: s, override: o } = e, i = s === "out" ? { scale: 1, translateY: -t.top } : { scale: n, translateY: -t.top + t.height }, r = K(o, q.scaleDown), l = K(o, q.translate), c = K(o, q.scaleUp), a = s === "out" ? 1 : 0, p = s === "out" ? 0 : 1, d = s === "out" ? [
|
|
855
861
|
{
|
|
856
862
|
spring: r,
|
|
857
|
-
offset:
|
|
863
|
+
offset: T.scaleDown,
|
|
858
864
|
tick: (f) => {
|
|
859
865
|
const y = 1 - f;
|
|
860
866
|
i.scale = 1 - (1 - n) * y;
|
|
@@ -862,7 +868,7 @@ function Pt(e) {
|
|
|
862
868
|
},
|
|
863
869
|
{
|
|
864
870
|
spring: l,
|
|
865
|
-
offset:
|
|
871
|
+
offset: T.translate,
|
|
866
872
|
tick: (f) => {
|
|
867
873
|
const y = 1 - f;
|
|
868
874
|
i.translateY = -t.top - t.height * y;
|
|
@@ -870,7 +876,7 @@ function Pt(e) {
|
|
|
870
876
|
},
|
|
871
877
|
{
|
|
872
878
|
spring: c,
|
|
873
|
-
offset:
|
|
879
|
+
offset: T.scaleUp,
|
|
874
880
|
tick: (f) => {
|
|
875
881
|
const y = 1 - f;
|
|
876
882
|
i.scale = n + (1 - n) * y;
|
|
@@ -879,21 +885,21 @@ function Pt(e) {
|
|
|
879
885
|
] : [
|
|
880
886
|
{
|
|
881
887
|
spring: r,
|
|
882
|
-
offset:
|
|
888
|
+
offset: T.scaleDown,
|
|
883
889
|
tick: (f) => {
|
|
884
890
|
i.scale = 1 - (1 - n) * f;
|
|
885
891
|
}
|
|
886
892
|
},
|
|
887
893
|
{
|
|
888
894
|
spring: l,
|
|
889
|
-
offset:
|
|
895
|
+
offset: T.translate,
|
|
890
896
|
tick: (f) => {
|
|
891
897
|
i.translateY = -t.top + t.height * (1 - f);
|
|
892
898
|
}
|
|
893
899
|
},
|
|
894
900
|
{
|
|
895
901
|
spring: c,
|
|
896
|
-
offset:
|
|
902
|
+
offset: T.scaleUp,
|
|
897
903
|
tick: (f) => {
|
|
898
904
|
i.scale = n + (1 - n) * f;
|
|
899
905
|
}
|
|
@@ -1022,7 +1028,7 @@ const fn = (e = {}) => {
|
|
|
1022
1028
|
const t = ((o = e.border) == null ? void 0 : o.color) ?? an, n = rn, s = e.physics;
|
|
1023
1029
|
return {
|
|
1024
1030
|
prepare: ({ from: i, to: r, context: l }) => {
|
|
1025
|
-
const c =
|
|
1031
|
+
const c = F(l, "from"), a = F(l, "to"), p = k(document.body, l.positionedParent), d = un(t, {
|
|
1026
1032
|
...c,
|
|
1027
1033
|
top: p.top
|
|
1028
1034
|
});
|
|
@@ -1209,7 +1215,7 @@ function Cn(e) {
|
|
|
1209
1215
|
function O(e) {
|
|
1210
1216
|
return e.left + e.width / 2;
|
|
1211
1217
|
}
|
|
1212
|
-
function
|
|
1218
|
+
function D(e) {
|
|
1213
1219
|
return e.top + e.height / 2;
|
|
1214
1220
|
}
|
|
1215
1221
|
function pt(e, t) {
|
|
@@ -1302,7 +1308,7 @@ function Wt(e, t, n, s, o) {
|
|
|
1302
1308
|
const i = n.width / s, r = n.height / o;
|
|
1303
1309
|
return {
|
|
1304
1310
|
left: O(e) + (O(n) - O(t)) / s - i / 2,
|
|
1305
|
-
top:
|
|
1311
|
+
top: D(e) + (D(n) - D(t)) / o - r / 2,
|
|
1306
1312
|
width: i,
|
|
1307
1313
|
height: r
|
|
1308
1314
|
};
|
|
@@ -1315,7 +1321,7 @@ const Pn = {
|
|
|
1315
1321
|
function M(e) {
|
|
1316
1322
|
return Pn[e];
|
|
1317
1323
|
}
|
|
1318
|
-
const Ot = "data-hero-enter-key",
|
|
1324
|
+
const Ot = "data-hero-enter-key", Dt = "data-hero-exit-key", Q = "data-hero-key";
|
|
1319
1325
|
class _n {
|
|
1320
1326
|
constructor() {
|
|
1321
1327
|
E(this, "previousFromOpacity", "");
|
|
@@ -1356,13 +1362,13 @@ const Rn = () => new In(), vn = {
|
|
|
1356
1362
|
fade: Rn
|
|
1357
1363
|
}, On = {
|
|
1358
1364
|
spring: { stiffness: 320, damping: 30 }
|
|
1359
|
-
},
|
|
1365
|
+
}, Dn = () => On, Fn = {
|
|
1360
1366
|
spring: { stiffness: 300, damping: 30, doubleSpring: 1 }
|
|
1361
|
-
},
|
|
1362
|
-
default:
|
|
1363
|
-
smooth:
|
|
1367
|
+
}, Tn = () => Fn, Mn = {
|
|
1368
|
+
default: Dn,
|
|
1369
|
+
smooth: Tn
|
|
1364
1370
|
}, Yn = 700, Ln = "data-hero-aspect-ratio", kn = "data-hero-radius";
|
|
1365
|
-
function
|
|
1371
|
+
function Ft(e, t, n) {
|
|
1366
1372
|
const s = k(e, t);
|
|
1367
1373
|
return at(
|
|
1368
1374
|
t,
|
|
@@ -1384,7 +1390,7 @@ function U(e, t) {
|
|
|
1384
1390
|
return n;
|
|
1385
1391
|
}
|
|
1386
1392
|
function Hn(e, t) {
|
|
1387
|
-
const n = [], s = U(t, Ot), o = U(e,
|
|
1393
|
+
const n = [], s = U(t, Ot), o = U(e, Dt);
|
|
1388
1394
|
for (const [l, c] of s) {
|
|
1389
1395
|
const a = o.get(l);
|
|
1390
1396
|
a && n.push({
|
|
@@ -1395,7 +1401,7 @@ function Hn(e, t) {
|
|
|
1395
1401
|
toFit: M("enter")
|
|
1396
1402
|
});
|
|
1397
1403
|
}
|
|
1398
|
-
const i = U(e, Ot), r = U(t,
|
|
1404
|
+
const i = U(e, Ot), r = U(t, Dt);
|
|
1399
1405
|
for (const [l, c] of i) {
|
|
1400
1406
|
const a = r.get(l);
|
|
1401
1407
|
a && n.push({
|
|
@@ -1440,15 +1446,15 @@ function Vn(e, t) {
|
|
|
1440
1446
|
}
|
|
1441
1447
|
function Xn(e, t, n) {
|
|
1442
1448
|
const { fromEl: s, toEl: o } = t, [i, r] = Un(
|
|
1443
|
-
|
|
1444
|
-
|
|
1449
|
+
Ft(e, s, t.fromFit),
|
|
1450
|
+
Ft(e, o, t.toFit)
|
|
1445
1451
|
), l = i.content, c = i.window, a = r.content, p = r.window, d = r.clipInset, u = i.radiusSource === "unsupported" || r.radiusSource === "unsupported", h = u ? 0 : i.radius, f = u ? 0 : r.radius;
|
|
1446
1452
|
if (l.width === 0 || l.height === 0 || c.width === 0 || c.height === 0 || a.width === 0 || a.height === 0 || p.width === 0 || p.height === 0)
|
|
1447
1453
|
return null;
|
|
1448
1454
|
const y = Math.max(
|
|
1449
1455
|
l.width / a.width,
|
|
1450
1456
|
l.height / a.height
|
|
1451
|
-
), m = O(l), S =
|
|
1457
|
+
), m = O(l), S = D(l), g = O(a), $ = D(a), x = m - g, C = S - $;
|
|
1452
1458
|
if (Math.abs(C) > n) return null;
|
|
1453
1459
|
const I = pt(
|
|
1454
1460
|
a,
|
|
@@ -1558,7 +1564,7 @@ const jn = {
|
|
|
1558
1564
|
prepare: ({ from: i, to: r, context: l }) => (i.then((c) => {
|
|
1559
1565
|
c.style.opacity = "1";
|
|
1560
1566
|
}), r.then((c) => {
|
|
1561
|
-
const a =
|
|
1567
|
+
const a = F(l, "to"), p = Math.min(a.width, a.height) * 0.4;
|
|
1562
1568
|
c.style.setProperty("--max-border-radius", `${p}px`), c.style.setProperty("--border-radius-scale", "1"), c.style.willChange = "transform", c.style.backfaceVisibility = "hidden";
|
|
1563
1569
|
const d = a.left + a.width / 2, u = a.top + a.height / 2;
|
|
1564
1570
|
c.style.transformOrigin = `${d}px ${u}px`, c.style.position = "fixed", c.style.top = `${a.top}px`, c.style.left = `${a.left}px`, c.style.width = `${a.width}px`, c.style.height = `${a.height}px`, c.style.zIndex = "1000", c.style.overflow = "hidden", c.style.transform = `rotate(${n}deg) scale(${s}) translateZ(0)`, c.style.borderRadius = "calc(var(--max-border-radius) * var(--border-radius-scale))", c.style.opacity = "1";
|
|
@@ -1824,7 +1830,7 @@ const fs = {
|
|
|
1824
1830
|
return s && (u = c("sheet-overlay"), Object.assign(u.style, s.initialStyle), u.style.willChange = s.willChange, l.positionedParent.appendChild(u)), { overlay: u };
|
|
1825
1831
|
},
|
|
1826
1832
|
animation: ({ from: i, to: r, context: l, overlay: c }) => {
|
|
1827
|
-
const a = l.direction === "forward" ? "enter" : "exit", p = a === "enter" ? t.enterPhysics : t.exitPhysics, d = a === "enter" ? r : i, u = a === "enter" ? i : r, h =
|
|
1833
|
+
const a = l.direction === "forward" ? "enter" : "exit", p = a === "enter" ? t.enterPhysics : t.exitPhysics, d = a === "enter" ? r : i, u = a === "enter" ? i : r, h = F(
|
|
1828
1834
|
l,
|
|
1829
1835
|
a === "enter" ? "to" : "from"
|
|
1830
1836
|
), f = () => {
|
|
@@ -1856,7 +1862,7 @@ const fs = {
|
|
|
1856
1862
|
if (o) {
|
|
1857
1863
|
const x = u.scrollHeight;
|
|
1858
1864
|
x > 0 && (u.style.height = `${x}px`);
|
|
1859
|
-
const C =
|
|
1865
|
+
const C = F(
|
|
1860
1866
|
l,
|
|
1861
1867
|
a === "enter" ? "from" : "to"
|
|
1862
1868
|
), I = C.left + C.width / 2, A = C.top + C.height / 2;
|
|
@@ -2025,7 +2031,7 @@ function jt(e, t, n) {
|
|
|
2025
2031
|
function $s(e) {
|
|
2026
2032
|
const { pageRect: t, scrollOffset: n, enterRadius: s, exitRadius: o } = e, i = Zt(e), { enterContent: r, exitContent: l, startWindow: c, scaleX: a, scaleY: p } = i, d = l.left - r.left + (l.width - r.width) / 2 - n.x, u = l.top - r.top + (l.height - r.height) / 2 - n.y, h = Gt(c, t);
|
|
2027
2033
|
return {
|
|
2028
|
-
transformOrigin: `${O(r)}px ${
|
|
2034
|
+
transformOrigin: `${O(r)}px ${D(r)}px`,
|
|
2029
2035
|
animate: (f) => {
|
|
2030
2036
|
const y = 1 - f, m = 1 + (a - 1) * y, S = 1 + (p - 1) * y, g = Math.max(0, o * y + s * (1 - y)), $ = jt(g, m, S);
|
|
2031
2037
|
return {
|
|
@@ -2038,7 +2044,7 @@ function $s(e) {
|
|
|
2038
2044
|
function Es(e) {
|
|
2039
2045
|
const { pageRect: t, scrollOffset: n, enterRadius: s, exitRadius: o } = e, i = Zt(e), { enterContent: r, exitContent: l, startWindow: c, scaleX: a, scaleY: p } = i, d = l.left - r.left + (l.width - r.width) / 2 + n.x, u = l.top - r.top + (l.height - r.height) / 2 + n.y, h = Gt(c, t);
|
|
2040
2046
|
return {
|
|
2041
|
-
transformOrigin: `${O(r)}px ${
|
|
2047
|
+
transformOrigin: `${O(r)}px ${D(r)}px`,
|
|
2042
2048
|
animate: (f) => {
|
|
2043
2049
|
const y = 1 - f, m = 1 + (a - 1) * y, S = 1 + (p - 1) * y, g = Math.max(0, s * (1 - y) + o * y), $ = jt(g, m, S);
|
|
2044
2050
|
return {
|
|
@@ -2052,6 +2058,8 @@ const Ps = {
|
|
|
2052
2058
|
spring: {
|
|
2053
2059
|
stiffness: 380,
|
|
2054
2060
|
damping: 30,
|
|
2061
|
+
restDelta: 0.1,
|
|
2062
|
+
restSpeed: 0.1,
|
|
2055
2063
|
doubleSpring: {
|
|
2056
2064
|
stiffness: 260,
|
|
2057
2065
|
damping: 30
|
|
@@ -2147,7 +2155,7 @@ const Os = {
|
|
|
2147
2155
|
}
|
|
2148
2156
|
}
|
|
2149
2157
|
};
|
|
2150
|
-
function
|
|
2158
|
+
function Ds({
|
|
2151
2159
|
enterRect: e,
|
|
2152
2160
|
exitRect: t,
|
|
2153
2161
|
scrollOffset: n
|
|
@@ -2163,7 +2171,7 @@ function Fs({
|
|
|
2163
2171
|
}
|
|
2164
2172
|
};
|
|
2165
2173
|
}
|
|
2166
|
-
function
|
|
2174
|
+
function Fs({
|
|
2167
2175
|
enterRect: e,
|
|
2168
2176
|
exitRect: t,
|
|
2169
2177
|
scrollOffset: n
|
|
@@ -2179,12 +2187,12 @@ function Ts({
|
|
|
2179
2187
|
}
|
|
2180
2188
|
};
|
|
2181
2189
|
}
|
|
2182
|
-
class
|
|
2190
|
+
class Ts {
|
|
2183
2191
|
constructor() {
|
|
2184
2192
|
E(this, "physics", Os);
|
|
2185
2193
|
}
|
|
2186
2194
|
contribute(t) {
|
|
2187
|
-
const { from: n, to: s, resolved: o, input: i, physics: r } = t, l = o.mode === "enter", c = l ? n : s, a = l ?
|
|
2195
|
+
const { from: n, to: s, resolved: o, input: i, physics: r } = t, l = o.mode === "enter", c = l ? n : s, a = l ? Ds(i) : Fs(i);
|
|
2188
2196
|
return a && (c.style.transformOrigin = a.transformOrigin), [
|
|
2189
2197
|
new b({
|
|
2190
2198
|
element: c,
|
|
@@ -2210,14 +2218,14 @@ class Ys {
|
|
|
2210
2218
|
}
|
|
2211
2219
|
}
|
|
2212
2220
|
const Ls = {
|
|
2213
|
-
expand: () => new
|
|
2221
|
+
expand: () => new Ts(),
|
|
2214
2222
|
static: () => new Ys(),
|
|
2215
2223
|
blur: () => new Rs()
|
|
2216
2224
|
};
|
|
2217
2225
|
function ks(e) {
|
|
2218
2226
|
return Ls[e]();
|
|
2219
2227
|
}
|
|
2220
|
-
const lt = "data-zoom-enter-key",
|
|
2228
|
+
const lt = "data-zoom-enter-key", Tt = "data-zoom-exit-key", Mt = "data-zoom-radius";
|
|
2221
2229
|
function Hs(e, t) {
|
|
2222
2230
|
return Math.abs(e.left - t.left) < 0.01 && Math.abs(e.top - t.top) < 0.01 && Math.abs(e.width - t.width) < 0.01 && Math.abs(e.height - t.height) < 0.01;
|
|
2223
2231
|
}
|
|
@@ -2238,9 +2246,9 @@ function Yt(e) {
|
|
|
2238
2246
|
return t.length !== 1 ? null : t[0];
|
|
2239
2247
|
}
|
|
2240
2248
|
function Lt(e, t) {
|
|
2241
|
-
const n = e.querySelectorAll(`[${
|
|
2249
|
+
const n = e.querySelectorAll(`[${Tt}]`);
|
|
2242
2250
|
for (const s of n)
|
|
2243
|
-
if (s.getAttribute(
|
|
2251
|
+
if (s.getAttribute(Tt) === t)
|
|
2244
2252
|
return s;
|
|
2245
2253
|
return null;
|
|
2246
2254
|
}
|
|
@@ -10,8 +10,8 @@ export type AxisXVariant = "default" | "snappy";
|
|
|
10
10
|
* Public `variant` value for `axis({ type: "y" })`.
|
|
11
11
|
*
|
|
12
12
|
* - `"default"` — directional fade-through. Forward = bottom→top.
|
|
13
|
-
* - `"non-directional"` — direction-agnostic. Incoming always
|
|
14
|
-
* below; outgoing fades in place.
|
|
13
|
+
* - `"non-directional"` — direction-agnostic cross-fade. Incoming always
|
|
14
|
+
* rises from below; outgoing fades in place.
|
|
15
15
|
*/
|
|
16
16
|
export type AxisYVariant = "default" | "non-directional";
|
|
17
17
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"non-directional.d.ts","sourceRoot":"","sources":["../../../../../src/lib/transitions/axis/provider/y/non-directional.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,YAAY,EAEb,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"non-directional.d.ts","sourceRoot":"","sources":["../../../../../src/lib/transitions/axis/provider/y/non-directional.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,YAAY,EAEb,MAAM,aAAa,CAAC;AAqDrB,wBAAgB,6BAA6B,IAAI,YAAY,CAO5D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blur.d.ts","sourceRoot":"","sources":["../../../../src/lib/transitions/zoom/provider/blur.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,KAAK,EAEV,iBAAiB,EACjB,UAAU,EAEV,cAAc,EACd,YAAY,EACZ,YAAY,EACb,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,SAAS,EAGV,MAAM,oBAAoB,CAAC;AAK5B,eAAO,MAAM,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"blur.d.ts","sourceRoot":"","sources":["../../../../src/lib/transitions/zoom/provider/blur.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,KAAK,EAEV,iBAAiB,EACjB,UAAU,EAEV,cAAc,EACd,YAAY,EACZ,YAAY,EACb,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,SAAS,EAGV,MAAM,oBAAoB,CAAC;AAK5B,eAAO,MAAM,YAAY,EAAE,cAW1B,CAAC;AAqEF,qBAAa,sBAAuB,YAAW,YAAY;IACzD,QAAQ,CAAC,OAAO,iBAAgB;IAEhC,UAAU,CAAC,GAAG,EAAE,iBAAiB,GAAG,SAAS,EAAE;CAkBhD;AAQD,qBAAa,eAAgB,YAAW,YAAY;IAClD,OAAO,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC;IAQjD,UAAU,CAAC,GAAG,EAAE,iBAAiB,GAAG,SAAS,EAAE;CA2BhD;AAMD,wBAAgB,kBAAkB,IAAI,YAAY,CASjD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ssgoi/core",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.3",
|
|
4
4
|
"description": "Core animation engine for SSGOI - Native app-like page transitions with spring physics",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -32,18 +32,6 @@
|
|
|
32
32
|
"!dist/**/*.test.*",
|
|
33
33
|
"!dist/**/*.spec.*"
|
|
34
34
|
],
|
|
35
|
-
"scripts": {
|
|
36
|
-
"dev": "vite",
|
|
37
|
-
"watch": "vite build --watch",
|
|
38
|
-
"build": "tsc && vite build",
|
|
39
|
-
"preview": "vite preview",
|
|
40
|
-
"prepare": "pnpm run build",
|
|
41
|
-
"lint": "eslint .",
|
|
42
|
-
"test": "vitest",
|
|
43
|
-
"test:ui": "vitest --ui",
|
|
44
|
-
"test:run": "vitest run",
|
|
45
|
-
"test:coverage": "vitest run --coverage"
|
|
46
|
-
},
|
|
47
35
|
"keywords": [
|
|
48
36
|
"page-transition",
|
|
49
37
|
"page-transitions",
|
|
@@ -88,5 +76,16 @@
|
|
|
88
76
|
"vite": "^6.0.7",
|
|
89
77
|
"vite-plugin-dts": "^4.5.0",
|
|
90
78
|
"vitest": "^3.2.4"
|
|
79
|
+
},
|
|
80
|
+
"scripts": {
|
|
81
|
+
"dev": "vite",
|
|
82
|
+
"watch": "vite build --watch",
|
|
83
|
+
"build": "tsc && vite build",
|
|
84
|
+
"preview": "vite preview",
|
|
85
|
+
"lint": "eslint .",
|
|
86
|
+
"test": "vitest",
|
|
87
|
+
"test:ui": "vitest --ui",
|
|
88
|
+
"test:run": "vitest run",
|
|
89
|
+
"test:coverage": "vitest run --coverage"
|
|
91
90
|
}
|
|
92
|
-
}
|
|
91
|
+
}
|