@moveindustries/movement-design-system 1.2.1 → 1.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.
- package/CHANGELOG.md +11 -0
- package/dist/brand-faces.css +88 -0
- package/dist/{button-Dh2vlJOI.js → button-BE4Sonxr.js} +1 -1
- package/dist/button-DDuNM3Ni.cjs +1 -0
- package/dist/carousel.cjs +1 -1
- package/dist/carousel.js +147 -139
- package/dist/components/Footer/Footer.d.ts +11 -8
- package/dist/components/Footer/Footer.d.ts.map +1 -1
- package/dist/createLucideIcon-8yq_KgWS.cjs +1 -0
- package/dist/createLucideIcon-DFqdAswP.js +102 -0
- package/dist/fonts.css +32 -12
- package/dist/index.cjs +1 -1
- package/dist/index.js +526 -513
- package/dist/movement-design-system.css +90 -1
- package/dist/theme.css +18 -15
- package/dist/{use-mobile-C12jSU8y.cjs → use-mobile-1LviLXhw.cjs} +2 -2
- package/dist/{use-mobile-Da0X_fcF.js → use-mobile-CN6nNdj4.js} +63 -60
- package/dist/wallet.cjs +1 -1
- package/dist/wallet.js +36 -36
- package/package.json +15 -17
- package/dist/button-DZAlWvkC.cjs +0 -1
- package/dist/index-5va-8CrW.cjs +0 -1
- package/dist/index-uPOYJZpG.js +0 -34
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [1.2.2] - 2026-06-18
|
|
8
|
+
|
|
9
|
+
Makes the unified footer truly self-contained and fixes a `lucide-react` install conflict. The 1.2.1 footer borrowed the host app's Tailwind utilities and CSS variables, so the same component rendered differently per app (and its desktop logo size got clobbered by the consuming app's own `.h-9`); this release scopes all footer styling inside the design system so it renders identically everywhere with no per-app workarounds.
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- **Footer — self-contained styling.** All footer styling now lives in `footer.css` (compiled into the `component-styles` bundle) under scoped `.mvmt-footer*` classes with literal values and a fixed `768px` breakpoint. The footer no longer uses ambient Tailwind utility classes (`h-9` / `md:h-11` / `text-[24px]`) or reads host CSS variables (`--container-max` / `--container-padding-x` / `--font-display`) for layout, sizing, or typography, so it renders identically across Bridge, Staking, Explorer, and Faucet. Text uses the bundled `"ABC Oracle"` face directly (see below), and the footer's top margin was removed (it leaked the host page background above the black slab).
|
|
14
|
+
- **Brand fonts bundled.** The ABC Oracle / RecifeText `@font-face` rules now ship in the `component-styles` bundle (external `url()`s, woff2 load on use), so components render the brand font wherever the DS CSS loads — instead of depending on each app to expose it via `--font-display`, which broke in apps that mis-scoped that variable. Font tokens and the `body` fallback now end with the literal brand face. New `brand-faces.css` is the shared `@font-face` source.
|
|
15
|
+
- **WalletModal** — uses the standard `font-display` utility instead of ad-hoc `font-[family-name:var(--font-display,sans-serif)]` values.
|
|
16
|
+
- **`lucide-react` peer conflict.** The peer range `^0.500.0` only allowed `0.500.x` (caret on a `0.x` version), so consumers on any newer `lucide-react` (e.g. `0.562.0`; latest is `1.21.0`) failed `npm install` with an ERESOLVE peer conflict. `lucide-react` is now bundled into the package (removed from `peerDependencies` and from the build's `external` list) — the icons used are tree-shaken in (`sideEffects: false`, ~1 KB added) and the package no longer emits a bare `lucide-react` import, so consumers never resolve or install it.
|
|
17
|
+
|
|
7
18
|
## [1.2.1] - 2026-06-17
|
|
8
19
|
|
|
9
20
|
Unified footer release. Replaces the pre-rebrand `Footer` with the Bridge footer — the source-of-truth design — so Bridge, Staking, Explorer, and Faucet all render one consistent footer from a single source. Also repairs the brand-font wiring (the `font-*` utilities were partly broken) and removes ~4.8 MB of unused legacy font files from the package.
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/* ============================================================================
|
|
2
|
+
* Movement brand @font-face declarations — ABC Oracle + RecifeText.
|
|
3
|
+
* ----------------------------------------------------------------------------
|
|
4
|
+
* Single source of truth for the brand faces. Consumed two ways:
|
|
5
|
+
* 1. `fonts.css` @imports this (the standalone `/fonts` entry + Storybook).
|
|
6
|
+
* 2. The library build APPENDS this file to the published component-styles
|
|
7
|
+
* bundle (dist/movement-design-system.css) so every consumer that imports
|
|
8
|
+
* the bundle gets the real brand faces with no extra import — see
|
|
9
|
+
* `copyThemePlugin` in vite.config.ts.
|
|
10
|
+
* The `url()`s stay external (never base64-inlined): the woff2 ship in the
|
|
11
|
+
* package under dist/assets/fonts/** and download only when a face is used.
|
|
12
|
+
* Paths are relative to dist/ root, where this file, fonts.css, and the
|
|
13
|
+
* component-styles bundle all live alongside ./assets/fonts/.
|
|
14
|
+
* ============================================================================ */
|
|
15
|
+
|
|
16
|
+
/* ABC Oracle — primary sans / display */
|
|
17
|
+
@font-face {
|
|
18
|
+
font-family: "ABC Oracle";
|
|
19
|
+
src: url("./assets/fonts/oracle/ABCOracle-Regular.woff2") format("woff2");
|
|
20
|
+
font-weight: 400;
|
|
21
|
+
font-style: normal;
|
|
22
|
+
font-display: swap;
|
|
23
|
+
}
|
|
24
|
+
@font-face {
|
|
25
|
+
font-family: "ABC Oracle";
|
|
26
|
+
src: url("./assets/fonts/oracle/ABCOracle-RegularItalic.woff2") format("woff2");
|
|
27
|
+
font-weight: 400;
|
|
28
|
+
font-style: italic;
|
|
29
|
+
font-display: swap;
|
|
30
|
+
}
|
|
31
|
+
@font-face {
|
|
32
|
+
font-family: "ABC Oracle";
|
|
33
|
+
src: url("./assets/fonts/oracle/ABCOracle-Medium.woff2") format("woff2");
|
|
34
|
+
font-weight: 500;
|
|
35
|
+
font-style: normal;
|
|
36
|
+
font-display: swap;
|
|
37
|
+
}
|
|
38
|
+
@font-face {
|
|
39
|
+
font-family: "ABC Oracle";
|
|
40
|
+
src: url("./assets/fonts/oracle/ABCOracle-MediumItalic.woff2") format("woff2");
|
|
41
|
+
font-weight: 500;
|
|
42
|
+
font-style: italic;
|
|
43
|
+
font-display: swap;
|
|
44
|
+
}
|
|
45
|
+
@font-face {
|
|
46
|
+
font-family: "ABC Oracle";
|
|
47
|
+
src: url("./assets/fonts/oracle/ABCOracle-Bold.woff2") format("woff2");
|
|
48
|
+
font-weight: 700;
|
|
49
|
+
font-style: normal;
|
|
50
|
+
font-display: swap;
|
|
51
|
+
}
|
|
52
|
+
@font-face {
|
|
53
|
+
font-family: "ABC Oracle";
|
|
54
|
+
src: url("./assets/fonts/oracle/ABCOracle-BoldItalic.woff2") format("woff2");
|
|
55
|
+
font-weight: 700;
|
|
56
|
+
font-style: italic;
|
|
57
|
+
font-display: swap;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* RecifeText — serif, emphasis */
|
|
61
|
+
@font-face {
|
|
62
|
+
font-family: "RecifeText";
|
|
63
|
+
src: url("./assets/fonts/recife/RecifeTextWeb-Regular.woff2") format("woff2");
|
|
64
|
+
font-weight: 400;
|
|
65
|
+
font-style: normal;
|
|
66
|
+
font-display: swap;
|
|
67
|
+
}
|
|
68
|
+
@font-face {
|
|
69
|
+
font-family: "RecifeText";
|
|
70
|
+
src: url("./assets/fonts/recife/RecifeTextWeb-RegularItalic.woff2") format("woff2");
|
|
71
|
+
font-weight: 400;
|
|
72
|
+
font-style: italic;
|
|
73
|
+
font-display: swap;
|
|
74
|
+
}
|
|
75
|
+
@font-face {
|
|
76
|
+
font-family: "RecifeText";
|
|
77
|
+
src: url("./assets/fonts/recife/RecifeTextWeb-Medium.woff2") format("woff2");
|
|
78
|
+
font-weight: 500;
|
|
79
|
+
font-style: normal;
|
|
80
|
+
font-display: swap;
|
|
81
|
+
}
|
|
82
|
+
@font-face {
|
|
83
|
+
font-family: "RecifeText";
|
|
84
|
+
src: url("./assets/fonts/recife/RecifeTextWeb-Bold.woff2") format("woff2");
|
|
85
|
+
font-weight: 700;
|
|
86
|
+
font-style: normal;
|
|
87
|
+
font-display: swap;
|
|
88
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import { Slot as n } from "@radix-ui/react-slot";
|
|
4
|
-
import { c as s } from "./
|
|
4
|
+
import { c as s } from "./createLucideIcon-DFqdAswP.js";
|
|
5
5
|
import { c } from "./utils-eGXXUFl7.js";
|
|
6
6
|
const d = s(
|
|
7
7
|
"cursor-pointer inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-bold transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive uppercase tracking-wider rounded-full",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const s=require("react/jsx-runtime");require("react");const c=require("@radix-ui/react-slot"),d=require("./createLucideIcon-8yq_KgWS.cjs"),g=require("./utils-CikHldDD.cjs"),e=d.cva("cursor-pointer inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-bold transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive uppercase tracking-wider rounded-full",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90 active:bg-primary/80",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/90 active:bg-secondary/80",accent:"bg-accent text-accent-foreground hover:bg-accent/90 active:bg-accent/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90 active:bg-destructive/80",success:"bg-success text-success-foreground hover:bg-success/90 active:bg-success/80",warning:"bg-warning text-warning-foreground hover:bg-warning/90 active:bg-warning/80",outline:"border-2 border-primary bg-transparent text-primary hover:bg-primary hover:text-primary-foreground active:bg-primary/90 active:text-primary-foreground",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline",glow:"w-full max-w-[522px] p-3 bg-[#15EDEB] border-0 font-mono text-[#1d1d1d] rounded-lg text-2xl font-bold leading-6 tracking-[-0.06rem] uppercase relative overflow-hidden backdrop-blur-[21px] shadow-[8px_8px_0_0_rgba(0,0,0,0.55)] hover:-translate-y-px hover:bg-white hover:shadow-[-8px_-8px_0_0_rgba(0,0,0,0.55)] active:translate-y-0 disabled:opacity-50 disabled:cursor-not-allowed transition-all duration-200 ease-in-out"},size:{xs:"h-6 px-3 text-xs gap-1.5",sm:"h-8 px-4 text-sm gap-2",default:"h-10 px-6 text-base gap-2",lg:"h-12 px-8 text-lg gap-2.5",xl:"h-14 px-10 text-xl gap-2.5","2xl":"h-16 px-12 text-2xl gap-3",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function u({className:t,variant:r,size:a,asChild:n=!1,...i}){const o=n?c.Slot:"button";return s.jsx(o,{"data-slot":"button",className:g.cn(e({variant:r,size:a,className:t})),...i})}exports.Button=u;exports.buttonVariants=e;
|
package/dist/carousel.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("react/jsx-runtime"),Y=require("react"),Ut=require("lucide-react"),ht=require("./utils-CikHldDD.cjs"),Qt=require("./button-DZAlWvkC.cjs");function ln(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,s.get?s:{enumerable:!0,get:()=>t[e]})}}return n.default=t,Object.freeze(n)}const $=ln(Y);function fn(t){return Object.prototype.toString.call(t)==="[object Object]"}function Ht(t){return fn(t)||Array.isArray(t)}function dn(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Pt(t,n){const e=Object.keys(t),s=Object.keys(n);if(e.length!==s.length)return!1;const c=JSON.stringify(Object.keys(t.breakpoints||{})),i=JSON.stringify(Object.keys(n.breakpoints||{}));return c!==i?!1:e.every(o=>{const a=t[o],r=n[o];return typeof a=="function"?`${a}`==`${r}`:!Ht(a)||!Ht(r)?a===r:Pt(a,r)})}function _t(t){return t.concat().sort((n,e)=>n.name>e.name?1:-1).map(n=>n.options)}function pn(t,n){if(t.length!==n.length)return!1;const e=_t(t),s=_t(n);return e.every((c,i)=>{const o=s[i];return Pt(c,o)})}function Dt(t){return typeof t=="number"}function Ot(t){return typeof t=="string"}function xt(t){return typeof t=="boolean"}function $t(t){return Object.prototype.toString.call(t)==="[object Object]"}function D(t){return Math.abs(t)}function At(t){return Math.sign(t)}function dt(t,n){return D(t-n)}function mn(t,n){if(t===0||n===0||D(t)<=D(n))return 0;const e=dt(D(t),D(n));return D(e/t)}function gn(t){return Math.round(t*100)/100}function pt(t){return mt(t).map(Number)}function V(t){return t[St(t)]}function St(t){return Math.max(0,t.length-1)}function Mt(t,n){return n===St(t)}function Kt(t,n=0){return Array.from(Array(t),(e,s)=>n+s)}function mt(t){return Object.keys(t)}function Jt(t,n){return[t,n].reduce((e,s)=>(mt(s).forEach(c=>{const i=e[c],o=s[c],a=$t(i)&&$t(o);e[c]=a?Jt(i,o):o}),e),{})}function wt(t,n){return typeof n.MouseEvent<"u"&&t instanceof n.MouseEvent}function hn(t,n){const e={start:s,center:c,end:i};function s(){return 0}function c(r){return i(r)/2}function i(r){return n-r}function o(r,u){return Ot(t)?e[t](r):t(n,r,u)}return{measure:o}}function gt(){let t=[];function n(c,i,o,a={passive:!0}){let r;if("addEventListener"in c)c.addEventListener(i,o,a),r=()=>c.removeEventListener(i,o,a);else{const u=c;u.addListener(o),r=()=>u.removeListener(o)}return t.push(r),s}function e(){t=t.filter(c=>c())}const s={add:n,clear:e};return s}function Sn(t,n,e,s){const c=gt(),i=1e3/60;let o=null,a=0,r=0;function u(){c.add(t,"visibilitychange",()=>{t.hidden&&f()})}function h(){b(),c.clear()}function d(g){if(!r)return;o||(o=g,e(),e());const l=g-o;for(o=g,a+=l;a>=i;)e(),a-=i;const S=a/i;s(S),r&&(r=n.requestAnimationFrame(d))}function p(){r||(r=n.requestAnimationFrame(d))}function b(){n.cancelAnimationFrame(r),o=null,a=0,r=0}function f(){o=null,a=0}return{init:u,destroy:h,start:p,stop:b,update:e,render:s}}function bn(t,n){const e=n==="rtl",s=t==="y",c=s?"y":"x",i=s?"x":"y",o=!s&&e?-1:1,a=h(),r=d();function u(f){const{height:m,width:g}=f;return s?m:g}function h(){return s?"top":e?"right":"left"}function d(){return s?"bottom":e?"left":"right"}function p(f){return f*o}return{scroll:c,cross:i,startEdge:a,endEdge:r,measureSize:u,direction:p}}function ot(t=0,n=0){const e=D(t-n);function s(u){return u<t}function c(u){return u>n}function i(u){return s(u)||c(u)}function o(u){return i(u)?s(u)?t:n:u}function a(u){return e?u-e*Math.ceil((u-n)/e):u}return{length:e,max:n,min:t,constrain:o,reachedAny:i,reachedMax:c,reachedMin:s,removeOffset:a}}function Xt(t,n,e){const{constrain:s}=ot(0,t),c=t+1;let i=o(n);function o(p){return e?D((c+p)%c):s(p)}function a(){return i}function r(p){return i=o(p),d}function u(p){return h().set(a()+p)}function h(){return Xt(t,a(),e)}const d={get:a,set:r,add:u,clone:h};return d}function yn(t,n,e,s,c,i,o,a,r,u,h,d,p,b,f,m,g,l,S){const{cross:x,direction:L}=t,w=["INPUT","SELECT","TEXTAREA"],C={passive:!1},v=gt(),E=gt(),I=ot(50,225).constrain(b.measure(20)),A={mouse:300,touch:400},T={mouse:500,touch:600},k=f?43:25;let R=!1,q=0,G=0,tt=!1,Z=!1,K=!1,U=!1;function ct(y){if(!S)return;function O(j){(xt(S)||S(y,j))&&at(j)}const M=n;v.add(M,"dragstart",j=>j.preventDefault(),C).add(M,"touchmove",()=>{},C).add(M,"touchend",()=>{}).add(M,"touchstart",O).add(M,"mousedown",O).add(M,"touchcancel",N).add(M,"contextmenu",N).add(M,"click",J,!0)}function H(){v.clear(),E.clear()}function rt(){const y=U?e:n;E.add(y,"touchmove",F,C).add(y,"touchend",N).add(y,"mousemove",F,C).add(y,"mouseup",N)}function st(y){const O=y.nodeName||"";return w.includes(O)}function Q(){return(f?T:A)[U?"mouse":"touch"]}function ut(y,O){const M=d.add(At(y)*-1),j=h.byDistance(y,!f).distance;return f||D(y)<I?j:g&&O?j*.5:h.byIndex(M.get(),0).distance}function at(y){const O=wt(y,s);U=O,K=f&&O&&!y.buttons&&R,R=dt(c.get(),o.get())>=2,!(O&&y.button!==0)&&(st(y.target)||(tt=!0,i.pointerDown(y),u.useFriction(0).useDuration(0),c.set(o),rt(),q=i.readPoint(y),G=i.readPoint(y,x),p.emit("pointerDown")))}function F(y){if(!wt(y,s)&&y.touches.length>=2)return N(y);const M=i.readPoint(y),j=i.readPoint(y,x),_=dt(M,q),X=dt(j,G);if(!Z&&!U&&(!y.cancelable||(Z=_>X,!Z)))return N(y);const nt=i.pointerMove(y);_>m&&(K=!0),u.useFriction(.3).useDuration(.75),a.start(),c.add(L(nt)),y.preventDefault()}function N(y){const M=h.byDistance(0,!1).index!==d.get(),j=i.pointerUp(y)*Q(),_=ut(L(j),M),X=mn(j,_),nt=k-10*X,W=l+X/50;Z=!1,tt=!1,E.clear(),u.useDuration(nt).useFriction(W),r.distance(_,!f),U=!1,p.emit("pointerUp")}function J(y){K&&(y.stopPropagation(),y.preventDefault(),K=!1)}function z(){return tt}return{init:ct,destroy:H,pointerDown:z}}function xn(t,n){let s,c;function i(d){return d.timeStamp}function o(d,p){const f=`client${(p||t.scroll)==="x"?"X":"Y"}`;return(wt(d,n)?d:d.touches[0])[f]}function a(d){return s=d,c=d,o(d)}function r(d){const p=o(d)-o(c),b=i(d)-i(s)>170;return c=d,b&&(s=d),p}function u(d){if(!s||!c)return 0;const p=o(c)-o(s),b=i(d)-i(s),f=i(d)-i(c)>170,m=p/b;return b&&!f&&D(m)>.1?m:0}return{pointerDown:a,pointerMove:r,pointerUp:u,readPoint:o}}function vn(){function t(e){const{offsetTop:s,offsetLeft:c,offsetWidth:i,offsetHeight:o}=e;return{top:s,right:c+i,bottom:s+o,left:c,width:i,height:o}}return{measure:t}}function En(t){function n(s){return t*(s/100)}return{measure:n}}function Ln(t,n,e,s,c,i,o){const a=[t].concat(s);let r,u,h=[],d=!1;function p(g){return c.measureSize(o.measure(g))}function b(g){if(!i)return;u=p(t),h=s.map(p);function l(S){for(const x of S){if(d)return;const L=x.target===t,w=s.indexOf(x.target),C=L?u:h[w],v=p(L?t:s[w]);if(D(v-C)>=.5){g.reInit(),n.emit("resize");break}}}r=new ResizeObserver(S=>{(xt(i)||i(g,S))&&l(S)}),e.requestAnimationFrame(()=>{a.forEach(S=>r.observe(S))})}function f(){d=!0,r&&r.disconnect()}return{init:b,destroy:f}}function Cn(t,n,e,s,c,i){let o=0,a=0,r=c,u=i,h=t.get(),d=0;function p(){const C=s.get()-t.get(),v=!r;let E=0;return v?(o=0,e.set(s),t.set(s),E=C):(e.set(t),o+=C/r,o*=u,h+=o,t.add(o),E=h-d),a=At(E),d=h,w}function b(){const C=s.get()-n.get();return D(C)<.001}function f(){return r}function m(){return a}function g(){return o}function l(){return x(c)}function S(){return L(i)}function x(C){return r=C,w}function L(C){return u=C,w}const w={direction:m,duration:f,velocity:g,seek:p,settled:b,useBaseFriction:S,useBaseDuration:l,useFriction:L,useDuration:x};return w}function In(t,n,e,s,c){const i=c.measure(10),o=c.measure(50),a=ot(.1,.99);let r=!1;function u(){return!(r||!t.reachedAny(e.get())||!t.reachedAny(n.get()))}function h(b){if(!u())return;const f=t.reachedMin(n.get())?"min":"max",m=D(t[f]-n.get()),g=e.get()-n.get(),l=a.constrain(m/o);e.subtract(g*l),!b&&D(g)<i&&(e.set(t.constrain(e.get())),s.useDuration(25).useBaseFriction())}function d(b){r=!b}return{shouldConstrain:u,constrain:h,toggleActive:d}}function Tn(t,n,e,s,c){const i=ot(-n+t,0),o=d(),a=h(),r=p();function u(f,m){return dt(f,m)<=1}function h(){const f=o[0],m=V(o),g=o.lastIndexOf(f),l=o.indexOf(m)+1;return ot(g,l)}function d(){return e.map((f,m)=>{const{min:g,max:l}=i,S=i.constrain(f),x=!m,L=Mt(e,m);return x?l:L||u(g,S)?g:u(l,S)?l:S}).map(f=>parseFloat(f.toFixed(3)))}function p(){if(n<=t+c)return[i.max];if(s==="keepSnaps")return o;const{min:f,max:m}=a;return o.slice(f,m)}return{snapsContained:r,scrollContainLimit:a}}function On(t,n,e){const s=n[0],c=e?s-t:V(n);return{limit:ot(c,s)}}function wn(t,n,e,s){const i=n.min+.1,o=n.max+.1,{reachedMin:a,reachedMax:r}=ot(i,o);function u(p){return p===1?r(e.get()):p===-1?a(e.get()):!1}function h(p){if(!u(p))return;const b=t*(p*-1);s.forEach(f=>f.add(b))}return{loop:h}}function Pn(t){const{max:n,length:e}=t;function s(i){const o=i-n;return e?o/-e:0}return{get:s}}function Dn(t,n,e,s,c){const{startEdge:i,endEdge:o}=t,{groupSlides:a}=c,r=d().map(n.measure),u=p(),h=b();function d(){return a(s).map(m=>V(m)[o]-m[0][i]).map(D)}function p(){return s.map(m=>e[i]-m[i]).map(m=>-D(m))}function b(){return a(u).map(m=>m[0]).map((m,g)=>m+r[g])}return{snaps:u,snapsAligned:h}}function An(t,n,e,s,c,i){const{groupSlides:o}=c,{min:a,max:r}=s,u=h();function h(){const p=o(i),b=!t||n==="keepSnaps";return e.length===1?[i]:b?p:p.slice(a,r).map((f,m,g)=>{const l=!m,S=Mt(g,m);if(l){const x=V(g[0])+1;return Kt(x)}if(S){const x=St(i)-V(g)[0]+1;return Kt(x,V(g)[0])}return f})}return{slideRegistry:u}}function Mn(t,n,e,s,c){const{reachedAny:i,removeOffset:o,constrain:a}=s;function r(f){return f.concat().sort((m,g)=>D(m)-D(g))[0]}function u(f){const m=t?o(f):a(f),g=n.map((S,x)=>({diff:h(S-m,0),index:x})).sort((S,x)=>D(S.diff)-D(x.diff)),{index:l}=g[0];return{index:l,distance:m}}function h(f,m){const g=[f,f+e,f-e];if(!t)return f;if(!m)return r(g);const l=g.filter(S=>At(S)===m);return l.length?r(l):V(g)-e}function d(f,m){const g=n[f]-c.get(),l=h(g,m);return{index:f,distance:l}}function p(f,m){const g=c.get()+f,{index:l,distance:S}=u(g),x=!t&&i(g);if(!m||x)return{index:l,distance:f};const L=n[l]-S,w=f+h(L,0);return{index:l,distance:w}}return{byDistance:p,byIndex:d,shortcut:h}}function Nn(t,n,e,s,c,i,o){function a(d){const p=d.distance,b=d.index!==n.get();i.add(p),p&&(s.duration()?t.start():(t.update(),t.render(1),t.update())),b&&(e.set(n.get()),n.set(d.index),o.emit("select"))}function r(d,p){const b=c.byDistance(d,p);a(b)}function u(d,p){const b=n.clone().set(d),f=c.byIndex(b.get(),p);a(f)}return{distance:r,index:u}}function jn(t,n,e,s,c,i,o,a){const r={passive:!0,capture:!0};let u=0;function h(b){if(!a)return;function f(m){if(new Date().getTime()-u>10)return;o.emit("slideFocusStart"),t.scrollLeft=0;const S=e.findIndex(x=>x.includes(m));Dt(S)&&(c.useDuration(0),s.index(S,0),o.emit("slideFocus"))}i.add(document,"keydown",d,!1),n.forEach((m,g)=>{i.add(m,"focus",l=>{(xt(a)||a(b,l))&&f(g)},r)})}function d(b){b.code==="Tab"&&(u=new Date().getTime())}return{init:h}}function ft(t){let n=t;function e(){return n}function s(r){n=o(r)}function c(r){n+=o(r)}function i(r){n-=o(r)}function o(r){return Dt(r)?r:r.get()}return{get:e,set:s,add:c,subtract:i}}function Yt(t,n){const e=t.scroll==="x"?o:a,s=n.style;let c=null,i=!1;function o(p){return`translate3d(${p}px,0px,0px)`}function a(p){return`translate3d(0px,${p}px,0px)`}function r(p){if(i)return;const b=gn(t.direction(p));b!==c&&(s.transform=e(b),c=b)}function u(p){i=!p}function h(){i||(s.transform="",n.getAttribute("style")||n.removeAttribute("style"))}return{clear:h,to:r,toggleActive:u}}function kn(t,n,e,s,c,i,o,a,r){const h=pt(c),d=pt(c).reverse(),p=l().concat(S());function b(v,E){return v.reduce((I,A)=>I-c[A],E)}function f(v,E){return v.reduce((I,A)=>b(I,E)>0?I.concat([A]):I,[])}function m(v){return i.map((E,I)=>({start:E-s[I]+.5+v,end:E+n-.5+v}))}function g(v,E,I){const A=m(E);return v.map(T=>{const k=I?0:-e,R=I?e:0,q=I?"end":"start",G=A[T][q];return{index:T,loopPoint:G,slideLocation:ft(-1),translate:Yt(t,r[T]),target:()=>a.get()>G?k:R}})}function l(){const v=o[0],E=f(d,v);return g(E,e,!1)}function S(){const v=n-o[0]-1,E=f(h,v);return g(E,-e,!0)}function x(){return p.every(({index:v})=>{const E=h.filter(I=>I!==v);return b(E,n)<=.1})}function L(){p.forEach(v=>{const{target:E,translate:I,slideLocation:A}=v,T=E();T!==A.get()&&(I.to(T),A.set(T))})}function w(){p.forEach(v=>v.translate.clear())}return{canLoop:x,clear:w,loop:L,loopPoints:p}}function Fn(t,n,e){let s,c=!1;function i(r){if(!e)return;function u(h){for(const d of h)if(d.type==="childList"){r.reInit(),n.emit("slidesChanged");break}}s=new MutationObserver(h=>{c||(xt(e)||e(r,h))&&u(h)}),s.observe(t,{childList:!0})}function o(){s&&s.disconnect(),c=!0}return{init:i,destroy:o}}function zn(t,n,e,s){const c={};let i=null,o=null,a,r=!1;function u(){a=new IntersectionObserver(f=>{r||(f.forEach(m=>{const g=n.indexOf(m.target);c[g]=m}),i=null,o=null,e.emit("slidesInView"))},{root:t.parentElement,threshold:s}),n.forEach(f=>a.observe(f))}function h(){a&&a.disconnect(),r=!0}function d(f){return mt(c).reduce((m,g)=>{const l=parseInt(g),{isIntersecting:S}=c[l];return(f&&S||!f&&!S)&&m.push(l),m},[])}function p(f=!0){if(f&&i)return i;if(!f&&o)return o;const m=d(f);return f&&(i=m),f||(o=m),m}return{init:u,destroy:h,get:p}}function Bn(t,n,e,s,c,i){const{measureSize:o,startEdge:a,endEdge:r}=t,u=e[0]&&c,h=f(),d=m(),p=e.map(o),b=g();function f(){if(!u)return 0;const S=e[0];return D(n[a]-S[a])}function m(){if(!u)return 0;const S=i.getComputedStyle(V(s));return parseFloat(S.getPropertyValue(`margin-${r}`))}function g(){return e.map((S,x,L)=>{const w=!x,C=Mt(L,x);return w?p[x]+h:C?p[x]+d:L[x+1][a]-S[a]}).map(D)}return{slideSizes:p,slideSizesWithGaps:b,startGap:h,endGap:d}}function Vn(t,n,e,s,c,i,o,a,r){const{startEdge:u,endEdge:h,direction:d}=t,p=Dt(e);function b(l,S){return pt(l).filter(x=>x%S===0).map(x=>l.slice(x,x+S))}function f(l){return l.length?pt(l).reduce((S,x,L)=>{const w=V(S)||0,C=w===0,v=x===St(l),E=c[u]-i[w][u],I=c[u]-i[x][h],A=!s&&C?d(o):0,T=!s&&v?d(a):0,k=D(I-T-(E+A));return L&&k>n+r&&S.push(x),v&&S.push(l.length),S},[]).map((S,x,L)=>{const w=Math.max(L[x-1]||0);return l.slice(w,S)}):[]}function m(l){return p?b(l,e):f(l)}return{groupSlides:m}}function Rn(t,n,e,s,c,i,o){const{align:a,axis:r,direction:u,startIndex:h,loop:d,duration:p,dragFree:b,dragThreshold:f,inViewThreshold:m,slidesToScroll:g,skipSnaps:l,containScroll:S,watchResize:x,watchSlides:L,watchDrag:w,watchFocus:C}=i,v=2,E=vn(),I=E.measure(n),A=e.map(E.measure),T=bn(r,u),k=T.measureSize(I),R=En(k),q=hn(a,k),G=!d&&!!S,tt=d||!!S,{slideSizes:Z,slideSizesWithGaps:K,startGap:U,endGap:ct}=Bn(T,I,A,e,tt,c),H=Vn(T,k,g,d,I,A,U,ct,v),{snaps:rt,snapsAligned:st}=Dn(T,q,I,A,H),Q=-V(rt)+V(K),{snapsContained:ut,scrollContainLimit:at}=Tn(k,Q,st,S,v),F=G?ut:st,{limit:N}=On(Q,F,d),J=Xt(St(F),h,d),z=J.clone(),P=pt(e),y=({dragHandler:it,scrollBody:It,scrollBounds:Tt,options:{loop:bt}})=>{bt||Tt.constrain(it.pointerDown()),It.seek()},O=({scrollBody:it,translate:It,location:Tt,offsetLocation:bt,previousLocation:nn,scrollLooper:en,slideLooper:on,dragHandler:rn,animation:sn,eventHandler:zt,scrollBounds:cn,options:{loop:Bt}},Vt)=>{const Rt=it.settled(),un=!cn.shouldConstrain(),qt=Bt?Rt:Rt&&un,Gt=qt&&!rn.pointerDown();Gt&&sn.stop();const an=Tt.get()*Vt+nn.get()*(1-Vt);bt.set(an),Bt&&(en.loop(it.direction()),on.loop()),It.to(bt.get()),Gt&&zt.emit("settle"),qt||zt.emit("scroll")},M=Sn(s,c,()=>y(Ct),it=>O(Ct,it)),j=.68,_=F[J.get()],X=ft(_),nt=ft(_),W=ft(_),et=ft(_),lt=Cn(X,W,nt,et,p,j),Et=Mn(d,F,Q,N,et),Lt=Nn(M,J,z,lt,Et,et,o),jt=Pn(N),kt=gt(),Wt=zn(n,e,o,m),{slideRegistry:Ft}=An(G,S,F,at,H,P),tn=jn(t,e,Ft,Lt,lt,kt,o,C),Ct={ownerDocument:s,ownerWindow:c,eventHandler:o,containerRect:I,slideRects:A,animation:M,axis:T,dragHandler:yn(T,t,s,c,et,xn(T,c),X,M,Lt,lt,Et,J,o,R,b,f,l,j,w),eventStore:kt,percentOfView:R,index:J,indexPrevious:z,limit:N,location:X,offsetLocation:W,previousLocation:nt,options:i,resizeHandler:Ln(n,o,c,e,T,x,E),scrollBody:lt,scrollBounds:In(N,W,et,lt,R),scrollLooper:wn(Q,N,W,[X,W,nt,et]),scrollProgress:jt,scrollSnapList:F.map(jt.get),scrollSnaps:F,scrollTarget:Et,scrollTo:Lt,slideLooper:kn(T,k,Q,Z,K,rt,F,W,e),slideFocus:tn,slidesHandler:Fn(n,o,L),slidesInView:Wt,slideIndexes:P,slideRegistry:Ft,slidesToScroll:H,target:et,translate:Yt(T,n)};return Ct}function qn(){let t={},n;function e(u){n=u}function s(u){return t[u]||[]}function c(u){return s(u).forEach(h=>h(n,u)),r}function i(u,h){return t[u]=s(u).concat([h]),r}function o(u,h){return t[u]=s(u).filter(d=>d!==h),r}function a(){t={}}const r={init:e,emit:c,off:o,on:i,clear:a};return r}const Gn={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function Hn(t){function n(i,o){return Jt(i,o||{})}function e(i){const o=i.breakpoints||{},a=mt(o).filter(r=>t.matchMedia(r).matches).map(r=>o[r]).reduce((r,u)=>n(r,u),{});return n(i,a)}function s(i){return i.map(o=>mt(o.breakpoints||{})).reduce((o,a)=>o.concat(a),[]).map(t.matchMedia)}return{mergeOptions:n,optionsAtMedia:e,optionsMediaQueries:s}}function _n(t){let n=[];function e(i,o){return n=o.filter(({options:a})=>t.optionsAtMedia(a).active!==!1),n.forEach(a=>a.init(i,t)),o.reduce((a,r)=>Object.assign(a,{[r.name]:r}),{})}function s(){n=n.filter(i=>i.destroy())}return{init:e,destroy:s}}function yt(t,n,e){const s=t.ownerDocument,c=s.defaultView,i=Hn(c),o=_n(i),a=gt(),r=qn(),{mergeOptions:u,optionsAtMedia:h,optionsMediaQueries:d}=i,{on:p,off:b,emit:f}=r,m=T;let g=!1,l,S=u(Gn,yt.globalOptions),x=u(S),L=[],w,C,v;function E(){const{container:P,slides:y}=x;C=(Ot(P)?t.querySelector(P):P)||t.children[0];const M=Ot(y)?C.querySelectorAll(y):y;v=[].slice.call(M||C.children)}function I(P){const y=Rn(t,C,v,s,c,P,r);if(P.loop&&!y.slideLooper.canLoop()){const O=Object.assign({},P,{loop:!1});return I(O)}return y}function A(P,y){g||(S=u(S,P),x=h(S),L=y||L,E(),l=I(x),d([S,...L.map(({options:O})=>O)]).forEach(O=>a.add(O,"change",T)),x.active&&(l.translate.to(l.location.get()),l.animation.init(),l.slidesInView.init(),l.slideFocus.init(z),l.eventHandler.init(z),l.resizeHandler.init(z),l.slidesHandler.init(z),l.options.loop&&l.slideLooper.loop(),C.offsetParent&&v.length&&l.dragHandler.init(z),w=o.init(z,L)))}function T(P,y){const O=H();k(),A(u({startIndex:O},P),y),r.emit("reInit")}function k(){l.dragHandler.destroy(),l.eventStore.clear(),l.translate.clear(),l.slideLooper.clear(),l.resizeHandler.destroy(),l.slidesHandler.destroy(),l.slidesInView.destroy(),l.animation.destroy(),o.destroy(),a.clear()}function R(){g||(g=!0,a.clear(),k(),r.emit("destroy"),r.clear())}function q(P,y,O){!x.active||g||(l.scrollBody.useBaseFriction().useDuration(y===!0?0:x.duration),l.scrollTo.index(P,O||0))}function G(P){const y=l.index.add(1).get();q(y,P,-1)}function tt(P){const y=l.index.add(-1).get();q(y,P,1)}function Z(){return l.index.add(1).get()!==H()}function K(){return l.index.add(-1).get()!==H()}function U(){return l.scrollSnapList}function ct(){return l.scrollProgress.get(l.offsetLocation.get())}function H(){return l.index.get()}function rt(){return l.indexPrevious.get()}function st(){return l.slidesInView.get()}function Q(){return l.slidesInView.get(!1)}function ut(){return w}function at(){return l}function F(){return t}function N(){return C}function J(){return v}const z={canScrollNext:Z,canScrollPrev:K,containerNode:N,internalEngine:at,destroy:R,off:b,on:p,emit:f,plugins:ut,previousScrollSnap:rt,reInit:m,rootNode:F,scrollNext:G,scrollPrev:tt,scrollProgress:ct,scrollSnapList:U,scrollTo:q,selectedScrollSnap:H,slideNodes:J,slidesInView:st,slidesNotInView:Q};return A(n,e),setTimeout(()=>r.emit("init"),0),z}yt.globalOptions=void 0;function Nt(t={},n=[]){const e=Y.useRef(t),s=Y.useRef(n),[c,i]=Y.useState(),[o,a]=Y.useState(),r=Y.useCallback(()=>{c&&c.reInit(e.current,s.current)},[c]);return Y.useEffect(()=>{Pt(e.current,t)||(e.current=t,r())},[t,r]),Y.useEffect(()=>{pn(s.current,n)||(s.current=n,r())},[n,r]),Y.useEffect(()=>{if(dn()&&o){yt.globalOptions=Nt.globalOptions;const u=yt(o,e.current,s.current);return i(u),()=>u.destroy()}else i(void 0)},[o,i]),[a,c]}Nt.globalOptions=void 0;const Zt=$.createContext(null);function vt(){const t=$.useContext(Zt);if(!t)throw new Error("useCarousel must be used within a <Carousel />");return t}function $n({orientation:t="horizontal",opts:n,setApi:e,plugins:s,className:c,children:i,...o}){const[a,r]=Nt({...n,axis:t==="horizontal"?"x":"y"},s),[u,h]=$.useState(!1),[d,p]=$.useState(!1),b=$.useCallback(l=>{l&&(h(l.canScrollPrev()),p(l.canScrollNext()))},[]),f=$.useCallback(()=>{r?.scrollPrev()},[r]),m=$.useCallback(()=>{r?.scrollNext()},[r]),g=$.useCallback(l=>{l.key==="ArrowLeft"?(l.preventDefault(),f()):l.key==="ArrowRight"&&(l.preventDefault(),m())},[f,m]);return $.useEffect(()=>{!r||!e||e(r)},[r,e]),$.useEffect(()=>{if(r)return b(r),r.on("reInit",b),r.on("select",b),()=>{r?.off("select",b)}},[r,b]),B.jsx(Zt.Provider,{value:{carouselRef:a,api:r,opts:n,orientation:t||(n?.axis==="y"?"vertical":"horizontal"),scrollPrev:f,scrollNext:m,canScrollPrev:u,canScrollNext:d},children:B.jsx("div",{onKeyDownCapture:g,className:ht.cn("relative",c),role:"region","aria-roledescription":"carousel","data-slot":"carousel",...o,children:i})})}function Kn({className:t,...n}){const{carouselRef:e,orientation:s}=vt();return B.jsx("div",{ref:e,className:"overflow-hidden","data-slot":"carousel-content",children:B.jsx("div",{className:ht.cn("flex",s==="horizontal"?"-ml-4":"-mt-4 flex-col",t),...n})})}function Un({className:t,...n}){const{orientation:e}=vt();return B.jsx("div",{role:"group","aria-roledescription":"slide","data-slot":"carousel-item",className:ht.cn("min-w-0 shrink-0 grow-0 basis-full",e==="horizontal"?"pl-4":"pt-4",t),...n})}function Qn({className:t,variant:n="outline",size:e="icon",...s}){const{orientation:c,scrollPrev:i,canScrollPrev:o}=vt();return B.jsxs(Qt.Button,{"data-slot":"carousel-previous",variant:n,size:e,className:ht.cn("absolute size-8 rounded-full",c==="horizontal"?"top-1/2 -left-12 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",t),disabled:!o,onClick:i,...s,children:[B.jsx(Ut.ArrowLeft,{}),B.jsx("span",{className:"sr-only",children:"Previous slide"})]})}function Jn({className:t,variant:n="outline",size:e="icon",...s}){const{orientation:c,scrollNext:i,canScrollNext:o}=vt();return B.jsxs(Qt.Button,{"data-slot":"carousel-next",variant:n,size:e,className:ht.cn("absolute size-8 rounded-full",c==="horizontal"?"top-1/2 -right-12 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",t),disabled:!o,onClick:i,...s,children:[B.jsx(Ut.ArrowRight,{}),B.jsx("span",{className:"sr-only",children:"Next slide"})]})}exports.Carousel=$n;exports.CarouselContent=Kn;exports.CarouselItem=Un;exports.CarouselNext=Jn;exports.CarouselPrevious=Qn;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("react/jsx-runtime"),Y=require("react"),ht=require("./utils-CikHldDD.cjs"),Ut=require("./button-DDuNM3Ni.cjs"),Qt=require("./createLucideIcon-8yq_KgWS.cjs");function ln(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,s.get?s:{enumerable:!0,get:()=>t[e]})}}return n.default=t,Object.freeze(n)}const $=ln(Y);const fn=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],dn=Qt.createLucideIcon("arrow-left",fn);const pn=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],mn=Qt.createLucideIcon("arrow-right",pn);function gn(t){return Object.prototype.toString.call(t)==="[object Object]"}function Gt(t){return gn(t)||Array.isArray(t)}function hn(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Pt(t,n){const e=Object.keys(t),s=Object.keys(n);if(e.length!==s.length)return!1;const c=JSON.stringify(Object.keys(t.breakpoints||{})),i=JSON.stringify(Object.keys(n.breakpoints||{}));return c!==i?!1:e.every(o=>{const a=t[o],r=n[o];return typeof a=="function"?`${a}`==`${r}`:!Gt(a)||!Gt(r)?a===r:Pt(a,r)})}function _t(t){return t.concat().sort((n,e)=>n.name>e.name?1:-1).map(n=>n.options)}function Sn(t,n){if(t.length!==n.length)return!1;const e=_t(t),s=_t(n);return e.every((c,i)=>{const o=s[i];return Pt(c,o)})}function Dt(t){return typeof t=="number"}function wt(t){return typeof t=="string"}function xt(t){return typeof t=="boolean"}function $t(t){return Object.prototype.toString.call(t)==="[object Object]"}function D(t){return Math.abs(t)}function At(t){return Math.sign(t)}function dt(t,n){return D(t-n)}function yn(t,n){if(t===0||n===0||D(t)<=D(n))return 0;const e=dt(D(t),D(n));return D(e/t)}function bn(t){return Math.round(t*100)/100}function pt(t){return mt(t).map(Number)}function V(t){return t[St(t)]}function St(t){return Math.max(0,t.length-1)}function Mt(t,n){return n===St(t)}function Kt(t,n=0){return Array.from(Array(t),(e,s)=>n+s)}function mt(t){return Object.keys(t)}function Jt(t,n){return[t,n].reduce((e,s)=>(mt(s).forEach(c=>{const i=e[c],o=s[c],a=$t(i)&&$t(o);e[c]=a?Jt(i,o):o}),e),{})}function Ot(t,n){return typeof n.MouseEvent<"u"&&t instanceof n.MouseEvent}function xn(t,n){const e={start:s,center:c,end:i};function s(){return 0}function c(r){return i(r)/2}function i(r){return n-r}function o(r,u){return wt(t)?e[t](r):t(n,r,u)}return{measure:o}}function gt(){let t=[];function n(c,i,o,a={passive:!0}){let r;if("addEventListener"in c)c.addEventListener(i,o,a),r=()=>c.removeEventListener(i,o,a);else{const u=c;u.addListener(o),r=()=>u.removeListener(o)}return t.push(r),s}function e(){t=t.filter(c=>c())}const s={add:n,clear:e};return s}function vn(t,n,e,s){const c=gt(),i=1e3/60;let o=null,a=0,r=0;function u(){c.add(t,"visibilitychange",()=>{t.hidden&&f()})}function h(){y(),c.clear()}function d(g){if(!r)return;o||(o=g,e(),e());const l=g-o;for(o=g,a+=l;a>=i;)e(),a-=i;const S=a/i;s(S),r&&(r=n.requestAnimationFrame(d))}function p(){r||(r=n.requestAnimationFrame(d))}function y(){n.cancelAnimationFrame(r),o=null,a=0,r=0}function f(){o=null,a=0}return{init:u,destroy:h,start:p,stop:y,update:e,render:s}}function En(t,n){const e=n==="rtl",s=t==="y",c=s?"y":"x",i=s?"x":"y",o=!s&&e?-1:1,a=h(),r=d();function u(f){const{height:m,width:g}=f;return s?m:g}function h(){return s?"top":e?"right":"left"}function d(){return s?"bottom":e?"left":"right"}function p(f){return f*o}return{scroll:c,cross:i,startEdge:a,endEdge:r,measureSize:u,direction:p}}function ot(t=0,n=0){const e=D(t-n);function s(u){return u<t}function c(u){return u>n}function i(u){return s(u)||c(u)}function o(u){return i(u)?s(u)?t:n:u}function a(u){return e?u-e*Math.ceil((u-n)/e):u}return{length:e,max:n,min:t,constrain:o,reachedAny:i,reachedMax:c,reachedMin:s,removeOffset:a}}function Xt(t,n,e){const{constrain:s}=ot(0,t),c=t+1;let i=o(n);function o(p){return e?D((c+p)%c):s(p)}function a(){return i}function r(p){return i=o(p),d}function u(p){return h().set(a()+p)}function h(){return Xt(t,a(),e)}const d={get:a,set:r,add:u,clone:h};return d}function Ln(t,n,e,s,c,i,o,a,r,u,h,d,p,y,f,m,g,l,S){const{cross:x,direction:L}=t,O=["INPUT","SELECT","TEXTAREA"],C={passive:!1},v=gt(),E=gt(),I=ot(50,225).constrain(y.measure(20)),A={mouse:300,touch:400},T={mouse:500,touch:600},j=f?43:25;let R=!1,q=0,H=0,tt=!1,Z=!1,K=!1,U=!1;function ct(b){if(!S)return;function w(k){(xt(S)||S(b,k))&&at(k)}const M=n;v.add(M,"dragstart",k=>k.preventDefault(),C).add(M,"touchmove",()=>{},C).add(M,"touchend",()=>{}).add(M,"touchstart",w).add(M,"mousedown",w).add(M,"touchcancel",N).add(M,"contextmenu",N).add(M,"click",J,!0)}function G(){v.clear(),E.clear()}function rt(){const b=U?e:n;E.add(b,"touchmove",z,C).add(b,"touchend",N).add(b,"mousemove",z,C).add(b,"mouseup",N)}function st(b){const w=b.nodeName||"";return O.includes(w)}function Q(){return(f?T:A)[U?"mouse":"touch"]}function ut(b,w){const M=d.add(At(b)*-1),k=h.byDistance(b,!f).distance;return f||D(b)<I?k:g&&w?k*.5:h.byIndex(M.get(),0).distance}function at(b){const w=Ot(b,s);U=w,K=f&&w&&!b.buttons&&R,R=dt(c.get(),o.get())>=2,!(w&&b.button!==0)&&(st(b.target)||(tt=!0,i.pointerDown(b),u.useFriction(0).useDuration(0),c.set(o),rt(),q=i.readPoint(b),H=i.readPoint(b,x),p.emit("pointerDown")))}function z(b){if(!Ot(b,s)&&b.touches.length>=2)return N(b);const M=i.readPoint(b),k=i.readPoint(b,x),_=dt(M,q),X=dt(k,H);if(!Z&&!U&&(!b.cancelable||(Z=_>X,!Z)))return N(b);const nt=i.pointerMove(b);_>m&&(K=!0),u.useFriction(.3).useDuration(.75),a.start(),c.add(L(nt)),b.preventDefault()}function N(b){const M=h.byDistance(0,!1).index!==d.get(),k=i.pointerUp(b)*Q(),_=ut(L(k),M),X=yn(k,_),nt=j-10*X,W=l+X/50;Z=!1,tt=!1,E.clear(),u.useDuration(nt).useFriction(W),r.distance(_,!f),U=!1,p.emit("pointerUp")}function J(b){K&&(b.stopPropagation(),b.preventDefault(),K=!1)}function F(){return tt}return{init:ct,destroy:G,pointerDown:F}}function Cn(t,n){let s,c;function i(d){return d.timeStamp}function o(d,p){const f=`client${(p||t.scroll)==="x"?"X":"Y"}`;return(Ot(d,n)?d:d.touches[0])[f]}function a(d){return s=d,c=d,o(d)}function r(d){const p=o(d)-o(c),y=i(d)-i(s)>170;return c=d,y&&(s=d),p}function u(d){if(!s||!c)return 0;const p=o(c)-o(s),y=i(d)-i(s),f=i(d)-i(c)>170,m=p/y;return y&&!f&&D(m)>.1?m:0}return{pointerDown:a,pointerMove:r,pointerUp:u,readPoint:o}}function In(){function t(e){const{offsetTop:s,offsetLeft:c,offsetWidth:i,offsetHeight:o}=e;return{top:s,right:c+i,bottom:s+o,left:c,width:i,height:o}}return{measure:t}}function Tn(t){function n(s){return t*(s/100)}return{measure:n}}function wn(t,n,e,s,c,i,o){const a=[t].concat(s);let r,u,h=[],d=!1;function p(g){return c.measureSize(o.measure(g))}function y(g){if(!i)return;u=p(t),h=s.map(p);function l(S){for(const x of S){if(d)return;const L=x.target===t,O=s.indexOf(x.target),C=L?u:h[O],v=p(L?t:s[O]);if(D(v-C)>=.5){g.reInit(),n.emit("resize");break}}}r=new ResizeObserver(S=>{(xt(i)||i(g,S))&&l(S)}),e.requestAnimationFrame(()=>{a.forEach(S=>r.observe(S))})}function f(){d=!0,r&&r.disconnect()}return{init:y,destroy:f}}function On(t,n,e,s,c,i){let o=0,a=0,r=c,u=i,h=t.get(),d=0;function p(){const C=s.get()-t.get(),v=!r;let E=0;return v?(o=0,e.set(s),t.set(s),E=C):(e.set(t),o+=C/r,o*=u,h+=o,t.add(o),E=h-d),a=At(E),d=h,O}function y(){const C=s.get()-n.get();return D(C)<.001}function f(){return r}function m(){return a}function g(){return o}function l(){return x(c)}function S(){return L(i)}function x(C){return r=C,O}function L(C){return u=C,O}const O={direction:m,duration:f,velocity:g,seek:p,settled:y,useBaseFriction:S,useBaseDuration:l,useFriction:L,useDuration:x};return O}function Pn(t,n,e,s,c){const i=c.measure(10),o=c.measure(50),a=ot(.1,.99);let r=!1;function u(){return!(r||!t.reachedAny(e.get())||!t.reachedAny(n.get()))}function h(y){if(!u())return;const f=t.reachedMin(n.get())?"min":"max",m=D(t[f]-n.get()),g=e.get()-n.get(),l=a.constrain(m/o);e.subtract(g*l),!y&&D(g)<i&&(e.set(t.constrain(e.get())),s.useDuration(25).useBaseFriction())}function d(y){r=!y}return{shouldConstrain:u,constrain:h,toggleActive:d}}function Dn(t,n,e,s,c){const i=ot(-n+t,0),o=d(),a=h(),r=p();function u(f,m){return dt(f,m)<=1}function h(){const f=o[0],m=V(o),g=o.lastIndexOf(f),l=o.indexOf(m)+1;return ot(g,l)}function d(){return e.map((f,m)=>{const{min:g,max:l}=i,S=i.constrain(f),x=!m,L=Mt(e,m);return x?l:L||u(g,S)?g:u(l,S)?l:S}).map(f=>parseFloat(f.toFixed(3)))}function p(){if(n<=t+c)return[i.max];if(s==="keepSnaps")return o;const{min:f,max:m}=a;return o.slice(f,m)}return{snapsContained:r,scrollContainLimit:a}}function An(t,n,e){const s=n[0],c=e?s-t:V(n);return{limit:ot(c,s)}}function Mn(t,n,e,s){const i=n.min+.1,o=n.max+.1,{reachedMin:a,reachedMax:r}=ot(i,o);function u(p){return p===1?r(e.get()):p===-1?a(e.get()):!1}function h(p){if(!u(p))return;const y=t*(p*-1);s.forEach(f=>f.add(y))}return{loop:h}}function Nn(t){const{max:n,length:e}=t;function s(i){const o=i-n;return e?o/-e:0}return{get:s}}function kn(t,n,e,s,c){const{startEdge:i,endEdge:o}=t,{groupSlides:a}=c,r=d().map(n.measure),u=p(),h=y();function d(){return a(s).map(m=>V(m)[o]-m[0][i]).map(D)}function p(){return s.map(m=>e[i]-m[i]).map(m=>-D(m))}function y(){return a(u).map(m=>m[0]).map((m,g)=>m+r[g])}return{snaps:u,snapsAligned:h}}function jn(t,n,e,s,c,i){const{groupSlides:o}=c,{min:a,max:r}=s,u=h();function h(){const p=o(i),y=!t||n==="keepSnaps";return e.length===1?[i]:y?p:p.slice(a,r).map((f,m,g)=>{const l=!m,S=Mt(g,m);if(l){const x=V(g[0])+1;return Kt(x)}if(S){const x=St(i)-V(g)[0]+1;return Kt(x,V(g)[0])}return f})}return{slideRegistry:u}}function zn(t,n,e,s,c){const{reachedAny:i,removeOffset:o,constrain:a}=s;function r(f){return f.concat().sort((m,g)=>D(m)-D(g))[0]}function u(f){const m=t?o(f):a(f),g=n.map((S,x)=>({diff:h(S-m,0),index:x})).sort((S,x)=>D(S.diff)-D(x.diff)),{index:l}=g[0];return{index:l,distance:m}}function h(f,m){const g=[f,f+e,f-e];if(!t)return f;if(!m)return r(g);const l=g.filter(S=>At(S)===m);return l.length?r(l):V(g)-e}function d(f,m){const g=n[f]-c.get(),l=h(g,m);return{index:f,distance:l}}function p(f,m){const g=c.get()+f,{index:l,distance:S}=u(g),x=!t&&i(g);if(!m||x)return{index:l,distance:f};const L=n[l]-S,O=f+h(L,0);return{index:l,distance:O}}return{byDistance:p,byIndex:d,shortcut:h}}function Fn(t,n,e,s,c,i,o){function a(d){const p=d.distance,y=d.index!==n.get();i.add(p),p&&(s.duration()?t.start():(t.update(),t.render(1),t.update())),y&&(e.set(n.get()),n.set(d.index),o.emit("select"))}function r(d,p){const y=c.byDistance(d,p);a(y)}function u(d,p){const y=n.clone().set(d),f=c.byIndex(y.get(),p);a(f)}return{distance:r,index:u}}function Bn(t,n,e,s,c,i,o,a){const r={passive:!0,capture:!0};let u=0;function h(y){if(!a)return;function f(m){if(new Date().getTime()-u>10)return;o.emit("slideFocusStart"),t.scrollLeft=0;const S=e.findIndex(x=>x.includes(m));Dt(S)&&(c.useDuration(0),s.index(S,0),o.emit("slideFocus"))}i.add(document,"keydown",d,!1),n.forEach((m,g)=>{i.add(m,"focus",l=>{(xt(a)||a(y,l))&&f(g)},r)})}function d(y){y.code==="Tab"&&(u=new Date().getTime())}return{init:h}}function ft(t){let n=t;function e(){return n}function s(r){n=o(r)}function c(r){n+=o(r)}function i(r){n-=o(r)}function o(r){return Dt(r)?r:r.get()}return{get:e,set:s,add:c,subtract:i}}function Yt(t,n){const e=t.scroll==="x"?o:a,s=n.style;let c=null,i=!1;function o(p){return`translate3d(${p}px,0px,0px)`}function a(p){return`translate3d(0px,${p}px,0px)`}function r(p){if(i)return;const y=bn(t.direction(p));y!==c&&(s.transform=e(y),c=y)}function u(p){i=!p}function h(){i||(s.transform="",n.getAttribute("style")||n.removeAttribute("style"))}return{clear:h,to:r,toggleActive:u}}function Vn(t,n,e,s,c,i,o,a,r){const h=pt(c),d=pt(c).reverse(),p=l().concat(S());function y(v,E){return v.reduce((I,A)=>I-c[A],E)}function f(v,E){return v.reduce((I,A)=>y(I,E)>0?I.concat([A]):I,[])}function m(v){return i.map((E,I)=>({start:E-s[I]+.5+v,end:E+n-.5+v}))}function g(v,E,I){const A=m(E);return v.map(T=>{const j=I?0:-e,R=I?e:0,q=I?"end":"start",H=A[T][q];return{index:T,loopPoint:H,slideLocation:ft(-1),translate:Yt(t,r[T]),target:()=>a.get()>H?j:R}})}function l(){const v=o[0],E=f(d,v);return g(E,e,!1)}function S(){const v=n-o[0]-1,E=f(h,v);return g(E,-e,!0)}function x(){return p.every(({index:v})=>{const E=h.filter(I=>I!==v);return y(E,n)<=.1})}function L(){p.forEach(v=>{const{target:E,translate:I,slideLocation:A}=v,T=E();T!==A.get()&&(I.to(T),A.set(T))})}function O(){p.forEach(v=>v.translate.clear())}return{canLoop:x,clear:O,loop:L,loopPoints:p}}function Rn(t,n,e){let s,c=!1;function i(r){if(!e)return;function u(h){for(const d of h)if(d.type==="childList"){r.reInit(),n.emit("slidesChanged");break}}s=new MutationObserver(h=>{c||(xt(e)||e(r,h))&&u(h)}),s.observe(t,{childList:!0})}function o(){s&&s.disconnect(),c=!0}return{init:i,destroy:o}}function qn(t,n,e,s){const c={};let i=null,o=null,a,r=!1;function u(){a=new IntersectionObserver(f=>{r||(f.forEach(m=>{const g=n.indexOf(m.target);c[g]=m}),i=null,o=null,e.emit("slidesInView"))},{root:t.parentElement,threshold:s}),n.forEach(f=>a.observe(f))}function h(){a&&a.disconnect(),r=!0}function d(f){return mt(c).reduce((m,g)=>{const l=parseInt(g),{isIntersecting:S}=c[l];return(f&&S||!f&&!S)&&m.push(l),m},[])}function p(f=!0){if(f&&i)return i;if(!f&&o)return o;const m=d(f);return f&&(i=m),f||(o=m),m}return{init:u,destroy:h,get:p}}function Hn(t,n,e,s,c,i){const{measureSize:o,startEdge:a,endEdge:r}=t,u=e[0]&&c,h=f(),d=m(),p=e.map(o),y=g();function f(){if(!u)return 0;const S=e[0];return D(n[a]-S[a])}function m(){if(!u)return 0;const S=i.getComputedStyle(V(s));return parseFloat(S.getPropertyValue(`margin-${r}`))}function g(){return e.map((S,x,L)=>{const O=!x,C=Mt(L,x);return O?p[x]+h:C?p[x]+d:L[x+1][a]-S[a]}).map(D)}return{slideSizes:p,slideSizesWithGaps:y,startGap:h,endGap:d}}function Gn(t,n,e,s,c,i,o,a,r){const{startEdge:u,endEdge:h,direction:d}=t,p=Dt(e);function y(l,S){return pt(l).filter(x=>x%S===0).map(x=>l.slice(x,x+S))}function f(l){return l.length?pt(l).reduce((S,x,L)=>{const O=V(S)||0,C=O===0,v=x===St(l),E=c[u]-i[O][u],I=c[u]-i[x][h],A=!s&&C?d(o):0,T=!s&&v?d(a):0,j=D(I-T-(E+A));return L&&j>n+r&&S.push(x),v&&S.push(l.length),S},[]).map((S,x,L)=>{const O=Math.max(L[x-1]||0);return l.slice(O,S)}):[]}function m(l){return p?y(l,e):f(l)}return{groupSlides:m}}function _n(t,n,e,s,c,i,o){const{align:a,axis:r,direction:u,startIndex:h,loop:d,duration:p,dragFree:y,dragThreshold:f,inViewThreshold:m,slidesToScroll:g,skipSnaps:l,containScroll:S,watchResize:x,watchSlides:L,watchDrag:O,watchFocus:C}=i,v=2,E=In(),I=E.measure(n),A=e.map(E.measure),T=En(r,u),j=T.measureSize(I),R=Tn(j),q=xn(a,j),H=!d&&!!S,tt=d||!!S,{slideSizes:Z,slideSizesWithGaps:K,startGap:U,endGap:ct}=Hn(T,I,A,e,tt,c),G=Gn(T,j,g,d,I,A,U,ct,v),{snaps:rt,snapsAligned:st}=kn(T,q,I,A,G),Q=-V(rt)+V(K),{snapsContained:ut,scrollContainLimit:at}=Dn(j,Q,st,S,v),z=H?ut:st,{limit:N}=An(Q,z,d),J=Xt(St(z),h,d),F=J.clone(),P=pt(e),b=({dragHandler:it,scrollBody:It,scrollBounds:Tt,options:{loop:yt}})=>{yt||Tt.constrain(it.pointerDown()),It.seek()},w=({scrollBody:it,translate:It,location:Tt,offsetLocation:yt,previousLocation:nn,scrollLooper:en,slideLooper:on,dragHandler:rn,animation:sn,eventHandler:Ft,scrollBounds:cn,options:{loop:Bt}},Vt)=>{const Rt=it.settled(),un=!cn.shouldConstrain(),qt=Bt?Rt:Rt&&un,Ht=qt&&!rn.pointerDown();Ht&&sn.stop();const an=Tt.get()*Vt+nn.get()*(1-Vt);yt.set(an),Bt&&(en.loop(it.direction()),on.loop()),It.to(yt.get()),Ht&&Ft.emit("settle"),qt||Ft.emit("scroll")},M=vn(s,c,()=>b(Ct),it=>w(Ct,it)),k=.68,_=z[J.get()],X=ft(_),nt=ft(_),W=ft(_),et=ft(_),lt=On(X,W,nt,et,p,k),Et=zn(d,z,Q,N,et),Lt=Fn(M,J,F,lt,Et,et,o),kt=Nn(N),jt=gt(),Wt=qn(n,e,o,m),{slideRegistry:zt}=jn(H,S,z,at,G,P),tn=Bn(t,e,zt,Lt,lt,jt,o,C),Ct={ownerDocument:s,ownerWindow:c,eventHandler:o,containerRect:I,slideRects:A,animation:M,axis:T,dragHandler:Ln(T,t,s,c,et,Cn(T,c),X,M,Lt,lt,Et,J,o,R,y,f,l,k,O),eventStore:jt,percentOfView:R,index:J,indexPrevious:F,limit:N,location:X,offsetLocation:W,previousLocation:nt,options:i,resizeHandler:wn(n,o,c,e,T,x,E),scrollBody:lt,scrollBounds:Pn(N,W,et,lt,R),scrollLooper:Mn(Q,N,W,[X,W,nt,et]),scrollProgress:kt,scrollSnapList:z.map(kt.get),scrollSnaps:z,scrollTarget:Et,scrollTo:Lt,slideLooper:Vn(T,j,Q,Z,K,rt,z,W,e),slideFocus:tn,slidesHandler:Rn(n,o,L),slidesInView:Wt,slideIndexes:P,slideRegistry:zt,slidesToScroll:G,target:et,translate:Yt(T,n)};return Ct}function $n(){let t={},n;function e(u){n=u}function s(u){return t[u]||[]}function c(u){return s(u).forEach(h=>h(n,u)),r}function i(u,h){return t[u]=s(u).concat([h]),r}function o(u,h){return t[u]=s(u).filter(d=>d!==h),r}function a(){t={}}const r={init:e,emit:c,off:o,on:i,clear:a};return r}const Kn={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function Un(t){function n(i,o){return Jt(i,o||{})}function e(i){const o=i.breakpoints||{},a=mt(o).filter(r=>t.matchMedia(r).matches).map(r=>o[r]).reduce((r,u)=>n(r,u),{});return n(i,a)}function s(i){return i.map(o=>mt(o.breakpoints||{})).reduce((o,a)=>o.concat(a),[]).map(t.matchMedia)}return{mergeOptions:n,optionsAtMedia:e,optionsMediaQueries:s}}function Qn(t){let n=[];function e(i,o){return n=o.filter(({options:a})=>t.optionsAtMedia(a).active!==!1),n.forEach(a=>a.init(i,t)),o.reduce((a,r)=>Object.assign(a,{[r.name]:r}),{})}function s(){n=n.filter(i=>i.destroy())}return{init:e,destroy:s}}function bt(t,n,e){const s=t.ownerDocument,c=s.defaultView,i=Un(c),o=Qn(i),a=gt(),r=$n(),{mergeOptions:u,optionsAtMedia:h,optionsMediaQueries:d}=i,{on:p,off:y,emit:f}=r,m=T;let g=!1,l,S=u(Kn,bt.globalOptions),x=u(S),L=[],O,C,v;function E(){const{container:P,slides:b}=x;C=(wt(P)?t.querySelector(P):P)||t.children[0];const M=wt(b)?C.querySelectorAll(b):b;v=[].slice.call(M||C.children)}function I(P){const b=_n(t,C,v,s,c,P,r);if(P.loop&&!b.slideLooper.canLoop()){const w=Object.assign({},P,{loop:!1});return I(w)}return b}function A(P,b){g||(S=u(S,P),x=h(S),L=b||L,E(),l=I(x),d([S,...L.map(({options:w})=>w)]).forEach(w=>a.add(w,"change",T)),x.active&&(l.translate.to(l.location.get()),l.animation.init(),l.slidesInView.init(),l.slideFocus.init(F),l.eventHandler.init(F),l.resizeHandler.init(F),l.slidesHandler.init(F),l.options.loop&&l.slideLooper.loop(),C.offsetParent&&v.length&&l.dragHandler.init(F),O=o.init(F,L)))}function T(P,b){const w=G();j(),A(u({startIndex:w},P),b),r.emit("reInit")}function j(){l.dragHandler.destroy(),l.eventStore.clear(),l.translate.clear(),l.slideLooper.clear(),l.resizeHandler.destroy(),l.slidesHandler.destroy(),l.slidesInView.destroy(),l.animation.destroy(),o.destroy(),a.clear()}function R(){g||(g=!0,a.clear(),j(),r.emit("destroy"),r.clear())}function q(P,b,w){!x.active||g||(l.scrollBody.useBaseFriction().useDuration(b===!0?0:x.duration),l.scrollTo.index(P,w||0))}function H(P){const b=l.index.add(1).get();q(b,P,-1)}function tt(P){const b=l.index.add(-1).get();q(b,P,1)}function Z(){return l.index.add(1).get()!==G()}function K(){return l.index.add(-1).get()!==G()}function U(){return l.scrollSnapList}function ct(){return l.scrollProgress.get(l.offsetLocation.get())}function G(){return l.index.get()}function rt(){return l.indexPrevious.get()}function st(){return l.slidesInView.get()}function Q(){return l.slidesInView.get(!1)}function ut(){return O}function at(){return l}function z(){return t}function N(){return C}function J(){return v}const F={canScrollNext:Z,canScrollPrev:K,containerNode:N,internalEngine:at,destroy:R,off:y,on:p,emit:f,plugins:ut,previousScrollSnap:rt,reInit:m,rootNode:z,scrollNext:H,scrollPrev:tt,scrollProgress:ct,scrollSnapList:U,scrollTo:q,selectedScrollSnap:G,slideNodes:J,slidesInView:st,slidesNotInView:Q};return A(n,e),setTimeout(()=>r.emit("init"),0),F}bt.globalOptions=void 0;function Nt(t={},n=[]){const e=Y.useRef(t),s=Y.useRef(n),[c,i]=Y.useState(),[o,a]=Y.useState(),r=Y.useCallback(()=>{c&&c.reInit(e.current,s.current)},[c]);return Y.useEffect(()=>{Pt(e.current,t)||(e.current=t,r())},[t,r]),Y.useEffect(()=>{Sn(s.current,n)||(s.current=n,r())},[n,r]),Y.useEffect(()=>{if(hn()&&o){bt.globalOptions=Nt.globalOptions;const u=bt(o,e.current,s.current);return i(u),()=>u.destroy()}else i(void 0)},[o,i]),[a,c]}Nt.globalOptions=void 0;const Zt=$.createContext(null);function vt(){const t=$.useContext(Zt);if(!t)throw new Error("useCarousel must be used within a <Carousel />");return t}function Jn({orientation:t="horizontal",opts:n,setApi:e,plugins:s,className:c,children:i,...o}){const[a,r]=Nt({...n,axis:t==="horizontal"?"x":"y"},s),[u,h]=$.useState(!1),[d,p]=$.useState(!1),y=$.useCallback(l=>{l&&(h(l.canScrollPrev()),p(l.canScrollNext()))},[]),f=$.useCallback(()=>{r?.scrollPrev()},[r]),m=$.useCallback(()=>{r?.scrollNext()},[r]),g=$.useCallback(l=>{l.key==="ArrowLeft"?(l.preventDefault(),f()):l.key==="ArrowRight"&&(l.preventDefault(),m())},[f,m]);return $.useEffect(()=>{!r||!e||e(r)},[r,e]),$.useEffect(()=>{if(r)return y(r),r.on("reInit",y),r.on("select",y),()=>{r?.off("select",y)}},[r,y]),B.jsx(Zt.Provider,{value:{carouselRef:a,api:r,opts:n,orientation:t||(n?.axis==="y"?"vertical":"horizontal"),scrollPrev:f,scrollNext:m,canScrollPrev:u,canScrollNext:d},children:B.jsx("div",{onKeyDownCapture:g,className:ht.cn("relative",c),role:"region","aria-roledescription":"carousel","data-slot":"carousel",...o,children:i})})}function Xn({className:t,...n}){const{carouselRef:e,orientation:s}=vt();return B.jsx("div",{ref:e,className:"overflow-hidden","data-slot":"carousel-content",children:B.jsx("div",{className:ht.cn("flex",s==="horizontal"?"-ml-4":"-mt-4 flex-col",t),...n})})}function Yn({className:t,...n}){const{orientation:e}=vt();return B.jsx("div",{role:"group","aria-roledescription":"slide","data-slot":"carousel-item",className:ht.cn("min-w-0 shrink-0 grow-0 basis-full",e==="horizontal"?"pl-4":"pt-4",t),...n})}function Zn({className:t,variant:n="outline",size:e="icon",...s}){const{orientation:c,scrollPrev:i,canScrollPrev:o}=vt();return B.jsxs(Ut.Button,{"data-slot":"carousel-previous",variant:n,size:e,className:ht.cn("absolute size-8 rounded-full",c==="horizontal"?"top-1/2 -left-12 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",t),disabled:!o,onClick:i,...s,children:[B.jsx(dn,{}),B.jsx("span",{className:"sr-only",children:"Previous slide"})]})}function Wn({className:t,variant:n="outline",size:e="icon",...s}){const{orientation:c,scrollNext:i,canScrollNext:o}=vt();return B.jsxs(Ut.Button,{"data-slot":"carousel-next",variant:n,size:e,className:ht.cn("absolute size-8 rounded-full",c==="horizontal"?"top-1/2 -right-12 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",t),disabled:!o,onClick:i,...s,children:[B.jsx(mn,{}),B.jsx("span",{className:"sr-only",children:"Next slide"})]})}exports.Carousel=Jn;exports.CarouselContent=Xn;exports.CarouselItem=Yn;exports.CarouselNext=Wn;exports.CarouselPrevious=Zn;
|