@ssgoi/core 2.5.1 → 2.5.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.
Files changed (47) hide show
  1. package/dist/animator/animate.d.ts.map +1 -0
  2. package/dist/{animation-scheduler.d.ts → animator/animation-scheduler.d.ts} +1 -1
  3. package/dist/animator/animation-scheduler.d.ts.map +1 -0
  4. package/dist/{animator.d.ts → animator/index.d.ts} +2 -2
  5. package/dist/animator/index.d.ts.map +1 -0
  6. package/dist/animator/ticker.d.ts.map +1 -0
  7. package/dist/index.cjs +2 -2
  8. package/dist/index.d.ts +3 -3
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +275 -266
  11. package/dist/ssgoi-transition/create-context-manager.d.ts +18 -0
  12. package/dist/ssgoi-transition/create-context-manager.d.ts.map +1 -0
  13. package/dist/ssgoi-transition/create-ssgoi-transition-context.d.ts +46 -0
  14. package/dist/ssgoi-transition/create-ssgoi-transition-context.d.ts.map +1 -0
  15. package/dist/ssgoi-transition/create-swipe-detector.d.ts +10 -0
  16. package/dist/ssgoi-transition/create-swipe-detector.d.ts.map +1 -0
  17. package/dist/ssgoi-transition/find-matching-transition.d.ts +24 -0
  18. package/dist/ssgoi-transition/find-matching-transition.d.ts.map +1 -0
  19. package/dist/ssgoi-transition/process-symmetric-transitions.d.ts +7 -0
  20. package/dist/ssgoi-transition/process-symmetric-transitions.d.ts.map +1 -0
  21. package/dist/ssgoi-transition/types.d.ts +8 -0
  22. package/dist/ssgoi-transition/types.d.ts.map +1 -0
  23. package/dist/{create-transition-callback.d.ts → transition/create-transition-callback.d.ts} +1 -1
  24. package/dist/transition/create-transition-callback.d.ts.map +1 -0
  25. package/dist/{transition-strategy.d.ts → transition/transition-strategy.d.ts} +1 -1
  26. package/dist/transition/transition-strategy.d.ts.map +1 -0
  27. package/dist/{transition.d.ts → transition/transition.d.ts} +1 -1
  28. package/dist/transition/transition.d.ts.map +1 -0
  29. package/dist/view-transitions/index.cjs +9 -9
  30. package/dist/view-transitions/index.d.ts +1 -0
  31. package/dist/view-transitions/index.d.ts.map +1 -1
  32. package/dist/view-transitions/index.js +543 -412
  33. package/dist/view-transitions/instagram.d.ts +8 -0
  34. package/dist/view-transitions/instagram.d.ts.map +1 -0
  35. package/dist/view-transitions/pinterest.d.ts.map +1 -1
  36. package/package.json +13 -14
  37. package/dist/animate.d.ts.map +0 -1
  38. package/dist/animation-scheduler.d.ts.map +0 -1
  39. package/dist/animator.d.ts.map +0 -1
  40. package/dist/create-ssgoi-transition-context.d.ts +0 -15
  41. package/dist/create-ssgoi-transition-context.d.ts.map +0 -1
  42. package/dist/create-transition-callback.d.ts.map +0 -1
  43. package/dist/ticker.d.ts.map +0 -1
  44. package/dist/transition-strategy.d.ts.map +0 -1
  45. package/dist/transition.d.ts.map +0 -1
  46. /package/dist/{animate.d.ts → animator/animate.d.ts} +0 -0
  47. /package/dist/{ticker.d.ts → animator/ticker.d.ts} +0 -0
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Creates a context manager for tracking transition-related information
3
+ * including scroll positions and DOM element relationships
4
+ */
5
+ export declare function createContextManager(): {
6
+ initializeContext: (element: HTMLElement, path: string) => void;
7
+ calculateScrollOffset: (from?: string, to?: string) => {
8
+ x: number;
9
+ y: number;
10
+ };
11
+ getScrollContainer: () => HTMLElement | null;
12
+ getPositionedParentElement: () => HTMLElement;
13
+ getScrollPosition: (path?: string) => {
14
+ x: number;
15
+ y: number;
16
+ };
17
+ };
18
+ //# sourceMappingURL=create-context-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-context-manager.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/create-context-manager.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAgB,oBAAoB;iCAiBE,WAAW,QAAQ,MAAM;mCAyBpD,MAAM,OACR,MAAM,KACV;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE;;;+BAyBO,MAAM,KAAG;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE;EAapE"}
@@ -0,0 +1,46 @@
1
+ import { SsgoiConfig, SsgoiContext } from '../types';
2
+ /**
3
+ * SSGOI Transition Context Operation Principles
4
+ *
5
+ * Page transition scenario: /home → /about
6
+ *
7
+ * 1. OUT animation starts (when /home page disappears)
8
+ * - getTransition('unique-id', 'out', '/home') is called
9
+ * - Stores { from: '/home' } in pendingTransitions
10
+ * - Creates Promise and stores outResolve (not resolved yet)
11
+ * - Calls checkAndResolve → waits because 'to' is missing
12
+ *
13
+ * 2. IN animation starts (when /about page appears)
14
+ * - getTransition('unique-id', 'in', '/about') is called
15
+ * - Adds { to: '/about' } to existing pending
16
+ * - Creates Promise and stores inResolve
17
+ * - Calls checkAndResolve → both 'from' and 'to' are present!
18
+ *
19
+ * 3. Transition matching and resolution
20
+ * - Finds appropriate transition with from: '/home', to: '/about'
21
+ * - Resolves both out and in with the found transition's settings
22
+ * - Removes the id from pendingTransitions
23
+ *
24
+ * Key point: OUT and IN wait for each other. When both are ready,
25
+ * they find the appropriate transition using from/to info
26
+ * and resolve simultaneously.
27
+ *
28
+ * Edge cases:
29
+ * - No OUT animation on page refresh or initial entry
30
+ * - When only IN is called, checkAndResolve doesn't work without 'from'
31
+ * - Promise isn't resolved, so animation doesn't start
32
+ */
33
+ /**
34
+ * Creates a transition configuration
35
+ *
36
+ * @example
37
+ * const config = createSggoiTransitionConfig({
38
+ * transitions: [
39
+ * { from: '/home', to: '/about', transition: fade() },
40
+ * { from: '/products', to: '/products/*', transition: slide() }
41
+ * ],
42
+ * defaultTransition: fade()
43
+ * });
44
+ */
45
+ export declare function createSggoiTransitionContext(options: SsgoiConfig): SsgoiContext;
46
+ //# sourceMappingURL=create-ssgoi-transition-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-ssgoi-transition-context.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/create-ssgoi-transition-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAuB,MAAM,UAAU,CAAC;AAW/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH;;;;;;;;;;;GAWG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,WAAW,GACnB,YAAY,CAkJd"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Creates a swipe detector for iOS Safari swipe-back gesture
3
+ * Detects edge swipes that trigger Safari's native back navigation
4
+ */
5
+ export declare function createSwipeDetector(enabled: boolean): {
6
+ initialize: () => void;
7
+ cleanup: () => void;
8
+ isSwipePending: () => boolean;
9
+ };
10
+ //# sourceMappingURL=create-swipe-detector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-swipe-detector.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/create-swipe-detector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO;;;;EAgFnD"}
@@ -0,0 +1,24 @@
1
+ import { Transition } from '../types';
2
+ /**
3
+ * Matches a path against a pattern
4
+ * Supports exact matches and wildcard patterns
5
+ *
6
+ * @example
7
+ * matchPath('/products', '/products') // true
8
+ * matchPath('/products/123', '/products/*') // true
9
+ * matchPath('/products/123', '/products') // false
10
+ * matchPath('/anything', '*') // true
11
+ */
12
+ export declare function matchPath(path: string, pattern: string): boolean;
13
+ /**
14
+ * Finds a matching transition configuration for the given from and to paths
15
+ *
16
+ * First tries to find exact match for both from and to paths,
17
+ * then falls back to wildcard matches if no exact match is found.
18
+ */
19
+ export declare function findMatchingTransition<TContext>(from: string, to: string, transitions: Array<{
20
+ from: string;
21
+ to: string;
22
+ transition: Transition<TContext>;
23
+ }>): Transition<TContext> | null;
24
+ //# sourceMappingURL=find-matching-transition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-matching-transition.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/find-matching-transition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAchE;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAC7C,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,EACV,WAAW,EAAE,KAAK,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;CAClC,CAAC,GACD,UAAU,CAAC,QAAQ,CAAC,GAAG,IAAI,CAmB7B"}
@@ -0,0 +1,7 @@
1
+ import { SsgoiConfig } from '../types';
2
+ /**
3
+ * Processes symmetric transitions to create bidirectional navigation
4
+ * For each symmetric transition, creates a reverse transition automatically
5
+ */
6
+ export declare function processSymmetricTransitions(transitions: NonNullable<SsgoiConfig["transitions"]>): Omit<NonNullable<SsgoiConfig["transitions"]>[number], "symmetric">[];
7
+ //# sourceMappingURL=process-symmetric-transitions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-symmetric-transitions.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/process-symmetric-transitions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,WAAW,EAAE,WAAW,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,GACnD,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC,EAAE,CAUtE"}
@@ -0,0 +1,8 @@
1
+ import { GetTransitionConfig } from '../types';
2
+ export type PendingTransition = {
3
+ from?: string;
4
+ to?: string;
5
+ outResolve?: (transition: GetTransitionConfig) => void;
6
+ inResolve?: (transition: GetTransitionConfig) => void;
7
+ };
8
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/lib/ssgoi-transition/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,CAAC,UAAU,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACvD,SAAS,CAAC,EAAE,CAAC,UAAU,EAAE,mBAAmB,KAAK,IAAI,CAAC;CACvD,CAAC"}
@@ -1,4 +1,4 @@
1
- import { Transition, TransitionCallback } from './types';
1
+ import { Transition, TransitionCallback } from '../types';
2
2
  import { StrategyContext, TransitionStrategy } from './transition-strategy';
