@tsiky/components-r19 1.8.0 → 1.8.1

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/dist/index.cjs.js CHANGED
@@ -8166,7 +8166,7 @@
8166
8166
  ${g}px !important;
8167
8167
  top: ${p}px !important;
8168
8168
  }
8169
- `),()=>{M.contains(f)&&M.removeChild(f)}},[t]),o.jsx(M0e,{isPresent:t,childRef:r,sizeRef:s,children:Z.cloneElement(e,{ref:l})})}const x0e=({children:e,initial:t,isPresent:n,onExitComplete:c,custom:i,presenceAffectsLayout:r,mode:s,anchorX:d,root:l})=>{const h=zt(L0e),u=k.useId();let p=!0,y=k.useMemo(()=>(p=!1,{id:u,initial:t,isPresent:n,custom:i,onExitComplete:m=>{h.set(m,!0);for(const g of h.values())if(!g)return;c&&c()},register:m=>(h.set(m,!1),()=>h.delete(m))}),[n,h,c]);return r&&p&&(y={...y}),k.useMemo(()=>{h.forEach((m,g)=>h.set(g,!1))},[n]),Z.useEffect(()=>{!n&&!h.size&&c&&c()},[n]),s==="popLayout"&&(e=o.jsx(_0e,{isPresent:n,anchorX:d,root:l,children:e})),o.jsx(yL.Provider,{value:y,children:e})};function L0e(){return new Map}function w$(e=!0){const t=k.useContext(yL);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:c,register:i}=t,r=k.useId();k.useEffect(()=>{if(e)return i(r)},[e]);const s=k.useCallback(()=>e&&c&&c(r),[r,c,e]);return!n&&c?[!1,s]:[!0]}const Y1=e=>e.key||"";function bC(e){const t=[];return k.Children.forEach(e,n=>{k.isValidElement(n)&&t.push(n)}),t}const I0e=({children:e,custom:t,initial:n=!0,onExitComplete:c,presenceAffectsLayout:i=!0,mode:r="sync",propagate:s=!1,anchorX:d="left",root:l})=>{const[h,u]=w$(s),p=k.useMemo(()=>bC(e),[e]),y=s&&!h?[]:p.map(Y1),m=k.useRef(!0),g=k.useRef(p),f=zt(()=>new Map),[M,_]=k.useState(p),[v,L]=k.useState(p);uw(()=>{m.current=!1,g.current=p;for(let b=0;b<v.length;b++){const x=Y1(v[b]);y.includes(x)?f.delete(x):f.get(x)!==!0&&f.set(x,!1)}},[v,y.length,y.join("-")]);const w=[];if(p!==M){let b=[...p];for(let x=0;x<v.length;x++){const I=v[x],S=Y1(I);y.includes(S)||(b.splice(x,0,I),w.push(I))}return r==="wait"&&w.length&&(b=w),L(bC(b)),_(p),null}process.env.NODE_ENV!=="production"&&r==="wait"&&v.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:C}=k.useContext(lw);return o.jsx(o.Fragment,{children:v.map(b=>{const x=Y1(b),I=s&&!h?!1:p===v||y.includes(x),S=()=>{if(f.has(x))f.set(x,!0);else return;let j=!0;f.forEach($=>{$||(j=!1)}),j&&(C?.(),L(g.current),s&&u?.(),c&&c())};return o.jsx(x0e,{isPresent:I,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:r,root:l,onExitComplete:I?void 0:S,anchorX:d,children:b},x)})})},C$=k.createContext({strict:!1}),wC={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},e1={};for(const e in wC)e1[e]={isEnabled:t=>wC[e].some(n=>!!t[n])};function b0e(e){for(const t in e)e1[t]={...e1[t],...e[t]}}const w0e=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function sL(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||w0e.has(e)}let N$=e=>!sL(e);function C0e(e){typeof e=="function"&&(N$=t=>t.startsWith("on")?!sL(t):e(t))}try{C0e(require("@emotion/is-prop-valid").default)}catch{}function N0e(e,t,n){const c={};for(const i in e)i==="values"&&typeof e.values=="object"||(N$(i)||n===!0&&sL(i)||!t&&!sL(i)||e.draggable&&i.startsWith("onDrag"))&&(c[i]=e[i]);return c}const mL=k.createContext({});function fL(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function D1(e){return typeof e=="string"||Array.isArray(e)}const zw=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Vw=["initial",...zw];function gL(e){return fL(e.animate)||Vw.some(t=>D1(e[t]))}function j$(e){return!!(gL(e)||e.variants)}function j0e(e,t){if(gL(e)){const{initial:n,animate:c}=e;return{initial:n===!1||D1(n)?n:void 0,animate:D1(c)?c:void 0}}return e.inherit!==!1?t:{}}function S0e(e){const{initial:t,animate:n}=j0e(e,k.useContext(mL));return k.useMemo(()=>({initial:t,animate:n}),[CC(t),CC(n)])}function CC(e){return Array.isArray(e)?e.join(" "):e}const B1={};function $0e(e){for(const t in e)B1[t]=e[t],Mw(t)&&(B1[t].isCSSVariable=!0)}function S$(e,{layout:t,layoutId:n}){return o1.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!B1[e]||e==="opacity")}const q0e={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},A0e=n1.length;function z0e(e,t,n){let c="",i=!0;for(let r=0;r<A0e;r++){const s=n1[r],d=e[s];if(d===void 0)continue;let l=!0;if(typeof d=="number"?l=d===(s.startsWith("scale")?1:0):l=parseFloat(d)===0,!l||n){const h=M$(d,$w[s]);if(!l){i=!1;const u=q0e[s]||s;c+=`${u}(${h}) `}n&&(t[s]=h)}}return c=c.trim(),n?c=n(t,i?"":c):i&&(c="none"),c}function Pw(e,t,n){const{style:c,vars:i,transformOrigin:r}=e;let s=!1,d=!1;for(const l in t){const h=t[l];if(o1.has(l)){s=!0;continue}else if(Mw(l)){i[l]=h;continue}else{const u=M$(h,$w[l]);l.startsWith("origin")?(d=!0,r[l]=u):c[l]=u}}if(t.transform||(s||n?c.transform=z0e(t,e.transform,n):c.transform&&(c.transform="none")),d){const{originX:l="50%",originY:h="50%",originZ:u=0}=r;c.transformOrigin=`${l} ${h} ${u}`}}const Tw=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function $$(e,t,n){for(const c in t)!Ne(t[c])&&!S$(c,n)&&(e[c]=t[c])}function V0e({transformTemplate:e},t){return k.useMemo(()=>{const n=Tw();return Pw(n,t,e),Object.assign({},n.vars,n.style)},[t])}function P0e(e,t){const n=e.style||{},c={};return $$(c,n,e),Object.assign(c,V0e(e,t)),c}function T0e(e,t){const n={},c=P0e(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,c.userSelect=c.WebkitUserSelect=c.WebkitTouchCallout="none",c.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=c,n}const H0e={offset:"stroke-dashoffset",array:"stroke-dasharray"},D0e={offset:"strokeDashoffset",array:"strokeDasharray"};function B0e(e,t,n=1,c=0,i=!0){e.pathLength=1;const r=i?H0e:D0e;e[r.offset]=U.transform(-c);const s=U.transform(t),d=U.transform(n);e[r.array]=`${s} ${d}`}function q$(e,{attrX:t,attrY:n,attrScale:c,pathLength:i,pathSpacing:r=1,pathOffset:s=0,...d},l,h,u){if(Pw(e,d,h),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:p,style:y}=e;p.transform&&(y.transform=p.transform,delete p.transform),(y.transform||p.transformOrigin)&&(y.transformOrigin=p.transformOrigin??"50% 50%",delete p.transformOrigin),y.transform&&(y.transformBox=u?.transformBox??"fill-box",delete p.transformBox),t!==void 0&&(p.x=t),n!==void 0&&(p.y=n),c!==void 0&&(p.scale=c),i!==void 0&&B0e(p,i,r,s,!1)}const A$=()=>({...Tw(),attrs:{}}),z$=e=>typeof e=="string"&&e.toLowerCase()==="svg";function R0e(e,t,n,c){const i=k.useMemo(()=>{const r=A$();return q$(r,t,z$(c),e.transformTemplate,e.style),{...r.attrs,style:{...r.style}}},[t]);if(e.style){const r={};$$(r,e.style,e),i.style={...r,...i.style}}return i}const F0e=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Hw(e){return typeof e!="string"||e.includes("-")?!1:!!(F0e.indexOf(e)>-1||/[A-Z]/u.test(e))}function E0e(e,t,n,{latestValues:c},i,r=!1){const d=(Hw(e)?R0e:T0e)(t,c,i,e),l=N0e(t,typeof e=="string",r),h=e!==k.Fragment?{...l,...d,ref:n}:{},{children:u}=t,p=k.useMemo(()=>Ne(u)?u.get():u,[u]);return k.createElement(e,{...h,children:p})}function NC(e){const t=[{},{}];return e?.values.forEach((n,c)=>{t[0][c]=n.get(),t[1][c]=n.getVelocity()}),t}function Dw(e,t,n,c){if(typeof t=="function"){const[i,r]=NC(c);t=t(n!==void 0?n:e.custom,i,r)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,r]=NC(c);t=t(n!==void 0?n:e.custom,i,r)}return t}function Qx(e){return Ne(e)?e.get():e}function O0e({scrapeMotionValuesFromProps:e,createRenderState:t},n,c,i){return{latestValues:U0e(n,c,i,e),renderState:t()}}function U0e(e,t,n,c){const i={},r=c(e,{});for(const y in r)i[y]=Qx(r[y]);let{initial:s,animate:d}=e;const l=gL(e),h=j$(e);t&&h&&!l&&e.inherit!==!1&&(s===void 0&&(s=t.initial),d===void 0&&(d=t.animate));let u=n?n.initial===!1:!1;u=u||s===!1;const p=u?d:s;if(p&&typeof p!="boolean"&&!fL(p)){const y=Array.isArray(p)?p:[p];for(let m=0;m<y.length;m++){const g=Dw(e,y[m]);if(g){const{transitionEnd:f,transition:M,..._}=g;for(const v in _){let L=_[v];if(Array.isArray(L)){const w=u?L.length-1:0;L=L[w]}L!==null&&(i[v]=L)}for(const v in f)i[v]=f[v]}}}return i}const V$=e=>(t,n)=>{const c=k.useContext(mL),i=k.useContext(yL),r=()=>O0e(e,t,c,i);return n?r():zt(r)};function Bw(e,t,n){const{style:c}=e,i={};for(const r in c)(Ne(c[r])||t.style&&Ne(t.style[r])||S$(r,e)||n?.getValue(r)?.liveStyle!==void 0)&&(i[r]=c[r]);return i}const W0e=V$({scrapeMotionValuesFromProps:Bw,createRenderState:Tw});function P$(e,t,n){const c=Bw(e,t,n);for(const i in e)if(Ne(e[i])||Ne(t[i])){const r=n1.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;c[r]=e[i]}return c}const G0e=V$({scrapeMotionValuesFromProps:P$,createRenderState:A$}),K0e=Symbol.for("motionComponentSymbol");function Ec(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Z0e(e,t,n){return k.useCallback(c=>{c&&e.onMount&&e.onMount(c),t&&(c?t.mount(c):t.unmount()),n&&(typeof n=="function"?n(c):Ec(n)&&(n.current=c))},[t])}const Rw=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),X0e="framerAppearId",T$="data-"+Rw(X0e),H$=k.createContext({});function Y0e(e,t,n,c,i){const{visualElement:r}=k.useContext(mL),s=k.useContext(C$),d=k.useContext(yL),l=k.useContext(kL).reducedMotion,h=k.useRef(null);c=c||s.renderer,!h.current&&c&&(h.current=c(e,{visualState:t,parent:r,props:n,presenceContext:d,blockInitialAnimation:d?d.initial===!1:!1,reducedMotionConfig:l}));const u=h.current,p=k.useContext(H$);u&&!u.projection&&i&&(u.type==="html"||u.type==="svg")&&J0e(h.current,n,i,p);const y=k.useRef(!1);k.useInsertionEffect(()=>{u&&y.current&&u.update(n,d)});const m=n[T$],g=k.useRef(!!m&&!window.MotionHandoffIsComplete?.(m)&&window.MotionHasOptimisedAnimation?.(m));return uw(()=>{u&&(y.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),g.current&&u.animationState&&u.animationState.animateChanges())}),k.useEffect(()=>{u&&(!g.current&&u.animationState&&u.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(m)}),g.current=!1),u.enteringChildren=void 0)}),u}function J0e(e,t,n,c){const{layoutId:i,layout:r,drag:s,dragConstraints:d,layoutScroll:l,layoutRoot:h,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:D$(e.parent)),e.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:!!s||d&&Ec(d),visualElement:e,animationType:typeof r=="string"?r:"both",initialPromotionConfig:c,crossfade:u,layoutScroll:l,layoutRoot:h})}function D$(e){if(e)return e.options.allowProjection!==!1?e.projection:D$(e.parent)}function EL(e,{forwardMotionProps:t=!1}={},n,c){n&&b0e(n);const i=Hw(e)?G0e:W0e;function r(d,l){let h;const u={...k.useContext(kL),...d,layoutId:Q0e(d)},{isStatic:p}=u,y=S0e(d),m=i(d,p);if(!p&&hw){ele(u,n);const g=tle(u);h=g.MeasureLayout,y.visualElement=Y0e(e,m,u,c,g.ProjectionNode)}return o.jsxs(mL.Provider,{value:y,children:[h&&y.visualElement?o.jsx(h,{visualElement:y.visualElement,...u}):null,E0e(e,d,Z0e(m,y.visualElement,l),m,p,t)]})}r.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const s=k.forwardRef(r);return s[K0e]=e,s}function Q0e({layoutId:e}){const t=k.useContext(lw).id;return t&&e!==void 0?t+"-"+e:e}function ele(e,t){const n=k.useContext(C$).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const c="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?t1(!1,c,"lazy-strict-mode"):Qe(!1,c,"lazy-strict-mode")}}function tle(e){const{drag:t,layout:n}=e1;if(!t&&!n)return{};const c={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?c.MeasureLayout:void 0,ProjectionNode:c.ProjectionNode}}function ale(e,t){if(typeof Proxy>"u")return EL;const n=new Map,c=(r,s)=>EL(r,s,e,t),i=(r,s)=>(process.env.NODE_ENV!=="production"&&fw(!1,"motion() is deprecated. Use motion.create() instead."),c(r,s));return new Proxy(i,{get:(r,s)=>s==="create"?c:(n.has(s)||n.set(s,EL(s,void 0,e,t)),n.get(s))})}function B$({top:e,left:t,right:n,bottom:c}){return{x:{min:t,max:n},y:{min:e,max:c}}}function nle({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function ole(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),c=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:c.y,right:c.x}}function OL(e){return e===void 0||e===1}function Qb({scale:e,scaleX:t,scaleY:n}){return!OL(e)||!OL(t)||!OL(n)}function Ic(e){return Qb(e)||R$(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function R$(e){return jC(e.x)||jC(e.y)}function jC(e){return e&&e!=="0%"}function dL(e,t,n){const c=e-n,i=t*c;return n+i}function SC(e,t,n,c,i){return i!==void 0&&(e=dL(e,i,c)),dL(e,n,c)+t}function ew(e,t=0,n=1,c,i){e.min=SC(e.min,t,n,c,i),e.max=SC(e.max,t,n,c,i)}function F$(e,{x:t,y:n}){ew(e.x,t.translate,t.scale,t.originPoint),ew(e.y,n.translate,n.scale,n.originPoint)}const $C=.999999999999,qC=1.0000000000001;function cle(e,t,n,c=!1){const i=n.length;if(!i)return;t.x=t.y=1;let r,s;for(let d=0;d<i;d++){r=n[d],s=r.projectionDelta;const{visualElement:l}=r.options;l&&l.props.style&&l.props.style.display==="contents"||(c&&r.options.layoutScroll&&r.scroll&&r!==r.root&&Uc(e,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,F$(e,s)),c&&Ic(r.latestValues)&&Uc(e,r.latestValues))}t.x<qC&&t.x>$C&&(t.x=1),t.y<qC&&t.y>$C&&(t.y=1)}function Oc(e,t){e.min=e.min+t,e.max=e.max+t}function AC(e,t,n,c,i=.5){const r=pe(e.min,e.max,i);ew(e,t,n,r,c)}function Uc(e,t){AC(e.x,t.x,t.scaleX,t.scale,t.originX),AC(e.y,t.y,t.scaleY,t.scale,t.originY)}function E$(e,t){return B$(ole(e.getBoundingClientRect(),t))}function ile(e,t,n){const c=E$(e,n),{scroll:i}=t;return i&&(Oc(c.x,i.offset.x),Oc(c.y,i.offset.y)),c}const zC=()=>({translate:0,scale:1,origin:0,originPoint:0}),Wc=()=>({x:zC(),y:zC()}),VC=()=>({min:0,max:0}),ge=()=>({x:VC(),y:VC()}),tw={current:null},O$={current:!1};function rle(){if(O$.current=!0,!!hw)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>tw.current=e.matches;e.addEventListener("change",t),t()}else tw.current=!1}const sle=new WeakMap;function dle(e,t,n){for(const c in t){const i=t[c],r=n[c];if(Ne(i))e.addValue(c,i);else if(Ne(r))e.addValue(c,$c(i,{owner:e}));else if(r!==i)if(e.hasValue(c)){const s=e.getValue(c);s.liveStyle===!0?s.jump(i):s.hasAnimated||s.set(i)}else{const s=e.getStaticValue(c);e.addValue(c,$c(s!==void 0?s:i,{owner:e}))}}for(const c in n)t[c]===void 0&&e.removeValue(c);return t}const PC=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class lle{scrapeMotionValuesFromProps(t,n,c){return{}}constructor({parent:t,props:n,presenceContext:c,reducedMotionConfig:i,blockInitialAnimation:r,visualState:s},d={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=jw,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const y=He.now();this.renderScheduledAt<y&&(this.renderScheduledAt=y,he.render(this.render,!1,!0))};const{latestValues:l,renderState:h}=s;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=h,this.parent=t,this.props=n,this.presenceContext=c,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=d,this.blockInitialAnimation=!!r,this.isControllingVariants=gL(n),this.isVariantNode=j$(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...p}=this.scrapeMotionValuesFromProps(n,{},this);for(const y in p){const m=p[y];l[y]!==void 0&&Ne(m)&&m.set(l[y])}}mount(t){this.current=t,sle.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,c)=>this.bindToMotionValue(c,n)),O$.current||rle(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:tw.current,process.env.NODE_ENV!=="production"&&fw(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),gt(this.notifyUpdate),gt(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const c=o1.has(t);c&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&he.preRender(this.notifyUpdate),c&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),r&&r(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in e1){const n=e1[t];if(!n)continue;const{isEnabled:c,Feature:i}=n;if(!this.features[t]&&i&&c(this.props)&&(this.features[t]=new i(this)),this.features[t]){const r=this.features[t];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ge()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let c=0;c<PC.length;c++){const i=PC[c];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const r="on"+i,s=t[r];s&&(this.propEventSubscriptions[i]=this.on(i,s))}this.prevMotionValues=dle(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const c=this.values.get(t);n!==c&&(c&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let c=this.values.get(t);return c===void 0&&n!==void 0&&(c=$c(n===null?void 0:n,{owner:this}),this.addValue(t,c)),c}readValue(t,n){let c=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return c!=null&&(typeof c=="string"&&(VS(c)||TS(c))?c=parseFloat(c):!f0e(c)&&At.test(n)&&(c=v$(t,n)),this.setBaseTarget(t,Ne(c)?c.get():c)),Ne(c)?c.get():c}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let c;if(typeof n=="string"||typeof n=="object"){const r=Dw(this.props,n,this.presenceContext?.custom);r&&(c=r[t])}if(n&&c!==void 0)return c;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!Ne(i)?i:this.initialValues[t]!==void 0&&c===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new mw),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){qw.render(this.render)}}class U$ extends lle{constructor(){super(...arguments),this.KeyframeResolver=o0e}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:c}){delete n[t],delete c[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ne(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function W$(e,{style:t,vars:n},c,i){const r=e.style;let s;for(s in t)r[s]=t[s];i?.applyProjectionStyles(r,c);for(s in n)r.setProperty(s,n[s])}function hle(e){return window.getComputedStyle(e)}class ule extends U${constructor(){super(...arguments),this.type="html",this.renderInstance=W$}readValueFromInstance(t,n){if(o1.has(n))return this.projection?.isProjecting?Wb(n):xde(t,n);{const c=hle(t),i=(Mw(n)?c.getPropertyValue(n):c[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return E$(t,n)}build(t,n,c){Pw(t,n,c.transformTemplate)}scrapeMotionValuesFromProps(t,n,c){return Bw(t,n,c)}}const G$=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function ple(e,t,n,c){W$(e,t,void 0,c);for(const i in t.attrs)e.setAttribute(G$.has(i)?i:Rw(i),t.attrs[i])}class yle extends U${constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ge}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(o1.has(n)){const c=g$(n);return c&&c.default||0}return n=G$.has(n)?n:Rw(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,c){return P$(t,n,c)}build(t,n,c){q$(t,n,this.isSVGTag,c.transformTemplate,c.style)}renderInstance(t,n,c,i){ple(t,n,c,i)}mount(t){this.isSVGTag=z$(t.tagName),super.mount(t)}}const kle=(e,t)=>Hw(e)?new yle(t):new ule(t,{allowProjection:e!==k.Fragment});function Qc(e,t,n){const c=e.getProps();return Dw(c,t,n!==void 0?n:c.custom,e)}const aw=e=>Array.isArray(e);function mle(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,$c(n))}function fle(e){return aw(e)?e[e.length-1]||0:e}function gle(e,t){const n=Qc(e,t);let{transitionEnd:c={},transition:i={},...r}=n||{};r={...r,...c};for(const s in r){const d=fle(r[s]);mle(e,s,d)}}function vle(e){return!!(Ne(e)&&e.add)}function nw(e,t){const n=e.getValue("willChange");if(vle(n))return n.add(t);if(!n&&ft.WillChange){const c=new ft.WillChange("auto");e.addValue("willChange",c),c.add(t)}}function K$(e){return e.props[T$]}const Mle=e=>e!==null;function _le(e,{repeat:t,repeatType:n="loop"},c){const i=e.filter(Mle),r=t&&n!=="loop"&&t%2===1?0:i.length-1;return i[r]}const xle={type:"spring",stiffness:500,damping:25,restSpeed:10},Lle=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Ile={type:"keyframes",duration:.8},ble={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},wle=(e,{keyframes:t})=>t.length>2?Ile:o1.has(e)?e.startsWith("scale")?Lle(t[1]):xle:ble;function Cle({when:e,delay:t,delayChildren:n,staggerChildren:c,staggerDirection:i,repeat:r,repeatType:s,repeatDelay:d,from:l,elapsed:h,...u}){return!!Object.keys(u).length}const Fw=(e,t,n,c={},i,r)=>s=>{const d=Sw(c,e)||{},l=d.delay||c.delay||0;let{elapsed:h=0}=c;h=h-Je(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...d,delay:-h,onUpdate:y=>{t.set(y),d.onUpdate&&d.onUpdate(y)},onComplete:()=>{s(),d.onComplete&&d.onComplete()},name:e,motionValue:t,element:r?void 0:i};Cle(d)||Object.assign(u,wle(e,u)),u.duration&&(u.duration=Je(u.duration)),u.repeatDelay&&(u.repeatDelay=Je(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let p=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Yb(u),u.delay===0&&(p=!0)),(ft.instantAnimations||ft.skipAnimations)&&(p=!0,Yb(u),u.delay=0),u.allowFlatten=!d.type&&!d.ease,p&&!r&&t.get()!==void 0){const y=_le(u.keyframes,d);if(y!==void 0){he.update(()=>{u.onUpdate(y),u.onComplete()});return}}return d.isSync?new Nw(u):new Ude(u)};function Nle({protectedKeys:e,needsAnimating:t},n){const c=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,c}function Z$(e,t,{delay:n=0,transitionOverride:c,type:i}={}){let{transition:r=e.getDefaultTransition(),transitionEnd:s,...d}=t;c&&(r=c);const l=[],h=i&&e.animationState&&e.animationState.getState()[i];for(const u in d){const p=e.getValue(u,e.latestValues[u]??null),y=d[u];if(y===void 0||h&&Nle(h,u))continue;const m={delay:n,...Sw(r||{},u)},g=p.get();if(g!==void 0&&!p.isAnimating&&!Array.isArray(y)&&y===g&&!m.velocity)continue;let f=!1;if(window.MotionHandoffAnimation){const _=K$(e);if(_){const v=window.MotionHandoffAnimation(_,u,he);v!==null&&(m.startTime=v,f=!0)}}nw(e,u),p.start(Fw(u,p,y,e.shouldReduceMotion&&k$.has(u)?{type:!1}:m,e,f));const M=p.animation;M&&l.push(M)}return s&&Promise.all(l).then(()=>{he.update(()=>{s&&gle(e,s)})}),l}function X$(e,t,n,c=0,i=1){const r=Array.from(e).sort((h,u)=>h.sortNodePosition(u)).indexOf(t),s=e.size,d=(s-1)*c;return typeof n=="function"?n(r,s):i===1?r*c:d-r*c}function ow(e,t,n={}){const c=Qc(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=c||{};n.transitionOverride&&(i=n.transitionOverride);const r=c?()=>Promise.all(Z$(e,c,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:h=0,staggerChildren:u,staggerDirection:p}=i;return jle(e,t,l,h,u,p,n)}:()=>Promise.resolve(),{when:d}=i;if(d){const[l,h]=d==="beforeChildren"?[r,s]:[s,r];return l().then(()=>h())}else return Promise.all([r(),s(n.delay)])}function jle(e,t,n=0,c=0,i=0,r=1,s){const d=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),d.push(ow(l,t,{...s,delay:n+(typeof c=="function"?0:c)+X$(e.variantChildren,l,c,i,r)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(d)}function Sle(e,t,n={}){e.notify("AnimationStart",t);let c;if(Array.isArray(t)){const i=t.map(r=>ow(e,r,n));c=Promise.all(i)}else if(typeof t=="string")c=ow(e,t,n);else{const i=typeof t=="function"?Qc(e,t,n.custom):t;c=Promise.all(Z$(e,i,n))}return c.then(()=>{e.notify("AnimationComplete",t)})}function Y$(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let c=0;c<n;c++)if(t[c]!==e[c])return!1;return!0}const $le=Vw.length;function J$(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?J$(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<$le;n++){const c=Vw[n],i=e.props[c];(D1(i)||i===!1)&&(t[c]=i)}return t}const qle=[...zw].reverse(),Ale=zw.length;function zle(e){return t=>Promise.all(t.map(({animation:n,options:c})=>Sle(e,n,c)))}function Vle(e){let t=zle(e),n=TC(),c=!0;const i=l=>(h,u)=>{const p=Qc(e,u,l==="exit"?e.presenceContext?.custom:void 0);if(p){const{transition:y,transitionEnd:m,...g}=p;h={...h,...g,...m}}return h};function r(l){t=l(e)}function s(l){const{props:h}=e,u=J$(e.parent)||{},p=[],y=new Set;let m={},g=1/0;for(let M=0;M<Ale;M++){const _=qle[M],v=n[_],L=h[_]!==void 0?h[_]:u[_],w=D1(L),C=_===l?v.isActive:null;C===!1&&(g=M);let b=L===u[_]&&L!==h[_]&&w;if(b&&c&&e.manuallyAnimateOnMount&&(b=!1),v.protectedKeys={...m},!v.isActive&&C===null||!L&&!v.prevProp||fL(L)||typeof L=="boolean")continue;const x=Ple(v.prevProp,L);let I=x||_===l&&v.isActive&&!b&&w||M>g&&w,S=!1;const j=Array.isArray(L)?L:[L];let $=j.reduce(i(_),{});C===!1&&($={});const{prevResolvedValues:q={}}=v,H={...q,...$},D=A=>{I=!0,y.has(A)&&(S=!0,y.delete(A)),v.needsAnimating[A]=!0;const R=e.getValue(A);R&&(R.liveStyle=!1)};for(const A in H){const R=$[A],P=q[A];if(m.hasOwnProperty(A))continue;let T=!1;aw(R)&&aw(P)?T=!Y$(R,P):T=R!==P,T?R!=null?D(A):y.add(A):R!==void 0&&y.has(A)?D(A):v.protectedKeys[A]=!0}v.prevProp=L,v.prevResolvedValues=$,v.isActive&&(m={...m,...$}),c&&e.blockInitialAnimation&&(I=!1);const z=b&&x;I&&(!z||S)&&p.push(...j.map(A=>{const R={type:_};if(typeof A=="string"&&c&&!z&&e.manuallyAnimateOnMount&&e.parent){const{parent:P}=e,T=Qc(P,A);if(P.enteringChildren&&T){const{delayChildren:E}=T.transition||{};R.delay=X$(P.enteringChildren,e,E)}}return{animation:A,options:R}}))}if(y.size){const M={};if(typeof h.initial!="boolean"){const _=Qc(e,Array.isArray(h.initial)?h.initial[0]:h.initial);_&&_.transition&&(M.transition=_.transition)}y.forEach(_=>{const v=e.getBaseTarget(_),L=e.getValue(_);L&&(L.liveStyle=!0),M[_]=v??null}),p.push({animation:M})}let f=!!p.length;return c&&(h.initial===!1||h.initial===h.animate)&&!e.manuallyAnimateOnMount&&(f=!1),c=!1,f?t(p):Promise.resolve()}function d(l,h){if(n[l].isActive===h)return Promise.resolve();e.variantChildren?.forEach(p=>p.animationState?.setActive(l,h)),n[l].isActive=h;const u=s(l);for(const p in n)n[p].protectedKeys={};return u}return{animateChanges:s,setActive:d,setAnimateFunction:r,getState:()=>n,reset:()=>{n=TC()}}}function Ple(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Y$(t,e):!1}function Dt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function TC(){return{animate:Dt(!0),whileInView:Dt(),whileHover:Dt(),whileTap:Dt(),whileDrag:Dt(),whileFocus:Dt(),exit:Dt()}}class Vt{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Tle extends Vt{constructor(t){super(t),t.animationState||(t.animationState=Vle(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();fL(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let Hle=0;class Dle extends Vt{constructor(){super(...arguments),this.id=Hle++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:c}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===c)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const Ble={animation:{Feature:Tle},exit:{Feature:Dle}};function R1(e,t,n,c={passive:!0}){return e.addEventListener(t,n,c),()=>e.removeEventListener(t,n)}function W1(e){return{point:{x:e.pageX,y:e.pageY}}}const Rle=e=>t=>Aw(t)&&e(t,W1(t));function q1(e,t,n,c){return R1(e,t,Rle(n),c)}const Q$=1e-4,Fle=1-Q$,Ele=1+Q$,eq=.01,Ole=0-eq,Ule=0+eq;function ze(e){return e.max-e.min}function Wle(e,t,n){return Math.abs(e-t)<=n}function HC(e,t,n,c=.5){e.origin=c,e.originPoint=pe(t.min,t.max,e.origin),e.scale=ze(n)/ze(t),e.translate=pe(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Fle&&e.scale<=Ele||isNaN(e.scale))&&(e.scale=1),(e.translate>=Ole&&e.translate<=Ule||isNaN(e.translate))&&(e.translate=0)}function A1(e,t,n,c){HC(e.x,t.x,n.x,c?c.originX:void 0),HC(e.y,t.y,n.y,c?c.originY:void 0)}function DC(e,t,n){e.min=n.min+t.min,e.max=e.min+ze(t)}function Gle(e,t,n){DC(e.x,t.x,n.x),DC(e.y,t.y,n.y)}function BC(e,t,n){e.min=t.min-n.min,e.max=e.min+ze(t)}function z1(e,t,n){BC(e.x,t.x,n.x),BC(e.y,t.y,n.y)}function Oe(e){return[e("x"),e("y")]}const tq=({current:e})=>e?e.ownerDocument.defaultView:null,RC=(e,t)=>Math.abs(e-t);function Kle(e,t){const n=RC(e.x,t.x),c=RC(e.y,t.y);return Math.sqrt(n**2+c**2)}class aq{constructor(t,n,{transformPagePoint:c,contextWindow:i=window,dragSnapToOrigin:r=!1,distanceThreshold:s=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=WL(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,g=Kle(y.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!g)return;const{point:f}=y,{timestamp:M}=Ce;this.history.push({...f,timestamp:M});const{onStart:_,onMove:v}=this.handlers;m||(_&&_(this.lastMoveEvent,y),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,y)},this.handlePointerMove=(y,m)=>{this.lastMoveEvent=y,this.lastMoveEventInfo=UL(m,this.transformPagePoint),he.update(this.updatePoint,!0)},this.handlePointerUp=(y,m)=>{this.end();const{onEnd:g,onSessionEnd:f,resumeAnimation:M}=this.handlers;if(this.dragSnapToOrigin&&M&&M(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const _=WL(y.type==="pointercancel"?this.lastMoveEventInfo:UL(m,this.transformPagePoint),this.history);this.startEvent&&g&&g(y,_),f&&f(y,_)},!Aw(t))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=c,this.distanceThreshold=s,this.contextWindow=i||window;const d=W1(t),l=UL(d,this.transformPagePoint),{point:h}=l,{timestamp:u}=Ce;this.history=[{...h,timestamp:u}];const{onSessionStart:p}=n;p&&p(t,WL(l,this.history)),this.removeListeners=E1(q1(this.contextWindow,"pointermove",this.handlePointerMove),q1(this.contextWindow,"pointerup",this.handlePointerUp),q1(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),gt(this.updatePoint)}}function UL(e,t){return t?{point:t(e.point)}:e}function FC(e,t){return{x:e.x-t.x,y:e.y-t.y}}function WL({point:e},t){return{point:e,delta:FC(e,nq(t)),offset:FC(e,Zle(t)),velocity:Xle(t,.1)}}function Zle(e){return e[0]}function nq(e){return e[e.length-1]}function Xle(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,c=null;const i=nq(e);for(;n>=0&&(c=e[n],!(i.timestamp-c.timestamp>Je(t)));)n--;if(!c)return{x:0,y:0};const r=We(i.timestamp-c.timestamp);if(r===0)return{x:0,y:0};const s={x:(i.x-c.x)/r,y:(i.y-c.y)/r};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function Yle(e,{min:t,max:n},c){return t!==void 0&&e<t?e=c?pe(t,e,c.min):Math.max(e,t):n!==void 0&&e>n&&(e=c?pe(n,e,c.max):Math.min(e,n)),e}function EC(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function Jle(e,{top:t,left:n,bottom:c,right:i}){return{x:EC(e.x,n,i),y:EC(e.y,t,c)}}function OC(e,t){let n=t.min-e.min,c=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,c]=[c,n]),{min:n,max:c}}function Qle(e,t){return{x:OC(e.x,t.x),y:OC(e.y,t.y)}}function ehe(e,t){let n=.5;const c=ze(e),i=ze(t);return i>c?n=P1(t.min,t.max-c,e.min):c>i&&(n=P1(e.min,e.max-i,t.min)),mt(0,1,n)}function the(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const cw=.35;function ahe(e=cw){return e===!1?e=0:e===!0&&(e=cw),{x:UC(e,"left","right"),y:UC(e,"top","bottom")}}function UC(e,t,n){return{min:WC(e,t),max:WC(e,n)}}function WC(e,t){return typeof e=="number"?e:e[t]||0}const nhe=new WeakMap;class ohe{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ge(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:c}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=p=>{const{dragSnapToOrigin:y}=this.getProps();y?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(W1(p).point)},s=(p,y)=>{const{drag:m,dragPropagation:g,onDragStart:f}=this.getProps();if(m&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=s0e(m),!this.openDragLock))return;this.latestPointerEvent=p,this.latestPanInfo=y,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Oe(_=>{let v=this.getAxisMotionValue(_).get()||0;if(st.test(v)){const{projection:L}=this.visualElement;if(L&&L.layout){const w=L.layout.layoutBox[_];w&&(v=ze(w)*(parseFloat(v)/100))}}this.originPoint[_]=v}),f&&he.postRender(()=>f(p,y)),nw(this.visualElement,"transform");const{animationState:M}=this.visualElement;M&&M.setActive("whileDrag",!0)},d=(p,y)=>{this.latestPointerEvent=p,this.latestPanInfo=y;const{dragPropagation:m,dragDirectionLock:g,onDirectionLock:f,onDrag:M}=this.getProps();if(!m&&!this.openDragLock)return;const{offset:_}=y;if(g&&this.currentDirection===null){this.currentDirection=che(_),this.currentDirection!==null&&f&&f(this.currentDirection);return}this.updateAxis("x",y.point,_),this.updateAxis("y",y.point,_),this.visualElement.render(),M&&M(p,y)},l=(p,y)=>{this.latestPointerEvent=p,this.latestPanInfo=y,this.stop(p,y),this.latestPointerEvent=null,this.latestPanInfo=null},h=()=>Oe(p=>this.getAnimationState(p)==="paused"&&this.getAxisMotionValue(p).animation?.play()),{dragSnapToOrigin:u}=this.getProps();this.panSession=new aq(t,{onSessionStart:r,onStart:s,onMove:d,onSessionEnd:l,resumeAnimation:h},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:c,contextWindow:tq(this.visualElement)})}stop(t,n){const c=t||this.latestPointerEvent,i=n||this.latestPanInfo,r=this.isDragging;if(this.cancel(),!r||!i||!c)return;const{velocity:s}=i;this.startAnimation(s);const{onDragEnd:d}=this.getProps();d&&he.postRender(()=>d(c,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:c}=this.getProps();!c&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,c){const{drag:i}=this.getProps();if(!c||!J1(t,i,this.currentDirection))return;const r=this.getAxisMotionValue(t);let s=this.originPoint[t]+c[t];this.constraints&&this.constraints[t]&&(s=Yle(s,this.constraints[t],this.elastic[t])),r.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),c=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;t&&Ec(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&c?this.constraints=Jle(c.layoutBox,t):this.constraints=!1,this.elastic=ahe(n),i!==this.constraints&&c&&this.constraints&&!this.hasMutatedConstraints&&Oe(r=>{this.constraints!==!1&&this.getAxisMotionValue(r)&&(this.constraints[r]=the(c.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Ec(t))return!1;const c=t.current;Qe(c!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const r=ile(c,i.root,this.visualElement.getTransformPagePoint());let s=Qle(i.layout.layoutBox,r);if(n){const d=n(nle(s));this.hasMutatedConstraints=!!d,d&&(s=B$(d))}return s}startAnimation(t){const{drag:n,dragMomentum:c,dragElastic:i,dragTransition:r,dragSnapToOrigin:s,onDragTransitionEnd:d}=this.getProps(),l=this.constraints||{},h=Oe(u=>{if(!J1(u,n,this.currentDirection))return;let p=l&&l[u]||{};s&&(p={min:0,max:0});const y=i?200:1e6,m=i?40:1e7,g={type:"inertia",velocity:c?t[u]:0,bounceStiffness:y,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...r,...p};return this.startAxisValueAnimation(u,g)});return Promise.all(h).then(d)}startAxisValueAnimation(t,n){const c=this.getAxisMotionValue(t);return nw(this.visualElement,t),c.start(Fw(t,c,0,n,this.visualElement,!1))}stopAnimation(){Oe(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Oe(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,c=this.visualElement.getProps(),i=c[n];return i||this.visualElement.getValue(t,(c.initial?c.initial[t]:void 0)||0)}snapToCursor(t){Oe(n=>{const{drag:c}=this.getProps();if(!J1(n,c,this.currentDirection))return;const{projection:i}=this.visualElement,r=this.getAxisMotionValue(n);if(i&&i.layout){const{min:s,max:d}=i.layout.layoutBox[n];r.set(t[n]-pe(s,d,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:c}=this.visualElement;if(!Ec(n)||!c||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Oe(s=>{const d=this.getAxisMotionValue(s);if(d&&this.constraints!==!1){const l=d.get();i[s]=ehe({min:l,max:l},this.constraints[s])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",c.root&&c.root.updateScroll(),c.updateLayout(),this.resolveConstraints(),Oe(s=>{if(!J1(s,t,null))return;const d=this.getAxisMotionValue(s),{min:l,max:h}=this.constraints[s];d.set(pe(l,h,i[s]))})}addListeners(){if(!this.visualElement.current)return;nhe.set(this.visualElement,this);const t=this.visualElement.current,n=q1(t,"pointerdown",l=>{const{drag:h,dragListener:u=!0}=this.getProps();h&&u&&this.start(l)}),c=()=>{const{dragConstraints:l}=this.getProps();Ec(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,r=i.addEventListener("measure",c);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),he.read(c);const s=R1(window,"resize",()=>this.scalePositionWithinConstraints()),d=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:h})=>{this.isDragging&&h&&(Oe(u=>{const p=this.getAxisMotionValue(u);p&&(this.originPoint[u]+=l[u].translate,p.set(p.get()+l[u].translate))}),this.visualElement.render())});return()=>{s(),n(),r(),d&&d()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:c=!1,dragPropagation:i=!1,dragConstraints:r=!1,dragElastic:s=cw,dragMomentum:d=!0}=t;return{...t,drag:n,dragDirectionLock:c,dragPropagation:i,dragConstraints:r,dragElastic:s,dragMomentum:d}}}function J1(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function che(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class ihe extends Vt{constructor(t){super(t),this.removeGroupControls=Ke,this.removeListeners=Ke,this.controls=new ohe(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ke}unmount(){this.removeGroupControls(),this.removeListeners()}}const GC=e=>(t,n)=>{e&&he.postRender(()=>e(t,n))};class rhe extends Vt{constructor(){super(...arguments),this.removePointerDownListener=Ke}onPointerDown(t){this.session=new aq(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:tq(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:c,onPanEnd:i}=this.node.getProps();return{onSessionStart:GC(t),onStart:GC(n),onMove:c,onEnd:(r,s)=>{delete this.session,i&&he.postRender(()=>i(r,s))}}}mount(){this.removePointerDownListener=q1(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const eL={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function KC(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const d1={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(U.test(e))e=parseFloat(e);else return e;const n=KC(e,t.target.x),c=KC(e,t.target.y);return`${n}% ${c}%`}},she={correct:(e,{treeScale:t,projectionDelta:n})=>{const c=e,i=At.parse(e);if(i.length>5)return c;const r=At.createTransformer(e),s=typeof i[0]!="number"?1:0,d=n.x.scale*t.x,l=n.y.scale*t.y;i[0+s]/=d,i[1+s]/=l;const h=pe(d,l,.5);return typeof i[2+s]=="number"&&(i[2+s]/=h),typeof i[3+s]=="number"&&(i[3+s]/=h),r(i)}};let GL=!1;class dhe extends k.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:c,layoutId:i}=this.props,{projection:r}=t;$0e(lhe),r&&(n.group&&n.group.add(r),c&&c.register&&i&&c.register(r),GL&&r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,onExitComplete:()=>this.safeToRemove()})),eL.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:c,drag:i,isPresent:r}=this.props,{projection:s}=c;return s&&(s.isPresent=r,GL=!0,i||t.layoutDependency!==n||n===void 0||t.isPresent!==r?s.willUpdate():this.safeToRemove(),t.isPresent!==r&&(r?s.promote():s.relegate()||he.postRender(()=>{const d=s.getStack();(!d||!d.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),qw.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:c}=this.props,{projection:i}=t;GL=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),c&&c.deregister&&c.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function oq(e){const[t,n]=w$(),c=k.useContext(lw);return o.jsx(dhe,{...e,layoutGroup:c,switchLayoutGroup:k.useContext(H$),isPresent:t,safeToRemove:n})}const lhe={borderRadius:{...d1,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:d1,borderTopRightRadius:d1,borderBottomLeftRadius:d1,borderBottomRightRadius:d1,boxShadow:she};function hhe(e,t,n){const c=Ne(e)?e:$c(e);return c.start(Fw("",c,t,n)),c.animation}const uhe=(e,t)=>e.depth-t.depth;class phe{constructor(){this.children=[],this.isDirty=!1}add(t){pw(this.children,t),this.isDirty=!0}remove(t){yw(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(uhe),this.isDirty=!1,this.children.forEach(t)}}function yhe(e,t){const n=He.now(),c=({timestamp:i})=>{const r=i-n;r>=t&&(gt(c),e(r-t))};return he.setup(c,!0),()=>gt(c)}const cq=["TopLeft","TopRight","BottomLeft","BottomRight"],khe=cq.length,ZC=e=>typeof e=="string"?parseFloat(e):e,XC=e=>typeof e=="number"||U.test(e);function mhe(e,t,n,c,i,r){i?(e.opacity=pe(0,n.opacity??1,fhe(c)),e.opacityExit=pe(t.opacity??1,0,ghe(c))):r&&(e.opacity=pe(t.opacity??1,n.opacity??1,c));for(let s=0;s<khe;s++){const d=`border${cq[s]}Radius`;let l=YC(t,d),h=YC(n,d);if(l===void 0&&h===void 0)continue;l||(l=0),h||(h=0),l===0||h===0||XC(l)===XC(h)?(e[d]=Math.max(pe(ZC(l),ZC(h),c),0),(st.test(h)||st.test(l))&&(e[d]+="%")):e[d]=h}(t.rotate||n.rotate)&&(e.rotate=pe(t.rotate||0,n.rotate||0,c))}function YC(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const fhe=iq(0,.5,US),ghe=iq(.5,.95,Ke);function iq(e,t,n){return c=>c<e?0:c>t?1:n(P1(e,t,c))}function JC(e,t){e.min=t.min,e.max=t.max}function Re(e,t){JC(e.x,t.x),JC(e.y,t.y)}function QC(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function eN(e,t,n,c,i){return e-=t,e=dL(e,1/n,c),i!==void 0&&(e=dL(e,1/i,c)),e}function vhe(e,t=0,n=1,c=.5,i,r=e,s=e){if(st.test(t)&&(t=parseFloat(t),t=pe(s.min,s.max,t/100)-s.min),typeof t!="number")return;let d=pe(r.min,r.max,c);e===r&&(d-=t),e.min=eN(e.min,t,n,d,i),e.max=eN(e.max,t,n,d,i)}function tN(e,t,[n,c,i],r,s){vhe(e,t[n],t[c],t[i],t.scale,r,s)}const Mhe=["x","scaleX","originX"],_he=["y","scaleY","originY"];function aN(e,t,n,c){tN(e.x,t,Mhe,n?n.x:void 0,c?c.x:void 0),tN(e.y,t,_he,n?n.y:void 0,c?c.y:void 0)}function nN(e){return e.translate===0&&e.scale===1}function rq(e){return nN(e.x)&&nN(e.y)}function oN(e,t){return e.min===t.min&&e.max===t.max}function xhe(e,t){return oN(e.x,t.x)&&oN(e.y,t.y)}function cN(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function sq(e,t){return cN(e.x,t.x)&&cN(e.y,t.y)}function iN(e){return ze(e.x)/ze(e.y)}function rN(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Lhe{constructor(){this.members=[]}add(t){pw(this.members,t),t.scheduleRender()}remove(t){if(yw(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let c;for(let i=n;i>=0;i--){const r=this.members[i];if(r.isPresent!==!1){c=r;break}}return c?(this.promote(c),!0):!1}promote(t,n){const c=this.lead;if(t!==c&&(this.prevLead=c,this.lead=t,t.show(),c)){c.instance&&c.scheduleRender(),t.scheduleRender(),t.resumeFrom=c,n&&(t.resumeFrom.preserveOpacity=!0),c.snapshot&&(t.snapshot=c.snapshot,t.snapshot.latestValues=c.animationValues||c.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&c.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:c}=t;n.onExitComplete&&n.onExitComplete(),c&&c.options.onExitComplete&&c.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Ihe(e,t,n){let c="";const i=e.x.translate/t.x,r=e.y.translate/t.y,s=n?.z||0;if((i||r||s)&&(c=`translate3d(${i}px, ${r}px, ${s}px) `),(t.x!==1||t.y!==1)&&(c+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:h,rotate:u,rotateX:p,rotateY:y,skewX:m,skewY:g}=n;h&&(c=`perspective(${h}px) ${c}`),u&&(c+=`rotate(${u}deg) `),p&&(c+=`rotateX(${p}deg) `),y&&(c+=`rotateY(${y}deg) `),m&&(c+=`skewX(${m}deg) `),g&&(c+=`skewY(${g}deg) `)}const d=e.x.scale*t.x,l=e.y.scale*t.y;return(d!==1||l!==1)&&(c+=`scale(${d}, ${l})`),c||"none"}const KL=["","X","Y","Z"],bhe=1e3;let whe=0;function ZL(e,t,n,c){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),c&&(c[e]=0))}function dq(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=K$(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",he,!(i||r))}const{parent:c}=e;c&&!c.hasCheckedOptimisedAppear&&dq(c)}function lq({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:c,resetTransform:i}){return class{constructor(s={},d=t?.()){this.id=whe++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(jhe),this.nodes.forEach(Ahe),this.nodes.forEach(zhe),this.nodes.forEach(She)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=d?d.root||d:this,this.path=d?[...d.path,d]:[],this.parent=d,this.depth=d?d.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new phe)}addEventListener(s,d){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new mw),this.eventHandlers.get(s).add(d)}notifyListeners(s,...d){const l=this.eventHandlers.get(s);l&&l.notify(...d)}hasListeners(s){return this.eventHandlers.has(s)}mount(s){if(this.instance)return;this.isSVG=b$(s)&&!y0e(s),this.instance=s;const{layoutId:d,layout:l,visualElement:h}=this.options;if(h&&!h.current&&h.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||d)&&(this.isLayoutDirty=!0),e){let u,p=0;const y=()=>this.root.updateBlockedByResize=!1;he.read(()=>{p=window.innerWidth}),e(s,()=>{const m=window.innerWidth;m!==p&&(p=m,this.root.updateBlockedByResize=!0,u&&u(),u=yhe(y,250),eL.hasAnimatedSinceResize&&(eL.hasAnimatedSinceResize=!1,this.nodes.forEach(lN)))})}d&&this.root.registerSharedNode(d,this),this.options.animate!==!1&&h&&(d||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:p,hasRelativeLayoutChanged:y,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||h.getDefaultTransition()||Dhe,{onLayoutAnimationStart:f,onLayoutAnimationComplete:M}=h.getProps(),_=!this.targetLayout||!sq(this.targetLayout,m),v=!p&&y;if(this.options.layoutRoot||this.resumeFrom||v||p&&(_||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const L={...Sw(g,"layout"),onPlay:f,onComplete:M};(h.shouldReduceMotion||this.options.layoutRoot)&&(L.delay=0,L.type=!1),this.startAnimation(L),this.setAnimationOrigin(u,v)}else p||lN(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),gt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Vhe),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&dq(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const p=this.path[u];p.shouldResetTransform=!0,p.updateScroll("snapshot"),p.options.layoutRoot&&p.willUpdate(!1)}const{layoutId:d,layout:l}=this.options;if(d===void 0&&!l)return;const h=this.getTransformTemplate();this.prevTransformTemplateValue=h?h(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(sN);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(dN);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(qhe),this.nodes.forEach(Che),this.nodes.forEach(Nhe)):this.nodes.forEach(dN),this.clearAllSnapshots();const d=He.now();Ce.delta=mt(0,1e3/60,d-Ce.timestamp),Ce.timestamp=d,Ce.isProcessing=!0,TL.update.process(Ce),TL.preRender.process(Ce),TL.render.process(Ce),Ce.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,qw.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach($he),this.sharedNodes.forEach(Phe)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,he.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){he.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ze(this.snapshot.measuredBox.x)&&!ze(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const s=this.layout;this.layout=this.measure(!1),this.layoutCorrected=ge(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:d}=this.options;d&&d.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let d=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(d=!1),d&&this.instance){const l=c(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,d=this.projectionDelta&&!rq(this.projectionDelta),l=this.getTransformTemplate(),h=l?l(this.latestValues,""):void 0,u=h!==this.prevTransformTemplateValue;s&&this.instance&&(d||Ic(this.latestValues)||u)&&(i(this.instance,h),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const d=this.measurePageBox();let l=this.removeElementScroll(d);return s&&(l=this.removeTransform(l)),Bhe(l),{animationId:this.root.animationId,measuredBox:d,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:s}=this.options;if(!s)return ge();const d=s.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Rhe))){const{scroll:h}=this.root;h&&(Oc(d.x,h.offset.x),Oc(d.y,h.offset.y))}return d}removeElementScroll(s){const d=ge();if(Re(d,s),this.scroll?.wasRoot)return d;for(let l=0;l<this.path.length;l++){const h=this.path[l],{scroll:u,options:p}=h;h!==this.root&&u&&p.layoutScroll&&(u.wasRoot&&Re(d,s),Oc(d.x,u.offset.x),Oc(d.y,u.offset.y))}return d}applyTransform(s,d=!1){const l=ge();Re(l,s);for(let h=0;h<this.path.length;h++){const u=this.path[h];!d&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Uc(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Ic(u.latestValues)&&Uc(l,u.latestValues)}return Ic(this.latestValues)&&Uc(l,this.latestValues),l}removeTransform(s){const d=ge();Re(d,s);for(let l=0;l<this.path.length;l++){const h=this.path[l];if(!h.instance||!Ic(h.latestValues))continue;Qb(h.latestValues)&&h.updateSnapshot();const u=ge(),p=h.measurePageBox();Re(u,p),aN(d,h.latestValues,h.snapshot?h.snapshot.layoutBox:void 0,u)}return Ic(this.latestValues)&&aN(d,this.latestValues),d}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ce.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){const d=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=d.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=d.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=d.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==d;if(!(s||l&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:p}=this.options;if(!(!this.layout||!(u||p))){if(this.resolvedRelativeTargetAt=Ce.timestamp,!this.targetDelta&&!this.relativeTarget){const y=this.getClosestProjectingParent();y&&y.layout&&this.animationProgress!==1?(this.relativeParent=y,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ge(),this.relativeTargetOrigin=ge(),z1(this.relativeTargetOrigin,this.layout.layoutBox,y.layout.layoutBox),Re(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=ge(),this.targetWithTransforms=ge()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Gle(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Re(this.target,this.layout.layoutBox),F$(this.target,this.targetDelta)):Re(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const y=this.getClosestProjectingParent();y&&!!y.resumingFrom==!!this.resumingFrom&&!y.options.layoutScroll&&y.target&&this.animationProgress!==1?(this.relativeParent=y,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ge(),this.relativeTargetOrigin=ge(),z1(this.relativeTargetOrigin,this.target,y.target),Re(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||Qb(this.parent.latestValues)||R$(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){const s=this.getLead(),d=!!this.resumingFrom||this!==s;let l=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(l=!1),d&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===Ce.timestamp&&(l=!1),l)return;const{layout:h,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(h||u))return;Re(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,y=this.treeScale.y;cle(this.layoutCorrected,this.treeScale,this.path,d),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox,s.targetWithTransforms=ge());const{target:m}=s;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(QC(this.prevProjectionDelta.x,this.projectionDelta.x),QC(this.prevProjectionDelta.y,this.projectionDelta.y)),A1(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==y||!rN(this.projectionDelta.x,this.prevProjectionDelta.x)||!rN(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){if(this.options.visualElement?.scheduleRender(),s){const d=this.getStack();d&&d.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Wc(),this.projectionDelta=Wc(),this.projectionDeltaWithTransform=Wc()}setAnimationOrigin(s,d=!1){const l=this.snapshot,h=l?l.latestValues:{},u={...this.latestValues},p=Wc();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!d;const y=ge(),m=l?l.source:void 0,g=this.layout?this.layout.source:void 0,f=m!==g,M=this.getStack(),_=!M||M.members.length<=1,v=!!(f&&!_&&this.options.crossfade===!0&&!this.path.some(Hhe));this.animationProgress=0;let L;this.mixTargetDelta=w=>{const C=w/1e3;hN(p.x,s.x,C),hN(p.y,s.y,C),this.setTargetDelta(p),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(z1(y,this.layout.layoutBox,this.relativeParent.layout.layoutBox),The(this.relativeTarget,this.relativeTargetOrigin,y,C),L&&xhe(this.relativeTarget,L)&&(this.isProjectionDirty=!1),L||(L=ge()),Re(L,this.relativeTarget)),f&&(this.animationValues=u,mhe(u,h,this.latestValues,C,v,_)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=C},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(gt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=he.update(()=>{eL.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=$c(0)),this.currentAnimation=hhe(this.motionValue,[0,1e3],{...s,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),s.onUpdate&&s.onUpdate(d)},onStop:()=>{},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(bhe),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:d,target:l,layout:h,latestValues:u}=s;if(!(!d||!l||!h)){if(this!==s&&this.layout&&h&&hq(this.options.animationType,this.layout.layoutBox,h.layoutBox)){l=this.target||ge();const p=ze(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+p;const y=ze(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+y}Re(d,l),Uc(d,u),A1(this.projectionDeltaWithTransform,this.layoutCorrected,d,u)}}registerSharedNode(s,d){this.sharedNodes.has(s)||this.sharedNodes.set(s,new Lhe),this.sharedNodes.get(s).add(d);const h=d.options.initialPromotionConfig;d.promote({transition:h?h.transition:void 0,preserveFollowOpacity:h&&h.shouldPreserveFollowOpacity?h.shouldPreserveFollowOpacity(d):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){const{layoutId:s}=this.options;return s?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:s}=this.options;return s?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:d,preserveFollowOpacity:l}={}){const h=this.getStack();h&&h.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),d&&this.setOptions({transition:d})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let d=!1;const{latestValues:l}=s;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(d=!0),!d)return;const h={};l.z&&ZL("z",s,h,this.animationValues);for(let u=0;u<KL.length;u++)ZL(`rotate${KL[u]}`,s,h,this.animationValues),ZL(`skew${KL[u]}`,s,h,this.animationValues);s.render();for(const u in h)s.setStaticValue(u,h[u]),this.animationValues&&(this.animationValues[u]=h[u]);s.scheduleRender()}applyProjectionStyles(s,d){if(!this.instance||this.isSVG)return;if(!this.isVisible){s.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,s.visibility="",s.opacity="",s.pointerEvents=Qx(d?.pointerEvents)||"",s.transform=l?l(this.latestValues,""):"none";return}const h=this.getLead();if(!this.projectionDelta||!this.layout||!h.target){this.options.layoutId&&(s.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,s.pointerEvents=Qx(d?.pointerEvents)||""),this.hasProjected&&!Ic(this.latestValues)&&(s.transform=l?l({},""):"none",this.hasProjected=!1);return}s.visibility="";const u=h.animationValues||h.latestValues;this.applyTransformsToTarget();let p=Ihe(this.projectionDeltaWithTransform,this.treeScale,u);l&&(p=l(u,p)),s.transform=p;const{x:y,y:m}=this.projectionDelta;s.transformOrigin=`${y.origin*100}% ${m.origin*100}% 0`,h.animationValues?s.opacity=h===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:s.opacity=h===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const g in B1){if(u[g]===void 0)continue;const{correct:f,applyTo:M,isCSSVariable:_}=B1[g],v=p==="none"?u[g]:f(u[g],h);if(M){const L=M.length;for(let w=0;w<L;w++)s[M[w]]=v}else _?this.options.visualElement.renderState.vars[g]=v:s[g]=v}this.options.layoutId&&(s.pointerEvents=h===this?Qx(d?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>s.currentAnimation?.stop()),this.root.nodes.forEach(sN),this.root.sharedNodes.clear()}}}function Che(e){e.updateLayout()}function Nhe(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:c}=e.layout,{animationType:i}=e.options,r=t.source!==e.layout.source;i==="size"?Oe(u=>{const p=r?t.measuredBox[u]:t.layoutBox[u],y=ze(p);p.min=n[u].min,p.max=p.min+y}):hq(i,t.layoutBox,n)&&Oe(u=>{const p=r?t.measuredBox[u]:t.layoutBox[u],y=ze(n[u]);p.max=p.min+y,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+y)});const s=Wc();A1(s,n,t.layoutBox);const d=Wc();r?A1(d,e.applyTransform(c,!0),t.measuredBox):A1(d,n,t.layoutBox);const l=!rq(s);let h=!1;if(!e.resumeFrom){const u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:p,layout:y}=u;if(p&&y){const m=ge();z1(m,t.layoutBox,p.layoutBox);const g=ge();z1(g,n,y.layoutBox),sq(m,g)||(h=!0),u.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=m,e.relativeParent=u)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:d,layoutDelta:s,hasLayoutChanged:l,hasRelativeLayoutChanged:h})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function jhe(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function She(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function $he(e){e.clearSnapshot()}function sN(e){e.clearMeasurements()}function dN(e){e.isLayoutDirty=!1}function qhe(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function lN(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Ahe(e){e.resolveTargetDelta()}function zhe(e){e.calcProjection()}function Vhe(e){e.resetSkewAndRotation()}function Phe(e){e.removeLeadSnapshot()}function hN(e,t,n){e.translate=pe(t.translate,0,n),e.scale=pe(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function uN(e,t,n,c){e.min=pe(t.min,n.min,c),e.max=pe(t.max,n.max,c)}function The(e,t,n,c){uN(e.x,t.x,n.x,c),uN(e.y,t.y,n.y,c)}function Hhe(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Dhe={duration:.45,ease:[.4,0,.1,1]},pN=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),yN=pN("applewebkit/")&&!pN("chrome/")?Math.round:Ke;function kN(e){e.min=yN(e.min),e.max=yN(e.max)}function Bhe(e){kN(e.x),kN(e.y)}function hq(e,t,n){return e==="position"||e==="preserve-aspect"&&!Wle(iN(t),iN(n),.2)}function Rhe(e){return e!==e.root&&e.scroll?.wasRoot}const Fhe=lq({attachResizeListener:(e,t)=>R1(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),XL={current:void 0},uq=lq({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!XL.current){const e=new Fhe({});e.mount(window),e.setOptions({layoutScroll:!0}),XL.current=e}return XL.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Ehe={pan:{Feature:rhe},drag:{Feature:ihe,ProjectionNode:uq,MeasureLayout:oq}};function mN(e,t,n){const{props:c}=e;e.animationState&&c.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,r=c[i];r&&he.postRender(()=>r(t,W1(t)))}class Ohe extends Vt{mount(){const{current:t}=this.node;t&&(this.unmount=d0e(t,(n,c)=>(mN(this.node,c,"Start"),i=>mN(this.node,i,"End"))))}unmount(){}}class Uhe extends Vt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=E1(R1(this.node.current,"focus",()=>this.onFocus()),R1(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function fN(e,t,n){const{props:c}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&c.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),r=c[i];r&&he.postRender(()=>r(t,W1(t)))}class Whe extends Vt{mount(){const{current:t}=this.node;t&&(this.unmount=p0e(t,(n,c)=>(fN(this.node,c,"Start"),(i,{success:r})=>fN(this.node,i,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const iw=new WeakMap,YL=new WeakMap,Ghe=e=>{const t=iw.get(e.target);t&&t(e)},Khe=e=>{e.forEach(Ghe)};function Zhe({root:e,...t}){const n=e||document;YL.has(n)||YL.set(n,{});const c=YL.get(n),i=JSON.stringify(t);return c[i]||(c[i]=new IntersectionObserver(Khe,{root:e,...t})),c[i]}function Xhe(e,t,n){const c=Zhe(t);return iw.set(e,n),c.observe(e),()=>{iw.delete(e),c.unobserve(e)}}const Yhe={some:0,all:1};class Jhe extends Vt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:c,amount:i="some",once:r}=t,s={root:n?n.current:void 0,rootMargin:c,threshold:typeof i=="number"?i:Yhe[i]},d=l=>{const{isIntersecting:h}=l;if(this.isInView===h||(this.isInView=h,r&&!h&&this.hasEnteredView))return;h&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",h);const{onViewportEnter:u,onViewportLeave:p}=this.node.getProps(),y=h?u:p;y&&y(l)};return Xhe(this.node.current,s,d)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Qhe(t,n))&&this.startObserver()}unmount(){}}function Qhe({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const eue={inView:{Feature:Jhe},tap:{Feature:Whe},focus:{Feature:Uhe},hover:{Feature:Ohe}},tue={layout:{ProjectionNode:uq,MeasureLayout:oq}},aue={...Ble,...eue,...Ehe,...tue},Ew=ale(aue,kle);function pq(e){const t=zt(()=>$c(e)),{isStatic:n}=k.useContext(kL);if(n){const[,c]=k.useState(e);k.useEffect(()=>t.on("change",c),[])}return t}function yq(e,t){const n=pq(t()),c=()=>n.set(t());return c(),uw(()=>{const i=()=>he.preRender(c,!1,!0),r=e.map(s=>s.on("change",i));return()=>{r.forEach(s=>s()),gt(c)}}),n}function nue(e){$1.current=[],e();const t=yq($1.current,e);return $1.current=void 0,t}function oue(e,t,n,c){if(typeof e=="function")return nue(e);const i=typeof t=="function"?t:k0e(t,n,c);return Array.isArray(e)?gN(e,i):gN([e],([r])=>i(r))}function gN(e,t){const n=zt(()=>[]);return yq(e,()=>{n.length=0;const c=e.length;for(let i=0;i<c;i++)n[i]=e[i].get();return t(n)})}class cue{constructor(){this.componentControls=new Set}subscribe(t){return this.componentControls.add(t),()=>this.componentControls.delete(t)}start(t,n){this.componentControls.forEach(c=>{c.start(t.nativeEvent||t,n)})}cancel(){this.componentControls.forEach(t=>{t.cancel()})}stop(){this.componentControls.forEach(t=>{t.stop()})}}const iue=()=>new cue;function rue(){return zt(iue)}const kq=k.createContext(null);function sue(e,t,n,c){if(!c)return e;const i=e.findIndex(u=>u.value===t);if(i===-1)return e;const r=c>0?1:-1,s=e[i+r];if(!s)return e;const d=e[i],l=s.layout,h=pe(l.min,l.max,.5);return r===1&&d.layout.max+n>h||r===-1&&d.layout.min+n<h?_2e(e,i,i+r):e}function due({children:e,as:t="ul",axis:n="y",onReorder:c,values:i,...r},s){const d=zt(()=>Ew[t]),l=[],h=k.useRef(!1);Qe(!!i,"Reorder.Group must be provided a values prop","reorder-values");const u={axis:n,registerItem:(p,y)=>{const m=l.findIndex(g=>p===g.value);m!==-1?l[m].layout=y[n]:l.push({value:p,layout:y[n]}),l.sort(uue)},updateOrder:(p,y,m)=>{if(h.current)return;const g=sue(l,p,y,m);l!==g&&(h.current=!0,c(g.map(hue).filter(f=>i.indexOf(f)!==-1)))}};return k.useEffect(()=>{h.current=!1}),o.jsx(d,{...r,ref:s,ignoreStrict:!0,children:o.jsx(kq.Provider,{value:u,children:e})})}const lue=k.forwardRef(due);function hue(e){return e.value}function uue(e,t){return e.layout.min-t.layout.min}function vN(e,t=0){return Ne(e)?e:pq(t)}function pue({children:e,style:t={},value:n,as:c="li",onDrag:i,layout:r=!0,...s},d){const l=zt(()=>Ew[c]),h=k.useContext(kq),u={x:vN(t.x),y:vN(t.y)},p=oue([u.x,u.y],([f,M])=>f||M?1:"unset");Qe(!!h,"Reorder.Item must be a child of Reorder.Group","reorder-item-child");const{axis:y,registerItem:m,updateOrder:g}=h;return o.jsx(l,{drag:y,...s,dragSnapToOrigin:!0,style:{...t,x:u.x,y:u.y,zIndex:p},layout:r,onDrag:(f,M)=>{const{velocity:_}=M;_[y]&&g(n,u[y].get(),_[y]),i&&i(f,M)},onLayoutMeasure:f=>m(n,f),ref:d,ignoreStrict:!0,children:e})}const yue=k.forwardRef(pue),lL=[o.jsx(j1,{size:18}),o.jsx(Ct,{size:18}),o.jsx(C1,{size:18}),o.jsx(Nt,{size:18}),o.jsx(g1,{size:18}),o.jsx(f1,{size:18})],kue=({items:e,onReorder:t,draggable:n=!1,className:c,header:i,headerStyle:r,itemsDraggable:s=!0})=>{const[d,l]=k.useState(e??[]);return k.useEffect(()=>{e&&Array.isArray(e)?(e.forEach((h,u)=>{if(h.icon==null&&(h.icon=lL[u%lL.length]),typeof h.text=="string"&&h.text.includes("/")){const p=String(h.text).split("/"),y=p[0].trim(),g=p.slice(1).join("/").trim().match(/^(\d+)(.*)$/);if(g){const f=g[1],M=g[2]??"",_=f.padStart(3,"0");h.text=`${y} / ${_}${M}`}}}),l(e)):l([])},[e]),o.jsxs("div",{className:`trend-list ${c??""}`,draggable:n,style:{position:"relative"},children:[o.jsx("div",{className:"trend-header",style:r,children:i??"Trend"}),o.jsx("div",{className:"trend-list-body",style:{opacity:n?0:1},children:o.jsx(lue,{axis:"y",values:d,onReorder:h=>{l(h),t?.(h)},style:{display:"flex",flexDirection:"column",gap:8},children:d.map((h,u)=>o.jsx(mue,{value:h,index:u,itemsDraggable:s},String(h.id)))})}),n&&o.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:o.jsx(a.Move,{size:48,strokeWidth:1.5,style:{opacity:.8}})})]})};function mue({value:e,index:t}){const n=rue(),c=lL[t%lL.length]??null;return o.jsx(yue,{value:e,dragListener:!1,dragControls:n,style:{listStyle:"none"},onDragStart:()=>{try{document.body.classList.add("is-dragging")}catch{}},onDragEnd:()=>{try{document.body.classList.remove("is-dragging")}catch{}},children:o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[o.jsx("div",{className:"reorder-handle","aria-hidden":!0,onPointerDown:i=>n.start(i),style:{width:28,height:28,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",userSelect:"none"},children:o.jsx("svg",{width:"25",height:"25",viewBox:"0 0 24 24","aria-hidden":!0,children:o.jsxs("g",{fill:"currentColor",children:[o.jsx("circle",{cx:"8",cy:"6",r:"2"}),o.jsx("circle",{cx:"16",cy:"6",r:"2"}),o.jsx("circle",{cx:"8",cy:"12",r:"2"}),o.jsx("circle",{cx:"16",cy:"12",r:"2"}),o.jsx("circle",{cx:"8",cy:"18",r:"2"}),o.jsx("circle",{cx:"16",cy:"18",r:"2"})]})})}),o.jsx("div",{style:{flex:1},children:o.jsx(zS,{title:e.title,subtitle:e.subtitle,text:e.text,background:e.background,titleStyle:e.titleStyle,subtitleStyle:e.subtitleStyle,textStyle:e.textStyle,itemStyle:e.itemStyle,icon:e.icon??c})})]})})}function fue(e,t){return t.required?t.type==="checkbox"&&!e?{isValid:!1,error:`${t.label} est requis`}:!e||typeof e=="string"&&e.trim()===""?{isValid:!1,error:`${t.label} est requis`}:null:null}function gue(e){return!e||typeof e=="string"&&e.trim()===""}function vue(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)?null:{isValid:!1,error:"Format d'email invalide"}}function Mue(e){return/^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)*\/?$/.test(e)?null:{isValid:!1,error:"Format d'URL invalide"}}function _ue(e,t){const n=Number(e);return isNaN(n)?{isValid:!1,error:"Doit être un nombre valide"}:t.validation?.min!==void 0&&n<Number(t.validation.min)?{isValid:!1,error:`Doit être ≥ ${t.validation.min}`}:t.validation?.max!==void 0&&n>Number(t.validation.max)?{isValid:!1,error:`Doit être ≤ ${t.validation.max}`}:null}function xue(e,t){return t.validation?.minDate&&new Date(e)<new Date(t.validation.minDate)?{isValid:!1,error:`Doit être après ${t.validation.minDate}`}:t.validation?.maxDate&&new Date(e)>new Date(t.validation.maxDate)?{isValid:!1,error:`Doit être avant ${t.validation.maxDate}`}:null}function Lue(e,t){if(t.validation?.acceptedTypes){const n=t.validation.acceptedTypes.split(","),c=e.type;if(!n.some(i=>c.match(i.replace("*",".*"))))return{isValid:!1,error:`Type de fichier non supporté: ${c}`}}return t.validation?.maxFileSize&&e.size>t.validation.maxFileSize?{isValid:!1,error:`Fichier trop volumineux (max ${t.validation.maxFileSize/1048576}MB)`}:null}function Iue(e,t){return t.validation?t.validation.minLength&&e.length<t.validation.minLength?{isValid:!1,error:`Minimum ${t.validation.minLength} caractères`}:t.validation.maxLength&&e.length>t.validation.maxLength?{isValid:!1,error:`Maximum ${t.validation.maxLength} caractères`}:t.validation.pattern&&!new RegExp(t.validation.pattern).test(e)?{isValid:!1,error:"Format invalide"}:null:null}function hL(e,t){const n=fue(e,t);if(n)return n;if(gue(e))return{isValid:!0};const c=e.toString();switch(t.type){case"email":{const r=vue(c);if(r)return r;break}case"url":{const r=Mue(c);if(r)return r;break}case"number":{const r=_ue(e,t);if(r)return r;break}case"date":case"month":case"week":case"time":case"datetime-local":{const r=xue(e,t);if(r)return r;break}case"file":{const r=Lue(e,t);if(r)return r;break}}const i=Iue(c,t);return i||{isValid:!0}}function mq(e,t){const n={};let c=!0;for(const i of t){const r=hL(e[i.name],i);r.isValid||(n[i.name]=r.error,c=!1)}return{isValid:c,errors:n}}const bue="_formContainer_14ads_1",wue="_headerLine_14ads_17",Cue="_formTitle_14ads_25",Nue="_formDescription_14ads_30",jue="_sectionTitle_14ads_37",Sue="_sectionHelp_14ads_44",$ue="_fieldHelp_14ads_50",que="_gridContainer_14ads_58",Aue="_fieldGridItem_14ads_70",zue="_sectionFull_14ads_105",Vue="_formFooter_14ads_110",Pue="_footerLeft_14ads_118",Tue="_footerRight_14ads_119",Hue="_cancelLink_14ads_125",Due="_submitButton_14ads_136",Bue="_fieldLabel_14ads_148",Rue="_inputWrapper_14ads_163",Fue="_inputInner_14ads_187",Eue="_hasPrefix_14ads_196",Oue="_inputBase_14ads_196",Uue="_iconPrefix_14ads_292",Wue="_iconSuffix_14ads_293",Gue="_passwordToggle_14ads_319",Kue="_fieldError_14ads_365",Zue="_fieldInvalid_14ads_372",le={formContainer:bue,headerLine:wue,formTitle:Cue,formDescription:Nue,sectionTitle:jue,sectionHelp:Sue,fieldHelp:$ue,gridContainer:que,fieldGridItem:Aue,sectionFull:zue,formFooter:Vue,footerLeft:Pue,footerRight:Tue,cancelLink:Hue,submitButton:Due,fieldLabel:Bue,inputWrapper:Rue,inputInner:Fue,hasPrefix:Eue,inputBase:Oue,iconPrefix:Uue,iconSuffix:Wue,passwordToggle:Gue,fieldError:Kue,fieldInvalid:Zue},fq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>{const[s,d]=k.useState(!1),l=e.type==="password",h=e.attributes?.showPasswordToggle??!0,u=l?s?"text":"password":e.type,p=e.attributes?.iconComponent??(e.attributes?.icon?kt[e.attributes.icon]:null),y=e.attributes?.iconPosition??"suffix",m=g=>{n(g.target.value)};return o.jsxs("div",{className:le.inputWrapper,children:[o.jsx("label",{className:`${le.fieldLabel} ${e.required?"required":""}`,htmlFor:e.name,children:e.label}),o.jsxs("div",{className:`${le.inputInner} ${p&&y==="prefix"?le.hasPrefix:""}`,children:[p&&y==="prefix"&&o.jsx("span",{className:le.iconPrefix,children:o.jsx(p,{size:16})}),o.jsx("input",{id:e.name,name:e.name,type:u,placeholder:e.placeholder,className:`${le.inputBase} ${i?le.fieldInvalid:""}`,value:t??"",onChange:m,onBlur:c,disabled:!!e.disabled,"aria-invalid":!!i,"aria-describedby":e.help?`${e.name}-help`:void 0}),l&&h&&o.jsx("button",{type:"button","aria-label":s?"Masquer le mot de passe":"Afficher le mot de passe",className:le.passwordToggle,onClick:()=>d(g=>!g),children:s?o.jsx(L1,{size:16}):o.jsx(I1,{size:16})}),p&&y==="suffix"&&!l&&o.jsx("span",{className:le.iconSuffix,children:o.jsx(p,{size:16})})]}),r&&i&&o.jsx("span",{className:le.fieldError,children:i})]})},Xue="_fieldGroup_yb3zi_7",Yue="_fieldLabel_yb3zi_11",Jue="_required_yb3zi_17",Que="_fieldInput_yb3zi_22",epe="_fieldInvalid_yb3zi_40",tpe="_fieldValid_yb3zi_44",ape="_fieldError_yb3zi_48",npe="_radioGroup_yb3zi_57",St={fieldGroup:Xue,fieldLabel:Yue,required:Jue,fieldInput:Que,fieldInvalid:epe,fieldValid:tpe,fieldError:ape,radioGroup:npe},vL=({field:e,children:t,error:n,touched:c})=>{const i=c&&n;return o.jsxs("div",{className:St.fieldGroup,children:[e.type!=="checkbox"&&e.type!=="radio"&&o.jsx("label",{className:`${St.fieldLabel} ${e.required?St.required:""}`,children:e.label}),t,i&&o.jsx("span",{className:St.fieldError,children:n})]})},gq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>{const s=r&&i,d=r&&!i&&t,l=["form-control",St.fieldInput,s?St.fieldInvalid:"",d?St.fieldValid:""].filter(Boolean).join(" ");return o.jsx(vL,{field:e,error:i,touched:r,children:o.jsx("textarea",{className:l,placeholder:e.placeholder,value:t||"",onChange:h=>n(h.target.value),onBlur:c,rows:4})})},ope="_wrapper_117u4_1",cpe="_wrapperInvalid_117u4_15",ipe="_nativeSelect_117u4_19",rpe="_display_117u4_30",spe="_topLabel_117u4_37",dpe="_valueLine_117u4_45",lpe="_valuePlaceholder_117u4_53",hpe="_valueActive_117u4_57",upe="_caret_117u4_61",ppe="_error_117u4_75",ype="_optionStyle_117u4_89",Fe={wrapper:ope,wrapperInvalid:cpe,nativeSelect:ipe,display:rpe,topLabel:spe,valueLine:dpe,valuePlaceholder:lpe,valueActive:hpe,caret:upe,error:ppe,optionStyle:ype},Ow=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>{const s=!!(r&&i),d=e.label||"",l=e.placeholder||"",h=e.options?.find(u=>String(u.value)===String(t))?.label??"";return o.jsxs("div",{className:`${Fe.wrapper} ${s?Fe.wrapperInvalid:""} ${t?Fe.wrapperHasValue:""}`,children:[o.jsxs("select",{id:e.name,name:e.name,className:Fe.nativeSelect,value:t??"",onChange:u=>n(u.target.value),onBlur:c,"aria-invalid":s,"aria-label":d,children:[o.jsx("option",{value:"",disabled:!0,hidden:!0,children:l||`Sélectionnez ${d?.toLowerCase()||""}`}),e.options?.map((u,p)=>o.jsx("option",{value:u.value,className:Fe.optionStyle,children:u.label},p))]}),o.jsxs("div",{className:Fe.display,children:[d&&o.jsx("span",{className:Fe.topLabel,children:d}),o.jsx("span",{className:`${Fe.valueLine} ${t?Fe.valueActive:Fe.valuePlaceholder}`,children:t?h:l}),o.jsx("span",{className:Fe.caret,"aria-hidden":"true"})]}),s&&o.jsx("span",{className:Fe.error,children:i})]})},vq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>o.jsx(vL,{field:e,error:i,touched:r,children:o.jsxs("div",{className:"form-check",children:[o.jsx("input",{type:"checkbox",className:"form-check-input",id:e.name,checked:!!t,onChange:s=>n(s.target.checked),onBlur:c}),o.jsx("label",{className:"form-check-label",htmlFor:e.name,children:e.label})]})}),Mq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>o.jsx(vL,{field:e,error:i,touched:r,children:o.jsx("div",{className:St.radioGroup,children:e.options?.map(s=>o.jsxs("div",{className:"form-check",children:[o.jsx("input",{type:"radio",className:"form-check-input",id:`${e.name}-${s.value}`,name:e.name,value:s.value,checked:t===s.value,onChange:d=>n(d.target.value),onBlur:c}),o.jsx("label",{className:"form-check-label",htmlFor:`${e.name}-${s.value}`,children:s.label})]},s.value))})}),kpe="_fileInputContainer_r2guc_3",mpe="_customFileInput_r2guc_8",fpe="_fileInputLabel_r2guc_12",gpe="_dragOver_r2guc_39",vpe="_uploadIcon_r2guc_44",Mpe="_uploadText_r2guc_50",_pe="_uploadHint_r2guc_56",xpe="_fileList_r2guc_60",Lpe="_fileListTitle_r2guc_69",Ipe="_fileItem_r2guc_80",bpe="_fileIcon_r2guc_96",wpe="_fileName_r2guc_102",Cpe="_fileSize_r2guc_108",Npe="_removeButton_r2guc_114",jpe="_errorText_r2guc_129",Se={fileInputContainer:kpe,customFileInput:mpe,fileInputLabel:fpe,dragOver:gpe,uploadIcon:vpe,uploadText:Mpe,uploadHint:_pe,fileList:xpe,fileListTitle:Lpe,fileItem:Ipe,fileIcon:bpe,fileName:wpe,fileSize:Cpe,removeButton:Npe,errorText:jpe},_q=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>{const s=k.useRef(null),[d,l]=k.useState(!1),h=M=>{n(M.target.files)},u=()=>{s.current&&s.current.click()},p=M=>{M.preventDefault(),l(!0)},y=()=>{l(!1)},m=M=>{M.preventDefault(),l(!1),M.dataTransfer.files&&M.dataTransfer.files.length>0&&n(M.dataTransfer.files)},g=M=>{if(!t)return;const _=Array.from(t);_.splice(M,1);const v=new DataTransfer;_.forEach(L=>v.items.add(L)),n(v.files)},f=M=>{if(M===0)return"0 Bytes";const _=1024,v=["Bytes","KB","MB","GB"],L=Math.floor(Math.log(M)/Math.log(_));return parseFloat((M/Math.pow(_,L)).toFixed(2))+" "+v[L]};return o.jsxs("div",{className:`${Se.fileInputContainer} ${r&&i?Se.hasError:""}`,children:[o.jsxs("label",{htmlFor:e.name,className:"form-label",children:[e.label,e.required&&o.jsx("span",{className:"text-danger",children:" *"})]}),o.jsx("input",{type:"file",id:e.name,name:e.name,multiple:e.attributes?.multiple||!1,accept:e.attributes?.accept,onChange:h,onBlur:c,ref:s,className:Se.customFileInput}),o.jsxs("label",{htmlFor:e.name,className:`${Se.fileInputLabel} ${d?Se.dragOver:""}`,onDragOver:p,onDragLeave:y,onDrop:m,onClick:u,tabIndex:0,children:[o.jsx("div",{className:Se.uploadIcon,children:o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",fill:"currentColor",viewBox:"0 0 16 16",children:[o.jsx("path",{d:"M.5 9.9a.5.5 0 0 1 .5.5v2.5a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-2.5a.5.5 0 0 1 1 0v2.5a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-2.5a.5.5 0 0 1 .5-.5z"}),o.jsx("path",{d:"M7.646 1.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1-.708.708L8.5 2.707V11.5a.5.5 0 0 1-1 0V2.707L5.354 4.854a.5.5 0 1 1-.708-.708l3-3z"})]})}),o.jsx("div",{className:Se.uploadText,children:d?"Déposez vos fichiers ici":"Cliquez ou glissez-déposez pour téléverser"}),o.jsxs("div",{className:Se.uploadHint,children:[e.attributes?.accept||"Tous les fichiers"," ",e.attributes?.multiple?"(Multiple autorisé)":""]})]}),t&&t.length>0&&o.jsxs("div",{className:Se.fileList,children:[o.jsx("div",{className:Se.fileListTitle,children:"Fichiers sélectionnés:"}),o.jsx("ul",{children:Array.from(t).map((M,_)=>o.jsxs("li",{className:Se.fileItem,children:[o.jsx("div",{className:Se.fileIcon,children:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",children:o.jsx("path",{d:"M4 0h5.293A1 1 0 0 1 10 .293L13.707 4a1 1 0 0 1 .293.707V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2zm5.5 1.5v2a1 1 0 0 0 1 1h2l-3-3z"})})}),o.jsx("div",{className:Se.fileName,children:M.name}),o.jsx("div",{className:Se.fileSize,children:f(M.size)}),o.jsx("button",{type:"button",className:Se.removeButton,onClick:v=>{v.stopPropagation(),g(_)},"aria-label":`Supprimer ${M.name}`,children:o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",children:[o.jsx("path",{d:"M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z"}),o.jsx("path",{fillRule:"evenodd",d:"M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z"})]})})]},_))})]}),r&&i&&o.jsx("div",{className:Se.errorText,children:i})]})},Spe="_container_ecah4_2",$pe="_label_ecah4_6",qpe="_requiredIndicator_ecah4_13",Ape="_input_ecah4_18",zpe="_inputError_ecah4_49",Vpe="_errorMessage_ecah4_58",Dc={container:Spe,label:$pe,requiredIndicator:qpe,input:Ape,inputError:zpe,errorMessage:Vpe},xq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r,labelColor:s="black",backgroundColor:d="white"})=>{const l=e.type==="month"?"month":e.type==="week"?"week":e.type==="time"?"time":e.type==="datetime-local"?"datetime-local":"date";return o.jsxs("div",{className:Dc.container,children:[o.jsxs("label",{htmlFor:e.name,className:Dc.label,style:{color:s},children:[e.label,e.required&&o.jsx("span",{className:Dc.requiredIndicator,children:"*"})]}),o.jsx("input",{type:l,id:e.name,name:e.name,value:t||"",onChange:h=>n(h.target.value),onBlur:c,className:`${Dc.input} ${r&&i?Dc.inputError:""}`,style:{color:s,backgroundColor:d},min:e.validation?.min,max:e.validation?.max,step:e.type==="time"?e.attributes?.step:void 0,disabled:e.disabled}),r&&i&&o.jsx("div",{className:Dc.errorMessage,children:i})]})},Ppe="_rangeContainer_cyqk3_3",Tpe={rangeContainer:Ppe},Lq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>o.jsxs("div",{className:`mb-3 ${Tpe.rangeContainer}`,children:[o.jsxs("label",{htmlFor:e.name,className:"form-label",children:[e.label,": ",t,e.required&&o.jsx("span",{className:"text-danger",children:" *"})]}),o.jsx("input",{type:"range",id:e.name,name:e.name,value:t||0,onChange:s=>n(s.target.value),onBlur:c,className:`form-range ${r&&i?"is-invalid":""}`,min:e.validation?.min||0,max:e.validation?.max||100,step:e.attributes?.step||1}),r&&i&&o.jsx("div",{className:"invalid-feedback",children:i})]}),Hpe="_colorPickerContainer_1wxgj_2",Dpe="_colorInput_1wxgj_19",Bpe="_colorValue_1wxgj_39",JL={colorPickerContainer:Hpe,colorInput:Dpe,colorValue:Bpe},Iq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>o.jsxs("div",{className:"mb-3",children:[o.jsxs("label",{htmlFor:e.name,className:"form-label",children:[e.label,e.required&&o.jsx("span",{className:"text-danger",children:" *"})]}),o.jsxs("div",{className:JL.colorPickerContainer,children:[o.jsx("input",{type:"color",id:e.name,name:e.name,value:t||"#000000",onChange:s=>n(s.target.value),onBlur:c,className:JL.colorInput}),o.jsx("span",{className:JL.colorValue,children:t})]}),r&&i&&o.jsx("div",{className:"invalid-feedback",children:i})]}),bq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>{const s=["date","month","week","time","datetime-local"];if(e.type==="file")return o.jsx(_q,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});if(s.includes(e.type))return o.jsx(xq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});if(e.type==="range")return o.jsx(Lq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});if(e.type==="color")return o.jsx(Iq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});switch(e.type){case"textarea":return o.jsx(gq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});case"select":return o.jsx(Ow,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});case"checkbox":return o.jsx(vq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});case"radio":return o.jsx(Mq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});default:return o.jsx(fq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})}};var QL,MN;function Rpe(){if(MN)return QL;MN=1;function e(){this.__data__=[],this.size=0}return QL=e,QL}var eI,_N;function wq(){if(_N)return eI;_N=1;function e(t,n){return t===n||t!==t&&n!==n}return eI=e,eI}var tI,xN;function ML(){if(xN)return tI;xN=1;var e=wq();function t(n,c){for(var i=n.length;i--;)if(e(n[i][0],c))return i;return-1}return tI=t,tI}var aI,LN;function Fpe(){if(LN)return aI;LN=1;var e=ML(),t=Array.prototype,n=t.splice;function c(i){var r=this.__data__,s=e(r,i);if(s<0)return!1;var d=r.length-1;return s==d?r.pop():n.call(r,s,1),--this.size,!0}return aI=c,aI}var nI,IN;function Epe(){if(IN)return nI;IN=1;var e=ML();function t(n){var c=this.__data__,i=e(c,n);return i<0?void 0:c[i][1]}return nI=t,nI}var oI,bN;function Ope(){if(bN)return oI;bN=1;var e=ML();function t(n){return e(this.__data__,n)>-1}return oI=t,oI}var cI,wN;function Upe(){if(wN)return cI;wN=1;var e=ML();function t(n,c){var i=this.__data__,r=e(i,n);return r<0?(++this.size,i.push([n,c])):i[r][1]=c,this}return cI=t,cI}var iI,CN;function _L(){if(CN)return iI;CN=1;var e=Rpe(),t=Fpe(),n=Epe(),c=Ope(),i=Upe();function r(s){var d=-1,l=s==null?0:s.length;for(this.clear();++d<l;){var h=s[d];this.set(h[0],h[1])}}return r.prototype.clear=e,r.prototype.delete=t,r.prototype.get=n,r.prototype.has=c,r.prototype.set=i,iI=r,iI}var rI,NN;function Wpe(){if(NN)return rI;NN=1;var e=_L();function t(){this.__data__=new e,this.size=0}return rI=t,rI}var sI,jN;function Gpe(){if(jN)return sI;jN=1;function e(t){var n=this.__data__,c=n.delete(t);return this.size=n.size,c}return sI=e,sI}var dI,SN;function Kpe(){if(SN)return dI;SN=1;function e(t){return this.__data__.get(t)}return dI=e,dI}var lI,$N;function Zpe(){if($N)return lI;$N=1;function e(t){return this.__data__.has(t)}return lI=e,lI}var hI,qN;function Cq(){if(qN)return hI;qN=1;var e=typeof a.commonjsGlobal=="object"&&a.commonjsGlobal&&a.commonjsGlobal.Object===Object&&a.commonjsGlobal;return hI=e,hI}var uI,AN;function vt(){if(AN)return uI;AN=1;var e=Cq(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return uI=n,uI}var pI,zN;function Uw(){if(zN)return pI;zN=1;var e=vt(),t=e.Symbol;return pI=t,pI}var yI,VN;function Xpe(){if(VN)return yI;VN=1;var e=Uw(),t=Object.prototype,n=t.hasOwnProperty,c=t.toString,i=e?e.toStringTag:void 0;function r(s){var d=n.call(s,i),l=s[i];try{s[i]=void 0;var h=!0}catch{}var u=c.call(s);return h&&(d?s[i]=l:delete s[i]),u}return yI=r,yI}var kI,PN;function Ype(){if(PN)return kI;PN=1;var e=Object.prototype,t=e.toString;function n(c){return t.call(c)}return kI=n,kI}var mI,TN;function xL(){if(TN)return mI;TN=1;var e=Uw(),t=Xpe(),n=Ype(),c="[object Null]",i="[object Undefined]",r=e?e.toStringTag:void 0;function s(d){return d==null?d===void 0?i:c:r&&r in Object(d)?t(d):n(d)}return mI=s,mI}var fI,HN;function Nq(){if(HN)return fI;HN=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return fI=e,fI}var gI,DN;function jq(){if(DN)return gI;DN=1;var e=xL(),t=Nq(),n="[object AsyncFunction]",c="[object Function]",i="[object GeneratorFunction]",r="[object Proxy]";function s(d){if(!t(d))return!1;var l=e(d);return l==c||l==i||l==n||l==r}return gI=s,gI}var vI,BN;function Jpe(){if(BN)return vI;BN=1;var e=vt(),t=e["__core-js_shared__"];return vI=t,vI}var MI,RN;function Qpe(){if(RN)return MI;RN=1;var e=Jpe(),t=function(){var c=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return c?"Symbol(src)_1."+c:""}();function n(c){return!!t&&t in c}return MI=n,MI}var _I,FN;function Sq(){if(FN)return _I;FN=1;var e=Function.prototype,t=e.toString;function n(c){if(c!=null){try{return t.call(c)}catch{}try{return c+""}catch{}}return""}return _I=n,_I}var xI,EN;function eye(){if(EN)return xI;EN=1;var e=jq(),t=Qpe(),n=Nq(),c=Sq(),i=/[\\^$.*+?()[\]{}|]/g,r=/^\[object .+?Constructor\]$/,s=Function.prototype,d=Object.prototype,l=s.toString,h=d.hasOwnProperty,u=RegExp("^"+l.call(h).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p(y){if(!n(y)||t(y))return!1;var m=e(y)?u:r;return m.test(c(y))}return xI=p,xI}var LI,ON;function tye(){if(ON)return LI;ON=1;function e(t,n){return t?.[n]}return LI=e,LI}var II,UN;function c1(){if(UN)return II;UN=1;var e=eye(),t=tye();function n(c,i){var r=t(c,i);return e(r)?r:void 0}return II=n,II}var bI,WN;function Ww(){if(WN)return bI;WN=1;var e=c1(),t=vt(),n=e(t,"Map");return bI=n,bI}var wI,GN;function LL(){if(GN)return wI;GN=1;var e=c1(),t=e(Object,"create");return wI=t,wI}var CI,KN;function aye(){if(KN)return CI;KN=1;var e=LL();function t(){this.__data__=e?e(null):{},this.size=0}return CI=t,CI}var NI,ZN;function nye(){if(ZN)return NI;ZN=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return NI=e,NI}var jI,XN;function oye(){if(XN)return jI;XN=1;var e=LL(),t="__lodash_hash_undefined__",n=Object.prototype,c=n.hasOwnProperty;function i(r){var s=this.__data__;if(e){var d=s[r];return d===t?void 0:d}return c.call(s,r)?s[r]:void 0}return jI=i,jI}var SI,YN;function cye(){if(YN)return SI;YN=1;var e=LL(),t=Object.prototype,n=t.hasOwnProperty;function c(i){var r=this.__data__;return e?r[i]!==void 0:n.call(r,i)}return SI=c,SI}var $I,JN;function iye(){if(JN)return $I;JN=1;var e=LL(),t="__lodash_hash_undefined__";function n(c,i){var r=this.__data__;return this.size+=this.has(c)?0:1,r[c]=e&&i===void 0?t:i,this}return $I=n,$I}var qI,QN;function rye(){if(QN)return qI;QN=1;var e=aye(),t=nye(),n=oye(),c=cye(),i=iye();function r(s){var d=-1,l=s==null?0:s.length;for(this.clear();++d<l;){var h=s[d];this.set(h[0],h[1])}}return r.prototype.clear=e,r.prototype.delete=t,r.prototype.get=n,r.prototype.has=c,r.prototype.set=i,qI=r,qI}var AI,ej;function sye(){if(ej)return AI;ej=1;var e=rye(),t=_L(),n=Ww();function c(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return AI=c,AI}var zI,tj;function dye(){if(tj)return zI;tj=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return zI=e,zI}var VI,aj;function IL(){if(aj)return VI;aj=1;var e=dye();function t(n,c){var i=n.__data__;return e(c)?i[typeof c=="string"?"string":"hash"]:i.map}return VI=t,VI}var PI,nj;function lye(){if(nj)return PI;nj=1;var e=IL();function t(n){var c=e(this,n).delete(n);return this.size-=c?1:0,c}return PI=t,PI}var TI,oj;function hye(){if(oj)return TI;oj=1;var e=IL();function t(n){return e(this,n).get(n)}return TI=t,TI}var HI,cj;function uye(){if(cj)return HI;cj=1;var e=IL();function t(n){return e(this,n).has(n)}return HI=t,HI}var DI,ij;function pye(){if(ij)return DI;ij=1;var e=IL();function t(n,c){var i=e(this,n),r=i.size;return i.set(n,c),this.size+=i.size==r?0:1,this}return DI=t,DI}var BI,rj;function $q(){if(rj)return BI;rj=1;var e=sye(),t=lye(),n=hye(),c=uye(),i=pye();function r(s){var d=-1,l=s==null?0:s.length;for(this.clear();++d<l;){var h=s[d];this.set(h[0],h[1])}}return r.prototype.clear=e,r.prototype.delete=t,r.prototype.get=n,r.prototype.has=c,r.prototype.set=i,BI=r,BI}var RI,sj;function yye(){if(sj)return RI;sj=1;var e=_L(),t=Ww(),n=$q(),c=200;function i(r,s){var d=this.__data__;if(d instanceof e){var l=d.__data__;if(!t||l.length<c-1)return l.push([r,s]),this.size=++d.size,this;d=this.__data__=new n(l)}return d.set(r,s),this.size=d.size,this}return RI=i,RI}var FI,dj;function kye(){if(dj)return FI;dj=1;var e=_L(),t=Wpe(),n=Gpe(),c=Kpe(),i=Zpe(),r=yye();function s(d){var l=this.__data__=new e(d);this.size=l.size}return s.prototype.clear=t,s.prototype.delete=n,s.prototype.get=c,s.prototype.has=i,s.prototype.set=r,FI=s,FI}var EI,lj;function mye(){if(lj)return EI;lj=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return EI=t,EI}var OI,hj;function fye(){if(hj)return OI;hj=1;function e(t){return this.__data__.has(t)}return OI=e,OI}var UI,uj;function gye(){if(uj)return UI;uj=1;var e=$q(),t=mye(),n=fye();function c(i){var r=-1,s=i==null?0:i.length;for(this.__data__=new e;++r<s;)this.add(i[r])}return c.prototype.add=c.prototype.push=t,c.prototype.has=n,UI=c,UI}var WI,pj;function vye(){if(pj)return WI;pj=1;function e(t,n){for(var c=-1,i=t==null?0:t.length;++c<i;)if(n(t[c],c,t))return!0;return!1}return WI=e,WI}var GI,yj;function Mye(){if(yj)return GI;yj=1;function e(t,n){return t.has(n)}return GI=e,GI}var KI,kj;function qq(){if(kj)return KI;kj=1;var e=gye(),t=vye(),n=Mye(),c=1,i=2;function r(s,d,l,h,u,p){var y=l&c,m=s.length,g=d.length;if(m!=g&&!(y&&g>m))return!1;var f=p.get(s),M=p.get(d);if(f&&M)return f==d&&M==s;var _=-1,v=!0,L=l&i?new e:void 0;for(p.set(s,d),p.set(d,s);++_<m;){var w=s[_],C=d[_];if(h)var b=y?h(C,w,_,d,s,p):h(w,C,_,s,d,p);if(b!==void 0){if(b)continue;v=!1;break}if(L){if(!t(d,function(x,I){if(!n(L,I)&&(w===x||u(w,x,l,h,p)))return L.push(I)})){v=!1;break}}else if(!(w===C||u(w,C,l,h,p))){v=!1;break}}return p.delete(s),p.delete(d),v}return KI=r,KI}var ZI,mj;function _ye(){if(mj)return ZI;mj=1;var e=vt(),t=e.Uint8Array;return ZI=t,ZI}var XI,fj;function xye(){if(fj)return XI;fj=1;function e(t){var n=-1,c=Array(t.size);return t.forEach(function(i,r){c[++n]=[r,i]}),c}return XI=e,XI}var YI,gj;function Lye(){if(gj)return YI;gj=1;function e(t){var n=-1,c=Array(t.size);return t.forEach(function(i){c[++n]=i}),c}return YI=e,YI}var JI,vj;function Iye(){if(vj)return JI;vj=1;var e=Uw(),t=_ye(),n=wq(),c=qq(),i=xye(),r=Lye(),s=1,d=2,l="[object Boolean]",h="[object Date]",u="[object Error]",p="[object Map]",y="[object Number]",m="[object RegExp]",g="[object Set]",f="[object String]",M="[object Symbol]",_="[object ArrayBuffer]",v="[object DataView]",L=e?e.prototype:void 0,w=L?L.valueOf:void 0;function C(b,x,I,S,j,$,q){switch(I){case v:if(b.byteLength!=x.byteLength||b.byteOffset!=x.byteOffset)return!1;b=b.buffer,x=x.buffer;case _:return!(b.byteLength!=x.byteLength||!$(new t(b),new t(x)));case l:case h:case y:return n(+b,+x);case u:return b.name==x.name&&b.message==x.message;case m:case f:return b==x+"";case p:var H=i;case g:var D=S&s;if(H||(H=r),b.size!=x.size&&!D)return!1;var z=q.get(b);if(z)return z==x;S|=d,q.set(b,x);var N=c(H(b),H(x),S,j,$,q);return q.delete(b),N;case M:if(w)return w.call(b)==w.call(x)}return!1}return JI=C,JI}var QI,Mj;function bye(){if(Mj)return QI;Mj=1;function e(t,n){for(var c=-1,i=n.length,r=t.length;++c<i;)t[r+c]=n[c];return t}return QI=e,QI}var eb,_j;function Gw(){if(_j)return eb;_j=1;var e=Array.isArray;return eb=e,eb}var tb,xj;function wye(){if(xj)return tb;xj=1;var e=bye(),t=Gw();function n(c,i,r){var s=i(c);return t(c)?s:e(s,r(c))}return tb=n,tb}var ab,Lj;function Cye(){if(Lj)return ab;Lj=1;function e(t,n){for(var c=-1,i=t==null?0:t.length,r=0,s=[];++c<i;){var d=t[c];n(d,c,t)&&(s[r++]=d)}return s}return ab=e,ab}var nb,Ij;function Nye(){if(Ij)return nb;Ij=1;function e(){return[]}return nb=e,nb}var ob,bj;function jye(){if(bj)return ob;bj=1;var e=Cye(),t=Nye(),n=Object.prototype,c=n.propertyIsEnumerable,i=Object.getOwnPropertySymbols,r=i?function(s){return s==null?[]:(s=Object(s),e(i(s),function(d){return c.call(s,d)}))}:t;return ob=r,ob}var cb,wj;function Sye(){if(wj)return cb;wj=1;function e(t,n){for(var c=-1,i=Array(t);++c<t;)i[c]=n(c);return i}return cb=e,cb}var ib,Cj;function bL(){if(Cj)return ib;Cj=1;function e(t){return t!=null&&typeof t=="object"}return ib=e,ib}var rb,Nj;function $ye(){if(Nj)return rb;Nj=1;var e=xL(),t=bL(),n="[object Arguments]";function c(i){return t(i)&&e(i)==n}return rb=c,rb}var sb,jj;function qye(){if(jj)return sb;jj=1;var e=$ye(),t=bL(),n=Object.prototype,c=n.hasOwnProperty,i=n.propertyIsEnumerable,r=e(function(){return arguments}())?e:function(s){return t(s)&&c.call(s,"callee")&&!i.call(s,"callee")};return sb=r,sb}var k1={exports:{}},db,Sj;function Aye(){if(Sj)return db;Sj=1;function e(){return!1}return db=e,db}k1.exports;var $j;function Aq(){return $j||($j=1,function(e,t){var n=vt(),c=Aye(),i=t&&!t.nodeType&&t,r=i&&!0&&e&&!e.nodeType&&e,s=r&&r.exports===i,d=s?n.Buffer:void 0,l=d?d.isBuffer:void 0,h=l||c;e.exports=h}(k1,k1.exports)),k1.exports}var lb,qj;function zye(){if(qj)return lb;qj=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(c,i){var r=typeof c;return i=i??e,!!i&&(r=="number"||r!="symbol"&&t.test(c))&&c>-1&&c%1==0&&c<i}return lb=n,lb}var hb,Aj;function zq(){if(Aj)return hb;Aj=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return hb=t,hb}var ub,zj;function Vye(){if(zj)return ub;zj=1;var e=xL(),t=zq(),n=bL(),c="[object Arguments]",i="[object Array]",r="[object Boolean]",s="[object Date]",d="[object Error]",l="[object Function]",h="[object Map]",u="[object Number]",p="[object Object]",y="[object RegExp]",m="[object Set]",g="[object String]",f="[object WeakMap]",M="[object ArrayBuffer]",_="[object DataView]",v="[object Float32Array]",L="[object Float64Array]",w="[object Int8Array]",C="[object Int16Array]",b="[object Int32Array]",x="[object Uint8Array]",I="[object Uint8ClampedArray]",S="[object Uint16Array]",j="[object Uint32Array]",$={};$[v]=$[L]=$[w]=$[C]=$[b]=$[x]=$[I]=$[S]=$[j]=!0,$[c]=$[i]=$[M]=$[r]=$[_]=$[s]=$[d]=$[l]=$[h]=$[u]=$[p]=$[y]=$[m]=$[g]=$[f]=!1;function q(H){return n(H)&&t(H.length)&&!!$[e(H)]}return ub=q,ub}var pb,Vj;function Pye(){if(Vj)return pb;Vj=1;function e(t){return function(n){return t(n)}}return pb=e,pb}var m1={exports:{}};m1.exports;var Pj;function Tye(){return Pj||(Pj=1,function(e,t){var n=Cq(),c=t&&!t.nodeType&&t,i=c&&!0&&e&&!e.nodeType&&e,r=i&&i.exports===c,s=r&&n.process,d=function(){try{var l=i&&i.require&&i.require("util").types;return l||s&&s.binding&&s.binding("util")}catch{}}();e.exports=d}(m1,m1.exports)),m1.exports}var yb,Tj;function Vq(){if(Tj)return yb;Tj=1;var e=Vye(),t=Pye(),n=Tye(),c=n&&n.isTypedArray,i=c?t(c):e;return yb=i,yb}var kb,Hj;function Hye(){if(Hj)return kb;Hj=1;var e=Sye(),t=qye(),n=Gw(),c=Aq(),i=zye(),r=Vq(),s=Object.prototype,d=s.hasOwnProperty;function l(h,u){var p=n(h),y=!p&&t(h),m=!p&&!y&&c(h),g=!p&&!y&&!m&&r(h),f=p||y||m||g,M=f?e(h.length,String):[],_=M.length;for(var v in h)(u||d.call(h,v))&&!(f&&(v=="length"||m&&(v=="offset"||v=="parent")||g&&(v=="buffer"||v=="byteLength"||v=="byteOffset")||i(v,_)))&&M.push(v);return M}return kb=l,kb}var mb,Dj;function Dye(){if(Dj)return mb;Dj=1;var e=Object.prototype;function t(n){var c=n&&n.constructor,i=typeof c=="function"&&c.prototype||e;return n===i}return mb=t,mb}var fb,Bj;function Bye(){if(Bj)return fb;Bj=1;function e(t,n){return function(c){return t(n(c))}}return fb=e,fb}var gb,Rj;function Rye(){if(Rj)return gb;Rj=1;var e=Bye(),t=e(Object.keys,Object);return gb=t,gb}var vb,Fj;function Fye(){if(Fj)return vb;Fj=1;var e=Dye(),t=Rye(),n=Object.prototype,c=n.hasOwnProperty;function i(r){if(!e(r))return t(r);var s=[];for(var d in Object(r))c.call(r,d)&&d!="constructor"&&s.push(d);return s}return vb=i,vb}var Mb,Ej;function Eye(){if(Ej)return Mb;Ej=1;var e=jq(),t=zq();function n(c){return c!=null&&t(c.length)&&!e(c)}return Mb=n,Mb}var _b,Oj;function Oye(){if(Oj)return _b;Oj=1;var e=Hye(),t=Fye(),n=Eye();function c(i){return n(i)?e(i):t(i)}return _b=c,_b}var xb,Uj;function Uye(){if(Uj)return xb;Uj=1;var e=wye(),t=jye(),n=Oye();function c(i){return e(i,n,t)}return xb=c,xb}var Lb,Wj;function Wye(){if(Wj)return Lb;Wj=1;var e=Uye(),t=1,n=Object.prototype,c=n.hasOwnProperty;function i(r,s,d,l,h,u){var p=d&t,y=e(r),m=y.length,g=e(s),f=g.length;if(m!=f&&!p)return!1;for(var M=m;M--;){var _=y[M];if(!(p?_ in s:c.call(s,_)))return!1}var v=u.get(r),L=u.get(s);if(v&&L)return v==s&&L==r;var w=!0;u.set(r,s),u.set(s,r);for(var C=p;++M<m;){_=y[M];var b=r[_],x=s[_];if(l)var I=p?l(x,b,_,s,r,u):l(b,x,_,r,s,u);if(!(I===void 0?b===x||h(b,x,d,l,u):I)){w=!1;break}C||(C=_=="constructor")}if(w&&!C){var S=r.constructor,j=s.constructor;S!=j&&"constructor"in r&&"constructor"in s&&!(typeof S=="function"&&S instanceof S&&typeof j=="function"&&j instanceof j)&&(w=!1)}return u.delete(r),u.delete(s),w}return Lb=i,Lb}var Ib,Gj;function Gye(){if(Gj)return Ib;Gj=1;var e=c1(),t=vt(),n=e(t,"DataView");return Ib=n,Ib}var bb,Kj;function Kye(){if(Kj)return bb;Kj=1;var e=c1(),t=vt(),n=e(t,"Promise");return bb=n,bb}var wb,Zj;function Zye(){if(Zj)return wb;Zj=1;var e=c1(),t=vt(),n=e(t,"Set");return wb=n,wb}var Cb,Xj;function Xye(){if(Xj)return Cb;Xj=1;var e=c1(),t=vt(),n=e(t,"WeakMap");return Cb=n,Cb}var Nb,Yj;function Yye(){if(Yj)return Nb;Yj=1;var e=Gye(),t=Ww(),n=Kye(),c=Zye(),i=Xye(),r=xL(),s=Sq(),d="[object Map]",l="[object Object]",h="[object Promise]",u="[object Set]",p="[object WeakMap]",y="[object DataView]",m=s(e),g=s(t),f=s(n),M=s(c),_=s(i),v=r;return(e&&v(new e(new ArrayBuffer(1)))!=y||t&&v(new t)!=d||n&&v(n.resolve())!=h||c&&v(new c)!=u||i&&v(new i)!=p)&&(v=function(L){var w=r(L),C=w==l?L.constructor:void 0,b=C?s(C):"";if(b)switch(b){case m:return y;case g:return d;case f:return h;case M:return u;case _:return p}return w}),Nb=v,Nb}var jb,Jj;function Jye(){if(Jj)return jb;Jj=1;var e=kye(),t=qq(),n=Iye(),c=Wye(),i=Yye(),r=Gw(),s=Aq(),d=Vq(),l=1,h="[object Arguments]",u="[object Array]",p="[object Object]",y=Object.prototype,m=y.hasOwnProperty;function g(f,M,_,v,L,w){var C=r(f),b=r(M),x=C?u:i(f),I=b?u:i(M);x=x==h?p:x,I=I==h?p:I;var S=x==p,j=I==p,$=x==I;if($&&s(f)){if(!s(M))return!1;C=!0,S=!1}if($&&!S)return w||(w=new e),C||d(f)?t(f,M,_,v,L,w):n(f,M,x,_,v,L,w);if(!(_&l)){var q=S&&m.call(f,"__wrapped__"),H=j&&m.call(M,"__wrapped__");if(q||H){var D=q?f.value():f,z=H?M.value():M;return w||(w=new e),L(D,z,_,v,w)}}return $?(w||(w=new e),c(f,M,_,v,L,w)):!1}return jb=g,jb}var Sb,Qj;function Qye(){if(Qj)return Sb;Qj=1;var e=Jye(),t=bL();function n(c,i,r,s,d){return c===i?!0:c==null||i==null||!t(c)&&!t(i)?c!==c&&i!==i:e(c,i,r,s,n,d)}return Sb=n,Sb}var $b,eS;function e4e(){if(eS)return $b;eS=1;var e=Qye();function t(n,c){return e(n,c)}return $b=t,$b}var t4e=e4e();const a4e=a.getDefaultExportFromCjs(t4e),n4e=({schema:e,initialData:t={},onSubmit:n,submitLabel:c,submitIcon:i,submitIconPosition:r="left",onCancel:s,cancelLabel:d="Retour",cancelIcon:l})=>{const[h,u]=k.useState(t),[p,y]=k.useState({}),[m,g]=k.useState({}),[f,M]=k.useState(!1),_=k.useRef(t);k.useEffect(()=>{a4e(_.current,t)||(u(t),_.current=t)},[t]);const v=(I,S)=>{const j={...h,[I]:S};if(u(j),m[I]){const $=e.fields.find(q=>q.name===I);if($){const q=hL(S,$);y(H=>({...H,[I]:q.isValid?"":q.error}))}}},L=I=>{if(!m[I]){g(j=>({...j,[I]:!0}));const S=e.fields.find(j=>j.name===I);if(S){const j=hL(h[I],S);y($=>({...$,[I]:j.isValid?"":j.error}))}}},w=async I=>{I.preventDefault(),M(!0);const S=e.fields.reduce(($,q)=>(q.type!=="section"&&($[q.name]=!0),$),{});g(S);const j=mq(h,e.fields.filter($=>$.type!=="section"));if(y(j.errors),j.isValid)try{await n(h)}catch($){console.error("Erreur lors de la soumission:",$),y(q=>({...q,__global:"Une erreur est survenue lors de la soumission"}))}M(!1)},C=l?kt[l]:null,b=i&&kt[i]||e.submitIcon&&kt[e.submitIcon]||null,x=e.columns&&e.columns>0?Math.floor(e.columns):12;return o.jsxs("div",{className:le.formContainer,children:[o.jsx("div",{className:le.headerLine,children:o.jsx("h2",{className:le.formTitle,children:e.title})}),e.description&&o.jsx("p",{className:le.formDescription,children:e.description}),p.__global&&o.jsx("div",{className:`alert alert-danger ${le.globalError}`,children:p.__global}),o.jsxs("form",{onSubmit:w,children:[o.jsx("div",{className:le.gridContainer,style:{gridTemplateColumns:`repeat(${x}, minmax(0, 1fr))`},children:e.fields.map(I=>{if(I.type==="section")return o.jsxs("div",{className:le.sectionFull,children:[o.jsx("h5",{className:le.sectionTitle,children:I.label}),I.help&&o.jsx("p",{className:le.sectionHelp,children:I.help})]},I.name);const j={gridColumn:`span ${Math.max(1,Math.min(x,I.gridCol??x))}`};return o.jsxs("div",{className:le.fieldGridItem,style:j,children:[o.jsx(bq,{field:I,value:h[I.name],onChange:$=>v(I.name,$),onBlur:()=>L(I.name),error:p[I.name],touched:m[I.name]}),I.help&&o.jsx("small",{className:le.fieldHelp,children:I.help})]},I.name)})}),o.jsxs("div",{className:le.formFooter,children:[o.jsx("div",{className:le.footerLeft,children:s&&o.jsxs("button",{type:"button",className:le.cancelLink,onClick:s,children:[C&&o.jsx(C,{size:16,className:"me-2"})," ",d]})}),o.jsx("div",{className:le.footerRight,children:o.jsx(tL,{type:"submit",variant:"primary",size:"md",className:le.submitButton,disabled:f,children:f?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"spinner-border spinner-border-sm me-2",role:"status"}),"Validation..."]}):o.jsxs(o.Fragment,{children:[b&&(r==="left"||e.submitIconPosition==="left")&&o.jsx(b,{size:16,className:"me-2"}),c||e.submitText||"Valider",b&&(r==="right"||e.submitIconPosition==="right")&&o.jsx(b,{size:16,className:"ms-2"})]})})})]})]})]})};function o4e(e){return{title:e._formTitle||"Formulaire",description:e._formDescription,fields:e._fieldMetadata||[],submitText:e._submitText||"Valider"}}const c4e="_container_1gljv_85",i4e="_tableWrapper_1gljv_111",r4e="_tableControls_1gljv_117",s4e="_controlsRight_1gljv_128",d4e="_limitedRows_1gljv_151",l4e="_table_1gljv_111",h4e="_headerCell_1gljv_206",u4e="_headerContent_1gljv_220",p4e="_headerWords_1gljv_229",y4e="_headerWord_1gljv_229",k4e="_cellContent_1gljv_276",m4e="_alignLeft_1gljv_286",f4e="_alignCenter_1gljv_290",g4e="_alignRight_1gljv_294",v4e="_tableCell_1gljv_298",M4e="_tableRow_1gljv_308",_4e="_emptyRow_1gljv_385",x4e="_toggleFiltersButton_1gljv_393",L4e="_toggleSortButton_1gljv_394",I4e="_buttonTextCompact_1gljv_415",b4e="_uppercaseSmall_1gljv_450",w4e="_filtersPanel_1gljv_463",C4e="_filtersPanelInline_1gljv_481",N4e="_filtersPanelHorizontal_1gljv_492",j4e="_filtersRow_1gljv_492",S4e="_filtersActionsHorizontal_1gljv_525",$4e="_filterItemInline_1gljv_542",q4e="_filterLabel_1gljv_571",A4e="_filterInput_1gljv_576",z4e="_filterSelect_1gljv_577",V4e="_operatorSelect_1gljv_578",P4e="_operatorInput_1gljv_579",T4e="_activeFilterTag_1gljv_597",H4e="_actionsGroup_1gljv_609",D4e="_applyButton_1gljv_615",B4e="_cancelButton_1gljv_625",R4e="_columnSorterContainer_1gljv_649",F4e="_sorterControls_1gljv_654",E4e="_sortDropdownWrapper_1gljv_659",O4e="_sortDropdown_1gljv_659",U4e="_sortDropdownHeader_1gljv_679",W4e="_closeButton_1gljv_688",G4e="_sortDropdownContent_1gljv_703",K4e="_sortDropdownItem_1gljv_709",Z4e="_sortDirectionButtons_1gljv_734",X4e="_sortDirectionButton_1gljv_734",Y4e="_activeSort_1gljv_757",J4e="_sortActions_1gljv_764",Q4e="_paginationButton_1gljv_842",e5e="_pageSizeSelect_1gljv_844",t5e="_topPagination_1gljv_853",a5e="_paginationContainer_1gljv_861",n5e="_leftGroup_1gljv_874",o5e="_pageSizeControls_1gljv_882",c5e="_paginationInfo_1gljv_908",i5e="_paginationControls_1gljv_916",r5e="_disabledButton_1gljv_947",s5e="_activeButton_1gljv_952",d5e="_navigationButton_1gljv_962",l5e="_operatorFilterContainer_1gljv_1010",h5e="_rangeSeparator_1gljv_1016",u5e="_activeFiltersSection_1gljv_1179",p5e="_activeFiltersRow_1gljv_1184",y5e="_activeFiltersList_1gljv_1192",k5e="_clearAllButton_1gljv_1200",m5e="_removeFilterButton_1gljv_1221",f5e="_sortIndicator_1gljv_1272",g5e="_active_1gljv_349",v5e="_clearSortButton_1gljv_1371",M5e="_loaderSpinner_1gljv_2743",_5e="_loaderSpinnerSmall_1gljv_2755",x5e="_paginationLoading_1gljv_2772",L5e="_loadingButton_1gljv_2780",I5e="_loadingIndicator_1gljv_2791",V={container:c4e,tableWrapper:i4e,tableControls:r4e,controlsRight:s4e,limitedRows:d4e,table:l4e,headerCell:h4e,headerContent:u4e,headerWords:p4e,headerWord:y4e,cellContent:k4e,alignLeft:m4e,alignCenter:f4e,alignRight:g4e,tableCell:v4e,tableRow:M4e,emptyRow:_4e,toggleFiltersButton:x4e,toggleSortButton:L4e,buttonTextCompact:I4e,uppercaseSmall:b4e,filtersPanel:w4e,filtersPanelInline:C4e,filtersPanelHorizontal:N4e,filtersRow:j4e,filtersActionsHorizontal:S4e,filterItemInline:$4e,filterLabel:q4e,filterInput:A4e,filterSelect:z4e,operatorSelect:V4e,operatorInput:P4e,activeFilterTag:T4e,actionsGroup:H4e,applyButton:D4e,cancelButton:B4e,columnSorterContainer:R4e,sorterControls:F4e,sortDropdownWrapper:E4e,sortDropdown:O4e,sortDropdownHeader:U4e,closeButton:W4e,sortDropdownContent:G4e,sortDropdownItem:K4e,sortDirectionButtons:Z4e,sortDirectionButton:X4e,activeSort:Y4e,sortActions:J4e,paginationButton:Q4e,pageSizeSelect:e5e,topPagination:t5e,paginationContainer:a5e,leftGroup:n5e,pageSizeControls:o5e,paginationInfo:c5e,paginationControls:i5e,disabledButton:r5e,activeButton:s5e,navigationButton:d5e,operatorFilterContainer:l5e,rangeSeparator:h5e,activeFiltersSection:u5e,activeFiltersRow:p5e,activeFiltersList:y5e,clearAllButton:k5e,removeFilterButton:m5e,sortIndicator:f5e,active:g5e,clearSortButton:v5e,loaderSpinner:M5e,loaderSpinnerSmall:_5e,paginationLoading:x5e,loadingButton:L5e,loadingIndicator:I5e},b5e=({config:e,value:t,onChange:n,disabled:c})=>o.jsxs("select",{value:t===""?"":String(t),onChange:i=>n(i.target.value===""?"":i.target.value==="true"),disabled:c,className:V.filterSelect,children:[o.jsx("option",{value:"",children:`Filtrer ${e.label}...`}),o.jsx("option",{value:"true",children:"Oui"}),o.jsx("option",{value:"false",children:"Non"})]}),w5e=({config:e,value:t,onChange:n,disabled:c})=>o.jsx("input",{type:"date",value:t||"",onChange:i=>n(i.target.value),placeholder:`Filtrer ${e.label}...`,disabled:c,className:V.filterInput}),C5e=({config:e,value:t,onChange:n,disabled:c})=>{const[i,r]=k.useState([]);k.useEffect(()=>{(async()=>{if(e.asyncOptions)try{const l=await e.asyncOptions();r(l??[])}catch(l){console.error("Erreur chargement options MultiSelect:",l),r([])}else r(e.options??[])})()},[e]);const s=d=>{const l=Array.from(d.target.selectedOptions,h=>h.value);n(l)};return o.jsx("select",{multiple:!0,value:t.map(String),onChange:s,disabled:c,className:V.filterMultiSelect,children:i.map((d,l)=>o.jsx("option",{value:String(d.value),children:d.label},l))})},tS=({config:e,value:t,onChange:n,disabled:c})=>{const[i,r]=k.useState(t||""),s=d=>{const l=d.target.value===""?"":Number(d.target.value);r(l),n(l)};return o.jsx("input",{type:"number",value:i,onChange:s,placeholder:e.placeholder||`Filtrer ${e.label}...`,disabled:c,className:V.filterInput})},N5e=({config:e,value:t,onChange:n,disabled:c=!1})=>{const[i,r]=k.useState([]),[s,d]=k.useState(!1);k.useEffect(()=>{(async()=>{if(e.asyncOptions){d(!0);try{const u=await e.asyncOptions();r(u)}catch(u){console.error("Error loading options:",u)}finally{d(!1)}}else r(e.options||[])})()},[e]);const l=h=>{const u=h.target.value;n(u)};return s?o.jsx("div",{children:"Chargement..."}):o.jsxs("select",{value:String(t||""),onChange:l,disabled:c,className:V.filterInput,children:[o.jsx("option",{value:"",children:"Select..."}),i.map(h=>o.jsx("option",{value:h.value,children:h.label},h.value))]})},j5e=({config:e,value:t,onChange:n,disabled:c=!1})=>{const[i,r]=k.useState("");k.useEffect(()=>{r(typeof t=="string"?t:String(t||""))},[t]);const s=d=>{const l=d.target.value;r(l),n(l)};return o.jsx("input",{type:"text",value:i,onChange:s,placeholder:e.placeholder||`Filtrer ${e.label}...`,disabled:c,className:V.filterInput})},S5e=({config:e,value:t,onChange:n,disabled:c=!1})=>{const[i,r]=k.useState(t?.operator||""),[s,d]=k.useState(t?.value||"");k.useEffect(()=>{i&&s&&n({operator:i,value:s})},[i,s,n]);const l=u=>{r(u.target.value)},h=u=>{d(u.target.value)};return o.jsxs("div",{className:V.operatorFilterContainer,children:[o.jsxs("select",{value:i,onChange:l,disabled:c,className:V.operatorSelect,children:[o.jsx("option",{value:"",children:"Sélectionner un opérateur"}),e.operators.map(u=>o.jsx("option",{value:String(u.value),children:u.label},String(u.value)))]}),o.jsx("input",{type:"text",value:s,onChange:h,placeholder:"Valeur",disabled:c||!i,className:V.operatorInput})]})},$5e=({value:e,onChange:t,disabled:n})=>{const c=e||{},i=s=>{t({...c,start:s.target.value})},r=s=>{t({...c,end:s.target.value})};return o.jsxs("div",{className:V.dateRangeContainer,children:[o.jsx("input",{type:"date",value:c.start||"",onChange:i,disabled:n,className:V.filterInput}),o.jsx("span",{className:V.rangeSeparator,children:"→"}),o.jsx("input",{type:"date",value:c.end||"",onChange:r,disabled:n,className:V.filterInput})]})},q5e=({config:e,value:t,onChange:n,disabled:c})=>{switch(e.type){case"text":case"search":return o.jsx(j5e,{config:e,value:t,onChange:n,disabled:c});case"number":return o.jsx(tS,{config:e,value:t,onChange:n,disabled:c});case"range":return o.jsx(tS,{config:e,value:t,onChange:n,disabled:c});case"select":return o.jsx(N5e,{config:e,value:t,onChange:n,disabled:c});case"operator":return o.jsx(S5e,{config:e,value:t,onChange:n,disabled:c});case"multiselect":return o.jsx(C5e,{config:e,value:t,onChange:n,disabled:c});case"date":return o.jsx(w5e,{config:e,value:t,onChange:n,disabled:c});case"daterange":return o.jsx($5e,{config:e,value:t??{start:"",end:""},onChange:n,disabled:c});case"boolean":return o.jsx(b5e,{config:e,value:t,onChange:n,disabled:c});default:return o.jsxs("div",{children:["Type de filtre non supporté: ",e.type]})}},Pq=({filters:e,externalFilters:t=[],onFiltersChange:n,onApply:c,isControlled:i=!1})=>{const[r,s]=k.useState([]),[d,l]=k.useState(()=>{const g={};return e.forEach(f=>{f.type==="daterange"?g[f.id]={start:"",end:""}:g[f.id]=f.defaultValue??""}),g});k.useEffect(()=>{if(!i)return;const g={...d??{}};e.forEach(f=>{f.id in g||(g[f.id]=f.type==="daterange"?{start:"",end:""}:f.defaultValue??"")}),(t||[]).forEach(f=>{!f||!f.id||(g[f.id]=f.value)}),l(g),s(t??[])},[i,JSON.stringify(t||[]),JSON.stringify(e.map(g=>g.id))]);const h=i?t:r,u=k.useCallback((g,f)=>{l(M=>({...M,[g]:f}))},[]),p=k.useCallback(async()=>{const g=[],f={...d};for(const[M,_]of Object.entries(f)){const v=e.find(C=>C.id===M);if(!v)continue;let L=_;try{typeof _=="function"&&(L=await _(f)),typeof v.executeOnApply=="function"&&(L=await v.executeOnApply(L,f))}catch{continue}if(v.type==="daterange"){const C=L?.start??"",b=L?.end??"",x=typeof C=="string"?C.trim()==="":!C,I=typeof b=="string"?b.trim()==="":!b;if(x&&I)continue}L==null||typeof L=="string"&&L.trim()===""||Array.isArray(L)&&L.length===0||typeof L=="object"&&!Array.isArray(L)&&Object.keys(L).length===0||g.push({id:M,type:v.type,value:L,label:v.label})}return i?n?.(g):(s(g),c?.(g)),g},[d,e,i,n,c]),y=k.useCallback(g=>{l(f=>({...f,[g]:void 0})),u(g,void 0)},[u]),m=k.useCallback(()=>{const g={};e.forEach(f=>{f.type==="daterange"?g[f.id]={start:"",end:""}:g[f.id]=f.defaultValue??""}),l(g),i?n?.([]):(s([]),c?.([]))},[e,i,n,c]);return{appliedFilters:h,tempFilters:d,updateFilter:u,applyFilters:p,clearFilter:y,clearAllFilters:m}},A5e=(e,t)=>{if(e==null)return!1;const n=t.value;if(n==null)return!1;switch(t.type){case"text":case"search":return String(e).toLowerCase().includes(String(n).toLowerCase());case"number":case"range":return Number(e)===Number(n);case"select":case"multiselect":return Array.isArray(n)?n.includes(e)||n.map(c=>String(c)).includes(String(e)):String(e)===String(n);case"boolean":return!!e==!!n;case"date":return new Date(e).getTime()===new Date(String(n)).getTime();case"daterange":try{if(!n||typeof n!="object")return!1;const c=n;if(!c.start||!c.end)return!1;const i=c.start,r=c.end;if(typeof i!="string"||typeof r!="string"||!i.trim()||!r.trim())return!1;const s=new Date(e).getTime(),d=new Date(i).getTime(),l=new Date(r).getTime();return isNaN(s)||isNaN(d)||isNaN(l)?!1:s>=d&&s<=l}catch(c){return console.error("Error processing daterange filter:",c),!1}case"operator":if(typeof n=="object"&&n!==null){const c=n;if(!("operator"in c)||!("value"in c))return!1;const{operator:i,value:r}=c,s=Number(e),d=Number(r);if(isNaN(s)||isNaN(d))return String(e).includes(String(r));switch(i){case"equals":return s===d;case"gt":return s>d;case"lt":return s<d;case"gte":return s>=d;case"lte":return s<=d;default:return String(e).includes(String(r))}}return!1;default:return String(e).toLowerCase().includes(String(n).toLowerCase())}};function Tq(e,t,n="",c={key:null,direction:"asc"},i=1,r=10,s=[]){const d=Math.max(1,r),l=(n||"").trim().toLowerCase(),h=k.useMemo(()=>{let f=e;return l&&(f=f.filter(M=>t.some(_=>{const v=M.data[_.id];return v==null?!1:String(v).toLowerCase().includes(l)}))),s.length>0&&(f=f.filter(M=>s.every(_=>{try{const v=M.data[_.id];return A5e(v,_)}catch(v){return console.error("Error applying filter:",v),!1}}))),f},[e,t,l,s]),u=k.useMemo(()=>{if(!c?.key)return h;const f=c.key;return[...h].sort((M,_)=>{const v=M.data[f],L=_.data[f];if(v==null)return 1;if(L==null)return-1;if(typeof v=="number"&&typeof L=="number")return c.direction==="desc"?L-v:v-L;if(v instanceof Date&&L instanceof Date){const C=v.getTime()-L.getTime();return c.direction==="desc"?-C:C}const w=String(v).localeCompare(String(L),void 0,{numeric:!0,sensitivity:"base"});return c.direction==="desc"?-w:w})},[h,c]),p=u,y=Math.ceil(u.length/d),m=0,g=Math.min(i*d,u.length);return{paginatedData:p,sortedData:u,filteredData:h,totalPages:y,startIndex:m,endIndex:g}}const Hq=({value:e})=>e,Dq=({value:e})=>k.createElement("a",{href:`mailto:${e}`,className:"email-link"},e),Bq=({value:e})=>k.createElement("a",{href:String(e),target:"_blank",rel:"noopener noreferrer",className:"text-link"},e),Rq=({value:e})=>{if(!e)return null;const t={success:"success-badge",warning:"warning-badge",error:"error-badge",info:"info-badge",default:"default-badge"},n=typeof e=="object"?e.type:"default",c=typeof e=="object"?e.text:e,i=t[n]||t.default;return k.createElement("span",{className:`badge ${i}`},c)},Fq=({value:e})=>{try{return new Date(e).toLocaleDateString()}catch{return String(e)}},Eq=({value:e})=>k.createElement("span",{className:"number-value"},Number(e).toLocaleString()),Oq=({value:e})=>k.createElement("span",{className:"currency-value"},new Intl.NumberFormat("fr-FR",{style:"currency",currency:"EUR"}).format(Number(e))),Uq=({value:e})=>k.createElement("div",{className:"image-container"},k.createElement("img",{src:e,alt:"Table content",className:"table-image",onError:t=>t.currentTarget.style.display="none"})),rw={renderers:{text:Hq,email:Dq,link:Bq,badge:Rq,date:Fq,number:Eq,currency:Oq,image:Uq},icons:{sortAsc:k.createElement(Nc,{className:"sort-icon active",size:14}),sortDesc:k.createElement(qt,{className:"sort-icon active",size:14}),sortDefault:k.createElement(Kc,{className:"sort-icon",size:14})}},z5e=(e,t)=>{rw.renderers[e]&&console.warn(`Le renderer "${e}" existe déjà et sera écrasé.`),rw.renderers[e]=t},V5e=({filters:e,externalFilters:t=[],onFiltersChange:n,onApply:c,isControlled:i=!1,debounceTimeout:r=300,expanded:s,onToggle:d,panelPlacement:l="top",onPanelHeightChange:h,label:u="Advanced-Filters",applyLabel:p="Apply",cancelLabel:y="Cancel",clearLabel:m="Clear",applyDisabled:g=!1,loading:f=!1})=>{const[M,_]=k.useState(!1),v=typeof s=="boolean"?s:M,{appliedFilters:L,tempFilters:w,updateFilter:C,applyFilters:b,clearAllFilters:x}=Pq({filters:e,externalFilters:t,onFiltersChange:n,onApply:c,isControlled:i}),I=k.useRef(null),S=k.useRef(null);k.useEffect(()=>{if(v&&I.current){const z=I.current.getBoundingClientRect().height;h?.(z)}else h?.(0)},[v,e,w,h]);const j=()=>{typeof s=="boolean"?d?.(!s):_(z=>{const N=!z;return d?.(N),N})},$=()=>e.map(z=>{const N=w?.[z.id];return N==null||typeof N=="string"&&N.trim()===""?null:{id:z.id,label:z.label,value:N}}).filter(Boolean),q=async()=>{let z;try{z=await b()}catch{z=void 0}let N=[];z&&Array.isArray(z)&&z.length>0?N=z:L&&L.length>0?N=L:N=$(),n?.(N),c?.(N)},H=()=>{d?.(!1),typeof s!="boolean"&&_(!1)},D=()=>{x(),n?.([]),c?.([])};return k.useEffect(()=>{const z=A=>{v&&S.current&&(S.current.contains(A.target)||(d?.(!1),typeof s!="boolean"&&_(!1)))},N=A=>{A.key==="Escape"&&v&&(d?.(!1),typeof s!="boolean"&&_(!1))};return v&&(document.addEventListener("pointerdown",z),document.addEventListener("keydown",N)),()=>{document.removeEventListener("pointerdown",z),document.removeEventListener("keydown",N)}},[v,s,d]),o.jsxs("div",{className:V.advancedFiltersContainer,ref:S,children:[o.jsxs("button",{className:`${V.toggleFiltersButton} ${L.length>0?V.active:""} ${v?V.toggleFiltersButtonOpen:""} ${f?V.loadingButton:""}`,onClick:j,"aria-expanded":v,"aria-controls":"advanced-filters-panel",type:"button",disabled:f,children:[f?o.jsx("span",{className:V.loaderSpinnerSmall}):o.jsx(wt,{size:14}),o.jsx("span",{className:V.buttonTextCompact,children:u}),L.length>0&&!f&&o.jsx("span",{className:V.filterCountBadge,"aria-hidden":!0,children:L.length}),f&&o.jsx("span",{className:V.loadingIndicator,"aria-hidden":!0,children:"Chargement..."})]}),v&&o.jsxs("div",{id:"advanced-filters-panel",ref:I,className:`${V.filtersPanel} ${l==="top"?`${V.filtersPanelInline} ${V.filtersPanelHorizontal}`:""}`,role:"region","aria-label":"Panneau de filtres avancés",children:[o.jsx("div",{className:V.filtersRow,children:e.map(z=>o.jsxs("div",{className:`${V.filterItem} ${V.filterItemInline}`,children:[o.jsxs("label",{className:V.filterLabel,children:[z.label,z.required&&o.jsx("span",{className:V.required,children:"*"})]}),o.jsx(q5e,{config:z,value:w[z.id],onChange:N=>C(z.id,N),disabled:z.disabled})]},z.id))}),o.jsxs("div",{className:V.filtersActionsHorizontal,children:[o.jsx("div",{className:V.activeFiltersSection,children:L.length>0&&o.jsxs("div",{className:V.activeFiltersRow,children:[o.jsx("span",{className:V.activeLabelCompact,children:"Actifs :"}),o.jsx("div",{className:V.activeFiltersList,children:L.map(z=>o.jsxs("div",{className:V.activeFilterTag,children:[z.label??z.id,o.jsx("button",{className:V.removeFilterButton,onClick:()=>C(z.id,void 0),"aria-label":`Supprimer ${z.id}`,type:"button",children:"×"})]},z.id))}),o.jsxs("button",{className:V.clearAllButton,onClick:D,type:"button",children:[o.jsx(Ge,{size:12})," ",m]})]})}),o.jsxs("div",{className:V.actionsGroup,children:[o.jsx("button",{className:V.cancelButton,onClick:H,type:"button",disabled:f,children:y}),o.jsx("button",{className:`${V.applyButton} ${f?V.loadingButton:""}`,onClick:q,type:"button",disabled:g||f,"aria-disabled":g||f,children:f?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:V.loaderSpinnerSmall}),o.jsx("span",{children:"Chargement..."})]}):p})]})]})]})]})},aS=e=>{const t=e.replace(/[^A-Za-zÀ-ÖØ-öø-ÿ]/g,"");return t.length>0&&t===t.toUpperCase()},P5e=({columns:e,sortConfig:t,onSort:n,label:c="Sort",loading:i=!1})=>{const[r,s]=k.useState(!1),d=e.filter(g=>g.sortable),l=k.useRef(null),h=t?.key!==null&&t?.key!==void 0,u=(g,f)=>{n({key:g,direction:f}),s(!1)},p=()=>{n({key:null,direction:"asc"}),s(!1)},y=()=>s(g=>!g),m=()=>{s(!1)};return k.useEffect(()=>{if(!r)return;const g=M=>{if(!l.current)return;const _=M.target;_&&!l.current.contains(_)&&s(!1)},f=M=>{M.key==="Escape"&&s(!1)};return document.addEventListener("pointerdown",g),document.addEventListener("keydown",f),()=>{document.removeEventListener("pointerdown",g),document.removeEventListener("keydown",f)}},[r]),k.useEffect(()=>{const g=document.querySelector("[data-table-wrapper]");if(!g)return;const f=g.style.overflow??"";return r?g.style.overflow="hidden":g.style.overflow=f,()=>{g.style.overflow=f}},[r]),o.jsx("div",{className:V.columnSorterContainer,ref:l,children:o.jsx("div",{className:V.sorterControls,children:d.length>0&&o.jsxs("div",{className:V.sortDropdownWrapper,ref:l,children:[o.jsxs("button",{className:`${V.toggleSortButton} ${r?V.toggleSortButtonOpen:""} ${h?V.active:""} ${i?V.loadingButton:""}`,onClick:y,"aria-expanded":r,"aria-haspopup":"true",type:"button",disabled:i,children:[i?o.jsx("span",{className:V.loaderSpinnerSmall}):o.jsx(Kc,{size:14}),o.jsx("span",{className:`${V.buttonTextCompact} ${aS(c)?V.uppercaseSmall:""}`,children:c}),h&&!i&&o.jsx("div",{className:V.sortIndicator,children:t?.direction==="asc"?o.jsx(Nc,{size:12}):o.jsx(qt,{size:12})})]}),r&&o.jsxs("div",{className:`${V.sortDropdown} ${V.sortDropdownInline}`,role:"menu",children:[o.jsxs("div",{className:V.sortDropdownHeader,children:[o.jsx("span",{children:"Trier par:"}),o.jsx("button",{className:V.closeButton,onClick:m,"aria-label":"Fermer",type:"button",children:o.jsx(Ge,{size:16})})]}),o.jsx("div",{className:V.sortDropdownContent,children:d.map(g=>{const f=String(g.label??g.id),M=aS(f);return o.jsxs("div",{className:V.sortDropdownItem,role:"menuitem",tabIndex:0,onKeyDown:_=>{_.key==="Enter"&&u(g.id,"asc")},children:[o.jsx("span",{className:`${V.columnSorterLabel} ${M?V.uppercaseSmall:""}`,title:f,"aria-label":f,children:f}),o.jsxs("div",{className:V.sortDirectionButtons,children:[o.jsx("button",{className:`${V.sortDirectionButton} ${t?.key===g.id&&t?.direction==="asc"?V.activeSort:""}`,onClick:()=>u(g.id,"asc"),title:"Trier par ordre croissant",type:"button",children:o.jsx(Nc,{size:12})}),o.jsx("button",{className:`${V.sortDirectionButton} ${t?.key===g.id&&t?.direction==="desc"?V.activeSort:""}`,onClick:()=>u(g.id,"desc"),title:"Trier par ordre décroissant",type:"button",children:o.jsx(qt,{size:12})})]})]},g.id)})}),h&&o.jsx("div",{className:V.sortActions,children:o.jsxs("button",{className:V.clearSortButton,onClick:p,type:"button",children:[o.jsx(bt,{size:14}),o.jsx("span",{children:"Annuler le tri"})]})})]})]})})})},T5e=({currentPage:e,totalPages:t,pageSize:n,totalItems:c,itemLabel:i="items",onPageChange:r,onPageSizeChange:s,loading:d=!1})=>{const l=Math.max(1,Math.floor(t)),h=Math.min(Math.max(1,Math.floor(e)),l),u=()=>{h>1&&r(h-1)},p=()=>{if(h<t){const f=h+1;r(f)}},y=c>0?(h-1)*n+1:0,m=c>0?Math.min(h*n,c):0,g=()=>{const f=[];let _=Math.max(1,h-Math.floor(2.5)),v=_+5-1;v>l&&(v=l,_=Math.max(1,v-5+1));for(let L=_;L<=v;L++)f.push(L);return f};return o.jsxs("div",{className:V.paginationContainer,role:"navigation","aria-label":"Pagination",children:[o.jsx("div",{className:V.leftGroup,children:s&&o.jsx("div",{className:V.pageSizeControls,children:o.jsx("select",{value:n,onChange:f=>s(Number(f.target.value)),className:V.pageSizeSelect,"aria-label":"Taille de page",disabled:d,children:[10,20,30].map(f=>o.jsx("option",{value:f,children:f},f))})})}),o.jsx("div",{className:V.paginationInfo,"aria-live":"polite",children:d?o.jsxs("span",{className:V.paginationLoading,children:[o.jsx("span",{className:V.loaderSpinner}),o.jsx("span",{children:"Chargement..."})]}):`${y}-${m} ${i}`}),o.jsxs("div",{className:V.paginationControls,children:[o.jsx("button",{onClick:u,disabled:h===1||d,className:`${V.paginationButton} ${V.navigationButton} ${h===1?V.disabledButton:""} ${d?V.loadingButton:""}`,"aria-label":"Page précédente",children:d&&h>1?o.jsx("span",{className:V.loaderSpinnerSmall}):"«"}),g().map(f=>o.jsx("button",{onClick:()=>r(f),disabled:d,"aria-current":h===f?"page":void 0,className:`${V.paginationButton} ${h===f?V.activeButton:""} ${d?V.loadingButton:""}`,children:d&&h===f?o.jsx("span",{className:V.loaderSpinnerSmall}):f},f)),o.jsx("button",{onClick:p,disabled:d||h>=l,className:`${V.paginationButton} ${V.navigationButton} ${d?V.loadingButton:""} ${h>=l?V.disabledButton:""}`,"aria-label":"Page suivante",children:d?o.jsx("span",{className:V.loaderSpinnerSmall}):"»"})]})]})},H5e=(e,t)=>{if(!e)return"";if(t)return e;const n=String(e).trim();if(!n)return n;const c=n.toLowerCase();return c.charAt(0).toUpperCase()+c.slice(1)},D5e=e=>{if(!e)return!1;const t=e.trim().split(/\s+/);return e.length>18||t.length>2},B5e=({columns:e})=>o.jsx("thead",{className:V.tableHeader,children:o.jsx("tr",{children:e.map((t,n)=>{const c=t.align==="right"?V.alignRight:t.align==="left"?V.alignLeft:V.alignCenter,i=t.preserveHeaderCase===!0,r=H5e(String(t.label??""),i),s=D5e(r),d=s?r.split(/\s+/):[];return o.jsx("th",{className:`${V.headerCell} ${c}`,style:{width:t.width??void 0},"data-preserve":i?"true":"false",title:t.a11yConfig?.mode==="guide"?t.a11yConfig.description:t.a11yConfig?.mode==="key"?t.a11yConfig.key:void 0,children:o.jsx("div",{className:V.headerContent,children:s?o.jsx("div",{className:V.headerWords,children:d.map((l,h)=>o.jsx("span",{className:V.headerWord,children:l},h))}):o.jsx("span",{children:r})})},t.id??`col-${n}`)})})}),R5e=({value:e,row:t,column:n})=>{const c=n.align==="right"?V.alignRight:n.align==="left"?V.alignLeft:V.alignCenter,i=typeof n.render=="function"?n.render(e,t):e==null?"":String(e);return o.jsx("td",{className:`${V.tableCell} ${c}`,style:{width:n.width??void 0},children:o.jsx("div",{className:V.cellContent,children:i})})},F5e=({row:e,rowId:t,columns:n,onRowClick:c,index:i,getRowStyle:r})=>{const s=r?r(e):{},{backgroundColor:d,accentColor:l,...h}=s||{},u={backgroundColor:d,...h,"--row-accent":l??"transparent"};return o.jsx("tr",{className:`${V.tableRow} ${c?V.clickableRow:""}`,onClick:()=>c?.(e,i),style:u,children:n.map(p=>o.jsx(R5e,{value:e[p.id],row:e,column:p},`${t}-${p.id}`))})},E5e=({data:e,columns:t,onRowClick:n,startIndex:c,searchTerm:i,getRowStyle:r})=>e.length===0?o.jsx("tbody",{children:o.jsx("tr",{children:o.jsx("td",{colSpan:t.length,className:V.emptyRow,children:i?"Aucun résultat trouvé":"Aucune donnée disponible"})})}):o.jsx("tbody",{children:e.map((s,d)=>o.jsx(F5e,{row:s.data,rowId:s.id,columns:t,onRowClick:n,index:c+d-1,getRowStyle:r},s.id))}),Wq=({columns:e=[],data:t=[],pagination:n={pageSize:10,currentPage:1},onRowClick:c,searchTerm:i="",className:r="",filterConfig:s=[],externalFilters:d=[],onFiltersChange:l,onApplyFilters:h,onSort:u,filtersControlled:p=!1,debounceTimeout:y=300,getRowStyle:m,background:g,onPageSizeChange:f,onPageChange:M,itemLabel:_="items",advancedFiltersLabel:v="Advanced-Filters",advancedFiltersActiveLabel:L,sortLabel:w="Sort",applyLabel:C="Apply",cancelLabel:b="Cancel",clearLabel:x="Clear",applyDisabled:I=!1,paginationLoading:S=!1,filtersLoading:j=!1,sortLoading:$=!1,totalCount:q=null})=>{const[H,D]=k.useState({key:null,direction:"asc"}),[z,N]=k.useState(n.currentPage??1),[A,R]=k.useState(n.pageSize??10),[P,T]=k.useState(!1),E=k.useRef(null),[X,ae]=k.useState([]),J=p?d:X,Ie=p?[]:X;k.useEffect(()=>{const ne=n.currentPage??1,zc=n.pageSize??10;ne!==z&&N(ne),zc!==A&&R(zc)},[n.currentPage,n.pageSize]);const{paginatedData:me,sortedData:$e,totalPages:se,startIndex:F}=Tq(t,e,i,H,z,A,Ie),ee=$e.length,re=typeof q=="number"&&q>=0?q:ee;let oe=se;typeof q=="number"&&q>=0&&(oe=Math.max(1,Math.ceil(q/A)));const ke=ee>10;k.useEffect(()=>{const ne=Math.max(1,Math.floor(oe));z>ne&&N(ne),z<1&&N(1)},[oe]);const Le=ne=>{p||ae(ne),l?.(ne),N(1),M?.(1)},ve=ne=>{p||ae(ne),h?.(ne),N(1),M?.(1),E.current&&E.current.style.setProperty("--filters-panel-height","0px")},qe=ne=>{M?.(ne),N(ne)},je=ne=>{R(ne),N(1),f?.(ne),M?.(1)},ue=ne=>{E.current&&E.current.style.setProperty("--filters-panel-height",`${Math.round(ne)}px`)},be=ne=>{D(ne),u?.(ne)},Mt=ne=>{T(ne),!ne&&E.current&&E.current.style.setProperty("--filters-panel-height","0px")};k.useEffect(()=>{(J?.length??0)>0&&T(!0)},[J]),k.useEffect(()=>{s.length>0&&J.length>0&&T(!0)},[s.length,J.length]);const Ac=(J?.length??0)>0&&L?L:v;return o.jsxs("div",{ref:E,className:`${V.container} ${r} ${P?V.filtersOpen:""}`,style:{background:g,"--row-height":"48px","--header-height":"56px"},children:[o.jsx("div",{className:V.tableControls,children:o.jsxs("div",{className:V.controlsRight,children:[o.jsx(P5e,{columns:e,onSort:be,label:w,sortConfig:H,loading:$}),s.length>0&&o.jsx(V5e,{filters:s,externalFilters:J,onFiltersChange:Le,onApply:ve,isControlled:p,debounceTimeout:y,expanded:P,onToggle:Mt,panelPlacement:"top",onPanelHeightChange:ue,label:Ac,applyLabel:C,cancelLabel:b,clearLabel:x,applyDisabled:I,loading:j})]})}),o.jsx("div",{className:V.topPagination,children:o.jsx(T5e,{currentPage:z,totalPages:oe,pageSize:A,totalItems:re,itemLabel:_,onPageChange:qe,onPageSizeChange:je,loading:S})}),o.jsx("div",{className:`${V.tableWrapper} ${ke?V.limitedRows:""}`,"data-table-wrapper":!0,children:o.jsxs("table",{className:V.table,children:[o.jsx(B5e,{columns:e}),o.jsx(E5e,{data:me,columns:e,onRowClick:c,startIndex:F,getRowStyle:m,searchTerm:i})]})})]})};function O5e(e){const{pagination:t,totalCount:n,onPageChange:c,...i}=e,r=t?.pageSize??20,s=t?.currentPage??1,d=k.useMemo(()=>{if(n===null||typeof n>"u")return null;const p=Number(n);if(!Number.isFinite(p)||p<=0)return 1;const y=Number(r);return!Number.isFinite(y)||y<=0?1:Math.max(1,Math.ceil(p/y))},[n,r]),l=s>1,h=d===null?!1:s<d,u=p=>{typeof p=="number"&&(p<1||p<s&&!l||p>s&&!h||c?.(p))};return o.jsx(Wq,{...i,pagination:{pageSize:r,currentPage:s},totalCount:n,onPageChange:u})}const U5e="_mpRoot_31595_1",W5e="_mpHeader_31595_22",G5e="_mpTitle_31595_31",K5e="_mpList_31595_35",Z5e="_mpVertical_31595_41",X5e="_mpHorizontal_31595_46",Y5e="_mpItem_31595_55",J5e="_mpClickable_31595_95",Q5e="_mpLeft_31595_117",eke="_mpIcon_31595_125",tke="_mpMeta_31595_140",ake="_mpLabel_31595_145",nke="_mpDate_31595_154",oke="_mpRight_31595_160",cke="_mpValue_31595_168",ike="_mpHint_31595_176",rke="_mpBadge_31595_180",ske="_mpBadgeTop_31595_199",dke="_mpBadgeSub_31595_206",lke="_mpBadgeSmall_31595_213",hke="_mpPill_31595_229",uke="_mpRounded_31595_232",pke="_mpCompact_31595_236",yke="_compactItemWrapper_31595_252",kke="_mpSummaryRoot_31595_265",mke="_mpSummaryInner_31595_269",fke="_mpSummaryFlex_31595_284",gke="_mpSummaryCardWrapperHorizontal_31595_292",vke="_mpSummaryCardWrapper_31595_292",Mke="_mpSummaryCardHorizontal_31595_303",_ke="_mpSummaryCard_31595_292",xke="_mpSummaryValue_31595_321",Lke="_mpSummaryLabel_31595_327",Ike="_mpSummaryBadge_31595_338",bke="_mpSummaryBadgeSub_31595_357",wke="_mpEmpty_31595_365",Cke="_mpSummaryVertical_31595_372",Nke="_mpIconSquare_31595_380",W={mpRoot:U5e,mpHeader:W5e,mpTitle:G5e,mpList:K5e,mpVertical:Z5e,mpHorizontal:X5e,mpItem:Y5e,mpClickable:J5e,mpLeft:Q5e,mpIcon:eke,mpMeta:tke,mpLabel:ake,mpDate:nke,mpRight:oke,mpValue:cke,mpHint:ike,mpBadge:rke,mpBadgeTop:ske,mpBadgeSub:dke,mpBadgeSmall:lke,mpPill:hke,mpRounded:uke,mpCompact:pke,compactItemWrapper:yke,mpSummaryRoot:kke,mpSummaryInner:mke,mpSummaryFlex:fke,mpSummaryCardWrapperHorizontal:gke,mpSummaryCardWrapper:vke,mpSummaryCardHorizontal:Mke,mpSummaryCard:_ke,mpSummaryValue:xke,mpSummaryLabel:Lke,mpSummaryBadge:Ike,mpSummaryBadgeSub:bke,mpEmpty:wke,mpSummaryVertical:Cke,mpIconSquare:Nke},$t=(e,t=1)=>{if(!e||typeof e!="string")return`rgba(124, 58, 237, ${t})`;const n=e.trim();if(n.toLowerCase()==="transparent")return"rgba(0,0,0,0)";if(/^rgba?\(/i.test(n))return/^rgba\(/i.test(n)?n.replace(/rgba\(([^)]+),\s*([0-9.]+)\s*\)$/,(d,l)=>`rgba(${l.split(",").map(u=>u.trim()).slice(0,3).join(", ")}, ${t})`):n;let c=n.replace("#","").toLowerCase();if(c.length===3&&(c=c.split("").map(d=>d+d).join("")),!/^[0-9a-f]{6}$/i.test(c))return`rgba(124, 58, 237, ${t})`;const i=parseInt(c.slice(0,2),16),r=parseInt(c.slice(2,4),16),s=parseInt(c.slice(4,6),16);return`rgba(${i}, ${r}, ${s}, ${t})`},jke=({item:e,shape:t,onItemClick:n,color:c,renderItem:i})=>{const r=k.useCallback(()=>{n?.(e)},[n,e]),s=[W.mpItem,t==="pill"?W.mpPill:W.mpRounded,n?W.mpClickable:""].filter(Boolean).join(" ");if(i)return o.jsx("div",{className:s,role:n?"button":"group",tabIndex:n?0:-1,onClick:r,onKeyDown:y=>{n&&(y.key==="Enter"||y.key===" ")&&(n(e),y.preventDefault())},"aria-label":n?`Voir les détails de ${e.label}`:void 0,children:i(e)});const d=n?"button":"div",l=n?{onClick:r,className:s,type:"button","aria-label":`Voir les détails de ${e.label}`}:{className:s,role:"group"},h=e.iconComponent,u=e.iconSquareBg,p=e.iconColor;return o.jsxs(d,{...l,children:[o.jsxs("div",{className:W.mpLeft,children:[h?o.jsx("div",{className:W.mpIconSquare,style:{background:u??$t(p??c??"#7c3aed",1),border:`1px solid ${$t(p??c??"#7c3aed",.18)}`,color:p??"#ffffff"},children:k.createElement(h,{size:20,color:p??"#fff",strokeWidth:1.8})}):e.icon?o.jsx("div",{className:W.mpIcon,children:e.icon}):null,o.jsxs("div",{className:W.mpMeta,children:[o.jsx("div",{className:W.mpLabel,children:e.label}),e.subLabel&&o.jsx("div",{className:W.mpDate,children:e.subLabel}),e.date&&o.jsx("div",{className:W.mpDate,children:e.date})]})]}),o.jsxs("div",{className:W.mpRight,children:[o.jsx("div",{className:W.mpValue,style:{color:e.valueColor??c??void 0},children:e.value}),e.badge?o.jsxs("div",{className:[W.mpBadge,e.badge.small?W.mpBadgeSmall:""].join(" "),style:{backgroundColor:e.badge.bg??$t(e.badge.color||c||"#7c3aed",.12),borderColor:e.badge.bg?"transparent":$t(e.badge.color||c||"#7c3aed",.18),color:e.badge.color??e.badge.textColor??"#0f172a",fontWeight:600},children:[o.jsx("div",{className:W.mpBadgeTop,children:e.badge.text}),e.badge.subText&&o.jsx("div",{className:W.mpBadgeSub,children:e.badge.subText})]}):e.hint?o.jsx("div",{className:W.mpHint,children:e.hint}):null]})]})},Ske=k.memo(jke),nS=({title:e,right:t})=>!e&&!t?null:o.jsxs("div",{className:W.mpHeader,children:[o.jsx("div",{className:W.mpTitle,children:e}),o.jsx("div",{children:t})]}),oS=(e,t=1)=>{try{return $t(e,t)}catch{return`rgba(124, 58, 237, ${t})`}},$ke=({item:e})=>o.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:14,borderRadius:12,minHeight:88,boxSizing:"border-box",background:e.bgColor??"transparent",border:`1px solid ${e.borderColor??"transparent"}`,boxShadow:"0 4px 10px rgba(15,23,42,0.03)"},children:[o.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[o.jsx("div",{style:{fontSize:13,fontWeight:700,color:"#475569"},children:e.label}),o.jsx("div",{style:{fontSize:26,fontWeight:900,color:"#0f172a",lineHeight:1},children:e.value})]}),o.jsx("div",{title:String(e.label),style:{display:"flex",alignItems:"center",justifyContent:"center",width:48,height:48,borderRadius:10,background:e.iconSquareBg??oS("#7c3aed",.12),border:`1px solid ${oS(e.iconColor??"#7c3aed",.12)}`,boxShadow:"none"},children:e.iconComponent?k.createElement(e.iconComponent,{size:18,color:e.iconColor??"#7c3aed",strokeWidth:1.6}):null})]}),qke=({item:e,bg:t,onClick:n,width:c,height:i,extraStyle:r})=>o.jsxs("div",{className:W.mpSummaryCard,style:{background:t,width:c??void 0,height:i??void 0,...r??{}},role:n?"button":"group",tabIndex:n?0:-1,onClick:()=>n?.(e),children:[o.jsx("div",{className:W.mpSummaryLabel,children:e.label}),o.jsx("div",{className:W.mpSummaryValue,style:{color:e.valueColor??"#2a24deff"},children:e.value}),e.badge&&o.jsxs("div",{className:W.mpSummaryBadge,children:[e.badge.text,e.badge.subText&&o.jsx("div",{className:W.mpSummaryBadgeSub,children:e.badge.subText})]})]}),cS=(e,t=1)=>{try{return $t(e,t)}catch{return`rgba(124, 58, 237, ${t})`}},iS=e=>o.jsxs("div",{style:{display:"grid",gridTemplateRows:"auto 1fr",width:"100%",gap:8,alignItems:"center",boxSizing:"border-box",minWidth:0},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between-left",alignItems:"baseline",gap:10,width:"100%"},children:[o.jsx("div",{style:{fontWeight:700,fontSize:"clamp(14px, 1.2vw, 16px)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:e.label}),e.subLabel?o.jsx("div",{style:{fontSize:"clamp(13px, 1.1vw, 15px)",fontWeight:600,whiteSpace:"nowrap"},children:e.subLabel}):null]}),o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:15,width:"100%"},children:[o.jsx("div",{style:{fontWeight:900,fontSize:"clamp(16px, 1.6vw, 20px)",color:e.valueColor,lineHeight:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.value}),e.badge?o.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"8px 12px",borderRadius:10,backgroundColor:e.badge.bg?e.badge.bg:cS("#7c3aed",.08),border:`1px solid ${e.badge.bg?e.badge.bg:cS("#7c3aed",.12)}`,color:e.badge.textColor||"#0f172a",fontWeight:700,fontSize:"clamp(12px, 1.2vw, 14px)",width:"120px",height:"52px",textAlign:"center",boxSizing:"border-box",overflow:"hidden",boxShadow:"0 2px 4px rgba(0,0,0,0.1)",lineHeight:1.2,flexShrink:0},children:[o.jsx("div",{style:{fontSize:14,fontWeight:800,lineHeight:1.2,letterSpacing:"0.02em",width:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.badge.text}),e.badge.subText?o.jsx("div",{style:{fontSize:13,marginTop:4,fontWeight:700,letterSpacing:"0.01em",width:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.badge.subText}):null]}):null]})]}),rS=(e,t)=>{try{if(typeof e=="function"){const n=e(t);if(n!==void 0)return n}}catch{}try{return k.createElement(e,{item:t})}catch(n){return console.warn("chooseDefaultRender: impossible de rendre CompactRenderer",n),null}},Ake=e=>{switch(e){case"image":return t=>k.createElement($ke,{item:t});case"pertinence":return t=>k.createElement(qke,{item:t});case"alternateHorizontal":return t=>rS(iS,t);case"compact":return t=>rS(iS,t);case"summary":return;case"default":default:return}},Gq=({item:e,orientation:t,bg:n,border:c,valueColor:i,onClick:r,width:s,height:d,extraStyle:l})=>{const u=t==="horizontal"?W.mpSummaryCardHorizontal:W.mpSummaryCard;return o.jsxs("div",{className:u,style:{background:n,border:`1px solid ${c}`,width:s??void 0,height:d??void 0,...l??{}},role:r?"button":"group",tabIndex:r?0:-1,onClick:()=>r?.(e),children:[e.badge&&o.jsxs("div",{className:W.mpSummaryBadge,children:[e.badge.text,e.badge.subText&&o.jsx("div",{className:W.mpSummaryBadgeSub,children:e.badge.subText})]}),o.jsx("div",{className:W.mpSummaryValue,style:{color:i},children:e.value}),o.jsx("div",{className:W.mpSummaryLabel,children:e.label})]})},zke=["transparent","transparent","transparent","transparent"],Vke=["transparent","transparent","transparent","transparent"],Pke=["#059669","#2563eb","#b45309","#7c3aed"],Tke=(e,t=1)=>{try{return $t(e,t)}catch{return`rgba(124, 58, 237, ${t})`}},Kq=e=>{const{items:t=[],layout:n="vertical",orientation:c="auto",shape:i="rounded",color:r="#7c3aed",compact:s=!1,title:d,onItemClick:l,className:h="",loading:u=!1,emptyMessage:p="Aucun élément",renderItem:y,summary:m=!1,summaryBgColors:g=zke,summaryBorderColors:f=Vke,summaryValueColors:M=Pke,preset:_,background:v}=e,{itemsContainerStyle:L,itemsContainerClassName:w,summaryGridColumns:C,compactItemWidth:b,compactItemHeight:x,compactItemStyle:I,summaryCardWidth:S,summaryCardHeight:j,summaryCardStyle:$}=e,q=n==="vertical",H={"--mp-accent":r,"--mp-accent-soft":Tke(r,.08),"--mp-bg-primary":v},D=[W.mpRoot,q?W.mpVertical:W.mpHorizontal,s?W.mpCompact:"",m?W.mpSummaryRoot:"",c!=="auto"?c==="vertical"?W.mpOrientationVertical:W.mpOrientationHorizontal:"",h].filter(Boolean).join(" "),z=k.useMemo(()=>y||(Ake(_)??void 0),[y,_]);if(m){const N=c==="horizontal"?W.mpSummaryFlex:W.mpSummaryVertical,R={...(C?{display:"grid",gridTemplateColumns:`repeat(${C}, 1fr)`,gap:18,alignItems:"stretch",width:"100%"}:void 0)??{},...L??{}};return o.jsxs("div",{className:D,style:H,"aria-busy":u,children:[d&&o.jsx(nS,{title:d}),o.jsx("div",{className:W.mpSummaryInner,children:o.jsx("div",{className:`${N} ${w??""}`,style:R,children:t.length===0?o.jsx("div",{className:W.mpEmpty,children:p}):t.map((P,T)=>{const E=P.bgColor??g[T%g.length],X=P.borderColor??f[T%f.length],ae=P.valueColor??M[T%M.length];return z?o.jsx("div",{className:c==="horizontal"?W.mpSummaryCardWrapperHorizontal:W.mpSummaryCardWrapper,style:{width:S??void 0,height:j??void 0,...$??{}},children:z(P,T)},P.id):o.jsx(Gq,{item:P,orientation:c==="horizontal"?"horizontal":"vertical",bg:E,border:X,valueColor:ae,onClick:l,width:S??void 0,height:j??void 0,extraStyle:$},P.id)})})})]})}return o.jsxs("div",{className:D,style:H,"aria-busy":u,children:[d&&o.jsx(nS,{title:d}),o.jsx("div",{className:W.mpList,style:L,children:u?o.jsx("div",{className:W.mpEmpty,children:"Chargement…"}):t.length===0?o.jsx("div",{className:W.mpEmpty,children:p}):t.map(N=>{const A=s?{width:b??void 0,height:x??void 0,boxSizing:"border-box",...I??{}}:void 0;return o.jsx("div",{className:s?W.compactItemWrapper:void 0,style:A,children:o.jsx(Ske,{item:N,shape:i,onItemClick:l,color:r,renderItem:z?R=>z(R,t.indexOf(R)):void 0})},N.id)})})]})};k.memo(Kq);const Hke=({a11yConfig:e,width:t,height:n,colors:c={text:"#0b1220",background:"#fff",contentBackground:"#efeff0"},titles:i={},placeholder:r="Loading Chart",style:s,className:d="",children:l,padding:h="1rem",variant:u="default",showBorder:p=!1,titleKey:y,leftTitleKey:m})=>{const g=t?typeof t=="number"?`${t}px`:t:void 0,f=n?typeof n=="number"?`${n}px`:n:void 0,M=r&&typeof r=="object"&&!k.isValidElement(r)&&("text"in r||"subtext"in r||"icon"in r||"background"in r||"iconSize"in r),_=M?r:void 0,v=_?.icon?kt[_.icon]:void 0,L=28,w=_?.iconSize??L,C=["chart-container",`variant-${u}`,p?"with-border":"",d].filter(Boolean).join(" "),b=c.contentBackground??void 0,x=typeof h=="number"?`${h}px`:h;return o.jsxs("div",{className:C,style:{width:g,height:f,color:c.text,background:c.background,display:"flex",flexDirection:"column",boxSizing:"border-box",padding:x,...s},children:[o.jsxs("div",{className:"chart-header",children:[o.jsxs("div",{title:Y(e,m||y),className:"chart-title-left",style:{display:"flex",alignItems:"center",gap:"8px"},children:[i.left,i.leftSubtitle&&o.jsx("div",{className:"chart-subtitle-left",children:i.leftSubtitle})]}),o.jsx("div",{className:"chart-title-right",children:i.right})]}),o.jsx("div",{className:"chart-content",style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",background:b},children:l||(M&&_?o.jsxs("div",{className:"placeholder",role:"status","aria-live":"polite",children:[v&&o.jsx("div",{className:"placeholder-icon",style:{width:w,height:w},children:o.jsx(v,{color:_.iconColor??"currentColor",size:typeof w=="number"?w:parseInt(String(w),10)||L})}),_.text&&o.jsx("div",{className:"placeholder-text",children:_.text}),_.subtext&&o.jsx("div",{className:"placeholder-subtext",children:_.subtext})]}):o.jsx("div",{className:"placeholder-node",role:"status","aria-live":"polite",children:r}))})]})},Kw=({id:e,size:t="100%",background:n,icon:c,text:i,subtext:r,onClose:s,onClick:d,style:l,className:h="",colorTextPrimary:u,colorTextSub:p,model:y})=>{const m=c||y?.icon?kt[c||y?.icon]:null;return o.jsxs("div",{id:e,className:`alert ${h}`,style:{width:typeof t=="number"?`${t}px`:t,background:n||y?.background,pointerEvents:"auto",...l},role:"alert",onClick:d,children:[m&&o.jsx(m,{className:"alert-icon",size:20,color:u||y?.colorTextPrimary}),o.jsxs("div",{className:"alert-content",children:[o.jsx("span",{className:"alert-text",style:{color:u||y?.colorTextPrimary},children:i}),r&&o.jsx("span",{className:"alert-subtext",style:{color:p||y?.colorTextSub},children:r})]}),s&&o.jsx("button",{className:"alert-close",onClick:s,"aria-label":"Fermer",children:"✕"})]})},Zq=k.createContext(null),Dke=(e="alert")=>`${e}_${Math.random().toString(36).slice(2,9)}`,Bke=({children:e,defaultDuration:t=4e3,maxAlerts:n,containerClassName:c,containerStyle:i})=>{const[r,s]=k.useState([]),d=k.useRef(new Map),l=k.useRef(null),h=k.useRef(null),u=k.useRef(n);k.useEffect(()=>()=>{d.current.forEach(x=>window.clearTimeout(x)),d.current.clear()},[]);const p=(x,I)=>{const S=I===void 0||I===0?t:I;if(S===-1)return;const j=window.setTimeout(()=>{g(x)},S);d.current.set(x,j)},y=x=>{const I=d.current.get(x);I&&(window.clearTimeout(I),d.current.delete(x))},m=x=>{const I=Dke(),S={...x,id:I,createdAt:Date.now()};return s(j=>{const $=[S,...j],q=u.current;return typeof q=="number"&&q>=0&&$.length>q?($.slice(q).forEach(D=>y(D.id)),$.slice(0,q)):$}),p(I,x.duration),I},g=x=>{y(x),s(I=>I.filter(S=>S.id!==x))},f=(x,I)=>{s(S=>S.map(j=>j.id===x?{...j,...I}:j))},M=()=>{d.current.forEach(x=>window.clearTimeout(x)),d.current.clear(),s([])},_=x=>{h.current=x},v=()=>r.slice(),L=k.useMemo(()=>({showAlert:m,dismissAlert:g,updateAlert:f,clearAlerts:M,setContainerRef:_,getAlertsSnapshot:v}),[r]),w=h.current,C=o.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,display:"flex",flexDirection:"column",alignItems:"center",pointerEvents:"none",zIndex:10001,padding:"8px 4px"},children:o.jsx(I0e,{mode:"popLayout",children:r.map(x=>o.jsx(Ew.div,{initial:{opacity:0,y:-10,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-10,scale:.98},transition:{type:"spring",damping:25,stiffness:300},style:{width:"100%",pointerEvents:"auto",boxShadow:"0 6px 20px rgba(0, 0, 0, 0.12)",borderRadius:"8px",marginBottom:"6px",backgroundColor:x.background||x.model?.background||"var(--color-background, #fff)",border:"1px solid rgba(0, 0, 0, 0.08)",overflow:"hidden"},children:o.jsx(Kw,{id:x.id,text:x.text,subtext:x.subtext,icon:x.icon,background:"transparent",colorTextPrimary:x.colorTextPrimary,colorTextSub:x.colorTextSub,model:x.model,onClose:()=>g(x.id),size:"100%",style:{boxShadow:"none"}})},x.id))})}),b=o.jsx("div",{ref:x=>{h.current||(l.current=x)},className:c,style:{width:"100%",position:"relative",...i},"aria-live":"polite",children:C});return o.jsxs(Zq.Provider,{value:L,children:[w?dw.createPortal(C,w):b,e]})},Rke=()=>{const e=k.useContext(Zq);if(!e)throw new Error("useAlerts must be used inside an AlertsProvider");return e},Fke={default:{background:"#f3f4f6",icon:"Info",colorTextPrimary:"#111827",colorTextSub:"#4b5563"},info:{background:"#dbeafe",icon:"Info",colorTextPrimary:"#1e40af",colorTextSub:"#3b82f6"},success:{background:"#dcfce7",icon:"CheckCircle2",colorTextPrimary:"#166534",colorTextSub:"#22c55e"},warning:{background:"#fef3c7",icon:"AlertTriangle",colorTextPrimary:"#92400e",colorTextSub:"#f59e0b"},error:{background:"#fee2e2",icon:"XCircle",colorTextPrimary:"#991b1b",colorTextSub:"#ef4444"}},Eke="_container_18zbo_1",Oke="_icon_18zbo_9",Uke="_selectWrapper_18zbo_23",qb={container:Eke,icon:Oke,selectWrapper:Uke},Wke=({options:e,defaultValue:t,onChange:n,label:c})=>{const[i,r]=k.useState(t||e[0]?.value||""),s=d=>{r(d),n?.(d)};return o.jsxs("div",{className:qb.container,children:[o.jsxs("div",{className:qb.icon,children:[o.jsx(M1,{size:18}),o.jsx("p",{children:c})]}),o.jsx("div",{className:qb.selectWrapper,children:o.jsx(Ow,{field:{name:"periode",label:"",options:e},value:i,onChange:s,onBlur:()=>{}})})]})},Gke=250,Kke=k.forwardRef(({title:e,subtitle:t,size:n="420px",beforeOpen:c,afterOpen:i,beforeClose:r,afterClose:s,style:d,className:l="",children:h,closeOnOverlayClick:u=!0,showCloseButton:p=!0},y)=>{const[m,g]=k.useState(!1),[f,M]=k.useState(!1),_=k.useRef(null),v=k.useRef(null),L=k.useRef(null),w=k.useRef(null);k.useEffect(()=>{const x=_.current;if(!x)return;const I=x.parentElement;return I?(window.getComputedStyle(I).position==="static"&&(I.setAttribute("data-scp-prev-position",I.style.position??""),I.style.position="relative",I.setAttribute("data-scp-position-changed","true")),()=>{if(I.getAttribute("data-scp-position-changed")==="true"){const j=I.getAttribute("data-scp-prev-position")??"";I.style.position=j,I.removeAttribute("data-scp-position-changed"),I.removeAttribute("data-scp-prev-position")}}):void 0},[]),k.useImperativeHandle(y,()=>({open:()=>{m||(c?.(),M(!1),g(!0))},close:()=>{m&&(r?.(),M(!1),g(!1))},toggle:()=>{m?(r?.(),M(!1),g(!1)):(c?.(),M(!1),g(!0))}}),[m,c,r]),k.useEffect(()=>{const x=v.current;w.current&&(window.clearTimeout(w.current),w.current=null);const I=S=>{if(S.target===x&&!(S.propertyName!=="transform"&&S.propertyName!=="opacity"))if(m){M(!0),i?.();try{x?.focus()}catch{}}else{s?.();try{L.current?.focus()}catch{}}};return x&&(x.addEventListener("transitionend",I),w.current=window.setTimeout(()=>{if(m){M(!0),i?.();try{x?.focus()}catch{}}else{s?.();try{L.current?.focus()}catch{}}},Gke+60)),m&&(L.current=document.activeElement),()=>{x&&x.removeEventListener("transitionend",I),w.current&&(window.clearTimeout(w.current),w.current=null)}},[m,i,s]),k.useEffect(()=>{const x=I=>{I.key==="Escape"&&m&&(r?.(),M(!1),g(!1))};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[m,r]);const C=()=>{u&&(r?.(),M(!1),g(!1))},b=typeof n=="number"?`${n}px`:n;return o.jsxs("div",{ref:_,className:`scp-inline-root ${m?"open":""}`,"aria-hidden":!m,children:[o.jsx("div",{className:`scp-overlay ${m?"visible":""}`,onMouseDown:C,role:"presentation"}),o.jsxs("aside",{className:`scp-panel ${m?"in":"out"} ${f?"interactive":""} ${l}`,style:{width:b,...d},ref:v,tabIndex:-1,role:"dialog","aria-label":e,children:[o.jsxs("div",{className:"scp-header",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"scp-title",children:e}),t&&o.jsx("div",{className:"scp-subtitle",children:t})]}),p&&o.jsx("button",{className:"scp-close","aria-label":"Close",onClick:()=>{r?.(),M(!1),g(!1)},children:o.jsx(Ge,{size:18})})]}),o.jsx("div",{className:"scp-body",children:h})]})]})});function Zke(e){const t=k.useRef("");k.useEffect(()=>{if(e){t.current=document.body.style.overflow,document.body.style.overflow="hidden";return}document.body.style.overflow=t.current||""},[e])}const Xke="_container_1pfsp_1",Yke="_title_1pfsp_8",sS={container:Xke,title:Yke},Jke=({title:e,fontSize:t,barColor:n,className:c="",style:i={}})=>{const r={...i,"--title-font-size":t,"--bar-color":n};return o.jsx("div",{className:`${sS.container} ${c}`,style:r,children:o.jsx("h2",{className:sS.title,children:e})})},Qke="_modalOverlay_1dmfp_1",e3e="_modalContainer_1dmfp_16",t3e="_modalTitle_1dmfp_29",a3e="_modalInput_1dmfp_38",n3e="_modalTextarea_1dmfp_39",o3e="_modalActions_1dmfp_71",c3e="_cancelBtn_1dmfp_78",i3e="_saveBtn_1dmfp_100",r3e="_inputError_1dmfp_148",s3e="_inlineAlert_1dmfp_153",Xe={modalOverlay:Qke,modalContainer:e3e,modalTitle:t3e,modalInput:a3e,modalTextarea:n3e,modalActions:o3e,cancelBtn:c3e,saveBtn:i3e,inputError:r3e,inlineAlert:s3e},qc=({isOpen:e,onClose:t,onSave:n,title:c="Ajouter un élément",fields:i,initialValues:r={},errorMessage:s="",disableSave:d,onFieldChange:l,confirmText:h="Valider",cancelText:u="Annuler"})=>{const[p,y]=k.useState({}),m=k.useRef(null),[g,f]=k.useState(!1),[M,_]=k.useState(!1),v=k.useRef(null);if(k.useEffect(()=>{if(!e)return;const x={};for(const I of i)x[I.name]=Object.prototype.hasOwnProperty.call(r,I.name)?r[I.name]:"";return y(x),requestAnimationFrame(()=>{m.current?.focus();const I=m.current;if(I&&typeof I.selectionStart=="number"){const S=String(I.value??"").length;I.setSelectionRange(S,S)}}),()=>{v.current&&(window.clearTimeout(v.current),v.current=null)}},[e]),k.useEffect(()=>{s&&e?(_(!0),v.current&&(window.clearTimeout(v.current),v.current=null),v.current=window.setTimeout(()=>{_(!1),v.current=null},3e3)):(_(!1),v.current&&(window.clearTimeout(v.current),v.current=null))},[s,e]),!e)return null;const L=(x,I)=>{y(S=>({...S,[x]:I})),l&&l(x,I)},w=async()=>{if(!Object.values(p).some(x=>x===""||x===void 0))try{f(!0);const x=await n(p);if(typeof x=="string"&&x==="duplicate-same"){f(!1);return}y({}),f(!1),t()}catch(x){console.error("AddItemModal onSave error:",x),f(!1),t()}},C=x=>{x.target===x.currentTarget&&t()},b=x=>x.stopPropagation();return o.jsx("div",{className:Xe.modalOverlay,onMouseDown:C,role:"dialog","aria-modal":"true",children:o.jsxs("div",{className:Xe.modalContainer,onMouseDown:b,onClick:b,children:[o.jsx("h2",{className:Xe.modalTitle,children:c}),i.map((x,I)=>{const S=p[x.name]??"",j=I===0&&!!s,$={name:x.name,placeholder:x.placeholder||x.label,value:String(S),onChange:q=>L(x.name,q.target.value),className:x.type==="textarea"?`${Xe.modalTextarea} ${j?Xe.inputError:""}`:`${Xe.modalInput} ${j?Xe.inputError:""}`,tabIndex:0,disabled:g};return I===0&&($.ref=q=>{m.current=q}),o.jsxs("div",{style:{marginBottom:8},children:[x.type==="textarea"?o.jsx("textarea",{rows:x.rows||4,...$}):o.jsx("input",{type:x.type||"text",...$}),I===0&&M&&s&&o.jsx("div",{style:{marginTop:8},children:o.jsx(Kw,{text:s,background:"#fff5f5",colorTextPrimary:"#ef4444",onClose:()=>_(!1),className:Xe.inlineAlert})})]},x.name)}),o.jsxs("div",{className:Xe.modalActions,children:[o.jsx("button",{className:Xe.cancelBtn,onClick:t,type:"button",disabled:g,children:u}),o.jsx("button",{className:Xe.saveBtn,onClick:w,type:"button",disabled:g||!!d,children:g?"En cours...":h})]})]})})},d3e=({title:e,keyCount:t,onAddKey:n,a11yConfig:c})=>{const[i,r]=k.useState(!1),s=d=>{const l=d.key;n&&l&&n(l)};return o.jsxs("div",{className:"header-container",children:[o.jsxs("div",{className:"header-info",children:[o.jsx("h1",{title:Y(c,e),children:e}),o.jsxs("p",{children:[t," clés"]})]}),o.jsxs("button",{onClick:()=>r(!0),className:"add-key-button",children:[o.jsx(Jc,{className:"add-key-icon"}),"Clé"]}),o.jsx(qc,{isOpen:i,title:"Ajouter une clé",onClose:()=>r(!1),onSave:s,fields:[{name:"key",label:"Nouvelle clé",placeholder:"Entrer une nouvelle clé"}]})]})},l3e=({modules:e,onEdit:t,onDelete:n,onAddModule:c,onSelectModule:i,addModalFields:r,addModalTitle:s})=>{const[d,l]=k.useState(!1),[h,u]=k.useState(null),[p,y]=k.useState(null),[m,g]=k.useState(!1),f=()=>l(!0),M=()=>l(!1),_=x=>{if(c){const I=x.code?.trim()||x.id?.trim(),S=x.title?.trim(),j=I||S||String(Date.now()),$=S||I||`Module ${j}`;c({id:j,title:$,subtitle:"",translations:{}})}M()},v=(x,I)=>{x.stopPropagation(),u(I)},L=()=>u(null),w=x=>{if(!h){L();return}const I={...h,title:x.title||h.title,subtitle:""};t&&t(I),L()},C=(x,I)=>{x.stopPropagation(),n&&n(I)},b=x=>{y(x.id),i&&i(x)};return m?o.jsx("div",{className:"module-sidebar collapsed",children:o.jsx(Xc,{size:20,className:"menu-toggle",onClick:()=>g(!1)})}):o.jsxs("div",{className:"module-sidebar",children:[o.jsxs("div",{className:"sidebar-header",children:[o.jsxs("span",{className:"header-text",children:["Modules (",e.length,")"]}),o.jsxs("div",{className:"header-actions",children:[o.jsx(Zc,{size:18,className:"header-folder",onClick:f}),o.jsx(Xc,{size:18,className:"header-menu",onClick:()=>g(!0)})]})]}),o.jsx("hr",{className:"divider"}),o.jsx("div",{className:"module-list",children:e.map(x=>{const I=Object.keys(x.translations||{}).length,S=I>0||x.id===p;return o.jsxs("div",{className:`module-item ${x.id===p?"selected":""}`,onClick:()=>b(x),role:"button",tabIndex:0,onKeyDown:j=>{j.key==="Enter"&&b(x)},children:[o.jsxs("div",{className:"module-left",children:[o.jsx(b1,{size:16,className:"item-folder"}),o.jsxs("div",{className:"module-info",children:[o.jsxs("div",{className:"module-title",children:[x.title,S&&o.jsxs("span",{className:"count",children:[" ",I," "]})]}),x.subtitle?o.jsx("div",{className:"module-subtitle",children:x.subtitle}):null]})]}),o.jsxs("div",{className:"module-actions",children:[t&&o.jsx(Yc,{onClick:j=>v(j,x),color:"#777",size:16}),n&&o.jsx(yt,{onClick:j=>C(j,x.id),color:"#777",size:16})]})]},x.id)})}),o.jsx(qc,{isOpen:d,onClose:M,onSave:_,title:s||"Ajouter un module",fields:r&&r.length?r.map(x=>({name:x.name,label:x.label,type:x.type,placeholder:x.placeholder,rows:x.rows})):[{name:"title",label:"Titre",placeholder:"Titre du module"}]}),h&&o.jsx(qc,{isOpen:!!h,onClose:L,onSave:w,title:"Éditer le module",initialValues:{title:h.title},fields:[{name:"title",label:"Titre",placeholder:"Titre du module"}]})]})},Xq=({placeholder:e="Rechercher une clé ou traduction...",value:t="",onChange:n,iconPosition:c="left",iconColor:i="#9ca3af",a11yConfig:r,className:s})=>o.jsxs("div",{className:`search-container icon-${c}`,title:Y(r,e),children:[o.jsx("div",{className:"search-icon-wrapper",children:o.jsx(N1,{className:"search-icon",color:i})}),o.jsx("input",{type:"text",placeholder:e,value:t,onChange:d=>n?.(d.target.value),className:`search-input ${s}`})]}),h3e=({keyName:e,translations:t,availableLanguages:n,onDeleteKey:c,onEditKey:i,onEditTranslation:r,onDeleteTranslation:s,onAddTranslation:d,draggable:l=!1,checkDuplicateLocal:h})=>{const[u,p]=k.useState(!1),[y,m]=k.useState(""),[g,f]=k.useState(null),[M,_]=k.useState(""),[v,L]=k.useState(""),[w,C]=k.useState(!1),[b,x]=k.useState(!1),[I,S]=k.useState(null),[j,$]=k.useState(!1),q=t.map(T=>T.language),H=n.filter(T=>!q.includes(T.code)),D=()=>{y&&v.trim()&&(d?.(e,y,v.trim()),m(""),L(""),p(!1))},z=(T,E)=>{f(T),_(E)},N=T=>{r?.(e,T,M),f(null),_("")},A=()=>{f(null),_("")},R=async T=>{const E=T.name?.trim();if(E){if(S(null),$(!1),E===e||!i)return C(!1),"ok";try{const X=await i(e,E);if(typeof X=="string"&&X==="ok")C(!1),S(null);else{if(typeof X=="string"&&X==="duplicate-same")return S("Une clé existe déjà dans ce module."),$(!0),"duplicate-same";if(typeof X=="string"&&X==="duplicate-other")return C(!1),S(null),"duplicate-other";C(!1)}}catch(X){console.error("Erreur handleRenameSave:",X),S("Erreur lors du renommage.")}}},P=(T,E)=>{if(T!=="name")return;const X=E.trim();S(null),$(!1),X&&typeof h=="function"&&(h(X,e)?(S("Une clé existe déjà dans ce module."),$(!0)):(S(null),$(!1)))};return o.jsxs("div",{className:`translation-key ${b?"collapsed":"expanded"} ${l?"draggable":""}`,children:[o.jsxs("div",{className:"card-header",children:[o.jsxs("div",{className:"header-left",children:[o.jsx("button",{className:"collapse-button",onClick:()=>x(!b),title:b?"Déplier":"Replier",children:b?o.jsx(x1,{className:"collapse-icon"}):o.jsx(qt,{className:"collapse-icon"})}),o.jsx("h3",{className:"card-title",title:e,children:e})]}),o.jsxs("div",{className:"header-actions",children:[o.jsx("button",{className:"action-button",onClick:T=>{T.stopPropagation(),C(!0)},title:"Renommer la clé",children:o.jsx(ut,{className:"action-icon"})}),o.jsx("button",{onClick:T=>{T.stopPropagation(),c?.(e)},className:"action-button delete",title:"Supprimer la clé",children:o.jsx(yt,{className:"action-icon"})})]})]}),o.jsx("div",{className:`translations-container ${b?"":"expanded"}`,children:!l&&o.jsxs(o.Fragment,{children:[t.map(T=>o.jsxs("div",{className:"translation-row",children:[o.jsx("div",{className:"language-code",children:T.language}),o.jsx("div",{className:"translation-content",children:g===T.language?o.jsxs(o.Fragment,{children:[o.jsx("input",{type:"text",value:M,onChange:E=>_(E.target.value),className:"edit-input",autoFocus:!0,onKeyDown:E=>{E.key==="Enter"&&N(T.language),E.key==="Escape"&&A()}}),o.jsx("button",{onClick:()=>N(T.language),className:"save-button",disabled:!M.trim(),children:"Enregistrer"}),o.jsx("button",{onClick:A,className:"cancel-button",children:o.jsx(Ge,{className:"action-icon"})})]}):o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"translation-text",title:T.value,children:T.value}),o.jsx("button",{onClick:()=>z(T.language,T.value),className:"edit-button",title:"Éditer la traduction",children:o.jsx(ut,{className:"action-icon"})}),o.jsx("button",{onClick:()=>s?.(e,T.language),className:"delete-translation-button",title:"Supprimer la traduction",children:o.jsx(Ge,{className:"action-icon"})})]})})]},T.language)),u?o.jsxs("div",{className:"add-language-row",children:[o.jsx("div",{className:"language-code",children:"+"}),o.jsxs("div",{className:"add-language-content",children:[o.jsx("div",{className:"language-select-container",children:o.jsxs("select",{value:y,onChange:T=>m(T.target.value),className:"language-select",children:[o.jsx("option",{value:"",children:"Sélectionnez la langue"}),H.map(T=>o.jsxs("option",{value:T.code,children:[T.name," (",T.code,")"]},T.code))]})}),y&&o.jsx("input",{type:"text",value:v,onChange:T=>L(T.target.value),placeholder:"Entrez la traduction...",className:"translation-input",onKeyDown:T=>{T.key==="Enter"&&D(),T.key==="Escape"&&(p(!1),m(""),L(""))}}),o.jsx("button",{onClick:D,disabled:!y||!v.trim(),className:"save-button",children:"Ajouter"}),o.jsx("button",{onClick:()=>{p(!1),m(""),L("")},className:"cancel-button",children:o.jsx(Ge,{className:"action-icon"})})]})]}):o.jsxs("button",{onClick:()=>p(!0),className:"show-add-button",disabled:H.length===0,children:[o.jsx("span",{className:"plus-icon",children:"+"}),"Ajouter une langue"]})]})}),l&&o.jsxs("div",{className:"drag-overlay",children:[o.jsx(a.Move,{size:24,strokeWidth:1.5}),o.jsx("span",{children:"Glisser pour réorganiser"})]}),o.jsx(qc,{isOpen:w,onClose:()=>{C(!1),S(null),$(!1)},onSave:R,onFieldChange:P,title:"Renommer la clé",initialValues:{name:e},fields:[{name:"name",label:"Nom de la clé",placeholder:"Nom de la clé"}],errorMessage:I||"",disableSave:j})]})},u3e="_wrapper_1wvht_1",p3e="_leftGroup_1wvht_12",y3e="_filterButton_1wvht_21",k3e="_open_1wvht_42",m3e="_filterIcon_1wvht_42",f3e="_infoText_1wvht_58",g3e="_pickerContainer_1wvht_66",v3e="_srOnly_1wvht_79",M3e="_pickerLabel_1wvht_91",_3e="_datetime_1wvht_98",x3e="_rightGroup_1wvht_107",L3e="_searchInputWrap_1wvht_116",I3e="_searchInput_1wvht_116",b3e="_searchIcon_1wvht_152",Ve={wrapper:u3e,leftGroup:p3e,filterButton:y3e,open:k3e,filterIcon:m3e,infoText:f3e,pickerContainer:g3e,srOnly:v3e,pickerLabel:M3e,datetime:_3e,rightGroup:x3e,searchInputWrap:L3e,searchInput:I3e,searchIcon:b3e};function w3e({onDateChange:e,onSearch:t,initialDate:n}){const[c,i]=k.useState(!1),[r,s]=k.useState(n??""),d=k.useRef(null);k.useEffect(()=>{function p(y){const m=y.target;d.current&&m&&!d.current.contains(m)&&i(!1)}return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[]),k.useEffect(()=>{n&&s(n)},[n]);const l=()=>i(p=>!p),h=p=>{const y=p.target.value;s(y),e?.(y)},u=p=>{t?.(p.target.value)};return o.jsxs("div",{className:Ve.wrapper,ref:d,children:[o.jsxs("div",{className:Ve.leftGroup,children:[o.jsxs("button",{type:"button",className:`${Ve.filterButton} ${c?Ve.open:""}`,onClick:l,"aria-expanded":c,"aria-haspopup":"dialog","aria-controls":"entry-datetime",children:[o.jsx("span",{children:"Entry time"}),o.jsx("svg",{className:Ve.filterIcon,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":!0,children:o.jsx("path",{fill:"currentColor",d:"M10 18h4v-2h-4v2zm-7-8v2h18V10H3zm3-6v2h12V4H6z"})})]}),o.jsx("div",{className:Ve.infoText,children:"Confidence interval: step ± 15' / exit ± 30'"}),c&&o.jsxs("div",{className:Ve.pickerContainer,role:"dialog","aria-label":"Choisir la date et l’heure",children:[o.jsx("label",{className:Ve.pickerLabel,htmlFor:"entry-datetime",children:o.jsx("span",{className:Ve.srOnly,children:"Choisir la date et l’heure"})}),o.jsx("input",{id:"entry-datetime",className:Ve.datetime,type:"datetime-local",value:r,onChange:h,"aria-label":"Date et heure d’entrée"})]})]}),o.jsx("div",{className:Ve.rightGroup,children:o.jsxs("div",{className:Ve.searchInputWrap,children:[o.jsx("input",{className:Ve.searchInput,placeholder:"Search...",onChange:u,"aria-label":"Search"}),o.jsx("svg",{className:Ve.searchIcon,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"16",height:"16","aria-hidden":!0,children:o.jsx("path",{fill:"currentColor",d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16a6.471 6.471 0 004.23-1.57l.27.28v.79L20 20.49 21.49 19l-5.99-5zM10 15.5A5.5 5.5 0 1115.5 10 5.5 5.5 0 0110 15.5z"})})]})})]})}const C3e=({className:e="",style:t={},title:n,titleClassName:c="",titleStyle:i,data:r,lineClasses:s={},renderCell:d,bg:l,titleBg:h,titleColor:u,itemBg:p,emptyContent:y,colGap:m="1rem"})=>{const g=Array.isArray(r)?r:[],f=g.length===0,M=g.every(w=>typeof w=="string"),_=g.some(w=>Array.isArray(w)),v=(w,C,b)=>d?d(w,C,b):o.jsx("span",{className:"slb-cell-text",children:w}),L=m?{"--col-gap":m}:void 0;return f?o.jsxs("div",{className:`slb-root ${e}`,style:{...t,background:l??void 0},children:[n&&o.jsx("div",{className:`slb-title ${c}`,style:{...i,background:h??void 0,color:u??void 0},children:n}),o.jsx("div",{className:"slb-empty",children:y??null})]}):M&&!_?o.jsxs("div",{className:`slb-root ${e}`,style:{...t,background:l??void 0},children:[n&&o.jsx("div",{className:`slb-title ${c}`,style:{background:h??void 0,color:u??void 0},children:n}),o.jsx("ul",{className:"slb-list",children:g.map((w,C)=>o.jsx("li",{className:`slb-item ${s[C]||""}`,style:{background:p??void 0},children:v(w,C,0)},C))})]}):o.jsxs("div",{className:`slb-root ${e}`,style:{...t,background:l??void 0},children:[n&&o.jsx("div",{className:`slb-title ${c}`,style:{background:h??void 0,color:u??void 0},children:n}),o.jsx("div",{className:"slb-grid",style:L,children:g.map((w,C)=>{const b=s[C]||"";if(Array.isArray(w)){const[x,I]=w;return o.jsxs("div",{className:`slb-row ${b}`,style:{background:p??void 0},children:[o.jsx("div",{className:"slb-grid-left",children:v(x,C,0)}),o.jsx("div",{className:"slb-grid-right",children:v(I,C,1)})]},C)}return o.jsxs("div",{className:`slb-row ${b}`,style:{background:p??void 0},children:[o.jsx("div",{className:"slb-grid-left",children:v(w,C,0)}),o.jsx("div",{className:"slb-grid-right slb-empty-cell","aria-hidden":"true"})]},C)})})]})},N3e=({className:e="",style:t={},title:n,titleColor:c,data:i=[],badgeColor:r="#0ea5e9",badgeColors:s={},badgePadding:d="8px 16px",badgeWidth:l,itemBg:h,lineClasses:u={},colGap:p="1rem"})=>{const y=i.some(g=>Array.isArray(g)),m=p?{"--col-gap":p}:void 0;return o.jsxs("div",{className:`clb-root ${e}`,style:{...t},children:[n&&o.jsx("div",{className:"clb-title",style:c?{color:c}:void 0,children:n}),o.jsx("div",{className:"clb-grid",style:m,children:i.map((g,f)=>{const M=u[f]||"";if(Array.isArray(g)){const[_,v]=g,L=s[f]||r;return o.jsxs("div",{className:`clb-row ${M}`,style:{background:h??void 0},children:[o.jsx("div",{className:"clb-badge-col",children:o.jsx("div",{className:"counter-badge",style:{background:L,padding:d,width:l,minWidth:l},children:_})}),o.jsx("div",{className:"clb-text",children:v})]},f)}return y?o.jsxs("div",{className:`clb-row ${M}`,style:{background:h??void 0},children:[o.jsx("div",{className:"clb-badge-col clb-empty-badge"}),o.jsx("div",{className:"clb-text",children:g})]},f):o.jsx("div",{className:`clb-fullrow ${M}`,style:{background:h??void 0},children:o.jsx("span",{children:g})},f)})})]})},j3e=({className:e="",style:t={},title:n,items:c=[],titleBg:i,titleColor:r,itemBg:s,lineClasses:d={},renderTrendIcon:l,colGap:h="1rem"})=>{const u=h?{"--col-gap":h}:void 0;return o.jsxs("div",{className:`tlb-root ${e}`,style:{...t,background:s??void 0},children:[n&&o.jsx("div",{className:"tlb-title",style:{background:i??void 0,color:r??void 0},children:n}),o.jsx("div",{className:"tlb-grid",style:u,children:c.map((p,y)=>{const m=d[y]||"";return o.jsxs("div",{className:`tlb-row ${m}`,style:{background:s??void 0},children:[o.jsx("div",{className:"tlb-label",children:p.label}),o.jsxs("div",{className:"tlb-value-group",children:[o.jsx("div",{className:"tlb-icon-col",children:l?l(p):p.icon??null}),o.jsxs("div",{className:"tlb-value-wrap",children:[o.jsx("div",{className:"tlb-value",children:p.value}),typeof p.delta<"u"&&o.jsx("div",{className:`tlb-delta ${p.delta>0?"positive":p.delta<0?"negative":"neutral"}`,children:p.deltaLabel??String(p.delta)})]})]})]},y)})})]})},S3e=({className:e="",style:t={},children:n,gap:c="1rem"})=>o.jsx("div",{className:`frc-root ${e}`,style:{...t,"--frc-gap":c},children:k.Children.map(n,i=>o.jsx("div",{className:"frc-item",children:i}))}),$3e=({className:e="",style:t={},children:n,gap:c="1rem",background:i="#D9EEF5"})=>o.jsx("div",{className:`lcc-root ${e}`,style:{background:i,...t,"--lcc-gap":c},children:k.Children.map(n,r=>o.jsx("div",{className:"lcc-cell",children:r}))}),q3e="_overlay_i1ay5_2",A3e="_fadeIn_i1ay5_1",z3e="_popup_i1ay5_17",V3e="_slideUp_i1ay5_1",P3e="_header_i1ay5_28",T3e="_body_i1ay5_40",H3e="_footer_i1ay5_51",D3e="_cancelButton_i1ay5_59",B3e="_confirmButton_i1ay5_77",R3e="_warning_i1ay5_97",F3e="_danger_i1ay5_106",E3e="_info_i1ay5_115",xt={overlay:q3e,fadeIn:A3e,popup:z3e,slideUp:V3e,header:P3e,body:T3e,footer:H3e,cancelButton:D3e,confirmButton:B3e,warning:R3e,danger:F3e,info:E3e},O3e=({isOpen:e,title:t,message:n,onConfirm:c,onCancel:i,confirmText:r="Confirmer",cancelText:s="Annuler",type:d="warning"})=>{if(!e)return null;const l=u=>{u.target===u.currentTarget&&i()},h=u=>{u.key==="Escape"&&i(),u.key==="Enter"&&u.ctrlKey&&c()};return o.jsx("div",{className:xt.overlay,onClick:l,onKeyDown:h,role:"dialog","aria-labelledby":"confirmation-title","aria-describedby":"confirmation-message",children:o.jsxs("div",{className:`${xt.popup} ${xt[d]}`,children:[o.jsx("div",{className:xt.header,children:o.jsx("h3",{id:"confirmation-title",children:t})}),o.jsx("div",{className:xt.body,children:o.jsx("p",{id:"confirmation-message",children:n})}),o.jsxs("div",{className:xt.footer,children:[o.jsx("button",{className:xt.cancelButton,onClick:i,type:"button",children:s}),o.jsx("button",{className:xt.confirmButton,onClick:c,type:"button",autoFocus:!0,children:r})]})]})})},U3e=()=>{const[e,t]=k.useState({isOpen:!1,title:"",message:"",onConfirm:null}),n=k.useCallback((r,s,d)=>{t({isOpen:!0,title:r,message:s,onConfirm:d})},[]),c=k.useCallback(()=>{t(r=>({...r,isOpen:!1,onConfirm:null}))},[]),i=k.useCallback(()=>{e.onConfirm?.(),c()},[e.onConfirm,c]);return{isOpen:e.isOpen,title:e.title,message:e.message,showConfirmation:n,hideConfirmation:c,handleConfirm:i}},W3e="_container_v7v52_1",G3e="_selectButton_v7v52_6",K3e="_disabled_v7v52_19",Z3e="_error_v7v52_29",X3e="_outline_v7v52_43",Y3e="_filled_v7v52_53",J3e="_sm_v7v52_58",Q3e="_md_v7v52_63",eme="_lg_v7v52_68",tme="_buttonContent_v7v52_73",ame="_label_v7v52_80",nme="_placeholder_v7v52_87",ome="_iconsContainer_v7v52_91",cme="_loadingSpinner_v7v52_99",ime="_spin_v7v52_1",rme="_arrowIcon_v7v52_119",sme="_arrowIconOpen_v7v52_127",dme="_dropdown_v7v52_131",lme="_searchContainer_v7v52_146",hme="_searchInput_v7v52_150",ume="_optionsList_v7v52_173",pme="_noResults_v7v52_195",yme="_option_v7v52_173",kme="_optionHighlighted_v7v52_217",mme="_optionSelected_v7v52_222",fme="_optionDisabled_v7v52_228",gme="_optionLabel_v7v52_233",vme="_checkIcon_v7v52_240",Mme="_widthFull_v7v52_248",_me="_width64_v7v52_252",xme="_width80_v7v52_256",Lme="_width96_v7v52_260",ie={container:W3e,selectButton:G3e,disabled:K3e,error:Z3e,default:"_default_v7v52_38",outline:X3e,filled:Y3e,sm:J3e,md:Q3e,lg:eme,buttonContent:tme,label:ame,placeholder:nme,iconsContainer:ome,loadingSpinner:cme,spin:ime,arrowIcon:rme,arrowIconOpen:sme,dropdown:dme,searchContainer:lme,searchInput:hme,optionsList:ume,noResults:pme,option:yme,optionHighlighted:kme,optionSelected:mme,optionDisabled:fme,optionLabel:gme,checkIcon:vme,widthFull:Mme,width64:_me,width80:xme,width96:Lme},Ime=({options:e,value:t,onChange:n,placeholder:c="Sélectionner une option...",disabled:i=!1,loading:r=!1,error:s=!1,className:d="",size:l="md",variant:h="default",width:u="w-full"})=>{const[p,y]=k.useState(!1),[m,g]=k.useState(""),[f,M]=k.useState(0),[_,v]=k.useState({top:0,left:0,width:0}),L=k.useRef(null),w=k.useRef(null),C=k.useRef(null),b=k.useMemo(()=>m?e.filter(N=>N.label.toLowerCase().includes(m.toLowerCase())):e,[e,m]),x=e.find(N=>N.value===t),I=k.useCallback(()=>{if(L.current){const N=L.current.getBoundingClientRect();v({top:N.top,left:N.left,width:N.width})}},[]);k.useEffect(()=>(p&&(I(),window.addEventListener("scroll",I,!0),window.addEventListener("resize",I)),()=>{window.removeEventListener("scroll",I,!0),window.removeEventListener("resize",I)}),[p,I]),k.useEffect(()=>{const N=A=>{L.current&&!L.current.contains(A.target)&&w.current&&!w.current.contains(A.target)&&(y(!1),g(""))};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[]),k.useEffect(()=>{M(0)},[b]);const S=N=>{N.disabled||(n?.(N.value,N),y(!1),g(""))},j=N=>{g(N.target.value),p||y(!0)},$=N=>{if(!p){(N.key==="ArrowDown"||N.key==="Enter")&&y(!0);return}switch(N.key){case"ArrowDown":N.preventDefault(),M(A=>A<b.length-1?A+1:A);break;case"ArrowUp":N.preventDefault(),M(A=>A>0?A-1:A);break;case"Enter":N.preventDefault(),b[f]&&S(b[f]);break;case"Escape":y(!1),g("");break}},q=()=>[ie.selectButton,ie[l],ie[h],i?ie.disabled:"",s?ie.error:"",d].filter(Boolean).join(" "),H=()=>{switch(u){case"w-64":return ie.width64;case"w-80":return ie.width80;case"w-96":return ie.width96;default:return ie.widthFull}},D=(N,A)=>[ie.option,A===f?ie.optionHighlighted:"",N.value===t?ie.optionSelected:"",N.disabled?ie.optionDisabled:""].filter(Boolean).join(" "),z={position:"fixed",top:_.top+(L.current?.offsetHeight||0)+4,left:_.left,width:_.width,zIndex:9999};return o.jsxs("div",{className:`${ie.container} ${H()}`,children:[o.jsx("button",{ref:L,className:q(),onClick:()=>!i&&y(!p),onKeyDown:$,tabIndex:i?-1:0,type:"button","aria-haspopup":"listbox","aria-expanded":p,disabled:i,children:o.jsxs("div",{className:ie.buttonContent,children:[o.jsx("span",{className:`${ie.label} ${x?"":ie.placeholder}`,children:x?x.label:c}),o.jsxs("div",{className:ie.iconsContainer,children:[r&&o.jsx("div",{className:ie.loadingSpinner}),o.jsx("svg",{className:`${ie.arrowIcon} ${p?ie.arrowIconOpen:""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]})}),p&&dw.createPortal(o.jsxs("div",{className:`${ie.dropdown} ${H()}`,style:z,ref:w,children:[o.jsx("div",{className:ie.searchContainer,children:o.jsx("input",{ref:C,type:"text",value:m,onChange:j,placeholder:"Rechercher...",className:ie.searchInput,autoFocus:!0})}),o.jsx("div",{className:ie.optionsList,children:b.length===0?o.jsx("div",{className:ie.noResults,children:"Aucun résultat trouvé"}):o.jsx("ul",{role:"listbox",children:b.map((N,A)=>o.jsx("li",{className:D(N,A),onClick:()=>S(N),onMouseEnter:()=>M(A),role:"option","aria-selected":N.value===t,"aria-disabled":N.disabled,children:o.jsxs("div",{className:ie.buttonContent,children:[o.jsx("span",{className:ie.optionLabel,title:N.label,children:N.label}),N.value===t&&o.jsx("svg",{className:ie.checkIcon,fill:"currentColor",viewBox:"0 0 20 20",children:o.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})]})},N.value))})})]}),document.body)]})},bme="_container_uq7pt_1",wme="_item_uq7pt_7",Cme="_mainValue_uq7pt_13",Nme="_label_uq7pt_17",jme="_subValue_uq7pt_22",Sme="_subValueWrapper_uq7pt_27",$me="_subSeparator_uq7pt_32",Ee={container:bme,item:wme,mainValue:Cme,label:Nme,subValue:jme,subValueWrapper:Sme,subSeparator:$me},qme=({dms:e,stats:t=[],itemWidth:n="120px",valueFontSize:c="28px",valueFontWeight:i=700,subFontSize:r="16px",subFontWeight:s=600,backgroundColor:d="#ffffff",labelColor:l="#6b7280",valueColor:h="#000000"})=>{const u=(p,y,m)=>{const[g,f]=p.split("/").map(M=>M.trim());return o.jsxs("span",{className:Ee.subValueWrapper,children:[o.jsx("span",{className:Ee.subLeft,style:{color:y},children:g}),o.jsx("span",{className:Ee.subSeparator,children:" / "}),o.jsx("span",{className:Ee.subRight,style:{color:m},children:f})]})};return o.jsxs("div",{className:Ee.container,style:{backgroundColor:d},children:[e&&o.jsxs("div",{className:Ee.item,style:{flex:`1 1 ${n}`},children:[o.jsx("div",{className:Ee.mainValue,style:{fontSize:c,fontWeight:i,color:h},children:e}),o.jsx("div",{className:Ee.label,style:{color:l},children:"DMS"})]}),t.map((p,y)=>o.jsxs("div",{className:Ee.item,style:{flex:`1 1 ${n}`},children:[o.jsx("div",{className:Ee.mainValue,style:{fontSize:c,fontWeight:i,color:h},children:p.value}),o.jsx("div",{className:Ee.label,style:{color:l},children:p.label}),o.jsx("div",{className:Ee.subValue,style:{fontSize:r,fontWeight:s},children:p.subValue&&u(p.subValue,p.subLeftColor,p.subRightColor)})]},y))]})},Ame="_encours_16ist_1",zme="_header_16ist_19",Vme="_iconWrap_16ist_27",Pme="_title_16ist_36",Tme="_items_16ist_47",Hme="_spaceEvenly_16ist_56",Dme="_item_16ist_47",Bme="_valueContainer_16ist_86",Rme="_value_16ist_86",Fme="_label_16ist_108",nt={encours:Ame,header:zme,iconWrap:Vme,title:Pme,items:Tme,spaceEvenly:Hme,item:Dme,valueContainer:Bme,value:Rme,label:Fme},Cc=e=>typeof e=="number"?`${e}px`:typeof e=="string"?e:void 0;function Eme(e,t){const n={},c={};return e.valueColor&&(n.color=e.valueColor),e.valueFontSize!==void 0?n.fontSize=Cc(e.valueFontSize):t.defaultValueFontSize!==void 0&&(n.fontSize=Cc(t.defaultValueFontSize)),e.valueFontWeight!==void 0?n.fontWeight=e.valueFontWeight:t.defaultValueFontWeight!==void 0&&(n.fontWeight=t.defaultValueFontWeight),e.labelColor&&(c.color=e.labelColor),e.labelFontSize!==void 0?c.fontSize=Cc(e.labelFontSize):t.defaultLabelFontSize!==void 0&&(c.fontSize=Cc(t.defaultLabelFontSize)),e.labelFontWeight!==void 0?c.fontWeight=e.labelFontWeight:t.defaultLabelFontWeight!==void 0&&(c.fontWeight=t.defaultLabelFontWeight),{valueStyle:n,labelStyle:c}}function Ome(){return o.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[o.jsx("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"1.4"}),o.jsx("path",{d:"M8 12h8",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})}function Ume(e){const{title:t,titleColor:n,titleFontSize:c,titleFontWeight:i,icon:r,iconSize:s=18,iconColor:d,defaultValueFontSize:l,defaultValueFontWeight:h,defaultLabelFontSize:u,defaultLabelFontWeight:p,data:y,style:m,bg:g="#ffffff",width:f,gap:M,className:_,ariaLabel:v}=e,L=r?kt[r]:void 0,w={background:g,width:Cc(f),...m},C={};n&&(C.color=n),c!==void 0&&(C.fontSize=Cc(c)),i!==void 0&&(C.fontWeight=i);const b={};return d&&(b.color=d),o.jsxs("section",{className:`${nt.encours} ${_??""}`,style:w,"aria-label":v??t,children:[o.jsxs("div",{className:nt.header,children:[o.jsx("div",{className:nt.iconWrap,"aria-hidden":!0,style:b,children:L?o.jsx(L,{size:typeof s=="number"?s:void 0}):o.jsx(Ome,{})}),o.jsx("div",{className:nt.title,style:C,children:t})]}),o.jsx("div",{className:`${nt.items} ${M===void 0?nt.spaceEvenly:""}`,role:"list",style:M!==void 0?{gap:`${M}px`}:{},children:y.map((x,I)=>{const{valueStyle:S,labelStyle:j}=Eme(x,{defaultValueFontSize:l,defaultValueFontWeight:h,defaultLabelFontSize:u,defaultLabelFontWeight:p});return o.jsx("div",{className:nt.item,role:"listitem",style:{...x.background?{background:x.background}:{},...x.width?{width:Cc(x.width)}:{}},children:o.jsxs("div",{className:nt.valueContainer,children:[o.jsx("div",{className:nt.value,style:S,children:x.value}),x.label&&o.jsx("div",{className:nt.label,style:j,children:x.label})]})},`${String(x.label??x.value)}-${I}`)})})]})}const Wme=e=>Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 -960 960 960",...e},Z.createElement("path",{d:"M480-360 280-559h400z"})),Gme=k.memo(Wme),Kme=e=>Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 -960 960 960",...e},Z.createElement("path",{d:"m280-400 200-201 200 201z"})),Zme=k.memo(Kme),Xme=e=>Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 16 16",...e},Z.createElement("path",{fill:"#0087BD",d:"M3 14a.96.96 0 0 1-.7-.3.96.96 0 0 1-.3-.7V3q0-.4.3-.7T3 2h10q.4 0 .7.3t.3.7v10q0 .4-.3.7t-.7.3zm3.983-3.55q.1 0 .192-.033a.36.36 0 0 0 .158-.117l4.117-4.133q.15-.15.15-.35a.54.54 0 0 0-.15-.367.52.52 0 0 0-.358-.133.5.5 0 0 0-.359.15l-3.75 3.75L5.35 7.583a.48.48 0 0 0-.7 0q-.15.15-.15.367 0 .216.15.35l1.983 2a.48.48 0 0 0 .35.15"})),Yme=k.memo(Xme),Jme=e=>Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 16 16",...e},Z.createElement("path",{fill:"#1E2122",d:"M3 14a.96.96 0 0 1-.7-.3.96.96 0 0 1-.3-.7V3q0-.4.3-.7T3 2h10q.4 0 .7.3t.3.7v10q0 .4-.3.7t-.7.3zm0-1h10V3H3z"})),Qme=k.memo(Jme),e6e=({items:e,onSave:t,loading:n,disabled:c,saveLabel:i,savingLabel:r,buttonTitle:s,size:d=16,colors:l={bg:"#DADADA",activeBg:"var(--color-primary)",circle:"#FFFFFF",icon:"#1C1B1F",icon2:"#FFFFFF"},style:h,a11yConfig:u})=>{const[p,y]=k.useState(!1),[m,g]=k.useState(e),[f,M]=k.useState(!1);if(k.useEffect(()=>{M(!0)},[]),k.useEffect(()=>{g(e)},[e]),!f)return null;const _=(w,C)=>{C<4||g(b=>b.map(x=>x.component_key===w?{...x,visible:!x.visible}:x))},v=()=>{t(m),y(!1)},L=Y(u,s);return o.jsxs("div",{style:{position:"relative",display:"inline-block",...h},children:[o.jsxs("div",{onClick:()=>{c||y(!p)},style:{display:"flex",alignItems:"center",cursor:c?"not-allowed":"pointer",borderRadius:4,transition:"background 0.2s"},title:L,children:[o.jsx($S,{width:d,height:d,fill:l?.icon||"currentColor",style:{transition:"color 0.2s"}}),p?o.jsx(Zme,{width:d,height:d,fill:l?.icon||"currentColor"}):o.jsx(Gme,{width:d,height:d,fill:l?.icon||"currentColor"})]}),p&&o.jsxs("div",{style:{position:"absolute",top:"120%",right:0,minWidth:260,background:"#fff",borderRadius:"0.25rem",boxShadow:"0px 3px 7px 0px rgba(17, 20, 21, 0.05),0px 14px 14px 0px rgba(17, 20, 21, 0.04),0px 30px 18px 0px rgba(17, 20, 21, 0.03), 0px 54px 22px 0px rgba(17, 20, 21, 0.01),0px 85px 24px 0px rgba(17, 20, 21, 0)",zIndex:235465456,padding:"0 0 0.5rem 0"},children:[o.jsx("ul",{style:{listStyle:"none",padding:0,margin:0},children:m.map((w,C)=>o.jsxs(k.Fragment,{children:[o.jsxs("li",{onClick:()=>_(w.component_key,C),style:{display:"flex",alignItems:"center",padding:"0.5rem",cursor:C<4?"not-allowed":"pointer",transition:"background 0.2s"},onMouseEnter:b=>{C>=4&&(b.currentTarget.style.background="#F9FAFB")},onMouseLeave:b=>{C>=4&&(b.currentTarget.style.background="transparent")},children:[o.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",marginRight:8,flexShrink:0},children:w.visible?o.jsx(Yme,{width:20,height:20,fill:l?.activeBg||"var(--color-primary, #008FBB)"}):o.jsx(Qme,{width:20,height:20,fill:"#D1D5DB"})}),o.jsx("span",{style:{fontSize:"14px",color:"#111827",fontWeight:400,userSelect:"none"},children:w.label})]}),C===3&&o.jsx("div",{style:{height:1,background:"#E5E7EB",margin:"4px 0"}})]},w.component_key))}),o.jsx("div",{style:{padding:"12px 16px 0 16px",display:"flex",justifyContent:"flex-end"},children:o.jsx("button",{type:"button",onClick:v,disabled:n,style:{padding:"6px 16px",borderRadius:4,border:"none",background:"var(--color-primary, #008FBB)",color:"#fff",fontSize:"14px",fontWeight:500,cursor:n?"not-allowed":"pointer",transition:"opacity 0.2s",opacity:n?.7:1},children:n?r:i})})]})]})},t6e="_container_zhny9_1",a6e="_card_zhny9_15",n6e="_footer_zhny9_33",o6e="_noPaddingMobile_zhny9_51",Q1={container:t6e,card:a6e,footer:n6e,noPaddingMobile:o6e},c6e="_board_71fer_1",i6e="_clickable_71fer_21",r6e="_sideBar_71fer_26",s6e="_boardContent_71fer_32",d6e="_orange_71fer_40",l6e="_red_71fer_44",h6e="_green_71fer_48",u6e="_grey_71fer_52",p6e="_lightGrey_71fer_56",y6e="_big_71fer_61",k6e="_medium_71fer_66",m6e="_headerRow_71fer_70",f6e="_iconWrapper_71fer_75",g6e="_headerTitle_71fer_80",v6e="_valueArea_71fer_89",M6e="_titleWhite_71fer_99",_6e="_titleBlack_71fer_103",x6e="_valueWhite_71fer_108",L6e="_valueBlack_71fer_112",I6e="_valueBlue_71fer_116",b6e="_bars_71fer_121",w6e="_bar_71fer_121",C6e="_barDark_71fer_135",N6e="_barDim_71fer_139",Ue={board:c6e,clickable:i6e,sideBar:r6e,boardContent:s6e,orange:d6e,red:l6e,green:h6e,grey:u6e,lightGrey:p6e,big:y6e,medium:k6e,headerRow:m6e,iconWrapper:f6e,headerTitle:g6e,valueArea:v6e,titleWhite:M6e,titleBlack:_6e,valueWhite:x6e,valueBlack:L6e,valueBlue:I6e,bars:b6e,bar:w6e,barDark:C6e,barDim:N6e},j6e=({endingDark:e=!1,lightCount:t=5,className:n=""})=>{const c=Math.max(0,Math.min(5,Math.floor(t)));return o.jsx("div",{className:`${Ue.bars} ${n} bars-data-board`,children:Array.from({length:5}).map((i,r)=>o.jsx("span",{className:`${Ue.bar} ${r<c?"":e?Ue.barDark:Ue.barDim}`},r))})},jt=({a11yConfig:e,iconName:t,label:n,value:c,backgroundColor:i="green",bars:r,lightBars:s=5,size:d="big",valueScale:l,width:h,height:u,className:p="",style:y,titleColor:m="white",valueColor:g="white",titleFontSize:f,titleFontWeight:M,valueFontSize:_,valueFontWeight:v,barColor:L,justifyContent:w="space-between",alignItems:C="flex-start",cardGap:b="",onClick:x,iconColor:I,titleKey:S})=>{const j=r!=="none",$=r==="endingDark",{padding:q,...H}=y||{},D=h===void 0&&u===void 0&&i===void 0&&Object.keys(H).length===0?void 0:{...h!==void 0?{width:h}:{},...u!==void 0?{height:u}:{},...i!==void 0?{backgroundColor:i}:{},...H},z=`${Ue.board} ${Ue[d]} ${p}`;return o.jsxs("div",{className:z,onClick:x,style:l!==void 0?{...D,"--ds-value-scale":l}:D,children:[L&&o.jsx("div",{className:Ue.sideBar,style:{backgroundColor:L}}),o.jsxs("div",{className:Ue.boardContent,style:{padding:q,gap:b},children:[o.jsxs("div",{className:Ue.headerRow,style:{justifyContent:w,alignItems:C},children:[t&&o.jsx("div",{className:Ue.iconWrapper,style:{color:I},children:t}),o.jsx("div",{className:`${Ue.headerTitle} header-title-data-board`,children:o.jsx("span",{title:Y(e,S),"aria-label":e?.description,style:{color:m,...f?{fontSize:f}:{},...M?{fontWeight:M}:{}},children:n})}),j?o.jsx(j6e,{endingDark:$,lightCount:s}):null]}),o.jsx("div",{className:Ue.valueArea,style:{color:g,..._?{fontSize:_}:{},...v?{fontWeight:v}:{}},children:c})]})]})},S6e="_wrapper_1ydle_10",$6e="_hosp_1ydle_19",q6e="_headerRow_1ydle_54",A6e="_iconWrapper_1ydle_61",z6e="_headerTitle_1ydle_67",V6e="_hospValue_1ydle_76",P6e="_side_1ydle_88",T6e="_mini_1ydle_100",H6e="_miniLabel_1ydle_131",D6e="_miniValue_1ydle_140",B6e="_miniBars_1ydle_150",R6e="_bars_1ydle_155",F6e="_bar_1ydle_155",E6e="_barDark_1ydle_169",O6e="_barDim_1ydle_173",Ae={wrapper:S6e,hosp:$6e,headerRow:q6e,iconWrapper:A6e,headerTitle:z6e,hospValue:V6e,side:P6e,mini:T6e,miniLabel:H6e,miniValue:D6e,miniBars:B6e,bars:R6e,bar:F6e,barDark:E6e,barDim:O6e},U6e=({endingDark:e=!1,lightCount:t=5,className:n=""})=>{const c=Math.max(0,Math.min(5,Math.floor(t)));return o.jsx("div",{className:`${Ae.bars} ${n} bars-data-board`,children:Array.from({length:5}).map((i,r)=>o.jsx("span",{className:`${Ae.bar} ${r<c?"":e?Ae.barDark:Ae.barDim}`},r))})},Yq=({left:e,right:t,className:n="",style:c,miniTilesCount:i=3})=>{const r=e.bars??"endingDark",s=r!=="none",d=r==="endingDark",l={...c,"--mini-tiles-count":i};return o.jsxs("div",{className:`${Ae.wrapper} ${n} data-four-boards`,style:l,children:[o.jsxs("div",{className:`${Ae.hosp} ${e.className||""}`,onClick:e.onClick,style:{...e.width?{width:e.width}:{},...e.height?{height:e.height}:{},...e.backgroundColor?{backgroundColor:e.backgroundColor}:{},...e.style||{}},title:Y(e.a11yConfig,e.titleKey),children:[o.jsxs("div",{className:Ae.headerRow,children:[o.jsxs("div",{className:`${Ae.iconWrapper} icon-wrapper-data-four-boards`,children:[e.iconName&&o.jsx("span",{style:{color:e.iconColor},children:e.iconName}),o.jsx("span",{className:Ae.headerTitle,style:{color:e.titleColor||"white",...e.titleFontSize?{fontSize:e.titleFontSize}:{},...e.titleFontWeight?{fontWeight:e.titleFontWeight}:{}},title:Y(e.a11yConfig,e.titleKey),children:e.label})]}),s?o.jsx(U6e,{endingDark:d,lightCount:e.lightBars??5}):null]}),o.jsx("div",{className:Ae.hospValue,style:{color:e.valueColor||"white",...e.valueScale!==void 0?{"--ds-value-scale":e.valueScale}:{},...e.valueFontSize?{fontSize:e.valueFontSize}:{},...e.valueFontWeight?{fontWeight:e.valueFontWeight}:{}},children:e.value})]}),o.jsx("div",{className:Ae.side,children:t.map((h,u)=>o.jsxs("div",{className:`${Ae.mini} ${h.className||""} icon-wrapper-data-four-boards`,onClick:h.onClick,style:{...h.width?{width:h.width}:{},...h.height?{height:h.height}:{},...h.backgroundColor?{backgroundColor:h.backgroundColor}:{},...h.style||{}},title:Y(h.a11yConfig,h.titleKey),children:[o.jsxs("span",{className:Ae.miniLabel,style:{color:h.titleColor||"white",textAlign:"right",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",...h.titleFontSize?{fontSize:h.titleFontSize}:{},...h.titleFontWeight?{fontWeight:h.titleFontWeight}:{}},title:Y(h.a11yConfig,h.titleKey),children:[h.iconName&&o.jsx("span",{style:{color:h.iconColor},children:h.iconName}),h.label]}),o.jsx("span",{className:`${Ae.miniValue} mini-value-data-four-boards`,style:{color:h.valueColor||"white",textAlign:"right",...h.valueScale!==void 0?{"--ds-value-scale":h.valueScale}:{},...h.valueFontSize?{fontSize:h.valueFontSize}:{},...h.valueFontWeight?{fontWeight:h.valueFontWeight}:{}},children:h.value}),o.jsx("div",{className:Ae.miniBars})]},h.id??`${h.label}-${u}`))})]})},W6e=({items:e,footerLabel:t,width:n,height:c,size:i=320,style:r,className:s="",backgroundColor:d,titleFontSize:l,titleFontWeight:h,valueFontSize:u,valueFontWeight:p,noPaddingLeftRight:y=!1,onItemClick:m})=>{const g={width:n??i,height:c,backgroundColor:d??"var(--ds-navy)",...r},f=e[0],M=e[1],_=e.slice(2,5);return o.jsxs("div",{style:g,className:`${Q1.container} ${y?Q1.noPaddingMobile:""} ${s}`,children:[o.jsxs("div",{className:Q1.card,children:[f?o.jsx(jt,{a11yConfig:f.a11yConfig,label:f.label,value:f.value,backgroundColor:f.backgroundColor,bars:f.bars,lightBars:f.lightBars,size:f.size??"big",valueScale:f.valueScale,width:f.width,height:f.height,titleColor:"white",valueColor:"white",titleFontSize:f.titleFontSize??l,titleFontWeight:f.titleFontWeight??h,valueFontSize:f.valueFontSize??u,valueFontWeight:f.valueFontWeight??p,titleKey:f.titleKey,onClick:v=>m?.(0,v)}):null,M&&_.length>0?o.jsx(Yq,{left:{a11yConfig:M.a11yConfig,id:M.id,label:M.label,value:M.value,backgroundColor:M.backgroundColor,bars:M.bars,lightBars:M.lightBars,valueScale:M.valueScale,width:M.width,height:M.height,titleFontSize:M.titleFontSize??l,titleFontWeight:M.titleFontWeight??h,valueFontSize:M.valueFontSize??u,valueFontWeight:M.valueFontWeight??p,titleKey:M.titleKey,onClick:v=>m?.(1,v)},right:_.map((v,L)=>({a11yConfig:v.a11yConfig,id:v.id,label:v.label,value:v.value,backgroundColor:v.backgroundColor,bars:v.bars,lightBars:v.lightBars,valueScale:v.valueScale,width:v.width,height:v.height,titleFontSize:v.titleFontSize??l,titleFontWeight:v.titleFontWeight??h,valueFontSize:v.valueFontSize??u,valueFontWeight:v.valueFontWeight??p,titleKey:v.titleKey,onClick:w=>m?.(2+L,w)}))}):M&&_.length===0?o.jsx(jt,{a11yConfig:M.a11yConfig,label:M.label,value:M.value,backgroundColor:M.backgroundColor,bars:M.bars,lightBars:M.lightBars,size:M.size??"big",valueScale:M.valueScale,width:M.width,height:M.height,titleColor:"white",valueColor:"white",titleFontSize:M.titleFontSize??l,titleFontWeight:M.titleFontWeight??h,valueFontSize:M.valueFontSize??u,valueFontWeight:M.valueFontWeight??p,onClick:v=>m?.(1,v)}):null]}),t&&o.jsx("div",{className:Q1.footer,children:t})]})},G6e=({x:e,y:t,width:n,payload:c,fontSize:i,fontWeight:r,stroke:s})=>o.jsx("g",{transform:`translate(${e},${t})`,children:o.jsx("foreignObject",{x:-n,y:-20,width:n,height:40,style:{overflow:"visible"},children:o.jsx("div",{style:{fontSize:i,fontWeight:r,color:s,lineHeight:"1.1",wordBreak:"break-word",display:"flex",justifyContent:"flex-end",textAlign:"right",alignItems:"center",height:"100%",paddingRight:"8px"},children:c.value})})}),K6e=({data:e,height:t=360,barColor:n="#0284C7",tooltipEnabled:c=!0,backgroundColor:i="#ffffff",legendTextColor:r="#000",barHeight:s=100,yAxisWidth:d=240,fontSize:l="12px",fontWeight:h="400",wrapLabels:u=!1,domain:p})=>{const y=(g,f,M)=>{if(g==null||g==="")return"";const _=M?.payload?.percentage;return typeof _=="number"&&Number.isFinite(_)?`${g} (${_.toFixed(3)}%)`:g},m=g=>g==null||g===""?"":`${g}%`;return o.jsx("div",{style:{backgroundColor:i},children:o.jsx(a.ResponsiveContainer,{width:"100%",height:t,children:o.jsxs(a.BarChart,{data:e,layout:"vertical",margin:{top:8,right:48,bottom:8,left:0},children:[o.jsx(a.CartesianGrid,{opacity:.4,stroke:"#E5E7EB",vertical:!1}),o.jsx(a.XAxis,{type:"number",domain:p,axisLine:!1,tickLine:!1,fontSize:l,fontWeight:h,stroke:r}),o.jsx(a.YAxis,{type:"category",dataKey:"label",stroke:r,axisLine:!1,tickLine:!1,width:d,interval:0,fontSize:l,fontWeight:h,tick:u?o.jsx(G6e,{}):void 0}),c&&o.jsx(a.Tooltip,{formatter:y}),o.jsx(a.Bar,{dataKey:"value",fill:n,radius:0,barSize:s,children:o.jsx(a.LabelList,{dataKey:"percentage",position:"right",offset:10,formatter:m,fill:r,fontSize:l,fontWeight:h})})]})})})},Z6e="_menu_10i6j_1",X6e="_menuRow_10i6j_18",Y6e="_separator_10i6j_33",J6e="_rowLabel_10i6j_39",Q6e="_rowLeadingIcon_10i6j_47",e8e="_rowIcon_10i6j_54",Bc={menu:Z6e,menuRow:X6e,separator:Y6e,rowLabel:J6e,rowLeadingIcon:Q6e,rowIcon:e8e},t8e=k.forwardRef(function({isVisible:t,onClose:n,items:c,style:i,position:r,bg:s},d){const l=k.useRef(null),h=d||l;if(k.useEffect(()=>{if(!t)return;const y=m=>{h.current&&!h.current.contains(m.target)&&n?.()};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[t,n]),!t)return null;const p={...{top:r?.top,left:r?.left,right:r?.right,bottom:r?.bottom},...s&&{backgroundColor:s},...i};return o.jsx("div",{ref:h,role:"menu",className:Bc.menu,style:p,children:c.map(y=>{if(y.type==="separator")return o.jsx("hr",{className:Bc.separator},y.id);const m=y,g=m.color?{color:m.color}:{},f=m.closeOnClick!==!1;return o.jsxs("button",{role:"menuitem",className:Bc.menuRow,style:g,onClick:()=>{m.onClick?.(),f&&n?.()},children:[o.jsxs("span",{className:Bc.rowLabel,children:[m.leadingIcon&&o.jsx("span",{className:Bc.rowLeadingIcon,children:m.leadingIcon}),o.jsx("span",{children:m.label})]}),m.icon&&o.jsx("span",{className:Bc.rowIcon,children:m.icon})]},m.id)})})}),Jq=({user:e,logoutHref:t,logoutTarget:n="_self",onLogout:c,profileHref:i,profileLinkTarget:r="_self",backgroundColor:s="transparent",textColor:d="inherit",roleColor:l="#888",avatarSize:h="32px",padding:u="10px",gap:p="12px",emailFontSize:y="14px",emailFontWeight:m=600,roleFontSize:g="12px",roleFontWeight:f,avatarColor:M="#5b8fb9",backgroundColorAvatar:_="#f1f4f5",dropdownMenuItems:v,dropdownMenuStyle:L,dropdownMenuOffset:w,statusDotColor:C,a11yConfig:b,style:x,className:I=""})=>{const{user:S}=dt(),j=e||S,{currentTheme:$,switchTheme:q}=pL(),H=k.useRef(null),D=k.useRef(null),[z,N]=k.useState(!1),[A,R]=k.useState({}),P=k.useMemo(()=>{const F=[],ee=({variant:oe})=>oe==="sun"?o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("circle",{cx:"12",cy:"12",r:"4"})}):o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})});i&&(F.push({id:"profile",type:"action",label:"Mon profil",onClick:()=>{typeof window>"u"||(r==="_blank"?window.open(i,"_blank","noopener,noreferrer"):window.location.assign(i))}}),F.push({id:"sep-profile",type:"separator"}));const re=$==="dark";return F.push({id:"theme",type:"action",label:re?"Mode clair":"Mode sombre",icon:o.jsx(ee,{variant:re?"sun":"moon"}),onClick:()=>{q(re?"light":"dark")}}),(t||c)&&(F.push({id:"sep-theme",type:"separator"}),F.push({id:"logout",type:"action",label:"Se déconnecter",danger:!0,onClick:()=>{if(t){if(typeof window>"u")return;n==="_blank"?window.open(t,"_blank","noopener,noreferrer"):window.location.assign(t);return}c?.()}})),F},[$,t,n,c,i,r,q]),T=v??P,E=()=>{if(!H.current){N(F=>!F);return}if(!z){const F=H.current.getBoundingClientRect(),ee=window.innerWidth,re=window.innerHeight,oe=200,ke=200,Le=4,ve=w?.x??0,qe=w?.y??0,ue=ee-F.right>=oe+Le;R(ue?{top:F.bottom-ke+qe,left:F.right+Le+ve}:{bottom:re-F.top+qe,left:F.left+ve})}N(F=>!F)};if(k.useEffect(()=>{if(!z||!H.current)return;const F=()=>{const ee=H.current.getBoundingClientRect(),re=window.innerWidth,oe=window.innerHeight,ke=200,Le=200,ve=4,qe=w?.x??0,je=w?.y??0,be=re-ee.right>=ke+ve;R(be?{top:ee.bottom-Le+je,left:ee.right+ve+qe}:{bottom:oe-ee.top+je,left:ee.left+qe})};return window.addEventListener("resize",F),window.addEventListener("orientationchange",F),()=>{window.removeEventListener("resize",F),window.removeEventListener("orientationchange",F)}},[z,w]),k.useEffect(()=>{if(!z||!H.current||!D.current)return;const F=()=>{const re=H.current.getBoundingClientRect(),oe=D.current.getBoundingClientRect(),ke=w?.x??0,Le=w?.y??0;R(ve=>ve.left!==void 0&&ve.top!==void 0&&ve.left>=re.right-1?{top:re.bottom-oe.height+Le,left:ve.left+ke}:ve)},ee=requestAnimationFrame(()=>{setTimeout(F,0)});return()=>cancelAnimationFrame(ee)},[z,w]),!j)return null;const X=j,ae=parseInt(h,10)||40,J=`${ae*.375}px`,Ie=`${ae*1.375}px`,me=`${ae*.2}px`,$e=`${ae*.6}px`,se=()=>{const F=parseInt(h,10)||40,ee=Math.max(8,F*.34375),re=Math.max(2,F*.05);return o.jsxs(o.Fragment,{children:[o.jsxs("div",{style:{position:"relative",flexShrink:0,userSelect:"none"},children:[X.image?o.jsx("img",{src:X.image,alt:`${X.prenom} ${X.nom}`,style:{width:h,height:h,borderRadius:"50%",objectFit:"cover",userSelect:"none"}}):o.jsxs("div",{style:{width:h,height:h,position:"relative",borderRadius:"50%",backgroundColor:_,overflow:"hidden",userSelect:"none"},children:[o.jsx("div",{style:{width:J,height:J,borderRadius:"50%",backgroundColor:M,position:"absolute",top:me,left:"50%",transform:"translateX(-50%)",zIndex:2,userSelect:"none"}}),o.jsx("div",{style:{width:Ie,height:Ie,borderRadius:"50%",backgroundColor:M,position:"absolute",top:$e,left:"50%",transform:"translateX(-50%)",zIndex:1,userSelect:"none"}})]}),C&&o.jsx("div",{style:{position:"absolute",bottom:re,right:re,width:`${ee}px`,height:`${ee}px`,borderRadius:"50%",backgroundColor:C,border:"2px solid white",zIndex:10}})]}),o.jsxs("div",{style:{display:"flex",flexDirection:"column",minWidth:0,flex:1},children:[o.jsx("span",{style:{fontWeight:m,fontSize:y,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:X.email,children:X.email}),o.jsx("span",{style:{color:l,fontSize:g,fontWeight:f,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:X.role,children:X.role})]})]})};return o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:H,className:`user-info ${I}`,style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:u,backgroundColor:s,gap:p,color:d,width:"100%",boxSizing:"border-box",cursor:"pointer",userSelect:"none",...x},onClick:E,title:Y(b,X.role),role:"button",tabIndex:0,children:o.jsx("div",{style:{display:"flex",alignItems:"center",gap:p,flex:1,minWidth:0},children:o.jsx(se,{})})}),o.jsx(t8e,{ref:D,isVisible:z,onClose:()=>N(!1),items:T,style:L,position:A})]})},a8e="_navItem_16uqf_1",n8e="_label_16uqf_14",o8e="_icon_16uqf_26",l1={navItem:a8e,label:n8e,icon:o8e},Zw=({label:e,labelKey:t,onClick:n,href:c,isActive:i,icon:r,style:s,className:d="",highlightColor:l="#00aec7",color:h="#333",activeColor:u="#00aec7",highlightBackgroundColor:p="rgba(0, 0, 0, 0.05)",fontSize:y="15px",fontWeight:m="500",sidebarCollapsed:g=!1,padding:f="10px 16px",borderWidth:M="4px",iconGap:_="12px",disabled:v=!1,disabledColor:L,a11yConfig:w})=>{const C=()=>{v||n?.()},b=o.jsxs(o.Fragment,{children:[r&&o.jsx("span",{className:l1.icon,style:{marginRight:g?0:_},children:r}),!g&&o.jsx("span",{className:l1.label,children:e})]}),x=()=>{if(!i)return"transparent";const S=j=>{const $=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(j);return $?{r:parseInt($[1],16),g:parseInt($[2],16),b:parseInt($[3],16)}:null};if(l.startsWith("#")){const j=S(l);if(j)return`rgba(${j.r}, ${j.g}, ${j.b}, 0.08)`}else if(l.startsWith("rgb")){const j=l.match(/\d+/g);if(j&&j.length>=3)return`rgba(${j[0]}, ${j[1]}, ${j[2]}, 0.08)`}return p},I={onClick:C,className:`${l1.navItem} ${i?l1.active:""} ${d} ${v?l1.disabled:""}`,style:{padding:f,color:i?u:v?L||"#999":h,borderLeft:i?`${M} solid ${l}`:`${M} solid transparent`,backgroundColor:x(),fontSize:y,fontWeight:m,cursor:v?"not-allowed":"pointer",textDecoration:"none",...s},"aria-disabled":v};return c&&!n&&!v?o.jsx("a",{href:c,...I,title:Y(w,t),children:b}):o.jsx("div",{...I,role:n?"button":void 0,tabIndex:n&&!v?0:void 0,title:Y(w,t),children:b})},c8e="_navbar_agnn2_1",i8e="_topSection_agnn2_9",r8e="_sectionsContainer_agnn2_14",s8e="_sectionTitle_agnn2_20",d8e="_sectionItems_agnn2_25",l8e="_bottomSection_agnn2_30",h8e="_versionContainer_agnn2_49",lt={navbar:c8e,topSection:i8e,sectionsContainer:r8e,sectionTitle:s8e,sectionItems:d8e,bottomSection:l8e,versionContainer:h8e},u8e=({logoProps:e,logoSpacing:t,navItems:n,padding:c="24px 16px",sectionSpacing:i="32px",itemSpacing:r="4px",backgroundColor:s="#fff",highlightColor:d="#00aec7",highlightBackgroundColor:l="rgba(0, 0, 0, 0.05)",version:h,navSectionStyle:u,navLinkStyle:p,navItemPadding:y="10px 16px",navItemBorderWidth:m="4px",navItemIconGap:g="12px",navItemFontSize:f="15px",navItemFontWeight:M="500",navItemColor:_,sectionTitlePadding:v="16px",sectionTitleFontSize:L="11px",sectionTitleColor:w="#999",sectionTitleWeight:C="500",versionFontSize:b="12px",versionFontWeight:x="400",versionColor:I="#999",userInfoProps:S,style:j,className:$="",width:q="280px",showLogo:H=!0,versionA11yConfig:D,displayNone:z=!1})=>{const N=dt(),A=N.activeNav,R=N.setActiveNav,P=N.user,T=S.user||P;return o.jsxs("div",{className:`${lt.navbar} ${$}`,style:{width:q,backgroundColor:s,padding:c,display:z?"none":"flex",...j},children:[o.jsxs("div",{className:lt.topSection,style:{gap:t},children:[H&&o.jsx("div",{className:lt.logoContainer,children:o.jsx(uL,{...e})}),o.jsx("div",{className:lt.sectionsContainer,style:{gap:i},children:n.map((E,X)=>o.jsxs("div",{className:lt.section,children:[E.title&&o.jsx("div",{className:lt.sectionTitle,title:Y(E.a11yConfig,E.titleKey),style:{fontSize:L,color:w,padding:v,fontWeight:C,border:"4px solid transparent",...u},children:E.title}),o.jsx("div",{className:lt.sectionItems,style:{gap:r},children:E.items.map(ae=>o.jsx(Zw,{...ae,isActive:ae.isActive===null?ae.isActive:A===ae.id,onClick:()=>{ae.onClick&&ae.onClick(),ae.isActive==null&&R(ae.id)},highlightColor:d,activeColor:d,highlightBackgroundColor:l,padding:y,borderWidth:m,iconGap:g,fontSize:f,fontWeight:M,color:_,style:p},ae.id))})]},X))})]}),o.jsxs("div",{className:lt.bottomSection,style:{gap:t},children:[o.jsx(Jq,{...S,user:T}),h&&o.jsx("div",{className:lt.versionContainer,title:Y(D,h),style:{fontSize:b,fontWeight:x,color:I},children:h})]})]})},p8e="_container_4qege_1",y8e="_titleContainer_4qege_10",k8e="_title_4qege_10",m8e="_inlineToggleContainer_4qege_24",f8e="_rightContentContainer_4qege_30",h1={container:p8e,titleContainer:y8e,title:k8e,inlineToggleContainer:m8e,rightContentContainer:f8e},g8e=({className:e="",style:t,fontSize:n="20px",fontWeight:c="bold",color:i="#000",padding:r="0",margin:s,backgroundColor:d,width:l,height:h,border:u,borderRadius:p,navItems:y,formatTitle:m=M=>M,rightContent:g,inlineToggle:f})=>{const{activeNav:M}=dt(),_=y.find(L=>L.id===M),v=m(_?_.label:M);return v?o.jsxs("div",{className:`${h1.container} ${e}`,style:{padding:r,margin:s,backgroundColor:d,width:l,height:h,border:u,borderRadius:p,...t},children:[o.jsxs("div",{className:h1.titleContainer,children:[o.jsx("div",{className:h1.title,style:{fontSize:n,fontWeight:c,color:i},children:v}),f&&o.jsx("div",{className:h1.inlineToggleContainer,children:f})]}),g&&o.jsx("div",{className:h1.rightContentContainer,children:g})]}):null},v8e="_navItem_1hg26_1",M8e="_navItemIcon_1hg26_21",_8e="_navItemLabel_1hg26_29",x8e="_navItemCount_1hg26_36",L8e="_navItemIndicator_1hg26_49",u1={navItem:v8e,navItemIcon:M8e,navItemLabel:_8e,navItemCount:x8e,navItemIndicator:L8e},Qq=({a11yConfig:e,label:t,isActive:n,onClick:c,href:i,labelKey:r,icon:s,count:d,activeColor:l="#00aec7",inactiveColor:h="#666",activeBackgroundColor:u="transparent",countBackgroundColor:p,countColor:y="#fff",countBorderRadius:m="10px",countPadding:g="2px 6px",countFontSize:f="12px",countFontWeight:M="500",indicatorColor:_="#00aec7",indicatorHeight:v="3px",padding:L="8px 4px",fontSize:w="14px",fontWeight:C="500",gap:b="8px",style:x,className:I="",disabled:S=!1,onNavigate:j})=>{const $=()=>{S||(c?.(),i&&(j?j(i):window.location.href=i))};return o.jsxs("div",{className:`${u1.navItem} ${I}`,onClick:$,title:Y(e,r),style:{gap:b,padding:L,color:n?l:h,backgroundColor:n?u:"transparent",fontSize:w,fontWeight:C,...x},children:[s&&o.jsx("span",{className:u1.navItemIcon,children:s}),o.jsx("span",{className:u1.navItemLabel,children:t}),d!==void 0&&o.jsx("span",{className:u1.navItemCount,style:{backgroundColor:p,color:y,borderRadius:m,padding:g,fontSize:f,fontWeight:M},children:d}),n&&!S&&o.jsx("div",{className:u1.navItemIndicator,style:{height:v,backgroundColor:_}})]})},I8e="_container_13hsa_1",b8e="_groupHeader_13hsa_8",w8e="_groupHeaderLeft_13hsa_18",C8e="_groupIcon_13hsa_23",N8e="_dropdown_13hsa_29",j8e="_item_13hsa_42",S8e="_itemIcon_13hsa_65",$8e="_chevron_13hsa_72",q8e="_chevronOpen_13hsa_79",ht={container:I8e,groupHeader:b8e,groupHeaderLeft:w8e,groupIcon:C8e,dropdown:N8e,item:j8e,itemIcon:S8e,chevron:$8e,chevronOpen:q8e},A8e=e=>Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 -960 960 960",...e},Z.createElement("path",{d:"M480-344 240-584l43-43 197 197 197-197 43 43z"})),V1=k.memo(A8e),eA=({groups:e,activeItemId:t,onItemClick:n,style:c,className:i,bgColor:r="transparent",color:s="var(--color-text)",headerBgColor:d="var(--color-indicator)",headerColor:l="var(--color-text)",headerBorderBottomColor:h="var(--color-border)",dropdownBgColor:u="var(--color-background)",itemBgColor:p="transparent",itemHoverBgColor:y="rgba(0,0,0,0.05)",itemColor:m="var(--color-text)",itemActiveColor:g="var(--color-primary)",itemActiveBorderColor:f="var(--color-primary)",itemDividerColor:M="var(--color-border)",iconColor:_="#555555",activeIconColor:v="var(--color-primary)",headerIconColor:L="var(--color-text)",chevronColor:w="var(--color-text)",iconSize:C=22,headerPadding:b="14px 20px",itemPadding:x="14px 20px",iconGap:I=14,borderRadius:S=0})=>{const[j,$]=k.useState(""),q=k.useRef(null);k.useEffect(()=>{const D=z=>{q.current&&!q.current.contains(z.target)&&$("")};return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[]);const H={backgroundColor:r,color:s,borderRadius:S,...c};return o.jsx("nav",{ref:q,className:[ht.container,i].filter(Boolean).join(" "),style:H,children:e.map(D=>{const z=j===D.id,N={backgroundColor:d,color:l,padding:b,borderBottom:`1px solid ${h}`,gap:I},A={backgroundColor:u};return o.jsxs("div",{children:[o.jsxs("div",{className:ht.groupHeader,style:N,onClick:()=>$(z?"":D.id),role:"button","aria-expanded":z,children:[o.jsxs("div",{className:ht.groupHeaderLeft,style:{gap:I},children:[D.icon&&o.jsx("span",{className:ht.groupIcon,style:{color:L,width:C,height:C},children:D.icon}),o.jsx("span",{children:D.label})]}),o.jsx("span",{className:[ht.chevron,z?ht.chevronOpen:""].join(" "),style:{color:w},children:o.jsx(V1,{width:18,height:18})})]}),z&&o.jsx("div",{className:ht.dropdown,style:A,children:D.items.map(R=>{const P=R.id===t,T={padding:x,gap:I,color:P?g:m,backgroundColor:p,"--item-border-width":P?"4px":"1px","--item-border-color":P?f:M};return o.jsxs("div",{className:ht.item,style:T,onClick:()=>{n?.(D.id,R.id),$("")},role:"menuitem",onMouseEnter:E=>{P||(E.currentTarget.style.backgroundColor=y)},children:[R.icon&&o.jsx("span",{className:ht.itemIcon,style:{color:P?v:_,width:C,height:C},children:R.icon}),o.jsx("span",{children:R.label})]},R.id)})})]},D.id)})})},z8e="_subheaderContent_1glo8_1",V8e="_navContainer_1glo8_11",P8e="_rightContent_1glo8_45",Ab={subheaderContent:z8e,navContainer:V8e,rightContent:P8e},T8e=({subNavItems:e,backgroundColor:t="transparent",padding:n="0",margin:c,width:i,height:r="auto",border:s,borderBottom:d="none",itemGap:l="24px",actionsGap:h="16px",itemPadding:u="12px 0",itemFontSize:p="14px",itemFontWeight:y="500",activeItemColor:m="#00aec7",inactiveItemColor:g="#5c6975",indicatorHeight:f="3px",showDraggable:M=!1,showLegend:_=!1,showData:v=!1,className:L="",style:w,countBackgroundColor:C,countColor:b,countBorderRadius:x,countPadding:I,countFontSize:S,countFontWeight:j,navContainerClassName:$,navContainerStyle:q,rightContentClassName:H,rightContentStyle:D,rightActions:z,activeSwitcherColor:N,inactiveSwitcherColor:A,isMobile:R=!1,onNavigate:P})=>{const{activeSubNav:T,setActiveSubNav:E,navCounts:X,activeNav:ae}=dt();if(R){const J=e.find(me=>me.id===T)||e[0],Ie=[{id:"current-group",label:J?.label||ae?.toUpperCase()||"MENU",icon:J?.icon,items:e.map(me=>({id:me.id,label:me.label,icon:me.icon}))}];return o.jsx("div",{className:L,style:w,children:o.jsx(eA,{groups:Ie,activeItemId:T,onItemClick:(me,$e)=>{const se=e.find(F=>F.id===$e);se&&(se.onClick&&se.onClick(),se.href&&(P?P(se.href):se.onNavigate?se.onNavigate(se.href):window.location.href=se.href),E($e))},headerBgColor:t})})}return o.jsxs("div",{className:`${Ab.subheaderContent} ${L}`,style:{backgroundColor:t,padding:n,margin:c,width:i,height:r,border:s,borderBottom:d,...w},children:[o.jsx("div",{className:`${Ab.navContainer} ${$||""}`,style:{gap:l,...q},children:e.map(J=>{const Ie=J.count!==void 0?J.count:X[J.id],me=T===J.id||J.isActive;return o.jsx(Qq,{...J,onNavigate:P||J.onNavigate,count:Ie,isActive:me,onClick:()=>{J.onClick&&J.onClick(),E(J.id)},activeColor:m,inactiveColor:g,countBackgroundColor:C,countColor:b,countBorderRadius:x,countPadding:I,countFontSize:S,countFontWeight:j,indicatorColor:m,indicatorHeight:f,padding:u,fontSize:p,fontWeight:y,gap:"8px",style:J.style},J.id)})}),o.jsxs("div",{className:`${Ab.rightContent} ${H||""}`,style:{gap:h,...D},children:[M&&o.jsx(aL,{size:20,colors:{bg:N,activeBg:A,icon:"#1C1B1F",icon2:"#FFFFFF"}}),_&&o.jsx(nL,{size:20,colors:{bg:N,activeBg:A,icon:"#1C1B1F",icon2:"#FFFFFF"}}),v&&o.jsx(oL,{size:20,colors:{bg:N,activeBg:A,icon:"#1C1B1F",icon2:"#FFFFFF"}}),z]})]})},H8e=({onSwitch:e,size:t="20px",lightIconColor:n="#666",darkIconColor:c="#fff",backgroundColor:i="transparent",padding:r="8px",borderRadius:s="50%",style:d,className:l=""})=>{const[h,u]=k.useState(!1),{currentTheme:p,switchTheme:y}=pL(),m=p!="dark",g=()=>{y(m?"dark":"light"),e?.()};return k.useEffect(()=>{u(!0)},[]),!h||!p?o.jsx(o.Fragment,{}):o.jsx("div",{className:`theme-switcher ${l}`,onClick:g,style:{cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:i,padding:r,borderRadius:s,transition:"all 0.3s ease",...d},children:m?o.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}):o.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:c,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("circle",{cx:"12",cy:"12",r:"5"}),o.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),o.jsx("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),o.jsx("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),o.jsx("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),o.jsx("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),o.jsx("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),o.jsx("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),o.jsx("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]})})},D8e=({initialSortBy:e=null,initialSortOrder:t="asc",onSortChange:n})=>{const[c,i]=k.useState({sortBy:e,sortOrder:t,filters:{}}),r=k.useCallback(s=>{let d="asc";c.sortBy===s&&(d=c.sortOrder==="asc"?"desc":"asc");const l={...c,sortBy:s,sortOrder:d};i(l),n(s,d)},[c,n]);return{tableState:c,handleSort:r}},B8e=e=>Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"#FFF",viewBox:"0 -960 960 960",...e},Z.createElement("path",{d:"M440-800v487L216-537l-56 57 320 320 320-320-56-57-224 224v-487z"})),R8e=k.memo(B8e),F8e=e=>Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"#FFF",viewBox:"0 -960 960 960",...e},Z.createElement("path",{d:"M440-160v-487L216-423l-56-57 320-320 320 320-56 57-224-224v487z"})),E8e=k.memo(F8e),O8e=({columns:e,sortBy:t,sortOrder:n,onSort:c,removeLabelSpan:i=!1})=>o.jsx("thead",{children:o.jsx("tr",{children:e.map((r,s)=>{const d=t===r.key,l=!!r.sortable;return o.jsx("th",{className:`${r.className||""}${l?" sortable":""}`,style:{width:r.width,textAlign:r.align||"left"},onClick:()=>l&&c(String(r.key)),title:Y(r.a11yConfig,r.titleKey),children:o.jsxs("div",{className:`th-content ${r.align?`align-${r.align}`:""}`,children:[i?r.label:o.jsx("span",{children:r.label}),l&&o.jsx("span",{className:"sort-icon-container",style:{display:"inline-flex",alignItems:"center"},children:d&&n==="asc"?o.jsx(E8e,{width:16,height:16,style:{fill:"currentColor",transition:"all 0.2s ease"}}):o.jsx(R8e,{width:16,height:16,style:{fill:"currentColor",opacity:d?1:.5,transition:"all 0.2s ease"}})})]})},String(r.key)||s)})})}),U8e=({data:e,columns:t,rowKey:n,onRowClick:c,isLoading:i,text:r,rowStyle:s,rowClassName:d})=>!e.length&&!i?o.jsx("tbody",{children:o.jsx("tr",{children:o.jsx("td",{colSpan:t.length,style:{textAlign:"center",padding:"32px"},children:o.jsx("span",{style:{color:"var(--table-text-muted)"},children:r?.noData||"Aucune donnée disponible"})})})}):o.jsx("tbody",{children:e.map((l,h)=>{const u=l[n],p=typeof u=="string"||typeof u=="number"?u:h;return o.jsx("tr",{onClick:()=>c&&c(l),style:{cursor:c?"pointer":"default",...s?s(l):{}},className:d?d(l,h):"",children:t.map((y,m)=>o.jsx("td",{style:{width:y.width,textAlign:y.align||"left"},className:y.className,children:y.render?y.render(l):l[y.key]},`${String(y.key)}-${m}`))},p)})}),W8e=({state:e,onPaginationChange:t,onLoadMore:n,infiniteScroll:c,hasMore:i,text:r,isLoading:s})=>{const{page:d,pageSize:l,total:h}=e,u=l===-1?h:l,p=Math.ceil(h/u)||1,y=Math.min(Math.max(1,d),p),m=h===0?0:(y-1)*u+1,g=Math.min(y*u,h),f=_=>{t({page:_})},M=k.useMemo(()=>{if(p<=6)return Array.from({length:p},(S,j)=>j+1);const L=Math.max(y-1,1),w=Math.min(y+1,p),C=L>2,b=w<p-2,x=1,I=p;if(!C&&b)return[...Array.from({length:5},($,q)=>q+1),"...",p];if(C&&!b){const j=Array.from({length:5},($,q)=>p-5+q+1);return[x,"...",...j]}if(C&&b){const S=Array.from({length:w-L+1},(j,$)=>L+$);return[x,"...",...S,"...",I]}return[]},[y,p]);return o.jsxs("div",{className:"table-pagination",children:[o.jsx("div",{className:"pagination-summary",children:h>0?o.jsx("span",{children:r?.itemsRange?r.itemsRange(m,g,h):o.jsxs(o.Fragment,{children:[o.jsxs("b",{children:[m,"–",g]})," ","sur ",o.jsx("b",{children:h.toLocaleString()})," éléments"]})}):o.jsx("span",{children:r?.noResults||"0 résultats"})}),o.jsx("div",{className:"pagination-spacer"}),!c&&l!==-1&&p>1&&o.jsxs("div",{className:"pagination-controls",children:[o.jsx("button",{className:"pagination-btn",onClick:()=>f(1),disabled:y===1,title:r?.first||"Premier",children:"<<"}),o.jsx("button",{className:"pagination-btn",onClick:()=>f(y-1),disabled:y===1,title:r?.previous||"Précédent",children:"<"}),(M||[]).map((_,v)=>_==="..."?o.jsx("span",{style:{padding:"0 4px",color:"var(--table-text-muted)"},children:"..."},v):o.jsx("button",{className:`pagination-btn ${_===y?"active":""}`,onClick:()=>f(_),children:_},v)),o.jsx("button",{className:"pagination-btn",onClick:()=>f(y+1),disabled:y===p,title:r?.next||"Suivant",children:">"}),o.jsx("button",{className:"pagination-btn",onClick:()=>f(p),disabled:y===p,title:r?.last||"Dernier",children:">>"})]}),!c&&n&&i&&o.jsx("div",{className:"pagination-load-more",children:o.jsx("button",{className:"btn-load-more",onClick:n,disabled:s,style:{padding:"8px 16px",backgroundColor:"white",border:"1px solid #ddd",borderRadius:"6px",cursor:s?"wait":"pointer",color:"#555",fontWeight:600},children:s?r?.loading||"Chargement...":r?.loadMore||"Charger plus"})})]})},tA=({data:e,columns:t,isLoading:n,pagination:c,onPaginationChange:i,onSortChange:r,rowKey:s,loaderSize:d=40,stickyHeader:l=!0,height:h,minHeight:u="200px",text:p,onLoadMore:y,infiniteScroll:m,hasMore:g,tableState:f,className:M,style:_,rowStyle:v,onRowClick:L,rowClassName:w,titleKey:C,removeLabelSpan:b=!1,a11yConfig:x})=>{const I=k.useMemo(()=>({...p}),[p]),S=k.useRef(null);k.useEffect(()=>{if(!m||!y||!g||n)return;const z=new IntersectionObserver(N=>{N[0].isIntersecting&&y()},{threshold:.1});return S.current&&z.observe(S.current),()=>z.disconnect()},[m,y,g,n]);const{tableState:j,handleSort:$}=D8e({initialSortBy:null,onSortChange:r}),q=(f?.sortBy!==void 0?f.sortBy:j.sortBy)??void 0,H=f?.sortOrder!==void 0?f.sortOrder:j.sortOrder,D=z=>{const N=q,A=H;let R="asc";N===z&&(R=A==="asc"?"desc":"asc"),f?.sortBy!==void 0?r(z,R):$(z)};return o.jsxs("div",{className:`table-container ${M||""}`,style:_,title:Y(x,C),children:[o.jsxs("div",{className:"table-frame",style:{height:h??void 0,minHeight:u??void 0},children:[n&&o.jsx("div",{className:"table-loader-overlay",children:o.jsx("div",{className:"spinner",style:{width:d,height:d,borderTopColor:"var(--table-primary)"}})}),o.jsxs("div",{className:`table-wrapper ${l?"sticky-header":""}`,children:[o.jsxs("table",{className:"data-table",children:[o.jsx(O8e,{columns:t,sortBy:q,sortOrder:H,onSort:D,removeLabelSpan:b}),o.jsx(U8e,{data:e,columns:t.map(z=>({...z,render:z.render?N=>z.render(N,{}):void 0})),rowKey:s,onRowClick:L,isLoading:n,text:I,rowStyle:typeof v=="function"?v:v?()=>v:void 0,rowClassName:w})]}),m&&o.jsx("div",{ref:S,style:{height:20,margin:10}})]})]}),o.jsx(W8e,{state:c,onPaginationChange:i,text:I,onLoadMore:y,infiniteScroll:m,hasMore:g,isLoading:n})]})},G8e="_datePickerContainer_1941b_3",K8e="_label_1941b_16",Z8e="_displayNode_1941b_23",X8e="_datePickerButton_1941b_30",Y8e="_datePickerButtonDisabled_1941b_50",J8e="_datePickerButtonOpen_1941b_59",Q8e="_datePickerLabel_1941b_68",efe="_placeholder_1941b_79",tfe="_chevron_1941b_83",afe="_errorMessage_1941b_91",nfe="_dropdown_1941b_96",ofe="_calendarHeader_1941b_120",cfe="_navButton_1941b_129",ife="_headerSelectors_1941b_148",rfe="_monthSelector_1941b_156",sfe="_yearSelector_1941b_157",dfe="_selectorButton_1941b_161",lfe="_selectorChevron_1941b_178",hfe="_selectorChevronOpen_1941b_183",ufe="_monthDropdown_1941b_187",pfe="_yearDropdown_1941b_188",yfe="_monthItem_1941b_208",kfe="_yearItem_1941b_209",mfe="_monthItemSelected_1941b_231",ffe="_yearItemSelected_1941b_232",gfe="_weekdays_1941b_236",vfe="_weekday_1941b_236",Mfe="_calendarGrid_1941b_252",_fe="_dateCell_1941b_260",xfe="_dateCellSelected_1941b_283",Lfe="_dateCellOtherMonth_1941b_287",Ife="_dateCellOtherMonthSelected_1941b_291",bfe="_calendarFooter_1941b_295",wfe="_cancelButton_1941b_303",Cfe="_applyButton_1941b_304",Nfe="_timePickerContainer_1941b_348",jfe="_timeGroup_1941b_357",Sfe="_timeLabel_1941b_364",$fe="_timeInputWrapper_1941b_370",qfe="_timeInput_1941b_370",Afe="_timeSeparator_1941b_398",O={datePickerContainer:G8e,label:K8e,displayNode:Z8e,datePickerButton:X8e,datePickerButtonDisabled:Y8e,datePickerButtonOpen:J8e,datePickerLabel:Q8e,placeholder:efe,chevron:tfe,errorMessage:afe,dropdown:nfe,calendarHeader:ofe,navButton:cfe,headerSelectors:ife,monthSelector:rfe,yearSelector:sfe,selectorButton:dfe,selectorChevron:lfe,selectorChevronOpen:hfe,monthDropdown:ufe,yearDropdown:pfe,monthItem:yfe,yearItem:kfe,monthItemSelected:mfe,yearItemSelected:ffe,weekdays:gfe,weekday:vfe,calendarGrid:Mfe,dateCell:_fe,dateCellSelected:xfe,dateCellOtherMonth:Lfe,dateCellOtherMonthSelected:Ife,calendarFooter:bfe,cancelButton:wfe,applyButton:Cfe,timePickerContainer:Nfe,timeGroup:jfe,timeLabel:Sfe,timeInputWrapper:$fe,timeInput:qfe,timeSeparator:Afe},dS=["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],zfe=["Lun","Mar","Mer","Jeu","Ven","Sam","Dim"],sw=({value:e,onChange:t,label:n,placeholder:c="Sélectionner une date...",className:i="",fullWidth:r=!0,disabled:s=!1,error:d,buttonHeight:l="2.75rem",buttonPadding:h="0.75rem 1rem 0.75rem 1rem",dropdownMaxHeight:u="auto",fontSize:p="0.875rem",iconSize:y="1.5rem",labelMarginBottom:m="0.5rem",errorMarginTop:g="0.25rem",dropdownMarginTop:f="0.25rem",itemPadding:M="0.5rem 0.75rem",fontWeight:_="400",buttonBgColor:v,buttonBorderColor:L,buttonTextColor:w,dropdownBgColor:C="#ffffff",itemHoverColor:b,selectedItemBgColor:x,iconColor:I,errorColor:S,labelColor:j,placeholderColor:$,borderRadius:q="var(--radius-content)",borderWidth:H="0.0625rem",boxShadow:D="0 0.25rem 0.75rem rgba(0, 0, 0, 0.1)",transitionDuration:z="0.2s",transitionTiming:N="ease",dateCellSize:A="2.5rem",headerTextColor:R="#6c757d",weekdayTextColor:P="#6c757d",currentMonthDateColor:T="#212529",otherMonthDateColor:E="#adb5bd",selectedDateBgColor:X="#00A6D9",selectedDateTextColor:ae="#ffffff",cancelButtonBgColor:J="#e9ecef",cancelButtonTextColor:Ie="#212529",applyButtonBgColor:me="#00A6D9",applyButtonTextColor:$e="#ffffff",width:se,displayNode:F=void 0,displayMode:ee="auto",displayNodeAriaLabel:re,dropdownPosition:oe="bottom",dropdownAlignment:ke="right",dropdownWidth:Le,withBorder:ve=!1,icon:qe,precision:je="day",hoursLabel:ue="Heures",minutesLabel:be="Minutes",lowerLimit:Mt=null,upperLimit:i1=null,months:Ac,weekdays:ne,cancelText:zc="Annuler",applyText:fe="Appliquer",prevMonthAriaLabel:Pt="Mois précédent",nextMonthAriaLabel:cA="Mois suivant",calendarAriaLabel:iA="Sélecteur de date",openedAriaLabel:rA="Ouvrir le sélecteur de date",selectedDateAriaLabel:sA="Date sélectionnée: ",locale:Xw="fr-FR",rotateIcon:dA=!0})=>{const Tt=B=>{if(B instanceof Date)return isNaN(B.getTime())?null:B;if(typeof B=="string"&&B){const G=new Date(B);return isNaN(G.getTime())?null:G}return null},[et,Ht]=k.useState(!1),[Vc,lA]=k.useState({top:0,left:0,width:0}),[ce,r1]=k.useState(Tt(e)||new Date),[wL,CL]=k.useState(Tt(e)),[NL,jL]=k.useState(Tt(e)?.getHours()??0),[SL,$L]=k.useState(Tt(e)?.getMinutes()??0),[qL,Pc]=k.useState(!1),[AL,Tc]=k.useState(!1),zL=k.useRef(null),G1=k.useRef(null),VL=k.useRef(null),PL=k.useRef(null);k.useEffect(()=>{const B=Tt(e);CL(B),B&&(r1(B),jL(B.getHours()),$L(B.getMinutes()))},[e]);const Hc=k.useCallback(()=>{if(G1.current){const B=G1.current.getBoundingClientRect();lA({top:B.top,left:B.left,width:B.width})}},[]);k.useEffect(()=>(et&&(Hc(),window.addEventListener("scroll",Hc,!0),window.addEventListener("resize",Hc)),()=>{window.removeEventListener("scroll",Hc,!0),window.removeEventListener("resize",Hc)}),[et,Hc]),k.useEffect(()=>{const B=G=>{if(zL.current&&!zL.current.contains(G.target)){const _e=document.getElementById("datepicker-dropdown");if(_e&&_e.contains(G.target))return;Ht(!1),Pc(!1),Tc(!1)}VL.current&&!VL.current.contains(G.target)&&Pc(!1),PL.current&&!PL.current.contains(G.target)&&Tc(!1)};return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[]);const Yw=B=>new Date(B.getFullYear(),B.getMonth()+1,0).getDate(),hA=B=>{const G=new Date(B.getFullYear(),B.getMonth(),1).getDay();return G===0?6:G-1},uA=()=>{const B=[],G=hA(ce),_e=Yw(ce),K1=new Date(ce.getFullYear(),ce.getMonth()-1,1),_t=Yw(K1);for(let Ze=G-1;Ze>=0;Ze--)B.push(new Date(ce.getFullYear(),ce.getMonth()-1,_t-Ze));for(let Ze=1;Ze<=_e;Ze++)B.push(new Date(ce.getFullYear(),ce.getMonth(),Ze));const s1=42-B.length;for(let Ze=1;Ze<=s1;Ze++)B.push(new Date(ce.getFullYear(),ce.getMonth()+1,Ze));return B},pA=(B,G)=>!B||!G?!1:B.getDate()===G.getDate()&&B.getMonth()===G.getMonth()&&B.getFullYear()===G.getFullYear(),yA=B=>B.getMonth()===ce.getMonth()&&B.getFullYear()===ce.getFullYear(),kA=()=>{r1(new Date(ce.getFullYear(),ce.getMonth()-1,1))},mA=()=>{r1(new Date(ce.getFullYear(),ce.getMonth()+1,1))},fA=B=>{if(!s){const G=new Date(B);G.setHours(NL),G.setMinutes(SL),CL(G)}},gA=()=>{if(!s){if(wL){const B=new Date(wL);B.setHours(NL),B.setMinutes(SL),t(B)}else t(null);Ht(!1)}},vA=()=>{const B=Tt(e);CL(B),B&&(jL(B.getHours()),$L(B.getMinutes())),Ht(!1)},MA=B=>{r1(new Date(ce.getFullYear(),B,1)),Pc(!1)},_A=B=>{r1(new Date(B,ce.getMonth(),1)),Tc(!1)},xA=()=>{const B=ce.getFullYear(),G=[];for(let _e=B-10;_e<=B+10;_e++)G.push(_e);return G},LA=B=>{if(!s)switch(B.key){case"Enter":case" ":B.preventDefault(),Ht(!et);break;case"Escape":Ht(!1),Pc(!1),Tc(!1);break;case"Tab":et&&(Ht(!1),Pc(!1),Tc(!1));break}},IA={width:se||(r?"100%":"auto"),fontSize:p,fontWeight:_},bA={height:l,padding:h,backgroundColor:v||"#ffffff",border:ve?void 0:"none",borderColor:d?S||"#dc3545":L||"#dee2e6",color:w||"#212529",borderRadius:q,borderWidth:H,fontWeight:_,transition:`all ${z} ${N}`},wA={backgroundColor:C||"#ffffff",maxHeight:u,borderRadius:q,borderWidth:H,boxShadow:D,transition:`opacity ${z} ${N}, transform ${z} ${N}`,position:"fixed",top:oe==="bottom"?Vc.top+(G1.current?.offsetHeight||0)+parseFloat(f.replace("rem",""))*16:"auto",bottom:oe==="top"?window.innerHeight-Vc.top+parseFloat(f.replace("rem",""))*16:"auto",left:ke==="left"?Vc.left:"auto",right:ke==="right"?window.innerWidth-(Vc.left+Vc.width):"auto",width:Le||(r?Vc.width:"auto"),zIndex:10001},Jw={width:y,height:y,color:I||"#6c757d","--icon-rotation":dA&&et?"rotate(180deg)":"rotate(0deg)"},CA={color:j||"#212529",marginBottom:m,fontWeight:_},NA={color:$||"#6c757d"},jA={color:S||"#dc3545",marginTop:g},SA=uA(),tt=Tt(e),Qw=tt?je==="minutes"?`${tt.toLocaleDateString(Xw)} ${tt.getHours().toString().padStart(2,"0")}:${tt.getMinutes().toString().padStart(2,"0")}`:tt.toLocaleDateString(Xw):"",$A=!!F&&(ee==="icon"||ee==="auto"&&!tt),qA=re||(tt?`${sA}${Qw}`:rA);return o.jsxs("div",{className:`${O.datePickerContainer} ${i}`,ref:zL,style:IA,"data-fullwidth":r,"data-disabled":s,"data-error":!!d,children:[n&&o.jsx("label",{className:O.label,style:CA,children:n}),o.jsxs("button",{ref:G1,type:"button",onClick:()=>!s&&Ht(!et),onKeyDown:LA,className:`
8169
+ `),()=>{M.contains(f)&&M.removeChild(f)}},[t]),o.jsx(M0e,{isPresent:t,childRef:r,sizeRef:s,children:Z.cloneElement(e,{ref:l})})}const x0e=({children:e,initial:t,isPresent:n,onExitComplete:c,custom:i,presenceAffectsLayout:r,mode:s,anchorX:d,root:l})=>{const h=zt(L0e),u=k.useId();let p=!0,y=k.useMemo(()=>(p=!1,{id:u,initial:t,isPresent:n,custom:i,onExitComplete:m=>{h.set(m,!0);for(const g of h.values())if(!g)return;c&&c()},register:m=>(h.set(m,!1),()=>h.delete(m))}),[n,h,c]);return r&&p&&(y={...y}),k.useMemo(()=>{h.forEach((m,g)=>h.set(g,!1))},[n]),Z.useEffect(()=>{!n&&!h.size&&c&&c()},[n]),s==="popLayout"&&(e=o.jsx(_0e,{isPresent:n,anchorX:d,root:l,children:e})),o.jsx(yL.Provider,{value:y,children:e})};function L0e(){return new Map}function w$(e=!0){const t=k.useContext(yL);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:c,register:i}=t,r=k.useId();k.useEffect(()=>{if(e)return i(r)},[e]);const s=k.useCallback(()=>e&&c&&c(r),[r,c,e]);return!n&&c?[!1,s]:[!0]}const Y1=e=>e.key||"";function bC(e){const t=[];return k.Children.forEach(e,n=>{k.isValidElement(n)&&t.push(n)}),t}const I0e=({children:e,custom:t,initial:n=!0,onExitComplete:c,presenceAffectsLayout:i=!0,mode:r="sync",propagate:s=!1,anchorX:d="left",root:l})=>{const[h,u]=w$(s),p=k.useMemo(()=>bC(e),[e]),y=s&&!h?[]:p.map(Y1),m=k.useRef(!0),g=k.useRef(p),f=zt(()=>new Map),[M,_]=k.useState(p),[v,L]=k.useState(p);uw(()=>{m.current=!1,g.current=p;for(let b=0;b<v.length;b++){const x=Y1(v[b]);y.includes(x)?f.delete(x):f.get(x)!==!0&&f.set(x,!1)}},[v,y.length,y.join("-")]);const w=[];if(p!==M){let b=[...p];for(let x=0;x<v.length;x++){const I=v[x],S=Y1(I);y.includes(S)||(b.splice(x,0,I),w.push(I))}return r==="wait"&&w.length&&(b=w),L(bC(b)),_(p),null}process.env.NODE_ENV!=="production"&&r==="wait"&&v.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:C}=k.useContext(lw);return o.jsx(o.Fragment,{children:v.map(b=>{const x=Y1(b),I=s&&!h?!1:p===v||y.includes(x),S=()=>{if(f.has(x))f.set(x,!0);else return;let j=!0;f.forEach($=>{$||(j=!1)}),j&&(C?.(),L(g.current),s&&u?.(),c&&c())};return o.jsx(x0e,{isPresent:I,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:r,root:l,onExitComplete:I?void 0:S,anchorX:d,children:b},x)})})},C$=k.createContext({strict:!1}),wC={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},e1={};for(const e in wC)e1[e]={isEnabled:t=>wC[e].some(n=>!!t[n])};function b0e(e){for(const t in e)e1[t]={...e1[t],...e[t]}}const w0e=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function sL(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||w0e.has(e)}let N$=e=>!sL(e);function C0e(e){typeof e=="function"&&(N$=t=>t.startsWith("on")?!sL(t):e(t))}try{C0e(require("@emotion/is-prop-valid").default)}catch{}function N0e(e,t,n){const c={};for(const i in e)i==="values"&&typeof e.values=="object"||(N$(i)||n===!0&&sL(i)||!t&&!sL(i)||e.draggable&&i.startsWith("onDrag"))&&(c[i]=e[i]);return c}const mL=k.createContext({});function fL(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function D1(e){return typeof e=="string"||Array.isArray(e)}const zw=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Vw=["initial",...zw];function gL(e){return fL(e.animate)||Vw.some(t=>D1(e[t]))}function j$(e){return!!(gL(e)||e.variants)}function j0e(e,t){if(gL(e)){const{initial:n,animate:c}=e;return{initial:n===!1||D1(n)?n:void 0,animate:D1(c)?c:void 0}}return e.inherit!==!1?t:{}}function S0e(e){const{initial:t,animate:n}=j0e(e,k.useContext(mL));return k.useMemo(()=>({initial:t,animate:n}),[CC(t),CC(n)])}function CC(e){return Array.isArray(e)?e.join(" "):e}const B1={};function $0e(e){for(const t in e)B1[t]=e[t],Mw(t)&&(B1[t].isCSSVariable=!0)}function S$(e,{layout:t,layoutId:n}){return o1.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!B1[e]||e==="opacity")}const q0e={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},A0e=n1.length;function z0e(e,t,n){let c="",i=!0;for(let r=0;r<A0e;r++){const s=n1[r],d=e[s];if(d===void 0)continue;let l=!0;if(typeof d=="number"?l=d===(s.startsWith("scale")?1:0):l=parseFloat(d)===0,!l||n){const h=M$(d,$w[s]);if(!l){i=!1;const u=q0e[s]||s;c+=`${u}(${h}) `}n&&(t[s]=h)}}return c=c.trim(),n?c=n(t,i?"":c):i&&(c="none"),c}function Pw(e,t,n){const{style:c,vars:i,transformOrigin:r}=e;let s=!1,d=!1;for(const l in t){const h=t[l];if(o1.has(l)){s=!0;continue}else if(Mw(l)){i[l]=h;continue}else{const u=M$(h,$w[l]);l.startsWith("origin")?(d=!0,r[l]=u):c[l]=u}}if(t.transform||(s||n?c.transform=z0e(t,e.transform,n):c.transform&&(c.transform="none")),d){const{originX:l="50%",originY:h="50%",originZ:u=0}=r;c.transformOrigin=`${l} ${h} ${u}`}}const Tw=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function $$(e,t,n){for(const c in t)!Ne(t[c])&&!S$(c,n)&&(e[c]=t[c])}function V0e({transformTemplate:e},t){return k.useMemo(()=>{const n=Tw();return Pw(n,t,e),Object.assign({},n.vars,n.style)},[t])}function P0e(e,t){const n=e.style||{},c={};return $$(c,n,e),Object.assign(c,V0e(e,t)),c}function T0e(e,t){const n={},c=P0e(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,c.userSelect=c.WebkitUserSelect=c.WebkitTouchCallout="none",c.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=c,n}const H0e={offset:"stroke-dashoffset",array:"stroke-dasharray"},D0e={offset:"strokeDashoffset",array:"strokeDasharray"};function B0e(e,t,n=1,c=0,i=!0){e.pathLength=1;const r=i?H0e:D0e;e[r.offset]=U.transform(-c);const s=U.transform(t),d=U.transform(n);e[r.array]=`${s} ${d}`}function q$(e,{attrX:t,attrY:n,attrScale:c,pathLength:i,pathSpacing:r=1,pathOffset:s=0,...d},l,h,u){if(Pw(e,d,h),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:p,style:y}=e;p.transform&&(y.transform=p.transform,delete p.transform),(y.transform||p.transformOrigin)&&(y.transformOrigin=p.transformOrigin??"50% 50%",delete p.transformOrigin),y.transform&&(y.transformBox=u?.transformBox??"fill-box",delete p.transformBox),t!==void 0&&(p.x=t),n!==void 0&&(p.y=n),c!==void 0&&(p.scale=c),i!==void 0&&B0e(p,i,r,s,!1)}const A$=()=>({...Tw(),attrs:{}}),z$=e=>typeof e=="string"&&e.toLowerCase()==="svg";function R0e(e,t,n,c){const i=k.useMemo(()=>{const r=A$();return q$(r,t,z$(c),e.transformTemplate,e.style),{...r.attrs,style:{...r.style}}},[t]);if(e.style){const r={};$$(r,e.style,e),i.style={...r,...i.style}}return i}const F0e=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Hw(e){return typeof e!="string"||e.includes("-")?!1:!!(F0e.indexOf(e)>-1||/[A-Z]/u.test(e))}function E0e(e,t,n,{latestValues:c},i,r=!1){const d=(Hw(e)?R0e:T0e)(t,c,i,e),l=N0e(t,typeof e=="string",r),h=e!==k.Fragment?{...l,...d,ref:n}:{},{children:u}=t,p=k.useMemo(()=>Ne(u)?u.get():u,[u]);return k.createElement(e,{...h,children:p})}function NC(e){const t=[{},{}];return e?.values.forEach((n,c)=>{t[0][c]=n.get(),t[1][c]=n.getVelocity()}),t}function Dw(e,t,n,c){if(typeof t=="function"){const[i,r]=NC(c);t=t(n!==void 0?n:e.custom,i,r)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,r]=NC(c);t=t(n!==void 0?n:e.custom,i,r)}return t}function Qx(e){return Ne(e)?e.get():e}function O0e({scrapeMotionValuesFromProps:e,createRenderState:t},n,c,i){return{latestValues:U0e(n,c,i,e),renderState:t()}}function U0e(e,t,n,c){const i={},r=c(e,{});for(const y in r)i[y]=Qx(r[y]);let{initial:s,animate:d}=e;const l=gL(e),h=j$(e);t&&h&&!l&&e.inherit!==!1&&(s===void 0&&(s=t.initial),d===void 0&&(d=t.animate));let u=n?n.initial===!1:!1;u=u||s===!1;const p=u?d:s;if(p&&typeof p!="boolean"&&!fL(p)){const y=Array.isArray(p)?p:[p];for(let m=0;m<y.length;m++){const g=Dw(e,y[m]);if(g){const{transitionEnd:f,transition:M,..._}=g;for(const v in _){let L=_[v];if(Array.isArray(L)){const w=u?L.length-1:0;L=L[w]}L!==null&&(i[v]=L)}for(const v in f)i[v]=f[v]}}}return i}const V$=e=>(t,n)=>{const c=k.useContext(mL),i=k.useContext(yL),r=()=>O0e(e,t,c,i);return n?r():zt(r)};function Bw(e,t,n){const{style:c}=e,i={};for(const r in c)(Ne(c[r])||t.style&&Ne(t.style[r])||S$(r,e)||n?.getValue(r)?.liveStyle!==void 0)&&(i[r]=c[r]);return i}const W0e=V$({scrapeMotionValuesFromProps:Bw,createRenderState:Tw});function P$(e,t,n){const c=Bw(e,t,n);for(const i in e)if(Ne(e[i])||Ne(t[i])){const r=n1.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;c[r]=e[i]}return c}const G0e=V$({scrapeMotionValuesFromProps:P$,createRenderState:A$}),K0e=Symbol.for("motionComponentSymbol");function Ec(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Z0e(e,t,n){return k.useCallback(c=>{c&&e.onMount&&e.onMount(c),t&&(c?t.mount(c):t.unmount()),n&&(typeof n=="function"?n(c):Ec(n)&&(n.current=c))},[t])}const Rw=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),X0e="framerAppearId",T$="data-"+Rw(X0e),H$=k.createContext({});function Y0e(e,t,n,c,i){const{visualElement:r}=k.useContext(mL),s=k.useContext(C$),d=k.useContext(yL),l=k.useContext(kL).reducedMotion,h=k.useRef(null);c=c||s.renderer,!h.current&&c&&(h.current=c(e,{visualState:t,parent:r,props:n,presenceContext:d,blockInitialAnimation:d?d.initial===!1:!1,reducedMotionConfig:l}));const u=h.current,p=k.useContext(H$);u&&!u.projection&&i&&(u.type==="html"||u.type==="svg")&&J0e(h.current,n,i,p);const y=k.useRef(!1);k.useInsertionEffect(()=>{u&&y.current&&u.update(n,d)});const m=n[T$],g=k.useRef(!!m&&!window.MotionHandoffIsComplete?.(m)&&window.MotionHasOptimisedAnimation?.(m));return uw(()=>{u&&(y.current=!0,window.MotionIsMounted=!0,u.updateFeatures(),u.scheduleRenderMicrotask(),g.current&&u.animationState&&u.animationState.animateChanges())}),k.useEffect(()=>{u&&(!g.current&&u.animationState&&u.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(m)}),g.current=!1),u.enteringChildren=void 0)}),u}function J0e(e,t,n,c){const{layoutId:i,layout:r,drag:s,dragConstraints:d,layoutScroll:l,layoutRoot:h,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:D$(e.parent)),e.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:!!s||d&&Ec(d),visualElement:e,animationType:typeof r=="string"?r:"both",initialPromotionConfig:c,crossfade:u,layoutScroll:l,layoutRoot:h})}function D$(e){if(e)return e.options.allowProjection!==!1?e.projection:D$(e.parent)}function EL(e,{forwardMotionProps:t=!1}={},n,c){n&&b0e(n);const i=Hw(e)?G0e:W0e;function r(d,l){let h;const u={...k.useContext(kL),...d,layoutId:Q0e(d)},{isStatic:p}=u,y=S0e(d),m=i(d,p);if(!p&&hw){ele(u,n);const g=tle(u);h=g.MeasureLayout,y.visualElement=Y0e(e,m,u,c,g.ProjectionNode)}return o.jsxs(mL.Provider,{value:y,children:[h&&y.visualElement?o.jsx(h,{visualElement:y.visualElement,...u}):null,E0e(e,d,Z0e(m,y.visualElement,l),m,p,t)]})}r.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const s=k.forwardRef(r);return s[K0e]=e,s}function Q0e({layoutId:e}){const t=k.useContext(lw).id;return t&&e!==void 0?t+"-"+e:e}function ele(e,t){const n=k.useContext(C$).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const c="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?t1(!1,c,"lazy-strict-mode"):Qe(!1,c,"lazy-strict-mode")}}function tle(e){const{drag:t,layout:n}=e1;if(!t&&!n)return{};const c={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?c.MeasureLayout:void 0,ProjectionNode:c.ProjectionNode}}function ale(e,t){if(typeof Proxy>"u")return EL;const n=new Map,c=(r,s)=>EL(r,s,e,t),i=(r,s)=>(process.env.NODE_ENV!=="production"&&fw(!1,"motion() is deprecated. Use motion.create() instead."),c(r,s));return new Proxy(i,{get:(r,s)=>s==="create"?c:(n.has(s)||n.set(s,EL(s,void 0,e,t)),n.get(s))})}function B$({top:e,left:t,right:n,bottom:c}){return{x:{min:t,max:n},y:{min:e,max:c}}}function nle({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function ole(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),c=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:c.y,right:c.x}}function OL(e){return e===void 0||e===1}function Qb({scale:e,scaleX:t,scaleY:n}){return!OL(e)||!OL(t)||!OL(n)}function Ic(e){return Qb(e)||R$(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function R$(e){return jC(e.x)||jC(e.y)}function jC(e){return e&&e!=="0%"}function dL(e,t,n){const c=e-n,i=t*c;return n+i}function SC(e,t,n,c,i){return i!==void 0&&(e=dL(e,i,c)),dL(e,n,c)+t}function ew(e,t=0,n=1,c,i){e.min=SC(e.min,t,n,c,i),e.max=SC(e.max,t,n,c,i)}function F$(e,{x:t,y:n}){ew(e.x,t.translate,t.scale,t.originPoint),ew(e.y,n.translate,n.scale,n.originPoint)}const $C=.999999999999,qC=1.0000000000001;function cle(e,t,n,c=!1){const i=n.length;if(!i)return;t.x=t.y=1;let r,s;for(let d=0;d<i;d++){r=n[d],s=r.projectionDelta;const{visualElement:l}=r.options;l&&l.props.style&&l.props.style.display==="contents"||(c&&r.options.layoutScroll&&r.scroll&&r!==r.root&&Uc(e,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,F$(e,s)),c&&Ic(r.latestValues)&&Uc(e,r.latestValues))}t.x<qC&&t.x>$C&&(t.x=1),t.y<qC&&t.y>$C&&(t.y=1)}function Oc(e,t){e.min=e.min+t,e.max=e.max+t}function AC(e,t,n,c,i=.5){const r=pe(e.min,e.max,i);ew(e,t,n,r,c)}function Uc(e,t){AC(e.x,t.x,t.scaleX,t.scale,t.originX),AC(e.y,t.y,t.scaleY,t.scale,t.originY)}function E$(e,t){return B$(ole(e.getBoundingClientRect(),t))}function ile(e,t,n){const c=E$(e,n),{scroll:i}=t;return i&&(Oc(c.x,i.offset.x),Oc(c.y,i.offset.y)),c}const zC=()=>({translate:0,scale:1,origin:0,originPoint:0}),Wc=()=>({x:zC(),y:zC()}),VC=()=>({min:0,max:0}),ge=()=>({x:VC(),y:VC()}),tw={current:null},O$={current:!1};function rle(){if(O$.current=!0,!!hw)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>tw.current=e.matches;e.addEventListener("change",t),t()}else tw.current=!1}const sle=new WeakMap;function dle(e,t,n){for(const c in t){const i=t[c],r=n[c];if(Ne(i))e.addValue(c,i);else if(Ne(r))e.addValue(c,$c(i,{owner:e}));else if(r!==i)if(e.hasValue(c)){const s=e.getValue(c);s.liveStyle===!0?s.jump(i):s.hasAnimated||s.set(i)}else{const s=e.getStaticValue(c);e.addValue(c,$c(s!==void 0?s:i,{owner:e}))}}for(const c in n)t[c]===void 0&&e.removeValue(c);return t}const PC=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class lle{scrapeMotionValuesFromProps(t,n,c){return{}}constructor({parent:t,props:n,presenceContext:c,reducedMotionConfig:i,blockInitialAnimation:r,visualState:s},d={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=jw,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const y=He.now();this.renderScheduledAt<y&&(this.renderScheduledAt=y,he.render(this.render,!1,!0))};const{latestValues:l,renderState:h}=s;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=h,this.parent=t,this.props=n,this.presenceContext=c,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=d,this.blockInitialAnimation=!!r,this.isControllingVariants=gL(n),this.isVariantNode=j$(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...p}=this.scrapeMotionValuesFromProps(n,{},this);for(const y in p){const m=p[y];l[y]!==void 0&&Ne(m)&&m.set(l[y])}}mount(t){this.current=t,sle.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,c)=>this.bindToMotionValue(c,n)),O$.current||rle(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:tw.current,process.env.NODE_ENV!=="production"&&fw(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),gt(this.notifyUpdate),gt(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const c=o1.has(t);c&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&he.preRender(this.notifyUpdate),c&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),r&&r(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in e1){const n=e1[t];if(!n)continue;const{isEnabled:c,Feature:i}=n;if(!this.features[t]&&i&&c(this.props)&&(this.features[t]=new i(this)),this.features[t]){const r=this.features[t];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ge()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let c=0;c<PC.length;c++){const i=PC[c];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const r="on"+i,s=t[r];s&&(this.propEventSubscriptions[i]=this.on(i,s))}this.prevMotionValues=dle(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const c=this.values.get(t);n!==c&&(c&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let c=this.values.get(t);return c===void 0&&n!==void 0&&(c=$c(n===null?void 0:n,{owner:this}),this.addValue(t,c)),c}readValue(t,n){let c=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return c!=null&&(typeof c=="string"&&(VS(c)||TS(c))?c=parseFloat(c):!f0e(c)&&At.test(n)&&(c=v$(t,n)),this.setBaseTarget(t,Ne(c)?c.get():c)),Ne(c)?c.get():c}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let c;if(typeof n=="string"||typeof n=="object"){const r=Dw(this.props,n,this.presenceContext?.custom);r&&(c=r[t])}if(n&&c!==void 0)return c;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!Ne(i)?i:this.initialValues[t]!==void 0&&c===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new mw),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){qw.render(this.render)}}class U$ extends lle{constructor(){super(...arguments),this.KeyframeResolver=o0e}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:c}){delete n[t],delete c[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ne(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function W$(e,{style:t,vars:n},c,i){const r=e.style;let s;for(s in t)r[s]=t[s];i?.applyProjectionStyles(r,c);for(s in n)r.setProperty(s,n[s])}function hle(e){return window.getComputedStyle(e)}class ule extends U${constructor(){super(...arguments),this.type="html",this.renderInstance=W$}readValueFromInstance(t,n){if(o1.has(n))return this.projection?.isProjecting?Wb(n):xde(t,n);{const c=hle(t),i=(Mw(n)?c.getPropertyValue(n):c[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return E$(t,n)}build(t,n,c){Pw(t,n,c.transformTemplate)}scrapeMotionValuesFromProps(t,n,c){return Bw(t,n,c)}}const G$=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function ple(e,t,n,c){W$(e,t,void 0,c);for(const i in t.attrs)e.setAttribute(G$.has(i)?i:Rw(i),t.attrs[i])}class yle extends U${constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ge}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(o1.has(n)){const c=g$(n);return c&&c.default||0}return n=G$.has(n)?n:Rw(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,c){return P$(t,n,c)}build(t,n,c){q$(t,n,this.isSVGTag,c.transformTemplate,c.style)}renderInstance(t,n,c,i){ple(t,n,c,i)}mount(t){this.isSVGTag=z$(t.tagName),super.mount(t)}}const kle=(e,t)=>Hw(e)?new yle(t):new ule(t,{allowProjection:e!==k.Fragment});function Qc(e,t,n){const c=e.getProps();return Dw(c,t,n!==void 0?n:c.custom,e)}const aw=e=>Array.isArray(e);function mle(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,$c(n))}function fle(e){return aw(e)?e[e.length-1]||0:e}function gle(e,t){const n=Qc(e,t);let{transitionEnd:c={},transition:i={},...r}=n||{};r={...r,...c};for(const s in r){const d=fle(r[s]);mle(e,s,d)}}function vle(e){return!!(Ne(e)&&e.add)}function nw(e,t){const n=e.getValue("willChange");if(vle(n))return n.add(t);if(!n&&ft.WillChange){const c=new ft.WillChange("auto");e.addValue("willChange",c),c.add(t)}}function K$(e){return e.props[T$]}const Mle=e=>e!==null;function _le(e,{repeat:t,repeatType:n="loop"},c){const i=e.filter(Mle),r=t&&n!=="loop"&&t%2===1?0:i.length-1;return i[r]}const xle={type:"spring",stiffness:500,damping:25,restSpeed:10},Lle=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Ile={type:"keyframes",duration:.8},ble={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},wle=(e,{keyframes:t})=>t.length>2?Ile:o1.has(e)?e.startsWith("scale")?Lle(t[1]):xle:ble;function Cle({when:e,delay:t,delayChildren:n,staggerChildren:c,staggerDirection:i,repeat:r,repeatType:s,repeatDelay:d,from:l,elapsed:h,...u}){return!!Object.keys(u).length}const Fw=(e,t,n,c={},i,r)=>s=>{const d=Sw(c,e)||{},l=d.delay||c.delay||0;let{elapsed:h=0}=c;h=h-Je(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...d,delay:-h,onUpdate:y=>{t.set(y),d.onUpdate&&d.onUpdate(y)},onComplete:()=>{s(),d.onComplete&&d.onComplete()},name:e,motionValue:t,element:r?void 0:i};Cle(d)||Object.assign(u,wle(e,u)),u.duration&&(u.duration=Je(u.duration)),u.repeatDelay&&(u.repeatDelay=Je(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let p=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Yb(u),u.delay===0&&(p=!0)),(ft.instantAnimations||ft.skipAnimations)&&(p=!0,Yb(u),u.delay=0),u.allowFlatten=!d.type&&!d.ease,p&&!r&&t.get()!==void 0){const y=_le(u.keyframes,d);if(y!==void 0){he.update(()=>{u.onUpdate(y),u.onComplete()});return}}return d.isSync?new Nw(u):new Ude(u)};function Nle({protectedKeys:e,needsAnimating:t},n){const c=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,c}function Z$(e,t,{delay:n=0,transitionOverride:c,type:i}={}){let{transition:r=e.getDefaultTransition(),transitionEnd:s,...d}=t;c&&(r=c);const l=[],h=i&&e.animationState&&e.animationState.getState()[i];for(const u in d){const p=e.getValue(u,e.latestValues[u]??null),y=d[u];if(y===void 0||h&&Nle(h,u))continue;const m={delay:n,...Sw(r||{},u)},g=p.get();if(g!==void 0&&!p.isAnimating&&!Array.isArray(y)&&y===g&&!m.velocity)continue;let f=!1;if(window.MotionHandoffAnimation){const _=K$(e);if(_){const v=window.MotionHandoffAnimation(_,u,he);v!==null&&(m.startTime=v,f=!0)}}nw(e,u),p.start(Fw(u,p,y,e.shouldReduceMotion&&k$.has(u)?{type:!1}:m,e,f));const M=p.animation;M&&l.push(M)}return s&&Promise.all(l).then(()=>{he.update(()=>{s&&gle(e,s)})}),l}function X$(e,t,n,c=0,i=1){const r=Array.from(e).sort((h,u)=>h.sortNodePosition(u)).indexOf(t),s=e.size,d=(s-1)*c;return typeof n=="function"?n(r,s):i===1?r*c:d-r*c}function ow(e,t,n={}){const c=Qc(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=c||{};n.transitionOverride&&(i=n.transitionOverride);const r=c?()=>Promise.all(Z$(e,c,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:h=0,staggerChildren:u,staggerDirection:p}=i;return jle(e,t,l,h,u,p,n)}:()=>Promise.resolve(),{when:d}=i;if(d){const[l,h]=d==="beforeChildren"?[r,s]:[s,r];return l().then(()=>h())}else return Promise.all([r(),s(n.delay)])}function jle(e,t,n=0,c=0,i=0,r=1,s){const d=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),d.push(ow(l,t,{...s,delay:n+(typeof c=="function"?0:c)+X$(e.variantChildren,l,c,i,r)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(d)}function Sle(e,t,n={}){e.notify("AnimationStart",t);let c;if(Array.isArray(t)){const i=t.map(r=>ow(e,r,n));c=Promise.all(i)}else if(typeof t=="string")c=ow(e,t,n);else{const i=typeof t=="function"?Qc(e,t,n.custom):t;c=Promise.all(Z$(e,i,n))}return c.then(()=>{e.notify("AnimationComplete",t)})}function Y$(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let c=0;c<n;c++)if(t[c]!==e[c])return!1;return!0}const $le=Vw.length;function J$(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?J$(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<$le;n++){const c=Vw[n],i=e.props[c];(D1(i)||i===!1)&&(t[c]=i)}return t}const qle=[...zw].reverse(),Ale=zw.length;function zle(e){return t=>Promise.all(t.map(({animation:n,options:c})=>Sle(e,n,c)))}function Vle(e){let t=zle(e),n=TC(),c=!0;const i=l=>(h,u)=>{const p=Qc(e,u,l==="exit"?e.presenceContext?.custom:void 0);if(p){const{transition:y,transitionEnd:m,...g}=p;h={...h,...g,...m}}return h};function r(l){t=l(e)}function s(l){const{props:h}=e,u=J$(e.parent)||{},p=[],y=new Set;let m={},g=1/0;for(let M=0;M<Ale;M++){const _=qle[M],v=n[_],L=h[_]!==void 0?h[_]:u[_],w=D1(L),C=_===l?v.isActive:null;C===!1&&(g=M);let b=L===u[_]&&L!==h[_]&&w;if(b&&c&&e.manuallyAnimateOnMount&&(b=!1),v.protectedKeys={...m},!v.isActive&&C===null||!L&&!v.prevProp||fL(L)||typeof L=="boolean")continue;const x=Ple(v.prevProp,L);let I=x||_===l&&v.isActive&&!b&&w||M>g&&w,S=!1;const j=Array.isArray(L)?L:[L];let $=j.reduce(i(_),{});C===!1&&($={});const{prevResolvedValues:q={}}=v,H={...q,...$},D=A=>{I=!0,y.has(A)&&(S=!0,y.delete(A)),v.needsAnimating[A]=!0;const R=e.getValue(A);R&&(R.liveStyle=!1)};for(const A in H){const R=$[A],P=q[A];if(m.hasOwnProperty(A))continue;let T=!1;aw(R)&&aw(P)?T=!Y$(R,P):T=R!==P,T?R!=null?D(A):y.add(A):R!==void 0&&y.has(A)?D(A):v.protectedKeys[A]=!0}v.prevProp=L,v.prevResolvedValues=$,v.isActive&&(m={...m,...$}),c&&e.blockInitialAnimation&&(I=!1);const z=b&&x;I&&(!z||S)&&p.push(...j.map(A=>{const R={type:_};if(typeof A=="string"&&c&&!z&&e.manuallyAnimateOnMount&&e.parent){const{parent:P}=e,T=Qc(P,A);if(P.enteringChildren&&T){const{delayChildren:E}=T.transition||{};R.delay=X$(P.enteringChildren,e,E)}}return{animation:A,options:R}}))}if(y.size){const M={};if(typeof h.initial!="boolean"){const _=Qc(e,Array.isArray(h.initial)?h.initial[0]:h.initial);_&&_.transition&&(M.transition=_.transition)}y.forEach(_=>{const v=e.getBaseTarget(_),L=e.getValue(_);L&&(L.liveStyle=!0),M[_]=v??null}),p.push({animation:M})}let f=!!p.length;return c&&(h.initial===!1||h.initial===h.animate)&&!e.manuallyAnimateOnMount&&(f=!1),c=!1,f?t(p):Promise.resolve()}function d(l,h){if(n[l].isActive===h)return Promise.resolve();e.variantChildren?.forEach(p=>p.animationState?.setActive(l,h)),n[l].isActive=h;const u=s(l);for(const p in n)n[p].protectedKeys={};return u}return{animateChanges:s,setActive:d,setAnimateFunction:r,getState:()=>n,reset:()=>{n=TC()}}}function Ple(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Y$(t,e):!1}function Dt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function TC(){return{animate:Dt(!0),whileInView:Dt(),whileHover:Dt(),whileTap:Dt(),whileDrag:Dt(),whileFocus:Dt(),exit:Dt()}}class Vt{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Tle extends Vt{constructor(t){super(t),t.animationState||(t.animationState=Vle(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();fL(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let Hle=0;class Dle extends Vt{constructor(){super(...arguments),this.id=Hle++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:c}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===c)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const Ble={animation:{Feature:Tle},exit:{Feature:Dle}};function R1(e,t,n,c={passive:!0}){return e.addEventListener(t,n,c),()=>e.removeEventListener(t,n)}function W1(e){return{point:{x:e.pageX,y:e.pageY}}}const Rle=e=>t=>Aw(t)&&e(t,W1(t));function q1(e,t,n,c){return R1(e,t,Rle(n),c)}const Q$=1e-4,Fle=1-Q$,Ele=1+Q$,eq=.01,Ole=0-eq,Ule=0+eq;function ze(e){return e.max-e.min}function Wle(e,t,n){return Math.abs(e-t)<=n}function HC(e,t,n,c=.5){e.origin=c,e.originPoint=pe(t.min,t.max,e.origin),e.scale=ze(n)/ze(t),e.translate=pe(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Fle&&e.scale<=Ele||isNaN(e.scale))&&(e.scale=1),(e.translate>=Ole&&e.translate<=Ule||isNaN(e.translate))&&(e.translate=0)}function A1(e,t,n,c){HC(e.x,t.x,n.x,c?c.originX:void 0),HC(e.y,t.y,n.y,c?c.originY:void 0)}function DC(e,t,n){e.min=n.min+t.min,e.max=e.min+ze(t)}function Gle(e,t,n){DC(e.x,t.x,n.x),DC(e.y,t.y,n.y)}function BC(e,t,n){e.min=t.min-n.min,e.max=e.min+ze(t)}function z1(e,t,n){BC(e.x,t.x,n.x),BC(e.y,t.y,n.y)}function Oe(e){return[e("x"),e("y")]}const tq=({current:e})=>e?e.ownerDocument.defaultView:null,RC=(e,t)=>Math.abs(e-t);function Kle(e,t){const n=RC(e.x,t.x),c=RC(e.y,t.y);return Math.sqrt(n**2+c**2)}class aq{constructor(t,n,{transformPagePoint:c,contextWindow:i=window,dragSnapToOrigin:r=!1,distanceThreshold:s=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=WL(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,g=Kle(y.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!g)return;const{point:f}=y,{timestamp:M}=Ce;this.history.push({...f,timestamp:M});const{onStart:_,onMove:v}=this.handlers;m||(_&&_(this.lastMoveEvent,y),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,y)},this.handlePointerMove=(y,m)=>{this.lastMoveEvent=y,this.lastMoveEventInfo=UL(m,this.transformPagePoint),he.update(this.updatePoint,!0)},this.handlePointerUp=(y,m)=>{this.end();const{onEnd:g,onSessionEnd:f,resumeAnimation:M}=this.handlers;if(this.dragSnapToOrigin&&M&&M(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const _=WL(y.type==="pointercancel"?this.lastMoveEventInfo:UL(m,this.transformPagePoint),this.history);this.startEvent&&g&&g(y,_),f&&f(y,_)},!Aw(t))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=c,this.distanceThreshold=s,this.contextWindow=i||window;const d=W1(t),l=UL(d,this.transformPagePoint),{point:h}=l,{timestamp:u}=Ce;this.history=[{...h,timestamp:u}];const{onSessionStart:p}=n;p&&p(t,WL(l,this.history)),this.removeListeners=E1(q1(this.contextWindow,"pointermove",this.handlePointerMove),q1(this.contextWindow,"pointerup",this.handlePointerUp),q1(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),gt(this.updatePoint)}}function UL(e,t){return t?{point:t(e.point)}:e}function FC(e,t){return{x:e.x-t.x,y:e.y-t.y}}function WL({point:e},t){return{point:e,delta:FC(e,nq(t)),offset:FC(e,Zle(t)),velocity:Xle(t,.1)}}function Zle(e){return e[0]}function nq(e){return e[e.length-1]}function Xle(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,c=null;const i=nq(e);for(;n>=0&&(c=e[n],!(i.timestamp-c.timestamp>Je(t)));)n--;if(!c)return{x:0,y:0};const r=We(i.timestamp-c.timestamp);if(r===0)return{x:0,y:0};const s={x:(i.x-c.x)/r,y:(i.y-c.y)/r};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function Yle(e,{min:t,max:n},c){return t!==void 0&&e<t?e=c?pe(t,e,c.min):Math.max(e,t):n!==void 0&&e>n&&(e=c?pe(n,e,c.max):Math.min(e,n)),e}function EC(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function Jle(e,{top:t,left:n,bottom:c,right:i}){return{x:EC(e.x,n,i),y:EC(e.y,t,c)}}function OC(e,t){let n=t.min-e.min,c=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,c]=[c,n]),{min:n,max:c}}function Qle(e,t){return{x:OC(e.x,t.x),y:OC(e.y,t.y)}}function ehe(e,t){let n=.5;const c=ze(e),i=ze(t);return i>c?n=P1(t.min,t.max-c,e.min):c>i&&(n=P1(e.min,e.max-i,t.min)),mt(0,1,n)}function the(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const cw=.35;function ahe(e=cw){return e===!1?e=0:e===!0&&(e=cw),{x:UC(e,"left","right"),y:UC(e,"top","bottom")}}function UC(e,t,n){return{min:WC(e,t),max:WC(e,n)}}function WC(e,t){return typeof e=="number"?e:e[t]||0}const nhe=new WeakMap;class ohe{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ge(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:c}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=p=>{const{dragSnapToOrigin:y}=this.getProps();y?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(W1(p).point)},s=(p,y)=>{const{drag:m,dragPropagation:g,onDragStart:f}=this.getProps();if(m&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=s0e(m),!this.openDragLock))return;this.latestPointerEvent=p,this.latestPanInfo=y,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Oe(_=>{let v=this.getAxisMotionValue(_).get()||0;if(st.test(v)){const{projection:L}=this.visualElement;if(L&&L.layout){const w=L.layout.layoutBox[_];w&&(v=ze(w)*(parseFloat(v)/100))}}this.originPoint[_]=v}),f&&he.postRender(()=>f(p,y)),nw(this.visualElement,"transform");const{animationState:M}=this.visualElement;M&&M.setActive("whileDrag",!0)},d=(p,y)=>{this.latestPointerEvent=p,this.latestPanInfo=y;const{dragPropagation:m,dragDirectionLock:g,onDirectionLock:f,onDrag:M}=this.getProps();if(!m&&!this.openDragLock)return;const{offset:_}=y;if(g&&this.currentDirection===null){this.currentDirection=che(_),this.currentDirection!==null&&f&&f(this.currentDirection);return}this.updateAxis("x",y.point,_),this.updateAxis("y",y.point,_),this.visualElement.render(),M&&M(p,y)},l=(p,y)=>{this.latestPointerEvent=p,this.latestPanInfo=y,this.stop(p,y),this.latestPointerEvent=null,this.latestPanInfo=null},h=()=>Oe(p=>this.getAnimationState(p)==="paused"&&this.getAxisMotionValue(p).animation?.play()),{dragSnapToOrigin:u}=this.getProps();this.panSession=new aq(t,{onSessionStart:r,onStart:s,onMove:d,onSessionEnd:l,resumeAnimation:h},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:c,contextWindow:tq(this.visualElement)})}stop(t,n){const c=t||this.latestPointerEvent,i=n||this.latestPanInfo,r=this.isDragging;if(this.cancel(),!r||!i||!c)return;const{velocity:s}=i;this.startAnimation(s);const{onDragEnd:d}=this.getProps();d&&he.postRender(()=>d(c,i))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:c}=this.getProps();!c&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,c){const{drag:i}=this.getProps();if(!c||!J1(t,i,this.currentDirection))return;const r=this.getAxisMotionValue(t);let s=this.originPoint[t]+c[t];this.constraints&&this.constraints[t]&&(s=Yle(s,this.constraints[t],this.elastic[t])),r.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),c=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;t&&Ec(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&c?this.constraints=Jle(c.layoutBox,t):this.constraints=!1,this.elastic=ahe(n),i!==this.constraints&&c&&this.constraints&&!this.hasMutatedConstraints&&Oe(r=>{this.constraints!==!1&&this.getAxisMotionValue(r)&&(this.constraints[r]=the(c.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Ec(t))return!1;const c=t.current;Qe(c!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const r=ile(c,i.root,this.visualElement.getTransformPagePoint());let s=Qle(i.layout.layoutBox,r);if(n){const d=n(nle(s));this.hasMutatedConstraints=!!d,d&&(s=B$(d))}return s}startAnimation(t){const{drag:n,dragMomentum:c,dragElastic:i,dragTransition:r,dragSnapToOrigin:s,onDragTransitionEnd:d}=this.getProps(),l=this.constraints||{},h=Oe(u=>{if(!J1(u,n,this.currentDirection))return;let p=l&&l[u]||{};s&&(p={min:0,max:0});const y=i?200:1e6,m=i?40:1e7,g={type:"inertia",velocity:c?t[u]:0,bounceStiffness:y,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...r,...p};return this.startAxisValueAnimation(u,g)});return Promise.all(h).then(d)}startAxisValueAnimation(t,n){const c=this.getAxisMotionValue(t);return nw(this.visualElement,t),c.start(Fw(t,c,0,n,this.visualElement,!1))}stopAnimation(){Oe(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Oe(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,c=this.visualElement.getProps(),i=c[n];return i||this.visualElement.getValue(t,(c.initial?c.initial[t]:void 0)||0)}snapToCursor(t){Oe(n=>{const{drag:c}=this.getProps();if(!J1(n,c,this.currentDirection))return;const{projection:i}=this.visualElement,r=this.getAxisMotionValue(n);if(i&&i.layout){const{min:s,max:d}=i.layout.layoutBox[n];r.set(t[n]-pe(s,d,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:c}=this.visualElement;if(!Ec(n)||!c||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Oe(s=>{const d=this.getAxisMotionValue(s);if(d&&this.constraints!==!1){const l=d.get();i[s]=ehe({min:l,max:l},this.constraints[s])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",c.root&&c.root.updateScroll(),c.updateLayout(),this.resolveConstraints(),Oe(s=>{if(!J1(s,t,null))return;const d=this.getAxisMotionValue(s),{min:l,max:h}=this.constraints[s];d.set(pe(l,h,i[s]))})}addListeners(){if(!this.visualElement.current)return;nhe.set(this.visualElement,this);const t=this.visualElement.current,n=q1(t,"pointerdown",l=>{const{drag:h,dragListener:u=!0}=this.getProps();h&&u&&this.start(l)}),c=()=>{const{dragConstraints:l}=this.getProps();Ec(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,r=i.addEventListener("measure",c);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),he.read(c);const s=R1(window,"resize",()=>this.scalePositionWithinConstraints()),d=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:h})=>{this.isDragging&&h&&(Oe(u=>{const p=this.getAxisMotionValue(u);p&&(this.originPoint[u]+=l[u].translate,p.set(p.get()+l[u].translate))}),this.visualElement.render())});return()=>{s(),n(),r(),d&&d()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:c=!1,dragPropagation:i=!1,dragConstraints:r=!1,dragElastic:s=cw,dragMomentum:d=!0}=t;return{...t,drag:n,dragDirectionLock:c,dragPropagation:i,dragConstraints:r,dragElastic:s,dragMomentum:d}}}function J1(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function che(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class ihe extends Vt{constructor(t){super(t),this.removeGroupControls=Ke,this.removeListeners=Ke,this.controls=new ohe(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ke}unmount(){this.removeGroupControls(),this.removeListeners()}}const GC=e=>(t,n)=>{e&&he.postRender(()=>e(t,n))};class rhe extends Vt{constructor(){super(...arguments),this.removePointerDownListener=Ke}onPointerDown(t){this.session=new aq(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:tq(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:c,onPanEnd:i}=this.node.getProps();return{onSessionStart:GC(t),onStart:GC(n),onMove:c,onEnd:(r,s)=>{delete this.session,i&&he.postRender(()=>i(r,s))}}}mount(){this.removePointerDownListener=q1(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const eL={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function KC(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const d1={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(U.test(e))e=parseFloat(e);else return e;const n=KC(e,t.target.x),c=KC(e,t.target.y);return`${n}% ${c}%`}},she={correct:(e,{treeScale:t,projectionDelta:n})=>{const c=e,i=At.parse(e);if(i.length>5)return c;const r=At.createTransformer(e),s=typeof i[0]!="number"?1:0,d=n.x.scale*t.x,l=n.y.scale*t.y;i[0+s]/=d,i[1+s]/=l;const h=pe(d,l,.5);return typeof i[2+s]=="number"&&(i[2+s]/=h),typeof i[3+s]=="number"&&(i[3+s]/=h),r(i)}};let GL=!1;class dhe extends k.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:c,layoutId:i}=this.props,{projection:r}=t;$0e(lhe),r&&(n.group&&n.group.add(r),c&&c.register&&i&&c.register(r),GL&&r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,onExitComplete:()=>this.safeToRemove()})),eL.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:c,drag:i,isPresent:r}=this.props,{projection:s}=c;return s&&(s.isPresent=r,GL=!0,i||t.layoutDependency!==n||n===void 0||t.isPresent!==r?s.willUpdate():this.safeToRemove(),t.isPresent!==r&&(r?s.promote():s.relegate()||he.postRender(()=>{const d=s.getStack();(!d||!d.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),qw.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:c}=this.props,{projection:i}=t;GL=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),c&&c.deregister&&c.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function oq(e){const[t,n]=w$(),c=k.useContext(lw);return o.jsx(dhe,{...e,layoutGroup:c,switchLayoutGroup:k.useContext(H$),isPresent:t,safeToRemove:n})}const lhe={borderRadius:{...d1,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:d1,borderTopRightRadius:d1,borderBottomLeftRadius:d1,borderBottomRightRadius:d1,boxShadow:she};function hhe(e,t,n){const c=Ne(e)?e:$c(e);return c.start(Fw("",c,t,n)),c.animation}const uhe=(e,t)=>e.depth-t.depth;class phe{constructor(){this.children=[],this.isDirty=!1}add(t){pw(this.children,t),this.isDirty=!0}remove(t){yw(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(uhe),this.isDirty=!1,this.children.forEach(t)}}function yhe(e,t){const n=He.now(),c=({timestamp:i})=>{const r=i-n;r>=t&&(gt(c),e(r-t))};return he.setup(c,!0),()=>gt(c)}const cq=["TopLeft","TopRight","BottomLeft","BottomRight"],khe=cq.length,ZC=e=>typeof e=="string"?parseFloat(e):e,XC=e=>typeof e=="number"||U.test(e);function mhe(e,t,n,c,i,r){i?(e.opacity=pe(0,n.opacity??1,fhe(c)),e.opacityExit=pe(t.opacity??1,0,ghe(c))):r&&(e.opacity=pe(t.opacity??1,n.opacity??1,c));for(let s=0;s<khe;s++){const d=`border${cq[s]}Radius`;let l=YC(t,d),h=YC(n,d);if(l===void 0&&h===void 0)continue;l||(l=0),h||(h=0),l===0||h===0||XC(l)===XC(h)?(e[d]=Math.max(pe(ZC(l),ZC(h),c),0),(st.test(h)||st.test(l))&&(e[d]+="%")):e[d]=h}(t.rotate||n.rotate)&&(e.rotate=pe(t.rotate||0,n.rotate||0,c))}function YC(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const fhe=iq(0,.5,US),ghe=iq(.5,.95,Ke);function iq(e,t,n){return c=>c<e?0:c>t?1:n(P1(e,t,c))}function JC(e,t){e.min=t.min,e.max=t.max}function Re(e,t){JC(e.x,t.x),JC(e.y,t.y)}function QC(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function eN(e,t,n,c,i){return e-=t,e=dL(e,1/n,c),i!==void 0&&(e=dL(e,1/i,c)),e}function vhe(e,t=0,n=1,c=.5,i,r=e,s=e){if(st.test(t)&&(t=parseFloat(t),t=pe(s.min,s.max,t/100)-s.min),typeof t!="number")return;let d=pe(r.min,r.max,c);e===r&&(d-=t),e.min=eN(e.min,t,n,d,i),e.max=eN(e.max,t,n,d,i)}function tN(e,t,[n,c,i],r,s){vhe(e,t[n],t[c],t[i],t.scale,r,s)}const Mhe=["x","scaleX","originX"],_he=["y","scaleY","originY"];function aN(e,t,n,c){tN(e.x,t,Mhe,n?n.x:void 0,c?c.x:void 0),tN(e.y,t,_he,n?n.y:void 0,c?c.y:void 0)}function nN(e){return e.translate===0&&e.scale===1}function rq(e){return nN(e.x)&&nN(e.y)}function oN(e,t){return e.min===t.min&&e.max===t.max}function xhe(e,t){return oN(e.x,t.x)&&oN(e.y,t.y)}function cN(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function sq(e,t){return cN(e.x,t.x)&&cN(e.y,t.y)}function iN(e){return ze(e.x)/ze(e.y)}function rN(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Lhe{constructor(){this.members=[]}add(t){pw(this.members,t),t.scheduleRender()}remove(t){if(yw(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let c;for(let i=n;i>=0;i--){const r=this.members[i];if(r.isPresent!==!1){c=r;break}}return c?(this.promote(c),!0):!1}promote(t,n){const c=this.lead;if(t!==c&&(this.prevLead=c,this.lead=t,t.show(),c)){c.instance&&c.scheduleRender(),t.scheduleRender(),t.resumeFrom=c,n&&(t.resumeFrom.preserveOpacity=!0),c.snapshot&&(t.snapshot=c.snapshot,t.snapshot.latestValues=c.animationValues||c.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&c.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:c}=t;n.onExitComplete&&n.onExitComplete(),c&&c.options.onExitComplete&&c.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Ihe(e,t,n){let c="";const i=e.x.translate/t.x,r=e.y.translate/t.y,s=n?.z||0;if((i||r||s)&&(c=`translate3d(${i}px, ${r}px, ${s}px) `),(t.x!==1||t.y!==1)&&(c+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:h,rotate:u,rotateX:p,rotateY:y,skewX:m,skewY:g}=n;h&&(c=`perspective(${h}px) ${c}`),u&&(c+=`rotate(${u}deg) `),p&&(c+=`rotateX(${p}deg) `),y&&(c+=`rotateY(${y}deg) `),m&&(c+=`skewX(${m}deg) `),g&&(c+=`skewY(${g}deg) `)}const d=e.x.scale*t.x,l=e.y.scale*t.y;return(d!==1||l!==1)&&(c+=`scale(${d}, ${l})`),c||"none"}const KL=["","X","Y","Z"],bhe=1e3;let whe=0;function ZL(e,t,n,c){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),c&&(c[e]=0))}function dq(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=K$(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",he,!(i||r))}const{parent:c}=e;c&&!c.hasCheckedOptimisedAppear&&dq(c)}function lq({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:c,resetTransform:i}){return class{constructor(s={},d=t?.()){this.id=whe++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(jhe),this.nodes.forEach(Ahe),this.nodes.forEach(zhe),this.nodes.forEach(She)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=d?d.root||d:this,this.path=d?[...d.path,d]:[],this.parent=d,this.depth=d?d.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new phe)}addEventListener(s,d){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new mw),this.eventHandlers.get(s).add(d)}notifyListeners(s,...d){const l=this.eventHandlers.get(s);l&&l.notify(...d)}hasListeners(s){return this.eventHandlers.has(s)}mount(s){if(this.instance)return;this.isSVG=b$(s)&&!y0e(s),this.instance=s;const{layoutId:d,layout:l,visualElement:h}=this.options;if(h&&!h.current&&h.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||d)&&(this.isLayoutDirty=!0),e){let u,p=0;const y=()=>this.root.updateBlockedByResize=!1;he.read(()=>{p=window.innerWidth}),e(s,()=>{const m=window.innerWidth;m!==p&&(p=m,this.root.updateBlockedByResize=!0,u&&u(),u=yhe(y,250),eL.hasAnimatedSinceResize&&(eL.hasAnimatedSinceResize=!1,this.nodes.forEach(lN)))})}d&&this.root.registerSharedNode(d,this),this.options.animate!==!1&&h&&(d||l)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:p,hasRelativeLayoutChanged:y,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||h.getDefaultTransition()||Dhe,{onLayoutAnimationStart:f,onLayoutAnimationComplete:M}=h.getProps(),_=!this.targetLayout||!sq(this.targetLayout,m),v=!p&&y;if(this.options.layoutRoot||this.resumeFrom||v||p&&(_||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const L={...Sw(g,"layout"),onPlay:f,onComplete:M};(h.shouldReduceMotion||this.options.layoutRoot)&&(L.delay=0,L.type=!1),this.startAnimation(L),this.setAnimationOrigin(u,v)}else p||lN(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),gt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Vhe),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&dq(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const p=this.path[u];p.shouldResetTransform=!0,p.updateScroll("snapshot"),p.options.layoutRoot&&p.willUpdate(!1)}const{layoutId:d,layout:l}=this.options;if(d===void 0&&!l)return;const h=this.getTransformTemplate();this.prevTransformTemplateValue=h?h(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(sN);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(dN);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(qhe),this.nodes.forEach(Che),this.nodes.forEach(Nhe)):this.nodes.forEach(dN),this.clearAllSnapshots();const d=He.now();Ce.delta=mt(0,1e3/60,d-Ce.timestamp),Ce.timestamp=d,Ce.isProcessing=!0,TL.update.process(Ce),TL.preRender.process(Ce),TL.render.process(Ce),Ce.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,qw.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach($he),this.sharedNodes.forEach(Phe)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,he.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){he.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ze(this.snapshot.measuredBox.x)&&!ze(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const s=this.layout;this.layout=this.measure(!1),this.layoutCorrected=ge(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:d}=this.options;d&&d.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let d=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(d=!1),d&&this.instance){const l=c(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,d=this.projectionDelta&&!rq(this.projectionDelta),l=this.getTransformTemplate(),h=l?l(this.latestValues,""):void 0,u=h!==this.prevTransformTemplateValue;s&&this.instance&&(d||Ic(this.latestValues)||u)&&(i(this.instance,h),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const d=this.measurePageBox();let l=this.removeElementScroll(d);return s&&(l=this.removeTransform(l)),Bhe(l),{animationId:this.root.animationId,measuredBox:d,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:s}=this.options;if(!s)return ge();const d=s.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Rhe))){const{scroll:h}=this.root;h&&(Oc(d.x,h.offset.x),Oc(d.y,h.offset.y))}return d}removeElementScroll(s){const d=ge();if(Re(d,s),this.scroll?.wasRoot)return d;for(let l=0;l<this.path.length;l++){const h=this.path[l],{scroll:u,options:p}=h;h!==this.root&&u&&p.layoutScroll&&(u.wasRoot&&Re(d,s),Oc(d.x,u.offset.x),Oc(d.y,u.offset.y))}return d}applyTransform(s,d=!1){const l=ge();Re(l,s);for(let h=0;h<this.path.length;h++){const u=this.path[h];!d&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Uc(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Ic(u.latestValues)&&Uc(l,u.latestValues)}return Ic(this.latestValues)&&Uc(l,this.latestValues),l}removeTransform(s){const d=ge();Re(d,s);for(let l=0;l<this.path.length;l++){const h=this.path[l];if(!h.instance||!Ic(h.latestValues))continue;Qb(h.latestValues)&&h.updateSnapshot();const u=ge(),p=h.measurePageBox();Re(u,p),aN(d,h.latestValues,h.snapshot?h.snapshot.layoutBox:void 0,u)}return Ic(this.latestValues)&&aN(d,this.latestValues),d}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ce.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){const d=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=d.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=d.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=d.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==d;if(!(s||l&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:p}=this.options;if(!(!this.layout||!(u||p))){if(this.resolvedRelativeTargetAt=Ce.timestamp,!this.targetDelta&&!this.relativeTarget){const y=this.getClosestProjectingParent();y&&y.layout&&this.animationProgress!==1?(this.relativeParent=y,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ge(),this.relativeTargetOrigin=ge(),z1(this.relativeTargetOrigin,this.layout.layoutBox,y.layout.layoutBox),Re(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=ge(),this.targetWithTransforms=ge()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Gle(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Re(this.target,this.layout.layoutBox),F$(this.target,this.targetDelta)):Re(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const y=this.getClosestProjectingParent();y&&!!y.resumingFrom==!!this.resumingFrom&&!y.options.layoutScroll&&y.target&&this.animationProgress!==1?(this.relativeParent=y,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ge(),this.relativeTargetOrigin=ge(),z1(this.relativeTargetOrigin,this.target,y.target),Re(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||Qb(this.parent.latestValues)||R$(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){const s=this.getLead(),d=!!this.resumingFrom||this!==s;let l=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(l=!1),d&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===Ce.timestamp&&(l=!1),l)return;const{layout:h,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(h||u))return;Re(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,y=this.treeScale.y;cle(this.layoutCorrected,this.treeScale,this.path,d),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox,s.targetWithTransforms=ge());const{target:m}=s;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(QC(this.prevProjectionDelta.x,this.projectionDelta.x),QC(this.prevProjectionDelta.y,this.projectionDelta.y)),A1(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==y||!rN(this.projectionDelta.x,this.prevProjectionDelta.x)||!rN(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){if(this.options.visualElement?.scheduleRender(),s){const d=this.getStack();d&&d.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Wc(),this.projectionDelta=Wc(),this.projectionDeltaWithTransform=Wc()}setAnimationOrigin(s,d=!1){const l=this.snapshot,h=l?l.latestValues:{},u={...this.latestValues},p=Wc();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!d;const y=ge(),m=l?l.source:void 0,g=this.layout?this.layout.source:void 0,f=m!==g,M=this.getStack(),_=!M||M.members.length<=1,v=!!(f&&!_&&this.options.crossfade===!0&&!this.path.some(Hhe));this.animationProgress=0;let L;this.mixTargetDelta=w=>{const C=w/1e3;hN(p.x,s.x,C),hN(p.y,s.y,C),this.setTargetDelta(p),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(z1(y,this.layout.layoutBox,this.relativeParent.layout.layoutBox),The(this.relativeTarget,this.relativeTargetOrigin,y,C),L&&xhe(this.relativeTarget,L)&&(this.isProjectionDirty=!1),L||(L=ge()),Re(L,this.relativeTarget)),f&&(this.animationValues=u,mhe(u,h,this.latestValues,C,v,_)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=C},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(gt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=he.update(()=>{eL.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=$c(0)),this.currentAnimation=hhe(this.motionValue,[0,1e3],{...s,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),s.onUpdate&&s.onUpdate(d)},onStop:()=>{},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(bhe),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:d,target:l,layout:h,latestValues:u}=s;if(!(!d||!l||!h)){if(this!==s&&this.layout&&h&&hq(this.options.animationType,this.layout.layoutBox,h.layoutBox)){l=this.target||ge();const p=ze(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+p;const y=ze(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+y}Re(d,l),Uc(d,u),A1(this.projectionDeltaWithTransform,this.layoutCorrected,d,u)}}registerSharedNode(s,d){this.sharedNodes.has(s)||this.sharedNodes.set(s,new Lhe),this.sharedNodes.get(s).add(d);const h=d.options.initialPromotionConfig;d.promote({transition:h?h.transition:void 0,preserveFollowOpacity:h&&h.shouldPreserveFollowOpacity?h.shouldPreserveFollowOpacity(d):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){const{layoutId:s}=this.options;return s?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:s}=this.options;return s?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:d,preserveFollowOpacity:l}={}){const h=this.getStack();h&&h.promote(this,l),s&&(this.projectionDelta=void 0,this.needsReset=!0),d&&this.setOptions({transition:d})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let d=!1;const{latestValues:l}=s;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(d=!0),!d)return;const h={};l.z&&ZL("z",s,h,this.animationValues);for(let u=0;u<KL.length;u++)ZL(`rotate${KL[u]}`,s,h,this.animationValues),ZL(`skew${KL[u]}`,s,h,this.animationValues);s.render();for(const u in h)s.setStaticValue(u,h[u]),this.animationValues&&(this.animationValues[u]=h[u]);s.scheduleRender()}applyProjectionStyles(s,d){if(!this.instance||this.isSVG)return;if(!this.isVisible){s.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,s.visibility="",s.opacity="",s.pointerEvents=Qx(d?.pointerEvents)||"",s.transform=l?l(this.latestValues,""):"none";return}const h=this.getLead();if(!this.projectionDelta||!this.layout||!h.target){this.options.layoutId&&(s.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,s.pointerEvents=Qx(d?.pointerEvents)||""),this.hasProjected&&!Ic(this.latestValues)&&(s.transform=l?l({},""):"none",this.hasProjected=!1);return}s.visibility="";const u=h.animationValues||h.latestValues;this.applyTransformsToTarget();let p=Ihe(this.projectionDeltaWithTransform,this.treeScale,u);l&&(p=l(u,p)),s.transform=p;const{x:y,y:m}=this.projectionDelta;s.transformOrigin=`${y.origin*100}% ${m.origin*100}% 0`,h.animationValues?s.opacity=h===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:s.opacity=h===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const g in B1){if(u[g]===void 0)continue;const{correct:f,applyTo:M,isCSSVariable:_}=B1[g],v=p==="none"?u[g]:f(u[g],h);if(M){const L=M.length;for(let w=0;w<L;w++)s[M[w]]=v}else _?this.options.visualElement.renderState.vars[g]=v:s[g]=v}this.options.layoutId&&(s.pointerEvents=h===this?Qx(d?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>s.currentAnimation?.stop()),this.root.nodes.forEach(sN),this.root.sharedNodes.clear()}}}function Che(e){e.updateLayout()}function Nhe(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:c}=e.layout,{animationType:i}=e.options,r=t.source!==e.layout.source;i==="size"?Oe(u=>{const p=r?t.measuredBox[u]:t.layoutBox[u],y=ze(p);p.min=n[u].min,p.max=p.min+y}):hq(i,t.layoutBox,n)&&Oe(u=>{const p=r?t.measuredBox[u]:t.layoutBox[u],y=ze(n[u]);p.max=p.min+y,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+y)});const s=Wc();A1(s,n,t.layoutBox);const d=Wc();r?A1(d,e.applyTransform(c,!0),t.measuredBox):A1(d,n,t.layoutBox);const l=!rq(s);let h=!1;if(!e.resumeFrom){const u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:p,layout:y}=u;if(p&&y){const m=ge();z1(m,t.layoutBox,p.layoutBox);const g=ge();z1(g,n,y.layoutBox),sq(m,g)||(h=!0),u.options.layoutRoot&&(e.relativeTarget=g,e.relativeTargetOrigin=m,e.relativeParent=u)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:d,layoutDelta:s,hasLayoutChanged:l,hasRelativeLayoutChanged:h})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function jhe(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function She(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function $he(e){e.clearSnapshot()}function sN(e){e.clearMeasurements()}function dN(e){e.isLayoutDirty=!1}function qhe(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function lN(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Ahe(e){e.resolveTargetDelta()}function zhe(e){e.calcProjection()}function Vhe(e){e.resetSkewAndRotation()}function Phe(e){e.removeLeadSnapshot()}function hN(e,t,n){e.translate=pe(t.translate,0,n),e.scale=pe(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function uN(e,t,n,c){e.min=pe(t.min,n.min,c),e.max=pe(t.max,n.max,c)}function The(e,t,n,c){uN(e.x,t.x,n.x,c),uN(e.y,t.y,n.y,c)}function Hhe(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Dhe={duration:.45,ease:[.4,0,.1,1]},pN=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),yN=pN("applewebkit/")&&!pN("chrome/")?Math.round:Ke;function kN(e){e.min=yN(e.min),e.max=yN(e.max)}function Bhe(e){kN(e.x),kN(e.y)}function hq(e,t,n){return e==="position"||e==="preserve-aspect"&&!Wle(iN(t),iN(n),.2)}function Rhe(e){return e!==e.root&&e.scroll?.wasRoot}const Fhe=lq({attachResizeListener:(e,t)=>R1(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),XL={current:void 0},uq=lq({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!XL.current){const e=new Fhe({});e.mount(window),e.setOptions({layoutScroll:!0}),XL.current=e}return XL.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Ehe={pan:{Feature:rhe},drag:{Feature:ihe,ProjectionNode:uq,MeasureLayout:oq}};function mN(e,t,n){const{props:c}=e;e.animationState&&c.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,r=c[i];r&&he.postRender(()=>r(t,W1(t)))}class Ohe extends Vt{mount(){const{current:t}=this.node;t&&(this.unmount=d0e(t,(n,c)=>(mN(this.node,c,"Start"),i=>mN(this.node,i,"End"))))}unmount(){}}class Uhe extends Vt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=E1(R1(this.node.current,"focus",()=>this.onFocus()),R1(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function fN(e,t,n){const{props:c}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&c.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),r=c[i];r&&he.postRender(()=>r(t,W1(t)))}class Whe extends Vt{mount(){const{current:t}=this.node;t&&(this.unmount=p0e(t,(n,c)=>(fN(this.node,c,"Start"),(i,{success:r})=>fN(this.node,i,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const iw=new WeakMap,YL=new WeakMap,Ghe=e=>{const t=iw.get(e.target);t&&t(e)},Khe=e=>{e.forEach(Ghe)};function Zhe({root:e,...t}){const n=e||document;YL.has(n)||YL.set(n,{});const c=YL.get(n),i=JSON.stringify(t);return c[i]||(c[i]=new IntersectionObserver(Khe,{root:e,...t})),c[i]}function Xhe(e,t,n){const c=Zhe(t);return iw.set(e,n),c.observe(e),()=>{iw.delete(e),c.unobserve(e)}}const Yhe={some:0,all:1};class Jhe extends Vt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:c,amount:i="some",once:r}=t,s={root:n?n.current:void 0,rootMargin:c,threshold:typeof i=="number"?i:Yhe[i]},d=l=>{const{isIntersecting:h}=l;if(this.isInView===h||(this.isInView=h,r&&!h&&this.hasEnteredView))return;h&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",h);const{onViewportEnter:u,onViewportLeave:p}=this.node.getProps(),y=h?u:p;y&&y(l)};return Xhe(this.node.current,s,d)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Qhe(t,n))&&this.startObserver()}unmount(){}}function Qhe({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const eue={inView:{Feature:Jhe},tap:{Feature:Whe},focus:{Feature:Uhe},hover:{Feature:Ohe}},tue={layout:{ProjectionNode:uq,MeasureLayout:oq}},aue={...Ble,...eue,...Ehe,...tue},Ew=ale(aue,kle);function pq(e){const t=zt(()=>$c(e)),{isStatic:n}=k.useContext(kL);if(n){const[,c]=k.useState(e);k.useEffect(()=>t.on("change",c),[])}return t}function yq(e,t){const n=pq(t()),c=()=>n.set(t());return c(),uw(()=>{const i=()=>he.preRender(c,!1,!0),r=e.map(s=>s.on("change",i));return()=>{r.forEach(s=>s()),gt(c)}}),n}function nue(e){$1.current=[],e();const t=yq($1.current,e);return $1.current=void 0,t}function oue(e,t,n,c){if(typeof e=="function")return nue(e);const i=typeof t=="function"?t:k0e(t,n,c);return Array.isArray(e)?gN(e,i):gN([e],([r])=>i(r))}function gN(e,t){const n=zt(()=>[]);return yq(e,()=>{n.length=0;const c=e.length;for(let i=0;i<c;i++)n[i]=e[i].get();return t(n)})}class cue{constructor(){this.componentControls=new Set}subscribe(t){return this.componentControls.add(t),()=>this.componentControls.delete(t)}start(t,n){this.componentControls.forEach(c=>{c.start(t.nativeEvent||t,n)})}cancel(){this.componentControls.forEach(t=>{t.cancel()})}stop(){this.componentControls.forEach(t=>{t.stop()})}}const iue=()=>new cue;function rue(){return zt(iue)}const kq=k.createContext(null);function sue(e,t,n,c){if(!c)return e;const i=e.findIndex(u=>u.value===t);if(i===-1)return e;const r=c>0?1:-1,s=e[i+r];if(!s)return e;const d=e[i],l=s.layout,h=pe(l.min,l.max,.5);return r===1&&d.layout.max+n>h||r===-1&&d.layout.min+n<h?_2e(e,i,i+r):e}function due({children:e,as:t="ul",axis:n="y",onReorder:c,values:i,...r},s){const d=zt(()=>Ew[t]),l=[],h=k.useRef(!1);Qe(!!i,"Reorder.Group must be provided a values prop","reorder-values");const u={axis:n,registerItem:(p,y)=>{const m=l.findIndex(g=>p===g.value);m!==-1?l[m].layout=y[n]:l.push({value:p,layout:y[n]}),l.sort(uue)},updateOrder:(p,y,m)=>{if(h.current)return;const g=sue(l,p,y,m);l!==g&&(h.current=!0,c(g.map(hue).filter(f=>i.indexOf(f)!==-1)))}};return k.useEffect(()=>{h.current=!1}),o.jsx(d,{...r,ref:s,ignoreStrict:!0,children:o.jsx(kq.Provider,{value:u,children:e})})}const lue=k.forwardRef(due);function hue(e){return e.value}function uue(e,t){return e.layout.min-t.layout.min}function vN(e,t=0){return Ne(e)?e:pq(t)}function pue({children:e,style:t={},value:n,as:c="li",onDrag:i,layout:r=!0,...s},d){const l=zt(()=>Ew[c]),h=k.useContext(kq),u={x:vN(t.x),y:vN(t.y)},p=oue([u.x,u.y],([f,M])=>f||M?1:"unset");Qe(!!h,"Reorder.Item must be a child of Reorder.Group","reorder-item-child");const{axis:y,registerItem:m,updateOrder:g}=h;return o.jsx(l,{drag:y,...s,dragSnapToOrigin:!0,style:{...t,x:u.x,y:u.y,zIndex:p},layout:r,onDrag:(f,M)=>{const{velocity:_}=M;_[y]&&g(n,u[y].get(),_[y]),i&&i(f,M)},onLayoutMeasure:f=>m(n,f),ref:d,ignoreStrict:!0,children:e})}const yue=k.forwardRef(pue),lL=[o.jsx(j1,{size:18}),o.jsx(Ct,{size:18}),o.jsx(C1,{size:18}),o.jsx(Nt,{size:18}),o.jsx(g1,{size:18}),o.jsx(f1,{size:18})],kue=({items:e,onReorder:t,draggable:n=!1,className:c,header:i,headerStyle:r,itemsDraggable:s=!0})=>{const[d,l]=k.useState(e??[]);return k.useEffect(()=>{e&&Array.isArray(e)?(e.forEach((h,u)=>{if(h.icon==null&&(h.icon=lL[u%lL.length]),typeof h.text=="string"&&h.text.includes("/")){const p=String(h.text).split("/"),y=p[0].trim(),g=p.slice(1).join("/").trim().match(/^(\d+)(.*)$/);if(g){const f=g[1],M=g[2]??"",_=f.padStart(3,"0");h.text=`${y} / ${_}${M}`}}}),l(e)):l([])},[e]),o.jsxs("div",{className:`trend-list ${c??""}`,draggable:n,style:{position:"relative"},children:[o.jsx("div",{className:"trend-header",style:r,children:i??"Trend"}),o.jsx("div",{className:"trend-list-body",style:{opacity:n?0:1},children:o.jsx(lue,{axis:"y",values:d,onReorder:h=>{l(h),t?.(h)},style:{display:"flex",flexDirection:"column",gap:8},children:d.map((h,u)=>o.jsx(mue,{value:h,index:u,itemsDraggable:s},String(h.id)))})}),n&&o.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:o.jsx(a.Move,{size:48,strokeWidth:1.5,style:{opacity:.8}})})]})};function mue({value:e,index:t}){const n=rue(),c=lL[t%lL.length]??null;return o.jsx(yue,{value:e,dragListener:!1,dragControls:n,style:{listStyle:"none"},onDragStart:()=>{try{document.body.classList.add("is-dragging")}catch{}},onDragEnd:()=>{try{document.body.classList.remove("is-dragging")}catch{}},children:o.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[o.jsx("div",{className:"reorder-handle","aria-hidden":!0,onPointerDown:i=>n.start(i),style:{width:28,height:28,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",userSelect:"none"},children:o.jsx("svg",{width:"25",height:"25",viewBox:"0 0 24 24","aria-hidden":!0,children:o.jsxs("g",{fill:"currentColor",children:[o.jsx("circle",{cx:"8",cy:"6",r:"2"}),o.jsx("circle",{cx:"16",cy:"6",r:"2"}),o.jsx("circle",{cx:"8",cy:"12",r:"2"}),o.jsx("circle",{cx:"16",cy:"12",r:"2"}),o.jsx("circle",{cx:"8",cy:"18",r:"2"}),o.jsx("circle",{cx:"16",cy:"18",r:"2"})]})})}),o.jsx("div",{style:{flex:1},children:o.jsx(zS,{title:e.title,subtitle:e.subtitle,text:e.text,background:e.background,titleStyle:e.titleStyle,subtitleStyle:e.subtitleStyle,textStyle:e.textStyle,itemStyle:e.itemStyle,icon:e.icon??c})})]})})}function fue(e,t){return t.required?t.type==="checkbox"&&!e?{isValid:!1,error:`${t.label} est requis`}:!e||typeof e=="string"&&e.trim()===""?{isValid:!1,error:`${t.label} est requis`}:null:null}function gue(e){return!e||typeof e=="string"&&e.trim()===""}function vue(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)?null:{isValid:!1,error:"Format d'email invalide"}}function Mue(e){return/^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)*\/?$/.test(e)?null:{isValid:!1,error:"Format d'URL invalide"}}function _ue(e,t){const n=Number(e);return isNaN(n)?{isValid:!1,error:"Doit être un nombre valide"}:t.validation?.min!==void 0&&n<Number(t.validation.min)?{isValid:!1,error:`Doit être ≥ ${t.validation.min}`}:t.validation?.max!==void 0&&n>Number(t.validation.max)?{isValid:!1,error:`Doit être ≤ ${t.validation.max}`}:null}function xue(e,t){return t.validation?.minDate&&new Date(e)<new Date(t.validation.minDate)?{isValid:!1,error:`Doit être après ${t.validation.minDate}`}:t.validation?.maxDate&&new Date(e)>new Date(t.validation.maxDate)?{isValid:!1,error:`Doit être avant ${t.validation.maxDate}`}:null}function Lue(e,t){if(t.validation?.acceptedTypes){const n=t.validation.acceptedTypes.split(","),c=e.type;if(!n.some(i=>c.match(i.replace("*",".*"))))return{isValid:!1,error:`Type de fichier non supporté: ${c}`}}return t.validation?.maxFileSize&&e.size>t.validation.maxFileSize?{isValid:!1,error:`Fichier trop volumineux (max ${t.validation.maxFileSize/1048576}MB)`}:null}function Iue(e,t){return t.validation?t.validation.minLength&&e.length<t.validation.minLength?{isValid:!1,error:`Minimum ${t.validation.minLength} caractères`}:t.validation.maxLength&&e.length>t.validation.maxLength?{isValid:!1,error:`Maximum ${t.validation.maxLength} caractères`}:t.validation.pattern&&!new RegExp(t.validation.pattern).test(e)?{isValid:!1,error:"Format invalide"}:null:null}function hL(e,t){const n=fue(e,t);if(n)return n;if(gue(e))return{isValid:!0};const c=e.toString();switch(t.type){case"email":{const r=vue(c);if(r)return r;break}case"url":{const r=Mue(c);if(r)return r;break}case"number":{const r=_ue(e,t);if(r)return r;break}case"date":case"month":case"week":case"time":case"datetime-local":{const r=xue(e,t);if(r)return r;break}case"file":{const r=Lue(e,t);if(r)return r;break}}const i=Iue(c,t);return i||{isValid:!0}}function mq(e,t){const n={};let c=!0;for(const i of t){const r=hL(e[i.name],i);r.isValid||(n[i.name]=r.error,c=!1)}return{isValid:c,errors:n}}const bue="_formContainer_14ads_1",wue="_headerLine_14ads_17",Cue="_formTitle_14ads_25",Nue="_formDescription_14ads_30",jue="_sectionTitle_14ads_37",Sue="_sectionHelp_14ads_44",$ue="_fieldHelp_14ads_50",que="_gridContainer_14ads_58",Aue="_fieldGridItem_14ads_70",zue="_sectionFull_14ads_105",Vue="_formFooter_14ads_110",Pue="_footerLeft_14ads_118",Tue="_footerRight_14ads_119",Hue="_cancelLink_14ads_125",Due="_submitButton_14ads_136",Bue="_fieldLabel_14ads_148",Rue="_inputWrapper_14ads_163",Fue="_inputInner_14ads_187",Eue="_hasPrefix_14ads_196",Oue="_inputBase_14ads_196",Uue="_iconPrefix_14ads_292",Wue="_iconSuffix_14ads_293",Gue="_passwordToggle_14ads_319",Kue="_fieldError_14ads_365",Zue="_fieldInvalid_14ads_372",le={formContainer:bue,headerLine:wue,formTitle:Cue,formDescription:Nue,sectionTitle:jue,sectionHelp:Sue,fieldHelp:$ue,gridContainer:que,fieldGridItem:Aue,sectionFull:zue,formFooter:Vue,footerLeft:Pue,footerRight:Tue,cancelLink:Hue,submitButton:Due,fieldLabel:Bue,inputWrapper:Rue,inputInner:Fue,hasPrefix:Eue,inputBase:Oue,iconPrefix:Uue,iconSuffix:Wue,passwordToggle:Gue,fieldError:Kue,fieldInvalid:Zue},fq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>{const[s,d]=k.useState(!1),l=e.type==="password",h=e.attributes?.showPasswordToggle??!0,u=l?s?"text":"password":e.type,p=e.attributes?.iconComponent??(e.attributes?.icon?kt[e.attributes.icon]:null),y=e.attributes?.iconPosition??"suffix",m=g=>{n(g.target.value)};return o.jsxs("div",{className:le.inputWrapper,children:[o.jsx("label",{className:`${le.fieldLabel} ${e.required?"required":""}`,htmlFor:e.name,children:e.label}),o.jsxs("div",{className:`${le.inputInner} ${p&&y==="prefix"?le.hasPrefix:""}`,children:[p&&y==="prefix"&&o.jsx("span",{className:le.iconPrefix,children:o.jsx(p,{size:16})}),o.jsx("input",{id:e.name,name:e.name,type:u,placeholder:e.placeholder,className:`${le.inputBase} ${i?le.fieldInvalid:""}`,value:t??"",onChange:m,onBlur:c,disabled:!!e.disabled,"aria-invalid":!!i,"aria-describedby":e.help?`${e.name}-help`:void 0}),l&&h&&o.jsx("button",{type:"button","aria-label":s?"Masquer le mot de passe":"Afficher le mot de passe",className:le.passwordToggle,onClick:()=>d(g=>!g),children:s?o.jsx(L1,{size:16}):o.jsx(I1,{size:16})}),p&&y==="suffix"&&!l&&o.jsx("span",{className:le.iconSuffix,children:o.jsx(p,{size:16})})]}),r&&i&&o.jsx("span",{className:le.fieldError,children:i})]})},Xue="_fieldGroup_yb3zi_7",Yue="_fieldLabel_yb3zi_11",Jue="_required_yb3zi_17",Que="_fieldInput_yb3zi_22",epe="_fieldInvalid_yb3zi_40",tpe="_fieldValid_yb3zi_44",ape="_fieldError_yb3zi_48",npe="_radioGroup_yb3zi_57",St={fieldGroup:Xue,fieldLabel:Yue,required:Jue,fieldInput:Que,fieldInvalid:epe,fieldValid:tpe,fieldError:ape,radioGroup:npe},vL=({field:e,children:t,error:n,touched:c})=>{const i=c&&n;return o.jsxs("div",{className:St.fieldGroup,children:[e.type!=="checkbox"&&e.type!=="radio"&&o.jsx("label",{className:`${St.fieldLabel} ${e.required?St.required:""}`,children:e.label}),t,i&&o.jsx("span",{className:St.fieldError,children:n})]})},gq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>{const s=r&&i,d=r&&!i&&t,l=["form-control",St.fieldInput,s?St.fieldInvalid:"",d?St.fieldValid:""].filter(Boolean).join(" ");return o.jsx(vL,{field:e,error:i,touched:r,children:o.jsx("textarea",{className:l,placeholder:e.placeholder,value:t||"",onChange:h=>n(h.target.value),onBlur:c,rows:4})})},ope="_wrapper_117u4_1",cpe="_wrapperInvalid_117u4_15",ipe="_nativeSelect_117u4_19",rpe="_display_117u4_30",spe="_topLabel_117u4_37",dpe="_valueLine_117u4_45",lpe="_valuePlaceholder_117u4_53",hpe="_valueActive_117u4_57",upe="_caret_117u4_61",ppe="_error_117u4_75",ype="_optionStyle_117u4_89",Fe={wrapper:ope,wrapperInvalid:cpe,nativeSelect:ipe,display:rpe,topLabel:spe,valueLine:dpe,valuePlaceholder:lpe,valueActive:hpe,caret:upe,error:ppe,optionStyle:ype},Ow=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>{const s=!!(r&&i),d=e.label||"",l=e.placeholder||"",h=e.options?.find(u=>String(u.value)===String(t))?.label??"";return o.jsxs("div",{className:`${Fe.wrapper} ${s?Fe.wrapperInvalid:""} ${t?Fe.wrapperHasValue:""}`,children:[o.jsxs("select",{id:e.name,name:e.name,className:Fe.nativeSelect,value:t??"",onChange:u=>n(u.target.value),onBlur:c,"aria-invalid":s,"aria-label":d,children:[o.jsx("option",{value:"",disabled:!0,hidden:!0,children:l||`Sélectionnez ${d?.toLowerCase()||""}`}),e.options?.map((u,p)=>o.jsx("option",{value:u.value,className:Fe.optionStyle,children:u.label},p))]}),o.jsxs("div",{className:Fe.display,children:[d&&o.jsx("span",{className:Fe.topLabel,children:d}),o.jsx("span",{className:`${Fe.valueLine} ${t?Fe.valueActive:Fe.valuePlaceholder}`,children:t?h:l}),o.jsx("span",{className:Fe.caret,"aria-hidden":"true"})]}),s&&o.jsx("span",{className:Fe.error,children:i})]})},vq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>o.jsx(vL,{field:e,error:i,touched:r,children:o.jsxs("div",{className:"form-check",children:[o.jsx("input",{type:"checkbox",className:"form-check-input",id:e.name,checked:!!t,onChange:s=>n(s.target.checked),onBlur:c}),o.jsx("label",{className:"form-check-label",htmlFor:e.name,children:e.label})]})}),Mq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>o.jsx(vL,{field:e,error:i,touched:r,children:o.jsx("div",{className:St.radioGroup,children:e.options?.map(s=>o.jsxs("div",{className:"form-check",children:[o.jsx("input",{type:"radio",className:"form-check-input",id:`${e.name}-${s.value}`,name:e.name,value:s.value,checked:t===s.value,onChange:d=>n(d.target.value),onBlur:c}),o.jsx("label",{className:"form-check-label",htmlFor:`${e.name}-${s.value}`,children:s.label})]},s.value))})}),kpe="_fileInputContainer_r2guc_3",mpe="_customFileInput_r2guc_8",fpe="_fileInputLabel_r2guc_12",gpe="_dragOver_r2guc_39",vpe="_uploadIcon_r2guc_44",Mpe="_uploadText_r2guc_50",_pe="_uploadHint_r2guc_56",xpe="_fileList_r2guc_60",Lpe="_fileListTitle_r2guc_69",Ipe="_fileItem_r2guc_80",bpe="_fileIcon_r2guc_96",wpe="_fileName_r2guc_102",Cpe="_fileSize_r2guc_108",Npe="_removeButton_r2guc_114",jpe="_errorText_r2guc_129",Se={fileInputContainer:kpe,customFileInput:mpe,fileInputLabel:fpe,dragOver:gpe,uploadIcon:vpe,uploadText:Mpe,uploadHint:_pe,fileList:xpe,fileListTitle:Lpe,fileItem:Ipe,fileIcon:bpe,fileName:wpe,fileSize:Cpe,removeButton:Npe,errorText:jpe},_q=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>{const s=k.useRef(null),[d,l]=k.useState(!1),h=M=>{n(M.target.files)},u=()=>{s.current&&s.current.click()},p=M=>{M.preventDefault(),l(!0)},y=()=>{l(!1)},m=M=>{M.preventDefault(),l(!1),M.dataTransfer.files&&M.dataTransfer.files.length>0&&n(M.dataTransfer.files)},g=M=>{if(!t)return;const _=Array.from(t);_.splice(M,1);const v=new DataTransfer;_.forEach(L=>v.items.add(L)),n(v.files)},f=M=>{if(M===0)return"0 Bytes";const _=1024,v=["Bytes","KB","MB","GB"],L=Math.floor(Math.log(M)/Math.log(_));return parseFloat((M/Math.pow(_,L)).toFixed(2))+" "+v[L]};return o.jsxs("div",{className:`${Se.fileInputContainer} ${r&&i?Se.hasError:""}`,children:[o.jsxs("label",{htmlFor:e.name,className:"form-label",children:[e.label,e.required&&o.jsx("span",{className:"text-danger",children:" *"})]}),o.jsx("input",{type:"file",id:e.name,name:e.name,multiple:e.attributes?.multiple||!1,accept:e.attributes?.accept,onChange:h,onBlur:c,ref:s,className:Se.customFileInput}),o.jsxs("label",{htmlFor:e.name,className:`${Se.fileInputLabel} ${d?Se.dragOver:""}`,onDragOver:p,onDragLeave:y,onDrop:m,onClick:u,tabIndex:0,children:[o.jsx("div",{className:Se.uploadIcon,children:o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",fill:"currentColor",viewBox:"0 0 16 16",children:[o.jsx("path",{d:"M.5 9.9a.5.5 0 0 1 .5.5v2.5a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-2.5a.5.5 0 0 1 1 0v2.5a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-2.5a.5.5 0 0 1 .5-.5z"}),o.jsx("path",{d:"M7.646 1.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1-.708.708L8.5 2.707V11.5a.5.5 0 0 1-1 0V2.707L5.354 4.854a.5.5 0 1 1-.708-.708l3-3z"})]})}),o.jsx("div",{className:Se.uploadText,children:d?"Déposez vos fichiers ici":"Cliquez ou glissez-déposez pour téléverser"}),o.jsxs("div",{className:Se.uploadHint,children:[e.attributes?.accept||"Tous les fichiers"," ",e.attributes?.multiple?"(Multiple autorisé)":""]})]}),t&&t.length>0&&o.jsxs("div",{className:Se.fileList,children:[o.jsx("div",{className:Se.fileListTitle,children:"Fichiers sélectionnés:"}),o.jsx("ul",{children:Array.from(t).map((M,_)=>o.jsxs("li",{className:Se.fileItem,children:[o.jsx("div",{className:Se.fileIcon,children:o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",children:o.jsx("path",{d:"M4 0h5.293A1 1 0 0 1 10 .293L13.707 4a1 1 0 0 1 .293.707V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2zm5.5 1.5v2a1 1 0 0 0 1 1h2l-3-3z"})})}),o.jsx("div",{className:Se.fileName,children:M.name}),o.jsx("div",{className:Se.fileSize,children:f(M.size)}),o.jsx("button",{type:"button",className:Se.removeButton,onClick:v=>{v.stopPropagation(),g(_)},"aria-label":`Supprimer ${M.name}`,children:o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",children:[o.jsx("path",{d:"M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z"}),o.jsx("path",{fillRule:"evenodd",d:"M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z"})]})})]},_))})]}),r&&i&&o.jsx("div",{className:Se.errorText,children:i})]})},Spe="_container_ecah4_2",$pe="_label_ecah4_6",qpe="_requiredIndicator_ecah4_13",Ape="_input_ecah4_18",zpe="_inputError_ecah4_49",Vpe="_errorMessage_ecah4_58",Dc={container:Spe,label:$pe,requiredIndicator:qpe,input:Ape,inputError:zpe,errorMessage:Vpe},xq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r,labelColor:s="black",backgroundColor:d="white"})=>{const l=e.type==="month"?"month":e.type==="week"?"week":e.type==="time"?"time":e.type==="datetime-local"?"datetime-local":"date";return o.jsxs("div",{className:Dc.container,children:[o.jsxs("label",{htmlFor:e.name,className:Dc.label,style:{color:s},children:[e.label,e.required&&o.jsx("span",{className:Dc.requiredIndicator,children:"*"})]}),o.jsx("input",{type:l,id:e.name,name:e.name,value:t||"",onChange:h=>n(h.target.value),onBlur:c,className:`${Dc.input} ${r&&i?Dc.inputError:""}`,style:{color:s,backgroundColor:d},min:e.validation?.min,max:e.validation?.max,step:e.type==="time"?e.attributes?.step:void 0,disabled:e.disabled}),r&&i&&o.jsx("div",{className:Dc.errorMessage,children:i})]})},Ppe="_rangeContainer_cyqk3_3",Tpe={rangeContainer:Ppe},Lq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>o.jsxs("div",{className:`mb-3 ${Tpe.rangeContainer}`,children:[o.jsxs("label",{htmlFor:e.name,className:"form-label",children:[e.label,": ",t,e.required&&o.jsx("span",{className:"text-danger",children:" *"})]}),o.jsx("input",{type:"range",id:e.name,name:e.name,value:t||0,onChange:s=>n(s.target.value),onBlur:c,className:`form-range ${r&&i?"is-invalid":""}`,min:e.validation?.min||0,max:e.validation?.max||100,step:e.attributes?.step||1}),r&&i&&o.jsx("div",{className:"invalid-feedback",children:i})]}),Hpe="_colorPickerContainer_1wxgj_2",Dpe="_colorInput_1wxgj_19",Bpe="_colorValue_1wxgj_39",JL={colorPickerContainer:Hpe,colorInput:Dpe,colorValue:Bpe},Iq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>o.jsxs("div",{className:"mb-3",children:[o.jsxs("label",{htmlFor:e.name,className:"form-label",children:[e.label,e.required&&o.jsx("span",{className:"text-danger",children:" *"})]}),o.jsxs("div",{className:JL.colorPickerContainer,children:[o.jsx("input",{type:"color",id:e.name,name:e.name,value:t||"#000000",onChange:s=>n(s.target.value),onBlur:c,className:JL.colorInput}),o.jsx("span",{className:JL.colorValue,children:t})]}),r&&i&&o.jsx("div",{className:"invalid-feedback",children:i})]}),bq=({field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})=>{const s=["date","month","week","time","datetime-local"];if(e.type==="file")return o.jsx(_q,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});if(s.includes(e.type))return o.jsx(xq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});if(e.type==="range")return o.jsx(Lq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});if(e.type==="color")return o.jsx(Iq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});switch(e.type){case"textarea":return o.jsx(gq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});case"select":return o.jsx(Ow,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});case"checkbox":return o.jsx(vq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});case"radio":return o.jsx(Mq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r});default:return o.jsx(fq,{field:e,value:t,onChange:n,onBlur:c,error:i,touched:r})}};var QL,MN;function Rpe(){if(MN)return QL;MN=1;function e(){this.__data__=[],this.size=0}return QL=e,QL}var eI,_N;function wq(){if(_N)return eI;_N=1;function e(t,n){return t===n||t!==t&&n!==n}return eI=e,eI}var tI,xN;function ML(){if(xN)return tI;xN=1;var e=wq();function t(n,c){for(var i=n.length;i--;)if(e(n[i][0],c))return i;return-1}return tI=t,tI}var aI,LN;function Fpe(){if(LN)return aI;LN=1;var e=ML(),t=Array.prototype,n=t.splice;function c(i){var r=this.__data__,s=e(r,i);if(s<0)return!1;var d=r.length-1;return s==d?r.pop():n.call(r,s,1),--this.size,!0}return aI=c,aI}var nI,IN;function Epe(){if(IN)return nI;IN=1;var e=ML();function t(n){var c=this.__data__,i=e(c,n);return i<0?void 0:c[i][1]}return nI=t,nI}var oI,bN;function Ope(){if(bN)return oI;bN=1;var e=ML();function t(n){return e(this.__data__,n)>-1}return oI=t,oI}var cI,wN;function Upe(){if(wN)return cI;wN=1;var e=ML();function t(n,c){var i=this.__data__,r=e(i,n);return r<0?(++this.size,i.push([n,c])):i[r][1]=c,this}return cI=t,cI}var iI,CN;function _L(){if(CN)return iI;CN=1;var e=Rpe(),t=Fpe(),n=Epe(),c=Ope(),i=Upe();function r(s){var d=-1,l=s==null?0:s.length;for(this.clear();++d<l;){var h=s[d];this.set(h[0],h[1])}}return r.prototype.clear=e,r.prototype.delete=t,r.prototype.get=n,r.prototype.has=c,r.prototype.set=i,iI=r,iI}var rI,NN;function Wpe(){if(NN)return rI;NN=1;var e=_L();function t(){this.__data__=new e,this.size=0}return rI=t,rI}var sI,jN;function Gpe(){if(jN)return sI;jN=1;function e(t){var n=this.__data__,c=n.delete(t);return this.size=n.size,c}return sI=e,sI}var dI,SN;function Kpe(){if(SN)return dI;SN=1;function e(t){return this.__data__.get(t)}return dI=e,dI}var lI,$N;function Zpe(){if($N)return lI;$N=1;function e(t){return this.__data__.has(t)}return lI=e,lI}var hI,qN;function Cq(){if(qN)return hI;qN=1;var e=typeof a.commonjsGlobal=="object"&&a.commonjsGlobal&&a.commonjsGlobal.Object===Object&&a.commonjsGlobal;return hI=e,hI}var uI,AN;function vt(){if(AN)return uI;AN=1;var e=Cq(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return uI=n,uI}var pI,zN;function Uw(){if(zN)return pI;zN=1;var e=vt(),t=e.Symbol;return pI=t,pI}var yI,VN;function Xpe(){if(VN)return yI;VN=1;var e=Uw(),t=Object.prototype,n=t.hasOwnProperty,c=t.toString,i=e?e.toStringTag:void 0;function r(s){var d=n.call(s,i),l=s[i];try{s[i]=void 0;var h=!0}catch{}var u=c.call(s);return h&&(d?s[i]=l:delete s[i]),u}return yI=r,yI}var kI,PN;function Ype(){if(PN)return kI;PN=1;var e=Object.prototype,t=e.toString;function n(c){return t.call(c)}return kI=n,kI}var mI,TN;function xL(){if(TN)return mI;TN=1;var e=Uw(),t=Xpe(),n=Ype(),c="[object Null]",i="[object Undefined]",r=e?e.toStringTag:void 0;function s(d){return d==null?d===void 0?i:c:r&&r in Object(d)?t(d):n(d)}return mI=s,mI}var fI,HN;function Nq(){if(HN)return fI;HN=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return fI=e,fI}var gI,DN;function jq(){if(DN)return gI;DN=1;var e=xL(),t=Nq(),n="[object AsyncFunction]",c="[object Function]",i="[object GeneratorFunction]",r="[object Proxy]";function s(d){if(!t(d))return!1;var l=e(d);return l==c||l==i||l==n||l==r}return gI=s,gI}var vI,BN;function Jpe(){if(BN)return vI;BN=1;var e=vt(),t=e["__core-js_shared__"];return vI=t,vI}var MI,RN;function Qpe(){if(RN)return MI;RN=1;var e=Jpe(),t=function(){var c=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return c?"Symbol(src)_1."+c:""}();function n(c){return!!t&&t in c}return MI=n,MI}var _I,FN;function Sq(){if(FN)return _I;FN=1;var e=Function.prototype,t=e.toString;function n(c){if(c!=null){try{return t.call(c)}catch{}try{return c+""}catch{}}return""}return _I=n,_I}var xI,EN;function eye(){if(EN)return xI;EN=1;var e=jq(),t=Qpe(),n=Nq(),c=Sq(),i=/[\\^$.*+?()[\]{}|]/g,r=/^\[object .+?Constructor\]$/,s=Function.prototype,d=Object.prototype,l=s.toString,h=d.hasOwnProperty,u=RegExp("^"+l.call(h).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p(y){if(!n(y)||t(y))return!1;var m=e(y)?u:r;return m.test(c(y))}return xI=p,xI}var LI,ON;function tye(){if(ON)return LI;ON=1;function e(t,n){return t?.[n]}return LI=e,LI}var II,UN;function c1(){if(UN)return II;UN=1;var e=eye(),t=tye();function n(c,i){var r=t(c,i);return e(r)?r:void 0}return II=n,II}var bI,WN;function Ww(){if(WN)return bI;WN=1;var e=c1(),t=vt(),n=e(t,"Map");return bI=n,bI}var wI,GN;function LL(){if(GN)return wI;GN=1;var e=c1(),t=e(Object,"create");return wI=t,wI}var CI,KN;function aye(){if(KN)return CI;KN=1;var e=LL();function t(){this.__data__=e?e(null):{},this.size=0}return CI=t,CI}var NI,ZN;function nye(){if(ZN)return NI;ZN=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return NI=e,NI}var jI,XN;function oye(){if(XN)return jI;XN=1;var e=LL(),t="__lodash_hash_undefined__",n=Object.prototype,c=n.hasOwnProperty;function i(r){var s=this.__data__;if(e){var d=s[r];return d===t?void 0:d}return c.call(s,r)?s[r]:void 0}return jI=i,jI}var SI,YN;function cye(){if(YN)return SI;YN=1;var e=LL(),t=Object.prototype,n=t.hasOwnProperty;function c(i){var r=this.__data__;return e?r[i]!==void 0:n.call(r,i)}return SI=c,SI}var $I,JN;function iye(){if(JN)return $I;JN=1;var e=LL(),t="__lodash_hash_undefined__";function n(c,i){var r=this.__data__;return this.size+=this.has(c)?0:1,r[c]=e&&i===void 0?t:i,this}return $I=n,$I}var qI,QN;function rye(){if(QN)return qI;QN=1;var e=aye(),t=nye(),n=oye(),c=cye(),i=iye();function r(s){var d=-1,l=s==null?0:s.length;for(this.clear();++d<l;){var h=s[d];this.set(h[0],h[1])}}return r.prototype.clear=e,r.prototype.delete=t,r.prototype.get=n,r.prototype.has=c,r.prototype.set=i,qI=r,qI}var AI,ej;function sye(){if(ej)return AI;ej=1;var e=rye(),t=_L(),n=Ww();function c(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return AI=c,AI}var zI,tj;function dye(){if(tj)return zI;tj=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return zI=e,zI}var VI,aj;function IL(){if(aj)return VI;aj=1;var e=dye();function t(n,c){var i=n.__data__;return e(c)?i[typeof c=="string"?"string":"hash"]:i.map}return VI=t,VI}var PI,nj;function lye(){if(nj)return PI;nj=1;var e=IL();function t(n){var c=e(this,n).delete(n);return this.size-=c?1:0,c}return PI=t,PI}var TI,oj;function hye(){if(oj)return TI;oj=1;var e=IL();function t(n){return e(this,n).get(n)}return TI=t,TI}var HI,cj;function uye(){if(cj)return HI;cj=1;var e=IL();function t(n){return e(this,n).has(n)}return HI=t,HI}var DI,ij;function pye(){if(ij)return DI;ij=1;var e=IL();function t(n,c){var i=e(this,n),r=i.size;return i.set(n,c),this.size+=i.size==r?0:1,this}return DI=t,DI}var BI,rj;function $q(){if(rj)return BI;rj=1;var e=sye(),t=lye(),n=hye(),c=uye(),i=pye();function r(s){var d=-1,l=s==null?0:s.length;for(this.clear();++d<l;){var h=s[d];this.set(h[0],h[1])}}return r.prototype.clear=e,r.prototype.delete=t,r.prototype.get=n,r.prototype.has=c,r.prototype.set=i,BI=r,BI}var RI,sj;function yye(){if(sj)return RI;sj=1;var e=_L(),t=Ww(),n=$q(),c=200;function i(r,s){var d=this.__data__;if(d instanceof e){var l=d.__data__;if(!t||l.length<c-1)return l.push([r,s]),this.size=++d.size,this;d=this.__data__=new n(l)}return d.set(r,s),this.size=d.size,this}return RI=i,RI}var FI,dj;function kye(){if(dj)return FI;dj=1;var e=_L(),t=Wpe(),n=Gpe(),c=Kpe(),i=Zpe(),r=yye();function s(d){var l=this.__data__=new e(d);this.size=l.size}return s.prototype.clear=t,s.prototype.delete=n,s.prototype.get=c,s.prototype.has=i,s.prototype.set=r,FI=s,FI}var EI,lj;function mye(){if(lj)return EI;lj=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return EI=t,EI}var OI,hj;function fye(){if(hj)return OI;hj=1;function e(t){return this.__data__.has(t)}return OI=e,OI}var UI,uj;function gye(){if(uj)return UI;uj=1;var e=$q(),t=mye(),n=fye();function c(i){var r=-1,s=i==null?0:i.length;for(this.__data__=new e;++r<s;)this.add(i[r])}return c.prototype.add=c.prototype.push=t,c.prototype.has=n,UI=c,UI}var WI,pj;function vye(){if(pj)return WI;pj=1;function e(t,n){for(var c=-1,i=t==null?0:t.length;++c<i;)if(n(t[c],c,t))return!0;return!1}return WI=e,WI}var GI,yj;function Mye(){if(yj)return GI;yj=1;function e(t,n){return t.has(n)}return GI=e,GI}var KI,kj;function qq(){if(kj)return KI;kj=1;var e=gye(),t=vye(),n=Mye(),c=1,i=2;function r(s,d,l,h,u,p){var y=l&c,m=s.length,g=d.length;if(m!=g&&!(y&&g>m))return!1;var f=p.get(s),M=p.get(d);if(f&&M)return f==d&&M==s;var _=-1,v=!0,L=l&i?new e:void 0;for(p.set(s,d),p.set(d,s);++_<m;){var w=s[_],C=d[_];if(h)var b=y?h(C,w,_,d,s,p):h(w,C,_,s,d,p);if(b!==void 0){if(b)continue;v=!1;break}if(L){if(!t(d,function(x,I){if(!n(L,I)&&(w===x||u(w,x,l,h,p)))return L.push(I)})){v=!1;break}}else if(!(w===C||u(w,C,l,h,p))){v=!1;break}}return p.delete(s),p.delete(d),v}return KI=r,KI}var ZI,mj;function _ye(){if(mj)return ZI;mj=1;var e=vt(),t=e.Uint8Array;return ZI=t,ZI}var XI,fj;function xye(){if(fj)return XI;fj=1;function e(t){var n=-1,c=Array(t.size);return t.forEach(function(i,r){c[++n]=[r,i]}),c}return XI=e,XI}var YI,gj;function Lye(){if(gj)return YI;gj=1;function e(t){var n=-1,c=Array(t.size);return t.forEach(function(i){c[++n]=i}),c}return YI=e,YI}var JI,vj;function Iye(){if(vj)return JI;vj=1;var e=Uw(),t=_ye(),n=wq(),c=qq(),i=xye(),r=Lye(),s=1,d=2,l="[object Boolean]",h="[object Date]",u="[object Error]",p="[object Map]",y="[object Number]",m="[object RegExp]",g="[object Set]",f="[object String]",M="[object Symbol]",_="[object ArrayBuffer]",v="[object DataView]",L=e?e.prototype:void 0,w=L?L.valueOf:void 0;function C(b,x,I,S,j,$,q){switch(I){case v:if(b.byteLength!=x.byteLength||b.byteOffset!=x.byteOffset)return!1;b=b.buffer,x=x.buffer;case _:return!(b.byteLength!=x.byteLength||!$(new t(b),new t(x)));case l:case h:case y:return n(+b,+x);case u:return b.name==x.name&&b.message==x.message;case m:case f:return b==x+"";case p:var H=i;case g:var D=S&s;if(H||(H=r),b.size!=x.size&&!D)return!1;var z=q.get(b);if(z)return z==x;S|=d,q.set(b,x);var N=c(H(b),H(x),S,j,$,q);return q.delete(b),N;case M:if(w)return w.call(b)==w.call(x)}return!1}return JI=C,JI}var QI,Mj;function bye(){if(Mj)return QI;Mj=1;function e(t,n){for(var c=-1,i=n.length,r=t.length;++c<i;)t[r+c]=n[c];return t}return QI=e,QI}var eb,_j;function Gw(){if(_j)return eb;_j=1;var e=Array.isArray;return eb=e,eb}var tb,xj;function wye(){if(xj)return tb;xj=1;var e=bye(),t=Gw();function n(c,i,r){var s=i(c);return t(c)?s:e(s,r(c))}return tb=n,tb}var ab,Lj;function Cye(){if(Lj)return ab;Lj=1;function e(t,n){for(var c=-1,i=t==null?0:t.length,r=0,s=[];++c<i;){var d=t[c];n(d,c,t)&&(s[r++]=d)}return s}return ab=e,ab}var nb,Ij;function Nye(){if(Ij)return nb;Ij=1;function e(){return[]}return nb=e,nb}var ob,bj;function jye(){if(bj)return ob;bj=1;var e=Cye(),t=Nye(),n=Object.prototype,c=n.propertyIsEnumerable,i=Object.getOwnPropertySymbols,r=i?function(s){return s==null?[]:(s=Object(s),e(i(s),function(d){return c.call(s,d)}))}:t;return ob=r,ob}var cb,wj;function Sye(){if(wj)return cb;wj=1;function e(t,n){for(var c=-1,i=Array(t);++c<t;)i[c]=n(c);return i}return cb=e,cb}var ib,Cj;function bL(){if(Cj)return ib;Cj=1;function e(t){return t!=null&&typeof t=="object"}return ib=e,ib}var rb,Nj;function $ye(){if(Nj)return rb;Nj=1;var e=xL(),t=bL(),n="[object Arguments]";function c(i){return t(i)&&e(i)==n}return rb=c,rb}var sb,jj;function qye(){if(jj)return sb;jj=1;var e=$ye(),t=bL(),n=Object.prototype,c=n.hasOwnProperty,i=n.propertyIsEnumerable,r=e(function(){return arguments}())?e:function(s){return t(s)&&c.call(s,"callee")&&!i.call(s,"callee")};return sb=r,sb}var k1={exports:{}},db,Sj;function Aye(){if(Sj)return db;Sj=1;function e(){return!1}return db=e,db}k1.exports;var $j;function Aq(){return $j||($j=1,function(e,t){var n=vt(),c=Aye(),i=t&&!t.nodeType&&t,r=i&&!0&&e&&!e.nodeType&&e,s=r&&r.exports===i,d=s?n.Buffer:void 0,l=d?d.isBuffer:void 0,h=l||c;e.exports=h}(k1,k1.exports)),k1.exports}var lb,qj;function zye(){if(qj)return lb;qj=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(c,i){var r=typeof c;return i=i??e,!!i&&(r=="number"||r!="symbol"&&t.test(c))&&c>-1&&c%1==0&&c<i}return lb=n,lb}var hb,Aj;function zq(){if(Aj)return hb;Aj=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return hb=t,hb}var ub,zj;function Vye(){if(zj)return ub;zj=1;var e=xL(),t=zq(),n=bL(),c="[object Arguments]",i="[object Array]",r="[object Boolean]",s="[object Date]",d="[object Error]",l="[object Function]",h="[object Map]",u="[object Number]",p="[object Object]",y="[object RegExp]",m="[object Set]",g="[object String]",f="[object WeakMap]",M="[object ArrayBuffer]",_="[object DataView]",v="[object Float32Array]",L="[object Float64Array]",w="[object Int8Array]",C="[object Int16Array]",b="[object Int32Array]",x="[object Uint8Array]",I="[object Uint8ClampedArray]",S="[object Uint16Array]",j="[object Uint32Array]",$={};$[v]=$[L]=$[w]=$[C]=$[b]=$[x]=$[I]=$[S]=$[j]=!0,$[c]=$[i]=$[M]=$[r]=$[_]=$[s]=$[d]=$[l]=$[h]=$[u]=$[p]=$[y]=$[m]=$[g]=$[f]=!1;function q(H){return n(H)&&t(H.length)&&!!$[e(H)]}return ub=q,ub}var pb,Vj;function Pye(){if(Vj)return pb;Vj=1;function e(t){return function(n){return t(n)}}return pb=e,pb}var m1={exports:{}};m1.exports;var Pj;function Tye(){return Pj||(Pj=1,function(e,t){var n=Cq(),c=t&&!t.nodeType&&t,i=c&&!0&&e&&!e.nodeType&&e,r=i&&i.exports===c,s=r&&n.process,d=function(){try{var l=i&&i.require&&i.require("util").types;return l||s&&s.binding&&s.binding("util")}catch{}}();e.exports=d}(m1,m1.exports)),m1.exports}var yb,Tj;function Vq(){if(Tj)return yb;Tj=1;var e=Vye(),t=Pye(),n=Tye(),c=n&&n.isTypedArray,i=c?t(c):e;return yb=i,yb}var kb,Hj;function Hye(){if(Hj)return kb;Hj=1;var e=Sye(),t=qye(),n=Gw(),c=Aq(),i=zye(),r=Vq(),s=Object.prototype,d=s.hasOwnProperty;function l(h,u){var p=n(h),y=!p&&t(h),m=!p&&!y&&c(h),g=!p&&!y&&!m&&r(h),f=p||y||m||g,M=f?e(h.length,String):[],_=M.length;for(var v in h)(u||d.call(h,v))&&!(f&&(v=="length"||m&&(v=="offset"||v=="parent")||g&&(v=="buffer"||v=="byteLength"||v=="byteOffset")||i(v,_)))&&M.push(v);return M}return kb=l,kb}var mb,Dj;function Dye(){if(Dj)return mb;Dj=1;var e=Object.prototype;function t(n){var c=n&&n.constructor,i=typeof c=="function"&&c.prototype||e;return n===i}return mb=t,mb}var fb,Bj;function Bye(){if(Bj)return fb;Bj=1;function e(t,n){return function(c){return t(n(c))}}return fb=e,fb}var gb,Rj;function Rye(){if(Rj)return gb;Rj=1;var e=Bye(),t=e(Object.keys,Object);return gb=t,gb}var vb,Fj;function Fye(){if(Fj)return vb;Fj=1;var e=Dye(),t=Rye(),n=Object.prototype,c=n.hasOwnProperty;function i(r){if(!e(r))return t(r);var s=[];for(var d in Object(r))c.call(r,d)&&d!="constructor"&&s.push(d);return s}return vb=i,vb}var Mb,Ej;function Eye(){if(Ej)return Mb;Ej=1;var e=jq(),t=zq();function n(c){return c!=null&&t(c.length)&&!e(c)}return Mb=n,Mb}var _b,Oj;function Oye(){if(Oj)return _b;Oj=1;var e=Hye(),t=Fye(),n=Eye();function c(i){return n(i)?e(i):t(i)}return _b=c,_b}var xb,Uj;function Uye(){if(Uj)return xb;Uj=1;var e=wye(),t=jye(),n=Oye();function c(i){return e(i,n,t)}return xb=c,xb}var Lb,Wj;function Wye(){if(Wj)return Lb;Wj=1;var e=Uye(),t=1,n=Object.prototype,c=n.hasOwnProperty;function i(r,s,d,l,h,u){var p=d&t,y=e(r),m=y.length,g=e(s),f=g.length;if(m!=f&&!p)return!1;for(var M=m;M--;){var _=y[M];if(!(p?_ in s:c.call(s,_)))return!1}var v=u.get(r),L=u.get(s);if(v&&L)return v==s&&L==r;var w=!0;u.set(r,s),u.set(s,r);for(var C=p;++M<m;){_=y[M];var b=r[_],x=s[_];if(l)var I=p?l(x,b,_,s,r,u):l(b,x,_,r,s,u);if(!(I===void 0?b===x||h(b,x,d,l,u):I)){w=!1;break}C||(C=_=="constructor")}if(w&&!C){var S=r.constructor,j=s.constructor;S!=j&&"constructor"in r&&"constructor"in s&&!(typeof S=="function"&&S instanceof S&&typeof j=="function"&&j instanceof j)&&(w=!1)}return u.delete(r),u.delete(s),w}return Lb=i,Lb}var Ib,Gj;function Gye(){if(Gj)return Ib;Gj=1;var e=c1(),t=vt(),n=e(t,"DataView");return Ib=n,Ib}var bb,Kj;function Kye(){if(Kj)return bb;Kj=1;var e=c1(),t=vt(),n=e(t,"Promise");return bb=n,bb}var wb,Zj;function Zye(){if(Zj)return wb;Zj=1;var e=c1(),t=vt(),n=e(t,"Set");return wb=n,wb}var Cb,Xj;function Xye(){if(Xj)return Cb;Xj=1;var e=c1(),t=vt(),n=e(t,"WeakMap");return Cb=n,Cb}var Nb,Yj;function Yye(){if(Yj)return Nb;Yj=1;var e=Gye(),t=Ww(),n=Kye(),c=Zye(),i=Xye(),r=xL(),s=Sq(),d="[object Map]",l="[object Object]",h="[object Promise]",u="[object Set]",p="[object WeakMap]",y="[object DataView]",m=s(e),g=s(t),f=s(n),M=s(c),_=s(i),v=r;return(e&&v(new e(new ArrayBuffer(1)))!=y||t&&v(new t)!=d||n&&v(n.resolve())!=h||c&&v(new c)!=u||i&&v(new i)!=p)&&(v=function(L){var w=r(L),C=w==l?L.constructor:void 0,b=C?s(C):"";if(b)switch(b){case m:return y;case g:return d;case f:return h;case M:return u;case _:return p}return w}),Nb=v,Nb}var jb,Jj;function Jye(){if(Jj)return jb;Jj=1;var e=kye(),t=qq(),n=Iye(),c=Wye(),i=Yye(),r=Gw(),s=Aq(),d=Vq(),l=1,h="[object Arguments]",u="[object Array]",p="[object Object]",y=Object.prototype,m=y.hasOwnProperty;function g(f,M,_,v,L,w){var C=r(f),b=r(M),x=C?u:i(f),I=b?u:i(M);x=x==h?p:x,I=I==h?p:I;var S=x==p,j=I==p,$=x==I;if($&&s(f)){if(!s(M))return!1;C=!0,S=!1}if($&&!S)return w||(w=new e),C||d(f)?t(f,M,_,v,L,w):n(f,M,x,_,v,L,w);if(!(_&l)){var q=S&&m.call(f,"__wrapped__"),H=j&&m.call(M,"__wrapped__");if(q||H){var D=q?f.value():f,z=H?M.value():M;return w||(w=new e),L(D,z,_,v,w)}}return $?(w||(w=new e),c(f,M,_,v,L,w)):!1}return jb=g,jb}var Sb,Qj;function Qye(){if(Qj)return Sb;Qj=1;var e=Jye(),t=bL();function n(c,i,r,s,d){return c===i?!0:c==null||i==null||!t(c)&&!t(i)?c!==c&&i!==i:e(c,i,r,s,n,d)}return Sb=n,Sb}var $b,eS;function e4e(){if(eS)return $b;eS=1;var e=Qye();function t(n,c){return e(n,c)}return $b=t,$b}var t4e=e4e();const a4e=a.getDefaultExportFromCjs(t4e),n4e=({schema:e,initialData:t={},onSubmit:n,submitLabel:c,submitIcon:i,submitIconPosition:r="left",onCancel:s,cancelLabel:d="Retour",cancelIcon:l})=>{const[h,u]=k.useState(t),[p,y]=k.useState({}),[m,g]=k.useState({}),[f,M]=k.useState(!1),_=k.useRef(t);k.useEffect(()=>{a4e(_.current,t)||(u(t),_.current=t)},[t]);const v=(I,S)=>{const j={...h,[I]:S};if(u(j),m[I]){const $=e.fields.find(q=>q.name===I);if($){const q=hL(S,$);y(H=>({...H,[I]:q.isValid?"":q.error}))}}},L=I=>{if(!m[I]){g(j=>({...j,[I]:!0}));const S=e.fields.find(j=>j.name===I);if(S){const j=hL(h[I],S);y($=>({...$,[I]:j.isValid?"":j.error}))}}},w=async I=>{I.preventDefault(),M(!0);const S=e.fields.reduce(($,q)=>(q.type!=="section"&&($[q.name]=!0),$),{});g(S);const j=mq(h,e.fields.filter($=>$.type!=="section"));if(y(j.errors),j.isValid)try{await n(h)}catch($){console.error("Erreur lors de la soumission:",$),y(q=>({...q,__global:"Une erreur est survenue lors de la soumission"}))}M(!1)},C=l?kt[l]:null,b=i&&kt[i]||e.submitIcon&&kt[e.submitIcon]||null,x=e.columns&&e.columns>0?Math.floor(e.columns):12;return o.jsxs("div",{className:le.formContainer,children:[o.jsx("div",{className:le.headerLine,children:o.jsx("h2",{className:le.formTitle,children:e.title})}),e.description&&o.jsx("p",{className:le.formDescription,children:e.description}),p.__global&&o.jsx("div",{className:`alert alert-danger ${le.globalError}`,children:p.__global}),o.jsxs("form",{onSubmit:w,children:[o.jsx("div",{className:le.gridContainer,style:{gridTemplateColumns:`repeat(${x}, minmax(0, 1fr))`},children:e.fields.map(I=>{if(I.type==="section")return o.jsxs("div",{className:le.sectionFull,children:[o.jsx("h5",{className:le.sectionTitle,children:I.label}),I.help&&o.jsx("p",{className:le.sectionHelp,children:I.help})]},I.name);const j={gridColumn:`span ${Math.max(1,Math.min(x,I.gridCol??x))}`};return o.jsxs("div",{className:le.fieldGridItem,style:j,children:[o.jsx(bq,{field:I,value:h[I.name],onChange:$=>v(I.name,$),onBlur:()=>L(I.name),error:p[I.name],touched:m[I.name]}),I.help&&o.jsx("small",{className:le.fieldHelp,children:I.help})]},I.name)})}),o.jsxs("div",{className:le.formFooter,children:[o.jsx("div",{className:le.footerLeft,children:s&&o.jsxs("button",{type:"button",className:le.cancelLink,onClick:s,children:[C&&o.jsx(C,{size:16,className:"me-2"})," ",d]})}),o.jsx("div",{className:le.footerRight,children:o.jsx(tL,{type:"submit",variant:"primary",size:"md",className:le.submitButton,disabled:f,children:f?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"spinner-border spinner-border-sm me-2",role:"status"}),"Validation..."]}):o.jsxs(o.Fragment,{children:[b&&(r==="left"||e.submitIconPosition==="left")&&o.jsx(b,{size:16,className:"me-2"}),c||e.submitText||"Valider",b&&(r==="right"||e.submitIconPosition==="right")&&o.jsx(b,{size:16,className:"ms-2"})]})})})]})]})]})};function o4e(e){return{title:e._formTitle||"Formulaire",description:e._formDescription,fields:e._fieldMetadata||[],submitText:e._submitText||"Valider"}}const c4e="_container_1gljv_85",i4e="_tableWrapper_1gljv_111",r4e="_tableControls_1gljv_117",s4e="_controlsRight_1gljv_128",d4e="_limitedRows_1gljv_151",l4e="_table_1gljv_111",h4e="_headerCell_1gljv_206",u4e="_headerContent_1gljv_220",p4e="_headerWords_1gljv_229",y4e="_headerWord_1gljv_229",k4e="_cellContent_1gljv_276",m4e="_alignLeft_1gljv_286",f4e="_alignCenter_1gljv_290",g4e="_alignRight_1gljv_294",v4e="_tableCell_1gljv_298",M4e="_tableRow_1gljv_308",_4e="_emptyRow_1gljv_385",x4e="_toggleFiltersButton_1gljv_393",L4e="_toggleSortButton_1gljv_394",I4e="_buttonTextCompact_1gljv_415",b4e="_uppercaseSmall_1gljv_450",w4e="_filtersPanel_1gljv_463",C4e="_filtersPanelInline_1gljv_481",N4e="_filtersPanelHorizontal_1gljv_492",j4e="_filtersRow_1gljv_492",S4e="_filtersActionsHorizontal_1gljv_525",$4e="_filterItemInline_1gljv_542",q4e="_filterLabel_1gljv_571",A4e="_filterInput_1gljv_576",z4e="_filterSelect_1gljv_577",V4e="_operatorSelect_1gljv_578",P4e="_operatorInput_1gljv_579",T4e="_activeFilterTag_1gljv_597",H4e="_actionsGroup_1gljv_609",D4e="_applyButton_1gljv_615",B4e="_cancelButton_1gljv_625",R4e="_columnSorterContainer_1gljv_649",F4e="_sorterControls_1gljv_654",E4e="_sortDropdownWrapper_1gljv_659",O4e="_sortDropdown_1gljv_659",U4e="_sortDropdownHeader_1gljv_679",W4e="_closeButton_1gljv_688",G4e="_sortDropdownContent_1gljv_703",K4e="_sortDropdownItem_1gljv_709",Z4e="_sortDirectionButtons_1gljv_734",X4e="_sortDirectionButton_1gljv_734",Y4e="_activeSort_1gljv_757",J4e="_sortActions_1gljv_764",Q4e="_paginationButton_1gljv_842",e5e="_pageSizeSelect_1gljv_844",t5e="_topPagination_1gljv_853",a5e="_paginationContainer_1gljv_861",n5e="_leftGroup_1gljv_874",o5e="_pageSizeControls_1gljv_882",c5e="_paginationInfo_1gljv_908",i5e="_paginationControls_1gljv_916",r5e="_disabledButton_1gljv_947",s5e="_activeButton_1gljv_952",d5e="_navigationButton_1gljv_962",l5e="_operatorFilterContainer_1gljv_1010",h5e="_rangeSeparator_1gljv_1016",u5e="_activeFiltersSection_1gljv_1179",p5e="_activeFiltersRow_1gljv_1184",y5e="_activeFiltersList_1gljv_1192",k5e="_clearAllButton_1gljv_1200",m5e="_removeFilterButton_1gljv_1221",f5e="_sortIndicator_1gljv_1272",g5e="_active_1gljv_349",v5e="_clearSortButton_1gljv_1371",M5e="_loaderSpinner_1gljv_2743",_5e="_loaderSpinnerSmall_1gljv_2755",x5e="_paginationLoading_1gljv_2772",L5e="_loadingButton_1gljv_2780",I5e="_loadingIndicator_1gljv_2791",V={container:c4e,tableWrapper:i4e,tableControls:r4e,controlsRight:s4e,limitedRows:d4e,table:l4e,headerCell:h4e,headerContent:u4e,headerWords:p4e,headerWord:y4e,cellContent:k4e,alignLeft:m4e,alignCenter:f4e,alignRight:g4e,tableCell:v4e,tableRow:M4e,emptyRow:_4e,toggleFiltersButton:x4e,toggleSortButton:L4e,buttonTextCompact:I4e,uppercaseSmall:b4e,filtersPanel:w4e,filtersPanelInline:C4e,filtersPanelHorizontal:N4e,filtersRow:j4e,filtersActionsHorizontal:S4e,filterItemInline:$4e,filterLabel:q4e,filterInput:A4e,filterSelect:z4e,operatorSelect:V4e,operatorInput:P4e,activeFilterTag:T4e,actionsGroup:H4e,applyButton:D4e,cancelButton:B4e,columnSorterContainer:R4e,sorterControls:F4e,sortDropdownWrapper:E4e,sortDropdown:O4e,sortDropdownHeader:U4e,closeButton:W4e,sortDropdownContent:G4e,sortDropdownItem:K4e,sortDirectionButtons:Z4e,sortDirectionButton:X4e,activeSort:Y4e,sortActions:J4e,paginationButton:Q4e,pageSizeSelect:e5e,topPagination:t5e,paginationContainer:a5e,leftGroup:n5e,pageSizeControls:o5e,paginationInfo:c5e,paginationControls:i5e,disabledButton:r5e,activeButton:s5e,navigationButton:d5e,operatorFilterContainer:l5e,rangeSeparator:h5e,activeFiltersSection:u5e,activeFiltersRow:p5e,activeFiltersList:y5e,clearAllButton:k5e,removeFilterButton:m5e,sortIndicator:f5e,active:g5e,clearSortButton:v5e,loaderSpinner:M5e,loaderSpinnerSmall:_5e,paginationLoading:x5e,loadingButton:L5e,loadingIndicator:I5e},b5e=({config:e,value:t,onChange:n,disabled:c})=>o.jsxs("select",{value:t===""?"":String(t),onChange:i=>n(i.target.value===""?"":i.target.value==="true"),disabled:c,className:V.filterSelect,children:[o.jsx("option",{value:"",children:`Filtrer ${e.label}...`}),o.jsx("option",{value:"true",children:"Oui"}),o.jsx("option",{value:"false",children:"Non"})]}),w5e=({config:e,value:t,onChange:n,disabled:c})=>o.jsx("input",{type:"date",value:t||"",onChange:i=>n(i.target.value),placeholder:`Filtrer ${e.label}...`,disabled:c,className:V.filterInput}),C5e=({config:e,value:t,onChange:n,disabled:c})=>{const[i,r]=k.useState([]);k.useEffect(()=>{(async()=>{if(e.asyncOptions)try{const l=await e.asyncOptions();r(l??[])}catch(l){console.error("Erreur chargement options MultiSelect:",l),r([])}else r(e.options??[])})()},[e]);const s=d=>{const l=Array.from(d.target.selectedOptions,h=>h.value);n(l)};return o.jsx("select",{multiple:!0,value:t.map(String),onChange:s,disabled:c,className:V.filterMultiSelect,children:i.map((d,l)=>o.jsx("option",{value:String(d.value),children:d.label},l))})},tS=({config:e,value:t,onChange:n,disabled:c})=>{const[i,r]=k.useState(t||""),s=d=>{const l=d.target.value===""?"":Number(d.target.value);r(l),n(l)};return o.jsx("input",{type:"number",value:i,onChange:s,placeholder:e.placeholder||`Filtrer ${e.label}...`,disabled:c,className:V.filterInput})},N5e=({config:e,value:t,onChange:n,disabled:c=!1})=>{const[i,r]=k.useState([]),[s,d]=k.useState(!1);k.useEffect(()=>{(async()=>{if(e.asyncOptions){d(!0);try{const u=await e.asyncOptions();r(u)}catch(u){console.error("Error loading options:",u)}finally{d(!1)}}else r(e.options||[])})()},[e]);const l=h=>{const u=h.target.value;n(u)};return s?o.jsx("div",{children:"Chargement..."}):o.jsxs("select",{value:String(t||""),onChange:l,disabled:c,className:V.filterInput,children:[o.jsx("option",{value:"",children:"Select..."}),i.map(h=>o.jsx("option",{value:h.value,children:h.label},h.value))]})},j5e=({config:e,value:t,onChange:n,disabled:c=!1})=>{const[i,r]=k.useState("");k.useEffect(()=>{r(typeof t=="string"?t:String(t||""))},[t]);const s=d=>{const l=d.target.value;r(l),n(l)};return o.jsx("input",{type:"text",value:i,onChange:s,placeholder:e.placeholder||`Filtrer ${e.label}...`,disabled:c,className:V.filterInput})},S5e=({config:e,value:t,onChange:n,disabled:c=!1})=>{const[i,r]=k.useState(t?.operator||""),[s,d]=k.useState(t?.value||"");k.useEffect(()=>{i&&s&&n({operator:i,value:s})},[i,s,n]);const l=u=>{r(u.target.value)},h=u=>{d(u.target.value)};return o.jsxs("div",{className:V.operatorFilterContainer,children:[o.jsxs("select",{value:i,onChange:l,disabled:c,className:V.operatorSelect,children:[o.jsx("option",{value:"",children:"Sélectionner un opérateur"}),e.operators.map(u=>o.jsx("option",{value:String(u.value),children:u.label},String(u.value)))]}),o.jsx("input",{type:"text",value:s,onChange:h,placeholder:"Valeur",disabled:c||!i,className:V.operatorInput})]})},$5e=({value:e,onChange:t,disabled:n})=>{const c=e||{},i=s=>{t({...c,start:s.target.value})},r=s=>{t({...c,end:s.target.value})};return o.jsxs("div",{className:V.dateRangeContainer,children:[o.jsx("input",{type:"date",value:c.start||"",onChange:i,disabled:n,className:V.filterInput}),o.jsx("span",{className:V.rangeSeparator,children:"→"}),o.jsx("input",{type:"date",value:c.end||"",onChange:r,disabled:n,className:V.filterInput})]})},q5e=({config:e,value:t,onChange:n,disabled:c})=>{switch(e.type){case"text":case"search":return o.jsx(j5e,{config:e,value:t,onChange:n,disabled:c});case"number":return o.jsx(tS,{config:e,value:t,onChange:n,disabled:c});case"range":return o.jsx(tS,{config:e,value:t,onChange:n,disabled:c});case"select":return o.jsx(N5e,{config:e,value:t,onChange:n,disabled:c});case"operator":return o.jsx(S5e,{config:e,value:t,onChange:n,disabled:c});case"multiselect":return o.jsx(C5e,{config:e,value:t,onChange:n,disabled:c});case"date":return o.jsx(w5e,{config:e,value:t,onChange:n,disabled:c});case"daterange":return o.jsx($5e,{config:e,value:t??{start:"",end:""},onChange:n,disabled:c});case"boolean":return o.jsx(b5e,{config:e,value:t,onChange:n,disabled:c});default:return o.jsxs("div",{children:["Type de filtre non supporté: ",e.type]})}},Pq=({filters:e,externalFilters:t=[],onFiltersChange:n,onApply:c,isControlled:i=!1})=>{const[r,s]=k.useState([]),[d,l]=k.useState(()=>{const g={};return e.forEach(f=>{f.type==="daterange"?g[f.id]={start:"",end:""}:g[f.id]=f.defaultValue??""}),g});k.useEffect(()=>{if(!i)return;const g={...d??{}};e.forEach(f=>{f.id in g||(g[f.id]=f.type==="daterange"?{start:"",end:""}:f.defaultValue??"")}),(t||[]).forEach(f=>{!f||!f.id||(g[f.id]=f.value)}),l(g),s(t??[])},[i,JSON.stringify(t||[]),JSON.stringify(e.map(g=>g.id))]);const h=i?t:r,u=k.useCallback((g,f)=>{l(M=>({...M,[g]:f}))},[]),p=k.useCallback(async()=>{const g=[],f={...d};for(const[M,_]of Object.entries(f)){const v=e.find(C=>C.id===M);if(!v)continue;let L=_;try{typeof _=="function"&&(L=await _(f)),typeof v.executeOnApply=="function"&&(L=await v.executeOnApply(L,f))}catch{continue}if(v.type==="daterange"){const C=L?.start??"",b=L?.end??"",x=typeof C=="string"?C.trim()==="":!C,I=typeof b=="string"?b.trim()==="":!b;if(x&&I)continue}L==null||typeof L=="string"&&L.trim()===""||Array.isArray(L)&&L.length===0||typeof L=="object"&&!Array.isArray(L)&&Object.keys(L).length===0||g.push({id:M,type:v.type,value:L,label:v.label})}return i?n?.(g):(s(g),c?.(g)),g},[d,e,i,n,c]),y=k.useCallback(g=>{l(f=>({...f,[g]:void 0})),u(g,void 0)},[u]),m=k.useCallback(()=>{const g={};e.forEach(f=>{f.type==="daterange"?g[f.id]={start:"",end:""}:g[f.id]=f.defaultValue??""}),l(g),i?n?.([]):(s([]),c?.([]))},[e,i,n,c]);return{appliedFilters:h,tempFilters:d,updateFilter:u,applyFilters:p,clearFilter:y,clearAllFilters:m}},A5e=(e,t)=>{if(e==null)return!1;const n=t.value;if(n==null)return!1;switch(t.type){case"text":case"search":return String(e).toLowerCase().includes(String(n).toLowerCase());case"number":case"range":return Number(e)===Number(n);case"select":case"multiselect":return Array.isArray(n)?n.includes(e)||n.map(c=>String(c)).includes(String(e)):String(e)===String(n);case"boolean":return!!e==!!n;case"date":return new Date(e).getTime()===new Date(String(n)).getTime();case"daterange":try{if(!n||typeof n!="object")return!1;const c=n;if(!c.start||!c.end)return!1;const i=c.start,r=c.end;if(typeof i!="string"||typeof r!="string"||!i.trim()||!r.trim())return!1;const s=new Date(e).getTime(),d=new Date(i).getTime(),l=new Date(r).getTime();return isNaN(s)||isNaN(d)||isNaN(l)?!1:s>=d&&s<=l}catch(c){return console.error("Error processing daterange filter:",c),!1}case"operator":if(typeof n=="object"&&n!==null){const c=n;if(!("operator"in c)||!("value"in c))return!1;const{operator:i,value:r}=c,s=Number(e),d=Number(r);if(isNaN(s)||isNaN(d))return String(e).includes(String(r));switch(i){case"equals":return s===d;case"gt":return s>d;case"lt":return s<d;case"gte":return s>=d;case"lte":return s<=d;default:return String(e).includes(String(r))}}return!1;default:return String(e).toLowerCase().includes(String(n).toLowerCase())}};function Tq(e,t,n="",c={key:null,direction:"asc"},i=1,r=10,s=[]){const d=Math.max(1,r),l=(n||"").trim().toLowerCase(),h=k.useMemo(()=>{let f=e;return l&&(f=f.filter(M=>t.some(_=>{const v=M.data[_.id];return v==null?!1:String(v).toLowerCase().includes(l)}))),s.length>0&&(f=f.filter(M=>s.every(_=>{try{const v=M.data[_.id];return A5e(v,_)}catch(v){return console.error("Error applying filter:",v),!1}}))),f},[e,t,l,s]),u=k.useMemo(()=>{if(!c?.key)return h;const f=c.key;return[...h].sort((M,_)=>{const v=M.data[f],L=_.data[f];if(v==null)return 1;if(L==null)return-1;if(typeof v=="number"&&typeof L=="number")return c.direction==="desc"?L-v:v-L;if(v instanceof Date&&L instanceof Date){const C=v.getTime()-L.getTime();return c.direction==="desc"?-C:C}const w=String(v).localeCompare(String(L),void 0,{numeric:!0,sensitivity:"base"});return c.direction==="desc"?-w:w})},[h,c]),p=u,y=Math.ceil(u.length/d),m=0,g=Math.min(i*d,u.length);return{paginatedData:p,sortedData:u,filteredData:h,totalPages:y,startIndex:m,endIndex:g}}const Hq=({value:e})=>e,Dq=({value:e})=>k.createElement("a",{href:`mailto:${e}`,className:"email-link"},e),Bq=({value:e})=>k.createElement("a",{href:String(e),target:"_blank",rel:"noopener noreferrer",className:"text-link"},e),Rq=({value:e})=>{if(!e)return null;const t={success:"success-badge",warning:"warning-badge",error:"error-badge",info:"info-badge",default:"default-badge"},n=typeof e=="object"?e.type:"default",c=typeof e=="object"?e.text:e,i=t[n]||t.default;return k.createElement("span",{className:`badge ${i}`},c)},Fq=({value:e})=>{try{return new Date(e).toLocaleDateString()}catch{return String(e)}},Eq=({value:e})=>k.createElement("span",{className:"number-value"},Number(e).toLocaleString()),Oq=({value:e})=>k.createElement("span",{className:"currency-value"},new Intl.NumberFormat("fr-FR",{style:"currency",currency:"EUR"}).format(Number(e))),Uq=({value:e})=>k.createElement("div",{className:"image-container"},k.createElement("img",{src:e,alt:"Table content",className:"table-image",onError:t=>t.currentTarget.style.display="none"})),rw={renderers:{text:Hq,email:Dq,link:Bq,badge:Rq,date:Fq,number:Eq,currency:Oq,image:Uq},icons:{sortAsc:k.createElement(Nc,{className:"sort-icon active",size:14}),sortDesc:k.createElement(qt,{className:"sort-icon active",size:14}),sortDefault:k.createElement(Kc,{className:"sort-icon",size:14})}},z5e=(e,t)=>{rw.renderers[e]&&console.warn(`Le renderer "${e}" existe déjà et sera écrasé.`),rw.renderers[e]=t},V5e=({filters:e,externalFilters:t=[],onFiltersChange:n,onApply:c,isControlled:i=!1,debounceTimeout:r=300,expanded:s,onToggle:d,panelPlacement:l="top",onPanelHeightChange:h,label:u="Advanced-Filters",applyLabel:p="Apply",cancelLabel:y="Cancel",clearLabel:m="Clear",applyDisabled:g=!1,loading:f=!1})=>{const[M,_]=k.useState(!1),v=typeof s=="boolean"?s:M,{appliedFilters:L,tempFilters:w,updateFilter:C,applyFilters:b,clearAllFilters:x}=Pq({filters:e,externalFilters:t,onFiltersChange:n,onApply:c,isControlled:i}),I=k.useRef(null),S=k.useRef(null);k.useEffect(()=>{if(v&&I.current){const z=I.current.getBoundingClientRect().height;h?.(z)}else h?.(0)},[v,e,w,h]);const j=()=>{typeof s=="boolean"?d?.(!s):_(z=>{const N=!z;return d?.(N),N})},$=()=>e.map(z=>{const N=w?.[z.id];return N==null||typeof N=="string"&&N.trim()===""?null:{id:z.id,label:z.label,value:N}}).filter(Boolean),q=async()=>{let z;try{z=await b()}catch{z=void 0}let N=[];z&&Array.isArray(z)&&z.length>0?N=z:L&&L.length>0?N=L:N=$(),n?.(N),c?.(N)},H=()=>{d?.(!1),typeof s!="boolean"&&_(!1)},D=()=>{x(),n?.([]),c?.([])};return k.useEffect(()=>{const z=A=>{v&&S.current&&(S.current.contains(A.target)||(d?.(!1),typeof s!="boolean"&&_(!1)))},N=A=>{A.key==="Escape"&&v&&(d?.(!1),typeof s!="boolean"&&_(!1))};return v&&(document.addEventListener("pointerdown",z),document.addEventListener("keydown",N)),()=>{document.removeEventListener("pointerdown",z),document.removeEventListener("keydown",N)}},[v,s,d]),o.jsxs("div",{className:V.advancedFiltersContainer,ref:S,children:[o.jsxs("button",{className:`${V.toggleFiltersButton} ${L.length>0?V.active:""} ${v?V.toggleFiltersButtonOpen:""} ${f?V.loadingButton:""}`,onClick:j,"aria-expanded":v,"aria-controls":"advanced-filters-panel",type:"button",disabled:f,children:[f?o.jsx("span",{className:V.loaderSpinnerSmall}):o.jsx(wt,{size:14}),o.jsx("span",{className:V.buttonTextCompact,children:u}),L.length>0&&!f&&o.jsx("span",{className:V.filterCountBadge,"aria-hidden":!0,children:L.length}),f&&o.jsx("span",{className:V.loadingIndicator,"aria-hidden":!0,children:"Chargement..."})]}),v&&o.jsxs("div",{id:"advanced-filters-panel",ref:I,className:`${V.filtersPanel} ${l==="top"?`${V.filtersPanelInline} ${V.filtersPanelHorizontal}`:""}`,role:"region","aria-label":"Panneau de filtres avancés",children:[o.jsx("div",{className:V.filtersRow,children:e.map(z=>o.jsxs("div",{className:`${V.filterItem} ${V.filterItemInline}`,children:[o.jsxs("label",{className:V.filterLabel,children:[z.label,z.required&&o.jsx("span",{className:V.required,children:"*"})]}),o.jsx(q5e,{config:z,value:w[z.id],onChange:N=>C(z.id,N),disabled:z.disabled})]},z.id))}),o.jsxs("div",{className:V.filtersActionsHorizontal,children:[o.jsx("div",{className:V.activeFiltersSection,children:L.length>0&&o.jsxs("div",{className:V.activeFiltersRow,children:[o.jsx("span",{className:V.activeLabelCompact,children:"Actifs :"}),o.jsx("div",{className:V.activeFiltersList,children:L.map(z=>o.jsxs("div",{className:V.activeFilterTag,children:[z.label??z.id,o.jsx("button",{className:V.removeFilterButton,onClick:()=>C(z.id,void 0),"aria-label":`Supprimer ${z.id}`,type:"button",children:"×"})]},z.id))}),o.jsxs("button",{className:V.clearAllButton,onClick:D,type:"button",children:[o.jsx(Ge,{size:12})," ",m]})]})}),o.jsxs("div",{className:V.actionsGroup,children:[o.jsx("button",{className:V.cancelButton,onClick:H,type:"button",disabled:f,children:y}),o.jsx("button",{className:`${V.applyButton} ${f?V.loadingButton:""}`,onClick:q,type:"button",disabled:g||f,"aria-disabled":g||f,children:f?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:V.loaderSpinnerSmall}),o.jsx("span",{children:"Chargement..."})]}):p})]})]})]})]})},aS=e=>{const t=e.replace(/[^A-Za-zÀ-ÖØ-öø-ÿ]/g,"");return t.length>0&&t===t.toUpperCase()},P5e=({columns:e,sortConfig:t,onSort:n,label:c="Sort",loading:i=!1})=>{const[r,s]=k.useState(!1),d=e.filter(g=>g.sortable),l=k.useRef(null),h=t?.key!==null&&t?.key!==void 0,u=(g,f)=>{n({key:g,direction:f}),s(!1)},p=()=>{n({key:null,direction:"asc"}),s(!1)},y=()=>s(g=>!g),m=()=>{s(!1)};return k.useEffect(()=>{if(!r)return;const g=M=>{if(!l.current)return;const _=M.target;_&&!l.current.contains(_)&&s(!1)},f=M=>{M.key==="Escape"&&s(!1)};return document.addEventListener("pointerdown",g),document.addEventListener("keydown",f),()=>{document.removeEventListener("pointerdown",g),document.removeEventListener("keydown",f)}},[r]),k.useEffect(()=>{const g=document.querySelector("[data-table-wrapper]");if(!g)return;const f=g.style.overflow??"";return r?g.style.overflow="hidden":g.style.overflow=f,()=>{g.style.overflow=f}},[r]),o.jsx("div",{className:V.columnSorterContainer,ref:l,children:o.jsx("div",{className:V.sorterControls,children:d.length>0&&o.jsxs("div",{className:V.sortDropdownWrapper,ref:l,children:[o.jsxs("button",{className:`${V.toggleSortButton} ${r?V.toggleSortButtonOpen:""} ${h?V.active:""} ${i?V.loadingButton:""}`,onClick:y,"aria-expanded":r,"aria-haspopup":"true",type:"button",disabled:i,children:[i?o.jsx("span",{className:V.loaderSpinnerSmall}):o.jsx(Kc,{size:14}),o.jsx("span",{className:`${V.buttonTextCompact} ${aS(c)?V.uppercaseSmall:""}`,children:c}),h&&!i&&o.jsx("div",{className:V.sortIndicator,children:t?.direction==="asc"?o.jsx(Nc,{size:12}):o.jsx(qt,{size:12})})]}),r&&o.jsxs("div",{className:`${V.sortDropdown} ${V.sortDropdownInline}`,role:"menu",children:[o.jsxs("div",{className:V.sortDropdownHeader,children:[o.jsx("span",{children:"Trier par:"}),o.jsx("button",{className:V.closeButton,onClick:m,"aria-label":"Fermer",type:"button",children:o.jsx(Ge,{size:16})})]}),o.jsx("div",{className:V.sortDropdownContent,children:d.map(g=>{const f=String(g.label??g.id),M=aS(f);return o.jsxs("div",{className:V.sortDropdownItem,role:"menuitem",tabIndex:0,onKeyDown:_=>{_.key==="Enter"&&u(g.id,"asc")},children:[o.jsx("span",{className:`${V.columnSorterLabel} ${M?V.uppercaseSmall:""}`,title:f,"aria-label":f,children:f}),o.jsxs("div",{className:V.sortDirectionButtons,children:[o.jsx("button",{className:`${V.sortDirectionButton} ${t?.key===g.id&&t?.direction==="asc"?V.activeSort:""}`,onClick:()=>u(g.id,"asc"),title:"Trier par ordre croissant",type:"button",children:o.jsx(Nc,{size:12})}),o.jsx("button",{className:`${V.sortDirectionButton} ${t?.key===g.id&&t?.direction==="desc"?V.activeSort:""}`,onClick:()=>u(g.id,"desc"),title:"Trier par ordre décroissant",type:"button",children:o.jsx(qt,{size:12})})]})]},g.id)})}),h&&o.jsx("div",{className:V.sortActions,children:o.jsxs("button",{className:V.clearSortButton,onClick:p,type:"button",children:[o.jsx(bt,{size:14}),o.jsx("span",{children:"Annuler le tri"})]})})]})]})})})},T5e=({currentPage:e,totalPages:t,pageSize:n,totalItems:c,itemLabel:i="items",onPageChange:r,onPageSizeChange:s,loading:d=!1})=>{const l=Math.max(1,Math.floor(t)),h=Math.min(Math.max(1,Math.floor(e)),l),u=()=>{h>1&&r(h-1)},p=()=>{if(h<t){const f=h+1;r(f)}},y=c>0?(h-1)*n+1:0,m=c>0?Math.min(h*n,c):0,g=()=>{const f=[];let _=Math.max(1,h-Math.floor(2.5)),v=_+5-1;v>l&&(v=l,_=Math.max(1,v-5+1));for(let L=_;L<=v;L++)f.push(L);return f};return o.jsxs("div",{className:V.paginationContainer,role:"navigation","aria-label":"Pagination",children:[o.jsx("div",{className:V.leftGroup,children:s&&o.jsx("div",{className:V.pageSizeControls,children:o.jsx("select",{value:n,onChange:f=>s(Number(f.target.value)),className:V.pageSizeSelect,"aria-label":"Taille de page",disabled:d,children:[10,20,30].map(f=>o.jsx("option",{value:f,children:f},f))})})}),o.jsx("div",{className:V.paginationInfo,"aria-live":"polite",children:d?o.jsxs("span",{className:V.paginationLoading,children:[o.jsx("span",{className:V.loaderSpinner}),o.jsx("span",{children:"Chargement..."})]}):`${y}-${m} ${i}`}),o.jsxs("div",{className:V.paginationControls,children:[o.jsx("button",{onClick:u,disabled:h===1||d,className:`${V.paginationButton} ${V.navigationButton} ${h===1?V.disabledButton:""} ${d?V.loadingButton:""}`,"aria-label":"Page précédente",children:d&&h>1?o.jsx("span",{className:V.loaderSpinnerSmall}):"«"}),g().map(f=>o.jsx("button",{onClick:()=>r(f),disabled:d,"aria-current":h===f?"page":void 0,className:`${V.paginationButton} ${h===f?V.activeButton:""} ${d?V.loadingButton:""}`,children:d&&h===f?o.jsx("span",{className:V.loaderSpinnerSmall}):f},f)),o.jsx("button",{onClick:p,disabled:d||h>=l,className:`${V.paginationButton} ${V.navigationButton} ${d?V.loadingButton:""} ${h>=l?V.disabledButton:""}`,"aria-label":"Page suivante",children:d?o.jsx("span",{className:V.loaderSpinnerSmall}):"»"})]})]})},H5e=(e,t)=>{if(!e)return"";if(t)return e;const n=String(e).trim();if(!n)return n;const c=n.toLowerCase();return c.charAt(0).toUpperCase()+c.slice(1)},D5e=e=>{if(!e)return!1;const t=e.trim().split(/\s+/);return e.length>18||t.length>2},B5e=({columns:e})=>o.jsx("thead",{className:V.tableHeader,children:o.jsx("tr",{children:e.map((t,n)=>{const c=t.align==="right"?V.alignRight:t.align==="left"?V.alignLeft:V.alignCenter,i=t.preserveHeaderCase===!0,r=H5e(String(t.label??""),i),s=D5e(r),d=s?r.split(/\s+/):[];return o.jsx("th",{className:`${V.headerCell} ${c}`,style:{width:t.width??void 0},"data-preserve":i?"true":"false",title:t.a11yConfig?.mode==="guide"?t.a11yConfig.description:t.a11yConfig?.mode==="key"?t.a11yConfig.key:void 0,children:o.jsx("div",{className:V.headerContent,children:s?o.jsx("div",{className:V.headerWords,children:d.map((l,h)=>o.jsx("span",{className:V.headerWord,children:l},h))}):o.jsx("span",{children:r})})},t.id??`col-${n}`)})})}),R5e=({value:e,row:t,column:n})=>{const c=n.align==="right"?V.alignRight:n.align==="left"?V.alignLeft:V.alignCenter,i=typeof n.render=="function"?n.render(e,t):e==null?"":String(e);return o.jsx("td",{className:`${V.tableCell} ${c}`,style:{width:n.width??void 0},children:o.jsx("div",{className:V.cellContent,children:i})})},F5e=({row:e,rowId:t,columns:n,onRowClick:c,index:i,getRowStyle:r})=>{const s=r?r(e):{},{backgroundColor:d,accentColor:l,...h}=s||{},u={backgroundColor:d,...h,"--row-accent":l??"transparent"};return o.jsx("tr",{className:`${V.tableRow} ${c?V.clickableRow:""}`,onClick:()=>c?.(e,i),style:u,children:n.map(p=>o.jsx(R5e,{value:e[p.id],row:e,column:p},`${t}-${p.id}`))})},E5e=({data:e,columns:t,onRowClick:n,startIndex:c,searchTerm:i,getRowStyle:r})=>e.length===0?o.jsx("tbody",{children:o.jsx("tr",{children:o.jsx("td",{colSpan:t.length,className:V.emptyRow,children:i?"Aucun résultat trouvé":"Aucune donnée disponible"})})}):o.jsx("tbody",{children:e.map((s,d)=>o.jsx(F5e,{row:s.data,rowId:s.id,columns:t,onRowClick:n,index:c+d-1,getRowStyle:r},s.id))}),Wq=({columns:e=[],data:t=[],pagination:n={pageSize:10,currentPage:1},onRowClick:c,searchTerm:i="",className:r="",filterConfig:s=[],externalFilters:d=[],onFiltersChange:l,onApplyFilters:h,onSort:u,filtersControlled:p=!1,debounceTimeout:y=300,getRowStyle:m,background:g,onPageSizeChange:f,onPageChange:M,itemLabel:_="items",advancedFiltersLabel:v="Advanced-Filters",advancedFiltersActiveLabel:L,sortLabel:w="Sort",applyLabel:C="Apply",cancelLabel:b="Cancel",clearLabel:x="Clear",applyDisabled:I=!1,paginationLoading:S=!1,filtersLoading:j=!1,sortLoading:$=!1,totalCount:q=null})=>{const[H,D]=k.useState({key:null,direction:"asc"}),[z,N]=k.useState(n.currentPage??1),[A,R]=k.useState(n.pageSize??10),[P,T]=k.useState(!1),E=k.useRef(null),[X,ae]=k.useState([]),J=p?d:X,Ie=p?[]:X;k.useEffect(()=>{const ne=n.currentPage??1,zc=n.pageSize??10;ne!==z&&N(ne),zc!==A&&R(zc)},[n.currentPage,n.pageSize]);const{paginatedData:me,sortedData:$e,totalPages:se,startIndex:F}=Tq(t,e,i,H,z,A,Ie),ee=$e.length,re=typeof q=="number"&&q>=0?q:ee;let oe=se;typeof q=="number"&&q>=0&&(oe=Math.max(1,Math.ceil(q/A)));const ke=ee>10;k.useEffect(()=>{const ne=Math.max(1,Math.floor(oe));z>ne&&N(ne),z<1&&N(1)},[oe]);const Le=ne=>{p||ae(ne),l?.(ne),N(1),M?.(1)},ve=ne=>{p||ae(ne),h?.(ne),N(1),M?.(1),E.current&&E.current.style.setProperty("--filters-panel-height","0px")},qe=ne=>{M?.(ne),N(ne)},je=ne=>{R(ne),N(1),f?.(ne),M?.(1)},ue=ne=>{E.current&&E.current.style.setProperty("--filters-panel-height",`${Math.round(ne)}px`)},be=ne=>{D(ne),u?.(ne)},Mt=ne=>{T(ne),!ne&&E.current&&E.current.style.setProperty("--filters-panel-height","0px")};k.useEffect(()=>{(J?.length??0)>0&&T(!0)},[J]),k.useEffect(()=>{s.length>0&&J.length>0&&T(!0)},[s.length,J.length]);const Ac=(J?.length??0)>0&&L?L:v;return o.jsxs("div",{ref:E,className:`${V.container} ${r} ${P?V.filtersOpen:""}`,style:{background:g,"--row-height":"48px","--header-height":"56px"},children:[o.jsx("div",{className:V.tableControls,children:o.jsxs("div",{className:V.controlsRight,children:[o.jsx(P5e,{columns:e,onSort:be,label:w,sortConfig:H,loading:$}),s.length>0&&o.jsx(V5e,{filters:s,externalFilters:J,onFiltersChange:Le,onApply:ve,isControlled:p,debounceTimeout:y,expanded:P,onToggle:Mt,panelPlacement:"top",onPanelHeightChange:ue,label:Ac,applyLabel:C,cancelLabel:b,clearLabel:x,applyDisabled:I,loading:j})]})}),o.jsx("div",{className:V.topPagination,children:o.jsx(T5e,{currentPage:z,totalPages:oe,pageSize:A,totalItems:re,itemLabel:_,onPageChange:qe,onPageSizeChange:je,loading:S})}),o.jsx("div",{className:`${V.tableWrapper} ${ke?V.limitedRows:""}`,"data-table-wrapper":!0,children:o.jsxs("table",{className:V.table,children:[o.jsx(B5e,{columns:e}),o.jsx(E5e,{data:me,columns:e,onRowClick:c,startIndex:F,getRowStyle:m,searchTerm:i})]})})]})};function O5e(e){const{pagination:t,totalCount:n,onPageChange:c,...i}=e,r=t?.pageSize??20,s=t?.currentPage??1,d=k.useMemo(()=>{if(n===null||typeof n>"u")return null;const p=Number(n);if(!Number.isFinite(p)||p<=0)return 1;const y=Number(r);return!Number.isFinite(y)||y<=0?1:Math.max(1,Math.ceil(p/y))},[n,r]),l=s>1,h=d===null?!1:s<d,u=p=>{typeof p=="number"&&(p<1||p<s&&!l||p>s&&!h||c?.(p))};return o.jsx(Wq,{...i,pagination:{pageSize:r,currentPage:s},totalCount:n,onPageChange:u})}const U5e="_mpRoot_31595_1",W5e="_mpHeader_31595_22",G5e="_mpTitle_31595_31",K5e="_mpList_31595_35",Z5e="_mpVertical_31595_41",X5e="_mpHorizontal_31595_46",Y5e="_mpItem_31595_55",J5e="_mpClickable_31595_95",Q5e="_mpLeft_31595_117",eke="_mpIcon_31595_125",tke="_mpMeta_31595_140",ake="_mpLabel_31595_145",nke="_mpDate_31595_154",oke="_mpRight_31595_160",cke="_mpValue_31595_168",ike="_mpHint_31595_176",rke="_mpBadge_31595_180",ske="_mpBadgeTop_31595_199",dke="_mpBadgeSub_31595_206",lke="_mpBadgeSmall_31595_213",hke="_mpPill_31595_229",uke="_mpRounded_31595_232",pke="_mpCompact_31595_236",yke="_compactItemWrapper_31595_252",kke="_mpSummaryRoot_31595_265",mke="_mpSummaryInner_31595_269",fke="_mpSummaryFlex_31595_284",gke="_mpSummaryCardWrapperHorizontal_31595_292",vke="_mpSummaryCardWrapper_31595_292",Mke="_mpSummaryCardHorizontal_31595_303",_ke="_mpSummaryCard_31595_292",xke="_mpSummaryValue_31595_321",Lke="_mpSummaryLabel_31595_327",Ike="_mpSummaryBadge_31595_338",bke="_mpSummaryBadgeSub_31595_357",wke="_mpEmpty_31595_365",Cke="_mpSummaryVertical_31595_372",Nke="_mpIconSquare_31595_380",W={mpRoot:U5e,mpHeader:W5e,mpTitle:G5e,mpList:K5e,mpVertical:Z5e,mpHorizontal:X5e,mpItem:Y5e,mpClickable:J5e,mpLeft:Q5e,mpIcon:eke,mpMeta:tke,mpLabel:ake,mpDate:nke,mpRight:oke,mpValue:cke,mpHint:ike,mpBadge:rke,mpBadgeTop:ske,mpBadgeSub:dke,mpBadgeSmall:lke,mpPill:hke,mpRounded:uke,mpCompact:pke,compactItemWrapper:yke,mpSummaryRoot:kke,mpSummaryInner:mke,mpSummaryFlex:fke,mpSummaryCardWrapperHorizontal:gke,mpSummaryCardWrapper:vke,mpSummaryCardHorizontal:Mke,mpSummaryCard:_ke,mpSummaryValue:xke,mpSummaryLabel:Lke,mpSummaryBadge:Ike,mpSummaryBadgeSub:bke,mpEmpty:wke,mpSummaryVertical:Cke,mpIconSquare:Nke},$t=(e,t=1)=>{if(!e||typeof e!="string")return`rgba(124, 58, 237, ${t})`;const n=e.trim();if(n.toLowerCase()==="transparent")return"rgba(0,0,0,0)";if(/^rgba?\(/i.test(n))return/^rgba\(/i.test(n)?n.replace(/rgba\(([^)]+),\s*([0-9.]+)\s*\)$/,(d,l)=>`rgba(${l.split(",").map(u=>u.trim()).slice(0,3).join(", ")}, ${t})`):n;let c=n.replace("#","").toLowerCase();if(c.length===3&&(c=c.split("").map(d=>d+d).join("")),!/^[0-9a-f]{6}$/i.test(c))return`rgba(124, 58, 237, ${t})`;const i=parseInt(c.slice(0,2),16),r=parseInt(c.slice(2,4),16),s=parseInt(c.slice(4,6),16);return`rgba(${i}, ${r}, ${s}, ${t})`},jke=({item:e,shape:t,onItemClick:n,color:c,renderItem:i})=>{const r=k.useCallback(()=>{n?.(e)},[n,e]),s=[W.mpItem,t==="pill"?W.mpPill:W.mpRounded,n?W.mpClickable:""].filter(Boolean).join(" ");if(i)return o.jsx("div",{className:s,role:n?"button":"group",tabIndex:n?0:-1,onClick:r,onKeyDown:y=>{n&&(y.key==="Enter"||y.key===" ")&&(n(e),y.preventDefault())},"aria-label":n?`Voir les détails de ${e.label}`:void 0,children:i(e)});const d=n?"button":"div",l=n?{onClick:r,className:s,type:"button","aria-label":`Voir les détails de ${e.label}`}:{className:s,role:"group"},h=e.iconComponent,u=e.iconSquareBg,p=e.iconColor;return o.jsxs(d,{...l,children:[o.jsxs("div",{className:W.mpLeft,children:[h?o.jsx("div",{className:W.mpIconSquare,style:{background:u??$t(p??c??"#7c3aed",1),border:`1px solid ${$t(p??c??"#7c3aed",.18)}`,color:p??"#ffffff"},children:k.createElement(h,{size:20,color:p??"#fff",strokeWidth:1.8})}):e.icon?o.jsx("div",{className:W.mpIcon,children:e.icon}):null,o.jsxs("div",{className:W.mpMeta,children:[o.jsx("div",{className:W.mpLabel,children:e.label}),e.subLabel&&o.jsx("div",{className:W.mpDate,children:e.subLabel}),e.date&&o.jsx("div",{className:W.mpDate,children:e.date})]})]}),o.jsxs("div",{className:W.mpRight,children:[o.jsx("div",{className:W.mpValue,style:{color:e.valueColor??c??void 0},children:e.value}),e.badge?o.jsxs("div",{className:[W.mpBadge,e.badge.small?W.mpBadgeSmall:""].join(" "),style:{backgroundColor:e.badge.bg??$t(e.badge.color||c||"#7c3aed",.12),borderColor:e.badge.bg?"transparent":$t(e.badge.color||c||"#7c3aed",.18),color:e.badge.color??e.badge.textColor??"#0f172a",fontWeight:600},children:[o.jsx("div",{className:W.mpBadgeTop,children:e.badge.text}),e.badge.subText&&o.jsx("div",{className:W.mpBadgeSub,children:e.badge.subText})]}):e.hint?o.jsx("div",{className:W.mpHint,children:e.hint}):null]})]})},Ske=k.memo(jke),nS=({title:e,right:t})=>!e&&!t?null:o.jsxs("div",{className:W.mpHeader,children:[o.jsx("div",{className:W.mpTitle,children:e}),o.jsx("div",{children:t})]}),oS=(e,t=1)=>{try{return $t(e,t)}catch{return`rgba(124, 58, 237, ${t})`}},$ke=({item:e})=>o.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:14,borderRadius:12,minHeight:88,boxSizing:"border-box",background:e.bgColor??"transparent",border:`1px solid ${e.borderColor??"transparent"}`,boxShadow:"0 4px 10px rgba(15,23,42,0.03)"},children:[o.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[o.jsx("div",{style:{fontSize:13,fontWeight:700,color:"#475569"},children:e.label}),o.jsx("div",{style:{fontSize:26,fontWeight:900,color:"#0f172a",lineHeight:1},children:e.value})]}),o.jsx("div",{title:String(e.label),style:{display:"flex",alignItems:"center",justifyContent:"center",width:48,height:48,borderRadius:10,background:e.iconSquareBg??oS("#7c3aed",.12),border:`1px solid ${oS(e.iconColor??"#7c3aed",.12)}`,boxShadow:"none"},children:e.iconComponent?k.createElement(e.iconComponent,{size:18,color:e.iconColor??"#7c3aed",strokeWidth:1.6}):null})]}),qke=({item:e,bg:t,onClick:n,width:c,height:i,extraStyle:r})=>o.jsxs("div",{className:W.mpSummaryCard,style:{background:t,width:c??void 0,height:i??void 0,...r??{}},role:n?"button":"group",tabIndex:n?0:-1,onClick:()=>n?.(e),children:[o.jsx("div",{className:W.mpSummaryLabel,children:e.label}),o.jsx("div",{className:W.mpSummaryValue,style:{color:e.valueColor??"#2a24deff"},children:e.value}),e.badge&&o.jsxs("div",{className:W.mpSummaryBadge,children:[e.badge.text,e.badge.subText&&o.jsx("div",{className:W.mpSummaryBadgeSub,children:e.badge.subText})]})]}),cS=(e,t=1)=>{try{return $t(e,t)}catch{return`rgba(124, 58, 237, ${t})`}},iS=e=>o.jsxs("div",{style:{display:"grid",gridTemplateRows:"auto 1fr",width:"100%",gap:8,alignItems:"center",boxSizing:"border-box",minWidth:0},children:[o.jsxs("div",{style:{display:"flex",justifyContent:"space-between-left",alignItems:"baseline",gap:10,width:"100%"},children:[o.jsx("div",{style:{fontWeight:700,fontSize:"clamp(14px, 1.2vw, 16px)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:e.label}),e.subLabel?o.jsx("div",{style:{fontSize:"clamp(13px, 1.1vw, 15px)",fontWeight:600,whiteSpace:"nowrap"},children:e.subLabel}):null]}),o.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:15,width:"100%"},children:[o.jsx("div",{style:{fontWeight:900,fontSize:"clamp(16px, 1.6vw, 20px)",color:e.valueColor,lineHeight:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.value}),e.badge?o.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"8px 12px",borderRadius:10,backgroundColor:e.badge.bg?e.badge.bg:cS("#7c3aed",.08),border:`1px solid ${e.badge.bg?e.badge.bg:cS("#7c3aed",.12)}`,color:e.badge.textColor||"#0f172a",fontWeight:700,fontSize:"clamp(12px, 1.2vw, 14px)",width:"120px",height:"52px",textAlign:"center",boxSizing:"border-box",overflow:"hidden",boxShadow:"0 2px 4px rgba(0,0,0,0.1)",lineHeight:1.2,flexShrink:0},children:[o.jsx("div",{style:{fontSize:14,fontWeight:800,lineHeight:1.2,letterSpacing:"0.02em",width:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.badge.text}),e.badge.subText?o.jsx("div",{style:{fontSize:13,marginTop:4,fontWeight:700,letterSpacing:"0.01em",width:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.badge.subText}):null]}):null]})]}),rS=(e,t)=>{try{if(typeof e=="function"){const n=e(t);if(n!==void 0)return n}}catch{}try{return k.createElement(e,{item:t})}catch(n){return console.warn("chooseDefaultRender: impossible de rendre CompactRenderer",n),null}},Ake=e=>{switch(e){case"image":return t=>k.createElement($ke,{item:t});case"pertinence":return t=>k.createElement(qke,{item:t});case"alternateHorizontal":return t=>rS(iS,t);case"compact":return t=>rS(iS,t);case"summary":return;case"default":default:return}},Gq=({item:e,orientation:t,bg:n,border:c,valueColor:i,onClick:r,width:s,height:d,extraStyle:l})=>{const u=t==="horizontal"?W.mpSummaryCardHorizontal:W.mpSummaryCard;return o.jsxs("div",{className:u,style:{background:n,border:`1px solid ${c}`,width:s??void 0,height:d??void 0,...l??{}},role:r?"button":"group",tabIndex:r?0:-1,onClick:()=>r?.(e),children:[e.badge&&o.jsxs("div",{className:W.mpSummaryBadge,children:[e.badge.text,e.badge.subText&&o.jsx("div",{className:W.mpSummaryBadgeSub,children:e.badge.subText})]}),o.jsx("div",{className:W.mpSummaryValue,style:{color:i},children:e.value}),o.jsx("div",{className:W.mpSummaryLabel,children:e.label})]})},zke=["transparent","transparent","transparent","transparent"],Vke=["transparent","transparent","transparent","transparent"],Pke=["#059669","#2563eb","#b45309","#7c3aed"],Tke=(e,t=1)=>{try{return $t(e,t)}catch{return`rgba(124, 58, 237, ${t})`}},Kq=e=>{const{items:t=[],layout:n="vertical",orientation:c="auto",shape:i="rounded",color:r="#7c3aed",compact:s=!1,title:d,onItemClick:l,className:h="",loading:u=!1,emptyMessage:p="Aucun élément",renderItem:y,summary:m=!1,summaryBgColors:g=zke,summaryBorderColors:f=Vke,summaryValueColors:M=Pke,preset:_,background:v}=e,{itemsContainerStyle:L,itemsContainerClassName:w,summaryGridColumns:C,compactItemWidth:b,compactItemHeight:x,compactItemStyle:I,summaryCardWidth:S,summaryCardHeight:j,summaryCardStyle:$}=e,q=n==="vertical",H={"--mp-accent":r,"--mp-accent-soft":Tke(r,.08),"--mp-bg-primary":v},D=[W.mpRoot,q?W.mpVertical:W.mpHorizontal,s?W.mpCompact:"",m?W.mpSummaryRoot:"",c!=="auto"?c==="vertical"?W.mpOrientationVertical:W.mpOrientationHorizontal:"",h].filter(Boolean).join(" "),z=k.useMemo(()=>y||(Ake(_)??void 0),[y,_]);if(m){const N=c==="horizontal"?W.mpSummaryFlex:W.mpSummaryVertical,R={...(C?{display:"grid",gridTemplateColumns:`repeat(${C}, 1fr)`,gap:18,alignItems:"stretch",width:"100%"}:void 0)??{},...L??{}};return o.jsxs("div",{className:D,style:H,"aria-busy":u,children:[d&&o.jsx(nS,{title:d}),o.jsx("div",{className:W.mpSummaryInner,children:o.jsx("div",{className:`${N} ${w??""}`,style:R,children:t.length===0?o.jsx("div",{className:W.mpEmpty,children:p}):t.map((P,T)=>{const E=P.bgColor??g[T%g.length],X=P.borderColor??f[T%f.length],ae=P.valueColor??M[T%M.length];return z?o.jsx("div",{className:c==="horizontal"?W.mpSummaryCardWrapperHorizontal:W.mpSummaryCardWrapper,style:{width:S??void 0,height:j??void 0,...$??{}},children:z(P,T)},P.id):o.jsx(Gq,{item:P,orientation:c==="horizontal"?"horizontal":"vertical",bg:E,border:X,valueColor:ae,onClick:l,width:S??void 0,height:j??void 0,extraStyle:$},P.id)})})})]})}return o.jsxs("div",{className:D,style:H,"aria-busy":u,children:[d&&o.jsx(nS,{title:d}),o.jsx("div",{className:W.mpList,style:L,children:u?o.jsx("div",{className:W.mpEmpty,children:"Chargement…"}):t.length===0?o.jsx("div",{className:W.mpEmpty,children:p}):t.map(N=>{const A=s?{width:b??void 0,height:x??void 0,boxSizing:"border-box",...I??{}}:void 0;return o.jsx("div",{className:s?W.compactItemWrapper:void 0,style:A,children:o.jsx(Ske,{item:N,shape:i,onItemClick:l,color:r,renderItem:z?R=>z(R,t.indexOf(R)):void 0})},N.id)})})]})};k.memo(Kq);const Hke=({a11yConfig:e,width:t,height:n,colors:c={text:"#0b1220",background:"#fff",contentBackground:"#efeff0"},titles:i={},placeholder:r="Loading Chart",style:s,className:d="",children:l,padding:h="1rem",variant:u="default",showBorder:p=!1,titleKey:y,leftTitleKey:m})=>{const g=t?typeof t=="number"?`${t}px`:t:void 0,f=n?typeof n=="number"?`${n}px`:n:void 0,M=r&&typeof r=="object"&&!k.isValidElement(r)&&("text"in r||"subtext"in r||"icon"in r||"background"in r||"iconSize"in r),_=M?r:void 0,v=_?.icon?kt[_.icon]:void 0,L=28,w=_?.iconSize??L,C=["chart-container",`variant-${u}`,p?"with-border":"",d].filter(Boolean).join(" "),b=c.contentBackground??void 0,x=typeof h=="number"?`${h}px`:h;return o.jsxs("div",{className:C,style:{width:g,height:f,color:c.text,background:c.background,display:"flex",flexDirection:"column",boxSizing:"border-box",padding:x,...s},children:[o.jsxs("div",{className:"chart-header",children:[o.jsxs("div",{title:Y(e,m||y),className:"chart-title-left",style:{display:"flex",alignItems:"center",gap:"8px"},children:[i.left,i.leftSubtitle&&o.jsx("div",{className:"chart-subtitle-left",children:i.leftSubtitle})]}),o.jsx("div",{className:"chart-title-right",children:i.right})]}),o.jsx("div",{className:"chart-content",style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",background:b},children:l||(M&&_?o.jsxs("div",{className:"placeholder",role:"status","aria-live":"polite",children:[v&&o.jsx("div",{className:"placeholder-icon",style:{width:w,height:w},children:o.jsx(v,{color:_.iconColor??"currentColor",size:typeof w=="number"?w:parseInt(String(w),10)||L})}),_.text&&o.jsx("div",{className:"placeholder-text",children:_.text}),_.subtext&&o.jsx("div",{className:"placeholder-subtext",children:_.subtext})]}):o.jsx("div",{className:"placeholder-node",role:"status","aria-live":"polite",children:r}))})]})},Kw=({id:e,size:t="100%",background:n,icon:c,text:i,subtext:r,onClose:s,onClick:d,style:l,className:h="",colorTextPrimary:u,colorTextSub:p,model:y})=>{const m=c||y?.icon?kt[c||y?.icon]:null;return o.jsxs("div",{id:e,className:`alert ${h}`,style:{width:typeof t=="number"?`${t}px`:t,background:n||y?.background,pointerEvents:"auto",...l},role:"alert",onClick:d,children:[m&&o.jsx(m,{className:"alert-icon",size:20,color:u||y?.colorTextPrimary}),o.jsxs("div",{className:"alert-content",children:[o.jsx("span",{className:"alert-text",style:{color:u||y?.colorTextPrimary},children:i}),r&&o.jsx("span",{className:"alert-subtext",style:{color:p||y?.colorTextSub},children:r})]}),s&&o.jsx("button",{className:"alert-close",onClick:s,"aria-label":"Fermer",children:"✕"})]})},Zq=k.createContext(null),Dke=(e="alert")=>`${e}_${Math.random().toString(36).slice(2,9)}`,Bke=({children:e,defaultDuration:t=4e3,maxAlerts:n,containerClassName:c,containerStyle:i})=>{const[r,s]=k.useState([]),d=k.useRef(new Map),l=k.useRef(null),h=k.useRef(null),u=k.useRef(n);k.useEffect(()=>()=>{d.current.forEach(x=>window.clearTimeout(x)),d.current.clear()},[]);const p=(x,I)=>{const S=I===void 0||I===0?t:I;if(S===-1)return;const j=window.setTimeout(()=>{g(x)},S);d.current.set(x,j)},y=x=>{const I=d.current.get(x);I&&(window.clearTimeout(I),d.current.delete(x))},m=x=>{const I=Dke(),S={...x,id:I,createdAt:Date.now()};return s(j=>{const $=[S,...j],q=u.current;return typeof q=="number"&&q>=0&&$.length>q?($.slice(q).forEach(D=>y(D.id)),$.slice(0,q)):$}),p(I,x.duration),I},g=x=>{y(x),s(I=>I.filter(S=>S.id!==x))},f=(x,I)=>{s(S=>S.map(j=>j.id===x?{...j,...I}:j))},M=()=>{d.current.forEach(x=>window.clearTimeout(x)),d.current.clear(),s([])},_=x=>{h.current=x},v=()=>r.slice(),L=k.useMemo(()=>({showAlert:m,dismissAlert:g,updateAlert:f,clearAlerts:M,setContainerRef:_,getAlertsSnapshot:v}),[r]),w=h.current,C=o.jsx("div",{style:{position:"absolute",top:0,left:0,right:0,display:"flex",flexDirection:"column",alignItems:"center",pointerEvents:"none",zIndex:10001,padding:"8px 4px"},children:o.jsx(I0e,{mode:"popLayout",children:r.map(x=>o.jsx(Ew.div,{initial:{opacity:0,y:-10,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-10,scale:.98},transition:{type:"spring",damping:25,stiffness:300},style:{width:"100%",pointerEvents:"auto",boxShadow:"0 6px 20px rgba(0, 0, 0, 0.12)",borderRadius:"8px",marginBottom:"6px",backgroundColor:x.background||x.model?.background||"var(--color-background, #fff)",border:"1px solid rgba(0, 0, 0, 0.08)",overflow:"hidden"},children:o.jsx(Kw,{id:x.id,text:x.text,subtext:x.subtext,icon:x.icon,background:"transparent",colorTextPrimary:x.colorTextPrimary,colorTextSub:x.colorTextSub,model:x.model,onClose:()=>g(x.id),size:"100%",style:{boxShadow:"none"}})},x.id))})}),b=o.jsx("div",{ref:x=>{h.current||(l.current=x)},className:c,style:{width:"100%",position:"relative",...i},"aria-live":"polite",children:C});return o.jsxs(Zq.Provider,{value:L,children:[w?dw.createPortal(C,w):b,e]})},Rke=()=>{const e=k.useContext(Zq);if(!e)throw new Error("useAlerts must be used inside an AlertsProvider");return e},Fke={default:{background:"#f3f4f6",icon:"Info",colorTextPrimary:"#111827",colorTextSub:"#4b5563"},info:{background:"#dbeafe",icon:"Info",colorTextPrimary:"#1e40af",colorTextSub:"#3b82f6"},success:{background:"#dcfce7",icon:"CheckCircle2",colorTextPrimary:"#166534",colorTextSub:"#22c55e"},warning:{background:"#fef3c7",icon:"AlertTriangle",colorTextPrimary:"#92400e",colorTextSub:"#f59e0b"},error:{background:"#fee2e2",icon:"XCircle",colorTextPrimary:"#991b1b",colorTextSub:"#ef4444"}},Eke="_container_18zbo_1",Oke="_icon_18zbo_9",Uke="_selectWrapper_18zbo_23",qb={container:Eke,icon:Oke,selectWrapper:Uke},Wke=({options:e,defaultValue:t,onChange:n,label:c})=>{const[i,r]=k.useState(t||e[0]?.value||""),s=d=>{r(d),n?.(d)};return o.jsxs("div",{className:qb.container,children:[o.jsxs("div",{className:qb.icon,children:[o.jsx(M1,{size:18}),o.jsx("p",{children:c})]}),o.jsx("div",{className:qb.selectWrapper,children:o.jsx(Ow,{field:{name:"periode",label:"",options:e},value:i,onChange:s,onBlur:()=>{}})})]})},Gke=250,Kke=k.forwardRef(({title:e,subtitle:t,size:n="420px",beforeOpen:c,afterOpen:i,beforeClose:r,afterClose:s,style:d,className:l="",children:h,closeOnOverlayClick:u=!0,showCloseButton:p=!0},y)=>{const[m,g]=k.useState(!1),[f,M]=k.useState(!1),_=k.useRef(null),v=k.useRef(null),L=k.useRef(null),w=k.useRef(null);k.useEffect(()=>{const x=_.current;if(!x)return;const I=x.parentElement;return I?(window.getComputedStyle(I).position==="static"&&(I.setAttribute("data-scp-prev-position",I.style.position??""),I.style.position="relative",I.setAttribute("data-scp-position-changed","true")),()=>{if(I.getAttribute("data-scp-position-changed")==="true"){const j=I.getAttribute("data-scp-prev-position")??"";I.style.position=j,I.removeAttribute("data-scp-position-changed"),I.removeAttribute("data-scp-prev-position")}}):void 0},[]),k.useImperativeHandle(y,()=>({open:()=>{m||(c?.(),M(!1),g(!0))},close:()=>{m&&(r?.(),M(!1),g(!1))},toggle:()=>{m?(r?.(),M(!1),g(!1)):(c?.(),M(!1),g(!0))}}),[m,c,r]),k.useEffect(()=>{const x=v.current;w.current&&(window.clearTimeout(w.current),w.current=null);const I=S=>{if(S.target===x&&!(S.propertyName!=="transform"&&S.propertyName!=="opacity"))if(m){M(!0),i?.();try{x?.focus()}catch{}}else{s?.();try{L.current?.focus()}catch{}}};return x&&(x.addEventListener("transitionend",I),w.current=window.setTimeout(()=>{if(m){M(!0),i?.();try{x?.focus()}catch{}}else{s?.();try{L.current?.focus()}catch{}}},Gke+60)),m&&(L.current=document.activeElement),()=>{x&&x.removeEventListener("transitionend",I),w.current&&(window.clearTimeout(w.current),w.current=null)}},[m,i,s]),k.useEffect(()=>{const x=I=>{I.key==="Escape"&&m&&(r?.(),M(!1),g(!1))};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[m,r]);const C=()=>{u&&(r?.(),M(!1),g(!1))},b=typeof n=="number"?`${n}px`:n;return o.jsxs("div",{ref:_,className:`scp-inline-root ${m?"open":""}`,"aria-hidden":!m,children:[o.jsx("div",{className:`scp-overlay ${m?"visible":""}`,onMouseDown:C,role:"presentation"}),o.jsxs("aside",{className:`scp-panel ${m?"in":"out"} ${f?"interactive":""} ${l}`,style:{width:b,...d},ref:v,tabIndex:-1,role:"dialog","aria-label":e,children:[o.jsxs("div",{className:"scp-header",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"scp-title",children:e}),t&&o.jsx("div",{className:"scp-subtitle",children:t})]}),p&&o.jsx("button",{className:"scp-close","aria-label":"Close",onClick:()=>{r?.(),M(!1),g(!1)},children:o.jsx(Ge,{size:18})})]}),o.jsx("div",{className:"scp-body",children:h})]})]})});function Zke(e){const t=k.useRef("");k.useEffect(()=>{if(e){t.current=document.body.style.overflow,document.body.style.overflow="hidden";return}document.body.style.overflow=t.current||""},[e])}const Xke="_container_1pfsp_1",Yke="_title_1pfsp_8",sS={container:Xke,title:Yke},Jke=({title:e,fontSize:t,barColor:n,className:c="",style:i={}})=>{const r={...i,"--title-font-size":t,"--bar-color":n};return o.jsx("div",{className:`${sS.container} ${c}`,style:r,children:o.jsx("h2",{className:sS.title,children:e})})},Qke="_modalOverlay_1dmfp_1",e3e="_modalContainer_1dmfp_16",t3e="_modalTitle_1dmfp_29",a3e="_modalInput_1dmfp_38",n3e="_modalTextarea_1dmfp_39",o3e="_modalActions_1dmfp_71",c3e="_cancelBtn_1dmfp_78",i3e="_saveBtn_1dmfp_100",r3e="_inputError_1dmfp_148",s3e="_inlineAlert_1dmfp_153",Xe={modalOverlay:Qke,modalContainer:e3e,modalTitle:t3e,modalInput:a3e,modalTextarea:n3e,modalActions:o3e,cancelBtn:c3e,saveBtn:i3e,inputError:r3e,inlineAlert:s3e},qc=({isOpen:e,onClose:t,onSave:n,title:c="Ajouter un élément",fields:i,initialValues:r={},errorMessage:s="",disableSave:d,onFieldChange:l,confirmText:h="Valider",cancelText:u="Annuler"})=>{const[p,y]=k.useState({}),m=k.useRef(null),[g,f]=k.useState(!1),[M,_]=k.useState(!1),v=k.useRef(null);if(k.useEffect(()=>{if(!e)return;const x={};for(const I of i)x[I.name]=Object.prototype.hasOwnProperty.call(r,I.name)?r[I.name]:"";return y(x),requestAnimationFrame(()=>{m.current?.focus();const I=m.current;if(I&&typeof I.selectionStart=="number"){const S=String(I.value??"").length;I.setSelectionRange(S,S)}}),()=>{v.current&&(window.clearTimeout(v.current),v.current=null)}},[e]),k.useEffect(()=>{s&&e?(_(!0),v.current&&(window.clearTimeout(v.current),v.current=null),v.current=window.setTimeout(()=>{_(!1),v.current=null},3e3)):(_(!1),v.current&&(window.clearTimeout(v.current),v.current=null))},[s,e]),!e)return null;const L=(x,I)=>{y(S=>({...S,[x]:I})),l&&l(x,I)},w=async()=>{if(!Object.values(p).some(x=>x===""||x===void 0))try{f(!0);const x=await n(p);if(typeof x=="string"&&x==="duplicate-same"){f(!1);return}y({}),f(!1),t()}catch(x){console.error("AddItemModal onSave error:",x),f(!1),t()}},C=x=>{x.target===x.currentTarget&&t()},b=x=>x.stopPropagation();return o.jsx("div",{className:Xe.modalOverlay,onMouseDown:C,role:"dialog","aria-modal":"true",children:o.jsxs("div",{className:Xe.modalContainer,onMouseDown:b,onClick:b,children:[o.jsx("h2",{className:Xe.modalTitle,children:c}),i.map((x,I)=>{const S=p[x.name]??"",j=I===0&&!!s,$={name:x.name,placeholder:x.placeholder||x.label,value:String(S),onChange:q=>L(x.name,q.target.value),className:x.type==="textarea"?`${Xe.modalTextarea} ${j?Xe.inputError:""}`:`${Xe.modalInput} ${j?Xe.inputError:""}`,tabIndex:0,disabled:g};return I===0&&($.ref=q=>{m.current=q}),o.jsxs("div",{style:{marginBottom:8},children:[x.type==="textarea"?o.jsx("textarea",{rows:x.rows||4,...$}):o.jsx("input",{type:x.type||"text",...$}),I===0&&M&&s&&o.jsx("div",{style:{marginTop:8},children:o.jsx(Kw,{text:s,background:"#fff5f5",colorTextPrimary:"#ef4444",onClose:()=>_(!1),className:Xe.inlineAlert})})]},x.name)}),o.jsxs("div",{className:Xe.modalActions,children:[o.jsx("button",{className:Xe.cancelBtn,onClick:t,type:"button",disabled:g,children:u}),o.jsx("button",{className:Xe.saveBtn,onClick:w,type:"button",disabled:g||!!d,children:g?"En cours...":h})]})]})})},d3e=({title:e,keyCount:t,onAddKey:n,a11yConfig:c})=>{const[i,r]=k.useState(!1),s=d=>{const l=d.key;n&&l&&n(l)};return o.jsxs("div",{className:"header-container",children:[o.jsxs("div",{className:"header-info",children:[o.jsx("h1",{title:Y(c,e),children:e}),o.jsxs("p",{children:[t," clés"]})]}),o.jsxs("button",{onClick:()=>r(!0),className:"add-key-button",children:[o.jsx(Jc,{className:"add-key-icon"}),"Clé"]}),o.jsx(qc,{isOpen:i,title:"Ajouter une clé",onClose:()=>r(!1),onSave:s,fields:[{name:"key",label:"Nouvelle clé",placeholder:"Entrer une nouvelle clé"}]})]})},l3e=({modules:e,onEdit:t,onDelete:n,onAddModule:c,onSelectModule:i,addModalFields:r,addModalTitle:s})=>{const[d,l]=k.useState(!1),[h,u]=k.useState(null),[p,y]=k.useState(null),[m,g]=k.useState(!1),f=()=>l(!0),M=()=>l(!1),_=x=>{if(c){const I=x.code?.trim()||x.id?.trim(),S=x.title?.trim(),j=I||S||String(Date.now()),$=S||I||`Module ${j}`;c({id:j,title:$,subtitle:"",translations:{}})}M()},v=(x,I)=>{x.stopPropagation(),u(I)},L=()=>u(null),w=x=>{if(!h){L();return}const I={...h,title:x.title||h.title,subtitle:""};t&&t(I),L()},C=(x,I)=>{x.stopPropagation(),n&&n(I)},b=x=>{y(x.id),i&&i(x)};return m?o.jsx("div",{className:"module-sidebar collapsed",children:o.jsx(Xc,{size:20,className:"menu-toggle",onClick:()=>g(!1)})}):o.jsxs("div",{className:"module-sidebar",children:[o.jsxs("div",{className:"sidebar-header",children:[o.jsxs("span",{className:"header-text",children:["Modules (",e.length,")"]}),o.jsxs("div",{className:"header-actions",children:[o.jsx(Zc,{size:18,className:"header-folder",onClick:f}),o.jsx(Xc,{size:18,className:"header-menu",onClick:()=>g(!0)})]})]}),o.jsx("hr",{className:"divider"}),o.jsx("div",{className:"module-list",children:e.map(x=>{const I=Object.keys(x.translations||{}).length,S=I>0||x.id===p;return o.jsxs("div",{className:`module-item ${x.id===p?"selected":""}`,onClick:()=>b(x),role:"button",tabIndex:0,onKeyDown:j=>{j.key==="Enter"&&b(x)},children:[o.jsxs("div",{className:"module-left",children:[o.jsx(b1,{size:16,className:"item-folder"}),o.jsxs("div",{className:"module-info",children:[o.jsxs("div",{className:"module-title",children:[x.title,S&&o.jsxs("span",{className:"count",children:[" ",I," "]})]}),x.subtitle?o.jsx("div",{className:"module-subtitle",children:x.subtitle}):null]})]}),o.jsxs("div",{className:"module-actions",children:[t&&o.jsx(Yc,{onClick:j=>v(j,x),color:"#777",size:16}),n&&o.jsx(yt,{onClick:j=>C(j,x.id),color:"#777",size:16})]})]},x.id)})}),o.jsx(qc,{isOpen:d,onClose:M,onSave:_,title:s||"Ajouter un module",fields:r&&r.length?r.map(x=>({name:x.name,label:x.label,type:x.type,placeholder:x.placeholder,rows:x.rows})):[{name:"title",label:"Titre",placeholder:"Titre du module"}]}),h&&o.jsx(qc,{isOpen:!!h,onClose:L,onSave:w,title:"Éditer le module",initialValues:{title:h.title},fields:[{name:"title",label:"Titre",placeholder:"Titre du module"}]})]})},Xq=({placeholder:e="Rechercher une clé ou traduction...",value:t="",onChange:n,iconPosition:c="left",iconColor:i="#9ca3af",a11yConfig:r,className:s})=>o.jsxs("div",{className:`search-container icon-${c}`,title:Y(r,e),children:[o.jsx("div",{className:"search-icon-wrapper",children:o.jsx(N1,{className:"search-icon",color:i})}),o.jsx("input",{type:"text",placeholder:e,value:t,onChange:d=>n?.(d.target.value),className:`search-input ${s}`})]}),h3e=({keyName:e,translations:t,availableLanguages:n,onDeleteKey:c,onEditKey:i,onEditTranslation:r,onDeleteTranslation:s,onAddTranslation:d,draggable:l=!1,checkDuplicateLocal:h})=>{const[u,p]=k.useState(!1),[y,m]=k.useState(""),[g,f]=k.useState(null),[M,_]=k.useState(""),[v,L]=k.useState(""),[w,C]=k.useState(!1),[b,x]=k.useState(!1),[I,S]=k.useState(null),[j,$]=k.useState(!1),q=t.map(T=>T.language),H=n.filter(T=>!q.includes(T.code)),D=()=>{y&&v.trim()&&(d?.(e,y,v.trim()),m(""),L(""),p(!1))},z=(T,E)=>{f(T),_(E)},N=T=>{r?.(e,T,M),f(null),_("")},A=()=>{f(null),_("")},R=async T=>{const E=T.name?.trim();if(E){if(S(null),$(!1),E===e||!i)return C(!1),"ok";try{const X=await i(e,E);if(typeof X=="string"&&X==="ok")C(!1),S(null);else{if(typeof X=="string"&&X==="duplicate-same")return S("Une clé existe déjà dans ce module."),$(!0),"duplicate-same";if(typeof X=="string"&&X==="duplicate-other")return C(!1),S(null),"duplicate-other";C(!1)}}catch(X){console.error("Erreur handleRenameSave:",X),S("Erreur lors du renommage.")}}},P=(T,E)=>{if(T!=="name")return;const X=E.trim();S(null),$(!1),X&&typeof h=="function"&&(h(X,e)?(S("Une clé existe déjà dans ce module."),$(!0)):(S(null),$(!1)))};return o.jsxs("div",{className:`translation-key ${b?"collapsed":"expanded"} ${l?"draggable":""}`,children:[o.jsxs("div",{className:"card-header",children:[o.jsxs("div",{className:"header-left",children:[o.jsx("button",{className:"collapse-button",onClick:()=>x(!b),title:b?"Déplier":"Replier",children:b?o.jsx(x1,{className:"collapse-icon"}):o.jsx(qt,{className:"collapse-icon"})}),o.jsx("h3",{className:"card-title",title:e,children:e})]}),o.jsxs("div",{className:"header-actions",children:[o.jsx("button",{className:"action-button",onClick:T=>{T.stopPropagation(),C(!0)},title:"Renommer la clé",children:o.jsx(ut,{className:"action-icon"})}),o.jsx("button",{onClick:T=>{T.stopPropagation(),c?.(e)},className:"action-button delete",title:"Supprimer la clé",children:o.jsx(yt,{className:"action-icon"})})]})]}),o.jsx("div",{className:`translations-container ${b?"":"expanded"}`,children:!l&&o.jsxs(o.Fragment,{children:[t.map(T=>o.jsxs("div",{className:"translation-row",children:[o.jsx("div",{className:"language-code",children:T.language}),o.jsx("div",{className:"translation-content",children:g===T.language?o.jsxs(o.Fragment,{children:[o.jsx("input",{type:"text",value:M,onChange:E=>_(E.target.value),className:"edit-input",autoFocus:!0,onKeyDown:E=>{E.key==="Enter"&&N(T.language),E.key==="Escape"&&A()}}),o.jsx("button",{onClick:()=>N(T.language),className:"save-button",disabled:!M.trim(),children:"Enregistrer"}),o.jsx("button",{onClick:A,className:"cancel-button",children:o.jsx(Ge,{className:"action-icon"})})]}):o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"translation-text",title:T.value,children:T.value}),o.jsx("button",{onClick:()=>z(T.language,T.value),className:"edit-button",title:"Éditer la traduction",children:o.jsx(ut,{className:"action-icon"})}),o.jsx("button",{onClick:()=>s?.(e,T.language),className:"delete-translation-button",title:"Supprimer la traduction",children:o.jsx(Ge,{className:"action-icon"})})]})})]},T.language)),u?o.jsxs("div",{className:"add-language-row",children:[o.jsx("div",{className:"language-code",children:"+"}),o.jsxs("div",{className:"add-language-content",children:[o.jsx("div",{className:"language-select-container",children:o.jsxs("select",{value:y,onChange:T=>m(T.target.value),className:"language-select",children:[o.jsx("option",{value:"",children:"Sélectionnez la langue"}),H.map(T=>o.jsxs("option",{value:T.code,children:[T.name," (",T.code,")"]},T.code))]})}),y&&o.jsx("input",{type:"text",value:v,onChange:T=>L(T.target.value),placeholder:"Entrez la traduction...",className:"translation-input",onKeyDown:T=>{T.key==="Enter"&&D(),T.key==="Escape"&&(p(!1),m(""),L(""))}}),o.jsx("button",{onClick:D,disabled:!y||!v.trim(),className:"save-button",children:"Ajouter"}),o.jsx("button",{onClick:()=>{p(!1),m(""),L("")},className:"cancel-button",children:o.jsx(Ge,{className:"action-icon"})})]})]}):o.jsxs("button",{onClick:()=>p(!0),className:"show-add-button",disabled:H.length===0,children:[o.jsx("span",{className:"plus-icon",children:"+"}),"Ajouter une langue"]})]})}),l&&o.jsxs("div",{className:"drag-overlay",children:[o.jsx(a.Move,{size:24,strokeWidth:1.5}),o.jsx("span",{children:"Glisser pour réorganiser"})]}),o.jsx(qc,{isOpen:w,onClose:()=>{C(!1),S(null),$(!1)},onSave:R,onFieldChange:P,title:"Renommer la clé",initialValues:{name:e},fields:[{name:"name",label:"Nom de la clé",placeholder:"Nom de la clé"}],errorMessage:I||"",disableSave:j})]})},u3e="_wrapper_1wvht_1",p3e="_leftGroup_1wvht_12",y3e="_filterButton_1wvht_21",k3e="_open_1wvht_42",m3e="_filterIcon_1wvht_42",f3e="_infoText_1wvht_58",g3e="_pickerContainer_1wvht_66",v3e="_srOnly_1wvht_79",M3e="_pickerLabel_1wvht_91",_3e="_datetime_1wvht_98",x3e="_rightGroup_1wvht_107",L3e="_searchInputWrap_1wvht_116",I3e="_searchInput_1wvht_116",b3e="_searchIcon_1wvht_152",Ve={wrapper:u3e,leftGroup:p3e,filterButton:y3e,open:k3e,filterIcon:m3e,infoText:f3e,pickerContainer:g3e,srOnly:v3e,pickerLabel:M3e,datetime:_3e,rightGroup:x3e,searchInputWrap:L3e,searchInput:I3e,searchIcon:b3e};function w3e({onDateChange:e,onSearch:t,initialDate:n}){const[c,i]=k.useState(!1),[r,s]=k.useState(n??""),d=k.useRef(null);k.useEffect(()=>{function p(y){const m=y.target;d.current&&m&&!d.current.contains(m)&&i(!1)}return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[]),k.useEffect(()=>{n&&s(n)},[n]);const l=()=>i(p=>!p),h=p=>{const y=p.target.value;s(y),e?.(y)},u=p=>{t?.(p.target.value)};return o.jsxs("div",{className:Ve.wrapper,ref:d,children:[o.jsxs("div",{className:Ve.leftGroup,children:[o.jsxs("button",{type:"button",className:`${Ve.filterButton} ${c?Ve.open:""}`,onClick:l,"aria-expanded":c,"aria-haspopup":"dialog","aria-controls":"entry-datetime",children:[o.jsx("span",{children:"Entry time"}),o.jsx("svg",{className:Ve.filterIcon,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":!0,children:o.jsx("path",{fill:"currentColor",d:"M10 18h4v-2h-4v2zm-7-8v2h18V10H3zm3-6v2h12V4H6z"})})]}),o.jsx("div",{className:Ve.infoText,children:"Confidence interval: step ± 15' / exit ± 30'"}),c&&o.jsxs("div",{className:Ve.pickerContainer,role:"dialog","aria-label":"Choisir la date et l’heure",children:[o.jsx("label",{className:Ve.pickerLabel,htmlFor:"entry-datetime",children:o.jsx("span",{className:Ve.srOnly,children:"Choisir la date et l’heure"})}),o.jsx("input",{id:"entry-datetime",className:Ve.datetime,type:"datetime-local",value:r,onChange:h,"aria-label":"Date et heure d’entrée"})]})]}),o.jsx("div",{className:Ve.rightGroup,children:o.jsxs("div",{className:Ve.searchInputWrap,children:[o.jsx("input",{className:Ve.searchInput,placeholder:"Search...",onChange:u,"aria-label":"Search"}),o.jsx("svg",{className:Ve.searchIcon,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"16",height:"16","aria-hidden":!0,children:o.jsx("path",{fill:"currentColor",d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16a6.471 6.471 0 004.23-1.57l.27.28v.79L20 20.49 21.49 19l-5.99-5zM10 15.5A5.5 5.5 0 1115.5 10 5.5 5.5 0 0110 15.5z"})})]})})]})}const C3e=({className:e="",style:t={},title:n,titleClassName:c="",titleStyle:i,data:r,lineClasses:s={},renderCell:d,bg:l,titleBg:h,titleColor:u,itemBg:p,emptyContent:y,colGap:m="1rem"})=>{const g=Array.isArray(r)?r:[],f=g.length===0,M=g.every(w=>typeof w=="string"),_=g.some(w=>Array.isArray(w)),v=(w,C,b)=>d?d(w,C,b):o.jsx("span",{className:"slb-cell-text",children:w}),L=m?{"--col-gap":m}:void 0;return f?o.jsxs("div",{className:`slb-root ${e}`,style:{...t,background:l??void 0},children:[n&&o.jsx("div",{className:`slb-title ${c}`,style:{...i,background:h??void 0,color:u??void 0},children:n}),o.jsx("div",{className:"slb-empty",children:y??null})]}):M&&!_?o.jsxs("div",{className:`slb-root ${e}`,style:{...t,background:l??void 0},children:[n&&o.jsx("div",{className:`slb-title ${c}`,style:{background:h??void 0,color:u??void 0},children:n}),o.jsx("ul",{className:"slb-list",children:g.map((w,C)=>o.jsx("li",{className:`slb-item ${s[C]||""}`,style:{background:p??void 0},children:v(w,C,0)},C))})]}):o.jsxs("div",{className:`slb-root ${e}`,style:{...t,background:l??void 0},children:[n&&o.jsx("div",{className:`slb-title ${c}`,style:{background:h??void 0,color:u??void 0},children:n}),o.jsx("div",{className:"slb-grid",style:L,children:g.map((w,C)=>{const b=s[C]||"";if(Array.isArray(w)){const[x,I]=w;return o.jsxs("div",{className:`slb-row ${b}`,style:{background:p??void 0},children:[o.jsx("div",{className:"slb-grid-left",children:v(x,C,0)}),o.jsx("div",{className:"slb-grid-right",children:v(I,C,1)})]},C)}return o.jsxs("div",{className:`slb-row ${b}`,style:{background:p??void 0},children:[o.jsx("div",{className:"slb-grid-left",children:v(w,C,0)}),o.jsx("div",{className:"slb-grid-right slb-empty-cell","aria-hidden":"true"})]},C)})})]})},N3e=({className:e="",style:t={},title:n,titleColor:c,data:i=[],badgeColor:r="#0ea5e9",badgeColors:s={},badgePadding:d="8px 16px",badgeWidth:l,itemBg:h,lineClasses:u={},colGap:p="1rem"})=>{const y=i.some(g=>Array.isArray(g)),m=p?{"--col-gap":p}:void 0;return o.jsxs("div",{className:`clb-root ${e}`,style:{...t},children:[n&&o.jsx("div",{className:"clb-title",style:c?{color:c}:void 0,children:n}),o.jsx("div",{className:"clb-grid",style:m,children:i.map((g,f)=>{const M=u[f]||"";if(Array.isArray(g)){const[_,v]=g,L=s[f]||r;return o.jsxs("div",{className:`clb-row ${M}`,style:{background:h??void 0},children:[o.jsx("div",{className:"clb-badge-col",children:o.jsx("div",{className:"counter-badge",style:{background:L,padding:d,width:l,minWidth:l},children:_})}),o.jsx("div",{className:"clb-text",children:v})]},f)}return y?o.jsxs("div",{className:`clb-row ${M}`,style:{background:h??void 0},children:[o.jsx("div",{className:"clb-badge-col clb-empty-badge"}),o.jsx("div",{className:"clb-text",children:g})]},f):o.jsx("div",{className:`clb-fullrow ${M}`,style:{background:h??void 0},children:o.jsx("span",{children:g})},f)})})]})},j3e=({className:e="",style:t={},title:n,items:c=[],titleBg:i,titleColor:r,itemBg:s,lineClasses:d={},renderTrendIcon:l,colGap:h="1rem"})=>{const u=h?{"--col-gap":h}:void 0;return o.jsxs("div",{className:`tlb-root ${e}`,style:{...t,background:s??void 0},children:[n&&o.jsx("div",{className:"tlb-title",style:{background:i??void 0,color:r??void 0},children:n}),o.jsx("div",{className:"tlb-grid",style:u,children:c.map((p,y)=>{const m=d[y]||"";return o.jsxs("div",{className:`tlb-row ${m}`,style:{background:s??void 0},children:[o.jsx("div",{className:"tlb-label",children:p.label}),o.jsxs("div",{className:"tlb-value-group",children:[o.jsx("div",{className:"tlb-icon-col",children:l?l(p):p.icon??null}),o.jsxs("div",{className:"tlb-value-wrap",children:[o.jsx("div",{className:"tlb-value",children:p.value}),typeof p.delta<"u"&&o.jsx("div",{className:`tlb-delta ${p.delta>0?"positive":p.delta<0?"negative":"neutral"}`,children:p.deltaLabel??String(p.delta)})]})]})]},y)})})]})},S3e=({className:e="",style:t={},children:n,gap:c="1rem"})=>o.jsx("div",{className:`frc-root ${e}`,style:{...t,"--frc-gap":c},children:k.Children.map(n,i=>o.jsx("div",{className:"frc-item",children:i}))}),$3e=({className:e="",style:t={},children:n,gap:c="1rem",background:i="#D9EEF5"})=>o.jsx("div",{className:`lcc-root ${e}`,style:{background:i,...t,"--lcc-gap":c},children:k.Children.map(n,r=>o.jsx("div",{className:"lcc-cell",children:r}))}),q3e="_overlay_i1ay5_2",A3e="_fadeIn_i1ay5_1",z3e="_popup_i1ay5_17",V3e="_slideUp_i1ay5_1",P3e="_header_i1ay5_28",T3e="_body_i1ay5_40",H3e="_footer_i1ay5_51",D3e="_cancelButton_i1ay5_59",B3e="_confirmButton_i1ay5_77",R3e="_warning_i1ay5_97",F3e="_danger_i1ay5_106",E3e="_info_i1ay5_115",xt={overlay:q3e,fadeIn:A3e,popup:z3e,slideUp:V3e,header:P3e,body:T3e,footer:H3e,cancelButton:D3e,confirmButton:B3e,warning:R3e,danger:F3e,info:E3e},O3e=({isOpen:e,title:t,message:n,onConfirm:c,onCancel:i,confirmText:r="Confirmer",cancelText:s="Annuler",type:d="warning"})=>{if(!e)return null;const l=u=>{u.target===u.currentTarget&&i()},h=u=>{u.key==="Escape"&&i(),u.key==="Enter"&&u.ctrlKey&&c()};return o.jsx("div",{className:xt.overlay,onClick:l,onKeyDown:h,role:"dialog","aria-labelledby":"confirmation-title","aria-describedby":"confirmation-message",children:o.jsxs("div",{className:`${xt.popup} ${xt[d]}`,children:[o.jsx("div",{className:xt.header,children:o.jsx("h3",{id:"confirmation-title",children:t})}),o.jsx("div",{className:xt.body,children:o.jsx("p",{id:"confirmation-message",children:n})}),o.jsxs("div",{className:xt.footer,children:[o.jsx("button",{className:xt.cancelButton,onClick:i,type:"button",children:s}),o.jsx("button",{className:xt.confirmButton,onClick:c,type:"button",autoFocus:!0,children:r})]})]})})},U3e=()=>{const[e,t]=k.useState({isOpen:!1,title:"",message:"",onConfirm:null}),n=k.useCallback((r,s,d)=>{t({isOpen:!0,title:r,message:s,onConfirm:d})},[]),c=k.useCallback(()=>{t(r=>({...r,isOpen:!1,onConfirm:null}))},[]),i=k.useCallback(()=>{e.onConfirm?.(),c()},[e.onConfirm,c]);return{isOpen:e.isOpen,title:e.title,message:e.message,showConfirmation:n,hideConfirmation:c,handleConfirm:i}},W3e="_container_v7v52_1",G3e="_selectButton_v7v52_6",K3e="_disabled_v7v52_19",Z3e="_error_v7v52_29",X3e="_outline_v7v52_43",Y3e="_filled_v7v52_53",J3e="_sm_v7v52_58",Q3e="_md_v7v52_63",eme="_lg_v7v52_68",tme="_buttonContent_v7v52_73",ame="_label_v7v52_80",nme="_placeholder_v7v52_87",ome="_iconsContainer_v7v52_91",cme="_loadingSpinner_v7v52_99",ime="_spin_v7v52_1",rme="_arrowIcon_v7v52_119",sme="_arrowIconOpen_v7v52_127",dme="_dropdown_v7v52_131",lme="_searchContainer_v7v52_146",hme="_searchInput_v7v52_150",ume="_optionsList_v7v52_173",pme="_noResults_v7v52_195",yme="_option_v7v52_173",kme="_optionHighlighted_v7v52_217",mme="_optionSelected_v7v52_222",fme="_optionDisabled_v7v52_228",gme="_optionLabel_v7v52_233",vme="_checkIcon_v7v52_240",Mme="_widthFull_v7v52_248",_me="_width64_v7v52_252",xme="_width80_v7v52_256",Lme="_width96_v7v52_260",ie={container:W3e,selectButton:G3e,disabled:K3e,error:Z3e,default:"_default_v7v52_38",outline:X3e,filled:Y3e,sm:J3e,md:Q3e,lg:eme,buttonContent:tme,label:ame,placeholder:nme,iconsContainer:ome,loadingSpinner:cme,spin:ime,arrowIcon:rme,arrowIconOpen:sme,dropdown:dme,searchContainer:lme,searchInput:hme,optionsList:ume,noResults:pme,option:yme,optionHighlighted:kme,optionSelected:mme,optionDisabled:fme,optionLabel:gme,checkIcon:vme,widthFull:Mme,width64:_me,width80:xme,width96:Lme},Ime=({options:e,value:t,onChange:n,placeholder:c="Sélectionner une option...",disabled:i=!1,loading:r=!1,error:s=!1,className:d="",size:l="md",variant:h="default",width:u="w-full"})=>{const[p,y]=k.useState(!1),[m,g]=k.useState(""),[f,M]=k.useState(0),[_,v]=k.useState({top:0,left:0,width:0}),L=k.useRef(null),w=k.useRef(null),C=k.useRef(null),b=k.useMemo(()=>m?e.filter(N=>N.label.toLowerCase().includes(m.toLowerCase())):e,[e,m]),x=e.find(N=>N.value===t),I=k.useCallback(()=>{if(L.current){const N=L.current.getBoundingClientRect();v({top:N.top,left:N.left,width:N.width})}},[]);k.useEffect(()=>(p&&(I(),window.addEventListener("scroll",I,!0),window.addEventListener("resize",I)),()=>{window.removeEventListener("scroll",I,!0),window.removeEventListener("resize",I)}),[p,I]),k.useEffect(()=>{const N=A=>{L.current&&!L.current.contains(A.target)&&w.current&&!w.current.contains(A.target)&&(y(!1),g(""))};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[]),k.useEffect(()=>{M(0)},[b]);const S=N=>{N.disabled||(n?.(N.value,N),y(!1),g(""))},j=N=>{g(N.target.value),p||y(!0)},$=N=>{if(!p){(N.key==="ArrowDown"||N.key==="Enter")&&y(!0);return}switch(N.key){case"ArrowDown":N.preventDefault(),M(A=>A<b.length-1?A+1:A);break;case"ArrowUp":N.preventDefault(),M(A=>A>0?A-1:A);break;case"Enter":N.preventDefault(),b[f]&&S(b[f]);break;case"Escape":y(!1),g("");break}},q=()=>[ie.selectButton,ie[l],ie[h],i?ie.disabled:"",s?ie.error:"",d].filter(Boolean).join(" "),H=()=>{switch(u){case"w-64":return ie.width64;case"w-80":return ie.width80;case"w-96":return ie.width96;default:return ie.widthFull}},D=(N,A)=>[ie.option,A===f?ie.optionHighlighted:"",N.value===t?ie.optionSelected:"",N.disabled?ie.optionDisabled:""].filter(Boolean).join(" "),z={position:"fixed",top:_.top+(L.current?.offsetHeight||0)+4,left:_.left,width:_.width,zIndex:9999};return o.jsxs("div",{className:`${ie.container} ${H()}`,children:[o.jsx("button",{ref:L,className:q(),onClick:()=>!i&&y(!p),onKeyDown:$,tabIndex:i?-1:0,type:"button","aria-haspopup":"listbox","aria-expanded":p,disabled:i,children:o.jsxs("div",{className:ie.buttonContent,children:[o.jsx("span",{className:`${ie.label} ${x?"":ie.placeholder}`,children:x?x.label:c}),o.jsxs("div",{className:ie.iconsContainer,children:[r&&o.jsx("div",{className:ie.loadingSpinner}),o.jsx("svg",{className:`${ie.arrowIcon} ${p?ie.arrowIconOpen:""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]})}),p&&dw.createPortal(o.jsxs("div",{className:`${ie.dropdown} ${H()}`,style:z,ref:w,children:[o.jsx("div",{className:ie.searchContainer,children:o.jsx("input",{ref:C,type:"text",value:m,onChange:j,placeholder:"Rechercher...",className:ie.searchInput,autoFocus:!0})}),o.jsx("div",{className:ie.optionsList,children:b.length===0?o.jsx("div",{className:ie.noResults,children:"Aucun résultat trouvé"}):o.jsx("ul",{role:"listbox",children:b.map((N,A)=>o.jsx("li",{className:D(N,A),onClick:()=>S(N),onMouseEnter:()=>M(A),role:"option","aria-selected":N.value===t,"aria-disabled":N.disabled,children:o.jsxs("div",{className:ie.buttonContent,children:[o.jsx("span",{className:ie.optionLabel,title:N.label,children:N.label}),N.value===t&&o.jsx("svg",{className:ie.checkIcon,fill:"currentColor",viewBox:"0 0 20 20",children:o.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})]})},N.value))})})]}),document.body)]})},bme="_container_uq7pt_1",wme="_item_uq7pt_7",Cme="_mainValue_uq7pt_13",Nme="_label_uq7pt_17",jme="_subValue_uq7pt_22",Sme="_subValueWrapper_uq7pt_27",$me="_subSeparator_uq7pt_32",Ee={container:bme,item:wme,mainValue:Cme,label:Nme,subValue:jme,subValueWrapper:Sme,subSeparator:$me},qme=({dms:e,stats:t=[],itemWidth:n="120px",valueFontSize:c="28px",valueFontWeight:i=700,subFontSize:r="16px",subFontWeight:s=600,backgroundColor:d="#ffffff",labelColor:l="#6b7280",valueColor:h="#000000"})=>{const u=(p,y,m)=>{const[g,f]=p.split("/").map(M=>M.trim());return o.jsxs("span",{className:Ee.subValueWrapper,children:[o.jsx("span",{className:Ee.subLeft,style:{color:y},children:g}),o.jsx("span",{className:Ee.subSeparator,children:" / "}),o.jsx("span",{className:Ee.subRight,style:{color:m},children:f})]})};return o.jsxs("div",{className:Ee.container,style:{backgroundColor:d},children:[e&&o.jsxs("div",{className:Ee.item,style:{flex:`1 1 ${n}`},children:[o.jsx("div",{className:Ee.mainValue,style:{fontSize:c,fontWeight:i,color:h},children:e}),o.jsx("div",{className:Ee.label,style:{color:l},children:"DMS"})]}),t.map((p,y)=>o.jsxs("div",{className:Ee.item,style:{flex:`1 1 ${n}`},children:[o.jsx("div",{className:Ee.mainValue,style:{fontSize:c,fontWeight:i,color:h},children:p.value}),o.jsx("div",{className:Ee.label,style:{color:l},children:p.label}),o.jsx("div",{className:Ee.subValue,style:{fontSize:r,fontWeight:s},children:p.subValue&&u(p.subValue,p.subLeftColor,p.subRightColor)})]},y))]})},Ame="_encours_16ist_1",zme="_header_16ist_19",Vme="_iconWrap_16ist_27",Pme="_title_16ist_36",Tme="_items_16ist_47",Hme="_spaceEvenly_16ist_56",Dme="_item_16ist_47",Bme="_valueContainer_16ist_86",Rme="_value_16ist_86",Fme="_label_16ist_108",nt={encours:Ame,header:zme,iconWrap:Vme,title:Pme,items:Tme,spaceEvenly:Hme,item:Dme,valueContainer:Bme,value:Rme,label:Fme},Cc=e=>typeof e=="number"?`${e}px`:typeof e=="string"?e:void 0;function Eme(e,t){const n={},c={};return e.valueColor&&(n.color=e.valueColor),e.valueFontSize!==void 0?n.fontSize=Cc(e.valueFontSize):t.defaultValueFontSize!==void 0&&(n.fontSize=Cc(t.defaultValueFontSize)),e.valueFontWeight!==void 0?n.fontWeight=e.valueFontWeight:t.defaultValueFontWeight!==void 0&&(n.fontWeight=t.defaultValueFontWeight),e.labelColor&&(c.color=e.labelColor),e.labelFontSize!==void 0?c.fontSize=Cc(e.labelFontSize):t.defaultLabelFontSize!==void 0&&(c.fontSize=Cc(t.defaultLabelFontSize)),e.labelFontWeight!==void 0?c.fontWeight=e.labelFontWeight:t.defaultLabelFontWeight!==void 0&&(c.fontWeight=t.defaultLabelFontWeight),{valueStyle:n,labelStyle:c}}function Ome(){return o.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[o.jsx("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"1.4"}),o.jsx("path",{d:"M8 12h8",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})}function Ume(e){const{title:t,titleColor:n,titleFontSize:c,titleFontWeight:i,icon:r,iconSize:s=18,iconColor:d,defaultValueFontSize:l,defaultValueFontWeight:h,defaultLabelFontSize:u,defaultLabelFontWeight:p,data:y,style:m,bg:g="#ffffff",width:f,gap:M,className:_,ariaLabel:v}=e,L=r?kt[r]:void 0,w={background:g,width:Cc(f),...m},C={};n&&(C.color=n),c!==void 0&&(C.fontSize=Cc(c)),i!==void 0&&(C.fontWeight=i);const b={};return d&&(b.color=d),o.jsxs("section",{className:`${nt.encours} ${_??""}`,style:w,"aria-label":v??t,children:[o.jsxs("div",{className:nt.header,children:[o.jsx("div",{className:nt.iconWrap,"aria-hidden":!0,style:b,children:L?o.jsx(L,{size:typeof s=="number"?s:void 0}):o.jsx(Ome,{})}),o.jsx("div",{className:nt.title,style:C,children:t})]}),o.jsx("div",{className:`${nt.items} ${M===void 0?nt.spaceEvenly:""}`,role:"list",style:M!==void 0?{gap:`${M}px`}:{},children:y.map((x,I)=>{const{valueStyle:S,labelStyle:j}=Eme(x,{defaultValueFontSize:l,defaultValueFontWeight:h,defaultLabelFontSize:u,defaultLabelFontWeight:p});return o.jsx("div",{className:nt.item,role:"listitem",style:{...x.background?{background:x.background}:{},...x.width?{width:Cc(x.width)}:{}},children:o.jsxs("div",{className:nt.valueContainer,children:[o.jsx("div",{className:nt.value,style:S,children:x.value}),x.label&&o.jsx("div",{className:nt.label,style:j,children:x.label})]})},`${String(x.label??x.value)}-${I}`)})})]})}const Wme=e=>Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 -960 960 960",...e},Z.createElement("path",{d:"M480-360 280-559h400z"})),Gme=k.memo(Wme),Kme=e=>Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 -960 960 960",...e},Z.createElement("path",{d:"m280-400 200-201 200 201z"})),Zme=k.memo(Kme),Xme=e=>Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 16 16",...e},Z.createElement("path",{fill:"#0087BD",d:"M3 14a.96.96 0 0 1-.7-.3.96.96 0 0 1-.3-.7V3q0-.4.3-.7T3 2h10q.4 0 .7.3t.3.7v10q0 .4-.3.7t-.7.3zm3.983-3.55q.1 0 .192-.033a.36.36 0 0 0 .158-.117l4.117-4.133q.15-.15.15-.35a.54.54 0 0 0-.15-.367.52.52 0 0 0-.358-.133.5.5 0 0 0-.359.15l-3.75 3.75L5.35 7.583a.48.48 0 0 0-.7 0q-.15.15-.15.367 0 .216.15.35l1.983 2a.48.48 0 0 0 .35.15"})),Yme=k.memo(Xme),Jme=e=>Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 16 16",...e},Z.createElement("path",{fill:"#1E2122",d:"M3 14a.96.96 0 0 1-.7-.3.96.96 0 0 1-.3-.7V3q0-.4.3-.7T3 2h10q.4 0 .7.3t.3.7v10q0 .4-.3.7t-.7.3zm0-1h10V3H3z"})),Qme=k.memo(Jme),e6e=({items:e,onSave:t,loading:n,disabled:c,saveLabel:i,savingLabel:r,buttonTitle:s,size:d=16,colors:l={bg:"#DADADA",activeBg:"var(--color-primary)",circle:"#FFFFFF",icon:"#1C1B1F",icon2:"#FFFFFF"},style:h,a11yConfig:u})=>{const[p,y]=k.useState(!1),[m,g]=k.useState(e),[f,M]=k.useState(!1);if(k.useEffect(()=>{M(!0)},[]),k.useEffect(()=>{g(e)},[e]),!f)return null;const _=(w,C)=>{C<4||g(b=>b.map(x=>x.component_key===w?{...x,visible:!x.visible}:x))},v=()=>{t(m),y(!1)},L=Y(u,s);return o.jsxs("div",{style:{position:"relative",display:"inline-block",...h},children:[o.jsxs("div",{onClick:()=>{c||y(!p)},style:{display:"flex",alignItems:"center",cursor:c?"not-allowed":"pointer",borderRadius:4,transition:"background 0.2s"},title:L,children:[o.jsx($S,{width:d,height:d,fill:l?.icon||"currentColor",style:{transition:"color 0.2s"}}),p?o.jsx(Zme,{width:d,height:d,fill:l?.icon||"currentColor"}):o.jsx(Gme,{width:d,height:d,fill:l?.icon||"currentColor"})]}),p&&o.jsxs("div",{style:{position:"absolute",top:"120%",right:0,minWidth:260,background:"#fff",borderRadius:"0.25rem",boxShadow:"0px 3px 7px 0px rgba(17, 20, 21, 0.05),0px 14px 14px 0px rgba(17, 20, 21, 0.04),0px 30px 18px 0px rgba(17, 20, 21, 0.03), 0px 54px 22px 0px rgba(17, 20, 21, 0.01),0px 85px 24px 0px rgba(17, 20, 21, 0)",zIndex:235465456,padding:"0 0 0.5rem 0"},children:[o.jsx("ul",{style:{listStyle:"none",padding:0,margin:0},children:m.map((w,C)=>o.jsxs(k.Fragment,{children:[o.jsxs("li",{onClick:()=>_(w.component_key,C),style:{display:"flex",alignItems:"center",padding:"0.5rem",cursor:C<4?"not-allowed":"pointer",transition:"background 0.2s"},onMouseEnter:b=>{C>=4&&(b.currentTarget.style.background="#F9FAFB")},onMouseLeave:b=>{C>=4&&(b.currentTarget.style.background="transparent")},children:[o.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",marginRight:8,flexShrink:0},children:w.visible?o.jsx(Yme,{width:20,height:20,fill:l?.activeBg||"var(--color-primary, #008FBB)"}):o.jsx(Qme,{width:20,height:20,fill:"#D1D5DB"})}),o.jsx("span",{style:{fontSize:"14px",color:"#111827",fontWeight:400,userSelect:"none"},children:w.label})]}),C===3&&o.jsx("div",{style:{height:1,background:"#E5E7EB",margin:"4px 0"}})]},w.component_key))}),o.jsx("div",{style:{padding:"12px 16px 0 16px",display:"flex",justifyContent:"flex-end"},children:o.jsx("button",{type:"button",onClick:v,disabled:n,style:{padding:"6px 16px",borderRadius:4,border:"none",background:"var(--color-primary, #008FBB)",color:"#fff",fontSize:"14px",fontWeight:500,cursor:n?"not-allowed":"pointer",transition:"opacity 0.2s",opacity:n?.7:1},children:n?r:i})})]})]})},t6e="_container_zhny9_1",a6e="_card_zhny9_15",n6e="_footer_zhny9_33",o6e="_noPaddingMobile_zhny9_51",Q1={container:t6e,card:a6e,footer:n6e,noPaddingMobile:o6e},c6e="_board_71fer_1",i6e="_clickable_71fer_21",r6e="_sideBar_71fer_26",s6e="_boardContent_71fer_32",d6e="_orange_71fer_40",l6e="_red_71fer_44",h6e="_green_71fer_48",u6e="_grey_71fer_52",p6e="_lightGrey_71fer_56",y6e="_big_71fer_61",k6e="_medium_71fer_66",m6e="_headerRow_71fer_70",f6e="_iconWrapper_71fer_75",g6e="_headerTitle_71fer_80",v6e="_valueArea_71fer_89",M6e="_titleWhite_71fer_99",_6e="_titleBlack_71fer_103",x6e="_valueWhite_71fer_108",L6e="_valueBlack_71fer_112",I6e="_valueBlue_71fer_116",b6e="_bars_71fer_121",w6e="_bar_71fer_121",C6e="_barDark_71fer_135",N6e="_barDim_71fer_139",Ue={board:c6e,clickable:i6e,sideBar:r6e,boardContent:s6e,orange:d6e,red:l6e,green:h6e,grey:u6e,lightGrey:p6e,big:y6e,medium:k6e,headerRow:m6e,iconWrapper:f6e,headerTitle:g6e,valueArea:v6e,titleWhite:M6e,titleBlack:_6e,valueWhite:x6e,valueBlack:L6e,valueBlue:I6e,bars:b6e,bar:w6e,barDark:C6e,barDim:N6e},j6e=({endingDark:e=!1,lightCount:t=5,className:n=""})=>{const c=Math.max(0,Math.min(5,Math.floor(t)));return o.jsx("div",{className:`${Ue.bars} ${n} bars-data-board`,children:Array.from({length:5}).map((i,r)=>o.jsx("span",{className:`${Ue.bar} ${r<c?"":e?Ue.barDark:Ue.barDim}`},r))})},jt=({a11yConfig:e,iconName:t,label:n,value:c,backgroundColor:i="green",bars:r,lightBars:s=5,size:d="big",valueScale:l,width:h,height:u,className:p="",style:y,titleColor:m="white",valueColor:g="white",titleFontSize:f,titleFontWeight:M,valueFontSize:_,valueFontWeight:v,barColor:L,justifyContent:w="space-between",alignItems:C="flex-start",cardGap:b="",onClick:x,iconColor:I,titleKey:S})=>{const j=r!=="none",$=r==="endingDark",{padding:q,...H}=y||{},D=h===void 0&&u===void 0&&i===void 0&&Object.keys(H).length===0?void 0:{...h!==void 0?{width:h}:{},...u!==void 0?{height:u}:{},...i!==void 0?{backgroundColor:i}:{},...H},z=`${Ue.board} ${Ue[d]} ${p}`;return o.jsxs("div",{className:z,onClick:x,style:l!==void 0?{...D,"--ds-value-scale":l}:D,children:[L&&o.jsx("div",{className:Ue.sideBar,style:{backgroundColor:L}}),o.jsxs("div",{className:Ue.boardContent,style:{padding:q,gap:b},children:[o.jsxs("div",{className:Ue.headerRow,style:{justifyContent:w,alignItems:C},children:[t&&o.jsx("div",{className:Ue.iconWrapper,style:{color:I},children:t}),o.jsx("div",{className:`${Ue.headerTitle} header-title-data-board`,children:o.jsx("span",{title:Y(e,S),"aria-label":e?.description,style:{color:m,...f?{fontSize:f}:{},...M?{fontWeight:M}:{}},children:n})}),j?o.jsx(j6e,{endingDark:$,lightCount:s}):null]}),o.jsx("div",{className:Ue.valueArea,style:{color:g,..._?{fontSize:_}:{},...v?{fontWeight:v}:{}},children:c})]})]})},S6e="_wrapper_1ydle_10",$6e="_hosp_1ydle_19",q6e="_headerRow_1ydle_54",A6e="_iconWrapper_1ydle_61",z6e="_headerTitle_1ydle_67",V6e="_hospValue_1ydle_76",P6e="_side_1ydle_88",T6e="_mini_1ydle_100",H6e="_miniLabel_1ydle_131",D6e="_miniValue_1ydle_140",B6e="_miniBars_1ydle_150",R6e="_bars_1ydle_155",F6e="_bar_1ydle_155",E6e="_barDark_1ydle_169",O6e="_barDim_1ydle_173",Ae={wrapper:S6e,hosp:$6e,headerRow:q6e,iconWrapper:A6e,headerTitle:z6e,hospValue:V6e,side:P6e,mini:T6e,miniLabel:H6e,miniValue:D6e,miniBars:B6e,bars:R6e,bar:F6e,barDark:E6e,barDim:O6e},U6e=({endingDark:e=!1,lightCount:t=5,className:n=""})=>{const c=Math.max(0,Math.min(5,Math.floor(t)));return o.jsx("div",{className:`${Ae.bars} ${n} bars-data-board`,children:Array.from({length:5}).map((i,r)=>o.jsx("span",{className:`${Ae.bar} ${r<c?"":e?Ae.barDark:Ae.barDim}`},r))})},Yq=({left:e,right:t,className:n="",style:c,miniTilesCount:i=3})=>{const r=e.bars??"endingDark",s=r!=="none",d=r==="endingDark",l={...c,"--mini-tiles-count":i};return o.jsxs("div",{className:`${Ae.wrapper} ${n} data-four-boards`,style:l,children:[o.jsxs("div",{className:`${Ae.hosp} ${e.className||""}`,onClick:e.onClick,style:{...e.width?{width:e.width}:{},...e.height?{height:e.height}:{},...e.backgroundColor?{backgroundColor:e.backgroundColor}:{},...e.style||{}},title:Y(e.a11yConfig,e.titleKey),children:[o.jsxs("div",{className:Ae.headerRow,children:[o.jsxs("div",{className:`${Ae.iconWrapper} icon-wrapper-data-four-boards`,children:[e.iconName&&o.jsx("span",{style:{color:e.iconColor},children:e.iconName}),o.jsx("span",{className:Ae.headerTitle,style:{color:e.titleColor||"white",...e.titleFontSize?{fontSize:e.titleFontSize}:{},...e.titleFontWeight?{fontWeight:e.titleFontWeight}:{}},title:Y(e.a11yConfig,e.titleKey),children:e.label})]}),s?o.jsx(U6e,{endingDark:d,lightCount:e.lightBars??5}):null]}),o.jsx("div",{className:Ae.hospValue,style:{color:e.valueColor||"white",...e.valueScale!==void 0?{"--ds-value-scale":e.valueScale}:{},...e.valueFontSize?{fontSize:e.valueFontSize}:{},...e.valueFontWeight?{fontWeight:e.valueFontWeight}:{}},children:e.value})]}),o.jsx("div",{className:Ae.side,children:t.map((h,u)=>o.jsxs("div",{className:`${Ae.mini} ${h.className||""} icon-wrapper-data-four-boards`,onClick:h.onClick,style:{...h.width?{width:h.width}:{},...h.height?{height:h.height}:{},...h.backgroundColor?{backgroundColor:h.backgroundColor}:{},...h.style||{}},title:Y(h.a11yConfig,h.titleKey),children:[o.jsxs("span",{className:Ae.miniLabel,style:{color:h.titleColor||"white",textAlign:"right",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",...h.titleFontSize?{fontSize:h.titleFontSize}:{},...h.titleFontWeight?{fontWeight:h.titleFontWeight}:{}},title:Y(h.a11yConfig,h.titleKey),children:[h.iconName&&o.jsx("span",{style:{color:h.iconColor},children:h.iconName}),h.label]}),o.jsx("span",{className:`${Ae.miniValue} mini-value-data-four-boards`,style:{color:h.valueColor||"white",textAlign:"right",...h.valueScale!==void 0?{"--ds-value-scale":h.valueScale}:{},...h.valueFontSize?{fontSize:h.valueFontSize}:{},...h.valueFontWeight?{fontWeight:h.valueFontWeight}:{}},children:h.value}),o.jsx("div",{className:Ae.miniBars})]},h.id??`${h.label}-${u}`))})]})},W6e=({items:e,footerLabel:t,width:n,height:c,size:i=320,style:r,className:s="",backgroundColor:d,titleFontSize:l,titleFontWeight:h,valueFontSize:u,valueFontWeight:p,noPaddingLeftRight:y=!1,onItemClick:m})=>{const g={width:n??i,height:c,backgroundColor:d??"var(--ds-navy)",...r},f=e[0],M=e[1],_=e.slice(2,5);return o.jsxs("div",{style:g,className:`${Q1.container} ${y?Q1.noPaddingMobile:""} ${s}`,children:[o.jsxs("div",{className:Q1.card,children:[f?o.jsx(jt,{a11yConfig:f.a11yConfig,label:f.label,value:f.value,backgroundColor:f.backgroundColor,bars:f.bars,lightBars:f.lightBars,size:f.size??"big",valueScale:f.valueScale,width:f.width,height:f.height,titleColor:"white",valueColor:"white",titleFontSize:f.titleFontSize??l,titleFontWeight:f.titleFontWeight??h,valueFontSize:f.valueFontSize??u,valueFontWeight:f.valueFontWeight??p,titleKey:f.titleKey,onClick:v=>m?.(0,v)}):null,M&&_.length>0?o.jsx(Yq,{left:{a11yConfig:M.a11yConfig,id:M.id,label:M.label,value:M.value,backgroundColor:M.backgroundColor,bars:M.bars,lightBars:M.lightBars,valueScale:M.valueScale,width:M.width,height:M.height,titleFontSize:M.titleFontSize??l,titleFontWeight:M.titleFontWeight??h,valueFontSize:M.valueFontSize??u,valueFontWeight:M.valueFontWeight??p,titleKey:M.titleKey,onClick:v=>m?.(1,v)},right:_.map((v,L)=>({a11yConfig:v.a11yConfig,id:v.id,label:v.label,value:v.value,backgroundColor:v.backgroundColor,bars:v.bars,lightBars:v.lightBars,valueScale:v.valueScale,width:v.width,height:v.height,titleFontSize:v.titleFontSize??l,titleFontWeight:v.titleFontWeight??h,valueFontSize:v.valueFontSize??u,valueFontWeight:v.valueFontWeight??p,titleKey:v.titleKey,onClick:w=>m?.(2+L,w)}))}):M&&_.length===0?o.jsx(jt,{a11yConfig:M.a11yConfig,label:M.label,value:M.value,backgroundColor:M.backgroundColor,bars:M.bars,lightBars:M.lightBars,size:M.size??"big",valueScale:M.valueScale,width:M.width,height:M.height,titleColor:"white",valueColor:"white",titleFontSize:M.titleFontSize??l,titleFontWeight:M.titleFontWeight??h,valueFontSize:M.valueFontSize??u,valueFontWeight:M.valueFontWeight??p,onClick:v=>m?.(1,v)}):null]}),t&&o.jsx("div",{className:Q1.footer,children:t})]})},G6e=({x:e,y:t,width:n,payload:c,fontSize:i,fontWeight:r,stroke:s})=>o.jsx("g",{transform:`translate(${e},${t})`,children:o.jsx("foreignObject",{x:-n,y:-35,width:n,height:70,style:{overflow:"visible"},children:o.jsx("div",{style:{fontSize:i,fontWeight:r,color:s,lineHeight:"1.1",display:"flex",justifyContent:"flex-end",textAlign:"right",alignItems:"center",height:"100%",width:"100%",paddingRight:"8px",paddingLeft:"8px",boxSizing:"border-box"},children:o.jsx("span",{style:{wordBreak:"break-word",whiteSpace:"normal",display:"block",maxWidth:"100%",width:"100%"},children:c.value})})})}),K6e=({data:e,height:t=360,barColor:n="#0284C7",tooltipEnabled:c=!0,backgroundColor:i="#ffffff",legendTextColor:r="#000",barHeight:s=100,yAxisWidth:d=240,fontSize:l="12px",fontWeight:h="400",wrapLabels:u=!1,domain:p})=>{const y=(g,f,M)=>{if(g==null||g==="")return"";const _=M?.payload?.percentage;return typeof _=="number"&&Number.isFinite(_)?`${g} (${_.toFixed(1)}%)`:g},m=g=>g==null||g===""?"":`${g}%`;return o.jsx("div",{style:{backgroundColor:i},children:o.jsx(a.ResponsiveContainer,{width:"100%",height:t,children:o.jsxs(a.BarChart,{data:e,layout:"vertical",margin:{top:8,right:48,bottom:8,left:0},children:[o.jsx(a.CartesianGrid,{opacity:.4,stroke:"#E5E7EB",vertical:!1}),o.jsx(a.XAxis,{type:"number",domain:p,axisLine:!1,tickLine:!1,fontSize:l,fontWeight:h,stroke:r}),o.jsx(a.YAxis,{type:"category",dataKey:"label",stroke:r,axisLine:!1,tickLine:!1,width:d,interval:0,fontSize:l,fontWeight:h,tick:u?o.jsx(G6e,{}):void 0}),c&&o.jsx(a.Tooltip,{formatter:y}),o.jsx(a.Bar,{dataKey:"value",fill:n,radius:0,barSize:s,children:o.jsx(a.LabelList,{dataKey:"percentage",position:"right",offset:10,formatter:m,fill:r,fontSize:l,fontWeight:h})})]})})})},Z6e="_menu_10i6j_1",X6e="_menuRow_10i6j_18",Y6e="_separator_10i6j_33",J6e="_rowLabel_10i6j_39",Q6e="_rowLeadingIcon_10i6j_47",e8e="_rowIcon_10i6j_54",Bc={menu:Z6e,menuRow:X6e,separator:Y6e,rowLabel:J6e,rowLeadingIcon:Q6e,rowIcon:e8e},t8e=k.forwardRef(function({isVisible:t,onClose:n,items:c,style:i,position:r,bg:s},d){const l=k.useRef(null),h=d||l;if(k.useEffect(()=>{if(!t)return;const y=m=>{h.current&&!h.current.contains(m.target)&&n?.()};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[t,n]),!t)return null;const p={...{top:r?.top,left:r?.left,right:r?.right,bottom:r?.bottom},...s&&{backgroundColor:s},...i};return o.jsx("div",{ref:h,role:"menu",className:Bc.menu,style:p,children:c.map(y=>{if(y.type==="separator")return o.jsx("hr",{className:Bc.separator},y.id);const m=y,g=m.color?{color:m.color}:{},f=m.closeOnClick!==!1;return o.jsxs("button",{role:"menuitem",className:Bc.menuRow,style:g,onClick:()=>{m.onClick?.(),f&&n?.()},children:[o.jsxs("span",{className:Bc.rowLabel,children:[m.leadingIcon&&o.jsx("span",{className:Bc.rowLeadingIcon,children:m.leadingIcon}),o.jsx("span",{children:m.label})]}),m.icon&&o.jsx("span",{className:Bc.rowIcon,children:m.icon})]},m.id)})})}),Jq=({user:e,logoutHref:t,logoutTarget:n="_self",onLogout:c,profileHref:i,profileLinkTarget:r="_self",backgroundColor:s="transparent",textColor:d="inherit",roleColor:l="#888",avatarSize:h="32px",padding:u="10px",gap:p="12px",emailFontSize:y="14px",emailFontWeight:m=600,roleFontSize:g="12px",roleFontWeight:f,avatarColor:M="#5b8fb9",backgroundColorAvatar:_="#f1f4f5",dropdownMenuItems:v,dropdownMenuStyle:L,dropdownMenuOffset:w,statusDotColor:C,a11yConfig:b,style:x,className:I=""})=>{const{user:S}=dt(),j=e||S,{currentTheme:$,switchTheme:q}=pL(),H=k.useRef(null),D=k.useRef(null),[z,N]=k.useState(!1),[A,R]=k.useState({}),P=k.useMemo(()=>{const F=[],ee=({variant:oe})=>oe==="sun"?o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("circle",{cx:"12",cy:"12",r:"4"})}):o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})});i&&(F.push({id:"profile",type:"action",label:"Mon profil",onClick:()=>{typeof window>"u"||(r==="_blank"?window.open(i,"_blank","noopener,noreferrer"):window.location.assign(i))}}),F.push({id:"sep-profile",type:"separator"}));const re=$==="dark";return F.push({id:"theme",type:"action",label:re?"Mode clair":"Mode sombre",icon:o.jsx(ee,{variant:re?"sun":"moon"}),onClick:()=>{q(re?"light":"dark")}}),(t||c)&&(F.push({id:"sep-theme",type:"separator"}),F.push({id:"logout",type:"action",label:"Se déconnecter",danger:!0,onClick:()=>{if(t){if(typeof window>"u")return;n==="_blank"?window.open(t,"_blank","noopener,noreferrer"):window.location.assign(t);return}c?.()}})),F},[$,t,n,c,i,r,q]),T=v??P,E=()=>{if(!H.current){N(F=>!F);return}if(!z){const F=H.current.getBoundingClientRect(),ee=window.innerWidth,re=window.innerHeight,oe=200,ke=200,Le=4,ve=w?.x??0,qe=w?.y??0,ue=ee-F.right>=oe+Le;R(ue?{top:F.bottom-ke+qe,left:F.right+Le+ve}:{bottom:re-F.top+qe,left:F.left+ve})}N(F=>!F)};if(k.useEffect(()=>{if(!z||!H.current)return;const F=()=>{const ee=H.current.getBoundingClientRect(),re=window.innerWidth,oe=window.innerHeight,ke=200,Le=200,ve=4,qe=w?.x??0,je=w?.y??0,be=re-ee.right>=ke+ve;R(be?{top:ee.bottom-Le+je,left:ee.right+ve+qe}:{bottom:oe-ee.top+je,left:ee.left+qe})};return window.addEventListener("resize",F),window.addEventListener("orientationchange",F),()=>{window.removeEventListener("resize",F),window.removeEventListener("orientationchange",F)}},[z,w]),k.useEffect(()=>{if(!z||!H.current||!D.current)return;const F=()=>{const re=H.current.getBoundingClientRect(),oe=D.current.getBoundingClientRect(),ke=w?.x??0,Le=w?.y??0;R(ve=>ve.left!==void 0&&ve.top!==void 0&&ve.left>=re.right-1?{top:re.bottom-oe.height+Le,left:ve.left+ke}:ve)},ee=requestAnimationFrame(()=>{setTimeout(F,0)});return()=>cancelAnimationFrame(ee)},[z,w]),!j)return null;const X=j,ae=parseInt(h,10)||40,J=`${ae*.375}px`,Ie=`${ae*1.375}px`,me=`${ae*.2}px`,$e=`${ae*.6}px`,se=()=>{const F=parseInt(h,10)||40,ee=Math.max(8,F*.34375),re=Math.max(2,F*.05);return o.jsxs(o.Fragment,{children:[o.jsxs("div",{style:{position:"relative",flexShrink:0,userSelect:"none"},children:[X.image?o.jsx("img",{src:X.image,alt:`${X.prenom} ${X.nom}`,style:{width:h,height:h,borderRadius:"50%",objectFit:"cover",userSelect:"none"}}):o.jsxs("div",{style:{width:h,height:h,position:"relative",borderRadius:"50%",backgroundColor:_,overflow:"hidden",userSelect:"none"},children:[o.jsx("div",{style:{width:J,height:J,borderRadius:"50%",backgroundColor:M,position:"absolute",top:me,left:"50%",transform:"translateX(-50%)",zIndex:2,userSelect:"none"}}),o.jsx("div",{style:{width:Ie,height:Ie,borderRadius:"50%",backgroundColor:M,position:"absolute",top:$e,left:"50%",transform:"translateX(-50%)",zIndex:1,userSelect:"none"}})]}),C&&o.jsx("div",{style:{position:"absolute",bottom:re,right:re,width:`${ee}px`,height:`${ee}px`,borderRadius:"50%",backgroundColor:C,border:"2px solid white",zIndex:10}})]}),o.jsxs("div",{style:{display:"flex",flexDirection:"column",minWidth:0,flex:1},children:[o.jsx("span",{style:{fontWeight:m,fontSize:y,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:X.email,children:X.email}),o.jsx("span",{style:{color:l,fontSize:g,fontWeight:f,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:X.role,children:X.role})]})]})};return o.jsxs(o.Fragment,{children:[o.jsx("div",{ref:H,className:`user-info ${I}`,style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:u,backgroundColor:s,gap:p,color:d,width:"100%",boxSizing:"border-box",cursor:"pointer",userSelect:"none",...x},onClick:E,title:Y(b,X.role),role:"button",tabIndex:0,children:o.jsx("div",{style:{display:"flex",alignItems:"center",gap:p,flex:1,minWidth:0},children:o.jsx(se,{})})}),o.jsx(t8e,{ref:D,isVisible:z,onClose:()=>N(!1),items:T,style:L,position:A})]})},a8e="_navItem_16uqf_1",n8e="_label_16uqf_14",o8e="_icon_16uqf_26",l1={navItem:a8e,label:n8e,icon:o8e},Zw=({label:e,labelKey:t,onClick:n,href:c,isActive:i,icon:r,style:s,className:d="",highlightColor:l="#00aec7",color:h="#333",activeColor:u="#00aec7",highlightBackgroundColor:p="rgba(0, 0, 0, 0.05)",fontSize:y="15px",fontWeight:m="500",sidebarCollapsed:g=!1,padding:f="10px 16px",borderWidth:M="4px",iconGap:_="12px",disabled:v=!1,disabledColor:L,a11yConfig:w})=>{const C=()=>{v||n?.()},b=o.jsxs(o.Fragment,{children:[r&&o.jsx("span",{className:l1.icon,style:{marginRight:g?0:_},children:r}),!g&&o.jsx("span",{className:l1.label,children:e})]}),x=()=>{if(!i)return"transparent";const S=j=>{const $=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(j);return $?{r:parseInt($[1],16),g:parseInt($[2],16),b:parseInt($[3],16)}:null};if(l.startsWith("#")){const j=S(l);if(j)return`rgba(${j.r}, ${j.g}, ${j.b}, 0.08)`}else if(l.startsWith("rgb")){const j=l.match(/\d+/g);if(j&&j.length>=3)return`rgba(${j[0]}, ${j[1]}, ${j[2]}, 0.08)`}return p},I={onClick:C,className:`${l1.navItem} ${i?l1.active:""} ${d} ${v?l1.disabled:""}`,style:{padding:f,color:i?u:v?L||"#999":h,borderLeft:i?`${M} solid ${l}`:`${M} solid transparent`,backgroundColor:x(),fontSize:y,fontWeight:m,cursor:v?"not-allowed":"pointer",textDecoration:"none",...s},"aria-disabled":v};return c&&!n&&!v?o.jsx("a",{href:c,...I,title:Y(w,t),children:b}):o.jsx("div",{...I,role:n?"button":void 0,tabIndex:n&&!v?0:void 0,title:Y(w,t),children:b})},c8e="_navbar_agnn2_1",i8e="_topSection_agnn2_9",r8e="_sectionsContainer_agnn2_14",s8e="_sectionTitle_agnn2_20",d8e="_sectionItems_agnn2_25",l8e="_bottomSection_agnn2_30",h8e="_versionContainer_agnn2_49",lt={navbar:c8e,topSection:i8e,sectionsContainer:r8e,sectionTitle:s8e,sectionItems:d8e,bottomSection:l8e,versionContainer:h8e},u8e=({logoProps:e,logoSpacing:t,navItems:n,padding:c="24px 16px",sectionSpacing:i="32px",itemSpacing:r="4px",backgroundColor:s="#fff",highlightColor:d="#00aec7",highlightBackgroundColor:l="rgba(0, 0, 0, 0.05)",version:h,navSectionStyle:u,navLinkStyle:p,navItemPadding:y="10px 16px",navItemBorderWidth:m="4px",navItemIconGap:g="12px",navItemFontSize:f="15px",navItemFontWeight:M="500",navItemColor:_,sectionTitlePadding:v="16px",sectionTitleFontSize:L="11px",sectionTitleColor:w="#999",sectionTitleWeight:C="500",versionFontSize:b="12px",versionFontWeight:x="400",versionColor:I="#999",userInfoProps:S,style:j,className:$="",width:q="280px",showLogo:H=!0,versionA11yConfig:D,displayNone:z=!1})=>{const N=dt(),A=N.activeNav,R=N.setActiveNav,P=N.user,T=S.user||P;return o.jsxs("div",{className:`${lt.navbar} ${$}`,style:{width:q,backgroundColor:s,padding:c,display:z?"none":"flex",...j},children:[o.jsxs("div",{className:lt.topSection,style:{gap:t},children:[H&&o.jsx("div",{className:lt.logoContainer,children:o.jsx(uL,{...e})}),o.jsx("div",{className:lt.sectionsContainer,style:{gap:i},children:n.map((E,X)=>o.jsxs("div",{className:lt.section,children:[E.title&&o.jsx("div",{className:lt.sectionTitle,title:Y(E.a11yConfig,E.titleKey),style:{fontSize:L,color:w,padding:v,fontWeight:C,border:"4px solid transparent",...u},children:E.title}),o.jsx("div",{className:lt.sectionItems,style:{gap:r},children:E.items.map(ae=>o.jsx(Zw,{...ae,isActive:ae.isActive===null?ae.isActive:A===ae.id,onClick:()=>{ae.onClick&&ae.onClick(),ae.isActive==null&&R(ae.id)},highlightColor:d,activeColor:d,highlightBackgroundColor:l,padding:y,borderWidth:m,iconGap:g,fontSize:f,fontWeight:M,color:_,style:p},ae.id))})]},X))})]}),o.jsxs("div",{className:lt.bottomSection,style:{gap:t},children:[o.jsx(Jq,{...S,user:T}),h&&o.jsx("div",{className:lt.versionContainer,title:Y(D,h),style:{fontSize:b,fontWeight:x,color:I},children:h})]})]})},p8e="_container_4qege_1",y8e="_titleContainer_4qege_10",k8e="_title_4qege_10",m8e="_inlineToggleContainer_4qege_24",f8e="_rightContentContainer_4qege_30",h1={container:p8e,titleContainer:y8e,title:k8e,inlineToggleContainer:m8e,rightContentContainer:f8e},g8e=({className:e="",style:t,fontSize:n="20px",fontWeight:c="bold",color:i="#000",padding:r="0",margin:s,backgroundColor:d,width:l,height:h,border:u,borderRadius:p,navItems:y,formatTitle:m=M=>M,rightContent:g,inlineToggle:f})=>{const{activeNav:M}=dt(),_=y.find(L=>L.id===M),v=m(_?_.label:M);return v?o.jsxs("div",{className:`${h1.container} ${e}`,style:{padding:r,margin:s,backgroundColor:d,width:l,height:h,border:u,borderRadius:p,...t},children:[o.jsxs("div",{className:h1.titleContainer,children:[o.jsx("div",{className:h1.title,style:{fontSize:n,fontWeight:c,color:i},children:v}),f&&o.jsx("div",{className:h1.inlineToggleContainer,children:f})]}),g&&o.jsx("div",{className:h1.rightContentContainer,children:g})]}):null},v8e="_navItem_1hg26_1",M8e="_navItemIcon_1hg26_21",_8e="_navItemLabel_1hg26_29",x8e="_navItemCount_1hg26_36",L8e="_navItemIndicator_1hg26_49",u1={navItem:v8e,navItemIcon:M8e,navItemLabel:_8e,navItemCount:x8e,navItemIndicator:L8e},Qq=({a11yConfig:e,label:t,isActive:n,onClick:c,href:i,labelKey:r,icon:s,count:d,activeColor:l="#00aec7",inactiveColor:h="#666",activeBackgroundColor:u="transparent",countBackgroundColor:p,countColor:y="#fff",countBorderRadius:m="10px",countPadding:g="2px 6px",countFontSize:f="12px",countFontWeight:M="500",indicatorColor:_="#00aec7",indicatorHeight:v="3px",padding:L="8px 4px",fontSize:w="14px",fontWeight:C="500",gap:b="8px",style:x,className:I="",disabled:S=!1,onNavigate:j})=>{const $=()=>{S||(c?.(),i&&(j?j(i):window.location.href=i))};return o.jsxs("div",{className:`${u1.navItem} ${I}`,onClick:$,title:Y(e,r),style:{gap:b,padding:L,color:n?l:h,backgroundColor:n?u:"transparent",fontSize:w,fontWeight:C,...x},children:[s&&o.jsx("span",{className:u1.navItemIcon,children:s}),o.jsx("span",{className:u1.navItemLabel,children:t}),d!==void 0&&o.jsx("span",{className:u1.navItemCount,style:{backgroundColor:p,color:y,borderRadius:m,padding:g,fontSize:f,fontWeight:M},children:d}),n&&!S&&o.jsx("div",{className:u1.navItemIndicator,style:{height:v,backgroundColor:_}})]})},I8e="_container_13hsa_1",b8e="_groupHeader_13hsa_8",w8e="_groupHeaderLeft_13hsa_18",C8e="_groupIcon_13hsa_23",N8e="_dropdown_13hsa_29",j8e="_item_13hsa_42",S8e="_itemIcon_13hsa_65",$8e="_chevron_13hsa_72",q8e="_chevronOpen_13hsa_79",ht={container:I8e,groupHeader:b8e,groupHeaderLeft:w8e,groupIcon:C8e,dropdown:N8e,item:j8e,itemIcon:S8e,chevron:$8e,chevronOpen:q8e},A8e=e=>Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 -960 960 960",...e},Z.createElement("path",{d:"M480-344 240-584l43-43 197 197 197-197 43 43z"})),V1=k.memo(A8e),eA=({groups:e,activeItemId:t,onItemClick:n,style:c,className:i,bgColor:r="transparent",color:s="var(--color-text)",headerBgColor:d="var(--color-indicator)",headerColor:l="var(--color-text)",headerBorderBottomColor:h="var(--color-border)",dropdownBgColor:u="var(--color-background)",itemBgColor:p="transparent",itemHoverBgColor:y="rgba(0,0,0,0.05)",itemColor:m="var(--color-text)",itemActiveColor:g="var(--color-primary)",itemActiveBorderColor:f="var(--color-primary)",itemDividerColor:M="var(--color-border)",iconColor:_="#555555",activeIconColor:v="var(--color-primary)",headerIconColor:L="var(--color-text)",chevronColor:w="var(--color-text)",iconSize:C=22,headerPadding:b="14px 20px",itemPadding:x="14px 20px",iconGap:I=14,borderRadius:S=0})=>{const[j,$]=k.useState(""),q=k.useRef(null);k.useEffect(()=>{const D=z=>{q.current&&!q.current.contains(z.target)&&$("")};return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[]);const H={backgroundColor:r,color:s,borderRadius:S,...c};return o.jsx("nav",{ref:q,className:[ht.container,i].filter(Boolean).join(" "),style:H,children:e.map(D=>{const z=j===D.id,N={backgroundColor:d,color:l,padding:b,borderBottom:`1px solid ${h}`,gap:I},A={backgroundColor:u};return o.jsxs("div",{children:[o.jsxs("div",{className:ht.groupHeader,style:N,onClick:()=>$(z?"":D.id),role:"button","aria-expanded":z,children:[o.jsxs("div",{className:ht.groupHeaderLeft,style:{gap:I},children:[D.icon&&o.jsx("span",{className:ht.groupIcon,style:{color:L,width:C,height:C},children:D.icon}),o.jsx("span",{children:D.label})]}),o.jsx("span",{className:[ht.chevron,z?ht.chevronOpen:""].join(" "),style:{color:w},children:o.jsx(V1,{width:18,height:18})})]}),z&&o.jsx("div",{className:ht.dropdown,style:A,children:D.items.map(R=>{const P=R.id===t,T={padding:x,gap:I,color:P?g:m,backgroundColor:p,"--item-border-width":P?"4px":"1px","--item-border-color":P?f:M};return o.jsxs("div",{className:ht.item,style:T,onClick:()=>{n?.(D.id,R.id),$("")},role:"menuitem",onMouseEnter:E=>{P||(E.currentTarget.style.backgroundColor=y)},children:[R.icon&&o.jsx("span",{className:ht.itemIcon,style:{color:P?v:_,width:C,height:C},children:R.icon}),o.jsx("span",{children:R.label})]},R.id)})})]},D.id)})})},z8e="_subheaderContent_1glo8_1",V8e="_navContainer_1glo8_11",P8e="_rightContent_1glo8_45",Ab={subheaderContent:z8e,navContainer:V8e,rightContent:P8e},T8e=({subNavItems:e,backgroundColor:t="transparent",padding:n="0",margin:c,width:i,height:r="auto",border:s,borderBottom:d="none",itemGap:l="24px",actionsGap:h="16px",itemPadding:u="12px 0",itemFontSize:p="14px",itemFontWeight:y="500",activeItemColor:m="#00aec7",inactiveItemColor:g="#5c6975",indicatorHeight:f="3px",showDraggable:M=!1,showLegend:_=!1,showData:v=!1,className:L="",style:w,countBackgroundColor:C,countColor:b,countBorderRadius:x,countPadding:I,countFontSize:S,countFontWeight:j,navContainerClassName:$,navContainerStyle:q,rightContentClassName:H,rightContentStyle:D,rightActions:z,activeSwitcherColor:N,inactiveSwitcherColor:A,isMobile:R=!1,onNavigate:P})=>{const{activeSubNav:T,setActiveSubNav:E,navCounts:X,activeNav:ae}=dt();if(R){const J=e.find(me=>me.id===T)||e[0],Ie=[{id:"current-group",label:J?.label||ae?.toUpperCase()||"MENU",icon:J?.icon,items:e.map(me=>({id:me.id,label:me.label,icon:me.icon}))}];return o.jsx("div",{className:L,style:w,children:o.jsx(eA,{groups:Ie,activeItemId:T,onItemClick:(me,$e)=>{const se=e.find(F=>F.id===$e);se&&(se.onClick&&se.onClick(),se.href&&(P?P(se.href):se.onNavigate?se.onNavigate(se.href):window.location.href=se.href),E($e))},headerBgColor:t})})}return o.jsxs("div",{className:`${Ab.subheaderContent} ${L}`,style:{backgroundColor:t,padding:n,margin:c,width:i,height:r,border:s,borderBottom:d,...w},children:[o.jsx("div",{className:`${Ab.navContainer} ${$||""}`,style:{gap:l,...q},children:e.map(J=>{const Ie=J.count!==void 0?J.count:X[J.id],me=T===J.id||J.isActive;return o.jsx(Qq,{...J,onNavigate:P||J.onNavigate,count:Ie,isActive:me,onClick:()=>{J.onClick&&J.onClick(),E(J.id)},activeColor:m,inactiveColor:g,countBackgroundColor:C,countColor:b,countBorderRadius:x,countPadding:I,countFontSize:S,countFontWeight:j,indicatorColor:m,indicatorHeight:f,padding:u,fontSize:p,fontWeight:y,gap:"8px",style:J.style},J.id)})}),o.jsxs("div",{className:`${Ab.rightContent} ${H||""}`,style:{gap:h,...D},children:[M&&o.jsx(aL,{size:20,colors:{bg:N,activeBg:A,icon:"#1C1B1F",icon2:"#FFFFFF"}}),_&&o.jsx(nL,{size:20,colors:{bg:N,activeBg:A,icon:"#1C1B1F",icon2:"#FFFFFF"}}),v&&o.jsx(oL,{size:20,colors:{bg:N,activeBg:A,icon:"#1C1B1F",icon2:"#FFFFFF"}}),z]})]})},H8e=({onSwitch:e,size:t="20px",lightIconColor:n="#666",darkIconColor:c="#fff",backgroundColor:i="transparent",padding:r="8px",borderRadius:s="50%",style:d,className:l=""})=>{const[h,u]=k.useState(!1),{currentTheme:p,switchTheme:y}=pL(),m=p!="dark",g=()=>{y(m?"dark":"light"),e?.()};return k.useEffect(()=>{u(!0)},[]),!h||!p?o.jsx(o.Fragment,{}):o.jsx("div",{className:`theme-switcher ${l}`,onClick:g,style:{cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:i,padding:r,borderRadius:s,transition:"all 0.3s ease",...d},children:m?o.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}):o.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:c,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[o.jsx("circle",{cx:"12",cy:"12",r:"5"}),o.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),o.jsx("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),o.jsx("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),o.jsx("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),o.jsx("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),o.jsx("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),o.jsx("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),o.jsx("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]})})},D8e=({initialSortBy:e=null,initialSortOrder:t="asc",onSortChange:n})=>{const[c,i]=k.useState({sortBy:e,sortOrder:t,filters:{}}),r=k.useCallback(s=>{let d="asc";c.sortBy===s&&(d=c.sortOrder==="asc"?"desc":"asc");const l={...c,sortBy:s,sortOrder:d};i(l),n(s,d)},[c,n]);return{tableState:c,handleSort:r}},B8e=e=>Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"#FFF",viewBox:"0 -960 960 960",...e},Z.createElement("path",{d:"M440-800v487L216-537l-56 57 320 320 320-320-56-57-224 224v-487z"})),R8e=k.memo(B8e),F8e=e=>Z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"#FFF",viewBox:"0 -960 960 960",...e},Z.createElement("path",{d:"M440-160v-487L216-423l-56-57 320-320 320 320-56 57-224-224v487z"})),E8e=k.memo(F8e),O8e=({columns:e,sortBy:t,sortOrder:n,onSort:c,removeLabelSpan:i=!1})=>o.jsx("thead",{children:o.jsx("tr",{children:e.map((r,s)=>{const d=t===r.key,l=!!r.sortable;return o.jsx("th",{className:`${r.className||""}${l?" sortable":""}`,style:{width:r.width,textAlign:r.align||"left"},onClick:()=>l&&c(String(r.key)),title:Y(r.a11yConfig,r.titleKey),children:o.jsxs("div",{className:`th-content ${r.align?`align-${r.align}`:""}`,children:[i?r.label:o.jsx("span",{children:r.label}),l&&o.jsx("span",{className:"sort-icon-container",style:{display:"inline-flex",alignItems:"center"},children:d&&n==="asc"?o.jsx(E8e,{width:16,height:16,style:{fill:"currentColor",transition:"all 0.2s ease"}}):o.jsx(R8e,{width:16,height:16,style:{fill:"currentColor",opacity:d?1:.5,transition:"all 0.2s ease"}})})]})},String(r.key)||s)})})}),U8e=({data:e,columns:t,rowKey:n,onRowClick:c,isLoading:i,text:r,rowStyle:s,rowClassName:d})=>!e.length&&!i?o.jsx("tbody",{children:o.jsx("tr",{children:o.jsx("td",{colSpan:t.length,style:{textAlign:"center",padding:"32px"},children:o.jsx("span",{style:{color:"var(--table-text-muted)"},children:r?.noData||"Aucune donnée disponible"})})})}):o.jsx("tbody",{children:e.map((l,h)=>{const u=l[n],p=typeof u=="string"||typeof u=="number"?u:h;return o.jsx("tr",{onClick:()=>c&&c(l),style:{cursor:c?"pointer":"default",...s?s(l):{}},className:d?d(l,h):"",children:t.map((y,m)=>o.jsx("td",{style:{width:y.width,textAlign:y.align||"left"},className:y.className,children:y.render?y.render(l):l[y.key]},`${String(y.key)}-${m}`))},p)})}),W8e=({state:e,onPaginationChange:t,onLoadMore:n,infiniteScroll:c,hasMore:i,text:r,isLoading:s})=>{const{page:d,pageSize:l,total:h}=e,u=l===-1?h:l,p=Math.ceil(h/u)||1,y=Math.min(Math.max(1,d),p),m=h===0?0:(y-1)*u+1,g=Math.min(y*u,h),f=_=>{t({page:_})},M=k.useMemo(()=>{if(p<=6)return Array.from({length:p},(S,j)=>j+1);const L=Math.max(y-1,1),w=Math.min(y+1,p),C=L>2,b=w<p-2,x=1,I=p;if(!C&&b)return[...Array.from({length:5},($,q)=>q+1),"...",p];if(C&&!b){const j=Array.from({length:5},($,q)=>p-5+q+1);return[x,"...",...j]}if(C&&b){const S=Array.from({length:w-L+1},(j,$)=>L+$);return[x,"...",...S,"...",I]}return[]},[y,p]);return o.jsxs("div",{className:"table-pagination",children:[o.jsx("div",{className:"pagination-summary",children:h>0?o.jsx("span",{children:r?.itemsRange?r.itemsRange(m,g,h):o.jsxs(o.Fragment,{children:[o.jsxs("b",{children:[m,"–",g]})," ","sur ",o.jsx("b",{children:h.toLocaleString()})," éléments"]})}):o.jsx("span",{children:r?.noResults||"0 résultats"})}),o.jsx("div",{className:"pagination-spacer"}),!c&&l!==-1&&p>1&&o.jsxs("div",{className:"pagination-controls",children:[o.jsx("button",{className:"pagination-btn",onClick:()=>f(1),disabled:y===1,title:r?.first||"Premier",children:"<<"}),o.jsx("button",{className:"pagination-btn",onClick:()=>f(y-1),disabled:y===1,title:r?.previous||"Précédent",children:"<"}),(M||[]).map((_,v)=>_==="..."?o.jsx("span",{style:{padding:"0 4px",color:"var(--table-text-muted)"},children:"..."},v):o.jsx("button",{className:`pagination-btn ${_===y?"active":""}`,onClick:()=>f(_),children:_},v)),o.jsx("button",{className:"pagination-btn",onClick:()=>f(y+1),disabled:y===p,title:r?.next||"Suivant",children:">"}),o.jsx("button",{className:"pagination-btn",onClick:()=>f(p),disabled:y===p,title:r?.last||"Dernier",children:">>"})]}),!c&&n&&i&&o.jsx("div",{className:"pagination-load-more",children:o.jsx("button",{className:"btn-load-more",onClick:n,disabled:s,style:{padding:"8px 16px",backgroundColor:"white",border:"1px solid #ddd",borderRadius:"6px",cursor:s?"wait":"pointer",color:"#555",fontWeight:600},children:s?r?.loading||"Chargement...":r?.loadMore||"Charger plus"})})]})},tA=({data:e,columns:t,isLoading:n,pagination:c,onPaginationChange:i,onSortChange:r,rowKey:s,loaderSize:d=40,stickyHeader:l=!0,height:h,minHeight:u="200px",text:p,onLoadMore:y,infiniteScroll:m,hasMore:g,tableState:f,className:M,style:_,rowStyle:v,onRowClick:L,rowClassName:w,titleKey:C,removeLabelSpan:b=!1,a11yConfig:x})=>{const I=k.useMemo(()=>({...p}),[p]),S=k.useRef(null);k.useEffect(()=>{if(!m||!y||!g||n)return;const z=new IntersectionObserver(N=>{N[0].isIntersecting&&y()},{threshold:.1});return S.current&&z.observe(S.current),()=>z.disconnect()},[m,y,g,n]);const{tableState:j,handleSort:$}=D8e({initialSortBy:null,onSortChange:r}),q=(f?.sortBy!==void 0?f.sortBy:j.sortBy)??void 0,H=f?.sortOrder!==void 0?f.sortOrder:j.sortOrder,D=z=>{const N=q,A=H;let R="asc";N===z&&(R=A==="asc"?"desc":"asc"),f?.sortBy!==void 0?r(z,R):$(z)};return o.jsxs("div",{className:`table-container ${M||""}`,style:_,title:Y(x,C),children:[o.jsxs("div",{className:"table-frame",style:{height:h??void 0,minHeight:u??void 0},children:[n&&o.jsx("div",{className:"table-loader-overlay",children:o.jsx("div",{className:"spinner",style:{width:d,height:d,borderTopColor:"var(--table-primary)"}})}),o.jsxs("div",{className:`table-wrapper ${l?"sticky-header":""}`,children:[o.jsxs("table",{className:"data-table",children:[o.jsx(O8e,{columns:t,sortBy:q,sortOrder:H,onSort:D,removeLabelSpan:b}),o.jsx(U8e,{data:e,columns:t.map(z=>({...z,render:z.render?N=>z.render(N,{}):void 0})),rowKey:s,onRowClick:L,isLoading:n,text:I,rowStyle:typeof v=="function"?v:v?()=>v:void 0,rowClassName:w})]}),m&&o.jsx("div",{ref:S,style:{height:20,margin:10}})]})]}),o.jsx(W8e,{state:c,onPaginationChange:i,text:I,onLoadMore:y,infiniteScroll:m,hasMore:g,isLoading:n})]})},G8e="_datePickerContainer_1941b_3",K8e="_label_1941b_16",Z8e="_displayNode_1941b_23",X8e="_datePickerButton_1941b_30",Y8e="_datePickerButtonDisabled_1941b_50",J8e="_datePickerButtonOpen_1941b_59",Q8e="_datePickerLabel_1941b_68",efe="_placeholder_1941b_79",tfe="_chevron_1941b_83",afe="_errorMessage_1941b_91",nfe="_dropdown_1941b_96",ofe="_calendarHeader_1941b_120",cfe="_navButton_1941b_129",ife="_headerSelectors_1941b_148",rfe="_monthSelector_1941b_156",sfe="_yearSelector_1941b_157",dfe="_selectorButton_1941b_161",lfe="_selectorChevron_1941b_178",hfe="_selectorChevronOpen_1941b_183",ufe="_monthDropdown_1941b_187",pfe="_yearDropdown_1941b_188",yfe="_monthItem_1941b_208",kfe="_yearItem_1941b_209",mfe="_monthItemSelected_1941b_231",ffe="_yearItemSelected_1941b_232",gfe="_weekdays_1941b_236",vfe="_weekday_1941b_236",Mfe="_calendarGrid_1941b_252",_fe="_dateCell_1941b_260",xfe="_dateCellSelected_1941b_283",Lfe="_dateCellOtherMonth_1941b_287",Ife="_dateCellOtherMonthSelected_1941b_291",bfe="_calendarFooter_1941b_295",wfe="_cancelButton_1941b_303",Cfe="_applyButton_1941b_304",Nfe="_timePickerContainer_1941b_348",jfe="_timeGroup_1941b_357",Sfe="_timeLabel_1941b_364",$fe="_timeInputWrapper_1941b_370",qfe="_timeInput_1941b_370",Afe="_timeSeparator_1941b_398",O={datePickerContainer:G8e,label:K8e,displayNode:Z8e,datePickerButton:X8e,datePickerButtonDisabled:Y8e,datePickerButtonOpen:J8e,datePickerLabel:Q8e,placeholder:efe,chevron:tfe,errorMessage:afe,dropdown:nfe,calendarHeader:ofe,navButton:cfe,headerSelectors:ife,monthSelector:rfe,yearSelector:sfe,selectorButton:dfe,selectorChevron:lfe,selectorChevronOpen:hfe,monthDropdown:ufe,yearDropdown:pfe,monthItem:yfe,yearItem:kfe,monthItemSelected:mfe,yearItemSelected:ffe,weekdays:gfe,weekday:vfe,calendarGrid:Mfe,dateCell:_fe,dateCellSelected:xfe,dateCellOtherMonth:Lfe,dateCellOtherMonthSelected:Ife,calendarFooter:bfe,cancelButton:wfe,applyButton:Cfe,timePickerContainer:Nfe,timeGroup:jfe,timeLabel:Sfe,timeInputWrapper:$fe,timeInput:qfe,timeSeparator:Afe},dS=["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],zfe=["Lun","Mar","Mer","Jeu","Ven","Sam","Dim"],sw=({value:e,onChange:t,label:n,placeholder:c="Sélectionner une date...",className:i="",fullWidth:r=!0,disabled:s=!1,error:d,buttonHeight:l="2.75rem",buttonPadding:h="0.75rem 1rem 0.75rem 1rem",dropdownMaxHeight:u="auto",fontSize:p="0.875rem",iconSize:y="1.5rem",labelMarginBottom:m="0.5rem",errorMarginTop:g="0.25rem",dropdownMarginTop:f="0.25rem",itemPadding:M="0.5rem 0.75rem",fontWeight:_="400",buttonBgColor:v,buttonBorderColor:L,buttonTextColor:w,dropdownBgColor:C="#ffffff",itemHoverColor:b,selectedItemBgColor:x,iconColor:I,errorColor:S,labelColor:j,placeholderColor:$,borderRadius:q="var(--radius-content)",borderWidth:H="0.0625rem",boxShadow:D="0 0.25rem 0.75rem rgba(0, 0, 0, 0.1)",transitionDuration:z="0.2s",transitionTiming:N="ease",dateCellSize:A="2.5rem",headerTextColor:R="#6c757d",weekdayTextColor:P="#6c757d",currentMonthDateColor:T="#212529",otherMonthDateColor:E="#adb5bd",selectedDateBgColor:X="#00A6D9",selectedDateTextColor:ae="#ffffff",cancelButtonBgColor:J="#e9ecef",cancelButtonTextColor:Ie="#212529",applyButtonBgColor:me="#00A6D9",applyButtonTextColor:$e="#ffffff",width:se,displayNode:F=void 0,displayMode:ee="auto",displayNodeAriaLabel:re,dropdownPosition:oe="bottom",dropdownAlignment:ke="right",dropdownWidth:Le,withBorder:ve=!1,icon:qe,precision:je="day",hoursLabel:ue="Heures",minutesLabel:be="Minutes",lowerLimit:Mt=null,upperLimit:i1=null,months:Ac,weekdays:ne,cancelText:zc="Annuler",applyText:fe="Appliquer",prevMonthAriaLabel:Pt="Mois précédent",nextMonthAriaLabel:cA="Mois suivant",calendarAriaLabel:iA="Sélecteur de date",openedAriaLabel:rA="Ouvrir le sélecteur de date",selectedDateAriaLabel:sA="Date sélectionnée: ",locale:Xw="fr-FR",rotateIcon:dA=!0})=>{const Tt=B=>{if(B instanceof Date)return isNaN(B.getTime())?null:B;if(typeof B=="string"&&B){const G=new Date(B);return isNaN(G.getTime())?null:G}return null},[et,Ht]=k.useState(!1),[Vc,lA]=k.useState({top:0,left:0,width:0}),[ce,r1]=k.useState(Tt(e)||new Date),[wL,CL]=k.useState(Tt(e)),[NL,jL]=k.useState(Tt(e)?.getHours()??0),[SL,$L]=k.useState(Tt(e)?.getMinutes()??0),[qL,Pc]=k.useState(!1),[AL,Tc]=k.useState(!1),zL=k.useRef(null),G1=k.useRef(null),VL=k.useRef(null),PL=k.useRef(null);k.useEffect(()=>{const B=Tt(e);CL(B),B&&(r1(B),jL(B.getHours()),$L(B.getMinutes()))},[e]);const Hc=k.useCallback(()=>{if(G1.current){const B=G1.current.getBoundingClientRect();lA({top:B.top,left:B.left,width:B.width})}},[]);k.useEffect(()=>(et&&(Hc(),window.addEventListener("scroll",Hc,!0),window.addEventListener("resize",Hc)),()=>{window.removeEventListener("scroll",Hc,!0),window.removeEventListener("resize",Hc)}),[et,Hc]),k.useEffect(()=>{const B=G=>{if(zL.current&&!zL.current.contains(G.target)){const _e=document.getElementById("datepicker-dropdown");if(_e&&_e.contains(G.target))return;Ht(!1),Pc(!1),Tc(!1)}VL.current&&!VL.current.contains(G.target)&&Pc(!1),PL.current&&!PL.current.contains(G.target)&&Tc(!1)};return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[]);const Yw=B=>new Date(B.getFullYear(),B.getMonth()+1,0).getDate(),hA=B=>{const G=new Date(B.getFullYear(),B.getMonth(),1).getDay();return G===0?6:G-1},uA=()=>{const B=[],G=hA(ce),_e=Yw(ce),K1=new Date(ce.getFullYear(),ce.getMonth()-1,1),_t=Yw(K1);for(let Ze=G-1;Ze>=0;Ze--)B.push(new Date(ce.getFullYear(),ce.getMonth()-1,_t-Ze));for(let Ze=1;Ze<=_e;Ze++)B.push(new Date(ce.getFullYear(),ce.getMonth(),Ze));const s1=42-B.length;for(let Ze=1;Ze<=s1;Ze++)B.push(new Date(ce.getFullYear(),ce.getMonth()+1,Ze));return B},pA=(B,G)=>!B||!G?!1:B.getDate()===G.getDate()&&B.getMonth()===G.getMonth()&&B.getFullYear()===G.getFullYear(),yA=B=>B.getMonth()===ce.getMonth()&&B.getFullYear()===ce.getFullYear(),kA=()=>{r1(new Date(ce.getFullYear(),ce.getMonth()-1,1))},mA=()=>{r1(new Date(ce.getFullYear(),ce.getMonth()+1,1))},fA=B=>{if(!s){const G=new Date(B);G.setHours(NL),G.setMinutes(SL),CL(G)}},gA=()=>{if(!s){if(wL){const B=new Date(wL);B.setHours(NL),B.setMinutes(SL),t(B)}else t(null);Ht(!1)}},vA=()=>{const B=Tt(e);CL(B),B&&(jL(B.getHours()),$L(B.getMinutes())),Ht(!1)},MA=B=>{r1(new Date(ce.getFullYear(),B,1)),Pc(!1)},_A=B=>{r1(new Date(B,ce.getMonth(),1)),Tc(!1)},xA=()=>{const B=ce.getFullYear(),G=[];for(let _e=B-10;_e<=B+10;_e++)G.push(_e);return G},LA=B=>{if(!s)switch(B.key){case"Enter":case" ":B.preventDefault(),Ht(!et);break;case"Escape":Ht(!1),Pc(!1),Tc(!1);break;case"Tab":et&&(Ht(!1),Pc(!1),Tc(!1));break}},IA={width:se||(r?"100%":"auto"),fontSize:p,fontWeight:_},bA={height:l,padding:h,backgroundColor:v||"#ffffff",border:ve?void 0:"none",borderColor:d?S||"#dc3545":L||"#dee2e6",color:w||"#212529",borderRadius:q,borderWidth:H,fontWeight:_,transition:`all ${z} ${N}`},wA={backgroundColor:C||"#ffffff",maxHeight:u,borderRadius:q,borderWidth:H,boxShadow:D,transition:`opacity ${z} ${N}, transform ${z} ${N}`,position:"fixed",top:oe==="bottom"?Vc.top+(G1.current?.offsetHeight||0)+parseFloat(f.replace("rem",""))*16:"auto",bottom:oe==="top"?window.innerHeight-Vc.top+parseFloat(f.replace("rem",""))*16:"auto",left:ke==="left"?Vc.left:"auto",right:ke==="right"?window.innerWidth-(Vc.left+Vc.width):"auto",width:Le||(r?Vc.width:"auto"),zIndex:10001},Jw={width:y,height:y,color:I||"#6c757d","--icon-rotation":dA&&et?"rotate(180deg)":"rotate(0deg)"},CA={color:j||"#212529",marginBottom:m,fontWeight:_},NA={color:$||"#6c757d"},jA={color:S||"#dc3545",marginTop:g},SA=uA(),tt=Tt(e),Qw=tt?je==="minutes"?`${tt.toLocaleDateString(Xw)} ${tt.getHours().toString().padStart(2,"0")}:${tt.getMinutes().toString().padStart(2,"0")}`:tt.toLocaleDateString(Xw):"",$A=!!F&&(ee==="icon"||ee==="auto"&&!tt),qA=re||(tt?`${sA}${Qw}`:rA);return o.jsxs("div",{className:`${O.datePickerContainer} ${i}`,ref:zL,style:IA,"data-fullwidth":r,"data-disabled":s,"data-error":!!d,children:[n&&o.jsx("label",{className:O.label,style:CA,children:n}),o.jsxs("button",{ref:G1,type:"button",onClick:()=>!s&&Ht(!et),onKeyDown:LA,className:`
8170
8170
  ${O.datePickerButton}
8171
8171
  ${et?O.datePickerButtonOpen:""}
8172
8172
  ${s?O.datePickerButtonDisabled:""}