@udixio/ui-react 0.1.2 → 0.2.0
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 +0 -10
- package/dist/index.cjs +2 -2
- package/dist/index.js +1164 -1181
- package/dist/lib/components/Button.d.ts +4 -2
- package/dist/lib/components/Button.d.ts.map +1 -1
- package/dist/lib/components/Card.d.ts +5 -0
- package/dist/lib/components/Card.d.ts.map +1 -1
- package/dist/lib/components/Carousel.d.ts +6 -0
- package/dist/lib/components/Carousel.d.ts.map +1 -1
- package/dist/lib/components/CarouselItem.d.ts +4 -0
- package/dist/lib/components/CarouselItem.d.ts.map +1 -1
- package/dist/lib/components/{Divided.d.ts → Divider.d.ts} +6 -1
- package/dist/lib/components/Divider.d.ts.map +1 -0
- package/dist/lib/components/Fab.d.ts +5 -0
- package/dist/lib/components/Fab.d.ts.map +1 -1
- package/dist/lib/components/IconButton.d.ts +6 -1
- package/dist/lib/components/IconButton.d.ts.map +1 -1
- package/dist/lib/components/NavigationRail.d.ts +5 -0
- package/dist/lib/components/NavigationRail.d.ts.map +1 -1
- package/dist/lib/components/NavigationRailItem.d.ts +8 -0
- package/dist/lib/components/NavigationRailItem.d.ts.map +1 -1
- package/dist/lib/components/ProgressIndicator.d.ts +4 -0
- package/dist/lib/components/ProgressIndicator.d.ts.map +1 -1
- package/dist/lib/components/Slider.d.ts +5 -0
- package/dist/lib/components/Slider.d.ts.map +1 -1
- package/dist/lib/components/Snackbar.d.ts +5 -0
- package/dist/lib/components/Snackbar.d.ts.map +1 -1
- package/dist/lib/components/Switch.d.ts +5 -0
- package/dist/lib/components/Switch.d.ts.map +1 -1
- package/dist/lib/components/Tab.d.ts +4 -0
- package/dist/lib/components/Tab.d.ts.map +1 -1
- package/dist/lib/components/Tabs.d.ts +5 -0
- package/dist/lib/components/Tabs.d.ts.map +1 -1
- package/dist/lib/components/TextField.d.ts +5 -0
- package/dist/lib/components/TextField.d.ts.map +1 -1
- package/dist/lib/components/ToolTip.d.ts +5 -0
- package/dist/lib/components/ToolTip.d.ts.map +1 -1
- package/dist/lib/components/index.d.ts +1 -1
- package/dist/lib/effects/SyncedFixedWrapper.d.ts.map +1 -1
- package/dist/lib/interfaces/button.interface.d.ts +5 -0
- package/dist/lib/interfaces/button.interface.d.ts.map +1 -1
- package/dist/lib/interfaces/icon-button.interface.d.ts +1 -1
- package/dist/lib/interfaces/icon-button.interface.d.ts.map +1 -1
- package/dist/lib/styles/button.style.d.ts +14 -4
- package/dist/lib/styles/button.style.d.ts.map +1 -1
- package/dist/lib/styles/icon-button.style.d.ts +4 -4
- package/package.json +2 -2
- package/src/lib/components/Button.tsx +42 -15
- package/src/lib/components/Card.tsx +5 -0
- package/src/lib/components/Carousel.tsx +12 -6
- package/src/lib/components/CarouselItem.tsx +6 -1
- package/src/lib/components/{Divided.tsx → Divider.tsx} +5 -0
- package/src/lib/components/Fab.tsx +6 -1
- package/src/lib/components/IconButton.tsx +12 -7
- package/src/lib/components/NavigationRail.tsx +40 -41
- package/src/lib/components/NavigationRailItem.tsx +8 -0
- package/src/lib/components/ProgressIndicator.tsx +8 -2
- package/src/lib/components/Slider.tsx +5 -0
- package/src/lib/components/Snackbar.tsx +7 -2
- package/src/lib/components/Switch.tsx +5 -0
- package/src/lib/components/Tab.tsx +4 -0
- package/src/lib/components/Tabs.tsx +8 -3
- package/src/lib/components/TextField.tsx +8 -3
- package/src/lib/components/ToolTip.tsx +8 -8
- package/src/lib/components/index.ts +1 -1
- package/src/lib/effects/SyncedFixedWrapper.tsx +0 -2
- package/src/lib/interfaces/button.interface.ts +6 -0
- package/src/lib/interfaces/icon-button.interface.ts +1 -1
- package/src/lib/styles/button.style.ts +27 -48
- package/dist/lib/components/Divided.d.ts.map +0 -1
package/CHANGELOG.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),se=require("clsx"),Be=require("tailwind-merge"),c=require("react"),R=require("motion/react"),Pe=require("throttle-debounce"),De=require("react-dom"),We=require("react-textarea-autosize"),le=Be.extendTailwindMerge({override:{classGroups:{"text-color":[{text:[e=>!e.startsWith("display-")&&!e.startsWith("headline-")&&!e.startsWith("title-")&&!e.startsWith("body-")&&!e.startsWith("label-")]}]}},extend:{classGroups:{font:[{text:[e=>e.startsWith("display-")||e.startsWith("headline-")||e.startsWith("title-")||e.startsWith("body-")||e.startsWith("label-")]}]},conflictingClassGroups:{font:["font"]}}}),d=(...e)=>le(se.clsx(e)),oe=(...e)=>le(se.clsx(e));function $e(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}const ae=e=>{const t={};e.classNameList.forEach(r=>{var s;if(r)if(typeof r=="string")(t[s=e.default]??(t[s]=[])).push(r);else{const u=r(e.states);Object.entries(u).map(l=>{const[i,m]=l;(t[i]??(t[i]=[])).push(m)})}});const n=t;return Object.entries(t).map(r=>{let[s,u]=r;u=u.reverse(),s==e.default&&u.unshift("relative"),u.unshift($e(s)),n[s]=oe(...u)}),n},X=(e,t)=>n=>ae({classNameList:[n.className,t],default:e,states:n}),ce=X("button",({variant:e,disabled:t,iconPosition:n,icon:r,loading:s,shape:u,size:l,allowShapeTransformation:i})=>({button:d("group flex items-center cursor-pointer",l==="xSmall"&&"py-2",l==="small"&&"py-1",e==="text"&&[l==="xSmall"&&"-my-2",l==="small"&&"-my-1"]),container:d(" relative outline-none overflow-hidden inline-block flex justify-center items-center ",l==="xSmall"&&"text-label-large px-3 py-1.5 gap-1",l==="small"&&"text-label-large px-4 py-2.5 gap-2",l==="medium"&&"text-title-medium px-6 py-4 gap-2",l==="large"&&"text-headline-small px-12 py-8 gap-3",l==="xLarge"&&"text-headline-large px-16 py-12 gap-4",u==="rounded"&&{"rounded-[30px]":l==="xSmall"||l=="small","rounded-[40px]":l==="medium","rounded-[70px]":l==="large"||l=="xLarge"},u==="squared"&&{"rounded-[12px]":l==="xSmall"||l=="small","rounded-[16px]":l==="medium","rounded-[28px]":l==="large"||l=="xLarge"},i&&!t&&{"group-active:rounded-[12px]":l==="xSmall"||l=="small","group-active:rounded-[16px]":l==="medium","group-active:rounded-[28px]":l==="large"||l=="xLarge"},e==="elevated"&&{"bg-surface-container-low shadow-1 hover:shadow-2":!t},e==="filled"&&{"bg-primary hover:shadow-1":!t},e==="filledTonal"&&{"bg-secondary-container hover:shadow-1":!t},e==="outlined"&&[" border",{"border-on-surface/[0.12]":t," border-outline focus:border-primary":!t}],e==="text"&&["w-fit",{"text-primary":!t,"text-on-surface/[0.38]":t},l==="xSmall"&&"-mx-3 ",l==="small"&&"-mx-4 ",l==="medium"&&"-mx-6 ",l==="large"&&"-mx-12",l==="xLarge"&&"-mx-16 "],t&&"cursor-default"),stateLayer:d("state-layer min-h-full min-w-full absolute top-0 left-0 ",e==="elevated"&&{"bg-on-surface/[0.12]":t,"group-state-primary":!t},e==="filled"&&{"bg-on-surface/[0.12]":t,"group-state-on-primary":!t},e==="filledTonal"&&{"bg-on-surface/[0.12]":t,"group-state-on-secondary-container ":!t},e==="outlined"&&{"group-state-primary group-state-primary":!t},e==="text"&&{"group-state-primary":!t}),label:d({invisible:s},e==="elevated"&&{"text-primary":!t,"text-on-surface/[38%]":t},e==="filled"&&{"text-on-primary":!t,"text-on-surface/[38%]":t},e==="filledTonal"&&{"text-on-secondary-container":!t,"text-on-surface/[0.38]":t},e==="outlined"&&{"text-primary":!t,"text-on-surface/[0.38]":t},e==="text"&&{"text-primary":!t,"text-on-surface/[0.38]":t}),icon:d({invisible:s},l==="xSmall"&&"size-5",l==="small"&&"size-5",l==="medium"&&"size-6",l==="large"&&"size-8",l==="xLarge"&&"size-10",e==="elevated"&&{"text-primary":!t,"text-on-surface/[38%]":t},e==="filled"&&{"text-on-primary":!t,"text-on-surface/[38%]":t},e==="filledTonal"&&{"text-on-secondary-container":!t,"text-on-surface/[0.38]":t},e==="outlined"&&{"text-primary":!t,"text-on-surface/[0.38]":t},e==="text"&&{"text-primary":!t,"text-on-surface/[0.38]":t})})),ie=X("card",({variant:e,isInteractive:t})=>({card:d("card group/card rounded-xl overflow-hidden z-10",e==="outlined"&&"bg-surface",e==="elevated"&&"bg-surface-container-low shadow-1",e==="filled"&&"bg-surface-container-highest",e!=="filled"&&"border border-outline-variant"),stateLayer:d(["w-full top-0 left-0 h-full absolute -z-10",{" group-hover/card:hover-state-on-surface group-focus-visible/card:focus-state-on-surface":t}])})),ue=X("carouselItem",()=>({carouselItem:d("rounded-[28px] overflow-hidden flex-none")})),fe=X("carousel",()=>({carousel:d(["w-full h-[400px]"]),track:d("grid grid-flow-col h-full transition-transform ease-out w-fit")})),de=X("divider",({orientation:e})=>({divider:d("border-outline-variant ",{"h-fit w-full border-t":e==="horizontal"},{"h-auto self-stretch w-fit border-l":e==="vertical"})})),me=X("fab",({size:e,variant:t,isExtended:n})=>({fab:d("flex shadow-3 hover:shadow-4 group overflow-hidden outline-none items-center cursor-pointer",{"rounded-[12px]":e=="small"&&!n,"rounded-[16px]":e=="medium"||n,"rounded-[28px]":e=="large"&&!n},{"p-2":e=="small"&&!n,"p-4":e=="medium"||n,"p-[30px]":e=="large"&&!n},t==="surface"&&"bg-surface-container",t==="primary"&&"bg-primary-container",t==="secondary"&&"bg-secondary-container",t==="tertiary"&&"bg-tertiary-container"),stateLayer:d("absolute w-full h-full overflow-hidden left-1/2 top-1/2 transform -translate-y-1/2 -translate-x-1/2",t==="surface"&&"group-hover:hover-state-primary group-focus:focus-state-primary",t==="primary"&&"group-hover:hover-state-on-primary-container group-focus-visible:focus-state-on-primary-container",t==="secondary"&&"group-hover:hover-state-on-secondary-container group-focus-visible:focus-state-on-secondary-container",t==="tertiary"&&"group-hover:hover-state-on-tertiary-container group-focus-visible:focus-state-on-tertiary-container"),icon:d({"size-6":e=="small"||e=="medium"||n,"size-9":e=="large"&&!n},t==="surface"&&"text-primary",t==="primary"&&"text-on-primary-container",t==="secondary"&&"text-on-secondary-container",t==="tertiary"&&"text-on-tertiary-container"),label:d("text-title-medium text-nowrap",t==="surface"&&"text-primary",t==="primary"&&"text-on-primary-container",t==="secondary"&&"text-on-secondary-container",t==="tertiary"&&"text-on-tertiary-container")})),pe=X("iconButton",({variant:e,disabled:t,onToggle:n,isActive:r,size:s,width:u,shape:l,allowShapeTransformation:i})=>({iconButton:d("group min-h-12 flex items-center cursor-pointer",{"cursor-default":t}),container:d("rounded-full relative flex overflow-hidden transition-all duration-300",(l==="rounded"||l==="squared"&&n&&!t&&r&&i)&&{"rounded-[30px]":s==="xSmall"||s=="small","rounded-[40px]":s==="medium","rounded-[70px]":s==="large"||s=="xLarge"},(l==="squared"||l==="rounded"&&n&&!t&&r&&i)&&{"rounded-[12px]":s==="xSmall"||s=="small","rounded-[16px]":s==="medium","rounded-[28px]":s==="large"||s=="xLarge"},i&&!t&&{"group-active:rounded-[12px]":s==="xSmall"||s=="small","group-active:rounded-[16px]":s==="medium","group-active:rounded-[28px]":s==="large"||s=="xLarge"},e==="filled"&&[!t&&{"bg-surface-container":!r&&!!n,"bg-primary":r||!n},!!t&&"bg-on-surface/[0.12]"],e==="tonal"&&[!t&&{"bg-surface-container":!r&&!!n,"bg-secondary-container":r||!n},!!t&&"bg-on-surface/[0.12]"],e==="outlined"&&[!t&&{"border border-outline":!r,"border border-transparent bg-inverse-surface":r},!!t&&{"border border-on-surface/[0.12]":!r,"border border-transparent bg-on-surface/[0.12]":r}]),stateLayer:d("absolute top-0 left-0 h-full w-full ",!t&&[e==="standard"&&{"state-on-surface-variant":!r,"state-primary":r},e==="filled"&&{"state-primary":!r&&!!n,"state-inverse-on-surface":r||!n},e==="tonal"&&{"state-on-surface-variant":!r&&!!n,"state-on-secondary-container":r||!n},e==="outlined"&&{"state-on-surface-variant":!r,"state-on-primary":r}]),icon:d(" transition-all duration-300",{"size-5 p-1.5":s==="xSmall"},{"size-6 p-2":s==="small"},{"size-6 p-4":s==="medium"},{"size-8 p-8":s==="large"},{"size-10 p-12":s==="xLarge"},u=="narrow"&&[{"px-1":s==="xSmall"},{"px-1":s==="small"},{"px-3":s==="medium"},{"px-4":s==="large"},{"px-8":s==="xLarge"}],u=="wide"&&[{"px-2.5":s==="xSmall"},{"px-3.5":s==="small"},{"px-6":s==="medium"},{"px-12":s==="large"},{"px-[72px]":s==="xLarge"}],!t&&[e==="standard"&&{"text-on-surface-variant":!r,"text-primary":r},e==="filled"&&{"text-primary":!r&&!!n,"text-on-primary":r||!n},e==="tonal"&&{"text-on-surface-variant":!r&&!!n,"text-on-secondary-container":r||!n},e==="outlined"&&{"text-on-surface-variant":!r,"text-inverse-on-surface":r}],!!t&&"text-on-surface/[0.38]")})),he=X("progressIndicator",({variant:e,isVisible:t})=>({progressIndicator:d((e==="linear-determinate"||e=="linear-indeterminate")&&"flex w-full"),track:"h-full rounded-full bg-primary rounded-l-full",activeIndicator:d((e==="linear-determinate"||e=="linear-indeterminate")&&"h-full flex-1 rounded-full bg-primary-container",(e==="circular-determinate"||e=="circular-indeterminate")&&["stroke-primary fill-transparent ",{"stroke-[4px]":t,"stroke-[0px]":!t}]),stop:"absolute right-0 bg-primary rounded-full"})),xe=X("slider",({isChanging:e})=>({slider:d(["relative w-full h-11 flex items-center rounded gap-x-1.5 cursor-pointer"]),activeTrack:d(["h-4 relative transition-all duration-100 bg-primary overflow-hidden rounded-l-full "]),inactiveTrack:d(["h-4 relative transition-all duration-100 bg-primary-container rounded-r-full overflow-hidden"]),handle:d(["transform transition-all duration-100 bg-primary h-full rounded-full ",{"w-0.5":e,"w-1":!e}]),valueIndicator:d(["absolute select-none bg-inverse-surface text-inverse-on-surface py-3 px-4 text-label-large rounded-full bottom-[calc(100%+4px)] transform left-1/2 -translate-x-1/2"]),dot:d(["h-1 w-1 absolute transform -translate-y-1/2 -translate-x-1/2 top-1/2 rounded-full"])})),ye=X("snackbar",()=>({snackbar:d(" rounded bg-inverse-surface "),container:d("pl-4 pr-2 max-w-full py-1 flex items-center flex-wrap"),supportingText:d("text-body-medium text-inverse-on-surface "),icon:d(" ml-auto mr-0 text-inverse-on-surface block dark")})),ge=X("switch",({isSelected:e,disabled:t,inactiveIcon:n})=>({switch:d("group w-[52px] h-[32px] outline-none rounded-full border-2 flex items-center",{"bg-on-surface/[0.12] border-transparent":t},!t&&["cursor-pointer ",{"bg-primary border-primary":e},{"bg-surface-container border-outline":!e}]),handleContainer:d("flex items-center justify-center absolute",{"left-[14px]":!e},{"right-[14px]":e}),handle:d("transition-all duration-100 z-10 rounded-full flex items-center justify-center",{"w-[16px] h-[16px]":!e&&!n},{"w-[24px] h-[24px]":!(!e&&!n)},!t&&["cursor-pointer group-active:h-[28px] group-active:w-[28px]",{"bg-on-primary group-hover:bg-primary-container":e},{"bg-outline group-hover:bg-on-surface-variant":!e}],{"bg-surface":t}),handleStateLayer:d("w-[40px] h-[40px] -z-10 rounded-full absolute",{"group-state-primary":!t}),icon:d("w-[16px] h-[16px]",!t&&[{"text-on-primary-container":e},{"text-on-primary":!e}],{"text-on-surface/[0.38]":t})})),we=X("tab",({isSelected:e,icon:t,label:n,variant:r})=>({tab:d("bg-surface flex-1 group outline-none flex px-4 justify-center items-center cursor-pointer",{"z-10":e},!!(t&&n)&&r==="primary"&&"h-16",!(t&&n&&r==="primary")&&"h-12"),stateLayer:d("absolute w-full h-full overflow-hidden left-1/2 top-1/2 transform -translate-y-1/2 -translate-x-1/2",r==="primary"&&{"group-hover:hover-state-on-surface group-focus-visible:focus-state-on-surface":!e,"group-hover:hover-state-primary group-focus-visible:focus-state-primary":e},r==="secondary"&&"group-hover:hover-state-on-surface group-focus-visible:focus-state-on-surface"),content:d("flex gap-0.5 h-full justify-center",{relative:r=="primary"},{"":!!(n&&!t)},r==="primary"&&"flex-col items-center",r==="secondary"&&{"flex-col items-center":!(n&&t),"flex-row items-center gap-2":!!(n&&t)}),icon:d("h-6 w-6 p-0.5 !box-border",r==="primary"&&{"text-on-surface-variant":!e,"text-primary":e},r==="secondary"&&{"text-on-surface-variant":!e,"text-on-surface":e}),label:d("text-title-small text-nowrap",r==="primary"&&{"text-on-surface-variant":!e,"text-primary":e},r==="secondary"&&{"text-on-surface-variant":!e,"text-on-surface":e}),underline:d("bg-primary absolute w-full left-0 bottom-0",r==="primary"&&"h-[3px] rounded-t",r==="secondary"&&"h-0.5")})),ve=X("tabs",({scrollable:e})=>({tabs:d("border-b border-surface-container-highest","flex relative ",{"overflow-x-auto":e})})),be=X("textField",({disabled:e,leadingIcon:t,trailingIcon:n,variant:r,errorText:s,isFocused:u,value:l,suffix:i,textLine:m})=>({textField:d({"opacity-[.38]":e}),content:d("group transition-border duration-200 relative flex items-center ",{"h-14":m=="singleLine"},{"border-on-surface-variant":!(s!=null&&s.length)&&!u&&r=="filled","border-outline":!(s!=null&&s.length)&&!u&&r=="outlined","border-primary":!(s!=null&&s.length)&&u,"border-error":!!(s!=null&&s.length)},{"bg-on-surface/[0.04]":e},r=="filled"&&["rounded-t overflow-hidden border-b",{"bg-surface-container-highest":!e}],r=="outlined"&&["border rounded box-border",{"border-[3px]":u}]),stateLayer:d("absolute -z-10 w-full h-full top-0 left-0",{hidden:r=="outlined"},{"group-state-on-surface":!e,"focus-state-on-surface":u}),label:d("inline-flex outline-none whitespace-nowrap",{"text-on-surface-variant":!e&&!(s!=null&&s.length)},{"text-on-surface":e},{"text-error":!!(s!=null&&s.length)},{"text-primary":!(s!=null&&s.length)&&u}),input:d("w-full resize-none px-4 text-body-large bg-[inherit] outline-none autofill:transition-colors autofill:duration-[5000000ms]",{" text-on-surface placeholder:text-on-surface-variant":!e,"placeholder:text-on-surface text-on-surface":e},{"pr-0":!!i},r=="filled"&&" pb-2 pt-6",r=="outlined"&&"py-4 relative z-10"),activeIndicator:d("absolute w-0 inset-x-0 border-rounded mx-auto bottom-0",r=="filled"&&["h-[2px] transition-all duration-300",{"bg-primary":!(s!=null&&s.length)},{"bg-error":!!(s!=null&&s.length)},{"!w-full":u}]),supportingText:d(" text-body-small px-4 pt-1",{"text-on-surface-variant":!e&&!(s!=null&&s.length)},{"text-on-surface":e},{"!w-full":u},{"text-error":!!(s!=null&&s.length)}),leadingIcon:d(["h-12 ml-3 flex items-center justify-center",{"cursor-text":!c.isValidElement(t)}]),trailingIcon:d("h-12 w-12 flex items-center justify-center",{"cursor-text":!c.isValidElement(n)}),suffix:d("text-on-surface-variant pl-0 pr-4",r=="filled"&&" pb-2 pt-6",r=="outlined"&&"py-4 relative z-10")})),je=X("toolTip",({position:e,variant:t})=>({toolTip:d(" pointer-events-auto w-max z-10 absolute m-1 w-max-content max-w-[312px]",{"bottom-full left-1/2 -translate-x-1/2":e=="top","top-full left-1/2 -translate-x-1/2":e=="bottom","right-full top-1/2 -translate-y-1/2":e=="left","left-full top-1/2 -translate-y-1/2":e=="right","bottom-full right-full":e=="top-left","bottom-full left-full":e=="top-right","top-full right-full":e=="bottom-left","top-full left-full":e=="bottom-right"}),container:d("pb-2",t=="rich"&&"bg-surface-container rounded-2xl text-on-surface-container px-4 pt-3 shadow-2",t=="plain"&&"bg-inverse-surface rounded text-inverse-on-surface px-2 py-1"),actions:d("flex gap-10 px-1 mt-2",t=="plain"&&"hidden"),subHead:d("text-title-small mb-1",t=="plain"&&"hidden"),supportingText:d("")})),H=({icon:e,colors:t=[],className:n})=>{const{icon:r}=e,[s,u,,,l]=r||[],i=m=>{switch(m.length){case 2:return{"--fa-primary-color":m[0]||"inherit","--fa-secondary-color":m[1]||"inherit"};case 1:return{color:m[0]};default:return{}}};return o.jsx("svg",{className:d("size-5 box-content",n),style:{...i(t)},xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${s} ${u}`,role:"img","aria-hidden":"true",children:typeof l=="string"?o.jsx("path",{className:"fill-current",d:l}):l.map((m,f)=>o.jsx("path",{d:m},f))})},Ne=({variant:e="linear-determinate",minHeight:t=4,value:n=0,transitionDuration:r=1e3,className:s,...u})=>{const[l,i]=c.useState(n),[m,f]=c.useState(1.5);c.useEffect(()=>{n>100&&(n=100),n<0&&(n=0),i(n)},[n]);const[w,v]=c.useState(!0),a=()=>w?m:m*.5;c.useEffect(()=>{if((e==="circular-indeterminate"||e==="linear-indeterminate")&&l!==100){const S=setInterval(()=>{i(w?10:90),v(!w)},a()*1e3);return()=>clearInterval(S)}},[e,w,l]);const[h,b]=c.useState(!1);c.useEffect(()=>{if(l>=100){const S=setTimeout(()=>{b(!1)},r);return()=>{clearTimeout(S)}}else b(!0)},[l,r]);const j=he({className:s,variant:e,value:n,transitionDuration:r,isVisible:h,minHeight:t});return o.jsxs(o.Fragment,{children:[(e==="linear-determinate"||e=="linear-indeterminate")&&o.jsxs("div",{style:{height:`${t}px`},className:j.progressIndicator,...u,children:[o.jsx("div",{style:{height:h?`${t}px`:"0px",width:`${l}%`,transition:`width 1ms ease-in-out ${l==100?", height 200ms 0.5s ease-in-out":""}`},className:j.track}),o.jsx("div",{style:{height:h?`${t}px`:"0px",marginLeft:l!=100?"6px":"0px",transition:`width ${r}ms ease-in-out ${l==100?`, height 200ms 0.5s ease-in-out, margin-left ${r}ms ${r/1.5}ms`:""}`},className:j.activeIndicator}),o.jsx("div",{style:{height:h?`${t}px`:"0px",width:`${t}px`,transition:`width ${r}ms ease-in-out, height 200ms 0.5s ease-in-out`},className:j.stop})]}),(e==="circular-determinate"||e=="circular-indeterminate")&&o.jsx(R.motion.svg,{width:"48",height:"48",viewBox:"0 0 48 48",initial:{rotate:-90},animate:{rotate:270},transition:{repeat:1/0,duration:a(),ease:"linear"},className:j.progressIndicator,...u,children:o.jsx(R.motion.circle,{cx:"50%",cy:"50%",r:h?"calc(50% - 2px)":"50%",style:{strokeLinecap:"round"},initial:"hidden",animate:"visible",className:j.activeIndicator,variants:{hidden:{pathLength:w?10/100:90/100},visible:{pathLength:w?90/100:10/100}},transition:{pathLength:{type:"tween",ease:"linear",duration:a(),bounce:0}}})},w+"")]})},Z=({colorName:e="on-surface",triggerRef:t})=>{const n={initial:{opacity:0,borderRadius:"50%",width:"25%",height:"25%"},animate:{opacity:1,borderRadius:0,width:"200%",height:"200%",transition:{duration:.3,borderRadius:{duration:.3,delay:.3}}}},[r,s]=c.useState(!0),[u,l]=c.useState(!1),[i,m]=c.useState({x:0,y:0});c.useEffect(()=>{u&&(s(!0),s(!1))},[u]),c.useEffect(()=>{const a=t==null?void 0:t.current;if(a)return a.addEventListener("mousedown",f),a.addEventListener("mouseup",v),a.addEventListener("mouseleave",w),()=>{a.removeEventListener("mousedown",f),a.removeEventListener("mouseup",v),a.removeEventListener("mouseleave",w)}},[t]);const f=a=>{const h=t==null?void 0:t.current,b=h.getBoundingClientRect();l(!0),m({x:(a.clientX-b.left)/h.clientWidth*100,y:(a.clientY-b.top)/h.clientHeight*100})},w=a=>{l(!1)},v=a=>{l(!1)};return o.jsx(R.AnimatePresence,{mode:"wait",children:(u||!u&&!r)&&o.jsx(R.motion.div,{style:{position:"absolute",width:"100%",height:"100%",top:i.y+"%",left:i.x+"%",background:`color-mix(in srgb, var(--color-${e}) 12%, transparent)`,pointerEvents:"none"},variants:n,initial:"initial",animate:"animate",exit:{opacity:0,transition:{duration:0}},onAnimationComplete:()=>s(!0),className:"transform -translate-x-1/2 -translate-y-1/2"})})},Se=X("customScroll",({orientation:e,draggable:t,isDragging:n})=>({customScroll:d("flex h-full w-full",t&&["[&::-webkit-scrollbar-track]:rounded-full","[&::-webkit-scrollbar-track]:bg-transparent","[&::-webkit-scrollbar-thumb]:rounded-full",{"[&::-webkit-scrollbar-thumb]:bg-outline":n,"[&::-webkit-scrollbar-thumb]:bg-transparent":!n},{"[&::-webkit-scrollbar]:h-2":e==="horizontal"},{"[&::-webkit-scrollbar]:w-2":e==="vertical"}],{"overflow-y-scroll flex-col":e==="vertical","overflow-x-scroll flex-row":e==="horizontal","cursor-grab":t&&!n,"cursor-grabbing":t&&n}),track:d("overflow-hidden flex-none sticky",{"left-0 h-full":e==="horizontal","top-0 w-full":e==="vertical"})})),T=({children:e,orientation:t="vertical",scrollSize:n,onScroll:r,className:s,draggable:u=!1,throttleDuration:l=75})=>{var V,W;const i=c.useRef(null),m=c.useRef(null),[f,w]=c.useState({width:null,height:null});c.useEffect(()=>{if(!i.current)return;const L=new ResizeObserver($=>{for(const F of $)F.target===i.current&&w({width:F.contentRect.width,height:F.contentRect.height})});return L.observe(i.current),()=>{L.disconnect()}},[i]);const v=c.useRef(null),a=c.useRef(null),h=()=>{const L=m.current;return L?{width:n??L.scrollWidth,height:n??L.scrollHeight}:null},b=()=>{const L=i.current;return L?{width:L.clientWidth,height:L.clientHeight}:null},{scrollYProgress:j,scrollXProgress:S}=R.useScroll({container:i}),E=c.useRef(null);E.current||(E.current=Pe.throttle(l,(L,$)=>{!a.current||!v.current||r&&(t==="horizontal"&&$==="x"&&r({scrollProgress:L,scroll:L*v.current.width,scrollTotal:v.current.width,scrollVisible:a.current.width}),t==="vertical"&&$==="y"&&r({scrollProgress:L,scroll:L*v.current.height,scrollTotal:v.current.height,scrollVisible:a.current.height}))}));const y=(L,$)=>{E.current&&E.current(L,$)};c.useEffect(()=>{f.width&&y(S.get(),"x"),f.height&&y(j.get(),"y")},[f]),R.useMotionValueEvent(S,"change",L=>{y(L,"x")}),R.useMotionValueEvent(j,"change",L=>{y(L,"y")});const[N,I]=c.useState(!1);c.useLayoutEffect(()=>{N||!a.current||!v.current||!r||(r({scrollProgress:0,scroll:0,scrollTotal:t=="vertical"?v.current.height:v.current.width,scrollVisible:t=="vertical"?a.current.height:a.current.width}),I(!0))},[a,v,r]),v.current=h(),a.current=b();const[M,C]=c.useState(!1),B=Se({isDragging:M,children:e,className:s,onScroll:r,orientation:t,scrollSize:n,draggable:u,throttleDuration:l}),[P,k]=c.useState(0),[p,D]=c.useState(0),A=L=>{if(!u)return;const $=i.current;if(!$||P==null)return;const K=(L.pageX-$.offsetLeft-P)*1.5;$.scrollLeft=p-K},q=L=>{const $=i.current;$&&(C(!0),k(L.pageX-$.offsetLeft),D($.scrollLeft))},G=L=>{M&&(L.preventDefault(),A(L))},U=()=>{C(!1)},Y=()=>{C(!1)},g=L=>{L.preventDefault()},x=c.useRef(null);return c.useEffect(()=>()=>{x.current&&clearTimeout(x.current)},[]),o.jsxs("div",{className:B.customScroll,ref:i,onMouseDown:q,onMouseMove:G,onMouseUp:U,onMouseLeave:Y,onDragStart:g,onScroll:L=>{M||(k(null),C(!0),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{C(!1)},1e3))},children:[o.jsx("div",{ref:m,style:t==="vertical"?{height:((V=a==null?void 0:a.current)==null?void 0:V.height)??"100%"}:{width:((W=a==null?void 0:a.current)==null?void 0:W.width)??"100%"},className:B.track,children:e}),a.current&&v.current&&o.jsxs(o.Fragment,{children:[t==="vertical"&&v.current.height>a.current.height&&o.jsx(R.motion.div,{className:"flex-none",style:{height:v.current.height-a.current.height}}),t==="horizontal"&&v.current.width>a.current.width&&o.jsx(R.motion.div,{className:"flex-none",style:{width:v.current.width-a.current.width}})]})]})},Fe=({children:e,transition:t=".5s",orientation:n="vertical",throttleDuration:r=25,...s})=>{const[u,l]=c.useState(null),i=R.motionValue((u==null?void 0:u.scrollProgress)??0),m=R.useTransform(i,[0,1],[0,1-((u==null?void 0:u.scrollVisible)??0)/((u==null?void 0:u.scrollTotal)??0)]),f=R.useTransform(m,a=>`${-a*100}%`),w=a=>{i.set(a.scrollProgress),a.scrollTotal>0&&l(a)},v=c.useRef(null);return R.useMotionValueEvent(f,"change",a=>{const h=performance.now();if(v.current!==null){const b=h-v.current;console.log(`Delta temps : ${b} ms`)}v.current=h,console.log(a)}),o.jsx(T,{onScroll:w,throttleDuration:r,...s,children:o.jsx(R.motion.div,{className:d("transition-transform ease-out",{"w-fit h-full":n==="horizontal","h-fit w-full":n==="vertical"}),style:{transitionDuration:t,...n=="vertical"?{y:f}:{x:f}},children:e})})},Ee=({targetRef:e,children:t})=>{const[n,r]=c.useState(null),s=c.useRef(null),u=()=>{const l=e.current;if(!l)return;const i=l.getBoundingClientRect();console.log(l),r({position:"fixed",top:i.top,left:i.left,width:i.width,height:i.height,pointerEvents:"none",zIndex:999})};return c.useEffect(()=>{const l=e.current;if(l)return u(),window.addEventListener("scroll",u,!0),window.addEventListener("resize",u),s.current=new ResizeObserver(u),s.current.observe(l),()=>{var i;window.removeEventListener("scroll",u,!0),window.removeEventListener("resize",u),(i=s.current)==null||i.disconnect()}},[e]),n?De.createPortal(o.jsx("div",{style:n,children:t}),document.body):null},Le=({variant:e="filled",disabled:t=!1,icon:n,href:r,label:s,className:u,iconPosition:l="left",loading:i=!1,shape:m="rounded",onClick:f,ref:w,size:v="medium",allowShapeTransformation:a=!0,transition:h,...b})=>{const j=r?"a":"button",S=c.useRef(null),E=w||S,y=ce({allowShapeTransformation:a,size:v,shape:m,href:r,disabled:t,icon:n,iconPosition:l,label:s,loading:i,variant:e,transition:h,className:u}),N=n?o.jsx(H,{icon:n,className:y.icon}):o.jsx(o.Fragment,{});return h={duration:.3,...h},o.jsx(j,{ref:E,href:r,className:y.button,...b,onClick:I=>{t?I.preventDefault():f&&f(I)},disabled:t,children:o.jsxs("div",{className:y.container,style:{transition:h.duration+"s"},children:[o.jsx("div",{className:y.stateLayer,children:!t&&o.jsx(Z,{colorName:e==="elevated"&&"primary"||e==="filled"&&"on-primary"||e==="filledTonal"&&"on-secondary-container"||e==="outlined"&&"primary"||e==="text"&&"primary"||"",triggerRef:E})}),l==="left"&&N,i&&o.jsx("div",{className:"!absolute left-1/2 -translate-x-1/2 top-1/2 -translate-y-1/2",children:o.jsx(Ne,{className:()=>({progressIndicator:"h-6 w-6",activeIndicator:d({"!stroke-primary":e==="elevated"&&!t,"!stroke-on-surface/[38%]":e==="elevated"&&t},{"!stroke-on-primary":e==="filled"&&!t,"!stroke-on-surface/[38%]":e==="filled"&&t},{"!stroke-on-secondary-container":e==="filledTonal"&&!t,"!stroke-on-surface/[38%]":e==="filledTonal"&&t},{"!stroke-primary":e==="outlined"&&!t,"!stroke-on-surface/[38%]":e==="outlined"&&t},{"!stroke-primary":e==="text"&&!t,"!stroke-on-surface/[38%]":e==="text"&&t})}),variant:"circular-indeterminate"})}),o.jsx("span",{className:y.label,children:s}),l==="right"&&N]})})},Ue=({variant:e="outlined",className:t,children:n,isInteractive:r=!1,ref:s,...u})=>{const l=ie({className:t,isInteractive:r,variant:e}),i=c.useRef(null),m=s||i;return o.jsxs("div",{...u,ref:m,className:l.card,children:[o.jsx("div",{className:l.stateLayer,children:r&&o.jsx(Z,{colorName:"on-surface",triggerRef:m})}),n]})},Re=(e,t,n=[0,1])=>{const[r,s]=t,[u,l]=n,m=(Math.max(r,Math.min(e,s))-r)/(s-r);return u+m*(l-u)},Ie=({className:e,children:t,width:n=1,index:r=0,ref:s,...u})=>{const l=c.useRef(null),i=s||l,m=ue({className:e,index:r,width:n,children:t});return o.jsx(R.motion.div,{ref:i,animate:{width:n+"px"},transition:{duration:.5,ease:"linear"},className:m.carouselItem,...u,children:t})},Xe=({variant:e="hero",className:t,children:n,ref:r,marginPourcent:s=0,inputRange:u=[.21,.65],outputRange:l=[42,300],gap:i=8,onChange:m,scrollSensitivity:f=1.25,...w})=>{var U,Y;const v=c.useRef(null),a=r||v,h=fe({className:t,children:n,variant:e,inputRange:u,outputRange:l,marginPourcent:s,onChange:m,gap:i,scrollSensitivity:f}),b=c.Children.toArray(n).filter(g=>c.isValidElement(g)&&g.type===Ie),j=c.useRef(null),[S,E]=c.useState([]),[y,N]=c.useState(null),I=()=>{var $;if(!j.current||!a.current||!y)return[];const{scrollVisible:g,scrollProgress:x}=y;function V(F,K){return F.map(_=>(_-K)/Math.abs(F[1]-F[0]))}let W=b.map((F,K)=>{if(!M[K].current||!j.current)return 0;let J=K/(b.length-1);return J>1&&(J=1),J<0&&(J=0),J});W=V(W,x);let L=(((($=a.current)==null?void 0:$.clientWidth)??g)-(l[0]+i))/(l[1]+i);return W.map((F,K)=>({value:Math.abs(F),originalIndex:K})).sort((F,K)=>F.value-K.value).forEach((F,K)=>{K===0&&B(F.originalIndex);let _=Re(L,[0,1],[0,l[1]]);_<l[0]&&(_=l[0]),L--,W[F.originalIndex]=_}),W},M=c.useRef([]).current,[C,B]=c.useState(0);c.useEffect(()=>{m&&m(C)},[C]),M.length!==b.length&&b.forEach((g,x)=>{M[x]||(M[x]=c.createRef())});const P=b.map((g,x)=>c.cloneElement(g,{width:S[x],ref:M[x],key:x,index:x})),k=R.motionValue((y==null?void 0:y.scrollProgress)??0),p=R.useTransform(k,[0,1],[0,1-(((U=a.current)==null?void 0:U.clientWidth)??0)/(((Y=j==null?void 0:j.current)==null?void 0:Y.clientWidth)??0)]),D=R.useTransform(p,g=>`${-g*100}%`),A=g=>{g.scrollTotal>0&&N(g)};c.useEffect(()=>{const g=I();E(g)},[y]);const[q,G]=c.useState(0);return c.useLayoutEffect(()=>{let g=l[1];y&&g>y.scrollVisible&&(g=y.scrollVisible);const x=(g+i)*P.length/f;G(x)},[a,M,y]),o.jsx("div",{className:h.carousel,ref:a,...w,children:o.jsx(T,{draggable:!0,orientation:"horizontal",onScroll:A,scrollSize:q,children:o.jsx(R.motion.div,{className:h.track,ref:j,style:{transitionDuration:"0.5s",transitionTimingFunction:"ease-out",gap:`${i}px`,x:D},children:P})})})},qe=({orientation:e="horizontal",className:t,...n})=>{const r=de({orientation:e,className:t});return o.jsx("hr",{className:r.divider,...n})},O=[];for(let e=0;e<256;++e)O.push((e+256).toString(16).slice(1));function Oe(e,t=0){return(O[e[t+0]]+O[e[t+1]]+O[e[t+2]]+O[e[t+3]]+"-"+O[e[t+4]]+O[e[t+5]]+"-"+O[e[t+6]]+O[e[t+7]]+"-"+O[e[t+8]]+O[e[t+9]]+"-"+O[e[t+10]]+O[e[t+11]]+O[e[t+12]]+O[e[t+13]]+O[e[t+14]]+O[e[t+15]]).toLowerCase()}let Q;const Ae=new Uint8Array(16);function Ge(){if(!Q){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Q=crypto.getRandomValues.bind(crypto)}return Q(Ae)}const Ke=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),re={randomUUID:Ke};function ee(e,t,n){var s;if(re.randomUUID&&!e)return re.randomUUID();e=e||{};const r=e.random??((s=e.rng)==null?void 0:s.call(e))??Ge();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Oe(r)}const te=({variant:e="plain",buttons:t,className:n,children:r,title:s,text:u,position:l,targetRef:i,ref:m,trigger:f=["hover","focus"],...w})=>{if(!r&&!i)throw new Error("ToolTip must have a child or a targetRef");Array.isArray(f)||(f=[f]),t&&!Array.isArray(t)&&(t=[t]);const v=c.useRef(null),a=i||v,[h,b]=c.useState(null),[j]=c.useState(ee()),[S,E]=c.useState(!1),y=c.useRef(null);c.useEffect(()=>{const p=D=>{b(D.detail)};return document.addEventListener("tooltip-update",p),()=>{document.removeEventListener("tooltip-update",p)}},[]),c.useEffect(()=>{y.current&&clearTimeout(y.current),h?E(h===j):y.current=setTimeout(()=>{E(!1)},1200)},[h,j]);const N=()=>{if(f.includes("hover")){const p=new CustomEvent("tooltip-update",{detail:j});document.dispatchEvent(p)}},I=()=>{if(f.includes("hover")){const p=new CustomEvent("tooltip-update",{detail:null});document.dispatchEvent(p)}},M=()=>{if(f.includes("click")){const p=new CustomEvent("tooltip-update",{detail:S?null:j});document.dispatchEvent(p)}},C=()=>{if(f.includes("focus")){const p=new CustomEvent("tooltip-update",{detail:j});document.dispatchEvent(p)}},B=()=>{if(f.includes("focus")){const p=new CustomEvent("tooltip-update",{detail:null});document.dispatchEvent(p)}};c.useEffect(()=>{if(a!=null&&a.current){const p=a.current;return p.addEventListener("mouseenter",N),p.addEventListener("mouseleave",I),p.addEventListener("click",M),p.addEventListener("focus",C),p.addEventListener("blur",B),()=>{p.removeEventListener("mouseenter",N),p.removeEventListener("mouseleave",I),p.removeEventListener("click",M),p.removeEventListener("focus",C),p.removeEventListener("blur",B)}}},[a,f,j,S]);const P=!i&&c.isValidElement(r)?c.cloneElement(r,{ref:v}):r;if(!l&&typeof window<"u"&&a!=null&&a.current&&!l){const p=a.current.getBoundingClientRect(),D=window.innerWidth,A=window.innerHeight,q=p.left/D,G=p.top/A;e==="plain"?q<1/3?l="right":q>2/3?l="left":l=G>.5?"top":"bottom":q<1/2&&G<1/2?l="bottom-right":q>1/2&&G<1/2?l="bottom-left":q>1/2&&G>1/2?l="top-left":q<1/2&&G>1/2&&(l="top-right")}const k=je({variant:e,buttons:t,className:n,title:s,text:u,position:l,trigger:f,targetRef:i,children:r});return o.jsxs(o.Fragment,{children:[P,o.jsx(R.AnimatePresence,{children:S&&o.jsx(Ee,{targetRef:a,children:o.jsx(R.motion.div,{initial:{opacity:h?1:0},animate:{opacity:1},transition:{duration:h?0:.3},exit:{opacity:h?1:0},className:k.toolTip,...w,onMouseEnter:N,onMouseLeave:I,children:o.jsxs(R.motion.div,{className:k.container,layoutId:"tool-tip",transition:{type:"spring",stiffness:200,damping:20},children:[s&&o.jsx("div",{className:k.subHead,children:s}),o.jsx("div",{className:k.supportingText,children:u}),t&&o.jsx("div",{className:k.actions,children:Array.isArray(t)&&t.map((p,D)=>o.jsx(Le,{size:"small",variant:"text",...p},D))})]})})})})]})},z=({className:e,label:t,variant:n="primary",size:r="medium",href:s,type:u,icon:l,isExtended:i=!1,ref:m,transition:f,...w})=>{const v=s?"a":"button",a=me({href:s,icon:l,isExtended:i,label:t,size:r,variant:n,className:e,transition:f});f={duration:.3,...f};const h=c.useRef(null),b=m||h,j={visible:{width:"auto",marginLeft:12,opacity:1,transition:{...f,opacity:{duration:f.duration/2,delay:f.duration-f.duration/2}}},hidden:{width:0,marginLeft:0,opacity:0,transition:{...f,marginLeft:{duration:f.duration/2,delay:f.duration-f.duration/2}}}};return o.jsxs(v,{...w,ref:b,href:s,"aria-label":i?void 0:t,className:a.fab,children:[o.jsx(te,{trigger:i?null:void 0,text:t,targetRef:b}),o.jsx("span",{className:a.stateLayer,children:o.jsx(Z,{colorName:d({primary:n=="surface","on-primary-container":n=="primary","on-secondary-container":n=="secondary","on-tertiary-container":n=="tertiary"}),triggerRef:b})}),o.jsx(H,{icon:l,className:a.icon}),o.jsx(R.AnimatePresence,{children:i&&o.jsx(R.motion.span,{variants:j,initial:"hidden",animate:"visible",exit:"hidden",className:a.label,children:t})})]})},ne=({variant:e="standard",href:t,disabled:n=!1,type:r="button",title:s,arialLabel:u,onToggle:l,activated:i=!1,onClick:m,icon:f,size:w="medium",iconSelected:v,className:a,ref:h,width:b="default",shape:j="rounded",allowShapeTransformation:S=!0,transition:E,...y})=>{s||(s=u);const[N,I]=c.useState(i);let M;l?l&&(M=p=>{n&&p.preventDefault(),I(!N),l(!!N)},f=N&&v||f):M=p=>{n&&p.preventDefault(),m&&m(p)},c.useEffect(()=>{I(i)},[i]);const C=t?"a":"button",B=pe({transition:E,shape:j,allowShapeTransformation:S,width:b,href:t,activated:i,arialLabel:u,iconSelected:v,isActive:N,onToggle:l,disabled:n,icon:f,variant:e,className:a,size:w,...y}),P=c.useRef(null),k=h||P;return E={duration:.3,...E},o.jsxs(C,{disabled:n,href:t,className:B.iconButton,"aria-label":u,...y,title:void 0,onClick:M,ref:k,children:[o.jsx(te,{targetRef:k,trigger:n?null:void 0,text:s}),o.jsxs("div",{style:{transition:E.duration+"s"},className:B.container,children:[o.jsx("div",{className:B.stateLayer,children:!n&&o.jsx(Z,{colorName:d(e==="standard"&&{"on-surface-variant":!N,primary:N},e==="filled"&&{primary:!N&&!!l,"inverse-on-surface":N||!l},e==="tonal"&&{"on-surface-variant":!N&&!!l,"on-secondary-container":N||!l},e==="outlined"&&{"on-surface-variant":!N,"on-primary":N}),triggerRef:k})}),f&&o.jsx(H,{icon:f,className:B.icon})]})]})},He=({className:e,valueFormatter:t,step:n=10,name:r,value:s=0,min:u=0,max:l=100,marks:i=[{value:0,label:"0"},{value:100,label:"100"}],ref:m,onChange:f,...w})=>{const v=g=>{const x=h(),V=a();return g===1/0?100:g===-1/0?0:(g-x)/(V-x)*100},a=(g=!1)=>g?l:l==1/0?i[(i==null?void 0:i.length)-1].value:l,h=(g=!1)=>g?u:u==-1/0?i[0].value:u,b=g=>{const x=h(!1);return(a(!1)-x)*g/100+x},[j,S]=c.useState(!1),E=c.useRef(null),y=m||E,[N,I]=c.useState(s),[M,C]=c.useState(v(s)),[B,P]=c.useState(!1),k=g=>{P(!0),S(!0),A(g)},p=()=>{P(!1),S(!1)};c.useEffect(()=>(B?(window.addEventListener("mouseup",p),window.addEventListener("mousemove",A),window.addEventListener("touchend",p),window.addEventListener("touchmove",A)):(window.removeEventListener("mouseup",p),window.removeEventListener("mousemove",A),window.removeEventListener("touchend",p),window.removeEventListener("touchmove",A)),()=>{window.removeEventListener("mouseup",p),window.removeEventListener("mousemove",A),window.removeEventListener("touchend",p),window.removeEventListener("touchmove",A)}),[B]);const D=xe({className:e,isChanging:j,marks:i,max:l,min:u,name:r,step:n,value:N,valueFormatter:t,onChange:f}),A=g=>{const x=y==null?void 0:y.current;if(x){const V=x.getBoundingClientRect().left,L=((g.type==="touchmove"||g.type==="touchstart"?g.touches[0].clientX:g.clientX)-V)/x.offsetWidth*100;q({pourcent:L})}},q=({pourcent:g,value:x})=>{if(g){if(g>=100){I(a(!0)),C(100);return}if(g<=0){I(h(!0)),C(0);return}x=b(g),x==h()&&(x=h(!0)),x==a()&&(x=a(!0))}else if(x!=null){if(x>=a()){I(a(!0)),C(100);return}if(x<=h()){I(h(!0)),C(0);return}g=v(x)}else return;n!=null?x=Math.round((x-h())/n)*n+h():i&&(x=i.reduce((V,W,L)=>{let $=W.value===1/0?a():W.value===-1/0?h():W.value,F=V.value===1/0?a():V.value===-1/0?h():V.value;return $=Math.abs($-x),F=Math.abs(F-x),$<F?W:V}).value),x>=a()&&(x=a(!0)),x<=h()&&(x=h(!0)),g=v(x),I(x),C(g),f&&f(x)},[G,U]=c.useState(0);c.useEffect(()=>{const g=()=>{y.current&&U(y.current.offsetWidth)};return g(),window.addEventListener("resize",g),()=>{window.removeEventListener("resize",g)}},[]);const Y=g=>{switch(g.key){case"ArrowRight":if(n)q({value:N+n});else if(i){const x=i.find(V=>V.value>N);x&&q({value:x.value})}break;case"ArrowLeft":if(n)q({value:N-n});else if(i){const x=i.slice(0).reverse().find((V,W,L)=>N===1/0?W===1:V.value<N);x&&q({value:x.value})}break;default:return}};return o.jsxs("div",{tabIndex:0,onKeyDown:Y,role:"slider","aria-valuemin":h(!0),"aria-valuemax":a(!0),"aria-valuenow":N,"aria-valuetext":N.toString(),className:D.slider,onMouseDown:k,onClick:A,ref:y,onTouchStart:k,onDragStart:g=>g.preventDefault(),...w,children:[o.jsx("input",{type:"hidden",name:r,value:N}),o.jsx("div",{className:D.activeTrack,style:{flex:M/100}}),o.jsx("div",{className:D.handle,children:o.jsx(R.AnimatePresence,{children:j&&o.jsx(R.motion.div,{className:D.valueIndicator,initial:"hidden",animate:"visible",exit:"hidden",style:{translate:"-50%",transformOrigin:"center bottom",textWrap:"nowrap"},variants:{visible:{opacity:1,scale:1},hidden:{opacity:1,scale:0}},transition:{duration:.1},children:t?t(N):N})})}),o.jsx("div",{className:D.inactiveTrack,style:{flex:1-M/100}}),o.jsx("div",{className:"w-[calc(100%-12px)] h-full absolute -translate-x-1/2 transform left-1/2",children:i&&i.map((g,x)=>{let V=null;const W=(j?9:10)/G*100,L=v(g.value);return L<=M-W?V=!0:L>=M+W&&(V=!1),o.jsx("div",{className:d(D.dot,{"bg-primary-container":V!=null&&V,"bg-primary":V!=null&&!V}),style:{left:`${v(g.value)}%`}},x)})})]})};/*!
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),se=require("clsx"),Ve=require("tailwind-merge"),c=require("react"),I=require("motion/react"),Pe=require("throttle-debounce"),De=require("react-dom"),We=require("react-textarea-autosize"),le=Ve.extendTailwindMerge({override:{classGroups:{"text-color":[{text:[e=>!e.startsWith("display-")&&!e.startsWith("headline-")&&!e.startsWith("title-")&&!e.startsWith("body-")&&!e.startsWith("label-")]}]}},extend:{classGroups:{font:[{text:[e=>e.startsWith("display-")||e.startsWith("headline-")||e.startsWith("title-")||e.startsWith("body-")||e.startsWith("label-")]}]},conflictingClassGroups:{font:["font"]}}}),d=(...e)=>le(se.clsx(e)),oe=(...e)=>le(se.clsx(e));function $e(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}const ae=e=>{const t={};e.classNameList.forEach(s=>{var n;if(s)if(typeof s=="string")(t[n=e.default]??(t[n]=[])).push(s);else{const u=s(e.states);Object.entries(u).map(i=>{const[l,m]=i;(t[l]??(t[l]=[])).push(m)})}});const r=t;return Object.entries(t).map(s=>{let[n,u]=s;u=u.reverse(),n==e.default&&u.unshift("relative"),u.unshift($e(n)),r[n]=oe(...u)}),r},X=(e,t)=>r=>ae({classNameList:[r.className,t],default:e,states:r}),ce=X("button",({variant:e,disabled:t,iconPosition:r,icon:s,isActive:n,loading:u,shape:i,size:l,allowShapeTransformation:m})=>({button:d("group flex items-center cursor-pointer",l==="xSmall"&&"py-2",l==="small"&&"py-1",e==="text"&&[l==="xSmall"&&"-my-2",l==="small"&&"-my-1"]),container:d(" relative outline-none overflow-hidden inline-block flex justify-center items-center ",l==="xSmall"&&"text-label-large px-3 py-1.5 gap-1",l==="small"&&"text-label-large px-4 py-2.5 gap-2",l==="medium"&&"text-title-medium px-6 py-4 gap-2",l==="large"&&"text-headline-small px-12 py-8 gap-3",l==="xLarge"&&"text-headline-large px-16 py-12 gap-4",i==="rounded"&&{"rounded-[30px]":l==="xSmall"||l=="small","rounded-[40px]":l==="medium","rounded-[70px]":l==="large"||l=="xLarge"},i==="squared"&&{"rounded-[12px]":l==="xSmall"||l=="small","rounded-[16px]":l==="medium","rounded-[28px]":l==="large"||l=="xLarge"},m&&!t&&{"group-active:rounded-[12px]":l==="xSmall"||l=="small","group-active:rounded-[16px]":l==="medium","group-active:rounded-[28px]":l==="large"||l=="xLarge"},m&&n&&{"rounded-[12px]":l==="xSmall"||l=="small","rounded-[16px]":l==="medium","rounded-[28px]":l==="large"||l=="xLarge"},e==="elevated"&&{"shadow-1 hover:shadow-2":!t,"bg-surface-container-low text-primary":!t&&!n,"bg-primary text-on-primary":!t&&n,"text-on-surface/[38%]":t},e==="filled"&&{"hover:shadow-1":!t,"bg-surface-container text-on-surface-variant":!t&&!n,"bg-primary text-on-primary":!t&&n,"text-on-surface/[38%]":t},e==="filledTonal"&&{"hover:shadow-1":!t,"bg-secondary-container text-on-secondary-container":!t&&!n,"bg-secondary text-on-secondary":!t&&n,"text-on-surface/[0.38]":t},e==="outlined"&&[" border",{"border-on-surface/[0.12] text-on-surface/[0.38]":t,"text-primary border-outline focus:border-primary":!t&&!n,"text-inverse-on-surface bg-inverse-surface border-inverse-surface":!t&&n}],e==="text"&&["w-fit",{"text-primary":!t,"text-on-surface/[0.38]":t},l==="xSmall"&&"-mx-3 ",l==="small"&&"-mx-4 ",l==="medium"&&"-mx-6 ",l==="large"&&"-mx-12",l==="xLarge"&&"-mx-16 "],t&&"cursor-default"),stateLayer:d("state-layer min-h-full min-w-full absolute top-0 left-0 ",e==="elevated"&&{"bg-on-surface/[0.12]":t,"group-state-primary":!t},e==="filled"&&{"bg-on-surface/[0.12]":t,"group-state-on-primary":!t},e==="filledTonal"&&{"bg-on-surface/[0.12]":t,"group-state-on-secondary-container ":!t},e==="outlined"&&{"group-state-primary group-state-primary":!t},e==="text"&&{"group-state-primary":!t}),label:d({invisible:u}),icon:d({invisible:u},l==="xSmall"&&"size-5",l==="small"&&"size-5",l==="medium"&&"size-6",l==="large"&&"size-8",l==="xLarge"&&"size-10")})),ie=X("card",({variant:e,isInteractive:t})=>({card:d("card group/card rounded-xl overflow-hidden z-10",e==="outlined"&&"bg-surface",e==="elevated"&&"bg-surface-container-low shadow-1",e==="filled"&&"bg-surface-container-highest",e!=="filled"&&"border border-outline-variant"),stateLayer:d(["w-full top-0 left-0 h-full absolute -z-10",{" group-hover/card:hover-state-on-surface group-focus-visible/card:focus-state-on-surface":t}])})),ue=X("carouselItem",()=>({carouselItem:d("rounded-[28px] overflow-hidden flex-none")})),fe=X("carousel",()=>({carousel:d(["w-full h-[400px]"]),track:d("grid grid-flow-col h-full transition-transform ease-out w-fit")})),de=X("divider",({orientation:e})=>({divider:d("border-outline-variant ",{"h-fit w-full border-t":e==="horizontal"},{"h-auto self-stretch w-fit border-l":e==="vertical"})})),me=X("fab",({size:e,variant:t,isExtended:r})=>({fab:d("flex shadow-3 hover:shadow-4 group overflow-hidden outline-none items-center cursor-pointer",{"rounded-[12px]":e=="small"&&!r,"rounded-[16px]":e=="medium"||r,"rounded-[28px]":e=="large"&&!r},{"p-2":e=="small"&&!r,"p-4":e=="medium"||r,"p-[30px]":e=="large"&&!r},t==="surface"&&"bg-surface-container",t==="primary"&&"bg-primary-container",t==="secondary"&&"bg-secondary-container",t==="tertiary"&&"bg-tertiary-container"),stateLayer:d("absolute w-full h-full overflow-hidden left-1/2 top-1/2 transform -translate-y-1/2 -translate-x-1/2",t==="surface"&&"group-hover:hover-state-primary group-focus:focus-state-primary",t==="primary"&&"group-hover:hover-state-on-primary-container group-focus-visible:focus-state-on-primary-container",t==="secondary"&&"group-hover:hover-state-on-secondary-container group-focus-visible:focus-state-on-secondary-container",t==="tertiary"&&"group-hover:hover-state-on-tertiary-container group-focus-visible:focus-state-on-tertiary-container"),icon:d({"size-6":e=="small"||e=="medium"||r,"size-9":e=="large"&&!r},t==="surface"&&"text-primary",t==="primary"&&"text-on-primary-container",t==="secondary"&&"text-on-secondary-container",t==="tertiary"&&"text-on-tertiary-container"),label:d("text-title-medium text-nowrap",t==="surface"&&"text-primary",t==="primary"&&"text-on-primary-container",t==="secondary"&&"text-on-secondary-container",t==="tertiary"&&"text-on-tertiary-container")})),pe=X("iconButton",({variant:e,disabled:t,onToggle:r,isActive:s,size:n,width:u,shape:i,allowShapeTransformation:l})=>({iconButton:d("group min-h-12 flex items-center cursor-pointer",{"cursor-default":t}),container:d("rounded-full relative flex overflow-hidden transition-all duration-300",(i==="rounded"||i==="squared"&&r&&!t&&s&&l)&&{"rounded-[30px]":n==="xSmall"||n=="small","rounded-[40px]":n==="medium","rounded-[70px]":n==="large"||n=="xLarge"},(i==="squared"||i==="rounded"&&r&&!t&&s&&l)&&{"rounded-[12px]":n==="xSmall"||n=="small","rounded-[16px]":n==="medium","rounded-[28px]":n==="large"||n=="xLarge"},l&&!t&&{"group-active:rounded-[12px]":n==="xSmall"||n=="small","group-active:rounded-[16px]":n==="medium","group-active:rounded-[28px]":n==="large"||n=="xLarge"},e==="filled"&&[!t&&{"bg-surface-container":!s&&!!r,"bg-primary":s||!r},!!t&&"bg-on-surface/[0.12]"],e==="tonal"&&[!t&&{"bg-surface-container":!s&&!!r,"bg-secondary-container":s||!r},!!t&&"bg-on-surface/[0.12]"],e==="outlined"&&[!t&&{"border border-outline":!s,"border border-transparent bg-inverse-surface":s},!!t&&{"border border-on-surface/[0.12]":!s,"border border-transparent bg-on-surface/[0.12]":s}]),stateLayer:d("absolute top-0 left-0 h-full w-full ",!t&&[e==="standard"&&{"state-on-surface-variant":!s,"state-primary":s},e==="filled"&&{"state-primary":!s&&!!r,"state-inverse-on-surface":s||!r},e==="tonal"&&{"state-on-surface-variant":!s&&!!r,"state-on-secondary-container":s||!r},e==="outlined"&&{"state-on-surface-variant":!s,"state-on-primary":s}]),icon:d(" transition-all duration-300",{"size-5 p-1.5":n==="xSmall"},{"size-6 p-2":n==="small"},{"size-6 p-4":n==="medium"},{"size-8 p-8":n==="large"},{"size-10 p-12":n==="xLarge"},u=="narrow"&&[{"px-1":n==="xSmall"},{"px-1":n==="small"},{"px-3":n==="medium"},{"px-4":n==="large"},{"px-8":n==="xLarge"}],u=="wide"&&[{"px-2.5":n==="xSmall"},{"px-3.5":n==="small"},{"px-6":n==="medium"},{"px-12":n==="large"},{"px-[72px]":n==="xLarge"}],!t&&[e==="standard"&&{"text-on-surface-variant":!s,"text-primary":s},e==="filled"&&{"text-primary":!s&&!!r,"text-on-primary":s||!r},e==="tonal"&&{"text-on-surface-variant":!s&&!!r,"text-on-secondary-container":s||!r},e==="outlined"&&{"text-on-surface-variant":!s,"text-inverse-on-surface":s}],!!t&&"text-on-surface/[0.38]")})),he=X("progressIndicator",({variant:e,isVisible:t})=>({progressIndicator:d((e==="linear-determinate"||e=="linear-indeterminate")&&"flex w-full"),track:"h-full rounded-full bg-primary rounded-l-full",activeIndicator:d((e==="linear-determinate"||e=="linear-indeterminate")&&"h-full flex-1 rounded-full bg-primary-container",(e==="circular-determinate"||e=="circular-indeterminate")&&["stroke-primary fill-transparent ",{"stroke-[4px]":t,"stroke-[0px]":!t}]),stop:"absolute right-0 bg-primary rounded-full"})),xe=X("slider",({isChanging:e})=>({slider:d(["relative w-full h-11 flex items-center rounded gap-x-1.5 cursor-pointer"]),activeTrack:d(["h-4 relative transition-all duration-100 bg-primary overflow-hidden rounded-l-full "]),inactiveTrack:d(["h-4 relative transition-all duration-100 bg-primary-container rounded-r-full overflow-hidden"]),handle:d(["transform transition-all duration-100 bg-primary h-full rounded-full ",{"w-0.5":e,"w-1":!e}]),valueIndicator:d(["absolute select-none bg-inverse-surface text-inverse-on-surface py-3 px-4 text-label-large rounded-full bottom-[calc(100%+4px)] transform left-1/2 -translate-x-1/2"]),dot:d(["h-1 w-1 absolute transform -translate-y-1/2 -translate-x-1/2 top-1/2 rounded-full"])})),ye=X("snackbar",()=>({snackbar:d(" rounded bg-inverse-surface "),container:d("pl-4 pr-2 max-w-full py-1 flex items-center flex-wrap"),supportingText:d("text-body-medium text-inverse-on-surface "),icon:d(" ml-auto mr-0 text-inverse-on-surface block dark")})),ge=X("switch",({isSelected:e,disabled:t,inactiveIcon:r})=>({switch:d("group w-[52px] h-[32px] outline-none rounded-full border-2 flex items-center",{"bg-on-surface/[0.12] border-transparent":t},!t&&["cursor-pointer ",{"bg-primary border-primary":e},{"bg-surface-container border-outline":!e}]),handleContainer:d("flex items-center justify-center absolute",{"left-[14px]":!e},{"right-[14px]":e}),handle:d("transition-all duration-100 z-10 rounded-full flex items-center justify-center",{"w-[16px] h-[16px]":!e&&!r},{"w-[24px] h-[24px]":!(!e&&!r)},!t&&["cursor-pointer group-active:h-[28px] group-active:w-[28px]",{"bg-on-primary group-hover:bg-primary-container":e},{"bg-outline group-hover:bg-on-surface-variant":!e}],{"bg-surface":t}),handleStateLayer:d("w-[40px] h-[40px] -z-10 rounded-full absolute",{"group-state-primary":!t}),icon:d("w-[16px] h-[16px]",!t&&[{"text-on-primary-container":e},{"text-on-primary":!e}],{"text-on-surface/[0.38]":t})})),we=X("tab",({isSelected:e,icon:t,label:r,variant:s})=>({tab:d("bg-surface flex-1 group outline-none flex px-4 justify-center items-center cursor-pointer",{"z-10":e},!!(t&&r)&&s==="primary"&&"h-16",!(t&&r&&s==="primary")&&"h-12"),stateLayer:d("absolute w-full h-full overflow-hidden left-1/2 top-1/2 transform -translate-y-1/2 -translate-x-1/2",s==="primary"&&{"group-hover:hover-state-on-surface group-focus-visible:focus-state-on-surface":!e,"group-hover:hover-state-primary group-focus-visible:focus-state-primary":e},s==="secondary"&&"group-hover:hover-state-on-surface group-focus-visible:focus-state-on-surface"),content:d("flex gap-0.5 h-full justify-center",{relative:s=="primary"},{"":!!(r&&!t)},s==="primary"&&"flex-col items-center",s==="secondary"&&{"flex-col items-center":!(r&&t),"flex-row items-center gap-2":!!(r&&t)}),icon:d("h-6 w-6 p-0.5 !box-border",s==="primary"&&{"text-on-surface-variant":!e,"text-primary":e},s==="secondary"&&{"text-on-surface-variant":!e,"text-on-surface":e}),label:d("text-title-small text-nowrap",s==="primary"&&{"text-on-surface-variant":!e,"text-primary":e},s==="secondary"&&{"text-on-surface-variant":!e,"text-on-surface":e}),underline:d("bg-primary absolute w-full left-0 bottom-0",s==="primary"&&"h-[3px] rounded-t",s==="secondary"&&"h-0.5")})),ve=X("tabs",({scrollable:e})=>({tabs:d("border-b border-surface-container-highest","flex relative ",{"overflow-x-auto":e})})),be=X("textField",({disabled:e,leadingIcon:t,trailingIcon:r,variant:s,errorText:n,isFocused:u,value:i,suffix:l,textLine:m})=>({textField:d({"opacity-[.38]":e}),content:d("group transition-border duration-200 relative flex items-center ",{"h-14":m=="singleLine"},{"border-on-surface-variant":!(n!=null&&n.length)&&!u&&s=="filled","border-outline":!(n!=null&&n.length)&&!u&&s=="outlined","border-primary":!(n!=null&&n.length)&&u,"border-error":!!(n!=null&&n.length)},{"bg-on-surface/[0.04]":e},s=="filled"&&["rounded-t overflow-hidden border-b",{"bg-surface-container-highest":!e}],s=="outlined"&&["border rounded box-border",{"border-[3px]":u}]),stateLayer:d("absolute -z-10 w-full h-full top-0 left-0",{hidden:s=="outlined"},{"group-state-on-surface":!e,"focus-state-on-surface":u}),label:d("inline-flex outline-none whitespace-nowrap",{"text-on-surface-variant":!e&&!(n!=null&&n.length)},{"text-on-surface":e},{"text-error":!!(n!=null&&n.length)},{"text-primary":!(n!=null&&n.length)&&u}),input:d("w-full resize-none px-4 text-body-large bg-[inherit] outline-none autofill:transition-colors autofill:duration-[5000000ms]",{" text-on-surface placeholder:text-on-surface-variant":!e,"placeholder:text-on-surface text-on-surface":e},{"pr-0":!!l},s=="filled"&&" pb-2 pt-6",s=="outlined"&&"py-4 relative z-10"),activeIndicator:d("absolute w-0 inset-x-0 border-rounded mx-auto bottom-0",s=="filled"&&["h-[2px] transition-all duration-300",{"bg-primary":!(n!=null&&n.length)},{"bg-error":!!(n!=null&&n.length)},{"!w-full":u}]),supportingText:d(" text-body-small px-4 pt-1",{"text-on-surface-variant":!e&&!(n!=null&&n.length)},{"text-on-surface":e},{"!w-full":u},{"text-error":!!(n!=null&&n.length)}),leadingIcon:d(["h-12 ml-3 flex items-center justify-center",{"cursor-text":!c.isValidElement(t)}]),trailingIcon:d("h-12 w-12 flex items-center justify-center",{"cursor-text":!c.isValidElement(r)}),suffix:d("text-on-surface-variant pl-0 pr-4",s=="filled"&&" pb-2 pt-6",s=="outlined"&&"py-4 relative z-10")})),je=X("toolTip",({position:e,variant:t})=>({toolTip:d(" pointer-events-auto w-max z-10 absolute m-1 w-max-content max-w-[312px]",{"bottom-full left-1/2 -translate-x-1/2":e=="top","top-full left-1/2 -translate-x-1/2":e=="bottom","right-full top-1/2 -translate-y-1/2":e=="left","left-full top-1/2 -translate-y-1/2":e=="right","bottom-full right-full":e=="top-left","bottom-full left-full":e=="top-right","top-full right-full":e=="bottom-left","top-full left-full":e=="bottom-right"}),container:d("pb-2",t=="rich"&&"bg-surface-container rounded-2xl text-on-surface-container px-4 pt-3 shadow-2",t=="plain"&&"bg-inverse-surface rounded text-inverse-on-surface px-2 py-1"),actions:d("flex gap-10 px-1 mt-2",t=="plain"&&"hidden"),subHead:d("text-title-small mb-1",t=="plain"&&"hidden"),supportingText:d("")})),Y=({icon:e,colors:t=[],className:r})=>{const{icon:s}=e,[n,u,,,i]=s||[],l=m=>{switch(m.length){case 2:return{"--fa-primary-color":m[0]||"inherit","--fa-secondary-color":m[1]||"inherit"};case 1:return{color:m[0]};default:return{}}};return o.jsx("svg",{className:d("size-5 box-content",r),style:{...l(t)},xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${n} ${u}`,role:"img","aria-hidden":"true",children:typeof i=="string"?o.jsx("path",{className:"fill-current",d:i}):i.map((m,f)=>o.jsx("path",{d:m},f))})},Ne=({variant:e="linear-determinate",minHeight:t=4,value:r=0,transitionDuration:s=1e3,className:n,...u})=>{const[i,l]=c.useState(r),[m]=c.useState(1.5);c.useEffect(()=>{r>100&&(r=100),r<0&&(r=0),l(r)},[r]);const[f,g]=c.useState(!0),y=()=>f?m:m*.5;c.useEffect(()=>{if((e==="circular-indeterminate"||e==="linear-indeterminate")&&i!==100){const j=setInterval(()=>{l(f?10:90),g(!f)},y()*1e3);return()=>clearInterval(j)}},[e,f,i]);const[a,b]=c.useState(!1);c.useEffect(()=>{if(i>=100){const j=setTimeout(()=>{b(!1)},s);return()=>{clearTimeout(j)}}else b(!0)},[i,s]);const w=he({className:n,variant:e,value:r,transitionDuration:s,isVisible:a,minHeight:t});return o.jsxs(o.Fragment,{children:[(e==="linear-determinate"||e=="linear-indeterminate")&&o.jsxs("div",{style:{height:`${t}px`},className:w.progressIndicator,...u,children:[o.jsx("div",{style:{height:a?`${t}px`:"0px",width:`${i}%`,transition:`width 1ms ease-in-out ${i==100?", height 200ms 0.5s ease-in-out":""}`},className:w.track}),o.jsx("div",{style:{height:a?`${t}px`:"0px",marginLeft:i!=100?"6px":"0px",transition:`width ${s}ms ease-in-out ${i==100?`, height 200ms 0.5s ease-in-out, margin-left ${s}ms ${s/1.5}ms`:""}`},className:w.activeIndicator}),o.jsx("div",{style:{height:a?`${t}px`:"0px",width:`${t}px`,transition:`width ${s}ms ease-in-out, height 200ms 0.5s ease-in-out`},className:w.stop})]}),(e==="circular-determinate"||e=="circular-indeterminate")&&o.jsx(I.motion.svg,{width:"48",height:"48",viewBox:"0 0 48 48",initial:{rotate:-90},animate:{rotate:270},transition:{repeat:1/0,duration:y(),ease:"linear"},className:w.progressIndicator,...u,children:o.jsx(I.motion.circle,{cx:"50%",cy:"50%",r:a?"calc(50% - 2px)":"50%",style:{strokeLinecap:"round"},initial:"hidden",animate:"visible",className:w.activeIndicator,variants:{hidden:{pathLength:f?10/100:90/100},visible:{pathLength:f?90/100:10/100}},transition:{pathLength:{type:"tween",ease:"linear",duration:y(),bounce:0}}})},f+"")]})},A=({colorName:e="on-surface",triggerRef:t})=>{const r={initial:{opacity:0,borderRadius:"50%",width:"25%",height:"25%"},animate:{opacity:1,borderRadius:0,width:"200%",height:"200%",transition:{duration:.3,borderRadius:{duration:.3,delay:.3}}}},[s,n]=c.useState(!0),[u,i]=c.useState(!1),[l,m]=c.useState({x:0,y:0});c.useEffect(()=>{u&&(n(!0),n(!1))},[u]),c.useEffect(()=>{const a=t==null?void 0:t.current;if(a)return a.addEventListener("mousedown",f),a.addEventListener("mouseup",y),a.addEventListener("mouseleave",g),()=>{a.removeEventListener("mousedown",f),a.removeEventListener("mouseup",y),a.removeEventListener("mouseleave",g)}},[t]);const f=a=>{const b=t==null?void 0:t.current,w=b.getBoundingClientRect();i(!0),m({x:(a.clientX-w.left)/b.clientWidth*100,y:(a.clientY-w.top)/b.clientHeight*100})},g=a=>{i(!1)},y=a=>{i(!1)};return o.jsx(I.AnimatePresence,{mode:"wait",children:(u||!u&&!s)&&o.jsx(I.motion.div,{style:{position:"absolute",width:"100%",height:"100%",top:l.y+"%",left:l.x+"%",background:`color-mix(in srgb, var(--color-${e}) 12%, transparent)`,pointerEvents:"none"},variants:r,initial:"initial",animate:"animate",exit:{opacity:0,transition:{duration:0}},onAnimationComplete:()=>n(!0),className:"transform -translate-x-1/2 -translate-y-1/2"})})},Se=X("customScroll",({orientation:e,draggable:t,isDragging:r})=>({customScroll:d("flex h-full w-full",t&&["[&::-webkit-scrollbar-track]:rounded-full","[&::-webkit-scrollbar-track]:bg-transparent","[&::-webkit-scrollbar-thumb]:rounded-full",{"[&::-webkit-scrollbar-thumb]:bg-outline":r,"[&::-webkit-scrollbar-thumb]:bg-transparent":!r},{"[&::-webkit-scrollbar]:h-2":e==="horizontal"},{"[&::-webkit-scrollbar]:w-2":e==="vertical"}],{"overflow-y-scroll flex-col":e==="vertical","overflow-x-scroll flex-row":e==="horizontal","cursor-grab":t&&!r,"cursor-grabbing":t&&r}),track:d("overflow-hidden flex-none sticky",{"left-0 h-full":e==="horizontal","top-0 w-full":e==="vertical"})})),T=({children:e,orientation:t="vertical",scrollSize:r,onScroll:s,className:n,draggable:u=!1,throttleDuration:i=75})=>{var P,W;const l=c.useRef(null),m=c.useRef(null),[f,g]=c.useState({width:null,height:null});c.useEffect(()=>{if(!l.current)return;const R=new ResizeObserver($=>{for(const F of $)F.target===l.current&&g({width:F.contentRect.width,height:F.contentRect.height})});return R.observe(l.current),()=>{R.disconnect()}},[l]);const y=c.useRef(null),a=c.useRef(null),b=()=>{const R=m.current;return R?{width:r??R.scrollWidth,height:r??R.scrollHeight}:null},w=()=>{const R=l.current;return R?{width:R.clientWidth,height:R.clientHeight}:null},{scrollYProgress:j,scrollXProgress:L}=I.useScroll({container:l}),k=c.useRef(null);k.current||(k.current=Pe.throttle(i,(R,$)=>{!a.current||!y.current||s&&(t==="horizontal"&&$==="x"&&s({scrollProgress:R,scroll:R*y.current.width,scrollTotal:y.current.width,scrollVisible:a.current.width}),t==="vertical"&&$==="y"&&s({scrollProgress:R,scroll:R*y.current.height,scrollTotal:y.current.height,scrollVisible:a.current.height}))}));const v=(R,$)=>{k.current&&k.current(R,$)};c.useEffect(()=>{f.width&&v(L.get(),"x"),f.height&&v(j.get(),"y")},[f]),I.useMotionValueEvent(L,"change",R=>{v(R,"x")}),I.useMotionValueEvent(j,"change",R=>{v(R,"y")});const[N,M]=c.useState(!1);c.useLayoutEffect(()=>{N||!a.current||!y.current||!s||(s({scrollProgress:0,scroll:0,scrollTotal:t=="vertical"?y.current.height:y.current.width,scrollVisible:t=="vertical"?a.current.height:a.current.width}),M(!0))},[a,y,s]),y.current=b(),a.current=w();const[S,C]=c.useState(!1),V=Se({isDragging:S,children:e,className:n,onScroll:s,orientation:t,scrollSize:r,draggable:u,throttleDuration:i}),[B,E]=c.useState(0),[p,D]=c.useState(0),G=R=>{if(!u)return;const $=l.current;if(!$||B==null)return;const H=(R.pageX-$.offsetLeft-B)*1.5;$.scrollLeft=p-H},q=R=>{const $=l.current;$&&(C(!0),E(R.pageX-$.offsetLeft),D($.scrollLeft))},K=R=>{S&&(R.preventDefault(),G(R))},U=()=>{C(!1)},_=()=>{C(!1)},x=R=>{R.preventDefault()},h=c.useRef(null);return c.useEffect(()=>()=>{h.current&&clearTimeout(h.current)},[]),o.jsxs("div",{className:V.customScroll,ref:l,onMouseDown:q,onMouseMove:K,onMouseUp:U,onMouseLeave:_,onDragStart:x,onScroll:R=>{S||(E(null),C(!0),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{C(!1)},1e3))},children:[o.jsx("div",{ref:m,style:t==="vertical"?{height:((P=a==null?void 0:a.current)==null?void 0:P.height)??"100%"}:{width:((W=a==null?void 0:a.current)==null?void 0:W.width)??"100%"},className:V.track,children:e}),a.current&&y.current&&o.jsxs(o.Fragment,{children:[t==="vertical"&&y.current.height>a.current.height&&o.jsx(I.motion.div,{className:"flex-none",style:{height:y.current.height-a.current.height}}),t==="horizontal"&&y.current.width>a.current.width&&o.jsx(I.motion.div,{className:"flex-none",style:{width:y.current.width-a.current.width}})]})]})},Fe=({children:e,transition:t=".5s",orientation:r="vertical",throttleDuration:s=25,...n})=>{const[u,i]=c.useState(null),l=I.motionValue((u==null?void 0:u.scrollProgress)??0),m=I.useTransform(l,[0,1],[0,1-((u==null?void 0:u.scrollVisible)??0)/((u==null?void 0:u.scrollTotal)??0)]),f=I.useTransform(m,a=>`${-a*100}%`),g=a=>{l.set(a.scrollProgress),a.scrollTotal>0&&i(a)},y=c.useRef(null);return I.useMotionValueEvent(f,"change",a=>{const b=performance.now();if(y.current!==null){const w=b-y.current;console.log(`Delta temps : ${w} ms`)}y.current=b,console.log(a)}),o.jsx(T,{onScroll:g,throttleDuration:s,...n,children:o.jsx(I.motion.div,{className:d("transition-transform ease-out",{"w-fit h-full":r==="horizontal","h-fit w-full":r==="vertical"}),style:{transitionDuration:t,...r=="vertical"?{y:f}:{x:f}},children:e})})},Ee=({targetRef:e,children:t})=>{const[r,s]=c.useState(null),n=c.useRef(null),u=()=>{const i=e.current;if(!i)return;const l=i.getBoundingClientRect();s({position:"fixed",top:l.top,left:l.left,width:l.width,height:l.height,pointerEvents:"none",zIndex:999})};return c.useEffect(()=>{const i=e.current;if(i)return u(),window.addEventListener("scroll",u,!0),window.addEventListener("resize",u),n.current=new ResizeObserver(u),n.current.observe(i),()=>{var l;window.removeEventListener("scroll",u,!0),window.removeEventListener("resize",u),(l=n.current)==null||l.disconnect()}},[e]),r?De.createPortal(o.jsx("div",{style:r,children:t}),document.body):null},Le=({variant:e="filled",disabled:t=!1,icon:r,href:s,label:n,className:u,iconPosition:i="left",loading:l=!1,shape:m="rounded",onClick:f,onToggle:g,activated:y,ref:a,size:b="medium",allowShapeTransformation:w=!0,transition:j,children:L,...k})=>{const v=s?"a":"button",N=c.useRef(null),M=a||N,[S,C]=c.useState(y);c.useEffect(()=>{C(y)},[y]),j={duration:.3,...j};let V;g?g&&(V=p=>{t&&p.preventDefault(),C(!S),g(!!S)}):V=p=>{t&&p.preventDefault(),f&&f(p)};const B=ce({allowShapeTransformation:w,size:b,shape:m,href:s,disabled:t,icon:r,iconPosition:i,label:n,loading:l,variant:e,transition:j,className:u,isActive:S??!1,onToggle:g,activated:S}),E=r?o.jsx(Y,{icon:r,className:B.icon}):o.jsx(o.Fragment,{});return console.log("gfegrger",g),console.log("test",S,g,V),o.jsx(v,{ref:M,href:s,className:B.button,...k,onClick:V,disabled:t,"aria-pressed":g?S:void 0,children:o.jsxs("div",{className:B.container,style:{transition:j.duration+"s"},children:[o.jsx("div",{className:B.stateLayer,children:!t&&o.jsx(A,{colorName:e==="elevated"&&"primary"||e==="filled"&&"on-primary"||e==="filledTonal"&&"on-secondary-container"||e==="outlined"&&"primary"||e==="text"&&"primary"||"",triggerRef:M})}),i==="left"&&E,l&&o.jsx("div",{className:"!absolute left-1/2 -translate-x-1/2 top-1/2 -translate-y-1/2",children:o.jsx(Ne,{className:()=>({progressIndicator:"h-6 w-6",activeIndicator:d({"!stroke-primary":e==="elevated"&&!t,"!stroke-on-surface/[38%]":e==="elevated"&&t},{"!stroke-on-primary":e==="filled"&&!t,"!stroke-on-surface/[38%]":e==="filled"&&t},{"!stroke-on-secondary-container":e==="filledTonal"&&!t,"!stroke-on-surface/[38%]":e==="filledTonal"&&t},{"!stroke-primary":e==="outlined"&&!t,"!stroke-on-surface/[38%]":e==="outlined"&&t},{"!stroke-primary":e==="text"&&!t,"!stroke-on-surface/[38%]":e==="text"&&t})}),variant:"circular-indeterminate"})}),o.jsx("span",{className:B.label,children:n??L}),i==="right"&&E]})})},Ue=({variant:e="outlined",className:t,children:r,isInteractive:s=!1,ref:n,...u})=>{const i=ie({className:t,isInteractive:s,variant:e}),l=c.useRef(null),m=n||l;return o.jsxs("div",{...u,ref:m,className:i.card,children:[o.jsx("div",{className:i.stateLayer,children:s&&o.jsx(A,{colorName:"on-surface",triggerRef:m})}),r]})},Re=(e,t,r=[0,1])=>{const[s,n]=t,[u,i]=r,m=(Math.max(s,Math.min(e,n))-s)/(n-s);return u+m*(i-u)},Ie=({className:e,children:t,width:r=1,index:s=0,ref:n,...u})=>{const i=c.useRef(null),l=n||i,m=ue({className:e,index:s,width:r,children:t});return o.jsx(I.motion.div,{ref:l,animate:{width:r+"px"},transition:{duration:.5,ease:"linear"},className:m.carouselItem,...u,children:t})},Xe=({variant:e="hero",className:t,children:r,ref:s,marginPourcent:n=0,inputRange:u=[.21,.65],outputRange:i=[42,300],gap:l=8,onChange:m,scrollSensitivity:f=1.25,...g})=>{var U,_;const y=c.useRef(null),a=s||y,b=fe({className:t,children:r,variant:e,inputRange:u,outputRange:i,marginPourcent:n,onChange:m,gap:l,scrollSensitivity:f}),w=c.Children.toArray(r).filter(x=>c.isValidElement(x)&&x.type===Ie),j=c.useRef(null),[L,k]=c.useState([]),[v,N]=c.useState(null),M=()=>{var $;if(!j.current||!a.current||!v)return[];const{scrollVisible:x,scrollProgress:h}=v;function P(F,H){return F.map(Z=>(Z-H)/Math.abs(F[1]-F[0]))}let W=w.map((F,H)=>{if(!S[H].current||!j.current)return 0;let J=H/(w.length-1);return J>1&&(J=1),J<0&&(J=0),J});W=P(W,h);let R=(((($=a.current)==null?void 0:$.clientWidth)??x)-(i[0]+l))/(i[1]+l);return W.map((F,H)=>({value:Math.abs(F),originalIndex:H})).sort((F,H)=>F.value-H.value).forEach((F,H)=>{H===0&&V(F.originalIndex);let Z=Re(R,[0,1],[0,i[1]]);Z<i[0]&&(Z=i[0]),R--,W[F.originalIndex]=Z}),W},S=c.useRef([]).current,[C,V]=c.useState(0);c.useEffect(()=>{m&&m(C)},[C]),S.length!==w.length&&w.forEach((x,h)=>{S[h]||(S[h]=c.createRef())});const B=w.map((x,h)=>c.cloneElement(x,{width:L[h],ref:S[h],key:h,index:h})),E=I.motionValue((v==null?void 0:v.scrollProgress)??0),p=I.useTransform(E,[0,1],[0,1-(((U=a.current)==null?void 0:U.clientWidth)??0)/(((_=j==null?void 0:j.current)==null?void 0:_.clientWidth)??0)]),D=I.useTransform(p,x=>`${-x*100}%`),G=x=>{x.scrollTotal>0&&N(x)};c.useEffect(()=>{const x=M();k(x)},[v]);const[q,K]=c.useState(0);return c.useLayoutEffect(()=>{let x=i[1];v&&x>v.scrollVisible&&(x=v.scrollVisible);const h=(x+l)*B.length/f;K(h)},[a,S,v]),o.jsx("div",{className:b.carousel,ref:a,...g,children:o.jsx(T,{draggable:!0,orientation:"horizontal",onScroll:G,scrollSize:q,children:o.jsx(I.motion.div,{className:b.track,ref:j,style:{transitionDuration:"0.5s",transitionTimingFunction:"ease-out",gap:`${l}px`,x:D},children:B})})})},qe=({orientation:e="horizontal",className:t,...r})=>{const s=de({orientation:e,className:t});return o.jsx("hr",{className:s.divider,...r})},O=[];for(let e=0;e<256;++e)O.push((e+256).toString(16).slice(1));function Oe(e,t=0){return(O[e[t+0]]+O[e[t+1]]+O[e[t+2]]+O[e[t+3]]+"-"+O[e[t+4]]+O[e[t+5]]+"-"+O[e[t+6]]+O[e[t+7]]+"-"+O[e[t+8]]+O[e[t+9]]+"-"+O[e[t+10]]+O[e[t+11]]+O[e[t+12]]+O[e[t+13]]+O[e[t+14]]+O[e[t+15]]).toLowerCase()}let Q;const Ge=new Uint8Array(16);function Ke(){if(!Q){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Q=crypto.getRandomValues.bind(crypto)}return Q(Ge)}const He=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),re={randomUUID:He};function ee(e,t,r){var n;if(re.randomUUID&&!e)return re.randomUUID();e=e||{};const s=e.random??((n=e.rng)==null?void 0:n.call(e))??Ke();if(s.length<16)throw new Error("Random bytes length must be >= 16");return s[6]=s[6]&15|64,s[8]=s[8]&63|128,Oe(s)}const te=({variant:e="plain",buttons:t,className:r,children:s,title:n,text:u,position:i,targetRef:l,ref:m,trigger:f=["hover","focus"],...g})=>{if(!s&&!l)throw new Error("ToolTip must have a child or a targetRef");Array.isArray(f)||(f=[f]),t&&!Array.isArray(t)&&(t=[t]);const y=c.useRef(null),a=l||y,[b,w]=c.useState(null),[j]=c.useState(ee()),[L,k]=c.useState(!1),v=c.useRef(null);c.useEffect(()=>{const p=D=>{w(D.detail)};return document.addEventListener("tooltip-update",p),()=>{document.removeEventListener("tooltip-update",p)}},[]),c.useEffect(()=>{v.current&&clearTimeout(v.current),b?k(b===j):v.current=setTimeout(()=>{k(!1)},1200)},[b,j]);const N=()=>{if(f.includes("hover")){const p=new CustomEvent("tooltip-update",{detail:j});document.dispatchEvent(p)}},M=()=>{if(f.includes("hover")){const p=new CustomEvent("tooltip-update",{detail:null});document.dispatchEvent(p)}},S=()=>{if(f.includes("click")){const p=new CustomEvent("tooltip-update",{detail:L?null:j});document.dispatchEvent(p)}},C=()=>{if(f.includes("focus")){const p=new CustomEvent("tooltip-update",{detail:j});document.dispatchEvent(p)}},V=()=>{if(f.includes("focus")){const p=new CustomEvent("tooltip-update",{detail:null});document.dispatchEvent(p)}};c.useEffect(()=>{if(a!=null&&a.current){const p=a.current;return p.addEventListener("mouseenter",N),p.addEventListener("mouseleave",M),p.addEventListener("click",S),p.addEventListener("focus",C),p.addEventListener("blur",V),()=>{p.removeEventListener("mouseenter",N),p.removeEventListener("mouseleave",M),p.removeEventListener("click",S),p.removeEventListener("focus",C),p.removeEventListener("blur",V)}}},[a,f,j,L]);const B=!l&&c.isValidElement(s)?c.cloneElement(s,{ref:y}):s;if(!i&&typeof window<"u"&&a!=null&&a.current&&!i){const p=a.current.getBoundingClientRect(),D=window.innerWidth,G=window.innerHeight,q=p.left/D,K=p.top/G;e==="plain"?q<1/3?i="right":q>2/3?i="left":i=K>.5?"top":"bottom":q<1/2&&K<1/2?i="bottom-right":q>1/2&&K<1/2?i="bottom-left":q>1/2&&K>1/2?i="top-left":q<1/2&&K>1/2&&(i="top-right")}const E=je({variant:e,buttons:t,className:r,title:n,text:u,position:i,trigger:f,targetRef:l,children:s});return o.jsxs(o.Fragment,{children:[B,o.jsx(I.AnimatePresence,{children:L&&o.jsx(Ee,{targetRef:a,children:o.jsx(I.motion.div,{initial:{opacity:b?1:0},animate:{opacity:1},transition:{duration:b?0:.3},exit:{opacity:b?1:0},className:E.toolTip,...g,onMouseEnter:N,onMouseLeave:M,children:o.jsxs(I.motion.div,{className:E.container,layoutId:"tool-tip",transition:{type:"spring",stiffness:200,damping:20},children:[n&&o.jsx("div",{className:E.subHead,children:n}),o.jsx("div",{className:E.supportingText,children:u}),t&&o.jsx("div",{className:E.actions,children:Array.isArray(t)&&t.map((p,D)=>o.jsx(Le,{size:"small",variant:"text",...p},D))})]})})})})]})},z=({className:e,label:t,variant:r="primary",size:s="medium",href:n,type:u,icon:i,isExtended:l=!1,ref:m,transition:f,...g})=>{const y=n?"a":"button",a=me({href:n,icon:i,isExtended:l,label:t,size:s,variant:r,className:e,transition:f});f={duration:.3,...f};const b=c.useRef(null),w=m||b,j={visible:{width:"auto",marginLeft:12,opacity:1,transition:{...f,opacity:{duration:f.duration/2,delay:f.duration-f.duration/2}}},hidden:{width:0,marginLeft:0,opacity:0,transition:{...f,marginLeft:{duration:f.duration/2,delay:f.duration-f.duration/2}}}};return o.jsxs(y,{...g,ref:w,href:n,"aria-label":l?void 0:t,className:a.fab,children:[o.jsx(te,{trigger:l?null:void 0,text:t,targetRef:w}),o.jsx("span",{className:a.stateLayer,children:o.jsx(A,{colorName:d({primary:r=="surface","on-primary-container":r=="primary","on-secondary-container":r=="secondary","on-tertiary-container":r=="tertiary"}),triggerRef:w})}),o.jsx(Y,{icon:i,className:a.icon}),o.jsx(I.AnimatePresence,{children:l&&o.jsx(I.motion.span,{variants:j,initial:"hidden",animate:"visible",exit:"hidden",className:a.label,children:t})})]})},ne=({variant:e="standard",href:t,disabled:r=!1,type:s="button",title:n,ariaLabel:u,onToggle:i,activated:l=!1,onClick:m,icon:f,size:g="medium",iconSelected:y,className:a,ref:b,width:w="default",shape:j="rounded",allowShapeTransformation:L=!0,transition:k,...v})=>{n||(n=u);const[N,M]=c.useState(l);let S;i?i&&(S=p=>{r&&p.preventDefault(),M(!N),i(!!N)},f=N&&y||f):S=p=>{r&&p.preventDefault(),m&&m(p)},c.useEffect(()=>{M(l)},[l]);const C=t?"a":"button",V=pe({transition:k,shape:j,allowShapeTransformation:L,width:w,href:t,activated:N,ariaLabel:u,iconSelected:y,isActive:N,onToggle:i,disabled:r,icon:f,variant:e,className:a,size:g,...v}),B=c.useRef(null),E=b||B;return k={duration:.3,...k},o.jsxs(C,{disabled:r,href:t,className:V.iconButton,"aria-label":u,...v,title:void 0,onClick:S,ref:E,children:[o.jsx(te,{targetRef:E,trigger:r?null:void 0,text:n}),o.jsxs("div",{style:{transition:k.duration+"s"},className:V.container,children:[o.jsx("div",{className:V.stateLayer,children:!r&&o.jsx(A,{colorName:d(e==="standard"&&{"on-surface-variant":!N,primary:N},e==="filled"&&{primary:!N&&!!i,"inverse-on-surface":N||!i},e==="tonal"&&{"on-surface-variant":!N&&!!i,"on-secondary-container":N||!i},e==="outlined"&&{"on-surface-variant":!N,"on-primary":N}),triggerRef:E})}),f&&o.jsx(Y,{icon:f,className:V.icon})]})]})},Ye=({className:e,valueFormatter:t,step:r=10,name:s,value:n=0,min:u=0,max:i=100,marks:l=[{value:0,label:"0"},{value:100,label:"100"}],ref:m,onChange:f,...g})=>{const y=x=>{const h=b(),P=a();return x===1/0?100:x===-1/0?0:(x-h)/(P-h)*100},a=(x=!1)=>x?i:i==1/0?l[(l==null?void 0:l.length)-1].value:i,b=(x=!1)=>x?u:u==-1/0?l[0].value:u,w=x=>{const h=b(!1);return(a(!1)-h)*x/100+h},[j,L]=c.useState(!1),k=c.useRef(null),v=m||k,[N,M]=c.useState(n),[S,C]=c.useState(y(n)),[V,B]=c.useState(!1),E=x=>{B(!0),L(!0),G(x)},p=()=>{B(!1),L(!1)};c.useEffect(()=>(V?(window.addEventListener("mouseup",p),window.addEventListener("mousemove",G),window.addEventListener("touchend",p),window.addEventListener("touchmove",G)):(window.removeEventListener("mouseup",p),window.removeEventListener("mousemove",G),window.removeEventListener("touchend",p),window.removeEventListener("touchmove",G)),()=>{window.removeEventListener("mouseup",p),window.removeEventListener("mousemove",G),window.removeEventListener("touchend",p),window.removeEventListener("touchmove",G)}),[V]);const D=xe({className:e,isChanging:j,marks:l,max:i,min:u,name:s,step:r,value:N,valueFormatter:t,onChange:f}),G=x=>{const h=v==null?void 0:v.current;if(h){const P=h.getBoundingClientRect().left,R=((x.type==="touchmove"||x.type==="touchstart"?x.touches[0].clientX:x.clientX)-P)/h.offsetWidth*100;q({pourcent:R})}},q=({pourcent:x,value:h})=>{if(x){if(x>=100){M(a(!0)),C(100);return}if(x<=0){M(b(!0)),C(0);return}h=w(x),h==b()&&(h=b(!0)),h==a()&&(h=a(!0))}else if(h!=null){if(h>=a()){M(a(!0)),C(100);return}if(h<=b()){M(b(!0)),C(0);return}x=y(h)}else return;r!=null?h=Math.round((h-b())/r)*r+b():l&&(h=l.reduce((P,W,R)=>{let $=W.value===1/0?a():W.value===-1/0?b():W.value,F=P.value===1/0?a():P.value===-1/0?b():P.value;return $=Math.abs($-h),F=Math.abs(F-h),$<F?W:P}).value),h>=a()&&(h=a(!0)),h<=b()&&(h=b(!0)),x=y(h),M(h),C(x),f&&f(h)},[K,U]=c.useState(0);c.useEffect(()=>{const x=()=>{v.current&&U(v.current.offsetWidth)};return x(),window.addEventListener("resize",x),()=>{window.removeEventListener("resize",x)}},[]);const _=x=>{switch(x.key){case"ArrowRight":if(r)q({value:N+r});else if(l){const h=l.find(P=>P.value>N);h&&q({value:h.value})}break;case"ArrowLeft":if(r)q({value:N-r});else if(l){const h=l.slice(0).reverse().find((P,W,R)=>N===1/0?W===1:P.value<N);h&&q({value:h.value})}break;default:return}};return o.jsxs("div",{tabIndex:0,onKeyDown:_,role:"slider","aria-valuemin":b(!0),"aria-valuemax":a(!0),"aria-valuenow":N,"aria-valuetext":N.toString(),className:D.slider,onMouseDown:E,onClick:G,ref:v,onTouchStart:E,onDragStart:x=>x.preventDefault(),...g,children:[o.jsx("input",{type:"hidden",name:s,value:N}),o.jsx("div",{className:D.activeTrack,style:{flex:S/100}}),o.jsx("div",{className:D.handle,children:o.jsx(I.AnimatePresence,{children:j&&o.jsx(I.motion.div,{className:D.valueIndicator,initial:"hidden",animate:"visible",exit:"hidden",style:{translate:"-50%",transformOrigin:"center bottom",textWrap:"nowrap"},variants:{visible:{opacity:1,scale:1},hidden:{opacity:1,scale:0}},transition:{duration:.1},children:t?t(N):N})})}),o.jsx("div",{className:D.inactiveTrack,style:{flex:1-S/100}}),o.jsx("div",{className:"w-[calc(100%-12px)] h-full absolute -translate-x-1/2 transform left-1/2",children:l&&l.map((x,h)=>{let P=null;const W=(j?9:10)/K*100,R=y(x.value);return R<=S-W?P=!0:R>=S+W&&(P=!1),o.jsx("div",{className:d(D.dot,{"bg-primary-container":P!=null&&P,"bg-primary":P!=null&&!P}),style:{left:`${y(x.value)}%`}},h)})})]})};/*!
|
|
2
2
|
* Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com
|
|
3
3
|
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
|
|
4
4
|
* Copyright 2024 Fonticons, Inc.
|
|
5
|
-
*/const Ye={prefix:"fas",iconName:"bars",icon:[448,512,["navicon"],"f0c9","M0 96C0 78.3 14.3 64 32 64l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 128C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32L32 448c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"]},_e={prefix:"fas",iconName:"circle-exclamation",icon:[512,512,["exclamation-circle"],"f06a","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]},ke={prefix:"fas",iconName:"xmark",icon:[384,512,[128473,10005,10006,10060,215,"close","multiply","remove","times"],"f00d","M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"]},Ze=({supportingText:e,className:t,duration:n,closeIcon:r=ke,onClose:s,...u})=>{const[l,i]=c.useState(!0),m=ye({className:t,closeIcon:r,duration:n,isVisible:l,onClose:s,supportingText:e});c.useEffect(()=>{n&&setTimeout(()=>{f()},n)},[n]);const f=()=>{i(!1),s==null||s()};return o.jsx(R.AnimatePresence,{children:l&&o.jsx(R.motion.div,{initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{duration:.1},className:m.snackbar,...u,children:o.jsxs("div",{className:m.container,children:[o.jsx("p",{className:m.supportingText,children:e}),o.jsx(ne,{onClick:()=>f(),className:m.icon,icon:r,arialLabel:"close the snackbar"})]})})})},Je=({selected:e=!1,className:t,activeIcon:n,disabled:r=!1,inactiveIcon:s,onChange:u,onClick:l,onKeyDown:i,ref:m,...f})=>{const[w,v]=c.useState(e),a=y=>{r||(b(),l&&l(y))},h=y=>{r||((y.key===" "||y.key==="Enter")&&(y.preventDefault(),b()),i&&i(y))},b=()=>{v(!w),u==null||u(!w)},j=ge({className:t,isSelected:w,activeIcon:n,inactiveIcon:s,disabled:r,selected:w,onChange:u}),S=c.useRef(null),E=m||S;return o.jsxs(R.motion.div,{role:"switch","aria-checked":w,tabIndex:r?-1:0,onKeyDown:h,onClick:a,ref:E,className:j.switch,...f,children:[o.jsx("input",{type:"hidden",value:w?"1":"0"}),o.jsxs(R.motion.div,{layout:!0,style:{translate:w?"50%":"-50%"},transition:{type:"spring",stiffness:700,damping:30},className:j.handleContainer,children:[o.jsx("div",{className:j.handle,children:(w?n:s)&&o.jsx(H,{className:j.icon,icon:w?n:s})}),o.jsx("div",{className:j.handleStateLayer})]})]})},Me=({className:e,onClick:t,label:n,variant:r="primary",href:s,icon:u,selectedTab:l,setSelectedTab:i,tabsId:m,index:f,onTabSelected:w,scrollable:v=!1,selected:a=!1,ref:h,...b})=>{const j=c.useRef(null),S=h||j,[E,y]=c.useState(a);c.useEffect(()=>{a&&l==null?y(!0):y(l==f&&f!=null)},[l]),c.useEffect(()=>{l==f&&w&&w({ref:S,index:f||0,label:n,icon:u})},[l]);const N=s?"a":"button",I=C=>{i&&i(f??null),t&&t(C)},M=we({className:e,onTabSelected:w,scrollable:v,selectedTab:l,index:f,tabsId:m,selected:E,variant:r,icon:u,label:n,isSelected:E,setSelectedTab:i,href:s});return o.jsxs(N,{...b,role:"tab","aria-selected":E,ref:S,href:s,className:M.tab,onClick:I,...b,children:[o.jsx("span",{className:M.stateLayer,children:o.jsx(Z,{colorName:r==="primary"&&E?"primary":"on-surface",triggerRef:S})}),o.jsxs("span",{className:M.content,children:[u&&o.jsx(H,{icon:u,className:M.icon}),o.jsx("span",{className:M.label,children:n}),E&&o.jsx(R.motion.span,{layoutId:`underline-${m}`,className:M.underline,transition:{duration:.3}})]})]})},Qe=({variant:e="primary",onTabSelected:t,children:n,className:r,selectedTab:s,setSelectedTab:u,scrollable:l=!1})=>{const[i,m]=c.useState(null);let f;s==0||s!=null?f=s:f=i;const w=u||m,v=c.Children.toArray(n).filter(S=>c.isValidElement(S)&&S.type===Me),a=c.useRef(null),h=S=>{if(t==null||t(S),l){const E=a.current,y=S.ref.current;if(E&&y){const N=y.offsetLeft+y.offsetWidth/2-E.offsetWidth/2;E.scrollTo({left:N,behavior:"smooth"})}}},b=c.useMemo(()=>ee(),[]),j=ve({children:n,onTabSelected:t,scrollable:l,selectedTab:f,setSelectedTab:w,className:r,variant:e});return o.jsx("div",{ref:a,role:"tablist",className:j.tabs,children:v.map((S,E)=>c.cloneElement(S,{key:E,index:E,variant:e,selectedTab:f,setSelectedTab:w,tabsId:b,onTabSelected:h,scrollable:l}))})},ze=({variant:e="filled",disabled:t=!1,errorText:n,placeholder:r,suffix:s,name:u,label:l,className:i,supportingText:m,trailingIcon:f,leadingIcon:w,type:v="text",textLine:a="singleLine",autoComplete:h="on",onChange:b,value:j,showSupportingText:S=!1,...E})=>{const[y,N]=c.useState(j??""),[I,M]=c.useState(!1),[C,B]=c.useState(!1),[P,k]=c.useState(S);c.useEffect(()=>{N(j??"")},[j]),c.useEffect(()=>{n!=null&&n.length?B(!0):B(!1)},[n]),c.useEffect(()=>{S?k(S):m!=null&&m.length?k(!0):k(!1)},[P,m]),c.useEffect(()=>{I&&B(!1)},[I]);const p=c.useRef(null),D=()=>{p.current&&!I&&p.current.focus()},A=()=>{M(!0)},q=V=>{const W=V.target.value;N(W),B(!1),typeof b=="function"&&b(W)},G=()=>{M(!1)},U=be({showSupportingText:P,isFocused:I,showErrorIcon:C,disabled:t,name:u,label:l,autoComplete:h,className:i,onChange:b,placeholder:r,supportingText:m,type:v,leadingIcon:w,trailingIcon:f,variant:e,errorText:n,value:y,suffix:s,textLine:a}),[Y]=c.useState(ee());let g,x;switch(a){case"multiLine":x=We,g={};break;case"textAreas":x="textarea",g={};break;case"singleLine":default:x="input",g={type:v};break}return o.jsxs("div",{className:U.textField,...E,children:[o.jsxs("fieldset",{onClick:D,className:U.content,children:[o.jsx("div",{className:U.stateLayer}),w&&o.jsx("div",{className:U.leadingIcon,children:c.isValidElement(w)?w:o.jsx(H,{className:"w-5 h-5",icon:w})}),!(!I&&!y.length||e=="filled")&&o.jsx(R.motion.legend,{variants:{hidden:{width:0,padding:0},visible:{width:"auto",padding:"0 8px"}},initial:"hidden",animate:!I&&!y.length?"hidden":"visible",className:"max-w-full ml-2 px-2 text-body-small h-0",transition:{duration:.2},children:o.jsx("span",{className:"transform inline-flex -translate-y-1/2",children:o.jsx(R.motion.span,{className:U.label,transition:{duration:.3},layoutId:Y,children:l})})}),o.jsxs("div",{className:"flex-1 relative",children:[(!I&&!y.length||e=="filled")&&o.jsx(R.motion.label,{htmlFor:u,className:d("absolute left-4 transition-all duration-300",{"text-body-small top-2":e=="filled"&&!(!I&&!y.length),"text-body-large top-1/2 transform -translate-y-1/2":!(e=="filled"&&!(!I&&!y.length))}),transition:{duration:.3},children:o.jsx(R.motion.span,{className:U.label,transition:{duration:.3},layoutId:e=="outlined"?Y:void 0,children:l})}),o.jsx(x,{ref:p,value:y,onChange:q,className:U.input,id:u,name:u,placeholder:I?r??void 0:"",onFocus:A,onBlur:G,disabled:t,autoComplete:h,"aria-invalid":!!(n!=null&&n.length),"aria-label":l,...g})]}),o.jsx("div",{className:U.activeIndicator}),!C&&o.jsxs(o.Fragment,{children:[f&&o.jsx("div",{onClick:V=>{V.stopPropagation()},className:U.trailingIcon,children:c.isValidElement(f)?f:o.jsx(H,{className:"h-5",icon:f})}),!f&&s&&o.jsx("span",{className:U.suffix,children:s})]}),C&&o.jsx("div",{className:d(U.trailingIcon,{" absolute right-0":!f}),children:o.jsx(H,{className:"h-5 text-error",icon:_e})})]}),P&&o.jsx("p",{className:U.supportingText,children:n!=null&&n.length?n:m!=null&&m.length?m:" "})]})},Te=X("navigationRailItem",({isSelected:e,icon:t,label:n,variant:r})=>({navigationRailItem:d(" group flex flex-col pt-1 pb-1.5 cursor-pointer",{"text-on-surface-variant":!e,"text-on-secondary-container":e,"gap-2 h-[68px]":r=="vertical","gap-0 h-[66px]":r=="horizontal"}),container:d(" w-fit flex justify-center relative rounded-full items-center mx-5",{"bg-secondary-container overflow-hidden":e,"gap-2 ":r=="horizontal","gap-0 ":r=="vertical","p-4":!n},n&&["px-4",{"py-1 ":r=="vertical","py-4 ":r=="horizontal"}]),stateLayer:d(" absolute w-full rounded-full h-full left-0 top-0 ",{"group-state-on-surface":!e,"group-state-on-secondary-container":e}),icon:d("size-6 flex"),label:d("w-fit mx-auto",{"text-label-large ":r=="horizontal","text-label-medium":r=="vertical"})})),Ce=({label:e})=>o.jsx("div",{className:" h-9 flex items-center mx-9 mt-3",children:o.jsx("p",{className:"text-label-large text-on-surface-variant",children:e})}),Ve=({className:e,onClick:t,label:n,variant:r="vertical",href:s,icon:u,selectedItem:l,setSelectedItem:i,index:m,onItemSelected:f,selected:w=!1,ref:v,transition:a,isExtended:h,iconSelected:b,style:j,extendedOnly:S,...E})=>{const y=c.useRef(null),N=v||y,[I,M]=c.useState(w);c.useEffect(()=>{w&&l==null?M(!0):M(l==m&&m!=null)},[l]),c.useEffect(()=>{l==m&&f&&f({ref:N,index:m||0,label:n,icon:u})},[l]);const C=s?"a":"button",B=k=>{i&&i(m??null),t&&t(k)},P=Te({isExtended:h,extendedOnly:S,className:e,onItemSelected:f,selectedItem:l,index:m,transition:a,selected:I,variant:r,icon:u,label:n,isSelected:I,setSelectedItem:i,href:s,iconSelected:b});return a={duration:.3,...a},S&&!h?null:o.jsxs(C,{...E,role:"tab","aria-selected":I,ref:N,href:s,className:P.navigationRailItem,onClick:B,style:{transition:a.duration+"s",...j},children:[o.jsxs(R.motion.div,{style:{transition:r=="horizontal"?a.duration+`s, gap ${a.duration/2}s ${a.duration-a.duration/2}s`:a.duration+`s, gap ${a.duration/3}s ${a.duration-a.duration/3}s`},transition:a,className:P.container,children:[o.jsx(R.motion.div,{layout:!0,className:P.stateLayer}),u&&o.jsx(H,{icon:I?b:u,className:P.icon}),o.jsx(R.AnimatePresence,{children:r=="horizontal"&&(()=>{const k={width:0,opacity:0,transition:{...a}},p={width:"auto",opacity:1,transition:{...a,opacity:{duration:a.duration/2,delay:a.duration-a.duration/2}}};return o.jsx(R.motion.span,{initial:k,animate:p,exit:k,className:P.label,children:n})})()})]}),o.jsx(R.AnimatePresence,{children:r=="vertical"&&(()=>{const k={height:0,opacity:0,transition:{...a,opacity:{duration:0}}},p={height:"auto",opacity:1,transition:{...a,opacity:{duration:a.duration/3,delay:a.duration-a.duration/3}}};return o.jsx(R.motion.span,{initial:k,animate:p,exit:k,className:P.label,transition:a,children:n})})()})]})},et=X("navigationRail",({isExtended:e,alignment:t})=>({navigationRail:d("flex flex-col left-0 h-full top-0 pt-11",{"w-fit max-w-24":!e,"w-fit min-w-[220px] max-w-[360px]":e,"justify-between":t=="middle","justify-start":t=="top"}),header:d("flex flex-col gap-1 items-start"),menuIcon:"mx-5",segments:d(" flex flex-col overflow-auto min-w-full mt-10",{"w-full":!e,"w-fit items-start":e})})),tt=({variant:e="standard",onItemSelected:t,children:n,className:r,selectedItem:s,extended:u,alignment:l="top",menu:i={closed:{icon:Ye,label:"Open menu"},opened:{icon:ke,label:"Close menu"}},style:m,onExtendedChange:f,transition:w,setSelectedItem:v})=>{const[a,h]=c.useState(null),[b,j]=c.useState(u);let S;s==0||s!=null?S=s:S=a;const E=v||h,y=c.useRef(null),N=k=>{t==null||t(k)};function I(k){const p=[];return c.Children.forEach(k,D=>{c.isValidElement(D)&&D.type===c.Fragment?p.push(...I(D.props.children)):p.push(D)}),p}const M=I(n),C=M.filter(k=>c.isValidElement(k)&&k.type===z),B=et({children:n,onItemSelected:t,selectedItem:S,setSelectedItem:E,className:r,variant:e,extended:b,isExtended:b,alignment:l,menu:i,transition:w,onExtendedChange:f});w={duration:.3,...w};const P=c.useRef(!1);return P.current=!1,c.useEffect(()=>{f==null||f(b??!1)},[b]),o.jsxs("div",{style:{transition:w.duration+"s",...m},ref:y,className:B.navigationRail,children:[o.jsxs("div",{className:B.header,children:[o.jsx(ne,{onClick:()=>j(!b),arialLabel:b?i==null?void 0:i.opened.label:i==null?void 0:i.closed.label,className:B.menuIcon,icon:b?i.opened.icon:i==null?void 0:i.closed.icon}),C.length>0&&c.cloneElement(C[0],{transition:w,isExtended:b,className:"!shadow-none mx-5 "+C[0].props.className})]}),o.jsx("div",{className:B.segments,children:(()=>{let k=0;return M.map(p=>c.isValidElement(p)&&p.type===Ve?c.cloneElement(p,{key:k,index:k++,variant:b?"horizontal":"vertical",selectedItem:S,setSelectedItem:E,onItemSelected:N,transition:w,extendedOnly:P.current,isExtended:b}):c.isValidElement(p)&&p.type===z?null:c.isValidElement(p)&&p.type===Ce?(P.current=!0,b?c.cloneElement(p,{}):null):p)})()}),o.jsx("div",{className:"flex-1 max-h-[160px]"})]})};exports.Button=Le;exports.Card=Ue;exports.Carousel=Xe;exports.CarouselItem=Ie;exports.CustomScroll=T;exports.Divider=qe;exports.Fab=z;exports.Icon=H;exports.IconButton=ne;exports.NavigationRail=tt;exports.NavigationRailItem=Ve;exports.NavigationRailSection=Ce;exports.ProgressIndicator=Ne;exports.RippleEffect=Z;exports.Slider=He;exports.SmoothScroll=Fe;exports.Snackbar=Ze;exports.Switch=Je;exports.SyncedFixedWrapper=Ee;exports.Tab=Me;exports.Tabs=Qe;exports.TextField=ze;exports.ToolTip=te;exports.buttonStyle=ce;exports.cardStyle=ie;exports.carouselItemStyle=ue;exports.carouselStyle=fe;exports.classNames=d;exports.classnames=oe;exports.customScrollStyle=Se;exports.defaultClassNames=X;exports.dividerStyle=de;exports.fabStyle=me;exports.getClassNames=ae;exports.iconButtonStyle=pe;exports.normalize=Re;exports.progressIndicatorStyle=he;exports.sliderStyle=xe;exports.snackbarStyle=ye;exports.switchStyle=ge;exports.tabStyle=we;exports.tabsStyle=ve;exports.textFieldStyle=be;exports.toolStyle=je;
|
|
5
|
+
*/const _e={prefix:"fas",iconName:"bars",icon:[448,512,["navicon"],"f0c9","M0 96C0 78.3 14.3 64 32 64l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 128C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32L32 448c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"]},Ze={prefix:"fas",iconName:"circle-exclamation",icon:[512,512,["exclamation-circle"],"f06a","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]},ke={prefix:"fas",iconName:"xmark",icon:[384,512,[128473,10005,10006,10060,215,"close","multiply","remove","times"],"f00d","M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"]},Ae=({supportingText:e,className:t,duration:r,closeIcon:s=ke,onClose:n,...u})=>{const[i,l]=c.useState(!0),m=ye({className:t,closeIcon:s,duration:r,isVisible:i,onClose:n,supportingText:e});c.useEffect(()=>{r&&setTimeout(()=>{f()},r)},[r]);const f=()=>{l(!1),n==null||n()};return o.jsx(I.AnimatePresence,{children:i&&o.jsx(I.motion.div,{initial:{height:0},animate:{height:"auto"},exit:{height:0},transition:{duration:.1},className:m.snackbar,...u,children:o.jsxs("div",{className:m.container,children:[o.jsx("p",{className:m.supportingText,children:e}),o.jsx(ne,{onClick:()=>f(),className:m.icon,icon:s,ariaLabel:"close the snackbar"})]})})})},Je=({selected:e=!1,className:t,activeIcon:r,disabled:s=!1,inactiveIcon:n,onChange:u,onClick:i,onKeyDown:l,ref:m,...f})=>{const[g,y]=c.useState(e),a=v=>{s||(w(),i&&i(v))},b=v=>{s||((v.key===" "||v.key==="Enter")&&(v.preventDefault(),w()),l&&l(v))},w=()=>{y(!g),u==null||u(!g)},j=ge({className:t,isSelected:g,activeIcon:r,inactiveIcon:n,disabled:s,selected:g,onChange:u}),L=c.useRef(null),k=m||L;return o.jsxs(I.motion.div,{role:"switch","aria-checked":g,tabIndex:s?-1:0,onKeyDown:b,onClick:a,ref:k,className:j.switch,...f,children:[o.jsx("input",{type:"hidden",value:g?"1":"0"}),o.jsxs(I.motion.div,{layout:!0,style:{translate:g?"50%":"-50%"},transition:{type:"spring",stiffness:700,damping:30},className:j.handleContainer,children:[o.jsx("div",{className:j.handle,children:(g?r:n)&&o.jsx(Y,{className:j.icon,icon:g?r:n})}),o.jsx("div",{className:j.handleStateLayer})]})]})},Me=({className:e,onClick:t,label:r,variant:s="primary",href:n,icon:u,selectedTab:i,setSelectedTab:l,tabsId:m,index:f,onTabSelected:g,scrollable:y=!1,selected:a=!1,ref:b,...w})=>{const j=c.useRef(null),L=b||j,[k,v]=c.useState(a);c.useEffect(()=>{a&&i==null?v(!0):v(i==f&&f!=null)},[i]),c.useEffect(()=>{i==f&&g&&g({ref:L,index:f||0,label:r,icon:u})},[i]);const N=n?"a":"button",M=C=>{l&&l(f??null),t&&t(C)},S=we({className:e,onTabSelected:g,scrollable:y,selectedTab:i,index:f,tabsId:m,selected:k,variant:s,icon:u,label:r,isSelected:k,setSelectedTab:l,href:n});return o.jsxs(N,{...w,role:"tab","aria-selected":k,ref:L,href:n,className:S.tab,onClick:M,...w,children:[o.jsx("span",{className:S.stateLayer,children:o.jsx(A,{colorName:s==="primary"&&k?"primary":"on-surface",triggerRef:L})}),o.jsxs("span",{className:S.content,children:[u&&o.jsx(Y,{icon:u,className:S.icon}),o.jsx("span",{className:S.label,children:r}),k&&o.jsx(I.motion.span,{layoutId:`underline-${m}`,className:S.underline,transition:{duration:.3}})]})]})},Qe=({variant:e="primary",onTabSelected:t,children:r,className:s,selectedTab:n,setSelectedTab:u,scrollable:i=!1})=>{const[l,m]=c.useState(null);let f;n==0||n!=null?f=n:f=l;const g=u||m,y=c.Children.toArray(r).filter(L=>c.isValidElement(L)&&L.type===Me),a=c.useRef(null),b=L=>{if(t==null||t(L),i){const k=a.current,v=L.ref.current;if(k&&v){const N=v.offsetLeft+v.offsetWidth/2-k.offsetWidth/2;k.scrollTo({left:N,behavior:"smooth"})}}},w=c.useMemo(()=>ee(),[]),j=ve({children:r,onTabSelected:t,scrollable:i,selectedTab:f,setSelectedTab:g,className:s,variant:e});return o.jsx("div",{ref:a,role:"tablist",className:j.tabs,children:y.map((L,k)=>c.cloneElement(L,{key:k,index:k,variant:e,selectedTab:f,setSelectedTab:g,tabsId:w,onTabSelected:b,scrollable:i}))})},ze=({variant:e="filled",disabled:t=!1,errorText:r,placeholder:s,suffix:n,name:u,label:i,className:l,supportingText:m,trailingIcon:f,leadingIcon:g,type:y="text",textLine:a="singleLine",autoComplete:b="on",onChange:w,value:j,showSupportingText:L=!1,...k})=>{const[v,N]=c.useState(j??""),[M,S]=c.useState(!1),[C,V]=c.useState(!1),[B,E]=c.useState(L);c.useEffect(()=>{N(j??"")},[j]),c.useEffect(()=>{r!=null&&r.length?V(!0):V(!1)},[r]),c.useEffect(()=>{L?E(L):m!=null&&m.length?E(!0):E(!1)},[B,m]),c.useEffect(()=>{M&&V(!1)},[M]);const p=c.useRef(null),D=()=>{p.current&&!M&&p.current.focus()},G=()=>{S(!0)},q=P=>{const W=P.target.value;N(W),V(!1),typeof w=="function"&&w(W)},K=()=>{S(!1)},U=be({showSupportingText:B,isFocused:M,showErrorIcon:C,disabled:t,name:u,label:i,autoComplete:b,className:l,onChange:w,placeholder:s,supportingText:m,type:y,leadingIcon:g,trailingIcon:f,variant:e,errorText:r,value:v,suffix:n,textLine:a}),[_]=c.useState(ee());let x,h;switch(a){case"multiLine":h=We,x={};break;case"textAreas":h="textarea",x={};break;case"singleLine":default:h="input",x={type:y};break}return o.jsxs("div",{className:U.textField,...k,children:[o.jsxs("fieldset",{onClick:D,className:U.content,children:[o.jsx("div",{className:U.stateLayer}),g&&o.jsx("div",{className:U.leadingIcon,children:c.isValidElement(g)?g:o.jsx(Y,{className:"w-5 h-5",icon:g})}),!(!M&&!v.length||e=="filled")&&o.jsx(I.motion.legend,{variants:{hidden:{width:0,padding:0},visible:{width:"auto",padding:"0 8px"}},initial:"hidden",animate:!M&&!v.length?"hidden":"visible",className:"max-w-full ml-2 px-2 text-body-small h-0",transition:{duration:.2},children:o.jsx("span",{className:"transform inline-flex -translate-y-1/2",children:o.jsx(I.motion.span,{className:U.label,transition:{duration:.3},layoutId:_,children:i})})}),o.jsxs("div",{className:"flex-1 relative",children:[(!M&&!v.length||e=="filled")&&o.jsx(I.motion.label,{htmlFor:u,className:d("absolute left-4 transition-all duration-300",{"text-body-small top-2":e=="filled"&&!(!M&&!v.length),"text-body-large top-1/2 transform -translate-y-1/2":!(e=="filled"&&!(!M&&!v.length))}),transition:{duration:.3},children:o.jsx(I.motion.span,{className:U.label,transition:{duration:.3},layoutId:e=="outlined"?_:void 0,children:i})}),o.jsx(h,{ref:p,value:v,onChange:q,className:U.input,id:u,name:u,placeholder:M?s??void 0:"",onFocus:G,onBlur:K,disabled:t,autoComplete:b,"aria-invalid":!!(r!=null&&r.length),"aria-label":i,...x})]}),o.jsx("div",{className:U.activeIndicator}),!C&&o.jsxs(o.Fragment,{children:[f&&o.jsx("div",{onClick:P=>{P.stopPropagation()},className:U.trailingIcon,children:c.isValidElement(f)?f:o.jsx(Y,{className:"h-5",icon:f})}),!f&&n&&o.jsx("span",{className:U.suffix,children:n})]}),C&&o.jsx("div",{className:d(U.trailingIcon,{" absolute right-0":!f}),children:o.jsx(Y,{className:"h-5 text-error",icon:Ze})})]}),B&&o.jsx("p",{className:U.supportingText,children:r!=null&&r.length?r:m!=null&&m.length?m:" "})]})},Te=X("navigationRailItem",({isSelected:e,icon:t,label:r,variant:s})=>({navigationRailItem:d(" group flex flex-col pt-1 pb-1.5 cursor-pointer",{"text-on-surface-variant":!e,"text-on-secondary-container":e,"gap-2 h-[68px]":s=="vertical","gap-0 h-[66px]":s=="horizontal"}),container:d(" w-fit flex justify-center relative rounded-full items-center mx-5",{"bg-secondary-container overflow-hidden":e,"gap-2 ":s=="horizontal","gap-0 ":s=="vertical","p-4":!r},r&&["px-4",{"py-1 ":s=="vertical","py-4 ":s=="horizontal"}]),stateLayer:d(" absolute w-full rounded-full h-full left-0 top-0 ",{"group-state-on-surface":!e,"group-state-on-secondary-container":e}),icon:d("size-6 flex"),label:d("w-fit mx-auto",{"text-label-large ":s=="horizontal","text-label-medium":s=="vertical"})})),Ce=({label:e})=>o.jsx("div",{className:" h-9 flex items-center mx-9 mt-3",children:o.jsx("p",{className:"text-label-large text-on-surface-variant",children:e})}),Be=({className:e,onClick:t,label:r,variant:s="vertical",href:n,icon:u,selectedItem:i,setSelectedItem:l,index:m,onItemSelected:f,selected:g=!1,ref:y,transition:a,isExtended:b,iconSelected:w,style:j,extendedOnly:L,...k})=>{const v=c.useRef(null),N=y||v,[M,S]=c.useState(g);c.useEffect(()=>{g&&i==null?S(!0):S(i==m&&m!=null)},[i]),c.useEffect(()=>{i==m&&f&&f({ref:N,index:m||0,label:r,icon:u})},[i]);const C=n?"a":"button",V=E=>{l&&l(m??null),t&&t(E)},B=Te({isExtended:b,extendedOnly:L,className:e,onItemSelected:f,selectedItem:i,index:m,transition:a,selected:M,variant:s,icon:u,label:r,isSelected:M,setSelectedItem:l,href:n,iconSelected:w});return a={duration:.3,...a},L&&!b?null:o.jsxs(C,{...k,role:"tab","aria-selected":M,ref:N,href:n,className:B.navigationRailItem,onClick:V,style:{transition:a.duration+"s",...j},children:[o.jsxs(I.motion.div,{style:{transition:s=="horizontal"?a.duration+`s, gap ${a.duration/2}s ${a.duration-a.duration/2}s`:a.duration+`s, gap ${a.duration/3}s ${a.duration-a.duration/3}s`},transition:a,className:B.container,children:[o.jsx(I.motion.div,{layout:!0,className:B.stateLayer}),u&&o.jsx(Y,{icon:M?w:u,className:B.icon}),o.jsx(I.AnimatePresence,{children:s=="horizontal"&&(()=>{const E={width:0,opacity:0,transition:{...a}},p={width:"auto",opacity:1,transition:{...a,opacity:{duration:a.duration/2,delay:a.duration-a.duration/2}}};return o.jsx(I.motion.span,{initial:E,animate:p,exit:E,className:B.label,children:r})})()})]}),o.jsx(I.AnimatePresence,{children:s=="vertical"&&(()=>{const E={height:0,opacity:0,transition:{...a,opacity:{duration:0}}},p={height:"auto",opacity:1,transition:{...a,opacity:{duration:a.duration/3,delay:a.duration-a.duration/3}}};return o.jsx(I.motion.span,{initial:E,animate:p,exit:E,className:B.label,transition:a,children:r})})()})]})},et=X("navigationRail",({isExtended:e,alignment:t})=>({navigationRail:d("flex flex-col left-0 h-full top-0 pt-11",{"w-fit max-w-24":!e,"w-fit min-w-[220px] max-w-[360px]":e,"justify-between":t=="middle","justify-start":t=="top"}),header:d("flex flex-col gap-1 items-start"),menuIcon:"mx-5",segments:d(" flex flex-col overflow-auto min-w-full mt-10",{"w-full":!e,"w-fit items-start":e})})),tt=({variant:e="standard",onItemSelected:t,children:r,className:s,selectedItem:n,extended:u,alignment:i="top",menu:l={closed:{icon:_e,label:"Open menu"},opened:{icon:ke,label:"Close menu"}},style:m,onExtendedChange:f,transition:g,setSelectedItem:y})=>{const[a,b]=c.useState(null),[w,j]=c.useState(u);let L;n==0||n!=null?L=n:L=a;const k=y||b,v=c.useRef(null),N=E=>{t==null||t(E)};function M(E){const p=[];return c.Children.forEach(E,D=>{c.isValidElement(D)&&D.type===c.Fragment?p.push(...M(D.props.children)):p.push(D)}),p}const S=M(r),C=S.filter(E=>c.isValidElement(E)&&E.type===z),V=et({children:r,onItemSelected:t,selectedItem:L,setSelectedItem:k,className:s,variant:e,extended:w,isExtended:w,alignment:i,menu:l,transition:g,onExtendedChange:f});g={duration:.3,...g};const B=c.useRef(!1);return B.current=!1,c.useEffect(()=>{f==null||f(w??!1)},[w]),o.jsxs("div",{style:{transition:g.duration+"s",...m},ref:v,className:V.navigationRail,children:[o.jsxs("div",{className:V.header,children:[o.jsx(ne,{onClick:()=>j(!w),ariaLabel:w?l==null?void 0:l.opened.label:l==null?void 0:l.closed.label,className:V.menuIcon,icon:w?l.opened.icon:l==null?void 0:l.closed.icon}),C.length>0&&c.cloneElement(C[0],{transition:g,isExtended:w,className:"!shadow-none mx-5 "+C[0].props.className})]}),o.jsx("div",{className:V.segments,children:(()=>{let E=0;return S.map(p=>c.isValidElement(p)&&p.type===Be?c.cloneElement(p,{key:E,index:E++,variant:w?"horizontal":"vertical",selectedItem:L,setSelectedItem:k,onItemSelected:N,transition:g,extendedOnly:B.current,isExtended:w}):c.isValidElement(p)&&p.type===z?null:c.isValidElement(p)&&p.type===Ce?(B.current=!0,w?c.cloneElement(p,{}):null):p)})()}),o.jsx("div",{className:"flex-1 max-h-[160px]"})]})};exports.Button=Le;exports.Card=Ue;exports.Carousel=Xe;exports.CarouselItem=Ie;exports.CustomScroll=T;exports.Divider=qe;exports.Fab=z;exports.Icon=Y;exports.IconButton=ne;exports.NavigationRail=tt;exports.NavigationRailItem=Be;exports.NavigationRailSection=Ce;exports.ProgressIndicator=Ne;exports.RippleEffect=A;exports.Slider=Ye;exports.SmoothScroll=Fe;exports.Snackbar=Ae;exports.Switch=Je;exports.SyncedFixedWrapper=Ee;exports.Tab=Me;exports.Tabs=Qe;exports.TextField=ze;exports.ToolTip=te;exports.buttonStyle=ce;exports.cardStyle=ie;exports.carouselItemStyle=ue;exports.carouselStyle=fe;exports.classNames=d;exports.classnames=oe;exports.customScrollStyle=Se;exports.defaultClassNames=X;exports.dividerStyle=de;exports.fabStyle=me;exports.getClassNames=ae;exports.iconButtonStyle=pe;exports.normalize=Re;exports.progressIndicatorStyle=he;exports.sliderStyle=xe;exports.snackbarStyle=ye;exports.switchStyle=ge;exports.tabStyle=we;exports.tabsStyle=ve;exports.textFieldStyle=be;exports.toolStyle=je;
|