@ssgoi/core 3.2.1 → 3.2.2

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,6 +1,9 @@
1
1
  import { StrategyContext, TRANSITION_STRATEGY, TransitionStrategy } from './transition-strategy';
2
- import { TransitionCallback, TransitionOptions, TransitionKey } from '../types';
2
+ import { RefCallback, TransitionCallback, TransitionOptions, TransitionKey } from '../types';
3
3
  export declare function generateAutoKey(): TransitionKey;
4
+ type TransitionOptionsWithStrategy = TransitionOptions<undefined> & {
5
+ [TRANSITION_STRATEGY]?: (context: StrategyContext) => TransitionStrategy;
6
+ };
4
7
  /**
5
8
  * Framework-agnostic transition function that can be used as a ref
6
9
  *
@@ -22,23 +25,28 @@ export declare function generateAutoKey(): TransitionKey;
22
25
  * 4. `tick` - Called on each animation frame with progress value (1 → 0)
23
26
  * 5. `onEnd` - Called when animation completes and element is removed
24
27
  *
25
- * @returns {TransitionCallback} A callback function to be used as a ref
28
+ * @param options - Transition configuration
29
+ * @param mode - 'manual' (default) returns cleanup, 'auto' handles unmount via MutationObserver
30
+ * @returns Callback function to be used as a ref
26
31
  *
27
32
  * @example
28
33
  * ```tsx
34
+ * // Manual mode (default) - you handle cleanup
29
35
  * <div ref={transition({
30
36
  * key: 'hero-fade',
31
- * in: (element) => ({
32
- * prepare: (el) => el.style.opacity = '0',
33
- * tick: (progress) => el.style.opacity = progress.toString(),
34
- * }),
35
- * out: (element) => ({
36
- * tick: (progress) => el.style.opacity = progress.toString(),
37
- * })
37
+ * in: (element) => ({ tick: (p) => element.style.opacity = String(p) }),
38
+ * out: (element) => ({ tick: (p) => element.style.opacity = String(p) }),
38
39
  * })} />
40
+ *
41
+ * // Auto mode - automatic unmount detection via MutationObserver
42
+ * <div ref={transition({
43
+ * key: 'hero-fade',
44
+ * in: (element) => ({ tick: (p) => element.style.opacity = String(p) }),
45
+ * out: (element) => ({ tick: (p) => element.style.opacity = String(p) }),
46
+ * }, 'auto')} />
39
47
  * ```
40
48
  */
41
- export declare function transition(options: TransitionOptions<undefined> & {
42
- [TRANSITION_STRATEGY]?: (context: StrategyContext) => TransitionStrategy;
43
- }): TransitionCallback;
49
+ export declare function transition(options: TransitionOptionsWithStrategy, mode?: "manual"): TransitionCallback;
50
+ export declare function transition(options: TransitionOptionsWithStrategy, mode: "auto"): RefCallback;
51
+ export {};
44
52
  //# sourceMappingURL=transition.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"transition.d.ts","sourceRoot":"","sources":["../../src/lib/transition/transition.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAEV,kBAAkB,EAClB,iBAAiB,EAElB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAyE9C,wBAAgB,eAAe,IAAI,aAAa,CAU/C;AAoBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,iBAAiB,CAAC,SAAS,CAAC,GAAG;IACtC,CAAC,mBAAmB,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,kBAAkB,CAAC;CAC1E,GACA,kBAAkB,CAsBpB"}
