@tsiky/components-r19 1.6.52 → 1.6.53
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/chart.cjs.js +1 -1
- package/dist/chart.js +214 -206
- package/dist/components-r19.css +1 -1
- package/dist/index.cjs.js +3 -3
- package/dist/index.js +422 -402
- package/dist/src/components/HorizontalBarChart/HorizontalBarChart.d.ts +1 -0
- package/dist/src/components/HorizontalBarChart/HorizontalBarChart.d.ts.map +1 -1
- package/dist/src/components/SankeyChartV2/SankeyChartV2.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -8166,15 +8166,15 @@
|
|
|
8166
8166
|
${g}px !important;
|
|
8167
8167
|
top: ${p}px !important;
|
|
8168
8168
|
}
|
|
8169
|
-
`),()=>{M.contains(f)&&M.removeChild(f)}},[t]),c.jsx(h0e,{isPresent:t,childRef:r,sizeRef:s,children:Z.cloneElement(e,{ref:l})})}const p0e=({children:e,initial:t,isPresent:n,onExitComplete:o,custom:i,presenceAffectsLayout:r,mode:s,anchorX:d,root:l})=>{const h=$t(y0e),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;o&&o()},register:m=>(h.set(m,!1),()=>h.delete(m))}),[n,h,o]);return r&&p&&(y={...y}),k.useMemo(()=>{h.forEach((m,g)=>h.set(g,!1))},[n]),Z.useEffect(()=>{!n&&!h.size&&o&&o()},[n]),s==="popLayout"&&(e=c.jsx(u0e,{isPresent:n,anchorX:d,root:l,children:e})),c.jsx(dL.Provider,{value:y,children:e})};function y0e(){return new Map}function m$(e=!0){const t=k.useContext(dL);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:o,register:i}=t,r=k.useId();k.useEffect(()=>{if(e)return i(r)},[e]);const s=k.useCallback(()=>e&&o&&o(r),[r,o,e]);return!n&&o?[!1,s]:[!0]}const O1=e=>e.key||"";function MC(e){const t=[];return k.Children.forEach(e,n=>{k.isValidElement(n)&&t.push(n)}),t}const k0e=({children:e,custom:t,initial:n=!0,onExitComplete:o,presenceAffectsLayout:i=!0,mode:r="sync",propagate:s=!1,anchorX:d="left",root:l})=>{const[h,u]=m$(s),p=k.useMemo(()=>MC(e),[e]),y=s&&!h?[]:p.map(O1),m=k.useRef(!0),g=k.useRef(p),f=$t(()=>new Map),[M,_]=k.useState(p),[v,I]=k.useState(p);rw(()=>{m.current=!1,g.current=p;for(let w=0;w<v.length;w++){const L=O1(v[w]);y.includes(L)?f.delete(L):f.get(L)!==!0&&f.set(L,!1)}},[v,y.length,y.join("-")]);const C=[];if(p!==M){let w=[...p];for(let L=0;L<v.length;L++){const x=v[L],S=O1(x);y.includes(S)||(w.splice(L,0,x),C.push(x))}return r==="wait"&&C.length&&(w=C),I(MC(w)),_(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:b}=k.useContext(cw);return c.jsx(c.Fragment,{children:v.map(w=>{const L=O1(w),x=s&&!h?!1:p===v||y.includes(L),S=()=>{if(f.has(L))f.set(L,!0);else return;let j=!0;f.forEach($=>{$||(j=!1)}),j&&(b?.(),I(g.current),s&&u?.(),o&&o())};return c.jsx(p0e,{isPresent:x,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:r,root:l,onExitComplete:x?void 0:S,anchorX:d,children:w},L)})})},f$=k.createContext({strict:!1}),_C={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"]},Wc={};for(const e in _C)Wc[e]={isEnabled:t=>_C[e].some(n=>!!t[n])};function m0e(e){for(const t in e)Wc[t]={...Wc[t],...e[t]}}const f0e=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 nL(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||f0e.has(e)}let g$=e=>!nL(e);function g0e(e){typeof e=="function"&&(g$=t=>t.startsWith("on")?!nL(t):e(t))}try{g0e(require("@emotion/is-prop-valid").default)}catch{}function v0e(e,t,n){const o={};for(const i in e)i==="values"&&typeof e.values=="object"||(g$(i)||n===!0&&nL(i)||!t&&!nL(i)||e.draggable&&i.startsWith("onDrag"))&&(o[i]=e[i]);return o}const hL=k.createContext({});function uL(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function $1(e){return typeof e=="string"||Array.isArray(e)}const Sw=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],jw=["initial",...Sw];function pL(e){return uL(e.animate)||jw.some(t=>$1(e[t]))}function v$(e){return!!(pL(e)||e.variants)}function M0e(e,t){if(pL(e)){const{initial:n,animate:o}=e;return{initial:n===!1||$1(n)?n:void 0,animate:$1(o)?o:void 0}}return e.inherit!==!1?t:{}}function _0e(e){const{initial:t,animate:n}=M0e(e,k.useContext(hL));return k.useMemo(()=>({initial:t,animate:n}),[xC(t),xC(n)])}function xC(e){return Array.isArray(e)?e.join(" "):e}const q1={};function x0e(e){for(const t in e)q1[t]=e[t],kw(t)&&(q1[t].isCSSVariable=!0)}function M$(e,{layout:t,layoutId:n}){return Xc.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!q1[e]||e==="opacity")}const L0e={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},I0e=Kc.length;function b0e(e,t,n){let o="",i=!0;for(let r=0;r<I0e;r++){const s=Kc[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=l$(d,ww[s]);if(!l){i=!1;const u=L0e[s]||s;o+=`${u}(${h}) `}n&&(t[s]=h)}}return o=o.trim(),n?o=n(t,i?"":o):i&&(o="none"),o}function $w(e,t,n){const{style:o,vars:i,transformOrigin:r}=e;let s=!1,d=!1;for(const l in t){const h=t[l];if(Xc.has(l)){s=!0;continue}else if(kw(l)){i[l]=h;continue}else{const u=l$(h,ww[l]);l.startsWith("origin")?(d=!0,r[l]=u):o[l]=u}}if(t.transform||(s||n?o.transform=b0e(t,e.transform,n):o.transform&&(o.transform="none")),d){const{originX:l="50%",originY:h="50%",originZ:u=0}=r;o.transformOrigin=`${l} ${h} ${u}`}}const qw=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function _$(e,t,n){for(const o in t)!Le(t[o])&&!M$(o,n)&&(e[o]=t[o])}function w0e({transformTemplate:e},t){return k.useMemo(()=>{const n=qw();return $w(n,t,e),Object.assign({},n.vars,n.style)},[t])}function C0e(e,t){const n=e.style||{},o={};return _$(o,n,e),Object.assign(o,w0e(e,t)),o}function N0e(e,t){const n={},o=C0e(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.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=o,n}const S0e={offset:"stroke-dashoffset",array:"stroke-dasharray"},j0e={offset:"strokeDashoffset",array:"strokeDasharray"};function $0e(e,t,n=1,o=0,i=!0){e.pathLength=1;const r=i?S0e:j0e;e[r.offset]=O.transform(-o);const s=O.transform(t),d=O.transform(n);e[r.array]=`${s} ${d}`}function x$(e,{attrX:t,attrY:n,attrScale:o,pathLength:i,pathSpacing:r=1,pathOffset:s=0,...d},l,h,u){if($w(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),o!==void 0&&(p.scale=o),i!==void 0&&$0e(p,i,r,s,!1)}const L$=()=>({...qw(),attrs:{}}),I$=e=>typeof e=="string"&&e.toLowerCase()==="svg";function q0e(e,t,n,o){const i=k.useMemo(()=>{const r=L$();return x$(r,t,I$(o),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 A0e=["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 Aw(e){return typeof e!="string"||e.includes("-")?!1:!!(A0e.indexOf(e)>-1||/[A-Z]/u.test(e))}function z0e(e,t,n,{latestValues:o},i,r=!1){const d=(Aw(e)?q0e:N0e)(t,o,i,e),l=v0e(t,typeof e=="string",r),h=e!==k.Fragment?{...l,...d,ref:n}:{},{children:u}=t,p=k.useMemo(()=>Le(u)?u.get():u,[u]);return k.createElement(e,{...h,children:p})}function LC(e){const t=[{},{}];return e?.values.forEach((n,o)=>{t[0][o]=n.get(),t[1][o]=n.getVelocity()}),t}function zw(e,t,n,o){if(typeof t=="function"){const[i,r]=LC(o);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]=LC(o);t=t(n!==void 0?n:e.custom,i,r)}return t}function Zx(e){return Le(e)?e.get():e}function V0e({scrapeMotionValuesFromProps:e,createRenderState:t},n,o,i){return{latestValues:P0e(n,o,i,e),renderState:t()}}function P0e(e,t,n,o){const i={},r=o(e,{});for(const y in r)i[y]=Zx(r[y]);let{initial:s,animate:d}=e;const l=pL(e),h=v$(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"&&!uL(p)){const y=Array.isArray(p)?p:[p];for(let m=0;m<y.length;m++){const g=zw(e,y[m]);if(g){const{transitionEnd:f,transition:M,..._}=g;for(const v in _){let I=_[v];if(Array.isArray(I)){const C=u?I.length-1:0;I=I[C]}I!==null&&(i[v]=I)}for(const v in f)i[v]=f[v]}}}return i}const b$=e=>(t,n)=>{const o=k.useContext(hL),i=k.useContext(dL),r=()=>V0e(e,t,o,i);return n?r():$t(r)};function Vw(e,t,n){const{style:o}=e,i={};for(const r in o)(Le(o[r])||t.style&&Le(t.style[r])||M$(r,e)||n?.getValue(r)?.liveStyle!==void 0)&&(i[r]=o[r]);return i}const T0e=b$({scrapeMotionValuesFromProps:Vw,createRenderState:qw});function w$(e,t,n){const o=Vw(e,t,n);for(const i in e)if(Le(e[i])||Le(t[i])){const r=Kc.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;o[r]=e[i]}return o}const H0e=b$({scrapeMotionValuesFromProps:w$,createRenderState:L$}),D0e=Symbol.for("motionComponentSymbol");function Tc(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function B0e(e,t,n){return k.useCallback(o=>{o&&e.onMount&&e.onMount(o),t&&(o?t.mount(o):t.unmount()),n&&(typeof n=="function"?n(o):Tc(n)&&(n.current=o))},[t])}const Pw=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),R0e="framerAppearId",C$="data-"+Pw(R0e),N$=k.createContext({});function F0e(e,t,n,o,i){const{visualElement:r}=k.useContext(hL),s=k.useContext(f$),d=k.useContext(dL),l=k.useContext(lL).reducedMotion,h=k.useRef(null);o=o||s.renderer,!h.current&&o&&(h.current=o(e,{visualState:t,parent:r,props:n,presenceContext:d,blockInitialAnimation:d?d.initial===!1:!1,reducedMotionConfig:l}));const u=h.current,p=k.useContext(N$);u&&!u.projection&&i&&(u.type==="html"||u.type==="svg")&&E0e(h.current,n,i,p);const y=k.useRef(!1);k.useInsertionEffect(()=>{u&&y.current&&u.update(n,d)});const m=n[C$],g=k.useRef(!!m&&!window.MotionHandoffIsComplete?.(m)&&window.MotionHasOptimisedAnimation?.(m));return rw(()=>{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 E0e(e,t,n,o){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:S$(e.parent)),e.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:!!s||d&&Tc(d),visualElement:e,animationType:typeof r=="string"?r:"both",initialPromotionConfig:o,crossfade:u,layoutScroll:l,layoutRoot:h})}function S$(e){if(e)return e.options.allowProjection!==!1?e.projection:S$(e.parent)}function HL(e,{forwardMotionProps:t=!1}={},n,o){n&&m0e(n);const i=Aw(e)?H0e:T0e;function r(d,l){let h;const u={...k.useContext(lL),...d,layoutId:O0e(d)},{isStatic:p}=u,y=_0e(d),m=i(d,p);if(!p&&iw){U0e(u,n);const g=W0e(u);h=g.MeasureLayout,y.visualElement=F0e(e,m,u,o,g.ProjectionNode)}return c.jsxs(hL.Provider,{value:y,children:[h&&y.visualElement?c.jsx(h,{visualElement:y.visualElement,...u}):null,z0e(e,d,B0e(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[D0e]=e,s}function O0e({layoutId:e}){const t=k.useContext(cw).id;return t&&e!==void 0?t+"-"+e:e}function U0e(e,t){const n=k.useContext(f$).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const o="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?Gc(!1,o,"lazy-strict-mode"):Xe(!1,o,"lazy-strict-mode")}}function W0e(e){const{drag:t,layout:n}=Wc;if(!t&&!n)return{};const o={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function G0e(e,t){if(typeof Proxy>"u")return HL;const n=new Map,o=(r,s)=>HL(r,s,e,t),i=(r,s)=>(process.env.NODE_ENV!=="production"&&uw(!1,"motion() is deprecated. Use motion.create() instead."),o(r,s));return new Proxy(i,{get:(r,s)=>s==="create"?o:(n.has(s)||n.set(s,HL(s,void 0,e,t)),n.get(s))})}function j$({top:e,left:t,right:n,bottom:o}){return{x:{min:t,max:n},y:{min:e,max:o}}}function Z0e({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function K0e(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),o=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:o.y,right:o.x}}function DL(e){return e===void 0||e===1}function Zb({scale:e,scaleX:t,scaleY:n}){return!DL(e)||!DL(t)||!DL(n)}function Mc(e){return Zb(e)||$$(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function $$(e){return IC(e.x)||IC(e.y)}function IC(e){return e&&e!=="0%"}function oL(e,t,n){const o=e-n,i=t*o;return n+i}function bC(e,t,n,o,i){return i!==void 0&&(e=oL(e,i,o)),oL(e,n,o)+t}function Kb(e,t=0,n=1,o,i){e.min=bC(e.min,t,n,o,i),e.max=bC(e.max,t,n,o,i)}function q$(e,{x:t,y:n}){Kb(e.x,t.translate,t.scale,t.originPoint),Kb(e.y,n.translate,n.scale,n.originPoint)}const wC=.999999999999,CC=1.0000000000001;function X0e(e,t,n,o=!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"||(o&&r.options.layoutScroll&&r.scroll&&r!==r.root&&Dc(e,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,q$(e,s)),o&&Mc(r.latestValues)&&Dc(e,r.latestValues))}t.x<CC&&t.x>wC&&(t.x=1),t.y<CC&&t.y>wC&&(t.y=1)}function Hc(e,t){e.min=e.min+t,e.max=e.max+t}function NC(e,t,n,o,i=.5){const r=ie(e.min,e.max,i);Kb(e,t,n,r,o)}function Dc(e,t){NC(e.x,t.x,t.scaleX,t.scale,t.originX),NC(e.y,t.y,t.scaleY,t.scale,t.originY)}function A$(e,t){return j$(K0e(e.getBoundingClientRect(),t))}function Y0e(e,t,n){const o=A$(e,n),{scroll:i}=t;return i&&(Hc(o.x,i.offset.x),Hc(o.y,i.offset.y)),o}const SC=()=>({translate:0,scale:1,origin:0,originPoint:0}),Bc=()=>({x:SC(),y:SC()}),jC=()=>({min:0,max:0}),pe=()=>({x:jC(),y:jC()}),Xb={current:null},z$={current:!1};function J0e(){if(z$.current=!0,!!iw)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Xb.current=e.matches;e.addEventListener("change",t),t()}else Xb.current=!1}const Q0e=new WeakMap;function ele(e,t,n){for(const o in t){const i=t[o],r=n[o];if(Le(i))e.addValue(o,i);else if(Le(r))e.addValue(o,Cc(i,{owner:e}));else if(r!==i)if(e.hasValue(o)){const s=e.getValue(o);s.liveStyle===!0?s.jump(i):s.hasAnimated||s.set(i)}else{const s=e.getStaticValue(o);e.addValue(o,Cc(s!==void 0?s:i,{owner:e}))}}for(const o in n)t[o]===void 0&&e.removeValue(o);return t}const $C=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class tle{scrapeMotionValuesFromProps(t,n,o){return{}}constructor({parent:t,props:n,presenceContext:o,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=Iw,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=ze.now();this.renderScheduledAt<y&&(this.renderScheduledAt=y,oe.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=o,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=d,this.blockInitialAnimation=!!r,this.isControllingVariants=pL(n),this.isVariantNode=v$(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&&Le(m)&&m.set(l[y])}}mount(t){this.current=t,Q0e.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,o)=>this.bindToMotionValue(o,n)),z$.current||J0e(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Xb.current,process.env.NODE_ENV!=="production"&&uw(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(),kt(this.notifyUpdate),kt(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 o=Xc.has(t);o&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&oe.preRender(this.notifyUpdate),o&&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 Wc){const n=Wc[t];if(!n)continue;const{isEnabled:o,Feature:i}=n;if(!this.features[t]&&i&&o(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):pe()}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 o=0;o<$C.length;o++){const i=$C[o];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=ele(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 o=this.values.get(t);n!==o&&(o&&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 o=this.values.get(t);return o===void 0&&n!==void 0&&(o=Cc(n===null?void 0:n,{owner:this}),this.addValue(t,o)),o}readValue(t,n){let o=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return o!=null&&(typeof o=="string"&&(bj(o)||Cj(o))?o=parseFloat(o):!s0e(o)&&jt.test(n)&&(o=d$(t,n)),this.setBaseTarget(t,Le(o)?o.get():o)),Le(o)?o.get():o}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let o;if(typeof n=="string"||typeof n=="object"){const r=zw(this.props,n,this.presenceContext?.custom);r&&(o=r[t])}if(n&&o!==void 0)return o;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!Le(i)?i:this.initialValues[t]!==void 0&&o===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new hw),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Cw.render(this.render)}}class V$ extends tle{constructor(){super(...arguments),this.KeyframeResolver=Kde}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:o}){delete n[t],delete o[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Le(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function P$(e,{style:t,vars:n},o,i){const r=e.style;let s;for(s in t)r[s]=t[s];i?.applyProjectionStyles(r,o);for(s in n)r.setProperty(s,n[s])}function ale(e){return window.getComputedStyle(e)}class nle extends V${constructor(){super(...arguments),this.type="html",this.renderInstance=P$}readValueFromInstance(t,n){if(Xc.has(n))return this.projection?.isProjecting?Rb(n):pde(t,n);{const o=ale(t),i=(kw(n)?o.getPropertyValue(n):o[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return A$(t,n)}build(t,n,o){$w(t,n,o.transformTemplate)}scrapeMotionValuesFromProps(t,n,o){return Vw(t,n,o)}}const T$=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 ole(e,t,n,o){P$(e,t,void 0,o);for(const i in t.attrs)e.setAttribute(T$.has(i)?i:Pw(i),t.attrs[i])}class cle extends V${constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=pe}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Xc.has(n)){const o=s$(n);return o&&o.default||0}return n=T$.has(n)?n:Pw(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,o){return w$(t,n,o)}build(t,n,o){x$(t,n,this.isSVGTag,o.transformTemplate,o.style)}renderInstance(t,n,o,i){ole(t,n,o,i)}mount(t){this.isSVGTag=I$(t.tagName),super.mount(t)}}const ile=(e,t)=>Aw(e)?new cle(t):new nle(t,{allowProjection:e!==k.Fragment});function Uc(e,t,n){const o=e.getProps();return zw(o,t,n!==void 0?n:o.custom,e)}const Yb=e=>Array.isArray(e);function rle(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Cc(n))}function sle(e){return Yb(e)?e[e.length-1]||0:e}function dle(e,t){const n=Uc(e,t);let{transitionEnd:o={},transition:i={},...r}=n||{};r={...r,...o};for(const s in r){const d=sle(r[s]);rle(e,s,d)}}function lle(e){return!!(Le(e)&&e.add)}function Jb(e,t){const n=e.getValue("willChange");if(lle(n))return n.add(t);if(!n&&yt.WillChange){const o=new yt.WillChange("auto");e.addValue("willChange",o),o.add(t)}}function H$(e){return e.props[C$]}const hle=e=>e!==null;function ule(e,{repeat:t,repeatType:n="loop"},o){const i=e.filter(hle),r=t&&n!=="loop"&&t%2===1?0:i.length-1;return i[r]}const ple={type:"spring",stiffness:500,damping:25,restSpeed:10},yle=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),kle={type:"keyframes",duration:.8},mle={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},fle=(e,{keyframes:t})=>t.length>2?kle:Xc.has(e)?e.startsWith("scale")?yle(t[1]):ple:mle;function gle({when:e,delay:t,delayChildren:n,staggerChildren:o,staggerDirection:i,repeat:r,repeatType:s,repeatDelay:d,from:l,elapsed:h,...u}){return!!Object.keys(u).length}const Tw=(e,t,n,o={},i,r)=>s=>{const d=bw(o,e)||{},l=d.delay||o.delay||0;let{elapsed:h=0}=o;h=h-Ke(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};gle(d)||Object.assign(u,fle(e,u)),u.duration&&(u.duration=Ke(u.duration)),u.repeatDelay&&(u.repeatDelay=Ke(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let p=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Wb(u),u.delay===0&&(p=!0)),(yt.instantAnimations||yt.skipAnimations)&&(p=!0,Wb(u),u.delay=0),u.allowFlatten=!d.type&&!d.ease,p&&!r&&t.get()!==void 0){const y=ule(u.keyframes,d);if(y!==void 0){oe.update(()=>{u.onUpdate(y),u.onComplete()});return}}return d.isSync?new Lw(u):new Pde(u)};function vle({protectedKeys:e,needsAnimating:t},n){const o=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,o}function D$(e,t,{delay:n=0,transitionOverride:o,type:i}={}){let{transition:r=e.getDefaultTransition(),transitionEnd:s,...d}=t;o&&(r=o);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&&vle(h,u))continue;const m={delay:n,...bw(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 _=H$(e);if(_){const v=window.MotionHandoffAnimation(_,u,oe);v!==null&&(m.startTime=v,f=!0)}}Jb(e,u),p.start(Tw(u,p,y,e.shouldReduceMotion&&c$.has(u)?{type:!1}:m,e,f));const M=p.animation;M&&l.push(M)}return s&&Promise.all(l).then(()=>{oe.update(()=>{s&&dle(e,s)})}),l}function B$(e,t,n,o=0,i=1){const r=Array.from(e).sort((h,u)=>h.sortNodePosition(u)).indexOf(t),s=e.size,d=(s-1)*o;return typeof n=="function"?n(r,s):i===1?r*o:d-r*o}function Qb(e,t,n={}){const o=Uc(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(i=n.transitionOverride);const r=o?()=>Promise.all(D$(e,o,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:h=0,staggerChildren:u,staggerDirection:p}=i;return Mle(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 Mle(e,t,n=0,o=0,i=0,r=1,s){const d=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),d.push(Qb(l,t,{...s,delay:n+(typeof o=="function"?0:o)+B$(e.variantChildren,l,o,i,r)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(d)}function _le(e,t,n={}){e.notify("AnimationStart",t);let o;if(Array.isArray(t)){const i=t.map(r=>Qb(e,r,n));o=Promise.all(i)}else if(typeof t=="string")o=Qb(e,t,n);else{const i=typeof t=="function"?Uc(e,t,n.custom):t;o=Promise.all(D$(e,i,n))}return o.then(()=>{e.notify("AnimationComplete",t)})}function R$(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let o=0;o<n;o++)if(t[o]!==e[o])return!1;return!0}const xle=jw.length;function F$(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?F$(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<xle;n++){const o=jw[n],i=e.props[o];($1(i)||i===!1)&&(t[o]=i)}return t}const Lle=[...Sw].reverse(),Ile=Sw.length;function ble(e){return t=>Promise.all(t.map(({animation:n,options:o})=>_le(e,n,o)))}function wle(e){let t=ble(e),n=qC(),o=!0;const i=l=>(h,u)=>{const p=Uc(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=F$(e.parent)||{},p=[],y=new Set;let m={},g=1/0;for(let M=0;M<Ile;M++){const _=Lle[M],v=n[_],I=h[_]!==void 0?h[_]:u[_],C=$1(I),b=_===l?v.isActive:null;b===!1&&(g=M);let w=I===u[_]&&I!==h[_]&&C;if(w&&o&&e.manuallyAnimateOnMount&&(w=!1),v.protectedKeys={...m},!v.isActive&&b===null||!I&&!v.prevProp||uL(I)||typeof I=="boolean")continue;const L=Cle(v.prevProp,I);let x=L||_===l&&v.isActive&&!w&&C||M>g&&C,S=!1;const j=Array.isArray(I)?I:[I];let $=j.reduce(i(_),{});b===!1&&($={});const{prevResolvedValues:q={}}=v,H={...q,...$},P=V=>{x=!0,y.has(V)&&(S=!0,y.delete(V)),v.needsAnimating[V]=!0;const T=e.getValue(V);T&&(T.liveStyle=!1)};for(const V in H){const T=$[V],R=q[V];if(m.hasOwnProperty(V))continue;let B=!1;Yb(T)&&Yb(R)?B=!R$(T,R):B=T!==R,B?T!=null?P(V):y.add(V):T!==void 0&&y.has(V)?P(V):v.protectedKeys[V]=!0}v.prevProp=I,v.prevResolvedValues=$,v.isActive&&(m={...m,...$}),o&&e.blockInitialAnimation&&(x=!1);const A=w&&L;x&&(!A||S)&&p.push(...j.map(V=>{const T={type:_};if(typeof V=="string"&&o&&!A&&e.manuallyAnimateOnMount&&e.parent){const{parent:R}=e,B=Uc(R,V);if(R.enteringChildren&&B){const{delayChildren:F}=B.transition||{};T.delay=B$(R.enteringChildren,e,F)}}return{animation:V,options:T}}))}if(y.size){const M={};if(typeof h.initial!="boolean"){const _=Uc(e,Array.isArray(h.initial)?h.initial[0]:h.initial);_&&_.transition&&(M.transition=_.transition)}y.forEach(_=>{const v=e.getBaseTarget(_),I=e.getValue(_);I&&(I.liveStyle=!0),M[_]=v??null}),p.push({animation:M})}let f=!!p.length;return o&&(h.initial===!1||h.initial===h.animate)&&!e.manuallyAnimateOnMount&&(f=!1),o=!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=qC()}}}function Cle(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!R$(t,e):!1}function Vt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function qC(){return{animate:Vt(!0),whileInView:Vt(),whileHover:Vt(),whileTap:Vt(),whileDrag:Vt(),whileFocus:Vt(),exit:Vt()}}class qt{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Nle extends qt{constructor(t){super(t),t.animationState||(t.animationState=wle(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();uL(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 Sle=0;class jle extends qt{constructor(){super(...arguments),this.id=Sle++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===o)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 $le={animation:{Feature:Nle},exit:{Feature:jle}};function A1(e,t,n,o={passive:!0}){return e.addEventListener(t,n,o),()=>e.removeEventListener(t,n)}function H1(e){return{point:{x:e.pageX,y:e.pageY}}}const qle=e=>t=>Nw(t)&&e(t,H1(t));function I1(e,t,n,o){return A1(e,t,qle(n),o)}const E$=1e-4,Ale=1-E$,zle=1+E$,O$=.01,Vle=0-O$,Ple=0+O$;function Se(e){return e.max-e.min}function Tle(e,t,n){return Math.abs(e-t)<=n}function AC(e,t,n,o=.5){e.origin=o,e.originPoint=ie(t.min,t.max,e.origin),e.scale=Se(n)/Se(t),e.translate=ie(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Ale&&e.scale<=zle||isNaN(e.scale))&&(e.scale=1),(e.translate>=Vle&&e.translate<=Ple||isNaN(e.translate))&&(e.translate=0)}function b1(e,t,n,o){AC(e.x,t.x,n.x,o?o.originX:void 0),AC(e.y,t.y,n.y,o?o.originY:void 0)}function zC(e,t,n){e.min=n.min+t.min,e.max=e.min+Se(t)}function Hle(e,t,n){zC(e.x,t.x,n.x),zC(e.y,t.y,n.y)}function VC(e,t,n){e.min=t.min-n.min,e.max=e.min+Se(t)}function w1(e,t,n){VC(e.x,t.x,n.x),VC(e.y,t.y,n.y)}function Re(e){return[e("x"),e("y")]}const U$=({current:e})=>e?e.ownerDocument.defaultView:null,PC=(e,t)=>Math.abs(e-t);function Dle(e,t){const n=PC(e.x,t.x),o=PC(e.y,t.y);return Math.sqrt(n**2+o**2)}class W${constructor(t,n,{transformPagePoint:o,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=RL(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,g=Dle(y.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!g)return;const{point:f}=y,{timestamp:M}=xe;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=BL(m,this.transformPagePoint),oe.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 _=RL(y.type==="pointercancel"?this.lastMoveEventInfo:BL(m,this.transformPagePoint),this.history);this.startEvent&&g&&g(y,_),f&&f(y,_)},!Nw(t))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=o,this.distanceThreshold=s,this.contextWindow=i||window;const d=H1(t),l=BL(d,this.transformPagePoint),{point:h}=l,{timestamp:u}=xe;this.history=[{...h,timestamp:u}];const{onSessionStart:p}=n;p&&p(t,RL(l,this.history)),this.removeListeners=V1(I1(this.contextWindow,"pointermove",this.handlePointerMove),I1(this.contextWindow,"pointerup",this.handlePointerUp),I1(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),kt(this.updatePoint)}}function BL(e,t){return t?{point:t(e.point)}:e}function TC(e,t){return{x:e.x-t.x,y:e.y-t.y}}function RL({point:e},t){return{point:e,delta:TC(e,G$(t)),offset:TC(e,Ble(t)),velocity:Rle(t,.1)}}function Ble(e){return e[0]}function G$(e){return e[e.length-1]}function Rle(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,o=null;const i=G$(e);for(;n>=0&&(o=e[n],!(i.timestamp-o.timestamp>Ke(t)));)n--;if(!o)return{x:0,y:0};const r=Ee(i.timestamp-o.timestamp);if(r===0)return{x:0,y:0};const s={x:(i.x-o.x)/r,y:(i.y-o.y)/r};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function Fle(e,{min:t,max:n},o){return t!==void 0&&e<t?e=o?ie(t,e,o.min):Math.max(e,t):n!==void 0&&e>n&&(e=o?ie(n,e,o.max):Math.min(e,n)),e}function HC(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 Ele(e,{top:t,left:n,bottom:o,right:i}){return{x:HC(e.x,n,i),y:HC(e.y,t,o)}}function DC(e,t){let n=t.min-e.min,o=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,o]=[o,n]),{min:n,max:o}}function Ole(e,t){return{x:DC(e.x,t.x),y:DC(e.y,t.y)}}function Ule(e,t){let n=.5;const o=Se(e),i=Se(t);return i>o?n=N1(t.min,t.max-o,e.min):o>i&&(n=N1(e.min,e.max-i,t.min)),pt(0,1,n)}function Wle(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 ew=.35;function Gle(e=ew){return e===!1?e=0:e===!0&&(e=ew),{x:BC(e,"left","right"),y:BC(e,"top","bottom")}}function BC(e,t,n){return{min:RC(e,t),max:RC(e,n)}}function RC(e,t){return typeof e=="number"?e:e[t]||0}const Zle=new WeakMap;class Kle{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=pe(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:o}={}){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(H1(p).point)},s=(p,y)=>{const{drag:m,dragPropagation:g,onDragStart:f}=this.getProps();if(m&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Qde(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),Re(_=>{let v=this.getAxisMotionValue(_).get()||0;if(ct.test(v)){const{projection:I}=this.visualElement;if(I&&I.layout){const C=I.layout.layoutBox[_];C&&(v=Se(C)*(parseFloat(v)/100))}}this.originPoint[_]=v}),f&&oe.postRender(()=>f(p,y)),Jb(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=Xle(_),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=()=>Re(p=>this.getAnimationState(p)==="paused"&&this.getAxisMotionValue(p).animation?.play()),{dragSnapToOrigin:u}=this.getProps();this.panSession=new W$(t,{onSessionStart:r,onStart:s,onMove:d,onSessionEnd:l,resumeAnimation:h},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:o,contextWindow:U$(this.visualElement)})}stop(t,n){const o=t||this.latestPointerEvent,i=n||this.latestPanInfo,r=this.isDragging;if(this.cancel(),!r||!i||!o)return;const{velocity:s}=i;this.startAnimation(s);const{onDragEnd:d}=this.getProps();d&&oe.postRender(()=>d(o,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:o}=this.getProps();!o&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,o){const{drag:i}=this.getProps();if(!o||!U1(t,i,this.currentDirection))return;const r=this.getAxisMotionValue(t);let s=this.originPoint[t]+o[t];this.constraints&&this.constraints[t]&&(s=Fle(s,this.constraints[t],this.elastic[t])),r.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),o=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;t&&Tc(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&o?this.constraints=Ele(o.layoutBox,t):this.constraints=!1,this.elastic=Gle(n),i!==this.constraints&&o&&this.constraints&&!this.hasMutatedConstraints&&Re(r=>{this.constraints!==!1&&this.getAxisMotionValue(r)&&(this.constraints[r]=Wle(o.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Tc(t))return!1;const o=t.current;Xe(o!==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=Y0e(o,i.root,this.visualElement.getTransformPagePoint());let s=Ole(i.layout.layoutBox,r);if(n){const d=n(Z0e(s));this.hasMutatedConstraints=!!d,d&&(s=j$(d))}return s}startAnimation(t){const{drag:n,dragMomentum:o,dragElastic:i,dragTransition:r,dragSnapToOrigin:s,onDragTransitionEnd:d}=this.getProps(),l=this.constraints||{},h=Re(u=>{if(!U1(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:o?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 o=this.getAxisMotionValue(t);return Jb(this.visualElement,t),o.start(Tw(t,o,0,n,this.visualElement,!1))}stopAnimation(){Re(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Re(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,o=this.visualElement.getProps(),i=o[n];return i||this.visualElement.getValue(t,(o.initial?o.initial[t]:void 0)||0)}snapToCursor(t){Re(n=>{const{drag:o}=this.getProps();if(!U1(n,o,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]-ie(s,d,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:o}=this.visualElement;if(!Tc(n)||!o||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Re(s=>{const d=this.getAxisMotionValue(s);if(d&&this.constraints!==!1){const l=d.get();i[s]=Ule({min:l,max:l},this.constraints[s])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",o.root&&o.root.updateScroll(),o.updateLayout(),this.resolveConstraints(),Re(s=>{if(!U1(s,t,null))return;const d=this.getAxisMotionValue(s),{min:l,max:h}=this.constraints[s];d.set(ie(l,h,i[s]))})}addListeners(){if(!this.visualElement.current)return;Zle.set(this.visualElement,this);const t=this.visualElement.current,n=I1(t,"pointerdown",l=>{const{drag:h,dragListener:u=!0}=this.getProps();h&&u&&this.start(l)}),o=()=>{const{dragConstraints:l}=this.getProps();Tc(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,r=i.addEventListener("measure",o);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),oe.read(o);const s=A1(window,"resize",()=>this.scalePositionWithinConstraints()),d=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:h})=>{this.isDragging&&h&&(Re(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:o=!1,dragPropagation:i=!1,dragConstraints:r=!1,dragElastic:s=ew,dragMomentum:d=!0}=t;return{...t,drag:n,dragDirectionLock:o,dragPropagation:i,dragConstraints:r,dragElastic:s,dragMomentum:d}}}function U1(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Xle(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Yle extends qt{constructor(t){super(t),this.removeGroupControls=Oe,this.removeListeners=Oe,this.controls=new Kle(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Oe}unmount(){this.removeGroupControls(),this.removeListeners()}}const FC=e=>(t,n)=>{e&&oe.postRender(()=>e(t,n))};class Jle extends qt{constructor(){super(...arguments),this.removePointerDownListener=Oe}onPointerDown(t){this.session=new W$(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:U$(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:o,onPanEnd:i}=this.node.getProps();return{onSessionStart:FC(t),onStart:FC(n),onMove:o,onEnd:(r,s)=>{delete this.session,i&&oe.postRender(()=>i(r,s))}}}mount(){this.removePointerDownListener=I1(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 Kx={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function EC(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const t1={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(O.test(e))e=parseFloat(e);else return e;const n=EC(e,t.target.x),o=EC(e,t.target.y);return`${n}% ${o}%`}},Qle={correct:(e,{treeScale:t,projectionDelta:n})=>{const o=e,i=jt.parse(e);if(i.length>5)return o;const r=jt.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=ie(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 FL=!1;class ehe extends k.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:o,layoutId:i}=this.props,{projection:r}=t;x0e(the),r&&(n.group&&n.group.add(r),o&&o.register&&i&&o.register(r),FL&&r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,onExitComplete:()=>this.safeToRemove()})),Kx.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:o,drag:i,isPresent:r}=this.props,{projection:s}=o;return s&&(s.isPresent=r,FL=!0,i||t.layoutDependency!==n||n===void 0||t.isPresent!==r?s.willUpdate():this.safeToRemove(),t.isPresent!==r&&(r?s.promote():s.relegate()||oe.postRender(()=>{const d=s.getStack();(!d||!d.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Cw.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:o}=this.props,{projection:i}=t;FL=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),o&&o.deregister&&o.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Z$(e){const[t,n]=m$(),o=k.useContext(cw);return c.jsx(ehe,{...e,layoutGroup:o,switchLayoutGroup:k.useContext(N$),isPresent:t,safeToRemove:n})}const the={borderRadius:{...t1,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:t1,borderTopRightRadius:t1,borderBottomLeftRadius:t1,borderBottomRightRadius:t1,boxShadow:Qle};function ahe(e,t,n){const o=Le(e)?e:Cc(e);return o.start(Tw("",o,t,n)),o.animation}const nhe=(e,t)=>e.depth-t.depth;class ohe{constructor(){this.children=[],this.isDirty=!1}add(t){sw(this.children,t),this.isDirty=!0}remove(t){dw(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(nhe),this.isDirty=!1,this.children.forEach(t)}}function che(e,t){const n=ze.now(),o=({timestamp:i})=>{const r=i-n;r>=t&&(kt(o),e(r-t))};return oe.setup(o,!0),()=>kt(o)}const K$=["TopLeft","TopRight","BottomLeft","BottomRight"],ihe=K$.length,OC=e=>typeof e=="string"?parseFloat(e):e,UC=e=>typeof e=="number"||O.test(e);function rhe(e,t,n,o,i,r){i?(e.opacity=ie(0,n.opacity??1,she(o)),e.opacityExit=ie(t.opacity??1,0,dhe(o))):r&&(e.opacity=ie(t.opacity??1,n.opacity??1,o));for(let s=0;s<ihe;s++){const d=`border${K$[s]}Radius`;let l=WC(t,d),h=WC(n,d);if(l===void 0&&h===void 0)continue;l||(l=0),h||(h=0),l===0||h===0||UC(l)===UC(h)?(e[d]=Math.max(ie(OC(l),OC(h),o),0),(ct.test(h)||ct.test(l))&&(e[d]+="%")):e[d]=h}(t.rotate||n.rotate)&&(e.rotate=ie(t.rotate||0,n.rotate||0,o))}function WC(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const she=X$(0,.5,Vj),dhe=X$(.5,.95,Oe);function X$(e,t,n){return o=>o<e?0:o>t?1:n(N1(e,t,o))}function GC(e,t){e.min=t.min,e.max=t.max}function He(e,t){GC(e.x,t.x),GC(e.y,t.y)}function ZC(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function KC(e,t,n,o,i){return e-=t,e=oL(e,1/n,o),i!==void 0&&(e=oL(e,1/i,o)),e}function lhe(e,t=0,n=1,o=.5,i,r=e,s=e){if(ct.test(t)&&(t=parseFloat(t),t=ie(s.min,s.max,t/100)-s.min),typeof t!="number")return;let d=ie(r.min,r.max,o);e===r&&(d-=t),e.min=KC(e.min,t,n,d,i),e.max=KC(e.max,t,n,d,i)}function XC(e,t,[n,o,i],r,s){lhe(e,t[n],t[o],t[i],t.scale,r,s)}const hhe=["x","scaleX","originX"],uhe=["y","scaleY","originY"];function YC(e,t,n,o){XC(e.x,t,hhe,n?n.x:void 0,o?o.x:void 0),XC(e.y,t,uhe,n?n.y:void 0,o?o.y:void 0)}function JC(e){return e.translate===0&&e.scale===1}function Y$(e){return JC(e.x)&&JC(e.y)}function QC(e,t){return e.min===t.min&&e.max===t.max}function phe(e,t){return QC(e.x,t.x)&&QC(e.y,t.y)}function eN(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function J$(e,t){return eN(e.x,t.x)&&eN(e.y,t.y)}function tN(e){return Se(e.x)/Se(e.y)}function aN(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class yhe{constructor(){this.members=[]}add(t){sw(this.members,t),t.scheduleRender()}remove(t){if(dw(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 o;for(let i=n;i>=0;i--){const r=this.members[i];if(r.isPresent!==!1){o=r;break}}return o?(this.promote(o),!0):!1}promote(t,n){const o=this.lead;if(t!==o&&(this.prevLead=o,this.lead=t,t.show(),o)){o.instance&&o.scheduleRender(),t.scheduleRender(),t.resumeFrom=o,n&&(t.resumeFrom.preserveOpacity=!0),o.snapshot&&(t.snapshot=o.snapshot,t.snapshot.latestValues=o.animationValues||o.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&o.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:o}=t;n.onExitComplete&&n.onExitComplete(),o&&o.options.onExitComplete&&o.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function khe(e,t,n){let o="";const i=e.x.translate/t.x,r=e.y.translate/t.y,s=n?.z||0;if((i||r||s)&&(o=`translate3d(${i}px, ${r}px, ${s}px) `),(t.x!==1||t.y!==1)&&(o+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:h,rotate:u,rotateX:p,rotateY:y,skewX:m,skewY:g}=n;h&&(o=`perspective(${h}px) ${o}`),u&&(o+=`rotate(${u}deg) `),p&&(o+=`rotateX(${p}deg) `),y&&(o+=`rotateY(${y}deg) `),m&&(o+=`skewX(${m}deg) `),g&&(o+=`skewY(${g}deg) `)}const d=e.x.scale*t.x,l=e.y.scale*t.y;return(d!==1||l!==1)&&(o+=`scale(${d}, ${l})`),o||"none"}const EL=["","X","Y","Z"],mhe=1e3;let fhe=0;function OL(e,t,n,o){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),o&&(o[e]=0))}function Q$(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=H$(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",oe,!(i||r))}const{parent:o}=e;o&&!o.hasCheckedOptimisedAppear&&Q$(o)}function eq({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:o,resetTransform:i}){return class{constructor(s={},d=t?.()){this.id=fhe++,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(Mhe),this.nodes.forEach(Ihe),this.nodes.forEach(bhe),this.nodes.forEach(_he)},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 ohe)}addEventListener(s,d){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new hw),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=k$(s)&&!c0e(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;oe.read(()=>{p=window.innerWidth}),e(s,()=>{const m=window.innerWidth;m!==p&&(p=m,this.root.updateBlockedByResize=!0,u&&u(),u=che(y,250),Kx.hasAnimatedSinceResize&&(Kx.hasAnimatedSinceResize=!1,this.nodes.forEach(cN)))})}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()||jhe,{onLayoutAnimationStart:f,onLayoutAnimationComplete:M}=h.getProps(),_=!this.targetLayout||!J$(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 I={...bw(g,"layout"),onPlay:f,onComplete:M};(h.shouldReduceMotion||this.options.layoutRoot)&&(I.delay=0,I.type=!1),this.startAnimation(I),this.setAnimationOrigin(u,v)}else p||cN(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(),kt(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(whe),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&&Q$(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(nN);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(oN);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Lhe),this.nodes.forEach(ghe),this.nodes.forEach(vhe)):this.nodes.forEach(oN),this.clearAllSnapshots();const d=ze.now();xe.delta=pt(0,1e3/60,d-xe.timestamp),xe.timestamp=d,xe.isProcessing=!0,qL.update.process(xe),qL.preRender.process(xe),qL.render.process(xe),xe.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Cw.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(xhe),this.sharedNodes.forEach(Che)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,oe.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){oe.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Se(this.snapshot.measuredBox.x)&&!Se(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=pe(),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=o(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&&!Y$(this.projectionDelta),l=this.getTransformTemplate(),h=l?l(this.latestValues,""):void 0,u=h!==this.prevTransformTemplateValue;s&&this.instance&&(d||Mc(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)),$he(l),{animationId:this.root.animationId,measuredBox:d,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:s}=this.options;if(!s)return pe();const d=s.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(qhe))){const{scroll:h}=this.root;h&&(Hc(d.x,h.offset.x),Hc(d.y,h.offset.y))}return d}removeElementScroll(s){const d=pe();if(He(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&&He(d,s),Hc(d.x,u.offset.x),Hc(d.y,u.offset.y))}return d}applyTransform(s,d=!1){const l=pe();He(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&&Dc(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Mc(u.latestValues)&&Dc(l,u.latestValues)}return Mc(this.latestValues)&&Dc(l,this.latestValues),l}removeTransform(s){const d=pe();He(d,s);for(let l=0;l<this.path.length;l++){const h=this.path[l];if(!h.instance||!Mc(h.latestValues))continue;Zb(h.latestValues)&&h.updateSnapshot();const u=pe(),p=h.measurePageBox();He(u,p),YC(d,h.latestValues,h.snapshot?h.snapshot.layoutBox:void 0,u)}return Mc(this.latestValues)&&YC(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!==xe.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=xe.timestamp,!this.targetDelta&&!this.relativeTarget){const y=this.getClosestProjectingParent();y&&y.layout&&this.animationProgress!==1?(this.relativeParent=y,this.forceRelativeParentToResolveTarget(),this.relativeTarget=pe(),this.relativeTargetOrigin=pe(),w1(this.relativeTargetOrigin,this.layout.layoutBox,y.layout.layoutBox),He(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=pe(),this.targetWithTransforms=pe()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Hle(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):He(this.target,this.layout.layoutBox),q$(this.target,this.targetDelta)):He(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=pe(),this.relativeTargetOrigin=pe(),w1(this.relativeTargetOrigin,this.target,y.target),He(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||Zb(this.parent.latestValues)||$$(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===xe.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;He(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,y=this.treeScale.y;X0e(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=pe());const{target:m}=s;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(ZC(this.prevProjectionDelta.x,this.projectionDelta.x),ZC(this.prevProjectionDelta.y,this.projectionDelta.y)),b1(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==y||!aN(this.projectionDelta.x,this.prevProjectionDelta.x)||!aN(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=Bc(),this.projectionDelta=Bc(),this.projectionDeltaWithTransform=Bc()}setAnimationOrigin(s,d=!1){const l=this.snapshot,h=l?l.latestValues:{},u={...this.latestValues},p=Bc();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!d;const y=pe(),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(She));this.animationProgress=0;let I;this.mixTargetDelta=C=>{const b=C/1e3;iN(p.x,s.x,b),iN(p.y,s.y,b),this.setTargetDelta(p),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(w1(y,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Nhe(this.relativeTarget,this.relativeTargetOrigin,y,b),I&&phe(this.relativeTarget,I)&&(this.isProjectionDirty=!1),I||(I=pe()),He(I,this.relativeTarget)),f&&(this.animationValues=u,rhe(u,h,this.latestValues,b,v,_)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=b},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(kt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=oe.update(()=>{Kx.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Cc(0)),this.currentAnimation=ahe(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(mhe),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&&tq(this.options.animationType,this.layout.layoutBox,h.layoutBox)){l=this.target||pe();const p=Se(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+p;const y=Se(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+y}He(d,l),Dc(d,u),b1(this.projectionDeltaWithTransform,this.layoutCorrected,d,u)}}registerSharedNode(s,d){this.sharedNodes.has(s)||this.sharedNodes.set(s,new yhe),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&&OL("z",s,h,this.animationValues);for(let u=0;u<EL.length;u++)OL(`rotate${EL[u]}`,s,h,this.animationValues),OL(`skew${EL[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=Zx(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=Zx(d?.pointerEvents)||""),this.hasProjected&&!Mc(this.latestValues)&&(s.transform=l?l({},""):"none",this.hasProjected=!1);return}s.visibility="";const u=h.animationValues||h.latestValues;this.applyTransformsToTarget();let p=khe(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 q1){if(u[g]===void 0)continue;const{correct:f,applyTo:M,isCSSVariable:_}=q1[g],v=p==="none"?u[g]:f(u[g],h);if(M){const I=M.length;for(let C=0;C<I;C++)s[M[C]]=v}else _?this.options.visualElement.renderState.vars[g]=v:s[g]=v}this.options.layoutId&&(s.pointerEvents=h===this?Zx(d?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>s.currentAnimation?.stop()),this.root.nodes.forEach(nN),this.root.sharedNodes.clear()}}}function ghe(e){e.updateLayout()}function vhe(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:o}=e.layout,{animationType:i}=e.options,r=t.source!==e.layout.source;i==="size"?Re(u=>{const p=r?t.measuredBox[u]:t.layoutBox[u],y=Se(p);p.min=n[u].min,p.max=p.min+y}):tq(i,t.layoutBox,n)&&Re(u=>{const p=r?t.measuredBox[u]:t.layoutBox[u],y=Se(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=Bc();b1(s,n,t.layoutBox);const d=Bc();r?b1(d,e.applyTransform(o,!0),t.measuredBox):b1(d,n,t.layoutBox);const l=!Y$(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=pe();w1(m,t.layoutBox,p.layoutBox);const g=pe();w1(g,n,y.layoutBox),J$(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 Mhe(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 _he(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function xhe(e){e.clearSnapshot()}function nN(e){e.clearMeasurements()}function oN(e){e.isLayoutDirty=!1}function Lhe(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function cN(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Ihe(e){e.resolveTargetDelta()}function bhe(e){e.calcProjection()}function whe(e){e.resetSkewAndRotation()}function Che(e){e.removeLeadSnapshot()}function iN(e,t,n){e.translate=ie(t.translate,0,n),e.scale=ie(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function rN(e,t,n,o){e.min=ie(t.min,n.min,o),e.max=ie(t.max,n.max,o)}function Nhe(e,t,n,o){rN(e.x,t.x,n.x,o),rN(e.y,t.y,n.y,o)}function She(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const jhe={duration:.45,ease:[.4,0,.1,1]},sN=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),dN=sN("applewebkit/")&&!sN("chrome/")?Math.round:Oe;function lN(e){e.min=dN(e.min),e.max=dN(e.max)}function $he(e){lN(e.x),lN(e.y)}function tq(e,t,n){return e==="position"||e==="preserve-aspect"&&!Tle(tN(t),tN(n),.2)}function qhe(e){return e!==e.root&&e.scroll?.wasRoot}const Ahe=eq({attachResizeListener:(e,t)=>A1(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),UL={current:void 0},aq=eq({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!UL.current){const e=new Ahe({});e.mount(window),e.setOptions({layoutScroll:!0}),UL.current=e}return UL.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),zhe={pan:{Feature:Jle},drag:{Feature:Yle,ProjectionNode:aq,MeasureLayout:Z$}};function hN(e,t,n){const{props:o}=e;e.animationState&&o.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,r=o[i];r&&oe.postRender(()=>r(t,H1(t)))}class Vhe extends qt{mount(){const{current:t}=this.node;t&&(this.unmount=e0e(t,(n,o)=>(hN(this.node,o,"Start"),i=>hN(this.node,i,"End"))))}unmount(){}}class Phe extends qt{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=V1(A1(this.node.current,"focus",()=>this.onFocus()),A1(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function uN(e,t,n){const{props:o}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&o.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),r=o[i];r&&oe.postRender(()=>r(t,H1(t)))}class The extends qt{mount(){const{current:t}=this.node;t&&(this.unmount=o0e(t,(n,o)=>(uN(this.node,o,"Start"),(i,{success:r})=>uN(this.node,i,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const tw=new WeakMap,WL=new WeakMap,Hhe=e=>{const t=tw.get(e.target);t&&t(e)},Dhe=e=>{e.forEach(Hhe)};function Bhe({root:e,...t}){const n=e||document;WL.has(n)||WL.set(n,{});const o=WL.get(n),i=JSON.stringify(t);return o[i]||(o[i]=new IntersectionObserver(Dhe,{root:e,...t})),o[i]}function Rhe(e,t,n){const o=Bhe(t);return tw.set(e,n),o.observe(e),()=>{tw.delete(e),o.unobserve(e)}}const Fhe={some:0,all:1};class Ehe extends qt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:o,amount:i="some",once:r}=t,s={root:n?n.current:void 0,rootMargin:o,threshold:typeof i=="number"?i:Fhe[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 Rhe(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(Ohe(t,n))&&this.startObserver()}unmount(){}}function Ohe({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Uhe={inView:{Feature:Ehe},tap:{Feature:The},focus:{Feature:Phe},hover:{Feature:Vhe}},Whe={layout:{ProjectionNode:aq,MeasureLayout:Z$}},Ghe={...$le,...Uhe,...zhe,...Whe},Hw=G0e(Ghe,ile);function nq(e){const t=$t(()=>Cc(e)),{isStatic:n}=k.useContext(lL);if(n){const[,o]=k.useState(e);k.useEffect(()=>t.on("change",o),[])}return t}function oq(e,t){const n=nq(t()),o=()=>n.set(t());return o(),rw(()=>{const i=()=>oe.preRender(o,!1,!0),r=e.map(s=>s.on("change",i));return()=>{r.forEach(s=>s()),kt(o)}}),n}function Zhe(e){L1.current=[],e();const t=oq(L1.current,e);return L1.current=void 0,t}function Khe(e,t,n,o){if(typeof e=="function")return Zhe(e);const i=typeof t=="function"?t:i0e(t,n,o);return Array.isArray(e)?pN(e,i):pN([e],([r])=>i(r))}function pN(e,t){const n=$t(()=>[]);return oq(e,()=>{n.length=0;const o=e.length;for(let i=0;i<o;i++)n[i]=e[i].get();return t(n)})}class Xhe{constructor(){this.componentControls=new Set}subscribe(t){return this.componentControls.add(t),()=>this.componentControls.delete(t)}start(t,n){this.componentControls.forEach(o=>{o.start(t.nativeEvent||t,n)})}cancel(){this.componentControls.forEach(t=>{t.cancel()})}stop(){this.componentControls.forEach(t=>{t.stop()})}}const Yhe=()=>new Xhe;function Jhe(){return $t(Yhe)}const cq=k.createContext(null);function Qhe(e,t,n,o){if(!o)return e;const i=e.findIndex(u=>u.value===t);if(i===-1)return e;const r=o>0?1:-1,s=e[i+r];if(!s)return e;const d=e[i],l=s.layout,h=ie(l.min,l.max,.5);return r===1&&d.layout.max+n>h||r===-1&&d.layout.min+n<h?u2e(e,i,i+r):e}function eue({children:e,as:t="ul",axis:n="y",onReorder:o,values:i,...r},s){const d=$t(()=>Hw[t]),l=[],h=k.useRef(!1);Xe(!!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(nue)},updateOrder:(p,y,m)=>{if(h.current)return;const g=Qhe(l,p,y,m);l!==g&&(h.current=!0,o(g.map(aue).filter(f=>i.indexOf(f)!==-1)))}};return k.useEffect(()=>{h.current=!1}),c.jsx(d,{...r,ref:s,ignoreStrict:!0,children:c.jsx(cq.Provider,{value:u,children:e})})}const tue=k.forwardRef(eue);function aue(e){return e.value}function nue(e,t){return e.layout.min-t.layout.min}function yN(e,t=0){return Le(e)?e:nq(t)}function oue({children:e,style:t={},value:n,as:o="li",onDrag:i,layout:r=!0,...s},d){const l=$t(()=>Hw[o]),h=k.useContext(cq),u={x:yN(t.x),y:yN(t.y)},p=Khe([u.x,u.y],([f,M])=>f||M?1:"unset");Xe(!!h,"Reorder.Item must be a child of Reorder.Group","reorder-item-child");const{axis:y,registerItem:m,updateOrder:g}=h;return c.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 cue=k.forwardRef(oue),cL=[c.jsx(_1,{size:18}),c.jsx(Lt,{size:18}),c.jsx(g1,{size:18}),c.jsx(It,{size:18}),c.jsx(l1,{size:18}),c.jsx(d1,{size:18})],iue=({items:e,onReorder:t,draggable:n=!1,className:o,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=cL[u%cL.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]),c.jsxs("div",{className:`trend-list ${o??""}`,draggable:n,style:{position:"relative"},children:[c.jsx("div",{className:"trend-header",style:r,children:i??"Trend"}),c.jsx("div",{className:"trend-list-body",style:{opacity:n?0:1},children:c.jsx(tue,{axis:"y",values:d,onReorder:h=>{l(h),t?.(h)},style:{display:"flex",flexDirection:"column",gap:8},children:d.map((h,u)=>c.jsx(rue,{value:h,index:u,itemsDraggable:s},String(h.id)))})}),n&&c.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:c.jsx(a.Move,{size:48,strokeWidth:1.5,style:{opacity:.8}})})]})};function rue({value:e,index:t}){const n=Jhe(),o=cL[t%cL.length]??null;return c.jsx(cue,{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:c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[c.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:c.jsx("svg",{width:"25",height:"25",viewBox:"0 0 24 24","aria-hidden":!0,children:c.jsxs("g",{fill:"currentColor",children:[c.jsx("circle",{cx:"8",cy:"6",r:"2"}),c.jsx("circle",{cx:"16",cy:"6",r:"2"}),c.jsx("circle",{cx:"8",cy:"12",r:"2"}),c.jsx("circle",{cx:"16",cy:"12",r:"2"}),c.jsx("circle",{cx:"8",cy:"18",r:"2"}),c.jsx("circle",{cx:"16",cy:"18",r:"2"})]})})}),c.jsx("div",{style:{flex:1},children:c.jsx(Ij,{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??o})})]})})}function sue(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 due(e){return!e||typeof e=="string"&&e.trim()===""}function lue(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)?null:{isValid:!1,error:"Format d'email invalide"}}function hue(e){return/^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)*\/?$/.test(e)?null:{isValid:!1,error:"Format d'URL invalide"}}function uue(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 pue(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 yue(e,t){if(t.validation?.acceptedTypes){const n=t.validation.acceptedTypes.split(","),o=e.type;if(!n.some(i=>o.match(i.replace("*",".*"))))return{isValid:!1,error:`Type de fichier non supporté: ${o}`}}return t.validation?.maxFileSize&&e.size>t.validation.maxFileSize?{isValid:!1,error:`Fichier trop volumineux (max ${t.validation.maxFileSize/1048576}MB)`}:null}function kue(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 iL(e,t){const n=sue(e,t);if(n)return n;if(due(e))return{isValid:!0};const o=e.toString();switch(t.type){case"email":{const r=lue(o);if(r)return r;break}case"url":{const r=hue(o);if(r)return r;break}case"number":{const r=uue(e,t);if(r)return r;break}case"date":case"month":case"week":case"time":case"datetime-local":{const r=pue(e,t);if(r)return r;break}case"file":{const r=yue(e,t);if(r)return r;break}}const i=kue(o,t);return i||{isValid:!0}}function iq(e,t){const n={};let o=!0;for(const i of t){const r=iL(e[i.name],i);r.isValid||(n[i.name]=r.error,o=!1)}return{isValid:o,errors:n}}const mue="_formContainer_14ads_1",fue="_headerLine_14ads_17",gue="_formTitle_14ads_25",vue="_formDescription_14ads_30",Mue="_sectionTitle_14ads_37",_ue="_sectionHelp_14ads_44",xue="_fieldHelp_14ads_50",Lue="_gridContainer_14ads_58",Iue="_fieldGridItem_14ads_70",bue="_sectionFull_14ads_105",wue="_formFooter_14ads_110",Cue="_footerLeft_14ads_118",Nue="_footerRight_14ads_119",Sue="_cancelLink_14ads_125",jue="_submitButton_14ads_136",$ue="_fieldLabel_14ads_148",que="_inputWrapper_14ads_163",Aue="_inputInner_14ads_187",zue="_hasPrefix_14ads_196",Vue="_inputBase_14ads_196",Pue="_iconPrefix_14ads_292",Tue="_iconSuffix_14ads_293",Hue="_passwordToggle_14ads_319",Due="_fieldError_14ads_365",Bue="_fieldInvalid_14ads_372",ne={formContainer:mue,headerLine:fue,formTitle:gue,formDescription:vue,sectionTitle:Mue,sectionHelp:_ue,fieldHelp:xue,gridContainer:Lue,fieldGridItem:Iue,sectionFull:bue,formFooter:wue,footerLeft:Cue,footerRight:Nue,cancelLink:Sue,submitButton:jue,fieldLabel:$ue,inputWrapper:que,inputInner:Aue,hasPrefix:zue,inputBase:Vue,iconPrefix:Pue,iconSuffix:Tue,passwordToggle:Hue,fieldError:Due,fieldInvalid:Bue},rq=({field:e,value:t,onChange:n,onBlur:o,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?ut[e.attributes.icon]:null),y=e.attributes?.iconPosition??"suffix",m=g=>{n(g.target.value)};return c.jsxs("div",{className:ne.inputWrapper,children:[c.jsx("label",{className:`${ne.fieldLabel} ${e.required?"required":""}`,htmlFor:e.name,children:e.label}),c.jsxs("div",{className:`${ne.inputInner} ${p&&y==="prefix"?ne.hasPrefix:""}`,children:[p&&y==="prefix"&&c.jsx("span",{className:ne.iconPrefix,children:c.jsx(p,{size:16})}),c.jsx("input",{id:e.name,name:e.name,type:u,placeholder:e.placeholder,className:`${ne.inputBase} ${i?ne.fieldInvalid:""}`,value:t??"",onChange:m,onBlur:o,disabled:!!e.disabled,"aria-invalid":!!i,"aria-describedby":e.help?`${e.name}-help`:void 0}),l&&h&&c.jsx("button",{type:"button","aria-label":s?"Masquer le mot de passe":"Afficher le mot de passe",className:ne.passwordToggle,onClick:()=>d(g=>!g),children:s?c.jsx(y1,{size:16}):c.jsx(k1,{size:16})}),p&&y==="suffix"&&!l&&c.jsx("span",{className:ne.iconSuffix,children:c.jsx(p,{size:16})})]}),r&&i&&c.jsx("span",{className:ne.fieldError,children:i})]})},Rue="_fieldGroup_yb3zi_7",Fue="_fieldLabel_yb3zi_11",Eue="_required_yb3zi_17",Oue="_fieldInput_yb3zi_22",Uue="_fieldInvalid_yb3zi_40",Wue="_fieldValid_yb3zi_44",Gue="_fieldError_yb3zi_48",Zue="_radioGroup_yb3zi_57",wt={fieldGroup:Rue,fieldLabel:Fue,required:Eue,fieldInput:Oue,fieldInvalid:Uue,fieldValid:Wue,fieldError:Gue,radioGroup:Zue},yL=({field:e,children:t,error:n,touched:o})=>{const i=o&&n;return c.jsxs("div",{className:wt.fieldGroup,children:[e.type!=="checkbox"&&e.type!=="radio"&&c.jsx("label",{className:`${wt.fieldLabel} ${e.required?wt.required:""}`,children:e.label}),t,i&&c.jsx("span",{className:wt.fieldError,children:n})]})},sq=({field:e,value:t,onChange:n,onBlur:o,error:i,touched:r})=>{const s=r&&i,d=r&&!i&&t,l=["form-control",wt.fieldInput,s?wt.fieldInvalid:"",d?wt.fieldValid:""].filter(Boolean).join(" ");return c.jsx(yL,{field:e,error:i,touched:r,children:c.jsx("textarea",{className:l,placeholder:e.placeholder,value:t||"",onChange:h=>n(h.target.value),onBlur:o,rows:4})})},Kue="_wrapper_117u4_1",Xue="_wrapperInvalid_117u4_15",Yue="_nativeSelect_117u4_19",Jue="_display_117u4_30",Que="_topLabel_117u4_37",epe="_valueLine_117u4_45",tpe="_valuePlaceholder_117u4_53",ape="_valueActive_117u4_57",npe="_caret_117u4_61",ope="_error_117u4_75",cpe="_optionStyle_117u4_89",De={wrapper:Kue,wrapperInvalid:Xue,nativeSelect:Yue,display:Jue,topLabel:Que,valueLine:epe,valuePlaceholder:tpe,valueActive:ape,caret:npe,error:ope,optionStyle:cpe},Dw=({field:e,value:t,onChange:n,onBlur:o,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 c.jsxs("div",{className:`${De.wrapper} ${s?De.wrapperInvalid:""} ${t?De.wrapperHasValue:""}`,children:[c.jsxs("select",{id:e.name,name:e.name,className:De.nativeSelect,value:t??"",onChange:u=>n(u.target.value),onBlur:o,"aria-invalid":s,"aria-label":d,children:[c.jsx("option",{value:"",disabled:!0,hidden:!0,children:l||`Sélectionnez ${d?.toLowerCase()||""}`}),e.options?.map((u,p)=>c.jsx("option",{value:u.value,className:De.optionStyle,children:u.label},p))]}),c.jsxs("div",{className:De.display,children:[d&&c.jsx("span",{className:De.topLabel,children:d}),c.jsx("span",{className:`${De.valueLine} ${t?De.valueActive:De.valuePlaceholder}`,children:t?h:l}),c.jsx("span",{className:De.caret,"aria-hidden":"true"})]}),s&&c.jsx("span",{className:De.error,children:i})]})},dq=({field:e,value:t,onChange:n,onBlur:o,error:i,touched:r})=>c.jsx(yL,{field:e,error:i,touched:r,children:c.jsxs("div",{className:"form-check",children:[c.jsx("input",{type:"checkbox",className:"form-check-input",id:e.name,checked:!!t,onChange:s=>n(s.target.checked),onBlur:o}),c.jsx("label",{className:"form-check-label",htmlFor:e.name,children:e.label})]})}),lq=({field:e,value:t,onChange:n,onBlur:o,error:i,touched:r})=>c.jsx(yL,{field:e,error:i,touched:r,children:c.jsx("div",{className:wt.radioGroup,children:e.options?.map(s=>c.jsxs("div",{className:"form-check",children:[c.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:o}),c.jsx("label",{className:"form-check-label",htmlFor:`${e.name}-${s.value}`,children:s.label})]},s.value))})}),ipe="_fileInputContainer_r2guc_3",rpe="_customFileInput_r2guc_8",spe="_fileInputLabel_r2guc_12",dpe="_dragOver_r2guc_39",lpe="_uploadIcon_r2guc_44",hpe="_uploadText_r2guc_50",upe="_uploadHint_r2guc_56",ppe="_fileList_r2guc_60",ype="_fileListTitle_r2guc_69",kpe="_fileItem_r2guc_80",mpe="_fileIcon_r2guc_96",fpe="_fileName_r2guc_102",gpe="_fileSize_r2guc_108",vpe="_removeButton_r2guc_114",Mpe="_errorText_r2guc_129",be={fileInputContainer:ipe,customFileInput:rpe,fileInputLabel:spe,dragOver:dpe,uploadIcon:lpe,uploadText:hpe,uploadHint:upe,fileList:ppe,fileListTitle:ype,fileItem:kpe,fileIcon:mpe,fileName:fpe,fileSize:gpe,removeButton:vpe,errorText:Mpe},hq=({field:e,value:t,onChange:n,onBlur:o,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(I=>v.items.add(I)),n(v.files)},f=M=>{if(M===0)return"0 Bytes";const _=1024,v=["Bytes","KB","MB","GB"],I=Math.floor(Math.log(M)/Math.log(_));return parseFloat((M/Math.pow(_,I)).toFixed(2))+" "+v[I]};return c.jsxs("div",{className:`${be.fileInputContainer} ${r&&i?be.hasError:""}`,children:[c.jsxs("label",{htmlFor:e.name,className:"form-label",children:[e.label,e.required&&c.jsx("span",{className:"text-danger",children:" *"})]}),c.jsx("input",{type:"file",id:e.name,name:e.name,multiple:e.attributes?.multiple||!1,accept:e.attributes?.accept,onChange:h,onBlur:o,ref:s,className:be.customFileInput}),c.jsxs("label",{htmlFor:e.name,className:`${be.fileInputLabel} ${d?be.dragOver:""}`,onDragOver:p,onDragLeave:y,onDrop:m,onClick:u,tabIndex:0,children:[c.jsx("div",{className:be.uploadIcon,children:c.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",fill:"currentColor",viewBox:"0 0 16 16",children:[c.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"}),c.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"})]})}),c.jsx("div",{className:be.uploadText,children:d?"Déposez vos fichiers ici":"Cliquez ou glissez-déposez pour téléverser"}),c.jsxs("div",{className:be.uploadHint,children:[e.attributes?.accept||"Tous les fichiers"," ",e.attributes?.multiple?"(Multiple autorisé)":""]})]}),t&&t.length>0&&c.jsxs("div",{className:be.fileList,children:[c.jsx("div",{className:be.fileListTitle,children:"Fichiers sélectionnés:"}),c.jsx("ul",{children:Array.from(t).map((M,_)=>c.jsxs("li",{className:be.fileItem,children:[c.jsx("div",{className:be.fileIcon,children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",children:c.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"})})}),c.jsx("div",{className:be.fileName,children:M.name}),c.jsx("div",{className:be.fileSize,children:f(M.size)}),c.jsx("button",{type:"button",className:be.removeButton,onClick:v=>{v.stopPropagation(),g(_)},"aria-label":`Supprimer ${M.name}`,children:c.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",children:[c.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"}),c.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&&c.jsx("div",{className:be.errorText,children:i})]})},_pe="_container_ecah4_2",xpe="_label_ecah4_6",Lpe="_requiredIndicator_ecah4_13",Ipe="_input_ecah4_18",bpe="_inputError_ecah4_49",wpe="_errorMessage_ecah4_58",Ac={container:_pe,label:xpe,requiredIndicator:Lpe,input:Ipe,inputError:bpe,errorMessage:wpe},uq=({field:e,value:t,onChange:n,onBlur:o,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 c.jsxs("div",{className:Ac.container,children:[c.jsxs("label",{htmlFor:e.name,className:Ac.label,style:{color:s},children:[e.label,e.required&&c.jsx("span",{className:Ac.requiredIndicator,children:"*"})]}),c.jsx("input",{type:l,id:e.name,name:e.name,value:t||"",onChange:h=>n(h.target.value),onBlur:o,className:`${Ac.input} ${r&&i?Ac.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&&c.jsx("div",{className:Ac.errorMessage,children:i})]})},Cpe="_rangeContainer_cyqk3_3",Npe={rangeContainer:Cpe},pq=({field:e,value:t,onChange:n,onBlur:o,error:i,touched:r})=>c.jsxs("div",{className:`mb-3 ${Npe.rangeContainer}`,children:[c.jsxs("label",{htmlFor:e.name,className:"form-label",children:[e.label,": ",t,e.required&&c.jsx("span",{className:"text-danger",children:" *"})]}),c.jsx("input",{type:"range",id:e.name,name:e.name,value:t||0,onChange:s=>n(s.target.value),onBlur:o,className:`form-range ${r&&i?"is-invalid":""}`,min:e.validation?.min||0,max:e.validation?.max||100,step:e.attributes?.step||1}),r&&i&&c.jsx("div",{className:"invalid-feedback",children:i})]}),Spe="_colorPickerContainer_1wxgj_2",jpe="_colorInput_1wxgj_19",$pe="_colorValue_1wxgj_39",GL={colorPickerContainer:Spe,colorInput:jpe,colorValue:$pe},yq=({field:e,value:t,onChange:n,onBlur:o,error:i,touched:r})=>c.jsxs("div",{className:"mb-3",children:[c.jsxs("label",{htmlFor:e.name,className:"form-label",children:[e.label,e.required&&c.jsx("span",{className:"text-danger",children:" *"})]}),c.jsxs("div",{className:GL.colorPickerContainer,children:[c.jsx("input",{type:"color",id:e.name,name:e.name,value:t||"#000000",onChange:s=>n(s.target.value),onBlur:o,className:GL.colorInput}),c.jsx("span",{className:GL.colorValue,children:t})]}),r&&i&&c.jsx("div",{className:"invalid-feedback",children:i})]}),kq=({field:e,value:t,onChange:n,onBlur:o,error:i,touched:r})=>{const s=["date","month","week","time","datetime-local"];if(e.type==="file")return c.jsx(hq,{field:e,value:t,onChange:n,onBlur:o,error:i,touched:r});if(s.includes(e.type))return c.jsx(uq,{field:e,value:t,onChange:n,onBlur:o,error:i,touched:r});if(e.type==="range")return c.jsx(pq,{field:e,value:t,onChange:n,onBlur:o,error:i,touched:r});if(e.type==="color")return c.jsx(yq,{field:e,value:t,onChange:n,onBlur:o,error:i,touched:r});switch(e.type){case"textarea":return c.jsx(sq,{field:e,value:t,onChange:n,onBlur:o,error:i,touched:r});case"select":return c.jsx(Dw,{field:e,value:t,onChange:n,onBlur:o,error:i,touched:r});case"checkbox":return c.jsx(dq,{field:e,value:t,onChange:n,onBlur:o,error:i,touched:r});case"radio":return c.jsx(lq,{field:e,value:t,onChange:n,onBlur:o,error:i,touched:r});default:return c.jsx(rq,{field:e,value:t,onChange:n,onBlur:o,error:i,touched:r})}};var ZL,kN;function qpe(){if(kN)return ZL;kN=1;function e(){this.__data__=[],this.size=0}return ZL=e,ZL}var KL,mN;function mq(){if(mN)return KL;mN=1;function e(t,n){return t===n||t!==t&&n!==n}return KL=e,KL}var XL,fN;function kL(){if(fN)return XL;fN=1;var e=mq();function t(n,o){for(var i=n.length;i--;)if(e(n[i][0],o))return i;return-1}return XL=t,XL}var YL,gN;function Ape(){if(gN)return YL;gN=1;var e=kL(),t=Array.prototype,n=t.splice;function o(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 YL=o,YL}var JL,vN;function zpe(){if(vN)return JL;vN=1;var e=kL();function t(n){var o=this.__data__,i=e(o,n);return i<0?void 0:o[i][1]}return JL=t,JL}var QL,MN;function Vpe(){if(MN)return QL;MN=1;var e=kL();function t(n){return e(this.__data__,n)>-1}return QL=t,QL}var eI,_N;function Ppe(){if(_N)return eI;_N=1;var e=kL();function t(n,o){var i=this.__data__,r=e(i,n);return r<0?(++this.size,i.push([n,o])):i[r][1]=o,this}return eI=t,eI}var tI,xN;function mL(){if(xN)return tI;xN=1;var e=qpe(),t=Ape(),n=zpe(),o=Vpe(),i=Ppe();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=o,r.prototype.set=i,tI=r,tI}var aI,LN;function Tpe(){if(LN)return aI;LN=1;var e=mL();function t(){this.__data__=new e,this.size=0}return aI=t,aI}var nI,IN;function Hpe(){if(IN)return nI;IN=1;function e(t){var n=this.__data__,o=n.delete(t);return this.size=n.size,o}return nI=e,nI}var oI,bN;function Dpe(){if(bN)return oI;bN=1;function e(t){return this.__data__.get(t)}return oI=e,oI}var cI,wN;function Bpe(){if(wN)return cI;wN=1;function e(t){return this.__data__.has(t)}return cI=e,cI}var iI,CN;function fq(){if(CN)return iI;CN=1;var e=typeof a.commonjsGlobal=="object"&&a.commonjsGlobal&&a.commonjsGlobal.Object===Object&&a.commonjsGlobal;return iI=e,iI}var rI,NN;function mt(){if(NN)return rI;NN=1;var e=fq(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return rI=n,rI}var sI,SN;function Bw(){if(SN)return sI;SN=1;var e=mt(),t=e.Symbol;return sI=t,sI}var dI,jN;function Rpe(){if(jN)return dI;jN=1;var e=Bw(),t=Object.prototype,n=t.hasOwnProperty,o=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=o.call(s);return h&&(d?s[i]=l:delete s[i]),u}return dI=r,dI}var lI,$N;function Fpe(){if($N)return lI;$N=1;var e=Object.prototype,t=e.toString;function n(o){return t.call(o)}return lI=n,lI}var hI,qN;function fL(){if(qN)return hI;qN=1;var e=Bw(),t=Rpe(),n=Fpe(),o="[object Null]",i="[object Undefined]",r=e?e.toStringTag:void 0;function s(d){return d==null?d===void 0?i:o:r&&r in Object(d)?t(d):n(d)}return hI=s,hI}var uI,AN;function gq(){if(AN)return uI;AN=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return uI=e,uI}var pI,zN;function vq(){if(zN)return pI;zN=1;var e=fL(),t=gq(),n="[object AsyncFunction]",o="[object Function]",i="[object GeneratorFunction]",r="[object Proxy]";function s(d){if(!t(d))return!1;var l=e(d);return l==o||l==i||l==n||l==r}return pI=s,pI}var yI,VN;function Epe(){if(VN)return yI;VN=1;var e=mt(),t=e["__core-js_shared__"];return yI=t,yI}var kI,PN;function Ope(){if(PN)return kI;PN=1;var e=Epe(),t=function(){var o=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}();function n(o){return!!t&&t in o}return kI=n,kI}var mI,TN;function Mq(){if(TN)return mI;TN=1;var e=Function.prototype,t=e.toString;function n(o){if(o!=null){try{return t.call(o)}catch{}try{return o+""}catch{}}return""}return mI=n,mI}var fI,HN;function Upe(){if(HN)return fI;HN=1;var e=vq(),t=Ope(),n=gq(),o=Mq(),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(o(y))}return fI=p,fI}var gI,DN;function Wpe(){if(DN)return gI;DN=1;function e(t,n){return t?.[n]}return gI=e,gI}var vI,BN;function Yc(){if(BN)return vI;BN=1;var e=Upe(),t=Wpe();function n(o,i){var r=t(o,i);return e(r)?r:void 0}return vI=n,vI}var MI,RN;function Rw(){if(RN)return MI;RN=1;var e=Yc(),t=mt(),n=e(t,"Map");return MI=n,MI}var _I,FN;function gL(){if(FN)return _I;FN=1;var e=Yc(),t=e(Object,"create");return _I=t,_I}var xI,EN;function Gpe(){if(EN)return xI;EN=1;var e=gL();function t(){this.__data__=e?e(null):{},this.size=0}return xI=t,xI}var LI,ON;function Zpe(){if(ON)return LI;ON=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return LI=e,LI}var II,UN;function Kpe(){if(UN)return II;UN=1;var e=gL(),t="__lodash_hash_undefined__",n=Object.prototype,o=n.hasOwnProperty;function i(r){var s=this.__data__;if(e){var d=s[r];return d===t?void 0:d}return o.call(s,r)?s[r]:void 0}return II=i,II}var bI,WN;function Xpe(){if(WN)return bI;WN=1;var e=gL(),t=Object.prototype,n=t.hasOwnProperty;function o(i){var r=this.__data__;return e?r[i]!==void 0:n.call(r,i)}return bI=o,bI}var wI,GN;function Ype(){if(GN)return wI;GN=1;var e=gL(),t="__lodash_hash_undefined__";function n(o,i){var r=this.__data__;return this.size+=this.has(o)?0:1,r[o]=e&&i===void 0?t:i,this}return wI=n,wI}var CI,ZN;function Jpe(){if(ZN)return CI;ZN=1;var e=Gpe(),t=Zpe(),n=Kpe(),o=Xpe(),i=Ype();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=o,r.prototype.set=i,CI=r,CI}var NI,KN;function Qpe(){if(KN)return NI;KN=1;var e=Jpe(),t=mL(),n=Rw();function o(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return NI=o,NI}var SI,XN;function eye(){if(XN)return SI;XN=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return SI=e,SI}var jI,YN;function vL(){if(YN)return jI;YN=1;var e=eye();function t(n,o){var i=n.__data__;return e(o)?i[typeof o=="string"?"string":"hash"]:i.map}return jI=t,jI}var $I,JN;function tye(){if(JN)return $I;JN=1;var e=vL();function t(n){var o=e(this,n).delete(n);return this.size-=o?1:0,o}return $I=t,$I}var qI,QN;function aye(){if(QN)return qI;QN=1;var e=vL();function t(n){return e(this,n).get(n)}return qI=t,qI}var AI,eS;function nye(){if(eS)return AI;eS=1;var e=vL();function t(n){return e(this,n).has(n)}return AI=t,AI}var zI,tS;function oye(){if(tS)return zI;tS=1;var e=vL();function t(n,o){var i=e(this,n),r=i.size;return i.set(n,o),this.size+=i.size==r?0:1,this}return zI=t,zI}var VI,aS;function _q(){if(aS)return VI;aS=1;var e=Qpe(),t=tye(),n=aye(),o=nye(),i=oye();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=o,r.prototype.set=i,VI=r,VI}var PI,nS;function cye(){if(nS)return PI;nS=1;var e=mL(),t=Rw(),n=_q(),o=200;function i(r,s){var d=this.__data__;if(d instanceof e){var l=d.__data__;if(!t||l.length<o-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 PI=i,PI}var TI,oS;function iye(){if(oS)return TI;oS=1;var e=mL(),t=Tpe(),n=Hpe(),o=Dpe(),i=Bpe(),r=cye();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=o,s.prototype.has=i,s.prototype.set=r,TI=s,TI}var HI,cS;function rye(){if(cS)return HI;cS=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return HI=t,HI}var DI,iS;function sye(){if(iS)return DI;iS=1;function e(t){return this.__data__.has(t)}return DI=e,DI}var BI,rS;function dye(){if(rS)return BI;rS=1;var e=_q(),t=rye(),n=sye();function o(i){var r=-1,s=i==null?0:i.length;for(this.__data__=new e;++r<s;)this.add(i[r])}return o.prototype.add=o.prototype.push=t,o.prototype.has=n,BI=o,BI}var RI,sS;function lye(){if(sS)return RI;sS=1;function e(t,n){for(var o=-1,i=t==null?0:t.length;++o<i;)if(n(t[o],o,t))return!0;return!1}return RI=e,RI}var FI,dS;function hye(){if(dS)return FI;dS=1;function e(t,n){return t.has(n)}return FI=e,FI}var EI,lS;function xq(){if(lS)return EI;lS=1;var e=dye(),t=lye(),n=hye(),o=1,i=2;function r(s,d,l,h,u,p){var y=l&o,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,I=l&i?new e:void 0;for(p.set(s,d),p.set(d,s);++_<m;){var C=s[_],b=d[_];if(h)var w=y?h(b,C,_,d,s,p):h(C,b,_,s,d,p);if(w!==void 0){if(w)continue;v=!1;break}if(I){if(!t(d,function(L,x){if(!n(I,x)&&(C===L||u(C,L,l,h,p)))return I.push(x)})){v=!1;break}}else if(!(C===b||u(C,b,l,h,p))){v=!1;break}}return p.delete(s),p.delete(d),v}return EI=r,EI}var OI,hS;function uye(){if(hS)return OI;hS=1;var e=mt(),t=e.Uint8Array;return OI=t,OI}var UI,uS;function pye(){if(uS)return UI;uS=1;function e(t){var n=-1,o=Array(t.size);return t.forEach(function(i,r){o[++n]=[r,i]}),o}return UI=e,UI}var WI,pS;function yye(){if(pS)return WI;pS=1;function e(t){var n=-1,o=Array(t.size);return t.forEach(function(i){o[++n]=i}),o}return WI=e,WI}var GI,yS;function kye(){if(yS)return GI;yS=1;var e=Bw(),t=uye(),n=mq(),o=xq(),i=pye(),r=yye(),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]",I=e?e.prototype:void 0,C=I?I.valueOf:void 0;function b(w,L,x,S,j,$,q){switch(x){case v:if(w.byteLength!=L.byteLength||w.byteOffset!=L.byteOffset)return!1;w=w.buffer,L=L.buffer;case _:return!(w.byteLength!=L.byteLength||!$(new t(w),new t(L)));case l:case h:case y:return n(+w,+L);case u:return w.name==L.name&&w.message==L.message;case m:case f:return w==L+"";case p:var H=i;case g:var P=S&s;if(H||(H=r),w.size!=L.size&&!P)return!1;var A=q.get(w);if(A)return A==L;S|=d,q.set(w,L);var N=o(H(w),H(L),S,j,$,q);return q.delete(w),N;case M:if(C)return C.call(w)==C.call(L)}return!1}return GI=b,GI}var ZI,kS;function mye(){if(kS)return ZI;kS=1;function e(t,n){for(var o=-1,i=n.length,r=t.length;++o<i;)t[r+o]=n[o];return t}return ZI=e,ZI}var KI,mS;function Fw(){if(mS)return KI;mS=1;var e=Array.isArray;return KI=e,KI}var XI,fS;function fye(){if(fS)return XI;fS=1;var e=mye(),t=Fw();function n(o,i,r){var s=i(o);return t(o)?s:e(s,r(o))}return XI=n,XI}var YI,gS;function gye(){if(gS)return YI;gS=1;function e(t,n){for(var o=-1,i=t==null?0:t.length,r=0,s=[];++o<i;){var d=t[o];n(d,o,t)&&(s[r++]=d)}return s}return YI=e,YI}var JI,vS;function vye(){if(vS)return JI;vS=1;function e(){return[]}return JI=e,JI}var QI,MS;function Mye(){if(MS)return QI;MS=1;var e=gye(),t=vye(),n=Object.prototype,o=n.propertyIsEnumerable,i=Object.getOwnPropertySymbols,r=i?function(s){return s==null?[]:(s=Object(s),e(i(s),function(d){return o.call(s,d)}))}:t;return QI=r,QI}var eb,_S;function _ye(){if(_S)return eb;_S=1;function e(t,n){for(var o=-1,i=Array(t);++o<t;)i[o]=n(o);return i}return eb=e,eb}var tb,xS;function ML(){if(xS)return tb;xS=1;function e(t){return t!=null&&typeof t=="object"}return tb=e,tb}var ab,LS;function xye(){if(LS)return ab;LS=1;var e=fL(),t=ML(),n="[object Arguments]";function o(i){return t(i)&&e(i)==n}return ab=o,ab}var nb,IS;function Lye(){if(IS)return nb;IS=1;var e=xye(),t=ML(),n=Object.prototype,o=n.hasOwnProperty,i=n.propertyIsEnumerable,r=e(function(){return arguments}())?e:function(s){return t(s)&&o.call(s,"callee")&&!i.call(s,"callee")};return nb=r,nb}var r1={exports:{}},ob,bS;function Iye(){if(bS)return ob;bS=1;function e(){return!1}return ob=e,ob}r1.exports;var wS;function Lq(){return wS||(wS=1,function(e,t){var n=mt(),o=Iye(),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||o;e.exports=h}(r1,r1.exports)),r1.exports}var cb,CS;function bye(){if(CS)return cb;CS=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(o,i){var r=typeof o;return i=i??e,!!i&&(r=="number"||r!="symbol"&&t.test(o))&&o>-1&&o%1==0&&o<i}return cb=n,cb}var ib,NS;function Iq(){if(NS)return ib;NS=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return ib=t,ib}var rb,SS;function wye(){if(SS)return rb;SS=1;var e=fL(),t=Iq(),n=ML(),o="[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]",I="[object Float64Array]",C="[object Int8Array]",b="[object Int16Array]",w="[object Int32Array]",L="[object Uint8Array]",x="[object Uint8ClampedArray]",S="[object Uint16Array]",j="[object Uint32Array]",$={};$[v]=$[I]=$[C]=$[b]=$[w]=$[L]=$[x]=$[S]=$[j]=!0,$[o]=$[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 rb=q,rb}var sb,jS;function Cye(){if(jS)return sb;jS=1;function e(t){return function(n){return t(n)}}return sb=e,sb}var s1={exports:{}};s1.exports;var $S;function Nye(){return $S||($S=1,function(e,t){var n=fq(),o=t&&!t.nodeType&&t,i=o&&!0&&e&&!e.nodeType&&e,r=i&&i.exports===o,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}(s1,s1.exports)),s1.exports}var db,qS;function bq(){if(qS)return db;qS=1;var e=wye(),t=Cye(),n=Nye(),o=n&&n.isTypedArray,i=o?t(o):e;return db=i,db}var lb,AS;function Sye(){if(AS)return lb;AS=1;var e=_ye(),t=Lye(),n=Fw(),o=Lq(),i=bye(),r=bq(),s=Object.prototype,d=s.hasOwnProperty;function l(h,u){var p=n(h),y=!p&&t(h),m=!p&&!y&&o(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 lb=l,lb}var hb,zS;function jye(){if(zS)return hb;zS=1;var e=Object.prototype;function t(n){var o=n&&n.constructor,i=typeof o=="function"&&o.prototype||e;return n===i}return hb=t,hb}var ub,VS;function $ye(){if(VS)return ub;VS=1;function e(t,n){return function(o){return t(n(o))}}return ub=e,ub}var pb,PS;function qye(){if(PS)return pb;PS=1;var e=$ye(),t=e(Object.keys,Object);return pb=t,pb}var yb,TS;function Aye(){if(TS)return yb;TS=1;var e=jye(),t=qye(),n=Object.prototype,o=n.hasOwnProperty;function i(r){if(!e(r))return t(r);var s=[];for(var d in Object(r))o.call(r,d)&&d!="constructor"&&s.push(d);return s}return yb=i,yb}var kb,HS;function zye(){if(HS)return kb;HS=1;var e=vq(),t=Iq();function n(o){return o!=null&&t(o.length)&&!e(o)}return kb=n,kb}var mb,DS;function Vye(){if(DS)return mb;DS=1;var e=Sye(),t=Aye(),n=zye();function o(i){return n(i)?e(i):t(i)}return mb=o,mb}var fb,BS;function Pye(){if(BS)return fb;BS=1;var e=fye(),t=Mye(),n=Vye();function o(i){return e(i,n,t)}return fb=o,fb}var gb,RS;function Tye(){if(RS)return gb;RS=1;var e=Pye(),t=1,n=Object.prototype,o=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:o.call(s,_)))return!1}var v=u.get(r),I=u.get(s);if(v&&I)return v==s&&I==r;var C=!0;u.set(r,s),u.set(s,r);for(var b=p;++M<m;){_=y[M];var w=r[_],L=s[_];if(l)var x=p?l(L,w,_,s,r,u):l(w,L,_,r,s,u);if(!(x===void 0?w===L||h(w,L,d,l,u):x)){C=!1;break}b||(b=_=="constructor")}if(C&&!b){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)&&(C=!1)}return u.delete(r),u.delete(s),C}return gb=i,gb}var vb,FS;function Hye(){if(FS)return vb;FS=1;var e=Yc(),t=mt(),n=e(t,"DataView");return vb=n,vb}var Mb,ES;function Dye(){if(ES)return Mb;ES=1;var e=Yc(),t=mt(),n=e(t,"Promise");return Mb=n,Mb}var _b,OS;function Bye(){if(OS)return _b;OS=1;var e=Yc(),t=mt(),n=e(t,"Set");return _b=n,_b}var xb,US;function Rye(){if(US)return xb;US=1;var e=Yc(),t=mt(),n=e(t,"WeakMap");return xb=n,xb}var Lb,WS;function Fye(){if(WS)return Lb;WS=1;var e=Hye(),t=Rw(),n=Dye(),o=Bye(),i=Rye(),r=fL(),s=Mq(),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(o),_=s(i),v=r;return(e&&v(new e(new ArrayBuffer(1)))!=y||t&&v(new t)!=d||n&&v(n.resolve())!=h||o&&v(new o)!=u||i&&v(new i)!=p)&&(v=function(I){var C=r(I),b=C==l?I.constructor:void 0,w=b?s(b):"";if(w)switch(w){case m:return y;case g:return d;case f:return h;case M:return u;case _:return p}return C}),Lb=v,Lb}var Ib,GS;function Eye(){if(GS)return Ib;GS=1;var e=iye(),t=xq(),n=kye(),o=Tye(),i=Fye(),r=Fw(),s=Lq(),d=bq(),l=1,h="[object Arguments]",u="[object Array]",p="[object Object]",y=Object.prototype,m=y.hasOwnProperty;function g(f,M,_,v,I,C){var b=r(f),w=r(M),L=b?u:i(f),x=w?u:i(M);L=L==h?p:L,x=x==h?p:x;var S=L==p,j=x==p,$=L==x;if($&&s(f)){if(!s(M))return!1;b=!0,S=!1}if($&&!S)return C||(C=new e),b||d(f)?t(f,M,_,v,I,C):n(f,M,L,_,v,I,C);if(!(_&l)){var q=S&&m.call(f,"__wrapped__"),H=j&&m.call(M,"__wrapped__");if(q||H){var P=q?f.value():f,A=H?M.value():M;return C||(C=new e),I(P,A,_,v,C)}}return $?(C||(C=new e),o(f,M,_,v,I,C)):!1}return Ib=g,Ib}var bb,ZS;function Oye(){if(ZS)return bb;ZS=1;var e=Eye(),t=ML();function n(o,i,r,s,d){return o===i?!0:o==null||i==null||!t(o)&&!t(i)?o!==o&&i!==i:e(o,i,r,s,n,d)}return bb=n,bb}var wb,KS;function Uye(){if(KS)return wb;KS=1;var e=Oye();function t(n,o){return e(n,o)}return wb=t,wb}var Wye=Uye();const Gye=a.getDefaultExportFromCjs(Wye),Zye=({schema:e,initialData:t={},onSubmit:n,submitLabel:o,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(()=>{Gye(_.current,t)||(u(t),_.current=t)},[t]);const v=(x,S)=>{const j={...h,[x]:S};if(u(j),m[x]){const $=e.fields.find(q=>q.name===x);if($){const q=iL(S,$);y(H=>({...H,[x]:q.isValid?"":q.error}))}}},I=x=>{if(!m[x]){g(j=>({...j,[x]:!0}));const S=e.fields.find(j=>j.name===x);if(S){const j=iL(h[x],S);y($=>({...$,[x]:j.isValid?"":j.error}))}}},C=async x=>{x.preventDefault(),M(!0);const S=e.fields.reduce(($,q)=>(q.type!=="section"&&($[q.name]=!0),$),{});g(S);const j=iq(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)},b=l?ut[l]:null,w=i&&ut[i]||e.submitIcon&&ut[e.submitIcon]||null,L=e.columns&&e.columns>0?Math.floor(e.columns):12;return c.jsxs("div",{className:ne.formContainer,children:[c.jsx("div",{className:ne.headerLine,children:c.jsx("h2",{className:ne.formTitle,children:e.title})}),e.description&&c.jsx("p",{className:ne.formDescription,children:e.description}),p.__global&&c.jsx("div",{className:`alert alert-danger ${ne.globalError}`,children:p.__global}),c.jsxs("form",{onSubmit:C,children:[c.jsx("div",{className:ne.gridContainer,style:{gridTemplateColumns:`repeat(${L}, minmax(0, 1fr))`},children:e.fields.map(x=>{if(x.type==="section")return c.jsxs("div",{className:ne.sectionFull,children:[c.jsx("h5",{className:ne.sectionTitle,children:x.label}),x.help&&c.jsx("p",{className:ne.sectionHelp,children:x.help})]},x.name);const j={gridColumn:`span ${Math.max(1,Math.min(L,x.gridCol??L))}`};return c.jsxs("div",{className:ne.fieldGridItem,style:j,children:[c.jsx(kq,{field:x,value:h[x.name],onChange:$=>v(x.name,$),onBlur:()=>I(x.name),error:p[x.name],touched:m[x.name]}),x.help&&c.jsx("small",{className:ne.fieldHelp,children:x.help})]},x.name)})}),c.jsxs("div",{className:ne.formFooter,children:[c.jsx("div",{className:ne.footerLeft,children:s&&c.jsxs("button",{type:"button",className:ne.cancelLink,onClick:s,children:[b&&c.jsx(b,{size:16,className:"me-2"})," ",d]})}),c.jsx("div",{className:ne.footerRight,children:c.jsx(Xx,{type:"submit",variant:"primary",size:"md",className:ne.submitButton,disabled:f,children:f?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"spinner-border spinner-border-sm me-2",role:"status"}),"Validation..."]}):c.jsxs(c.Fragment,{children:[w&&(r==="left"||e.submitIconPosition==="left")&&c.jsx(w,{size:16,className:"me-2"}),o||e.submitText||"Valider",w&&(r==="right"||e.submitIconPosition==="right")&&c.jsx(w,{size:16,className:"ms-2"})]})})})]})]})]})};function Kye(e){return{title:e._formTitle||"Formulaire",description:e._formDescription,fields:e._fieldMetadata||[],submitText:e._submitText||"Valider"}}const Xye="_container_1gljv_85",Yye="_tableWrapper_1gljv_111",Jye="_tableControls_1gljv_117",Qye="_controlsRight_1gljv_128",e4e="_limitedRows_1gljv_151",t4e="_table_1gljv_111",a4e="_headerCell_1gljv_206",n4e="_headerContent_1gljv_220",o4e="_headerWords_1gljv_229",c4e="_headerWord_1gljv_229",i4e="_cellContent_1gljv_276",r4e="_alignLeft_1gljv_286",s4e="_alignCenter_1gljv_290",d4e="_alignRight_1gljv_294",l4e="_tableCell_1gljv_298",h4e="_tableRow_1gljv_308",u4e="_emptyRow_1gljv_385",p4e="_toggleFiltersButton_1gljv_393",y4e="_toggleSortButton_1gljv_394",k4e="_buttonTextCompact_1gljv_415",m4e="_uppercaseSmall_1gljv_450",f4e="_filtersPanel_1gljv_463",g4e="_filtersPanelInline_1gljv_481",v4e="_filtersPanelHorizontal_1gljv_492",M4e="_filtersRow_1gljv_492",_4e="_filtersActionsHorizontal_1gljv_525",x4e="_filterItemInline_1gljv_542",L4e="_filterLabel_1gljv_571",I4e="_filterInput_1gljv_576",b4e="_filterSelect_1gljv_577",w4e="_operatorSelect_1gljv_578",C4e="_operatorInput_1gljv_579",N4e="_activeFilterTag_1gljv_597",S4e="_actionsGroup_1gljv_609",j4e="_applyButton_1gljv_615",$4e="_cancelButton_1gljv_625",q4e="_columnSorterContainer_1gljv_649",A4e="_sorterControls_1gljv_654",z4e="_sortDropdownWrapper_1gljv_659",V4e="_sortDropdown_1gljv_659",P4e="_sortDropdownHeader_1gljv_679",T4e="_closeButton_1gljv_688",H4e="_sortDropdownContent_1gljv_703",D4e="_sortDropdownItem_1gljv_709",B4e="_sortDirectionButtons_1gljv_734",R4e="_sortDirectionButton_1gljv_734",F4e="_activeSort_1gljv_757",E4e="_sortActions_1gljv_764",O4e="_paginationButton_1gljv_842",U4e="_pageSizeSelect_1gljv_844",W4e="_topPagination_1gljv_853",G4e="_paginationContainer_1gljv_861",Z4e="_leftGroup_1gljv_874",K4e="_pageSizeControls_1gljv_882",X4e="_paginationInfo_1gljv_908",Y4e="_paginationControls_1gljv_916",J4e="_disabledButton_1gljv_947",Q4e="_activeButton_1gljv_952",e5e="_navigationButton_1gljv_962",t5e="_operatorFilterContainer_1gljv_1010",a5e="_rangeSeparator_1gljv_1016",n5e="_activeFiltersSection_1gljv_1179",o5e="_activeFiltersRow_1gljv_1184",c5e="_activeFiltersList_1gljv_1192",i5e="_clearAllButton_1gljv_1200",r5e="_removeFilterButton_1gljv_1221",s5e="_sortIndicator_1gljv_1272",d5e="_active_1gljv_349",l5e="_clearSortButton_1gljv_1371",h5e="_loaderSpinner_1gljv_2743",u5e="_loaderSpinnerSmall_1gljv_2755",p5e="_paginationLoading_1gljv_2772",y5e="_loadingButton_1gljv_2780",k5e="_loadingIndicator_1gljv_2791",z={container:Xye,tableWrapper:Yye,tableControls:Jye,controlsRight:Qye,limitedRows:e4e,table:t4e,headerCell:a4e,headerContent:n4e,headerWords:o4e,headerWord:c4e,cellContent:i4e,alignLeft:r4e,alignCenter:s4e,alignRight:d4e,tableCell:l4e,tableRow:h4e,emptyRow:u4e,toggleFiltersButton:p4e,toggleSortButton:y4e,buttonTextCompact:k4e,uppercaseSmall:m4e,filtersPanel:f4e,filtersPanelInline:g4e,filtersPanelHorizontal:v4e,filtersRow:M4e,filtersActionsHorizontal:_4e,filterItemInline:x4e,filterLabel:L4e,filterInput:I4e,filterSelect:b4e,operatorSelect:w4e,operatorInput:C4e,activeFilterTag:N4e,actionsGroup:S4e,applyButton:j4e,cancelButton:$4e,columnSorterContainer:q4e,sorterControls:A4e,sortDropdownWrapper:z4e,sortDropdown:V4e,sortDropdownHeader:P4e,closeButton:T4e,sortDropdownContent:H4e,sortDropdownItem:D4e,sortDirectionButtons:B4e,sortDirectionButton:R4e,activeSort:F4e,sortActions:E4e,paginationButton:O4e,pageSizeSelect:U4e,topPagination:W4e,paginationContainer:G4e,leftGroup:Z4e,pageSizeControls:K4e,paginationInfo:X4e,paginationControls:Y4e,disabledButton:J4e,activeButton:Q4e,navigationButton:e5e,operatorFilterContainer:t5e,rangeSeparator:a5e,activeFiltersSection:n5e,activeFiltersRow:o5e,activeFiltersList:c5e,clearAllButton:i5e,removeFilterButton:r5e,sortIndicator:s5e,active:d5e,clearSortButton:l5e,loaderSpinner:h5e,loaderSpinnerSmall:u5e,paginationLoading:p5e,loadingButton:y5e,loadingIndicator:k5e},m5e=({config:e,value:t,onChange:n,disabled:o})=>c.jsxs("select",{value:t===""?"":String(t),onChange:i=>n(i.target.value===""?"":i.target.value==="true"),disabled:o,className:z.filterSelect,children:[c.jsx("option",{value:"",children:`Filtrer ${e.label}...`}),c.jsx("option",{value:"true",children:"Oui"}),c.jsx("option",{value:"false",children:"Non"})]}),f5e=({config:e,value:t,onChange:n,disabled:o})=>c.jsx("input",{type:"date",value:t||"",onChange:i=>n(i.target.value),placeholder:`Filtrer ${e.label}...`,disabled:o,className:z.filterInput}),g5e=({config:e,value:t,onChange:n,disabled:o})=>{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 c.jsx("select",{multiple:!0,value:t.map(String),onChange:s,disabled:o,className:z.filterMultiSelect,children:i.map((d,l)=>c.jsx("option",{value:String(d.value),children:d.label},l))})},XS=({config:e,value:t,onChange:n,disabled:o})=>{const[i,r]=k.useState(t||""),s=d=>{const l=d.target.value===""?"":Number(d.target.value);r(l),n(l)};return c.jsx("input",{type:"number",value:i,onChange:s,placeholder:e.placeholder||`Filtrer ${e.label}...`,disabled:o,className:z.filterInput})},v5e=({config:e,value:t,onChange:n,disabled:o=!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?c.jsx("div",{children:"Chargement..."}):c.jsxs("select",{value:String(t||""),onChange:l,disabled:o,className:z.filterInput,children:[c.jsx("option",{value:"",children:"Select..."}),i.map(h=>c.jsx("option",{value:h.value,children:h.label},h.value))]})},M5e=({config:e,value:t,onChange:n,disabled:o=!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 c.jsx("input",{type:"text",value:i,onChange:s,placeholder:e.placeholder||`Filtrer ${e.label}...`,disabled:o,className:z.filterInput})},_5e=({config:e,value:t,onChange:n,disabled:o=!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 c.jsxs("div",{className:z.operatorFilterContainer,children:[c.jsxs("select",{value:i,onChange:l,disabled:o,className:z.operatorSelect,children:[c.jsx("option",{value:"",children:"Sélectionner un opérateur"}),e.operators.map(u=>c.jsx("option",{value:String(u.value),children:u.label},String(u.value)))]}),c.jsx("input",{type:"text",value:s,onChange:h,placeholder:"Valeur",disabled:o||!i,className:z.operatorInput})]})},x5e=({value:e,onChange:t,disabled:n})=>{const o=e||{},i=s=>{t({...o,start:s.target.value})},r=s=>{t({...o,end:s.target.value})};return c.jsxs("div",{className:z.dateRangeContainer,children:[c.jsx("input",{type:"date",value:o.start||"",onChange:i,disabled:n,className:z.filterInput}),c.jsx("span",{className:z.rangeSeparator,children:"→"}),c.jsx("input",{type:"date",value:o.end||"",onChange:r,disabled:n,className:z.filterInput})]})},L5e=({config:e,value:t,onChange:n,disabled:o})=>{switch(e.type){case"text":case"search":return c.jsx(M5e,{config:e,value:t,onChange:n,disabled:o});case"number":return c.jsx(XS,{config:e,value:t,onChange:n,disabled:o});case"range":return c.jsx(XS,{config:e,value:t,onChange:n,disabled:o});case"select":return c.jsx(v5e,{config:e,value:t,onChange:n,disabled:o});case"operator":return c.jsx(_5e,{config:e,value:t,onChange:n,disabled:o});case"multiselect":return c.jsx(g5e,{config:e,value:t,onChange:n,disabled:o});case"date":return c.jsx(f5e,{config:e,value:t,onChange:n,disabled:o});case"daterange":return c.jsx(x5e,{config:e,value:t??{start:"",end:""},onChange:n,disabled:o});case"boolean":return c.jsx(m5e,{config:e,value:t,onChange:n,disabled:o});default:return c.jsxs("div",{children:["Type de filtre non supporté: ",e.type]})}},wq=({filters:e,externalFilters:t=[],onFiltersChange:n,onApply:o,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(b=>b.id===M);if(!v)continue;let I=_;try{typeof _=="function"&&(I=await _(f)),typeof v.executeOnApply=="function"&&(I=await v.executeOnApply(I,f))}catch{continue}if(v.type==="daterange"){const b=I?.start??"",w=I?.end??"",L=typeof b=="string"?b.trim()==="":!b,x=typeof w=="string"?w.trim()==="":!w;if(L&&x)continue}I==null||typeof I=="string"&&I.trim()===""||Array.isArray(I)&&I.length===0||typeof I=="object"&&!Array.isArray(I)&&Object.keys(I).length===0||g.push({id:M,type:v.type,value:I,label:v.label})}return i?n?.(g):(s(g),o?.(g)),g},[d,e,i,n,o]),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([]),o?.([]))},[e,i,n,o]);return{appliedFilters:h,tempFilters:d,updateFilter:u,applyFilters:p,clearFilter:y,clearAllFilters:m}},I5e=(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(o=>String(o)).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 o=n;if(!o.start||!o.end)return!1;const i=o.start,r=o.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(o){return console.error("Error processing daterange filter:",o),!1}case"operator":if(typeof n=="object"&&n!==null){const o=n;if(!("operator"in o)||!("value"in o))return!1;const{operator:i,value:r}=o,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 Cq(e,t,n="",o={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 I5e(v,_)}catch(v){return console.error("Error applying filter:",v),!1}}))),f},[e,t,l,s]),u=k.useMemo(()=>{if(!o?.key)return h;const f=o.key;return[...h].sort((M,_)=>{const v=M.data[f],I=_.data[f];if(v==null)return 1;if(I==null)return-1;if(typeof v=="number"&&typeof I=="number")return o.direction==="desc"?I-v:v-I;if(v instanceof Date&&I instanceof Date){const b=v.getTime()-I.getTime();return o.direction==="desc"?-b:b}const C=String(v).localeCompare(String(I),void 0,{numeric:!0,sensitivity:"base"});return o.direction==="desc"?-C:C})},[h,o]),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 Nq=({value:e})=>e,Sq=({value:e})=>k.createElement("a",{href:`mailto:${e}`,className:"email-link"},e),jq=({value:e})=>k.createElement("a",{href:String(e),target:"_blank",rel:"noopener noreferrer",className:"text-link"},e),$q=({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",o=typeof e=="object"?e.text:e,i=t[n]||t.default;return k.createElement("span",{className:`badge ${i}`},o)},qq=({value:e})=>{try{return new Date(e).toLocaleDateString()}catch{return String(e)}},Aq=({value:e})=>k.createElement("span",{className:"number-value"},Number(e).toLocaleString()),zq=({value:e})=>k.createElement("span",{className:"currency-value"},new Intl.NumberFormat("fr-FR",{style:"currency",currency:"EUR"}).format(Number(e))),Vq=({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"})),aw={renderers:{text:Nq,email:Sq,link:jq,badge:$q,date:qq,number:Aq,currency:zq,image:Vq},icons:{sortAsc:k.createElement(Ic,{className:"sort-icon active",size:14}),sortDesc:k.createElement(Nt,{className:"sort-icon active",size:14}),sortDefault:k.createElement(Rc,{className:"sort-icon",size:14})}},b5e=(e,t)=>{aw.renderers[e]&&console.warn(`Le renderer "${e}" existe déjà et sera écrasé.`),aw.renderers[e]=t},w5e=({filters:e,externalFilters:t=[],onFiltersChange:n,onApply:o,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:I,tempFilters:C,updateFilter:b,applyFilters:w,clearAllFilters:L}=wq({filters:e,externalFilters:t,onFiltersChange:n,onApply:o,isControlled:i}),x=k.useRef(null),S=k.useRef(null);k.useEffect(()=>{if(v&&x.current){const A=x.current.getBoundingClientRect().height;h?.(A)}else h?.(0)},[v,e,C,h]);const j=()=>{typeof s=="boolean"?d?.(!s):_(A=>{const N=!A;return d?.(N),N})},$=()=>e.map(A=>{const N=C?.[A.id];return N==null||typeof N=="string"&&N.trim()===""?null:{id:A.id,label:A.label,value:N}}).filter(Boolean),q=async()=>{let A;try{A=await w()}catch{A=void 0}let N=[];A&&Array.isArray(A)&&A.length>0?N=A:I&&I.length>0?N=I:N=$(),n?.(N),o?.(N)},H=()=>{d?.(!1),typeof s!="boolean"&&_(!1)},P=()=>{L(),n?.([]),o?.([])};return k.useEffect(()=>{const A=V=>{v&&S.current&&(S.current.contains(V.target)||(d?.(!1),typeof s!="boolean"&&_(!1)))},N=V=>{V.key==="Escape"&&v&&(d?.(!1),typeof s!="boolean"&&_(!1))};return v&&(document.addEventListener("pointerdown",A),document.addEventListener("keydown",N)),()=>{document.removeEventListener("pointerdown",A),document.removeEventListener("keydown",N)}},[v,s,d]),c.jsxs("div",{className:z.advancedFiltersContainer,ref:S,children:[c.jsxs("button",{className:`${z.toggleFiltersButton} ${I.length>0?z.active:""} ${v?z.toggleFiltersButtonOpen:""} ${f?z.loadingButton:""}`,onClick:j,"aria-expanded":v,"aria-controls":"advanced-filters-panel",type:"button",disabled:f,children:[f?c.jsx("span",{className:z.loaderSpinnerSmall}):c.jsx(xt,{size:14}),c.jsx("span",{className:z.buttonTextCompact,children:u}),I.length>0&&!f&&c.jsx("span",{className:z.filterCountBadge,"aria-hidden":!0,children:I.length}),f&&c.jsx("span",{className:z.loadingIndicator,"aria-hidden":!0,children:"Chargement..."})]}),v&&c.jsxs("div",{id:"advanced-filters-panel",ref:x,className:`${z.filtersPanel} ${l==="top"?`${z.filtersPanelInline} ${z.filtersPanelHorizontal}`:""}`,role:"region","aria-label":"Panneau de filtres avancés",children:[c.jsx("div",{className:z.filtersRow,children:e.map(A=>c.jsxs("div",{className:`${z.filterItem} ${z.filterItemInline}`,children:[c.jsxs("label",{className:z.filterLabel,children:[A.label,A.required&&c.jsx("span",{className:z.required,children:"*"})]}),c.jsx(L5e,{config:A,value:C[A.id],onChange:N=>b(A.id,N),disabled:A.disabled})]},A.id))}),c.jsxs("div",{className:z.filtersActionsHorizontal,children:[c.jsx("div",{className:z.activeFiltersSection,children:I.length>0&&c.jsxs("div",{className:z.activeFiltersRow,children:[c.jsx("span",{className:z.activeLabelCompact,children:"Actifs :"}),c.jsx("div",{className:z.activeFiltersList,children:I.map(A=>c.jsxs("div",{className:z.activeFilterTag,children:[A.label??A.id,c.jsx("button",{className:z.removeFilterButton,onClick:()=>b(A.id,void 0),"aria-label":`Supprimer ${A.id}`,type:"button",children:"×"})]},A.id))}),c.jsxs("button",{className:z.clearAllButton,onClick:P,type:"button",children:[c.jsx(Ze,{size:12})," ",m]})]})}),c.jsxs("div",{className:z.actionsGroup,children:[c.jsx("button",{className:z.cancelButton,onClick:H,type:"button",disabled:f,children:y}),c.jsx("button",{className:`${z.applyButton} ${f?z.loadingButton:""}`,onClick:q,type:"button",disabled:g||f,"aria-disabled":g||f,children:f?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:z.loaderSpinnerSmall}),c.jsx("span",{children:"Chargement..."})]}):p})]})]})]})]})},YS=e=>{const t=e.replace(/[^A-Za-zÀ-ÖØ-öø-ÿ]/g,"");return t.length>0&&t===t.toUpperCase()},C5e=({columns:e,sortConfig:t,onSort:n,label:o="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]),c.jsx("div",{className:z.columnSorterContainer,ref:l,children:c.jsx("div",{className:z.sorterControls,children:d.length>0&&c.jsxs("div",{className:z.sortDropdownWrapper,ref:l,children:[c.jsxs("button",{className:`${z.toggleSortButton} ${r?z.toggleSortButtonOpen:""} ${h?z.active:""} ${i?z.loadingButton:""}`,onClick:y,"aria-expanded":r,"aria-haspopup":"true",type:"button",disabled:i,children:[i?c.jsx("span",{className:z.loaderSpinnerSmall}):c.jsx(Rc,{size:14}),c.jsx("span",{className:`${z.buttonTextCompact} ${YS(o)?z.uppercaseSmall:""}`,children:o}),h&&!i&&c.jsx("div",{className:z.sortIndicator,children:t?.direction==="asc"?c.jsx(Ic,{size:12}):c.jsx(Nt,{size:12})})]}),r&&c.jsxs("div",{className:`${z.sortDropdown} ${z.sortDropdownInline}`,role:"menu",children:[c.jsxs("div",{className:z.sortDropdownHeader,children:[c.jsx("span",{children:"Trier par:"}),c.jsx("button",{className:z.closeButton,onClick:m,"aria-label":"Fermer",type:"button",children:c.jsx(Ze,{size:16})})]}),c.jsx("div",{className:z.sortDropdownContent,children:d.map(g=>{const f=String(g.label??g.id),M=YS(f);return c.jsxs("div",{className:z.sortDropdownItem,role:"menuitem",tabIndex:0,onKeyDown:_=>{_.key==="Enter"&&u(g.id,"asc")},children:[c.jsx("span",{className:`${z.columnSorterLabel} ${M?z.uppercaseSmall:""}`,title:f,"aria-label":f,children:f}),c.jsxs("div",{className:z.sortDirectionButtons,children:[c.jsx("button",{className:`${z.sortDirectionButton} ${t?.key===g.id&&t?.direction==="asc"?z.activeSort:""}`,onClick:()=>u(g.id,"asc"),title:"Trier par ordre croissant",type:"button",children:c.jsx(Ic,{size:12})}),c.jsx("button",{className:`${z.sortDirectionButton} ${t?.key===g.id&&t?.direction==="desc"?z.activeSort:""}`,onClick:()=>u(g.id,"desc"),title:"Trier par ordre décroissant",type:"button",children:c.jsx(Nt,{size:12})})]})]},g.id)})}),h&&c.jsx("div",{className:z.sortActions,children:c.jsxs("button",{className:z.clearSortButton,onClick:p,type:"button",children:[c.jsx(_t,{size:14}),c.jsx("span",{children:"Annuler le tri"})]})})]})]})})})},N5e=({currentPage:e,totalPages:t,pageSize:n,totalItems:o,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=o>0?(h-1)*n+1:0,m=o>0?Math.min(h*n,o):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 I=_;I<=v;I++)f.push(I);return f};return c.jsxs("div",{className:z.paginationContainer,role:"navigation","aria-label":"Pagination",children:[c.jsx("div",{className:z.leftGroup,children:s&&c.jsx("div",{className:z.pageSizeControls,children:c.jsx("select",{value:n,onChange:f=>s(Number(f.target.value)),className:z.pageSizeSelect,"aria-label":"Taille de page",disabled:d,children:[10,20,30].map(f=>c.jsx("option",{value:f,children:f},f))})})}),c.jsx("div",{className:z.paginationInfo,"aria-live":"polite",children:d?c.jsxs("span",{className:z.paginationLoading,children:[c.jsx("span",{className:z.loaderSpinner}),c.jsx("span",{children:"Chargement..."})]}):`${y}-${m} ${i}`}),c.jsxs("div",{className:z.paginationControls,children:[c.jsx("button",{onClick:u,disabled:h===1||d,className:`${z.paginationButton} ${z.navigationButton} ${h===1?z.disabledButton:""} ${d?z.loadingButton:""}`,"aria-label":"Page précédente",children:d&&h>1?c.jsx("span",{className:z.loaderSpinnerSmall}):"«"}),g().map(f=>c.jsx("button",{onClick:()=>r(f),disabled:d,"aria-current":h===f?"page":void 0,className:`${z.paginationButton} ${h===f?z.activeButton:""} ${d?z.loadingButton:""}`,children:d&&h===f?c.jsx("span",{className:z.loaderSpinnerSmall}):f},f)),c.jsx("button",{onClick:p,disabled:d||h>=l,className:`${z.paginationButton} ${z.navigationButton} ${d?z.loadingButton:""} ${h>=l?z.disabledButton:""}`,"aria-label":"Page suivante",children:d?c.jsx("span",{className:z.loaderSpinnerSmall}):"»"})]})]})},S5e=(e,t)=>{if(!e)return"";if(t)return e;const n=String(e).trim();if(!n)return n;const o=n.toLowerCase();return o.charAt(0).toUpperCase()+o.slice(1)},j5e=e=>{if(!e)return!1;const t=e.trim().split(/\s+/);return e.length>18||t.length>2},$5e=({columns:e})=>c.jsx("thead",{className:z.tableHeader,children:c.jsx("tr",{children:e.map((t,n)=>{const o=t.align==="right"?z.alignRight:t.align==="left"?z.alignLeft:z.alignCenter,i=t.preserveHeaderCase===!0,r=S5e(String(t.label??""),i),s=j5e(r),d=s?r.split(/\s+/):[];return c.jsx("th",{className:`${z.headerCell} ${o}`,style:{width:t.width??void 0},"data-preserve":i?"true":"false",children:c.jsx("div",{className:z.headerContent,children:s?c.jsx("div",{className:z.headerWords,children:d.map((l,h)=>c.jsx("span",{className:z.headerWord,children:l},h))}):c.jsx("span",{children:r})})},t.id??`col-${n}`)})})}),q5e=({value:e,row:t,column:n})=>{const o=n.align==="right"?z.alignRight:n.align==="left"?z.alignLeft:z.alignCenter,i=typeof n.render=="function"?n.render(e,t):e==null?"":String(e);return c.jsx("td",{className:`${z.tableCell} ${o}`,style:{width:n.width??void 0},children:c.jsx("div",{className:z.cellContent,children:i})})},A5e=({row:e,rowId:t,columns:n,onRowClick:o,index:i,getRowStyle:r})=>{const s=r?r(e):{},{backgroundColor:d,accentColor:l,...h}=s||{},u={backgroundColor:d,...h,"--row-accent":l??"transparent"};return c.jsx("tr",{className:`${z.tableRow} ${o?z.clickableRow:""}`,onClick:()=>o?.(e,i),style:u,children:n.map(p=>c.jsx(q5e,{value:e[p.id],row:e,column:p},`${t}-${p.id}`))})},z5e=({data:e,columns:t,onRowClick:n,startIndex:o,searchTerm:i,getRowStyle:r})=>e.length===0?c.jsx("tbody",{children:c.jsx("tr",{children:c.jsx("td",{colSpan:t.length,className:z.emptyRow,children:i?"Aucun résultat trouvé":"Aucune donnée disponible"})})}):c.jsx("tbody",{children:e.map((s,d)=>c.jsx(A5e,{row:s.data,rowId:s.id,columns:t,onRowClick:n,index:o+d-1,getRowStyle:r},s.id))}),Pq=({columns:e=[],data:t=[],pagination:n={pageSize:10,currentPage:1},onRowClick:o,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:I,sortLabel:C="Sort",applyLabel:b="Apply",cancelLabel:w="Cancel",clearLabel:L="Clear",applyDisabled:x=!1,paginationLoading:S=!1,filtersLoading:j=!1,sortLoading:$=!1,totalCount:q=null})=>{const[H,P]=k.useState({key:null,direction:"asc"}),[A,N]=k.useState(n.currentPage??1),[V,T]=k.useState(n.pageSize??10),[R,B]=k.useState(!1),F=k.useRef(null),[J,G]=k.useState([]),le=p?d:J,ve=p?[]:J;k.useEffect(()=>{const Y=n.currentPage??1,D1=n.pageSize??10;Y!==A&&N(Y),D1!==V&&T(D1)},[n.currentPage,n.pageSize]);const{paginatedData:ye,sortedData:he,totalPages:K,startIndex:X}=Cq(t,e,i,H,A,V,ve),re=he.length,Ie=typeof q=="number"&&q>=0?q:re;let ke=K;typeof q=="number"&&q>=0&&(ke=Math.max(1,Math.ceil(q/V)));const we=re>10;k.useEffect(()=>{const Y=Math.max(1,Math.floor(ke));A>Y&&N(Y),A<1&&N(1)},[ke]);const se=Y=>{p||G(Y),l?.(Y),N(1),M?.(1)},Me=Y=>{p||G(Y),h?.(Y),N(1),M?.(1),F.current&&F.current.style.setProperty("--filters-panel-height","0px")},Ve=Y=>{M?.(Y),N(Y)},je=Y=>{T(Y),N(1),f?.(Y),M?.(1)},ue=Y=>{F.current&&F.current.style.setProperty("--filters-panel-height",`${Math.round(Y)}px`)},Ce=Y=>{P(Y),u?.(Y)},rt=Y=>{B(Y),!Y&&F.current&&F.current.style.setProperty("--filters-panel-height","0px")};k.useEffect(()=>{(le?.length??0)>0&&B(!0)},[le]),k.useEffect(()=>{s.length>0&&le.length>0&&B(!0)},[s.length,le.length]);const ce=(le?.length??0)>0&&I?I:v;return c.jsxs("div",{ref:F,className:`${z.container} ${r} ${R?z.filtersOpen:""}`,style:{background:g,"--row-height":"48px","--header-height":"56px"},children:[c.jsx("div",{className:z.tableControls,children:c.jsxs("div",{className:z.controlsRight,children:[c.jsx(C5e,{columns:e,onSort:Ce,label:C,sortConfig:H,loading:$}),s.length>0&&c.jsx(w5e,{filters:s,externalFilters:le,onFiltersChange:se,onApply:Me,isControlled:p,debounceTimeout:y,expanded:R,onToggle:rt,panelPlacement:"top",onPanelHeightChange:ue,label:ce,applyLabel:b,cancelLabel:w,clearLabel:L,applyDisabled:x,loading:j})]})}),c.jsx("div",{className:z.topPagination,children:c.jsx(N5e,{currentPage:A,totalPages:ke,pageSize:V,totalItems:Ie,itemLabel:_,onPageChange:Ve,onPageSizeChange:je,loading:S})}),c.jsx("div",{className:`${z.tableWrapper} ${we?z.limitedRows:""}`,"data-table-wrapper":!0,children:c.jsxs("table",{className:z.table,children:[c.jsx($5e,{columns:e}),c.jsx(z5e,{data:ye,columns:e,onRowClick:o,startIndex:X,getRowStyle:m,searchTerm:i})]})})]})};function V5e(e){const{pagination:t,totalCount:n,onPageChange:o,...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||o?.(p))};return c.jsx(Pq,{...i,pagination:{pageSize:r,currentPage:s},totalCount:n,onPageChange:u})}const P5e="_mpRoot_31595_1",T5e="_mpHeader_31595_22",H5e="_mpTitle_31595_31",D5e="_mpList_31595_35",B5e="_mpVertical_31595_41",R5e="_mpHorizontal_31595_46",F5e="_mpItem_31595_55",E5e="_mpClickable_31595_95",O5e="_mpLeft_31595_117",U5e="_mpIcon_31595_125",W5e="_mpMeta_31595_140",G5e="_mpLabel_31595_145",Z5e="_mpDate_31595_154",K5e="_mpRight_31595_160",X5e="_mpValue_31595_168",Y5e="_mpHint_31595_176",J5e="_mpBadge_31595_180",Q5e="_mpBadgeTop_31595_199",eke="_mpBadgeSub_31595_206",tke="_mpBadgeSmall_31595_213",ake="_mpPill_31595_229",nke="_mpRounded_31595_232",oke="_mpCompact_31595_236",cke="_compactItemWrapper_31595_252",ike="_mpSummaryRoot_31595_265",rke="_mpSummaryInner_31595_269",ske="_mpSummaryFlex_31595_284",dke="_mpSummaryCardWrapperHorizontal_31595_292",lke="_mpSummaryCardWrapper_31595_292",hke="_mpSummaryCardHorizontal_31595_303",uke="_mpSummaryCard_31595_292",pke="_mpSummaryValue_31595_321",yke="_mpSummaryLabel_31595_327",kke="_mpSummaryBadge_31595_338",mke="_mpSummaryBadgeSub_31595_357",fke="_mpEmpty_31595_365",gke="_mpSummaryVertical_31595_372",vke="_mpIconSquare_31595_380",U={mpRoot:P5e,mpHeader:T5e,mpTitle:H5e,mpList:D5e,mpVertical:B5e,mpHorizontal:R5e,mpItem:F5e,mpClickable:E5e,mpLeft:O5e,mpIcon:U5e,mpMeta:W5e,mpLabel:G5e,mpDate:Z5e,mpRight:K5e,mpValue:X5e,mpHint:Y5e,mpBadge:J5e,mpBadgeTop:Q5e,mpBadgeSub:eke,mpBadgeSmall:tke,mpPill:ake,mpRounded:nke,mpCompact:oke,compactItemWrapper:cke,mpSummaryRoot:ike,mpSummaryInner:rke,mpSummaryFlex:ske,mpSummaryCardWrapperHorizontal:dke,mpSummaryCardWrapper:lke,mpSummaryCardHorizontal:hke,mpSummaryCard:uke,mpSummaryValue:pke,mpSummaryLabel:yke,mpSummaryBadge:kke,mpSummaryBadgeSub:mke,mpEmpty:fke,mpSummaryVertical:gke,mpIconSquare:vke},Ct=(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 o=n.replace("#","").toLowerCase();if(o.length===3&&(o=o.split("").map(d=>d+d).join("")),!/^[0-9a-f]{6}$/i.test(o))return`rgba(124, 58, 237, ${t})`;const i=parseInt(o.slice(0,2),16),r=parseInt(o.slice(2,4),16),s=parseInt(o.slice(4,6),16);return`rgba(${i}, ${r}, ${s}, ${t})`},Mke=({item:e,shape:t,onItemClick:n,color:o,renderItem:i})=>{const r=k.useCallback(()=>{n?.(e)},[n,e]),s=[U.mpItem,t==="pill"?U.mpPill:U.mpRounded,n?U.mpClickable:""].filter(Boolean).join(" ");if(i)return c.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 c.jsxs(d,{...l,children:[c.jsxs("div",{className:U.mpLeft,children:[h?c.jsx("div",{className:U.mpIconSquare,style:{background:u??Ct(p??o??"#7c3aed",1),border:`1px solid ${Ct(p??o??"#7c3aed",.18)}`,color:p??"#ffffff"},children:k.createElement(h,{size:20,color:p??"#fff",strokeWidth:1.8})}):e.icon?c.jsx("div",{className:U.mpIcon,children:e.icon}):null,c.jsxs("div",{className:U.mpMeta,children:[c.jsx("div",{className:U.mpLabel,children:e.label}),e.subLabel&&c.jsx("div",{className:U.mpDate,children:e.subLabel}),e.date&&c.jsx("div",{className:U.mpDate,children:e.date})]})]}),c.jsxs("div",{className:U.mpRight,children:[c.jsx("div",{className:U.mpValue,style:{color:e.valueColor??o??void 0},children:e.value}),e.badge?c.jsxs("div",{className:[U.mpBadge,e.badge.small?U.mpBadgeSmall:""].join(" "),style:{backgroundColor:e.badge.bg??Ct(e.badge.color||o||"#7c3aed",.12),borderColor:e.badge.bg?"transparent":Ct(e.badge.color||o||"#7c3aed",.18),color:e.badge.color??e.badge.textColor??"#0f172a",fontWeight:600},children:[c.jsx("div",{className:U.mpBadgeTop,children:e.badge.text}),e.badge.subText&&c.jsx("div",{className:U.mpBadgeSub,children:e.badge.subText})]}):e.hint?c.jsx("div",{className:U.mpHint,children:e.hint}):null]})]})},_ke=k.memo(Mke),JS=({title:e,right:t})=>!e&&!t?null:c.jsxs("div",{className:U.mpHeader,children:[c.jsx("div",{className:U.mpTitle,children:e}),c.jsx("div",{children:t})]}),QS=(e,t=1)=>{try{return Ct(e,t)}catch{return`rgba(124, 58, 237, ${t})`}},xke=({item:e})=>c.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:[c.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[c.jsx("div",{style:{fontSize:13,fontWeight:700,color:"#475569"},children:e.label}),c.jsx("div",{style:{fontSize:26,fontWeight:900,color:"#0f172a",lineHeight:1},children:e.value})]}),c.jsx("div",{title:String(e.label),style:{display:"flex",alignItems:"center",justifyContent:"center",width:48,height:48,borderRadius:10,background:e.iconSquareBg??QS("#7c3aed",.12),border:`1px solid ${QS(e.iconColor??"#7c3aed",.12)}`,boxShadow:"none"},children:e.iconComponent?k.createElement(e.iconComponent,{size:18,color:e.iconColor??"#7c3aed",strokeWidth:1.6}):null})]}),Lke=({item:e,bg:t,onClick:n,width:o,height:i,extraStyle:r})=>c.jsxs("div",{className:U.mpSummaryCard,style:{background:t,width:o??void 0,height:i??void 0,...r??{}},role:n?"button":"group",tabIndex:n?0:-1,onClick:()=>n?.(e),children:[c.jsx("div",{className:U.mpSummaryLabel,children:e.label}),c.jsx("div",{className:U.mpSummaryValue,style:{color:e.valueColor??"#2a24deff"},children:e.value}),e.badge&&c.jsxs("div",{className:U.mpSummaryBadge,children:[e.badge.text,e.badge.subText&&c.jsx("div",{className:U.mpSummaryBadgeSub,children:e.badge.subText})]})]}),ej=(e,t=1)=>{try{return Ct(e,t)}catch{return`rgba(124, 58, 237, ${t})`}},tj=e=>c.jsxs("div",{style:{display:"grid",gridTemplateRows:"auto 1fr",width:"100%",gap:8,alignItems:"center",boxSizing:"border-box",minWidth:0},children:[c.jsxs("div",{style:{display:"flex",justifyContent:"space-between-left",alignItems:"baseline",gap:10,width:"100%"},children:[c.jsx("div",{style:{fontWeight:700,fontSize:"clamp(14px, 1.2vw, 16px)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:e.label}),e.subLabel?c.jsx("div",{style:{fontSize:"clamp(13px, 1.1vw, 15px)",fontWeight:600,whiteSpace:"nowrap"},children:e.subLabel}):null]}),c.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:15,width:"100%"},children:[c.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?c.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"8px 12px",borderRadius:10,backgroundColor:e.badge.bg?e.badge.bg:ej("#7c3aed",.08),border:`1px solid ${e.badge.bg?e.badge.bg:ej("#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:[c.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?c.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]})]}),aj=(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}},Ike=e=>{switch(e){case"image":return t=>k.createElement(xke,{item:t});case"pertinence":return t=>k.createElement(Lke,{item:t});case"alternateHorizontal":return t=>aj(tj,t);case"compact":return t=>aj(tj,t);case"summary":return;case"default":default:return}},Tq=({item:e,orientation:t,bg:n,border:o,valueColor:i,onClick:r,width:s,height:d,extraStyle:l})=>{const u=t==="horizontal"?U.mpSummaryCardHorizontal:U.mpSummaryCard;return c.jsxs("div",{className:u,style:{background:n,border:`1px solid ${o}`,width:s??void 0,height:d??void 0,...l??{}},role:r?"button":"group",tabIndex:r?0:-1,onClick:()=>r?.(e),children:[e.badge&&c.jsxs("div",{className:U.mpSummaryBadge,children:[e.badge.text,e.badge.subText&&c.jsx("div",{className:U.mpSummaryBadgeSub,children:e.badge.subText})]}),c.jsx("div",{className:U.mpSummaryValue,style:{color:i},children:e.value}),c.jsx("div",{className:U.mpSummaryLabel,children:e.label})]})},bke=["transparent","transparent","transparent","transparent"],wke=["transparent","transparent","transparent","transparent"],Cke=["#059669","#2563eb","#b45309","#7c3aed"],Nke=(e,t=1)=>{try{return Ct(e,t)}catch{return`rgba(124, 58, 237, ${t})`}},Hq=e=>{const{items:t=[],layout:n="vertical",orientation:o="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=bke,summaryBorderColors:f=wke,summaryValueColors:M=Cke,preset:_,background:v}=e,{itemsContainerStyle:I,itemsContainerClassName:C,summaryGridColumns:b,compactItemWidth:w,compactItemHeight:L,compactItemStyle:x,summaryCardWidth:S,summaryCardHeight:j,summaryCardStyle:$}=e,q=n==="vertical",H={"--mp-accent":r,"--mp-accent-soft":Nke(r,.08),"--mp-bg-primary":v},P=[U.mpRoot,q?U.mpVertical:U.mpHorizontal,s?U.mpCompact:"",m?U.mpSummaryRoot:"",o!=="auto"?o==="vertical"?U.mpOrientationVertical:U.mpOrientationHorizontal:"",h].filter(Boolean).join(" "),A=k.useMemo(()=>y||(Ike(_)??void 0),[y,_]);if(m){const N=o==="horizontal"?U.mpSummaryFlex:U.mpSummaryVertical,T={...(b?{display:"grid",gridTemplateColumns:`repeat(${b}, 1fr)`,gap:18,alignItems:"stretch",width:"100%"}:void 0)??{},...I??{}};return c.jsxs("div",{className:P,style:H,"aria-busy":u,children:[d&&c.jsx(JS,{title:d}),c.jsx("div",{className:U.mpSummaryInner,children:c.jsx("div",{className:`${N} ${C??""}`,style:T,children:t.length===0?c.jsx("div",{className:U.mpEmpty,children:p}):t.map((R,B)=>{const F=R.bgColor??g[B%g.length],J=R.borderColor??f[B%f.length],G=R.valueColor??M[B%M.length];return A?c.jsx("div",{className:o==="horizontal"?U.mpSummaryCardWrapperHorizontal:U.mpSummaryCardWrapper,style:{width:S??void 0,height:j??void 0,...$??{}},children:A(R,B)},R.id):c.jsx(Tq,{item:R,orientation:o==="horizontal"?"horizontal":"vertical",bg:F,border:J,valueColor:G,onClick:l,width:S??void 0,height:j??void 0,extraStyle:$},R.id)})})})]})}return c.jsxs("div",{className:P,style:H,"aria-busy":u,children:[d&&c.jsx(JS,{title:d}),c.jsx("div",{className:U.mpList,style:I,children:u?c.jsx("div",{className:U.mpEmpty,children:"Chargement…"}):t.length===0?c.jsx("div",{className:U.mpEmpty,children:p}):t.map(N=>{const V=s?{width:w??void 0,height:L??void 0,boxSizing:"border-box",...x??{}}:void 0;return c.jsx("div",{className:s?U.compactItemWrapper:void 0,style:V,children:c.jsx(_ke,{item:N,shape:i,onItemClick:l,color:r,renderItem:A?T=>A(T,t.indexOf(T)):void 0})},N.id)})})]})};k.memo(Hq);const Ske=({width:e,height:t,colors:n={text:"#0b1220",background:"#fff",contentBackground:"#efeff0"},titles:o={},placeholder:i="Loading Chart",style:r,className:s="",children:d,padding:l="1rem",variant:h="default",showBorder:u=!1})=>{const p=e?typeof e=="number"?`${e}px`:e:void 0,y=t?typeof t=="number"?`${t}px`:t:void 0,m=i&&typeof i=="object"&&!k.isValidElement(i)&&("text"in i||"subtext"in i||"icon"in i||"background"in i||"iconSize"in i),g=m?i:void 0,f=g?.icon?ut[g.icon]:void 0,M=28,_=g?.iconSize??M,v=["chart-container",`variant-${h}`,u?"with-border":"",s].filter(Boolean).join(" "),I=n.contentBackground??void 0,C=typeof l=="number"?`${l}px`:l;return c.jsxs("div",{className:v,style:{width:p,height:y,color:n.text,background:n.background,display:"flex",flexDirection:"column",boxSizing:"border-box",padding:C,...r},children:[c.jsxs("div",{className:"chart-header",children:[c.jsxs("div",{className:"chart-title-left",style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.left,o.leftSubtitle&&c.jsx("div",{className:"chart-subtitle-left",children:o.leftSubtitle})]}),c.jsx("div",{className:"chart-title-right",children:o.right})]}),c.jsx("div",{className:"chart-content",style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",background:I},children:d||(m&&g?c.jsxs("div",{className:"placeholder",role:"status","aria-live":"polite",children:[f&&c.jsx("div",{className:"placeholder-icon",style:{width:_,height:_},children:c.jsx(f,{color:g.iconColor??"currentColor",size:typeof _=="number"?_:parseInt(String(_),10)||M})}),g.text&&c.jsx("div",{className:"placeholder-text",children:g.text}),g.subtext&&c.jsx("div",{className:"placeholder-subtext",children:g.subtext})]}):c.jsx("div",{className:"placeholder-node",role:"status","aria-live":"polite",children:i}))})]})},Ew=({id:e,size:t="100%",background:n,icon:o,text:i,subtext:r,onClose:s,onClick:d,style:l,className:h="",colorTextPrimary:u,colorTextSub:p,model:y})=>{const m=o||y?.icon?ut[o||y?.icon]:null;return c.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&&c.jsx(m,{className:"alert-icon",size:20,color:u||y?.colorTextPrimary}),c.jsxs("div",{className:"alert-content",children:[c.jsx("span",{className:"alert-text",style:{color:u||y?.colorTextPrimary},children:i}),r&&c.jsx("span",{className:"alert-subtext",style:{color:p||y?.colorTextSub},children:r})]}),s&&c.jsx("button",{className:"alert-close",onClick:s,"aria-label":"Fermer",children:"✕"})]})},Dq=k.createContext(null),jke=(e="alert")=>`${e}_${Math.random().toString(36).slice(2,9)}`,$ke=({children:e,defaultDuration:t=4e3,maxAlerts:n,containerClassName:o,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(L=>window.clearTimeout(L)),d.current.clear()},[]);const p=(L,x)=>{const S=x===void 0||x===0?t:x;if(S===-1)return;const j=window.setTimeout(()=>{g(L)},S);d.current.set(L,j)},y=L=>{const x=d.current.get(L);x&&(window.clearTimeout(x),d.current.delete(L))},m=L=>{const x=jke(),S={...L,id:x,createdAt:Date.now()};return s(j=>{const $=[S,...j],q=u.current;return typeof q=="number"&&q>=0&&$.length>q?($.slice(q).forEach(P=>y(P.id)),$.slice(0,q)):$}),p(x,L.duration),x},g=L=>{y(L),s(x=>x.filter(S=>S.id!==L))},f=(L,x)=>{s(S=>S.map(j=>j.id===L?{...j,...x}:j))},M=()=>{d.current.forEach(L=>window.clearTimeout(L)),d.current.clear(),s([])},_=L=>{h.current=L},v=()=>r.slice(),I=k.useMemo(()=>({showAlert:m,dismissAlert:g,updateAlert:f,clearAlerts:M,setContainerRef:_,getAlertsSnapshot:v}),[r]),C=h.current,b=c.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:c.jsx(k0e,{mode:"popLayout",children:r.map(L=>c.jsx(Hw.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:L.background||L.model?.background||"var(--color-background, #fff)",border:"1px solid rgba(0, 0, 0, 0.08)",overflow:"hidden"},children:c.jsx(Ew,{id:L.id,text:L.text,subtext:L.subtext,icon:L.icon,background:"transparent",colorTextPrimary:L.colorTextPrimary,colorTextSub:L.colorTextSub,model:L.model,onClose:()=>g(L.id),size:"100%",style:{boxShadow:"none"}})},L.id))})}),w=c.jsx("div",{ref:L=>{h.current||(l.current=L)},className:o,style:{width:"100%",position:"relative",...i},"aria-live":"polite",children:b});return c.jsxs(Dq.Provider,{value:I,children:[C?ow.createPortal(b,C):w,e]})},qke=()=>{const e=k.useContext(Dq);if(!e)throw new Error("useAlerts must be used inside an AlertsProvider");return e},Ake={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"}},zke="_container_18zbo_1",Vke="_icon_18zbo_9",Pke="_selectWrapper_18zbo_23",Cb={container:zke,icon:Vke,selectWrapper:Pke},Tke=({options:e,defaultValue:t,onChange:n,label:o})=>{const[i,r]=k.useState(t||e[0]?.value||""),s=d=>{r(d),n?.(d)};return c.jsxs("div",{className:Cb.container,children:[c.jsxs("div",{className:Cb.icon,children:[c.jsx(h1,{size:18}),c.jsx("p",{children:o})]}),c.jsx("div",{className:Cb.selectWrapper,children:c.jsx(Dw,{field:{name:"periode",label:"",options:e},value:i,onChange:s,onBlur:()=>{}})})]})},Hke=250,Dke=k.forwardRef(({title:e,subtitle:t,size:n="420px",beforeOpen:o,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),I=k.useRef(null),C=k.useRef(null);k.useEffect(()=>{const L=_.current;if(!L)return;const x=L.parentElement;return x?(window.getComputedStyle(x).position==="static"&&(x.setAttribute("data-scp-prev-position",x.style.position??""),x.style.position="relative",x.setAttribute("data-scp-position-changed","true")),()=>{if(x.getAttribute("data-scp-position-changed")==="true"){const j=x.getAttribute("data-scp-prev-position")??"";x.style.position=j,x.removeAttribute("data-scp-position-changed"),x.removeAttribute("data-scp-prev-position")}}):void 0},[]),k.useImperativeHandle(y,()=>({open:()=>{m||(o?.(),M(!1),g(!0))},close:()=>{m&&(r?.(),M(!1),g(!1))},toggle:()=>{m?(r?.(),M(!1),g(!1)):(o?.(),M(!1),g(!0))}}),[m,o,r]),k.useEffect(()=>{const L=v.current;C.current&&(window.clearTimeout(C.current),C.current=null);const x=S=>{if(S.target===L&&!(S.propertyName!=="transform"&&S.propertyName!=="opacity"))if(m){M(!0),i?.();try{L?.focus()}catch{}}else{s?.();try{I.current?.focus()}catch{}}};return L&&(L.addEventListener("transitionend",x),C.current=window.setTimeout(()=>{if(m){M(!0),i?.();try{L?.focus()}catch{}}else{s?.();try{I.current?.focus()}catch{}}},Hke+60)),m&&(I.current=document.activeElement),()=>{L&&L.removeEventListener("transitionend",x),C.current&&(window.clearTimeout(C.current),C.current=null)}},[m,i,s]),k.useEffect(()=>{const L=x=>{x.key==="Escape"&&m&&(r?.(),M(!1),g(!1))};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[m,r]);const b=()=>{u&&(r?.(),M(!1),g(!1))},w=typeof n=="number"?`${n}px`:n;return c.jsxs("div",{ref:_,className:`scp-inline-root ${m?"open":""}`,"aria-hidden":!m,children:[c.jsx("div",{className:`scp-overlay ${m?"visible":""}`,onMouseDown:b,role:"presentation"}),c.jsxs("aside",{className:`scp-panel ${m?"in":"out"} ${f?"interactive":""} ${l}`,style:{width:w,...d},ref:v,tabIndex:-1,role:"dialog","aria-label":e,children:[c.jsxs("div",{className:"scp-header",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"scp-title",children:e}),t&&c.jsx("div",{className:"scp-subtitle",children:t})]}),p&&c.jsx("button",{className:"scp-close","aria-label":"Close",onClick:()=>{r?.(),M(!1),g(!1)},children:c.jsx(Ze,{size:18})})]}),c.jsx("div",{className:"scp-body",children:h})]})]})});function Bke(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 Rke="_container_1pfsp_1",Fke="_title_1pfsp_8",nj={container:Rke,title:Fke},Eke=({title:e,fontSize:t,barColor:n,className:o="",style:i={}})=>{const r={...i,"--title-font-size":t,"--bar-color":n};return c.jsx("div",{className:`${nj.container} ${o}`,style:r,children:c.jsx("h2",{className:nj.title,children:e})})},Oke="_modalOverlay_1dmfp_1",Uke="_modalContainer_1dmfp_16",Wke="_modalTitle_1dmfp_29",Gke="_modalInput_1dmfp_38",Zke="_modalTextarea_1dmfp_39",Kke="_modalActions_1dmfp_71",Xke="_cancelBtn_1dmfp_78",Yke="_saveBtn_1dmfp_100",Jke="_inputError_1dmfp_148",Qke="_inlineAlert_1dmfp_153",We={modalOverlay:Oke,modalContainer:Uke,modalTitle:Wke,modalInput:Gke,modalTextarea:Zke,modalActions:Kke,cancelBtn:Xke,saveBtn:Yke,inputError:Jke,inlineAlert:Qke},Nc=({isOpen:e,onClose:t,onSave:n,title:o="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 L={};for(const x of i)L[x.name]=Object.prototype.hasOwnProperty.call(r,x.name)?r[x.name]:"";return y(L),requestAnimationFrame(()=>{m.current?.focus();const x=m.current;if(x&&typeof x.selectionStart=="number"){const S=String(x.value??"").length;x.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 I=(L,x)=>{y(S=>({...S,[L]:x})),l&&l(L,x)},C=async()=>{if(!Object.values(p).some(L=>L===""||L===void 0))try{f(!0);const L=await n(p);if(typeof L=="string"&&L==="duplicate-same"){f(!1);return}y({}),f(!1),t()}catch(L){console.error("AddItemModal onSave error:",L),f(!1),t()}},b=L=>{L.target===L.currentTarget&&t()},w=L=>L.stopPropagation();return c.jsx("div",{className:We.modalOverlay,onMouseDown:b,role:"dialog","aria-modal":"true",children:c.jsxs("div",{className:We.modalContainer,onMouseDown:w,onClick:w,children:[c.jsx("h2",{className:We.modalTitle,children:o}),i.map((L,x)=>{const S=p[L.name]??"",j=x===0&&!!s,$={name:L.name,placeholder:L.placeholder||L.label,value:String(S),onChange:q=>I(L.name,q.target.value),className:L.type==="textarea"?`${We.modalTextarea} ${j?We.inputError:""}`:`${We.modalInput} ${j?We.inputError:""}`,tabIndex:0,disabled:g};return x===0&&($.ref=q=>{m.current=q}),c.jsxs("div",{style:{marginBottom:8},children:[L.type==="textarea"?c.jsx("textarea",{rows:L.rows||4,...$}):c.jsx("input",{type:L.type||"text",...$}),x===0&&M&&s&&c.jsx("div",{style:{marginTop:8},children:c.jsx(Ew,{text:s,background:"#fff5f5",colorTextPrimary:"#ef4444",onClose:()=>_(!1),className:We.inlineAlert})})]},L.name)}),c.jsxs("div",{className:We.modalActions,children:[c.jsx("button",{className:We.cancelBtn,onClick:t,type:"button",disabled:g,children:u}),c.jsx("button",{className:We.saveBtn,onClick:C,type:"button",disabled:g||!!d,children:g?"En cours...":h})]})]})})},e3e=({title:e,keyCount:t,onAddKey:n})=>{const[o,i]=k.useState(!1),r=s=>{const d=s.key;n&&d&&n(d)};return c.jsxs("div",{className:"header-container",children:[c.jsxs("div",{className:"header-info",children:[c.jsx("h1",{children:e}),c.jsxs("p",{children:[t," clés"]})]}),c.jsxs("button",{onClick:()=>i(!0),className:"add-key-button",children:[c.jsx(Oc,{className:"add-key-icon"}),"Clé"]}),c.jsx(Nc,{isOpen:o,title:"Ajouter une clé",onClose:()=>i(!1),onSave:r,fields:[{name:"key",label:"Nouvelle clé",placeholder:"Entrer une nouvelle clé"}]})]})},t3e=({modules:e,onEdit:t,onDelete:n,onAddModule:o,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),_=L=>{if(o){const x=L.code?.trim()||L.id?.trim(),S=L.title?.trim(),j=x||S||String(Date.now()),$=S||x||`Module ${j}`;o({id:j,title:$,subtitle:"",translations:{}})}M()},v=(L,x)=>{L.stopPropagation(),u(x)},I=()=>u(null),C=L=>{if(!h){I();return}const x={...h,title:L.title||h.title,subtitle:""};t&&t(x),I()},b=(L,x)=>{L.stopPropagation(),n&&n(x)},w=L=>{y(L.id),i&&i(L)};return m?c.jsx("div",{className:"module-sidebar collapsed",children:c.jsx(Ec,{size:20,className:"menu-toggle",onClick:()=>g(!1)})}):c.jsxs("div",{className:"module-sidebar",children:[c.jsxs("div",{className:"sidebar-header",children:[c.jsxs("span",{className:"header-text",children:["Modules (",e.length,")"]}),c.jsxs("div",{className:"header-actions",children:[c.jsx(Fc,{size:18,className:"header-folder",onClick:f}),c.jsx(Ec,{size:18,className:"header-menu",onClick:()=>g(!0)})]})]}),c.jsx("hr",{className:"divider"}),c.jsx("div",{className:"module-list",children:e.map(L=>{const x=Object.keys(L.translations||{}).length,S=x>0||L.id===p;return c.jsxs("div",{className:`module-item ${L.id===p?"selected":""}`,onClick:()=>w(L),role:"button",tabIndex:0,onKeyDown:j=>{j.key==="Enter"&&w(L)},children:[c.jsxs("div",{className:"module-left",children:[c.jsx(m1,{size:16,className:"item-folder"}),c.jsxs("div",{className:"module-info",children:[c.jsxs("div",{className:"module-title",children:[L.title,S&&c.jsxs("span",{className:"count",children:[" ",x," "]})]}),L.subtitle?c.jsx("div",{className:"module-subtitle",children:L.subtitle}):null]})]}),c.jsxs("div",{className:"module-actions",children:[t&&c.jsx(v1,{onClick:j=>v(j,L),color:"#777",size:16}),n&&c.jsx(St,{onClick:j=>b(j,L.id),color:"#777",size:16})]})]},L.id)})}),c.jsx(Nc,{isOpen:d,onClose:M,onSave:_,title:s||"Ajouter un module",fields:r&&r.length?r.map(L=>({name:L.name,label:L.label,type:L.type,placeholder:L.placeholder,rows:L.rows})):[{name:"title",label:"Titre",placeholder:"Titre du module"}]}),h&&c.jsx(Nc,{isOpen:!!h,onClose:I,onSave:C,title:"Éditer le module",initialValues:{title:h.title},fields:[{name:"title",label:"Titre",placeholder:"Titre du module"}]})]})},Bq=({placeholder:e="Rechercher une clé ou traduction...",value:t="",onChange:n,iconPosition:o="left",iconColor:i="#9ca3af"})=>c.jsxs("div",{className:`search-container icon-${o}`,children:[c.jsx("div",{className:"search-icon-wrapper",children:c.jsx(M1,{className:"search-icon",color:i})}),c.jsx("input",{type:"text",placeholder:e,value:t,onChange:r=>n?.(r.target.value),className:"search-input"})]}),a3e=({keyName:e,translations:t,availableLanguages:n,onDeleteKey:o,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,I]=k.useState(""),[C,b]=k.useState(!1),[w,L]=k.useState(!1),[x,S]=k.useState(null),[j,$]=k.useState(!1),q=t.map(B=>B.language),H=n.filter(B=>!q.includes(B.code)),P=()=>{y&&v.trim()&&(d?.(e,y,v.trim()),m(""),I(""),p(!1))},A=(B,F)=>{f(B),_(F)},N=B=>{r?.(e,B,M),f(null),_("")},V=()=>{f(null),_("")},T=async B=>{const F=B.name?.trim();if(F){if(S(null),$(!1),F===e||!i)return b(!1),"ok";try{const J=await i(e,F);if(typeof J=="string"&&J==="ok")b(!1),S(null);else{if(typeof J=="string"&&J==="duplicate-same")return S("Une clé existe déjà dans ce module."),$(!0),"duplicate-same";if(typeof J=="string"&&J==="duplicate-other")return b(!1),S(null),"duplicate-other";b(!1)}}catch(J){console.error("Erreur handleRenameSave:",J),S("Erreur lors du renommage.")}}},R=(B,F)=>{if(B!=="name")return;const J=F.trim();S(null),$(!1),J&&typeof h=="function"&&(h(J,e)?(S("Une clé existe déjà dans ce module."),$(!0)):(S(null),$(!1)))};return c.jsxs("div",{className:`translation-key ${w?"collapsed":"expanded"} ${l?"draggable":""}`,children:[c.jsxs("div",{className:"card-header",children:[c.jsxs("div",{className:"header-left",children:[c.jsx("button",{className:"collapse-button",onClick:()=>L(!w),title:w?"Déplier":"Replier",children:w?c.jsx(p1,{className:"collapse-icon"}):c.jsx(Nt,{className:"collapse-icon"})}),c.jsx("h3",{className:"card-title",title:e,children:e})]}),c.jsxs("div",{className:"header-actions",children:[c.jsx("button",{className:"action-button",onClick:B=>{B.stopPropagation(),b(!0)},title:"Renommer la clé",children:c.jsx(lt,{className:"action-icon"})}),c.jsx("button",{onClick:B=>{B.stopPropagation(),o?.(e)},className:"action-button delete",title:"Supprimer la clé",children:c.jsx(St,{className:"action-icon"})})]})]}),c.jsx("div",{className:`translations-container ${w?"":"expanded"}`,children:!l&&c.jsxs(c.Fragment,{children:[t.map(B=>c.jsxs("div",{className:"translation-row",children:[c.jsx("div",{className:"language-code",children:B.language}),c.jsx("div",{className:"translation-content",children:g===B.language?c.jsxs(c.Fragment,{children:[c.jsx("input",{type:"text",value:M,onChange:F=>_(F.target.value),className:"edit-input",autoFocus:!0,onKeyDown:F=>{F.key==="Enter"&&N(B.language),F.key==="Escape"&&V()}}),c.jsx("button",{onClick:()=>N(B.language),className:"save-button",disabled:!M.trim(),children:"Enregistrer"}),c.jsx("button",{onClick:V,className:"cancel-button",children:c.jsx(Ze,{className:"action-icon"})})]}):c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"translation-text",title:B.value,children:B.value}),c.jsx("button",{onClick:()=>A(B.language,B.value),className:"edit-button",title:"Éditer la traduction",children:c.jsx(lt,{className:"action-icon"})}),c.jsx("button",{onClick:()=>s?.(e,B.language),className:"delete-translation-button",title:"Supprimer la traduction",children:c.jsx(Ze,{className:"action-icon"})})]})})]},B.language)),u?c.jsxs("div",{className:"add-language-row",children:[c.jsx("div",{className:"language-code",children:"+"}),c.jsxs("div",{className:"add-language-content",children:[c.jsx("div",{className:"language-select-container",children:c.jsxs("select",{value:y,onChange:B=>m(B.target.value),className:"language-select",children:[c.jsx("option",{value:"",children:"Sélectionnez la langue"}),H.map(B=>c.jsxs("option",{value:B.code,children:[B.name," (",B.code,")"]},B.code))]})}),y&&c.jsx("input",{type:"text",value:v,onChange:B=>I(B.target.value),placeholder:"Entrez la traduction...",className:"translation-input",onKeyDown:B=>{B.key==="Enter"&&P(),B.key==="Escape"&&(p(!1),m(""),I(""))}}),c.jsx("button",{onClick:P,disabled:!y||!v.trim(),className:"save-button",children:"Ajouter"}),c.jsx("button",{onClick:()=>{p(!1),m(""),I("")},className:"cancel-button",children:c.jsx(Ze,{className:"action-icon"})})]})]}):c.jsxs("button",{onClick:()=>p(!0),className:"show-add-button",disabled:H.length===0,children:[c.jsx("span",{className:"plus-icon",children:"+"}),"Ajouter une langue"]})]})}),l&&c.jsxs("div",{className:"drag-overlay",children:[c.jsx(a.Move,{size:24,strokeWidth:1.5}),c.jsx("span",{children:"Glisser pour réorganiser"})]}),c.jsx(Nc,{isOpen:C,onClose:()=>{b(!1),S(null),$(!1)},onSave:T,onFieldChange:R,title:"Renommer la clé",initialValues:{name:e},fields:[{name:"name",label:"Nom de la clé",placeholder:"Nom de la clé"}],errorMessage:x||"",disableSave:j})]})},n3e="_wrapper_1wvht_1",o3e="_leftGroup_1wvht_12",c3e="_filterButton_1wvht_21",i3e="_open_1wvht_42",r3e="_filterIcon_1wvht_42",s3e="_infoText_1wvht_58",d3e="_pickerContainer_1wvht_66",l3e="_srOnly_1wvht_79",h3e="_pickerLabel_1wvht_91",u3e="_datetime_1wvht_98",p3e="_rightGroup_1wvht_107",y3e="_searchInputWrap_1wvht_116",k3e="_searchInput_1wvht_116",m3e="_searchIcon_1wvht_152",$e={wrapper:n3e,leftGroup:o3e,filterButton:c3e,open:i3e,filterIcon:r3e,infoText:s3e,pickerContainer:d3e,srOnly:l3e,pickerLabel:h3e,datetime:u3e,rightGroup:p3e,searchInputWrap:y3e,searchInput:k3e,searchIcon:m3e};function f3e({onDateChange:e,onSearch:t,initialDate:n}){const[o,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 c.jsxs("div",{className:$e.wrapper,ref:d,children:[c.jsxs("div",{className:$e.leftGroup,children:[c.jsxs("button",{type:"button",className:`${$e.filterButton} ${o?$e.open:""}`,onClick:l,"aria-expanded":o,"aria-haspopup":"dialog","aria-controls":"entry-datetime",children:[c.jsx("span",{children:"Entry time"}),c.jsx("svg",{className:$e.filterIcon,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":!0,children:c.jsx("path",{fill:"currentColor",d:"M10 18h4v-2h-4v2zm-7-8v2h18V10H3zm3-6v2h12V4H6z"})})]}),c.jsx("div",{className:$e.infoText,children:"Confidence interval: step ± 15' / exit ± 30'"}),o&&c.jsxs("div",{className:$e.pickerContainer,role:"dialog","aria-label":"Choisir la date et l’heure",children:[c.jsx("label",{className:$e.pickerLabel,htmlFor:"entry-datetime",children:c.jsx("span",{className:$e.srOnly,children:"Choisir la date et l’heure"})}),c.jsx("input",{id:"entry-datetime",className:$e.datetime,type:"datetime-local",value:r,onChange:h,"aria-label":"Date et heure d’entrée"})]})]}),c.jsx("div",{className:$e.rightGroup,children:c.jsxs("div",{className:$e.searchInputWrap,children:[c.jsx("input",{className:$e.searchInput,placeholder:"Search...",onChange:u,"aria-label":"Search"}),c.jsx("svg",{className:$e.searchIcon,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"16",height:"16","aria-hidden":!0,children:c.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 g3e=({className:e="",style:t={},title:n,titleClassName:o="",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(C=>typeof C=="string"),_=g.some(C=>Array.isArray(C)),v=(C,b,w)=>d?d(C,b,w):c.jsx("span",{className:"slb-cell-text",children:C}),I=m?{"--col-gap":m}:void 0;return f?c.jsxs("div",{className:`slb-root ${e}`,style:{...t,background:l??void 0},children:[n&&c.jsx("div",{className:`slb-title ${o}`,style:{...i,background:h??void 0,color:u??void 0},children:n}),c.jsx("div",{className:"slb-empty",children:y??null})]}):M&&!_?c.jsxs("div",{className:`slb-root ${e}`,style:{...t,background:l??void 0},children:[n&&c.jsx("div",{className:`slb-title ${o}`,style:{background:h??void 0,color:u??void 0},children:n}),c.jsx("ul",{className:"slb-list",children:g.map((C,b)=>c.jsx("li",{className:`slb-item ${s[b]||""}`,style:{background:p??void 0},children:v(C,b,0)},b))})]}):c.jsxs("div",{className:`slb-root ${e}`,style:{...t,background:l??void 0},children:[n&&c.jsx("div",{className:`slb-title ${o}`,style:{background:h??void 0,color:u??void 0},children:n}),c.jsx("div",{className:"slb-grid",style:I,children:g.map((C,b)=>{const w=s[b]||"";if(Array.isArray(C)){const[L,x]=C;return c.jsxs("div",{className:`slb-row ${w}`,style:{background:p??void 0},children:[c.jsx("div",{className:"slb-grid-left",children:v(L,b,0)}),c.jsx("div",{className:"slb-grid-right",children:v(x,b,1)})]},b)}return c.jsxs("div",{className:`slb-row ${w}`,style:{background:p??void 0},children:[c.jsx("div",{className:"slb-grid-left",children:v(C,b,0)}),c.jsx("div",{className:"slb-grid-right slb-empty-cell","aria-hidden":"true"})]},b)})})]})},v3e=({className:e="",style:t={},title:n,titleColor:o,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 c.jsxs("div",{className:`clb-root ${e}`,style:{...t},children:[n&&c.jsx("div",{className:"clb-title",style:o?{color:o}:void 0,children:n}),c.jsx("div",{className:"clb-grid",style:m,children:i.map((g,f)=>{const M=u[f]||"";if(Array.isArray(g)){const[_,v]=g,I=s[f]||r;return c.jsxs("div",{className:`clb-row ${M}`,style:{background:h??void 0},children:[c.jsx("div",{className:"clb-badge-col",children:c.jsx("div",{className:"counter-badge",style:{background:I,padding:d,width:l,minWidth:l},children:_})}),c.jsx("div",{className:"clb-text",children:v})]},f)}return y?c.jsxs("div",{className:`clb-row ${M}`,style:{background:h??void 0},children:[c.jsx("div",{className:"clb-badge-col clb-empty-badge"}),c.jsx("div",{className:"clb-text",children:g})]},f):c.jsx("div",{className:`clb-fullrow ${M}`,style:{background:h??void 0},children:c.jsx("span",{children:g})},f)})})]})},M3e=({className:e="",style:t={},title:n,items:o=[],titleBg:i,titleColor:r,itemBg:s,lineClasses:d={},renderTrendIcon:l,colGap:h="1rem"})=>{const u=h?{"--col-gap":h}:void 0;return c.jsxs("div",{className:`tlb-root ${e}`,style:{...t,background:s??void 0},children:[n&&c.jsx("div",{className:"tlb-title",style:{background:i??void 0,color:r??void 0},children:n}),c.jsx("div",{className:"tlb-grid",style:u,children:o.map((p,y)=>{const m=d[y]||"";return c.jsxs("div",{className:`tlb-row ${m}`,style:{background:s??void 0},children:[c.jsx("div",{className:"tlb-label",children:p.label}),c.jsxs("div",{className:"tlb-value-group",children:[c.jsx("div",{className:"tlb-icon-col",children:l?l(p):p.icon??null}),c.jsxs("div",{className:"tlb-value-wrap",children:[c.jsx("div",{className:"tlb-value",children:p.value}),typeof p.delta<"u"&&c.jsx("div",{className:`tlb-delta ${p.delta>0?"positive":p.delta<0?"negative":"neutral"}`,children:p.deltaLabel??String(p.delta)})]})]})]},y)})})]})},_3e=({className:e="",style:t={},children:n,gap:o="1rem"})=>c.jsx("div",{className:`frc-root ${e}`,style:{...t,"--frc-gap":o},children:k.Children.map(n,i=>c.jsx("div",{className:"frc-item",children:i}))}),x3e=({className:e="",style:t={},children:n,gap:o="1rem",background:i="#D9EEF5"})=>c.jsx("div",{className:`lcc-root ${e}`,style:{background:i,...t,"--lcc-gap":o},children:k.Children.map(n,r=>c.jsx("div",{className:"lcc-cell",children:r}))}),L3e="_overlay_i1ay5_2",I3e="_fadeIn_i1ay5_1",b3e="_popup_i1ay5_17",w3e="_slideUp_i1ay5_1",C3e="_header_i1ay5_28",N3e="_body_i1ay5_40",S3e="_footer_i1ay5_51",j3e="_cancelButton_i1ay5_59",$3e="_confirmButton_i1ay5_77",q3e="_warning_i1ay5_97",A3e="_danger_i1ay5_106",z3e="_info_i1ay5_115",gt={overlay:L3e,fadeIn:I3e,popup:b3e,slideUp:w3e,header:C3e,body:N3e,footer:S3e,cancelButton:j3e,confirmButton:$3e,warning:q3e,danger:A3e,info:z3e},V3e=({isOpen:e,title:t,message:n,onConfirm:o,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&&o()};return c.jsx("div",{className:gt.overlay,onClick:l,onKeyDown:h,role:"dialog","aria-labelledby":"confirmation-title","aria-describedby":"confirmation-message",children:c.jsxs("div",{className:`${gt.popup} ${gt[d]}`,children:[c.jsx("div",{className:gt.header,children:c.jsx("h3",{id:"confirmation-title",children:t})}),c.jsx("div",{className:gt.body,children:c.jsx("p",{id:"confirmation-message",children:n})}),c.jsxs("div",{className:gt.footer,children:[c.jsx("button",{className:gt.cancelButton,onClick:i,type:"button",children:s}),c.jsx("button",{className:gt.confirmButton,onClick:o,type:"button",autoFocus:!0,children:r})]})]})})},P3e=()=>{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})},[]),o=k.useCallback(()=>{t(r=>({...r,isOpen:!1,onConfirm:null}))},[]),i=k.useCallback(()=>{e.onConfirm?.(),o()},[e.onConfirm,o]);return{isOpen:e.isOpen,title:e.title,message:e.message,showConfirmation:n,hideConfirmation:o,handleConfirm:i}},T3e="_container_v7v52_1",H3e="_selectButton_v7v52_6",D3e="_disabled_v7v52_19",B3e="_error_v7v52_29",R3e="_outline_v7v52_43",F3e="_filled_v7v52_53",E3e="_sm_v7v52_58",O3e="_md_v7v52_63",U3e="_lg_v7v52_68",W3e="_buttonContent_v7v52_73",G3e="_label_v7v52_80",Z3e="_placeholder_v7v52_87",K3e="_iconsContainer_v7v52_91",X3e="_loadingSpinner_v7v52_99",Y3e="_spin_v7v52_1",J3e="_arrowIcon_v7v52_119",Q3e="_arrowIconOpen_v7v52_127",eme="_dropdown_v7v52_131",tme="_searchContainer_v7v52_146",ame="_searchInput_v7v52_150",nme="_optionsList_v7v52_173",ome="_noResults_v7v52_195",cme="_option_v7v52_173",ime="_optionHighlighted_v7v52_217",rme="_optionSelected_v7v52_222",sme="_optionDisabled_v7v52_228",dme="_optionLabel_v7v52_233",lme="_checkIcon_v7v52_240",hme="_widthFull_v7v52_248",ume="_width64_v7v52_252",pme="_width80_v7v52_256",yme="_width96_v7v52_260",te={container:T3e,selectButton:H3e,disabled:D3e,error:B3e,default:"_default_v7v52_38",outline:R3e,filled:F3e,sm:E3e,md:O3e,lg:U3e,buttonContent:W3e,label:G3e,placeholder:Z3e,iconsContainer:K3e,loadingSpinner:X3e,spin:Y3e,arrowIcon:J3e,arrowIconOpen:Q3e,dropdown:eme,searchContainer:tme,searchInput:ame,optionsList:nme,noResults:ome,option:cme,optionHighlighted:ime,optionSelected:rme,optionDisabled:sme,optionLabel:dme,checkIcon:lme,widthFull:hme,width64:ume,width80:pme,width96:yme},kme=({options:e,value:t,onChange:n,placeholder:o="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}),I=k.useRef(null),C=k.useRef(null),b=k.useRef(null),w=k.useMemo(()=>m?e.filter(N=>N.label.toLowerCase().includes(m.toLowerCase())):e,[e,m]),L=e.find(N=>N.value===t),x=k.useCallback(()=>{if(I.current){const N=I.current.getBoundingClientRect();v({top:N.top,left:N.left,width:N.width})}},[]);k.useEffect(()=>(p&&(x(),window.addEventListener("scroll",x,!0),window.addEventListener("resize",x)),()=>{window.removeEventListener("scroll",x,!0),window.removeEventListener("resize",x)}),[p,x]),k.useEffect(()=>{const N=V=>{I.current&&!I.current.contains(V.target)&&C.current&&!C.current.contains(V.target)&&(y(!1),g(""))};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[]),k.useEffect(()=>{M(0)},[w]);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(V=>V<w.length-1?V+1:V);break;case"ArrowUp":N.preventDefault(),M(V=>V>0?V-1:V);break;case"Enter":N.preventDefault(),w[f]&&S(w[f]);break;case"Escape":y(!1),g("");break}},q=()=>[te.selectButton,te[l],te[h],i?te.disabled:"",s?te.error:"",d].filter(Boolean).join(" "),H=()=>{switch(u){case"w-64":return te.width64;case"w-80":return te.width80;case"w-96":return te.width96;default:return te.widthFull}},P=(N,V)=>[te.option,V===f?te.optionHighlighted:"",N.value===t?te.optionSelected:"",N.disabled?te.optionDisabled:""].filter(Boolean).join(" "),A={position:"fixed",top:_.top+(I.current?.offsetHeight||0)+4,left:_.left,width:_.width,zIndex:9999};return c.jsxs("div",{className:`${te.container} ${H()}`,children:[c.jsx("button",{ref:I,className:q(),onClick:()=>!i&&y(!p),onKeyDown:$,tabIndex:i?-1:0,type:"button","aria-haspopup":"listbox","aria-expanded":p,disabled:i,children:c.jsxs("div",{className:te.buttonContent,children:[c.jsx("span",{className:`${te.label} ${L?"":te.placeholder}`,children:L?L.label:o}),c.jsxs("div",{className:te.iconsContainer,children:[r&&c.jsx("div",{className:te.loadingSpinner}),c.jsx("svg",{className:`${te.arrowIcon} ${p?te.arrowIconOpen:""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]})}),p&&ow.createPortal(c.jsxs("div",{className:`${te.dropdown} ${H()}`,style:A,ref:C,children:[c.jsx("div",{className:te.searchContainer,children:c.jsx("input",{ref:b,type:"text",value:m,onChange:j,placeholder:"Rechercher...",className:te.searchInput,autoFocus:!0})}),c.jsx("div",{className:te.optionsList,children:w.length===0?c.jsx("div",{className:te.noResults,children:"Aucun résultat trouvé"}):c.jsx("ul",{role:"listbox",children:w.map((N,V)=>c.jsx("li",{className:P(N,V),onClick:()=>S(N),onMouseEnter:()=>M(V),role:"option","aria-selected":N.value===t,"aria-disabled":N.disabled,children:c.jsxs("div",{className:te.buttonContent,children:[c.jsx("span",{className:te.optionLabel,title:N.label,children:N.label}),N.value===t&&c.jsx("svg",{className:te.checkIcon,fill:"currentColor",viewBox:"0 0 20 20",children:c.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)]})},mme="_container_uq7pt_1",fme="_item_uq7pt_7",gme="_mainValue_uq7pt_13",vme="_label_uq7pt_17",Mme="_subValue_uq7pt_22",_me="_subValueWrapper_uq7pt_27",xme="_subSeparator_uq7pt_32",Be={container:mme,item:fme,mainValue:gme,label:vme,subValue:Mme,subValueWrapper:_me,subSeparator:xme},Lme=({dms:e,stats:t=[],itemWidth:n="120px",valueFontSize:o="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 c.jsxs("span",{className:Be.subValueWrapper,children:[c.jsx("span",{className:Be.subLeft,style:{color:y},children:g}),c.jsx("span",{className:Be.subSeparator,children:" / "}),c.jsx("span",{className:Be.subRight,style:{color:m},children:f})]})};return c.jsxs("div",{className:Be.container,style:{backgroundColor:d},children:[e&&c.jsxs("div",{className:Be.item,style:{flex:`1 1 ${n}`},children:[c.jsx("div",{className:Be.mainValue,style:{fontSize:o,fontWeight:i,color:h},children:e}),c.jsx("div",{className:Be.label,style:{color:l},children:"DMS"})]}),t.map((p,y)=>c.jsxs("div",{className:Be.item,style:{flex:`1 1 ${n}`},children:[c.jsx("div",{className:Be.mainValue,style:{fontSize:o,fontWeight:i,color:h},children:p.value}),c.jsx("div",{className:Be.label,style:{color:l},children:p.label}),c.jsx("div",{className:Be.subValue,style:{fontSize:r,fontWeight:s},children:p.subValue&&u(p.subValue,p.subLeftColor,p.subRightColor)})]},y))]})},Ime="_encours_16ist_1",bme="_header_16ist_19",wme="_iconWrap_16ist_27",Cme="_title_16ist_36",Nme="_items_16ist_47",Sme="_spaceEvenly_16ist_56",jme="_item_16ist_47",$me="_valueContainer_16ist_86",qme="_value_16ist_86",Ame="_label_16ist_108",et={encours:Ime,header:bme,iconWrap:wme,title:Cme,items:Nme,spaceEvenly:Sme,item:jme,valueContainer:$me,value:qme,label:Ame},Lc=e=>typeof e=="number"?`${e}px`:typeof e=="string"?e:void 0;function zme(e,t){const n={},o={};return e.valueColor&&(n.color=e.valueColor),e.valueFontSize!==void 0?n.fontSize=Lc(e.valueFontSize):t.defaultValueFontSize!==void 0&&(n.fontSize=Lc(t.defaultValueFontSize)),e.valueFontWeight!==void 0?n.fontWeight=e.valueFontWeight:t.defaultValueFontWeight!==void 0&&(n.fontWeight=t.defaultValueFontWeight),e.labelColor&&(o.color=e.labelColor),e.labelFontSize!==void 0?o.fontSize=Lc(e.labelFontSize):t.defaultLabelFontSize!==void 0&&(o.fontSize=Lc(t.defaultLabelFontSize)),e.labelFontWeight!==void 0?o.fontWeight=e.labelFontWeight:t.defaultLabelFontWeight!==void 0&&(o.fontWeight=t.defaultLabelFontWeight),{valueStyle:n,labelStyle:o}}function Vme(){return c.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[c.jsx("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"1.4"}),c.jsx("path",{d:"M8 12h8",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})}function Pme(e){const{title:t,titleColor:n,titleFontSize:o,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,I=r?ut[r]:void 0,C={background:g,width:Lc(f),...m},b={};n&&(b.color=n),o!==void 0&&(b.fontSize=Lc(o)),i!==void 0&&(b.fontWeight=i);const w={};return d&&(w.color=d),c.jsxs("section",{className:`${et.encours} ${_??""}`,style:C,"aria-label":v??t,children:[c.jsxs("div",{className:et.header,children:[c.jsx("div",{className:et.iconWrap,"aria-hidden":!0,style:w,children:I?c.jsx(I,{size:typeof s=="number"?s:void 0}):c.jsx(Vme,{})}),c.jsx("div",{className:et.title,style:b,children:t})]}),c.jsx("div",{className:`${et.items} ${M===void 0?et.spaceEvenly:""}`,role:"list",style:M!==void 0?{gap:`${M}px`}:{},children:y.map((L,x)=>{const{valueStyle:S,labelStyle:j}=zme(L,{defaultValueFontSize:l,defaultValueFontWeight:h,defaultLabelFontSize:u,defaultLabelFontWeight:p});return c.jsx("div",{className:et.item,role:"listitem",style:{...L.background?{background:L.background}:{},...L.width?{width:Lc(L.width)}:{}},children:c.jsxs("div",{className:et.valueContainer,children:[c.jsx("div",{className:et.value,style:S,children:L.value}),L.label&&c.jsx("div",{className:et.label,style:j,children:L.label})]})},`${String(L.label??L.value)}-${x}`)})})]})}const Tme=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"})),Hme=k.memo(Tme),Dme=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"})),Bme=k.memo(Dme),Rme=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"})),Fme=k.memo(Rme),Eme=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"})),Ome=k.memo(Eme),Ume=({items:e,onSave:t,loading:n,disabled:o,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})=>{const[u,p]=k.useState(!1),[y,m]=k.useState(e),[g,f]=k.useState(!1);if(k.useEffect(()=>{f(!0)},[]),k.useEffect(()=>{m(e)},[e]),!g)return null;const M=(v,I)=>{I<4||m(C=>C.map(b=>b.component_key===v?{...b,visible:!b.visible}:b))},_=()=>{t(y),p(!1)};return c.jsxs("div",{style:{position:"relative",display:"inline-block",...h},children:[c.jsxs("div",{onClick:()=>{o||p(!u)},style:{display:"flex",alignItems:"center",cursor:o?"not-allowed":"pointer",borderRadius:4,transition:"background 0.2s"},title:s,children:[c.jsx(_j,{width:d,height:d,fill:l?.icon||"currentColor",style:{transition:"color 0.2s"}}),u?c.jsx(Bme,{width:d,height:d,fill:l?.icon||"currentColor"}):c.jsx(Hme,{width:d,height:d,fill:l?.icon||"currentColor"})]}),u&&c.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:[c.jsx("ul",{style:{listStyle:"none",padding:0,margin:0},children:y.map((v,I)=>c.jsxs(k.Fragment,{children:[c.jsxs("li",{onClick:()=>M(v.component_key,I),style:{display:"flex",alignItems:"center",padding:"0.5rem",cursor:I<4?"not-allowed":"pointer",transition:"background 0.2s"},onMouseEnter:C=>{I>=4&&(C.currentTarget.style.background="#F9FAFB")},onMouseLeave:C=>{I>=4&&(C.currentTarget.style.background="transparent")},children:[c.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",marginRight:8,flexShrink:0},children:v.visible?c.jsx(Fme,{width:20,height:20,fill:l?.activeBg||"var(--color-primary, #008FBB)"}):c.jsx(Ome,{width:20,height:20,fill:"#D1D5DB"})}),c.jsx("span",{style:{fontSize:"14px",color:"#111827",fontWeight:400,userSelect:"none"},children:v.label})]}),I===3&&c.jsx("div",{style:{height:1,background:"#E5E7EB",margin:"4px 0"}})]},v.component_key))}),c.jsx("div",{style:{padding:"12px 16px 0 16px",display:"flex",justifyContent:"flex-end"},children:c.jsx("button",{type:"button",onClick:_,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})})]})]})},Wme="_container_zhny9_1",Gme="_card_zhny9_15",Zme="_footer_zhny9_33",Kme="_noPaddingMobile_zhny9_51",W1={container:Wme,card:Gme,footer:Zme,noPaddingMobile:Kme},Xme="_board_1tbkr_1",Yme="_clickable_1tbkr_21",Jme="_sideBar_1tbkr_26",Qme="_boardContent_1tbkr_32",e6e="_orange_1tbkr_40",t6e="_red_1tbkr_44",a6e="_green_1tbkr_48",n6e="_grey_1tbkr_52",o6e="_lightGrey_1tbkr_56",c6e="_big_1tbkr_61",i6e="_medium_1tbkr_66",r6e="_headerRow_1tbkr_70",s6e="_iconWrapper_1tbkr_75",d6e="_headerTitle_1tbkr_80",l6e="_valueArea_1tbkr_89",h6e="_titleWhite_1tbkr_99",u6e="_titleBlack_1tbkr_103",p6e="_valueWhite_1tbkr_108",y6e="_valueBlack_1tbkr_112",k6e="_valueBlue_1tbkr_116",m6e="_bars_1tbkr_121",f6e="_bar_1tbkr_121",g6e="_barDark_1tbkr_135",v6e="_barDim_1tbkr_139",Fe={board:Xme,clickable:Yme,sideBar:Jme,boardContent:Qme,orange:e6e,red:t6e,green:a6e,grey:n6e,lightGrey:o6e,big:c6e,medium:i6e,headerRow:r6e,iconWrapper:s6e,headerTitle:d6e,valueArea:l6e,titleWhite:h6e,titleBlack:u6e,valueWhite:p6e,valueBlack:y6e,valueBlue:k6e,bars:m6e,bar:f6e,barDark:g6e,barDim:v6e},M6e=({endingDark:e=!1,lightCount:t=5,className:n=""})=>{const o=Math.max(0,Math.min(5,Math.floor(t)));return c.jsx("div",{className:`${Fe.bars} ${n} bars-data-board`,children:Array.from({length:5}).map((i,r)=>c.jsx("span",{className:`${Fe.bar} ${r<o?"":e?Fe.barDark:Fe.barDim}`},r))})},bt=({iconName:e,label:t,value:n,backgroundColor:o="green",bars:i,lightBars:r=5,size:s="big",valueScale:d,width:l,height:h,className:u="",style:p,titleColor:y="white",valueColor:m="white",titleFontSize:g,titleFontWeight:f,valueFontSize:M,valueFontWeight:_,barColor:v,justifyContent:I="space-between",alignItems:C="flex-start",cardGap:b="",onClick:w,iconColor:L})=>{const x=i!=="none",S=i==="endingDark",{padding:j,...$}=p||{},q=l===void 0&&h===void 0&&o===void 0&&Object.keys($).length===0?void 0:{...l!==void 0?{width:l}:{},...h!==void 0?{height:h}:{},...o!==void 0?{backgroundColor:o}:{},...$},H=`${Fe.board} ${Fe[s]} ${u}`;return c.jsxs("div",{className:H,onClick:w,style:d!==void 0?{...q,"--ds-value-scale":d}:q,children:[v&&c.jsx("div",{className:Fe.sideBar,style:{backgroundColor:v}}),c.jsxs("div",{className:Fe.boardContent,style:{padding:j,gap:b},children:[c.jsxs("div",{className:Fe.headerRow,style:{justifyContent:I,alignItems:C},children:[e&&c.jsx("div",{className:Fe.iconWrapper,style:{color:L},children:e}),c.jsx("div",{className:`${Fe.headerTitle} header-title-data-board`,children:c.jsx("span",{style:{color:y,...g?{fontSize:g}:{},...f?{fontWeight:f}:{}},children:t})}),x?c.jsx(M6e,{endingDark:S,lightCount:r}):null]}),c.jsx("div",{className:Fe.valueArea,style:{color:m,...M?{fontSize:M}:{},..._?{fontWeight:_}:{}},children:n})]})]})},_6e="_wrapper_tldrb_10",x6e="_hosp_tldrb_19",L6e="_headerRow_tldrb_54",I6e="_iconWrapper_tldrb_61",b6e="_headerTitle_tldrb_67",w6e="_hospValue_tldrb_76",C6e="_side_tldrb_88",N6e="_mini_tldrb_100",S6e="_miniLabel_tldrb_134",j6e="_miniValue_tldrb_143",$6e="_miniBars_tldrb_153",q6e="_bars_tldrb_158",A6e="_bar_tldrb_158",z6e="_barDark_tldrb_172",V6e="_barDim_tldrb_176",Ne={wrapper:_6e,hosp:x6e,headerRow:L6e,iconWrapper:I6e,headerTitle:b6e,hospValue:w6e,side:C6e,mini:N6e,miniLabel:S6e,miniValue:j6e,miniBars:$6e,bars:q6e,bar:A6e,barDark:z6e,barDim:V6e},P6e=({endingDark:e=!1,lightCount:t=5,className:n=""})=>{const o=Math.max(0,Math.min(5,Math.floor(t)));return c.jsx("div",{className:`${Ne.bars} ${n} bars-data-board`,children:Array.from({length:5}).map((i,r)=>c.jsx("span",{className:`${Ne.bar} ${r<o?"":e?Ne.barDark:Ne.barDim}`},r))})},Rq=({left:e,right:t,className:n="",style:o})=>{const i=e.bars??"endingDark",r=i!=="none",s=i==="endingDark";return c.jsxs("div",{className:`${Ne.wrapper} ${n} data-four-boards`,style:o,children:[c.jsxs("div",{className:`${Ne.hosp} ${e.className||""}`,onClick:e.onClick,style:{...e.width?{width:e.width}:{},...e.height?{height:e.height}:{},...e.backgroundColor?{backgroundColor:e.backgroundColor}:{},...e.style||{}},children:[c.jsxs("div",{className:Ne.headerRow,children:[c.jsxs("div",{className:`${Ne.iconWrapper} icon-wrapper-data-four-boards`,children:[e.iconName&&c.jsx("span",{style:{color:e.iconColor},children:e.iconName}),c.jsx("span",{className:Ne.headerTitle,style:{color:e.titleColor||"white",...e.titleFontSize?{fontSize:e.titleFontSize}:{},...e.titleFontWeight?{fontWeight:e.titleFontWeight}:{}},children:e.label})]}),r?c.jsx(P6e,{endingDark:s,lightCount:e.lightBars??5}):null]}),c.jsx("div",{className:Ne.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})]}),c.jsx("div",{className:Ne.side,children:t.map((d,l)=>c.jsxs("div",{className:`${Ne.mini} ${d.className||""} icon-wrapper-data-four-boards`,onClick:d.onClick,style:{...d.width?{width:d.width}:{},...d.height?{height:d.height}:{},...d.backgroundColor?{backgroundColor:d.backgroundColor}:{},...d.style||{}},children:[c.jsxs("span",{className:Ne.miniLabel,style:{color:d.titleColor||"white",textAlign:"right",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",...d.titleFontSize?{fontSize:d.titleFontSize}:{},...d.titleFontWeight?{fontWeight:d.titleFontWeight}:{}},children:[d.iconName&&c.jsx("span",{style:{color:d.iconColor,marginRight:"4px"},children:d.iconName}),d.label]}),c.jsx("span",{className:`${Ne.miniValue} mini-value-data-four-boards`,style:{color:d.valueColor||"white",textAlign:"right",...d.valueScale!==void 0?{"--ds-value-scale":d.valueScale}:{},...d.valueFontSize?{fontSize:d.valueFontSize}:{},...d.valueFontWeight?{fontWeight:d.valueFontWeight}:{}},children:d.value}),c.jsx("div",{className:Ne.miniBars})]},d.id??`${d.label}-${l}`))})]})},T6e=({items:e,footerLabel:t,width:n,height:o,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:o,backgroundColor:d??"var(--ds-navy)",...r},f=e[0],M=e[1],_=e.slice(2,5);return c.jsxs("div",{style:g,className:`${W1.container} ${y?W1.noPaddingMobile:""} ${s}`,children:[c.jsxs("div",{className:W1.card,children:[f?c.jsx(bt,{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,onClick:v=>m?.(0,v)}):null,M&&_.length>0?c.jsx(Rq,{left:{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,onClick:v=>m?.(1,v)},right:_.map((v,I)=>({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,onClick:C=>m?.(2+I,C)}))}):M&&_.length===0?c.jsx(bt,{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&&c.jsx("div",{className:W1.footer,children:t})]})},H6e=({data:e,height:t=360,barColor:n="#0284C7",tooltipEnabled:o=!0,backgroundColor:i="#ffffff",legendTextColor:r="#000",barHeight:s=100,yAxisWidth:d=240,fontSize:l="12px",fontWeight:h="400"})=>c.jsx("div",{style:{backgroundColor:i},children:c.jsx(a.ResponsiveContainer,{width:"100%",height:t,children:c.jsxs(a.BarChart,{data:e,layout:"vertical",children:[c.jsx(a.CartesianGrid,{stroke:"#E5E7EB",vertical:!1}),c.jsx(a.XAxis,{type:"number",axisLine:!1,tickLine:!1,fontSize:l,fontWeight:h,stroke:r}),c.jsx(a.YAxis,{type:"category",dataKey:"label",stroke:r,axisLine:!1,tickLine:!1,width:d,interval:0,fontSize:l,fontWeight:h}),o&&c.jsx(a.Tooltip,{}),c.jsx(a.Bar,{dataKey:"value",fill:n,radius:0,barSize:s})]})})}),D6e="_menu_10i6j_1",B6e="_menuRow_10i6j_18",R6e="_separator_10i6j_33",F6e="_rowLabel_10i6j_39",E6e="_rowLeadingIcon_10i6j_47",O6e="_rowIcon_10i6j_54",zc={menu:D6e,menuRow:B6e,separator:R6e,rowLabel:F6e,rowLeadingIcon:E6e,rowIcon:O6e},U6e=k.forwardRef(function({isVisible:t,onClose:n,items:o,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 c.jsx("div",{ref:h,role:"menu",className:zc.menu,style:p,children:o.map(y=>{if(y.type==="separator")return c.jsx("hr",{className:zc.separator},y.id);const m=y,g=m.color?{color:m.color}:{},f=m.closeOnClick!==!1;return c.jsxs("button",{role:"menuitem",className:zc.menuRow,style:g,onClick:()=>{m.onClick?.(),f&&n?.()},children:[c.jsxs("span",{className:zc.rowLabel,children:[m.leadingIcon&&c.jsx("span",{className:zc.rowLeadingIcon,children:m.leadingIcon}),c.jsx("span",{children:m.label})]}),m.icon&&c.jsx("span",{className:zc.rowIcon,children:m.icon})]},m.id)})})}),Fq=({user:e,logoutHref:t,logoutTarget:n="_self",onLogout:o,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:I,dropdownMenuOffset:C,statusDotColor:b,style:w,className:L=""})=>{const{user:x}=it(),S=e||x,{currentTheme:j,switchTheme:$}=sL(),q=k.useRef(null),H=k.useRef(null),[P,A]=k.useState(!1),[N,V]=k.useState({}),T=k.useMemo(()=>{const K=[],X=({variant:Ie})=>Ie==="sun"?c.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:c.jsx("circle",{cx:"12",cy:"12",r:"4"})}):c.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:c.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})});i&&(K.push({id:"profile",type:"action",label:"Mon profil",onClick:()=>{typeof window>"u"||(r==="_blank"?window.open(i,"_blank","noopener,noreferrer"):window.location.assign(i))}}),K.push({id:"sep-profile",type:"separator"}));const re=j==="dark";return K.push({id:"theme",type:"action",label:re?"Mode clair":"Mode sombre",icon:c.jsx(X,{variant:re?"sun":"moon"}),onClick:()=>{$(re?"light":"dark")}}),(t||o)&&(K.push({id:"sep-theme",type:"separator"}),K.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}o?.()}})),K},[j,t,n,o,i,r,$]),R=v??T,B=()=>{if(!q.current){A(K=>!K);return}if(!P){const K=q.current.getBoundingClientRect(),X=window.innerWidth,re=window.innerHeight,Ie=200,ke=200,we=4,se=C?.x??0,Me=C?.y??0,je=X-K.right>=Ie+we;V(je?{top:K.bottom-ke+Me,left:K.right+we+se}:{bottom:re-K.top+Me,left:K.left+se})}A(K=>!K)};if(k.useEffect(()=>{if(!P||!q.current)return;const K=()=>{const X=q.current.getBoundingClientRect(),re=window.innerWidth,Ie=window.innerHeight,ke=200,we=200,se=4,Me=C?.x??0,Ve=C?.y??0,ue=re-X.right>=ke+se;V(ue?{top:X.bottom-we+Ve,left:X.right+se+Me}:{bottom:Ie-X.top+Ve,left:X.left+Me})};return window.addEventListener("resize",K),window.addEventListener("orientationchange",K),()=>{window.removeEventListener("resize",K),window.removeEventListener("orientationchange",K)}},[P,C]),k.useEffect(()=>{if(!P||!q.current||!H.current)return;const K=()=>{const re=q.current.getBoundingClientRect(),Ie=H.current.getBoundingClientRect(),ke=C?.x??0,we=C?.y??0;V(se=>se.left!==void 0&&se.top!==void 0&&se.left>=re.right-1?{top:re.bottom-Ie.height+we,left:se.left+ke}:se)},X=requestAnimationFrame(()=>{setTimeout(K,0)});return()=>cancelAnimationFrame(X)},[P,C]),!S)return null;const F=S,J=parseInt(h,10)||40,G=`${J*.375}px`,le=`${J*1.375}px`,ve=`${J*.2}px`,ye=`${J*.6}px`,he=()=>{const K=parseInt(h,10)||40,X=Math.max(8,K*.34375),re=Math.max(2,K*.05);return c.jsxs(c.Fragment,{children:[c.jsxs("div",{style:{position:"relative",flexShrink:0,userSelect:"none"},children:[F.image?c.jsx("img",{src:F.image,alt:`${F.prenom} ${F.nom}`,style:{width:h,height:h,borderRadius:"50%",objectFit:"cover",userSelect:"none"}}):c.jsxs("div",{style:{width:h,height:h,position:"relative",borderRadius:"50%",backgroundColor:_,overflow:"hidden",userSelect:"none"},children:[c.jsx("div",{style:{width:G,height:G,borderRadius:"50%",backgroundColor:M,position:"absolute",top:ve,left:"50%",transform:"translateX(-50%)",zIndex:2,userSelect:"none"}}),c.jsx("div",{style:{width:le,height:le,borderRadius:"50%",backgroundColor:M,position:"absolute",top:ye,left:"50%",transform:"translateX(-50%)",zIndex:1,userSelect:"none"}})]}),b&&c.jsx("div",{style:{position:"absolute",bottom:re,right:re,width:`${X}px`,height:`${X}px`,borderRadius:"50%",backgroundColor:b,border:"2px solid white",zIndex:10}})]}),c.jsxs("div",{style:{display:"flex",flexDirection:"column",minWidth:0,flex:1},children:[c.jsx("span",{style:{fontWeight:m,fontSize:y,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:F.email,children:F.email}),c.jsx("span",{style:{color:l,fontSize:g,fontWeight:f,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:F.role,children:F.role})]})]})};return c.jsxs(c.Fragment,{children:[c.jsx("div",{ref:q,className:`user-info ${L}`,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",...w},onClick:B,role:"button",tabIndex:0,children:c.jsx("div",{style:{display:"flex",alignItems:"center",gap:p,flex:1,minWidth:0},children:c.jsx(he,{})})}),c.jsx(U6e,{ref:H,isVisible:P,onClose:()=>A(!1),items:R,style:I,position:N})]})},W6e="_navItem_16uqf_1",G6e="_label_16uqf_14",Z6e="_icon_16uqf_26",a1={navItem:W6e,label:G6e,icon:Z6e},Ow=({label:e,onClick:t,href:n,isActive:o,icon:i,style:r,className:s="",highlightColor:d="#00aec7",color:l="#333",activeColor:h="#00aec7",highlightBackgroundColor:u="rgba(0, 0, 0, 0.05)",fontSize:p="15px",fontWeight:y="500",sidebarCollapsed:m=!1,padding:g="10px 16px",borderWidth:f="4px",iconGap:M="12px",disabled:_=!1,disabledColor:v})=>{const I=()=>{_||t?.()},C=c.jsxs(c.Fragment,{children:[i&&c.jsx("span",{className:a1.icon,style:{marginRight:m?0:M},children:i}),!m&&c.jsx("span",{className:a1.label,children:e})]}),b=()=>{if(!o)return"transparent";const L=x=>{const S=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(x);return S?{r:parseInt(S[1],16),g:parseInt(S[2],16),b:parseInt(S[3],16)}:null};if(d.startsWith("#")){const x=L(d);if(x)return`rgba(${x.r}, ${x.g}, ${x.b}, 0.08)`}else if(d.startsWith("rgb")){const x=d.match(/\d+/g);if(x&&x.length>=3)return`rgba(${x[0]}, ${x[1]}, ${x[2]}, 0.08)`}return u},w={onClick:I,className:`${a1.navItem} ${o?a1.active:""} ${s} ${_?a1.disabled:""}`,style:{padding:g,color:o?h:_?v||"#999":l,borderLeft:o?`${f} solid ${d}`:`${f} solid transparent`,backgroundColor:b(),fontSize:p,fontWeight:y,cursor:_?"not-allowed":"pointer",textDecoration:"none",...r},"aria-disabled":_};return n&&!_?c.jsx("a",{href:n,...w,children:C}):c.jsx("div",{...w,role:t?"button":void 0,tabIndex:t&&!_?0:void 0,children:C})},K6e="_navbar_agnn2_1",X6e="_topSection_agnn2_9",Y6e="_sectionsContainer_agnn2_14",J6e="_sectionTitle_agnn2_20",Q6e="_sectionItems_agnn2_25",e8e="_bottomSection_agnn2_30",t8e="_versionContainer_agnn2_49",st={navbar:K6e,topSection:X6e,sectionsContainer:Y6e,sectionTitle:J6e,sectionItems:Q6e,bottomSection:e8e,versionContainer:t8e},a8e=({logoProps:e,logoSpacing:t,navItems:n,padding:o="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:I="11px",sectionTitleColor:C="#999",sectionTitleWeight:b="500",versionFontSize:w="12px",versionFontWeight:L="400",versionColor:x="#999",userInfoProps:S,style:j,className:$="",width:q="280px",showLogo:H=!0})=>{const P=it(),A=P.activeNav,N=P.setActiveNav,V=P.user,T=S.user||V;return c.jsxs("div",{className:`${st.navbar} ${$}`,style:{width:q,backgroundColor:s,padding:o,...j},children:[c.jsxs("div",{className:st.topSection,style:{gap:t},children:[H&&c.jsx("div",{className:st.logoContainer,children:c.jsx(rL,{...e})}),c.jsx("div",{className:st.sectionsContainer,style:{gap:i},children:n.map((R,B)=>c.jsxs("div",{className:st.section,children:[R.title&&c.jsx("div",{className:st.sectionTitle,style:{fontSize:I,color:C,padding:v,fontWeight:b,border:"4px solid transparent",...u},children:R.title}),c.jsx("div",{className:st.sectionItems,style:{gap:r},children:R.items.map(F=>c.jsx(Ow,{...F,isActive:F.isActive===null?F.isActive:A===F.id,onClick:()=>{F.onClick&&F.onClick(),F.isActive==null&&N(F.id)},highlightColor:d,activeColor:d,highlightBackgroundColor:l,padding:y,borderWidth:m,iconGap:g,fontSize:f,fontWeight:M,color:_,style:p},F.id))})]},B))})]}),c.jsxs("div",{className:st.bottomSection,style:{gap:t},children:[c.jsx(Fq,{...S,user:T}),h&&c.jsx("div",{className:st.versionContainer,style:{fontSize:w,fontWeight:L,color:x},children:h})]})]})},n8e="_container_4qege_1",o8e="_titleContainer_4qege_10",c8e="_title_4qege_10",i8e="_inlineToggleContainer_4qege_24",r8e="_rightContentContainer_4qege_30",n1={container:n8e,titleContainer:o8e,title:c8e,inlineToggleContainer:i8e,rightContentContainer:r8e},s8e=({className:e="",style:t,fontSize:n="20px",fontWeight:o="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}=it(),_=y.find(I=>I.id===M),v=m(_?_.label:M);return v?c.jsxs("div",{className:`${n1.container} ${e}`,style:{padding:r,margin:s,backgroundColor:d,width:l,height:h,border:u,borderRadius:p,...t},children:[c.jsxs("div",{className:n1.titleContainer,children:[c.jsx("div",{className:n1.title,style:{fontSize:n,fontWeight:o,color:i},children:v}),f&&c.jsx("div",{className:n1.inlineToggleContainer,children:f})]}),g&&c.jsx("div",{className:n1.rightContentContainer,children:g})]}):null},d8e="_navItem_1hg26_1",l8e="_navItemIcon_1hg26_21",h8e="_navItemLabel_1hg26_29",u8e="_navItemCount_1hg26_36",p8e="_navItemIndicator_1hg26_49",o1={navItem:d8e,navItemIcon:l8e,navItemLabel:h8e,navItemCount:u8e,navItemIndicator:p8e},Eq=({label:e,isActive:t,onClick:n,href:o,icon:i,count:r,activeColor:s="#00aec7",inactiveColor:d="#666",activeBackgroundColor:l="transparent",countBackgroundColor:h,countColor:u="#fff",countBorderRadius:p="10px",countPadding:y="2px 6px",countFontSize:m="12px",countFontWeight:g="500",indicatorColor:f="#00aec7",indicatorHeight:M="3px",padding:_="8px 4px",fontSize:v="14px",fontWeight:I="500",gap:C="8px",style:b,className:w="",disabled:L=!1})=>{const x=()=>{L||(n?.(),o&&(window.location.href=o))};return c.jsxs("div",{className:`${o1.navItem} ${w}`,onClick:x,style:{gap:C,padding:_,color:t?s:d,backgroundColor:t?l:"transparent",fontSize:v,fontWeight:I,...b},children:[i&&c.jsx("span",{className:o1.navItemIcon,children:i}),c.jsx("span",{className:o1.navItemLabel,children:e}),r!==void 0&&c.jsx("span",{className:o1.navItemCount,style:{backgroundColor:h,color:u,borderRadius:p,padding:y,fontSize:m,fontWeight:g},children:r}),t&&!L&&c.jsx("div",{className:o1.navItemIndicator,style:{height:M,backgroundColor:f}})]})},y8e="_container_13hsa_1",k8e="_groupHeader_13hsa_8",m8e="_groupHeaderLeft_13hsa_18",f8e="_groupIcon_13hsa_23",g8e="_dropdown_13hsa_29",v8e="_item_13hsa_42",M8e="_itemIcon_13hsa_65",_8e="_chevron_13hsa_72",x8e="_chevronOpen_13hsa_79",dt={container:y8e,groupHeader:k8e,groupHeaderLeft:m8e,groupIcon:f8e,dropdown:g8e,item:v8e,itemIcon:M8e,chevron:_8e,chevronOpen:x8e},L8e=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"})),C1=k.memo(L8e),Oq=({groups:e,activeItemId:t,onItemClick:n,style:o,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:I="var(--color-text)",chevronColor:C="var(--color-text)",iconSize:b=22,headerPadding:w="14px 20px",itemPadding:L="14px 20px",iconGap:x=14,borderRadius:S=0})=>{const[j,$]=k.useState(""),q=k.useRef(null);k.useEffect(()=>{const P=A=>{q.current&&!q.current.contains(A.target)&&$("")};return document.addEventListener("mousedown",P),()=>document.removeEventListener("mousedown",P)},[]);const H={backgroundColor:r,color:s,borderRadius:S,...o};return c.jsx("nav",{ref:q,className:[dt.container,i].filter(Boolean).join(" "),style:H,children:e.map(P=>{const A=j===P.id,N={backgroundColor:d,color:l,padding:w,borderBottom:`1px solid ${h}`,gap:x},V={backgroundColor:u};return c.jsxs("div",{children:[c.jsxs("div",{className:dt.groupHeader,style:N,onClick:()=>$(A?"":P.id),role:"button","aria-expanded":A,children:[c.jsxs("div",{className:dt.groupHeaderLeft,style:{gap:x},children:[P.icon&&c.jsx("span",{className:dt.groupIcon,style:{color:I,width:b,height:b},children:P.icon}),c.jsx("span",{children:P.label})]}),c.jsx("span",{className:[dt.chevron,A?dt.chevronOpen:""].join(" "),style:{color:C},children:c.jsx(C1,{width:18,height:18})})]}),A&&c.jsx("div",{className:dt.dropdown,style:V,children:P.items.map(T=>{const R=T.id===t,B={padding:L,gap:x,color:R?g:m,backgroundColor:p,"--item-border-width":R?"4px":"1px","--item-border-color":R?f:M};return c.jsxs("div",{className:dt.item,style:B,onClick:()=>{n?.(P.id,T.id),$("")},role:"menuitem",onMouseEnter:F=>{R||(F.currentTarget.style.backgroundColor=y)},children:[T.icon&&c.jsx("span",{className:dt.itemIcon,style:{color:R?v:_,width:b,height:b},children:T.icon}),c.jsx("span",{children:T.label})]},T.id)})})]},P.id)})})},I8e="_subheaderContent_1glo8_1",b8e="_navContainer_1glo8_11",w8e="_rightContent_1glo8_45",Nb={subheaderContent:I8e,navContainer:b8e,rightContent:w8e},C8e=({subNavItems:e,backgroundColor:t="transparent",padding:n="0",margin:o,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:I="",style:C,countBackgroundColor:b,countColor:w,countBorderRadius:L,countPadding:x,countFontSize:S,countFontWeight:j,navContainerClassName:$,navContainerStyle:q,rightContentClassName:H,rightContentStyle:P,rightActions:A,activeSwitcherColor:N,inactiveSwitcherColor:V,isMobile:T=!1})=>{const{activeSubNav:R,setActiveSubNav:B,navCounts:F,activeNav:J}=it();if(T){const G=e.find(ve=>ve.id===R)||e[0],le=[{id:"current-group",label:G?.label||J?.toUpperCase()||"MENU",icon:G?.icon,items:e.map(ve=>({id:ve.id,label:ve.label,icon:ve.icon}))}];return c.jsx("div",{className:I,style:C,children:c.jsx(Oq,{groups:le,activeItemId:R,onItemClick:(ve,ye)=>{const he=e.find(K=>K.id===ye);he&&(he.onClick&&he.onClick(),he.href&&(window.location.href=he.href),B(ye))},headerBgColor:t})})}return c.jsxs("div",{className:`${Nb.subheaderContent} ${I}`,style:{backgroundColor:t,padding:n,margin:o,width:i,height:r,border:s,borderBottom:d,...C},children:[c.jsx("div",{className:`${Nb.navContainer} ${$||""}`,style:{gap:l,...q},children:e.map(G=>{const le=G.count!==void 0?G.count:F[G.id],ve=R===G.id||G.isActive;return c.jsx(Eq,{...G,count:le,isActive:ve,onClick:()=>{G.onClick&&G.onClick(),B(G.id)},activeColor:m,inactiveColor:g,countBackgroundColor:b,countColor:w,countBorderRadius:L,countPadding:x,countFontSize:S,countFontWeight:j,indicatorColor:m,indicatorHeight:f,padding:u,fontSize:p,fontWeight:y,gap:"8px",style:G.style},G.id)})}),c.jsxs("div",{className:`${Nb.rightContent} ${H||""}`,style:{gap:h,...P},children:[M&&c.jsx(Yx,{size:20,colors:{bg:N,activeBg:V,icon:"#1C1B1F",icon2:"#FFFFFF"}}),_&&c.jsx(Jx,{size:20,colors:{bg:N,activeBg:V,icon:"#1C1B1F",icon2:"#FFFFFF"}}),v&&c.jsx(Qx,{size:20,colors:{bg:N,activeBg:V,icon:"#1C1B1F",icon2:"#FFFFFF"}}),A]})]})},N8e=({onSwitch:e,size:t="20px",lightIconColor:n="#666",darkIconColor:o="#fff",backgroundColor:i="transparent",padding:r="8px",borderRadius:s="50%",style:d,className:l=""})=>{const[h,u]=k.useState(!1),{currentTheme:p,switchTheme:y}=sL(),m=p!="dark",g=()=>{y(m?"dark":"light"),e?.()};return k.useEffect(()=>{u(!0)},[]),!h||!p?c.jsx(c.Fragment,{}):c.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?c.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:c.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}):c.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:o,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[c.jsx("circle",{cx:"12",cy:"12",r:"5"}),c.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),c.jsx("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),c.jsx("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),c.jsx("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),c.jsx("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),c.jsx("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),c.jsx("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),c.jsx("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]})})},S8e=({initialSortBy:e=null,initialSortOrder:t="asc",onSortChange:n})=>{const[o,i]=k.useState({sortBy:e,sortOrder:t,filters:{}}),r=k.useCallback(s=>{let d="asc";o.sortBy===s&&(d=o.sortOrder==="asc"?"desc":"asc");const l={...o,sortBy:s,sortOrder:d};i(l),n(s,d)},[o,n]);return{tableState:o,handleSort:r}},j8e=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"})),$8e=k.memo(j8e),q8e=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"})),A8e=k.memo(q8e),z8e=({columns:e,sortBy:t,sortOrder:n,onSort:o,removeLabelSpan:i=!1})=>c.jsx("thead",{children:c.jsx("tr",{children:e.map((r,s)=>{const d=t===r.key,l=!!r.sortable;return c.jsx("th",{className:`${r.className||""}${l?" sortable":""}`,style:{width:r.width,textAlign:r.align||"left"},onClick:()=>l&&o(String(r.key)),children:c.jsxs("div",{className:`th-content ${r.align?`align-${r.align}`:""}`,children:[i?r.label:c.jsx("span",{children:r.label}),l&&c.jsx("span",{className:"sort-icon-container",style:{display:"inline-flex",alignItems:"center"},children:d&&n==="asc"?c.jsx(A8e,{width:16,height:16,style:{fill:"currentColor",transition:"all 0.2s ease"}}):c.jsx($8e,{width:16,height:16,style:{fill:"currentColor",opacity:d?1:.5,transition:"all 0.2s ease"}})})]})},String(r.key)||s)})})}),V8e=({data:e,columns:t,rowKey:n,onRowClick:o,isLoading:i,text:r,rowStyle:s,rowClassName:d})=>!e.length&&!i?c.jsx("tbody",{children:c.jsx("tr",{children:c.jsx("td",{colSpan:t.length,style:{textAlign:"center",padding:"32px"},children:c.jsx("span",{style:{color:"var(--table-text-muted)"},children:r?.noData||"Aucune donnée disponible"})})})}):c.jsx("tbody",{children:e.map((l,h)=>{const u=l[n],p=typeof u=="string"||typeof u=="number"?u:h;return c.jsx("tr",{onClick:()=>o&&o(l),style:{cursor:o?"pointer":"default",...s?s(l):{}},className:d?d(l,h):"",children:t.map((y,m)=>c.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)})}),P8e=({state:e,onPaginationChange:t,onLoadMore:n,infiniteScroll:o,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 I=Math.max(y-1,1),C=Math.min(y+1,p),b=I>2,w=C<p-2,L=1,x=p;if(!b&&w)return[...Array.from({length:5},($,q)=>q+1),"...",p];if(b&&!w){const j=Array.from({length:5},($,q)=>p-5+q+1);return[L,"...",...j]}if(b&&w){const S=Array.from({length:C-I+1},(j,$)=>I+$);return[L,"...",...S,"...",x]}return[]},[y,p]);return c.jsxs("div",{className:"table-pagination",children:[c.jsx("div",{className:"pagination-summary",children:h>0?c.jsx("span",{children:r?.itemsRange?r.itemsRange(m,g,h):c.jsxs(c.Fragment,{children:[c.jsxs("b",{children:[m,"–",g]})," ","sur ",c.jsx("b",{children:h.toLocaleString()})," éléments"]})}):c.jsx("span",{children:r?.noResults||"0 résultats"})}),c.jsx("div",{className:"pagination-spacer"}),!o&&l!==-1&&p>1&&c.jsxs("div",{className:"pagination-controls",children:[c.jsx("button",{className:"pagination-btn",onClick:()=>f(1),disabled:y===1,title:r?.first||"Premier",children:"<<"}),c.jsx("button",{className:"pagination-btn",onClick:()=>f(y-1),disabled:y===1,title:r?.previous||"Précédent",children:"<"}),(M||[]).map((_,v)=>_==="..."?c.jsx("span",{style:{padding:"0 4px",color:"var(--table-text-muted)"},children:"..."},v):c.jsx("button",{className:`pagination-btn ${_===y?"active":""}`,onClick:()=>f(_),children:_},v)),c.jsx("button",{className:"pagination-btn",onClick:()=>f(y+1),disabled:y===p,title:r?.next||"Suivant",children:">"}),c.jsx("button",{className:"pagination-btn",onClick:()=>f(p),disabled:y===p,title:r?.last||"Dernier",children:">>"})]}),!o&&n&&i&&c.jsx("div",{className:"pagination-load-more",children:c.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"})})]})},Uq=({data:e,columns:t,isLoading:n,pagination:o,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:I,rowClassName:C,removeLabelSpan:b=!1})=>{const w=k.useMemo(()=>({...p}),[p]),L=k.useRef(null);k.useEffect(()=>{if(!m||!y||!g||n)return;const H=new IntersectionObserver(P=>{P[0].isIntersecting&&y()},{threshold:.1});return L.current&&H.observe(L.current),()=>H.disconnect()},[m,y,g,n]);const{tableState:x,handleSort:S}=S8e({initialSortBy:null,onSortChange:r}),j=(f?.sortBy!==void 0?f.sortBy:x.sortBy)??void 0,$=f?.sortOrder!==void 0?f.sortOrder:x.sortOrder,q=H=>{const P=j,A=$;let N="asc";P===H&&(N=A==="asc"?"desc":"asc"),f?.sortBy!==void 0?r(H,N):S(H)};return c.jsxs("div",{className:`table-container ${M||""}`,style:_,children:[c.jsxs("div",{className:"table-frame",style:{height:h??void 0,minHeight:u??void 0},children:[n&&c.jsx("div",{className:"table-loader-overlay",children:c.jsx("div",{className:"spinner",style:{width:d,height:d,borderTopColor:"var(--table-primary)"}})}),c.jsxs("div",{className:`table-wrapper ${l?"sticky-header":""}`,children:[c.jsxs("table",{className:"data-table",children:[c.jsx(z8e,{columns:t,sortBy:j,sortOrder:$,onSort:q,removeLabelSpan:b}),c.jsx(V8e,{data:e,columns:t.map(H=>({...H,render:H.render?P=>H.render(P,{}):void 0})),rowKey:s,onRowClick:I,isLoading:n,text:w,rowStyle:typeof v=="function"?v:v?()=>v:void 0,rowClassName:C})]}),m&&c.jsx("div",{ref:L,style:{height:20,margin:10}})]})]}),c.jsx(P8e,{state:o,onPaginationChange:i,text:w,onLoadMore:y,infiniteScroll:m,hasMore:g,isLoading:n})]})},T8e="_datePickerContainer_1941b_3",H8e="_label_1941b_16",D8e="_displayNode_1941b_23",B8e="_datePickerButton_1941b_30",R8e="_datePickerButtonDisabled_1941b_50",F8e="_datePickerButtonOpen_1941b_59",E8e="_datePickerLabel_1941b_68",O8e="_placeholder_1941b_79",U8e="_chevron_1941b_83",W8e="_errorMessage_1941b_91",G8e="_dropdown_1941b_96",Z8e="_calendarHeader_1941b_120",K8e="_navButton_1941b_129",X8e="_headerSelectors_1941b_148",Y8e="_monthSelector_1941b_156",J8e="_yearSelector_1941b_157",Q8e="_selectorButton_1941b_161",efe="_selectorChevron_1941b_178",tfe="_selectorChevronOpen_1941b_183",afe="_monthDropdown_1941b_187",nfe="_yearDropdown_1941b_188",ofe="_monthItem_1941b_208",cfe="_yearItem_1941b_209",ife="_monthItemSelected_1941b_231",rfe="_yearItemSelected_1941b_232",sfe="_weekdays_1941b_236",dfe="_weekday_1941b_236",lfe="_calendarGrid_1941b_252",hfe="_dateCell_1941b_260",ufe="_dateCellSelected_1941b_283",pfe="_dateCellOtherMonth_1941b_287",yfe="_dateCellOtherMonthSelected_1941b_291",kfe="_calendarFooter_1941b_295",mfe="_cancelButton_1941b_303",ffe="_applyButton_1941b_304",gfe="_timePickerContainer_1941b_348",vfe="_timeGroup_1941b_357",Mfe="_timeLabel_1941b_364",_fe="_timeInputWrapper_1941b_370",xfe="_timeInput_1941b_370",Lfe="_timeSeparator_1941b_398",E={datePickerContainer:T8e,label:H8e,displayNode:D8e,datePickerButton:B8e,datePickerButtonDisabled:R8e,datePickerButtonOpen:F8e,datePickerLabel:E8e,placeholder:O8e,chevron:U8e,errorMessage:W8e,dropdown:G8e,calendarHeader:Z8e,navButton:K8e,headerSelectors:X8e,monthSelector:Y8e,yearSelector:J8e,selectorButton:Q8e,selectorChevron:efe,selectorChevronOpen:tfe,monthDropdown:afe,yearDropdown:nfe,monthItem:ofe,yearItem:cfe,monthItemSelected:ife,yearItemSelected:rfe,weekdays:sfe,weekday:dfe,calendarGrid:lfe,dateCell:hfe,dateCellSelected:ufe,dateCellOtherMonth:pfe,dateCellOtherMonthSelected:yfe,calendarFooter:kfe,cancelButton:mfe,applyButton:ffe,timePickerContainer:gfe,timeGroup:vfe,timeLabel:Mfe,timeInputWrapper:_fe,timeInput:xfe,timeSeparator:Lfe},oj=["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],Ife=["Lun","Mar","Mer","Jeu","Ven","Sam","Dim"],nw=({value:e,onChange:t,label:n,placeholder:o="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:I,buttonTextColor:C,dropdownBgColor:b="#ffffff",itemHoverColor:w,selectedItemBgColor:L,iconColor:x,errorColor:S,labelColor:j,placeholderColor:$,borderRadius:q="var(--radius-content)",borderWidth:H="0.0625rem",boxShadow:P="0 0.25rem 0.75rem rgba(0, 0, 0, 0.1)",transitionDuration:A="0.2s",transitionTiming:N="ease",dateCellSize:V="2.5rem",headerTextColor:T="#6c757d",weekdayTextColor:R="#6c757d",currentMonthDateColor:B="#212529",otherMonthDateColor:F="#adb5bd",selectedDateBgColor:J="#00A6D9",selectedDateTextColor:G="#ffffff",cancelButtonBgColor:le="#e9ecef",cancelButtonTextColor:ve="#212529",applyButtonBgColor:ye="#00A6D9",applyButtonTextColor:he="#ffffff",width:K,displayNode:X=void 0,displayMode:re="auto",displayNodeAriaLabel:Ie,dropdownPosition:ke="bottom",dropdownAlignment:we="right",dropdownWidth:se,withBorder:Me=!1,icon:Ve,precision:je="day",hoursLabel:ue="Heures",minutesLabel:Ce="Minutes",lowerLimit:rt=null,upperLimit:Jc=null,months:ce,weekdays:Y,cancelText:D1="Annuler",applyText:Kq="Appliquer",prevMonthAriaLabel:Xq="Mois précédent",nextMonthAriaLabel:Yq="Mois suivant",calendarAriaLabel:Jq="Sélecteur de date",openedAriaLabel:Qq="Ouvrir le sélecteur de date",selectedDateAriaLabel:eA="Date sélectionnée: ",locale:Uw="fr-FR"})=>{const At=D=>{if(D instanceof Date)return isNaN(D.getTime())?null:D;if(typeof D=="string"&&D){const W=new Date(D);return isNaN(W.getTime())?null:W}return null},[Ye,zt]=k.useState(!1),[Sc,tA]=k.useState({top:0,left:0,width:0}),[ee,Qc]=k.useState(At(e)||new Date),[_L,xL]=k.useState(At(e)),[LL,IL]=k.useState(At(e)?.getHours()??0),[bL,wL]=k.useState(At(e)?.getMinutes()??0),[CL,jc]=k.useState(!1),[NL,$c]=k.useState(!1),SL=k.useRef(null),B1=k.useRef(null),jL=k.useRef(null),$L=k.useRef(null);k.useEffect(()=>{const D=At(e);xL(D),D&&(Qc(D),IL(D.getHours()),wL(D.getMinutes()))},[e]);const qc=k.useCallback(()=>{if(B1.current){const D=B1.current.getBoundingClientRect();tA({top:D.top,left:D.left,width:D.width})}},[]);k.useEffect(()=>(Ye&&(qc(),window.addEventListener("scroll",qc,!0),window.addEventListener("resize",qc)),()=>{window.removeEventListener("scroll",qc,!0),window.removeEventListener("resize",qc)}),[Ye,qc]),k.useEffect(()=>{const D=W=>{if(SL.current&&!SL.current.contains(W.target)){const fe=document.getElementById("datepicker-dropdown");if(fe&&fe.contains(W.target))return;zt(!1),jc(!1),$c(!1)}jL.current&&!jL.current.contains(W.target)&&jc(!1),$L.current&&!$L.current.contains(W.target)&&$c(!1)};return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[]);const Ww=D=>new Date(D.getFullYear(),D.getMonth()+1,0).getDate(),aA=D=>{const W=new Date(D.getFullYear(),D.getMonth(),1).getDay();return W===0?6:W-1},nA=()=>{const D=[],W=aA(ee),fe=Ww(ee),R1=new Date(ee.getFullYear(),ee.getMonth()-1,1),ft=Ww(R1);for(let Ue=W-1;Ue>=0;Ue--)D.push(new Date(ee.getFullYear(),ee.getMonth()-1,ft-Ue));for(let Ue=1;Ue<=fe;Ue++)D.push(new Date(ee.getFullYear(),ee.getMonth(),Ue));const e1=42-D.length;for(let Ue=1;Ue<=e1;Ue++)D.push(new Date(ee.getFullYear(),ee.getMonth()+1,Ue));return D},oA=(D,W)=>!D||!W?!1:D.getDate()===W.getDate()&&D.getMonth()===W.getMonth()&&D.getFullYear()===W.getFullYear(),cA=D=>D.getMonth()===ee.getMonth()&&D.getFullYear()===ee.getFullYear(),iA=()=>{Qc(new Date(ee.getFullYear(),ee.getMonth()-1,1))},rA=()=>{Qc(new Date(ee.getFullYear(),ee.getMonth()+1,1))},sA=D=>{if(!s){const W=new Date(D);W.setHours(LL),W.setMinutes(bL),xL(W)}},dA=()=>{if(!s){if(_L){const D=new Date(_L);D.setHours(LL),D.setMinutes(bL),t(D)}else t(null);zt(!1)}},lA=()=>{const D=At(e);xL(D),D&&(IL(D.getHours()),wL(D.getMinutes())),zt(!1)},hA=D=>{Qc(new Date(ee.getFullYear(),D,1)),jc(!1)},uA=D=>{Qc(new Date(D,ee.getMonth(),1)),$c(!1)},pA=()=>{const D=ee.getFullYear(),W=[];for(let fe=D-10;fe<=D+10;fe++)W.push(fe);return W},yA=D=>{if(!s)switch(D.key){case"Enter":case" ":D.preventDefault(),zt(!Ye);break;case"Escape":zt(!1),jc(!1),$c(!1);break;case"Tab":Ye&&(zt(!1),jc(!1),$c(!1));break}},kA={width:K||(r?"100%":"auto"),fontSize:p,fontWeight:_},mA={height:l,padding:h,backgroundColor:v||"#ffffff",border:Me?void 0:"none",borderColor:d?S||"#dc3545":I||"#dee2e6",color:C||"#212529",borderRadius:q,borderWidth:H,fontWeight:_,transition:`all ${A} ${N}`},fA={backgroundColor:b||"#ffffff",maxHeight:u,borderRadius:q,borderWidth:H,boxShadow:P,transition:`opacity ${A} ${N}, transform ${A} ${N}`,position:"fixed",top:ke==="bottom"?Sc.top+(B1.current?.offsetHeight||0)+parseFloat(f.replace("rem",""))*16:"auto",bottom:ke==="top"?window.innerHeight-Sc.top+parseFloat(f.replace("rem",""))*16:"auto",left:we==="left"?Sc.left:"auto",right:we==="right"?window.innerWidth-(Sc.left+Sc.width):"auto",width:se||(r?Sc.width:"auto"),zIndex:10001},Gw={width:y,height:y,color:x||"#6c757d","--icon-rotation":Ye?"rotate(180deg)":"rotate(0deg)"},gA={color:j||"#212529",marginBottom:m,fontWeight:_},vA={color:$||"#6c757d"},MA={color:S||"#dc3545",marginTop:g},_A=nA(),Je=At(e),Zw=Je?je==="minutes"?`${Je.toLocaleDateString(Uw)} ${Je.getHours().toString().padStart(2,"0")}:${Je.getMinutes().toString().padStart(2,"0")}`:Je.toLocaleDateString(Uw):"",xA=!!X&&(re==="icon"||re==="auto"&&!Je),LA=Ie||(Je?`${eA}${Zw}`:Qq);return c.jsxs("div",{className:`${E.datePickerContainer} ${i}`,ref:SL,style:kA,"data-fullwidth":r,"data-disabled":s,"data-error":!!d,children:[n&&c.jsx("label",{className:E.label,style:gA,children:n}),c.jsxs("button",{ref:B1,type:"button",onClick:()=>!s&&zt(!Ye),onKeyDown:yA,className:`
|
|
8169
|
+
`),()=>{M.contains(f)&&M.removeChild(f)}},[t]),c.jsx(h0e,{isPresent:t,childRef:r,sizeRef:s,children:Z.cloneElement(e,{ref:l})})}const p0e=({children:e,initial:t,isPresent:n,onExitComplete:o,custom:i,presenceAffectsLayout:r,mode:s,anchorX:d,root:l})=>{const h=$t(y0e),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;o&&o()},register:m=>(h.set(m,!1),()=>h.delete(m))}),[n,h,o]);return r&&p&&(y={...y}),k.useMemo(()=>{h.forEach((m,g)=>h.set(g,!1))},[n]),Z.useEffect(()=>{!n&&!h.size&&o&&o()},[n]),s==="popLayout"&&(e=c.jsx(u0e,{isPresent:n,anchorX:d,root:l,children:e})),c.jsx(dL.Provider,{value:y,children:e})};function y0e(){return new Map}function m$(e=!0){const t=k.useContext(dL);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:o,register:i}=t,r=k.useId();k.useEffect(()=>{if(e)return i(r)},[e]);const s=k.useCallback(()=>e&&o&&o(r),[r,o,e]);return!n&&o?[!1,s]:[!0]}const O1=e=>e.key||"";function MC(e){const t=[];return k.Children.forEach(e,n=>{k.isValidElement(n)&&t.push(n)}),t}const k0e=({children:e,custom:t,initial:n=!0,onExitComplete:o,presenceAffectsLayout:i=!0,mode:r="sync",propagate:s=!1,anchorX:d="left",root:l})=>{const[h,u]=m$(s),p=k.useMemo(()=>MC(e),[e]),y=s&&!h?[]:p.map(O1),m=k.useRef(!0),g=k.useRef(p),f=$t(()=>new Map),[M,_]=k.useState(p),[v,I]=k.useState(p);rw(()=>{m.current=!1,g.current=p;for(let w=0;w<v.length;w++){const L=O1(v[w]);y.includes(L)?f.delete(L):f.get(L)!==!0&&f.set(L,!1)}},[v,y.length,y.join("-")]);const C=[];if(p!==M){let w=[...p];for(let L=0;L<v.length;L++){const x=v[L],S=O1(x);y.includes(S)||(w.splice(L,0,x),C.push(x))}return r==="wait"&&C.length&&(w=C),I(MC(w)),_(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:b}=k.useContext(cw);return c.jsx(c.Fragment,{children:v.map(w=>{const L=O1(w),x=s&&!h?!1:p===v||y.includes(L),S=()=>{if(f.has(L))f.set(L,!0);else return;let j=!0;f.forEach($=>{$||(j=!1)}),j&&(b?.(),I(g.current),s&&u?.(),o&&o())};return c.jsx(p0e,{isPresent:x,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:r,root:l,onExitComplete:x?void 0:S,anchorX:d,children:w},L)})})},f$=k.createContext({strict:!1}),_C={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"]},Wc={};for(const e in _C)Wc[e]={isEnabled:t=>_C[e].some(n=>!!t[n])};function m0e(e){for(const t in e)Wc[t]={...Wc[t],...e[t]}}const f0e=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 nL(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||f0e.has(e)}let g$=e=>!nL(e);function g0e(e){typeof e=="function"&&(g$=t=>t.startsWith("on")?!nL(t):e(t))}try{g0e(require("@emotion/is-prop-valid").default)}catch{}function v0e(e,t,n){const o={};for(const i in e)i==="values"&&typeof e.values=="object"||(g$(i)||n===!0&&nL(i)||!t&&!nL(i)||e.draggable&&i.startsWith("onDrag"))&&(o[i]=e[i]);return o}const hL=k.createContext({});function uL(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function $1(e){return typeof e=="string"||Array.isArray(e)}const Sw=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],jw=["initial",...Sw];function pL(e){return uL(e.animate)||jw.some(t=>$1(e[t]))}function v$(e){return!!(pL(e)||e.variants)}function M0e(e,t){if(pL(e)){const{initial:n,animate:o}=e;return{initial:n===!1||$1(n)?n:void 0,animate:$1(o)?o:void 0}}return e.inherit!==!1?t:{}}function _0e(e){const{initial:t,animate:n}=M0e(e,k.useContext(hL));return k.useMemo(()=>({initial:t,animate:n}),[xC(t),xC(n)])}function xC(e){return Array.isArray(e)?e.join(" "):e}const q1={};function x0e(e){for(const t in e)q1[t]=e[t],kw(t)&&(q1[t].isCSSVariable=!0)}function M$(e,{layout:t,layoutId:n}){return Xc.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!q1[e]||e==="opacity")}const L0e={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},I0e=Kc.length;function b0e(e,t,n){let o="",i=!0;for(let r=0;r<I0e;r++){const s=Kc[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=l$(d,ww[s]);if(!l){i=!1;const u=L0e[s]||s;o+=`${u}(${h}) `}n&&(t[s]=h)}}return o=o.trim(),n?o=n(t,i?"":o):i&&(o="none"),o}function $w(e,t,n){const{style:o,vars:i,transformOrigin:r}=e;let s=!1,d=!1;for(const l in t){const h=t[l];if(Xc.has(l)){s=!0;continue}else if(kw(l)){i[l]=h;continue}else{const u=l$(h,ww[l]);l.startsWith("origin")?(d=!0,r[l]=u):o[l]=u}}if(t.transform||(s||n?o.transform=b0e(t,e.transform,n):o.transform&&(o.transform="none")),d){const{originX:l="50%",originY:h="50%",originZ:u=0}=r;o.transformOrigin=`${l} ${h} ${u}`}}const qw=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function _$(e,t,n){for(const o in t)!Le(t[o])&&!M$(o,n)&&(e[o]=t[o])}function w0e({transformTemplate:e},t){return k.useMemo(()=>{const n=qw();return $w(n,t,e),Object.assign({},n.vars,n.style)},[t])}function C0e(e,t){const n=e.style||{},o={};return _$(o,n,e),Object.assign(o,w0e(e,t)),o}function N0e(e,t){const n={},o=C0e(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.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=o,n}const S0e={offset:"stroke-dashoffset",array:"stroke-dasharray"},j0e={offset:"strokeDashoffset",array:"strokeDasharray"};function $0e(e,t,n=1,o=0,i=!0){e.pathLength=1;const r=i?S0e:j0e;e[r.offset]=O.transform(-o);const s=O.transform(t),d=O.transform(n);e[r.array]=`${s} ${d}`}function x$(e,{attrX:t,attrY:n,attrScale:o,pathLength:i,pathSpacing:r=1,pathOffset:s=0,...d},l,h,u){if($w(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),o!==void 0&&(p.scale=o),i!==void 0&&$0e(p,i,r,s,!1)}const L$=()=>({...qw(),attrs:{}}),I$=e=>typeof e=="string"&&e.toLowerCase()==="svg";function q0e(e,t,n,o){const i=k.useMemo(()=>{const r=L$();return x$(r,t,I$(o),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 A0e=["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 Aw(e){return typeof e!="string"||e.includes("-")?!1:!!(A0e.indexOf(e)>-1||/[A-Z]/u.test(e))}function z0e(e,t,n,{latestValues:o},i,r=!1){const d=(Aw(e)?q0e:N0e)(t,o,i,e),l=v0e(t,typeof e=="string",r),h=e!==k.Fragment?{...l,...d,ref:n}:{},{children:u}=t,p=k.useMemo(()=>Le(u)?u.get():u,[u]);return k.createElement(e,{...h,children:p})}function LC(e){const t=[{},{}];return e?.values.forEach((n,o)=>{t[0][o]=n.get(),t[1][o]=n.getVelocity()}),t}function zw(e,t,n,o){if(typeof t=="function"){const[i,r]=LC(o);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]=LC(o);t=t(n!==void 0?n:e.custom,i,r)}return t}function Zx(e){return Le(e)?e.get():e}function V0e({scrapeMotionValuesFromProps:e,createRenderState:t},n,o,i){return{latestValues:P0e(n,o,i,e),renderState:t()}}function P0e(e,t,n,o){const i={},r=o(e,{});for(const y in r)i[y]=Zx(r[y]);let{initial:s,animate:d}=e;const l=pL(e),h=v$(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"&&!uL(p)){const y=Array.isArray(p)?p:[p];for(let m=0;m<y.length;m++){const g=zw(e,y[m]);if(g){const{transitionEnd:f,transition:M,..._}=g;for(const v in _){let I=_[v];if(Array.isArray(I)){const C=u?I.length-1:0;I=I[C]}I!==null&&(i[v]=I)}for(const v in f)i[v]=f[v]}}}return i}const b$=e=>(t,n)=>{const o=k.useContext(hL),i=k.useContext(dL),r=()=>V0e(e,t,o,i);return n?r():$t(r)};function Vw(e,t,n){const{style:o}=e,i={};for(const r in o)(Le(o[r])||t.style&&Le(t.style[r])||M$(r,e)||n?.getValue(r)?.liveStyle!==void 0)&&(i[r]=o[r]);return i}const T0e=b$({scrapeMotionValuesFromProps:Vw,createRenderState:qw});function w$(e,t,n){const o=Vw(e,t,n);for(const i in e)if(Le(e[i])||Le(t[i])){const r=Kc.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;o[r]=e[i]}return o}const H0e=b$({scrapeMotionValuesFromProps:w$,createRenderState:L$}),D0e=Symbol.for("motionComponentSymbol");function Tc(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function B0e(e,t,n){return k.useCallback(o=>{o&&e.onMount&&e.onMount(o),t&&(o?t.mount(o):t.unmount()),n&&(typeof n=="function"?n(o):Tc(n)&&(n.current=o))},[t])}const Pw=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),R0e="framerAppearId",C$="data-"+Pw(R0e),N$=k.createContext({});function F0e(e,t,n,o,i){const{visualElement:r}=k.useContext(hL),s=k.useContext(f$),d=k.useContext(dL),l=k.useContext(lL).reducedMotion,h=k.useRef(null);o=o||s.renderer,!h.current&&o&&(h.current=o(e,{visualState:t,parent:r,props:n,presenceContext:d,blockInitialAnimation:d?d.initial===!1:!1,reducedMotionConfig:l}));const u=h.current,p=k.useContext(N$);u&&!u.projection&&i&&(u.type==="html"||u.type==="svg")&&E0e(h.current,n,i,p);const y=k.useRef(!1);k.useInsertionEffect(()=>{u&&y.current&&u.update(n,d)});const m=n[C$],g=k.useRef(!!m&&!window.MotionHandoffIsComplete?.(m)&&window.MotionHasOptimisedAnimation?.(m));return rw(()=>{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 E0e(e,t,n,o){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:S$(e.parent)),e.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:!!s||d&&Tc(d),visualElement:e,animationType:typeof r=="string"?r:"both",initialPromotionConfig:o,crossfade:u,layoutScroll:l,layoutRoot:h})}function S$(e){if(e)return e.options.allowProjection!==!1?e.projection:S$(e.parent)}function HL(e,{forwardMotionProps:t=!1}={},n,o){n&&m0e(n);const i=Aw(e)?H0e:T0e;function r(d,l){let h;const u={...k.useContext(lL),...d,layoutId:O0e(d)},{isStatic:p}=u,y=_0e(d),m=i(d,p);if(!p&&iw){U0e(u,n);const g=W0e(u);h=g.MeasureLayout,y.visualElement=F0e(e,m,u,o,g.ProjectionNode)}return c.jsxs(hL.Provider,{value:y,children:[h&&y.visualElement?c.jsx(h,{visualElement:y.visualElement,...u}):null,z0e(e,d,B0e(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[D0e]=e,s}function O0e({layoutId:e}){const t=k.useContext(cw).id;return t&&e!==void 0?t+"-"+e:e}function U0e(e,t){const n=k.useContext(f$).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const o="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?Gc(!1,o,"lazy-strict-mode"):Xe(!1,o,"lazy-strict-mode")}}function W0e(e){const{drag:t,layout:n}=Wc;if(!t&&!n)return{};const o={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function G0e(e,t){if(typeof Proxy>"u")return HL;const n=new Map,o=(r,s)=>HL(r,s,e,t),i=(r,s)=>(process.env.NODE_ENV!=="production"&&uw(!1,"motion() is deprecated. Use motion.create() instead."),o(r,s));return new Proxy(i,{get:(r,s)=>s==="create"?o:(n.has(s)||n.set(s,HL(s,void 0,e,t)),n.get(s))})}function j$({top:e,left:t,right:n,bottom:o}){return{x:{min:t,max:n},y:{min:e,max:o}}}function Z0e({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function K0e(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),o=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:o.y,right:o.x}}function DL(e){return e===void 0||e===1}function Zb({scale:e,scaleX:t,scaleY:n}){return!DL(e)||!DL(t)||!DL(n)}function Mc(e){return Zb(e)||$$(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function $$(e){return IC(e.x)||IC(e.y)}function IC(e){return e&&e!=="0%"}function oL(e,t,n){const o=e-n,i=t*o;return n+i}function bC(e,t,n,o,i){return i!==void 0&&(e=oL(e,i,o)),oL(e,n,o)+t}function Kb(e,t=0,n=1,o,i){e.min=bC(e.min,t,n,o,i),e.max=bC(e.max,t,n,o,i)}function q$(e,{x:t,y:n}){Kb(e.x,t.translate,t.scale,t.originPoint),Kb(e.y,n.translate,n.scale,n.originPoint)}const wC=.999999999999,CC=1.0000000000001;function X0e(e,t,n,o=!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"||(o&&r.options.layoutScroll&&r.scroll&&r!==r.root&&Dc(e,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,q$(e,s)),o&&Mc(r.latestValues)&&Dc(e,r.latestValues))}t.x<CC&&t.x>wC&&(t.x=1),t.y<CC&&t.y>wC&&(t.y=1)}function Hc(e,t){e.min=e.min+t,e.max=e.max+t}function NC(e,t,n,o,i=.5){const r=ie(e.min,e.max,i);Kb(e,t,n,r,o)}function Dc(e,t){NC(e.x,t.x,t.scaleX,t.scale,t.originX),NC(e.y,t.y,t.scaleY,t.scale,t.originY)}function A$(e,t){return j$(K0e(e.getBoundingClientRect(),t))}function Y0e(e,t,n){const o=A$(e,n),{scroll:i}=t;return i&&(Hc(o.x,i.offset.x),Hc(o.y,i.offset.y)),o}const SC=()=>({translate:0,scale:1,origin:0,originPoint:0}),Bc=()=>({x:SC(),y:SC()}),jC=()=>({min:0,max:0}),pe=()=>({x:jC(),y:jC()}),Xb={current:null},z$={current:!1};function J0e(){if(z$.current=!0,!!iw)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Xb.current=e.matches;e.addEventListener("change",t),t()}else Xb.current=!1}const Q0e=new WeakMap;function ele(e,t,n){for(const o in t){const i=t[o],r=n[o];if(Le(i))e.addValue(o,i);else if(Le(r))e.addValue(o,Cc(i,{owner:e}));else if(r!==i)if(e.hasValue(o)){const s=e.getValue(o);s.liveStyle===!0?s.jump(i):s.hasAnimated||s.set(i)}else{const s=e.getStaticValue(o);e.addValue(o,Cc(s!==void 0?s:i,{owner:e}))}}for(const o in n)t[o]===void 0&&e.removeValue(o);return t}const $C=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class tle{scrapeMotionValuesFromProps(t,n,o){return{}}constructor({parent:t,props:n,presenceContext:o,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=Iw,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=ze.now();this.renderScheduledAt<y&&(this.renderScheduledAt=y,oe.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=o,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=d,this.blockInitialAnimation=!!r,this.isControllingVariants=pL(n),this.isVariantNode=v$(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&&Le(m)&&m.set(l[y])}}mount(t){this.current=t,Q0e.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,o)=>this.bindToMotionValue(o,n)),z$.current||J0e(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Xb.current,process.env.NODE_ENV!=="production"&&uw(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(),kt(this.notifyUpdate),kt(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 o=Xc.has(t);o&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&oe.preRender(this.notifyUpdate),o&&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 Wc){const n=Wc[t];if(!n)continue;const{isEnabled:o,Feature:i}=n;if(!this.features[t]&&i&&o(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):pe()}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 o=0;o<$C.length;o++){const i=$C[o];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=ele(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 o=this.values.get(t);n!==o&&(o&&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 o=this.values.get(t);return o===void 0&&n!==void 0&&(o=Cc(n===null?void 0:n,{owner:this}),this.addValue(t,o)),o}readValue(t,n){let o=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return o!=null&&(typeof o=="string"&&(bj(o)||Cj(o))?o=parseFloat(o):!s0e(o)&&jt.test(n)&&(o=d$(t,n)),this.setBaseTarget(t,Le(o)?o.get():o)),Le(o)?o.get():o}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let o;if(typeof n=="string"||typeof n=="object"){const r=zw(this.props,n,this.presenceContext?.custom);r&&(o=r[t])}if(n&&o!==void 0)return o;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!Le(i)?i:this.initialValues[t]!==void 0&&o===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new hw),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Cw.render(this.render)}}class V$ extends tle{constructor(){super(...arguments),this.KeyframeResolver=Kde}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:o}){delete n[t],delete o[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Le(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function P$(e,{style:t,vars:n},o,i){const r=e.style;let s;for(s in t)r[s]=t[s];i?.applyProjectionStyles(r,o);for(s in n)r.setProperty(s,n[s])}function ale(e){return window.getComputedStyle(e)}class nle extends V${constructor(){super(...arguments),this.type="html",this.renderInstance=P$}readValueFromInstance(t,n){if(Xc.has(n))return this.projection?.isProjecting?Rb(n):pde(t,n);{const o=ale(t),i=(kw(n)?o.getPropertyValue(n):o[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return A$(t,n)}build(t,n,o){$w(t,n,o.transformTemplate)}scrapeMotionValuesFromProps(t,n,o){return Vw(t,n,o)}}const T$=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 ole(e,t,n,o){P$(e,t,void 0,o);for(const i in t.attrs)e.setAttribute(T$.has(i)?i:Pw(i),t.attrs[i])}class cle extends V${constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=pe}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Xc.has(n)){const o=s$(n);return o&&o.default||0}return n=T$.has(n)?n:Pw(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,o){return w$(t,n,o)}build(t,n,o){x$(t,n,this.isSVGTag,o.transformTemplate,o.style)}renderInstance(t,n,o,i){ole(t,n,o,i)}mount(t){this.isSVGTag=I$(t.tagName),super.mount(t)}}const ile=(e,t)=>Aw(e)?new cle(t):new nle(t,{allowProjection:e!==k.Fragment});function Uc(e,t,n){const o=e.getProps();return zw(o,t,n!==void 0?n:o.custom,e)}const Yb=e=>Array.isArray(e);function rle(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Cc(n))}function sle(e){return Yb(e)?e[e.length-1]||0:e}function dle(e,t){const n=Uc(e,t);let{transitionEnd:o={},transition:i={},...r}=n||{};r={...r,...o};for(const s in r){const d=sle(r[s]);rle(e,s,d)}}function lle(e){return!!(Le(e)&&e.add)}function Jb(e,t){const n=e.getValue("willChange");if(lle(n))return n.add(t);if(!n&&yt.WillChange){const o=new yt.WillChange("auto");e.addValue("willChange",o),o.add(t)}}function H$(e){return e.props[C$]}const hle=e=>e!==null;function ule(e,{repeat:t,repeatType:n="loop"},o){const i=e.filter(hle),r=t&&n!=="loop"&&t%2===1?0:i.length-1;return i[r]}const ple={type:"spring",stiffness:500,damping:25,restSpeed:10},yle=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),kle={type:"keyframes",duration:.8},mle={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},fle=(e,{keyframes:t})=>t.length>2?kle:Xc.has(e)?e.startsWith("scale")?yle(t[1]):ple:mle;function gle({when:e,delay:t,delayChildren:n,staggerChildren:o,staggerDirection:i,repeat:r,repeatType:s,repeatDelay:d,from:l,elapsed:h,...u}){return!!Object.keys(u).length}const Tw=(e,t,n,o={},i,r)=>s=>{const d=bw(o,e)||{},l=d.delay||o.delay||0;let{elapsed:h=0}=o;h=h-Ke(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};gle(d)||Object.assign(u,fle(e,u)),u.duration&&(u.duration=Ke(u.duration)),u.repeatDelay&&(u.repeatDelay=Ke(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let p=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Wb(u),u.delay===0&&(p=!0)),(yt.instantAnimations||yt.skipAnimations)&&(p=!0,Wb(u),u.delay=0),u.allowFlatten=!d.type&&!d.ease,p&&!r&&t.get()!==void 0){const y=ule(u.keyframes,d);if(y!==void 0){oe.update(()=>{u.onUpdate(y),u.onComplete()});return}}return d.isSync?new Lw(u):new Pde(u)};function vle({protectedKeys:e,needsAnimating:t},n){const o=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,o}function D$(e,t,{delay:n=0,transitionOverride:o,type:i}={}){let{transition:r=e.getDefaultTransition(),transitionEnd:s,...d}=t;o&&(r=o);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&&vle(h,u))continue;const m={delay:n,...bw(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 _=H$(e);if(_){const v=window.MotionHandoffAnimation(_,u,oe);v!==null&&(m.startTime=v,f=!0)}}Jb(e,u),p.start(Tw(u,p,y,e.shouldReduceMotion&&c$.has(u)?{type:!1}:m,e,f));const M=p.animation;M&&l.push(M)}return s&&Promise.all(l).then(()=>{oe.update(()=>{s&&dle(e,s)})}),l}function B$(e,t,n,o=0,i=1){const r=Array.from(e).sort((h,u)=>h.sortNodePosition(u)).indexOf(t),s=e.size,d=(s-1)*o;return typeof n=="function"?n(r,s):i===1?r*o:d-r*o}function Qb(e,t,n={}){const o=Uc(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(i=n.transitionOverride);const r=o?()=>Promise.all(D$(e,o,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:h=0,staggerChildren:u,staggerDirection:p}=i;return Mle(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 Mle(e,t,n=0,o=0,i=0,r=1,s){const d=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),d.push(Qb(l,t,{...s,delay:n+(typeof o=="function"?0:o)+B$(e.variantChildren,l,o,i,r)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(d)}function _le(e,t,n={}){e.notify("AnimationStart",t);let o;if(Array.isArray(t)){const i=t.map(r=>Qb(e,r,n));o=Promise.all(i)}else if(typeof t=="string")o=Qb(e,t,n);else{const i=typeof t=="function"?Uc(e,t,n.custom):t;o=Promise.all(D$(e,i,n))}return o.then(()=>{e.notify("AnimationComplete",t)})}function R$(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let o=0;o<n;o++)if(t[o]!==e[o])return!1;return!0}const xle=jw.length;function F$(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?F$(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<xle;n++){const o=jw[n],i=e.props[o];($1(i)||i===!1)&&(t[o]=i)}return t}const Lle=[...Sw].reverse(),Ile=Sw.length;function ble(e){return t=>Promise.all(t.map(({animation:n,options:o})=>_le(e,n,o)))}function wle(e){let t=ble(e),n=qC(),o=!0;const i=l=>(h,u)=>{const p=Uc(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=F$(e.parent)||{},p=[],y=new Set;let m={},g=1/0;for(let M=0;M<Ile;M++){const _=Lle[M],v=n[_],I=h[_]!==void 0?h[_]:u[_],C=$1(I),b=_===l?v.isActive:null;b===!1&&(g=M);let w=I===u[_]&&I!==h[_]&&C;if(w&&o&&e.manuallyAnimateOnMount&&(w=!1),v.protectedKeys={...m},!v.isActive&&b===null||!I&&!v.prevProp||uL(I)||typeof I=="boolean")continue;const L=Cle(v.prevProp,I);let x=L||_===l&&v.isActive&&!w&&C||M>g&&C,S=!1;const j=Array.isArray(I)?I:[I];let $=j.reduce(i(_),{});b===!1&&($={});const{prevResolvedValues:q={}}=v,H={...q,...$},P=V=>{x=!0,y.has(V)&&(S=!0,y.delete(V)),v.needsAnimating[V]=!0;const T=e.getValue(V);T&&(T.liveStyle=!1)};for(const V in H){const T=$[V],R=q[V];if(m.hasOwnProperty(V))continue;let B=!1;Yb(T)&&Yb(R)?B=!R$(T,R):B=T!==R,B?T!=null?P(V):y.add(V):T!==void 0&&y.has(V)?P(V):v.protectedKeys[V]=!0}v.prevProp=I,v.prevResolvedValues=$,v.isActive&&(m={...m,...$}),o&&e.blockInitialAnimation&&(x=!1);const A=w&&L;x&&(!A||S)&&p.push(...j.map(V=>{const T={type:_};if(typeof V=="string"&&o&&!A&&e.manuallyAnimateOnMount&&e.parent){const{parent:R}=e,B=Uc(R,V);if(R.enteringChildren&&B){const{delayChildren:F}=B.transition||{};T.delay=B$(R.enteringChildren,e,F)}}return{animation:V,options:T}}))}if(y.size){const M={};if(typeof h.initial!="boolean"){const _=Uc(e,Array.isArray(h.initial)?h.initial[0]:h.initial);_&&_.transition&&(M.transition=_.transition)}y.forEach(_=>{const v=e.getBaseTarget(_),I=e.getValue(_);I&&(I.liveStyle=!0),M[_]=v??null}),p.push({animation:M})}let f=!!p.length;return o&&(h.initial===!1||h.initial===h.animate)&&!e.manuallyAnimateOnMount&&(f=!1),o=!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=qC()}}}function Cle(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!R$(t,e):!1}function Vt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function qC(){return{animate:Vt(!0),whileInView:Vt(),whileHover:Vt(),whileTap:Vt(),whileDrag:Vt(),whileFocus:Vt(),exit:Vt()}}class qt{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Nle extends qt{constructor(t){super(t),t.animationState||(t.animationState=wle(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();uL(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 Sle=0;class jle extends qt{constructor(){super(...arguments),this.id=Sle++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:o}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===o)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 $le={animation:{Feature:Nle},exit:{Feature:jle}};function A1(e,t,n,o={passive:!0}){return e.addEventListener(t,n,o),()=>e.removeEventListener(t,n)}function H1(e){return{point:{x:e.pageX,y:e.pageY}}}const qle=e=>t=>Nw(t)&&e(t,H1(t));function I1(e,t,n,o){return A1(e,t,qle(n),o)}const E$=1e-4,Ale=1-E$,zle=1+E$,O$=.01,Vle=0-O$,Ple=0+O$;function Se(e){return e.max-e.min}function Tle(e,t,n){return Math.abs(e-t)<=n}function AC(e,t,n,o=.5){e.origin=o,e.originPoint=ie(t.min,t.max,e.origin),e.scale=Se(n)/Se(t),e.translate=ie(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Ale&&e.scale<=zle||isNaN(e.scale))&&(e.scale=1),(e.translate>=Vle&&e.translate<=Ple||isNaN(e.translate))&&(e.translate=0)}function b1(e,t,n,o){AC(e.x,t.x,n.x,o?o.originX:void 0),AC(e.y,t.y,n.y,o?o.originY:void 0)}function zC(e,t,n){e.min=n.min+t.min,e.max=e.min+Se(t)}function Hle(e,t,n){zC(e.x,t.x,n.x),zC(e.y,t.y,n.y)}function VC(e,t,n){e.min=t.min-n.min,e.max=e.min+Se(t)}function w1(e,t,n){VC(e.x,t.x,n.x),VC(e.y,t.y,n.y)}function Re(e){return[e("x"),e("y")]}const U$=({current:e})=>e?e.ownerDocument.defaultView:null,PC=(e,t)=>Math.abs(e-t);function Dle(e,t){const n=PC(e.x,t.x),o=PC(e.y,t.y);return Math.sqrt(n**2+o**2)}class W${constructor(t,n,{transformPagePoint:o,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=RL(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,g=Dle(y.offset,{x:0,y:0})>=this.distanceThreshold;if(!m&&!g)return;const{point:f}=y,{timestamp:M}=xe;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=BL(m,this.transformPagePoint),oe.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 _=RL(y.type==="pointercancel"?this.lastMoveEventInfo:BL(m,this.transformPagePoint),this.history);this.startEvent&&g&&g(y,_),f&&f(y,_)},!Nw(t))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=o,this.distanceThreshold=s,this.contextWindow=i||window;const d=H1(t),l=BL(d,this.transformPagePoint),{point:h}=l,{timestamp:u}=xe;this.history=[{...h,timestamp:u}];const{onSessionStart:p}=n;p&&p(t,RL(l,this.history)),this.removeListeners=V1(I1(this.contextWindow,"pointermove",this.handlePointerMove),I1(this.contextWindow,"pointerup",this.handlePointerUp),I1(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),kt(this.updatePoint)}}function BL(e,t){return t?{point:t(e.point)}:e}function TC(e,t){return{x:e.x-t.x,y:e.y-t.y}}function RL({point:e},t){return{point:e,delta:TC(e,G$(t)),offset:TC(e,Ble(t)),velocity:Rle(t,.1)}}function Ble(e){return e[0]}function G$(e){return e[e.length-1]}function Rle(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,o=null;const i=G$(e);for(;n>=0&&(o=e[n],!(i.timestamp-o.timestamp>Ke(t)));)n--;if(!o)return{x:0,y:0};const r=Ee(i.timestamp-o.timestamp);if(r===0)return{x:0,y:0};const s={x:(i.x-o.x)/r,y:(i.y-o.y)/r};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function Fle(e,{min:t,max:n},o){return t!==void 0&&e<t?e=o?ie(t,e,o.min):Math.max(e,t):n!==void 0&&e>n&&(e=o?ie(n,e,o.max):Math.min(e,n)),e}function HC(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 Ele(e,{top:t,left:n,bottom:o,right:i}){return{x:HC(e.x,n,i),y:HC(e.y,t,o)}}function DC(e,t){let n=t.min-e.min,o=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,o]=[o,n]),{min:n,max:o}}function Ole(e,t){return{x:DC(e.x,t.x),y:DC(e.y,t.y)}}function Ule(e,t){let n=.5;const o=Se(e),i=Se(t);return i>o?n=N1(t.min,t.max-o,e.min):o>i&&(n=N1(e.min,e.max-i,t.min)),pt(0,1,n)}function Wle(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 ew=.35;function Gle(e=ew){return e===!1?e=0:e===!0&&(e=ew),{x:BC(e,"left","right"),y:BC(e,"top","bottom")}}function BC(e,t,n){return{min:RC(e,t),max:RC(e,n)}}function RC(e,t){return typeof e=="number"?e:e[t]||0}const Zle=new WeakMap;class Kle{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=pe(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:o}={}){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(H1(p).point)},s=(p,y)=>{const{drag:m,dragPropagation:g,onDragStart:f}=this.getProps();if(m&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Qde(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),Re(_=>{let v=this.getAxisMotionValue(_).get()||0;if(ct.test(v)){const{projection:I}=this.visualElement;if(I&&I.layout){const C=I.layout.layoutBox[_];C&&(v=Se(C)*(parseFloat(v)/100))}}this.originPoint[_]=v}),f&&oe.postRender(()=>f(p,y)),Jb(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=Xle(_),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=()=>Re(p=>this.getAnimationState(p)==="paused"&&this.getAxisMotionValue(p).animation?.play()),{dragSnapToOrigin:u}=this.getProps();this.panSession=new W$(t,{onSessionStart:r,onStart:s,onMove:d,onSessionEnd:l,resumeAnimation:h},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:o,contextWindow:U$(this.visualElement)})}stop(t,n){const o=t||this.latestPointerEvent,i=n||this.latestPanInfo,r=this.isDragging;if(this.cancel(),!r||!i||!o)return;const{velocity:s}=i;this.startAnimation(s);const{onDragEnd:d}=this.getProps();d&&oe.postRender(()=>d(o,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:o}=this.getProps();!o&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,o){const{drag:i}=this.getProps();if(!o||!U1(t,i,this.currentDirection))return;const r=this.getAxisMotionValue(t);let s=this.originPoint[t]+o[t];this.constraints&&this.constraints[t]&&(s=Fle(s,this.constraints[t],this.elastic[t])),r.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),o=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;t&&Tc(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&o?this.constraints=Ele(o.layoutBox,t):this.constraints=!1,this.elastic=Gle(n),i!==this.constraints&&o&&this.constraints&&!this.hasMutatedConstraints&&Re(r=>{this.constraints!==!1&&this.getAxisMotionValue(r)&&(this.constraints[r]=Wle(o.layoutBox[r],this.constraints[r]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Tc(t))return!1;const o=t.current;Xe(o!==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=Y0e(o,i.root,this.visualElement.getTransformPagePoint());let s=Ole(i.layout.layoutBox,r);if(n){const d=n(Z0e(s));this.hasMutatedConstraints=!!d,d&&(s=j$(d))}return s}startAnimation(t){const{drag:n,dragMomentum:o,dragElastic:i,dragTransition:r,dragSnapToOrigin:s,onDragTransitionEnd:d}=this.getProps(),l=this.constraints||{},h=Re(u=>{if(!U1(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:o?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 o=this.getAxisMotionValue(t);return Jb(this.visualElement,t),o.start(Tw(t,o,0,n,this.visualElement,!1))}stopAnimation(){Re(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Re(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,o=this.visualElement.getProps(),i=o[n];return i||this.visualElement.getValue(t,(o.initial?o.initial[t]:void 0)||0)}snapToCursor(t){Re(n=>{const{drag:o}=this.getProps();if(!U1(n,o,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]-ie(s,d,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:o}=this.visualElement;if(!Tc(n)||!o||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Re(s=>{const d=this.getAxisMotionValue(s);if(d&&this.constraints!==!1){const l=d.get();i[s]=Ule({min:l,max:l},this.constraints[s])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",o.root&&o.root.updateScroll(),o.updateLayout(),this.resolveConstraints(),Re(s=>{if(!U1(s,t,null))return;const d=this.getAxisMotionValue(s),{min:l,max:h}=this.constraints[s];d.set(ie(l,h,i[s]))})}addListeners(){if(!this.visualElement.current)return;Zle.set(this.visualElement,this);const t=this.visualElement.current,n=I1(t,"pointerdown",l=>{const{drag:h,dragListener:u=!0}=this.getProps();h&&u&&this.start(l)}),o=()=>{const{dragConstraints:l}=this.getProps();Tc(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,r=i.addEventListener("measure",o);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),oe.read(o);const s=A1(window,"resize",()=>this.scalePositionWithinConstraints()),d=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:h})=>{this.isDragging&&h&&(Re(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:o=!1,dragPropagation:i=!1,dragConstraints:r=!1,dragElastic:s=ew,dragMomentum:d=!0}=t;return{...t,drag:n,dragDirectionLock:o,dragPropagation:i,dragConstraints:r,dragElastic:s,dragMomentum:d}}}function U1(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Xle(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Yle extends qt{constructor(t){super(t),this.removeGroupControls=Oe,this.removeListeners=Oe,this.controls=new Kle(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Oe}unmount(){this.removeGroupControls(),this.removeListeners()}}const FC=e=>(t,n)=>{e&&oe.postRender(()=>e(t,n))};class Jle extends qt{constructor(){super(...arguments),this.removePointerDownListener=Oe}onPointerDown(t){this.session=new W$(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:U$(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:o,onPanEnd:i}=this.node.getProps();return{onSessionStart:FC(t),onStart:FC(n),onMove:o,onEnd:(r,s)=>{delete this.session,i&&oe.postRender(()=>i(r,s))}}}mount(){this.removePointerDownListener=I1(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 Kx={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function EC(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const t1={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(O.test(e))e=parseFloat(e);else return e;const n=EC(e,t.target.x),o=EC(e,t.target.y);return`${n}% ${o}%`}},Qle={correct:(e,{treeScale:t,projectionDelta:n})=>{const o=e,i=jt.parse(e);if(i.length>5)return o;const r=jt.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=ie(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 FL=!1;class ehe extends k.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:o,layoutId:i}=this.props,{projection:r}=t;x0e(the),r&&(n.group&&n.group.add(r),o&&o.register&&i&&o.register(r),FL&&r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,onExitComplete:()=>this.safeToRemove()})),Kx.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:o,drag:i,isPresent:r}=this.props,{projection:s}=o;return s&&(s.isPresent=r,FL=!0,i||t.layoutDependency!==n||n===void 0||t.isPresent!==r?s.willUpdate():this.safeToRemove(),t.isPresent!==r&&(r?s.promote():s.relegate()||oe.postRender(()=>{const d=s.getStack();(!d||!d.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Cw.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:o}=this.props,{projection:i}=t;FL=!0,i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),o&&o.deregister&&o.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Z$(e){const[t,n]=m$(),o=k.useContext(cw);return c.jsx(ehe,{...e,layoutGroup:o,switchLayoutGroup:k.useContext(N$),isPresent:t,safeToRemove:n})}const the={borderRadius:{...t1,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:t1,borderTopRightRadius:t1,borderBottomLeftRadius:t1,borderBottomRightRadius:t1,boxShadow:Qle};function ahe(e,t,n){const o=Le(e)?e:Cc(e);return o.start(Tw("",o,t,n)),o.animation}const nhe=(e,t)=>e.depth-t.depth;class ohe{constructor(){this.children=[],this.isDirty=!1}add(t){sw(this.children,t),this.isDirty=!0}remove(t){dw(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(nhe),this.isDirty=!1,this.children.forEach(t)}}function che(e,t){const n=ze.now(),o=({timestamp:i})=>{const r=i-n;r>=t&&(kt(o),e(r-t))};return oe.setup(o,!0),()=>kt(o)}const K$=["TopLeft","TopRight","BottomLeft","BottomRight"],ihe=K$.length,OC=e=>typeof e=="string"?parseFloat(e):e,UC=e=>typeof e=="number"||O.test(e);function rhe(e,t,n,o,i,r){i?(e.opacity=ie(0,n.opacity??1,she(o)),e.opacityExit=ie(t.opacity??1,0,dhe(o))):r&&(e.opacity=ie(t.opacity??1,n.opacity??1,o));for(let s=0;s<ihe;s++){const d=`border${K$[s]}Radius`;let l=WC(t,d),h=WC(n,d);if(l===void 0&&h===void 0)continue;l||(l=0),h||(h=0),l===0||h===0||UC(l)===UC(h)?(e[d]=Math.max(ie(OC(l),OC(h),o),0),(ct.test(h)||ct.test(l))&&(e[d]+="%")):e[d]=h}(t.rotate||n.rotate)&&(e.rotate=ie(t.rotate||0,n.rotate||0,o))}function WC(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const she=X$(0,.5,Vj),dhe=X$(.5,.95,Oe);function X$(e,t,n){return o=>o<e?0:o>t?1:n(N1(e,t,o))}function GC(e,t){e.min=t.min,e.max=t.max}function He(e,t){GC(e.x,t.x),GC(e.y,t.y)}function ZC(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function KC(e,t,n,o,i){return e-=t,e=oL(e,1/n,o),i!==void 0&&(e=oL(e,1/i,o)),e}function lhe(e,t=0,n=1,o=.5,i,r=e,s=e){if(ct.test(t)&&(t=parseFloat(t),t=ie(s.min,s.max,t/100)-s.min),typeof t!="number")return;let d=ie(r.min,r.max,o);e===r&&(d-=t),e.min=KC(e.min,t,n,d,i),e.max=KC(e.max,t,n,d,i)}function XC(e,t,[n,o,i],r,s){lhe(e,t[n],t[o],t[i],t.scale,r,s)}const hhe=["x","scaleX","originX"],uhe=["y","scaleY","originY"];function YC(e,t,n,o){XC(e.x,t,hhe,n?n.x:void 0,o?o.x:void 0),XC(e.y,t,uhe,n?n.y:void 0,o?o.y:void 0)}function JC(e){return e.translate===0&&e.scale===1}function Y$(e){return JC(e.x)&&JC(e.y)}function QC(e,t){return e.min===t.min&&e.max===t.max}function phe(e,t){return QC(e.x,t.x)&&QC(e.y,t.y)}function eN(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function J$(e,t){return eN(e.x,t.x)&&eN(e.y,t.y)}function tN(e){return Se(e.x)/Se(e.y)}function aN(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class yhe{constructor(){this.members=[]}add(t){sw(this.members,t),t.scheduleRender()}remove(t){if(dw(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 o;for(let i=n;i>=0;i--){const r=this.members[i];if(r.isPresent!==!1){o=r;break}}return o?(this.promote(o),!0):!1}promote(t,n){const o=this.lead;if(t!==o&&(this.prevLead=o,this.lead=t,t.show(),o)){o.instance&&o.scheduleRender(),t.scheduleRender(),t.resumeFrom=o,n&&(t.resumeFrom.preserveOpacity=!0),o.snapshot&&(t.snapshot=o.snapshot,t.snapshot.latestValues=o.animationValues||o.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&o.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:o}=t;n.onExitComplete&&n.onExitComplete(),o&&o.options.onExitComplete&&o.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function khe(e,t,n){let o="";const i=e.x.translate/t.x,r=e.y.translate/t.y,s=n?.z||0;if((i||r||s)&&(o=`translate3d(${i}px, ${r}px, ${s}px) `),(t.x!==1||t.y!==1)&&(o+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:h,rotate:u,rotateX:p,rotateY:y,skewX:m,skewY:g}=n;h&&(o=`perspective(${h}px) ${o}`),u&&(o+=`rotate(${u}deg) `),p&&(o+=`rotateX(${p}deg) `),y&&(o+=`rotateY(${y}deg) `),m&&(o+=`skewX(${m}deg) `),g&&(o+=`skewY(${g}deg) `)}const d=e.x.scale*t.x,l=e.y.scale*t.y;return(d!==1||l!==1)&&(o+=`scale(${d}, ${l})`),o||"none"}const EL=["","X","Y","Z"],mhe=1e3;let fhe=0;function OL(e,t,n,o){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),o&&(o[e]=0))}function Q$(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=H$(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",oe,!(i||r))}const{parent:o}=e;o&&!o.hasCheckedOptimisedAppear&&Q$(o)}function eq({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:o,resetTransform:i}){return class{constructor(s={},d=t?.()){this.id=fhe++,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(Mhe),this.nodes.forEach(Ihe),this.nodes.forEach(bhe),this.nodes.forEach(_he)},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 ohe)}addEventListener(s,d){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new hw),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=k$(s)&&!c0e(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;oe.read(()=>{p=window.innerWidth}),e(s,()=>{const m=window.innerWidth;m!==p&&(p=m,this.root.updateBlockedByResize=!0,u&&u(),u=che(y,250),Kx.hasAnimatedSinceResize&&(Kx.hasAnimatedSinceResize=!1,this.nodes.forEach(cN)))})}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()||jhe,{onLayoutAnimationStart:f,onLayoutAnimationComplete:M}=h.getProps(),_=!this.targetLayout||!J$(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 I={...bw(g,"layout"),onPlay:f,onComplete:M};(h.shouldReduceMotion||this.options.layoutRoot)&&(I.delay=0,I.type=!1),this.startAnimation(I),this.setAnimationOrigin(u,v)}else p||cN(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(),kt(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(whe),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&&Q$(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(nN);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(oN);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Lhe),this.nodes.forEach(ghe),this.nodes.forEach(vhe)):this.nodes.forEach(oN),this.clearAllSnapshots();const d=ze.now();xe.delta=pt(0,1e3/60,d-xe.timestamp),xe.timestamp=d,xe.isProcessing=!0,qL.update.process(xe),qL.preRender.process(xe),qL.render.process(xe),xe.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Cw.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(xhe),this.sharedNodes.forEach(Che)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,oe.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){oe.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Se(this.snapshot.measuredBox.x)&&!Se(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=pe(),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=o(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&&!Y$(this.projectionDelta),l=this.getTransformTemplate(),h=l?l(this.latestValues,""):void 0,u=h!==this.prevTransformTemplateValue;s&&this.instance&&(d||Mc(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)),$he(l),{animationId:this.root.animationId,measuredBox:d,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:s}=this.options;if(!s)return pe();const d=s.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(qhe))){const{scroll:h}=this.root;h&&(Hc(d.x,h.offset.x),Hc(d.y,h.offset.y))}return d}removeElementScroll(s){const d=pe();if(He(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&&He(d,s),Hc(d.x,u.offset.x),Hc(d.y,u.offset.y))}return d}applyTransform(s,d=!1){const l=pe();He(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&&Dc(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Mc(u.latestValues)&&Dc(l,u.latestValues)}return Mc(this.latestValues)&&Dc(l,this.latestValues),l}removeTransform(s){const d=pe();He(d,s);for(let l=0;l<this.path.length;l++){const h=this.path[l];if(!h.instance||!Mc(h.latestValues))continue;Zb(h.latestValues)&&h.updateSnapshot();const u=pe(),p=h.measurePageBox();He(u,p),YC(d,h.latestValues,h.snapshot?h.snapshot.layoutBox:void 0,u)}return Mc(this.latestValues)&&YC(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!==xe.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=xe.timestamp,!this.targetDelta&&!this.relativeTarget){const y=this.getClosestProjectingParent();y&&y.layout&&this.animationProgress!==1?(this.relativeParent=y,this.forceRelativeParentToResolveTarget(),this.relativeTarget=pe(),this.relativeTargetOrigin=pe(),w1(this.relativeTargetOrigin,this.layout.layoutBox,y.layout.layoutBox),He(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=pe(),this.targetWithTransforms=pe()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Hle(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):He(this.target,this.layout.layoutBox),q$(this.target,this.targetDelta)):He(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=pe(),this.relativeTargetOrigin=pe(),w1(this.relativeTargetOrigin,this.target,y.target),He(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||Zb(this.parent.latestValues)||$$(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===xe.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;He(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,y=this.treeScale.y;X0e(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=pe());const{target:m}=s;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(ZC(this.prevProjectionDelta.x,this.projectionDelta.x),ZC(this.prevProjectionDelta.y,this.projectionDelta.y)),b1(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==y||!aN(this.projectionDelta.x,this.prevProjectionDelta.x)||!aN(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=Bc(),this.projectionDelta=Bc(),this.projectionDeltaWithTransform=Bc()}setAnimationOrigin(s,d=!1){const l=this.snapshot,h=l?l.latestValues:{},u={...this.latestValues},p=Bc();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!d;const y=pe(),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(She));this.animationProgress=0;let I;this.mixTargetDelta=C=>{const b=C/1e3;iN(p.x,s.x,b),iN(p.y,s.y,b),this.setTargetDelta(p),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(w1(y,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Nhe(this.relativeTarget,this.relativeTargetOrigin,y,b),I&&phe(this.relativeTarget,I)&&(this.isProjectionDirty=!1),I||(I=pe()),He(I,this.relativeTarget)),f&&(this.animationValues=u,rhe(u,h,this.latestValues,b,v,_)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=b},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(kt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=oe.update(()=>{Kx.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Cc(0)),this.currentAnimation=ahe(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(mhe),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&&tq(this.options.animationType,this.layout.layoutBox,h.layoutBox)){l=this.target||pe();const p=Se(this.layout.layoutBox.x);l.x.min=s.target.x.min,l.x.max=l.x.min+p;const y=Se(this.layout.layoutBox.y);l.y.min=s.target.y.min,l.y.max=l.y.min+y}He(d,l),Dc(d,u),b1(this.projectionDeltaWithTransform,this.layoutCorrected,d,u)}}registerSharedNode(s,d){this.sharedNodes.has(s)||this.sharedNodes.set(s,new yhe),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&&OL("z",s,h,this.animationValues);for(let u=0;u<EL.length;u++)OL(`rotate${EL[u]}`,s,h,this.animationValues),OL(`skew${EL[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=Zx(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=Zx(d?.pointerEvents)||""),this.hasProjected&&!Mc(this.latestValues)&&(s.transform=l?l({},""):"none",this.hasProjected=!1);return}s.visibility="";const u=h.animationValues||h.latestValues;this.applyTransformsToTarget();let p=khe(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 q1){if(u[g]===void 0)continue;const{correct:f,applyTo:M,isCSSVariable:_}=q1[g],v=p==="none"?u[g]:f(u[g],h);if(M){const I=M.length;for(let C=0;C<I;C++)s[M[C]]=v}else _?this.options.visualElement.renderState.vars[g]=v:s[g]=v}this.options.layoutId&&(s.pointerEvents=h===this?Zx(d?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>s.currentAnimation?.stop()),this.root.nodes.forEach(nN),this.root.sharedNodes.clear()}}}function ghe(e){e.updateLayout()}function vhe(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:o}=e.layout,{animationType:i}=e.options,r=t.source!==e.layout.source;i==="size"?Re(u=>{const p=r?t.measuredBox[u]:t.layoutBox[u],y=Se(p);p.min=n[u].min,p.max=p.min+y}):tq(i,t.layoutBox,n)&&Re(u=>{const p=r?t.measuredBox[u]:t.layoutBox[u],y=Se(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=Bc();b1(s,n,t.layoutBox);const d=Bc();r?b1(d,e.applyTransform(o,!0),t.measuredBox):b1(d,n,t.layoutBox);const l=!Y$(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=pe();w1(m,t.layoutBox,p.layoutBox);const g=pe();w1(g,n,y.layoutBox),J$(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 Mhe(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 _he(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function xhe(e){e.clearSnapshot()}function nN(e){e.clearMeasurements()}function oN(e){e.isLayoutDirty=!1}function Lhe(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function cN(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Ihe(e){e.resolveTargetDelta()}function bhe(e){e.calcProjection()}function whe(e){e.resetSkewAndRotation()}function Che(e){e.removeLeadSnapshot()}function iN(e,t,n){e.translate=ie(t.translate,0,n),e.scale=ie(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function rN(e,t,n,o){e.min=ie(t.min,n.min,o),e.max=ie(t.max,n.max,o)}function Nhe(e,t,n,o){rN(e.x,t.x,n.x,o),rN(e.y,t.y,n.y,o)}function She(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const jhe={duration:.45,ease:[.4,0,.1,1]},sN=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),dN=sN("applewebkit/")&&!sN("chrome/")?Math.round:Oe;function lN(e){e.min=dN(e.min),e.max=dN(e.max)}function $he(e){lN(e.x),lN(e.y)}function tq(e,t,n){return e==="position"||e==="preserve-aspect"&&!Tle(tN(t),tN(n),.2)}function qhe(e){return e!==e.root&&e.scroll?.wasRoot}const Ahe=eq({attachResizeListener:(e,t)=>A1(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),UL={current:void 0},aq=eq({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!UL.current){const e=new Ahe({});e.mount(window),e.setOptions({layoutScroll:!0}),UL.current=e}return UL.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),zhe={pan:{Feature:Jle},drag:{Feature:Yle,ProjectionNode:aq,MeasureLayout:Z$}};function hN(e,t,n){const{props:o}=e;e.animationState&&o.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,r=o[i];r&&oe.postRender(()=>r(t,H1(t)))}class Vhe extends qt{mount(){const{current:t}=this.node;t&&(this.unmount=e0e(t,(n,o)=>(hN(this.node,o,"Start"),i=>hN(this.node,i,"End"))))}unmount(){}}class Phe extends qt{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=V1(A1(this.node.current,"focus",()=>this.onFocus()),A1(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function uN(e,t,n){const{props:o}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&o.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),r=o[i];r&&oe.postRender(()=>r(t,H1(t)))}class The extends qt{mount(){const{current:t}=this.node;t&&(this.unmount=o0e(t,(n,o)=>(uN(this.node,o,"Start"),(i,{success:r})=>uN(this.node,i,r?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const tw=new WeakMap,WL=new WeakMap,Hhe=e=>{const t=tw.get(e.target);t&&t(e)},Dhe=e=>{e.forEach(Hhe)};function Bhe({root:e,...t}){const n=e||document;WL.has(n)||WL.set(n,{});const o=WL.get(n),i=JSON.stringify(t);return o[i]||(o[i]=new IntersectionObserver(Dhe,{root:e,...t})),o[i]}function Rhe(e,t,n){const o=Bhe(t);return tw.set(e,n),o.observe(e),()=>{tw.delete(e),o.unobserve(e)}}const Fhe={some:0,all:1};class Ehe extends qt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:o,amount:i="some",once:r}=t,s={root:n?n.current:void 0,rootMargin:o,threshold:typeof i=="number"?i:Fhe[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 Rhe(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(Ohe(t,n))&&this.startObserver()}unmount(){}}function Ohe({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Uhe={inView:{Feature:Ehe},tap:{Feature:The},focus:{Feature:Phe},hover:{Feature:Vhe}},Whe={layout:{ProjectionNode:aq,MeasureLayout:Z$}},Ghe={...$le,...Uhe,...zhe,...Whe},Hw=G0e(Ghe,ile);function nq(e){const t=$t(()=>Cc(e)),{isStatic:n}=k.useContext(lL);if(n){const[,o]=k.useState(e);k.useEffect(()=>t.on("change",o),[])}return t}function oq(e,t){const n=nq(t()),o=()=>n.set(t());return o(),rw(()=>{const i=()=>oe.preRender(o,!1,!0),r=e.map(s=>s.on("change",i));return()=>{r.forEach(s=>s()),kt(o)}}),n}function Zhe(e){L1.current=[],e();const t=oq(L1.current,e);return L1.current=void 0,t}function Khe(e,t,n,o){if(typeof e=="function")return Zhe(e);const i=typeof t=="function"?t:i0e(t,n,o);return Array.isArray(e)?pN(e,i):pN([e],([r])=>i(r))}function pN(e,t){const n=$t(()=>[]);return oq(e,()=>{n.length=0;const o=e.length;for(let i=0;i<o;i++)n[i]=e[i].get();return t(n)})}class Xhe{constructor(){this.componentControls=new Set}subscribe(t){return this.componentControls.add(t),()=>this.componentControls.delete(t)}start(t,n){this.componentControls.forEach(o=>{o.start(t.nativeEvent||t,n)})}cancel(){this.componentControls.forEach(t=>{t.cancel()})}stop(){this.componentControls.forEach(t=>{t.stop()})}}const Yhe=()=>new Xhe;function Jhe(){return $t(Yhe)}const cq=k.createContext(null);function Qhe(e,t,n,o){if(!o)return e;const i=e.findIndex(u=>u.value===t);if(i===-1)return e;const r=o>0?1:-1,s=e[i+r];if(!s)return e;const d=e[i],l=s.layout,h=ie(l.min,l.max,.5);return r===1&&d.layout.max+n>h||r===-1&&d.layout.min+n<h?u2e(e,i,i+r):e}function eue({children:e,as:t="ul",axis:n="y",onReorder:o,values:i,...r},s){const d=$t(()=>Hw[t]),l=[],h=k.useRef(!1);Xe(!!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(nue)},updateOrder:(p,y,m)=>{if(h.current)return;const g=Qhe(l,p,y,m);l!==g&&(h.current=!0,o(g.map(aue).filter(f=>i.indexOf(f)!==-1)))}};return k.useEffect(()=>{h.current=!1}),c.jsx(d,{...r,ref:s,ignoreStrict:!0,children:c.jsx(cq.Provider,{value:u,children:e})})}const tue=k.forwardRef(eue);function aue(e){return e.value}function nue(e,t){return e.layout.min-t.layout.min}function yN(e,t=0){return Le(e)?e:nq(t)}function oue({children:e,style:t={},value:n,as:o="li",onDrag:i,layout:r=!0,...s},d){const l=$t(()=>Hw[o]),h=k.useContext(cq),u={x:yN(t.x),y:yN(t.y)},p=Khe([u.x,u.y],([f,M])=>f||M?1:"unset");Xe(!!h,"Reorder.Item must be a child of Reorder.Group","reorder-item-child");const{axis:y,registerItem:m,updateOrder:g}=h;return c.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 cue=k.forwardRef(oue),cL=[c.jsx(_1,{size:18}),c.jsx(Lt,{size:18}),c.jsx(g1,{size:18}),c.jsx(It,{size:18}),c.jsx(l1,{size:18}),c.jsx(d1,{size:18})],iue=({items:e,onReorder:t,draggable:n=!1,className:o,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=cL[u%cL.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]),c.jsxs("div",{className:`trend-list ${o??""}`,draggable:n,style:{position:"relative"},children:[c.jsx("div",{className:"trend-header",style:r,children:i??"Trend"}),c.jsx("div",{className:"trend-list-body",style:{opacity:n?0:1},children:c.jsx(tue,{axis:"y",values:d,onReorder:h=>{l(h),t?.(h)},style:{display:"flex",flexDirection:"column",gap:8},children:d.map((h,u)=>c.jsx(rue,{value:h,index:u,itemsDraggable:s},String(h.id)))})}),n&&c.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:c.jsx(a.Move,{size:48,strokeWidth:1.5,style:{opacity:.8}})})]})};function rue({value:e,index:t}){const n=Jhe(),o=cL[t%cL.length]??null;return c.jsx(cue,{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:c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[c.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:c.jsx("svg",{width:"25",height:"25",viewBox:"0 0 24 24","aria-hidden":!0,children:c.jsxs("g",{fill:"currentColor",children:[c.jsx("circle",{cx:"8",cy:"6",r:"2"}),c.jsx("circle",{cx:"16",cy:"6",r:"2"}),c.jsx("circle",{cx:"8",cy:"12",r:"2"}),c.jsx("circle",{cx:"16",cy:"12",r:"2"}),c.jsx("circle",{cx:"8",cy:"18",r:"2"}),c.jsx("circle",{cx:"16",cy:"18",r:"2"})]})})}),c.jsx("div",{style:{flex:1},children:c.jsx(Ij,{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??o})})]})})}function sue(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 due(e){return!e||typeof e=="string"&&e.trim()===""}function lue(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)?null:{isValid:!1,error:"Format d'email invalide"}}function hue(e){return/^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)*\/?$/.test(e)?null:{isValid:!1,error:"Format d'URL invalide"}}function uue(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 pue(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 yue(e,t){if(t.validation?.acceptedTypes){const n=t.validation.acceptedTypes.split(","),o=e.type;if(!n.some(i=>o.match(i.replace("*",".*"))))return{isValid:!1,error:`Type de fichier non supporté: ${o}`}}return t.validation?.maxFileSize&&e.size>t.validation.maxFileSize?{isValid:!1,error:`Fichier trop volumineux (max ${t.validation.maxFileSize/1048576}MB)`}:null}function kue(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 iL(e,t){const n=sue(e,t);if(n)return n;if(due(e))return{isValid:!0};const o=e.toString();switch(t.type){case"email":{const r=lue(o);if(r)return r;break}case"url":{const r=hue(o);if(r)return r;break}case"number":{const r=uue(e,t);if(r)return r;break}case"date":case"month":case"week":case"time":case"datetime-local":{const r=pue(e,t);if(r)return r;break}case"file":{const r=yue(e,t);if(r)return r;break}}const i=kue(o,t);return i||{isValid:!0}}function iq(e,t){const n={};let o=!0;for(const i of t){const r=iL(e[i.name],i);r.isValid||(n[i.name]=r.error,o=!1)}return{isValid:o,errors:n}}const mue="_formContainer_14ads_1",fue="_headerLine_14ads_17",gue="_formTitle_14ads_25",vue="_formDescription_14ads_30",Mue="_sectionTitle_14ads_37",_ue="_sectionHelp_14ads_44",xue="_fieldHelp_14ads_50",Lue="_gridContainer_14ads_58",Iue="_fieldGridItem_14ads_70",bue="_sectionFull_14ads_105",wue="_formFooter_14ads_110",Cue="_footerLeft_14ads_118",Nue="_footerRight_14ads_119",Sue="_cancelLink_14ads_125",jue="_submitButton_14ads_136",$ue="_fieldLabel_14ads_148",que="_inputWrapper_14ads_163",Aue="_inputInner_14ads_187",zue="_hasPrefix_14ads_196",Vue="_inputBase_14ads_196",Pue="_iconPrefix_14ads_292",Tue="_iconSuffix_14ads_293",Hue="_passwordToggle_14ads_319",Due="_fieldError_14ads_365",Bue="_fieldInvalid_14ads_372",ne={formContainer:mue,headerLine:fue,formTitle:gue,formDescription:vue,sectionTitle:Mue,sectionHelp:_ue,fieldHelp:xue,gridContainer:Lue,fieldGridItem:Iue,sectionFull:bue,formFooter:wue,footerLeft:Cue,footerRight:Nue,cancelLink:Sue,submitButton:jue,fieldLabel:$ue,inputWrapper:que,inputInner:Aue,hasPrefix:zue,inputBase:Vue,iconPrefix:Pue,iconSuffix:Tue,passwordToggle:Hue,fieldError:Due,fieldInvalid:Bue},rq=({field:e,value:t,onChange:n,onBlur:o,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?ut[e.attributes.icon]:null),y=e.attributes?.iconPosition??"suffix",m=g=>{n(g.target.value)};return c.jsxs("div",{className:ne.inputWrapper,children:[c.jsx("label",{className:`${ne.fieldLabel} ${e.required?"required":""}`,htmlFor:e.name,children:e.label}),c.jsxs("div",{className:`${ne.inputInner} ${p&&y==="prefix"?ne.hasPrefix:""}`,children:[p&&y==="prefix"&&c.jsx("span",{className:ne.iconPrefix,children:c.jsx(p,{size:16})}),c.jsx("input",{id:e.name,name:e.name,type:u,placeholder:e.placeholder,className:`${ne.inputBase} ${i?ne.fieldInvalid:""}`,value:t??"",onChange:m,onBlur:o,disabled:!!e.disabled,"aria-invalid":!!i,"aria-describedby":e.help?`${e.name}-help`:void 0}),l&&h&&c.jsx("button",{type:"button","aria-label":s?"Masquer le mot de passe":"Afficher le mot de passe",className:ne.passwordToggle,onClick:()=>d(g=>!g),children:s?c.jsx(y1,{size:16}):c.jsx(k1,{size:16})}),p&&y==="suffix"&&!l&&c.jsx("span",{className:ne.iconSuffix,children:c.jsx(p,{size:16})})]}),r&&i&&c.jsx("span",{className:ne.fieldError,children:i})]})},Rue="_fieldGroup_yb3zi_7",Fue="_fieldLabel_yb3zi_11",Eue="_required_yb3zi_17",Oue="_fieldInput_yb3zi_22",Uue="_fieldInvalid_yb3zi_40",Wue="_fieldValid_yb3zi_44",Gue="_fieldError_yb3zi_48",Zue="_radioGroup_yb3zi_57",wt={fieldGroup:Rue,fieldLabel:Fue,required:Eue,fieldInput:Oue,fieldInvalid:Uue,fieldValid:Wue,fieldError:Gue,radioGroup:Zue},yL=({field:e,children:t,error:n,touched:o})=>{const i=o&&n;return c.jsxs("div",{className:wt.fieldGroup,children:[e.type!=="checkbox"&&e.type!=="radio"&&c.jsx("label",{className:`${wt.fieldLabel} ${e.required?wt.required:""}`,children:e.label}),t,i&&c.jsx("span",{className:wt.fieldError,children:n})]})},sq=({field:e,value:t,onChange:n,onBlur:o,error:i,touched:r})=>{const s=r&&i,d=r&&!i&&t,l=["form-control",wt.fieldInput,s?wt.fieldInvalid:"",d?wt.fieldValid:""].filter(Boolean).join(" ");return c.jsx(yL,{field:e,error:i,touched:r,children:c.jsx("textarea",{className:l,placeholder:e.placeholder,value:t||"",onChange:h=>n(h.target.value),onBlur:o,rows:4})})},Kue="_wrapper_117u4_1",Xue="_wrapperInvalid_117u4_15",Yue="_nativeSelect_117u4_19",Jue="_display_117u4_30",Que="_topLabel_117u4_37",epe="_valueLine_117u4_45",tpe="_valuePlaceholder_117u4_53",ape="_valueActive_117u4_57",npe="_caret_117u4_61",ope="_error_117u4_75",cpe="_optionStyle_117u4_89",De={wrapper:Kue,wrapperInvalid:Xue,nativeSelect:Yue,display:Jue,topLabel:Que,valueLine:epe,valuePlaceholder:tpe,valueActive:ape,caret:npe,error:ope,optionStyle:cpe},Dw=({field:e,value:t,onChange:n,onBlur:o,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 c.jsxs("div",{className:`${De.wrapper} ${s?De.wrapperInvalid:""} ${t?De.wrapperHasValue:""}`,children:[c.jsxs("select",{id:e.name,name:e.name,className:De.nativeSelect,value:t??"",onChange:u=>n(u.target.value),onBlur:o,"aria-invalid":s,"aria-label":d,children:[c.jsx("option",{value:"",disabled:!0,hidden:!0,children:l||`Sélectionnez ${d?.toLowerCase()||""}`}),e.options?.map((u,p)=>c.jsx("option",{value:u.value,className:De.optionStyle,children:u.label},p))]}),c.jsxs("div",{className:De.display,children:[d&&c.jsx("span",{className:De.topLabel,children:d}),c.jsx("span",{className:`${De.valueLine} ${t?De.valueActive:De.valuePlaceholder}`,children:t?h:l}),c.jsx("span",{className:De.caret,"aria-hidden":"true"})]}),s&&c.jsx("span",{className:De.error,children:i})]})},dq=({field:e,value:t,onChange:n,onBlur:o,error:i,touched:r})=>c.jsx(yL,{field:e,error:i,touched:r,children:c.jsxs("div",{className:"form-check",children:[c.jsx("input",{type:"checkbox",className:"form-check-input",id:e.name,checked:!!t,onChange:s=>n(s.target.checked),onBlur:o}),c.jsx("label",{className:"form-check-label",htmlFor:e.name,children:e.label})]})}),lq=({field:e,value:t,onChange:n,onBlur:o,error:i,touched:r})=>c.jsx(yL,{field:e,error:i,touched:r,children:c.jsx("div",{className:wt.radioGroup,children:e.options?.map(s=>c.jsxs("div",{className:"form-check",children:[c.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:o}),c.jsx("label",{className:"form-check-label",htmlFor:`${e.name}-${s.value}`,children:s.label})]},s.value))})}),ipe="_fileInputContainer_r2guc_3",rpe="_customFileInput_r2guc_8",spe="_fileInputLabel_r2guc_12",dpe="_dragOver_r2guc_39",lpe="_uploadIcon_r2guc_44",hpe="_uploadText_r2guc_50",upe="_uploadHint_r2guc_56",ppe="_fileList_r2guc_60",ype="_fileListTitle_r2guc_69",kpe="_fileItem_r2guc_80",mpe="_fileIcon_r2guc_96",fpe="_fileName_r2guc_102",gpe="_fileSize_r2guc_108",vpe="_removeButton_r2guc_114",Mpe="_errorText_r2guc_129",be={fileInputContainer:ipe,customFileInput:rpe,fileInputLabel:spe,dragOver:dpe,uploadIcon:lpe,uploadText:hpe,uploadHint:upe,fileList:ppe,fileListTitle:ype,fileItem:kpe,fileIcon:mpe,fileName:fpe,fileSize:gpe,removeButton:vpe,errorText:Mpe},hq=({field:e,value:t,onChange:n,onBlur:o,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(I=>v.items.add(I)),n(v.files)},f=M=>{if(M===0)return"0 Bytes";const _=1024,v=["Bytes","KB","MB","GB"],I=Math.floor(Math.log(M)/Math.log(_));return parseFloat((M/Math.pow(_,I)).toFixed(2))+" "+v[I]};return c.jsxs("div",{className:`${be.fileInputContainer} ${r&&i?be.hasError:""}`,children:[c.jsxs("label",{htmlFor:e.name,className:"form-label",children:[e.label,e.required&&c.jsx("span",{className:"text-danger",children:" *"})]}),c.jsx("input",{type:"file",id:e.name,name:e.name,multiple:e.attributes?.multiple||!1,accept:e.attributes?.accept,onChange:h,onBlur:o,ref:s,className:be.customFileInput}),c.jsxs("label",{htmlFor:e.name,className:`${be.fileInputLabel} ${d?be.dragOver:""}`,onDragOver:p,onDragLeave:y,onDrop:m,onClick:u,tabIndex:0,children:[c.jsx("div",{className:be.uploadIcon,children:c.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",fill:"currentColor",viewBox:"0 0 16 16",children:[c.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"}),c.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"})]})}),c.jsx("div",{className:be.uploadText,children:d?"Déposez vos fichiers ici":"Cliquez ou glissez-déposez pour téléverser"}),c.jsxs("div",{className:be.uploadHint,children:[e.attributes?.accept||"Tous les fichiers"," ",e.attributes?.multiple?"(Multiple autorisé)":""]})]}),t&&t.length>0&&c.jsxs("div",{className:be.fileList,children:[c.jsx("div",{className:be.fileListTitle,children:"Fichiers sélectionnés:"}),c.jsx("ul",{children:Array.from(t).map((M,_)=>c.jsxs("li",{className:be.fileItem,children:[c.jsx("div",{className:be.fileIcon,children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",children:c.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"})})}),c.jsx("div",{className:be.fileName,children:M.name}),c.jsx("div",{className:be.fileSize,children:f(M.size)}),c.jsx("button",{type:"button",className:be.removeButton,onClick:v=>{v.stopPropagation(),g(_)},"aria-label":`Supprimer ${M.name}`,children:c.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",children:[c.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"}),c.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&&c.jsx("div",{className:be.errorText,children:i})]})},_pe="_container_ecah4_2",xpe="_label_ecah4_6",Lpe="_requiredIndicator_ecah4_13",Ipe="_input_ecah4_18",bpe="_inputError_ecah4_49",wpe="_errorMessage_ecah4_58",Ac={container:_pe,label:xpe,requiredIndicator:Lpe,input:Ipe,inputError:bpe,errorMessage:wpe},uq=({field:e,value:t,onChange:n,onBlur:o,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 c.jsxs("div",{className:Ac.container,children:[c.jsxs("label",{htmlFor:e.name,className:Ac.label,style:{color:s},children:[e.label,e.required&&c.jsx("span",{className:Ac.requiredIndicator,children:"*"})]}),c.jsx("input",{type:l,id:e.name,name:e.name,value:t||"",onChange:h=>n(h.target.value),onBlur:o,className:`${Ac.input} ${r&&i?Ac.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&&c.jsx("div",{className:Ac.errorMessage,children:i})]})},Cpe="_rangeContainer_cyqk3_3",Npe={rangeContainer:Cpe},pq=({field:e,value:t,onChange:n,onBlur:o,error:i,touched:r})=>c.jsxs("div",{className:`mb-3 ${Npe.rangeContainer}`,children:[c.jsxs("label",{htmlFor:e.name,className:"form-label",children:[e.label,": ",t,e.required&&c.jsx("span",{className:"text-danger",children:" *"})]}),c.jsx("input",{type:"range",id:e.name,name:e.name,value:t||0,onChange:s=>n(s.target.value),onBlur:o,className:`form-range ${r&&i?"is-invalid":""}`,min:e.validation?.min||0,max:e.validation?.max||100,step:e.attributes?.step||1}),r&&i&&c.jsx("div",{className:"invalid-feedback",children:i})]}),Spe="_colorPickerContainer_1wxgj_2",jpe="_colorInput_1wxgj_19",$pe="_colorValue_1wxgj_39",GL={colorPickerContainer:Spe,colorInput:jpe,colorValue:$pe},yq=({field:e,value:t,onChange:n,onBlur:o,error:i,touched:r})=>c.jsxs("div",{className:"mb-3",children:[c.jsxs("label",{htmlFor:e.name,className:"form-label",children:[e.label,e.required&&c.jsx("span",{className:"text-danger",children:" *"})]}),c.jsxs("div",{className:GL.colorPickerContainer,children:[c.jsx("input",{type:"color",id:e.name,name:e.name,value:t||"#000000",onChange:s=>n(s.target.value),onBlur:o,className:GL.colorInput}),c.jsx("span",{className:GL.colorValue,children:t})]}),r&&i&&c.jsx("div",{className:"invalid-feedback",children:i})]}),kq=({field:e,value:t,onChange:n,onBlur:o,error:i,touched:r})=>{const s=["date","month","week","time","datetime-local"];if(e.type==="file")return c.jsx(hq,{field:e,value:t,onChange:n,onBlur:o,error:i,touched:r});if(s.includes(e.type))return c.jsx(uq,{field:e,value:t,onChange:n,onBlur:o,error:i,touched:r});if(e.type==="range")return c.jsx(pq,{field:e,value:t,onChange:n,onBlur:o,error:i,touched:r});if(e.type==="color")return c.jsx(yq,{field:e,value:t,onChange:n,onBlur:o,error:i,touched:r});switch(e.type){case"textarea":return c.jsx(sq,{field:e,value:t,onChange:n,onBlur:o,error:i,touched:r});case"select":return c.jsx(Dw,{field:e,value:t,onChange:n,onBlur:o,error:i,touched:r});case"checkbox":return c.jsx(dq,{field:e,value:t,onChange:n,onBlur:o,error:i,touched:r});case"radio":return c.jsx(lq,{field:e,value:t,onChange:n,onBlur:o,error:i,touched:r});default:return c.jsx(rq,{field:e,value:t,onChange:n,onBlur:o,error:i,touched:r})}};var ZL,kN;function qpe(){if(kN)return ZL;kN=1;function e(){this.__data__=[],this.size=0}return ZL=e,ZL}var KL,mN;function mq(){if(mN)return KL;mN=1;function e(t,n){return t===n||t!==t&&n!==n}return KL=e,KL}var XL,fN;function kL(){if(fN)return XL;fN=1;var e=mq();function t(n,o){for(var i=n.length;i--;)if(e(n[i][0],o))return i;return-1}return XL=t,XL}var YL,gN;function Ape(){if(gN)return YL;gN=1;var e=kL(),t=Array.prototype,n=t.splice;function o(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 YL=o,YL}var JL,vN;function zpe(){if(vN)return JL;vN=1;var e=kL();function t(n){var o=this.__data__,i=e(o,n);return i<0?void 0:o[i][1]}return JL=t,JL}var QL,MN;function Vpe(){if(MN)return QL;MN=1;var e=kL();function t(n){return e(this.__data__,n)>-1}return QL=t,QL}var eI,_N;function Ppe(){if(_N)return eI;_N=1;var e=kL();function t(n,o){var i=this.__data__,r=e(i,n);return r<0?(++this.size,i.push([n,o])):i[r][1]=o,this}return eI=t,eI}var tI,xN;function mL(){if(xN)return tI;xN=1;var e=qpe(),t=Ape(),n=zpe(),o=Vpe(),i=Ppe();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=o,r.prototype.set=i,tI=r,tI}var aI,LN;function Tpe(){if(LN)return aI;LN=1;var e=mL();function t(){this.__data__=new e,this.size=0}return aI=t,aI}var nI,IN;function Hpe(){if(IN)return nI;IN=1;function e(t){var n=this.__data__,o=n.delete(t);return this.size=n.size,o}return nI=e,nI}var oI,bN;function Dpe(){if(bN)return oI;bN=1;function e(t){return this.__data__.get(t)}return oI=e,oI}var cI,wN;function Bpe(){if(wN)return cI;wN=1;function e(t){return this.__data__.has(t)}return cI=e,cI}var iI,CN;function fq(){if(CN)return iI;CN=1;var e=typeof a.commonjsGlobal=="object"&&a.commonjsGlobal&&a.commonjsGlobal.Object===Object&&a.commonjsGlobal;return iI=e,iI}var rI,NN;function mt(){if(NN)return rI;NN=1;var e=fq(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return rI=n,rI}var sI,SN;function Bw(){if(SN)return sI;SN=1;var e=mt(),t=e.Symbol;return sI=t,sI}var dI,jN;function Rpe(){if(jN)return dI;jN=1;var e=Bw(),t=Object.prototype,n=t.hasOwnProperty,o=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=o.call(s);return h&&(d?s[i]=l:delete s[i]),u}return dI=r,dI}var lI,$N;function Fpe(){if($N)return lI;$N=1;var e=Object.prototype,t=e.toString;function n(o){return t.call(o)}return lI=n,lI}var hI,qN;function fL(){if(qN)return hI;qN=1;var e=Bw(),t=Rpe(),n=Fpe(),o="[object Null]",i="[object Undefined]",r=e?e.toStringTag:void 0;function s(d){return d==null?d===void 0?i:o:r&&r in Object(d)?t(d):n(d)}return hI=s,hI}var uI,AN;function gq(){if(AN)return uI;AN=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return uI=e,uI}var pI,zN;function vq(){if(zN)return pI;zN=1;var e=fL(),t=gq(),n="[object AsyncFunction]",o="[object Function]",i="[object GeneratorFunction]",r="[object Proxy]";function s(d){if(!t(d))return!1;var l=e(d);return l==o||l==i||l==n||l==r}return pI=s,pI}var yI,VN;function Epe(){if(VN)return yI;VN=1;var e=mt(),t=e["__core-js_shared__"];return yI=t,yI}var kI,PN;function Ope(){if(PN)return kI;PN=1;var e=Epe(),t=function(){var o=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}();function n(o){return!!t&&t in o}return kI=n,kI}var mI,TN;function Mq(){if(TN)return mI;TN=1;var e=Function.prototype,t=e.toString;function n(o){if(o!=null){try{return t.call(o)}catch{}try{return o+""}catch{}}return""}return mI=n,mI}var fI,HN;function Upe(){if(HN)return fI;HN=1;var e=vq(),t=Ope(),n=gq(),o=Mq(),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(o(y))}return fI=p,fI}var gI,DN;function Wpe(){if(DN)return gI;DN=1;function e(t,n){return t?.[n]}return gI=e,gI}var vI,BN;function Yc(){if(BN)return vI;BN=1;var e=Upe(),t=Wpe();function n(o,i){var r=t(o,i);return e(r)?r:void 0}return vI=n,vI}var MI,RN;function Rw(){if(RN)return MI;RN=1;var e=Yc(),t=mt(),n=e(t,"Map");return MI=n,MI}var _I,FN;function gL(){if(FN)return _I;FN=1;var e=Yc(),t=e(Object,"create");return _I=t,_I}var xI,EN;function Gpe(){if(EN)return xI;EN=1;var e=gL();function t(){this.__data__=e?e(null):{},this.size=0}return xI=t,xI}var LI,ON;function Zpe(){if(ON)return LI;ON=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return LI=e,LI}var II,UN;function Kpe(){if(UN)return II;UN=1;var e=gL(),t="__lodash_hash_undefined__",n=Object.prototype,o=n.hasOwnProperty;function i(r){var s=this.__data__;if(e){var d=s[r];return d===t?void 0:d}return o.call(s,r)?s[r]:void 0}return II=i,II}var bI,WN;function Xpe(){if(WN)return bI;WN=1;var e=gL(),t=Object.prototype,n=t.hasOwnProperty;function o(i){var r=this.__data__;return e?r[i]!==void 0:n.call(r,i)}return bI=o,bI}var wI,GN;function Ype(){if(GN)return wI;GN=1;var e=gL(),t="__lodash_hash_undefined__";function n(o,i){var r=this.__data__;return this.size+=this.has(o)?0:1,r[o]=e&&i===void 0?t:i,this}return wI=n,wI}var CI,ZN;function Jpe(){if(ZN)return CI;ZN=1;var e=Gpe(),t=Zpe(),n=Kpe(),o=Xpe(),i=Ype();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=o,r.prototype.set=i,CI=r,CI}var NI,KN;function Qpe(){if(KN)return NI;KN=1;var e=Jpe(),t=mL(),n=Rw();function o(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return NI=o,NI}var SI,XN;function eye(){if(XN)return SI;XN=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return SI=e,SI}var jI,YN;function vL(){if(YN)return jI;YN=1;var e=eye();function t(n,o){var i=n.__data__;return e(o)?i[typeof o=="string"?"string":"hash"]:i.map}return jI=t,jI}var $I,JN;function tye(){if(JN)return $I;JN=1;var e=vL();function t(n){var o=e(this,n).delete(n);return this.size-=o?1:0,o}return $I=t,$I}var qI,QN;function aye(){if(QN)return qI;QN=1;var e=vL();function t(n){return e(this,n).get(n)}return qI=t,qI}var AI,eS;function nye(){if(eS)return AI;eS=1;var e=vL();function t(n){return e(this,n).has(n)}return AI=t,AI}var zI,tS;function oye(){if(tS)return zI;tS=1;var e=vL();function t(n,o){var i=e(this,n),r=i.size;return i.set(n,o),this.size+=i.size==r?0:1,this}return zI=t,zI}var VI,aS;function _q(){if(aS)return VI;aS=1;var e=Qpe(),t=tye(),n=aye(),o=nye(),i=oye();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=o,r.prototype.set=i,VI=r,VI}var PI,nS;function cye(){if(nS)return PI;nS=1;var e=mL(),t=Rw(),n=_q(),o=200;function i(r,s){var d=this.__data__;if(d instanceof e){var l=d.__data__;if(!t||l.length<o-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 PI=i,PI}var TI,oS;function iye(){if(oS)return TI;oS=1;var e=mL(),t=Tpe(),n=Hpe(),o=Dpe(),i=Bpe(),r=cye();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=o,s.prototype.has=i,s.prototype.set=r,TI=s,TI}var HI,cS;function rye(){if(cS)return HI;cS=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return HI=t,HI}var DI,iS;function sye(){if(iS)return DI;iS=1;function e(t){return this.__data__.has(t)}return DI=e,DI}var BI,rS;function dye(){if(rS)return BI;rS=1;var e=_q(),t=rye(),n=sye();function o(i){var r=-1,s=i==null?0:i.length;for(this.__data__=new e;++r<s;)this.add(i[r])}return o.prototype.add=o.prototype.push=t,o.prototype.has=n,BI=o,BI}var RI,sS;function lye(){if(sS)return RI;sS=1;function e(t,n){for(var o=-1,i=t==null?0:t.length;++o<i;)if(n(t[o],o,t))return!0;return!1}return RI=e,RI}var FI,dS;function hye(){if(dS)return FI;dS=1;function e(t,n){return t.has(n)}return FI=e,FI}var EI,lS;function xq(){if(lS)return EI;lS=1;var e=dye(),t=lye(),n=hye(),o=1,i=2;function r(s,d,l,h,u,p){var y=l&o,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,I=l&i?new e:void 0;for(p.set(s,d),p.set(d,s);++_<m;){var C=s[_],b=d[_];if(h)var w=y?h(b,C,_,d,s,p):h(C,b,_,s,d,p);if(w!==void 0){if(w)continue;v=!1;break}if(I){if(!t(d,function(L,x){if(!n(I,x)&&(C===L||u(C,L,l,h,p)))return I.push(x)})){v=!1;break}}else if(!(C===b||u(C,b,l,h,p))){v=!1;break}}return p.delete(s),p.delete(d),v}return EI=r,EI}var OI,hS;function uye(){if(hS)return OI;hS=1;var e=mt(),t=e.Uint8Array;return OI=t,OI}var UI,uS;function pye(){if(uS)return UI;uS=1;function e(t){var n=-1,o=Array(t.size);return t.forEach(function(i,r){o[++n]=[r,i]}),o}return UI=e,UI}var WI,pS;function yye(){if(pS)return WI;pS=1;function e(t){var n=-1,o=Array(t.size);return t.forEach(function(i){o[++n]=i}),o}return WI=e,WI}var GI,yS;function kye(){if(yS)return GI;yS=1;var e=Bw(),t=uye(),n=mq(),o=xq(),i=pye(),r=yye(),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]",I=e?e.prototype:void 0,C=I?I.valueOf:void 0;function b(w,L,x,S,j,$,q){switch(x){case v:if(w.byteLength!=L.byteLength||w.byteOffset!=L.byteOffset)return!1;w=w.buffer,L=L.buffer;case _:return!(w.byteLength!=L.byteLength||!$(new t(w),new t(L)));case l:case h:case y:return n(+w,+L);case u:return w.name==L.name&&w.message==L.message;case m:case f:return w==L+"";case p:var H=i;case g:var P=S&s;if(H||(H=r),w.size!=L.size&&!P)return!1;var A=q.get(w);if(A)return A==L;S|=d,q.set(w,L);var N=o(H(w),H(L),S,j,$,q);return q.delete(w),N;case M:if(C)return C.call(w)==C.call(L)}return!1}return GI=b,GI}var ZI,kS;function mye(){if(kS)return ZI;kS=1;function e(t,n){for(var o=-1,i=n.length,r=t.length;++o<i;)t[r+o]=n[o];return t}return ZI=e,ZI}var KI,mS;function Fw(){if(mS)return KI;mS=1;var e=Array.isArray;return KI=e,KI}var XI,fS;function fye(){if(fS)return XI;fS=1;var e=mye(),t=Fw();function n(o,i,r){var s=i(o);return t(o)?s:e(s,r(o))}return XI=n,XI}var YI,gS;function gye(){if(gS)return YI;gS=1;function e(t,n){for(var o=-1,i=t==null?0:t.length,r=0,s=[];++o<i;){var d=t[o];n(d,o,t)&&(s[r++]=d)}return s}return YI=e,YI}var JI,vS;function vye(){if(vS)return JI;vS=1;function e(){return[]}return JI=e,JI}var QI,MS;function Mye(){if(MS)return QI;MS=1;var e=gye(),t=vye(),n=Object.prototype,o=n.propertyIsEnumerable,i=Object.getOwnPropertySymbols,r=i?function(s){return s==null?[]:(s=Object(s),e(i(s),function(d){return o.call(s,d)}))}:t;return QI=r,QI}var eb,_S;function _ye(){if(_S)return eb;_S=1;function e(t,n){for(var o=-1,i=Array(t);++o<t;)i[o]=n(o);return i}return eb=e,eb}var tb,xS;function ML(){if(xS)return tb;xS=1;function e(t){return t!=null&&typeof t=="object"}return tb=e,tb}var ab,LS;function xye(){if(LS)return ab;LS=1;var e=fL(),t=ML(),n="[object Arguments]";function o(i){return t(i)&&e(i)==n}return ab=o,ab}var nb,IS;function Lye(){if(IS)return nb;IS=1;var e=xye(),t=ML(),n=Object.prototype,o=n.hasOwnProperty,i=n.propertyIsEnumerable,r=e(function(){return arguments}())?e:function(s){return t(s)&&o.call(s,"callee")&&!i.call(s,"callee")};return nb=r,nb}var r1={exports:{}},ob,bS;function Iye(){if(bS)return ob;bS=1;function e(){return!1}return ob=e,ob}r1.exports;var wS;function Lq(){return wS||(wS=1,function(e,t){var n=mt(),o=Iye(),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||o;e.exports=h}(r1,r1.exports)),r1.exports}var cb,CS;function bye(){if(CS)return cb;CS=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(o,i){var r=typeof o;return i=i??e,!!i&&(r=="number"||r!="symbol"&&t.test(o))&&o>-1&&o%1==0&&o<i}return cb=n,cb}var ib,NS;function Iq(){if(NS)return ib;NS=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return ib=t,ib}var rb,SS;function wye(){if(SS)return rb;SS=1;var e=fL(),t=Iq(),n=ML(),o="[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]",I="[object Float64Array]",C="[object Int8Array]",b="[object Int16Array]",w="[object Int32Array]",L="[object Uint8Array]",x="[object Uint8ClampedArray]",S="[object Uint16Array]",j="[object Uint32Array]",$={};$[v]=$[I]=$[C]=$[b]=$[w]=$[L]=$[x]=$[S]=$[j]=!0,$[o]=$[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 rb=q,rb}var sb,jS;function Cye(){if(jS)return sb;jS=1;function e(t){return function(n){return t(n)}}return sb=e,sb}var s1={exports:{}};s1.exports;var $S;function Nye(){return $S||($S=1,function(e,t){var n=fq(),o=t&&!t.nodeType&&t,i=o&&!0&&e&&!e.nodeType&&e,r=i&&i.exports===o,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}(s1,s1.exports)),s1.exports}var db,qS;function bq(){if(qS)return db;qS=1;var e=wye(),t=Cye(),n=Nye(),o=n&&n.isTypedArray,i=o?t(o):e;return db=i,db}var lb,AS;function Sye(){if(AS)return lb;AS=1;var e=_ye(),t=Lye(),n=Fw(),o=Lq(),i=bye(),r=bq(),s=Object.prototype,d=s.hasOwnProperty;function l(h,u){var p=n(h),y=!p&&t(h),m=!p&&!y&&o(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 lb=l,lb}var hb,zS;function jye(){if(zS)return hb;zS=1;var e=Object.prototype;function t(n){var o=n&&n.constructor,i=typeof o=="function"&&o.prototype||e;return n===i}return hb=t,hb}var ub,VS;function $ye(){if(VS)return ub;VS=1;function e(t,n){return function(o){return t(n(o))}}return ub=e,ub}var pb,PS;function qye(){if(PS)return pb;PS=1;var e=$ye(),t=e(Object.keys,Object);return pb=t,pb}var yb,TS;function Aye(){if(TS)return yb;TS=1;var e=jye(),t=qye(),n=Object.prototype,o=n.hasOwnProperty;function i(r){if(!e(r))return t(r);var s=[];for(var d in Object(r))o.call(r,d)&&d!="constructor"&&s.push(d);return s}return yb=i,yb}var kb,HS;function zye(){if(HS)return kb;HS=1;var e=vq(),t=Iq();function n(o){return o!=null&&t(o.length)&&!e(o)}return kb=n,kb}var mb,DS;function Vye(){if(DS)return mb;DS=1;var e=Sye(),t=Aye(),n=zye();function o(i){return n(i)?e(i):t(i)}return mb=o,mb}var fb,BS;function Pye(){if(BS)return fb;BS=1;var e=fye(),t=Mye(),n=Vye();function o(i){return e(i,n,t)}return fb=o,fb}var gb,RS;function Tye(){if(RS)return gb;RS=1;var e=Pye(),t=1,n=Object.prototype,o=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:o.call(s,_)))return!1}var v=u.get(r),I=u.get(s);if(v&&I)return v==s&&I==r;var C=!0;u.set(r,s),u.set(s,r);for(var b=p;++M<m;){_=y[M];var w=r[_],L=s[_];if(l)var x=p?l(L,w,_,s,r,u):l(w,L,_,r,s,u);if(!(x===void 0?w===L||h(w,L,d,l,u):x)){C=!1;break}b||(b=_=="constructor")}if(C&&!b){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)&&(C=!1)}return u.delete(r),u.delete(s),C}return gb=i,gb}var vb,FS;function Hye(){if(FS)return vb;FS=1;var e=Yc(),t=mt(),n=e(t,"DataView");return vb=n,vb}var Mb,ES;function Dye(){if(ES)return Mb;ES=1;var e=Yc(),t=mt(),n=e(t,"Promise");return Mb=n,Mb}var _b,OS;function Bye(){if(OS)return _b;OS=1;var e=Yc(),t=mt(),n=e(t,"Set");return _b=n,_b}var xb,US;function Rye(){if(US)return xb;US=1;var e=Yc(),t=mt(),n=e(t,"WeakMap");return xb=n,xb}var Lb,WS;function Fye(){if(WS)return Lb;WS=1;var e=Hye(),t=Rw(),n=Dye(),o=Bye(),i=Rye(),r=fL(),s=Mq(),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(o),_=s(i),v=r;return(e&&v(new e(new ArrayBuffer(1)))!=y||t&&v(new t)!=d||n&&v(n.resolve())!=h||o&&v(new o)!=u||i&&v(new i)!=p)&&(v=function(I){var C=r(I),b=C==l?I.constructor:void 0,w=b?s(b):"";if(w)switch(w){case m:return y;case g:return d;case f:return h;case M:return u;case _:return p}return C}),Lb=v,Lb}var Ib,GS;function Eye(){if(GS)return Ib;GS=1;var e=iye(),t=xq(),n=kye(),o=Tye(),i=Fye(),r=Fw(),s=Lq(),d=bq(),l=1,h="[object Arguments]",u="[object Array]",p="[object Object]",y=Object.prototype,m=y.hasOwnProperty;function g(f,M,_,v,I,C){var b=r(f),w=r(M),L=b?u:i(f),x=w?u:i(M);L=L==h?p:L,x=x==h?p:x;var S=L==p,j=x==p,$=L==x;if($&&s(f)){if(!s(M))return!1;b=!0,S=!1}if($&&!S)return C||(C=new e),b||d(f)?t(f,M,_,v,I,C):n(f,M,L,_,v,I,C);if(!(_&l)){var q=S&&m.call(f,"__wrapped__"),H=j&&m.call(M,"__wrapped__");if(q||H){var P=q?f.value():f,A=H?M.value():M;return C||(C=new e),I(P,A,_,v,C)}}return $?(C||(C=new e),o(f,M,_,v,I,C)):!1}return Ib=g,Ib}var bb,ZS;function Oye(){if(ZS)return bb;ZS=1;var e=Eye(),t=ML();function n(o,i,r,s,d){return o===i?!0:o==null||i==null||!t(o)&&!t(i)?o!==o&&i!==i:e(o,i,r,s,n,d)}return bb=n,bb}var wb,KS;function Uye(){if(KS)return wb;KS=1;var e=Oye();function t(n,o){return e(n,o)}return wb=t,wb}var Wye=Uye();const Gye=a.getDefaultExportFromCjs(Wye),Zye=({schema:e,initialData:t={},onSubmit:n,submitLabel:o,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(()=>{Gye(_.current,t)||(u(t),_.current=t)},[t]);const v=(x,S)=>{const j={...h,[x]:S};if(u(j),m[x]){const $=e.fields.find(q=>q.name===x);if($){const q=iL(S,$);y(H=>({...H,[x]:q.isValid?"":q.error}))}}},I=x=>{if(!m[x]){g(j=>({...j,[x]:!0}));const S=e.fields.find(j=>j.name===x);if(S){const j=iL(h[x],S);y($=>({...$,[x]:j.isValid?"":j.error}))}}},C=async x=>{x.preventDefault(),M(!0);const S=e.fields.reduce(($,q)=>(q.type!=="section"&&($[q.name]=!0),$),{});g(S);const j=iq(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)},b=l?ut[l]:null,w=i&&ut[i]||e.submitIcon&&ut[e.submitIcon]||null,L=e.columns&&e.columns>0?Math.floor(e.columns):12;return c.jsxs("div",{className:ne.formContainer,children:[c.jsx("div",{className:ne.headerLine,children:c.jsx("h2",{className:ne.formTitle,children:e.title})}),e.description&&c.jsx("p",{className:ne.formDescription,children:e.description}),p.__global&&c.jsx("div",{className:`alert alert-danger ${ne.globalError}`,children:p.__global}),c.jsxs("form",{onSubmit:C,children:[c.jsx("div",{className:ne.gridContainer,style:{gridTemplateColumns:`repeat(${L}, minmax(0, 1fr))`},children:e.fields.map(x=>{if(x.type==="section")return c.jsxs("div",{className:ne.sectionFull,children:[c.jsx("h5",{className:ne.sectionTitle,children:x.label}),x.help&&c.jsx("p",{className:ne.sectionHelp,children:x.help})]},x.name);const j={gridColumn:`span ${Math.max(1,Math.min(L,x.gridCol??L))}`};return c.jsxs("div",{className:ne.fieldGridItem,style:j,children:[c.jsx(kq,{field:x,value:h[x.name],onChange:$=>v(x.name,$),onBlur:()=>I(x.name),error:p[x.name],touched:m[x.name]}),x.help&&c.jsx("small",{className:ne.fieldHelp,children:x.help})]},x.name)})}),c.jsxs("div",{className:ne.formFooter,children:[c.jsx("div",{className:ne.footerLeft,children:s&&c.jsxs("button",{type:"button",className:ne.cancelLink,onClick:s,children:[b&&c.jsx(b,{size:16,className:"me-2"})," ",d]})}),c.jsx("div",{className:ne.footerRight,children:c.jsx(Xx,{type:"submit",variant:"primary",size:"md",className:ne.submitButton,disabled:f,children:f?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"spinner-border spinner-border-sm me-2",role:"status"}),"Validation..."]}):c.jsxs(c.Fragment,{children:[w&&(r==="left"||e.submitIconPosition==="left")&&c.jsx(w,{size:16,className:"me-2"}),o||e.submitText||"Valider",w&&(r==="right"||e.submitIconPosition==="right")&&c.jsx(w,{size:16,className:"ms-2"})]})})})]})]})]})};function Kye(e){return{title:e._formTitle||"Formulaire",description:e._formDescription,fields:e._fieldMetadata||[],submitText:e._submitText||"Valider"}}const Xye="_container_1gljv_85",Yye="_tableWrapper_1gljv_111",Jye="_tableControls_1gljv_117",Qye="_controlsRight_1gljv_128",e4e="_limitedRows_1gljv_151",t4e="_table_1gljv_111",a4e="_headerCell_1gljv_206",n4e="_headerContent_1gljv_220",o4e="_headerWords_1gljv_229",c4e="_headerWord_1gljv_229",i4e="_cellContent_1gljv_276",r4e="_alignLeft_1gljv_286",s4e="_alignCenter_1gljv_290",d4e="_alignRight_1gljv_294",l4e="_tableCell_1gljv_298",h4e="_tableRow_1gljv_308",u4e="_emptyRow_1gljv_385",p4e="_toggleFiltersButton_1gljv_393",y4e="_toggleSortButton_1gljv_394",k4e="_buttonTextCompact_1gljv_415",m4e="_uppercaseSmall_1gljv_450",f4e="_filtersPanel_1gljv_463",g4e="_filtersPanelInline_1gljv_481",v4e="_filtersPanelHorizontal_1gljv_492",M4e="_filtersRow_1gljv_492",_4e="_filtersActionsHorizontal_1gljv_525",x4e="_filterItemInline_1gljv_542",L4e="_filterLabel_1gljv_571",I4e="_filterInput_1gljv_576",b4e="_filterSelect_1gljv_577",w4e="_operatorSelect_1gljv_578",C4e="_operatorInput_1gljv_579",N4e="_activeFilterTag_1gljv_597",S4e="_actionsGroup_1gljv_609",j4e="_applyButton_1gljv_615",$4e="_cancelButton_1gljv_625",q4e="_columnSorterContainer_1gljv_649",A4e="_sorterControls_1gljv_654",z4e="_sortDropdownWrapper_1gljv_659",V4e="_sortDropdown_1gljv_659",P4e="_sortDropdownHeader_1gljv_679",T4e="_closeButton_1gljv_688",H4e="_sortDropdownContent_1gljv_703",D4e="_sortDropdownItem_1gljv_709",B4e="_sortDirectionButtons_1gljv_734",R4e="_sortDirectionButton_1gljv_734",F4e="_activeSort_1gljv_757",E4e="_sortActions_1gljv_764",O4e="_paginationButton_1gljv_842",U4e="_pageSizeSelect_1gljv_844",W4e="_topPagination_1gljv_853",G4e="_paginationContainer_1gljv_861",Z4e="_leftGroup_1gljv_874",K4e="_pageSizeControls_1gljv_882",X4e="_paginationInfo_1gljv_908",Y4e="_paginationControls_1gljv_916",J4e="_disabledButton_1gljv_947",Q4e="_activeButton_1gljv_952",e5e="_navigationButton_1gljv_962",t5e="_operatorFilterContainer_1gljv_1010",a5e="_rangeSeparator_1gljv_1016",n5e="_activeFiltersSection_1gljv_1179",o5e="_activeFiltersRow_1gljv_1184",c5e="_activeFiltersList_1gljv_1192",i5e="_clearAllButton_1gljv_1200",r5e="_removeFilterButton_1gljv_1221",s5e="_sortIndicator_1gljv_1272",d5e="_active_1gljv_349",l5e="_clearSortButton_1gljv_1371",h5e="_loaderSpinner_1gljv_2743",u5e="_loaderSpinnerSmall_1gljv_2755",p5e="_paginationLoading_1gljv_2772",y5e="_loadingButton_1gljv_2780",k5e="_loadingIndicator_1gljv_2791",z={container:Xye,tableWrapper:Yye,tableControls:Jye,controlsRight:Qye,limitedRows:e4e,table:t4e,headerCell:a4e,headerContent:n4e,headerWords:o4e,headerWord:c4e,cellContent:i4e,alignLeft:r4e,alignCenter:s4e,alignRight:d4e,tableCell:l4e,tableRow:h4e,emptyRow:u4e,toggleFiltersButton:p4e,toggleSortButton:y4e,buttonTextCompact:k4e,uppercaseSmall:m4e,filtersPanel:f4e,filtersPanelInline:g4e,filtersPanelHorizontal:v4e,filtersRow:M4e,filtersActionsHorizontal:_4e,filterItemInline:x4e,filterLabel:L4e,filterInput:I4e,filterSelect:b4e,operatorSelect:w4e,operatorInput:C4e,activeFilterTag:N4e,actionsGroup:S4e,applyButton:j4e,cancelButton:$4e,columnSorterContainer:q4e,sorterControls:A4e,sortDropdownWrapper:z4e,sortDropdown:V4e,sortDropdownHeader:P4e,closeButton:T4e,sortDropdownContent:H4e,sortDropdownItem:D4e,sortDirectionButtons:B4e,sortDirectionButton:R4e,activeSort:F4e,sortActions:E4e,paginationButton:O4e,pageSizeSelect:U4e,topPagination:W4e,paginationContainer:G4e,leftGroup:Z4e,pageSizeControls:K4e,paginationInfo:X4e,paginationControls:Y4e,disabledButton:J4e,activeButton:Q4e,navigationButton:e5e,operatorFilterContainer:t5e,rangeSeparator:a5e,activeFiltersSection:n5e,activeFiltersRow:o5e,activeFiltersList:c5e,clearAllButton:i5e,removeFilterButton:r5e,sortIndicator:s5e,active:d5e,clearSortButton:l5e,loaderSpinner:h5e,loaderSpinnerSmall:u5e,paginationLoading:p5e,loadingButton:y5e,loadingIndicator:k5e},m5e=({config:e,value:t,onChange:n,disabled:o})=>c.jsxs("select",{value:t===""?"":String(t),onChange:i=>n(i.target.value===""?"":i.target.value==="true"),disabled:o,className:z.filterSelect,children:[c.jsx("option",{value:"",children:`Filtrer ${e.label}...`}),c.jsx("option",{value:"true",children:"Oui"}),c.jsx("option",{value:"false",children:"Non"})]}),f5e=({config:e,value:t,onChange:n,disabled:o})=>c.jsx("input",{type:"date",value:t||"",onChange:i=>n(i.target.value),placeholder:`Filtrer ${e.label}...`,disabled:o,className:z.filterInput}),g5e=({config:e,value:t,onChange:n,disabled:o})=>{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 c.jsx("select",{multiple:!0,value:t.map(String),onChange:s,disabled:o,className:z.filterMultiSelect,children:i.map((d,l)=>c.jsx("option",{value:String(d.value),children:d.label},l))})},XS=({config:e,value:t,onChange:n,disabled:o})=>{const[i,r]=k.useState(t||""),s=d=>{const l=d.target.value===""?"":Number(d.target.value);r(l),n(l)};return c.jsx("input",{type:"number",value:i,onChange:s,placeholder:e.placeholder||`Filtrer ${e.label}...`,disabled:o,className:z.filterInput})},v5e=({config:e,value:t,onChange:n,disabled:o=!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?c.jsx("div",{children:"Chargement..."}):c.jsxs("select",{value:String(t||""),onChange:l,disabled:o,className:z.filterInput,children:[c.jsx("option",{value:"",children:"Select..."}),i.map(h=>c.jsx("option",{value:h.value,children:h.label},h.value))]})},M5e=({config:e,value:t,onChange:n,disabled:o=!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 c.jsx("input",{type:"text",value:i,onChange:s,placeholder:e.placeholder||`Filtrer ${e.label}...`,disabled:o,className:z.filterInput})},_5e=({config:e,value:t,onChange:n,disabled:o=!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 c.jsxs("div",{className:z.operatorFilterContainer,children:[c.jsxs("select",{value:i,onChange:l,disabled:o,className:z.operatorSelect,children:[c.jsx("option",{value:"",children:"Sélectionner un opérateur"}),e.operators.map(u=>c.jsx("option",{value:String(u.value),children:u.label},String(u.value)))]}),c.jsx("input",{type:"text",value:s,onChange:h,placeholder:"Valeur",disabled:o||!i,className:z.operatorInput})]})},x5e=({value:e,onChange:t,disabled:n})=>{const o=e||{},i=s=>{t({...o,start:s.target.value})},r=s=>{t({...o,end:s.target.value})};return c.jsxs("div",{className:z.dateRangeContainer,children:[c.jsx("input",{type:"date",value:o.start||"",onChange:i,disabled:n,className:z.filterInput}),c.jsx("span",{className:z.rangeSeparator,children:"→"}),c.jsx("input",{type:"date",value:o.end||"",onChange:r,disabled:n,className:z.filterInput})]})},L5e=({config:e,value:t,onChange:n,disabled:o})=>{switch(e.type){case"text":case"search":return c.jsx(M5e,{config:e,value:t,onChange:n,disabled:o});case"number":return c.jsx(XS,{config:e,value:t,onChange:n,disabled:o});case"range":return c.jsx(XS,{config:e,value:t,onChange:n,disabled:o});case"select":return c.jsx(v5e,{config:e,value:t,onChange:n,disabled:o});case"operator":return c.jsx(_5e,{config:e,value:t,onChange:n,disabled:o});case"multiselect":return c.jsx(g5e,{config:e,value:t,onChange:n,disabled:o});case"date":return c.jsx(f5e,{config:e,value:t,onChange:n,disabled:o});case"daterange":return c.jsx(x5e,{config:e,value:t??{start:"",end:""},onChange:n,disabled:o});case"boolean":return c.jsx(m5e,{config:e,value:t,onChange:n,disabled:o});default:return c.jsxs("div",{children:["Type de filtre non supporté: ",e.type]})}},wq=({filters:e,externalFilters:t=[],onFiltersChange:n,onApply:o,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(b=>b.id===M);if(!v)continue;let I=_;try{typeof _=="function"&&(I=await _(f)),typeof v.executeOnApply=="function"&&(I=await v.executeOnApply(I,f))}catch{continue}if(v.type==="daterange"){const b=I?.start??"",w=I?.end??"",L=typeof b=="string"?b.trim()==="":!b,x=typeof w=="string"?w.trim()==="":!w;if(L&&x)continue}I==null||typeof I=="string"&&I.trim()===""||Array.isArray(I)&&I.length===0||typeof I=="object"&&!Array.isArray(I)&&Object.keys(I).length===0||g.push({id:M,type:v.type,value:I,label:v.label})}return i?n?.(g):(s(g),o?.(g)),g},[d,e,i,n,o]),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([]),o?.([]))},[e,i,n,o]);return{appliedFilters:h,tempFilters:d,updateFilter:u,applyFilters:p,clearFilter:y,clearAllFilters:m}},I5e=(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(o=>String(o)).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 o=n;if(!o.start||!o.end)return!1;const i=o.start,r=o.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(o){return console.error("Error processing daterange filter:",o),!1}case"operator":if(typeof n=="object"&&n!==null){const o=n;if(!("operator"in o)||!("value"in o))return!1;const{operator:i,value:r}=o,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 Cq(e,t,n="",o={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 I5e(v,_)}catch(v){return console.error("Error applying filter:",v),!1}}))),f},[e,t,l,s]),u=k.useMemo(()=>{if(!o?.key)return h;const f=o.key;return[...h].sort((M,_)=>{const v=M.data[f],I=_.data[f];if(v==null)return 1;if(I==null)return-1;if(typeof v=="number"&&typeof I=="number")return o.direction==="desc"?I-v:v-I;if(v instanceof Date&&I instanceof Date){const b=v.getTime()-I.getTime();return o.direction==="desc"?-b:b}const C=String(v).localeCompare(String(I),void 0,{numeric:!0,sensitivity:"base"});return o.direction==="desc"?-C:C})},[h,o]),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 Nq=({value:e})=>e,Sq=({value:e})=>k.createElement("a",{href:`mailto:${e}`,className:"email-link"},e),jq=({value:e})=>k.createElement("a",{href:String(e),target:"_blank",rel:"noopener noreferrer",className:"text-link"},e),$q=({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",o=typeof e=="object"?e.text:e,i=t[n]||t.default;return k.createElement("span",{className:`badge ${i}`},o)},qq=({value:e})=>{try{return new Date(e).toLocaleDateString()}catch{return String(e)}},Aq=({value:e})=>k.createElement("span",{className:"number-value"},Number(e).toLocaleString()),zq=({value:e})=>k.createElement("span",{className:"currency-value"},new Intl.NumberFormat("fr-FR",{style:"currency",currency:"EUR"}).format(Number(e))),Vq=({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"})),aw={renderers:{text:Nq,email:Sq,link:jq,badge:$q,date:qq,number:Aq,currency:zq,image:Vq},icons:{sortAsc:k.createElement(Ic,{className:"sort-icon active",size:14}),sortDesc:k.createElement(Nt,{className:"sort-icon active",size:14}),sortDefault:k.createElement(Rc,{className:"sort-icon",size:14})}},b5e=(e,t)=>{aw.renderers[e]&&console.warn(`Le renderer "${e}" existe déjà et sera écrasé.`),aw.renderers[e]=t},w5e=({filters:e,externalFilters:t=[],onFiltersChange:n,onApply:o,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:I,tempFilters:C,updateFilter:b,applyFilters:w,clearAllFilters:L}=wq({filters:e,externalFilters:t,onFiltersChange:n,onApply:o,isControlled:i}),x=k.useRef(null),S=k.useRef(null);k.useEffect(()=>{if(v&&x.current){const A=x.current.getBoundingClientRect().height;h?.(A)}else h?.(0)},[v,e,C,h]);const j=()=>{typeof s=="boolean"?d?.(!s):_(A=>{const N=!A;return d?.(N),N})},$=()=>e.map(A=>{const N=C?.[A.id];return N==null||typeof N=="string"&&N.trim()===""?null:{id:A.id,label:A.label,value:N}}).filter(Boolean),q=async()=>{let A;try{A=await w()}catch{A=void 0}let N=[];A&&Array.isArray(A)&&A.length>0?N=A:I&&I.length>0?N=I:N=$(),n?.(N),o?.(N)},H=()=>{d?.(!1),typeof s!="boolean"&&_(!1)},P=()=>{L(),n?.([]),o?.([])};return k.useEffect(()=>{const A=V=>{v&&S.current&&(S.current.contains(V.target)||(d?.(!1),typeof s!="boolean"&&_(!1)))},N=V=>{V.key==="Escape"&&v&&(d?.(!1),typeof s!="boolean"&&_(!1))};return v&&(document.addEventListener("pointerdown",A),document.addEventListener("keydown",N)),()=>{document.removeEventListener("pointerdown",A),document.removeEventListener("keydown",N)}},[v,s,d]),c.jsxs("div",{className:z.advancedFiltersContainer,ref:S,children:[c.jsxs("button",{className:`${z.toggleFiltersButton} ${I.length>0?z.active:""} ${v?z.toggleFiltersButtonOpen:""} ${f?z.loadingButton:""}`,onClick:j,"aria-expanded":v,"aria-controls":"advanced-filters-panel",type:"button",disabled:f,children:[f?c.jsx("span",{className:z.loaderSpinnerSmall}):c.jsx(xt,{size:14}),c.jsx("span",{className:z.buttonTextCompact,children:u}),I.length>0&&!f&&c.jsx("span",{className:z.filterCountBadge,"aria-hidden":!0,children:I.length}),f&&c.jsx("span",{className:z.loadingIndicator,"aria-hidden":!0,children:"Chargement..."})]}),v&&c.jsxs("div",{id:"advanced-filters-panel",ref:x,className:`${z.filtersPanel} ${l==="top"?`${z.filtersPanelInline} ${z.filtersPanelHorizontal}`:""}`,role:"region","aria-label":"Panneau de filtres avancés",children:[c.jsx("div",{className:z.filtersRow,children:e.map(A=>c.jsxs("div",{className:`${z.filterItem} ${z.filterItemInline}`,children:[c.jsxs("label",{className:z.filterLabel,children:[A.label,A.required&&c.jsx("span",{className:z.required,children:"*"})]}),c.jsx(L5e,{config:A,value:C[A.id],onChange:N=>b(A.id,N),disabled:A.disabled})]},A.id))}),c.jsxs("div",{className:z.filtersActionsHorizontal,children:[c.jsx("div",{className:z.activeFiltersSection,children:I.length>0&&c.jsxs("div",{className:z.activeFiltersRow,children:[c.jsx("span",{className:z.activeLabelCompact,children:"Actifs :"}),c.jsx("div",{className:z.activeFiltersList,children:I.map(A=>c.jsxs("div",{className:z.activeFilterTag,children:[A.label??A.id,c.jsx("button",{className:z.removeFilterButton,onClick:()=>b(A.id,void 0),"aria-label":`Supprimer ${A.id}`,type:"button",children:"×"})]},A.id))}),c.jsxs("button",{className:z.clearAllButton,onClick:P,type:"button",children:[c.jsx(Ze,{size:12})," ",m]})]})}),c.jsxs("div",{className:z.actionsGroup,children:[c.jsx("button",{className:z.cancelButton,onClick:H,type:"button",disabled:f,children:y}),c.jsx("button",{className:`${z.applyButton} ${f?z.loadingButton:""}`,onClick:q,type:"button",disabled:g||f,"aria-disabled":g||f,children:f?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:z.loaderSpinnerSmall}),c.jsx("span",{children:"Chargement..."})]}):p})]})]})]})]})},YS=e=>{const t=e.replace(/[^A-Za-zÀ-ÖØ-öø-ÿ]/g,"");return t.length>0&&t===t.toUpperCase()},C5e=({columns:e,sortConfig:t,onSort:n,label:o="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]),c.jsx("div",{className:z.columnSorterContainer,ref:l,children:c.jsx("div",{className:z.sorterControls,children:d.length>0&&c.jsxs("div",{className:z.sortDropdownWrapper,ref:l,children:[c.jsxs("button",{className:`${z.toggleSortButton} ${r?z.toggleSortButtonOpen:""} ${h?z.active:""} ${i?z.loadingButton:""}`,onClick:y,"aria-expanded":r,"aria-haspopup":"true",type:"button",disabled:i,children:[i?c.jsx("span",{className:z.loaderSpinnerSmall}):c.jsx(Rc,{size:14}),c.jsx("span",{className:`${z.buttonTextCompact} ${YS(o)?z.uppercaseSmall:""}`,children:o}),h&&!i&&c.jsx("div",{className:z.sortIndicator,children:t?.direction==="asc"?c.jsx(Ic,{size:12}):c.jsx(Nt,{size:12})})]}),r&&c.jsxs("div",{className:`${z.sortDropdown} ${z.sortDropdownInline}`,role:"menu",children:[c.jsxs("div",{className:z.sortDropdownHeader,children:[c.jsx("span",{children:"Trier par:"}),c.jsx("button",{className:z.closeButton,onClick:m,"aria-label":"Fermer",type:"button",children:c.jsx(Ze,{size:16})})]}),c.jsx("div",{className:z.sortDropdownContent,children:d.map(g=>{const f=String(g.label??g.id),M=YS(f);return c.jsxs("div",{className:z.sortDropdownItem,role:"menuitem",tabIndex:0,onKeyDown:_=>{_.key==="Enter"&&u(g.id,"asc")},children:[c.jsx("span",{className:`${z.columnSorterLabel} ${M?z.uppercaseSmall:""}`,title:f,"aria-label":f,children:f}),c.jsxs("div",{className:z.sortDirectionButtons,children:[c.jsx("button",{className:`${z.sortDirectionButton} ${t?.key===g.id&&t?.direction==="asc"?z.activeSort:""}`,onClick:()=>u(g.id,"asc"),title:"Trier par ordre croissant",type:"button",children:c.jsx(Ic,{size:12})}),c.jsx("button",{className:`${z.sortDirectionButton} ${t?.key===g.id&&t?.direction==="desc"?z.activeSort:""}`,onClick:()=>u(g.id,"desc"),title:"Trier par ordre décroissant",type:"button",children:c.jsx(Nt,{size:12})})]})]},g.id)})}),h&&c.jsx("div",{className:z.sortActions,children:c.jsxs("button",{className:z.clearSortButton,onClick:p,type:"button",children:[c.jsx(_t,{size:14}),c.jsx("span",{children:"Annuler le tri"})]})})]})]})})})},N5e=({currentPage:e,totalPages:t,pageSize:n,totalItems:o,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=o>0?(h-1)*n+1:0,m=o>0?Math.min(h*n,o):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 I=_;I<=v;I++)f.push(I);return f};return c.jsxs("div",{className:z.paginationContainer,role:"navigation","aria-label":"Pagination",children:[c.jsx("div",{className:z.leftGroup,children:s&&c.jsx("div",{className:z.pageSizeControls,children:c.jsx("select",{value:n,onChange:f=>s(Number(f.target.value)),className:z.pageSizeSelect,"aria-label":"Taille de page",disabled:d,children:[10,20,30].map(f=>c.jsx("option",{value:f,children:f},f))})})}),c.jsx("div",{className:z.paginationInfo,"aria-live":"polite",children:d?c.jsxs("span",{className:z.paginationLoading,children:[c.jsx("span",{className:z.loaderSpinner}),c.jsx("span",{children:"Chargement..."})]}):`${y}-${m} ${i}`}),c.jsxs("div",{className:z.paginationControls,children:[c.jsx("button",{onClick:u,disabled:h===1||d,className:`${z.paginationButton} ${z.navigationButton} ${h===1?z.disabledButton:""} ${d?z.loadingButton:""}`,"aria-label":"Page précédente",children:d&&h>1?c.jsx("span",{className:z.loaderSpinnerSmall}):"«"}),g().map(f=>c.jsx("button",{onClick:()=>r(f),disabled:d,"aria-current":h===f?"page":void 0,className:`${z.paginationButton} ${h===f?z.activeButton:""} ${d?z.loadingButton:""}`,children:d&&h===f?c.jsx("span",{className:z.loaderSpinnerSmall}):f},f)),c.jsx("button",{onClick:p,disabled:d||h>=l,className:`${z.paginationButton} ${z.navigationButton} ${d?z.loadingButton:""} ${h>=l?z.disabledButton:""}`,"aria-label":"Page suivante",children:d?c.jsx("span",{className:z.loaderSpinnerSmall}):"»"})]})]})},S5e=(e,t)=>{if(!e)return"";if(t)return e;const n=String(e).trim();if(!n)return n;const o=n.toLowerCase();return o.charAt(0).toUpperCase()+o.slice(1)},j5e=e=>{if(!e)return!1;const t=e.trim().split(/\s+/);return e.length>18||t.length>2},$5e=({columns:e})=>c.jsx("thead",{className:z.tableHeader,children:c.jsx("tr",{children:e.map((t,n)=>{const o=t.align==="right"?z.alignRight:t.align==="left"?z.alignLeft:z.alignCenter,i=t.preserveHeaderCase===!0,r=S5e(String(t.label??""),i),s=j5e(r),d=s?r.split(/\s+/):[];return c.jsx("th",{className:`${z.headerCell} ${o}`,style:{width:t.width??void 0},"data-preserve":i?"true":"false",children:c.jsx("div",{className:z.headerContent,children:s?c.jsx("div",{className:z.headerWords,children:d.map((l,h)=>c.jsx("span",{className:z.headerWord,children:l},h))}):c.jsx("span",{children:r})})},t.id??`col-${n}`)})})}),q5e=({value:e,row:t,column:n})=>{const o=n.align==="right"?z.alignRight:n.align==="left"?z.alignLeft:z.alignCenter,i=typeof n.render=="function"?n.render(e,t):e==null?"":String(e);return c.jsx("td",{className:`${z.tableCell} ${o}`,style:{width:n.width??void 0},children:c.jsx("div",{className:z.cellContent,children:i})})},A5e=({row:e,rowId:t,columns:n,onRowClick:o,index:i,getRowStyle:r})=>{const s=r?r(e):{},{backgroundColor:d,accentColor:l,...h}=s||{},u={backgroundColor:d,...h,"--row-accent":l??"transparent"};return c.jsx("tr",{className:`${z.tableRow} ${o?z.clickableRow:""}`,onClick:()=>o?.(e,i),style:u,children:n.map(p=>c.jsx(q5e,{value:e[p.id],row:e,column:p},`${t}-${p.id}`))})},z5e=({data:e,columns:t,onRowClick:n,startIndex:o,searchTerm:i,getRowStyle:r})=>e.length===0?c.jsx("tbody",{children:c.jsx("tr",{children:c.jsx("td",{colSpan:t.length,className:z.emptyRow,children:i?"Aucun résultat trouvé":"Aucune donnée disponible"})})}):c.jsx("tbody",{children:e.map((s,d)=>c.jsx(A5e,{row:s.data,rowId:s.id,columns:t,onRowClick:n,index:o+d-1,getRowStyle:r},s.id))}),Pq=({columns:e=[],data:t=[],pagination:n={pageSize:10,currentPage:1},onRowClick:o,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:I,sortLabel:C="Sort",applyLabel:b="Apply",cancelLabel:w="Cancel",clearLabel:L="Clear",applyDisabled:x=!1,paginationLoading:S=!1,filtersLoading:j=!1,sortLoading:$=!1,totalCount:q=null})=>{const[H,P]=k.useState({key:null,direction:"asc"}),[A,N]=k.useState(n.currentPage??1),[V,T]=k.useState(n.pageSize??10),[R,B]=k.useState(!1),F=k.useRef(null),[J,G]=k.useState([]),le=p?d:J,ve=p?[]:J;k.useEffect(()=>{const Y=n.currentPage??1,D1=n.pageSize??10;Y!==A&&N(Y),D1!==V&&T(D1)},[n.currentPage,n.pageSize]);const{paginatedData:ye,sortedData:he,totalPages:K,startIndex:X}=Cq(t,e,i,H,A,V,ve),re=he.length,Ie=typeof q=="number"&&q>=0?q:re;let ke=K;typeof q=="number"&&q>=0&&(ke=Math.max(1,Math.ceil(q/V)));const we=re>10;k.useEffect(()=>{const Y=Math.max(1,Math.floor(ke));A>Y&&N(Y),A<1&&N(1)},[ke]);const se=Y=>{p||G(Y),l?.(Y),N(1),M?.(1)},Me=Y=>{p||G(Y),h?.(Y),N(1),M?.(1),F.current&&F.current.style.setProperty("--filters-panel-height","0px")},Ve=Y=>{M?.(Y),N(Y)},je=Y=>{T(Y),N(1),f?.(Y),M?.(1)},ue=Y=>{F.current&&F.current.style.setProperty("--filters-panel-height",`${Math.round(Y)}px`)},Ce=Y=>{P(Y),u?.(Y)},rt=Y=>{B(Y),!Y&&F.current&&F.current.style.setProperty("--filters-panel-height","0px")};k.useEffect(()=>{(le?.length??0)>0&&B(!0)},[le]),k.useEffect(()=>{s.length>0&&le.length>0&&B(!0)},[s.length,le.length]);const ce=(le?.length??0)>0&&I?I:v;return c.jsxs("div",{ref:F,className:`${z.container} ${r} ${R?z.filtersOpen:""}`,style:{background:g,"--row-height":"48px","--header-height":"56px"},children:[c.jsx("div",{className:z.tableControls,children:c.jsxs("div",{className:z.controlsRight,children:[c.jsx(C5e,{columns:e,onSort:Ce,label:C,sortConfig:H,loading:$}),s.length>0&&c.jsx(w5e,{filters:s,externalFilters:le,onFiltersChange:se,onApply:Me,isControlled:p,debounceTimeout:y,expanded:R,onToggle:rt,panelPlacement:"top",onPanelHeightChange:ue,label:ce,applyLabel:b,cancelLabel:w,clearLabel:L,applyDisabled:x,loading:j})]})}),c.jsx("div",{className:z.topPagination,children:c.jsx(N5e,{currentPage:A,totalPages:ke,pageSize:V,totalItems:Ie,itemLabel:_,onPageChange:Ve,onPageSizeChange:je,loading:S})}),c.jsx("div",{className:`${z.tableWrapper} ${we?z.limitedRows:""}`,"data-table-wrapper":!0,children:c.jsxs("table",{className:z.table,children:[c.jsx($5e,{columns:e}),c.jsx(z5e,{data:ye,columns:e,onRowClick:o,startIndex:X,getRowStyle:m,searchTerm:i})]})})]})};function V5e(e){const{pagination:t,totalCount:n,onPageChange:o,...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||o?.(p))};return c.jsx(Pq,{...i,pagination:{pageSize:r,currentPage:s},totalCount:n,onPageChange:u})}const P5e="_mpRoot_31595_1",T5e="_mpHeader_31595_22",H5e="_mpTitle_31595_31",D5e="_mpList_31595_35",B5e="_mpVertical_31595_41",R5e="_mpHorizontal_31595_46",F5e="_mpItem_31595_55",E5e="_mpClickable_31595_95",O5e="_mpLeft_31595_117",U5e="_mpIcon_31595_125",W5e="_mpMeta_31595_140",G5e="_mpLabel_31595_145",Z5e="_mpDate_31595_154",K5e="_mpRight_31595_160",X5e="_mpValue_31595_168",Y5e="_mpHint_31595_176",J5e="_mpBadge_31595_180",Q5e="_mpBadgeTop_31595_199",eke="_mpBadgeSub_31595_206",tke="_mpBadgeSmall_31595_213",ake="_mpPill_31595_229",nke="_mpRounded_31595_232",oke="_mpCompact_31595_236",cke="_compactItemWrapper_31595_252",ike="_mpSummaryRoot_31595_265",rke="_mpSummaryInner_31595_269",ske="_mpSummaryFlex_31595_284",dke="_mpSummaryCardWrapperHorizontal_31595_292",lke="_mpSummaryCardWrapper_31595_292",hke="_mpSummaryCardHorizontal_31595_303",uke="_mpSummaryCard_31595_292",pke="_mpSummaryValue_31595_321",yke="_mpSummaryLabel_31595_327",kke="_mpSummaryBadge_31595_338",mke="_mpSummaryBadgeSub_31595_357",fke="_mpEmpty_31595_365",gke="_mpSummaryVertical_31595_372",vke="_mpIconSquare_31595_380",U={mpRoot:P5e,mpHeader:T5e,mpTitle:H5e,mpList:D5e,mpVertical:B5e,mpHorizontal:R5e,mpItem:F5e,mpClickable:E5e,mpLeft:O5e,mpIcon:U5e,mpMeta:W5e,mpLabel:G5e,mpDate:Z5e,mpRight:K5e,mpValue:X5e,mpHint:Y5e,mpBadge:J5e,mpBadgeTop:Q5e,mpBadgeSub:eke,mpBadgeSmall:tke,mpPill:ake,mpRounded:nke,mpCompact:oke,compactItemWrapper:cke,mpSummaryRoot:ike,mpSummaryInner:rke,mpSummaryFlex:ske,mpSummaryCardWrapperHorizontal:dke,mpSummaryCardWrapper:lke,mpSummaryCardHorizontal:hke,mpSummaryCard:uke,mpSummaryValue:pke,mpSummaryLabel:yke,mpSummaryBadge:kke,mpSummaryBadgeSub:mke,mpEmpty:fke,mpSummaryVertical:gke,mpIconSquare:vke},Ct=(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 o=n.replace("#","").toLowerCase();if(o.length===3&&(o=o.split("").map(d=>d+d).join("")),!/^[0-9a-f]{6}$/i.test(o))return`rgba(124, 58, 237, ${t})`;const i=parseInt(o.slice(0,2),16),r=parseInt(o.slice(2,4),16),s=parseInt(o.slice(4,6),16);return`rgba(${i}, ${r}, ${s}, ${t})`},Mke=({item:e,shape:t,onItemClick:n,color:o,renderItem:i})=>{const r=k.useCallback(()=>{n?.(e)},[n,e]),s=[U.mpItem,t==="pill"?U.mpPill:U.mpRounded,n?U.mpClickable:""].filter(Boolean).join(" ");if(i)return c.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 c.jsxs(d,{...l,children:[c.jsxs("div",{className:U.mpLeft,children:[h?c.jsx("div",{className:U.mpIconSquare,style:{background:u??Ct(p??o??"#7c3aed",1),border:`1px solid ${Ct(p??o??"#7c3aed",.18)}`,color:p??"#ffffff"},children:k.createElement(h,{size:20,color:p??"#fff",strokeWidth:1.8})}):e.icon?c.jsx("div",{className:U.mpIcon,children:e.icon}):null,c.jsxs("div",{className:U.mpMeta,children:[c.jsx("div",{className:U.mpLabel,children:e.label}),e.subLabel&&c.jsx("div",{className:U.mpDate,children:e.subLabel}),e.date&&c.jsx("div",{className:U.mpDate,children:e.date})]})]}),c.jsxs("div",{className:U.mpRight,children:[c.jsx("div",{className:U.mpValue,style:{color:e.valueColor??o??void 0},children:e.value}),e.badge?c.jsxs("div",{className:[U.mpBadge,e.badge.small?U.mpBadgeSmall:""].join(" "),style:{backgroundColor:e.badge.bg??Ct(e.badge.color||o||"#7c3aed",.12),borderColor:e.badge.bg?"transparent":Ct(e.badge.color||o||"#7c3aed",.18),color:e.badge.color??e.badge.textColor??"#0f172a",fontWeight:600},children:[c.jsx("div",{className:U.mpBadgeTop,children:e.badge.text}),e.badge.subText&&c.jsx("div",{className:U.mpBadgeSub,children:e.badge.subText})]}):e.hint?c.jsx("div",{className:U.mpHint,children:e.hint}):null]})]})},_ke=k.memo(Mke),JS=({title:e,right:t})=>!e&&!t?null:c.jsxs("div",{className:U.mpHeader,children:[c.jsx("div",{className:U.mpTitle,children:e}),c.jsx("div",{children:t})]}),QS=(e,t=1)=>{try{return Ct(e,t)}catch{return`rgba(124, 58, 237, ${t})`}},xke=({item:e})=>c.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:[c.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[c.jsx("div",{style:{fontSize:13,fontWeight:700,color:"#475569"},children:e.label}),c.jsx("div",{style:{fontSize:26,fontWeight:900,color:"#0f172a",lineHeight:1},children:e.value})]}),c.jsx("div",{title:String(e.label),style:{display:"flex",alignItems:"center",justifyContent:"center",width:48,height:48,borderRadius:10,background:e.iconSquareBg??QS("#7c3aed",.12),border:`1px solid ${QS(e.iconColor??"#7c3aed",.12)}`,boxShadow:"none"},children:e.iconComponent?k.createElement(e.iconComponent,{size:18,color:e.iconColor??"#7c3aed",strokeWidth:1.6}):null})]}),Lke=({item:e,bg:t,onClick:n,width:o,height:i,extraStyle:r})=>c.jsxs("div",{className:U.mpSummaryCard,style:{background:t,width:o??void 0,height:i??void 0,...r??{}},role:n?"button":"group",tabIndex:n?0:-1,onClick:()=>n?.(e),children:[c.jsx("div",{className:U.mpSummaryLabel,children:e.label}),c.jsx("div",{className:U.mpSummaryValue,style:{color:e.valueColor??"#2a24deff"},children:e.value}),e.badge&&c.jsxs("div",{className:U.mpSummaryBadge,children:[e.badge.text,e.badge.subText&&c.jsx("div",{className:U.mpSummaryBadgeSub,children:e.badge.subText})]})]}),ej=(e,t=1)=>{try{return Ct(e,t)}catch{return`rgba(124, 58, 237, ${t})`}},tj=e=>c.jsxs("div",{style:{display:"grid",gridTemplateRows:"auto 1fr",width:"100%",gap:8,alignItems:"center",boxSizing:"border-box",minWidth:0},children:[c.jsxs("div",{style:{display:"flex",justifyContent:"space-between-left",alignItems:"baseline",gap:10,width:"100%"},children:[c.jsx("div",{style:{fontWeight:700,fontSize:"clamp(14px, 1.2vw, 16px)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:e.label}),e.subLabel?c.jsx("div",{style:{fontSize:"clamp(13px, 1.1vw, 15px)",fontWeight:600,whiteSpace:"nowrap"},children:e.subLabel}):null]}),c.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:15,width:"100%"},children:[c.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?c.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"8px 12px",borderRadius:10,backgroundColor:e.badge.bg?e.badge.bg:ej("#7c3aed",.08),border:`1px solid ${e.badge.bg?e.badge.bg:ej("#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:[c.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?c.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]})]}),aj=(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}},Ike=e=>{switch(e){case"image":return t=>k.createElement(xke,{item:t});case"pertinence":return t=>k.createElement(Lke,{item:t});case"alternateHorizontal":return t=>aj(tj,t);case"compact":return t=>aj(tj,t);case"summary":return;case"default":default:return}},Tq=({item:e,orientation:t,bg:n,border:o,valueColor:i,onClick:r,width:s,height:d,extraStyle:l})=>{const u=t==="horizontal"?U.mpSummaryCardHorizontal:U.mpSummaryCard;return c.jsxs("div",{className:u,style:{background:n,border:`1px solid ${o}`,width:s??void 0,height:d??void 0,...l??{}},role:r?"button":"group",tabIndex:r?0:-1,onClick:()=>r?.(e),children:[e.badge&&c.jsxs("div",{className:U.mpSummaryBadge,children:[e.badge.text,e.badge.subText&&c.jsx("div",{className:U.mpSummaryBadgeSub,children:e.badge.subText})]}),c.jsx("div",{className:U.mpSummaryValue,style:{color:i},children:e.value}),c.jsx("div",{className:U.mpSummaryLabel,children:e.label})]})},bke=["transparent","transparent","transparent","transparent"],wke=["transparent","transparent","transparent","transparent"],Cke=["#059669","#2563eb","#b45309","#7c3aed"],Nke=(e,t=1)=>{try{return Ct(e,t)}catch{return`rgba(124, 58, 237, ${t})`}},Hq=e=>{const{items:t=[],layout:n="vertical",orientation:o="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=bke,summaryBorderColors:f=wke,summaryValueColors:M=Cke,preset:_,background:v}=e,{itemsContainerStyle:I,itemsContainerClassName:C,summaryGridColumns:b,compactItemWidth:w,compactItemHeight:L,compactItemStyle:x,summaryCardWidth:S,summaryCardHeight:j,summaryCardStyle:$}=e,q=n==="vertical",H={"--mp-accent":r,"--mp-accent-soft":Nke(r,.08),"--mp-bg-primary":v},P=[U.mpRoot,q?U.mpVertical:U.mpHorizontal,s?U.mpCompact:"",m?U.mpSummaryRoot:"",o!=="auto"?o==="vertical"?U.mpOrientationVertical:U.mpOrientationHorizontal:"",h].filter(Boolean).join(" "),A=k.useMemo(()=>y||(Ike(_)??void 0),[y,_]);if(m){const N=o==="horizontal"?U.mpSummaryFlex:U.mpSummaryVertical,T={...(b?{display:"grid",gridTemplateColumns:`repeat(${b}, 1fr)`,gap:18,alignItems:"stretch",width:"100%"}:void 0)??{},...I??{}};return c.jsxs("div",{className:P,style:H,"aria-busy":u,children:[d&&c.jsx(JS,{title:d}),c.jsx("div",{className:U.mpSummaryInner,children:c.jsx("div",{className:`${N} ${C??""}`,style:T,children:t.length===0?c.jsx("div",{className:U.mpEmpty,children:p}):t.map((R,B)=>{const F=R.bgColor??g[B%g.length],J=R.borderColor??f[B%f.length],G=R.valueColor??M[B%M.length];return A?c.jsx("div",{className:o==="horizontal"?U.mpSummaryCardWrapperHorizontal:U.mpSummaryCardWrapper,style:{width:S??void 0,height:j??void 0,...$??{}},children:A(R,B)},R.id):c.jsx(Tq,{item:R,orientation:o==="horizontal"?"horizontal":"vertical",bg:F,border:J,valueColor:G,onClick:l,width:S??void 0,height:j??void 0,extraStyle:$},R.id)})})})]})}return c.jsxs("div",{className:P,style:H,"aria-busy":u,children:[d&&c.jsx(JS,{title:d}),c.jsx("div",{className:U.mpList,style:I,children:u?c.jsx("div",{className:U.mpEmpty,children:"Chargement…"}):t.length===0?c.jsx("div",{className:U.mpEmpty,children:p}):t.map(N=>{const V=s?{width:w??void 0,height:L??void 0,boxSizing:"border-box",...x??{}}:void 0;return c.jsx("div",{className:s?U.compactItemWrapper:void 0,style:V,children:c.jsx(_ke,{item:N,shape:i,onItemClick:l,color:r,renderItem:A?T=>A(T,t.indexOf(T)):void 0})},N.id)})})]})};k.memo(Hq);const Ske=({width:e,height:t,colors:n={text:"#0b1220",background:"#fff",contentBackground:"#efeff0"},titles:o={},placeholder:i="Loading Chart",style:r,className:s="",children:d,padding:l="1rem",variant:h="default",showBorder:u=!1})=>{const p=e?typeof e=="number"?`${e}px`:e:void 0,y=t?typeof t=="number"?`${t}px`:t:void 0,m=i&&typeof i=="object"&&!k.isValidElement(i)&&("text"in i||"subtext"in i||"icon"in i||"background"in i||"iconSize"in i),g=m?i:void 0,f=g?.icon?ut[g.icon]:void 0,M=28,_=g?.iconSize??M,v=["chart-container",`variant-${h}`,u?"with-border":"",s].filter(Boolean).join(" "),I=n.contentBackground??void 0,C=typeof l=="number"?`${l}px`:l;return c.jsxs("div",{className:v,style:{width:p,height:y,color:n.text,background:n.background,display:"flex",flexDirection:"column",boxSizing:"border-box",padding:C,...r},children:[c.jsxs("div",{className:"chart-header",children:[c.jsxs("div",{className:"chart-title-left",style:{display:"flex",alignItems:"center",gap:"8px"},children:[o.left,o.leftSubtitle&&c.jsx("div",{className:"chart-subtitle-left",children:o.leftSubtitle})]}),c.jsx("div",{className:"chart-title-right",children:o.right})]}),c.jsx("div",{className:"chart-content",style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",background:I},children:d||(m&&g?c.jsxs("div",{className:"placeholder",role:"status","aria-live":"polite",children:[f&&c.jsx("div",{className:"placeholder-icon",style:{width:_,height:_},children:c.jsx(f,{color:g.iconColor??"currentColor",size:typeof _=="number"?_:parseInt(String(_),10)||M})}),g.text&&c.jsx("div",{className:"placeholder-text",children:g.text}),g.subtext&&c.jsx("div",{className:"placeholder-subtext",children:g.subtext})]}):c.jsx("div",{className:"placeholder-node",role:"status","aria-live":"polite",children:i}))})]})},Ew=({id:e,size:t="100%",background:n,icon:o,text:i,subtext:r,onClose:s,onClick:d,style:l,className:h="",colorTextPrimary:u,colorTextSub:p,model:y})=>{const m=o||y?.icon?ut[o||y?.icon]:null;return c.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&&c.jsx(m,{className:"alert-icon",size:20,color:u||y?.colorTextPrimary}),c.jsxs("div",{className:"alert-content",children:[c.jsx("span",{className:"alert-text",style:{color:u||y?.colorTextPrimary},children:i}),r&&c.jsx("span",{className:"alert-subtext",style:{color:p||y?.colorTextSub},children:r})]}),s&&c.jsx("button",{className:"alert-close",onClick:s,"aria-label":"Fermer",children:"✕"})]})},Dq=k.createContext(null),jke=(e="alert")=>`${e}_${Math.random().toString(36).slice(2,9)}`,$ke=({children:e,defaultDuration:t=4e3,maxAlerts:n,containerClassName:o,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(L=>window.clearTimeout(L)),d.current.clear()},[]);const p=(L,x)=>{const S=x===void 0||x===0?t:x;if(S===-1)return;const j=window.setTimeout(()=>{g(L)},S);d.current.set(L,j)},y=L=>{const x=d.current.get(L);x&&(window.clearTimeout(x),d.current.delete(L))},m=L=>{const x=jke(),S={...L,id:x,createdAt:Date.now()};return s(j=>{const $=[S,...j],q=u.current;return typeof q=="number"&&q>=0&&$.length>q?($.slice(q).forEach(P=>y(P.id)),$.slice(0,q)):$}),p(x,L.duration),x},g=L=>{y(L),s(x=>x.filter(S=>S.id!==L))},f=(L,x)=>{s(S=>S.map(j=>j.id===L?{...j,...x}:j))},M=()=>{d.current.forEach(L=>window.clearTimeout(L)),d.current.clear(),s([])},_=L=>{h.current=L},v=()=>r.slice(),I=k.useMemo(()=>({showAlert:m,dismissAlert:g,updateAlert:f,clearAlerts:M,setContainerRef:_,getAlertsSnapshot:v}),[r]),C=h.current,b=c.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:c.jsx(k0e,{mode:"popLayout",children:r.map(L=>c.jsx(Hw.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:L.background||L.model?.background||"var(--color-background, #fff)",border:"1px solid rgba(0, 0, 0, 0.08)",overflow:"hidden"},children:c.jsx(Ew,{id:L.id,text:L.text,subtext:L.subtext,icon:L.icon,background:"transparent",colorTextPrimary:L.colorTextPrimary,colorTextSub:L.colorTextSub,model:L.model,onClose:()=>g(L.id),size:"100%",style:{boxShadow:"none"}})},L.id))})}),w=c.jsx("div",{ref:L=>{h.current||(l.current=L)},className:o,style:{width:"100%",position:"relative",...i},"aria-live":"polite",children:b});return c.jsxs(Dq.Provider,{value:I,children:[C?ow.createPortal(b,C):w,e]})},qke=()=>{const e=k.useContext(Dq);if(!e)throw new Error("useAlerts must be used inside an AlertsProvider");return e},Ake={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"}},zke="_container_18zbo_1",Vke="_icon_18zbo_9",Pke="_selectWrapper_18zbo_23",Cb={container:zke,icon:Vke,selectWrapper:Pke},Tke=({options:e,defaultValue:t,onChange:n,label:o})=>{const[i,r]=k.useState(t||e[0]?.value||""),s=d=>{r(d),n?.(d)};return c.jsxs("div",{className:Cb.container,children:[c.jsxs("div",{className:Cb.icon,children:[c.jsx(h1,{size:18}),c.jsx("p",{children:o})]}),c.jsx("div",{className:Cb.selectWrapper,children:c.jsx(Dw,{field:{name:"periode",label:"",options:e},value:i,onChange:s,onBlur:()=>{}})})]})},Hke=250,Dke=k.forwardRef(({title:e,subtitle:t,size:n="420px",beforeOpen:o,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),I=k.useRef(null),C=k.useRef(null);k.useEffect(()=>{const L=_.current;if(!L)return;const x=L.parentElement;return x?(window.getComputedStyle(x).position==="static"&&(x.setAttribute("data-scp-prev-position",x.style.position??""),x.style.position="relative",x.setAttribute("data-scp-position-changed","true")),()=>{if(x.getAttribute("data-scp-position-changed")==="true"){const j=x.getAttribute("data-scp-prev-position")??"";x.style.position=j,x.removeAttribute("data-scp-position-changed"),x.removeAttribute("data-scp-prev-position")}}):void 0},[]),k.useImperativeHandle(y,()=>({open:()=>{m||(o?.(),M(!1),g(!0))},close:()=>{m&&(r?.(),M(!1),g(!1))},toggle:()=>{m?(r?.(),M(!1),g(!1)):(o?.(),M(!1),g(!0))}}),[m,o,r]),k.useEffect(()=>{const L=v.current;C.current&&(window.clearTimeout(C.current),C.current=null);const x=S=>{if(S.target===L&&!(S.propertyName!=="transform"&&S.propertyName!=="opacity"))if(m){M(!0),i?.();try{L?.focus()}catch{}}else{s?.();try{I.current?.focus()}catch{}}};return L&&(L.addEventListener("transitionend",x),C.current=window.setTimeout(()=>{if(m){M(!0),i?.();try{L?.focus()}catch{}}else{s?.();try{I.current?.focus()}catch{}}},Hke+60)),m&&(I.current=document.activeElement),()=>{L&&L.removeEventListener("transitionend",x),C.current&&(window.clearTimeout(C.current),C.current=null)}},[m,i,s]),k.useEffect(()=>{const L=x=>{x.key==="Escape"&&m&&(r?.(),M(!1),g(!1))};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[m,r]);const b=()=>{u&&(r?.(),M(!1),g(!1))},w=typeof n=="number"?`${n}px`:n;return c.jsxs("div",{ref:_,className:`scp-inline-root ${m?"open":""}`,"aria-hidden":!m,children:[c.jsx("div",{className:`scp-overlay ${m?"visible":""}`,onMouseDown:b,role:"presentation"}),c.jsxs("aside",{className:`scp-panel ${m?"in":"out"} ${f?"interactive":""} ${l}`,style:{width:w,...d},ref:v,tabIndex:-1,role:"dialog","aria-label":e,children:[c.jsxs("div",{className:"scp-header",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"scp-title",children:e}),t&&c.jsx("div",{className:"scp-subtitle",children:t})]}),p&&c.jsx("button",{className:"scp-close","aria-label":"Close",onClick:()=>{r?.(),M(!1),g(!1)},children:c.jsx(Ze,{size:18})})]}),c.jsx("div",{className:"scp-body",children:h})]})]})});function Bke(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 Rke="_container_1pfsp_1",Fke="_title_1pfsp_8",nj={container:Rke,title:Fke},Eke=({title:e,fontSize:t,barColor:n,className:o="",style:i={}})=>{const r={...i,"--title-font-size":t,"--bar-color":n};return c.jsx("div",{className:`${nj.container} ${o}`,style:r,children:c.jsx("h2",{className:nj.title,children:e})})},Oke="_modalOverlay_1dmfp_1",Uke="_modalContainer_1dmfp_16",Wke="_modalTitle_1dmfp_29",Gke="_modalInput_1dmfp_38",Zke="_modalTextarea_1dmfp_39",Kke="_modalActions_1dmfp_71",Xke="_cancelBtn_1dmfp_78",Yke="_saveBtn_1dmfp_100",Jke="_inputError_1dmfp_148",Qke="_inlineAlert_1dmfp_153",We={modalOverlay:Oke,modalContainer:Uke,modalTitle:Wke,modalInput:Gke,modalTextarea:Zke,modalActions:Kke,cancelBtn:Xke,saveBtn:Yke,inputError:Jke,inlineAlert:Qke},Nc=({isOpen:e,onClose:t,onSave:n,title:o="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 L={};for(const x of i)L[x.name]=Object.prototype.hasOwnProperty.call(r,x.name)?r[x.name]:"";return y(L),requestAnimationFrame(()=>{m.current?.focus();const x=m.current;if(x&&typeof x.selectionStart=="number"){const S=String(x.value??"").length;x.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 I=(L,x)=>{y(S=>({...S,[L]:x})),l&&l(L,x)},C=async()=>{if(!Object.values(p).some(L=>L===""||L===void 0))try{f(!0);const L=await n(p);if(typeof L=="string"&&L==="duplicate-same"){f(!1);return}y({}),f(!1),t()}catch(L){console.error("AddItemModal onSave error:",L),f(!1),t()}},b=L=>{L.target===L.currentTarget&&t()},w=L=>L.stopPropagation();return c.jsx("div",{className:We.modalOverlay,onMouseDown:b,role:"dialog","aria-modal":"true",children:c.jsxs("div",{className:We.modalContainer,onMouseDown:w,onClick:w,children:[c.jsx("h2",{className:We.modalTitle,children:o}),i.map((L,x)=>{const S=p[L.name]??"",j=x===0&&!!s,$={name:L.name,placeholder:L.placeholder||L.label,value:String(S),onChange:q=>I(L.name,q.target.value),className:L.type==="textarea"?`${We.modalTextarea} ${j?We.inputError:""}`:`${We.modalInput} ${j?We.inputError:""}`,tabIndex:0,disabled:g};return x===0&&($.ref=q=>{m.current=q}),c.jsxs("div",{style:{marginBottom:8},children:[L.type==="textarea"?c.jsx("textarea",{rows:L.rows||4,...$}):c.jsx("input",{type:L.type||"text",...$}),x===0&&M&&s&&c.jsx("div",{style:{marginTop:8},children:c.jsx(Ew,{text:s,background:"#fff5f5",colorTextPrimary:"#ef4444",onClose:()=>_(!1),className:We.inlineAlert})})]},L.name)}),c.jsxs("div",{className:We.modalActions,children:[c.jsx("button",{className:We.cancelBtn,onClick:t,type:"button",disabled:g,children:u}),c.jsx("button",{className:We.saveBtn,onClick:C,type:"button",disabled:g||!!d,children:g?"En cours...":h})]})]})})},e3e=({title:e,keyCount:t,onAddKey:n})=>{const[o,i]=k.useState(!1),r=s=>{const d=s.key;n&&d&&n(d)};return c.jsxs("div",{className:"header-container",children:[c.jsxs("div",{className:"header-info",children:[c.jsx("h1",{children:e}),c.jsxs("p",{children:[t," clés"]})]}),c.jsxs("button",{onClick:()=>i(!0),className:"add-key-button",children:[c.jsx(Oc,{className:"add-key-icon"}),"Clé"]}),c.jsx(Nc,{isOpen:o,title:"Ajouter une clé",onClose:()=>i(!1),onSave:r,fields:[{name:"key",label:"Nouvelle clé",placeholder:"Entrer une nouvelle clé"}]})]})},t3e=({modules:e,onEdit:t,onDelete:n,onAddModule:o,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),_=L=>{if(o){const x=L.code?.trim()||L.id?.trim(),S=L.title?.trim(),j=x||S||String(Date.now()),$=S||x||`Module ${j}`;o({id:j,title:$,subtitle:"",translations:{}})}M()},v=(L,x)=>{L.stopPropagation(),u(x)},I=()=>u(null),C=L=>{if(!h){I();return}const x={...h,title:L.title||h.title,subtitle:""};t&&t(x),I()},b=(L,x)=>{L.stopPropagation(),n&&n(x)},w=L=>{y(L.id),i&&i(L)};return m?c.jsx("div",{className:"module-sidebar collapsed",children:c.jsx(Ec,{size:20,className:"menu-toggle",onClick:()=>g(!1)})}):c.jsxs("div",{className:"module-sidebar",children:[c.jsxs("div",{className:"sidebar-header",children:[c.jsxs("span",{className:"header-text",children:["Modules (",e.length,")"]}),c.jsxs("div",{className:"header-actions",children:[c.jsx(Fc,{size:18,className:"header-folder",onClick:f}),c.jsx(Ec,{size:18,className:"header-menu",onClick:()=>g(!0)})]})]}),c.jsx("hr",{className:"divider"}),c.jsx("div",{className:"module-list",children:e.map(L=>{const x=Object.keys(L.translations||{}).length,S=x>0||L.id===p;return c.jsxs("div",{className:`module-item ${L.id===p?"selected":""}`,onClick:()=>w(L),role:"button",tabIndex:0,onKeyDown:j=>{j.key==="Enter"&&w(L)},children:[c.jsxs("div",{className:"module-left",children:[c.jsx(m1,{size:16,className:"item-folder"}),c.jsxs("div",{className:"module-info",children:[c.jsxs("div",{className:"module-title",children:[L.title,S&&c.jsxs("span",{className:"count",children:[" ",x," "]})]}),L.subtitle?c.jsx("div",{className:"module-subtitle",children:L.subtitle}):null]})]}),c.jsxs("div",{className:"module-actions",children:[t&&c.jsx(v1,{onClick:j=>v(j,L),color:"#777",size:16}),n&&c.jsx(St,{onClick:j=>b(j,L.id),color:"#777",size:16})]})]},L.id)})}),c.jsx(Nc,{isOpen:d,onClose:M,onSave:_,title:s||"Ajouter un module",fields:r&&r.length?r.map(L=>({name:L.name,label:L.label,type:L.type,placeholder:L.placeholder,rows:L.rows})):[{name:"title",label:"Titre",placeholder:"Titre du module"}]}),h&&c.jsx(Nc,{isOpen:!!h,onClose:I,onSave:C,title:"Éditer le module",initialValues:{title:h.title},fields:[{name:"title",label:"Titre",placeholder:"Titre du module"}]})]})},Bq=({placeholder:e="Rechercher une clé ou traduction...",value:t="",onChange:n,iconPosition:o="left",iconColor:i="#9ca3af"})=>c.jsxs("div",{className:`search-container icon-${o}`,children:[c.jsx("div",{className:"search-icon-wrapper",children:c.jsx(M1,{className:"search-icon",color:i})}),c.jsx("input",{type:"text",placeholder:e,value:t,onChange:r=>n?.(r.target.value),className:"search-input"})]}),a3e=({keyName:e,translations:t,availableLanguages:n,onDeleteKey:o,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,I]=k.useState(""),[C,b]=k.useState(!1),[w,L]=k.useState(!1),[x,S]=k.useState(null),[j,$]=k.useState(!1),q=t.map(B=>B.language),H=n.filter(B=>!q.includes(B.code)),P=()=>{y&&v.trim()&&(d?.(e,y,v.trim()),m(""),I(""),p(!1))},A=(B,F)=>{f(B),_(F)},N=B=>{r?.(e,B,M),f(null),_("")},V=()=>{f(null),_("")},T=async B=>{const F=B.name?.trim();if(F){if(S(null),$(!1),F===e||!i)return b(!1),"ok";try{const J=await i(e,F);if(typeof J=="string"&&J==="ok")b(!1),S(null);else{if(typeof J=="string"&&J==="duplicate-same")return S("Une clé existe déjà dans ce module."),$(!0),"duplicate-same";if(typeof J=="string"&&J==="duplicate-other")return b(!1),S(null),"duplicate-other";b(!1)}}catch(J){console.error("Erreur handleRenameSave:",J),S("Erreur lors du renommage.")}}},R=(B,F)=>{if(B!=="name")return;const J=F.trim();S(null),$(!1),J&&typeof h=="function"&&(h(J,e)?(S("Une clé existe déjà dans ce module."),$(!0)):(S(null),$(!1)))};return c.jsxs("div",{className:`translation-key ${w?"collapsed":"expanded"} ${l?"draggable":""}`,children:[c.jsxs("div",{className:"card-header",children:[c.jsxs("div",{className:"header-left",children:[c.jsx("button",{className:"collapse-button",onClick:()=>L(!w),title:w?"Déplier":"Replier",children:w?c.jsx(p1,{className:"collapse-icon"}):c.jsx(Nt,{className:"collapse-icon"})}),c.jsx("h3",{className:"card-title",title:e,children:e})]}),c.jsxs("div",{className:"header-actions",children:[c.jsx("button",{className:"action-button",onClick:B=>{B.stopPropagation(),b(!0)},title:"Renommer la clé",children:c.jsx(lt,{className:"action-icon"})}),c.jsx("button",{onClick:B=>{B.stopPropagation(),o?.(e)},className:"action-button delete",title:"Supprimer la clé",children:c.jsx(St,{className:"action-icon"})})]})]}),c.jsx("div",{className:`translations-container ${w?"":"expanded"}`,children:!l&&c.jsxs(c.Fragment,{children:[t.map(B=>c.jsxs("div",{className:"translation-row",children:[c.jsx("div",{className:"language-code",children:B.language}),c.jsx("div",{className:"translation-content",children:g===B.language?c.jsxs(c.Fragment,{children:[c.jsx("input",{type:"text",value:M,onChange:F=>_(F.target.value),className:"edit-input",autoFocus:!0,onKeyDown:F=>{F.key==="Enter"&&N(B.language),F.key==="Escape"&&V()}}),c.jsx("button",{onClick:()=>N(B.language),className:"save-button",disabled:!M.trim(),children:"Enregistrer"}),c.jsx("button",{onClick:V,className:"cancel-button",children:c.jsx(Ze,{className:"action-icon"})})]}):c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"translation-text",title:B.value,children:B.value}),c.jsx("button",{onClick:()=>A(B.language,B.value),className:"edit-button",title:"Éditer la traduction",children:c.jsx(lt,{className:"action-icon"})}),c.jsx("button",{onClick:()=>s?.(e,B.language),className:"delete-translation-button",title:"Supprimer la traduction",children:c.jsx(Ze,{className:"action-icon"})})]})})]},B.language)),u?c.jsxs("div",{className:"add-language-row",children:[c.jsx("div",{className:"language-code",children:"+"}),c.jsxs("div",{className:"add-language-content",children:[c.jsx("div",{className:"language-select-container",children:c.jsxs("select",{value:y,onChange:B=>m(B.target.value),className:"language-select",children:[c.jsx("option",{value:"",children:"Sélectionnez la langue"}),H.map(B=>c.jsxs("option",{value:B.code,children:[B.name," (",B.code,")"]},B.code))]})}),y&&c.jsx("input",{type:"text",value:v,onChange:B=>I(B.target.value),placeholder:"Entrez la traduction...",className:"translation-input",onKeyDown:B=>{B.key==="Enter"&&P(),B.key==="Escape"&&(p(!1),m(""),I(""))}}),c.jsx("button",{onClick:P,disabled:!y||!v.trim(),className:"save-button",children:"Ajouter"}),c.jsx("button",{onClick:()=>{p(!1),m(""),I("")},className:"cancel-button",children:c.jsx(Ze,{className:"action-icon"})})]})]}):c.jsxs("button",{onClick:()=>p(!0),className:"show-add-button",disabled:H.length===0,children:[c.jsx("span",{className:"plus-icon",children:"+"}),"Ajouter une langue"]})]})}),l&&c.jsxs("div",{className:"drag-overlay",children:[c.jsx(a.Move,{size:24,strokeWidth:1.5}),c.jsx("span",{children:"Glisser pour réorganiser"})]}),c.jsx(Nc,{isOpen:C,onClose:()=>{b(!1),S(null),$(!1)},onSave:T,onFieldChange:R,title:"Renommer la clé",initialValues:{name:e},fields:[{name:"name",label:"Nom de la clé",placeholder:"Nom de la clé"}],errorMessage:x||"",disableSave:j})]})},n3e="_wrapper_1wvht_1",o3e="_leftGroup_1wvht_12",c3e="_filterButton_1wvht_21",i3e="_open_1wvht_42",r3e="_filterIcon_1wvht_42",s3e="_infoText_1wvht_58",d3e="_pickerContainer_1wvht_66",l3e="_srOnly_1wvht_79",h3e="_pickerLabel_1wvht_91",u3e="_datetime_1wvht_98",p3e="_rightGroup_1wvht_107",y3e="_searchInputWrap_1wvht_116",k3e="_searchInput_1wvht_116",m3e="_searchIcon_1wvht_152",$e={wrapper:n3e,leftGroup:o3e,filterButton:c3e,open:i3e,filterIcon:r3e,infoText:s3e,pickerContainer:d3e,srOnly:l3e,pickerLabel:h3e,datetime:u3e,rightGroup:p3e,searchInputWrap:y3e,searchInput:k3e,searchIcon:m3e};function f3e({onDateChange:e,onSearch:t,initialDate:n}){const[o,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 c.jsxs("div",{className:$e.wrapper,ref:d,children:[c.jsxs("div",{className:$e.leftGroup,children:[c.jsxs("button",{type:"button",className:`${$e.filterButton} ${o?$e.open:""}`,onClick:l,"aria-expanded":o,"aria-haspopup":"dialog","aria-controls":"entry-datetime",children:[c.jsx("span",{children:"Entry time"}),c.jsx("svg",{className:$e.filterIcon,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":!0,children:c.jsx("path",{fill:"currentColor",d:"M10 18h4v-2h-4v2zm-7-8v2h18V10H3zm3-6v2h12V4H6z"})})]}),c.jsx("div",{className:$e.infoText,children:"Confidence interval: step ± 15' / exit ± 30'"}),o&&c.jsxs("div",{className:$e.pickerContainer,role:"dialog","aria-label":"Choisir la date et l’heure",children:[c.jsx("label",{className:$e.pickerLabel,htmlFor:"entry-datetime",children:c.jsx("span",{className:$e.srOnly,children:"Choisir la date et l’heure"})}),c.jsx("input",{id:"entry-datetime",className:$e.datetime,type:"datetime-local",value:r,onChange:h,"aria-label":"Date et heure d’entrée"})]})]}),c.jsx("div",{className:$e.rightGroup,children:c.jsxs("div",{className:$e.searchInputWrap,children:[c.jsx("input",{className:$e.searchInput,placeholder:"Search...",onChange:u,"aria-label":"Search"}),c.jsx("svg",{className:$e.searchIcon,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"16",height:"16","aria-hidden":!0,children:c.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 g3e=({className:e="",style:t={},title:n,titleClassName:o="",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(C=>typeof C=="string"),_=g.some(C=>Array.isArray(C)),v=(C,b,w)=>d?d(C,b,w):c.jsx("span",{className:"slb-cell-text",children:C}),I=m?{"--col-gap":m}:void 0;return f?c.jsxs("div",{className:`slb-root ${e}`,style:{...t,background:l??void 0},children:[n&&c.jsx("div",{className:`slb-title ${o}`,style:{...i,background:h??void 0,color:u??void 0},children:n}),c.jsx("div",{className:"slb-empty",children:y??null})]}):M&&!_?c.jsxs("div",{className:`slb-root ${e}`,style:{...t,background:l??void 0},children:[n&&c.jsx("div",{className:`slb-title ${o}`,style:{background:h??void 0,color:u??void 0},children:n}),c.jsx("ul",{className:"slb-list",children:g.map((C,b)=>c.jsx("li",{className:`slb-item ${s[b]||""}`,style:{background:p??void 0},children:v(C,b,0)},b))})]}):c.jsxs("div",{className:`slb-root ${e}`,style:{...t,background:l??void 0},children:[n&&c.jsx("div",{className:`slb-title ${o}`,style:{background:h??void 0,color:u??void 0},children:n}),c.jsx("div",{className:"slb-grid",style:I,children:g.map((C,b)=>{const w=s[b]||"";if(Array.isArray(C)){const[L,x]=C;return c.jsxs("div",{className:`slb-row ${w}`,style:{background:p??void 0},children:[c.jsx("div",{className:"slb-grid-left",children:v(L,b,0)}),c.jsx("div",{className:"slb-grid-right",children:v(x,b,1)})]},b)}return c.jsxs("div",{className:`slb-row ${w}`,style:{background:p??void 0},children:[c.jsx("div",{className:"slb-grid-left",children:v(C,b,0)}),c.jsx("div",{className:"slb-grid-right slb-empty-cell","aria-hidden":"true"})]},b)})})]})},v3e=({className:e="",style:t={},title:n,titleColor:o,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 c.jsxs("div",{className:`clb-root ${e}`,style:{...t},children:[n&&c.jsx("div",{className:"clb-title",style:o?{color:o}:void 0,children:n}),c.jsx("div",{className:"clb-grid",style:m,children:i.map((g,f)=>{const M=u[f]||"";if(Array.isArray(g)){const[_,v]=g,I=s[f]||r;return c.jsxs("div",{className:`clb-row ${M}`,style:{background:h??void 0},children:[c.jsx("div",{className:"clb-badge-col",children:c.jsx("div",{className:"counter-badge",style:{background:I,padding:d,width:l,minWidth:l},children:_})}),c.jsx("div",{className:"clb-text",children:v})]},f)}return y?c.jsxs("div",{className:`clb-row ${M}`,style:{background:h??void 0},children:[c.jsx("div",{className:"clb-badge-col clb-empty-badge"}),c.jsx("div",{className:"clb-text",children:g})]},f):c.jsx("div",{className:`clb-fullrow ${M}`,style:{background:h??void 0},children:c.jsx("span",{children:g})},f)})})]})},M3e=({className:e="",style:t={},title:n,items:o=[],titleBg:i,titleColor:r,itemBg:s,lineClasses:d={},renderTrendIcon:l,colGap:h="1rem"})=>{const u=h?{"--col-gap":h}:void 0;return c.jsxs("div",{className:`tlb-root ${e}`,style:{...t,background:s??void 0},children:[n&&c.jsx("div",{className:"tlb-title",style:{background:i??void 0,color:r??void 0},children:n}),c.jsx("div",{className:"tlb-grid",style:u,children:o.map((p,y)=>{const m=d[y]||"";return c.jsxs("div",{className:`tlb-row ${m}`,style:{background:s??void 0},children:[c.jsx("div",{className:"tlb-label",children:p.label}),c.jsxs("div",{className:"tlb-value-group",children:[c.jsx("div",{className:"tlb-icon-col",children:l?l(p):p.icon??null}),c.jsxs("div",{className:"tlb-value-wrap",children:[c.jsx("div",{className:"tlb-value",children:p.value}),typeof p.delta<"u"&&c.jsx("div",{className:`tlb-delta ${p.delta>0?"positive":p.delta<0?"negative":"neutral"}`,children:p.deltaLabel??String(p.delta)})]})]})]},y)})})]})},_3e=({className:e="",style:t={},children:n,gap:o="1rem"})=>c.jsx("div",{className:`frc-root ${e}`,style:{...t,"--frc-gap":o},children:k.Children.map(n,i=>c.jsx("div",{className:"frc-item",children:i}))}),x3e=({className:e="",style:t={},children:n,gap:o="1rem",background:i="#D9EEF5"})=>c.jsx("div",{className:`lcc-root ${e}`,style:{background:i,...t,"--lcc-gap":o},children:k.Children.map(n,r=>c.jsx("div",{className:"lcc-cell",children:r}))}),L3e="_overlay_i1ay5_2",I3e="_fadeIn_i1ay5_1",b3e="_popup_i1ay5_17",w3e="_slideUp_i1ay5_1",C3e="_header_i1ay5_28",N3e="_body_i1ay5_40",S3e="_footer_i1ay5_51",j3e="_cancelButton_i1ay5_59",$3e="_confirmButton_i1ay5_77",q3e="_warning_i1ay5_97",A3e="_danger_i1ay5_106",z3e="_info_i1ay5_115",gt={overlay:L3e,fadeIn:I3e,popup:b3e,slideUp:w3e,header:C3e,body:N3e,footer:S3e,cancelButton:j3e,confirmButton:$3e,warning:q3e,danger:A3e,info:z3e},V3e=({isOpen:e,title:t,message:n,onConfirm:o,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&&o()};return c.jsx("div",{className:gt.overlay,onClick:l,onKeyDown:h,role:"dialog","aria-labelledby":"confirmation-title","aria-describedby":"confirmation-message",children:c.jsxs("div",{className:`${gt.popup} ${gt[d]}`,children:[c.jsx("div",{className:gt.header,children:c.jsx("h3",{id:"confirmation-title",children:t})}),c.jsx("div",{className:gt.body,children:c.jsx("p",{id:"confirmation-message",children:n})}),c.jsxs("div",{className:gt.footer,children:[c.jsx("button",{className:gt.cancelButton,onClick:i,type:"button",children:s}),c.jsx("button",{className:gt.confirmButton,onClick:o,type:"button",autoFocus:!0,children:r})]})]})})},P3e=()=>{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})},[]),o=k.useCallback(()=>{t(r=>({...r,isOpen:!1,onConfirm:null}))},[]),i=k.useCallback(()=>{e.onConfirm?.(),o()},[e.onConfirm,o]);return{isOpen:e.isOpen,title:e.title,message:e.message,showConfirmation:n,hideConfirmation:o,handleConfirm:i}},T3e="_container_v7v52_1",H3e="_selectButton_v7v52_6",D3e="_disabled_v7v52_19",B3e="_error_v7v52_29",R3e="_outline_v7v52_43",F3e="_filled_v7v52_53",E3e="_sm_v7v52_58",O3e="_md_v7v52_63",U3e="_lg_v7v52_68",W3e="_buttonContent_v7v52_73",G3e="_label_v7v52_80",Z3e="_placeholder_v7v52_87",K3e="_iconsContainer_v7v52_91",X3e="_loadingSpinner_v7v52_99",Y3e="_spin_v7v52_1",J3e="_arrowIcon_v7v52_119",Q3e="_arrowIconOpen_v7v52_127",eme="_dropdown_v7v52_131",tme="_searchContainer_v7v52_146",ame="_searchInput_v7v52_150",nme="_optionsList_v7v52_173",ome="_noResults_v7v52_195",cme="_option_v7v52_173",ime="_optionHighlighted_v7v52_217",rme="_optionSelected_v7v52_222",sme="_optionDisabled_v7v52_228",dme="_optionLabel_v7v52_233",lme="_checkIcon_v7v52_240",hme="_widthFull_v7v52_248",ume="_width64_v7v52_252",pme="_width80_v7v52_256",yme="_width96_v7v52_260",te={container:T3e,selectButton:H3e,disabled:D3e,error:B3e,default:"_default_v7v52_38",outline:R3e,filled:F3e,sm:E3e,md:O3e,lg:U3e,buttonContent:W3e,label:G3e,placeholder:Z3e,iconsContainer:K3e,loadingSpinner:X3e,spin:Y3e,arrowIcon:J3e,arrowIconOpen:Q3e,dropdown:eme,searchContainer:tme,searchInput:ame,optionsList:nme,noResults:ome,option:cme,optionHighlighted:ime,optionSelected:rme,optionDisabled:sme,optionLabel:dme,checkIcon:lme,widthFull:hme,width64:ume,width80:pme,width96:yme},kme=({options:e,value:t,onChange:n,placeholder:o="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}),I=k.useRef(null),C=k.useRef(null),b=k.useRef(null),w=k.useMemo(()=>m?e.filter(N=>N.label.toLowerCase().includes(m.toLowerCase())):e,[e,m]),L=e.find(N=>N.value===t),x=k.useCallback(()=>{if(I.current){const N=I.current.getBoundingClientRect();v({top:N.top,left:N.left,width:N.width})}},[]);k.useEffect(()=>(p&&(x(),window.addEventListener("scroll",x,!0),window.addEventListener("resize",x)),()=>{window.removeEventListener("scroll",x,!0),window.removeEventListener("resize",x)}),[p,x]),k.useEffect(()=>{const N=V=>{I.current&&!I.current.contains(V.target)&&C.current&&!C.current.contains(V.target)&&(y(!1),g(""))};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[]),k.useEffect(()=>{M(0)},[w]);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(V=>V<w.length-1?V+1:V);break;case"ArrowUp":N.preventDefault(),M(V=>V>0?V-1:V);break;case"Enter":N.preventDefault(),w[f]&&S(w[f]);break;case"Escape":y(!1),g("");break}},q=()=>[te.selectButton,te[l],te[h],i?te.disabled:"",s?te.error:"",d].filter(Boolean).join(" "),H=()=>{switch(u){case"w-64":return te.width64;case"w-80":return te.width80;case"w-96":return te.width96;default:return te.widthFull}},P=(N,V)=>[te.option,V===f?te.optionHighlighted:"",N.value===t?te.optionSelected:"",N.disabled?te.optionDisabled:""].filter(Boolean).join(" "),A={position:"fixed",top:_.top+(I.current?.offsetHeight||0)+4,left:_.left,width:_.width,zIndex:9999};return c.jsxs("div",{className:`${te.container} ${H()}`,children:[c.jsx("button",{ref:I,className:q(),onClick:()=>!i&&y(!p),onKeyDown:$,tabIndex:i?-1:0,type:"button","aria-haspopup":"listbox","aria-expanded":p,disabled:i,children:c.jsxs("div",{className:te.buttonContent,children:[c.jsx("span",{className:`${te.label} ${L?"":te.placeholder}`,children:L?L.label:o}),c.jsxs("div",{className:te.iconsContainer,children:[r&&c.jsx("div",{className:te.loadingSpinner}),c.jsx("svg",{className:`${te.arrowIcon} ${p?te.arrowIconOpen:""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]})}),p&&ow.createPortal(c.jsxs("div",{className:`${te.dropdown} ${H()}`,style:A,ref:C,children:[c.jsx("div",{className:te.searchContainer,children:c.jsx("input",{ref:b,type:"text",value:m,onChange:j,placeholder:"Rechercher...",className:te.searchInput,autoFocus:!0})}),c.jsx("div",{className:te.optionsList,children:w.length===0?c.jsx("div",{className:te.noResults,children:"Aucun résultat trouvé"}):c.jsx("ul",{role:"listbox",children:w.map((N,V)=>c.jsx("li",{className:P(N,V),onClick:()=>S(N),onMouseEnter:()=>M(V),role:"option","aria-selected":N.value===t,"aria-disabled":N.disabled,children:c.jsxs("div",{className:te.buttonContent,children:[c.jsx("span",{className:te.optionLabel,title:N.label,children:N.label}),N.value===t&&c.jsx("svg",{className:te.checkIcon,fill:"currentColor",viewBox:"0 0 20 20",children:c.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)]})},mme="_container_uq7pt_1",fme="_item_uq7pt_7",gme="_mainValue_uq7pt_13",vme="_label_uq7pt_17",Mme="_subValue_uq7pt_22",_me="_subValueWrapper_uq7pt_27",xme="_subSeparator_uq7pt_32",Be={container:mme,item:fme,mainValue:gme,label:vme,subValue:Mme,subValueWrapper:_me,subSeparator:xme},Lme=({dms:e,stats:t=[],itemWidth:n="120px",valueFontSize:o="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 c.jsxs("span",{className:Be.subValueWrapper,children:[c.jsx("span",{className:Be.subLeft,style:{color:y},children:g}),c.jsx("span",{className:Be.subSeparator,children:" / "}),c.jsx("span",{className:Be.subRight,style:{color:m},children:f})]})};return c.jsxs("div",{className:Be.container,style:{backgroundColor:d},children:[e&&c.jsxs("div",{className:Be.item,style:{flex:`1 1 ${n}`},children:[c.jsx("div",{className:Be.mainValue,style:{fontSize:o,fontWeight:i,color:h},children:e}),c.jsx("div",{className:Be.label,style:{color:l},children:"DMS"})]}),t.map((p,y)=>c.jsxs("div",{className:Be.item,style:{flex:`1 1 ${n}`},children:[c.jsx("div",{className:Be.mainValue,style:{fontSize:o,fontWeight:i,color:h},children:p.value}),c.jsx("div",{className:Be.label,style:{color:l},children:p.label}),c.jsx("div",{className:Be.subValue,style:{fontSize:r,fontWeight:s},children:p.subValue&&u(p.subValue,p.subLeftColor,p.subRightColor)})]},y))]})},Ime="_encours_16ist_1",bme="_header_16ist_19",wme="_iconWrap_16ist_27",Cme="_title_16ist_36",Nme="_items_16ist_47",Sme="_spaceEvenly_16ist_56",jme="_item_16ist_47",$me="_valueContainer_16ist_86",qme="_value_16ist_86",Ame="_label_16ist_108",et={encours:Ime,header:bme,iconWrap:wme,title:Cme,items:Nme,spaceEvenly:Sme,item:jme,valueContainer:$me,value:qme,label:Ame},Lc=e=>typeof e=="number"?`${e}px`:typeof e=="string"?e:void 0;function zme(e,t){const n={},o={};return e.valueColor&&(n.color=e.valueColor),e.valueFontSize!==void 0?n.fontSize=Lc(e.valueFontSize):t.defaultValueFontSize!==void 0&&(n.fontSize=Lc(t.defaultValueFontSize)),e.valueFontWeight!==void 0?n.fontWeight=e.valueFontWeight:t.defaultValueFontWeight!==void 0&&(n.fontWeight=t.defaultValueFontWeight),e.labelColor&&(o.color=e.labelColor),e.labelFontSize!==void 0?o.fontSize=Lc(e.labelFontSize):t.defaultLabelFontSize!==void 0&&(o.fontSize=Lc(t.defaultLabelFontSize)),e.labelFontWeight!==void 0?o.fontWeight=e.labelFontWeight:t.defaultLabelFontWeight!==void 0&&(o.fontWeight=t.defaultLabelFontWeight),{valueStyle:n,labelStyle:o}}function Vme(){return c.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[c.jsx("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"1.4"}),c.jsx("path",{d:"M8 12h8",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})}function Pme(e){const{title:t,titleColor:n,titleFontSize:o,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,I=r?ut[r]:void 0,C={background:g,width:Lc(f),...m},b={};n&&(b.color=n),o!==void 0&&(b.fontSize=Lc(o)),i!==void 0&&(b.fontWeight=i);const w={};return d&&(w.color=d),c.jsxs("section",{className:`${et.encours} ${_??""}`,style:C,"aria-label":v??t,children:[c.jsxs("div",{className:et.header,children:[c.jsx("div",{className:et.iconWrap,"aria-hidden":!0,style:w,children:I?c.jsx(I,{size:typeof s=="number"?s:void 0}):c.jsx(Vme,{})}),c.jsx("div",{className:et.title,style:b,children:t})]}),c.jsx("div",{className:`${et.items} ${M===void 0?et.spaceEvenly:""}`,role:"list",style:M!==void 0?{gap:`${M}px`}:{},children:y.map((L,x)=>{const{valueStyle:S,labelStyle:j}=zme(L,{defaultValueFontSize:l,defaultValueFontWeight:h,defaultLabelFontSize:u,defaultLabelFontWeight:p});return c.jsx("div",{className:et.item,role:"listitem",style:{...L.background?{background:L.background}:{},...L.width?{width:Lc(L.width)}:{}},children:c.jsxs("div",{className:et.valueContainer,children:[c.jsx("div",{className:et.value,style:S,children:L.value}),L.label&&c.jsx("div",{className:et.label,style:j,children:L.label})]})},`${String(L.label??L.value)}-${x}`)})})]})}const Tme=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"})),Hme=k.memo(Tme),Dme=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"})),Bme=k.memo(Dme),Rme=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"})),Fme=k.memo(Rme),Eme=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"})),Ome=k.memo(Eme),Ume=({items:e,onSave:t,loading:n,disabled:o,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})=>{const[u,p]=k.useState(!1),[y,m]=k.useState(e),[g,f]=k.useState(!1);if(k.useEffect(()=>{f(!0)},[]),k.useEffect(()=>{m(e)},[e]),!g)return null;const M=(v,I)=>{I<4||m(C=>C.map(b=>b.component_key===v?{...b,visible:!b.visible}:b))},_=()=>{t(y),p(!1)};return c.jsxs("div",{style:{position:"relative",display:"inline-block",...h},children:[c.jsxs("div",{onClick:()=>{o||p(!u)},style:{display:"flex",alignItems:"center",cursor:o?"not-allowed":"pointer",borderRadius:4,transition:"background 0.2s"},title:s,children:[c.jsx(_j,{width:d,height:d,fill:l?.icon||"currentColor",style:{transition:"color 0.2s"}}),u?c.jsx(Bme,{width:d,height:d,fill:l?.icon||"currentColor"}):c.jsx(Hme,{width:d,height:d,fill:l?.icon||"currentColor"})]}),u&&c.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:[c.jsx("ul",{style:{listStyle:"none",padding:0,margin:0},children:y.map((v,I)=>c.jsxs(k.Fragment,{children:[c.jsxs("li",{onClick:()=>M(v.component_key,I),style:{display:"flex",alignItems:"center",padding:"0.5rem",cursor:I<4?"not-allowed":"pointer",transition:"background 0.2s"},onMouseEnter:C=>{I>=4&&(C.currentTarget.style.background="#F9FAFB")},onMouseLeave:C=>{I>=4&&(C.currentTarget.style.background="transparent")},children:[c.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",marginRight:8,flexShrink:0},children:v.visible?c.jsx(Fme,{width:20,height:20,fill:l?.activeBg||"var(--color-primary, #008FBB)"}):c.jsx(Ome,{width:20,height:20,fill:"#D1D5DB"})}),c.jsx("span",{style:{fontSize:"14px",color:"#111827",fontWeight:400,userSelect:"none"},children:v.label})]}),I===3&&c.jsx("div",{style:{height:1,background:"#E5E7EB",margin:"4px 0"}})]},v.component_key))}),c.jsx("div",{style:{padding:"12px 16px 0 16px",display:"flex",justifyContent:"flex-end"},children:c.jsx("button",{type:"button",onClick:_,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})})]})]})},Wme="_container_zhny9_1",Gme="_card_zhny9_15",Zme="_footer_zhny9_33",Kme="_noPaddingMobile_zhny9_51",W1={container:Wme,card:Gme,footer:Zme,noPaddingMobile:Kme},Xme="_board_1tbkr_1",Yme="_clickable_1tbkr_21",Jme="_sideBar_1tbkr_26",Qme="_boardContent_1tbkr_32",e6e="_orange_1tbkr_40",t6e="_red_1tbkr_44",a6e="_green_1tbkr_48",n6e="_grey_1tbkr_52",o6e="_lightGrey_1tbkr_56",c6e="_big_1tbkr_61",i6e="_medium_1tbkr_66",r6e="_headerRow_1tbkr_70",s6e="_iconWrapper_1tbkr_75",d6e="_headerTitle_1tbkr_80",l6e="_valueArea_1tbkr_89",h6e="_titleWhite_1tbkr_99",u6e="_titleBlack_1tbkr_103",p6e="_valueWhite_1tbkr_108",y6e="_valueBlack_1tbkr_112",k6e="_valueBlue_1tbkr_116",m6e="_bars_1tbkr_121",f6e="_bar_1tbkr_121",g6e="_barDark_1tbkr_135",v6e="_barDim_1tbkr_139",Fe={board:Xme,clickable:Yme,sideBar:Jme,boardContent:Qme,orange:e6e,red:t6e,green:a6e,grey:n6e,lightGrey:o6e,big:c6e,medium:i6e,headerRow:r6e,iconWrapper:s6e,headerTitle:d6e,valueArea:l6e,titleWhite:h6e,titleBlack:u6e,valueWhite:p6e,valueBlack:y6e,valueBlue:k6e,bars:m6e,bar:f6e,barDark:g6e,barDim:v6e},M6e=({endingDark:e=!1,lightCount:t=5,className:n=""})=>{const o=Math.max(0,Math.min(5,Math.floor(t)));return c.jsx("div",{className:`${Fe.bars} ${n} bars-data-board`,children:Array.from({length:5}).map((i,r)=>c.jsx("span",{className:`${Fe.bar} ${r<o?"":e?Fe.barDark:Fe.barDim}`},r))})},bt=({iconName:e,label:t,value:n,backgroundColor:o="green",bars:i,lightBars:r=5,size:s="big",valueScale:d,width:l,height:h,className:u="",style:p,titleColor:y="white",valueColor:m="white",titleFontSize:g,titleFontWeight:f,valueFontSize:M,valueFontWeight:_,barColor:v,justifyContent:I="space-between",alignItems:C="flex-start",cardGap:b="",onClick:w,iconColor:L})=>{const x=i!=="none",S=i==="endingDark",{padding:j,...$}=p||{},q=l===void 0&&h===void 0&&o===void 0&&Object.keys($).length===0?void 0:{...l!==void 0?{width:l}:{},...h!==void 0?{height:h}:{},...o!==void 0?{backgroundColor:o}:{},...$},H=`${Fe.board} ${Fe[s]} ${u}`;return c.jsxs("div",{className:H,onClick:w,style:d!==void 0?{...q,"--ds-value-scale":d}:q,children:[v&&c.jsx("div",{className:Fe.sideBar,style:{backgroundColor:v}}),c.jsxs("div",{className:Fe.boardContent,style:{padding:j,gap:b},children:[c.jsxs("div",{className:Fe.headerRow,style:{justifyContent:I,alignItems:C},children:[e&&c.jsx("div",{className:Fe.iconWrapper,style:{color:L},children:e}),c.jsx("div",{className:`${Fe.headerTitle} header-title-data-board`,children:c.jsx("span",{style:{color:y,...g?{fontSize:g}:{},...f?{fontWeight:f}:{}},children:t})}),x?c.jsx(M6e,{endingDark:S,lightCount:r}):null]}),c.jsx("div",{className:Fe.valueArea,style:{color:m,...M?{fontSize:M}:{},..._?{fontWeight:_}:{}},children:n})]})]})},_6e="_wrapper_1uu3e_10",x6e="_hosp_1uu3e_19",L6e="_headerRow_1uu3e_54",I6e="_iconWrapper_1uu3e_61",b6e="_headerTitle_1uu3e_67",w6e="_hospValue_1uu3e_76",C6e="_side_1uu3e_88",N6e="_mini_1uu3e_100",S6e="_miniLabel_1uu3e_131",j6e="_miniValue_1uu3e_140",$6e="_miniBars_1uu3e_150",q6e="_bars_1uu3e_155",A6e="_bar_1uu3e_155",z6e="_barDark_1uu3e_169",V6e="_barDim_1uu3e_173",Ne={wrapper:_6e,hosp:x6e,headerRow:L6e,iconWrapper:I6e,headerTitle:b6e,hospValue:w6e,side:C6e,mini:N6e,miniLabel:S6e,miniValue:j6e,miniBars:$6e,bars:q6e,bar:A6e,barDark:z6e,barDim:V6e},P6e=({endingDark:e=!1,lightCount:t=5,className:n=""})=>{const o=Math.max(0,Math.min(5,Math.floor(t)));return c.jsx("div",{className:`${Ne.bars} ${n} bars-data-board`,children:Array.from({length:5}).map((i,r)=>c.jsx("span",{className:`${Ne.bar} ${r<o?"":e?Ne.barDark:Ne.barDim}`},r))})},Rq=({left:e,right:t,className:n="",style:o})=>{const i=e.bars??"endingDark",r=i!=="none",s=i==="endingDark";return c.jsxs("div",{className:`${Ne.wrapper} ${n} data-four-boards`,style:o,children:[c.jsxs("div",{className:`${Ne.hosp} ${e.className||""}`,onClick:e.onClick,style:{...e.width?{width:e.width}:{},...e.height?{height:e.height}:{},...e.backgroundColor?{backgroundColor:e.backgroundColor}:{},...e.style||{}},children:[c.jsxs("div",{className:Ne.headerRow,children:[c.jsxs("div",{className:`${Ne.iconWrapper} icon-wrapper-data-four-boards`,children:[e.iconName&&c.jsx("span",{style:{color:e.iconColor},children:e.iconName}),c.jsx("span",{className:Ne.headerTitle,style:{color:e.titleColor||"white",...e.titleFontSize?{fontSize:e.titleFontSize}:{},...e.titleFontWeight?{fontWeight:e.titleFontWeight}:{}},children:e.label})]}),r?c.jsx(P6e,{endingDark:s,lightCount:e.lightBars??5}):null]}),c.jsx("div",{className:Ne.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})]}),c.jsx("div",{className:Ne.side,children:t.map((d,l)=>c.jsxs("div",{className:`${Ne.mini} ${d.className||""} icon-wrapper-data-four-boards`,onClick:d.onClick,style:{...d.width?{width:d.width}:{},...d.height?{height:d.height}:{},...d.backgroundColor?{backgroundColor:d.backgroundColor}:{},...d.style||{}},children:[c.jsxs("span",{className:Ne.miniLabel,style:{color:d.titleColor||"white",textAlign:"right",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",...d.titleFontSize?{fontSize:d.titleFontSize}:{},...d.titleFontWeight?{fontWeight:d.titleFontWeight}:{}},children:[d.iconName&&c.jsx("span",{style:{color:d.iconColor,marginRight:"4px"},children:d.iconName}),d.label]}),c.jsx("span",{className:`${Ne.miniValue} mini-value-data-four-boards`,style:{color:d.valueColor||"white",textAlign:"right",...d.valueScale!==void 0?{"--ds-value-scale":d.valueScale}:{},...d.valueFontSize?{fontSize:d.valueFontSize}:{},...d.valueFontWeight?{fontWeight:d.valueFontWeight}:{}},children:d.value}),c.jsx("div",{className:Ne.miniBars})]},d.id??`${d.label}-${l}`))})]})},T6e=({items:e,footerLabel:t,width:n,height:o,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:o,backgroundColor:d??"var(--ds-navy)",...r},f=e[0],M=e[1],_=e.slice(2,5);return c.jsxs("div",{style:g,className:`${W1.container} ${y?W1.noPaddingMobile:""} ${s}`,children:[c.jsxs("div",{className:W1.card,children:[f?c.jsx(bt,{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,onClick:v=>m?.(0,v)}):null,M&&_.length>0?c.jsx(Rq,{left:{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,onClick:v=>m?.(1,v)},right:_.map((v,I)=>({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,onClick:C=>m?.(2+I,C)}))}):M&&_.length===0?c.jsx(bt,{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&&c.jsx("div",{className:W1.footer,children:t})]})},H6e=({x:e,y:t,width:n,payload:o,fontSize:i,fontWeight:r,stroke:s})=>c.jsx("g",{transform:`translate(${e},${t})`,children:c.jsx("foreignObject",{x:-n,y:-20,width:n,height:40,style:{overflow:"visible"},children:c.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:o.value})})}),D6e=({data:e,height:t=360,barColor:n="#0284C7",tooltipEnabled:o=!0,backgroundColor:i="#ffffff",legendTextColor:r="#000",barHeight:s=100,yAxisWidth:d=240,fontSize:l="12px",fontWeight:h="400",wrapLabels:u=!1})=>c.jsx("div",{style:{backgroundColor:i},children:c.jsx(a.ResponsiveContainer,{width:"100%",height:t,children:c.jsxs(a.BarChart,{data:e,layout:"vertical",children:[c.jsx(a.CartesianGrid,{stroke:"#E5E7EB",vertical:!1}),c.jsx(a.XAxis,{type:"number",axisLine:!1,tickLine:!1,fontSize:l,fontWeight:h,stroke:r}),c.jsx(a.YAxis,{type:"category",dataKey:"label",stroke:r,axisLine:!1,tickLine:!1,width:d,interval:0,fontSize:l,fontWeight:h,tick:u?c.jsx(H6e,{}):void 0}),o&&c.jsx(a.Tooltip,{}),c.jsx(a.Bar,{dataKey:"value",fill:n,radius:0,barSize:s})]})})}),B6e="_menu_10i6j_1",R6e="_menuRow_10i6j_18",F6e="_separator_10i6j_33",E6e="_rowLabel_10i6j_39",O6e="_rowLeadingIcon_10i6j_47",U6e="_rowIcon_10i6j_54",zc={menu:B6e,menuRow:R6e,separator:F6e,rowLabel:E6e,rowLeadingIcon:O6e,rowIcon:U6e},W6e=k.forwardRef(function({isVisible:t,onClose:n,items:o,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 c.jsx("div",{ref:h,role:"menu",className:zc.menu,style:p,children:o.map(y=>{if(y.type==="separator")return c.jsx("hr",{className:zc.separator},y.id);const m=y,g=m.color?{color:m.color}:{},f=m.closeOnClick!==!1;return c.jsxs("button",{role:"menuitem",className:zc.menuRow,style:g,onClick:()=>{m.onClick?.(),f&&n?.()},children:[c.jsxs("span",{className:zc.rowLabel,children:[m.leadingIcon&&c.jsx("span",{className:zc.rowLeadingIcon,children:m.leadingIcon}),c.jsx("span",{children:m.label})]}),m.icon&&c.jsx("span",{className:zc.rowIcon,children:m.icon})]},m.id)})})}),Fq=({user:e,logoutHref:t,logoutTarget:n="_self",onLogout:o,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:I,dropdownMenuOffset:C,statusDotColor:b,style:w,className:L=""})=>{const{user:x}=it(),S=e||x,{currentTheme:j,switchTheme:$}=sL(),q=k.useRef(null),H=k.useRef(null),[P,A]=k.useState(!1),[N,V]=k.useState({}),T=k.useMemo(()=>{const K=[],X=({variant:Ie})=>Ie==="sun"?c.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:c.jsx("circle",{cx:"12",cy:"12",r:"4"})}):c.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:c.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})});i&&(K.push({id:"profile",type:"action",label:"Mon profil",onClick:()=>{typeof window>"u"||(r==="_blank"?window.open(i,"_blank","noopener,noreferrer"):window.location.assign(i))}}),K.push({id:"sep-profile",type:"separator"}));const re=j==="dark";return K.push({id:"theme",type:"action",label:re?"Mode clair":"Mode sombre",icon:c.jsx(X,{variant:re?"sun":"moon"}),onClick:()=>{$(re?"light":"dark")}}),(t||o)&&(K.push({id:"sep-theme",type:"separator"}),K.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}o?.()}})),K},[j,t,n,o,i,r,$]),R=v??T,B=()=>{if(!q.current){A(K=>!K);return}if(!P){const K=q.current.getBoundingClientRect(),X=window.innerWidth,re=window.innerHeight,Ie=200,ke=200,we=4,se=C?.x??0,Me=C?.y??0,je=X-K.right>=Ie+we;V(je?{top:K.bottom-ke+Me,left:K.right+we+se}:{bottom:re-K.top+Me,left:K.left+se})}A(K=>!K)};if(k.useEffect(()=>{if(!P||!q.current)return;const K=()=>{const X=q.current.getBoundingClientRect(),re=window.innerWidth,Ie=window.innerHeight,ke=200,we=200,se=4,Me=C?.x??0,Ve=C?.y??0,ue=re-X.right>=ke+se;V(ue?{top:X.bottom-we+Ve,left:X.right+se+Me}:{bottom:Ie-X.top+Ve,left:X.left+Me})};return window.addEventListener("resize",K),window.addEventListener("orientationchange",K),()=>{window.removeEventListener("resize",K),window.removeEventListener("orientationchange",K)}},[P,C]),k.useEffect(()=>{if(!P||!q.current||!H.current)return;const K=()=>{const re=q.current.getBoundingClientRect(),Ie=H.current.getBoundingClientRect(),ke=C?.x??0,we=C?.y??0;V(se=>se.left!==void 0&&se.top!==void 0&&se.left>=re.right-1?{top:re.bottom-Ie.height+we,left:se.left+ke}:se)},X=requestAnimationFrame(()=>{setTimeout(K,0)});return()=>cancelAnimationFrame(X)},[P,C]),!S)return null;const F=S,J=parseInt(h,10)||40,G=`${J*.375}px`,le=`${J*1.375}px`,ve=`${J*.2}px`,ye=`${J*.6}px`,he=()=>{const K=parseInt(h,10)||40,X=Math.max(8,K*.34375),re=Math.max(2,K*.05);return c.jsxs(c.Fragment,{children:[c.jsxs("div",{style:{position:"relative",flexShrink:0,userSelect:"none"},children:[F.image?c.jsx("img",{src:F.image,alt:`${F.prenom} ${F.nom}`,style:{width:h,height:h,borderRadius:"50%",objectFit:"cover",userSelect:"none"}}):c.jsxs("div",{style:{width:h,height:h,position:"relative",borderRadius:"50%",backgroundColor:_,overflow:"hidden",userSelect:"none"},children:[c.jsx("div",{style:{width:G,height:G,borderRadius:"50%",backgroundColor:M,position:"absolute",top:ve,left:"50%",transform:"translateX(-50%)",zIndex:2,userSelect:"none"}}),c.jsx("div",{style:{width:le,height:le,borderRadius:"50%",backgroundColor:M,position:"absolute",top:ye,left:"50%",transform:"translateX(-50%)",zIndex:1,userSelect:"none"}})]}),b&&c.jsx("div",{style:{position:"absolute",bottom:re,right:re,width:`${X}px`,height:`${X}px`,borderRadius:"50%",backgroundColor:b,border:"2px solid white",zIndex:10}})]}),c.jsxs("div",{style:{display:"flex",flexDirection:"column",minWidth:0,flex:1},children:[c.jsx("span",{style:{fontWeight:m,fontSize:y,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:F.email,children:F.email}),c.jsx("span",{style:{color:l,fontSize:g,fontWeight:f,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:F.role,children:F.role})]})]})};return c.jsxs(c.Fragment,{children:[c.jsx("div",{ref:q,className:`user-info ${L}`,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",...w},onClick:B,role:"button",tabIndex:0,children:c.jsx("div",{style:{display:"flex",alignItems:"center",gap:p,flex:1,minWidth:0},children:c.jsx(he,{})})}),c.jsx(W6e,{ref:H,isVisible:P,onClose:()=>A(!1),items:R,style:I,position:N})]})},G6e="_navItem_16uqf_1",Z6e="_label_16uqf_14",K6e="_icon_16uqf_26",a1={navItem:G6e,label:Z6e,icon:K6e},Ow=({label:e,onClick:t,href:n,isActive:o,icon:i,style:r,className:s="",highlightColor:d="#00aec7",color:l="#333",activeColor:h="#00aec7",highlightBackgroundColor:u="rgba(0, 0, 0, 0.05)",fontSize:p="15px",fontWeight:y="500",sidebarCollapsed:m=!1,padding:g="10px 16px",borderWidth:f="4px",iconGap:M="12px",disabled:_=!1,disabledColor:v})=>{const I=()=>{_||t?.()},C=c.jsxs(c.Fragment,{children:[i&&c.jsx("span",{className:a1.icon,style:{marginRight:m?0:M},children:i}),!m&&c.jsx("span",{className:a1.label,children:e})]}),b=()=>{if(!o)return"transparent";const L=x=>{const S=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(x);return S?{r:parseInt(S[1],16),g:parseInt(S[2],16),b:parseInt(S[3],16)}:null};if(d.startsWith("#")){const x=L(d);if(x)return`rgba(${x.r}, ${x.g}, ${x.b}, 0.08)`}else if(d.startsWith("rgb")){const x=d.match(/\d+/g);if(x&&x.length>=3)return`rgba(${x[0]}, ${x[1]}, ${x[2]}, 0.08)`}return u},w={onClick:I,className:`${a1.navItem} ${o?a1.active:""} ${s} ${_?a1.disabled:""}`,style:{padding:g,color:o?h:_?v||"#999":l,borderLeft:o?`${f} solid ${d}`:`${f} solid transparent`,backgroundColor:b(),fontSize:p,fontWeight:y,cursor:_?"not-allowed":"pointer",textDecoration:"none",...r},"aria-disabled":_};return n&&!_?c.jsx("a",{href:n,...w,children:C}):c.jsx("div",{...w,role:t?"button":void 0,tabIndex:t&&!_?0:void 0,children:C})},X6e="_navbar_agnn2_1",Y6e="_topSection_agnn2_9",J6e="_sectionsContainer_agnn2_14",Q6e="_sectionTitle_agnn2_20",e8e="_sectionItems_agnn2_25",t8e="_bottomSection_agnn2_30",a8e="_versionContainer_agnn2_49",st={navbar:X6e,topSection:Y6e,sectionsContainer:J6e,sectionTitle:Q6e,sectionItems:e8e,bottomSection:t8e,versionContainer:a8e},n8e=({logoProps:e,logoSpacing:t,navItems:n,padding:o="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:I="11px",sectionTitleColor:C="#999",sectionTitleWeight:b="500",versionFontSize:w="12px",versionFontWeight:L="400",versionColor:x="#999",userInfoProps:S,style:j,className:$="",width:q="280px",showLogo:H=!0})=>{const P=it(),A=P.activeNav,N=P.setActiveNav,V=P.user,T=S.user||V;return c.jsxs("div",{className:`${st.navbar} ${$}`,style:{width:q,backgroundColor:s,padding:o,...j},children:[c.jsxs("div",{className:st.topSection,style:{gap:t},children:[H&&c.jsx("div",{className:st.logoContainer,children:c.jsx(rL,{...e})}),c.jsx("div",{className:st.sectionsContainer,style:{gap:i},children:n.map((R,B)=>c.jsxs("div",{className:st.section,children:[R.title&&c.jsx("div",{className:st.sectionTitle,style:{fontSize:I,color:C,padding:v,fontWeight:b,border:"4px solid transparent",...u},children:R.title}),c.jsx("div",{className:st.sectionItems,style:{gap:r},children:R.items.map(F=>c.jsx(Ow,{...F,isActive:F.isActive===null?F.isActive:A===F.id,onClick:()=>{F.onClick&&F.onClick(),F.isActive==null&&N(F.id)},highlightColor:d,activeColor:d,highlightBackgroundColor:l,padding:y,borderWidth:m,iconGap:g,fontSize:f,fontWeight:M,color:_,style:p},F.id))})]},B))})]}),c.jsxs("div",{className:st.bottomSection,style:{gap:t},children:[c.jsx(Fq,{...S,user:T}),h&&c.jsx("div",{className:st.versionContainer,style:{fontSize:w,fontWeight:L,color:x},children:h})]})]})},o8e="_container_4qege_1",c8e="_titleContainer_4qege_10",i8e="_title_4qege_10",r8e="_inlineToggleContainer_4qege_24",s8e="_rightContentContainer_4qege_30",n1={container:o8e,titleContainer:c8e,title:i8e,inlineToggleContainer:r8e,rightContentContainer:s8e},d8e=({className:e="",style:t,fontSize:n="20px",fontWeight:o="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}=it(),_=y.find(I=>I.id===M),v=m(_?_.label:M);return v?c.jsxs("div",{className:`${n1.container} ${e}`,style:{padding:r,margin:s,backgroundColor:d,width:l,height:h,border:u,borderRadius:p,...t},children:[c.jsxs("div",{className:n1.titleContainer,children:[c.jsx("div",{className:n1.title,style:{fontSize:n,fontWeight:o,color:i},children:v}),f&&c.jsx("div",{className:n1.inlineToggleContainer,children:f})]}),g&&c.jsx("div",{className:n1.rightContentContainer,children:g})]}):null},l8e="_navItem_1hg26_1",h8e="_navItemIcon_1hg26_21",u8e="_navItemLabel_1hg26_29",p8e="_navItemCount_1hg26_36",y8e="_navItemIndicator_1hg26_49",o1={navItem:l8e,navItemIcon:h8e,navItemLabel:u8e,navItemCount:p8e,navItemIndicator:y8e},Eq=({label:e,isActive:t,onClick:n,href:o,icon:i,count:r,activeColor:s="#00aec7",inactiveColor:d="#666",activeBackgroundColor:l="transparent",countBackgroundColor:h,countColor:u="#fff",countBorderRadius:p="10px",countPadding:y="2px 6px",countFontSize:m="12px",countFontWeight:g="500",indicatorColor:f="#00aec7",indicatorHeight:M="3px",padding:_="8px 4px",fontSize:v="14px",fontWeight:I="500",gap:C="8px",style:b,className:w="",disabled:L=!1})=>{const x=()=>{L||(n?.(),o&&(window.location.href=o))};return c.jsxs("div",{className:`${o1.navItem} ${w}`,onClick:x,style:{gap:C,padding:_,color:t?s:d,backgroundColor:t?l:"transparent",fontSize:v,fontWeight:I,...b},children:[i&&c.jsx("span",{className:o1.navItemIcon,children:i}),c.jsx("span",{className:o1.navItemLabel,children:e}),r!==void 0&&c.jsx("span",{className:o1.navItemCount,style:{backgroundColor:h,color:u,borderRadius:p,padding:y,fontSize:m,fontWeight:g},children:r}),t&&!L&&c.jsx("div",{className:o1.navItemIndicator,style:{height:M,backgroundColor:f}})]})},k8e="_container_13hsa_1",m8e="_groupHeader_13hsa_8",f8e="_groupHeaderLeft_13hsa_18",g8e="_groupIcon_13hsa_23",v8e="_dropdown_13hsa_29",M8e="_item_13hsa_42",_8e="_itemIcon_13hsa_65",x8e="_chevron_13hsa_72",L8e="_chevronOpen_13hsa_79",dt={container:k8e,groupHeader:m8e,groupHeaderLeft:f8e,groupIcon:g8e,dropdown:v8e,item:M8e,itemIcon:_8e,chevron:x8e,chevronOpen:L8e},I8e=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"})),C1=k.memo(I8e),Oq=({groups:e,activeItemId:t,onItemClick:n,style:o,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:I="var(--color-text)",chevronColor:C="var(--color-text)",iconSize:b=22,headerPadding:w="14px 20px",itemPadding:L="14px 20px",iconGap:x=14,borderRadius:S=0})=>{const[j,$]=k.useState(""),q=k.useRef(null);k.useEffect(()=>{const P=A=>{q.current&&!q.current.contains(A.target)&&$("")};return document.addEventListener("mousedown",P),()=>document.removeEventListener("mousedown",P)},[]);const H={backgroundColor:r,color:s,borderRadius:S,...o};return c.jsx("nav",{ref:q,className:[dt.container,i].filter(Boolean).join(" "),style:H,children:e.map(P=>{const A=j===P.id,N={backgroundColor:d,color:l,padding:w,borderBottom:`1px solid ${h}`,gap:x},V={backgroundColor:u};return c.jsxs("div",{children:[c.jsxs("div",{className:dt.groupHeader,style:N,onClick:()=>$(A?"":P.id),role:"button","aria-expanded":A,children:[c.jsxs("div",{className:dt.groupHeaderLeft,style:{gap:x},children:[P.icon&&c.jsx("span",{className:dt.groupIcon,style:{color:I,width:b,height:b},children:P.icon}),c.jsx("span",{children:P.label})]}),c.jsx("span",{className:[dt.chevron,A?dt.chevronOpen:""].join(" "),style:{color:C},children:c.jsx(C1,{width:18,height:18})})]}),A&&c.jsx("div",{className:dt.dropdown,style:V,children:P.items.map(T=>{const R=T.id===t,B={padding:L,gap:x,color:R?g:m,backgroundColor:p,"--item-border-width":R?"4px":"1px","--item-border-color":R?f:M};return c.jsxs("div",{className:dt.item,style:B,onClick:()=>{n?.(P.id,T.id),$("")},role:"menuitem",onMouseEnter:F=>{R||(F.currentTarget.style.backgroundColor=y)},children:[T.icon&&c.jsx("span",{className:dt.itemIcon,style:{color:R?v:_,width:b,height:b},children:T.icon}),c.jsx("span",{children:T.label})]},T.id)})})]},P.id)})})},b8e="_subheaderContent_1glo8_1",w8e="_navContainer_1glo8_11",C8e="_rightContent_1glo8_45",Nb={subheaderContent:b8e,navContainer:w8e,rightContent:C8e},N8e=({subNavItems:e,backgroundColor:t="transparent",padding:n="0",margin:o,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:I="",style:C,countBackgroundColor:b,countColor:w,countBorderRadius:L,countPadding:x,countFontSize:S,countFontWeight:j,navContainerClassName:$,navContainerStyle:q,rightContentClassName:H,rightContentStyle:P,rightActions:A,activeSwitcherColor:N,inactiveSwitcherColor:V,isMobile:T=!1})=>{const{activeSubNav:R,setActiveSubNav:B,navCounts:F,activeNav:J}=it();if(T){const G=e.find(ve=>ve.id===R)||e[0],le=[{id:"current-group",label:G?.label||J?.toUpperCase()||"MENU",icon:G?.icon,items:e.map(ve=>({id:ve.id,label:ve.label,icon:ve.icon}))}];return c.jsx("div",{className:I,style:C,children:c.jsx(Oq,{groups:le,activeItemId:R,onItemClick:(ve,ye)=>{const he=e.find(K=>K.id===ye);he&&(he.onClick&&he.onClick(),he.href&&(window.location.href=he.href),B(ye))},headerBgColor:t})})}return c.jsxs("div",{className:`${Nb.subheaderContent} ${I}`,style:{backgroundColor:t,padding:n,margin:o,width:i,height:r,border:s,borderBottom:d,...C},children:[c.jsx("div",{className:`${Nb.navContainer} ${$||""}`,style:{gap:l,...q},children:e.map(G=>{const le=G.count!==void 0?G.count:F[G.id],ve=R===G.id||G.isActive;return c.jsx(Eq,{...G,count:le,isActive:ve,onClick:()=>{G.onClick&&G.onClick(),B(G.id)},activeColor:m,inactiveColor:g,countBackgroundColor:b,countColor:w,countBorderRadius:L,countPadding:x,countFontSize:S,countFontWeight:j,indicatorColor:m,indicatorHeight:f,padding:u,fontSize:p,fontWeight:y,gap:"8px",style:G.style},G.id)})}),c.jsxs("div",{className:`${Nb.rightContent} ${H||""}`,style:{gap:h,...P},children:[M&&c.jsx(Yx,{size:20,colors:{bg:N,activeBg:V,icon:"#1C1B1F",icon2:"#FFFFFF"}}),_&&c.jsx(Jx,{size:20,colors:{bg:N,activeBg:V,icon:"#1C1B1F",icon2:"#FFFFFF"}}),v&&c.jsx(Qx,{size:20,colors:{bg:N,activeBg:V,icon:"#1C1B1F",icon2:"#FFFFFF"}}),A]})]})},S8e=({onSwitch:e,size:t="20px",lightIconColor:n="#666",darkIconColor:o="#fff",backgroundColor:i="transparent",padding:r="8px",borderRadius:s="50%",style:d,className:l=""})=>{const[h,u]=k.useState(!1),{currentTheme:p,switchTheme:y}=sL(),m=p!="dark",g=()=>{y(m?"dark":"light"),e?.()};return k.useEffect(()=>{u(!0)},[]),!h||!p?c.jsx(c.Fragment,{}):c.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?c.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:c.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}):c.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:o,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[c.jsx("circle",{cx:"12",cy:"12",r:"5"}),c.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),c.jsx("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),c.jsx("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),c.jsx("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),c.jsx("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),c.jsx("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),c.jsx("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),c.jsx("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]})})},j8e=({initialSortBy:e=null,initialSortOrder:t="asc",onSortChange:n})=>{const[o,i]=k.useState({sortBy:e,sortOrder:t,filters:{}}),r=k.useCallback(s=>{let d="asc";o.sortBy===s&&(d=o.sortOrder==="asc"?"desc":"asc");const l={...o,sortBy:s,sortOrder:d};i(l),n(s,d)},[o,n]);return{tableState:o,handleSort:r}},$8e=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"})),q8e=k.memo($8e),A8e=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"})),z8e=k.memo(A8e),V8e=({columns:e,sortBy:t,sortOrder:n,onSort:o,removeLabelSpan:i=!1})=>c.jsx("thead",{children:c.jsx("tr",{children:e.map((r,s)=>{const d=t===r.key,l=!!r.sortable;return c.jsx("th",{className:`${r.className||""}${l?" sortable":""}`,style:{width:r.width,textAlign:r.align||"left"},onClick:()=>l&&o(String(r.key)),children:c.jsxs("div",{className:`th-content ${r.align?`align-${r.align}`:""}`,children:[i?r.label:c.jsx("span",{children:r.label}),l&&c.jsx("span",{className:"sort-icon-container",style:{display:"inline-flex",alignItems:"center"},children:d&&n==="asc"?c.jsx(z8e,{width:16,height:16,style:{fill:"currentColor",transition:"all 0.2s ease"}}):c.jsx(q8e,{width:16,height:16,style:{fill:"currentColor",opacity:d?1:.5,transition:"all 0.2s ease"}})})]})},String(r.key)||s)})})}),P8e=({data:e,columns:t,rowKey:n,onRowClick:o,isLoading:i,text:r,rowStyle:s,rowClassName:d})=>!e.length&&!i?c.jsx("tbody",{children:c.jsx("tr",{children:c.jsx("td",{colSpan:t.length,style:{textAlign:"center",padding:"32px"},children:c.jsx("span",{style:{color:"var(--table-text-muted)"},children:r?.noData||"Aucune donnée disponible"})})})}):c.jsx("tbody",{children:e.map((l,h)=>{const u=l[n],p=typeof u=="string"||typeof u=="number"?u:h;return c.jsx("tr",{onClick:()=>o&&o(l),style:{cursor:o?"pointer":"default",...s?s(l):{}},className:d?d(l,h):"",children:t.map((y,m)=>c.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)})}),T8e=({state:e,onPaginationChange:t,onLoadMore:n,infiniteScroll:o,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 I=Math.max(y-1,1),C=Math.min(y+1,p),b=I>2,w=C<p-2,L=1,x=p;if(!b&&w)return[...Array.from({length:5},($,q)=>q+1),"...",p];if(b&&!w){const j=Array.from({length:5},($,q)=>p-5+q+1);return[L,"...",...j]}if(b&&w){const S=Array.from({length:C-I+1},(j,$)=>I+$);return[L,"...",...S,"...",x]}return[]},[y,p]);return c.jsxs("div",{className:"table-pagination",children:[c.jsx("div",{className:"pagination-summary",children:h>0?c.jsx("span",{children:r?.itemsRange?r.itemsRange(m,g,h):c.jsxs(c.Fragment,{children:[c.jsxs("b",{children:[m,"–",g]})," ","sur ",c.jsx("b",{children:h.toLocaleString()})," éléments"]})}):c.jsx("span",{children:r?.noResults||"0 résultats"})}),c.jsx("div",{className:"pagination-spacer"}),!o&&l!==-1&&p>1&&c.jsxs("div",{className:"pagination-controls",children:[c.jsx("button",{className:"pagination-btn",onClick:()=>f(1),disabled:y===1,title:r?.first||"Premier",children:"<<"}),c.jsx("button",{className:"pagination-btn",onClick:()=>f(y-1),disabled:y===1,title:r?.previous||"Précédent",children:"<"}),(M||[]).map((_,v)=>_==="..."?c.jsx("span",{style:{padding:"0 4px",color:"var(--table-text-muted)"},children:"..."},v):c.jsx("button",{className:`pagination-btn ${_===y?"active":""}`,onClick:()=>f(_),children:_},v)),c.jsx("button",{className:"pagination-btn",onClick:()=>f(y+1),disabled:y===p,title:r?.next||"Suivant",children:">"}),c.jsx("button",{className:"pagination-btn",onClick:()=>f(p),disabled:y===p,title:r?.last||"Dernier",children:">>"})]}),!o&&n&&i&&c.jsx("div",{className:"pagination-load-more",children:c.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"})})]})},Uq=({data:e,columns:t,isLoading:n,pagination:o,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:I,rowClassName:C,removeLabelSpan:b=!1})=>{const w=k.useMemo(()=>({...p}),[p]),L=k.useRef(null);k.useEffect(()=>{if(!m||!y||!g||n)return;const H=new IntersectionObserver(P=>{P[0].isIntersecting&&y()},{threshold:.1});return L.current&&H.observe(L.current),()=>H.disconnect()},[m,y,g,n]);const{tableState:x,handleSort:S}=j8e({initialSortBy:null,onSortChange:r}),j=(f?.sortBy!==void 0?f.sortBy:x.sortBy)??void 0,$=f?.sortOrder!==void 0?f.sortOrder:x.sortOrder,q=H=>{const P=j,A=$;let N="asc";P===H&&(N=A==="asc"?"desc":"asc"),f?.sortBy!==void 0?r(H,N):S(H)};return c.jsxs("div",{className:`table-container ${M||""}`,style:_,children:[c.jsxs("div",{className:"table-frame",style:{height:h??void 0,minHeight:u??void 0},children:[n&&c.jsx("div",{className:"table-loader-overlay",children:c.jsx("div",{className:"spinner",style:{width:d,height:d,borderTopColor:"var(--table-primary)"}})}),c.jsxs("div",{className:`table-wrapper ${l?"sticky-header":""}`,children:[c.jsxs("table",{className:"data-table",children:[c.jsx(V8e,{columns:t,sortBy:j,sortOrder:$,onSort:q,removeLabelSpan:b}),c.jsx(P8e,{data:e,columns:t.map(H=>({...H,render:H.render?P=>H.render(P,{}):void 0})),rowKey:s,onRowClick:I,isLoading:n,text:w,rowStyle:typeof v=="function"?v:v?()=>v:void 0,rowClassName:C})]}),m&&c.jsx("div",{ref:L,style:{height:20,margin:10}})]})]}),c.jsx(T8e,{state:o,onPaginationChange:i,text:w,onLoadMore:y,infiniteScroll:m,hasMore:g,isLoading:n})]})},H8e="_datePickerContainer_1941b_3",D8e="_label_1941b_16",B8e="_displayNode_1941b_23",R8e="_datePickerButton_1941b_30",F8e="_datePickerButtonDisabled_1941b_50",E8e="_datePickerButtonOpen_1941b_59",O8e="_datePickerLabel_1941b_68",U8e="_placeholder_1941b_79",W8e="_chevron_1941b_83",G8e="_errorMessage_1941b_91",Z8e="_dropdown_1941b_96",K8e="_calendarHeader_1941b_120",X8e="_navButton_1941b_129",Y8e="_headerSelectors_1941b_148",J8e="_monthSelector_1941b_156",Q8e="_yearSelector_1941b_157",efe="_selectorButton_1941b_161",tfe="_selectorChevron_1941b_178",afe="_selectorChevronOpen_1941b_183",nfe="_monthDropdown_1941b_187",ofe="_yearDropdown_1941b_188",cfe="_monthItem_1941b_208",ife="_yearItem_1941b_209",rfe="_monthItemSelected_1941b_231",sfe="_yearItemSelected_1941b_232",dfe="_weekdays_1941b_236",lfe="_weekday_1941b_236",hfe="_calendarGrid_1941b_252",ufe="_dateCell_1941b_260",pfe="_dateCellSelected_1941b_283",yfe="_dateCellOtherMonth_1941b_287",kfe="_dateCellOtherMonthSelected_1941b_291",mfe="_calendarFooter_1941b_295",ffe="_cancelButton_1941b_303",gfe="_applyButton_1941b_304",vfe="_timePickerContainer_1941b_348",Mfe="_timeGroup_1941b_357",_fe="_timeLabel_1941b_364",xfe="_timeInputWrapper_1941b_370",Lfe="_timeInput_1941b_370",Ife="_timeSeparator_1941b_398",E={datePickerContainer:H8e,label:D8e,displayNode:B8e,datePickerButton:R8e,datePickerButtonDisabled:F8e,datePickerButtonOpen:E8e,datePickerLabel:O8e,placeholder:U8e,chevron:W8e,errorMessage:G8e,dropdown:Z8e,calendarHeader:K8e,navButton:X8e,headerSelectors:Y8e,monthSelector:J8e,yearSelector:Q8e,selectorButton:efe,selectorChevron:tfe,selectorChevronOpen:afe,monthDropdown:nfe,yearDropdown:ofe,monthItem:cfe,yearItem:ife,monthItemSelected:rfe,yearItemSelected:sfe,weekdays:dfe,weekday:lfe,calendarGrid:hfe,dateCell:ufe,dateCellSelected:pfe,dateCellOtherMonth:yfe,dateCellOtherMonthSelected:kfe,calendarFooter:mfe,cancelButton:ffe,applyButton:gfe,timePickerContainer:vfe,timeGroup:Mfe,timeLabel:_fe,timeInputWrapper:xfe,timeInput:Lfe,timeSeparator:Ife},oj=["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],bfe=["Lun","Mar","Mer","Jeu","Ven","Sam","Dim"],nw=({value:e,onChange:t,label:n,placeholder:o="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:I,buttonTextColor:C,dropdownBgColor:b="#ffffff",itemHoverColor:w,selectedItemBgColor:L,iconColor:x,errorColor:S,labelColor:j,placeholderColor:$,borderRadius:q="var(--radius-content)",borderWidth:H="0.0625rem",boxShadow:P="0 0.25rem 0.75rem rgba(0, 0, 0, 0.1)",transitionDuration:A="0.2s",transitionTiming:N="ease",dateCellSize:V="2.5rem",headerTextColor:T="#6c757d",weekdayTextColor:R="#6c757d",currentMonthDateColor:B="#212529",otherMonthDateColor:F="#adb5bd",selectedDateBgColor:J="#00A6D9",selectedDateTextColor:G="#ffffff",cancelButtonBgColor:le="#e9ecef",cancelButtonTextColor:ve="#212529",applyButtonBgColor:ye="#00A6D9",applyButtonTextColor:he="#ffffff",width:K,displayNode:X=void 0,displayMode:re="auto",displayNodeAriaLabel:Ie,dropdownPosition:ke="bottom",dropdownAlignment:we="right",dropdownWidth:se,withBorder:Me=!1,icon:Ve,precision:je="day",hoursLabel:ue="Heures",minutesLabel:Ce="Minutes",lowerLimit:rt=null,upperLimit:Jc=null,months:ce,weekdays:Y,cancelText:D1="Annuler",applyText:Kq="Appliquer",prevMonthAriaLabel:Xq="Mois précédent",nextMonthAriaLabel:Yq="Mois suivant",calendarAriaLabel:Jq="Sélecteur de date",openedAriaLabel:Qq="Ouvrir le sélecteur de date",selectedDateAriaLabel:eA="Date sélectionnée: ",locale:Uw="fr-FR"})=>{const At=D=>{if(D instanceof Date)return isNaN(D.getTime())?null:D;if(typeof D=="string"&&D){const W=new Date(D);return isNaN(W.getTime())?null:W}return null},[Ye,zt]=k.useState(!1),[Sc,tA]=k.useState({top:0,left:0,width:0}),[ee,Qc]=k.useState(At(e)||new Date),[_L,xL]=k.useState(At(e)),[LL,IL]=k.useState(At(e)?.getHours()??0),[bL,wL]=k.useState(At(e)?.getMinutes()??0),[CL,jc]=k.useState(!1),[NL,$c]=k.useState(!1),SL=k.useRef(null),B1=k.useRef(null),jL=k.useRef(null),$L=k.useRef(null);k.useEffect(()=>{const D=At(e);xL(D),D&&(Qc(D),IL(D.getHours()),wL(D.getMinutes()))},[e]);const qc=k.useCallback(()=>{if(B1.current){const D=B1.current.getBoundingClientRect();tA({top:D.top,left:D.left,width:D.width})}},[]);k.useEffect(()=>(Ye&&(qc(),window.addEventListener("scroll",qc,!0),window.addEventListener("resize",qc)),()=>{window.removeEventListener("scroll",qc,!0),window.removeEventListener("resize",qc)}),[Ye,qc]),k.useEffect(()=>{const D=W=>{if(SL.current&&!SL.current.contains(W.target)){const fe=document.getElementById("datepicker-dropdown");if(fe&&fe.contains(W.target))return;zt(!1),jc(!1),$c(!1)}jL.current&&!jL.current.contains(W.target)&&jc(!1),$L.current&&!$L.current.contains(W.target)&&$c(!1)};return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[]);const Ww=D=>new Date(D.getFullYear(),D.getMonth()+1,0).getDate(),aA=D=>{const W=new Date(D.getFullYear(),D.getMonth(),1).getDay();return W===0?6:W-1},nA=()=>{const D=[],W=aA(ee),fe=Ww(ee),R1=new Date(ee.getFullYear(),ee.getMonth()-1,1),ft=Ww(R1);for(let Ue=W-1;Ue>=0;Ue--)D.push(new Date(ee.getFullYear(),ee.getMonth()-1,ft-Ue));for(let Ue=1;Ue<=fe;Ue++)D.push(new Date(ee.getFullYear(),ee.getMonth(),Ue));const e1=42-D.length;for(let Ue=1;Ue<=e1;Ue++)D.push(new Date(ee.getFullYear(),ee.getMonth()+1,Ue));return D},oA=(D,W)=>!D||!W?!1:D.getDate()===W.getDate()&&D.getMonth()===W.getMonth()&&D.getFullYear()===W.getFullYear(),cA=D=>D.getMonth()===ee.getMonth()&&D.getFullYear()===ee.getFullYear(),iA=()=>{Qc(new Date(ee.getFullYear(),ee.getMonth()-1,1))},rA=()=>{Qc(new Date(ee.getFullYear(),ee.getMonth()+1,1))},sA=D=>{if(!s){const W=new Date(D);W.setHours(LL),W.setMinutes(bL),xL(W)}},dA=()=>{if(!s){if(_L){const D=new Date(_L);D.setHours(LL),D.setMinutes(bL),t(D)}else t(null);zt(!1)}},lA=()=>{const D=At(e);xL(D),D&&(IL(D.getHours()),wL(D.getMinutes())),zt(!1)},hA=D=>{Qc(new Date(ee.getFullYear(),D,1)),jc(!1)},uA=D=>{Qc(new Date(D,ee.getMonth(),1)),$c(!1)},pA=()=>{const D=ee.getFullYear(),W=[];for(let fe=D-10;fe<=D+10;fe++)W.push(fe);return W},yA=D=>{if(!s)switch(D.key){case"Enter":case" ":D.preventDefault(),zt(!Ye);break;case"Escape":zt(!1),jc(!1),$c(!1);break;case"Tab":Ye&&(zt(!1),jc(!1),$c(!1));break}},kA={width:K||(r?"100%":"auto"),fontSize:p,fontWeight:_},mA={height:l,padding:h,backgroundColor:v||"#ffffff",border:Me?void 0:"none",borderColor:d?S||"#dc3545":I||"#dee2e6",color:C||"#212529",borderRadius:q,borderWidth:H,fontWeight:_,transition:`all ${A} ${N}`},fA={backgroundColor:b||"#ffffff",maxHeight:u,borderRadius:q,borderWidth:H,boxShadow:P,transition:`opacity ${A} ${N}, transform ${A} ${N}`,position:"fixed",top:ke==="bottom"?Sc.top+(B1.current?.offsetHeight||0)+parseFloat(f.replace("rem",""))*16:"auto",bottom:ke==="top"?window.innerHeight-Sc.top+parseFloat(f.replace("rem",""))*16:"auto",left:we==="left"?Sc.left:"auto",right:we==="right"?window.innerWidth-(Sc.left+Sc.width):"auto",width:se||(r?Sc.width:"auto"),zIndex:10001},Gw={width:y,height:y,color:x||"#6c757d","--icon-rotation":Ye?"rotate(180deg)":"rotate(0deg)"},gA={color:j||"#212529",marginBottom:m,fontWeight:_},vA={color:$||"#6c757d"},MA={color:S||"#dc3545",marginTop:g},_A=nA(),Je=At(e),Zw=Je?je==="minutes"?`${Je.toLocaleDateString(Uw)} ${Je.getHours().toString().padStart(2,"0")}:${Je.getMinutes().toString().padStart(2,"0")}`:Je.toLocaleDateString(Uw):"",xA=!!X&&(re==="icon"||re==="auto"&&!Je),LA=Ie||(Je?`${eA}${Zw}`:Qq);return c.jsxs("div",{className:`${E.datePickerContainer} ${i}`,ref:SL,style:kA,"data-fullwidth":r,"data-disabled":s,"data-error":!!d,children:[n&&c.jsx("label",{className:E.label,style:gA,children:n}),c.jsxs("button",{ref:B1,type:"button",onClick:()=>!s&&zt(!Ye),onKeyDown:yA,className:`
|
|
8170
8170
|
${E.datePickerButton}
|
|
8171
8171
|
${Ye?E.datePickerButtonOpen:""}
|
|
8172
8172
|
${s?E.datePickerButtonDisabled:""}
|
|
8173
|
-
`,style:mA,disabled:s,"aria-expanded":Ye,"aria-haspopup":"dialog","aria-label":LA,"aria-labelledby":n?`${n}-label`:void 0,children:[xA?c.jsx("span",{className:E.displayNode,"aria-hidden":!0,children:X}):c.jsx("span",{className:`${E.datePickerLabel} ${Je?"":E.placeholder}`,style:Je?void 0:vA,children:Je?Zw:o}),Ve?c.jsx("span",{className:E.chevron,style:Gw,children:Ve}):c.jsx(C1,{fill:"var(--color-text)",className:`${E.chevron} ${Ye?E.chevronOpen:""}`,style:Gw})]}),d&&c.jsx("div",{className:E.errorMessage,style:MA,children:d}),Ye&&!s&&ow.createPortal(c.jsxs("div",{id:"datepicker-dropdown",className:E.dropdown,style:fA,role:"dialog","aria-label":Jq,children:[c.jsxs("div",{className:E.calendarHeader,children:[c.jsx("button",{type:"button",className:E.navButton,onClick:iA,"aria-label":Xq,children:"‹"}),c.jsxs("div",{className:E.headerSelectors,children:[c.jsxs("div",{className:E.monthSelector,ref:jL,children:[c.jsxs("button",{type:"button",className:E.selectorButton,onClick:()=>jc(!CL),style:{color:T,"--hover-color":w},children:[(ce||oj)[ee.getMonth()],c.jsx(C1,{fill:"var(--color-text)",className:`${E.selectorChevron} ${CL?E.selectorChevronOpen:""}`,style:{width:"0.75rem",height:"0.75rem",marginLeft:"0.25rem"}})]}),CL&&c.jsx("div",{className:E.monthDropdown,children:(ce||oj).map((D,W)=>c.jsx("button",{type:"button",className:`${E.monthItem} ${ee.getMonth()===W?E.monthItemSelected:""}`,onClick:()=>hA(W),style:{padding:M,backgroundColor:ee.getMonth()===W?L||"#e7f1ff":b},onMouseEnter:fe=>{w&&ee.getMonth()!==W&&(fe.currentTarget.style.backgroundColor=w)},onMouseLeave:fe=>{w&&(fe.currentTarget.style.backgroundColor=ee.getMonth()===W?L||"#e7f1ff":b)},children:D},W))})]}),c.jsxs("div",{className:E.yearSelector,ref:$L,children:[c.jsxs("button",{type:"button",className:E.selectorButton,onClick:()=>$c(!NL),style:{color:T,"--hover-color":w},children:[ee.getFullYear(),c.jsx(C1,{fill:"var(--color-text)",className:`${E.selectorChevron} ${NL?E.selectorChevronOpen:""}`,style:{width:"0.75rem",height:"0.75rem",marginLeft:"0.25rem"}})]}),NL&&c.jsx("div",{className:E.yearDropdown,children:pA().map(D=>c.jsx("button",{type:"button",className:`${E.yearItem} ${ee.getFullYear()===D?E.yearItemSelected:""}`,onClick:()=>uA(D),style:{padding:M,backgroundColor:ee.getFullYear()===D?L||"#e7f1ff":b},onMouseEnter:W=>{w&&ee.getFullYear()!==D&&(W.currentTarget.style.backgroundColor=w)},onMouseLeave:W=>{w&&(W.currentTarget.style.backgroundColor=ee.getFullYear()===D?L||"#e7f1ff":b)},children:D},D))})]})]}),c.jsx("button",{type:"button",className:E.navButton,onClick:rA,"aria-label":Yq,children:"›"})]}),c.jsx("div",{className:E.weekdays,children:(Y||
|
|
8173
|
+
`,style:mA,disabled:s,"aria-expanded":Ye,"aria-haspopup":"dialog","aria-label":LA,"aria-labelledby":n?`${n}-label`:void 0,children:[xA?c.jsx("span",{className:E.displayNode,"aria-hidden":!0,children:X}):c.jsx("span",{className:`${E.datePickerLabel} ${Je?"":E.placeholder}`,style:Je?void 0:vA,children:Je?Zw:o}),Ve?c.jsx("span",{className:E.chevron,style:Gw,children:Ve}):c.jsx(C1,{fill:"var(--color-text)",className:`${E.chevron} ${Ye?E.chevronOpen:""}`,style:Gw})]}),d&&c.jsx("div",{className:E.errorMessage,style:MA,children:d}),Ye&&!s&&ow.createPortal(c.jsxs("div",{id:"datepicker-dropdown",className:E.dropdown,style:fA,role:"dialog","aria-label":Jq,children:[c.jsxs("div",{className:E.calendarHeader,children:[c.jsx("button",{type:"button",className:E.navButton,onClick:iA,"aria-label":Xq,children:"‹"}),c.jsxs("div",{className:E.headerSelectors,children:[c.jsxs("div",{className:E.monthSelector,ref:jL,children:[c.jsxs("button",{type:"button",className:E.selectorButton,onClick:()=>jc(!CL),style:{color:T,"--hover-color":w},children:[(ce||oj)[ee.getMonth()],c.jsx(C1,{fill:"var(--color-text)",className:`${E.selectorChevron} ${CL?E.selectorChevronOpen:""}`,style:{width:"0.75rem",height:"0.75rem",marginLeft:"0.25rem"}})]}),CL&&c.jsx("div",{className:E.monthDropdown,children:(ce||oj).map((D,W)=>c.jsx("button",{type:"button",className:`${E.monthItem} ${ee.getMonth()===W?E.monthItemSelected:""}`,onClick:()=>hA(W),style:{padding:M,backgroundColor:ee.getMonth()===W?L||"#e7f1ff":b},onMouseEnter:fe=>{w&&ee.getMonth()!==W&&(fe.currentTarget.style.backgroundColor=w)},onMouseLeave:fe=>{w&&(fe.currentTarget.style.backgroundColor=ee.getMonth()===W?L||"#e7f1ff":b)},children:D},W))})]}),c.jsxs("div",{className:E.yearSelector,ref:$L,children:[c.jsxs("button",{type:"button",className:E.selectorButton,onClick:()=>$c(!NL),style:{color:T,"--hover-color":w},children:[ee.getFullYear(),c.jsx(C1,{fill:"var(--color-text)",className:`${E.selectorChevron} ${NL?E.selectorChevronOpen:""}`,style:{width:"0.75rem",height:"0.75rem",marginLeft:"0.25rem"}})]}),NL&&c.jsx("div",{className:E.yearDropdown,children:pA().map(D=>c.jsx("button",{type:"button",className:`${E.yearItem} ${ee.getFullYear()===D?E.yearItemSelected:""}`,onClick:()=>uA(D),style:{padding:M,backgroundColor:ee.getFullYear()===D?L||"#e7f1ff":b},onMouseEnter:W=>{w&&ee.getFullYear()!==D&&(W.currentTarget.style.backgroundColor=w)},onMouseLeave:W=>{w&&(W.currentTarget.style.backgroundColor=ee.getFullYear()===D?L||"#e7f1ff":b)},children:D},D))})]})]}),c.jsx("button",{type:"button",className:E.navButton,onClick:rA,"aria-label":Yq,children:"›"})]}),c.jsx("div",{className:E.weekdays,children:(Y||bfe).map(D=>c.jsx("div",{className:E.weekday,style:{color:R},children:D},D))}),c.jsx("div",{className:E.calendarGrid,children:_A.map((D,W)=>{if(!D)return null;const fe=oA(D,_L),R1=cA(D),ft=!!(rt&&D<rt||Jc&&D>Jc);return c.jsx("button",{type:"button",className:`${E.dateCell} ${fe?E.dateCellSelected:""} ${fe?E.dateCellOtherMonthSelected:""} ${R1?"":E.dateCellOtherMonth} ${ft?E.dateCellDisabled:""}`,onClick:()=>!ft&&sA(D),disabled:ft,style:{width:V,height:V,color:fe?G:R1?B:F,backgroundColor:fe?J:"transparent",opacity:ft?.4:1,cursor:ft?"not-allowed":"pointer"},onMouseEnter:e1=>{!fe&&!ft&&w&&(e1.currentTarget.style.backgroundColor=w)},onMouseLeave:e1=>{fe||(e1.currentTarget.style.backgroundColor="transparent")},children:D.getDate()},W)})}),je==="minutes"&&c.jsxs("div",{className:E.timePickerContainer,children:[c.jsxs("div",{className:E.timeGroup,children:[c.jsx("span",{className:E.timeLabel,children:ue}),c.jsx("div",{className:E.timeInputWrapper,children:c.jsx("input",{type:"number",min:"0",max:"23",value:LL,onChange:D=>{const W=parseInt(D.target.value);!isNaN(W)&&W>=0&&W<=23&&IL(W)},className:E.timeInput})})]}),c.jsx("span",{className:E.timeSeparator,children:":"}),c.jsxs("div",{className:E.timeGroup,children:[c.jsx("span",{className:E.timeLabel,children:Ce}),c.jsx("div",{className:E.timeInputWrapper,children:c.jsx("input",{type:"number",min:"0",max:"59",value:bL,onChange:D=>{const W=parseInt(D.target.value);!isNaN(W)&&W>=0&&W<=59&&wL(W)},className:E.timeInput})})]})]}),c.jsxs("div",{className:E.calendarFooter,children:[c.jsx("button",{type:"button",className:E.cancelButton,onClick:lA,style:{backgroundColor:le,color:ve,borderRadius:q,padding:M},children:D1}),c.jsx("button",{type:"button",className:E.applyButton,onClick:dA,style:{backgroundColor:ye,color:he,borderRadius:q,padding:M},children:Kq})]})]}),document.body)]})},wfe="_selectContainer_1ptm9_1",Cfe="_label_1ptm9_15",Nfe="_selectButton_1ptm9_23",Sfe="_selectButtonDisabled_1ptm9_43",jfe="_selectButtonOpen_1ptm9_48",$fe="_selectButtonContent_1ptm9_58",qfe="_selectIcon_1ptm9_66",Afe="_selectLabel_1ptm9_72",zfe="_placeholder_1ptm9_79",Vfe="_chevron_1ptm9_84",Pfe="_errorMessage_1ptm9_93",Tfe="_dropdown_1ptm9_99",Hfe="_dropdownContent_1ptm9_123",Dfe="_item_1ptm9_129",Bfe="_itemSelected_1ptm9_151",Rfe="_itemContent_1ptm9_155",Ffe="_itemIcon_1ptm9_162",Efe="_itemLabel_1ptm9_168",ge={selectContainer:wfe,label:Cfe,selectButton:Nfe,selectButtonDisabled:Sfe,selectButtonOpen:jfe,selectButtonContent:$fe,selectIcon:qfe,selectLabel:Afe,placeholder:zfe,chevron:Vfe,errorMessage:Pfe,dropdown:Tfe,dropdownContent:Hfe,item:Dfe,itemSelected:Bfe,itemContent:Rfe,itemIcon:Ffe,itemLabel:Efe},Wq=({items:e,value:t,onChange:n,label:o,placeholder:i="Sélectionner...",className:r="",fullWidth:s=!0,disabled:d=!1,error:l,buttonHeight:h="var(--select-button-height, 2.75rem)",buttonPadding:u="var(--select-button-padding, 0.75rem)",dropdownMaxHeight:p="var(--select-dropdown-max-height, 15rem)",fontSize:y="var(--select-font-size, 0.875rem)",iconSize:m="var(--select-icon-size, 1.5rem)",labelMarginBottom:g="var(--select-label-margin-bottom, 0.5rem)",errorMarginTop:f="var(--select-error-margin-top, 0.25rem)",dropdownMarginTop:M="var(--select-dropdown-margin-top, 0.25rem)",itemPadding:_="var(--select-item-padding, 0.5rem 0.75rem)",gap:v="var(--select-gap, 0.5rem)",buttonBgColor:I,buttonBorderColor:C,buttonTextColor:b,dropdownBgColor:w,itemHoverColor:L,selectedItemBgColor:x,iconColor:S,errorColor:j,labelColor:$,placeholderColor:q,border:H,borderRadius:P="var(--select-border-radius, 0.5rem)",borderWidth:A="var(--select-border-width, 0.0625rem)",boxShadow:N="var(--select-box-shadow, 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1))",transitionDuration:V="var(--select-transition-duration, 0.2s)",transitionTiming:T="var(--select-transition-timing, ease)",scrollbarWidth:R="var(--select-scrollbar-width, 0.375rem)",scrollbarTrackColor:B="var(--select-scrollbar-track-color, #f1f1f1)",scrollbarThumbColor:F="var(--select-scrollbar-thumb-color, #c1c1c1)",width:J,dropdownPosition:G="bottom",dropdownAlignment:le="right",dropdownWidth:ve})=>{const[ye,he]=k.useState(!1),K=k.useRef(null),X=e.find(ce=>ce.value===t);k.useEffect(()=>{const ce=Y=>{K.current&&!K.current.contains(Y.target)&&he(!1)};return document.addEventListener("mousedown",ce),()=>document.removeEventListener("mousedown",ce)},[]);const re=ce=>{d||(n(ce),he(!1))},Ie=ce=>{if(!d)switch(ce.key){case"Enter":case" ":ce.preventDefault(),he(!ye);break;case"Escape":he(!1);break;case"Tab":ye&&he(!1);break}},ke={width:J||(s?"100%":"auto"),fontSize:y},we={height:h,padding:u,backgroundColor:I||"var(--select-button-bg-color, #ffffff)",border:H,borderColor:l?j||"var(--select-error-color, #dc3545)":C||"var(--select-button-border-color, #dee2e6)",color:b||"var(--select-button-text-color, #212529)",borderRadius:P,borderWidth:A,transition:`all ${V} ${T}`},se={backgroundColor:w||"var(--select-dropdown-bg-color, #ffffff)",maxHeight:p,borderRadius:P,borderWidth:A,boxShadow:N,transition:`opacity ${V} ${T}, transform ${V} ${T}`,position:"absolute",top:G==="bottom"?"100%":"auto",bottom:G==="top"?"100%":"auto",left:le==="left"?0:"auto",right:le==="right"?0:"auto",width:ve||(s?"100%":"auto"),marginTop:G==="bottom"?M:0,marginBottom:G==="top"?M:0,zIndex:1001},Me={width:m,height:m,color:S||"var(--select-icon-color, #6c757d)","--icon-rotation":ye?"rotate(180deg)":"rotate(0deg)"},Ve={color:$||"var(--select-label-color, #212529)",marginBottom:g},je={color:q||"var(--select-placeholder-color, #6c757d)"},ue={color:j||"var(--select-error-color, #dc3545)",marginTop:f},Ce={padding:_,transition:`background-color ${V} ${T}`},rt={gap:v},Jc={"--scrollbar-width":R,"--scrollbar-track-color":B,"--scrollbar-thumb-color":F};return c.jsxs("div",{className:`${ge.selectContainer} ${r}`,ref:K,style:ke,"data-fullwidth":s,"data-disabled":d,"data-error":!!l,children:[o&&c.jsx("label",{className:ge.label,style:Ve,children:o}),c.jsxs("button",{type:"button",onClick:()=>!d&&he(!ye),onKeyDown:Ie,className:`
|
|
8174
8174
|
${ge.selectButton}
|
|
8175
8175
|
${ye?ge.selectButtonOpen:""}
|
|
8176
8176
|
${d?ge.selectButtonDisabled:""}
|
|
8177
8177
|
`,style:we,disabled:d,"aria-expanded":ye,"aria-haspopup":"listbox","aria-labelledby":o?`${o}-label`:void 0,children:[c.jsxs("div",{className:ge.selectButtonContent,style:rt,children:[X?.icon&&c.jsx("span",{className:ge.selectIcon,style:Me,children:X.icon}),c.jsx("span",{className:`${ge.selectLabel} ${X?"":ge.placeholder}`,style:X?void 0:je,children:X?X.label:i})]}),c.jsx(C1,{fill:"var(--color-text)",className:`${ge.chevron} ${ye?ge.chevronOpen:""}`,style:Me})]}),l&&c.jsx("div",{className:ge.errorMessage,style:ue,children:l}),ye&&!d&&c.jsx("div",{className:ge.dropdown,style:se,role:"listbox","aria-label":o||"Options de sélection",children:c.jsx("div",{className:ge.dropdownContent,style:Jc,children:e.map(ce=>c.jsx("button",{type:"button",onClick:()=>re(ce.value),className:`
|
|
8178
8178
|
${ge.item}
|
|
8179
8179
|
${t===ce.value?ge.itemSelected:""}
|
|
8180
|
-
`,style:{...Ce,backgroundColor:t===ce.value?x||"#F0F4F6":"transparent"},onMouseEnter:Y=>{L&&(Y.currentTarget.style.backgroundColor=L)},onMouseLeave:Y=>{L&&(Y.currentTarget.style.backgroundColor=t===ce.value?x||"#F0F4F6":"transparent")},role:"option","aria-selected":t===ce.value,children:c.jsxs("div",{className:ge.itemContent,style:rt,children:[ce.icon&&c.jsx("span",{className:ge.itemIcon,style:Me,children:ce.icon}),c.jsx("span",{className:ge.itemLabel,children:ce.label})]})},ce.value))})})]})},Efe="_filterBar_1hlqe_3",Ofe="_label_1hlqe_11",cj={filterBar:Efe,label:Ofe},Ufe=({label:e="Filtres",startDate:t,endDate:n,granularity:o,onStartDateChange:i,onEndDateChange:r,onGranularityChange:s,granularityItems:d,startDatePlaceholder:l="Date début",endDatePlaceholder:h="Date fin",granularityPlaceholder:u="Sélectionner...",className:p="",disabled:y=!1,gap:m="0.75rem",labelFontSize:g="0.875rem",labelFontWeight:f="400",labelColor:M="#212529",labelMarginRight:_="1rem",startDateWidth:v,endDateWidth:I,selectWidth:C,datePickerProps:b={},selectProps:w={},rightContent:L,extraContent:x})=>{const S={fontSize:g,fontWeight:f,color:M,marginRight:_},j={gap:m};return c.jsxs("div",{className:`${cj.filterBar} ${p}`,style:j,children:[e&&c.jsx("span",{className:cj.label,style:S,children:e}),c.jsx(nw,{value:t,onChange:i,placeholder:l,fullWidth:!1,disabled:y,label:void 0,width:v,...b}),c.jsx(nw,{value:n,onChange:r,placeholder:h,fullWidth:!1,disabled:y,label:void 0,width:I,...b}),c.jsx(Wq,{items:d,value:o,onChange:s,placeholder:u,fullWidth:!1,disabled:y,label:void 0,width:C,...w}),x,L&&c.jsx("div",{style:{marginLeft:"auto"},children:L})]})},Wfe="_container_1x6mq_16",Gfe="_disabled_1x6mq_26",Zfe="_predStyle_1x6mq_32",Kfe="_realStyle_1x6mq_36",Xfe="_predGap_1x6mq_40",Yfe="_realGap_1x6mq_44",Jfe="_big_1x6mq_49",Qfe="_medium_1x6mq_53",e7e="_iconWrapper_1x6mq_58",t7e="_predRelative_1x6mq_68",a7e="_realRelative_1x6mq_72",n7e="_iconImg_1x6mq_76",o7e="_content_1x6mq_84",c7e="_header_1x6mq_93",i7e="_predJustify_1x6mq_99",r7e="_realJustify_1x6mq_103",s7e="_predHeaderLineHeight_1x6mq_116",d7e="_realHeaderLineHeight_1x6mq_120",l7e="_title_1x6mq_129",h7e="_titleBlack_1x6mq_144",u7e="_titleWhite_1x6mq_148",p7e="_subtitle_1x6mq_153",y7e="_valueRowHorizontal_1x6mq_163",k7e="_valueRowVertical_1x6mq_171",m7e="_singleValue_1x6mq_180",f7e="_primaryRow_1x6mq_184",g7e="_maxBadge_1x6mq_191",v7e="_valuePrimary_1x6mq_203",M7e="_valuePrimaryBlack_1x6mq_210",_7e="_valuePrimaryWhite_1x6mq_214",x7e="_valueSlash_1x6mq_219",L7e="_valueSecondary_1x6mq_226",I7e="_valueSecondaryBlue_1x6mq_232",b7e="_valueSecondaryWhite_1x6mq_236",w7e="_valueSecondaryBlack_1x6mq_240",C7e="_valueStacked_1x6mq_245",N7e="_stackedTop_1x6mq_254",S7e="_stackedBottom_1x6mq_255",ae={container:Wfe,disabled:Gfe,predStyle:Zfe,realStyle:Kfe,predGap:Xfe,realGap:Yfe,big:Jfe,medium:Qfe,iconWrapper:e7e,predRelative:t7e,realRelative:a7e,iconImg:n7e,content:o7e,header:c7e,predJustify:i7e,realJustify:r7e,predHeaderLineHeight:s7e,realHeaderLineHeight:d7e,title:l7e,titleBlack:h7e,titleWhite:u7e,subtitle:p7e,valueRowHorizontal:y7e,valueRowVertical:k7e,singleValue:m7e,primaryRow:f7e,maxBadge:g7e,valuePrimary:v7e,valuePrimaryBlack:M7e,valuePrimaryWhite:_7e,valueSlash:x7e,valueSecondary:L7e,valueSecondaryBlue:I7e,valueSecondaryWhite:b7e,valueSecondaryBlack:w7e,valueStacked:C7e,stackedTop:N7e,stackedBottom:S7e},j7e=({iconName:e,title:t,subtitle:n,showSubtitle:o,realised:i="-",prediction:r="-",size:s="big",titleColor:d="black",valueColor:l="blue",realValueColor:h,className:u="",style:p="",variant:y="horizontal",showMax:m=!1,titleFontSize:g,titleFontWeight:f,subtitleFontSize:M,subtitleFontWeight:_,primaryFontSize:v,primaryFontWeight:I,secondaryFontSize:C,secondaryFontWeight:b,backgroundColor:w="#f2f9fc",gap:L="",disabled:x=!1,positionRelative:S="",justifyContent:j="",headerLineHeight:$="",headerMinHeight:q="",contentSpace:H=""})=>{const P=o!==void 0?o:!!n,A=`${ae.container} ${ae[s]} ${ae[p]} ${x?ae.disabled:""}`,N=l==="white"?ae.valuePrimaryWhite:ae.valuePrimaryBlack,V=l==="blue"?ae.valueSecondaryBlue:l==="white"?ae.valueSecondaryWhite:ae.valueSecondaryBlack,T=G=>G===void 0?void 0:typeof G=="number"?`${G}px`:G,R=G=>G===void 0?void 0:G,B=y==="vertical",F=r!=null&&r!==""&&r!=="-"&&r!=="—",J=B?ae.valueRowVertical:ae.valueRowHorizontal;return c.jsxs("div",{className:`${A} ${u}`,style:{backgroundColor:w},children:[e&&c.jsx("div",{className:`${ae.iconWrapper} ${ae[S]}`,children:e}),c.jsxs("div",{className:`${ae.content} ${ae[L]} ${F?"":ae.singleValue} content-indicator-v2`,style:{justifyContent:H},children:[c.jsx("div",{className:`${ae.header} ${ae[j]} ${ae[$]} header-indicator-v2`,style:{minHeight:q},children:c.jsx("h6",{className:`${ae.title}`,style:{fontSize:T(g),fontWeight:R(f),color:d},children:t})}),P&&n?c.jsx("div",{className:"subtitle-container",children:c.jsx("span",{className:ae.subtitle,style:{fontSize:T(M),fontWeight:R(_)},children:n})}):null,c.jsxs("div",{className:`${J} count-indicator-v2`,children:[c.jsxs("div",{className:ae.primaryRow,children:[m&&c.jsx("span",{className:`${ae.maxBadge} max-badge-indicator-v2`,children:"MAX"}),c.jsx("span",{className:`${ae.valuePrimary} ${N}`,style:{fontSize:T(v||(!F&&B?"1.75rem":void 0)),fontWeight:R(I),color:h||void 0},children:i})]}),F&&c.jsxs(c.Fragment,{children:[!B&&c.jsx("span",{className:ae.valueSlash,style:{fontSize:T(C),fontWeight:R(b)},children:"/"}),c.jsx("span",{className:`${ae.valueSecondary} ${V}`,style:{fontSize:T(C),fontWeight:R(b)},children:r})]})]})]})]})},$7e="_banner_f10in_2",q7e="_iep_f10in_14",A7e="_groupSmall_f10in_24",z7e="_genre_f10in_34",V7e="_gravite_f10in_42",P7e="_orientationContainer_f10in_48",T7e="_service_f10in_61",H7e="_roomBedContainer_f10in_71",D7e="_room_f10in_71",B7e="_bed_f10in_87",R7e="_bedUf_f10in_92",F7e="_statusContainer_f10in_97",E7e="_status_f10in_97",O7e="_centeredWarn_f10in_124",qe={banner:$7e,iep:q7e,groupSmall:A7e,genre:z7e,gravite:V7e,orientationContainer:P7e,service:T7e,roomBedContainer:H7e,room:D7e,bed:B7e,bedUf:R7e,statusContainer:F7e,status:E7e,centeredWarn:O7e},U7e=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("mask",{id:"a",width:16,height:16,x:0,y:0,maskUnits:"userSpaceOnUse",style:{maskType:"alpha"}},Z.createElement("path",{fill:"#D9D9D9",d:"M0 0h16v16H0z"})),Z.createElement("g",{mask:"url(#a)"},Z.createElement("path",{fill:"#C60000",d:"M.666 14 7.999 1.333 15.333 14zm2.3-1.333h10.067L7.999 4zm5.508-.859a.65.65 0 0 0 .192-.475.65.65 0 0 0-.192-.475.65.65 0 0 0-.475-.191.65.65 0 0 0-.475.191.65.65 0 0 0-.191.475q0 .285.191.475A.65.65 0 0 0 8 12a.65.65 0 0 0 .475-.192M7.333 10h1.333V6.667H7.333z"}))),ij=k.memo(U7e),W7e=({patient:e,genre:t,gravite:n,bed:o,bed_uf:i,room:r,orientation:s,status:d,backgroundColor:l="#ffffff",primaryFontColor:h="#111827",secondaryFontColor:u="#6b7280",statusFontColor:p="#0284c7",statusBackgroundColor:y="#e0f2fe",genreBackgroundColor:m="#9ca3af",genreFontSize:g,style:f,warn:M=!1,warnMessage:_,warnColor:v="#F94134"})=>c.jsxs("div",{className:qe.banner,style:{backgroundColor:l,...f},children:[c.jsxs("div",{className:qe.iep,children:[c.jsx("div",{style:{color:u},children:e.iep??"--"}),c.jsxs("div",{style:{color:h},children:[((e.nom||"").trim().split(/\s+/)[0]||"").substring(0,3).toUpperCase(),"."," ",((e.prenom||"").trim().split(/\s+/)[0]||"").substring(0,3).toLowerCase().replace(/^./,I=>I.toUpperCase()),".(",e.age,")"]})]}),c.jsxs("div",{className:qe.groupSmall,children:[c.jsx("span",{className:`${qe.genre} genre-info-banner`,style:{color:"#ffffff",background:m,fontSize:g},children:t??"--"}),c.jsx("span",{className:`${qe.gravite} gravite-info-banner`,children:n??"--"})]}),c.jsx("div",{className:qe.orientationContainer,children:c.jsx("div",{className:qe.service,style:{color:h},children:s??"--"})}),c.jsxs("div",{className:qe.roomBedContainer,children:[i&&c.jsx("span",{className:qe.bedUf,children:i}),c.jsx("span",{className:qe.room,children:r??"--"}),c.jsx("span",{className:qe.bed,children:o??"--"})]}),c.jsxs("div",{className:qe.statusContainer,children:[d?c.jsx("div",{className:`${qe.status} status-info-banner`,style:{color:p,backgroundColor:y},children:d}):M&&c.jsxs("div",{className:qe.centeredWarn,style:{textTransform:"uppercase"},children:[c.jsx(ij,{color:v,width:20,height:20,style:{marginRight:"6px"}}),c.jsx("span",{style:{color:v,fontSize:"12px",fontWeight:600},children:_})]}),d&&M&&c.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-start",color:v,fontSize:"10px",fontWeight:400,marginTop:"4px",textTransform:"uppercase"},children:[c.jsx(ij,{color:v,width:12,height:12,style:{marginRight:"4px"}}),c.jsx("span",{children:_})]})]})]}),G7e=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:"M200-200v-240h60v180h180v60zm500-320v-180H520v-60h240v240z"})),Z7e=k.memo(G7e),K7e=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:"m249-207-42-42 231-231-231-231 42-42 231 231 231-231 42 42-231 231 231 231-42 42-231-231z"})),Gq=k.memo(K7e),X7e=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:"M440-440v240h-60v-180H200v-60zm140-320v180h180v60H520v-240z"})),Y7e=k.memo(X7e),J7e="_overlay_1grjo_1",Q7e="_container_1grjo_11",ege="_fullscreen_1grjo_24",tge="_header_1grjo_30",age="_headerActions_1grjo_42",nge="_iconButton_1grjo_47",oge="_body_1grjo_58",cge="_sidebar_1grjo_65",ige="_content_1grjo_89",rge="_contentHeader_1grjo_96",sge="_childrenWrapper_1grjo_112",dge="_footer_1grjo_136",lge="_baseButton_1grjo_144",hge="_noOverlay_1grjo_158",uge="_contained_1grjo_166",_e={overlay:J7e,container:Q7e,fullscreen:ege,header:tge,headerActions:age,iconButton:nge,body:oge,sidebar:cge,content:ige,contentHeader:rge,childrenWrapper:sge,footer:dge,baseButton:lge,noOverlay:hge,contained:uge},pge=({headerText:e,headerTextColor:t="var(--color-text)",backgroundColor:n="var(--color-background)",headerFontSize:o="1rem",headerFontWeight:i="600",isOpen:r,onClose:s,leftButton:d,rightButton:l,children:h,contentTitle:u,contentBackgroundColor:p="var(--color-content-background)",sideContent:y,hideMaximize:m=!1,hideHeader:g=!1,hideSidebar:f=!1,onDelete:M,deleteLabel:_="Supprimer",width:v="75%",maxWidth:I="none",height:C="85%",maxHeight:b="85%",borderRadius:w="0.5rem",childrenPadding:L="1rem",overflow:x="auto",contentHeaderAction:S,contentFooterAction:j,hideFooter:$=!1,hideOverlay:q=!1,position:H})=>{const[P,A]=k.useState(!1),N=k.useRef(null);if(k.useEffect(()=>{if(!r||!q)return;const T=R=>{(R.type==="scroll"||R.type==="wheel"||R.type==="touchmove"||N.current&&!N.current.contains(R.target))&&s()};return document.addEventListener("mousedown",T),document.addEventListener("scroll",T,!0),document.addEventListener("wheel",T,{passive:!0,capture:!0}),document.addEventListener("touchmove",T,{passive:!0,capture:!0}),()=>{document.removeEventListener("mousedown",T),document.removeEventListener("scroll",T,!0),document.removeEventListener("wheel",T,!0),document.removeEventListener("touchmove",T,!0)}},[r,q,s]),!r)return null;const V=(T,R=!1)=>c.jsx(Xx,{onClick:T.disabled?void 0:T.onClick,className:_e.baseButton,disabled:T.disabled,style:{background:T.backgroundColor??(R?"#008FBB":"#ffffff"),color:T.textColor??(R?"#ffffff":"#374151"),border:T.borderColor||R?"none":void 0,cursor:T.disabled?T.cursor??"not-allowed":T.cursor??"pointer",filter:T.disabled?T.filter??"grayscale(0.5)":T.filter??"none",opacity:T.disabled?.65:1},children:T.text});return c.jsx("div",{className:q?_e.noOverlay:_e.overlay,onClick:s,children:c.jsxs("div",{ref:N,className:`${_e.container} ${P?_e.fullscreen:""} ${q?_e.contained:""}`,onClick:T=>T.stopPropagation(),style:{width:P?"100%":v,maxWidth:P?"none":I,height:P?"100%":C,maxHeight:P?"100%":b,borderRadius:P?"0":w,overflow:x,...H||{}},children:[!g&&c.jsxs("header",{className:_e.header,style:{backgroundColor:n},children:[c.jsx("h2",{style:{fontSize:o,fontWeight:i,color:t},children:e}),c.jsxs("div",{className:_e.headerActions,children:[!m&&c.jsx("button",{onClick:()=>A(!P),className:_e.iconButton,title:P?"Réduire":"Agrandir",children:P?c.jsx(Y7e,{width:22,height:22,fill:t}):c.jsx(Z7e,{width:22,height:22,fill:t})}),c.jsx("button",{onClick:s,className:_e.iconButton,title:"Fermer",children:c.jsx(Gq,{width:22,height:22,fill:t})})]})]}),c.jsxs("div",{className:_e.body,style:{overflow:x},children:[y&&!f&&c.jsx("aside",{className:_e.sidebar,children:y}),c.jsxs("main",{className:_e.content,style:{backgroundColor:p,overflow:x},children:[u&&c.jsxs("header",{className:_e.contentHeader,style:{backgroundColor:n},children:[c.jsx("span",{style:{color:t},children:u}),S]}),c.jsx("div",{className:_e.childrenWrapper,style:{padding:L,overflow:x},children:h})]})]}),!$&&c.jsxs("footer",{className:_e.footer,style:{backgroundColor:n},children:[M&&c.jsx(Xx,{onClick:M,className:_e.baseButton,style:{background:"#fee2e2",color:"#ef4444",marginRight:"auto",border:"none"},children:_}),j,V(d),V(l,!0)]})]})})},yge="_container_1vb1c_1",kge="_searchWrapper_1vb1c_10",mge="_navItems_1vb1c_17",Sb={container:yge,searchWrapper:kge,navItems:mge},fge=({items:e,activeId:t,activeColor:n="#00aec7",backgroundColor:o="#fff",textColor:i="#000",onItemClick:r,searchValue:s="",onSearchChange:d,searchPlaceholder:l="Rechercher",width:h="100%",className:u=""})=>c.jsxs("div",{className:`${Sb.container} ${u}`,style:{width:h,backgroundColor:o,color:i},children:[c.jsx("div",{className:Sb.searchWrapper,children:c.jsx(Bq,{value:s,onChange:d,placeholder:l,iconPosition:"right",iconColor:"var(--color-text)"})}),c.jsx("div",{className:Sb.navItems,children:e.map(p=>c.jsx(Ow,{id:p.id,label:p.label,icon:p.icon,isActive:t===p.id,onClick:()=>r?.(p.id),activeColor:n,color:i,fontWeight:"600",fontSize:"0.75rem",padding:"0.75rem 1rem",iconGap:"0.5rem"},p.id))})]}),gge=({modules:e,selectedModuleId:t,onSelectModule:n,onAddModule:o,onEditModule:i,onDeleteModule:r,title:s="Modules",addModuleTitle:d="Ajouter un module",addModuleLabel:l="Titre",addModulePlaceholder:h="Nom du module",renameModuleTitle:u="Renommer le module",renameModuleLabel:p="Titre",renameModulePlaceholder:y="Nom du module",confirmText:m="Valider",cancelText:g="Annuler"})=>{const[f,M]=k.useState(!1),[_,v]=k.useState(null),I=()=>M(!0),C=()=>M(!1),b=j=>{const $=j.title?.trim();$&&o&&o($),C()},w=(j,$)=>{j.stopPropagation(),v($)},L=()=>v(null),x=j=>{const $=j.title?.trim();_&&$&&i&&i(_,$),L()},S=(j,$)=>{j.stopPropagation(),r&&r($)};return c.jsxs("div",{className:"module-sidebar-v2",children:[c.jsxs("div",{className:"sidebar-header",children:[c.jsxs("div",{className:"header-title",children:[s," (",e.length,")"]}),c.jsx(Fc,{size:18,className:"add-view-icon",onClick:I})]}),c.jsx("div",{className:"module-list",children:e.map(j=>c.jsxs("div",{className:`module-item ${j.id===t?"selected":""}`,onClick:()=>n&&n(j),children:[j.icon||c.jsx(f1,{size:14,className:"drag-handle"}),c.jsxs("div",{className:"module-content",children:[c.jsx("div",{className:"module-title",children:j.title}),j.subtitle&&c.jsx("div",{className:"module-subtitle",children:j.subtitle})]}),typeof j.count<"u"&&c.jsx("span",{className:"module-count",children:j.count}),c.jsxs("div",{className:"module-actions",children:[c.jsx(ht,{size:12,className:"action-icon edit",onClick:$=>w($,j)}),c.jsx(St,{size:12,className:"action-icon delete",onClick:$=>S($,j)})]})]},j.id))}),c.jsx(Nc,{isOpen:f,onClose:C,onSave:b,title:d,fields:[{name:"title",label:l,placeholder:h}],confirmText:m,cancelText:g}),_&&c.jsx(Nc,{isOpen:!!_,onClose:L,onSave:x,title:u,initialValues:{title:_.title},fields:[{name:"title",label:p,placeholder:y}],confirmText:m,cancelText:g})]})},vge=({keyName:e,translations:t,availableLanguages:n,onChange:o,onRename:i,onDelete:r})=>{const[s,d]=k.useState(!1),[l,h]=k.useState(e),[u,p]=k.useState(null),[y,m]=k.useState(""),[g,f]=k.useState(!1),[M,_]=k.useState(""),[v,I]=k.useState(""),C=k.useMemo(()=>{const A={};return Array.isArray(t)&&t.forEach(N=>{N&&N.language&&(A[N.language.toUpperCase()]=N.value)}),A},[t]),b=k.useMemo(()=>n,[n]),w=()=>{d(!1),l!==e&&l.trim()!==""?i&&i(l.trim()):h(e)},L=A=>{A.key==="Enter"?w():A.key==="Escape"&&(h(e),d(!1))},x=A=>{const N=A.toUpperCase();p(N),m(C[N]||"")},S=()=>{u&&(o(u,y),p(null),m(""))},j=A=>{A.key==="Enter"?S():A.key==="Escape"&&(p(null),m(""))},$=()=>{f(!0),b.length>0&&_(b[0].toUpperCase()),I("")},q=()=>{M&&v.trim()&&(o(M,v.trim()),f(!1),_(""),I(""))},H=()=>{f(!1),_(""),I("")},P=A=>{A.key==="Enter"?q():A.key==="Escape"&&H()};return c.jsxs("div",{className:"translation-key-v2",children:[c.jsxs("div",{className:"header",children:[s?c.jsx("input",{className:"key-name-input",value:l,onChange:A=>h(A.target.value),onBlur:w,onKeyDown:L,autoFocus:!0}):c.jsx("h3",{className:"header-title",children:e}),c.jsxs("div",{className:"header-actions",children:[c.jsx(ht,{size:16,className:"action-icon edit",onClick:()=>d(!0)}),c.jsx(St,{size:16,className:"action-icon delete",onClick:r})]})]}),c.jsxs("div",{className:"translations-list",children:[n.map(A=>{const N=A.toUpperCase(),V=C[N]||"",T=u===N;return c.jsxs("div",{className:"lang-row",children:[c.jsx("div",{className:"lang-label",children:N}),T?c.jsx("input",{className:"translation-input editing",value:y,onChange:R=>m(R.target.value),onBlur:S,onKeyDown:j,placeholder:"Entrez la traduction...",autoFocus:!0}):c.jsx("div",{className:`translation-value ${V?"":"empty"}`,onClick:()=>x(A),title:"Cliquer pour éditer",children:V||"Cliquer pour ajouter..."})]},A)}),g?c.jsxs("div",{className:"lang-row add-row",children:[c.jsx("select",{className:"lang-select",value:M,onChange:A=>_(A.target.value),children:b.map(A=>c.jsx("option",{value:A.toUpperCase(),children:A.toUpperCase()},A))}),c.jsx("input",{className:"translation-input editing",value:v,onChange:A=>I(A.target.value),onKeyDown:P,placeholder:"Mot",autoFocus:!0}),c.jsxs("div",{className:"add-actions",children:[c.jsx(u1,{size:18,className:"action-icon confirm",onClick:q}),c.jsx(Ze,{size:18,className:"action-icon cancel",onClick:H})]})]}):b.length>0&&c.jsxs("button",{className:"add-translation-btn",onClick:$,children:[c.jsx(Oc,{size:16}),c.jsx("span",{children:"Ajouter"})]})]})]})},Mge="_overlay_1jz4r_1",_ge="_modal_1jz4r_15",xge="_body_1jz4r_27",Lge="_footer_1jz4r_46",Ige="_confirmButton_1jz4r_55",bge="_danger_1jz4r_75",wge="_cancelButton_1jz4r_83",vt={overlay:Mge,modal:_ge,body:xge,footer:Lge,confirmButton:Ige,danger:bge,cancelButton:wge},Cge=({isOpen:e,message:t,onConfirm:n,onCancel:o,confirmText:i="Confirmer",cancelText:r="Annuler",isDanger:s=!1,hideFooter:d=!1,secondaryConfirmText:l,onSecondaryConfirm:h})=>e?c.jsx("div",{className:vt.overlay,onClick:o,children:c.jsxs("div",{className:vt.modal,onClick:u=>u.stopPropagation(),children:[c.jsx("div",{className:vt.body,children:typeof t=="string"?c.jsx("p",{children:t}):t}),!d&&c.jsxs("div",{className:vt.footer,children:[c.jsx("button",{className:`${vt.confirmButton} ${s?vt.danger:""}`,onClick:n,children:i}),l&&h&&c.jsx("button",{className:vt.confirmButton,onClick:h,children:l}),c.jsx("button",{className:vt.cancelButton,onClick:o,children:r})]})]})}):null,Nge="_card_1ildr_1",Sge="_topIcon_1ildr_17",jge="_title_1ildr_24",$ge="_text_1ildr_31",qge="_bottomIcon_1ildr_37",c1={card:Nge,topIcon:Sge,title:jge,text:$ge,bottomIcon:qge},Age=({topIcon:e,title:t,text:n,bottomIcon:o,onClick:i,className:r="",headerTextColor:s="#000",textColor:d="#4b5563",backgroundColor:l="#fff"})=>c.jsxs("div",{className:`${c1.card} ${r}`,onClick:i,role:i?"button":void 0,tabIndex:i?0:void 0,style:{backgroundColor:l},children:[e&&c.jsx("div",{className:c1.topIcon,children:e}),c.jsx("h3",{className:c1.title,style:{color:s},children:t}),c.jsx("p",{className:c1.text,style:{color:d},children:n}),o&&c.jsx("div",{className:c1.bottomIcon,children:o})]}),zge="_container_1ry38_1",Vge="_disabled_1ry38_9",Pge="_selectBox_1ry38_14",Tge="_selectBoxOpen_1ry38_36",Hge="_tagsContainer_1ry38_41",Dge="_tag_1ry38_41",Bge="_tagLabel_1ry38_66",Rge="_removeBtnContainer_1ry38_72",Fge="_removeBtn_1ry38_72",Ege="_searchInput_1ry38_97",Oge="_placeholder_1ry38_117",Uge="_actions_1ry38_124",Wge="_clearBtn_1ry38_131",Gge="_chevron_1ry38_153",Zge="_chevronOpen_1ry38_159",Kge="_dropdown_1ry38_163",Xge="_option_1ry38_177",Yge="_noOptions_1ry38_189",Jge="_overflowBlock_1ry38_196",Qge="_overflowEllipsis_1ry38_203",eve="_overflowBadge_1ry38_210",tve="_overflowBadgeWrap_1ry38_233",ave="_overflowDropdown_1ry38_239",nve="_overflowDropdownItem_1ry38_255",ove="_overflowDropdownItemLabel_1ry38_266",cve="_overflowDropdownItemRemove_1ry38_273",Q={container:zge,disabled:Vge,selectBox:Pge,selectBoxOpen:Tge,tagsContainer:Hge,tag:Dge,tagLabel:Bge,removeBtnContainer:Rge,removeBtn:Fge,searchInput:Ege,placeholder:Oge,actions:Uge,clearBtn:Wge,chevron:Gge,chevronOpen:Zge,dropdown:Kge,option:Xge,noOptions:Yge,overflowBlock:Jge,overflowEllipsis:Qge,overflowBadge:eve,overflowBadgeWrap:tve,overflowDropdown:ave,overflowDropdownItem:nve,overflowDropdownItemLabel:ove,overflowDropdownItemRemove:cve},ive=({options:e,noOptionsMessage:t="",value:n,onChange:o,placeholder:i="Sélectionner...",isSearchable:r=!0,className:s="",disabled:d=!1})=>{const[l,h]=k.useState(!1),[u,p]=k.useState(""),y=k.useRef(null),m=k.useRef(null),g=k.useRef(null),f=k.useRef(null),[M,_]=k.useState(null),[v,I]=k.useState(!1),C=k.useRef([]),b=k.useRef(null),w=k.useMemo(()=>{const N=new Map(e.map(V=>[V.value,V]));return n.map(V=>N.get(V)).filter(V=>V!==void 0)},[e,n]),L=k.useMemo(()=>e.filter(N=>!n.includes(N.value)),[e,n]),x=k.useMemo(()=>{let N=L;return u&&(N=N.filter(V=>V.label.toLowerCase().includes(u.toLowerCase()))),N},[L,u]);k.useEffect(()=>{const N=V=>{const T=V.target;y.current&&!y.current.contains(T)&&(h(!1),p(""),_(null),I(!1))};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[]),k.useEffect(()=>{if(w.length===0){_(null),C.current=[];return}w.length>C.current.length&&_(null);const N=()=>{const B=g.current,F=f.current;if(!B||!F)return;const J=F.getBoundingClientRect().width,G=F.querySelector(`.${Q.actions}`),le=G?G.getBoundingClientRect().width:80,ve=56,ye=r?80:0,he=16,K=Array.from(B.querySelectorAll(`.${Q.tag}`));K.length===w.length&&(C.current=K.map(ue=>{const Ce=ue.getBoundingClientRect(),rt=ue.scrollWidth;return Math.max(Ce.width,rt,ue.offsetWidth||0)}));const X=C.current,re=X.length>0?X.reduce((ue,Ce)=>ue+Ce,0)/X.length:120,Ie=w.length<=X.length?X.slice(0,w.length):[...X,...Array(w.length-X.length).fill(re)],ke=4,we=Math.max(0,J-le-ye-he);let se=0,Me=0;for(let ue=0;ue<w.length;ue++){const Ce=Ie[ue]??120;if(se+Ce+ke>we)break;se+=Ce+ke,Me++}if(Me>=w.length){_(null);return}const Ve=Math.max(0,J-ve-le-ye-he);se=0;let je=0;for(let ue=0;ue<w.length;ue++){const Ce=Ie[ue]??120;if(se+Ce+ke>Ve)break;se+=Ce+ke,je++}je<w.length&&je>0?_(je):_(null)},V=requestAnimationFrame(()=>{N()}),T=setTimeout(N,100),R=new ResizeObserver(()=>{N()});return f.current&&R.observe(f.current),()=>{cancelAnimationFrame(V),clearTimeout(T),R.disconnect()}},[w,r,l]);const S=()=>{if(d)return;const N=!l;N&&I(!1),h(N),N&&r&&setTimeout(()=>m.current?.focus(),0)},j=N=>{if(n.includes(N.value))return;I(!1);const V=[...w,N];o(V),p(""),_(null),h(!1)},$=N=>{N.preventDefault(),N.stopPropagation(),I(V=>!V)},q=M!=null&&M<w.length?w.slice(M):[],H=(N,V)=>{V.stopPropagation();const T=w.filter(R=>R.value!==N);o(T)},P=N=>{N.stopPropagation(),o([])},A=N=>{N.stopPropagation(),l||h(!0)};return c.jsxs("div",{className:`${Q.container} ${s} ${d?Q.disabled:""}`,ref:y,children:[c.jsxs("div",{ref:f,className:`${Q.selectBox} ${l?Q.selectBoxOpen:""}`,onClick:S,role:"combobox","aria-expanded":l,"aria-haspopup":"listbox",children:[c.jsxs("div",{className:Q.tagsContainer,ref:g,children:[M!==null&&M>0?w.slice(0,M).map((N,V)=>c.jsxs("div",{className:Q.tag,children:[c.jsx("div",{className:Q.tagLabel,children:c.jsx("span",{children:N.label})}),c.jsx("div",{className:Q.removeBtnContainer,children:c.jsx("button",{type:"button",className:Q.removeBtn,onClick:T=>H(N.value,T),"aria-label":`Supprimer ${N.label}`,children:c.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor",children:c.jsx("path",{d:"M8.5 1.5L1.5 8.5M1.5 1.5L8.5 8.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})})]},`tag-${N.value}-${V}`)):w.map((N,V)=>c.jsxs("div",{className:Q.tag,children:[c.jsx("div",{className:Q.tagLabel,children:c.jsx("span",{children:N.label})}),c.jsx("div",{className:Q.removeBtnContainer,children:c.jsx("button",{type:"button",className:Q.removeBtn,onClick:T=>H(N.value,T),"aria-label":`Supprimer ${N.label}`,children:c.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor",children:c.jsx("path",{d:"M8.5 1.5L1.5 8.5M1.5 1.5L8.5 8.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})})]},`tag-${N.value}-${V}`)),r?c.jsx("input",{ref:m,type:"text",className:Q.searchInput,placeholder:w.length===0?i:"",value:u,onChange:N=>{p(N.target.value),l||h(!0)},onClick:A,disabled:d}):w.length===0&&c.jsx("span",{className:Q.placeholder,children:i})]}),M!==null&&M<w.length&&c.jsxs("div",{className:Q.overflowBlock,children:[c.jsx("span",{className:Q.overflowEllipsis,children:"..."}),c.jsxs("div",{className:Q.overflowBadgeWrap,children:[c.jsx("button",{ref:b,type:"button",className:Q.overflowBadge,onClick:$,"aria-label":`Afficher ${q.length} éléments cachés`,children:q.length}),v&&q.length>0&&c.jsx("div",{className:Q.overflowDropdown,role:"list","aria-label":"Éléments cachés",children:q.map((N,V)=>c.jsxs("div",{className:Q.overflowDropdownItem,children:[c.jsx("span",{className:Q.overflowDropdownItemLabel,children:N.label}),c.jsx("button",{type:"button",className:Q.overflowDropdownItemRemove,onClick:T=>{T.stopPropagation(),H(N.value,T)},"aria-label":`Supprimer ${N.label}`,children:c.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor",children:c.jsx("path",{d:"M8.5 1.5L1.5 8.5M1.5 1.5L8.5 8.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]},`hidden-${N.value}-${V}`))})]})]}),c.jsxs("div",{className:Q.actions,children:[w.length>0&&c.jsx("button",{type:"button",className:Q.clearBtn,onClick:P,"aria-label":"Effacer tout",children:c.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:c.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),c.jsx("svg",{className:`${Q.chevron} ${l?Q.chevronOpen:""}`,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:c.jsx("path",{d:"M6 9l6 6 6-6"})})]})]}),l&&!d&&c.jsx("div",{className:Q.dropdown,role:"listbox",children:x.length>0?x.map((N,V)=>c.jsx("div",{className:Q.option,onClick:()=>j(N),role:"option","aria-selected":!1,children:N.label},`opt-${N.value}-${V}`)):c.jsx("div",{className:Q.noOptions,children:t})})]})},rve="_container_h7jek_1",sve={container:rve},dve=({labels:e=[],data:t=[],selectedUfs:n=[],icons:o=[],lastCardTextColor:i="black",boardColors:r={}})=>{const s=k.useMemo(()=>{const h=n.length===0?t:t.filter(p=>p&&n.includes(String(p.uf).replace(/^0+/,""))),u=new Set;return h.filter(p=>{if(!p||!p.uf)return!1;const y=String(p.uf).replace(/^0+/,"");return u.has(y)?!1:(u.add(y),!0)})},[t,n]),d=k.useMemo(()=>s.reduce((h,u)=>({disponibles:h.disponibles+(u.totalAvailable??u.disponibles??0),homme:h.homme+(u.availableMen??u.disponibleHomme??0),femme:h.femme+(u.availableWomen??u.disponibleFemme??0),indifferencie:h.indifferencie+(u.availableIndifferentSex??u.indifferences??0),sorties:h.sorties+(u.outToday??u.sortie24??0)}),{disponibles:0,homme:0,femme:0,indifferencie:0,sorties:0}),[s]),l=h=>r.disponibles?r.disponibles:h>3?"#35994E":h>=1?"#EF6C00":"#C62828";return c.jsxs("div",{className:sve.container,children:[c.jsx(bt,{label:e[0],value:d.disponibles.toLocaleString("fr-FR"),iconName:o[0],backgroundColor:l(d.disponibles),valueFontSize:"2.5rem",valueFontWeight:"400",bars:"none",justifyContent:"flexStart",alignItems:"center",titleColor:"white",valueColor:"white",titleFontSize:"0.625rem",titleFontWeight:"600",cardGap:"2rem",style:{padding:"0.5rem"}}),c.jsx(bt,{label:e[1],value:d.homme.toLocaleString("fr-FR"),iconName:o[1],backgroundColor:r.homme??"#7DD493",valueFontSize:"2.375rem",valueFontWeight:"400",bars:"none",justifyContent:"flexStart",alignItems:"center",titleColor:"black",valueColor:"black",titleFontSize:"0.625rem",titleFontWeight:"600",cardGap:"2rem",style:{padding:"0.5rem"}}),c.jsx(bt,{label:e[2],value:d.femme.toLocaleString("fr-FR"),iconName:o[2],backgroundColor:r.femme??"#7DD493",valueFontSize:"2.375rem",valueFontWeight:"400",bars:"none",justifyContent:"flexStart",alignItems:"center",titleColor:"black",valueColor:"black",titleFontSize:"0.625rem",titleFontWeight:"600",cardGap:"2rem",style:{padding:"0.5rem"}}),c.jsx(bt,{label:e[3],value:d.indifferencie.toLocaleString("fr-FR"),iconName:o[3],backgroundColor:r.indifferencie??"#7DD493",valueFontSize:"2.375rem",valueFontWeight:"400",bars:"none",justifyContent:"flexStart",alignItems:"center",titleColor:"black",valueColor:"black",titleFontSize:"0.625rem",titleFontWeight:"600",cardGap:"2rem",style:{padding:"0.5rem"}}),c.jsx(bt,{label:e[4],value:d.sorties.toLocaleString("fr-FR"),iconName:o[4],backgroundColor:r.sorties??"#F2F9FC",valueFontSize:"3rem",valueFontWeight:"400",bars:"none",justifyContent:"flexStart",alignItems:"center",titleColor:i,valueColor:i,titleFontSize:"0.625rem",titleFontWeight:"600",cardGap:"2rem",style:{padding:"0.5rem"}})]})},lve=({message:e,icon:t,className:n,style:o,fontSize:i,fontWeight:r,color:s,backgroundColor:d="#f44336",onClick:l})=>c.jsxs("div",{className:n,onClick:l,style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",borderRadius:"6px",backgroundColor:d,color:s,fontSize:i,fontWeight:r,cursor:l?"pointer":"default",...o},children:[t&&c.jsx("span",{style:{display:"flex",alignItems:"center",color:s},children:t}),c.jsx("span",{children:e})]}),hve="_container_1pt6c_1",uve="_chartContainer_1pt6c_14",pve="_legend_1pt6c_22",yve="_legendItem_1pt6c_29",kve="_leftSection_1pt6c_41",mve="_colorIndicator_1pt6c_47",fve="_label_1pt6c_54",gve="_rightSection_1pt6c_60",vve="_ratio_1pt6c_66",Mve="_value1_1pt6c_73",_ve="_separator_1pt6c_78",xve="_value2_1pt6c_82",Lve="_statusIndicator_1pt6c_87",Ive="_inactive_1pt6c_102",Ae={container:hve,chartContainer:uve,legend:pve,legendItem:yve,leftSection:kve,colorIndicator:mve,label:fve,rightSection:gve,ratio:vve,value1:Mve,separator:_ve,value2:xve,statusIndicator:Lve,inactive:Ive},rj=Math.PI/180,bve=({data:e,height:t=400,bg:n,backgroundColor:o,color:i,fontSize:r,fontWeight:s,padding:d,margin:l,borderRadius:h,className:u="",style:p={},labelColor:y,ratioColor:m,separatorColor:g,borderColor:f})=>{const[M,_]=k.useState(new Set(e.map(x=>x.nom))),v=x=>{const S=new Set(M);S.has(x)?S.size>1&&S.delete(x):S.add(x),_(S)},I={...p,"--bg-color":n||o||"transparent","--text-color":i||"inherit","--font-size":r||"14px","--font-weight":s||"400","--padding":d||"0","--margin":l||"0","--border-radius":h||"0","--label-color":y||"inherit","--ratio-color":m||"inherit","--separator-color":g||"#03a9f4","--border-color":f||"#e0e0e0"},C=k.useMemo(()=>e.map(x=>({...x,displayValue:M.has(x.nom)?x.value:0})),[e,M]),b=k.useMemo(()=>e.every(x=>x.value===0),[e]),w=k.useMemo(()=>b?1:C.reduce((x,S)=>x+S.displayValue,0)||1,[b,C]),L=k.useCallback(({cx:x,cy:S,midAngle:j,innerRadius:$,outerRadius:q,value:H})=>{if(H===0||b)return null;const P=$+(q-$)*.5,A=x+P*Math.cos(-j*rj),N=S+P*Math.sin(-j*rj),V=Math.round(H/w*100);return c.jsx(a.Text,{x:A,y:N,fill:"white",textAnchor:"middle",dominantBaseline:"central",fontSize:12,fontWeight:"bold",children:`${V}%`})},[w,b]);return c.jsxs("div",{className:`${Ae.container} ${u}`,style:I,children:[c.jsx("div",{className:Ae.chartContainer,style:{height:t/2+100},children:c.jsx(a.ResponsiveContainer,{width:"100%",height:"100%",children:c.jsx(a.PieChart,{children:c.jsx(a.Pie,{data:b?[{displayValue:1,color:"#A3C2CB"}]:C,cx:"50%",cy:"50%",innerRadius:45,outerRadius:75,paddingAngle:0,dataKey:"displayValue",stroke:"white",strokeWidth:b?0:2,startAngle:90,endAngle:450,labelLine:!1,label:L,isAnimationActive:!1,children:b?c.jsx(a.Cell,{fill:"#A3C2CB"}):C.map((x,S)=>c.jsx(a.Cell,{fill:x.color},`cell-${S}`))})})})}),c.jsx("div",{className:Ae.legend,children:e.map((x,S)=>{const j=M.has(x.nom);return c.jsxs("div",{className:`${Ae.legendItem} ${j?"":Ae.inactive}`,onClick:()=>v(x.nom),style:{cursor:"pointer",transition:"opacity 0.2s"},children:[c.jsxs("div",{className:Ae.leftSection,children:[c.jsx("div",{className:Ae.colorIndicator,style:{backgroundColor:x.color,opacity:j?1:.3}}),c.jsx("span",{className:Ae.label,style:{opacity:j?1:.5},children:x.nom})]}),c.jsxs("div",{className:Ae.rightSection,style:{opacity:j?1:.5},children:[c.jsxs("div",{className:Ae.ratio,children:[c.jsx("span",{className:Ae.value1,children:x.value1}),c.jsx("span",{className:Ae.separator,children:"/"}),c.jsx("span",{className:Ae.value2,children:x.value2})]}),x.statusColor&&c.jsx("div",{className:Ae.statusIndicator,style:{backgroundColor:x.statusColor}})]})]},`legend-${S}`)})})]})},wve="_container_1pc4v_1",Cve="_leftGroup_1pc4v_10",Nve="_iconBtn_1pc4v_16",G1={container:wve,leftGroup:Cve,iconBtn:Nve},Sve=e=>Z.createElement("svg",{width:"1em",height:"1em",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",...e},Z.createElement("path",{d:"M3 12h18M3 6h18M3 18h18"})),jve=k.memo(Sve),$ve=e=>Z.createElement("svg",{width:"1em",height:"1em",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",...e},Z.createElement("path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8m-4-6-4-4-4 4m4-4v13"})),Zq=k.memo($ve),qve=({menuIcon:e,logoProps:t,actionIcon:n,style:o,className:i,bgColor:r="var(--header-bg)",color:s="var(--color-text)",borderBottomColor:d="var(--color-border)",borderBottomWidth:l=1,height:h="8vh",onMenuClick:u,onActionClick:p})=>{const y={backgroundColor:r,color:s,borderBottom:`${l}px solid ${d}`,height:h,...o};return c.jsxs("header",{className:[G1.container,i].filter(Boolean).join(" "),style:y,children:[c.jsxs("div",{className:G1.leftGroup,children:[c.jsx("button",{className:G1.iconBtn,onClick:u,"aria-label":"Menu",style:{color:"inherit"},children:e??c.jsx(jve,{width:22,height:22})}),c.jsx(rL,{...t,size:"medium"})]}),c.jsx("button",{className:G1.iconBtn,onClick:p,"aria-label":"Action",style:{color:"inherit"},children:n??c.jsx(Zq,{width:22,height:22})})]})},Ave="_container_24g3e_1",zve="_iconBtn_24g3e_10",Vve="_title_24g3e_22",Z1={container:Ave,iconBtn:zve,title:Vve},Pve=({title:e="Menu",closeIcon:t,actionIcon:n,style:o,className:i,titleStyle:r,bgColor:s="var(--header-bg)",color:d="var(--color-text)",borderBottomColor:l="transparent",borderBottomWidth:h=0,height:u="8vh",onClose:p,onAction:y})=>{const m={backgroundColor:s,color:d,borderBottom:`${h}px solid ${l}`,height:u,...o};return c.jsxs("div",{className:[Z1.container,i].filter(Boolean).join(" "),style:m,children:[c.jsx("button",{className:Z1.iconBtn,onClick:p,"aria-label":"Fermer",style:{color:"inherit"},children:t??c.jsx(Gq,{width:22,height:22})}),c.jsx("span",{className:Z1.title,style:{fontWeight:"var(--font-weight-h)",fontSize:"var(--h5)",...r},children:e.toUpperCase()}),c.jsx("button",{className:Z1.iconBtn,onClick:y,"aria-label":"Partager",style:{color:"inherit"},children:n??c.jsx(Zq,{width:22,height:22})})]})};exports.PeriodRange=a.PeriodRange;exports.SimpleBarChart=a.SimpleBarChart;exports.ActionCard=Age;exports.AddItemModal=Nc;exports.Alert=Ew;exports.AlertMessage=lve;exports.AlertsProvider=$ke;exports.BadgeList=sj;exports.BadgeRenderer=$q;exports.Button=Xx;exports.ChartContainer=Ske;exports.CheckboxInput=dq;exports.CircularProgress=jb;exports.ColorInput=yq;exports.ComponentVisibilityManager=Ab;exports.ComponentVisibilityToggle=Ume;exports.ConfirmationModal=Cge;exports.ConfirmationPopup=V3e;exports.CounterListBox=v3e;exports.CurrencyRenderer=zq;exports.DashboardSummary=Lme;exports.DataBoard=bt;exports.DataFourBoards=Rq;exports.DateInput=uq;exports.DatePicker=nw;exports.DateRenderer=qq;exports.DayStatCard=e2e;exports.DayStatCardV2=T6e;exports.DonutChartRatio=bve;exports.DraggableProvider=o2e;exports.DraggableSwitcherButton=Yx;exports.DynamicForm=Zye;exports.DynamicInput=kq;exports.EmailRenderer=Sq;exports.Encours=Pme;exports.EntryControl=f3e;exports.FileInput=hq;exports.FilterBar=Ufe;exports.FiltreEtiquette=ive;exports.FlexRowContainer=_3e;exports.Grid=hj;exports.Header=l2e;exports.HorizontalBarChart=H6e;exports.IconText=xj;exports.ImageRenderer=Vq;exports.IndicatorItemV2=j7e;exports.InfoBanner=W7e;exports.InputWrapper=yL;exports.LegendFilterProvider=i2e;exports.LegendFilterSwitcherButton=Jx;exports.LinkRenderer=jq;exports.ListContentContainer=x3e;exports.Logo=rL;exports.MetricsPanel=Hq;exports.MobileMenuHeader=Pve;exports.MobileNavMenu=Oq;exports.MobileTopBar=qve;exports.ModuleHeader=e3e;exports.ModuleSideBar=t3e;exports.ModuleSideBarV2=gge;exports.NavBar=uj;exports.NavBarV2=a8e;exports.NavItem=$b;exports.NavItemV2=Ow;exports.NavProvider=t2e;exports.NumberRenderer=Aq;exports.PeriodSelect=Tke;exports.PopUp=pge;exports.RadioInput=lq;exports.RangeInput=pq;exports.ScrollableHorizontale=Lj;exports.SearchBar=Bq;exports.Select=Wq;exports.SelectFilter=kme;exports.SelectInput=Dw;exports.SettingNavBar=fge;exports.ShowDataProvider=r2e;exports.ShowDataSwitcherButton=Qx;exports.SideComponent=Dke;exports.SimpleListBox=g3e;exports.SubHeaderContent=C8e;exports.SubHeaderNavItem=Eq;exports.SubHeaderTitle=s8e;exports.SubNavBar=h2e;exports.SummaryAvailable=dve;exports.SummaryCard=Tq;exports.Switcher=z1;exports.TableLayout=Uq;exports.TableauDynamique=Pq;exports.TableauDynamiqueSafePagination=V5e;exports.TableauxComponent=Uq;exports.TextInput=rq;exports.TextRenderer=Nq;exports.TextareaInput=sq;exports.ThemeProvider=a2e;exports.ThemeSwitcher=N8e;exports.ThemeSwitcherButton=qb;exports.Title=Eke;exports.TranslationKey=a3e;exports.TranslationKeyV2=vge;exports.TrendItem=Ij;exports.TrendList=iue;exports.TrendListBox=M3e;exports.UserInfo=Fq;exports.alertModels=Ake;exports.getFormSchema=Kye;exports.hexToRgba=Ct;exports.registerRenderer=b5e;exports.tableConfig=aw;exports.useAlerts=qke;exports.useBodyScrollLock=Bke;exports.useConfirmationPopup=P3e;exports.useDraggableSwitcher=mj;exports.useFilters=wq;exports.useLegendFilterSwitcher=gj;exports.useNavigation=it;exports.useShowDataSwitcher=Mj;exports.useTableData=Cq;exports.useThemeContext=yj;exports.useThemeSwitcher=sL;exports.validateField=iL;exports.validateForm=iq;
|
|
8180
|
+
`,style:{...Ce,backgroundColor:t===ce.value?x||"#F0F4F6":"transparent"},onMouseEnter:Y=>{L&&(Y.currentTarget.style.backgroundColor=L)},onMouseLeave:Y=>{L&&(Y.currentTarget.style.backgroundColor=t===ce.value?x||"#F0F4F6":"transparent")},role:"option","aria-selected":t===ce.value,children:c.jsxs("div",{className:ge.itemContent,style:rt,children:[ce.icon&&c.jsx("span",{className:ge.itemIcon,style:Me,children:ce.icon}),c.jsx("span",{className:ge.itemLabel,children:ce.label})]})},ce.value))})})]})},Ofe="_filterBar_1hlqe_3",Ufe="_label_1hlqe_11",cj={filterBar:Ofe,label:Ufe},Wfe=({label:e="Filtres",startDate:t,endDate:n,granularity:o,onStartDateChange:i,onEndDateChange:r,onGranularityChange:s,granularityItems:d,startDatePlaceholder:l="Date début",endDatePlaceholder:h="Date fin",granularityPlaceholder:u="Sélectionner...",className:p="",disabled:y=!1,gap:m="0.75rem",labelFontSize:g="0.875rem",labelFontWeight:f="400",labelColor:M="#212529",labelMarginRight:_="1rem",startDateWidth:v,endDateWidth:I,selectWidth:C,datePickerProps:b={},selectProps:w={},rightContent:L,extraContent:x})=>{const S={fontSize:g,fontWeight:f,color:M,marginRight:_},j={gap:m};return c.jsxs("div",{className:`${cj.filterBar} ${p}`,style:j,children:[e&&c.jsx("span",{className:cj.label,style:S,children:e}),c.jsx(nw,{value:t,onChange:i,placeholder:l,fullWidth:!1,disabled:y,label:void 0,width:v,...b}),c.jsx(nw,{value:n,onChange:r,placeholder:h,fullWidth:!1,disabled:y,label:void 0,width:I,...b}),c.jsx(Wq,{items:d,value:o,onChange:s,placeholder:u,fullWidth:!1,disabled:y,label:void 0,width:C,...w}),x,L&&c.jsx("div",{style:{marginLeft:"auto"},children:L})]})},Gfe="_container_1x6mq_16",Zfe="_disabled_1x6mq_26",Kfe="_predStyle_1x6mq_32",Xfe="_realStyle_1x6mq_36",Yfe="_predGap_1x6mq_40",Jfe="_realGap_1x6mq_44",Qfe="_big_1x6mq_49",e7e="_medium_1x6mq_53",t7e="_iconWrapper_1x6mq_58",a7e="_predRelative_1x6mq_68",n7e="_realRelative_1x6mq_72",o7e="_iconImg_1x6mq_76",c7e="_content_1x6mq_84",i7e="_header_1x6mq_93",r7e="_predJustify_1x6mq_99",s7e="_realJustify_1x6mq_103",d7e="_predHeaderLineHeight_1x6mq_116",l7e="_realHeaderLineHeight_1x6mq_120",h7e="_title_1x6mq_129",u7e="_titleBlack_1x6mq_144",p7e="_titleWhite_1x6mq_148",y7e="_subtitle_1x6mq_153",k7e="_valueRowHorizontal_1x6mq_163",m7e="_valueRowVertical_1x6mq_171",f7e="_singleValue_1x6mq_180",g7e="_primaryRow_1x6mq_184",v7e="_maxBadge_1x6mq_191",M7e="_valuePrimary_1x6mq_203",_7e="_valuePrimaryBlack_1x6mq_210",x7e="_valuePrimaryWhite_1x6mq_214",L7e="_valueSlash_1x6mq_219",I7e="_valueSecondary_1x6mq_226",b7e="_valueSecondaryBlue_1x6mq_232",w7e="_valueSecondaryWhite_1x6mq_236",C7e="_valueSecondaryBlack_1x6mq_240",N7e="_valueStacked_1x6mq_245",S7e="_stackedTop_1x6mq_254",j7e="_stackedBottom_1x6mq_255",ae={container:Gfe,disabled:Zfe,predStyle:Kfe,realStyle:Xfe,predGap:Yfe,realGap:Jfe,big:Qfe,medium:e7e,iconWrapper:t7e,predRelative:a7e,realRelative:n7e,iconImg:o7e,content:c7e,header:i7e,predJustify:r7e,realJustify:s7e,predHeaderLineHeight:d7e,realHeaderLineHeight:l7e,title:h7e,titleBlack:u7e,titleWhite:p7e,subtitle:y7e,valueRowHorizontal:k7e,valueRowVertical:m7e,singleValue:f7e,primaryRow:g7e,maxBadge:v7e,valuePrimary:M7e,valuePrimaryBlack:_7e,valuePrimaryWhite:x7e,valueSlash:L7e,valueSecondary:I7e,valueSecondaryBlue:b7e,valueSecondaryWhite:w7e,valueSecondaryBlack:C7e,valueStacked:N7e,stackedTop:S7e,stackedBottom:j7e},$7e=({iconName:e,title:t,subtitle:n,showSubtitle:o,realised:i="-",prediction:r="-",size:s="big",titleColor:d="black",valueColor:l="blue",realValueColor:h,className:u="",style:p="",variant:y="horizontal",showMax:m=!1,titleFontSize:g,titleFontWeight:f,subtitleFontSize:M,subtitleFontWeight:_,primaryFontSize:v,primaryFontWeight:I,secondaryFontSize:C,secondaryFontWeight:b,backgroundColor:w="#f2f9fc",gap:L="",disabled:x=!1,positionRelative:S="",justifyContent:j="",headerLineHeight:$="",headerMinHeight:q="",contentSpace:H=""})=>{const P=o!==void 0?o:!!n,A=`${ae.container} ${ae[s]} ${ae[p]} ${x?ae.disabled:""}`,N=l==="white"?ae.valuePrimaryWhite:ae.valuePrimaryBlack,V=l==="blue"?ae.valueSecondaryBlue:l==="white"?ae.valueSecondaryWhite:ae.valueSecondaryBlack,T=G=>G===void 0?void 0:typeof G=="number"?`${G}px`:G,R=G=>G===void 0?void 0:G,B=y==="vertical",F=r!=null&&r!==""&&r!=="-"&&r!=="—",J=B?ae.valueRowVertical:ae.valueRowHorizontal;return c.jsxs("div",{className:`${A} ${u}`,style:{backgroundColor:w},children:[e&&c.jsx("div",{className:`${ae.iconWrapper} ${ae[S]}`,children:e}),c.jsxs("div",{className:`${ae.content} ${ae[L]} ${F?"":ae.singleValue} content-indicator-v2`,style:{justifyContent:H},children:[c.jsx("div",{className:`${ae.header} ${ae[j]} ${ae[$]} header-indicator-v2`,style:{minHeight:q},children:c.jsx("h6",{className:`${ae.title}`,style:{fontSize:T(g),fontWeight:R(f),color:d},children:t})}),P&&n?c.jsx("div",{className:"subtitle-container",children:c.jsx("span",{className:ae.subtitle,style:{fontSize:T(M),fontWeight:R(_)},children:n})}):null,c.jsxs("div",{className:`${J} count-indicator-v2`,children:[c.jsxs("div",{className:ae.primaryRow,children:[m&&c.jsx("span",{className:`${ae.maxBadge} max-badge-indicator-v2`,children:"MAX"}),c.jsx("span",{className:`${ae.valuePrimary} ${N}`,style:{fontSize:T(v||(!F&&B?"1.75rem":void 0)),fontWeight:R(I),color:h||void 0},children:i})]}),F&&c.jsxs(c.Fragment,{children:[!B&&c.jsx("span",{className:ae.valueSlash,style:{fontSize:T(C),fontWeight:R(b)},children:"/"}),c.jsx("span",{className:`${ae.valueSecondary} ${V}`,style:{fontSize:T(C),fontWeight:R(b)},children:r})]})]})]})]})},q7e="_banner_f10in_2",A7e="_iep_f10in_14",z7e="_groupSmall_f10in_24",V7e="_genre_f10in_34",P7e="_gravite_f10in_42",T7e="_orientationContainer_f10in_48",H7e="_service_f10in_61",D7e="_roomBedContainer_f10in_71",B7e="_room_f10in_71",R7e="_bed_f10in_87",F7e="_bedUf_f10in_92",E7e="_statusContainer_f10in_97",O7e="_status_f10in_97",U7e="_centeredWarn_f10in_124",qe={banner:q7e,iep:A7e,groupSmall:z7e,genre:V7e,gravite:P7e,orientationContainer:T7e,service:H7e,roomBedContainer:D7e,room:B7e,bed:R7e,bedUf:F7e,statusContainer:E7e,status:O7e,centeredWarn:U7e},W7e=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("mask",{id:"a",width:16,height:16,x:0,y:0,maskUnits:"userSpaceOnUse",style:{maskType:"alpha"}},Z.createElement("path",{fill:"#D9D9D9",d:"M0 0h16v16H0z"})),Z.createElement("g",{mask:"url(#a)"},Z.createElement("path",{fill:"#C60000",d:"M.666 14 7.999 1.333 15.333 14zm2.3-1.333h10.067L7.999 4zm5.508-.859a.65.65 0 0 0 .192-.475.65.65 0 0 0-.192-.475.65.65 0 0 0-.475-.191.65.65 0 0 0-.475.191.65.65 0 0 0-.191.475q0 .285.191.475A.65.65 0 0 0 8 12a.65.65 0 0 0 .475-.192M7.333 10h1.333V6.667H7.333z"}))),ij=k.memo(W7e),G7e=({patient:e,genre:t,gravite:n,bed:o,bed_uf:i,room:r,orientation:s,status:d,backgroundColor:l="#ffffff",primaryFontColor:h="#111827",secondaryFontColor:u="#6b7280",statusFontColor:p="#0284c7",statusBackgroundColor:y="#e0f2fe",genreBackgroundColor:m="#9ca3af",genreFontSize:g,style:f,warn:M=!1,warnMessage:_,warnColor:v="#F94134"})=>c.jsxs("div",{className:qe.banner,style:{backgroundColor:l,...f},children:[c.jsxs("div",{className:qe.iep,children:[c.jsx("div",{style:{color:u},children:e.iep??"--"}),c.jsxs("div",{style:{color:h},children:[((e.nom||"").trim().split(/\s+/)[0]||"").substring(0,3).toUpperCase(),"."," ",((e.prenom||"").trim().split(/\s+/)[0]||"").substring(0,3).toLowerCase().replace(/^./,I=>I.toUpperCase()),".(",e.age,")"]})]}),c.jsxs("div",{className:qe.groupSmall,children:[c.jsx("span",{className:`${qe.genre} genre-info-banner`,style:{color:"#ffffff",background:m,fontSize:g},children:t??"--"}),c.jsx("span",{className:`${qe.gravite} gravite-info-banner`,children:n??"--"})]}),c.jsx("div",{className:qe.orientationContainer,children:c.jsx("div",{className:qe.service,style:{color:h},children:s??"--"})}),c.jsxs("div",{className:qe.roomBedContainer,children:[i&&c.jsx("span",{className:qe.bedUf,children:i}),c.jsx("span",{className:qe.room,children:r??"--"}),c.jsx("span",{className:qe.bed,children:o??"--"})]}),c.jsxs("div",{className:qe.statusContainer,children:[d?c.jsx("div",{className:`${qe.status} status-info-banner`,style:{color:p,backgroundColor:y},children:d}):M&&c.jsxs("div",{className:qe.centeredWarn,style:{textTransform:"uppercase"},children:[c.jsx(ij,{color:v,width:20,height:20,style:{marginRight:"6px"}}),c.jsx("span",{style:{color:v,fontSize:"12px",fontWeight:600},children:_})]}),d&&M&&c.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-start",color:v,fontSize:"10px",fontWeight:400,marginTop:"4px",textTransform:"uppercase"},children:[c.jsx(ij,{color:v,width:12,height:12,style:{marginRight:"4px"}}),c.jsx("span",{children:_})]})]})]}),Z7e=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:"M200-200v-240h60v180h180v60zm500-320v-180H520v-60h240v240z"})),K7e=k.memo(Z7e),X7e=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:"m249-207-42-42 231-231-231-231 42-42 231 231 231-231 42 42-231 231 231 231-42 42-231-231z"})),Gq=k.memo(X7e),Y7e=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:"M440-440v240h-60v-180H200v-60zm140-320v180h180v60H520v-240z"})),J7e=k.memo(Y7e),Q7e="_overlay_1grjo_1",ege="_container_1grjo_11",tge="_fullscreen_1grjo_24",age="_header_1grjo_30",nge="_headerActions_1grjo_42",oge="_iconButton_1grjo_47",cge="_body_1grjo_58",ige="_sidebar_1grjo_65",rge="_content_1grjo_89",sge="_contentHeader_1grjo_96",dge="_childrenWrapper_1grjo_112",lge="_footer_1grjo_136",hge="_baseButton_1grjo_144",uge="_noOverlay_1grjo_158",pge="_contained_1grjo_166",_e={overlay:Q7e,container:ege,fullscreen:tge,header:age,headerActions:nge,iconButton:oge,body:cge,sidebar:ige,content:rge,contentHeader:sge,childrenWrapper:dge,footer:lge,baseButton:hge,noOverlay:uge,contained:pge},yge=({headerText:e,headerTextColor:t="var(--color-text)",backgroundColor:n="var(--color-background)",headerFontSize:o="1rem",headerFontWeight:i="600",isOpen:r,onClose:s,leftButton:d,rightButton:l,children:h,contentTitle:u,contentBackgroundColor:p="var(--color-content-background)",sideContent:y,hideMaximize:m=!1,hideHeader:g=!1,hideSidebar:f=!1,onDelete:M,deleteLabel:_="Supprimer",width:v="75%",maxWidth:I="none",height:C="85%",maxHeight:b="85%",borderRadius:w="0.5rem",childrenPadding:L="1rem",overflow:x="auto",contentHeaderAction:S,contentFooterAction:j,hideFooter:$=!1,hideOverlay:q=!1,position:H})=>{const[P,A]=k.useState(!1),N=k.useRef(null);if(k.useEffect(()=>{if(!r||!q)return;const T=R=>{(R.type==="scroll"||R.type==="wheel"||R.type==="touchmove"||N.current&&!N.current.contains(R.target))&&s()};return document.addEventListener("mousedown",T),document.addEventListener("scroll",T,!0),document.addEventListener("wheel",T,{passive:!0,capture:!0}),document.addEventListener("touchmove",T,{passive:!0,capture:!0}),()=>{document.removeEventListener("mousedown",T),document.removeEventListener("scroll",T,!0),document.removeEventListener("wheel",T,!0),document.removeEventListener("touchmove",T,!0)}},[r,q,s]),!r)return null;const V=(T,R=!1)=>c.jsx(Xx,{onClick:T.disabled?void 0:T.onClick,className:_e.baseButton,disabled:T.disabled,style:{background:T.backgroundColor??(R?"#008FBB":"#ffffff"),color:T.textColor??(R?"#ffffff":"#374151"),border:T.borderColor||R?"none":void 0,cursor:T.disabled?T.cursor??"not-allowed":T.cursor??"pointer",filter:T.disabled?T.filter??"grayscale(0.5)":T.filter??"none",opacity:T.disabled?.65:1},children:T.text});return c.jsx("div",{className:q?_e.noOverlay:_e.overlay,onClick:s,children:c.jsxs("div",{ref:N,className:`${_e.container} ${P?_e.fullscreen:""} ${q?_e.contained:""}`,onClick:T=>T.stopPropagation(),style:{width:P?"100%":v,maxWidth:P?"none":I,height:P?"100%":C,maxHeight:P?"100%":b,borderRadius:P?"0":w,overflow:x,...H||{}},children:[!g&&c.jsxs("header",{className:_e.header,style:{backgroundColor:n},children:[c.jsx("h2",{style:{fontSize:o,fontWeight:i,color:t},children:e}),c.jsxs("div",{className:_e.headerActions,children:[!m&&c.jsx("button",{onClick:()=>A(!P),className:_e.iconButton,title:P?"Réduire":"Agrandir",children:P?c.jsx(J7e,{width:22,height:22,fill:t}):c.jsx(K7e,{width:22,height:22,fill:t})}),c.jsx("button",{onClick:s,className:_e.iconButton,title:"Fermer",children:c.jsx(Gq,{width:22,height:22,fill:t})})]})]}),c.jsxs("div",{className:_e.body,style:{overflow:x},children:[y&&!f&&c.jsx("aside",{className:_e.sidebar,children:y}),c.jsxs("main",{className:_e.content,style:{backgroundColor:p,overflow:x},children:[u&&c.jsxs("header",{className:_e.contentHeader,style:{backgroundColor:n},children:[c.jsx("span",{style:{color:t},children:u}),S]}),c.jsx("div",{className:_e.childrenWrapper,style:{padding:L,overflow:x},children:h})]})]}),!$&&c.jsxs("footer",{className:_e.footer,style:{backgroundColor:n},children:[M&&c.jsx(Xx,{onClick:M,className:_e.baseButton,style:{background:"#fee2e2",color:"#ef4444",marginRight:"auto",border:"none"},children:_}),j,V(d),V(l,!0)]})]})})},kge="_container_1vb1c_1",mge="_searchWrapper_1vb1c_10",fge="_navItems_1vb1c_17",Sb={container:kge,searchWrapper:mge,navItems:fge},gge=({items:e,activeId:t,activeColor:n="#00aec7",backgroundColor:o="#fff",textColor:i="#000",onItemClick:r,searchValue:s="",onSearchChange:d,searchPlaceholder:l="Rechercher",width:h="100%",className:u=""})=>c.jsxs("div",{className:`${Sb.container} ${u}`,style:{width:h,backgroundColor:o,color:i},children:[c.jsx("div",{className:Sb.searchWrapper,children:c.jsx(Bq,{value:s,onChange:d,placeholder:l,iconPosition:"right",iconColor:"var(--color-text)"})}),c.jsx("div",{className:Sb.navItems,children:e.map(p=>c.jsx(Ow,{id:p.id,label:p.label,icon:p.icon,isActive:t===p.id,onClick:()=>r?.(p.id),activeColor:n,color:i,fontWeight:"600",fontSize:"0.75rem",padding:"0.75rem 1rem",iconGap:"0.5rem"},p.id))})]}),vge=({modules:e,selectedModuleId:t,onSelectModule:n,onAddModule:o,onEditModule:i,onDeleteModule:r,title:s="Modules",addModuleTitle:d="Ajouter un module",addModuleLabel:l="Titre",addModulePlaceholder:h="Nom du module",renameModuleTitle:u="Renommer le module",renameModuleLabel:p="Titre",renameModulePlaceholder:y="Nom du module",confirmText:m="Valider",cancelText:g="Annuler"})=>{const[f,M]=k.useState(!1),[_,v]=k.useState(null),I=()=>M(!0),C=()=>M(!1),b=j=>{const $=j.title?.trim();$&&o&&o($),C()},w=(j,$)=>{j.stopPropagation(),v($)},L=()=>v(null),x=j=>{const $=j.title?.trim();_&&$&&i&&i(_,$),L()},S=(j,$)=>{j.stopPropagation(),r&&r($)};return c.jsxs("div",{className:"module-sidebar-v2",children:[c.jsxs("div",{className:"sidebar-header",children:[c.jsxs("div",{className:"header-title",children:[s," (",e.length,")"]}),c.jsx(Fc,{size:18,className:"add-view-icon",onClick:I})]}),c.jsx("div",{className:"module-list",children:e.map(j=>c.jsxs("div",{className:`module-item ${j.id===t?"selected":""}`,onClick:()=>n&&n(j),children:[j.icon||c.jsx(f1,{size:14,className:"drag-handle"}),c.jsxs("div",{className:"module-content",children:[c.jsx("div",{className:"module-title",children:j.title}),j.subtitle&&c.jsx("div",{className:"module-subtitle",children:j.subtitle})]}),typeof j.count<"u"&&c.jsx("span",{className:"module-count",children:j.count}),c.jsxs("div",{className:"module-actions",children:[c.jsx(ht,{size:12,className:"action-icon edit",onClick:$=>w($,j)}),c.jsx(St,{size:12,className:"action-icon delete",onClick:$=>S($,j)})]})]},j.id))}),c.jsx(Nc,{isOpen:f,onClose:C,onSave:b,title:d,fields:[{name:"title",label:l,placeholder:h}],confirmText:m,cancelText:g}),_&&c.jsx(Nc,{isOpen:!!_,onClose:L,onSave:x,title:u,initialValues:{title:_.title},fields:[{name:"title",label:p,placeholder:y}],confirmText:m,cancelText:g})]})},Mge=({keyName:e,translations:t,availableLanguages:n,onChange:o,onRename:i,onDelete:r})=>{const[s,d]=k.useState(!1),[l,h]=k.useState(e),[u,p]=k.useState(null),[y,m]=k.useState(""),[g,f]=k.useState(!1),[M,_]=k.useState(""),[v,I]=k.useState(""),C=k.useMemo(()=>{const A={};return Array.isArray(t)&&t.forEach(N=>{N&&N.language&&(A[N.language.toUpperCase()]=N.value)}),A},[t]),b=k.useMemo(()=>n,[n]),w=()=>{d(!1),l!==e&&l.trim()!==""?i&&i(l.trim()):h(e)},L=A=>{A.key==="Enter"?w():A.key==="Escape"&&(h(e),d(!1))},x=A=>{const N=A.toUpperCase();p(N),m(C[N]||"")},S=()=>{u&&(o(u,y),p(null),m(""))},j=A=>{A.key==="Enter"?S():A.key==="Escape"&&(p(null),m(""))},$=()=>{f(!0),b.length>0&&_(b[0].toUpperCase()),I("")},q=()=>{M&&v.trim()&&(o(M,v.trim()),f(!1),_(""),I(""))},H=()=>{f(!1),_(""),I("")},P=A=>{A.key==="Enter"?q():A.key==="Escape"&&H()};return c.jsxs("div",{className:"translation-key-v2",children:[c.jsxs("div",{className:"header",children:[s?c.jsx("input",{className:"key-name-input",value:l,onChange:A=>h(A.target.value),onBlur:w,onKeyDown:L,autoFocus:!0}):c.jsx("h3",{className:"header-title",children:e}),c.jsxs("div",{className:"header-actions",children:[c.jsx(ht,{size:16,className:"action-icon edit",onClick:()=>d(!0)}),c.jsx(St,{size:16,className:"action-icon delete",onClick:r})]})]}),c.jsxs("div",{className:"translations-list",children:[n.map(A=>{const N=A.toUpperCase(),V=C[N]||"",T=u===N;return c.jsxs("div",{className:"lang-row",children:[c.jsx("div",{className:"lang-label",children:N}),T?c.jsx("input",{className:"translation-input editing",value:y,onChange:R=>m(R.target.value),onBlur:S,onKeyDown:j,placeholder:"Entrez la traduction...",autoFocus:!0}):c.jsx("div",{className:`translation-value ${V?"":"empty"}`,onClick:()=>x(A),title:"Cliquer pour éditer",children:V||"Cliquer pour ajouter..."})]},A)}),g?c.jsxs("div",{className:"lang-row add-row",children:[c.jsx("select",{className:"lang-select",value:M,onChange:A=>_(A.target.value),children:b.map(A=>c.jsx("option",{value:A.toUpperCase(),children:A.toUpperCase()},A))}),c.jsx("input",{className:"translation-input editing",value:v,onChange:A=>I(A.target.value),onKeyDown:P,placeholder:"Mot",autoFocus:!0}),c.jsxs("div",{className:"add-actions",children:[c.jsx(u1,{size:18,className:"action-icon confirm",onClick:q}),c.jsx(Ze,{size:18,className:"action-icon cancel",onClick:H})]})]}):b.length>0&&c.jsxs("button",{className:"add-translation-btn",onClick:$,children:[c.jsx(Oc,{size:16}),c.jsx("span",{children:"Ajouter"})]})]})]})},_ge="_overlay_1jz4r_1",xge="_modal_1jz4r_15",Lge="_body_1jz4r_27",Ige="_footer_1jz4r_46",bge="_confirmButton_1jz4r_55",wge="_danger_1jz4r_75",Cge="_cancelButton_1jz4r_83",vt={overlay:_ge,modal:xge,body:Lge,footer:Ige,confirmButton:bge,danger:wge,cancelButton:Cge},Nge=({isOpen:e,message:t,onConfirm:n,onCancel:o,confirmText:i="Confirmer",cancelText:r="Annuler",isDanger:s=!1,hideFooter:d=!1,secondaryConfirmText:l,onSecondaryConfirm:h})=>e?c.jsx("div",{className:vt.overlay,onClick:o,children:c.jsxs("div",{className:vt.modal,onClick:u=>u.stopPropagation(),children:[c.jsx("div",{className:vt.body,children:typeof t=="string"?c.jsx("p",{children:t}):t}),!d&&c.jsxs("div",{className:vt.footer,children:[c.jsx("button",{className:`${vt.confirmButton} ${s?vt.danger:""}`,onClick:n,children:i}),l&&h&&c.jsx("button",{className:vt.confirmButton,onClick:h,children:l}),c.jsx("button",{className:vt.cancelButton,onClick:o,children:r})]})]})}):null,Sge="_card_1ildr_1",jge="_topIcon_1ildr_17",$ge="_title_1ildr_24",qge="_text_1ildr_31",Age="_bottomIcon_1ildr_37",c1={card:Sge,topIcon:jge,title:$ge,text:qge,bottomIcon:Age},zge=({topIcon:e,title:t,text:n,bottomIcon:o,onClick:i,className:r="",headerTextColor:s="#000",textColor:d="#4b5563",backgroundColor:l="#fff"})=>c.jsxs("div",{className:`${c1.card} ${r}`,onClick:i,role:i?"button":void 0,tabIndex:i?0:void 0,style:{backgroundColor:l},children:[e&&c.jsx("div",{className:c1.topIcon,children:e}),c.jsx("h3",{className:c1.title,style:{color:s},children:t}),c.jsx("p",{className:c1.text,style:{color:d},children:n}),o&&c.jsx("div",{className:c1.bottomIcon,children:o})]}),Vge="_container_1ry38_1",Pge="_disabled_1ry38_9",Tge="_selectBox_1ry38_14",Hge="_selectBoxOpen_1ry38_36",Dge="_tagsContainer_1ry38_41",Bge="_tag_1ry38_41",Rge="_tagLabel_1ry38_66",Fge="_removeBtnContainer_1ry38_72",Ege="_removeBtn_1ry38_72",Oge="_searchInput_1ry38_97",Uge="_placeholder_1ry38_117",Wge="_actions_1ry38_124",Gge="_clearBtn_1ry38_131",Zge="_chevron_1ry38_153",Kge="_chevronOpen_1ry38_159",Xge="_dropdown_1ry38_163",Yge="_option_1ry38_177",Jge="_noOptions_1ry38_189",Qge="_overflowBlock_1ry38_196",eve="_overflowEllipsis_1ry38_203",tve="_overflowBadge_1ry38_210",ave="_overflowBadgeWrap_1ry38_233",nve="_overflowDropdown_1ry38_239",ove="_overflowDropdownItem_1ry38_255",cve="_overflowDropdownItemLabel_1ry38_266",ive="_overflowDropdownItemRemove_1ry38_273",Q={container:Vge,disabled:Pge,selectBox:Tge,selectBoxOpen:Hge,tagsContainer:Dge,tag:Bge,tagLabel:Rge,removeBtnContainer:Fge,removeBtn:Ege,searchInput:Oge,placeholder:Uge,actions:Wge,clearBtn:Gge,chevron:Zge,chevronOpen:Kge,dropdown:Xge,option:Yge,noOptions:Jge,overflowBlock:Qge,overflowEllipsis:eve,overflowBadge:tve,overflowBadgeWrap:ave,overflowDropdown:nve,overflowDropdownItem:ove,overflowDropdownItemLabel:cve,overflowDropdownItemRemove:ive},rve=({options:e,noOptionsMessage:t="",value:n,onChange:o,placeholder:i="Sélectionner...",isSearchable:r=!0,className:s="",disabled:d=!1})=>{const[l,h]=k.useState(!1),[u,p]=k.useState(""),y=k.useRef(null),m=k.useRef(null),g=k.useRef(null),f=k.useRef(null),[M,_]=k.useState(null),[v,I]=k.useState(!1),C=k.useRef([]),b=k.useRef(null),w=k.useMemo(()=>{const N=new Map(e.map(V=>[V.value,V]));return n.map(V=>N.get(V)).filter(V=>V!==void 0)},[e,n]),L=k.useMemo(()=>e.filter(N=>!n.includes(N.value)),[e,n]),x=k.useMemo(()=>{let N=L;return u&&(N=N.filter(V=>V.label.toLowerCase().includes(u.toLowerCase()))),N},[L,u]);k.useEffect(()=>{const N=V=>{const T=V.target;y.current&&!y.current.contains(T)&&(h(!1),p(""),_(null),I(!1))};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[]),k.useEffect(()=>{if(w.length===0){_(null),C.current=[];return}w.length>C.current.length&&_(null);const N=()=>{const B=g.current,F=f.current;if(!B||!F)return;const J=F.getBoundingClientRect().width,G=F.querySelector(`.${Q.actions}`),le=G?G.getBoundingClientRect().width:80,ve=56,ye=r?80:0,he=16,K=Array.from(B.querySelectorAll(`.${Q.tag}`));K.length===w.length&&(C.current=K.map(ue=>{const Ce=ue.getBoundingClientRect(),rt=ue.scrollWidth;return Math.max(Ce.width,rt,ue.offsetWidth||0)}));const X=C.current,re=X.length>0?X.reduce((ue,Ce)=>ue+Ce,0)/X.length:120,Ie=w.length<=X.length?X.slice(0,w.length):[...X,...Array(w.length-X.length).fill(re)],ke=4,we=Math.max(0,J-le-ye-he);let se=0,Me=0;for(let ue=0;ue<w.length;ue++){const Ce=Ie[ue]??120;if(se+Ce+ke>we)break;se+=Ce+ke,Me++}if(Me>=w.length){_(null);return}const Ve=Math.max(0,J-ve-le-ye-he);se=0;let je=0;for(let ue=0;ue<w.length;ue++){const Ce=Ie[ue]??120;if(se+Ce+ke>Ve)break;se+=Ce+ke,je++}je<w.length&&je>0?_(je):_(null)},V=requestAnimationFrame(()=>{N()}),T=setTimeout(N,100),R=new ResizeObserver(()=>{N()});return f.current&&R.observe(f.current),()=>{cancelAnimationFrame(V),clearTimeout(T),R.disconnect()}},[w,r,l]);const S=()=>{if(d)return;const N=!l;N&&I(!1),h(N),N&&r&&setTimeout(()=>m.current?.focus(),0)},j=N=>{if(n.includes(N.value))return;I(!1);const V=[...w,N];o(V),p(""),_(null),h(!1)},$=N=>{N.preventDefault(),N.stopPropagation(),I(V=>!V)},q=M!=null&&M<w.length?w.slice(M):[],H=(N,V)=>{V.stopPropagation();const T=w.filter(R=>R.value!==N);o(T)},P=N=>{N.stopPropagation(),o([])},A=N=>{N.stopPropagation(),l||h(!0)};return c.jsxs("div",{className:`${Q.container} ${s} ${d?Q.disabled:""}`,ref:y,children:[c.jsxs("div",{ref:f,className:`${Q.selectBox} ${l?Q.selectBoxOpen:""}`,onClick:S,role:"combobox","aria-expanded":l,"aria-haspopup":"listbox",children:[c.jsxs("div",{className:Q.tagsContainer,ref:g,children:[M!==null&&M>0?w.slice(0,M).map((N,V)=>c.jsxs("div",{className:Q.tag,children:[c.jsx("div",{className:Q.tagLabel,children:c.jsx("span",{children:N.label})}),c.jsx("div",{className:Q.removeBtnContainer,children:c.jsx("button",{type:"button",className:Q.removeBtn,onClick:T=>H(N.value,T),"aria-label":`Supprimer ${N.label}`,children:c.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor",children:c.jsx("path",{d:"M8.5 1.5L1.5 8.5M1.5 1.5L8.5 8.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})})]},`tag-${N.value}-${V}`)):w.map((N,V)=>c.jsxs("div",{className:Q.tag,children:[c.jsx("div",{className:Q.tagLabel,children:c.jsx("span",{children:N.label})}),c.jsx("div",{className:Q.removeBtnContainer,children:c.jsx("button",{type:"button",className:Q.removeBtn,onClick:T=>H(N.value,T),"aria-label":`Supprimer ${N.label}`,children:c.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor",children:c.jsx("path",{d:"M8.5 1.5L1.5 8.5M1.5 1.5L8.5 8.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})})]},`tag-${N.value}-${V}`)),r?c.jsx("input",{ref:m,type:"text",className:Q.searchInput,placeholder:w.length===0?i:"",value:u,onChange:N=>{p(N.target.value),l||h(!0)},onClick:A,disabled:d}):w.length===0&&c.jsx("span",{className:Q.placeholder,children:i})]}),M!==null&&M<w.length&&c.jsxs("div",{className:Q.overflowBlock,children:[c.jsx("span",{className:Q.overflowEllipsis,children:"..."}),c.jsxs("div",{className:Q.overflowBadgeWrap,children:[c.jsx("button",{ref:b,type:"button",className:Q.overflowBadge,onClick:$,"aria-label":`Afficher ${q.length} éléments cachés`,children:q.length}),v&&q.length>0&&c.jsx("div",{className:Q.overflowDropdown,role:"list","aria-label":"Éléments cachés",children:q.map((N,V)=>c.jsxs("div",{className:Q.overflowDropdownItem,children:[c.jsx("span",{className:Q.overflowDropdownItemLabel,children:N.label}),c.jsx("button",{type:"button",className:Q.overflowDropdownItemRemove,onClick:T=>{T.stopPropagation(),H(N.value,T)},"aria-label":`Supprimer ${N.label}`,children:c.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor",children:c.jsx("path",{d:"M8.5 1.5L1.5 8.5M1.5 1.5L8.5 8.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]},`hidden-${N.value}-${V}`))})]})]}),c.jsxs("div",{className:Q.actions,children:[w.length>0&&c.jsx("button",{type:"button",className:Q.clearBtn,onClick:P,"aria-label":"Effacer tout",children:c.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:c.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),c.jsx("svg",{className:`${Q.chevron} ${l?Q.chevronOpen:""}`,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:c.jsx("path",{d:"M6 9l6 6 6-6"})})]})]}),l&&!d&&c.jsx("div",{className:Q.dropdown,role:"listbox",children:x.length>0?x.map((N,V)=>c.jsx("div",{className:Q.option,onClick:()=>j(N),role:"option","aria-selected":!1,children:N.label},`opt-${N.value}-${V}`)):c.jsx("div",{className:Q.noOptions,children:t})})]})},sve="_container_h7jek_1",dve={container:sve},lve=({labels:e=[],data:t=[],selectedUfs:n=[],icons:o=[],lastCardTextColor:i="black",boardColors:r={}})=>{const s=k.useMemo(()=>{const h=n.length===0?t:t.filter(p=>p&&n.includes(String(p.uf).replace(/^0+/,""))),u=new Set;return h.filter(p=>{if(!p||!p.uf)return!1;const y=String(p.uf).replace(/^0+/,"");return u.has(y)?!1:(u.add(y),!0)})},[t,n]),d=k.useMemo(()=>s.reduce((h,u)=>({disponibles:h.disponibles+(u.totalAvailable??u.disponibles??0),homme:h.homme+(u.availableMen??u.disponibleHomme??0),femme:h.femme+(u.availableWomen??u.disponibleFemme??0),indifferencie:h.indifferencie+(u.availableIndifferentSex??u.indifferences??0),sorties:h.sorties+(u.outToday??u.sortie24??0)}),{disponibles:0,homme:0,femme:0,indifferencie:0,sorties:0}),[s]),l=h=>r.disponibles?r.disponibles:h>3?"#35994E":h>=1?"#EF6C00":"#C62828";return c.jsxs("div",{className:dve.container,children:[c.jsx(bt,{label:e[0],value:d.disponibles.toLocaleString("fr-FR"),iconName:o[0],backgroundColor:l(d.disponibles),valueFontSize:"2.5rem",valueFontWeight:"400",bars:"none",justifyContent:"flexStart",alignItems:"center",titleColor:"white",valueColor:"white",titleFontSize:"0.625rem",titleFontWeight:"600",cardGap:"2rem",style:{padding:"0.5rem"}}),c.jsx(bt,{label:e[1],value:d.homme.toLocaleString("fr-FR"),iconName:o[1],backgroundColor:r.homme??"#7DD493",valueFontSize:"2.375rem",valueFontWeight:"400",bars:"none",justifyContent:"flexStart",alignItems:"center",titleColor:"black",valueColor:"black",titleFontSize:"0.625rem",titleFontWeight:"600",cardGap:"2rem",style:{padding:"0.5rem"}}),c.jsx(bt,{label:e[2],value:d.femme.toLocaleString("fr-FR"),iconName:o[2],backgroundColor:r.femme??"#7DD493",valueFontSize:"2.375rem",valueFontWeight:"400",bars:"none",justifyContent:"flexStart",alignItems:"center",titleColor:"black",valueColor:"black",titleFontSize:"0.625rem",titleFontWeight:"600",cardGap:"2rem",style:{padding:"0.5rem"}}),c.jsx(bt,{label:e[3],value:d.indifferencie.toLocaleString("fr-FR"),iconName:o[3],backgroundColor:r.indifferencie??"#7DD493",valueFontSize:"2.375rem",valueFontWeight:"400",bars:"none",justifyContent:"flexStart",alignItems:"center",titleColor:"black",valueColor:"black",titleFontSize:"0.625rem",titleFontWeight:"600",cardGap:"2rem",style:{padding:"0.5rem"}}),c.jsx(bt,{label:e[4],value:d.sorties.toLocaleString("fr-FR"),iconName:o[4],backgroundColor:r.sorties??"#F2F9FC",valueFontSize:"3rem",valueFontWeight:"400",bars:"none",justifyContent:"flexStart",alignItems:"center",titleColor:i,valueColor:i,titleFontSize:"0.625rem",titleFontWeight:"600",cardGap:"2rem",style:{padding:"0.5rem"}})]})},hve=({message:e,icon:t,className:n,style:o,fontSize:i,fontWeight:r,color:s,backgroundColor:d="#f44336",onClick:l})=>c.jsxs("div",{className:n,onClick:l,style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 12px",borderRadius:"6px",backgroundColor:d,color:s,fontSize:i,fontWeight:r,cursor:l?"pointer":"default",...o},children:[t&&c.jsx("span",{style:{display:"flex",alignItems:"center",color:s},children:t}),c.jsx("span",{children:e})]}),uve="_container_1pt6c_1",pve="_chartContainer_1pt6c_14",yve="_legend_1pt6c_22",kve="_legendItem_1pt6c_29",mve="_leftSection_1pt6c_41",fve="_colorIndicator_1pt6c_47",gve="_label_1pt6c_54",vve="_rightSection_1pt6c_60",Mve="_ratio_1pt6c_66",_ve="_value1_1pt6c_73",xve="_separator_1pt6c_78",Lve="_value2_1pt6c_82",Ive="_statusIndicator_1pt6c_87",bve="_inactive_1pt6c_102",Ae={container:uve,chartContainer:pve,legend:yve,legendItem:kve,leftSection:mve,colorIndicator:fve,label:gve,rightSection:vve,ratio:Mve,value1:_ve,separator:xve,value2:Lve,statusIndicator:Ive,inactive:bve},rj=Math.PI/180,wve=({data:e,height:t=400,bg:n,backgroundColor:o,color:i,fontSize:r,fontWeight:s,padding:d,margin:l,borderRadius:h,className:u="",style:p={},labelColor:y,ratioColor:m,separatorColor:g,borderColor:f})=>{const[M,_]=k.useState(new Set(e.map(x=>x.nom))),v=x=>{const S=new Set(M);S.has(x)?S.size>1&&S.delete(x):S.add(x),_(S)},I={...p,"--bg-color":n||o||"transparent","--text-color":i||"inherit","--font-size":r||"14px","--font-weight":s||"400","--padding":d||"0","--margin":l||"0","--border-radius":h||"0","--label-color":y||"inherit","--ratio-color":m||"inherit","--separator-color":g||"#03a9f4","--border-color":f||"#e0e0e0"},C=k.useMemo(()=>e.map(x=>({...x,displayValue:M.has(x.nom)?x.value:0})),[e,M]),b=k.useMemo(()=>e.every(x=>x.value===0),[e]),w=k.useMemo(()=>b?1:C.reduce((x,S)=>x+S.displayValue,0)||1,[b,C]),L=k.useCallback(({cx:x,cy:S,midAngle:j,innerRadius:$,outerRadius:q,value:H})=>{if(H===0||b)return null;const P=$+(q-$)*.5,A=x+P*Math.cos(-j*rj),N=S+P*Math.sin(-j*rj),V=Math.round(H/w*100);return c.jsx(a.Text,{x:A,y:N,fill:"white",textAnchor:"middle",dominantBaseline:"central",fontSize:12,fontWeight:"bold",children:`${V}%`})},[w,b]);return c.jsxs("div",{className:`${Ae.container} ${u}`,style:I,children:[c.jsx("div",{className:Ae.chartContainer,style:{height:t/2+100},children:c.jsx(a.ResponsiveContainer,{width:"100%",height:"100%",children:c.jsx(a.PieChart,{children:c.jsx(a.Pie,{data:b?[{displayValue:1,color:"#A3C2CB"}]:C,cx:"50%",cy:"50%",innerRadius:45,outerRadius:75,paddingAngle:0,dataKey:"displayValue",stroke:"white",strokeWidth:b?0:2,startAngle:90,endAngle:450,labelLine:!1,label:L,isAnimationActive:!1,children:b?c.jsx(a.Cell,{fill:"#A3C2CB"}):C.map((x,S)=>c.jsx(a.Cell,{fill:x.color},`cell-${S}`))})})})}),c.jsx("div",{className:Ae.legend,children:e.map((x,S)=>{const j=M.has(x.nom);return c.jsxs("div",{className:`${Ae.legendItem} ${j?"":Ae.inactive}`,onClick:()=>v(x.nom),style:{cursor:"pointer",transition:"opacity 0.2s"},children:[c.jsxs("div",{className:Ae.leftSection,children:[c.jsx("div",{className:Ae.colorIndicator,style:{backgroundColor:x.color,opacity:j?1:.3}}),c.jsx("span",{className:Ae.label,style:{opacity:j?1:.5},children:x.nom})]}),c.jsxs("div",{className:Ae.rightSection,style:{opacity:j?1:.5},children:[c.jsxs("div",{className:Ae.ratio,children:[c.jsx("span",{className:Ae.value1,children:x.value1}),c.jsx("span",{className:Ae.separator,children:"/"}),c.jsx("span",{className:Ae.value2,children:x.value2})]}),x.statusColor&&c.jsx("div",{className:Ae.statusIndicator,style:{backgroundColor:x.statusColor}})]})]},`legend-${S}`)})})]})},Cve="_container_1pc4v_1",Nve="_leftGroup_1pc4v_10",Sve="_iconBtn_1pc4v_16",G1={container:Cve,leftGroup:Nve,iconBtn:Sve},jve=e=>Z.createElement("svg",{width:"1em",height:"1em",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",...e},Z.createElement("path",{d:"M3 12h18M3 6h18M3 18h18"})),$ve=k.memo(jve),qve=e=>Z.createElement("svg",{width:"1em",height:"1em",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",...e},Z.createElement("path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8m-4-6-4-4-4 4m4-4v13"})),Zq=k.memo(qve),Ave=({menuIcon:e,logoProps:t,actionIcon:n,style:o,className:i,bgColor:r="var(--header-bg)",color:s="var(--color-text)",borderBottomColor:d="var(--color-border)",borderBottomWidth:l=1,height:h="8vh",onMenuClick:u,onActionClick:p})=>{const y={backgroundColor:r,color:s,borderBottom:`${l}px solid ${d}`,height:h,...o};return c.jsxs("header",{className:[G1.container,i].filter(Boolean).join(" "),style:y,children:[c.jsxs("div",{className:G1.leftGroup,children:[c.jsx("button",{className:G1.iconBtn,onClick:u,"aria-label":"Menu",style:{color:"inherit"},children:e??c.jsx($ve,{width:22,height:22})}),c.jsx(rL,{...t,size:"medium"})]}),c.jsx("button",{className:G1.iconBtn,onClick:p,"aria-label":"Action",style:{color:"inherit"},children:n??c.jsx(Zq,{width:22,height:22})})]})},zve="_container_24g3e_1",Vve="_iconBtn_24g3e_10",Pve="_title_24g3e_22",Z1={container:zve,iconBtn:Vve,title:Pve},Tve=({title:e="Menu",closeIcon:t,actionIcon:n,style:o,className:i,titleStyle:r,bgColor:s="var(--header-bg)",color:d="var(--color-text)",borderBottomColor:l="transparent",borderBottomWidth:h=0,height:u="8vh",onClose:p,onAction:y})=>{const m={backgroundColor:s,color:d,borderBottom:`${h}px solid ${l}`,height:u,...o};return c.jsxs("div",{className:[Z1.container,i].filter(Boolean).join(" "),style:m,children:[c.jsx("button",{className:Z1.iconBtn,onClick:p,"aria-label":"Fermer",style:{color:"inherit"},children:t??c.jsx(Gq,{width:22,height:22})}),c.jsx("span",{className:Z1.title,style:{fontWeight:"var(--font-weight-h)",fontSize:"var(--h5)",...r},children:e.toUpperCase()}),c.jsx("button",{className:Z1.iconBtn,onClick:y,"aria-label":"Partager",style:{color:"inherit"},children:n??c.jsx(Zq,{width:22,height:22})})]})};exports.PeriodRange=a.PeriodRange;exports.SimpleBarChart=a.SimpleBarChart;exports.ActionCard=zge;exports.AddItemModal=Nc;exports.Alert=Ew;exports.AlertMessage=hve;exports.AlertsProvider=$ke;exports.BadgeList=sj;exports.BadgeRenderer=$q;exports.Button=Xx;exports.ChartContainer=Ske;exports.CheckboxInput=dq;exports.CircularProgress=jb;exports.ColorInput=yq;exports.ComponentVisibilityManager=Ab;exports.ComponentVisibilityToggle=Ume;exports.ConfirmationModal=Nge;exports.ConfirmationPopup=V3e;exports.CounterListBox=v3e;exports.CurrencyRenderer=zq;exports.DashboardSummary=Lme;exports.DataBoard=bt;exports.DataFourBoards=Rq;exports.DateInput=uq;exports.DatePicker=nw;exports.DateRenderer=qq;exports.DayStatCard=e2e;exports.DayStatCardV2=T6e;exports.DonutChartRatio=wve;exports.DraggableProvider=o2e;exports.DraggableSwitcherButton=Yx;exports.DynamicForm=Zye;exports.DynamicInput=kq;exports.EmailRenderer=Sq;exports.Encours=Pme;exports.EntryControl=f3e;exports.FileInput=hq;exports.FilterBar=Wfe;exports.FiltreEtiquette=rve;exports.FlexRowContainer=_3e;exports.Grid=hj;exports.Header=l2e;exports.HorizontalBarChart=D6e;exports.IconText=xj;exports.ImageRenderer=Vq;exports.IndicatorItemV2=$7e;exports.InfoBanner=G7e;exports.InputWrapper=yL;exports.LegendFilterProvider=i2e;exports.LegendFilterSwitcherButton=Jx;exports.LinkRenderer=jq;exports.ListContentContainer=x3e;exports.Logo=rL;exports.MetricsPanel=Hq;exports.MobileMenuHeader=Tve;exports.MobileNavMenu=Oq;exports.MobileTopBar=Ave;exports.ModuleHeader=e3e;exports.ModuleSideBar=t3e;exports.ModuleSideBarV2=vge;exports.NavBar=uj;exports.NavBarV2=n8e;exports.NavItem=$b;exports.NavItemV2=Ow;exports.NavProvider=t2e;exports.NumberRenderer=Aq;exports.PeriodSelect=Tke;exports.PopUp=yge;exports.RadioInput=lq;exports.RangeInput=pq;exports.ScrollableHorizontale=Lj;exports.SearchBar=Bq;exports.Select=Wq;exports.SelectFilter=kme;exports.SelectInput=Dw;exports.SettingNavBar=gge;exports.ShowDataProvider=r2e;exports.ShowDataSwitcherButton=Qx;exports.SideComponent=Dke;exports.SimpleListBox=g3e;exports.SubHeaderContent=N8e;exports.SubHeaderNavItem=Eq;exports.SubHeaderTitle=d8e;exports.SubNavBar=h2e;exports.SummaryAvailable=lve;exports.SummaryCard=Tq;exports.Switcher=z1;exports.TableLayout=Uq;exports.TableauDynamique=Pq;exports.TableauDynamiqueSafePagination=V5e;exports.TableauxComponent=Uq;exports.TextInput=rq;exports.TextRenderer=Nq;exports.TextareaInput=sq;exports.ThemeProvider=a2e;exports.ThemeSwitcher=S8e;exports.ThemeSwitcherButton=qb;exports.Title=Eke;exports.TranslationKey=a3e;exports.TranslationKeyV2=Mge;exports.TrendItem=Ij;exports.TrendList=iue;exports.TrendListBox=M3e;exports.UserInfo=Fq;exports.alertModels=Ake;exports.getFormSchema=Kye;exports.hexToRgba=Ct;exports.registerRenderer=b5e;exports.tableConfig=aw;exports.useAlerts=qke;exports.useBodyScrollLock=Bke;exports.useConfirmationPopup=P3e;exports.useDraggableSwitcher=mj;exports.useFilters=wq;exports.useLegendFilterSwitcher=gj;exports.useNavigation=it;exports.useShowDataSwitcher=Mj;exports.useTableData=Cq;exports.useThemeContext=yj;exports.useThemeSwitcher=sL;exports.validateField=iL;exports.validateForm=iq;
|