@ssgoi/react 0.0.6 → 0.0.7

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=(r={})=>{const{from:i=0,to:c=1,spring:a={stiffness:300,damping:30}}=r;return{in:o=>({spring:a,tick:s=>{const t=i+(c-i)*s;o.style.opacity=t.toString()}}),out:o=>({spring:a,tick:s=>{const t=i+(c-i)*s;o.style.opacity=t.toString()}})}},u=(r={})=>{const{from:i=0,to:c=1,spring:a={stiffness:300,damping:30}}=r;return{in:o=>({spring:a,tick:s=>{const t=i+(c-i)*s;o.style.transform=`scale(${t})`}}),out:o=>({spring:a,tick:s=>{const t=i+(c-i)*s;o.style.transform=`scale(${t})`}})}},y=(r={})=>{const{direction:i="left",distance:c=100,fade:a=!0,spring:o={stiffness:400,damping:35}}=r,s=t=>{const n=(1-t)*c;switch(i){case"left":return`translateX(${-n}px)`;case"right":return`translateX(${n}px)`;case"up":return`translateY(${-n}px)`;case"down":return`translateY(${n}px)`}};return{in:t=>({spring:o,tick:n=>{t.style.transform=s(n),a&&(t.style.opacity=n.toString())}}),out:t=>({spring:o,tick:n=>{t.style.transform=s(n),a&&(t.style.opacity=n.toString())}})}},p=(r={})=>{const{degrees:i=360,clockwise:c=!0,scale:a=!1,fade:o=!1,spring:s={stiffness:500,damping:25}}=r,t=c?i:-i;return{in:n=>({spring:s,tick:e=>{const f=[`rotate(${e*t}deg)`];a&&f.push(`scale(${e})`),n.style.transform=f.join(" "),o&&(n.style.opacity=e.toString())}}),out:n=>({spring:s,tick:e=>{const f=[`rotate(${e*t}deg)`];a&&f.push(`scale(${e})`),n.style.transform=f.join(" "),o&&(n.style.opacity=e.toString())}})}},d=(r={})=>{const{height:i=20,scale:c=!0,fade:a=!1,spring:o={stiffness:800,damping:15}}=r;return{in:s=>({spring:o,tick:t=>{const n=[],e=Math.sin(t*Math.PI)*i*(1-t);n.push(`translateY(${-e}px)`),c&&n.push(`scale(${.8+t*.2})`),s.style.transform=n.join(" "),a&&(s.style.opacity=t.toString())}}),out:s=>({spring:o,tick:t=>{const n=[],e=Math.sin(t*Math.PI)*i*(1-t);n.push(`translateY(${-e}px)`),c&&n.push(`scale(${.8+t*.2})`),s.style.transform=n.join(" "),a&&(s.style.opacity=t.toString())}})}},g=(r={})=>{const{amount:i=10,scale:c=!1,fade:a=!0,spring:o={stiffness:300,damping:30}}=r;return{in:s=>({spring:o,tick:t=>{const e=[`blur(${(1-t)*i}px)`];s.style.filter=e.join(" "),c&&(s.style.transform=`scale(${.8+t*.2})`),a&&(s.style.opacity=t.toString())}}),out:s=>({spring:o,tick:t=>{const e=[`blur(${(1-t)*i}px)`];s.style.filter=e.join(" "),c&&(s.style.transform=`scale(${.8+t*.2})`),a&&(s.style.opacity=t.toString())}})}},m=(r={})=>{const{spring:i={stiffness:1e3,damping:100}}=r;return{in:c=>({spring:i,tick:a=>{}}),out:c=>({spring:i,tick:a=>{}})}};exports.blur=g;exports.bounce=d;exports.fade=l;exports.none=m;exports.rotate=p;exports.scale=u;exports.slide=y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=(o={})=>{const{from:i=0,to:a=1,spring:e={stiffness:300,damping:30}}=o;return{in:r=>({spring:e,tick:n=>{const t=i+(a-i)*n;r.style.opacity=t.toString()}}),out:r=>({spring:e,tick:n=>{const t=i+(a-i)*n;r.style.opacity=t.toString()}})}},g=(o={})=>{const{from:i=0,to:a=1,spring:e={stiffness:300,damping:30}}=o;return{in:r=>({spring:e,tick:n=>{const t=i+(a-i)*n;r.style.transform=`scale(${t})`}}),out:r=>({spring:e,tick:n=>{const t=i+(a-i)*n;r.style.transform=`scale(${t})`}})}},f=(o={})=>{const{direction:i="left",distance:a=100,fade:e=!0,spring:r={stiffness:400,damping:35}}=o,n=t=>{const s=(1-t)*a;switch(i){case"left":return`translateX(${-s}px)`;case"right":return`translateX(${s}px)`;case"up":return`translateY(${-s}px)`;case"down":return`translateY(${s}px)`}};return{in:t=>({spring:r,tick:s=>{t.style.transform=n(s),e&&(t.style.opacity=s.toString())}}),out:t=>({spring:r,tick:s=>{t.style.transform=n(s),e&&(t.style.opacity=s.toString())}})}},u=(o={})=>{const{degrees:i=360,clockwise:a=!0,scale:e=!1,fade:r=!1,spring:n={stiffness:500,damping:25}}=o,t=a?i:-i;return{in:s=>({spring:n,tick:c=>{const l=[`rotate(${c*t}deg)`];e&&l.push(`scale(${c})`),s.style.transform=l.join(" "),r&&(s.style.opacity=c.toString())}}),out:s=>({spring:n,tick:c=>{const l=[`rotate(${c*t}deg)`];e&&l.push(`scale(${c})`),s.style.transform=l.join(" "),r&&(s.style.opacity=c.toString())}})}},y=(o={})=>{const{height:i=20,scale:a=!0,fade:e=!1,spring:r={stiffness:800,damping:15}}=o;return{in:n=>({spring:r,tick:t=>{const s=[],c=Math.sin(t*Math.PI)*i*(1-t);s.push(`translateY(${-c}px)`),a&&s.push(`scale(${.8+t*.2})`),n.style.transform=s.join(" "),e&&(n.style.opacity=t.toString())}}),out:n=>({spring:r,tick:t=>{const s=[],c=Math.sin(t*Math.PI)*i*(1-t);s.push(`translateY(${-c}px)`),a&&s.push(`scale(${.8+t*.2})`),n.style.transform=s.join(" "),e&&(n.style.opacity=t.toString())}})}},d=(o={})=>{const{amount:i=10,scale:a=!1,fade:e=!0,spring:r={stiffness:300,damping:30}}=o;return{in:n=>({spring:r,tick:t=>{const s=[`blur(${(1-t)*i}px)`];n.style.filter=s.join(" "),a&&(n.style.transform=`scale(${.8+t*.2})`),e&&(n.style.opacity=t.toString())}}),out:n=>({spring:r,tick:t=>{const s=[`blur(${(1-t)*i}px)`];n.style.filter=s.join(" "),a&&(n.style.transform=`scale(${.8+t*.2})`),e&&(n.style.opacity=t.toString())}})}},m=(o={})=>{const{spring:i={stiffness:1e3,damping:100}}=o;return{in:a=>({spring:i,tick:e=>{}}),out:a=>({spring:i,tick:e=>{}})}};exports.blur=d;exports.bounce=y;exports.fade=p;exports.none=m;exports.rotate=u;exports.scale=g;exports.slide=f;
@@ -1,173 +1,173 @@
1
- const l = (r = {}) => {
1
+ const l = (o = {}) => {
2
2
  const {
3
3
  from: i = 0,
4
- to: c = 1,
5
- spring: a = { stiffness: 300, damping: 30 }
6
- } = r;
4
+ to: a = 1,
5
+ spring: r = { stiffness: 300, damping: 30 }
6
+ } = o;
7
7
  return {
8
- in: (o) => ({
9
- spring: a,
10
- tick: (s) => {
11
- const t = i + (c - i) * s;
12
- o.style.opacity = t.toString();
8
+ in: (e) => ({
9
+ spring: r,
10
+ tick: (n) => {
11
+ const t = i + (a - i) * n;
12
+ e.style.opacity = t.toString();
13
13
  }
14
14
  }),
15
- out: (o) => ({
16
- spring: a,
17
- tick: (s) => {
18
- const t = i + (c - i) * s;
19
- o.style.opacity = t.toString();
15
+ out: (e) => ({
16
+ spring: r,
17
+ tick: (n) => {
18
+ const t = i + (a - i) * n;
19
+ e.style.opacity = t.toString();
20
20
  }
21
21
  })
22
22
  };
23
- }, u = (r = {}) => {
23
+ }, g = (o = {}) => {
24
24
  const {
25
25
  from: i = 0,
26
- to: c = 1,
27
- spring: a = { stiffness: 300, damping: 30 }
28
- } = r;
26
+ to: a = 1,
27
+ spring: r = { stiffness: 300, damping: 30 }
28
+ } = o;
29
29
  return {
30
- in: (o) => ({
31
- spring: a,
32
- tick: (s) => {
33
- const t = i + (c - i) * s;
34
- o.style.transform = `scale(${t})`;
30
+ in: (e) => ({
31
+ spring: r,
32
+ tick: (n) => {
33
+ const t = i + (a - i) * n;
34
+ e.style.transform = `scale(${t})`;
35
35
  }
36
36
  }),
37
- out: (o) => ({
38
- spring: a,
39
- tick: (s) => {
40
- const t = i + (c - i) * s;
41
- o.style.transform = `scale(${t})`;
37
+ out: (e) => ({
38
+ spring: r,
39
+ tick: (n) => {
40
+ const t = i + (a - i) * n;
41
+ e.style.transform = `scale(${t})`;
42
42
  }
43
43
  })
44
44
  };
45
- }, y = (r = {}) => {
45
+ }, f = (o = {}) => {
46
46
  const {
47
47
  direction: i = "left",
48
- distance: c = 100,
49
- fade: a = !0,
50
- spring: o = { stiffness: 400, damping: 35 }
51
- } = r, s = (t) => {
52
- const n = (1 - t) * c;
48
+ distance: a = 100,
49
+ fade: r = !0,
50
+ spring: e = { stiffness: 400, damping: 35 }
51
+ } = o, n = (t) => {
52
+ const s = (1 - t) * a;
53
53
  switch (i) {
54
54
  case "left":
55
- return `translateX(${-n}px)`;
55
+ return `translateX(${-s}px)`;
56
56
  case "right":
57
- return `translateX(${n}px)`;
57
+ return `translateX(${s}px)`;
58
58
  case "up":
59
- return `translateY(${-n}px)`;
59
+ return `translateY(${-s}px)`;
60
60
  case "down":
61
- return `translateY(${n}px)`;
61
+ return `translateY(${s}px)`;
62
62
  }
63
63
  };
64
64
  return {
65
65
  in: (t) => ({
66
- spring: o,
67
- tick: (n) => {
68
- t.style.transform = s(n), a && (t.style.opacity = n.toString());
66
+ spring: e,
67
+ tick: (s) => {
68
+ t.style.transform = n(s), r && (t.style.opacity = s.toString());
69
69
  }
70
70
  }),
71
71
  out: (t) => ({
72
- spring: o,
73
- tick: (n) => {
74
- t.style.transform = s(n), a && (t.style.opacity = n.toString());
72
+ spring: e,
73
+ tick: (s) => {
74
+ t.style.transform = n(s), r && (t.style.opacity = s.toString());
75
75
  }
76
76
  })
77
77
  };
78
- }, p = (r = {}) => {
78
+ }, u = (o = {}) => {
79
79
  const {
80
80
  degrees: i = 360,
81
- clockwise: c = !0,
82
- scale: a = !1,
83
- fade: o = !1,
84
- spring: s = { stiffness: 500, damping: 25 }
85
- } = r, t = c ? i : -i;
81
+ clockwise: a = !0,
82
+ scale: r = !1,
83
+ fade: e = !1,
84
+ spring: n = { stiffness: 500, damping: 25 }
85
+ } = o, t = a ? i : -i;
86
86
  return {
87
- in: (n) => ({
88
- spring: s,
89
- tick: (e) => {
90
- const f = [`rotate(${e * t}deg)`];
91
- a && f.push(`scale(${e})`), n.style.transform = f.join(" "), o && (n.style.opacity = e.toString());
87
+ in: (s) => ({
88
+ spring: n,
89
+ tick: (c) => {
90
+ const p = [`rotate(${c * t}deg)`];
91
+ r && p.push(`scale(${c})`), s.style.transform = p.join(" "), e && (s.style.opacity = c.toString());
92
92
  }
93
93
  }),
94
- out: (n) => ({
95
- spring: s,
96
- tick: (e) => {
97
- const f = [`rotate(${e * t}deg)`];
98
- a && f.push(`scale(${e})`), n.style.transform = f.join(" "), o && (n.style.opacity = e.toString());
94
+ out: (s) => ({
95
+ spring: n,
96
+ tick: (c) => {
97
+ const p = [`rotate(${c * t}deg)`];
98
+ r && p.push(`scale(${c})`), s.style.transform = p.join(" "), e && (s.style.opacity = c.toString());
99
99
  }
100
100
  })
101
101
  };
102
- }, d = (r = {}) => {
102
+ }, y = (o = {}) => {
103
103
  const {
104
104
  height: i = 20,
105
- scale: c = !0,
106
- fade: a = !1,
107
- spring: o = { stiffness: 800, damping: 15 }
108
- } = r;
105
+ scale: a = !0,
106
+ fade: r = !1,
107
+ spring: e = { stiffness: 800, damping: 15 }
108
+ } = o;
109
109
  return {
110
- in: (s) => ({
111
- spring: o,
110
+ in: (n) => ({
111
+ spring: e,
112
112
  tick: (t) => {
113
- const n = [], e = Math.sin(t * Math.PI) * i * (1 - t);
114
- n.push(`translateY(${-e}px)`), c && n.push(`scale(${0.8 + t * 0.2})`), s.style.transform = n.join(" "), a && (s.style.opacity = t.toString());
113
+ const s = [], c = Math.sin(t * Math.PI) * i * (1 - t);
114
+ s.push(`translateY(${-c}px)`), a && s.push(`scale(${0.8 + t * 0.2})`), n.style.transform = s.join(" "), r && (n.style.opacity = t.toString());
115
115
  }
116
116
  }),
117
- out: (s) => ({
118
- spring: o,
117
+ out: (n) => ({
118
+ spring: e,
119
119
  tick: (t) => {
120
- const n = [], e = Math.sin(t * Math.PI) * i * (1 - t);
121
- n.push(`translateY(${-e}px)`), c && n.push(`scale(${0.8 + t * 0.2})`), s.style.transform = n.join(" "), a && (s.style.opacity = t.toString());
120
+ const s = [], c = Math.sin(t * Math.PI) * i * (1 - t);
121
+ s.push(`translateY(${-c}px)`), a && s.push(`scale(${0.8 + t * 0.2})`), n.style.transform = s.join(" "), r && (n.style.opacity = t.toString());
122
122
  }
123
123
  })
124
124
  };
125
- }, $ = (r = {}) => {
125
+ }, m = (o = {}) => {
126
126
  const {
127
127
  amount: i = 10,
128
- scale: c = !1,
129
- fade: a = !0,
130
- spring: o = { stiffness: 300, damping: 30 }
131
- } = r;
128
+ scale: a = !1,
129
+ fade: r = !0,
130
+ spring: e = { stiffness: 300, damping: 30 }
131
+ } = o;
132
132
  return {
133
- in: (s) => ({
134
- spring: o,
133
+ in: (n) => ({
134
+ spring: e,
135
135
  tick: (t) => {
136
- const e = [`blur(${(1 - t) * i}px)`];
137
- s.style.filter = e.join(" "), c && (s.style.transform = `scale(${0.8 + t * 0.2})`), a && (s.style.opacity = t.toString());
136
+ const s = [`blur(${(1 - t) * i}px)`];
137
+ n.style.filter = s.join(" "), a && (n.style.transform = `scale(${0.8 + t * 0.2})`), r && (n.style.opacity = t.toString());
138
138
  }
139
139
  }),
140
- out: (s) => ({
141
- spring: o,
140
+ out: (n) => ({
141
+ spring: e,
142
142
  tick: (t) => {
143
- const e = [`blur(${(1 - t) * i}px)`];
144
- s.style.filter = e.join(" "), c && (s.style.transform = `scale(${0.8 + t * 0.2})`), a && (s.style.opacity = t.toString());
143
+ const s = [`blur(${(1 - t) * i}px)`];
144
+ n.style.filter = s.join(" "), a && (n.style.transform = `scale(${0.8 + t * 0.2})`), r && (n.style.opacity = t.toString());
145
145
  }
146
146
  })
147
147
  };
148
- }, m = (r = {}) => {
148
+ }, d = (o = {}) => {
149
149
  const {
150
150
  spring: i = { stiffness: 1e3, damping: 100 }
151
- } = r;
151
+ } = o;
152
152
  return {
153
- in: (c) => ({
153
+ in: (a) => ({
154
154
  spring: i,
155
- tick: (a) => {
155
+ tick: (r) => {
156
156
  }
157
157
  }),
158
- out: (c) => ({
158
+ out: (a) => ({
159
159
  spring: i,
160
- tick: (a) => {
160
+ tick: (r) => {
161
161
  }
162
162
  })
163
163
  };
164
164
  };
165
165
  export {
166
- $ as blur,
167
- d as bounce,
166
+ m as blur,
167
+ y as bounce,
168
168
  l as fade,
169
- m as none,
170
- p as rotate,
171
- u as scale,
172
- y as slide
169
+ d as none,
170
+ u as rotate,
171
+ g as scale,
172
+ f as slide
173
173
  };
@@ -1 +1 @@
1
- "use strict";const n=e=>{e.style.position="absolute",e.style.width="100%",e.style.top="0",e.style.left="0"},r=e=>{let t=e.parentElement;for(;t&&t!==document.body;){const l=window.getComputedStyle(t),o=l.overflow+l.overflowY+l.overflowX;if(o.includes("auto")||o.includes("scroll")||t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth)return t;t=t.parentElement}return document.documentElement};exports.getScrollingElement=r;exports.prepareOutgoing=n;
1
+ "use strict";const n=e=>{e.style.position="absolute",e.style.width="100%",e.style.top="0",e.style.left="0"},r=e=>{let t=e.parentElement;for(;t&&t!==document.body;){const l=window.getComputedStyle(t),o=l.overflow+l.overflowY+l.overflowX;if(o.includes("auto")||o.includes("scroll")||t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth)return t;t=t.parentElement}return document.documentElement};exports.n=n;exports.r=r;
@@ -3,14 +3,14 @@ const n = (e) => {
3
3
  }, r = (e) => {
4
4
  let t = e.parentElement;
5
5
  for (; t && t !== document.body; ) {
6
- const o = window.getComputedStyle(t), l = o.overflow + o.overflowY + o.overflowX;
7
- if (l.includes("auto") || l.includes("scroll") || t.scrollHeight > t.clientHeight || t.scrollWidth > t.clientWidth)
6
+ const l = window.getComputedStyle(t), o = l.overflow + l.overflowY + l.overflowX;
7
+ if (o.includes("auto") || o.includes("scroll") || t.scrollHeight > t.clientHeight || t.scrollWidth > t.clientWidth)
8
8
  return t;
9
9
  t = t.parentElement;
10
10
  }
11
11
  return document.documentElement;
12
12
  };
13
13
  export {
14
- r as g,
15
- n as p
14
+ n,
15
+ r
16
16
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("../utils-BSgyev81.cjs"),P=(t={})=>{const n={stiffness:t.spring?.stiffness??300,damping:t.spring?.damping??30};return{in:e=>({spring:n,tick:i=>{e.style.opacity=i.toString()}}),out:e=>({spring:n,tick:i=>{e.style.opacity=i.toString()},prepare:k.prepareOutgoing})}};function b(t,n){return t.querySelector(`[data-hero-key="${n}"]`)}function A(t,n){const e=t.getBoundingClientRect(),i=n.getBoundingClientRect();return new DOMRect(i.left-e.left,i.top-e.top,i.width,i.height)}const C=(t={})=>{const n={stiffness:t.spring?.stiffness??300,damping:t.spring?.damping??30},e=t.timeout??300;let i=null,s=null;return{in:async(a,h)=>{const o=a,c=Array.from(o.querySelectorAll("[data-hero-key]"));if(c.length===0)return{spring:n,tick:()=>{}};if(!await new Promise(l=>{i?l(!0):(s=l,setTimeout(()=>{s=null,l(!1)},e))})||!i)return i=null,{spring:n,tick:()=>{}};const r=c.map(l=>{const y=l.getAttribute("data-hero-key");if(!y)return null;const d=b(i,y);if(!d)return null;const p=l,u=A(i,d),f=A(o,p),$=u.left-f.left-h.scrollOffset.x,w=u.top-f.top-h.scrollOffset.y,x=u.width/f.width,M=u.height/f.height,q=p.style.transform,O=p.style.position,T=p.style.transformOrigin;return{toEl:p,dx:$,dy:w,dw:x,dh:M,originalTransform:q,originalPosition:O,originalTransformOrigin:T}}).filter(Boolean);return i=null,r.length===0?{spring:n,tick:()=>{}}:{spring:n,prepare:()=>{r.forEach(({toEl:l})=>{l.style.position="relative",l.style.transformOrigin="top left"})},tick:l=>{r.forEach(({toEl:y,dx:d,dy:p,dw:u,dh:f})=>{y.style.transform=`translate(${(1-l)*d}px,${(1-l)*p}px) scale(${l+(1-l)*u}, ${l+(1-l)*f})`})},onEnd:()=>{r.forEach(({toEl:l,originalTransform:y,originalPosition:d,originalTransformOrigin:p})=>{l.style.transform=y,l.style.position=d,l.style.transformOrigin=p})}}},out:async a=>({onStart:()=>{i=a,s&&(s(!0),s=null)},prepare:h=>{k.prepareOutgoing(h),h.style.opacity="0"}})}};function S(t,n){const e=t.getBoundingClientRect(),i=n.getBoundingClientRect();return new DOMRect(i.left-e.left,i.top-e.top,i.width,i.height)}function E({detailRect:t,galleryRect:n,pageRect:e,scrollOffset:i},s){const a=n.left-t.left+(n.width-t.width)/2-i.x,h=n.top-t.top+(n.height-t.height)/2-i.y,o=n.width/t.width,c=n.height/t.height,g=Math.max(o,c),r=t.top/e.height*100,l=(e.width-(t.left+t.width))/e.width*100,y=(e.height-(t.top+t.height))/e.height*100,d=t.left/e.width*100;return s.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,p=>{const u=1-p,f=r*u,$=l*u,w=y*u,x=d*u;s.style.clipPath=`inset(${f}% ${$}% ${w}% ${x}%)`,s.style.transform=`translate(${a*u}px, ${h*u}px) scale(${1+(g-1)*u})`}}function D({galleryRect:t,detailRect:n,scrollOffset:e},i){const s=n.left-t.left+(n.width-t.width)/2+e.x,a=n.top-t.top+(n.height-t.height)/2+e.y,h=n.width/t.width,o=n.height/t.height,c=Math.max(h,o);return g=>{i.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`;const r=1-g;i.style.transform=`translate(${s*r-e.x}px, ${a*r-e.y}px) scale(${1+(c-1)*r})`,i.style.opacity=`${1-r}`}}function H({galleryRect:t,detailRect:n,scrollOffset:e},i){const s=n.left-t.left+(n.width-t.width)/2-e.x,a=n.top-t.top+(n.height-t.height)/2-e.y,h=n.width/t.width,o=n.height/t.height,c=Math.max(h,o);return g=>{const r=1-g,l=g;i.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,i.style.transform=`translate(${s*r}px, ${a*r}px) scale(${1+(c-1)*r})`,i.style.opacity=`${l}`}}function F({detailRect:t,galleryRect:n,pageRect:e,scrollOffset:i},s){const a=n.left-t.left+(n.width-t.width)/2+i.x,h=n.top-t.top+(n.height-t.height)/2+i.y,o=n.width/t.width,c=n.height/t.height,g=Math.min(o,c),r=t.top/e.height*100,l=(e.width-(t.left+t.width))/e.width*100,y=(e.height-(t.top+t.height))/e.height*100,d=t.left/e.width*100;return s.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,p=>{const u=1-p,f=r*u,$=l*u,w=y*u,x=d*u;s.style.clipPath=`inset(${f}% ${$}% ${w}% ${x}%)`,s.style.transform=`translate(${a*u-i.x}px, ${h*u-i.y}px) scale(${1+(g-1)*u})`}}function I(t,n,e){const i=t.querySelector("[data-pinterest-detail-key]"),s=n.querySelector("[data-pinterest-detail-key]");if(t.querySelectorAll("[data-pinterest-detail-key]").length>1||n.querySelectorAll("[data-pinterest-detail-key]").length>1)return null;let a=null,h=null,o=!1;if(!i&&s){h=s;const l=h.getAttribute("data-pinterest-detail-key");if(!l)return null;a=t.querySelector(`[data-pinterest-gallery-key="${l}"]`),a&&(o=!0)}else if(i&&!s){h=i;const l=h.getAttribute("data-pinterest-detail-key");if(!l)return null;a=n.querySelector(`[data-pinterest-gallery-key="${l}"]`),a&&(o=!1)}if(!a||!h)return null;const c=S(o?t:n,a),g=S(o?n:t,h),r=n.getBoundingClientRect();return o?{inAnimation:E({detailRect:g,galleryRect:c,pageRect:r,scrollOffset:e},n),outAnimation:D({galleryRect:c,detailRect:g,scrollOffset:e},t)}:{inAnimation:H({galleryRect:c,detailRect:g,scrollOffset:e},n),outAnimation:F({detailRect:g,galleryRect:c,pageRect:r,scrollOffset:e},t)}}const L=(t={})=>{const n={stiffness:t.spring?.stiffness??50,damping:t.spring?.damping??10},e=t.timeout??300;let i=null,s=null,a=null;return{in:async(h,{scrollOffset:o})=>{const c=h;return!await new Promise(r=>{i?r(!0):(s=r,setTimeout(()=>{s=null,r(!1)},e))})||!i?(i=null,{spring:n,tick:()=>{}}):(a=I(i,c,o),a?(i=null,{spring:n,tick:r=>{a&&a.inAnimation(r)}}):{spring:n,tick:()=>{}})},out:async h=>({spring:n,onStart:()=>{i=h,s&&(s(!0),s=null)},prepare:o=>{k.prepareOutgoing(o),o.style.zIndex="-1"},tick:o=>{a&&a.outAnimation(o)}})}};function B(t){const n=t.getBoundingClientRect(),e=t.clientHeight,s=50*(window.innerHeight-n.top)/e;return Math.min(Math.max(s,0),100)}const X=(t={})=>{const n={stiffness:t.spring?.stiffness??300,damping:t.spring?.damping??200};return{in:e=>{const i=B(e);return{spring:n,tick:s=>{e.style.clipPath=`circle(${s*100}% at 50% ${i}%)`}}},out:e=>{const i=B(e);return{spring:n,tick:s=>{e.style.clipPath=`circle(${s*100}% at 50% ${i}%)`,e.style.zIndex="100"},prepare:k.prepareOutgoing}}}};exports.fade=P;exports.hero=C;exports.pinterest=L;exports.ripple=X;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("../utils-DR41YsAh-CN_CfgYX.cjs"),P=(t={})=>{var e,n;const i={stiffness:((e=t.spring)==null?void 0:e.stiffness)??300,damping:((n=t.spring)==null?void 0:n.damping)??30};return{in:r=>({spring:i,tick:l=>{r.style.opacity=l.toString()}}),out:r=>({spring:i,tick:l=>{r.style.opacity=l.toString()},prepare:x.n})}};function E(t,e){return t.querySelector(`[data-hero-key="${e}"]`)}function R(t,e){const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return new DOMRect(i.left-n.left,i.top-n.top,i.width,i.height)}const B=(t={})=>{var e,n;const i={stiffness:((e=t.spring)==null?void 0:e.stiffness)??300,damping:((n=t.spring)==null?void 0:n.damping)??30},r=t.timeout??300;let l=null,s=null;return{in:async(a,g)=>{const h=a,p=Array.from(h.querySelectorAll("[data-hero-key]"));if(p.length===0)return{spring:i,tick:()=>{}};if(!await new Promise(c=>{l?c(!0):(s=c,setTimeout(()=>{s=null,c(!1)},r))})||!l)return l=null,{spring:i,tick:()=>{}};const f=p.map(c=>{const u=c.getAttribute("data-hero-key");if(!u)return null;const d=E(l,u);if(!d)return null;const o=c,y=R(l,d),m=R(h,o),w=y.left-m.left-g.scrollOffset.x,$=y.top-m.top-g.scrollOffset.y,A=y.width/m.width,S=y.height/m.height,v=o.style.transform,q=o.style.position,M=o.style.transformOrigin;return{toEl:o,dx:w,dy:$,dw:A,dh:S,originalTransform:v,originalPosition:q,originalTransformOrigin:M}}).filter(Boolean);return l=null,f.length===0?{spring:i,tick:()=>{}}:{spring:i,prepare:()=>{f.forEach(({toEl:c})=>{c.style.position="relative",c.style.transformOrigin="top left"})},tick:c=>{f.forEach(({toEl:u,dx:d,dy:o,dw:y,dh:m})=>{u.style.transform=`translate(${(1-c)*d}px,${(1-c)*o}px) scale(${c+(1-c)*y}, ${c+(1-c)*m})`})},onEnd:()=>{f.forEach(({toEl:c,originalTransform:u,originalPosition:d,originalTransformOrigin:o})=>{c.style.transform=u,c.style.position=d,c.style.transformOrigin=o})}}},out:async a=>({onStart:()=>{l=a,s&&(s(!0),s=null)},prepare:g=>{x.n(g),g.style.opacity="0"}})}};function O(t,e){const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();return new DOMRect(i.left-n.left,i.top-n.top,i.width,i.height)}function T({detailRect:t,galleryRect:e,pageRect:n,scrollOffset:i},r){const l=e.left-t.left+(e.width-t.width)/2-i.x,s=e.top-t.top+(e.height-t.height)/2-i.y,a=e.width/t.width,g=e.height/t.height,h=Math.max(a,g),p=t.top/n.height*100,f=(n.width-(t.left+t.width))/n.width*100,c=(n.height-(t.top+t.height))/n.height*100,u=t.left/n.width*100;return r.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,d=>{const o=1-d,y=p*o,m=f*o,w=c*o,$=u*o;r.style.clipPath=`inset(${y}% ${m}% ${w}% ${$}%)`,r.style.transform=`translate(${l*o}px, ${s*o}px) scale(${1+(h-1)*o})`}}function C({galleryRect:t,detailRect:e,scrollOffset:n},i){const r=e.left-t.left+(e.width-t.width)/2+n.x,l=e.top-t.top+(e.height-t.height)/2+n.y,s=e.width/t.width,a=e.height/t.height,g=Math.max(s,a);return h=>{i.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`;const p=1-h;i.style.transform=`translate(${r*p-n.x}px, ${l*p-n.y}px) scale(${1+(g-1)*p})`,i.style.opacity=`${1-p}`}}function b({galleryRect:t,detailRect:e,scrollOffset:n},i){const r=e.left-t.left+(e.width-t.width)/2-n.x,l=e.top-t.top+(e.height-t.height)/2-n.y,s=e.width/t.width,a=e.height/t.height,g=Math.max(s,a);return h=>{const p=1-h,f=h;i.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,i.style.transform=`translate(${r*p}px, ${l*p}px) scale(${1+(g-1)*p})`,i.style.opacity=`${f}`}}function D({detailRect:t,galleryRect:e,pageRect:n,scrollOffset:i},r){const l=e.left-t.left+(e.width-t.width)/2+i.x,s=e.top-t.top+(e.height-t.height)/2+i.y,a=e.width/t.width,g=e.height/t.height,h=Math.min(a,g),p=t.top/n.height*100,f=(n.width-(t.left+t.width))/n.width*100,c=(n.height-(t.top+t.height))/n.height*100,u=t.left/n.width*100;return r.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,d=>{const o=1-d,y=p*o,m=f*o,w=c*o,$=u*o;r.style.clipPath=`inset(${y}% ${m}% ${w}% ${$}%)`,r.style.transform=`translate(${l*o-i.x}px, ${s*o-i.y}px) scale(${1+(h-1)*o})`}}function z(t,e,n){const i=t.querySelector("[data-pinterest-detail-key]"),r=e.querySelector("[data-pinterest-detail-key]");if(t.querySelectorAll("[data-pinterest-detail-key]").length>1||e.querySelectorAll("[data-pinterest-detail-key]").length>1)return null;let l=null,s=null,a=!1;if(!i&&r){s=r;const f=s.getAttribute("data-pinterest-detail-key");if(!f)return null;l=t.querySelector(`[data-pinterest-gallery-key="${f}"]`),l&&(a=!0)}else if(i&&!r){s=i;const f=s.getAttribute("data-pinterest-detail-key");if(!f)return null;l=e.querySelector(`[data-pinterest-gallery-key="${f}"]`),l&&(a=!1)}if(!l||!s)return null;const g=O(a?t:e,l),h=O(a?e:t,s),p=e.getBoundingClientRect();return a?{inAnimation:T({detailRect:h,galleryRect:g,pageRect:p,scrollOffset:n},e),outAnimation:C({galleryRect:g,detailRect:h,scrollOffset:n},t)}:{inAnimation:b({galleryRect:g,detailRect:h,scrollOffset:n},e),outAnimation:D({detailRect:h,galleryRect:g,pageRect:p,scrollOffset:n},t)}}const H=(t={})=>{var e,n;const i={stiffness:((e=t.spring)==null?void 0:e.stiffness)??50,damping:((n=t.spring)==null?void 0:n.damping)??10},r=t.timeout??300;let l=null,s=null,a=null;return{in:async(g,{scrollOffset:h})=>{const p=g;return!await new Promise(f=>{l?f(!0):(s=f,setTimeout(()=>{s=null,f(!1)},r))})||!l?(l=null,{spring:i,tick:()=>{}}):(a=z(l,p,h),a?(l=null,{spring:i,tick:f=>{a&&a.inAnimation(f)}}):{spring:i,tick:()=>{}})},out:async g=>({spring:i,onStart:()=>{l=g,s&&(s(!0),s=null)},prepare:h=>{x.n(h),h.style.zIndex="-1"},tick:h=>{a&&a.outAnimation(h)}})}};function k(t){const e=t.getBoundingClientRect(),n=t.clientHeight,i=50*(window.innerHeight-e.top)/n;return Math.min(Math.max(i,0),100)}const I=(t={})=>{var e,n;const i={stiffness:((e=t.spring)==null?void 0:e.stiffness)??300,damping:((n=t.spring)==null?void 0:n.damping)??200};return{in:r=>{const l=k(r);return{spring:i,tick:s=>{r.style.clipPath=`circle(${s*100}% at 50% ${l}%)`}}},out:r=>{const l=k(r);return{spring:i,tick:s=>{r.style.clipPath=`circle(${s*100}% at 50% ${l}%)`,r.style.zIndex="100"},prepare:x.n}}}};exports.fade=P;exports.hero=B;exports.pinterest=H;exports.ripple=I;