1
+ {"version":3,"file":"transition.d.ts","sourceRoot":"","sources":["../../src/lib/transition/transition.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACV,WAAW,EAEX,kBAAkB,EAElB,iBAAiB,EAElB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AA8E9C,wBAAgB,eAAe,IAAI,aAAa,CAU/C;AAoBD,KAAK,6BAA6B,GAAG,iBAAiB,CAAC,SAAS,CAAC,GAAG;IAClE,CAAC,mBAAmB,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,kBAAkB,CAAC;CAC1E,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,6BAA6B,EACtC,IAAI,CAAC,EAAE,QAAQ,GACd,kBAAkB,CAAC;AACtB,wBAAgB,UAAU,CACxB,OAAO,EAAE,6BAA6B,EACtC,IAAI,EAAE,MAAM,GACX,WAAW,CAAC"}
package/dist/types.d.ts CHANGED
@@ -195,6 +195,17 @@ export type TransitionOptions<TContext = undefined> = Transition<TContext> & {
195
195
  scope?: TransitionScope;
196
196
  };
197
197
  export type TransitionCallback = (element: HTMLElement | null) => void | (() => void);
198
+ /**
199
+ * Ref callback type for 'auto' mode
200
+ * Handles null and manages unmount automatically via MutationObserver
201
+ */
202
+ export type RefCallback = (element: HTMLElement | null) => void;
203
+ /**
204
+ * Transition mode
205
+ * - 'manual': Returns TransitionCallback with cleanup function (default)
206
+ * - 'auto': Returns RefCallback with automatic unmount detection via MutationObserver
207
+ */
208
+ export type TransitionMode = "manual" | "auto";
198
209
  /**
199
210
  * Context object passed to view transitions
200
211
  * Provides essential information for smooth page transitions
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/lib/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,CAAC;AAE5C,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AAE1D;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,YAAY,GAAG,SAAS,CAAC;AAEjE;;GAEG;AACH,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T,UAAU,GAAG;IAAE,GAAG,EAAE,aAAa,CAAA;CAAE,CAAC;AAEzC;;;;;;;;;;GAUG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC,EAAE,EAAE,MAAM,CAAC;IACX;;;;;OAKG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,UAAU,EAAE,KAAK,GAAG,QAAQ,CAAC,GAAG;IACtE,GAAG,CAAC,EAAE;QAAE,OAAO,EAAE,WAAW,CAAC;QAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,WAAW,CAAA;KAAE,CAAC;IACzE,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,2BAA2B,GAAG,IAAI,CAC5C,iBAAiB,EACjB,SAAS,GAAG,UAAU,CACvB,GAAG;IACF,OAAO,EAAE,oBAAoB,EAAE,CAAC;CACjC,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,iBAAiB,EACzB,OAAO,CAAC,EAAE,WAAW,GACpB,2BAA2B,CA8C7B;AAED;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC"}
@@ -5,5 +5,4 @@ export { parseCallerLocation } from './parse-caller-location';
5
5
  export { sleep } from './sleep';
6
6
  export { getRect } from './get-rect';
7
7
  export { round, floor, ceil, toFixed } from './number';
8
- export { withResolvers } from './with-resolvers';
9
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"fade.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/fade.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAe,MAAM,UAAU,CAAC;AAQ3E,UAAU,WAAW;IACnB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,SAAS,CAAC,EAAE,YAAY,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,eAAO,MAAM,IAAI,GAAI,UAAS,WAAgB,KAAG,eAyDhD,CAAC"}
1
+ {"version":3,"file":"fade.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/fade.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAe,MAAM,UAAU,CAAC;AAQ3E,UAAU,WAAW;IACnB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,SAAS,CAAC,EAAE,YAAY,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,eAAO,MAAM,IAAI,GAAI,UAAS,WAAgB,KAAG,eA0DhD,CAAC"}
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("../jaemin-BG8HRXG1.cjs"),P=t=>new Promise(n=>setTimeout(n,t));function L(){let t,n;return{promise:new Promise((d,r)=>{t=d,n=r}),resolve:t,reject:n}}const B={stiffness:80,damping:25},H={stiffness:75,damping:25},q=300,N=10,G="horizontal",j="#000000",K=(t={})=>{const{inSpring:n=H,outSpring:s=B,transitionDelay:d=q,blindCount:r=N,direction:a=G,blindColor:l=j}=t;let i,c=null;const o=(e,h,y="left")=>{window.getComputedStyle(e).position==="static"&&(e.style.position="relative");const g=document.createElement("div");g.className="blind-container",g.style.cssText=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("../jaemin-BG8HRXG1.cjs"),D=t=>new Promise(n=>setTimeout(n,t)),M={stiffness:80,damping:25},B={stiffness:75,damping:25},H=300,q=10,N="horizontal",G="#000000",j=(t={})=>{const{inSpring:n=B,outSpring:a=M,transitionDelay:d=H,blindCount:r=q,direction:s=N,blindColor:l=G}=t;let i,c=null;const o=(e,h,y="left")=>{window.getComputedStyle(e).position==="static"&&(e.style.position="relative");const g=document.createElement("div");g.className="blind-container",g.style.cssText=`
2
2
  position: absolute;
3
3
  top: 0;
4
4
  left: 0;
@@ -7,29 +7,29 @@
7
7
  pointer-events: none;
8
8
  z-index: 9999;
9
9
  overflow: hidden;
10
- `;const u=[];for(let w=0;w<r;w++){const f=document.createElement("div");if(a==="horizontal"){const x=100/r,$=`calc(${x}% + 1px)`;f.style.cssText=`
10
+ `;const u=[];for(let w=0;w<r;w++){const f=document.createElement("div");if(s==="horizontal"){const x=100/r,m=`calc(${x}% + 1px)`;f.style.cssText=`
11
11
  position: absolute;
12
12
  top: ${x*w}%;
13
13
  left: 0;
14
14
  width: 100%;
15
- height: ${$};
15
+ height: ${m};
16
16
  background: ${l};
17
17
  transform: scaleX(${h==="hidden"?0:1});
18
18
  transform-origin: ${y} center;
19
19
  will-change: transform;
20
- `}else{const x=100/r,$=`calc(${x}% + 1px)`;f.style.cssText=`
20
+ `}else{const x=100/r,m=`calc(${x}% + 1px)`;f.style.cssText=`
21
21
  position: absolute;
22
22
  top: 0;
23
23
  left: ${x*w}%;
24
- width: ${$};
24
+ width: ${m};
25
25
  height: 100%;
26
26
  background: ${l};
27
27
  transform: scaleY(${h==="hidden"?0:1});
28
28
  transform-origin: ${y==="left"?"top":"bottom"} center;
29
29
  will-change: transform;
30
- `}u.push(f),g.appendChild(f)}return e.appendChild(g),{container:g,blinds:u}};return{out:()=>{let e=null;i=new Promise(p=>{c=p});const h=p=>{const g=1-p;return{transform:a==="horizontal"?`scaleX(${g})`:`scaleY(${g})`}};return{springs:Array.from({length:r},(p,g)=>({spring:s,offset:.2,css:{get element(){return e==null?void 0:e.blinds[g]},style:h}})),schedule:"stagger",prepare:p=>{m.prepareOutgoing(p),p.style.zIndex="1000",e=o(p,"hidden","left")},onStart:()=>{},onEnd:()=>{c&&c()}}},in:()=>{let e=null;const h=p=>{const g=1-p;return{transform:a==="horizontal"?`scaleX(${g})`:`scaleY(${g})`}};return{springs:Array.from({length:r},(p,g)=>({spring:n,offset:.2,css:{get element(){return e==null?void 0:e.blinds[g]},style:h}})),schedule:"stagger",prepare:p=>{p.style.position="relative",p.style.zIndex="0",e=o(p,"closed","right")},onStart:()=>{},wait:async()=>{i&&await i,await P(d)},onEnd:()=>{e&&e.container&&e.container.remove()}}}}},Z={stiffness:150,damping:20},J={stiffness:100,damping:20},Q=(t={})=>{var a,l;const{opacity:n=!1,direction:s="enter"}=t,d=s==="enter"?Z:J,r={stiffness:((a=t.spring)==null?void 0:a.stiffness)??d.stiffness,damping:((l=t.spring)==null?void 0:l.damping)??d.damping};return s==="enter"?{in:i=>({spring:r,prepare:()=>{i.style.willChange=n?"transform, opacity":"transform",i.style.backfaceVisibility="hidden",i.style.contain="layout paint"},css:c=>{const o={transform:`translate3d(${(1-c)*100}%, 0, 0)`};return n&&(o.opacity=c),o},onEnd:()=>{i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain=""}}),out:(i,c)=>({spring:r,prepare:o=>{m.prepareOutgoing(o,c),o.style.zIndex="-1",o.style.willChange=n?"transform, opacity":"transform",o.style.backfaceVisibility="hidden",o.style.contain="layout paint",o.style.pointerEvents="none"},css:o=>{const e={transform:`translate3d(${-(1-o)*20}%, 0, 0)`};return n&&(e.opacity=o),e}})}:{in:i=>({spring:r,prepare:()=>{i.style.willChange=n?"transform, opacity":"transform",i.style.backfaceVisibility="hidden",i.style.contain="layout paint"},css:c=>{const o={transform:`translate3d(${-(1-c)*20}%, 0, 0)`};return n&&(o.opacity=c),o},onEnd:()=>{i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain=""}}),out:(i,c)=>({spring:r,prepare:o=>{m.prepareOutgoing(o,c),o.style.zIndex="100",o.style.willChange=n?"transform, opacity":"transform",o.style.backfaceVisibility="hidden",o.style.contain="layout paint",o.style.pointerEvents="none"},css:o=>{const e={transform:`translate3d(${(1-o)*100}%, 0, 0)`};return n&&(e.opacity=o),e}})}},R={stiffness:120,damping:15},tt={stiffness:100,damping:20},nt=0,et=(t={})=>{const{inSpring:n=tt,outSpring:s=R,transitionDelay:d=nt}=t;let{promise:r,resolve:a}=L();return{in:l=>({spring:n,prepare:()=>{l.style.opacity="0",l.style.willChange="opacity"},wait:async()=>{if(r){await r;const i=L();r=i.promise,a=i.resolve,await P(d)}},css:i=>({opacity:i}),onEnd:()=>{l.style.willChange="auto",l.style.opacity="1"}}),out:(l,i)=>({spring:s,css:c=>({opacity:c}),prepare:()=>{m.prepareOutgoing(l,i),l.style.willChange="opacity"},onEnd:()=>{a&&a(),l.style.willChange="auto"}})}},it={scaleDown:{stiffness:20,damping:7},translate:{stiffness:15,damping:7},scaleUp:{stiffness:20,damping:7}},b={scaleDown:0,translate:.2,scaleUp:.8},st=.8,at="white",rt=t=>{var r;const n=it,s=st,d=((r=t==null?void 0:t.border)==null?void 0:r.color)??at;return{out:async(a,l)=>{const i=T(l),c=m.getRect(document.body,l.positionedParent),o=ot(d,{...i,top:c.top}),e={scale:1,translateY:-i.top},h=()=>{a.style.transform=`translateY(${e.translateY}px) scale(${e.scale})`;const y=(i.width-i.width*e.scale)/2,p=(i.height-i.height*e.scale)/2;lt(o,y,p)};return{springs:[{spring:n.scaleDown,offset:b.scaleDown,tick:y=>{const p=1-y;e.scale=1-(1-s)*p,h()}},{spring:n.translate,offset:b.translate,tick:y=>{const p=1-y;e.translateY=-i.top-i.height*p,h()}},{spring:n.scaleUp,offset:b.scaleUp,tick:y=>{const p=1-y;e.scale=s+(1-s)*p,h()}}],schedule:"stagger",prepare:()=>{m.prepareOutgoing(a),k(a,i),O(a,i),ct(a,i);for(const y of o)l.positionedParent.appendChild(y)},onEnd:()=>{a.style.clipPath="",a.style.transformOrigin="",setTimeout(()=>{for(const y of o)l.positionedParent.removeChild(y)},1e3)}}},in:async(a,l)=>{const i=T(l),c={scale:s,translateY:-i.top+i.height},o=()=>{a.style.transform=`translateY(${c.translateY}px) scale(${c.scale})`};return{springs:[{spring:n.scaleDown,offset:b.scaleDown,tick:e=>{c.scale=1-(1-s)*e,o()}},{spring:n.translate,offset:b.translate,tick:e=>{c.translateY=-i.top+i.height*(1-e),o()}},{spring:n.scaleUp,offset:b.scaleUp,tick:e=>{c.scale=s+(1-s)*e,o()}}],schedule:"stagger",prepare:()=>{k(a,i),O(a,i),a.style.transform=`translateY(${-i.top+i.height}px) scale(${s})`},onEnd:()=>{a.style.clipPath="",a.style.transformOrigin="",a.style.transform=""}}}}};function lt(t,n,s){const d=n*.7,r=s*.7;t.topLeft.style.transform=`translate(${d}px, ${r}px)`,t.topRight.style.transform=`translate(${-d}px, ${r}px)`,t.bottomLeft.style.transform=`translate(${d}px, ${-r}px)`,t.bottomRight.style.transform=`translate(${-d}px, ${-r}px)`}function ot(t="white",n){const r=document.createElement("div");r.style.position="fixed",r.style.pointerEvents="none",r.style.zIndex="9999",r.style.top=`${n.top-1}px`,r.style.left=`${n.left-1}px`,r.style.width="15px",r.style.height="15px";const a=document.createElement("div");a.style.position="absolute",a.style.width="15px",a.style.height="1px",a.style.backgroundColor=t,a.style.top="0",a.style.left="0";const l=document.createElement("div");l.style.position="absolute",l.style.width="1px",l.style.height="15px",l.style.backgroundColor=t,l.style.top="0",l.style.left="0",r.appendChild(a),r.appendChild(l);const i=document.createElement("div");i.style.position="fixed",i.style.pointerEvents="none",i.style.zIndex="9999",i.style.top=`${n.top-1}px`,i.style.left=`${n.left+n.width-15+1}px`,i.style.width="15px",i.style.height="15px";const c=document.createElement("div");c.style.position="absolute",c.style.width="15px",c.style.height="1px",c.style.backgroundColor=t,c.style.top="0",c.style.right="0";const o=document.createElement("div");o.style.position="absolute",o.style.width="1px",o.style.height="15px",o.style.backgroundColor=t,o.style.top="0",o.style.right="0",i.appendChild(c),i.appendChild(o);const e=document.createElement("div");e.style.position="fixed",e.style.pointerEvents="none",e.style.zIndex="9999",e.style.top=`${n.top+n.height-15+1}px`,e.style.left=`${n.left-1}px`,e.style.width="15px",e.style.height="15px";const h=document.createElement("div");h.style.position="absolute",h.style.width="15px",h.style.height="1px",h.style.backgroundColor=t,h.style.bottom="0",h.style.left="0";const y=document.createElement("div");y.style.position="absolute",y.style.width="1px",y.style.height="15px",y.style.backgroundColor=t,y.style.bottom="0",y.style.left="0",e.appendChild(h),e.appendChild(y);const p=document.createElement("div");p.style.position="fixed",p.style.pointerEvents="none",p.style.zIndex="9999",p.style.top=`${n.top+n.height-15+1}px`,p.style.left=`${n.left+n.width-15+1}px`,p.style.width="15px",p.style.height="15px";const g=document.createElement("div");g.style.position="absolute",g.style.width="15px",g.style.height="1px",g.style.backgroundColor=t,g.style.bottom="0",g.style.right="0";const u=document.createElement("div");return u.style.position="absolute",u.style.width="1px",u.style.height="15px",u.style.backgroundColor=t,u.style.bottom="0",u.style.right="0",p.appendChild(g),p.appendChild(u),{topLeft:r,topRight:i,bottomLeft:e,bottomRight:p,*[Symbol.iterator](){yield r,yield i,yield e,yield p}}}function T(t){const n=m.getRect(document.body,t.positionedParent);return{top:t.scroll.y,left:0,width:n.width,height:window.innerHeight-n.top}}function k(t,n){const s=n.left+n.width/2,d=n.top+n.height/2;t.style.transformOrigin=`${s}px ${d}px`}function O(t,n){t.style.clipPath=`polygon(
30
+ `}u.push(f),g.appendChild(f)}return e.appendChild(g),{container:g,blinds:u}};return{out:()=>{let e=null;i=new Promise(p=>{c=p});const h=p=>{const g=1-p;return{transform:s==="horizontal"?`scaleX(${g})`:`scaleY(${g})`}};return{springs:Array.from({length:r},(p,g)=>({spring:a,offset:.2,css:{get element(){return e==null?void 0:e.blinds[g]},style:h}})),schedule:"stagger",prepare:p=>{$.prepareOutgoing(p),p.style.zIndex="1000",e=o(p,"hidden","left")},onStart:()=>{},onEnd:()=>{c&&c()}}},in:()=>{let e=null;const h=p=>{const g=1-p;return{transform:s==="horizontal"?`scaleX(${g})`:`scaleY(${g})`}};return{springs:Array.from({length:r},(p,g)=>({spring:n,offset:.2,css:{get element(){return e==null?void 0:e.blinds[g]},style:h}})),schedule:"stagger",prepare:p=>{p.style.position="relative",p.style.zIndex="0",e=o(p,"closed","right")},onStart:()=>{},wait:async()=>{i&&await i,await D(d)},onEnd:()=>{e&&e.container&&e.container.remove()}}}}},K={stiffness:150,damping:20},Z={stiffness:100,damping:20},J=(t={})=>{var s,l;const{opacity:n=!1,direction:a="enter"}=t,d=a==="enter"?K:Z,r={stiffness:((s=t.spring)==null?void 0:s.stiffness)??d.stiffness,damping:((l=t.spring)==null?void 0:l.damping)??d.damping};return a==="enter"?{in:i=>({spring:r,prepare:()=>{i.style.willChange=n?"transform, opacity":"transform",i.style.backfaceVisibility="hidden",i.style.contain="layout paint"},css:c=>{const o={transform:`translate3d(${(1-c)*100}%, 0, 0)`};return n&&(o.opacity=c),o},onEnd:()=>{i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain=""}}),out:(i,c)=>({spring:r,prepare:o=>{$.prepareOutgoing(o,c),o.style.zIndex="-1",o.style.willChange=n?"transform, opacity":"transform",o.style.backfaceVisibility="hidden",o.style.contain="layout paint",o.style.pointerEvents="none"},css:o=>{const e={transform:`translate3d(${-(1-o)*20}%, 0, 0)`};return n&&(e.opacity=o),e}})}:{in:i=>({spring:r,prepare:()=>{i.style.willChange=n?"transform, opacity":"transform",i.style.backfaceVisibility="hidden",i.style.contain="layout paint"},css:c=>{const o={transform:`translate3d(${-(1-c)*20}%, 0, 0)`};return n&&(o.opacity=c),o},onEnd:()=>{i.style.willChange="auto",i.style.backfaceVisibility="",i.style.contain=""}}),out:(i,c)=>({spring:r,prepare:o=>{$.prepareOutgoing(o,c),o.style.zIndex="100",o.style.willChange=n?"transform, opacity":"transform",o.style.backfaceVisibility="hidden",o.style.contain="layout paint",o.style.pointerEvents="none"},css:o=>{const e={transform:`translate3d(${(1-o)*100}%, 0, 0)`};return n&&(e.opacity=o),e}})}},Q={stiffness:65,damping:16},R={stiffness:65,damping:14},tt=0,nt=(t={})=>{const{inSpring:n=R,outSpring:a=Q,transitionDelay:d=tt}=t;let r,s=null;return{in:l=>({spring:n,prepare:()=>{l.style.willChange="opacity"},wait:async()=>{r&&(await r,await D(d))},css:i=>({opacity:i}),onEnd:()=>{l.style.willChange="auto"}}),out:(l,i)=>(r=new Promise(c=>{s=c}),{spring:a,css:c=>({opacity:c}),prepare:()=>{$.prepareOutgoing(l,i),l.style.willChange="opacity"},onEnd:()=>{s&&s(),l.style.willChange="auto"}})}},et={scaleDown:{stiffness:20,damping:7},translate:{stiffness:15,damping:7},scaleUp:{stiffness:20,damping:7}},b={scaleDown:0,translate:.2,scaleUp:.8},it=.8,st="white",at=t=>{var r;const n=et,a=it,d=((r=t==null?void 0:t.border)==null?void 0:r.color)??st;return{out:async(s,l)=>{const i=L(l),c=$.getRect(document.body,l.positionedParent),o=lt(d,{...i,top:c.top}),e={scale:1,translateY:-i.top},h=()=>{s.style.transform=`translateY(${e.translateY}px) scale(${e.scale})`;const y=(i.width-i.width*e.scale)/2,p=(i.height-i.height*e.scale)/2;rt(o,y,p)};return{springs:[{spring:n.scaleDown,offset:b.scaleDown,tick:y=>{const p=1-y;e.scale=1-(1-a)*p,h()}},{spring:n.translate,offset:b.translate,tick:y=>{const p=1-y;e.translateY=-i.top-i.height*p,h()}},{spring:n.scaleUp,offset:b.scaleUp,tick:y=>{const p=1-y;e.scale=a+(1-a)*p,h()}}],schedule:"stagger",prepare:()=>{$.prepareOutgoing(s),T(s,i),k(s,i),ot(s,i);for(const y of o)l.positionedParent.appendChild(y)},onEnd:()=>{s.style.clipPath="",s.style.transformOrigin="",setTimeout(()=>{for(const y of o)l.positionedParent.removeChild(y)},1e3)}}},in:async(s,l)=>{const i=L(l),c={scale:a,translateY:-i.top+i.height},o=()=>{s.style.transform=`translateY(${c.translateY}px) scale(${c.scale})`};return{springs:[{spring:n.scaleDown,offset:b.scaleDown,tick:e=>{c.scale=1-(1-a)*e,o()}},{spring:n.translate,offset:b.translate,tick:e=>{c.translateY=-i.top+i.height*(1-e),o()}},{spring:n.scaleUp,offset:b.scaleUp,tick:e=>{c.scale=a+(1-a)*e,o()}}],schedule:"stagger",prepare:()=>{T(s,i),k(s,i),s.style.transform=`translateY(${-i.top+i.height}px) scale(${a})`},onEnd:()=>{s.style.clipPath="",s.style.transformOrigin="",s.style.transform=""}}}}};function rt(t,n,a){const d=n*.7,r=a*.7;t.topLeft.style.transform=`translate(${d}px, ${r}px)`,t.topRight.style.transform=`translate(${-d}px, ${r}px)`,t.bottomLeft.style.transform=`translate(${d}px, ${-r}px)`,t.bottomRight.style.transform=`translate(${-d}px, ${-r}px)`}function lt(t="white",n){const r=document.createElement("div");r.style.position="fixed",r.style.pointerEvents="none",r.style.zIndex="9999",r.style.top=`${n.top-1}px`,r.style.left=`${n.left-1}px`,r.style.width="15px",r.style.height="15px";const s=document.createElement("div");s.style.position="absolute",s.style.width="15px",s.style.height="1px",s.style.backgroundColor=t,s.style.top="0",s.style.left="0";const l=document.createElement("div");l.style.position="absolute",l.style.width="1px",l.style.height="15px",l.style.backgroundColor=t,l.style.top="0",l.style.left="0",r.appendChild(s),r.appendChild(l);const i=document.createElement("div");i.style.position="fixed",i.style.pointerEvents="none",i.style.zIndex="9999",i.style.top=`${n.top-1}px`,i.style.left=`${n.left+n.width-15+1}px`,i.style.width="15px",i.style.height="15px";const c=document.createElement("div");c.style.position="absolute",c.style.width="15px",c.style.height="1px",c.style.backgroundColor=t,c.style.top="0",c.style.right="0";const o=document.createElement("div");o.style.position="absolute",o.style.width="1px",o.style.height="15px",o.style.backgroundColor=t,o.style.top="0",o.style.right="0",i.appendChild(c),i.appendChild(o);const e=document.createElement("div");e.style.position="fixed",e.style.pointerEvents="none",e.style.zIndex="9999",e.style.top=`${n.top+n.height-15+1}px`,e.style.left=`${n.left-1}px`,e.style.width="15px",e.style.height="15px";const h=document.createElement("div");h.style.position="absolute",h.style.width="15px",h.style.height="1px",h.style.backgroundColor=t,h.style.bottom="0",h.style.left="0";const y=document.createElement("div");y.style.position="absolute",y.style.width="1px",y.style.height="15px",y.style.backgroundColor=t,y.style.bottom="0",y.style.left="0",e.appendChild(h),e.appendChild(y);const p=document.createElement("div");p.style.position="fixed",p.style.pointerEvents="none",p.style.zIndex="9999",p.style.top=`${n.top+n.height-15+1}px`,p.style.left=`${n.left+n.width-15+1}px`,p.style.width="15px",p.style.height="15px";const g=document.createElement("div");g.style.position="absolute",g.style.width="15px",g.style.height="1px",g.style.backgroundColor=t,g.style.bottom="0",g.style.right="0";const u=document.createElement("div");return u.style.position="absolute",u.style.width="1px",u.style.height="15px",u.style.backgroundColor=t,u.style.bottom="0",u.style.right="0",p.appendChild(g),p.appendChild(u),{topLeft:r,topRight:i,bottomLeft:e,bottomRight:p,*[Symbol.iterator](){yield r,yield i,yield e,yield p}}}function L(t){const n=$.getRect(document.body,t.positionedParent);return{top:t.scroll.y,left:0,width:n.width,height:window.innerHeight-n.top}}function T(t,n){const a=n.left+n.width/2,d=n.top+n.height/2;t.style.transformOrigin=`${a}px ${d}px`}function k(t,n){t.style.clipPath=`polygon(
31
31
  ${n.left}px ${n.top}px,
32
32
  ${n.left+n.width}px ${n.top}px,
33
33
  ${n.left+n.width}px ${n.top+n.height}px,
34
34
  ${n.left}px ${n.top+n.height}px
35
- )`}function ct(t,n){t.style.transform=`translateY(${-n.top}px)`}function dt(t,n){return t.querySelector(`[data-hero-key="${n}"]`)}const pt=(t={})=>{var l,i;const n={stiffness:((l=t.spring)==null?void 0:l.stiffness)??300,damping:((i=t.spring)==null?void 0:i.damping)??30},s=t.timeout??300,d=t.maxDistance??700;let r=null,a=null;return{in:async(c,o)=>{const e=c,h=Array.from(e.querySelectorAll("[data-hero-key]"));if(h.length===0)return{spring:n,tick:()=>{}};if(!await new Promise(g=>{r?g(!0):(a=g,setTimeout(()=>{a=null,g(!1)},s))})||!r)return r=null,{spring:n,tick:()=>{}};const p=h.map(g=>{const u=g.getAttribute("data-hero-key");if(!u)return null;const w=dt(r,u);if(!w)return null;const f=g,x=m.getRect(r,w),$=m.getRect(e,f),v=x.left-$.left-o.scrollOffset.x,F=x.top-$.top-o.scrollOffset.y,Y=x.width/$.width,U=x.height/$.height,V=f.style.transform,W=f.style.position,z=f.style.transformOrigin,X=f.style.zIndex,M=f.style.willChange;return{toEl:f,dx:v,dy:F,dw:Y,dh:U,originalTransform:V,originalPosition:W,originalTransformOrigin:z,originalZIndex:X,originalWillChange:M}}).filter(g=>g!==null&&Math.abs(g.dy)<=d);return r=null,p.length===0?{spring:n,tick:()=>{}}:{springs:p.map(({toEl:g,dx:u,dy:w,dw:f,dh:x})=>({spring:n,tick:$=>{g.style.transform=`translate(${(1-$)*u}px, ${(1-$)*w}px) scale(${$+(1-$)*f}, ${$+(1-$)*x})`}})),schedule:"parallel",prepare:()=>{p.forEach(({toEl:g})=>{g.style.position="relative",g.style.transformOrigin="top left",g.style.zIndex="1000",g.style.willChange="transform"})},onEnd:()=>{p.forEach(({toEl:g,originalTransform:u,originalPosition:w,originalTransformOrigin:f,originalZIndex:x,originalWillChange:$})=>{g.style.transform=u,g.style.position=w,g.style.transformOrigin=f,g.style.zIndex=x,g.style.willChange=$})}}},out:async c=>({spring:n,onStart:()=>{r=c,a&&(a(!0),a=null)},tick:()=>{},prepare:o=>{m.prepareOutgoing(o),o.style.opacity="0"}})}};function ht({detailRect:t,galleryRect:n,pageRect:s,scrollOffset:d}){const r=n.left-t.left+(n.width-t.width)/2-d.x,a=n.top-t.top+(n.height-t.height)/2-d.y,l=n.width/t.width,i=n.height/t.height,c=Math.max(l,i),o=t.top/s.height*100,e=(s.width-(t.left+t.width))/s.width*100,h=(s.height-(t.top+t.height))/s.height*100,y=t.left/s.width*100;return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:g=>{const u=1-g;return{clipPath:`inset(${o*u}% ${e*u}% ${h*u}% ${y*u}%)`,transform:`translate(${r*u}px, ${a*u}px) scale(${1+(c-1)*u})`}}}}function yt({detailRect:t,galleryRect:n,pageRect:s,scrollOffset:d}){const r=n.left-t.left+(n.width-t.width)/2+d.x,a=n.top-t.top+(n.height-t.height)/2+d.y,l=n.width/t.width,i=n.height/t.height,c=Math.min(l,i),o=t.top/s.height*100,e=(s.width-(t.left+t.width))/s.width*100,h=(s.height-(t.top+t.height))/s.height*100,y=t.left/s.width*100;return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:g=>{const u=1-g;return{clipPath:`inset(${o*u}% ${e*u}% ${h*u}% ${y*u}%)`,transform:`translate(${r*u-d.x}px, ${a*u-d.y}px) scale(${1+(c-1)*u})`}}}}function gt(t,n,s){const d=t.querySelector("[data-instagram-detail-key]"),r=n.querySelector("[data-instagram-detail-key]");if(t.querySelectorAll("[data-instagram-detail-key]").length>1||n.querySelectorAll("[data-instagram-detail-key]").length>1)return null;let a=null,l=null,i=!1;if(!d&&r){l=r;const e=l.getAttribute("data-instagram-detail-key");if(!e)return null;a=t.querySelector(`[data-instagram-gallery-key="${e}"]`),a&&(i=!0)}else if(d&&!r){l=d;const e=l.getAttribute("data-instagram-detail-key");if(!e)return null;a=n.querySelector(`[data-instagram-gallery-key="${e}"]`),a&&(i=!1)}if(!a||!l)return null;const c=m.getRect(i?t:n,a),o=m.getRect(i?n:t,l);if(i){const e=ht({detailRect:o,galleryRect:c,pageRect:n.getBoundingClientRect(),scrollOffset:s});return n.style.transformOrigin=e.transformOrigin,{isEnterMode:!0,inAnimation:e.animate}}else{const e=yt({detailRect:o,galleryRect:c,pageRect:t.getBoundingClientRect(),scrollOffset:s});return t.style.transformOrigin=e.transformOrigin,{isEnterMode:!1,outAnimation:e.animate}}}const ut=(t={})=>{var i,c;const n={stiffness:((i=t.spring)==null?void 0:i.stiffness)??150,damping:((c=t.spring)==null?void 0:c.damping)??20},s=t.timeout??300;let d=null,r=null,a=null,l=null;return{in:async(o,{scrollOffset:e})=>{const h=o;return!await new Promise(p=>{d?p(!0):(r=p,setTimeout(()=>{r=null,p(!1)},s))})||!d?(l==null||l(),l=null,d=null,{spring:n,css:()=>({})}):(a=gt(d,h,e),l==null||l(),l=null,a?(d=null,{spring:n,css:p=>a!=null&&a.inAnimation?a.inAnimation(p):{}}):(d=null,{spring:n,css:()=>({})}))},out:async(o,e)=>{const h=new Promise(y=>{l=y});return{spring:n,prepare:y=>{a!=null&&a.isEnterMode?m.prepareOutgoing(y):(m.prepareOutgoing(y,e),y.style.zIndex="-1")},wait:async()=>{d=o,r&&(r(!0),r=null),await h},css:y=>a!=null&&a.outAnimation?a.outAnimation(y):{}}}}};function ft({detailRect:t,galleryRect:n,pageRect:s,scrollOffset:d}){const r=n.left-t.left+(n.width-t.width)/2-d.x,a=n.top-t.top+(n.height-t.height)/2-d.y,l=n.width/t.width,i=n.height/t.height,c=Math.max(l,i),o=t.top/s.height*100,e=(s.width-(t.left+t.width))/s.width*100,h=(s.height-(t.top+t.height))/s.height*100,y=t.left/s.width*100;return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:g=>{const u=1-g;return{clipPath:`inset(${o*u}% ${e*u}% ${h*u}% ${y*u}%)`,transform:`translate(${r*u}px, ${a*u}px) scale(${1+(c-1)*u})`}}}}function mt({galleryRect:t,detailRect:n,scrollOffset:s}){const d=n.left-t.left+(n.width-t.width)/2+s.x,r=n.top-t.top+(n.height-t.height)/2+s.y,a=n.width/t.width,l=n.height/t.height,i=Math.max(a,l);return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:o=>{const e=1-o;return{transform:`translate(${d*e-s.x}px, ${r*e-s.y}px) scale(${1+(i-1)*e})`,opacity:`${1-e}`}}}}function $t({galleryRect:t,detailRect:n,scrollOffset:s}){const d=n.left-t.left+(n.width-t.width)/2-s.x,r=n.top-t.top+(n.height-t.height)/2-s.y,a=n.width/t.width,l=n.height/t.height,i=Math.max(a,l);return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:o=>{const e=1-o,h=o;return{transform:`translate(${d*e}px, ${r*e}px) scale(${1+(i-1)*e})`,opacity:`${h}`}}}}function wt({detailRect:t,galleryRect:n,pageRect:s,scrollOffset:d}){const r=n.left-t.left+(n.width-t.width)/2+d.x,a=n.top-t.top+(n.height-t.height)/2+d.y,l=n.width/t.width,i=n.height/t.height,c=Math.min(l,i),o=t.top/s.height*100,e=(s.width-(t.left+t.width))/s.width*100,h=(s.height-(t.top+t.height))/s.height*100,y=t.left/s.width*100;return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:g=>{const u=1-g;return{clipPath:`inset(${o*u}% ${e*u}% ${h*u}% ${y*u}%)`,transform:`translate(${r*u-d.x}px, ${a*u-d.y}px) scale(${1+(c-1)*u})`}}}}function xt(t,n,s){const d=t.querySelector("[data-pinterest-detail-key]"),r=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,l=null,i=!1;if(!d&&r){l=r;const e=l.getAttribute("data-pinterest-detail-key");if(!e)return null;a=t.querySelector(`[data-pinterest-gallery-key="${e}"]`),a&&(i=!0)}else if(d&&!r){l=d;const e=l.getAttribute("data-pinterest-detail-key");if(!e)return null;a=n.querySelector(`[data-pinterest-gallery-key="${e}"]`),a&&(i=!1)}if(!a||!l)return null;const c=m.getRect(i?t:n,a),o=m.getRect(i?n:t,l);if(i){const e=ft({detailRect:o,galleryRect:c,pageRect:n.getBoundingClientRect(),scrollOffset:s}),h=mt({galleryRect:c,detailRect:o,scrollOffset:s});return n.style.transformOrigin=e.transformOrigin,t.style.transformOrigin=h.transformOrigin,{inAnimation:e.animate,outAnimation:h.animate}}else{const e=$t({galleryRect:c,detailRect:o,scrollOffset:s}),h=wt({detailRect:o,galleryRect:c,pageRect:t.getBoundingClientRect(),scrollOffset:s});return n.style.transformOrigin=e.transformOrigin,t.style.transformOrigin=h.transformOrigin,{inAnimation:e.animate,outAnimation:h.animate}}}const bt=(t={})=>{var i,c;const n={stiffness:((i=t.spring)==null?void 0:i.stiffness)??30,damping:((c=t.spring)==null?void 0:c.damping)??10},s=t.timeout??300;let d=null,r=null,a=null,l=null;return{in:async(o,{scrollOffset:e})=>{const h=o;return!await new Promise(p=>{d?p(!0):(r=p,setTimeout(()=>{r=null,p(!1)},s))})||!d?(l==null||l(),l=null,d=null,{spring:n,css:()=>({})}):(a=xt(d,h,e),l==null||l(),l=null,a?(d=null,{spring:n,css:p=>a?a.inAnimation(p):{}}):(d=null,{spring:n,css:()=>({})}))},out:async o=>{const e=new Promise(h=>{l=h});return{spring:n,prepare:h=>{m.prepareOutgoing(h),h.style.zIndex="-1"},wait:async()=>{d=o,r&&(r(!0),r=null),await e},css:h=>a?a.outAnimation(h):{}}}}},S={stiffness:5,damping:4},Et=(t={})=>{var c,o;const n=t.direction??"up",s={stiffness:((c=t.spring)==null?void 0:c.stiffness)??S.stiffness,damping:((o=t.spring)==null?void 0:o.damping)??S.damping},d=n==="up";let r=null,a=null,l=null;const i=()=>{if(r===null||a===null)return null;const e=Math.min(r,a),h=window.innerHeight;return Math.max(e,h)};return{in:e=>(a=e.offsetHeight,r!==null&&(l=i()),{spring:s,prepare:()=>{e.style.willChange="transform",e.style.backfaceVisibility="hidden",e.style.contain="layout paint"},tick:h=>{l===null&&(l=i());const y=l??window.innerHeight,p=d?(1-h)*y:(1-h)*-y;e.style.transform=`translate3d(0, ${p}px, 0)`},onEnd:()=>{e.style.willChange="auto",e.style.backfaceVisibility="",e.style.contain=""}}),out:(e,h)=>({spring:s,onStart:()=>{r=e.offsetHeight,a!==null&&(l=i())},tick:y=>{l===null&&(l=i());const p=l??window.innerHeight,g=d?(1-y)*-p:(1-y)*p;e.style.transform=`translate3d(0, ${g}px, 0)`},prepare:y=>{m.prepareOutgoing(y,h),y.style.zIndex=d?"-1":"1",y.style.willChange="transform",y.style.backfaceVisibility="hidden",y.style.contain="layout paint",y.style.pointerEvents="none"}})}},_={stiffness:15,damping:7},Ct=(t={})=>{var r,a;const n=t.direction??"left",s={stiffness:((r=t.spring)==null?void 0:r.stiffness)??_.stiffness,damping:((a=t.spring)==null?void 0:a.damping)??_.damping},d=n==="left";return{in:l=>({spring:s,prepare:()=>{l.style.willChange="transform",l.style.backfaceVisibility="hidden",l.style.contain="layout paint"},css:i=>({transform:`translate3d(${d?(1-i)*100:(1-i)*-100}%, 0, 0)`}),onEnd:()=>{l.style.willChange="auto",l.style.backfaceVisibility="",l.style.contain=""}}),out:(l,i)=>({spring:s,css:c=>({transform:`translate3d(${d?(1-c)*-100:(1-c)*100}%, 0, 0)`}),prepare:c=>{m.prepareOutgoing(c,i),c.style.willChange="transform",c.style.backfaceVisibility="hidden",c.style.contain="layout paint",c.style.pointerEvents="none"}})}},I={stiffness:17,damping:6},A=20,E=800,At=()=>{let t,n=null;return{in:s=>({spring:I,prepare:()=>{s.style.willChange="transform",s.style.backfaceVisibility="hidden",s.style.contain="layout paint",s.style.transform=`perspective(${E}px) rotateY(${A}deg) translate3d(-100%, 0, 0)`},wait:async()=>{t&&await t},css:d=>{const r=(1-d)*A,a=-(1-d)*100;return{transform:`perspective(${E}px) rotateY(${r}deg) translate3d(${a}%, 0, 0)`}},onEnd:()=>{s.style.transform="",s.style.willChange="auto",s.style.backfaceVisibility="",s.style.contain=""}}),out:(s,d)=>(t=new Promise(r=>{n=r}),{spring:I,prepare:r=>{m.prepareOutgoing(r,d),r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint",r.style.pointerEvents="none",r.style.transform=`perspective(${E}px) rotateY(0deg) translate3d(0%, 0, 0)`},css:r=>{const a=1-r,l=a*A,i=a*100;return{transform:`perspective(${E}px) rotateY(${-l}deg) translate3d(${i}%, 0, 0)`}},onEnd:()=>{n&&n(),s.style.transform=""}})}},Lt={stiffness:1,damping:1},Tt={stiffness:20,damping:25},kt="#000000",Ot="circle",D="CURTAIN_REVEAL_OVERLAY_ID",St={position:"fixed",inset:"0",width:"100vw",height:"100%",zIndex:"9999",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"},_t={position:"relative",display:"inline-block",height:"5.5rem",overflow:"hidden"},It={display:"flex",height:"100%",willChange:"transform",transition:"transform 0.3s ease"},Dt={display:"inline-flex",alignItems:"center",justifyContent:"center",whiteSpace:"nowrap",fontSize:"5.5rem",fontWeight:"900",letterSpacing:"0.02em",color:"#FFFFFF"},Pt=.4,C=.5,vt=.2;function Ft(t,n){switch(t){case"circle":return`circle(${n*100}% at 50% 50%)`;case"square":return`inset(${(1-n)*50}% round ${10*n}%)`;case"triangle":{const s=n*100;return`polygon(50% ${50-s}%, ${50-s}% ${50+s}%, ${50+s}% ${50+s}%)`}}}const Yt=t=>t.reduce((n,s)=>n+s,0),Ut=(t={})=>{const{background:n=kt,texts:s=[],shape:d=Ot,inSpring:r=Tt,outSpring:a=Lt,textStyle:l={}}=t;return{out:(i,c)=>{const o=i.style.opacity;return{spring:a,from:1,to:0,prepare:e=>{m.prepareOutgoing(e,c),e.style.opacity="1"},tick:e=>{const h=Math.max(0,e-Pt);i.style.opacity=String(h)},onEnd:()=>{i.style.opacity=o}}},in:i=>{let c=null,o=null,e=null;const h=document.body.style.overflow,y=document.getElementById(D);let p=[];const g=()=>{c=document.createElement("div"),c.id=D,Object.assign(c.style,St,{background:n}),document.body.appendChild(c),o=document.createElement("div"),Object.assign(o.style,_t),c.appendChild(o),e=document.createElement("div"),Object.assign(e.style,It),o.appendChild(e),s.forEach(u=>{const w=document.createElement("div");w.textContent=u,Object.assign(w.style,Dt,l),e.appendChild(w)}),p=Array.from(e.children).map(u=>u.getBoundingClientRect().width)};return{spring:r,from:0,to:1,prepare:()=>{document.body.style.overflow="hidden",i.style.opacity="1",y==null||y.remove(),g(),c&&o&&(c.style.clipPath="none",o.style.transform="scale(1)")},tick:u=>{if(!(!c||!o||!e)){if(u<=C&&s.length>0){const w=u/C,f=Math.min(Math.floor(w*s.length),s.length-1),x=p[f]??0,$=Yt(p.slice(0,f));o.style.width=`${x}px`,e.style.transform=`translateX(-${$}px)`}if(u>C){const f=1-Math.max(0,Math.min(1,(u-C)/vt));c.style.clipPath=Ft(d,f),o.style.transform=`scale(${f})`}}},onEnd:()=>{c==null||c.remove(),c=o=e=null,document.body.style.overflow=h}}}}};exports.jaemin=m.jaemin;exports.blind=K;exports.curtainReveal=Ut;exports.drill=Q;exports.fade=et;exports.film=rt;exports.hero=pt;exports.instagram=ut;exports.pinterest=bt;exports.scroll=Et;exports.slide=Ct;exports.strip=At;
35
+ )`}function ot(t,n){t.style.transform=`translateY(${-n.top}px)`}function ct(t,n){return t.querySelector(`[data-hero-key="${n}"]`)}const dt=(t={})=>{var l,i;const n={stiffness:((l=t.spring)==null?void 0:l.stiffness)??300,damping:((i=t.spring)==null?void 0:i.damping)??30},a=t.timeout??300,d=t.maxDistance??700;let r=null,s=null;return{in:async(c,o)=>{const e=c,h=Array.from(e.querySelectorAll("[data-hero-key]"));if(h.length===0)return{spring:n,tick:()=>{}};if(!await new Promise(g=>{r?g(!0):(s=g,setTimeout(()=>{s=null,g(!1)},a))})||!r)return r=null,{spring:n,tick:()=>{}};const p=h.map(g=>{const u=g.getAttribute("data-hero-key");if(!u)return null;const w=ct(r,u);if(!w)return null;const f=g,x=$.getRect(r,w),m=$.getRect(e,f),P=x.left-m.left-o.scrollOffset.x,v=x.top-m.top-o.scrollOffset.y,F=x.width/m.width,Y=x.height/m.height,U=f.style.transform,V=f.style.position,W=f.style.transformOrigin,z=f.style.zIndex,X=f.style.willChange;return{toEl:f,dx:P,dy:v,dw:F,dh:Y,originalTransform:U,originalPosition:V,originalTransformOrigin:W,originalZIndex:z,originalWillChange:X}}).filter(g=>g!==null&&Math.abs(g.dy)<=d);return r=null,p.length===0?{spring:n,tick:()=>{}}:{springs:p.map(({toEl:g,dx:u,dy:w,dw:f,dh:x})=>({spring:n,tick:m=>{g.style.transform=`translate(${(1-m)*u}px, ${(1-m)*w}px) scale(${m+(1-m)*f}, ${m+(1-m)*x})`}})),schedule:"parallel",prepare:()=>{p.forEach(({toEl:g})=>{g.style.position="relative",g.style.transformOrigin="top left",g.style.zIndex="1000",g.style.willChange="transform"})},onEnd:()=>{p.forEach(({toEl:g,originalTransform:u,originalPosition:w,originalTransformOrigin:f,originalZIndex:x,originalWillChange:m})=>{g.style.transform=u,g.style.position=w,g.style.transformOrigin=f,g.style.zIndex=x,g.style.willChange=m})}}},out:async c=>({spring:n,onStart:()=>{r=c,s&&(s(!0),s=null)},tick:()=>{},prepare:o=>{$.prepareOutgoing(o),o.style.opacity="0"}})}};function pt({detailRect:t,galleryRect:n,pageRect:a,scrollOffset:d}){const r=n.left-t.left+(n.width-t.width)/2-d.x,s=n.top-t.top+(n.height-t.height)/2-d.y,l=n.width/t.width,i=n.height/t.height,c=Math.max(l,i),o=t.top/a.height*100,e=(a.width-(t.left+t.width))/a.width*100,h=(a.height-(t.top+t.height))/a.height*100,y=t.left/a.width*100;return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:g=>{const u=1-g;return{clipPath:`inset(${o*u}% ${e*u}% ${h*u}% ${y*u}%)`,transform:`translate(${r*u}px, ${s*u}px) scale(${1+(c-1)*u})`}}}}function ht({detailRect:t,galleryRect:n,pageRect:a,scrollOffset:d}){const r=n.left-t.left+(n.width-t.width)/2+d.x,s=n.top-t.top+(n.height-t.height)/2+d.y,l=n.width/t.width,i=n.height/t.height,c=Math.min(l,i),o=t.top/a.height*100,e=(a.width-(t.left+t.width))/a.width*100,h=(a.height-(t.top+t.height))/a.height*100,y=t.left/a.width*100;return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:g=>{const u=1-g;return{clipPath:`inset(${o*u}% ${e*u}% ${h*u}% ${y*u}%)`,transform:`translate(${r*u-d.x}px, ${s*u-d.y}px) scale(${1+(c-1)*u})`}}}}function yt(t,n,a){const d=t.querySelector("[data-instagram-detail-key]"),r=n.querySelector("[data-instagram-detail-key]");if(t.querySelectorAll("[data-instagram-detail-key]").length>1||n.querySelectorAll("[data-instagram-detail-key]").length>1)return null;let s=null,l=null,i=!1;if(!d&&r){l=r;const e=l.getAttribute("data-instagram-detail-key");if(!e)return null;s=t.querySelector(`[data-instagram-gallery-key="${e}"]`),s&&(i=!0)}else if(d&&!r){l=d;const e=l.getAttribute("data-instagram-detail-key");if(!e)return null;s=n.querySelector(`[data-instagram-gallery-key="${e}"]`),s&&(i=!1)}if(!s||!l)return null;const c=$.getRect(i?t:n,s),o=$.getRect(i?n:t,l);if(i){const e=pt({detailRect:o,galleryRect:c,pageRect:n.getBoundingClientRect(),scrollOffset:a});return n.style.transformOrigin=e.transformOrigin,{isEnterMode:!0,inAnimation:e.animate}}else{const e=ht({detailRect:o,galleryRect:c,pageRect:t.getBoundingClientRect(),scrollOffset:a});return t.style.transformOrigin=e.transformOrigin,{isEnterMode:!1,outAnimation:e.animate}}}const gt=(t={})=>{var i,c;const n={stiffness:((i=t.spring)==null?void 0:i.stiffness)??150,damping:((c=t.spring)==null?void 0:c.damping)??20},a=t.timeout??300;let d=null,r=null,s=null,l=null;return{in:async(o,{scrollOffset:e})=>{const h=o;return!await new Promise(p=>{d?p(!0):(r=p,setTimeout(()=>{r=null,p(!1)},a))})||!d?(l==null||l(),l=null,d=null,{spring:n,css:()=>({})}):(s=yt(d,h,e),l==null||l(),l=null,s?(d=null,{spring:n,css:p=>s!=null&&s.inAnimation?s.inAnimation(p):{}}):(d=null,{spring:n,css:()=>({})}))},out:async(o,e)=>{const h=new Promise(y=>{l=y});return{spring:n,prepare:y=>{s!=null&&s.isEnterMode?$.prepareOutgoing(y):($.prepareOutgoing(y,e),y.style.zIndex="-1")},wait:async()=>{d=o,r&&(r(!0),r=null),await h},css:y=>s!=null&&s.outAnimation?s.outAnimation(y):{}}}}};function ut({detailRect:t,galleryRect:n,pageRect:a,scrollOffset:d}){const r=n.left-t.left+(n.width-t.width)/2-d.x,s=n.top-t.top+(n.height-t.height)/2-d.y,l=n.width/t.width,i=n.height/t.height,c=Math.max(l,i),o=t.top/a.height*100,e=(a.width-(t.left+t.width))/a.width*100,h=(a.height-(t.top+t.height))/a.height*100,y=t.left/a.width*100;return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:g=>{const u=1-g;return{clipPath:`inset(${o*u}% ${e*u}% ${h*u}% ${y*u}%)`,transform:`translate(${r*u}px, ${s*u}px) scale(${1+(c-1)*u})`}}}}function ft({galleryRect:t,detailRect:n,scrollOffset:a}){const d=n.left-t.left+(n.width-t.width)/2+a.x,r=n.top-t.top+(n.height-t.height)/2+a.y,s=n.width/t.width,l=n.height/t.height,i=Math.max(s,l);return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:o=>{const e=1-o;return{transform:`translate(${d*e-a.x}px, ${r*e-a.y}px) scale(${1+(i-1)*e})`,opacity:`${1-e}`}}}}function $t({galleryRect:t,detailRect:n,scrollOffset:a}){const d=n.left-t.left+(n.width-t.width)/2-a.x,r=n.top-t.top+(n.height-t.height)/2-a.y,s=n.width/t.width,l=n.height/t.height,i=Math.max(s,l);return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:o=>{const e=1-o,h=o;return{transform:`translate(${d*e}px, ${r*e}px) scale(${1+(i-1)*e})`,opacity:`${h}`}}}}function mt({detailRect:t,galleryRect:n,pageRect:a,scrollOffset:d}){const r=n.left-t.left+(n.width-t.width)/2+d.x,s=n.top-t.top+(n.height-t.height)/2+d.y,l=n.width/t.width,i=n.height/t.height,c=Math.min(l,i),o=t.top/a.height*100,e=(a.width-(t.left+t.width))/a.width*100,h=(a.height-(t.top+t.height))/a.height*100,y=t.left/a.width*100;return{transformOrigin:`${t.left+t.width/2}px ${t.top+t.height/2}px`,animate:g=>{const u=1-g;return{clipPath:`inset(${o*u}% ${e*u}% ${h*u}% ${y*u}%)`,transform:`translate(${r*u-d.x}px, ${s*u-d.y}px) scale(${1+(c-1)*u})`}}}}function wt(t,n,a){const d=t.querySelector("[data-pinterest-detail-key]"),r=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 s=null,l=null,i=!1;if(!d&&r){l=r;const e=l.getAttribute("data-pinterest-detail-key");if(!e)return null;s=t.querySelector(`[data-pinterest-gallery-key="${e}"]`),s&&(i=!0)}else if(d&&!r){l=d;const e=l.getAttribute("data-pinterest-detail-key");if(!e)return null;s=n.querySelector(`[data-pinterest-gallery-key="${e}"]`),s&&(i=!1)}if(!s||!l)return null;const c=$.getRect(i?t:n,s),o=$.getRect(i?n:t,l);if(i){const e=ut({detailRect:o,galleryRect:c,pageRect:n.getBoundingClientRect(),scrollOffset:a}),h=ft({galleryRect:c,detailRect:o,scrollOffset:a});return n.style.transformOrigin=e.transformOrigin,t.style.transformOrigin=h.transformOrigin,{inAnimation:e.animate,outAnimation:h.animate}}else{const e=$t({galleryRect:c,detailRect:o,scrollOffset:a}),h=mt({detailRect:o,galleryRect:c,pageRect:t.getBoundingClientRect(),scrollOffset:a});return n.style.transformOrigin=e.transformOrigin,t.style.transformOrigin=h.transformOrigin,{inAnimation:e.animate,outAnimation:h.animate}}}const xt=(t={})=>{var i,c;const n={stiffness:((i=t.spring)==null?void 0:i.stiffness)??30,damping:((c=t.spring)==null?void 0:c.damping)??10},a=t.timeout??300;let d=null,r=null,s=null,l=null;return{in:async(o,{scrollOffset:e})=>{const h=o;return!await new Promise(p=>{d?p(!0):(r=p,setTimeout(()=>{r=null,p(!1)},a))})||!d?(l==null||l(),l=null,d=null,{spring:n,css:()=>({})}):(s=wt(d,h,e),l==null||l(),l=null,s?(d=null,{spring:n,css:p=>s?s.inAnimation(p):{}}):(d=null,{spring:n,css:()=>({})}))},out:async o=>{const e=new Promise(h=>{l=h});return{spring:n,prepare:h=>{$.prepareOutgoing(h),h.style.zIndex="-1"},wait:async()=>{d=o,r&&(r(!0),r=null),await e},css:h=>s?s.outAnimation(h):{}}}}},O={stiffness:5,damping:4},bt=(t={})=>{var c,o;const n=t.direction??"up",a={stiffness:((c=t.spring)==null?void 0:c.stiffness)??O.stiffness,damping:((o=t.spring)==null?void 0:o.damping)??O.damping},d=n==="up";let r=null,s=null,l=null;const i=()=>{if(r===null||s===null)return null;const e=Math.min(r,s),h=window.innerHeight;return Math.max(e,h)};return{in:e=>(s=e.offsetHeight,r!==null&&(l=i()),{spring:a,prepare:()=>{e.style.willChange="transform",e.style.backfaceVisibility="hidden",e.style.contain="layout paint"},tick:h=>{l===null&&(l=i());const y=l??window.innerHeight,p=d?(1-h)*y:(1-h)*-y;e.style.transform=`translate3d(0, ${p}px, 0)`},onEnd:()=>{e.style.willChange="auto",e.style.backfaceVisibility="",e.style.contain=""}}),out:(e,h)=>({spring:a,onStart:()=>{r=e.offsetHeight,s!==null&&(l=i())},tick:y=>{l===null&&(l=i());const p=l??window.innerHeight,g=d?(1-y)*-p:(1-y)*p;e.style.transform=`translate3d(0, ${g}px, 0)`},prepare:y=>{$.prepareOutgoing(y,h),y.style.zIndex=d?"-1":"1",y.style.willChange="transform",y.style.backfaceVisibility="hidden",y.style.contain="layout paint",y.style.pointerEvents="none"}})}},S={stiffness:15,damping:7},Et=(t={})=>{var r,s;const n=t.direction??"left",a={stiffness:((r=t.spring)==null?void 0:r.stiffness)??S.stiffness,damping:((s=t.spring)==null?void 0:s.damping)??S.damping},d=n==="left";return{in:l=>({spring:a,prepare:()=>{l.style.willChange="transform",l.style.backfaceVisibility="hidden",l.style.contain="layout paint"},css:i=>({transform:`translate3d(${d?(1-i)*100:(1-i)*-100}%, 0, 0)`}),onEnd:()=>{l.style.willChange="auto",l.style.backfaceVisibility="",l.style.contain=""}}),out:(l,i)=>({spring:a,css:c=>({transform:`translate3d(${d?(1-c)*-100:(1-c)*100}%, 0, 0)`}),prepare:c=>{$.prepareOutgoing(c,i),c.style.willChange="transform",c.style.backfaceVisibility="hidden",c.style.contain="layout paint",c.style.pointerEvents="none"}})}},_={stiffness:17,damping:6},A=20,E=800,Ct=()=>{let t,n=null;return{in:a=>({spring:_,prepare:()=>{a.style.willChange="transform",a.style.backfaceVisibility="hidden",a.style.contain="layout paint",a.style.transform=`perspective(${E}px) rotateY(${A}deg) translate3d(-100%, 0, 0)`},wait:async()=>{t&&await t},css:d=>{const r=(1-d)*A,s=-(1-d)*100;return{transform:`perspective(${E}px) rotateY(${r}deg) translate3d(${s}%, 0, 0)`}},onEnd:()=>{a.style.transform="",a.style.willChange="auto",a.style.backfaceVisibility="",a.style.contain=""}}),out:(a,d)=>(t=new Promise(r=>{n=r}),{spring:_,prepare:r=>{$.prepareOutgoing(r,d),r.style.willChange="transform",r.style.backfaceVisibility="hidden",r.style.contain="layout paint",r.style.pointerEvents="none",r.style.transform=`perspective(${E}px) rotateY(0deg) translate3d(0%, 0, 0)`},css:r=>{const s=1-r,l=s*A,i=s*100;return{transform:`perspective(${E}px) rotateY(${-l}deg) translate3d(${i}%, 0, 0)`}},onEnd:()=>{n&&n(),a.style.transform=""}})}},At={stiffness:1,damping:1},Lt={stiffness:20,damping:25},Tt="#000000",kt="circle",I="CURTAIN_REVEAL_OVERLAY_ID",Ot={position:"fixed",inset:"0",width:"100vw",height:"100%",zIndex:"9999",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"},St={position:"relative",display:"inline-block",height:"5.5rem",overflow:"hidden"},_t={display:"flex",height:"100%",willChange:"transform",transition:"transform 0.3s ease"},It={display:"inline-flex",alignItems:"center",justifyContent:"center",whiteSpace:"nowrap",fontSize:"5.5rem",fontWeight:"900",letterSpacing:"0.02em",color:"#FFFFFF"},Dt=.4,C=.5,Pt=.2;function vt(t,n){switch(t){case"circle":return`circle(${n*100}% at 50% 50%)`;case"square":return`inset(${(1-n)*50}% round ${10*n}%)`;case"triangle":{const a=n*100;return`polygon(50% ${50-a}%, ${50-a}% ${50+a}%, ${50+a}% ${50+a}%)`}}}const Ft=t=>t.reduce((n,a)=>n+a,0),Yt=(t={})=>{const{background:n=Tt,texts:a=[],shape:d=kt,inSpring:r=Lt,outSpring:s=At,textStyle:l={}}=t;return{out:(i,c)=>{const o=i.style.opacity;return{spring:s,from:1,to:0,prepare:e=>{$.prepareOutgoing(e,c),e.style.opacity="1"},tick:e=>{const h=Math.max(0,e-Dt);i.style.opacity=String(h)},onEnd:()=>{i.style.opacity=o}}},in:i=>{let c=null,o=null,e=null;const h=document.body.style.overflow,y=document.getElementById(I);let p=[];const g=()=>{c=document.createElement("div"),c.id=I,Object.assign(c.style,Ot,{background:n}),document.body.appendChild(c),o=document.createElement("div"),Object.assign(o.style,St),c.appendChild(o),e=document.createElement("div"),Object.assign(e.style,_t),o.appendChild(e),a.forEach(u=>{const w=document.createElement("div");w.textContent=u,Object.assign(w.style,It,l),e.appendChild(w)}),p=Array.from(e.children).map(u=>u.getBoundingClientRect().width)};return{spring:r,from:0,to:1,prepare:()=>{document.body.style.overflow="hidden",i.style.opacity="1",y==null||y.remove(),g(),c&&o&&(c.style.clipPath="none",o.style.transform="scale(1)")},tick:u=>{if(!(!c||!o||!e)){if(u<=C&&a.length>0){const w=u/C,f=Math.min(Math.floor(w*a.length),a.length-1),x=p[f]??0,m=Ft(p.slice(0,f));o.style.width=`${x}px`,e.style.transform=`translateX(-${m}px)`}if(u>C){const f=1-Math.max(0,Math.min(1,(u-C)/Pt));c.style.clipPath=vt(d,f),o.style.transform=`scale(${f})`}}},onEnd:()=>{c==null||c.remove(),c=o=e=null,document.body.style.overflow=h}}}}};exports.jaemin=$.jaemin;exports.blind=j;exports.curtainReveal=Yt;exports.drill=J;exports.fade=nt;exports.film=at;exports.hero=dt;exports.instagram=gt;exports.pinterest=xt;exports.scroll=bt;exports.slide=Et;exports.strip=Ct;