3
3
  export declare function createTransitionCallback<TAnimationValue = number>(getTransition: () => Transition<undefined, TAnimationValue>, options?: {
4
4
  onCleanupEnd?: () => void;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-transition-callback.d.ts","sourceRoot":"","sources":["../../src/lib/transition/create-transition-callback.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,kBAAkB,EAEnB,MAAM,UAAU,CAAC;AAIlB,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,kBAAkB,EAExB,MAAM,uBAAuB,CAAC;AAE/B,wBAAgB,wBAAwB,CAAC,eAAe,GAAG,MAAM,EAC/D,aAAa,EAAE,MAAM,UAAU,CAAC,SAAS,EAAE,eAAe,CAAC,EAC3D,OAAO,CAAC,EAAE;IACR,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,CACT,OAAO,EAAE,eAAe,CAAC,eAAe,CAAC,KACtC,kBAAkB,CAAC,eAAe,CAAC,CAAC;CAC1C,GACA,kBAAkB,CAuRpB"}
@@ -1,4 +1,4 @@
1
- import { TransitionConfig, AnimationController } from './types';
1
+ import { TransitionConfig, AnimationController } from '../types';
2
2
  export declare const TRANSITION_STRATEGY: unique symbol;
3
3
  export interface StrategyContext<TAnimationValue = number> {
4
4
  currentAnimation: {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transition-strategy.d.ts","sourceRoot":"","sources":["../../src/lib/transition/transition-strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,mBAAmB,EAEpB,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,mBAAmB,eAAoC,CAAC;AAErE,MAAM,WAAW,eAAe,CAAC,eAAe,GAAG,MAAM;IAGvD,gBAAgB,EAAE;QAChB,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;QACjD,SAAS,EAAE,IAAI,GAAG,KAAK,CAAC;KACzB,GAAG,IAAI,CAAC;CACV;AAED,MAAM,WAAW,cAAc,CAAC,eAAe,GAAG,MAAM;IACtD,MAAM,CAAC,EAAE,gBAAgB,CAAC,eAAe,CAAC,CAAC;IAC3C,KAAK,EAAE;QACL,QAAQ,EAAE,eAAe,CAAC;QAC1B,QAAQ,EAAE,eAAe,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAC5E,CAAC;IACF,IAAI,EAAE,eAAe,CAAC;IACtB,EAAE,EAAE,eAAe,CAAC;IACpB,SAAS,EAAE,SAAS,GAAG,UAAU,CAAC;CACnC;AAED,MAAM,WAAW,iBAAiB,CAAC,eAAe,GAAG,MAAM;IACzD,EAAE,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC,CAAC;IAChD,GAAG,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC,CAAC;CAClD;AAED,MAAM,WAAW,kBAAkB,CAAC,eAAe,GAAG,MAAM;IAC1D,KAAK,EAAE,CACL,OAAO,EAAE,iBAAiB,CAAC,eAAe,CAAC,KACxC,OAAO,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,CAAC;IAC9C,MAAM,EAAE,CACN,OAAO,EAAE,iBAAiB,CAAC,eAAe,CAAC,KACxC,OAAO,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,CAAC;CAC/C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,eAAO,MAAM,qBAAqB,GAAI,eAAe,GAAG,MAAM,EAC5D,SAAS,eAAe,CAAC,eAAe,CAAC,KACxC,kBAAkB,CAAC,eAAe,CAiMpC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,4BAA4B,GACvC,eAAe,GAAG,MAAM,OACrB,kBAAkB,CAAC,eAAe,CAoGtC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { StrategyContext, TRANSITION_STRATEGY, TransitionStrategy } from './transition-strategy';
2
- import { TransitionCallback, TransitionOptions, TransitionKey } from './types';
2
+ import { TransitionCallback, TransitionOptions, TransitionKey } from '../types';
3
3
  export declare function generateAutoKey(): TransitionKey;
4
4
  /**
5
5
  * Framework-agnostic transition function that can be used as a ref
@@ -0,0 +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,EAClB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAiE9C,wBAAgB,eAAe,IAAI,aAAa,CAY/C;AAoBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,wBAAgB,UAAU,CAAC,eAAe,GAAG,MAAM,EACjD,OAAO,EAAE,iBAAiB,CAAC,SAAS,EAAE,eAAe,CAAC,GAAG;IACvD,CAAC,mBAAmB,CAAC,CAAC,EAAE,CACtB,OAAO,EAAE,eAAe,CAAC,eAAe,CAAC,KACtC,kBAAkB,CAAC,eAAe,CAAC,CAAC;CAC1C,GACA,kBAAkB,CAoBpB"}
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("../jaemin-DL1-g_B5.cjs"),B=t=>new Promise(e=>setTimeout(e,t)),M={stiffness:80,damping:25},G={stiffness:75,damping:25},V=300,j=10,q="horizontal",K="#000000",Z=(t={})=>{const{inSpring:e=G,outSpring:r=M,transitionDelay:c=V,blindCount:s=j,direction:o=q,staggerDelay:l=100,blindColor:n=K}=t;let i,d=null;const a=(p,g,y="left")=>{window.getComputedStyle(p).position==="static"&&(p.style.position="relative");const h=document.createElement("div");h.className="blind-container",h.style.cssText=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("../jaemin-DL1-g_B5.cjs"),M=t=>new Promise(e=>setTimeout(e,t)),q={stiffness:80,damping:25},N={stiffness:75,damping:25},G=300,V=10,j="horizontal",K="#000000",Z=(t={})=>{const{inSpring:e=N,outSpring:s=q,transitionDelay:d=G,blindCount:r=V,direction:i=j,staggerDelay:o=100,blindColor:n=K}=t;let a,c=null;const l=(p,g,u="left")=>{window.getComputedStyle(p).position==="static"&&(p.style.position="relative");const h=document.createElement("div");h.className="blind-container",h.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 f=[];for(let $=0;$<s;$++){const m=document.createElement("div");if(o==="horizontal"){const x=100/s,T=`calc(${x}% + 1px)`;m.style.cssText=`
10
+ `;const f=[];for(let $=0;$<r;$++){const x=document.createElement("div");if(i==="horizontal"){const m=100/r,T=`calc(${m}% + 1px)`;x.style.cssText=`
11
11
  position: absolute;
12
- top: ${x*$}%;
12
+ top: ${m*$}%;
13
13
  left: 0;
14
14
  width: 100%;
15
15
  height: ${T};
16
16
  background: ${n};
17
17
  transform: scaleX(${g==="hidden"?0:1});
18
- transform-origin: ${y} center;
18
+ transform-origin: ${u} center;
19
19
  will-change: transform;
20
- `}else{const x=100/s,T=`calc(${x}% + 1px)`;m.style.cssText=`
20
+ `}else{const m=100/r,T=`calc(${m}% + 1px)`;x.style.cssText=`
21
21
  position: absolute;
22
22
  top: 0;
23
- left: ${x*$}%;
23
+ left: ${m*$}%;
24
24
  width: ${T};
25
25
  height: 100%;
26
26
  background: ${n};
27
27
  transform: scaleY(${g==="hidden"?0:1});
28
- transform-origin: ${y==="left"?"top":"bottom"} center;
28
+ transform-origin: ${u==="left"?"top":"bottom"} center;
29
29
  will-change: transform;
30
- `}f.push(m),h.appendChild(m)}return p.appendChild(h),{container:h,blinds:f}};return{out:()=>{let p=null;return i=new Promise(y=>{d=y}),{springs:Array.from({length:s},(y,u)=>({from:0,to:1,spring:r,offset:u*l,tick:h=>{if(!p)return;const f=p.blinds[u];f&&(o==="horizontal"?f.style.transform=`scaleX(${h})`:f.style.transform=`scaleY(${h})`)}})),schedule:"chain",prepare:y=>{b.prepareOutgoing(y),y.style.zIndex="1000",p=a(y,"hidden","left")},onStart:()=>{},onEnd:()=>{d&&d()}}},in:()=>{let p=null;return{springs:Array.from({length:s},(y,u)=>({from:1,to:0,spring:e,offset:u*l,tick:h=>{if(!p)return;const f=p.blinds[u];f&&(o==="horizontal"?f.style.transform=`scaleX(${h})`:f.style.transform=`scaleY(${h})`)}})),schedule:"chain",prepare:y=>{y.style.position="relative",y.style.zIndex="0",p=a(y,"closed","right")},onStart:()=>{},wait:async()=>{i&&await i,await B(c)},onEnd:()=>{p&&p.container&&p.container.remove()}}}}},J=(t={})=>{var s,o;const{opacity:e=!1,direction:r="enter"}=t,c={stiffness:((s=t.spring)==null?void 0:s.stiffness)??150,damping:((o=t.spring)==null?void 0:o.damping)??20};return r==="enter"?{in:l=>({spring:c,tick:n=>{l.style.transform=`translateX(${(1-n)*100}%)`,e&&(l.style.opacity=n.toString())}}),out:(l,n)=>({spring:c,prepare:i=>{b.prepareOutgoing(i,n),i.style.zIndex="-1"},tick:i=>{l.style.transform=`translateX(${-(1-i)*20}%)`,e&&(l.style.opacity=i.toString())}})}:{in:l=>({spring:{stiffness:100,damping:20},tick:n=>{l.style.transform=`translateX(${-(1-n)*20}%)`,e&&(l.style.opacity=n.toString())}}),out:(l,n)=>({spring:{stiffness:100,damping:20},prepare:i=>{b.prepareOutgoing(i,n),i.style.zIndex="100"},tick:i=>{l.style.transform=`translateX(${(1-i)*100}%)`,e&&(l.style.opacity=i.toString())}})}},Q=t=>new Promise(e=>setTimeout(e,t)),R={stiffness:7,damping:4},tt={stiffness:8,damping:4},et=0,nt=(t={})=>{const{inSpring:e=tt,outSpring:r=R,transitionDelay:c=et}=t;let s,o=null;return{in:l=>({spring:e,prepare:n=>{n.style.opacity="0",n.style.willChange="opacity"},wait:async()=>{s&&(await s,await Q(c))},tick:n=>{l.style.opacity=n.toString()}}),out:(l,n)=>(s=new Promise(i=>{o=i}),{spring:r,tick:i=>{l.style.opacity=i.toString()},prepare:i=>{b.prepareOutgoing(i,n),i.style.willChange="opacity"},onEnd:()=>{o&&o()}})}},it={stiffness:5,damping:3.5},st=.8,rt="white",w={start:0,end:.45},E={start:.85,end:1},L={start:.2,end:.9},ot=t=>{var s;const e=(t==null?void 0:t.spring)??it,r=(t==null?void 0:t.scale)??st,c=((s=t==null?void 0:t.border)==null?void 0:s.color)??rt;return{out:async(o,l)=>{const n=P(l),i=b.getRect(document.body,l.positionedParent),d=at(c,{...n,top:i.top});let a=1,p=-n.top;return{spring:e,prepare:()=>{b.prepareOutgoing(o),k(o,n),I(o,n),dt(o,n);for(const g of d)l.positionedParent.appendChild(g)},onEnd:()=>{o.style.clipPath="",o.style.transformOrigin="",setTimeout(()=>{for(const g of d)l.positionedParent.removeChild(g)},1e3)},tick:g=>{const y=1-g;if(w.start<=y&&y<=w.end){const f=A(y,w.start,w.end);a=1-(1-r)*f}if(E.start<=y&&y<=E.end){const f=A(y,E.start,E.end);a=r+(1-r)*f}if(L.start<=y&&y<=L.end){const f=A(y,L.start,L.end);p=-n.top-n.height*f}o.style.transform=`translateY(${p}px) scale(${a})`;const u=(n.width-n.width*a)/2,h=(n.height-n.height*a)/2;lt(d,u,h)}}},in:async(o,l)=>{const n=P(l);let i=r,d=-n.top+n.height;return{spring:e,prepare:()=>{k(o,n),I(o,n),o.style.transform=`translateY(${-n.top+n.height}px) scale(${r})`},onEnd:()=>{o.style.clipPath="",o.style.transformOrigin="",o.style.transform=""},tick:a=>{if(w.start<=a&&a<=w.end){const p=A(a,w.start,w.end);i=1-(1-r)*p}if(E.start<=a&&a<=E.end){const p=A(a,E.start,E.end);i=r+(1-r)*p}if(L.start<=a&&a<=L.end){const p=A(a,L.start,L.end);d=-n.top+n.height*(1-p)}o.style.transform=`translateY(${d}px) scale(${i})`}}}}};function lt(t,e,r){const c=e*.7,s=r*.7;t.topLeft.style.transform=`translate(${c}px, ${s}px)`,t.topRight.style.transform=`translate(${-c}px, ${s}px)`,t.bottomLeft.style.transform=`translate(${c}px, ${-s}px)`,t.bottomRight.style.transform=`translate(${-c}px, ${-s}px)`}function at(t="white",e){const s=document.createElement("div");s.style.position="fixed",s.style.pointerEvents="none",s.style.zIndex="9999",s.style.top=`${e.top-1}px`,s.style.left=`${e.left-1}px`,s.style.width="15px",s.style.height="15px";const o=document.createElement("div");o.style.position="absolute",o.style.width="15px",o.style.height="1px",o.style.backgroundColor=t,o.style.top="0",o.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",s.appendChild(o),s.appendChild(l);const n=document.createElement("div");n.style.position="fixed",n.style.pointerEvents="none",n.style.zIndex="9999",n.style.top=`${e.top-1}px`,n.style.left=`${e.left+e.width-15+1}px`,n.style.width="15px",n.style.height="15px";const i=document.createElement("div");i.style.position="absolute",i.style.width="15px",i.style.height="1px",i.style.backgroundColor=t,i.style.top="0",i.style.right="0";const d=document.createElement("div");d.style.position="absolute",d.style.width="1px",d.style.height="15px",d.style.backgroundColor=t,d.style.top="0",d.style.right="0",n.appendChild(i),n.appendChild(d);const a=document.createElement("div");a.style.position="fixed",a.style.pointerEvents="none",a.style.zIndex="9999",a.style.top=`${e.top+e.height-15+1}px`,a.style.left=`${e.left-1}px`,a.style.width="15px",a.style.height="15px";const p=document.createElement("div");p.style.position="absolute",p.style.width="15px",p.style.height="1px",p.style.backgroundColor=t,p.style.bottom="0",p.style.left="0";const g=document.createElement("div");g.style.position="absolute",g.style.width="1px",g.style.height="15px",g.style.backgroundColor=t,g.style.bottom="0",g.style.left="0",a.appendChild(p),a.appendChild(g);const y=document.createElement("div");y.style.position="fixed",y.style.pointerEvents="none",y.style.zIndex="9999",y.style.top=`${e.top+e.height-15+1}px`,y.style.left=`${e.left+e.width-15+1}px`,y.style.width="15px",y.style.height="15px";const u=document.createElement("div");u.style.position="absolute",u.style.width="15px",u.style.height="1px",u.style.backgroundColor=t,u.style.bottom="0",u.style.right="0";const h=document.createElement("div");return h.style.position="absolute",h.style.width="1px",h.style.height="15px",h.style.backgroundColor=t,h.style.bottom="0",h.style.right="0",y.appendChild(u),y.appendChild(h),{topLeft:s,topRight:n,bottomLeft:a,bottomRight:y,*[Symbol.iterator](){yield s,yield n,yield a,yield y}}}function P(t){const e=b.getRect(document.body,t.positionedParent);return{top:t.scroll.y,left:0,width:e.width,height:window.innerHeight-e.top}}function k(t,e){const r=e.left+e.width/2,c=e.top+e.height/2;t.style.transformOrigin=`${r}px ${c}px`}function I(t,e){t.style.clipPath=`polygon(
30
+ `}f.push(x),h.appendChild(x)}return p.appendChild(h),{container:h,blinds:f}};return{out:()=>{let p=null;return a=new Promise(u=>{c=u}),{springs:Array.from({length:r},(u,y)=>({from:0,to:1,spring:s,offset:y*o,tick:h=>{if(!p)return;const f=p.blinds[y];f&&(i==="horizontal"?f.style.transform=`scaleX(${h})`:f.style.transform=`scaleY(${h})`)}})),schedule:"chain",prepare:u=>{w.prepareOutgoing(u),u.style.zIndex="1000",p=l(u,"hidden","left")},onStart:()=>{},onEnd:()=>{c&&c()}}},in:()=>{let p=null;return{springs:Array.from({length:r},(u,y)=>({from:1,to:0,spring:e,offset:y*o,tick:h=>{if(!p)return;const f=p.blinds[y];f&&(i==="horizontal"?f.style.transform=`scaleX(${h})`:f.style.transform=`scaleY(${h})`)}})),schedule:"chain",prepare:u=>{u.style.position="relative",u.style.zIndex="0",p=l(u,"closed","right")},onStart:()=>{},wait:async()=>{a&&await a,await M(d)},onEnd:()=>{p&&p.container&&p.container.remove()}}}}},J=(t={})=>{var r,i;const{opacity:e=!1,direction:s="enter"}=t,d={stiffness:((r=t.spring)==null?void 0:r.stiffness)??150,damping:((i=t.spring)==null?void 0:i.damping)??20};return s==="enter"?{in:o=>({spring:d,tick:n=>{o.style.transform=`translateX(${(1-n)*100}%)`,e&&(o.style.opacity=n.toString())}}),out:(o,n)=>({spring:d,prepare:a=>{w.prepareOutgoing(a,n),a.style.zIndex="-1"},tick:a=>{o.style.transform=`translateX(${-(1-a)*20}%)`,e&&(o.style.opacity=a.toString())}})}:{in:o=>({spring:{stiffness:100,damping:20},tick:n=>{o.style.transform=`translateX(${-(1-n)*20}%)`,e&&(o.style.opacity=n.toString())}}),out:(o,n)=>({spring:{stiffness:100,damping:20},prepare:a=>{w.prepareOutgoing(a,n),a.style.zIndex="100"},tick:a=>{o.style.transform=`translateX(${(1-a)*100}%)`,e&&(o.style.opacity=a.toString())}})}},Q=t=>new Promise(e=>setTimeout(e,t)),R={stiffness:65,damping:16},tt={stiffness:65,damping:14},et=0,nt=(t={})=>{const{inSpring:e=tt,outSpring:s=R,transitionDelay:d=et}=t;let r,i=null;return{in:o=>({spring:e,prepare:n=>{n.style.opacity="0",n.style.willChange="opacity"},wait:async()=>{r&&(await r,await Q(d))},tick:n=>{o.style.opacity=n.toString()}}),out:(o,n)=>(r=new Promise(a=>{i=a}),{spring:s,tick:a=>{o.style.opacity=a.toString()},prepare:()=>{w.prepareOutgoing(o,n),o.style.willChange="opacity"},onEnd:()=>{i&&i()}})}},it={stiffness:5,damping:3.5},st=.8,rt="white",b={start:0,end:.45},E={start:.85,end:1},A={start:.2,end:.9},lt=t=>{var r;const e=(t==null?void 0:t.spring)??it,s=(t==null?void 0:t.scale)??st,d=((r=t==null?void 0:t.border)==null?void 0:r.color)??rt;return{out:async(i,o)=>{const n=P(o),a=w.getRect(document.body,o.positionedParent),c=ot(d,{...n,top:a.top});let l=1,p=-n.top;return{spring:e,prepare:()=>{w.prepareOutgoing(i),_(i,n),I(i,n),dt(i,n);for(const g of c)o.positionedParent.appendChild(g)},onEnd:()=>{i.style.clipPath="",i.style.transformOrigin="",setTimeout(()=>{for(const g of c)o.positionedParent.removeChild(g)},1e3)},tick:g=>{const u=1-g;if(b.start<=u&&u<=b.end){const f=L(u,b.start,b.end);l=1-(1-s)*f}if(E.start<=u&&u<=E.end){const f=L(u,E.start,E.end);l=s+(1-s)*f}if(A.start<=u&&u<=A.end){const f=L(u,A.start,A.end);p=-n.top-n.height*f}i.style.transform=`translateY(${p}px) scale(${l})`;const y=(n.width-n.width*l)/2,h=(n.height-n.height*l)/2;at(c,y,h)}}},in:async(i,o)=>{const n=P(o);let a=s,c=-n.top+n.height;return{spring:e,prepare:()=>{_(i,n),I(i,n),i.style.transform=`translateY(${-n.top+n.height}px) scale(${s})`},onEnd:()=>{i.style.clipPath="",i.style.transformOrigin="",i.style.transform=""},tick:l=>{if(b.start<=l&&l<=b.end){const p=L(l,b.start,b.end);a=1-(1-s)*p}if(E.start<=l&&l<=E.end){const p=L(l,E.start,E.end);a=s+(1-s)*p}if(A.start<=l&&l<=A.end){const p=L(l,A.start,A.end);c=-n.top+n.height*(1-p)}i.style.transform=`translateY(${c}px) scale(${a})`}}}}};function at(t,e,s){const d=e*.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",e){const r=document.createElement("div");r.style.position="fixed",r.style.pointerEvents="none",r.style.zIndex="9999",r.style.top=`${e.top-1}px`,r.style.left=`${e.left-1}px`,r.style.width="15px",r.style.height="15px";const i=document.createElement("div");i.style.position="absolute",i.style.width="15px",i.style.height="1px",i.style.backgroundColor=t,i.style.top="0",i.style.left="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.left="0",r.appendChild(i),r.appendChild(o);const n=document.createElement("div");n.style.position="fixed",n.style.pointerEvents="none",n.style.zIndex="9999",n.style.top=`${e.top-1}px`,n.style.left=`${e.left+e.width-15+1}px`,n.style.width="15px",n.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.right="0";const c=document.createElement("div");c.style.position="absolute",c.style.width="1px",c.style.height="15px",c.style.backgroundColor=t,c.style.top="0",c.style.right="0",n.appendChild(a),n.appendChild(c);const l=document.createElement("div");l.style.position="fixed",l.style.pointerEvents="none",l.style.zIndex="9999",l.style.top=`${e.top+e.height-15+1}px`,l.style.left=`${e.left-1}px`,l.style.width="15px",l.style.height="15px";const p=document.createElement("div");p.style.position="absolute",p.style.width="15px",p.style.height="1px",p.style.backgroundColor=t,p.style.bottom="0",p.style.left="0";const g=document.createElement("div");g.style.position="absolute",g.style.width="1px",g.style.height="15px",g.style.backgroundColor=t,g.style.bottom="0",g.style.left="0",l.appendChild(p),l.appendChild(g);const u=document.createElement("div");u.style.position="fixed",u.style.pointerEvents="none",u.style.zIndex="9999",u.style.top=`${e.top+e.height-15+1}px`,u.style.left=`${e.left+e.width-15+1}px`,u.style.width="15px",u.style.height="15px";const y=document.createElement("div");y.style.position="absolute",y.style.width="15px",y.style.height="1px",y.style.backgroundColor=t,y.style.bottom="0",y.style.right="0";const h=document.createElement("div");return h.style.position="absolute",h.style.width="1px",h.style.height="15px",h.style.backgroundColor=t,h.style.bottom="0",h.style.right="0",u.appendChild(y),u.appendChild(h),{topLeft:r,topRight:n,bottomLeft:l,bottomRight:u,*[Symbol.iterator](){yield r,yield n,yield l,yield u}}}function P(t){const e=w.getRect(document.body,t.positionedParent);return{top:t.scroll.y,left:0,width:e.width,height:window.innerHeight-e.top}}function _(t,e){const s=e.left+e.width/2,d=e.top+e.height/2;t.style.transformOrigin=`${s}px ${d}px`}function I(t,e){t.style.clipPath=`polygon(
31
31
  ${e.left}px ${e.top}px,
32
32
  ${e.left+e.width}px ${e.top}px,
33
33
  ${e.left+e.width}px ${e.top+e.height}px,
34
34
  ${e.left}px ${e.top+e.height}px
35
- )`}function dt(t,e){t.style.transform=`translateY(${-e.top}px)`}function A(t,e,r){return t<=e?0:t>=r?1:(t-e)/(r-e)}function ct(t,e){return t.querySelector(`[data-hero-key="${e}"]`)}const pt=(t={})=>{var l,n;const e={stiffness:((l=t.spring)==null?void 0:l.stiffness)??300,damping:((n=t.spring)==null?void 0:n.damping)??30},r=t.timeout??300,c=t.maxDistance??700;let s=null,o=null;return{in:async(i,d)=>{const a=i,p=Array.from(a.querySelectorAll("[data-hero-key]"));if(p.length===0)return{spring:e,tick:()=>{}};if(!await new Promise(u=>{s?u(!0):(o=u,setTimeout(()=>{o=null,u(!1)},r))})||!s)return s=null,{spring:e,tick:()=>{}};const y=p.map(u=>{const h=u.getAttribute("data-hero-key");if(!h)return null;const f=ct(s,h);if(!f)return null;const $=u,m=b.getRect(s,f),x=b.getRect(a,$),T=m.left-x.left-d.scrollOffset.x,Y=m.top-x.top-d.scrollOffset.y,U=m.width/x.width,W=m.height/x.height,X=$.style.transform,N=$.style.position,z=$.style.transformOrigin,H=$.style.zIndex;return{toEl:$,dx:T,dy:Y,dw:U,dh:W,originalTransform:X,originalPosition:N,originalTransformOrigin:z,originalZIndex:H}}).filter(u=>u!==null&&Math.abs(u.dy)<=c);return s=null,y.length===0?{spring:e,tick:()=>{}}:{spring:e,prepare:()=>{y.forEach(({toEl:u})=>{u.style.position="relative",u.style.transformOrigin="top left",u.style.zIndex="1000"})},tick:u=>{y.forEach(({toEl:h,dx:f,dy:$,dw:m,dh:x})=>{h.style.transform=`translate(${(1-u)*f}px,${(1-u)*$}px) scale(${u+(1-u)*m}, ${u+(1-u)*x})`})},onEnd:()=>{y.forEach(({toEl:u,originalTransform:h,originalPosition:f,originalTransformOrigin:$,originalZIndex:m})=>{u.style.transform=h,u.style.position=f,u.style.transformOrigin=$,u.style.zIndex=m})}}},out:async i=>({onStart:()=>{s=i,o&&(o(!0),o=null)},prepare:d=>{b.prepareOutgoing(d),d.style.opacity="0"}})}};function ht({detailRect:t,galleryRect:e,pageRect:r,scrollOffset:c},s){const o=e.left-t.left+(e.width-t.width)/2-c.x,l=e.top-t.top+(e.height-t.height)/2-c.y,n=e.width/t.width,i=e.height/t.height,d=Math.max(n,i),a=t.top/r.height*100,p=(r.width-(t.left+t.width))/r.width*100,g=(r.height-(t.top+t.height))/r.height*100,y=t.left/r.width*100;return s.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,u=>{const h=1-u,f=a*h,$=p*h,m=g*h,x=y*h;s.style.clipPath=`inset(${f}% ${$}% ${m}% ${x}%)`,s.style.transform=`translate(${o*h}px, ${l*h}px) scale(${1+(d-1)*h})`}}function yt({galleryRect:t,detailRect:e,scrollOffset:r},c){const s=e.left-t.left+(e.width-t.width)/2+r.x,o=e.top-t.top+(e.height-t.height)/2+r.y,l=e.width/t.width,n=e.height/t.height,i=Math.max(l,n);return d=>{c.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`;const a=1-d;c.style.transform=`translate(${s*a-r.x}px, ${o*a-r.y}px) scale(${1+(i-1)*a})`,c.style.opacity=`${1-a}`}}function ut({galleryRect:t,detailRect:e,scrollOffset:r},c){const s=e.left-t.left+(e.width-t.width)/2-r.x,o=e.top-t.top+(e.height-t.height)/2-r.y,l=e.width/t.width,n=e.height/t.height,i=Math.max(l,n);return d=>{const a=1-d,p=d;c.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,c.style.transform=`translate(${s*a}px, ${o*a}px) scale(${1+(i-1)*a})`,c.style.opacity=`${p}`}}function gt({detailRect:t,galleryRect:e,pageRect:r,scrollOffset:c},s){const o=e.left-t.left+(e.width-t.width)/2+c.x,l=e.top-t.top+(e.height-t.height)/2+c.y,n=e.width/t.width,i=e.height/t.height,d=Math.min(n,i),a=t.top/r.height*100,p=(r.width-(t.left+t.width))/r.width*100,g=(r.height-(t.top+t.height))/r.height*100,y=t.left/r.width*100;return s.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,u=>{const h=1-u,f=a*h,$=p*h,m=g*h,x=y*h;s.style.clipPath=`inset(${f}% ${$}% ${m}% ${x}%)`,s.style.transform=`translate(${o*h-c.x}px, ${l*h-c.y}px) scale(${1+(d-1)*h})`}}function ft(t,e,r){const c=t.querySelector("[data-pinterest-detail-key]"),s=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 o=null,l=null,n=!1;if(!c&&s){l=s;const p=l.getAttribute("data-pinterest-detail-key");if(!p)return null;o=t.querySelector(`[data-pinterest-gallery-key="${p}"]`),o&&(n=!0)}else if(c&&!s){l=c;const p=l.getAttribute("data-pinterest-detail-key");if(!p)return null;o=e.querySelector(`[data-pinterest-gallery-key="${p}"]`),o&&(n=!1)}if(!o||!l)return null;const i=b.getRect(n?t:e,o),d=b.getRect(n?e:t,l),a=e.getBoundingClientRect();return n?{inAnimation:ht({detailRect:d,galleryRect:i,pageRect:a,scrollOffset:r},e),outAnimation:yt({galleryRect:i,detailRect:d,scrollOffset:r},t)}:{inAnimation:ut({galleryRect:i,detailRect:d,scrollOffset:r},e),outAnimation:gt({detailRect:d,galleryRect:i,pageRect:a,scrollOffset:r},t)}}const $t=(t={})=>{var l,n;const e={stiffness:((l=t.spring)==null?void 0:l.stiffness)??30,damping:((n=t.spring)==null?void 0:n.damping)??10},r=t.timeout??300;let c=null,s=null,o=null;return{in:async(i,{scrollOffset:d})=>{const a=i;return!await new Promise(g=>{c?g(!0):(s=g,setTimeout(()=>{s=null,g(!1)},r))})||!c?(c=null,{spring:e,tick:()=>{}}):(o=ft(c,a,d),o?(c=null,{spring:e,tick:g=>{o&&o.inAnimation(g)}}):{spring:e,tick:()=>{}})},out:async i=>({spring:e,onStart:()=>{c=i,s&&(s(!0),s=null)},prepare:d=>{b.prepareOutgoing(d),d.style.zIndex="-1"},tick:d=>{o&&o.outAnimation(d)}})}},O={stiffness:5,damping:4},mt=(t={})=>{var i,d;const e=t.direction??"up",r={stiffness:((i=t.spring)==null?void 0:i.stiffness)??O.stiffness,damping:((d=t.spring)==null?void 0:d.damping)??O.damping},c=e==="up";let s=null,o=null,l=null;const n=()=>{if(s===null||o===null)return null;const a=Math.min(s,o),p=window.innerHeight;return Math.max(a,p)};return{in:a=>(o=a.offsetHeight,s!==null&&(l=n()),{spring:r,tick:p=>{if(l===null&&(l=n(),l===null))return;const g=c?(1-p)*l:(1-p)*-l;a.style.transform=`translateY(${g}px)`}}),out:a=>({spring:r,onStart:()=>{s=a.offsetHeight,o!==null&&(l=n())},tick:p=>{if(l===null&&(l=n(),l===null))return;const g=c?(1-p)*-l:(1-p)*l;a.style.transform=`translateY(${g}px)`},prepare:p=>{b.prepareOutgoing(p),p.style.zIndex=c?"-1":"1"}})}},D={stiffness:15,damping:7},xt=(t={})=>{var s,o;const e=t.direction??"left",r={stiffness:((s=t.spring)==null?void 0:s.stiffness)??D.stiffness,damping:((o=t.spring)==null?void 0:o.damping)??D.damping},c=e==="left";return{in:l=>({spring:r,tick:n=>{const i=c?(1-n)*100:(1-n)*-100;l.style.transform=`translateX(${i}%)`}}),out:(l,n)=>({spring:r,tick:i=>{const d=c?(1-i)*-100:(1-i)*100;l.style.transform=`translateX(${d}%)`},prepare:i=>{b.prepareOutgoing(i,n),i.style.zIndex=c?"-1":"1"}})}},v={stiffness:17,damping:6},_=20,C=800,bt=()=>{let t,e=null;return{in:r=>({spring:v,prepare:c=>{c.style.transform=`perspective(${C}px) rotateY(${_}deg) translateX(-100%)`},wait:async()=>{t&&await t},tick:c=>{const s=(1-c)*_,o=-(1-c)*100;r.style.transform=`perspective(${C}px) rotateY(${s}deg) translateX(${o}%)`},onEnd:()=>{r.style.transform=""}}),out:(r,c)=>(t=new Promise(s=>{e=s}),{spring:v,prepare:s=>{b.prepareOutgoing(s,c)},tick:s=>{const o=1-s,l=o*_,n=o*100;r.style.transform=`perspective(${C}px) rotateY(${-l}deg) translateX(${n}%)`},onEnd:()=>{e&&e(),r.style.transform=""}})}},wt={stiffness:1,damping:1},Et={stiffness:20,damping:25},Lt="#000000",At="circle",F="CURTAIN_REVEAL_OVERLAY_ID",Tt={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"},Ct={display:"inline-flex",alignItems:"center",justifyContent:"center",whiteSpace:"nowrap",fontSize:"5.5rem",fontWeight:"900",letterSpacing:"0.02em",color:"#FFFFFF"},Pt=.4,S=.5,kt=.2;function It(t,e){switch(t){case"circle":return`circle(${e*100}% at 50% 50%)`;case"square":return`inset(${(1-e)*50}% round ${10*e}%)`;case"triangle":{const r=e*100;return`polygon(50% ${50-r}%, ${50-r}% ${50+r}%, ${50+r}% ${50+r}%)`}}}const Ot=t=>t.reduce((e,r)=>e+r,0),Dt=(t={})=>{const{background:e=Lt,texts:r=[],shape:c=At,inSpring:s=Et,outSpring:o=wt,textStyle:l={}}=t;return{out:(n,i)=>{const d=n.style.opacity;return{spring:o,from:1,to:0,prepare:a=>{b.prepareOutgoing(a,i),a.style.opacity="1"},tick:a=>{const p=Math.max(0,a-Pt);n.style.opacity=String(p)},onEnd:()=>{n.style.opacity=d}}},in:n=>{let i=null,d=null,a=null;const p=document.body.style.overflow,g=document.getElementById(F);let y=[];const u=()=>{i=document.createElement("div"),i.id=F,Object.assign(i.style,Tt,{background:e}),document.body.appendChild(i),d=document.createElement("div"),Object.assign(d.style,St),i.appendChild(d),a=document.createElement("div"),Object.assign(a.style,_t),d.appendChild(a),r.forEach(h=>{const f=document.createElement("div");f.textContent=h,Object.assign(f.style,Ct,l),a.appendChild(f)}),y=Array.from(a.children).map(h=>h.getBoundingClientRect().width)};return{spring:s,from:0,to:1,prepare:()=>{document.body.style.overflow="hidden",n.style.opacity="1",g==null||g.remove(),u(),i&&d&&(i.style.clipPath="none",d.style.transform="scale(1)")},tick:h=>{if(!(!i||!d||!a)){if(h<=S&&r.length>0){const f=h/S,$=Math.min(Math.floor(f*r.length),r.length-1),m=y[$]??0,x=Ot(y.slice(0,$));d.style.width=`${m}px`,a.style.transform=`translateX(-${x}px)`}if(h>S){const $=1-Math.max(0,Math.min(1,(h-S)/kt));i.style.clipPath=It(c,$),d.style.transform=`scale(${$})`}}},onEnd:()=>{i==null||i.remove(),i=d=a=null,document.body.style.overflow=p}}}}};exports.jaemin=b.jaemin;exports.blind=Z;exports.curtainReveal=Dt;exports.drill=J;exports.fade=nt;exports.film=ot;exports.hero=pt;exports.pinterest=$t;exports.scroll=mt;exports.slide=xt;exports.strip=bt;
35
+ )`}function dt(t,e){t.style.transform=`translateY(${-e.top}px)`}function L(t,e,s){return t<=e?0:t>=s?1:(t-e)/(s-e)}function ct(t,e){return t.querySelector(`[data-hero-key="${e}"]`)}const ht=(t={})=>{var o,n;const e={stiffness:((o=t.spring)==null?void 0:o.stiffness)??300,damping:((n=t.spring)==null?void 0:n.damping)??30},s=t.timeout??300,d=t.maxDistance??700;let r=null,i=null;return{in:async(a,c)=>{const l=a,p=Array.from(l.querySelectorAll("[data-hero-key]"));if(p.length===0)return{spring:e,tick:()=>{}};if(!await new Promise(y=>{r?y(!0):(i=y,setTimeout(()=>{i=null,y(!1)},s))})||!r)return r=null,{spring:e,tick:()=>{}};const u=p.map(y=>{const h=y.getAttribute("data-hero-key");if(!h)return null;const f=ct(r,h);if(!f)return null;const $=y,x=w.getRect(r,f),m=w.getRect(l,$),T=x.left-m.left-c.scrollOffset.x,Y=x.top-m.top-c.scrollOffset.y,U=x.width/m.width,X=x.height/m.height,W=$.style.transform,z=$.style.position,B=$.style.transformOrigin,H=$.style.zIndex;return{toEl:$,dx:T,dy:Y,dw:U,dh:X,originalTransform:W,originalPosition:z,originalTransformOrigin:B,originalZIndex:H}}).filter(y=>y!==null&&Math.abs(y.dy)<=d);return r=null,u.length===0?{spring:e,tick:()=>{}}:{spring:e,prepare:()=>{u.forEach(({toEl:y})=>{y.style.position="relative",y.style.transformOrigin="top left",y.style.zIndex="1000"})},tick:y=>{u.forEach(({toEl:h,dx:f,dy:$,dw:x,dh:m})=>{h.style.transform=`translate(${(1-y)*f}px,${(1-y)*$}px) scale(${y+(1-y)*x}, ${y+(1-y)*m})`})},onEnd:()=>{u.forEach(({toEl:y,originalTransform:h,originalPosition:f,originalTransformOrigin:$,originalZIndex:x})=>{y.style.transform=h,y.style.position=f,y.style.transformOrigin=$,y.style.zIndex=x})}}},out:async a=>({onStart:()=>{r=a,i&&(i(!0),i=null)},prepare:c=>{w.prepareOutgoing(c),c.style.opacity="0"}})}};function pt({detailRect:t,galleryRect:e,pageRect:s,scrollOffset:d},r){const i=e.left-t.left+(e.width-t.width)/2-d.x,o=e.top-t.top+(e.height-t.height)/2-d.y,n=e.width/t.width,a=e.height/t.height,c=Math.max(n,a),l=t.top/s.height*100,p=(s.width-(t.left+t.width))/s.width*100,g=(s.height-(t.top+t.height))/s.height*100,u=t.left/s.width*100;return r.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,y=>{const h=1-y,f=l*h,$=p*h,x=g*h,m=u*h;r.style.clipPath=`inset(${f}% ${$}% ${x}% ${m}%)`,r.style.transform=`translate(${i*h}px, ${o*h}px) scale(${1+(c-1)*h})`}}function ut({detailRect:t,galleryRect:e,pageRect:s,scrollOffset:d},r){const i=e.left-t.left+(e.width-t.width)/2+d.x,o=e.top-t.top+(e.height-t.height)/2+d.y,n=e.width/t.width,a=e.height/t.height,c=Math.min(n,a),l=t.top/s.height*100,p=(s.width-(t.left+t.width))/s.width*100,g=(s.height-(t.top+t.height))/s.height*100,u=t.left/s.width*100;return r.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,y=>{const h=1-y,f=l*h,$=p*h,x=g*h,m=u*h;r.style.clipPath=`inset(${f}% ${$}% ${x}% ${m}%)`,r.style.transform=`translate(${i*h-d.x}px, ${o*h-d.y}px) scale(${1+(c-1)*h})`}}function yt(t,e,s){const d=t.querySelector("[data-instagram-detail-key]"),r=e.querySelector("[data-instagram-detail-key]");if(t.querySelectorAll("[data-instagram-detail-key]").length>1||e.querySelectorAll("[data-instagram-detail-key]").length>1)return null;let i=null,o=null,n=!1;if(!d&&r){o=r;const l=o.getAttribute("data-instagram-detail-key");if(!l)return null;i=t.querySelector(`[data-instagram-gallery-key="${l}"]`),i&&(n=!0)}else if(d&&!r){o=d;const l=o.getAttribute("data-instagram-detail-key");if(!l)return null;i=e.querySelector(`[data-instagram-gallery-key="${l}"]`),i&&(n=!1)}if(!i||!o)return null;const a=w.getRect(n?t:e,i),c=w.getRect(n?e:t,o);return n?{isEnterMode:!0,inAnimation:pt({detailRect:c,galleryRect:a,pageRect:e.getBoundingClientRect(),scrollOffset:s},e)}:{isEnterMode:!1,outAnimation:ut({detailRect:c,galleryRect:a,pageRect:t.getBoundingClientRect(),scrollOffset:s},t)}}const gt=(t={})=>{var o,n;const e={stiffness:((o=t.spring)==null?void 0:o.stiffness)??150,damping:((n=t.spring)==null?void 0:n.damping)??20},s=t.timeout??300;let d=null,r=null,i=null;return{in:async(a,{scrollOffset:c})=>{const l=a;return!await new Promise(g=>{d?g(!0):(r=g,setTimeout(()=>{r=null,g(!1)},s))})||!d?(d=null,{spring:e,tick:()=>{}}):(i=yt(d,l,c),i?(d=null,{spring:e,tick:g=>{i!=null&&i.inAnimation&&i.inAnimation(g)}}):{spring:e,tick:()=>{}})},out:async(a,c)=>({spring:e,onStart:()=>{d=a,r&&(r(!0),r=null)},prepare:l=>{w.prepareOutgoing(l,c),i!=null&&i.isEnterMode||(l.style.zIndex="-1")},tick:l=>{i!=null&&i.outAnimation&&i.outAnimation(l)}})}};function ft({detailRect:t,galleryRect:e,pageRect:s,scrollOffset:d},r){const i=e.left-t.left+(e.width-t.width)/2-d.x,o=e.top-t.top+(e.height-t.height)/2-d.y,n=e.width/t.width,a=e.height/t.height,c=Math.max(n,a),l=t.top/s.height*100,p=(s.width-(t.left+t.width))/s.width*100,g=(s.height-(t.top+t.height))/s.height*100,u=t.left/s.width*100;return r.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,y=>{const h=1-y,f=l*h,$=p*h,x=g*h,m=u*h;r.style.clipPath=`inset(${f}% ${$}% ${x}% ${m}%)`,r.style.transform=`translate(${i*h}px, ${o*h}px) scale(${1+(c-1)*h})`}}function $t({galleryRect:t,detailRect:e,scrollOffset:s},d){const r=e.left-t.left+(e.width-t.width)/2+s.x,i=e.top-t.top+(e.height-t.height)/2+s.y,o=e.width/t.width,n=e.height/t.height,a=Math.max(o,n);return c=>{d.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`;const l=1-c;d.style.transform=`translate(${r*l-s.x}px, ${i*l-s.y}px) scale(${1+(a-1)*l})`,d.style.opacity=`${1-l}`}}function xt({galleryRect:t,detailRect:e,scrollOffset:s},d){const r=e.left-t.left+(e.width-t.width)/2-s.x,i=e.top-t.top+(e.height-t.height)/2-s.y,o=e.width/t.width,n=e.height/t.height,a=Math.max(o,n);return c=>{const l=1-c,p=c;d.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,d.style.transform=`translate(${r*l}px, ${i*l}px) scale(${1+(a-1)*l})`,d.style.opacity=`${p}`}}function mt({detailRect:t,galleryRect:e,pageRect:s,scrollOffset:d},r){const i=e.left-t.left+(e.width-t.width)/2+d.x,o=e.top-t.top+(e.height-t.height)/2+d.y,n=e.width/t.width,a=e.height/t.height,c=Math.min(n,a),l=t.top/s.height*100,p=(s.width-(t.left+t.width))/s.width*100,g=(s.height-(t.top+t.height))/s.height*100,u=t.left/s.width*100;return r.style.transformOrigin=`${t.left+t.width/2}px ${t.top+t.height/2}px`,y=>{const h=1-y,f=l*h,$=p*h,x=g*h,m=u*h;r.style.clipPath=`inset(${f}% ${$}% ${x}% ${m}%)`,r.style.transform=`translate(${i*h-d.x}px, ${o*h-d.y}px) scale(${1+(c-1)*h})`}}function wt(t,e,s){const d=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 i=null,o=null,n=!1;if(!d&&r){o=r;const l=o.getAttribute("data-pinterest-detail-key");if(!l)return null;i=t.querySelector(`[data-pinterest-gallery-key="${l}"]`),i&&(n=!0)}else if(d&&!r){o=d;const l=o.getAttribute("data-pinterest-detail-key");if(!l)return null;i=e.querySelector(`[data-pinterest-gallery-key="${l}"]`),i&&(n=!1)}if(!i||!o)return null;const a=w.getRect(n?t:e,i),c=w.getRect(n?e:t,o);return n?{inAnimation:ft({detailRect:c,galleryRect:a,pageRect:e.getBoundingClientRect(),scrollOffset:s},e),outAnimation:$t({galleryRect:a,detailRect:c,scrollOffset:s},t)}:{inAnimation:xt({galleryRect:a,detailRect:c,scrollOffset:s},e),outAnimation:mt({detailRect:c,galleryRect:a,pageRect:t.getBoundingClientRect(),scrollOffset:s},t)}}const bt=(t={})=>{var o,n;const e={stiffness:((o=t.spring)==null?void 0:o.stiffness)??30,damping:((n=t.spring)==null?void 0:n.damping)??10},s=t.timeout??300;let d=null,r=null,i=null;return{in:async(a,{scrollOffset:c})=>{const l=a;return!await new Promise(g=>{d?g(!0):(r=g,setTimeout(()=>{r=null,g(!1)},s))})||!d?(d=null,{spring:e,tick:()=>{}}):(i=wt(d,l,c),i?(d=null,{spring:e,tick:g=>{i&&i.inAnimation(g)}}):{spring:e,tick:()=>{}})},out:async a=>({spring:e,onStart:()=>{d=a,r&&(r(!0),r=null)},prepare:c=>{w.prepareOutgoing(c),c.style.zIndex="-1"},tick:c=>{i&&i.outAnimation(c)}})}},D={stiffness:5,damping:4},Et=(t={})=>{var a,c;const e=t.direction??"up",s={stiffness:((a=t.spring)==null?void 0:a.stiffness)??D.stiffness,damping:((c=t.spring)==null?void 0:c.damping)??D.damping},d=e==="up";let r=null,i=null,o=null;const n=()=>{if(r===null||i===null)return null;const l=Math.min(r,i),p=window.innerHeight;return Math.max(l,p)};return{in:l=>(i=l.offsetHeight,r!==null&&(o=n()),{spring:s,tick:p=>{if(o===null&&(o=n(),o===null))return;const g=d?(1-p)*o:(1-p)*-o;l.style.transform=`translateY(${g}px)`}}),out:l=>({spring:s,onStart:()=>{r=l.offsetHeight,i!==null&&(o=n())},tick:p=>{if(o===null&&(o=n(),o===null))return;const g=d?(1-p)*-o:(1-p)*o;l.style.transform=`translateY(${g}px)`},prepare:p=>{w.prepareOutgoing(p),p.style.zIndex=d?"-1":"1"}})}},O={stiffness:15,damping:7},At=(t={})=>{var r,i;const e=t.direction??"left",s={stiffness:((r=t.spring)==null?void 0:r.stiffness)??O.stiffness,damping:((i=t.spring)==null?void 0:i.damping)??O.damping},d=e==="left";return{in:o=>({spring:s,tick:n=>{const a=d?(1-n)*100:(1-n)*-100;o.style.transform=`translateX(${a}%)`}}),out:(o,n)=>({spring:s,tick:a=>{const c=d?(1-a)*-100:(1-a)*100;o.style.transform=`translateX(${c}%)`},prepare:a=>{w.prepareOutgoing(a,n),a.style.zIndex=d?"-1":"1"}})}},v={stiffness:17,damping:6},k=20,C=800,Lt=()=>{let t,e=null;return{in:s=>({spring:v,prepare:d=>{d.style.transform=`perspective(${C}px) rotateY(${k}deg) translateX(-100%)`},wait:async()=>{t&&await t},tick:d=>{const r=(1-d)*k,i=-(1-d)*100;s.style.transform=`perspective(${C}px) rotateY(${r}deg) translateX(${i}%)`},onEnd:()=>{s.style.transform=""}}),out:(s,d)=>(t=new Promise(r=>{e=r}),{spring:v,prepare:r=>{w.prepareOutgoing(r,d)},tick:r=>{const i=1-r,o=i*k,n=i*100;s.style.transform=`perspective(${C}px) rotateY(${-o}deg) translateX(${n}%)`},onEnd:()=>{e&&e(),s.style.transform=""}})}},Tt={stiffness:1,damping:1},St={stiffness:20,damping:25},kt="#000000",Ct="circle",F="CURTAIN_REVEAL_OVERLAY_ID",Pt={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"},Ot=.4,S=.5,vt=.2;function Ft(t,e){switch(t){case"circle":return`circle(${e*100}% at 50% 50%)`;case"square":return`inset(${(1-e)*50}% round ${10*e}%)`;case"triangle":{const s=e*100;return`polygon(50% ${50-s}%, ${50-s}% ${50+s}%, ${50+s}% ${50+s}%)`}}}const Yt=t=>t.reduce((e,s)=>e+s,0),Ut=(t={})=>{const{background:e=kt,texts:s=[],shape:d=Ct,inSpring:r=St,outSpring:i=Tt,textStyle:o={}}=t;return{out:(n,a)=>{const c=n.style.opacity;return{spring:i,from:1,to:0,prepare:l=>{w.prepareOutgoing(l,a),l.style.opacity="1"},tick:l=>{const p=Math.max(0,l-Ot);n.style.opacity=String(p)},onEnd:()=>{n.style.opacity=c}}},in:n=>{let a=null,c=null,l=null;const p=document.body.style.overflow,g=document.getElementById(F);let u=[];const y=()=>{a=document.createElement("div"),a.id=F,Object.assign(a.style,Pt,{background:e}),document.body.appendChild(a),c=document.createElement("div"),Object.assign(c.style,_t),a.appendChild(c),l=document.createElement("div"),Object.assign(l.style,It),c.appendChild(l),s.forEach(h=>{const f=document.createElement("div");f.textContent=h,Object.assign(f.style,Dt,o),l.appendChild(f)}),u=Array.from(l.children).map(h=>h.getBoundingClientRect().width)};return{spring:r,from:0,to:1,prepare:()=>{document.body.style.overflow="hidden",n.style.opacity="1",g==null||g.remove(),y(),a&&c&&(a.style.clipPath="none",c.style.transform="scale(1)")},tick:h=>{if(!(!a||!c||!l)){if(h<=S&&s.length>0){const f=h/S,$=Math.min(Math.floor(f*s.length),s.length-1),x=u[$]??0,m=Yt(u.slice(0,$));c.style.width=`${x}px`,l.style.transform=`translateX(-${m}px)`}if(h>S){const $=1-Math.max(0,Math.min(1,(h-S)/vt));a.style.clipPath=Ft(d,$),c.style.transform=`scale(${$})`}}},onEnd:()=>{a==null||a.remove(),a=c=l=null,document.body.style.overflow=p}}}}};exports.jaemin=w.jaemin;exports.blind=Z;exports.curtainReveal=Ut;exports.drill=J;exports.fade=nt;exports.film=lt;exports.hero=ht;exports.instagram=gt;exports.pinterest=bt;exports.scroll=Et;exports.slide=At;exports.strip=Lt;
@@ -3,6 +3,7 @@ export * from './drill';
3
3
  export * from './fade';
4
4
  export * from './film';
5
5
  export * from './hero';
6
+ export * from './instagram';
6
7
  export { jaemin } from './jaemin';
7
8
  export * from './pinterest';
8
9
  export * from './scroll';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/view-transitions/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC"}