@wakastellar/ui 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blocks/index.d.ts +29 -1
- package/dist/components/index.d.ts +23 -1
- package/dist/index.cjs.js +33 -21
- package/dist/index.es.js +21424 -9310
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1,15 +1,31 @@
|
|
|
1
|
-
"use strict";var Ri=Object.create;var os=Object.defineProperty;var $i=Object.getOwnPropertyDescriptor;var Ai=Object.getOwnPropertyNames;var Fi=Object.getPrototypeOf,Li=Object.prototype.hasOwnProperty;var Ii=(t,a,r,s)=>{if(a&&typeof a=="object"||typeof a=="function")for(let n of Ai(a))!Li.call(t,n)&&n!==r&&os(t,n,{get:()=>a[n],enumerable:!(s=$i(a,n))||s.enumerable});return t};var ka=(t,a,r)=>(r=t!=null?Ri(Fi(t)):{},Ii(a||!t||!t.__esModule?os(r,"default",{value:t,enumerable:!0}):r,t));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),C=require("react"),Oi=require("@radix-ui/react-accordion"),E=require("lucide-react"),Os=require("clsx"),_i=require("tailwind-merge"),De=require("class-variance-authority"),zi=require("@radix-ui/react-alert-dialog"),Vi=require("@radix-ui/react-aspect-ratio"),Wi=require("@radix-ui/react-avatar"),$a=require("@radix-ui/react-slot"),Hi=require("react-day-picker"),qi=require("@radix-ui/react-checkbox"),M=require("date-fns"),Ui=require("@radix-ui/react-collapsible"),Le=require("cmdk"),Bi=require("@radix-ui/react-dialog"),Gi=require("@radix-ui/react-context-menu"),Xi=require("@radix-ui/react-dropdown-menu"),Ji=require("@radix-ui/react-label"),Yi=require("@radix-ui/react-hover-card"),Ki=require("@radix-ui/react-select"),Ka=require("react-dom"),Zi=require("@radix-ui/react-menubar"),Qi=require("@radix-ui/react-navigation-menu"),el=require("@radix-ui/react-popover"),tl=require("@radix-ui/react-progress"),al=require("@radix-ui/react-radio-group"),rl=require("@radix-ui/react-scroll-area"),sl=require("@radix-ui/react-separator"),nl=require("@radix-ui/react-slider"),ol=require("@radix-ui/react-switch"),il=require("@radix-ui/react-tabs"),ll=require("@radix-ui/react-toast"),cl=require("@radix-ui/react-toggle"),dl=require("@radix-ui/react-tooltip"),ft=require("react-datepicker"),et=require("react-i18next"),lt=require("i18next"),Ee=require("@tanstack/react-table"),ul=require("@tanstack/react-virtual");function pe(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const s=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(a,r,s.get?s:{enumerable:!0,get:()=>t[r]})}}return a.default=t,Object.freeze(a)}const i=pe(C),Pt=pe(Oi),Ae=pe(zi),ml=pe(Vi),zt=pe(Wi),Za=pe(qi),lr=pe(Ui),he=pe(Bi),be=pe(Gi),xe=pe(Xi),_s=pe(Ji),Aa=pe(Yi),Ce=pe(Ki),ue=pe(Zi),Ie=pe(Qi),ra=pe(el),Qa=pe(tl),sa=pe(al),Et=pe(rl),zs=pe(sl),Jt=pe(nl),er=pe(ol),Rt=pe(il),qe=pe(ll),Vs=pe(cl),fa=pe(dl);function Da(...t){return _i.twMerge(Os.clsx(...t))}Da.variants=function(t){const a={variants:t.variants??{},defaultVariants:t.defaultVariants},r=De.cva(t.base??"",a);return s=>{const{class:n,className:o,...d}=s??{};return Da(r(d),n,o)}};const j=(...t)=>Da(t),fl=Pt.Root,Ws=i.forwardRef(({className:t,...a},r)=>e.jsx(Pt.Item,{ref:r,className:j("border-b",t),...a}));Ws.displayName="AccordionItem";const Hs=i.forwardRef(({className:t,children:a,...r},s)=>e.jsx(Pt.Header,{className:"flex",children:e.jsxs(Pt.Trigger,{ref:s,className:j("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",t),...r,children:[a,e.jsx(E.ChevronDown,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));Hs.displayName=Pt.Trigger.displayName;const qs=i.forwardRef(({className:t,children:a,...r},s)=>e.jsx(Pt.Content,{ref:s,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...r,children:e.jsx("div",{className:j("pb-4 pt-0",t),children:a})}));qs.displayName=Pt.Content.displayName;const Us=Ae.Root,hl=Ae.Trigger,Bs=Ae.Portal,cr=i.forwardRef(({className:t,...a},r)=>e.jsx(Ae.Overlay,{className:j("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...a,ref:r}));cr.displayName=Ae.Overlay.displayName;const dr=i.forwardRef(({className:t,...a},r)=>e.jsxs(Bs,{children:[e.jsx(cr,{}),e.jsx(Ae.Content,{ref:r,className:j("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...a})]}));dr.displayName=Ae.Content.displayName;const ur=({className:t,...a})=>e.jsx("div",{className:j("flex flex-col space-y-2 text-center sm:text-left",t),...a});ur.displayName="AlertDialogHeader";const mr=({className:t,...a})=>e.jsx("div",{className:j("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...a});mr.displayName="AlertDialogFooter";const fr=i.forwardRef(({className:t,...a},r)=>e.jsx(Ae.Title,{ref:r,className:j("text-lg font-semibold",t),...a}));fr.displayName=Ae.Title.displayName;const hr=i.forwardRef(({className:t,...a},r)=>e.jsx(Ae.Description,{ref:r,className:j("text-sm text-muted-foreground",t),...a}));hr.displayName=Ae.Description.displayName;const pr=i.forwardRef(({className:t,...a},r)=>e.jsx(Ae.Action,{ref:r,className:j("inline-flex h-10 items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-semibold text-primary-foreground ring-offset-background transition-colors hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...a}));pr.displayName=Ae.Action.displayName;const gr=i.forwardRef(({className:t,...a},r)=>e.jsx(Ae.Cancel,{ref:r,className:j("mt-2 inline-flex h-10 items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-semibold ring-offset-background transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 sm:mt-0",t),...a}));gr.displayName=Ae.Cancel.displayName;const pl=De.cva("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Gs=i.forwardRef(({className:t,variant:a,...r},s)=>e.jsx("div",{ref:s,role:"alert",className:j(pl({variant:a}),t),...r}));Gs.displayName="Alert";const Xs=i.forwardRef(({className:t,...a},r)=>e.jsx("h5",{ref:r,className:j("mb-1 font-medium leading-none tracking-tight",t),...a}));Xs.displayName="AlertTitle";const Js=i.forwardRef(({className:t,...a},r)=>e.jsx("div",{ref:r,className:j("text-sm [&_p]:leading-relaxed",t),...a}));Js.displayName="AlertDescription";const gl=ml.Root,Ys=i.forwardRef(({className:t,...a},r)=>e.jsx(zt.Root,{ref:r,className:j("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...a}));Ys.displayName=zt.Root.displayName;const Ks=i.forwardRef(({className:t,...a},r)=>e.jsx(zt.Image,{ref:r,className:j("aspect-square h-full w-full",t),...a}));Ks.displayName=zt.Image.displayName;const Zs=i.forwardRef(({className:t,...a},r)=>e.jsx(zt.Fallback,{ref:r,className:j("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...a}));Zs.displayName=zt.Fallback.displayName;const Qs=De.cva("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function He({className:t,variant:a,...r}){return e.jsx("div",{className:j(Qs({variant:a}),t),...r})}const bl=De.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),O=i.forwardRef(({className:t,variant:a,size:r,asChild:s=!1,...n},o)=>{const d=s?$a.Slot:"button";return e.jsx(d,{className:j(bl({variant:a,size:r,className:t})),ref:o,...n})});O.displayName="Button";function br({className:t,classNames:a,showOutsideDays:r=!0,...s}){return e.jsx(Hi.DayPicker,{showOutsideDays:r,className:j("p-4 bg-background border border-border rounded-lg shadow-sm",t),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center mb-4",caption_label:"text-lg font-semibold text-foreground",nav:"space-x-1 flex items-center",nav_button:j("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-all duration-200","h-8 w-8 bg-background border border-border hover:bg-accent hover:text-accent-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex mb-2",head_cell:"text-muted-foreground rounded-md w-10 h-10 font-medium text-sm flex items-center justify-center",row:"flex w-full",cell:"h-10 w-10 text-center text-sm p-0 relative",day:j("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-all duration-200","h-10 w-10 p-0 font-normal cursor-pointer","hover:bg-accent hover:text-accent-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50"),day_range_end:"day-range-end",day_selected:j("bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground","focus:bg-primary focus:text-primary-foreground shadow-sm"),day_today:"bg-accent text-accent-foreground font-semibold",day_outside:"text-muted-foreground opacity-50 hover:opacity-70",day_disabled:"text-muted-foreground opacity-30 cursor-not-allowed",day_range_middle:"bg-accent/50 text-accent-foreground",day_hidden:"invisible",...a},components:{Chevron:({...n})=>n.orientation==="left"?e.jsx(E.ChevronLeft,{className:"h-4 w-4"}):e.jsx(E.ChevronRight,{className:"h-4 w-4"})},...s})}br.displayName="Calendar";const Ve=i.forwardRef(({className:t,...a},r)=>e.jsx("div",{ref:r,className:j("rounded-xl border bg-card text-card-foreground shadow",t),...a}));Ve.displayName="Card";const Ke=i.forwardRef(({className:t,...a},r)=>e.jsx("div",{ref:r,className:j("flex flex-col space-y-1.5 p-6",t),...a}));Ke.displayName="CardHeader";const We=i.forwardRef(({className:t,...a},r)=>e.jsx("h3",{ref:r,className:j("font-semibold leading-none tracking-tight",t),...a}));We.displayName="CardTitle";const Dt=i.forwardRef(({className:t,...a},r)=>e.jsx("p",{ref:r,className:j("text-sm text-muted-foreground",t),...a}));Dt.displayName="CardDescription";const Ze=i.forwardRef(({className:t,...a},r)=>e.jsx("div",{ref:r,className:j("p-6 pt-0",t),...a}));Ze.displayName="CardContent";const en=i.forwardRef(({className:t,...a},r)=>e.jsx("div",{ref:r,className:j("flex items-center p-6 pt-0",t),...a}));en.displayName="CardFooter";const at=i.forwardRef(({className:t,...a},r)=>e.jsx(Za.Root,{ref:r,className:j("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",t),...a,children:e.jsx(Za.Indicator,{className:j("flex items-center justify-center text-current"),children:e.jsx(E.Check,{className:"h-4 w-4"})})}));at.displayName=Za.Root.displayName;function je(t){return(a={})=>{const r=a.width?String(a.width):t.defaultWidth;return t.formats[r]||t.formats[t.defaultWidth]}}function Q(t){return(a,r)=>{const s=r?.context?String(r.context):"standalone";let n;if(s==="formatting"&&t.formattingValues){const d=t.defaultFormattingWidth||t.defaultWidth,u=r?.width?String(r.width):d;n=t.formattingValues[u]||t.formattingValues[d]}else{const d=t.defaultWidth,u=r?.width?String(r.width):t.defaultWidth;n=t.values[u]||t.values[d]}const o=t.argumentCallback?t.argumentCallback(a):a;return n[o]}}function ee(t){return(a,r={})=>{const s=r.width,n=s&&t.matchPatterns[s]||t.matchPatterns[t.defaultMatchWidth],o=a.match(n);if(!o)return null;const d=o[0],u=s&&t.parsePatterns[s]||t.parsePatterns[t.defaultParseWidth],h=Array.isArray(u)?vl(u,f=>f.test(d)):xl(u,f=>f.test(d));let m;m=t.valueCallback?t.valueCallback(h):h,m=r.valueCallback?r.valueCallback(m):m;const v=a.slice(d.length);return{value:m,rest:v}}}function xl(t,a){for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&a(t[r]))return r}function vl(t,a){for(let r=0;r<t.length;r++)if(a(t[r]))return r}function yt(t){return(a,r={})=>{const s=a.match(t.matchPattern);if(!s)return null;const n=s[0],o=a.match(t.parsePattern);if(!o)return null;let d=t.valueCallback?t.valueCallback(o[0]):o[0];d=r.valueCallback?r.valueCallback(d):d;const u=a.slice(n.length);return{value:d,rest:u}}}const is=Symbol.for("constructDateFrom");function tn(t,a){return typeof t=="function"?t(a):t&&typeof t=="object"&&is in t?t[is](a):t instanceof Date?new t.constructor(a):new Date(a)}function yl(t,...a){const r=tn.bind(null,t||a.find(s=>typeof s=="object"));return a.map(r)}let wl={};function jl(){return wl}function Nl(t,a){return tn(a||t,t)}function ls(t,a){const r=jl(),s=a?.weekStartsOn??a?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,n=Nl(t,a?.in),o=n.getDay(),d=(o<s?7:0)+o-s;return n.setDate(n.getDate()-d),n.setHours(0,0,0,0),n}function tr(t,a,r){const[s,n]=yl(r?.in,t,a);return+ls(s,r)==+ls(n,r)}const cs={lessThanXSeconds:{standalone:{one:"weniger als 1 Sekunde",other:"weniger als {{count}} Sekunden"},withPreposition:{one:"weniger als 1 Sekunde",other:"weniger als {{count}} Sekunden"}},xSeconds:{standalone:{one:"1 Sekunde",other:"{{count}} Sekunden"},withPreposition:{one:"1 Sekunde",other:"{{count}} Sekunden"}},halfAMinute:{standalone:"eine halbe Minute",withPreposition:"einer halben Minute"},lessThanXMinutes:{standalone:{one:"weniger als 1 Minute",other:"weniger als {{count}} Minuten"},withPreposition:{one:"weniger als 1 Minute",other:"weniger als {{count}} Minuten"}},xMinutes:{standalone:{one:"1 Minute",other:"{{count}} Minuten"},withPreposition:{one:"1 Minute",other:"{{count}} Minuten"}},aboutXHours:{standalone:{one:"etwa 1 Stunde",other:"etwa {{count}} Stunden"},withPreposition:{one:"etwa 1 Stunde",other:"etwa {{count}} Stunden"}},xHours:{standalone:{one:"1 Stunde",other:"{{count}} Stunden"},withPreposition:{one:"1 Stunde",other:"{{count}} Stunden"}},xDays:{standalone:{one:"1 Tag",other:"{{count}} Tage"},withPreposition:{one:"1 Tag",other:"{{count}} Tagen"}},aboutXWeeks:{standalone:{one:"etwa 1 Woche",other:"etwa {{count}} Wochen"},withPreposition:{one:"etwa 1 Woche",other:"etwa {{count}} Wochen"}},xWeeks:{standalone:{one:"1 Woche",other:"{{count}} Wochen"},withPreposition:{one:"1 Woche",other:"{{count}} Wochen"}},aboutXMonths:{standalone:{one:"etwa 1 Monat",other:"etwa {{count}} Monate"},withPreposition:{one:"etwa 1 Monat",other:"etwa {{count}} Monaten"}},xMonths:{standalone:{one:"1 Monat",other:"{{count}} Monate"},withPreposition:{one:"1 Monat",other:"{{count}} Monaten"}},aboutXYears:{standalone:{one:"etwa 1 Jahr",other:"etwa {{count}} Jahre"},withPreposition:{one:"etwa 1 Jahr",other:"etwa {{count}} Jahren"}},xYears:{standalone:{one:"1 Jahr",other:"{{count}} Jahre"},withPreposition:{one:"1 Jahr",other:"{{count}} Jahren"}},overXYears:{standalone:{one:"mehr als 1 Jahr",other:"mehr als {{count}} Jahre"},withPreposition:{one:"mehr als 1 Jahr",other:"mehr als {{count}} Jahren"}},almostXYears:{standalone:{one:"fast 1 Jahr",other:"fast {{count}} Jahre"},withPreposition:{one:"fast 1 Jahr",other:"fast {{count}} Jahren"}}},Sl=(t,a,r)=>{let s;const n=r?.addSuffix?cs[t].withPreposition:cs[t].standalone;return typeof n=="string"?s=n:a===1?s=n.one:s=n.other.replace("{{count}}",String(a)),r?.addSuffix?r.comparison&&r.comparison>0?"in "+s:"vor "+s:s},kl={full:"EEEE, do MMMM y",long:"do MMMM y",medium:"do MMM y",short:"dd.MM.y"},Cl={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},Tl={full:"{{date}} 'um' {{time}}",long:"{{date}} 'um' {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},El={date:je({formats:kl,defaultWidth:"full"}),time:je({formats:Cl,defaultWidth:"full"}),dateTime:je({formats:Tl,defaultWidth:"full"})},Pl={lastWeek:"'letzten' eeee 'um' p",yesterday:"'gestern um' p",today:"'heute um' p",tomorrow:"'morgen um' p",nextWeek:"eeee 'um' p",other:"P"},Dl=(t,a,r,s)=>Pl[t],Ml={narrow:["v.Chr.","n.Chr."],abbreviated:["v.Chr.","n.Chr."],wide:["vor Christus","nach Christus"]},Rl={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1. Quartal","2. Quartal","3. Quartal","4. Quartal"]},ar={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],wide:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"]},$l={narrow:ar.narrow,abbreviated:["Jan.","Feb.","März","Apr.","Mai","Juni","Juli","Aug.","Sep.","Okt.","Nov.","Dez."],wide:ar.wide},Al={narrow:["S","M","D","M","D","F","S"],short:["So","Mo","Di","Mi","Do","Fr","Sa"],abbreviated:["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."],wide:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"]},Fl={narrow:{am:"vm.",pm:"nm.",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachm.",evening:"Abend",night:"Nacht"},abbreviated:{am:"vorm.",pm:"nachm.",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachmittag",evening:"Abend",night:"Nacht"},wide:{am:"vormittags",pm:"nachmittags",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachmittag",evening:"Abend",night:"Nacht"}},Ll={narrow:{am:"vm.",pm:"nm.",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachm.",evening:"abends",night:"nachts"},abbreviated:{am:"vorm.",pm:"nachm.",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachmittags",evening:"abends",night:"nachts"},wide:{am:"vormittags",pm:"nachmittags",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachmittags",evening:"abends",night:"nachts"}},Il=t=>Number(t)+".",Ol={ordinalNumber:Il,era:Q({values:Ml,defaultWidth:"wide"}),quarter:Q({values:Rl,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Q({values:ar,formattingValues:$l,defaultWidth:"wide"}),day:Q({values:Al,defaultWidth:"wide"}),dayPeriod:Q({values:Fl,defaultWidth:"wide",formattingValues:Ll,defaultFormattingWidth:"wide"})},_l=/^(\d+)(\.)?/i,zl=/\d+/i,Vl={narrow:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,abbreviated:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,wide:/^(vor Christus|vor unserer Zeitrechnung|nach Christus|unserer Zeitrechnung)/i},Wl={any:[/^v/i,/^n/i]},Hl={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](\.)? Quartal/i},ql={any:[/1/i,/2/i,/3/i,/4/i]},Ul={narrow:/^[jfmasond]/i,abbreviated:/^(j[aä]n|feb|mär[z]?|apr|mai|jun[i]?|jul[i]?|aug|sep|okt|nov|dez)\.?/i,wide:/^(januar|februar|märz|april|mai|juni|juli|august|september|oktober|november|dezember)/i},Bl={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^j[aä]/i,/^f/i,/^mär/i,/^ap/i,/^mai/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Gl={narrow:/^[smdmf]/i,short:/^(so|mo|di|mi|do|fr|sa)/i,abbreviated:/^(son?|mon?|die?|mit?|don?|fre?|sam?)\.?/i,wide:/^(sonntag|montag|dienstag|mittwoch|donnerstag|freitag|samstag)/i},Xl={any:[/^so/i,/^mo/i,/^di/i,/^mi/i,/^do/i,/^f/i,/^sa/i]},Jl={narrow:/^(vm\.?|nm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,abbreviated:/^(vorm\.?|nachm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,wide:/^(vormittags|nachmittags|Mitternacht|Mittag|morgens|nachmittags|abends|nachts)/i},Yl={any:{am:/^v/i,pm:/^n/i,midnight:/^Mitte/i,noon:/^Mitta/i,morning:/morgens/i,afternoon:/nachmittags/i,evening:/abends/i,night:/nachts/i}},Kl={ordinalNumber:yt({matchPattern:_l,parsePattern:zl,valueCallback:t=>parseInt(t)}),era:ee({matchPatterns:Vl,defaultMatchWidth:"wide",parsePatterns:Wl,defaultParseWidth:"any"}),quarter:ee({matchPatterns:Hl,defaultMatchWidth:"wide",parsePatterns:ql,defaultParseWidth:"any",valueCallback:t=>t+1}),month:ee({matchPatterns:Ul,defaultMatchWidth:"wide",parsePatterns:Bl,defaultParseWidth:"any"}),day:ee({matchPatterns:Gl,defaultMatchWidth:"wide",parsePatterns:Xl,defaultParseWidth:"any"}),dayPeriod:ee({matchPatterns:Jl,defaultMatchWidth:"wide",parsePatterns:Yl,defaultParseWidth:"any"})},an={code:"de",formatDistance:Sl,formatLong:El,formatRelative:Dl,localize:Ol,match:Kl,options:{weekStartsOn:1,firstWeekContainsDate:4}},Zl={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Ql=(t,a,r)=>{let s;const n=Zl[t];return typeof n=="string"?s=n:a===1?s=n.one:s=n.other.replace("{{count}}",a.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"in "+s:s+" ago":s},ec={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},tc=(t,a,r,s)=>ec[t],ac={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},rc={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},sc={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},nc={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},oc={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},ic={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},lc=(t,a)=>{const r=Number(t),s=r%100;if(s>20||s<10)switch(s%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},cc={ordinalNumber:lc,era:Q({values:ac,defaultWidth:"wide"}),quarter:Q({values:rc,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Q({values:sc,defaultWidth:"wide"}),day:Q({values:nc,defaultWidth:"wide"}),dayPeriod:Q({values:oc,defaultWidth:"wide",formattingValues:ic,defaultFormattingWidth:"wide"})},dc=/^(\d+)(th|st|nd|rd)?/i,uc=/\d+/i,mc={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},fc={any:[/^b/i,/^(a|c)/i]},hc={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},pc={any:[/1/i,/2/i,/3/i,/4/i]},gc={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},bc={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},xc={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},vc={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},yc={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},wc={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},jc={ordinalNumber:yt({matchPattern:dc,parsePattern:uc,valueCallback:t=>parseInt(t,10)}),era:ee({matchPatterns:mc,defaultMatchWidth:"wide",parsePatterns:fc,defaultParseWidth:"any"}),quarter:ee({matchPatterns:hc,defaultMatchWidth:"wide",parsePatterns:pc,defaultParseWidth:"any",valueCallback:t=>t+1}),month:ee({matchPatterns:gc,defaultMatchWidth:"wide",parsePatterns:bc,defaultParseWidth:"any"}),day:ee({matchPatterns:xc,defaultMatchWidth:"wide",parsePatterns:vc,defaultParseWidth:"any"}),dayPeriod:ee({matchPatterns:yc,defaultMatchWidth:"any",parsePatterns:wc,defaultParseWidth:"any"})},Nc={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Sc={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},kc={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Cc={date:je({formats:Nc,defaultWidth:"full"}),time:je({formats:Sc,defaultWidth:"full"}),dateTime:je({formats:kc,defaultWidth:"full"})},rn={code:"en-US",formatDistance:Ql,formatLong:Cc,formatRelative:tc,localize:cc,match:jc,options:{weekStartsOn:0,firstWeekContainsDate:1}},Tc={lessThanXSeconds:{one:"menos de un segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"medio minuto",lessThanXMinutes:{one:"menos de un minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"alrededor de 1 hora",other:"alrededor de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 día",other:"{{count}} días"},aboutXWeeks:{one:"alrededor de 1 semana",other:"alrededor de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"alrededor de 1 mes",other:"alrededor de {{count}} meses"},xMonths:{one:"1 mes",other:"{{count}} meses"},aboutXYears:{one:"alrededor de 1 año",other:"alrededor de {{count}} años"},xYears:{one:"1 año",other:"{{count}} años"},overXYears:{one:"más de 1 año",other:"más de {{count}} años"},almostXYears:{one:"casi 1 año",other:"casi {{count}} años"}},Ec=(t,a,r)=>{let s;const n=Tc[t];return typeof n=="string"?s=n:a===1?s=n.one:s=n.other.replace("{{count}}",a.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"en "+s:"hace "+s:s},Pc={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/y"},Dc={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},Mc={full:"{{date}} 'a las' {{time}}",long:"{{date}} 'a las' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Rc={date:je({formats:Pc,defaultWidth:"full"}),time:je({formats:Dc,defaultWidth:"full"}),dateTime:je({formats:Mc,defaultWidth:"full"})},$c={lastWeek:"'el' eeee 'pasado a la' p",yesterday:"'ayer a la' p",today:"'hoy a la' p",tomorrow:"'mañana a la' p",nextWeek:"eeee 'a la' p",other:"P"},Ac={lastWeek:"'el' eeee 'pasado a las' p",yesterday:"'ayer a las' p",today:"'hoy a las' p",tomorrow:"'mañana a las' p",nextWeek:"eeee 'a las' p",other:"P"},Fc=(t,a,r,s)=>a.getHours()!==1?Ac[t]:$c[t],Lc={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","después de cristo"]},Ic={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},Oc={narrow:["e","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],wide:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"]},_c={narrow:["d","l","m","m","j","v","s"],short:["do","lu","ma","mi","ju","vi","sá"],abbreviated:["dom","lun","mar","mié","jue","vie","sáb"],wide:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"]},zc={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"}},Vc={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"}},Wc=(t,a)=>Number(t)+"º",Hc={ordinalNumber:Wc,era:Q({values:Lc,defaultWidth:"wide"}),quarter:Q({values:Ic,defaultWidth:"wide",argumentCallback:t=>Number(t)-1}),month:Q({values:Oc,defaultWidth:"wide"}),day:Q({values:_c,defaultWidth:"wide"}),dayPeriod:Q({values:zc,defaultWidth:"wide",formattingValues:Vc,defaultFormattingWidth:"wide"})},qc=/^(\d+)(º)?/i,Uc=/\d+/i,Bc={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,wide:/^(antes de cristo|antes de la era com[uú]n|despu[eé]s de cristo|era com[uú]n)/i},Gc={any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes de la era com[uú]n)/i,/^(despu[eé]s de cristo|era com[uú]n)/i]},Xc={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},Jc={any:[/1/i,/2/i,/3/i,/4/i]},Yc={narrow:/^[efmajsond]/i,abbreviated:/^(ene|feb|mar|abr|may|jun|jul|ago|sep|oct|nov|dic)/i,wide:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i},Kc={narrow:[/^e/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^en/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i]},Zc={narrow:/^[dlmjvs]/i,short:/^(do|lu|ma|mi|ju|vi|s[áa])/i,abbreviated:/^(dom|lun|mar|mi[ée]|jue|vie|s[áa]b)/i,wide:/^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i},Qc={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^do/i,/^lu/i,/^ma/i,/^mi/i,/^ju/i,/^vi/i,/^sa/i]},ed={narrow:/^(a|p|mn|md|(de la|a las) (mañana|tarde|noche))/i,any:/^([ap]\.?\s?m\.?|medianoche|mediodia|(de la|a las) (mañana|tarde|noche))/i},td={any:{am:/^a/i,pm:/^p/i,midnight:/^mn/i,noon:/^md/i,morning:/mañana/i,afternoon:/tarde/i,evening:/tarde/i,night:/noche/i}},ad={ordinalNumber:yt({matchPattern:qc,parsePattern:Uc,valueCallback:function(t){return parseInt(t,10)}}),era:ee({matchPatterns:Bc,defaultMatchWidth:"wide",parsePatterns:Gc,defaultParseWidth:"any"}),quarter:ee({matchPatterns:Xc,defaultMatchWidth:"wide",parsePatterns:Jc,defaultParseWidth:"any",valueCallback:t=>t+1}),month:ee({matchPatterns:Yc,defaultMatchWidth:"wide",parsePatterns:Kc,defaultParseWidth:"any"}),day:ee({matchPatterns:Zc,defaultMatchWidth:"wide",parsePatterns:Qc,defaultParseWidth:"any"}),dayPeriod:ee({matchPatterns:ed,defaultMatchWidth:"any",parsePatterns:td,defaultParseWidth:"any"})},sn={code:"es",formatDistance:Ec,formatLong:Rc,formatRelative:Fc,localize:Hc,match:ad,options:{weekStartsOn:1,firstWeekContainsDate:1}},rd={lessThanXSeconds:{one:"moins d’une seconde",other:"moins de {{count}} secondes"},xSeconds:{one:"1 seconde",other:"{{count}} secondes"},halfAMinute:"30 secondes",lessThanXMinutes:{one:"moins d’une minute",other:"moins de {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"environ 1 heure",other:"environ {{count}} heures"},xHours:{one:"1 heure",other:"{{count}} heures"},xDays:{one:"1 jour",other:"{{count}} jours"},aboutXWeeks:{one:"environ 1 semaine",other:"environ {{count}} semaines"},xWeeks:{one:"1 semaine",other:"{{count}} semaines"},aboutXMonths:{one:"environ 1 mois",other:"environ {{count}} mois"},xMonths:{one:"1 mois",other:"{{count}} mois"},aboutXYears:{one:"environ 1 an",other:"environ {{count}} ans"},xYears:{one:"1 an",other:"{{count}} ans"},overXYears:{one:"plus d’un an",other:"plus de {{count}} ans"},almostXYears:{one:"presqu’un an",other:"presque {{count}} ans"}},sd=(t,a,r)=>{let s;const n=rd[t];return typeof n=="string"?s=n:a===1?s=n.one:s=n.other.replace("{{count}}",String(a)),r?.addSuffix?r.comparison&&r.comparison>0?"dans "+s:"il y a "+s:s},nd={full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"dd/MM/y"},od={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},id={full:"{{date}} 'à' {{time}}",long:"{{date}} 'à' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ld={date:je({formats:nd,defaultWidth:"full"}),time:je({formats:od,defaultWidth:"full"}),dateTime:je({formats:id,defaultWidth:"full"})},cd={lastWeek:"eeee 'dernier à' p",yesterday:"'hier à' p",today:"'aujourd’hui à' p",tomorrow:"'demain à' p'",nextWeek:"eeee 'prochain à' p",other:"P"},dd=(t,a,r,s)=>cd[t],ud={narrow:["av. J.-C","ap. J.-C"],abbreviated:["av. J.-C","ap. J.-C"],wide:["avant Jésus-Christ","après Jésus-Christ"]},md={narrow:["T1","T2","T3","T4"],abbreviated:["1er trim.","2ème trim.","3ème trim.","4ème trim."],wide:["1er trimestre","2ème trimestre","3ème trimestre","4ème trimestre"]},fd={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],wide:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"]},hd={narrow:["D","L","M","M","J","V","S"],short:["di","lu","ma","me","je","ve","sa"],abbreviated:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],wide:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"]},pd={narrow:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"mat.",afternoon:"ap.m.",evening:"soir",night:"mat."},abbreviated:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"matin",afternoon:"après-midi",evening:"soir",night:"matin"},wide:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"du matin",afternoon:"de l’après-midi",evening:"du soir",night:"du matin"}},gd=(t,a)=>{const r=Number(t),s=a?.unit;if(r===0)return"0";const n=["year","week","hour","minute","second"];let o;return r===1?o=s&&n.includes(s)?"ère":"er":o="ème",r+o},bd=["MMM","MMMM"],xd={preprocessor:(t,a)=>t.getDate()===1||!a.some(s=>s.isToken&&bd.includes(s.value))?a:a.map(s=>s.isToken&&s.value==="do"?{isToken:!0,value:"d"}:s),ordinalNumber:gd,era:Q({values:ud,defaultWidth:"wide"}),quarter:Q({values:md,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Q({values:fd,defaultWidth:"wide"}),day:Q({values:hd,defaultWidth:"wide"}),dayPeriod:Q({values:pd,defaultWidth:"wide"})},vd=/^(\d+)(ième|ère|ème|er|e)?/i,yd=/\d+/i,wd={narrow:/^(av\.J\.C|ap\.J\.C|ap\.J\.-C)/i,abbreviated:/^(av\.J\.-C|av\.J-C|apr\.J\.-C|apr\.J-C|ap\.J-C)/i,wide:/^(avant Jésus-Christ|après Jésus-Christ)/i},jd={any:[/^av/i,/^ap/i]},Nd={narrow:/^T?[1234]/i,abbreviated:/^[1234](er|ème|e)? trim\.?/i,wide:/^[1234](er|ème|e)? trimestre/i},Sd={any:[/1/i,/2/i,/3/i,/4/i]},kd={narrow:/^[jfmasond]/i,abbreviated:/^(janv|févr|mars|avr|mai|juin|juill|juil|août|sept|oct|nov|déc)\.?/i,wide:/^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i},Cd={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^av/i,/^ma/i,/^juin/i,/^juil/i,/^ao/i,/^s/i,/^o/i,/^n/i,/^d/i]},Td={narrow:/^[lmjvsd]/i,short:/^(di|lu|ma|me|je|ve|sa)/i,abbreviated:/^(dim|lun|mar|mer|jeu|ven|sam)\.?/i,wide:/^(dimanche|lundi|mardi|mercredi|jeudi|vendredi|samedi)/i},Ed={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^di/i,/^lu/i,/^ma/i,/^me/i,/^je/i,/^ve/i,/^sa/i]},Pd={narrow:/^(a|p|minuit|midi|mat\.?|ap\.?m\.?|soir|nuit)/i,any:/^([ap]\.?\s?m\.?|du matin|de l'après[-\s]midi|du soir|de la nuit)/i},Dd={any:{am:/^a/i,pm:/^p/i,midnight:/^min/i,noon:/^mid/i,morning:/mat/i,afternoon:/ap/i,evening:/soir/i,night:/nuit/i}},Md={ordinalNumber:yt({matchPattern:vd,parsePattern:yd,valueCallback:t=>parseInt(t)}),era:ee({matchPatterns:wd,defaultMatchWidth:"wide",parsePatterns:jd,defaultParseWidth:"any"}),quarter:ee({matchPatterns:Nd,defaultMatchWidth:"wide",parsePatterns:Sd,defaultParseWidth:"any",valueCallback:t=>t+1}),month:ee({matchPatterns:kd,defaultMatchWidth:"wide",parsePatterns:Cd,defaultParseWidth:"any"}),day:ee({matchPatterns:Td,defaultMatchWidth:"wide",parsePatterns:Ed,defaultParseWidth:"any"}),dayPeriod:ee({matchPatterns:Pd,defaultMatchWidth:"any",parsePatterns:Dd,defaultParseWidth:"any"})},Ot={code:"fr",formatDistance:sd,formatLong:ld,formatRelative:dd,localize:xd,match:Md,options:{weekStartsOn:1,firstWeekContainsDate:4}},Rd={lessThanXSeconds:{one:"meno di un secondo",other:"meno di {{count}} secondi"},xSeconds:{one:"un secondo",other:"{{count}} secondi"},halfAMinute:"alcuni secondi",lessThanXMinutes:{one:"meno di un minuto",other:"meno di {{count}} minuti"},xMinutes:{one:"un minuto",other:"{{count}} minuti"},aboutXHours:{one:"circa un'ora",other:"circa {{count}} ore"},xHours:{one:"un'ora",other:"{{count}} ore"},xDays:{one:"un giorno",other:"{{count}} giorni"},aboutXWeeks:{one:"circa una settimana",other:"circa {{count}} settimane"},xWeeks:{one:"una settimana",other:"{{count}} settimane"},aboutXMonths:{one:"circa un mese",other:"circa {{count}} mesi"},xMonths:{one:"un mese",other:"{{count}} mesi"},aboutXYears:{one:"circa un anno",other:"circa {{count}} anni"},xYears:{one:"un anno",other:"{{count}} anni"},overXYears:{one:"più di un anno",other:"più di {{count}} anni"},almostXYears:{one:"quasi un anno",other:"quasi {{count}} anni"}},$d=(t,a,r)=>{let s;const n=Rd[t];return typeof n=="string"?s=n:a===1?s=n.one:s=n.other.replace("{{count}}",a.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"tra "+s:s+" fa":s},Ad={full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"dd/MM/y"},Fd={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},Ld={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},Id={date:je({formats:Ad,defaultWidth:"full"}),time:je({formats:Fd,defaultWidth:"full"}),dateTime:je({formats:Ld,defaultWidth:"full"})},xr=["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"];function Od(t){switch(t){case 0:return"'domenica scorsa alle' p";default:return"'"+xr[t]+" scorso alle' p"}}function ds(t){return"'"+xr[t]+" alle' p"}function _d(t){switch(t){case 0:return"'domenica prossima alle' p";default:return"'"+xr[t]+" prossimo alle' p"}}const zd={lastWeek:(t,a,r)=>{const s=t.getDay();return tr(t,a,r)?ds(s):Od(s)},yesterday:"'ieri alle' p",today:"'oggi alle' p",tomorrow:"'domani alle' p",nextWeek:(t,a,r)=>{const s=t.getDay();return tr(t,a,r)?ds(s):_d(s)},other:"P"},Vd=(t,a,r,s)=>{const n=zd[t];return typeof n=="function"?n(a,r,s):n},Wd={narrow:["aC","dC"],abbreviated:["a.C.","d.C."],wide:["avanti Cristo","dopo Cristo"]},Hd={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},qd={narrow:["G","F","M","A","M","G","L","A","S","O","N","D"],abbreviated:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],wide:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"]},Ud={narrow:["D","L","M","M","G","V","S"],short:["dom","lun","mar","mer","gio","ven","sab"],abbreviated:["dom","lun","mar","mer","gio","ven","sab"],wide:["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"]},Bd={narrow:{am:"m.",pm:"p.",midnight:"mezzanotte",noon:"mezzogiorno",morning:"mattina",afternoon:"pomeriggio",evening:"sera",night:"notte"},abbreviated:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"mattina",afternoon:"pomeriggio",evening:"sera",night:"notte"},wide:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"mattina",afternoon:"pomeriggio",evening:"sera",night:"notte"}},Gd={narrow:{am:"m.",pm:"p.",midnight:"mezzanotte",noon:"mezzogiorno",morning:"di mattina",afternoon:"del pomeriggio",evening:"di sera",night:"di notte"},abbreviated:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"di mattina",afternoon:"del pomeriggio",evening:"di sera",night:"di notte"},wide:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"di mattina",afternoon:"del pomeriggio",evening:"di sera",night:"di notte"}},Xd=(t,a)=>{const r=Number(t);return String(r)},Jd={ordinalNumber:Xd,era:Q({values:Wd,defaultWidth:"wide"}),quarter:Q({values:Hd,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Q({values:qd,defaultWidth:"wide"}),day:Q({values:Ud,defaultWidth:"wide"}),dayPeriod:Q({values:Bd,defaultWidth:"wide",formattingValues:Gd,defaultFormattingWidth:"wide"})},Yd=/^(\d+)(º)?/i,Kd=/\d+/i,Zd={narrow:/^(aC|dC)/i,abbreviated:/^(a\.?\s?C\.?|a\.?\s?e\.?\s?v\.?|d\.?\s?C\.?|e\.?\s?v\.?)/i,wide:/^(avanti Cristo|avanti Era Volgare|dopo Cristo|Era Volgare)/i},Qd={any:[/^a/i,/^(d|e)/i]},eu={narrow:/^[1234]/i,abbreviated:/^t[1234]/i,wide:/^[1234](º)? trimestre/i},tu={any:[/1/i,/2/i,/3/i,/4/i]},au={narrow:/^[gfmalsond]/i,abbreviated:/^(gen|feb|mar|apr|mag|giu|lug|ago|set|ott|nov|dic)/i,wide:/^(gennaio|febbraio|marzo|aprile|maggio|giugno|luglio|agosto|settembre|ottobre|novembre|dicembre)/i},ru={narrow:[/^g/i,/^f/i,/^m/i,/^a/i,/^m/i,/^g/i,/^l/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ge/i,/^f/i,/^mar/i,/^ap/i,/^mag/i,/^gi/i,/^l/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},su={narrow:/^[dlmgvs]/i,short:/^(do|lu|ma|me|gi|ve|sa)/i,abbreviated:/^(dom|lun|mar|mer|gio|ven|sab)/i,wide:/^(domenica|luned[i|ì]|marted[i|ì]|mercoled[i|ì]|gioved[i|ì]|venerd[i|ì]|sabato)/i},nu={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^g/i,/^v/i,/^s/i],any:[/^d/i,/^l/i,/^ma/i,/^me/i,/^g/i,/^v/i,/^s/i]},ou={narrow:/^(a|m\.|p|mezzanotte|mezzogiorno|(di|del) (mattina|pomeriggio|sera|notte))/i,any:/^([ap]\.?\s?m\.?|mezzanotte|mezzogiorno|(di|del) (mattina|pomeriggio|sera|notte))/i},iu={any:{am:/^a/i,pm:/^p/i,midnight:/^mezza/i,noon:/^mezzo/i,morning:/mattina/i,afternoon:/pomeriggio/i,evening:/sera/i,night:/notte/i}},lu={ordinalNumber:yt({matchPattern:Yd,parsePattern:Kd,valueCallback:t=>parseInt(t,10)}),era:ee({matchPatterns:Zd,defaultMatchWidth:"wide",parsePatterns:Qd,defaultParseWidth:"any"}),quarter:ee({matchPatterns:eu,defaultMatchWidth:"wide",parsePatterns:tu,defaultParseWidth:"any",valueCallback:t=>t+1}),month:ee({matchPatterns:au,defaultMatchWidth:"wide",parsePatterns:ru,defaultParseWidth:"any"}),day:ee({matchPatterns:su,defaultMatchWidth:"wide",parsePatterns:nu,defaultParseWidth:"any"}),dayPeriod:ee({matchPatterns:ou,defaultMatchWidth:"any",parsePatterns:iu,defaultParseWidth:"any"})},nn={code:"it",formatDistance:$d,formatLong:Id,formatRelative:Vd,localize:Jd,match:lu,options:{weekStartsOn:1,firstWeekContainsDate:4}},cu={lessThanXSeconds:{one:"1秒未満",other:"{{count}}秒未満",oneWithSuffix:"約1秒",otherWithSuffix:"約{{count}}秒"},xSeconds:{one:"1秒",other:"{{count}}秒"},halfAMinute:"30秒",lessThanXMinutes:{one:"1分未満",other:"{{count}}分未満",oneWithSuffix:"約1分",otherWithSuffix:"約{{count}}分"},xMinutes:{one:"1分",other:"{{count}}分"},aboutXHours:{one:"約1時間",other:"約{{count}}時間"},xHours:{one:"1時間",other:"{{count}}時間"},xDays:{one:"1日",other:"{{count}}日"},aboutXWeeks:{one:"約1週間",other:"約{{count}}週間"},xWeeks:{one:"1週間",other:"{{count}}週間"},aboutXMonths:{one:"約1か月",other:"約{{count}}か月"},xMonths:{one:"1か月",other:"{{count}}か月"},aboutXYears:{one:"約1年",other:"約{{count}}年"},xYears:{one:"1年",other:"{{count}}年"},overXYears:{one:"1年以上",other:"{{count}}年以上"},almostXYears:{one:"1年近く",other:"{{count}}年近く"}},du=(t,a,r)=>{r=r||{};let s;const n=cu[t];return typeof n=="string"?s=n:a===1?r.addSuffix&&n.oneWithSuffix?s=n.oneWithSuffix:s=n.one:r.addSuffix&&n.otherWithSuffix?s=n.otherWithSuffix.replace("{{count}}",String(a)):s=n.other.replace("{{count}}",String(a)),r.addSuffix?r.comparison&&r.comparison>0?s+"後":s+"前":s},uu={full:"y年M月d日EEEE",long:"y年M月d日",medium:"y/MM/dd",short:"y/MM/dd"},mu={full:"H時mm分ss秒 zzzz",long:"H:mm:ss z",medium:"H:mm:ss",short:"H:mm"},fu={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},hu={date:je({formats:uu,defaultWidth:"full"}),time:je({formats:mu,defaultWidth:"full"}),dateTime:je({formats:fu,defaultWidth:"full"})},pu={lastWeek:"先週のeeeeのp",yesterday:"昨日のp",today:"今日のp",tomorrow:"明日のp",nextWeek:"翌週のeeeeのp",other:"P"},gu=(t,a,r,s)=>pu[t],bu={narrow:["BC","AC"],abbreviated:["紀元前","西暦"],wide:["紀元前","西暦"]},xu={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["第1四半期","第2四半期","第3四半期","第4四半期"]},vu={narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"]},yu={narrow:["日","月","火","水","木","金","土"],short:["日","月","火","水","木","金","土"],abbreviated:["日","月","火","水","木","金","土"],wide:["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日"]},wu={narrow:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"},abbreviated:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"},wide:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"}},ju={narrow:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"},abbreviated:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"},wide:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"}},Nu=(t,a)=>{const r=Number(t);switch(String(a?.unit)){case"year":return`${r}年`;case"quarter":return`第${r}四半期`;case"month":return`${r}月`;case"week":return`第${r}週`;case"date":return`${r}日`;case"hour":return`${r}時`;case"minute":return`${r}分`;case"second":return`${r}秒`;default:return`${r}`}},Su={ordinalNumber:Nu,era:Q({values:bu,defaultWidth:"wide"}),quarter:Q({values:xu,defaultWidth:"wide",argumentCallback:t=>Number(t)-1}),month:Q({values:vu,defaultWidth:"wide"}),day:Q({values:yu,defaultWidth:"wide"}),dayPeriod:Q({values:wu,defaultWidth:"wide",formattingValues:ju,defaultFormattingWidth:"wide"})},ku=/^第?\d+(年|四半期|月|週|日|時|分|秒)?/i,Cu=/\d+/i,Tu={narrow:/^(B\.?C\.?|A\.?D\.?)/i,abbreviated:/^(紀元[前後]|西暦)/i,wide:/^(紀元[前後]|西暦)/i},Eu={narrow:[/^B/i,/^A/i],any:[/^(紀元前)/i,/^(西暦|紀元後)/i]},Pu={narrow:/^[1234]/i,abbreviated:/^Q[1234]/i,wide:/^第[1234一二三四1234]四半期/i},Du={any:[/(1|一|1)/i,/(2|二|2)/i,/(3|三|3)/i,/(4|四|4)/i]},Mu={narrow:/^([123456789]|1[012])/,abbreviated:/^([123456789]|1[012])月/i,wide:/^([123456789]|1[012])月/i},Ru={any:[/^1\D/,/^2/,/^3/,/^4/,/^5/,/^6/,/^7/,/^8/,/^9/,/^10/,/^11/,/^12/]},$u={narrow:/^[日月火水木金土]/,short:/^[日月火水木金土]/,abbreviated:/^[日月火水木金土]/,wide:/^[日月火水木金土]曜日/},Au={any:[/^日/,/^月/,/^火/,/^水/,/^木/,/^金/,/^土/]},Fu={any:/^(AM|PM|午前|午後|正午|深夜|真夜中|夜|朝)/i},Lu={any:{am:/^(A|午前)/i,pm:/^(P|午後)/i,midnight:/^深夜|真夜中/i,noon:/^正午/i,morning:/^朝/i,afternoon:/^午後/i,evening:/^夜/i,night:/^深夜/i}},Iu={ordinalNumber:yt({matchPattern:ku,parsePattern:Cu,valueCallback:function(t){return parseInt(t,10)}}),era:ee({matchPatterns:Tu,defaultMatchWidth:"wide",parsePatterns:Eu,defaultParseWidth:"any"}),quarter:ee({matchPatterns:Pu,defaultMatchWidth:"wide",parsePatterns:Du,defaultParseWidth:"any",valueCallback:t=>t+1}),month:ee({matchPatterns:Mu,defaultMatchWidth:"wide",parsePatterns:Ru,defaultParseWidth:"any"}),day:ee({matchPatterns:$u,defaultMatchWidth:"wide",parsePatterns:Au,defaultParseWidth:"any"}),dayPeriod:ee({matchPatterns:Fu,defaultMatchWidth:"any",parsePatterns:Lu,defaultParseWidth:"any"})},on={code:"ja",formatDistance:du,formatLong:hu,formatRelative:gu,localize:Su,match:Iu,options:{weekStartsOn:0,firstWeekContainsDate:1}},Ou={lessThanXSeconds:{one:"menos de um segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"meio minuto",lessThanXMinutes:{one:"menos de um minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"aproximadamente 1 hora",other:"aproximadamente {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 dia",other:"{{count}} dias"},aboutXWeeks:{one:"aproximadamente 1 semana",other:"aproximadamente {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"aproximadamente 1 mês",other:"aproximadamente {{count}} meses"},xMonths:{one:"1 mês",other:"{{count}} meses"},aboutXYears:{one:"aproximadamente 1 ano",other:"aproximadamente {{count}} anos"},xYears:{one:"1 ano",other:"{{count}} anos"},overXYears:{one:"mais de 1 ano",other:"mais de {{count}} anos"},almostXYears:{one:"quase 1 ano",other:"quase {{count}} anos"}},_u=(t,a,r)=>{let s;const n=Ou[t];return typeof n=="string"?s=n:a===1?s=n.one:s=n.other.replace("{{count}}",String(a)),r?.addSuffix?r.comparison&&r.comparison>0?"daqui a "+s:"há "+s:s},zu={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d 'de' MMM 'de' y",short:"dd/MM/y"},Vu={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},Wu={full:"{{date}} 'às' {{time}}",long:"{{date}} 'às' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Hu={date:je({formats:zu,defaultWidth:"full"}),time:je({formats:Vu,defaultWidth:"full"}),dateTime:je({formats:Wu,defaultWidth:"full"})},qu={lastWeek:t=>{const a=t.getDay();return"'"+(a===0||a===6?"último":"última")+"' eeee 'às' p"},yesterday:"'ontem às' p",today:"'hoje às' p",tomorrow:"'amanhã às' p",nextWeek:"eeee 'às' p",other:"P"},Uu=(t,a,r,s)=>{const n=qu[t];return typeof n=="function"?n(a):n},Bu={narrow:["aC","dC"],abbreviated:["a.C.","d.C."],wide:["antes de Cristo","depois de Cristo"]},Gu={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},Xu={narrow:["j","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],wide:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"]},Ju={narrow:["d","s","t","q","q","s","s"],short:["dom","seg","ter","qua","qui","sex","sáb"],abbreviated:["dom","seg","ter","qua","qui","sex","sáb"],wide:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"]},Yu={narrow:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"noite",night:"madrugada"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"noite",night:"madrugada"},wide:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"noite",night:"madrugada"}},Ku={narrow:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da noite",night:"da madrugada"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da noite",night:"da madrugada"},wide:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da noite",night:"da madrugada"}},Zu=(t,a)=>Number(t)+"º",Qu={ordinalNumber:Zu,era:Q({values:Bu,defaultWidth:"wide"}),quarter:Q({values:Gu,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Q({values:Xu,defaultWidth:"wide"}),day:Q({values:Ju,defaultWidth:"wide"}),dayPeriod:Q({values:Yu,defaultWidth:"wide",formattingValues:Ku,defaultFormattingWidth:"wide"})},em=/^(\d+)(º|ª)?/i,tm=/\d+/i,am={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,wide:/^(antes de cristo|antes da era comum|depois de cristo|era comum)/i},rm={any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes da era comum)/i,/^(depois de cristo|era comum)/i]},sm={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º|ª)? trimestre/i},nm={any:[/1/i,/2/i,/3/i,/4/i]},om={narrow:/^[jfmasond]/i,abbreviated:/^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,wide:/^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i},im={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ab/i,/^mai/i,/^jun/i,/^jul/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},lm={narrow:/^[dstq]/i,short:/^(dom|seg|ter|qua|qui|sex|s[áa]b)/i,abbreviated:/^(dom|seg|ter|qua|qui|sex|s[áa]b)/i,wide:/^(domingo|segunda-?\s?feira|terça-?\s?feira|quarta-?\s?feira|quinta-?\s?feira|sexta-?\s?feira|s[áa]bado)/i},cm={narrow:[/^d/i,/^s/i,/^t/i,/^q/i,/^q/i,/^s/i,/^s/i],any:[/^d/i,/^seg/i,/^t/i,/^qua/i,/^qui/i,/^sex/i,/^s[áa]/i]},dm={narrow:/^(a|p|meia-?\s?noite|meio-?\s?dia|(da) (manh[ãa]|tarde|noite|madrugada))/i,any:/^([ap]\.?\s?m\.?|meia-?\s?noite|meio-?\s?dia|(da) (manh[ãa]|tarde|noite|madrugada))/i},um={any:{am:/^a/i,pm:/^p/i,midnight:/^meia/i,noon:/^meio/i,morning:/manh[ãa]/i,afternoon:/tarde/i,evening:/noite/i,night:/madrugada/i}},mm={ordinalNumber:yt({matchPattern:em,parsePattern:tm,valueCallback:t=>parseInt(t,10)}),era:ee({matchPatterns:am,defaultMatchWidth:"wide",parsePatterns:rm,defaultParseWidth:"any"}),quarter:ee({matchPatterns:sm,defaultMatchWidth:"wide",parsePatterns:nm,defaultParseWidth:"any",valueCallback:t=>t+1}),month:ee({matchPatterns:om,defaultMatchWidth:"wide",parsePatterns:im,defaultParseWidth:"any"}),day:ee({matchPatterns:lm,defaultMatchWidth:"wide",parsePatterns:cm,defaultParseWidth:"any"}),dayPeriod:ee({matchPatterns:dm,defaultMatchWidth:"any",parsePatterns:um,defaultParseWidth:"any"})},ln={code:"pt",formatDistance:_u,formatLong:Hu,formatRelative:Uu,localize:Qu,match:mm,options:{weekStartsOn:1,firstWeekContainsDate:4}},fm={lessThanXSeconds:{one:"不到 1 秒",other:"不到 {{count}} 秒"},xSeconds:{one:"1 秒",other:"{{count}} 秒"},halfAMinute:"半分钟",lessThanXMinutes:{one:"不到 1 分钟",other:"不到 {{count}} 分钟"},xMinutes:{one:"1 分钟",other:"{{count}} 分钟"},xHours:{one:"1 小时",other:"{{count}} 小时"},aboutXHours:{one:"大约 1 小时",other:"大约 {{count}} 小时"},xDays:{one:"1 天",other:"{{count}} 天"},aboutXWeeks:{one:"大约 1 个星期",other:"大约 {{count}} 个星期"},xWeeks:{one:"1 个星期",other:"{{count}} 个星期"},aboutXMonths:{one:"大约 1 个月",other:"大约 {{count}} 个月"},xMonths:{one:"1 个月",other:"{{count}} 个月"},aboutXYears:{one:"大约 1 年",other:"大约 {{count}} 年"},xYears:{one:"1 年",other:"{{count}} 年"},overXYears:{one:"超过 1 年",other:"超过 {{count}} 年"},almostXYears:{one:"将近 1 年",other:"将近 {{count}} 年"}},hm=(t,a,r)=>{let s;const n=fm[t];return typeof n=="string"?s=n:a===1?s=n.one:s=n.other.replace("{{count}}",String(a)),r?.addSuffix?r.comparison&&r.comparison>0?s+"内":s+"前":s},pm={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},gm={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},bm={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},xm={date:je({formats:pm,defaultWidth:"full"}),time:je({formats:gm,defaultWidth:"full"}),dateTime:je({formats:bm,defaultWidth:"full"})};function us(t,a,r){const s="eeee p";return tr(t,a,r)?s:t.getTime()>a.getTime()?"'下个'"+s:"'上个'"+s}const vm={lastWeek:us,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:us,other:"PP p"},ym=(t,a,r,s)=>{const n=vm[t];return typeof n=="function"?n(a,r,s):n},wm={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},jm={narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},Nm={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},Sm={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},km={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},Cm={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},Tm=(t,a)=>{const r=Number(t);switch(a?.unit){case"date":return r.toString()+"日";case"hour":return r.toString()+"时";case"minute":return r.toString()+"分";case"second":return r.toString()+"秒";default:return"第 "+r.toString()}},Em={ordinalNumber:Tm,era:Q({values:wm,defaultWidth:"wide"}),quarter:Q({values:jm,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Q({values:Nm,defaultWidth:"wide"}),day:Q({values:Sm,defaultWidth:"wide"}),dayPeriod:Q({values:km,defaultWidth:"wide",formattingValues:Cm,defaultFormattingWidth:"wide"})},Pm=/^(第\s*)?\d+(日|时|分|秒)?/i,Dm=/\d+/i,Mm={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},Rm={any:[/^(前)/i,/^(公元)/i]},$m={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},Am={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},Fm={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},Lm={narrow:[/^一/i,/^二/i,/^三/i,/^四/i,/^五/i,/^六/i,/^七/i,/^八/i,/^九/i,/^十(?!(一|二))/i,/^十一/i,/^十二/i],any:[/^一|1/i,/^二|2/i,/^三|3/i,/^四|4/i,/^五|5/i,/^六|6/i,/^七|7/i,/^八|8/i,/^九|9/i,/^十(?!(一|二))|10/i,/^十一|11/i,/^十二|12/i]},Im={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},Om={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},_m={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},zm={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},Vm={ordinalNumber:yt({matchPattern:Pm,parsePattern:Dm,valueCallback:t=>parseInt(t,10)}),era:ee({matchPatterns:Mm,defaultMatchWidth:"wide",parsePatterns:Rm,defaultParseWidth:"any"}),quarter:ee({matchPatterns:$m,defaultMatchWidth:"wide",parsePatterns:Am,defaultParseWidth:"any",valueCallback:t=>t+1}),month:ee({matchPatterns:Fm,defaultMatchWidth:"wide",parsePatterns:Lm,defaultParseWidth:"any"}),day:ee({matchPatterns:Im,defaultMatchWidth:"wide",parsePatterns:Om,defaultParseWidth:"any"}),dayPeriod:ee({matchPatterns:_m,defaultMatchWidth:"any",parsePatterns:zm,defaultParseWidth:"any"})},cn={code:"zh-CN",formatDistance:hm,formatLong:xm,formatRelative:ym,localize:Em,match:Vm,options:{weekStartsOn:1,firstWeekContainsDate:4}},Wm=(t=Ot)=>[{label:"Aujourd'hui",value:()=>new Date},{label:"Hier",value:()=>M.subDays(new Date,1)},{label:"Demain",value:()=>M.addDays(new Date,1)},{label:"Cette semaine",range:()=>({from:M.startOfWeek(new Date,{locale:t}),to:M.endOfWeek(new Date,{locale:t})})},{label:"Semaine dernière",range:()=>({from:M.startOfWeek(M.subWeeks(new Date,1),{locale:t}),to:M.endOfWeek(M.subWeeks(new Date,1),{locale:t})})},{label:"Ce mois",range:()=>({from:M.startOfMonth(new Date),to:M.endOfMonth(new Date)})},{label:"Mois dernier",range:()=>({from:M.startOfMonth(M.subMonths(new Date,1)),to:M.endOfMonth(M.subMonths(new Date,1))})},{label:"Ce trimestre",range:()=>({from:M.startOfQuarter(new Date),to:M.endOfQuarter(new Date)})},{label:"Cette année",range:()=>({from:M.startOfYear(new Date),to:M.endOfYear(new Date)})}],Hm=()=>[{label:"7 derniers jours",range:()=>({from:M.subDays(new Date,7),to:new Date})},{label:"30 derniers jours",range:()=>({from:M.subDays(new Date,30),to:new Date})},{label:"90 derniers jours",range:()=>({from:M.subDays(new Date,90),to:new Date})}],qm=t=>t.map(a=>({label:`${a} prochains jours`,range:()=>({from:new Date,to:M.addDays(new Date,a)})})),Um=(t,a)=>{if(typeof a=="function"){const r=a();return"from"in r&&r.from&&r.to?{label:t,range:()=>({from:r.from,to:r.to})}:{label:t,value:a}}return"from"in a&&a.from&&a.to?{label:t,range:{from:a.from,to:a.to}}:{label:t,value:a}},Bm=t=>M.isAfter(t,M.endOfDay(new Date)),dn=t=>M.isBefore(t,M.startOfDay(new Date)),Gm=t=>{const a=new Date;return t.getDate()===a.getDate()&&t.getMonth()===a.getMonth()&&t.getFullYear()===a.getFullYear()},vr=t=>{const a=t.getDay();return a!==0&&a!==6},un=t=>{const a=t.getDay();return a===0||a===6},mn=(t,a)=>a.some(r=>M.isEqual(M.startOfDay(r),M.startOfDay(t))),ct=(t,a,r)=>M.isWithinInterval(t,{start:a,end:r}),Xm=t=>a=>{const r=M.subYears(new Date,t);return M.isAfter(a,r)?`L'âge minimum est de ${t} ans`:!0},Jm=t=>a=>{const r=M.subYears(new Date,t);return M.isBefore(a,r)?`L'âge maximum est de ${t} ans`:!0},Ym=t=>dn(t)?"Cette date est expirée":!0,Km=(t,a)=>({days:M.differenceInDays(a,t),weeks:M.differenceInWeeks(a,t),months:M.differenceInMonths(a,t)}),Zm=(t,a="PPP",r=Ot)=>t.from?t.to?`${M.format(t.from,a,{locale:r})} - ${M.format(t.to,a,{locale:r})}`:M.format(t.from,a,{locale:r}):"",Qm=t=>[new Date(t,0,1),new Date(t,4,1),new Date(t,4,8),new Date(t,6,14),new Date(t,7,15),new Date(t,10,1),new Date(t,10,11),new Date(t,11,25)],yr=(t,a)=>{const r=[],s=M.startOfMonth(new Date(t,a)),n=M.endOfMonth(new Date(t,a));let o=s;for(;M.isBefore(o,n)||M.isEqual(o,n);)r.push(o),o=M.addDays(o,1);return r},ef=(t,a)=>yr(t,a).filter(un),tf=(t,a)=>yr(t,a).filter(vr),af=()=>t=>{const a=new Date,r=M.endOfMonth(t);if(M.isBefore(r,a))return"La carte est expirée";const s=M.addMonths(a,3);return M.isBefore(r,s)?"La carte expire bientôt":!0},rf=t=>a=>{const r=M.addDays(new Date,t);return M.isBefore(a,r)?`La réservation doit être faite ${t} jours à l'avance minimum`:!0},sf=t=>a=>!a.from||!a.to?!0:M.differenceInDays(a.to,a.from)>t?`La période ne peut pas dépasser ${t} jours`:!0,nf=(t,a)=>M.isEqual(M.startOfDay(t),M.startOfDay(a)),of=(t,a,r=[])=>{let s=0,n=M.startOfDay(t);const o=M.startOfDay(a);for(;M.isBefore(n,o)||M.isEqual(n,o);)vr(n)&&!mn(n,r)&&s++,n=M.addDays(n,1);return s},lf=t=>{const a=t||new Date().getFullYear();return[1,2,3,4].map(r=>{const s=M.startOfQuarter(new Date(a,(r-1)*3,1)),n=M.endOfQuarter(s);return{label:`T${r} ${a}`,range:()=>({from:s,to:n})}})},cf=(t,a=Ot)=>{const r=t||new Date().getFullYear();return Array.from({length:12},(s,n)=>{const o=M.startOfMonth(new Date(r,n,1)),d=M.endOfMonth(o);return{label:M.format(o,"MMMM yyyy",{locale:a}),range:()=>({from:o,to:d})}})},df=t=>t.getTime(),uf=t=>new Date(t),mf=t=>M.startOfDay(t),ff=(t,a)=>!t.from||!t.to||!a.from||!a.to?!1:M.isEqual(M.startOfDay(t.from),M.startOfDay(a.from))&&M.isEqual(M.startOfDay(t.to),M.startOfDay(a.to)),hf=(t,a)=>!t.from||!t.to||!a.from||!a.to||!(ct(t.from,a.from,a.to)||ct(t.to,a.from,a.to)||ct(a.from,t.from,t.to)||ct(a.to,t.from,t.to))?null:{from:M.isBefore(t.from,a.from)?t.from:a.from,to:M.isAfter(t.to,a.to)?t.to:a.to},pf=(t,a)=>!t.from||!t.to||!a.from||!a.to?!1:ct(t.from,a.from,a.to)||ct(t.to,a.from,a.to)||ct(a.from,t.from,t.to)||ct(a.to,t.from,t.to);class wr{constructor(a){this.loadedThemes=new Set,this.styleElements=new Map,this.config={baseUrl:a.baseUrl,cache:a.cache??!0,timeout:a.timeout??1e4,onError:a.onError??(r=>console.error("Theme loading error:",r)),onSuccess:a.onSuccess??(()=>{})}}async loadTheme(a){if(this.config.cache&&this.loadedThemes.has(a)){console.log(`Theme "${a}" already loaded from cache`),this.applyTheme(a);return}try{const r=new AbortController,s=setTimeout(()=>r.abort(),this.config.timeout),n=this.buildThemeUrl(a);console.log(`Loading theme from: ${n}`);const o=await fetch(n,{signal:r.signal,headers:{Accept:"text/css"}});if(clearTimeout(s),!o.ok)throw new Error(`Failed to load theme: ${o.status} ${o.statusText}`);const d=await o.text();if(!d.includes(`[data-theme="${a}"]`))throw new Error(`Invalid theme CSS: missing [data-theme="${a}"] selector`);this.injectThemeStyles(a,d),this.loadedThemes.add(a),this.applyTheme(a),this.config.onSuccess(a)}catch(r){const s=r instanceof Error?r:new Error(String(r));throw this.config.onError(s,a),s}}applyTheme(a){if(typeof document>"u")return;document.documentElement.setAttribute("data-theme",a);try{localStorage.setItem("theme",a)}catch(s){console.warn("Could not save theme to localStorage:",s)}console.log(`Applied theme: ${a}`)}getCurrentTheme(){return typeof document>"u"?null:document.documentElement.getAttribute("data-theme")}loadSavedTheme(){if(typeof window>"u")return null;try{return localStorage.getItem("theme")}catch(a){return console.warn("Could not load theme from localStorage:",a),null}}async preloadThemes(a){console.log(`Preloading ${a.length} themes...`),await Promise.allSettled(a.map(r=>this.loadTheme(r))),console.log(`Preloaded ${this.loadedThemes.size} themes`)}unloadTheme(a){const r=this.styleElements.get(a);r&&(r.remove(),this.styleElements.delete(a)),this.loadedThemes.delete(a),console.log(`Unloaded theme: ${a}`)}clearCache(){this.styleElements.forEach(a=>a.remove()),this.styleElements.clear(),this.loadedThemes.clear(),console.log("Theme cache cleared")}getLoadedThemes(){return Array.from(this.loadedThemes)}buildThemeUrl(a){return`${this.config.baseUrl.replace(/\/$/,"")}/${a}.css`}injectThemeStyles(a,r){if(typeof document>"u")return;const s=this.styleElements.get(a);s&&s.remove();const n=document.createElement("style");n.setAttribute("data-theme-name",a),n.textContent=r,document.head.appendChild(n),this.styleElements.set(a,n)}}let na=null;function gf(t){return na=new wr(t),na}function jr(){if(!na)throw new Error("ThemeLoader not initialized. Call initThemeLoader() first.");return na}async function bf(t){return jr().loadTheme(t)}function xf(t){jr().applyTheme(t)}function vf(t){if(typeof window>"u")return{loadTheme:async()=>{},applyTheme:()=>{},currentTheme:null,loadedThemes:[],isLoading:!1};const a=na||new wr({baseUrl:t?.baseUrl||"/themes",...t}),[r,s]=i.useState(!1),[n,o]=i.useState(a.getCurrentTheme());return{loadTheme:async h=>{s(!0);try{await a.loadTheme(h),o(h)}finally{s(!1)}},applyTheme:h=>{a.applyTheme(h),o(h)},currentTheme:n,loadedThemes:a.getLoadedThemes(),isLoading:r}}var ms=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function yf(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var qa={exports:{}},fs;function wf(){return fs||(fs=1,(function(t){var a=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};var r=(function(s){var n=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,o=0,d={},u={manual:s.Prism&&s.Prism.manual,disableWorkerMessageHandler:s.Prism&&s.Prism.disableWorkerMessageHandler,util:{encode:function l(c){return c instanceof h?new h(c.type,l(c.content),c.alias):Array.isArray(c)?c.map(l):c.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(l){return Object.prototype.toString.call(l).slice(8,-1)},objId:function(l){return l.__id||Object.defineProperty(l,"__id",{value:++o}),l.__id},clone:function l(c,p){p=p||{};var x,N;switch(u.util.type(c)){case"Object":if(N=u.util.objId(c),p[N])return p[N];x={},p[N]=x;for(var R in c)c.hasOwnProperty(R)&&(x[R]=l(c[R],p));return x;case"Array":return N=u.util.objId(c),p[N]?p[N]:(x=[],p[N]=x,c.forEach(function(F,D){x[D]=l(F,p)}),x);default:return c}},getLanguage:function(l){for(;l;){var c=n.exec(l.className);if(c)return c[1].toLowerCase();l=l.parentElement}return"none"},setLanguage:function(l,c){l.className=l.className.replace(RegExp(n,"gi"),""),l.classList.add("language-"+c)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(x){var l=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(x.stack)||[])[1];if(l){var c=document.getElementsByTagName("script");for(var p in c)if(c[p].src==l)return c[p]}return null}},isActive:function(l,c,p){for(var x="no-"+c;l;){var N=l.classList;if(N.contains(c))return!0;if(N.contains(x))return!1;l=l.parentElement}return!!p}},languages:{plain:d,plaintext:d,text:d,txt:d,extend:function(l,c){var p=u.util.clone(u.languages[l]);for(var x in c)p[x]=c[x];return p},insertBefore:function(l,c,p,x){x=x||u.languages;var N=x[l],R={};for(var F in N)if(N.hasOwnProperty(F)){if(F==c)for(var D in p)p.hasOwnProperty(D)&&(R[D]=p[D]);p.hasOwnProperty(F)||(R[F]=N[F])}var T=x[l];return x[l]=R,u.languages.DFS(u.languages,function(P,L){L===T&&P!=l&&(this[P]=R)}),R},DFS:function l(c,p,x,N){N=N||{};var R=u.util.objId;for(var F in c)if(c.hasOwnProperty(F)){p.call(c,F,c[F],x||F);var D=c[F],T=u.util.type(D);T==="Object"&&!N[R(D)]?(N[R(D)]=!0,l(D,p,null,N)):T==="Array"&&!N[R(D)]&&(N[R(D)]=!0,l(D,p,F,N))}}},plugins:{},highlightAll:function(l,c){u.highlightAllUnder(document,l,c)},highlightAllUnder:function(l,c,p){var x={callback:p,container:l,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};u.hooks.run("before-highlightall",x),x.elements=Array.prototype.slice.apply(x.container.querySelectorAll(x.selector)),u.hooks.run("before-all-elements-highlight",x);for(var N=0,R;R=x.elements[N++];)u.highlightElement(R,c===!0,x.callback)},highlightElement:function(l,c,p){var x=u.util.getLanguage(l),N=u.languages[x];u.util.setLanguage(l,x);var R=l.parentElement;R&&R.nodeName.toLowerCase()==="pre"&&u.util.setLanguage(R,x);var F=l.textContent,D={element:l,language:x,grammar:N,code:F};function T(L){D.highlightedCode=L,u.hooks.run("before-insert",D),D.element.innerHTML=D.highlightedCode,u.hooks.run("after-highlight",D),u.hooks.run("complete",D),p&&p.call(D.element)}if(u.hooks.run("before-sanity-check",D),R=D.element.parentElement,R&&R.nodeName.toLowerCase()==="pre"&&!R.hasAttribute("tabindex")&&R.setAttribute("tabindex","0"),!D.code){u.hooks.run("complete",D),p&&p.call(D.element);return}if(u.hooks.run("before-highlight",D),!D.grammar){T(u.util.encode(D.code));return}if(c&&s.Worker){var P=new Worker(u.filename);P.onmessage=function(L){T(L.data)},P.postMessage(JSON.stringify({language:D.language,code:D.code,immediateClose:!0}))}else T(u.highlight(D.code,D.grammar,D.language))},highlight:function(l,c,p){var x={code:l,grammar:c,language:p};if(u.hooks.run("before-tokenize",x),!x.grammar)throw new Error('The language "'+x.language+'" has no grammar.');return x.tokens=u.tokenize(x.code,x.grammar),u.hooks.run("after-tokenize",x),h.stringify(u.util.encode(x.tokens),x.language)},tokenize:function(l,c){var p=c.rest;if(p){for(var x in p)c[x]=p[x];delete c.rest}var N=new f;return y(N,N.head,l),v(l,N,c,N.head,0),S(N)},hooks:{all:{},add:function(l,c){var p=u.hooks.all;p[l]=p[l]||[],p[l].push(c)},run:function(l,c){var p=u.hooks.all[l];if(!(!p||!p.length))for(var x=0,N;N=p[x++];)N(c)}},Token:h};s.Prism=u;function h(l,c,p,x){this.type=l,this.content=c,this.alias=p,this.length=(x||"").length|0}h.stringify=function l(c,p){if(typeof c=="string")return c;if(Array.isArray(c)){var x="";return c.forEach(function(T){x+=l(T,p)}),x}var N={type:c.type,content:l(c.content,p),tag:"span",classes:["token",c.type],attributes:{},language:p},R=c.alias;R&&(Array.isArray(R)?Array.prototype.push.apply(N.classes,R):N.classes.push(R)),u.hooks.run("wrap",N);var F="";for(var D in N.attributes)F+=" "+D+'="'+(N.attributes[D]||"").replace(/"/g,""")+'"';return"<"+N.tag+' class="'+N.classes.join(" ")+'"'+F+">"+N.content+"</"+N.tag+">"};function m(l,c,p,x){l.lastIndex=c;var N=l.exec(p);if(N&&x&&N[1]){var R=N[1].length;N.index+=R,N[0]=N[0].slice(R)}return N}function v(l,c,p,x,N,R){for(var F in p)if(!(!p.hasOwnProperty(F)||!p[F])){var D=p[F];D=Array.isArray(D)?D:[D];for(var T=0;T<D.length;++T){if(R&&R.cause==F+","+T)return;var P=D[T],L=P.inside,A=!!P.lookbehind,V=!!P.greedy,X=P.alias;if(V&&!P.pattern.global){var me=P.pattern.toString().match(/[imsuy]*$/)[0];P.pattern=RegExp(P.pattern.source,me+"g")}for(var se=P.pattern||P,Y=x.next,H=N;Y!==c.tail&&!(R&&H>=R.reach);H+=Y.value.length,Y=Y.next){var _=Y.value;if(c.length>l.length)return;if(!(_ instanceof h)){var q=1,$;if(V){if($=m(se,H,l,A),!$||$.index>=l.length)break;var Re=$.index,te=$.index+$[0].length,Z=H;for(Z+=Y.value.length;Re>=Z;)Y=Y.next,Z+=Y.value.length;if(Z-=Y.value.length,H=Z,Y.value instanceof h)continue;for(var G=Y;G!==c.tail&&(Z<te||typeof G.value=="string");G=G.next)q++,Z+=G.value.length;q--,_=l.slice(H,Z),$.index-=H}else if($=m(se,0,_,A),!$)continue;var Re=$.index,ve=$[0],Ne=_.slice(0,Re),le=_.slice(Re+ve.length),Me=H+_.length;R&&Me>R.reach&&(R.reach=Me);var z=Y.prev;Ne&&(z=y(c,z,Ne),H+=Ne.length),k(c,z,q);var I=new h(F,L?u.tokenize(ve,L):ve,X,ve);if(Y=y(c,z,I),le&&y(c,Y,le),q>1){var J={cause:F+","+T,reach:Me};v(l,c,p,Y.prev,H,J),R&&J.reach>R.reach&&(R.reach=J.reach)}}}}}}function f(){var l={value:null,prev:null,next:null},c={value:null,prev:l,next:null};l.next=c,this.head=l,this.tail=c,this.length=0}function y(l,c,p){var x=c.next,N={value:p,prev:c,next:x};return c.next=N,x.prev=N,l.length++,N}function k(l,c,p){for(var x=c.next,N=0;N<p&&x!==l.tail;N++)x=x.next;c.next=x,x.prev=c,l.length-=N}function S(l){for(var c=[],p=l.head.next;p!==l.tail;)c.push(p.value),p=p.next;return c}if(!s.document)return s.addEventListener&&(u.disableWorkerMessageHandler||s.addEventListener("message",function(l){var c=JSON.parse(l.data),p=c.language,x=c.code,N=c.immediateClose;s.postMessage(u.highlight(x,u.languages[p],p)),N&&s.close()},!1)),u;var g=u.util.currentScript();g&&(u.filename=g.src,g.hasAttribute("data-manual")&&(u.manual=!0));function w(){u.manual||u.highlightAll()}if(!u.manual){var b=document.readyState;b==="loading"||b==="interactive"&&g&&g.defer?document.addEventListener("DOMContentLoaded",w):window.requestAnimationFrame?window.requestAnimationFrame(w):window.setTimeout(w,16)}return u})(a);t.exports&&(t.exports=r),typeof ms<"u"&&(ms.Prism=r),r.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},r.languages.markup.tag.inside["attr-value"].inside.entity=r.languages.markup.entity,r.languages.markup.doctype.inside["internal-subset"].inside=r.languages.markup,r.hooks.add("wrap",function(s){s.type==="entity"&&(s.attributes.title=s.content.replace(/&/,"&"))}),Object.defineProperty(r.languages.markup.tag,"addInlined",{value:function(n,o){var d={};d["language-"+o]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:r.languages[o]},d.cdata=/^<!\[CDATA\[|\]\]>$/i;var u={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:d}};u["language-"+o]={pattern:/[\s\S]+/,inside:r.languages[o]};var h={};h[n]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return n}),"i"),lookbehind:!0,greedy:!0,inside:u},r.languages.insertBefore("markup","cdata",h)}}),Object.defineProperty(r.languages.markup.tag,"addAttribute",{value:function(s,n){r.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+s+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,"language-"+n],inside:r.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),r.languages.html=r.languages.markup,r.languages.mathml=r.languages.markup,r.languages.svg=r.languages.markup,r.languages.xml=r.languages.extend("markup",{}),r.languages.ssml=r.languages.xml,r.languages.atom=r.languages.xml,r.languages.rss=r.languages.xml,(function(s){var n=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;s.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+n.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+n.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+n.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+n.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:n,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},s.languages.css.atrule.inside.rest=s.languages.css;var o=s.languages.markup;o&&(o.tag.addInlined("style","css"),o.tag.addAttribute("style","css"))})(r),r.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},r.languages.javascript=r.languages.extend("clike",{"class-name":[r.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),r.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,r.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:r.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:r.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:r.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:r.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:r.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),r.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:r.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),r.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),r.languages.markup&&(r.languages.markup.tag.addInlined("script","javascript"),r.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),r.languages.js=r.languages.javascript,(function(){if(typeof r>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var s="Loading…",n=function(g,w){return"✖ Error "+g+" while fetching file: "+w},o="✖ Error: File does not exist or is empty",d={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},u="data-src-status",h="loading",m="loaded",v="failed",f="pre[data-src]:not(["+u+'="'+m+'"]):not(['+u+'="'+h+'"])';function y(g,w,b){var l=new XMLHttpRequest;l.open("GET",g,!0),l.onreadystatechange=function(){l.readyState==4&&(l.status<400&&l.responseText?w(l.responseText):l.status>=400?b(n(l.status,l.statusText)):b(o))},l.send(null)}function k(g){var w=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(g||"");if(w){var b=Number(w[1]),l=w[2],c=w[3];return l?c?[b,Number(c)]:[b,void 0]:[b,b]}}r.hooks.add("before-highlightall",function(g){g.selector+=", "+f}),r.hooks.add("before-sanity-check",function(g){var w=g.element;if(w.matches(f)){g.code="",w.setAttribute(u,h);var b=w.appendChild(document.createElement("CODE"));b.textContent=s;var l=w.getAttribute("data-src"),c=g.language;if(c==="none"){var p=(/\.(\w+)$/.exec(l)||[,"none"])[1];c=d[p]||p}r.util.setLanguage(b,c),r.util.setLanguage(w,c);var x=r.plugins.autoloader;x&&x.loadLanguages(c),y(l,function(N){w.setAttribute(u,m);var R=k(w.getAttribute("data-range"));if(R){var F=N.split(/\r\n?|\n/g),D=R[0],T=R[1]==null?F.length:R[1];D<0&&(D+=F.length),D=Math.max(0,Math.min(D-1,F.length)),T<0&&(T+=F.length),T=Math.max(0,Math.min(T,F.length)),N=F.slice(D,T).join(`
|
|
2
|
-
`),w.hasAttribute("data-start")||w.setAttribute("data-start",String(D+1))}b.textContent=N,r.highlightElement(b)},function(N){w.setAttribute(u,v),b.textContent=N})}}),r.plugins.fileHighlight={highlight:function(w){for(var b=(w||document).querySelectorAll(f),l=0,c;c=b[l++];)r.highlightElement(c)}};var S=!1;r.fileHighlight=function(){S||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),S=!0),r.plugins.fileHighlight.highlight.apply(this,arguments)}})()})(qa)),qa.exports}var jf=wf();const Ua=yf(jf);var hs={},ps;function Nf(){return ps||(ps=1,(function(t){t.languages.typescript=t.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),t.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete t.languages.typescript.parameter,delete t.languages.typescript["literal-property"];var a=t.languages.extend("typescript",{});delete a["class-name"],t.languages.typescript["class-name"].inside=a,t.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:a}}}}),t.languages.ts=t.languages.typescript})(Prism)),hs}Nf();Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/});Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}});Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}});Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript"));Prism.languages.js=Prism.languages.javascript;(function(t){var a=t.util.clone(t.languages.javascript),r=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,s=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,n=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function o(h,m){return h=h.replace(/<S>/g,function(){return r}).replace(/<BRACES>/g,function(){return s}).replace(/<SPREAD>/g,function(){return n}),RegExp(h,m)}n=o(n).source,t.languages.jsx=t.languages.extend("markup",a),t.languages.jsx.tag.pattern=o(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),t.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,t.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,t.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,t.languages.jsx.tag.inside.comment=a.comment,t.languages.insertBefore("inside","attr-name",{spread:{pattern:o(/<SPREAD>/.source),inside:t.languages.jsx}},t.languages.jsx.tag),t.languages.insertBefore("inside","special-attr",{script:{pattern:o(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:t.languages.jsx}}},t.languages.jsx.tag);var d=function(h){return h?typeof h=="string"?h:typeof h.content=="string"?h.content:h.content.map(d).join(""):""},u=function(h){for(var m=[],v=0;v<h.length;v++){var f=h[v],y=!1;if(typeof f!="string"&&(f.type==="tag"&&f.content[0]&&f.content[0].type==="tag"?f.content[0].content[0].content==="</"?m.length>0&&m[m.length-1].tagName===d(f.content[0].content[1])&&m.pop():f.content[f.content.length-1].content==="/>"||m.push({tagName:d(f.content[0].content[1]),openedBraces:0}):m.length>0&&f.type==="punctuation"&&f.content==="{"?m[m.length-1].openedBraces++:m.length>0&&m[m.length-1].openedBraces>0&&f.type==="punctuation"&&f.content==="}"?m[m.length-1].openedBraces--:y=!0),(y||typeof f=="string")&&m.length>0&&m[m.length-1].openedBraces===0){var k=d(f);v<h.length-1&&(typeof h[v+1]=="string"||h[v+1].type==="plain-text")&&(k+=d(h[v+1]),h.splice(v+1,1)),v>0&&(typeof h[v-1]=="string"||h[v-1].type==="plain-text")&&(k=d(h[v-1])+k,h.splice(v-1,1),v--),h[v]=new t.Token("plain-text",k,null,k)}f.content&&typeof f.content!="string"&&u(f.content)}};t.hooks.add("after-tokenize",function(h){h.language!=="jsx"&&h.language!=="tsx"||u(h.tokens)})})(Prism);(function(t){var a=t.util.clone(t.languages.typescript);t.languages.tsx=t.languages.extend("jsx",a),delete t.languages.tsx.parameter,delete t.languages.tsx["literal-property"];var r=t.languages.tsx.tag;r.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+r.pattern.source+")",r.pattern.flags),r.lookbehind=!0})(Prism);(function(t){var a=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+a.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+a.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+a.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+a.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:a,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var r=t.languages.markup;r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))})(Prism);var gs={},bs;function Sf(){return bs||(bs=1,Prism.languages.scss=Prism.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),Prism.languages.insertBefore("scss","atrule",{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),Prism.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),Prism.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),Prism.languages.scss.atrule.inside.rest=Prism.languages.scss),gs}Sf();Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}};Prism.languages.webmanifest=Prism.languages.json;(function(t){var a="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",r={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},s={bash:r,environment:{pattern:RegExp("\\$"+a),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+a),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};t.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+a),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:s},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:r}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:s},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:s.entity}}],environment:{pattern:RegExp("\\$?"+a),alias:"constant"},variable:s.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},r.inside=t.languages.bash;for(var n=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],o=s.variable[1].inside,d=0;d<n.length;d++)o[n[d]]=t.languages.bash[n[d]];t.languages.sh=t.languages.bash,t.languages.shell=t.languages.bash})(Prism);var xs={},vs;function kf(){return vs||(vs=1,Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python),xs}kf();var ys={},ws;function Cf(){return ws||(ws=1,(function(t){var a=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,r=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,s={pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};t.languages.java=t.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[s,{pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:s.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+r+/[A-Z]\w*\b/.source),lookbehind:!0,inside:s.inside}],keyword:a,function:[t.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),t.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),t.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":s,keyword:a,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+r+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:s.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+r+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:s.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return a.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(Prism)),ys}Cf();var js={},Ns;function Tf(){return Ns||(Ns=1,(function(t){function a(H,_){return H.replace(/<<(\d+)>>/g,function(q,$){return"(?:"+_[+$]+")"})}function r(H,_,q){return RegExp(a(H,_),"")}function s(H,_){for(var q=0;q<_;q++)H=H.replace(/<<self>>/g,function(){return"(?:"+H+")"});return H.replace(/<<self>>/g,"[^\\s\\S]")}var n={type:"bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",typeDeclaration:"class enum interface record struct",contextual:"add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",other:"abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield"};function o(H){return"\\b(?:"+H.trim().replace(/ /g,"|")+")\\b"}var d=o(n.typeDeclaration),u=RegExp(o(n.type+" "+n.typeDeclaration+" "+n.contextual+" "+n.other)),h=o(n.typeDeclaration+" "+n.contextual+" "+n.other),m=o(n.type+" "+n.typeDeclaration+" "+n.other),v=s(/<(?:[^<>;=+\-*/%&|^]|<<self>>)*>/.source,2),f=s(/\((?:[^()]|<<self>>)*\)/.source,2),y=/@?\b[A-Za-z_]\w*\b/.source,k=a(/<<0>>(?:\s*<<1>>)?/.source,[y,v]),S=a(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[h,k]),g=/\[\s*(?:,\s*)*\]/.source,w=a(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[S,g]),b=a(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[v,f,g]),l=a(/\(<<0>>+(?:,<<0>>+)+\)/.source,[b]),c=a(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[l,S,g]),p={keyword:u,punctuation:/[<>()?,.:[\]]/},x=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,N=/"(?:\\.|[^\\"\r\n])*"/.source,R=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;t.languages.csharp=t.languages.extend("clike",{string:[{pattern:r(/(^|[^$\\])<<0>>/.source,[R]),lookbehind:!0,greedy:!0},{pattern:r(/(^|[^@$\\])<<0>>/.source,[N]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:r(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[S]),lookbehind:!0,inside:p},{pattern:r(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[y,c]),lookbehind:!0,inside:p},{pattern:r(/(\busing\s+)<<0>>(?=\s*=)/.source,[y]),lookbehind:!0},{pattern:r(/(\b<<0>>\s+)<<1>>/.source,[d,k]),lookbehind:!0,inside:p},{pattern:r(/(\bcatch\s*\(\s*)<<0>>/.source,[S]),lookbehind:!0,inside:p},{pattern:r(/(\bwhere\s+)<<0>>/.source,[y]),lookbehind:!0},{pattern:r(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[w]),lookbehind:!0,inside:p},{pattern:r(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[c,m,y]),inside:p}],keyword:u,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),t.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),t.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:r(/([(,]\s*)<<0>>(?=\s*:)/.source,[y]),lookbehind:!0,alias:"punctuation"}}),t.languages.insertBefore("csharp","class-name",{namespace:{pattern:r(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[y]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:r(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[f]),lookbehind:!0,alias:"class-name",inside:p},"return-type":{pattern:r(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[c,S]),inside:p,alias:"class-name"},"constructor-invocation":{pattern:r(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[c]),lookbehind:!0,inside:p,alias:"class-name"},"generic-method":{pattern:r(/<<0>>\s*<<1>>(?=\s*\()/.source,[y,v]),inside:{function:r(/^<<0>>/.source,[y]),generic:{pattern:RegExp(v),alias:"class-name",inside:p}}},"type-list":{pattern:r(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[d,k,y,c,u.source,f,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:r(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[k,f]),lookbehind:!0,greedy:!0,inside:t.languages.csharp},keyword:u,"class-name":{pattern:RegExp(c),greedy:!0,inside:p},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var F=N+"|"+x,D=a(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[F]),T=s(a(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[D]),2),P=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,L=a(/<<0>>(?:\s*\(<<1>>*\))?/.source,[S,T]);t.languages.insertBefore("csharp","class-name",{attribute:{pattern:r(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[P,L]),lookbehind:!0,greedy:!0,inside:{target:{pattern:r(/^<<0>>(?=\s*:)/.source,[P]),alias:"keyword"},"attribute-arguments":{pattern:r(/\(<<0>>*\)/.source,[T]),inside:t.languages.csharp},"class-name":{pattern:RegExp(S),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var A=/:[^}\r\n]+/.source,V=s(a(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[D]),2),X=a(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[V,A]),me=s(a(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<<self>>*\)/.source,[F]),2),se=a(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[me,A]);function Y(H,_){return{interpolation:{pattern:r(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[H]),lookbehind:!0,inside:{"format-string":{pattern:r(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[_,A]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:t.languages.csharp}}},string:/[\s\S]+/}}t.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:r(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[X]),lookbehind:!0,greedy:!0,inside:Y(X,V)},{pattern:r(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[se]),lookbehind:!0,greedy:!0,inside:Y(se,me)}],char:{pattern:RegExp(x),greedy:!0}}),t.languages.dotnet=t.languages.cs=t.languages.csharp})(Prism)),js}Tf();var Ss={},ks;function Ef(){return ks||(ks=1,(function(t){var a=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,r=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],s=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,n=/<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,o=/[{}\[\](),:;]/;t.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:a,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:r,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:s,operator:n,punctuation:o};var d={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:t.languages.php},u=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:d}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:d}}];t.languages.insertBefore("php","variable",{string:u,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:a,string:u,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:r,number:s,operator:n,punctuation:o}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),t.hooks.add("before-tokenize",function(h){if(/<\?/.test(h.code)){var m=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;t.languages["markup-templating"].buildPlaceholders(h,"php",m)}}),t.hooks.add("after-tokenize",function(h){t.languages["markup-templating"].tokenizePlaceholders(h,"php")})})(Prism)),Ss}Ef();var Cs={},Ts;function Pf(){return Ts||(Ts=1,(function(t){t.languages.ruby=t.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),t.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var a={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:t.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete t.languages.ruby.function;var r="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",s=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;t.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+r+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:a,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:a,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+s),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+s+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),t.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+r),greedy:!0,inside:{interpolation:a,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:a,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:a,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+r),greedy:!0,inside:{interpolation:a,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:a,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete t.languages.ruby.string,t.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),t.languages.rb=t.languages.ruby})(Prism)),Cs}Pf();Prism.languages.go=Prism.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/});Prism.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}});delete Prism.languages.go["class-name"];var Es={},Ps;function Df(){return Ps||(Ps=1,(function(t){for(var a=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,r=0;r<2;r++)a=a.replace(/<self>/g,function(){return a});a=a.replace(/<self>/g,function(){return/[^\s\S]/.source}),t.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+a),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},t.languages.rust["closure-params"].inside.rest=t.languages.rust,t.languages.rust.attribute.inside.string=t.languages.rust.string})(Prism)),Es}Df();Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/};(function(t){var a=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function r(v){return v=v.replace(/<inner>/g,function(){return a}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+v+")")}var s=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,n=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return s}),o=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;t.languages.markdown=t.languages.extend("markup",{}),t.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:t.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+n+o+"(?:"+n+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+n+o+")(?:"+n+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(s),inside:t.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+n+")"+o+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+n+"$"),inside:{"table-header":{pattern:RegExp(s),alias:"important",inside:t.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:r(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:r(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:r(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:r(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(v){["url","bold","italic","strike","code-snippet"].forEach(function(f){v!==f&&(t.languages.markdown[v].inside.content.inside[f]=t.languages.markdown[f])})}),t.hooks.add("after-tokenize",function(v){if(v.language!=="markdown"&&v.language!=="md")return;function f(y){if(!(!y||typeof y=="string"))for(var k=0,S=y.length;k<S;k++){var g=y[k];if(g.type!=="code"){f(g.content);continue}var w=g.content[1],b=g.content[3];if(w&&b&&w.type==="code-language"&&b.type==="code-block"&&typeof w.content=="string"){var l=w.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");l=(/[a-z][\w-]*/i.exec(l)||[""])[0].toLowerCase();var c="language-"+l;b.alias?typeof b.alias=="string"?b.alias=[b.alias,c]:b.alias.push(c):b.alias=[c]}}}f(v.tokens)}),t.hooks.add("wrap",function(v){if(v.type==="code-block"){for(var f="",y=0,k=v.classes.length;y<k;y++){var S=v.classes[y],g=/language-(.+)/.exec(S);if(g){f=g[1];break}}var w=t.languages[f];if(w)v.content=t.highlight(m(v.content),w,f);else if(f&&f!=="none"&&t.plugins.autoloader){var b="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);v.attributes.id=b,t.plugins.autoloader.loadLanguages(f,function(){var l=document.getElementById(b);l&&(l.innerHTML=t.highlight(l.textContent,t.languages[f],f))})}}});var d=RegExp(t.languages.markup.tag.pattern.source,"gi"),u={amp:"&",lt:"<",gt:">",quot:'"'},h=String.fromCodePoint||String.fromCharCode;function m(v){var f=v.replace(d,"");return f=f.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(y,k){if(k=k.toLowerCase(),k[0]==="#"){var S;return k[1]==="x"?S=parseInt(k.slice(2),16):S=Number(k.slice(1)),h(S)}else{var g=u[k];return g||y}}),f}t.languages.md=t.languages.markdown})(Prism);(function(t){var a=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,s="(?:"+r.source+"(?:[ ]+"+a.source+")?|"+a.source+"(?:[ ]+"+r.source+")?)",n=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),o=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function d(u,h){h=(h||"").replace(/m/g,"")+"m";var m=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return s}).replace(/<<value>>/g,function(){return u});return RegExp(m,h)}t.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return s})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return s}).replace(/<<key>>/g,function(){return"(?:"+n+"|"+o+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:d(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:d(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:d(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:d(o),lookbehind:!0,greedy:!0},number:{pattern:d(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:r,important:a,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},t.languages.yml=t.languages.yaml})(Prism);(function(t){var a=/\\[\r\n](?:\s|\\[\r\n]|#.*(?!.))*(?![\s#]|\\[\r\n])/.source,r=/(?:[ \t]+(?![ \t])(?:<SP_BS>)?|<SP_BS>)/.source.replace(/<SP_BS>/g,function(){return a}),s=/"(?:[^"\\\r\n]|\\(?:\r\n|[\s\S]))*"|'(?:[^'\\\r\n]|\\(?:\r\n|[\s\S]))*'/.source,n=/--[\w-]+=(?:<STR>|(?!["'])(?:[^\s\\]|\\.)+)/.source.replace(/<STR>/g,function(){return s}),o={pattern:RegExp(s),greedy:!0},d={pattern:/(^[ \t]*)#.*/m,lookbehind:!0,greedy:!0};function u(h,m){return h=h.replace(/<OPT>/g,function(){return n}).replace(/<SP>/g,function(){return r}),RegExp(h,m)}t.languages.docker={instruction:{pattern:/(^[ \t]*)(?:ADD|ARG|CMD|COPY|ENTRYPOINT|ENV|EXPOSE|FROM|HEALTHCHECK|LABEL|MAINTAINER|ONBUILD|RUN|SHELL|STOPSIGNAL|USER|VOLUME|WORKDIR)(?=\s)(?:\\.|[^\r\n\\])*(?:\\$(?:\s|#.*$)*(?![\s#])(?:\\.|[^\r\n\\])*)*/im,lookbehind:!0,greedy:!0,inside:{options:{pattern:u(/(^(?:ONBUILD<SP>)?\w+<SP>)<OPT>(?:<SP><OPT>)*/.source,"i"),lookbehind:!0,greedy:!0,inside:{property:{pattern:/(^|\s)--[\w-]+/,lookbehind:!0},string:[o,{pattern:/(=)(?!["'])(?:[^\s\\]|\\.)+/,lookbehind:!0}],operator:/\\$/m,punctuation:/=/}},keyword:[{pattern:u(/(^(?:ONBUILD<SP>)?HEALTHCHECK<SP>(?:<OPT><SP>)*)(?:CMD|NONE)\b/.source,"i"),lookbehind:!0,greedy:!0},{pattern:u(/(^(?:ONBUILD<SP>)?FROM<SP>(?:<OPT><SP>)*(?!--)[^ \t\\]+<SP>)AS/.source,"i"),lookbehind:!0,greedy:!0},{pattern:u(/(^ONBUILD<SP>)\w+/.source,"i"),lookbehind:!0,greedy:!0},{pattern:/^\w+/,greedy:!0}],comment:d,string:o,variable:/\$(?:\w+|\{[^{}"'\\]*\})/,operator:/\\$/m}},comment:d},t.languages.dockerfile=t.languages.docker})(Prism);Prism.languages.git={comment:/^#.*/m,deleted:/^[-–].*/m,inserted:/^\+.*/m,string:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,command:{pattern:/^.*\$ git .*$/m,inside:{parameter:/\s--?\w+/}},coord:/^@@.*@@$/m,"commit-sha1":/^commit \w{40}$/m};const Ds=De.cva("relative rounded font-mono",{variants:{variant:{inline:"bg-muted px-[0.3rem] py-[0.2rem] text-xs sm:text-sm",block:"block bg-muted overflow-x-auto"},size:{sm:"text-xs sm:text-sm",base:"text-sm sm:text-base",lg:"text-base sm:text-lg"}},defaultVariants:{variant:"inline",size:"base"}}),fn=i.forwardRef(({className:t,variant:a,size:r,language:s,showLineNumbers:n=!1,maxHeight:o,copyable:d=!1,filename:u,theme:h="auto",children:m,...v},f)=>{const[y,k]=i.useState(!1),[S,g]=i.useState("");i.useRef(null),i.useEffect(()=>{if(a==="block"&&s&&m)try{const b=typeof m=="string"?m:String(m),l=Ua.highlight(b,Ua.languages[s]||Ua.languages.text,s);g(l)}catch(b){console.warn(`Failed to highlight code for language: ${s}`,b),g(String(m))}else g(String(m))},[s,m,a]);const w=async()=>{if(typeof m=="string")try{await navigator.clipboard.writeText(m),k(!0),setTimeout(()=>k(!1),2e3)}catch(b){console.error("Failed to copy code:",b)}};return a==="block"?e.jsxs("div",{className:"relative my-4 sm:my-6",children:[(u||d)&&e.jsxs("div",{className:"flex items-center justify-between bg-muted/50 px-3 sm:px-4 py-2 sm:py-3 rounded-t-lg border-b",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[u&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs sm:text-sm text-muted-foreground",children:[e.jsx(E.FileText,{className:"h-3 w-3 sm:h-4 sm:w-4"}),e.jsx("span",{className:"font-medium",children:u})]}),s&&!u&&e.jsx("div",{className:"text-xs sm:text-sm text-muted-foreground uppercase font-medium",children:s})]}),d&&e.jsx(O,{variant:"ghost",size:"sm",onClick:w,className:"h-6 w-6 sm:h-7 sm:w-7 p-0 hover:bg-muted-foreground/10",children:y?e.jsx(E.Check,{className:"h-3 w-3 sm:h-4 sm:w-4 text-green-600"}):e.jsx(E.Copy,{className:"h-3 w-3 sm:h-4 sm:w-4"})})]}),e.jsx("div",{className:j("waka-code relative",o&&"overflow-hidden"),style:{maxHeight:o?`${o}px`:void 0},children:e.jsxs("pre",{className:j(Ds({variant:a,size:r}),"p-3 sm:p-4 lg:p-6","text-xs sm:text-sm lg:text-base","leading-relaxed sm:leading-loose","whitespace-pre-wrap break-words","scrollbar-thin scrollbar-thumb-muted-foreground/20 scrollbar-track-transparent","hover:scrollbar-thumb-muted-foreground/30",o&&"overflow-y-auto",!u&&!d&&s&&"rounded-lg",u||d?"rounded-b-lg":"rounded-lg",t),children:[n&&e.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-8 sm:w-10 lg:w-12 bg-muted/30 border-r border-border/50 flex flex-col text-xs sm:text-sm text-muted-foreground select-none",children:String(m).split(`
|
|
3
|
-
`).map((b,l)=>e.jsx("div",{className:"flex items-center justify-center h-5 sm:h-6 lg:h-7",children:l+1},l))}),e.jsx("code",{ref:f,className:j("block",n&&"ml-8 sm:ml-10 lg:ml-12",s&&"language-"+s),...v,dangerouslySetInnerHTML:a==="block"&&s?{__html:S}:void 0,children:a==="block"&&s?void 0:m})]})}),s&&!u&&!d&&e.jsx("div",{className:"absolute top-2 right-2 text-xs text-muted-foreground/70 bg-background/80 px-2 py-1 rounded uppercase font-medium",children:s})]}):e.jsx("code",{className:j(Ds({variant:a,size:r}),t),ref:f,...v,children:m})});fn.displayName="Code";const Mf=lr.Root,Rf=lr.CollapsibleTrigger,$f=lr.CollapsibleContent,hn=he.Root,Af=he.Trigger,pn=he.Portal,Ff=he.Close,Nr=i.forwardRef(({className:t,...a},r)=>e.jsx(he.Overlay,{ref:r,className:j("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...a}));Nr.displayName=he.Overlay.displayName;const Sr=i.forwardRef(({className:t,children:a,...r},s)=>e.jsxs(pn,{children:[e.jsx(Nr,{}),e.jsxs(he.Content,{ref:s,className:j("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...r,children:[a,e.jsxs(he.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[e.jsx(E.X,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Sr.displayName=he.Content.displayName;const gn=({className:t,...a})=>e.jsx("div",{className:j("flex flex-col space-y-1.5 text-center sm:text-left",t),...a});gn.displayName="DialogHeader";const bn=({className:t,...a})=>e.jsx("div",{className:j("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...a});bn.displayName="DialogFooter";const xn=i.forwardRef(({className:t,...a},r)=>e.jsx(he.Title,{ref:r,className:j("text-lg font-semibold leading-none tracking-tight",t),...a}));xn.displayName=he.Title.displayName;const vn=i.forwardRef(({className:t,...a},r)=>e.jsx(he.Description,{ref:r,className:j("text-sm text-muted-foreground",t),...a}));vn.displayName=he.Description.displayName;const _t=i.forwardRef(({className:t,...a},r)=>e.jsx(Le.Command,{ref:r,className:j("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...a}));_t.displayName=Le.Command.displayName;const Lf=({children:t,...a})=>e.jsx(hn,{...a,children:e.jsx(Sr,{className:"overflow-hidden p-0 shadow-lg",children:e.jsx(_t,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:t})})}),oa=i.forwardRef(({className:t,...a},r)=>e.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[e.jsx(E.Search,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(Le.Command.Input,{ref:r,className:j("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),...a})]}));oa.displayName=Le.Command.Input.displayName;const kr=i.forwardRef(({className:t,...a},r)=>e.jsx(Le.Command.List,{ref:r,className:j("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...a}));kr.displayName=Le.Command.List.displayName;const ia=i.forwardRef((t,a)=>e.jsx(Le.Command.Empty,{ref:a,className:"py-6 text-center text-sm",...t}));ia.displayName=Le.Command.Empty.displayName;const la=i.forwardRef(({className:t,...a},r)=>e.jsx(Le.Command.Group,{ref:r,className:j("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",t),...a}));la.displayName=Le.Command.Group.displayName;const yn=i.forwardRef(({className:t,...a},r)=>e.jsx(Le.Command.Separator,{ref:r,className:j("-mx-1 h-px bg-border",t),...a}));yn.displayName=Le.Command.Separator.displayName;const ca=i.forwardRef(({className:t,...a},r)=>e.jsx(Le.Command.Item,{ref:r,className:j("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...a}));ca.displayName=Le.Command.Item.displayName;const wn=({className:t,...a})=>e.jsx("span",{className:j("ml-auto text-xs tracking-widest text-muted-foreground",t),...a});wn.displayName="CommandShortcut";const jn=be.Root,Nn=be.Trigger,If=be.Group,Of=be.Portal,_f=be.Sub,zf=be.RadioGroup,Sn=i.forwardRef(({className:t,inset:a,children:r,...s},n)=>e.jsxs(be.SubTrigger,{ref:n,className:j("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",a&&"pl-8",t),...s,children:[r,e.jsx(E.ChevronRight,{className:"ml-auto h-4 w-4"})]}));Sn.displayName=be.SubTrigger.displayName;const kn=i.forwardRef(({className:t,...a},r)=>e.jsx(be.SubContent,{ref:r,className:j("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...a}));kn.displayName=be.SubContent.displayName;const Cr=i.forwardRef(({className:t,...a},r)=>e.jsx(be.Portal,{children:e.jsx(be.Content,{ref:r,className:j("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...a})}));Cr.displayName=be.Content.displayName;const it=i.forwardRef(({className:t,inset:a,...r},s)=>e.jsx(be.Item,{ref:s,className:j("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a&&"pl-8",t),...r}));it.displayName=be.Item.displayName;const Cn=i.forwardRef(({className:t,children:a,checked:r,...s},n)=>e.jsxs(be.CheckboxItem,{ref:n,className:j("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:r,...s,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(be.ItemIndicator,{children:e.jsx(E.Check,{className:"h-4 w-4"})})}),a]}));Cn.displayName=be.CheckboxItem.displayName;const Tn=i.forwardRef(({className:t,children:a,...r},s)=>e.jsxs(be.RadioItem,{ref:s,className:j("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...r,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(be.ItemIndicator,{children:e.jsx(E.Circle,{className:"h-2 w-2 fill-current"})})}),a]}));Tn.displayName=be.RadioItem.displayName;const En=i.forwardRef(({className:t,inset:a,...r},s)=>e.jsx(be.Label,{ref:s,className:j("px-2 py-1.5 text-sm font-semibold text-foreground",a&&"pl-8",t),...r}));En.displayName=be.Label.displayName;const Kt=i.forwardRef(({className:t,...a},r)=>e.jsx(be.Separator,{ref:r,className:j("-mx-1 my-1 h-px bg-border",t),...a}));Kt.displayName=be.Separator.displayName;const Pn=({className:t,...a})=>e.jsx("span",{className:j("ml-auto text-xs tracking-widest text-muted-foreground",t),...a});Pn.displayName="ContextMenuShortcut";const Zt=xe.Root,Qt=xe.Trigger,Vf=xe.Group,Wf=xe.Portal,Hf=xe.Sub,qf=xe.RadioGroup,Dn=i.forwardRef(({className:t,inset:a,children:r,...s},n)=>e.jsxs(xe.SubTrigger,{ref:n,className:j("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",a&&"pl-8",t),...s,children:[r,e.jsx(E.ChevronRight,{className:"ml-auto h-4 w-4"})]}));Dn.displayName=xe.SubTrigger.displayName;const Mn=i.forwardRef(({className:t,...a},r)=>e.jsx(xe.SubContent,{ref:r,className:j("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...a}));Mn.displayName=xe.SubContent.displayName;const Lt=i.forwardRef(({className:t,sideOffset:a=4,...r},s)=>e.jsx(xe.Portal,{children:e.jsx(xe.Content,{ref:s,sideOffset:a,className:j("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r})}));Lt.displayName=xe.Content.displayName;const Tr=i.forwardRef(({className:t,inset:a,...r},s)=>e.jsx(xe.Item,{ref:s,className:j("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a&&"pl-8",t),...r}));Tr.displayName=xe.Item.displayName;const Tt=i.forwardRef(({className:t,children:a,checked:r,...s},n)=>e.jsxs(xe.CheckboxItem,{ref:n,className:j("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:r,...s,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(xe.ItemIndicator,{children:e.jsx(E.Check,{className:"h-4 w-4"})})}),a]}));Tt.displayName=xe.CheckboxItem.displayName;const Rn=i.forwardRef(({className:t,children:a,...r},s)=>e.jsxs(xe.RadioItem,{ref:s,className:j("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...r,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(xe.ItemIndicator,{children:e.jsx(E.Circle,{className:"h-2 w-2 fill-current"})})}),a]}));Rn.displayName=xe.RadioItem.displayName;const ea=i.forwardRef(({className:t,inset:a,...r},s)=>e.jsx(xe.Label,{ref:s,className:j("px-2 py-1.5 text-sm font-semibold",a&&"pl-8",t),...r}));ea.displayName=xe.Label.displayName;const ta=i.forwardRef(({className:t,...a},r)=>e.jsx(xe.Separator,{ref:r,className:j("-mx-1 my-1 h-px bg-muted",t),...a}));ta.displayName=xe.Separator.displayName;const $n=({className:t,...a})=>e.jsx("span",{className:j("ml-auto text-xs tracking-widest opacity-60",t),...a});$n.displayName="DropdownMenuShortcut";var Uf=t=>t.type==="checkbox",Yt=t=>t instanceof Date,Er=t=>t==null;const An=t=>typeof t=="object";var Mt=t=>!Er(t)&&!Array.isArray(t)&&An(t)&&!Yt(t),Bf=t=>Mt(t)&&t.target?Uf(t.target)?t.target.checked:t.target.value:t,Gf=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,Xf=(t,a)=>t.has(Gf(a)),Jf=t=>{const a=t.constructor&&t.constructor.prototype;return Mt(a)&&a.hasOwnProperty("isPrototypeOf")},Yf=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Fn(t){let a;const r=Array.isArray(t),s=typeof FileList<"u"?t instanceof FileList:!1;if(t instanceof Date)a=new Date(t);else if(!(Yf&&(t instanceof Blob||s))&&(r||Mt(t)))if(a=r?[]:Object.create(Object.getPrototypeOf(t)),!r&&!Jf(t))a=t;else for(const n in t)t.hasOwnProperty(n)&&(a[n]=Fn(t[n]));else return t;return a}var Ln=t=>/^\w*$/.test(t),rr=t=>t===void 0,Kf=t=>Array.isArray(t)?t.filter(Boolean):[],In=t=>Kf(t.replace(/["|']|\]/g,"").split(/\.|\[/)),Fe=(t,a,r)=>{if(!a||!Mt(t))return r;const s=(Ln(a)?[a]:In(a)).reduce((n,o)=>Er(n)?n:n[o],t);return rr(s)||s===t?rr(t[a])?r:t[a]:s},Ba=t=>typeof t=="boolean",Ms=(t,a,r)=>{let s=-1;const n=Ln(a)?[a]:In(a),o=n.length,d=o-1;for(;++s<o;){const u=n[s];let h=r;if(s!==d){const m=t[u];h=Mt(m)||Array.isArray(m)?m:isNaN(+n[s+1])?{}:[]}if(u==="__proto__"||u==="constructor"||u==="prototype")return;t[u]=h,t=t[u]}};const Rs={BLUR:"blur",CHANGE:"change"},$s={all:"all"},Pr=C.createContext(null);Pr.displayName="HookFormContext";const Fa=()=>C.useContext(Pr),Zf=t=>{const{children:a,...r}=t;return C.createElement(Pr.Provider,{value:r},a)};var Qf=(t,a,r,s=!0)=>{const n={defaultValues:a._defaultValues};for(const o in t)Object.defineProperty(n,o,{get:()=>{const d=o;return a._proxyFormState[d]!==$s.all&&(a._proxyFormState[d]=!s||$s.all),r&&(r[d]=!0),t[d]}});return n};const On=typeof window<"u"?C.useLayoutEffect:C.useEffect;function eh(t){const a=Fa(),{control:r=a.control,disabled:s,name:n,exact:o}=t||{},[d,u]=C.useState(r._formState),h=C.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return On(()=>r._subscribe({name:n,formState:h.current,exact:o,callback:m=>{!s&&u({...r._formState,...m})}}),[n,s,o]),C.useEffect(()=>{h.current.isValid&&r._setValid(!0)},[r]),C.useMemo(()=>Qf(d,r,h.current,!1),[d,r])}var th=t=>typeof t=="string",As=(t,a,r,s,n)=>th(t)?Fe(r,t,n):Array.isArray(t)?t.map(o=>Fe(r,o)):r,Fs=t=>Er(t)||!An(t);function Ca(t,a,r=new WeakSet){if(Fs(t)||Fs(a))return Object.is(t,a);if(Yt(t)&&Yt(a))return t.getTime()===a.getTime();const s=Object.keys(t),n=Object.keys(a);if(s.length!==n.length)return!1;if(r.has(t)||r.has(a))return!0;r.add(t),r.add(a);for(const o of s){const d=t[o];if(!n.includes(o))return!1;if(o!=="ref"){const u=a[o];if(Yt(d)&&Yt(u)||Mt(d)&&Mt(u)||Array.isArray(d)&&Array.isArray(u)?!Ca(d,u,r):!Object.is(d,u))return!1}}return!0}function ah(t){const a=Fa(),{control:r=a.control,name:s,defaultValue:n,disabled:o,exact:d,compute:u}=t||{},h=C.useRef(n),m=C.useRef(u),v=C.useRef(void 0),f=C.useRef(r),y=C.useRef(s);m.current=u;const[k,S]=C.useState(()=>{const p=r._getWatch(s,h.current);return m.current?m.current(p):p}),g=C.useCallback(p=>{const x=As(s,r._names,p||r._formValues,!1,h.current);return m.current?m.current(x):x},[r._formValues,r._names,s]),w=C.useCallback(p=>{if(!o){const x=As(s,r._names,p||r._formValues,!1,h.current);if(m.current){const N=m.current(x);Ca(N,v.current)||(S(N),v.current=N)}else S(x)}},[r._formValues,r._names,o,s]);On(()=>((f.current!==r||!Ca(y.current,s))&&(f.current=r,y.current=s,w()),r._subscribe({name:s,formState:{values:!0},exact:d,callback:p=>{w(p.values)}})),[r,d,s,w]),C.useEffect(()=>r._removeUnmounted());const b=f.current!==r,l=y.current,c=C.useMemo(()=>{if(o)return null;const p=!b&&!Ca(l,s);return b||p?g():null},[o,b,s,l,g]);return c!==null?c:k}function rh(t){const a=Fa(),{name:r,disabled:s,control:n=a.control,shouldUnregister:o,defaultValue:d,exact:u=!0}=t,h=Xf(n._names.array,r),m=C.useMemo(()=>Fe(n._formValues,r,Fe(n._defaultValues,r,d)),[n,r,d]),v=ah({control:n,name:r,defaultValue:m,exact:u}),f=eh({control:n,name:r,exact:u}),y=C.useRef(t),k=C.useRef(void 0),S=C.useRef(n.register(r,{...t.rules,value:v,...Ba(t.disabled)?{disabled:t.disabled}:{}}));y.current=t;const g=C.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Fe(f.errors,r)},isDirty:{enumerable:!0,get:()=>!!Fe(f.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!Fe(f.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!Fe(f.validatingFields,r)},error:{enumerable:!0,get:()=>Fe(f.errors,r)}}),[f,r]),w=C.useCallback(p=>S.current.onChange({target:{value:Bf(p),name:r},type:Rs.CHANGE}),[r]),b=C.useCallback(()=>S.current.onBlur({target:{value:Fe(n._formValues,r),name:r},type:Rs.BLUR}),[r,n._formValues]),l=C.useCallback(p=>{const x=Fe(n._fields,r);x&&p&&(x._f.ref={focus:()=>p.focus&&p.focus(),select:()=>p.select&&p.select(),setCustomValidity:N=>p.setCustomValidity(N),reportValidity:()=>p.reportValidity()})},[n._fields,r]),c=C.useMemo(()=>({name:r,value:v,...Ba(s)||f.disabled?{disabled:f.disabled||s}:{},onChange:w,onBlur:b,ref:l}),[r,s,f.disabled,w,b,l,v]);return C.useEffect(()=>{const p=n._options.shouldUnregister||o,x=k.current;x&&x!==r&&!h&&n.unregister(x),n.register(r,{...y.current.rules,...Ba(y.current.disabled)?{disabled:y.current.disabled}:{}});const N=(R,F)=>{const D=Fe(n._fields,R);D&&D._f&&(D._f.mount=F)};if(N(r,!0),p){const R=Fn(Fe(n._options.defaultValues,r,y.current.defaultValue));Ms(n._defaultValues,r,R),rr(Fe(n._formValues,r))&&Ms(n._formValues,r,R)}return!h&&n.register(r),k.current=r,()=>{(h?p&&!n._state.action:p)?n.unregister(r):N(r,!1)}},[r,n,h,o]),C.useEffect(()=>{n._setDisabledField({disabled:s,name:r})},[s,r,n]),C.useMemo(()=>({field:c,formState:f,fieldState:g}),[c,f,g])}const _n=t=>t.render(rh(t)),sh=De.cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ge=i.forwardRef(({className:t,...a},r)=>e.jsx(_s.Root,{ref:r,className:j(sh(),t),...a}));ge.displayName=_s.Root.displayName;const nh=Zf,zn=i.createContext({}),oh=({...t})=>e.jsx(zn.Provider,{value:{name:t.name},children:e.jsx(_n,{...t})}),ha=()=>{const t=i.useContext(zn),a=i.useContext(Vn),{getFieldState:r,formState:s}=Fa(),n=r(t.name,s);if(!t)throw new Error("useFormField should be used within <FormField>");const{id:o}=a;return{id:o,name:t.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...n}},Vn=i.createContext({}),Wn=i.forwardRef(({className:t,...a},r)=>{const s=i.useId();return e.jsx(Vn.Provider,{value:{id:s},children:e.jsx("div",{ref:r,className:j("space-y-2",t),...a})})});Wn.displayName="FormItem";const Hn=i.forwardRef(({className:t,...a},r)=>{const{error:s,formItemId:n}=ha();return e.jsx(ge,{ref:r,className:j(s&&"text-destructive",t),htmlFor:n,...a})});Hn.displayName="FormLabel";const qn=i.forwardRef(({...t},a)=>{const{error:r,formItemId:s,formDescriptionId:n,formMessageId:o}=ha();return e.jsx($a.Slot,{ref:a,id:s,"aria-describedby":r?`${n} ${o}`:`${n}`,"aria-invalid":!!r,...t})});qn.displayName="FormControl";const Un=i.forwardRef(({className:t,...a},r)=>{const{formDescriptionId:s}=ha();return e.jsx("p",{ref:r,id:s,className:j("text-sm text-muted-foreground",t),...a})});Un.displayName="FormDescription";const Bn=i.forwardRef(({className:t,children:a,...r},s)=>{const{error:n,formMessageId:o}=ha(),d=n?String(n?.message):a;return d?e.jsx("p",{ref:s,id:o,className:j("text-sm font-medium text-destructive",t),...r,children:d}):null});Bn.displayName="FormMessage";const ih=Aa.Root,lh=Aa.Trigger,Gn=i.forwardRef(({className:t,align:a="center",sideOffset:r=4,...s},n)=>e.jsx(Aa.Content,{ref:n,align:a,sideOffset:r,className:j("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...s}));Gn.displayName=Aa.Content.displayName;const Xn=i.forwardRef(({length:t=6,value:a="",onChange:r,onComplete:s,pattern:n="numeric",secure:o=!1,disabled:d=!1,className:u,error:h,size:m="md",separator:v,separatorElement:f=e.jsx("span",{className:"text-muted-foreground",children:"-"}),...y},k)=>{const[S,g]=i.useState(a.split("").slice(0,t)),w=i.useRef([]);i.useEffect(()=>{const F=a.split("").slice(0,t);g(F)},[a,t]);const l=(()=>{switch(n){case"numeric":return/^[0-9]$/;case"alpha":return/^[a-zA-Z]$/;case"alphanumeric":return/^[a-zA-Z0-9]$/;default:return/^.$/}})(),c=(F,D)=>{if(d)return;const T=D.slice(-1);if(T&&!l.test(T))return;const P=[...S];P[F]=T,g(P);const L=P.join("");r?.(L),T&&F<t-1&&w.current[F+1]?.focus(),P.every(A=>A!=="")&&P.length===t&&s?.(L)},p=(F,D)=>{if(!d){if(D.key==="Backspace"){D.preventDefault();const T=[...S];T[F]?(T[F]="",g(T),r?.(T.join(""))):F>0&&(T[F-1]="",g(T),r?.(T.join("")),w.current[F-1]?.focus())}if(D.key==="Delete"){D.preventDefault();const T=[...S];T[F]="",g(T),r?.(T.join(""))}D.key==="ArrowLeft"&&F>0&&(D.preventDefault(),w.current[F-1]?.focus()),D.key==="ArrowRight"&&F<t-1&&(D.preventDefault(),w.current[F+1]?.focus()),D.key==="Home"&&(D.preventDefault(),w.current[0]?.focus()),D.key==="End"&&(D.preventDefault(),w.current[t-1]?.focus())}},x=F=>{if(F.preventDefault(),d)return;const T=F.clipboardData.getData("text/plain").split("").filter(A=>l.test(A)).slice(0,t),P=[...S];T.forEach((A,V)=>{P[V]=A}),g(P),r?.(P.join(""));const L=P.findIndex(A=>!A);L!==-1?w.current[L]?.focus():w.current[t-1]?.focus(),P.every(A=>A!=="")&&P.length===t&&s?.(P.join(""))},N=F=>{F.target.select()},R={sm:"h-8 w-8 text-sm",md:"h-12 w-12 text-base",lg:"h-16 w-16 text-lg"}[m];return e.jsxs("div",{ref:k,className:j("flex flex-col gap-2",u),children:[e.jsx("div",{className:"flex items-center gap-2",children:Array.from({length:t}).map((F,D)=>e.jsxs(i.Fragment,{children:[e.jsx("input",{ref:T=>w.current[D]=T,type:o?"password":"text",inputMode:n==="numeric"?"numeric":"text",maxLength:1,value:S[D]||"",onChange:T=>c(D,T.target.value),onKeyDown:T=>p(D,T),onPaste:x,onFocus:N,disabled:d,className:j("flex items-center justify-center rounded-md border border-input bg-background text-center font-medium transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",R,h&&"border-destructive focus-visible:ring-destructive",S[D]&&"border-primary"),"aria-label":`Caractère ${D+1} sur ${t}`,...y}),v&&(D+1)%v===0&&D<t-1&&e.jsx("div",{className:"flex items-center justify-center",children:f})]},D))}),h&&e.jsx("p",{className:"text-sm text-destructive",role:"alert",children:h})]})});Xn.displayName="InputOTP";const fe=i.forwardRef(({className:t,type:a,...r},s)=>e.jsx("input",{type:a,className:j("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:s,...r}));fe.displayName="Input";const ut=Ce.Root,ch=Ce.Group,mt=Ce.Value,rt=i.forwardRef(({className:t,children:a,...r},s)=>e.jsxs(Ce.Trigger,{ref:s,className:j("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...r,children:[a,e.jsx(Ce.Icon,{asChild:!0,children:e.jsx(E.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));rt.displayName=Ce.Trigger.displayName;const Dr=i.forwardRef(({className:t,...a},r)=>e.jsx(Ce.ScrollUpButton,{ref:r,className:j("flex cursor-default items-center justify-center py-1",t),...a,children:e.jsx(E.ChevronUp,{className:"h-4 w-4"})}));Dr.displayName=Ce.ScrollUpButton.displayName;const Mr=i.forwardRef(({className:t,...a},r)=>e.jsx(Ce.ScrollDownButton,{ref:r,className:j("flex cursor-default items-center justify-center py-1",t),...a,children:e.jsx(E.ChevronDown,{className:"h-4 w-4"})}));Mr.displayName=Ce.ScrollDownButton.displayName;const st=i.forwardRef(({className:t,children:a,position:r="popper",...s},n)=>e.jsx(Ce.Portal,{children:e.jsxs(Ce.Content,{ref:n,className:j("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:r,...s,children:[e.jsx(Dr,{}),e.jsx(Ce.Viewport,{className:j("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:a}),e.jsx(Mr,{})]})}));st.displayName=Ce.Content.displayName;const Jn=i.forwardRef(({className:t,...a},r)=>e.jsx(Ce.Label,{ref:r,className:j("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...a}));Jn.displayName=Ce.Label.displayName;const Qe=i.forwardRef(({className:t,children:a,...r},s)=>e.jsxs(Ce.Item,{ref:s,className:j("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...r,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Ce.ItemIndicator,{children:e.jsx(E.Check,{className:"h-4 w-4"})})}),e.jsx(Ce.ItemText,{children:a})]}));Qe.displayName=Ce.Item.displayName;const Yn=i.forwardRef(({className:t,...a},r)=>e.jsx(Ce.Separator,{ref:r,className:j("-mx-1 my-1 h-px bg-muted",t),...a}));Yn.displayName=Ce.Separator.displayName;function dh({languages:t,value:a,onChange:r,showFlags:s=!0,showLabels:n=!0,variant:o="default",isLoading:d=!1,className:u,placeholder:h="Select language",ariaLabel:m="Select language"}){const[v,f]=i.useState(!1),[y,k]=i.useState(!1),S=i.useRef(null),g=i.useRef(null);i.useEffect(()=>{k(!0)},[]);const w=t.find(x=>x.code===a),b=x=>{r?.(x),f(!1)},[l,c]=i.useState({top:0,left:0});if(i.useEffect(()=>{if(v&&S.current&&y){const x=S.current.getBoundingClientRect();c({top:x.bottom+8,left:x.left})}},[v,y]),o==="default")return e.jsxs(ut,{value:a,onValueChange:r,disabled:d,children:[e.jsx(rt,{className:j("w-[180px]",u),children:e.jsx(mt,{placeholder:h,children:w&&e.jsxs("div",{className:"flex items-center gap-2",children:[s&&w.flagEmoji&&e.jsx("span",{className:"text-lg",children:w.flagEmoji}),s&&w.flag&&!w.flagEmoji&&e.jsx("img",{src:w.flag,alt:w.label,className:"h-4 w-6 object-cover rounded"}),!s&&e.jsx(E.Globe,{className:"h-4 w-4 text-muted-foreground"}),n&&e.jsx("span",{children:w.label})]})})}),e.jsx(st,{children:t.map(x=>e.jsx(Qe,{value:x.code,children:e.jsxs("div",{className:"flex items-center gap-2",children:[s&&x.flagEmoji&&e.jsx("span",{className:"text-lg",children:x.flagEmoji}),s&&x.flag&&!x.flagEmoji&&e.jsx("img",{src:x.flag,alt:x.label,className:"h-4 w-6 object-cover rounded"}),n&&x.label]})},x.code))})]});if(o==="minimal"){const x=v&&y?e.jsx("div",{ref:g,className:"fixed z-[9999] min-w-[160px] rounded-md border border-border bg-popover text-popover-foreground p-2 shadow-lg",style:{top:`${l.top}px`,left:`${l.left}px`},onMouseDown:N=>N.stopPropagation(),children:e.jsx("div",{className:"grid gap-1",children:t.map(N=>e.jsxs("button",{onMouseDown:R=>{R.preventDefault(),R.stopPropagation(),b(N.code)},type:"button",className:j("flex items-center gap-2 rounded-sm px-2 py-2 text-sm hover:bg-accent hover:text-accent-foreground transition-colors cursor-pointer",a===N.code&&"bg-accent"),children:[N.flagEmoji&&e.jsx("span",{className:"text-lg",children:N.flagEmoji}),N.flag&&!N.flagEmoji&&e.jsx("img",{src:N.flag,alt:N.label,className:"h-4 w-6 object-cover rounded"}),e.jsx("span",{className:"flex-1 text-left",children:N.label}),a===N.code&&e.jsx(E.Check,{className:"h-4 w-4 shrink-0"})]},N.code))})}):null;return e.jsxs(e.Fragment,{children:[e.jsxs("button",{ref:S,onClick:N=>{N.preventDefault(),N.stopPropagation(),f(!v)},className:j("flex h-9 w-9 items-center justify-center rounded-md border border-input bg-transparent hover:bg-accent hover:text-accent-foreground transition-colors",u),title:"Changer de langue",type:"button",disabled:d,children:[w?.flagEmoji?e.jsx("span",{className:"text-lg",children:w.flagEmoji}):e.jsx(E.Globe,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:m})]}),y&&typeof document<"u"&&x&&Ka.createPortal(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-[9998]",onMouseDown:N=>{N.preventDefault(),f(!1)}}),x]}),document.body)]})}const p=v&&y?e.jsx("div",{ref:g,className:"fixed z-[9999] min-w-[180px] rounded-md border border-border bg-popover text-popover-foreground p-2 shadow-lg",style:{top:`${l.top}px`,left:`${l.left}px`},onMouseDown:x=>x.stopPropagation(),children:e.jsx("div",{className:"grid gap-1",children:t.map(x=>e.jsxs("button",{onMouseDown:N=>{N.preventDefault(),N.stopPropagation(),b(x.code)},type:"button",className:j("flex items-center gap-2 rounded-sm px-2 py-2 text-sm hover:bg-accent hover:text-accent-foreground transition-colors cursor-pointer",a===x.code&&"bg-accent"),children:[s&&x.flagEmoji&&e.jsx("span",{className:"text-lg",children:x.flagEmoji}),s&&x.flag&&!x.flagEmoji&&e.jsx("img",{src:x.flag,alt:x.label,className:"h-4 w-6 object-cover rounded"}),e.jsx("span",{className:"flex-1 text-left",children:x.label}),a===x.code&&e.jsx(E.Check,{className:"h-4 w-4 shrink-0"})]},x.code))})}):null;return e.jsxs(e.Fragment,{children:[e.jsxs("button",{ref:S,onClick:x=>{x.preventDefault(),x.stopPropagation(),d||f(!v)},className:j("inline-flex items-center gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm hover:bg-accent hover:text-accent-foreground transition-colors",d&&"opacity-50 cursor-not-allowed",u),disabled:d,type:"button","aria-label":m,children:[s&&w?.flagEmoji&&e.jsx("span",{className:"text-lg",children:w.flagEmoji}),s&&w?.flag&&!w?.flagEmoji&&e.jsx("img",{src:w.flag,alt:w.label,className:"h-4 w-6 object-cover rounded"}),!s&&e.jsx(E.Globe,{className:"h-4 w-4"}),n&&e.jsx("span",{children:w?.label||"Langue"}),e.jsx(E.ChevronDown,{className:"h-4 w-4"})]}),y&&typeof document<"u"&&p&&Ka.createPortal(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-[9998]",onMouseDown:x=>{x.preventDefault(),f(!1)}}),p]}),document.body)]})}const uh=ue.Menu,mh=ue.Group,fh=ue.Portal,hh=ue.Sub,ph=ue.RadioGroup,Kn=i.forwardRef(({className:t,...a},r)=>e.jsx(ue.Root,{ref:r,className:j("flex h-10 items-center space-x-1 rounded-md border bg-background p-1",t),...a}));Kn.displayName=ue.Root.displayName;const Zn=i.forwardRef(({className:t,...a},r)=>e.jsx(ue.Trigger,{ref:r,className:j("flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t),...a}));Zn.displayName=ue.Trigger.displayName;const Qn=i.forwardRef(({className:t,inset:a,children:r,...s},n)=>e.jsxs(ue.SubTrigger,{ref:n,className:j("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",a&&"pl-8",t),...s,children:[r,e.jsx(E.ChevronRight,{className:"ml-auto h-4 w-4"})]}));Qn.displayName=ue.SubTrigger.displayName;const eo=i.forwardRef(({className:t,...a},r)=>e.jsx(ue.SubContent,{ref:r,className:j("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...a}));eo.displayName=ue.SubContent.displayName;const to=i.forwardRef(({className:t,align:a="start",alignOffset:r=-4,sideOffset:s=8,...n},o)=>e.jsx(ue.Portal,{children:e.jsx(ue.Content,{ref:o,align:a,alignOffset:r,sideOffset:s,className:j("z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n})}));to.displayName=ue.Content.displayName;const ao=i.forwardRef(({className:t,inset:a,...r},s)=>e.jsx(ue.Item,{ref:s,className:j("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a&&"pl-8",t),...r}));ao.displayName=ue.Item.displayName;const ro=i.forwardRef(({className:t,children:a,checked:r,...s},n)=>e.jsxs(ue.CheckboxItem,{ref:n,className:j("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:r,...s,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(ue.ItemIndicator,{children:e.jsx(E.Check,{className:"h-4 w-4"})})}),a]}));ro.displayName=ue.CheckboxItem.displayName;const so=i.forwardRef(({className:t,children:a,...r},s)=>e.jsxs(ue.RadioItem,{ref:s,className:j("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...r,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(ue.ItemIndicator,{children:e.jsx(E.Circle,{className:"h-2 w-2 fill-current"})})}),a]}));so.displayName=ue.RadioItem.displayName;const no=i.forwardRef(({className:t,inset:a,...r},s)=>e.jsx(ue.Label,{ref:s,className:j("px-2 py-1.5 text-sm font-semibold",a&&"pl-8",t),...r}));no.displayName=ue.Label.displayName;const oo=i.forwardRef(({className:t,...a},r)=>e.jsx(ue.Separator,{ref:r,className:j("-mx-1 my-1 h-px bg-muted",t),...a}));oo.displayName=ue.Separator.displayName;const io=({className:t,...a})=>e.jsx("span",{className:j("ml-auto text-xs tracking-widest text-muted-foreground",t),...a});io.displayName="MenubarShortcut";const lo=i.forwardRef(({className:t,children:a,...r},s)=>e.jsxs(Ie.Root,{ref:s,className:j("relative z-10 flex max-w-max flex-1 items-center justify-center",t),...r,children:[a,e.jsx(Rr,{})]}));lo.displayName=Ie.Root.displayName;const co=i.forwardRef(({className:t,...a},r)=>e.jsx(Ie.List,{ref:r,className:j("group flex flex-1 list-none items-center justify-center space-x-1",t),...a}));co.displayName=Ie.List.displayName;const gh=Ie.Item,uo=De.cva("group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50"),mo=i.forwardRef(({className:t,children:a,...r},s)=>e.jsxs(Ie.Trigger,{ref:s,className:j(uo(),"group",t),...r,children:[a," ",e.jsx(E.ChevronDown,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]}));mo.displayName=Ie.Trigger.displayName;const fo=i.forwardRef(({className:t,...a},r)=>e.jsx(Ie.Content,{ref:r,className:j("left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto ",t),...a}));fo.displayName=Ie.Content.displayName;const bh=Ie.Link,Rr=i.forwardRef(({className:t,...a},r)=>e.jsx("div",{className:j("absolute left-0 top-full flex justify-center"),children:e.jsx(Ie.Viewport,{className:j("origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",t),ref:r,...a})}));Rr.displayName=Ie.Viewport.displayName;const ho=i.forwardRef(({className:t,...a},r)=>e.jsx(Ie.Indicator,{ref:r,className:j("top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",t),...a,children:e.jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}));ho.displayName=Ie.Indicator.displayName;const xt=ra.Root,vt=ra.Trigger,dt=i.forwardRef(({className:t,align:a="center",sideOffset:r=4,...s},n)=>e.jsx(ra.Portal,{children:e.jsx(ra.Content,{ref:n,align:a,sideOffset:r,className:j("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...s})}));dt.displayName=ra.Content.displayName;const po=i.forwardRef(({className:t,value:a,...r},s)=>e.jsx(Qa.Root,{ref:s,className:j("relative h-4 w-full overflow-hidden rounded-full bg-secondary",t),...r,children:e.jsx(Qa.Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(a||0)}%)`}})}));po.displayName=Qa.Root.displayName;const go=i.forwardRef(({className:t,...a},r)=>e.jsx(sa.Root,{className:j("grid gap-2",t),...a,ref:r}));go.displayName=sa.Root.displayName;const bo=i.forwardRef(({className:t,...a},r)=>e.jsx(sa.Item,{ref:r,className:j("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...a,children:e.jsx(sa.Indicator,{className:"flex items-center justify-center",children:e.jsx(E.Circle,{className:"h-2.5 w-2.5 fill-current text-current"})})}));bo.displayName=sa.Item.displayName;const It=i.forwardRef(({className:t,children:a,...r},s)=>e.jsxs(Et.Root,{ref:s,className:j("relative overflow-hidden",t),...r,children:[e.jsx(Et.Viewport,{className:"h-full w-full rounded-[inherit]",children:a}),e.jsx($r,{}),e.jsx(Et.Corner,{})]}));It.displayName=Et.Root.displayName;const $r=i.forwardRef(({className:t,orientation:a="vertical",...r},s)=>e.jsx(Et.ScrollAreaScrollbar,{ref:s,orientation:a,className:j("flex touch-none select-none transition-colors",a==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",a==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",t),...r,children:e.jsx(Et.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));$r.displayName=Et.ScrollAreaScrollbar.displayName;const $t=i.forwardRef(({className:t,orientation:a="horizontal",decorative:r=!0,...s},n)=>e.jsx(zs.Root,{ref:n,decorative:r,orientation:a,className:j("shrink-0 bg-border",a==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...s}));$t.displayName=zs.Root.displayName;const Ar=he.Root,Fr=he.Trigger,xh=he.Close,xo=he.Portal,Lr=i.forwardRef(({className:t,...a},r)=>e.jsx(he.Overlay,{className:j("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...a,ref:r}));Lr.displayName=he.Overlay.displayName;const vh=De.cva("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),La=i.forwardRef(({side:t="right",className:a,children:r,...s},n)=>e.jsxs(xo,{children:[e.jsx(Lr,{}),e.jsxs(he.Content,{ref:n,className:j(vh({side:t}),a),...s,children:[r,e.jsxs(he.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[e.jsx(E.X,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));La.displayName=he.Content.displayName;const Ir=({className:t,...a})=>e.jsx("div",{className:j("flex flex-col space-y-2 text-center sm:text-left",t),...a});Ir.displayName="SheetHeader";const vo=({className:t,...a})=>e.jsx("div",{className:j("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...a});vo.displayName="SheetFooter";const Or=i.forwardRef(({className:t,...a},r)=>e.jsx(he.Title,{ref:r,className:j("text-lg font-semibold text-foreground",t),...a}));Or.displayName=he.Title.displayName;const _r=i.forwardRef(({className:t,...a},r)=>e.jsx(he.Description,{ref:r,className:j("text-sm text-muted-foreground",t),...a}));_r.displayName=he.Description.displayName;function yh({className:t,...a}){return e.jsx("div",{className:j("animate-pulse rounded-md bg-muted",t),...a})}const yo=i.forwardRef(({className:t,...a},r)=>e.jsxs(Jt.Root,{ref:r,className:j("relative flex w-full touch-none select-none items-center",t),...a,children:[e.jsx(Jt.Track,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:e.jsx(Jt.Range,{className:"absolute h-full bg-primary"})}),e.jsx(Jt.Thumb,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));yo.displayName=Jt.Root.displayName;const zr=i.forwardRef(({className:t,...a},r)=>e.jsx(er.Root,{className:j("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",t),...a,ref:r,children:e.jsx(er.Thumb,{className:j("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));zr.displayName=er.Root.displayName;const wo=i.forwardRef(({className:t,...a},r)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:r,className:j("w-full caption-bottom text-sm",t),...a})}));wo.displayName="Table";const jo=i.forwardRef(({className:t,...a},r)=>e.jsx("thead",{ref:r,className:j("[&_tr]:border-b",t),...a}));jo.displayName="TableHeader";const No=i.forwardRef(({className:t,...a},r)=>e.jsx("tbody",{ref:r,className:j("[&_tr:last-child]:border-0",t),...a}));No.displayName="TableBody";const So=i.forwardRef(({className:t,...a},r)=>e.jsx("tfoot",{ref:r,className:j("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...a}));So.displayName="TableFooter";const ko=i.forwardRef(({className:t,...a},r)=>e.jsx("tr",{ref:r,className:j("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t),...a}));ko.displayName="TableRow";const Co=i.forwardRef(({className:t,...a},r)=>e.jsx("th",{ref:r,className:j("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t),...a}));Co.displayName="TableHead";const To=i.forwardRef(({className:t,...a},r)=>e.jsx("td",{ref:r,className:j("p-4 align-middle [&:has([role=checkbox])]:pr-0",t),...a}));To.displayName="TableCell";const Eo=i.forwardRef(({className:t,...a},r)=>e.jsx("caption",{ref:r,className:j("mt-4 text-sm text-muted-foreground",t),...a}));Eo.displayName="TableCaption";const Vr=Rt.Root,Ia=i.forwardRef(({className:t,...a},r)=>e.jsx(Rt.List,{ref:r,className:j("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",t),...a}));Ia.displayName=Rt.List.displayName;const da=i.forwardRef(({className:t,...a},r)=>e.jsx(Rt.Trigger,{ref:r,className:j("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",t),...a}));da.displayName=Rt.Trigger.displayName;const ua=i.forwardRef(({className:t,...a},r)=>e.jsx(Rt.Content,{ref:r,className:j("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...a}));ua.displayName=Rt.Content.displayName;const pa=i.forwardRef(({className:t,...a},r)=>e.jsx("textarea",{className:j("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),ref:r,...a}));pa.displayName="Textarea";const Po=i.createContext(void 0);function Do({children:t,themes:a,defaultTheme:r="default",s3Config:s,onThemeChange:n,enableDarkMode:o=!1}){const[d,u]=i.useState(r),[h,m]=i.useState(!0),[v,f]=i.useState(new Set),[y,k]=i.useState(!1),[S,g]=i.useState(!1),w=i.useRef(new Map),b=i.useRef(new Set);i.useEffect(()=>{b.current=v},[v]);const l=i.useCallback(async T=>{if(!s)throw new Error("S3 configuration not provided");const{baseUrl:P,prefix:L="",extension:A="css",headers:V={},timeout:X=1e4}=s,me=P.replace(/\/+$/,""),se=L.replace(/^\/+/,"").replace(/\/+$/,""),Y=`v=${Date.now()}`;let H;se?H=`${me}/${se}/${T}.${A}?${Y}`:H=`${me}/${T}.${A}?${Y}`,console.log(`[ThemeProvider] Loading theme "${T}" from URL: ${H}`);try{const _=new AbortController,q=setTimeout(()=>_.abort(),X),$=await fetch(H,{signal:_.signal,headers:{Accept:A==="json"?"application/json":"text/css","Cache-Control":"no-cache, no-store, must-revalidate",Pragma:"no-cache",...V}});if(clearTimeout(q),!$.ok){const Z=`HTTP ${$.status}: ${$.statusText}`;throw console.error(`[ThemeProvider] Failed to load theme "${T}" from ${H}:`,Z),new Error(Z)}if(console.log(`[ThemeProvider] ✅ Successfully loaded theme "${T}" from ${H}`),A==="json"){let Z;try{const G=await $.text();if(console.log(`[ThemeProvider] Raw JSON response for theme "${T}" (${G.length} chars)`),!G||G.trim().length===0)throw new Error(`Empty JSON response for theme "${T}"`);Z=JSON.parse(G),console.log(`[ThemeProvider] Parsed JSON for theme "${T}":`,Object.keys(Z))}catch(G){throw console.error(`[ThemeProvider] Failed to parse JSON for theme "${T}":`,G),new Error(`Invalid JSON format for theme "${T}": ${G instanceof Error?G.message:"Unknown error"}`)}try{const G=wh(T,Z);if(!G.includes(`[data-theme="${T}"]`))throw console.error(`[ThemeProvider] ❌ Generated CSS missing [data-theme="${T}"] selector for theme "${T}"`),console.error("[ThemeProvider] Generated CSS:",G.substring(0,500)),new Error(`Generated CSS is missing the required selector [data-theme="${T}"]`);return console.log(`[ThemeProvider] ✅ Converted JSON to CSS for theme "${T}" (${G.length} chars)`),G}catch(G){throw console.error(`[ThemeProvider] Failed to convert JSON to CSS for theme "${T}":`,G),G}}const te=await $.text();if(!te||te.trim().length===0)throw new Error(`Empty CSS response for theme "${T}"`);return!te.includes(`[data-theme="${T}"]`)&&!te.includes(":root")&&!te.includes("html")?(console.warn(`[ThemeProvider] Theme CSS might be missing [data-theme="${T}"] selector`),console.warn("[ThemeProvider] CSS content preview:",te.substring(0,200))):console.log(`[ThemeProvider] ✅ CSS file loaded for theme "${T}" (${te.length} chars)`),te}catch(_){throw console.error(`[ThemeProvider] Error loading theme ${T}:`,_),_}},[s]);i.useCallback(T=>{const P=w.current.get(T);P&&(P.parentNode&&P.parentNode.removeChild(P),w.current.delete(T))},[]);const c=i.useCallback((T,P)=>{if(typeof document>"u")return;!P.includes(`[data-theme="${T}"]`)&&!P.includes(":root")&&console.warn(`[ThemeProvider] CSS might be missing [data-theme="${T}"] selector:`,P.substring(0,200)),document.querySelectorAll("style[data-theme-styles]").forEach(X=>X.remove()),w.current.clear();const A=document.createElement("style");A.setAttribute("data-theme-id",T),A.setAttribute("data-theme-styles","active"),A.textContent=P,document.head.appendChild(A),w.current.set(T,A),document.querySelector(`style[data-theme-id="${T}"]`)?console.log(`[ThemeProvider] ✅ CSS injected for theme "${T}" (${P.length} chars)`):console.error(`[ThemeProvider] ❌ Failed to inject CSS for theme "${T}"`),A.offsetHeight},[]),p=i.useCallback(T=>{if(typeof document>"u")return;const P=document.documentElement;P.setAttribute("data-theme",T);const L=P.getAttribute("data-theme");L!==T?console.warn(`[ThemeProvider] Failed to apply theme attribute. Expected: ${T}, Got: ${L}`):console.log(`[ThemeProvider] ✅ Theme attribute applied: data-theme="${T}"`);try{localStorage.setItem("waka-theme",T)}catch(A){console.warn("[ThemeProvider] Could not save theme to localStorage:",A)}},[]),x=i.useCallback(async T=>{if(!b.current.has(T))try{if(s){const P=await l(T);c(T,P),f(L=>new Set(L).add(T))}else f(P=>new Set(P).add(T))}catch(P){throw console.error(`[ThemeProvider] Failed to preload theme ${T}:`,P),P}},[s,l,c]),N=i.useCallback(async T=>{console.log(`[ThemeProvider] changeTheme called with themeId: ${T}`),m(!0);try{if(s){console.log(`[ThemeProvider] Loading theme from S3: ${T}`);const P=await l(T);console.log(`[ThemeProvider] CSS loaded, length: ${P.length}`),c(T,P),f(L=>new Set(L).add(T)),await new Promise(L=>requestAnimationFrame(L))}else console.log("[ThemeProvider] No S3 config, applying theme directly");console.log(`[ThemeProvider] Applying theme attribute: ${T}`),p(T),u(T),console.log(`[ThemeProvider] ✅ Theme changed successfully to: ${T}`),n?.(T)}catch(P){console.error(`[ThemeProvider] ❌ Failed to change theme to ${T}:`,P);try{p(T),u(T)}catch(L){console.error("[ThemeProvider] ❌ Fallback also failed:",L)}throw P}finally{m(!1)}},[s,l,c,p,n]),R=i.useCallback(T=>v.has(T),[v]);i.useEffect(()=>{if(y)return;(async()=>{m(!0);try{let P=r;if(typeof window<"u"){const L=localStorage.getItem("waka-theme");L&&a.some(A=>A.id===L)&&(P=L)}if(s){const L=await l(P);c(P,L),f(new Set([P])),await new Promise(A=>requestAnimationFrame(A))}else f(new Set([P]));p(P),u(P)}catch(P){console.error("[ThemeProvider] Error initializing:",P),p(r),u(r),f(new Set([r]))}finally{m(!1),k(!0)}})()},[y,r,a,s,l,c,p]);const F=i.useCallback(()=>{o&&g(T=>{const P=!T,L=document.documentElement;P?L.classList.add("dark"):L.classList.remove("dark");try{localStorage.setItem("waka-dark-mode",P?"dark":"light")}catch(A){console.warn("[ThemeProvider] Could not save dark mode to localStorage:",A)}return P})},[o]);i.useEffect(()=>{if(!o||typeof window>"u")return;let T=!1;try{const V=localStorage.getItem("waka-dark-mode");V!==null?T=V==="dark":(T=window.matchMedia("(prefers-color-scheme: dark)").matches,localStorage.setItem("waka-dark-mode",T?"dark":"light"))}catch(V){console.warn("[ThemeProvider] Could not read dark mode from localStorage:",V)}g(T);const P=document.documentElement;T?P.classList.add("dark"):P.classList.remove("dark");const L=window.matchMedia("(prefers-color-scheme: dark)"),A=V=>{try{localStorage.getItem("waka-dark-mode")||(g(V.matches),V.matches?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),localStorage.setItem("waka-dark-mode",V.matches?"dark":"light"))}catch{}};return L.addEventListener("change",A),()=>{L.removeEventListener("change",A)}},[]),i.useEffect(()=>()=>{w.current.forEach(T=>{T.parentNode&&T.parentNode.removeChild(T)}),w.current.clear()},[]);const D={currentTheme:d,themes:a,changeTheme:N,isLoading:h,loadedThemes:v,preloadTheme:x,isThemeLoaded:R,isDarkMode:S,toggleDarkMode:F};return e.jsx(Po.Provider,{value:D,children:t})}function wh(t,a){if(!a||typeof a!="object")throw console.error(`[ThemeProvider] Invalid JSON data for theme "${t}":`,a),new Error(`Invalid JSON data for theme "${t}"`);let r={};if(a.cssVars||a["css-vars"])r=a.cssVars||a["css-vars"],console.log(`[ThemeProvider] Using cssVars/css-vars format for theme "${t}"`);else if(a.variables)r=a.variables,console.log(`[ThemeProvider] Using variables format for theme "${t}"`);else if(typeof a=="object"&&a!==null){const g=["label","description","author","previewColor","version","createdAt","changelog","id"];r=Object.fromEntries(Object.entries(a).filter(([w])=>!g.includes(w))),console.log(`[ThemeProvider] Using direct object format for theme "${t}"`)}if(!r||Object.keys(r).length===0)throw console.error(`[ThemeProvider] No CSS variables found in JSON for theme "${t}":`,a),new Error(`No CSS variables found in JSON for theme "${t}"`);console.log(`[ThemeProvider] Found ${Object.keys(r).length} CSS variables for theme "${t}"`);const s=(g,w)=>{if(typeof g=="string")return g;if(typeof g=="number"||typeof g=="boolean")return String(g);if(g==null)return"none";if(typeof g=="object"){if(Array.isArray(g))return g.map(l=>s(l,w)).join(" ");if(console.log(`[ThemeProvider] Converting object value for key "${w}":`,JSON.stringify(g,null,2)),("r"in g||"R"in g)&&("g"in g||"G"in g)&&("b"in g||"B"in g)){const l=g.r??g.R??0,c=g.g??g.G??0,p=g.b??g.B??0,x=g.a??g.A??g.alpha??g.opacity;return x!=null?`rgba(${l}, ${c}, ${p}, ${x})`:`rgb(${l}, ${c}, ${p})`}if(("h"in g||"H"in g)&&("s"in g||"S"in g)&&("l"in g||"L"in g)){const l=g.h??g.H??0,c=g.s??g.S??0,p=g.l??g.L??0,x=g.a??g.A??g.alpha??g.opacity;return x!=null?`hsla(${l}, ${c}%, ${p}%, ${x})`:`hsl(${l}, ${c}%, ${p}%)`}return Object.keys(g).length>0?(console.warn(`[ThemeProvider] Object value for "${w}" has nested structure, cannot convert to CSS:`,g),JSON.stringify(g)):"none"}return console.warn(`[ThemeProvider] Unknown value type for "${w}":`,typeof g,g),String(g)},n=(g,w="")=>{const b=[];for(const[l,c]of Object.entries(g))if(typeof c=="object"&&c!==null&&!Array.isArray(c))if(("r"in c||"R"in c||"h"in c||"H"in c)&&("g"in c||"G"in c||"s"in c||"S"in c)){const x=w?`--${w}-${l}`:l.startsWith("--")?l:`--${l}`,N=s(c,l);b.push(` ${x}: ${N};`)}else{const x=w?`${w}-${l}`:"",N=n(c,x);b.push(...N)}else{const p=w?`--${w}-${l}`:l.startsWith("--")?l:`--${l}`,x=s(c,l);b.push(` ${p}: ${x};`)}return b},o=r.light,d=r.dark,u=r.theme,h=Object.fromEntries(Object.entries(r).filter(([g])=>!["light","dark","theme"].includes(g))),m=[];u&&typeof u=="object"&&!Array.isArray(u)&&m.push(...n(u,"")),Object.keys(h).length>0&&m.push(...n(h,""));const v=o&&typeof o=="object"&&!Array.isArray(o)?n(o,""):[],f=d&&typeof d=="object"&&!Array.isArray(d)?n(d,""):[];let y="";if(m.length>0||v.length>0){const g=[...m,...v];y+=`[data-theme="${t}"] {
|
|
4
|
-
${
|
|
1
|
+
"use strict";var yc=Object.create;var jn=Object.defineProperty;var Nc=Object.getOwnPropertyDescriptor;var Cc=Object.getOwnPropertyNames;var kc=Object.getPrototypeOf,Sc=Object.prototype.hasOwnProperty;var Dc=(t,a,s,r)=>{if(a&&typeof a=="object"||typeof a=="function")for(let n of Cc(a))!Sc.call(t,n)&&n!==s&&jn(t,n,{get:()=>a[n],enumerable:!(r=Nc(a,n))||r.enumerable});return t};var ua=(t,a,s)=>(s=t!=null?yc(kc(t)):{},Dc(a||!t||!t.__esModule?jn(s,"default",{value:t,enumerable:!0}):s,t));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),O=require("react"),Tc=require("@radix-ui/react-accordion"),h=require("lucide-react"),Co=require("clsx"),Ec=require("tailwind-merge"),Ye=require("class-variance-authority"),Mc=require("@radix-ui/react-alert-dialog"),Pc=require("@radix-ui/react-aspect-ratio"),Ac=require("@radix-ui/react-avatar"),ya=require("@radix-ui/react-slot"),Rc=require("react-day-picker"),Fc=require("@radix-ui/react-checkbox"),_=require("date-fns"),$c=require("@radix-ui/react-collapsible"),ut=require("cmdk"),Lc=require("@radix-ui/react-dialog"),Ic=require("@radix-ui/react-context-menu"),Oc=require("@radix-ui/react-dropdown-menu"),zc=require("@radix-ui/react-label"),_c=require("@radix-ui/react-hover-card"),Vc=require("@radix-ui/react-select"),Za=require("react-dom"),Wc=require("@radix-ui/react-menubar"),Uc=require("@radix-ui/react-navigation-menu"),Bc=require("@radix-ui/react-popover"),qc=require("@radix-ui/react-progress"),Hc=require("@radix-ui/react-radio-group"),Gc=require("@radix-ui/react-scroll-area"),Xc=require("@radix-ui/react-separator"),Yc=require("@radix-ui/react-slider"),Jc=require("@radix-ui/react-switch"),Kc=require("@radix-ui/react-tabs"),Qc=require("@radix-ui/react-toast"),Zc=require("@radix-ui/react-toggle"),ed=require("@radix-ui/react-tooltip"),qe=require("@tanstack/react-table"),Nt=require("react-i18next"),td=require("@tanstack/react-virtual"),_t=require("react-datepicker"),$t=require("i18next");function Pe(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const s in t)if(s!=="default"){const r=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(a,s,r.get?r:{enumerable:!0,get:()=>t[s]})}}return a.default=t,Object.freeze(a)}const l=Pe(O),hs=Pe(Tc),ot=Pe(Mc),sd=Pe(Pc),Ds=Pe(Ac),er=Pe(Fc),ur=Pe($c),ue=Pe(Lc),Ae=Pe(Ic),Re=Pe(Oc),ko=Pe(zc),Na=Pe(_c),We=Pe(Vc),Me=Pe(Wc),mt=Pe(Uc),Bs=Pe(Bc),tr=Pe(qc),qs=Pe(Hc),us=Pe(Gc),So=Pe(Xc),Os=Pe(Yc),sr=Pe(Jc),ws=Pe(Kc),pt=Pe(Qc),Do=Pe(Zc),Qs=Pe(ed);function ga(...t){return Ec.twMerge(Co.clsx(...t))}ga.variants=function(t){const a={variants:t.variants??{},defaultVariants:t.defaultVariants},s=Ye.cva(t.base??"",a);return r=>{const{class:n,className:o,...i}=r??{};return ga(s(i),n,o)}};const g=(...t)=>ga(t),ar=hs.Root,mr=l.forwardRef(({className:t,...a},s)=>e.jsx(hs.Item,{ref:s,className:g("border-b",t),...a}));mr.displayName="AccordionItem";const hr=l.forwardRef(({className:t,children:a,...s},r)=>e.jsx(hs.Header,{className:"flex",children:e.jsxs(hs.Trigger,{ref:r,className:g("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",t),...s,children:[a,e.jsx(h.ChevronDown,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));hr.displayName=hs.Trigger.displayName;const fr=l.forwardRef(({className:t,children:a,...s},r)=>e.jsx(hs.Content,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...s,children:e.jsx("div",{className:g("pb-4 pt-0",t),children:a})}));fr.displayName=hs.Content.displayName;const fs=ot.Root,To=ot.Trigger,Eo=ot.Portal,pr=l.forwardRef(({className:t,...a},s)=>e.jsx(ot.Overlay,{className:g("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...a,ref:s}));pr.displayName=ot.Overlay.displayName;const Xt=l.forwardRef(({className:t,...a},s)=>e.jsxs(Eo,{children:[e.jsx(pr,{}),e.jsx(ot.Content,{ref:s,className:g("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...a})]}));Xt.displayName=ot.Content.displayName;const Yt=({className:t,...a})=>e.jsx("div",{className:g("flex flex-col space-y-2 text-center sm:text-left",t),...a});Yt.displayName="AlertDialogHeader";const Jt=({className:t,...a})=>e.jsx("div",{className:g("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...a});Jt.displayName="AlertDialogFooter";const Kt=l.forwardRef(({className:t,...a},s)=>e.jsx(ot.Title,{ref:s,className:g("text-lg font-semibold",t),...a}));Kt.displayName=ot.Title.displayName;const Qt=l.forwardRef(({className:t,...a},s)=>e.jsx(ot.Description,{ref:s,className:g("text-sm text-muted-foreground",t),...a}));Qt.displayName=ot.Description.displayName;const Zt=l.forwardRef(({className:t,...a},s)=>e.jsx(ot.Action,{ref:s,className:g("inline-flex h-10 items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-semibold text-primary-foreground ring-offset-background transition-colors hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...a}));Zt.displayName=ot.Action.displayName;const es=l.forwardRef(({className:t,...a},s)=>e.jsx(ot.Cancel,{ref:s,className:g("mt-2 inline-flex h-10 items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-semibold ring-offset-background transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 sm:mt-0",t),...a}));es.displayName=ot.Cancel.displayName;const ad=Ye.cva("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Mo=l.forwardRef(({className:t,variant:a,...s},r)=>e.jsx("div",{ref:r,role:"alert",className:g(ad({variant:a}),t),...s}));Mo.displayName="Alert";const Po=l.forwardRef(({className:t,...a},s)=>e.jsx("h5",{ref:s,className:g("mb-1 font-medium leading-none tracking-tight",t),...a}));Po.displayName="AlertTitle";const Ao=l.forwardRef(({className:t,...a},s)=>e.jsx("div",{ref:s,className:g("text-sm [&_p]:leading-relaxed",t),...a}));Ao.displayName="AlertDescription";const rd=sd.Root,Ct=l.forwardRef(({className:t,...a},s)=>e.jsx(Ds.Root,{ref:s,className:g("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...a}));Ct.displayName=Ds.Root.displayName;const kt=l.forwardRef(({className:t,...a},s)=>e.jsx(Ds.Image,{ref:s,className:g("aspect-square h-full w-full",t),...a}));kt.displayName=Ds.Image.displayName;const St=l.forwardRef(({className:t,...a},s)=>e.jsx(Ds.Fallback,{ref:s,className:g("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...a}));St.displayName=Ds.Fallback.displayName;const Ro=Ye.cva("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function De({className:t,variant:a,...s}){return e.jsx("div",{className:g(Ro({variant:a}),t),...s})}const nd=Ye.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),$=l.forwardRef(({className:t,variant:a,size:s,asChild:r=!1,...n},o)=>{const i=r?ya.Slot:"button";return e.jsx(i,{className:g(nd({variant:a,size:s,className:t})),ref:o,...n})});$.displayName="Button";function Ca({className:t,classNames:a,showOutsideDays:s=!0,...r}){return e.jsx(Rc.DayPicker,{showOutsideDays:s,className:g("p-4 bg-background border border-border rounded-lg shadow-sm",t),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center mb-4",caption_label:"text-lg font-semibold text-foreground",nav:"space-x-1 flex items-center",nav_button:g("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-all duration-200","h-8 w-8 bg-background border border-border hover:bg-accent hover:text-accent-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex mb-2",head_cell:"text-muted-foreground rounded-md w-10 h-10 font-medium text-sm flex items-center justify-center",row:"flex w-full",cell:"h-10 w-10 text-center text-sm p-0 relative",day:g("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-all duration-200","h-10 w-10 p-0 font-normal cursor-pointer","hover:bg-accent hover:text-accent-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50"),day_range_end:"day-range-end",day_selected:g("bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground","focus:bg-primary focus:text-primary-foreground shadow-sm"),day_today:"bg-accent text-accent-foreground font-semibold",day_outside:"text-muted-foreground opacity-50 hover:opacity-70",day_disabled:"text-muted-foreground opacity-30 cursor-not-allowed",day_range_middle:"bg-accent/50 text-accent-foreground",day_hidden:"invisible",...a},components:{Chevron:({...n})=>n.orientation==="left"?e.jsx(h.ChevronLeft,{className:"h-4 w-4"}):e.jsx(h.ChevronRight,{className:"h-4 w-4"})},...r})}Ca.displayName="Calendar";const Se=l.forwardRef(({className:t,...a},s)=>e.jsx("div",{ref:s,className:g("rounded-xl border bg-card text-card-foreground shadow",t),...a}));Se.displayName="Card";const He=l.forwardRef(({className:t,...a},s)=>e.jsx("div",{ref:s,className:g("flex flex-col space-y-1.5 p-6",t),...a}));He.displayName="CardHeader";const Ve=l.forwardRef(({className:t,...a},s)=>e.jsx("h3",{ref:s,className:g("font-semibold leading-none tracking-tight",t),...a}));Ve.displayName="CardTitle";const nt=l.forwardRef(({className:t,...a},s)=>e.jsx("p",{ref:s,className:g("text-sm text-muted-foreground",t),...a}));nt.displayName="CardDescription";const Ee=l.forwardRef(({className:t,...a},s)=>e.jsx("div",{ref:s,className:g("p-6 pt-0",t),...a}));Ee.displayName="CardContent";const xr=l.forwardRef(({className:t,...a},s)=>e.jsx("div",{ref:s,className:g("flex items-center p-6 pt-0",t),...a}));xr.displayName="CardFooter";const et=l.forwardRef(({className:t,...a},s)=>e.jsx(er.Root,{ref:s,className:g("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",t),...a,children:e.jsx(er.Indicator,{className:g("flex items-center justify-center text-current"),children:e.jsx(h.Check,{className:"h-4 w-4"})})}));et.displayName=er.Root.displayName;function $e(t){return(a={})=>{const s=a.width?String(a.width):t.defaultWidth;return t.formats[s]||t.formats[t.defaultWidth]}}function fe(t){return(a,s)=>{const r=s?.context?String(s.context):"standalone";let n;if(r==="formatting"&&t.formattingValues){const i=t.defaultFormattingWidth||t.defaultWidth,c=s?.width?String(s.width):i;n=t.formattingValues[c]||t.formattingValues[i]}else{const i=t.defaultWidth,c=s?.width?String(s.width):t.defaultWidth;n=t.values[c]||t.values[i]}const o=t.argumentCallback?t.argumentCallback(a):a;return n[o]}}function pe(t){return(a,s={})=>{const r=s.width,n=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=a.match(n);if(!o)return null;const i=o[0],c=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],m=Array.isArray(c)?id(c,u=>u.test(i)):od(c,u=>u.test(i));let d;d=t.valueCallback?t.valueCallback(m):m,d=s.valueCallback?s.valueCallback(d):d;const x=a.slice(i.length);return{value:d,rest:x}}}function od(t,a){for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&a(t[s]))return s}function id(t,a){for(let s=0;s<t.length;s++)if(a(t[s]))return s}function ss(t){return(a,s={})=>{const r=a.match(t.matchPattern);if(!r)return null;const n=r[0],o=a.match(t.parsePattern);if(!o)return null;let i=t.valueCallback?t.valueCallback(o[0]):o[0];i=s.valueCallback?s.valueCallback(i):i;const c=a.slice(n.length);return{value:i,rest:c}}}const vn=Symbol.for("constructDateFrom");function Fo(t,a){return typeof t=="function"?t(a):t&&typeof t=="object"&&vn in t?t[vn](a):t instanceof Date?new t.constructor(a):new Date(a)}function ld(t,...a){const s=Fo.bind(null,t||a.find(r=>typeof r=="object"));return a.map(s)}let cd={};function dd(){return cd}function ud(t,a){return Fo(a||t,t)}function wn(t,a){const s=dd(),r=a?.weekStartsOn??a?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0,n=ud(t,a?.in),o=n.getDay(),i=(o<r?7:0)+o-r;return n.setDate(n.getDate()-i),n.setHours(0,0,0,0),n}function rr(t,a,s){const[r,n]=ld(s?.in,t,a);return+wn(r,s)==+wn(n,s)}const yn={lessThanXSeconds:{standalone:{one:"weniger als 1 Sekunde",other:"weniger als {{count}} Sekunden"},withPreposition:{one:"weniger als 1 Sekunde",other:"weniger als {{count}} Sekunden"}},xSeconds:{standalone:{one:"1 Sekunde",other:"{{count}} Sekunden"},withPreposition:{one:"1 Sekunde",other:"{{count}} Sekunden"}},halfAMinute:{standalone:"eine halbe Minute",withPreposition:"einer halben Minute"},lessThanXMinutes:{standalone:{one:"weniger als 1 Minute",other:"weniger als {{count}} Minuten"},withPreposition:{one:"weniger als 1 Minute",other:"weniger als {{count}} Minuten"}},xMinutes:{standalone:{one:"1 Minute",other:"{{count}} Minuten"},withPreposition:{one:"1 Minute",other:"{{count}} Minuten"}},aboutXHours:{standalone:{one:"etwa 1 Stunde",other:"etwa {{count}} Stunden"},withPreposition:{one:"etwa 1 Stunde",other:"etwa {{count}} Stunden"}},xHours:{standalone:{one:"1 Stunde",other:"{{count}} Stunden"},withPreposition:{one:"1 Stunde",other:"{{count}} Stunden"}},xDays:{standalone:{one:"1 Tag",other:"{{count}} Tage"},withPreposition:{one:"1 Tag",other:"{{count}} Tagen"}},aboutXWeeks:{standalone:{one:"etwa 1 Woche",other:"etwa {{count}} Wochen"},withPreposition:{one:"etwa 1 Woche",other:"etwa {{count}} Wochen"}},xWeeks:{standalone:{one:"1 Woche",other:"{{count}} Wochen"},withPreposition:{one:"1 Woche",other:"{{count}} Wochen"}},aboutXMonths:{standalone:{one:"etwa 1 Monat",other:"etwa {{count}} Monate"},withPreposition:{one:"etwa 1 Monat",other:"etwa {{count}} Monaten"}},xMonths:{standalone:{one:"1 Monat",other:"{{count}} Monate"},withPreposition:{one:"1 Monat",other:"{{count}} Monaten"}},aboutXYears:{standalone:{one:"etwa 1 Jahr",other:"etwa {{count}} Jahre"},withPreposition:{one:"etwa 1 Jahr",other:"etwa {{count}} Jahren"}},xYears:{standalone:{one:"1 Jahr",other:"{{count}} Jahre"},withPreposition:{one:"1 Jahr",other:"{{count}} Jahren"}},overXYears:{standalone:{one:"mehr als 1 Jahr",other:"mehr als {{count}} Jahre"},withPreposition:{one:"mehr als 1 Jahr",other:"mehr als {{count}} Jahren"}},almostXYears:{standalone:{one:"fast 1 Jahr",other:"fast {{count}} Jahre"},withPreposition:{one:"fast 1 Jahr",other:"fast {{count}} Jahren"}}},md=(t,a,s)=>{let r;const n=s?.addSuffix?yn[t].withPreposition:yn[t].standalone;return typeof n=="string"?r=n:a===1?r=n.one:r=n.other.replace("{{count}}",String(a)),s?.addSuffix?s.comparison&&s.comparison>0?"in "+r:"vor "+r:r},hd={full:"EEEE, do MMMM y",long:"do MMMM y",medium:"do MMM y",short:"dd.MM.y"},fd={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},pd={full:"{{date}} 'um' {{time}}",long:"{{date}} 'um' {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},xd={date:$e({formats:hd,defaultWidth:"full"}),time:$e({formats:fd,defaultWidth:"full"}),dateTime:$e({formats:pd,defaultWidth:"full"})},gd={lastWeek:"'letzten' eeee 'um' p",yesterday:"'gestern um' p",today:"'heute um' p",tomorrow:"'morgen um' p",nextWeek:"eeee 'um' p",other:"P"},bd=(t,a,s,r)=>gd[t],jd={narrow:["v.Chr.","n.Chr."],abbreviated:["v.Chr.","n.Chr."],wide:["vor Christus","nach Christus"]},vd={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1. Quartal","2. Quartal","3. Quartal","4. Quartal"]},nr={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],wide:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"]},wd={narrow:nr.narrow,abbreviated:["Jan.","Feb.","März","Apr.","Mai","Juni","Juli","Aug.","Sep.","Okt.","Nov.","Dez."],wide:nr.wide},yd={narrow:["S","M","D","M","D","F","S"],short:["So","Mo","Di","Mi","Do","Fr","Sa"],abbreviated:["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."],wide:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"]},Nd={narrow:{am:"vm.",pm:"nm.",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachm.",evening:"Abend",night:"Nacht"},abbreviated:{am:"vorm.",pm:"nachm.",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachmittag",evening:"Abend",night:"Nacht"},wide:{am:"vormittags",pm:"nachmittags",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachmittag",evening:"Abend",night:"Nacht"}},Cd={narrow:{am:"vm.",pm:"nm.",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachm.",evening:"abends",night:"nachts"},abbreviated:{am:"vorm.",pm:"nachm.",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachmittags",evening:"abends",night:"nachts"},wide:{am:"vormittags",pm:"nachmittags",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachmittags",evening:"abends",night:"nachts"}},kd=t=>Number(t)+".",Sd={ordinalNumber:kd,era:fe({values:jd,defaultWidth:"wide"}),quarter:fe({values:vd,defaultWidth:"wide",argumentCallback:t=>t-1}),month:fe({values:nr,formattingValues:wd,defaultWidth:"wide"}),day:fe({values:yd,defaultWidth:"wide"}),dayPeriod:fe({values:Nd,defaultWidth:"wide",formattingValues:Cd,defaultFormattingWidth:"wide"})},Dd=/^(\d+)(\.)?/i,Td=/\d+/i,Ed={narrow:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,abbreviated:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,wide:/^(vor Christus|vor unserer Zeitrechnung|nach Christus|unserer Zeitrechnung)/i},Md={any:[/^v/i,/^n/i]},Pd={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](\.)? Quartal/i},Ad={any:[/1/i,/2/i,/3/i,/4/i]},Rd={narrow:/^[jfmasond]/i,abbreviated:/^(j[aä]n|feb|mär[z]?|apr|mai|jun[i]?|jul[i]?|aug|sep|okt|nov|dez)\.?/i,wide:/^(januar|februar|märz|april|mai|juni|juli|august|september|oktober|november|dezember)/i},Fd={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^j[aä]/i,/^f/i,/^mär/i,/^ap/i,/^mai/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},$d={narrow:/^[smdmf]/i,short:/^(so|mo|di|mi|do|fr|sa)/i,abbreviated:/^(son?|mon?|die?|mit?|don?|fre?|sam?)\.?/i,wide:/^(sonntag|montag|dienstag|mittwoch|donnerstag|freitag|samstag)/i},Ld={any:[/^so/i,/^mo/i,/^di/i,/^mi/i,/^do/i,/^f/i,/^sa/i]},Id={narrow:/^(vm\.?|nm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,abbreviated:/^(vorm\.?|nachm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,wide:/^(vormittags|nachmittags|Mitternacht|Mittag|morgens|nachmittags|abends|nachts)/i},Od={any:{am:/^v/i,pm:/^n/i,midnight:/^Mitte/i,noon:/^Mitta/i,morning:/morgens/i,afternoon:/nachmittags/i,evening:/abends/i,night:/nachts/i}},zd={ordinalNumber:ss({matchPattern:Dd,parsePattern:Td,valueCallback:t=>parseInt(t)}),era:pe({matchPatterns:Ed,defaultMatchWidth:"wide",parsePatterns:Md,defaultParseWidth:"any"}),quarter:pe({matchPatterns:Pd,defaultMatchWidth:"wide",parsePatterns:Ad,defaultParseWidth:"any",valueCallback:t=>t+1}),month:pe({matchPatterns:Rd,defaultMatchWidth:"wide",parsePatterns:Fd,defaultParseWidth:"any"}),day:pe({matchPatterns:$d,defaultMatchWidth:"wide",parsePatterns:Ld,defaultParseWidth:"any"}),dayPeriod:pe({matchPatterns:Id,defaultMatchWidth:"wide",parsePatterns:Od,defaultParseWidth:"any"})},$o={code:"de",formatDistance:md,formatLong:xd,formatRelative:bd,localize:Sd,match:zd,options:{weekStartsOn:1,firstWeekContainsDate:4}},_d={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Vd=(t,a,s)=>{let r;const n=_d[t];return typeof n=="string"?r=n:a===1?r=n.one:r=n.other.replace("{{count}}",a.toString()),s?.addSuffix?s.comparison&&s.comparison>0?"in "+r:r+" ago":r},Wd={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Ud=(t,a,s,r)=>Wd[t],Bd={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},qd={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Hd={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Gd={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Xd={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Yd={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Jd=(t,a)=>{const s=Number(t),r=s%100;if(r>20||r<10)switch(r%10){case 1:return s+"st";case 2:return s+"nd";case 3:return s+"rd"}return s+"th"},Kd={ordinalNumber:Jd,era:fe({values:Bd,defaultWidth:"wide"}),quarter:fe({values:qd,defaultWidth:"wide",argumentCallback:t=>t-1}),month:fe({values:Hd,defaultWidth:"wide"}),day:fe({values:Gd,defaultWidth:"wide"}),dayPeriod:fe({values:Xd,defaultWidth:"wide",formattingValues:Yd,defaultFormattingWidth:"wide"})},Qd=/^(\d+)(th|st|nd|rd)?/i,Zd=/\d+/i,eu={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},tu={any:[/^b/i,/^(a|c)/i]},su={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},au={any:[/1/i,/2/i,/3/i,/4/i]},ru={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},nu={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},ou={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},iu={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},lu={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},cu={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},du={ordinalNumber:ss({matchPattern:Qd,parsePattern:Zd,valueCallback:t=>parseInt(t,10)}),era:pe({matchPatterns:eu,defaultMatchWidth:"wide",parsePatterns:tu,defaultParseWidth:"any"}),quarter:pe({matchPatterns:su,defaultMatchWidth:"wide",parsePatterns:au,defaultParseWidth:"any",valueCallback:t=>t+1}),month:pe({matchPatterns:ru,defaultMatchWidth:"wide",parsePatterns:nu,defaultParseWidth:"any"}),day:pe({matchPatterns:ou,defaultMatchWidth:"wide",parsePatterns:iu,defaultParseWidth:"any"}),dayPeriod:pe({matchPatterns:lu,defaultMatchWidth:"any",parsePatterns:cu,defaultParseWidth:"any"})},uu={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},mu={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},hu={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},fu={date:$e({formats:uu,defaultWidth:"full"}),time:$e({formats:mu,defaultWidth:"full"}),dateTime:$e({formats:hu,defaultWidth:"full"})},Lo={code:"en-US",formatDistance:Vd,formatLong:fu,formatRelative:Ud,localize:Kd,match:du,options:{weekStartsOn:0,firstWeekContainsDate:1}},pu={lessThanXSeconds:{one:"menos de un segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"medio minuto",lessThanXMinutes:{one:"menos de un minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"alrededor de 1 hora",other:"alrededor de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 día",other:"{{count}} días"},aboutXWeeks:{one:"alrededor de 1 semana",other:"alrededor de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"alrededor de 1 mes",other:"alrededor de {{count}} meses"},xMonths:{one:"1 mes",other:"{{count}} meses"},aboutXYears:{one:"alrededor de 1 año",other:"alrededor de {{count}} años"},xYears:{one:"1 año",other:"{{count}} años"},overXYears:{one:"más de 1 año",other:"más de {{count}} años"},almostXYears:{one:"casi 1 año",other:"casi {{count}} años"}},xu=(t,a,s)=>{let r;const n=pu[t];return typeof n=="string"?r=n:a===1?r=n.one:r=n.other.replace("{{count}}",a.toString()),s?.addSuffix?s.comparison&&s.comparison>0?"en "+r:"hace "+r:r},gu={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/y"},bu={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},ju={full:"{{date}} 'a las' {{time}}",long:"{{date}} 'a las' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},vu={date:$e({formats:gu,defaultWidth:"full"}),time:$e({formats:bu,defaultWidth:"full"}),dateTime:$e({formats:ju,defaultWidth:"full"})},wu={lastWeek:"'el' eeee 'pasado a la' p",yesterday:"'ayer a la' p",today:"'hoy a la' p",tomorrow:"'mañana a la' p",nextWeek:"eeee 'a la' p",other:"P"},yu={lastWeek:"'el' eeee 'pasado a las' p",yesterday:"'ayer a las' p",today:"'hoy a las' p",tomorrow:"'mañana a las' p",nextWeek:"eeee 'a las' p",other:"P"},Nu=(t,a,s,r)=>a.getHours()!==1?yu[t]:wu[t],Cu={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","después de cristo"]},ku={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},Su={narrow:["e","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],wide:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"]},Du={narrow:["d","l","m","m","j","v","s"],short:["do","lu","ma","mi","ju","vi","sá"],abbreviated:["dom","lun","mar","mié","jue","vie","sáb"],wide:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"]},Tu={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"}},Eu={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"}},Mu=(t,a)=>Number(t)+"º",Pu={ordinalNumber:Mu,era:fe({values:Cu,defaultWidth:"wide"}),quarter:fe({values:ku,defaultWidth:"wide",argumentCallback:t=>Number(t)-1}),month:fe({values:Su,defaultWidth:"wide"}),day:fe({values:Du,defaultWidth:"wide"}),dayPeriod:fe({values:Tu,defaultWidth:"wide",formattingValues:Eu,defaultFormattingWidth:"wide"})},Au=/^(\d+)(º)?/i,Ru=/\d+/i,Fu={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,wide:/^(antes de cristo|antes de la era com[uú]n|despu[eé]s de cristo|era com[uú]n)/i},$u={any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes de la era com[uú]n)/i,/^(despu[eé]s de cristo|era com[uú]n)/i]},Lu={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},Iu={any:[/1/i,/2/i,/3/i,/4/i]},Ou={narrow:/^[efmajsond]/i,abbreviated:/^(ene|feb|mar|abr|may|jun|jul|ago|sep|oct|nov|dic)/i,wide:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i},zu={narrow:[/^e/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^en/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i]},_u={narrow:/^[dlmjvs]/i,short:/^(do|lu|ma|mi|ju|vi|s[áa])/i,abbreviated:/^(dom|lun|mar|mi[ée]|jue|vie|s[áa]b)/i,wide:/^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i},Vu={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^do/i,/^lu/i,/^ma/i,/^mi/i,/^ju/i,/^vi/i,/^sa/i]},Wu={narrow:/^(a|p|mn|md|(de la|a las) (mañana|tarde|noche))/i,any:/^([ap]\.?\s?m\.?|medianoche|mediodia|(de la|a las) (mañana|tarde|noche))/i},Uu={any:{am:/^a/i,pm:/^p/i,midnight:/^mn/i,noon:/^md/i,morning:/mañana/i,afternoon:/tarde/i,evening:/tarde/i,night:/noche/i}},Bu={ordinalNumber:ss({matchPattern:Au,parsePattern:Ru,valueCallback:function(t){return parseInt(t,10)}}),era:pe({matchPatterns:Fu,defaultMatchWidth:"wide",parsePatterns:$u,defaultParseWidth:"any"}),quarter:pe({matchPatterns:Lu,defaultMatchWidth:"wide",parsePatterns:Iu,defaultParseWidth:"any",valueCallback:t=>t+1}),month:pe({matchPatterns:Ou,defaultMatchWidth:"wide",parsePatterns:zu,defaultParseWidth:"any"}),day:pe({matchPatterns:_u,defaultMatchWidth:"wide",parsePatterns:Vu,defaultParseWidth:"any"}),dayPeriod:pe({matchPatterns:Wu,defaultMatchWidth:"any",parsePatterns:Uu,defaultParseWidth:"any"})},Io={code:"es",formatDistance:xu,formatLong:vu,formatRelative:Nu,localize:Pu,match:Bu,options:{weekStartsOn:1,firstWeekContainsDate:1}},qu={lessThanXSeconds:{one:"moins d’une seconde",other:"moins de {{count}} secondes"},xSeconds:{one:"1 seconde",other:"{{count}} secondes"},halfAMinute:"30 secondes",lessThanXMinutes:{one:"moins d’une minute",other:"moins de {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"environ 1 heure",other:"environ {{count}} heures"},xHours:{one:"1 heure",other:"{{count}} heures"},xDays:{one:"1 jour",other:"{{count}} jours"},aboutXWeeks:{one:"environ 1 semaine",other:"environ {{count}} semaines"},xWeeks:{one:"1 semaine",other:"{{count}} semaines"},aboutXMonths:{one:"environ 1 mois",other:"environ {{count}} mois"},xMonths:{one:"1 mois",other:"{{count}} mois"},aboutXYears:{one:"environ 1 an",other:"environ {{count}} ans"},xYears:{one:"1 an",other:"{{count}} ans"},overXYears:{one:"plus d’un an",other:"plus de {{count}} ans"},almostXYears:{one:"presqu’un an",other:"presque {{count}} ans"}},Hu=(t,a,s)=>{let r;const n=qu[t];return typeof n=="string"?r=n:a===1?r=n.one:r=n.other.replace("{{count}}",String(a)),s?.addSuffix?s.comparison&&s.comparison>0?"dans "+r:"il y a "+r:r},Gu={full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"dd/MM/y"},Xu={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},Yu={full:"{{date}} 'à' {{time}}",long:"{{date}} 'à' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Ju={date:$e({formats:Gu,defaultWidth:"full"}),time:$e({formats:Xu,defaultWidth:"full"}),dateTime:$e({formats:Yu,defaultWidth:"full"})},Ku={lastWeek:"eeee 'dernier à' p",yesterday:"'hier à' p",today:"'aujourd’hui à' p",tomorrow:"'demain à' p'",nextWeek:"eeee 'prochain à' p",other:"P"},Qu=(t,a,s,r)=>Ku[t],Zu={narrow:["av. J.-C","ap. J.-C"],abbreviated:["av. J.-C","ap. J.-C"],wide:["avant Jésus-Christ","après Jésus-Christ"]},em={narrow:["T1","T2","T3","T4"],abbreviated:["1er trim.","2ème trim.","3ème trim.","4ème trim."],wide:["1er trimestre","2ème trimestre","3ème trimestre","4ème trimestre"]},tm={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],wide:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"]},sm={narrow:["D","L","M","M","J","V","S"],short:["di","lu","ma","me","je","ve","sa"],abbreviated:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],wide:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"]},am={narrow:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"mat.",afternoon:"ap.m.",evening:"soir",night:"mat."},abbreviated:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"matin",afternoon:"après-midi",evening:"soir",night:"matin"},wide:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"du matin",afternoon:"de l’après-midi",evening:"du soir",night:"du matin"}},rm=(t,a)=>{const s=Number(t),r=a?.unit;if(s===0)return"0";const n=["year","week","hour","minute","second"];let o;return s===1?o=r&&n.includes(r)?"ère":"er":o="ème",s+o},nm=["MMM","MMMM"],om={preprocessor:(t,a)=>t.getDate()===1||!a.some(r=>r.isToken&&nm.includes(r.value))?a:a.map(r=>r.isToken&&r.value==="do"?{isToken:!0,value:"d"}:r),ordinalNumber:rm,era:fe({values:Zu,defaultWidth:"wide"}),quarter:fe({values:em,defaultWidth:"wide",argumentCallback:t=>t-1}),month:fe({values:tm,defaultWidth:"wide"}),day:fe({values:sm,defaultWidth:"wide"}),dayPeriod:fe({values:am,defaultWidth:"wide"})},im=/^(\d+)(ième|ère|ème|er|e)?/i,lm=/\d+/i,cm={narrow:/^(av\.J\.C|ap\.J\.C|ap\.J\.-C)/i,abbreviated:/^(av\.J\.-C|av\.J-C|apr\.J\.-C|apr\.J-C|ap\.J-C)/i,wide:/^(avant Jésus-Christ|après Jésus-Christ)/i},dm={any:[/^av/i,/^ap/i]},um={narrow:/^T?[1234]/i,abbreviated:/^[1234](er|ème|e)? trim\.?/i,wide:/^[1234](er|ème|e)? trimestre/i},mm={any:[/1/i,/2/i,/3/i,/4/i]},hm={narrow:/^[jfmasond]/i,abbreviated:/^(janv|févr|mars|avr|mai|juin|juill|juil|août|sept|oct|nov|déc)\.?/i,wide:/^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i},fm={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^av/i,/^ma/i,/^juin/i,/^juil/i,/^ao/i,/^s/i,/^o/i,/^n/i,/^d/i]},pm={narrow:/^[lmjvsd]/i,short:/^(di|lu|ma|me|je|ve|sa)/i,abbreviated:/^(dim|lun|mar|mer|jeu|ven|sam)\.?/i,wide:/^(dimanche|lundi|mardi|mercredi|jeudi|vendredi|samedi)/i},xm={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^di/i,/^lu/i,/^ma/i,/^me/i,/^je/i,/^ve/i,/^sa/i]},gm={narrow:/^(a|p|minuit|midi|mat\.?|ap\.?m\.?|soir|nuit)/i,any:/^([ap]\.?\s?m\.?|du matin|de l'après[-\s]midi|du soir|de la nuit)/i},bm={any:{am:/^a/i,pm:/^p/i,midnight:/^min/i,noon:/^mid/i,morning:/mat/i,afternoon:/ap/i,evening:/soir/i,night:/nuit/i}},jm={ordinalNumber:ss({matchPattern:im,parsePattern:lm,valueCallback:t=>parseInt(t)}),era:pe({matchPatterns:cm,defaultMatchWidth:"wide",parsePatterns:dm,defaultParseWidth:"any"}),quarter:pe({matchPatterns:um,defaultMatchWidth:"wide",parsePatterns:mm,defaultParseWidth:"any",valueCallback:t=>t+1}),month:pe({matchPatterns:hm,defaultMatchWidth:"wide",parsePatterns:fm,defaultParseWidth:"any"}),day:pe({matchPatterns:pm,defaultMatchWidth:"wide",parsePatterns:xm,defaultParseWidth:"any"}),dayPeriod:pe({matchPatterns:gm,defaultMatchWidth:"any",parsePatterns:bm,defaultParseWidth:"any"})},ps={code:"fr",formatDistance:Hu,formatLong:Ju,formatRelative:Qu,localize:om,match:jm,options:{weekStartsOn:1,firstWeekContainsDate:4}},vm={lessThanXSeconds:{one:"meno di un secondo",other:"meno di {{count}} secondi"},xSeconds:{one:"un secondo",other:"{{count}} secondi"},halfAMinute:"alcuni secondi",lessThanXMinutes:{one:"meno di un minuto",other:"meno di {{count}} minuti"},xMinutes:{one:"un minuto",other:"{{count}} minuti"},aboutXHours:{one:"circa un'ora",other:"circa {{count}} ore"},xHours:{one:"un'ora",other:"{{count}} ore"},xDays:{one:"un giorno",other:"{{count}} giorni"},aboutXWeeks:{one:"circa una settimana",other:"circa {{count}} settimane"},xWeeks:{one:"una settimana",other:"{{count}} settimane"},aboutXMonths:{one:"circa un mese",other:"circa {{count}} mesi"},xMonths:{one:"un mese",other:"{{count}} mesi"},aboutXYears:{one:"circa un anno",other:"circa {{count}} anni"},xYears:{one:"un anno",other:"{{count}} anni"},overXYears:{one:"più di un anno",other:"più di {{count}} anni"},almostXYears:{one:"quasi un anno",other:"quasi {{count}} anni"}},wm=(t,a,s)=>{let r;const n=vm[t];return typeof n=="string"?r=n:a===1?r=n.one:r=n.other.replace("{{count}}",a.toString()),s?.addSuffix?s.comparison&&s.comparison>0?"tra "+r:r+" fa":r},ym={full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"dd/MM/y"},Nm={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},Cm={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},km={date:$e({formats:ym,defaultWidth:"full"}),time:$e({formats:Nm,defaultWidth:"full"}),dateTime:$e({formats:Cm,defaultWidth:"full"})},gr=["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"];function Sm(t){switch(t){case 0:return"'domenica scorsa alle' p";default:return"'"+gr[t]+" scorso alle' p"}}function Nn(t){return"'"+gr[t]+" alle' p"}function Dm(t){switch(t){case 0:return"'domenica prossima alle' p";default:return"'"+gr[t]+" prossimo alle' p"}}const Tm={lastWeek:(t,a,s)=>{const r=t.getDay();return rr(t,a,s)?Nn(r):Sm(r)},yesterday:"'ieri alle' p",today:"'oggi alle' p",tomorrow:"'domani alle' p",nextWeek:(t,a,s)=>{const r=t.getDay();return rr(t,a,s)?Nn(r):Dm(r)},other:"P"},Em=(t,a,s,r)=>{const n=Tm[t];return typeof n=="function"?n(a,s,r):n},Mm={narrow:["aC","dC"],abbreviated:["a.C.","d.C."],wide:["avanti Cristo","dopo Cristo"]},Pm={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},Am={narrow:["G","F","M","A","M","G","L","A","S","O","N","D"],abbreviated:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],wide:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"]},Rm={narrow:["D","L","M","M","G","V","S"],short:["dom","lun","mar","mer","gio","ven","sab"],abbreviated:["dom","lun","mar","mer","gio","ven","sab"],wide:["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"]},Fm={narrow:{am:"m.",pm:"p.",midnight:"mezzanotte",noon:"mezzogiorno",morning:"mattina",afternoon:"pomeriggio",evening:"sera",night:"notte"},abbreviated:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"mattina",afternoon:"pomeriggio",evening:"sera",night:"notte"},wide:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"mattina",afternoon:"pomeriggio",evening:"sera",night:"notte"}},$m={narrow:{am:"m.",pm:"p.",midnight:"mezzanotte",noon:"mezzogiorno",morning:"di mattina",afternoon:"del pomeriggio",evening:"di sera",night:"di notte"},abbreviated:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"di mattina",afternoon:"del pomeriggio",evening:"di sera",night:"di notte"},wide:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"di mattina",afternoon:"del pomeriggio",evening:"di sera",night:"di notte"}},Lm=(t,a)=>{const s=Number(t);return String(s)},Im={ordinalNumber:Lm,era:fe({values:Mm,defaultWidth:"wide"}),quarter:fe({values:Pm,defaultWidth:"wide",argumentCallback:t=>t-1}),month:fe({values:Am,defaultWidth:"wide"}),day:fe({values:Rm,defaultWidth:"wide"}),dayPeriod:fe({values:Fm,defaultWidth:"wide",formattingValues:$m,defaultFormattingWidth:"wide"})},Om=/^(\d+)(º)?/i,zm=/\d+/i,_m={narrow:/^(aC|dC)/i,abbreviated:/^(a\.?\s?C\.?|a\.?\s?e\.?\s?v\.?|d\.?\s?C\.?|e\.?\s?v\.?)/i,wide:/^(avanti Cristo|avanti Era Volgare|dopo Cristo|Era Volgare)/i},Vm={any:[/^a/i,/^(d|e)/i]},Wm={narrow:/^[1234]/i,abbreviated:/^t[1234]/i,wide:/^[1234](º)? trimestre/i},Um={any:[/1/i,/2/i,/3/i,/4/i]},Bm={narrow:/^[gfmalsond]/i,abbreviated:/^(gen|feb|mar|apr|mag|giu|lug|ago|set|ott|nov|dic)/i,wide:/^(gennaio|febbraio|marzo|aprile|maggio|giugno|luglio|agosto|settembre|ottobre|novembre|dicembre)/i},qm={narrow:[/^g/i,/^f/i,/^m/i,/^a/i,/^m/i,/^g/i,/^l/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ge/i,/^f/i,/^mar/i,/^ap/i,/^mag/i,/^gi/i,/^l/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},Hm={narrow:/^[dlmgvs]/i,short:/^(do|lu|ma|me|gi|ve|sa)/i,abbreviated:/^(dom|lun|mar|mer|gio|ven|sab)/i,wide:/^(domenica|luned[i|ì]|marted[i|ì]|mercoled[i|ì]|gioved[i|ì]|venerd[i|ì]|sabato)/i},Gm={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^g/i,/^v/i,/^s/i],any:[/^d/i,/^l/i,/^ma/i,/^me/i,/^g/i,/^v/i,/^s/i]},Xm={narrow:/^(a|m\.|p|mezzanotte|mezzogiorno|(di|del) (mattina|pomeriggio|sera|notte))/i,any:/^([ap]\.?\s?m\.?|mezzanotte|mezzogiorno|(di|del) (mattina|pomeriggio|sera|notte))/i},Ym={any:{am:/^a/i,pm:/^p/i,midnight:/^mezza/i,noon:/^mezzo/i,morning:/mattina/i,afternoon:/pomeriggio/i,evening:/sera/i,night:/notte/i}},Jm={ordinalNumber:ss({matchPattern:Om,parsePattern:zm,valueCallback:t=>parseInt(t,10)}),era:pe({matchPatterns:_m,defaultMatchWidth:"wide",parsePatterns:Vm,defaultParseWidth:"any"}),quarter:pe({matchPatterns:Wm,defaultMatchWidth:"wide",parsePatterns:Um,defaultParseWidth:"any",valueCallback:t=>t+1}),month:pe({matchPatterns:Bm,defaultMatchWidth:"wide",parsePatterns:qm,defaultParseWidth:"any"}),day:pe({matchPatterns:Hm,defaultMatchWidth:"wide",parsePatterns:Gm,defaultParseWidth:"any"}),dayPeriod:pe({matchPatterns:Xm,defaultMatchWidth:"any",parsePatterns:Ym,defaultParseWidth:"any"})},Oo={code:"it",formatDistance:wm,formatLong:km,formatRelative:Em,localize:Im,match:Jm,options:{weekStartsOn:1,firstWeekContainsDate:4}},Km={lessThanXSeconds:{one:"1秒未満",other:"{{count}}秒未満",oneWithSuffix:"約1秒",otherWithSuffix:"約{{count}}秒"},xSeconds:{one:"1秒",other:"{{count}}秒"},halfAMinute:"30秒",lessThanXMinutes:{one:"1分未満",other:"{{count}}分未満",oneWithSuffix:"約1分",otherWithSuffix:"約{{count}}分"},xMinutes:{one:"1分",other:"{{count}}分"},aboutXHours:{one:"約1時間",other:"約{{count}}時間"},xHours:{one:"1時間",other:"{{count}}時間"},xDays:{one:"1日",other:"{{count}}日"},aboutXWeeks:{one:"約1週間",other:"約{{count}}週間"},xWeeks:{one:"1週間",other:"{{count}}週間"},aboutXMonths:{one:"約1か月",other:"約{{count}}か月"},xMonths:{one:"1か月",other:"{{count}}か月"},aboutXYears:{one:"約1年",other:"約{{count}}年"},xYears:{one:"1年",other:"{{count}}年"},overXYears:{one:"1年以上",other:"{{count}}年以上"},almostXYears:{one:"1年近く",other:"{{count}}年近く"}},Qm=(t,a,s)=>{s=s||{};let r;const n=Km[t];return typeof n=="string"?r=n:a===1?s.addSuffix&&n.oneWithSuffix?r=n.oneWithSuffix:r=n.one:s.addSuffix&&n.otherWithSuffix?r=n.otherWithSuffix.replace("{{count}}",String(a)):r=n.other.replace("{{count}}",String(a)),s.addSuffix?s.comparison&&s.comparison>0?r+"後":r+"前":r},Zm={full:"y年M月d日EEEE",long:"y年M月d日",medium:"y/MM/dd",short:"y/MM/dd"},eh={full:"H時mm分ss秒 zzzz",long:"H:mm:ss z",medium:"H:mm:ss",short:"H:mm"},th={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},sh={date:$e({formats:Zm,defaultWidth:"full"}),time:$e({formats:eh,defaultWidth:"full"}),dateTime:$e({formats:th,defaultWidth:"full"})},ah={lastWeek:"先週のeeeeのp",yesterday:"昨日のp",today:"今日のp",tomorrow:"明日のp",nextWeek:"翌週のeeeeのp",other:"P"},rh=(t,a,s,r)=>ah[t],nh={narrow:["BC","AC"],abbreviated:["紀元前","西暦"],wide:["紀元前","西暦"]},oh={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["第1四半期","第2四半期","第3四半期","第4四半期"]},ih={narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"]},lh={narrow:["日","月","火","水","木","金","土"],short:["日","月","火","水","木","金","土"],abbreviated:["日","月","火","水","木","金","土"],wide:["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日"]},ch={narrow:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"},abbreviated:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"},wide:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"}},dh={narrow:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"},abbreviated:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"},wide:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"}},uh=(t,a)=>{const s=Number(t);switch(String(a?.unit)){case"year":return`${s}年`;case"quarter":return`第${s}四半期`;case"month":return`${s}月`;case"week":return`第${s}週`;case"date":return`${s}日`;case"hour":return`${s}時`;case"minute":return`${s}分`;case"second":return`${s}秒`;default:return`${s}`}},mh={ordinalNumber:uh,era:fe({values:nh,defaultWidth:"wide"}),quarter:fe({values:oh,defaultWidth:"wide",argumentCallback:t=>Number(t)-1}),month:fe({values:ih,defaultWidth:"wide"}),day:fe({values:lh,defaultWidth:"wide"}),dayPeriod:fe({values:ch,defaultWidth:"wide",formattingValues:dh,defaultFormattingWidth:"wide"})},hh=/^第?\d+(年|四半期|月|週|日|時|分|秒)?/i,fh=/\d+/i,ph={narrow:/^(B\.?C\.?|A\.?D\.?)/i,abbreviated:/^(紀元[前後]|西暦)/i,wide:/^(紀元[前後]|西暦)/i},xh={narrow:[/^B/i,/^A/i],any:[/^(紀元前)/i,/^(西暦|紀元後)/i]},gh={narrow:/^[1234]/i,abbreviated:/^Q[1234]/i,wide:/^第[1234一二三四1234]四半期/i},bh={any:[/(1|一|1)/i,/(2|二|2)/i,/(3|三|3)/i,/(4|四|4)/i]},jh={narrow:/^([123456789]|1[012])/,abbreviated:/^([123456789]|1[012])月/i,wide:/^([123456789]|1[012])月/i},vh={any:[/^1\D/,/^2/,/^3/,/^4/,/^5/,/^6/,/^7/,/^8/,/^9/,/^10/,/^11/,/^12/]},wh={narrow:/^[日月火水木金土]/,short:/^[日月火水木金土]/,abbreviated:/^[日月火水木金土]/,wide:/^[日月火水木金土]曜日/},yh={any:[/^日/,/^月/,/^火/,/^水/,/^木/,/^金/,/^土/]},Nh={any:/^(AM|PM|午前|午後|正午|深夜|真夜中|夜|朝)/i},Ch={any:{am:/^(A|午前)/i,pm:/^(P|午後)/i,midnight:/^深夜|真夜中/i,noon:/^正午/i,morning:/^朝/i,afternoon:/^午後/i,evening:/^夜/i,night:/^深夜/i}},kh={ordinalNumber:ss({matchPattern:hh,parsePattern:fh,valueCallback:function(t){return parseInt(t,10)}}),era:pe({matchPatterns:ph,defaultMatchWidth:"wide",parsePatterns:xh,defaultParseWidth:"any"}),quarter:pe({matchPatterns:gh,defaultMatchWidth:"wide",parsePatterns:bh,defaultParseWidth:"any",valueCallback:t=>t+1}),month:pe({matchPatterns:jh,defaultMatchWidth:"wide",parsePatterns:vh,defaultParseWidth:"any"}),day:pe({matchPatterns:wh,defaultMatchWidth:"wide",parsePatterns:yh,defaultParseWidth:"any"}),dayPeriod:pe({matchPatterns:Nh,defaultMatchWidth:"any",parsePatterns:Ch,defaultParseWidth:"any"})},zo={code:"ja",formatDistance:Qm,formatLong:sh,formatRelative:rh,localize:mh,match:kh,options:{weekStartsOn:0,firstWeekContainsDate:1}},Sh={lessThanXSeconds:{one:"menos de um segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"meio minuto",lessThanXMinutes:{one:"menos de um minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"aproximadamente 1 hora",other:"aproximadamente {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 dia",other:"{{count}} dias"},aboutXWeeks:{one:"aproximadamente 1 semana",other:"aproximadamente {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"aproximadamente 1 mês",other:"aproximadamente {{count}} meses"},xMonths:{one:"1 mês",other:"{{count}} meses"},aboutXYears:{one:"aproximadamente 1 ano",other:"aproximadamente {{count}} anos"},xYears:{one:"1 ano",other:"{{count}} anos"},overXYears:{one:"mais de 1 ano",other:"mais de {{count}} anos"},almostXYears:{one:"quase 1 ano",other:"quase {{count}} anos"}},Dh=(t,a,s)=>{let r;const n=Sh[t];return typeof n=="string"?r=n:a===1?r=n.one:r=n.other.replace("{{count}}",String(a)),s?.addSuffix?s.comparison&&s.comparison>0?"daqui a "+r:"há "+r:r},Th={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d 'de' MMM 'de' y",short:"dd/MM/y"},Eh={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},Mh={full:"{{date}} 'às' {{time}}",long:"{{date}} 'às' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Ph={date:$e({formats:Th,defaultWidth:"full"}),time:$e({formats:Eh,defaultWidth:"full"}),dateTime:$e({formats:Mh,defaultWidth:"full"})},Ah={lastWeek:t=>{const a=t.getDay();return"'"+(a===0||a===6?"último":"última")+"' eeee 'às' p"},yesterday:"'ontem às' p",today:"'hoje às' p",tomorrow:"'amanhã às' p",nextWeek:"eeee 'às' p",other:"P"},Rh=(t,a,s,r)=>{const n=Ah[t];return typeof n=="function"?n(a):n},Fh={narrow:["aC","dC"],abbreviated:["a.C.","d.C."],wide:["antes de Cristo","depois de Cristo"]},$h={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},Lh={narrow:["j","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],wide:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"]},Ih={narrow:["d","s","t","q","q","s","s"],short:["dom","seg","ter","qua","qui","sex","sáb"],abbreviated:["dom","seg","ter","qua","qui","sex","sáb"],wide:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"]},Oh={narrow:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"noite",night:"madrugada"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"noite",night:"madrugada"},wide:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"noite",night:"madrugada"}},zh={narrow:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da noite",night:"da madrugada"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da noite",night:"da madrugada"},wide:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da noite",night:"da madrugada"}},_h=(t,a)=>Number(t)+"º",Vh={ordinalNumber:_h,era:fe({values:Fh,defaultWidth:"wide"}),quarter:fe({values:$h,defaultWidth:"wide",argumentCallback:t=>t-1}),month:fe({values:Lh,defaultWidth:"wide"}),day:fe({values:Ih,defaultWidth:"wide"}),dayPeriod:fe({values:Oh,defaultWidth:"wide",formattingValues:zh,defaultFormattingWidth:"wide"})},Wh=/^(\d+)(º|ª)?/i,Uh=/\d+/i,Bh={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,wide:/^(antes de cristo|antes da era comum|depois de cristo|era comum)/i},qh={any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes da era comum)/i,/^(depois de cristo|era comum)/i]},Hh={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º|ª)? trimestre/i},Gh={any:[/1/i,/2/i,/3/i,/4/i]},Xh={narrow:/^[jfmasond]/i,abbreviated:/^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,wide:/^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i},Yh={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ab/i,/^mai/i,/^jun/i,/^jul/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},Jh={narrow:/^[dstq]/i,short:/^(dom|seg|ter|qua|qui|sex|s[áa]b)/i,abbreviated:/^(dom|seg|ter|qua|qui|sex|s[áa]b)/i,wide:/^(domingo|segunda-?\s?feira|terça-?\s?feira|quarta-?\s?feira|quinta-?\s?feira|sexta-?\s?feira|s[áa]bado)/i},Kh={narrow:[/^d/i,/^s/i,/^t/i,/^q/i,/^q/i,/^s/i,/^s/i],any:[/^d/i,/^seg/i,/^t/i,/^qua/i,/^qui/i,/^sex/i,/^s[áa]/i]},Qh={narrow:/^(a|p|meia-?\s?noite|meio-?\s?dia|(da) (manh[ãa]|tarde|noite|madrugada))/i,any:/^([ap]\.?\s?m\.?|meia-?\s?noite|meio-?\s?dia|(da) (manh[ãa]|tarde|noite|madrugada))/i},Zh={any:{am:/^a/i,pm:/^p/i,midnight:/^meia/i,noon:/^meio/i,morning:/manh[ãa]/i,afternoon:/tarde/i,evening:/noite/i,night:/madrugada/i}},ef={ordinalNumber:ss({matchPattern:Wh,parsePattern:Uh,valueCallback:t=>parseInt(t,10)}),era:pe({matchPatterns:Bh,defaultMatchWidth:"wide",parsePatterns:qh,defaultParseWidth:"any"}),quarter:pe({matchPatterns:Hh,defaultMatchWidth:"wide",parsePatterns:Gh,defaultParseWidth:"any",valueCallback:t=>t+1}),month:pe({matchPatterns:Xh,defaultMatchWidth:"wide",parsePatterns:Yh,defaultParseWidth:"any"}),day:pe({matchPatterns:Jh,defaultMatchWidth:"wide",parsePatterns:Kh,defaultParseWidth:"any"}),dayPeriod:pe({matchPatterns:Qh,defaultMatchWidth:"any",parsePatterns:Zh,defaultParseWidth:"any"})},_o={code:"pt",formatDistance:Dh,formatLong:Ph,formatRelative:Rh,localize:Vh,match:ef,options:{weekStartsOn:1,firstWeekContainsDate:4}},tf={lessThanXSeconds:{one:"不到 1 秒",other:"不到 {{count}} 秒"},xSeconds:{one:"1 秒",other:"{{count}} 秒"},halfAMinute:"半分钟",lessThanXMinutes:{one:"不到 1 分钟",other:"不到 {{count}} 分钟"},xMinutes:{one:"1 分钟",other:"{{count}} 分钟"},xHours:{one:"1 小时",other:"{{count}} 小时"},aboutXHours:{one:"大约 1 小时",other:"大约 {{count}} 小时"},xDays:{one:"1 天",other:"{{count}} 天"},aboutXWeeks:{one:"大约 1 个星期",other:"大约 {{count}} 个星期"},xWeeks:{one:"1 个星期",other:"{{count}} 个星期"},aboutXMonths:{one:"大约 1 个月",other:"大约 {{count}} 个月"},xMonths:{one:"1 个月",other:"{{count}} 个月"},aboutXYears:{one:"大约 1 年",other:"大约 {{count}} 年"},xYears:{one:"1 年",other:"{{count}} 年"},overXYears:{one:"超过 1 年",other:"超过 {{count}} 年"},almostXYears:{one:"将近 1 年",other:"将近 {{count}} 年"}},sf=(t,a,s)=>{let r;const n=tf[t];return typeof n=="string"?r=n:a===1?r=n.one:r=n.other.replace("{{count}}",String(a)),s?.addSuffix?s.comparison&&s.comparison>0?r+"内":r+"前":r},af={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},rf={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},nf={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},of={date:$e({formats:af,defaultWidth:"full"}),time:$e({formats:rf,defaultWidth:"full"}),dateTime:$e({formats:nf,defaultWidth:"full"})};function Cn(t,a,s){const r="eeee p";return rr(t,a,s)?r:t.getTime()>a.getTime()?"'下个'"+r:"'上个'"+r}const lf={lastWeek:Cn,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:Cn,other:"PP p"},cf=(t,a,s,r)=>{const n=lf[t];return typeof n=="function"?n(a,s,r):n},df={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},uf={narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},mf={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},hf={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},ff={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},pf={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},xf=(t,a)=>{const s=Number(t);switch(a?.unit){case"date":return s.toString()+"日";case"hour":return s.toString()+"时";case"minute":return s.toString()+"分";case"second":return s.toString()+"秒";default:return"第 "+s.toString()}},gf={ordinalNumber:xf,era:fe({values:df,defaultWidth:"wide"}),quarter:fe({values:uf,defaultWidth:"wide",argumentCallback:t=>t-1}),month:fe({values:mf,defaultWidth:"wide"}),day:fe({values:hf,defaultWidth:"wide"}),dayPeriod:fe({values:ff,defaultWidth:"wide",formattingValues:pf,defaultFormattingWidth:"wide"})},bf=/^(第\s*)?\d+(日|时|分|秒)?/i,jf=/\d+/i,vf={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},wf={any:[/^(前)/i,/^(公元)/i]},yf={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},Nf={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},Cf={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},kf={narrow:[/^一/i,/^二/i,/^三/i,/^四/i,/^五/i,/^六/i,/^七/i,/^八/i,/^九/i,/^十(?!(一|二))/i,/^十一/i,/^十二/i],any:[/^一|1/i,/^二|2/i,/^三|3/i,/^四|4/i,/^五|5/i,/^六|6/i,/^七|7/i,/^八|8/i,/^九|9/i,/^十(?!(一|二))|10/i,/^十一|11/i,/^十二|12/i]},Sf={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},Df={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},Tf={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},Ef={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},Mf={ordinalNumber:ss({matchPattern:bf,parsePattern:jf,valueCallback:t=>parseInt(t,10)}),era:pe({matchPatterns:vf,defaultMatchWidth:"wide",parsePatterns:wf,defaultParseWidth:"any"}),quarter:pe({matchPatterns:yf,defaultMatchWidth:"wide",parsePatterns:Nf,defaultParseWidth:"any",valueCallback:t=>t+1}),month:pe({matchPatterns:Cf,defaultMatchWidth:"wide",parsePatterns:kf,defaultParseWidth:"any"}),day:pe({matchPatterns:Sf,defaultMatchWidth:"wide",parsePatterns:Df,defaultParseWidth:"any"}),dayPeriod:pe({matchPatterns:Tf,defaultMatchWidth:"any",parsePatterns:Ef,defaultParseWidth:"any"})},Vo={code:"zh-CN",formatDistance:sf,formatLong:of,formatRelative:cf,localize:gf,match:Mf,options:{weekStartsOn:1,firstWeekContainsDate:4}},Pf=(t=ps)=>[{label:"Aujourd'hui",value:()=>new Date},{label:"Hier",value:()=>_.subDays(new Date,1)},{label:"Demain",value:()=>_.addDays(new Date,1)},{label:"Cette semaine",range:()=>({from:_.startOfWeek(new Date,{locale:t}),to:_.endOfWeek(new Date,{locale:t})})},{label:"Semaine dernière",range:()=>({from:_.startOfWeek(_.subWeeks(new Date,1),{locale:t}),to:_.endOfWeek(_.subWeeks(new Date,1),{locale:t})})},{label:"Ce mois",range:()=>({from:_.startOfMonth(new Date),to:_.endOfMonth(new Date)})},{label:"Mois dernier",range:()=>({from:_.startOfMonth(_.subMonths(new Date,1)),to:_.endOfMonth(_.subMonths(new Date,1))})},{label:"Ce trimestre",range:()=>({from:_.startOfQuarter(new Date),to:_.endOfQuarter(new Date)})},{label:"Cette année",range:()=>({from:_.startOfYear(new Date),to:_.endOfYear(new Date)})}],Af=()=>[{label:"7 derniers jours",range:()=>({from:_.subDays(new Date,7),to:new Date})},{label:"30 derniers jours",range:()=>({from:_.subDays(new Date,30),to:new Date})},{label:"90 derniers jours",range:()=>({from:_.subDays(new Date,90),to:new Date})}],Rf=t=>t.map(a=>({label:`${a} prochains jours`,range:()=>({from:new Date,to:_.addDays(new Date,a)})})),Ff=(t,a)=>{if(typeof a=="function"){const s=a();return"from"in s&&s.from&&s.to?{label:t,range:()=>({from:s.from,to:s.to})}:{label:t,value:a}}return"from"in a&&a.from&&a.to?{label:t,range:{from:a.from,to:a.to}}:{label:t,value:a}},$f=t=>_.isAfter(t,_.endOfDay(new Date)),Wo=t=>_.isBefore(t,_.startOfDay(new Date)),Lf=t=>{const a=new Date;return t.getDate()===a.getDate()&&t.getMonth()===a.getMonth()&&t.getFullYear()===a.getFullYear()},br=t=>{const a=t.getDay();return a!==0&&a!==6},Uo=t=>{const a=t.getDay();return a===0||a===6},Bo=(t,a)=>a.some(s=>_.isEqual(_.startOfDay(s),_.startOfDay(t))),Lt=(t,a,s)=>_.isWithinInterval(t,{start:a,end:s}),If=t=>a=>{const s=_.subYears(new Date,t);return _.isAfter(a,s)?`L'âge minimum est de ${t} ans`:!0},Of=t=>a=>{const s=_.subYears(new Date,t);return _.isBefore(a,s)?`L'âge maximum est de ${t} ans`:!0},zf=t=>Wo(t)?"Cette date est expirée":!0,_f=(t,a)=>({days:_.differenceInDays(a,t),weeks:_.differenceInWeeks(a,t),months:_.differenceInMonths(a,t)}),Vf=(t,a="PPP",s=ps)=>t.from?t.to?`${_.format(t.from,a,{locale:s})} - ${_.format(t.to,a,{locale:s})}`:_.format(t.from,a,{locale:s}):"",Wf=t=>[new Date(t,0,1),new Date(t,4,1),new Date(t,4,8),new Date(t,6,14),new Date(t,7,15),new Date(t,10,1),new Date(t,10,11),new Date(t,11,25)],jr=(t,a)=>{const s=[],r=_.startOfMonth(new Date(t,a)),n=_.endOfMonth(new Date(t,a));let o=r;for(;_.isBefore(o,n)||_.isEqual(o,n);)s.push(o),o=_.addDays(o,1);return s},Uf=(t,a)=>jr(t,a).filter(Uo),Bf=(t,a)=>jr(t,a).filter(br),qf=()=>t=>{const a=new Date,s=_.endOfMonth(t);if(_.isBefore(s,a))return"La carte est expirée";const r=_.addMonths(a,3);return _.isBefore(s,r)?"La carte expire bientôt":!0},Hf=t=>a=>{const s=_.addDays(new Date,t);return _.isBefore(a,s)?`La réservation doit être faite ${t} jours à l'avance minimum`:!0},Gf=t=>a=>!a.from||!a.to?!0:_.differenceInDays(a.to,a.from)>t?`La période ne peut pas dépasser ${t} jours`:!0,Xf=(t,a)=>_.isEqual(_.startOfDay(t),_.startOfDay(a)),Yf=(t,a,s=[])=>{let r=0,n=_.startOfDay(t);const o=_.startOfDay(a);for(;_.isBefore(n,o)||_.isEqual(n,o);)br(n)&&!Bo(n,s)&&r++,n=_.addDays(n,1);return r},Jf=t=>{const a=t||new Date().getFullYear();return[1,2,3,4].map(s=>{const r=_.startOfQuarter(new Date(a,(s-1)*3,1)),n=_.endOfQuarter(r);return{label:`T${s} ${a}`,range:()=>({from:r,to:n})}})},Kf=(t,a=ps)=>{const s=t||new Date().getFullYear();return Array.from({length:12},(r,n)=>{const o=_.startOfMonth(new Date(s,n,1)),i=_.endOfMonth(o);return{label:_.format(o,"MMMM yyyy",{locale:a}),range:()=>({from:o,to:i})}})},Qf=t=>t.getTime(),Zf=t=>new Date(t),ep=t=>_.startOfDay(t),tp=(t,a)=>!t.from||!t.to||!a.from||!a.to?!1:_.isEqual(_.startOfDay(t.from),_.startOfDay(a.from))&&_.isEqual(_.startOfDay(t.to),_.startOfDay(a.to)),sp=(t,a)=>!t.from||!t.to||!a.from||!a.to||!(Lt(t.from,a.from,a.to)||Lt(t.to,a.from,a.to)||Lt(a.from,t.from,t.to)||Lt(a.to,t.from,t.to))?null:{from:_.isBefore(t.from,a.from)?t.from:a.from,to:_.isAfter(t.to,a.to)?t.to:a.to},ap=(t,a)=>!t.from||!t.to||!a.from||!a.to?!1:Lt(t.from,a.from,a.to)||Lt(t.to,a.from,a.to)||Lt(a.from,t.from,t.to)||Lt(a.to,t.from,t.to);class vr{constructor(a){this.loadedThemes=new Set,this.styleElements=new Map,this.config={baseUrl:a.baseUrl,cache:a.cache??!0,timeout:a.timeout??1e4,onError:a.onError??(s=>console.error("Theme loading error:",s)),onSuccess:a.onSuccess??(()=>{})}}async loadTheme(a){if(this.config.cache&&this.loadedThemes.has(a)){console.log(`Theme "${a}" already loaded from cache`),this.applyTheme(a);return}try{const s=new AbortController,r=setTimeout(()=>s.abort(),this.config.timeout),n=this.buildThemeUrl(a);console.log(`Loading theme from: ${n}`);const o=await fetch(n,{signal:s.signal,headers:{Accept:"text/css"}});if(clearTimeout(r),!o.ok)throw new Error(`Failed to load theme: ${o.status} ${o.statusText}`);const i=await o.text();if(!i.includes(`[data-theme="${a}"]`))throw new Error(`Invalid theme CSS: missing [data-theme="${a}"] selector`);this.injectThemeStyles(a,i),this.loadedThemes.add(a),this.applyTheme(a),this.config.onSuccess(a)}catch(s){const r=s instanceof Error?s:new Error(String(s));throw this.config.onError(r,a),r}}applyTheme(a){if(typeof document>"u")return;document.documentElement.setAttribute("data-theme",a);try{localStorage.setItem("theme",a)}catch(r){console.warn("Could not save theme to localStorage:",r)}console.log(`Applied theme: ${a}`)}getCurrentTheme(){return typeof document>"u"?null:document.documentElement.getAttribute("data-theme")}loadSavedTheme(){if(typeof window>"u")return null;try{return localStorage.getItem("theme")}catch(a){return console.warn("Could not load theme from localStorage:",a),null}}async preloadThemes(a){console.log(`Preloading ${a.length} themes...`),await Promise.allSettled(a.map(s=>this.loadTheme(s))),console.log(`Preloaded ${this.loadedThemes.size} themes`)}unloadTheme(a){const s=this.styleElements.get(a);s&&(s.remove(),this.styleElements.delete(a)),this.loadedThemes.delete(a),console.log(`Unloaded theme: ${a}`)}clearCache(){this.styleElements.forEach(a=>a.remove()),this.styleElements.clear(),this.loadedThemes.clear(),console.log("Theme cache cleared")}getLoadedThemes(){return Array.from(this.loadedThemes)}buildThemeUrl(a){return`${this.config.baseUrl.replace(/\/$/,"")}/${a}.css`}injectThemeStyles(a,s){if(typeof document>"u")return;const r=this.styleElements.get(a);r&&r.remove();const n=document.createElement("style");n.setAttribute("data-theme-name",a),n.textContent=s,document.head.appendChild(n),this.styleElements.set(a,n)}}let Hs=null;function rp(t){return Hs=new vr(t),Hs}function wr(){if(!Hs)throw new Error("ThemeLoader not initialized. Call initThemeLoader() first.");return Hs}async function np(t){return wr().loadTheme(t)}function op(t){wr().applyTheme(t)}function ip(t){if(typeof window>"u")return{loadTheme:async()=>{},applyTheme:()=>{},currentTheme:null,loadedThemes:[],isLoading:!1};const a=Hs||new vr({baseUrl:t?.baseUrl||"/themes",...t}),[s,r]=l.useState(!1),[n,o]=l.useState(a.getCurrentTheme());return{loadTheme:async m=>{r(!0);try{await a.loadTheme(m),o(m)}finally{r(!1)}},applyTheme:m=>{a.applyTheme(m),o(m)},currentTheme:n,loadedThemes:a.getLoadedThemes(),isLoading:s}}var kn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function lp(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var _a={exports:{}},Sn;function cp(){return Sn||(Sn=1,(function(t){var a=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};var s=(function(r){var n=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,o=0,i={},c={manual:r.Prism&&r.Prism.manual,disableWorkerMessageHandler:r.Prism&&r.Prism.disableWorkerMessageHandler,util:{encode:function p(j){return j instanceof m?new m(j.type,p(j.content),j.alias):Array.isArray(j)?j.map(p):j.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(p){return Object.prototype.toString.call(p).slice(8,-1)},objId:function(p){return p.__id||Object.defineProperty(p,"__id",{value:++o}),p.__id},clone:function p(j,C){C=C||{};var N,S;switch(c.util.type(j)){case"Object":if(S=c.util.objId(j),C[S])return C[S];N={},C[S]=N;for(var A in j)j.hasOwnProperty(A)&&(N[A]=p(j[A],C));return N;case"Array":return S=c.util.objId(j),C[S]?C[S]:(N=[],C[S]=N,j.forEach(function(R,E){N[E]=p(R,C)}),N);default:return j}},getLanguage:function(p){for(;p;){var j=n.exec(p.className);if(j)return j[1].toLowerCase();p=p.parentElement}return"none"},setLanguage:function(p,j){p.className=p.className.replace(RegExp(n,"gi"),""),p.classList.add("language-"+j)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(N){var p=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(N.stack)||[])[1];if(p){var j=document.getElementsByTagName("script");for(var C in j)if(j[C].src==p)return j[C]}return null}},isActive:function(p,j,C){for(var N="no-"+j;p;){var S=p.classList;if(S.contains(j))return!0;if(S.contains(N))return!1;p=p.parentElement}return!!C}},languages:{plain:i,plaintext:i,text:i,txt:i,extend:function(p,j){var C=c.util.clone(c.languages[p]);for(var N in j)C[N]=j[N];return C},insertBefore:function(p,j,C,N){N=N||c.languages;var S=N[p],A={};for(var R in S)if(S.hasOwnProperty(R)){if(R==j)for(var E in C)C.hasOwnProperty(E)&&(A[E]=C[E]);C.hasOwnProperty(R)||(A[R]=S[R])}var D=N[p];return N[p]=A,c.languages.DFS(c.languages,function(M,P){P===D&&M!=p&&(this[M]=A)}),A},DFS:function p(j,C,N,S){S=S||{};var A=c.util.objId;for(var R in j)if(j.hasOwnProperty(R)){C.call(j,R,j[R],N||R);var E=j[R],D=c.util.type(E);D==="Object"&&!S[A(E)]?(S[A(E)]=!0,p(E,C,null,S)):D==="Array"&&!S[A(E)]&&(S[A(E)]=!0,p(E,C,R,S))}}},plugins:{},highlightAll:function(p,j){c.highlightAllUnder(document,p,j)},highlightAllUnder:function(p,j,C){var N={callback:C,container:p,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};c.hooks.run("before-highlightall",N),N.elements=Array.prototype.slice.apply(N.container.querySelectorAll(N.selector)),c.hooks.run("before-all-elements-highlight",N);for(var S=0,A;A=N.elements[S++];)c.highlightElement(A,j===!0,N.callback)},highlightElement:function(p,j,C){var N=c.util.getLanguage(p),S=c.languages[N];c.util.setLanguage(p,N);var A=p.parentElement;A&&A.nodeName.toLowerCase()==="pre"&&c.util.setLanguage(A,N);var R=p.textContent,E={element:p,language:N,grammar:S,code:R};function D(P){E.highlightedCode=P,c.hooks.run("before-insert",E),E.element.innerHTML=E.highlightedCode,c.hooks.run("after-highlight",E),c.hooks.run("complete",E),C&&C.call(E.element)}if(c.hooks.run("before-sanity-check",E),A=E.element.parentElement,A&&A.nodeName.toLowerCase()==="pre"&&!A.hasAttribute("tabindex")&&A.setAttribute("tabindex","0"),!E.code){c.hooks.run("complete",E),C&&C.call(E.element);return}if(c.hooks.run("before-highlight",E),!E.grammar){D(c.util.encode(E.code));return}if(j&&r.Worker){var M=new Worker(c.filename);M.onmessage=function(P){D(P.data)},M.postMessage(JSON.stringify({language:E.language,code:E.code,immediateClose:!0}))}else D(c.highlight(E.code,E.grammar,E.language))},highlight:function(p,j,C){var N={code:p,grammar:j,language:C};if(c.hooks.run("before-tokenize",N),!N.grammar)throw new Error('The language "'+N.language+'" has no grammar.');return N.tokens=c.tokenize(N.code,N.grammar),c.hooks.run("after-tokenize",N),m.stringify(c.util.encode(N.tokens),N.language)},tokenize:function(p,j){var C=j.rest;if(C){for(var N in C)j[N]=C[N];delete j.rest}var S=new u;return f(S,S.head,p),x(p,S,j,S.head,0),k(S)},hooks:{all:{},add:function(p,j){var C=c.hooks.all;C[p]=C[p]||[],C[p].push(j)},run:function(p,j){var C=c.hooks.all[p];if(!(!C||!C.length))for(var N=0,S;S=C[N++];)S(j)}},Token:m};r.Prism=c;function m(p,j,C,N){this.type=p,this.content=j,this.alias=C,this.length=(N||"").length|0}m.stringify=function p(j,C){if(typeof j=="string")return j;if(Array.isArray(j)){var N="";return j.forEach(function(D){N+=p(D,C)}),N}var S={type:j.type,content:p(j.content,C),tag:"span",classes:["token",j.type],attributes:{},language:C},A=j.alias;A&&(Array.isArray(A)?Array.prototype.push.apply(S.classes,A):S.classes.push(A)),c.hooks.run("wrap",S);var R="";for(var E in S.attributes)R+=" "+E+'="'+(S.attributes[E]||"").replace(/"/g,""")+'"';return"<"+S.tag+' class="'+S.classes.join(" ")+'"'+R+">"+S.content+"</"+S.tag+">"};function d(p,j,C,N){p.lastIndex=j;var S=p.exec(C);if(S&&N&&S[1]){var A=S[1].length;S.index+=A,S[0]=S[0].slice(A)}return S}function x(p,j,C,N,S,A){for(var R in C)if(!(!C.hasOwnProperty(R)||!C[R])){var E=C[R];E=Array.isArray(E)?E:[E];for(var D=0;D<E.length;++D){if(A&&A.cause==R+","+D)return;var M=E[D],P=M.inside,T=!!M.lookbehind,q=!!M.greedy,H=M.alias;if(q&&!M.pattern.global){var Y=M.pattern.toString().match(/[imsuy]*$/)[0];M.pattern=RegExp(M.pattern.source,Y+"g")}for(var U=M.pattern||M,z=N.next,V=S;z!==j.tail&&!(A&&V>=A.reach);V+=z.value.length,z=z.next){var L=z.value;if(j.length>p.length)return;if(!(L instanceof m)){var W=1,F;if(q){if(F=d(U,V,p,T),!F||F.index>=p.length)break;var le=F.index,G=F.index+F[0].length,ee=V;for(ee+=z.value.length;le>=ee;)z=z.next,ee+=z.value.length;if(ee-=z.value.length,V=ee,z.value instanceof m)continue;for(var se=z;se!==j.tail&&(ee<G||typeof se.value=="string");se=se.next)W++,ee+=se.value.length;W--,L=p.slice(V,ee),F.index-=V}else if(F=d(U,0,L,T),!F)continue;var le=F.index,X=F[0],K=L.slice(0,le),I=L.slice(le+X.length),te=V+L.length;A&&te>A.reach&&(A.reach=te);var Z=z.prev;K&&(Z=f(j,Z,K),V+=K.length),w(j,Z,W);var J=new m(R,P?c.tokenize(X,P):X,H,X);if(z=f(j,Z,J),I&&f(j,z,I),W>1){var ne={cause:R+","+D,reach:te};x(p,j,C,z.prev,V,ne),A&&ne.reach>A.reach&&(A.reach=ne.reach)}}}}}}function u(){var p={value:null,prev:null,next:null},j={value:null,prev:p,next:null};p.next=j,this.head=p,this.tail=j,this.length=0}function f(p,j,C){var N=j.next,S={value:C,prev:j,next:N};return j.next=S,N.prev=S,p.length++,S}function w(p,j,C){for(var N=j.next,S=0;S<C&&N!==p.tail;S++)N=N.next;j.next=N,N.prev=j,p.length-=S}function k(p){for(var j=[],C=p.head.next;C!==p.tail;)j.push(C.value),C=C.next;return j}if(!r.document)return r.addEventListener&&(c.disableWorkerMessageHandler||r.addEventListener("message",function(p){var j=JSON.parse(p.data),C=j.language,N=j.code,S=j.immediateClose;r.postMessage(c.highlight(N,c.languages[C],C)),S&&r.close()},!1)),c;var b=c.util.currentScript();b&&(c.filename=b.src,b.hasAttribute("data-manual")&&(c.manual=!0));function y(){c.manual||c.highlightAll()}if(!c.manual){var v=document.readyState;v==="loading"||v==="interactive"&&b&&b.defer?document.addEventListener("DOMContentLoaded",y):window.requestAnimationFrame?window.requestAnimationFrame(y):window.setTimeout(y,16)}return c})(a);t.exports&&(t.exports=s),typeof kn<"u"&&(kn.Prism=s),s.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},s.languages.markup.tag.inside["attr-value"].inside.entity=s.languages.markup.entity,s.languages.markup.doctype.inside["internal-subset"].inside=s.languages.markup,s.hooks.add("wrap",function(r){r.type==="entity"&&(r.attributes.title=r.content.replace(/&/,"&"))}),Object.defineProperty(s.languages.markup.tag,"addInlined",{value:function(n,o){var i={};i["language-"+o]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:s.languages[o]},i.cdata=/^<!\[CDATA\[|\]\]>$/i;var c={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:i}};c["language-"+o]={pattern:/[\s\S]+/,inside:s.languages[o]};var m={};m[n]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return n}),"i"),lookbehind:!0,greedy:!0,inside:c},s.languages.insertBefore("markup","cdata",m)}}),Object.defineProperty(s.languages.markup.tag,"addAttribute",{value:function(r,n){s.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+r+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,"language-"+n],inside:s.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),s.languages.html=s.languages.markup,s.languages.mathml=s.languages.markup,s.languages.svg=s.languages.markup,s.languages.xml=s.languages.extend("markup",{}),s.languages.ssml=s.languages.xml,s.languages.atom=s.languages.xml,s.languages.rss=s.languages.xml,(function(r){var n=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;r.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+n.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+n.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+n.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+n.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:n,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},r.languages.css.atrule.inside.rest=r.languages.css;var o=r.languages.markup;o&&(o.tag.addInlined("style","css"),o.tag.addAttribute("style","css"))})(s),s.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},s.languages.javascript=s.languages.extend("clike",{"class-name":[s.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),s.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,s.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:s.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:s.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:s.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:s.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:s.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),s.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:s.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),s.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),s.languages.markup&&(s.languages.markup.tag.addInlined("script","javascript"),s.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),s.languages.js=s.languages.javascript,(function(){if(typeof s>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var r="Loading…",n=function(b,y){return"✖ Error "+b+" while fetching file: "+y},o="✖ Error: File does not exist or is empty",i={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},c="data-src-status",m="loading",d="loaded",x="failed",u="pre[data-src]:not(["+c+'="'+d+'"]):not(['+c+'="'+m+'"])';function f(b,y,v){var p=new XMLHttpRequest;p.open("GET",b,!0),p.onreadystatechange=function(){p.readyState==4&&(p.status<400&&p.responseText?y(p.responseText):p.status>=400?v(n(p.status,p.statusText)):v(o))},p.send(null)}function w(b){var y=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(b||"");if(y){var v=Number(y[1]),p=y[2],j=y[3];return p?j?[v,Number(j)]:[v,void 0]:[v,v]}}s.hooks.add("before-highlightall",function(b){b.selector+=", "+u}),s.hooks.add("before-sanity-check",function(b){var y=b.element;if(y.matches(u)){b.code="",y.setAttribute(c,m);var v=y.appendChild(document.createElement("CODE"));v.textContent=r;var p=y.getAttribute("data-src"),j=b.language;if(j==="none"){var C=(/\.(\w+)$/.exec(p)||[,"none"])[1];j=i[C]||C}s.util.setLanguage(v,j),s.util.setLanguage(y,j);var N=s.plugins.autoloader;N&&N.loadLanguages(j),f(p,function(S){y.setAttribute(c,d);var A=w(y.getAttribute("data-range"));if(A){var R=S.split(/\r\n?|\n/g),E=A[0],D=A[1]==null?R.length:A[1];E<0&&(E+=R.length),E=Math.max(0,Math.min(E-1,R.length)),D<0&&(D+=R.length),D=Math.max(0,Math.min(D,R.length)),S=R.slice(E,D).join(`
|
|
2
|
+
`),y.hasAttribute("data-start")||y.setAttribute("data-start",String(E+1))}v.textContent=S,s.highlightElement(v)},function(S){y.setAttribute(c,x),v.textContent=S})}}),s.plugins.fileHighlight={highlight:function(y){for(var v=(y||document).querySelectorAll(u),p=0,j;j=v[p++];)s.highlightElement(j)}};var k=!1;s.fileHighlight=function(){k||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),k=!0),s.plugins.fileHighlight.highlight.apply(this,arguments)}})()})(_a)),_a.exports}var dp=cp();const Va=lp(dp);var Dn={},Tn;function up(){return Tn||(Tn=1,(function(t){t.languages.typescript=t.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),t.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete t.languages.typescript.parameter,delete t.languages.typescript["literal-property"];var a=t.languages.extend("typescript",{});delete a["class-name"],t.languages.typescript["class-name"].inside=a,t.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:a}}}}),t.languages.ts=t.languages.typescript})(Prism)),Dn}up();Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/});Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}});Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}});Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript"));Prism.languages.js=Prism.languages.javascript;(function(t){var a=t.util.clone(t.languages.javascript),s=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,r=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,n=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function o(m,d){return m=m.replace(/<S>/g,function(){return s}).replace(/<BRACES>/g,function(){return r}).replace(/<SPREAD>/g,function(){return n}),RegExp(m,d)}n=o(n).source,t.languages.jsx=t.languages.extend("markup",a),t.languages.jsx.tag.pattern=o(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),t.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,t.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,t.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,t.languages.jsx.tag.inside.comment=a.comment,t.languages.insertBefore("inside","attr-name",{spread:{pattern:o(/<SPREAD>/.source),inside:t.languages.jsx}},t.languages.jsx.tag),t.languages.insertBefore("inside","special-attr",{script:{pattern:o(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:t.languages.jsx}}},t.languages.jsx.tag);var i=function(m){return m?typeof m=="string"?m:typeof m.content=="string"?m.content:m.content.map(i).join(""):""},c=function(m){for(var d=[],x=0;x<m.length;x++){var u=m[x],f=!1;if(typeof u!="string"&&(u.type==="tag"&&u.content[0]&&u.content[0].type==="tag"?u.content[0].content[0].content==="</"?d.length>0&&d[d.length-1].tagName===i(u.content[0].content[1])&&d.pop():u.content[u.content.length-1].content==="/>"||d.push({tagName:i(u.content[0].content[1]),openedBraces:0}):d.length>0&&u.type==="punctuation"&&u.content==="{"?d[d.length-1].openedBraces++:d.length>0&&d[d.length-1].openedBraces>0&&u.type==="punctuation"&&u.content==="}"?d[d.length-1].openedBraces--:f=!0),(f||typeof u=="string")&&d.length>0&&d[d.length-1].openedBraces===0){var w=i(u);x<m.length-1&&(typeof m[x+1]=="string"||m[x+1].type==="plain-text")&&(w+=i(m[x+1]),m.splice(x+1,1)),x>0&&(typeof m[x-1]=="string"||m[x-1].type==="plain-text")&&(w=i(m[x-1])+w,m.splice(x-1,1),x--),m[x]=new t.Token("plain-text",w,null,w)}u.content&&typeof u.content!="string"&&c(u.content)}};t.hooks.add("after-tokenize",function(m){m.language!=="jsx"&&m.language!=="tsx"||c(m.tokens)})})(Prism);(function(t){var a=t.util.clone(t.languages.typescript);t.languages.tsx=t.languages.extend("jsx",a),delete t.languages.tsx.parameter,delete t.languages.tsx["literal-property"];var s=t.languages.tsx.tag;s.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+s.pattern.source+")",s.pattern.flags),s.lookbehind=!0})(Prism);(function(t){var a=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+a.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+a.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+a.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+a.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:a,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var s=t.languages.markup;s&&(s.tag.addInlined("style","css"),s.tag.addAttribute("style","css"))})(Prism);var En={},Mn;function mp(){return Mn||(Mn=1,Prism.languages.scss=Prism.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),Prism.languages.insertBefore("scss","atrule",{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),Prism.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),Prism.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),Prism.languages.scss.atrule.inside.rest=Prism.languages.scss),En}mp();Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}};Prism.languages.webmanifest=Prism.languages.json;(function(t){var a="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",s={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},r={bash:s,environment:{pattern:RegExp("\\$"+a),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+a),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};t.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+a),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:s}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp("\\$?"+a),alias:"constant"},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},s.inside=t.languages.bash;for(var n=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],o=r.variable[1].inside,i=0;i<n.length;i++)o[n[i]]=t.languages.bash[n[i]];t.languages.sh=t.languages.bash,t.languages.shell=t.languages.bash})(Prism);var Pn={},An;function hp(){return An||(An=1,Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python),Pn}hp();var Rn={},Fn;function fp(){return Fn||(Fn=1,(function(t){var a=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,s=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+s+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};t.languages.java=t.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+s+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+s+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:a,function:[t.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),t.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),t.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:a,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+s+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+s+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return a.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(Prism)),Rn}fp();var $n={},Ln;function pp(){return Ln||(Ln=1,(function(t){function a(V,L){return V.replace(/<<(\d+)>>/g,function(W,F){return"(?:"+L[+F]+")"})}function s(V,L,W){return RegExp(a(V,L),"")}function r(V,L){for(var W=0;W<L;W++)V=V.replace(/<<self>>/g,function(){return"(?:"+V+")"});return V.replace(/<<self>>/g,"[^\\s\\S]")}var n={type:"bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",typeDeclaration:"class enum interface record struct",contextual:"add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",other:"abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield"};function o(V){return"\\b(?:"+V.trim().replace(/ /g,"|")+")\\b"}var i=o(n.typeDeclaration),c=RegExp(o(n.type+" "+n.typeDeclaration+" "+n.contextual+" "+n.other)),m=o(n.typeDeclaration+" "+n.contextual+" "+n.other),d=o(n.type+" "+n.typeDeclaration+" "+n.other),x=r(/<(?:[^<>;=+\-*/%&|^]|<<self>>)*>/.source,2),u=r(/\((?:[^()]|<<self>>)*\)/.source,2),f=/@?\b[A-Za-z_]\w*\b/.source,w=a(/<<0>>(?:\s*<<1>>)?/.source,[f,x]),k=a(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[m,w]),b=/\[\s*(?:,\s*)*\]/.source,y=a(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[k,b]),v=a(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[x,u,b]),p=a(/\(<<0>>+(?:,<<0>>+)+\)/.source,[v]),j=a(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[p,k,b]),C={keyword:c,punctuation:/[<>()?,.:[\]]/},N=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,S=/"(?:\\.|[^\\"\r\n])*"/.source,A=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;t.languages.csharp=t.languages.extend("clike",{string:[{pattern:s(/(^|[^$\\])<<0>>/.source,[A]),lookbehind:!0,greedy:!0},{pattern:s(/(^|[^@$\\])<<0>>/.source,[S]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:s(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[k]),lookbehind:!0,inside:C},{pattern:s(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[f,j]),lookbehind:!0,inside:C},{pattern:s(/(\busing\s+)<<0>>(?=\s*=)/.source,[f]),lookbehind:!0},{pattern:s(/(\b<<0>>\s+)<<1>>/.source,[i,w]),lookbehind:!0,inside:C},{pattern:s(/(\bcatch\s*\(\s*)<<0>>/.source,[k]),lookbehind:!0,inside:C},{pattern:s(/(\bwhere\s+)<<0>>/.source,[f]),lookbehind:!0},{pattern:s(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[y]),lookbehind:!0,inside:C},{pattern:s(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[j,d,f]),inside:C}],keyword:c,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),t.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),t.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:s(/([(,]\s*)<<0>>(?=\s*:)/.source,[f]),lookbehind:!0,alias:"punctuation"}}),t.languages.insertBefore("csharp","class-name",{namespace:{pattern:s(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[f]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:s(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[u]),lookbehind:!0,alias:"class-name",inside:C},"return-type":{pattern:s(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[j,k]),inside:C,alias:"class-name"},"constructor-invocation":{pattern:s(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[j]),lookbehind:!0,inside:C,alias:"class-name"},"generic-method":{pattern:s(/<<0>>\s*<<1>>(?=\s*\()/.source,[f,x]),inside:{function:s(/^<<0>>/.source,[f]),generic:{pattern:RegExp(x),alias:"class-name",inside:C}}},"type-list":{pattern:s(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[i,w,f,j,c.source,u,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:s(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[w,u]),lookbehind:!0,greedy:!0,inside:t.languages.csharp},keyword:c,"class-name":{pattern:RegExp(j),greedy:!0,inside:C},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var R=S+"|"+N,E=a(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[R]),D=r(a(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[E]),2),M=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,P=a(/<<0>>(?:\s*\(<<1>>*\))?/.source,[k,D]);t.languages.insertBefore("csharp","class-name",{attribute:{pattern:s(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[M,P]),lookbehind:!0,greedy:!0,inside:{target:{pattern:s(/^<<0>>(?=\s*:)/.source,[M]),alias:"keyword"},"attribute-arguments":{pattern:s(/\(<<0>>*\)/.source,[D]),inside:t.languages.csharp},"class-name":{pattern:RegExp(k),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var T=/:[^}\r\n]+/.source,q=r(a(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[E]),2),H=a(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[q,T]),Y=r(a(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<<self>>*\)/.source,[R]),2),U=a(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[Y,T]);function z(V,L){return{interpolation:{pattern:s(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[V]),lookbehind:!0,inside:{"format-string":{pattern:s(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[L,T]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:t.languages.csharp}}},string:/[\s\S]+/}}t.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:s(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[H]),lookbehind:!0,greedy:!0,inside:z(H,q)},{pattern:s(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[U]),lookbehind:!0,greedy:!0,inside:z(U,Y)}],char:{pattern:RegExp(N),greedy:!0}}),t.languages.dotnet=t.languages.cs=t.languages.csharp})(Prism)),$n}pp();var In={},On;function xp(){return On||(On=1,(function(t){var a=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,s=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],r=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,n=/<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,o=/[{}\[\](),:;]/;t.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:a,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:s,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:r,operator:n,punctuation:o};var i={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:t.languages.php},c=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:i}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:i}}];t.languages.insertBefore("php","variable",{string:c,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:a,string:c,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:s,number:r,operator:n,punctuation:o}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),t.hooks.add("before-tokenize",function(m){if(/<\?/.test(m.code)){var d=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;t.languages["markup-templating"].buildPlaceholders(m,"php",d)}}),t.hooks.add("after-tokenize",function(m){t.languages["markup-templating"].tokenizePlaceholders(m,"php")})})(Prism)),In}xp();var zn={},_n;function gp(){return _n||(_n=1,(function(t){t.languages.ruby=t.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),t.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var a={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:t.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete t.languages.ruby.function;var s="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",r=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;t.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+s+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:a,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:a,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+r),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+r+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),t.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+s),greedy:!0,inside:{interpolation:a,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:a,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:a,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+s),greedy:!0,inside:{interpolation:a,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:a,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete t.languages.ruby.string,t.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),t.languages.rb=t.languages.ruby})(Prism)),zn}gp();Prism.languages.go=Prism.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/});Prism.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}});delete Prism.languages.go["class-name"];var Vn={},Wn;function bp(){return Wn||(Wn=1,(function(t){for(var a=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,s=0;s<2;s++)a=a.replace(/<self>/g,function(){return a});a=a.replace(/<self>/g,function(){return/[^\s\S]/.source}),t.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+a),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},t.languages.rust["closure-params"].inside.rest=t.languages.rust,t.languages.rust.attribute.inside.string=t.languages.rust.string})(Prism)),Vn}bp();Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/};(function(t){var a=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function s(x){return x=x.replace(/<inner>/g,function(){return a}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+x+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,n=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),o=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;t.languages.markdown=t.languages.extend("markup",{}),t.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:t.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+n+o+"(?:"+n+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+n+o+")(?:"+n+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:t.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+n+")"+o+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+n+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:t.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:s(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:s(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:s(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:s(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(x){["url","bold","italic","strike","code-snippet"].forEach(function(u){x!==u&&(t.languages.markdown[x].inside.content.inside[u]=t.languages.markdown[u])})}),t.hooks.add("after-tokenize",function(x){if(x.language!=="markdown"&&x.language!=="md")return;function u(f){if(!(!f||typeof f=="string"))for(var w=0,k=f.length;w<k;w++){var b=f[w];if(b.type!=="code"){u(b.content);continue}var y=b.content[1],v=b.content[3];if(y&&v&&y.type==="code-language"&&v.type==="code-block"&&typeof y.content=="string"){var p=y.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");p=(/[a-z][\w-]*/i.exec(p)||[""])[0].toLowerCase();var j="language-"+p;v.alias?typeof v.alias=="string"?v.alias=[v.alias,j]:v.alias.push(j):v.alias=[j]}}}u(x.tokens)}),t.hooks.add("wrap",function(x){if(x.type==="code-block"){for(var u="",f=0,w=x.classes.length;f<w;f++){var k=x.classes[f],b=/language-(.+)/.exec(k);if(b){u=b[1];break}}var y=t.languages[u];if(y)x.content=t.highlight(d(x.content),y,u);else if(u&&u!=="none"&&t.plugins.autoloader){var v="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);x.attributes.id=v,t.plugins.autoloader.loadLanguages(u,function(){var p=document.getElementById(v);p&&(p.innerHTML=t.highlight(p.textContent,t.languages[u],u))})}}});var i=RegExp(t.languages.markup.tag.pattern.source,"gi"),c={amp:"&",lt:"<",gt:">",quot:'"'},m=String.fromCodePoint||String.fromCharCode;function d(x){var u=x.replace(i,"");return u=u.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(f,w){if(w=w.toLowerCase(),w[0]==="#"){var k;return w[1]==="x"?k=parseInt(w.slice(2),16):k=Number(w.slice(1)),m(k)}else{var b=c[w];return b||f}}),u}t.languages.md=t.languages.markdown})(Prism);(function(t){var a=/[*&][^\s[\]{},]+/,s=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+s.source+"(?:[ ]+"+a.source+")?|"+a.source+"(?:[ ]+"+s.source+")?)",n=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),o=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function i(c,m){m=(m||"").replace(/m/g,"")+"m";var d=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return c});return RegExp(d,m)}t.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return r})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<key>>/g,function(){return"(?:"+n+"|"+o+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:i(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:i(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:i(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:i(o),lookbehind:!0,greedy:!0},number:{pattern:i(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:s,important:a,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},t.languages.yml=t.languages.yaml})(Prism);(function(t){var a=/\\[\r\n](?:\s|\\[\r\n]|#.*(?!.))*(?![\s#]|\\[\r\n])/.source,s=/(?:[ \t]+(?![ \t])(?:<SP_BS>)?|<SP_BS>)/.source.replace(/<SP_BS>/g,function(){return a}),r=/"(?:[^"\\\r\n]|\\(?:\r\n|[\s\S]))*"|'(?:[^'\\\r\n]|\\(?:\r\n|[\s\S]))*'/.source,n=/--[\w-]+=(?:<STR>|(?!["'])(?:[^\s\\]|\\.)+)/.source.replace(/<STR>/g,function(){return r}),o={pattern:RegExp(r),greedy:!0},i={pattern:/(^[ \t]*)#.*/m,lookbehind:!0,greedy:!0};function c(m,d){return m=m.replace(/<OPT>/g,function(){return n}).replace(/<SP>/g,function(){return s}),RegExp(m,d)}t.languages.docker={instruction:{pattern:/(^[ \t]*)(?:ADD|ARG|CMD|COPY|ENTRYPOINT|ENV|EXPOSE|FROM|HEALTHCHECK|LABEL|MAINTAINER|ONBUILD|RUN|SHELL|STOPSIGNAL|USER|VOLUME|WORKDIR)(?=\s)(?:\\.|[^\r\n\\])*(?:\\$(?:\s|#.*$)*(?![\s#])(?:\\.|[^\r\n\\])*)*/im,lookbehind:!0,greedy:!0,inside:{options:{pattern:c(/(^(?:ONBUILD<SP>)?\w+<SP>)<OPT>(?:<SP><OPT>)*/.source,"i"),lookbehind:!0,greedy:!0,inside:{property:{pattern:/(^|\s)--[\w-]+/,lookbehind:!0},string:[o,{pattern:/(=)(?!["'])(?:[^\s\\]|\\.)+/,lookbehind:!0}],operator:/\\$/m,punctuation:/=/}},keyword:[{pattern:c(/(^(?:ONBUILD<SP>)?HEALTHCHECK<SP>(?:<OPT><SP>)*)(?:CMD|NONE)\b/.source,"i"),lookbehind:!0,greedy:!0},{pattern:c(/(^(?:ONBUILD<SP>)?FROM<SP>(?:<OPT><SP>)*(?!--)[^ \t\\]+<SP>)AS/.source,"i"),lookbehind:!0,greedy:!0},{pattern:c(/(^ONBUILD<SP>)\w+/.source,"i"),lookbehind:!0,greedy:!0},{pattern:/^\w+/,greedy:!0}],comment:i,string:o,variable:/\$(?:\w+|\{[^{}"'\\]*\})/,operator:/\\$/m}},comment:i},t.languages.dockerfile=t.languages.docker})(Prism);Prism.languages.git={comment:/^#.*/m,deleted:/^[-–].*/m,inserted:/^\+.*/m,string:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,command:{pattern:/^.*\$ git .*$/m,inside:{parameter:/\s--?\w+/}},coord:/^@@.*@@$/m,"commit-sha1":/^commit \w{40}$/m};const Un=Ye.cva("relative rounded font-mono",{variants:{variant:{inline:"bg-muted px-[0.3rem] py-[0.2rem] text-xs sm:text-sm",block:"block bg-muted overflow-x-auto"},size:{sm:"text-xs sm:text-sm",base:"text-sm sm:text-base",lg:"text-base sm:text-lg"}},defaultVariants:{variant:"inline",size:"base"}}),qo=l.forwardRef(({className:t,variant:a,size:s,language:r,showLineNumbers:n=!1,maxHeight:o,copyable:i=!1,filename:c,theme:m="auto",children:d,...x},u)=>{const[f,w]=l.useState(!1),[k,b]=l.useState("");l.useRef(null),l.useEffect(()=>{if(a==="block"&&r&&d)try{const v=typeof d=="string"?d:String(d),p=Va.highlight(v,Va.languages[r]||Va.languages.text,r);b(p)}catch(v){console.warn(`Failed to highlight code for language: ${r}`,v),b(String(d))}else b(String(d))},[r,d,a]);const y=async()=>{if(typeof d=="string")try{await navigator.clipboard.writeText(d),w(!0),setTimeout(()=>w(!1),2e3)}catch(v){console.error("Failed to copy code:",v)}};return a==="block"?e.jsxs("div",{className:"relative my-4 sm:my-6",children:[(c||i)&&e.jsxs("div",{className:"flex items-center justify-between bg-muted/50 px-3 sm:px-4 py-2 sm:py-3 rounded-t-lg border-b",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[c&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs sm:text-sm text-muted-foreground",children:[e.jsx(h.FileText,{className:"h-3 w-3 sm:h-4 sm:w-4"}),e.jsx("span",{className:"font-medium",children:c})]}),r&&!c&&e.jsx("div",{className:"text-xs sm:text-sm text-muted-foreground uppercase font-medium",children:r})]}),i&&e.jsx($,{variant:"ghost",size:"sm",onClick:y,className:"h-6 w-6 sm:h-7 sm:w-7 p-0 hover:bg-muted-foreground/10",children:f?e.jsx(h.Check,{className:"h-3 w-3 sm:h-4 sm:w-4 text-green-600"}):e.jsx(h.Copy,{className:"h-3 w-3 sm:h-4 sm:w-4"})})]}),e.jsx("div",{className:g("waka-code relative",o&&"overflow-hidden"),style:{maxHeight:o?`${o}px`:void 0},children:e.jsxs("pre",{className:g(Un({variant:a,size:s}),"p-3 sm:p-4 lg:p-6","text-xs sm:text-sm lg:text-base","leading-relaxed sm:leading-loose","whitespace-pre-wrap break-words","scrollbar-thin scrollbar-thumb-muted-foreground/20 scrollbar-track-transparent","hover:scrollbar-thumb-muted-foreground/30",o&&"overflow-y-auto",!c&&!i&&r&&"rounded-lg",c||i?"rounded-b-lg":"rounded-lg",t),children:[n&&e.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-8 sm:w-10 lg:w-12 bg-muted/30 border-r border-border/50 flex flex-col text-xs sm:text-sm text-muted-foreground select-none",children:String(d).split(`
|
|
3
|
+
`).map((v,p)=>e.jsx("div",{className:"flex items-center justify-center h-5 sm:h-6 lg:h-7",children:p+1},p))}),e.jsx("code",{ref:u,className:g("block",n&&"ml-8 sm:ml-10 lg:ml-12",r&&"language-"+r),...x,dangerouslySetInnerHTML:a==="block"&&r?{__html:k}:void 0,children:a==="block"&&r?void 0:d})]})}),r&&!c&&!i&&e.jsx("div",{className:"absolute top-2 right-2 text-xs text-muted-foreground/70 bg-background/80 px-2 py-1 rounded uppercase font-medium",children:r})]}):e.jsx("code",{className:g(Un({variant:a,size:s}),t),ref:u,...x,children:d})});qo.displayName="Code";const yr=ur.Root,Nr=ur.CollapsibleTrigger,Cr=ur.CollapsibleContent,It=ue.Root,jp=ue.Trigger,Ho=ue.Portal,Go=ue.Close,kr=l.forwardRef(({className:t,...a},s)=>e.jsx(ue.Overlay,{ref:s,className:g("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...a}));kr.displayName=ue.Overlay.displayName;const Tt=l.forwardRef(({className:t,children:a,...s},r)=>e.jsxs(Ho,{children:[e.jsx(kr,{}),e.jsxs(ue.Content,{ref:r,className:g("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...s,children:[a,e.jsxs(ue.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[e.jsx(h.X,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Tt.displayName=ue.Content.displayName;const qt=({className:t,...a})=>e.jsx("div",{className:g("flex flex-col space-y-1.5 text-center sm:text-left",t),...a});qt.displayName="DialogHeader";const Ht=({className:t,...a})=>e.jsx("div",{className:g("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...a});Ht.displayName="DialogFooter";const Gt=l.forwardRef(({className:t,...a},s)=>e.jsx(ue.Title,{ref:s,className:g("text-lg font-semibold leading-none tracking-tight",t),...a}));Gt.displayName=ue.Title.displayName;const Cs=l.forwardRef(({className:t,...a},s)=>e.jsx(ue.Description,{ref:s,className:g("text-sm text-muted-foreground",t),...a}));Cs.displayName=ue.Description.displayName;const ts=l.forwardRef(({className:t,...a},s)=>e.jsx(ut.Command,{ref:s,className:g("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...a}));ts.displayName=ut.Command.displayName;const vp=({children:t,...a})=>e.jsx(It,{...a,children:e.jsx(Tt,{className:"overflow-hidden p-0 shadow-lg",children:e.jsx(ts,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:t})})}),xs=l.forwardRef(({className:t,...a},s)=>e.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[e.jsx(h.Search,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(ut.Command.Input,{ref:s,className:g("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),...a})]}));xs.displayName=ut.Command.Input.displayName;const Zs=l.forwardRef(({className:t,...a},s)=>e.jsx(ut.Command.List,{ref:s,className:g("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...a}));Zs.displayName=ut.Command.List.displayName;const gs=l.forwardRef((t,a)=>e.jsx(ut.Command.Empty,{ref:a,className:"py-6 text-center text-sm",...t}));gs.displayName=ut.Command.Empty.displayName;const Ot=l.forwardRef(({className:t,...a},s)=>e.jsx(ut.Command.Group,{ref:s,className:g("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",t),...a}));Ot.displayName=ut.Command.Group.displayName;const ba=l.forwardRef(({className:t,...a},s)=>e.jsx(ut.Command.Separator,{ref:s,className:g("-mx-1 h-px bg-border",t),...a}));ba.displayName=ut.Command.Separator.displayName;const zt=l.forwardRef(({className:t,...a},s)=>e.jsx(ut.Command.Item,{ref:s,className:g("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...a}));zt.displayName=ut.Command.Item.displayName;const Xo=({className:t,...a})=>e.jsx("span",{className:g("ml-auto text-xs tracking-widest text-muted-foreground",t),...a});Xo.displayName="CommandShortcut";const Yo=Ae.Root,Jo=Ae.Trigger,wp=Ae.Group,yp=Ae.Portal,Np=Ae.Sub,Cp=Ae.RadioGroup,Ko=l.forwardRef(({className:t,inset:a,children:s,...r},n)=>e.jsxs(Ae.SubTrigger,{ref:n,className:g("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",a&&"pl-8",t),...r,children:[s,e.jsx(h.ChevronRight,{className:"ml-auto h-4 w-4"})]}));Ko.displayName=Ae.SubTrigger.displayName;const Qo=l.forwardRef(({className:t,...a},s)=>e.jsx(Ae.SubContent,{ref:s,className:g("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...a}));Qo.displayName=Ae.SubContent.displayName;const Sr=l.forwardRef(({className:t,...a},s)=>e.jsx(Ae.Portal,{children:e.jsx(Ae.Content,{ref:s,className:g("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...a})}));Sr.displayName=Ae.Content.displayName;const Ft=l.forwardRef(({className:t,inset:a,...s},r)=>e.jsx(Ae.Item,{ref:r,className:g("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a&&"pl-8",t),...s}));Ft.displayName=Ae.Item.displayName;const Zo=l.forwardRef(({className:t,children:a,checked:s,...r},n)=>e.jsxs(Ae.CheckboxItem,{ref:n,className:g("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:s,...r,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Ae.ItemIndicator,{children:e.jsx(h.Check,{className:"h-4 w-4"})})}),a]}));Zo.displayName=Ae.CheckboxItem.displayName;const ei=l.forwardRef(({className:t,children:a,...s},r)=>e.jsxs(Ae.RadioItem,{ref:r,className:g("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...s,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Ae.ItemIndicator,{children:e.jsx(h.Circle,{className:"h-2 w-2 fill-current"})})}),a]}));ei.displayName=Ae.RadioItem.displayName;const ti=l.forwardRef(({className:t,inset:a,...s},r)=>e.jsx(Ae.Label,{ref:r,className:g("px-2 py-1.5 text-sm font-semibold text-foreground",a&&"pl-8",t),...s}));ti.displayName=Ae.Label.displayName;const Vs=l.forwardRef(({className:t,...a},s)=>e.jsx(Ae.Separator,{ref:s,className:g("-mx-1 my-1 h-px bg-border",t),...a}));Vs.displayName=Ae.Separator.displayName;const si=({className:t,...a})=>e.jsx("span",{className:g("ml-auto text-xs tracking-widest text-muted-foreground",t),...a});si.displayName="ContextMenuShortcut";const Ge=Re.Root,Xe=Re.Trigger,kp=Re.Group,Sp=Re.Portal,Dp=Re.Sub,Tp=Re.RadioGroup,ai=l.forwardRef(({className:t,inset:a,children:s,...r},n)=>e.jsxs(Re.SubTrigger,{ref:n,className:g("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",a&&"pl-8",t),...r,children:[s,e.jsx(h.ChevronRight,{className:"ml-auto h-4 w-4"})]}));ai.displayName=Re.SubTrigger.displayName;const ri=l.forwardRef(({className:t,...a},s)=>e.jsx(Re.SubContent,{ref:s,className:g("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...a}));ri.displayName=Re.SubContent.displayName;const Ue=l.forwardRef(({className:t,sideOffset:a=4,...s},r)=>e.jsx(Re.Portal,{children:e.jsx(Re.Content,{ref:r,sideOffset:a,className:g("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...s})}));Ue.displayName=Re.Content.displayName;const xe=l.forwardRef(({className:t,inset:a,...s},r)=>e.jsx(Re.Item,{ref:r,className:g("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a&&"pl-8",t),...s}));xe.displayName=Re.Item.displayName;const ds=l.forwardRef(({className:t,children:a,checked:s,...r},n)=>e.jsxs(Re.CheckboxItem,{ref:n,className:g("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:s,...r,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Re.ItemIndicator,{children:e.jsx(h.Check,{className:"h-4 w-4"})})}),a]}));ds.displayName=Re.CheckboxItem.displayName;const ni=l.forwardRef(({className:t,children:a,...s},r)=>e.jsxs(Re.RadioItem,{ref:r,className:g("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...s,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Re.ItemIndicator,{children:e.jsx(h.Circle,{className:"h-2 w-2 fill-current"})})}),a]}));ni.displayName=Re.RadioItem.displayName;const ms=l.forwardRef(({className:t,inset:a,...s},r)=>e.jsx(Re.Label,{ref:r,className:g("px-2 py-1.5 text-sm font-semibold",a&&"pl-8",t),...s}));ms.displayName=Re.Label.displayName;const Ze=l.forwardRef(({className:t,...a},s)=>e.jsx(Re.Separator,{ref:s,className:g("-mx-1 my-1 h-px bg-muted",t),...a}));Ze.displayName=Re.Separator.displayName;const oi=({className:t,...a})=>e.jsx("span",{className:g("ml-auto text-xs tracking-widest opacity-60",t),...a});oi.displayName="DropdownMenuShortcut";var Ep=t=>t.type==="checkbox",zs=t=>t instanceof Date,Dr=t=>t==null;const ii=t=>typeof t=="object";var bs=t=>!Dr(t)&&!Array.isArray(t)&&ii(t)&&!zs(t),Mp=t=>bs(t)&&t.target?Ep(t.target)?t.target.checked:t.target.value:t,Pp=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,Ap=(t,a)=>t.has(Pp(a)),Rp=t=>{const a=t.constructor&&t.constructor.prototype;return bs(a)&&a.hasOwnProperty("isPrototypeOf")},Fp=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function li(t){let a;const s=Array.isArray(t),r=typeof FileList<"u"?t instanceof FileList:!1;if(t instanceof Date)a=new Date(t);else if(!(Fp&&(t instanceof Blob||r))&&(s||bs(t)))if(a=s?[]:Object.create(Object.getPrototypeOf(t)),!s&&!Rp(t))a=t;else for(const n in t)t.hasOwnProperty(n)&&(a[n]=li(t[n]));else return t;return a}var ci=t=>/^\w*$/.test(t),or=t=>t===void 0,$p=t=>Array.isArray(t)?t.filter(Boolean):[],di=t=>$p(t.replace(/["|']|\]/g,"").split(/\.|\[/)),it=(t,a,s)=>{if(!a||!bs(t))return s;const r=(ci(a)?[a]:di(a)).reduce((n,o)=>Dr(n)?n:n[o],t);return or(r)||r===t?or(t[a])?s:t[a]:r},Wa=t=>typeof t=="boolean",Bn=(t,a,s)=>{let r=-1;const n=ci(a)?[a]:di(a),o=n.length,i=o-1;for(;++r<o;){const c=n[r];let m=s;if(r!==i){const d=t[c];m=bs(d)||Array.isArray(d)?d:isNaN(+n[r+1])?{}:[]}if(c==="__proto__"||c==="constructor"||c==="prototype")return;t[c]=m,t=t[c]}};const qn={BLUR:"blur",CHANGE:"change"},Hn={all:"all"},Tr=O.createContext(null);Tr.displayName="HookFormContext";const ka=()=>O.useContext(Tr),Lp=t=>{const{children:a,...s}=t;return O.createElement(Tr.Provider,{value:s},a)};var Ip=(t,a,s,r=!0)=>{const n={defaultValues:a._defaultValues};for(const o in t)Object.defineProperty(n,o,{get:()=>{const i=o;return a._proxyFormState[i]!==Hn.all&&(a._proxyFormState[i]=!r||Hn.all),s&&(s[i]=!0),t[i]}});return n};const ui=typeof window<"u"?O.useLayoutEffect:O.useEffect;function Op(t){const a=ka(),{control:s=a.control,disabled:r,name:n,exact:o}=t||{},[i,c]=O.useState(s._formState),m=O.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return ui(()=>s._subscribe({name:n,formState:m.current,exact:o,callback:d=>{!r&&c({...s._formState,...d})}}),[n,r,o]),O.useEffect(()=>{m.current.isValid&&s._setValid(!0)},[s]),O.useMemo(()=>Ip(i,s,m.current,!1),[i,s])}var zp=t=>typeof t=="string",Gn=(t,a,s,r,n)=>zp(t)?it(s,t,n):Array.isArray(t)?t.map(o=>it(s,o)):s,Xn=t=>Dr(t)||!ii(t);function ha(t,a,s=new WeakSet){if(Xn(t)||Xn(a))return Object.is(t,a);if(zs(t)&&zs(a))return t.getTime()===a.getTime();const r=Object.keys(t),n=Object.keys(a);if(r.length!==n.length)return!1;if(s.has(t)||s.has(a))return!0;s.add(t),s.add(a);for(const o of r){const i=t[o];if(!n.includes(o))return!1;if(o!=="ref"){const c=a[o];if(zs(i)&&zs(c)||bs(i)&&bs(c)||Array.isArray(i)&&Array.isArray(c)?!ha(i,c,s):!Object.is(i,c))return!1}}return!0}function _p(t){const a=ka(),{control:s=a.control,name:r,defaultValue:n,disabled:o,exact:i,compute:c}=t||{},m=O.useRef(n),d=O.useRef(c),x=O.useRef(void 0),u=O.useRef(s),f=O.useRef(r);d.current=c;const[w,k]=O.useState(()=>{const C=s._getWatch(r,m.current);return d.current?d.current(C):C}),b=O.useCallback(C=>{const N=Gn(r,s._names,C||s._formValues,!1,m.current);return d.current?d.current(N):N},[s._formValues,s._names,r]),y=O.useCallback(C=>{if(!o){const N=Gn(r,s._names,C||s._formValues,!1,m.current);if(d.current){const S=d.current(N);ha(S,x.current)||(k(S),x.current=S)}else k(N)}},[s._formValues,s._names,o,r]);ui(()=>((u.current!==s||!ha(f.current,r))&&(u.current=s,f.current=r,y()),s._subscribe({name:r,formState:{values:!0},exact:i,callback:C=>{y(C.values)}})),[s,i,r,y]),O.useEffect(()=>s._removeUnmounted());const v=u.current!==s,p=f.current,j=O.useMemo(()=>{if(o)return null;const C=!v&&!ha(p,r);return v||C?b():null},[o,v,r,p,b]);return j!==null?j:w}function Vp(t){const a=ka(),{name:s,disabled:r,control:n=a.control,shouldUnregister:o,defaultValue:i,exact:c=!0}=t,m=Ap(n._names.array,s),d=O.useMemo(()=>it(n._formValues,s,it(n._defaultValues,s,i)),[n,s,i]),x=_p({control:n,name:s,defaultValue:d,exact:c}),u=Op({control:n,name:s,exact:c}),f=O.useRef(t),w=O.useRef(void 0),k=O.useRef(n.register(s,{...t.rules,value:x,...Wa(t.disabled)?{disabled:t.disabled}:{}}));f.current=t;const b=O.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!it(u.errors,s)},isDirty:{enumerable:!0,get:()=>!!it(u.dirtyFields,s)},isTouched:{enumerable:!0,get:()=>!!it(u.touchedFields,s)},isValidating:{enumerable:!0,get:()=>!!it(u.validatingFields,s)},error:{enumerable:!0,get:()=>it(u.errors,s)}}),[u,s]),y=O.useCallback(C=>k.current.onChange({target:{value:Mp(C),name:s},type:qn.CHANGE}),[s]),v=O.useCallback(()=>k.current.onBlur({target:{value:it(n._formValues,s),name:s},type:qn.BLUR}),[s,n._formValues]),p=O.useCallback(C=>{const N=it(n._fields,s);N&&C&&(N._f.ref={focus:()=>C.focus&&C.focus(),select:()=>C.select&&C.select(),setCustomValidity:S=>C.setCustomValidity(S),reportValidity:()=>C.reportValidity()})},[n._fields,s]),j=O.useMemo(()=>({name:s,value:x,...Wa(r)||u.disabled?{disabled:u.disabled||r}:{},onChange:y,onBlur:v,ref:p}),[s,r,u.disabled,y,v,p,x]);return O.useEffect(()=>{const C=n._options.shouldUnregister||o,N=w.current;N&&N!==s&&!m&&n.unregister(N),n.register(s,{...f.current.rules,...Wa(f.current.disabled)?{disabled:f.current.disabled}:{}});const S=(A,R)=>{const E=it(n._fields,A);E&&E._f&&(E._f.mount=R)};if(S(s,!0),C){const A=li(it(n._options.defaultValues,s,f.current.defaultValue));Bn(n._defaultValues,s,A),or(it(n._formValues,s))&&Bn(n._formValues,s,A)}return!m&&n.register(s),w.current=s,()=>{(m?C&&!n._state.action:C)?n.unregister(s):S(s,!1)}},[s,n,m,o]),O.useEffect(()=>{n._setDisabledField({disabled:r,name:s})},[r,s,n]),O.useMemo(()=>({field:j,formState:u,fieldState:b}),[j,u,b])}const mi=t=>t.render(Vp(t)),Wp=Ye.cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),he=l.forwardRef(({className:t,...a},s)=>e.jsx(ko.Root,{ref:s,className:g(Wp(),t),...a}));he.displayName=ko.Root.displayName;const Up=Lp,hi=l.createContext({}),Bp=({...t})=>e.jsx(hi.Provider,{value:{name:t.name},children:e.jsx(mi,{...t})}),ea=()=>{const t=l.useContext(hi),a=l.useContext(fi),{getFieldState:s,formState:r}=ka(),n=s(t.name,r);if(!t)throw new Error("useFormField should be used within <FormField>");const{id:o}=a;return{id:o,name:t.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...n}},fi=l.createContext({}),pi=l.forwardRef(({className:t,...a},s)=>{const r=l.useId();return e.jsx(fi.Provider,{value:{id:r},children:e.jsx("div",{ref:s,className:g("space-y-2",t),...a})})});pi.displayName="FormItem";const xi=l.forwardRef(({className:t,...a},s)=>{const{error:r,formItemId:n}=ea();return e.jsx(he,{ref:s,className:g(r&&"text-destructive",t),htmlFor:n,...a})});xi.displayName="FormLabel";const gi=l.forwardRef(({...t},a)=>{const{error:s,formItemId:r,formDescriptionId:n,formMessageId:o}=ea();return e.jsx(ya.Slot,{ref:a,id:r,"aria-describedby":s?`${n} ${o}`:`${n}`,"aria-invalid":!!s,...t})});gi.displayName="FormControl";const bi=l.forwardRef(({className:t,...a},s)=>{const{formDescriptionId:r}=ea();return e.jsx("p",{ref:s,id:r,className:g("text-sm text-muted-foreground",t),...a})});bi.displayName="FormDescription";const ji=l.forwardRef(({className:t,children:a,...s},r)=>{const{error:n,formMessageId:o}=ea(),i=n?String(n?.message):a;return i?e.jsx("p",{ref:r,id:o,className:g("text-sm font-medium text-destructive",t),...s,children:i}):null});ji.displayName="FormMessage";const qp=Na.Root,Hp=Na.Trigger,vi=l.forwardRef(({className:t,align:a="center",sideOffset:s=4,...r},n)=>e.jsx(Na.Content,{ref:n,align:a,sideOffset:s,className:g("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r}));vi.displayName=Na.Content.displayName;const wi=l.forwardRef(({length:t=6,value:a="",onChange:s,onComplete:r,pattern:n="numeric",secure:o=!1,disabled:i=!1,className:c,error:m,size:d="md",separator:x,separatorElement:u=e.jsx("span",{className:"text-muted-foreground",children:"-"}),...f},w)=>{const[k,b]=l.useState(a.split("").slice(0,t)),y=l.useRef([]);l.useEffect(()=>{const R=a.split("").slice(0,t);b(R)},[a,t]);const p=(()=>{switch(n){case"numeric":return/^[0-9]$/;case"alpha":return/^[a-zA-Z]$/;case"alphanumeric":return/^[a-zA-Z0-9]$/;default:return/^.$/}})(),j=(R,E)=>{if(i)return;const D=E.slice(-1);if(D&&!p.test(D))return;const M=[...k];M[R]=D,b(M);const P=M.join("");s?.(P),D&&R<t-1&&y.current[R+1]?.focus(),M.every(T=>T!=="")&&M.length===t&&r?.(P)},C=(R,E)=>{if(!i){if(E.key==="Backspace"){E.preventDefault();const D=[...k];D[R]?(D[R]="",b(D),s?.(D.join(""))):R>0&&(D[R-1]="",b(D),s?.(D.join("")),y.current[R-1]?.focus())}if(E.key==="Delete"){E.preventDefault();const D=[...k];D[R]="",b(D),s?.(D.join(""))}E.key==="ArrowLeft"&&R>0&&(E.preventDefault(),y.current[R-1]?.focus()),E.key==="ArrowRight"&&R<t-1&&(E.preventDefault(),y.current[R+1]?.focus()),E.key==="Home"&&(E.preventDefault(),y.current[0]?.focus()),E.key==="End"&&(E.preventDefault(),y.current[t-1]?.focus())}},N=R=>{if(R.preventDefault(),i)return;const D=R.clipboardData.getData("text/plain").split("").filter(T=>p.test(T)).slice(0,t),M=[...k];D.forEach((T,q)=>{M[q]=T}),b(M),s?.(M.join(""));const P=M.findIndex(T=>!T);P!==-1?y.current[P]?.focus():y.current[t-1]?.focus(),M.every(T=>T!=="")&&M.length===t&&r?.(M.join(""))},S=R=>{R.target.select()},A={sm:"h-8 w-8 text-sm",md:"h-12 w-12 text-base",lg:"h-16 w-16 text-lg"}[d];return e.jsxs("div",{ref:w,className:g("flex flex-col gap-2",c),children:[e.jsx("div",{className:"flex items-center gap-2",children:Array.from({length:t}).map((R,E)=>e.jsxs(l.Fragment,{children:[e.jsx("input",{ref:D=>y.current[E]=D,type:o?"password":"text",inputMode:n==="numeric"?"numeric":"text",maxLength:1,value:k[E]||"",onChange:D=>j(E,D.target.value),onKeyDown:D=>C(E,D),onPaste:N,onFocus:S,disabled:i,className:g("flex items-center justify-center rounded-md border border-input bg-background text-center font-medium transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50",A,m&&"border-destructive focus-visible:ring-destructive",k[E]&&"border-primary"),"aria-label":`Caractère ${E+1} sur ${t}`,...f}),x&&(E+1)%x===0&&E<t-1&&e.jsx("div",{className:"flex items-center justify-center",children:u})]},E))}),m&&e.jsx("p",{className:"text-sm text-destructive",role:"alert",children:m})]})});wi.displayName="InputOTP";const oe=l.forwardRef(({className:t,type:a,...s},r)=>e.jsx("input",{type:a,className:g("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:r,...s}));oe.displayName="Input";const Oe=We.Root,Gp=We.Group,ze=We.Value,Le=l.forwardRef(({className:t,children:a,...s},r)=>e.jsxs(We.Trigger,{ref:r,className:g("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...s,children:[a,e.jsx(We.Icon,{asChild:!0,children:e.jsx(h.ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));Le.displayName=We.Trigger.displayName;const Er=l.forwardRef(({className:t,...a},s)=>e.jsx(We.ScrollUpButton,{ref:s,className:g("flex cursor-default items-center justify-center py-1",t),...a,children:e.jsx(h.ChevronUp,{className:"h-4 w-4"})}));Er.displayName=We.ScrollUpButton.displayName;const Mr=l.forwardRef(({className:t,...a},s)=>e.jsx(We.ScrollDownButton,{ref:s,className:g("flex cursor-default items-center justify-center py-1",t),...a,children:e.jsx(h.ChevronDown,{className:"h-4 w-4"})}));Mr.displayName=We.ScrollDownButton.displayName;const Ie=l.forwardRef(({className:t,children:a,position:s="popper",...r},n)=>e.jsx(We.Portal,{children:e.jsxs(We.Content,{ref:n,className:g("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:s,...r,children:[e.jsx(Er,{}),e.jsx(We.Viewport,{className:g("p-1",s==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:a}),e.jsx(Mr,{})]})}));Ie.displayName=We.Content.displayName;const yi=l.forwardRef(({className:t,...a},s)=>e.jsx(We.Label,{ref:s,className:g("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...a}));yi.displayName=We.Label.displayName;const be=l.forwardRef(({className:t,children:a,...s},r)=>e.jsxs(We.Item,{ref:r,className:g("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...s,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(We.ItemIndicator,{children:e.jsx(h.Check,{className:"h-4 w-4"})})}),e.jsx(We.ItemText,{children:a})]}));be.displayName=We.Item.displayName;const Ni=l.forwardRef(({className:t,...a},s)=>e.jsx(We.Separator,{ref:s,className:g("-mx-1 my-1 h-px bg-muted",t),...a}));Ni.displayName=We.Separator.displayName;function Xp({languages:t,value:a,onChange:s,showFlags:r=!0,showLabels:n=!0,variant:o="default",isLoading:i=!1,className:c,placeholder:m="Select language",ariaLabel:d="Select language"}){const[x,u]=l.useState(!1),[f,w]=l.useState(!1),k=l.useRef(null),b=l.useRef(null);l.useEffect(()=>{w(!0)},[]);const y=t.find(N=>N.code===a),v=N=>{s?.(N),u(!1)},[p,j]=l.useState({top:0,left:0});if(l.useEffect(()=>{if(x&&k.current&&f){const N=k.current.getBoundingClientRect();j({top:N.bottom+8,left:N.left})}},[x,f]),o==="default")return e.jsxs(Oe,{value:a,onValueChange:s,disabled:i,children:[e.jsx(Le,{className:g("w-[180px]",c),children:e.jsx(ze,{placeholder:m,children:y&&e.jsxs("div",{className:"flex items-center gap-2",children:[r&&y.flagEmoji&&e.jsx("span",{className:"text-lg",children:y.flagEmoji}),r&&y.flag&&!y.flagEmoji&&e.jsx("img",{src:y.flag,alt:y.label,className:"h-4 w-6 object-cover rounded"}),!r&&e.jsx(h.Globe,{className:"h-4 w-4 text-muted-foreground"}),n&&e.jsx("span",{children:y.label})]})})}),e.jsx(Ie,{children:t.map(N=>e.jsx(be,{value:N.code,children:e.jsxs("div",{className:"flex items-center gap-2",children:[r&&N.flagEmoji&&e.jsx("span",{className:"text-lg",children:N.flagEmoji}),r&&N.flag&&!N.flagEmoji&&e.jsx("img",{src:N.flag,alt:N.label,className:"h-4 w-6 object-cover rounded"}),n&&N.label]})},N.code))})]});if(o==="minimal"){const N=x&&f?e.jsx("div",{ref:b,className:"fixed z-[9999] min-w-[160px] rounded-md border border-border bg-popover text-popover-foreground p-2 shadow-lg",style:{top:`${p.top}px`,left:`${p.left}px`},onMouseDown:S=>S.stopPropagation(),children:e.jsx("div",{className:"grid gap-1",children:t.map(S=>e.jsxs("button",{onMouseDown:A=>{A.preventDefault(),A.stopPropagation(),v(S.code)},type:"button",className:g("flex items-center gap-2 rounded-sm px-2 py-2 text-sm hover:bg-accent hover:text-accent-foreground transition-colors cursor-pointer",a===S.code&&"bg-accent"),children:[S.flagEmoji&&e.jsx("span",{className:"text-lg",children:S.flagEmoji}),S.flag&&!S.flagEmoji&&e.jsx("img",{src:S.flag,alt:S.label,className:"h-4 w-6 object-cover rounded"}),e.jsx("span",{className:"flex-1 text-left",children:S.label}),a===S.code&&e.jsx(h.Check,{className:"h-4 w-4 shrink-0"})]},S.code))})}):null;return e.jsxs(e.Fragment,{children:[e.jsxs("button",{ref:k,onClick:S=>{S.preventDefault(),S.stopPropagation(),u(!x)},className:g("flex h-9 w-9 items-center justify-center rounded-md border border-input bg-transparent hover:bg-accent hover:text-accent-foreground transition-colors",c),title:"Changer de langue",type:"button",disabled:i,children:[y?.flagEmoji?e.jsx("span",{className:"text-lg",children:y.flagEmoji}):e.jsx(h.Globe,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:d})]}),f&&typeof document<"u"&&N&&Za.createPortal(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-[9998]",onMouseDown:S=>{S.preventDefault(),u(!1)}}),N]}),document.body)]})}const C=x&&f?e.jsx("div",{ref:b,className:"fixed z-[9999] min-w-[180px] rounded-md border border-border bg-popover text-popover-foreground p-2 shadow-lg",style:{top:`${p.top}px`,left:`${p.left}px`},onMouseDown:N=>N.stopPropagation(),children:e.jsx("div",{className:"grid gap-1",children:t.map(N=>e.jsxs("button",{onMouseDown:S=>{S.preventDefault(),S.stopPropagation(),v(N.code)},type:"button",className:g("flex items-center gap-2 rounded-sm px-2 py-2 text-sm hover:bg-accent hover:text-accent-foreground transition-colors cursor-pointer",a===N.code&&"bg-accent"),children:[r&&N.flagEmoji&&e.jsx("span",{className:"text-lg",children:N.flagEmoji}),r&&N.flag&&!N.flagEmoji&&e.jsx("img",{src:N.flag,alt:N.label,className:"h-4 w-6 object-cover rounded"}),e.jsx("span",{className:"flex-1 text-left",children:N.label}),a===N.code&&e.jsx(h.Check,{className:"h-4 w-4 shrink-0"})]},N.code))})}):null;return e.jsxs(e.Fragment,{children:[e.jsxs("button",{ref:k,onClick:N=>{N.preventDefault(),N.stopPropagation(),i||u(!x)},className:g("inline-flex items-center gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm hover:bg-accent hover:text-accent-foreground transition-colors",i&&"opacity-50 cursor-not-allowed",c),disabled:i,type:"button","aria-label":d,children:[r&&y?.flagEmoji&&e.jsx("span",{className:"text-lg",children:y.flagEmoji}),r&&y?.flag&&!y?.flagEmoji&&e.jsx("img",{src:y.flag,alt:y.label,className:"h-4 w-6 object-cover rounded"}),!r&&e.jsx(h.Globe,{className:"h-4 w-4"}),n&&e.jsx("span",{children:y?.label||"Langue"}),e.jsx(h.ChevronDown,{className:"h-4 w-4"})]}),f&&typeof document<"u"&&C&&Za.createPortal(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-[9998]",onMouseDown:N=>{N.preventDefault(),u(!1)}}),C]}),document.body)]})}const Yp=Me.Menu,Jp=Me.Group,Kp=Me.Portal,Qp=Me.Sub,Zp=Me.RadioGroup,Ci=l.forwardRef(({className:t,...a},s)=>e.jsx(Me.Root,{ref:s,className:g("flex h-10 items-center space-x-1 rounded-md border bg-background p-1",t),...a}));Ci.displayName=Me.Root.displayName;const ki=l.forwardRef(({className:t,...a},s)=>e.jsx(Me.Trigger,{ref:s,className:g("flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t),...a}));ki.displayName=Me.Trigger.displayName;const Si=l.forwardRef(({className:t,inset:a,children:s,...r},n)=>e.jsxs(Me.SubTrigger,{ref:n,className:g("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",a&&"pl-8",t),...r,children:[s,e.jsx(h.ChevronRight,{className:"ml-auto h-4 w-4"})]}));Si.displayName=Me.SubTrigger.displayName;const Di=l.forwardRef(({className:t,...a},s)=>e.jsx(Me.SubContent,{ref:s,className:g("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...a}));Di.displayName=Me.SubContent.displayName;const Ti=l.forwardRef(({className:t,align:a="start",alignOffset:s=-4,sideOffset:r=8,...n},o)=>e.jsx(Me.Portal,{children:e.jsx(Me.Content,{ref:o,align:a,alignOffset:s,sideOffset:r,className:g("z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n})}));Ti.displayName=Me.Content.displayName;const Ei=l.forwardRef(({className:t,inset:a,...s},r)=>e.jsx(Me.Item,{ref:r,className:g("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a&&"pl-8",t),...s}));Ei.displayName=Me.Item.displayName;const Mi=l.forwardRef(({className:t,children:a,checked:s,...r},n)=>e.jsxs(Me.CheckboxItem,{ref:n,className:g("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:s,...r,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Me.ItemIndicator,{children:e.jsx(h.Check,{className:"h-4 w-4"})})}),a]}));Mi.displayName=Me.CheckboxItem.displayName;const Pi=l.forwardRef(({className:t,children:a,...s},r)=>e.jsxs(Me.RadioItem,{ref:r,className:g("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...s,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(Me.ItemIndicator,{children:e.jsx(h.Circle,{className:"h-2 w-2 fill-current"})})}),a]}));Pi.displayName=Me.RadioItem.displayName;const Ai=l.forwardRef(({className:t,inset:a,...s},r)=>e.jsx(Me.Label,{ref:r,className:g("px-2 py-1.5 text-sm font-semibold",a&&"pl-8",t),...s}));Ai.displayName=Me.Label.displayName;const Ri=l.forwardRef(({className:t,...a},s)=>e.jsx(Me.Separator,{ref:s,className:g("-mx-1 my-1 h-px bg-muted",t),...a}));Ri.displayName=Me.Separator.displayName;const Fi=({className:t,...a})=>e.jsx("span",{className:g("ml-auto text-xs tracking-widest text-muted-foreground",t),...a});Fi.displayName="MenubarShortcut";const $i=l.forwardRef(({className:t,children:a,...s},r)=>e.jsxs(mt.Root,{ref:r,className:g("relative z-10 flex max-w-max flex-1 items-center justify-center",t),...s,children:[a,e.jsx(Pr,{})]}));$i.displayName=mt.Root.displayName;const Li=l.forwardRef(({className:t,...a},s)=>e.jsx(mt.List,{ref:s,className:g("group flex flex-1 list-none items-center justify-center space-x-1",t),...a}));Li.displayName=mt.List.displayName;const ex=mt.Item,Ii=Ye.cva("group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50"),Oi=l.forwardRef(({className:t,children:a,...s},r)=>e.jsxs(mt.Trigger,{ref:r,className:g(Ii(),"group",t),...s,children:[a," ",e.jsx(h.ChevronDown,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]}));Oi.displayName=mt.Trigger.displayName;const zi=l.forwardRef(({className:t,...a},s)=>e.jsx(mt.Content,{ref:s,className:g("left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto ",t),...a}));zi.displayName=mt.Content.displayName;const tx=mt.Link,Pr=l.forwardRef(({className:t,...a},s)=>e.jsx("div",{className:g("absolute left-0 top-full flex justify-center"),children:e.jsx(mt.Viewport,{className:g("origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",t),ref:s,...a})}));Pr.displayName=mt.Viewport.displayName;const _i=l.forwardRef(({className:t,...a},s)=>e.jsx(mt.Indicator,{ref:s,className:g("top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",t),...a,children:e.jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}));_i.displayName=mt.Indicator.displayName;const ct=Bs.Root,dt=Bs.Trigger,rt=l.forwardRef(({className:t,align:a="center",sideOffset:s=4,...r},n)=>e.jsx(Bs.Portal,{children:e.jsx(Bs.Content,{ref:n,align:a,sideOffset:s,className:g("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r})}));rt.displayName=Bs.Content.displayName;const Gs=l.forwardRef(({className:t,value:a,...s},r)=>e.jsx(tr.Root,{ref:r,className:g("relative h-4 w-full overflow-hidden rounded-full bg-secondary",t),...s,children:e.jsx(tr.Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(a||0)}%)`}})}));Gs.displayName=tr.Root.displayName;const Vi=l.forwardRef(({className:t,...a},s)=>e.jsx(qs.Root,{className:g("grid gap-2",t),...a,ref:s}));Vi.displayName=qs.Root.displayName;const Wi=l.forwardRef(({className:t,...a},s)=>e.jsx(qs.Item,{ref:s,className:g("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...a,children:e.jsx(qs.Indicator,{className:"flex items-center justify-center",children:e.jsx(h.Circle,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Wi.displayName=qs.Item.displayName;const yt=l.forwardRef(({className:t,children:a,...s},r)=>e.jsxs(us.Root,{ref:r,className:g("relative overflow-hidden",t),...s,children:[e.jsx(us.Viewport,{className:"h-full w-full rounded-[inherit]",children:a}),e.jsx(Ar,{}),e.jsx(us.Corner,{})]}));yt.displayName=us.Root.displayName;const Ar=l.forwardRef(({className:t,orientation:a="vertical",...s},r)=>e.jsx(us.ScrollAreaScrollbar,{ref:r,orientation:a,className:g("flex touch-none select-none transition-colors",a==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",a==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",t),...s,children:e.jsx(us.ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));Ar.displayName=us.ScrollAreaScrollbar.displayName;const Et=l.forwardRef(({className:t,orientation:a="horizontal",decorative:s=!0,...r},n)=>e.jsx(So.Root,{ref:n,decorative:s,orientation:a,className:g("shrink-0 bg-border",a==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...r}));Et.displayName=So.Root.displayName;const ta=ue.Root,Rr=ue.Trigger,sx=ue.Close,Ui=ue.Portal,Fr=l.forwardRef(({className:t,...a},s)=>e.jsx(ue.Overlay,{className:g("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...a,ref:s}));Fr.displayName=ue.Overlay.displayName;const ax=Ye.cva("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Ts=l.forwardRef(({side:t="right",className:a,children:s,...r},n)=>e.jsxs(Ui,{children:[e.jsx(Fr,{}),e.jsxs(ue.Content,{ref:n,className:g(ax({side:t}),a),...r,children:[s,e.jsxs(ue.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[e.jsx(h.X,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ts.displayName=ue.Content.displayName;const Sa=({className:t,...a})=>e.jsx("div",{className:g("flex flex-col space-y-2 text-center sm:text-left",t),...a});Sa.displayName="SheetHeader";const $r=({className:t,...a})=>e.jsx("div",{className:g("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...a});$r.displayName="SheetFooter";const Da=l.forwardRef(({className:t,...a},s)=>e.jsx(ue.Title,{ref:s,className:g("text-lg font-semibold text-foreground",t),...a}));Da.displayName=ue.Title.displayName;const Ta=l.forwardRef(({className:t,...a},s)=>e.jsx(ue.Description,{ref:s,className:g("text-sm text-muted-foreground",t),...a}));Ta.displayName=ue.Description.displayName;function rx({className:t,...a}){return e.jsx("div",{className:g("animate-pulse rounded-md bg-muted",t),...a})}const ja=l.forwardRef(({className:t,...a},s)=>e.jsxs(Os.Root,{ref:s,className:g("relative flex w-full touch-none select-none items-center",t),...a,children:[e.jsx(Os.Track,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:e.jsx(Os.Range,{className:"absolute h-full bg-primary"})}),e.jsx(Os.Thumb,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));ja.displayName=Os.Root.displayName;const sa=l.forwardRef(({className:t,...a},s)=>e.jsx(sr.Root,{className:g("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",t),...a,ref:s,children:e.jsx(sr.Thumb,{className:g("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));sa.displayName=sr.Root.displayName;const Ea=l.forwardRef(({className:t,...a},s)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:s,className:g("w-full caption-bottom text-sm",t),...a})}));Ea.displayName="Table";const Ma=l.forwardRef(({className:t,...a},s)=>e.jsx("thead",{ref:s,className:g("[&_tr]:border-b",t),...a}));Ma.displayName="TableHeader";const Pa=l.forwardRef(({className:t,...a},s)=>e.jsx("tbody",{ref:s,className:g("[&_tr:last-child]:border-0",t),...a}));Pa.displayName="TableBody";const Bi=l.forwardRef(({className:t,...a},s)=>e.jsx("tfoot",{ref:s,className:g("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...a}));Bi.displayName="TableFooter";const Bt=l.forwardRef(({className:t,...a},s)=>e.jsx("tr",{ref:s,className:g("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t),...a}));Bt.displayName="TableRow";const lt=l.forwardRef(({className:t,...a},s)=>e.jsx("th",{ref:s,className:g("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t),...a}));lt.displayName="TableHead";const st=l.forwardRef(({className:t,...a},s)=>e.jsx("td",{ref:s,className:g("p-4 align-middle [&:has([role=checkbox])]:pr-0",t),...a}));st.displayName="TableCell";const qi=l.forwardRef(({className:t,...a},s)=>e.jsx("caption",{ref:s,className:g("mt-4 text-sm text-muted-foreground",t),...a}));qi.displayName="TableCaption";const aa=ws.Root,Es=l.forwardRef(({className:t,...a},s)=>e.jsx(ws.List,{ref:s,className:g("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",t),...a}));Es.displayName=ws.List.displayName;const js=l.forwardRef(({className:t,...a},s)=>e.jsx(ws.Trigger,{ref:s,className:g("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",t),...a}));js.displayName=ws.Trigger.displayName;const vs=l.forwardRef(({className:t,...a},s)=>e.jsx(ws.Content,{ref:s,className:g("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...a}));vs.displayName=ws.Content.displayName;const wt=l.forwardRef(({className:t,...a},s)=>e.jsx("textarea",{className:g("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),ref:s,...a}));wt.displayName="Textarea";const Hi=l.createContext(void 0);function Gi({children:t,themes:a,defaultTheme:s="default",s3Config:r,onThemeChange:n,enableDarkMode:o=!1}){const[i,c]=l.useState(s),[m,d]=l.useState(!0),[x,u]=l.useState(new Set),[f,w]=l.useState(!1),[k,b]=l.useState(!1),y=l.useRef(new Map),v=l.useRef(new Set);l.useEffect(()=>{v.current=x},[x]);const p=l.useCallback(async D=>{if(!r)throw new Error("S3 configuration not provided");const{baseUrl:M,prefix:P="",extension:T="css",headers:q={},timeout:H=1e4}=r,Y=M.replace(/\/+$/,""),U=P.replace(/^\/+/,"").replace(/\/+$/,""),z=`v=${Date.now()}`;let V;U?V=`${Y}/${U}/${D}.${T}?${z}`:V=`${Y}/${D}.${T}?${z}`,console.log(`[ThemeProvider] Loading theme "${D}" from URL: ${V}`);try{const L=new AbortController,W=setTimeout(()=>L.abort(),H),F=await fetch(V,{signal:L.signal,headers:{Accept:T==="json"?"application/json":"text/css","Cache-Control":"no-cache, no-store, must-revalidate",Pragma:"no-cache",...q}});if(clearTimeout(W),!F.ok){const ee=`HTTP ${F.status}: ${F.statusText}`;throw console.error(`[ThemeProvider] Failed to load theme "${D}" from ${V}:`,ee),new Error(ee)}if(console.log(`[ThemeProvider] ✅ Successfully loaded theme "${D}" from ${V}`),T==="json"){let ee;try{const se=await F.text();if(console.log(`[ThemeProvider] Raw JSON response for theme "${D}" (${se.length} chars)`),!se||se.trim().length===0)throw new Error(`Empty JSON response for theme "${D}"`);ee=JSON.parse(se),console.log(`[ThemeProvider] Parsed JSON for theme "${D}":`,Object.keys(ee))}catch(se){throw console.error(`[ThemeProvider] Failed to parse JSON for theme "${D}":`,se),new Error(`Invalid JSON format for theme "${D}": ${se instanceof Error?se.message:"Unknown error"}`)}try{const se=nx(D,ee);if(!se.includes(`[data-theme="${D}"]`))throw console.error(`[ThemeProvider] ❌ Generated CSS missing [data-theme="${D}"] selector for theme "${D}"`),console.error("[ThemeProvider] Generated CSS:",se.substring(0,500)),new Error(`Generated CSS is missing the required selector [data-theme="${D}"]`);return console.log(`[ThemeProvider] ✅ Converted JSON to CSS for theme "${D}" (${se.length} chars)`),se}catch(se){throw console.error(`[ThemeProvider] Failed to convert JSON to CSS for theme "${D}":`,se),se}}const G=await F.text();if(!G||G.trim().length===0)throw new Error(`Empty CSS response for theme "${D}"`);return!G.includes(`[data-theme="${D}"]`)&&!G.includes(":root")&&!G.includes("html")?(console.warn(`[ThemeProvider] Theme CSS might be missing [data-theme="${D}"] selector`),console.warn("[ThemeProvider] CSS content preview:",G.substring(0,200))):console.log(`[ThemeProvider] ✅ CSS file loaded for theme "${D}" (${G.length} chars)`),G}catch(L){throw console.error(`[ThemeProvider] Error loading theme ${D}:`,L),L}},[r]);l.useCallback(D=>{const M=y.current.get(D);M&&(M.parentNode&&M.parentNode.removeChild(M),y.current.delete(D))},[]);const j=l.useCallback((D,M)=>{if(typeof document>"u")return;!M.includes(`[data-theme="${D}"]`)&&!M.includes(":root")&&console.warn(`[ThemeProvider] CSS might be missing [data-theme="${D}"] selector:`,M.substring(0,200)),document.querySelectorAll("style[data-theme-styles]").forEach(H=>H.remove()),y.current.clear();const T=document.createElement("style");T.setAttribute("data-theme-id",D),T.setAttribute("data-theme-styles","active"),T.textContent=M,document.head.appendChild(T),y.current.set(D,T),document.querySelector(`style[data-theme-id="${D}"]`)?console.log(`[ThemeProvider] ✅ CSS injected for theme "${D}" (${M.length} chars)`):console.error(`[ThemeProvider] ❌ Failed to inject CSS for theme "${D}"`),T.offsetHeight},[]),C=l.useCallback(D=>{if(typeof document>"u")return;const M=document.documentElement;M.setAttribute("data-theme",D);const P=M.getAttribute("data-theme");P!==D?console.warn(`[ThemeProvider] Failed to apply theme attribute. Expected: ${D}, Got: ${P}`):console.log(`[ThemeProvider] ✅ Theme attribute applied: data-theme="${D}"`);try{localStorage.setItem("waka-theme",D)}catch(T){console.warn("[ThemeProvider] Could not save theme to localStorage:",T)}},[]),N=l.useCallback(async D=>{if(!v.current.has(D))try{if(r){const M=await p(D);j(D,M),u(P=>new Set(P).add(D))}else u(M=>new Set(M).add(D))}catch(M){throw console.error(`[ThemeProvider] Failed to preload theme ${D}:`,M),M}},[r,p,j]),S=l.useCallback(async D=>{console.log(`[ThemeProvider] changeTheme called with themeId: ${D}`),d(!0);try{if(r){console.log(`[ThemeProvider] Loading theme from S3: ${D}`);const M=await p(D);console.log(`[ThemeProvider] CSS loaded, length: ${M.length}`),j(D,M),u(P=>new Set(P).add(D)),await new Promise(P=>requestAnimationFrame(P))}else console.log("[ThemeProvider] No S3 config, applying theme directly");console.log(`[ThemeProvider] Applying theme attribute: ${D}`),C(D),c(D),console.log(`[ThemeProvider] ✅ Theme changed successfully to: ${D}`),n?.(D)}catch(M){console.error(`[ThemeProvider] ❌ Failed to change theme to ${D}:`,M);try{C(D),c(D)}catch(P){console.error("[ThemeProvider] ❌ Fallback also failed:",P)}throw M}finally{d(!1)}},[r,p,j,C,n]),A=l.useCallback(D=>x.has(D),[x]);l.useEffect(()=>{if(f)return;(async()=>{d(!0);try{let M=s;if(typeof window<"u"){const P=localStorage.getItem("waka-theme");P&&a.some(T=>T.id===P)&&(M=P)}if(r){const P=await p(M);j(M,P),u(new Set([M])),await new Promise(T=>requestAnimationFrame(T))}else u(new Set([M]));C(M),c(M)}catch(M){console.error("[ThemeProvider] Error initializing:",M),C(s),c(s),u(new Set([s]))}finally{d(!1),w(!0)}})()},[f,s,a,r,p,j,C]);const R=l.useCallback(()=>{o&&b(D=>{const M=!D,P=document.documentElement;M?P.classList.add("dark"):P.classList.remove("dark");try{localStorage.setItem("waka-dark-mode",M?"dark":"light")}catch(T){console.warn("[ThemeProvider] Could not save dark mode to localStorage:",T)}return M})},[o]);l.useEffect(()=>{if(!o||typeof window>"u")return;let D=!1;try{const q=localStorage.getItem("waka-dark-mode");q!==null?D=q==="dark":(D=window.matchMedia("(prefers-color-scheme: dark)").matches,localStorage.setItem("waka-dark-mode",D?"dark":"light"))}catch(q){console.warn("[ThemeProvider] Could not read dark mode from localStorage:",q)}b(D);const M=document.documentElement;D?M.classList.add("dark"):M.classList.remove("dark");const P=window.matchMedia("(prefers-color-scheme: dark)"),T=q=>{try{localStorage.getItem("waka-dark-mode")||(b(q.matches),q.matches?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),localStorage.setItem("waka-dark-mode",q.matches?"dark":"light"))}catch{}};return P.addEventListener("change",T),()=>{P.removeEventListener("change",T)}},[]),l.useEffect(()=>()=>{y.current.forEach(D=>{D.parentNode&&D.parentNode.removeChild(D)}),y.current.clear()},[]);const E={currentTheme:i,themes:a,changeTheme:S,isLoading:m,loadedThemes:x,preloadTheme:N,isThemeLoaded:A,isDarkMode:k,toggleDarkMode:R};return e.jsx(Hi.Provider,{value:E,children:t})}function nx(t,a){if(!a||typeof a!="object")throw console.error(`[ThemeProvider] Invalid JSON data for theme "${t}":`,a),new Error(`Invalid JSON data for theme "${t}"`);let s={};if(a.cssVars||a["css-vars"])s=a.cssVars||a["css-vars"],console.log(`[ThemeProvider] Using cssVars/css-vars format for theme "${t}"`);else if(a.variables)s=a.variables,console.log(`[ThemeProvider] Using variables format for theme "${t}"`);else if(typeof a=="object"&&a!==null){const b=["label","description","author","previewColor","version","createdAt","changelog","id"];s=Object.fromEntries(Object.entries(a).filter(([y])=>!b.includes(y))),console.log(`[ThemeProvider] Using direct object format for theme "${t}"`)}if(!s||Object.keys(s).length===0)throw console.error(`[ThemeProvider] No CSS variables found in JSON for theme "${t}":`,a),new Error(`No CSS variables found in JSON for theme "${t}"`);console.log(`[ThemeProvider] Found ${Object.keys(s).length} CSS variables for theme "${t}"`);const r=(b,y)=>{if(typeof b=="string")return b;if(typeof b=="number"||typeof b=="boolean")return String(b);if(b==null)return"none";if(typeof b=="object"){if(Array.isArray(b))return b.map(p=>r(p,y)).join(" ");if(console.log(`[ThemeProvider] Converting object value for key "${y}":`,JSON.stringify(b,null,2)),("r"in b||"R"in b)&&("g"in b||"G"in b)&&("b"in b||"B"in b)){const p=b.r??b.R??0,j=b.g??b.G??0,C=b.b??b.B??0,N=b.a??b.A??b.alpha??b.opacity;return N!=null?`rgba(${p}, ${j}, ${C}, ${N})`:`rgb(${p}, ${j}, ${C})`}if(("h"in b||"H"in b)&&("s"in b||"S"in b)&&("l"in b||"L"in b)){const p=b.h??b.H??0,j=b.s??b.S??0,C=b.l??b.L??0,N=b.a??b.A??b.alpha??b.opacity;return N!=null?`hsla(${p}, ${j}%, ${C}%, ${N})`:`hsl(${p}, ${j}%, ${C}%)`}return Object.keys(b).length>0?(console.warn(`[ThemeProvider] Object value for "${y}" has nested structure, cannot convert to CSS:`,b),JSON.stringify(b)):"none"}return console.warn(`[ThemeProvider] Unknown value type for "${y}":`,typeof b,b),String(b)},n=(b,y="")=>{const v=[];for(const[p,j]of Object.entries(b))if(typeof j=="object"&&j!==null&&!Array.isArray(j))if(("r"in j||"R"in j||"h"in j||"H"in j)&&("g"in j||"G"in j||"s"in j||"S"in j)){const N=y?`--${y}-${p}`:p.startsWith("--")?p:`--${p}`,S=r(j,p);v.push(` ${N}: ${S};`)}else{const N=y?`${y}-${p}`:"",S=n(j,N);v.push(...S)}else{const C=y?`--${y}-${p}`:p.startsWith("--")?p:`--${p}`,N=r(j,p);v.push(` ${C}: ${N};`)}return v},o=s.light,i=s.dark,c=s.theme,m=Object.fromEntries(Object.entries(s).filter(([b])=>!["light","dark","theme"].includes(b))),d=[];c&&typeof c=="object"&&!Array.isArray(c)&&d.push(...n(c,"")),Object.keys(m).length>0&&d.push(...n(m,""));const x=o&&typeof o=="object"&&!Array.isArray(o)?n(o,""):[],u=i&&typeof i=="object"&&!Array.isArray(i)?n(i,""):[];let f="";if(d.length>0||x.length>0){const b=[...d,...x];f+=`[data-theme="${t}"] {
|
|
4
|
+
${b.join(`
|
|
5
5
|
`)}
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
`}
|
|
8
|
+
`}u.length>0&&(f+=`[data-theme="${t}"].dark,
|
|
9
9
|
[data-theme="${t}"][data-theme-mode="dark"] {
|
|
10
|
-
${
|
|
10
|
+
${u.join(`
|
|
11
11
|
`)}
|
|
12
|
-
}`);const k=y.trim();if(k.trim().length===0)throw console.error(`[ThemeProvider] No CSS variables generated for theme "${t}"`),new Error(`No CSS variables found in JSON for theme "${t}"`);const S=k;if(!S.includes(`[data-theme="${t}"]`))throw console.error(`[ThemeProvider] Generated CSS is missing the selector for theme "${t}"`),console.error("[ThemeProvider] Generated CSS:",S),new Error(`Generated CSS is missing the required selector [data-theme="${t}"]`);return S.length<50&&console.warn(`[ThemeProvider] Generated CSS seems too short for theme "${t}":`,S),console.log(`[ThemeProvider] ✅ Generated valid CSS for theme "${t}" with ${Object.keys(r).length} variables`),S}function ga(){const t=i.useContext(Po);if(!t)throw new Error("useTheme must be used within a ThemeProvider");return t}const Mo=i.forwardRef(({className:t,variant:a="default",ariaLabel:r="Select theme"},s)=>{const{currentTheme:n,changeTheme:o,themes:d,isLoading:u}=ga(),[h,m]=i.useState(!1),[v,f]=i.useState(!1),y=i.useRef(null),k=i.useRef(null);i.useEffect(()=>{f(!0)},[]);const S=async(b,l)=>{l&&(l.preventDefault(),l.stopPropagation());try{console.log(`[ThemeSelector] Changing theme to: ${b}`),await o(b),console.log(`[ThemeSelector] ✅ Theme changed to: ${b}`)}catch(c){console.error(`[ThemeSelector] ❌ Failed to change theme to ${b}:`,c)}a==="compact"&&setTimeout(()=>m(!1),100)},[g,w]=i.useState({top:0,right:0});if(i.useEffect(()=>{if(h&&y.current&&v){const b=y.current.getBoundingClientRect();w({top:b.bottom+8,right:window.innerWidth-b.right})}},[h,v]),a==="compact"){const b=h&&v?e.jsxs("div",{ref:k,className:"fixed z-[9999] min-w-[220px] rounded-md border border-border bg-popover text-popover-foreground p-2 shadow-lg",style:{top:`${g.top}px`,right:`${g.right}px`},onMouseDown:l=>{l.stopPropagation()},children:[e.jsx("div",{className:"px-2 py-1.5 border-b border-border mb-2",children:e.jsxs("div",{className:"text-xs font-medium text-muted-foreground flex items-center justify-between",children:[e.jsx("span",{children:"Thèmes"}),u&&e.jsx(E.Loader2,{className:"h-3 w-3 animate-spin"})]})}),u&&d.length===0?e.jsxs("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:[e.jsx(E.Loader2,{className:"h-4 w-4 mr-2 animate-spin"}),"Chargement..."]}):e.jsxs("div",{className:"grid gap-1",children:[d.map(l=>e.jsxs("button",{onMouseDown:c=>{c.preventDefault(),c.stopPropagation(),S(l.id,c)},type:"button",className:j("flex items-center gap-3 rounded-sm px-2 py-2 text-sm hover:bg-accent hover:text-accent-foreground transition-colors cursor-pointer",n===l.id&&"bg-accent"),children:[l.previewColor&&e.jsx("div",{className:"h-4 w-4 rounded border border-border shrink-0",style:{backgroundColor:l.previewColor}}),e.jsx("span",{className:"flex-1 text-left",children:l.label}),n===l.id&&e.jsx(E.Check,{className:"h-4 w-4 shrink-0"})]},l.id)),d.length===0&&!u&&e.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Aucun thème disponible"})]}),e.jsx("div",{className:"px-2 py-1.5 border-t border-border mt-2",children:e.jsxs("div",{className:"text-xs text-muted-foreground",children:[d.length," thème",d.length>1?"s":""," disponible",d.length>1?"s":""]})})]}):null;return e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:s,className:j("relative",t),children:e.jsxs("button",{ref:y,onMouseDown:l=>{l.preventDefault(),l.stopPropagation()},onClick:l=>{l.preventDefault(),l.stopPropagation(),m(!h)},className:"flex h-9 w-9 items-center justify-center rounded-md border border-input bg-transparent hover:bg-accent hover:text-accent-foreground relative",title:"Changer de thème",type:"button",children:[e.jsx(E.Palette,{className:"h-4 w-4"}),u&&e.jsx(E.Loader2,{className:"h-3 w-3 absolute top-1 right-1 animate-spin text-primary"}),e.jsx("span",{className:"sr-only",children:r})]})}),v&&typeof document<"u"&&b&&Ka.createPortal(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-[9998]",onMouseDown:l=>{l.preventDefault(),m(!1)}}),b]}),document.body)]})}if(a==="select"){const b=d.find(l=>l.id===n);return e.jsx("div",{ref:s,className:j("w-full",t),children:e.jsxs(ut,{value:n,onValueChange:async l=>{try{console.log(`[ThemeSelector] Changing theme to: ${l}`),await o(l),console.log(`[ThemeSelector] ✅ Theme changed to: ${l}`)}catch(c){console.error(`[ThemeSelector] ❌ Failed to change theme to ${l}:`,c)}},disabled:u||d.length===0,children:[e.jsx(rt,{className:"w-full","aria-label":r,children:e.jsx(mt,{children:u&&d.length===0?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(E.Loader2,{className:"h-4 w-4 animate-spin"}),e.jsx("span",{children:"Chargement..."})]}):b?e.jsxs("span",{className:"flex items-center gap-3",children:[b.previewColor&&e.jsx("div",{className:"h-4 w-4 rounded border border-border shrink-0",style:{backgroundColor:b.previewColor}}),e.jsx("span",{className:"truncate",children:b.label})]}):e.jsx("span",{className:"text-muted-foreground",children:"Sélectionner un thème"})})}),e.jsxs(st,{children:[d.map(l=>e.jsx(Qe,{value:l.id,className:"cursor-pointer",children:e.jsxs("div",{className:"flex items-center gap-3 w-full",children:[l.previewColor&&e.jsx("div",{className:"h-4 w-4 rounded border border-border shrink-0",style:{backgroundColor:l.previewColor}}),e.jsx("span",{className:"flex-1 text-left truncate",children:l.label})]})},l.id)),d.length===0&&!u&&e.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Aucun thème disponible"})]})]})})}return e.jsx("div",{ref:s,className:j("grid gap-4",t),children:u&&d.length===0?e.jsxs("div",{className:"flex items-center justify-center py-12 text-sm text-muted-foreground",children:[e.jsx(E.Loader2,{className:"h-5 w-5 mr-2 animate-spin"}),"Chargement des thèmes..."]}):e.jsxs(e.Fragment,{children:[d.map(b=>e.jsxs("button",{onClick:async l=>{l.preventDefault(),l.stopPropagation(),await S(b.id,l)},type:"button",className:j("relative flex flex-col items-start gap-2 rounded-lg border-2 p-4 text-left transition-all hover:border-primary",n===b.id?"border-primary bg-primary/5":"border-muted"),children:[e.jsxs("div",{className:"flex w-full items-center justify-between",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"font-semibold",children:b.label}),b.description&&e.jsx("span",{className:"text-sm text-muted-foreground",children:b.description})]}),n===b.id&&e.jsx(E.Check,{className:"h-5 w-5 text-primary shrink-0"})]}),b.previewColor&&e.jsx("div",{className:"flex gap-2 w-full",children:e.jsx("div",{className:"h-8 w-full rounded border",style:{backgroundColor:b.previewColor}})})]},b.id)),d.length===0&&!u&&e.jsx("div",{className:"py-12 text-center text-sm text-muted-foreground",children:"Aucun thème disponible"})]})})});Mo.displayName="ThemeSelector";const Ro=qe.Provider,Wr=i.forwardRef(({className:t,...a},r)=>e.jsx(qe.Viewport,{ref:r,className:j("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",t),...a}));Wr.displayName=qe.Viewport.displayName;const jh=De.cva("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Hr=i.forwardRef(({className:t,variant:a,...r},s)=>e.jsx(qe.Root,{ref:s,className:j(jh({variant:a}),t),...r}));Hr.displayName=qe.Root.displayName;const $o=i.forwardRef(({className:t,...a},r)=>e.jsx(qe.Action,{ref:r,className:j("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",t),...a}));$o.displayName=qe.Action.displayName;const qr=i.forwardRef(({className:t,...a},r)=>e.jsx(qe.Close,{ref:r,className:j("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...a,children:e.jsx(E.X,{className:"h-4 w-4"})}));qr.displayName=qe.Close.displayName;const Ur=i.forwardRef(({className:t,...a},r)=>e.jsx(qe.Title,{ref:r,className:j("text-sm font-semibold",t),...a}));Ur.displayName=qe.Title.displayName;const Br=i.forwardRef(({className:t,...a},r)=>e.jsx(qe.Description,{ref:r,className:j("text-sm opacity-90",t),...a}));Br.displayName=qe.Description.displayName;const Nh=1,Sh=1e6;let Ga=0;function kh(){return Ga=(Ga+1)%Number.MAX_SAFE_INTEGER,Ga.toString()}const Xa=new Map,Ls=t=>{if(Xa.has(t))return;const a=setTimeout(()=>{Xa.delete(t),aa({type:"REMOVE_TOAST",toastId:t})},Sh);Xa.set(t,a)},Ao=(t,a)=>{switch(a.type){case"ADD_TOAST":return{...t,toasts:[a.toast,...t.toasts].slice(0,Nh)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(r=>r.id===a.toast.id?{...r,...a.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=a;return r?Ls(r):t.toasts.forEach(s=>{Ls(s.id)}),{...t,toasts:t.toasts.map(s=>s.id===r||r===void 0?{...s,open:!1}:s)}}case"REMOVE_TOAST":return a.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(r=>r.id!==a.toastId)}}},Ta=[];let Ea={toasts:[]};function aa(t){Ea=Ao(Ea,t),Ta.forEach(a=>{a(Ea)})}function Fo({...t}){const a=kh(),r=n=>aa({type:"UPDATE_TOAST",toast:{...n,id:a}}),s=()=>aa({type:"DISMISS_TOAST",toastId:a});return aa({type:"ADD_TOAST",toast:{...t,id:a,open:!0,onOpenChange:n=>{n||s()}}}),{id:a,dismiss:s,update:r}}function Gr(){const[t,a]=i.useState(Ea);return i.useEffect(()=>(Ta.push(a),()=>{const r=Ta.indexOf(a);r>-1&&Ta.splice(r,1)}),[t]),{...t,toast:Fo,dismiss:r=>aa({type:"DISMISS_TOAST",toastId:r})}}function Ch(){const{toasts:t}=Gr();return e.jsxs(Ro,{children:[t.map(function({id:a,title:r,description:s,action:n,...o}){return e.jsxs(Hr,{...o,children:[e.jsxs("div",{className:"grid gap-1",children:[r&&e.jsx(Ur,{children:r}),s&&e.jsx(Br,{children:s})]}),n,e.jsx(qr,{})]},a)}),e.jsx(Wr,{})]})}const Lo=De.cva("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}}),Io=i.forwardRef(({className:t,variant:a,size:r,...s},n)=>e.jsx(Vs.Root,{ref:n,className:j(Lo({variant:a,size:r,className:t})),...s}));Io.displayName=Vs.Root.displayName;const sr=fa.Provider,nr=fa.Root,or=fa.Trigger,Ma=i.forwardRef(({className:t,sideOffset:a=4,...r},s)=>e.jsx(fa.Content,{ref:s,sideOffset:a,className:j("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r}));Ma.displayName=fa.Content.displayName;const Oo=De.cva("",{variants:{variant:{default:"text-foreground",muted:"text-muted-foreground",destructive:"text-destructive",success:"text-green-600 dark:text-green-400",warning:"text-amber-600 dark:text-amber-400",link:"text-primary underline-offset-4 hover:underline"},size:{xs:"text-xs",sm:"text-sm",base:"text-base",lg:"text-lg",xl:"text-xl"},weight:{normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"},align:{left:"text-left",center:"text-center",right:"text-right",justify:"text-justify"}},defaultVariants:{variant:"default",size:"base",weight:"normal",align:"left"}}),_o=i.forwardRef(({className:t,variant:a,size:r,weight:s,align:n,asChild:o=!1,truncate:d=!1,...u},h)=>{const m=o?$a.Slot:"p";return e.jsx(m,{className:j(Oo({variant:a,size:r,weight:s,align:n}),d&&"truncate",t),ref:h,...u})});_o.displayName="Text";const zo=De.cva("font-bold tracking-tight",{variants:{level:{h1:"text-4xl lg:text-5xl",h2:"text-3xl lg:text-4xl",h3:"text-2xl lg:text-3xl",h4:"text-xl lg:text-2xl",h5:"text-lg lg:text-xl",h6:"text-base lg:text-lg"},variant:{default:"text-foreground",gradient:"bg-gradient-to-r from-primary to-primary/60 bg-clip-text text-transparent",muted:"text-muted-foreground"}},defaultVariants:{level:"h2",variant:"default"}}),Vo=i.forwardRef(({className:t,level:a="h2",variant:r,asChild:s=!1,...n},o)=>{const d=s?$a.Slot:a;return e.jsx(d,{className:j(zo({level:a,variant:r}),t),ref:o,...n})});Vo.displayName="Heading";const Wo=De.cva("mt-6 border-l-4 pl-6 italic",{variants:{variant:{default:"border-border text-muted-foreground",primary:"border-primary text-foreground",success:"border-green-500 text-green-900 dark:text-green-100",warning:"border-amber-500 text-amber-900 dark:text-amber-100",destructive:"border-destructive text-destructive"}},defaultVariants:{variant:"default"}}),Ho=i.forwardRef(({className:t,variant:a,author:r,cite:s,children:n,...o},d)=>e.jsxs("figure",{className:"my-6",children:[e.jsx("blockquote",{className:j(Wo({variant:a}),t),cite:s,ref:d,...o,children:n}),r&&e.jsxs("figcaption",{className:"mt-2 text-sm text-muted-foreground",children:["— ",r]})]}));Ho.displayName="Blockquote";De.cva("relative rounded font-mono",{variants:{variant:{inline:"bg-muted px-[0.3rem] py-[0.2rem] text-xs sm:text-sm",block:"block bg-muted overflow-x-auto"},size:{sm:"text-xs sm:text-sm",base:"text-sm sm:text-base",lg:"text-base sm:text-lg"}},defaultVariants:{variant:"inline",size:"base"}});const qo=De.cva("inline-flex items-center justify-center rounded border border-border bg-muted px-2 py-1 font-mono text-xs font-medium text-muted-foreground shadow-sm",{variants:{size:{sm:"h-5 min-w-[1.25rem] text-[0.625rem]",default:"h-6 min-w-[1.5rem] text-xs",lg:"h-7 min-w-[1.75rem] text-sm"}},defaultVariants:{size:"default"}}),Uo=i.forwardRef(({className:t,size:a,...r},s)=>e.jsx("kbd",{className:j(qo({size:a}),t),ref:s,...r}));Uo.displayName="Kbd";const Th=De.cva("flex items-center",{variants:{variant:{default:"gap-2 p-3 rounded-lg border bg-card shadow-sm",minimal:"gap-2",pills:"gap-2 p-2 rounded-full border bg-muted/30",inline:"gap-1.5 text-sm",compact:"gap-1.5 p-2 rounded-md bg-muted/50"}},defaultVariants:{variant:"default"}}),Eh=De.cva("justify-between gap-2 transition-all",{variants:{variant:{default:"h-9 border-primary/50",minimal:"h-8 border-0 shadow-none hover:bg-accent",pills:"h-8 rounded-full px-4",inline:"h-7 text-sm border-0 shadow-none p-0 hover:bg-transparent hover:underline",compact:"h-7 text-xs px-2"}},defaultVariants:{variant:"default"}}),Ph={partner:E.Building2,network:E.Network,customer:E.Users},Dh={partner:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",network:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200",customer:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200"},Ja={partner:"Partenaire",network:"Réseau",customer:"Client"},Bo=i.forwardRef(({type:t,items:a,selected:r,isLoading:s,onSelect:n,placeholder:o,emptyText:d,showIcon:u,showBadge:h,variant:m},v)=>{const[f,y]=i.useState(!1),[k,S]=i.useState(""),g=Ph[t],w=i.useMemo(()=>k?a.filter(c=>c.name.toLowerCase().includes(k.toLowerCase())):a,[a,k]),b=c=>{n(c),y(!1),S("")},l=c=>{c.stopPropagation(),n({id:"",name:"",type:t}),S("")};return e.jsxs(xt,{open:f,onOpenChange:y,children:[e.jsx(vt,{asChild:!0,children:e.jsxs(O,{ref:v,variant:m==="inline"?"ghost":"outline",role:"combobox","aria-expanded":f,className:j(Eh({variant:m}),r?.id?"border-primary/50":""),disabled:s||a.length===0,children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[u&&g&&e.jsx(g,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"truncate",children:r?.name||o||Ja[t]}),h&&r?.id&&e.jsx(He,{variant:"secondary",className:j("text-xs",Dh[t]),children:t})]}),r?.id?e.jsx(E.X,{className:"h-3 w-3 shrink-0 opacity-50 hover:opacity-100",onClick:l}):e.jsx(E.ChevronRight,{className:"h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(dt,{className:"w-[300px] p-0",align:"start",children:e.jsxs(_t,{shouldFilter:!1,children:[e.jsxs("div",{className:"flex items-center border-b px-3 py-2 bg-muted/50",children:[e.jsx(E.Search,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(oa,{placeholder:`Rechercher ${Ja[t].toLowerCase()}...`,value:k,onValueChange:S,className:"border-0 focus:ring-0"})]}),e.jsxs(kr,{children:[e.jsx(ia,{children:d||`Aucun ${Ja[t].toLowerCase()} trouvé`}),e.jsx(la,{children:w.map(c=>e.jsx(ca,{value:c.id,onSelect:()=>b(c),className:"cursor-pointer",children:e.jsxs("div",{className:"flex items-center gap-2 w-full",children:[u&&g&&e.jsx(g,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"flex-1 truncate",children:c.name}),c.metadata?.count!==void 0&&e.jsx(He,{variant:"secondary",className:"text-xs",children:c.metadata.count})]})},c.id))})]})]})})]})});Bo.displayName="AdmincrumbSelector";const Go=i.forwardRef(({levels:t,separator:a,className:r,onLevelChange:s,showIcons:n=!0,showBadges:o=!1,showHome:d=!1,maxWidth:u="100%",variant:h="default",resetable:m=!1,onReset:v},f)=>{const y=g=>w=>{s?.(g,w)},k=t.some(g=>g.selected?.id),S=m&&k&&v;return e.jsxs("nav",{ref:f,"aria-label":"Fil d'Ariane administrateur",className:j("flex items-center gap-2",r),style:{maxWidth:u},children:[e.jsxs("div",{className:j(Th({variant:h}),"overflow-x-auto"),children:[d&&e.jsxs(e.Fragment,{children:[e.jsx(O,{variant:h==="inline"?"ghost":"outline",size:h==="compact"?"sm":"default",className:j(h==="inline"&&"h-7 px-2",h==="compact"&&"h-7 px-2"),onClick:()=>v?.(),children:e.jsx(E.Home,{className:"h-4 w-4"})}),e.jsx(E.ChevronRight,{className:"h-4 w-4 text-muted-foreground shrink-0","aria-hidden":"true"})]}),e.jsx("ol",{className:"flex items-center gap-2 list-none p-0 m-0",children:t.map((g,w)=>e.jsxs("li",{className:"flex items-center gap-2",children:[w>0&&e.jsx(e.Fragment,{children:a||e.jsx(E.ChevronRight,{className:j("text-muted-foreground shrink-0",h==="compact"||h==="inline"?"h-3 w-3":"h-4 w-4"),"aria-hidden":"true"})}),e.jsx(Bo,{...g,onSelect:y(w),showIcon:n,showBadge:o,variant:h||"default"})]},`${g.type}-${w}`))}),S&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-px h-6 bg-border mx-1","aria-hidden":"true"}),e.jsxs(O,{variant:"ghost",size:h==="compact"?"sm":"default",onClick:v,className:j("gap-2",h==="compact"&&"h-7 px-2 text-xs"),children:[e.jsx(E.X,{className:"h-3 w-3"}),"Réinitialiser"]})]})]}),k&&!S&&e.jsxs(He,{variant:"secondary",className:"gap-1",children:[e.jsx(E.Filter,{className:"h-3 w-3"}),"Filtré"]})]})});Go.displayName="WakaAdmincrumb";function Mh(){const[t,a]=i.useState(),[r,s]=i.useState(),[n,o]=i.useState(),d=i.useCallback((h,m)=>{h===0?(a(m.id?m:void 0),s(void 0),o(void 0)):h===1?(s(m.id?m:void 0),o(void 0)):h===2&&o(m.id?m:void 0)},[]),u=i.useCallback(()=>{a(void 0),s(void 0),o(void 0)},[]);return{partner:t,network:r,customer:n,handleLevelChange:d,reset:u}}const Rh=({images:t,autoplay:a=!1,autoplayInterval:r=3e3,showIndicators:s=!0,showNavigation:n=!0,showThumbnails:o=!1,showFullscreen:d=!1,showDownload:u=!1,showShare:h=!1,showCounter:m=!1,showProgress:v=!1,transition:f="fade",layout:y="default",theme:k="auto",aspectRatio:S="16/9",maxHeight:g,className:w,imageClassName:b,indicatorClassName:l,navigationClassName:c,thumbnailClassName:p,overlayClassName:x,counterClassName:N,progressClassName:R,onImageChange:F,onImageClick:D,onFullscreenToggle:T,onDownload:P,onShare:L,onPlayPause:A,onThumbnailClick:V,onIndicatorClick:X,onNavigationClick:me,onKeyboardNavigation:se,onTouchStart:Y,onTouchEnd:H,onSwipeLeft:_,onSwipeRight:q,onSwipeUp:$,onSwipeDown:te,onLoadStart:Z,onLoadEnd:G,onError:Re,onReady:ve,onDestroy:Ne,loop:le=!0,pauseOnHover:Me=!0,pauseOnFocus:z=!0,pauseOnTouch:I=!0,keyboardNavigation:J=!0,touchNavigation:ce=!0,swipeThreshold:oe=50,animationDuration:de=300,preloadImages:Se=!0,lazyLoading:ye=!0,imageQuality:Oe="auto",placeholder:ht,errorImage:Ue,loadingSpinner:Be,emptyState:wt,customControls:Vt,customOverlay:Wt,customThumbnails:At,customIndicators:W,customNavigation:K,ariaLabel:Pe="Carrousel d'images",ariaLabelledBy:Ge,ariaDescribedBy:ba,role:ts="region",virtualScrolling:Oa=!1,maxVisibleThumbnails:_a=10,thumbnailSize:xa="medium",overlayOpacity:fi=.7,overlayGradient:hi,navigationSize:nt="medium",indicatorSize:jt="medium",indicatorShape:pt="circle",thumbnailAspectRatio:va="1/1",onMount:za,onUnmount:Va,onBeforeChange:tt,onAfterChange:Wa})=>{const[Xe,Ht]=C.useState(0),[Je,ot]=C.useState(a),[Nt,ya]=C.useState(!1),[as,Ha]=C.useState(!1),[wa,rs]=C.useState(!1),[qt,Ut]=C.useState(null),[pi,St]=C.useState(null),[Ye,ja]=C.useState(new Set),[Na,Sa]=C.useState(0),ne=C.useRef(null),B=C.useRef(null),we=C.useRef([]),$e=C.useRef(null),kt=C.useRef(0),ke=t&&t.length>0,Te=Math.max(0,Math.min(Xe,t.length-1)),re=ke?t[Te]:null,Ct=C.useMemo(()=>{switch(S){case"16/9":return"aspect-video";case"4/3":return"aspect-[4/3]";case"1/1":return"aspect-square";case"3/2":return"aspect-[3/2]";default:return"aspect-video"}},[S]),gt=C.useMemo(()=>k==="auto"?"":k==="dark"?"dark":"light",[k]),Bt=C.useCallback(()=>{ne.current&&clearInterval(ne.current),Je&&ke&&t.length>1&&(ne.current=setInterval(()=>{Ht(U=>le?(U+1)%t.length:Math.min(U+1,t.length-1))},r))},[Je,ke,t.length,r,le]),_e=C.useCallback(()=>{ne.current&&(clearInterval(ne.current),ne.current=null)},[]),ss=C.useCallback(()=>{if(!Je||!a)return;const U=Date.now(),ie=()=>{const Ft=(Date.now()-U)/r*100;Sa(Math.min(Ft,100)),Ft<100&&requestAnimationFrame(ie)};requestAnimationFrame(ie)},[Je,a,r]);C.useEffect(()=>(Je?(Bt(),ss()):(_e(),Sa(0)),()=>_e()),[Je,Bt,_e,ss]);const Gt=C.useCallback(()=>{if(!ke)return;const U=le?(Xe-1+t.length)%t.length:Math.max(Xe-1,0);tt&&!tt(Xe,U)||(Ht(U),me?.("prev"))},[ke,Xe,t.length,le,tt,me]),Xt=C.useCallback(()=>{if(!ke)return;const U=le?(Xe+1)%t.length:Math.min(Xe+1,t.length-1);tt&&!tt(Xe,U)||(Ht(U),me?.("next"))},[ke,Xe,t.length,le,tt,me]),ns=C.useCallback(U=>{!ke||U<0||U>=t.length||tt&&!tt(Xe,U)||(Ht(U),X?.(U))},[ke,Xe,t.length,tt,X]),gi=C.useCallback(U=>{if(!J)return;const ie=U.key;switch(se?.(ie),ie){case"ArrowLeft":U.preventDefault(),Gt();break;case"ArrowRight":U.preventDefault(),Xt();break;case"ArrowUp":U.preventDefault(),$?.();break;case"ArrowDown":U.preventDefault(),te?.();break;case" ":U.preventDefault(),ot(ze=>!ze),A?.(!Je);break;case"Escape":Nt&&(ya(!1),T?.(!1));break;case"f":case"F":d&&ya(ze=>(T?.(!ze),!ze));break}},[J,Gt,Xt,se,$,te,Je,A,Nt,d,T]),bi=C.useCallback(U=>{if(!ce)return;const ie=U.touches[0];Ut({x:ie.clientX,y:ie.clientY}),kt.current=Date.now(),Y?.(U),I&&ot(!1)},[ce,Y,I]),xi=C.useCallback(U=>{if(!ce||!qt)return;const ie=U.changedTouches[0];St({x:ie.clientX,y:ie.clientY}),H?.(U);const ze=ie.clientX-qt.x,Ft=ie.clientY-qt.y;Date.now()-kt.current,Math.abs(ze)>Math.abs(Ft)&&Math.abs(ze)>oe?ze>0?(q?.(),Gt()):(_?.(),Xt()):Math.abs(Ft)>oe&&(Ft>0?te?.():$?.()),Ut(null),St(null)},[ce,qt,H,oe,q,_,te,$,Gt,Xt]),vi=C.useCallback(U=>{ja(ie=>new Set([...ie,U])),Ha(!1),G?.(U)},[G]),yi=C.useCallback((U,ie)=>{rs(!0),Ha(!1),Re?.(U,ie)},[Re]);C.useEffect(()=>{re&&(F?.(Te,re),Wa?.(Te))},[Te,re,F,Wa]);const wi=C.useCallback(()=>{re&&D?.(re,Te)},[re,Te,D]),bt=C.useCallback(U=>{U.stopPropagation()},[]),ji=C.useCallback(()=>{ya(U=>(T?.(!U),!U))},[T]),Ni=C.useCallback(()=>{re&&P?.(re,Te)},[re,Te,P]),Si=C.useCallback(()=>{re&&L?.(re,Te)},[re,Te,L]),ki=C.useCallback(()=>{Me&&ot(!1)},[Me]),Ci=C.useCallback(()=>{Me&&a&&ot(!0)},[Me,a]),Ti=C.useCallback(()=>{z&&ot(!1)},[z]),Ei=C.useCallback(()=>{z&&a&&ot(!0)},[z,a]);if(C.useEffect(()=>(za?.(),ve?.(),()=>{Va?.(),Ne?.(),_e()}),[za,ve,Va,Ne,_e]),C.useEffect(()=>()=>_e(),[_e]),!ke)return e.jsx("div",{className:j("flex items-center justify-center h-64 bg-gray-100 rounded-lg",w),children:wt||e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-gray-500 mb-2",children:"Aucune image à afficher"}),e.jsx("p",{className:"text-sm text-gray-400",children:"Ajoutez des images pour commencer"})]})});const Pi=j("waka-carousel relative w-full mx-auto bg-black rounded-lg overflow-hidden","focus:outline-none focus:ring-2 focus:ring-blue-500",Nt&&"fixed inset-0 z-50 rounded-none",gt,w),Di=j("relative",Ct,b),Mi=j("absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-4",x);return e.jsxs("div",{ref:B,className:Pi,style:{maxHeight:g},tabIndex:0,onKeyDown:gi,onTouchStart:bi,onTouchEnd:xi,onMouseEnter:ki,onMouseLeave:Ci,onFocus:Ti,onBlur:Ei,role:ts,"aria-label":Pe,"aria-labelledby":Ge,"aria-describedby":ba,children:[e.jsxs("div",{className:Di,children:[as&&Be&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50 z-20",children:Be}),wa&&Ue?e.jsx("img",{src:Ue,alt:"Erreur de chargement",className:j("w-full h-full object-cover",b)}):re?e.jsx("img",{ref:U=>we.current[Te]=U,src:re.src,alt:re.alt,className:j("w-full h-full object-cover transition-opacity duration-300",b),onClick:wi,loading:ye?"lazy":"eager",onLoad:()=>vi(Te),onError:U=>yi(Te,new Error("Erreur de chargement de l'image"))}):null,re&&(re.title||re.description||re.caption)&&e.jsxs("div",{className:Mi,children:[re.title&&e.jsx("h3",{className:"text-white text-lg font-semibold mb-1",children:re.title}),re.description&&e.jsx("p",{className:"text-white/90 text-sm mb-2",children:re.description}),re.caption&&e.jsx("p",{className:"text-white/80 text-xs",children:re.caption})]}),Vt&&e.jsx("div",{className:"absolute inset-0 z-10",children:Vt}),Wt&&e.jsx("div",{className:"absolute inset-0 z-10",children:Wt}),n&&t.length>1&&e.jsx(e.Fragment,{children:K?e.jsx("div",{className:"absolute inset-0 z-10",children:K}):e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:U=>{bt(U),Gt()},className:j("absolute left-2 top-1/2 -translate-y-1/2 z-10","bg-black/50 hover:bg-black/70 text-white p-2 rounded-full","transition-all duration-200 hover:scale-110","focus:outline-none focus:ring-2 focus:ring-white",nt==="small"&&"p-1",nt==="large"&&"p-3",c),"aria-label":"Image précédente",children:e.jsx(E.ChevronLeft,{className:j("w-5 h-5",nt==="small"&&"w-4 h-4",nt==="large"&&"w-6 h-6")})}),e.jsx("button",{onClick:U=>{bt(U),Xt()},className:j("absolute right-2 top-1/2 -translate-y-1/2 z-10","bg-black/50 hover:bg-black/70 text-white p-2 rounded-full","transition-all duration-200 hover:scale-110","focus:outline-none focus:ring-2 focus:ring-white",nt==="small"&&"p-1",nt==="large"&&"p-3",c),"aria-label":"Image suivante",children:e.jsx(E.ChevronRight,{className:j("w-5 h-5",nt==="small"&&"w-4 h-4",nt==="large"&&"w-6 h-6")})})]})}),a&&t.length>1&&e.jsx("button",{onClick:U=>{bt(U),ot(ie=>(A?.(!ie),!ie))},className:j("absolute top-2 right-2 z-10","bg-black/50 hover:bg-black/70 text-white p-2 rounded-full","transition-all duration-200 hover:scale-110","focus:outline-none focus:ring-2 focus:ring-white"),"aria-label":Je?"Pause":"Lecture",children:Je?e.jsx(E.Pause,{className:"w-4 h-4"}):e.jsx(E.Play,{className:"w-4 h-4"})}),d&&e.jsx("button",{onClick:U=>{bt(U),ji()},className:j("absolute top-2 left-2 z-10","bg-black/50 hover:bg-black/70 text-white p-2 rounded-full","transition-all duration-200 hover:scale-110","focus:outline-none focus:ring-2 focus:ring-white"),"aria-label":Nt?"Quitter le plein écran":"Plein écran",children:Nt?e.jsx(E.X,{className:"w-4 h-4"}):e.jsx(E.Maximize2,{className:"w-4 h-4"})}),u&&re?.downloadUrl&&e.jsx("button",{onClick:U=>{bt(U),Ni()},className:j("absolute top-2 right-12 z-10","bg-black/50 hover:bg-black/70 text-white p-2 rounded-full","transition-all duration-200 hover:scale-110","focus:outline-none focus:ring-2 focus:ring-white"),"aria-label":"Télécharger l'image",children:e.jsx(E.Download,{className:"w-4 h-4"})}),h&&re?.shareUrl&&e.jsx("button",{onClick:U=>{bt(U),Si()},className:j("absolute top-2 right-20 z-10","bg-black/50 hover:bg-black/70 text-white p-2 rounded-full","transition-all duration-200 hover:scale-110","focus:outline-none focus:ring-2 focus:ring-white"),"aria-label":"Partager l'image",children:e.jsx(E.Share2,{className:"w-4 h-4"})}),m&&e.jsxs("div",{className:j("absolute top-2 left-1/2 -translate-x-1/2 z-10","bg-black/50 text-white px-3 py-1 rounded-full text-sm",N),children:[Te+1," / ",t.length]}),v&&Je&&e.jsx("div",{className:j("absolute bottom-0 left-0 right-0 h-1 bg-black/30",R),children:e.jsx("div",{ref:$e,className:"h-full bg-white transition-all duration-100",style:{width:`${Na}%`}})})]}),s&&t.length>1&&e.jsx("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 flex space-x-2",children:W?e.jsx("div",{className:"flex space-x-2",children:W}):t.map((U,ie)=>e.jsx("button",{onClick:ze=>{bt(ze),ns(ie)},className:j("transition-all duration-200","focus:outline-none focus:ring-2 focus:ring-white",pt==="circle"&&"rounded-full",pt==="square"&&"rounded",pt==="diamond"&&"rotate-45",pt==="line"&&"rounded-none",jt==="small"&&"w-2 h-2",jt==="medium"&&"w-3 h-3",jt==="large"&&"w-4 h-4",pt==="line"&&jt==="small"&&"w-8 h-1",pt==="line"&&jt==="medium"&&"w-12 h-1",pt==="line"&&jt==="large"&&"w-16 h-1",ie===Te?"bg-white":"bg-white/50 hover:bg-white/70",l),"aria-label":`Aller à l'image ${ie+1}`},ie))}),o&&t.length>1&&e.jsx("div",{className:"flex space-x-2 p-4 bg-gray-100 overflow-x-auto",children:At?e.jsx("div",{className:"flex space-x-2",children:At}):t.map((U,ie)=>e.jsx("button",{onClick:ze=>{bt(ze),ns(ie),V?.(ie)},className:j("flex-shrink-0 rounded overflow-hidden","border-2 transition-all duration-200","focus:outline-none focus:ring-2 focus:ring-blue-500",xa==="small"&&"w-12 h-12",xa==="medium"&&"w-16 h-16",xa==="large"&&"w-20 h-20",va==="1/1"&&"aspect-square",va==="4/3"&&"aspect-[4/3]",va==="16/9"&&"aspect-video",ie===Te?"border-blue-500":"border-gray-300 hover:border-gray-400",p),children:e.jsx("img",{src:U.src,alt:U.alt,className:"w-full h-full object-cover",loading:"lazy"})},ie))})]})};let Is=!1,ir=null;!Is&&!lt.isInitialized&&(Is=!0,ir=lt.use(et.initReactI18next).init({resources:{},fallbackLng:"fr",lng:"fr",defaultNS:"translation",ns:["translation"],debug:!1,interpolation:{escapeValue:!1},react:{useSuspense:!1},ignoreJSONStructure:!0,returnNull:!1,returnEmptyString:!1,returnObjects:!1,load:"languageOnly",detection:void 0,initImmediate:!0}).then(()=>(console.log("[i18n] Initialized successfully"),lt)).catch(t=>(console.error("[i18n] Failed to initialize:",t),lt)));function Xo(){const[t,a]=C.useState(lt.isInitialized);return C.useEffect(()=>{if(lt.isInitialized){a(!0);return}if(ir)ir.then(()=>{a(!0)});else{const r=setTimeout(()=>{a(!0)},100);return()=>clearTimeout(r)}},[]),!t||!lt.isInitialized?{t:r=>r,i18n:lt,ready:!1}:et.useTranslation()}ft.registerLocale("fr",Ot);ft.registerLocale("en",rn);ft.registerLocale("es",sn);ft.registerLocale("de",an);ft.registerLocale("it",nn);ft.registerLocale("pt",ln);ft.registerLocale("ja",on);ft.registerLocale("zh",cn);const Xr=i.forwardRef(({value:t,onChange:a,placeholder:r,disabled:s=!1,className:n,variant:o="date",format:d,minDate:u,maxDate:h,showSeconds:m=!1,showClear:v=!0,showPresets:f=!1,presets:y,locale:k="fr",timeFormat:S="24h",size:g="md",error:w,label:b,required:l=!1,inline:c=!1,monthsShown:p=1,timeIntervals:x=15,validation:N,showWeekNumbers:R=!1,showTodayButton:F=!0,showSelectionInfo:D=!1,allowTimeRange:T=!1,timezone:P,onBeforeChange:L,onAfterChange:A,renderDay:V,popoverClassName:X,disableAnimations:me=!1,readOnly:se=!1,id:Y,name:H,autoFocus:_=!1},q)=>{const{t:$}=Xo(),[te,Z]=i.useState(!1),[G,Re]=i.useState(o==="range"&&t&&!("from"in t)?{from:t,to:void 0}:t),[ve,Ne]=i.useState(null),[le,Me]=i.useState(null),I={fr:Ot,en:rn,es:sn,de:an,it:nn,pt:ln,ja:on,zh:cn}[k]||Ot,J=[{label:$?.("today")||"Aujourd'hui",value:()=>new Date},{label:$?.("yesterday")||"Hier",value:()=>M.subDays(new Date,1)},{label:$?.("thisWeek")||"Cette semaine",range:()=>({from:M.startOfWeek(new Date,{locale:I}),to:M.endOfWeek(new Date,{locale:I})})},{label:$?.("lastWeek")||"Semaine dernière",range:()=>({from:M.startOfWeek(M.subWeeks(new Date,1),{locale:I}),to:M.endOfWeek(M.subWeeks(new Date,1),{locale:I})})},{label:$?.("thisMonth")||"Ce mois",range:()=>({from:M.startOfMonth(new Date),to:M.endOfMonth(new Date)})},{label:$?.("lastMonth")||"Mois dernier",range:()=>({from:M.startOfMonth(M.subMonths(new Date,1)),to:M.endOfMonth(M.subMonths(new Date,1))})},{label:$?.("last7Days")||"7 derniers jours",range:()=>({from:M.subDays(new Date,7),to:new Date})},{label:$?.("last30Days")||"30 derniers jours",range:()=>({from:M.subDays(new Date,30),to:new Date})},{label:$?.("thisYear")||"Cette année",range:()=>({from:M.startOfYear(new Date),to:M.endOfYear(new Date)})}],ce=y||(f?J:[]),oe={sm:"h-8 px-3 text-xs",md:"h-10 px-4 text-sm",lg:"h-12 px-5 text-base"},Se=d||(()=>{switch(o){case"time":return m?S==="12h"?"h:mm:ss a":"HH:mm:ss":S==="12h"?"h:mm a":"HH:mm";case"datetime":return m?S==="12h"?"PPP h:mm:ss a":"PPP HH:mm:ss":S==="12h"?"PPP h:mm a":"PPP HH:mm";case"range":return"PPP";case"multiple":return"PPP";default:return"PPP"}})(),ye=W=>{if(!N)return null;if(u&&M.isBefore(W,M.startOfDay(u)))return $?.("dateBeforeMin")||`Date antérieure au ${M.format(u,Se,{locale:I})}`;if(h&&M.isAfter(W,M.endOfDay(h)))return $?.("dateAfterMax")||`Date postérieure au ${M.format(h,Se,{locale:I})}`;if(N.disabledDates?.some(K=>M.isEqual(M.startOfDay(K),M.startOfDay(W)))||N.disabledDatesFn?.(W))return N.message||$?.("dateDisabled")||"Date désactivée";if(N.disabledDaysOfWeek?.includes(W.getDay()))return N.message||$?.("dayOfWeekDisabled")||"Jour de la semaine désactivé";if(N.validate){const K=N.validate(W);if(K===!1)return N.message||$?.("invalidDate")||"Date invalide";if(typeof K=="string")return K}return null},Oe=W=>{if(se)return;let K=null;if(o==="range"){if(Array.isArray(W)&&W[0]&&W[1])K={from:W[0],to:W[1]};else if(W){const Pe=G;Pe?.from&&!Pe.to?K={from:Pe.from,to:W}:K={from:W,to:void 0}}}else if(o==="multiple")if(Array.isArray(G)){const Pe=[...G],Ge=Pe.findIndex(ba=>M.isEqual(M.startOfDay(ba),M.startOfDay(W)));Ge>=0?Pe.splice(Ge,1):Pe.push(W),K=Pe}else K=W?[W]:[];else K=W;if(!(L&&!L(K))){if(K&&!K.from&&!Array.isArray(K)){const Pe=ye(K);if(Pe){Ne(Pe);return}}Ne(null),Re(K),a?.(K),A?.(K),o!=="range"&&o!=="multiple"&&!c&&Z(!1)}},ht=W=>{if(W.range){const K=typeof W.range=="function"?W.range():W.range;Oe([K.from,K.to])}else if(W.value){const K=typeof W.value=="function"?W.value():W.value;Oe(K)}c||Z(!1)},Ue=W=>{W&&W.stopPropagation(),!se&&(Re(null),Ne(null),a?.(null),A?.(null))},Be=()=>{Oe(new Date)},wt=()=>{if(!G)return r||$?.("selectDate")||"Sélectionner une date";try{if(o==="range"){const W=G;return W.from&&W.to?`${M.format(W.from,Se,{locale:I})} - ${M.format(W.to,Se,{locale:I})}`:W.from?`${M.format(W.from,Se,{locale:I})} - ...`:r||$?.("selectDateRange")||"Sélectionner une période"}if(o==="multiple"){const W=G;return W.length===0?r||$?.("selectDates")||"Sélectionner des dates":W.length===1?M.format(W[0],Se,{locale:I}):`${W.length} ${$?.("datesSelected")||"dates sélectionnées"}`}return M.format(G,Se,{locale:I})}catch(W){return console.error("Error formatting date:",W),r||$?.("selectDate")||"Sélectionner une date"}},Vt=W=>!!(u&&M.isBefore(W,M.startOfDay(u))||h&&M.isAfter(W,M.endOfDay(h))||N?.disabledDates?.some(K=>M.isEqual(M.startOfDay(K),M.startOfDay(W)))||N?.disabledDatesFn?.(W)||N?.disabledDaysOfWeek?.includes(W.getDay())),Wt=W=>!!(N?.highlightedDates?.some(K=>M.isEqual(M.startOfDay(K),M.startOfDay(W)))||N?.highlightedDatesFn?.(W)),At=()=>{const W={selected:o==="range"?G?.from:o==="multiple"?void 0:G,onChange:Oe,startDate:o==="range"?G?.from:void 0,endDate:o==="range"?G?.to:void 0,selectsRange:o==="range",selectsMultiple:o==="multiple",highlightDates:o==="multiple"?G:void 0,showTimeSelect:o==="time"||o==="datetime",showTimeSelectOnly:o==="time",timeFormat:m?S==="12h"?"h:mm:ss aa":"HH:mm:ss":S==="12h"?"h:mm aa":"HH:mm",timeIntervals:x,timeCaption:$?.("time")||"Heure",dateFormat:Se,locale:k,placeholderText:r,disabled:s,minDate:u,maxDate:h,inline:c,monthsShown:o==="range"?Math.max(2,p):p,showWeekNumbers:R,filterDate:K=>!Vt(K),dayClassName:K=>{const Pe=[];if(Wt(K)&&Pe.push("highlighted-date"),le&&o==="range"){const Ge=G;Ge?.from&&!Ge.to&&M.isWithinInterval(K,{start:Ge.from<le?Ge.from:le,end:Ge.from>le?Ge.from:le})&&Pe.push("in-selecting-range")}return Pe.join(" ")},onDayMouseEnter:K=>Me(K),calendarClassName:j("waka-datepicker",me&&"no-animations"),wrapperClassName:"w-full",autoFocus:_};return e.jsxs("div",{className:"flex gap-3",children:[f&&ce.length>0&&e.jsxs("div",{className:"flex flex-col gap-1 min-w-[150px] border-r border-border pr-3",children:[e.jsx(ge,{className:"text-xs font-semibold text-muted-foreground mb-1",children:$?.("quickSelection")||"Sélection rapide"}),e.jsx(It,{className:"h-[300px]",children:e.jsx("div",{className:"space-y-1",children:ce.map((K,Pe)=>e.jsx(O,{variant:"ghost",size:"sm",className:"w-full justify-start text-xs",onClick:()=>ht(K),children:K.label},Pe))})})]}),e.jsxs("div",{className:"flex-1",children:[e.jsx(ft,{...W}),D&&G&&e.jsxs("div",{className:"mt-3 p-2 bg-muted rounded-md text-xs space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(E.Info,{className:"h-3 w-3 text-muted-foreground"}),e.jsxs("span",{className:"font-medium",children:[$?.("selection")||"Sélection"," :"]})]}),e.jsx("div",{className:"text-muted-foreground pl-5",children:wt()})]})]})]})};return c?e.jsxs("div",{ref:q,className:j("space-y-2",n),id:Y,children:[b&&e.jsxs(ge,{className:"text-sm font-medium text-foreground",children:[b,l&&e.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),e.jsx("div",{className:"border border-border rounded-lg p-4 bg-card",children:At()}),(w||ve)&&e.jsxs("div",{className:"flex items-center gap-1.5 text-sm text-destructive",children:[e.jsx(E.AlertCircle,{className:"h-3.5 w-3.5"}),e.jsx("span",{children:w||ve})]})]}):e.jsxs("div",{ref:q,className:j("space-y-2",n),id:Y,children:[b&&e.jsxs(ge,{htmlFor:`${Y}-input`,className:"text-sm font-medium text-foreground",children:[b,l&&e.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),e.jsxs(xt,{open:te,onOpenChange:Z,children:[e.jsx(vt,{asChild:!0,children:e.jsxs(O,{id:`${Y}-input`,name:H,variant:"outline",disabled:s||se,className:j("w-full justify-between text-left font-normal",!G&&"text-muted-foreground",oe[g],(w||ve)&&"border-destructive focus-visible:ring-destructive",se&&"cursor-default opacity-70"),"aria-label":b||r,"aria-invalid":!!(w||ve),"aria-required":l,children:[e.jsxs("span",{className:"flex items-center gap-2 flex-1 truncate",children:[o==="time"?e.jsx(E.Clock,{className:"h-4 w-4 flex-shrink-0"}):e.jsx(E.Calendar,{className:"h-4 w-4 flex-shrink-0"}),e.jsx("span",{className:"truncate",children:wt()})]}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0 ml-2",children:[G&&v&&!se&&e.jsx(sr,{children:e.jsxs(nr,{children:[e.jsx(or,{asChild:!0,children:e.jsx("div",{className:"h-5 w-5 rounded hover:bg-destructive/10 flex items-center justify-center cursor-pointer",onClick:Ue,role:"button","aria-label":$?.("clear")||"Effacer",children:e.jsx(E.X,{className:"h-3 w-3 text-muted-foreground hover:text-destructive"})})}),e.jsx(Ma,{children:e.jsx("p",{children:$?.("clear")||"Effacer"})})]})}),ve&&e.jsx(sr,{children:e.jsxs(nr,{children:[e.jsx(or,{asChild:!0,children:e.jsx(E.AlertCircle,{className:"h-4 w-4 text-destructive"})}),e.jsx(Ma,{children:e.jsx("p",{children:ve})})]})})]})]})}),e.jsxs(dt,{className:j("w-auto p-0",X),align:"start",sideOffset:4,children:[e.jsx("div",{className:"p-4",children:At()}),(F||v)&&e.jsxs(e.Fragment,{children:[e.jsx($t,{}),e.jsxs("div",{className:"flex items-center justify-between p-3 gap-2",children:[F&&e.jsxs(O,{variant:"outline",size:"sm",onClick:Be,disabled:s||se,children:[e.jsx(E.Calendar,{className:"h-3.5 w-3.5 mr-1.5"}),$?.("today")||"Aujourd'hui"]}),v&&G&&e.jsxs(O,{variant:"outline",size:"sm",onClick:Ue,disabled:s||se,className:"ml-auto",children:[e.jsx(E.X,{className:"h-3.5 w-3.5 mr-1.5"}),$?.("clear")||"Effacer"]})]})]})]})]}),(w||ve)&&e.jsxs("div",{className:"flex items-center gap-1.5 text-sm text-destructive",children:[e.jsx(E.AlertCircle,{className:"h-3.5 w-3.5"}),e.jsx("span",{children:w||ve})]})]})});Xr.displayName="WakaDateTimePicker";function $h({name:t,control:a,defaultValue:r,...s}){return e.jsx(_n,{name:t,control:a,defaultValue:r,render:({field:n,fieldState:o})=>e.jsx(Xr,{...s,value:n.value,onChange:n.onChange,error:o.error?.message})})}function Ah(t){return i.useMemo(()=>({formatDateForSubmit:r=>r?r.toISOString():null,formatRangeForSubmit:r=>!r?.from||!r?.to?null:{from:r.from.toISOString(),to:r.to.toISOString()},parseDateFromServer:r=>r?new Date(r):null,parseRangeFromServer:r=>r?{from:new Date(r.from),to:new Date(r.to)}:null}),[])}const Fh={info:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",success:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",warning:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",error:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"},Pa=i.forwardRef(({notification:t,onMarkAsRead:a,onDelete:r},s)=>{const n=o=>{const u=new Date().getTime()-o.getTime(),h=Math.floor(u/6e4),m=Math.floor(u/36e5),v=Math.floor(u/864e5);return h<1?"À l'instant":h<60?`Il y a ${h} min`:m<24?`Il y a ${m}h`:v<7?`Il y a ${v}j`:o.toLocaleDateString("fr-FR")};return e.jsxs("div",{ref:s,className:j("flex gap-3 p-4 hover:bg-muted/50 transition-colors border-l-4",t.read?"border-l-transparent opacity-60":"border-l-primary","relative group"),children:[e.jsx("div",{className:j("flex-shrink-0 w-10 h-10 rounded-full flex items-center justify-center",Fh[t.type]),children:t.icon||e.jsx(E.Bell,{className:"h-5 w-5"})}),e.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("h4",{className:j("text-sm font-semibold",t.read&&"font-normal"),children:t.title}),e.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:n(t.timestamp)})]}),e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:t.message}),t.action&&e.jsx(O,{variant:"link",size:"sm",className:"h-auto p-0 text-primary",onClick:t.action.onClick,children:t.action.label})]}),e.jsxs("div",{className:"flex-shrink-0 flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[!t.read&&a&&e.jsxs(O,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>a(t.id),children:[e.jsx(E.Check,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Marquer comme lu"})]}),r&&e.jsxs(O,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive",onClick:()=>r(t.id),children:[e.jsx(E.Trash2,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Supprimer"})]})]})]})});Pa.displayName="NotificationItem";const Jo=i.forwardRef(({notifications:t,onMarkAsRead:a,onMarkAllAsRead:r,onDelete:s,onDeleteAll:n,onSettingsClick:o,maxHeight:d="400px",className:u,iconClassName:h,badgeClassName:m,showBadge:v=!0,showTabs:f=!0,emptyMessage:y="Aucune notification",emptyIcon:k},S)=>{const[g,w]=i.useState(!1),[b,l]=i.useState("all"),c=t.filter(N=>!N.read).length,p=i.useMemo(()=>b==="all"?t:b==="unread"?t.filter(N=>!N.read):t,[t,b]),x=()=>e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 px-4 text-center",children:[k||e.jsx(E.Bell,{className:"h-12 w-12 text-muted-foreground/50 mb-4"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:y})]});return e.jsxs(xt,{open:g,onOpenChange:w,children:[e.jsx(vt,{asChild:!0,children:e.jsxs(O,{ref:S,variant:"ghost",size:"icon",className:j("relative",u),children:[e.jsx(E.Bell,{className:j("h-5 w-5",h)}),v&&c>0&&e.jsx(He,{variant:"destructive",className:j("absolute -top-1 -right-1 h-5 min-w-[20px] flex items-center justify-center p-0 text-xs",m),children:c>99?"99+":c}),e.jsxs("span",{className:"sr-only",children:["Notifications (",c," non lues)"]})]})}),e.jsxs(dt,{className:"w-[380px] p-0",align:"end",sideOffset:8,children:[e.jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-base",children:"Notifications"}),c>0&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[c," non ",c>1?"lues":"lue"]})]}),e.jsxs("div",{className:"flex gap-1",children:[r&&c>0&&e.jsxs(O,{variant:"ghost",size:"sm",className:"h-8 text-xs",onClick:r,children:[e.jsx(E.Check,{className:"h-3 w-3 mr-1"}),"Tout marquer"]}),o&&e.jsxs(O,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:o,children:[e.jsx(E.Settings,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Paramètres"})]})]})]}),f&&t.length>0&&e.jsxs(Vr,{value:b,onValueChange:l,className:"w-full",children:[e.jsxs(Ia,{className:"w-full rounded-none border-b bg-transparent p-0",children:[e.jsxs(da,{value:"all",className:"flex-1 rounded-none data-[state=active]:border-b-2 data-[state=active]:border-primary",children:["Toutes (",t.length,")"]}),e.jsxs(da,{value:"unread",className:"flex-1 rounded-none data-[state=active]:border-b-2 data-[state=active]:border-primary",children:["Non lues (",c,")"]})]}),e.jsx(ua,{value:"all",className:"m-0",children:e.jsx(It,{className:"h-[400px]",style:{maxHeight:d},children:e.jsx("div",{className:"p-0",children:p.length===0?e.jsx(x,{}):e.jsx("div",{className:"divide-y",children:p.map(N=>e.jsx(Pa,{notification:N,onMarkAsRead:a,onDelete:s},N.id))})})})}),e.jsx(ua,{value:"unread",className:"m-0",children:e.jsx(It,{className:"h-[400px]",style:{maxHeight:d},children:e.jsx("div",{className:"p-0",children:p.length===0?e.jsx(x,{}):e.jsx("div",{className:"divide-y",children:p.map(N=>e.jsx(Pa,{notification:N,onMarkAsRead:a,onDelete:s},N.id))})})})})]}),!f&&e.jsx(It,{className:"h-[400px]",style:{maxHeight:d},children:e.jsx("div",{className:"p-0",children:t.length===0?e.jsx(x,{}):e.jsx("div",{className:"divide-y",children:t.map(N=>e.jsx(Pa,{notification:N,onMarkAsRead:a,onDelete:s},N.id))})})}),t.length>0&&n&&e.jsxs(e.Fragment,{children:[e.jsx($t,{}),e.jsx("div",{className:"p-2",children:e.jsxs(O,{variant:"ghost",size:"sm",className:"w-full text-destructive hover:text-destructive",onClick:n,children:[e.jsx(E.Trash2,{className:"h-3 w-3 mr-2"}),"Tout supprimer"]})})]})]})]})});Jo.displayName="WakaNotifications";function Lh(t=[]){const[a,r]=i.useState(t),s=i.useCallback(m=>{const v={...m,id:`notification-${Date.now()}-${Math.random()}`,timestamp:new Date,read:!1};r(f=>[v,...f])},[]),n=i.useCallback(m=>{r(v=>v.map(f=>f.id===m?{...f,read:!0}:f))},[]),o=i.useCallback(()=>{r(m=>m.map(v=>({...v,read:!0})))},[]),d=i.useCallback(m=>{r(v=>v.filter(f=>f.id!==m))},[]),u=i.useCallback(()=>{r([])},[]),h=i.useMemo(()=>a.filter(m=>!m.read).length,[a]);return{notifications:a,addNotification:s,markAsRead:n,markAllAsRead:o,deleteNotification:d,deleteAllNotifications:u,unreadCount:h}}const Ih=De.cva("relative inline-flex items-center justify-center",{variants:{size:{sm:"w-12 h-12",md:"w-16 h-16",lg:"w-24 h-24",xl:"w-32 h-32"}},defaultVariants:{size:"md"}}),Yo=i.forwardRef(({className:t,size:a,showAsteroids:r=!0,speed:s=2,rocketColor:n="text-primary",asteroidColor:o="text-muted-foreground",...d},u)=>{const m={sm:{orbit:40,rocket:16,asteroid:6},md:{orbit:56,rocket:20,asteroid:8},lg:{orbit:88,rocket:28,asteroid:12},xl:{orbit:120,rocket:36,asteroid:16}}[a||"md"],v=m.orbit,f=m.orbit;return e.jsxs("div",{ref:u,className:j(Ih({size:a,className:t})),role:"status","aria-label":"Chargement en cours",...d,children:[e.jsxs("svg",{width:m.orbit*2,height:m.orbit*2,viewBox:`0 0 ${m.orbit*2} ${m.orbit*2}`,className:"overflow-visible",children:[e.jsx("circle",{cx:v,cy:f,r:m.orbit-m.rocket,fill:"none",stroke:"currentColor",strokeWidth:"1",strokeDasharray:"4 4",className:"opacity-20"}),r&&e.jsxs("g",{className:o,children:[e.jsx("g",{style:{animation:`waka-float ${s*1.5}s ease-in-out infinite`,transformOrigin:`${v+m.orbit*.6}px ${f-m.orbit*.5}px`},children:e.jsx("polygon",{points:Ya(v+m.orbit*.6,f-m.orbit*.5,m.asteroid),fill:"currentColor",opacity:"0.3"})}),e.jsx("g",{style:{animation:`waka-float ${s*2}s ease-in-out infinite 0.5s`,transformOrigin:`${v-m.orbit*.7}px ${f+m.orbit*.4}px`},children:e.jsx("polygon",{points:Ya(v-m.orbit*.7,f+m.orbit*.4,m.asteroid*.8),fill:"currentColor",opacity:"0.3"})}),e.jsx("g",{style:{animation:`waka-float ${s*1.8}s ease-in-out infinite 1s`,transformOrigin:`${v-m.orbit*.8}px ${f-m.orbit*.2}px`},children:e.jsx("polygon",{points:Ya(v-m.orbit*.8,f-m.orbit*.2,m.asteroid*.6),fill:"currentColor",opacity:"0.3"})})]}),e.jsx("g",{className:n,style:{animation:`waka-orbit ${s}s linear infinite`,transformOrigin:`${v}px ${f}px`},children:e.jsxs("g",{transform:`translate(${v}, ${f-m.orbit+m.rocket/2})`,children:[e.jsx("path",{d:`M 0,-${m.rocket/2} L ${m.rocket/4},-${m.rocket/6} L ${m.rocket/4},${m.rocket/3} L 0,${m.rocket/2} L -${m.rocket/4},${m.rocket/3} L -${m.rocket/4},-${m.rocket/6} Z`,fill:"currentColor"}),e.jsx("circle",{cx:"0",cy:-m.rocket/6,r:m.rocket/8,fill:"white",opacity:"0.8"}),e.jsxs("g",{opacity:"0.8",children:[e.jsx("path",{d:`M -${m.rocket/6},${m.rocket/2} L -${m.rocket/8},${m.rocket/1.5} L 0,${m.rocket/2} Z`,fill:"#FF6B35",style:{animation:`waka-flicker ${s/4}s ease-in-out infinite`}}),e.jsx("path",{d:`M 0,${m.rocket/2} L ${m.rocket/8},${m.rocket/1.5} L ${m.rocket/6},${m.rocket/2} Z`,fill:"#FF6B35",style:{animation:`waka-flicker ${s/4}s ease-in-out infinite 0.1s`}}),e.jsx("path",{d:`M -${m.rocket/12},${m.rocket/2} L 0,${m.rocket/1.3} L ${m.rocket/12},${m.rocket/2} Z`,fill:"#FFA500",style:{animation:`waka-flicker ${s/4}s ease-in-out infinite 0.05s`}})]})]})}),[...Array(3)].map((y,k)=>e.jsx("circle",{cx:v+(k-1)*m.orbit*.3,cy:f-m.orbit*1.2,r:"1",fill:"currentColor",className:"opacity-40",style:{animation:`waka-twinkle ${s*1.5}s ease-in-out infinite ${k*.3}s`}},k))]}),e.jsx("style",{dangerouslySetInnerHTML:{__html:`
|
|
12
|
+
}`);const w=f.trim();if(w.trim().length===0)throw console.error(`[ThemeProvider] No CSS variables generated for theme "${t}"`),new Error(`No CSS variables found in JSON for theme "${t}"`);const k=w;if(!k.includes(`[data-theme="${t}"]`))throw console.error(`[ThemeProvider] Generated CSS is missing the selector for theme "${t}"`),console.error("[ThemeProvider] Generated CSS:",k),new Error(`Generated CSS is missing the required selector [data-theme="${t}"]`);return k.length<50&&console.warn(`[ThemeProvider] Generated CSS seems too short for theme "${t}":`,k),console.log(`[ThemeProvider] ✅ Generated valid CSS for theme "${t}" with ${Object.keys(s).length} variables`),k}function Ms(){const t=l.useContext(Hi);if(!t)throw new Error("useTheme must be used within a ThemeProvider");return t}const Xi=l.forwardRef(({className:t,variant:a="default",ariaLabel:s="Select theme"},r)=>{const{currentTheme:n,changeTheme:o,themes:i,isLoading:c}=Ms(),[m,d]=l.useState(!1),[x,u]=l.useState(!1),f=l.useRef(null),w=l.useRef(null);l.useEffect(()=>{u(!0)},[]);const k=async(v,p)=>{p&&(p.preventDefault(),p.stopPropagation());try{console.log(`[ThemeSelector] Changing theme to: ${v}`),await o(v),console.log(`[ThemeSelector] ✅ Theme changed to: ${v}`)}catch(j){console.error(`[ThemeSelector] ❌ Failed to change theme to ${v}:`,j)}a==="compact"&&setTimeout(()=>d(!1),100)},[b,y]=l.useState({top:0,right:0});if(l.useEffect(()=>{if(m&&f.current&&x){const v=f.current.getBoundingClientRect();y({top:v.bottom+8,right:window.innerWidth-v.right})}},[m,x]),a==="compact"){const v=m&&x?e.jsxs("div",{ref:w,className:"fixed z-[9999] min-w-[220px] rounded-md border border-border bg-popover text-popover-foreground p-2 shadow-lg",style:{top:`${b.top}px`,right:`${b.right}px`},onMouseDown:p=>{p.stopPropagation()},children:[e.jsx("div",{className:"px-2 py-1.5 border-b border-border mb-2",children:e.jsxs("div",{className:"text-xs font-medium text-muted-foreground flex items-center justify-between",children:[e.jsx("span",{children:"Thèmes"}),c&&e.jsx(h.Loader2,{className:"h-3 w-3 animate-spin"})]})}),c&&i.length===0?e.jsxs("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:[e.jsx(h.Loader2,{className:"h-4 w-4 mr-2 animate-spin"}),"Chargement..."]}):e.jsxs("div",{className:"grid gap-1",children:[i.map(p=>e.jsxs("button",{onMouseDown:j=>{j.preventDefault(),j.stopPropagation(),k(p.id,j)},type:"button",className:g("flex items-center gap-3 rounded-sm px-2 py-2 text-sm hover:bg-accent hover:text-accent-foreground transition-colors cursor-pointer",n===p.id&&"bg-accent"),children:[p.previewColor&&e.jsx("div",{className:"h-4 w-4 rounded border border-border shrink-0",style:{backgroundColor:p.previewColor}}),e.jsx("span",{className:"flex-1 text-left",children:p.label}),n===p.id&&e.jsx(h.Check,{className:"h-4 w-4 shrink-0"})]},p.id)),i.length===0&&!c&&e.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Aucun thème disponible"})]}),e.jsx("div",{className:"px-2 py-1.5 border-t border-border mt-2",children:e.jsxs("div",{className:"text-xs text-muted-foreground",children:[i.length," thème",i.length>1?"s":""," disponible",i.length>1?"s":""]})})]}):null;return e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:r,className:g("relative",t),children:e.jsxs("button",{ref:f,onMouseDown:p=>{p.preventDefault(),p.stopPropagation()},onClick:p=>{p.preventDefault(),p.stopPropagation(),d(!m)},className:"flex h-9 w-9 items-center justify-center rounded-md border border-input bg-transparent hover:bg-accent hover:text-accent-foreground relative",title:"Changer de thème",type:"button",children:[e.jsx(h.Palette,{className:"h-4 w-4"}),c&&e.jsx(h.Loader2,{className:"h-3 w-3 absolute top-1 right-1 animate-spin text-primary"}),e.jsx("span",{className:"sr-only",children:s})]})}),x&&typeof document<"u"&&v&&Za.createPortal(e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-[9998]",onMouseDown:p=>{p.preventDefault(),d(!1)}}),v]}),document.body)]})}if(a==="select"){const v=i.find(p=>p.id===n);return e.jsx("div",{ref:r,className:g("w-full",t),children:e.jsxs(Oe,{value:n,onValueChange:async p=>{try{console.log(`[ThemeSelector] Changing theme to: ${p}`),await o(p),console.log(`[ThemeSelector] ✅ Theme changed to: ${p}`)}catch(j){console.error(`[ThemeSelector] ❌ Failed to change theme to ${p}:`,j)}},disabled:c||i.length===0,children:[e.jsx(Le,{className:"w-full","aria-label":s,children:e.jsx(ze,{children:c&&i.length===0?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(h.Loader2,{className:"h-4 w-4 animate-spin"}),e.jsx("span",{children:"Chargement..."})]}):v?e.jsxs("span",{className:"flex items-center gap-3",children:[v.previewColor&&e.jsx("div",{className:"h-4 w-4 rounded border border-border shrink-0",style:{backgroundColor:v.previewColor}}),e.jsx("span",{className:"truncate",children:v.label})]}):e.jsx("span",{className:"text-muted-foreground",children:"Sélectionner un thème"})})}),e.jsxs(Ie,{children:[i.map(p=>e.jsx(be,{value:p.id,className:"cursor-pointer",children:e.jsxs("div",{className:"flex items-center gap-3 w-full",children:[p.previewColor&&e.jsx("div",{className:"h-4 w-4 rounded border border-border shrink-0",style:{backgroundColor:p.previewColor}}),e.jsx("span",{className:"flex-1 text-left truncate",children:p.label})]})},p.id)),i.length===0&&!c&&e.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"Aucun thème disponible"})]})]})})}return e.jsx("div",{ref:r,className:g("grid gap-4",t),children:c&&i.length===0?e.jsxs("div",{className:"flex items-center justify-center py-12 text-sm text-muted-foreground",children:[e.jsx(h.Loader2,{className:"h-5 w-5 mr-2 animate-spin"}),"Chargement des thèmes..."]}):e.jsxs(e.Fragment,{children:[i.map(v=>e.jsxs("button",{onClick:async p=>{p.preventDefault(),p.stopPropagation(),await k(v.id,p)},type:"button",className:g("relative flex flex-col items-start gap-2 rounded-lg border-2 p-4 text-left transition-all hover:border-primary",n===v.id?"border-primary bg-primary/5":"border-muted"),children:[e.jsxs("div",{className:"flex w-full items-center justify-between",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"font-semibold",children:v.label}),v.description&&e.jsx("span",{className:"text-sm text-muted-foreground",children:v.description})]}),n===v.id&&e.jsx(h.Check,{className:"h-5 w-5 text-primary shrink-0"})]}),v.previewColor&&e.jsx("div",{className:"flex gap-2 w-full",children:e.jsx("div",{className:"h-8 w-full rounded border",style:{backgroundColor:v.previewColor}})})]},v.id)),i.length===0&&!c&&e.jsx("div",{className:"py-12 text-center text-sm text-muted-foreground",children:"Aucun thème disponible"})]})})});Xi.displayName="ThemeSelector";const Yi=pt.Provider,Lr=l.forwardRef(({className:t,...a},s)=>e.jsx(pt.Viewport,{ref:s,className:g("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",t),...a}));Lr.displayName=pt.Viewport.displayName;const ox=Ye.cva("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Ir=l.forwardRef(({className:t,variant:a,...s},r)=>e.jsx(pt.Root,{ref:r,className:g(ox({variant:a}),t),...s}));Ir.displayName=pt.Root.displayName;const Ji=l.forwardRef(({className:t,...a},s)=>e.jsx(pt.Action,{ref:s,className:g("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",t),...a}));Ji.displayName=pt.Action.displayName;const Or=l.forwardRef(({className:t,...a},s)=>e.jsx(pt.Close,{ref:s,className:g("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...a,children:e.jsx(h.X,{className:"h-4 w-4"})}));Or.displayName=pt.Close.displayName;const zr=l.forwardRef(({className:t,...a},s)=>e.jsx(pt.Title,{ref:s,className:g("text-sm font-semibold",t),...a}));zr.displayName=pt.Title.displayName;const _r=l.forwardRef(({className:t,...a},s)=>e.jsx(pt.Description,{ref:s,className:g("text-sm opacity-90",t),...a}));_r.displayName=pt.Description.displayName;const ix=1,lx=1e6;let Ua=0;function cx(){return Ua=(Ua+1)%Number.MAX_SAFE_INTEGER,Ua.toString()}const Ba=new Map,Yn=t=>{if(Ba.has(t))return;const a=setTimeout(()=>{Ba.delete(t),Ws({type:"REMOVE_TOAST",toastId:t})},lx);Ba.set(t,a)},Ki=(t,a)=>{switch(a.type){case"ADD_TOAST":return{...t,toasts:[a.toast,...t.toasts].slice(0,ix)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(s=>s.id===a.toast.id?{...s,...a.toast}:s)};case"DISMISS_TOAST":{const{toastId:s}=a;return s?Yn(s):t.toasts.forEach(r=>{Yn(r.id)}),{...t,toasts:t.toasts.map(r=>r.id===s||s===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return a.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(s=>s.id!==a.toastId)}}},fa=[];let pa={toasts:[]};function Ws(t){pa=Ki(pa,t),fa.forEach(a=>{a(pa)})}function Qi({...t}){const a=cx(),s=n=>Ws({type:"UPDATE_TOAST",toast:{...n,id:a}}),r=()=>Ws({type:"DISMISS_TOAST",toastId:a});return Ws({type:"ADD_TOAST",toast:{...t,id:a,open:!0,onOpenChange:n=>{n||r()}}}),{id:a,dismiss:r,update:s}}function Aa(){const[t,a]=l.useState(pa);return l.useEffect(()=>(fa.push(a),()=>{const s=fa.indexOf(a);s>-1&&fa.splice(s,1)}),[t]),{...t,toast:Qi,dismiss:s=>Ws({type:"DISMISS_TOAST",toastId:s})}}function dx(){const{toasts:t}=Aa();return e.jsxs(Yi,{children:[t.map(function({id:a,title:s,description:r,action:n,...o}){return e.jsxs(Ir,{...o,children:[e.jsxs("div",{className:"grid gap-1",children:[s&&e.jsx(zr,{children:s}),r&&e.jsx(_r,{children:r})]}),n,e.jsx(Or,{})]},a)}),e.jsx(Lr,{})]})}const Zi=Ye.cva("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}}),el=l.forwardRef(({className:t,variant:a,size:s,...r},n)=>e.jsx(Do.Root,{ref:n,className:g(Zi({variant:a,size:s,className:t})),...r}));el.displayName=Do.Root.displayName;const Xs=Qs.Provider,Ys=Qs.Root,Js=Qs.Trigger,Ss=l.forwardRef(({className:t,sideOffset:a=4,...s},r)=>e.jsx(Qs.Content,{ref:r,sideOffset:a,className:g("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...s}));Ss.displayName=Qs.Content.displayName;const tl=Ye.cva("",{variants:{variant:{default:"text-foreground",muted:"text-muted-foreground",destructive:"text-destructive",success:"text-green-600 dark:text-green-400",warning:"text-amber-600 dark:text-amber-400",link:"text-primary underline-offset-4 hover:underline"},size:{xs:"text-xs",sm:"text-sm",base:"text-base",lg:"text-lg",xl:"text-xl"},weight:{normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"},align:{left:"text-left",center:"text-center",right:"text-right",justify:"text-justify"}},defaultVariants:{variant:"default",size:"base",weight:"normal",align:"left"}}),sl=l.forwardRef(({className:t,variant:a,size:s,weight:r,align:n,asChild:o=!1,truncate:i=!1,...c},m)=>{const d=o?ya.Slot:"p";return e.jsx(d,{className:g(tl({variant:a,size:s,weight:r,align:n}),i&&"truncate",t),ref:m,...c})});sl.displayName="Text";const al=Ye.cva("font-bold tracking-tight",{variants:{level:{h1:"text-4xl lg:text-5xl",h2:"text-3xl lg:text-4xl",h3:"text-2xl lg:text-3xl",h4:"text-xl lg:text-2xl",h5:"text-lg lg:text-xl",h6:"text-base lg:text-lg"},variant:{default:"text-foreground",gradient:"bg-gradient-to-r from-primary to-primary/60 bg-clip-text text-transparent",muted:"text-muted-foreground"}},defaultVariants:{level:"h2",variant:"default"}}),rl=l.forwardRef(({className:t,level:a="h2",variant:s,asChild:r=!1,...n},o)=>{const i=r?ya.Slot:a;return e.jsx(i,{className:g(al({level:a,variant:s}),t),ref:o,...n})});rl.displayName="Heading";const nl=Ye.cva("mt-6 border-l-4 pl-6 italic",{variants:{variant:{default:"border-border text-muted-foreground",primary:"border-primary text-foreground",success:"border-green-500 text-green-900 dark:text-green-100",warning:"border-amber-500 text-amber-900 dark:text-amber-100",destructive:"border-destructive text-destructive"}},defaultVariants:{variant:"default"}}),ol=l.forwardRef(({className:t,variant:a,author:s,cite:r,children:n,...o},i)=>e.jsxs("figure",{className:"my-6",children:[e.jsx("blockquote",{className:g(nl({variant:a}),t),cite:r,ref:i,...o,children:n}),s&&e.jsxs("figcaption",{className:"mt-2 text-sm text-muted-foreground",children:["— ",s]})]}));ol.displayName="Blockquote";Ye.cva("relative rounded font-mono",{variants:{variant:{inline:"bg-muted px-[0.3rem] py-[0.2rem] text-xs sm:text-sm",block:"block bg-muted overflow-x-auto"},size:{sm:"text-xs sm:text-sm",base:"text-sm sm:text-base",lg:"text-base sm:text-lg"}},defaultVariants:{variant:"inline",size:"base"}});const il=Ye.cva("inline-flex items-center justify-center rounded border border-border bg-muted px-2 py-1 font-mono text-xs font-medium text-muted-foreground shadow-sm",{variants:{size:{sm:"h-5 min-w-[1.25rem] text-[0.625rem]",default:"h-6 min-w-[1.5rem] text-xs",lg:"h-7 min-w-[1.75rem] text-sm"}},defaultVariants:{size:"default"}}),ll=l.forwardRef(({className:t,size:a,...s},r)=>e.jsx("kbd",{className:g(il({size:a}),t),ref:r,...s}));ll.displayName="Kbd";function ge(...t){return Co.clsx(t)}function cl(t,a="export.csv"){if(!t||t.length===0)return;const s=Object.keys(t[0]),r=[s.join(","),...t.map(i=>s.map(c=>{const m=i[c];return typeof m=="string"&&(m.includes(",")||m.includes('"')||m.includes(`
|
|
13
|
+
`))?`"${m.replace(/"/g,'""')}"`:m}).join(","))].join(`
|
|
14
|
+
`),n=new Blob([r],{type:"text/csv;charset=utf-8;"}),o=document.createElement("a");o.href=URL.createObjectURL(n),o.download=a,o.click(),URL.revokeObjectURL(o.href)}function dl(t,a="export.json"){const s=JSON.stringify(t,null,2),r=new Blob([s],{type:"application/json;charset=utf-8;"}),n=document.createElement("a");n.href=URL.createObjectURL(r),n.download=a,n.click(),URL.revokeObjectURL(n.href)}async function ux(t){return new Promise((a,s)=>{const r=new FileReader;r.onload=n=>{try{const i=(n.target?.result).split(`
|
|
15
|
+
`).filter(d=>d.trim());if(i.length===0){a([]);return}const c=i[0].split(",").map(d=>d.trim().replace(/^"|"$/g,"")),m=i.slice(1).map(d=>{const x=d.split(",").map(f=>f.trim().replace(/^"|"$/g,"")),u={};return c.forEach((f,w)=>{u[f]=x[w]||""}),u});a(m)}catch(o){s(o)}},r.onerror=()=>s(r.error),r.readAsText(t)})}function ul(t,a){try{localStorage.setItem(`datatable_${t}`,JSON.stringify(a))}catch(s){console.warn("[DataTable] Failed to save state:",s)}}function ml(t){try{const a=localStorage.getItem(`datatable_${t}`);return a?JSON.parse(a):null}catch(a){return console.warn("[DataTable] Failed to load state:",a),null}}function mx(t,a,s){const r=s.toLowerCase();return Object.values(t).some(n=>n==null?!1:String(n).toLowerCase().includes(r))}function hl({data:t,columns:a,pagination:s,tableId:r,onSortingChange:n,onFiltersChange:o,onSelectionChange:i}){const c=O.useMemo(()=>r?ml(r):null,[r]),[m,d]=O.useState(c?.sorting||[]),[x,u]=O.useState(c?.columnFilters||[]),[f,w]=O.useState(c?.columnVisibility||{}),[k,b]=O.useState({}),[y,v]=O.useState(c?.globalFilter||""),[p,j]=O.useState({pageIndex:s?.currentPage||0,pageSize:s?.pageSize||10});O.useEffect(()=>{r&&ul(r,{sorting:m,columnFilters:x,columnVisibility:f,globalFilter:y})},[r,m,x,f,y]),O.useEffect(()=>{n?.(m)},[m,n]),O.useEffect(()=>{o?.(x)},[x,o]),O.useEffect(()=>{const E=C.getFilteredSelectedRowModel().rows.map(D=>D.original);i?.(E)},[k]);const C=qe.useReactTable({data:t,columns:a,state:{sorting:m,columnFilters:x,columnVisibility:f,rowSelection:k,globalFilter:y,pagination:p},enableRowSelection:!0,onRowSelectionChange:b,onSortingChange:d,onColumnFiltersChange:u,onColumnVisibilityChange:w,onGlobalFilterChange:v,onPaginationChange:j,getCoreRowModel:qe.getCoreRowModel(),getFilteredRowModel:qe.getFilteredRowModel(),getPaginationRowModel:qe.getPaginationRowModel(),getSortedRowModel:qe.getSortedRowModel(),globalFilterFn:mx,manualPagination:s?.mode==="server",pageCount:s?.mode==="server"?Math.ceil((s.totalItems||0)/p.pageSize):void 0}),N=O.useMemo(()=>C.getFilteredSelectedRowModel().rows.map(E=>E.original),[C,k]),S=O.useCallback(()=>{u([]),v("")},[]),A=O.useCallback(()=>{b({})},[]),R=O.useCallback(()=>C.getFilteredRowModel().rows.map(E=>E.original),[C]);return{table:C,sorting:m,setSorting:d,columnFilters:x,setColumnFilters:u,columnVisibility:f,setColumnVisibility:w,rowSelection:k,setRowSelection:b,globalFilter:y,setGlobalFilter:v,pagination:p,setPagination:j,selectedRows:N,resetFilters:S,resetSelection:A,exportData:R}}function Vr(t="standard",a="comfortable"){const[s,r]=O.useState(t),[n,o]=O.useState(a),[i,c]=O.useState(!1);O.useEffect(()=>{const u=()=>{c(window.innerWidth<768)};return u(),window.addEventListener("resize",u),()=>window.removeEventListener("resize",u)},[]),O.useEffect(()=>{i&&s==="standard"&&r("card")},[i,s]);const m=O.useCallback(()=>{r(u=>{switch(u){case"standard":return"card";case"card":return"compact";case"compact":return"standard";default:return"standard"}})},[]),d=O.useCallback(()=>{o(u=>u==="comfortable"?"compact":"comfortable")},[]);return{layout:s,setLayout:r,density:n,setDensity:o,toggleLayout:m,toggleDensity:d,isMobile:i,densityClasses:{comfortable:{table:"text-sm",cell:"px-4 py-3",header:"px-4 py-3"},compact:{table:"text-xs",cell:"px-2 py-1.5",header:"px-2 py-2"},spacious:{table:"text-base",cell:"px-6 py-4",header:"px-6 py-4"}}[n]}}function Wr(t,a={}){const{onSave:s,onCancel:r,validateField:n,autoSave:o=!1,autoSaveDelay:i=2e3}=a,[c,m]=O.useState(null),[d,x]=O.useState({}),[u,f]=O.useState(null),[w,k]=O.useState({}),[b,y]=O.useState(!1),v=O.useMemo(()=>!u||!c?!1:Object.keys(d).some(M=>{const P=M;return d[P]!==u[P]}),[d,u,c]),p=v&&c!==null,j=O.useCallback((M,P)=>{m(M),x({...P}),f(P),k({})},[]),C=O.useCallback(()=>{!c||!u||(r?.(c,u),m(null),x({}),f(null),k({}))},[c,u,r]),N=O.useCallback((M,P)=>{if(c){if(n){const T=n(M,P);if(T){k(q=>({...q,[M]:T}));return}else k(q=>{const H={...q};return delete H[M],H})}x(T=>({...T,[M]:P}))}},[c,n]),S=O.useCallback(async()=>{if(!(!c||!s||b)){if(Object.keys(w).length>0)throw new Error("Validation errors present");y(!0);try{await s(c,d),m(null),x({}),f(null),k({})}catch(M){throw console.error("Error saving edit:",M),M}finally{y(!1)}}},[c,s,d,w,b]),A=O.useCallback(()=>{u&&(x({...u}),k({}))},[u]),R=O.useMemo(()=>!o||!p?null:setTimeout(()=>{p&&!b&&S().catch(console.error)},i),[o,p,b,S,i]);return O.useEffect(()=>()=>{R&&clearTimeout(R)},[R]),[{editingRowId:c,editedData:d,hasChanges:v,isDirty:p},{startEdit:j,cancelEdit:C,saveEdit:S,updateField:N,resetEdit:A}]}function Ks({table:t,config:a,globalFilter:s,onGlobalFilterChange:r,density:n,onDensityChange:o,onExport:i,onImport:c}){const{t:m}=Nt.useTranslation(),d=l.useRef(null),x=t.getFilteredSelectedRowModel().rows,u=x.length>0,f=l.useMemo(()=>a?.actions?a.actions.filter(b=>!(b.requiresSelection&&!u)):[],[a?.actions,u]),w=b=>{const y=u?x.map(v=>v.original):t.getFilteredRowModel().rows.map(v=>v.original);i?i(b):b==="csv"?cl(y,"export.csv"):dl(y,"export.json")},k=b=>{const y=b.target.files?.[0];y&&c&&c(y),d.current&&(d.current.value="")};return e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4 p-4 border-b",children:[e.jsxs("div",{className:"flex flex-1 flex-col sm:flex-row items-start sm:items-center gap-2 w-full sm:w-auto",children:[a?.showSearch!==!1&&e.jsxs("div",{className:"relative w-full sm:w-64",children:[e.jsx(h.Search,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(oe,{placeholder:m("datatable.toolbar.search",{defaultValue:"Search..."}),value:s??"",onChange:b=>r(b.target.value),className:"pl-8 h-9"}),s&&e.jsx("button",{onClick:()=>r(""),className:"absolute right-2 top-2.5 text-muted-foreground hover:text-foreground",children:e.jsx(h.X,{className:"h-4 w-4"})})]}),u&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsxs("span",{children:[x.length," ",m("datatable.toolbar.selected",{defaultValue:"selected"})]}),e.jsx($,{variant:"ghost",size:"sm",onClick:()=>t.resetRowSelection(),className:"h-7 px-2",children:m("datatable.toolbar.clear",{defaultValue:"Clear"})})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[f.map(b=>e.jsxs($,{variant:b.variant||"outline",size:"sm",onClick:()=>b.onClick(x.map(y=>y.original)),disabled:b.disabled,className:"h-9",children:[b.icon,e.jsx("span",{className:"ml-2",children:b.label})]},b.id)),a?.showRefresh&&e.jsxs($,{variant:"outline",size:"icon",onClick:a.onRefresh,className:"h-9 w-9",children:[e.jsx(h.RefreshCw,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:m("datatable.toolbar.refresh",{defaultValue:"Refresh"})})]}),i&&e.jsxs(Ge,{children:[e.jsx(Xe,{asChild:!0,children:e.jsxs($,{variant:"outline",size:"icon",className:"h-9 w-9",children:[e.jsx(h.Download,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:m("datatable.toolbar.export",{defaultValue:"Export"})})]})}),e.jsxs(Ue,{align:"end",children:[e.jsx(ms,{children:m("datatable.toolbar.exportAs",{defaultValue:"Export as"})}),e.jsx(Ze,{}),e.jsx(ds,{onClick:()=>w("csv"),children:"CSV"}),e.jsx(ds,{onClick:()=>w("json"),children:"JSON"})]})]}),c&&e.jsxs(e.Fragment,{children:[e.jsx("input",{ref:d,type:"file",accept:".csv,.json",onChange:k,className:"hidden"}),e.jsxs($,{variant:"outline",size:"icon",onClick:()=>d.current?.click(),className:"h-9 w-9",children:[e.jsx(h.Upload,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:m("datatable.toolbar.import",{defaultValue:"Import"})})]})]}),a?.showColumnToggle!==!1&&e.jsxs(Ge,{children:[e.jsx(Xe,{asChild:!0,children:e.jsxs($,{variant:"outline",size:"icon",className:"h-9 w-9",children:[e.jsx(h.Columns,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:m("datatable.toolbar.columns",{defaultValue:"Columns"})})]})}),e.jsxs(Ue,{align:"end",className:"w-48",children:[e.jsx(ms,{children:m("datatable.toolbar.toggleColumns",{defaultValue:"Toggle columns"})}),e.jsx(Ze,{}),t.getAllColumns().filter(b=>b.getCanHide()).map(b=>e.jsx(ds,{className:"capitalize",checked:b.getIsVisible(),onCheckedChange:y=>b.toggleVisibility(!!y),children:b.id},b.id))]})]}),a?.showDensity&&o&&e.jsxs(Ge,{children:[e.jsx(Xe,{asChild:!0,children:e.jsxs($,{variant:"outline",size:"icon",className:"h-9 w-9",children:[e.jsx(h.SlidersHorizontal,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:m("datatable.toolbar.density",{defaultValue:"Density"})})]})}),e.jsxs(Ue,{align:"end",children:[e.jsx(ms,{children:m("datatable.toolbar.tableDensity",{defaultValue:"Table density"})}),e.jsx(Ze,{}),e.jsx(ds,{checked:n==="comfortable",onCheckedChange:()=>o("comfortable"),children:m("datatable.toolbar.comfortable",{defaultValue:"Comfortable"})}),e.jsx(ds,{checked:n==="compact",onCheckedChange:()=>o("compact"),children:m("datatable.toolbar.compact",{defaultValue:"Compact"})})]})]})]})]})}function Ur({table:t,pageSizeOptions:a=[25,50,100,500],showInfo:s=!0}){const{t:r}=Nt.useTranslation(),n=t.getState().pagination.pageIndex,o=t.getState().pagination.pageSize,i=t.getPageCount(),c=t.getFilteredRowModel().rows.length,m=n*o+1,d=Math.min((n+1)*o,c);return e.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 px-4 py-3 border-t",children:[s&&e.jsx("div",{className:"text-sm text-muted-foreground",children:c>0?e.jsxs(e.Fragment,{children:[r("datatable.pagination.showing",{defaultValue:"Showing"})," ",m," ",r("datatable.pagination.to",{defaultValue:"to"})," ",d," ",r("datatable.pagination.of",{defaultValue:"of"})," ",c," ",r("datatable.pagination.results",{defaultValue:"results"})]}):r("datatable.pagination.noResults",{defaultValue:"No results"})}),e.jsxs("div",{className:"flex items-center gap-6",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground whitespace-nowrap",children:r("datatable.pagination.rowsPerPage",{defaultValue:"Rows per page"})}),e.jsxs(Oe,{value:`${o}`,onValueChange:x=>{t.setPageSize(Number(x))},children:[e.jsx(Le,{className:"h-8 w-[70px]",children:e.jsx(ze,{placeholder:o})}),e.jsx(Ie,{side:"top",children:a.map(x=>e.jsx(be,{value:`${x}`,children:x},x))})]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsxs("span",{className:"text-sm text-muted-foreground mr-2",children:[r("datatable.pagination.page",{defaultValue:"Page"})," ",n+1," ",r("datatable.pagination.of",{defaultValue:"of"})," ",i]}),e.jsxs($,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>t.setPageIndex(0),disabled:!t.getCanPreviousPage(),children:[e.jsx(h.ChevronsLeft,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:r("datatable.pagination.firstPage",{defaultValue:"First page"})})]}),e.jsxs($,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>t.previousPage(),disabled:!t.getCanPreviousPage(),children:[e.jsx(h.ChevronLeft,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:r("datatable.pagination.previousPage",{defaultValue:"Previous page"})})]}),e.jsxs($,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>t.nextPage(),disabled:!t.getCanNextPage(),children:[e.jsx(h.ChevronRight,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:r("datatable.pagination.nextPage",{defaultValue:"Next page"})})]}),e.jsxs($,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>t.setPageIndex(i-1),disabled:!t.getCanNextPage(),children:[e.jsx(h.ChevronsRight,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:r("datatable.pagination.lastPage",{defaultValue:"Last page"})})]})]})]})]})}function Br({table:t,filters:a,position:s="top",onFiltersChange:r}){const{t:n}=Nt.useTranslation(),[o,i]=l.useState([]),[c,m]=l.useState(!1),d=l.useCallback(v=>{const p=t.getPreFilteredRowModel().rows,j=new Set;return p.forEach(C=>{const N=C.getValue(v);N!=null&&N!==""&&j.add(String(N))}),Array.from(j).sort()},[t]),x={text:[{value:"contains",label:n("datatable.filters.contains",{defaultValue:"Contains"})},{value:"equals",label:n("datatable.filters.equals",{defaultValue:"Equals"})},{value:"startsWith",label:n("datatable.filters.startsWith",{defaultValue:"Starts with"})},{value:"endsWith",label:n("datatable.filters.endsWith",{defaultValue:"Ends with"})},{value:"notContains",label:n("datatable.filters.notContains",{defaultValue:"Not contains"})}],select:[{value:"equals",label:n("datatable.filters.equals",{defaultValue:"Equals"})},{value:"notEquals",label:n("datatable.filters.notEquals",{defaultValue:"Not equals"})}],multiselect:[{value:"in",label:n("datatable.filters.in",{defaultValue:"In"})},{value:"notIn",label:n("datatable.filters.notIn",{defaultValue:"Not in"})}],range:[{value:"between",label:n("datatable.filters.between",{defaultValue:"Between"})},{value:"greaterThan",label:n("datatable.filters.greaterThan",{defaultValue:"Greater than"})},{value:"lessThan",label:n("datatable.filters.lessThan",{defaultValue:"Less than"})}],date:[{value:"equals",label:n("datatable.filters.equals",{defaultValue:"Equals"})},{value:"before",label:n("datatable.filters.before",{defaultValue:"Before"})},{value:"after",label:n("datatable.filters.after",{defaultValue:"After"})},{value:"between",label:n("datatable.filters.between",{defaultValue:"Between"})}],daterange:[{value:"between",label:n("datatable.filters.between",{defaultValue:"Between"})},{value:"before",label:n("datatable.filters.before",{defaultValue:"Before"})},{value:"after",label:n("datatable.filters.after",{defaultValue:"After"})}],checkbox:[{value:"equals",label:n("datatable.filters.equals",{defaultValue:"Equals"})}],number:[{value:"equals",label:n("datatable.filters.equals",{defaultValue:"Equals"})},{value:"notEquals",label:n("datatable.filters.notEquals",{defaultValue:"Not equals"})},{value:"greaterThan",label:n("datatable.filters.greaterThan",{defaultValue:"Greater than"})},{value:"lessThan",label:n("datatable.filters.lessThan",{defaultValue:"Less than"})},{value:"between",label:n("datatable.filters.between",{defaultValue:"Between"})}],boolean:[{value:"equals",label:n("datatable.filters.equals",{defaultValue:"Equals"})},{value:"notEquals",label:n("datatable.filters.notEquals",{defaultValue:"Not equals"})}]},u=(v,p,j)=>{const C=t.getColumn(v.column||v.id);if(!C)return;const N={columnId:v.column||v.id,operator:p,value:j,label:v.label};i(S=>[...S,N]),C.setFilterValue({operator:p,value:j}),r?.([...o,N])},f=v=>{const p=o[v],j=t.getColumn(p.columnId);j&&j.setFilterValue(void 0);const C=o.filter((N,S)=>S!==v);i(C),r?.(C)},w=()=>{o.forEach(v=>{const p=t.getColumn(v.columnId);p&&p.setFilterValue(void 0)}),i([]),r?.([])},k=v=>{const[p,j]=l.useState(x[v.type]?.[0]?.value||"equals"),C=()=>v.defaultValue!==void 0?v.defaultValue:v.type==="range"?{min:"",max:""}:v.type==="daterange"?{from:"",to:""}:v.type==="checkbox"?!1:"",[N,S]=l.useState(C()),[A,R]=l.useState([]),[E,D]=l.useState(!1),M=v.column?d(v.column):[],P=()=>{const T=v.type==="multiselect"?A:N;let q=!1;v.type==="multiselect"?q=Array.isArray(T)&&T.length>0:v.type==="range"?q=T.min!==""||T.max!=="":v.type==="daterange"?q=T.from!==""||T.to!=="":v.type==="checkbox"?q=!0:q=T!==""&&T!=null,q&&(u(v,p,T),S(C()),R([]),D(!1))};return e.jsxs("div",{className:"space-y-3 p-4 border rounded-lg",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(he,{className:"text-sm font-medium",children:v.label}),e.jsx(De,{variant:"outline",className:"text-xs",children:v.type})]}),x[v.type]&&x[v.type].length>1&&e.jsxs(Oe,{value:p,onValueChange:j,children:[e.jsx(Le,{className:"h-9",children:e.jsx(ze,{})}),e.jsx(Ie,{children:x[v.type].map(T=>e.jsx(be,{value:T.value,children:T.label},T.value))})]}),v.type==="text"&&e.jsx("div",{className:"space-y-2",children:e.jsxs(ct,{open:E,onOpenChange:D,children:[e.jsx(dt,{asChild:!0,children:e.jsx(oe,{placeholder:v.placeholder||n("datatable.filters.enterValue",{defaultValue:"Enter value..."}),value:N,onChange:T=>{S(T.target.value),D(!0)},className:"h-9"})}),M.length>0&&N&&e.jsx(rt,{className:"w-[--radix-popover-trigger-width] p-0",align:"start",children:e.jsxs(ts,{children:[e.jsx(xs,{placeholder:n("datatable.filters.search",{defaultValue:"Search..."})}),e.jsx(gs,{children:n("datatable.filters.noResults",{defaultValue:"No results"})}),e.jsx(Ot,{className:"max-h-64 overflow-auto",children:M.filter(T=>T.toLowerCase().includes(N.toLowerCase())).slice(0,50).map(T=>e.jsx(zt,{onSelect:()=>{S(T),D(!1)},children:T},T))})]})})]})}),v.type==="select"&&e.jsxs(Oe,{value:N,onValueChange:S,children:[e.jsx(Le,{className:"h-9",children:e.jsx(ze,{placeholder:v.placeholder})}),e.jsx(Ie,{children:(v.options||M.map(T=>({label:T,value:T}))).map(T=>e.jsx(be,{value:String(T.value),children:T.label},T.value))})]}),v.type==="multiselect"&&e.jsxs(ct,{children:[e.jsx(dt,{asChild:!0,children:e.jsxs($,{variant:"outline",className:"w-full justify-between h-9",children:[A.length>0?`${A.length} ${n("datatable.filters.selected",{defaultValue:"selected"})}`:v.placeholder||n("datatable.filters.selectValues",{defaultValue:"Select values..."}),e.jsx(h.ChevronDown,{className:"ml-2 h-4 w-4 opacity-50"})]})}),e.jsx(rt,{className:"w-[--radix-popover-trigger-width] p-0",align:"start",children:e.jsxs(ts,{children:[e.jsx(xs,{placeholder:n("datatable.filters.search",{defaultValue:"Search..."})}),e.jsx(gs,{children:n("datatable.filters.noResults",{defaultValue:"No results"})}),e.jsx(Ot,{className:"max-h-64 overflow-auto",children:M.map(T=>e.jsxs(zt,{onSelect:()=>{R(q=>q.includes(T)?q.filter(H=>H!==T):[...q,T])},children:[e.jsx(et,{checked:A.includes(T),className:"mr-2"}),T]},T))})]})})]}),v.type==="date"&&e.jsx(oe,{type:"date",value:N,onChange:T=>S(T.target.value),className:"h-9"}),v.type==="range"&&e.jsxs("div",{className:"flex gap-2",children:[e.jsx(oe,{type:"number",placeholder:"Min",value:N.min||"",onChange:T=>S({...N,min:T.target.value}),className:"h-9"}),e.jsx(oe,{type:"number",placeholder:"Max",value:N.max||"",onChange:T=>S({...N,max:T.target.value}),className:"h-9"})]}),v.type==="daterange"&&e.jsxs("div",{className:"flex gap-2",children:[e.jsx(oe,{type:"date",placeholder:n("datatable.filters.from",{defaultValue:"From"}),value:N.from||"",onChange:T=>S({...N,from:T.target.value}),className:"h-9"}),e.jsx(oe,{type:"date",placeholder:n("datatable.filters.to",{defaultValue:"To"}),value:N.to||"",onChange:T=>S({...N,to:T.target.value}),className:"h-9"})]}),v.type==="checkbox"&&e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(et,{id:`checkbox-${v.id}`,checked:N===!0,onCheckedChange:T=>S(T===!0)}),e.jsx(he,{htmlFor:`checkbox-${v.id}`,className:"text-sm font-normal",children:v.placeholder||n("datatable.filters.checked",{defaultValue:"Checked"})})]}),e.jsxs($,{onClick:P,size:"sm",className:"w-full",children:[e.jsx(h.Plus,{className:"h-4 w-4 mr-2"}),n("datatable.filters.apply",{defaultValue:"Apply filter"})]})]})};if(!a||a.length===0)return null;const b=e.jsxs("div",{className:"space-y-4",children:[o.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(he,{className:"text-sm text-muted-foreground",children:n("datatable.filters.active",{defaultValue:"Filtres actifs"})}),e.jsxs($,{variant:"ghost",size:"sm",onClick:w,children:[e.jsx(h.Trash2,{className:"h-3 w-3 mr-1"}),n("datatable.filters.clearAll",{defaultValue:"Tout effacer"})]})]}),e.jsx("div",{className:"space-y-1",children:o.map((v,p)=>e.jsxs("div",{className:"flex items-center justify-between p-2 bg-muted rounded-md text-sm",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{className:"font-medium",children:v.label}),e.jsx("span",{className:"text-muted-foreground mx-2",children:v.operator}),e.jsx("span",{className:"text-primary truncate",children:Array.isArray(v.value)?v.value.join(", "):v.value})]}),e.jsx($,{variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>f(p),children:e.jsx(h.X,{className:"h-3 w-3"})})]},p))})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(he,{className:"text-sm text-muted-foreground",children:n("datatable.filters.available",{defaultValue:"Filtres disponibles"})}),a.map(v=>e.jsx("div",{children:k(v)},v.id))]})]}),y=e.jsxs($,{variant:"outline",size:"sm",children:[e.jsx(h.Filter,{className:"h-4 w-4 mr-2"}),n("datatable.filters.title",{defaultValue:"Filtres"}),o.length>0&&e.jsx(De,{variant:"secondary",className:"ml-2",children:o.length})]});return s==="right"||s==="left"?e.jsxs(ta,{open:c,onOpenChange:m,children:[e.jsx(Rr,{asChild:!0,children:y}),e.jsxs(Ts,{side:s,className:"w-[400px] sm:w-[540px] overflow-y-auto",children:[e.jsxs(Sa,{children:[e.jsxs(Da,{className:"flex items-center gap-2",children:[e.jsx(h.Filter,{className:"h-5 w-5"}),n("datatable.filters.title",{defaultValue:"Filtres"})]}),e.jsx(Ta,{children:n("datatable.filters.description",{defaultValue:"Appliquez des filtres pour affiner les résultats"})})]}),e.jsx("div",{className:"mt-6",children:b})]})]}):e.jsxs(ct,{open:c,onOpenChange:m,children:[e.jsx(dt,{asChild:!0,children:y}),e.jsx(rt,{className:"w-[400px] max-h-[600px] overflow-y-auto",align:s==="top"?"start":"end",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(h.Filter,{className:"h-4 w-4"}),e.jsx("h4",{className:"font-semibold text-sm",children:n("datatable.filters.title",{defaultValue:"Filtres"})})]})}),b]})})]})}function va({value:t,field:a,config:s,isEditing:r,error:n,onChange:o,onStartEdit:i,onSave:c,onCancel:m,className:d}){const[x,u]=l.useState(t),[f,w]=l.useState(!1);l.useEffect(()=>{u(t)},[t]);const k=()=>{o(x),c()},b=()=>{u(t),m()},y=p=>{p.key==="Enter"&&!p.shiftKey?(p.preventDefault(),k()):p.key==="Escape"&&(p.preventDefault(),b())};if(!r)return e.jsx("div",{className:ge("cursor-pointer hover:bg-muted/50 p-1 rounded transition-colors",d),onClick:i,children:hx(t,s)});const v=()=>{switch(s.type){case"textarea":return e.jsx(wt,{value:x||"",onChange:p=>u(p.target.value),onKeyDown:y,placeholder:s.placeholder,rows:s.rows||3,disabled:s.disabled,className:ge(n&&"border-destructive")});case"select":return e.jsxs(Oe,{value:x||"",onValueChange:u,disabled:s.disabled,children:[e.jsx(Le,{className:ge(n&&"border-destructive"),children:e.jsx(ze,{placeholder:s.placeholder})}),e.jsx(Ie,{children:s.options?.map(p=>e.jsx(be,{value:p.value,children:p.label},p.value))})]});case"checkbox":return e.jsx(et,{checked:!!x,onCheckedChange:u,disabled:s.disabled});case"switch":return e.jsx(sa,{checked:!!x,onCheckedChange:u,disabled:s.disabled});case"date":case"datetime":return e.jsxs(ct,{open:f,onOpenChange:w,children:[e.jsx(dt,{asChild:!0,children:e.jsxs($,{variant:"outline",className:ge("w-full justify-start text-left font-normal",!x&&"text-muted-foreground",n&&"border-destructive"),children:[e.jsx(h.CalendarIcon,{className:"mr-2 h-4 w-4"}),x?_.format(new Date(x),"PPP"):s.placeholder]})}),e.jsx(rt,{className:"w-auto p-0",align:"start",children:e.jsx(Ca,{mode:"single",selected:x?new Date(x):void 0,onSelect:p=>{p&&(u(s.type==="datetime"?p.toISOString():p.toISOString().split("T")[0]),w(!1))},initialFocus:!0})})]});default:return e.jsx(oe,{type:s.type,value:x||"",onChange:p=>u(p.target.value),onKeyDown:y,placeholder:s.placeholder,min:s.min,max:s.max,step:s.step,disabled:s.disabled,required:s.required,pattern:s.pattern,title:s.title,className:ge(n&&"border-destructive")})}};return e.jsxs("div",{className:ge("relative",d),children:[v(),e.jsxs("div",{className:"absolute right-1 top-1/2 -translate-y-1/2 flex gap-1",children:[e.jsx($,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:k,children:e.jsx(h.Check,{className:"h-3 w-3 text-green-600"})}),e.jsx($,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:b,children:e.jsx(h.X,{className:"h-3 w-3 text-red-600"})})]}),n&&e.jsx("p",{className:"text-xs text-destructive mt-1",children:n})]})}function hx(t,a){if(t==null)return e.jsx("span",{className:"text-muted-foreground italic",children:"Non défini"});switch(a.type){case"checkbox":case"switch":return e.jsx("span",{className:ge("inline-flex items-center px-2 py-1 rounded-full text-xs font-medium",t?"bg-green-100 text-green-800":"bg-gray-100 text-gray-800"),children:t?"Oui":"Non"});case"date":case"datetime":try{const r=new Date(t);return _.format(r,a.type==="datetime"?"PPP p":"PPP")}catch{return t}case"select":const s=a.options?.find(r=>r.value===t);return s?s.label:t;case"textarea":return e.jsx("div",{className:"max-w-xs",children:e.jsx("p",{className:"truncate",children:t})});default:return t}}function fx({data:t,columns:a,layout:s="standard",variant:r="bordered",density:n="comfortable",filters:o,filterPosition:i="top",toolbar:c,pagination:m,selection:d=!1,actions:x,i18nNamespace:u,loading:f=!1,error:w,emptyState:k,headerSticky:b=!1,columnVisibilityToggle:y=!0,columnResize:v=!1,enableExport:p=!1,enableImport:j=!1,enableReorder:C=!1,enableContextMenu:N=!1,onRowClick:S,onRowDoubleClick:A,onSortingChange:R,onFiltersChange:E,onSelectionChange:D,className:M,tableId:P,virtualization:T,edit:q}){const{t:H}=Nt.useTranslation(u),{layout:Y,setLayout:U,density:z,setDensity:V,densityClasses:L}=Vr(s,n),W=l.useMemo(()=>{const me=[...a];if(d){const ae={id:"select",header:({table:de})=>e.jsx(et,{checked:de.getIsAllPageRowsSelected(),onCheckedChange:Te=>de.toggleAllPageRowsSelected(!!Te),"aria-label":H("datatable.selectAll",{defaultValue:"Select all"})}),cell:({row:de})=>e.jsx(et,{checked:de.getIsSelected(),onCheckedChange:Te=>de.toggleSelected(!!Te),"aria-label":H("datatable.selectRow",{defaultValue:"Select row"})}),enableSorting:!1,enableHiding:!1};me.unshift(ae)}return me},[a,d,q,H]),{table:F,globalFilter:G,setGlobalFilter:ee,selectedRows:se,resetFilters:le,exportData:X}=hl({data:t,columns:W,pagination:m,tableId:P,onSortingChange:R,onFiltersChange:E,onSelectionChange:D}),[K,I]=Wr(F,{onSave:q?.onSave,onCancel:q?.onCancel,autoSave:q?.autoSave,autoSaveDelay:q?.autoSaveDelay});if(q?.editableColumns&&q.editableColumns.length>0){const me={id:"edit-actions",header:()=>H("datatable.actions",{defaultValue:"Actions"}),cell:({row:ae})=>K.editingRowId===ae.id?e.jsxs("div",{className:"flex gap-1",children:[e.jsx($,{size:"sm",variant:"ghost",onClick:()=>I.saveEdit(),disabled:!K.hasChanges,children:H("datatable.save",{defaultValue:"Save"})}),e.jsx($,{size:"sm",variant:"ghost",onClick:()=>I.cancelEdit(),children:H("datatable.cancel",{defaultValue:"Cancel"})})]}):e.jsx($,{size:"sm",variant:"ghost",onClick:()=>{console.log("🔧 Starting edit for row:",ae.id,ae.original),I.startEdit(ae.id,ae.original)},children:H("datatable.edit",{defaultValue:"Edit"})}),enableSorting:!1,enableHiding:!1};W.push(me)}const te=l.useCallback(me=>{const ae=X();console.log("Export",me,ae)},[X]),Z=l.useCallback(me=>{console.log("Import",me)},[]),J={bordered:"border rounded-lg",minimal:"",striped:"[&_tbody_tr:nth-child(even)]:bg-muted/50",glass:"backdrop-blur-sm bg-background/80 border rounded-lg"};if(f)return e.jsx("div",{className:"flex items-center justify-center h-64 border rounded-lg",children:e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsx(h.Loader2,{className:"h-8 w-8 animate-spin text-muted-foreground"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:H("datatable.loading",{defaultValue:"Loading..."})})]})});if(w)return e.jsx("div",{className:"flex items-center justify-center h-64 border rounded-lg bg-destructive/10",children:e.jsxs("div",{className:"flex flex-col items-center gap-2 text-destructive",children:[e.jsx(h.AlertCircle,{className:"h-8 w-8"}),e.jsx("p",{className:"text-sm font-medium",children:w})]})});if(!t||t.length===0)return e.jsxs("div",{className:"flex flex-col",children:[c&&e.jsx(Ks,{table:F,config:c,globalFilter:G,onGlobalFilterChange:ee,density:z,onDensityChange:V,onExport:p?te:void 0,onImport:j?Z:void 0}),e.jsx("div",{className:"flex items-center justify-center h-64 border rounded-lg",children:k||e.jsxs("div",{className:"flex flex-col items-center gap-2 text-muted-foreground",children:[e.jsx("p",{className:"text-lg font-medium",children:H("datatable.noData",{defaultValue:"No data"})}),e.jsx("p",{className:"text-sm",children:H("datatable.noDataDescription",{defaultValue:"There are no results to display"})})]})})]});const ne=()=>{const me=e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[c&&e.jsx("div",{className:"flex-1",children:e.jsx(Ks,{table:F,config:c,globalFilter:G,onGlobalFilterChange:ee,density:z,onDensityChange:V,onExport:p?te:void 0,onImport:j?Z:void 0})}),o&&e.jsx(Br,{table:F,filters:o,position:i,onFiltersChange:E})]}),e.jsx("div",{className:ge("w-full overflow-auto",J[r]),children:e.jsxs("table",{className:ge("w-full caption-bottom text-sm",L.table),children:[e.jsx("thead",{className:ge(b&&"sticky top-0 bg-background z-10"),children:F.getHeaderGroups().map(ae=>e.jsx("tr",{className:"border-b",children:ae.headers.map(de=>e.jsxs("th",{className:ge("text-left font-medium text-muted-foreground",L.header,de.column.getCanSort()&&"cursor-pointer select-none hover:text-foreground"),onClick:de.column.getToggleSortingHandler(),children:[de.isPlaceholder?null:qe.flexRender(de.column.columnDef.header,de.getContext()),de.column.getIsSorted()&&e.jsx("span",{className:"ml-2",children:de.column.getIsSorted()==="asc"?"↑":"↓"})]},de.id))},ae.id))}),e.jsx("tbody",{children:F.getRowModel().rows.map(ae=>e.jsx("tr",{className:ge("border-b transition-colors",S&&"cursor-pointer hover:bg-muted/50",ae.getIsSelected()&&"bg-muted"),onClick:()=>S?.(ae.original),onDoubleClick:()=>A?.(ae.original),children:ae.getVisibleCells().map(de=>{const Te=de.getValue(),Ce=de.column.id,Je=ae.id,xt=K.editingRowId===Je,Ke=q?.editableColumns?.find(tt=>tt.field===Ce);return Ke&&xt?e.jsx("td",{className:ge("align-middle",L.cell),children:e.jsx(va,{value:Te,field:Ce,config:Ke.config,isEditing:xt,onChange:tt=>I.updateField(Ce,tt),onStartEdit:()=>I.startEdit(Je,ae.original),onSave:()=>I.saveEdit(),onCancel:()=>I.cancelEdit()})},de.id):e.jsx("td",{className:ge("align-middle",L.cell),children:qe.flexRender(de.column.columnDef.cell,de.getContext())},de.id)})},ae.id))})]})}),m&&e.jsx(Ur,{table:F,pageSizeOptions:m.pageSizeOptions})]});return e.jsx("div",{className:"space-y-4",children:me})};return e.jsx("div",{className:ge("w-full",M),children:ne()})}function fl({data:t,columns:a,pagination:s,tableId:r,onSortingChange:n,onFiltersChange:o,onSelectionChange:i,onColumnOrderChange:c,onExpandedChange:m,onGroupingChange:d,grouping:x,virtualization:u,sortMode:f="multiple",performance:w}){const k=O.useMemo(()=>r?px(r):null,[r]),[b,y]=O.useState(k?.sorting||[]),[v,p]=O.useState(k?.columnFilters||[]),[j,C]=O.useState(k?.columnVisibility||{}),[N,S]=O.useState(k?.columnOrder||[]),[A,R]=O.useState(k?.expanded||{}),[E,D]=O.useState(k?.grouping||[]),[M,P]=O.useState(k?.rowSelection||{}),[T,q]=O.useState(k?.globalFilter||""),[H,Y]=O.useState({pageIndex:s?.currentPage||0,pageSize:s?.pageSize||10}),[U,z]=O.useState(v);O.useEffect(()=>{const J=setTimeout(()=>{z(v)},w?.filterDebounceMs||300);return()=>clearTimeout(J)},[v,w?.filterDebounceMs]),O.useEffect(()=>{x?.columns&&x.columns.length>0&&E.length===0&&D([x.columns[0]])},[x?.columns,E.length]),O.useEffect(()=>{r&&xx(r,{sorting:b,columnFilters:v,columnVisibility:j,columnOrder:N,expanded:A,grouping:E,pagination:H,globalFilter:T,density:"comfortable",layout:"standard",rowSelection:M})},[r,b,v,j,N,A,E,H,T,M]),O.useEffect(()=>{n?.(b)},[b,n]),O.useEffect(()=>{o?.(U)},[U,o]),O.useEffect(()=>{const J=V.getFilteredSelectedRowModel().rows.map(ne=>ne.original);i?.(J)},[M]),O.useEffect(()=>{c?.(N)},[N,c]),O.useEffect(()=>{m?.(A)},[A,m]),O.useEffect(()=>{d?.(E)},[E,d]);const V=qe.useReactTable({data:t,columns:a,state:{sorting:b,columnFilters:U,columnVisibility:j,columnOrder:N,expanded:A,grouping:E,rowSelection:M,globalFilter:T,pagination:H},enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0,enableGrouping:!0,enableExpanding:!0,enableColumnResizing:!0,enableSorting:!0,enableMultiSort:f==="multiple",enableFilters:!0,enableGlobalFilter:!0,enableColumnFilters:!0,onRowSelectionChange:P,onSortingChange:y,onColumnFiltersChange:p,onColumnVisibilityChange:C,onColumnOrderChange:S,onExpandedChange:R,onGroupingChange:D,onGlobalFilterChange:q,onPaginationChange:Y,getCoreRowModel:qe.getCoreRowModel(),getFilteredRowModel:qe.getFilteredRowModel(),getPaginationRowModel:qe.getPaginationRowModel(),getSortedRowModel:qe.getSortedRowModel(),getGroupedRowModel:qe.getGroupedRowModel(),getExpandedRowModel:qe.getExpandedRowModel(),getFacetedRowModel:qe.getFacetedRowModel(),getFacetedUniqueValues:qe.getFacetedUniqueValues(),globalFilterFn:gx,manualPagination:s?.mode==="server",pageCount:s?.mode==="server"?Math.ceil((s.totalItems||0)/H.pageSize):void 0,columnResizeMode:"onChange",sortDescFirst:!1}),L=O.useMemo(()=>V.getFilteredSelectedRowModel().rows.map(J=>J.original),[V,M]),W=O.useCallback(()=>{p([]),q("")},[]),F=O.useCallback(()=>{P({})},[]),G=O.useCallback(()=>{y([]),p([]),C({}),S([]),R({}),D([]),P({}),q(""),Y({pageIndex:0,pageSize:s?.pageSize||10})},[s?.pageSize]),ee=O.useCallback(()=>V.getFilteredRowModel().rows.map(J=>J.original),[V]),se=O.useCallback(()=>x?.columns?.length?V.getGroupedRowModel().rows.map(J=>J.original):t,[V,x,t]),le=O.useCallback(()=>V.getExpandedRowModel().rows.map(J=>J.original),[V]),X=O.useCallback(J=>{D(ne=>ne.includes(J)?ne.filter(ae=>ae!==J):[...ne,J])},[]),K=O.useCallback(()=>{D([])},[]),I=O.useCallback(J=>{R(ne=>({...ne,[J]:!ne[J]}))},[]),te=O.useCallback(()=>{const J=V.getRowModel().rows.map(me=>me.id),ne={};J.forEach(me=>{ne[me]=!0}),R(ne)},[V]),Z=O.useCallback(()=>{R({})},[]);return{table:V,sorting:b,setSorting:y,columnFilters:v,setColumnFilters:p,columnVisibility:j,setColumnVisibility:C,columnOrder:N,setColumnOrder:S,expanded:A,setExpanded:R,grouping:E,setGrouping:D,rowSelection:M,setRowSelection:P,globalFilter:T,setGlobalFilter:q,pagination:H,setPagination:Y,selectedRows:L,resetFilters:W,resetSelection:F,resetAll:G,exportData:ee,getGroupedData:se,getExpandedData:le,toggleGrouping:X,clearGrouping:K,toggleRowExpansion:I,expandAll:te,collapseAll:Z}}function px(t){try{const a=localStorage.getItem(`datatable-${t}`);return a?JSON.parse(a):null}catch{return null}}function xx(t,a){try{localStorage.setItem(`datatable-${t}`,JSON.stringify(a))}catch{}}function gx(t,a,s){const r=s.toLowerCase();return t.getVisibleCells().some(n=>{const o=n.getValue();return o==null?!1:String(o).toLowerCase().includes(r)})}function pl({data:t,virtualization:a,containerRef:s}){const[r,n]=O.useState(a?.containerHeight||600);O.useEffect(()=>{if(!s.current||!a)return;const f=new ResizeObserver(w=>{for(const k of w)n(k.contentRect.height)});return f.observe(s.current),()=>{f.disconnect()}},[s,a]);const o=O.useMemo(()=>{if(!a||a.type==="none")return null;const f={count:t.length,getScrollElement:()=>s.current,estimateSize:()=>a.itemHeight||50,overscan:a.overscan||5};return a.type==="dynamic"?{...f,estimateSize:()=>a.estimatedItemHeight||50}:f},[t.length,a,s]),i=o?td.useVirtualizer(o):null,c=O.useCallback((f,w="start")=>{i&&i.scrollToIndex(f,{align:w})},[i]),m=O.useCallback(f=>{i&&i.scrollToOffset(f)},[i]),d=O.useCallback(()=>i?i.getVirtualItems():[],[i]),x=O.useCallback(()=>i?i.getTotalSize():0,[i]),u=a?.type!=="none"&&o!==null;return{virtualizer:i,isVirtualized:u,containerHeight:r,scrollToIndex:c,scrollToOffset:m,getVirtualItems:d,getTotalSize:x,virtualItems:i?i.getVirtualItems():[],totalSize:i?i.getTotalSize():0}}function xl({data:t,columns:a,exportConfig:s}){const r=O.useMemo(()=>({formats:["csv","xlsx","json"],filename:"export",includeHeaders:!0,...s}),[s]),n=O.useCallback((f,w)=>{if(!f.length)return;const k=a.filter(j=>j.accessorKey||j.id).map(j=>j.header||j.accessorKey||j.id).join(","),b=f.map(j=>a.filter(C=>C.accessorKey||C.id).map(C=>{const N=C.accessorKey?j[C.accessorKey]:j[C.id],S=C.formatter?C.formatter(N):N,A=String(S||"");return A.includes(",")||A.includes('"')||A.includes(`
|
|
16
|
+
`)?`"${A.replace(/"/g,'""')}"`:A}).join(",")),y=[k,...b].join(`
|
|
17
|
+
`),v=new Blob([y],{type:"text/csv;charset=utf-8;"}),p=document.createElement("a");p.href=URL.createObjectURL(v),p.download=`${w||r.filename}.csv`,p.click(),URL.revokeObjectURL(p.href)},[a,r.filename]),o=O.useCallback((f,w)=>{const k=JSON.stringify(f,null,2),b=new Blob([k],{type:"application/json"}),y=document.createElement("a");y.href=URL.createObjectURL(b),y.download=`${w||r.filename}.json`,y.click(),URL.revokeObjectURL(y.href)},[r.filename]),i=O.useCallback(async(f,w)=>{try{if(typeof window>"u")throw new Error("XLSX export not available in server environment");const k=await import("xlsx"),y=[a.filter(j=>j.accessorKey||j.id).map(j=>j.header||j.accessorKey||j.id),...f.map(j=>a.filter(C=>C.accessorKey||C.id).map(C=>{const N=C.accessorKey?j[C.accessorKey]:j[C.id];return C.formatter?C.formatter(N):N}))],v=k.utils.aoa_to_sheet(y),p=k.utils.book_new();k.utils.book_append_sheet(p,v,"Sheet1"),k.writeFile(p,`${w||r.filename}.xlsx`)}catch(k){throw console.error("Erreur lors de l'export XLSX:",k),new Error("La librairie xlsx n'est pas disponible")}},[a,r.filename]),c=O.useCallback(async(f,w)=>{try{if(typeof window>"u")throw new Error("PDF export not available in server environment");const k=await import("jspdf"),b=await import("jspdf-autotable"),y=new k.default,v=a.filter(j=>j.accessorKey||j.id).map(j=>j.header||j.accessorKey||j.id),p=f.map(j=>a.filter(C=>C.accessorKey||C.id).map(C=>{const N=C.accessorKey?j[C.accessorKey]:j[C.id];return C.formatter?C.formatter(N):N}));y.autoTable({head:[v],body:p,startY:20,styles:{fontSize:8},headStyles:{fillColor:[66,139,202]}}),y.save(`${w||r.filename}.pdf`)}catch(k){throw console.error("Erreur lors de l'export PDF:",k),new Error("Les librairies jsPDF et jspdf-autotable ne sont pas disponibles")}},[a,r.filename]),m=O.useCallback((f,w)=>{const k=a.filter(p=>p.accessorKey||p.id).map(p=>p.accessorKey||p.id);let b=`<?xml version="1.0" encoding="UTF-8"?>
|
|
18
|
+
<data>
|
|
19
|
+
`;f.forEach((p,j)=>{b+=` <row id="${j}">
|
|
20
|
+
`,k.forEach(C=>{const N=p[C],S=String(N||"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");b+=` <${C}>${S}</${C}>
|
|
21
|
+
`}),b+=` </row>
|
|
22
|
+
`}),b+="</data>";const y=new Blob([b],{type:"application/xml"}),v=document.createElement("a");v.href=URL.createObjectURL(y),v.download=`${w||r.filename}.xml`,v.click(),URL.revokeObjectURL(v.href)},[a,r.filename]),d=O.useCallback(async(f,w,k)=>{const b=w||t,y=k||r.filename;if(r.onExport){r.onExport(b,f);return}switch(f.toLowerCase()){case"csv":n(b,y);break;case"json":o(b,y);break;case"xlsx":await i(b,y);break;case"pdf":await c(b,y);break;case"xml":m(b,y);break;default:throw new Error(`Format d'export non supporté: ${f}`)}},[t,r,n,o,i,c,m]),x=O.useCallback(async f=>d(f),[d]),u=O.useCallback(async(f,w)=>d(f,w),[d]);return{exportData:d,exportAll:x,exportSelected:u,supportedFormats:r.formats,isExportSupported:f=>r.formats.includes(f)}}function gl({importConfig:t}){const a=O.useMemo(()=>({accept:".csv,.xlsx,.json,.xml",...t}),[t]),s=O.useCallback((u,f=",")=>{const w=u.split(`
|
|
23
|
+
`).filter(y=>y.trim());if(w.length===0)return[];const k=w[0].split(f).map(y=>y.trim().replace(/"/g,""));return w.slice(1).map(y=>{const v=y.split(f).map(j=>j.trim().replace(/"/g,"")),p={};return k.forEach((j,C)=>{p[j]=v[C]||""}),p})},[]),r=O.useCallback(u=>{try{const f=JSON.parse(u);return Array.isArray(f)?f:[f]}catch{throw new Error("Format JSON invalide")}},[]),n=O.useCallback(u=>{try{const k=new DOMParser().parseFromString(u,"text/xml").querySelectorAll("row");return Array.from(k).map(b=>{const y={};return Array.from(b.children).forEach(v=>{y[v.tagName]=v.textContent||""}),y})}catch{throw new Error("Format XML invalide")}},[]),o=O.useCallback(async u=>{try{if(typeof window>"u")throw new Error("XLSX parsing not available in server environment");const f=await import("xlsx"),w=await u.arrayBuffer(),k=f.read(w,{type:"array"}),b=k.SheetNames[0],y=k.Sheets[b],v=f.utils.sheet_to_json(y,{header:1});if(v.length===0)return[];const p=v[0];return v.slice(1).map(j=>{const C={};return p.forEach((N,S)=>{C[N]=j[S]||""}),C})}catch{throw new Error("Erreur lors du parsing du fichier XLSX")}},[]),i=O.useCallback(u=>a.validate?a.validate(u):Array.isArray(u)?u.length===0?{valid:!1,errors:["Aucune donnée trouvée"]}:{valid:!0,errors:[]}:{valid:!1,errors:["Les données doivent être un tableau"]},[a.validate]),c=O.useCallback(u=>a.columnMapping?u.map(f=>{const w={};return Object.entries(a.columnMapping).forEach(([k,b])=>{f[k]!==void 0&&(w[b]=f[k])}),w}):u,[a.columnMapping]),m=O.useCallback(async u=>{const f=u.name.split(".").pop()?.toLowerCase();let w=[];try{const k=await u.text();switch(f){case"csv":w=s(k,a.parseOptions?.csv?.delimiter);break;case"json":w=r(k);break;case"xml":w=n(k);break;case"xlsx":w=await o(u);break;default:throw new Error(`Format de fichier non supporté: ${f}`)}const b=i(w);if(!b.valid)throw new Error(`Données invalides: ${b.errors.join(", ")}`);const y=c(w);return a.onImport&&a.onImport(y),y}catch(k){throw new Error(`Erreur lors de l'import: ${k instanceof Error?k.message:"Erreur inconnue"}`)}},[a,s,r,n,o,i,c]),d=O.useCallback(()=>{const u=document.createElement("input");return u.type="file",u.accept=a.accept,u.multiple=!1,u},[a.accept]),x=O.useCallback(()=>new Promise((u,f)=>{const w=d();w.onchange=async k=>{const b=k.target.files?.[0];if(!b){f(new Error("Aucun fichier sélectionné"));return}try{const y=await m(b);u(y)}catch(y){f(y)}},w.click()}),[d,m]);return{importData:m,importWithUI:x,supportedFormats:a.accept?.split(",")||[],isFormatSupported:u=>{const f=u.split(".").pop()?.toLowerCase();return a.accept?.includes(f||"")||!1}}}function bl({theme:t,variant:a="bordered",density:s="comfortable"}){const r={colors:{primary:"hsl(var(--primary))",secondary:"hsl(var(--secondary))",accent:"hsl(var(--accent))",background:"hsl(var(--background))",surface:"hsl(var(--card))",text:"hsl(var(--foreground))",textSecondary:"hsl(var(--muted-foreground))",border:"hsl(var(--border))",hover:"hsl(var(--muted))",selected:"hsl(var(--accent))",disabled:"hsl(var(--muted))"},spacing:{xs:"0.25rem",sm:"0.5rem",md:"1rem",lg:"1.5rem",xl:"2rem"},typography:{fontFamily:"inherit",fontSize:{xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem"},fontWeight:{normal:"400",medium:"500",semibold:"600",bold:"700"}},borders:{radius:{sm:"0.25rem",md:"0.5rem",lg:"0.75rem"},width:{thin:"1px",medium:"2px",thick:"4px"}},shadows:{sm:"0 1px 2px 0 rgb(0 0 0 / 0.05)",md:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",lg:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)"}},n=O.useMemo(()=>t?{colors:{...r.colors,...t.colors},spacing:{...r.spacing,...t.spacing},typography:{...r.typography,...t.typography},borders:{...r.borders,...t.borders},shadows:{...r.shadows,...t.shadows}}:r,[t,r]),o=O.useMemo(()=>{const x="w-full";switch(a){case"bordered":return`${x} border rounded-lg`;case"minimal":return x;case"striped":return`${x} [&_tbody_tr:nth-child(even)]:bg-muted/50`;case"glass":return`${x} backdrop-blur-sm bg-background/80 border rounded-lg`;default:return x}},[a]),i=O.useMemo(()=>{switch(s){case"spacious":return{table:"text-base",header:"px-6 py-4",cell:"px-6 py-4",row:"h-16"};case"compact":return{table:"text-sm",header:"px-3 py-2",cell:"px-3 py-2",row:"h-8"};case"comfortable":default:return{table:"text-sm",header:"px-4 py-3",cell:"px-4 py-3",row:"h-12"}}},[s]),c=O.useMemo(()=>{const x={};return n.colors&&Object.entries(n.colors).forEach(([u,f])=>{x[`--datatable-color-${u}`]=f}),n.spacing&&Object.entries(n.spacing).forEach(([u,f])=>{x[`--datatable-spacing-${u}`]=f}),n.typography&&(n.typography.fontFamily&&(x["--datatable-font-family"]=n.typography.fontFamily),n.typography.fontSize&&Object.entries(n.typography.fontSize).forEach(([u,f])=>{x[`--datatable-font-size-${u}`]=f}),n.typography.fontWeight&&Object.entries(n.typography.fontWeight).forEach(([u,f])=>{x[`--datatable-font-weight-${u}`]=f})),n.borders&&(n.borders.radius&&Object.entries(n.borders.radius).forEach(([u,f])=>{x[`--datatable-radius-${u}`]=f}),n.borders.width&&Object.entries(n.borders.width).forEach(([u,f])=>{x[`--datatable-border-width-${u}`]=f})),n.shadows&&Object.entries(n.shadows).forEach(([u,f])=>{x[`--datatable-shadow-${u}`]=f}),x},[n]),m=O.useCallback((x,u)=>u?`${x} [--datatable-theme-key:${u}]`:x,[]),d=O.useCallback((x={})=>({...x,...c}),[c]);return{theme:n,variantClasses:o,densityClasses:i,customStyles:c,getThemedClass:m,getThemedStyles:d}}function bx({data:t,columns:a,layout:s="standard",variant:r="bordered",density:n="comfortable",filters:o,filterPosition:i="top",toolbar:c,pagination:m,selection:d=!1,actions:x,i18nNamespace:u,loading:f=!1,error:w,emptyState:k,headerSticky:b=!1,columnVisibilityToggle:y=!0,columnResize:v=!1,columnOrder:p,grouping:j,rowExpansion:C,virtualization:N,sortMode:S="multiple",enableExport:A=!1,enableImport:R=!1,enableReorder:E=!1,enableContextMenu:D=!1,onRowClick:M,onRowDoubleClick:P,onSortingChange:T,onFiltersChange:q,onSelectionChange:H,onColumnOrderChange:Y,onExpandedChange:U,onGroupingChange:z,className:V,tableId:L,edit:W,theme:F,performance:G}){const{t:ee}=Nt.useTranslation(u),se=l.useRef(null),{layout:le,setLayout:X,density:K,setDensity:I,densityClasses:te}=Vr(s,n),{theme:Z,variantClasses:J,densityClasses:ne,customStyles:me,getThemedClass:ae,getThemedStyles:de}=bl({theme:F,variant:r,density:K}),Te=l.useMemo(()=>{const ye=[...a];if(d){const ce={id:"select",header:({table:Fe})=>e.jsx(et,{checked:Fe.getIsAllPageRowsSelected(),onCheckedChange:at=>Fe.toggleAllPageRowsSelected(!!at),"aria-label":ee("datatable.selectAll",{defaultValue:"Select all"})}),cell:({row:Fe})=>e.jsx(et,{checked:Fe.getIsSelected(),onCheckedChange:at=>Fe.toggleSelected(!!at),"aria-label":ee("datatable.selectRow",{defaultValue:"Select row"})}),enableSorting:!1,enableHiding:!1,size:50};ye.unshift(ce)}if(C?.enabled){const ce={id:"expand",header:()=>null,cell:({row:Fe})=>Fe.getCanExpand()?e.jsx($,{variant:"ghost",size:"sm",onClick:()=>Fe.toggleExpanded(),className:"h-8 w-8 p-0",children:Fe.getIsExpanded()?e.jsx(h.ChevronDown,{className:"h-4 w-4"}):e.jsx(h.ChevronRight,{className:"h-4 w-4"})}):null,enableSorting:!1,enableHiding:!1,size:50};ye.unshift(ce)}if(E){const ce={id:"reorder",header:()=>null,cell:()=>e.jsx($,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 cursor-move",children:e.jsx(h.GripVertical,{className:"h-4 w-4"})}),enableSorting:!1,enableHiding:!1,size:50};ye.unshift(ce)}return ye},[a,d,C,E,ee]);console.log("DataTableAdvanced - props:",{grouping:j,rowExpansion:C,dataLength:t.length});const{table:Ce,sorting:Je,setSorting:xt,columnFilters:Ke,setColumnFilters:tt,columnVisibility:gt,setColumnVisibility:Mt,columnOrder:Qe,setColumnOrder:B,expanded:Q,setExpanded:re,grouping:we,setGrouping:je,rowSelection:Pt,setRowSelection:ys,globalFilter:Fa,setGlobalFilter:$a,pagination:ra,setPagination:ac,selectedRows:rc,resetFilters:At,resetSelection:rs,resetAll:Vt,exportData:na,getGroupedData:La,getExpandedData:Ia,toggleGrouping:Dt,clearGrouping:Oa,toggleRowExpansion:bt,expandAll:As,collapseAll:jt}=fl({data:t,columns:Te,pagination:m,tableId:L,onSortingChange:T,onFiltersChange:q,onSelectionChange:H,onColumnOrderChange:Y,onExpandedChange:U,onGroupingChange:z,grouping:j,virtualization:N,sortMode:S,performance:G}),{isVirtualized:Rt,virtualItems:ns,totalSize:oa,scrollToIndex:pn,scrollToOffset:za}=pl({data:t,virtualization:N,containerRef:se}),{exportData:ia,exportAll:xn,exportSelected:Rs}=xl({data:t,columns:Te,exportConfig:typeof A=="object"?A:void 0}),{importWithUI:Fs,supportedFormats:nc}=gl({importConfig:typeof R=="object"?R:void 0}),[os,vt]=Wr(Ce,{onSave:W?.onSave,onCancel:W?.onCancel,autoSave:W?.autoSave,autoSaveDelay:W?.autoSaveDelay});if(W?.editableColumns&&W.editableColumns.length>0){const ye={id:"edit-actions",header:()=>ee("datatable.actions",{defaultValue:"Actions"}),cell:({row:ce})=>os.editingRowId===ce.id?e.jsxs("div",{className:"flex gap-1",children:[e.jsx($,{size:"sm",variant:"ghost",onClick:()=>vt.saveEdit(),disabled:!os.hasChanges,children:ee("datatable.save",{defaultValue:"Save"})}),e.jsx($,{size:"sm",variant:"ghost",onClick:()=>vt.cancelEdit(),children:ee("datatable.cancel",{defaultValue:"Cancel"})})]}):e.jsx($,{size:"sm",variant:"ghost",onClick:()=>vt.startEdit(ce.id,ce.original),children:ee("datatable.edit",{defaultValue:"Edit"})}),enableSorting:!1,enableHiding:!1};Te.push(ye)}const la=l.useCallback(async ye=>{try{await ia(ye)}catch(ce){console.error("Erreur lors de l'export:",ce)}},[ia]),ca=l.useCallback(async()=>{try{const ye=await Fs();console.log("Données importées:",ye)}catch(ye){console.error("Erreur lors de l'import:",ye)}},[Fs]);if(f)return e.jsx("div",{className:"flex items-center justify-center h-64 border rounded-lg",children:e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsx(h.Loader2,{className:"h-8 w-8 animate-spin text-muted-foreground"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:ee("datatable.loading",{defaultValue:"Loading..."})})]})});if(w)return e.jsx("div",{className:"flex items-center justify-center h-64 border rounded-lg bg-destructive/10",children:e.jsxs("div",{className:"flex flex-col items-center gap-2 text-destructive",children:[e.jsx(h.AlertCircle,{className:"h-8 w-8"}),e.jsx("p",{className:"text-sm font-medium",children:w})]})});if(!t||t.length===0)return e.jsxs("div",{className:"flex flex-col",children:[c&&e.jsx(Ks,{table:Ce,config:c,globalFilter:Fa,onGlobalFilterChange:$a,density:K,onDensityChange:I,onExport:A?la:void 0,onImport:R?ca:void 0}),e.jsx("div",{className:"flex items-center justify-center h-64 border rounded-lg",children:k||e.jsxs("div",{className:"flex flex-col items-center gap-2 text-muted-foreground",children:[e.jsx("p",{className:"text-lg font-medium",children:ee("datatable.noData",{defaultValue:"No data"})}),e.jsx("p",{className:"text-sm",children:ee("datatable.noDataDescription",{defaultValue:"There are no results to display"})})]})})]});const da=()=>Rt?e.jsx("div",{ref:se,className:"h-full overflow-auto",style:{height:N?.containerHeight||600},children:e.jsxs("table",{className:ge("w-full caption-bottom text-sm",ne.table),style:de(),children:[e.jsx("thead",{className:ge(b&&"sticky top-0 bg-background z-10"),children:Ce.getHeaderGroups().map(ye=>e.jsx("tr",{className:"border-b",children:ye.headers.map(ce=>e.jsxs("th",{className:ge("text-left font-medium text-muted-foreground",ne.header,ce.column.getCanSort()&&"cursor-pointer select-none hover:text-foreground"),onClick:ce.column.getToggleSortingHandler(),style:{width:ce.getSize(),minWidth:ce.column.columnDef.minSize,maxWidth:ce.column.columnDef.maxSize},children:[ce.isPlaceholder?null:qe.flexRender(ce.column.columnDef.header,ce.getContext()),ce.column.getIsSorted()&&e.jsx("span",{className:"ml-2",children:ce.column.getIsSorted()==="asc"?"↑":"↓"})]},ce.id))},ye.id))}),e.jsx("tbody",{children:ns.map(ye=>{const Fe=(j?.columns?.length?Ce.getGroupedRowModel().rows:C?.enabled?Ce.getExpandedRowModel().rows:Ce.getRowModel().rows)[ye.index];return Fe?e.jsx("tr",{className:ge("border-b transition-colors",M&&"cursor-pointer hover:bg-muted/50",Fe.getIsSelected()&&"bg-muted"),onClick:()=>M?.(Fe.original),onDoubleClick:()=>P?.(Fe.original),style:{position:"absolute",top:ye.start,left:0,width:"100%",height:ye.size},children:Fe.getVisibleCells().map(at=>{const is=at.getValue(),_e=at.column.id,Be=Fe.id,ve=os.editingRowId===Be,ls=W?.editableColumns?.find(Wt=>Wt.field===_e);return ls&&ve?e.jsx("td",{className:ge("align-middle",ne.cell),children:e.jsx(va,{value:is,field:_e,config:ls.config,isEditing:ve,onChange:Wt=>vt.updateField(_e,Wt),onStartEdit:()=>vt.startEdit(Be,Fe.original),onSave:()=>vt.saveEdit(),onCancel:()=>vt.cancelEdit()})},at.id):e.jsx("td",{className:ge("align-middle",ne.cell),children:qe.flexRender(at.column.columnDef.cell,at.getContext())},at.id)})},Fe.id):null})})]})}):e.jsx("div",{className:ge("w-full overflow-auto",J),children:e.jsxs("table",{className:ge("w-full caption-bottom text-sm",ne.table),style:de(),children:[e.jsx("thead",{className:ge(b&&"sticky top-0 bg-background z-10"),children:Ce.getHeaderGroups().map(ye=>e.jsx("tr",{className:"border-b",children:ye.headers.map(ce=>e.jsxs("th",{className:ge("text-left font-medium text-muted-foreground",ne.header,ce.column.getCanSort()&&"cursor-pointer select-none hover:text-foreground"),onClick:ce.column.getToggleSortingHandler(),style:{width:ce.getSize(),minWidth:ce.column.columnDef.minSize,maxWidth:ce.column.columnDef.maxSize},children:[ce.isPlaceholder?null:qe.flexRender(ce.column.columnDef.header,ce.getContext()),ce.column.getIsSorted()&&e.jsx("span",{className:"ml-2",children:ce.column.getIsSorted()==="asc"?"↑":"↓"})]},ce.id))},ye.id))}),e.jsx("tbody",{children:(()=>{const ye=j?.columns?.length?Ce.getGroupedRowModel().rows:C?.enabled?Ce.getExpandedRowModel().rows:Ce.getRowModel().rows;return console.log("DataTableAdvanced - rendering rows:",{totalRows:ye.length,grouping:j?.columns,rowExpansion:C?.enabled,firstRow:ye[0]}),ye.map((ce,Fe)=>{const at=ce.getIsGrouped(),is=ce.getIsExpanded();return e.jsxs(l.Fragment,{children:[e.jsx("tr",{className:ge("border-b transition-colors",M&&"cursor-pointer hover:bg-muted/50",ce.getIsSelected()&&"bg-muted",at&&"bg-muted/30 font-medium"),onClick:()=>M?.(ce.original),onDoubleClick:()=>P?.(ce.original),children:ce.getVisibleCells().map(_e=>{const Be=_e.getValue(),ve=_e.column.id,ls=ce.id,Wt=os.editingRowId===ls,$s=W?.editableColumns?.find(ht=>ht.field===ve);return $s&&Wt?e.jsx("td",{className:ge("align-middle",ne.cell),children:e.jsx(va,{value:Be,field:ve,config:$s.config,isEditing:Wt,onChange:ht=>vt.updateField(ve,ht),onStartEdit:()=>vt.startEdit(ls,ce.original),onSave:()=>vt.saveEdit(),onCancel:()=>vt.cancelEdit()})},_e.id):e.jsx("td",{className:ge("align-middle",ne.cell),children:at?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:ht=>{ht.stopPropagation(),ce.toggleExpanded()},className:"p-1 hover:bg-muted rounded",children:is?"▼":"▶"}),e.jsxs("span",{className:"font-medium",children:[_e.getValue()," (",ce.subRows.length," éléments)"]})]}):qe.flexRender(_e.column.columnDef.cell,_e.getContext())},_e.id)})}),C?.enabled&&is&&e.jsx("tr",{children:e.jsx("td",{colSpan:Te.length,className:"p-0",children:e.jsx("div",{className:"border-b",children:C.renderExpanded?.(ce.original)})})},`${ce.id}-expanded-${Fe}`)]},`${ce.id}-${Fe}`)})})()})]})});return e.jsxs("div",{className:ge("w-full",V),style:de(),children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[c&&e.jsx("div",{className:"flex-1",children:e.jsx(Ks,{table:Ce,config:c,globalFilter:Fa,onGlobalFilterChange:$a,density:K,onDensityChange:I,onExport:A?la:void 0,onImport:R?ca:void 0})}),o&&e.jsx(Br,{table:Ce,filters:o,position:i,onFiltersChange:q})]}),da(),m&&e.jsx(Ur,{table:Ce,pageSizeOptions:m.pageSizeOptions})]})}function jx({header:t,column:a,className:s}){const[r,n]=l.useState(!1),o=l.useCallback(i=>{i.preventDefault(),i.stopPropagation(),n(!0);const c=i.clientX,m=a.getSize(),d=u=>{const f=u.clientX-c,w=Math.max(50,m+f);a.setSize(w)},x=()=>{n(!1),document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",x)};document.addEventListener("mousemove",d),document.addEventListener("mouseup",x)},[a]);return a.getCanResize()?e.jsx("div",{className:ge("absolute right-0 top-0 h-full w-1 cursor-col-resize bg-border opacity-0 hover:opacity-100 transition-opacity",r&&"opacity-100 bg-primary",s),onMouseDown:o,style:{width:"4px",marginRight:"-2px"}}):null}function vx({row:t,table:a,className:s}){const[r,n]=l.useState(t.getIsExpanded()),o=l.useCallback(()=>{n(!r),t.toggleExpanded()},[r,t]);t.getValue(t.groupingColumnId);const i=t.subRows.length;return e.jsxs("div",{className:ge("flex items-center gap-2 py-2",s),children:[e.jsx($,{variant:"ghost",size:"sm",onClick:o,className:"h-6 w-6 p-0",children:r?e.jsx(h.ChevronDown,{className:"h-4 w-4"}):e.jsx(h.ChevronRight,{className:"h-4 w-4"})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium",children:qe.flexRender(t.groupingColumn.columnDef.cell,t.getGroupingValue())}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:["(",i," ",i===1?"item":"items",")"]})]})]})}function wx({row:t,table:a,className:s}){const r=t.getAggregationValue();return r?e.jsx("div",{className:ge("flex items-center gap-4 py-2 bg-muted/50",s),children:Object.entries(r).map(([n,o])=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-sm font-medium",children:[n,":"]}),e.jsx("span",{className:"text-sm text-muted-foreground",children:typeof o=="number"?o.toLocaleString():String(o)})]},n))}):null}function yx({table:t,groupingColumns:a,onGroupingChange:s,className:r}){const[n,o]=l.useState(a),i=l.useCallback(m=>{const d=n.includes(m)?n.filter(x=>x!==m):[...n,m];o(d),s(d)},[n,s]),c=l.useCallback(()=>{o([]),s([])},[s]);return e.jsxs("div",{className:ge("flex items-center gap-2",r),children:[e.jsx("span",{className:"text-sm font-medium",children:"Group by:"}),t.getAllColumns().filter(m=>m.getCanGroup()).map(m=>e.jsx($,{variant:n.includes(m.id)?"default":"outline",size:"sm",onClick:()=>i(m.id),children:m.columnDef.header},m.id)),n.length>0&&e.jsx($,{variant:"ghost",size:"sm",onClick:c,children:"Clear"})]})}function Nx({row:t,rowIndex:a,actions:s=[],columnActions:r=[],onCopy:n,onExport:o,onEdit:i,onDelete:c,onToggleColumnVisibility:m,visibleColumns:d=[],className:x,children:u}){const[f,w]=l.useState(!1),k=l.useCallback(C=>{C.onClick(t),w(!1)},[t]),b=l.useCallback(()=>{if(n)n(t);else{const C=Object.entries(t).map(([N,S])=>`${N}: ${S}`).join(`
|
|
24
|
+
`);navigator.clipboard.writeText(C)}w(!1)},[t,n]),y=l.useCallback(()=>{o&&o(t),w(!1)},[t,o]),v=l.useCallback(()=>{i&&i(t),w(!1)},[t,i]),p=l.useCallback(()=>{c&&c(t),w(!1)},[t,c]),j=l.useCallback(C=>{m&&m(C),w(!1)},[m]);return e.jsxs(Yo,{onOpenChange:w,children:[e.jsx(Jo,{asChild:!0,children:u}),e.jsxs(Sr,{className:ge("w-64",x),children:[s.length>0&&e.jsxs(e.Fragment,{children:[s.map(C=>e.jsxs(Ft,{onClick:()=>k(C),disabled:C.disabled,className:ge(C.destructive&&"text-destructive focus:text-destructive"),children:[C.icon&&e.jsx("span",{className:"mr-2",children:C.icon}),C.label]},C.id)),e.jsx(Vs,{})]}),e.jsxs(Ft,{onClick:b,children:[e.jsx(h.Copy,{className:"mr-2 h-4 w-4"}),"Copy row"]}),o&&e.jsxs(Ft,{onClick:y,children:[e.jsx(h.Download,{className:"mr-2 h-4 w-4"}),"Export row"]}),i&&e.jsxs(Ft,{onClick:v,children:[e.jsx(h.Edit,{className:"mr-2 h-4 w-4"}),"Edit row"]}),c&&e.jsxs(Ft,{onClick:p,className:"text-destructive focus:text-destructive",children:[e.jsx(h.Trash2,{className:"mr-2 h-4 w-4"}),"Delete row"]}),r.length>0&&e.jsxs(e.Fragment,{children:[e.jsx(Vs,{}),e.jsx("div",{className:"px-2 py-1.5 text-sm font-semibold text-muted-foreground",children:"Columns"}),r.map(C=>e.jsxs(Ft,{onClick:()=>j(C.id),disabled:C.disabled,children:[C.icon&&e.jsx("span",{className:"mr-2",children:C.icon}),C.label]},C.id))]}),m&&d.length>0&&e.jsxs(e.Fragment,{children:[e.jsx(Vs,{}),e.jsx("div",{className:"px-2 py-1.5 text-sm font-semibold text-muted-foreground",children:"Toggle Columns"}),d.map(C=>e.jsxs(Ft,{onClick:()=>j(C),children:[e.jsx(h.Eye,{className:"mr-2 h-4 w-4"}),C]},C))]})]})]})}function Cx({table:t,selectionMode:a="multiple",selectedRows:s,onSelectionChange:r,selectionActions:n=[],className:o}){const[i,c]=l.useState(null);l.useCallback((f,w)=>{if(a==="single"){t.setRowSelection({[f]:w});return}if(a==="range"&&i!==null){const k=Math.min(i,f),b=Math.max(i,f),y={...t.getState().rowSelection};for(let v=k;v<=b;v++)y[v]=w;t.setRowSelection(y)}else t.setRowSelection(k=>({...k,[f]:w}));c(f)},[t,a,i]);const m=l.useCallback(f=>{if(f){const w=t.getRowModel().rows.reduce((k,b,y)=>(k[y]=!0,k),{});t.setRowSelection(w)}else t.setRowSelection({})},[t]);l.useCallback((f,w,k)=>{const b={...t.getState().rowSelection};for(let y=f;y<=w;y++)b[y]=k;t.setRowSelection(b)},[t]),l.useCallback(f=>{const w={...t.getState().rowSelection};t.getRowModel().rows.forEach((k,b)=>{f(k.original)&&(w[b]=!0)}),t.setRowSelection(w)},[t]);const d=l.useCallback(f=>{f.onClick(s)},[s]),x=t.getIsAllPageRowsSelected(),u=t.getIsSomePageRowsSelected();return e.jsxs("div",{className:ge("flex items-center gap-2",o),children:[e.jsx(et,{checked:x,onCheckedChange:m,ref:f=>{f&&"indeterminate"in f&&(f.indeterminate=u&&!x)},"aria-label":"Select all rows"}),s.length>0&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsxs("span",{children:[s.length," selected"]}),e.jsx("div",{className:"flex items-center gap-1",children:n.map(f=>e.jsxs($,{variant:"ghost",size:"sm",onClick:()=>d(f),disabled:f.disabled,className:ge(f.destructive&&"text-destructive hover:text-destructive"),children:[f.icon&&e.jsx("span",{className:"mr-1",children:f.icon}),f.label]},f.id))})]}),e.jsxs(Oe,{onValueChange:f=>{switch(f){case"all":m(!0);break;case"none":m(!1);break;case"invert":t.getRowModel().rows.forEach((w,k)=>{const b=t.getState().rowSelection[k];t.setRowSelection(y=>({...y,[k]:!b}))});break}},children:[e.jsx(Le,{className:"w-32",children:e.jsx(ze,{placeholder:"Select"})}),e.jsxs(Ie,{children:[e.jsx(be,{value:"all",children:"Select All"}),e.jsx(be,{value:"none",children:"Select None"}),e.jsx(be,{value:"invert",children:"Invert Selection"})]})]})]})}function kx({table:t,selectionMode:a="multiple",onSelectionChange:s}){const[r,n]=l.useState([]);l.useEffect(()=>{const x=t.getFilteredSelectedRowModel().rows.map(u=>u.original);n(x),s?.(x)},[t,s]);const o=l.useCallback((x,u=!0)=>{t.setRowSelection(f=>({...f,[x]:u}))},[t]),i=l.useCallback((x=!0)=>{if(x){const u=t.getRowModel().rows.reduce((f,w,k)=>(f[k]=!0,f),{});t.setRowSelection(u)}else t.setRowSelection({})},[t]),c=l.useCallback((x,u,f=!0)=>{const w={...t.getState().rowSelection};for(let k=x;k<=u;k++)w[k]=f;t.setRowSelection(w)},[t]),m=l.useCallback(x=>{const u={...t.getState().rowSelection};t.getRowModel().rows.forEach((f,w)=>{x(f.original)&&(u[w]=!0)}),t.setRowSelection(u)},[t]),d=l.useCallback(()=>{t.setRowSelection({})},[t]);return{selectedRows:r,selectRow:o,selectAll:i,selectRange:c,selectByCriteria:m,clearSelection:d,isAllSelected:t.getIsAllPageRowsSelected(),isSomeSelected:t.getIsSomePageRowsSelected()}}const Sx=Ye.cva("flex items-center",{variants:{variant:{default:"gap-2 p-3 rounded-lg border bg-card shadow-sm",minimal:"gap-2",pills:"gap-2 p-2 rounded-full border bg-muted/30",inline:"gap-1.5 text-sm",compact:"gap-1.5 p-2 rounded-md bg-muted/50"}},defaultVariants:{variant:"default"}}),Dx=Ye.cva("justify-between gap-2 transition-all",{variants:{variant:{default:"h-9 border-primary/50",minimal:"h-8 border-0 shadow-none hover:bg-accent",pills:"h-8 rounded-full px-4",inline:"h-7 text-sm border-0 shadow-none p-0 hover:bg-transparent hover:underline",compact:"h-7 text-xs px-2"}},defaultVariants:{variant:"default"}}),Tx={partner:h.Building2,network:h.Network,customer:h.Users},Ex={partner:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",network:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200",customer:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200"},qa={partner:"Partenaire",network:"Réseau",customer:"Client"},jl=l.forwardRef(({type:t,items:a,selected:s,isLoading:r,onSelect:n,placeholder:o,emptyText:i,showIcon:c,showBadge:m,variant:d},x)=>{const[u,f]=l.useState(!1),[w,k]=l.useState(""),b=Tx[t],y=l.useMemo(()=>w?a.filter(j=>j.name.toLowerCase().includes(w.toLowerCase())):a,[a,w]),v=j=>{n(j),f(!1),k("")},p=j=>{j.stopPropagation(),n({id:"",name:"",type:t}),k("")};return e.jsxs(ct,{open:u,onOpenChange:f,children:[e.jsx(dt,{asChild:!0,children:e.jsxs($,{ref:x,variant:d==="inline"?"ghost":"outline",role:"combobox","aria-expanded":u,className:g(Dx({variant:d}),s?.id?"border-primary/50":""),disabled:r||a.length===0,children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c&&b&&e.jsx(b,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"truncate",children:s?.name||o||qa[t]}),m&&s?.id&&e.jsx(De,{variant:"secondary",className:g("text-xs",Ex[t]),children:t})]}),s?.id?e.jsx(h.X,{className:"h-3 w-3 shrink-0 opacity-50 hover:opacity-100",onClick:p}):e.jsx(h.ChevronRight,{className:"h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(rt,{className:"w-[300px] p-0",align:"start",children:e.jsxs(ts,{shouldFilter:!1,children:[e.jsxs("div",{className:"flex items-center border-b px-3 py-2 bg-muted/50",children:[e.jsx(h.Search,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(xs,{placeholder:`Rechercher ${qa[t].toLowerCase()}...`,value:w,onValueChange:k,className:"border-0 focus:ring-0"})]}),e.jsxs(Zs,{children:[e.jsx(gs,{children:i||`Aucun ${qa[t].toLowerCase()} trouvé`}),e.jsx(Ot,{children:y.map(j=>e.jsx(zt,{value:j.id,onSelect:()=>v(j),className:"cursor-pointer",children:e.jsxs("div",{className:"flex items-center gap-2 w-full",children:[c&&b&&e.jsx(b,{className:"h-4 w-4 shrink-0"}),e.jsx("span",{className:"flex-1 truncate",children:j.name}),j.metadata?.count!==void 0&&e.jsx(De,{variant:"secondary",className:"text-xs",children:j.metadata.count})]})},j.id))})]})]})})]})});jl.displayName="AdmincrumbSelector";const vl=l.forwardRef(({levels:t,separator:a,className:s,onLevelChange:r,showIcons:n=!0,showBadges:o=!1,showHome:i=!1,maxWidth:c="100%",variant:m="default",resetable:d=!1,onReset:x},u)=>{const f=b=>y=>{r?.(b,y)},w=t.some(b=>b.selected?.id),k=d&&w&&x;return e.jsxs("nav",{ref:u,"aria-label":"Fil d'Ariane administrateur",className:g("flex items-center gap-2",s),style:{maxWidth:c},children:[e.jsxs("div",{className:g(Sx({variant:m}),"overflow-x-auto"),children:[i&&e.jsxs(e.Fragment,{children:[e.jsx($,{variant:m==="inline"?"ghost":"outline",size:m==="compact"?"sm":"default",className:g(m==="inline"&&"h-7 px-2",m==="compact"&&"h-7 px-2"),onClick:()=>x?.(),children:e.jsx(h.Home,{className:"h-4 w-4"})}),e.jsx(h.ChevronRight,{className:"h-4 w-4 text-muted-foreground shrink-0","aria-hidden":"true"})]}),e.jsx("ol",{className:"flex items-center gap-2 list-none p-0 m-0",children:t.map((b,y)=>e.jsxs("li",{className:"flex items-center gap-2",children:[y>0&&e.jsx(e.Fragment,{children:a||e.jsx(h.ChevronRight,{className:g("text-muted-foreground shrink-0",m==="compact"||m==="inline"?"h-3 w-3":"h-4 w-4"),"aria-hidden":"true"})}),e.jsx(jl,{...b,onSelect:f(y),showIcon:n,showBadge:o,variant:m||"default"})]},`${b.type}-${y}`))}),k&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-px h-6 bg-border mx-1","aria-hidden":"true"}),e.jsxs($,{variant:"ghost",size:m==="compact"?"sm":"default",onClick:x,className:g("gap-2",m==="compact"&&"h-7 px-2 text-xs"),children:[e.jsx(h.X,{className:"h-3 w-3"}),"Réinitialiser"]})]})]}),w&&!k&&e.jsxs(De,{variant:"secondary",className:"gap-1",children:[e.jsx(h.Filter,{className:"h-3 w-3"}),"Filtré"]})]})});vl.displayName="WakaAdmincrumb";function Mx(){const[t,a]=l.useState(),[s,r]=l.useState(),[n,o]=l.useState(),i=l.useCallback((m,d)=>{m===0?(a(d.id?d:void 0),r(void 0),o(void 0)):m===1?(r(d.id?d:void 0),o(void 0)):m===2&&o(d.id?d:void 0)},[]),c=l.useCallback(()=>{a(void 0),r(void 0),o(void 0)},[]);return{partner:t,network:s,customer:n,handleLevelChange:i,reset:c}}const qr=l.forwardRef(({options:t,value:a,onChange:s,onSearch:r,multiple:n=!1,creatable:o=!1,onCreate:i,placeholder:c="Sélectionner...",emptyMessage:m="Aucun résultat.",loading:d=!1,disabled:x=!1,error:u,className:f,label:w,description:k,maxSelections:b,sortOptions:y=!1,searchDebounce:v=300},p)=>{const[j,C]=l.useState(!1),[N,S]=l.useState(""),[A,R]=l.useState(t),[E,D]=l.useState(!1),M=l.useRef();l.useEffect(()=>{r||R(t)},[t,r]);const P=l.useMemo(()=>a?Array.isArray(a)?a:[a]:[],[a]);l.useEffect(()=>{if(r){if(M.current&&clearTimeout(M.current),!N.trim()){R(t);return}return M.current=setTimeout(async()=>{D(!0);try{const W=await r(N);R(W)}catch{R([])}finally{D(!1)}},v),()=>{M.current&&clearTimeout(M.current)}}},[N,r,v,t]);const T=l.useMemo(()=>{let W=A;if(!r&&N.trim()){const F=N.toLowerCase();W=A.filter(G=>G.label.toLowerCase().includes(F)||G.value.toLowerCase().includes(F))}return y&&(W=[...W].sort((F,G)=>F.label.localeCompare(G.label))),W},[A,N,r,y]),q=l.useMemo(()=>{const W={_ungrouped:[]};for(const F of T){const G=F.group||"_ungrouped";W[G]||(W[G]=[]),W[G].push(F)}return W},[T]),H=o&&N.trim()&&!A.some(W=>W.value.toLowerCase()===N.toLowerCase()),Y=W=>{if(n){const F=P.includes(W)?P.filter(G=>G!==W):b&&P.length>=b?P:[...P,W];s?.(F.length>0?F:null)}else s?.(W===a?null:W),C(!1);S("")},U=()=>{if(!N.trim())return;const W={value:N.trim(),label:N.trim()};R(F=>[...F,W]),Y(W.value),i?.(W.value)},z=(W,F)=>{F.stopPropagation();const G=P.filter(ee=>ee!==W);s?.(G.length>0?G:null)},V=W=>A.find(G=>G.value===W)?.label||W,L=E||d;return e.jsxs("div",{className:g("space-y-1.5",f),children:[w&&e.jsx(he,{children:w}),k&&e.jsx("p",{className:"text-sm text-muted-foreground",children:k}),e.jsxs(ct,{open:j,onOpenChange:C,children:[e.jsx(dt,{asChild:!0,children:e.jsxs($,{ref:p,variant:"outline",role:"combobox","aria-expanded":j,disabled:x,className:g("w-full justify-between font-normal",!a&&"text-muted-foreground",u&&"border-destructive"),children:[n?e.jsx("div",{className:"flex flex-wrap gap-1 flex-1 min-w-0",children:P.length>0?P.map(W=>e.jsxs(De,{variant:"secondary",className:"text-xs",children:[V(W),e.jsx("button",{className:"ml-1 hover:text-destructive",onClick:F=>z(W,F),children:e.jsx(h.X,{className:"h-3 w-3"})})]},W)):e.jsx("span",{children:c})}):e.jsx("span",{className:"truncate",children:a?V(a):c}),L?e.jsx(h.Loader2,{className:"ml-2 h-4 w-4 shrink-0 animate-spin"}):e.jsx(h.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(rt,{className:"w-[var(--radix-popover-trigger-width)] p-0",align:"start",children:e.jsxs(ts,{shouldFilter:!1,children:[e.jsx(xs,{placeholder:"Rechercher...",value:N,onValueChange:S}),e.jsxs(Zs,{children:[L&&e.jsxs("div",{className:"py-6 text-center text-sm",children:[e.jsx(h.Loader2,{className:"h-4 w-4 animate-spin mx-auto mb-2"}),"Chargement..."]}),!L&&T.length===0&&!H&&e.jsx(gs,{children:m}),H&&e.jsx(Ot,{children:e.jsxs(zt,{onSelect:U,className:"cursor-pointer",children:[e.jsx(h.Plus,{className:"mr-2 h-4 w-4"}),'Créer "',N,'"']})}),Object.entries(q).map(([W,F])=>F.length===0?null:e.jsx(Ot,{heading:W!=="_ungrouped"?W:void 0,children:F.map(G=>e.jsxs(zt,{value:G.value,onSelect:()=>Y(G.value),disabled:G.disabled,className:"cursor-pointer",children:[e.jsx(h.Check,{className:g("mr-2 h-4 w-4",P.includes(G.value)?"opacity-100":"opacity-0")}),G.label]},G.value))},W))]})]})})]}),u&&e.jsx("p",{className:"text-sm text-destructive",children:u})]})});qr.displayName="WakaAutocomplete";const wl=l.forwardRef((t,a)=>e.jsx(qr,{ref:a,...t}));wl.displayName="WakaAutocompleteForm";const Jn={" ":"11011001100","!":"11001101100",'"':"11001100110","#":"10010011000",$:"10010001100","%":"10001001100","&":"10011001000","'":"10011000100","(":"10001100100",")":"11001001000","*":"11001000100","+":"11000100100",",":"10110011100","-":"10011011100",".":"10011001110","/":"10111001100",0:"10011101100",1:"10011100110",2:"11001110010",3:"11001011100",4:"11001001110",5:"11011100100",6:"11001110100",7:"11101101110",8:"11101001100",9:"11100101100",":":"11100100110",";":"11101100100","<":"11100110100","=":"11100110010",">":"11011011000","?":"11011000110","@":"11000110110",A:"10100011000",B:"10001011000",C:"10001000110",D:"10110001000",E:"10001101000",F:"10001100010",G:"11010001000",H:"11000101000",I:"11000100010",J:"10110111000",K:"10110001110",L:"10001101110",M:"10111011000",N:"10111000110",O:"10001110110",P:"11101110110",Q:"11010001110",R:"11000101110",S:"11011101000",T:"11011100010",U:"11011101110",V:"11101011000",W:"11101000110",X:"11100010110",Y:"11101101000",Z:"11101100010"},Kn="11010000100",Px="1100011101011";function Ha(t){let a=Kn;for(const s of t.toUpperCase()){const r=Jn[s];r?a+=r:a+=Jn["?"]}return a+=Kn,a+=Px,a}const Ga={0:"101001101101",1:"110100101011",2:"101100101011",3:"110110010101",4:"101001101011",5:"110100110101",6:"101100110101",7:"101001011011",8:"110100101101",9:"101100101101",A:"110101001011",B:"101101001011",C:"110110100101",D:"101011001011",E:"110101100101",F:"101101100101",G:"101010011011",H:"110101001101",I:"101101001101",J:"101011001101",K:"110101010011",L:"101101010011",M:"110110101001",N:"101011010011",O:"110101101001",P:"101101101001",Q:"101010110011",R:"110101011001",S:"101101011001",T:"101011011001",U:"110010101011",V:"100110101011",W:"110011010101",X:"100101101011",Y:"110010110101",Z:"100110110101","-":"100101011011",".":"110010101101"," ":"100110101101","*":"100101101101"};function Ax(t){let a=Ga["*"]+"0";for(const s of t.toUpperCase()){const r=Ga[s];r&&(a+=r+"0")}return a+=Ga["*"],a}function Rx(t,a){switch(a){case"CODE128":return Ha(t);case"CODE39":return Ax(t);case"EAN13":case"EAN8":case"UPC":case"ITF14":return Ha(t);default:return Ha(t)}}function Fx({value:t,format:a="CODE128",width:s=200,height:r=80,displayValue:n=!0,lineColor:o="#000000",background:i="#FFFFFF",fontSize:c=14,margin:m=10,showActions:d=!1,className:x}){const u=l.useRef(null),[f,w]=l.useState(!1);l.useEffect(()=>{const y=u.current;if(!y||!t)return;const v=y.getContext("2d");if(!v)return;const p=Rx(t,a),j=n?c+4:0,C=r-j-m*2,N=(s-m*2)/p.length;v.fillStyle=i,v.fillRect(0,0,s,r),v.fillStyle=o;for(let S=0;S<p.length;S++)p[S]==="1"&&v.fillRect(m+S*N,m,N,C);n&&(v.fillStyle=o,v.font=`${c}px monospace`,v.textAlign="center",v.textBaseline="bottom",v.fillText(t,s/2,r-m+2))},[t,a,s,r,n,o,i,c,m]);const k=()=>{const y=u.current;if(!y)return;const v=document.createElement("a");v.download=`barcode-${t}-${Date.now()}.png`,v.href=y.toDataURL("image/png"),v.click()},b=async()=>{const y=u.current;if(y)try{const v=await new Promise(p=>{y.toBlob(j=>{j&&p(j)},"image/png")});await navigator.clipboard.write([new ClipboardItem({"image/png":v})]),w(!0),setTimeout(()=>w(!1),2e3)}catch(v){console.error("Failed to copy barcode:",v)}};return e.jsxs("div",{className:g("inline-flex flex-col items-center gap-2",x),children:[e.jsx("canvas",{ref:u,width:s,height:r,className:"rounded border",style:{width:s,height:r}}),d&&e.jsxs("div",{className:"flex gap-2",children:[e.jsxs($,{variant:"outline",size:"sm",onClick:k,children:[e.jsx(h.Download,{className:"h-4 w-4 mr-1"}),"Télécharger"]}),e.jsxs($,{variant:"outline",size:"sm",onClick:b,children:[f?e.jsx(h.Check,{className:"h-4 w-4 mr-1"}):e.jsx(h.Copy,{className:"h-4 w-4 mr-1"}),f?"Copié":"Copier"]})]})]})}function Qn({item:t,index:a,isLast:s,size:r,variant:n,showHomeIcon:o,renderLink:i,onItemClick:c}){const m={sm:"text-xs py-0.5 px-1.5",md:"text-sm py-1 px-2",lg:"text-base py-1.5 px-3"},d={sm:"h-3 w-3",md:"h-4 w-4",lg:"h-5 w-5"},x={default:s?"text-foreground font-medium":"text-muted-foreground hover:text-foreground",ghost:s?"text-foreground font-medium bg-muted rounded-md":"text-muted-foreground hover:text-foreground hover:bg-muted rounded-md",outline:s?"text-foreground font-medium border rounded-md":"text-muted-foreground hover:text-foreground hover:border-foreground border border-transparent rounded-md"},u=e.jsxs("span",{className:"flex items-center gap-1.5",children:[a===0&&o&&!t.icon&&e.jsx(h.Home,{className:d[r]}),t.icon&&e.jsx("span",{className:d[r],children:t.icon}),e.jsx("span",{className:"truncate max-w-[150px]",children:t.label})]}),f=g("inline-flex items-center transition-colors",m[r],x[n],t.disabled&&"opacity-50 pointer-events-none"),w=k=>{c&&(k.preventDefault(),c(t,a))};return s||!t.href?e.jsx("span",{className:g(f,"cursor-default"),"aria-current":s?"page":void 0,children:u}):i?i(t,e.jsx("span",{className:f,onClick:w,children:u})):e.jsx("a",{href:t.href,className:f,onClick:w,children:u})}function $x({items:t,startIndex:a,size:s,renderLink:r,onItemClick:n}){const o={sm:"h-3 w-3",md:"h-4 w-4",lg:"h-5 w-5"};return e.jsxs(Ge,{children:[e.jsx(Xe,{asChild:!0,children:e.jsx("button",{type:"button",className:"inline-flex items-center justify-center p-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted transition-colors","aria-label":"Afficher les éléments masqués",children:e.jsx(h.MoreHorizontal,{className:o[s]})})}),e.jsx(Ue,{align:"start",children:t.map((i,c)=>{const m=a+c,d=()=>{n?.(i,m)};return r&&i.href?e.jsx(xe,{asChild:!0,children:r(i,e.jsxs("span",{className:"flex items-center gap-2 w-full",children:[i.icon,i.label]}))},m):e.jsxs(xe,{onClick:d,disabled:i.disabled,children:[i.icon&&e.jsx("span",{className:"mr-2",children:i.icon}),i.label]},m)})})]})}function Lx({items:t,separator:a,showHomeIcon:s=!1,maxItems:r,renderLink:n,onItemClick:o,size:i="md",variant:c="default",className:m}){const d={sm:"h-3 w-3",md:"h-4 w-4",lg:"h-5 w-5"},x=e.jsx(h.ChevronRight,{className:g(d[i],"text-muted-foreground")}),u=()=>a??x,f=r&&t.length>r;let w,k=[],b=0;if(f&&r){const y=Math.max(r-2,1);w=[t[0],...t.slice(-y)],k=t.slice(1,-y),b=1}else w=t;return e.jsx("nav",{"aria-label":"Fil d'Ariane",className:g("flex items-center",m),children:e.jsxs("ol",{className:"flex items-center flex-wrap gap-1",children:[w.length>0&&e.jsx("li",{className:"flex items-center",children:e.jsx(Qn,{item:w[0],index:0,isLast:w.length===1&&!f,size:i,variant:c,showHomeIcon:s,renderLink:n,onItemClick:o})}),f&&k.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("li",{className:"flex items-center","aria-hidden":"true",children:u()}),e.jsx("li",{className:"flex items-center",children:e.jsx($x,{items:k,startIndex:b,size:i,renderLink:n,onItemClick:o})})]}),w.slice(1).map((y,v)=>{const p=f?t.length-(w.length-1-v):v+1;return e.jsxs(l.Fragment,{children:[e.jsx("li",{className:"flex items-center","aria-hidden":"true",children:u()}),e.jsx("li",{className:"flex items-center",children:e.jsx(Qn,{item:y,index:p,isLast:p===t.length-1,size:i,variant:c,showHomeIcon:!1,renderLink:n,onItemClick:o})})]},p)})]})})}function Ix(t,a){const{homeLabel:s="Accueil",labelMap:r={},excludePaths:n=[]}=a||{};return l.useMemo(()=>{const i=t.split("/").filter(Boolean).filter(d=>!n.includes(d)),c=[{label:s,href:"/"}];let m="";return i.forEach(d=>{m+=`/${d}`;const x=r[d]||d.charAt(0).toUpperCase()+d.slice(1).replace(/-/g," ");c.push({label:x,href:m})}),c},[t,s,r,n])}const Ox=({images:t,autoplay:a=!1,autoplayInterval:s=3e3,showIndicators:r=!0,showNavigation:n=!0,showThumbnails:o=!1,showFullscreen:i=!1,showDownload:c=!1,showShare:m=!1,showCounter:d=!1,showProgress:x=!1,transition:u="fade",layout:f="default",theme:w="auto",aspectRatio:k="16/9",maxHeight:b,className:y,imageClassName:v,indicatorClassName:p,navigationClassName:j,thumbnailClassName:C,overlayClassName:N,counterClassName:S,progressClassName:A,onImageChange:R,onImageClick:E,onFullscreenToggle:D,onDownload:M,onShare:P,onPlayPause:T,onThumbnailClick:q,onIndicatorClick:H,onNavigationClick:Y,onKeyboardNavigation:U,onTouchStart:z,onTouchEnd:V,onSwipeLeft:L,onSwipeRight:W,onSwipeUp:F,onSwipeDown:G,onLoadStart:ee,onLoadEnd:se,onError:le,onReady:X,onDestroy:K,loop:I=!0,pauseOnHover:te=!0,pauseOnFocus:Z=!0,pauseOnTouch:J=!0,keyboardNavigation:ne=!0,touchNavigation:me=!0,swipeThreshold:ae=50,animationDuration:de=300,preloadImages:Te=!0,lazyLoading:Ce=!0,imageQuality:Je="auto",placeholder:xt,errorImage:Ke,loadingSpinner:tt,emptyState:gt,customControls:Mt,customOverlay:Qe,customThumbnails:B,customIndicators:Q,customNavigation:re,ariaLabel:we="Carrousel d'images",ariaLabelledBy:je,ariaDescribedBy:Pt,role:ys="region",virtualScrolling:Fa=!1,maxVisibleThumbnails:$a=10,thumbnailSize:ra="medium",overlayOpacity:ac=.7,overlayGradient:rc,navigationSize:At="medium",indicatorSize:rs="medium",indicatorShape:Vt="circle",thumbnailAspectRatio:na="1/1",onMount:La,onUnmount:Ia,onBeforeChange:Dt,onAfterChange:Oa})=>{const[bt,As]=O.useState(0),[jt,Rt]=O.useState(a),[ns,oa]=O.useState(!1),[pn,za]=O.useState(!1),[ia,xn]=O.useState(!1),[Rs,Fs]=O.useState(null),[nc,os]=O.useState(null),[vt,la]=O.useState(new Set),[ca,da]=O.useState(0),ye=O.useRef(null),ce=O.useRef(null),Fe=O.useRef([]),at=O.useRef(null),is=O.useRef(0),_e=t&&t.length>0,Be=Math.max(0,Math.min(bt,t.length-1)),ve=_e?t[Be]:null,ls=O.useMemo(()=>{switch(k){case"16/9":return"aspect-video";case"4/3":return"aspect-[4/3]";case"1/1":return"aspect-square";case"3/2":return"aspect-[3/2]";default:return"aspect-video"}},[k]),Wt=O.useMemo(()=>w==="auto"?"":w==="dark"?"dark":"light",[w]),$s=O.useCallback(()=>{ye.current&&clearInterval(ye.current),jt&&_e&&t.length>1&&(ye.current=setInterval(()=>{As(ie=>I?(ie+1)%t.length:Math.min(ie+1,t.length-1))},s))},[jt,_e,t.length,s,I]),ht=O.useCallback(()=>{ye.current&&(clearInterval(ye.current),ye.current=null)},[]),gn=O.useCallback(()=>{if(!jt||!a)return;const ie=Date.now(),ke=()=>{const Ns=(Date.now()-ie)/s*100;da(Math.min(Ns,100)),Ns<100&&requestAnimationFrame(ke)};requestAnimationFrame(ke)},[jt,a,s]);O.useEffect(()=>(jt?($s(),gn()):(ht(),da(0)),()=>ht()),[jt,$s,ht,gn]);const Ls=O.useCallback(()=>{if(!_e)return;const ie=I?(bt-1+t.length)%t.length:Math.max(bt-1,0);Dt&&!Dt(bt,ie)||(As(ie),Y?.("prev"))},[_e,bt,t.length,I,Dt,Y]),Is=O.useCallback(()=>{if(!_e)return;const ie=I?(bt+1)%t.length:Math.min(bt+1,t.length-1);Dt&&!Dt(bt,ie)||(As(ie),Y?.("next"))},[_e,bt,t.length,I,Dt,Y]),bn=O.useCallback(ie=>{!_e||ie<0||ie>=t.length||Dt&&!Dt(bt,ie)||(As(ie),H?.(ie))},[_e,bt,t.length,Dt,H]),oc=O.useCallback(ie=>{if(!ne)return;const ke=ie.key;switch(U?.(ke),ke){case"ArrowLeft":ie.preventDefault(),Ls();break;case"ArrowRight":ie.preventDefault(),Is();break;case"ArrowUp":ie.preventDefault(),F?.();break;case"ArrowDown":ie.preventDefault(),G?.();break;case" ":ie.preventDefault(),Rt(ft=>!ft),T?.(!jt);break;case"Escape":ns&&(oa(!1),D?.(!1));break;case"f":case"F":i&&oa(ft=>(D?.(!ft),!ft));break}},[ne,Ls,Is,U,F,G,jt,T,ns,i,D]),ic=O.useCallback(ie=>{if(!me)return;const ke=ie.touches[0];Fs({x:ke.clientX,y:ke.clientY}),is.current=Date.now(),z?.(ie),J&&Rt(!1)},[me,z,J]),lc=O.useCallback(ie=>{if(!me||!Rs)return;const ke=ie.changedTouches[0];os({x:ke.clientX,y:ke.clientY}),V?.(ie);const ft=ke.clientX-Rs.x,Ns=ke.clientY-Rs.y;Date.now()-is.current,Math.abs(ft)>Math.abs(Ns)&&Math.abs(ft)>ae?ft>0?(W?.(),Ls()):(L?.(),Is()):Math.abs(Ns)>ae&&(Ns>0?G?.():F?.()),Fs(null),os(null)},[me,Rs,V,ae,W,L,G,F,Ls,Is]),cc=O.useCallback(ie=>{la(ke=>new Set([...ke,ie])),za(!1),se?.(ie)},[se]),dc=O.useCallback((ie,ke)=>{xn(!0),za(!1),le?.(ie,ke)},[le]);O.useEffect(()=>{ve&&(R?.(Be,ve),Oa?.(Be))},[Be,ve,R,Oa]);const uc=O.useCallback(()=>{ve&&E?.(ve,Be)},[ve,Be,E]),Ut=O.useCallback(ie=>{ie.stopPropagation()},[]),mc=O.useCallback(()=>{oa(ie=>(D?.(!ie),!ie))},[D]),hc=O.useCallback(()=>{ve&&M?.(ve,Be)},[ve,Be,M]),fc=O.useCallback(()=>{ve&&P?.(ve,Be)},[ve,Be,P]),pc=O.useCallback(()=>{te&&Rt(!1)},[te]),xc=O.useCallback(()=>{te&&a&&Rt(!0)},[te,a]),gc=O.useCallback(()=>{Z&&Rt(!1)},[Z]),bc=O.useCallback(()=>{Z&&a&&Rt(!0)},[Z,a]);if(O.useEffect(()=>(La?.(),X?.(),()=>{Ia?.(),K?.(),ht()}),[La,X,Ia,K,ht]),O.useEffect(()=>()=>ht(),[ht]),!_e)return e.jsx("div",{className:g("flex items-center justify-center h-64 bg-gray-100 rounded-lg",y),children:gt||e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-gray-500 mb-2",children:"Aucune image à afficher"}),e.jsx("p",{className:"text-sm text-gray-400",children:"Ajoutez des images pour commencer"})]})});const jc=g("waka-carousel relative w-full mx-auto bg-black rounded-lg overflow-hidden","focus:outline-none focus:ring-2 focus:ring-blue-500",ns&&"fixed inset-0 z-50 rounded-none",Wt,y),vc=g("relative",ls,v),wc=g("absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-4",N);return e.jsxs("div",{ref:ce,className:jc,style:{maxHeight:b},tabIndex:0,onKeyDown:oc,onTouchStart:ic,onTouchEnd:lc,onMouseEnter:pc,onMouseLeave:xc,onFocus:gc,onBlur:bc,role:ys,"aria-label":we,"aria-labelledby":je,"aria-describedby":Pt,children:[e.jsxs("div",{className:vc,children:[pn&&tt&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50 z-20",children:tt}),ia&&Ke?e.jsx("img",{src:Ke,alt:"Erreur de chargement",className:g("w-full h-full object-cover",v)}):ve?e.jsx("img",{ref:ie=>Fe.current[Be]=ie,src:ve.src,alt:ve.alt,className:g("w-full h-full object-cover transition-opacity duration-300",v),onClick:uc,loading:Ce?"lazy":"eager",onLoad:()=>cc(Be),onError:ie=>dc(Be,new Error("Erreur de chargement de l'image"))}):null,ve&&(ve.title||ve.description||ve.caption)&&e.jsxs("div",{className:wc,children:[ve.title&&e.jsx("h3",{className:"text-white text-lg font-semibold mb-1",children:ve.title}),ve.description&&e.jsx("p",{className:"text-white/90 text-sm mb-2",children:ve.description}),ve.caption&&e.jsx("p",{className:"text-white/80 text-xs",children:ve.caption})]}),Mt&&e.jsx("div",{className:"absolute inset-0 z-10",children:Mt}),Qe&&e.jsx("div",{className:"absolute inset-0 z-10",children:Qe}),n&&t.length>1&&e.jsx(e.Fragment,{children:re?e.jsx("div",{className:"absolute inset-0 z-10",children:re}):e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:ie=>{Ut(ie),Ls()},className:g("absolute left-2 top-1/2 -translate-y-1/2 z-10","bg-black/50 hover:bg-black/70 text-white p-2 rounded-full","transition-all duration-200 hover:scale-110","focus:outline-none focus:ring-2 focus:ring-white",At==="small"&&"p-1",At==="large"&&"p-3",j),"aria-label":"Image précédente",children:e.jsx(h.ChevronLeft,{className:g("w-5 h-5",At==="small"&&"w-4 h-4",At==="large"&&"w-6 h-6")})}),e.jsx("button",{onClick:ie=>{Ut(ie),Is()},className:g("absolute right-2 top-1/2 -translate-y-1/2 z-10","bg-black/50 hover:bg-black/70 text-white p-2 rounded-full","transition-all duration-200 hover:scale-110","focus:outline-none focus:ring-2 focus:ring-white",At==="small"&&"p-1",At==="large"&&"p-3",j),"aria-label":"Image suivante",children:e.jsx(h.ChevronRight,{className:g("w-5 h-5",At==="small"&&"w-4 h-4",At==="large"&&"w-6 h-6")})})]})}),a&&t.length>1&&e.jsx("button",{onClick:ie=>{Ut(ie),Rt(ke=>(T?.(!ke),!ke))},className:g("absolute top-2 right-2 z-10","bg-black/50 hover:bg-black/70 text-white p-2 rounded-full","transition-all duration-200 hover:scale-110","focus:outline-none focus:ring-2 focus:ring-white"),"aria-label":jt?"Pause":"Lecture",children:jt?e.jsx(h.Pause,{className:"w-4 h-4"}):e.jsx(h.Play,{className:"w-4 h-4"})}),i&&e.jsx("button",{onClick:ie=>{Ut(ie),mc()},className:g("absolute top-2 left-2 z-10","bg-black/50 hover:bg-black/70 text-white p-2 rounded-full","transition-all duration-200 hover:scale-110","focus:outline-none focus:ring-2 focus:ring-white"),"aria-label":ns?"Quitter le plein écran":"Plein écran",children:ns?e.jsx(h.X,{className:"w-4 h-4"}):e.jsx(h.Maximize2,{className:"w-4 h-4"})}),c&&ve?.downloadUrl&&e.jsx("button",{onClick:ie=>{Ut(ie),hc()},className:g("absolute top-2 right-12 z-10","bg-black/50 hover:bg-black/70 text-white p-2 rounded-full","transition-all duration-200 hover:scale-110","focus:outline-none focus:ring-2 focus:ring-white"),"aria-label":"Télécharger l'image",children:e.jsx(h.Download,{className:"w-4 h-4"})}),m&&ve?.shareUrl&&e.jsx("button",{onClick:ie=>{Ut(ie),fc()},className:g("absolute top-2 right-20 z-10","bg-black/50 hover:bg-black/70 text-white p-2 rounded-full","transition-all duration-200 hover:scale-110","focus:outline-none focus:ring-2 focus:ring-white"),"aria-label":"Partager l'image",children:e.jsx(h.Share2,{className:"w-4 h-4"})}),d&&e.jsxs("div",{className:g("absolute top-2 left-1/2 -translate-x-1/2 z-10","bg-black/50 text-white px-3 py-1 rounded-full text-sm",S),children:[Be+1," / ",t.length]}),x&&jt&&e.jsx("div",{className:g("absolute bottom-0 left-0 right-0 h-1 bg-black/30",A),children:e.jsx("div",{ref:at,className:"h-full bg-white transition-all duration-100",style:{width:`${ca}%`}})})]}),r&&t.length>1&&e.jsx("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 flex space-x-2",children:Q?e.jsx("div",{className:"flex space-x-2",children:Q}):t.map((ie,ke)=>e.jsx("button",{onClick:ft=>{Ut(ft),bn(ke)},className:g("transition-all duration-200","focus:outline-none focus:ring-2 focus:ring-white",Vt==="circle"&&"rounded-full",Vt==="square"&&"rounded",Vt==="diamond"&&"rotate-45",Vt==="line"&&"rounded-none",rs==="small"&&"w-2 h-2",rs==="medium"&&"w-3 h-3",rs==="large"&&"w-4 h-4",Vt==="line"&&rs==="small"&&"w-8 h-1",Vt==="line"&&rs==="medium"&&"w-12 h-1",Vt==="line"&&rs==="large"&&"w-16 h-1",ke===Be?"bg-white":"bg-white/50 hover:bg-white/70",p),"aria-label":`Aller à l'image ${ke+1}`},ke))}),o&&t.length>1&&e.jsx("div",{className:"flex space-x-2 p-4 bg-gray-100 overflow-x-auto",children:B?e.jsx("div",{className:"flex space-x-2",children:B}):t.map((ie,ke)=>e.jsx("button",{onClick:ft=>{Ut(ft),bn(ke),q?.(ke)},className:g("flex-shrink-0 rounded overflow-hidden","border-2 transition-all duration-200","focus:outline-none focus:ring-2 focus:ring-blue-500",ra==="small"&&"w-12 h-12",ra==="medium"&&"w-16 h-16",ra==="large"&&"w-20 h-20",na==="1/1"&&"aspect-square",na==="4/3"&&"aspect-[4/3]",na==="16/9"&&"aspect-video",ke===Be?"border-blue-500":"border-gray-300 hover:border-gray-400",C),children:e.jsx("img",{src:ie.src,alt:ie.alt,className:"w-full h-full object-cover",loading:"lazy"})},ke))})]})},zx=["#ef4444","#f97316","#f59e0b","#eab308","#84cc16","#22c55e","#10b981","#14b8a6","#06b6d4","#0ea5e9","#3b82f6","#6366f1","#8b5cf6","#a855f7","#d946ef","#ec4899","#f43f5e","#000000","#6b7280","#ffffff"];function yl(t,a,s){a/=100,s/=100;const r=a*Math.min(s,1-s),n=o=>{const i=(o+t/30)%12;return s-r*Math.max(Math.min(i-3,9-i,1),-1)};return[Math.round(n(0)*255),Math.round(n(8)*255),Math.round(n(4)*255)]}function _s(t,a,s){t/=255,a/=255,s/=255;const r=Math.max(t,a,s),n=Math.min(t,a,s);let o=0,i=0;const c=(r+n)/2;if(r!==n){const m=r-n;switch(i=c>.5?m/(2-r-n):m/(r+n),r){case t:o=((a-s)/m+(a<s?6:0))*60;break;case a:o=((s-t)/m+2)*60;break;case s:o=((t-a)/m+4)*60;break}}return[Math.round(o),Math.round(i*100),Math.round(c*100)]}function _x(t){const a=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return a?[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16)]:null}function Zn(t,a,s){return"#"+[t,a,s].map(r=>r.toString(16).padStart(2,"0")).join("")}function ma(t){if(t.startsWith("#"))return _x(t);const a=t.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);if(a)return[parseInt(a[1]),parseInt(a[2]),parseInt(a[3])];const s=t.match(/hsl\((\d+),\s*(\d+)%?,\s*(\d+)%?\)/);return s?yl(parseInt(s[1]),parseInt(s[2]),parseInt(s[3])):null}function eo(t,a,s,r){switch(r){case"hex":return Zn(t,a,s);case"rgb":return`rgb(${t}, ${a}, ${s})`;case"hsl":{const[n,o,i]=_s(t,a,s);return`hsl(${n}, ${o}%, ${i}%)`}default:return Zn(t,a,s)}}const Hr=l.forwardRef(({value:t="#3b82f6",onChange:a,format:s="hex",showAlpha:r=!1,showPresets:n=!0,presets:o=zx,showEyeDropper:i=!0,disabled:c=!1,placeholder:m="Sélectionner une couleur",className:d,size:x="md"},u)=>{const[f,w]=l.useState(!1),[k,b]=l.useState(0),[y,v]=l.useState(100),[p,j]=l.useState(50),[C,N]=l.useState(t),S=l.useRef(null),A=l.useRef(null);l.useEffect(()=>{const H=ma(t);if(H){const[Y,U,z]=_s(...H);b(Y),v(U),j(z),N(t)}},[t]);const R=l.useCallback((H,Y,U)=>{const[z,V,L]=yl(H,Y,U),W=eo(z,V,L,s);N(W),a?.(W)},[s,a]),E=H=>{H.preventDefault();const Y=S.current?.getBoundingClientRect();if(!Y)return;const U=(L,W)=>{const F=Math.max(0,Math.min(100,(L-Y.left)/Y.width*100)),G=Math.max(0,Math.min(100,100-(W-Y.top)/Y.height*100));v(F),j(G),R(k,F,G)};U(H.clientX,H.clientY);const z=L=>U(L.clientX,L.clientY),V=()=>{document.removeEventListener("mousemove",z),document.removeEventListener("mouseup",V)};document.addEventListener("mousemove",z),document.addEventListener("mouseup",V)},D=H=>{H.preventDefault();const Y=A.current?.getBoundingClientRect();if(!Y)return;const U=L=>{const W=Math.max(0,Math.min(360,(L-Y.left)/Y.width*360));b(W),R(W,y,p)};U(H.clientX);const z=L=>U(L.clientX),V=()=>{document.removeEventListener("mousemove",z),document.removeEventListener("mouseup",V)};document.addEventListener("mousemove",z),document.addEventListener("mouseup",V)},M=async()=>{if("EyeDropper"in window)try{const Y=await new window.EyeDropper().open(),U=ma(Y.sRGBHex);if(U){const[z,V,L]=_s(...U);b(z),v(V),j(L),R(z,V,L)}}catch{}},P=H=>{const Y=H.target.value;N(Y);const U=ma(Y);if(U){const[z,V,L]=_s(...U);b(z),v(V),j(L),a?.(eo(...U,s))}},T={sm:"h-7 w-7",md:"h-9 w-9",lg:"h-11 w-11"},q=i&&typeof window<"u"&&"EyeDropper"in window;return e.jsxs(ct,{open:f,onOpenChange:w,children:[e.jsx(dt,{asChild:!0,children:e.jsx($,{ref:u,variant:"outline",disabled:c,className:g("p-0.5 rounded-md border",T[x],d),title:m,children:e.jsx("div",{className:"w-full h-full rounded",style:{backgroundColor:t}})})}),e.jsx(rt,{className:"w-64 p-3",align:"start",children:e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{ref:S,className:"relative w-full h-36 rounded cursor-crosshair",style:{background:`
|
|
25
|
+
linear-gradient(to top, #000, transparent),
|
|
26
|
+
linear-gradient(to right, #fff, transparent),
|
|
27
|
+
hsl(${k}, 100%, 50%)
|
|
28
|
+
`},onMouseDown:E,children:e.jsx("div",{className:"absolute w-4 h-4 border-2 border-white rounded-full shadow -translate-x-1/2 -translate-y-1/2 pointer-events-none",style:{left:`${y}%`,top:`${100-p}%`,backgroundColor:`hsl(${k}, ${y}%, ${p}%)`}})}),e.jsx("div",{ref:A,className:"relative w-full h-3 rounded cursor-pointer",style:{background:"linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00)"},onMouseDown:D,children:e.jsx("div",{className:"absolute w-3 h-5 border-2 border-white rounded -translate-x-1/2 -top-1 shadow pointer-events-none",style:{left:`${k/360*100}%`,backgroundColor:`hsl(${k}, 100%, 50%)`}})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-8 h-8 rounded border flex-shrink-0",style:{backgroundColor:t}}),e.jsx(oe,{value:C,onChange:P,className:"h-8 text-sm font-mono",placeholder:s==="hex"?"#000000":s==="rgb"?"rgb(0,0,0)":"hsl(0,0%,0%)"}),q&&e.jsx($,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:M,title:"Pipette",children:e.jsx(h.Pipette,{className:"h-4 w-4"})})]}),n&&o.length>0&&e.jsxs("div",{children:[e.jsx(he,{className:"text-xs text-muted-foreground",children:"Couleurs prédéfinies"}),e.jsx("div",{className:"grid grid-cols-10 gap-1 mt-1",children:o.map(H=>e.jsx("button",{className:g("w-5 h-5 rounded border transition-transform hover:scale-110",t.toLowerCase()===H.toLowerCase()&&"ring-2 ring-primary ring-offset-1"),style:{backgroundColor:H},onClick:()=>{const Y=ma(H);if(Y){const[U,z,V]=_s(...Y);b(U),v(z),j(V),R(U,z,V)}}},H))})]})]})})]})});Hr.displayName="WakaColorPicker";const Nl=l.forwardRef(({error:t,label:a,className:s,...r},n)=>e.jsxs("div",{className:g("space-y-1.5",s),children:[a&&e.jsx(he,{htmlFor:r.name,children:a}),e.jsx(Hr,{ref:n,...r}),t&&e.jsx("p",{className:"text-sm text-destructive",children:t})]}));Nl.displayName="WakaColorPickerForm";function Vx(t){const a=new Map;for(const s of t){const r=s.group;a.has(r)||a.set(r,[]),a.get(r).push(s)}return a}function Wx({options:t,value:a,onChange:s,placeholder:r="Sélectionner...",searchPlaceholder:n="Rechercher...",emptyMessage:o="Aucun résultat trouvé.",multiple:i=!1,creatable:c=!1,onCreate:m,createLabel:d="Créer",onSearch:x,searchDebounce:u=300,disabled:f=!1,error:w=!1,loading:k=!1,size:b="md",clearable:y=!0,maxSelections:v,className:p,id:j,name:C}){const[N,S]=l.useState(!1),[A,R]=l.useState(""),[E,D]=l.useState(t),[M,P]=l.useState(!1),[T,q]=l.useState([]),H=k||M;l.useEffect(()=>{x||D(t)},[t,x]),l.useEffect(()=>{if(!x)return;const I=setTimeout(async()=>{P(!0);try{const te=await x(A);D(te)}catch(te){console.error("Search error:",te)}finally{P(!1)}},u);return()=>clearTimeout(I)},[A,x,u]);const Y=l.useMemo(()=>[...E,...T],[E,T]),U=l.useMemo(()=>{if(x||!A)return Y;const I=A.toLowerCase();return Y.filter(te=>te.label.toLowerCase().includes(I)||te.description?.toLowerCase().includes(I))},[Y,A,x]),z=l.useMemo(()=>a===void 0?[]:Array.isArray(a)?a:[a],[a]),V=l.useMemo(()=>Y.filter(I=>z.some(te=>te===I.value)),[Y,z]),L=I=>{if(!I.disabled)if(i){const te=z.includes(I.value);let Z;if(te)Z=z.filter(J=>J!==I.value);else{if(v&&z.length>=v)return;Z=[...z,I.value]}s?.(Z.length>0?Z:void 0)}else{const te=z.includes(I.value);s?.(te?void 0:I.value),S(!1)}},W=async()=>{if(!(!c||!A.trim())){P(!0);try{let I;m?I=await m(A.trim()):I={value:A.trim(),label:A.trim()},q(te=>[...te,I]),L(I),R("")}catch(I){console.error("Creation error:",I)}finally{P(!1)}}},F=I=>{I.stopPropagation(),s?.(void 0),R("")},G=I=>{if(i){const te=z.filter(Z=>Z!==I);s?.(te.length>0?te:void 0)}},ee=l.useMemo(()=>{if(!c||!A.trim())return!1;const I=A.trim().toLowerCase();return!Y.some(te=>te.label.toLowerCase()===I)},[c,A,Y]),se=l.useMemo(()=>Vx(U),[U]),le=l.useMemo(()=>V.length===0?"":i?`${V.length} sélectionné${V.length>1?"s":""}`:V[0]?.label||"",[V,i]),X={sm:"h-8 text-xs",md:"h-9 text-sm",lg:"h-10 text-base"},K={sm:"h-3 w-3",md:"h-4 w-4",lg:"h-5 w-5"};return e.jsxs(ct,{open:N,onOpenChange:S,children:[e.jsx(dt,{asChild:!0,children:e.jsxs($,{id:j,variant:"outline",role:"combobox","aria-expanded":N,disabled:f,className:g("w-full justify-between font-normal",X[b],!le&&"text-muted-foreground",w&&"border-destructive focus-visible:ring-destructive",p),children:[e.jsx("span",{className:"flex-1 text-left truncate",children:le||r}),e.jsxs("div",{className:"flex items-center gap-1 ml-2",children:[H&&e.jsx(h.Loader2,{className:g(K[b],"animate-spin")}),y&&z.length>0&&!f&&e.jsx(h.X,{className:g(K[b],"opacity-50 hover:opacity-100"),onClick:F}),e.jsx(h.ChevronsUpDown,{className:g(K[b],"opacity-50")})]})]})}),e.jsx(rt,{className:"w-[--radix-popover-trigger-width] p-0",align:"start",children:e.jsxs(ts,{shouldFilter:!1,children:[e.jsx(xs,{placeholder:n,value:A,onValueChange:R}),e.jsxs(Zs,{children:[H&&e.jsx("div",{className:"flex items-center justify-center py-6",children:e.jsx(h.Loader2,{className:"h-5 w-5 animate-spin text-muted-foreground"})}),!H&&U.length===0&&!ee&&e.jsx(gs,{children:o}),!H&&Array.from(se.entries()).map(([I,te],Z)=>e.jsxs(l.Fragment,{children:[Z>0&&e.jsx(ba,{}),e.jsx(Ot,{heading:I,children:te.map(J=>{const ne=z.includes(J.value);return e.jsxs(zt,{value:String(J.value),onSelect:()=>L(J),disabled:J.disabled||i&&!!v&&z.length>=v&&!ne,className:g("flex items-center gap-2",J.disabled&&"opacity-50"),children:[e.jsx("div",{className:g("flex items-center justify-center w-4 h-4 border rounded",ne?"bg-primary border-primary text-primary-foreground":"border-muted-foreground/30"),children:ne&&e.jsx(h.Check,{className:"h-3 w-3"})}),J.icon&&e.jsx("span",{className:"flex-shrink-0",children:J.icon}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"truncate",children:J.label}),J.description&&e.jsx("div",{className:"text-xs text-muted-foreground truncate",children:J.description})]})]},String(J.value))})})]},I||"ungrouped")),ee&&e.jsxs(e.Fragment,{children:[e.jsx(ba,{}),e.jsx(Ot,{children:e.jsxs(zt,{onSelect:W,className:"flex items-center gap-2",children:[e.jsx(h.Plus,{className:K[b]}),e.jsxs("span",{children:[d,' "',A.trim(),'"']})]})})]})]})]})}),C&&e.jsx("input",{type:"hidden",name:C,value:i?z.join(","):String(z[0]||"")}),i&&V.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1 mt-2",children:V.map(I=>e.jsxs(De,{variant:"secondary",className:"gap-1",children:[I.icon,I.label,e.jsx(h.X,{className:"h-3 w-3 cursor-pointer hover:text-destructive",onClick:()=>G(I.value)})]},String(I.value)))})]})}function Ux(t={}){const{options:a=[],initialValue:s,multiple:r=!1}=t,[n,o]=l.useState(s),[i,c]=l.useState(a);return{value:n,onChange:o,options:i,setOptions:c,clear:()=>o(void 0),addOption:w=>{c(k=>[...k,w])},removeOption:w=>{c(k=>k.filter(b=>b.value!==w)),r&&Array.isArray(n)?o(n.filter(k=>k!==w)):n===w&&o(void 0)},selectAll:()=>{r&&o(i.filter(w=>!w.disabled).map(w=>w.value))},selectNone:()=>o(r?[]:void 0),multiple:r}}const Cl=[{label:"Aujourd'hui",getValue:()=>({from:_.startOfDay(new Date),to:_.endOfDay(new Date)})},{label:"Hier",getValue:()=>({from:_.startOfDay(_.subDays(new Date,1)),to:_.endOfDay(_.subDays(new Date,1))})},{label:"7 derniers jours",getValue:()=>({from:_.startOfDay(_.subDays(new Date,6)),to:_.endOfDay(new Date)})},{label:"30 derniers jours",getValue:()=>({from:_.startOfDay(_.subDays(new Date,29)),to:_.endOfDay(new Date)})},{label:"Ce mois",getValue:()=>({from:_.startOfMonth(new Date),to:_.endOfMonth(new Date)})},{label:"Mois dernier",getValue:()=>({from:_.startOfMonth(_.subMonths(new Date,1)),to:_.endOfMonth(_.subMonths(new Date,1))})},{label:"Cette année",getValue:()=>({from:_.startOfYear(new Date),to:_.endOfDay(new Date)})}];function Bx({value:t,onChange:a,placeholder:s="Sélectionner une période",dateFormat:r="dd/MM/yyyy",minDate:n,maxDate:o,disabled:i=!1,error:c=!1,showPresets:m=!0,presets:d=Cl,numberOfMonths:x=2,locale:u=ps,size:f="md",className:w,id:k,name:b,clearable:y=!0}){const[v,p]=l.useState(!1),[j,C]=l.useState(t);l.useEffect(()=>{C(t)},[t]);const N=P=>{C(P),a?.(P)},S=P=>{const T=P.getValue();N(T),p(!1)},A=P=>{P.stopPropagation(),N(void 0)},R=l.useMemo(()=>{if(!j?.from)return"";const P=_.format(j.from,r,{locale:u});if(!j.to)return P;const T=_.format(j.to,r,{locale:u});return`${P} - ${T}`},[j,r,u]),E={sm:"h-8 text-xs px-2",md:"h-9 text-sm px-3",lg:"h-10 text-base px-4"},D={sm:"h-3 w-3",md:"h-4 w-4",lg:"h-5 w-5"},M=l.useMemo(()=>{const P=[];return n&&P.push(T=>_.isBefore(T,_.startOfDay(n))),o&&P.push(T=>_.isAfter(T,_.endOfDay(o))),P.length>0?T=>P.some(q=>q(T)):void 0},[n,o]);return e.jsxs(ct,{open:v,onOpenChange:p,children:[e.jsx(dt,{asChild:!0,children:e.jsxs($,{id:k,variant:"outline",role:"combobox","aria-expanded":v,disabled:i,className:g("w-full justify-start font-normal",E[f],!R&&"text-muted-foreground",c&&"border-destructive focus-visible:ring-destructive",w),children:[e.jsx(h.Calendar,{className:g(D[f],"mr-2")}),e.jsx("span",{className:"flex-1 text-left truncate",children:R||s}),y&&R&&!i&&e.jsx(h.X,{className:g(D[f],"ml-2 opacity-50 hover:opacity-100"),onClick:A})]})}),e.jsxs(rt,{className:"w-auto p-0",align:"start",children:[e.jsxs("div",{className:"flex",children:[m&&d.length>0&&e.jsx("div",{className:"border-r p-2 space-y-1",children:d.map((P,T)=>e.jsx($,{variant:"ghost",size:"sm",className:"w-full justify-start text-xs",onClick:()=>S(P),children:P.label},T))}),e.jsx("div",{className:"p-3",children:e.jsx(Ca,{mode:"range",selected:j,onSelect:N,numberOfMonths:x,locale:u,disabled:M,initialFocus:!0})})]}),e.jsxs("div",{className:"border-t p-3 flex justify-between items-center",children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:j?.from&&j?.to&&e.jsxs(e.Fragment,{children:[Math.ceil((j.to.getTime()-j.from.getTime())/(1e3*60*60*24))+1," ","jours sélectionnés"]})}),e.jsxs("div",{className:"flex gap-2",children:[y&&e.jsx($,{variant:"ghost",size:"sm",onClick:()=>N(void 0),children:"Effacer"}),e.jsx($,{size:"sm",onClick:()=>p(!1),children:"Appliquer"})]})]})]})]})}function qx(t={}){const{initialValue:a,minDate:s,maxDate:r}=t,[n,o]=l.useState(a),i=()=>o(void 0),c=()=>{o({from:_.startOfDay(new Date),to:_.endOfDay(new Date)})},m=()=>{o({from:_.startOfDay(_.subDays(new Date,6)),to:_.endOfDay(new Date)})},d=()=>{o({from:_.startOfMonth(new Date),to:_.endOfMonth(new Date)})},x=f=>!(!f?.from||!f?.to||!_.isValid(f.from)||!_.isValid(f.to)||_.isAfter(f.from,f.to)||s&&_.isBefore(f.from,_.startOfDay(s))||r&&_.isAfter(f.to,_.endOfDay(r)));return{value:n,onChange:o,clear:i,setToday:c,setThisWeek:m,setThisMonth:d,isValidRange:()=>x(n),dayCount:!n?.from||!n?.to?null:Math.ceil((n.to.getTime()-n.from.getTime())/(1e3*60*60*24))+1,minDate:s,maxDate:r}}let to=!1,ir=null;!to&&!$t.isInitialized&&(to=!0,ir=$t.use(Nt.initReactI18next).init({resources:{},fallbackLng:"fr",lng:"fr",defaultNS:"translation",ns:["translation"],debug:!1,interpolation:{escapeValue:!1},react:{useSuspense:!1},ignoreJSONStructure:!0,returnNull:!1,returnEmptyString:!1,returnObjects:!1,load:"languageOnly",detection:void 0,initImmediate:!0}).then(()=>(console.log("[i18n] Initialized successfully"),$t)).catch(t=>(console.error("[i18n] Failed to initialize:",t),$t)));function kl(){const[t,a]=O.useState($t.isInitialized);return O.useEffect(()=>{if($t.isInitialized){a(!0);return}if(ir)ir.then(()=>{a(!0)});else{const s=setTimeout(()=>{a(!0)},100);return()=>clearTimeout(s)}},[]),!t||!$t.isInitialized?{t:s=>s,i18n:$t,ready:!1}:Nt.useTranslation()}_t.registerLocale("fr",ps);_t.registerLocale("en",Lo);_t.registerLocale("es",Io);_t.registerLocale("de",$o);_t.registerLocale("it",Oo);_t.registerLocale("pt",_o);_t.registerLocale("ja",zo);_t.registerLocale("zh",Vo);const Gr=l.forwardRef(({value:t,onChange:a,placeholder:s,disabled:r=!1,className:n,variant:o="date",format:i,minDate:c,maxDate:m,showSeconds:d=!1,showClear:x=!0,showPresets:u=!1,presets:f,locale:w="fr",timeFormat:k="24h",size:b="md",error:y,label:v,required:p=!1,inline:j=!1,monthsShown:C=1,timeIntervals:N=15,validation:S,showWeekNumbers:A=!1,showTodayButton:R=!0,showSelectionInfo:E=!1,allowTimeRange:D=!1,timezone:M,onBeforeChange:P,onAfterChange:T,renderDay:q,popoverClassName:H,disableAnimations:Y=!1,readOnly:U=!1,id:z,name:V,autoFocus:L=!1},W)=>{const{t:F}=kl(),[G,ee]=l.useState(!1),[se,le]=l.useState(o==="range"&&t&&!("from"in t)?{from:t,to:void 0}:t),[X,K]=l.useState(null),[I,te]=l.useState(null),J={fr:ps,en:Lo,es:Io,de:$o,it:Oo,pt:_o,ja:zo,zh:Vo}[w]||ps,ne=[{label:F?.("today")||"Aujourd'hui",value:()=>new Date},{label:F?.("yesterday")||"Hier",value:()=>_.subDays(new Date,1)},{label:F?.("thisWeek")||"Cette semaine",range:()=>({from:_.startOfWeek(new Date,{locale:J}),to:_.endOfWeek(new Date,{locale:J})})},{label:F?.("lastWeek")||"Semaine dernière",range:()=>({from:_.startOfWeek(_.subWeeks(new Date,1),{locale:J}),to:_.endOfWeek(_.subWeeks(new Date,1),{locale:J})})},{label:F?.("thisMonth")||"Ce mois",range:()=>({from:_.startOfMonth(new Date),to:_.endOfMonth(new Date)})},{label:F?.("lastMonth")||"Mois dernier",range:()=>({from:_.startOfMonth(_.subMonths(new Date,1)),to:_.endOfMonth(_.subMonths(new Date,1))})},{label:F?.("last7Days")||"7 derniers jours",range:()=>({from:_.subDays(new Date,7),to:new Date})},{label:F?.("last30Days")||"30 derniers jours",range:()=>({from:_.subDays(new Date,30),to:new Date})},{label:F?.("thisYear")||"Cette année",range:()=>({from:_.startOfYear(new Date),to:_.endOfYear(new Date)})}],me=f||(u?ne:[]),ae={sm:"h-8 px-3 text-xs",md:"h-10 px-4 text-sm",lg:"h-12 px-5 text-base"},Te=i||(()=>{switch(o){case"time":return d?k==="12h"?"h:mm:ss a":"HH:mm:ss":k==="12h"?"h:mm a":"HH:mm";case"datetime":return d?k==="12h"?"PPP h:mm:ss a":"PPP HH:mm:ss":k==="12h"?"PPP h:mm a":"PPP HH:mm";case"range":return"PPP";case"multiple":return"PPP";default:return"PPP"}})(),Ce=Q=>{if(!S)return null;if(c&&_.isBefore(Q,_.startOfDay(c)))return F?.("dateBeforeMin")||`Date antérieure au ${_.format(c,Te,{locale:J})}`;if(m&&_.isAfter(Q,_.endOfDay(m)))return F?.("dateAfterMax")||`Date postérieure au ${_.format(m,Te,{locale:J})}`;if(S.disabledDates?.some(re=>_.isEqual(_.startOfDay(re),_.startOfDay(Q)))||S.disabledDatesFn?.(Q))return S.message||F?.("dateDisabled")||"Date désactivée";if(S.disabledDaysOfWeek?.includes(Q.getDay()))return S.message||F?.("dayOfWeekDisabled")||"Jour de la semaine désactivé";if(S.validate){const re=S.validate(Q);if(re===!1)return S.message||F?.("invalidDate")||"Date invalide";if(typeof re=="string")return re}return null},Je=Q=>{if(U)return;let re=null;if(o==="range"){if(Array.isArray(Q)&&Q[0]&&Q[1])re={from:Q[0],to:Q[1]};else if(Q){const we=se;we?.from&&!we.to?re={from:we.from,to:Q}:re={from:Q,to:void 0}}}else if(o==="multiple")if(Array.isArray(se)){const we=[...se],je=we.findIndex(Pt=>_.isEqual(_.startOfDay(Pt),_.startOfDay(Q)));je>=0?we.splice(je,1):we.push(Q),re=we}else re=Q?[Q]:[];else re=Q;if(!(P&&!P(re))){if(re&&!re.from&&!Array.isArray(re)){const we=Ce(re);if(we){K(we);return}}K(null),le(re),a?.(re),T?.(re),o!=="range"&&o!=="multiple"&&!j&&ee(!1)}},xt=Q=>{if(Q.range){const re=typeof Q.range=="function"?Q.range():Q.range;Je([re.from,re.to])}else if(Q.value){const re=typeof Q.value=="function"?Q.value():Q.value;Je(re)}j||ee(!1)},Ke=Q=>{Q&&Q.stopPropagation(),!U&&(le(null),K(null),a?.(null),T?.(null))},tt=()=>{Je(new Date)},gt=()=>{if(!se)return s||F?.("selectDate")||"Sélectionner une date";try{if(o==="range"){const Q=se;return Q.from&&Q.to?`${_.format(Q.from,Te,{locale:J})} - ${_.format(Q.to,Te,{locale:J})}`:Q.from?`${_.format(Q.from,Te,{locale:J})} - ...`:s||F?.("selectDateRange")||"Sélectionner une période"}if(o==="multiple"){const Q=se;return Q.length===0?s||F?.("selectDates")||"Sélectionner des dates":Q.length===1?_.format(Q[0],Te,{locale:J}):`${Q.length} ${F?.("datesSelected")||"dates sélectionnées"}`}return _.format(se,Te,{locale:J})}catch(Q){return console.error("Error formatting date:",Q),s||F?.("selectDate")||"Sélectionner une date"}},Mt=Q=>!!(c&&_.isBefore(Q,_.startOfDay(c))||m&&_.isAfter(Q,_.endOfDay(m))||S?.disabledDates?.some(re=>_.isEqual(_.startOfDay(re),_.startOfDay(Q)))||S?.disabledDatesFn?.(Q)||S?.disabledDaysOfWeek?.includes(Q.getDay())),Qe=Q=>!!(S?.highlightedDates?.some(re=>_.isEqual(_.startOfDay(re),_.startOfDay(Q)))||S?.highlightedDatesFn?.(Q)),B=()=>{const Q={selected:o==="range"?se?.from:o==="multiple"?void 0:se,onChange:Je,startDate:o==="range"?se?.from:void 0,endDate:o==="range"?se?.to:void 0,selectsRange:o==="range",selectsMultiple:o==="multiple",highlightDates:o==="multiple"?se:void 0,showTimeSelect:o==="time"||o==="datetime",showTimeSelectOnly:o==="time",timeFormat:d?k==="12h"?"h:mm:ss aa":"HH:mm:ss":k==="12h"?"h:mm aa":"HH:mm",timeIntervals:N,timeCaption:F?.("time")||"Heure",dateFormat:Te,locale:w,placeholderText:s,disabled:r,minDate:c,maxDate:m,inline:j,monthsShown:o==="range"?Math.max(2,C):C,showWeekNumbers:A,filterDate:re=>!Mt(re),dayClassName:re=>{const we=[];if(Qe(re)&&we.push("highlighted-date"),I&&o==="range"){const je=se;je?.from&&!je.to&&_.isWithinInterval(re,{start:je.from<I?je.from:I,end:je.from>I?je.from:I})&&we.push("in-selecting-range")}return we.join(" ")},onDayMouseEnter:re=>te(re),calendarClassName:g("waka-datepicker",Y&&"no-animations"),wrapperClassName:"w-full",autoFocus:L};return e.jsxs("div",{className:"flex gap-3",children:[u&&me.length>0&&e.jsxs("div",{className:"flex flex-col gap-1 min-w-[150px] border-r border-border pr-3",children:[e.jsx(he,{className:"text-xs font-semibold text-muted-foreground mb-1",children:F?.("quickSelection")||"Sélection rapide"}),e.jsx(yt,{className:"h-[300px]",children:e.jsx("div",{className:"space-y-1",children:me.map((re,we)=>e.jsx($,{variant:"ghost",size:"sm",className:"w-full justify-start text-xs",onClick:()=>xt(re),children:re.label},we))})})]}),e.jsxs("div",{className:"flex-1",children:[e.jsx(_t,{...Q}),E&&se&&e.jsxs("div",{className:"mt-3 p-2 bg-muted rounded-md text-xs space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(h.Info,{className:"h-3 w-3 text-muted-foreground"}),e.jsxs("span",{className:"font-medium",children:[F?.("selection")||"Sélection"," :"]})]}),e.jsx("div",{className:"text-muted-foreground pl-5",children:gt()})]})]})]})};return j?e.jsxs("div",{ref:W,className:g("space-y-2",n),id:z,children:[v&&e.jsxs(he,{className:"text-sm font-medium text-foreground",children:[v,p&&e.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),e.jsx("div",{className:"border border-border rounded-lg p-4 bg-card",children:B()}),(y||X)&&e.jsxs("div",{className:"flex items-center gap-1.5 text-sm text-destructive",children:[e.jsx(h.AlertCircle,{className:"h-3.5 w-3.5"}),e.jsx("span",{children:y||X})]})]}):e.jsxs("div",{ref:W,className:g("space-y-2",n),id:z,children:[v&&e.jsxs(he,{htmlFor:`${z}-input`,className:"text-sm font-medium text-foreground",children:[v,p&&e.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),e.jsxs(ct,{open:G,onOpenChange:ee,children:[e.jsx(dt,{asChild:!0,children:e.jsxs($,{id:`${z}-input`,name:V,variant:"outline",disabled:r||U,className:g("w-full justify-between text-left font-normal",!se&&"text-muted-foreground",ae[b],(y||X)&&"border-destructive focus-visible:ring-destructive",U&&"cursor-default opacity-70"),"aria-label":v||s,"aria-invalid":!!(y||X),"aria-required":p,children:[e.jsxs("span",{className:"flex items-center gap-2 flex-1 truncate",children:[o==="time"?e.jsx(h.Clock,{className:"h-4 w-4 flex-shrink-0"}):e.jsx(h.Calendar,{className:"h-4 w-4 flex-shrink-0"}),e.jsx("span",{className:"truncate",children:gt()})]}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0 ml-2",children:[se&&x&&!U&&e.jsx(Xs,{children:e.jsxs(Ys,{children:[e.jsx(Js,{asChild:!0,children:e.jsx("div",{className:"h-5 w-5 rounded hover:bg-destructive/10 flex items-center justify-center cursor-pointer",onClick:Ke,role:"button","aria-label":F?.("clear")||"Effacer",children:e.jsx(h.X,{className:"h-3 w-3 text-muted-foreground hover:text-destructive"})})}),e.jsx(Ss,{children:e.jsx("p",{children:F?.("clear")||"Effacer"})})]})}),X&&e.jsx(Xs,{children:e.jsxs(Ys,{children:[e.jsx(Js,{asChild:!0,children:e.jsx(h.AlertCircle,{className:"h-4 w-4 text-destructive"})}),e.jsx(Ss,{children:e.jsx("p",{children:X})})]})})]})]})}),e.jsxs(rt,{className:g("w-auto p-0",H),align:"start",sideOffset:4,children:[e.jsx("div",{className:"p-4",children:B()}),(R||x)&&e.jsxs(e.Fragment,{children:[e.jsx(Et,{}),e.jsxs("div",{className:"flex items-center justify-between p-3 gap-2",children:[R&&e.jsxs($,{variant:"outline",size:"sm",onClick:tt,disabled:r||U,children:[e.jsx(h.Calendar,{className:"h-3.5 w-3.5 mr-1.5"}),F?.("today")||"Aujourd'hui"]}),x&&se&&e.jsxs($,{variant:"outline",size:"sm",onClick:Ke,disabled:r||U,className:"ml-auto",children:[e.jsx(h.X,{className:"h-3.5 w-3.5 mr-1.5"}),F?.("clear")||"Effacer"]})]})]})]})]}),(y||X)&&e.jsxs("div",{className:"flex items-center gap-1.5 text-sm text-destructive",children:[e.jsx(h.AlertCircle,{className:"h-3.5 w-3.5"}),e.jsx("span",{children:y||X})]})]})});Gr.displayName="WakaDateTimePicker";function Hx({name:t,control:a,defaultValue:s,...r}){return e.jsx(mi,{name:t,control:a,defaultValue:s,render:({field:n,fieldState:o})=>e.jsx(Gr,{...r,value:n.value,onChange:n.onChange,error:o.error?.message})})}function Gx(t){return l.useMemo(()=>({formatDateForSubmit:s=>s?s.toISOString():null,formatRangeForSubmit:s=>!s?.from||!s?.to?null:{from:s.from.toISOString(),to:s.to.toISOString()},parseDateFromServer:s=>s?new Date(s):null,parseRangeFromServer:s=>s?{from:new Date(s.from),to:new Date(s.to)}:null}),[])}const Xx={left:{sm:"w-64",md:"w-80",lg:"w-96",xl:"w-[480px]",full:"w-screen"},right:{sm:"w-64",md:"w-80",lg:"w-96",xl:"w-[480px]",full:"w-screen"},top:{sm:"h-32",md:"h-48",lg:"h-64",xl:"h-96",full:"h-screen"},bottom:{sm:"h-32",md:"h-48",lg:"h-64",xl:"h-96",full:"h-screen"}},Yx={left:"left-0 top-0 h-full",right:"right-0 top-0 h-full",top:"top-0 left-0 w-full",bottom:"bottom-0 left-0 w-full"},Jx={left:"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left",right:"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right",top:"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom"},Xr=l.forwardRef(({className:t,...a},s)=>e.jsx("div",{ref:s,className:g("flex flex-col space-y-1.5 p-4 border-b",t),...a}));Xr.displayName="DrawerHeader";const Yr=l.forwardRef(({className:t,...a},s)=>e.jsx("div",{ref:s,className:g("flex-1 overflow-auto p-4",t),...a}));Yr.displayName="DrawerBody";const Jr=l.forwardRef(({className:t,...a},s)=>e.jsx("div",{ref:s,className:g("flex items-center justify-end gap-2 p-4 border-t",t),...a}));Jr.displayName="DrawerFooter";const Kr=l.forwardRef(({className:t,...a},s)=>e.jsx(ue.Title,{ref:s,className:g("text-lg font-semibold leading-none tracking-tight",t),...a}));Kr.displayName="DrawerTitle";const Qr=l.forwardRef(({className:t,...a},s)=>e.jsx(ue.Description,{ref:s,className:g("text-sm text-muted-foreground",t),...a}));Qr.displayName="DrawerDescription";function Kx({open:t,onOpenChange:a,position:s="right",size:r="md",title:n,description:o,showCloseButton:i=!0,closeOnOverlayClick:c=!0,closeOnEscape:m=!0,showOverlay:d=!0,children:x,footer:u,className:f,contentClassName:w}){const k=y=>{c||y.preventDefault()},b=y=>{m||y.preventDefault()};return e.jsx(ue.Root,{open:t,onOpenChange:a,children:e.jsxs(ue.Portal,{children:[d&&e.jsx(ue.Overlay,{className:g("fixed inset-0 z-50 bg-black/50","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0")}),e.jsxs(ue.Content,{onPointerDownOutside:k,onEscapeKeyDown:b,className:g("fixed z-50 bg-background shadow-lg flex flex-col","duration-300 ease-in-out",Yx[s],Xx[s][r],Jx[s],f),children:[(n||o||i)&&e.jsx(Xr,{children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex-1",children:[n&&e.jsx(Kr,{children:n}),o&&e.jsx(Qr,{children:o})]}),i&&e.jsxs(ue.Close,{className:"rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[e.jsx(h.X,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Fermer"})]})]})}),e.jsx(Yr,{className:w,children:x}),u&&e.jsx(Jr,{children:u})]})]})})}function Qx(t={}){const{defaultOpen:a=!1,onOpen:s,onClose:r}=t,[n,o]=l.useState(a),i=l.useCallback(x=>{o(x),x?s?.():r?.()},[s,r]),c=l.useCallback(()=>i(!0),[i]),m=l.useCallback(()=>i(!1),[i]),d=l.useCallback(()=>i(!n),[i,n]);return{open:n,onOpenChange:i,openDrawer:c,closeDrawer:m,toggleDrawer:d}}const Zx=ue.Trigger,eg=ue.Close;function Xa(t){if(t===0)return"0 Bytes";const a=1024,s=["Bytes","KB","MB","GB"],r=Math.floor(Math.log(t)/Math.log(a));return`${parseFloat((t/Math.pow(a,r)).toFixed(2))} ${s[r]}`}function tg(t){const a=t.type;return a.startsWith("image/")?h.Image:a.includes("pdf")?h.FileText:a.includes("spreadsheet")||a.includes("excel")||a.includes("csv")?h.FileSpreadsheet:a.includes("zip")||a.includes("archive")||a.includes("compressed")?h.FileArchive:h.File}const Sl=l.forwardRef(({variant:t="dropzone",accept:a,maxSize:s=10*1024*1024,maxFiles:r=5,multiple:n=!1,onUpload:o,onComplete:i,onRemove:c,onError:m,showPreview:d=!0,showProgress:x=!0,disabled:u=!1,className:f,placeholder:w="Glissez vos fichiers ici ou cliquez pour sélectionner",label:k,description:b},y)=>{const[v,p]=l.useState([]),[j,C]=l.useState(!1),N=l.useRef(null),S=()=>`${Date.now()}-${Math.random().toString(36).slice(2,11)}`,A=U=>s&&U.size>s?`Le fichier dépasse la taille maximale de ${Xa(s)}`:a&&!a.split(",").map(L=>L.trim()).some(L=>L.startsWith(".")?U.name.toLowerCase().endsWith(L.toLowerCase()):L.endsWith("/*")?U.type.startsWith(L.replace("/*","/")):U.type===L)?`Type de fichier non accepté. Types acceptés: ${a}`:null,R=async U=>{const z=Array.from(U),V=v.filter(ee=>ee.status!=="error").length,L=r-V,W=z.slice(0,L);z.length>L&&m?.(`Nombre maximum de fichiers atteint (${r})`);const F=W.map(ee=>({id:S(),file:ee,progress:0,status:"pending"})),G=[];for(const ee of F){const se=A(ee.file);se&&(ee.status="error",ee.error=se,m?.(se,ee.file)),G.push(ee)}if(p(ee=>[...ee,...G]),o)for(const ee of G.filter(se=>se.status==="pending"))try{p(le=>le.map(X=>X.id===ee.id?{...X,status:"uploading"}:X));const se=await o(ee.file,le=>{p(X=>X.map(K=>K.id===ee.id?{...K,progress:le}:K))});p(le=>le.map(X=>X.id===ee.id?{...X,status:"success",progress:100,url:se}:X))}catch(se){const le=se instanceof Error?se.message:"Erreur d'upload";p(X=>X.map(K=>K.id===ee.id?{...K,status:"error",error:le}:K)),m?.(le,ee.file)}else p(ee=>ee.map(se=>G.some(le=>le.id===se.id)&&se.status==="pending"?{...se,status:"success",progress:100}:se))};l.useEffect(()=>{v.length>0&&v.every(z=>z.status!=="pending"&&z.status!=="uploading")&&i?.(v)},[v,i]);const E=U=>{if(U.preventDefault(),C(!1),u)return;const z=U.dataTransfer.files;z.length>0&&R(n?z:[z[0]])},D=U=>{const z=U.target.files;z&&z.length>0&&R(n?z:[z[0]]),U.target.value=""},M=U=>{p(z=>z.filter(V=>V.id!==U.id)),c?.(U)},P=()=>{u||N.current?.click()},T=()=>e.jsx("div",{className:g("relative border-2 border-dashed rounded-lg p-6 transition-colors",j&&"border-primary bg-primary/5",u&&"opacity-50 cursor-not-allowed",!u&&"cursor-pointer hover:border-primary/50",f),onDragOver:U=>{U.preventDefault(),u||C(!0)},onDragLeave:()=>C(!1),onDrop:E,onClick:P,children:e.jsxs("div",{className:"flex flex-col items-center justify-center text-center",children:[e.jsx(h.Upload,{className:g("h-10 w-10 mb-3",j?"text-primary":"text-muted-foreground")}),e.jsx("p",{className:"text-sm font-medium",children:w}),b&&e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:b}),s&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Taille max: ",Xa(s)]})]})}),q=()=>e.jsxs($,{variant:"outline",disabled:u,onClick:P,className:f,children:[e.jsx(h.Upload,{className:"h-4 w-4 mr-2"}),w||"Sélectionner un fichier"]}),H=()=>e.jsxs("div",{className:g("flex items-center gap-2 p-2 border rounded-lg",u&&"opacity-50 cursor-not-allowed",!u&&"cursor-pointer hover:bg-muted/50",f),onClick:P,children:[e.jsx(h.Upload,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:w||"Ajouter un fichier"})]}),Y=U=>{const z=tg(U.file),V=U.file.type.startsWith("image/");return e.jsxs("div",{className:g("flex items-center gap-3 p-2 rounded-lg border",U.status==="error"&&"border-destructive bg-destructive/5"),children:[e.jsx("div",{className:"w-10 h-10 rounded flex items-center justify-center bg-muted overflow-hidden flex-shrink-0",children:d&&V&&U.status!=="error"?e.jsx("img",{src:URL.createObjectURL(U.file),alt:U.file.name,className:"w-full h-full object-cover"}):e.jsx(z,{className:"h-5 w-5 text-muted-foreground"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium truncate",children:U.file.name}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsx("span",{children:Xa(U.file.size)}),U.status==="error"&&e.jsxs("span",{className:"text-destructive flex items-center gap-1",children:[e.jsx(h.AlertCircle,{className:"h-3 w-3"}),U.error]}),U.status==="success"&&e.jsxs("span",{className:"text-green-600 flex items-center gap-1",children:[e.jsx(h.Check,{className:"h-3 w-3"}),"Uploadé"]})]}),x&&U.status==="uploading"&&e.jsx(Gs,{value:U.progress,className:"h-1 mt-1"})]}),e.jsx($,{variant:"ghost",size:"icon",className:"h-8 w-8 flex-shrink-0",onClick:L=>{L.stopPropagation(),M(U)},children:e.jsx(h.X,{className:"h-4 w-4"})})]},U.id)};return e.jsxs("div",{ref:y,className:"space-y-3",children:[k&&e.jsx(he,{children:k}),e.jsx("input",{ref:N,type:"file",accept:a,multiple:n,onChange:D,className:"sr-only",disabled:u}),t==="dropzone"&&T(),t==="button"&&q(),t==="inline"&&H(),v.length>0&&e.jsx("div",{className:"space-y-2",children:v.map(Y)})]})});Sl.displayName="WakaFileUpload";function Dl({src:t,alt:a,width:s,height:r,placeholder:n,placeholderColor:o="bg-muted",lazy:i=!0,zoomable:c=!1,maxZoom:m=3,objectFit:d="cover",objectPosition:x="center",rounded:u="md",showLoader:f=!0,onLoad:w,onError:k,onZoomChange:b,className:y,containerClassName:v,aspectRatio:p}){const[j,C]=l.useState(!1),[N,S]=l.useState(!1),[A,R]=l.useState(!1),[E,D]=l.useState(1),[M,P]=l.useState({x:0,y:0}),[T,q]=l.useState(!1),[H,Y]=l.useState({x:0,y:0}),U=l.useRef(null),z={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",full:"rounded-full"},V=()=>{C(!0),w?.()},L=()=>{S(!0),k?.()},W=()=>{c&&(R(!0),D(1),P({x:0,y:0}))},F=()=>{const I=Math.min(E+.5,m);D(I),b?.(I)},G=()=>{const I=Math.max(E-.5,1);D(I),I===1&&P({x:0,y:0}),b?.(I)},ee=I=>{I.preventDefault(),I.deltaY<0?F():G()},se=I=>{E>1&&(q(!0),Y({x:I.clientX-M.x,y:I.clientY-M.y}))},le=I=>{T&&E>1&&P({x:I.clientX-H.x,y:I.clientY-H.y})},X=()=>{q(!1)},K=async()=>{try{const te=await(await fetch(t)).blob(),Z=window.URL.createObjectURL(te),J=document.createElement("a");J.href=Z,J.download=a||"image",document.body.appendChild(J),J.click(),document.body.removeChild(J),window.URL.revokeObjectURL(Z)}catch(I){console.error("Failed to download image:",I)}};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:g("relative overflow-hidden",z[u],v),style:{width:s,height:r,aspectRatio:p},children:[(!j||N)&&e.jsx("div",{className:g("absolute inset-0 flex items-center justify-center",o,z[u]),children:n?e.jsx("img",{src:n,alt:"",className:g("w-full h-full",`object-${d}`),style:{objectPosition:x}}):N?e.jsxs("div",{className:"flex flex-col items-center gap-2 text-muted-foreground",children:[e.jsx(h.ImageIcon,{className:"h-8 w-8"}),e.jsx("span",{className:"text-xs",children:"Erreur de chargement"})]}):f?e.jsx("div",{className:"animate-pulse",children:e.jsx(h.ImageIcon,{className:"h-8 w-8 text-muted-foreground"})}):null}),!N&&e.jsx("img",{ref:U,src:t,alt:a,loading:i?"lazy":"eager",onLoad:V,onError:L,onClick:W,className:g("w-full h-full transition-opacity duration-300",`object-${d}`,j?"opacity-100":"opacity-0",c&&"cursor-zoom-in",z[u],y),style:{objectPosition:x}}),c&&j&&!N&&e.jsx("div",{className:"absolute bottom-2 right-2 p-1 bg-black/50 rounded text-white",children:e.jsx(h.Maximize2,{className:"h-4 w-4"})})]}),c&&e.jsx(It,{open:A,onOpenChange:R,children:e.jsxs(Tt,{className:"max-w-[95vw] max-h-[95vh] p-0 overflow-hidden bg-black/95",onWheel:ee,children:[e.jsxs("div",{className:"absolute top-4 right-4 z-50 flex gap-2",children:[e.jsx($,{variant:"secondary",size:"icon",onClick:G,disabled:E<=1,children:e.jsx(h.ZoomOut,{className:"h-4 w-4"})}),e.jsx($,{variant:"secondary",size:"icon",onClick:F,disabled:E>=m,children:e.jsx(h.ZoomIn,{className:"h-4 w-4"})}),e.jsx($,{variant:"secondary",size:"icon",onClick:K,children:e.jsx(h.Download,{className:"h-4 w-4"})}),e.jsx(Go,{asChild:!0,children:e.jsx($,{variant:"secondary",size:"icon",children:e.jsx(h.X,{className:"h-4 w-4"})})})]}),e.jsxs("div",{className:"absolute bottom-4 left-4 z-50 text-white text-sm bg-black/50 px-2 py-1 rounded",children:[Math.round(E*100),"%"]}),e.jsx("div",{className:g("w-full h-full flex items-center justify-center overflow-hidden",E>1?"cursor-grab":"cursor-default",T&&"cursor-grabbing"),onMouseDown:se,onMouseMove:le,onMouseUp:X,onMouseLeave:X,children:e.jsx("img",{src:t,alt:a,className:"max-w-none select-none",style:{transform:`scale(${E}) translate(${M.x/E}px, ${M.y/E}px)`,transition:T?"none":"transform 0.2s ease-out"},draggable:!1})})]})})]})}function sg({images:t,columns:a=3,gap:s=4,aspectRatio:r="1/1",className:n}){return e.jsx("div",{className:g("grid",n),style:{gridTemplateColumns:`repeat(${a}, 1fr)`,gap:`${s*4}px`},children:t.map((o,i)=>e.jsx(Dl,{src:o.thumbnail||o.src,alt:o.alt,zoomable:!0,objectFit:"cover",containerClassName:"w-full",aspectRatio:r},i))})}const ag={low:"bg-gray-100 text-gray-700 border-gray-200",medium:"bg-blue-100 text-blue-700 border-blue-200",high:"bg-orange-100 text-orange-700 border-orange-200",urgent:"bg-red-100 text-red-700 border-red-200"};function rg({card:t,columnId:a,onCardClick:s,onCardDelete:r,renderCard:n,onDragStart:o}){return n?e.jsx("div",{draggable:!0,onDragStart:i=>o(i,t.id,a),className:"cursor-grab active:cursor-grabbing",children:n(t,a)}):e.jsxs("div",{draggable:!0,onDragStart:i=>o(i,t.id,a),onClick:()=>s?.(t,a),className:g("group bg-card border rounded-lg p-3 shadow-sm cursor-grab active:cursor-grabbing","hover:border-primary/50 hover:shadow-md transition-all duration-200"),children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[t.labels&&t.labels.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1 mb-2",children:t.labels.map(i=>e.jsx("span",{className:"px-1.5 py-0.5 text-[10px] font-medium rounded",style:{backgroundColor:i.color+"20",color:i.color},children:i.name},i.id))}),e.jsx("h4",{className:"font-medium text-sm truncate",children:t.title}),t.description&&e.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:t.description})]}),e.jsx(h.GripVertical,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0"})]}),(t.priority||t.assignee||t.dueDate)&&e.jsxs("div",{className:"flex items-center justify-between mt-3 pt-2 border-t",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[t.priority&&e.jsx("span",{className:g("px-1.5 py-0.5 text-[10px] font-medium rounded border",ag[t.priority]),children:t.priority}),t.dueDate&&e.jsx("span",{className:"text-[10px] text-muted-foreground",children:t.dueDate.toLocaleDateString()})]}),t.assignee&&e.jsx("div",{className:"h-6 w-6 rounded-full bg-primary/10 flex items-center justify-center text-[10px] font-medium",title:t.assignee.name,children:t.assignee.avatar?e.jsx("img",{src:t.assignee.avatar,alt:t.assignee.name,className:"h-full w-full rounded-full object-cover"}):t.assignee.name.charAt(0).toUpperCase()})]}),r&&e.jsx($,{variant:"ghost",size:"icon",className:"absolute top-1 right-1 h-6 w-6 opacity-0 group-hover:opacity-100",onClick:i=>{i.stopPropagation(),r(t.id,a)},children:e.jsx(h.X,{className:"h-3 w-3"})})]})}function ng({column:t,onCardMove:a,onCardAdd:s,onCardDelete:r,onCardClick:n,onColumnDelete:o,allowAddCard:i,allowColumnDrag:c,renderCard:m,draggedCard:d,setDraggedCard:x,onColumnDragStart:u}){const[f,w]=l.useState(!1),[k,b]=l.useState(""),[y,v]=l.useState(null),p=(E,D,M)=>{x({id:D,fromColumnId:M}),E.dataTransfer.effectAllowed="move"},j=(E,D)=>{E.preventDefault(),d&&v(D)},C=()=>{v(null)},N=(E,D)=>{E.preventDefault(),d&&a&&a(d.id,d.fromColumnId,t.id,D),x(null),v(null)},S=E=>{E.preventDefault(),d&&a&&a(d.id,d.fromColumnId,t.id,t.cards.length),x(null),v(null)},A=()=>{k.trim()&&s&&(s(t.id,{title:k.trim()}),b(""),w(!1))},R=t.limit!==void 0&&t.cards.length>=t.limit;return e.jsxs("div",{className:"flex flex-col bg-muted/50 rounded-lg min-w-[280px] max-w-[320px] h-full",onDragOver:E=>E.preventDefault(),onDrop:S,children:[e.jsxs("div",{className:g("flex items-center justify-between p-3 border-b",c&&"cursor-grab active:cursor-grabbing"),draggable:c,onDragStart:E=>u(E,t.id),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[t.color&&e.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:t.color}}),e.jsx("h3",{className:"font-semibold text-sm",children:t.title}),e.jsxs("span",{className:"text-xs text-muted-foreground bg-background px-1.5 py-0.5 rounded",children:[t.cards.length,t.limit&&`/${t.limit}`]})]}),o&&e.jsxs(Ge,{children:[e.jsx(Xe,{asChild:!0,children:e.jsx($,{variant:"ghost",size:"icon",className:"h-6 w-6",children:e.jsx(h.MoreHorizontal,{className:"h-4 w-4"})})}),e.jsx(Ue,{align:"end",children:e.jsx(xe,{className:"text-destructive",onClick:()=>o(t.id),children:"Supprimer la colonne"})})]})]}),e.jsx(yt,{className:"flex-1 p-2",children:e.jsxs("div",{className:"space-y-2",children:[t.cards.map((E,D)=>e.jsxs("div",{onDragOver:M=>j(M,D),onDragLeave:C,onDrop:M=>N(M,D),children:[y===D&&d&&e.jsx("div",{className:"h-1 bg-primary rounded mb-2"}),e.jsx(rg,{card:E,columnId:t.id,onCardClick:n,onCardDelete:r,renderCard:m,onDragStart:p})]},E.id)),d&&y===null&&e.jsx("div",{className:"h-20 border-2 border-dashed border-primary/30 rounded-lg",onDragOver:E=>{E.preventDefault(),v(t.cards.length)}})]})}),i&&e.jsx("div",{className:"p-2 border-t",children:f?e.jsxs("div",{className:"space-y-2",children:[e.jsx(oe,{value:k,onChange:E=>b(E.target.value),placeholder:"Titre de la carte...",autoFocus:!0,onKeyDown:E=>{E.key==="Enter"&&A(),E.key==="Escape"&&w(!1)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx($,{size:"sm",onClick:A,disabled:!k.trim(),children:"Ajouter"}),e.jsx($,{size:"sm",variant:"ghost",onClick:()=>w(!1),children:"Annuler"})]})]}):e.jsxs($,{variant:"ghost",className:"w-full justify-start text-muted-foreground",onClick:()=>w(!0),disabled:R,children:[e.jsx(h.Plus,{className:"h-4 w-4 mr-1"}),"Ajouter une carte"]})})]})}function og({columns:t,onCardMove:a,onColumnMove:s,onCardAdd:r,onCardDelete:n,onCardClick:o,onColumnAdd:i,onColumnDelete:c,allowAddCard:m=!0,allowAddColumn:d=!1,allowColumnDrag:x=!1,renderCard:u,height:f="100%",className:w}){const[k,b]=l.useState(null),[y,v]=l.useState(null),[p,j]=l.useState(!1),[C,N]=l.useState(""),S=(E,D)=>{x&&(v(D),E.dataTransfer.effectAllowed="move")},A=(E,D)=>{E.preventDefault(),y&&s&&s(y,D),v(null)},R=()=>{C.trim()&&i&&(i({title:C.trim()}),N(""),j(!1))};return e.jsxs("div",{className:g("flex gap-4 overflow-x-auto p-4",w),style:{height:f},children:[t.map((E,D)=>e.jsx("div",{onDragOver:M=>M.preventDefault(),onDrop:M=>A(M,D),children:e.jsx(ng,{column:E,onCardMove:a,onCardAdd:r,onCardDelete:n,onCardClick:o,onColumnDelete:c,allowAddCard:m,allowColumnDrag:x,renderCard:u,draggedCard:k,setDraggedCard:b,onColumnDragStart:S})},E.id)),d&&e.jsx("div",{className:"min-w-[280px]",children:p?e.jsxs("div",{className:"bg-muted/50 rounded-lg p-3 space-y-2",children:[e.jsx(oe,{value:C,onChange:E=>N(E.target.value),placeholder:"Titre de la colonne...",autoFocus:!0,onKeyDown:E=>{E.key==="Enter"&&R(),E.key==="Escape"&&j(!1)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx($,{size:"sm",onClick:R,disabled:!C.trim(),children:"Ajouter"}),e.jsx($,{size:"sm",variant:"ghost",onClick:()=>j(!1),children:"Annuler"})]})]}):e.jsxs($,{variant:"outline",className:"w-full h-auto py-8 border-dashed",onClick:()=>j(!0),children:[e.jsx(h.Plus,{className:"h-4 w-4 mr-2"}),"Ajouter une colonne"]})})]})}function ig(t){const[a,s]=l.useState(t);return{columns:a,setColumns:s,moveCard:(d,x,u,f)=>{s(w=>{const k=[...w],b=k.find(j=>j.id===x);if(!b)return w;const y=b.cards.findIndex(j=>j.id===d);if(y===-1)return w;const[v]=b.cards.splice(y,1),p=k.find(j=>j.id===u);return p?(p.cards.splice(f,0,v),k):w})},moveColumn:(d,x)=>{s(u=>{const f=[...u],w=f.findIndex(b=>b.id===d);if(w===-1)return u;const[k]=f.splice(w,1);return f.splice(x,0,k),f})},addCard:(d,x)=>{s(u=>u.map(f=>f.id===d?{...f,cards:[...f.cards,{id:`card-${Date.now()}`,title:x.title||"Nouvelle carte",...x}]}:f))},deleteCard:(d,x)=>{s(u=>u.map(f=>f.id===x?{...f,cards:f.cards.filter(w=>w.id!==d)}:f))},addColumn:d=>{s(x=>[...x,{id:`column-${Date.now()}`,title:d.title||"Nouvelle colonne",cards:[],...d}])},deleteColumn:d=>{s(x=>x.filter(u=>u.id!==d))}}}const lg={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl",full:"max-w-[calc(100vw-2rem)] max-h-[calc(100vh-2rem)]"},cg={fade:"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",slide:"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",scale:"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",none:""},dg={fade:"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",slide:"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:slide-out-to-top-[2%] data-[state=open]:slide-in-from-top-[2%]",scale:"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",none:""},Zr=l.forwardRef(({className:t,animation:a="fade",...s},r)=>e.jsx(ue.Overlay,{ref:r,className:g("fixed inset-0 z-50 bg-black/80",cg[a],t),...s}));Zr.displayName="ModalOverlay";const en=l.forwardRef(({className:t,children:a,size:s="md",animation:r="fade",centered:n=!0,showCloseButton:o=!0,...i},c)=>e.jsxs(ue.Content,{ref:c,className:g("fixed z-50 w-full bg-background shadow-lg sm:rounded-lg","left-1/2 -translate-x-1/2",n?"top-1/2 -translate-y-1/2":"top-[10%]",lg[s],dg[r],"duration-200",t),...i,children:[a,o&&e.jsxs(ue.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[e.jsx(h.X,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Fermer"})]})]}));en.displayName="ModalContent";const tn=l.forwardRef(({className:t,sticky:a,...s},r)=>e.jsx("div",{ref:r,className:g("flex flex-col space-y-1.5 p-6 pb-4",a&&"sticky top-0 bg-background z-10 border-b",t),...s}));tn.displayName="ModalHeader";const sn=l.forwardRef(({className:t,...a},s)=>e.jsx(ue.Title,{ref:s,className:g("text-lg font-semibold leading-none tracking-tight",t),...a}));sn.displayName="ModalTitle";const an=l.forwardRef(({className:t,...a},s)=>e.jsx(ue.Description,{ref:s,className:g("text-sm text-muted-foreground",t),...a}));an.displayName="ModalDescription";const rn=l.forwardRef(({className:t,...a},s)=>e.jsx("div",{ref:s,className:g("px-6 py-4 overflow-auto",t),...a}));rn.displayName="ModalBody";const nn=l.forwardRef(({className:t,sticky:a,...s},r)=>e.jsx("div",{ref:r,className:g("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 p-6 pt-4",a&&"sticky bottom-0 bg-background z-10 border-t",t),...s}));nn.displayName="ModalFooter";function ug({open:t,onOpenChange:a,title:s,description:r,children:n,size:o="md",showCloseButton:i=!0,closeOnOverlayClick:c=!0,closeOnEscape:m=!0,animation:d="scale",centered:x=!0,stickyHeader:u=!1,stickyFooter:f=!1,footer:w,className:k,overlayClassName:b}){const y=p=>{c||p.preventDefault()},v=p=>{m||p.preventDefault()};return e.jsx(ue.Root,{open:t,onOpenChange:a,children:e.jsxs(ue.Portal,{children:[e.jsx(Zr,{animation:d,className:b}),e.jsxs(en,{size:o,animation:d,centered:x,showCloseButton:i,className:k,onInteractOutside:y,onEscapeKeyDown:v,children:[(s||r)&&e.jsxs(tn,{sticky:u,children:[s&&e.jsx(sn,{children:s}),r&&e.jsx(an,{children:r})]}),e.jsx(rn,{children:n}),w&&e.jsx(nn,{sticky:f,children:w})]})]})})}function mg({children:t,onOpen:a,className:s,disabled:r}){return e.jsx(ue.Trigger,{className:s,disabled:r,onClick:a,asChild:!0,children:t})}function hg(t){const{defaultOpen:a=!1,onOpenChange:s}=t||{},[r,n]=l.useState(a),o=l.useCallback(()=>{n(!0),s?.(!0)},[s]),i=l.useCallback(()=>{n(!1),s?.(!1)},[s]),c=l.useCallback(()=>{n(d=>{const x=!d;return s?.(x),x})},[s]),m=l.useCallback(d=>{n(d),s?.(d)},[s]);return{isOpen:r,open:o,close:i,toggle:c,onOpenChange:m}}const fg={info:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",success:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",warning:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",error:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"},xa=l.forwardRef(({notification:t,onMarkAsRead:a,onDelete:s},r)=>{const n=o=>{const c=new Date().getTime()-o.getTime(),m=Math.floor(c/6e4),d=Math.floor(c/36e5),x=Math.floor(c/864e5);return m<1?"À l'instant":m<60?`Il y a ${m} min`:d<24?`Il y a ${d}h`:x<7?`Il y a ${x}j`:o.toLocaleDateString("fr-FR")};return e.jsxs("div",{ref:r,className:g("flex gap-3 p-4 hover:bg-muted/50 transition-colors border-l-4",t.read?"border-l-transparent opacity-60":"border-l-primary","relative group"),children:[e.jsx("div",{className:g("flex-shrink-0 w-10 h-10 rounded-full flex items-center justify-center",fg[t.type]),children:t.icon||e.jsx(h.Bell,{className:"h-5 w-5"})}),e.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("h4",{className:g("text-sm font-semibold",t.read&&"font-normal"),children:t.title}),e.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:n(t.timestamp)})]}),e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:t.message}),t.action&&e.jsx($,{variant:"link",size:"sm",className:"h-auto p-0 text-primary",onClick:t.action.onClick,children:t.action.label})]}),e.jsxs("div",{className:"flex-shrink-0 flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[!t.read&&a&&e.jsxs($,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>a(t.id),children:[e.jsx(h.Check,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Marquer comme lu"})]}),s&&e.jsxs($,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive",onClick:()=>s(t.id),children:[e.jsx(h.Trash2,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Supprimer"})]})]})]})});xa.displayName="NotificationItem";const Tl=l.forwardRef(({notifications:t,onMarkAsRead:a,onMarkAllAsRead:s,onDelete:r,onDeleteAll:n,onSettingsClick:o,maxHeight:i="400px",className:c,iconClassName:m,badgeClassName:d,showBadge:x=!0,showTabs:u=!0,emptyMessage:f="Aucune notification",emptyIcon:w},k)=>{const[b,y]=l.useState(!1),[v,p]=l.useState("all"),j=t.filter(S=>!S.read).length,C=l.useMemo(()=>v==="all"?t:v==="unread"?t.filter(S=>!S.read):t,[t,v]),N=()=>e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 px-4 text-center",children:[w||e.jsx(h.Bell,{className:"h-12 w-12 text-muted-foreground/50 mb-4"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:f})]});return e.jsxs(ct,{open:b,onOpenChange:y,children:[e.jsx(dt,{asChild:!0,children:e.jsxs($,{ref:k,variant:"ghost",size:"icon",className:g("relative",c),children:[e.jsx(h.Bell,{className:g("h-5 w-5",m)}),x&&j>0&&e.jsx(De,{variant:"destructive",className:g("absolute -top-1 -right-1 h-5 min-w-[20px] flex items-center justify-center p-0 text-xs",d),children:j>99?"99+":j}),e.jsxs("span",{className:"sr-only",children:["Notifications (",j," non lues)"]})]})}),e.jsxs(rt,{className:"w-[380px] p-0",align:"end",sideOffset:8,children:[e.jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-base",children:"Notifications"}),j>0&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[j," non ",j>1?"lues":"lue"]})]}),e.jsxs("div",{className:"flex gap-1",children:[s&&j>0&&e.jsxs($,{variant:"ghost",size:"sm",className:"h-8 text-xs",onClick:s,children:[e.jsx(h.Check,{className:"h-3 w-3 mr-1"}),"Tout marquer"]}),o&&e.jsxs($,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:o,children:[e.jsx(h.Settings,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Paramètres"})]})]})]}),u&&t.length>0&&e.jsxs(aa,{value:v,onValueChange:p,className:"w-full",children:[e.jsxs(Es,{className:"w-full rounded-none border-b bg-transparent p-0",children:[e.jsxs(js,{value:"all",className:"flex-1 rounded-none data-[state=active]:border-b-2 data-[state=active]:border-primary",children:["Toutes (",t.length,")"]}),e.jsxs(js,{value:"unread",className:"flex-1 rounded-none data-[state=active]:border-b-2 data-[state=active]:border-primary",children:["Non lues (",j,")"]})]}),e.jsx(vs,{value:"all",className:"m-0",children:e.jsx(yt,{className:"h-[400px]",style:{maxHeight:i},children:e.jsx("div",{className:"p-0",children:C.length===0?e.jsx(N,{}):e.jsx("div",{className:"divide-y",children:C.map(S=>e.jsx(xa,{notification:S,onMarkAsRead:a,onDelete:r},S.id))})})})}),e.jsx(vs,{value:"unread",className:"m-0",children:e.jsx(yt,{className:"h-[400px]",style:{maxHeight:i},children:e.jsx("div",{className:"p-0",children:C.length===0?e.jsx(N,{}):e.jsx("div",{className:"divide-y",children:C.map(S=>e.jsx(xa,{notification:S,onMarkAsRead:a,onDelete:r},S.id))})})})})]}),!u&&e.jsx(yt,{className:"h-[400px]",style:{maxHeight:i},children:e.jsx("div",{className:"p-0",children:t.length===0?e.jsx(N,{}):e.jsx("div",{className:"divide-y",children:t.map(S=>e.jsx(xa,{notification:S,onMarkAsRead:a,onDelete:r},S.id))})})}),t.length>0&&n&&e.jsxs(e.Fragment,{children:[e.jsx(Et,{}),e.jsx("div",{className:"p-2",children:e.jsxs($,{variant:"ghost",size:"sm",className:"w-full text-destructive hover:text-destructive",onClick:n,children:[e.jsx(h.Trash2,{className:"h-3 w-3 mr-2"}),"Tout supprimer"]})})]})]})]})});Tl.displayName="WakaNotifications";function pg(t=[]){const[a,s]=l.useState(t),r=l.useCallback(d=>{const x={...d,id:`notification-${Date.now()}-${Math.random()}`,timestamp:new Date,read:!1};s(u=>[x,...u])},[]),n=l.useCallback(d=>{s(x=>x.map(u=>u.id===d?{...u,read:!0}:u))},[]),o=l.useCallback(()=>{s(d=>d.map(x=>({...x,read:!0})))},[]),i=l.useCallback(d=>{s(x=>x.filter(u=>u.id!==d))},[]),c=l.useCallback(()=>{s([])},[]),m=l.useMemo(()=>a.filter(d=>!d.read).length,[a]);return{notifications:a,addNotification:r,markAsRead:n,markAllAsRead:o,deleteNotification:i,deleteAllNotifications:c,unreadCount:m}}function Us(t,a,s){let r=t;return a!==void 0&&r<a&&(r=a),s!==void 0&&r>s&&(r=s),r}function Ya(t,a){const s=Math.pow(10,a);return Math.round(t*s)/s}function xg({value:t,onChange:a,min:s,max:r,step:n=1,precision:o=0,placeholder:i="0",disabled:c=!1,error:m=!1,size:d="md",buttonPosition:x="sides",allowEmpty:u=!1,formatValue:f,parseValue:w,className:k,id:b,name:y}){const[v,p]=l.useState(t!==void 0?f?f(t):String(t):""),[j,C]=l.useState(!1);l.useEffect(()=>{j||p(t!==void 0?f?f(t):String(t):"")},[t,f,j]);const N=U=>{const z=U.target.value;if(p(z),z===""&&u){a?.(void 0);return}let V;if(w)V=w(z);else{const L=z.replace(",",".");V=parseFloat(L)}if(V!==void 0&&!isNaN(V)){const L=Us(Ya(V,o),s,r);a?.(L)}},S=()=>{if(C(!1),t!==void 0)p(f?f(t):String(t));else if(!u){const U=s!==void 0?s:0;a?.(U),p(f?f(U):String(U))}},A=()=>{C(!0)},R=()=>{const z=Us(Ya((t??(s!==void 0?s:0))+n,o),s,r);a?.(z)},E=()=>{const z=Us(Ya((t??(s!==void 0?s:0))-n,o),s,r);a?.(z)},D=U=>{U.key==="ArrowUp"?(U.preventDefault(),R()):U.key==="ArrowDown"&&(U.preventDefault(),E())},M={sm:"h-8 text-xs",md:"h-9 text-sm",lg:"h-10 text-base"},P={sm:"h-8 w-8",md:"h-9 w-9",lg:"h-10 w-10"},T={sm:"h-3 w-3",md:"h-4 w-4",lg:"h-5 w-5"},q=r===void 0||(t??0)<r,H=s===void 0||(t??0)>s,Y=(U,z)=>{const V=U==="increment",L=V?h.Plus:h.Minus,W=V?R:E,F=V?q:H;return e.jsx($,{type:"button",variant:"outline",size:"icon",className:g(P[d],"flex-shrink-0",z==="left"&&"rounded-r-none border-r-0",z==="right"&&"rounded-l-none border-l-0"),onClick:W,disabled:c||!F,tabIndex:-1,"aria-label":V?"Augmenter":"Diminuer",children:e.jsx(L,{className:T[d]})})};return x==="none"?e.jsx(oe,{id:b,name:y,type:"text",inputMode:"decimal",value:v,onChange:N,onBlur:S,onFocus:A,onKeyDown:D,placeholder:i,disabled:c,className:g(M[d],"text-center",m&&"border-destructive focus-visible:ring-destructive",k)}):x==="right"?e.jsxs("div",{className:g("flex",k),children:[e.jsx(oe,{id:b,name:y,type:"text",inputMode:"decimal",value:v,onChange:N,onBlur:S,onFocus:A,onKeyDown:D,placeholder:i,disabled:c,className:g(M[d],"rounded-r-none",m&&"border-destructive focus-visible:ring-destructive")}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx($,{type:"button",variant:"outline",size:"icon",className:g("h-[50%] w-6 rounded-none rounded-tr-md border-l-0 border-b-0",d==="sm"&&"h-4",d==="lg"&&"h-5"),onClick:R,disabled:c||!q,tabIndex:-1,"aria-label":"Augmenter",children:e.jsx(h.Plus,{className:"h-2.5 w-2.5"})}),e.jsx($,{type:"button",variant:"outline",size:"icon",className:g("h-[50%] w-6 rounded-none rounded-br-md border-l-0",d==="sm"&&"h-4",d==="lg"&&"h-5"),onClick:E,disabled:c||!H,tabIndex:-1,"aria-label":"Diminuer",children:e.jsx(h.Minus,{className:"h-2.5 w-2.5"})})]})]}):e.jsxs("div",{className:g("flex",k),children:[Y("decrement","left"),e.jsx(oe,{id:b,name:y,type:"text",inputMode:"decimal",value:v,onChange:N,onBlur:S,onFocus:A,onKeyDown:D,placeholder:i,disabled:c,className:g(M[d],"rounded-none text-center",m&&"border-destructive focus-visible:ring-destructive")}),Y("increment","right")]})}function gg(t={}){const{initialValue:a,min:s,max:r,step:n=1}=t,[o,i]=l.useState(a);return{value:o,onChange:i,increment:()=>{i(u=>Us((u??(s!==void 0?s:0))+n,s,r))},decrement:()=>{i(u=>Us((u??(s!==void 0?s:0))-n,s,r))},reset:()=>i(a),clear:()=>i(void 0),min:s,max:r,step:n}}function bg(t,a,s){if(a<=s)return Array.from({length:a},(o,i)=>i+1);const r=[],n=Math.floor((s-3)/2);if(r.push(1),t<=n+2){for(let o=2;o<=Math.min(s-1,a-1);o++)r.push(o);a>s&&r.push("ellipsis")}else if(t>=a-n-1){r.push("ellipsis");for(let o=Math.max(a-s+2,2);o<=a-1;o++)r.push(o)}else{r.push("ellipsis");for(let o=t-n;o<=t+n;o++)r.push(o);r.push("ellipsis")}return a>1&&r.push(a),r}function jg({page:t,totalPages:a,onPageChange:s,pageSize:r=10,pageSizeOptions:n=[10,20,50,100],onPageSizeChange:o,totalItems:i,showPageSizeSelector:c=!1,showItemsInfo:m=!1,showFirstLast:d=!0,maxVisiblePages:x=7,size:u="md",variant:f="outline",className:w,labels:k={}}){const{page:b="Page",of:y="sur",items:v="éléments",itemsPerPage:p="par page",first:j="Première page",previous:C="Page précédente",next:N="Page suivante",last:S="Dernière page"}=k,A={sm:"h-7 w-7 text-xs",md:"h-8 w-8 text-sm",lg:"h-10 w-10 text-base"},R={sm:"h-3 w-3",md:"h-4 w-4",lg:"h-5 w-5"},E=bg(t,a,x),D=T=>{T>=1&&T<=a&&T!==t&&s(T)},M=i?(t-1)*r+1:null,P=i?Math.min(t*r,i):null;return e.jsxs("nav",{role:"navigation","aria-label":"Pagination",className:g("flex flex-wrap items-center gap-4 justify-between",w),children:[m&&i!==void 0&&e.jsxs("div",{className:"text-sm text-muted-foreground",children:[M,"-",P," ",y," ",i," ",v]}),c&&o&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-sm text-muted-foreground whitespace-nowrap",children:[p,":"]}),e.jsxs(Oe,{value:String(r),onValueChange:T=>o(Number(T)),children:[e.jsx(Le,{className:g("w-[70px]",u==="sm"?"h-7":u==="lg"?"h-10":"h-8"),children:e.jsx(ze,{})}),e.jsx(Ie,{children:n.map(T=>e.jsx(be,{value:String(T),children:T},T))})]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[d&&e.jsx($,{variant:f,size:"icon",className:A[u],onClick:()=>D(1),disabled:t===1,"aria-label":j,children:e.jsx(h.ChevronsLeft,{className:R[u]})}),e.jsx($,{variant:f,size:"icon",className:A[u],onClick:()=>D(t-1),disabled:t===1,"aria-label":C,children:e.jsx(h.ChevronLeft,{className:R[u]})}),e.jsx("div",{className:"flex items-center gap-1",children:E.map((T,q)=>{if(T==="ellipsis")return e.jsx("span",{className:g("flex items-center justify-center text-muted-foreground",A[u]),children:e.jsx(h.MoreHorizontal,{className:R[u]})},`ellipsis-${q}`);const H=T===t;return e.jsx($,{variant:H?"default":f,size:"icon",className:g(A[u],H&&"pointer-events-none"),onClick:()=>D(T),"aria-label":`${b} ${T}`,"aria-current":H?"page":void 0,children:T},T)})}),e.jsx($,{variant:f,size:"icon",className:A[u],onClick:()=>D(t+1),disabled:t===a,"aria-label":N,children:e.jsx(h.ChevronRight,{className:R[u]})}),d&&e.jsx($,{variant:f,size:"icon",className:A[u],onClick:()=>D(a),disabled:t===a,"aria-label":S,children:e.jsx(h.ChevronsRight,{className:R[u]})})]}),!m&&a>0&&e.jsxs("div",{className:"text-sm text-muted-foreground",children:[b," ",t," ",y," ",a]})]})}function vg({totalItems:t,initialPageSize:a=10,initialPage:s=1}){const[r,n]=l.useState(s),[o,i]=l.useState(a),c=Math.ceil(t/o);l.useEffect(()=>{r>c&&c>0&&n(c)},[r,c]);const m=b=>{i(b),n(1)},d=()=>{r<c&&n(r+1)},x=()=>{r>1&&n(r-1)},u=()=>n(1),f=()=>n(c),w=(r-1)*o,k=Math.min(w+o-1,t-1);return{page:r,pageSize:o,totalPages:c,setPage:n,setPageSize:m,nextPage:d,prevPage:x,firstPage:u,lastPage:f,canNextPage:r<c,canPrevPage:r>1,startIndex:w,endIndex:k}}function wg(t,a){const s=Math.max(21,Math.min(177,21+Math.floor(t.length/10)*4)),r=[];for(let n=0;n<s;n++){r[n]=[];for(let o=0;o<s;o++)if(n<7&&o<7||n<7&&o>=s-7||n>=s-7&&o<7){const c=n<7?n:n-(s-7),m=o<7?o:o>=s-7?o-(s-7):o;c===0||c===6||m===0||m===6||c>=2&&c<=4&&m>=2&&m<=4?r[n][o]=!0:r[n][o]=!1}else{const c=(t.charCodeAt((n*s+o)%t.length)||0)+n*31+o*17;r[n][o]=c%3===0}}return{modules:r,size:s}}function yg({value:t,size:a=200,errorCorrectionLevel:s="M",fgColor:r="#000000",bgColor:n="#FFFFFF",includeMargin:o=!0,logoUrl:i,logoSize:c=.2,showActions:m=!1,className:d}){const x=l.useRef(null),[u,f]=l.useState(!1);l.useEffect(()=>{const b=x.current;if(!b||!t)return;const y=b.getContext("2d");if(!y)return;const v=wg(t),p=o?4:0,j=a/(v.size+p*2);y.fillStyle=n,y.fillRect(0,0,a,a),y.fillStyle=r;for(let C=0;C<v.size;C++)for(let N=0;N<v.size;N++)v.modules[C][N]&&y.fillRect((N+p)*j,(C+p)*j,j,j);if(i){const C=new Image;C.crossOrigin="anonymous",C.onload=()=>{const N=a*c,S=(a-N)/2,A=(a-N)/2;y.fillStyle=n,y.fillRect(S-4,A-4,N+8,N+8),y.drawImage(C,S,A,N,N)},C.src=i}},[t,a,s,r,n,o,i,c]);const w=()=>{const b=x.current;if(!b)return;const y=document.createElement("a");y.download=`qrcode-${Date.now()}.png`,y.href=b.toDataURL("image/png"),y.click()},k=async()=>{const b=x.current;if(b)try{const y=await new Promise(v=>{b.toBlob(p=>{p&&v(p)},"image/png")});await navigator.clipboard.write([new ClipboardItem({"image/png":y})]),f(!0),setTimeout(()=>f(!1),2e3)}catch(y){console.error("Failed to copy QR code:",y)}};return e.jsxs("div",{className:g("inline-flex flex-col items-center gap-2",d),children:[e.jsx("canvas",{ref:x,width:a,height:a,className:"rounded-lg",style:{width:a,height:a}}),m&&e.jsxs("div",{className:"flex gap-2",children:[e.jsxs($,{variant:"outline",size:"sm",onClick:w,children:[e.jsx(h.Download,{className:"h-4 w-4 mr-1"}),"Télécharger"]}),e.jsxs($,{variant:"outline",size:"sm",onClick:k,children:[u?e.jsx(h.Check,{className:"h-4 w-4 mr-1"}):e.jsx(h.Copy,{className:"h-4 w-4 mr-1"}),u?"Copié":"Copier"]})]})]})}function Ng(t=""){const[a,s]=l.useState(t);return{value:a,setValue:s,props:{value:a}}}function Cg({options:t,value:a,onChange:s,size:r="md",variant:n="default",fullWidth:o=!1,disabled:i=!1,name:c,className:m}){const[d,x]=l.useState({}),u=l.useRef(null),f=l.useRef(new Map),w={sm:"h-7 text-xs px-2",md:"h-9 text-sm px-3",lg:"h-11 text-base px-4"},k={sm:"p-0.5",md:"p-1",lg:"p-1"},b={sm:"h-3 w-3",md:"h-4 w-4",lg:"h-5 w-5"};l.useEffect(()=>{if(a===void 0)return;const p=f.current.get(a),j=u.current;if(p&&j){const C=j.getBoundingClientRect(),N=p.getBoundingClientRect();x({left:N.left-C.left,width:N.width,height:N.height})}},[a,t]);const y=p=>{i||s?.(p)},v=p=>j=>{j?f.current.set(p,j):f.current.delete(p)};return e.jsxs("div",{ref:u,role:"radiogroup",className:g("relative inline-flex items-center bg-muted rounded-lg",k[r],o&&"w-full",i&&"opacity-50",m),children:[a!==void 0&&n==="default"&&e.jsx("div",{className:"absolute bg-background rounded-md shadow-sm transition-all duration-200 ease-out",style:d}),t.map(p=>{const j=p.value===a,C=i||p.disabled;return e.jsxs("button",{ref:v(p.value),type:"button",role:"radio","aria-checked":j,disabled:C,onClick:()=>y(p.value),className:g("relative z-10 inline-flex items-center justify-center gap-1.5 font-medium transition-colors rounded-md",w[r],o&&"flex-1",n==="default"&&[j?"text-foreground":"text-muted-foreground hover:text-foreground"],n==="pills"&&[j?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-background/50"],C&&"cursor-not-allowed opacity-50"),children:[p.icon&&e.jsx("span",{className:b[r],children:p.icon}),p.label]},String(p.value))}),c&&e.jsx("input",{type:"hidden",name:c,value:String(a??"")})]})}function kg(t,a){const[s,r]=l.useState(a??t[0]?.value);return{value:s,onChange:r,selectNext:()=>{const d=(t.findIndex(u=>u.value===s)+1)%t.length,x=t[d];x.disabled||r(x.value)},selectPrevious:()=>{const m=t.findIndex(u=>u.value===s),d=m===0?t.length-1:m-1,x=t[d];x.disabled||r(x.value)},selectFirst:()=>{const m=t.find(d=>!d.disabled);m&&r(m.value)},selectLast:()=>{const m=[...t].reverse().find(d=>!d.disabled);m&&r(m.value)},options:t}}const Sg=Ye.cva("relative inline-flex items-center justify-center",{variants:{size:{sm:"w-12 h-12",md:"w-16 h-16",lg:"w-24 h-24",xl:"w-32 h-32"}},defaultVariants:{size:"md"}}),El=l.forwardRef(({className:t,size:a,showAsteroids:s=!0,speed:r=2,rocketColor:n="text-primary",asteroidColor:o="text-muted-foreground",...i},c)=>{const d={sm:{orbit:40,rocket:16,asteroid:6},md:{orbit:56,rocket:20,asteroid:8},lg:{orbit:88,rocket:28,asteroid:12},xl:{orbit:120,rocket:36,asteroid:16}}[a||"md"],x=d.orbit,u=d.orbit;return e.jsxs("div",{ref:c,className:g(Sg({size:a,className:t})),role:"status","aria-label":"Chargement en cours",...i,children:[e.jsxs("svg",{width:d.orbit*2,height:d.orbit*2,viewBox:`0 0 ${d.orbit*2} ${d.orbit*2}`,className:"overflow-visible",children:[e.jsx("circle",{cx:x,cy:u,r:d.orbit-d.rocket,fill:"none",stroke:"currentColor",strokeWidth:"1",strokeDasharray:"4 4",className:"opacity-20"}),s&&e.jsxs("g",{className:o,children:[e.jsx("g",{style:{animation:`waka-float ${r*1.5}s ease-in-out infinite`,transformOrigin:`${x+d.orbit*.6}px ${u-d.orbit*.5}px`},children:e.jsx("polygon",{points:Ja(x+d.orbit*.6,u-d.orbit*.5,d.asteroid),fill:"currentColor",opacity:"0.3"})}),e.jsx("g",{style:{animation:`waka-float ${r*2}s ease-in-out infinite 0.5s`,transformOrigin:`${x-d.orbit*.7}px ${u+d.orbit*.4}px`},children:e.jsx("polygon",{points:Ja(x-d.orbit*.7,u+d.orbit*.4,d.asteroid*.8),fill:"currentColor",opacity:"0.3"})}),e.jsx("g",{style:{animation:`waka-float ${r*1.8}s ease-in-out infinite 1s`,transformOrigin:`${x-d.orbit*.8}px ${u-d.orbit*.2}px`},children:e.jsx("polygon",{points:Ja(x-d.orbit*.8,u-d.orbit*.2,d.asteroid*.6),fill:"currentColor",opacity:"0.3"})})]}),e.jsx("g",{className:n,style:{animation:`waka-orbit ${r}s linear infinite`,transformOrigin:`${x}px ${u}px`},children:e.jsxs("g",{transform:`translate(${x}, ${u-d.orbit+d.rocket/2})`,children:[e.jsx("path",{d:`M 0,-${d.rocket/2} L ${d.rocket/4},-${d.rocket/6} L ${d.rocket/4},${d.rocket/3} L 0,${d.rocket/2} L -${d.rocket/4},${d.rocket/3} L -${d.rocket/4},-${d.rocket/6} Z`,fill:"currentColor"}),e.jsx("circle",{cx:"0",cy:-d.rocket/6,r:d.rocket/8,fill:"white",opacity:"0.8"}),e.jsxs("g",{opacity:"0.8",children:[e.jsx("path",{d:`M -${d.rocket/6},${d.rocket/2} L -${d.rocket/8},${d.rocket/1.5} L 0,${d.rocket/2} Z`,fill:"#FF6B35",style:{animation:`waka-flicker ${r/4}s ease-in-out infinite`}}),e.jsx("path",{d:`M 0,${d.rocket/2} L ${d.rocket/8},${d.rocket/1.5} L ${d.rocket/6},${d.rocket/2} Z`,fill:"#FF6B35",style:{animation:`waka-flicker ${r/4}s ease-in-out infinite 0.1s`}}),e.jsx("path",{d:`M -${d.rocket/12},${d.rocket/2} L 0,${d.rocket/1.3} L ${d.rocket/12},${d.rocket/2} Z`,fill:"#FFA500",style:{animation:`waka-flicker ${r/4}s ease-in-out infinite 0.05s`}})]})]})}),[...Array(3)].map((f,w)=>e.jsx("circle",{cx:x+(w-1)*d.orbit*.3,cy:u-d.orbit*1.2,r:"1",fill:"currentColor",className:"opacity-40",style:{animation:`waka-twinkle ${r*1.5}s ease-in-out infinite ${w*.3}s`}},w))]}),e.jsx("style",{dangerouslySetInnerHTML:{__html:`
|
|
13
29
|
@keyframes waka-orbit {
|
|
14
30
|
from { transform: rotate(0deg); }
|
|
15
31
|
to { transform: rotate(360deg); }
|
|
@@ -26,7 +42,7 @@ ${f.join(`
|
|
|
26
42
|
0%, 100% { opacity: 0.4; transform: scale(1); }
|
|
27
43
|
50% { opacity: 1; transform: scale(1.5); }
|
|
28
44
|
}
|
|
29
|
-
`}})]})});Yo.displayName="WakaSpinner";function Ya(t,a,r){const s=[];for(let o=0;o<6;o++){const d=o/6*Math.PI*2,u=r*(.7+Math.random()*.6),h=t+Math.cos(d)*u,m=a+Math.sin(d)*u;s.push([h,m])}return s.map(([o,d])=>`${o},${d}`).join(" ")}function Ko({s3Config:t,onSave:a,onDelete:r,onLoadTheme:s,existingThemes:n=[],className:o}){const{toast:d}=Gr(),[u,h]=i.useState(""),[m,v]=i.useState(""),[f,y]=i.useState(""),[k,S]=i.useState("#3b82f6"),[g,w]=i.useState(""),[b,l]=i.useState(""),[c,p]=i.useState(""),[x,N]=i.useState(!1),[R,F]=i.useState(!1),[D,T]=i.useState(!1),[P,L]=i.useState(!1),[A,V]=i.useState(!1),[X,me]=i.useState(null),[se,Y]=i.useState([]),[H,_]=i.useState("1.0.0"),q=i.useRef(null),$=i.useCallback(z=>{if(!z.trim())return{valid:!1,error:"Le CSS ne peut pas être vide"};const I=z.includes(":root")||z.includes(".dark"),J=z.includes("@theme inline");return!I&&!J?{valid:!1,error:"Le CSS doit contenir :root, .dark ou @theme inline"}:z.includes("--")?{valid:!0}:{valid:!1,error:"Le CSS doit contenir des variables CSS (--variable)"}},[]),te=i.useCallback(()=>{const z=$(b);if(!z.valid){d({title:"CSS invalide",description:z.error,variant:"destructive"});return}q.current&&q.current.parentNode&&q.current.parentNode.removeChild(q.current);const I=document.createElement("style");I.setAttribute("data-theme-preview",u),I.textContent=b,document.head.appendChild(I),q.current=I,document.documentElement.setAttribute("data-theme",u),F(!0),d({title:"Prévisualisation activée",description:`Le thème "${m}" est maintenant actif`})},[b,u,m,$,d]),Z=i.useCallback(()=>{q.current&&q.current.parentNode&&q.current.parentNode.removeChild(q.current),document.documentElement.removeAttribute("data-theme"),F(!1),d({title:"Prévisualisation arrêtée",description:"Thème par défaut restauré"})},[d]),G=i.useCallback(async()=>{const z=$(b);if(!z.valid){d({title:"CSS invalide",description:z.error,variant:"destructive"});return}if(!u||!m){d({title:"Informations manquantes",description:"Veuillez renseigner l'ID et le nom du thème",variant:"destructive"});return}N(!0);try{const{baseUrl:I,method:J="PUT",headers:ce={},prefix:oe="",extension:de="css"}=t,Se=encodeURIComponent(u.replace(/\s+/g,"-").toLowerCase()),ye=`${I.replace(/\/$/,"")}/${oe}${Se}.${de}`;console.log(`[ThemeCreator] Uploading theme to: ${ye}`);const Oe=await fetch(ye,{method:J,headers:{"Content-Type":"text/css",...ce},body:b});if(!Oe.ok)throw new Error(`Upload failed: ${Oe.status} ${Oe.statusText}`);const ht={version:H,createdAt:new Date,createdBy:g||"Anonymous",changelog:c||"No changelog provided",css:b},Ue=[...se,ht];Y(Ue);const Be={id:u,label:m,description:f,previewColor:k,author:g,versions:Ue,currentVersion:H},wt=`${I.replace(/\/$/,"")}/${oe}${u}.json`;await fetch(wt,{method:J,headers:{"Content-Type":"application/json",...ce},body:JSON.stringify(Be,null,2)}),d({title:"Thème publié !",description:`Le thème "${m}" v${H} a été uploadé sur S3`}),a?.(Be),p("")}catch(I){console.error("[ThemeCreator] Upload error:",I),d({title:"Erreur d'upload",description:I instanceof Error?I.message:"Une erreur est survenue",variant:"destructive"})}finally{N(!1)}},[b,u,m,f,k,g,H,c,se,t,$,d,a]),Re=i.useCallback(async()=>{try{await navigator.clipboard.writeText(b),T(!0),setTimeout(()=>T(!1),2e3),d({title:"CSS copié !",description:"Le code CSS a été copié dans le presse-papiers"})}catch{d({title:"Erreur de copie",description:"Impossible de copier le CSS",variant:"destructive"})}},[b,d]),ve=i.useCallback(async z=>{V(!0);try{let I=z;if(s&&(!z.versions||z.versions.length===0||!z.versions[0].css)){const ce=await s(z.id);if(ce)I=ce,d({title:"Thème chargé",description:`Thème "${I.label}" chargé depuis S3`});else{d({title:"Erreur",description:`Impossible de charger le thème "${z.label}"`,variant:"destructive"});return}}h(I.id),v(I.label),y(I.description||""),S(I.previewColor||"#3b82f6"),w(I.author||""),Y(I.versions),_(I.currentVersion);const J=I.versions[I.versions.length-1];J&&l(J.css),me(I)}catch(I){console.error("[WakaThemeCreator] Error loading theme:",I),d({title:"Erreur",description:"Erreur lors du chargement du thème",variant:"destructive"})}finally{V(!1)}},[s,d]),Ne=i.useCallback(()=>{h(""),v(""),y(""),S("#3b82f6"),w(""),l(""),p(""),Y([]),_("1.0.0"),me(null),R&&Z()},[R,Z]),le=i.useCallback(()=>{const z=new Blob([b],{type:"text/css"}),I=URL.createObjectURL(z),J=document.createElement("a");J.href=I,J.download=`${u||"theme"}.css`,document.body.appendChild(J),J.click(),document.body.removeChild(J),URL.revokeObjectURL(I),d({title:"CSS téléchargé",description:`Fichier ${u||"theme"}.css téléchargé`})},[b,u,d]);return e.jsxs("div",{className:j("w-full max-w-6xl mx-auto space-y-6",o),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold",children:"Créateur de Thèmes"}),e.jsx("p",{className:"text-muted-foreground",children:"Créez et publiez des thèmes TweakCN sur S3"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(O,{variant:"outline",onClick:Ne,children:[e.jsx(E.Plus,{className:"mr-2 h-4 w-4"}),"Nouveau thème"]}),R&&e.jsx(O,{variant:"destructive",onClick:Z,children:"Arrêter la prévisualisation"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsxs(Ve,{className:"lg:col-span-1",children:[e.jsxs(Ke,{children:[e.jsx(We,{children:"Thèmes existants"}),e.jsx(Dt,{children:"Chargez un thème pour le modifier"})]}),e.jsx(Ze,{className:"space-y-2",children:n.length===0?e.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"Aucun thème existant"}):n.map(z=>e.jsxs("button",{onClick:()=>ve(z),disabled:A,className:j("w-full flex items-center gap-3 p-3 rounded-lg border-2 transition-all text-left",X?.id===z.id?"border-primary bg-primary/10":"border-border hover:border-primary/50",A&&"opacity-50 cursor-not-allowed"),children:[e.jsx("div",{className:"w-8 h-8 rounded-full flex-shrink-0",style:{backgroundColor:z.previewColor||"#3b82f6"}}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"font-medium truncate flex items-center gap-2",children:[z.label,A&&X?.id===z.id&&e.jsx(E.Loader2,{className:"h-4 w-4 animate-spin"})]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["v",z.currentVersion||"1.0.0"," • ",z.versions?.length||0," versions"]})]})]},z.id))})]}),e.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[e.jsxs(Ve,{children:[e.jsx(Ke,{children:e.jsxs(We,{className:"flex items-center gap-2",children:[e.jsx(E.Palette,{className:"h-5 w-5"}),"Informations du thème"]})}),e.jsxs(Ze,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ge,{htmlFor:"theme-id",children:"ID du thème *"}),e.jsx(fe,{id:"theme-id",placeholder:"ex: forest",value:u,onChange:z=>h(z.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ge,{htmlFor:"theme-label",children:"Nom d'affichage *"}),e.jsx(fe,{id:"theme-label",placeholder:"ex: Forêt",value:m,onChange:z=>v(z.target.value)})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ge,{htmlFor:"theme-description",children:"Description"}),e.jsx(fe,{id:"theme-description",placeholder:"Thème inspiré de la nature",value:f,onChange:z=>y(z.target.value)})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ge,{htmlFor:"theme-color",children:"Couleur de prévisualisation"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(fe,{id:"theme-color",type:"color",value:k,onChange:z=>S(z.target.value),className:"w-16 h-10 p-1"}),e.jsx(fe,{value:k,onChange:z=>S(z.target.value),placeholder:"#3b82f6"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ge,{htmlFor:"theme-author",children:"Auteur"}),e.jsx(fe,{id:"theme-author",placeholder:"Votre nom",value:g,onChange:z=>w(z.target.value)})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ge,{htmlFor:"theme-version",children:"Version"}),e.jsx(fe,{id:"theme-version",placeholder:"1.0.0",value:H,onChange:z=>_(z.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ge,{htmlFor:"theme-changelog",children:"Changelog"}),e.jsx(fe,{id:"theme-changelog",placeholder:"Modifications apportées",value:c,onChange:z=>p(z.target.value)})]})]})]})]}),e.jsxs(Ve,{children:[e.jsxs(Ke,{children:[e.jsxs(We,{className:"flex items-center gap-2",children:[e.jsx(E.FileCode,{className:"h-5 w-5"}),"Code CSS TweakCN"]}),e.jsx(Dt,{children:"Collez le CSS généré par TweakCN ici"})]}),e.jsxs(Ze,{className:"space-y-4",children:[e.jsx(pa,{placeholder:`:root {
|
|
45
|
+
`}})]})});El.displayName="WakaSpinner";function Ja(t,a,s){const r=[];for(let o=0;o<6;o++){const i=o/6*Math.PI*2,c=s*(.7+Math.random()*.6),m=t+Math.cos(i)*c,d=a+Math.sin(i)*c;r.push([m,d])}return r.map(([o,i])=>`${o},${i}`).join(" ")}const Dg={default:{icon:"text-muted-foreground",bg:"bg-muted",gradient:"from-gray-500 to-gray-600"},primary:{icon:"text-primary",bg:"bg-primary/10",gradient:"from-primary to-primary/80"},success:{icon:"text-green-600",bg:"bg-green-100",gradient:"from-green-500 to-green-600"},warning:{icon:"text-yellow-600",bg:"bg-yellow-100",gradient:"from-yellow-500 to-yellow-600"},destructive:{icon:"text-destructive",bg:"bg-destructive/10",gradient:"from-destructive to-destructive/80"},blue:{icon:"text-blue-600",bg:"bg-blue-100",gradient:"from-blue-500 to-blue-600"},purple:{icon:"text-purple-600",bg:"bg-purple-100",gradient:"from-purple-500 to-purple-600"}};function so({direction:t,value:a,text:s,invert:r,size:n}){const o=r?t==="down":t==="up",i=r?t==="up":t==="down",c={sm:"h-3 w-3",md:"h-4 w-4",lg:"h-5 w-5"},m={sm:"text-[10px]",md:"text-xs",lg:"text-sm"},d=t==="up"?h.TrendingUp:t==="down"?h.TrendingDown:h.Minus;return e.jsxs("div",{className:g("flex items-center gap-1",m[n],o&&"text-green-600",i&&"text-destructive",t==="neutral"&&"text-muted-foreground"),children:[e.jsx(d,{className:c[n]}),a&&e.jsx("span",{className:"font-medium",children:a}),s&&e.jsx("span",{className:"text-muted-foreground",children:s})]})}function Tg({size:t}){const a={sm:"h-5 w-16",md:"h-7 w-20",lg:"h-9 w-24"};return e.jsxs("div",{className:"animate-pulse",children:[e.jsx("div",{className:"h-3 w-16 bg-muted rounded mb-2"}),e.jsx("div",{className:g("bg-muted rounded",a[t])})]})}function Ml({label:t,value:a,description:s,icon:r,trend:n,trendValue:o,trendText:i,invertTrend:c=!1,variant:m="default",size:d="md",color:x="default",loading:u=!1,className:f}){const w=Dg[x],b={sm:{container:"p-3",label:"text-xs",value:"text-xl",description:"text-[10px]",icon:"h-8 w-8",iconInner:"h-4 w-4"},md:{container:"p-4",label:"text-sm",value:"text-2xl",description:"text-xs",icon:"h-10 w-10",iconInner:"h-5 w-5"},lg:{container:"p-6",label:"text-base",value:"text-4xl",description:"text-sm",icon:"h-12 w-12",iconInner:"h-6 w-6"}}[d];return u?e.jsx("div",{className:g(m==="card"&&"rounded-lg border bg-card shadow-sm",m==="gradient"&&"rounded-lg text-white",b.container,f),children:e.jsx(Tg,{size:d})}):m==="minimal"?e.jsxs("div",{className:g("flex flex-col",f),children:[e.jsx("span",{className:g("text-muted-foreground",b.label),children:t}),e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsx("span",{className:g("font-bold tracking-tight",b.value),children:a}),n&&e.jsx(so,{direction:n,value:o,text:i,invert:c,size:d})]}),s&&e.jsx("span",{className:g("text-muted-foreground mt-1",b.description),children:s})]}):m==="gradient"?e.jsx("div",{className:g("rounded-lg bg-gradient-to-br text-white",w.gradient,b.container,f),children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:g("text-white/80",b.label),children:t}),e.jsx("p",{className:g("font-bold mt-1",b.value),children:a}),s&&e.jsx("p",{className:g("text-white/70 mt-1",b.description),children:s}),n&&e.jsxs("div",{className:"mt-2 flex items-center gap-1 text-white/90",children:[n==="up"&&e.jsx(h.ArrowUp,{className:b.iconInner}),n==="down"&&e.jsx(h.ArrowDown,{className:b.iconInner}),o&&e.jsx("span",{className:b.description,children:o}),i&&e.jsx("span",{className:g("text-white/70",b.description),children:i})]})]}),r&&e.jsx("div",{className:"rounded-lg bg-white/20 p-2",children:e.jsx("div",{className:b.iconInner,children:r})})]})}):e.jsx("div",{className:g(m==="card"&&"rounded-lg border bg-card shadow-sm",b.container,f),children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:g("text-muted-foreground font-medium",b.label),children:t}),e.jsxs("div",{className:"flex items-baseline gap-2 mt-1",children:[e.jsx("span",{className:g("font-bold tracking-tight",b.value),children:a}),n&&e.jsx(so,{direction:n,value:o,text:i,invert:c,size:d})]}),s&&e.jsx("p",{className:g("text-muted-foreground mt-1",b.description),children:s})]}),r&&e.jsx("div",{className:g("rounded-lg flex items-center justify-center flex-shrink-0",b.icon,w.bg),children:e.jsx("div",{className:g(b.iconInner,w.icon),children:r})})]})})}function Pl({children:t,layout:a="row",columns:s=4,gap:r="md",className:n}){const o={sm:"gap-2",md:"gap-4",lg:"gap-6"},i={2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4"};return e.jsx("div",{className:g(o[r],a==="row"&&"flex flex-wrap",a==="grid"&&g("grid",i[s]),n),children:t})}function Eg(t={}){const{initialValue:a=0,format:s,previousValue:r}=t,[n,o]=l.useState(a),i=s?s(n):n.toString(),c=l.useMemo(()=>r===void 0?"neutral":n>r?"up":n<r?"down":"neutral",[n,r]),m=l.useMemo(()=>{if(r===void 0||r===0)return;const d=(n-r)/r*100;return`${d>=0?"+":""}${d.toFixed(1)}%`},[n,r]);return{value:i,rawValue:n,setValue:o,trend:c,trendValue:m}}const on=l.createContext(null);function ln(){const t=l.useContext(on);if(!t)throw new Error("useStepperContext must be used within a WakaStepper");return t}function ao({step:t,index:a,status:s}){const{variant:r,size:n}=ln(),o={sm:"h-6 w-6 text-xs",md:"h-8 w-8 text-sm",lg:"h-10 w-10 text-base"},i={sm:"h-3 w-3",md:"h-4 w-4",lg:"h-5 w-5"},c=g("rounded-full flex items-center justify-center font-medium transition-all duration-200",o[n]),m={pending:"bg-muted text-muted-foreground border-2 border-muted",current:"bg-primary text-primary-foreground border-2 border-primary shadow-md",completed:"bg-primary text-primary-foreground border-2 border-primary",error:"bg-destructive text-destructive-foreground border-2 border-destructive"},d=()=>t.icon&&s==="current"?t.icon:s==="completed"?e.jsx(h.Check,{className:i[n]}):s==="error"?e.jsx(h.AlertCircle,{className:i[n]}):r==="simple"?e.jsx(h.Circle,{className:g(i[n],s==="current"?"fill-current":"")}):e.jsx("span",{children:a+1});return e.jsx("div",{className:g(c,m[s]),children:d()})}function ro({isCompleted:t,orientation:a}){const s=g("transition-colors duration-300",a==="horizontal"?"flex-1 h-0.5 mx-2":"w-0.5 min-h-[24px] mx-auto my-1");return e.jsx("div",{className:g(s,t?"bg-primary":"bg-muted")})}function Mg({step:t,index:a,isLast:s}){const{currentStep:r,orientation:n,size:o,clickable:i,allowPrevious:c,goToStep:m,getStepStatus:d}=ln(),x=d(a),u=i&&!t.disabled&&(c?a<r:!0),f={sm:"text-xs",md:"text-sm",lg:"text-base"},w={sm:"text-[10px]",md:"text-xs",lg:"text-sm"},k=()=>{u&&m(a)};return n==="vertical"?e.jsxs("div",{className:"flex",children:[e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("button",{type:"button",onClick:k,disabled:!u,className:g("flex items-center gap-3 text-left",u&&"cursor-pointer hover:opacity-80",!u&&"cursor-default"),children:e.jsx(ao,{step:t,index:a,status:x})}),!s&&e.jsx(ro,{isCompleted:x==="completed",orientation:"vertical"})]}),e.jsx("div",{className:"ml-3 pb-6",children:e.jsxs("button",{type:"button",onClick:k,disabled:!u,className:g("text-left",u&&"cursor-pointer hover:opacity-80",!u&&"cursor-default"),children:[e.jsxs("p",{className:g("font-medium",f[o],x==="current"?"text-foreground":"text-muted-foreground",t.disabled&&"opacity-50"),children:[t.title,t.optional&&e.jsx("span",{className:"ml-1 text-muted-foreground font-normal",children:"(Optionnel)"})]}),t.description&&e.jsx("p",{className:g("text-muted-foreground mt-0.5",w[o]),children:t.description})]})})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex flex-col items-center",children:e.jsxs("button",{type:"button",onClick:k,disabled:!u,className:g("flex flex-col items-center gap-2",u&&"cursor-pointer hover:opacity-80",!u&&"cursor-default"),children:[e.jsx(ao,{step:t,index:a,status:x}),e.jsxs("div",{className:"text-center min-w-[80px] max-w-[120px]",children:[e.jsx("p",{className:g("font-medium",f[o],x==="current"?"text-foreground":"text-muted-foreground",t.disabled&&"opacity-50"),children:t.title}),t.description&&e.jsx("p",{className:g("text-muted-foreground mt-0.5 hidden sm:block",w[o]),children:t.description})]})]})}),!s&&e.jsx(ro,{isCompleted:x==="completed",orientation:"horizontal"})]})}function Pg({steps:t,currentStep:a,onStepChange:s,orientation:r="horizontal",variant:n="default",size:o="md",clickable:i=!1,allowPrevious:c=!0,showContent:m=!1,className:d}){const x=l.useCallback(b=>b<a?"completed":b===a?"current":"pending",[a]),u=l.useCallback(b=>{b>=0&&b<t.length&&!t[b].disabled&&s?.(b)},[t,s]),f=l.useCallback(()=>{a<t.length-1&&u(a+1)},[a,t.length,u]),w=l.useCallback(()=>{a>0&&u(a-1)},[a,u]),k={currentStep:a,orientation:r,variant:n,size:o,clickable:i,allowPrevious:c,goToStep:u,nextStep:f,prevStep:w,getStepStatus:x};return e.jsx(on.Provider,{value:k,children:e.jsxs("div",{className:g("w-full",d),children:[e.jsx("nav",{"aria-label":"Progress",className:g(r==="horizontal"?"flex items-start justify-between":"flex flex-col"),children:t.map((b,y)=>e.jsx(Mg,{step:b,index:y,isLast:y===t.length-1},b.id))}),m&&t[a]?.content&&e.jsx("div",{className:"mt-6 p-4 rounded-lg border bg-card",children:t[a].content})]})})}function Ag({prevLabel:t="Précédent",nextLabel:a="Suivant",finishLabel:s="Terminer",onFinish:r,showCancel:n=!1,cancelLabel:o="Annuler",onCancel:i,disableNext:c=!1,className:m}){const d=l.useContext(on);if(!d)throw new Error("StepperNavigation must be used within a WakaStepper");const{currentStep:x,prevStep:u,nextStep:f}=d;return e.jsxs("div",{className:g("flex items-center justify-between mt-6",m),children:[e.jsx("div",{className:"flex gap-2",children:n&&e.jsx("button",{type:"button",onClick:i,className:"px-4 py-2 text-sm font-medium text-muted-foreground hover:text-foreground transition-colors",children:o})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{type:"button",onClick:u,disabled:x===0,className:g("px-4 py-2 text-sm font-medium rounded-md border transition-colors",x===0?"opacity-50 cursor-not-allowed":"hover:bg-muted"),children:t}),e.jsx("button",{type:"button",onClick:r||f,disabled:c,className:g("px-4 py-2 text-sm font-medium rounded-md bg-primary text-primary-foreground transition-colors",c?"opacity-50 cursor-not-allowed":"hover:bg-primary/90"),children:r?s:a})]})]})}function Al({s3Config:t,onSave:a,onDelete:s,onLoadTheme:r,existingThemes:n=[],className:o}){const{toast:i}=Aa(),[c,m]=l.useState(""),[d,x]=l.useState(""),[u,f]=l.useState(""),[w,k]=l.useState("#3b82f6"),[b,y]=l.useState(""),[v,p]=l.useState(""),[j,C]=l.useState(""),[N,S]=l.useState(!1),[A,R]=l.useState(!1),[E,D]=l.useState(!1),[M,P]=l.useState(!1),[T,q]=l.useState(!1),[H,Y]=l.useState(null),[U,z]=l.useState([]),[V,L]=l.useState("1.0.0"),W=l.useRef(null),F=l.useCallback(Z=>{if(!Z.trim())return{valid:!1,error:"Le CSS ne peut pas être vide"};const J=Z.includes(":root")||Z.includes(".dark"),ne=Z.includes("@theme inline");return!J&&!ne?{valid:!1,error:"Le CSS doit contenir :root, .dark ou @theme inline"}:Z.includes("--")?{valid:!0}:{valid:!1,error:"Le CSS doit contenir des variables CSS (--variable)"}},[]),G=l.useCallback(()=>{const Z=F(v);if(!Z.valid){i({title:"CSS invalide",description:Z.error,variant:"destructive"});return}W.current&&W.current.parentNode&&W.current.parentNode.removeChild(W.current);const J=document.createElement("style");J.setAttribute("data-theme-preview",c),J.textContent=v,document.head.appendChild(J),W.current=J,document.documentElement.setAttribute("data-theme",c),R(!0),i({title:"Prévisualisation activée",description:`Le thème "${d}" est maintenant actif`})},[v,c,d,F,i]),ee=l.useCallback(()=>{W.current&&W.current.parentNode&&W.current.parentNode.removeChild(W.current),document.documentElement.removeAttribute("data-theme"),R(!1),i({title:"Prévisualisation arrêtée",description:"Thème par défaut restauré"})},[i]),se=l.useCallback(async()=>{const Z=F(v);if(!Z.valid){i({title:"CSS invalide",description:Z.error,variant:"destructive"});return}if(!c||!d){i({title:"Informations manquantes",description:"Veuillez renseigner l'ID et le nom du thème",variant:"destructive"});return}S(!0);try{const{baseUrl:J,method:ne="PUT",headers:me={},prefix:ae="",extension:de="css"}=t,Te=encodeURIComponent(c.replace(/\s+/g,"-").toLowerCase()),Ce=`${J.replace(/\/$/,"")}/${ae}${Te}.${de}`;console.log(`[ThemeCreator] Uploading theme to: ${Ce}`);const Je=await fetch(Ce,{method:ne,headers:{"Content-Type":"text/css",...me},body:v});if(!Je.ok)throw new Error(`Upload failed: ${Je.status} ${Je.statusText}`);const xt={version:V,createdAt:new Date,createdBy:b||"Anonymous",changelog:j||"No changelog provided",css:v},Ke=[...U,xt];z(Ke);const tt={id:c,label:d,description:u,previewColor:w,author:b,versions:Ke,currentVersion:V},gt=`${J.replace(/\/$/,"")}/${ae}${c}.json`;await fetch(gt,{method:ne,headers:{"Content-Type":"application/json",...me},body:JSON.stringify(tt,null,2)}),i({title:"Thème publié !",description:`Le thème "${d}" v${V} a été uploadé sur S3`}),a?.(tt),C("")}catch(J){console.error("[ThemeCreator] Upload error:",J),i({title:"Erreur d'upload",description:J instanceof Error?J.message:"Une erreur est survenue",variant:"destructive"})}finally{S(!1)}},[v,c,d,u,w,b,V,j,U,t,F,i,a]),le=l.useCallback(async()=>{try{await navigator.clipboard.writeText(v),D(!0),setTimeout(()=>D(!1),2e3),i({title:"CSS copié !",description:"Le code CSS a été copié dans le presse-papiers"})}catch{i({title:"Erreur de copie",description:"Impossible de copier le CSS",variant:"destructive"})}},[v,i]),X=l.useCallback(async Z=>{q(!0);try{let J=Z;if(r&&(!Z.versions||Z.versions.length===0||!Z.versions[0].css)){const me=await r(Z.id);if(me)J=me,i({title:"Thème chargé",description:`Thème "${J.label}" chargé depuis S3`});else{i({title:"Erreur",description:`Impossible de charger le thème "${Z.label}"`,variant:"destructive"});return}}m(J.id),x(J.label),f(J.description||""),k(J.previewColor||"#3b82f6"),y(J.author||""),z(J.versions),L(J.currentVersion);const ne=J.versions[J.versions.length-1];ne&&p(ne.css),Y(J)}catch(J){console.error("[WakaThemeCreator] Error loading theme:",J),i({title:"Erreur",description:"Erreur lors du chargement du thème",variant:"destructive"})}finally{q(!1)}},[r,i]),K=l.useCallback(()=>{m(""),x(""),f(""),k("#3b82f6"),y(""),p(""),C(""),z([]),L("1.0.0"),Y(null),A&&ee()},[A,ee]),I=l.useCallback(()=>{const Z=new Blob([v],{type:"text/css"}),J=URL.createObjectURL(Z),ne=document.createElement("a");ne.href=J,ne.download=`${c||"theme"}.css`,document.body.appendChild(ne),ne.click(),document.body.removeChild(ne),URL.revokeObjectURL(J),i({title:"CSS téléchargé",description:`Fichier ${c||"theme"}.css téléchargé`})},[v,c,i]);return e.jsxs("div",{className:g("w-full max-w-6xl mx-auto space-y-6",o),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold",children:"Créateur de Thèmes"}),e.jsx("p",{className:"text-muted-foreground",children:"Créez et publiez des thèmes TweakCN sur S3"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs($,{variant:"outline",onClick:K,children:[e.jsx(h.Plus,{className:"mr-2 h-4 w-4"}),"Nouveau thème"]}),A&&e.jsx($,{variant:"destructive",onClick:ee,children:"Arrêter la prévisualisation"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsxs(Se,{className:"lg:col-span-1",children:[e.jsxs(He,{children:[e.jsx(Ve,{children:"Thèmes existants"}),e.jsx(nt,{children:"Chargez un thème pour le modifier"})]}),e.jsx(Ee,{className:"space-y-2",children:n.length===0?e.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"Aucun thème existant"}):n.map(Z=>e.jsxs("button",{onClick:()=>X(Z),disabled:T,className:g("w-full flex items-center gap-3 p-3 rounded-lg border-2 transition-all text-left",H?.id===Z.id?"border-primary bg-primary/10":"border-border hover:border-primary/50",T&&"opacity-50 cursor-not-allowed"),children:[e.jsx("div",{className:"w-8 h-8 rounded-full flex-shrink-0",style:{backgroundColor:Z.previewColor||"#3b82f6"}}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"font-medium truncate flex items-center gap-2",children:[Z.label,T&&H?.id===Z.id&&e.jsx(h.Loader2,{className:"h-4 w-4 animate-spin"})]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["v",Z.currentVersion||"1.0.0"," • ",Z.versions?.length||0," versions"]})]})]},Z.id))})]}),e.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[e.jsxs(Se,{children:[e.jsx(He,{children:e.jsxs(Ve,{className:"flex items-center gap-2",children:[e.jsx(h.Palette,{className:"h-5 w-5"}),"Informations du thème"]})}),e.jsxs(Ee,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(he,{htmlFor:"theme-id",children:"ID du thème *"}),e.jsx(oe,{id:"theme-id",placeholder:"ex: forest",value:c,onChange:Z=>m(Z.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(he,{htmlFor:"theme-label",children:"Nom d'affichage *"}),e.jsx(oe,{id:"theme-label",placeholder:"ex: Forêt",value:d,onChange:Z=>x(Z.target.value)})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(he,{htmlFor:"theme-description",children:"Description"}),e.jsx(oe,{id:"theme-description",placeholder:"Thème inspiré de la nature",value:u,onChange:Z=>f(Z.target.value)})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(he,{htmlFor:"theme-color",children:"Couleur de prévisualisation"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(oe,{id:"theme-color",type:"color",value:w,onChange:Z=>k(Z.target.value),className:"w-16 h-10 p-1"}),e.jsx(oe,{value:w,onChange:Z=>k(Z.target.value),placeholder:"#3b82f6"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(he,{htmlFor:"theme-author",children:"Auteur"}),e.jsx(oe,{id:"theme-author",placeholder:"Votre nom",value:b,onChange:Z=>y(Z.target.value)})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(he,{htmlFor:"theme-version",children:"Version"}),e.jsx(oe,{id:"theme-version",placeholder:"1.0.0",value:V,onChange:Z=>L(Z.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(he,{htmlFor:"theme-changelog",children:"Changelog"}),e.jsx(oe,{id:"theme-changelog",placeholder:"Modifications apportées",value:j,onChange:Z=>C(Z.target.value)})]})]})]})]}),e.jsxs(Se,{children:[e.jsxs(He,{children:[e.jsxs(Ve,{className:"flex items-center gap-2",children:[e.jsx(h.FileCode,{className:"h-5 w-5"}),"Code CSS TweakCN"]}),e.jsx(nt,{children:"Collez le CSS généré par TweakCN ici"})]}),e.jsxs(Ee,{className:"space-y-4",children:[e.jsx(wt,{placeholder:`:root {
|
|
30
46
|
--background: oklch(0.9911 0 0);
|
|
31
47
|
--foreground: oklch(0.2046 0 0);
|
|
32
48
|
--primary: oklch(0.8348 0.1302 160.9080);
|
|
@@ -57,16 +73,12 @@ ${f.join(`
|
|
|
57
73
|
--color-primary: var(--primary);
|
|
58
74
|
--color-primary-foreground: var(--primary-foreground);
|
|
59
75
|
/* ... autres couleurs ... */
|
|
60
|
-
}`,value:b,onChange:z=>l(z.target.value),className:"font-mono text-sm min-h-[300px]"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(O,{onClick:te,disabled:R,children:[e.jsx(E.Eye,{className:"mr-2 h-4 w-4"}),"Prévisualiser"]}),e.jsx(O,{variant:"outline",onClick:Re,children:D?e.jsxs(e.Fragment,{children:[e.jsx(E.Check,{className:"mr-2 h-4 w-4"}),"Copié !"]}):e.jsxs(e.Fragment,{children:[e.jsx(E.Copy,{className:"mr-2 h-4 w-4"}),"Copier CSS"]})}),e.jsxs(O,{variant:"outline",onClick:le,children:[e.jsx(E.Download,{className:"mr-2 h-4 w-4"}),"Télécharger"]}),e.jsx("div",{className:"ml-auto",children:e.jsx(O,{onClick:G,disabled:x,children:x?e.jsxs(e.Fragment,{children:[e.jsx(E.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),"Publication..."]}):e.jsxs(e.Fragment,{children:[e.jsx(E.Upload,{className:"mr-2 h-4 w-4"}),"Publier sur S3"]})})})]})]})]}),se.length>0&&e.jsxs(Ve,{children:[e.jsx(Ke,{children:e.jsxs(We,{className:"flex items-center gap-2",children:[e.jsx(E.History,{className:"h-5 w-5"}),"Historique des versions"]})}),e.jsx(Ze,{children:e.jsx("div",{className:"space-y-3",children:se.slice().reverse().map((z,I)=>e.jsxs("div",{className:"flex items-start gap-3 p-3 border rounded-lg",children:[e.jsxs(He,{variant:"outline",children:["v",z.version]}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-sm font-medium",children:z.changelog||"Aucune description"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Par ",z.createdBy," • ",z.createdAt.toLocaleDateString()]})]}),e.jsx(O,{variant:"ghost",size:"sm",onClick:()=>l(z.css),children:"Charger"})]},I))})})]})]})]}),e.jsx(Us,{open:P,onOpenChange:L,children:e.jsxs(dr,{children:[e.jsxs(ur,{children:[e.jsx(fr,{children:"Supprimer le thème ?"}),e.jsx(hr,{children:"Cette action est irréversible. Le thème sera supprimé de S3."})]}),e.jsxs(mr,{children:[e.jsx(gr,{children:"Annuler"}),e.jsx(pr,{onClick:()=>{X&&(r?.(X.id),Ne()),L(!1)},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Supprimer"})]})]})})]})}Ko.displayName="WakaThemeCreator";function Oh(){try{return ga()}catch{return null}}const Zo=De.cva("w-full",{variants:{size:{sm:"max-w-2xl",base:"max-w-4xl",lg:"max-w-6xl",full:"max-w-full"}},defaultVariants:{size:"base"}}),Qo=i.forwardRef(({className:t,size:a,onThemeChange:r,onThemeLoad:s,onThemeSave:n,initialTheme:o,showPreview:d=!0,showExport:u=!0,showImport:h=!0,allowCustomColors:m=!0,...v},f)=>{const y=Oh(),k=y?.theme,S=y?.themes||[],g=y?.setTheme,[w,b]=C.useState(o||{name:"Custom Theme",description:"Thème personnalisé",colors:{background:"#ffffff",foreground:"#0a0a0a",card:"#ffffff",cardForeground:"#0a0a0a",popover:"#ffffff",popoverForeground:"#0a0a0a",primary:"#0a0a0a",primaryForeground:"#fafafa",secondary:"#f4f4f5",secondaryForeground:"#0a0a0a",muted:"#f4f4f5",mutedForeground:"#737373",accent:"#f4f4f5",accentForeground:"#0a0a0a",destructive:"#ef4444",destructiveForeground:"#fafafa",border:"#e4e4e7",input:"#e4e4e7",ring:"#0a0a0a"}}),[l,c]=C.useState(!1),[p,x]=C.useState(null),[N,R]=C.useState(null),[F,D]=C.useState(""),[T,P]=C.useState(!1),[L,A]=C.useState("auto"),V=C.useCallback(_=>{const q=document.documentElement;if(Object.entries(_.colors).forEach(([$,te])=>{const Z=`--${$.replace(/([A-Z])/g,"-$1").toLowerCase()}`;q.style.setProperty(Z,te)}),g){const $={id:_.name.toLowerCase().replace(/\s+/g,"-"),label:_.name,description:_.description||"",previewColor:_.colors.primary};g($.id)}},[g]),X=async _=>{c(!0),x(null),R(null);try{const q=await fetch(_);if(!q.ok)throw new Error(`Erreur HTTP: ${q.status}`);const $=await q.json();if(!$.name||!$.colors)throw new Error("Format de thème invalide");const te={name:$.name,description:$.description||"",author:$.author||"",version:$.version||"1.0.0",colors:{background:$.colors.background||"#ffffff",foreground:$.colors.foreground||"#0a0a0a",card:$.colors.card||"#ffffff",cardForeground:$.colors.cardForeground||"#0a0a0a",popover:$.colors.popover||"#ffffff",popoverForeground:$.colors.popoverForeground||"#0a0a0a",primary:$.colors.primary||"#0a0a0a",primaryForeground:$.colors.primaryForeground||"#fafafa",secondary:$.colors.secondary||"#f4f4f5",secondaryForeground:$.colors.secondaryForeground||"#0a0a0a",muted:$.colors.muted||"#f4f4f5",mutedForeground:$.colors.mutedForeground||"#737373",accent:$.colors.accent||"#f4f4f5",accentForeground:$.colors.accentForeground||"#0a0a0a",destructive:$.colors.destructive||"#ef4444",destructiveForeground:$.colors.destructiveForeground||"#fafafa",border:$.colors.border||"#e4e4e7",input:$.colors.input||"#e4e4e7",ring:$.colors.ring||"#0a0a0a",chart1:$.colors.chart1,chart2:$.colors.chart2,chart3:$.colors.chart3,chart4:$.colors.chart4,chart5:$.colors.chart5}};b(te),V(te),s?.(te),R("Thème chargé avec succès !")}catch(q){x(q instanceof Error?q.message:"Erreur lors du chargement du thème")}finally{c(!1)}},me=()=>{const _=JSON.stringify(w,null,2),q=new Blob([_],{type:"application/json"}),$=URL.createObjectURL(q),te=document.createElement("a");te.href=$,te.download=`${w.name.toLowerCase().replace(/\s+/g,"-")}-theme.json`,document.body.appendChild(te),te.click(),document.body.removeChild(te),URL.revokeObjectURL($)},se=async()=>{try{await navigator.clipboard.writeText(JSON.stringify(w,null,2)),P(!0),setTimeout(()=>P(!1),2e3)}catch{x("Impossible de copier le thème")}},Y=(_,q)=>{const $={...w,colors:{...w.colors,[_]:q}};b($),V($),r?.($)},H=()=>{n?.(w),R("Thème sauvegardé !")};return C.useEffect(()=>{V(w)},[w,V]),C.useEffect(()=>{const _=document.documentElement;L==="dark"?_.classList.add("dark"):L==="light"?_.classList.remove("dark"):window.matchMedia("(prefers-color-scheme: dark)").matches?_.classList.add("dark"):_.classList.remove("dark")},[L]),e.jsx("div",{ref:f,className:j(Zo({size:a}),t),...v,children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold",children:"Gestionnaire de Thèmes TweakCN"}),e.jsx("p",{className:"text-muted-foreground",children:"Créez, importez et prévisualisez vos thèmes personnalisés"})]}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs(He,{variant:"outline",className:"flex items-center gap-1",children:[e.jsx(E.Palette,{className:"h-3 w-3"}),w.name]})})]}),p&&e.jsxs("div",{className:"flex items-center gap-2 p-3 bg-destructive/10 border border-destructive/20 rounded-lg text-destructive",children:[e.jsx(E.AlertCircle,{className:"h-4 w-4"}),e.jsx("span",{className:"text-sm",children:p})]}),N&&e.jsxs("div",{className:"flex items-center gap-2 p-3 bg-green-500/10 border border-green-500/20 rounded-lg text-green-600",children:[e.jsx(E.CheckCircle,{className:"h-4 w-4"}),e.jsx("span",{className:"text-sm",children:N})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs(Ve,{children:[e.jsx(Ke,{children:e.jsxs(We,{className:"flex items-center gap-2",children:[e.jsx(E.Settings,{className:"h-5 w-5"}),"Informations du thème"]})}),e.jsxs(Ze,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(ge,{htmlFor:"theme-name",children:"Nom"}),e.jsx(fe,{id:"theme-name",value:w.name,onChange:_=>b({...w,name:_.target.value}),placeholder:"Mon thème"})]}),e.jsxs("div",{children:[e.jsx(ge,{htmlFor:"theme-author",children:"Auteur"}),e.jsx(fe,{id:"theme-author",value:w.author||"",onChange:_=>b({...w,author:_.target.value}),placeholder:"Votre nom"})]})]}),e.jsxs("div",{children:[e.jsx(ge,{htmlFor:"theme-description",children:"Description"}),e.jsx(pa,{id:"theme-description",value:w.description||"",onChange:_=>b({...w,description:_.target.value}),placeholder:"Description du thème...",rows:3})]})]})]}),(h||u)&&e.jsxs(Ve,{children:[e.jsx(Ke,{children:e.jsxs(We,{className:"flex items-center gap-2",children:[e.jsx(E.Upload,{className:"h-5 w-5"}),"Import / Export"]})}),e.jsxs(Ze,{className:"space-y-4",children:[h&&e.jsxs("div",{children:[e.jsx(ge,{htmlFor:"import-url",children:"URL du thème JSON"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(fe,{id:"import-url",value:F,onChange:_=>D(_.target.value),placeholder:"https://example.com/theme.json",className:"flex-1"}),e.jsx(O,{onClick:()=>X(F),disabled:!F||l,size:"sm",children:l?e.jsx(E.RefreshCw,{className:"h-4 w-4 animate-spin"}):e.jsx(E.Download,{className:"h-4 w-4"})})]})]}),u&&e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(O,{onClick:me,variant:"outline",className:"flex-1",children:[e.jsx(E.Download,{className:"h-4 w-4 mr-2"}),"Exporter JSON"]}),e.jsx(O,{onClick:se,variant:"outline",children:T?e.jsx(E.Check,{className:"h-4 w-4"}):e.jsx(E.Copy,{className:"h-4 w-4"})})]})]})]}),d&&e.jsxs(Ve,{children:[e.jsx(Ke,{children:e.jsxs(We,{className:"flex items-center gap-2",children:[e.jsx(E.Eye,{className:"h-5 w-5"}),"Prévisualisation"]})}),e.jsx(Ze,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(O,{variant:L==="light"?"default":"outline",size:"sm",onClick:()=>A("light"),children:[e.jsx(E.Sun,{className:"h-4 w-4 mr-2"}),"Clair"]}),e.jsxs(O,{variant:L==="dark"?"default":"outline",size:"sm",onClick:()=>A("dark"),children:[e.jsx(E.Moon,{className:"h-4 w-4 mr-2"}),"Sombre"]}),e.jsxs(O,{variant:L==="auto"?"default":"outline",size:"sm",onClick:()=>A("auto"),children:[e.jsx(E.Monitor,{className:"h-4 w-4 mr-2"}),"Auto"]})]}),k&&e.jsxs("div",{className:"text-sm text-muted-foreground",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"Thème actuel:"}),e.jsx("span",{className:"font-medium",children:k})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"Mode sombre:"}),e.jsx("span",{className:"font-medium",children:"Géré par le système"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"Thèmes disponibles:"}),e.jsx("span",{className:"font-medium",children:S.length})]})]})]})})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(O,{onClick:H,className:"flex-1",children:"Sauvegarder le thème"}),e.jsxs(O,{variant:"outline",onClick:()=>window.open("https://tweakcn.com","_blank"),children:[e.jsx(E.ExternalLink,{className:"h-4 w-4 mr-2"}),"TweakCN"]})]})]}),m&&e.jsx("div",{className:"space-y-6",children:e.jsxs(Ve,{children:[e.jsxs(Ke,{children:[e.jsxs(We,{className:"flex items-center gap-2",children:[e.jsx(E.Palette,{className:"h-5 w-5"}),"Couleurs du thème"]}),e.jsx(Dt,{children:"Cliquez sur une couleur pour la modifier"})]}),e.jsx(Ze,{children:e.jsx("div",{className:"grid grid-cols-2 gap-4",children:Object.entries(w.colors).map(([_,q])=>e.jsxs("div",{className:"space-y-2",children:[e.jsx(ge,{htmlFor:`color-${_}`,className:"text-sm font-medium",children:_.replace(/([A-Z])/g," $1").replace(/^./,$=>$.toUpperCase())}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("div",{className:"w-10 h-10 rounded border border-border cursor-pointer",style:{backgroundColor:q},onClick:()=>{document.getElementById(`color-${_}`)?.click()}}),e.jsx(fe,{id:`color-${_}`,type:"color",value:q,onChange:$=>Y(_,$.target.value),className:"flex-1 h-10"})]})]},_))})})]})})]}),d&&e.jsxs(Ve,{children:[e.jsx(Ke,{children:e.jsxs(We,{className:"flex items-center gap-2",children:[e.jsx(E.Eye,{className:"h-5 w-5"}),"Prévisualisation en temps réel"]})}),e.jsx(Ze,{children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium",children:"Boutons"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(O,{size:"sm",children:"Primary"}),e.jsx(O,{variant:"secondary",size:"sm",children:"Secondary"}),e.jsx(O,{variant:"outline",size:"sm",children:"Outline"}),e.jsx(O,{variant:"destructive",size:"sm",children:"Destructive"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium",children:"Cards"}),e.jsxs(Ve,{className:"p-3",children:[e.jsx(We,{className:"text-sm",children:"Exemple de carte"}),e.jsx(Dt,{className:"text-xs",children:"Contenu de la carte avec le nouveau thème"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium",children:"Inputs"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(fe,{placeholder:"Input normal"}),e.jsx(fe,{placeholder:"Input avec erreur",className:"border-destructive"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium",children:"Badges"}),e.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.jsx(He,{children:"Default"}),e.jsx(He,{variant:"secondary",children:"Secondary"}),e.jsx(He,{variant:"destructive",children:"Destructive"}),e.jsx(He,{variant:"outline",children:"Outline"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium",children:"Séparateur"}),e.jsx($t,{}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Texte avec couleur muted"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium",children:"Progress"}),e.jsx("div",{className:"w-full bg-muted rounded-full h-2",children:e.jsx("div",{className:"bg-primary h-2 rounded-full",style:{width:"60%"}})})]})]})})]})]})})});Qo.displayName="WakaThemeManager";function ae(...t){return Os.clsx(t)}function ei(t,a="export.csv"){if(!t||t.length===0)return;const r=Object.keys(t[0]),s=[r.join(","),...t.map(d=>r.map(u=>{const h=d[u];return typeof h=="string"&&(h.includes(",")||h.includes('"')||h.includes(`
|
|
61
|
-
`)
|
|
62
|
-
`),
|
|
63
|
-
`).filter(m=>m.trim());if(d.length===0){a([]);return}const u=d[0].split(",").map(m=>m.trim().replace(/^"|"$/g,"")),h=d.slice(1).map(m=>{const v=m.split(",").map(y=>y.trim().replace(/^"|"$/g,"")),f={};return u.forEach((y,k)=>{f[y]=v[k]||""}),f});a(h)}catch(o){r(o)}},s.onerror=()=>r(s.error),s.readAsText(t)})}function ai(t,a){try{localStorage.setItem(`datatable_${t}`,JSON.stringify(a))}catch(r){console.warn("[DataTable] Failed to save state:",r)}}function ri(t){try{const a=localStorage.getItem(`datatable_${t}`);return a?JSON.parse(a):null}catch(a){return console.warn("[DataTable] Failed to load state:",a),null}}function zh(t,a,r){const s=r.toLowerCase();return Object.values(t).some(n=>n==null?!1:String(n).toLowerCase().includes(s))}function si({data:t,columns:a,pagination:r,tableId:s,onSortingChange:n,onFiltersChange:o,onSelectionChange:d}){const u=C.useMemo(()=>s?ri(s):null,[s]),[h,m]=C.useState(u?.sorting||[]),[v,f]=C.useState(u?.columnFilters||[]),[y,k]=C.useState(u?.columnVisibility||{}),[S,g]=C.useState({}),[w,b]=C.useState(u?.globalFilter||""),[l,c]=C.useState({pageIndex:r?.currentPage||0,pageSize:r?.pageSize||10});C.useEffect(()=>{s&&ai(s,{sorting:h,columnFilters:v,columnVisibility:y,globalFilter:w})},[s,h,v,y,w]),C.useEffect(()=>{n?.(h)},[h,n]),C.useEffect(()=>{o?.(v)},[v,o]),C.useEffect(()=>{const D=p.getFilteredSelectedRowModel().rows.map(T=>T.original);d?.(D)},[S]);const p=Ee.useReactTable({data:t,columns:a,state:{sorting:h,columnFilters:v,columnVisibility:y,rowSelection:S,globalFilter:w,pagination:l},enableRowSelection:!0,onRowSelectionChange:g,onSortingChange:m,onColumnFiltersChange:f,onColumnVisibilityChange:k,onGlobalFilterChange:b,onPaginationChange:c,getCoreRowModel:Ee.getCoreRowModel(),getFilteredRowModel:Ee.getFilteredRowModel(),getPaginationRowModel:Ee.getPaginationRowModel(),getSortedRowModel:Ee.getSortedRowModel(),globalFilterFn:zh,manualPagination:r?.mode==="server",pageCount:r?.mode==="server"?Math.ceil((r.totalItems||0)/l.pageSize):void 0}),x=C.useMemo(()=>p.getFilteredSelectedRowModel().rows.map(D=>D.original),[p,S]),N=C.useCallback(()=>{f([]),b("")},[]),R=C.useCallback(()=>{g({})},[]),F=C.useCallback(()=>p.getFilteredRowModel().rows.map(D=>D.original),[p]);return{table:p,sorting:h,setSorting:m,columnFilters:v,setColumnFilters:f,columnVisibility:y,setColumnVisibility:k,rowSelection:S,setRowSelection:g,globalFilter:w,setGlobalFilter:b,pagination:l,setPagination:c,selectedRows:x,resetFilters:N,resetSelection:R,exportData:F}}function Jr(t="standard",a="comfortable"){const[r,s]=C.useState(t),[n,o]=C.useState(a),[d,u]=C.useState(!1);C.useEffect(()=>{const f=()=>{u(window.innerWidth<768)};return f(),window.addEventListener("resize",f),()=>window.removeEventListener("resize",f)},[]),C.useEffect(()=>{d&&r==="standard"&&s("card")},[d,r]);const h=C.useCallback(()=>{s(f=>{switch(f){case"standard":return"card";case"card":return"compact";case"compact":return"standard";default:return"standard"}})},[]),m=C.useCallback(()=>{o(f=>f==="comfortable"?"compact":"comfortable")},[]);return{layout:r,setLayout:s,density:n,setDensity:o,toggleLayout:h,toggleDensity:m,isMobile:d,densityClasses:{comfortable:{table:"text-sm",cell:"px-4 py-3",header:"px-4 py-3"},compact:{table:"text-xs",cell:"px-2 py-1.5",header:"px-2 py-2"},spacious:{table:"text-base",cell:"px-6 py-4",header:"px-6 py-4"}}[n]}}function Yr(t,a={}){const{onSave:r,onCancel:s,validateField:n,autoSave:o=!1,autoSaveDelay:d=2e3}=a,[u,h]=C.useState(null),[m,v]=C.useState({}),[f,y]=C.useState(null),[k,S]=C.useState({}),[g,w]=C.useState(!1),b=C.useMemo(()=>!f||!u?!1:Object.keys(m).some(P=>{const L=P;return m[L]!==f[L]}),[m,f,u]),l=b&&u!==null,c=C.useCallback((P,L)=>{h(P),v({...L}),y(L),S({})},[]),p=C.useCallback(()=>{!u||!f||(s?.(u,f),h(null),v({}),y(null),S({}))},[u,f,s]),x=C.useCallback((P,L)=>{if(u){if(n){const A=n(P,L);if(A){S(V=>({...V,[P]:A}));return}else S(V=>{const X={...V};return delete X[P],X})}v(A=>({...A,[P]:L}))}},[u,n]),N=C.useCallback(async()=>{if(!(!u||!r||g)){if(Object.keys(k).length>0)throw new Error("Validation errors present");w(!0);try{await r(u,m),h(null),v({}),y(null),S({})}catch(P){throw console.error("Error saving edit:",P),P}finally{w(!1)}}},[u,r,m,k,g]),R=C.useCallback(()=>{f&&(v({...f}),S({}))},[f]),F=C.useMemo(()=>!o||!l?null:setTimeout(()=>{l&&!g&&N().catch(console.error)},d),[o,l,g,N,d]);return C.useEffect(()=>()=>{F&&clearTimeout(F)},[F]),[{editingRowId:u,editedData:m,hasChanges:b,isDirty:l},{startEdit:c,cancelEdit:p,saveEdit:N,updateField:x,resetEdit:R}]}function ma({table:t,config:a,globalFilter:r,onGlobalFilterChange:s,density:n,onDensityChange:o,onExport:d,onImport:u}){const{t:h}=et.useTranslation(),m=i.useRef(null),v=t.getFilteredSelectedRowModel().rows,f=v.length>0,y=i.useMemo(()=>a?.actions?a.actions.filter(g=>!(g.requiresSelection&&!f)):[],[a?.actions,f]),k=g=>{const w=f?v.map(b=>b.original):t.getFilteredRowModel().rows.map(b=>b.original);d?d(g):g==="csv"?ei(w,"export.csv"):ti(w,"export.json")},S=g=>{const w=g.target.files?.[0];w&&u&&u(w),m.current&&(m.current.value="")};return e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4 p-4 border-b",children:[e.jsxs("div",{className:"flex flex-1 flex-col sm:flex-row items-start sm:items-center gap-2 w-full sm:w-auto",children:[a?.showSearch!==!1&&e.jsxs("div",{className:"relative w-full sm:w-64",children:[e.jsx(E.Search,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(fe,{placeholder:h("datatable.toolbar.search",{defaultValue:"Search..."}),value:r??"",onChange:g=>s(g.target.value),className:"pl-8 h-9"}),r&&e.jsx("button",{onClick:()=>s(""),className:"absolute right-2 top-2.5 text-muted-foreground hover:text-foreground",children:e.jsx(E.X,{className:"h-4 w-4"})})]}),f&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsxs("span",{children:[v.length," ",h("datatable.toolbar.selected",{defaultValue:"selected"})]}),e.jsx(O,{variant:"ghost",size:"sm",onClick:()=>t.resetRowSelection(),className:"h-7 px-2",children:h("datatable.toolbar.clear",{defaultValue:"Clear"})})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[y.map(g=>e.jsxs(O,{variant:g.variant||"outline",size:"sm",onClick:()=>g.onClick(v.map(w=>w.original)),disabled:g.disabled,className:"h-9",children:[g.icon,e.jsx("span",{className:"ml-2",children:g.label})]},g.id)),a?.showRefresh&&e.jsxs(O,{variant:"outline",size:"icon",onClick:a.onRefresh,className:"h-9 w-9",children:[e.jsx(E.RefreshCw,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:h("datatable.toolbar.refresh",{defaultValue:"Refresh"})})]}),d&&e.jsxs(Zt,{children:[e.jsx(Qt,{asChild:!0,children:e.jsxs(O,{variant:"outline",size:"icon",className:"h-9 w-9",children:[e.jsx(E.Download,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:h("datatable.toolbar.export",{defaultValue:"Export"})})]})}),e.jsxs(Lt,{align:"end",children:[e.jsx(ea,{children:h("datatable.toolbar.exportAs",{defaultValue:"Export as"})}),e.jsx(ta,{}),e.jsx(Tt,{onClick:()=>k("csv"),children:"CSV"}),e.jsx(Tt,{onClick:()=>k("json"),children:"JSON"})]})]}),u&&e.jsxs(e.Fragment,{children:[e.jsx("input",{ref:m,type:"file",accept:".csv,.json",onChange:S,className:"hidden"}),e.jsxs(O,{variant:"outline",size:"icon",onClick:()=>m.current?.click(),className:"h-9 w-9",children:[e.jsx(E.Upload,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:h("datatable.toolbar.import",{defaultValue:"Import"})})]})]}),a?.showColumnToggle!==!1&&e.jsxs(Zt,{children:[e.jsx(Qt,{asChild:!0,children:e.jsxs(O,{variant:"outline",size:"icon",className:"h-9 w-9",children:[e.jsx(E.Columns,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:h("datatable.toolbar.columns",{defaultValue:"Columns"})})]})}),e.jsxs(Lt,{align:"end",className:"w-48",children:[e.jsx(ea,{children:h("datatable.toolbar.toggleColumns",{defaultValue:"Toggle columns"})}),e.jsx(ta,{}),t.getAllColumns().filter(g=>g.getCanHide()).map(g=>e.jsx(Tt,{className:"capitalize",checked:g.getIsVisible(),onCheckedChange:w=>g.toggleVisibility(!!w),children:g.id},g.id))]})]}),a?.showDensity&&o&&e.jsxs(Zt,{children:[e.jsx(Qt,{asChild:!0,children:e.jsxs(O,{variant:"outline",size:"icon",className:"h-9 w-9",children:[e.jsx(E.SlidersHorizontal,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:h("datatable.toolbar.density",{defaultValue:"Density"})})]})}),e.jsxs(Lt,{align:"end",children:[e.jsx(ea,{children:h("datatable.toolbar.tableDensity",{defaultValue:"Table density"})}),e.jsx(ta,{}),e.jsx(Tt,{checked:n==="comfortable",onCheckedChange:()=>o("comfortable"),children:h("datatable.toolbar.comfortable",{defaultValue:"Comfortable"})}),e.jsx(Tt,{checked:n==="compact",onCheckedChange:()=>o("compact"),children:h("datatable.toolbar.compact",{defaultValue:"Compact"})})]})]})]})]})}function Kr({table:t,pageSizeOptions:a=[25,50,100,500],showInfo:r=!0}){const{t:s}=et.useTranslation(),n=t.getState().pagination.pageIndex,o=t.getState().pagination.pageSize,d=t.getPageCount(),u=t.getFilteredRowModel().rows.length,h=n*o+1,m=Math.min((n+1)*o,u);return e.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 px-4 py-3 border-t",children:[r&&e.jsx("div",{className:"text-sm text-muted-foreground",children:u>0?e.jsxs(e.Fragment,{children:[s("datatable.pagination.showing",{defaultValue:"Showing"})," ",h," ",s("datatable.pagination.to",{defaultValue:"to"})," ",m," ",s("datatable.pagination.of",{defaultValue:"of"})," ",u," ",s("datatable.pagination.results",{defaultValue:"results"})]}):s("datatable.pagination.noResults",{defaultValue:"No results"})}),e.jsxs("div",{className:"flex items-center gap-6",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground whitespace-nowrap",children:s("datatable.pagination.rowsPerPage",{defaultValue:"Rows per page"})}),e.jsxs(ut,{value:`${o}`,onValueChange:v=>{t.setPageSize(Number(v))},children:[e.jsx(rt,{className:"h-8 w-[70px]",children:e.jsx(mt,{placeholder:o})}),e.jsx(st,{side:"top",children:a.map(v=>e.jsx(Qe,{value:`${v}`,children:v},v))})]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsxs("span",{className:"text-sm text-muted-foreground mr-2",children:[s("datatable.pagination.page",{defaultValue:"Page"})," ",n+1," ",s("datatable.pagination.of",{defaultValue:"of"})," ",d]}),e.jsxs(O,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>t.setPageIndex(0),disabled:!t.getCanPreviousPage(),children:[e.jsx(E.ChevronsLeft,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:s("datatable.pagination.firstPage",{defaultValue:"First page"})})]}),e.jsxs(O,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>t.previousPage(),disabled:!t.getCanPreviousPage(),children:[e.jsx(E.ChevronLeft,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:s("datatable.pagination.previousPage",{defaultValue:"Previous page"})})]}),e.jsxs(O,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>t.nextPage(),disabled:!t.getCanNextPage(),children:[e.jsx(E.ChevronRight,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:s("datatable.pagination.nextPage",{defaultValue:"Next page"})})]}),e.jsxs(O,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>t.setPageIndex(d-1),disabled:!t.getCanNextPage(),children:[e.jsx(E.ChevronsRight,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:s("datatable.pagination.lastPage",{defaultValue:"Last page"})})]})]})]})]})}function Zr({table:t,filters:a,position:r="top",onFiltersChange:s}){const{t:n}=et.useTranslation(),[o,d]=i.useState([]),[u,h]=i.useState(!1),m=i.useCallback(b=>{const l=t.getPreFilteredRowModel().rows,c=new Set;return l.forEach(p=>{const x=p.getValue(b);x!=null&&x!==""&&c.add(String(x))}),Array.from(c).sort()},[t]),v={text:[{value:"contains",label:n("datatable.filters.contains",{defaultValue:"Contains"})},{value:"equals",label:n("datatable.filters.equals",{defaultValue:"Equals"})},{value:"startsWith",label:n("datatable.filters.startsWith",{defaultValue:"Starts with"})},{value:"endsWith",label:n("datatable.filters.endsWith",{defaultValue:"Ends with"})},{value:"notContains",label:n("datatable.filters.notContains",{defaultValue:"Not contains"})}],select:[{value:"equals",label:n("datatable.filters.equals",{defaultValue:"Equals"})},{value:"notEquals",label:n("datatable.filters.notEquals",{defaultValue:"Not equals"})}],multiselect:[{value:"in",label:n("datatable.filters.in",{defaultValue:"In"})},{value:"notIn",label:n("datatable.filters.notIn",{defaultValue:"Not in"})}],range:[{value:"between",label:n("datatable.filters.between",{defaultValue:"Between"})},{value:"greaterThan",label:n("datatable.filters.greaterThan",{defaultValue:"Greater than"})},{value:"lessThan",label:n("datatable.filters.lessThan",{defaultValue:"Less than"})}],date:[{value:"equals",label:n("datatable.filters.equals",{defaultValue:"Equals"})},{value:"before",label:n("datatable.filters.before",{defaultValue:"Before"})},{value:"after",label:n("datatable.filters.after",{defaultValue:"After"})},{value:"between",label:n("datatable.filters.between",{defaultValue:"Between"})}],daterange:[{value:"between",label:n("datatable.filters.between",{defaultValue:"Between"})},{value:"before",label:n("datatable.filters.before",{defaultValue:"Before"})},{value:"after",label:n("datatable.filters.after",{defaultValue:"After"})}],checkbox:[{value:"equals",label:n("datatable.filters.equals",{defaultValue:"Equals"})}],number:[{value:"equals",label:n("datatable.filters.equals",{defaultValue:"Equals"})},{value:"notEquals",label:n("datatable.filters.notEquals",{defaultValue:"Not equals"})},{value:"greaterThan",label:n("datatable.filters.greaterThan",{defaultValue:"Greater than"})},{value:"lessThan",label:n("datatable.filters.lessThan",{defaultValue:"Less than"})},{value:"between",label:n("datatable.filters.between",{defaultValue:"Between"})}],boolean:[{value:"equals",label:n("datatable.filters.equals",{defaultValue:"Equals"})},{value:"notEquals",label:n("datatable.filters.notEquals",{defaultValue:"Not equals"})}]},f=(b,l,c)=>{const p=t.getColumn(b.column||b.id);if(!p)return;const x={columnId:b.column||b.id,operator:l,value:c,label:b.label};d(N=>[...N,x]),p.setFilterValue({operator:l,value:c}),s?.([...o,x])},y=b=>{const l=o[b],c=t.getColumn(l.columnId);c&&c.setFilterValue(void 0);const p=o.filter((x,N)=>N!==b);d(p),s?.(p)},k=()=>{o.forEach(b=>{const l=t.getColumn(b.columnId);l&&l.setFilterValue(void 0)}),d([]),s?.([])},S=b=>{const[l,c]=i.useState(v[b.type]?.[0]?.value||"equals"),p=()=>b.defaultValue!==void 0?b.defaultValue:b.type==="range"?{min:"",max:""}:b.type==="daterange"?{from:"",to:""}:b.type==="checkbox"?!1:"",[x,N]=i.useState(p()),[R,F]=i.useState([]),[D,T]=i.useState(!1),P=b.column?m(b.column):[],L=()=>{const A=b.type==="multiselect"?R:x;let V=!1;b.type==="multiselect"?V=Array.isArray(A)&&A.length>0:b.type==="range"?V=A.min!==""||A.max!=="":b.type==="daterange"?V=A.from!==""||A.to!=="":b.type==="checkbox"?V=!0:V=A!==""&&A!=null,V&&(f(b,l,A),N(p()),F([]),T(!1))};return e.jsxs("div",{className:"space-y-3 p-4 border rounded-lg",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(ge,{className:"text-sm font-medium",children:b.label}),e.jsx(He,{variant:"outline",className:"text-xs",children:b.type})]}),v[b.type]&&v[b.type].length>1&&e.jsxs(ut,{value:l,onValueChange:c,children:[e.jsx(rt,{className:"h-9",children:e.jsx(mt,{})}),e.jsx(st,{children:v[b.type].map(A=>e.jsx(Qe,{value:A.value,children:A.label},A.value))})]}),b.type==="text"&&e.jsx("div",{className:"space-y-2",children:e.jsxs(xt,{open:D,onOpenChange:T,children:[e.jsx(vt,{asChild:!0,children:e.jsx(fe,{placeholder:b.placeholder||n("datatable.filters.enterValue",{defaultValue:"Enter value..."}),value:x,onChange:A=>{N(A.target.value),T(!0)},className:"h-9"})}),P.length>0&&x&&e.jsx(dt,{className:"w-[--radix-popover-trigger-width] p-0",align:"start",children:e.jsxs(_t,{children:[e.jsx(oa,{placeholder:n("datatable.filters.search",{defaultValue:"Search..."})}),e.jsx(ia,{children:n("datatable.filters.noResults",{defaultValue:"No results"})}),e.jsx(la,{className:"max-h-64 overflow-auto",children:P.filter(A=>A.toLowerCase().includes(x.toLowerCase())).slice(0,50).map(A=>e.jsx(ca,{onSelect:()=>{N(A),T(!1)},children:A},A))})]})})]})}),b.type==="select"&&e.jsxs(ut,{value:x,onValueChange:N,children:[e.jsx(rt,{className:"h-9",children:e.jsx(mt,{placeholder:b.placeholder})}),e.jsx(st,{children:(b.options||P.map(A=>({label:A,value:A}))).map(A=>e.jsx(Qe,{value:String(A.value),children:A.label},A.value))})]}),b.type==="multiselect"&&e.jsxs(xt,{children:[e.jsx(vt,{asChild:!0,children:e.jsxs(O,{variant:"outline",className:"w-full justify-between h-9",children:[R.length>0?`${R.length} ${n("datatable.filters.selected",{defaultValue:"selected"})}`:b.placeholder||n("datatable.filters.selectValues",{defaultValue:"Select values..."}),e.jsx(E.ChevronDown,{className:"ml-2 h-4 w-4 opacity-50"})]})}),e.jsx(dt,{className:"w-[--radix-popover-trigger-width] p-0",align:"start",children:e.jsxs(_t,{children:[e.jsx(oa,{placeholder:n("datatable.filters.search",{defaultValue:"Search..."})}),e.jsx(ia,{children:n("datatable.filters.noResults",{defaultValue:"No results"})}),e.jsx(la,{className:"max-h-64 overflow-auto",children:P.map(A=>e.jsxs(ca,{onSelect:()=>{F(V=>V.includes(A)?V.filter(X=>X!==A):[...V,A])},children:[e.jsx(at,{checked:R.includes(A),className:"mr-2"}),A]},A))})]})})]}),b.type==="date"&&e.jsx(fe,{type:"date",value:x,onChange:A=>N(A.target.value),className:"h-9"}),b.type==="range"&&e.jsxs("div",{className:"flex gap-2",children:[e.jsx(fe,{type:"number",placeholder:"Min",value:x.min||"",onChange:A=>N({...x,min:A.target.value}),className:"h-9"}),e.jsx(fe,{type:"number",placeholder:"Max",value:x.max||"",onChange:A=>N({...x,max:A.target.value}),className:"h-9"})]}),b.type==="daterange"&&e.jsxs("div",{className:"flex gap-2",children:[e.jsx(fe,{type:"date",placeholder:n("datatable.filters.from",{defaultValue:"From"}),value:x.from||"",onChange:A=>N({...x,from:A.target.value}),className:"h-9"}),e.jsx(fe,{type:"date",placeholder:n("datatable.filters.to",{defaultValue:"To"}),value:x.to||"",onChange:A=>N({...x,to:A.target.value}),className:"h-9"})]}),b.type==="checkbox"&&e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(at,{id:`checkbox-${b.id}`,checked:x===!0,onCheckedChange:A=>N(A===!0)}),e.jsx(ge,{htmlFor:`checkbox-${b.id}`,className:"text-sm font-normal",children:b.placeholder||n("datatable.filters.checked",{defaultValue:"Checked"})})]}),e.jsxs(O,{onClick:L,size:"sm",className:"w-full",children:[e.jsx(E.Plus,{className:"h-4 w-4 mr-2"}),n("datatable.filters.apply",{defaultValue:"Apply filter"})]})]})};if(!a||a.length===0)return null;const g=e.jsxs("div",{className:"space-y-4",children:[o.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(ge,{className:"text-sm text-muted-foreground",children:n("datatable.filters.active",{defaultValue:"Filtres actifs"})}),e.jsxs(O,{variant:"ghost",size:"sm",onClick:k,children:[e.jsx(E.Trash2,{className:"h-3 w-3 mr-1"}),n("datatable.filters.clearAll",{defaultValue:"Tout effacer"})]})]}),e.jsx("div",{className:"space-y-1",children:o.map((b,l)=>e.jsxs("div",{className:"flex items-center justify-between p-2 bg-muted rounded-md text-sm",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{className:"font-medium",children:b.label}),e.jsx("span",{className:"text-muted-foreground mx-2",children:b.operator}),e.jsx("span",{className:"text-primary truncate",children:Array.isArray(b.value)?b.value.join(", "):b.value})]}),e.jsx(O,{variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>y(l),children:e.jsx(E.X,{className:"h-3 w-3"})})]},l))})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(ge,{className:"text-sm text-muted-foreground",children:n("datatable.filters.available",{defaultValue:"Filtres disponibles"})}),a.map(b=>e.jsx("div",{children:S(b)},b.id))]})]}),w=e.jsxs(O,{variant:"outline",size:"sm",children:[e.jsx(E.Filter,{className:"h-4 w-4 mr-2"}),n("datatable.filters.title",{defaultValue:"Filtres"}),o.length>0&&e.jsx(He,{variant:"secondary",className:"ml-2",children:o.length})]});return r==="right"||r==="left"?e.jsxs(Ar,{open:u,onOpenChange:h,children:[e.jsx(Fr,{asChild:!0,children:w}),e.jsxs(La,{side:r,className:"w-[400px] sm:w-[540px] overflow-y-auto",children:[e.jsxs(Ir,{children:[e.jsxs(Or,{className:"flex items-center gap-2",children:[e.jsx(E.Filter,{className:"h-5 w-5"}),n("datatable.filters.title",{defaultValue:"Filtres"})]}),e.jsx(_r,{children:n("datatable.filters.description",{defaultValue:"Appliquez des filtres pour affiner les résultats"})})]}),e.jsx("div",{className:"mt-6",children:g})]})]}):e.jsxs(xt,{open:u,onOpenChange:h,children:[e.jsx(vt,{asChild:!0,children:w}),e.jsx(dt,{className:"w-[400px] max-h-[600px] overflow-y-auto",align:r==="top"?"start":"end",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(E.Filter,{className:"h-4 w-4"}),e.jsx("h4",{className:"font-semibold text-sm",children:n("datatable.filters.title",{defaultValue:"Filtres"})})]})}),g]})})]})}function Ra({value:t,field:a,config:r,isEditing:s,error:n,onChange:o,onStartEdit:d,onSave:u,onCancel:h,className:m}){const[v,f]=i.useState(t),[y,k]=i.useState(!1);i.useEffect(()=>{f(t)},[t]);const S=()=>{o(v),u()},g=()=>{f(t),h()},w=l=>{l.key==="Enter"&&!l.shiftKey?(l.preventDefault(),S()):l.key==="Escape"&&(l.preventDefault(),g())};if(!s)return e.jsx("div",{className:ae("cursor-pointer hover:bg-muted/50 p-1 rounded transition-colors",m),onClick:d,children:Vh(t,r)});const b=()=>{switch(r.type){case"textarea":return e.jsx(pa,{value:v||"",onChange:l=>f(l.target.value),onKeyDown:w,placeholder:r.placeholder,rows:r.rows||3,disabled:r.disabled,className:ae(n&&"border-destructive")});case"select":return e.jsxs(ut,{value:v||"",onValueChange:f,disabled:r.disabled,children:[e.jsx(rt,{className:ae(n&&"border-destructive"),children:e.jsx(mt,{placeholder:r.placeholder})}),e.jsx(st,{children:r.options?.map(l=>e.jsx(Qe,{value:l.value,children:l.label},l.value))})]});case"checkbox":return e.jsx(at,{checked:!!v,onCheckedChange:f,disabled:r.disabled});case"switch":return e.jsx(zr,{checked:!!v,onCheckedChange:f,disabled:r.disabled});case"date":case"datetime":return e.jsxs(xt,{open:y,onOpenChange:k,children:[e.jsx(vt,{asChild:!0,children:e.jsxs(O,{variant:"outline",className:ae("w-full justify-start text-left font-normal",!v&&"text-muted-foreground",n&&"border-destructive"),children:[e.jsx(E.CalendarIcon,{className:"mr-2 h-4 w-4"}),v?M.format(new Date(v),"PPP"):r.placeholder]})}),e.jsx(dt,{className:"w-auto p-0",align:"start",children:e.jsx(br,{mode:"single",selected:v?new Date(v):void 0,onSelect:l=>{l&&(f(r.type==="datetime"?l.toISOString():l.toISOString().split("T")[0]),k(!1))},initialFocus:!0})})]});default:return e.jsx(fe,{type:r.type,value:v||"",onChange:l=>f(l.target.value),onKeyDown:w,placeholder:r.placeholder,min:r.min,max:r.max,step:r.step,disabled:r.disabled,required:r.required,pattern:r.pattern,title:r.title,className:ae(n&&"border-destructive")})}};return e.jsxs("div",{className:ae("relative",m),children:[b(),e.jsxs("div",{className:"absolute right-1 top-1/2 -translate-y-1/2 flex gap-1",children:[e.jsx(O,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:S,children:e.jsx(E.Check,{className:"h-3 w-3 text-green-600"})}),e.jsx(O,{size:"sm",variant:"ghost",className:"h-6 w-6 p-0",onClick:g,children:e.jsx(E.X,{className:"h-3 w-3 text-red-600"})})]}),n&&e.jsx("p",{className:"text-xs text-destructive mt-1",children:n})]})}function Vh(t,a){if(t==null)return e.jsx("span",{className:"text-muted-foreground italic",children:"Non défini"});switch(a.type){case"checkbox":case"switch":return e.jsx("span",{className:ae("inline-flex items-center px-2 py-1 rounded-full text-xs font-medium",t?"bg-green-100 text-green-800":"bg-gray-100 text-gray-800"),children:t?"Oui":"Non"});case"date":case"datetime":try{const s=new Date(t);return M.format(s,a.type==="datetime"?"PPP p":"PPP")}catch{return t}case"select":const r=a.options?.find(s=>s.value===t);return r?r.label:t;case"textarea":return e.jsx("div",{className:"max-w-xs",children:e.jsx("p",{className:"truncate",children:t})});default:return t}}function Wh({data:t,columns:a,layout:r="standard",variant:s="bordered",density:n="comfortable",filters:o,filterPosition:d="top",toolbar:u,pagination:h,selection:m=!1,actions:v,i18nNamespace:f,loading:y=!1,error:k,emptyState:S,headerSticky:g=!1,columnVisibilityToggle:w=!0,columnResize:b=!1,enableExport:l=!1,enableImport:c=!1,enableReorder:p=!1,enableContextMenu:x=!1,onRowClick:N,onRowDoubleClick:R,onSortingChange:F,onFiltersChange:D,onSelectionChange:T,className:P,tableId:L,virtualization:A,edit:V}){const{t:X}=et.useTranslation(f),{layout:me,setLayout:se,density:Y,setDensity:H,densityClasses:_}=Jr(r,n),q=i.useMemo(()=>{const ce=[...a];if(m){const oe={id:"select",header:({table:de})=>e.jsx(at,{checked:de.getIsAllPageRowsSelected(),onCheckedChange:Se=>de.toggleAllPageRowsSelected(!!Se),"aria-label":X("datatable.selectAll",{defaultValue:"Select all"})}),cell:({row:de})=>e.jsx(at,{checked:de.getIsSelected(),onCheckedChange:Se=>de.toggleSelected(!!Se),"aria-label":X("datatable.selectRow",{defaultValue:"Select row"})}),enableSorting:!1,enableHiding:!1};ce.unshift(oe)}return ce},[a,m,V,X]),{table:$,globalFilter:te,setGlobalFilter:Z,selectedRows:G,resetFilters:Re,exportData:ve}=si({data:t,columns:q,pagination:h,tableId:L,onSortingChange:F,onFiltersChange:D,onSelectionChange:T}),[Ne,le]=Yr($,{onSave:V?.onSave,onCancel:V?.onCancel,autoSave:V?.autoSave,autoSaveDelay:V?.autoSaveDelay});if(V?.editableColumns&&V.editableColumns.length>0){const ce={id:"edit-actions",header:()=>X("datatable.actions",{defaultValue:"Actions"}),cell:({row:oe})=>Ne.editingRowId===oe.id?e.jsxs("div",{className:"flex gap-1",children:[e.jsx(O,{size:"sm",variant:"ghost",onClick:()=>le.saveEdit(),disabled:!Ne.hasChanges,children:X("datatable.save",{defaultValue:"Save"})}),e.jsx(O,{size:"sm",variant:"ghost",onClick:()=>le.cancelEdit(),children:X("datatable.cancel",{defaultValue:"Cancel"})})]}):e.jsx(O,{size:"sm",variant:"ghost",onClick:()=>{console.log("🔧 Starting edit for row:",oe.id,oe.original),le.startEdit(oe.id,oe.original)},children:X("datatable.edit",{defaultValue:"Edit"})}),enableSorting:!1,enableHiding:!1};q.push(ce)}const Me=i.useCallback(ce=>{const oe=ve();console.log("Export",ce,oe)},[ve]),z=i.useCallback(ce=>{console.log("Import",ce)},[]),I={bordered:"border rounded-lg",minimal:"",striped:"[&_tbody_tr:nth-child(even)]:bg-muted/50",glass:"backdrop-blur-sm bg-background/80 border rounded-lg"};if(y)return e.jsx("div",{className:"flex items-center justify-center h-64 border rounded-lg",children:e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsx(E.Loader2,{className:"h-8 w-8 animate-spin text-muted-foreground"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:X("datatable.loading",{defaultValue:"Loading..."})})]})});if(k)return e.jsx("div",{className:"flex items-center justify-center h-64 border rounded-lg bg-destructive/10",children:e.jsxs("div",{className:"flex flex-col items-center gap-2 text-destructive",children:[e.jsx(E.AlertCircle,{className:"h-8 w-8"}),e.jsx("p",{className:"text-sm font-medium",children:k})]})});if(!t||t.length===0)return e.jsxs("div",{className:"flex flex-col",children:[u&&e.jsx(ma,{table:$,config:u,globalFilter:te,onGlobalFilterChange:Z,density:Y,onDensityChange:H,onExport:l?Me:void 0,onImport:c?z:void 0}),e.jsx("div",{className:"flex items-center justify-center h-64 border rounded-lg",children:S||e.jsxs("div",{className:"flex flex-col items-center gap-2 text-muted-foreground",children:[e.jsx("p",{className:"text-lg font-medium",children:X("datatable.noData",{defaultValue:"No data"})}),e.jsx("p",{className:"text-sm",children:X("datatable.noDataDescription",{defaultValue:"There are no results to display"})})]})})]});const J=()=>{const ce=e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[u&&e.jsx("div",{className:"flex-1",children:e.jsx(ma,{table:$,config:u,globalFilter:te,onGlobalFilterChange:Z,density:Y,onDensityChange:H,onExport:l?Me:void 0,onImport:c?z:void 0})}),o&&e.jsx(Zr,{table:$,filters:o,position:d,onFiltersChange:D})]}),e.jsx("div",{className:ae("w-full overflow-auto",I[s]),children:e.jsxs("table",{className:ae("w-full caption-bottom text-sm",_.table),children:[e.jsx("thead",{className:ae(g&&"sticky top-0 bg-background z-10"),children:$.getHeaderGroups().map(oe=>e.jsx("tr",{className:"border-b",children:oe.headers.map(de=>e.jsxs("th",{className:ae("text-left font-medium text-muted-foreground",_.header,de.column.getCanSort()&&"cursor-pointer select-none hover:text-foreground"),onClick:de.column.getToggleSortingHandler(),children:[de.isPlaceholder?null:Ee.flexRender(de.column.columnDef.header,de.getContext()),de.column.getIsSorted()&&e.jsx("span",{className:"ml-2",children:de.column.getIsSorted()==="asc"?"↑":"↓"})]},de.id))},oe.id))}),e.jsx("tbody",{children:$.getRowModel().rows.map(oe=>e.jsx("tr",{className:ae("border-b transition-colors",N&&"cursor-pointer hover:bg-muted/50",oe.getIsSelected()&&"bg-muted"),onClick:()=>N?.(oe.original),onDoubleClick:()=>R?.(oe.original),children:oe.getVisibleCells().map(de=>{const Se=de.getValue(),ye=de.column.id,Oe=oe.id,ht=Ne.editingRowId===Oe,Ue=V?.editableColumns?.find(Be=>Be.field===ye);return Ue&&ht?e.jsx("td",{className:ae("align-middle",_.cell),children:e.jsx(Ra,{value:Se,field:ye,config:Ue.config,isEditing:ht,onChange:Be=>le.updateField(ye,Be),onStartEdit:()=>le.startEdit(Oe,oe.original),onSave:()=>le.saveEdit(),onCancel:()=>le.cancelEdit()})},de.id):e.jsx("td",{className:ae("align-middle",_.cell),children:Ee.flexRender(de.column.columnDef.cell,de.getContext())},de.id)})},oe.id))})]})}),h&&e.jsx(Kr,{table:$,pageSizeOptions:h.pageSizeOptions})]});return e.jsx("div",{className:"space-y-4",children:ce})};return e.jsx("div",{className:ae("w-full",P),children:J()})}function ni({data:t,columns:a,pagination:r,tableId:s,onSortingChange:n,onFiltersChange:o,onSelectionChange:d,onColumnOrderChange:u,onExpandedChange:h,onGroupingChange:m,grouping:v,virtualization:f,sortMode:y="multiple",performance:k}){const S=C.useMemo(()=>s?Hh(s):null,[s]),[g,w]=C.useState(S?.sorting||[]),[b,l]=C.useState(S?.columnFilters||[]),[c,p]=C.useState(S?.columnVisibility||{}),[x,N]=C.useState(S?.columnOrder||[]),[R,F]=C.useState(S?.expanded||{}),[D,T]=C.useState(S?.grouping||[]),[P,L]=C.useState(S?.rowSelection||{}),[A,V]=C.useState(S?.globalFilter||""),[X,me]=C.useState({pageIndex:r?.currentPage||0,pageSize:r?.pageSize||10}),[se,Y]=C.useState(b);C.useEffect(()=>{const I=setTimeout(()=>{Y(b)},k?.filterDebounceMs||300);return()=>clearTimeout(I)},[b,k?.filterDebounceMs]),C.useEffect(()=>{v?.columns&&v.columns.length>0&&D.length===0&&T([v.columns[0]])},[v?.columns,D.length]),C.useEffect(()=>{s&&qh(s,{sorting:g,columnFilters:b,columnVisibility:c,columnOrder:x,expanded:R,grouping:D,pagination:X,globalFilter:A,density:"comfortable",layout:"standard",rowSelection:P})},[s,g,b,c,x,R,D,X,A,P]),C.useEffect(()=>{n?.(g)},[g,n]),C.useEffect(()=>{o?.(se)},[se,o]),C.useEffect(()=>{const I=H.getFilteredSelectedRowModel().rows.map(J=>J.original);d?.(I)},[P]),C.useEffect(()=>{u?.(x)},[x,u]),C.useEffect(()=>{h?.(R)},[R,h]),C.useEffect(()=>{m?.(D)},[D,m]);const H=Ee.useReactTable({data:t,columns:a,state:{sorting:g,columnFilters:se,columnVisibility:c,columnOrder:x,expanded:R,grouping:D,rowSelection:P,globalFilter:A,pagination:X},enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0,enableGrouping:!0,enableExpanding:!0,enableColumnResizing:!0,enableSorting:!0,enableMultiSort:y==="multiple",enableFilters:!0,enableGlobalFilter:!0,enableColumnFilters:!0,onRowSelectionChange:L,onSortingChange:w,onColumnFiltersChange:l,onColumnVisibilityChange:p,onColumnOrderChange:N,onExpandedChange:F,onGroupingChange:T,onGlobalFilterChange:V,onPaginationChange:me,getCoreRowModel:Ee.getCoreRowModel(),getFilteredRowModel:Ee.getFilteredRowModel(),getPaginationRowModel:Ee.getPaginationRowModel(),getSortedRowModel:Ee.getSortedRowModel(),getGroupedRowModel:Ee.getGroupedRowModel(),getExpandedRowModel:Ee.getExpandedRowModel(),getFacetedRowModel:Ee.getFacetedRowModel(),getFacetedUniqueValues:Ee.getFacetedUniqueValues(),globalFilterFn:Uh,manualPagination:r?.mode==="server",pageCount:r?.mode==="server"?Math.ceil((r.totalItems||0)/X.pageSize):void 0,columnResizeMode:"onChange",sortDescFirst:!1}),_=C.useMemo(()=>H.getFilteredSelectedRowModel().rows.map(I=>I.original),[H,P]),q=C.useCallback(()=>{l([]),V("")},[]),$=C.useCallback(()=>{L({})},[]),te=C.useCallback(()=>{w([]),l([]),p({}),N([]),F({}),T([]),L({}),V(""),me({pageIndex:0,pageSize:r?.pageSize||10})},[r?.pageSize]),Z=C.useCallback(()=>H.getFilteredRowModel().rows.map(I=>I.original),[H]),G=C.useCallback(()=>v?.columns?.length?H.getGroupedRowModel().rows.map(I=>I.original):t,[H,v,t]),Re=C.useCallback(()=>H.getExpandedRowModel().rows.map(I=>I.original),[H]),ve=C.useCallback(I=>{T(J=>J.includes(I)?J.filter(oe=>oe!==I):[...J,I])},[]),Ne=C.useCallback(()=>{T([])},[]),le=C.useCallback(I=>{F(J=>({...J,[I]:!J[I]}))},[]),Me=C.useCallback(()=>{const I=H.getRowModel().rows.map(ce=>ce.id),J={};I.forEach(ce=>{J[ce]=!0}),F(J)},[H]),z=C.useCallback(()=>{F({})},[]);return{table:H,sorting:g,setSorting:w,columnFilters:b,setColumnFilters:l,columnVisibility:c,setColumnVisibility:p,columnOrder:x,setColumnOrder:N,expanded:R,setExpanded:F,grouping:D,setGrouping:T,rowSelection:P,setRowSelection:L,globalFilter:A,setGlobalFilter:V,pagination:X,setPagination:me,selectedRows:_,resetFilters:q,resetSelection:$,resetAll:te,exportData:Z,getGroupedData:G,getExpandedData:Re,toggleGrouping:ve,clearGrouping:Ne,toggleRowExpansion:le,expandAll:Me,collapseAll:z}}function Hh(t){try{const a=localStorage.getItem(`datatable-${t}`);return a?JSON.parse(a):null}catch{return null}}function qh(t,a){try{localStorage.setItem(`datatable-${t}`,JSON.stringify(a))}catch{}}function Uh(t,a,r){const s=r.toLowerCase();return t.getVisibleCells().some(n=>{const o=n.getValue();return o==null?!1:String(o).toLowerCase().includes(s)})}function oi({data:t,virtualization:a,containerRef:r}){const[s,n]=C.useState(a?.containerHeight||600);C.useEffect(()=>{if(!r.current||!a)return;const y=new ResizeObserver(k=>{for(const S of k)n(S.contentRect.height)});return y.observe(r.current),()=>{y.disconnect()}},[r,a]);const o=C.useMemo(()=>{if(!a||a.type==="none")return null;const y={count:t.length,getScrollElement:()=>r.current,estimateSize:()=>a.itemHeight||50,overscan:a.overscan||5};return a.type==="dynamic"?{...y,estimateSize:()=>a.estimatedItemHeight||50}:y},[t.length,a,r]),d=o?ul.useVirtualizer(o):null,u=C.useCallback((y,k="start")=>{d&&d.scrollToIndex(y,{align:k})},[d]),h=C.useCallback(y=>{d&&d.scrollToOffset(y)},[d]),m=C.useCallback(()=>d?d.getVirtualItems():[],[d]),v=C.useCallback(()=>d?d.getTotalSize():0,[d]),f=a?.type!=="none"&&o!==null;return{virtualizer:d,isVirtualized:f,containerHeight:s,scrollToIndex:u,scrollToOffset:h,getVirtualItems:m,getTotalSize:v,virtualItems:d?d.getVirtualItems():[],totalSize:d?d.getTotalSize():0}}function ii({data:t,columns:a,exportConfig:r}){const s=C.useMemo(()=>({formats:["csv","xlsx","json"],filename:"export",includeHeaders:!0,...r}),[r]),n=C.useCallback((y,k)=>{if(!y.length)return;const S=a.filter(c=>c.accessorKey||c.id).map(c=>c.header||c.accessorKey||c.id).join(","),g=y.map(c=>a.filter(p=>p.accessorKey||p.id).map(p=>{const x=p.accessorKey?c[p.accessorKey]:c[p.id],N=p.formatter?p.formatter(x):x,R=String(N||"");return R.includes(",")||R.includes('"')||R.includes(`
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
`,S.forEach(p=>{const x=l[p],N=String(x||"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");g+=` <${p}>${N}</${p}>
|
|
69
|
-
`}),g+=` </row>
|
|
70
|
-
`}),g+="</data>";const w=new Blob([g],{type:"application/xml"}),b=document.createElement("a");b.href=URL.createObjectURL(w),b.download=`${k||s.filename}.xml`,b.click(),URL.revokeObjectURL(b.href)},[a,s.filename]),m=C.useCallback(async(y,k,S)=>{const g=k||t,w=S||s.filename;if(s.onExport){s.onExport(g,y);return}switch(y.toLowerCase()){case"csv":n(g,w);break;case"json":o(g,w);break;case"xlsx":await d(g,w);break;case"pdf":await u(g,w);break;case"xml":h(g,w);break;default:throw new Error(`Format d'export non supporté: ${y}`)}},[t,s,n,o,d,u,h]),v=C.useCallback(async y=>m(y),[m]),f=C.useCallback(async(y,k)=>m(y,k),[m]);return{exportData:m,exportAll:v,exportSelected:f,supportedFormats:s.formats,isExportSupported:y=>s.formats.includes(y)}}function li({importConfig:t}){const a=C.useMemo(()=>({accept:".csv,.xlsx,.json,.xml",...t}),[t]),r=C.useCallback((f,y=",")=>{const k=f.split(`
|
|
71
|
-
`).filter(w=>w.trim());if(k.length===0)return[];const S=k[0].split(y).map(w=>w.trim().replace(/"/g,""));return k.slice(1).map(w=>{const b=w.split(y).map(c=>c.trim().replace(/"/g,"")),l={};return S.forEach((c,p)=>{l[c]=b[p]||""}),l})},[]),s=C.useCallback(f=>{try{const y=JSON.parse(f);return Array.isArray(y)?y:[y]}catch{throw new Error("Format JSON invalide")}},[]),n=C.useCallback(f=>{try{const S=new DOMParser().parseFromString(f,"text/xml").querySelectorAll("row");return Array.from(S).map(g=>{const w={};return Array.from(g.children).forEach(b=>{w[b.tagName]=b.textContent||""}),w})}catch{throw new Error("Format XML invalide")}},[]),o=C.useCallback(async f=>{try{if(typeof window>"u")throw new Error("XLSX parsing not available in server environment");const y=await import("xlsx"),k=await f.arrayBuffer(),S=y.read(k,{type:"array"}),g=S.SheetNames[0],w=S.Sheets[g],b=y.utils.sheet_to_json(w,{header:1});if(b.length===0)return[];const l=b[0];return b.slice(1).map(c=>{const p={};return l.forEach((x,N)=>{p[x]=c[N]||""}),p})}catch{throw new Error("Erreur lors du parsing du fichier XLSX")}},[]),d=C.useCallback(f=>a.validate?a.validate(f):Array.isArray(f)?f.length===0?{valid:!1,errors:["Aucune donnée trouvée"]}:{valid:!0,errors:[]}:{valid:!1,errors:["Les données doivent être un tableau"]},[a.validate]),u=C.useCallback(f=>a.columnMapping?f.map(y=>{const k={};return Object.entries(a.columnMapping).forEach(([S,g])=>{y[S]!==void 0&&(k[g]=y[S])}),k}):f,[a.columnMapping]),h=C.useCallback(async f=>{const y=f.name.split(".").pop()?.toLowerCase();let k=[];try{const S=await f.text();switch(y){case"csv":k=r(S,a.parseOptions?.csv?.delimiter);break;case"json":k=s(S);break;case"xml":k=n(S);break;case"xlsx":k=await o(f);break;default:throw new Error(`Format de fichier non supporté: ${y}`)}const g=d(k);if(!g.valid)throw new Error(`Données invalides: ${g.errors.join(", ")}`);const w=u(k);return a.onImport&&a.onImport(w),w}catch(S){throw new Error(`Erreur lors de l'import: ${S instanceof Error?S.message:"Erreur inconnue"}`)}},[a,r,s,n,o,d,u]),m=C.useCallback(()=>{const f=document.createElement("input");return f.type="file",f.accept=a.accept,f.multiple=!1,f},[a.accept]),v=C.useCallback(()=>new Promise((f,y)=>{const k=m();k.onchange=async S=>{const g=S.target.files?.[0];if(!g){y(new Error("Aucun fichier sélectionné"));return}try{const w=await h(g);f(w)}catch(w){y(w)}},k.click()}),[m,h]);return{importData:h,importWithUI:v,supportedFormats:a.accept?.split(",")||[],isFormatSupported:f=>{const y=f.split(".").pop()?.toLowerCase();return a.accept?.includes(y||"")||!1}}}function ci({theme:t,variant:a="bordered",density:r="comfortable"}){const s={colors:{primary:"hsl(var(--primary))",secondary:"hsl(var(--secondary))",accent:"hsl(var(--accent))",background:"hsl(var(--background))",surface:"hsl(var(--card))",text:"hsl(var(--foreground))",textSecondary:"hsl(var(--muted-foreground))",border:"hsl(var(--border))",hover:"hsl(var(--muted))",selected:"hsl(var(--accent))",disabled:"hsl(var(--muted))"},spacing:{xs:"0.25rem",sm:"0.5rem",md:"1rem",lg:"1.5rem",xl:"2rem"},typography:{fontFamily:"inherit",fontSize:{xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem"},fontWeight:{normal:"400",medium:"500",semibold:"600",bold:"700"}},borders:{radius:{sm:"0.25rem",md:"0.5rem",lg:"0.75rem"},width:{thin:"1px",medium:"2px",thick:"4px"}},shadows:{sm:"0 1px 2px 0 rgb(0 0 0 / 0.05)",md:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",lg:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)"}},n=C.useMemo(()=>t?{colors:{...s.colors,...t.colors},spacing:{...s.spacing,...t.spacing},typography:{...s.typography,...t.typography},borders:{...s.borders,...t.borders},shadows:{...s.shadows,...t.shadows}}:s,[t,s]),o=C.useMemo(()=>{const v="w-full";switch(a){case"bordered":return`${v} border rounded-lg`;case"minimal":return v;case"striped":return`${v} [&_tbody_tr:nth-child(even)]:bg-muted/50`;case"glass":return`${v} backdrop-blur-sm bg-background/80 border rounded-lg`;default:return v}},[a]),d=C.useMemo(()=>{switch(r){case"spacious":return{table:"text-base",header:"px-6 py-4",cell:"px-6 py-4",row:"h-16"};case"compact":return{table:"text-sm",header:"px-3 py-2",cell:"px-3 py-2",row:"h-8"};case"comfortable":default:return{table:"text-sm",header:"px-4 py-3",cell:"px-4 py-3",row:"h-12"}}},[r]),u=C.useMemo(()=>{const v={};return n.colors&&Object.entries(n.colors).forEach(([f,y])=>{v[`--datatable-color-${f}`]=y}),n.spacing&&Object.entries(n.spacing).forEach(([f,y])=>{v[`--datatable-spacing-${f}`]=y}),n.typography&&(n.typography.fontFamily&&(v["--datatable-font-family"]=n.typography.fontFamily),n.typography.fontSize&&Object.entries(n.typography.fontSize).forEach(([f,y])=>{v[`--datatable-font-size-${f}`]=y}),n.typography.fontWeight&&Object.entries(n.typography.fontWeight).forEach(([f,y])=>{v[`--datatable-font-weight-${f}`]=y})),n.borders&&(n.borders.radius&&Object.entries(n.borders.radius).forEach(([f,y])=>{v[`--datatable-radius-${f}`]=y}),n.borders.width&&Object.entries(n.borders.width).forEach(([f,y])=>{v[`--datatable-border-width-${f}`]=y})),n.shadows&&Object.entries(n.shadows).forEach(([f,y])=>{v[`--datatable-shadow-${f}`]=y}),v},[n]),h=C.useCallback((v,f)=>f?`${v} [--datatable-theme-key:${f}]`:v,[]),m=C.useCallback((v={})=>({...v,...u}),[u]);return{theme:n,variantClasses:o,densityClasses:d,customStyles:u,getThemedClass:h,getThemedStyles:m}}function Bh({data:t,columns:a,layout:r="standard",variant:s="bordered",density:n="comfortable",filters:o,filterPosition:d="top",toolbar:u,pagination:h,selection:m=!1,actions:v,i18nNamespace:f,loading:y=!1,error:k,emptyState:S,headerSticky:g=!1,columnVisibilityToggle:w=!0,columnResize:b=!1,columnOrder:l,grouping:c,rowExpansion:p,virtualization:x,sortMode:N="multiple",enableExport:R=!1,enableImport:F=!1,enableReorder:D=!1,enableContextMenu:T=!1,onRowClick:P,onRowDoubleClick:L,onSortingChange:A,onFiltersChange:V,onSelectionChange:X,onColumnOrderChange:me,onExpandedChange:se,onGroupingChange:Y,className:H,tableId:_,edit:q,theme:$,performance:te}){const{t:Z}=et.useTranslation(f),G=i.useRef(null),{layout:Re,setLayout:ve,density:Ne,setDensity:le,densityClasses:Me}=Jr(r,n),{theme:z,variantClasses:I,densityClasses:J,customStyles:ce,getThemedClass:oe,getThemedStyles:de}=ci({theme:$,variant:s,density:Ne}),Se=i.useMemo(()=>{const ne=[...a];if(m){const B={id:"select",header:({table:we})=>e.jsx(at,{checked:we.getIsAllPageRowsSelected(),onCheckedChange:$e=>we.toggleAllPageRowsSelected(!!$e),"aria-label":Z("datatable.selectAll",{defaultValue:"Select all"})}),cell:({row:we})=>e.jsx(at,{checked:we.getIsSelected(),onCheckedChange:$e=>we.toggleSelected(!!$e),"aria-label":Z("datatable.selectRow",{defaultValue:"Select row"})}),enableSorting:!1,enableHiding:!1,size:50};ne.unshift(B)}if(p?.enabled){const B={id:"expand",header:()=>null,cell:({row:we})=>we.getCanExpand()?e.jsx(O,{variant:"ghost",size:"sm",onClick:()=>we.toggleExpanded(),className:"h-8 w-8 p-0",children:we.getIsExpanded()?e.jsx(E.ChevronDown,{className:"h-4 w-4"}):e.jsx(E.ChevronRight,{className:"h-4 w-4"})}):null,enableSorting:!1,enableHiding:!1,size:50};ne.unshift(B)}if(D){const B={id:"reorder",header:()=>null,cell:()=>e.jsx(O,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 cursor-move",children:e.jsx(E.GripVertical,{className:"h-4 w-4"})}),enableSorting:!1,enableHiding:!1,size:50};ne.unshift(B)}return ne},[a,m,p,D,Z]);console.log("DataTableAdvanced - props:",{grouping:c,rowExpansion:p,dataLength:t.length});const{table:ye,sorting:Oe,setSorting:ht,columnFilters:Ue,setColumnFilters:Be,columnVisibility:wt,setColumnVisibility:Vt,columnOrder:Wt,setColumnOrder:At,expanded:W,setExpanded:K,grouping:Pe,setGrouping:Ge,rowSelection:ba,setRowSelection:ts,globalFilter:Oa,setGlobalFilter:_a,pagination:xa,setPagination:fi,selectedRows:hi,resetFilters:nt,resetSelection:jt,resetAll:pt,exportData:va,getGroupedData:za,getExpandedData:Va,toggleGrouping:tt,clearGrouping:Wa,toggleRowExpansion:Xe,expandAll:Ht,collapseAll:Je}=ni({data:t,columns:Se,pagination:h,tableId:_,onSortingChange:A,onFiltersChange:V,onSelectionChange:X,onColumnOrderChange:me,onExpandedChange:se,onGroupingChange:Y,grouping:c,virtualization:x,sortMode:N,performance:te}),{isVirtualized:ot,virtualItems:Nt,totalSize:ya,scrollToIndex:as,scrollToOffset:Ha}=oi({data:t,virtualization:x,containerRef:G}),{exportData:wa,exportAll:rs,exportSelected:qt}=ii({data:t,columns:Se,exportConfig:typeof R=="object"?R:void 0}),{importWithUI:Ut,supportedFormats:pi}=li({importConfig:typeof F=="object"?F:void 0}),[St,Ye]=Yr(ye,{onSave:q?.onSave,onCancel:q?.onCancel,autoSave:q?.autoSave,autoSaveDelay:q?.autoSaveDelay});if(q?.editableColumns&&q.editableColumns.length>0){const ne={id:"edit-actions",header:()=>Z("datatable.actions",{defaultValue:"Actions"}),cell:({row:B})=>St.editingRowId===B.id?e.jsxs("div",{className:"flex gap-1",children:[e.jsx(O,{size:"sm",variant:"ghost",onClick:()=>Ye.saveEdit(),disabled:!St.hasChanges,children:Z("datatable.save",{defaultValue:"Save"})}),e.jsx(O,{size:"sm",variant:"ghost",onClick:()=>Ye.cancelEdit(),children:Z("datatable.cancel",{defaultValue:"Cancel"})})]}):e.jsx(O,{size:"sm",variant:"ghost",onClick:()=>Ye.startEdit(B.id,B.original),children:Z("datatable.edit",{defaultValue:"Edit"})}),enableSorting:!1,enableHiding:!1};Se.push(ne)}const ja=i.useCallback(async ne=>{try{await wa(ne)}catch(B){console.error("Erreur lors de l'export:",B)}},[wa]),Na=i.useCallback(async()=>{try{const ne=await Ut();console.log("Données importées:",ne)}catch(ne){console.error("Erreur lors de l'import:",ne)}},[Ut]);if(y)return e.jsx("div",{className:"flex items-center justify-center h-64 border rounded-lg",children:e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsx(E.Loader2,{className:"h-8 w-8 animate-spin text-muted-foreground"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:Z("datatable.loading",{defaultValue:"Loading..."})})]})});if(k)return e.jsx("div",{className:"flex items-center justify-center h-64 border rounded-lg bg-destructive/10",children:e.jsxs("div",{className:"flex flex-col items-center gap-2 text-destructive",children:[e.jsx(E.AlertCircle,{className:"h-8 w-8"}),e.jsx("p",{className:"text-sm font-medium",children:k})]})});if(!t||t.length===0)return e.jsxs("div",{className:"flex flex-col",children:[u&&e.jsx(ma,{table:ye,config:u,globalFilter:Oa,onGlobalFilterChange:_a,density:Ne,onDensityChange:le,onExport:R?ja:void 0,onImport:F?Na:void 0}),e.jsx("div",{className:"flex items-center justify-center h-64 border rounded-lg",children:S||e.jsxs("div",{className:"flex flex-col items-center gap-2 text-muted-foreground",children:[e.jsx("p",{className:"text-lg font-medium",children:Z("datatable.noData",{defaultValue:"No data"})}),e.jsx("p",{className:"text-sm",children:Z("datatable.noDataDescription",{defaultValue:"There are no results to display"})})]})})]});const Sa=()=>ot?e.jsx("div",{ref:G,className:"h-full overflow-auto",style:{height:x?.containerHeight||600},children:e.jsxs("table",{className:ae("w-full caption-bottom text-sm",J.table),style:de(),children:[e.jsx("thead",{className:ae(g&&"sticky top-0 bg-background z-10"),children:ye.getHeaderGroups().map(ne=>e.jsx("tr",{className:"border-b",children:ne.headers.map(B=>e.jsxs("th",{className:ae("text-left font-medium text-muted-foreground",J.header,B.column.getCanSort()&&"cursor-pointer select-none hover:text-foreground"),onClick:B.column.getToggleSortingHandler(),style:{width:B.getSize(),minWidth:B.column.columnDef.minSize,maxWidth:B.column.columnDef.maxSize},children:[B.isPlaceholder?null:Ee.flexRender(B.column.columnDef.header,B.getContext()),B.column.getIsSorted()&&e.jsx("span",{className:"ml-2",children:B.column.getIsSorted()==="asc"?"↑":"↓"})]},B.id))},ne.id))}),e.jsx("tbody",{children:Nt.map(ne=>{const we=(c?.columns?.length?ye.getGroupedRowModel().rows:p?.enabled?ye.getExpandedRowModel().rows:ye.getRowModel().rows)[ne.index];return we?e.jsx("tr",{className:ae("border-b transition-colors",P&&"cursor-pointer hover:bg-muted/50",we.getIsSelected()&&"bg-muted"),onClick:()=>P?.(we.original),onDoubleClick:()=>L?.(we.original),style:{position:"absolute",top:ne.start,left:0,width:"100%",height:ne.size},children:we.getVisibleCells().map($e=>{const kt=$e.getValue(),ke=$e.column.id,Te=we.id,re=St.editingRowId===Te,Ct=q?.editableColumns?.find(gt=>gt.field===ke);return Ct&&re?e.jsx("td",{className:ae("align-middle",J.cell),children:e.jsx(Ra,{value:kt,field:ke,config:Ct.config,isEditing:re,onChange:gt=>Ye.updateField(ke,gt),onStartEdit:()=>Ye.startEdit(Te,we.original),onSave:()=>Ye.saveEdit(),onCancel:()=>Ye.cancelEdit()})},$e.id):e.jsx("td",{className:ae("align-middle",J.cell),children:Ee.flexRender($e.column.columnDef.cell,$e.getContext())},$e.id)})},we.id):null})})]})}):e.jsx("div",{className:ae("w-full overflow-auto",I),children:e.jsxs("table",{className:ae("w-full caption-bottom text-sm",J.table),style:de(),children:[e.jsx("thead",{className:ae(g&&"sticky top-0 bg-background z-10"),children:ye.getHeaderGroups().map(ne=>e.jsx("tr",{className:"border-b",children:ne.headers.map(B=>e.jsxs("th",{className:ae("text-left font-medium text-muted-foreground",J.header,B.column.getCanSort()&&"cursor-pointer select-none hover:text-foreground"),onClick:B.column.getToggleSortingHandler(),style:{width:B.getSize(),minWidth:B.column.columnDef.minSize,maxWidth:B.column.columnDef.maxSize},children:[B.isPlaceholder?null:Ee.flexRender(B.column.columnDef.header,B.getContext()),B.column.getIsSorted()&&e.jsx("span",{className:"ml-2",children:B.column.getIsSorted()==="asc"?"↑":"↓"})]},B.id))},ne.id))}),e.jsx("tbody",{children:(()=>{const ne=c?.columns?.length?ye.getGroupedRowModel().rows:p?.enabled?ye.getExpandedRowModel().rows:ye.getRowModel().rows;return console.log("DataTableAdvanced - rendering rows:",{totalRows:ne.length,grouping:c?.columns,rowExpansion:p?.enabled,firstRow:ne[0]}),ne.map((B,we)=>{const $e=B.getIsGrouped(),kt=B.getIsExpanded();return e.jsxs(i.Fragment,{children:[e.jsx("tr",{className:ae("border-b transition-colors",P&&"cursor-pointer hover:bg-muted/50",B.getIsSelected()&&"bg-muted",$e&&"bg-muted/30 font-medium"),onClick:()=>P?.(B.original),onDoubleClick:()=>L?.(B.original),children:B.getVisibleCells().map(ke=>{const Te=ke.getValue(),re=ke.column.id,Ct=B.id,gt=St.editingRowId===Ct,Bt=q?.editableColumns?.find(_e=>_e.field===re);return Bt&>?e.jsx("td",{className:ae("align-middle",J.cell),children:e.jsx(Ra,{value:Te,field:re,config:Bt.config,isEditing:gt,onChange:_e=>Ye.updateField(re,_e),onStartEdit:()=>Ye.startEdit(Ct,B.original),onSave:()=>Ye.saveEdit(),onCancel:()=>Ye.cancelEdit()})},ke.id):e.jsx("td",{className:ae("align-middle",J.cell),children:$e?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:_e=>{_e.stopPropagation(),B.toggleExpanded()},className:"p-1 hover:bg-muted rounded",children:kt?"▼":"▶"}),e.jsxs("span",{className:"font-medium",children:[ke.getValue()," (",B.subRows.length," éléments)"]})]}):Ee.flexRender(ke.column.columnDef.cell,ke.getContext())},ke.id)})}),p?.enabled&&kt&&e.jsx("tr",{children:e.jsx("td",{colSpan:Se.length,className:"p-0",children:e.jsx("div",{className:"border-b",children:p.renderExpanded?.(B.original)})})},`${B.id}-expanded-${we}`)]},`${B.id}-${we}`)})})()})]})});return e.jsxs("div",{className:ae("w-full",H),style:de(),children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[u&&e.jsx("div",{className:"flex-1",children:e.jsx(ma,{table:ye,config:u,globalFilter:Oa,onGlobalFilterChange:_a,density:Ne,onDensityChange:le,onExport:R?ja:void 0,onImport:F?Na:void 0})}),o&&e.jsx(Zr,{table:ye,filters:o,position:d,onFiltersChange:V})]}),Sa(),h&&e.jsx(Kr,{table:ye,pageSizeOptions:h.pageSizeOptions})]})}function Gh({header:t,column:a,className:r}){const[s,n]=i.useState(!1),o=i.useCallback(d=>{d.preventDefault(),d.stopPropagation(),n(!0);const u=d.clientX,h=a.getSize(),m=f=>{const y=f.clientX-u,k=Math.max(50,h+y);a.setSize(k)},v=()=>{n(!1),document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",v)};document.addEventListener("mousemove",m),document.addEventListener("mouseup",v)},[a]);return a.getCanResize()?e.jsx("div",{className:ae("absolute right-0 top-0 h-full w-1 cursor-col-resize bg-border opacity-0 hover:opacity-100 transition-opacity",s&&"opacity-100 bg-primary",r),onMouseDown:o,style:{width:"4px",marginRight:"-2px"}}):null}function Xh({row:t,table:a,className:r}){const[s,n]=i.useState(t.getIsExpanded()),o=i.useCallback(()=>{n(!s),t.toggleExpanded()},[s,t]);t.getValue(t.groupingColumnId);const d=t.subRows.length;return e.jsxs("div",{className:ae("flex items-center gap-2 py-2",r),children:[e.jsx(O,{variant:"ghost",size:"sm",onClick:o,className:"h-6 w-6 p-0",children:s?e.jsx(E.ChevronDown,{className:"h-4 w-4"}):e.jsx(E.ChevronRight,{className:"h-4 w-4"})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium",children:Ee.flexRender(t.groupingColumn.columnDef.cell,t.getGroupingValue())}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:["(",d," ",d===1?"item":"items",")"]})]})]})}function Jh({row:t,table:a,className:r}){const s=t.getAggregationValue();return s?e.jsx("div",{className:ae("flex items-center gap-4 py-2 bg-muted/50",r),children:Object.entries(s).map(([n,o])=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-sm font-medium",children:[n,":"]}),e.jsx("span",{className:"text-sm text-muted-foreground",children:typeof o=="number"?o.toLocaleString():String(o)})]},n))}):null}function Yh({table:t,groupingColumns:a,onGroupingChange:r,className:s}){const[n,o]=i.useState(a),d=i.useCallback(h=>{const m=n.includes(h)?n.filter(v=>v!==h):[...n,h];o(m),r(m)},[n,r]),u=i.useCallback(()=>{o([]),r([])},[r]);return e.jsxs("div",{className:ae("flex items-center gap-2",s),children:[e.jsx("span",{className:"text-sm font-medium",children:"Group by:"}),t.getAllColumns().filter(h=>h.getCanGroup()).map(h=>e.jsx(O,{variant:n.includes(h.id)?"default":"outline",size:"sm",onClick:()=>d(h.id),children:h.columnDef.header},h.id)),n.length>0&&e.jsx(O,{variant:"ghost",size:"sm",onClick:u,children:"Clear"})]})}function Kh({row:t,rowIndex:a,actions:r=[],columnActions:s=[],onCopy:n,onExport:o,onEdit:d,onDelete:u,onToggleColumnVisibility:h,visibleColumns:m=[],className:v,children:f}){const[y,k]=i.useState(!1),S=i.useCallback(p=>{p.onClick(t),k(!1)},[t]),g=i.useCallback(()=>{if(n)n(t);else{const p=Object.entries(t).map(([x,N])=>`${x}: ${N}`).join(`
|
|
72
|
-
`);navigator.clipboard.writeText(p)}k(!1)},[t,n]),w=i.useCallback(()=>{o&&o(t),k(!1)},[t,o]),b=i.useCallback(()=>{d&&d(t),k(!1)},[t,d]),l=i.useCallback(()=>{u&&u(t),k(!1)},[t,u]),c=i.useCallback(p=>{h&&h(p),k(!1)},[h]);return e.jsxs(jn,{onOpenChange:k,children:[e.jsx(Nn,{asChild:!0,children:f}),e.jsxs(Cr,{className:ae("w-64",v),children:[r.length>0&&e.jsxs(e.Fragment,{children:[r.map(p=>e.jsxs(it,{onClick:()=>S(p),disabled:p.disabled,className:ae(p.destructive&&"text-destructive focus:text-destructive"),children:[p.icon&&e.jsx("span",{className:"mr-2",children:p.icon}),p.label]},p.id)),e.jsx(Kt,{})]}),e.jsxs(it,{onClick:g,children:[e.jsx(E.Copy,{className:"mr-2 h-4 w-4"}),"Copy row"]}),o&&e.jsxs(it,{onClick:w,children:[e.jsx(E.Download,{className:"mr-2 h-4 w-4"}),"Export row"]}),d&&e.jsxs(it,{onClick:b,children:[e.jsx(E.Edit,{className:"mr-2 h-4 w-4"}),"Edit row"]}),u&&e.jsxs(it,{onClick:l,className:"text-destructive focus:text-destructive",children:[e.jsx(E.Trash2,{className:"mr-2 h-4 w-4"}),"Delete row"]}),s.length>0&&e.jsxs(e.Fragment,{children:[e.jsx(Kt,{}),e.jsx("div",{className:"px-2 py-1.5 text-sm font-semibold text-muted-foreground",children:"Columns"}),s.map(p=>e.jsxs(it,{onClick:()=>c(p.id),disabled:p.disabled,children:[p.icon&&e.jsx("span",{className:"mr-2",children:p.icon}),p.label]},p.id))]}),h&&m.length>0&&e.jsxs(e.Fragment,{children:[e.jsx(Kt,{}),e.jsx("div",{className:"px-2 py-1.5 text-sm font-semibold text-muted-foreground",children:"Toggle Columns"}),m.map(p=>e.jsxs(it,{onClick:()=>c(p),children:[e.jsx(E.Eye,{className:"mr-2 h-4 w-4"}),p]},p))]})]})]})}function Zh({table:t,selectionMode:a="multiple",selectedRows:r,onSelectionChange:s,selectionActions:n=[],className:o}){const[d,u]=i.useState(null);i.useCallback((y,k)=>{if(a==="single"){t.setRowSelection({[y]:k});return}if(a==="range"&&d!==null){const S=Math.min(d,y),g=Math.max(d,y),w={...t.getState().rowSelection};for(let b=S;b<=g;b++)w[b]=k;t.setRowSelection(w)}else t.setRowSelection(S=>({...S,[y]:k}));u(y)},[t,a,d]);const h=i.useCallback(y=>{if(y){const k=t.getRowModel().rows.reduce((S,g,w)=>(S[w]=!0,S),{});t.setRowSelection(k)}else t.setRowSelection({})},[t]);i.useCallback((y,k,S)=>{const g={...t.getState().rowSelection};for(let w=y;w<=k;w++)g[w]=S;t.setRowSelection(g)},[t]),i.useCallback(y=>{const k={...t.getState().rowSelection};t.getRowModel().rows.forEach((S,g)=>{y(S.original)&&(k[g]=!0)}),t.setRowSelection(k)},[t]);const m=i.useCallback(y=>{y.onClick(r)},[r]),v=t.getIsAllPageRowsSelected(),f=t.getIsSomePageRowsSelected();return e.jsxs("div",{className:ae("flex items-center gap-2",o),children:[e.jsx(at,{checked:v,onCheckedChange:h,ref:y=>{y&&"indeterminate"in y&&(y.indeterminate=f&&!v)},"aria-label":"Select all rows"}),r.length>0&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsxs("span",{children:[r.length," selected"]}),e.jsx("div",{className:"flex items-center gap-1",children:n.map(y=>e.jsxs(O,{variant:"ghost",size:"sm",onClick:()=>m(y),disabled:y.disabled,className:ae(y.destructive&&"text-destructive hover:text-destructive"),children:[y.icon&&e.jsx("span",{className:"mr-1",children:y.icon}),y.label]},y.id))})]}),e.jsxs(ut,{onValueChange:y=>{switch(y){case"all":h(!0);break;case"none":h(!1);break;case"invert":t.getRowModel().rows.forEach((k,S)=>{const g=t.getState().rowSelection[S];t.setRowSelection(w=>({...w,[S]:!g}))});break}},children:[e.jsx(rt,{className:"w-32",children:e.jsx(mt,{placeholder:"Select"})}),e.jsxs(st,{children:[e.jsx(Qe,{value:"all",children:"Select All"}),e.jsx(Qe,{value:"none",children:"Select None"}),e.jsx(Qe,{value:"invert",children:"Invert Selection"})]})]})]})}function Qh({table:t,selectionMode:a="multiple",onSelectionChange:r}){const[s,n]=i.useState([]);i.useEffect(()=>{const v=t.getFilteredSelectedRowModel().rows.map(f=>f.original);n(v),r?.(v)},[t,r]);const o=i.useCallback((v,f=!0)=>{t.setRowSelection(y=>({...y,[v]:f}))},[t]),d=i.useCallback((v=!0)=>{if(v){const f=t.getRowModel().rows.reduce((y,k,S)=>(y[S]=!0,y),{});t.setRowSelection(f)}else t.setRowSelection({})},[t]),u=i.useCallback((v,f,y=!0)=>{const k={...t.getState().rowSelection};for(let S=v;S<=f;S++)k[S]=y;t.setRowSelection(k)},[t]),h=i.useCallback(v=>{const f={...t.getState().rowSelection};t.getRowModel().rows.forEach((y,k)=>{v(y.original)&&(f[k]=!0)}),t.setRowSelection(f)},[t]),m=i.useCallback(()=>{t.setRowSelection({})},[t]);return{selectedRows:s,selectRow:o,selectAll:d,selectRange:u,selectByCriteria:h,clearSelection:m,isAllSelected:t.getIsAllPageRowsSelected(),isSomeSelected:t.getIsSomePageRowsSelected()}}const di=i.createContext(void 0);function ui({children:t,languages:a,defaultLanguage:r="fr",s3Config:s,onLanguageChange:n}){const{i18n:o}=et.useTranslation(),[d,u]=i.useState(r),[h,m]=i.useState(!0),[v,f]=i.useState(new Set),[y,k]=i.useState(!1),S=i.useCallback(async b=>{if(!s)throw new Error("S3 configuration not provided");const{baseUrl:l,prefix:c="",extension:p="json",headers:x={}}=s,N=`${l.replace(/\/$/,"")}/${c}${b}.${p}`;console.log(`[LanguageProvider] Loading translations from S3: ${N}`);try{const R=await fetch(N,{headers:{Accept:"application/json",...x}});if(!R.ok)throw new Error(`Failed to load translations: ${R.status} ${R.statusText}`);const F=await R.json();return console.log(`[LanguageProvider] ✓ Translations loaded for ${b}`),F}catch(R){throw console.error(`[LanguageProvider] ✗ Error loading translations for ${b}:`,R),R}},[s]);i.useEffect(()=>{if(y||!o||!s)return;(async()=>{try{const l=typeof window<"u"?localStorage.getItem("language"):null,c=l&&a.some(x=>x.code===l)?l:r;console.log(`[LanguageProvider] Initializing with language: ${c}`);const p=await S(c);o.addResourceBundle&&o.addResourceBundle(c,"translation",p,!0,!0),await o.changeLanguage(c),u(c),f(new Set([c])),k(!0),console.log(`[LanguageProvider] ✓ Initialized with ${c}`)}catch(l){console.error("[LanguageProvider] Error initializing:",l),k(!0)}finally{m(!1)}})()},[y,o,s,r,a,S]);const g=i.useCallback(async b=>{if(b!==d){if(!o?.changeLanguage){console.error("[LanguageProvider] i18next is not initialized");return}if(!s){console.error("[LanguageProvider] S3 config not provided");return}m(!0);try{if(!v.has(b)){console.log(`[LanguageProvider] Loading ${b} from S3...`);const l=await S(b);o.addResourceBundle&&o.addResourceBundle(b,"translation",l,!0,!0),f(c=>new Set([...c,b]))}await o.changeLanguage(b),u(b),typeof window<"u"&&localStorage.setItem("language",b),n?.(b),console.log(`[LanguageProvider] ✓ Language changed to: ${b}`)}catch(l){throw console.error("[LanguageProvider] ✗ Error changing language:",l),l}finally{m(!1)}}},[d,v,s,S,o,n]),w={currentLanguage:d,languages:a,changeLanguage:g,isLoading:h,loadedLanguages:v};return e.jsx(di.Provider,{value:w,children:t})}function Qr(){const t=i.useContext(di);if(!t)throw new Error("useLanguage must be used within a LanguageProvider");return t}const mi=i.createContext(void 0);function ep({children:t,config:a}){const{defaultTheme:r="light",storageKey:s="waka-ui-theme",themes:n,enableSystem:o=!0,s3Config:d}=a||{},[u,h]=i.useState(r),[m,v]=i.useState(),[f,y]=i.useState([]),[k,S]=i.useState(!0),[g,w]=i.useState("fallback");i.useEffect(()=>{(async()=>{if(S(!0),n&&n.length>0){const x=tp(n);y(x),w("config"),S(!1),console.log("[ThemeProvider] Using themes from config:",x.length);return}if(d?.baseUrl)try{const x=await ap(d.baseUrl);if(x.length>0){y(x),w("s3"),S(!1),console.log("[ThemeProvider] Loaded themes from S3:",x.length);return}}catch(x){console.error("[ThemeProvider] Failed to load themes from S3:",x)}y([{id:"light",label:"Clair",previewColor:"#3b82f6"},{id:"dark",label:"Sombre",previewColor:"#1e293b"}]),w("fallback"),S(!1),console.log("[ThemeProvider] Using fallback themes")})()},[n,d]),i.useEffect(()=>{if(!o)return;const c=window.matchMedia("(prefers-color-scheme: dark)"),p=x=>{v(x.matches?"dark":"light")};return v(c.matches?"dark":"light"),c.addEventListener("change",p),()=>c.removeEventListener("change",p)},[o]),i.useEffect(()=>{if(f.length===0)return;const c=localStorage.getItem(s),p=f.map(x=>x.id);c&&p.includes(c)&&h(c)},[s,f]),i.useEffect(()=>{if(f.length===0)return;const c=document.documentElement,p=u==="system"&&m?m:u;f.forEach(x=>c.classList.remove(x.id)),c.classList.add(p),c.setAttribute("data-theme",p),process.env.NODE_ENV==="development"&&console.log(`[WakaUI] Theme applied: ${p}`)},[u,m,f]);const b=i.useCallback(c=>{const p=f.map(x=>x.id);if(!p.includes(c)&&c!=="system"){console.warn(`[WakaUI] Theme "${c}" is not in the list of available themes:`,p);return}h(c),localStorage.setItem(s,c)},[f,s]),l=i.useMemo(()=>({theme:u,setTheme:b,themes:f,systemTheme:m,isLoadingThemes:k,themesSource:g}),[u,b,f,m,k,g]);return e.jsx(mi.Provider,{value:l,children:t})}function tp(t){return t.length===0?[]:typeof t[0]=="string"?t.map(a=>({id:a,label:rp(a),previewColor:sp(a)})):t}async function ap(t){try{const a=await fetch("/api/themes/list",{cache:"no-store"});if(!a.ok)throw new Error(`HTTP ${a.status}`);return(await a.json()).themes||[]}catch(a){return console.error("[ThemeProvider] Failed to fetch themes from S3:",a),[]}}function rp(t){return t.split("-").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" ")}function sp(t){return{light:"#3b82f6",dark:"#1e293b",forest:"#10b981",sunset:"#f59e0b",twilight:"#8b5cf6",monochrome:"#6b7280",perpetuity:"#ec4899"}[t]||"#3b82f6"}function np(){const t=i.useContext(mi);if(!t)throw new Error("useTheme must be used within a ThemeProvider");return t}function op({children:t,config:a}){const[r]=i.useState(()=>lt.createInstance()),[s,n]=i.useState(!1);return i.useEffect(()=>{(async()=>{try{await r.use(et.initReactI18next).init({lng:a.language.defaultLanguage,fallbackLng:a.language.defaultLanguage,supportedLngs:a.language.supportedLanguages,resources:a.language.resources||{},interpolation:{escapeValue:!1},react:{useSuspense:!1},debug:a.debug}),a.language.s3Config&&await ip(r,a.language.s3Config,a.language.supportedLanguages),n(!0),a.debug&&console.log("[WakaUI] i18n initialized successfully")}catch(d){console.error("[WakaUI] Failed to initialize i18n:",d),n(!0)}})()},[r,a]),i.useEffect(()=>{if(!s)return;const o=a.language.storageKey||"waka-ui-language",d=localStorage.getItem(o);d&&a.language.supportedLanguages.includes(d)&&r.changeLanguage(d);const u=h=>{localStorage.setItem(o,h),a.debug&&console.log(`[WakaUI] Language changed to: ${h}`)};return r.on("languageChanged",u),()=>{r.off("languageChanged",u)}},[s,r,a]),s?e.jsx(et.I18nextProvider,{i18n:r,children:e.jsx(ui,{languages:a.language.languages||[],defaultLanguage:a.language.defaultLanguage,s3Config:a.language.s3Config?{baseUrl:a.language.s3Config.bucketUrl,prefix:a.language.s3Config.translationsPath?`${a.language.s3Config.translationsPath}/`:"",extension:"json"}:void 0,children:e.jsx(Do,{themes:a.theme?.themes||[{id:"default",label:"Default"}],defaultTheme:a.theme?.defaultTheme||"default",s3Config:a.theme?.s3Config,enableDarkMode:a.theme?.enableSystem,children:t})})}):e.jsx("div",{style:{padding:"20px",textAlign:"center"},children:"Loading WakaUI..."})}async function ip(t,a,r){if(!a)return;const{bucketUrl:s,translationsPath:n="translations"}=a;try{await Promise.all(r.map(async o=>{try{const d=`${s}/${n}/${o}.json`,u=await fetch(d);if(!u.ok){console.warn(`[WakaUI] Failed to load translations for ${o} from S3`);return}const h=await u.json();t.addResourceBundle(o,"translation",h,!0,!0),process.env.NODE_ENV==="development"&&console.log(`[WakaUI] Loaded translations for ${o} from S3`)}catch(d){console.warn(`[WakaUI] Error loading translations for ${o}:`,d)}}))}catch(o){console.error("[WakaUI] Error loading translations from S3:",o)}}function lp(){const{i18n:t,t:a}=et.useTranslation(),r=Qr(),s=ga();return{currentLanguage:t.language||r.currentLanguage,changeLanguage:async n=>{await r.changeLanguage(n),await t.changeLanguage(n)},languages:r.languages,isLanguageLoading:r.isLoading,currentTheme:s.currentTheme,changeTheme:s.changeTheme,themes:s.themes,isThemeLoading:s.isLoading,preloadTheme:s.preloadTheme,isThemeLoaded:s.isThemeLoaded,t:a}}const es=i.createContext(void 0);function cp({children:t,initialSelection:a,onSelectionChange:r,persistKey:s="admincrumb-selection"}){const[n,o]=i.useState(()=>{if(typeof window<"u"&&s){const k=localStorage.getItem(s);if(k)try{return JSON.parse(k)}catch(S){console.error("Failed to parse stored admincrumb selection",S)}}return a||{}});i.useEffect(()=>{typeof window<"u"&&s&&localStorage.setItem(s,JSON.stringify(n))},[n,s]),i.useEffect(()=>{r?.(n)},[n,r]);const d=i.useCallback(k=>{o({partner:k,network:void 0,customer:void 0})},[]),u=i.useCallback(k=>{o(S=>({...S,network:k,customer:void 0}))},[]),h=i.useCallback(k=>{o(S=>({...S,customer:k}))},[]),m=i.useCallback(()=>{o({})},[]),v=i.useMemo(()=>!!(n.partner||n.network||n.customer),[n]),f=i.useCallback(()=>({...n.partner?.id&&{partnerId:n.partner.id},...n.network?.id&&{networkId:n.network.id},...n.customer?.id&&{customerId:n.customer.id}}),[n]),y=i.useMemo(()=>({selection:n,setPartner:d,setNetwork:u,setCustomer:h,reset:m,isFiltered:v,getFilterQuery:f}),[n,d,u,h,m,v,f]);return e.jsx(es.Provider,{value:y,children:t})}function dp(){const t=i.useContext(es);if(!t)throw new Error("useAdmincrumbContext must be used within AdmincrumbProvider");return t}function up(){return i.useContext(es)}const mp={github:E.Github,twitter:E.Twitter,linkedin:E.Linkedin,email:E.Mail};function fp({columns:t=[],socialLinks:a=[],copyright:r="© 2024 Tous droits réservés.",className:s}){return e.jsx("footer",{className:j("bg-muted/40",s),children:e.jsxs("div",{className:"container mx-auto px-4 py-12",children:[e.jsxs("div",{className:"grid grid-cols-1 gap-8 md:grid-cols-2 lg:grid-cols-4",children:[t.map((n,o)=>e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-foreground",children:n.title}),e.jsx("ul",{className:"space-y-2",children:n.links.map((d,u)=>e.jsx("li",{children:e.jsx("a",{href:d.href,className:"text-sm text-muted-foreground hover:text-foreground transition-colors",children:d.label})},u))})]},o)),a.length>0&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Suivez-nous"}),e.jsx("div",{className:"flex space-x-4",children:a.map((n,o)=>{const d=mp[n.platform];return e.jsx(O,{variant:"ghost",size:"icon",asChild:!0,className:"h-8 w-8",children:e.jsx("a",{href:n.url,target:"_blank",rel:"noopener noreferrer","aria-label":n.platform,children:e.jsx(d,{className:"h-4 w-4"})})},o)})})]})]}),e.jsx($t,{className:"my-8"}),e.jsxs("div",{className:"flex flex-col items-center justify-between space-y-4 md:flex-row md:space-y-0",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:r}),e.jsxs("div",{className:"flex space-x-6",children:[e.jsx("a",{href:"/privacy",className:"text-sm text-muted-foreground hover:text-foreground transition-colors",children:"Politique de confidentialité"}),e.jsx("a",{href:"/terms",className:"text-sm text-muted-foreground hover:text-foreground transition-colors",children:"Conditions d'utilisation"})]})]})]})})}function hp({items:t,defaultActiveId:a,variant:r="default",size:s="md",className:n,onTabChange:o}){const[d,u]=i.useState(a||t[0]?.id||""),h=f=>{u(f),o?.(f)},m={sm:"h-8 px-3 text-sm",md:"h-10 px-4 text-sm",lg:"h-12 px-6 text-base"},v={default:"bg-background",pills:"bg-muted rounded-full",underline:"bg-transparent border-b-2 border-transparent data-[state=active]:border-primary"};return e.jsx("div",{className:j("w-full",n),children:e.jsxs(Vr,{value:d,onValueChange:h,children:[e.jsx(Ia,{className:j("grid w-full",r==="pills"&&"grid-cols-auto",r!=="pills"&&`grid-cols-${t.length}`,v[r]),children:t.map(f=>e.jsx(da,{value:f.id,disabled:f.disabled,className:j(m[s],r==="underline"&&"rounded-none border-b-2 border-transparent data-[state=active]:border-primary",r==="pills"&&"rounded-full"),children:f.label},f.id))}),t.map(f=>e.jsx(ua,{value:f.id,className:"mt-6",children:f.content},f.id))]})})}function pp({variant:t="dropdown",showFlags:a=!0,className:r}){const{currentLanguage:s,languages:n,changeLanguage:o,isLoading:d}=Qr(),u=n.find(h=>h.code===s);return t==="select"?e.jsxs(ut,{value:s,onValueChange:o,disabled:d,children:[e.jsx(rt,{className:j("w-[180px]",r),children:e.jsxs(mt,{children:[a&&u?.flagEmoji&&e.jsx("span",{className:"mr-2",children:u.flagEmoji}),u?.label]})}),e.jsx(st,{children:n.map(h=>e.jsxs(Qe,{value:h.code,children:[a&&h.flagEmoji&&e.jsx("span",{className:"mr-2",children:h.flagEmoji}),h.label]},h.code))})]}):e.jsxs(Zt,{children:[e.jsx(Qt,{asChild:!0,children:e.jsxs(O,{variant:"outline",size:"sm",className:j("gap-2",r),disabled:d,children:[e.jsx(E.Globe,{className:"h-4 w-4"}),a&&u?.flagEmoji&&e.jsx("span",{children:u.flagEmoji}),u?.label]})}),e.jsx(Lt,{align:"end",children:n.map(h=>e.jsxs(Tr,{onClick:()=>o(h.code),className:"cursor-pointer",children:[a&&h.flagEmoji&&e.jsx("span",{className:"mr-2",children:h.flagEmoji}),h.label]},h.code))})]})}function gp({children:t,header:a,sidebar:r,footer:s,collapsible:n=!1,className:o}){const[d,u]=i.useState(!1);return e.jsxs("div",{className:j("min-h-screen bg-background",o),children:[a&&e.jsx("header",{className:"sticky top-0 z-50 w-full border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:e.jsxs("div",{className:"container flex h-14 max-w-screen-2xl items-center",children:[n&&r&&e.jsxs(Ar,{open:d,onOpenChange:u,children:[e.jsx(Fr,{asChild:!0,children:e.jsxs(O,{variant:"ghost",size:"icon",className:"md:hidden",children:[e.jsx(E.Menu,{className:"h-5 w-5"}),e.jsx("span",{className:"sr-only",children:"Ouvrir le menu"})]})}),e.jsx(La,{side:"left",className:"w-72 p-0",children:e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between p-4",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Navigation"}),e.jsx(O,{variant:"ghost",size:"icon",onClick:()=>u(!1),children:e.jsx(E.X,{className:"h-4 w-4"})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:r})]})})]}),a]})}),e.jsxs("div",{className:"flex",children:[r&&!n&&e.jsx("aside",{className:"hidden w-64 border-r bg-muted/40 md:block",children:e.jsx("div",{className:"h-full overflow-y-auto p-4",children:r})}),e.jsx("main",{className:"flex-1",children:e.jsx("div",{className:"container mx-auto p-4",children:t})})]}),s&&e.jsx("footer",{className:"border-t bg-muted/40",children:e.jsx("div",{className:"container mx-auto p-4",children:s})})]})}function bp({config:t,onSubmit:a,onForgotPassword:r,onSignUp:s,onSSOGoogle:n,onSSOMicrosoft:o,onSSOApple:d,onSSOLinkedIn:u,onSSOGithub:h,onSSOFacebook:m,onSSOInstagram:v,onSSOFranceConnect:f,showSocialLogin:y=!1,className:k}){let S=!1;try{S=ga().isDarkMode}catch{}const g=t?.theme_json?.dark_mode??S,[w,b]=i.useState({email:"",password:"",rememberMe:!1}),[l,c]=i.useState(!1),p=i.useMemo(()=>t?.assets?g?t.assets.theme_logo_dark:t.assets.theme_logo_light:null,[t?.assets,g]),x=i.useMemo(()=>t?.color_json?{"--login-primary":t.color_json.primary,"--login-secondary":t.color_json.secondary,"--login-accent":t.color_json.accent}:{},[t?.color_json]),N=i.useMemo(()=>{const T=[];if(!t?.signup_options)return y&&(h&&T.push({id:"github",label:"GitHub",icon:e.jsx(E.Github,{className:"h-4 w-4"}),onClick:h}),n&&T.push({id:"google",label:"Google",icon:e.jsx(E.Mail,{className:"h-4 w-4"}),onClick:n})),T;const P=t.signup_options;return P.allow_sso_google&&T.push({id:"google",label:"Google",icon:e.jsx(E.Mail,{className:"h-4 w-4"}),onClick:n}),P.allow_sso_microsoft&&T.push({id:"microsoft",label:"Microsoft",icon:e.jsx(E.Mail,{className:"h-4 w-4"}),onClick:o}),P.allow_sso_apple&&T.push({id:"apple",label:"Apple",icon:e.jsx(E.Apple,{className:"h-4 w-4"}),onClick:d}),P.allow_sso_linkedIn&&T.push({id:"linkedin",label:"LinkedIn",icon:e.jsx(E.Linkedin,{className:"h-4 w-4"}),onClick:u}),P.allow_sso_github&&T.push({id:"github",label:"GitHub",icon:e.jsx(E.Github,{className:"h-4 w-4"}),onClick:h}),P.allow_sso_facebook&&T.push({id:"facebook",label:"Facebook",icon:e.jsx(E.Facebook,{className:"h-4 w-4"}),onClick:m}),P.allow_sso_instagram&&T.push({id:"instagram",label:"Instagram",icon:e.jsx(E.Instagram,{className:"h-4 w-4"}),onClick:v}),P.allow_sso_france_connect&&T.push({id:"france-connect",label:"France Connect",icon:e.jsx(E.Mail,{className:"h-4 w-4"}),onClick:f}),T},[t?.signup_options,y,n,o,d,u,h,m,v,f]),R=t?.signup_options?.allow_login!==!1,F=async T=>{T.preventDefault(),c(!0);try{await a?.(w)}finally{c(!1)}},D=T=>P=>{b(L=>({...L,[T]:T==="rememberMe"?P.target.checked:P.target.value}))};return e.jsx("div",{className:j("flex items-center justify-center p-4",k),style:x,children:e.jsxs(Ve,{className:"w-full max-w-md",children:[e.jsxs(Ke,{className:"space-y-1",children:[p&&e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx("img",{src:p,alt:t?.theme_json?.name||"Logo",className:"max-h-16 max-w-full object-contain"})}),e.jsx(We,{className:"text-2xl text-center",children:"Connexion"}),e.jsx(Dt,{className:"text-center",children:"Entrez vos identifiants pour accéder à votre compte"})]}),e.jsxs(Ze,{className:"space-y-4",children:[N.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:j("grid gap-4",N.length===1?"grid-cols-1":"grid-cols-2"),children:N.map(T=>e.jsxs(O,{variant:"outline",className:"w-full",onClick:T.onClick,type:"button",children:[T.icon,T.label]},T.id))}),R&&e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx($t,{className:"w-full"})}),e.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:e.jsx("span",{className:"bg-background px-2 text-muted-foreground",children:"Ou continuez avec"})})]})]}),R&&e.jsxs("form",{onSubmit:F,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(ge,{htmlFor:"email",children:"Email"}),e.jsx(fe,{id:"email",type:"email",placeholder:"votre@email.com",value:w.email,onChange:D("email"),required:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ge,{htmlFor:"password",children:"Mot de passe"}),e.jsx(fe,{id:"password",type:"password",placeholder:"••••••••",value:w.password,onChange:D("password"),required:!0})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("input",{id:"remember",type:"checkbox",checked:w.rememberMe,onChange:D("rememberMe"),className:"h-4 w-4 rounded border-gray-300"}),e.jsx(ge,{htmlFor:"remember",className:"text-sm",children:"Se souvenir de moi"})]}),r&&e.jsx(O,{type:"button",variant:"link",className:"px-0 text-sm",onClick:r,children:"Mot de passe oublié ?"})]}),e.jsx(O,{type:"submit",className:"w-full",disabled:l,style:t?.color_json?.primary?{backgroundColor:t.color_json.primary,color:t.color_json.secondary}:void 0,children:l?"Connexion...":"Se connecter"})]}),s&&e.jsxs("div",{className:"text-center text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"Pas encore de compte ? "}),e.jsx(O,{type:"button",variant:"link",className:"px-0 text-sm",onClick:s,children:"S'inscrire"})]}),t?.waka_powered&&e.jsx("div",{className:"text-center text-xs text-muted-foreground mt-4 pt-4 border-t",children:"Powered by Waka"})]})]})})}exports.Accordion=fl;exports.AccordionContent=qs;exports.AccordionItem=Ws;exports.AccordionTrigger=Hs;exports.AdmincrumbProvider=cp;exports.Alert=Gs;exports.AlertDescription=Js;exports.AlertDialog=Us;exports.AlertDialogAction=pr;exports.AlertDialogCancel=gr;exports.AlertDialogContent=dr;exports.AlertDialogDescription=hr;exports.AlertDialogFooter=mr;exports.AlertDialogHeader=ur;exports.AlertDialogOverlay=cr;exports.AlertDialogPortal=Bs;exports.AlertDialogTitle=fr;exports.AlertDialogTrigger=hl;exports.AlertTitle=Xs;exports.AspectRatio=gl;exports.Avatar=Ys;exports.AvatarFallback=Zs;exports.AvatarImage=Ks;exports.Badge=He;exports.BlockLanguageSelector=pp;exports.Blockquote=Ho;exports.Button=O;exports.Calendar=br;exports.Card=Ve;exports.CardContent=Ze;exports.CardDescription=Dt;exports.CardFooter=en;exports.CardHeader=Ke;exports.CardTitle=We;exports.Checkbox=at;exports.Code=fn;exports.Collapsible=Mf;exports.CollapsibleContent=$f;exports.CollapsibleTrigger=Rf;exports.Command=_t;exports.CommandDialog=Lf;exports.CommandEmpty=ia;exports.CommandGroup=la;exports.CommandInput=oa;exports.CommandItem=ca;exports.CommandList=kr;exports.CommandSeparator=yn;exports.CommandShortcut=wn;exports.ContextMenu=jn;exports.ContextMenuCheckboxItem=Cn;exports.ContextMenuContent=Cr;exports.ContextMenuGroup=If;exports.ContextMenuItem=it;exports.ContextMenuLabel=En;exports.ContextMenuPortal=Of;exports.ContextMenuRadioGroup=zf;exports.ContextMenuRadioItem=Tn;exports.ContextMenuSeparator=Kt;exports.ContextMenuShortcut=Pn;exports.ContextMenuSub=_f;exports.ContextMenuSubContent=kn;exports.ContextMenuSubTrigger=Sn;exports.ContextMenuTrigger=Nn;exports.DataTable=Wh;exports.DataTableAdvanced=Bh;exports.DataTableColumnResizer=Gh;exports.DataTableContextMenu=Kh;exports.DataTableEditCell=Ra;exports.DataTableFilters=Zr;exports.DataTableGroupTotals=Jh;exports.DataTableGrouping=Xh;exports.DataTableGroupingControls=Yh;exports.DataTablePagination=Kr;exports.DataTableSelection=Zh;exports.DataTableToolbar=ma;exports.Dialog=hn;exports.DialogClose=Ff;exports.DialogContent=Sr;exports.DialogDescription=vn;exports.DialogFooter=bn;exports.DialogHeader=gn;exports.DialogOverlay=Nr;exports.DialogPortal=pn;exports.DialogTitle=xn;exports.DialogTrigger=Af;exports.DropdownMenu=Zt;exports.DropdownMenuCheckboxItem=Tt;exports.DropdownMenuContent=Lt;exports.DropdownMenuGroup=Vf;exports.DropdownMenuItem=Tr;exports.DropdownMenuLabel=ea;exports.DropdownMenuPortal=Wf;exports.DropdownMenuRadioGroup=qf;exports.DropdownMenuRadioItem=Rn;exports.DropdownMenuSeparator=ta;exports.DropdownMenuShortcut=$n;exports.DropdownMenuSub=Hf;exports.DropdownMenuSubContent=Mn;exports.DropdownMenuSubTrigger=Dn;exports.DropdownMenuTrigger=Qt;exports.Footer=fp;exports.Form=nh;exports.FormControl=qn;exports.FormDescription=Un;exports.FormField=oh;exports.FormItem=Wn;exports.FormLabel=Hn;exports.FormMessage=Bn;exports.Heading=Vo;exports.Headtab=hp;exports.HoverCard=ih;exports.HoverCardContent=Gn;exports.HoverCardTrigger=lh;exports.Input=fe;exports.InputOTP=Xn;exports.Kbd=Uo;exports.Label=ge;exports.LanguageProvider=ui;exports.LanguageSelector=dh;exports.Layout=gp;exports.LegacyThemeProvider=ep;exports.Login=bp;exports.Menubar=Kn;exports.MenubarCheckboxItem=ro;exports.MenubarContent=to;exports.MenubarGroup=mh;exports.MenubarItem=ao;exports.MenubarLabel=no;exports.MenubarMenu=uh;exports.MenubarPortal=fh;exports.MenubarRadioGroup=ph;exports.MenubarRadioItem=so;exports.MenubarSeparator=oo;exports.MenubarShortcut=io;exports.MenubarSub=hh;exports.MenubarSubContent=eo;exports.MenubarSubTrigger=Qn;exports.MenubarTrigger=Zn;exports.NavigationMenu=lo;exports.NavigationMenuContent=fo;exports.NavigationMenuIndicator=ho;exports.NavigationMenuItem=gh;exports.NavigationMenuLink=bh;exports.NavigationMenuList=co;exports.NavigationMenuTrigger=mo;exports.NavigationMenuViewport=Rr;exports.Popover=xt;exports.PopoverContent=dt;exports.PopoverTrigger=vt;exports.Progress=po;exports.RadioGroup=go;exports.RadioGroupItem=bo;exports.ScrollArea=It;exports.ScrollBar=$r;exports.Select=ut;exports.SelectContent=st;exports.SelectGroup=ch;exports.SelectItem=Qe;exports.SelectLabel=Jn;exports.SelectScrollDownButton=Mr;exports.SelectScrollUpButton=Dr;exports.SelectSeparator=Yn;exports.SelectTrigger=rt;exports.SelectValue=mt;exports.Separator=$t;exports.Sheet=Ar;exports.SheetClose=xh;exports.SheetContent=La;exports.SheetDescription=_r;exports.SheetFooter=vo;exports.SheetHeader=Ir;exports.SheetOverlay=Lr;exports.SheetPortal=xo;exports.SheetTitle=Or;exports.SheetTrigger=Fr;exports.Skeleton=yh;exports.Slider=yo;exports.Switch=zr;exports.Table=wo;exports.TableBody=No;exports.TableCaption=Eo;exports.TableCell=To;exports.TableFooter=So;exports.TableHead=Co;exports.TableHeader=jo;exports.TableRow=ko;exports.Tabs=Vr;exports.TabsContent=ua;exports.TabsList=Ia;exports.TabsTrigger=da;exports.Text=_o;exports.Textarea=pa;exports.ThemeLoader=wr;exports.ThemeProvider=Do;exports.ThemeSelector=Mo;exports.Toast=Hr;exports.ToastAction=$o;exports.ToastClose=qr;exports.ToastDescription=Br;exports.ToastProvider=Ro;exports.ToastTitle=Ur;exports.ToastViewport=Wr;exports.Toaster=Ch;exports.Toggle=Io;exports.Tooltip=nr;exports.TooltipContent=Ma;exports.TooltipProvider=sr;exports.TooltipTrigger=or;exports.WakaAdmincrumb=Go;exports.WakaCarousel=Rh;exports.WakaDateTimePicker=Xr;exports.WakaDateTimePickerForm=$h;exports.WakaNotifications=Jo;exports.WakaProvider=op;exports.WakaSpinner=Yo;exports.WakaThemeCreator=Ko;exports.WakaThemeManager=Qo;exports.applyTheme=xf;exports.badgeVariants=Qs;exports.blockquoteVariants=Wo;exports.calculateDuration=Km;exports.cn=j;exports.compareRanges=ff;exports.createBookingDateValidator=rf;exports.createCardExpiryValidator=af;exports.createCommonPresets=Wm;exports.createCustomPreset=Um;exports.createLastDaysPresets=Hm;exports.createMaxAgeValidator=Jm;exports.createMaxRangeDaysValidator=sf;exports.createMinAgeValidator=Xm;exports.createMonthlyPresets=cf;exports.createNextDaysPresets=qm;exports.createQuarterPresets=lf;exports.dateToTimestamp=df;exports.exportToCSV=ei;exports.exportToJSON=ti;exports.formatDateRange=Zm;exports.getDatesInMonth=yr;exports.getFrenchHolidays=Qm;exports.getThemeLoader=jr;exports.getWeekdaysInMonth=tf;exports.getWeekendsInMonth=ef;exports.getWorkingDays=of;exports.headingVariants=zo;exports.initThemeLoader=gf;exports.isDateInRange=ct;exports.isFutureDate=Bm;exports.isHoliday=mn;exports.isNotExpired=Ym;exports.isPastDate=dn;exports.isSameDay=nf;exports.isToday=Gm;exports.isWeekday=vr;exports.isWeekend=un;exports.kbdVariants=qo;exports.loadTableState=ri;exports.loadTheme=bf;exports.mergeRanges=hf;exports.navigationMenuTriggerStyle=uo;exports.normalizeDate=mf;exports.parseCSV=_h;exports.rangesOverlap=pf;exports.reducer=Ao;exports.saveTableState=ai;exports.textVariants=Oo;exports.themeManagerVariants=Zo;exports.timestampToDate=uf;exports.toast=Fo;exports.toggleVariants=Lo;exports.tweak=Da;exports.useAdmincrumb=Mh;exports.useAdmincrumbContext=dp;exports.useAdmincrumbContextOptional=up;exports.useDataTable=si;exports.useDataTableAdvanced=ni;exports.useDataTableEdit=Yr;exports.useDataTableExport=ii;exports.useDataTableImport=li;exports.useDataTableSelection=Qh;exports.useDataTableTheme=ci;exports.useDataTableVirtualization=oi;exports.useDateForm=Ah;exports.useFormField=ha;exports.useLanguage=Qr;exports.useLegacyTheme=np;exports.useNotifications=Lh;exports.useTableLayout=Jr;exports.useTheme=ga;exports.useThemeLoader=vf;exports.useToast=Gr;exports.useTranslation=Xo;exports.useWaka=lp;
|
|
76
|
+
}`,value:v,onChange:Z=>p(Z.target.value),className:"font-mono text-sm min-h-[300px]"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs($,{onClick:G,disabled:A,children:[e.jsx(h.Eye,{className:"mr-2 h-4 w-4"}),"Prévisualiser"]}),e.jsx($,{variant:"outline",onClick:le,children:E?e.jsxs(e.Fragment,{children:[e.jsx(h.Check,{className:"mr-2 h-4 w-4"}),"Copié !"]}):e.jsxs(e.Fragment,{children:[e.jsx(h.Copy,{className:"mr-2 h-4 w-4"}),"Copier CSS"]})}),e.jsxs($,{variant:"outline",onClick:I,children:[e.jsx(h.Download,{className:"mr-2 h-4 w-4"}),"Télécharger"]}),e.jsx("div",{className:"ml-auto",children:e.jsx($,{onClick:se,disabled:N,children:N?e.jsxs(e.Fragment,{children:[e.jsx(h.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),"Publication..."]}):e.jsxs(e.Fragment,{children:[e.jsx(h.Upload,{className:"mr-2 h-4 w-4"}),"Publier sur S3"]})})})]})]})]}),U.length>0&&e.jsxs(Se,{children:[e.jsx(He,{children:e.jsxs(Ve,{className:"flex items-center gap-2",children:[e.jsx(h.History,{className:"h-5 w-5"}),"Historique des versions"]})}),e.jsx(Ee,{children:e.jsx("div",{className:"space-y-3",children:U.slice().reverse().map((Z,J)=>e.jsxs("div",{className:"flex items-start gap-3 p-3 border rounded-lg",children:[e.jsxs(De,{variant:"outline",children:["v",Z.version]}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-sm font-medium",children:Z.changelog||"Aucune description"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Par ",Z.createdBy," • ",Z.createdAt.toLocaleDateString()]})]}),e.jsx($,{variant:"ghost",size:"sm",onClick:()=>p(Z.css),children:"Charger"})]},J))})})]})]})]}),e.jsx(fs,{open:M,onOpenChange:P,children:e.jsxs(Xt,{children:[e.jsxs(Yt,{children:[e.jsx(Kt,{children:"Supprimer le thème ?"}),e.jsx(Qt,{children:"Cette action est irréversible. Le thème sera supprimé de S3."})]}),e.jsxs(Jt,{children:[e.jsx(es,{children:"Annuler"}),e.jsx(Zt,{onClick:()=>{H&&(s?.(H.id),K()),P(!1)},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Supprimer"})]})]})})]})}Al.displayName="WakaThemeCreator";function Rg(){try{return Ms()}catch{return null}}const Rl=Ye.cva("w-full",{variants:{size:{sm:"max-w-2xl",base:"max-w-4xl",lg:"max-w-6xl",full:"max-w-full"}},defaultVariants:{size:"base"}}),Fl=l.forwardRef(({className:t,size:a,onThemeChange:s,onThemeLoad:r,onThemeSave:n,initialTheme:o,showPreview:i=!0,showExport:c=!0,showImport:m=!0,allowCustomColors:d=!0,...x},u)=>{const f=Rg(),w=f?.theme,k=f?.themes||[],b=f?.setTheme,[y,v]=O.useState(o||{name:"Custom Theme",description:"Thème personnalisé",colors:{background:"#ffffff",foreground:"#0a0a0a",card:"#ffffff",cardForeground:"#0a0a0a",popover:"#ffffff",popoverForeground:"#0a0a0a",primary:"#0a0a0a",primaryForeground:"#fafafa",secondary:"#f4f4f5",secondaryForeground:"#0a0a0a",muted:"#f4f4f5",mutedForeground:"#737373",accent:"#f4f4f5",accentForeground:"#0a0a0a",destructive:"#ef4444",destructiveForeground:"#fafafa",border:"#e4e4e7",input:"#e4e4e7",ring:"#0a0a0a"}}),[p,j]=O.useState(!1),[C,N]=O.useState(null),[S,A]=O.useState(null),[R,E]=O.useState(""),[D,M]=O.useState(!1),[P,T]=O.useState("auto"),q=O.useCallback(L=>{const W=document.documentElement;if(Object.entries(L.colors).forEach(([F,G])=>{const ee=`--${F.replace(/([A-Z])/g,"-$1").toLowerCase()}`;W.style.setProperty(ee,G)}),b){const F={id:L.name.toLowerCase().replace(/\s+/g,"-"),label:L.name,description:L.description||"",previewColor:L.colors.primary};b(F.id)}},[b]),H=async L=>{j(!0),N(null),A(null);try{const W=await fetch(L);if(!W.ok)throw new Error(`Erreur HTTP: ${W.status}`);const F=await W.json();if(!F.name||!F.colors)throw new Error("Format de thème invalide");const G={name:F.name,description:F.description||"",author:F.author||"",version:F.version||"1.0.0",colors:{background:F.colors.background||"#ffffff",foreground:F.colors.foreground||"#0a0a0a",card:F.colors.card||"#ffffff",cardForeground:F.colors.cardForeground||"#0a0a0a",popover:F.colors.popover||"#ffffff",popoverForeground:F.colors.popoverForeground||"#0a0a0a",primary:F.colors.primary||"#0a0a0a",primaryForeground:F.colors.primaryForeground||"#fafafa",secondary:F.colors.secondary||"#f4f4f5",secondaryForeground:F.colors.secondaryForeground||"#0a0a0a",muted:F.colors.muted||"#f4f4f5",mutedForeground:F.colors.mutedForeground||"#737373",accent:F.colors.accent||"#f4f4f5",accentForeground:F.colors.accentForeground||"#0a0a0a",destructive:F.colors.destructive||"#ef4444",destructiveForeground:F.colors.destructiveForeground||"#fafafa",border:F.colors.border||"#e4e4e7",input:F.colors.input||"#e4e4e7",ring:F.colors.ring||"#0a0a0a",chart1:F.colors.chart1,chart2:F.colors.chart2,chart3:F.colors.chart3,chart4:F.colors.chart4,chart5:F.colors.chart5}};v(G),q(G),r?.(G),A("Thème chargé avec succès !")}catch(W){N(W instanceof Error?W.message:"Erreur lors du chargement du thème")}finally{j(!1)}},Y=()=>{const L=JSON.stringify(y,null,2),W=new Blob([L],{type:"application/json"}),F=URL.createObjectURL(W),G=document.createElement("a");G.href=F,G.download=`${y.name.toLowerCase().replace(/\s+/g,"-")}-theme.json`,document.body.appendChild(G),G.click(),document.body.removeChild(G),URL.revokeObjectURL(F)},U=async()=>{try{await navigator.clipboard.writeText(JSON.stringify(y,null,2)),M(!0),setTimeout(()=>M(!1),2e3)}catch{N("Impossible de copier le thème")}},z=(L,W)=>{const F={...y,colors:{...y.colors,[L]:W}};v(F),q(F),s?.(F)},V=()=>{n?.(y),A("Thème sauvegardé !")};return O.useEffect(()=>{q(y)},[y,q]),O.useEffect(()=>{const L=document.documentElement;P==="dark"?L.classList.add("dark"):P==="light"?L.classList.remove("dark"):window.matchMedia("(prefers-color-scheme: dark)").matches?L.classList.add("dark"):L.classList.remove("dark")},[P]),e.jsx("div",{ref:u,className:g(Rl({size:a}),t),...x,children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold",children:"Gestionnaire de Thèmes TweakCN"}),e.jsx("p",{className:"text-muted-foreground",children:"Créez, importez et prévisualisez vos thèmes personnalisés"})]}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs(De,{variant:"outline",className:"flex items-center gap-1",children:[e.jsx(h.Palette,{className:"h-3 w-3"}),y.name]})})]}),C&&e.jsxs("div",{className:"flex items-center gap-2 p-3 bg-destructive/10 border border-destructive/20 rounded-lg text-destructive",children:[e.jsx(h.AlertCircle,{className:"h-4 w-4"}),e.jsx("span",{className:"text-sm",children:C})]}),S&&e.jsxs("div",{className:"flex items-center gap-2 p-3 bg-green-500/10 border border-green-500/20 rounded-lg text-green-600",children:[e.jsx(h.CheckCircle,{className:"h-4 w-4"}),e.jsx("span",{className:"text-sm",children:S})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs(Se,{children:[e.jsx(He,{children:e.jsxs(Ve,{className:"flex items-center gap-2",children:[e.jsx(h.Settings,{className:"h-5 w-5"}),"Informations du thème"]})}),e.jsxs(Ee,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(he,{htmlFor:"theme-name",children:"Nom"}),e.jsx(oe,{id:"theme-name",value:y.name,onChange:L=>v({...y,name:L.target.value}),placeholder:"Mon thème"})]}),e.jsxs("div",{children:[e.jsx(he,{htmlFor:"theme-author",children:"Auteur"}),e.jsx(oe,{id:"theme-author",value:y.author||"",onChange:L=>v({...y,author:L.target.value}),placeholder:"Votre nom"})]})]}),e.jsxs("div",{children:[e.jsx(he,{htmlFor:"theme-description",children:"Description"}),e.jsx(wt,{id:"theme-description",value:y.description||"",onChange:L=>v({...y,description:L.target.value}),placeholder:"Description du thème...",rows:3})]})]})]}),(m||c)&&e.jsxs(Se,{children:[e.jsx(He,{children:e.jsxs(Ve,{className:"flex items-center gap-2",children:[e.jsx(h.Upload,{className:"h-5 w-5"}),"Import / Export"]})}),e.jsxs(Ee,{className:"space-y-4",children:[m&&e.jsxs("div",{children:[e.jsx(he,{htmlFor:"import-url",children:"URL du thème JSON"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(oe,{id:"import-url",value:R,onChange:L=>E(L.target.value),placeholder:"https://example.com/theme.json",className:"flex-1"}),e.jsx($,{onClick:()=>H(R),disabled:!R||p,size:"sm",children:p?e.jsx(h.RefreshCw,{className:"h-4 w-4 animate-spin"}):e.jsx(h.Download,{className:"h-4 w-4"})})]})]}),c&&e.jsxs("div",{className:"flex gap-2",children:[e.jsxs($,{onClick:Y,variant:"outline",className:"flex-1",children:[e.jsx(h.Download,{className:"h-4 w-4 mr-2"}),"Exporter JSON"]}),e.jsx($,{onClick:U,variant:"outline",children:D?e.jsx(h.Check,{className:"h-4 w-4"}):e.jsx(h.Copy,{className:"h-4 w-4"})})]})]})]}),i&&e.jsxs(Se,{children:[e.jsx(He,{children:e.jsxs(Ve,{className:"flex items-center gap-2",children:[e.jsx(h.Eye,{className:"h-5 w-5"}),"Prévisualisation"]})}),e.jsx(Ee,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsxs($,{variant:P==="light"?"default":"outline",size:"sm",onClick:()=>T("light"),children:[e.jsx(h.Sun,{className:"h-4 w-4 mr-2"}),"Clair"]}),e.jsxs($,{variant:P==="dark"?"default":"outline",size:"sm",onClick:()=>T("dark"),children:[e.jsx(h.Moon,{className:"h-4 w-4 mr-2"}),"Sombre"]}),e.jsxs($,{variant:P==="auto"?"default":"outline",size:"sm",onClick:()=>T("auto"),children:[e.jsx(h.Monitor,{className:"h-4 w-4 mr-2"}),"Auto"]})]}),w&&e.jsxs("div",{className:"text-sm text-muted-foreground",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"Thème actuel:"}),e.jsx("span",{className:"font-medium",children:w})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"Mode sombre:"}),e.jsx("span",{className:"font-medium",children:"Géré par le système"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"Thèmes disponibles:"}),e.jsx("span",{className:"font-medium",children:k.length})]})]})]})})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx($,{onClick:V,className:"flex-1",children:"Sauvegarder le thème"}),e.jsxs($,{variant:"outline",onClick:()=>window.open("https://tweakcn.com","_blank"),children:[e.jsx(h.ExternalLink,{className:"h-4 w-4 mr-2"}),"TweakCN"]})]})]}),d&&e.jsx("div",{className:"space-y-6",children:e.jsxs(Se,{children:[e.jsxs(He,{children:[e.jsxs(Ve,{className:"flex items-center gap-2",children:[e.jsx(h.Palette,{className:"h-5 w-5"}),"Couleurs du thème"]}),e.jsx(nt,{children:"Cliquez sur une couleur pour la modifier"})]}),e.jsx(Ee,{children:e.jsx("div",{className:"grid grid-cols-2 gap-4",children:Object.entries(y.colors).map(([L,W])=>e.jsxs("div",{className:"space-y-2",children:[e.jsx(he,{htmlFor:`color-${L}`,className:"text-sm font-medium",children:L.replace(/([A-Z])/g," $1").replace(/^./,F=>F.toUpperCase())}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("div",{className:"w-10 h-10 rounded border border-border cursor-pointer",style:{backgroundColor:W},onClick:()=>{document.getElementById(`color-${L}`)?.click()}}),e.jsx(oe,{id:`color-${L}`,type:"color",value:W,onChange:F=>z(L,F.target.value),className:"flex-1 h-10"})]})]},L))})})]})})]}),i&&e.jsxs(Se,{children:[e.jsx(He,{children:e.jsxs(Ve,{className:"flex items-center gap-2",children:[e.jsx(h.Eye,{className:"h-5 w-5"}),"Prévisualisation en temps réel"]})}),e.jsx(Ee,{children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium",children:"Boutons"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx($,{size:"sm",children:"Primary"}),e.jsx($,{variant:"secondary",size:"sm",children:"Secondary"}),e.jsx($,{variant:"outline",size:"sm",children:"Outline"}),e.jsx($,{variant:"destructive",size:"sm",children:"Destructive"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium",children:"Cards"}),e.jsxs(Se,{className:"p-3",children:[e.jsx(Ve,{className:"text-sm",children:"Exemple de carte"}),e.jsx(nt,{className:"text-xs",children:"Contenu de la carte avec le nouveau thème"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium",children:"Inputs"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(oe,{placeholder:"Input normal"}),e.jsx(oe,{placeholder:"Input avec erreur",className:"border-destructive"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium",children:"Badges"}),e.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.jsx(De,{children:"Default"}),e.jsx(De,{variant:"secondary",children:"Secondary"}),e.jsx(De,{variant:"destructive",children:"Destructive"}),e.jsx(De,{variant:"outline",children:"Outline"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium",children:"Séparateur"}),e.jsx(Et,{}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Texte avec couleur muted"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"font-medium",children:"Progress"}),e.jsx("div",{className:"w-full bg-muted rounded-full h-2",children:e.jsx("div",{className:"bg-primary h-2 rounded-full",style:{width:"60%"}})})]})]})})]})]})})});Fl.displayName="WakaThemeManager";function wa(t){const a=t.split(":");return{hours:parseInt(a[0]||"0",10),minutes:parseInt(a[1]||"0",10),seconds:parseInt(a[2]||"0",10)}}function no(t,a,s,r){const n=t.toString().padStart(2,"0"),o=a.toString().padStart(2,"0"),i=s.toString().padStart(2,"0");return r?`${n}:${o}:${i}`:`${n}:${o}`}function Fg(t){const a=t>=12?"PM":"AM";let s=t%12;return s===0&&(s=12),{display:s,period:a}}function oo(t,a){return a==="AM"?t===12?0:t:t===12?12:t+12}function $g(t,a,s,r,n){const o=t*3600+a*60+s;if(r){const i=wa(r),c=i.hours*3600+i.minutes*60+i.seconds;if(o<c)return!1}if(n){const i=wa(n),c=i.hours*3600+i.minutes*60+i.seconds;if(o>c)return!1}return!0}function Ka({value:t,onChange:a,max:s,step:r=1,disabled:n,label:o}){const i=l.useMemo(()=>{const d=[];for(let x=0;x<s;x+=r)d.push(x);return d},[s,r]),c=()=>{const x=(i.indexOf(t)+1)%i.length;a(i[x])},m=()=>{const d=i.indexOf(t),x=d===0?i.length-1:d-1;a(i[x])};return e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("span",{className:"text-xs text-muted-foreground mb-1",children:o}),e.jsx($,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-8",onClick:c,disabled:n,tabIndex:-1,children:e.jsx(h.ChevronUp,{className:"h-4 w-4"})}),e.jsx("div",{className:"h-10 w-12 flex items-center justify-center text-lg font-medium",children:t.toString().padStart(2,"0")}),e.jsx($,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-8",onClick:m,disabled:n,tabIndex:-1,children:e.jsx(h.ChevronDown,{className:"h-4 w-4"})})]})}function Lg({value:t,onChange:a,disabled:s}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx($,{type:"button",variant:t==="AM"?"default":"ghost",size:"sm",className:"h-7 px-2",onClick:()=>a("AM"),disabled:s,children:"AM"}),e.jsx($,{type:"button",variant:t==="PM"?"default":"ghost",size:"sm",className:"h-7 px-2",onClick:()=>a("PM"),disabled:s,children:"PM"})]})}function Ig({value:t,onChange:a,placeholder:s="Sélectionner une heure",format:r="24h",showSeconds:n=!1,minuteStep:o=1,secondStep:i=1,minTime:c,maxTime:m,disabled:d=!1,error:x=!1,size:u="md",className:f,id:w,name:k}){const[b,y]=l.useState(!1),[v,p]=l.useState(t||""),j=t?wa(t):{hours:0,minutes:0,seconds:0},[C,N]=l.useState(j.hours),[S,A]=l.useState(j.minutes),[R,E]=l.useState(j.seconds),[D,M]=l.useState(j.hours>=12?"PM":"AM");l.useEffect(()=>{if(t){const F=wa(t);N(F.hours),A(F.minutes),E(F.seconds),M(F.hours>=12?"PM":"AM"),p(t)}},[t]);const P=l.useMemo(()=>{if(!t)return"";if(r==="12h"){const{display:F,period:G}=Fg(C);return`${F.toString().padStart(2,"0")}:${S.toString().padStart(2,"0")}${n?`:${R.toString().padStart(2,"0")}`:""} ${G}`}return no(C,S,R,n)},[t,C,S,R,r,n]),T=(F,G,ee)=>{if(!$g(F,G,ee,c,m))return;N(F),A(G),E(ee);const se=no(F,G,ee,n);a?.(se)},q=F=>{const G=r==="12h"?oo(F,D):F;T(G,S,R)},H=F=>{T(C,F,R)},Y=F=>{T(C,S,F)},U=F=>{M(F);const G=C%12||12,ee=oo(G,F);T(ee,S,R)},z=F=>{const G=F.target.value;p(G);const ee=n?/^(\d{1,2}):(\d{2}):(\d{2})$/:/^(\d{1,2}):(\d{2})$/,se=G.match(ee);if(se){const le=parseInt(se[1],10),X=parseInt(se[2],10),K=n?parseInt(se[3],10):0;le>=0&&le<24&&X>=0&&X<60&&K>=0&&K<60&&T(le,X,K)}},V={sm:"h-8 text-xs",md:"h-9 text-sm",lg:"h-10 text-base"},L={sm:"h-3 w-3",md:"h-4 w-4",lg:"h-5 w-5"},W=r==="12h"?C%12||12:C;return e.jsxs(ct,{open:b,onOpenChange:y,children:[e.jsx(dt,{asChild:!0,children:e.jsxs("div",{className:g("relative",f),children:[e.jsx(oe,{id:w,name:k,value:P,onChange:z,placeholder:s,disabled:d,className:g(V[u],"pr-10",x&&"border-destructive focus-visible:ring-destructive")}),e.jsx($,{type:"button",variant:"ghost",size:"icon",className:g("absolute right-0 top-0 h-full px-2",d&&"pointer-events-none opacity-50"),onClick:()=>!d&&y(!b),tabIndex:-1,children:e.jsx(h.Clock,{className:L[u]})})]})}),e.jsxs(rt,{className:"w-auto p-4",align:"start",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ka,{value:W,onChange:q,max:r==="12h"?13:24,disabled:d,label:"Heures"}),e.jsx("span",{className:"text-xl font-medium",children:":"}),e.jsx(Ka,{value:S,onChange:H,max:60,step:o,disabled:d,label:"Minutes"}),n&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-xl font-medium",children:":"}),e.jsx(Ka,{value:R,onChange:Y,max:60,step:i,disabled:d,label:"Secondes"})]}),r==="12h"&&e.jsx("div",{className:"ml-2",children:e.jsx(Lg,{value:D,onChange:U,disabled:d})})]}),e.jsxs("div",{className:"flex gap-2 mt-4 pt-4 border-t",children:[e.jsx($,{type:"button",variant:"outline",size:"sm",onClick:()=>{const F=new Date;T(F.getHours(),F.getMinutes(),F.getSeconds())},disabled:d,children:"Maintenant"}),e.jsx($,{type:"button",variant:"outline",size:"sm",onClick:()=>T(0,0,0),disabled:d,children:"00:00"}),e.jsx($,{type:"button",variant:"outline",size:"sm",onClick:()=>T(12,0,0),disabled:d,children:"12:00"})]})]})]})}function Og(t={}){const{initialValue:a="",format:s="24h",showSeconds:r=!1}=t,[n,o]=l.useState(a);return{value:n,onChange:o,clear:()=>o(""),setNow:()=>{const m=new Date,d=m.getHours().toString().padStart(2,"0"),x=m.getMinutes().toString().padStart(2,"0"),u=m.getSeconds().toString().padStart(2,"0");o(r?`${d}:${x}:${u}`:`${d}:${x}`)},format:s,showSeconds:r}}const $l={completed:{icon:h.Check,color:"text-green-600",bgColor:"bg-green-100"},current:{icon:h.Circle,color:"text-primary",bgColor:"bg-primary/10"},pending:{icon:h.Clock,color:"text-muted-foreground",bgColor:"bg-muted"},error:{icon:h.AlertCircle,color:"text-destructive",bgColor:"bg-destructive/10"}};function io({status:t,icon:a,color:s,size:r}){const n=$l[t],o=n.icon,i={sm:"h-6 w-6",md:"h-8 w-8",lg:"h-10 w-10"},c={sm:"h-3 w-3",md:"h-4 w-4",lg:"h-5 w-5"};return e.jsx("div",{className:g("rounded-full flex items-center justify-center flex-shrink-0 border-2 border-background shadow-sm",i[r],s?"":n.bgColor),style:s?{backgroundColor:s+"20"}:void 0,children:a||e.jsx(o,{className:g(c[r],s?"":n.color),style:s?{color:s}:void 0})})}function lo({item:t,isLast:a,size:s,showDate:r,dateFormat:n,collapsible:o,onItemClick:i,orientation:c,position:m}){const[d,x]=l.useState(!1),u=t.status||"pending",f={sm:{title:"text-sm",desc:"text-xs",date:"text-[10px]"},md:{title:"text-base",desc:"text-sm",date:"text-xs"},lg:{title:"text-lg",desc:"text-base",date:"text-sm"}},w=y=>(typeof y=="string"?new Date(y):y).toLocaleDateString("fr-FR",n||{day:"numeric",month:"short",year:"numeric"}),k=()=>{o&&t.content&&x(!d),i?.(t)};if(c==="horizontal")return e.jsxs("div",{className:"flex flex-col items-center flex-1 min-w-[120px]",children:[r&&t.date&&e.jsx("div",{className:g("mb-2 text-muted-foreground",f[s].date),children:w(t.date)}),e.jsxs("div",{className:"flex items-center w-full",children:[e.jsx("div",{className:g("flex-1 h-0.5",a?"":"bg-border"),style:u==="completed"?{backgroundColor:$l.completed.color.replace("text-","")}:void 0}),e.jsx(io,{status:u,icon:t.icon,color:t.color,size:s}),e.jsx("div",{className:g("flex-1 h-0.5",a?"":"bg-border")})]}),e.jsxs("div",{className:g("mt-2 text-center",i&&"cursor-pointer hover:opacity-80"),onClick:k,children:[e.jsx("h4",{className:g("font-medium",f[s].title),children:t.title}),t.description&&e.jsx("p",{className:g("text-muted-foreground mt-0.5",f[s].desc),children:t.description})]})]});const b=m==="right";return e.jsxs("div",{className:g("flex gap-4",b&&"flex-row-reverse"),children:[m!=="left"&&r&&t.date&&e.jsx("div",{className:g("w-24 text-muted-foreground pt-1",f[s].date,b?"text-left":"text-right"),children:w(t.date)}),e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx(io,{status:u,icon:t.icon,color:t.color,size:s}),!a&&e.jsx("div",{className:g("w-0.5 flex-1 min-h-[24px] mt-1",u==="completed"?"bg-green-500":"bg-border")})]}),e.jsxs("div",{className:g("flex-1 pb-8",b&&"text-right"),children:[m==="left"&&r&&t.date&&e.jsx("div",{className:g("text-muted-foreground mb-1",f[s].date),children:w(t.date)}),e.jsxs("div",{className:g("inline-block",(i||o&&t.content)&&"cursor-pointer hover:opacity-80"),onClick:k,children:[e.jsxs("h4",{className:g("font-medium",f[s].title),children:[t.title,o&&t.content&&e.jsx($,{variant:"ghost",size:"icon",className:"h-5 w-5 ml-1",children:d?e.jsx(h.ChevronUp,{className:"h-3 w-3"}):e.jsx(h.ChevronDown,{className:"h-3 w-3"})})]}),t.description&&e.jsx("p",{className:g("text-muted-foreground mt-0.5",f[s].desc),children:t.description})]}),o&&t.content&&d&&e.jsx("div",{className:"mt-3 p-3 bg-muted/50 rounded-lg",children:t.content})]})]})}function zg({items:t,orientation:a="vertical",linePosition:s="left",size:r="md",showDates:n=!0,dateFormat:o,collapsible:i=!1,alternate:c=!1,onItemClick:m,className:d}){return a==="horizontal"?e.jsx("div",{className:g("flex items-start overflow-x-auto",d),children:t.map((x,u)=>e.jsx(lo,{item:x,isLast:u===t.length-1,size:r,showDate:n,dateFormat:o,collapsible:i,onItemClick:m,orientation:"horizontal",position:"left"},x.id))}):e.jsx("div",{className:g("flex flex-col",s==="center"&&"items-center",d),children:t.map((x,u)=>{let f="left";return s==="center"&&c?f=u%2===0?"left":"right":s==="right"&&(f="right"),e.jsx(lo,{item:x,isLast:u===t.length-1,size:r,showDate:n,dateFormat:o,collapsible:i,onItemClick:m,orientation:"vertical",position:f},x.id)})})}const Ll=l.createContext(null);function _g(){const t=l.useContext(Ll);if(!t)throw new Error("useTreeContext must be used within a WakaTree");return t}function Vg(t){const a=[];function s(r){for(const n of r)a.push(n.id),n.children&&s(n.children)}return s(t),a}function Il({node:t,level:a}){const{selectedIds:s,selectionMode:r,showCheckboxes:n,showIcons:o,draggable:i,size:c,toggleSelect:m,toggleExpand:d,isSelected:x,isExpanded:u,onDragStart:f,onDragOver:w,onDragLeave:k,onDrop:b,dragOverId:y,dragPosition:v}=_g(),p=t.children&&t.children.length>0,j=u(t.id),C=x(t.id),N={sm:"py-0.5 text-xs",md:"py-1 text-sm",lg:"py-1.5 text-base"},S={sm:"h-3 w-3",md:"h-4 w-4",lg:"h-5 w-5"},A=a*(c==="sm"?12:c==="md"?16:20),R=Y=>{Y.stopPropagation(),r!=="none"&&t.selectable!==!1&&!t.disabled&&m(t.id)},E=Y=>{Y.stopPropagation(),d(t.id)},D=Y=>{i&&f(Y,t.id)},M=Y=>{i&&(Y.preventDefault(),w(Y,t.id))},P=Y=>{i&&k(Y)},T=Y=>{if(!i)return;Y.preventDefault();const U=Y.currentTarget.getBoundingClientRect(),z=Y.clientY-U.top,V=U.height;let L="inside";z<V*.25?L="before":z>V*.75&&(L="after"),b(Y,t.id,L)},q=()=>t.icon?t.icon:o?p?j?e.jsx(h.FolderOpen,{className:g(S[c],"text-amber-500")}):e.jsx(h.Folder,{className:g(S[c],"text-amber-500")}):e.jsx(h.File,{className:g(S[c],"text-muted-foreground")}):null,H=y===t.id;return e.jsxs("li",{role:"treeitem","aria-expanded":p?j:void 0,"aria-selected":C,children:[e.jsxs("div",{className:g("flex items-center gap-1 rounded-md cursor-pointer transition-colors group",N[c],C&&"bg-primary/10 text-primary",!C&&"hover:bg-muted",t.disabled&&"opacity-50 cursor-not-allowed",H&&v==="before"&&"border-t-2 border-primary",H&&v==="after"&&"border-b-2 border-primary",H&&v==="inside"&&"bg-primary/20"),style:{paddingLeft:A},onClick:R,draggable:i&&!t.disabled,onDragStart:D,onDragOver:M,onDragLeave:P,onDrop:T,children:[i&&e.jsx(h.GripVertical,{className:g(S[c],"text-muted-foreground opacity-0 group-hover:opacity-100 cursor-grab")}),e.jsx("button",{type:"button",onClick:E,className:g("flex items-center justify-center rounded hover:bg-muted-foreground/10",!p&&"invisible"),tabIndex:-1,children:j?e.jsx(h.ChevronDown,{className:S[c]}):e.jsx(h.ChevronRight,{className:S[c]})}),n&&r!=="none"&&e.jsx(et,{checked:C,onCheckedChange:()=>m(t.id),disabled:t.disabled||t.selectable===!1,className:c==="sm"?"h-3 w-3":c==="lg"?"h-5 w-5":"h-4 w-4"}),q(),e.jsx("span",{className:"truncate flex-1",children:t.label})]}),p&&j&&e.jsx("ul",{role:"group",className:"list-none",children:t.children.map(Y=>e.jsx(Il,{node:Y,level:a+1},Y.id))})]})}function Wg({data:t,selectedIds:a,onSelect:s,expandedIds:r,onExpand:n,selectionMode:o="single",showCheckboxes:i=!1,showIcons:c=!0,draggable:m=!1,onDrop:d,size:x="md",className:u,defaultExpandAll:f=!1}){const[w,k]=l.useState([]),[b,y]=l.useState(()=>f?Vg(t):[]),[v,p]=l.useState(null),[j,C]=l.useState(null),[N,S]=l.useState(null),A=a??w,R=r??b,E=l.useCallback(z=>{let V;o==="single"?V=A.includes(z)?[]:[z]:V=A.includes(z)?A.filter(L=>L!==z):[...A,z],s?s(V):k(V)},[A,o,s]),D=l.useCallback(z=>{const V=R.includes(z)?R.filter(L=>L!==z):[...R,z];n?n(V):y(V)},[R,n]),M=l.useCallback(z=>A.includes(z),[A]),P=l.useCallback(z=>R.includes(z),[R]),T=l.useCallback((z,V)=>{p(V),z.dataTransfer.effectAllowed="move",z.dataTransfer.setData("text/plain",V)},[]),q=l.useCallback((z,V)=>{if(v===V)return;const L=z.currentTarget.getBoundingClientRect(),W=z.clientY-L.top,F=L.height;let G="inside";W<F*.25?G="before":W>F*.75&&(G="after"),C(V),S(G)},[v]),H=l.useCallback(()=>{C(null),S(null)},[]),Y=l.useCallback((z,V,L)=>{z.preventDefault(),v&&v!==V&&d&&d(v,V,L),p(null),C(null),S(null)},[v,d]),U={selectedIds:A,expandedIds:R,selectionMode:o,showCheckboxes:i,showIcons:c,draggable:m,size:x,toggleSelect:E,toggleExpand:D,isSelected:M,isExpanded:P,onDragStart:T,onDragOver:q,onDragLeave:H,onDrop:Y,dragOverId:j,dragPosition:N};return e.jsx(Ll.Provider,{value:U,children:e.jsx("ul",{role:"tree","aria-multiselectable":o==="multiple",className:g("list-none",u),children:t.map(z=>e.jsx(Il,{node:z,level:0},z.id))})})}function cn(t,a){for(const s of t){if(s.id===a)return s;if(s.children){const r=cn(s.children,a);if(r)return r}}return null}function Ol(t,a,s){return t.map(r=>r.id===a?{...r,...s}:r.children?{...r,children:Ol(r.children,a,s)}:r)}function dn(t,a){return t.filter(s=>s.id!==a).map(s=>s.children?{...s,children:dn(s.children,a)}:s)}function un(t,a,s){return t.map(r=>r.id===a?{...r,children:[...r.children||[],s]}:r.children?{...r,children:un(r.children,a,s)}:r)}function Ug(t,a,s,r){const n=cn(t,a);if(!n)return t;let o=dn(t,a);if(r==="inside")o=un(o,s,n);else{const i=c=>{const m=[];for(const d of c)d.id===s?r==="before"?(m.push(n),m.push(d)):(m.push(d),m.push(n)):m.push({...d,children:d.children?i(d.children):void 0});return m};o=i(o)}return o}function co(t){const a=Math.floor(t/3600),s=Math.floor(t%3600/60),r=Math.floor(t%60);return a>0?`${a}:${s.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`:`${s}:${r.toString().padStart(2,"0")}`}function Bg({src:t,poster:a,autoPlay:s=!1,loop:r=!1,muted:n=!1,controls:o=!0,preload:i="metadata",width:c,height:m,aspectRatio:d="16/9",showFullscreen:x=!0,showPlaybackSpeed:u=!0,showQualitySelector:f=!1,playbackSpeeds:w=[.5,.75,1,1.25,1.5,2],onReady:k,onPlay:b,onPause:y,onEnded:v,onTimeUpdate:p,onError:j,className:C}){const N=l.useRef(null),S=l.useRef(null),[A,R]=l.useState(s),[E,D]=l.useState(n),[M,P]=l.useState(1),[T,q]=l.useState(0),[H,Y]=l.useState(0),[U,z]=l.useState(!1),[V,L]=l.useState(!0),[W,F]=l.useState(!0),[G,ee]=l.useState(1),[se,le]=l.useState(""),X=l.useRef(),K=l.useMemo(()=>typeof t=="string"?[{src:t,type:"video/mp4"}]:t,[t]);l.useEffect(()=>{K.length>0&&K[0].quality&&le(K[0].quality)},[K]);const I=()=>{const B=N.current;B&&(Y(B.duration),L(!1),k?.())},te=()=>{const B=N.current;B&&(q(B.currentTime),p?.(B.currentTime))},Z=()=>{R(!0),b?.()},J=()=>{R(!1),y?.()},ne=()=>{R(!1),v?.()},me=()=>{L(!1),j?.(new Error("Video failed to load"))},ae=()=>{L(!0)},de=()=>{L(!1)},Te=()=>{const B=N.current;B&&(A?B.pause():B.play())},Ce=()=>{const B=N.current;B&&(B.muted=!E,D(!E))},Je=B=>{const Q=N.current;if(!Q)return;const re=B[0];Q.volume=re,P(re),D(re===0)},xt=B=>{const Q=N.current;Q&&(Q.currentTime=B[0],q(B[0]))},Ke=B=>{const Q=N.current;Q&&(Q.currentTime=Math.max(0,Math.min(H,Q.currentTime+B)))},tt=B=>{const Q=N.current;Q&&(Q.playbackRate=B,ee(B))},gt=B=>{const Q=N.current;if(!Q)return;const re=Q.currentTime;Q.src=B.src,Q.currentTime=re,le(B.quality||""),A&&Q.play()},Mt=async()=>{const B=S.current;if(B)try{document.fullscreenElement?(await document.exitFullscreen(),z(!1)):(await B.requestFullscreen(),z(!0))}catch(Q){console.error("Fullscreen error:",Q)}},Qe=()=>{F(!0),X.current&&clearTimeout(X.current),A&&(X.current=setTimeout(()=>{F(!1)},3e3))};return l.useEffect(()=>()=>{X.current&&clearTimeout(X.current)},[]),l.useEffect(()=>{const B=()=>{z(!!document.fullscreenElement)};return document.addEventListener("fullscreenchange",B),()=>{document.removeEventListener("fullscreenchange",B)}},[]),e.jsxs("div",{ref:S,className:g("relative bg-black overflow-hidden group",C),style:{width:c,height:m,aspectRatio:m?void 0:d},onMouseMove:Qe,onMouseLeave:()=>A&&F(!1),children:[e.jsx("video",{ref:N,className:"w-full h-full",poster:a,autoPlay:s,loop:r,muted:n,preload:i,playsInline:!0,onLoadedMetadata:I,onTimeUpdate:te,onPlay:Z,onPause:J,onEnded:ne,onError:me,onWaiting:ae,onCanPlay:de,onClick:Te,children:K.map((B,Q)=>e.jsx("source",{src:B.src,type:B.type},Q))}),V&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50",children:e.jsx(h.Loader2,{className:"h-10 w-10 text-white animate-spin"})}),!A&&!V&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/30",children:e.jsx($,{variant:"ghost",size:"icon",className:"h-16 w-16 rounded-full bg-white/90 hover:bg-white text-black",onClick:Te,children:e.jsx(h.Play,{className:"h-8 w-8 ml-1"})})}),o&&e.jsxs("div",{className:g("absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/80 to-transparent p-4 transition-opacity duration-300",W||!A?"opacity-100":"opacity-0"),children:[e.jsx(ja,{value:[T],max:H||100,step:.1,onValueChange:xt,className:"mb-3"}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($,{variant:"ghost",size:"icon",className:"h-8 w-8 text-white hover:bg-white/20",onClick:Te,children:A?e.jsx(h.Pause,{className:"h-5 w-5"}):e.jsx(h.Play,{className:"h-5 w-5"})}),e.jsx($,{variant:"ghost",size:"icon",className:"h-8 w-8 text-white hover:bg-white/20",onClick:()=>Ke(-10),children:e.jsx(h.SkipBack,{className:"h-4 w-4"})}),e.jsx($,{variant:"ghost",size:"icon",className:"h-8 w-8 text-white hover:bg-white/20",onClick:()=>Ke(10),children:e.jsx(h.SkipForward,{className:"h-4 w-4"})}),e.jsx($,{variant:"ghost",size:"icon",className:"h-8 w-8 text-white hover:bg-white/20",onClick:Ce,children:E||M===0?e.jsx(h.VolumeX,{className:"h-5 w-5"}):e.jsx(h.Volume2,{className:"h-5 w-5"})}),e.jsx(ja,{value:[E?0:M],max:1,step:.1,onValueChange:Je,className:"w-20"}),e.jsxs("span",{className:"text-white text-sm ml-2",children:[co(T)," / ",co(H)]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[(u||f)&&e.jsxs(Ge,{children:[e.jsx(Xe,{asChild:!0,children:e.jsx($,{variant:"ghost",size:"icon",className:"h-8 w-8 text-white hover:bg-white/20",children:e.jsx(h.Settings,{className:"h-5 w-5"})})}),e.jsxs(Ue,{align:"end",children:[u&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-2 py-1 text-xs text-muted-foreground",children:"Vitesse"}),w.map(B=>e.jsxs(xe,{onClick:()=>tt(B),className:g(G===B&&"bg-muted"),children:[B,"x"]},B))]}),f&&K.some(B=>B.quality)&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-2 py-1 text-xs text-muted-foreground mt-2",children:"Qualité"}),K.filter(B=>B.quality).map((B,Q)=>e.jsx(xe,{onClick:()=>gt(B),className:g(se===B.quality&&"bg-muted"),children:B.quality},Q))]})]})]}),x&&e.jsx($,{variant:"ghost",size:"icon",className:"h-8 w-8 text-white hover:bg-white/20",onClick:Mt,children:U?e.jsx(h.Minimize,{className:"h-5 w-5"}):e.jsx(h.Maximize,{className:"h-5 w-5"})})]})]})]})]})}function qg(t={}){const[a,s]=l.useState(t.autoPlay??!1),[r,n]=l.useState(t.muted??!1),[o,i]=l.useState(0),[c,m]=l.useState(0);return{isPlaying:a,isMuted:r,currentTime:o,duration:c,onPlay:()=>s(!0),onPause:()=>s(!1),onTimeUpdate:i,onReady:()=>{}}}function Hg(t,a,s,r,n){return l.useMemo(()=>{const o=typeof a=="number";let i=0;const c=[];for(let u=0;u<t.length;u++){c.push(i);const f=o?a:a(t[u],u);i+=f}let m=0,d=t.length-1;if(o)m=Math.floor(r/a),d=Math.min(t.length-1,Math.ceil((r+s)/a));else{let u=0,f=t.length-1;for(;u<=f;){const w=Math.floor((u+f)/2);c[w]<r?u=w+1:f=w-1}m=Math.max(0,f);for(let w=m;w<t.length;w++){const k=c[w],b=o?a:a(t[w],w);if(k+b>r+s){d=w;break}}}m=Math.max(0,m-n),d=Math.min(t.length-1,d+n);const x=[];for(let u=m;u<=d;u++){const f=o?a:a(t[u],u);x.push({item:t[u],index:u,style:{position:"absolute",top:c[u],left:0,right:0,height:f}})}return{totalHeight:i,visibleItems:x,startIndex:m,endIndex:d}},[t,a,s,r,n])}function Gg({items:t,itemHeight:a,height:s,width:r="100%",overscan:n=3,renderItem:o,onScroll:i,onEndReached:c,endReachedThreshold:m=200,isLoading:d=!1,loadingElement:x,emptyElement:u,className:f,innerClassName:w,scrollRef:k}){const b=l.useRef(null),y=k||b,[v,p]=l.useState(0),j=l.useRef(!1),{totalHeight:C,visibleItems:N}=Hg(t,a,s,v,n),S=R=>{const E=R.currentTarget,D=E.scrollTop;if(p(D),i?.(D),c){const M=E.scrollHeight-E.scrollTop-E.clientHeight;M<m&&!j.current?(j.current=!0,c()):M>=m&&(j.current=!1)}},A=l.useCallback(R=>{y.current&&(y.current.scrollTop=R)},[y]);return l.useCallback((R,E="start")=>{const D=typeof a=="number";let M=0;if(D)M=R*a;else for(let T=0;T<R&&T<t.length;T++)M+=a(t[T],T);const P=D?a:a(t[R],R);E==="center"?M-=(s-P)/2:E==="end"&&(M-=s-P),A(Math.max(0,M))},[t,a,s,A]),t.length===0&&!d?e.jsx("div",{className:g("flex items-center justify-center text-muted-foreground",f),style:{height:s,width:r},children:u||"Aucun élément"}):e.jsx("div",{ref:y,className:g("overflow-auto",f),style:{height:s,width:r},onScroll:S,children:e.jsxs("div",{className:g("relative",w),style:{height:C+(d?50:0)},children:[N.map(({item:R,index:E,style:D})=>e.jsx(l.Fragment,{children:o(R,E,D)},E)),d&&e.jsx("div",{className:"absolute left-0 right-0 flex items-center justify-center py-4",style:{top:C},children:x||e.jsx("div",{className:"text-muted-foreground text-sm",children:"Chargement..."})})]})})}function Xg(t){const{itemCount:a,itemHeight:s,containerHeight:r,overscan:n=3}=t,[o,i]=l.useState(0),c=a*s,m=Math.max(0,Math.floor(o/s)-n),d=Math.min(a-1,Math.ceil((o+r)/s)+n),x=l.useMemo(()=>{const w=[];for(let k=m;k<=d;k++)w.push({index:k,start:k*s,size:s});return w},[m,d,s]);return{totalHeight:c,virtualItems:x,startIndex:m,endIndex:d,handleScroll:w=>{i(w.currentTarget.scrollTop)},scrollToIndex:w=>{i(w*s)},scrollTop:o}}const zl=l.createContext(void 0);function _l({children:t,languages:a,defaultLanguage:s="fr",s3Config:r,onLanguageChange:n}){const{i18n:o}=Nt.useTranslation(),[i,c]=l.useState(s),[m,d]=l.useState(!0),[x,u]=l.useState(new Set),[f,w]=l.useState(!1),k=l.useCallback(async v=>{if(!r)throw new Error("S3 configuration not provided");const{baseUrl:p,prefix:j="",extension:C="json",headers:N={}}=r,S=`${p.replace(/\/$/,"")}/${j}${v}.${C}`;console.log(`[LanguageProvider] Loading translations from S3: ${S}`);try{const A=await fetch(S,{headers:{Accept:"application/json",...N}});if(!A.ok)throw new Error(`Failed to load translations: ${A.status} ${A.statusText}`);const R=await A.json();return console.log(`[LanguageProvider] ✓ Translations loaded for ${v}`),R}catch(A){throw console.error(`[LanguageProvider] ✗ Error loading translations for ${v}:`,A),A}},[r]);l.useEffect(()=>{if(f||!o||!r)return;(async()=>{try{const p=typeof window<"u"?localStorage.getItem("language"):null,j=p&&a.some(N=>N.code===p)?p:s;console.log(`[LanguageProvider] Initializing with language: ${j}`);const C=await k(j);o.addResourceBundle&&o.addResourceBundle(j,"translation",C,!0,!0),await o.changeLanguage(j),c(j),u(new Set([j])),w(!0),console.log(`[LanguageProvider] ✓ Initialized with ${j}`)}catch(p){console.error("[LanguageProvider] Error initializing:",p),w(!0)}finally{d(!1)}})()},[f,o,r,s,a,k]);const b=l.useCallback(async v=>{if(v!==i){if(!o?.changeLanguage){console.error("[LanguageProvider] i18next is not initialized");return}if(!r){console.error("[LanguageProvider] S3 config not provided");return}d(!0);try{if(!x.has(v)){console.log(`[LanguageProvider] Loading ${v} from S3...`);const p=await k(v);o.addResourceBundle&&o.addResourceBundle(v,"translation",p,!0,!0),u(j=>new Set([...j,v]))}await o.changeLanguage(v),c(v),typeof window<"u"&&localStorage.setItem("language",v),n?.(v),console.log(`[LanguageProvider] ✓ Language changed to: ${v}`)}catch(p){throw console.error("[LanguageProvider] ✗ Error changing language:",p),p}finally{d(!1)}}},[i,x,r,k,o,n]),y={currentLanguage:i,languages:a,changeLanguage:b,isLoading:m,loadedLanguages:x};return e.jsx(zl.Provider,{value:y,children:t})}function mn(){const t=l.useContext(zl);if(!t)throw new Error("useLanguage must be used within a LanguageProvider");return t}const Vl=l.createContext(void 0);function Yg({children:t,config:a}){const{defaultTheme:s="light",storageKey:r="waka-ui-theme",themes:n,enableSystem:o=!0,s3Config:i}=a||{},[c,m]=l.useState(s),[d,x]=l.useState(),[u,f]=l.useState([]),[w,k]=l.useState(!0),[b,y]=l.useState("fallback");l.useEffect(()=>{(async()=>{if(k(!0),n&&n.length>0){const N=Jg(n);f(N),y("config"),k(!1),console.log("[ThemeProvider] Using themes from config:",N.length);return}if(i?.baseUrl)try{const N=await Kg(i.baseUrl);if(N.length>0){f(N),y("s3"),k(!1),console.log("[ThemeProvider] Loaded themes from S3:",N.length);return}}catch(N){console.error("[ThemeProvider] Failed to load themes from S3:",N)}f([{id:"light",label:"Clair",previewColor:"#3b82f6"},{id:"dark",label:"Sombre",previewColor:"#1e293b"}]),y("fallback"),k(!1),console.log("[ThemeProvider] Using fallback themes")})()},[n,i]),l.useEffect(()=>{if(!o)return;const j=window.matchMedia("(prefers-color-scheme: dark)"),C=N=>{x(N.matches?"dark":"light")};return x(j.matches?"dark":"light"),j.addEventListener("change",C),()=>j.removeEventListener("change",C)},[o]),l.useEffect(()=>{if(u.length===0)return;const j=localStorage.getItem(r),C=u.map(N=>N.id);j&&C.includes(j)&&m(j)},[r,u]),l.useEffect(()=>{if(u.length===0)return;const j=document.documentElement,C=c==="system"&&d?d:c;u.forEach(N=>j.classList.remove(N.id)),j.classList.add(C),j.setAttribute("data-theme",C),process.env.NODE_ENV==="development"&&console.log(`[WakaUI] Theme applied: ${C}`)},[c,d,u]);const v=l.useCallback(j=>{const C=u.map(N=>N.id);if(!C.includes(j)&&j!=="system"){console.warn(`[WakaUI] Theme "${j}" is not in the list of available themes:`,C);return}m(j),localStorage.setItem(r,j)},[u,r]),p=l.useMemo(()=>({theme:c,setTheme:v,themes:u,systemTheme:d,isLoadingThemes:w,themesSource:b}),[c,v,u,d,w,b]);return e.jsx(Vl.Provider,{value:p,children:t})}function Jg(t){return t.length===0?[]:typeof t[0]=="string"?t.map(a=>({id:a,label:Qg(a),previewColor:Zg(a)})):t}async function Kg(t){try{const a=await fetch("/api/themes/list",{cache:"no-store"});if(!a.ok)throw new Error(`HTTP ${a.status}`);return(await a.json()).themes||[]}catch(a){return console.error("[ThemeProvider] Failed to fetch themes from S3:",a),[]}}function Qg(t){return t.split("-").map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" ")}function Zg(t){return{light:"#3b82f6",dark:"#1e293b",forest:"#10b981",sunset:"#f59e0b",twilight:"#8b5cf6",monochrome:"#6b7280",perpetuity:"#ec4899"}[t]||"#3b82f6"}function eb(){const t=l.useContext(Vl);if(!t)throw new Error("useTheme must be used within a ThemeProvider");return t}function tb({children:t,config:a}){const[s]=l.useState(()=>$t.createInstance()),[r,n]=l.useState(!1);return l.useEffect(()=>{(async()=>{try{await s.use(Nt.initReactI18next).init({lng:a.language.defaultLanguage,fallbackLng:a.language.defaultLanguage,supportedLngs:a.language.supportedLanguages,resources:a.language.resources||{},interpolation:{escapeValue:!1},react:{useSuspense:!1},debug:a.debug}),a.language.s3Config&&await sb(s,a.language.s3Config,a.language.supportedLanguages),n(!0),a.debug&&console.log("[WakaUI] i18n initialized successfully")}catch(i){console.error("[WakaUI] Failed to initialize i18n:",i),n(!0)}})()},[s,a]),l.useEffect(()=>{if(!r)return;const o=a.language.storageKey||"waka-ui-language",i=localStorage.getItem(o);i&&a.language.supportedLanguages.includes(i)&&s.changeLanguage(i);const c=m=>{localStorage.setItem(o,m),a.debug&&console.log(`[WakaUI] Language changed to: ${m}`)};return s.on("languageChanged",c),()=>{s.off("languageChanged",c)}},[r,s,a]),r?e.jsx(Nt.I18nextProvider,{i18n:s,children:e.jsx(_l,{languages:a.language.languages||[],defaultLanguage:a.language.defaultLanguage,s3Config:a.language.s3Config?{baseUrl:a.language.s3Config.bucketUrl,prefix:a.language.s3Config.translationsPath?`${a.language.s3Config.translationsPath}/`:"",extension:"json"}:void 0,children:e.jsx(Gi,{themes:a.theme?.themes||[{id:"default",label:"Default"}],defaultTheme:a.theme?.defaultTheme||"default",s3Config:a.theme?.s3Config,enableDarkMode:a.theme?.enableSystem,children:t})})}):e.jsx("div",{style:{padding:"20px",textAlign:"center"},children:"Loading WakaUI..."})}async function sb(t,a,s){if(!a)return;const{bucketUrl:r,translationsPath:n="translations"}=a;try{await Promise.all(s.map(async o=>{try{const i=`${r}/${n}/${o}.json`,c=await fetch(i);if(!c.ok){console.warn(`[WakaUI] Failed to load translations for ${o} from S3`);return}const m=await c.json();t.addResourceBundle(o,"translation",m,!0,!0),process.env.NODE_ENV==="development"&&console.log(`[WakaUI] Loaded translations for ${o} from S3`)}catch(i){console.warn(`[WakaUI] Error loading translations for ${o}:`,i)}}))}catch(o){console.error("[WakaUI] Error loading translations from S3:",o)}}function ab(){const{i18n:t,t:a}=Nt.useTranslation(),s=mn(),r=Ms();return{currentLanguage:t.language||s.currentLanguage,changeLanguage:async n=>{await s.changeLanguage(n),await t.changeLanguage(n)},languages:s.languages,isLanguageLoading:s.isLoading,currentTheme:r.currentTheme,changeTheme:r.changeTheme,themes:r.themes,isThemeLoading:r.isLoading,preloadTheme:r.preloadTheme,isThemeLoaded:r.isThemeLoaded,t:a}}const hn=l.createContext(void 0);function rb({children:t,initialSelection:a,onSelectionChange:s,persistKey:r="admincrumb-selection"}){const[n,o]=l.useState(()=>{if(typeof window<"u"&&r){const w=localStorage.getItem(r);if(w)try{return JSON.parse(w)}catch(k){console.error("Failed to parse stored admincrumb selection",k)}}return a||{}});l.useEffect(()=>{typeof window<"u"&&r&&localStorage.setItem(r,JSON.stringify(n))},[n,r]),l.useEffect(()=>{s?.(n)},[n,s]);const i=l.useCallback(w=>{o({partner:w,network:void 0,customer:void 0})},[]),c=l.useCallback(w=>{o(k=>({...k,network:w,customer:void 0}))},[]),m=l.useCallback(w=>{o(k=>({...k,customer:w}))},[]),d=l.useCallback(()=>{o({})},[]),x=l.useMemo(()=>!!(n.partner||n.network||n.customer),[n]),u=l.useCallback(()=>({...n.partner?.id&&{partnerId:n.partner.id},...n.network?.id&&{networkId:n.network.id},...n.customer?.id&&{customerId:n.customer.id}}),[n]),f=l.useMemo(()=>({selection:n,setPartner:i,setNetwork:c,setCustomer:m,reset:d,isFiltered:x,getFilterQuery:u}),[n,i,c,m,d,x,u]);return e.jsx(hn.Provider,{value:f,children:t})}function nb(){const t=l.useContext(hn);if(!t)throw new Error("useAdmincrumbContext must be used within AdmincrumbProvider");return t}function ob(){return l.useContext(hn)}const ib={github:h.Github,twitter:h.Twitter,linkedin:h.Linkedin,email:h.Mail};function lb({columns:t=[],socialLinks:a=[],copyright:s="© 2024 Tous droits réservés.",className:r}){return e.jsx("footer",{className:g("bg-muted/40",r),children:e.jsxs("div",{className:"container mx-auto px-4 py-12",children:[e.jsxs("div",{className:"grid grid-cols-1 gap-8 md:grid-cols-2 lg:grid-cols-4",children:[t.map((n,o)=>e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-foreground",children:n.title}),e.jsx("ul",{className:"space-y-2",children:n.links.map((i,c)=>e.jsx("li",{children:e.jsx("a",{href:i.href,className:"text-sm text-muted-foreground hover:text-foreground transition-colors",children:i.label})},c))})]},o)),a.length>0&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Suivez-nous"}),e.jsx("div",{className:"flex space-x-4",children:a.map((n,o)=>{const i=ib[n.platform];return e.jsx($,{variant:"ghost",size:"icon",asChild:!0,className:"h-8 w-8",children:e.jsx("a",{href:n.url,target:"_blank",rel:"noopener noreferrer","aria-label":n.platform,children:e.jsx(i,{className:"h-4 w-4"})})},o)})})]})]}),e.jsx(Et,{className:"my-8"}),e.jsxs("div",{className:"flex flex-col items-center justify-between space-y-4 md:flex-row md:space-y-0",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:s}),e.jsxs("div",{className:"flex space-x-6",children:[e.jsx("a",{href:"/privacy",className:"text-sm text-muted-foreground hover:text-foreground transition-colors",children:"Politique de confidentialité"}),e.jsx("a",{href:"/terms",className:"text-sm text-muted-foreground hover:text-foreground transition-colors",children:"Conditions d'utilisation"})]})]})]})})}function cb({items:t,defaultActiveId:a,variant:s="default",size:r="md",className:n,onTabChange:o}){const[i,c]=l.useState(a||t[0]?.id||""),m=u=>{c(u),o?.(u)},d={sm:"h-8 px-3 text-sm",md:"h-10 px-4 text-sm",lg:"h-12 px-6 text-base"},x={default:"bg-background",pills:"bg-muted rounded-full",underline:"bg-transparent border-b-2 border-transparent data-[state=active]:border-primary"};return e.jsx("div",{className:g("w-full",n),children:e.jsxs(aa,{value:i,onValueChange:m,children:[e.jsx(Es,{className:g("grid w-full",s==="pills"&&"grid-cols-auto",s!=="pills"&&`grid-cols-${t.length}`,x[s]),children:t.map(u=>e.jsx(js,{value:u.id,disabled:u.disabled,className:g(d[r],s==="underline"&&"rounded-none border-b-2 border-transparent data-[state=active]:border-primary",s==="pills"&&"rounded-full"),children:u.label},u.id))}),t.map(u=>e.jsx(vs,{value:u.id,className:"mt-6",children:u.content},u.id))]})})}function db({items:t,separator:a="/",className:s}){return e.jsx("nav",{className:g("flex items-center space-x-1 text-sm text-muted-foreground",s),children:t.map((r,n)=>e.jsxs(l.Fragment,{children:[n>0&&e.jsx("span",{className:"mx-2 text-muted-foreground",children:a}),r.href?e.jsx("a",{href:r.href,className:"hover:text-foreground transition-colors",children:r.label}):e.jsx("span",{className:"text-foreground font-medium",children:r.label})]},n))})}function ub({variant:t="dropdown",showFlags:a=!0,className:s}){const{currentLanguage:r,languages:n,changeLanguage:o,isLoading:i}=mn(),c=n.find(m=>m.code===r);return t==="select"?e.jsxs(Oe,{value:r,onValueChange:o,disabled:i,children:[e.jsx(Le,{className:g("w-[180px]",s),children:e.jsxs(ze,{children:[a&&c?.flagEmoji&&e.jsx("span",{className:"mr-2",children:c.flagEmoji}),c?.label]})}),e.jsx(Ie,{children:n.map(m=>e.jsxs(be,{value:m.code,children:[a&&m.flagEmoji&&e.jsx("span",{className:"mr-2",children:m.flagEmoji}),m.label]},m.code))})]}):e.jsxs(Ge,{children:[e.jsx(Xe,{asChild:!0,children:e.jsxs($,{variant:"outline",size:"sm",className:g("gap-2",s),disabled:i,children:[e.jsx(h.Globe,{className:"h-4 w-4"}),a&&c?.flagEmoji&&e.jsx("span",{children:c.flagEmoji}),c?.label]})}),e.jsx(Ue,{align:"end",children:n.map(m=>e.jsxs(xe,{onClick:()=>o(m.code),className:"cursor-pointer",children:[a&&m.flagEmoji&&e.jsx("span",{className:"mr-2",children:m.flagEmoji}),m.label]},m.code))})]})}function mb({children:t,header:a,sidebar:s,footer:r,collapsible:n=!1,className:o}){const[i,c]=l.useState(!1);return e.jsxs("div",{className:g("min-h-screen bg-background",o),children:[a&&e.jsx("header",{className:"sticky top-0 z-50 w-full border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:e.jsxs("div",{className:"container flex h-14 max-w-screen-2xl items-center",children:[n&&s&&e.jsxs(ta,{open:i,onOpenChange:c,children:[e.jsx(Rr,{asChild:!0,children:e.jsxs($,{variant:"ghost",size:"icon",className:"md:hidden",children:[e.jsx(h.Menu,{className:"h-5 w-5"}),e.jsx("span",{className:"sr-only",children:"Ouvrir le menu"})]})}),e.jsx(Ts,{side:"left",className:"w-72 p-0",children:e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between p-4",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Navigation"}),e.jsx($,{variant:"ghost",size:"icon",onClick:()=>c(!1),children:e.jsx(h.X,{className:"h-4 w-4"})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:s})]})})]}),a]})}),e.jsxs("div",{className:"flex",children:[s&&!n&&e.jsx("aside",{className:"hidden w-64 border-r bg-muted/40 md:block",children:e.jsx("div",{className:"h-full overflow-y-auto p-4",children:s})}),e.jsx("main",{className:"flex-1",children:e.jsx("div",{className:"container mx-auto p-4",children:t})})]}),r&&e.jsx("footer",{className:"border-t bg-muted/40",children:e.jsx("div",{className:"container mx-auto p-4",children:r})})]})}function Wl({config:t,onSubmit:a,onForgotPassword:s,onSignUp:r,onSSOGoogle:n,onSSOMicrosoft:o,onSSOApple:i,onSSOLinkedIn:c,onSSOGithub:m,onSSOFacebook:d,onSSOInstagram:x,onSSOFranceConnect:u,showSocialLogin:f=!1,className:w}){let k=!1;try{k=Ms().isDarkMode}catch{}const b=t?.theme_json?.dark_mode??k,[y,v]=l.useState({email:"",password:"",rememberMe:!1}),[p,j]=l.useState(!1),C=l.useMemo(()=>t?.assets?b?t.assets.theme_logo_dark:t.assets.theme_logo_light:null,[t?.assets,b]),N=l.useMemo(()=>t?.color_json?{"--login-primary":t.color_json.primary,"--login-secondary":t.color_json.secondary,"--login-accent":t.color_json.accent}:{},[t?.color_json]),S=l.useMemo(()=>{const D=[];if(!t?.signup_options)return f&&(m&&D.push({id:"github",label:"GitHub",icon:e.jsx(h.Github,{className:"h-4 w-4"}),onClick:m}),n&&D.push({id:"google",label:"Google",icon:e.jsx(h.Mail,{className:"h-4 w-4"}),onClick:n})),D;const M=t.signup_options;return M.allow_sso_google&&D.push({id:"google",label:"Google",icon:e.jsx(h.Mail,{className:"h-4 w-4"}),onClick:n}),M.allow_sso_microsoft&&D.push({id:"microsoft",label:"Microsoft",icon:e.jsx(h.Mail,{className:"h-4 w-4"}),onClick:o}),M.allow_sso_apple&&D.push({id:"apple",label:"Apple",icon:e.jsx(h.Apple,{className:"h-4 w-4"}),onClick:i}),M.allow_sso_linkedIn&&D.push({id:"linkedin",label:"LinkedIn",icon:e.jsx(h.Linkedin,{className:"h-4 w-4"}),onClick:c}),M.allow_sso_github&&D.push({id:"github",label:"GitHub",icon:e.jsx(h.Github,{className:"h-4 w-4"}),onClick:m}),M.allow_sso_facebook&&D.push({id:"facebook",label:"Facebook",icon:e.jsx(h.Facebook,{className:"h-4 w-4"}),onClick:d}),M.allow_sso_instagram&&D.push({id:"instagram",label:"Instagram",icon:e.jsx(h.Instagram,{className:"h-4 w-4"}),onClick:x}),M.allow_sso_france_connect&&D.push({id:"france-connect",label:"France Connect",icon:e.jsx(h.Mail,{className:"h-4 w-4"}),onClick:u}),D},[t?.signup_options,f,n,o,i,c,m,d,x,u]),A=t?.signup_options?.allow_login!==!1,R=async D=>{D.preventDefault(),j(!0);try{await a?.(y)}finally{j(!1)}},E=D=>M=>{v(P=>({...P,[D]:D==="rememberMe"?M.target.checked:M.target.value}))};return e.jsx("div",{className:g("flex items-center justify-center p-4",w),style:N,children:e.jsxs(Se,{className:"w-full max-w-md",children:[e.jsxs(He,{className:"space-y-1",children:[C&&e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx("img",{src:C,alt:t?.theme_json?.name||"Logo",className:"max-h-16 max-w-full object-contain"})}),e.jsx(Ve,{className:"text-2xl text-center",children:"Connexion"}),e.jsx(nt,{className:"text-center",children:"Entrez vos identifiants pour accéder à votre compte"})]}),e.jsxs(Ee,{className:"space-y-4",children:[S.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:g("grid gap-4",S.length===1?"grid-cols-1":"grid-cols-2"),children:S.map(D=>e.jsxs($,{variant:"outline",className:"w-full",onClick:D.onClick,type:"button",children:[D.icon,D.label]},D.id))}),A&&e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx(Et,{className:"w-full"})}),e.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:e.jsx("span",{className:"bg-background px-2 text-muted-foreground",children:"Ou continuez avec"})})]})]}),A&&e.jsxs("form",{onSubmit:R,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(he,{htmlFor:"email",children:"Email"}),e.jsx(oe,{id:"email",type:"email",placeholder:"votre@email.com",value:y.email,onChange:E("email"),required:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(he,{htmlFor:"password",children:"Mot de passe"}),e.jsx(oe,{id:"password",type:"password",placeholder:"••••••••",value:y.password,onChange:E("password"),required:!0})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("input",{id:"remember",type:"checkbox",checked:y.rememberMe,onChange:E("rememberMe"),className:"h-4 w-4 rounded border-gray-300"}),e.jsx(he,{htmlFor:"remember",className:"text-sm",children:"Se souvenir de moi"})]}),s&&e.jsx($,{type:"button",variant:"link",className:"px-0 text-sm",onClick:s,children:"Mot de passe oublié ?"})]}),e.jsx($,{type:"submit",className:"w-full",disabled:p,style:t?.color_json?.primary?{backgroundColor:t.color_json.primary,color:t.color_json.secondary}:void 0,children:p?"Connexion...":"Se connecter"})]}),r&&e.jsxs("div",{className:"text-center text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"Pas encore de compte ? "}),e.jsx($,{type:"button",variant:"link",className:"px-0 text-sm",onClick:r,children:"S'inscrire"})]}),t?.waka_powered&&e.jsx("div",{className:"text-center text-xs text-muted-foreground mt-4 pt-4 border-t",children:"Powered by Waka"})]})]})})}const Ul=l.createContext(null);function hb(){const t=l.useContext(Ul);if(!t)throw new Error("Sidebar components must be used within WakaSidebar");return t}function fb({config:t}){const a=t.component?t.component:e.jsxs("div",{className:"flex items-center gap-3",children:[t.src&&e.jsx("img",{src:t.src,alt:t.alt||"Logo",className:"h-8 w-auto object-contain"}),t.title&&e.jsx("span",{className:"text-lg font-bold tracking-wide",children:t.title})]});return t.href?e.jsx("a",{href:t.href,className:"block",onClick:t.onClick,children:a}):t.onClick?e.jsx("button",{type:"button",onClick:t.onClick,className:"block text-left",children:a}):e.jsx("div",{children:a})}function Bl({item:t,isChild:a=!1,renderItem:s}){const{activeId:r,setActiveId:n,expandedIds:o,toggleExpanded:i,isMobile:c,closeOnNavigate:m,onClose:d}=hb(),x=t.children&&t.children.length>0,u=o.includes(t.id),f=r===t.id||t.active,w=()=>{t.disabled||(x?i(t.id):(n(t.id),t.onClick?.(),c&&m&&d()))};if(s)return e.jsx(e.Fragment,{children:s(t,a)});const k=e.jsxs("div",{className:g("flex items-center gap-3 rounded-lg px-3 py-2.5 text-sm font-medium transition-all duration-200","hover:bg-white/10",f&&!x&&"bg-sidebar-active text-sidebar-active-foreground",a&&"ml-6 text-[13px]",t.disabled&&"opacity-50 cursor-not-allowed"),children:[t.icon&&e.jsx("span",{className:g("flex-shrink-0",a?"h-4 w-4":"h-5 w-5"),children:t.icon}),e.jsx("span",{className:"flex-1 truncate",children:t.label}),t.badge!==void 0&&e.jsx("span",{className:"ml-auto flex h-5 min-w-[20px] items-center justify-center rounded-full bg-primary px-1.5 text-[10px] font-semibold text-primary-foreground",children:t.badge}),x&&e.jsx(h.ChevronDown,{className:g("h-4 w-4 transition-transform duration-200",u&&"rotate-180")})]});return x?e.jsxs(yr,{open:u,onOpenChange:()=>i(t.id),children:[e.jsx(Nr,{asChild:!0,children:e.jsx("button",{type:"button",className:"w-full text-left",disabled:t.disabled,children:k})}),e.jsx(Cr,{className:"space-y-1 pt-1",children:t.children?.map(b=>e.jsx(Bl,{item:b,isChild:!0,renderItem:s},b.id))})]}):t.href?e.jsx("a",{href:t.href,onClick:b=>{if(t.disabled){b.preventDefault();return}w()},className:"block",children:k}):e.jsx("button",{type:"button",className:"w-full text-left",disabled:t.disabled,onClick:w,children:k})}function uo({config:t}){const a=t.initials||t.name.split(" ").map(n=>n[0]).join("").slice(0,2).toUpperCase(),s=[{id:"profile",label:"Profil",icon:e.jsx(h.User,{className:"h-4 w-4"})},{id:"settings",label:"Paramètres",icon:e.jsx(h.Settings,{className:"h-4 w-4"})},{id:"logout",label:"Déconnexion",icon:e.jsx(h.LogOut,{className:"h-4 w-4"}),variant:"destructive"}],r=t.actions??s;return e.jsxs(Ge,{children:[e.jsx(Xe,{asChild:!0,children:e.jsxs("button",{type:"button",className:"flex w-full items-center gap-3 rounded-lg p-2 text-left transition-colors hover:bg-white/10",children:[e.jsxs(Ct,{className:"h-10 w-10 border-2 border-sidebar-active",children:[e.jsx(kt,{src:t.avatarUrl,alt:t.name}),e.jsx(St,{className:"bg-sidebar-active text-sidebar-active-foreground text-sm font-medium",children:a})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium truncate",children:t.name}),t.email&&e.jsx("p",{className:"text-xs text-sidebar-foreground/70 truncate",children:t.email})]}),e.jsx(h.ChevronDown,{className:"h-4 w-4 flex-shrink-0 opacity-70"})]})}),e.jsx(Ue,{align:"end",className:"w-56",children:r.map((n,o)=>e.jsxs(l.Fragment,{children:[n.variant==="destructive"&&o>0&&e.jsx(Ze,{}),e.jsx(xe,{onClick:n.onClick,className:g(n.variant==="destructive"&&"text-destructive focus:text-destructive"),asChild:!!n.href,children:n.href?e.jsxs("a",{href:n.href,className:"flex items-center gap-2",children:[n.icon,n.label]}):e.jsxs("span",{className:"flex items-center gap-2",children:[n.icon,n.label]})})]},n.id))})]})}function pb({logo:t,menu:a,user:s,userPosition:r="bottom",header:n,footer:o,renderItem:i}){return e.jsxs("div",{className:"flex h-full flex-col",children:[t&&e.jsx("div",{className:"flex-shrink-0 p-4 pb-2",children:e.jsx(fb,{config:t})}),n&&e.jsx("div",{className:"flex-shrink-0 px-4 py-2",children:n}),s&&r==="top"&&e.jsx("div",{className:"flex-shrink-0 px-3 py-2 border-b border-white/10",children:e.jsx(uo,{config:s})}),e.jsx(yt,{className:"flex-1 px-3 py-4",children:e.jsx("nav",{className:"space-y-1",children:a.map(c=>e.jsx(Bl,{item:c,renderItem:i},c.id))})}),o&&e.jsx("div",{className:"flex-shrink-0 px-4 py-2 border-t border-white/10",children:o}),s&&r==="bottom"&&e.jsx("div",{className:"flex-shrink-0 p-3 border-t border-white/10",children:e.jsx(uo,{config:s})})]})}function ql({logo:t,menu:a,user:s,width:r=260,mobileBreakpoint:n=768,open:o,onOpenChange:i,className:c,contentClassName:m,backgroundColor:d,textColor:x,activeColor:u,hoverColor:f,userPosition:w="bottom",showHamburger:k=!0,hamburgerPosition:b="left",renderItem:y,footer:v,header:p,position:j="fixed"}){const[C,N]=l.useState(!1),S=o!==void 0,A=S?o:C,R=S?i:N,[E,D]=l.useState(!1);l.useEffect(()=>{const L=()=>{D(window.innerWidth<n)};return L(),window.addEventListener("resize",L),()=>window.removeEventListener("resize",L)},[n]);const[M,P]=l.useState(()=>{const L=W=>{for(const F of W){if(F.active)return F.id;if(F.children){const G=L(F.children);if(G)return G}}return null};return L(a)}),[T,q]=l.useState(()=>{const L=(W,F=[])=>{for(const G of W){if(G.active)return F;if(G.children){const ee=L(G.children,[...F,G.id]);if(ee.length>F.length)return ee}}return[]};return L(a)}),H=l.useCallback(L=>{q(W=>W.includes(L)?W.filter(F=>F!==L):[...W,L])},[]),Y={activeId:M,setActiveId:P,expandedIds:T,toggleExpanded:H,isMobile:E,closeOnNavigate:!0,onClose:()=>R(!1)},U={"--sidebar-bg":d||"hsl(222 47% 11%)","--sidebar-text":x||"hsl(210 40% 96%)","--sidebar-active":u||"hsl(187 85% 43%)","--sidebar-active-foreground":"hsl(222 47% 11%)","--sidebar-hover":f||"rgba(255, 255, 255, 0.1)"},z=g("bg-[var(--sidebar-bg)] text-[var(--sidebar-text)]","[&_.bg-sidebar-active]:bg-[var(--sidebar-active)]","[&_.text-sidebar-active-foreground]:text-[var(--sidebar-active-foreground)]","[&_.text-sidebar-foreground\\/70]:text-[var(--sidebar-text)]/70","[&_.border-sidebar-active]:border-[var(--sidebar-active)]",m),V=e.jsx(Ul.Provider,{value:Y,children:e.jsx("div",{className:g("h-full",z),style:U,children:e.jsx(pb,{logo:t,menu:a,user:s,userPosition:w,header:p,footer:v,renderItem:y})})});return e.jsxs(e.Fragment,{children:[k&&E&&e.jsxs($,{variant:"ghost",size:"icon",className:g("fixed top-3 z-50",b==="left"?"left-3":"right-3"),onClick:()=>R(!0),children:[e.jsx(h.Menu,{className:"h-6 w-6"}),e.jsx("span",{className:"sr-only",children:"Ouvrir le menu"})]}),!E&&e.jsx("aside",{className:g(j==="fixed"?"fixed left-0 top-0 h-screen z-40":"relative h-full",c),style:{width:r},children:V}),E&&e.jsx(ta,{open:A,onOpenChange:R,children:e.jsx(Ts,{side:"left",className:g("w-[280px] p-0 border-0",c),style:U,children:V})})]})}function xb(){const[t,a]=l.useState(!1),s=l.useCallback(()=>a(!0),[]),r=l.useCallback(()=>a(!1),[]),n=l.useCallback(()=>a(o=>!o),[]);return{isOpen:t,setIsOpen:a,open:s,close:r,toggle:n}}function gb({sidebar:t,children:a,sidebarWidth:s=260,className:r,contentClassName:n}){const[o,i]=l.useState(!1),c=t.mobileBreakpoint||768;return l.useEffect(()=>{const m=()=>i(window.innerWidth<c);return m(),window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)},[c]),e.jsxs("div",{className:g("min-h-screen bg-background",r),children:[e.jsx(ql,{...t,width:s}),e.jsx("main",{className:g("min-h-screen transition-all duration-300",n),style:{marginLeft:o?0:s},children:a})]})}function bb({title:t,subtitle:a,showSearch:s=!0,searchPlaceholder:r="Rechercher...",searchValue:n,onSearchChange:o,onSearchSubmit:i,primaryAction:c,secondaryActions:m,filters:d,notifications:x,unreadCount:u=0,onNotificationsClick:f,userMenu:w,leftContent:k,rightContent:b,filterContent:y,className:v,mainBarClassName:p,filterBarClassName:j,sticky:C=!0}){const[N,S]=l.useState(n||""),A=D=>{const M=D.target.value;S(M),o?.(M)},R=D=>{D.key==="Enter"&&i?.(N)},E=d&&d.length>0||y;return e.jsxs("header",{className:g("w-full bg-background border-b",C&&"sticky top-0 z-50",v),children:[e.jsxs("div",{className:g("flex items-center gap-4 px-4 py-2 min-h-[56px]",p),children:[e.jsxs("div",{className:"flex items-center gap-3 flex-shrink-0",children:[c&&e.jsxs($,{variant:c.variant||"default",size:"sm",onClick:c.onClick,className:"gap-2",children:[c.icon||e.jsx(h.Plus,{className:"h-4 w-4"}),c.label]}),s&&e.jsxs("div",{className:"relative",children:[e.jsx(h.Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(oe,{type:"search",placeholder:r,value:N,onChange:A,onKeyDown:R,className:"pl-9 w-[200px] h-9 bg-muted/50"})]}),k]}),(t||a)&&e.jsxs("div",{className:"flex-1 text-center",children:[t&&e.jsx("h1",{className:"text-lg font-semibold leading-none",children:t}),a&&e.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:a})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0 ml-auto",children:[m?.map(D=>e.jsxs($,{variant:D.variant||"ghost",size:"sm",onClick:D.onClick,className:"gap-2",children:[D.icon,D.label]},D.id)),b,(x||f)&&e.jsxs(Ge,{children:[e.jsx(Xe,{asChild:!0,children:e.jsxs($,{variant:"ghost",size:"icon",className:"relative",onClick:x?void 0:f,children:[e.jsx(h.Bell,{className:"h-5 w-5"}),u>0&&e.jsx(De,{variant:"destructive",className:"absolute -top-1 -right-1 h-5 w-5 p-0 flex items-center justify-center text-xs",children:u>9?"9+":u})]})}),x&&x.length>0&&e.jsxs(Ue,{align:"end",className:"w-80",children:[e.jsx("div",{className:"p-2 font-semibold border-b",children:"Notifications"}),x.slice(0,5).map(D=>e.jsxs(xe,{onClick:D.onClick,className:g("flex flex-col items-start gap-1 p-3",!D.read&&"bg-muted/50"),children:[e.jsx("div",{className:"font-medium",children:D.title}),D.description&&e.jsx("div",{className:"text-sm text-muted-foreground",children:D.description}),D.time&&e.jsx("div",{className:"text-xs text-muted-foreground",children:D.time})]},D.id))]})]}),w&&e.jsxs(Ge,{children:[e.jsx(Xe,{asChild:!0,children:e.jsxs($,{variant:"ghost",size:"sm",className:"gap-2",children:[e.jsxs(Ct,{className:"h-7 w-7",children:[w.avatar&&e.jsx(kt,{src:w.avatar,alt:w.name}),e.jsx(St,{className:"text-xs",children:w.initials||w.name.slice(0,2).toUpperCase()})]}),e.jsx(h.ChevronDown,{className:"h-4 w-4"})]})}),e.jsxs(Ue,{align:"end",className:"w-56",children:[e.jsxs("div",{className:"p-2",children:[e.jsx("p",{className:"font-medium",children:w.name}),w.email&&e.jsx("p",{className:"text-sm text-muted-foreground",children:w.email})]}),e.jsx(Ze,{}),w.items.map((D,M)=>D.separator?e.jsx(Ze,{},M):e.jsxs(xe,{onClick:D.onClick,children:[D.icon&&e.jsx("span",{className:"mr-2",children:D.icon}),D.label]},M))]})]})]})]}),E&&e.jsxs("div",{className:g("flex items-center gap-2 px-4 py-2 border-t bg-muted/30",j),children:[d?.map(D=>e.jsxs(Oe,{value:D.value,onValueChange:D.onChange,children:[e.jsxs(Le,{className:"w-auto h-8 gap-2 bg-muted/50 border-0",children:[D.icon,e.jsx(ze,{placeholder:D.placeholder||D.label})]}),e.jsx(Ie,{children:D.options.map(M=>e.jsx(be,{value:M.value,children:M.label},M.value))})]},D.id)),y]})]})}function jb({title:t="Tableau de bord",description:a,period:s,onPeriodChange:r,periods:n=[{value:"today",label:"Aujourd'hui"},{value:"week",label:"Cette semaine"},{value:"month",label:"Ce mois"},{value:"year",label:"Cette année"}],onRefresh:o,loading:i,quickActions:c}){return e.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:t}),a&&e.jsx("p",{className:"text-muted-foreground mt-1",children:a})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[r&&e.jsxs(Ge,{children:[e.jsx(Xe,{asChild:!0,children:e.jsxs($,{variant:"outline",size:"sm",children:[e.jsx(h.Calendar,{className:"mr-2 h-4 w-4"}),n.find(m=>m.value===s)?.label||"Période"]})}),e.jsx(Ue,{align:"end",children:n.map(m=>e.jsx(xe,{onClick:()=>r(m.value),className:g(s===m.value&&"bg-muted"),children:m.label},m.value))})]}),o&&e.jsx($,{variant:"outline",size:"sm",onClick:o,disabled:i,children:e.jsx(h.RefreshCw,{className:g("h-4 w-4",i&&"animate-spin")})}),c?.map(m=>e.jsx($,{variant:m.variant||"default",size:"sm",onClick:m.onClick,asChild:!!m.href,children:m.href?e.jsxs("a",{href:m.href,children:[m.icon&&e.jsx("span",{className:"mr-2",children:m.icon}),m.label]}):e.jsxs(e.Fragment,{children:[m.icon&&e.jsx("span",{className:"mr-2",children:m.icon}),m.label]})},m.id))]})]})}function vb({stats:t,layout:a="grid",columns:s=4,loading:r}){return e.jsx(Pl,{layout:a,columns:s,gap:"md",children:t.map(n=>e.jsx(Ml,{label:n.label,value:n.value,trend:n.trend,trendValue:n.trendValue,trendText:n.trendText,icon:n.icon,color:n.color,variant:"card",loading:r},n.id))})}function wb({config:t}){return e.jsxs(Se,{children:[e.jsxs(He,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsxs("div",{children:[e.jsx(Ve,{className:"text-base",children:t.title}),t.description&&e.jsx(nt,{children:t.description})]}),t.actions&&t.actions.length>0&&e.jsxs(Ge,{children:[e.jsx(Xe,{asChild:!0,children:e.jsx($,{variant:"ghost",size:"icon",className:"h-8 w-8",children:e.jsx(h.MoreHorizontal,{className:"h-4 w-4"})})}),e.jsx(Ue,{align:"end",children:t.actions.map((a,s)=>e.jsx(xe,{onClick:a.onClick,children:a.label},s))})]})]}),e.jsx(Ee,{children:t.chart})]})}function yb({config:t}){return e.jsxs(Se,{children:[e.jsxs(He,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsxs("div",{children:[e.jsx(Ve,{className:"text-base",children:t.title}),t.description&&e.jsx(nt,{children:t.description})]}),t.actions&&t.actions.length>0&&e.jsx("div",{className:"flex gap-2",children:t.actions.map((a,s)=>e.jsx($,{variant:"outline",size:"sm",onClick:a.onClick,asChild:!!a.href,children:a.href?e.jsxs("a",{href:a.href,children:[a.label,e.jsx(h.ArrowUpRight,{className:"ml-1 h-3 w-3"})]}):a.label},s))})]}),e.jsx(Ee,{children:t.table})]})}function Nb({activities:t}){const a=r=>{const n=typeof r=="string"?new Date(r):r,i=new Date().getTime()-n.getTime(),c=Math.floor(i/6e4),m=Math.floor(c/60),d=Math.floor(m/24);return c<1?"À l'instant":c<60?`Il y a ${c} min`:m<24?`Il y a ${m}h`:d<7?`Il y a ${d}j`:n.toLocaleDateString("fr-FR")},s={info:"bg-blue-500",success:"bg-green-500",warning:"bg-yellow-500",error:"bg-red-500"};return e.jsxs(Se,{children:[e.jsx(He,{children:e.jsx(Ve,{className:"text-base",children:"Activité récente"})}),e.jsx(Ee,{children:e.jsx("div",{className:"space-y-4",children:t.map(r=>e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:g("h-2 w-2 rounded-full mt-2 flex-shrink-0",s[r.type||"info"])}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium",children:r.title}),r.description&&e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:r.description})]}),e.jsx("span",{className:"text-xs text-muted-foreground flex-shrink-0",children:a(r.timestamp)})]},r.id))})})]})}function Hl({title:t="Tableau de bord",description:a,stats:s,charts:r,tables:n,activities:o,quickActions:i,showHeader:c=!0,onRefresh:m,loading:d=!1,period:x="month",onPeriodChange:u,periods:f,statsLayout:w="grid",statsColumns:k=4,className:b}){return e.jsxs("div",{className:g("space-y-6",b),children:[c&&e.jsx(jb,{title:t,description:a,period:x,onPeriodChange:u,periods:f,onRefresh:m,loading:d,quickActions:i}),s&&s.length>0&&e.jsx(vb,{stats:s,layout:w,columns:k,loading:d}),r&&r.length>0&&e.jsx("div",{className:"grid gap-6 md:grid-cols-2",children:r.map(y=>e.jsx(wb,{config:y},y.id))}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[n&&n.length>0&&e.jsx("div",{className:g("space-y-6",o?"lg:col-span-2":"lg:col-span-3"),children:n.map(y=>e.jsx(yb,{config:y},y.id))}),o&&o.length>0&&e.jsx("div",{className:g(!n||n.length===0?"lg:col-span-3":""),children:e.jsx(Nb,{activities:o})})]})]})}const Gl=[{id:"revenue",label:"Revenus",value:"€45,231.89",trend:"up",trendValue:"+20.1%",trendText:"vs mois dernier",icon:e.jsx(h.DollarSign,{className:"h-5 w-5"}),color:"success"},{id:"users",label:"Utilisateurs",value:"2,350",trend:"up",trendValue:"+180",trendText:"cette semaine",icon:e.jsx(h.Users,{className:"h-5 w-5"}),color:"blue"},{id:"orders",label:"Commandes",value:"12,234",trend:"down",trendValue:"-4.3%",trendText:"vs mois dernier",icon:e.jsx(h.ShoppingCart,{className:"h-5 w-5"}),color:"purple"},{id:"performance",label:"Performance",value:"94.2%",trend:"up",trendValue:"+2.4%",icon:e.jsx(h.Activity,{className:"h-5 w-5"}),color:"primary"}];function Cb({field:t,value:a,onChange:s}){const r=n=>{s?.(n)};return t.type==="custom"&&t.customComponent?e.jsx("div",{className:"space-y-2",children:t.customComponent}):e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(he,{htmlFor:t.id,className:"text-sm font-medium",children:[t.label,t.required&&e.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),t.type==="switch"&&e.jsx(sa,{id:t.id,checked:a,onCheckedChange:r,disabled:t.disabled})]}),t.description&&t.type!=="switch"&&e.jsx("p",{className:"text-xs text-muted-foreground",children:t.description}),t.type==="switch"&&t.description&&e.jsx("p",{className:"text-xs text-muted-foreground",children:t.description}),t.type==="text"&&e.jsx(oe,{id:t.id,type:"text",value:a||"",onChange:n=>r(n.target.value),placeholder:t.placeholder,disabled:t.disabled}),t.type==="email"&&e.jsx(oe,{id:t.id,type:"email",value:a||"",onChange:n=>r(n.target.value),placeholder:t.placeholder,disabled:t.disabled}),t.type==="password"&&e.jsx(oe,{id:t.id,type:"password",value:a||"",onChange:n=>r(n.target.value),placeholder:t.placeholder,disabled:t.disabled}),t.type==="textarea"&&e.jsx(wt,{id:t.id,value:a||"",onChange:n=>r(n.target.value),placeholder:t.placeholder,disabled:t.disabled,rows:3}),t.type==="select"&&t.options&&e.jsxs(Oe,{value:a,onValueChange:r,disabled:t.disabled,children:[e.jsx(Le,{id:t.id,children:e.jsx(ze,{placeholder:t.placeholder||"Sélectionner..."})}),e.jsx(Ie,{children:t.options.map(n=>e.jsx(be,{value:n.value,children:n.label},n.value))})]})]})}function kb({section:t,values:a,onChange:s}){return e.jsxs(Se,{children:[e.jsx(He,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[t.icon&&e.jsx("span",{className:"text-muted-foreground",children:t.icon}),e.jsxs("div",{children:[e.jsx(Ve,{className:"text-base",children:t.title}),t.description&&e.jsx(nt,{children:t.description})]})]})}),e.jsx(Ee,{className:"space-y-6",children:t.fields.map((r,n)=>e.jsxs(l.Fragment,{children:[e.jsx(Cb,{field:r,value:a?.[r.id],onChange:o=>s?.(r.id,o)}),n<t.fields.length-1&&e.jsx(Et,{className:"my-4"})]},r.id))})]})}function Sb({title:t="Paramètres",description:a="Gérez les paramètres de votre compte et de l'application.",tabs:s,sections:r,useTabs:n=!0,defaultTab:o,values:i={},onChange:c,onSave:m,saving:d=!1,showSaveButton:x=!0,showDeleteAccount:u=!1,onDeleteAccount:f,className:w}){const[k,b]=l.useState(i),[y,v]=l.useState(!1);l.useEffect(()=>{b(i)},[i]);const p=(N,S)=>{b(A=>({...A,[N]:S})),v(!0),c?.(N,S)},j=async()=>{await m?.(k),v(!1)},C=N=>e.jsx("div",{className:"space-y-6",children:N.map(S=>e.jsx(kb,{section:S,values:k,onChange:p},S.id))});return e.jsxs("div",{className:g("space-y-6",w),children:[e.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:t}),a&&e.jsx("p",{className:"text-muted-foreground mt-1",children:a})]}),x&&m&&e.jsxs($,{onClick:j,disabled:d||!y,children:[d?e.jsx(h.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):e.jsx(h.Save,{className:"mr-2 h-4 w-4"}),"Enregistrer"]})]}),n&&s&&s.length>0?e.jsxs(aa,{defaultValue:o||s[0].id,className:"space-y-6",children:[e.jsx(Es,{className:"grid w-full grid-cols-2 md:w-auto md:inline-flex",children:s.map(N=>e.jsxs(js,{value:N.id,className:"gap-2",children:[N.icon,N.label]},N.id))}),s.map(N=>e.jsx(vs,{value:N.id,className:"space-y-6",children:C(N.sections)},N.id))]}):r&&C(r),u&&f&&e.jsxs(Se,{className:"border-destructive",children:[e.jsxs(He,{children:[e.jsxs(Ve,{className:"text-base text-destructive flex items-center gap-2",children:[e.jsx(h.Trash2,{className:"h-4 w-4"}),"Zone dangereuse"]}),e.jsx(nt,{children:"Actions irréversibles concernant votre compte."})]}),e.jsx(Ee,{children:e.jsxs(fs,{children:[e.jsx(To,{asChild:!0,children:e.jsxs($,{variant:"destructive",children:[e.jsx(h.Trash2,{className:"mr-2 h-4 w-4"}),"Supprimer mon compte"]})}),e.jsxs(Xt,{children:[e.jsxs(Yt,{children:[e.jsx(Kt,{children:"Êtes-vous sûr ?"}),e.jsx(Qt,{children:"Cette action est irréversible. Toutes vos données seront définitivement supprimées et ne pourront pas être récupérées."})]}),e.jsxs(Jt,{children:[e.jsx(es,{children:"Annuler"}),e.jsx(Zt,{onClick:f,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Supprimer définitivement"})]})]})]})})]})]})}const Db=[{id:"profile",label:"Profil",icon:e.jsx(h.User,{className:"h-4 w-4"}),sections:[{id:"personal",title:"Informations personnelles",description:"Mettez à jour vos informations personnelles.",icon:e.jsx(h.User,{className:"h-5 w-5"}),fields:[{id:"name",label:"Nom complet",type:"text",placeholder:"Jean Dupont",required:!0},{id:"email",label:"Adresse email",type:"email",placeholder:"jean@exemple.com",required:!0},{id:"bio",label:"Bio",type:"textarea",placeholder:"Parlez-nous de vous..."}]}]},{id:"notifications",label:"Notifications",icon:e.jsx(h.Bell,{className:"h-4 w-4"}),sections:[{id:"email-notifs",title:"Notifications par email",description:"Gérez vos préférences de notification par email.",icon:e.jsx(h.Mail,{className:"h-5 w-5"}),fields:[{id:"notif-marketing",label:"Marketing",description:"Recevoir des emails marketing et promotionnels.",type:"switch"},{id:"notif-security",label:"Sécurité",description:"Recevoir des alertes de sécurité importantes.",type:"switch"},{id:"notif-updates",label:"Mises à jour",description:"Recevoir les mises à jour de produit.",type:"switch"}]}]},{id:"security",label:"Sécurité",icon:e.jsx(h.Shield,{className:"h-4 w-4"}),sections:[{id:"password",title:"Mot de passe",description:"Changez votre mot de passe.",icon:e.jsx(h.Lock,{className:"h-5 w-5"}),fields:[{id:"current-password",label:"Mot de passe actuel",type:"password",placeholder:"••••••••"},{id:"new-password",label:"Nouveau mot de passe",type:"password",placeholder:"••••••••"},{id:"confirm-password",label:"Confirmer le mot de passe",type:"password",placeholder:"••••••••"}]},{id:"two-factor",title:"Authentification à deux facteurs",description:"Ajoutez une couche de sécurité supplémentaire.",icon:e.jsx(h.Smartphone,{className:"h-5 w-5"}),fields:[{id:"2fa-enabled",label:"Activer la 2FA",description:"Utilisez une application d'authentification.",type:"switch"}]}]},{id:"preferences",label:"Préférences",icon:e.jsx(h.Palette,{className:"h-4 w-4"}),sections:[{id:"appearance",title:"Apparence",description:"Personnalisez l'apparence de l'application.",icon:e.jsx(h.Palette,{className:"h-5 w-5"}),fields:[{id:"theme",label:"Thème",type:"select",options:[{value:"light",label:"Clair"},{value:"dark",label:"Sombre"},{value:"system",label:"Système"}]},{id:"language",label:"Langue",type:"select",options:[{value:"fr",label:"Français"},{value:"en",label:"English"},{value:"es",label:"Español"}]}]}]}];function mo({url:t,name:a,size:s="lg",editable:r,onAvatarChange:n}){const o=l.useRef(null),i={sm:"h-12 w-12",md:"h-16 w-16",lg:"h-24 w-24",xl:"h-32 w-32"},c=a.split(" ").map(d=>d[0]).join("").toUpperCase().slice(0,2),m=d=>{const x=d.target.files?.[0];x&&n&&n(x)};return e.jsxs("div",{className:"relative inline-block",children:[e.jsxs(Ct,{className:g(i[s],"border-4 border-background shadow-lg"),children:[e.jsx(kt,{src:t,alt:a}),e.jsx(St,{className:"text-lg font-medium",children:c})]}),r&&n&&e.jsxs(e.Fragment,{children:[e.jsx("input",{ref:o,type:"file",accept:"image/*",onChange:m,className:"hidden"}),e.jsx($,{size:"icon",variant:"secondary",className:"absolute bottom-0 right-0 h-8 w-8 rounded-full shadow-md",onClick:()=>o.current?.click(),children:e.jsx(h.Camera,{className:"h-4 w-4"})})]})]})}function Tb({field:t,value:a,onChange:s,isEditing:r}){if(!r)return e.jsxs("div",{className:"flex items-center gap-2",children:[t.icon&&e.jsx("span",{className:"text-muted-foreground",children:t.icon}),e.jsx("span",{className:g(!a&&"text-muted-foreground italic"),children:a||"Non renseigné"})]});const n={id:t.id,value:a||"",onChange:o=>s(o.target.value),placeholder:t.placeholder,disabled:t.disabled};return t.type==="textarea"?e.jsx(wt,{...n,rows:3}):t.type==="select"&&t.options?e.jsxs(Oe,{value:a,onValueChange:s,disabled:t.disabled,children:[e.jsx(Le,{children:e.jsx(ze,{placeholder:t.placeholder||"Sélectionner..."})}),e.jsx(Ie,{children:t.options.map(o=>e.jsx(be,{value:o.value,children:o.label},o.value))})]}):e.jsx(oe,{type:t.type||"text",...n})}function ho({section:t,values:a,onChange:s,isEditing:r}){return e.jsxs(Se,{children:[e.jsx(He,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[t.icon&&e.jsx("span",{className:"text-muted-foreground",children:t.icon}),e.jsxs("div",{children:[e.jsx(Ve,{className:"text-base",children:t.title}),t.description&&e.jsx(nt,{children:t.description})]})]})}),e.jsx(Ee,{className:"space-y-4",children:t.fields.map((n,o)=>e.jsxs(l.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(he,{htmlFor:n.id,className:"text-sm font-medium",children:[n.label,n.required&&e.jsx("span",{className:"text-destructive ml-1",children:"*"})]}),e.jsx(Tb,{field:n,value:a[n.id]||"",onChange:i=>s(n.id,i),isEditing:r})]}),o<t.fields.length-1&&r&&e.jsx(Et,{className:"my-4"})]},n.id))})]})}function Eb({links:t,isEditing:a}){const s=r=>{switch(r){case"twitter":return e.jsx(h.Twitter,{className:"h-4 w-4"});case"github":return e.jsx(h.Github,{className:"h-4 w-4"});case"linkedin":return e.jsx(h.Linkedin,{className:"h-4 w-4"});case"website":return e.jsx(h.Globe,{className:"h-4 w-4"});default:return e.jsx(h.Link,{className:"h-4 w-4"})}};return a?e.jsx("div",{className:"space-y-2",children:t.map(r=>e.jsxs("div",{className:"flex items-center gap-2",children:[s(r.type),e.jsx(oe,{value:r.url,className:"flex-1",readOnly:!0})]},r.id))}):e.jsx("div",{className:"flex gap-2 flex-wrap",children:t.map(r=>e.jsxs("a",{href:r.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 px-3 py-1.5 bg-muted rounded-full text-sm hover:bg-muted/80 transition-colors",children:[s(r.type),e.jsx("span",{children:r.label||r.type})]},r.id))})}function Mb({profile:t,editable:a=!1,isEditing:s,onEditToggle:r,onChange:n,onSave:o,saving:i=!1,onAvatarChange:c,customSections:m,showSocialLinks:d=!0,showStats:x=!1,stats:u,layout:f="card",useTabs:w=!1,className:k}){const[b,y]=l.useState(!1),[v,p]=l.useState(t),j=s??b;l.useEffect(()=>{p(t)},[t]);const C=P=>{r?r(P):y(P),P||p(t)},N=(P,T)=>{p(q=>({...q,[P]:T})),n?.(P,T)},S=async()=>{await o?.(v),C(!1)},A=[{id:"personal",title:"Informations personnelles",icon:e.jsx(h.User,{className:"h-5 w-5"}),fields:[{id:"firstName",label:"Prénom",value:v.firstName||"",type:"text",placeholder:"Jean",icon:e.jsx(h.User,{className:"h-4 w-4"})},{id:"lastName",label:"Nom",value:v.lastName||"",type:"text",placeholder:"Dupont"},{id:"email",label:"Email",value:v.email,type:"email",placeholder:"jean@exemple.com",required:!0,icon:e.jsx(h.Mail,{className:"h-4 w-4"})},{id:"phone",label:"Téléphone",value:v.phone||"",type:"tel",placeholder:"+33 6 12 34 56 78",icon:e.jsx(h.Phone,{className:"h-4 w-4"})},{id:"bio",label:"Bio",value:v.bio||"",type:"textarea",placeholder:"Parlez-nous de vous..."}]},{id:"professional",title:"Informations professionnelles",icon:e.jsx(h.Briefcase,{className:"h-5 w-5"}),fields:[{id:"role",label:"Poste",value:v.role||"",type:"text",placeholder:"Développeur Senior",icon:e.jsx(h.Briefcase,{className:"h-4 w-4"})},{id:"department",label:"Département",value:v.department||"",type:"text",placeholder:"Engineering"},{id:"company",label:"Entreprise",value:v.company||"",type:"text",placeholder:"Acme Inc.",icon:e.jsx(h.Building,{className:"h-4 w-4"})},{id:"location",label:"Localisation",value:v.location||"",type:"text",placeholder:"Paris, France",icon:e.jsx(h.MapPin,{className:"h-4 w-4"})},{id:"website",label:"Site web",value:v.website||"",type:"url",placeholder:"https://exemple.com",icon:e.jsx(h.Globe,{className:"h-4 w-4"})}]}],R=m||A,E={firstName:v.firstName||"",lastName:v.lastName||"",email:v.email,phone:v.phone||"",bio:v.bio||"",role:v.role||"",department:v.department||"",company:v.company||"",location:v.location||"",website:v.website||"",...v.customFields};if(f==="compact")return e.jsxs("div",{className:g("flex items-center gap-4",k),children:[e.jsx(mo,{url:v.avatarUrl,name:v.displayName,size:"md"}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold",children:v.displayName}),v.role&&e.jsx("p",{className:"text-sm text-muted-foreground",children:v.role}),v.email&&e.jsx("p",{className:"text-sm text-muted-foreground",children:v.email})]})]});const D=()=>e.jsxs("div",{className:"flex flex-col items-center text-center gap-4 md:flex-row md:text-left",children:[e.jsx(mo,{url:v.avatarUrl,name:v.displayName,size:"xl",editable:a&&j,onAvatarChange:c}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-start md:justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold",children:v.displayName}),v.role&&e.jsx("p",{className:"text-muted-foreground",children:v.role}),v.company&&e.jsxs("p",{className:"text-sm text-muted-foreground flex items-center gap-1",children:[e.jsx(h.Building,{className:"h-3 w-3"}),v.company]}),v.location&&e.jsxs("p",{className:"text-sm text-muted-foreground flex items-center gap-1",children:[e.jsx(h.MapPin,{className:"h-3 w-3"}),v.location]})]}),a&&e.jsx("div",{className:"flex gap-2",children:j?e.jsxs(e.Fragment,{children:[e.jsxs($,{variant:"outline",size:"sm",onClick:()=>C(!1),disabled:i,children:[e.jsx(h.X,{className:"mr-2 h-4 w-4"}),"Annuler"]}),e.jsxs($,{size:"sm",onClick:S,disabled:i,children:[i?e.jsx(h.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}):e.jsx(h.Save,{className:"mr-2 h-4 w-4"}),"Enregistrer"]})]}):e.jsxs($,{variant:"outline",size:"sm",onClick:()=>C(!0),children:[e.jsx(h.Edit3,{className:"mr-2 h-4 w-4"}),"Modifier"]})})]}),x&&u&&u.length>0&&e.jsx("div",{className:"flex gap-6 mt-4",children:u.map((P,T)=>e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-2xl font-bold",children:P.value}),e.jsx("div",{className:"text-xs text-muted-foreground",children:P.label})]},T))}),d&&v.socialLinks&&v.socialLinks.length>0&&e.jsx("div",{className:"mt-4",children:e.jsx(Eb,{links:v.socialLinks,isEditing:j})}),v.joinedAt&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-4 flex items-center gap-1",children:[e.jsx(h.Calendar,{className:"h-3 w-3"}),"Membre depuis"," ",new Date(v.joinedAt).toLocaleDateString("fr-FR",{month:"long",year:"numeric"})]})]})]}),M=()=>e.jsx("div",{className:"space-y-6",children:R.map(P=>e.jsx(ho,{section:P,values:E,onChange:N,isEditing:j},P.id))});return f==="card"?e.jsx(Se,{className:k,children:e.jsx(Ee,{className:"pt-6",children:e.jsxs("div",{className:"space-y-6",children:[D(),e.jsx(Et,{}),M()]})})}):e.jsxs("div",{className:g("space-y-6",k),children:[D(),w?e.jsxs(aa,{defaultValue:R[0]?.id,className:"space-y-6",children:[e.jsx(Es,{children:R.map(P=>e.jsxs(js,{value:P.id,className:"gap-2",children:[P.icon,P.title]},P.id))}),R.map(P=>e.jsx(vs,{value:P.id,children:e.jsx(ho,{section:P,values:E,onChange:N,isEditing:j})},P.id))]}):M()]})}const Pb={displayName:"Jean Dupont",firstName:"Jean",lastName:"Dupont",email:"jean.dupont@exemple.com",phone:"+33 6 12 34 56 78",bio:"Développeur passionné avec plus de 10 ans d'expérience dans le développement web et mobile.",avatarUrl:"",role:"Lead Developer",department:"Engineering",company:"Acme Inc.",location:"Paris, France",website:"https://jeandupont.dev",joinedAt:new Date("2023-01-15"),socialLinks:[{id:"1",type:"twitter",url:"https://twitter.com/jeandupont",label:"@jeandupont"},{id:"2",type:"github",url:"https://github.com/jeandupont",label:"jeandupont"},{id:"3",type:"linkedin",url:"https://linkedin.com/in/jeandupont",label:"Jean Dupont"}]},Xl=[{value:"admin",label:"Administrateur",color:"destructive"},{value:"moderator",label:"Modérateur",color:"warning"},{value:"user",label:"Utilisateur",color:"default"},{value:"guest",label:"Invité",color:"secondary"}],Ra={active:{label:"Actif",color:"bg-green-500",icon:h.CheckCircle},inactive:{label:"Inactif",color:"bg-gray-500",icon:h.XCircle},pending:{label:"En attente",color:"bg-yellow-500",icon:h.Mail},banned:{label:"Banni",color:"bg-red-500",icon:h.Ban}};function Ab({user:t,size:a="sm"}){const s={sm:"h-8 w-8",md:"h-10 w-10"},r=t.displayName.split(" ").map(n=>n[0]).join("").toUpperCase().slice(0,2);return e.jsxs(Ct,{className:s[a],children:[e.jsx(kt,{src:t.avatarUrl,alt:t.displayName}),e.jsx(St,{className:"text-xs",children:r})]})}function Rb({role:t,roles:a=Xl}){const s=a.find(n=>n.value===t),r=t==="admin"?h.ShieldAlert:t==="moderator"?h.ShieldCheck:h.Shield;return e.jsxs(De,{variant:s?.color,children:[e.jsx(r,{className:"h-3 w-3 mr-1"}),s?.label||t]})}function Fb({status:t}){const a=Ra[t];return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:g("h-2 w-2 rounded-full",a.color)}),e.jsx("span",{className:"text-sm",children:a.label})]})}function fo({open:t,onOpenChange:a,user:s,roles:r,permissions:n,onSubmit:o,loading:i}){const[c,m]=l.useState({email:"",displayName:"",firstName:"",lastName:"",role:"user",status:"pending",permissions:[]});l.useEffect(()=>{m(s?{email:s.email,displayName:s.displayName,firstName:s.firstName||"",lastName:s.lastName||"",role:s.role,status:s.status,permissions:s.permissions||[]}:{email:"",displayName:"",firstName:"",lastName:"",role:"user",status:"pending",permissions:[]})},[s,t]);const d=async u=>{u.preventDefault(),await o(c),a(!1)},x=u=>{m(f=>({...f,permissions:f.permissions?.includes(u)?f.permissions.filter(w=>w!==u):[...f.permissions||[],u]}))};return e.jsx(It,{open:t,onOpenChange:a,children:e.jsx(Tt,{className:"sm:max-w-[500px]",children:e.jsxs("form",{onSubmit:d,children:[e.jsxs(qt,{children:[e.jsx(Gt,{children:s?"Modifier l'utilisateur":"Créer un utilisateur"}),e.jsx(Cs,{children:s?"Modifiez les informations de l'utilisateur.":"Remplissez les informations pour créer un nouvel utilisateur."})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(he,{htmlFor:"firstName",children:"Prénom"}),e.jsx(oe,{id:"firstName",value:c.firstName,onChange:u=>m(f=>({...f,firstName:u.target.value})),placeholder:"Jean"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(he,{htmlFor:"lastName",children:"Nom"}),e.jsx(oe,{id:"lastName",value:c.lastName,onChange:u=>m(f=>({...f,lastName:u.target.value})),placeholder:"Dupont"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(he,{htmlFor:"displayName",children:"Nom d'affichage *"}),e.jsx(oe,{id:"displayName",value:c.displayName,onChange:u=>m(f=>({...f,displayName:u.target.value})),placeholder:"Jean Dupont",required:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(he,{htmlFor:"email",children:"Email *"}),e.jsx(oe,{id:"email",type:"email",value:c.email,onChange:u=>m(f=>({...f,email:u.target.value})),placeholder:"jean@exemple.com",required:!0})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(he,{htmlFor:"role",children:"Rôle"}),e.jsxs(Oe,{value:c.role,onValueChange:u=>m(f=>({...f,role:u})),children:[e.jsx(Le,{children:e.jsx(ze,{})}),e.jsx(Ie,{children:r.map(u=>e.jsx(be,{value:u.value,children:u.label},u.value))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(he,{htmlFor:"status",children:"Statut"}),e.jsxs(Oe,{value:c.status,onValueChange:u=>m(f=>({...f,status:u})),children:[e.jsx(Le,{children:e.jsx(ze,{})}),e.jsx(Ie,{children:Object.entries(Ra).map(([u,f])=>e.jsx(be,{value:u,children:f.label},u))})]})]})]}),n&&n.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(he,{children:"Permissions"}),e.jsx("div",{className:"border rounded-md p-3 space-y-2 max-h-[150px] overflow-y-auto",children:n.map(u=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(et,{id:u.id,checked:c.permissions?.includes(u.id),onCheckedChange:()=>x(u.id)}),e.jsx("label",{htmlFor:u.id,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:u.name})]},u.id))})]})]}),e.jsxs(Ht,{children:[e.jsx($,{type:"button",variant:"outline",onClick:()=>a(!1),children:"Annuler"}),e.jsxs($,{type:"submit",disabled:i,children:[i&&e.jsx(h.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),s?"Enregistrer":"Créer"]})]})]})})})}function $b({user:t,onEdit:a,onDelete:s,onResetPassword:r,onStatusChange:n,onRoleChange:o,roles:i}){return e.jsxs(Ge,{children:[e.jsx(Xe,{asChild:!0,children:e.jsx($,{variant:"ghost",size:"icon",className:"h-8 w-8",children:e.jsx(h.MoreHorizontal,{className:"h-4 w-4"})})}),e.jsxs(Ue,{align:"end",children:[a&&e.jsxs(xe,{onClick:a,children:[e.jsx(h.Edit,{className:"mr-2 h-4 w-4"}),"Modifier"]}),r&&e.jsxs(xe,{onClick:r,children:[e.jsx(h.Key,{className:"mr-2 h-4 w-4"}),"Réinitialiser le mot de passe"]}),o&&e.jsxs(e.Fragment,{children:[e.jsx(Ze,{}),e.jsx(ms,{children:"Changer le rôle"}),i.map(c=>e.jsx(xe,{onClick:()=>o(c.value),disabled:t.role===c.value,children:c.label},c.value))]}),n&&e.jsxs(e.Fragment,{children:[e.jsx(Ze,{}),e.jsx(ms,{children:"Changer le statut"}),Object.entries(Ra).map(([c,m])=>e.jsx(xe,{onClick:()=>n(c),disabled:t.status===c,children:m.label},c))]}),s&&e.jsxs(e.Fragment,{children:[e.jsx(Ze,{}),e.jsxs(xe,{onClick:s,className:"text-destructive focus:text-destructive",children:[e.jsx(h.Trash2,{className:"mr-2 h-4 w-4"}),"Supprimer"]})]})]})]})}function Lb({users:t,roles:a=Xl,permissions:s,selectedUsers:r=[],onSelectionChange:n,onCreate:o,onEdit:i,onDelete:c,onBulkDelete:m,onRoleChange:d,onStatusChange:x,onResetPassword:u,onExport:f,onRefresh:w,loading:k=!1,actionLoading:b=!1,searchQuery:y="",onSearchChange:v,roleFilter:p="all",onRoleFilterChange:j,statusFilter:C="all",onStatusFilterChange:N,showBulkActions:S=!0,showCreateButton:A=!0,title:R="Gestion des utilisateurs",description:E="Gérez les utilisateurs, leurs rôles et permissions.",className:D}){const[M,P]=l.useState(!1),[T,q]=l.useState(null),[H,Y]=l.useState(null),[U,z]=l.useState(!1),V=l.useMemo(()=>t.filter(X=>{if(y){const K=y.toLowerCase();if(!(X.displayName.toLowerCase().includes(K)||X.email.toLowerCase().includes(K)))return!1}return!(p!=="all"&&X.role!==p||C!=="all"&&X.status!==C)}),[t,y,p,C]),L=X=>{n?.(X?V.map(K=>K.id):[])},W=(X,K)=>{n?.(K?[...r,X]:r.filter(I=>I!==X))},F=async X=>{await o?.(X)},G=async X=>{T&&(await i?.(T.id,X),q(null))},ee=async()=>{H&&(await c?.(H.id),Y(null))},se=async()=>{await m?.(r),n?.([]),z(!1)},le=X=>(typeof X=="string"?new Date(X):X).toLocaleDateString("fr-FR",{day:"numeric",month:"short",year:"numeric"});return e.jsxs("div",{className:g("space-y-6",D),children:[e.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl font-bold tracking-tight flex items-center gap-2",children:[e.jsx(h.Users,{className:"h-6 w-6"}),R]}),E&&e.jsx("p",{className:"text-muted-foreground mt-1",children:E})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[w&&e.jsx($,{variant:"outline",size:"sm",onClick:w,disabled:k,children:e.jsx(h.RefreshCw,{className:g("h-4 w-4",k&&"animate-spin")})}),f&&e.jsxs($,{variant:"outline",size:"sm",onClick:f,children:[e.jsx(h.Download,{className:"mr-2 h-4 w-4"}),"Exporter"]}),A&&o&&e.jsxs($,{size:"sm",onClick:()=>P(!0),children:[e.jsx(h.UserPlus,{className:"mr-2 h-4 w-4"}),"Ajouter"]})]})]}),e.jsx(Se,{children:e.jsxs(Ee,{className:"pt-6",children:[e.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center",children:[v&&e.jsxs("div",{className:"relative flex-1",children:[e.jsx(h.Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(oe,{placeholder:"Rechercher un utilisateur...",value:y,onChange:X=>v(X.target.value),className:"pl-9"})]}),j&&e.jsxs(Oe,{value:p,onValueChange:X=>j(X),children:[e.jsxs(Le,{className:"w-[180px]",children:[e.jsx(h.Filter,{className:"mr-2 h-4 w-4"}),e.jsx(ze,{placeholder:"Rôle"})]}),e.jsxs(Ie,{children:[e.jsx(be,{value:"all",children:"Tous les rôles"}),a.map(X=>e.jsx(be,{value:X.value,children:X.label},X.value))]})]}),N&&e.jsxs(Oe,{value:C,onValueChange:X=>N(X),children:[e.jsxs(Le,{className:"w-[180px]",children:[e.jsx(h.Filter,{className:"mr-2 h-4 w-4"}),e.jsx(ze,{placeholder:"Statut"})]}),e.jsxs(Ie,{children:[e.jsx(be,{value:"all",children:"Tous les statuts"}),Object.entries(Ra).map(([X,K])=>e.jsx(be,{value:X,children:K.label},X))]})]})]}),S&&r.length>0&&e.jsxs("div",{className:"flex items-center gap-4 mt-4 p-3 bg-muted rounded-lg",children:[e.jsxs("span",{className:"text-sm font-medium",children:[r.length," utilisateur(s) sélectionné(s)"]}),m&&e.jsxs($,{variant:"destructive",size:"sm",onClick:()=>z(!0),children:[e.jsx(h.Trash2,{className:"mr-2 h-4 w-4"}),"Supprimer"]}),e.jsx($,{variant:"outline",size:"sm",onClick:()=>n?.([]),children:"Désélectionner"})]})]})}),e.jsx(Se,{children:e.jsx(Ee,{className:"p-0",children:e.jsxs(Ea,{children:[e.jsx(Ma,{children:e.jsxs(Bt,{children:[n&&e.jsx(lt,{className:"w-[50px]",children:e.jsx(et,{checked:V.length>0&&r.length===V.length,onCheckedChange:L})}),e.jsx(lt,{children:"Utilisateur"}),e.jsx(lt,{children:"Rôle"}),e.jsx(lt,{children:"Statut"}),e.jsx(lt,{children:"Inscrit le"}),e.jsx(lt,{children:"Dernière connexion"}),e.jsx(lt,{className:"w-[50px]"})]})}),e.jsx(Pa,{children:k?e.jsx(Bt,{children:e.jsx(st,{colSpan:n?7:6,className:"text-center py-8",children:e.jsx(h.Loader2,{className:"h-6 w-6 animate-spin mx-auto"})})}):V.length===0?e.jsx(Bt,{children:e.jsx(st,{colSpan:n?7:6,className:"text-center py-8 text-muted-foreground",children:"Aucun utilisateur trouvé"})}):V.map(X=>e.jsxs(Bt,{children:[n&&e.jsx(st,{children:e.jsx(et,{checked:r.includes(X.id),onCheckedChange:K=>W(X.id,K)})}),e.jsx(st,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Ab,{user:X}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:X.displayName}),e.jsx("div",{className:"text-sm text-muted-foreground",children:X.email})]})]})}),e.jsx(st,{children:e.jsx(Rb,{role:X.role,roles:a})}),e.jsx(st,{children:e.jsx(Fb,{status:X.status})}),e.jsx(st,{className:"text-muted-foreground",children:le(X.createdAt)}),e.jsx(st,{className:"text-muted-foreground",children:X.lastLogin?le(X.lastLogin):"-"}),e.jsx(st,{children:e.jsx($b,{user:X,roles:a,onEdit:i?()=>q(X):void 0,onDelete:c?()=>Y(X):void 0,onResetPassword:u?()=>u(X.id):void 0,onRoleChange:d?K=>d(X.id,K):void 0,onStatusChange:x?K=>x(X.id,K):void 0})})]},X.id))})]})})}),e.jsx(fo,{open:M,onOpenChange:P,roles:a,permissions:s,onSubmit:F,loading:b}),e.jsx(fo,{open:!!T,onOpenChange:X=>!X&&q(null),user:T||void 0,roles:a,permissions:s,onSubmit:G,loading:b}),e.jsx(fs,{open:!!H,onOpenChange:X=>!X&&Y(null),children:e.jsxs(Xt,{children:[e.jsxs(Yt,{children:[e.jsx(Kt,{children:"Supprimer l'utilisateur ?"}),e.jsxs(Qt,{children:["Êtes-vous sûr de vouloir supprimer ",H?.displayName," ? Cette action est irréversible."]})]}),e.jsxs(Jt,{children:[e.jsx(es,{children:"Annuler"}),e.jsx(Zt,{onClick:ee,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Supprimer"})]})]})}),e.jsx(fs,{open:U,onOpenChange:z,children:e.jsxs(Xt,{children:[e.jsxs(Yt,{children:[e.jsx(Kt,{children:"Supprimer les utilisateurs ?"}),e.jsxs(Qt,{children:["Êtes-vous sûr de vouloir supprimer ",r.length," utilisateur(s) ? Cette action est irréversible."]})]}),e.jsxs(Jt,{children:[e.jsx(es,{children:"Annuler"}),e.jsx(Zt,{onClick:se,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Supprimer"})]})]})})]})}const Ib=[{id:"1",email:"admin@exemple.com",displayName:"Admin User",firstName:"Admin",lastName:"User",role:"admin",status:"active",createdAt:new Date("2023-01-01"),lastLogin:new Date("2024-01-15")},{id:"2",email:"moderator@exemple.com",displayName:"Marie Modérateur",firstName:"Marie",lastName:"Modérateur",role:"moderator",status:"active",createdAt:new Date("2023-03-15"),lastLogin:new Date("2024-01-14")},{id:"3",email:"user@exemple.com",displayName:"Jean Utilisateur",firstName:"Jean",lastName:"Utilisateur",role:"user",status:"active",createdAt:new Date("2023-06-01"),lastLogin:new Date("2024-01-10")},{id:"4",email:"pending@exemple.com",displayName:"Paul Pending",firstName:"Paul",lastName:"Pending",role:"user",status:"pending",createdAt:new Date("2024-01-10")},{id:"5",email:"banned@exemple.com",displayName:"Bob Banni",firstName:"Bob",lastName:"Banni",role:"guest",status:"banned",createdAt:new Date("2023-09-01"),lastLogin:new Date("2023-12-01")}],Ob=[{id:"read",name:"Lecture",description:"Accès en lecture",category:"Base"},{id:"write",name:"Écriture",description:"Accès en écriture",category:"Base"},{id:"delete",name:"Suppression",description:"Accès suppression",category:"Base"},{id:"admin",name:"Administration",description:"Accès admin",category:"Admin"},{id:"users",name:"Gestion utilisateurs",description:"Gérer les utilisateurs",category:"Admin"}],Yl={created:{icon:h.Plus,color:"text-green-500",label:"créé"},updated:{icon:h.Edit,color:"text-blue-500",label:"modifié"},deleted:{icon:h.Trash2,color:"text-red-500",label:"supprimé"},commented:{icon:h.MessageSquare,color:"text-purple-500",label:"commenté"},uploaded:{icon:h.Upload,color:"text-cyan-500",label:"uploadé"},downloaded:{icon:h.Download,color:"text-gray-500",label:"téléchargé"},shared:{icon:h.User,color:"text-orange-500",label:"partagé"},approved:{icon:h.Check,color:"text-green-500",label:"approuvé"},rejected:{icon:h.X,color:"text-red-500",label:"rejeté"},mentioned:{icon:h.Bell,color:"text-yellow-500",label:"mentionné"},assigned:{icon:h.User,color:"text-indigo-500",label:"assigné"},completed:{icon:h.Check,color:"text-green-500",label:"terminé"},custom:{icon:h.AlertCircle,color:"text-gray-500",label:""}};function po({user:t,size:a="sm"}){const s={sm:"h-8 w-8",md:"h-10 w-10"},r=t.name.split(" ").map(n=>n[0]).join("").toUpperCase().slice(0,2);return e.jsxs(Ct,{className:s[a],children:[e.jsx(kt,{src:t.avatar,alt:t.name}),e.jsx(St,{className:"text-xs",children:r})]})}function xo({type:t,customIcon:a,customColor:s}){const r=Yl[t],n=r.icon;return e.jsx("div",{className:g("flex h-8 w-8 items-center justify-center rounded-full bg-background border-2 shadow-sm",s||r.color),children:a||e.jsx(n,{className:"h-4 w-4"})})}function zb({activity:t,showAvatar:a,relativeTime:s,layout:r,isLast:n}){const o=c=>{const m=typeof c=="string"?new Date(c):c;if(s){const x=new Date().getTime()-m.getTime(),u=Math.floor(x/6e4),f=Math.floor(u/60),w=Math.floor(f/24);if(u<1)return"À l'instant";if(u<60)return`Il y a ${u} min`;if(f<24)return`Il y a ${f}h`;if(w<7)return`Il y a ${w}j`}return m.toLocaleDateString("fr-FR",{day:"numeric",month:"short",hour:"2-digit",minute:"2-digit"})},i=Yl[t.type];return r==="compact"?e.jsxs("div",{className:"flex items-center gap-3 py-2",children:[e.jsx(xo,{type:t.type,customIcon:t.icon,customColor:t.color}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("p",{className:"text-sm truncate",children:[e.jsx("span",{className:"font-medium",children:t.user.name})," ",e.jsx("span",{className:"text-muted-foreground",children:t.title})]})}),e.jsx("span",{className:"text-xs text-muted-foreground flex-shrink-0",children:o(t.timestamp)})]}):r==="feed"?e.jsx(Se,{className:"mb-4",children:e.jsx(Ee,{className:"pt-4",children:e.jsxs("div",{className:"flex gap-3",children:[a&&e.jsx(po,{user:t.user,size:"md"}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"font-medium",children:t.user.name}),e.jsx(De,{variant:"secondary",className:"text-xs",children:i.label||t.type}),e.jsx("span",{className:"text-xs text-muted-foreground",children:o(t.timestamp)})]}),e.jsx("p",{className:"text-sm",children:t.title}),t.description&&e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:t.description}),t.metadata?.comment&&e.jsx("div",{className:"mt-2 p-3 bg-muted rounded-lg text-sm",children:t.metadata.comment})]})]})})}):e.jsxs("div",{className:"flex gap-4",children:[e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx(xo,{type:t.type,customIcon:t.icon,customColor:t.color}),!n&&e.jsx("div",{className:"w-0.5 flex-1 bg-border mt-2"})]}),e.jsx("div",{className:"flex-1 pb-8",children:e.jsxs("div",{className:"flex items-start gap-3",children:[a&&e.jsx(po,{user:t.user}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"font-medium",children:t.user.name}),e.jsx("span",{className:"text-muted-foreground",children:t.title})]}),t.description&&e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:t.description}),t.metadata?.comment&&e.jsx("div",{className:"mt-2 p-3 bg-muted rounded-lg text-sm",children:t.metadata.comment}),e.jsx("span",{className:"text-xs text-muted-foreground mt-2 block",children:o(t.timestamp)})]})]})})]})}function _b({activities:t,title:a="Activité",showSearch:s=!0,showFilters:r=!0,filters:n=[],activeFilter:o,onFilterChange:i,showRefresh:c=!0,onRefresh:m,loading:d=!1,groupByDay:x=!0,showLoadMore:u=!1,onLoadMore:f,loadingMore:w=!1,showAvatars:k=!0,relativeTime:b=!0,layout:y="timeline",className:v}){const[p,j]=l.useState(""),[C,N]=l.useState(null),S=o??C,A=M=>{i?i(M):N(M)},R=l.useMemo(()=>{let M=t;if(p){const P=p.toLowerCase();M=M.filter(T=>T.title.toLowerCase().includes(P)||T.user.name.toLowerCase().includes(P)||T.description?.toLowerCase().includes(P))}if(S){const P=n.find(T=>T.id===S);P&&(M=M.filter(T=>P.types.includes(T.type)))}return M},[t,p,S,n]),E=l.useMemo(()=>{if(!x)return null;const M={};return R.forEach(P=>{const q=(typeof P.timestamp=="string"?new Date(P.timestamp):P.timestamp).toLocaleDateString("fr-FR",{weekday:"long",day:"numeric",month:"long",year:"numeric"});M[q]||(M[q]=[]),M[q].push(P)}),M},[R,x]),D=M=>e.jsx("div",{children:M.map((P,T)=>e.jsx(zb,{activity:P,showAvatar:k,relativeTime:b,layout:y,isLast:T===M.length-1},P.id))});return e.jsxs("div",{className:g("space-y-4",v),children:[e.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[e.jsx("h2",{className:"text-xl font-semibold",children:a}),e.jsx("div",{className:"flex items-center gap-2",children:c&&m&&e.jsx($,{variant:"outline",size:"sm",onClick:m,disabled:d,children:e.jsx(h.RefreshCw,{className:g("h-4 w-4",d&&"animate-spin")})})})]}),(s||r)&&e.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center",children:[s&&e.jsxs("div",{className:"relative flex-1 max-w-sm",children:[e.jsx(h.Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(oe,{placeholder:"Rechercher...",value:p,onChange:M=>j(M.target.value),className:"pl-9"})]}),r&&n.length>0&&e.jsxs(Oe,{value:S||"all",onValueChange:M=>A(M==="all"?null:M),children:[e.jsxs(Le,{className:"w-[180px]",children:[e.jsx(h.Filter,{className:"h-4 w-4 mr-2"}),e.jsx(ze,{placeholder:"Filtrer"})]}),e.jsxs(Ie,{children:[e.jsx(be,{value:"all",children:"Toutes les activités"}),n.map(M=>e.jsx(be,{value:M.id,children:M.label},M.id))]})]})]}),d?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(h.RefreshCw,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):R.length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx(h.Clock,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),e.jsx("p",{className:"text-muted-foreground",children:"Aucune activité"})]}):x&&E?e.jsx("div",{className:"space-y-6",children:Object.entries(E).map(([M,P])=>e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-4 capitalize",children:M}),D(P)]},M))}):D(R),u&&f&&e.jsx("div",{className:"flex justify-center pt-4",children:e.jsxs($,{variant:"outline",onClick:f,disabled:w,children:[w?e.jsx(h.RefreshCw,{className:"h-4 w-4 animate-spin mr-2"}):e.jsx(h.ChevronDown,{className:"h-4 w-4 mr-2"}),"Charger plus"]})})]})}const Vb=[{id:"edits",label:"Modifications",types:["created","updated","deleted"]},{id:"comments",label:"Commentaires",types:["commented","mentioned"]},{id:"files",label:"Fichiers",types:["uploaded","downloaded","shared"]},{id:"approvals",label:"Approbations",types:["approved","rejected","completed"]}],Wb=[{id:"1",type:"created",title:"a créé le document 'Rapport Q4'",user:{id:"1",name:"Marie Dupont"},timestamp:new Date(Date.now()-1e3*60*5)},{id:"2",type:"commented",title:"a commenté sur 'Projet Alpha'",user:{id:"2",name:"Pierre Martin"},timestamp:new Date(Date.now()-1e3*60*30),metadata:{comment:"Super travail sur cette partie !"}},{id:"3",type:"uploaded",title:"a uploadé 3 fichiers",user:{id:"3",name:"Sophie Bernard"},timestamp:new Date(Date.now()-1e3*60*60*2)},{id:"4",type:"approved",title:"a approuvé la demande de congés",user:{id:"1",name:"Marie Dupont"},timestamp:new Date(Date.now()-1e3*60*60*24)}],fn={blue:{bg:"bg-blue-100",text:"text-blue-700",border:"border-blue-500"},green:{bg:"bg-green-100",text:"text-green-700",border:"border-green-500"},red:{bg:"bg-red-100",text:"text-red-700",border:"border-red-500"},yellow:{bg:"bg-yellow-100",text:"text-yellow-700",border:"border-yellow-500"},purple:{bg:"bg-purple-100",text:"text-purple-700",border:"border-purple-500"},pink:{bg:"bg-pink-100",text:"text-pink-700",border:"border-pink-500"},orange:{bg:"bg-orange-100",text:"text-orange-700",border:"border-orange-500"},cyan:{bg:"bg-cyan-100",text:"text-cyan-700",border:"border-cyan-500"}};function Ub(t,a){const s=[],r=new Date(t,a+1,0);for(let n=1;n<=r.getDate();n++)s.push(new Date(t,a,n));return s}function lr(t,a){return t.getFullYear()===a.getFullYear()&&t.getMonth()===a.getMonth()&&t.getDate()===a.getDate()}function Bb(t,a){return t.filter(s=>{const r=typeof s.start=="string"?new Date(s.start):s.start,n=typeof s.end=="string"?new Date(s.end):s.end;return s.allDay?lr(r,a)||a>=r&&a<=n:lr(r,a)})}function qb({currentDate:t,viewMode:a,onPrevious:s,onNext:r,onToday:n,onViewModeChange:o,onAddClick:i,showViewSelector:c,showAddButton:m,locale:d}){const x=()=>{switch(a){case"month":return t.toLocaleDateString(d,{month:"long",year:"numeric"});case"week":return`Semaine du ${t.toLocaleDateString(d,{day:"numeric",month:"long"})}`;case"day":return t.toLocaleDateString(d,{weekday:"long",day:"numeric",month:"long",year:"numeric"});case"agenda":return"Agenda";default:return""}};return e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($,{variant:"outline",size:"icon",onClick:s,children:e.jsx(h.ChevronLeft,{className:"h-4 w-4"})}),e.jsx($,{variant:"outline",size:"icon",onClick:r,children:e.jsx(h.ChevronRight,{className:"h-4 w-4"})}),e.jsx($,{variant:"outline",size:"sm",onClick:n,children:"Aujourd'hui"}),e.jsx("h2",{className:"text-xl font-semibold ml-4 capitalize",children:x()})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[c&&o&&e.jsxs(Oe,{value:a,onValueChange:u=>o(u),children:[e.jsx(Le,{className:"w-[120px]",children:e.jsx(ze,{})}),e.jsxs(Ie,{children:[e.jsx(be,{value:"month",children:"Mois"}),e.jsx(be,{value:"week",children:"Semaine"}),e.jsx(be,{value:"day",children:"Jour"}),e.jsx(be,{value:"agenda",children:"Agenda"})]})]}),m&&i&&e.jsxs($,{onClick:i,children:[e.jsx(h.Plus,{className:"h-4 w-4 mr-2"}),"Événement"]})]})]})}function Hb({event:t,onClick:a,compact:s=!1}){const r=fn[t.color||"blue"],n=typeof t.start=="string"?new Date(t.start):t.start;return e.jsxs("button",{onClick:o=>{o.stopPropagation(),a?.()},className:g("w-full text-left rounded px-1.5 py-0.5 text-xs truncate border-l-2",r.bg,r.text,r.border),children:[!t.allDay&&!s&&e.jsx("span",{className:"font-medium mr-1",children:n.toLocaleTimeString("fr-FR",{hour:"2-digit",minute:"2-digit"})}),t.title]})}function Gb({event:t,onEdit:a,onDelete:s}){const r=typeof t.start=="string"?new Date(t.start):t.start,n=typeof t.end=="string"?new Date(t.end):t.end,o=fn[t.color||"blue"];return e.jsxs("div",{className:"w-72",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsx("div",{className:g("w-3 h-3 rounded-full mt-1",o.bg.replace("100","500"))}),e.jsxs("div",{className:"flex gap-1",children:[a&&e.jsx($,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:a,children:e.jsx(h.Edit,{className:"h-3 w-3"})}),s&&e.jsx($,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:s,children:e.jsx(h.Trash2,{className:"h-3 w-3"})})]})]}),e.jsx("h4",{className:"font-semibold mt-2",children:t.title}),e.jsxs("div",{className:"space-y-2 mt-3 text-sm text-muted-foreground",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(h.Clock,{className:"h-4 w-4"}),t.allDay?e.jsx("span",{children:"Toute la journée"}):e.jsxs("span",{children:[r.toLocaleString("fr-FR",{weekday:"short",day:"numeric",month:"short",hour:"2-digit",minute:"2-digit"})," - ",n.toLocaleTimeString("fr-FR",{hour:"2-digit",minute:"2-digit"})]})]}),t.location&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(h.MapPin,{className:"h-4 w-4"}),e.jsx("span",{children:t.location})]}),t.attendees&&t.attendees.length>0&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(h.Users,{className:"h-4 w-4"}),e.jsxs("span",{children:[t.attendees.length," participant(s)"]})]})]}),t.description&&e.jsx("p",{className:"mt-3 text-sm",children:t.description})]})}function Xb({currentDate:t,events:a,weekStartsOn:s,locale:r,onDayClick:n,onEventClick:o,onEventEdit:i,onEventDelete:c}){const m=t.getFullYear(),d=t.getMonth(),x=Ub(m,d),u=new Date,f=Array.from({length:7},(y,v)=>new Date(2024,0,s+v).toLocaleDateString(r,{weekday:"short"})),k=(new Date(m,d,1).getDay()-s+7)%7,b=[];for(let y=0;y<k;y++)b.push(null);for(b.push(...x);b.length%7!==0;)b.push(null);return e.jsxs("div",{className:"border rounded-lg overflow-hidden",children:[e.jsx("div",{className:"grid grid-cols-7 bg-muted",children:f.map(y=>e.jsx("div",{className:"p-2 text-center text-sm font-medium capitalize",children:y},y))}),e.jsx("div",{className:"grid grid-cols-7",children:b.map((y,v)=>{const p=y?Bb(a,y):[],j=y&&lr(y,u),C=y&&y.getMonth()===d;return e.jsx("div",{className:g("min-h-[100px] border-t border-l p-1 cursor-pointer hover:bg-muted/50",!C&&"bg-muted/30 text-muted-foreground"),onClick:()=>y&&n?.(y),children:y&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:g("text-sm font-medium mb-1 w-7 h-7 flex items-center justify-center rounded-full",j&&"bg-primary text-primary-foreground"),children:y.getDate()}),e.jsxs("div",{className:"space-y-1",children:[p.slice(0,3).map(N=>e.jsxs(ct,{children:[e.jsx(dt,{asChild:!0,children:e.jsx("div",{children:e.jsx(Hb,{event:N,onClick:()=>o?.(N),compact:!0})})}),e.jsx(rt,{children:e.jsx(Gb,{event:N,onEdit:()=>i?.(N.id,{}),onDelete:()=>c?.(N.id)})})]},N.id)),p.length>3&&e.jsxs("button",{className:"text-xs text-muted-foreground hover:text-foreground",children:["+",p.length-3," autres"]})]})]})},v)})})]})}function Yb({currentDate:t,events:a,locale:s,onEventClick:r}){const n=a.filter(i=>{const c=typeof i.start=="string"?new Date(i.start):i.start,m=new Date(t);return m.setDate(m.getDate()+30),c>=t&&c<=m}).sort((i,c)=>{const m=typeof i.start=="string"?new Date(i.start):i.start,d=typeof c.start=="string"?new Date(c.start):c.start;return m.getTime()-d.getTime()}),o={};return n.forEach(i=>{const m=(typeof i.start=="string"?new Date(i.start):i.start).toDateString();o[m]||(o[m]=[]),o[m].push(i)}),e.jsxs("div",{className:"space-y-4",children:[Object.entries(o).map(([i,c])=>{const m=new Date(i);return e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-muted-foreground mb-2 capitalize",children:m.toLocaleDateString(s,{weekday:"long",day:"numeric",month:"long"})}),e.jsx("div",{className:"space-y-2",children:c.map(d=>{const x=fn[d.color||"blue"],u=typeof d.start=="string"?new Date(d.start):d.start,f=typeof d.end=="string"?new Date(d.end):d.end;return e.jsx(Se,{className:"cursor-pointer hover:shadow-md transition-shadow",onClick:()=>r?.(d),children:e.jsxs(Ee,{className:"p-3 flex gap-3",children:[e.jsx("div",{className:g("w-1 rounded-full",x.bg.replace("100","500"))}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h4",{className:"font-medium",children:d.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:d.allDay?"Toute la journée":`${u.toLocaleTimeString(s,{hour:"2-digit",minute:"2-digit"})} - ${f.toLocaleTimeString(s,{hour:"2-digit",minute:"2-digit"})}`}),d.location&&e.jsxs("p",{className:"text-sm text-muted-foreground flex items-center gap-1 mt-1",children:[e.jsx(h.MapPin,{className:"h-3 w-3"}),d.location]})]})]})},d.id)})})]},i)}),Object.keys(o).length===0&&e.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"Aucun événement à venir"})]})}function Jb({events:t,currentDate:a,onDateChange:s,viewMode:r,onViewModeChange:n,onEventClick:o,onEventCreate:i,onEventEdit:c,onEventDelete:m,onDayClick:d,showHeader:x=!0,showViewSelector:u=!0,showAddButton:f=!0,weekStartsOn:w=1,locale:k="fr-FR",className:b}){const[y,v]=l.useState(new Date),[p,j]=l.useState("month"),[C,N]=l.useState(!1),S=a??y,A=r??p,R=T=>{s?s(T):v(T)},E=T=>{n?n(T):j(T)},D=()=>{const T=new Date(S);switch(A){case"month":T.setMonth(T.getMonth()-1);break;case"week":T.setDate(T.getDate()-7);break;case"day":T.setDate(T.getDate()-1);break}R(T)},M=()=>{const T=new Date(S);switch(A){case"month":T.setMonth(T.getMonth()+1);break;case"week":T.setDate(T.getDate()+7);break;case"day":T.setDate(T.getDate()+1);break}R(T)},P=()=>{R(new Date)};return e.jsxs("div",{className:g("space-y-4",b),children:[x&&e.jsx(qb,{currentDate:S,viewMode:A,onPrevious:D,onNext:M,onToday:P,onViewModeChange:E,onAddClick:()=>N(!0),showViewSelector:u,showAddButton:f,locale:k}),A==="month"&&e.jsx(Xb,{currentDate:S,events:t,weekStartsOn:w,locale:k,onDayClick:d,onEventClick:o,onEventEdit:c,onEventDelete:m}),A==="agenda"&&e.jsx(Yb,{currentDate:S,events:t,locale:k,onEventClick:o}),(A==="week"||A==="day")&&e.jsxs("div",{className:"text-center py-12 text-muted-foreground",children:["Vue ",A==="week"?"semaine":"jour"," - À implémenter"]})]})}const Kb=[{id:"1",title:"Réunion d'équipe",start:new Date,end:new Date(Date.now()+1e3*60*60),color:"blue",location:"Salle de réunion A"},{id:"2",title:"Déjeuner avec le client",start:new Date(Date.now()+1e3*60*60*24),end:new Date(Date.now()+1e3*60*60*25),color:"green",location:"Restaurant Le Gourmet"},{id:"3",title:"Formation React",start:new Date(Date.now()+1e3*60*60*24*2),end:new Date(Date.now()+1e3*60*60*24*2+1e3*60*60*4),color:"purple",allDay:!0},{id:"4",title:"Deadline projet",start:new Date(Date.now()+1e3*60*60*24*5),end:new Date(Date.now()+1e3*60*60*24*5),color:"red",allDay:!0}];function Qb({conversations:t,activeId:a,currentUser:s,onSelect:r,onSearch:n}){const[o,i]=l.useState(""),c=u=>u.name?u.name:u.participants.filter(w=>w.id!==s.id).map(w=>w.name).join(", "),m=u=>{if(u.avatar)return{url:u.avatar,fallback:u.name?.charAt(0)||"G"};if(u.isGroup)return{fallback:"G"};const f=u.participants.find(w=>w.id!==s.id);return{url:f?.avatar,fallback:f?.name.charAt(0)||"?"}},d=u=>{if(!u)return"";const f=typeof u=="string"?new Date(u):u,k=new Date().getTime()-f.getTime(),b=Math.floor(k/(1e3*60*60*24));return b===0?f.toLocaleTimeString("fr-FR",{hour:"2-digit",minute:"2-digit"}):b===1?"Hier":b<7?f.toLocaleDateString("fr-FR",{weekday:"short"}):f.toLocaleDateString("fr-FR",{day:"numeric",month:"short"})},x=t.filter(u=>o?c(u).toLowerCase().includes(o.toLowerCase()):!0);return e.jsxs("div",{className:"flex flex-col h-full border-r",children:[e.jsx("div",{className:"p-3 border-b",children:e.jsxs("div",{className:"relative",children:[e.jsx(h.Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(oe,{placeholder:"Rechercher...",value:o,onChange:u=>{i(u.target.value),n?.(u.target.value)},className:"pl-9"})]})}),e.jsx(yt,{className:"flex-1",children:x.map(u=>{const f=m(u),w=c(u),k=u.participants.find(b=>b.id!==s.id);return e.jsxs("button",{onClick:()=>r(u),className:g("w-full flex items-center gap-3 p-3 hover:bg-muted/50 transition-colors text-left",a===u.id&&"bg-muted"),children:[e.jsxs("div",{className:"relative",children:[e.jsxs(Ct,{children:[e.jsx(kt,{src:f.url}),e.jsx(St,{children:f.fallback})]}),k?.status==="online"&&e.jsx("div",{className:"absolute bottom-0 right-0 h-3 w-3 rounded-full bg-green-500 border-2 border-background"})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"font-medium text-sm truncate",children:w}),e.jsx("span",{className:"text-xs text-muted-foreground",children:d(u.lastMessage?.timestamp)})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:u.lastMessage?.content||"Aucun message"}),u.unreadCount&&u.unreadCount>0&&e.jsx(De,{className:"h-5 min-w-[20px] justify-center",children:u.unreadCount})]})]})]},u.id)})})]})}function Zb({conversation:t,currentUser:a,onAudioCall:s,onVideoCall:r}){const n=t.participants.find(c=>c.id!==a.id),o=t.name||n?.name||"Chat",i=()=>t.isGroup?`${t.participants.length} participants`:n?.status==="online"?"En ligne":n?.lastSeen?`Vu ${(typeof n.lastSeen=="string"?new Date(n.lastSeen):n.lastSeen).toLocaleString("fr-FR")}`:"Hors ligne";return e.jsxs("div",{className:"flex items-center justify-between p-3 border-b",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(Ct,{children:[e.jsx(kt,{src:t.avatar||n?.avatar}),e.jsx(St,{children:o.charAt(0)})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-sm",children:o}),e.jsx("p",{className:"text-xs text-muted-foreground",children:i()})]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[s&&e.jsx($,{variant:"ghost",size:"icon",onClick:s,children:e.jsx(h.Phone,{className:"h-4 w-4"})}),r&&e.jsx($,{variant:"ghost",size:"icon",onClick:r,children:e.jsx(h.Video,{className:"h-4 w-4"})}),e.jsxs(Ge,{children:[e.jsx(Xe,{asChild:!0,children:e.jsx($,{variant:"ghost",size:"icon",children:e.jsx(h.MoreVertical,{className:"h-4 w-4"})})}),e.jsx(Ue,{align:"end",children:e.jsxs(xe,{children:[e.jsx(h.Settings,{className:"mr-2 h-4 w-4"}),"Paramètres"]})})]})]})]})}function ej({message:t,isOwn:a,showStatus:s,showTimestamp:r,onDelete:n,onReply:o}){const i=m=>(typeof m=="string"?new Date(m):m).toLocaleTimeString("fr-FR",{hour:"2-digit",minute:"2-digit"}),c=()=>{switch(t.status){case"sending":return e.jsx("div",{className:"h-3 w-3 rounded-full border-2 border-current animate-pulse"});case"sent":return e.jsx(h.Check,{className:"h-3 w-3"});case"delivered":return e.jsx(h.CheckCheck,{className:"h-3 w-3"});case"read":return e.jsx(h.CheckCheck,{className:"h-3 w-3 text-blue-500"});case"error":return e.jsx(h.X,{className:"h-3 w-3 text-red-500"});default:return null}};return e.jsxs("div",{className:g("flex gap-2 group",a?"flex-row-reverse":"flex-row"),children:[!a&&e.jsxs(Ct,{className:"h-8 w-8",children:[e.jsx(kt,{src:t.sender.avatar}),e.jsx(St,{className:"text-xs",children:t.sender.name.charAt(0)})]}),e.jsxs("div",{className:g("max-w-[70%]",a&&"items-end"),children:[t.replyTo&&e.jsxs("div",{className:"text-xs text-muted-foreground mb-1 p-2 bg-muted/50 rounded border-l-2 border-primary",children:[e.jsx("span",{className:"font-medium",children:t.replyTo.sender.name}),e.jsx("p",{className:"truncate",children:t.replyTo.content})]}),e.jsxs("div",{className:g("relative rounded-2xl px-4 py-2",a?"bg-primary text-primary-foreground rounded-tr-sm":"bg-muted rounded-tl-sm"),children:[t.attachments&&t.attachments.length>0&&e.jsx("div",{className:"space-y-2 mb-2",children:t.attachments.map((m,d)=>e.jsx("div",{children:m.type==="image"?e.jsx("img",{src:m.url,alt:m.name,className:"rounded-lg max-w-full"}):e.jsxs("div",{className:"flex items-center gap-2 p-2 bg-background/10 rounded",children:[e.jsx(h.File,{className:"h-4 w-4"}),e.jsx("span",{className:"text-sm truncate",children:m.name})]})},d))}),e.jsx("p",{className:"text-sm whitespace-pre-wrap break-words",children:t.content}),e.jsxs("div",{className:g("absolute top-0 opacity-0 group-hover:opacity-100 transition-opacity flex items-center gap-1",a?"-left-20":"-right-20"),children:[e.jsx($,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>o?.(t),children:e.jsx(h.Reply,{className:"h-3 w-3"})}),a&&n&&e.jsx($,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>n(t.id),children:e.jsx(h.Trash2,{className:"h-3 w-3"})})]})]}),e.jsxs("div",{className:g("flex items-center gap-1 mt-1 text-xs text-muted-foreground",a&&"justify-end"),children:[r&&e.jsx("span",{children:i(t.timestamp)}),t.isEdited&&e.jsx("span",{children:"(modifié)"}),a&&s&&c()]})]})]})}function tj({onSend:t,replyTo:a,onCancelReply:s,showAttachments:r,showEmoji:n,placeholder:o,sending:i}){const[c,m]=l.useState(""),d=l.useRef(null),x=()=>{c.trim()&&!i&&(t(c.trim()),m(""))},u=f=>{f.key==="Enter"&&!f.shiftKey&&(f.preventDefault(),x())};return e.jsxs("div",{className:"border-t p-3",children:[a&&e.jsxs("div",{className:"flex items-center justify-between mb-2 p-2 bg-muted rounded text-sm",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(h.Reply,{className:"h-4 w-4 text-primary"}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium",children:a.sender.name}),e.jsx("p",{className:"text-muted-foreground truncate",children:a.content})]})]}),e.jsx($,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:s,children:e.jsx(h.X,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[r&&e.jsx($,{variant:"ghost",size:"icon",children:e.jsx(h.Paperclip,{className:"h-4 w-4"})}),e.jsx(oe,{ref:d,value:c,onChange:f=>m(f.target.value),onKeyDown:u,placeholder:o,className:"flex-1",disabled:i}),n&&e.jsx($,{variant:"ghost",size:"icon",children:e.jsx(h.Smile,{className:"h-4 w-4"})}),e.jsx($,{onClick:x,disabled:!c.trim()||i,children:e.jsx(h.Send,{className:"h-4 w-4"})})]})]})}function Jl({conversations:t=[],activeConversation:a,messages:s,currentUser:r,onSendMessage:n,onConversationSelect:o,onMessageDelete:i,onMessageReply:c,onSearch:m,onAudioCall:d,onVideoCall:x,showConversationList:u=!0,showHeader:f=!0,showMessageStatus:w=!0,showTimestamps:k=!0,showAttachments:b=!0,showEmoji:y=!0,inputPlaceholder:v="Écrire un message...",sending:p=!1,loading:j=!1,layout:C="full",className:N}){const[S,A]=l.useState(null),R=l.useRef(null);l.useEffect(()=>{R.current?.scrollIntoView({behavior:"smooth"})},[s]);const E=(P,T)=>{n?.(P,T),A(null)},D=P=>{A(P),c?.(P)},M={full:"h-screen",embedded:"h-[600px]",floating:"h-[500px] w-[400px] rounded-lg shadow-xl"};return e.jsxs("div",{className:g("flex bg-background",M[C],N),children:[u&&e.jsx("div",{className:"w-80 flex-shrink-0",children:e.jsx(Qb,{conversations:t,activeId:a?.id,currentUser:r,onSelect:P=>o?.(P),onSearch:m})}),e.jsx("div",{className:"flex-1 flex flex-col min-w-0",children:a?e.jsxs(e.Fragment,{children:[f&&e.jsx(Zb,{conversation:a,currentUser:r,onAudioCall:d,onVideoCall:x}),e.jsx(yt,{className:"flex-1 p-4",children:e.jsxs("div",{className:"space-y-4",children:[s.map(P=>e.jsx(ej,{message:P,isOwn:P.sender.id===r.id,showStatus:w,showTimestamp:k,onDelete:i,onReply:D},P.id)),e.jsx("div",{ref:R})]})}),e.jsx(tj,{onSend:E,replyTo:S,onCancelReply:()=>A(null),showAttachments:b,showEmoji:y,placeholder:v,sending:p})]}):e.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:"Sélectionnez une conversation"})})]})}const ks={id:"current",name:"Moi",status:"online"},cr=[{id:"1",participants:[ks,{id:"2",name:"Marie Dupont",status:"online"}],lastMessage:{id:"m1",content:"D'accord, je m'en occupe !",sender:{id:"2",name:"Marie Dupont"},timestamp:new Date(Date.now()-1e3*60*5),status:"read"},unreadCount:0},{id:"2",participants:[ks,{id:"3",name:"Pierre Martin",status:"offline"}],lastMessage:{id:"m2",content:"On se voit demain ?",sender:ks,timestamp:new Date(Date.now()-1e3*60*60),status:"delivered"},unreadCount:2}],Kl=[{id:"1",content:"Salut ! Comment ça va ?",sender:{id:"2",name:"Marie Dupont"},timestamp:new Date(Date.now()-1e3*60*30),status:"read"},{id:"2",content:"Ça va bien merci ! Et toi ?",sender:ks,timestamp:new Date(Date.now()-1e3*60*25),status:"read"},{id:"3",content:"Super ! Tu as vu le nouveau projet ?",sender:{id:"2",name:"Marie Dupont"},timestamp:new Date(Date.now()-1e3*60*20),status:"read"}],Ql={"no-data":{title:"Aucune donnée",description:"Il n'y a pas encore de données à afficher.",icon:h.Inbox,actionLabel:"Ajouter",actionIcon:h.Plus},"no-results":{title:"Aucun résultat",description:"Aucun élément ne correspond à votre recherche.",icon:h.Search,actionLabel:"Effacer les filtres",actionIcon:h.Filter},"no-messages":{title:"Aucun message",description:"Votre boîte de réception est vide.",icon:h.MessageSquare,actionLabel:"Nouveau message",actionIcon:h.Plus},"no-files":{title:"Aucun fichier",description:"Vous n'avez pas encore de fichiers.",icon:h.FolderOpen,actionLabel:"Importer un fichier",actionIcon:h.Upload},"no-users":{title:"Aucun utilisateur",description:"Il n'y a pas encore d'utilisateurs.",icon:h.Users,actionLabel:"Inviter des utilisateurs",actionIcon:h.Plus},"no-cart":{title:"Panier vide",description:"Votre panier est vide.",icon:h.ShoppingCart,actionLabel:"Parcourir les produits",actionIcon:h.ArrowRight},"no-notifications":{title:"Aucune notification",description:"Vous êtes à jour !",icon:h.Bell},"no-events":{title:"Aucun événement",description:"Aucun événement prévu.",icon:h.Calendar,actionLabel:"Créer un événement",actionIcon:h.Plus},"no-images":{title:"Aucune image",description:"Vous n'avez pas encore d'images.",icon:h.Image,actionLabel:"Importer des images",actionIcon:h.Upload},"no-bookmarks":{title:"Aucun favori",description:"Vous n'avez pas encore de favoris.",icon:h.Bookmark,actionLabel:"Parcourir",actionIcon:h.ArrowRight},"no-favorites":{title:"Aucun favori",description:"Vous n'avez pas encore aimé de contenu.",icon:h.Heart},error:{title:"Une erreur est survenue",description:"Impossible de charger les données.",icon:h.FileQuestion,actionLabel:"Réessayer",actionIcon:h.RefreshCw},custom:{title:"Aucun élément",description:"Il n'y a rien à afficher.",icon:h.Inbox}};function go({type:t,size:a,className:s}){const n=Ql[t].icon,i={sm:{container:"h-24 w-24",icon:"h-8 w-8",circles:{outer:"h-20 w-20",inner:"h-14 w-14"}},md:{container:"h-32 w-32",icon:"h-10 w-10",circles:{outer:"h-28 w-28",inner:"h-20 w-20"}},lg:{container:"h-40 w-40",icon:"h-12 w-12",circles:{outer:"h-36 w-36",inner:"h-28 w-28"}}}[a];return e.jsxs("div",{className:g("relative flex items-center justify-center",i.container,s),children:[e.jsx("div",{className:g("absolute rounded-full bg-muted/50",i.circles.outer)}),e.jsx("div",{className:g("absolute rounded-full bg-muted",i.circles.inner)}),e.jsx("div",{className:"relative z-10 flex items-center justify-center rounded-full bg-background p-4 shadow-sm",children:e.jsx(n,{className:g(i.icon,"text-muted-foreground")})}),e.jsx("div",{className:"absolute -right-1 top-2 h-2 w-2 rounded-full bg-primary/20"}),e.jsx("div",{className:"absolute -left-1 bottom-4 h-1.5 w-1.5 rounded-full bg-primary/30"}),e.jsx("div",{className:"absolute right-4 bottom-0 h-2.5 w-2.5 rounded-full bg-primary/10"})]})}function as({type:t="no-data",title:a,description:s,icon:r,actions:n,illustration:o,showIllustration:i=!0,size:c="md",layout:m="vertical",centered:d=!0,children:x,className:u}){const f=Ql[t],w=a??f.title,k=s??f.description;f.icon;const b={sm:{container:"py-8 px-4",title:"text-base",description:"text-sm",icon:"h-8 w-8"},md:{container:"py-12 px-6",title:"text-lg",description:"text-sm",icon:"h-10 w-10"},lg:{container:"py-16 px-8",title:"text-xl",description:"text-base",icon:"h-12 w-12"}},y=[];if(f.actionLabel&&!n){const p=f.actionIcon;y.push({label:f.actionLabel,variant:"default",icon:p?e.jsx(p,{className:"h-4 w-4"}):void 0})}const v=n||(y.length>0?y:void 0);return m==="horizontal"?e.jsxs("div",{className:g("flex items-center gap-6",b[c].container,d&&"justify-center",u),children:[i&&e.jsx("div",{className:"flex-shrink-0",children:o||(r?e.jsx("div",{className:"flex items-center justify-center rounded-full bg-muted p-4",children:r}):e.jsx(go,{type:t,size:c}))}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("h3",{className:g("font-semibold",b[c].title),children:w}),e.jsx("p",{className:g("text-muted-foreground mt-1",b[c].description),children:k}),x&&e.jsx("div",{className:"mt-4",children:x}),v&&v.length>0&&e.jsx("div",{className:"flex gap-3 mt-4",children:v.map((p,j)=>e.jsx($,{variant:p.variant||"default",size:"sm",onClick:p.onClick,asChild:!!p.href,children:p.href?e.jsxs("a",{href:p.href,children:[p.icon&&e.jsx("span",{className:"mr-2",children:p.icon}),p.label]}):e.jsxs(e.Fragment,{children:[p.icon&&e.jsx("span",{className:"mr-2",children:p.icon}),p.label]})},j))})]})]}):e.jsxs("div",{className:g("flex flex-col items-center",d&&"text-center",b[c].container,u),children:[i&&e.jsx("div",{className:"mb-6",children:o||(r?e.jsx("div",{className:"flex items-center justify-center rounded-full bg-muted p-6",children:l.cloneElement(r,{className:g(b[c].icon,"text-muted-foreground")})}):e.jsx(go,{type:t,size:c}))}),e.jsx("h3",{className:g("font-semibold",b[c].title),children:w}),e.jsx("p",{className:g("text-muted-foreground mt-2 max-w-sm",b[c].description),children:k}),x&&e.jsx("div",{className:"mt-4",children:x}),v&&v.length>0&&e.jsx("div",{className:"flex flex-wrap gap-3 mt-6 justify-center",children:v.map((p,j)=>e.jsx($,{variant:p.variant||"default",onClick:p.onClick,asChild:!!p.href,children:p.href?e.jsxs("a",{href:p.href,children:[p.icon&&e.jsx("span",{className:"mr-2",children:p.icon}),p.label]}):e.jsxs(e.Fragment,{children:[p.icon&&e.jsx("span",{className:"mr-2",children:p.icon}),p.label]})},j))})]})}function sj(t){return e.jsx(as,{type:"no-data",...t})}function aj(t){return e.jsx(as,{type:"no-results",...t})}function rj(t){return e.jsx(as,{type:"no-messages",...t})}function nj(t){return e.jsx(as,{type:"no-files",...t})}function oj(t){return e.jsx(as,{type:"no-cart",...t})}function ij(t){return e.jsx(as,{type:"no-notifications",...t})}function lj(t){return e.jsx(as,{type:"error",...t})}const Zl={404:{code:"404",title:"Page non trouvée",description:"Désolé, la page que vous recherchez n'existe pas ou a été déplacée.",icon:h.FileQuestion},500:{code:"500",title:"Erreur serveur",description:"Une erreur inattendue s'est produite. Notre équipe a été notifiée.",icon:h.ServerCrash},403:{code:"403",title:"Accès refusé",description:"Vous n'avez pas les permissions nécessaires pour accéder à cette page.",icon:h.ShieldX},503:{code:"503",title:"Service indisponible",description:"Le service est temporairement indisponible. Veuillez réessayer plus tard.",icon:h.ServerCrash},offline:{code:"Hors ligne",title:"Vous êtes hors ligne",description:"Vérifiez votre connexion internet et réessayez.",icon:h.Wifi},maintenance:{code:"Maintenance",title:"Maintenance en cours",description:"Nous effectuons une maintenance. Nous serons bientôt de retour.",icon:h.Construction},custom:{code:"",title:"Erreur",description:"Une erreur s'est produite.",icon:h.FileQuestion}};function bo({type:t,className:a}){const r=Zl[t].icon;return e.jsxs("div",{className:g("relative flex items-center justify-center",a),children:[e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsx("div",{className:"h-48 w-48 rounded-full bg-muted/50"})}),e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsx("div",{className:"h-32 w-32 rounded-full bg-muted"})}),e.jsx("div",{className:"relative z-10 flex h-20 w-20 items-center justify-center rounded-full bg-background shadow-lg",children:e.jsx(r,{className:"h-10 w-10 text-muted-foreground"})}),e.jsx("div",{className:"absolute -right-4 top-4 h-3 w-3 rounded-full bg-primary/20"}),e.jsx("div",{className:"absolute -left-2 bottom-8 h-2 w-2 rounded-full bg-primary/30"}),e.jsx("div",{className:"absolute right-8 bottom-2 h-4 w-4 rounded-full bg-primary/10"})]})}function Ps({type:t="404",code:a,title:s,description:r,actions:n,illustration:o,showCode:i=!0,showIllustration:c=!0,showBackButton:m=!0,onBack:d,showHomeButton:x=!0,homeUrl:u="/",showRefreshButton:f=!1,children:w,layout:k="centered",size:b="md",className:y}){const v=Zl[t],p=a??v.code,j=s??v.title,C=r??v.description,N={sm:{container:"py-12 px-4",code:"text-6xl",title:"text-xl",description:"text-sm",illustration:"h-32 w-32"},md:{container:"py-16 px-6",code:"text-8xl",title:"text-2xl",description:"text-base",illustration:"h-48 w-48"},lg:{container:"py-24 px-8",code:"text-9xl",title:"text-3xl",description:"text-lg",illustration:"h-64 w-64"}},S=[];m&&S.push({label:"Retour",onClick:d||(()=>window.history.back()),variant:"outline",icon:e.jsx(h.ArrowLeft,{className:"h-4 w-4"})}),x&&S.push({label:"Accueil",href:u,variant:"default",icon:e.jsx(h.Home,{className:"h-4 w-4"})}),f&&S.push({label:"Réessayer",onClick:()=>window.location.reload(),variant:"secondary",icon:e.jsx(h.RefreshCw,{className:"h-4 w-4"})});const A=n||S,R=()=>e.jsxs("div",{className:"flex flex-col items-center text-center",children:[c&&e.jsx("div",{className:g("mb-8",N[b].illustration),children:o||e.jsx(bo,{type:t})}),i&&p&&e.jsx("div",{className:g("font-bold text-muted-foreground/20 mb-4",N[b].code),children:p}),e.jsx("h1",{className:g("font-bold tracking-tight mb-4",N[b].title),children:j}),e.jsx("p",{className:g("text-muted-foreground max-w-md mb-8",N[b].description),children:C}),w&&e.jsx("div",{className:"mb-8",children:w}),A.length>0&&e.jsx("div",{className:"flex flex-wrap gap-3 justify-center",children:A.map((E,D)=>e.jsx($,{variant:E.variant||"default",onClick:E.onClick,asChild:!!E.href,children:E.href?e.jsxs("a",{href:E.href,children:[E.icon&&e.jsx("span",{className:"mr-2",children:E.icon}),E.label]}):e.jsxs(e.Fragment,{children:[E.icon&&e.jsx("span",{className:"mr-2",children:E.icon}),E.label]})},D))})]});return k==="split"?e.jsxs("div",{className:g("min-h-screen flex flex-col lg:flex-row",y),children:[e.jsx("div",{className:"flex-1 bg-muted/30 flex items-center justify-center p-8 lg:p-16",children:e.jsx("div",{className:N[b].illustration,children:o||e.jsx(bo,{type:t})})}),e.jsx("div",{className:"flex-1 flex items-center justify-center p-8 lg:p-16",children:e.jsxs("div",{className:"max-w-md",children:[i&&p&&e.jsx("div",{className:g("font-bold text-primary mb-4",b==="sm"?"text-4xl":b==="md"?"text-5xl":"text-6xl"),children:p}),e.jsx("h1",{className:g("font-bold tracking-tight mb-4",N[b].title),children:j}),e.jsx("p",{className:g("text-muted-foreground mb-8",N[b].description),children:C}),w&&e.jsx("div",{className:"mb-8",children:w}),A.length>0&&e.jsx("div",{className:"flex flex-wrap gap-3",children:A.map((E,D)=>e.jsx($,{variant:E.variant||"default",onClick:E.onClick,asChild:!!E.href,children:E.href?e.jsxs("a",{href:E.href,children:[E.icon&&e.jsx("span",{className:"mr-2",children:E.icon}),E.label]}):e.jsxs(e.Fragment,{children:[E.icon&&e.jsx("span",{className:"mr-2",children:E.icon}),E.label]})},D))})]})})]}):e.jsx("div",{className:g("min-h-screen flex items-center justify-center",N[b].container,y),children:R()})}function cj(t){return e.jsx(Ps,{type:"404",...t})}function dj(t){return e.jsx(Ps,{type:"500",showRefreshButton:!0,...t})}function uj(t){return e.jsx(Ps,{type:"403",...t})}function mj(t){return e.jsx(Ps,{type:"maintenance",showBackButton:!1,showHomeButton:!1,...t})}function hj(t){return e.jsx(Ps,{type:"offline",showRefreshButton:!0,...t})}function fj({value:t,onChange:a,placeholder:s}){return e.jsxs("div",{className:"relative",children:[e.jsx(h.Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(oe,{type:"text",placeholder:s,value:t,onChange:r=>a(r.target.value),className:"pl-10"})]})}function pj({categories:t,activeCategory:a,onCategoryChange:s,itemCounts:r}){return e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs("button",{type:"button",onClick:()=>s(null),className:g("inline-flex items-center gap-2 px-3 py-1.5 rounded-full text-sm font-medium transition-colors",a===null?"bg-primary text-primary-foreground":"bg-muted hover:bg-muted/80"),children:["Tous",e.jsx(De,{variant:"secondary",className:"ml-1",children:Object.values(r).reduce((n,o)=>n+o,0)})]}),t.map(n=>e.jsxs("button",{type:"button",onClick:()=>s(n.id),className:g("inline-flex items-center gap-2 px-3 py-1.5 rounded-full text-sm font-medium transition-colors",a===n.id?"bg-primary text-primary-foreground":"bg-muted hover:bg-muted/80"),children:[n.icon,n.name,e.jsx(De,{variant:"secondary",className:"ml-1",children:r[n.id]||0})]},n.id))]})}function xj({itemId:t,helpful:a=0,notHelpful:s=0,onFeedback:r}){const[n,o]=l.useState(null),i=c=>{n===null&&(o(c),r(t,c))};return e.jsxs("div",{className:"flex items-center gap-4 mt-4 pt-4 border-t",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Cette réponse vous a-t-elle aidé ?"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{type:"button",onClick:()=>i(!0),disabled:n!==null,className:g("inline-flex items-center gap-1 px-2 py-1 text-sm rounded transition-colors",n===!0?"bg-green-100 text-green-700":n===null?"hover:bg-muted":"opacity-50"),children:["👍 ",a+(n===!0?1:0)]}),e.jsxs("button",{type:"button",onClick:()=>i(!1),disabled:n!==null,className:g("inline-flex items-center gap-1 px-2 py-1 text-sm rounded transition-colors",n===!1?"bg-red-100 text-red-700":n===null?"hover:bg-muted":"opacity-50"),children:["👎 ",s+(n===!1?1:0)]})]})]})}function gj({items:t,categories:a=[],title:s="Questions fréquentes",description:r,showSearch:n=!0,searchPlaceholder:o="Rechercher une question...",showCategoryFilter:i=!0,activeCategory:c,onCategoryChange:m,allowMultiple:d=!1,defaultOpen:x=[],showFeedback:u=!1,onFeedback:f,layout:w="default",size:k="md",className:b}){const[y,v]=l.useState(""),[p,j]=l.useState(null),C=c??p,N=P=>{m?m(P):j(P)},S=l.useMemo(()=>t.filter(P=>{if(y){const T=y.toLowerCase();if(!(P.question.toLowerCase().includes(T)||typeof P.answer=="string"&&P.answer.toLowerCase().includes(T)||P.tags?.some(H=>H.toLowerCase().includes(T))))return!1}return!(C&&P.category!==C)}),[t,y,C]),A=l.useMemo(()=>{const P={};return t.forEach(T=>{T.category&&(P[T.category]=(P[T.category]||0)+1)}),P},[t]),R=l.useMemo(()=>{if(w!=="grouped")return null;const P={};return S.forEach(T=>{const q=T.category||"other";P[q]||(P[q]=[]),P[q].push(T)}),P},[S,w]),E={sm:{title:"text-xl",question:"text-sm",answer:"text-sm"},md:{title:"text-2xl",question:"text-base",answer:"text-sm"},lg:{title:"text-3xl",question:"text-lg",answer:"text-base"}},D=P=>e.jsx(e.Fragment,{children:P.map(T=>e.jsxs(mr,{value:T.id,className:g(w==="cards"&&"border rounded-lg px-4 bg-card"),children:[e.jsx(hr,{className:g("hover:no-underline",E[k].question),children:e.jsx("span",{className:"text-left",children:T.question})}),e.jsxs(fr,{children:[e.jsx("div",{className:g("text-muted-foreground",E[k].answer),children:typeof T.answer=="string"?e.jsx("p",{children:T.answer}):T.answer}),T.tags&&T.tags.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1 mt-3",children:T.tags.map(q=>e.jsx(De,{variant:"outline",className:"text-xs",children:q},q))}),u&&f&&e.jsx(xj,{itemId:T.id,helpful:T.helpful,notHelpful:T.notHelpful,onFeedback:f})]})]},T.id))}),M=P=>d?e.jsx(ar,{type:"multiple",defaultValue:x,className:"space-y-2",children:D(P)}):e.jsx(ar,{type:"single",defaultValue:x[0],collapsible:!0,className:"space-y-2",children:D(P)});return e.jsxs("div",{className:g("space-y-6",b),children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h2",{className:g("font-bold tracking-tight",E[k].title),children:s}),r&&e.jsx("p",{className:"text-muted-foreground mt-2 max-w-2xl mx-auto",children:r})]}),n&&e.jsx("div",{className:"max-w-md mx-auto",children:e.jsx(fj,{value:y,onChange:v,placeholder:o})}),i&&a.length>0&&e.jsx("div",{className:"flex justify-center",children:e.jsx(pj,{categories:a,activeCategory:C,onCategoryChange:N,itemCounts:A})}),S.length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx(h.HelpCircle,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),e.jsx("p",{className:"text-muted-foreground",children:"Aucune question ne correspond à votre recherche."})]}):w==="grouped"&&R?e.jsx("div",{className:"space-y-8",children:Object.entries(R).map(([P,T])=>{const q=a.find(H=>H.id===P);return e.jsxs("div",{children:[e.jsxs("h3",{className:"text-lg font-semibold mb-4 flex items-center gap-2",children:[q?.icon,q?.name||P]}),M(T)]},P)})}):e.jsx("div",{className:"max-w-3xl mx-auto",children:M(S)})]})}const bj=[{id:"general",name:"Général",icon:e.jsx(h.HelpCircle,{className:"h-4 w-4"})},{id:"billing",name:"Facturation",icon:e.jsx(h.MessageCircle,{className:"h-4 w-4"})},{id:"technical",name:"Technique",icon:e.jsx(h.MessageCircle,{className:"h-4 w-4"})}],jj=[{id:"1",question:"Comment créer un compte ?",answer:"Pour créer un compte, cliquez sur le bouton 'S'inscrire' en haut à droite de la page, puis remplissez le formulaire avec vos informations personnelles.",category:"general",tags:["compte","inscription"]},{id:"2",question:"Comment réinitialiser mon mot de passe ?",answer:"Cliquez sur 'Mot de passe oublié' sur la page de connexion, entrez votre email et suivez les instructions envoyées par email.",category:"general",tags:["mot de passe","sécurité"]},{id:"3",question:"Quels moyens de paiement acceptez-vous ?",answer:"Nous acceptons les cartes de crédit (Visa, Mastercard, Amex), PayPal et les virements bancaires pour les entreprises.",category:"billing",tags:["paiement","carte"]},{id:"4",question:"Comment annuler mon abonnement ?",answer:"Vous pouvez annuler votre abonnement à tout moment depuis les paramètres de votre compte, section 'Abonnement'.",category:"billing",tags:["abonnement","annulation"]},{id:"5",question:"L'API est-elle disponible ?",answer:"Oui, notre API REST est disponible pour tous les plans payants. Consultez notre documentation développeur pour plus d'informations.",category:"technical",tags:["API","développeur"]}],vj={folder:{icon:h.Folder,color:"text-yellow-500"},document:{icon:h.FileText,color:"text-blue-500"},image:{icon:h.FileImage,color:"text-green-500"},video:{icon:h.FileVideo,color:"text-purple-500"},audio:{icon:h.FileAudio,color:"text-pink-500"},archive:{icon:h.FileArchive,color:"text-orange-500"},code:{icon:h.FileCode,color:"text-cyan-500"},other:{icon:h.File,color:"text-gray-500"}};function jo(t){if(!t)return"-";const a=["B","KB","MB","GB","TB"];let s=0,r=t;for(;r>=1024&&s<a.length-1;)r/=1024,s++;return`${r.toFixed(1)} ${a[s]}`}function wj({breadcrumbs:t,viewMode:a,onViewModeChange:s,onNavigate:r,onCreateFolder:n,onUpload:o,onRefresh:i,showSearch:c,onSearch:m,selectedCount:d,onDeleteSelected:x,onDownloadSelected:u}){const[f,w]=l.useState("");return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[i&&e.jsx($,{variant:"outline",size:"icon",onClick:i,children:e.jsx(h.RefreshCw,{className:"h-4 w-4"})}),o&&e.jsxs($,{variant:"outline",onClick:o,children:[e.jsx(h.Upload,{className:"h-4 w-4 mr-2"}),"Importer"]}),n&&e.jsxs($,{variant:"outline",onClick:n,children:[e.jsx(h.FolderPlus,{className:"h-4 w-4 mr-2"}),"Nouveau dossier"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[c&&m&&e.jsxs("div",{className:"relative w-64",children:[e.jsx(h.Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(oe,{placeholder:"Rechercher...",value:f,onChange:k=>{w(k.target.value),m(k.target.value)},className:"pl-9"})]}),e.jsx($,{variant:a==="grid"?"secondary":"ghost",size:"icon",onClick:()=>s("grid"),children:e.jsx(h.Grid,{className:"h-4 w-4"})}),e.jsx($,{variant:a==="list"?"secondary":"ghost",size:"icon",onClick:()=>s("list"),children:e.jsx(h.List,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[e.jsx("button",{onClick:()=>r("/"),className:"flex items-center gap-1 hover:text-primary",children:e.jsx(h.Home,{className:"h-4 w-4"})}),t.map((k,b)=>e.jsxs(l.Fragment,{children:[e.jsx(h.ChevronRight,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("button",{onClick:()=>r(k.path),className:g("hover:text-primary",b===t.length-1&&"font-medium"),children:k.name})]},k.id))]}),d>0&&e.jsxs("div",{className:"flex items-center gap-4 p-3 bg-muted rounded-lg",children:[e.jsxs("span",{className:"text-sm font-medium",children:[d," élément(s) sélectionné(s)"]}),u&&e.jsxs($,{variant:"outline",size:"sm",onClick:u,children:[e.jsx(h.Download,{className:"h-4 w-4 mr-2"}),"Télécharger"]}),x&&e.jsxs($,{variant:"destructive",size:"sm",onClick:x,children:[e.jsx(h.Trash2,{className:"h-4 w-4 mr-2"}),"Supprimer"]})]})]})}function vo({file:t,viewMode:a,isSelected:s,onSelect:r,onOpen:n,onRename:o,onDelete:i,onDownload:c,onShare:m,onToggleStar:d}){const x=vj[t.type],u=x.icon,f=typeof t.modifiedAt=="string"?new Date(t.modifiedAt):t.modifiedAt,w=()=>{t.type==="folder"&&n()};return a==="grid"?e.jsxs("div",{className:g("relative group p-4 rounded-lg border cursor-pointer transition-colors",s?"bg-primary/10 border-primary":"hover:bg-muted"),onClick:()=>r(!s),onDoubleClick:w,children:[e.jsx("div",{className:"absolute top-2 left-2 opacity-0 group-hover:opacity-100 transition-opacity",children:e.jsx(et,{checked:s,onCheckedChange:k=>r(k),onClick:k=>k.stopPropagation()})}),t.starred&&e.jsx(h.Star,{className:"absolute top-2 right-2 h-4 w-4 text-yellow-500 fill-yellow-500"}),e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[t.thumbnail&&t.type==="image"?e.jsx("img",{src:t.thumbnail,alt:t.name,className:"w-16 h-16 object-cover rounded"}):e.jsx(u,{className:g("h-12 w-12",x.color)}),e.jsx("span",{className:"text-sm font-medium text-center line-clamp-2",children:t.name}),t.type!=="folder"&&e.jsx("span",{className:"text-xs text-muted-foreground",children:jo(t.size)})]}),e.jsx("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:e.jsxs(Ge,{children:[e.jsx(Xe,{asChild:!0,onClick:k=>k.stopPropagation(),children:e.jsx($,{variant:"ghost",size:"icon",className:"h-7 w-7",children:e.jsx(h.MoreHorizontal,{className:"h-4 w-4"})})}),e.jsxs(Ue,{align:"end",children:[e.jsxs(xe,{onClick:n,children:[e.jsx(h.Eye,{className:"mr-2 h-4 w-4"}),"Ouvrir"]}),o&&e.jsxs(xe,{onClick:o,children:[e.jsx(h.Edit,{className:"mr-2 h-4 w-4"}),"Renommer"]}),c&&t.type!=="folder"&&e.jsxs(xe,{onClick:c,children:[e.jsx(h.Download,{className:"mr-2 h-4 w-4"}),"Télécharger"]}),m&&e.jsxs(xe,{onClick:m,children:[e.jsx(h.Share2,{className:"mr-2 h-4 w-4"}),"Partager"]}),d&&e.jsx(xe,{onClick:d,children:t.starred?e.jsxs(e.Fragment,{children:[e.jsx(h.StarOff,{className:"mr-2 h-4 w-4"}),"Retirer des favoris"]}):e.jsxs(e.Fragment,{children:[e.jsx(h.Star,{className:"mr-2 h-4 w-4"}),"Ajouter aux favoris"]})}),i&&e.jsxs(e.Fragment,{children:[e.jsx(Ze,{}),e.jsxs(xe,{onClick:i,className:"text-destructive",children:[e.jsx(h.Trash2,{className:"mr-2 h-4 w-4"}),"Supprimer"]})]})]})]})})]}):e.jsxs(Bt,{className:g("cursor-pointer",s&&"bg-primary/10"),onClick:()=>r(!s),onDoubleClick:w,children:[e.jsx(st,{className:"w-12",children:e.jsx(et,{checked:s,onCheckedChange:k=>r(k),onClick:k=>k.stopPropagation()})}),e.jsx(st,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(u,{className:g("h-5 w-5",x.color)}),e.jsx("span",{className:"font-medium",children:t.name}),t.starred&&e.jsx(h.Star,{className:"h-4 w-4 text-yellow-500 fill-yellow-500"}),t.shared&&e.jsx(De,{variant:"secondary",className:"text-xs",children:"Partagé"})]})}),e.jsx(st,{className:"text-muted-foreground",children:jo(t.size)}),e.jsx(st,{className:"text-muted-foreground",children:f.toLocaleDateString("fr-FR")}),e.jsx(st,{children:e.jsxs(Ge,{children:[e.jsx(Xe,{asChild:!0,onClick:k=>k.stopPropagation(),children:e.jsx($,{variant:"ghost",size:"icon",className:"h-8 w-8",children:e.jsx(h.MoreHorizontal,{className:"h-4 w-4"})})}),e.jsxs(Ue,{align:"end",children:[e.jsxs(xe,{onClick:n,children:[e.jsx(h.Eye,{className:"mr-2 h-4 w-4"}),"Ouvrir"]}),o&&e.jsxs(xe,{onClick:o,children:[e.jsx(h.Edit,{className:"mr-2 h-4 w-4"}),"Renommer"]}),c&&t.type!=="folder"&&e.jsxs(xe,{onClick:c,children:[e.jsx(h.Download,{className:"mr-2 h-4 w-4"}),"Télécharger"]}),i&&e.jsxs(e.Fragment,{children:[e.jsx(Ze,{}),e.jsxs(xe,{onClick:i,className:"text-destructive",children:[e.jsx(h.Trash2,{className:"mr-2 h-4 w-4"}),"Supprimer"]})]})]})]})})]})}function yj({files:t,currentPath:a="/",breadcrumbs:s=[],selectedFiles:r=[],onSelectionChange:n,onNavigate:o,onFileOpen:i,onDownload:c,onDelete:m,onRename:d,onCopy:x,onMove:u,onCreateFolder:f,onUpload:w,onShare:k,onToggleStar:b,onRefresh:y,viewMode:v,onViewModeChange:p,showSearch:j=!0,onSearch:C,showHeader:N=!0,showActions:S=!0,loading:A=!1,className:R}){const[E,D]=l.useState("grid"),[M,P]=l.useState(!1),[T,q]=l.useState(null),[H,Y]=l.useState(""),[U,z]=l.useState(!1),[V,L]=l.useState([]),[W,F]=l.useState(!1),[G,ee]=l.useState(""),se=v??E,le=ae=>{p?p(ae):D(ae)},X=(ae,de)=>{n?.(de?[...r,ae]:r.filter(Te=>Te!==ae))},K=ae=>{ae.type==="folder"?o?.(ae.path,ae.id):i?.(ae)},I=ae=>{q(ae),Y(ae.name),P(!0)},te=()=>{T&&H.trim()&&H!==T.name&&d?.(T.id,H.trim()),P(!1),q(null)},Z=()=>{L(r),z(!0)},J=()=>{m?.(V),z(!1),L([]),n?.([])},ne=()=>{G.trim()&&(f?.(G.trim(),a),F(!1),ee(""))},me=[...t].sort((ae,de)=>ae.type==="folder"&&de.type!=="folder"?-1:ae.type!=="folder"&&de.type==="folder"?1:ae.name.localeCompare(de.name));return e.jsxs("div",{className:g("space-y-4",R),children:[N&&e.jsx(wj,{breadcrumbs:s,viewMode:se,onViewModeChange:le,onNavigate:ae=>o?.(ae),onCreateFolder:f?()=>F(!0):void 0,onUpload:w?()=>{}:void 0,onRefresh:y,showSearch:j,onSearch:C,selectedCount:r.length,onDeleteSelected:m?Z:void 0,onDownloadSelected:c?()=>c(r):void 0}),A?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(h.RefreshCw,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):me.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-muted-foreground",children:[e.jsx(h.Folder,{className:"h-12 w-12 mb-4"}),e.jsx("p",{children:"Ce dossier est vide"})]}):se==="grid"?e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-4",children:me.map(ae=>e.jsx(vo,{file:ae,viewMode:"grid",isSelected:r.includes(ae.id),onSelect:de=>X(ae.id,de),onOpen:()=>K(ae),onRename:d?()=>I(ae):void 0,onDelete:m?()=>{L([ae.id]),z(!0)}:void 0,onDownload:c?()=>c([ae.id]):void 0,onShare:k?()=>k(ae.id):void 0,onToggleStar:b?()=>b(ae.id):void 0},ae.id))}):e.jsxs(Ea,{children:[e.jsx(Ma,{children:e.jsxs(Bt,{children:[e.jsx(lt,{className:"w-12",children:e.jsx(et,{checked:r.length===t.length&&t.length>0,onCheckedChange:ae=>{n?.(ae?t.map(de=>de.id):[])}})}),e.jsx(lt,{children:"Nom"}),e.jsx(lt,{children:"Taille"}),e.jsx(lt,{children:"Modifié"}),e.jsx(lt,{className:"w-12"})]})}),e.jsx(Pa,{children:me.map(ae=>e.jsx(vo,{file:ae,viewMode:"list",isSelected:r.includes(ae.id),onSelect:de=>X(ae.id,de),onOpen:()=>K(ae),onRename:d?()=>I(ae):void 0,onDelete:m?()=>{L([ae.id]),z(!0)}:void 0,onDownload:c?()=>c([ae.id]):void 0,onShare:k?()=>k(ae.id):void 0,onToggleStar:b?()=>b(ae.id):void 0},ae.id))})]}),e.jsx(It,{open:M,onOpenChange:P,children:e.jsxs(Tt,{children:[e.jsx(qt,{children:e.jsx(Gt,{children:"Renommer"})}),e.jsx(oe,{value:H,onChange:ae=>Y(ae.target.value),placeholder:"Nouveau nom",onKeyDown:ae=>ae.key==="Enter"&&te()}),e.jsxs(Ht,{children:[e.jsx($,{variant:"outline",onClick:()=>P(!1),children:"Annuler"}),e.jsx($,{onClick:te,children:"Renommer"})]})]})}),e.jsx(fs,{open:U,onOpenChange:z,children:e.jsxs(Xt,{children:[e.jsxs(Yt,{children:[e.jsx(Kt,{children:"Supprimer ?"}),e.jsxs(Qt,{children:["Êtes-vous sûr de vouloir supprimer ",V.length," élément(s) ? Cette action est irréversible."]})]}),e.jsxs(Jt,{children:[e.jsx(es,{children:"Annuler"}),e.jsx(Zt,{onClick:J,children:"Supprimer"})]})]})}),e.jsx(It,{open:W,onOpenChange:F,children:e.jsxs(Tt,{children:[e.jsx(qt,{children:e.jsx(Gt,{children:"Nouveau dossier"})}),e.jsx(oe,{value:G,onChange:ae=>ee(ae.target.value),placeholder:"Nom du dossier",onKeyDown:ae=>ae.key==="Enter"&&ne()}),e.jsxs(Ht,{children:[e.jsx($,{variant:"outline",onClick:()=>F(!1),children:"Annuler"}),e.jsx($,{onClick:ne,children:"Créer"})]})]})})]})}const Nj=[{id:"1",name:"Documents",type:"folder",path:"/Documents",createdAt:new Date("2024-01-01"),modifiedAt:new Date("2024-01-15")},{id:"2",name:"Images",type:"folder",path:"/Images",createdAt:new Date("2024-01-01"),modifiedAt:new Date("2024-01-10"),starred:!0},{id:"3",name:"Rapport Q4.pdf",type:"document",path:"/Rapport Q4.pdf",size:2456e3,createdAt:new Date("2024-01-05"),modifiedAt:new Date("2024-01-05")},{id:"4",name:"Photo vacances.jpg",type:"image",path:"/Photo vacances.jpg",size:567e4,createdAt:new Date("2024-01-08"),modifiedAt:new Date("2024-01-08")},{id:"5",name:"Présentation.pptx",type:"document",path:"/Présentation.pptx",size:89e5,createdAt:new Date("2024-01-12"),modifiedAt:new Date("2024-01-14"),shared:!0}],Cj=[{id:"root",name:"Mes fichiers",path:"/"}],wo={low:{label:"Basse",color:"bg-gray-500",icon:h.Clock},medium:{label:"Moyenne",color:"bg-blue-500",icon:h.Clock},high:{label:"Haute",color:"bg-orange-500",icon:h.AlertCircle},urgent:{label:"Urgente",color:"bg-red-500",icon:h.AlertCircle}};function kj({card:t,columnId:a,showAssignees:s,showLabels:r,showPriority:n,showDueDate:o,draggable:i,onCardClick:c,onCardEdit:m,onCardDelete:d,onDragStart:x}){const u=l.useMemo(()=>t.dueDate?(typeof t.dueDate=="string"?new Date(t.dueDate):t.dueDate)<new Date:!1,[t.dueDate]),f=w=>(typeof w=="string"?new Date(w):w).toLocaleDateString("fr-FR",{day:"numeric",month:"short"});return e.jsx(Se,{className:g("cursor-pointer hover:shadow-md transition-shadow",i&&"cursor-grab active:cursor-grabbing"),draggable:i,onDragStart:w=>x?.(w,t.id,a),onClick:()=>c?.(t,a),children:e.jsxs(Ee,{className:"p-3 space-y-2",children:[r&&t.labels&&t.labels.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1",children:t.labels.map(w=>e.jsx("div",{className:"h-1.5 w-8 rounded-full",style:{backgroundColor:w.color},title:w.name},w.id))}),e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("h4",{className:"text-sm font-medium leading-tight",children:t.title}),e.jsxs(Ge,{children:[e.jsx(Xe,{asChild:!0,onClick:w=>w.stopPropagation(),children:e.jsx($,{variant:"ghost",size:"icon",className:"h-6 w-6 flex-shrink-0",children:e.jsx(h.MoreHorizontal,{className:"h-3 w-3"})})}),e.jsxs(Ue,{align:"end",children:[e.jsxs(xe,{onClick:w=>{w.stopPropagation(),c?.(t,a)},children:[e.jsx(h.Edit,{className:"mr-2 h-4 w-4"}),"Modifier"]}),e.jsx(Ze,{}),e.jsxs(xe,{onClick:w=>{w.stopPropagation(),d?.(t.id,a)},className:"text-destructive",children:[e.jsx(h.Trash2,{className:"mr-2 h-4 w-4"}),"Supprimer"]})]})]})]}),t.description&&e.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:t.description}),e.jsxs("div",{className:"flex items-center justify-between pt-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[n&&t.priority&&e.jsx("div",{className:g("h-2 w-2 rounded-full",wo[t.priority].color),title:wo[t.priority].label}),o&&t.dueDate&&e.jsxs(De,{variant:u?"destructive":"outline",className:"text-xs px-1.5 py-0",children:[e.jsx(h.Calendar,{className:"h-3 w-3 mr-1"}),f(t.dueDate)]})]}),s&&t.assignees&&t.assignees.length>0&&e.jsxs("div",{className:"flex -space-x-1",children:[t.assignees.slice(0,3).map(w=>e.jsxs(Ct,{className:"h-5 w-5 border-2 border-background",children:[e.jsx(kt,{src:w.avatar}),e.jsx(St,{className:"text-[8px]",children:w.name.charAt(0)})]},w.id)),t.assignees.length>3&&e.jsxs("div",{className:"h-5 w-5 rounded-full bg-muted flex items-center justify-center text-[8px] border-2 border-background",children:["+",t.assignees.length-3]})]})]})]})})}function Sj({column:t,showCardCount:a,showAddCard:s,showAssignees:r,showLabels:n,showPriority:o,showDueDate:i,draggable:c,onCardClick:m,onCardAdd:d,onCardEdit:x,onCardDelete:u,onColumnEdit:f,onColumnDelete:w,onDragStart:k,onDragOver:b,onDrop:y}){const[v,p]=l.useState(!1),[j,C]=l.useState(""),[N,S]=l.useState(!1),[A,R]=l.useState(t.title),E=()=>{j.trim()&&(d?.(t.id,{title:j.trim()}),C(""),p(!1))},D=()=>{A.trim()&&A!==t.title&&f?.(t.id,{title:A.trim()}),S(!1)},M=t.limit&&t.cards.length>=t.limit;return e.jsxs("div",{className:"flex flex-col w-72 flex-shrink-0 bg-muted/50 rounded-lg",onDragOver:b,onDrop:P=>y?.(P,t.id),children:[e.jsxs("div",{className:"flex items-center justify-between p-3 border-b",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[t.color&&e.jsx("div",{className:"h-3 w-3 rounded-full",style:{backgroundColor:t.color}}),N?e.jsx("div",{className:"flex items-center gap-1",children:e.jsx(oe,{value:A,onChange:P=>R(P.target.value),className:"h-7 text-sm font-semibold",autoFocus:!0,onBlur:D,onKeyDown:P=>{P.key==="Enter"&&D(),P.key==="Escape"&&S(!1)}})}):e.jsx("h3",{className:"font-semibold text-sm cursor-pointer",onClick:()=>S(!0),children:t.title}),a&&e.jsxs(De,{variant:"secondary",className:"text-xs",children:[t.cards.length,t.limit&&`/${t.limit}`]})]}),e.jsxs(Ge,{children:[e.jsx(Xe,{asChild:!0,children:e.jsx($,{variant:"ghost",size:"icon",className:"h-7 w-7",children:e.jsx(h.MoreHorizontal,{className:"h-4 w-4"})})}),e.jsxs(Ue,{align:"end",children:[e.jsxs(xe,{onClick:()=>S(!0),children:[e.jsx(h.Edit,{className:"mr-2 h-4 w-4"}),"Renommer"]}),e.jsx(Ze,{}),e.jsxs(xe,{onClick:()=>w?.(t.id),className:"text-destructive",children:[e.jsx(h.Trash2,{className:"mr-2 h-4 w-4"}),"Supprimer"]})]})]})]}),e.jsxs("div",{className:"flex-1 p-2 space-y-2 min-h-[200px] overflow-y-auto",children:[t.cards.map(P=>e.jsx(kj,{card:P,columnId:t.id,showAssignees:r,showLabels:n,showPriority:o,showDueDate:i,draggable:c,onCardClick:m,onCardEdit:x,onCardDelete:u,onDragStart:k},P.id)),v&&e.jsxs(Se,{className:"p-2",children:[e.jsx(wt,{placeholder:"Titre de la carte...",value:j,onChange:P=>C(P.target.value),className:"min-h-[60px] text-sm",autoFocus:!0}),e.jsxs("div",{className:"flex gap-2 mt-2",children:[e.jsx($,{size:"sm",onClick:E,children:"Ajouter"}),e.jsx($,{size:"sm",variant:"ghost",onClick:()=>{p(!1),C("")},children:e.jsx(h.X,{className:"h-4 w-4"})})]})]})]}),s&&!v&&!M&&e.jsx("div",{className:"p-2 border-t",children:e.jsxs($,{variant:"ghost",size:"sm",className:"w-full justify-start",onClick:()=>p(!0),children:[e.jsx(h.Plus,{className:"h-4 w-4 mr-2"}),"Ajouter une carte"]})}),M&&e.jsx("div",{className:"p-2 border-t text-center text-xs text-muted-foreground",children:"Limite atteinte"})]})}function Dj({columns:t,onColumnsChange:a,onCardClick:s,onCardAdd:r,onCardEdit:n,onCardDelete:o,onCardMove:i,onColumnAdd:c,onColumnEdit:m,onColumnDelete:d,showAddCard:x=!0,showAddColumn:u=!0,showCardCount:f=!0,showAssignees:w=!0,showLabels:k=!0,showPriority:b=!0,showDueDate:y=!0,draggable:v=!0,availableLabels:p=[],availableAssignees:j=[],className:C}){const[N,S]=l.useState(t),[A,R]=l.useState(null),[E,D]=l.useState(!1),[M,P]=l.useState("");l.useEffect(()=>{S(t)},[t]);const T=(L,W,F)=>{R({cardId:W,columnId:F}),L.dataTransfer.effectAllowed="move"},q=L=>{L.preventDefault(),L.dataTransfer.dropEffect="move"},H=(L,W)=>{if(L.preventDefault(),!A)return;const{cardId:F,columnId:G}=A;if(G===W){R(null);return}if(i)i(F,G,W,0);else{const ee=N.map(se=>{if(se.id===G)return{...se,cards:se.cards.filter(le=>le.id!==F)};if(se.id===W){const le=N.find(X=>X.id===G)?.cards.find(X=>X.id===F);if(le)return{...se,cards:[...se.cards,le]}}return se});S(ee),a?.(ee)}R(null)},Y=(L,W)=>{if(r)r(L,W);else{const F={id:`card-${Date.now()}`,title:W.title||"Nouvelle carte",...W},G=N.map(ee=>ee.id===L?{...ee,cards:[...ee.cards,F]}:ee);S(G),a?.(G)}},U=(L,W)=>{if(o)o(L,W);else{const F=N.map(G=>G.id===W?{...G,cards:G.cards.filter(ee=>ee.id!==L)}:G);S(F),a?.(F)}},z=L=>{if(d)d(L);else{const W=N.filter(F=>F.id!==L);S(W),a?.(W)}},V=()=>{if(M.trim()){const L={id:`column-${Date.now()}`,title:M.trim(),cards:[]};if(c)c(L);else{const W=[...N,L];S(W),a?.(W)}P(""),D(!1)}};return e.jsx("div",{className:g("overflow-x-auto",C),children:e.jsxs("div",{className:"flex gap-4 p-4 min-h-[500px]",children:[N.map(L=>e.jsx(Sj,{column:L,showCardCount:f,showAddCard:x,showAssignees:w,showLabels:k,showPriority:b,showDueDate:y,draggable:v,onCardClick:s,onCardAdd:Y,onCardEdit:n,onCardDelete:U,onColumnEdit:m,onColumnDelete:z,onDragStart:T,onDragOver:q,onDrop:H},L.id)),u&&e.jsx("div",{className:"w-72 flex-shrink-0",children:E?e.jsxs(Se,{className:"p-3",children:[e.jsx(oe,{placeholder:"Titre de la colonne...",value:M,onChange:L=>P(L.target.value),autoFocus:!0,onKeyDown:L=>{L.key==="Enter"&&V(),L.key==="Escape"&&D(!1)}}),e.jsxs("div",{className:"flex gap-2 mt-2",children:[e.jsx($,{size:"sm",onClick:V,children:"Ajouter"}),e.jsx($,{size:"sm",variant:"ghost",onClick:()=>{D(!1),P("")},children:e.jsx(h.X,{className:"h-4 w-4"})})]})]}):e.jsxs($,{variant:"outline",className:"w-full justify-start h-12",onClick:()=>D(!0),children:[e.jsx(h.Plus,{className:"h-4 w-4 mr-2"}),"Ajouter une colonne"]})})]})})}const Tj=[{id:"todo",title:"À faire",color:"#6b7280",cards:[{id:"1",title:"Implémenter l'authentification",description:"Ajouter le login/logout avec JWT",priority:"high",labels:[{id:"dev",name:"Dev",color:"#3b82f6"}],assignees:[{id:"1",name:"Marie D."}]},{id:"2",title:"Créer les maquettes",priority:"medium",labels:[{id:"design",name:"Design",color:"#8b5cf6"}]}]},{id:"in-progress",title:"En cours",color:"#3b82f6",limit:3,cards:[{id:"3",title:"Refactoring du dashboard",priority:"medium",assignees:[{id:"2",name:"Pierre M."}],dueDate:new Date(Date.now()+1e3*60*60*24*2)}]},{id:"review",title:"En revue",color:"#f59e0b",cards:[]},{id:"done",title:"Terminé",color:"#10b981",cards:[{id:"4",title:"Setup du projet",priority:"low"}]}],Ej=[{id:"dev",name:"Dev",color:"#3b82f6"},{id:"design",name:"Design",color:"#8b5cf6"},{id:"bug",name:"Bug",color:"#ef4444"},{id:"feature",name:"Feature",color:"#10b981"}];function Mj({logo:t,brandName:a="Brand",navItems:s=[],showLoginButton:r=!0,loginButtonText:n="Se connecter",onLogin:o,loginHref:i}){const[c,m]=l.useState(!1);return e.jsxs("nav",{className:"sticky top-0 z-50 w-full border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:[e.jsxs("div",{className:"container flex h-16 items-center justify-between",children:[e.jsxs("a",{href:"/",className:"flex items-center gap-2 font-bold text-xl",children:[t,e.jsx("span",{children:a})]}),e.jsx("div",{className:"hidden md:flex items-center gap-6",children:s.map(d=>e.jsx("a",{href:d.href,className:g("text-sm font-medium transition-colors hover:text-primary",d.isActive?"text-primary":"text-muted-foreground"),children:d.label},d.href))}),e.jsx("div",{className:"hidden md:flex items-center gap-4",children:r&&e.jsx($,{variant:"default",onClick:o,asChild:!!i,children:i?e.jsx("a",{href:i,children:n}):n})}),e.jsx($,{variant:"ghost",size:"icon",className:"md:hidden",onClick:()=>m(!c),children:c?e.jsx(h.X,{className:"h-5 w-5"}):e.jsx(h.Menu,{className:"h-5 w-5"})})]}),c&&e.jsx("div",{className:"md:hidden border-t bg-background p-4",children:e.jsxs("div",{className:"flex flex-col gap-4",children:[s.map(d=>e.jsx("a",{href:d.href,className:"text-sm font-medium",onClick:()=>m(!1),children:d.label},d.href)),r&&e.jsx($,{onClick:o,asChild:!!i,children:i?e.jsx("a",{href:i,children:n}):n})]})})]})}function Pj({badge:t,title:a,highlightedTitle:s,description:r,primaryButtonText:n="Commencer",primaryButtonAction:o,primaryButtonHref:i,secondaryButtonText:c,secondaryButtonAction:m,secondaryButtonHref:d,image:x,stats:u}){return e.jsx("section",{className:"container py-24 md:py-32",children:e.jsxs("div",{className:"flex flex-col lg:flex-row items-center gap-12",children:[e.jsxs("div",{className:"flex-1 text-center lg:text-left",children:[t&&e.jsx(De,{variant:"secondary",className:"mb-4",children:t}),e.jsxs("h1",{className:"text-4xl md:text-5xl lg:text-6xl font-bold tracking-tight mb-6",children:[a," ",s&&e.jsx("span",{className:"text-primary",children:s})]}),e.jsx("p",{className:"text-lg md:text-xl text-muted-foreground mb-8 max-w-2xl lg:max-w-none",children:r}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center lg:justify-start mb-8",children:[e.jsx($,{size:"lg",onClick:o,asChild:!!i,children:i?e.jsxs("a",{href:i,children:[n,e.jsx(h.ArrowRight,{className:"ml-2 h-4 w-4"})]}):e.jsxs(e.Fragment,{children:[n,e.jsx(h.ArrowRight,{className:"ml-2 h-4 w-4"})]})}),c&&e.jsx($,{size:"lg",variant:"outline",onClick:m,asChild:!!d,children:d?e.jsxs("a",{href:d,children:[e.jsx(h.Play,{className:"mr-2 h-4 w-4"}),c]}):e.jsxs(e.Fragment,{children:[e.jsx(h.Play,{className:"mr-2 h-4 w-4"}),c]})})]}),u&&u.length>0&&e.jsx("div",{className:"flex gap-8 justify-center lg:justify-start",children:u.map((f,w)=>e.jsxs("div",{children:[e.jsx("div",{className:"text-2xl md:text-3xl font-bold",children:f.value}),e.jsx("div",{className:"text-sm text-muted-foreground",children:f.label})]},w))})]}),x&&e.jsx("div",{className:"flex-1 w-full lg:w-auto",children:x})]})})}function Aj({title:t="Fonctionnalités",description:a,features:s}){return e.jsxs("section",{className:"container py-24 bg-muted/30",children:[e.jsxs("div",{className:"text-center mb-12",children:[e.jsx("h2",{className:"text-3xl md:text-4xl font-bold tracking-tight mb-4",children:t}),a&&e.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:a})]}),e.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6",children:s.map(r=>e.jsxs(Se,{className:"bg-background",children:[e.jsxs(He,{children:[e.jsx("div",{className:"h-12 w-12 rounded-lg bg-primary/10 flex items-center justify-center mb-4",children:e.jsx("span",{className:"text-primary",children:r.icon})}),e.jsx(Ve,{className:"text-xl",children:r.title})]}),e.jsx(Ee,{children:e.jsx(nt,{className:"text-base",children:r.description})})]},r.id))})]})}function Rj({title:t="Ce que disent nos clients",testimonials:a}){return e.jsxs("section",{className:"container py-24",children:[e.jsx("h2",{className:"text-3xl md:text-4xl font-bold tracking-tight text-center mb-12",children:t}),e.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6",children:a.map(s=>e.jsx(Se,{children:e.jsxs(Ee,{className:"pt-6",children:[s.rating&&e.jsx("div",{className:"flex gap-1 mb-4",children:Array.from({length:5}).map((r,n)=>e.jsx(h.Star,{className:g("h-4 w-4",n<s.rating?"text-yellow-400 fill-yellow-400":"text-muted-foreground")},n))}),e.jsxs("p",{className:"text-muted-foreground mb-6",children:['"',s.content,'"']}),e.jsxs("div",{className:"flex items-center gap-3",children:[s.avatar?e.jsx("img",{src:s.avatar,alt:s.author,className:"h-10 w-10 rounded-full object-cover"}):e.jsx("div",{className:"h-10 w-10 rounded-full bg-primary/10 flex items-center justify-center",children:e.jsx("span",{className:"text-sm font-medium text-primary",children:s.author.charAt(0)})}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium",children:s.author}),e.jsxs("div",{className:"text-sm text-muted-foreground",children:[s.role,s.company&&` @ ${s.company}`]})]})]})]})},s.id))})]})}function Fj({title:t,description:a,buttonText:s,buttonAction:r,buttonHref:n,secondaryButtonText:o,secondaryButtonAction:i,variant:c="default"}){const m={default:"bg-muted/50",gradient:"bg-gradient-to-r from-primary/10 via-primary/5 to-background",dark:"bg-foreground text-background"};return e.jsx("section",{className:g("py-24",m[c]),children:e.jsx("div",{className:"container",children:e.jsxs("div",{className:"text-center max-w-2xl mx-auto",children:[e.jsx("h2",{className:g("text-3xl md:text-4xl font-bold tracking-tight mb-4",c==="dark"&&"text-background"),children:t}),a&&e.jsx("p",{className:g("text-lg mb-8",c==="dark"?"text-background/80":"text-muted-foreground"),children:a}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:[e.jsx($,{size:"lg",variant:c==="dark"?"secondary":"default",onClick:r,asChild:!!n,children:n?e.jsxs("a",{href:n,children:[s,e.jsx(h.ChevronRight,{className:"ml-2 h-4 w-4"})]}):e.jsxs(e.Fragment,{children:[s,e.jsx(h.ChevronRight,{className:"ml-2 h-4 w-4"})]})}),o&&e.jsx($,{size:"lg",variant:"outline",onClick:i,className:c==="dark"?"border-background/20 text-background hover:bg-background/10":"",children:o})]})]})})})}function $j({logo:t,brandName:a="Brand",navItems:s,showLoginButton:r=!0,loginButtonText:n="Se connecter",onLogin:o,loginHref:i,hero:c,features:m,featuresTitle:d,featuresDescription:x,testimonials:u,testimonialsTitle:f,cta:w,footer:k,className:b}){return e.jsxs("div",{className:g("min-h-screen",b),children:[e.jsx(Mj,{logo:t,brandName:a,navItems:s,showLoginButton:r,loginButtonText:n,onLogin:o,loginHref:i}),c&&e.jsx(Pj,{...c}),m&&m.length>0&&e.jsx(Aj,{title:d,description:x,features:m}),u&&u.length>0&&e.jsx(Rj,{title:f,testimonials:u}),w&&e.jsx(Fj,{...w}),k]})}const Lj=[{label:"Fonctionnalités",href:"#features"},{label:"Tarifs",href:"#pricing"},{label:"Témoignages",href:"#testimonials"},{label:"Contact",href:"#contact"}],Ij=[{id:"1",icon:e.jsx(h.Zap,{className:"h-6 w-6"}),title:"Rapide et performant",description:"Optimisé pour la vitesse avec des temps de chargement minimaux."},{id:"2",icon:e.jsx(h.Shield,{className:"h-6 w-6"}),title:"Sécurisé",description:"Vos données sont protégées avec un chiffrement de bout en bout."},{id:"3",icon:e.jsx(h.Users,{className:"h-6 w-6"}),title:"Collaboration",description:"Travaillez en équipe avec des outils de collaboration intégrés."},{id:"4",icon:e.jsx(h.Globe,{className:"h-6 w-6"}),title:"Accessible partout",description:"Accédez à votre espace depuis n'importe quel appareil."}],Oj=[{id:"1",content:"Cette solution a transformé notre façon de travailler. Nous avons gagné un temps précieux.",author:"Marie Dupont",role:"CEO",company:"TechCorp",rating:5},{id:"2",content:"Interface intuitive et support réactif. Je recommande vivement.",author:"Pierre Martin",role:"CTO",company:"StartupXYZ",rating:5},{id:"3",content:"Le meilleur outil que nous ayons utilisé pour gérer nos projets.",author:"Sophie Bernard",role:"Product Manager",company:"InnoLab",rating:5}],zj={badge:"Nouveau",title:"La solution pour",highlightedTitle:"votre entreprise",description:"Simplifiez votre quotidien avec notre plateforme tout-en-un. Gagnez du temps et concentrez-vous sur l'essentiel.",primaryButtonText:"Essayer gratuitement",secondaryButtonText:"Voir la démo",stats:[{value:"10K+",label:"Utilisateurs"},{value:"99.9%",label:"Uptime"},{value:"24/7",label:"Support"}]},_j={title:"Prêt à commencer ?",description:"Rejoignez des milliers d'entreprises qui nous font confiance.",buttonText:"Créer un compte gratuit",secondaryButtonText:"Contacter les ventes",variant:"gradient"};function Vj({period:t,onChange:a,yearlyDiscount:s}){return e.jsxs("div",{className:"flex items-center justify-center gap-4 mb-8",children:[e.jsx(he,{htmlFor:"billing-toggle",className:g("cursor-pointer transition-colors",t==="monthly"?"text-foreground":"text-muted-foreground"),children:"Mensuel"}),e.jsx(sa,{id:"billing-toggle",checked:t==="yearly",onCheckedChange:r=>a(r?"yearly":"monthly")}),e.jsxs(he,{htmlFor:"billing-toggle",className:g("cursor-pointer transition-colors flex items-center gap-2",t==="yearly"?"text-foreground":"text-muted-foreground"),children:["Annuel",s&&e.jsxs(De,{variant:"secondary",className:"text-xs",children:["-",s]})]})]})}function Wj({plan:t,billingPeriod:a}){const s=a==="yearly"&&t.priceYearly!==void 0?t.priceYearly:t.price,r=a==="yearly"&&t.periodYearly?t.periodYearly:t.period||"/mois",n=typeof s=="string";return e.jsxs(Se,{className:g("relative flex flex-col",t.popular&&"border-primary shadow-lg scale-105"),children:[t.popular&&e.jsx("div",{className:"absolute -top-3 left-1/2 -translate-x-1/2",children:e.jsxs(De,{className:"px-3",children:[e.jsx(h.Zap,{className:"h-3 w-3 mr-1"}),t.badge||"Populaire"]})}),e.jsxs(He,{className:"text-center pb-2",children:[e.jsx(Ve,{className:"text-xl",children:t.name}),t.description&&e.jsx(nt,{children:t.description})]}),e.jsxs(Ee,{className:"flex-1",children:[e.jsx("div",{className:"text-center mb-6",children:n?e.jsx("div",{className:"text-3xl font-bold",children:s}):e.jsxs("div",{className:"flex items-baseline justify-center",children:[e.jsx("span",{className:"text-sm text-muted-foreground mr-1",children:t.currency||"€"}),e.jsx("span",{className:"text-4xl font-bold",children:s}),e.jsx("span",{className:"text-sm text-muted-foreground ml-1",children:r})]})}),e.jsx("ul",{className:"space-y-3",children:t.features.map((o,i)=>e.jsxs("li",{className:"flex items-start gap-2",children:[o.included===!0?e.jsx(h.Check,{className:"h-5 w-5 text-green-500 flex-shrink-0"}):o.included==="partial"||o.included==="limited"?e.jsx(h.Check,{className:"h-5 w-5 text-yellow-500 flex-shrink-0"}):e.jsx(h.X,{className:"h-5 w-5 text-muted-foreground flex-shrink-0"}),e.jsxs("span",{className:g("text-sm",!o.included&&"text-muted-foreground"),children:[o.name,o.value&&e.jsxs("span",{className:"text-muted-foreground ml-1",children:["(",o.value,")"]})]}),o.tooltip&&e.jsx(Xs,{children:e.jsxs(Ys,{children:[e.jsx(Js,{asChild:!0,children:e.jsx(h.HelpCircle,{className:"h-4 w-4 text-muted-foreground cursor-help"})}),e.jsx(Ss,{children:e.jsx("p",{className:"max-w-xs",children:o.tooltip})})]})})]},i))})]}),e.jsx(xr,{children:e.jsx($,{className:"w-full",variant:t.buttonVariant||(t.popular?"default":"outline"),onClick:t.onSelect,disabled:t.disabled,asChild:!!t.href,children:t.href?e.jsx("a",{href:t.href,children:t.buttonText||"Choisir"}):t.buttonText||"Choisir"})})]})}function Uj({plans:t,billingPeriod:a}){const s=Array.from(new Set(t.flatMap(r=>r.features.map(n=>n.name))));return e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsxs("thead",{children:[e.jsxs("tr",{children:[e.jsx("th",{className:"text-left p-4 border-b bg-muted/50",children:"Fonctionnalité"}),t.map(r=>e.jsxs("th",{className:g("text-center p-4 border-b min-w-[150px]",r.popular&&"bg-primary/5"),children:[e.jsx("div",{className:"font-bold",children:r.name}),r.popular&&e.jsx(De,{className:"mt-1",variant:"default",children:"Populaire"})]},r.id))]}),e.jsxs("tr",{children:[e.jsx("td",{className:"p-4 border-b bg-muted/50 font-medium",children:"Prix"}),t.map(r=>{const n=a==="yearly"&&r.priceYearly!==void 0?r.priceYearly:r.price,o=a==="yearly"&&r.periodYearly?r.periodYearly:r.period||"/mois",i=typeof n=="string";return e.jsx("td",{className:g("text-center p-4 border-b",r.popular&&"bg-primary/5"),children:i?e.jsx("span",{className:"font-bold",children:n}):e.jsxs("span",{className:"font-bold",children:[r.currency||"€",n,e.jsx("span",{className:"text-sm font-normal text-muted-foreground",children:o})]})},r.id)})]})]}),e.jsxs("tbody",{children:[s.map((r,n)=>e.jsxs("tr",{className:n%2===0?"bg-muted/20":"",children:[e.jsx("td",{className:"p-4 border-b",children:r}),t.map(o=>{const i=o.features.find(c=>c.name===r);return e.jsx("td",{className:g("text-center p-4 border-b",o.popular&&"bg-primary/5"),children:i?i.included===!0?i.value?e.jsx("span",{children:i.value}):e.jsx(h.Check,{className:"h-5 w-5 text-green-500 mx-auto"}):i.included==="partial"||i.included==="limited"?e.jsx("span",{className:"text-yellow-600",children:i.value||"Limité"}):e.jsx(h.X,{className:"h-5 w-5 text-muted-foreground mx-auto"}):e.jsx(h.X,{className:"h-5 w-5 text-muted-foreground mx-auto"})},o.id)})]},n)),e.jsxs("tr",{children:[e.jsx("td",{className:"p-4"}),t.map(r=>e.jsx("td",{className:g("text-center p-4",r.popular&&"bg-primary/5"),children:e.jsx($,{variant:r.buttonVariant||(r.popular?"default":"outline"),onClick:r.onSelect,disabled:r.disabled,asChild:!!r.href,children:r.href?e.jsx("a",{href:r.href,children:r.buttonText||"Choisir"}):r.buttonText||"Choisir"})},r.id))]})]})]})})}function Bj({title:t="Questions fréquentes",items:a}){return e.jsxs("div",{className:"mt-16",children:[e.jsx("h2",{className:"text-2xl font-bold text-center mb-8",children:t}),e.jsx("div",{className:"grid md:grid-cols-2 gap-6 max-w-4xl mx-auto",children:a.map((s,r)=>e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"font-semibold",children:s.question}),e.jsx("p",{className:"text-muted-foreground text-sm",children:s.answer})]},r))})]})}function qj({title:t="Tarification",description:a,plans:s,showBillingToggle:r=!0,billingPeriod:n,onBillingPeriodChange:o,yearlyDiscount:i,faq:c,faqTitle:m,layout:d="cards",columns:x=3,showComparison:u=!1,className:f}){const[w,k]=l.useState("monthly"),b=n??w,y=p=>{o?o(p):k(p)},v={2:"md:grid-cols-2",3:"md:grid-cols-2 lg:grid-cols-3",4:"md:grid-cols-2 lg:grid-cols-4"};return e.jsxs("div",{className:g("container py-16",f),children:[e.jsxs("div",{className:"text-center mb-12",children:[e.jsx("h1",{className:"text-3xl md:text-4xl font-bold tracking-tight mb-4",children:t}),a&&e.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:a})]}),r&&e.jsx(Vj,{period:b,onChange:y,yearlyDiscount:i}),d==="cards"&&!u?e.jsx("div",{className:g("grid gap-6 items-stretch",v[x]),children:s.map(p=>e.jsx(Wj,{plan:p,billingPeriod:b},p.id))}):e.jsx(Uj,{plans:s,billingPeriod:b}),c&&c.length>0&&e.jsx(Bj,{title:m,items:c})]})}const Hj=[{id:"free",name:"Gratuit",description:"Pour démarrer",price:0,priceYearly:0,features:[{name:"1 utilisateur",included:!0},{name:"5 projets",included:!0},{name:"1 Go de stockage",included:!0},{name:"Support email",included:!0},{name:"API Access",included:!1},{name:"Analytics avancés",included:!1},{name:"Support prioritaire",included:!1}],buttonText:"Commencer gratuitement",buttonVariant:"outline"},{id:"pro",name:"Pro",description:"Pour les équipes",price:29,priceYearly:24,periodYearly:"/mois (facturé annuellement)",popular:!0,features:[{name:"5 utilisateurs",included:!0},{name:"Projets illimités",included:!0},{name:"50 Go de stockage",included:!0},{name:"Support email",included:!0},{name:"API Access",included:!0},{name:"Analytics avancés",included:!0},{name:"Support prioritaire",included:!1}],buttonText:"Essai gratuit 14 jours"},{id:"enterprise",name:"Enterprise",description:"Pour les grandes équipes",price:"Sur mesure",features:[{name:"Utilisateurs illimités",included:!0},{name:"Projets illimités",included:!0},{name:"Stockage illimité",included:!0},{name:"Support email",included:!0},{name:"API Access",included:!0},{name:"Analytics avancés",included:!0},{name:"Support prioritaire",included:!0}],buttonText:"Contacter les ventes",buttonVariant:"outline"}],Gj=[{question:"Puis-je changer de plan à tout moment ?",answer:"Oui, vous pouvez upgrader ou downgrader votre plan à tout moment. Les changements prennent effet immédiatement."},{question:"Y a-t-il une période d'essai ?",answer:"Oui, tous nos plans payants incluent une période d'essai gratuite de 14 jours, sans carte bancaire requise."},{question:"Quels moyens de paiement acceptez-vous ?",answer:"Nous acceptons les cartes de crédit (Visa, Mastercard, Amex), PayPal et les virements bancaires pour les entreprises."},{question:"Puis-je annuler à tout moment ?",answer:"Absolument. Vous pouvez annuler votre abonnement à tout moment sans frais supplémentaires."}],ec=l.createContext(null);function Xj(){const t=l.useContext(ec);if(!t)throw new Error("useWizard must be used within a WakaWizard");return t}function Yj({steps:t,currentStep:a,stepStatuses:s,showStepNumbers:r,orientation:n,onStepClick:o,allowBackNavigation:i}){const c=(d,x)=>x==="completed"?e.jsx(h.Check,{className:"h-4 w-4"}):x==="error"?e.jsx(h.AlertCircle,{className:"h-4 w-4"}):x==="skipped"?e.jsx(h.X,{className:"h-4 w-4 text-muted-foreground"}):r?e.jsx("span",{className:"text-xs font-medium",children:d+1}):e.jsx(h.Circle,{className:"h-3 w-3"}),m=d=>{switch(d){case"completed":return"bg-primary text-primary-foreground border-primary";case"current":return"bg-primary text-primary-foreground border-primary";case"error":return"bg-destructive text-destructive-foreground border-destructive";case"skipped":return"bg-muted text-muted-foreground border-muted";default:return"bg-background text-muted-foreground border-border"}};return n==="vertical"?e.jsx("div",{className:"flex flex-col gap-0",children:t.map((d,x)=>{const u=s[x],f=i&&x<a;return e.jsxs("div",{className:"flex gap-3",children:[e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("button",{type:"button",disabled:!f,onClick:()=>f&&o?.(x),className:g("flex h-8 w-8 items-center justify-center rounded-full border-2 transition-colors",m(u),f&&"cursor-pointer hover:opacity-80"),children:d.icon||c(x,u)}),x<t.length-1&&e.jsx("div",{className:g("w-0.5 flex-1 min-h-[24px]",s[x]==="completed"?"bg-primary":"bg-border")})]}),e.jsxs("div",{className:"pb-8",children:[e.jsxs("div",{className:g("font-medium",u==="current"?"text-foreground":"text-muted-foreground"),children:[d.title,d.optional&&e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:"(optionnel)"})]}),d.description&&e.jsx("div",{className:"text-sm text-muted-foreground mt-0.5",children:d.description})]})]},d.id)})}):e.jsx("div",{className:"flex items-center gap-0",children:t.map((d,x)=>{const u=s[x],f=i&&x<a;return e.jsxs(l.Fragment,{children:[e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsx("button",{type:"button",disabled:!f,onClick:()=>f&&o?.(x),className:g("flex h-8 w-8 items-center justify-center rounded-full border-2 transition-colors",m(u),f&&"cursor-pointer hover:opacity-80"),children:d.icon||c(x,u)}),e.jsx("div",{className:"text-center",children:e.jsx("div",{className:g("text-sm font-medium",u==="current"?"text-foreground":"text-muted-foreground"),children:d.title})})]}),x<t.length-1&&e.jsx("div",{className:g("flex-1 h-0.5 mx-2 mb-6",s[x]==="completed"?"bg-primary":"bg-border")})]},d.id)})})}function Jj({onPrev:t,onNext:a,onSkip:s,onCancel:r,isFirstStep:n,isLastStep:o,isOptional:i,prevButtonText:c,nextButtonText:m,finishButtonText:d,skipButtonText:x,cancelButtonText:u,showCancelButton:f,submitting:w}){return e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"flex gap-2",children:f&&r&&e.jsx($,{type:"button",variant:"ghost",onClick:r,disabled:w,children:u})}),e.jsxs("div",{className:"flex gap-2",children:[!n&&e.jsxs($,{type:"button",variant:"outline",onClick:t,disabled:w,children:[e.jsx(h.ArrowLeft,{className:"mr-2 h-4 w-4"}),c]}),i&&s&&!o&&e.jsx($,{type:"button",variant:"ghost",onClick:s,disabled:w,children:x}),e.jsxs($,{type:"button",onClick:a,disabled:w,children:[w&&e.jsx(h.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),o?d:m,!o&&!w&&e.jsx(h.ArrowRight,{className:"ml-2 h-4 w-4"})]})]})]})}function Kj({steps:t,currentStep:a,onStepChange:s,onSubmit:r,onCancel:n,title:o,description:i,prevButtonText:c="Précédent",nextButtonText:m="Suivant",finishButtonText:d="Terminer",cancelButtonText:x="Annuler",skipButtonText:u="Passer",showCancelButton:f=!0,showProgress:w=!0,showStepNumbers:k=!0,showStepper:b=!0,stepperPosition:y="top",allowBackNavigation:v=!0,confirmCancel:p=!0,cancelConfirmMessage:j="Êtes-vous sûr de vouloir annuler ? Toutes les modifications seront perdues.",submitting:C=!1,layout:N="card",className:S}){const[A,R]=l.useState(0),[E,D]=l.useState(t.map((K,I)=>I===0?"current":"pending")),[M,P]=l.useState(!1),T=a??A,q=T===0,H=T===t.length-1,Y=t[T],U=(T+1)/t.length*100,z=(K,I)=>{D(te=>{const Z=[...te];if(I==="next"&&T<t.length)Z[T]="completed";else if(I==="skip")Z[T]="skipped";else if(I==="goto"&&K<T)for(let J=K+1;J<t.length;J++)Z[J]="pending";return Z[K]="current",Z})},V=async K=>{if(K<0||K>=t.length||K>T&&!v)return;Y.onLeave&&await Y.onLeave(),z(K,"goto"),s?s(K):R(K);const I=t[K];I.onEnter&&await I.onEnter()},L=async()=>{if(Y.validate&&!await Y.validate()){D(I=>{const te=[...I];return te[T]="error",te});return}if(Y.onLeave&&await Y.onLeave(),H){const K={steps:t.map((I,te)=>({id:I.id,status:te===T?"completed":E[te]})),completedSteps:t.filter((I,te)=>E[te]==="completed"||te===T).map(I=>I.id),skippedSteps:t.filter((I,te)=>E[te]==="skipped").map(I=>I.id)};await r?.(K)}else{const K=T+1;z(K,"next"),s?s(K):R(K);const I=t[K];I.onEnter&&await I.onEnter()}},W=async()=>{if(q)return;Y.onLeave&&await Y.onLeave();const K=T-1;z(K,"prev"),s?s(K):R(K);const I=t[K];I.onEnter&&await I.onEnter()},F=async()=>{if(!Y.optional||H)return;Y.onLeave&&await Y.onLeave();const K=T+1;z(K,"skip"),s?s(K):R(K);const I=t[K];I.onEnter&&await I.onEnter()},G=()=>{p?P(!0):n?.()},ee={currentStep:T,totalSteps:t.length,stepStatuses:E,goToStep:V,nextStep:L,prevStep:W,skipStep:F,isFirstStep:q,isLastStep:H},se=b&&e.jsx(Yj,{steps:t,currentStep:T,stepStatuses:E,showStepNumbers:k,orientation:y==="left"?"vertical":"horizontal",onStepClick:V,allowBackNavigation:v}),le=e.jsx(Jj,{onPrev:W,onNext:L,onSkip:Y.optional?F:void 0,onCancel:n?G:void 0,isFirstStep:q,isLastStep:H,isOptional:Y.optional||!1,prevButtonText:c,nextButtonText:m,finishButtonText:d,skipButtonText:u,cancelButtonText:x,showCancelButton:f,submitting:C}),X=e.jsxs(ec.Provider,{value:ee,children:[y==="left"?e.jsxs("div",{className:"flex gap-8",children:[e.jsx("div",{className:"w-64 flex-shrink-0",children:se}),e.jsxs("div",{className:"flex-1",children:[w&&e.jsxs("div",{className:"mb-6",children:[e.jsxs("div",{className:"flex justify-between text-sm text-muted-foreground mb-2",children:[e.jsxs("span",{children:["Étape ",T+1," sur ",t.length]}),e.jsxs("span",{children:[Math.round(U),"%"]})]}),e.jsx(Gs,{value:U})]}),e.jsx("div",{className:"min-h-[300px]",children:Y.content}),e.jsx("div",{className:"mt-8",children:le})]})]}):e.jsxs(e.Fragment,{children:[se&&e.jsx("div",{className:"mb-8",children:se}),w&&e.jsxs("div",{className:"mb-6",children:[e.jsxs("div",{className:"flex justify-between text-sm text-muted-foreground mb-2",children:[e.jsxs("span",{children:["Étape ",T+1," sur ",t.length]}),e.jsxs("span",{children:[Math.round(U),"%"]})]}),e.jsx(Gs,{value:U})]}),e.jsx("div",{className:"min-h-[300px]",children:Y.content}),e.jsx("div",{className:"mt-8",children:le})]}),e.jsx(fs,{open:M,onOpenChange:P,children:e.jsxs(Xt,{children:[e.jsxs(Yt,{children:[e.jsx(Kt,{children:"Annuler ?"}),e.jsx(Qt,{children:j})]}),e.jsxs(Jt,{children:[e.jsx(es,{children:"Non, continuer"}),e.jsx(Zt,{onClick:()=>{P(!1),n?.()},children:"Oui, annuler"})]})]})})]});return N==="minimal"?e.jsx("div",{className:g("space-y-6",S),children:X}):N==="page"?e.jsxs("div",{className:g("container py-8 max-w-4xl",S),children:[(o||i)&&e.jsxs("div",{className:"mb-8",children:[o&&e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:o}),i&&e.jsx("p",{className:"text-muted-foreground mt-1",children:i})]}),X]}):e.jsxs(Se,{className:S,children:[(o||i)&&e.jsxs(He,{children:[o&&e.jsx(Ve,{children:o}),i&&e.jsx(nt,{children:i})]}),e.jsx(Ee,{children:X})]})}const Qj=[{id:"step-1",title:"Informations de base",description:"Renseignez vos informations personnelles",content:e.jsx("div",{className:"space-y-4",children:e.jsx("p",{className:"text-muted-foreground",children:"Contenu de l'étape 1 - Informations de base"})})},{id:"step-2",title:"Configuration",description:"Configurez vos préférences",optional:!0,content:e.jsx("div",{className:"space-y-4",children:e.jsx("p",{className:"text-muted-foreground",children:"Contenu de l'étape 2 - Configuration (optionnel)"})})},{id:"step-3",title:"Confirmation",description:"Vérifiez et confirmez",content:e.jsx("div",{className:"space-y-4",children:e.jsx("p",{className:"text-muted-foreground",children:"Contenu de l'étape 3 - Confirmation"})})}];function Ne(t){t=t.replace(/^#/,"");const a=parseInt(t.slice(0,2),16)/255,s=parseInt(t.slice(2,4),16)/255,r=parseInt(t.slice(4,6),16)/255,n=Math.max(a,s,r),o=Math.min(a,s,r);let i=0,c=0;const m=(n+o)/2;if(n!==o){const d=n-o;switch(c=m>.5?d/(2-n-o):d/(n+o),n){case a:i=((s-r)/d+(s<r?6:0))/6;break;case s:i=((r-a)/d+2)/6;break;case r:i=((a-s)/d+4)/6;break}}return`${Math.round(i*360)} ${Math.round(c*100)}% ${Math.round(m*100)}%`}function yo(t,a,s,r){const n=o=>({background:Ne(o.background),foreground:Ne(o.foreground),card:Ne(o.card),"card-foreground":Ne(o.cardForeground),popover:Ne(o.popover),"popover-foreground":Ne(o.popoverForeground),primary:Ne(o.primary),"primary-foreground":Ne(o.primaryForeground),secondary:Ne(o.secondary),"secondary-foreground":Ne(o.secondaryForeground),muted:Ne(o.muted),"muted-foreground":Ne(o.mutedForeground),accent:Ne(o.accent),"accent-foreground":Ne(o.accentForeground),destructive:Ne(o.destructive),"destructive-foreground":Ne(o.destructiveForeground),border:Ne(o.border),input:Ne(o.input),ring:Ne(o.ring),"chart-1":Ne(o.chart1),"chart-2":Ne(o.chart2),"chart-3":Ne(o.chart3),"chart-4":Ne(o.chart4),"chart-5":Ne(o.chart5),...o.sidebarBackground&&{"sidebar-background":Ne(o.sidebarBackground)},...o.sidebarForeground&&{"sidebar-foreground":Ne(o.sidebarForeground)},...o.sidebarPrimary&&{"sidebar-primary":Ne(o.sidebarPrimary)},...o.sidebarPrimaryForeground&&{"sidebar-primary-foreground":Ne(o.sidebarPrimaryForeground)},...o.sidebarAccent&&{"sidebar-accent":Ne(o.sidebarAccent)},...o.sidebarAccentForeground&&{"sidebar-accent-foreground":Ne(o.sidebarAccentForeground)},...o.sidebarBorder&&{"sidebar-border":Ne(o.sidebarBorder)},...o.sidebarRing&&{"sidebar-ring":Ne(o.sidebarRing)}});return{name:t,type:"registry:theme",cssVars:{theme:{radius:r||"0.5rem"},light:n(a),dark:n(s)}}}const Zj={background:"#ffffff",foreground:"#0a0a0a",card:"#ffffff",cardForeground:"#0a0a0a",popover:"#ffffff",popoverForeground:"#0a0a0a",primary:"#171717",primaryForeground:"#fafafa",secondary:"#f5f5f5",secondaryForeground:"#171717",muted:"#f5f5f5",mutedForeground:"#737373",accent:"#f5f5f5",accentForeground:"#171717",destructive:"#ef4444",destructiveForeground:"#fafafa",border:"#e5e5e5",input:"#e5e5e5",ring:"#0a0a0a",chart1:"#e76e50",chart2:"#2a9d90",chart3:"#274754",chart4:"#e8c468",chart5:"#f4a462"},ev={background:"#0a0a0a",foreground:"#fafafa",card:"#0a0a0a",cardForeground:"#fafafa",popover:"#0a0a0a",popoverForeground:"#fafafa",primary:"#fafafa",primaryForeground:"#171717",secondary:"#262626",secondaryForeground:"#fafafa",muted:"#262626",mutedForeground:"#a3a3a3",accent:"#262626",accentForeground:"#fafafa",destructive:"#7f1d1d",destructiveForeground:"#fafafa",border:"#262626",input:"#262626",ring:"#d4d4d4",chart1:"#2662d9",chart2:"#2eb88a",chart3:"#e88c30",chart4:"#af57db",chart5:"#e23670"},tv={background:"#f0fdfa",foreground:"#134e4a",card:"#ffffff",cardForeground:"#134e4a",popover:"#ffffff",popoverForeground:"#134e4a",primary:"#14b8a6",primaryForeground:"#ffffff",secondary:"#ccfbf1",secondaryForeground:"#134e4a",muted:"#ccfbf1",mutedForeground:"#5eead4",accent:"#2dd4bf",accentForeground:"#022c22",destructive:"#ef4444",destructiveForeground:"#fafafa",border:"#99f6e4",input:"#99f6e4",ring:"#14b8a6",chart1:"#14b8a6",chart2:"#2dd4bf",chart3:"#5eead4",chart4:"#0d9488",chart5:"#0f766e"},sv={background:"#042f2e",foreground:"#ccfbf1",card:"#134e4a",cardForeground:"#ccfbf1",popover:"#134e4a",popoverForeground:"#ccfbf1",primary:"#2dd4bf",primaryForeground:"#042f2e",secondary:"#115e59",secondaryForeground:"#ccfbf1",muted:"#115e59",mutedForeground:"#5eead4",accent:"#14b8a6",accentForeground:"#042f2e",destructive:"#ef4444",destructiveForeground:"#fafafa",border:"#115e59",input:"#115e59",ring:"#2dd4bf",chart1:"#2dd4bf",chart2:"#14b8a6",chart3:"#5eead4",chart4:"#99f6e4",chart5:"#0d9488"},dr=[{id:"default",name:"Default",lightColors:Zj,darkColors:ev,radius:"0.5rem"},{id:"ocean",name:"Ocean Breeze",lightColors:tv,darkColors:sv,radius:"0.5rem"}],av=[{id:"primary",label:"Primary",colors:[{key:"primary",label:"Primary"},{key:"primaryForeground",label:"Foreground"}]},{id:"secondary",label:"Secondary",colors:[{key:"secondary",label:"Secondary"},{key:"secondaryForeground",label:"Foreground"}]},{id:"accent",label:"Accent",colors:[{key:"accent",label:"Accent"},{key:"accentForeground",label:"Foreground"}]},{id:"base",label:"Base",colors:[{key:"background",label:"Background"},{key:"foreground",label:"Foreground"}]},{id:"card",label:"Card",colors:[{key:"card",label:"Card"},{key:"cardForeground",label:"Foreground"}]},{id:"popover",label:"Popover",colors:[{key:"popover",label:"Popover"},{key:"popoverForeground",label:"Foreground"}]},{id:"muted",label:"Muted",colors:[{key:"muted",label:"Muted"},{key:"mutedForeground",label:"Foreground"}]},{id:"destructive",label:"Destructive",colors:[{key:"destructive",label:"Destructive"},{key:"destructiveForeground",label:"Foreground"}]},{id:"border",label:"Border & Input",colors:[{key:"border",label:"Border"},{key:"input",label:"Input"},{key:"ring",label:"Ring"}]},{id:"chart",label:"Charts",colors:[{key:"chart1",label:"1"},{key:"chart2",label:"2"},{key:"chart3",label:"3"},{key:"chart4",label:"4"},{key:"chart5",label:"5"}]}];function rv({label:t,value:a,onChange:s}){return e.jsxs("div",{className:"flex items-center gap-2 py-1",children:[e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"color",value:a,onChange:r=>s(r.target.value),className:"w-7 h-7 rounded cursor-pointer border-0 bg-transparent p-0",style:{WebkitAppearance:"none",appearance:"none"}}),e.jsx("div",{className:"absolute inset-0.5 rounded pointer-events-none border border-border/20",style:{backgroundColor:a}})]}),e.jsx("span",{className:"text-[11px] text-muted-foreground flex-1 truncate",children:t}),e.jsx(oe,{value:a,onChange:r=>s(r.target.value),className:"h-6 w-16 text-[10px] font-mono px-1.5 bg-muted/50 border-0"})]})}function cs({label:t,value:a,onUpload:s,onRemove:r,accept:n="image/*",isUploading:o}){const i=l.useRef(null),c=async m=>{const d=m.target.files?.[0];d&&await s(d),i.current&&(i.current.value="")};return e.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-lg border border-border/30 bg-muted/20",children:[a?e.jsx("img",{src:a,alt:t,className:"w-8 h-8 object-contain rounded bg-background"}):e.jsx("div",{className:"w-8 h-8 rounded bg-muted/50 flex items-center justify-center",children:e.jsx(h.ImageIcon,{className:"w-3 h-3 text-muted-foreground"})}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx("p",{className:"text-[11px] font-medium truncate",children:t})}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx($,{variant:"ghost",size:"sm",onClick:()=>i.current?.click(),disabled:o,className:"h-6 w-6 p-0",children:o?e.jsx(h.Loader2,{className:"h-3 w-3 animate-spin"}):e.jsx(h.Upload,{className:"h-3 w-3"})}),a&&e.jsx($,{variant:"ghost",size:"sm",onClick:r,className:"h-6 w-6 p-0 text-destructive",children:e.jsx(h.Trash2,{className:"h-3 w-3"})})]}),e.jsx("input",{ref:i,type:"file",accept:n,onChange:c,className:"hidden"})]})}function nv({group:t,colors:a,onChange:s,defaultOpen:r=!1}){const[n,o]=l.useState(r);return e.jsxs(yr,{open:n,onOpenChange:o,children:[e.jsxs(Nr,{className:"flex items-center justify-between w-full py-1.5 px-2 hover:bg-muted/30 rounded transition-colors text-left",children:[e.jsx("span",{className:"text-[11px] font-medium",children:t.label}),e.jsxs("div",{className:"flex items-center gap-1",children:[t.colors.slice(0,3).map(i=>e.jsx("div",{className:"w-2.5 h-2.5 rounded-sm border border-border/30",style:{backgroundColor:a[i.key]||"#000"}},i.key)),e.jsx(h.ChevronDown,{className:g("h-3 w-3 text-muted-foreground ml-1 transition-transform",n&&"rotate-180")})]})]}),e.jsx(Cr,{className:"px-2 pb-1",children:t.colors.map(i=>e.jsx(rv,{label:i.label,value:a[i.key]||"#000000",onChange:c=>s(i.key,c)},i.key))})]})}function ov({assets:t,isDark:a}){return e.jsx("div",{className:"h-full w-full overflow-auto",children:e.jsx(Wl,{config:{theme_json:{name:"preview",dark_mode:a},assets:{theme_logo_light:t?.logoLight,theme_logo_dark:t?.logoDark,theme_image_light:t?.backgroundLight,theme_image_dark:t?.backgroundDark},signup_options:{allow_login:!0,require_MFA:!1,MFA_email:!1,MFA_whatsapp:!1,MFA_RCS:!1,allow_sso_google:!0,allow_sso_microsoft:!1,allow_sso_apple:!1,allow_sso_linkedIn:!1,allow_sso_github:!0,allow_sso_facebook:!1,allow_sso_instagram:!1,allow_sso_france_connect:!1}},showSocialLogin:!0,onSSOGoogle:()=>{},onSSOGithub:()=>{},className:"min-h-full"})})}function iv(){return e.jsx("div",{className:"h-full w-full overflow-auto p-4",children:e.jsx(Hl,{title:"Tableau de bord",description:"Aperçu de vos statistiques",stats:Gl,showHeader:!0,statsLayout:"grid",statsColumns:4})})}function lv(){return e.jsx("div",{className:"h-full w-full overflow-hidden",children:e.jsx(Jl,{conversations:cr,activeConversation:cr[0],messages:Kl,currentUser:ks,showConversationList:!0,showHeader:!0,layout:"full",className:"h-full"})})}function tc({themes:t=dr,initialTheme:a,onThemeChange:s,onSave:r,onUploadAsset:n,showSidebarColors:o=!1,previewTabs:i=["login","dashboard","chat"],className:c}){const{toast:m}=Aa(),{loadThemeFromJSON:d,isDarkMode:x,toggleDarkMode:u}=Ms(),[f,w]=l.useState(a||t[0]||dr[0]),[k,b]=l.useState(f.id),[y,v]=l.useState("colors"),[p,j]=l.useState(i[0]),[C,N]=l.useState("light"),[S,A]=l.useState(!1),[R,E]=l.useState(!1),[D,M]=l.useState(null),[P,T]=l.useState([f]),[q,H]=l.useState(0),Y=C==="light"?f.lightColors:f.darkColors,U=l.useRef(),z=l.useCallback(I=>{U.current&&clearTimeout(U.current),U.current=setTimeout(async()=>{try{const te=yo("theme-creator-preview",I.lightColors,I.darkColors,I.radius);await d("theme-creator-preview",te)}catch(te){console.error("Failed to apply theme:",te)}},50)},[d]);l.useEffect(()=>(z(f),()=>{U.current&&clearTimeout(U.current)}),[f,z]),l.useEffect(()=>{x!==(C==="dark")&&u()},[C,x,u]);const V=l.useCallback((I,te)=>{w(Z=>{const J=C==="light"?"lightColors":"darkColors",ne={...Z,[J]:{...Z[J],[I]:te}};return s?.(ne),ne})},[C,s]),L=l.useCallback(()=>{T(I=>[...I.slice(0,q+1),f]),H(I=>I+1)},[f,q]);l.useEffect(()=>{const I=setTimeout(L,500);return()=>clearTimeout(I)},[f,L]);const W=l.useCallback(I=>{const te=t.find(Z=>Z.id===I);te&&(w(te),b(I),T([te]),H(0),s?.(te))},[t,s]),F=l.useCallback(()=>{q>0&&(H(I=>I-1),w(P[q-1]))},[P,q]),G=l.useCallback(()=>{q<P.length-1&&(H(I=>I+1),w(P[q+1]))},[P,q]),ee=l.useCallback(()=>{const I=t.find(te=>te.id===k);I&&(w(I),T([I]),H(0),s?.(I),m({title:"Theme reset"}))},[t,k,s,m]),se=l.useCallback(async()=>{if(r){A(!0);try{await r(f),m({title:"Theme saved!"})}catch{m({title:"Error saving theme",variant:"destructive"})}finally{A(!1)}}},[f,r,m]),le=l.useCallback(async()=>{const I=yo(f.id,f.lightColors,f.darkColors,f.radius),te=Object.entries(I.cssVars?.light||{}).map(([ne,me])=>` --${ne}: ${me};`).join(`
|
|
77
|
+
`),Z=Object.entries(I.cssVars?.dark||{}).map(([ne,me])=>` --${ne}: ${me};`).join(`
|
|
78
|
+
`),J=`:root {
|
|
79
|
+
${te}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.dark {
|
|
83
|
+
${Z}
|
|
84
|
+
}`;await navigator.clipboard.writeText(J),E(!0),setTimeout(()=>E(!1),2e3),m({title:"CSS copied!"})},[f,m]),X=l.useCallback(async(I,te)=>{if(n){M(te);try{const Z=await n(I,te);w(J=>{const ne={...J,assets:{...J.assets,[te]:Z}};return s?.(ne),ne}),m({title:"Asset uploaded"})}catch{m({title:"Upload failed",variant:"destructive"})}finally{M(null)}}},[n,s,m]),K=l.useCallback(I=>{w(te=>{const Z={...te.assets};delete Z[I];const J={...te,assets:Z};return s?.(J),J})},[s]);return e.jsxs("div",{className:g("flex h-[calc(100vh-180px)] min-h-[500px] border rounded-lg overflow-hidden bg-background",c),children:[e.jsxs("div",{className:"w-56 border-r flex flex-col bg-card/30 shrink-0",children:[e.jsxs("div",{className:"p-2 border-b space-y-1.5",children:[e.jsxs(Oe,{value:k,onValueChange:W,children:[e.jsx(Le,{className:"h-7 text-xs",children:e.jsx(ze,{})}),e.jsx(Ie,{children:t.map(I=>e.jsx(be,{value:I.id,children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-2 w-2 rounded-full",style:{backgroundColor:I.lightColors.primary}}),e.jsx("span",{className:"text-xs",children:I.name})]})},I.id))})]}),e.jsxs("div",{className:"flex gap-0.5 p-0.5 bg-muted rounded",children:[e.jsxs("button",{onClick:()=>v("colors"),className:g("flex-1 flex items-center justify-center gap-1 px-2 py-0.5 rounded text-[10px] transition-all",y==="colors"?"bg-background shadow-sm":"text-muted-foreground hover:text-foreground"),children:[e.jsx(h.Palette,{className:"h-3 w-3"})," Colors"]}),e.jsxs("button",{onClick:()=>v("assets"),className:g("flex-1 flex items-center justify-center gap-1 px-2 py-0.5 rounded text-[10px] transition-all",y==="assets"?"bg-background shadow-sm":"text-muted-foreground hover:text-foreground"),children:[e.jsx(h.Image,{className:"h-3 w-3"})," Assets"]})]}),y==="colors"&&e.jsxs("div",{className:"flex gap-0.5 p-0.5 bg-muted/50 rounded",children:[e.jsxs("button",{onClick:()=>N("light"),className:g("flex-1 flex items-center justify-center gap-1 px-2 py-0.5 rounded text-[10px] transition-all",C==="light"?"bg-background shadow-sm":"text-muted-foreground"),children:[e.jsx(h.Sun,{className:"h-3 w-3"})," Light"]}),e.jsxs("button",{onClick:()=>N("dark"),className:g("flex-1 flex items-center justify-center gap-1 px-2 py-0.5 rounded text-[10px] transition-all",C==="dark"?"bg-background shadow-sm":"text-muted-foreground"),children:[e.jsx(h.Moon,{className:"h-3 w-3"})," Dark"]})]})]}),e.jsx(yt,{className:"flex-1",children:y==="colors"?e.jsx("div",{className:"p-1",children:av.map((I,te)=>e.jsx(nv,{group:I,colors:Y,onChange:V,defaultOpen:te<3},I.id))}):e.jsxs("div",{className:"p-1.5 space-y-1.5",children:[e.jsx("p",{className:"text-[9px] font-semibold text-muted-foreground uppercase tracking-wider px-1",children:"Logos"}),e.jsx(cs,{label:"Logo Light",value:f.assets?.logoLight,onUpload:I=>X(I,"logoLight"),onRemove:()=>K("logoLight"),isUploading:D==="logoLight"}),e.jsx(cs,{label:"Logo Dark",value:f.assets?.logoDark,onUpload:I=>X(I,"logoDark"),onRemove:()=>K("logoDark"),isUploading:D==="logoDark"}),e.jsx("p",{className:"text-[9px] font-semibold text-muted-foreground uppercase tracking-wider px-1 pt-1",children:"Backgrounds"}),e.jsx(cs,{label:"Background Light",value:f.assets?.backgroundLight,onUpload:I=>X(I,"backgroundLight"),onRemove:()=>K("backgroundLight"),isUploading:D==="backgroundLight"}),e.jsx(cs,{label:"Background Dark",value:f.assets?.backgroundDark,onUpload:I=>X(I,"backgroundDark"),onRemove:()=>K("backgroundDark"),isUploading:D==="backgroundDark"}),e.jsx("p",{className:"text-[9px] font-semibold text-muted-foreground uppercase tracking-wider px-1 pt-1",children:"Other"}),e.jsx(cs,{label:"Favicon",value:f.assets?.favicon,onUpload:I=>X(I,"favicon"),onRemove:()=>K("favicon"),accept:"image/x-icon,image/png,image/svg+xml",isUploading:D==="favicon"}),e.jsx(cs,{label:"Sponsor Light",value:f.assets?.sponsorLight,onUpload:I=>X(I,"sponsorLight"),onRemove:()=>K("sponsorLight"),isUploading:D==="sponsorLight"}),e.jsx(cs,{label:"Sponsor Dark",value:f.assets?.sponsorDark,onUpload:I=>X(I,"sponsorDark"),onRemove:()=>K("sponsorDark"),isUploading:D==="sponsorDark"})]})}),e.jsxs("div",{className:"p-1.5 border-t space-y-1",children:[e.jsxs("div",{className:"flex gap-1",children:[e.jsx($,{variant:"outline",size:"sm",onClick:F,disabled:q===0,className:"flex-1 h-6 text-[10px]",children:e.jsx(h.Undo2,{className:"h-3 w-3"})}),e.jsx($,{variant:"outline",size:"sm",onClick:G,disabled:q===P.length-1,className:"flex-1 h-6 text-[10px]",children:e.jsx(h.Redo2,{className:"h-3 w-3"})}),e.jsx($,{variant:"outline",size:"sm",onClick:ee,className:"flex-1 h-6 text-[10px]",children:e.jsx(h.RotateCcw,{className:"h-3 w-3"})})]}),e.jsxs("div",{className:"flex gap-1",children:[e.jsxs($,{variant:"outline",size:"sm",onClick:le,className:"flex-1 h-6 text-[10px]",children:[R?e.jsx(h.Check,{className:"h-3 w-3 mr-1"}):e.jsx(h.Copy,{className:"h-3 w-3 mr-1"}),R?"Copied":"CSS"]}),r&&e.jsxs($,{size:"sm",onClick:se,disabled:S,className:"flex-1 h-6 text-[10px]",children:[S?e.jsx(h.Loader2,{className:"h-3 w-3 mr-1 animate-spin"}):e.jsx(h.Save,{className:"h-3 w-3 mr-1"}),"Save"]})]})]})]}),e.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[e.jsxs("div",{className:"h-9 border-b flex items-center justify-between px-2 shrink-0",children:[e.jsxs("div",{className:"flex gap-0.5 p-0.5 bg-muted rounded",children:[i.includes("login")&&e.jsx("button",{onClick:()=>j("login"),className:g("px-2 py-0.5 rounded text-[10px] transition-all",p==="login"?"bg-background shadow-sm":"text-muted-foreground"),children:"Login"}),i.includes("dashboard")&&e.jsx("button",{onClick:()=>j("dashboard"),className:g("px-2 py-0.5 rounded text-[10px] transition-all",p==="dashboard"?"bg-background shadow-sm":"text-muted-foreground"),children:"Dashboard"}),i.includes("chat")&&e.jsx("button",{onClick:()=>j("chat"),className:g("px-2 py-0.5 rounded text-[10px] transition-all",p==="chat"?"bg-background shadow-sm":"text-muted-foreground"),children:"Chat"})]}),e.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-muted-foreground",children:[e.jsxs("span",{children:["Mode: ",C==="light"?"Light":"Dark"]}),C==="light"?e.jsx(h.Sun,{className:"h-3 w-3"}):e.jsx(h.Moon,{className:"h-3 w-3"})]})]}),e.jsxs("div",{className:"flex-1 overflow-hidden",children:[p==="login"&&e.jsx(ov,{assets:f.assets,isDark:C==="dark"}),p==="dashboard"&&e.jsx(iv,{}),p==="chat"&&e.jsx(lv,{})]})]})]})}tc.displayName="WakaThemeCreatorBlock";function sc(t,a,s){const r=t.translations[s]?.value||"",n=t.translations[a]?.value;return!n||n.trim()===""?"missing":n===r?"identical":"valid"}function Qa(t,a,s){const r=a.filter(n=>n!==s).map(n=>sc(t,n,s));return r.includes("missing")?"missing":r.includes("identical")?"identical":"valid"}function cv(t,a){const s=new Map;for(const r of t){const n=r.key.split(a),o=n.length>1?n[0]:"__root__";s.has(o)||s.set(o,[]),s.get(o).push(r)}return s}function dv({status:t}){const a={valid:{label:"OK",variant:"default",icon:h.CheckCircle,className:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-300"},missing:{label:"Manquant",variant:"destructive",icon:h.XCircle,className:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-300"},identical:{label:"Identique",variant:"secondary",icon:h.AlertTriangle,className:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-300"},warning:{label:"Attention",variant:"secondary",icon:h.AlertTriangle,className:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-300"}},{label:s,icon:r,className:n}=a[t];return e.jsxs(De,{variant:"outline",className:g("gap-1 text-xs",n),children:[e.jsx(r,{className:"h-3 w-3"}),s]})}function No({value:t,onChange:a,onBlur:s,placeholder:r,status:n,disabled:o}){const[i,c]=l.useState(t);l.useEffect(()=>{c(t)},[t]);const m=d=>{c(d.target.value),a(d.target.value)};return e.jsx(wt,{value:i,onChange:m,onBlur:s,placeholder:r,disabled:o,className:g("min-h-[60px] resize-none text-sm",n==="missing"&&"border-red-300 dark:border-red-700",n==="identical"&&"border-yellow-300 dark:border-yellow-700")})}function uv({config:t,translations:a,onChange:s,onSave:r,onAddKey:n,onDeleteKey:o,onAddLanguage:i,onExport:c,onImport:m,isLoading:d=!1,isSaving:x=!1,className:u,title:f="Translation Editor",description:w="Gérez vos traductions i18n"}){const[k,b]=l.useState(a),[y,v]=l.useState(""),[p,j]=l.useState("all"),[C,N]=l.useState(new Set),[S,A]=l.useState(null),[R,E]=l.useState(!1),[D,M]=l.useState(!1),[P,T]=l.useState(!1),[q,H]=l.useState(!1),[Y,U]=l.useState(""),[z,V]=l.useState({code:"",label:"",flag:""}),[L,W]=l.useState(null),[F,G]=l.useState(""),[ee,se]=l.useState("merge"),[le,X]=l.useState(new Map),K=l.useRef(null),{languages:I,sourceLanguage:te,keyPathSeparator:Z=".",autoSave:J=!0,saveDebounceMs:ne=300,placeholderPatterns:me=["{{.*?}}","{.*?}","%s","%d"]}=t,ae=I.filter(B=>B.code!==te);l.useEffect(()=>{b(a)},[a]),l.useEffect(()=>(J&&le.size>0&&r&&(K.current&&clearTimeout(K.current),K.current=setTimeout(async()=>{await r(k),X(new Map)},ne)),()=>{K.current&&clearTimeout(K.current)}),[le,J,ne,r,k]);const de=l.useMemo(()=>{let B=k;if(y){const Q=y.toLowerCase();B=B.filter(re=>{if(re.key.toLowerCase().includes(Q))return!0;for(const we of Object.keys(re.translations))if(re.translations[we]?.value?.toLowerCase().includes(Q))return!0;return!1})}return p!=="all"&&(B=B.filter(Q=>{const re=Qa(Q,I.map(we=>we.code),te);switch(p){case"missing":return re==="missing";case"incomplete":return re==="missing"||re==="identical";case"identical":return re==="identical";default:return!0}})),B},[k,y,p,I,te]),Te=l.useMemo(()=>cv(de,Z),[de,Z]),Ce=(B,Q,re)=>{b(we=>we.map(je=>je.key===B?{...je,translations:{...je.translations,[Q]:{...je.translations[Q],value:re,updatedAt:new Date}}}:je)),X(we=>{const je=new Map(we);return je.has(B)||je.set(B,new Map),je.get(B).set(Q,re),je}),s?.(B,Q,re)},Je=async()=>{Y.trim()&&(await n?.(Y),U(""),M(!1))},xt=async B=>{await o?.(B),b(Q=>Q.filter(re=>re.key!==B))},Ke=async()=>{!z.code||!z.label||(await i?.(z),V({code:"",label:"",flag:""}),T(!1))},tt=async()=>{!L||!F||(await m?.(L,F,ee),W(null),G(""),H(!1))},gt=B=>{navigator.clipboard.writeText(B)},Mt=B=>{N(Q=>{const re=new Set(Q);return re.has(B)?re.delete(B):re.add(B),re})},Qe=l.useMemo(()=>{let B=k.length,Q=0,re=0,we=0;for(const je of k){const Pt=Qa(je,I.map(ys=>ys.code),te);Pt==="missing"?Q++:Pt==="identical"?re++:we++}return{total:B,missing:Q,identical:re,valid:we}},[k,I,te]);return d?e.jsx("div",{className:g("flex items-center justify-center py-12",u),children:e.jsx(h.Loader2,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):e.jsx(Xs,{children:e.jsxs("div",{className:g("flex flex-col h-full",u),children:[e.jsxs("div",{className:"flex flex-col gap-4 p-4 border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold flex items-center gap-2",children:[e.jsx(h.Languages,{className:"h-6 w-6"}),f]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:w})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs($,{variant:"outline",size:"sm",onClick:()=>M(!0),children:[e.jsx(h.Plus,{className:"h-4 w-4 mr-1"}),"Ajouter une clé"]}),e.jsxs($,{variant:"outline",size:"sm",onClick:()=>T(!0),children:[e.jsx(h.Flag,{className:"h-4 w-4 mr-1"}),"Ajouter une langue"]}),e.jsxs(Ge,{children:[e.jsx(Xe,{asChild:!0,children:e.jsx($,{variant:"outline",size:"sm",children:e.jsx(h.MoreHorizontal,{className:"h-4 w-4"})})}),e.jsxs(Ue,{align:"end",children:[e.jsxs(xe,{onClick:()=>c?.(),children:[e.jsx(h.Download,{className:"h-4 w-4 mr-2"}),"Exporter tout"]}),I.map(B=>e.jsxs(xe,{onClick:()=>c?.(B.code),children:[e.jsx(h.Download,{className:"h-4 w-4 mr-2"}),"Exporter ",B.label]},B.code)),e.jsx(Ze,{}),e.jsxs(xe,{onClick:()=>H(!0),children:[e.jsx(h.Upload,{className:"h-4 w-4 mr-2"}),"Importer"]})]})]}),x&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(h.Loader2,{className:"h-4 w-4 animate-spin"}),"Sauvegarde..."]})]})]}),e.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[e.jsxs("span",{className:"text-muted-foreground",children:[Qe.total," clés"]}),e.jsxs("span",{className:"flex items-center gap-1 text-green-600 dark:text-green-400",children:[e.jsx(h.CheckCircle,{className:"h-4 w-4"}),Qe.valid," traduites"]}),e.jsxs("span",{className:"flex items-center gap-1 text-red-600 dark:text-red-400",children:[e.jsx(h.XCircle,{className:"h-4 w-4"}),Qe.missing," manquantes"]}),e.jsxs("span",{className:"flex items-center gap-1 text-yellow-600 dark:text-yellow-400",children:[e.jsx(h.AlertTriangle,{className:"h-4 w-4"}),Qe.identical," identiques"]})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"relative flex-1 max-w-md",children:[e.jsx(h.Search,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(oe,{placeholder:"Rechercher une clé ou une traduction...",value:y,onChange:B=>v(B.target.value),className:"pl-10"}),y&&e.jsx("button",{onClick:()=>v(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:e.jsx(h.X,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(h.Filter,{className:"h-4 w-4 text-muted-foreground"}),e.jsxs(Oe,{value:p,onValueChange:B=>j(B),children:[e.jsx(Le,{className:"w-[180px]",children:e.jsx(ze,{})}),e.jsxs(Ie,{children:[e.jsxs(be,{value:"all",children:["Toutes (",Qe.total,")"]}),e.jsxs(be,{value:"missing",children:["Manquantes (",Qe.missing,")"]}),e.jsxs(be,{value:"incomplete",children:["Incomplètes (",Qe.missing+Qe.identical,")"]}),e.jsxs(be,{value:"identical",children:["Identiques (",Qe.identical,")"]})]})]})]})]})]}),e.jsx("div",{className:"flex-1 overflow-auto",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{className:"sticky top-0 bg-muted/50 backdrop-blur z-10",children:e.jsxs("tr",{children:[e.jsx("th",{className:"text-left p-3 font-medium text-sm border-b w-[280px]",children:"Clé"}),e.jsxs("th",{className:"text-left p-3 font-medium text-sm border-b",children:[I.find(B=>B.code===te)?.label||te," (source)"]}),ae.map(B=>e.jsx("th",{className:"text-left p-3 font-medium text-sm border-b",children:e.jsxs("span",{className:"flex items-center gap-2",children:[B.flag&&e.jsx("span",{children:B.flag}),B.label]})},B.code)),e.jsx("th",{className:"text-center p-3 font-medium text-sm border-b w-[100px]",children:"État"}),e.jsx("th",{className:"text-center p-3 font-medium text-sm border-b w-[60px]",children:"Actions"})]})}),e.jsxs("tbody",{children:[Array.from(Te.entries()).map(([B,Q])=>e.jsxs(l.Fragment,{children:[B!=="__root__"&&e.jsx("tr",{className:"bg-muted/30",children:e.jsx("td",{colSpan:ae.length+4,className:"p-2",children:e.jsxs("button",{onClick:()=>Mt(B),className:"flex items-center gap-2 text-sm font-medium hover:text-primary transition-colors",children:[C.has(B)?e.jsx(h.ChevronRight,{className:"h-4 w-4"}):e.jsx(h.ChevronDown,{className:"h-4 w-4"}),B,e.jsx(De,{variant:"secondary",className:"text-xs",children:Q.length})]})})}),!C.has(B)&&Q.map(re=>{const we=Qa(re,I.map(je=>je.code),te);return e.jsxs("tr",{className:"border-b hover:bg-muted/30 transition-colors",children:[e.jsx("td",{className:"p-3 font-mono text-sm",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate max-w-[200px]",title:re.key,children:re.key}),e.jsxs(Ys,{children:[e.jsx(Js,{asChild:!0,children:e.jsx("button",{onClick:()=>gt(re.key),className:"text-muted-foreground hover:text-foreground",children:e.jsx(h.Copy,{className:"h-3 w-3"})})}),e.jsx(Ss,{children:"Copier la clé"})]})]})}),e.jsx("td",{className:"p-2",children:e.jsx(No,{value:re.translations[te]?.value||"",onChange:je=>Ce(re.key,te,je),placeholder:"Texte source...",status:re.translations[te]?.value?"valid":"missing"})}),ae.map(je=>{const Pt=sc(re,je.code,te);return e.jsx("td",{className:"p-2",children:e.jsx(No,{value:re.translations[je.code]?.value||"",onChange:ys=>Ce(re.key,je.code,ys),placeholder:`Traduction ${je.label}...`,status:Pt})},je.code)}),e.jsx("td",{className:"p-3 text-center",children:e.jsx(dv,{status:we})}),e.jsx("td",{className:"p-3 text-center",children:e.jsxs(Ge,{children:[e.jsx(Xe,{asChild:!0,children:e.jsx($,{variant:"ghost",size:"sm",children:e.jsx(h.MoreHorizontal,{className:"h-4 w-4"})})}),e.jsxs(Ue,{align:"end",children:[e.jsxs(xe,{onClick:()=>{A(re),E(!0)},children:[e.jsx(h.Edit3,{className:"h-4 w-4 mr-2"}),"Éditer"]}),e.jsxs(xe,{onClick:()=>gt(re.key),children:[e.jsx(h.Copy,{className:"h-4 w-4 mr-2"}),"Copier la clé"]}),e.jsx(Ze,{}),e.jsxs(xe,{className:"text-destructive",onClick:()=>xt(re.key),children:[e.jsx(h.Trash2,{className:"h-4 w-4 mr-2"}),"Supprimer"]})]})]})})]},re.key)})]},B)),de.length===0&&e.jsx("tr",{children:e.jsxs("td",{colSpan:ae.length+4,className:"p-12 text-center",children:[e.jsx(h.Languages,{className:"h-12 w-12 mx-auto text-muted-foreground/50 mb-4"}),e.jsx("p",{className:"text-muted-foreground",children:y||p!=="all"?"Aucune traduction ne correspond à vos critères":"Aucune traduction disponible"})]})})]})]})}),e.jsx(ta,{open:R,onOpenChange:E,children:e.jsxs(Ts,{className:"w-[500px] sm:max-w-[500px]",children:[e.jsxs(Sa,{children:[e.jsx(Da,{children:"Éditer la traduction"}),e.jsx(Ta,{children:S?.key})]}),S&&e.jsxs("div",{className:"py-6 space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("label",{className:"text-sm font-medium",children:[I.find(B=>B.code===te)?.label," (source)"]}),e.jsx(wt,{value:S.translations[te]?.value||"",onChange:B=>{Ce(S.key,te,B.target.value),A({...S,translations:{...S.translations,[te]:{...S.translations[te],value:B.target.value}}})},placeholder:"Texte source...",className:"min-h-[100px]"})]}),I.filter(B=>B.code!==te).map(B=>e.jsxs("div",{className:"space-y-2",children:[e.jsxs("label",{className:"text-sm font-medium flex items-center gap-2",children:[B.flag&&e.jsx("span",{children:B.flag}),B.label]}),e.jsx(wt,{value:S.translations[B.code]?.value||"",onChange:Q=>{Ce(S.key,B.code,Q.target.value),A({...S,translations:{...S.translations,[B.code]:{...S.translations[B.code],value:Q.target.value}}})},placeholder:`Traduction ${B.label}...`,className:"min-h-[100px]"})]},B.code)),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Commentaire (optionnel)"}),e.jsx(wt,{placeholder:"Contexte ou indication pour la traduction...",className:"min-h-[80px]"})]})]}),e.jsx($r,{children:e.jsx($,{variant:"outline",onClick:()=>E(!1),children:"Fermer"})})]})}),e.jsx(It,{open:D,onOpenChange:M,children:e.jsxs(Tt,{children:[e.jsxs(qt,{children:[e.jsx(Gt,{children:"Ajouter une clé de traduction"}),e.jsx(Cs,{children:"Entrez la clé de traduction (ex: common.buttons.submit)"})]}),e.jsx("div",{className:"py-4",children:e.jsx(oe,{value:Y,onChange:B=>U(B.target.value),placeholder:"namespace.key.name"})}),e.jsxs(Ht,{children:[e.jsx($,{variant:"outline",onClick:()=>M(!1),children:"Annuler"}),e.jsx($,{onClick:Je,children:"Ajouter"})]})]})}),e.jsx(It,{open:P,onOpenChange:T,children:e.jsxs(Tt,{children:[e.jsxs(qt,{children:[e.jsx(Gt,{children:"Ajouter une langue"}),e.jsx(Cs,{children:"Configurez la nouvelle langue à ajouter"})]}),e.jsxs("div",{className:"py-4 space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Code (ex: de, it, pt)"}),e.jsx(oe,{value:z.code,onChange:B=>V({...z,code:B.target.value}),placeholder:"de"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Label"}),e.jsx(oe,{value:z.label,onChange:B=>V({...z,label:B.target.value}),placeholder:"Allemand"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Emoji drapeau (optionnel)"}),e.jsx(oe,{value:z.flag,onChange:B=>V({...z,flag:B.target.value}),placeholder:"🇩🇪"})]})]}),e.jsxs(Ht,{children:[e.jsx($,{variant:"outline",onClick:()=>T(!1),children:"Annuler"}),e.jsx($,{onClick:Ke,children:"Ajouter"})]})]})}),e.jsx(It,{open:q,onOpenChange:H,children:e.jsxs(Tt,{children:[e.jsxs(qt,{children:[e.jsx(Gt,{children:"Importer des traductions"}),e.jsx(Cs,{children:"Sélectionnez un fichier JSON à importer"})]}),e.jsxs("div",{className:"py-4 space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Fichier JSON"}),e.jsx(oe,{type:"file",accept:".json",onChange:B=>W(B.target.files?.[0]||null)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Langue cible"}),e.jsxs(Oe,{value:F,onValueChange:G,children:[e.jsx(Le,{children:e.jsx(ze,{placeholder:"Sélectionner une langue"})}),e.jsx(Ie,{children:I.map(B=>e.jsxs(be,{value:B.code,children:[B.flag&&e.jsx("span",{className:"mr-2",children:B.flag}),B.label]},B.code))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium",children:"Stratégie"}),e.jsxs(Oe,{value:ee,onValueChange:B=>se(B),children:[e.jsx(Le,{children:e.jsx(ze,{})}),e.jsxs(Ie,{children:[e.jsx(be,{value:"merge",children:"Fusionner (conserver les existantes)"}),e.jsx(be,{value:"overwrite",children:"Écraser tout"})]})]})]})]}),e.jsxs(Ht,{children:[e.jsx($,{variant:"outline",onClick:()=>H(!1),children:"Annuler"}),e.jsx($,{onClick:tt,disabled:!L||!F,children:"Importer"})]})]})})]})})}exports.Accordion=ar;exports.AccordionContent=fr;exports.AccordionItem=mr;exports.AccordionTrigger=hr;exports.AdmincrumbProvider=rb;exports.Alert=Mo;exports.AlertDescription=Ao;exports.AlertDialog=fs;exports.AlertDialogAction=Zt;exports.AlertDialogCancel=es;exports.AlertDialogContent=Xt;exports.AlertDialogDescription=Qt;exports.AlertDialogFooter=Jt;exports.AlertDialogHeader=Yt;exports.AlertDialogOverlay=pr;exports.AlertDialogPortal=Eo;exports.AlertDialogTitle=Kt;exports.AlertDialogTrigger=To;exports.AlertTitle=Po;exports.AspectRatio=rd;exports.Avatar=Ct;exports.AvatarFallback=St;exports.AvatarImage=kt;exports.Badge=De;exports.BlockLanguageSelector=ub;exports.Blockquote=ol;exports.Button=$;exports.Calendar=Ca;exports.Card=Se;exports.CardContent=Ee;exports.CardDescription=nt;exports.CardFooter=xr;exports.CardHeader=He;exports.CardTitle=Ve;exports.Checkbox=et;exports.Code=qo;exports.Collapsible=yr;exports.CollapsibleContent=Cr;exports.CollapsibleTrigger=Nr;exports.Command=ts;exports.CommandDialog=vp;exports.CommandEmpty=gs;exports.CommandGroup=Ot;exports.CommandInput=xs;exports.CommandItem=zt;exports.CommandList=Zs;exports.CommandSeparator=ba;exports.CommandShortcut=Xo;exports.ContextMenu=Yo;exports.ContextMenuCheckboxItem=Zo;exports.ContextMenuContent=Sr;exports.ContextMenuGroup=wp;exports.ContextMenuItem=Ft;exports.ContextMenuLabel=ti;exports.ContextMenuPortal=yp;exports.ContextMenuRadioGroup=Cp;exports.ContextMenuRadioItem=ei;exports.ContextMenuSeparator=Vs;exports.ContextMenuShortcut=si;exports.ContextMenuSub=Np;exports.ContextMenuSubContent=Qo;exports.ContextMenuSubTrigger=Ko;exports.ContextMenuTrigger=Jo;exports.DataTable=fx;exports.DataTableAdvanced=bx;exports.DataTableColumnResizer=jx;exports.DataTableContextMenu=Nx;exports.DataTableEditCell=va;exports.DataTableFilters=Br;exports.DataTableGroupTotals=wx;exports.DataTableGrouping=vx;exports.DataTableGroupingControls=yx;exports.DataTablePagination=Ur;exports.DataTableSelection=Cx;exports.DataTableToolbar=Ks;exports.Dialog=It;exports.DialogClose=Go;exports.DialogContent=Tt;exports.DialogDescription=Cs;exports.DialogFooter=Ht;exports.DialogHeader=qt;exports.DialogOverlay=kr;exports.DialogPortal=Ho;exports.DialogTitle=Gt;exports.DialogTrigger=jp;exports.DrawerBody=Yr;exports.DrawerClose=eg;exports.DrawerDescription=Qr;exports.DrawerFooter=Jr;exports.DrawerHeader=Xr;exports.DrawerTitle=Kr;exports.DrawerTrigger=Zx;exports.DropdownMenu=Ge;exports.DropdownMenuCheckboxItem=ds;exports.DropdownMenuContent=Ue;exports.DropdownMenuGroup=kp;exports.DropdownMenuItem=xe;exports.DropdownMenuLabel=ms;exports.DropdownMenuPortal=Sp;exports.DropdownMenuRadioGroup=Tp;exports.DropdownMenuRadioItem=ni;exports.DropdownMenuSeparator=Ze;exports.DropdownMenuShortcut=oi;exports.DropdownMenuSub=Dp;exports.DropdownMenuSubContent=ri;exports.DropdownMenuSubTrigger=ai;exports.DropdownMenuTrigger=Xe;exports.EmptyCartState=oj;exports.Error403Page=uj;exports.Error404Page=cj;exports.Error500Page=dj;exports.ErrorState=lj;exports.Footer=lb;exports.Form=Up;exports.FormControl=gi;exports.FormDescription=bi;exports.FormField=Bp;exports.FormItem=pi;exports.FormLabel=xi;exports.FormMessage=ji;exports.Heading=rl;exports.Headtab=cb;exports.HeadtabBreadcrumb=db;exports.HoverCard=qp;exports.HoverCardContent=vi;exports.HoverCardTrigger=Hp;exports.Input=oe;exports.InputOTP=wi;exports.Kbd=ll;exports.Label=he;exports.LanguageProvider=_l;exports.LanguageSelector=Xp;exports.Layout=mb;exports.LegacyThemeProvider=Yg;exports.Login=Wl;exports.MaintenancePage=mj;exports.Menubar=Ci;exports.MenubarCheckboxItem=Mi;exports.MenubarContent=Ti;exports.MenubarGroup=Jp;exports.MenubarItem=Ei;exports.MenubarLabel=Ai;exports.MenubarMenu=Yp;exports.MenubarPortal=Kp;exports.MenubarRadioGroup=Zp;exports.MenubarRadioItem=Pi;exports.MenubarSeparator=Ri;exports.MenubarShortcut=Fi;exports.MenubarSub=Qp;exports.MenubarSubContent=Di;exports.MenubarSubTrigger=Si;exports.MenubarTrigger=ki;exports.ModalBody=rn;exports.ModalContent=en;exports.ModalDescription=an;exports.ModalFooter=nn;exports.ModalHeader=tn;exports.ModalOverlay=Zr;exports.ModalTitle=sn;exports.NavigationMenu=$i;exports.NavigationMenuContent=zi;exports.NavigationMenuIndicator=_i;exports.NavigationMenuItem=ex;exports.NavigationMenuLink=tx;exports.NavigationMenuList=Li;exports.NavigationMenuTrigger=Oi;exports.NavigationMenuViewport=Pr;exports.NoDataState=sj;exports.NoFilesState=nj;exports.NoMessagesState=rj;exports.NoNotificationsState=ij;exports.NoResultsState=aj;exports.OfflinePage=hj;exports.Popover=ct;exports.PopoverContent=rt;exports.PopoverTrigger=dt;exports.Progress=Gs;exports.RadioGroup=Vi;exports.RadioGroupItem=Wi;exports.ScrollArea=yt;exports.ScrollBar=Ar;exports.Select=Oe;exports.SelectContent=Ie;exports.SelectGroup=Gp;exports.SelectItem=be;exports.SelectLabel=yi;exports.SelectScrollDownButton=Mr;exports.SelectScrollUpButton=Er;exports.SelectSeparator=Ni;exports.SelectTrigger=Le;exports.SelectValue=ze;exports.Separator=Et;exports.Sheet=ta;exports.SheetClose=sx;exports.SheetContent=Ts;exports.SheetDescription=Ta;exports.SheetFooter=$r;exports.SheetHeader=Sa;exports.SheetOverlay=Fr;exports.SheetPortal=Ui;exports.SheetTitle=Da;exports.SheetTrigger=Rr;exports.SidebarLayout=gb;exports.Skeleton=rx;exports.Slider=ja;exports.StepperNavigation=Ag;exports.Switch=sa;exports.Table=Ea;exports.TableBody=Pa;exports.TableCaption=qi;exports.TableCell=st;exports.TableFooter=Bi;exports.TableHead=lt;exports.TableHeader=Ma;exports.TableRow=Bt;exports.Tabs=aa;exports.TabsContent=vs;exports.TabsList=Es;exports.TabsTrigger=js;exports.Text=sl;exports.Textarea=wt;exports.ThemeLoader=vr;exports.ThemeProvider=Gi;exports.ThemeSelector=Xi;exports.Toast=Ir;exports.ToastAction=Ji;exports.ToastClose=Or;exports.ToastDescription=_r;exports.ToastProvider=Yi;exports.ToastTitle=zr;exports.ToastViewport=Lr;exports.Toaster=dx;exports.Toggle=el;exports.Tooltip=Ys;exports.TooltipContent=Ss;exports.TooltipProvider=Xs;exports.TooltipTrigger=Js;exports.WakaActivityTimeline=_b;exports.WakaAdmincrumb=vl;exports.WakaAutocomplete=qr;exports.WakaAutocompleteForm=wl;exports.WakaBarcode=Fx;exports.WakaBreadcrumb=Lx;exports.WakaCalendarView=Jb;exports.WakaCarousel=Ox;exports.WakaChat=Jl;exports.WakaColorPicker=Hr;exports.WakaColorPickerForm=Nl;exports.WakaCombobox=Wx;exports.WakaDashboard=Hl;exports.WakaDateRangePicker=Bx;exports.WakaDateTimePicker=Gr;exports.WakaDateTimePickerForm=Hx;exports.WakaDrawer=Kx;exports.WakaEmptyState=as;exports.WakaErrorPage=Ps;exports.WakaFAQ=gj;exports.WakaFileManager=yj;exports.WakaFileUpload=Sl;exports.WakaHeader=bb;exports.WakaI18nEditor=uv;exports.WakaImage=Dl;exports.WakaImageGallery=sg;exports.WakaKanban=og;exports.WakaKanbanBoard=Dj;exports.WakaLanding=$j;exports.WakaModal=ug;exports.WakaModalTrigger=mg;exports.WakaNotifications=Tl;exports.WakaNumberInput=xg;exports.WakaPagination=jg;exports.WakaPricing=qj;exports.WakaProfile=Mb;exports.WakaProvider=tb;exports.WakaQRCode=yg;exports.WakaSegmentedControl=Cg;exports.WakaSettings=Sb;exports.WakaSidebar=ql;exports.WakaSpinner=El;exports.WakaStat=Ml;exports.WakaStatGroup=Pl;exports.WakaStepper=Pg;exports.WakaThemeCreator=Al;exports.WakaThemeCreatorBlock=tc;exports.WakaThemeManager=Fl;exports.WakaTimePicker=Ig;exports.WakaTimeline=zg;exports.WakaTree=Wg;exports.WakaUserManagement=Lb;exports.WakaVideo=Bg;exports.WakaVirtualList=Gg;exports.WakaWizard=Kj;exports.addChildNode=un;exports.applyTheme=op;exports.badgeVariants=Ro;exports.blockquoteVariants=nl;exports.calculateDuration=_f;exports.cn=g;exports.compareRanges=tp;exports.createBookingDateValidator=Hf;exports.createCardExpiryValidator=qf;exports.createCommonPresets=Pf;exports.createCustomPreset=Ff;exports.createLastDaysPresets=Af;exports.createMaxAgeValidator=Of;exports.createMaxRangeDaysValidator=Gf;exports.createMinAgeValidator=If;exports.createMonthlyPresets=Kf;exports.createNextDaysPresets=Rf;exports.createQuarterPresets=Jf;exports.dateToTimestamp=Qf;exports.defaultActivities=Wb;exports.defaultActivityFilters=Vb;exports.defaultCalendarEvents=Kb;exports.defaultChatConversations=cr;exports.defaultChatMessages=Kl;exports.defaultChatUser=ks;exports.defaultDashboardStats=Gl;exports.defaultFAQCategories=bj;exports.defaultFAQItems=jj;exports.defaultFileManagerBreadcrumbs=Cj;exports.defaultFiles=Nj;exports.defaultKanbanColumns=Tj;exports.defaultKanbanLabels=Ej;exports.defaultLandingCTA=_j;exports.defaultLandingFeatures=Ij;exports.defaultLandingHero=zj;exports.defaultLandingNavItems=Lj;exports.defaultLandingTestimonials=Oj;exports.defaultPermissions=Ob;exports.defaultPresets=Cl;exports.defaultPricingFAQ=Gj;exports.defaultPricingPlans=Hj;exports.defaultProfileData=Pb;exports.defaultSettingsTabs=Db;exports.defaultThemes=dr;exports.defaultUsers=Ib;exports.defaultWizardSteps=Qj;exports.exportToCSV=cl;exports.exportToJSON=dl;exports.findNodeById=cn;exports.formatDateRange=Vf;exports.getDatesInMonth=jr;exports.getFrenchHolidays=Wf;exports.getThemeLoader=wr;exports.getWeekdaysInMonth=Bf;exports.getWeekendsInMonth=Uf;exports.getWorkingDays=Yf;exports.headingVariants=al;exports.initThemeLoader=rp;exports.isDateInRange=Lt;exports.isFutureDate=$f;exports.isHoliday=Bo;exports.isNotExpired=zf;exports.isPastDate=Wo;exports.isSameDay=Xf;exports.isToday=Lf;exports.isWeekday=br;exports.isWeekend=Uo;exports.kbdVariants=il;exports.loadTableState=ml;exports.loadTheme=np;exports.mergeRanges=sp;exports.moveNode=Ug;exports.navigationMenuTriggerStyle=Ii;exports.normalizeDate=ep;exports.parseCSV=ux;exports.rangesOverlap=ap;exports.reducer=Ki;exports.removeNode=dn;exports.saveTableState=ul;exports.textVariants=tl;exports.themeManagerVariants=Rl;exports.timestampToDate=Zf;exports.toast=Qi;exports.toggleVariants=Zi;exports.tweak=ga;exports.updateNode=Ol;exports.useAdmincrumb=Mx;exports.useAdmincrumbContext=nb;exports.useAdmincrumbContextOptional=ob;exports.useBreadcrumbFromPath=Ix;exports.useCombobox=Ux;exports.useDataTable=hl;exports.useDataTableAdvanced=fl;exports.useDataTableEdit=Wr;exports.useDataTableExport=xl;exports.useDataTableImport=gl;exports.useDataTableSelection=kx;exports.useDataTableTheme=bl;exports.useDataTableVirtualization=pl;exports.useDateForm=Gx;exports.useDateRangePicker=qx;exports.useDrawer=Qx;exports.useFormField=ea;exports.useKanban=ig;exports.useLanguage=mn;exports.useLegacyTheme=eb;exports.useModal=hg;exports.useNotifications=pg;exports.useNumberInput=gg;exports.usePagination=vg;exports.useQRCode=Ng;exports.useSegmentedControl=kg;exports.useSidebar=xb;exports.useStat=Eg;exports.useStepperContext=ln;exports.useTableLayout=Vr;exports.useTheme=Ms;exports.useThemeLoader=ip;exports.useTimePicker=Og;exports.useToast=Aa;exports.useTranslation=kl;exports.useVideo=qg;exports.useVirtualList=Xg;exports.useWaka=ab;exports.useWizard=Xj;
|