1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[636],{982:(e,t,r)=>{"use strict";r.d(t,{dc:()=>i,_Z:()=>o,VG:()=>s});var n=r(64642);let a=[],i=!1,o="skip";function s(e,t,r,s){let l;"function"==typeof t&&"function"!=typeof r?(s=r,r=t):l=t;let u=(0,n.C)(l),c=s?-1:1;(function e(n,l,d){let h=n&&"object"==typeof n?n:{};if("string"==typeof h.type){let e="string"==typeof h.tagName?h.tagName:"string"==typeof h.name?h.name:void 0;Object.defineProperty(f,"name",{value:"node ("+n.type+(e?"<"+e+">":"")+")"})}return f;function f(){var h;let f,p,m,g=a;if((!t||u(n,l,d[d.length-1]||void 0))&&(g=Array.isArray(h=r(n,d))?h:"number"==typeof h?[!0,h]:null==h?a:[h])[0]===i)return g;if("children"in n&&n.children&&n.children&&g[0]!==o)for(p=(s?n.children.length:-1)+c,m=d.concat(n);p>-1&&p<n.children.length;){if((f=e(n.children[p],p,m)())[0]===i)return f;p="number"==typeof f[1]?f[1]:p+c}return g}})(e,void 0,[])()}},986:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(14232);let a=n.forwardRef(function(e,t){let{title:r,titleId:a,...i}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":a},i),r?n.createElement("title",{id:a},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"}))})},1859:e=>{e.exports={"banner-manager":"BannerManager_banner-manager__tmdPa",banner:"BannerManager_banner__hdCXf",container:"BannerManager_container__FFmB6",countdown:"BannerManager_countdown__YFws1",timeBlock:"BannerManager_timeBlock__Qu2ZH",timeLabel:"BannerManager_timeLabel__2d2Qo",content:"BannerManager_content__dRjpN",closeButton:"BannerManager_closeButton__H30I1",bannerLink:"BannerManager_bannerLink__rC_XZ"}},3610:(e,t,r)=>{"use strict";function n(){}function a(){}r.d(t,{HB:()=>a,ok:()=>n})},4817:(e,t,r)=>{"use strict";let n;r.r(t),r.d(t,{default:()=>eX});var a=r(37876);r(99551),r(38378),r(38665);var i=r(18847),o=r.n(i),s=r(77328),l=r.n(s),u=r(89099),c=r.n(u);r(29454);var d=r(72389),h=r(14232),f=r(14e3),p=r(65364);function m(){return"undefined"!=typeof window}function g(){return"production"}function y(){return"development"===((m()?window.vam:g())||"production")}function v(e){return RegExp(`/${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?=[/?#]|$)`)}function w(e){return(0,h.useEffect)(()=>{var t;e.beforeSend&&(null==(t=window.va)||t.call(window,"beforeSend",e.beforeSend))},[e.beforeSend]),(0,h.useEffect)(()=>{!function(e={debug:!0}){var t;if(!m())return;!function(e="auto"){if("auto"===e){window.vam=g();return}window.vam=e}(e.mode),window.va||(window.va=function(...e){(window.vaq=window.vaq||[]).push(e)}),e.beforeSend&&(null==(t=window.va)||t.call(window,"beforeSend",e.beforeSend));let r=e.scriptSrc?e.scriptSrc:y()?"https://va.vercel-scripts.com/v1/script.debug.js":e.basePath?`${e.basePath}/insights/script.js`:"/_vercel/insights/script.js";if(document.head.querySelector(`script[src*="${r}"]`))return;let n=document.createElement("script");n.src=r,n.defer=!0,n.dataset.sdkn="@vercel/analytics"+(e.framework?`/${e.framework}`:""),n.dataset.sdkv="1.6.1",e.disableAutoTrack&&(n.dataset.disableAutoTrack="1"),e.endpoint?n.dataset.endpoint=e.endpoint:e.basePath&&(n.dataset.endpoint=`${e.basePath}/insights`),e.dsn&&(n.dataset.dsn=e.dsn),n.onerror=()=>{let e=y()?"Please check if any ad blockers are enabled and try again.":"Be sure to enable Web Analytics for your project and deploy again. See https://vercel.com/docs/analytics/quickstart for more information.";console.log(`[Vercel Web Analytics] Failed to load script from ${r}. ${e}`)},y()&&!1===e.debug&&(n.dataset.debug="false"),document.head.appendChild(n)}({framework:e.framework||"react",basePath:e.basePath??function(){if(void 0!==p&&void 0!==p.env)return p.env.REACT_APP_VERCEL_OBSERVABILITY_BASEPATH}(),...void 0!==e.route&&{disableAutoTrack:!0},...e})},[]),(0,h.useEffect)(()=>{e.route&&e.path&&function({route:e,path:t}){var r;null==(r=window.va)||r.call(window,"pageview",{route:e,path:t})}({route:e.route,path:e.path})},[e.route,e.path]),null}function b(e){let{route:t,path:r}=(()=>{let e=(0,f.useParams)(),t=(0,f.useSearchParams)(),r=(0,f.usePathname)();return e?{route:function(e,t){if(!e||!t)return e;let r=e;try{let e=Object.entries(t);for(let[t,n]of e)if(!Array.isArray(n)){let e=v(n);e.test(r)&&(r=r.replace(e,`/[${t}]`))}for(let[t,n]of e)if(Array.isArray(n)){let e=v(n.join("/"));e.test(r)&&(r=r.replace(e,`/[...${t}]`))}return r}catch(t){return e}}(r,Object.keys(e).length?e:Object.fromEntries(t.entries())),path:r}:{route:null,path:r}})();return h.createElement(w,{path:r,route:t,...e,basePath:function(){if(void 0!==p&&void 0!==p.env)return p.env.
1NEXT_PUBLIC_VERCEL_OBSERVABILITY_BASEPATH}(),framework:"next"})}function x(e){return h.createElement(h.Suspense,{fallback:null},h.createElement(b,{...e}))}var E=r(67768),S=r(37149),k=r(58444),P=r(60388),C=r(90089),I=class extends C.Q{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,r){let n=t.queryKey,a=t.queryHash??(0,S.F$)(n,t),i=this.get(a);return i||(i=new k.X({client:e,queryKey:n,queryHash:a,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(n)}),this.add(i)),i}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){P.jG.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,S.MK)(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>(0,S.MK)(e,t)):t}notify(e){P.jG.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){P.jG.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){P.jG.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},T=r(21407),A=class extends C.Q{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#r=new Map,this.#n=0}#t;#r;#n;build(e,t,r){let n=new T.s({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){this.#t.add(e);let t=_(e);if("string"==typeof t){let r=this.#r.get(t);r?r.push(e):this.#r.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){let t=_(e);if("string"==typeof t){let r=this.#r.get(t);if(r)if(r.length>1){let t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&this.#r.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=_(e);if("string"!=typeof t)return!0;{let r=this.#r.get(t),n=r?.find(e=>"pending"===e.state.status);return!n||n===e}}runNext(e){let t=_(e);if("string"!=typeof t)return Promise.resolve();{let r=this.#r.get(t)?.find(t=>
1t!==e&&t.state.isPaused);return r?.continue()??Promise.resolve()}}clear(){P.jG.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#r.clear()})}getAll(){return Array.from(this.#t)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,S.nJ)(t,e))}findAll(e={}){return this.getAll().filter(t=>(0,S.nJ)(e,t))}notify(e){P.jG.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return P.jG.batch(()=>Promise.all(e.map(e=>e.continue().catch(S.lQ))))}};function _(e){return e.options.scope?.id}var O=r(98275),q=r(18070);function R(e){return{onFetch:(t,r)=>{let n=t.options,a=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},l=0,u=async()=>{let r=!1,u=(0,S.ZM)(t.options,t.fetchOptions),c=async(e,n,a)=>{if(r)return Promise.reject();if(null==n&&e.pages.length)return Promise.resolve(e);let i=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:n,direction:a?"backward":"forward",meta:t.options.meta};return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(t.signal.aborted?r=!0:t.signal.addEventListener("abort",()=>{r=!0}),t.signal)}),e})(),o=await u(i),{maxPages:s}=t.options,l=a?S.ZZ:S.y9;return{pages:l(e.pages,o,s),pageParams:l(e.pageParams,n,s)}};if(a&&i.length){let e="backward"===a,t={pages:i,pageParams:o},r=(e?function(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}:D)(n,t);s=await c(t,r,e)}else{let t=e??i.length;do{let e=0===l?o[0]??n.initialPageParam:D(n,s);if(l>0&&null==e)break;s=await c(s,e),l++}while(l<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=u}}}function D(e,{pages:t,pageParams:r}){let n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}var N=class{#a;#i;#o;#s;#l;#u;#c;#d;constructor(e={}){this.#a=e.queryCache||new I,this.#i=e.mutationCache||new A,this.#o=e.defaultOptions||{},this.#s=new Map,this.#l=new Map,this.#u=0}mount(){this.#u++,1===this.#u&&(this.#c=O.m.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#a.onFocus())}),this.#d=q.t.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#a.onOnline())}))}unmount(){this.#u--,0===this.#u&&(this.#c?.(),this.#c=void 0,this.#d?.(),this.#d=void 0)}isFetching(e){return this.#a.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#i.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#a.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),r=this.#a.build(this,t),n=r.state.data;return void 0===n?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime((0,S.d2)(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return this.#a.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,r){let n=this.defaultQueryOptions({queryKey:e}),a=this.#a.get(n.queryHash),i=a?.state.data,o=(0,S.Zw)(t,i);if(void 0!==o)return this.#a.build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return P.jG.batch(()=>this.#a.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#a.get(t.queryHash)?.state}removeQueries(e){let t=this.#a;P.jG.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let r=this.#a;return P.jG.batch(()=>(r.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){let r={revert:!0,...t};return Promise.all(P.jG.batch(()=>this.#a.findAll(e).map(e=>e.cancel(r)))).then(S.lQ).catch(S.lQ)}invalidateQueries(e,t={}){return P.jG.batch(()=>(this.#a.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,t={}){let r={...t,cancelRefetch:t.cancelRefetch??!0};return Promise.all(P.jG.batch(()=>this.#a.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,r);return r.throwOnError||(t=t.catch(S.lQ)),"paused"===e.state.fetchStatus?Promise.resolve():t}
1))).then(S.lQ)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let r=this.#a.build(this,t);return r.isStaleByTime((0,S.d2)(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(S.lQ).catch(S.lQ)}fetchInfiniteQuery(e){return e.behavior=R(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(S.lQ).catch(S.lQ)}ensureInfiniteQueryData(e){return e.behavior=R(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return q.t.isOnline()?this.#i.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#a}getMutationCache(){return this.#i}getDefaultOptions(){return this.#o}setDefaultOptions(e){this.#o=e}setQueryDefaults(e,t){this.#s.set((0,S.EN)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#s.values()],r={};return t.forEach(t=>{(0,S.Cp)(e,t.queryKey)&&Object.assign(r,t.defaultOptions)}),r}setMutationDefaults(e,t){this.#l.set((0,S.EN)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#l.values()],r={};return t.forEach(t=>{(0,S.Cp)(e,t.mutationKey)&&Object.assign(r,t.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#o.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,S.F$)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===S.hT&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#o.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#a.clear(),this.#i.clear()}},j=r(78676),L=r(36779),M=r(39853);let B=(0,h.createContext)(),U=e=>{let{children:t}=e,r=(0,h.useRef)([]),n=(0,h.useCallback)((e,t)=>{let n=Date.now()+Math.random();return r.current.push({key:e,callback:t,id:n}),n},[]),i=(0,h.useCallback)(e=>{r.current=r.current.filter(t=>(null==t?void 0:t.id)!==e)},[]),o=(0,h.useCallback)(e=>{["input","textarea","select"].includes(e.target.tagName.toLowerCase())||r.current.forEach(t=>{t.key===e.key&&t.callback(e)})},[]);return(0,h.useEffect)(()=>(document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)),[o]),(0,a.jsx)(B.Provider,{value:{registerKeyHandler:n,unregisterKeyHandler:i,handleKeyDown:o},children:t})};var F=r(5374),z=r(92070),V=r(56726),W=r(40678),H=r(52239),G=r(8156),Q=r(89936),K=r(91023),$=r(48230),Y=r.n($),J=r(92035),X=r(986),Z=r(29349),ee=r(74550),et=r(11629),er=r(70531),en=r(21997);function ea(){var e;let{isActive:t,target:r,learnVideo:n,adding:i,addLearnVideo:o,stop:s}=(0,G.mc)(),[l,c]=h.useState(!1),[d,f]=h.useState(!1),{user:p}=(0,M.ur)(),m=(0,u.useRouter)();if(!t||!r)return null;let g=null==p||null==(e=p.roles)?void 0:e.includes("admin"),y=!!n,v=r.videoCount||0;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"fixed inset-x-0 bottom-0 z-[9990] px-3 pb-3 pointer-events-none",children:(0,a.jsxs)("div",{className:"pointer-events-auto mx-auto flex max-w-5xl flex-col gap-3 rounded-xl border border-white/10 bg-[#181818]/95 p-3 text-white shadow-2xl backdrop-blur",children:[(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-start justify-between gap-4 rounded-lg bg-white/5 border border-white/10 p-4 text-sm text-zinc-200",children:[(0,a.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,a.jsx)(X.A,{className:"h-5 w-5 shrink-0 text-[#d98a8e] mt-0.5"}),(0,a.jsx)("div",{children:(0,a.jsx)("p",{className:"text-zinc-300 leading-relaxed",children:y?"Clique sur le bouton \xab Ajouter la vid\xe9o \xbb ci-dessous pour l'ajouter directement dans la playlist.":"Parcours le catalogue, lance une vid\xe9o de cours et clique sur le bouton \xab Ajouter la vid\xe9o \xbb"})})]}),(0,a.jsx)("button",{type:"button",onClick:()=>c(!0),className:"shrink-0 text-sm font-semibold text-[#d98a8e] hover:text-[#e0a3a6] hover:underline text-left sm:text-right cursor-pointer",children:"Explications compl\xe8tes"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-2.5",children:[(0,a.jsx)("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-[#aa484d]/20 text-[#d98a8e]",children:(0,a.jsx)(Z.A,{className:"h-5 w-5"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"text-xs leading-tight text-zinc-400",children:"Ajout rapide \xe0"}),(0,a.jsx)("p",{className:"truncate text-base font-bold leading-tight mt-0.5",children:(0,a.jsx)(Y(),{href:"/playlists/".concat(r.slug),className:"cursor-pointer hover:underline",children:r.playlistTitle})})]}),(0,a.jsxs)("span",{className:"ml-1.5 shrink-0 rounded-full border border-white/10 px-2 py-0.5 text-xs text-zinc-400",children:[v," vid\xe9o",v>1?"s":""]})]}),(0,a.jsx)("div",{className:"flex-1"}),y?(0,a.jsxs)("div",{className:"flex items-center gap-3 min-w-0 max-w-[60%]",children:[(0,a.jsxs)("span",{className:"hidden text-right text-sm text-zinc-400 sm:block truncate flex-1",title:n.title,children:["Vid\xe9o : ",(0,a.jsx)("span",{className:"font-semibold text-white",children:n.title})]}),(0,a.jsx)(J.A,{variant:"primary",size:"medium",onClick:o,isLoading:i,className:"shrink-0",children:(0,a.jsxs)("span",{className:"flex items-center gap-1.5",title:"Ajouter \xab ".concat(n.title," \xbb \xe0 la playlist"),children:[(0,a.jsx)(ee.A,{className:"h-5 w-5 shrink-0"}),(0,a.jsx)("span",{children:"Ajouter la vid\xe9o"})]})})]}):(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("span",{className:"hidden max-w-[280px] text-right text-xs text-zinc-400 sm:block"}),!("/cours"===m.pathname||m.pathname.startsWith("/cours/"))&&(0,a.jsx)(J.A,{variant:"secondary",size:"medium",onClick:()=>
1m.push("/cours"),className:"whitespace-nowrap border border-white text-white",children:"Parcourir les cours"})]}),(0,a.jsx)("button",{type:"button",onClick:()=>f(!0),"aria-label":"Fermer l'ajout rapide",className:"ml-1 shrink-0 rounded-md p-1.5 text-zinc-400 transition-colors hover:bg-white/5 hover:text-white cursor-pointer",children:(0,a.jsx)(et.A,{className:"h-6 w-6"})})]})]})}),(0,a.jsx)(er.Yw,{open:l,onOpenChange:c,canEdit:!0,isAdmin:g}),(0,a.jsx)(en.Lt,{open:d,onOpenChange:f,children:(0,a.jsxs)(en.EO,{className:"dark sm:max-w-md bg-[#181818] border-white/10 text-white p-6 rounded-xl shadow-2xl",children:[(0,a.jsxs)(en.wd,{children:[(0,a.jsx)(en.r7,{className:"text-white text-lg font-semibold",children:"Fermer l'ajout rapide ?"}),(0,a.jsxs)(en.$v,{className:"text-zinc-400 text-sm mt-2",children:["Souhaites-tu voir ta playlist \xab ",r.playlistTitle," \xbb ou rester sur la page actuelle ?"]})]}),(0,a.jsxs)(en.ck,{className:"flex flex-col sm:flex-row gap-2 mt-4 justify-end",children:[(0,a.jsx)(J.A,{variant:"secondary",size:"small",onClick:()=>f(!1),className:"border border-white/15 text-white",children:"Annuler"}),(0,a.jsx)(J.A,{variant:"secondary",size:"small",onClick:()=>{f(!1),s()},className:"border border-white/15 text-white",children:"Rester ici"}),(0,a.jsx)(J.A,{variant:"primary",size:"small",onClick:()=>{f(!1),s(),m.push("/playlists/".concat(r.slug))},children:"Voir la playlist"})]})]})})]})}var ei=r(95925),eo=r(55811),es=r(55747),el=r.n(es);let eu=e=>{let{children:t}=e,[r,n]=(0,h.useState)(!1),[i,o]=(0,h.useState)(!1),s=(0,u.useRouter)(),{isLoading:l}=(0,F.M)(),d=(0,h.useRef)(null);return(0,h.useEffect)(()=>{o(!0);let e=()=>{d.current&&(clearTimeout(d.current),d.current=null)},t=function(t){let{shallow:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!r)(c().asPath||"").split("?")[0]!==(t||"").split("?")[0]&&((0,h.startTransition)(()=>{n(!0)}),e(),d.current=setTimeout(()=>{n(!1)},6e3))},r=()=>{e(),(0,h.startTransition)(()=>{n(!1)})},a=()=>{e(),(0,h.startTransition)(()=>{n(!1)})};return c().events.on("routeChangeStart",t),c().events.on("routeChangeComplete",r),c().events.on("routeChangeError",a),()=>{e(),c().events.off("routeChangeStart",t),c().events.off("routeChangeComplete",r),c().events.off("routeChangeError",a)}},[]),(0,h.useEffect)(()=>{r&&n(!1)},[s.asPath]),(0,a.jsxs)(a.Fragment,{children:[i&&(l||r)&&(0,a.jsx)("div",{className:el().loadingOverlay,children:(0,a.jsx)("div",{className:el().loadingSpinner,children:(0,a.jsx)("div",{className:el().spinnerCircle})})}),t]})};var ec=r(98477),ed=r(87072),eh=r(30738),ef=r(16605),ep=r(69050),em=r(11897),eg=r(1859),ey=r.n(eg);function ev(){var e;let t=(0,u.useRouter)(),{activeBanners:r,dismissBanner:n}=(0,V.V)(),{user:i}=(0,M.ur)(),o=(0,h.useRef)(null),[s,l]=(0,h.useState)(!1);(0,h.useEffect)(()=>
1{l(!0)},[]);let c=t.pathname.includes("/learn"),d=t.pathname.startsWith("/pay/"),f=t.pathname.startsWith("/landings/")||t.pathname.startsWith("/landing/")||t.pathname.startsWith("/lp/"),p=t.pathname.startsWith("/bo"),m=t.pathname.startsWith("/live"),g=t.pathname.startsWith("/lt"),y=(0,h.useMemo)(()=>(0,ep._h)(r,{pathname:t.pathname,user:i,isLearningSpace:c,isPaymentLink:d,isLandingPage:f,isLivePage:m}),[r,t.pathname,c,d,f,m,i]);(0,h.useEffect)(()=>{var e;let t=(null==i||null==(e=i.roles)?void 0:e.includes("trial"))&&(null==i?void 0:i.trialTimeWatched)>0,r=em.dI&&i&&(null==i?void 0:i.isActivated)===!1&&!(null==i?void 0:i.isGoogle)&&!m&&!d&&!f&&!g;if(!s||0===y.length&&!t&&!r){"undefined"!=typeof document&&document.documentElement.style.setProperty("--banner-manager-height","0px");return}let n=()=>{let e=document.querySelector('[data-banner-sticky="true"]');if(e){let t=e.offsetHeight||0;document.documentElement.style.setProperty("--banner-manager-height","".concat(t,"px"))}else if(o.current){let e=o.current.offsetHeight||0;document.documentElement.style.setProperty("--banner-manager-height","".concat(e,"px"))}},a=null,l=requestAnimationFrame(()=>{n();let e=document.querySelector('[data-banner-sticky="true"]');e&&(a=new ResizeObserver(()=>{n()})).observe(e)});return()=>{cancelAnimationFrame(l),a&&a.disconnect(),"undefined"!=typeof document&&document.documentElement.style.setProperty("--banner-manager-height","0px")}},[s,y.length,null==i?void 0:i.roles,null==i?void 0:i.trialTimeWatched,null==i?void 0:i.isActivated,null==i?void 0:i.isGoogle,m,d,f]);let v=(null==i||null==(e=i.roles)?void 0:e.includes("trial"))&&i.trialTimeWatched>0,w=em.dI&&i&&!1===i.isActivated&&!i.isGoogle&&!m&&!d&&!f&&!g;if(p||0===y.length&&!v&&!w)return null;let b=(0,a.jsxs)("div",{ref:o,className:ey()["banner-manager"],"data-banner-sticky":"true",children:[w&&(0,a.jsx)(ef.A,{user:i}),v&&(0,a.jsx)(eh.A,{}),y.map(e=>{let t=e.basicId||e._id;return(0,a.jsx)(ed.A,{banner:e,onDismiss:n},t)})]});return s&&"undefined"!=typeof document?(0,ec.createPortal)(b,document.body):null}var ew=r(65364);function eb(){return"development"===function(){return"production"}()}function ex(e){return RegExp(`/${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?=[/?#]|$)`)}function eE(e){(0,h.useEffect)(()=>{var t;e.beforeSend&&(null==(t=window.si)||t.call(window,"beforeSend",e.beforeSend))},[e.beforeSend]);let t=(0,h.useRef)(null);return(0,h.useEffect)(()=>{if(t.current)e.route&&t.current(e.route);else{let r=function(e={}){var t;if("undefined"==typeof window||null===e.route)return null;window.si||(window.si=function(...e){(window.siq=window.siq||[]).push(e)});let r=e.scriptSrc?e.scriptSrc:eb()?"https://va.vercel-scripts.com/v1/speed-insights/script.debug.js":e.dsn?"https://va.vercel-scripts.com/v1/speed-insights/script.js":e.basePath?`${e.basePath}/speed-insights/script.js`:"/_vercel/speed-insights/script.js";if(document.head.querySelector(`script[src*="${r}"]`))return null;e.beforeSend&&(null==(t=window.si)||t.call(window,"beforeSend",e.beforeSend));let n=document.createElement("script");return n.src=r,n.defer=!0,n.dataset.sdkn="@vercel/speed-insights"+(e.framework?`/${e.framework}`:""),n.dataset.sdkv="1.3.1",e.sampleRate&&(n.dataset.sampleRate=e.sampleRate.toString()),e.route&&(n.dataset.route=e.route),e.endpoint?n.dataset.endpoint=e.endpoint:e.basePath&&(n.dataset.endpoint=`${e.basePath}/speed-insights/vitals`),e.dsn&&(n.dataset.dsn=e.dsn),eb()&&!1===e.debug&&(n.dataset.debug="false"),n.onerror=()=>{console.log(`[Vercel Speed Insights] Failed to load script from ${r}. Please check if any content blockers are enabled and try again.`)},document.head.appendChild(n),{setRoute:e=>{n.dataset.route=e??void 0}}}({framework:e.framework??"react",basePath:e.basePath??function(){if(void 0!==ew&&void 0!==ew.env)return ew.env.REACT_APP_VERCEL_OBSERVABILITY_BASEPATH}(),...e});r&&(t.current=r.setRoute)}},[e.route]),null}function eS(e){let t=(()=>{let e=(0,f.useParams)(),t=(0,f.useSearchParams)()||new URLSearchParams,r=(0,f.usePathname)();return e?function(e,t){if(!e||!t)return e;let r=e;try{let e=Object.entries(t);for(let[t,n]of e)if(!Array.isArray(n)){let e=ex(n);e.test(r)&&(r=r.replace(e,`/[${t}]`))}for(let[t,n]of e)if(Array.isArray(n)){let e=ex(n.join("/"));e.test(r)&&(r=r.replace(e,`/[...${t}]`))}return r}catch(t){return e}}(r,Object.keys(e).length?e:Object.fromEntries(t.entries())):null})();return h.createElement(eE,{route:t,...e,framework:"next",basePath:function(){if(void 0!==ew&&void 0!==ew.env)return ew.env.NEXT_PUBLIC_VERCEL_OBSERVABILITY_BASEPATH}()})}function ek(e){return h.createElement(h.Suspense,{fallback:null},h.createElement(eS,{...e}))}var eP=r(45105),eC=r.n(eP),eI=r(15707),eT=r(34214),eA=r(90293);r(12572),r(8728);var e_=r(17963);(0,e_.A)("hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}
1]]),(0,e_.A)("id-card",[["path",{d:"M16 10h2",key:"8sgtl7"}],["path",{d:"M16 14h2",key:"epxaof"}],["path",{d:"M6.17 15a3 3 0 0 1 5.66 0",key:"n6f512"}],["circle",{cx:"9",cy:"11",r:"2",key:"yxgjnd"}],["rect",{x:"2",y:"5",width:"20",height:"14",rx:"2",key:"qneu4z"}]]),r(25527),(0,e_.A)("key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]),(0,e_.A)("link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]),r(58725),r(16076),r(74206);let eO=()=>null;var eq=r(57776),eR=r(45195);o()(()=>r.e(7429).then(r.bind(r,87429)).then(e=>e.ReactQueryDevtools),{loadableGenerated:{webpack:()=>[null]},ssr:!1});let eD=o()(()=>Promise.all([r.e(188),r.e(6079),r.e(1630),r.e(4521),r.e(9207),r.e(3560),r.e(706),r.e(4587),r.e(8359),r.e(5068),r.e(5176),r.e(4234),r.e(5794),r.e(3474),r.e(5948),r.e(8864),r.e(5220),r.e(4001),r.e(8499),r.e(397),r.e(3392),r.e(314),r.e(5219),r.e(9553),r.e(2360),r.e(9628),r.e(5698),r.e(1011)]).then(r.bind(r,43392)),{loadableGenerated:{webpack:()=>[43392]},ssr:!1}),eN=o()(()=>Promise.all([r.e(4001),r.e(7599)]).then(r.bind(r,17599)),{loadableGenerated:{webpack:()=>[17599]},ssr:!1}),ej=o()(()=>r.e(8325).then(r.bind(r,8325)),{loadableGenerated:{webpack:()=>[8325]},ssr:!1}),eL=o()(()=>r.e(6194).then(r.bind(r,86194)),{loadableGenerated:{webpack:()=>[86194]},ssr:!1}),eM=o()(()=>r.e(5426).then(r.bind(r,85426)),{loadableGenerated:{webpack:()=>[85426]},ssr:!1}),eB=o()(()=>Promise.all([r.e(2269),r.e(963),r.e(1733)]).then(r.bind(r,71733)),{loadableGenerated:{webpack:()=>[71733]},ssr:!1}),eU=o()(()=>Promise.all([r.e(188),r.e(6079),r.e(1630),r.e(9938)]).then(r.bind(r,89938)),{loadableGenerated:{webpack:()=>[89938]},ssr:!1}),eF=o()(()=>Promise.all([r.e(3553),r.e(4001),r.e(8499),r.e(5269),r.e(6539)]).then(r.bind(r,6106)),{loadableGenerated:{webpack:()=>[6106]},ssr:!1}),ez=o()(()=>Promise.all([r.e(4001),r.e(8499),r.e(2599)]).then(r.bind(r,42599)),{loadableGenerated:{webpack:()=>[42599]},ssr:!1});window.emparaUmamiBeforeSend=eA.PN;let eV=o()(()=>Promise.all([r.e(4873),r.e(3560),r.e(706),r.e(5068),r.e(8864),r.e(1959),r.e(1725),r.e(4529),r.e(7399)]).then(r.bind(r,37399)),{loadableGenerated:{webpack:()=>[37399]},ssr:!1}),eW=o()(()=>r.e(5035).then(r.bind(r,15035)),{loadableGenerated:{webpack:()=>[15035]},ssr:!1}),eH=o()(()=>r.e(3651).then(r.bind(r,73651)).then(e=>e.Toaster),{loadableGenerated:{webpack:()=>[73651]},ssr:!1}),eG=o()(()=>Promise.all([r.e(188),r.e(6079),r.e(1630),r.e(3560),r.e(706),r.e(5220),r.e(6829)]).then(r.bind(r,16178)),{loadableGenerated:{webpack:()=>[16178]},ssr:!1}),eQ=o()(()=>Promise.all([r.e(1791),r.e(2133)]).then(r.bind(r,2133)),{loadableGenerated:{webpack:()=>[2133]},ssr:!1}),eK=o()(()=>Promise.all([r.e(2070),r.e(6243),r.e(6507)]).then(r.bind(r,92733)),{loadableGenerated:{webpack:()=>[92733]},ssr:!1});function e$(e){var t,n,i,o,s,l;let{Component:c,pageProps:f}=e,p=(0,u.useRouter)(),m=null==p||null==(t=p.pathname)?void 0:t.startsWith("/bo"),g=(null==p||null==(n=p.pathname)?void 0:n.startsWith("/l/"))||(null==p||null==(i=p.pathname)?void 0:i.startsWith("/lp/")),y=null==p||null==(o=p.pathname)?void 0:o.startsWith("/live"),v=m||g,w=(0,K.V)(),b=w.isNativeApp,{user:x,setUser:E,refreshUser:S}=(0,M.ur)(),{openEmailVerified:k}=(0,z.YF)(),P=(null==x?void 0:x._id)?String(x._id):"anon",[C,I]=(0,h.useState)(!1),T=(0,eT.H)(),A=(0,h.useRef)(!1);(0,h.useEffect)(()=>{I(!0),(0,ei.registerServiceWorker)(),b&&!1!==navigator.onLine&&!A.current&&(A.current=!0,Promise.all([Promise.all([r.e(188),r.e(6079),r.e(1630),r.e(4521),r.e(9207),r.e(3560),r.e(706),r.e(4587),r.e(8359),r.e(5068),r.e(5176),r.e(4234),r.e(5794),r.e(3474),r.e(5948),r.e(8864),r.e(5220),r.e(4001),r.e(8499),r.e(397),r.e(3392),r.e(314),r.e(5219),r.e(9553),r.e(2360),r.e(9628),r.e(5698),r.e(1011)]).then(r.bind(r,43392)),Promise.all([r.e(4587),r.e(4001),r.e(8499),r.e(5219),r.e(9553),r.e(9628),r.e(4913)]).then(r.bind(r,9628)),r.e(3086).then(r.bind(r,50705)),Promise.resolve().then(r.bind(r,56803))]).catch(()=>{}));try{var e,t;!window.__SPLASH_HIDDEN__&&(null==(t=window.Capacitor)||null==(e=t.isPluginAvailable)?void 0:e.call(t,"SplashScreen"))&&Promise.resolve().then(()=>{var e,t;let r=null==(t=window.Capacitor)||null==(e=t.Plugins)?void 0:e.SplashScreen;if(!r||"function"!=typeof r.hide)throw Error("SPLASH_BRIDGE_ABSENT");return r.hide({fadeOutDuration:250})}).catch(()=>r.e(9658).then(r.bind(r,7277)).then(e=>{let{SplashScreen:t}=e;return t.hide({fadeOutDuration:250})}
1)).then(()=>{window.__SPLASH_HIDDEN__=!0}).catch(()=>{})}catch(e){}if(b)(()=>{let e=document.getElementById("empara-startup-loader");if(e){if(!b){e.parentNode&&e.parentNode.removeChild(e);return}e.classList.add("loaded"),setTimeout(()=>{e.parentNode&&e.parentNode.removeChild(e)},450)}})();else{let e=document.getElementById("empara-startup-loader");e&&e.parentNode&&e.parentNode.removeChild(e)}},[x,b]),(0,h.useEffect)(()=>{!T&&(eI.default.init(),x&&eI.default.identifyUser(x))},[x,T]);let _=(0,h.useRef)(!1);return(0,h.useEffect)(()=>{if(!b||!1===navigator.onLine||_.current)return;_.current=!0;let e=null,t=null,n=()=>{if(e=null,t=null,!1===navigator.onLine)return;Promise.resolve().then(r.bind(r,95925)).then(function(e){return e.cacheOfflineAppAndPages()}).catch(()=>{}),r.e(6990).then(r.bind(r,56990)).then(function(e){return e.cacheOfflineShell()}).catch(()=>{});let n=()=>r.e(2260).then(r.bind(r,42260)).then(function(e){return e.syncEngine.triggerSync()}).catch(()=>{});Promise.resolve().then(r.bind(r,56803)).then(function(e){return e.offlineMediaStorage.getCachedManifestSync().length>0||Promise.resolve().then(r.bind(r,99783)).then(function(e){return e.offlineStorage.countPendingMutations()}).then(function(e){return e>0})}).then(function(e){return e?n():void 0}).catch(n)};return"function"==typeof window.requestIdleCallback?e=window.requestIdleCallback(n,{timeout:5e3}):t=setTimeout(n,3e3),()=>{null!==e&&"function"==typeof window.cancelIdleCallback&&window.cancelIdleCallback(e),null!==t&&clearTimeout(t)}},[b]),(0,h.useEffect)(()=>{if(!C||!p.isReady)return;let{logout:e}=p.query||{};if("true"===e){try{(0,d.Tp)(),(0,h.startTransition)(()=>E(null))}catch(e){}let e=new URL(window.location.href);e.searchParams.delete("logout"),p.replace("".concat(e.pathname).concat(e.search).concat(e.hash),void 0,{shallow:!0}).catch(()=>{})}},[C,p,p.isReady,null==(s=p.query)?void 0:s.logout,E]),(0,h.useEffect)(()=>{if(window.ResizeObserver){let e=window.ResizeObserver;return window.ResizeObserver=class extends e{constructor(e){super((t,r)=>{window.requestAnimationFrame(()=>{if(Array.isArray(t)&&t.length)try{e(t,r)}catch(e){if(e.message&&e.message.includes("ResizeObserver loop completed with undelivered notifications"))return;throw e}})})}},()=>{window.ResizeObserver=e}}},[]),(0,h.useEffect)(()=>{{let e=e=>{if(e.filename&&e.filename.includes("content_script")||e.message&&e.message.includes("contains is not a function"))return e.preventDefault(),!1};return window.addEventListener("error",e),()=>window.removeEventListener("error",e)}},[]),(0,h.useEffect)(()=>{if(C&&window._cio&&"function"==typeof window._cio.identify&&1){if(x)window._cio.identify({id:x.basicId});else{let e=localStorage.getItem("anonymousId");e||(e="anon-".concat(new Date().getTime()),localStorage.setItem("anonymousId",e))}T||window._cio.page()}},[x,C,T]),(0,h.useEffect)(()=>{if(!C)return;let e=e=>{(0,eA.A9)(e)||(window._cio&&"function"==typeof window._cio.page&&window._cio.page(),eI.default.trackPageView(e))},t=(e,t)=>{null!=e&&e.cancelled||(null==e||!e.__emparaOfflineBlocked)&&("undefined"==typeof navigator||navigator.onLine||console.warn("[Offline] Transition de navigation interrompue vers ".concat(t,":"),e))};return p.events.on("routeChangeComplete",e),p.events.on("routeChangeError",t),()=>{p.events.off("routeChangeComplete",e),p.events.off("routeChangeError",t)}},[p.events,C]),(0,h.useEffect)(()=>{if(!C||!p.isReady)return;let{emailVerified:e}=p.query||{};if("true"!==e)return;k(),"function"==typeof S&&S();let t={...p.query};delete t.emailVerified,p.replace({pathname:p.pathname,query:t},void 0,{shallow:!0})},[C,p.isReady,null==(l=p.query)?void 0:l.emailVerified,k,S,p]),(0,h.useEffect)(()=>{if(!C||!p.isReady)return;let{bf2025_registered:e}=p.query||{};if("true"===e){eI.default.trackEvent("BlackFriday2025_Registered",{event_category:"promotion",event_label:"BlackFriday 2025",registration_source:"blog",user_id:(null==x?void 0:x.basicId)||(null==x?void 0:x._id)||null});let e={...p.query};delete e.bf2025_registered,p.replace({pathname:p.pathname,query:e},void 0,{shallow:!0})}},[p.isReady,p.query,C,x,p]),(0,h.useEffect)(()=>{let e=null,t=null,n=null,a=async()=>
1{if(!e)try{let{createClient:a}=await Promise.all([r.e(1235),r.e(6131)]).then(r.bind(r,86131));(e=(n=a()).channel("prewarm-".concat(crypto.randomUUID()))).subscribe(),t=setTimeout(()=>{e&&n&&(n.removeChannel(e),e=null)},15e3)}catch(e){}};p.pathname.startsWith("/live/")&&a();let i=e=>{"string"==typeof e&&e.startsWith("/live/")&&a()};return p.events.on("routeChangeStart",i),()=>{p.events.off("routeChangeStart",i),t&&clearTimeout(t),e&&n&&(n.removeChannel(e),e=null)}},[p]),(0,h.useEffect)(()=>{if(!C)return;let e=["ArrowUp","ArrowUp","ArrowDown","ArrowDown","ArrowLeft","ArrowRight","ArrowLeft","ArrowRight","b","a"],t=[],r=r=>{t.push(r.key),t.length>e.length&&t.shift(),e.every((e,r)=>t[r]===e)&&(p.push("/kona"),t=[])};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[p,C]),(0,h.useEffect)(()=>{if(!C)return;let e=(0,eo.C3)(p),t=e=>{var t;let r=Error("EMPARA_OFFLINE_NAV_BLOCKED");r.__emparaOfflineBlocked=!0,p.events.emit("routeChangeError",r,(null==e||null==(t=e.detail)?void 0:t.url)||p.asPath,{shallow:!1})};return window.addEventListener(eo.u,t),()=>{window.removeEventListener(eo.u,t),"function"==typeof e&&e()}},[p,C]),(0,a.jsxs)(a.Fragment,{children:[!T&&(0,a.jsx)(eB,{user:x||f.user}),(0,a.jsx)(U,{children:(0,a.jsx)(j.A,{children:(0,a.jsx)(L.$F,{children:(0,a.jsx)(V.E,{children:(0,a.jsx)(W.ez,{children:(0,a.jsx)(H.lA,{children:(0,a.jsx)(F.o,{children:(0,a.jsxs)(G.GK,{children:[(0,a.jsx)(ev,{}),!b&&(0,a.jsx)(eQ,{user:x},P),!b&&(0,a.jsx)(eK,{user:x}),(0,a.jsx)(eu,{children:(0,a.jsx)("div",{className:(0,eR.cn)("flex flex-col min-h-screen",y&&"h-[100dvh] min-h-0 overflow-hidden",!v&&!y&&"pb-[calc(4.5rem+env(safe-area-inset-bottom,0px))]",!v&&!y&&!b&&"lg:pb-0"),children:(0,a.jsx)(c,{...f,className:"flex flex-col"})})}),!v&&(0,a.jsx)(eF,{}),(0,a.jsx)(ez,{}),b&&(0,a.jsx)(eD,{}),w.isTauri&&(0,a.jsx)(eN,{}),w.isTauri&&(0,a.jsx)(ej,{}),(0,a.jsx)(eO,{}),(0,a.jsx)(eV,{}),(0,a.jsx)(eW,{}),(0,a.jsx)(eG,{}),(0,a.jsx)(eU,{}),(0,a.jsx)(ea,{}),(0,a.jsx)(eH,{position:"bottom-center",theme:"light"})]})})})})})})})})]})}function eY(){return(0,h.useEffect)(()=>{let e="BO \xb7 ",t=document.querySelector("title");if(!t)return;let r=()=>{document.title.startsWith(e)||(document.title=e+document.title)};r();let n=new MutationObserver(r);return n.observe(t,{childList:!0}),()=>n.disconnect()},[]),null}function eJ(){let e=(0,u.useRouter)();return(0,h.useEffect)(()=>(0,eo.C3)(e),[e]),null}let eX=function(e){var t,r;let{Component:i,pageProps:o,router:s}=e,[u]=(0,h.useState)(()=>(n||(n=new N({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1,staleTime:3e5}}})),n)),[c,d]=(0,h.useState)(null),f=null==s||null==(t=s.pathname)?void 0:t.startsWith("/bo"),p=(0,Q.r)();return(null==s||null==(r=s.pathname)?void 0:r.startsWith("/l/"))?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(l(),{children:[(0,a.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover"}),(0,a.jsx)("link",{rel:"icon",href:"/favicon.ico"},"favicon")]}),(0,a.jsx)(i,{...o}),(0,a.jsx)(eJ,{}),(0,a.jsx)(x,{})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(l(),{children:[(0,a.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover"}),(0,a.jsx)("link",{rel:"icon",href:f?"/favicon-bo.ico":"/favicon.ico"},"favicon"),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("link",{rel:"preconnect",href:"https://qixpjnavnnjgoendcevh.supabase.co"}),(0,a.jsx)("link",{rel:"dns-prefetch",href:"https://qixpjnavnnjgoendcevh.supabase.co"})]})]}),f&&(0,a.jsx)(eY,{}),(0,a.jsx)(eC(),{src:"https://tally.so/widgets/embed.js",strategy:"afterInteractive"}),(0,a.jsx)(eC(),{src:"https://cdn.jsdelivr.net/npm/statsig-sidecar-v2-beta/dist/index.min.js?apikey=".concat("client-ouO6rrON2iF4Uy9328G1wy3Bd9jDgsZKELfOUHsGxqC"),strategy:"afterInteractive"}),!p&&(0,a.jsx)(eC(),{src:"https://uma.empara.fr/script.js","data-website-id":"ddba8501-26c9-4253-8623-3543317e1a8d","data-before-send":"emparaUmamiBeforeSend",strategy:"afterInteractive",defer:!0}),(0,a.jsx)(eL,{}),(0,a.jsx)(eM,{user:c}),(0,a.jsxs)(E.Ht,{client:u,children:[(0,a.jsx)(eq.G_,{clientId:"297383962942-qn6m58rr29oo343jnlihpd2mo466uvf7.apps.googleusercontent.com",children:(0,a.jsx)(M.vu,{initialUser:o.user,setUser:d,children:(0,a.jsx)(z._z,{children:(0,a.jsx)(e$,{Component:i,pageProps:o})})})}),!1]}),(0,a.jsx)(x,{beforeSend:eA.JN}),(0,a.jsx)(ek,{beforeSend:eA.JN})]})}},4902:(e,t,r)=>{"use strict";r.d(t,{Cl:()=>n,Tt:()=>a,fX:()=>o,sH:()=>i});var n=function(){return(n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};function a(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)0>t.indexOf(n[a])&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r}function i(e,t,r,n){return new(r||(r=Promise))(function(a,i){function o(e){try{l(n.next(e))}catch(e){i(e)}}function s(e){try{l(n.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?a(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,s)}l((n=n.apply(e,t||[])).next())})}Object.create;function o(e,t,r){if(r||2==arguments.length)for(var n,a=0,i=t.length;a<i;a++)!n&&a in t||(n||(n=Array.prototype.slice.call(t,0,a)),n[a]=t[a]);return e.concat(n||Array.prototype.slice.call(t))}Object.create,"function"==typeof SuppressedError&&SuppressedError},5374:(e,t,r)=>{"use strict";r.d(t,{M:()=>u,o:()=>l});var n=r(37876),a=r(14232),i=r(89099),o=r.n(i);let s=(0,a.createContext)();function l(e){let{children:t}=e,[r,i]=(0,a.useState)(!1),l=(0,a.useRef)(null),u=(0,a.useCallback)(e=>{l.current&&(clearTimeout(l.current),l.current=null),i(e),e&&(l.current=setTimeout(()=>{i(!1)},6e3))},[]);return(0,a.useEffect)(()=>{let e=()=>{l.current&&(clearTimeout(l.current),l.current=null),i(!1)};return o().events.on("routeChangeComplete",e),o().events.on("routeChangeError",e),()=>{l.current&&clearTimeout(l.current),o().events.off("routeChangeComplete",e),o().events.off("routeChangeError",e)}},[]),(0,n.jsx)(s.Provider,{value:{isLoading:r,setLoading:u},children:t})}function u(){let e=(0,a.useContext)(s);
1if(void 0===e)throw Error("useLoading must be used within a LoadingProvider");return e}},5824:(e,t,r)=>{"use strict";r.d(t,{Am:()=>d,GV:()=>c,JK:()=>l,J_:()=>s,N9:()=>h,O2:()=>o,a4:()=>i,pW:()=>u});var n=r(50900),a=r(72091);function i(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"web",t="ios"===e,r="android"===e,n="macos"===e,a="windows"===e,i="linux"===e,o=t||r,s=n||a||i||"desktop"===e,l=o||s;return{isNativeApp:l,isTauri:s,isCapacitor:o,isIOS:t,isAndroid:r,isDesktop:s,isMacOS:n,isWindows:a,isLinux:i,isWeb:!l,platform:e}}function o(){var e,t,r,a;let o=("undefined"!=typeof navigator?navigator.userAgent:"")||"",s=/Tauri|EmparaDesktop/i.test(o),l=!!(window.__TAURI_INTERNALS__||window.__TAURI__||window.__TAURI_METADATA__||window.__EMPARA_DESKTOP__||s),u=!!(void 0!==window.Capacitor&&(null==(t=window.Capacitor)||null==(e=t.isNativePlatform)?void 0:e.call(t))||n.Ii.isNativePlatform()),d=((null==(a=window.Capacitor)||null==(r=a.getPlatform)?void 0:r.call(a))||n.Ii.getPlatform()||"").toLowerCase(),h=l&&/Macintosh|Mac OS X/i.test(o),f=l&&/Windows/i.test(o),p=l&&/Linux/i.test(o),m="web";return u&&"ios"===d?m="ios":u&&"android"===d?m="android":h?m="macos":f?m="windows":p?m="linux":l&&(m="desktop"),{...i(m),isMsStore:c(o)}}function s(){return o().isIOS}function l(){return o().isNativeApp}function u(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=String(e||"").match(/EmparaDesktop\/(\d+\.\d+\.\d+)/);return t?t[1]:null}function c(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=String(e||"");return/EmparaDesktop\/\d+\.\d+\.\d+\s+Tauri\/2\s+MSStore\s*$/.test(t)}function d(e){let t=(0,a.mU)(e,"1.0.0");return null!==t&&t>=0}function h(e){let t=(0,a.mU)(e,"1.0.2");return null!==t&&t>=0}},7021:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(14232);let a=n.forwardRef(function(e,t){let{title:r,titleId:a,...i}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":a},i),r?n.createElement("title",{id:a},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 0 0-2.456 2.456ZM16.894 20.567 16.5 21.75l-.394-1.183a2.25 2.25 0 0 0-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 0 0 1.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 0 0 1.423 1.423l1.183.394-1.183.394a2.25 2.25 0 0 0-1.423 1.423Z"}))})},7566:(e,t,r)=>{"use strict";r.d(t,{Fo:()=>f,KZ:()=>u,K_:()=>i,Ni:()=>p,QC:()=>g,a1:()=>m,dY:()=>l,gD:()=>s,hD:()=>a,mg:()=>o,nZ:()=>c});var n=r(15707);let a=(e,t)=>{var r;if(!e||!t)return!1;let n="string"==typeof t?t:t._id;return!!n&&((null==e||null==(r=e.courses)?void 0:r.some(e=>{let t=(null==e?void 0:e._id)||(null==e?void 0:e.courseId);return(null==t?void 0:t.toString())===n.toString()}))||!1)};function i(e,t){if((null==e?void 0:e.status)!=="public")return null==e?void 0:e.status;let r=Array.isArray(t)?t[0]:t;if(!r||!r.startDate||!r.endDate)return null==e?void 0:e.status;let n=(e=>{try{let t=new Date(e),r=new Intl.DateTimeFormat("sv-SE",{timeZone:"Europe/Paris",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(t),n={};return r.forEach(e=>n[e.type]=e.value),new Date("".concat(n.year,"-").concat(n.month,"-").concat(n.day,"T").concat(n.hour,":").concat(n.minute,":").concat(n.second,"Z"))}catch(t){return new Date(e)}})(new Date),a=n.getTime(),i=n.getUTCHours(),o=new Date(r.startDate).getTime(),s=new Date(r.endDate).getTime();return a>=o-9e5&&a<s?i>=18?"preLive":"live":a>=s?"postLive":"preLive"}function o(e){if(!e)return!1;if("postLive"===e.status)return!0;if("public"===e.status){let t=Array.isArray(e.live)?e.live[0]:e.live;if(t&&t.endDate)return new Date(t.endDate)<new Date}return!1}let s=e=>{if(!(null==e?void 0:e.subscription))return!1;let t=e.subscription,r=new Date;if("active"!==t.status||"trial"===t.subscriptionType)return!1;if(t.currentPeriodStart&&t.currentPeriodEnd){let e=new Date(t.currentPeriodStart),n=new Date(t.currentPeriodEnd);if(r<e||r>n)return!1}return!(t.endedAt&&r>new Date(t.endedAt))&&!0},l=e=>{var t,r,n,a;if(!(null==e?void 0:e.subscription))return(null==e||null==(r=e.roles)?void 0:r.includes("sub"))?"sub":null;let i=e.subscription;return"trial"===i.subscriptionType?"trial":s(e)?"monthly"===(null==(n=i.subscriptionPlan)?void 0:n.type)||(null==(a=i.subscriptionPlan)?void 0:a.interval)==="month"?"monthly":"sub":(null==e||null==(t=e.roles)?void 0:t.includes("sub"))?"sub":null},u=e=>{var t,r,n;if(!s(e))return 0;let a=e.subscription;return Math.max(0,(null!=(r=null==(t=a.subscriptionPlan)?void 0:t.nbFreeDownload)?r:0)-(null!=(n=a.currentFreeCourse)?n:0))},c=Object.freeze({FREE:"Gratuit",PASSIONNE:"Passionn\xe9",PRO:"Pro"});Object.freeze([c.FREE,c.PASSIONNE,c.PRO]);let d=e=>"".concat(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").trim().toLowerCase(),h=function(e,t){var r,n;let{strict:a=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null==t||null==(r=t.roles)?void 0:r.includes("admin"))return!0;let i=d(e);if(!i||i===d(c.FREE))return!0;let o=null==t||null==(n=t.subscription)?void 0:n.subscriptionPlan;if(!o)return!a;let s=void 0!==o.basicId&&o.basicId<90;return i===d(c.PASSIONNE)?"passionne"===o.type||"premium"===o.type||s:i!==d(c.PRO)||"premium"===o.type||s},f=(e,t)=>{var r,n;return null!=t&&null!=(r=t.courses)&&!!r.some(t=>(null==t?void 0:t._id)===(null==e?void 0:e._id))||h(null==e||null==(n=e.availability)?void 0:n.offer,t)},p=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return!!e&&(!!(t&&a(e,t))||e.hasBonus&&"trial"!==e.subType||e.hasCourse)};async function m(e,t,r,n,a){try{let i=await fetch("/api/feedback/create",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({mark:parseInt(e),content:t,courseId:r,url:n||null,responseId:a||null})});if(!i.ok){let e=await i.json().catch(()=>({error:"Unknown error"}));throw Error(e.error||"HTTP error! status: ".concat(i.status))}return(await i.json()).feedback}catch(e){throw console.error("Error creating feedback:",e),e}}let g=async e=>{let{courseId:t,user:r,setUser:a,setIsRsvp:i=()=>{},setLoadingRsvp:o=()=>{},courseData:s={}}=e;try{var l,u;let e=((null===n.default||void 0===n.default?void 0:n.default.generateEventId)?n.default.generateEventId("CourseRSVP",null==r?void 0:r.basicId):"CourseRSVP_".concat(null==r?void 0:r.basicId))+t,c=(null===n.default||void 0===n.default?void 0:n.default.getFBP)?n.default.getFBP():null,d=(null===n.default||void 0===n.default?void 0:n.default.getFBC)?n.default.getFBC():null,h=await fetch("/api/user/rsvp",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({courseId:t,courseName:s.title||s.name,courseCategory:s.category||"formation",instructorName:s.instructor||s.author,courseDate:s.startDate||s.date,eventId:e,fbp:c,fbc:d})}),f=await h.json();if(null==f||null==(l=f.setRsvpStatus)?void 0:l.AddUserLiveReservation){let i=(e=>e?Array.isArray(e)?e.map(e=>
1null==e?void 0:e.toString()).filter(Boolean):[null==e?void 0:e.toString()].filter(Boolean):[])(null==r?void 0:r.liveReservationIds),l=null==t?void 0:t.toString(),c=i.includes(l)?i:[...i,l];if(a(e=>({...e,liveReservationIds:c})),o(!1),null==f||null==(u=f.setRsvpStatus)?void 0:u.AddUserLiveReservationCreated)try{(0,n.trackCourseRSVP)({courseId:t,courseName:s.title||s.name||"Formation Empara",courseCategory:s.category||"formation",rsvpType:"live",instructorName:s.instructor||s.author,courseDate:s.startDate||s.date,eventId:e})}catch(e){}}i(!0)}catch(e){console.error("Erreur lors de la r\xe9servation du live",e)}}},8156:(e,t,r)=>{"use strict";r.d(t,{GK:()=>l,mc:()=>u});var n=r(37876),a=r(14232),i=r(59688);let o="empara:quickAddPlaylist",s=(0,a.createContext)(null);function l(e){let{children:t}=e,[r,l]=(0,a.useState)(null),[u,c]=(0,a.useState)(null),[d,h]=(0,a.useState)(!1),f=(0,a.useRef)(!1);(0,a.useEffect)(()=>{try{let e=window.localStorage.getItem(o);if(e){let t=JSON.parse(e);(null==t?void 0:t.playlistId)&&l(t)}}catch(e){}f.current=!0},[]),(0,a.useEffect)(()=>{if(f.current)try{r?window.localStorage.setItem(o,JSON.stringify(r)):window.localStorage.removeItem(o)}catch(e){}},[r]);let p=(0,a.useCallback)(e=>{(null==e?void 0:e.playlistId)&&l({playlistId:e.playlistId,playlistTitle:e.playlistTitle||"Playlist",slug:e.slug||e.playlistId,videoCount:"number"==typeof e.videoCount?e.videoCount:0})},[]),m=(0,a.useCallback)(()=>{l(null),c(null)},[]),g=(0,a.useCallback)(e=>{if(!(null==e?void 0:e.videoId))return void c(null);c({videoId:e.videoId,courseId:e.courseId||null,title:e.title||"Vid\xe9o"})},[]),y=(0,a.useCallback)(()=>c(null),[]),v=(0,a.useCallback)(async()=>{if((null==r?void 0:r.playlistId)&&(null==u?void 0:u.videoId)&&!d){if(!u.courseId)return void i.oR.error("Impossible d'ajouter cette vid\xe9o (cours introuvable)");h(!0);try{var e;let t=await fetch("/api/playlist/".concat(r.playlistId,"/videos"),{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({videoId:u.videoId,courseId:u.courseId})});if(t.ok){l(e=>e?{...e,videoCount:(e.videoCount||0)+1}:e),i.oR.success("\xab ".concat(u.title," \xbb ajout\xe9e \xe0 \xab ").concat(r.playlistTitle," \xbb")),window.dispatchEvent(new CustomEvent("empara:playlist-video-added",{detail:{playlistId:r.playlistId}}));return}let n=await t.json().catch(()=>({}));400===t.status&&(null==n||null==(e=n.error)?void 0:e.includes("existe d\xe9j\xe0"))?i.oR.info("Cette vid\xe9o est d\xe9j\xe0 dans la playlist"):401===t.status?i.oR.error("Vous devez \xeatre connect\xe9 pour ajouter une vid\xe9o"):403===t.status?i.oR.error("Vous n'avez pas les droits sur cette playlist"):i.oR.error((null==n?void 0:n.error)||"Erreur lors de l'ajout de la vid\xe9o")}catch(e){i.oR.error("Erreur lors de l'ajout de la vid\xe9o")}finally{h(!1)}}},[r,u,d]),w=(0,a.useMemo)(()=>({target:r,isActive:!!r,learnVideo:u,adding:d,start:p,stop:m,setLearnVideo:g,clearLearnVideo:y,addLearnVideo:v}),[r,u,d,p,m,g,y,v]);return(0,n.jsx)(s.Provider,{value:w,children:t})}function u(){let e=(0,a.useContext)(s);return e||{target:null,isActive:!1,learnVideo:null,adding:!1,start:()=>{},stop:()=>{},setLearnVideo:()=>{},clearLearnVideo:()=>{},addLearnVideo:()=>{}}}},8420:(e,t,r)=>{"use strict";r.d(t,{A:()=>v});var n=r(3610),a=r(14455),i=r(97770);function o(e,t){let r=[{type:"text",value:"â©"}];return t>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),r}function s(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}var l=r(73435),u=r(46029),c=r(68581);let d={}.hasOwnProperty,h={};function f(e,t){e.position&&(t.position=(0,u.G1)(e))}function p(e,t){let r=t;if(e&&e.data){let t=e.data.hName,n=e.data.hChildren,i=e.data.hProperties;"string"==typeof t&&("element"===r.type?r.tagName=t:r={type:"element",tagName:t,properties:{},children:"children"in r?r.children:[r]}),"element"===r.type&&i&&Object.assign(r.properties,(0,a.Ay)(i)),"children"in r&&r.children&&null!=n&&(r.children=n)}return r}function m(e,t){let r=[],n=-1;for(t&&r.push({type:"text",value:"\n"});++n<e.length;)n&&r.push({type:"text",value:"\n"}),r.push(e[n]);return t&&e.length>0&&r.push({type:"text",value:"\n"}),r}function g(e){let t=0,r=e.charCodeAt(t);for(;9===r||32===r;)t++,r=e.charCodeAt(t);return e.slice(t)}function y(e,t){let r=function(e,t){let r=t||h,n=new Map,i=new Map,o={all:function(e){let t=[];if("children"in e){let r=e.children,n=-1;for(;++n<r.length;){let a=o.one(r[n],e);if(a){if(n&&"break"===r[n-1].type&&(Array.isArray(a)||"text"!==a.type||(a.value=g(a.value)),!Array.isArray(a)&&"element"===a.type)){let e=a.children[0];e&&"text"===e.type&&(e.value=g(e.value))}Array.isArray(a)?t.push(...a):t.push(a)}}}return t},applyData:p,definitionById:n,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...c.Y,...r.handlers},one:function(e,t){let r=e.type,n=o.handlers[r];if(d.call(o.handlers,r)&&n)return n(o,e,t);if(o.options.passThrough&&o.options.passThrough.includes(r)){if("children"in e){let{children:t,...r}=e,n=(0,a.Ay)(r);return n.children=o.all(e),n}return(0,a.Ay)(e)}return(o.options.unknownHandler||function(e,t){let r=t.data||{},n="value"in t&&!(d.call(r,"hProperties")||d.call(r,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)})(o,e,t)},options:r,patch:f,wrap:m};return(0,l.YR)(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){let t="definition"===e.type?n:i,r=String(e.identifier).toUpperCase();t.has(r)||t.set(r,e)}}),o}(e,t),u=r.one(e,void 0),y=function(e){let t="string"==typeof e.o
1ptions.clobberPrefix?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||o,n=e.options.footnoteBackLabel||s,l=e.options.footnoteLabel||"Footnotes",u=e.options.footnoteLabelTagName||"h2",c=e.options.footnoteLabelProperties||{className:["sr-only"]},d=[],h=-1;for(;++h<e.footnoteOrder.length;){let a=e.footnoteById.get(e.footnoteOrder[h]);if(!a)continue;let o=e.all(a),s=String(a.identifier).toUpperCase(),l=(0,i.e)(s.toLowerCase()),u=0,c=[],f=e.footnoteCounts.get(s);for(;void 0!==f&&++u<=f;){c.length>0&&c.push({type:"text",value:" "});let e="string"==typeof r?r:r(h,u);"string"==typeof e&&(e={type:"text",value:e}),c.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+l+(u>1?"-"+u:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof n?n:n(h,u),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}let p=o[o.length-1];if(p&&"element"===p.type&&"p"===p.tagName){let e=p.children[p.children.length-1];e&&"text"===e.type?e.value+=" ":p.children.push({type:"text",value:" "}),p.children.push(...c)}else o.push(...c);let m={type:"element",tagName:"li",properties:{id:t+"fn-"+l},children:e.wrap(o,!0)};e.patch(a,m),d.push(m)}if(0!==d.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:u,properties:{...(0,a.Ay)(c),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(d,!0)},{type:"text",value:"\n"}]}}(r),v=Array.isArray(u)?{type:"root",children:u}:u||{type:"root",children:[]};return y&&((0,n.ok)("children"in v),v.children.push({type:"text",value:"\n"},y)),v}function v(e,t){return e&&"run"in e?async function(r,n){let a=y(r,{file:n,...t});await e.run(a,n)}:function(r,n){return y(r,{file:n,...e||t})}}},8728:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(17963).A)("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]])},9030:(e,t,r)=>{"use strict";r.d(t,{A:()=>ex});var n={};r.r(n),r.d(n,{attentionMarkers:()=>eh,contentInitial:()=>eo,disable:()=>ef,document:()=>ei,flow:()=>el,flowInitial:()=>es,insideSpan:()=>ed,string:()=>eu,text:()=>ec});var a=r(30311),i=r(67776);class o{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let r=null==t?1/0:t;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,t,r){this.setCursor(Math.trunc(e));let n=this.right.splice(this.right.length-(t||0),1/0);return r&&s(this.left,r),n.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),s(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),s(this.right,e.reverse())}setCursor(e){if(e!==this.left.length&&(!(e>this.left.length)||0!==this.right.length)&&(!(e<0)||0!==this.left.length))if(e<this.left.length){let t=this.left.splice(e,1/0);s(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);s(this.left,t.reverse())}}}function s(e,t){let r=0;if(t.length<1e4)e.push(...t);else for(;r<t.length;)e.push(...t.slice(r,r+1e4)),r+=1e4}function l(e){let t,r,n,a,s,l,u,c={},d=-1,h=new o(e);for(;++d<h.length;){for(;d in c;)d=c[d];if(t=h.get(d),d&&"chunkFlow"===t[1].type&&"listItemPrefix"===h.get(d-1)[1].type&&((n=0)<(l=t[1]._tokenizer.events).length&&"lineEndingBlank"===l[n][1].type&&(n+=2),n<l.length&&"content"===l[n][1].type))for(;++n<l.length&&"content"!==l[n][1].type;)"chunkText"===l[n][1].type&&(l[n][1]._isInFirstContentOfListItem=!0,n++);if("enter"===t[0])t[1].contentType&&(Object.assign(c,function(e,t){let r,n,a=e.get(t)[1],i=e.get(t)[2],o=t-1,s=[],l=a._tokenizer;!l&&(l=i.parser[a.contentType](a.start),a._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));let u=l.events,c=[],d={},h=-1,f=a,p=0,m=0,g=[0];for(;f;){for(;e.get(++o)[1]!==f;);s.push(o),!f._tokenizer&&(r=i.sliceStream(f),f.next||r.push(null),n&&l.defineSki
1p(f.start),f._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(r),f._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),n=f,f=f.next}for(f=a;++h<u.length;)"exit"===u[h][0]&&"enter"===u[h-1][0]&&u[h][1].type===u[h-1][1].type&&u[h][1].start.line!==u[h][1].end.line&&(m=h+1,g.push(m),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(l.events=[],f?(f._tokenizer=void 0,f.previous=void 0):g.pop(),h=g.length;h--;){let t=u.slice(g[h],g[h+1]),r=s.pop();c.push([r,r+t.length-1]),e.splice(r,2,t)}for(c.reverse(),h=-1;++h<c.length;)d[p+c[h][0]]=p+c[h][1],p+=c[h][1]-c[h][0]-1;return d}(h,d)),d=c[d],u=!0);else if(t[1]._container){for(n=d,r=void 0;n--;)if("lineEnding"===(a=h.get(n))[1].type||"lineEndingBlank"===a[1].type)"enter"===a[0]&&(r&&(h.get(r)[1].type="lineEndingBlank"),a[1].type="lineEnding",r=n);else if("linePrefix"===a[1].type||"listItemIndent"===a[1].type);else break;r&&(t[1].end={...h.get(r)[1].start},(s=h.slice(r,d)).unshift(t),h.splice(r,d-r+1,s))}}return(0,i.m)(e,0,1/0,h.slice(0)),!u}var u=r(94988),c=r(71368),d=r(15711);let h={tokenize:function(e){let t,r=e.attempt(this.parser.constructs.contentInitial,function(t){return null===t?void e.consume(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),(0,c.N)(e,r,"linePrefix"))},function(r){return e.enter("paragraph"),function r(n){let a=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=a),t=a,function t(n){if(null===n){e.exit("chunkText"),e.exit("paragraph"),e.consume(n);return}return(0,d.HP)(n)?(e.consume(n),e.exit("chunkText"),r):(e.consume(n),t)}(n)}(r)});return r}},f={tokenize:function(e){let t,r,n,a=this,o=[],s=0;return l;function l(t){if(s<o.length){let r=o[s];return a.containerState=r[1],e.attempt(r[0].continuation,u,c)(t)}return c(t)}function u(e){if(s++,a.containerState._closeFlow){let r;a.containerState._closeFlow=void 0,t&&b();let n=a.events.length,o=n;for(;o--;)if("exit"===a.events[o][0]&&"chunkFlow"===a.events[o][1].type){r=a.events[o][1].end;break}w(s);let l=n;for(;l<a.events.length;)a.events[l][1].end={...r},l++;return(0,i.m)(a.events,o+1,0,a.events.slice(n)),a.events.length=l,c(e)}return l(e)}function c(r){if(s===o.length){if(!t)return m(r);if(t.currentConstruct&&t.currentConstruct.concrete)return y(r);a.interrupt=!!(t.currentConstruct&&!t._gfmTableDynamicInterruptHack)}return a.containerState={},e.check(p,h,f)(r)}function h(e){return t&&b(),w(s),m(e)}function f(e){return a.parser.lazy[a.now().line]=s!==o.length,n=a.now().offset,y(e)}function m(t){return a.containerState={},e.attempt(p,g,y)(t)}function g(e){return s++,o.push([a.currentConstruct,a.containerState]),m(e)}function y(n){if(null===n){t&&b(),w(0),e.consume(n);return}return t=t||a.parser.flow(a.now()),e.enter("chunkFlow",{_tokenizer:t,contentType:"flow",previous:r}),function t(r){if(null===r){v(e.exit("chunkFlow"),!0),w(0),e.consume(r);return}return(0,d.HP)(r)?(e.consume(r),v(e.exit("chunkFlow")),s=0,a.interrupt=void 0,l):(e.consume(r),t)}(n)}function v(e,o){let l=a.sliceStream(e);if(o&&l.push(null),e.previous=r,r&&(r.next=e),r=e,t.defineSkip(e.start),t.write(l),a.parser.lazy[e.start.line]){let e,r,o=t.events.length;for(;o--;)if(t.events[o][1].start.offset<n&&(!t.events[o][1].end||t.events[o][1].end.offset>n))return;let l=a.events.length,u=l;for(;u--;)if("exit"===a.events[u][0]&&"chunkFlow"===a.events[u][1].type){if(e){r=a.events[u][1].end;break}e=!0}for(w(s),o=l;o<a.events.length;)a.events[o][1].end={...r},o++;(0,i.m)(a.events,u+1,0,a.events.slice(l)),a.events.length=o}}function w(t){let r=o.length;for(;r-- >t;){let t=o[r];a.containerState=t[1],t[0].exit.call(a,e)}o.length=t}function b(){t.write([null]),r=void 0,t=void 0,a.containerState._closeFlow=void 0}}},p={tokenize:function(e,t,r){return(0,c.N)(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}};var m=r(69782);let g={resolve:function(e){return l(e),e},tokenize:function(e,t){let r;return function(t){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),n(t)};function n(t){return null===t?a(t):(0,d.HP)(t)?e.check(y,i,a)(t):(e.consume(t),n)}function a(r){return e.exit("chunkContent"),e.exit("content"),t(r)}function i(t){return e.consume(t),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,n}}},y={partial:!0,tokenize:function(e,t,r){let n=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),
1(0,c.N)(e,a,"linePrefix")};function a(a){if(null===a||(0,d.HP)(a))return r(a);let i=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(a):e.interrupt(n.parser.constructs.flow,r,t)(a)}}},v={tokenize:function(e){let t=this,r=e.attempt(m.B,function(n){return null===n?void e.consume(n):(e.enter("lineEndingBlank"),e.consume(n),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r)},e.attempt(this.parser.constructs.flowInitial,n,(0,c.N)(e,e.attempt(this.parser.constructs.flow,n,e.attempt(g,n)),"linePrefix")));return r;function n(n){return null===n?void e.consume(n):(e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),t.currentConstruct=void 0,r)}}},w={resolveAll:S()},b=E("string"),x=E("text");function E(e){return{resolveAll:S("text"===e?k:void 0),tokenize:function(t){let r=this,n=this.parser.constructs[e],a=t.attempt(n,i,o);return i;function i(e){return l(e)?a(e):o(e)}function o(e){return null===e?void t.consume(e):(t.enter("data"),t.consume(e),s)}function s(e){return l(e)?(t.exit("data"),a(e)):(t.consume(e),s)}function l(e){if(null===e)return!0;let t=n[e],a=-1;if(t)for(;++a<t.length;){let e=t[a];if(!e.previous||e.previous.call(r,r.previous))return!0}return!1}}}}function S(e){return function(t,r){let n,a=-1;for(;++a<=t.length;)void 0===n?t[a]&&"data"===t[a][1].type&&(n=a,a++):t[a]&&"data"===t[a][1].type||(a!==n+2&&(t[n][1].end=t[a-1][1].end,t.splice(n+2,a-n-2),a=n+2),n=void 0);return e?e(t,r):t}}function k(e,t){let r=0;for(;++r<=e.length;)if((r===e.length||"lineEnding"===e[r][1].type)&&"data"===e[r-1][1].type){let n,a=e[r-1][1],i=t.sliceStream(a),o=i.length,s=-1,l=0;for(;o--;){let e=i[o];if("string"==typeof e){for(s=e.length;32===e.charCodeAt(s-1);)l++,s--;if(s)break;s=-1}else if(-2===e)n=!0,l++;else if(-1===e);else{o++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(l=0),l){let i={type:r===e.length||n||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:a.start._bufferIndex+s,_index:a.start._index+o,line:a.end.line,column:a.end.column-l,offset:a.end.offset-l},end:{...a.end}};a.end={...i.start},a.start.offset===a.end.offset?Object.assign(a,i):(e.splice(r,0,["enter",i,t],["exit",i,t]),r+=2)}r++}return e}let P={name:"thematicBreak",tokenize:function(e,t,r){let n,a=0;return function(i){var o;return e.enter("thematicBreak"),n=o=i,function i(o){return o===n?(e.enter("thematicBreakSequence"),function t(r){return r===n?(e.consume(r),a++,t):(e.exit("thematicBreakSequence"),(0,d.On)(r)?(0,c.N)(e,i,"whitespace")(r):i(r))}(o)):a>=3&&(null===o||(0,d.HP)(o))?(e.exit("thematicBreak"),t(o)):r(o)}(o)}}},C={continuation:{tokenize:function(e,t,r){let n=this;return n.containerState._closeFlow=void 0,e.check(m.B,function(r){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,(0,c.N)(e,t,"listItemIndent",n.containerState.size+1)(r)},function(r){return n.containerState.furtherBlankLines||!(0,d.On)(r)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine
1=void 0,a(r)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,e.attempt(T,t,a)(r))});function a(a){return n.containerState._closeFlow=!0,n.interrupt=void 0,(0,c.N)(e,e.attempt(C,t,r),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,r){let n=this,a=n.events[n.events.length-1],i=a&&"linePrefix"===a[1].type?a[2].sliceSerialize(a[1],!0).length:0,o=0;return function(t){let a=n.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===a?!n.containerState.marker||t===n.containerState.marker:(0,d.BM)(t)){if(n.containerState.type||(n.containerState.type=a,e.enter(a,{_container:!0})),"listUnordered"===a)return e.enter("listItemPrefix"),42===t||45===t?e.check(P,r,s)(t):s(t);if(!n.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),function t(a){return(0,d.BM)(a)&&++o<10?(e.consume(a),t):(!n.interrupt||o<2)&&(n.containerState.marker?a===n.containerState.marker:41===a||46===a)?(e.exit("listItemValue"),s(a)):r(a)}(t)}return r(t)};function s(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||t,e.check(m.B,n.interrupt?r:l,e.attempt(I,c,u))}
1function l(e){return n.containerState.initialBlankLine=!0,i++,c(e)}function u(t){return(0,d.On)(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),c):r(t)}function c(r){return n.containerState.size=i+n.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(r)}}},I={partial:!0,tokenize:function(e,t,r){let n=this;return(0,c.N)(e,function(e){let a=n.events[n.events.length-1];return!(0,d.On)(e)&&a&&"listItemPrefixWhitespace"===a[1].type?t(e):r(e)},"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},T={partial:!0,tokenize:function(e,t,r){let n=this;return(0,c.N)(e,function(e){let a=n.events[n.events.length-1];return a&&"listItemIndent"===a[1].type&&a[2].sliceSerialize(a[1],!0).length===n.containerState.size?t(e):r(e)},"listItemIndent",n.containerState.size+1)}},A={continuation:{tokenize:function(e,t,r){let n=this;return function(t){return(0,d.On)(t)?(0,c.N)(e,a,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):a(t)};function a(n){return e.attempt(A,t,r)(n)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,r){let n=this;return function(t){if(62===t){let r=n.containerState;return r.open||(e.enter("blockQuote",{_container:!0}),r.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),a}return r(t)};function a(r){return(0,d.On)(r)?(e.enter("blockQuotePrefixWhitespace"),e.consume(r),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(r))}}};function _(e,t,r,n,a,i,o,s,l){let u=l||1/0,c=0;return function(t){return 60===t?(e.enter(n),e.enter(a),e.enter(i),e.consume(t),e.exit(i),h):null===t||32===t||41===t||(0,d.JQ)(t)?r(t):(e.enter(n),e.enter(o),e.enter(s),e.enter("chunkString",{contentType:"string"}),m(t))};function h(r){return 62===r?(e.enter(i),e.consume(r),e.exit(i),e.exit(a),e.exit(n),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),f(r))}function f(t){return 62===t?(e.exit("chunkString"),e.exit(s),h(t)):null===t||60===t||(0,d.HP)(t)?r(t):(e.consume(t),92===t?p:f)}function p(t){return 60===t||62===t||92===t?(e.consume(t),f):f(t)}function m(a){return!c&&(null===a||41===a||(0,d.Ee)(a))?(e.exit("chunkString"),e.exit(s),e.exit(o),e.exit(n),t(a)):c<u&&40===a?(e.consume(a),c++,m):41===a?(e.consume(a),c--,m):null===a||32===a||40===a||(0,d.JQ)(a)?r(a):(e.consume(a),92===a?g:m)}function g(t){return 40===t||41===t||92===t?(e.consume(t),m):m(t)}}function O(e,t,r,n,a,i){let o,s=this,l=0;return function(t){return e.enter(n),e.enter(a),e.consume(t),e.exit(a),e.enter(i),u};function u(h){return l>999||null===h||91===h||93===h&&!o||94===h&&!l&&"_hiddenFootnoteSupport"in s.parser.constructs?r(h):93===h?(e.exit(i),e.enter(a),e.consume(h),e.exit(a),e.exit(n),t):(0,d.HP)(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),c(h))}function c(t){return null===t||91===t||93===t||(0,d.HP)(t)||l++>999?(e.exit("chunkString"),u(t)):(e.consume(t),o||(o=!(0,d.On)(t)),92===t?h:c)}function h(t){return 91===t||92===t||93===t?(e.consume(t),l++,c):c(t)}}function q(e,t,r,n,a,i){let o;return function(t){return 34===t||39===t||40===t?(e.enter(n),e.enter(a),e.consume(t),e.exit(a),o=40===t?41:t,s):r(t)};function s(r){return r===o?(e.enter(a),e.consume(r),e.exit(a),e.exit(n),t):(e.enter(i),l(r))}function l(t){return t===o?(e.exit(i),s(o)):null===t?r(t):(0,d.HP)(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),(0,c.N)(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(t))}function u(t){return t===o||null===t||(0,d.HP)(t)?(e.exit("chunkString"),l(t)):(e.consume(t),92===t?h:u)}function h(t){return t===o||92===t?(e.consume(t),u):u(t)}}function R(e,t){let r;return function n(a){return(0,d.HP)(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),r=!0,n):(0,d.On)(a)?(0,c.N)(e,n,r?"linePrefix":"lineSuffix")(a):t(a)}}var D=r(39895);let N={partial:!0,tokenize:function(e,t,r){return function(t){return(0,d.Ee)(t)?R(e,n)(t):r(t)};function n(t){return q(e,a,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function a(t){return(0,d.On)(t)?(0,c.N)(e,i,"whitespace")(t):i(t)}function i(e){return null===e||(0,d.HP)(e)?t(e):r(e)}}},j={name:"codeIndented",tokenize:function(e,t,r){let n=this;
1return function(t){return e.enter("codeIndented"),(0,c.N)(e,a,"linePrefix",5)(t)};function a(t){let a=n.events[n.events.length-1];return a&&"linePrefix"===a[1].type&&a[2].sliceSerialize(a[1],!0).length>=4?function t(r){return null===r?i(r):(0,d.HP)(r)?e.attempt(L,t,i)(r):(e.enter("codeFlowValue"),function r(n){return null===n||(0,d.HP)(n)?(e.exit("codeFlowValue"),t(n)):(e.consume(n),r)}(r))}(t):r(t)}function i(r){return e.exit("codeIndented"),t(r)}}},L={partial:!0,tokenize:function(e,t,r){let n=this;return a;function a(t){return n.parser.lazy[n.now().line]?r(t):(0,d.HP)(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a):(0,c.N)(e,i,"linePrefix",5)(t)}function i(e){let i=n.events[n.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?t(e):(0,d.HP)(e)?a(e):r(e)}}},M={name:"setextUnderline",resolveTo:function(e,t){let r,n,a,i=e.length;for(;i--;)if("enter"===e[i][0]){if("content"===e[i][1].type){r=i;break}"paragraph"===e[i][1].type&&(n=i)}else"content"===e[i][1].type&&e.splice(i,1),a||"definition"!==e[i][1].type||(a=i);let o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[n][1].type="setextHeadingText",a?(e.splice(n,0,["enter",o,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push(["exit",o,t]),e},tokenize:function(e,t,r){let n,a=this;return function(t){var o;let s,l=a.events.length;for(;l--;)if("lineEnding"!==a.events[l][1].type&&"linePrefix"!==a.events[l][1].type&&"content"!==a.events[l][1].type){s="paragraph"===a.events[l][1].type;break}return!a.parser.lazy[a.now().line]&&(a.interrupt||s)?(e.enter("setextHeadingLine"),n=t,o=t,e.enter("setextHeadingLineSequence"),function t(r){return r===n?(e.consume(r),t):(e.exit("setextHeadingLineSequence"),(0,d.On)(r)?(0,c.N)(e,i,"lineSuffix")(r):i(r))}(o)):r(t)};function i(n){return null===n||(0,d.HP)(n)?(e.exit("setextHeadingLine"),t(n)):r(n)}}},B=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],U=["pre","script","style","textarea"],F={partial:!0,tokenize:function(e,t,r){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),e.attempt(m.B,t,r)}}},z={partial:!0,tokenize:function(e,t,r){let n=this;return function(t){return(0,d.HP)(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a):r(t)};function a(e){return n.parser.lazy[n.now().line]?r(e):t(e)}}},V={partial:!0,tokenize:function(e,t,r){let n=this;return function(t){return null===t?r(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),a)};function a(e){return n.parser.lazy[n.now().line]?r(e):t(e)}}},W={concrete:!0,name:"codeFenced",tokenize:function(e,t,r){let n,a=this,i={partial:!0,tokenize:function(e,t,r){let i=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o};function o(t){return e.enter("codeFencedFence"),(0,d.On)(t)?(0,c.N)(e,l,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):l(t)}function l(t){return t===n?(e.enter("codeFencedFenceSequence"),function t(a){return a===n?(i++,e.consume(a),t):i>=s?(e.exit("codeFencedFenceSequence"),(0,d.On)(a)?(0,c.N)(e,u,"whitespace")(a):u(a)):r(a)}(t)):r(t)}function u(n){return null===n||(0,d.HP)(n)?(e.exit("codeFencedFence"),t(n)):r(n)}}},o=0,s=0;return function(t){var i=t;let u=a.events[a.events.length-1];return o=u&&"linePrefix"===u[1].type?u[2].sliceSerialize(u[1],!0).length:0,n=i,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),function t(a){return a===n?(s++,e.consume(a),t):s<3?r(a):(e.exit("codeFencedFenceSequence"),(0,d.On)(a)?(0,c.N)(e,l,"whitespace")(a):l(a))}(i)};function l(i){return null===i||(0,d.HP)(i)?(e.exit("codeFencedFence"),a.interrupt?t(i):e.check(V,h,g)(i)):(e.enter("co
1deFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),function t(a){return null===a||(0,d.HP)(a)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),l(a)):(0,d.On)(a)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),(0,c.N)(e,u,"whitespace")(a)):96===a&&a===n?r(a):(e.consume(a),t)}(i))}function u(t){return null===t||(0,d.HP)(t)?l(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),function t(a){return null===a||(0,d.HP)(a)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),l(a)):96===a&&a===n?r(a):(e.consume(a),t)}(t))}function h(t){return e.attempt(i,g,f)(t)}function f(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),p}function p(t){return o>0&&(0,d.On)(t)?(0,c.N)(e,m,"linePrefix",o+1)(t):m(t)}function m(t){return null===t||(0,d.HP)(t)?e.check(V,h,g)(t):(e.enter("codeFlowValue"),function t(r){return null===r||(0,d.HP)(r)?(e.exit("codeFlowValue"),m(r)):(e.consume(r),t)}(t))}function g(r){return e.exit("codeFenced"),t(r)}}};var H=r(85583);let G={name:"characterReference",tokenize:function(e,t,r){let n,a,i=this,o=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),s};function s(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),n=31,a=d.lV,u(t))}function l(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),n=6,a=d.ok,u):(e.enter("characterReferenceValue"),n=7,a=d.BM,u(t))}function u(s){if(59===s&&o){let n=e.exit("characterReferenceValue");return a!==d.lV||(0,H.s)(i.sliceSerialize(n))?(e.enter("characterReferenceMarker"),e.consume(s),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):r(s)}return a(s)&&o++<n?(e.consume(s),u):r(s)}}},Q={name:"characterEscape",tokenize:function(e,t,r){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),n};function n(n){return(0,d.ol)(n)?(e.enter("characterEscapeValue"),e.consume(n),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):r(n)}}},K={name:"lineEnding",tokenize:function(e,t){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),(0,c.N)(e,t,"linePrefix")}}};var $=r(33338);let Y={name:"labelEnd",resolveAll:function(e){let t=-1,r=[];for(;++t<e.length;){let n=e[t][1];if(r.push(e[t]),"labelImage"===n.type||"labelLink"===n.type||"labelEnd"===n.type){let e="labelImage"===n.type?4:2;n.type="data",t+=e}}return e.length!==r.length&&(0,i.m)(e,0,e.length,r),e},resolveTo:function(e,t){let r,n,a,o,s=e.length,l=0;for(;s--;)if(r=e[s][1],n){if("link"===r.type||"labelLink"===r.type&&r._inactive)break;"enter"===e[s][0]&&"labelLink"===r.type&&(r._inactive=!0)}else if(a){if("enter"===e[s][0]&&("labelImage"===r.type||"labelLink"===r.type)&&!r._balanced&&(n=s,"labelLink"!==r.type)){l=2;break}}else"labelEnd"===r.type&&(a=s);let u={type:"labelLink"===e[n][1].type?"link":"image",start:{...e[n][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[n][1].start},end:{...e[a][1].end}},d={type:"labelText",start:{...e[n+l+2][1].end},end:{...e[a-2][1].start}};return o=[["enter",u,t],["enter",c,t]],o=(0,i.V)(o,e.slice(n+1,n+l+3)),o=(0,i.V)(o,[["enter",d,t]]),o=(0,i.V)(o,(0,$.W)(t.parser.constructs.insideSpan.null,e.slice(n+l+4,a-3),t)),o=(0,i.V)(o,[["exit",d,t],e[a-2],e[a-1],["exit",c,t]]),o=(0,i.V)(o,e.slice(a+1)),o=(0,i.V)(o,[["exit",u,t]]),(0,i.m)(e,n,e.length,o),e},tokenize:function(e,t,r){let n,a,i=this,o=i.events.length;for(;o--;)if(("labelImage"===i.events[o][1].type||"labelLink"===i.events[o][1].type)&&!i.events[o][1]._balanced){n=i.events[o][1];break}return function(t){return n?n._inactive?c(t):(a=i.parser.defined.includes((0,D.B)(i.sliceSerialize({start:n.end,end:i.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),s):r(t)};function s(t){return 40===t?e.attempt(J,u,a?u:c)(t):91===t?e.attempt(X,u,a?l:c)(t):a?u(t):c(t)}function l(t){return e.attempt(Z,u,c)(t)}function u(e){return t(e)}function c(e){return n._balanced=!0,r(e)}}},J={tokenize:function(e,t,r){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),n};function n(t){return(0,d.Ee)(t)?R(e,a)(t):a(t)}function a(t){return 41===t?u(t):_(e,i,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function i(t){return(0,d.Ee)(t)?R(e,s)(t):u(t)}function o(e){return r(e)}function s(t){return 34===t||39===t||40===t?q(e,l,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):u(t)}function l(t){return(0,d.Ee)(t)?R(e,u)(t):u(t)}function u(n){return 41===n?(e.enter("resourceMarker"),e.consume(n),e.exit("resourceMarker"),e.exit("resource"),t):r(n)}}},X={tokenize:function(e,t,r){let n=this;return function(t){return O.call(n,e,a,i,"reference","referenceMarker","referenceString")(t)};function a(e){return n.parser.defined.includes((0,D.B)(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?t(e):r(e)}function i(e){return r(e)}}},Z={tokenize:function(e,t,r){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),n};function n(n){return 93===n?(e.enter("referenceMarker"),e.consume(n),e.exit("referenceMarker"),e.exit("reference"),t):r(n)}}},ee={name:"labelStartImage",resolveAll:Y.resolveAll,tokenize:function(e,t,r){let n=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),a};function a(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),i):r(t)}function i(e){return 94===e&&"_hiddenFootnoteSupport"in n.parser.constructs?r(e):t(e)}}};var et=r(74358);
1let er={name:"attention",resolveAll:function(e,t){let r,n,a,o,s,l,u,c,d=-1;for(;++d<e.length;)if("enter"===e[d][0]&&"attentionSequence"===e[d][1].type&&e[d][1]._close){for(r=d;r--;)if("exit"===e[r][0]&&"attentionSequence"===e[r][1].type&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[d][1]).charCodeAt(0)){if((e[r][1]._close||e[d][1]._open)&&(e[d][1].end.offset-e[d][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[d][1].end.offset-e[d][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[d][1].end.offset-e[d][1].start.offset>1?2:1;let h={...e[r][1].end},f={...e[d][1].start};en(h,-l),en(f,l),o={type:l>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},s={type:l>1?"strongSequence":"emphasisSequence",start:{...e[d][1].start},end:f},a={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[d][1].start}},n={type:l>1?"strong":"emphasis",start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[d][1].start={...s.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=(0,i.V)(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=(0,i.V)(u,[["enter",n,t],["enter",o,t],["exit",o,t],["enter",a,t]]),u=(0,i.V)(u,(0,$.W)(t.parser.constructs.insideSpan.null,e.slice(r+1,d),t)),u=(0,i.V)(u,[["exit",a,t],["enter",s,t],["exit",s,t],["exit",n,t]]),e[d][1].end.offset-e[d][1].start.offset?(c=2,u=(0,i.V)(u,[["enter",e[d][1],t],["exit",e[d][1],t]])):c=0,(0,i.m)(e,r-1,d-r+3,u),d=r+u.length-c-2;break}}for(d=-1;++d<e.length;)"attentionSequence"===e[d][1].type&&(e[d][1].type="data");return e},tokenize:function(e,t){let r,n=this.parser.constructs.attentionMarkers.null,a=this.previous,i=(0,et.S)(a);return function(o){return r=o,e.enter("attentionSequence"),function o(s){if(s===r)return e.consume(s),o;let l=e.exit("attentionSequence"),u=(0,et.S)(s),c=!u||2===u&&i||n.includes(s),d=!i||2===i&&u||n.includes(a);return l._open=!!(42===r?c:c&&(i||!d)),l._close=!!(42===r?d:d&&(u||!c)),t(s)}(o)}}};function en(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}let ea={name:"labelStartLink",resolveAll:Y.resolveAll,tokenize:function(e,t,r){let n=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),a};function a(e){return 94===e&&"_hiddenFootnoteSupport"in n.parser.constructs?r(e):t(e)}}},ei={42:C,43:C,45:C,48:C,49:C,50:C,51:C,52:C,53:C,54:C,55:C,56:C,57:C,62:A},eo={91:{name:"definition",tokenize:function(e,t,r){let n,a=this;return function(t){var n;return e.enter("definition"),n=t,O.call(a,e,i,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(n)};function i(t){return(n=(0,D.B)(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),58===t)?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),o):r(t)}function o(t){return(0,d.Ee)(t)?R(e,s)(t):s(t)}function s(t){return _(e,l,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function l(t){return e.attempt(N,u,u)(t)}function u(t){return(0,d.On)(t)?(0,c.N)(e,h,"whitespace")(t):h(t)}function h(i){return null===i||(0,d.HP)(i)?(e.exit("definition"),a.parser.defined.push(n),t(i)):r(i)}}}},es={[-2]:j,[-1]:j,32:j},el={35:{name:"headingAtx",resolve:function(e,t){let r,n,a=e.length-2,o=3;return"whitespace"===e[3][1].type&&(o+=2),a-2>o&&"whitespace"===e[a][1].type&&(a-=2),"atxHeadingSequence"===e[a][1].type&&(o===a-1||a-4>o&&"whitespace"===e[a-2][1].type)&&(a-=o+1===a?2:4),a>o&&(r={type:"atxHeadingText",start:e[o][1].start,end:e[a][1].end},n={type:"chunkText",start:e[o][1].start,end:e[a][1].end,contentType:"text"},(0,i.m)(e,o,a-o+1,[["enter",r,t],["enter",n,t],["exit",n,t],["exit",r,t]])),e},tokenize:function(e,t,r){let n=0;return function(a){var i;return e.enter("atxHeading"),i=a,e.enter("atxHeadingSequence"),function a(i){return 35===i&&n++<6?(e.consume(i),a):null===i||(0,d.Ee)(i)?(e.exit("atxHeadingSequence"),function r(n){return 35===n?(e.enter("atxHeadingSequence"),function t(n){return 35===n?(e.consume(n),t):(e.exit("atxHeadingSequence"),r(n))}(n)):null===n||(0,d.HP)(n)?(e.exit("atxHeading"),t(n)):(0,d.On)(n)?(0,c.N)(e,r,"whitespace")(n):(e.enter("atxHeadingText"),function t(n){return null===n||35===n||(0,d.Ee)(n)?(e.exit("atxHeadingText"),r(n)):(e.consume(n),t)}(n))}(i)):r(i)}(i)}}},42:P,45:[M,P],60:{concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e},tokenize:function(e,t,r){let n,a,i,o,s,l=this;return function(t){var r;return r=t,e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(r),u};function u(o){return 33===o?(e.consume(o),c):47===o?(e.consume(o),a=!0,p):63===o?(e.consume(o),n=3,l.interrupt?t:R):(0,d.CW)(o)?(e.consume(o),i=String.fromCharCode(o),m):r(o)}function c(a){return 45===a?(e.consume(a),n=2,h):91===a?(e.consume(a),n=5,o=0,f):(0,d.CW)(a)?(e.consume(a),n=4,l.interrupt?t:R):r(a)}function h(n){return 45===n?(e.consume(n),l.interrupt?t:R):r(n)}function f(n){let a="CDATA[";
1return n===a.charCodeAt(o++)?(e.consume(n),o===a.length)?l.interrupt?t:P:f:r(n)}function p(t){return(0,d.CW)(t)?(e.consume(t),i=String.fromCharCode(t),m):r(t)}function m(o){if(null===o||47===o||62===o||(0,d.Ee)(o)){let s=47===o,u=i.toLowerCase();return!s&&!a&&U.includes(u)?(n=1,l.interrupt?t(o):P(o)):B.includes(i.toLowerCase())?(n=6,s)?(e.consume(o),g):l.interrupt?t(o):P(o):(n=7,l.interrupt&&!l.parser.lazy[l.now().line]?r(o):a?function t(r){return(0,d.On)(r)?(e.consume(r),t):S(r)}(o):y(o))}return 45===o||(0,d.lV)(o)?(e.consume(o),i+=String.fromCharCode(o),m):r(o)}function g(n){return 62===n?(e.consume(n),l.interrupt?t:P):r(n)}function y(t){return 47===t?(e.consume(t),S):58===t||95===t||(0,d.CW)(t)?(e.consume(t),v):(0,d.On)(t)?(e.consume(t),y):S(t)}function v(t){return 45===t||46===t||58===t||95===t||(0,d.lV)(t)?(e.consume(t),v):w(t)}function w(t){return 61===t?(e.consume(t),b):(0,d.On)(t)?(e.consume(t),w):y(t)}function b(t){return null===t||60===t||61===t||62===t||96===t?r(t):34===t||39===t?(e.consume(t),s=t,x):(0,d.On)(t)?(e.consume(t),b):function t(r){return null===r||34===r||39===r||47===r||60===r||61===r||62===r||96===r||(0,d.Ee)(r)?w(r):(e.consume(r),t)}(t)}function x(t){return t===s?(e.consume(t),s=null,E):null===t||(0,d.HP)(t)?r(t):(e.consume(t),x)}function E(e){return 47===e||62===e||(0,d.On)(e)?y(e):r(e)}function S(t){return 62===t?(e.consume(t),k):r(t)}function k(t){return null===t||(0,d.HP)(t)?P(t):(0,d.On)(t)?(e.consume(t),k):r(t)}function P(t){return 45===t&&2===n?(e.consume(t),A):60===t&&1===n?(e.consume(t),_):62===t&&4===n?(e.consume(t),D):63===t&&3===n?(e.consume(t),R):93===t&&5===n?(e.consume(t),q):(0,d.HP)(t)&&(6===n||7===n)?(e.exit("htmlFlowData"),e.check(F,N,C)(t)):null===t||(0,d.HP)(t)?(e.exit("htmlFlowData"),C(t)):(e.consume(t),P)}function C(t){return e.check(z,I,N)(t)}function I(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),T}function T(t){return null===t||(0,d.HP)(t)?C(t):(e.enter("htmlFlowData"),P(t))}function A(t){return 45===t?(e.consume(t),R):P(t)}function _(t){return 47===t?(e.consume(t),i="",O):P(t)}function O(t){if(62===t){let r=i.toLowerCase();return U.includes(r)?(e.consume(t),D):P(t)}return(0,d.CW)(t)&&i.length<8?(e.consume(t),i+=String.fromCharCode(t),O):P(t)}function q(t){return 93===t?(e.consume(t),R):P(t)}function R(t){return 62===t?(e.consume(t),D):45===t&&2===n?(e.consume(t),R):P(t)}function D(t){return null===t||(0,d.HP)(t)?(e.exit("htmlFlowData"),N(t)):(e.consume(t),D)}function N(r){return e.exit("htmlFlow"),t(r)}}},61:M,95:P,96:W,126:W},eu={38:G,92:Q},ec={[-5]:K,[-4]:K,[-3]:K,33:ee,38:G,42:er,60:[{name:"autolink",tokenize:function(e,t,r){let n=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a};function a(t){return(0,d.CW)(t)?(e.consume(t),i):64===t?r(t):s(t)}function i(t){return 43===t||45===t||46===t||(0,d.lV)(t)?(n=1,function t(r){return 58===r?(e.consume(r),n=0,o):(43===r||45===r||46===r||(0,d.lV)(r))&&n++<32?(e.consume(r),t):(n=0,s(r))}(t)):s(t)}function o(n){return 62===n?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(n),e.exit("autolinkMarker"),e.exit("autolink"),t):null===n||32===n||60===n||(0,d.JQ)(n)?r(n):(e.consume(n),o)}function s(t){return 64===t?(e.consume(t),l):(0,d.cx)(t)?(e.consume(t),s):r(t)}function l(a){return(0,d.lV)(a)?function a(i){return 46===i?(e.consume(i),n=0,l):62===i?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(i),e.exit("autolinkMarker"),e.exit("autolink"),t):function t(i){if((45===i||(0,d.lV)(i))&&n++<63){let r=45===i?t:a;return e.consume(i),r}return r(i)}(i)}(a):r(a)}}},{name:"htmlText",tokenize:function(e,t,r){let n,a,i,o=this;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),s};function s(t){return 33===t?(e.consume(t),l):47===t?(e.consume(t),E):63===t?(e.consume(t),b):(0,d.CW)(t)?(e.consume(t),k):r(t)}function l(t){return 45===t?(e.consume(t),u):91===t?(e.consume(t),a=0,m):(0,d.CW)(t)?(e.consume(t),w):r(t)}function u(t){return 45===t?(e.consume(t),p):r(t)}function h(t){return null===t?r(t):45===t?(e.consume(t),f):(0,d.HP)(t)?(i=h,q(t)):(e.consume(t),h)}function f(t){return 45===t?(e.consume(t),p):h(t)}function p(e){return 62===e?O(e):45===e?f(e):h(e)}function m(t){let n="CDATA[";return t===n.charCodeAt(a++)?(e.consume(t),a===n.length?g:m):r(t)}function g(t){return null===t?r(t):93===t?(e.consume(t),y):(0,d.HP)(t)?(i=g,q(t)):(e.consume(t),g)}function y(t){return 93===t?(e.consume(t),v):g(t)}function v(t){return 62===t?O(t):93===t?(e.consume(t),v):g(t)}function w(t){return null===t||62===t?O(t):(0,d.HP)(t)?(i=w,q(t)):(e.consume(t),w)}function b(t){return null===t?r(t):63===t?(e.consume(t),x):(0,d.HP)(t)?(i=b,q(t)):(e.consume(t),b)}function x(e){return 62===e?O(e):b(e)}function E(t){return(0,d.CW)(t)?(e.consume(t),S):r(t)}function S(t){return 45===t||(0,d.lV)(t)?(e.consume(t),S):function t(r){return(0,d.HP)(r)?(i=t,q(r)):(0,d.On)(r)?(e.consume(r),t):O(r)}(t)}function k(t){return 45===t||(0,d.lV)(t)?(e.consume(t),k):47===t||62===t||(0,d.Ee)(t)?P(t):r(t)}function P(t){return 47===t?(e.consume(t),O):58===t||95===t||(0,d.CW)(t)?(e.consume(t),C):(0,d.HP)(t)?(i=P,q(t)):(0,d.On)(t)?(e.consume(t),P):O(t)}function C(t){return 45===t||46===t||58===t||95===t||(0,d.lV)(t)?(e.consume(t),C):function t(r){return 61===r?(e.consume(r),I):(0,d.HP)(r)?(i=t,q(r)):(0,d.On)(r)?(e.consume(r),t):P(r)}(t)}function I(t){return null===t||60===t||61===t||62===t||96===t?r(t):34===t||39===t?(e.consume(t),n=t,T):(0,d.HP)(t)?(i=I,q(t)):(0,d.On)(t)?(e.consume(t),I):(e.consume(t),A)}function T(t){return t===n?(e.consume(t),n=void 0,_):null===t?r(t):(0,d.HP)(t)?(i=T,q(t)):(e.consume(t),T)}function A(t){return null===t||34===t||39===t||60===t||61===t||96===t?r(t):47===t||62===t||(0,d.Ee)(t)?P(t):(e.consume(t),A)}function _(e){return 47===e||62===e||(0,d.Ee)(e)?P(e):r(e)}function O(n){return 62===n?(e.consume(n),e.exit("htmlTextData"),e.exit("htmlText"),t):r(n)}function q(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),R}function R(t){return(0,d.On)(t)?(0,c.N)(e,D,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):D(t)}function D(t){return e.enter("htmlTextData"),i(t)}}}],91:ea,92:[{name:"hardBreakEscape",tokenize:function(e,t,r){return function(t){return e.enter("hardBreakEscape"),e.consume(t),n};function n(n){return(0,d.HP)(n)?(e.exit("hardBreakEscape"),t(n)):r(n)}}},Q],93:Y,95:er,96:{name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,r,n=e.length-4,a=3;if(("lineEnding"===e[3][1].type||"space"===e[a][1].type)&&("lineEnding"===e[n][1].type||"space"===e[n][1].type)){for(t=a;++t<n;)if("codeTextData"===e[t][1].type){e[a][1].type="codeTextPadding",e[n][1].type="codeTextPadding",a+=2,n-=2;break}}for(t=a-1,n++;++t<=n;)void 0===r?t!==n&&"lineEnding"!==e[t][1].type&&(r=t):(t===n||"lineEnding"===e[t][1].type)&&(e[r][1].type="codeTextData",t!==r+2&&(e[r][1].end=e[t-1][1].end,e.splice(r+2,t-r-2),n-=t-r-2,t=r+2),r=void 0);return e},tokenize:function(e,t,r){let n,a,i=0;
1return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),function t(r){return 96===r?(e.consume(r),i++,t):(e.exit("codeTextSequence"),o(r))}(t)};function o(l){return null===l?r(l):32===l?(e.enter("space"),e.consume(l),e.exit("space"),o):96===l?(a=e.enter("codeTextSequence"),n=0,function r(o){return 96===o?(e.consume(o),n++,r):n===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(o)):(a.type="codeTextData",s(o))}(l)):(0,d.HP)(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):(e.enter("codeTextData"),s(l))}function s(t){return null===t||32===t||96===t||(0,d.HP)(t)?(e.exit("codeTextData"),o(t)):(e.consume(t),s)}}}},ed={null:[er,w]},eh={null:[42,95]},ef={null:[]},ep=/[\0\t\n\r]/g;var em=r(11252),eg=r(34424),ey=r(30649);let ev={}.hasOwnProperty;function ew(e){return{line:e.line,column:e.column,offset:e.offset}}function eb(e,t){if(e)throw Error("Cannot close `"+e.type+"` ("+(0,ey.L)({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+(0,ey.L)({start:t.start,end:t.end})+") is open");throw Error("Cannot close document, a token (`"+t.type+"`, "+(0,ey.L)({start:t.start,end:t.end})+") is still open")}function ex(e){let t=this;t.parser=function(r){var o,s;let c,p,m,g;return"string"!=typeof(o={...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})&&(s=o,o=void 0),(function(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:n(v),autolinkProtocol:c,autolinkEmail:c,atxHeading:n(m),blockQuote:n(function(){return{type:"blockquote",children:[]}}),characterEscape:c,characterReference:c,codeFenced:n(p),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:n(p,i),codeText:n(function(){return{type:"inlineCode",value:""}},i),codeTextData:c,data:c,codeFlowValue:c,definition:n(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:n(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:n(g),hardBreakTrailing:n(g),htmlFlow:n(y,i),htmlFlowData:c,htmlText:n(y,i),htmlTextData:c,image:n(function(){return{type:"image",title:null,url:"",alt:null}}),label:i,link:n(v),listItem:n(function(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}),listItemValue:function(e){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0)},listOrdered:n(w,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:n(w),paragraph:n(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:n(m),strong:n(function(){return{type:"strong",children:[]}}),thematicBreak:n(function(){return{type:"thematicBreak"}})},exit:{atxHeading:s(),atxHeadingSequence:function(e){let t=this.stack[this.stack.length-1];t.depth||(t.depth=this.sliceSerialize(e).length)},autolink:s(),autolinkEmail:function(e){d.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){d.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:s(),characterEscapeValue:d,characterReferenceMarkerHexadecimal:f,characterReferenceMarkerNumeric:f,characterReferenceValue:function(e){let t,r=this.sliceSerialize(e),n=this.data.characterReferenceType;n?(t=(0,em.C)(r,"characterReferenceMarkerNumeric"===n?10:16),this.data.characterReferenceType=void 0):t=(0,H.s)(r);let a=this.stack[this.stack.length-1];a.value+=t},characterReference:function(e){this.stack.pop().position.end=ew(e.end)},codeFenced:s(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}),codeFencedFence:function(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)},codeFencedFenceInfo:function(){let e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){let e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:d,codeIndented:s(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}),codeText:s(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),codeTextData:d,data:d,definition:s(),definitionDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){let t=this.resume(),r=this.stack[this.stack.length-1];r.label=t,r.identifier=(0,D.B)(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:s(),hardBreakEscape:s(h),hardBreakTrailing:s(h),htmlFlow:s(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlFlowData:d,htmlText:s(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlTextData:d,image:s(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),label:function(){let e=this.stack[this.stack.length-1],t=this.resume(),r=this.stack[this.stack.length-1];this.data.inReference=!0,"link"===r.type?r.children=e.children:r.alt=t},labelText:function(e){let t=this.sliceSerialize(e),r=this.stack[this.stack.length-2];r.label=(0,eg.s)(t),r.identifier=(0,D.B)(t).toLowerCase()},lineEnding:function(e){let r=this.stack[this.stack.length-1];if(this.data.atHardBreak){r.children[r.children.length-1].position.end=ew(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(r.type)&&(c.call(this,e),d.call(this,e))},link:s(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),listItem:s(),listOrdered:s(),listUnordered:s(),paragraph:s(),referenceString:function(e){let t=this.resume(),r=this.stack[this.stack.length-1];r.label=t,r.identifier=(0,D.B)(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"},resourceDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){this.data.inReference=void 0},setextHeading:s(function(){this.data.setextHeadingSlurpLineEnding=void 0}),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2},setextHeadingText:function(){this.data.setextHeadingSlurpLineEnding=!0},strong:s(),thematicBreak:s()}};!function e(t,r){let n=-1;for(;++n<r.length;){let a=r[n];Array.isArray(a)?e(t,a):function(e,t){let r;for(r in t)if(ev.call(t,r))switch(r){case"canContainEols":{let n=t[r];n&&e[r].push(...n);break}case"transforms":{let n=t[r];n&&e[r].push(...n);break}case"enter":case"exit":{let n=t[r];n&&Object.assign(e[r],n)}}}(t,a)}}(t,(e||{}).mdastExtensions||[]);let r={};return function(e){let n={type:"root",children:[]},a={stack:[n],tokenStack:[],config:t,enter:o,exit:l,buffer:i,resume:u,data:r},s=[],c=-1;for(;++c<e.length;)("listOrdered"===e[c][1].type||"listUnordered"===e[c][1].type)&&("enter"===e[c][0]?s.push(c):c=function(e,t,r){let n,a,i,o,s=t-1,l=-1,u=!1;for(;++s<=r;){let t=e[s];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?l++:l--,o=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(!n||o||l||i||(i=s),o=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:o=void 0}
1if(!l&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===l&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(n){let o=s;for(a=void 0;o--;){let t=e[o];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;a&&(e[a][1].type="lineEndingBlank",u=!0),t[1].type="lineEnding",a=o}else if("linePrefix"===t[1].type||"blockQuotePrefix"===t[1].type||"blockQuotePrefixWhitespace"===t[1].type||"blockQuoteMarker"===t[1].type||"listItemIndent"===t[1].type);else break}i&&(!a||i<a)&&(n._spread=!0),n.end=Object.assign({},a?e[a][1].start:t[1].end),e.splice(a||s,0,["exit",n,t[2]]),s++,r++}if("listItemPrefix"===t[1].type){let a={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};n=a,e.splice(s,0,["enter",a,t[2]]),s++,r++,i=void 0,o=!0}}}return e[t][1]._spread=u,r}(e,s.pop(),c));for(c=-1;++c<e.length;){let r=t[e[c][0]];ev.call(r,e[c][1].type)&&r[e[c][1].type].call(Object.assign({sliceSerialize:e[c][2].sliceSerialize},a),e[c][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||eb).call(a,void 0,e[0])}for(n.position={start:ew(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:ew(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},c=-1;++c<t.transforms.length;)n=t.transforms[c](n)||n;return n};function n(e,t){return function(r){o.call(this,e(r),r),t&&t.call(this,r)}}function i(){this.stack.push({type:"fragment",children:[]})}function o(e,t,r){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,r||void 0]),e.position={start:ew(t.start),end:void 0}}function s(e){return function(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let r=this.stack.pop(),n=this.tokenStack.pop();if(n)n[0].type!==e.type&&(t?t.call(this,e,n[0]):(n[1]||eb).call(this,e,n[0]));else throw Error("Cannot close `"+e.type+"` ("+(0,ey.L)({start:e.start,end:e.end})+"): itâs not open");r.position.end=ew(e.end)}function u(){return(0,a.d)(this.stack.pop())}function c(e){let t=this.stack[this.stack.length-1].children,r=t[t.length-1];r&&"text"===r.type||((r={type:"text",value:""}).position={start:ew(e.start),end:void 0},t.push(r)),this.stack.push(r)}function d(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=ew(e.end)}function h(){this.data.atHardBreak=!0}function f(e){this.data.characterReferenceType=e.type}function p(){return{type:"code",lang:null,meta:null,value:""}}function m(){return{type:"heading",depth:0,children:[]}}function g(){return{type:"break"}}function y(){return{type:"html",value:""}}function v(){return{type:"link",title:null,url:"",children:[]}}function w(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}})(s)(function(e){for(;!l(e););return e}((function(e){let t={constructs:(0,u.y)([n,...(e||{}).extensions||[]]),content:r(h),defined:[],document:r(f),flow:r(v),lazy:{},string:r(b),text:r(x)};return t;function r(e){return function(r){return function(e,t,r){let n={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0},a={},o=[],s=[],l=[],u={attempt:g(function(e,t){y(e,t.from)}),check:g(m),consume:function(e){(0,d.HP)(e)?(n.line++,n.column=1,n.offset+=-3===e?2:1,v()):-1!==e&&(n.column++,n.offset++),n._bufferIndex<0?n._index++:(n._bufferIndex++,n._bufferIndex===s[n._index].length&&(n._bufferIndex=-1,n._index++)),c.previous=e},enter:function(e,t){let r=t||{};return r.type=e,r.start=p(),c.events.push(["enter",r,c]),l.push(r),r},exit:function(e){let t=l.pop();return t.end=p(),c.events.push(["exit",t,c]),t},interrupt:g(m,{interrupt:!0})},c={code:null,containerState:{},defineSkip:function(e){a[e.line]=e.column,v()},events:[],now:p,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let r,n=-1,a=[];for(;++n<e.length;){let i,o=e[n];if("string"==typeof o)i=o;else switch(o){case -5:i="\r";break;case -4:i="\n";break;case -3:i="\r\n";break;case -2:i=t?" ":" ";break;case -1:if(!t&&r)continue;i=" ";break;default:i=String.fromCharCode(o)}r=-2===o,a.push(i)}return a.join("")}(f(e),t)},sliceStream:f,write:function(e){return(s=(0,i.V)(s,e),function(){let e;for(;n._index<s.length;){let r=s[n._index];if("string"==typeof r)for(e=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===e&&n._bufferIndex<r.length;){var t;t=r.charCodeAt(n._bufferIndex),h=h(t)}else h=h(r)}}(),null!==s[s.length-1])?[]:(y(t,0),c.events=(0,$.W)(o,c.events,c),c.events)}},h=t.tokenize.call(c,u);return t.resolveAll&&o.push(t),c;function f(e){return function(e,t){let r,n=t.start._index,a=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;if(n===i)r=[e[n].slice(a,o)];else{if(r=e.slice(n,i),a>-1){let e=r[0];"string"==typeof e?r[0]=e.slice(a):r.shift()}o>0&&r.push(e[i].slice(0,o))}return r}(s,e)}function p(){let{_bufferIndex:e,_index:t,line:r,column:a,offset:i}=n;return{_bufferIndex:e,_index:t,line:r,column:a,offset:i}}
1function m(e,t){t.restore()}function g(e,t){return function(r,a,i){var o;let s,d,h,f;return Array.isArray(r)?m(r):"tokenize"in r?m([r]):(o=r,function(e){let t=null!==e&&o[e],r=null!==e&&o.null;return m([...Array.isArray(t)?t:t?[t]:[],...Array.isArray(r)?r:r?[r]:[]])(e)});function m(e){return(s=e,d=0,0===e.length)?i:g(e[d])}function g(e){return function(r){return(f=function(){let e=p(),t=c.previous,r=c.currentConstruct,a=c.events.length,i=Array.from(l);return{from:a,restore:function(){n=e,c.previous=t,c.currentConstruct=r,c.events.length=a,l=i,v()}}}(),h=e,e.partial||(c.currentConstruct=e),e.name&&c.parser.constructs.disable.null.includes(e.name))?w(r):e.tokenize.call(t?Object.assign(Object.create(c),t):c,u,y,w)(r)}}function y(t){return e(h,f),a}function w(e){return(f.restore(),++d<s.length)?g(s[d]):i}}}function y(e,t){e.resolveAll&&!o.includes(e)&&o.push(e),e.resolve&&(0,i.m)(c.events,t,c.events.length-t,e.resolve(c.events.slice(t),c)),e.resolveTo&&(c.events=e.resolveTo(c.events,c))}function v(){n.line in a&&n.column<2&&(n.column=a[n.line],n.offset+=a[n.line]-1)}}(t,e,r)}}})(s).document().write((p=1,m="",g=!0,function(e,t,r){let n,a,i,o,s,l=[];for(e=m+("string"==typeof e?e.toString():new TextDecoder(t||void 0).decode(e)),i=0,m="",g&&(65279===e.charCodeAt(0)&&i++,g=void 0);i<e.length;){if(ep.lastIndex=i,o=(n=ep.exec(e))&&void 0!==n.index?n.index:e.length,s=e.charCodeAt(o),!n){m=e.slice(i);break}if(10===s&&i===o&&c)l.push(-3),c=void 0;else switch(c&&(l.push(-5),c=void 0),i<o&&(l.push(e.slice(i,o)),p+=o-i),s){case 0:l.push(65533),p++;break;case 9:for(a=4*Math.ceil(p/4),l.push(-2);p++<a;)l.push(-1);break;case 10:l.push(-4),p=1;break;default:c=!0,p=1}i=o+1}return r&&(c&&l.push(-5),m&&l.push(m),l.push(null)),l})(r,o,!0))))}}},10714:(e,t,r)=>{"use strict";r.d(t,{s:()=>o,t:()=>i});var n=r(14232);function a(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function i(...e){return t=>{let r=!1,n=e.map(e=>{let n=a(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){let r=n[t];"function"==typeof r?r():a(e[t],null)}}}}function o(...e){return n.useCallback(i(...e),e)}},11061:(e,t,r)=>{"use strict";r.d(t,{$:()=>u,r:()=>l});var n=r(37876),a=r(14232),i=r(82987),o=r(47137),s=r(45195);let l=(0,o.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-border dark:bg-background/70 dark:hover:bg-accent/80 dark:hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/80 dark:hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline cursor-pointer"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}}),u=a.forwardRef(function(e,t){let{className:r,variant:a,size:o,asChild:u=!1,...c}=e,d=u?i.DX:"button";return(0,n.jsx)(d,{ref:t,"data-slot":"button",className:(0,s.cn)(l({variant:a,size:o,className:r})),...c})});u.displayName="Button"},11252:(e,t,r)=>{"use strict";function n(e,t){let r=Number.parseInt(e,t);return r<9||11===r||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(65535&r)==65535||(65535&r)==65534||r>1114111?"�":String.fromCodePoint(r)}r.d(t,{C:()=>n})},11629:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(14232);let a=n.forwardRef(function(e,t){let{title:r,titleId:a,...i}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":a},i),r?n.createElement("title",{id:a},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18
118 6M6 6l12 12"}))})},11897:(e,t,r)=>{"use strict";r.d(t,{CJ:()=>o,Q9:()=>i,dI:()=>a,we:()=>n});let n=!0,a=!0,i=3,o=5},12572:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(17963).A)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]])},13332:(e,t,r)=>{"use strict";function n(e){if(e)throw e}r.d(t,{l:()=>d});var a=r(99735),i=r(3610);function o(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}var s=r(65721);let l=function(e){let t=this.constructor.prototype,r=t[e],n=function(){return r.apply(n,arguments)};return Object.setPrototypeOf(n,t),n},u={}.hasOwnProperty;class c extends l{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=function(){let e=[],t={run:function(...t){let r=-1,n=t.pop();if("function"!=typeof n)throw TypeError("Expected function as last argument, not "+n);!function a(i,...o){let s=e[++r],l=-1;if(i)return void n(i);for(;++l<t.length;)(null===o[l]||void 0===o[l])&&(o[l]=t[l]);t=o,s?(function(e,t){let r;return function(...t){let i,o=e.length>t.length;o&&t.push(n);try{i=e.apply(this,t)}catch(e){if(o&&r)throw e;return n(e)}o||(i&&i.then&&"function"==typeof i.then?i.then(a,n):i instanceof Error?n(i):a(i))};function n(e,...a){r||(r=!0,t(e,...a))}function a(e){n(null,e)}})(s,a)(...o):n(null,...o)}(null,...t)},use:function(r){if("function"!=typeof r)throw TypeError("Expected `middelware` to be a function, not "+r);return e.push(r),t}};return t}()}copy(){let e=new c,t=-1;for(;++t<this.attachers.length;){let r=this.attachers[t];e.use(...r)}return e.data(a(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2==arguments.length?(p("data",this.frozen),this.namespace[e]=t,this):u.call(this.namespace,e)&&this.namespace[e]||void 0:e?(p("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;for(;++this.freezeIndex<this.attachers.length;){let[e,...t]=this.attachers[this.freezeIndex];if(!1===t[0])continue;!0===t[0]&&(t[0]=void 0);let r=e.call(this,...t);"function"==typeof r&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=y(e),r=this.parser||this.Parser;return h("parse",r),r(String(t),t)}process(e,t){let r=this;return this.freeze(),h("process",this.parser||this.Parser),f("process",this.compiler||this.Compiler),t?n(void 0,t):new Promise(n);function n(n,a){let o=y(e),s=r.parse(o);function l(e,r){e||!r?a(e):n?n(r):((0,i.ok)(t,"`done` is defined if `resolve` is not"),t(void 0,r))}r.run(s,o,function(e,t,n){var a,i;if(e||!t||!n)return l(e);let o=r.stringify(t,n);"string"==typeof(a=o)||(i=a)&&"object"==typeof i&&"byteLength"in i&&"byteOffset"in i?n.value=o:n.result=o,l(e,n)})}}processSync(e){let t,r=!1;return this.freeze(),h("processSync",this.parser||this.Parser),f("processSync",this.compiler||this.Compiler),this.process(e,function(e,a){r=!0,n(e),t=a}),g("processSync","process",r),(0,i.ok)(t,"we either bailed on an error or have a tree"),t}run(e,t,r){m(e),this.freeze();let n=this.transformers;return r||"function"!=typeof t||(r=t,t=void 0),r?a(void 0,r):new Promise(a);function a(a,o){(0,i.ok)("function"!=typeof t,"`file` canât be a `done` anymore, we checked");let s=y(t);n.run(e,s,function(t,n,s){let l=n||e;t?o(t):a?a(l):((0,i.ok)(r,"`done` is defined if `resolve` is not"),r(void 0,l,s))})}}runSync(e,t){let r,a=!1;return this.run(e,t,function(e,t){n(e),r=t,a=!0}),g("runSync","run",a),(0,i.ok)(r,"we either bailed on an error or have a tree"),r}stringify(e,t){this.freeze();let r=y(t),n=this.compiler||this.Compiler;return f("stringify",n),m(e),n(e,r)}use(e,...t){let r=this.attachers,n=this.namespace;if(p("use",this.frozen),null==e);else if("function"==typeof e)l(e,t);else if("object"==typeof e)Array.isArray(e)?s(e):i(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(!("plugins"in e)&&!("settings"in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");s(e.plugins),e.settings&&(n.settings=a(!0,n.settings,e.settings))}function s(e){let t=-1;if(null==e);else if(Array.isArray(e))for(;++t<e.length;){var r=e[t];if("function"==typeof r)l(r,[]);else if("object"==typeof r)if(Array.isArray(r)){let[e,...t]=r;l(e,t)}else i(r);else throw TypeError("Expected usable value, not `"+r+"`")}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function l(e,t){let n=-1,i=-1;for(;++n<r.length;)if(r[n][0]===e){i=n;break}if(-1===i)r.push([e,...t]);else if(t.length>0){let[n,...s]=t,l=r[i][1];o(l)&&o(n)&&(n=a(!0,l,n)),r[i]=[e,n,...s]}}}}let d=new c().freeze();function h(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `parser`")}function f(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `compiler`")}function p(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function m(e){if(!o(e)||"string"!=typeof e.type)throw TypeError("Expected node, got `"+e+"`")}function g(e,t,r){if(!r)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function y(e){var t;return(t=e)&&"object"==typeof t&&"message"in t&&"messages"in t?e:new s.T(e)}},14e3:(e,t,r)=>{e.exports=r(95092)},14159:(e,t,r)=>{"use strict";
1Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{ServerInsertedHTMLContext:function(){return a},useServerInsertedHTML:function(){return i}});let n=r(63732)._(r(14232)),a=n.default.createContext(null);function i(e){let t=(0,n.useContext)(a);t&&t(e)}},14455:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>c});let n="object"==typeof self?self:globalThis,a=e=>((e,t)=>{let r=(t,r)=>(e.set(r,t),t),a=i=>{if(e.has(i))return e.get(i);let[o,s]=t[i];switch(o){case 0:case -1:return r(s,i);case 1:{let e=r([],i);for(let t of s)e.push(a(t));return e}case 2:{let e=r({},i);for(let[t,r]of s)e[a(t)]=a(r);return e}case 3:return r(new Date(s),i);case 4:{let{source:e,flags:t}=s;return r(new RegExp(e,t),i)}case 5:{let e=r(new Map,i);for(let[t,r]of s)e.set(a(t),a(r));return e}case 6:{let e=r(new Set,i);for(let t of s)e.add(a(t));return e}case 7:{let{name:e,message:t}=s;return r(new n[e](t),i)}case 8:return r(BigInt(s),i);case"BigInt":return r(Object(BigInt(s)),i);case"ArrayBuffer":return r(new Uint8Array(s).buffer,s);case"DataView":{let{buffer:e}=new Uint8Array(s);return r(new DataView(e),s)}}return r(new n[o](s),i)};return a})(new Map,e)(0),{toString:i}={},{keys:o}=Object,s=e=>{let t=typeof e;if("object"!==t||!e)return[0,t];let r=i.call(e).slice(8,-1);switch(r){case"Array":return[1,""];case"Object":return[2,""];case"Date":return[3,""];case"RegExp":return[4,""];case"Map":return[5,""];case"Set":return[6,""];case"DataView":return[1,r]}return r.includes("Array")?[1,r]:r.includes("Error")?[7,r]:[2,r]},l=([e,t])=>0===e&&("function"===t||"symbol"===t),u=(e,{json:t,lossy:r}={})=>{let n=[];return((e,t,r,n)=>{let a=(e,t)=>{let a=n.push(e)-1;return r.set(t,a),a},i=n=>{if(r.has(n))return r.get(n);let[u,c]=s(n);switch(u){case 0:{let t=n;switch(c){case"bigint":u=8,t=n.toString();break;case"function":case"symbol":if(e)throw TypeError("unable to serialize "+c);t=null;break;case"undefined":return a([-1],n)}return a([u,t],n)}case 1:{if(c){let e=n;return"DataView"===c?e=new Uint8Array(n.buffer):"ArrayBuffer"===c&&(e=new Uint8Array(n)),a([c,[...e]],n)}let e=[],t=a([u,e],n);for(let t of n)e.push(i(t));return t}case 2:{if(c)switch(c){case"BigInt":return a([c,n.toString()],n);case"Boolean":case"Number":case"String":return a([c,n.valueOf()],n)}if(t&&"toJSON"in n)return i(n.toJSON());let r=[],d=a([u,r],n);for(let t of o(n))(e||!l(s(n[t])))&&r.push([i(t),i(n[t])]);return d}case 3:return a([u,n.toISOString()],n);case 4:{let{source:e,flags:t}=n;return a([u,{source:e,flags:t}],n)}case 5:{let t=[],r=a([u,t],n);for(let[r,a]of n)(e||!(l(s(r))||l(s(a))))&&t.push([i(r),i(a)]);return r}case 6:{let t=[],r=a([u,t],n);for(let r of n)(e||!l(s(r)))&&t.push(i(r));return r}}let{message:d}=n;return a([u,{name:c,message:d}],n)};return i})(!(t||r),!!t,new Map,n)(e),n},c="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?a(u(e,t)):structuredClone(e):(e,t)=>a(u(e,t))},15444:(e,t,r)=>{"use strict";function n(e){let t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function a(e){return e.join(" ").trim()}r.d(t,{A:()=>a,q:()=>n})},15707:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>l,identifyUser:()=>b,init:()=>x,parseStripeSession:()=>E,setStatsigClient:()=>S,trackCTAClick:()=>k,trackCompleteRegistration:()=>y,trackCourseRSVP:()=>g,trackEvent:()=>h,trackInitiateCheckout:()=>d,trackLead:()=>v,trackMenuClick:()=>P,trackPageView:()=>u,trackPageViewCours:()=>C,trackProductEvent:()=>I,trackPurchase:()=>c,trackSignIn:()=>p,trackSignUp:()=>f,trackSubscribe:()=>m,trackVideoPlay:()=>w});var n=r(59911),a=r(65364);let i=new Set(["AddPaymentInfo","AddToCart","AddToWishlist","CompleteRegistration","Contact","CustomizeProduct","Donate","FindLocation","InitiateCheckout","Lead","PageView","Purchase","Schedule","Search","StartTrial","SubmitApplication","Subscribe","ViewContent"]);class o{checkIfLocalhost(){if(!window.location)return!1;let e=window.location.hostname||"";return"localhost"===e||"127.0.0.1"===e||e.startsWith("192.168.")||e.includes("ngrok-free.app")}trackUmami(e,t){if(!this.isLocalhost)try{var r;null==(r=window.umami)||r.track(e,t)}catch(e){}}setStatsigClient(e){this.statsigClient=e}init(){this.isInitialized||(this.isProduction&&!(0,n.OY)()&&(this.initGoogleAnalytics(),this.initGoogleTagManager(),this.initFacebookPixel()),this.initVercelAnalytics(),this.isInitialized=!0)}initVercelAnalytics(){try{r.e(7289).then(r.bind(r,27289)).then(e=>{let{track:t}=e;this.vercelTrack=t}).catch(()=>{console.log("[Analytics] @vercel/analytics non disponible c\xf4t\xe9 client")}
1)}catch(e){}}initGoogleAnalytics(){if(window.gtag)return;let e=document.createElement("script");function t(){dataLayer.push(arguments)}e.async=!0,e.src="https://www.googletagmanager.com/gtag/js?id=".concat(this.gaId),document.head.appendChild(e),window.dataLayer=window.dataLayer||[],window.gtag=t,t("js",new Date),t("config",this.gaId,{send_page_view:!0,allow_google_signals:!0,allow_ad_personalization_signals:!0})}initGoogleTagManager(){if(window.dataLayer&&window.dataLayer.find(e=>"gtm.js"===e.event))return;window.dataLayer=window.dataLayer||[],window.dataLayer.push({"gtm.start":new Date().getTime(),event:"gtm.js"});let e=document.createElement("script");e.innerHTML="(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':\n new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],\n j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=\n 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);\n })(window,document,'script','dataLayer','".concat(this.gtmId,"');"),document.head.appendChild(e);let t=document.createElement("noscript"),r=document.createElement("iframe");r.src="https://www.googletagmanager.com/ns.html?id=".concat(this.gtmId),r.height="0",r.width="0",r.style.display="none",r.style.visibility="hidden",t.appendChild(r),document.body.firstChild?document.body.insertBefore(t,document.body.firstChild):document.body.appendChild(t)}initFacebookPixel(){if(this.isProduction&&!window.fbq){var e,t,r,n,a;e=window,t=document,e.fbq||(r=e.fbq=function(){r.callMethod?r.callMethod.apply(r,arguments):r.queue.push(arguments)},e._fbq||(e._fbq=r),r.push=r,r.loaded=!0,r.version="2.0",r.queue=[],(n=t.createElement("script")).async=!0,n.src="https://connect.facebook.net/en_US/fbevents.js",(a=t.getElementsByTagName("script")[0]).parentNode.insertBefore(n,a)),window.fbq("init",this.fbPixelId),window.fbq("track","PageView")}}identifyUser(e){if(!e)return;let t=e.basicId?String(e.basicId):e._id?String(e._id):e.id?String(e.id):null;if(this.userId===t)return;this.userId=t;let r=String(t);if(this.isProduction&&window.gtag){var n;window.gtag("config",this.gaId,{user_id:r,custom_map:{custom_parameter_user_type:(null==(n=e.roles)?void 0:n[0])||"unknown"}})}if(window.fbq){let r={em:e.email,fn:e.firstname,ln:e.lastname,external_id:t||void 0};window.fbq("init",this.fbPixelId,r)}}trackPageView(e){this.isProduction&&window.gtag&&window.gtag("config",this.gaId,{page_path:e}),this.isProduction&&window.fbq&&window.fbq("track","PageView"),this.isProduction&&window.dataLayer&&window.dataLayer.push({event:"page_view",page_path:e})}trackPageViewCours(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{courseId:t,courseName:r,courseCategory:n="formation",courseSlug:a,instructorName:i,coursePrice:o,courseDuration:s,courseLevel:l,userId:u=this.userId,eventId:c=null}=e,d=c||this.generateEventId("PageView_Cours",u||this.userId);if(this.isProduction&&window.gtag&&window.gtag("event","PageView_cours",{course_id:t,course_name:r,course_category:n,course_slug:a,instructor:i,course_price:o,course_duration:s,course_level:l,user_id:u}),this.isProduction&&window.fbq&&window.fbq("trackCustom","PageView_cours",{content_name:r,content_category:n,content_ids:[t],content_type:"product",value:o,currency:"EUR",user_id:u},{eventID:d}),this.isProduction&&window.dataLayer&&window.dataLayer.push({event:"PageView_cours",course_id:t,course_name:r,course_category:n,course_slug:a,instructor:i,course_price:o,course_duration:s,course_level:l,user_id:u}),this.statsigClient&&!this.isLocalhost)try{this.statsigClient.logEvent("PageView_cours",{course_id:t,course_name:r,course_category:n,course_slug:a,instructor:i,course_price:o,course_duration:s,course_level:l,user_id:u})}catch(e){console.warn("[Analytics] Erreur lors de l'envoi PageViewCours vers Statsig:",e)}return this.trackVercelEvent("PageView_cours",{courseId:t,courseName:r,courseCategory:n,courseSlug:a,instructorName:i,coursePrice:o,courseDuration:s,courseLevel:l,userId:u}),{eventId:d,fbp:this.getFBP(),fbc:this.getFBC()}}trackPurchase(e){var t,r,n,a,i,o,s,l,u,c,d,h,f,p,m,g,y,v,w,b,x,E,S,k,P;let{valueCents:C,valueEuros:I,value:T,currency:A="EUR",transactionId:_,items:O=[],userId:q=this.userId,eventId:R=null,valueInCents:D=!1}=e,N=this.resolveAmountDivisor(e,"trackPurchase"),j=null!=(t=null!=C?C:I)?t:T,L=null==N||null==j?null:j/N,M=e=>null==e||null==N?L:e/N,B=(e,t)=>null==t?{}:{[e]:t},U=R||(_?"Purchase_".concat(_):this.generateEventId("Purchase",q||this.userId));if(this.isProduction&&window.fbq){let e={...B("value",L),...null==L?{}:{currency:A},content_type:"product",num_items:O.length||1};O.length>0&&(e.content_ids=O.map(e=>e.id||e.priceId),e.contents=O.map(e=>({id:e.id||e.priceId,quantity:e.quantity||1,...B("item_price",M(e.price))}))),window.fbq("track","Purchase",e,{eventID:U})}if((this.isProduction||e.forceGtag)&&window.gtag&&(window.gtag("event","conversion",{send_to:e.sendTo||this.googleAdsSendTo,...B("value",L),currency:A,transaction_id:_||""}),window.gtag("event","purchase",{transaction_id:_,...B("value",L),currency:A,item_id:(null==(r=O[0])?void 0:r.id)||(null==(n=O[0])?void 0:n.priceId),item_name:(null==(a=O[0])?void 0:a.name)||(null==(i=O[0])?void 0:i.title),item_category:(null==(o=O[0])?void 0:o.category)||"subscription",...B("price",M(null==(s=O[0])?void 0:s.price)),user_id:q,items:O.map(e=>({item_id:e.id||e.priceId,item_name:e.name||e.title,item_category:e.category||"subscription",...B("price",M(e.price)),quantity:e.quantity||1}
1))})),this.isProduction&&window.dataLayer&&window.dataLayer.push({event:"purchase",ecommerce:{transaction_id:_,...B("value",L),currency:A,item_id:(null==(l=O[0])?void 0:l.id)||(null==(u=O[0])?void 0:u.priceId),item_name:(null==(c=O[0])?void 0:c.name)||(null==(d=O[0])?void 0:d.title),item_category:(null==(h=O[0])?void 0:h.category)||"subscription",...B("price",M(null==(f=O[0])?void 0:f.price)),user_id:q,items:O.map(e=>({item_id:e.id||e.priceId,item_name:e.name||e.title,item_category:e.category||"subscription",...B("price",M(e.price)),quantity:e.quantity||1}))}}),this.statsigClient&&!this.isLocalhost)try{this.statsigClient.logEvent("Purchase",{transaction_id:_,...B("value",L),currency:A,num_items:O.length||1,item_id:(null==(p=O[0])?void 0:p.id)||(null==(m=O[0])?void 0:m.priceId),item_name:(null==(g=O[0])?void 0:g.name)||(null==(y=O[0])?void 0:y.title),item_category:(null==(v=O[0])?void 0:v.category)||"subscription",...B("price",M(null==(w=O[0])?void 0:w.price)),user_id:q})}catch(e){console.warn("[Analytics] Erreur lors de l'envoi Purchase vers Statsig:",e)}return this.isProduction&&this.trackVercelEvent("Purchase",{transactionId:_,...B("value",L),userId:q,item_id:(null==(b=O[0])?void 0:b.id)||(null==(x=O[0])?void 0:x.priceId),item_name:(null==(E=O[0])?void 0:E.name)||(null==(S=O[0])?void 0:S.title),item_category:(null==(k=O[0])?void 0:k.category)||"subscription",...B("price",M(null==(P=O[0])?void 0:P.price))}),{eventId:U,fbp:this.getFBP(),fbc:this.getFBC()}}trackInitiateCheckout(){var e,t,r,n,a,i,o,s,l,u,c,d,h;let f=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{valueCents:p,valueEuros:m,value:g,currency:y="EUR",items:v=[],userId:w=this.userId,eventId:b=null,transactionId:x=null,valueInCents:E=!1}=f,S=this.resolveAmountDivisor(f,"trackInitiateCheckout"),k=null!=(e=null!=p?p:m)?e:g,P=null==S||null==k?null:k/S,C=e=>null==e||null==S?P:e/S,I=(e,t)=>null==t?{}:{[e]:t},T=b||(x?"InitiateCheckout_".concat(x):this.generateEventId("InitiateCheckout",w||this.userId));if(this.isProduction&&window.fbq){let e={content_type:"product",num_items:v.length||1};null!=P&&(e.value=P,e.currency=y),v.length>0&&(e.content_ids=v.map(e=>e.id||e.priceId),e.contents=v.map(e=>({id:e.id||e.priceId,quantity:e.quantity||1}))),window.fbq("track","InitiateCheckout",e,{eventID:T})}if(this.isProduction&&window.gtag&&window.gtag("event","begin_checkout",{currency:y,...I("value",P),item_id:(null==(t=v[0])?void 0:t.id)||(null==(r=v[0])?void 0:r.priceId),item_name:(null==(n=v[0])?void 0:n.name)||(null==(a=v[0])?void 0:a.title),item_category:(null==(i=v[0])?void 0:i.category)||"subscription",...I("price",C(null==(o=v[0])?void 0:o.price)),user_id:w,items:v.map(e=>({item_id:e.id||e.priceId,item_name:e.name||e.title,item_category:e.category||"subscription",...I("price",C(e.price)),quantity:e.quantity||1}))}),this.isProduction&&window.dataLayer){let e={event:"begin_checkout",ecommerce:{...I("value",P),currency:y,item_id:(null==(s=v[0])?void 0:s.id)||(null==(l=v[0])?void 0:l.priceId),item_name:(null==(u=v[0])?void 0:u.name)||(null==(c=v[0])?void 0:c.title),item_category:(null==(d=v[0])?void 0:d.category)||"subscription",...I("price",C(null==(h=v[0])?void 0:h.price)),user_id:w,items:v.map(e=>({item_id:e.id||e.priceId,item_name:e.name||e.title,item_category:e.category||"subscription",...I("price",C(e.price)),quantity:e.quantity||1}))}};x&&(e.ecommerce.transaction_id=x),window.dataLayer.push(e)}if(this.statsigClient&&!this.isLocalhost)try{this.statsigClient.logEvent("InitiateCheckout",{...I("value",P),currency:y,user_id:w,num_items:v.length||1})}catch(e){console.warn("[Analytics] Erreur lors de l'envoi InitiateCheckout vers Statsig:",e)}return this.trackVercelEvent("InitiateCheckout",{...I("value",P),userId:w}),{eventId:T,fbp:this.getFBP(),fbc:this.getFBC()}}trackSignUp(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{method:t="email",userType:r="trial",userId:n=this.userId,eventId:a=null,value:i=8.5,currency:o="EUR",sendTo:s=null}=e,l=a||this.generateEventId("Lead",n||this.userId);if(this.isProduction&&window.gtag&&(window.gtag("event","conversion",{send_to:s||this.googleAdsSendToSignUp,value:i,currency:o}),window.gtag("event","sign_up",{method:t,value:i,currency:o,user_t
1ype:r})),this.isProduction&&window.fbq&&window.fbq("track","Lead",{status:!0,method:t,value:0,currency:"EUR"},{eventID:l}),this.isProduction&&window.dataLayer&&window.dataLayer.push({event:"sign_up",value:i,currency:o,method:t,user_type:r}),this.statsigClient&&!this.isLocalhost)try{this.statsigClient.logEvent("SignUp",{method:t,user_type:r})}catch(e){console.warn("[Analytics] Erreur lors de l'envoi SignUp vers Statsig:",e)}return this.trackVercelEvent("SignUp",{method:t,userType:r}),{eventId:l,fbp:this.getFBP(),fbc:this.getFBC()}}trackCompleteRegistration(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{contentName:t="",signupFrom:r="",method:n="email",value:a=0,currency:i="EUR",userId:o=this.userId,eventId:s=null}=e,l=s||this.generateEventId("CompleteRegistration",o||this.userId);if(this.isProduction&&window.fbq&&(window.fbq("track","CompleteRegistration",{content_name:t,status:!0,value:a,currency:i},{eventID:l}),window.fbq("track","Lead",{content_name:t,status:!0,value:a,currency:i},{eventID:this.generateEventId("Lead",o||this.userId)})),this.isProduction&&window.gtag&&(window.gtag("event","sign_up",{method:n}),window.gtag("event","generate_lead",{method:n,content_name:t,value:a,currency:i})),this.isProduction&&window.dataLayer&&window.dataLayer.push({event:"complete_registration",method:n,content_name:t,signup_from:r,user_id:o}),this.statsigClient&&!this.isLocalhost)try{this.statsigClient.logEvent("CompleteRegistration",{method:n,content_name:t,signup_from:r,user_id:o})}catch(e){console.warn("[Analytics] Erreur lors de l'envoi CompleteRegistration vers Statsig:",e)}return this.trackVercelEvent("CompleteRegistration",{contentName:t,signupFrom:r}),this.trackUmami("complete-registration",{path:window.location.pathname,signupFrom:r,contentName:t}),{eventId:l,fbp:this.getFBP(),fbc:this.getFBC()}}trackLead(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{contentName:t="",contentCategory:r="low_ticket_playlist",email:n="",userId:a=this.userId,value:i=0,currency:o="EUR",eventId:s=null,...l}=e,u=s||this.generateEventId("Lead",a||n||this.userId);if(this.isProduction&&window.fbq&&window.fbq("track","Lead",{content_name:t,content_category:r,value:i,currency:o,...l},{eventID:u}),this.isProduction&&window.gtag&&window.gtag("event","generate_lead",{content_name:t,value:i,currency:o}),this.isProduction&&window.dataLayer&&window.dataLayer.push({event:"lead",content_name:t,user_id:a||n}),this.statsigClient&&!this.isLocalhost)try{this.statsigClient.logEvent("Lead",{content_name:t,...l})}catch(e){console.warn("[Analytics] Erreur lors de l'envoi Lead vers Statsig:",e)}return this.trackVercelEvent("Lead",{contentName:t,...l}),this.trackUmami("lead",{path:window.location.pathname,contentName:t}),{eventId:u,fbp:this.getFBP(),fbc:this.getFBC()}}trackVideoPlay(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{videoTitle:t="",videoId:r="",videoIndex:n=0,playlistSlug:a="",playlistTitle:i="",playCount:o=1,isFree:s=!1,stage:l="",userId:u=this.userId,eventId:c=null}=e;this._anonVideoPlaySeed||(this._anonVideoPlaySeed="anon-".concat(Math.random().toString(36).slice(2,12)));let d=u||this.getFBP()||this._anonVideoPlaySeed,h=c||this.generateEventId("VideoPlay","".concat(d,"_").concat(r||a,"_").concat(o)),f={content_name:t||i||"video",content_category:"video",content_ids:r?[String(r)]:[],content_type:"video",video_title:t,video_id:r,video_index:n,playlist_slug:a,playlist_title:i,play_count:o,is_free:s,stage:l};if(this.isProduction&&window.fbq&&(window.fbq("track","ViewContent",{content_name:t||i||"video",content_category:"playlist_video",content_ids:r?[String(r)]:[],content_type:"video",value:0,currency:"EUR"},{eventID:h}),window.fbq("trackCustom","VideoPlay",f,{eventID:h})),this.isProduction&&window.gtag&&window.gtag("event","video_play",{video_title:t,video_id:r,video_index:n,playlist_slug:a,play_count:o}),this.isProduction&&window.dataLayer&&window.dataLayer.push({event:"video_play",...f}),this.statsigClient&&!this.isLocalhost)try{this.statsigClient.logEvent("VideoPlay",f)}catch(e){console.warn("[Analytics] Erreur lors de l'envoi VideoPlay vers Statsig:",e)}return this.trackVercelEvent("VideoPlay",{videoTitle:t,playlistSlug:a,playCount:o,videoIndex:n}),this.trackUmami("video_play",{playlist:a,video:t,playCount:o}),{eventId:h,fbp:this.getFBP(),fbc:this.getFBC()}}trackSignIn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{method:t="email",userType:r=""}=e;if(this.isProduction&&window.gtag&&window.gtag("event","login",{method:t,user_type:r}),this.isProduction&&window.fbq&&window.fbq("trackCustom","Login",{method:t}),this.isProduction&&window.dataLayer&&window.dataLayer.push({event:"login",method:t,user_type:r}),this.statsigClient&&!this.isLocalhost)try{this.statsigClient.logEvent("SignIn",{method:t,user_type:r})}catch(e){console.warn("[Analytics] Erreur lors de l'envoi SignIn vers Statsig:",e)}this.trackVercelEvent("SignIn",{method:t,userType:r})}trackSubscribe(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{valueCents:t,valueEuros:r,currency:n="EUR",transactionId:a,priceId:i=null}=e;if(!a)return null;let o=null!=t?t/100:null!=r?r:null;if(null==o||o<=0)return null;let s="Subscribe_".concat(a);return this.isProduction&&window.fbq&&window.fbq("track","Subscribe",{value:o,currency:n,predicted_ltv:o,content_type:"product",...i?{c
1ontent_ids:[i]}:{}},{eventID:s}),{eventId:s}}trackCourseRSVP(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{courseId:t,courseName:r,courseCategory:n="formation",rsvpType:a="live",instructorName:i,courseDate:o,userId:s=this.userId,eventId:l=null}=e,u=l||this.generateEventId("CourseRSVP",s||this.userId);if(this.isProduction&&window.gtag&&window.gtag("event","course_rsvp",{course_id:t,course_name:r,course_category:n,rsvp_type:a,instructor:i,user_id:s}),this.isProduction&&window.fbq&&window.fbq("trackCustom","CourseRSVP",{content_name:r,content_category:n,content_ids:[t],status:!0,user_id:s},{eventID:u}),this.isProduction&&window.dataLayer&&window.dataLayer.push({event:"course_rsvp",course_id:t,course_name:r,course_category:n,rsvp_type:a,instructor:i,course_date:o,user_id:s}),this.statsigClient&&!this.isLocalhost)try{this.statsigClient.logEvent("CourseRSVP",{course_id:t,course_name:r,course_category:n,rsvp_type:a,instructor:i,user_id:s})}catch(e){console.warn("[Analytics] Erreur lors de l'envoi CourseRSVP vers Statsig:",e)}return this.trackVercelEvent("CourseRSVP",{courseId:t,courseName:r}),{eventId:u,fbp:this.getFBP(),fbc:this.getFBC()}}trackEvent(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.isProduction&&window.gtag&&window.gtag("event",e,t),this.isProduction&&window.fbq&&window.fbq(i.has(e)?"track":"trackCustom",e,t),this.isProduction&&window.dataLayer&&window.dataLayer.push({event:e,...t}),this.statsigClient&&!this.isLocalhost)try{this.statsigClient.logEvent(e,t)}catch(e){console.warn("[Analytics] Erreur lors de l'envoi vers Statsig:",e)}this.trackVercelEvent(e,t)}trackCTAClick(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{ctaType:t="button",ctaText:r="",ctaLocation:n="",ctaDestination:a="",ctaVariant:i="",userId:o=this.userId,eventId:s=null}=e,l=s||this.generateEventId("CTA_Click",o||this.userId);if(this.isProduction&&window.gtag&&window.gtag("event","cta_click",{cta_type:t,cta_text:r,cta_location:n,cta_destination:a,cta_variant:i,user_id:o}),this.isProduction&&window.fbq&&window.fbq("trackCustom","CTAClick",{cta_type:t,cta_text:r,cta_location:n,cta_destination:a,cta_variant:i,user_id:o},{eventID:l}),this.isProduction&&window.dataLayer&&window.dataLayer.push({event:"cta_click",cta_type:t,cta_text:r,cta_location:n,cta_destination:a,cta_variant:i,user_id:o}),this.statsigClient&&!this.isLocalhost)try{this.statsigClient.logEvent("CTAClick",{cta_type:t,cta_text:r,cta_location:n,cta_destination:a,cta_variant:i})}catch(e){console.warn("[Analytics] Erreur lors de l'envoi CTAClick vers Statsig:",e)}return this.trackVercelEvent("CTAClick",{ctaType:t,ctaText:r,ctaLocation:n,ctaDestination:a,ctaVariant:i}),n&&this.trackUmami("cta_".concat(n).slice(0,50),{location:n,ctaText:r,ctaVariant:i}),{eventId:l,fbp:this.getFBP(),fbc:this.getFBC()}}trackMenuClick(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{menuType:t="navigation",menuItem:r="",menuLocation:n="",menuDestination:a="",menuCategory:i="",userId:o=this.userId,eventId:s=null}=e,l=s||this.generateEventId("Menu_Click",o||this.userId);if(this.isProduction&&window.gtag&&window.gtag("event","menu_click",{menu_type:t,menu_item:r,menu_location:n,menu_destination:a,menu_category:i,user_id:o}),this.isProduction&&window.fbq&&window.fbq("trackCustom","MenuClick",{menu_type:t,menu_item:r,menu_location:n,menu_destination:a,menu_category:i},{eventID:l}),this.isProduction&&window.dataLayer&&window.dataLayer.push({event:"menu_click",menu_type:t,menu_item:r,menu_location:n,menu_destination:a,menu_category:i,user_id:o}),this.statsigClient&&!this.isLocalhost)try{this.statsigClient.logEvent("MenuClick",{menu_type:t,menu_item:r,menu_location:n,menu_destination:a,menu_category:i,user_id:o})}catch(e){console.warn("[Analytics] Erreur lors de l'envoi MenuClick vers Statsig:",e)}return this.trackVercelEvent("MenuClick",{menuType:t,menuItem:r,menuLocation:n,menuDestination:a,menuCategory:i,userId:o}),{eventId:l,fbp:this.getFBP(),fbc:this.getFBC()}}trackVercelEvent(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{this.vercelTrack&&"function"==typeof this.vercelTrack&&this.vercelTrack(e,t)}catch(e){}}parseStripeSession(e){var t,r;let n=e.amount_total||e.amount_subtotal||0,a=(null==(t=e.currency)?void 0:t.toUpperCase())||"EUR",i=e.metadata||{},o=((null==(r=e.line_items)?void 0:r.data)||[]).map(e=>{var t,r,a;let o="Unknown Product";return(null==(r=e.price)||null==(t=r.product)?void 0:t.name)?o=e.price.product.name:e.description?o=e.description:i.name?o=i.name:i.liveIds&&(o="Formation Empara"),{id:(null==(a=e.price)?void 0:a.id)||i.priceId,name:o,category:i.liveIds?"course":"subscription",price:e.amount_total||e.amount_subtotal||n,quantity:e.quantity||1}});if(0===o.length){let e="Unknown Product";i.name?e=i.name:i.liveIds&&(e="Formation Empara"),o.push({id:i.priceId||"unknown",name:e,category:i.liveIds?"course":"subscription",price:n,quantity:1})}return{transactionId:e.invoice||e.payment_intent||e.id,valueCents:n,currency:a,items:o}}resolveAmountDivisor(e){let{valueCents:t,valueEuros:r,value:n,valueInCents:a}=e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"analytics";return null!=t?100:null!=r||null==n?1:!0===a?100:!1===a?1:(console.error("[Analytics] ".concat(i,' : montant "').concat(n,'" sans unit\xe9 d\xe9clar\xe9e. Utilisez valueCents (centimes) ou valueEuros (euros). Valeur non transmise.')),null)}generateEventId(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.userId,r=t||this.userId||"anonymous";return"string"==typeof r&&r.includes("@")&&(r=r.toLowerCase().trim()),"".concat(e,"_").concat(r)}getFBP(){var e;if("undefined"==typeof document)return null;
1let t=null==(e=document.cookie)?void 0:e.split(";").find(e=>e.trim().startsWith("_fbp="));return t?t.split("=")[1]:null}getFBC(){var e;if("undefined"==typeof document)return null;let t=null==(e=document.cookie)?void 0:e.split(";").find(e=>e.trim().startsWith("_fbc="));return t?t.split("=")[1]:null}constructor(){this.isInitialized=!1,this.userId=null,this.fbPixelId="532627337966371",this.gaId=a.env.NEXT_PUBLIC_GA_ID||"G-MWW48NYGZQ",this.gtmId=a.env.NEXT_PUBLIC_GTM_ID||"GTM-T9LRQQL",this.googleAdsSendTo=a.env.NEXT_PUBLIC_GOOGLE_ADS_SEND_TO||"AW-481757662/1CQJCMnmwt0cEN6T3OUB",this.googleAdsSendToSignUp=a.env.NEXT_PUBLIC_GOOGLE_ADS_SIGNUP_SEND_TO||"AW-481757662/bIwcCJyuw90cEN6T3OUB",this.environment="prod",this.isProduction="prod"===this.environment,this.vercelTrack=null,this.vercelServerTrack=null,this.statsigClient=null,this.isLocalhost=this.checkIfLocalhost()}}let s=new o,l=s,u=e=>{try{var t;return null==s||null==(t=s.trackPageView)?void 0:t.call(s,e)}catch(e){console.warn("[Analytics] Erreur trackPageView:",e)}},c=e=>{try{var t;return null==s||null==(t=s.trackPurchase)?void 0:t.call(s,e)}catch(e){console.warn("[Analytics] Erreur trackPurchase:",e)}},d=e=>{try{var t;return null==s||null==(t=s.trackInitiateCheckout)?void 0:t.call(s,e)}catch(e){console.warn("[Analytics] Erreur trackInitiateCheckout:",e)}},h=(e,t)=>{try{var r;return null==s||null==(r=s.trackEvent)?void 0:r.call(s,e,t)}catch(e){console.warn("[Analytics] Erreur trackEvent:",e)}},f=e=>{try{var t;return null==s||null==(t=s.trackSignUp)?void 0:t.call(s,e)}catch(e){console.warn("[Analytics] Erreur trackSignUp:",e)}},p=e=>{try{var t;return null==s||null==(t=s.trackSignIn)?void 0:t.call(s,e)}catch(e){console.warn("[Analytics] Erreur trackSignIn:",e)}},m=e=>{try{var t;return null==s||null==(t=s.trackSubscribe)?void 0:t.call(s,e)}catch(e){console.warn("[Analytics] Erreur trackSubscribe:",e)}},g=e=>{try{var t;return null==s||null==(t=s.trackCourseRSVP)?void 0:t.call(s,e)}catch(e){console.warn("[Analytics] Erreur trackCourseRSVP:",e)}},y=e=>{try{var t;return null==s||null==(t=s.trackCompleteRegistration)?void 0:t.call(s,e)}catch(e){console.warn("[Analytics] Erreur trackCompleteRegistration:",e)}},v=e=>{try{var t;return null==s||null==(t=s.trackLead)?void 0:t.call(s,e)}catch(e){console.warn("[Analytics] Erreur trackLead:",e)}},w=e=>{try{var t;return null==s||null==(t=s.trackVideoPlay)?void 0:t.call(s,e)}catch(e){console.warn("[Analytics] Erreur trackVideoPlay:",e)}},b=e=>{try{var t;return null==s||null==(t=s.identifyUser)?void 0:t.call(s,e)}catch(e){console.warn("[Analytics] Erreur identifyUser:",e)}},x=()=>{try{var e;return null==s||null==(e=s.init)?void 0:e.call(s)}catch(e){console.warn("[Analytics] Erreur init:",e)}},E=e=>{try{var t;return null==s||null==(t=s.parseStripeSession)?void 0:t.call(s,e)}catch(e){console.warn("[Analytics] Erreur parseStripeSession:",e)}},S=e=>{try{var t;return null==s||null==(t=s.setStatsigClient)?void 0:t.call(s,e)}catch(e){console.warn("[Analytics] Erreur setStatsigClient:",e)}},k=e=>{try{var t;return null==s||null==(t=s.trackCTAClick)?void 0:t.call(s,e)}catch(e){console.warn("[Analytics] Erreur trackCTAClick:",e)}},P=e=>{try{var t;return null==s||null==(t=s.trackMenuClick)?void 0:t.call(s,e)}catch(e){console.warn("[Analytics] Erreur trackMenuClick:",e)}},C=e=>{try{var t;return null==s||null==(t=s.trackPageViewCours)?void 0:t.call(s,e)}catch(e){console.warn("[Analytics] Erreur trackPageViewCours:",e)}},I=(e,t)=>{try{var r;if("string"!=typeof e||!e)return;let n={};if(t&&"object"==typeof t)for(let[e,r]of Object.entries(t))"string"==typeof r||"boolean"==typeof r?n[e]=r:"number"==typeof r&&Number.isFinite(r)&&(n[e]=r);null==s||null==(r=s.trackUmami)||r.call(s,e.slice(0,50),n)}catch(e){console.warn("[Analytics] Erreur trackProductEvent:",e)}}},15711:(e,t,r)=>{"use strict";r.d(t,{BM:()=>s,CW:()=>n,Ee:()=>d,HP:()=>c,JQ:()=>o,Ny:()=>p,On:()=>h,cx:()=>i,es:()=>f,lV:()=>a,ok:()=>l,ol:()=>u});let n=m(/[A-Za-z]/),a=m(/[\dA-Za-z]/),i=m(/[#-'*+\--9=?A-Z^-~]/);function o(e){return null!==e&&(e<32||127===e)}let s=m(/\d/),l=m(/[\dA-Fa-f]/),u=m(/[!-/:-@[-`{-~]/);function c(e){return null!==e&&e<-2}function d(e){return null!==e&&(e<0||32===e)}function h(e){return -2===e||-1===e||32===e}let f=m(/\p{P}|\p{S}/u),p=m(/\s/);function m(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}},15861:e=>{!function(){var t={229:function(e){var t,r,n,a=e.exports={};function i(){throw Error("setTimeout has not been defined")}function o(){throw Error("clearTimeout has not been defined")}try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}var l=[],u=!1,c=-1;function d(){u&&n&&(u=!1,n.length?l=n.concat(l):c=-1,l.length&&h())}function h(){if(!u){var e=s(d);u=!0;for(var t=l.length;t;){for(n=l,l=[];++c<t;)n&&n[c].run();c=-1,t=l.length}n=null,u=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function p(){}a.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new f(e,t)),1!==l.length||u||s(h)},f.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=p,a.addListener=p,a.once=p,a.off=p,a.removeListener=p,a.removeAllListeners=p,a.emit=p,a.prependListener=p,a.prependOnceListener=p,a.listeners=function(e){return[]},a.binding=function(e){throw Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(e){throw Error("process.chdir is not supported")},a.umask=function(){return 0}}},r={};function n(e){var a=r[e];if(void 0!==a)return a.exports;var i=r[e]={exports:{}},o=!0;try{t[e](i,i.exports,n),o=!1}finally{o&&delete r[e]}return i.exports}n.ab="//",e.exports=n(229)}()},16076:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(17963).A)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},16605:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var n=r(37876),a=r(14232),i=r(8728),o=r(23551),s=r(45195),l=r(11897),u=r(74453);let c=e=>{let{user:t}=e,[r,c]=(0,a.useState)(!1),d=(0,u.Uf)();return((0,a.useCallback)(()=>{c(!0);try{sessionStorage.setItem("emailVerificationBannerDismissed","true")}catch(e){}},[]),(0,a.useEffect)(()=>{try{"true"===sessionStorage.getItem("emailVerificationBannerDismissed")&&c(!0)}catch(e){}},[]),!l.dI||!t||!1!==t.isActivated||t.isGoogle||r)?null:(0,n.jsx)("div",{className:(0,s.cn)("relative w-full px-4 py-1","bg-amber-50 border-b border-amber-200","text-amber-900"),children:(0,n.jsxs)("div",{className:"mx-auto max-w-7xl flex items-center justify-between gap-3",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[(0,n.jsx)("div",{className:"flex-shrink-0 p-1.5 bg-amber-100 rounded-full",children:(0,n.jsx)(i.A,{className:"w-4 h-4 text-amber-600"})}),(0,n.jsx)("div",{className:"flex-1 min-w-0",children:(0,n.jsx)("p",{className:"text-xs text-amber-700 mt-0.5",children:d.isEmailSent?"Un email de v\xe9rification a \xe9t\xe9 envoy\xe9 \xe0 ton adresse. Consulte tes spams si tu ne le trouves pas.":"Un email de v\xe9rification va \xeatre envoy\xe9 \xe0 ton adresse. Consulte tes spams si tu ne le trouves pas."})})]}),(0,n.jsx)("div",{className:"flex items-center gap-2 flex-shrink-0",children:d.justSent?(0,n.jsx)("span",{className:"text-xs text-black font-medium",children:"Email envoy\xe9 !"}):d.error?(0,n.jsx)("span",{className:"text-xs text-red-600 font-medium",children:d.error}):(0,n.jsxs)("button",{type:"button",onClick:d.send,disabled:d.isDisabled,className:(0,s.cn)("inline-flex items-center gap-1.5 px-3 py-1 rounded-md text-xs font-medium","bg-black text-white hover:bg-black/80","transition-colors duration-150","disabled:opacity-50 disabled:cursor-not-allowed"),children:[(0,n.jsx)(o.A,{className:(0,s.cn)("w-3 h-3",d.isSending&&"animate-spin")}),(0,u.Qd)(d,d.isEmailSent?"Renvoyer l'email":"Envoyer l'email")]})})]})})}},17315:(e,t,r)=>{"use strict";r.r(t),r.d(t,{boolean:()=>a,booleanish:()=>i,commaOrSpaceSeparated:()=>c,commaSeparated:()=>u,number:()=>s,overloadedBoolean:()=>o,spaceSeparated:()=>l});let n=0,a=d(),i=d(),o=d(),s=d(),l=d(),u=d(),c=d();function d(){return 2**++n}},17963:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});var n=r(14232);let a=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)},i=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim()};var o={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let s=(0,n.forwardRef)((e,t)=>{let{color:r="currentColor",size:a=24,strokeWidth:s=2,absoluteStrokeWidth:l,className:u="",children:c,iconNode:d,...h}=e;return(0,n.createElement)("svg",{ref:t,...o,width:a,height:a,stroke:r,strokeWidth:l?24*Number(s)/Number(a):s,className:i("lucide",u),...!c&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0})(h)&&{"aria-hidden":"true"},...h},[...d.map(e=>{let[t,r]=e;return(0,n.createElement)(t,r)}),...Array.isArray(c)?c:[c]])}),l=(e,t)=>
1{let r=(0,n.forwardRef)((r,o)=>{let{className:l,...u}=r;return(0,n.createElement)(s,{ref:o,iconNode:t,className:i("lucide-".concat(a(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),"lucide-".concat(e),l),...u})});return r.displayName=a(e),r}},18070:(e,t,r)=>{"use strict";r.d(t,{t:()=>i});var n=r(90089),a=r(37149),i=new class extends n.Q{#h=!0;#f;#p;constructor(){super(),this.#p=e=>{if(!a.S$&&window.addEventListener){let t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#f||this.setEventListener(this.#p)}onUnsubscribe(){this.hasListeners()||(this.#f?.(),this.#f=void 0)}setEventListener(e){this.#p=e,this.#f?.(),this.#f=e(this.setOnline.bind(this))}setOnline(e){this.#h!==e&&(this.#h=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#h}}},18444:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"unstable_rethrow",{enumerable:!0,get:function(){return n}});let n=r(34318).unstable_rethrow;("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},18847:(e,t,r)=>{e.exports=r(52496)},19169:(e,t,r)=>{"use strict";r.d(t,{RX:()=>eE,$P:()=>ew,ng:()=>eb,fY:()=>ex});var n={};r.r(n),r.d(n,{abtestingV3Client:()=>R,apiClientVersion:()=>O});var a={};r.r(a),r.d(a,{abtestingClient:()=>j,apiClientVersion:()=>D});var i={};r.r(i),r.d(i,{analyticsClient:()=>B,apiClientVersion:()=>L});var o={};r.r(o),r.d(o,{apiClientVersion:()=>U,insightsClient:()=>z});var s={};r.r(s),r.d(s,{apiClientVersion:()=>V,personalizationClient:()=>H});var l={};r.r(l),r.d(l,{apiClientVersion:()=>G,querySuggestionsClient:()=>K});var u={};r.r(u),r.d(u,{apiClientVersion:()=>$,searchClient:()=>Y});var c={};r.r(c),r.d(c,{apiClientVersion:()=>J,ingestionClient:()=>er,isOnDemandTrigger:()=>Z,isScheduleTrigger:()=>ee,isSubscriptionTrigger:()=>et});var d={};r.r(d),r.d(d,{apiClientVersion:()=>en,monitoringClient:()=>ea});var h={};function f(){return{send:function(e){return new Promise(t=>{let r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach(t=>r.setRequestHeader(t,e.headers[t]));let n=(e,n)=>setTimeout(()=>{r.abort(),t({status:0,content:n,isTimedOut:!0})},e),a=n(e.connectTimeout,"Connection timeout"),i;r.onreadystatechange=()=>{r.readyState>r.OPENED&&void 0===i&&(clearTimeout(a),i=n(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{0===r.status&&(clearTimeout(a),clearTimeout(i),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(a),clearTimeout(i),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)})}}}function p(e){let t,r=`algolia-client-js-${e.key}`;function n(){return void 0===t&&(t=e.localStorage||window.localStorage),t}function a(){return JSON.parse(n().getItem(r)||"{}")}function i(e){n().setItem(r,JSON.stringify(e))}return{get:(t,r,n={miss:()=>Promise.resolve()})=>Promise.resolve().then(()=>(!function(){let t=e.timeToLive?1e3*e.timeToLive:null,r=Object.fromEntries(Object.entries(a()).filter(([,e])=>void 0!==e.timestamp));i(r),t&&i(Object.fromEntries(Object.entries(r).filter(([,e])=>{let r=new Date().getTime();return!(e.timestamp+t<r)})))}(),a()[JSON.stringify(t)])).then(e=>Promise.all([e?e.value:r(),void 0!==e])).then(([e,t])=>Promise.all([e,t||n.miss(e)])).then(([e])=>e),set:(e,t)=>Promise.resolve().then(()=>{let i=a();return i[JSON.stringify(e)]={timestamp:new Date().getTime(),value:t},n().setItem(r,JSON.stringify(i)),t}),delete:e=>Promise.resolve().then(()=>{let t=a();delete t[JSON.stringify(e)],n().setItem(r,JSON.stringify(t))}),clear:()=>Promise.resolve().then(()=>{n().removeItem(r)})}}function m(e){let t=[...e.caches],r=t.shift();return void 0===r?{get:(e,t,r={miss:()=>Promise.resolve()})=>t().then(e=>Promise.all([e,r.miss(e)])).then(([e])=>e),set:(e,t)=>Promise.resolve(t),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}:{get:(e,n,a={miss:()=>Promise.resolve()})=>r.get(e,n,a).catch(()=>m({caches:t}).get(e,n,a)),set:(e,n)=>r.set(e,n).catch(()=>m({caches:t}).set(e,n)),delete:e=>r.delete(e).catch(()=>m({caches:t}).delete(e)),clear:()=>
1r.clear().catch(()=>m({caches:t}).clear())}}function g(e={serializable:!0}){let t={};return{get(r,n,a={miss:()=>Promise.resolve()}){let i=JSON.stringify(r);if(i in t)return Promise.resolve(e.serializable?JSON.parse(t[i]):t[i]);let o=n();return o.then(e=>a.miss(e)).then(()=>o)},set:(r,n)=>(t[JSON.stringify(r)]=e.serializable?JSON.stringify(n):n,Promise.resolve(n)),delete:e=>(delete t[JSON.stringify(e)],Promise.resolve()),clear:()=>(t={},Promise.resolve())}}function y(e,t,r="WithinHeaders"){let n={"x-algolia-api-key":t,"x-algolia-application-id":e};return{headers:()=>"WithinHeaders"===r?n:{},queryParameters:()=>"WithinQueryParameters"===r?n:{}}}function v({func:e,validate:t,aggregator:r,error:n,timeout:a=()=>0}){let i=o=>new Promise((s,l)=>{e(o).then(async e=>(r&&await r(e),await t(e))?s(e):n&&await n.validate(e)?l(Error(await n.message(e))):setTimeout(()=>{i(e).then(s).catch(l)},await a())).catch(e=>{l(e)})});return i()}function w({algoliaAgents:e,client:t,version:r}){let n=(function(e){let t={value:`Algolia for JavaScript (${e})`,add(e){let r=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return -1===t.value.indexOf(r)&&(t.value=`${t.value}${r}`),t}};return t})(r).add({segment:t,version:r});return e.forEach(e=>n.add(e)),n}function b(){return{debug:(e,t)=>Promise.resolve(),info:(e,t)=>Promise.resolve(),error:(e,t)=>Promise.resolve()}}function x(e,t="up"){let r=Date.now();return{...e,status:t,lastUpdate:r,isUp:function(){return"up"===t||Date.now()-r>12e4},isTimedOut:function(){return"timed out"===t&&Date.now()-r<=12e4}}}r.r(h),r.d(h,{apiClientVersion:()=>ei,recommendClient:()=>eo});var E=class extends Error{name="AlgoliaError";constructor(e,t){super(e),t&&(this.name=t)}},S=class extends E{stackTrace;constructor(e,t,r){super(e,r),this.stackTrace=t}},k=class extends S{constructor(e){super("Unreachable hosts - your application id may be incorrect. If the error persists, please visit our help center https://alg.li/support-unreachable-hosts or reach out to the Algolia Support team: https://alg.li/support",e,"RetryError")}},P=class extends S{status;constructor(e,t,r,n="ApiError"){super(e,r,n),this.status=t}},C=class extends E{response;constructor(e,t){super(e,"DeserializationError"),this.response=t}},I=class extends P{error;constructor(e,t,r,n){super(e,t,n,"DetailedApiError"),this.error=r}};function T(e){for(let t=e.length-1;t>0;t--){let r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}function A(e){let t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}function _({hosts:e,hostsCache:t,baseHeaders:r,logger:n,baseQueryParameters:a,algoliaAgent:i,timeouts:o,requester:s,requestsCache:l,responsesCache:u}){async function c(e){let r=await Promise.all(e.map(e=>t.get(e,()=>Promise.resolve(x(e))))),n=r.filter(e=>e.isUp()),a=r.filter(e=>e.isTimedOut()),i=[...n,...a];return{hosts:i.length>0?i:e,getTimeout:(e,t)=>(0===a.length&&0===e?1:a.length+3+e)*t}}async function d(l,u,h=!0){let f=[],p=function(e,t){if("GET"!==e.method&&(void 0!==e.data||void 0!==t.data))return JSON.stringify(Array.isArray(e.data)?e.data:{...e.data,...t.data})}(l,u),m=function(e,t,r){let n={Accept:"application/json",...e,...t,...r},a={};return Object.keys(n).forEach(e=>{let t=n[e];a[e.toLowerCase()]=t}),a}(r,l.headers,u.headers),g="GET"===l.method?{...l.data,...u.data}:{},y={...a,...l.queryParameters,...g};if(i.value&&(y["x-algolia-agent"]=i.value),u&&u.queryParameters)for(let e of Object.keys(u.queryParameters))u.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(u.queryParameters[e])?y[e]=u.queryParameters[e].toString():y[e]=u.queryParameters[e];let v=0,w=async(e,r)=>{let a=e.pop();if(void 0===a)throw new k(f.map(e=>A(e)));let i={...o,...u.timeouts},c={data:p,headers:m,method:l.method,url:function(e,t,r){var n;let a=Object.keys(n=r).filter(e=>void 0!==n[e]).sort().map(e=>`${e}=${encodeURIComponent("[object Array]"===Object.prototype.toString.call(n[e])?n[e].join(","):n[e]).replace(/\+/g,"%20")}`).join("&"),i=`${e.protocol}://${e.url}${e.port?`:${e.port}`:""}/${"/"===t.charAt(0)?t.substring(1):t}`;return a.length&&(i+=`?${a}`),i}(a,l.path,y),connectTimeout:r(v,i.connect),responseTimeout:r(v,h?i.read:i.write)},d=t=>{let r={request:c,response:t,host:a,triesLeft:e.length};return f.push(r),r},g=await s.send(c);if(function({isTimedOut:e,status:t}){return e||function({isTimedOut:e,status:t}){return!e&&0==~~t}({isTimedOut:e,status:t})||2!=~~(t/100)&&4!=~~(t/100)}(g)){let i=d(g);return g.isTimedOut&&v++,n.info("Retryable failure",A(i)),await t.set(a,x(a,g.isTimedOut?"timed out":"down")),w(e,r)}if(function({status:e}){return 2==~~(e/100)}(g))try{return JSON.parse(g.content)}catch(e){throw new C(e.message,g)}throw d(g),function({content:e,status:t},r){try{let n=JSON.parse(e);if("error"in n)return new I(n.message,t,n.error,r);return new P(n.message,t,r)}catch{}return new P(e,t,r)}(g,f)},b=e.filter(e=>"readWrite"===e.accept||(h?"read"===e.accept:"write"===e.accept)),E=await c(b);return w([...E.hosts].reverse(),E.getTimeout)}return{hostsCache:t,requester:s,timeouts:o,logger:n,algoliaAgent:i,baseHeaders:r,baseQueryParameters:a,hosts:e,request:function(e,t={}){let n=e.useReadTransporter||"GET"===e.method;if(!n)return d(e,t,n);let i=()=>d(e,t);if(!0!==(t.cacheable||e.cacheable))return i();let o={request:e,requestOptions:t,transporter:{queryParameters:a,headers:r}};return u.get(o,()=>l.get(o,()=>l.set(o,i()).then(e=>Promise.all([l.delete(o),e]),e=>Promise.all([l.delete(o),Promise.reject(e)])).then(([e,t])=>t)),{miss:e=>u.set(o,e)})},requestsCache:l,responsesCache:u}}var O="1.6.1",q=["de","us"];function R(e,t,r,n){if(!e||"string"!=typeof e)throw Error("`appId` is missing.");if(!t||"string"!=typeof t)throw Error("`apiKey` is missing.");if(r&&("string"!=typeof r||!q.includes(r)))throw Error(`\`region\` must be one of the following: ${q.join(", ")}`);return function({appId:e,apiKey:t,authMode:r,algoliaAgents:n,region:a,...i}){let o=y(e,t,r),s=_({hosts:[{url:a?"analytics.{region}.algolia.com".replace("{region}",a):"analytics.algolia.com",accept:"readWrite",protocol:"https"}],...i,algoliaAgent:w({algoliaAgents:n,client:"AbtestingV3",version:O}),baseHeaders:{"content-type":"text/plain",...o.headers(),...i.baseHeaders},baseQueryParameters:{...o.queryParameters(),...i.baseQueryParameters}});return{transporter:s,appId:e,apiKey:t,clearCache:()=>Promise.all([s.requestsCache.clear(),s.responsesCache.clear()]).then(()=>void 0),get _ua(){return s.algoliaAgent.value},addAlgoliaAgent(e,t){s.algoliaAgent.add({segment:e,version:t})},setClientApiKey({apiKey:e}){r&&"WithinHeaders"!==r?s.baseQueryParameters["x-algolia-api-key"]=e:s.baseHeaders["x-algolia-api-key"]=e},addABTests(e,t){if(!e)throw Error("Parameter `addABTestsRequest` is required when calling `addABTests`.");if(!e.name)throw Error("Parameter `addABTestsRequest.name` is required when calling `addABTests`.");if(!e.variants)throw Error("Parameter `addABTestsRequest.variants` is required when calling `addABTests`.");if(!e.metrics)throw Error("Parameter `addABTestsRequest.metrics` is required when calling `addABTests`.");if(!e.endAt)throw Error("Parameter `addABTestsRequest.endAt` is required when calling `addABTests`.");return s.request({method:"POST",path:"/3/abtests",queryParameters:{},headers:{},data:e},t)},customDelete({path:e,parameters:t},r){if(!e)throw Error("Parameter `path` is required when calling `customDelete`.");let n="/{path}".replace("{path}",e);return s.request({method:"DELETE",path:n,queryParameters:t||{},headers:{}},r)},customGet({path:e,parameters:t},r){if(!e)throw Error("Parameter `path` is required when calling `customGet`.");let n="/{path}".replace("{path}",e);return s.request({method:"GET",path:n,queryParameters:t||{},headers:{}},r)},customPost({path:e,parameters:t,body:r},n){if(!e)throw Error("Parameter `path` is required when calling `customPost`.");let a="/{path}".replace("{path}",e);return s.request({method:"POST",path:a,queryParameters:t||{},headers:{},data:r||{}},n)},customPut({path:e,parameters:t,body:r},n){if(!e)throw Error("Parameter `path` is required when calling `customPut`.");let a="/{path}".replace("{path}",e);return s.request({method:"PUT",path:a,queryParameters:t||{},headers:{},data:r||{}},n)},deleteABTest({id:e},t){if(!e)throw Error("Parameter `id` is required when calling `deleteABTest`.");let r="/3/abtests/{id}".replace("{id}",encodeURIComponent(e));return s.request({method:"DELETE",path:r,queryParameters:{},headers:{}},t)},estimateABTest(e,t){if(!e)throw Error("Parameter `estimateABTestRequest` is required when calling `estimateABTest`.");if(!e.configuration)throw Error("Parameter `estimateABTestRequest.configuration` is required when calling `estimateABTest`.");if(!e.variants)throw Error("Parameter `estimateABTestRequest.variants` is required when calling `estimateABTest`.");return s.request({method:"POST",path:"/3/abtests/estimate",queryParameters:{},headers:{},data:e},t)},getABTest({id:e},t){if(!e)throw Error("Parameter `id` is required when calling `getABTest`.");let r="/3/abtests/{id}".replace("{id}",encodeURIComponent(e));return s.request({method:"GET",path:r,queryParameters:{},headers:{}},t)},getTimeseries({id:e,startDate:t,endDate:r,metric:n},a){if(!e)throw Error("Parameter `id` is required when calling `getTimeseries`.");let i="/3/abtests/{id}/timeseries".replace("{id}",encodeURIComponent(e)),o={};return void 0!==t&&(o.startDate=t.toString()),void 0!==r&&(o.endDate=r.toString()),void 0!==n&&(o.metric=n.toString()),s.request({method:"GET",path:i,queryParameters:o,headers:{}},a)},listABTests({offset:e,limit:t,indexPrefix:r,indexSuffix:n,direction:a}={},i){let o={};return void 0!==e&&(o.offset=e.toString()),void 0!==t&&(o.limit=t.toString()),void 0!==r&&(o.indexPrefix=r.toString()),void 0!==n&&(o.indexSuffix=n.toString()),void 0!==a&&(o.direction=a.toString()),s.request({method:"GET",path:"/3/abtests",queryParameters:o,headers:{}},i)},scheduleABTest(e,t){if(!e)throw Error("Parameter `scheduleABTestsRequest` is required when calling `scheduleABTest`.");if(!e.name)throw Error("Parameter `scheduleABTestsRequest.name` is required when calling `scheduleABTest`.");if(!e.variants)throw Error("Parameter `scheduleABTestsRequest.variants` is required when calling `scheduleABTest`.");if(!e.metrics)throw Error("Parameter `scheduleABTestsRequest.metrics` is required when calling `scheduleABTest`.");if(!e.scheduledAt)throw Error("Parameter `scheduleABTestsRequest.scheduledAt` is required when calling `scheduleABTest`.");if(!e.endAt)throw Error("Parameter `scheduleABTestsRequest.endAt` is required when calling `scheduleABTest`.");return s.request({method:"POST",path:"/3/abtests/schedule",queryParameters:{},headers:{},data:e},t)},stopABTest({id:e},t){if(!e)throw Error("Parameter `id` is required when calling `stopABTest`.");let r="/3/abtests/{id}/stop".replace("{id}",encodeURIComponent(e));return s.request({method:"POST",path:r,queryParameters:{},headers:{}},t)}}}({appId:e,apiKey:t,region:r,timeouts:{connect:1e3,read:2e3,write:3e4},logger:b(),requester:f(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:g(),requestsCache:g({serializable:!1}),hostsCache:m({caches:[p({key:`${O}-${e}`}),g()]}),...n})}var D="5.40.1",N=["de","us"];function j(e,t,r,n){if(!e||"string"!=typeof e)throw Error("`appId` is missing.");if(!t||"string"!=typeof t)throw Error("`apiKey` is missing.");if(r&&("string"!=typeof r||!N.includes(r)))throw Error(`\`region\` must be one of the following: ${N.join(", ")}`);return function({appId:e,apiKey:t,authMode:r,algoliaAgents:n,region:a,...i}){let o=y(e,t,r),s=_({hosts:[{url:a?"analytics.{region}.algolia.com".replace("{region}",a):"analytics.algolia.com",accept:"readWrite",protocol:"https"}],...i,algoliaAgent:w({algoliaAgents:n,client:"Abtesting",version:D}),baseHeaders:{"content-type":"text/plain",...o.headers(),...i.baseHeaders},baseQueryParameters:{...o.queryParameters(),...i.baseQueryParameters}});return{transporter:s,appId:e,apiKey:t,clearCache:()=>Promise.all([s.requestsCache.clear(),s.responsesCache.clear()]).then(()=>void 0),get _ua(){return s.algoliaAgent.value},addAlgoliaAgent(e,t){s.algoliaAgent.add({segment:e,version:t})},setClientApiKey({apiKey:e}){r&&"WithinHeaders"!==r?s.baseQueryParameters["x-algolia-api-key"]=e:s.baseHeaders["x-algolia-api-key"]=e},addABTests(e,t){if(!e)throw Error("Parameter `addABTestsRequest` is required when calling `addABTests`.");if(!e.name)throw Error("Parameter `addABTestsRequest.name` is required when calling `addABTests`.");if(!e.variants)throw Error("Parameter `addABTestsRequest.variants` is required when calling `addABTests`.");if(!e.endAt)throw Error("Parameter `addABTestsRequest.endAt` is required when calling `addABTests`.");return s.request({method:"POST",path:"/2/abtests",queryParameters:{},headers:{},data:e},t)},customDelete({path:e,parameters:t},r){if(!e)throw Error("Parameter `path` is required when calling `customDelete`.");let n="/{path}".replace("{path}",e);return s.request({method:"DELETE",path:n,queryParameters:t||{},headers:{}},r)},customGet({path:e,parameters:t},r){if(!e)throw Error("Parameter `path` is required when calling `customGet`.");let n="/{path}".replace("{path}",e);return s.request({method:"GET",path:n,queryParameters:t||{},headers:{}},r)},customPost({path:e,parameters:t,body:r},n){if(!e)throw Error("Parameter `path` is required when calling `customPost`.");let a="/{path}".replace("{path}",e);return s.request({method:"POST",path:a,queryParameters:t||{},headers:{},data:r||{}},n)},customPut({path:e,parameters:t,body:r},n){if(!e)throw Error("Parameter `path` is required when calling `customPut`.");let a="/{path}".replace("{path}",e);return s.request({method:"PUT",path:a,queryParameters:t||{},headers:{},data:r||{}},n)},deleteABTest({id:e},t){if(!e)throw Error("Parameter `id` is required when calling `deleteABTest`.");let r="/2/abtests/{id}".replace("{id}",encodeURIComponent(e));return s.request({method:"DELETE",path:r,queryParameters:{},headers:{}},t)},estimateABTest(e,t){if(!e)throw Error("Parameter `estimateABTestRequest` is required when calling `estimateABTest`.");if(!e.configuration)throw Error("Parameter `estimateABTestRequest.configuration` is required when calling `estimateABTest`.");if(!e.variants)throw Error("Parameter `estimateABTestRequest.variants` is required when calling `estimateABTest`.");return s.request({method:"POST",path:"/2/abtests/estimate",queryParameters:{},headers:{},data:e},t)},getABTest({id:e},t){if(!e)throw Error("Parameter `id` is required when calling `getABTest`.");let r="/2/abtests/{id}".replace("{id}",encodeURIComponent(e));return s.request({method:"GET",path:r,queryParameters:{},headers:{}},t)},listABTests({offset:e,limit:t,indexPrefix:r,indexSuffix:n}={},a){let i={};return void 0!==e&&(i.offset=e.toString()),void 0!==t&&(i.limit=t.toString()),void 0!==r&&(i.indexPrefix=r.toString()),void 0!==n&&(i.indexSuffix=n.toString()),s.request({method:"GET",path:"/2/abtests",queryParameters:i,headers:{}},a)},scheduleABTest(e,t){if(!e)throw Error("Parameter `scheduleABTestsRequest` is required when calling `scheduleABTest`.");if(!e.name)throw Error("Parameter `scheduleABTestsRequest.name` is required when calling `scheduleABTest`.");if(!e.variants)throw Error("Parameter `scheduleABTestsRequest.variants` is required when calling `scheduleABTest`.");if(!e.scheduledAt)throw Error("Parameter `scheduleABTestsRequest.scheduledAt` is required when calling `scheduleABTest`.");if(!e.endAt)throw Error("Parameter `scheduleABTestsRequest.endAt` is required when calling `scheduleABTest`.");return s.request({method:"POST",path:"/2/abtests/schedule",queryParameters:{},headers:{},data:e},t)},stopABTest({id:e},t){if(!e)throw Error("Parameter `id` is required when calling `stopABTest`.");let r="/2/abtests/{id}/stop".replace("{id}",encodeURIComponent(e));return s.request({method:"POST",path:r,queryParameters:{},headers:{}},t)}}}({appId:e,apiKey:t,region:r,timeouts:{connect:1e3,read:2e3,write:3e4},logger:b(),requester:f(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:g(),requestsCache:g({serializable:!1}),hostsCache:m({caches:[p({key:`${D}-${e}`}),g()]}),...n})}var L="5.40.1",M=["de","us"];function B(e,t,r,n){if(!e||"string"!=typeof e)throw Error("`appId` is missing."
1);if(!t||"string"!=typeof t)throw Error("`apiKey` is missing.");if(r&&("string"!=typeof r||!M.includes(r)))throw Error(`\`region\` must be one of the following: ${M.join(", ")}`);return function({appId:e,apiKey:t,authMode:r,algoliaAgents:n,region:a,...i}){let o=y(e,t,r),s=_({hosts:[{url:a?"analytics.{region}.algolia.com".replace("{region}",a):"analytics.algolia.com",accept:"readWrite",protocol:"https"}],...i,algoliaAgent:w({algoliaAgents:n,client:"Analytics",version:L}),baseHeaders:{"content-type":"text/plain",...o.headers(),...i.baseHeaders},baseQueryParameters:{...o.queryParameters(),...i.baseQueryParameters}});return{transporter:s,appId:e,apiKey:t,clearCache:()=>Promise.all([s.requestsCache.clear(),s.responsesCache.clear()]).then(()=>void 0),get _ua(){return s.algoliaAgent.value},addAlgoliaAgent(e,t){s.algoliaAgent.add({segment:e,version:t})},setClientApiKey({apiKey:e}){r&&"WithinHeaders"!==r?s.baseQueryParameters["x-algolia-api-key"]=e:s.baseHeaders["x-algolia-api-key"]=e},customDelete({path:e,parameters:t},r){if(!e)throw Error("Parameter `path` is required when calling `customDelete`.");let n="/{path}".replace("{path}",e);return s.request({method:"DELETE",path:n,queryParameters:t||{},headers:{}},r)},customGet({path:e,parameters:t},r){if(!e)throw Error("Parameter `path` is required when calling `customGet`.");let n="/{path}".replace("{path}",e);return s.request({method:"GET",path:n,queryParameters:t||{},headers:{}},r)},customPost({path:e,parameters:t,body:r},n){if(!e)throw Error("Parameter `path` is required when calling `customPost`.");let a="/{path}".replace("{path}",e);return s.request({method:"POST",path:a,queryParameters:t||{},headers:{},data:r||{}},n)},customPut({path:e,parameters:t,body:r},n){if(!e)throw Error("Parameter `path` is required when calling `customPut`.");let a="/{path}".replace("{path}",e);return s.request({method:"PUT",path:a,queryParameters:t||{},headers:{},data:r||{}},n)},getAddToCartRate({index:e,startDate:t,endDate:r,tags:n},a){if(!e)throw Error("Parameter `index` is required when calling `getAddToCartRate`.");let i={};return void 0!==e&&(i.index=e.toString()),void 0!==t&&(i.startDate=t.toString()),void 0!==r&&(i.endDate=r.toString()),void 0!==n&&(i.tags=n.toString()),s.request({method:"GET",path:"/2/conversions/addToCartRate",queryParameters:i,headers:{}},a)},getAverageClickPosition({index:e,startDate:t,endDate:r,tags:n},a){if(!e)throw Error("Parameter `index` is required when calling `getAverageClickPosition`.");let i={};return void 0!==e&&(i.index=e.toString()),void 0!==t&&(i.startDate=t.toString()),void 0!==r&&(i.endDate=r.toString()),void 0!==n&&(i.tags=n.toString()),s.request({method:"GET",path:"/2/clicks/averageClickPosition",queryParameters:i,headers:{}},a)},getClickPositions({index:e,startDate:t,endDate:r,tags:n},a){if(!e)throw Error("Parameter `index` is required when calling `getClickPositions`.");let i={};return void 0!==e&&(i.index=e.toString()),void 0!==t&&(i.startDate=t.toString()),void 0!==r&&(i.endDate=r.toString()),void 0!==n&&(i.tags=n.toString()),s.request({method:"GET",path:"/2/clicks/positions",queryParameters:i,headers:{}},a)},getClickThroughRate({index:e,startDate:t,endDate:r,tags:n},a){if(!e)throw Error("Parameter `index` is required when calling `getClickThroughRate`.");let i={};return void 0!==e&&(i.index=e.toString()),void 0!==t&&(i.startDate=t.toString()),void 0!==r&&(i.endDate=r.toString()),void 0!==n&&(i.tags=n.toString()),s.request({method:"GET",path:"/2/clicks/clickThroughRate",queryParameters:i,headers:{}},a)},getConversionRate({index:e,startDate:t,endDate:r,tags:n},a){if(!e)throw Error("Parameter `index` is required when calling `getConversionRate`.");let i={};return void 0!==e&&(i.index=e.toString()),void 0!==t&&(i.startDate=t.toString()),void 0!==r&&(i.endDate=r.toString()),void 0!==n&&(i.tags=n.toString()),s.request({method:"GET",path:"/2/conversions/conversionRate",queryParameters:i,headers:{}},a)},getNoClickRate({index:e,startDate:t,endDate:r,tags:n},a){if(!e)throw Error("Parameter `index` is required when calling `getNoClickRate`.");let i={};return void 0!==e&&(i.index=e.toString()),void 0!==t&&(i.startDate=t.toString()),void 0!==r&&(i.endDate=r.toString()),void 0!==n&&(i.tags=n.toString()),s.request({method:"GET",path:"/2/searches/noClickRate",queryParameters:i,headers:{}},a)},getNoResultsRate({index:e,startDate:t,endDate:r,tags:n},a){if(!e)throw Error("Parameter `index` is required when calling `getNoResultsRate`.");let i={};return void 0!==e&&(i.index=e.toString()),void 0!==t&&(i.startDate=t.toString()),void 0!==r&&(i.endDate=r.toString()),void 0!==n&&(i.tags=n.toString()),s.request({method:"GET",path:"/2/searches/noResultRate",queryParameters:i,headers:{}},a)},getPurchaseRate({index:e,startDate:t,endDate:r,tags:n},a){if(!e)throw Error("Parameter `index` is required when calling `getPurchaseRate`.");let i={};return void 0!==e&&(i.index=e.toString()),void 0!==t&&(i.startDate=t.toString()),void 0!==r&&(i.endDate=r.toString()),void 0!==n&&(i.tags=n.toString()),s.request({method:"GET",path:"/2/conversions/purchaseRate",queryParameters:i,headers:{}},a)},getRevenue({index:e,startDate:t,endDate:r,tags:n},a){if(!e)throw Error("Parameter `index` is required when calling `getRevenue`.");let i={};return void 0!==e&&(i.index=e.toString()),void 0!==t&&(i.startDate=t.toString()),void 0!==r&&(i.endDate=r.toString()),void 0!==n&&(i.tags=n.toString()),s.request({method:"GET",path:"/2/conversions/revenue",queryParameters:i,headers:{}},a)},getSearchesCount({index:e,startDate:t,endDate:r,tags:n},a){if(!e)throw Error("Parameter `index` is required when calling `getSearchesCount`.");let i={};return void 0!==e&&(i.index=e.toString()),void 0!==t&&(i.startDate=t.toString()),void 0!==r&&(i.endDate=r.toString()),void 0!==n&&(i.tags=n.toString()),s.request({method:"GET",path:"/2/searches/count",queryParameters:i,headers:{}},a)},getSearchesNoClicks({index:e,startDate:t,endDate:r,limit:n,offset:a,tags:i},o){if(!e)throw Error("Parameter `index` is required when calling `getSearchesNoClicks`.");let l={};return void 0!==e&&(l.index=e.toString()),void 0!==t&&(l.startDate=t.toString()),void 0!==r&&(l.endDate=r.toString()),void 0!==n&&(l.limit=n.toString()),void 0!==a&&(l.offset=a.toString()),void 0!==i&&(l.tags=i.toString()),s.request({method:"GET",path:"/2/searches/noClicks",queryParameters:l,headers:{}},o)},getSearchesNoResults({index:e,startDate:t,endDate:r,limit:n,offset:a,tags:i},o){if(!e)throw Error("Parameter `index` is required when calling `getSearchesNoResults`.");let l={};return void 0!==e&&(l.index=e.toString()),void 0!==t&&(l.startDate=t.toString()),void 0!==r&&(l.endDate=r.toString()),void 0!==n&&(l.limit=n.toString()),void 0!==a&&(l.offset=a.toString()),void 0!==i&&(l.tags=i.toString()),s.request({method:"GET",path:"/2/searches/noResults",queryParameters:l,headers:{}},o)},getStatus({index:e},t){if(!e)throw Error("Parameter `index` is required when calling `getStatus`.");let r={};return void 0!==e&&(r.index=e.toString()),s.request({method:"GET",path:"/2/status",queryParameters:r,headers:{}},t)},getTopCountries({index:e,startDate:t,endDate:r,limit:n,offset:a,tags:i},o){if(!e)throw Error("Parameter `index` is required when calling `getTopCountries`.");let l={};return void 0!==e&&(l.index=e.toString()),void 0!==t&&(l.startDate=t.toString()),void 0!==r&&(l.endDate=r.toString()),void 0!==n&&(l.limit=n.toString()),void 0!==a&&(l.offset=a.toString()),void 0!==i&&(l.tags=i.toString()),s.request({method:"GET",path:"/2/countries",queryParameters:l,headers:{}},o)},getTopFilterAttributes({index:e,search:t,startDate:r,endDate:n,limit:a,offset:i,tags:o},l){if(!e)throw Error("Parameter `index` is required when calling `getTopFilterAttributes`.");let u={};return void 0!==e&&(u.index=e.toString()),void 0!==t&&(u.search=t.toString()),void 0!==r&&(u.startDate=r.toString()),void 0!==n&&(u.endDate=n.toString()),void 0!==a&&(u.limit=a.toString()),void 0!==i&&(u.offset=i.toString()),void 0!==o&&(u.tags=o.toString()),s.request({method:"GET",path:"/2/filters",queryParameters:u,headers:{}},l)},getTopFilterForAttribute({attribute:e,index:t,search:r,startDate:n,endDate:a,limit:i,offset:o,tags:l},u){if(!e)throw Error("Parameter `attribute` is required when calling `getTopFilterForAttribute`.");if(!t)throw Error("Parameter `index` is required when calling `getTopFilterForAttribute`.");let c="/2/filters/{attribute}".replace("{attribute}",encodeURIComponent(e)),d={};return void 0!==t&&(d.index=t.toString()),void 0!==r&&(d.search=r.toString()),void 0!==n&&(d.startDate=n.toString()),void 0!==a&&(d.endDate=a.toString()),void 0!==i&&(d.limit=i.toString()),void 0!==o&&(d.offset=o.toString()),void 0!==l&&(d.tags=l.toString()),s.request({method:"GET",path:c,queryParameters:d,headers:{}},u)},getTopFiltersNoResults({index:e,search:t,startDate:r,endDate:n,limit:a,offset:i,tags:o},l){if(!e)throw Error("Parameter `index` is required when calling `getTopFiltersNoResults`.");let u={};return void 0!==e&&(u.index=e.toString()),void 0!==t&&(u.search=t.toString()),void 0!==r&&(u.startDate=r.toString()),void 0!==n&&(u.endDate=n.toString()),void 0!==a&&(u.limit=a.toString()),void 0!==i&&(u.offset=i.toString()),void 0!==o&&(u.tags=o.toString()),s.request({method:"GET",path:"/2/filters/noResults",queryParameters:u,headers:{}},l)},getTopHits({index:e,search:t,clickAnalytics:r,revenueAnalytics:n,startDate:a,endDate:i,limit:o,offset:l,tags:u},c){if(!e)throw Error("Parameter `index` is required when calling `getTopHits`.");let d={};return void 0!==e&&(d.index=e.toString()),void 0!==t&&(d.search=t.toString()),void 0!==r&&(d.clickAnalytics=r.toString()),void 0!==n&&(d.revenueAnalytics=n.toString()),void 0!==a&&(d.startDate=a.toString()),void 0!==i&&(d.endDate=i.toString()),void 0!==o&&(d.limit=o.toString()),void 0!==l&&(d.offset=l.toString()),void 0!==u&&(d.tags=u.toString()),s.request({method:"GET",path:"/2/hits",queryParameters:d,headers:{}},c)},getTopSearches({index:e,clickAnalytics:t,revenueAnalytics:r,startDate:n,endDate:a,orderBy:i,direction:o,limit:l,offset:u,tags:c}
1,d){if(!e)throw Error("Parameter `index` is required when calling `getTopSearches`.");let h={};return void 0!==e&&(h.index=e.toString()),void 0!==t&&(h.clickAnalytics=t.toString()),void 0!==r&&(h.revenueAnalytics=r.toString()),void 0!==n&&(h.startDate=n.toString()),void 0!==a&&(h.endDate=a.toString()),void 0!==i&&(h.orderBy=i.toString()),void 0!==o&&(h.direction=o.toString()),void 0!==l&&(h.limit=l.toString()),void 0!==u&&(h.offset=u.toString()),void 0!==c&&(h.tags=c.toString()),s.request({method:"GET",path:"/2/searches",queryParameters:h,headers:{}},d)},getUsersCount({index:e,startDate:t,endDate:r,tags:n},a){if(!e)throw Error("Parameter `index` is required when calling `getUsersCount`.");let i={};return void 0!==e&&(i.index=e.toString()),void 0!==t&&(i.startDate=t.toString()),void 0!==r&&(i.endDate=r.toString()),void 0!==n&&(i.tags=n.toString()),s.request({method:"GET",path:"/2/users/count",queryParameters:i,headers:{}},a)}}}({appId:e,apiKey:t,region:r,timeouts:{connect:1e3,read:2e3,write:3e4},logger:b(),requester:f(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:g(),requestsCache:g({serializable:!1}),hostsCache:m({caches:[p({key:`${L}-${e}`}),g()]}),...n})}var U="5.40.1",F=["de","us"];function z(e,t,r,n){if(!e||"string"!=typeof e)throw Error("`appId` is missing.");if(!t||"string"!=typeof t)throw Error("`apiKey` is missing.");if(r&&("string"!=typeof r||!F.includes(r)))throw Error(`\`region\` must be one of the following: ${F.join(", ")}`);return function({appId:e,apiKey:t,authMode:r,algoliaAgents:n,region:a,...i}){let o=y(e,t,r),s=_({hosts:[{url:a?"insights.{region}.algolia.io".replace("{region}",a):"insights.algolia.io",accept:"readWrite",protocol:"https"}],...i,algoliaAgent:w({algoliaAgents:n,client:"Insights",version:U}),baseHeaders:{"content-type":"text/plain",...o.headers(),...i.baseHeaders},baseQueryParameters:{...o.queryParameters(),...i.baseQueryParameters}});return{transporter:s,appId:e,apiKey:t,clearCache:()=>Promise.all([s.requestsCache.clear(),s.responsesCache.clear()]).then(()=>void 0),get _ua(){return s.algoliaAgent.value},addAlgoliaAgent(e,t){s.algoliaAgent.add({segment:e,version:t})},setClientApiKey({apiKey:e}){r&&"WithinHeaders"!==r?s.baseQueryParameters["x-algolia-api-key"]=e:s.baseHeaders["x-algolia-api-key"]=e},customDelete({path:e,parameters:t},r){if(!e)throw Error("Parameter `path` is required when calling `customDelete`.");let n="/{path}".replace("{path}",e);return s.request({method:"DELETE",path:n,queryParameters:t||{},headers:{}},r)},customGet({path:e,parameters:t},r){if(!e)throw Error("Parameter `path` is required when calling `customGet`.");let n="/{path}".replace("{path}",e);return s.request({method:"GET",path:n,queryParameters:t||{},headers:{}},r)},customPost({path:e,parameters:t,body:r},n){if(!e)throw Error("Parameter `path` is required when calling `customPost`.");let a="/{path}".replace("{path}",e);return s.request({method:"POST",path:a,queryParameters:t||{},headers:{},data:r||{}},n)},customPut({path:e,parameters:t,body:r},n){if(!e)throw Error("Parameter `path` is required when calling `customPut`.");let a="/{path}".replace("{path}",e);return s.request({method:"PUT",path:a,queryParameters:t||{},headers:{},data:r||{}},n)},deleteUserToken({userToken:e},t){if(!e)throw Error("Parameter `userToken` is required when calling `deleteUserToken`.");let r="/1/usertokens/{userToken}".replace("{userToken}",encodeURIComponent(e));return s.request({method:"DELETE",path:r,queryParameters:{},headers:{}},t)},pushEvents(e,t){if(!e)throw Error("Parameter `insightsEvents` is required when calling `pushEvents`.");if(!e.events)throw Error("Parameter `insightsEvents.events` is required when calling `pushEvents`.");return s.request({method:"POST",path:"/1/events",queryParameters:{},headers:{},data:e},t)}}}({appId:e,apiKey:t,region:r,timeouts:{connect:1e3,read:2e3,write:3e4},logger:b(),requester:f(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:g(),requestsCache:g({serializable:!1}),hostsCache:m({caches:[p({key:`${U}-${e}`}),g()]}),...n})}var V="5.40.1",W=["eu","us"];function H(e,t,r,n){if(!e||"string"!=typeof e)throw Error("`appId` is missing.");if(!t||"string"!=typeof t)throw Error("`apiKey` is missing.");if(!r||r&&("string"!=typeof r||!W.includes(r)))throw Error(`\`region\` is required and must be one of the following: ${W.join(", ")}`);return function({appId:e,apiKey:t,authMode:r,algoliaAgents:n,region:a,...i}){let o=y(e,t,r),s=_({hosts:[{url:"personalization.{region}.algolia.com".replace("{region}",a),accept:"readWrite",protocol:"https"}],...i,algoliaAgent:w({algoliaAgents:n,client:"Personalization",version:V}),baseHeaders:{"content-type":"text/plain",...o.headers(),...i.baseHeaders},baseQueryParameters:{...o.queryParameters(),...i.baseQueryParameters}});return{transporter:s,appId:e,apiKey:t,clearCache:()=>Promise.all([s.requestsCache.clear(),s.responsesCache.clear()]).then(()=>void 0),get _ua(){return s.algoliaAgent.value},addAlgoliaAgent(e,t){s.algoliaAgent.add({segment:e,version:t})},setClientApiKey({apiKey:e}){r&&"WithinHeaders"!==r?s.baseQueryParameters["x-algolia-api-key"]=e:s.baseHeaders["x-algolia-api-key"]=e},customDelete({path:e,parameters:t},r){if(!e)throw Error("Parameter `path` is required when calling `customDelete`.");let n="/{path}".replace("{path}",e);return s.request({method:"DELETE",path:n,queryParameters:t||{},headers:{}},r)},customGet({path:e,parameters:t},r){if(!e)throw Error("Parameter `path` is required when calling `customGet`.");let n="/{path}".replace("{path}",e);return s.request({method:"GET",path:n,queryParameters:t||{},headers:{}},r)},customPost({path:e,parameters:t,body:r},n){if(!e)throw Error("Parameter `path` is required when calling `customPost`.");let a="/{path}".replace("{path}",e);return s.request({method:"POST",path:a,queryParameters:t||{},headers:{},data:r||{}},n)},customPut({path:e,parameters:t,body:r},n){if(!e)throw Error("Parameter `path` is required when calling `customPut`.");let a="/{path}".replace("{path}",e);return s.request({method:"PUT",path:a,queryParameters:t||{},headers:{},data:r||{}},n)},deleteUserProfile({userToken:e},t){if(!e)throw Error("Parameter `userToken` is required when calling `deleteUserProfile`.");let r="/1/profiles/{userToken}".replace("{userToken}",encodeURIComponent(e));return s.request({method:"DELETE",path:r,queryParameters:{},headers:{}},t)},getPersonalizationStrategy:e=>s.request({method:"GET",path:"/1/strategies/personalization",queryParameters:{},headers:{}},e),getUserTokenProfile({userToken:e},t){if(!e)throw Error("Parameter `userToken` is required when calling `getUserTokenProfile`.");let r="/1/profiles/personalization/{userToken}".replace("{userToken}",encodeURIComponent(e));return s.request({method:"GET",path:r,queryParameters:{},headers:{}},t)},setPersonalizationStrategy(e,t){if(!e)throw Error("Parameter `personalizationStrategyParams` is required when calling `setPersonalizationStrategy`.");if(!e.eventsScoring)throw Error("Parameter `personalizationStrategyParams.eventsScoring` is required when calling `setPersonalizationStrategy`.");if(!e.facetsScoring)throw Error("Parameter `personalizationStrategyParams.facetsScoring` is required when calling `setPersonalizationStrategy`.");if(!e.personalizationImpact)throw Error("Parameter `personalizationStrategyParams.personalizationImpact` is required when calling `setPersonalizationStrategy`.");return s.request({method:"POST",path:"/1/strategies/personalization",queryParameters:{},headers:{},data:e},t)}}}({appId:e,apiKey:t,region:r,timeouts:{connect:1e3,read:2e3,write:3e4},logger:b(),requester:f(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:g(),requestsCache:g({serializable:!1}),hostsCache:m({caches:[p({key:`${V}-${e}`}),g()]}),...n})}var G="5.40.1",Q=["eu","us"];function K(e,t,r,n){if(!e||"string"!=typeof e)throw Error("`appId` is missing.");if(!t||"string"!=typeof t)throw Error("`apiKey` is missing.");if(!r||r&&("string"!=typeof r||!Q.includes(r)))throw Error(`\`region\` is required and must be one of the following: ${Q.join(", ")}`);return function({appId:e,apiKey:t,authMode:r,algoliaAgents:n,region:a,...i}){let o=y(e,t,r),s=_({hosts:[{url:"query-suggestions.{region}.algolia.com".replace("{region}",a),accept:"readWrite",protocol:"https"}],...i,algoliaAgent:w({algoliaAgents:n,client:"QuerySuggestions",version:G}),baseHeaders:{"content-type":"text/plain",...o.headers(),...i.baseHeaders},baseQueryParameters:{...o.queryParameters(),...i.baseQueryParameters}});return{transporter:s,appId:e,apiKey:t,clearCache:()=>Promise.all([s.requestsCache.clear(),s.responsesCache.clear()]).then(()=>void 0),get _ua(){return s.algoliaAgent.value},addAlgoliaAgent(e,t){s.algoliaAgent.add({segment:e,version:t})},setClientApiKey({apiKey:e}){r&&"WithinHeaders"!==r?s.baseQueryParameters["x-algolia-api-key"]=e:s.baseHeaders["x-algolia-api-key"]=e},createConfig(e,t){if(!e)throw Error("Parameter `configurationWithIndex` is required when calling `createConfig`.");return s.request({method:"POST",path:"/1/configs",queryParameters:{},headers:{},data:e},t)},customDelete({path:e,parameters:t},r){if(!e)throw Error("Parameter `path` is required when calling `customDelete`.");let n="/{path}".replace("{path}",e);return s.request({method:"DELETE",path:n,queryParameters:t||{},headers:{}},r)},customGet({path:e,parameters:t},r){if(!e)throw Error("Parameter `path` is required when calling `customGet`.");let n="/{path}".replace("{path}",e);return s.request({method:"GET",path:n,queryParameters:t||{},headers:{}},r)},customPost({path:e,parameters:t,body:r},n){if(!e)throw Error("Parameter `path` is required when calling `customPost`.");let a="/{path}".replace("{path}",e);return s.request({method:"POST",path:a,queryParameters:t||{},headers:{},data:r||{}},n)},customPut({path:e,parameters:t,body:r},n){if(!e)throw Error("Parameter `path` is required when calling `customPut`.");let a="/{path}".replace("{path}",e);return s.request({method:"PUT",path:a,queryParameters:t||{},headers:{},data:r||{}},n)},deleteConfig({indexName:e},t){if(!e)throw Error("Parameter `indexName` is required when calling `deleteConfig`.");let r="/1/configs/{indexName}".replace("{indexName}",encodeURIComponent(e));return s.request({method:"DELETE",path:r,queryParameters:{},headers:{}},t)},getAllConfigs:e=>s.request({method:"GET",path:"/1/configs",queryParameters:{},headers:{}},e),getConfig({indexName:e},t){if(!e)throw Error("Parameter `indexName` is required when calling `getConfig`.");let r="/1/configs/{indexName}".replace("{indexName}",encodeURIComponent(e));return s.request({method:"GET",path:r,queryParameters:{},headers:{}},t)},getConfigStatus({indexName:e},t){if(!e)throw Error("Parameter `indexName` is required when calling `getConfigStatus`.");let r="/1/configs/{indexName}/status".replace("{indexName}",encodeURIComponent(e));return s.request({method:"GET",path:r,queryParameters:{},headers:{}},t)},getLogFile({indexName:e},t){if(!e)throw Error("Parameter `indexName` is required when calling `getLogFile`.");let r="/1/logs/{indexName}".replace("{indexName}",encodeURIComponent(e));return s.request({method:"GET",path:r,queryParameters:{},headers:{}},t)},updateConfig({indexName:e,configuration:t},r){if(!e)throw Error("Parameter `indexName` is required when calling `updateConfig`.");if(!t)throw Error("Parameter `configuration` is required when calling `updateConfig`.");if(!t.sourceIndices)throw Error("Parameter `configuration.sourceIndices` is required when calling `updateConfig`.");let n="/1/configs/{indexName}".replace("{indexName}",encodeURIComponent(e));return s.request({method:"PUT",path:n,queryParameters:{},headers:{},data:t},r)}}}({appId:e,apiKey:t,region:r,timeouts:{connect:1e3,read:2e3,write:3e4},logger:b(),requester:f(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:g(),requestsCache:g({serializable:!1}),hostsCache:m({caches:[p({key:`${G}-${e}`}),g()]}),...n})}var $="5.40.1";function Y(e,t,r){if(!e||"string"!=typeof e)throw Error("`appId` is missing.");if(!t||"string"!=typeof t)throw Error("`apiKey` is missing.");return function({appId:e,apiKey:t,authMode:r,algoliaAgents:n,...a}){let i=y(e,t,r),o=_({hosts:[{url:`${e}-dsn.algolia.net`,accept:"read",protocol:"https"},{url:`${e}.algolia.net`,accept:"write",protocol:"https"}].concat(T([{url:`${e}-1.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${e}-2.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${e}-3.algolianet.com`,accept:"readWrite",protocol:"https"}])),...a,algoliaAgent:w({algoliaAgents:n,client:"Search",version:$}),baseHeaders:{"content-type":"text/plain",...i.headers(),...a.baseHeaders},baseQueryParameters:{...i.queryParameters(),...a.baseQueryParameters}});return{transporter:o,appId:e,apiKey:t,clearCache:()=>Promise.all([o.requestsCache.clear(),o.responsesCache.clear()]).then(()=>void 0),get _ua(){return o.algoliaAgent.value},addAlgoliaAgent(e,t){o.algoliaAgent.add({segment:e,version:t})},setClientApiKey({apiKey:e}){r&&"WithinHeaders"!==r?o.baseQueryParameters["x-algolia-api-key"]=e:o.baseHeaders["x-algolia-api-key"]=e},waitForTask({indexName:e,taskID:t,maxRetries:r=50,timeout:n=e=>Math.min(200*e,5e3)},a){let i=0;return v({func:()=>this.getTask({indexName:e,taskID:t},a),validate:e=>"published"===e.status,aggregator:()=>i+=1,error:{validate:()=>i>=r,message:()=>`The maximum number of retries exceeded. (${i}/${r})`},timeout:()=>n(i)})},waitForAppTask({taskID:e,maxRetries:t=50,timeout:r=e=>Math.min(200*e,5e3)},n){let a=0;return v({func:()=>this.getAppTask({taskID:e},n),validate:e=>"published"===e.status,aggregator:()=>a+=1,error:{validate:()=>a>=t,message:()=>`The maximum number of retries exceeded. (${a}/${t})`},timeout:()=>r(a)})},waitForApiKey({operation:e,key:t,apiKey:r,maxRetries:n=50,timeout:a=e=>Math.min(200*e,5e3)},i){let o=0,s={aggregator:()=>o+=1,error:{validate:()=>
1o>=n,message:()=>`The maximum number of retries exceeded. (${o}/${n})`},timeout:()=>a(o)};if("update"===e){if(!r)throw Error("`apiKey` is required when waiting for an `update` operation.");return v({...s,func:()=>this.getApiKey({key:t},i),validate:e=>{for(let t of Object.keys(r)){let n=r[t],a=e[t];if(Array.isArray(n)&&Array.isArray(a)){if(n.length!==a.length||n.some((e,t)=>e!==a[t]))return!1}else if(n!==a)return!1}return!0}})}return v({...s,func:()=>this.getApiKey({key:t},i).catch(e=>{if(404!==e.status)throw e}),validate:t=>"add"===e?void 0!==t:void 0===t})},browseObjects({indexName:e,browseParams:t,...r},n){return v({func:r=>this.browse({indexName:e,browseParams:{cursor:r?r.cursor:void 0,hitsPerPage:1e3,...t}},n),validate:e=>void 0===e.cursor,...r})},browseRules({indexName:e,searchRulesParams:t,...r},n){let a={...t,hitsPerPage:t?.hitsPerPage||1e3};return v({func:t=>this.searchRules({indexName:e,searchRulesParams:{...a,page:t?t.page+1:a.page||0}},n),validate:e=>e.hits.length<a.hitsPerPage,...r})},browseSynonyms({indexName:e,searchSynonymsParams:t,...r},n){let a={...t,page:t?.page||0,hitsPerPage:1e3};return v({func:t=>{let r=this.searchSynonyms({indexName:e,searchSynonymsParams:{...a,page:a.page}},n);return a.page+=1,r},validate:e=>e.hits.length<a.hitsPerPage,...r})},async chunkedBatch({indexName:e,objects:t,action:r="addObject",waitForTasks:n,batchSize:a=1e3},i){let o=[],s=[];for(let[n,l]of t.entries())o.push({action:r,body:l}),(o.length===a||n===t.length-1)&&(s.push(await this.batch({indexName:e,batchWriteParams:{requests:o}},i)),o=[]);if(n)for(let t of s)await this.waitForTask({indexName:e,taskID:t.taskID});return s},async saveObjects({indexName:e,objects:t,waitForTasks:r,batchSize:n},a){return await this.chunkedBatch({indexName:e,objects:t,action:"addObject",waitForTasks:r,batchSize:n},a)},async deleteObjects({indexName:e,objectIDs:t,waitForTasks:r,batchSize:n},a){return await this.chunkedBatch({indexName:e,objects:t.map(e=>({objectID:e})),action:"deleteObject",waitForTasks:r,batchSize:n},a)},async partialUpdateObjects({indexName:e,objects:t,createIfNotExists:r,waitForTasks:n,batchSize:a},i){return await this.chunkedBatch({indexName:e,objects:t,action:r?"partialUpdateObject":"partialUpdateObjectNoCreate",batchSize:a,waitForTasks:n},i)},async replaceAllObjects({indexName:e,objects:t,batchSize:r,scopes:n},a){let i=Math.floor(1e6*Math.random())+1e5,o=`${e}_tmp_${i}`;void 0===n&&(n=["settings","rules","synonyms"]);try{let i=await this.operationIndex({indexName:e,operationIndexParams:{operation:"copy",destination:o,scope:n}},a),s=await this.chunkedBatch({indexName:o,objects:t,waitForTasks:!0,batchSize:r},a);await this.waitForTask({indexName:o,taskID:i.taskID}),i=await this.operationIndex({indexName:e,operationIndexParams:{operation:"copy",destination:o,scope:n}},a),await this.waitForTask({indexName:o,taskID:i.taskID});let l=await this.operationIndex({indexName:o,operationIndexParams:{operation:"move",destination:e}},a);return await this.waitForTask({indexName:o,taskID:l.taskID}),{copyOperationResponse:i,batchResponses:s,moveOperationResponse:l}}catch(e){throw await this.deleteIndex({indexName:o}),e}},async indexExists({indexName:e}
1){try{await this.getSettings({indexName:e})}catch(e){if(e instanceof P&&404===e.status)return!1;throw e}return!0},searchForHits(e,t){return this.search(e,t)},searchForFacets(e,t){return this.search(e,t)},addApiKey(e,t){if(!e)throw Error("Parameter `apiKey` is required when calling `addApiKey`.");if(!e.acl)throw Error("Parameter `apiKey.acl` is required when calling `addApiKey`.");return o.request({method:"POST",path:"/1/keys",queryParameters:{},headers:{},data:e},t)},addOrUpdateObject({indexName:e,objectID:t,body:r},n){if(!e)throw Error("Parameter `indexName` is required when calling `addOrUpdateObject`.");if(!t)throw Error("Parameter `objectID` is required when calling `addOrUpdateObject`.");if(!r)throw Error("Parameter `body` is required when calling `addOrUpdateObject`.");let a="/1/indexes/{indexName}/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t));return o.request({method:"PUT",path:a,queryParameters:{},headers:{},data:r},n)},appendSource(e,t){if(!e)throw Error("Parameter `source` is required when calling `appendSource`.");if(!e.source)throw Error("Parameter `source.source` is required when calling `appendSource`.");return o.request({method:"POST",path:"/1/security/sources/append",queryParameters:{},headers:{},data:e},t)},assignUserId({xAlgoliaUserID:e,assignUserIdParams:t},r){if(!e)throw Error("Parameter `xAlgoliaUserID` is required when calling `assignUserId`.");if(!t)throw Error("Parameter `assignUserIdParams` is required when calling `assignUserId`.");if(!t.cluster)throw Error("Parameter `assignUserIdParams.cluster` is required when calling `assignUserId`.");let n={};return void 0!==e&&(n["X-Algolia-User-ID"]=e.toString()),o.request({method:"POST",path:"/1/clusters/mapping",queryParameters:{},headers:n,data:t},r)},batch({indexName:e,batchWriteParams:t},r){if(!e)throw Error("Parameter `indexName` is required when calling `batch`.");if(!t)throw Error("Parameter `batchWriteParams` is required when calling `batch`.");if(!t.requests)throw Error("Parameter `batchWriteParams.requests` is required when calling `batch`.");let n="/1/indexes/{indexName}/batch".replace("{indexName}",encodeURIComponent(e));return o.request({method:"POST",path:n,queryParameters:{},headers:{},data:t},r)},batchAssignUserIds({xAlgoliaUserID:e,batchAssignUserIdsParams:t},r){if(!e)throw Error("Parameter `xAlgoliaUserID` is required when calling `batchAssignUserIds`.");if(!t)throw Error("Parameter `batchAssignUserIdsParams` is required when calling `batchAssignUserIds`.");if(!t.cluster)throw Error("Parameter `batchAssignUserIdsParams.cluster` is required when calling `batchAssignUserIds`.");if(!t.users)throw Error("Parameter `batchAssignUserIdsParams.users` is required when calling `batchAssignUserIds`.");let n={};return void 0!==e&&(n["X-Algolia-User-ID"]=e.toString()),o.request({method:"POST",path:"/1/clusters/mapping/batch",queryParameters:{},headers:n,data:t},r)},batchDictionaryEntries({dictionaryName:e,batchDictionaryEntriesParams:t},r){if(!e)throw Error("Parameter `dictionaryName` is required when calling `batchDictionaryEntries`.");if(!t)throw Error("Parameter `batchDictionaryEntriesParams` is required when calling `batchDictionaryEntries`.");if(!t.requests)throw Error("Parameter `batchDictionaryEntriesParams.requests` is required when calling `batchDictionaryEntries`.");let n="/1/dictionaries/{dictionaryName}/batch".replace("{dictionaryName}",encodeURIComponent(e));return o.request({method:"POST",path:n,queryParameters:{},headers:{},data:t},r)},browse({indexName:e,browseParams:t},r){if(!e)throw Error("Parameter `indexName` is required when calling `browse`.");let n="/1/indexes/{indexName}/browse".replace("{indexName}",encodeURIComponent(e));return o.request({method:"POST",path:n,queryParameters:{},headers:{},data:t||{},useReadTransporter:!0},r)},clearObjects({indexName:e},t){if(!e)throw Error("Parameter `indexName` is required when calling `clearObjects`.");let r="/1/indexes/{indexName}/clear".replace("{indexName}",encodeURIComponent(e));return o.request({method:"POST",path:r,queryParameters:{},headers:{}},t)},clearRules({indexName:e,forwardToReplicas:t},r){if(!e)throw Error("Parameter `indexName` is required when calling `clearRules`.");let n="/1/indexes/{indexName}/rules/clear".replace("{indexName}",encodeURIComponent(e)),a={};return void 0!==t&&(a.forwardToReplicas=t.toString()),o.request({method:"POST",path:n,queryParameters:a,headers:{}},r)},clearSynonyms({indexName:e,forwardToReplicas:t},r){if(!e)throw Error("Parameter `indexName` is required when calling `clearSynonyms`.");let n="/1/indexes/{indexName}/synonyms/clear".replace("{indexName}",encodeURIComponent(e)),a={};return void 0!==t&&(a.forwardToReplicas=t.toString()),o.request({method:"POST",path:n,queryParameters:a,headers:{}},r)},customDelete({path:e,parameters:t},r){if(!e)throw Error("Parameter `path` is required when calling `customDelete`.");let n="/{path}".replace("{path}",e);return o.request({method:"DELETE",path:n,queryParameters:t||{},headers:{}},r)},customGet({path:e,parameters:t},r){if(!e)throw Error("Parameter `path` is required when calling `customGet`.");let n="/{path}".replace("{path}",e);return o.request({method:"GET",path:n,queryParameters:t||{},headers:{}},r)},customPost({path:e,parameters:t,body:r},n){if(!e)throw Error("Parameter `path` is required when calling `customPost`.");let a="/{path}".replace("{path}",e);return o.request({method:"POST",path:a,queryParameters:t||{},headers:{},data:r||{}},n)},customPut({path:e,parameters:t,body:r},n){if(!e)throw Error("Parameter `path` is required when calling `customPut`.");let a="/{path}".replace("{path}",e);return o.request({method:"PUT",path:a,queryParameters:t||{},headers:{},data:r||{}},n)},deleteApiKey({key:e},t){if(!e)throw Error("Parameter `key` is required when calling `deleteApiKey`.");let r="/1/keys/{key}".replace("{key}",encodeURIComponent(e));return o.request({method:"DELETE",path:r,queryParameters:{},headers:{}},t)},deleteBy({indexName:e,deleteByParams:t},r){if(!e)throw Error("Parameter `indexName` is required when calling `deleteBy`.");if(!t)throw Error("Parameter `deleteByParams` is required when calling `deleteBy`.");let n="/1/indexes/{indexName}/deleteByQuery".replace("{indexName}",encodeURIComponent(e));return o.request({method:"POST",path:n,queryParameters:{},headers:{},data:t},r)},deleteIndex({indexName:e},t){if(!e)throw Error("Parameter `indexName` is required when calling `deleteIndex`.");let r="/1/indexes/{indexName}".replace("{indexName}",encodeURIComponent(e));return o.request({method:"DELETE",path:r,queryParameters:{},headers:{}},t)},deleteObject({indexName:e,objectID:t},r){if(!e)throw Error("Parameter `indexName` is required when calling `deleteObject`.");if(!t)throw Error("Parameter `objectID` is required when calling `deleteObject`.");let n="/1/indexes/{indexName}/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t));return o.request({method:"DELETE",path:n,queryParameters:{},headers:{}},r)},deleteRule({indexName:e,objectID:t,forwardToReplicas:r},n){if(!e)throw Error("Parameter `indexName` is required when calling `deleteRule`.");if(!t)throw Error("Parameter `objectID` is required when calling `deleteRule`.");let a="/1/indexes/{indexName}/rules/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),i={};return void 0!==r&&(i.forwardToReplicas=r.toString()),o.request({method:"DELETE",path:a,queryParameters:i,headers:{}},n)},deleteSource({source:e},t){if(!e)throw Error("Parameter `source` is required when calling `deleteSource`.");let r="/1/security/sources/{source}".replace("{source}",encodeURIComponent(e));return o.request({method:"DELETE",path:r,queryParameters:{},headers:{}},t)},deleteSynonym({indexName:e,objectID:t,forwardToReplicas:r},n){if(!e)throw Error("Parameter `indexName` is required when calling `deleteSynonym`.");if(!t)throw Error("Parameter `objectID` is required when calling `deleteSynonym`.");let a="/1/indexes/{indexName}/synonyms/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),i={};return void 0!==r&&(i.forwardToReplicas=r.toString()),o.request({method:"DELETE",path:a,queryParameters:i,headers:{}},n)},getApiKey({key:e},t){if(!e)throw Error("Parameter `key` is required when calling `getApiKey`.");let r="/1/keys/{key}".replace("{key}",encodeURIComponent(e));return o.request({method:"GET",path:r,queryParameters:{},headers:{}},t)},getAppTask({taskID:e},t){if(!e)throw Error("Parameter `taskID` is required when calling `getAppTask`.");let r="/1/task/{taskID}".replace("{taskID}",encodeURIComponent(e));return o.request({method:"GET",path:r,queryParameters:{},headers:{}},t)},getDictionaryLanguages:e=>o.request({method:"GET",path:"/1/dictionaries/*/languages",queryParameters:{},headers:{}},e),getDictionarySettings:e=>o.request({method:"GET",path:"/1/dictionaries/*/settings",queryParameters:{},headers:{}},e),getLogs({offset:e,length:t,indexName:r,type:n}={},a){let i={};return void 0!==e&&(i.offset=e.toString()),void 0!==t&&(i.length=t.toString()),void 0!==r&&(i.indexName=r.toString()),void 0!==n&&(i.type=n.toString()),o.request({method:"GET",path:"/1/logs",queryParameters:i,headers:{}},a)},getObject({indexName:e,objectID:t,attributesToRetrieve:r},n){if(!e)throw Error("Parameter `indexName` is required when calling `getObject`.");if(!t)throw Error("Parameter `objectID` is required when calling `getObject`.");let a="/1/indexes/{indexName}/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),i={};return void 0!==r&&(i.attributesToRetrieve=r.toString()),o.request({method:"GET",path:a,queryParameters:i,headers:{}},n)},getObjects(e,t){if(!e)throw Error("Parameter `getObjectsParams` is required when calling `getObjects`.");if(!e.requests)throw Error("Parameter `getObjectsParams.requests` is required when calling `getObjects`.");return o.request({method:"POST",path:"/1/indexes/*/objects",queryParameters:{},headers:{},data:e,useReadTransporter:!0,cacheable:!0},t)},getRule({indexName:e,objectID:t},r){if(!e)throw Error("Parameter `indexName` is required when calling `getRule`.");if(!t)throw Error("Parameter `objectID` is required when calling `getRule`.");let n="/1/indexes/{indexName}/rules/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t));return o.request({method:"GET",path:n,queryParameters:{},headers:{}},r)},getSettings({indexName:e,getVersion:t},r){if(!e)throw Error("Parameter `indexName` is required when calling `getSettings`.");let n="/1/indexes/{indexName}/settings".replace("{indexName}",encodeURIComponent(e)),a={};return void 0!==t&&(a.getVersion=t.toString()),o.request({method:"GET",path:n,queryParameters:a,headers:{}},r)},getSources:e=>o.request({method:"GET",path:"/1/security/sources",queryParameters:{},headers:{}},e),getSynonym({indexName:e,objectID:t},r){if(!e)throw Error("Parameter `indexName` is required when calling `getSynonym`.");if(!t)throw Error("Parameter `objectID` is required when calling `getSynonym`.");let n="/1/indexes/{indexName}/synonyms/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t));return o.request({method:"GET",path:n,queryParameters:{},headers:{}},r)},getTask({indexName:e,taskID:t},r){if(!e)throw Error("Parameter `indexName` is required when calling `getTask`.");if(!t)throw Error("Parameter `taskID` is required when calling `getTask`.");let n="/1/indexes/{indexName}/task/{taskID}".replace("{indexName}",encodeURIComponent(e)).replace("{taskID}",encodeURIComponent(t));return o.request({method:"GET",path:n,queryParameters:{},headers:{}},r)},getTopUserIds:e=>o.request({method:"GET",path:"/1/clusters/mapping/top",queryParameters:{},headers:{}},e),getUserId({userID:e},t){if(!e)throw Error("Parameter `userID` is required when calling `getUserId`.");let r="/1/clusters/mapping/{userID}".replace("{userID}",encodeURIComponent(e));return o.request({method:"GET",path:r,queryParameters:{},headers:{}},t)},hasPendingMappings({getClusters:e}={},t){let r={};return void 0!==e&&(r.getClusters=e.toString()),o.request({method:"GET",path:"/1/clusters/mapping/pending",queryParameters:r,headers:{}},t)},listApiKeys:e=>o.request({method:"GET",path:"/1/keys",queryParameters:{},headers:{}}
1,e),listClusters:e=>o.request({method:"GET",path:"/1/clusters",queryParameters:{},headers:{}},e),listIndices({page:e,hitsPerPage:t}={},r){let n={};return void 0!==e&&(n.page=e.toString()),void 0!==t&&(n.hitsPerPage=t.toString()),o.request({method:"GET",path:"/1/indexes",queryParameters:n,headers:{}},r)},listUserIds({page:e,hitsPerPage:t}={},r){let n={};return void 0!==e&&(n.page=e.toString()),void 0!==t&&(n.hitsPerPage=t.toString()),o.request({method:"GET",path:"/1/clusters/mapping",queryParameters:n,headers:{}},r)},multipleBatch(e,t){if(!e)throw Error("Parameter `batchParams` is required when calling `multipleBatch`.");if(!e.requests)throw Error("Parameter `batchParams.requests` is required when calling `multipleBatch`.");return o.request({method:"POST",path:"/1/indexes/*/batch",queryParameters:{},headers:{},data:e},t)},operationIndex({indexName:e,operationIndexParams:t},r){if(!e)throw Error("Parameter `indexName` is required when calling `operationIndex`.");if(!t)throw Error("Parameter `operationIndexParams` is required when calling `operationIndex`.");if(!t.operation)throw Error("Parameter `operationIndexParams.operation` is required when calling `operationIndex`.");if(!t.destination)throw Error("Parameter `operationIndexParams.destination` is required when calling `operationIndex`.");let n="/1/indexes/{indexName}/operation".replace("{indexName}",encodeURIComponent(e));return o.request({method:"POST",path:n,queryParameters:{},headers:{},data:t},r)},partialUpdateObject({indexName:e,objectID:t,attributesToUpdate:r,createIfNotExists:n},a){if(!e)throw Error("Parameter `indexName` is required when calling `partialUpdateObject`.");if(!t)throw Error("Parameter `objectID` is required when calling `partialUpdateObject`.");if(!r)throw Error("Parameter `attributesToUpdate` is required when calling `partialUpdateObject`.");let i="/1/indexes/{indexName}/{objectID}/partial".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),s={};return void 0!==n&&(s.createIfNotExists=n.toString()),o.request({method:"POST",path:i,queryParameters:s,headers:{},data:r},a)},removeUserId({userID:e},t){if(!e)throw Error("Parameter `userID` is required when calling `removeUserId`.");let r="/1/clusters/mapping/{userID}".replace("{userID}",encodeURIComponent(e));return o.request({method:"DELETE",path:r,queryParameters:{},headers:{}},t)},replaceSources({source:e},t){if(!e)throw Error("Parameter `source` is required when calling `replaceSources`.");return o.request({method:"PUT",path:"/1/security/sources",queryParameters:{},headers:{},data:e},t)},restoreApiKey({key:e},t){if(!e)throw Error("Parameter `key` is required when calling `restoreApiKey`.");let r="/1/keys/{key}/restore".replace("{key}",encodeURIComponent(e));return o.request({method:"POST",path:r,queryParameters:{},headers:{}},t)},saveObject({indexName:e,body:t},r){if(!e)throw Error("Parameter `indexName` is required when calling `saveObject`.");if(!t)throw Error("Parameter `body` is required when calling `saveObject`.");let n="/1/indexes/{indexName}".replace("{indexName}",encodeURIComponent(e));return o.request({method:"POST",path:n,queryParameters:{},headers:{},data:t},r)},saveRule({indexName:e,objectID:t,rule:r,forwardToReplicas:n},a){if(!e)throw Error("Parameter `indexName` is required when calling `saveRule`.");if(!t)throw Error("Parameter `objectID` is required when calling `saveRule`.");if(!r)throw Error("Parameter `rule` is required when calling `saveRule`.");if(!r.objectID)throw Error("Parameter `rule.objectID` is required when calling `saveRule`.");if(!r.consequence)throw Error("Parameter `rule.consequence` is required when calling `saveRule`.");let i="/1/indexes/{indexName}/rules/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),s={};return void 0!==n&&(s.forwardToReplicas=n.toString()),o.request({method:"PUT",path:i,queryParameters:s,headers:{},data:r},a)},saveRules({indexName:e,rules:t,forwardToReplicas:r,clearExistingRules:n},a){if(!e)throw Error("Parameter `indexName` is required when calling `saveRules`.");if(!t)throw Error("Parameter `rules` is required when calling `saveRules`.");let i="/1/indexes/{indexName}/rules/batch".replace("{indexName}",encodeURIComponent(e)),s={};return void 0!==r&&(s.forwardToReplicas=r.toString()),void 0!==n&&(s.clearExistingRules=n.toString()),o.request({method:"POST",path:i,queryParameters:s,headers:{},data:t},a)},saveSynonym({indexName:e,objectID:t,synonymHit:r,forwardToReplicas:n},a){if(!e)throw Error("Parameter `indexName` is required when calling `saveSynonym`.");if(!t)throw Error("Parameter `objectID` is required when calling `saveSynonym`.");if(!r)throw Error("Parameter `synonymHit` is required when calling `saveSynonym`.");if(!r.objectID)throw Error("Parameter `synonymHit.objectID` is required when calling `saveSynonym`.");if(!r.type)throw Error("Parameter `synonymHit.type` is required when calling `saveSynonym`.");let i="/1/indexes/{indexName}/synonyms/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(t)),s={};return void 0!==n&&(s.forwardToReplicas=n.toString()),o.request({method:"PUT",path:i,queryParameters:s,headers:{},data:r},a)},saveSynonyms({indexName:e,synonymHit:t,forwardToReplicas:r,replaceExistingSynonyms:n},a){if(!e)throw Error("Parameter `indexName` is required when calling `saveSynonyms`.");if(!t)throw Error("Parameter `synonymHit` is required when calling `saveSynonyms`.");let i="/1/indexes/{indexName}/synonyms/batch".replace("{indexName}",encodeURIComponent(e)),s={};return void 0!==r&&(s.forwardToReplicas=r.toString()),void 0!==n&&(s.replaceExistingSynonyms=n.toString()),o.request({method:"POST",path:i,queryParameters:s,headers:{},data:t},a)},search(e,t){if(e&&Array.isArray(e)&&(e={requests:e.map(({params:e,...t})=>"facet"===t.type?{...t,...e,type:"facet"}:{...t,...e,facet:void 0,maxFacetHits:void 0,facetQuery:void 0})}),!e)throw Error("Parameter `searchMethodParams` is required when calling `search`.");if(!e.requests)throw Error("Parameter `searchMethodParams.requests` is required when calling `search`.");let r={method:"POST",path:"/1/indexes/*/queries",queryParameters:{},headers:{},data:e,useReadTransporter:!0,cacheable:!0};return o.request(r,t)},searchDictionaryEntries({dictionaryName:e,searchDictionaryEntriesParams:t},r){if(!e)throw Error("Parameter `dictionaryName` is required when calling `searchDictionaryEntries`.");if(!t)throw Error("Parameter `searchDictionaryEntriesParams` is required when calling `searchDictionaryEntries`.");if(!t.query)throw Error("Parameter `searchDictionaryEntriesParams.query` is required when calling `searchDictionaryEntries`.");let n="/1/dictionaries/{dictionaryName}/search".replace("{dictionaryName}",encodeURIComponent(e));return o.request({method:"POST",path:n,queryParameters:{},headers:{},data:t,useReadTransporter:!0,cacheable:!0},r)},searchForFacetValues({indexName:e,facetName:t,searchForFacetValuesRequest:r},n){if(!e)throw Error("Parameter `indexName` is required when calling `searchForFacetValues`.");if(!t)throw Error("Parameter `facetName` is required when calling `searchForFacetValues`.");let a="/1/indexes/{indexName}/facets/{facetName}/query".replace("{indexName}",encodeURIComponent(e)).replace("{facetName}",encodeURIComponent(t));return o.request({method:"POST",path:a,queryParameters:{},headers:{},data:r||{},useReadTransporter:!0,cacheable:!0},n)},searchRules({indexName:e,searchRulesParams:t},r){if(!e)throw Error("Parameter `indexName` is required when calling `searchRules`.");let n="/1/indexes/{indexName}/rules/search".replace("{indexName}",encodeURIComponent(e));return o.request({method:"POST",path:n,queryParameters:{},headers:{},data:t||{},useReadTransporter:!0,cacheable:!0},r)},searchSingleIndex({indexName:e,searchParams:t},r){if(!e)throw Error("Parameter `indexName` is required when calling `searchSingleIndex`.");let n="/1/indexes/{indexName}/query".replace("{indexName}",encodeURIComponent(e));return o.request({method:"POST",path:n,queryParameters:{},headers:{},data:t||{},useReadTransporter:!0,cacheable:!0},r)},searchSynonyms({indexName:e,searchSynonymsParams:t},r){if(!e)throw Error("Parameter `indexName` is required when calling `searchSynonyms`.");let n="/1/indexes/{indexName}/synonyms/search".replace("{indexName}",encodeURIComponent(e));return o.request({method:"POST",path:n,queryParameters:{},headers:{},data:t||{},useReadTransporter:!0,cacheable:!0},r)},searchUserIds(e,t){if(!e)throw Error("Parameter `searchUserIdsParams` is required when calling `searchUserIds`.");if(!e.query)throw Error("Parameter `searchUserIdsParams.query` is required when calling `searchUserIds`.");return o.request({method:"POST",path:"/1/clusters/mapping/search",queryParameters:{},headers:{},data:e,useReadTransporter:!0,cacheable:!0},t)},setDictionarySettings(e,t){if(!e)throw Error("Parameter `dictionarySettingsParams` is required when calling `setDictionarySettings`.");if(!e.disableStandardEntries)throw Error("Parameter `dictionarySettingsParams.disableStandardEntries` is required when calling `setDictionarySettings`.");return o.request({method:"PUT",path:"/1/dictionaries/*/settings",queryParameters:{},headers:{},data:e},t)},setSettings({indexName:e,indexSettings:t,forwardToReplicas:r},n){if(!e)throw Error("Parameter `indexName` is required when calling `setSettings`.");if(!t)throw Error("Parameter `indexSettings` is required when calling `setSettings`.");let a="/1/indexes/{indexName}/settings".replace("{indexName}",encodeURIComponent(e)),i={};return void 0!==r&&(i.forwardToReplicas=r.toString()),o.request({method:"PUT",path:a,queryParameters:i,headers:{},data:t},n)},updateApiKey({key:e,apiKey:t},r){if(!e)throw Error("Parameter `key` is required when calling `updateApiKey`.");if(!t)throw Error("Parameter `apiKey` is required when calling `updateApiKey`.");if(!t.acl)throw Error("Parameter `apiKey.acl` is required when calling `updateApiKey`.");let n="/1/keys/{key}".replace("{key}",encodeURIComponent(e));return o.request({method:"PUT",path:n,queryParameters:{},headers:{},data:t},r)}}}({appId:e,apiKey:t,timeouts:{connect:1e3,read:2e3,write:3e4},logger:b(),requester:f(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:g(),requestsCache:g({serializable:!1}),hostsCache:m({caches:[p({key:`${$}-${e}`}),g()]}),...r})}var J="1.40.1",X=["eu","us"];function Z(e){return"onDemand"===e.type}function ee(e){return"schedule"===e.type}function et(e){return"subscription"===e.type}function er(e,t,r,n){if(!e||"string"!=typeof e)throw Error("`appId` is missing.");if(!t||"string"!=typeof t)throw Error("`apiKey` is missing.");if(!r||r&&("string"!=typeof r||!X.includes(r)))throw Error(`\`region\` is required and must be one of the following: ${X.join(", ")}`);return function({appId:e,apiKey:t,authMode:r,algoliaAgents:n,region:a,...i}){let o=y(e,t,r),s=_({hosts:[{url:"data.{region}.algolia.com".replace("{region}",a),accept:"readWrite",protocol:"https"}],...i,algoliaAgent:w({algoliaAgents:n,client:"Ingestion",version:J}),baseHeaders:{"content-type":"text/plain",...o.headers(),...i.baseHeaders},baseQueryParameters:{...o.queryParameters(),...i.baseQueryParameters}});return{transporter:s,appId:e,apiKey:t,clearCache:()=>Promise.all([s.requestsCache.clear(),s.responsesCache.clear()]).then(()=>void 0),get _ua(){return s.algoliaAgent.value},addAlgoliaAgent(e,t){s.algoliaAgent.add({segment:e,version:t})},setClientApiKey({apiKey:e}){r&&"WithinHeaders"!==r?s.baseQueryParameters["x-algolia-api-key"]=e:s.baseHeaders["x-algolia-api-key"]=e},async chunkedPush({indexName:e,objects:t,action:r="addObject",waitForTasks:n,batchSize:a=1e3,referenceIndexName:i},o){let s=[],l=0,u=[],c=Math.floor(a/10)||a;for(let[d,h]of t.entries())if(s.push(h),(s.length===a||d===t.length-1)&&(u.push(await this.push({indexName:e,pushTaskPayload:{action:r,records:s},referenceIndexName:i},o)),s=[]),n&&u.length>0&&(u.length%c==0||d===t.length-1)){for(let e of u.slice(l,l+c)){if(!e.eventID)throw Error("received unexpected response from the push endpoint, eventID must not be undefined");let t=0;await v({func:async()=>
1{if(void 0===e.eventID||!e.eventID)throw Error("received unexpected response from the push endpoint, eventID must not be undefined");return this.getEvent({runID:e.runID,eventID:e.eventID}).catch(e=>{if(404!==e.status)throw e})},validate:e=>void 0!==e,aggregator:()=>t+=1,error:{validate:()=>t>=50,message:()=>`The maximum number of retries exceeded. (${t}/50)`},timeout:()=>Math.min(500*t,5e3)})}l+=c}return u},createAuthentication(e,t){if(!e)throw Error("Parameter `authenticationCreate` is required when calling `createAuthentication`.");if(!e.type)throw Error("Parameter `authenticationCreate.type` is required when calling `createAuthentication`.");if(!e.name)throw Error("Parameter `authenticationCreate.name` is required when calling `createAuthentication`.");if(!e.input)throw Error("Parameter `authenticationCreate.input` is required when calling `createAuthentication`.");return s.request({method:"POST",path:"/1/authentications",queryParameters:{},headers:{},data:e},t)},createDestination(e,t){if(!e)throw Error("Parameter `destinationCreate` is required when calling `createDestination`.");if(!e.type)throw Error("Parameter `destinationCreate.type` is required when calling `createDestination`.");if(!e.name)throw Error("Parameter `destinationCreate.name` is required when calling `createDestination`.");if(!e.input)throw Error("Parameter `destinationCreate.input` is required when calling `createDestination`.");return s.request({method:"POST",path:"/1/destinations",queryParameters:{},headers:{},data:e},t)},createSource(e,t){if(!e)throw Error("Parameter `sourceCreate` is required when calling `createSource`.");if(!e.type)throw Error("Parameter `sourceCreate.type` is required when calling `createSource`.");if(!e.name)throw Error("Parameter `sourceCreate.name` is required when calling `createSource`.");return s.request({method:"POST",path:"/1/sources",queryParameters:{},headers:{},data:e},t)},createTask(e,t){if(!e)throw Error("Parameter `taskCreate` is required when calling `createTask`.");if(!e.sourceID)throw Error("Parameter `taskCreate.sourceID` is required when calling `createTask`.");if(!e.destinationID)throw Error("Parameter `taskCreate.destinationID` is required when calling `createTask`.");if(!e.action)throw Error("Parameter `taskCreate.action` is required when calling `createTask`.");return s.request({method:"POST",path:"/2/tasks",queryParameters:{},headers:{},data:e},t)},createTaskV1(e,t){if(!e)throw Error("Parameter `taskCreate` is required when calling `createTaskV1`.");if(!e.sourceID)throw Error("Parameter `taskCreate.sourceID` is required when calling `createTaskV1`.");if(!e.destinationID)throw Error("Parameter `taskCreate.destinationID` is required when calling `createTaskV1`.");if(!e.trigger)throw Error("Parameter `taskCreate.trigger` is required when calling `createTaskV1`.");if(!e.action)throw Error("Parameter `taskCreate.action` is required when calling `createTaskV1`.");return s.request({method:"POST",path:"/1/tasks",queryParameters:{},headers:{},data:e},t)},createTransformation(e,t){if(!e)throw Error("Parameter `transformationCreate` is required when calling `createTransformation`.");if(!e.name)throw Error("Parameter `transformationCreate.name` is required when calling `createTransformation`.");return s.request({method:"POST",path:"/1/transformations",queryParameters:{},headers:{},data:e},t)},customDelete({path:e,parameters:t},r){if(!e)throw Error("Parameter `path` is required when calling `customDelete`.");let n="/{path}".replace("{path}",e);return s.request({method:"DELETE",path:n,queryParameters:t||{},headers:{}},r)},customGet({path:e,parameters:t},r){if(!e)throw Error("Parameter `path` is required when calling `customGet`.");let n="/{path}".replace("{path}",e);return s.request({method:"GET",path:n,queryParameters:t||{},headers:{}},r)},customPost({path:e,parameters:t,body:r},n){if(!e)throw Error("Parameter `path` is required when calling `customPost`.");let a="/{path}".replace("{path}",e);return s.request({method:"POST",path:a,queryParameters:t||{},headers:{},data:r||{}},n)},customPut({path:e,parameters:t,body:r},n){if(!e)throw Error("Parameter `path` is required when calling `customPut`.");let a="/{path}".replace("{path}",e);return s.request({method:"PUT",path:a,queryParameters:t||{},headers:{},data:r||{}},n)},deleteAuthentication({authenticationID:e},t){if(!e)throw Error("Parameter `authenticationID` is required when calling `deleteAuthentication`.");let r="/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e));return s.request({method:"DELETE",path:r,queryParameters:{},headers:{}},t)},deleteDestination({destinationID:e},t){if(!e)throw Error("Parameter `destinationID` is required when calling `deleteDestination`.");let r="/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e));return s.request({method:"DELETE",path:r,queryParameters:{},headers:{}},t)},deleteSource({sourceID:e},t){if(!e)throw Error("Parameter `sourceID` is required when calling `deleteSource`.");let r="/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e));return s.request({method:"DELETE",path:r,queryParameters:{},headers:{}},t)},deleteTask({taskID:e},t){if(!e)throw Error("Parameter `taskID` is required when calling `deleteTask`.");let r="/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e));return s.request({method:"DELETE",path:r,queryParameters:{},headers:{}},t)},deleteTaskV1({taskID:e},t){if(!e)throw Error("Parameter `taskID` is required when calling `deleteTaskV1`.");let r="/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e));return s.request({method:"DELETE",path:r,queryParameters:{},headers:{}},t)},deleteTransformation({transformationID:e},t){if(!e)throw Error("Parameter `transformationID` is required when calling `deleteTransformation`.");let r="/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e));return s.request({method:"DELETE",path:r,queryParameters:{},headers:{}},t)},disableTask({taskID:e},t){if(!e)throw Error("Parameter `taskID` is required when calling `disableTask`.");let r="/2/tasks/{taskID}/disable".replace("{taskID}",encodeURIComponent(e));return s.request({method:"PUT",path:r,queryParameters:{},headers:{}},t)},disableTaskV1({taskID:e},t){if(!e)throw Error("Parameter `taskID` is required when calling `disableTaskV1`.");let r="/1/tasks/{taskID}/disable".replace("{taskID}",encodeURIComponent(e));return s.request({method:"PUT",path:r,queryParameters:{},headers:{}},t)},enableTask({taskID:e},t){if(!e)throw Error("Parameter `taskID` is required when calling `enableTask`.");let r="/2/tasks/{taskID}/enable".replace("{taskID}",encodeURIComponent(e));return s.request({method:"PUT",path:r,queryParameters:{},headers:{}},t)},enableTaskV1({taskID:e},t){if(!e)throw Error("Parameter `taskID` is required when calling `enableTaskV1`.");let r="/1/tasks/{taskID}/enable".replace("{taskID}",encodeURIComponent(e));return s.request({method:"PUT",path:r,queryParameters:{},headers:{}},t)},getAuthentication({authenticationID:e},t){if(!e)throw Error("Parameter `authenticationID` is required when calling `getAuthentication`.");let r="/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e));return s.request({method:"GET",path:r,queryParameters:{},headers:{}},t)},getDestination({destinationID:e},t){if(!e)throw Error("Parameter `destinationID` is required when calling `getDestination`.");let r="/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e));return s.request({method:"GET",path:r,queryParameters:{},headers:{}},t)},getEvent({runID:e,eventID:t},r){if(!e)throw Error("Parameter `runID` is required when calling `getEvent`.");if(!t)throw Error("Parameter `eventID` is required when calling `getEvent`.");let n="/1/runs/{runID}/events/{eventID}".replace("{runID}",encodeURIComponent(e)).replace("{eventID}",encodeURIComponent(t));return s.request({method:"GET",path:n,queryParameters:{},headers:{}},r)},getRun({runID:e},t){if(!e)throw Error("Parameter `runID` is required when calling `getRun`.");let r="/1/runs/{runID}".replace("{runID}",encodeURIComponent(e));return s.request({method:"GET",path:r,queryParameters:{},headers:{}},t)},getSource({sourceID:e},t){if(!e)throw Error("Parameter `sourceID` is required when calling `getSource`.");let r="/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e));return s.request({method:"GET",path:r,queryParameters:{},headers:{}},t)},getTask({taskID:e},t){if(!e)throw Error("Parameter `taskID` is required when calling `getTask`.");let r="/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e));return s.request({method:"GET",path:r,queryParameters:{},headers:{}},t)},getTaskV1({taskID:e},t){if(!e)throw Error("Parameter `taskID` is required when calling `getTaskV1`.");let r="/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e));return s.request({method:"GET",path:r,queryParameters:{},headers:{}},t)},getTransformation({transformationID:e},t){if(!e)throw Error("Parameter `transformationID` is required when calling `getTransformation`.");let r="/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e));return s.request({method:"GET",path:r,queryParameters:{},headers:{}},t)},listAuthentications({itemsPerPage:e,page:t,type:r,platform:n,sort:
1a,order:i}={},o){let l={};return void 0!==e&&(l.itemsPerPage=e.toString()),void 0!==t&&(l.page=t.toString()),void 0!==r&&(l.type=r.toString()),void 0!==n&&(l.platform=n.toString()),void 0!==a&&(l.sort=a.toString()),void 0!==i&&(l.order=i.toString()),s.request({method:"GET",path:"/1/authentications",queryParameters:l,headers:{}},o)},listDestinations({itemsPerPage:e,page:t,type:r,authenticationID:n,transformationID:a,sort:i,order:o}={},l){let u={};return void 0!==e&&(u.itemsPerPage=e.toString()),void 0!==t&&(u.page=t.toString()),void 0!==r&&(u.type=r.toString()),void 0!==n&&(u.authenticationID=n.toString()),void 0!==a&&(u.transformationID=a.toString()),void 0!==i&&(u.sort=i.toString()),void 0!==o&&(u.order=o.toString()),s.request({method:"GET",path:"/1/destinations",queryParameters:u,headers:{}},l)},listEvents({runID:e,itemsPerPage:t,page:r,status:n,type:a,sort:i,order:o,startDate:l,endDate:u},c){if(!e)throw Error("Parameter `runID` is required when calling `listEvents`.");let d="/1/runs/{runID}/events".replace("{runID}",encodeURIComponent(e)),h={};return void 0!==t&&(h.itemsPerPage=t.toString()),void 0!==r&&(h.page=r.toString()),void 0!==n&&(h.status=n.toString()),void 0!==a&&(h.type=a.toString()),void 0!==i&&(h.sort=i.toString()),void 0!==o&&(h.order=o.toString()),void 0!==l&&(h.startDate=l.toString()),void 0!==u&&(h.endDate=u.toString()),s.request({method:"GET",path:d,queryParameters:h,headers:{}},c)},listRuns({itemsPerPage:e,page:t,status:r,type:n,taskID:a,sort:i,order:o,startDate:l,endDate:u}={},c){let d={};return void 0!==e&&(d.itemsPerPage=e.toString()),void 0!==t&&(d.page=t.toString()),void 0!==r&&(d.status=r.toString()),void 0!==n&&(d.type=n.toString()),void 0!==a&&(d.taskID=a.toString()),void 0!==i&&(d.sort=i.toString()),void 0!==o&&(d.order=o.toString()),void 0!==l&&(d.startDate=l.toString()),void 0!==u&&(d.endDate=u.toString()),s.request({method:"GET",path:"/1/runs",queryParameters:d,headers:{}},c)},listSources({itemsPerPage:e,page:t,type:r,authenticationID:n,sort:a,order:i}={},o){let l={};return void 0!==e&&(l.itemsPerPage=e.toString()),void 0!==t&&(l.page=t.toString()),void 0!==r&&(l.type=r.toString()),void 0!==n&&(l.authenticationID=n.toString()),void 0!==a&&(l.sort=a.toString()),void 0!==i&&(l.order=i.toString()),s.request({method:"GET",path:"/1/sources",queryParameters:l,headers:{}},o)},listTasks({itemsPerPage:e,page:t,action:r,enabled:n,sourceID:a,sourceType:i,destinationID:o,triggerType:l,withEmailNotifications:u,sort:c,order:d}={},h){let f={};return void 0!==e&&(f.itemsPerPage=e.toString()),void 0!==t&&(f.page=t.toString()),void 0!==r&&(f.action=r.toString()),void 0!==n&&(f.enabled=n.toString()),void 0!==a&&(f.sourceID=a.toString()),void 0!==i&&(f.sourceType=i.toString()),void 0!==o&&(f.destinationID=o.toString()),void 0!==l&&(f.triggerType=l.toString()),void 0!==u&&(f.withEmailNotifications=u.toString()),void 0!==c&&(f.sort=c.toString()),void 0!==d&&(f.order=d.toString()),s.request({method:"GET",path:"/2/tasks",queryParameters:f,headers:{}},h)},listTasksV1({itemsPerPage:e,page:t,action:r,enabled:n,sourceID:a,destinationID:i,triggerType:o,sort:l,order:u}={},c){let d={};return void 0!==e&&(d.itemsPerPage=e.toString()),void 0!==t&&(d.page=t.toString()),void 0!==r&&(d.action=r.toString()),void 0!==n&&(d.enabled=n.toString()),void 0!==a&&(d.sourceID=a.toString()),void 0!==i&&(d.destinationID=i.toString()),void 0!==o&&(d.triggerType=o.toString()),void 0!==l&&(d.sort=l.toString()),void 0!==u&&(d.order=u.toString()),s.request({method:"GET",path:"/1/tasks",queryParameters:d,headers:{}},c)},listTransformations({itemsPerPage:e,page:t,sort:r,order:n,type:a}={},i){let o={};return void 0!==e&&(o.itemsPerPage=e.toString()),void 0!==t&&(o.page=t.toString()),void 0!==r&&(o.sort=r.toString()),void 0!==n&&(o.order=n.toString()),void 0!==a&&(o.type=a.toString()),s.request({method:"GET",path:"/1/transformations",queryParameters:o,headers:{}},i)},push({indexName:e,pushTaskPayload:t,watch:r,referenceIndexName:n},a){if(!e)throw Error("Parameter `indexName` is required when calling `push`.");if(!t)throw Error("Parameter `pushTaskPayload` is required when calling `push`.");if(!t.action)throw Error("Parameter `pushTaskPayload.action` is required when calling `push`.");if(!t.records)throw Error("Parameter `pushTaskPayload.records` is required when calling `push`.");let i="/1/push/{indexName}".replace("{indexName}",encodeURIComponent(e)),o={};return void 0!==r&&(o.watch=r.toString()),void 0!==n&&(o.referenceIndexName=n.toString()),a={timeouts:{connect:18e4,read:18e4,write:18e4,...a?.timeouts}},s.request({method:"POST",path:i,queryParameters:o,headers:{},data:t},a)},pushTask({taskID:e,pushTaskPayload:t,watch:r},n){if(!e)throw Error("Parameter `taskID` is required when calling `pushTask`.");if(!t)throw Error("Parameter `pushTaskPayload` is required when calling `pushTask`.");if(!t.action)throw Error("Parameter `pushTaskPayload.action` is required when calling `pushTask`.");if(!t.records)throw Error("Parameter `pushTaskPayload.records` is required when calling `pushTask`.");let a="/2/tasks/{taskID}/push".replace("{taskID}",encodeURIComponent(e)),i={};return void 0!==r&&(i.watch=r.toString()),n={timeouts:{connect:18e4,read:18e4,write:18e4,...n?.timeouts}},s.request({method:"POST",path:a,queryParameters:i,headers:{},data:t},n)},replaceTask({taskID:e,taskReplace:t},r){if(!e)throw Error("Parameter `taskID` is required when calling `replaceTask`.");if(!t)throw Error("Parameter `taskReplace` is required when calling `replaceTask`.");if(!t.destinationID)throw Error("Parameter `taskReplace.destinationID` is required when calling `replaceTask`.");if(!t.action)throw Error("Parameter `taskReplace.action` is required when calling `replaceTask`.");let n="/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e));return s.request({method:"PUT",path:n,queryParameters:{},headers:{},data:t},r)},runSource({sourceID:e,runSourcePayload:t},r){if(!e)throw Error("Parameter `sourceID` is required when calling `runSource`.");let n="/1/sources/{sourceID}/run".replace("{sourceID}",encodeURIComponent(e));return s.request({method:"POST",path:n,queryParameters:{},headers:{},data:t||{}},r)},runTask({taskID:e,runTaskPayload:t},r){if(!e)throw Error("Parameter `taskID` is required when calling `runTask`.");let n="/2/tasks/{taskID}/run".replace("{taskID}",encodeURIComponent(e));return s.request({method:"POST",path:n,queryParameters:{},headers:{},data:t||{}},r)},runTaskV1({taskID:e,runTaskPayload:t},r){if(!e)throw Error("Parameter `taskID` is required when calling `runTaskV1`.");let n="/1/tasks/{taskID}/run".replace("{taskID}",encodeURIComponent(e));return s.request({method:"POST",path:n,queryParameters:{},headers:{},data:t||{}},r)},searchAuthentications(e,t){if(!e)throw Error("Parameter `authenticationSearch` is required when calling `searchAuthentications`.");if(!e.authenticationIDs)throw Error("Parameter `authenticationSearch.authenticationIDs` is required when calling `searchAuthentications`.");return s.request({method:"POST",path:"/1/authentications/search",queryParameters:{},headers:{},data:e},t)},searchDestinations(e,t){if(!e)throw Error("Parameter `destinationSearch` is required when calling `searchDestinations`.");if(!e.destinationIDs)throw Error("Parameter `destinationSearch.destinationIDs` is required when calling `searchDestinations`.");return s.request({method:"POST",path:"/1/destinations/search",queryParameters:{},headers:{},data:e},t)},searchSources(e,t){if(!e)throw Error("Parameter `sourceSearch` is required when calling `searchSources`.");if(!e.sourceIDs)throw Error("Parameter `sourceSearch.sourceIDs` is required when calling `searchSources`.");return s.request({method:"POST",path:"/1/sources/search",queryParameters:{},headers:{},data:e},t)},searchTasks(e,t){if(!e)throw Error("Parameter `taskSearch` is required when calling `searchTasks`.");if(!e.taskIDs)throw Error("Parameter `taskSearch.taskIDs` is required when calling `searchTasks`.");return s.request({method:"POST",path:"/2/tasks/search",queryParameters:{},headers:{},data:e},t)},searchTasksV1(e,t){if(!e)throw Error("Parameter `taskSearch` is required when calling `searchTasksV1`.");if(!e.taskIDs)throw Error("Parameter `taskSearch.taskIDs` is required when calling `searchTasksV1`.");return s.request({method:"POST",path:"/1/tasks/search",queryParameters:{},headers:{},data:e},t)},searchTransformations(e,t){if(!e)throw Error("Parameter `transformationSearch` is required when calling `searchTransformations`.");if(!e.transformationIDs)throw Error("Parameter `transformationSearch.transformationIDs` is required when calling `searchTransformations`.");return s.request({method:"POST",path:"/1/transformations/search",queryParameters:{},headers:{},data:e},t)},triggerDockerSourceDiscover({sourceID:e},t){if(!e)throw Error("Parameter `sourceID` is required when calling `triggerDockerSourceDiscover`.");let r="/1/sources/{sourceID}/discover".replace("{sourceID}",encodeURIComponent(e));return t={timeouts:{connect:18e4,read:18e4,write:18e4,...t?.timeouts}},s.request({method:"POST",path:r,queryParameters:{},headers:{}},t)},tryTransformation(e,t){if(!e)throw Error("Parameter `transformationTry` is required when calling `tryTransformation`.");if(!e.sampleRecord)throw Error("Parameter `transformationTry.sampleRecord` is required when calling `tryTransformation`.");return s.request({method:"POST",path:"/1/transformations/try",queryParameters:{},headers:{},data:e},t)},tryTransformationBeforeUpdate({transformationID:e,transformationTry:t},r){if(!e)throw Error("Parameter `transformationID` is required when calling `tryTransformationBeforeUpdate`.");if(!t)throw Error("Parameter `transformationTry` is required when calling `tryTransformationBeforeUpdate`.");if(!t.sampleRecord)throw Error("Parameter `transformationTry.sampleRecord` is required when calling `tryTransformationBeforeUpdate`.");let n="/1/transformations/{transformationID}/try".replace("{transformationID}",encodeURIComponent(e));return s.request({method:"POST",path:n,queryParameters:{},headers:{},data:t},r)},updateAuthentication({authenticationID:e,authenticationUpdate:t},r){if(!e)throw Error("Parameter `authenticationID` is required when calling `updateAuthentication`.");if(!t)throw Error("Parameter `authenticationUpdate` is required when calling `updateAuthentication`.");let n="/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e));return s.request({method:"PATCH",path:n,queryParameters:{},headers:{},data:t},r)},updateDestination({destinationID:e,destinationUpdate:t},r){if(!e)throw Error("Parameter `destinationID` is required when calling `updateDestination`.");if(!t)throw Error("Parameter `destinationUpdate` is required when calling `updateDestination`.");let n="/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e));return s.request({method:"PATCH",path:n,queryParameters:{},headers:{},data:t},r)},updateSource({sourceID:e,sourceUpdate:t},r){if(!e)throw Error("Parameter `sourceID` is required when calling `updateSource`.");if(!t)throw Error("Parameter `sourceUpdate` is required when calling `updateSource`.");let n="/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e));return s.request({method:"PATCH",path:n,queryParameters:{},headers:{},data:t},r)},updateTask({taskID:e,taskUpdate:t},r){if(!e)throw Error("Parameter `taskID` is required when calling `updateTask`.");
1if(!t)throw Error("Parameter `taskUpdate` is required when calling `updateTask`.");let n="/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e));return s.request({method:"PATCH",path:n,queryParameters:{},headers:{},data:t},r)},updateTaskV1({taskID:e,taskUpdate:t},r){if(!e)throw Error("Parameter `taskID` is required when calling `updateTaskV1`.");if(!t)throw Error("Parameter `taskUpdate` is required when calling `updateTaskV1`.");let n="/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e));return s.request({method:"PATCH",path:n,queryParameters:{},headers:{},data:t},r)},updateTransformation({transformationID:e,transformationCreate:t},r){if(!e)throw Error("Parameter `transformationID` is required when calling `updateTransformation`.");if(!t)throw Error("Parameter `transformationCreate` is required when calling `updateTransformation`.");if(!t.name)throw Error("Parameter `transformationCreate.name` is required when calling `updateTransformation`.");let n="/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e));return s.request({method:"PUT",path:n,queryParameters:{},headers:{},data:t},r)},validateSource:(e,t)=>(t={timeouts:{connect:18e4,read:18e4,write:18e4,...t?.timeouts}},s.request({method:"POST",path:"/1/sources/validate",queryParameters:{},headers:{},data:e||{}},t)),validateSourceBeforeUpdate({sourceID:e,sourceUpdate:t},r){if(!e)throw Error("Parameter `sourceID` is required when calling `validateSourceBeforeUpdate`.");if(!t)throw Error("Parameter `sourceUpdate` is required when calling `validateSourceBeforeUpdate`.");let n="/1/sources/{sourceID}/validate".replace("{sourceID}",encodeURIComponent(e));return r={timeouts:{connect:18e4,read:18e4,write:18e4,...r?.timeouts}},s.request({method:"POST",path:n,queryParameters:{},headers:{},data:t},r)}}}({appId:e,apiKey:t,region:r,timeouts:{connect:25e3,read:25e3,write:25e3},logger:b(),requester:f(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:g(),requestsCache:g({serializable:!1}),hostsCache:m({caches:[p({key:`${J}-${e}`}),g()]}),...n})}var en="1.40.1";function ea(e,t,r){if(!e||"string"!=typeof e)throw Error("`appId` is missing.");if(!t||"string"!=typeof t)throw Error("`apiKey` is missing.");return function({appId:e,apiKey:t,authMode:r,algoliaAgents:n,...a}){let i=y(e,t,r),o=_({hosts:[{url:"status.algolia.com",accept:"readWrite",protocol:"https"}],...a,algoliaAgent:w({algoliaAgents:n,client:"Monitoring",version:en}),baseHeaders:{"content-type":"text/plain",...i.headers(),...a.baseHeaders},baseQueryParameters:{...i.queryParameters(),...a.baseQueryParameters}});return{transporter:o,appId:e,apiKey:t,clearCache:()=>Promise.all([o.requestsCache.clear(),o.responsesCache.clear()]).then(()=>void 0),get _ua(){return o.algoliaAgent.value},addAlgoliaAgent(e,t){o.algoliaAgent.add({segment:e,version:t})},setClientApiKey({apiKey:e}){r&&"WithinHeaders"!==r?o.baseQueryParameters["x-algolia-api-key"]=e:o.baseHeaders["x-algolia-api-key"]=e},customDelete({path:e,parameters:t},r){if(!e)throw Error("Parameter `path` is required when calling `customDelete`.");let n="/{path}".replace("{path}",e);return o.request({method:"DELETE",path:n,queryParameters:t||{},headers:{}},r)},customGet({path:e,parameters:t},r){if(!e)throw Error("Parameter `path` is required when calling `customGet`.");let n="/{path}".replace("{path}",e);return o.request({method:"GET",path:n,queryParameters:t||{},headers:{}},r)},customPost({path:e,parameters:t,body:r},n){if(!e)throw Error("Parameter `path` is required when calling `customPost`.");let a="/{path}".replace("{path}",e);return o.request({method:"POST",path:a,queryParameters:t||{},headers:{},data:r||{}},n)},customPut({path:e,parameters:t,body:r},n){if(!e)throw Error("Parameter `path` is required when calling `customPut`.");let a="/{path}".replace("{path}",e);return o.request({method:"PUT",path:a,queryParameters:t||{},headers:{},data:r||{}},n)},getClusterIncidents({clusters:e},t){if(!e)throw Error("Parameter `clusters` is required when calling `getClusterIncidents`.");let r="/1/incidents/{clusters}
1".replace("{clusters}",encodeURIComponent(e));return o.request({method:"GET",path:r,queryParameters:{},headers:{}},t)},getClusterStatus({clusters:e},t){if(!e)throw Error("Parameter `clusters` is required when calling `getClusterStatus`.");let r="/1/status/{clusters}".replace("{clusters}",encodeURIComponent(e));return o.request({method:"GET",path:r,queryParameters:{},headers:{}},t)},getIncidents:e=>o.request({method:"GET",path:"/1/incidents",queryParameters:{},headers:{}},e),getIndexingTime({clusters:e},t){if(!e)throw Error("Parameter `clusters` is required when calling `getIndexingTime`.");let r="/1/indexing/{clusters}".replace("{clusters}",encodeURIComponent(e));return o.request({method:"GET",path:r,queryParameters:{},headers:{}},t)},getLatency({clusters:e},t){if(!e)throw Error("Parameter `clusters` is required when calling `getLatency`.");let r="/1/latency/{clusters}".replace("{clusters}",encodeURIComponent(e));return o.request({method:"GET",path:r,queryParameters:{},headers:{}},t)},getMetrics({metric:e,period:t},r){if(!e)throw Error("Parameter `metric` is required when calling `getMetrics`.");if(!t)throw Error("Parameter `period` is required when calling `getMetrics`.");let n="/1/infrastructure/{metric}/period/{period}".replace("{metric}",encodeURIComponent(e)).replace("{period}",encodeURIComponent(t));return o.request({method:"GET",path:n,queryParameters:{},headers:{}},r)},getReachability({clusters:e},t){if(!e)throw Error("Parameter `clusters` is required when calling `getReachability`.");let r="/1/reachability/{clusters}/probes".replace("{clusters}",encodeURIComponent(e));return o.request({method:"GET",path:r,queryParameters:{},headers:{}},t)},getServers:e=>o.request({method:"GET",path:"/1/inventory/servers",queryParameters:{},headers:{}},e),getStatus:e=>o.request({method:"GET",path:"/1/status",queryParameters:{},headers:{}},e)}}({appId:e,apiKey:t,timeouts:{connect:1e3,read:2e3,write:3e4},logger:b(),requester:f(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:g(),requestsCache:g({serializable:!1}),hostsCache:m({caches:[p({key:`${en}-${e}`}),g()]}),...r})}var ei="5.40.1";function eo(e,t,r){if(!e||"string"!=typeof e)throw Error("`appId` is missing.");if(!t||"string"!=typeof t)throw Error("`apiKey` is missing.");return function({appId:e,apiKey:t,authMode:r,algoliaAgents:n,...a}){let i=y(e,t,r),o=_({hosts:[{url:`${e}-dsn.algolia.net`,accept:"read",protocol:"https"},{url:`${e}.algolia.net`,accept:"write",protocol:"https"}].concat(T([{url:`${e}-1.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${e}-2.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${e}-3.algolianet.com`,accept:"readWrite",protocol:"https"}])),...a,algoliaAgent:w({algoliaAgents:n,client:"Recommend",version:ei}),baseHeaders:{"content-type":"text/plain",...i.headers(),...a.baseHeaders},baseQueryParameters:{...i.queryParameters(),...a.baseQueryParameters}});return{transporter:o,appId:e,apiKey:t,clearCache:()=>Promise.all([o.requestsCache.clear(),o.responsesCache.clear()]).then(()=>void 0),get _ua(){return o.algoliaAgent.value},addAlgoliaAgent(e,t){o.algoliaAgent.add({segment:e,version:t})},setClientApiKey({apiKey:e}){r&&"WithinHeaders"!==r?o.baseQueryParameters["x-algolia-api-key"]=e:o.baseHeaders["x-algolia-api-key"]=e},batchRecommendRules({indexName:e,model:t,recommendRule:r},n){if(!e)throw Error("Parameter `indexName` is required when calling `batchRecommendRules`.");if(!t)throw Error("Parameter `model` is required when calling `batchRecommendRules`.");let a="/1/indexes/{indexName}/{model}/recommend/rules/batch".replace("{indexName}",encodeURIComponent(e)).replace("{model}",encodeURIComponent(t));return o.request({method:"POST",path:a,queryParameters:{},headers:{},data:r||{}},n)},customDelete({path:e,parameters:t},r){if(!e)throw Error("Parameter `path` is required when calling `customDelete`.");let n="/{path}".replace("{path}",e);return o.request({method:"DELETE",path:n,queryParameters:t||{},headers:{}},r)},customGet({path:e,parameters:t},r){if(!e)throw Error("Parameter `path` is required when calling `customGet`.");let n="/{path}".replace("{path}",e);return o.request({method:"GET",path:n,queryParameters:t||{},headers:{}},r)},customPost({path:e,parameters:t,body:r},n){if(!e)throw Error("Parameter `path` is required when calling `customPost`.");let a="/{path}".replace("{path}",e);return o.request({method:"POST",path:a,queryParameters:t||{},headers:{},data:r||{}},n)},customPut({path:e,parameters:t,body:r},n){if(!e)throw Error("Parameter `path` is required when calling `customPut`.");let a="/{path}".replace("{path}",e);return o.request({method:"PUT",path:a,queryParameters:t||{},headers:{},data:r||{}},n)},deleteRecommendRule({indexName:e,model:t,objectID:r},n){if(!e)throw Error("Parameter `indexName` is required when calling `deleteRecommendRule`.");if(!t)throw Error("Parameter `model` is required when calling `deleteRecommendRule`.");if(!r)throw Error("Parameter `objectID` is required when calling `deleteRecommendRule`.");let a="/1/indexes/{indexName}/{model}/recommend/rules/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{model}",encodeURIComponent(t)).replace("{objectID}",encodeURIComponent(r));return o.request({method:"DELETE",path:a,queryParameters:{},headers:{}},n)},getRecommendRule({indexName:e,model:t,objectID:r},n){if(!e)throw Error("Parameter `indexName` is required when calling `getRecommendRule`.");if(!t)throw Error("Parameter `model` is required when calling `getRecommendRule`.");if(!r)throw Error("Parameter `objectID` is required when calling `getRecommendRule`.");let a="/1/indexes/{indexName}/{model}/recommend/rules/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{model}",encodeURIComponent(t)).replace("{objectID}",encodeURIComponent(r));return o.request({method:"GET",path:a,queryParameters:{},headers:{}},n)},getRecommendStatus({indexName:e,model:t,taskID:r},n){if(!e)throw Error("Parameter `indexName` is required when calling `getRecommendStatus`.");if(!t)throw Error("Parameter `model` is required when calling `getRecommendStatus`.");if(!r)throw Error("Parameter `taskID` is required when calling `getRecommendStatus`.");let a="/1/indexes/{indexName}/{model}/task/{taskID}".replace("{indexName}",encodeURIComponent(e)).replace("{model}",encodeURIComponent(t)).replace("{taskID}",encodeURIComponent(r));return o.request({method:"GET",path:a,queryParameters:{},headers:{}},n)},getRecommendations(e,t){if(e&&Array.isArray(e)&&(e={requests:e}),!e)throw Error("Parameter `getRecommendationsParams` is required when calling `getRecommendations`.");if(!e.requests)throw Error("Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.");let r={method:"POST",path:"/1/indexes/*/recommendations",queryParameters:{},headers:{},data:e,useReadTransporter:!0,cacheable:!0};return o.request(r,t)},searchRecommendRules({indexName:e,model:t,searchRecommendRulesParams:r},n){if(!e)throw Error("Parameter `indexName` is required when calling `searchRecommendRules`.");if(!t)throw Error("Parameter `model` is required when calling `searchRecommendRules`.");let a="/1/indexes/{indexName}/{model}/recommend/rules/search".replace("{indexName}",encodeURIComponent(e)).replace("{model}",encodeURIComponent(t));return o.request({method:"POST",path:a,queryParameters:{},headers:{},data:r||{},useReadTransporter:!0,cacheable:!0},n)}}}({appId:e,apiKey:t,timeouts:{connect:1e3,read:2e3,write:3e4},logger:b(),requester:f(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:g(),requestsCache:g({serializable:!1}),hostsCache:m({caches:[p({key:`${ei}-${e}`}),g()]}),...r})}var es=Object.defineProperty,el=Object.getOwnPropertyDescriptor,eu=Object.getOwnPropertyNames,ec=Object.prototype.hasOwnProperty,ed=(e,t)=>{for(var r in t)es(e,r,{get:t[r],enumerable:!0})},eh=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let a of eu(t))ec.call(e,a)||a===r||es(e,a,{get:()=>t[a],enumerable:!(n=el(t,a))||n.enumerable});return e},ef=(e,t,r)=>(eh(e,t,"default"),r&&eh(r,t,"default")),ep={};ed(ep,{algoliasearch:()=>eg,apiClientVersion:()=>$});var em={};function eg(e,t,r){let n;if(!e||"string"!=typeof e)throw Error("`appId` is missing.");if(!t||"string"!=typeof t)throw Error("`apiKey` is missing.");let a=Y(e,t,r);if(r?.transformation){if(!r.transformation.region)throw Error("`region` must be provided when leveraging the transformation pipeline");n=er(e,t,r.transformation.region,r)}return{...a,async saveObjectsWithTransformation({indexName:e,objects:t,waitForTasks:a},i){if(!n)throw Error("`transformation.region` must be provided at client instantiation before calling this method.");if(!r?.transformation?.region)throw Error("`region` must be provided when leveraging the transformation pipeline");return n.chunkedPush({indexName:e,objects:t,action:"addObject",waitForTasks:a},i)},async partialUpdateObjectsWithTransformation({indexName:e,objects:t,createIfNotExists:a,waitForTasks:i},o){if(!n)throw Error("`transformation.region` must be provided at client instantiation before calling this method.");if(!r?.transformation?.region)throw Error("`region` must be provided when leveraging the transformation pipeline");return n.chunkedPush({indexName:e,objects:t,action:a?"partialUpdateObject":"partialUpdateObjectNoCreate",waitForTasks:i},o)}
1,async replaceAllObjectsWithTransformation({indexName:e,objects:t,batchSize:a,scopes:i},o){if(!n)throw Error("`transformation.region` must be provided at client instantiation before calling this method.");if(!r?.transformation?.region)throw Error("`region` must be provided when leveraging the transformation pipeline");let s=Math.floor(1e6*Math.random())+1e5,l=`${e}_tmp_${s}`;void 0===i&&(i=["settings","rules","synonyms"]);try{let r=await this.operationIndex({indexName:e,operationIndexParams:{operation:"copy",destination:l,scope:i}},o),s=await n.chunkedPush({indexName:l,objects:t,waitForTasks:!0,batchSize:a,referenceIndexName:e},o);await this.waitForTask({indexName:l,taskID:r.taskID}),r=await this.operationIndex({indexName:e,operationIndexParams:{operation:"copy",destination:l,scope:i}},o),await this.waitForTask({indexName:l,taskID:r.taskID});let u=await this.operationIndex({indexName:l,operationIndexParams:{operation:"move",destination:e}},o);return await this.waitForTask({indexName:l,taskID:u.taskID}),{copyOperationResponse:r,watchResponses:s,moveOperationResponse:u}}catch(e){throw await this.deleteIndex({indexName:l}),e}},get _ua(){return a.transporter.algoliaAgent.value},initAbtesting:r=>j(r.appId||e,r.apiKey||t,r.region,r.options),initAbtestingV3:r=>R(r.appId||e,r.apiKey||t,r.region,r.options),initAnalytics:r=>B(r.appId||e,r.apiKey||t,r.region,r.options),initIngestion:r=>er(r.appId||e,r.apiKey||t,r.region,r.options),initInsights:r=>z(r.appId||e,r.apiKey||t,r.region,r.options),initMonitoring:(r={})=>ea(r.appId||e,r.apiKey||t,r.options),initPersonalization:r=>H(r.appId||e,r.apiKey||t,r.region,r.options),initQuerySuggestions:r=>K(r.appId||e,r.apiKey||t,r.region,r.options),initRecommend:(r={})=>eo(r.appId||e,r.apiKey||t,r.options)}}ed(em,{apiClientVersion:()=>$}),ef(em,n),ef(em,a),ef(em,i),ef(em,o),ef(em,s),ef(em,l),ef(em,u),ef(em,c),ef(em,d),ef(em,h),ef(ep,em);let ey=null;try{ey=eg("ZHBCOJBQDF","86b4127ef613438a49718cc2fd34e044")}catch(e){console.error("[catalogService] Erreur initialisation Algolia:",e)}let ev="videos_new";async function ew(e){if(ey)try{return await ey.searchSingleIndex({indexName:ev,searchParams:{query:e,facets:["*"],distinct:10,hitsPerPage:100}})}catch(e){console.error(e)}}async function eb(e){if(ey)try{return await ey.searchSingleIndex({indexName:"pages",searchParams:{query:e,facets:["*"],distinct:66,hitsPerPage:15}})}catch(e){console.error(e)}}async function ex(e,t){if(!ey)return;let r=(()=>{if(!t)return;let e=Object.entries(t).filter(e=>{let[t,r]=e;return Array.isArray(r)&&r.length>0}),r=e.length;if(r)return 1===r?e.map(e=>{let[t,r]=e;return r.map(e=>"".concat(t,":").concat(e))}).flat():e.reduce((e,t)=>{let[r,n]=t;return[...e,n.map(e=>"".concat(r,":").concat(e))]},[])})();try{let t={query:e,facets:["*"],distinct:10,hitsPerPage:100};return r&&(t.facetFilters=r),await ey.searchSingleIndex({indexName:ev,searchParams:t})}catch(e){console.error(e)}}let eE={getFormations:async function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;try{var n,a;console.log("[catalogService] Appel getFormations:",{catalogFilters:e,sortType:t,userId:r});let i=await fetch("/api/catalog/formations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({catalogFilters:e,sortType:t,userId:r})});if(!i.ok)throw console.error("[catalogService] Erreur HTTP:",i.status),Error("HTTP error! status: ".concat(i.status));let o=await i.json();return console.log("[catalogService] R\xe9ponse getFormations:",{success:o.success,formationsLength:null==(n=o.formations)?void 0:n.length,formations:null==(a=o.formations)?void 0:a.slice(0,2)}),o.success?o.formations:[]}catch(e){return console.error("[catalogService] Erreur lors de la r\xe9cup\xe9ration des formations (".concat(t,"):"),e),[]}},getFilters:async()=>{try{let e=await fetch("/api/catalog/filters");if(!e.ok)throw Error("HTTP error! status: ".concat(e.status));let t=await e.json();return t.success?t.filters:[]}catch(e){return console.error("Erreur lors de la r\xe9cup\xe9ration des filtres:",e),[]}},toggleFavorite:async(e,t,r)=>{console.log("[catalogService] Appel toggleFavorite");try{let n=await fetch("/api/user/toggle-favorite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({courseId:e,userId:t,isFavorite:r})});if(!n.ok)throw Error("HTTP error! status: ".concat(n.status));return(await n.json()).success}catch(e){return console.error("Erreur lors de la mise \xe0 jour des favoris:",e),!1}}}},21407:(e,t,r)=>{"use strict";r.d(t,{$:()=>s,s:()=>o});var n=r(60388),a=r(46305),i=r(48149),o=class extends a.k{#m;#g;#i;#y;constructor(e){super(),this.#m=e.client,this.mutationId=e.mutationId,this.#i=e.mutationCache,this.#g=[],this.state=e.state||s(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#g.includes(e)||(this.#g.push(e),this.clearGcTimeout(),this.#i.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#g=this.#g.filter(t=>t!==e),this.scheduleGc(),this.#i.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#g.length||("pending"===this.state.status?this.scheduleGc():this.#i.remove(this))}continue(){return this.#y?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#v({type:"continue"})},r={client:this.#m,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#y=(0,i.II)({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#v({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#v({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#i.canRun(this)});let n="pending"===this.state.status,a=!this.#y.canStart();try{if(n)t();else{this.#v({type:"pending",variables:e,isPaused:a}),await this.#i.config.onMutate?.(e,this,r);let t=await this.options.onMutate?.(e,r);t!==this.state.context&&this.#v({type:"pending",context:t,variables:e,isPaused:a})}let i=await this.#y.start();return await this.#i.config.onSuccess?.(i,e,this.state.context,this,r),await this.options.onSuccess?.(i,e,this.state.context,r),await this.#i.config.onSettled?.(i,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(i,null,e,this.state.context,r),this.#v({type:"success",data:i}),i}catch(t){try{throw await this.#i.config.onError?.(t,e,this.state.context,this,r),await this.options.onError?.(t,e,this.state.context,r),await this.#i.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(void 0,t,e,this.state.context,r),t}finally{this.#v({type:"error",error:t})}}finally{this.#i.runNext(this)}}#v(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};
1case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),n.jG.batch(()=>{this.#g.forEach(t=>{t.onMutationUpdate(e)}),this.#i.notify({mutation:this,type:"updated",action:e})})}};function s(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}},21997:(e,t,r)=>{"use strict";r.d(t,{Lt:()=>q,Rx:()=>B,Zr:()=>U,EO:()=>D,$v:()=>M,ck:()=>j,wd:()=>N,r7:()=>L});var n=r(37876),a=r(14232),i=r(91844),o=r(10714),s=r(41222),l=r(33716),u=Symbol("radix.slottable"),c="AlertDialog",[d,h]=(0,i.A)(c,[s.Hs]),f=(0,s.Hs)(),p=e=>{let{__scopeAlertDialog:t,...r}=e,a=f(t);return(0,n.jsx)(s.bL,{...a,...r,modal:!0})};p.displayName=c,a.forwardRef((e,t)=>{let{__scopeAlertDialog:r,...a}=e,i=f(r);return(0,n.jsx)(s.l9,{...i,...a,ref:t})}).displayName="AlertDialogTrigger";var m=e=>{let{__scopeAlertDialog:t,...r}=e,a=f(t);return(0,n.jsx)(s.ZL,{...a,...r})};m.displayName="AlertDialogPortal";var g=a.forwardRef((e,t)=>{let{__scopeAlertDialog:r,...a}=e,i=f(r);return(0,n.jsx)(s.hJ,{...i,...a,ref:t})});g.displayName="AlertDialogOverlay";var y="AlertDialogContent",[v,w]=d(y),b=function(e){let t=({children:e})=>(0,n.jsx)(n.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=u,t}("AlertDialogContent"),x=a.forwardRef((e,t)=>{let{__scopeAlertDialog:r,children:i,...u}=e,c=f(r),d=a.useRef(null),h=(0,o.s)(t,d),p=a.useRef(null);return(0,n.jsx)(s.G$,{contentName:y,titleName:E,docsSlug:"alert-dialog",children:(0,n.jsx)(v,{scope:r,cancelRef:p,children:(0,n.jsxs)(s.UC,{role:"alertdialog",...c,...u,ref:h,onOpenAutoFocus:(0,l.mK)(u.onOpenAutoFocus,e=>{e.preventDefault(),p.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,n.jsx)(b,{children:i}),(0,n.jsx)(A,{contentRef:d})]})})})});x.displayName=y;var E="AlertDialogTitle",S=a.forwardRef((e,t)=>{let{__scopeAlertDialog:r,...a}=e,i=f(r);return(0,n.jsx)(s.hE,{...i,...a,ref:t})});S.displayName=E;var k="AlertDialogDescription",P=a.forwardRef((e,t)=>{let{__scopeAlertDialog:r,...a}=e,i=f(r);return(0,n.jsx)(s.VY,{...i,...a,ref:t})});P.displayName=k;var C=a.forwardRef((e,t)=>{let{__scopeAlertDialog:r,...a}=e,i=f(r);return(0,n.jsx)(s.bm,{...i,...a,ref:t})});C.displayName="AlertDialogAction";var I="AlertDialogCancel",T=a.forwardRef((e,t)=>{let{__scopeAlertDialog:r,...a}=e,{cancelRef:i}=w(I,r),l=f(r),u=(0,o.s)(t,i);return(0,n.jsx)(s.bm,{...l,...a,ref:u})});T.displayName=I;var A=({contentRef:e})=>{let t=`\`${y}\` requires a description for the component to be accessible for screen reader users. 2 3You can add a description to the \`${y}\` by passing a \`${k}\` component as a child, which also benefits sighted users by adding visible context to the dialog. 4 5Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${y}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. 6 7For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return a.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},_=r(45195),O=r(11061);let q=p,R=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)(g,{className:(0,_.cn)("fixed inset-0 z-[10000] 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",r),...a,ref:t})});R.displayName=g.displayName;let D=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsxs)(m,{children:[(0,n.jsx)(R,{}),(0,n.jsx)(x,{ref:t,className:(0,_.cn)("fixed left-[50%] top-[50%] z-[10001] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-popover text-popover-foreground 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:rou
7nded-lg",r),...a})]})});D.displayName=x.displayName;let N=e=>{let{className:t,...r}=e;return(0,n.jsx)("div",{className:(0,_.cn)("flex flex-col space-y-2 text-center sm:text-left",t),...r})};N.displayName="AlertDialogHeader";let j=e=>{let{className:t,...r}=e;return(0,n.jsx)("div",{className:(0,_.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...r})};j.displayName="AlertDialogFooter";let L=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)(S,{ref:t,className:(0,_.cn)("text-popover-foreground text-lg font-semibold",r),...a})});L.displayName=S.displayName;let M=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)(P,{ref:t,className:(0,_.cn)("text-sm text-muted-foreground dark:text-muted-foreground/90",r),...a})});M.displayName=P.displayName;let B=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)(C,{ref:t,className:(0,_.cn)((0,O.r)(),r),...a})});B.displayName=C.displayName;let U=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)(T,{ref:t,className:(0,_.cn)((0,O.r)({variant:"outline"}),"mt-2 sm:mt-0",r),...a})});U.displayName=T.displayName},22658:(e,t,r)=>{"use strict";r.d(t,{Oh:()=>i});var n=r(14232),a=0;function i(){n.useEffect(()=>{let e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??o()),document.body.insertAdjacentElement("beforeend",e[1]??o()),a++,()=>{1===a&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),a--}},[])}function o(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}},23551:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(17963).A)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},24181:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.camelCase=void 0;var r=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,a=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,s=function(e,t){return t.toUpperCase()},l=function(e,t){return"".concat(t,"-")};t.camelCase=function(e,t){var u;return(void 0===t&&(t={}),!(u=e)||a.test(u)||r.test(u))?e:(e=e.toLowerCase(),(e=t.reactCompat?e.replace(o,l):e.replace(i,l)).replace(n,s))}},25527:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(17963).A)("credit-card",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]])},28249:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(17963).A)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},29349:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(14232);let a=n.forwardRef(function(e,t){let{title:r,titleId:a,...i}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":a},i),r?n.createElement("title",{id:a},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.26 10.147a60.438 60.438 0 0 0-.491 6.347A48.62 48.62 0 0 1 12 20.904a48.62 48.62 0 0 1 8.232-4.41 60.46 60.46 0 0 0-.491-6.347m-15.482 0a50.636 50.636 0 0 0-2.658-.813A59.906 59.906 0 0 1 12 3.493a59.903 59.903 0 0 1 10.399 5.84c-.896.248-1.783.52-2.658.814m-15.482 0A50.717 50.717 0 0 1 12 13.489a50.702 50.702 0 0 1 7.74-3.342M6.75 15a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm0 0v-3.675A55.378 55.378 0 0 1 12 8.443m-7.007 11.55A5.981 5.981 0 0 0 6.75 15.75v-1.5"}))})},29454:(e,t,r)=>{"use strict";function n(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)"__proto__"!==n&&(e[n]=r[n])}return e}r.d(t,{A:()=>a});var a=function e(t,r){function a(e,a,i){if("undefined"!=typeof document){"number"==typeof(i=n({},r,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decode
7URIComponent).replace(/[()]/g,escape);var o="";for(var s in i)i[s]&&(o+="; "+s,!0!==i[s]&&(o+="="+i[s].split(";")[0]));return document.cookie=e+"="+t.write(a,e)+o}}return Object.create({set:a,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var r=document.cookie?document.cookie.split("; "):[],n={},a=0;a<r.length;a++){var i=r[a].split("="),o=i.slice(1).join("=");try{var s=decodeURIComponent(i[0]);if(s in n||(n[s]=t.read(o,s)),e===s)break}catch(e){}}return e?n[e]:n}},remove:function(e,t){a(e,"",n({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,n({},this.attributes,t))},withConverter:function(t){return e(n({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(r)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"})},30311:(e,t,r)=>{"use strict";r.d(t,{d:()=>a});let n={};function a(e,t){let r=t||n;return i(e,"boolean"!=typeof r.includeImageAlt||r.includeImageAlt,"boolean"!=typeof r.includeHtml||r.includeHtml)}function i(e,t,r){var n;if((n=e)&&"object"==typeof n){if("value"in e)return"html"!==e.type||r?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return o(e.children,t,r)}return Array.isArray(e)?o(e,t,r):""}function o(e,t,r){let n=[],a=-1;for(;++a<e.length;)n[a]=i(e[a],t,r);return n.join("")}},30649:(e,t,r)=>{"use strict";function n(e){return e&&"object"==typeof e?"position"in e||"type"in e?i(e.position):"start"in e||"end"in e?i(e):"line"in e||"column"in e?a(e):"":""}function a(e){return o(e&&e.line)+":"+o(e&&e.column)}function i(e){return a(e&&e.start)+"-"+a(e&&e.end)}function o(e){return e&&"number"==typeof e?e:1}r.d(t,{L:()=>n})},30738:(e,t,r)=>{"use strict";r.d(t,{A:()=>d});var n=r(37876),a=r(14232),i=r(48230),o=r.n(i),s=r(45282),l=r.n(s),u=r(39853),c=r(92035);function d(){let{user:e}=(0,u.ur)(),[t,r]=(0,a.useState)(null),[i,s]=(0,a.useState)(null);(0,a.useEffect)(()=>{var t;let r=async()=>{try{let e=await fetch("/api/trial-banners/active");if(e.ok){let t=await e.json(),r={};t.banners&&t.banners.forEach(e=>{r[e.key]=e}),s(r)}}catch(e){console.error("Failed to fetch trial banners",e)}};(null==e||null==(t=e.roles)?void 0:t.includes("trial"))&&r()},[null==e?void 0:e.roles]),(0,a.useEffect)(()=>{var t;let n=new Date((null==e||null==(t=e.subscription)?void 0:t.currentPeriodEnd)?e.subscription.currentPeriodEnd:Date.now()+864e5),a=()=>{let e=n-new Date;return e>0?{days:Math.floor(e/864e5),displayDays:Math.ceil(e/864e5),hours:Math.floor(e/36e5%24),minutes:Math.floor(e/1e3/60%60),seconds:Math.floor(e/1e3%60)}:null};r(a());let i=setInterval(()=>{r(a())},1e3);return()=>clearInterval(i)},[e]);let d=(null==e?void 0:e.signUpFrom)&&i?Object.keys(i).find(t=>e.signUpFrom.includes(t)):null,h=d?i[d]:null;return t&&h?(0,n.jsx)("div",{className:l().banner,children:(0,n.jsxs)("div",{className:l().container,children:[(0,n.jsxs)("div",{className:l().infoGroup,children:[(0,n.jsx)("div",{className:l().text,children:h.text}),(0,n.jsxs)("div",{className:l().priceWrapper,children:[(0,n.jsx)("span",{className:l().oldPrice,children:h.oldPrice})," ",(0,n.jsx)("span",{className:l().price,children:h.price})]})]}),(0,n.jsxs)("div",{className:l().actionGroup,children:[(0,n.jsx)("div",{className:l().actions,children:(0,n.jsx)(o(),{href:h.buttonLink,className:l().ctaButton,children:(0,n.jsx)(c.A,{variant:"secondaryDark",size:"small",children:h.buttonText})})}),(0,n.jsx)("div",{className:l().countdown,children:t.days>0?(0,n.jsx)(n.Fragment,{}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:l().divider}),(0,n.jsxs)("div",{className:l().timeWrapper,children:[(0,n.jsxs)("div",{className:l().timeBlock,children:[String(t.hours).padStart(2,"0"),(0,n.jsx)("span",{className:l().timeLabel,children:"h"})]}),(0,n.jsxs)("div",{className:l().timeBlock,children:[String(t.minutes).padStart(2,"0"),(0,n.jsx)("span",{className:l().timeLabel,children:"m"})]}),(0,n.jsxs)("div",{className:l().timeBlock,children:[String(t.seconds).padStart(2,"0"),(0,n.jsx)("span",{className:l().timeLabel,children:"s"})]})]})]})})]})]})}):null}},33338:(e,t,r)=>{"use strict";function n(e,t,r){let n=[],a=-1;for(;++a<e.length;){let i=e[a].resolveAll;i&&!n.includes(i)&&(t=i(t,r),n.push(i))}return t}r.d(t,{W:()=>n})},33716:(e,t,r)=>{"use strict";function n(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}r.d(t,{mK:()=>n}),"undefined"!=typeof window&&window.document&&window.document.createElement},34009:(e,t,r)=>{"use strict";
7Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{default:function(){return E},useLinkStatus:function(){return x}});let n=r(63732),a=r(37876),i=n._(r(14232)),o=r(84727),s=r(1623),l=r(170),u=r(70464),c=r(20125),d=r(242),h=r(63786),f=r(34327),p=r(9094),m=r(89203);r(35785);let g=new Set;function y(e,t,r,n){if((0,s.isLocalURL)(t)){if(!n.bypassPrefetchedCheck){let a=t+"%"+r+"%"+(void 0!==n.locale?n.locale:"locale"in e?e.locale:void 0);if(g.has(a))return;g.add(a)}e.prefetch(t,r,n).catch(e=>{})}}function v(e){return"string"==typeof e?e:(0,l.formatUrl)(e)}let w=i.default.forwardRef(function(e,t){let r,n,{href:l,as:g,children:w,prefetch:b=null,passHref:x,replace:E,shallow:S,scroll:k,locale:P,onClick:C,onNavigate:I,onMouseEnter:T,onTouchStart:A,legacyBehavior:_=!1,...O}=e;r=w,_&&("string"==typeof r||"number"==typeof r)&&(r=(0,a.jsx)("a",{children:r}));let q=i.default.useContext(d.RouterContext),R=!1!==b,{href:D,as:N}=i.default.useMemo(()=>{if(!q){let e=v(l);return{href:e,as:g?v(g):e}}let[e,t]=(0,o.resolveHref)(q,l,!0);return{href:e,as:g?(0,o.resolveHref)(q,g):t||e}},[q,l,g]),j=i.default.useRef(D),L=i.default.useRef(N);_&&(n=i.default.Children.only(r));let M=_?n&&"object"==typeof n&&n.ref:t,[B,U,F]=(0,h.useIntersection)({rootMargin:"200px"}),z=i.default.useCallback(e=>{(L.current!==N||j.current!==D)&&(F(),L.current=N,j.current=D),B(e)},[N,D,F,B]),V=(0,m.useMergedRef)(z,M);i.default.useEffect(()=>{q&&U&&R&&y(q,D,N,{locale:P})},[N,D,U,P,R,null==q?void 0:q.locale,q]);let W={ref:V,onClick(e){_||"function"!=typeof C||C(e),_&&n.props&&"function"==typeof n.props.onClick&&n.props.onClick(e),q&&(e.defaultPrevented||function(e,t,r,n,a,i,o,l,u){let{nodeName:c}=e.currentTarget;if(!("A"===c.toUpperCase()&&function(e){let t=e.currentTarget.getAttribute("target");return t&&"_self"!==t||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which}(e)||e.currentTarget.hasAttribute("download"))){if(!(0,s.isLocalURL)(r)){a&&(e.preventDefault(),location.replace(r));return}e.preventDefault(),(()=>{if(u){let e=!1;if(u({preventDefault:()=>{e=!0}}),e)return}let e=null==o||o;"beforePopState"in t?t[a?"replace":"push"](r,n,{shallow:i,locale:l,scroll:e}):t[a?"replace":"push"](n||r,{scroll:e})})()}}(e,q,D,N,E,S,k,P,I))},onMouseEnter(e){_||"function"!=typeof T||T(e),_&&n.props&&"function"==typeof n.props.onMouseEnter&&n.props.onMouseEnter(e),q&&y(q,D,N,{locale:P,priority:!0,bypassPrefetchedCheck:!0})},onTouchStart:function(e){_||"function"!=typeof A||A(e),_&&n.props&&"function"==typeof n.props.onTouchStart&&n.props.onTouchStart(e),q&&y(q,D,N,{locale:P,priority:!0,bypassPrefetchedCheck:!0})}};if((0,u.isAbsoluteUrl)(N))W.href=N;else if(!_||x||"a"===n.type&&!("href"in n.props)){let e=void 0!==P?P:null==q?void 0:q.locale;W.href=(null==q?void 0:q.isLocaleDomain)&&(0,f.getDomainLocale)(N,e,null==q?void 0:q.locales,null==q?void 0:q.domainLocales)||(0,p.addBasePath)((0,c.addLocale)(N,e,null==q?void 0:q.defaultLocale))}return _?i.default.cloneElement(n,W):(0,a.jsx)("a",{...O,...W,children:r})}),b=(0,i.createContext)({pending:!1}),x=()=>(0,i.useContext)(b),E=w;("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},34214:(e,t,r)=>{"use strict";r.d(t,{H:()=>o});var n=r(14232),a=r(89099),i=r(90293);function o(){let e=(0,a.useRouter)(),[t,r]=(0,n.useState)(()=>(0,i.A9)(window.location.href));return(0,n.useEffect)(()=>{let t=()=>r((0,i.A9)(window.location.href));return t(),e.events.on("routeChangeComplete",t),()=>e.events.off("routeChangeComplete",t)},[e.events]),t}},34318:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"unstable_rethrow",{enumerable:!0,get:function(){return function e(t){if((0,a.isNextRouterError)(t)||(0,n.isBailoutToCSRError)(t))throw t;t instanceof Error&&"cause"in t&&e(t.cause)}}});let n=r(1677),a=r(40497);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esMo
7dule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},34327:(e,t,r)=>{"use strict";function n(e,t,r,n){return!1}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getDomainLocale",{enumerable:!0,get:function(){return n}}),r(19783),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},34424:(e,t,r)=>{"use strict";r.d(t,{s:()=>o});var n=r(85583),a=r(11252);let i=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function o(e){return e.replace(i,s)}function s(e,t,r){if(t)return t;if(35===r.charCodeAt(0)){let e=r.charCodeAt(1),t=120===e||88===e;return(0,a.C)(r.slice(t?2:1),t?16:10)}return(0,n.s)(r)||e}},35785:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"errorOnce",{enumerable:!0,get:function(){return r}});let r=e=>{}},36779:(e,t,r)=>{"use strict";r.d(t,{$F:()=>l,Ay:()=>c,a5:()=>u});var n=r(37876),a=r(14232),i=r(47334),o=r(62734);let s=(0,a.createContext)();function l(e){let{children:t}=e,r=(0,i.d9)();return(0,n.jsx)(s.Provider,{value:{...r,moreFilters:o.Nl},children:t})}let u=()=>(0,a.useContext)(s),c=s},37149:(e,t,r)=>{"use strict";r.d(t,{Cp:()=>m,EN:()=>p,Eh:()=>c,F$:()=>f,GU:()=>I,MK:()=>d,S$:()=>a,ZM:()=>C,ZZ:()=>k,Zw:()=>o,d2:()=>u,f8:()=>y,gn:()=>s,hT:()=>P,j3:()=>l,lQ:()=>i,nJ:()=>h,pl:()=>E,y9:()=>S,yy:()=>x});var n=r(48306),a="undefined"==typeof window||"Deno"in globalThis;function i(){}function o(e,t){return"function"==typeof e?e(t):e}function s(e){return"number"==typeof e&&e>=0&&e!==1/0}function l(e,t){return Math.max(e+(t||0)-Date.now(),0)}function u(e,t){return"function"==typeof e?e(t):e}function c(e,t){return"function"==typeof e?e(t):e}function d(e,t){let{type:r="all",exact:n,fetchStatus:a,predicate:i,queryKey:o,stale:s}=e;if(o){if(n){if(t.queryHash!==f(o,t.options))return!1}else if(!m(t.queryKey,o))return!1}if("all"!==r){let e=t.isActive();if("active"===r&&!e||"inactive"===r&&e)return!1}return("boolean"!=typeof s||t.isStale()===s)&&(!a||a===t.state.fetchStatus)&&(!i||!!i(t))}function h(e,t){let{exact:r,status:n,predicate:a,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(r){if(p(t.options.mutationKey)!==p(i))return!1}else if(!m(t.options.mutationKey,i))return!1}return(!n||t.state.status===n)&&(!a||!!a(t))}function f(e,t){return(t?.queryKeyHashFn||p)(e)}function p(e){return JSON.stringify(e,(e,t)=>w(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function m(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&Object.keys(t).every(r=>m(e[r],t[r]))}var g=Object.prototype.hasOwnProperty;function y(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e)if(e[r]!==t[r])return!1;return!0}function v(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function w(e){if(!b(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!!b(r)&&!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function b(e){return"[object Object]"===Object.prototype.toString.call(e)}function x(e){return new Promise(t=>{n.zs.setTimeout(t,e)})}function E(e,t,r){return"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?function e(t,r){if(t===r)return t;let n=v(t)&&v(r);if(!n&&!(w(t)&&w(r)))return r;let a=(n?t:Object.keys(t)).length,i=n?r:Object.keys(r),o=i.length,s=n?Array(o):{},l=0;for(let u=0;u<o;u++){let o=n?u:i[u],c=t[o],d=r[o];if(c===d){s[o]=c,(n?u<a:g.call(t,o))&&l++;continue}if(null===c||null===d||"object"!=typeof c||"object"!=typeof d){s[o]=d;continue}let h=e(c,d);s[o]=h,h===c&&l++}return a===o&&l===a?t:s}(e,t):t}function S(e,t,r=0){let n=[...e,t];return r&&n.length>r?n.slice(1):n}function k(e,t,r=0){let n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var P=Symbol();function C(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==P?e.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`))}function I(e,t){return"function"==typeof e?e(...t):!!e}},37601:(e,t)=>{"use strict";function r(e){return Array.isArray(e)?e[1]:e}
7Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getSegmentValue",{enumerable:!0,get:function(){return r}}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},38378:()=>{},38665:()=>{},39853:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>p,ur:()=>f,vu:()=>h});var n=r(37876),a=r(14232),i=r(67768),o=r(67914);r(29454);var s=r(72389);let l=(0,a.createContext)(),u=["user","current"];async function c(){let e=(0,s.c4)();if(!e)return null;try{let t=await fetch("/api/user/me",{method:"GET",headers:{Authorization:"Bearer ".concat(e)},credentials:"include"});if(!t.ok){if(401===t.status)return(0,s.Tp)(),null;throw Error("HTTP error! status: ".concat(t.status))}let r=await t.json();if(r.success&&r.user)return(0,s.Wt)(r.user),r.user;return null}catch(e){var t,r,n;if("undefined"!=typeof navigator&&!navigator.onLine||(null==e?void 0:e.name)==="TypeError"||(null==e||null==(t=e.message)?void 0:t.includes("fetch"))||(null==e||null==(r=e.message)?void 0:r.includes("network"))||(null==e||null==(n=e.message)?void 0:n.includes("Failed to fetch"))){let e=(0,s.Yk)();if(e)return e}throw e}}function d(e){e&&Promise.resolve().then(r.bind(r,56803)).then(t=>{let{offlineMediaStorage:r}=t;return r.ensureOwner(e)}).catch(e=>{console.warn("[UserContext] Rattachement du stockage hors-ligne ignor\xe9:",e)})}function h(e){let{children:t,initialUser:r,setUser:h}=e,f=(0,i.jE)(),p=(0,a.useRef)(void 0),m=(0,a.useRef)(void 0),g=(0,a.useRef)(null);(0,a.useEffect)(()=>{var e;let t=(0,s.c4)();if(!t){p.current=null,m.current=null,(0,a.startTransition)(()=>{f.setQueryData(u,null)});return}let n=(0,s.UL)(),i=n||(null==r?void 0:r._id)||null;i&&g.current!==i&&(g.current=i,d(i));let o=r&&(!n||!r._id||String(r._id)===String(n));if(!r||!o){if(t){let e=f.getQueryData(u);if(!e||n&&String(e._id)!==String(n)){let e=(0,s.Yk)();e&&(!n||String(e._id)===String(n))?(0,a.startTransition)(()=>{f.setQueryData(u,e)}):f.invalidateQueries({queryKey:u})}}return}let l=null!=(e=null==r?void 0:r._id)?e:null,c=JSON.stringify(r);if(l===p.current&&c===m.current)return;p.current=l,m.current=c,(0,s.Wt)(r);let h=f.getQueryData(u);(0,a.startTransition)(()=>{h&&String(h._id)===String(r._id)?f.setQueryData(u,e=>{var t,n,a,i;return{...r,...e,roles:null!=(t=r.roles)?t:e.roles,subscription:null!=(n=r.subscription)?n:e.subscription,subType:null!=(a=r.subType)?a:e.subType,hasCourse:null!=(i=r.hasCourse)?i:e.hasCourse}}):f.setQueryData(u,r)})},[r,f]);let{data:y,refetch:v}=(0,o.I)({queryKey:u,queryFn:c,enabled:!!(0,s.c4)(),staleTime:18e5,refetchOnWindowFocus:!1,initialData:()=>void 0!==r?r:void 0}),w=(0,a.useCallback)(e=>{(null==e?void 0:e._id)&&g.current!==e._id&&(g.current=e._id,d(e._id)),(0,a.startTransition)(()=>{if(f.setQueryData(u,e),e){var t;(0,s.Wt)(e),p.current=null!=(t=e._id)?t:null,m.current=JSON.stringify(e)}else(0,s.Wt)(null),p.current=null,m.current=null;h&&h(e)})},[f,h]),b=(0,a.useCallback)(e=>{(0,a.startTransition)(()=>{f.setQueryData(u,t=>{if(!t)return t;let r={...t,trialTimeWatched:e};return(0,s.Wt)(r),r})})},[f]),x=(0,a.useCallback)(async()=>{await v()},[v]),E=(0,a.useCallback)(()=>{(0,s.Tp)(),p.current=null,m.current=null,(0,a.startTransition)(()=>{w(null),f.setQueryData(u,null),f.removeQueries({queryKey:["user"]})})},[f,w]);return(0,n.jsx)(l.Provider,{value:{user:y,setUser:w,refreshUser:x,logout:E,updateTrialTime:b,isLogin:!!y},children:t})}let f=()=>(0,a.useContext)(l),p=l},39895:(e,t,r)=>{"use strict";function n(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}r.d(t,{B:()=>n})},40097:(e,t,r)=>{"use strict";r.d(t,{n:()=>c});var n=r(14232),a=r(21407),i=r(60388),o=r(90089),s=r(37149),l=class extends o.Q{#m;#w=void 0;#b;#x;constructor(e,t){super(),this.#m=e,this.setOptions(t),this.bindMethods(),this.#E()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#m.defaultMutationOptions(e),(0,s.f8)(this.options,t)||this.#m.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#b,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,s.EN)(t.mutationKey)!==(0,s.EN)(this.options.mutationKey)?this.reset():this.#b?.state.status==="pending"&&this.#b.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#b?.removeObserver(this)}onMutationUpdate(e){this.#E(),this.#S(e)}getCurrentResult(){return this.#w}reset(){this.#b?.removeObserver(this),this.#b=void 0,this.#E(),this.#S()}mutate(e,t){return this.#x=t,this.#b?.removeObserver(this),this.#b=this.#m.getMutationCache().build(this.#m,this.options),this.#b.addObserver(this),this.#b.execute(e)}#E(){let e=this.#b?.state??(0,a.$)();this.#w={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#S(e){i.jG.batch(()=>
7{if(this.#x&&this.hasListeners()){let t=this.#w.variables,r=this.#w.context,n={client:this.#m,meta:this.options.meta,mutationKey:this.options.mutationKey};e?.type==="success"?(this.#x.onSuccess?.(e.data,t,r,n),this.#x.onSettled?.(e.data,null,t,r,n)):e?.type==="error"&&(this.#x.onError?.(e.error,t,r,n),this.#x.onSettled?.(void 0,e.error,t,r,n))}this.listeners.forEach(e=>{e(this.#w)})})}},u=r(67768);function c(e,t){let r=(0,u.jE)(t),[a]=n.useState(()=>new l(r,e));n.useEffect(()=>{a.setOptions(e)},[a,e]);let o=n.useSyncExternalStore(n.useCallback(e=>a.subscribe(i.jG.batchCalls(e)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),c=n.useCallback((e,t)=>{a.mutate(e,t).catch(s.lQ)},[a]);if(o.error&&(0,s.GU)(a.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:c,mutateAsync:o.mutate}}},40678:(e,t,r)=>{"use strict";r.d(t,{B_:()=>l,ez:()=>s});var n=r(37876),a=r(14232);let i="true"===r(65364).env.NEXT_PUBLIC_ENABLE_NOEL_OPERATION,o=(0,a.createContext)();function s(e){let{children:t}=e,[r,s]=(0,a.useState)([]),[l,u]=(0,a.useState)(!1),[c,d]=(0,a.useState)(!1);(0,a.useEffect)(()=>{try{let e=localStorage.getItem("empara_cart");e&&s(JSON.parse(e))}catch(e){console.error("Error loading cart from localStorage:",e)}d(!0)},[]),(0,a.useEffect)(()=>{if(c&&1)try{localStorage.setItem("empara_cart",JSON.stringify(r))}catch(e){console.error("Error saving cart to localStorage:",e)}},[r,c]);let h=(0,a.useCallback)(e=>{s(t=>t.some(t=>t._id===e._id)?t:[...t,{_id:e._id,basicId:e.basicId,title:e.title,price:e.priceAfterLive||e.price||0,image:e.image,url:e.url,authors:e.authors,type:"course"}]),u(!0)},[]),f=(0,a.useCallback)(e=>{s(t=>t.filter(t=>t._id!==e))},[]),p=(0,a.useCallback)(()=>{s([])},[]),m=(0,a.useCallback)(e=>{u(t=>"boolean"==typeof e?e:!t)},[]),g=(0,a.useMemo)(()=>r.reduce((e,t)=>e+(Number(t.price)||0),0),[r]),y=(0,a.useMemo)(()=>{let e=r.reduce((e,t)=>e+(Number(t.price)||0),0);return i?Math.round(.5*e*100)/100:e},[r]);return(0,n.jsx)(o.Provider,{value:{cartItems:r,addToCart:h,removeFromCart:f,clearCart:p,cartTotal:y,cartSubTotal:g,isCartOpen:l,toggleCart:m},children:t})}let l=()=>{let e=(0,a.useContext)(o);if(void 0===e)throw Error("useCartContext must be used within a CartProvider");return e}},41222:(e,t,r)=>{"use strict";r.d(t,{bm:()=>eP,UC:()=>eE,VY:()=>ek,hJ:()=>ex,ZL:()=>eb,bL:()=>ev,hE:()=>eS,l9:()=>ew,G$:()=>ep,Hs:()=>F});var n,a=r(14232),i=r(33716),o=r(10714),s=r(91844),l=r(70294),u=r(58162),c=r(98477),d=r(37876);function h(e){let t=function(e){let t=a.forwardRef((e,t)=>{let{children:r,...n}=e;if(a.isValidElement(r)){var i;let e,s,l=(i=r,(s=(e=Object.getOwnPropertyDescriptor(i.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?i.ref:(s=(e=Object.getOwnPropertyDescriptor(i,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?i.props.ref:i.props.ref||i.ref),u=function(e,t){let r={...t};for(let n in t){let a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...e)=>{let t=i(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...i}:"className"===n&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==a.Fragment&&(u.ref=t?(0,o.t)(t,l):l),a.cloneElement(r,u)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}(e),r=a.forwardRef((e,r)=>{let{children:n,...i}=e,o=a.Children.toArray(n),s=o.find(p);if(s){let e=s.props.children,n=o.map(t=>t!==s?t:a.Children.count(e)>1?a.Children.only(null):a.isValidElement(e)?e.props.children:null);return(0,d.jsx)(t,{...i,ref:r,children:a.isValidElement(e)?a.cloneElement(e,void 0,n):null})}return(0,d.jsx)(t,{...i,ref:r,children:n})});return r.displayName=`${e}.Slot`,r}var f=Symbol("radix.slottable");function p(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===f}var m=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=h(`Primitive.${t}`),n=a.forwardRef((e,n)=>{let{asChild:a,...i}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,d.jsx)(a?r:t,{...i,ref:n})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),g=r(62146),y=r(92216),v="dismissableLayer.update",w=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),b=a.forwardRef((e,t)=>
7{let{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:c,onDismiss:h,...f}=e,p=a.useContext(w),[b,S]=a.useState(null),k=b?.ownerDocument??globalThis?.document,[,P]=a.useState({}),C=(0,o.s)(t,e=>S(e)),I=Array.from(p.layers),[T]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),A=I.indexOf(T),_=b?I.indexOf(b):-1,O=p.layersWithOutsidePointerEventsDisabled.size>0,q=_>=A,R=function(e,t=globalThis?.document){let r=(0,g.c)(e),n=a.useRef(!1),i=a.useRef(()=>{});return a.useEffect(()=>{let e=e=>{if(e.target&&!n.current){let n=function(){E("dismissableLayer.pointerDownOutside",r,a,{discrete:!0})},a={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",i.current),i.current=n,t.addEventListener("click",i.current,{once:!0})):n()}else t.removeEventListener("click",i.current);n.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",e),t.removeEventListener("click",i.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}(e=>{let t=e.target,r=[...p.branches].some(e=>e.contains(t));q&&!r&&(l?.(e),c?.(e),e.defaultPrevented||h?.())},k),D=function(e,t=globalThis?.document){let r=(0,g.c)(e),n=a.useRef(!1);return a.useEffect(()=>{let e=e=>{e.target&&!n.current&&E("dismissableLayer.focusOutside",r,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}(e=>{let t=e.target;![...p.branches].some(e=>e.contains(t))&&(u?.(e),c?.(e),e.defaultPrevented||h?.())},k);return(0,y.U)(e=>{_===p.layers.size-1&&(s?.(e),!e.defaultPrevented&&h&&(e.preventDefault(),h()))},k),a.useEffect(()=>{if(b)return r&&(0===p.layersWithOutsidePointerEventsDisabled.size&&(n=k.body.style.pointerEvents,k.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(b)),p.layers.add(b),x(),()=>{r&&1===p.layersWithOutsidePointerEventsDisabled.size&&(k.body.style.pointerEvents=n)}},[b,k,r,p]),a.useEffect(()=>()=>{b&&(p.layers.delete(b),p.layersWithOutsidePointerEventsDisabled.delete(b),x())},[b,p]),a.useEffect(()=>{let e=()=>P({});return document.addEventListener(v,e),()=>document.removeEventListener(v,e)},[]),(0,d.jsx)(m.div,{...f,ref:C,style:{pointerEvents:O?q?"auto":"none":void 0,...e.style},onFocusCapture:(0,i.mK)(e.onFocusCapture,D.onFocusCapture),onBlurCapture:(0,i.mK)(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:(0,i.mK)(e.onPointerDownCapture,R.onPointerDownCapture)})});function x(){let e=new CustomEvent(v);document.dispatchEvent(e)}function E(e,t,r,{discrete:n}){let a=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});if(t&&a.addEventListener(e,t,{once:!0}),n)a&&c.flushSync(()=>a.dispatchEvent(i));else a.dispatchEvent(i)}b.displayName="DismissableLayer",a.forwardRef((e,t)=>{let r=a.useContext(w),n=a.useRef(null),i=(0,o.s)(t,n);return a.useEffect(()=>{let e=n.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),(0,d.jsx)(m.div,{...e,ref:i})}).displayName="DismissableLayerBranch";var S="focusScope.autoFocusOnMount",k="focusScope.autoFocusOnUnmount",P={bubbles:!1,cancelable:!0},C=a.forwardRef((e,t)=>{let{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...l}=e,[u,c]=a.useState(null),h=(0,g.c)(i),f=(0,g.c)(s),p=a.useRef(null),y=(0,o.s)(t,e=>c(e)),v=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(n){let e=function(e){if(v.paused||!u)return;let t=e.target;u.contains(t)?p.current=t:A(p.current,{select:!0})},t=function(e){if(v.paused||!u)return;let t=e.relatedTarget;null!==t&&(u.contains(t)||A(p.current,{select:!0}))};document.addEventListener("focusin",e),document.addEventListener("focusout",t);let r=new MutationObserver(function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&A(u)});return u&&r.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[n,u,v.paused]),a.useEffect(()=>{if(u){_.add(v);let e=document.activeElement;if(!u.contains(e)){let t=new CustomEvent(S,P);u.addEventListener(S,h),u.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){let r=document.activeElement;for(let n of e)if(A(n,{select:t}),document.activeElement!==r)return}(I(u).filter(e=>"A"!==e.tagName),{select:!0}),document.activeElement===e&&A(u))}return()=>{u.removeEventListener(S,h),setTimeout(()=>{let t=new CustomEvent(k,P);u.addEventListener(k,f),u.dispatchEvent(t),t.defaultPrevented||A(e??document.body,{select:!0}),u.removeEventListener(k,f),_.remove(v)},0)}}},[u,h,f,v]);let w=a.useCallback(e=>{if(!r&&!n||v.paused)return;let t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,a=document.activeElement;if(t&&a){let t=e.currentTarget,[n,i]=function(e){let t=I(e);return[T(t,e),T(t.reverse(),e)]}(t);n&&i?e.shiftKey||a!==i?e.shiftKey&&a===n&&(e.preventDefault(),r&&A(i,{select:!0})):(e.preventDefault(),r&&A(n,{select:!0})):a===t&&e.preventDefault()}},[r,n,v.paused]);return(0,d.jsx)(m.div,{tabIndex:-1,...l,ref:y,onKeyDown:w})});function I(e){let t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function T(e,t){for(let r of e)if(!function(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e&&(void 0===t||e!==t);){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}(r,{upTo:t}))return r}function A(e,{select:t=!1}={}){if(e&&e.focus){var r;let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&(r=e)instanceof HTMLInputElement&&"select"in r&&t&&e.select()}}C.displayName="FocusScope";var _=function(){let e=[];return{add(t){let r=e[0];t!==r&&r?.pause(),(e=O(e,t)).unshift(t)},remove(t){e=O(e,t),e[0]?.resume()}}}();function O(e,t){let r=[...e],n=r.indexOf(t);return -1!==n&&r.splice(n,1),r}var q=r(81285),R=a.forwardRef((e,t)=>
7{let{container:r,...n}=e,[i,o]=a.useState(!1);(0,q.N)(()=>o(!0),[]);let s=r||i&&globalThis?.document?.body;return s?c.createPortal((0,d.jsx)(m.div,{...n,ref:t}),s):null});R.displayName="Portal";var D=e=>{let{present:t,children:r}=e,n=function(e){var t,r;let[n,i]=a.useState(),o=a.useRef(null),s=a.useRef(e),l=a.useRef("none"),[u,c]=(t=e?"mounted":"unmounted",r={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},a.useReducer((e,t)=>r[e][t]??e,t));return a.useEffect(()=>{let e=N(o.current);l.current="mounted"===u?e:"none"},[u]),(0,q.N)(()=>{let t=o.current,r=s.current;if(r!==e){let n=l.current,a=N(t);e?c("MOUNT"):"none"===a||t?.display==="none"?c("UNMOUNT"):r&&n!==a?c("ANIMATION_OUT"):c("UNMOUNT"),s.current=e}},[e,c]),(0,q.N)(()=>{if(n){let e,t=n.ownerDocument.defaultView??window,r=r=>{let a=N(o.current).includes(CSS.escape(r.animationName));if(r.target===n&&a&&(c("ANIMATION_END"),!s.current)){let r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)})}},a=e=>{e.target===n&&(l.current=N(o.current))};return n.addEventListener("animationstart",a),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",a),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}c("ANIMATION_END")},[n,c]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:a.useCallback(e=>{o.current=e?getComputedStyle(e):null,i(e)},[])}}(t),i="function"==typeof r?r({present:n.isPresent}):a.Children.only(r),s=(0,o.s)(n.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(r=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}(i));return"function"==typeof r||n.isPresent?a.cloneElement(i,{ref:s}):null};function N(e){return e?.animationName||"none"}D.displayName="Presence";var j=r(22658),L=r(86324),M=r(94769),B="Dialog",[U,F]=(0,s.A)(B),[z,V]=U(B),W=e=>{let{__scopeDialog:t,children:r,open:n,defaultOpen:i,onOpenChange:o,modal:s=!0}=e,c=a.useRef(null),h=a.useRef(null),[f,p]=(0,u.i)({prop:n,defaultProp:i??!1,onChange:o,caller:B});return(0,d.jsx)(z,{scope:t,triggerRef:c,contentRef:h,contentId:(0,l.B)(),titleId:(0,l.B)(),descriptionId:(0,l.B)(),open:f,onOpenChange:p,onOpenToggle:a.useCallback(()=>p(e=>!e),[p]),modal:s,children:r})};W.displayName=B;var H="DialogTrigger",G=a.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=V(H,r),s=(0,o.s)(t,a.triggerRef);return(0,d.jsx)(m.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":eh(a.open),...n,ref:s,onClick:(0,i.mK)(e.onClick,a.onOpenToggle)})});G.displayName=H;var Q="DialogPortal",[K,$]=U(Q,{forceMount:void 0}),Y=e=>{let{__scopeDialog:t,forceMount:r,children:n,container:i}=e,o=V(Q,t);return(0,d.jsx)(K,{scope:t,forceMount:r,children:a.Children.map(n,e=>(0,d.jsx)(D,{present:r||o.open,children:(0,d.jsx)(R,{asChild:!0,container:i,children:e})}))})};Y.displayName=Q;var J="DialogOverlay",X=a.forwardRef((e,t)=>{let r=$(J,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,i=V(J,e.__scopeDialog);return i.modal?(0,d.jsx)(D,{present:n||i.open,children:(0,d.jsx)(ee,{...a,ref:t})}):null});X.displayName=J;var Z=h("DialogOverlay.RemoveScroll"),ee=a.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=V(J,r);return(0,d.jsx)(L.A,{as:Z,allowPinchZoom:!0,shards:[a.contentRef],children:(0,d.jsx)(m.div,{"data-state":eh(a.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),et="DialogContent",er=a.forwardRef((e,t)=>{let r=$(et,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,i=V(et,e.__scopeDialog);return(0,d.jsx)(D,{present:n||i.open,children:i.modal?(0,d.jsx)(en,{...a,ref:t}):(0,d.jsx)(ea,{...a,ref:t})})});er.displayName=et;var en=a.forwardRef((e,t)=>{let r=V(et,e.__scopeDialog),n=a.useRef(null),s=(0,o.s)(t,r.contentRef,n);return a.useEffect(()=>{let e=n.current;if(e)return(0,M.Eq)(e)},[]),(0,d.jsx)(ei,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,i.mK)(e.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:(0,i.mK)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:(0,i.mK)(e.onFocusOutside,e=>e.preventDefault())})}),ea=a.forwardRef((e,t)=>
7{let r=V(et,e.__scopeDialog),n=a.useRef(!1),i=a.useRef(!1);return(0,d.jsx)(ei,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(n.current||r.triggerRef.current?.focus(),t.preventDefault()),n.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(n.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));let a=t.target;r.triggerRef.current?.contains(a)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})}),ei=a.forwardRef((e,t)=>{let{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:s,...l}=e,u=V(et,r),c=a.useRef(null),h=(0,o.s)(t,c);return(0,j.Oh)(),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(C,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:s,children:(0,d.jsx)(b,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":eh(u.open),...l,ref:h,onDismiss:()=>u.onOpenChange(!1)})}),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(eg,{titleId:u.titleId}),(0,d.jsx)(ey,{contentRef:c,descriptionId:u.descriptionId})]})]})}),eo="DialogTitle",es=a.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=V(eo,r);return(0,d.jsx)(m.h2,{id:a.titleId,...n,ref:t})});es.displayName=eo;var el="DialogDescription",eu=a.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=V(el,r);return(0,d.jsx)(m.p,{id:a.descriptionId,...n,ref:t})});eu.displayName=el;var ec="DialogClose",ed=a.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=V(ec,r);return(0,d.jsx)(m.button,{type:"button",...n,ref:t,onClick:(0,i.mK)(e.onClick,()=>a.onOpenChange(!1))})});function eh(e){return e?"open":"closed"}ed.displayName=ec;var ef="DialogTitleWarning",[ep,em]=(0,s.q)(ef,{contentName:et,titleName:eo,docsSlug:"dialog"}),eg=({titleId:e})=>{let t=em(ef),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. 8 9If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. 10 11For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return a.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},ey=({contentRef:e,descriptionId:t})=>{let r=em("DialogDescriptionWarning"),n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${r.contentName}}.`;return a.useEffect(()=>{let r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},ev=W,ew=G,eb=Y,ex=X,eE=er,eS=es,ek=eu,eP=ed},44483:(e,t,r)=>{"use strict";function n(e){let t=[],r=String(e||""),n=r.indexOf(","),a=0,i=!1;for(;!i;){-1===n&&(n=r.length,i=!0);let e=r.slice(a,n).trim();(e||!i)&&t.push(e),a=n+1,n=r.indexOf(",",a)}return t}function a(e,t){let r=t||{};return(""===e[e.length-1]?[...e,""]:e).join((r.padRight?" ":"")+","+(!1===r.padLeft?"":" ")).trim()}r.d(t,{A:()=>a,q:()=>n})},45105:(e,t,r)=>{e.exports=r(36758)},45195:(e,t,r)=>{"use strict";r.d(t,{cn:()=>er});var n=r(69241);let a=(e,t)=>{if(0===e.length)return t.classGroupId;let r=e[0],n=t.nextPart.get(r),i=n?a(e.slice(1),n):void 0;if(i)return i;if(0===t.validators.length)return;let o=e.join("-");return t.validators.find(({validator:e})=>e(o))?.classGroupId},i=/^\[(.+)\]$/,o=(e,t,r,n)=>{e.forEach(e=>{if("string"==typeof e){(""===e?t:s(t,e)).classGroupId=r;return}if("function"==typeof e)return l(e)?void o(e(n),t,r,n):void t.validators.push({validator:e,classGroupId:r});Object.entries(e).forEach(([e,a])=>{o(a,s(t,e),r,n)})})},s=(e,t)=>{let r=e;return t.split("-").forEach(e=>{r.nextPart.has(e)||r.nextPart.set(e,{nextPart:new Map,validators:[]}),r=r.nextPart.get(e)}),r},l=e=>e.isThemeGetter,u=/\s+/;function c(){let e,t,r=0,n="";for(;r<arguments.length;)(e=arguments[r++])&&(t=d(e))&&(n&&(n+=" "),n+=t);return n}let d=e=>{let t;if("string"==typeof e)return e;let r="";for(let n=0;n<e.length;n++)e[n]&&(t=d(e[n]))&&(r&&(r+=" "),r+=t);return r},h=e=>{let t=t=>t[e]||[];return t.isThemeGetter=!0,t},f=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,p=/^\((?:(\w[\w-]*):)?(.+)\)$/i,m=/^\d+\/\d+$/,g=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,y=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,v=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,w=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,b=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,x=e=>m.test(e),E=e=>!!e&&!Number.isNaN(Number(e)),S=e=>!!e&&Number.isInteger(Number(e)),k=e=>e.endsWith("%")&&E(e.slice(0,-1)),P=e=>g.test(e),C=()=>!0,I=e=>y.test(e)&&!v.test(e),T=()=>!1,A=e=>w.test(e),_=e=>b.test(e),O=e=>!R(e)&&!B(e),q=e=>G(e,Y,T),R=e=>f.test(e),D=e=>G(e,J,I),N=e=>G(e,X,E),j=e=>G(e,K,T),L=e=>G(e,$,_),M=e=>G(e,ee,A),B=e=>p.test(e),U=e=>Q(e,J),F=e=>Q(e,Z),z=e=>Q(e,K),V=e=>Q(e,Y),W=e=>Q(e,$),H=e=>Q(e,ee,!0),G=(e,t,r)=>{let n=f.exec(e);return!!n&&(n[1]?t(n[1]):r(n[2]))},Q=(e,t,r=!1)=>{let n=p.exec(e);return!!n&&(n[1]?t(n[1]):r)},K=e=>"position"===e||"percentage"===e,$=e=>"image"===e||"url"===e,Y=e=>"length"===e||"size"===e||"bg-size"===e,J=e=>"length"===e,X=e=>"number"===e,Z=e=>"family-name"===e,ee=e=>"shadow"===e;Symbol.toStringTag;let et=function(e,...t){let r,n,s,l=function(u){let c;return n=(r={cache:(e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,r=new Map,n=new Map,a=(a,i)=>{r.set(a,i),++t>e&&(t=0,n=r,r=new Map)};return{get(e){let t=r.get(e);return void 0!==t?t:void 0!==(t=n.get(e))?(a(e,t),t):void 0},set(e,t){r.has(e)?r.set(e,t):a(e,t)}}})((c=t.reduce((e,t)=>
11t(e),e())).cacheSize),parseClassName:(e=>{let{prefix:t,experimentalParseClassName:r}=e,n=e=>{let t,r,n=[],a=0,i=0,o=0;for(let r=0;r<e.length;r++){let s=e[r];if(0===a&&0===i){if(":"===s){n.push(e.slice(o,r)),o=r+1;continue}if("/"===s){t=r;continue}}"["===s?a++:"]"===s?a--:"("===s?i++:")"===s&&i--}let s=0===n.length?e:e.substring(o),l=(r=s).endsWith("!")?r.substring(0,r.length-1):r.startsWith("!")?r.substring(1):r;return{modifiers:n,hasImportantModifier:l!==s,baseClassName:l,maybePostfixModifierPosition:t&&t>o?t-o:void 0}};if(t){let e=t+":",r=n;n=t=>t.startsWith(e)?r(t.substring(e.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:t,maybePostfixModifierPosition:void 0}}if(r){let e=n;n=t=>r({className:t,parseClassName:e})}return n})(c),sortModifiers:(e=>{let t=Object.fromEntries(e.orderSensitiveModifiers.map(e=>[e,!0]));return e=>{if(e.length<=1)return e;let r=[],n=[];return e.forEach(e=>{"["===e[0]||t[e]?(r.push(...n.sort(),e),n=[]):n.push(e)}),r.push(...n.sort()),r}})(c),...(e=>{let t=(e=>{let{theme:t,classGroups:r}=e,n={nextPart:new Map,validators:[]};for(let e in r)o(r[e],n,e,t);return n})(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:e=>{let r=e.split("-");return""===r[0]&&1!==r.length&&r.shift(),a(r,t)||(e=>{if(i.test(e)){let t=i.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}})(e)},getConflictingClassGroupIds:(e,t)=>{let a=r[e]||[];return t&&n[e]?[...a,...n[e]]:a}}})(c)}).cache.get,s=r.cache.set,l=d,d(u)};function d(e){let t=n(e);if(t)return t;let a=((e,t)=>{let{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a,sortModifiers:i}=t,o=[],s=e.trim().split(u),l="";for(let e=s.length-1;e>=0;e-=1){let t=s[e],{isExternal:u,modifiers:c,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:f}=r(t);if(u){l=t+(l.length>0?" "+l:l);continue}let p=!!f,m=n(p?h.substring(0,f):h);if(!m){if(!p||!(m=n(h))){l=t+(l.length>0?" "+l:l);continue}p=!1}let g=i(c).join(":"),y=d?g+"!":g,v=y+m;if(o.includes(v))continue;o.push(v);let w=a(m,p);for(let e=0;e<w.length;++e){let t=w[e];o.push(y+t)}l=t+(l.length>0?" "+l:l)}return l})(e,r);return s(e,a),a}return function(){return l(c.apply(null,arguments))}}(()=>{let e=h("color"),t=h("font"),r=h("text"),n=h("font-weight"),a=h("tracking"),i=h("leading"),o=h("breakpoint"),s=h("container"),l=h("spacing"),u=h("radius"),c=h("shadow"),d=h("inset-shadow"),f=h("text-shadow"),p=h("drop-shadow"),m=h("blur"),g=h("perspective"),y=h("aspect"),v=h("ease"),w=h("animate"),b=()=>["auto","avoid","all","avoid-page","page","left","right","column"],I=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],T=()=>[...I(),B,R],A=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto","contain","none"],G=()=>[B,R,l],Q=()=>[x,"full","auto",...G()],K=()=>[S,"none","subgrid",B,R],$=()=>["auto",{span:["full",S,B,R]},S,B,R],Y=()=>[S,"auto",B,R],J=()=>["auto","min","max","fr",B,R],X=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Z=()=>["start","end","center","stretch","center-safe","end-safe"],ee=()=>["auto",...G()],et=()=>[x,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...G()],er=()=>[e,B,R],en=()=>[...I(),z,j,{position:[B,R]}],ea=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ei=()=>["auto","cover","contain",V,q,{size:[B,R]}],eo=()=>[k,U,D],es=()=>["","none","full",u,B,R],el=()=>["",E,U,D],eu=()=>["solid","dashed","dotted","double"],ec=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ed=()=>[E,k,z,j],eh=()=>["","none",m,B,R],ef=()=>["none",E,B,R],ep=()=>["none",E,B,R],em=()=>[E,B,R],eg=()=>[x,"full",...G()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[P],breakpoint:[P],color:[C],container:[P],"drop-shadow":[P],ease:["in","out","in-out"],font:[O],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[P],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[P],shadow:[P],spacing:["px",E],text:[P],"text-shadow":[P],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",x,R,B,y]}
vendor: 12,796 bytes, line 11
11],container:["container"],columns:[{columns:[E,R,B,s]}],"break-after":[{"break-after":b()}],"break-before":[{"break-before":b()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:T()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Q()}],"inset-x":[{"inset-x":Q()}],"inset-y":[{"inset-y":Q()}],start:[{start:Q()}],end:[{end:Q()}],top:[{top:Q()}],right:[{right:Q()}],bottom:[{bottom:Q()}],left:[{left:Q()}],visibility:["visible","invisible","collapse"],z:[{z:[S,"auto",B,R]}],basis:[{basis:[x,"full","auto",s,...G()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[E,x,"auto","initial","none",R]}],grow:[{grow:["",E,B,R]}],shrink:[{shrink:["",E,B,R]}],order:[{order:[S,"first","last","none",B,R]}],"grid-cols":[{"grid-cols":K()}],"col-start-end":[{col:$()}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":K()}],"row-start-end":[{row:$()}],"row-start":[{"row-start":Y()}],"row-end":[{"row-end":Y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":J()}],"auto-rows":[{"auto-rows":J()}],gap:[{gap:G()}],"gap-x":[{"gap-x":G()}],"gap-y":[{"gap-y":G()}],"justify-content":[{justify:[...X(),"normal"]}],"justify-items":[{"justify-items":[...Z(),"normal"]}],"justify-self":[{"justify-self":["auto",...Z()]}],"align-content":[{content:["normal",...X()]}],"align-items":[{items:[...Z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Z(),{baseline:["","last"]}]}],"place-content":[{"place-content":X()}],"place-items":[{"place-items":[...Z(),"baseline"]}],"place-self":[{"place-self":["auto",...Z()]}],p:[{p:G()}],px:[{px:G()}],py:[{py:G()}],ps:[{ps:G()}],pe:[{pe:G()}],pt:[{pt:G()}],pr:[{pr:G()}],pb:[{pb:G()}],pl:[{pl:G()}],m:[{m:ee()}],mx:[{mx:ee()}],my:[{my:ee()}],ms:[{ms:ee()}],me:[{me:ee()}],mt:[{mt:ee()}],mr:[{mr:ee()}],mb:[{mb:ee()}],ml:[{ml:ee()}],"space-x":[{"space-x":G()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":G()}],"space-y-reverse":["space-y-reverse"],size:[{size:et()}],w:[{w:[s,"screen",...et()]}],"min-w":[{"min-w":[s,"screen","none",...et()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[o]},...et()]}],h:[{h:["screen","lh",...et()]}],"min-h":[{"min-h":["screen","lh","none",...et()]}],"max-h":[{"max-h":["screen","lh",...et()]}],"font-size":[{text:["base",r,U,D]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,B,N]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",k,R]}],"font-family":[{font:[F,R,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,B,R]}],"line-clamp":[{"line-clamp":[E,"none",B,N]}],leading:[{leading:[i,...G()]}],"list-image":[{"list-image":["none",B,R]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",B,R]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:er()}],"text-color":[{text:er()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...eu(),"wavy"]}],"text-decoration-thickness":[{decoration:[E,"from-font","auto",B,D]}],"text-decoration-color":[{decoration:er()}],"underline-offset":[{"underline-offset":[E,"auto",B,R]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:G()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",B,R]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",B,R]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:en()}],"bg-repeat":[{bg:ea()}],"bg-size":[{bg:ei()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},S,B,R],radial:["",B,R],conic:[S,B,R]},W,L]}],"bg-color":[{bg:er()}],"gradient-from-pos":[{from:eo()}],"gradient-via-pos":[{via:eo()}],"gradient-to-pos":[{to:eo()}],"gradient-from":[{from:er()}],"gradient-via":[{via:er()}],"gradient-to":[{to:er()}],rounded:[{rounded:es()}],"rounded-s":[{"rounded-s":es()}],"rounded-e":[{"rounded-e":es()}],"rounded-t":[{"rounded-t":es()}],"rounded-r":[{"rounded-r":es()}],"rounded-b":[{"rounded-b":es()}],"rounded-l":[{"rounded-l":es()}],"rounded-ss":[{"rounded-ss":es()}],"rounded-se":[{"rounded-se":es()}],"rounded-ee":[{"rounded-ee":es()}],"rounded-es":[{"rounded-es":es()}],"rounded-tl":[{"rounded-tl":es()}],"rounded-tr":[{"rounded-tr":es()}],"rounded-br":[{"rounded-br":es()}],"rounded-bl":[{"rounded-bl":es()}],"border-w":[{border:el()}],"border-w-x":[{"border-x":el()}],"border-w-y":[{"border-y":el()}],"border-w-s":[{"border-s":el()}],"border-w-e":[{"border-e":el()}],"border-w-t":[{"border-t":el()}],"border-w-r":[{"border-r":el()}],"border-w-b":[{"border-b":el()}],"border-w-l":[{"border-l":el()}],"divide-x":[{"divide-x":el()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":el()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...eu(),"hidden","none"]}],"divide-style":[{divide:[...eu(),"hidden","none"]}],"border-color":[{border:er()}],"border-color-x":[{"border-x":er()}],"border-color-y":[{"border-y":er()}],"border-color-s":[{"border-s":er()}],"border-color-e":[{"border-e":er()}],"border-color-t":[{"border-t":er()}],"border-color-r":[{"border-r":er()}],"border-color-b":[{"border-b":er()}],"border-color-l":[{"border-l":er()}],"divide-color":[{divide:er()}],"outline-style":[{outline:[...eu(),"none","hidden"]}],"outline-offset":[{"outline-offset":[E,B,R]}],"outline-w":[{outline:["",E,U,D]}],"outline-color":[{outline:er()}],shadow:[{shadow:["","none",c,H,M]}],"shadow-color":[{shadow:er()}],"inset-shadow":[{"inset-shadow":["none",d,H,M]}],"inset-shadow-color":[{"inset-shadow":er()}],"ring-w":[{ring:el()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:er()}],"ring-offset-w":[{"ring-offset":[E,D]}],"ring-offset-color":[{"ring-offset":er()}],"inset-ring-w":[{"inset-ring":el()}],"inset-ring-color":[{"inset-ring":er()}],"text-shadow":[{"text-shadow":["none",f,H,M]}],"text-shadow-color":[{"text-shadow":er()}],opacity:[{opacity:[E,B,R]}],"mix-blend":[{"mix-blend":[...ec(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ec()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[E]}],"mask-image-linear-from-pos":[{"mask-linear-from":ed()}],"mask-image-linear-to-pos":[{"mask-linear-to":ed()}],"mask-image-linear-from-color":[{"mask-linear-from":er()}],"mask-image-linear-to-color":[{"mask-linear-to":er()}],"mask-image-t-from-pos":[{"mask-t-from":ed()}],"mask-image-t-to-pos":[{"mask-t-to":ed()}],"mask-image-t-from-color":[{"mask-t-from":er()}],"mask-image-t-to-color":[{"mask-t-to":er()}],"mask-image-r-from-pos":[{"mask-r-from":ed()}],"mask-image-r-to-pos":[{"mask-r-to":ed()}],"mask-image-r-from-color":[{"mask-r-from":er()}],"mask-image-r-to-color":[{"mask-r-to":er()}],"mask-image-b-from-pos":[{"mask-b-from":ed()}],"mask-image-b-to-pos":[{"mask-b-to":ed()}],"mask-image-b-from-color":[{"mask-b-from":er()}],"mask-image-b-to-color":[{"mask-b-to":er()}],"mask-image-l-from-pos":[{"mask-l-from":ed()}],"mask-image-l-to-pos":[{"mask-l-to":ed()}],"mask-image-l-from-color":[{"mask-l-from":er()}],"mask-image-l-to-color":[{"mask-l-to":er()}],"mask-image-x-from-pos":[{"mask-x-from":ed()}],"mask-image-x-to-pos":[{"mask-x-to":ed()}],"mask-image-x-from-color":[{"mask-x-from":er()}],"mask-image-x-to-color":[{"mask-x-to":er()}],"mask-image-y-from-pos":[{"mask-y-from":ed()}],"mask-image-y-to-pos":[{"mask-y-to":ed()}],"mask-image-y-from-color":[{"mask-y-from":er()}],"mask-image-y-to-color":[{"mask-y-to":er()}],"mask-image-radial":[{"mask-radial":[B,R]}],"mask-image-radial-from-pos":[{"mask-radial-from":ed()}],"mask-image-radial-to-pos":[{"mask-radial-to":ed()}],"mask-image-radial-from-color":[{"mask-radial-from":er()}],"mask-image-radial-to-color":[{"mask-radial-to":er()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":I()}],"mask-image-conic-pos":[{"mask-conic":[E]}],"mask-image-conic-from-pos":[{"mask-conic-from":ed()}],"mask-image-conic-to-pos":[{"mask-conic-to":ed()}],"mask-image-conic-from-color":[{"mask-conic-from":er()}],"mask-image-conic-to-color":[{"mask-conic-to":er()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:en()}],"mask-repeat":[{mask:ea()}],"mask-size":[{mask:ei()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",B,R]}],filter:[{filter:["","none",B,R]}],blur:[{blur:eh()}],brightness:[{brightness:[E,B,R]}],contrast:[{contrast:[E,B,R]}],"drop-shadow":[{"drop-shadow":["","none",p,H,M]}],"drop-shadow-color":[{"drop-shadow":er()}],grayscale:[{grayscale:["",E,B,R]}],"hue-rotate":[{"hue-rotate":[E,B,R]}],invert:[{invert:["",E,B,R]}],saturate:[{saturate:[E,B,R]}],sepia:[{sepia:["",E,B,R]}],"backdrop-filter":[{"backdrop-filter":["","none",B,R]}],"backdrop-blur":[{"backdrop-blur":eh()}],"backdrop-brightness":[{"backdrop-brightness":[E,B,R]}],"backdrop-contrast":[{"backdrop-contrast":[E,B,R]}],"backdrop-grayscale":[{"backdrop-grayscale":["",E,B,R]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[E,B,R]}],"backdrop-invert":[{"backdrop-invert":["",E,B,R]}],"backdrop-opacity":[{"backdrop-opacity":[E,B,R]}],"backdrop-saturate":[{"backdrop-saturate":[E,B,R]}],"backdrop-sepia":[{"backdrop-sepia":["",E,B,R]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":G()}],"border-spacing-x":[{"border-spacing-x":G()}],"border-spacing-y":[{"border-spacing-y":G()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",B,R]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[E,"initial",B,R]}],ease:[{ease:["linear","initial",v,B,R]}],delay:[{delay:[E,B,R]}],animate:[{animate:["none",w,B,R]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,B,R]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:ef()}],"rotate-x":[{"rotate-x":ef()}],"rotate-y":[{"rotate-y":ef()}],"rotate-z":[{"rotate-z":ef()}],scale:[{scale:ep()}],"scale-x":[{"scale-x":ep()}],"scale-y":[{"scale-y":ep()}],"scale-z":[{"scale-z":ep()}],"scale-3d":["scale-3d"],skew:[{skew:em()}],"skew-x":[{"skew-x":em()}],"skew-y":[{"skew-y":em()}],transform:[{transform:[B,R,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:eg()}],"translate-x":[{"translate-x":eg()}],"translate-y":[{"translate-y":eg()}],"translate-z":[{"translate-z":eg()}],"translate-none":["translate-none"],accent:[{accent:er()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:er()}
11],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",B,R]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":G()}],"scroll-mx":[{"scroll-mx":G()}],"scroll-my":[{"scroll-my":G()}],"scroll-ms":[{"scroll-ms":G()}],"scroll-me":[{"scroll-me":G()}],"scroll-mt":[{"scroll-mt":G()}],"scroll-mr":[{"scroll-mr":G()}],"scroll-mb":[{"scroll-mb":G()}],"scroll-ml":[{"scroll-ml":G()}],"scroll-p":[{"scroll-p":G()}],"scroll-px":[{"scroll-px":G()}],"scroll-py":[{"scroll-py":G()}],"scroll-ps":[{"scroll-ps":G()}],"scroll-pe":[{"scroll-pe":G()}],"scroll-pt":[{"scroll-pt":G()}],"scroll-pr":[{"scroll-pr":G()}],"scroll-pb":[{"scroll-pb":G()}],"scroll-pl":[{"scroll-pl":G()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",B,R]}],fill:[{fill:["none",...er()]}],"stroke-w":[{stroke:[E,U,D,N]}],stroke:[{stroke:["none",...er()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function er(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return et((0,n.$)(t))}},45282:e=>{e.exports={red:"TrialOfferBanner_red__psJBz","bg-red":"TrialOfferBanner_bg-red__VS5_i",background:"TrialOfferBanner_background__iZ2fy",radius:"TrialOfferBanner_radius__DpIpf",banner:"TrialOfferBanner_banner__UGA_b",container:"TrialOfferBanner_container__FsDne",infoGroup:"TrialOfferBanner_infoGroup__8VqkB",text:"TrialOfferBanner_text__kLNRb",smallText:"TrialOfferBanner_smallText__RSvyK",priceWrapper:"TrialOfferBanner_priceWrapper__n14GH",actionGroup:"TrialOfferBanner_actionGroup__j5pGw",actions:"TrialOfferBanner_actions__olzYy",ctaButton:"TrialOfferBanner_ctaButton__lGGp5",divider:"TrialOfferBanner_divider__qA6vp",countdown:"TrialOfferBanner_countdown__X0ti3",price:"TrialOfferBanner_price__sQd_q",oldPrice:"TrialOfferBanner_oldPrice__nUqor",timeWrapper:"TrialOfferBanner_timeWrapper__Q4lou",timeBlock:"TrialOfferBanner_timeBlock__HOmqL",timeLabel:"TrialOfferBanner_timeLabel__d651X",separator:"TrialOfferBanner_separator__oR_0m",days:"TrialOfferBanner_days__lz_sU"}},46029:(e,t,r)=>{"use strict";r.d(t,{G1:()=>o,PW:()=>a,Y:()=>n});let n=i("end"),a=i("start");function i(e){return function(t){let r=t&&t.position&&t.position[e]||{};if("number"==typeof r.line&&r.line>0&&"number"==typeof r.column&&r.column>0)return{line:r.line,column:r.column,offset:"number"==typeof r.offset&&r.offset>-1?r.offset:void 0}}}function o(e){let t=a(e),r=n(e);if(t&&r)return{start:t,end:r}}},46305:(e,t,r)=>{"use strict";r.d(t,{k:()=>i});var n=r(48306),a=r(37149),i=class{#k;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,a.gn)(this.gcTime)&&(this.#k=n.zs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(a.S$?1/0:3e5))}clearGcTimeout(){this.#k&&(n.zs.clearTimeout(this.#k),this.#k=void 0)}}},47137:(e,t,r)=>{"use strict";r.d(t,{F:()=>o});var n=r(69241);let a=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,i=n.$,o=(e,t)=>r=>{var n;if((null==t?void 0:t.variants)==null)return i(e,null==r?void 0:r.class,null==r?void 0:r.className);let{variants:o,defaultVariants:s}=t,l=Object.keys(o).map(e=>{let t=null==r?void 0:r[e],n=null==s?void 0:s[e];if(null===t)return null;let i=a(t)||a(n);return o[e][i]}),u=r&&Object.entries(r).reduce((e,t)=>
11{let[r,n]=t;return void 0===n||(e[r]=n),e},{});return i(e,l,null==t||null==(n=t.compoundVariants)?void 0:n.reduce((e,t)=>{let{class:r,className:n,...a}=t;return Object.entries(a).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...s,...u}[t]):({...s,...u})[t]===r})?[...e,r,n]:e},[]),null==r?void 0:r.class,null==r?void 0:r.className)}},47334:(e,t,r)=>{"use strict";r.d(t,{ye:()=>h,d9:()=>g});var n=r(67768),a=r(67914),i=r(40097),o=r(14232),s=r(39853),l=r(62734),u=r(89099),c=r(7566),d=r(56803);let h={all:["catalog"],allCourses:["catalog","all-courses"],filters:["catalog","filters"],fieldsWithPositions:["catalog","fields-with-positions"],favorites:e=>["catalog","favorites",e],userCoursesData:e=>["catalog","user-courses-data",e]},f=e=>e?e.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,""):"",p=e=>e?e.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").trim():"",m=(e,t)=>{if(!t)return!0;if(!e)return!1;let r=p(e.title),n=p(e.marketingName);if(r.includes(t)||n.includes(t))return!0;if(Array.isArray(e.authors)){if(e.authors.some(e=>!!e&&("string"==typeof e?p(e).includes(t):p("".concat(e.firstname||""," ").concat(e.lastname||""," ").concat(e.name||"")).includes(t))))return!0}else if(e.authors){if("string"==typeof e.authors){if(p(e.authors).includes(t))return!0}else if(p("".concat(e.authors.firstname||""," ").concat(e.authors.lastname||""," ").concat(e.authors.name||"")).includes(t))return!0}return!!p(e.resume).includes(t)};function g(){let e=(0,o.useRef)(!1),t=(0,u.useRouter)(),r=(0,o.useContext)(s.Ay),g=(null==r?void 0:r.user)||null,y=(null==g?void 0:g._id)||null,v=(0,n.jE)(),w=(0,o.useMemo)(()=>(function(e){let t=null==e?void 0:e.onboarding;if(!t)return[];let r=e=>{let t=(null==e?void 0:e._id)||e;return t?String(t):null};return[...new Set([r(t.mainField),...(t.fieldIds||[]).map(r)].filter(Boolean))]})(g),[null==g?void 0:g.onboarding]),b=w.join(","),[x,E]=(0,o.useState)(null),[S,k]=(0,o.useState)(null),[P,C]=(0,o.useState)(!1),[I,T]=(0,o.useState)(!1),[A,_]=(0,o.useState)([]),[O,q]=(0,o.useState)(null),[R,D]=(0,o.useState)(null),[N,j]=(0,o.useState)(!1),[L,M]=(0,o.useState)(!1),[B,U]=(0,o.useState)(!1),[F,z]=(0,o.useState)(!1),[V,W]=(0,o.useState)(null),[H,G]=(0,o.useState)("learning"),[Q,K]=(0,o.useState)(null),[$,Y]=(0,o.useState)(""),[J,X]=(0,o.useState)({domains:[],offer:[],subdomains:[],userCourses:[]}),Z=(0,o.useCallback)(()=>{C(e=>!e)},[]),ee=(0,o.useCallback)(()=>{C(!0)},[]),et=(0,o.useCallback)(()=>{C(!1)},[]);(0,o.useEffect)(()=>{let e=()=>{C(!1)};return t.events.on("routeChangeStart",e),()=>{t.events.off("routeChangeStart",e)}},[t]);let er=(0,o.useRef)(!1),en=(0,o.useRef)(!1);(0,o.useEffect)(()=>(e.current=!0,()=>{e.current=!1}),[]);let ea=(0,o.useMemo)(()=>"/cours"===t.pathname,[t.pathname]),{data:ei=[],isLoading:eo,error:es,refetch:el}=(0,a.I)({queryKey:h.allCourses,queryFn:async()=>{if("undefined"!=typeof navigator&&!navigator.onLine)return await d.offlineMediaStorage.getOfflineCatalogCourses()||[];try{let e=await fetch("/api/catalog/all-courses",{method:"GET",credentials:"include"});if(!e.ok)throw Error("HTTP error! status: ".concat(e.status));let t=await e.json();if(!t.success)throw Error(t.message||"API error loading all courses");return t.courses||[]}catch(t){let e=await d.offlineMediaStorage.getOfflineCatalogCourses();if(e&&e.length>0)return e;throw t}},enabled:ea,staleTime:3e5,refetchOnMount:!1,refetchOnWindowFocus:!1}),eu=(0,o.useMemo)(()=>{var e;return ei&&0!==ei.length?!(null==(e=J.offer)?void 0:e.includes("Gratuit"))&&Array.isArray(J.subdomains)&&J.subdomains.includes(l.zK)?ei:ei.filter(e=>{var t;let r=null==e||null==(t=e.fields)?void 0:t.subfield;return!(Array.isArray(r)?r:r?[r]:[]).some(e=>{var t;return("string"==typeof e?e:(null==e||null==(t=e._id)?void 0:t.toString())||(null==e?void 0:e.toString()))===l.zK})}):ei},[ei,J.offer,J.subdomains]),ec=J.userCourses&&J.userCourses.length>0,{data:ed=null,isLoading:eh}=(0,a.I)({queryKey:h.userCoursesData(y),queryFn:async()=>{let e=await fetch("/api/catalog/user-courses-data",{method:"GET",credentials:"include"});if(!e.ok)throw Error("HTTP error! status: ".concat(e.status));let t=await e.json();if(!t.success)throw Error(t.message||"API error loading user courses data");return t.data},enabled:ea&&ec&&!!y,staleTime:12e4,refetchOnWindowFocus:!1}),{data:ef=[]}=(0,a.I)({queryKey:h.fieldsWithPositions,queryFn:async()=>{let e=await fetch("/api/catalog/fields-with-positions");
11if(!e.ok)throw Error("HTTP error! status: ".concat(e.status));let t=await e.json();if(!t.success)throw Error(t.message||"API error loading fields with positions");return t.fields||[]},enabled:ea&&("progress"===H||"learning"===H),staleTime:18e5,refetchOnMount:!1,refetchOnWindowFocus:!1}),{data:ep=[]}=(0,a.I)({queryKey:h.filters,queryFn:async()=>{let e=await fetch("/api/catalog/filters");if(!e.ok)throw Error("HTTP error! status: ".concat(e.status));let t=await e.json();if(!t.success)throw Error(t.message||"API error loading filters");return t.filters||[]},enabled:ea,staleTime:18e5,refetchOnMount:!1,refetchOnWindowFocus:!1});(0,o.useEffect)(()=>{e.current&&_(e=>e.length!==ep.length?ep:e.map(e=>(null==e?void 0:e._id)||(null==e?void 0:e.id)).join(",")!==ep.map(e=>(null==e?void 0:e._id)||(null==e?void 0:e.id)).join(",")?ep:e)},[ep]),(0,o.useEffect)(()=>{if(!t.isReady||en.current||0===ep.length)return;let{domaines:e,categories:r,offres:n,mescours:a}=t.query;if(!e&&!r&&!n&&!a){en.current=!0;return}er.current=!0;let i={domains:[],subdomains:[],offer:[],userCourses:[]};if(e&&(i.domains=(Array.isArray(e)?e:e.split(",")).map(e=>{let t=ep.find(t=>f(t.name)===e.toLowerCase());return null==t?void 0:t._id}).filter(Boolean)),r){let e=Array.isArray(r)?r:r.split(","),t=[{label:"Prise de vue",key:"624bf88773f427237b0f5086"},{label:"Business",key:"669e70108ec21fdf4974013e"},{label:"Post-production",key:"669e70478ec21fdf4974013f"},{label:"R\xe9sum\xe9",key:"669e79968ec21fdf49740140"}];i.subdomains=e.map(e=>{let r=t.find(t=>f(t.label)===e.toLowerCase());return null==r?void 0:r.key}).filter(Boolean)}if(n){let e=Array.isArray(n)?n:n.split(","),t=[{label:"Passionn\xe9",key:"Passionn\xe9"},{label:"Pro",key:"Pro"},{label:"Gratuit",key:"Gratuit"}];i.offer=e.map(e=>{let r=t.find(t=>f(t.label)===e.toLowerCase());return null==r?void 0:r.key}).filter(Boolean)}if(a){let e=[{label:"En cours",key:"watching"},{label:"D\xe9j\xe0 vus",key:"watched"},{label:"Favoris",key:"favorite"},{label:"Acc\xe8s \xe0 vie",key:"owned"},{label:"Exclure les termin\xe9es",key:"removeWatched"}].find(e=>f(e.label)===a.toLowerCase());e&&(i.userCourses=[e.key])}X(i),i.offer.includes("Gratuit")?G("recent"):(i.domains.length>0||i.subdomains.length>0||i.offer.length>0||i.userCourses.length>0)&&G("learning"),setTimeout(()=>{er.current=!1},100),en.current=!0},[t.isReady,t.query,ep]),(0,o.useEffect)(()=>{var e;if(er.current||!t.isReady||!en.current)return;let r=J.domains.map(e=>{let t=ep.find(t=>t._id===e);return t?f(t.name):null}).filter(Boolean),n=[{label:"Prise de vue",key:"624bf88773f427237b0f5086"},{label:"Business",key:"669e70108ec21fdf4974013e"},{label:"Post-production",key:"669e70478ec21fdf4974013f"},{label:"R\xe9sum\xe9",key:"669e79968ec21fdf49740140"}],a=J.subdomains.map(e=>{let t=n.find(t=>t.key===e);return t?f(t.label):null}).filter(Boolean),i=J.offer.map(e=>f(e)).filter(Boolean),o=(null==(e=J.userCourses)?void 0:e[0])?[{label:"En cours",key:"watching"},{label:"D\xe9j\xe0 vus",key:"watched"},{label:"Favoris",key:"favorite"},{label:"Acc\xe8s \xe0 vie",key:"owned"},{label:"Exclure les termin\xe9es",key:"removeWatched"}].find(e=>e.key===J.userCourses[0]):null,s={...t.query};r.length>0?s.domaines=r.join(","):delete s.domaines,a.length>0?s.categories=a.join(","):delete s.categories,i.length>0?s.offres=i.join(","):delete s.offres,o?s.mescours=f(o.label):delete s.mescours;let l=t.query.domaines||"",u=s.domaines||"",c=t.query.categories||"",d=s.categories||"",h=t.query.offres||"",p=s.offres||"",m=t.query.mescours||"",g=s.mescours||"";(l!==u||c!==d||h!==p||m!==g)&&t.replace({pathname:t.pathname,query:s},void 0,{shallow:!0})},[J.domains,J.subdomains,J.offer,J.userCourses,ep,t.isReady]),(0,o.useEffect)(()=>{let e="/cours"===t.pathname,r="/"===t.pathname,n=t.pathname.startsWith("/cours/")&&"/cours"!==t.pathname;e||r?M(!0):n&&M(!1)},[t.pathname]);let em=(0,i.n)({mutationFn:async e=>{let{courseId:t,isFavorite:r}=e,n=await fetch("/api/user/toggle-favorite",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({courseId:t,userId:y,isFavorite:r})});if(!n.ok)throw Error("HTTP error! status: ".concat(n.status));return(await n.json()).success},onSuccess:()=>
11{v.invalidateQueries({queryKey:h.userCoursesData(y)})}}),eg=(0,o.useCallback)((e,t)=>y?em.mutateAsync({courseId:e,isFavorite:t}):Promise.reject("User not logged in"),[y,em]),ey=(0,o.useMemo)(()=>{var e;if(!eu||0===eu.length)return[];let t=p($),r=t.length>0,n=J.offer&&J.offer.includes("Gratuit"),a=!n&&J.domains&&J.domains.length>0,i=!n&&J.subdomains&&J.subdomains.length>0,o=!(J.offer&&J.offer.includes("Pro"))&&J.offer&&J.offer.length>0,s=null==(e=J.userCourses)?void 0:e[0],l=!!s;return l&&!ed?[]:a||i||o||l||r?eu.filter(e=>{var n,u,d,h,f,p,g,y,v,w,b;if((0,c.mg)(e))return!1;let x=(null==(n=e._id)?void 0:n.toString())||e._id;if(r&&!m(e,t))return!1;let E=!0;if(a){let t=null==(u=e.fields)?void 0:u.field,r=[];if(Array.isArray(t))r=t.map(e=>{var t;return"string"==typeof e?e:(null==e||null==(t=e._id)?void 0:t.toString())||(null==e?void 0:e.toString())}).filter(Boolean);else if(t){let e="string"==typeof t?t:(null==t||null==(d=t._id)?void 0:d.toString())||(null==t?void 0:t.toString());e&&(r=[e])}E=J.domains.some(e=>r.includes(e))}let S=!0;if(i){let t=null==(h=e.fields)?void 0:h.subfield,r=[];if(Array.isArray(t))r=t.map(e=>{var t;return"string"==typeof e?e:(null==e||null==(t=e._id)?void 0:t.toString())||(null==e?void 0:e.toString())}).filter(Boolean);else if(t){let e="string"==typeof t?t:(null==t||null==(f=t._id)?void 0:f.toString())||(null==t?void 0:t.toString());e&&(r=[e])}S=J.subdomains.some(e=>r.includes(e))}let k=!0;if(o){let t=null==(p=e.availability)?void 0:p.offer;k=t&&J.offer.includes(t)}let P=!0;if(l)switch(s){case"watching":P=null==(g=ed.coursesInProgress)?void 0:g.includes(x);break;case"watched":P=null==(y=ed.coursesCompleted)?void 0:y.includes(x);break;case"favorite":P=null==(v=ed.favoriteIds)?void 0:v.includes(x);break;case"owned":P=null==(w=ed.ownedIds)?void 0:w.includes(x);break;case"removeWatched":P=!(null==(b=ed.coursesCompleted)?void 0:b.includes(x));break;default:P=!0}return E&&S&&k&&P}):eu.filter(e=>!(0,c.mg)(e))},[eu,J.domains,J.subdomains,J.offer,J.userCourses,ed,$]),ev=(0,o.useMemo)(()=>{var e,t,r;if(!ey||0===ey.length)return[];let n=null==(e=J.userCourses)?void 0:e[0];if(n&&ed){let e=[];switch(n){case"watching":e=ed.coursesInProgress||[];break;case"watched":e=ed.coursesCompleted||[];break;case"favorite":e=ed.favoriteIds||[];break;case"owned":e=ed.ownedIds||[];break;case"removeWatched":return ey;default:e=[]}let t=new Map;
11return ey.forEach(e=>{var r;let n=(null==(r=e._id)?void 0:r.toString())||e._id;n&&t.set(n,e)}),e.map(e=>t.get(e)).filter(Boolean)}switch(H){case"recent":return[...ey].sort((e,t)=>{let r=e.publishedAt?new Date(e.publishedAt).getTime():0;return(t.publishedAt?new Date(t.publishedAt).getTime():0)-r});case"best":return[...ey].sort((e,t)=>{let r=e=>{if(e.ratings&&"object"==typeof e.ratings&&void 0!==e.ratings.total){let t=Number(e.ratings.total);return isNaN(t)?0:t}if(void 0!==e.markCount){let t=Number(e.markCount);return isNaN(t)?0:t}return 0},n=r(e);return r(t)-n});case"progress":{if(!ef||0===ef.length)return[...ey].sort((e,t)=>{let r=e.publishedAt?new Date(e.publishedAt).getTime():0;return(t.publishedAt?new Date(t.publishedAt).getTime():0)-r});let e=new Map;eu.forEach(t=>{var r,n;let a=(null==(r=t._id)?void 0:r.toString())||(null==(n=t.basicId)?void 0:n.toString());a&&e.set(a,t)});let r=J.offer&&J.offer.includes("Gratuit"),n=!r&&J.domains&&J.domains.length>0,a=!r&&J.subdomains&&J.subdomains.length>0,i=!(J.offer&&J.offer.includes("Pro"))&&J.offer&&J.offer.length>0,o=e=>{var t,r;if(!a)return!0;let n=null==e||null==(t=e.fields)?void 0:t.subfield,i=[];if(Array.isArray(n))i=n.map(e=>{var t;return"string"==typeof e?e:(null==e||null==(t=e._id)?void 0:t.toString())||(null==e?void 0:e.toString())}).filter(Boolean);else if(n){let e="string"==typeof n?n:(null==n||null==(r=n._id)?void 0:r.toString())||(null==n?void 0:n.toString());e&&(i=[e])}return J.subdomains.some(e=>i.includes(e))},s=e=>{var t;if(!i)return!0;let r=null==e||null==(t=e.availability)?void 0:t.offer;return r&&J.offer.includes(r)},l=null==(t=J.userCourses)?void 0:t[0],u=!!l&&ed,d=e=>{var t,r,n,a,i,o;if(!u)return!0;let s=(null==e||null==(t=e._id)?void 0:t.toString())||(null==e?void 0:e._id);switch(l){case"watching":return null==(r=ed.coursesInProgress)?void 0:r.includes(s);case"watched":return null==(n=ed.coursesCompleted)?void 0:n.includes(s);case"favorite":return null==(a=ed.favoriteIds)?void 0:a.includes(s);case"owned":return null==(i=ed.ownedIds)?void 0:i.includes(s);case"removeWatched":return!(null==(o=ed.coursesCompleted)?void 0:o.includes(s));default:return!0}},h=p($),f=h.length>0,g=[];return ef.sort((e,t)=>(e.position||0)-(t.position||0)).forEach(t=>{if(!t.coursePositions||0===t.coursePositions.length||n&&!J.domains.includes(t._id))return;let r=t.coursePositions.sort((e,t)=>(e.position||0)-(t.position||0)).map(t=>{var r;let n=null==(r=t.courseId)?void 0:r.toString();return e.get(n)}).filter(Boolean).filter(e=>!(0,c.mg)(e)).filter(o).filter(s).filter(d).filter(e=>!f||m(e,h));r.length>0&&g.push({field:t,courses:r})}),g}case"learning":{if(!ef||0===ef.length)return[...ey].sort((e,t)=>{let r=e.publishedAt?new Date(e.publishedAt).getTime():0;return(t.publishedAt?new Date(t.publishedAt).getTime():0)-r});let e=new Map;eu.forEach(t=>{var r,n;let a=(null==(r=t._id)?void 0:r.toString())||(null==(n=t.basicId)?void 0:n.toString());a&&e.set(a,t)});let t=J.offer&&J.offer.includes("Gratuit"),n=!t&&J.domains&&J.domains.length>0,a=!t&&J.subdomains&&J.subdomains.length>0,i=!(J.offer&&J.offer.includes("Pro"))&&J.offer&&J.offer.length>0,o=e=>{var t,r;if(!a)return!0;let n=null==e||null==(t=e.fields)?void 0:t.subfield,i=[];if(Array.isArray(n))i=n.map(e=>{var t;return"string"==typeof e?e:(null==e||null==(t=e._id)?void 0:t.toString())||(null==e?void 0:e.toString())}).filter(Boolean);else if(n){let e="string"==typeof n?n:(null==n||null==(r=n._id)?void 0:r.toString())||(null==n?void 0:n.toString());e&&(i=[e])}return J.subdomains.some(e=>i.includes(e))},s=e=>{var t;if(!i)return!0;let r=null==e||null==(t=e.availability)?void 0:t.offer;return r&&J.offer.includes(r)},l=null==(r=J.userCourses)?void 0:r[0],u=!!l&&ed,d=e=>{var t,r,n,a,i,o;if(!u)return!0;let s=(null==e||null==(t=e._id)?void 0:t.toString())||(null==e?void 0:e._id);switch(l){case"watching":return null==(r=ed.coursesInProgress)?void 0:r.includes(s);case"watched":return null==(n=ed.coursesCompleted)?void 0:n.includes(s);case"favorite":return null==(a=ed.favoriteIds)?void 0:a.includes(s);case"owned":return null==(i=ed.ownedIds)?void 0:i.includes(s);case"removeWatched":return!(null==(o=ed.coursesCompleted)?void 0:o.includes(s));default:return!0}},h=[],f=p($),g=f.length>0;if(!(n||a||i||u||g)){let e=[...eu].filter(e=>{var t,r;let n=Array.isArray(null==e?void 0:e.live)?e.live:(null==e?void 0:e.live)?[e.live]:[];if(0===n.length)return!1;let a=(null==(t=n[0])?void 0:t.endDate)||(null==(r=n[0])?void 0:r.startDate),i=a&&new Date(a).getTime()<=Date.now();return(null==e?void 0:e.status)==="available"&&i||(0,c.mg)(e)}).sort((e,t)=>
11{let r=e=>{var t,r;let n=Array.isArray(null==e?void 0:e.live)?e.live:(null==e?void 0:e.live)?[e.live]:[],a=(null==(t=n[0])?void 0:t.endDate)||(null==(r=n[0])?void 0:r.startDate);return a?new Date(a).getTime():(null==e?void 0:e.publishedAt)?new Date(e.publishedAt).getTime():(null==e?void 0:e.createdAt)?new Date(e.createdAt).getTime():0};return r(t)-r(e)}).slice(0,4);e.length>0&&h.push({field:{_id:"virtual-recent",name:"Les + r\xe9cents",position:-2},courses:e});let t=[...eu].filter(e=>!(0,c.mg)(e)).sort((e,t)=>{var r,n;let a=(null==(r=e.ratings)?void 0:r.count5)||0;return((null==(n=t.ratings)?void 0:n.count5)||0)-a}).slice(0,4);t.length>0&&h.push({field:{_id:"virtual-popular",name:"Les + populaires",position:-1},courses:t})}return(function(e,t){let r=[...e||[]].sort((e,t)=>(e.position||0)-(t.position||0));if(!t||0===t.length)return r;let n=[],a=[];for(let e of r)t.includes(e._id)?n.push(e):a.push(e);return n.sort((e,r)=>t.indexOf(e._id)-t.indexOf(r._id)),[...n,...a]})(ef,w).forEach(t=>{if(!t.coursePositions||0===t.coursePositions.length||n&&!J.domains.includes(t._id))return;let r=t.coursePositions.sort((e,t)=>(e.position||0)-(t.position||0)).map(t=>{var r;let n=null==(r=t.courseId)?void 0:r.toString();return e.get(n)}).filter(Boolean).filter(e=>!(0,c.mg)(e)).filter(o).filter(s).filter(d).filter(e=>!g||m(e,f));if(r.length>0){let e=w.indexOf(t._id);h.push({field:t,courses:r,isUserDomain:-1!==e,isMainDomain:0===e})}}),h}default:return ey}},[ey,eu,H,ef,J.domains,J.subdomains,J.offer,J.userCourses,ed,b,$]),ew=(0,o.useCallback)(e=>{U(e)},[]),eb=(0,o.useCallback)(e=>{z(e)},[]);return{formations:ev,filters:A,userDomainIds:w,catalogFilters:J,setCatalogFilters:X,currentSort:H,modalBuyCourse:x,modalFormation:S,domainDrawerOpen:P,isHovering:I,isFetching:eo,loading:eo,isLoadingUserData:eh,userCoursesData:ed,user:g,sort:H,filtersList:A,actionMenuBindings:O,backgroundVideo:R,isTeaserMode:N,fullHeight:L,modalRating:B,modalDelete:F,sorting:l.p9,error:es,isFavoriteLoading:em.isPending,resetFilters:(0,o.useCallback)(()=>{Y(""),X({domains:[],offer:[],subdomains:[],userCourses:[]});let e={...t.query};delete e.domaines,delete e.categories,delete e.offres,delete e.mescours,t.replace({pathname:t.pathname,query:e},void 0,{shallow:!0})},[t]),toggleFavorite:eg,setModalBuyCourse:E,setModalFormation:k,setDomainDrawerOpen:C,toggleDomainDrawer:Z,openDomainDrawer:ee,closeDomainDrawer:et,setIsHovering:T,handleSortChange:(0,o.useCallback)(e=>{G(e)},[]),handleCatalogFilters:(0,o.useCallback)(function(e,t){arguments.length>2&&void 0!==arguments[2]&&arguments[2],arguments.length>3&&void 0!==arguments[3]&&arguments[3],X(r=>{let n,a=r[t]||[],i=a.includes(e),o=["offer","subdomains","userCourses"].includes(t),s=r.offer&&r.offer.includes("Gratuit");return"offer"===t&&"Gratuit"===e?i?Q&&(G(Q),K(null)):(K(H),G("recent")):"offer"===t&&s&&!i?Q&&(G(Q),K(null)):s||"domains"!==t&&"subdomains"!==t&&"offer"!==t||G("learning"),n=o?i?[]:[e]:i?a.filter(t=>t!==e):[...a,e],{...r,[t]:n}})},[H,Q]),setActionMenuBindings:q,setBackgroundVideo:D,setIsTeaserMode:j,setFullHeight:M,handleModalRating:ew,handleModalDelete:eb,searchQuery:$,setSearchQuery:Y,refetch:el,tempFeedback:V,setTempFeedback:W}}},48149:(e,t,r)=>{"use strict";r.d(t,{II:()=>c,cc:()=>u,v_:()=>l});var n=r(98275),a=r(18070),i=r(81883),o=r(37149);function s(e){return Math.min(1e3*2**e,3e4)}function l(e){return(e??"online")!=="online"||a.t.isOnline()}var u=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function c(e){let t,r=!1,c=0,d=(0,i.T)(),h=()=>n.m.isFocused()&&("always"===e.networkMode||a.t.isOnline())&&e.canRun(),f=()=>l(e.networkMode)&&e.canRun(),p=e=>{"pending"===d.status&&(t?.(),d.resolve(e))},m=e=>{"pending"===d.status&&(t?.(),d.reject(e))},g=()=>new Promise(r=>{t=e=>{("pending"!==d.status||h())&&r(e)},e.onPause?.()}).then(()=>{t=void 0,"pending"===d.status&&e.onContinue?.()}),y=()=>{let t;if("pending"!==d.status)return;let n=0===c?e.initialPromise:void 0;try{t=n??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(p).catch(t=>{if("pending"!==d.status)return;let n=e.retry??3*!o.S$,a=e.retryDelay??s,i="function"==typeof a?a(c,t):a,l=!0===n||"number"==typeof n&&c<n||"function"==typeof n&&n(c,t);if(r||!l)return void m(t);c++,e.onFail?.(c,t),(0,o.yy)(i).then(()=>h()?void 0:g()).then(()=>{r?m(t):y()})})};return{promise:d,status:()=>d.status,cancel:t=>{if("pending"===d.status){let r=new u(t);m(r),e.onCancel?.(r)}},continue:()=>(t?.(),d),cancelRetry:()=>{r=!0},continueRetry:()=>{r=!1},canStart:f,start:()=>(f()?y():g().then(y),d)}}},48230:(e,t,r)=>{e.exports=r(34009)},48306:(e,t,r)=>{"use strict";r.d(t,{Zq:()=>i,zs:()=>a});var n={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},a=new class{#P=n;#C=!1;setTimeoutProvider(e){this.#P=e}setTimeout(e,t){return this.#P.setTimeout(e,t)}clearTimeout(e){this.#P.clearTimeout(e)}setInterval(e,t){return this.#P.setInterval(e,t)}clearInterval(e){this.#P.clearInterval(e)}};function i(e){setTimeout(e,0)}},48945:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esMo
11dule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){let r=null;if(!e||"string"!=typeof e)return r;let n=(0,a.default)(e),i="function"==typeof t;return n.forEach(e=>{if("declaration"!==e.type)return;let{property:n,value:a}=e;i?t(n,a,e):a&&((r=r||{})[n]=a)}),r};let a=n(r(66720))},50650:(e,t,r)=>{"use strict";r.d(t,{I:()=>u});var n=r(77806),a=r(79174),i=r(93e3);let o=/[A-Z]/g,s=/-[a-z]/g,l=/^data[-\w.:]+$/i;function u(e,t){let r=(0,i.S)(t),u=t,h=a.R;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&"data"===r.slice(0,4)&&l.test(t)){if("-"===t.charAt(4)){let e=t.slice(5).replace(s,d);u="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!s.test(e)){let r=e.replace(o,c);"-"!==r.charAt(0)&&(r="-"+r),t="data"+r}}h=n.E}return new h(u,t)}function c(e){return"-"+e.toLowerCase()}function d(e){return e.charAt(1).toUpperCase()}},50900:(e,t,r)=>{"use strict";var n,a,i;r.d(t,{E_:()=>u,F3:()=>l,Ii:()=>s}),function(e){e.Unimplemented="UNIMPLEMENTED",e.Unavailable="UNAVAILABLE"}(n||(n={}));class o extends Error{constructor(e,t,r){super(e),this.message=e,this.code=t,this.data=r}}let s=(e=>e.Capacitor=(e=>{let t=e.CapacitorCustomPlatform||null,r=e.Capacitor||{},a=r.Plugins=r.Plugins||{},i=()=>null!==t?t.name:(e=>{var t,r;return(null==e?void 0:e.androidBridge)?"android":(null==(r=null==(t=null==e?void 0:e.webkit)?void 0:t.messageHandlers)?void 0:r.bridge)?"ios":"web"})(e),s=e=>{var t;return null==(t=r.PluginHeaders)?void 0:t.find(t=>t.name===e)},l=new Map;return r.convertFileSrc||(r.convertFileSrc=e=>e),r.getPlatform=i,r.handleError=t=>e.console.error(t),r.isNativePlatform=()=>"web"!==i(),r.isPluginAvailable=e=>{let t=l.get(e);return!!((null==t?void 0:t.platforms.has(i()))||s(e))},r.registerPlugin=(e,u={})=>{let c,d=l.get(e);if(d)return console.warn(`Capacitor plugin "${e}" already registered. Cannot register plugins twice.`),d.proxy;let h=i(),f=s(e),p=async()=>(!c&&h in u?c=c="function"==typeof u[h]?await u[h]():u[h]:null!==t&&!c&&"web"in u&&(c=c="function"==typeof u.web?await u.web():u.web),c),m=t=>{let a,i=(...i)=>{let s=p().then(s=>{let l=((t,a)=>{var i,s;if(f){let n=null==f?void 0:f.methods.find(e=>a===e.name);if(n)if("promise"===n.rtype)return t=>r.nativePromise(e,a.toString(),t);else return(t,n)=>r.nativeCallback(e,a.toString(),t,n);if(t)return null==(i=t[a])?void 0:i.bind(t)}else if(t)return null==(s=t[a])?void 0:s.bind(t);else throw new o(`"${e}" plugin is not implemented on ${h}`,n.Unimplemented)})(s,t);if(l){let e=l(...i);return a=null==e?void 0:e.remove,e}throw new o(`"${e}.${t}()" is not implemented on ${h}`,n.Unimplemented)});return"addListener"===t&&(s.remove=async()=>a()),s};return i.toString=()=>`${t.toString()}() { [capacitor code] }`,Object.defineProperty(i,"name",{value:t,writable:!1,configurable:!1}),i},g=m("addListener"),y=m("removeListener"),v=(e,t)=>{let r=g({eventName:e},t),n=async()=>{y({eventName:e,callbackId:await r},t)},a=new Promise(e=>r.then(()=>e({remove:n})));return a.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await n()},a},w=new Proxy({},{get(e,t){switch(t){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return f?v:g;case"removeListener":return y;default:return m(t)}}});return a[e]=w,l.set(e,{name:e,proxy:w,platforms:new Set([...Object.keys(u),...f?[h]:[]])}),w},r.Exception=o,r.DEBUG=!!r.DEBUG,r.isLoggingEnabled=!!r.isLoggingEnabled,r})(e))("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==r.g?r.g:{}),l=s.registerPlugin;class u{constructor(){this.listeners={},this.retainedEventArguments={},this.windowListeners={}}addListener(e,t){let r=!1;this.listeners[e]||(this.listeners[e]=[],r=!0),this.listeners[e].push(t);let n=this.windowListeners[e];return n&&!n.registered&&this.addWindowListener(n),r&&this.sendRetainedArgumentsForEvent(e),Promise.resolve({remove:async()=>this.removeListener(e,t)})}async removeAllListeners(){for(let e in this.listeners={},this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}}notifyListeners(e,t,r){let n=this.listeners[e];
11if(!n){if(r){let r=this.retainedEventArguments[e];r||(r=[]),r.push(t),this.retainedEventArguments[e]=r}return}n.forEach(e=>e(t))}hasListeners(e){var t;return!!(null==(t=this.listeners[e])?void 0:t.length)}registerWindowListener(e,t){this.windowListeners[t]={registered:!1,windowEventName:e,pluginEventName:t,handler:e=>{this.notifyListeners(t,e)}}}unimplemented(e="not implemented"){return new s.Exception(e,n.Unimplemented)}unavailable(e="not available"){return new s.Exception(e,n.Unavailable)}async removeListener(e,t){let r=this.listeners[e];if(!r)return;let n=r.indexOf(t);this.listeners[e].splice(n,1),this.listeners[e].length||this.removeWindowListener(this.windowListeners[e])}addWindowListener(e){window.addEventListener(e.windowEventName,e.handler),e.registered=!0}removeWindowListener(e){e&&(window.removeEventListener(e.windowEventName,e.handler),e.registered=!1)}sendRetainedArgumentsForEvent(e){let t=this.retainedEventArguments[e];t&&(delete this.retainedEventArguments[e],t.forEach(t=>{this.notifyListeners(e,t)}))}}let c=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),d=e=>e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class h extends u{async getCookies(){let e=document.cookie,t={};return e.split(";").forEach(e=>{if(e.length<=0)return;let[r,n]=e.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");r=d(r).trim(),n=d(n).trim(),t[r]=n}),t}async setCookie(e){try{let t=c(e.key),r=c(e.value),n=e.expires?`; expires=${e.expires.replace("expires=","")}`:"",a=(e.path||"/").replace("path=",""),i=null!=e.url&&e.url.length>0?`domain=${e.url}`:"";document.cookie=`${t}=${r||""}${n}; path=${a}; ${i};`}catch(e){return Promise.reject(e)}}async deleteCookie(e){try{document.cookie=`${e.key}=; Max-Age=0`}catch(e){return Promise.reject(e)}}async clearCookies(){try{for(let e of document.cookie.split(";")||[])document.cookie=e.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(e){return Promise.reject(e)}}async clearAllCookies(){try{await this.clearCookies()}catch(e){return Promise.reject(e)}}}l("CapacitorCookies",{web:()=>new h});let f=async e=>new Promise((t,r)=>{let n=new FileReader;n.onload=()=>{let e=n.result;t(e.indexOf(",")>=0?e.split(",")[1]:e)},n.onerror=e=>r(e),n.readAsDataURL(e)});class p extends u{async request(e){let t,r,n=((e,t={})=>{let r=Object.assign({method:e.method||"GET",headers:e.headers},t),n=((e={})=>{let t=Object.keys(e);return Object.keys(e).map(e=>e.toLocaleLowerCase()).reduce((r,n,a)=>(r[n]=e[t[a]],r),{})})(e.headers)["content-type"]||"";if("string"==typeof e.data)r.body=e.data;else if(n.includes("application/x-www-form-urlencoded")){let t=new URLSearchParams;for(let[r,n]of Object.entries(e.data||{}))t.set(r,n);r.body=t.toString()}else if(n.includes("multipart/form-data")||e.data instanceof FormData){let t=new FormData;if(e.data instanceof FormData)e.data.forEach((e,r)=>{t.append(r,e)});else for(let r of Object.keys(e.data))t.append(r,e.data[r]);r.body=t;let n=new Headers(r.headers);n.delete("content-type"),r.headers=n}else(n.includes("application/json")||"object"==typeof e.data)&&(r.body=JSON.stringify(e.data));return r})(e,e.webFetchExtra),a=((e,t=!0)=>e?Object.entries(e).reduce((e,r)=>{let n,a,[i,o]=r;return Array.isArray(o)?(a="",o.forEach(e=>{n=t?encodeURIComponent(e):e,a+=`${i}=${n}&`}),a.slice(0,-1)):(n=t?encodeURIComponent(o):o,a=`${i}=${n}`),`${e}&${a}`},"").substr(1):null)(e.params,e.shouldEncodeUrlParams),i=a?`${e.url}?${a}`:e.url,o=await fetch(i,n),s=o.headers.get("content-type")||"",{responseType:l="text"}=o.ok?e:{};switch(s.includes("application/json")&&(l="json"),l){case"arraybuffer":case"blob":r=await o.blob(),t=await f(r);break;case"json":t=await o.json();break;default:t=await o.text()}let u={};return o.headers.forEach((e,t)=>{u[t]=e}),{data:t,headers:u,status:o.status,url:o.url}}async get(e){return this.request(Object.assign(Object.assign({},e),{method:"GET"}))}async post(e){return this.request(Object.assign(Object.assign({},e),{method:"POST"}))}async put(e){return this.request(Object.assign(Object.assign({},e),{method:"PUT"}))}async patch(e){return this.request(Object.assign(Object.assign({},e),{method:"PATCH"}))}async delete(e){return this.request(Object.assign(Object.assign({},e),{method:"DELETE"}))}}l("CapacitorHttp",{web:()=>new p}),function(e){e.Dark="DARK",e.Light="LIGHT",e.Default="DEFAULT"}(a||(a={})),function(e){e.StatusBar="StatusBar",e.NavigationBar="NavigationBar"}(i||(i={}));class m extends u{async setStyle(){this.unavailable("not available for web")}async setAnimation(){this.unavailable("not available for web")}async show(){this.unavailable("not available for web")}async hide(){this.unavailable("not available for web")}}l("SystemBars",{web:()=>new m})},52239:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>l,f$:()=>s,lA:()=>
11o});var n=r(37876),a=r(14232);let i=(0,a.createContext)({displayMode:"hidden",setDisplayMode:()=>{}}),o=e=>{let{children:t}=e,[r,o]=(0,a.useState)("hidden"),s=(0,a.useCallback)(e=>{o(t=>t===e?t:e)},[]),l=(0,a.useMemo)(()=>({displayMode:r,setDisplayMode:s}),[r,s]);return(0,n.jsx)(i.Provider,{value:l,children:t})},s=()=>(0,a.useContext)(i),l=i},52496:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{default:function(){return s},noSSR:function(){return o}});let n=r(72687);r(37876),r(14232);let a=n._(r(90295));function i(e){return{default:(null==e?void 0:e.default)||e}}function o(e,t){return delete t.webpack,delete t.modules,e(t)}function s(e,t){let r=a.default,n={loading:e=>{let{error:t,isLoading:r,pastDelay:n}=e;return null}};e instanceof Promise?n.loader=()=>e:"function"==typeof e?n.loader=e:"object"==typeof e&&(n={...n,...e});let s=(n={...n,...t}).loader;return(n.loadableGenerated&&(n={...n,...n.loadableGenerated},delete n.loadableGenerated),"boolean"!=typeof n.ssr||n.ssr)?r({...n,loader:()=>null!=s?s().then(i):Promise.resolve(i(()=>null))}):(delete n.webpack,delete n.modules,o(r,n))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},53529:e=>{e.exports={red:"Button_red__gIT2S","bg-red":"Button_bg-red__YiaLj",background:"Button_background__RBJyC",radius:"Button_radius__R6BxJ",Text:"Button_Text__9l4ph",Primary:"Button_Primary__Qd_XH",SpanTransition:"Button_SpanTransition__REPZP",Secondary:"Button_Secondary__sICt5",SecondaryDark:"Button_SecondaryDark__MUyn0",BuyCourseButton:"Button_BuyCourseButton__iLz7F",Empty:"Button_Empty__irb5D",EmptyInverse:"Button_EmptyInverse__3T2w2",EmptyWhite:"Button_EmptyWhite__Ueu_l",Inverted:"Button_Inverted__vXboN",Loading:"Button_Loa
11ding__FtzZs",Rsvped:"Button_Rsvped__Ax_Tn",Legacy:"Button_Legacy__MMqra",LegacyRsvped:"Button_LegacyRsvped__aoVCW",small:"Button_small___2pxI",Spinner:"Button_Spinner__zXESq",medium:"Button_medium__zt4Do",large:"Button_large__vZ0uv",FullWidth:"Button_FullWidth__snG41",PulseHover:"Button_PulseHover__bkDkw",pulseHoverSpan:"Button_pulseHoverSpan__uoJGg",LoadingState:"Button_LoadingState__RflG2",spin:"Button_spin__4ZG1n"}},53568:(e,t,r)=>{"use strict";r.d(t,{oz:()=>F});var n=r(3610),a=r(44483);let i=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,o=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,s={};function l(e,t){return((t||s).jsx?o:i).test(e)}var u=r(80574),c=r(88367),d=r(50650);let h={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};var f=r(15444),p=r(83833),m=r(46029),g=r(84787);let y={}.hasOwnProperty,v=new Map,w=/[A-Z]/g,b=new Set(["table","tbody","thead","tfoot","tr"]),x=new Set(["td","th"]),E="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function S(e,t,r){return"element"===t.type?function(e,t,r){let n=e.schema;"svg"===t.tagName.toLowerCase()&&"html"===n.space&&(e.schema=c.JW),e.ancestors.push(t);let i=I(e,t.tagName,!1),o=function(e,t){let r,n,i={};for(n in t.properties)if("children"!==n&&y.call(t.properties,n)){let o=function(e,t,r){let n=(0,d.I)(e.schema,t);if(!(null==r||"number"==typeof r&&Number.isNaN(r))){if(Array.isArray(r)&&(r=n.commaSeparated?(0,a.A)(r):(0,f.A)(r)),"style"===n.property){let t="object"==typeof r?r:function(e,t){try{return p(t,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};let t=new g.o("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw t.file=e.filePath||void 0,t.url=E+"#cannot-parse-style-attribute",t}}(e,String(r));return"css"===e.stylePropertyNameCase&&(t=function(e){let t,r={};for(t in e)y.call(e,t)&&(r[function(e){let t=e.replace(w,A);return"ms-"===t.slice(0,3)&&(t="-"+t),t}(t)]=e[t]);return r}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&n.space?h[n.property]||n.property:n.attribute,r]}}(e,n,t.properties[n]);if(o){let[n,a]=o;e.tableCellAlignToStyle&&"align"===n&&"string"==typeof a&&x.has(t.tagName)?r=a:i[n]=a}}return r&&((i.style||(i.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=r),i}(e,t),s=C(e,t);return b.has(t.tagName)&&(s=s.filter(function(e){return"string"!=typeof e||!(0,u.m)(e)})),k(e,o,i,t),P(o,s),e.ancestors.pop(),e.schema=n,e.create(t,i,o,r)}(e,t,r):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){let r=t.data.estree.body[0];return(0,n.ok)("ExpressionStatement"===r.type),e.evaluater.evaluateExpression(r.expression)}T(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?function(e,t,r){let a=e.schema;"svg"===t.name&&"html"===a.space&&(e.schema=c.JW),e.ancestors.push(t);let i=null===t.name?e.Fragment:I(e,t.name,!0),o=function(e,t){let r={};for(let a of t.attributes)if("mdxJsxExpressionAttribute"===a.type)if(a.data&&a.data.estree&&e.evaluater){let t=a.data.estree.body[0];(0,n.ok)("ExpressionStatement"===t.type);let i=t.expression;(0,n.ok)("ObjectExpression"===i.type);let o=i.properties[0];(0,n.ok)("SpreadElement"===o.type),Object.assign(r,e.evaluater.evaluateExpression(o.argument))}else T(e,t.position);else{let i,o=a.name;if(a.value&&"object"==typeof a.value)if(a.value.data&&a.value.data.estree&&e.evaluater){let t=a.value.data.estree.body[0];(0,n.ok)("ExpressionStatement"===t.type),i=e.evaluater.evaluateExpression(t.expression)}else T(e,t.position);else i=null===a.value||a.value;r[o]=i}return r}(e,t),s=C(e,t);return k(e,o,i,t),P(o,s),e.ancestors.pop(),e.schema=a,e.create(t,i,o,r)}(e,t,r):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);T(e,t.position)}(e,t):"root"===t.type?function(e,t,r){let n={};return P(n,C(e,t)),e.create(t,e.Fragment,n,r)}(e,t,r):"text"===t.type?t.value:void 0}function k(e,t,r,n){"string"!=typeof r&&r!==e.Fragment&&e.passNode&&(t.node=n)}function P(e,t){if(t.length>0){let r=t.length>1?t:t[0];r&&(e.children=r)}}function C(e,t){let r=[],n=-1,a=e.passKeys?new Map:v;for(;++n<t.children.length;){let i,o=t.children[n];if(e.passKeys){let e="element"===o.type?o.tagName:"mdxJsxFlowElement"===o.type||"mdxJsxTextElement"===o.type?o.name:void 0;if(e){let t=a.get(e)||0;i=e+"-"+t,a.set(e,t+1)}}let s=S(e,o,i);void 0!==s&&r.push(s)}return r}function I(e,t,r){let a;if(r)if(t.includes(".")){let e,r=t.split("."),i=-1;for(;++i<r.length;){let t=l(r[i])?{type:"Identifier",name:r[i]}:{type:"Literal",value:r[i]};e=e?{type:"MemberExpression",object:e,property:t,computed:!!(i&&"Literal"===t.type),optional:!1}:t}(0,n.ok)(e,"always a result"),a=e}else a=l(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};else a={type:"Literal",value:t};if("Literal"===a.type){let t=a.value;
11return y.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(a);T(e)}function T(e,t){let r=new g.o("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=E+"#cannot-handle-mdx-estrees-without-createevaluater",r}function A(e){return"-"+e.toLowerCase()}let _={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]};var O=r(37876);r(14232);var q=r(9030),R=r(8420),D=r(13332),N=r(73435),j=r(65721);let L=[],M={allowDangerousHtml:!0},B=/^(https?|ircs?|mailto|xmpp)$/i,U=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function F(e){let t=function(e){let t=e.rehypePlugins||L,r=e.remarkPlugins||L,n=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...M}:M;return(0,D.l)().use(q.A).use(r).use(R.A,n).use(t)}(e),r=function(e){let t=e.children||"",r=new j.T;return"string"==typeof t?r.value=t:(0,n.HB)("Unexpected value `"+t+"` for `children` prop, expected `string`"),r}(e);return function(e,t){let r=t.allowedElements,a=t.allowElement,i=t.components,o=t.disallowedElements,s=t.skipHtml,l=t.unwrapDisallowed,u=t.urlTransform||z;for(let e of U)Object.hasOwn(t,e.from)&&(0,n.HB)("Unexpected `"+e.from+"` prop, "+(e.to?"use `"+e.to+"` instead":"remove it")+" (see <https://github.com/remarkjs/react-markdown/blob/main/changelog.md#"+e.id+"> for more info)");return r&&o&&(0,n.HB)("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other"),(0,N.YR)(e,function(e,t,n){if("raw"===e.type&&n&&"number"==typeof t)return s?n.children.splice(t,1):n.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in _)if(Object.hasOwn(_,t)&&Object.hasOwn(e.properties,t)){let r=e.properties[t],n=_[t];(null===n||n.includes(e.tagName))&&(e.properties[t]=u(String(r||""),t,e))}}if("element"===e.type){let i=r?!r.includes(e.tagName):!!o&&o.includes(e.tagName);if(!i&&a&&"number"==typeof t&&(i=!a(e,t,n)),i&&n&&"number"==typeof t)return l&&e.children?n.children.splice(t,1,...e.children):n.children.splice(t,1),t}}),function(e,t){var r,n,a,i;let o;if(!t||void 0===t.Fragment)throw TypeError("Expected `Fragment` in options");let s=t.filePath||void 0;if(t.development){if("function"!=typeof t.jsxDEV)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=s,n=t.jsxDEV,o=function(e,t,a,i){let o=Array.isArray(a.children),s=(0,m.PW)(e);return n(t,a,i,o,{columnNumber:s?s.column-1:void 0,fileName:r,lineNumber:s?s.line:void 0},void 0)}}else{if("function"!=typeof t.jsx)throw TypeError("Expected `jsx` in production options");
11if("function"!=typeof t.jsxs)throw TypeError("Expected `jsxs` in production options");a=t.jsx,i=t.jsxs,o=function(e,t,r,n){let o=Array.isArray(r.children)?i:a;return n?o(t,r,n):o(t,r)}}let l={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:o,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:s,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?c.JW:c.qy,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},u=S(l,e,void 0);return u&&"string"!=typeof u?u:l.create(e,l.Fragment,{children:u||void 0},void 0)}(e,{Fragment:O.Fragment,components:i,ignoreInvalidStyle:!0,jsx:O.jsx,jsxs:O.jsxs,passKeys:!0,passNode:!0})}(t.runSync(t.parse(r),r),e)}function z(e){let t=e.indexOf(":"),r=e.indexOf("?"),n=e.indexOf("#"),a=e.indexOf("/");return -1===t||-1!==a&&t>a||-1!==r&&t>r||-1!==n&&t>n||B.test(e.slice(0,t))?e:""}},55747:e=>{e.exports={red:"LoadingOverlay_red__AseNu","bg-red":"LoadingOverlay_bg-red__MWbh1",background:"LoadingOverlay_background__KRSLM",radius:"LoadingOverlay_radius__bwikX",loadingOverlay:"LoadingOverlay_loadingOverlay__JFvAI",loadingSpinner:"LoadingOverlay_loadingSpinner__VynJO",spinnerCircle:"LoadingOverlay_spinnerCircle__MXkxx",spin:"LoadingOverlay_spin__gxIDQ"}},55811:(e,t,r)=>{"use strict";r.d(t,{C3:()=>h,S:()=>u,u:()=>i,vW:()=>d});var n=r(5824),a=r(75433);let i="empara:offline-blocked",o=()=>{},s=null;function l(e){return e&&e.replace(/\/+$/,"")||"/"}function u(e,t){let r;if("string"!=typeof e)return!1;let n=e.trim();if(!n)return!1;if(n.startsWith("#"))return!0;try{r=new URL(n,window.location.href)}catch(e){return!1}return r.origin===window.location.origin&&l(r.pathname)===l(window.location.pathname)}function c(e){try{(0,n.J_)()&&(0,a.switchToOfflineShell)(),window.dispatchEvent(new CustomEvent(i,{detail:{url:e}}))}catch(e){}}function d(e,t){let{replace:r=!1,reload:a=!1}=t||{};if((0,n.JK)()&&!1===navigator.onLine){let t=a?window.location.href:e;return console.warn("[offline] navigation dure annul\xe9e (hors-ligne) :",t),c(t),!1}return a?window.location.reload():r?window.location.replace(e):window.location.href=e,!0}function h(e){if(!(0,n.JK)()||s)return o;let t=t=>{let r;if(!1!==navigator.onLine||t.defaultPrevented||"number"==typeof t.button&&0!==t.button||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey)return;let n=t.target;if(!n||"function"!=typeof n.closest)return;let a=n.closest("a[href]");if(!a)return;let i=(a.getAttribute("href")||"").trim();if(!i||i.startsWith("#"))return;let o=a.getAttribute("target");if(!(o&&"_self"!==o||a.hasAttribute("download"))){try{r=new URL(i,window.location.href)}catch(e){return}("http:"===r.protocol||"https:"===r.protocol)&&r.origin===window.location.origin&&(u(r.href,e&&e.query)||(t.preventDefault(),t.stopPropagation(),console.warn("[offline] navigation annul\xe9e (hors-ligne) :",r.pathname),c(r.href)))}},r=(t,r)=>{if(!1!==navigator.onLine||r&&r.shallow&&u(t,e&&e.query))return;c(t),console.warn("[offline] navigation annul\xe9e (hors-ligne) :",t);let n=Error("EMPARA_OFFLINE_NAV_BLOCKED");throw n.__emparaOfflineBlocked=!0,n},a=e=>{let t=e&&e.reason;t&&t.__emparaOfflineBlocked&&e.preventDefault()};document.addEventListener("click",t,!0),window.addEventListener("unhandledrejection",a);let i=e&&e.events;i&&i.on("routeChangeStart",r);let l=()=>{s===l&&(document.removeEventListener("click",t,!0),window.removeEventListener("unhandledrejection",a),i&&i.off("routeChangeStart",r),s=null)};return s=l,l}},56556:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return r(4817)}])},56726:(e,t,r)=>{"use strict";r.d(t,{E:()=>u,V:()=>s});var n=r(37876),a=r(14232),i=r(67914);let o=(0,a.createContext)({}),s=()=>{let e=(0,a.useContext)(o);if(!e)throw Error("useBannerContext must be used within BannerProvider");return e},l={active:()=>["banners","active"]};function u(e){let{children:t,initialBanners:r=[]}=e,[s,u]=(0,a.useState)([]),{data:c}=(0,i.I)({queryKey:l.active(),queryFn:async()=>{let e=await fetch("/api/banners",{method:"GET",credentials:"include"});if(!e.ok)throw Error("HTTP error! status: ".concat(e.status));let t=await e.json();if(!t.success)throw Error(t.message||"API error fetching banners");return{banners:t.banners||[]}},placeholderData:{banners:r},staleTime:3e5,refetchOnWindowFocus:!1}),d=(null==c?void 0:c.banners)||r||[];(0,a.useEffect)(()=>{try{let e=JSON.parse(localStorage.getItem("dismissedBanners")||"[]");u(e)}
11catch(e){console.error("Error loading dismissed banners:",e)}},[]);let h=(0,a.useCallback)(e=>{u(t=>{let r=[...t,e];try{localStorage.setItem("dismissedBanners",JSON.stringify(r))}catch(e){console.error("Error saving dismissed banner:",e)}return r})},[]),f=(0,a.useMemo)(()=>d.filter(e=>{let t=e.basicId||e._id;return!s.includes(t)}),[d,s]),p=(0,a.useMemo)(()=>({banners:d,activeBanners:f,dismissBanner:h}),[d,f,h]);return(0,n.jsx)(o.Provider,{value:p,children:t})}},56803:(e,t,r)=>{"use strict";r.r(t),r.d(t,{DEFAULT_DOWNLOAD_CONCURRENCY:()=>p,LEGACY_MEDIA_MIGRATION_VERSION:()=>v,MAX_DOWNLOAD_CONCURRENCY:()=>f,MIN_DOWNLOAD_CONCURRENCY:()=>h,clampDownloadConcurrency:()=>m,offlineMediaStorage:()=>M});var n=r(95925),a=r(99783),i=r(75433);let o=a.OFFLINE_STORES.DOWNLOADED_MEDIA,s="empara-offline-videos-v1",l="empara_offline_courses_manifest",u="empara_offline_storage_stats",c="empara_offline_download_quality_pref",d="empara_offline_download_concurrency_pref",h=2,f=8,p=5;function m(e){if(null==e||""===e)return p;let t=Math.round(Number(e));return Number.isFinite(t)?Math.min(f,Math.max(h,t)):p}let g="empara_offline_storage_owner",y="empara_offline_media_migration",v=1;function w(e){return!!e&&"native"!==e.mediaStore&&!e.nativeAssetId&&("string"==typeof e.cacheKey?e.cacheKey:"").startsWith("/offline-media/")}function b(e){return!!e&&("native"===e.mediaStore||!!e.nativeAssetId)}function x(e){if(!b(e))return null;let t=e.nativeAssetId||e.videoId;return t?String(t):null}function E(){return window.caches?window.caches:"undefined"!=typeof caches?caches:null}function S(){try{if("function"!=typeof i.isNativeMediaAvailable)return!!i.isNativeMediaAvailable;return!!(0,i.isNativeMediaAvailable)()}catch(e){return!1}}let k={state:"unknown",at:0,capacity:null},P=null,C=0;async function I(){let{force:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!S())return"proven"!==k.state&&(k={state:"absent",at:Date.now(),capacity:null}),k;if(!e&&"proven"===k.state||!e&&"absent"===k.state&&Date.now()-k.at<3e4)return k;if(!e&&P)return P;let t=++C,r=(async()=>{let e=null;try{e="function"==typeof i.capacity?await (0,i.capacity)():null}catch(t){console.warn("[OfflineMediaStorage] Sonde du magasin natif en \xe9chec:",t),e=null}let r=Number(null==e?void 0:e.safeUsableBytes),n=e&&Number.isFinite(r)&&r>=0?{state:"proven",at:Date.now(),capacity:e}:{state:"absent",at:Date.now(),capacity:null};return t===C&&(k=n),n})();return P=r,r.then(()=>{P===r&&(P=null)},()=>{P===r&&(P=null)}),r}function T(e){let t=Number(e);return!Number.isFinite(t)||t<=0?0:Math.round(t/0x40000000*10)/10}let A={capacitySource:"unknown",isEstimateReliable:!1,totalDeviceGB:0,freeDeviceGB:0,safeUsableBytes:null,deviceTotalBytes:null,deviceFreeBytes:null,nativeUsedByAppBytes:null};async function _(e,t,r){var n;if(!(null==(n=window.crypto)?void 0:n.subtle))return e;try{let n=r.replace(/^0x/,""),a=new Uint8Array(n.match(/.{1,2}/g).map(e=>parseInt(e,16))),i=await window.crypto.subtle.importKey("raw",t,{name:"AES-CBC"},!1,["encrypt"]);return await window.crypto.subtle.encrypt({name:"AES-CBC",iv:a},i,e)}catch(t){return console.warn("[OfflineMediaStorage] Fallback chiffrement WebCrypto:",t),e}}async function O(e,t,r){var n;if(!(null==(n=window.crypto)?void 0:n.subtle))return e;try{let n=r.replace(/^0x/,""),a=new Uint8Array(n.match(/.{1,2}/g).map(e=>parseInt(e,16))),i=await window.crypto.subtle.importKey("raw",t,{name:"AES-CBC"},!1,["decrypt"]);return await window.crypto.subtle.decrypt({name:"AES-CBC",iv:a},i,e)}catch(t){return console.error("[OfflineMediaStorage] Erreur d\xe9chiffrement WebCrypto:",t),e}}let q=["attempts","queuedAt","nextAttemptAt","lastError","plannedAt"];function R(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e||"completed"!==e.status||!0!==e.integrityChecked||!b(e)||x(e)!==t||r&&e.quality&&String(e.quality)!==String(r))return 0;let n=Number(e.filesize)||0;return n>0?n:0}function D(e,t){let r=Error(e),n=Number(t);return Number.isFinite(n)&&n>=100&&(r.status=n,r.httpStatus=n),r}function N(e,t){let r=(Array.isArray(e)?e:[]).map(e=>({firstname:String((null==e?void 0:e.firstname)||"").trim(),lastname:String((null==e?void 0:e.lastname)||"").trim()})).filter(e=>e.firstname||e.lastname);return r.length>0?r:t?[{firstname:String(t),lastname:""}]:[]}function j(e,t){let r="/cours/".concat(e,"/learn");return t?"".concat(r,"/0?v=").concat(t):r}class L{async getDB(){return this.db?this.db:this.dbPromise?this.dbPromise:window.indexedDB?(this.dbPromise=(0,a.openOfflineDb)().then(e=>e?(this.db=e,this.syncNativeOutcomes().catch(()=>{}),this.db.onversionchange=()=>{this.db.close(),this.db=null,this.dbPromise=null},e):(this.dbPromise=null,null)).catch(e=>{throw this.dbPromise=null,e}),this.dbPromise):null}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}notifyListeners(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};
11this.listeners.forEach(t=>{try{t(e)}catch(e){console.error("[OfflineMediaStorage] Listener error:",e)}})}async getAllDownloadedVideos(){let e=await this.getDB();return e?new Promise((t,r)=>{let n=e.transaction([o],"readonly").objectStore(o).getAll();n.onsuccess=()=>t(n.result||[]),n.onerror=e=>r(e.target.error)}):[]}async readAllDownloadedVideosOrNull(){return this.getAllDownloadedVideos().then(e=>Array.isArray(e)?e:null,e=>(console.warn("[OfflineMediaStorage] Lecture des lignes de t\xe9l\xe9chargement impossible:",e),null))}async getDownloadedVideo(e){let t=await this.getDB();return t&&e?new Promise((r,n)=>{let a=t.transaction([o],"readonly").objectStore(o).get(String(e));a.onsuccess=()=>r(a.result||null),a.onerror=e=>n(e.target.error)}):null}async isVideoDownloaded(e){if(!e)return!1;let t=await this.getDownloadedVideo(e);return!!(t&&"completed"===t.status)}async getGroupedDownloads(){let e=(await this.getAllDownloadedVideos()).filter(e=>"completed"===e.status),t={};for(let r of e){let e=r.courseId||"unknown_course",n=r.chapterId||"unknown_chapter";t[e]||(t[e]={id:e,_id:e,title:r.courseTitle||"Formation",marketingName:r.courseMarketingName||r.courseTitle||"Formation",slug:r.courseSlug||"",url:r.courseSlug||"",author:r.courseAuthor||"Empara",authors:N(r.courseAuthors,r.courseAuthor||"Empara"),cover:r.courseCover||null,image:r.courseCover||null,imageCatalogue:r.courseImageCatalogue||r.courseCover||null,fields:r.courseFields||[],resume:r.courseResume||"",totalDurationSeconds:0,totalSizeBytes:0,progress:r.courseProgress||0,chapters:{},videosCount:0,isOfflineAvailable:!0});let a=t[e];a.totalDurationSeconds+=Number(r.duration||0),a.totalSizeBytes+=Number(r.filesize||0),a.videosCount+=1,a.chapters[n]||(a.chapters[n]={id:n,_id:n,title:r.chapterTitle||"Chapitre",order:r.chapterOrder||0,totalDurationSeconds:0,totalSizeBytes:0,videos:[]});let i=a.chapters[n];i.totalDurationSeconds+=Number(r.duration||0),i.totalSizeBytes+=Number(r.filesize||0),i.videos.push(r)}return Object.values(t).map(e=>{let t=Object.values(e.chapters).sort((e,t)=>(e.order||0)-(t.order||0));return t.forEach(e=>{e.videos.sort((e,t)=>(e.globalOrder||0)-(t.globalOrder||0))}),{...e,duration:Math.round((e.totalDurationSeconds||0)/3600*10)/10,sizeMB:Math.round(e.totalSizeBytes/1048576*10)/10,chapters:t}})}async getOfflineDashboardData(e){var t,r,n;let a=await this.getGroupedDownloads();if(!a||0===a.length)return{resume:{hero:null,inProgress:[],topCourses:[]},purchased:[]};let i=a.map(e=>{var t,r,n;let a=null==(n=e.chapters)||null==(r=n[0])||null==(t=r.videos)?void 0:t[0],i=(null==a?void 0:a.videoId)||"";return{course:{_id:e.id,basicId:e.id,title:e.title,marketingName:e.marketingName||e.title,url:e.slug,authors:e.authors,image:e.image,imageCatalogue:e.imageCatalogue,duration:e.duration,progress:e.progress},progressPct:e.progress||0,href:j(e.slug||e.id,i),isOffline:!0}}),o=a.find(e=>(e.progress||0)>0)||a[0],s=(null==(n=o.chapters)||null==(r=n[0])||null==(t=r.videos)?void 0:t[0])||null,l=(null==s?void 0:s.videoId)||"";return{resume:{hero:o?{course:{_id:o.id,basicId:o.id,title:o.title,marketingName:o.marketingName||o.title,url:o.slug,authors:o.authors,image:o.image,imageCatalogue:o.imageCatalogue,duration:o.duration},video:s?{_id:l,videoId:l,title:s.title||"",duration:s.duration||0}:null,progressPct:o.progress||0,resumeHref:j(o.slug||o.id,l),pinned:!1,isOffline:!0}:null,inProgress:a.filter(e=>e.id!==(null==o?void 0:o.id)).map(e=>{var t,r,n;let a=null==(n=e.chapters)||null==(r=n[0])||null==(t=r.videos)?void 0:t[0],i=(null==a?void 0:a.videoId)||"";return{course:{_id:e.id,basicId:e.id,title:e.title,marketingName:e.marketingName||e.title,url:e.slug,authors:e.authors,image:e.image,imageCatalogue:e.imageCatalogue,duration:e.duration},progressPct:e.progress||0,href:j(e.slug||e.id,i),pinned:!1,isOffline:!0}}),topCourses:[]},purchased:i}}async getOfflineCatalogCourses(){return(await this.getGroupedDownloads()).map(e=>{var t;return{_id:e.id,basicId:e.id,title:e.title,marketingName:e.marketingName||e.title,url:e.slug,authors:e.authors,author:e.author,image:e.image,imageCatalogue:e.imageCatalogue,duration:e.duration,progress:e.progress||0,fields:e.fields||[],resume:e.resume||"",status:"available",isOffline:!0,sizeMB:e.sizeMB,videosCount:e.videosCount,chaptersCount:(null==(t=e.chapters)?void 0:t.length)||0}})}async syncManifestToLocalDisk(){try{let[e,t]=await Promise.all([this.getGroupedDownloads(),this.get
11StorageStats()]),r=JSON.stringify(e),a=JSON.stringify(t);if(this.manifestDiagnostics.lastManifestChars=r.length,this.manifestDiagnostics.lastStatsChars=a.length,window.localStorage){this.manifestDiagnostics.lastWriteAt=Date.now();try{localStorage.setItem(l,r),this.manifestDiagnostics.lastWriteOk=!0,this.manifestDiagnostics.lastError=null}catch(e){this.manifestDiagnostics.lastWriteOk=!1,this.manifestDiagnostics.writeFailures+=1,this.manifestDiagnostics.lastError=(null==e?void 0:e.name)||String(e),console.warn("[OfflineMediaStorage] \xc9criture du manifeste refus\xe9e par localStorage "+"(".concat(r.length," caract\xe8res, \xe9chec n\xb0").concat(this.manifestDiagnostics.writeFailures,") :"),e)}try{localStorage.setItem(u,a)}catch(e){console.warn("[OfflineMediaStorage] Erreur sauvegarde stats localStorage:",e)}}let i=window.caches||("undefined"!=typeof caches?caches:null);if(i)try{let r=await i.open(n.APP_CACHE_NAME),a={manifest:e,stats:t,updatedAt:Date.now()};await r.put("/offline-data/courses-manifest.json",new Response(JSON.stringify(a),{headers:{"Content-Type":"application/json"}}))}catch(e){console.warn("[OfflineMediaStorage] Erreur mise en cache manifeste:",e)}return{manifest:e,stats:t,diagnostics:this.getManifestDiagnostics()}}catch(e){return console.error("[OfflineMediaStorage] Erreur syncManifestToLocalDisk:",e),{manifest:[],stats:this.getCachedStatsSync(),diagnostics:this.getManifestDiagnostics()}}}getManifestDiagnostics(){return{...this.manifestDiagnostics}}getCachedManifestSync(){if(!window.localStorage)return[];try{let e=localStorage.getItem(l);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch(e){return console.warn("[OfflineMediaStorage] Erreur lecture manifeste synchrone:",e),[]}}getCachedStatsSync(){let e={emparaBytes:0,emparaMB:0,emparaGB:0,totalVideosCount:0,...A};if(!window.localStorage)return{...e};try{let t=localStorage.getItem(u);if(!t)return{...e};let r=JSON.parse(t);return{...e,...r}}catch(t){return console.warn("[OfflineMediaStorage] Erreur lecture stats synchrone:",t),{...e}}}getDownloadQualityPreference(){if(!window.localStorage)return null;let e=localStorage.getItem(c);return"normal"===e||"low"===e?e:null}setDownloadQualityPreference(e){if(!window.localStorage)return;let t="low"===e?"low":"normal";localStorage.setItem(c,t),this.notifyListeners({type:"quality_preference_changed",quality:t})}getDownloadConcurrencyPreference(){if(!window.localStorage)return p;let e=localStorage.getItem(d);return null==e?p:m(e)}setDownloadConcurrencyPreference(e){let t=m(e);return window.localStorage&&(localStorage.setItem(d,String(t)),this.notifyListeners({type:"concurrency_preference_changed",concurrency:t})),t}getStorageOwnerId(){return window.localStorage&&localStorage.getItem(g)||null}setStorageOwnerId(e){window.localStorage&&e&&localStorage.setItem(g,String(e))}async clearAllLocalData(){let e=!1;try{e="function"==typeof i.clearAllMedia&&await (0,i.clearAllMedia)()}catch(t){console.warn("[OfflineMediaStorage] Erreur purge du magasin natif:",t),e=!1}if("caches"in window)try{await caches.delete(s)}catch(e){console.warn("[OfflineMediaStorage] Erreur purge cache vid\xe9os:",e)}let t=await this.getDB();if(t&&(await new Promise((e,r)=>{let n=t.transaction([o],"readwrite").objectStore(o).clear();n.onsuccess=()=>e(),n.onerror=e=>r(e.target.error)}),t.objectStoreNames.contains(a.OFFLINE_STORES.COURSE_SNAPSHOTS)&&await new Promise((e,r)=>{let n=t.transaction([a.OFFLINE_STORES.COURSE_SNAPSHOTS],"readwrite").objectStore(a.OFFLINE_STORES.COURSE_SNAPSHOTS).clear();n.onsuccess=()=>e(),n.onerror=e=>r(e.target.error)}).catch(e=>{console.warn("[OfflineMediaStorage] Erreur purge des snapshots de cours:",e)})),window.localStorage)try{localStorage.removeItem(l),localStorage.removeItem(u)}catch(e){console.warn("[OfflineMediaStorage] Erreur purge localStorage:",e)}if(await (0,n.clearOfflineAppCache)(),this.notifyListeners({type:"cleared"}),!e&&"proven"===(await I()).state)throw Error("Le magasin m\xe9dia natif nâa pas pu \xeatre purg\xe9 : des vid\xe9os du compte pr\xe9c\xe9dent sont encore sur cet appareil.")}async ensureOwner(e){if(!e)return{owner:this.getStorageOwnerId(),purged:!1};let t=String(e),r=this.getStorageOwnerId();if(r===t)return{owner:r,purged:!1};if(!r)return this.setStorageOwnerId(t),{owner:t,purged:!1};try{await this.clearAllLocalData()}catch(e){return console.error("[OfflineMediaStorage] \xc9chec purge au changement de propri\xe9taire:",e),{owner:r,purged:!1}}return this.setStorageOwnerId(t),{owner:t,purged:!0}}resolveEffectiveQuality(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return"360p"===e||"low"===e?"360p":"720p"===e||"normal"===e||"normal"===this.getDownloadQualityPreference()?"720p":"360p"}async saveVideoMetadata(e){let{silent:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=await this.getDB();if(!r)return e;if(await new Promise((n,a)=>{let i=r.transaction([o],"readwrite").objectStore(o).put(e);i.onsuccess=()=>{n(e),t||this.notifyListeners({type:"update",videoId:e.videoId,item:e})},i.onerror=e=>a(e.target.error)}),!t)try{await this.syncManifestToLocalDisk()}catch(e){console.warn("[OfflineMediaStorage] Erreur syncManifest apr\xe8s saveVideoMetadata:",e)}return e}async savePlanRows(e){let t=Array.isArray(e)?e.filter(e=>e&&e.videoId):[];if(0===t.length)return 0;let r=await this.getDB();if(!r)return 0;
11let n=await new Promise((e,n)=>{let a=r.transaction([o],"readwrite"),i=a.objectStore(o),s=0;t.forEach(e=>{i.put(e).onsuccess=()=>{s+=1}}),a.oncomplete=()=>e(s),a.onerror=e=>{var t;return n(a.error||(null==e||null==(t=e.target)?void 0:t.error))},a.onabort=e=>{var t;return n(a.error||(null==e||null==(t=e.target)?void 0:t.error))}});try{await this.syncManifestToLocalDisk()}catch(e){console.warn("[OfflineMediaStorage] Erreur syncManifest apr\xe8s savePlanRows:",e)}return this.notifyListeners({type:"plan_rows_saved",count:n,videoIds:t.map(e=>String(e.videoId))}),n}async downloadVideo(e){var t,r,n,a,o,l,u;let{course:c,chapter:d,video:h,quality:f=null,onProgress:p,signal:m=null}=e;if(!(null==h?void 0:h._id)&&!(null==h?void 0:h.videoId)&&!(null==h?void 0:h.mediaId))throw Error("Identifiant de vid\xe9o manquant");let g=this.resolveEffectiveQuality(f),y=String((null==c?void 0:c._id)||(null==c?void 0:c.id)||h.courseId||""),v=String((null==d?void 0:d._id)||(null==d?void 0:d.id)||h.chapterId||"default"),E=h._id||h.videoId||h.mediaId,S=null,k=null;try{let e=await fetch("/api/videos/".concat(E,"/hls-manifest?quality=").concat(g),{signal:m});e.ok?S=await e.json():k=e.status}catch(e){if((null==e?void 0:e.name)==="AbortError")throw e;console.warn("[OfflineMediaStorage] HLS manifest API fallback:",e)}if(!S||!S.downloadUrl){let e=await fetch("/api/videos/".concat(E,"/offline-link?quality=").concat(g),{signal:m});if(!e.ok){let t=await e.json().catch(()=>({})),r=Number(e.status)>=100?e.status:k;throw D(t.error||"Impossible de g\xe9n\xe9rer le lien de t\xe9l\xe9chargement",r)}S=await e.json()}let P=S.downloadUrl;if(!P)throw Error("URL de flux vid\xe9o introuvable");let C=String(S.videoId||h._id||h.videoId||h.mediaId),T=Date.now(),A=S.offlineSecurityDays||30,O=24*A*36e5,R=T+O,j=S.encryption||null,L=!!(j&&j.keyUri),M=await this.getDownloadedVideo(C).catch(()=>null),B="proven"===(await I()).state;if(B&&w(M)&&(await this._purgeLegacyCacheEntries(M)||(console.warn("[OfflineMediaStorage] Copie h\xe9rit\xe9e de ".concat(C," non effa\xe7able : ")+"t\xe9l\xe9chargement maintenu dans le magasin CacheStorage."),B=!1)),!B&&b(M))try{let e=x(M);e&&"function"==typeof i.removeMedia&&await (0,i.removeMedia)(e)}catch(e){console.warn("[OfflineMediaStorage] Ancienne copie native non effa\xe7able:",e)}let U={videoId:C,mediaId:S.mediaId||h.mediaId,courseId:y,courseTitle:(null==c?void 0:c.title)||"Formation",courseMarketingName:(null==c?void 0:c.marketingName)||(null==c?void 0:c.title)||"Formation",courseSlug:(null==c?void 0:c.url)||(null==c?void 0:c.slug)||"",courseAuthor:(null==c?void 0:c.author)||((null==c||null==(r=c.authors)||null==(t=r[0])?void 0:t.firstname)?"".concat((null==c||null==(a=c.authors)||null==(n=a[0])?void 0:n.firstname)||""," ").concat((null==c||null==(l=c.authors)||null==(o=l[0])?void 0:o.lastname)||"").trim():"Empara"),courseAuthors:N(null==c?void 0:c.authors,null==c?void 0:c.author),courseCover:(null==c?void 0:c.image)||null,courseImageCatalogue:(null==c?void 0:c.imageCatalogue)||(null==c?void 0:c.imageSquare)||(null==c?void 0:c.image)||null,courseFields:(null==c?void 0:c.fields)||[],courseResume:(null==c?void 0:c.resume)||"",courseProgress:(null==c?void 0:c.progress)||0,chapterId:v,chapterTitle:(null==d?void 0:d.title)||"Chapitre",chapterOrder:(null==d?void 0:d.order)||0,title:S.title||h.title||"Le\xe7on",globalOrder:S.globalOrder||h.globalOrder||0,duration:S.duration||h.duration||0,quality:S.quality||f,filesize:S.filesize||0,status:"downloading",progress:0,integrityChecked:!1,downloadedAt:T,lastVerifiedAt:T,expiresAt:R,offlineSecurityDays:A,subtitles:S.subtitle||null,streamType:B?"native_ctr":L?"hls_aes128":"standard_mp4",mediaStore:B?"native":"cache",nativeAssetId:B?C:null,cacheKey:B?null:"/offline-media/videos/".concat(C,".mp4"),playlistCacheKey:B?null:"/offline-media/playlists/".concat(C,".m3u8"),keyCacheKey:B?null:"/offline-media/keys/".concat(C,".key"),iv:B?null:(null==j?void 0:j.iv)||null,leaseToken:B?null:(null==j?void 0:j.leaseToken)||null};M&&q.forEach(e=>{void 0!==M[e]&&(U[e]=M[e])}),await this.saveVideoMetadata(U);try{let e;if(B)return await this._downloadVideoNative({metadata:U,course:c,video:h,plannedRow:M,downloadUrl:P,manifestSizeBytes:Number(S.filesize)||0,maxOfflineMs:O,onProgress:p,signal:m});let t=null;if(L&&"caches"in window){let e=await fetch(j.keyUri,{signal:m});if(e.ok){t=await e.arrayBuffer();let r=await caches.open(s);await r.put(U.keyCacheKey,new Response(t,{headers:{"Content-Type":"application/octet-stream"}}))}}let r=await fetch(P,{signal:m});if(!r.ok)throw D("Erreur r\xe9seau lors du t\xe9l\xe9chargement (".concat(r.status,")"),r.status);let n=Number(r.headers.get("content-length"))||0,a=r.headers.get("content-encoding")?0:n,i=Number(S.filesize)||0,o=n||i,l=0,d=!1,f=-1,g=null==(u=r.body)?void 0:u.getReader(),y=[];if(g){for(;;){let{done:e,value:t}=await function(e,t){return new Promise((t,r)=>{let n=setTimeout(()=>{try{e.cancel()}catch(e){}r(Error("STALLED: aucun octet re\xe7u depuis ".concat(Math.round(30),"s")))},3e4);e.read().then(e=>{clearTimeout(n),t(e)},e=>{clearTimeout(n),r(e)})})}(g,3e4);if(e)break;if(y.push(t),l+=t.length,o>0){let e=Math.min(95,Math.round(l/o*100));U.progress=e,e!==f&&(f=e,p&&p(e),this.notifyListeners({type:"progress",videoId:C,progress:e}))}}
11if(a>0){if(d=!0,l!==a)throw Error("INCOMPLETE_TRANSFER: ".concat(l," octets re\xe7us sur ").concat(a," annonc\xe9s"))}else if(i>0){d=!0;let e=Math.floor(.9*i);if(l<e)throw Error("INCOMPLETE_TRANSFER: ".concat(l," octets re\xe7us sur ~").concat(i," attendus"))}}else{let e=await r.blob();y.push(new Uint8Array(await e.arrayBuffer())),l=e.size}let v=await new Blob(y).arrayBuffer();if(L&&t&&U.iv){let r=await _(v,t,U.iv);e=new Blob([r],{type:"application/octet-stream"})}else e=new Blob([v],{type:"video/mp4"});if("caches"in window){let t=await caches.open(s),r=new Headers({"Content-Type":L?"application/octet-stream":"video/mp4","Content-Length":String(e.size),"Accept-Ranges":"bytes"});if(await t.put(U.cacheKey,new Response(e,{headers:r})),L&&S.m3u8){let e=S.m3u8.replace(j.keyUri,U.keyCacheKey).replace(/segment_0\.ts/g,U.cacheKey);await t.put(U.playlistCacheKey,new Response(e,{headers:{"Content-Type":"application/vnd.apple.mpegurl"}}))}}return await this._finalizeCompletedDownload({metadata:U,course:c,video:h,integrityChecked:d,filesize:e.size,maxOfflineMs:O,onProgress:p})}catch(t){if((null==t?void 0:t.name)==="AbortError"||(null==m?void 0:m.aborted))throw this.notifyListeners({type:"aborted",videoId:C}),t;let e=await this.getDownloadedVideo(C).catch(()=>null);if(!e)throw t;throw await this.saveVideoMetadata({...e,status:"error",error:t.message,lastError:t.message}),await this._acknowledgeNativeOutcome(x(e),null==t?void 0:t.nativeOutcomeAt),this.notifyListeners({type:"error",videoId:C,error:t.message}),t}}async _purgeLegacyCacheEntries(e){if(!e||!("caches"in window))return!0;try{let t=await caches.open(s);return e.cacheKey&&await t.delete(e.cacheKey),e.keyCacheKey&&await t.delete(e.keyCacheKey),e.playlistCacheKey&&await t.delete(e.playlistCacheKey),!0}catch(e){return console.warn("[OfflineMediaStorage] Erreur purge des entr\xe9es h\xe9rit\xe9es:",e),!1}}async _nativeAssetState(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,{confirmStable:r=!1,expectation:n="announced"}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=async()=>{if(!e||"function"!=typeof i.hasMedia)return null;try{return await (0,i.hasMedia)(e)}catch(t){return console.warn("[OfflineMediaStorage] Sonde disque de ".concat(e," en \xe9chec:"),t),null}},o=e=>{if(!e)return{state:"unknown",bytes:0};if(!e.exists)return{state:"absent",bytes:0};let r=null==e.bytes?NaN:Number(e.bytes);if(!Number.isFinite(r))return{state:"unknown",bytes:0};let a=Math.max(0,r),i=Number(t)||0;return i>0?a>=i?{state:"complete",bytes:a}:"measured"===n?{state:"partial",bytes:a}:{state:a>=Math.floor(.9*i)?"plausible":"partial",bytes:a}:{state:"unknown",bytes:a}},s=e=>"complete"===e.state||"plausible"===e.state,l=o(await a());if(!r||!s(l))return l;await new Promise(e=>setTimeout(e,250));let u=o(await a());return s(u)&&u.bytes===l.bytes?u:{state:"partial",bytes:u.bytes||l.bytes}}async _downloadVideoNative(e){let{metadata:t,course:r,video:n,plannedRow:a=null,downloadUrl:o,manifestSizeBytes:s,maxOfflineMs:l,onProgress:u,signal:c=null}=e,d=String(t.videoId),h=String(t.nativeAssetId||d);if(null==c?void 0:c.aborted){let e=Error("T\xe9l\xe9chargement annul\xe9");throw e.name="AbortError",e}let f=R(a,h,t.quality),p=f||s,m=await this._nativeAssetState(h,p,{confirmStable:!0,expectation:f>0?"measured":"announced"});if(null==c?void 0:c.aborted){let e=Error("T\xe9l\xe9chargement annul\xe9");throw e.name="AbortError",e}let g=0===f||m.bytes===f;if("complete"===m.state&&g)return console.info("[OfflineMediaStorage] ".concat(d," d\xe9j\xe0 complet sur le disque natif ")+"(".concat(m.bytes," octets, attendus ").concat(p,") : t\xe9l\xe9chargement court-circuit\xe9.")),this._finalizeCompletedDownload({metadata:t,course:r,video:n,integrityChecked:!0,filesize:m.bytes,maxOfflineMs:l,onProgress:u});"complete"===m.state&&console.warn("[OfflineMediaStorage] ".concat(d," : le fichier natif fait ").concat(m.bytes," octets ")+"l\xe0 o\xf9 la derni\xe8re mesure en donnait ".concat(f," â reconstruction."));let y=await new Promise((e,r)=>{let n=!1,a=[],l=null,f=!1,p=null,g=!1,y=0,v=m.bytes||0,w=!1,b=(e,t)=>
11{if(!n){if(n=!0,null!==p&&(clearInterval(p),p=null),a.forEach(e=>{try{"function"==typeof e&&e()}catch(e){}}),a.length=0,l&&c)try{c.removeEventListener("abort",l)}catch(e){}e(t)}},x=-1;a.push((0,i.onProgress)(e=>{if((null==e?void 0:e.id)!==h)return;f=!0,w=!0;let r=Number.isFinite(Number(null==e?void 0:e.percent))?Number(e.percent):null;null!=r&&r!==x&&(x=r,t.progress=r,u&&u(r),this.notifyListeners({type:"progress",videoId:d,progress:r}))}));let E=(t,a)=>{if(n)return;let i=t>0;Promise.resolve().then(()=>this._nativeAssetState(h,i?t:s,{expectation:i?"measured":"announced"})).then(i=>{if(!n){if("unknown"===i.state&&i.bytes<=0){console.warn("[OfflineMediaStorage] Ach\xe8vement de ".concat(d," non v\xe9rifiable sur le disque ")+"natif : \xe9v\xe9nement accept\xe9 sans preuve."),b(e,{bytes:t,diskVerified:!1,at:a});return}return"absent"!==i.state&&(t<=0||i.bytes===t)?void b(e,{bytes:i.bytes||t,diskVerified:"complete"===i.state,at:a}):f?void b(r,Error("COMPLETION_UNVERIFIED: ach\xe8vement annonc\xe9 pour ".concat(d," (").concat(t," ")+"octets) mais le fichier natif est ".concat("absent"===i.state?"absent":"de ".concat(i.bytes," octets")))):void console.warn("[OfflineMediaStorage] \xab downloadComplete \xbb fant\xf4me ignor\xe9 pour ".concat(d," ")+"(annonc\xe9 ".concat(t," octets, disque : ").concat(i.state,"/").concat(i.bytes,") â ")+"\xe9v\xe9nement retenu d'une session pr\xe9c\xe9dente.")}}).catch(e=>{b(r,e instanceof Error?e:Error(String(e)))})};a.push((0,i.onComplete)(e=>{var t;(null==e?void 0:e.id)===h&&E(Number(null==e?void 0:e.bytes)||0,null!=(t=null==e?void 0:e.at)?t:null)})),a.push((0,i.onFailed)(e=>{var t;if((null==e?void 0:e.id)!==h)return;let n=Error((null==e?void 0:e.message)||"T\xe9l\xe9chargement natif \xe9chou\xe9");n.nativeOutcomeAt=null!=(t=null==e?void 0:e.at)?t:null,b(r,n)}));let S=async()=>{if(!n&&!g){g=!0;try{let t=await this._nativeAssetState(h,s,{confirmStable:!0,expectation:"announced"});if(n)return;if("complete"===t.state){console.warn("[OfflineMediaStorage] ".concat(d," : ach\xe8vement CONSTAT\xc9 sur le disque ")+"(".concat(t.bytes," octets) sans \xe9v\xe9nement terminal â transfert d\xe9nou\xe9 par la sonde.")),b(e,{bytes:t.bytes,diskVerified:!0,at:null});return}let a=t.bytes>v;a&&(v=t.bytes);let l=a||w;if(w=!1,l){y=0;return}y+=1,Promise.resolve().then(()=>(0,i.downloadMedia)({id:h,url:o,expectedBytes:s})).catch(()=>{}),y>=10&&b(r,Error("NATIVE_TRANSFER_TIMEOUT: aucun signe de vie de ".concat(d," sur ")+"".concat(y," sondes (disque : ").concat(t.state,"/").concat(t.bytes,")")))}finally{g=!1}}};n||(p=setInterval(()=>{S().catch(e=>{console.warn("[OfflineMediaStorage] Sonde de transfert de ".concat(d," en \xe9chec:"),e)})},9e4)),c&&(l=()=>{Promise.resolve().then(()=>"function"==typeof i.cancelMedia?(0,i.cancelMedia)(h):null).catch(()=>{});let e=Error("T\xe9l\xe9chargement annul\xe9");e.name="AbortError",b(r,e)},c.addEventListener("abort",l,{once:!0})),Promise.resolve().then(()=>(0,i.downloadMedia)({id:h,url:o,expectedBytes:s})).then(e=>{e||b(r,Error("Le stockage natif a refus\xe9 le t\xe9l\xe9chargement"))}).catch(e=>{b(r,e instanceof Error?e:Error(String(e)))})}),v=Number(null==y?void 0:y.bytes)||0,w=!!(null==y?void 0:y.diskVerified);if(s>0&&v>0&&v<Math.floor(.9*s)){let e=await this._nativeAssetState(h,s,{expectation:"announced"});if("partial"===e.state){try{"function"==typeof i.removeMedia&&await (0,i.removeMedia)(h)}catch(e){}throw Error("INCOMPLETE_TRANSFER: ".concat(e.bytes," octets sur le disque pour ~").concat(s," attendus"))}if("absent"===e.state)throw Error("INCOMPLETE_TRANSFER: aucun fichier natif pour ".concat(h," malgr\xe9 un \xe9v\xe9nement de fin"));"complete"===e.state&&(w=!0)}let b=await this._finalizeCompletedDownload({metadata:t,course:r,video:n,integrityChecked:w,filesize:v||Number(t.filesize)||0,maxOfflineMs:l,onProgress:u});return await this._acknowledgeNativeOutcome(h,null==y?void 0:y.at),b}async _acknowledgeNativeOutcome(e,t){let r=Number(t);if(!e||!Number.isFinite(r)||r<=0||"function"!=typeof i.consumeOutcome)return!1;try{return await (0,i.consumeOutcome)(e,{at:r})}
11catch(t){return console.warn("[OfflineMediaStorage] Accus\xe9 de r\xe9ception de l'issue ".concat(e," en \xe9chec:"),t),!1}}async _finalizeCompletedDownload(e){let{metadata:t,course:r,video:a,integrityChecked:i,filesize:o,maxOfflineMs:s,onProgress:l}=e,u=(null==r?void 0:r.url)||(null==r?void 0:r.slug)||(null==a?void 0:a.courseSlug)||t.courseSlug,c=(null==r?void 0:r.image)||(null==r?void 0:r.imageCatalogue)||(null==a?void 0:a.courseCover);try{await (0,n.cacheOfflineAppAndPages)({courseSlug:u,courseCover:c})}catch(e){console.warn("[OfflineMediaStorage] Avertissement mise en cache hors-ligne des pages:",e)}let d=Date.now();return t.status="completed",t.progress=100,t.integrityChecked=!!i,t.filesize=Number(o)||Number(t.filesize)||0,t.downloadedAt=d,t.lastVerifiedAt=d,t.expiresAt=d+s,await this.saveVideoMetadata(t),l&&l(100),this.notifyListeners({type:"completed",videoId:t.videoId,item:t}),t}async syncNativeOutcomes(){let{force:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.nativeOutcomeInflight)return this.nativeOutcomeInflight;if(!e&&this.nativeOutcomeDrain&&Date.now()-this.nativeOutcomeDrainedAt<3e4)return this.nativeOutcomeDrain;let t=this._drainNativeOutcomes().catch(e=>(console.warn("[OfflineMediaStorage] Drainage du journal des issues natives en \xe9chec:",e),{status:"error",total:0,applied:0,acknowledged:0,skipped:0})).then(e=>(this.nativeOutcomeDrainedAt=Date.now(),this.nativeOutcomeInflight=null,e));return this.nativeOutcomeInflight=t,this.nativeOutcomeDrain=t,this._bindNativeOutcomeWake(),t}_bindNativeOutcomeWake(){if(!this.nativeOutcomeWakeBound&&"undefined"!=typeof document&&"function"==typeof document.addEventListener){this.nativeOutcomeWakeBound=!0;try{document.addEventListener("visibilitychange",()=>{"visible"===document.visibilityState&&this.syncNativeOutcomes().catch(()=>{})})}catch(e){this.nativeOutcomeWakeBound=!1}}}async _drainNativeOutcomes(){let e={status:"unavailable",total:0,applied:0,acknowledged:0,skipped:0};if("function"!=typeof i.pendingOutcomes||"function"!=typeof i.consumeOutcome||"function"==typeof i.isOutcomeJournalAvailable&&!(0,i.isOutcomeJournalAvailable)())return{...e,status:"unsupported"};let t=await (0,i.pendingOutcomes)();if(null===t)return e;if(0===t.length)return{status:"drained",total:0,applied:0,acknowledged:0,skipped:0};let r=await this.readAllDownloadedVideosOrNull();if(null===r)return console.warn("[OfflineMediaStorage] Journal natif non drain\xe9 : manifeste illisible "+"(".concat(t.length," issue(s) conserv\xe9e(s)).")),{...e,status:"manifest-unreadable",total:t.length};let n=new Map;r.forEach(e=>{let t=x(e);t&&n.set(t,e)});let a=0,o=0,s=0;for(let e of t){let t=!1;try{t=await this._applyNativeOutcome(e,n.get(e.id)||null)}catch(r){console.warn("[OfflineMediaStorage] Issue native de ".concat(e.id," non appliqu\xe9e:"),r),t=!1}if(!t){s+=1;continue}a+=1,await this._acknowledgeNativeOutcome(e.id,e.at)&&(o+=1)}return(a>0||s>0)&&console.info("[OfflineMediaStorage] Journal natif drain\xe9 : ".concat(t.length," issue(s), ")+"".concat(a," appliqu\xe9e(s), ").concat(o," acquitt\xe9e(s), ").concat(s," conserv\xe9e(s).")),{status:"drained",total:t.length,applied:a,acknowledged:o,skipped:s}}async _applyNativeOutcome(e,t){if(!t)return console.warn("[OfflineMediaStorage] Issue native orpheline pour ".concat(e.id," ")+"(aucune ligne de manifeste) : conserv\xe9e."),!1;let r=R(t,e.id,t.quality)||"complete"===e.kind&&Number(e.bytes)||0,n=r||Number(t.filesize)||0,a=await this._nativeAssetState(e.id,n,{confirmStable:!0,expectation:r>0?"measured":"announced"});if("complete"===e.kind)return"complete"===a.state&&(e.bytes<=0||a.bytes===e.bytes)?"completed"===t.status&&!0===t.integrityChecked&&Number(t.filesize)===a.bytes||(console.info("[OfflineMediaStorage] ".concat(t.videoId," : ach\xe8vement rattrap\xe9 par le journal natif ")+"(".concat(a.bytes," octets) â la le\xe7on \xe9tait rest\xe9e \xab ").concat(t.status," \xbb.")),await this._finalizeCompletedDownload({metadata:t,course:null,video:t,integrityChecked:!0,filesize:a.bytes,maxOfflineMs:24*(Number(null==t?void 0:t.offlineSecurityDays)||30)*36e5}
11),!0):(console.warn("[OfflineMediaStorage] Ach\xe8vement journalis\xe9 de ".concat(t.videoId," non confirm\xe9 par le ")+"disque (annonc\xe9 ".concat(e.bytes,", disque ").concat(a.state,"/").concat(a.bytes,") : conserv\xe9.")),!1);return"complete"===a.state||"plausible"===a.state?(console.warn("[OfflineMediaStorage] \xc9chec journalis\xe9 de ".concat(t.videoId," contredit par le disque ")+"(".concat(a.bytes," octets pr\xe9sents, attendus ").concat(n,") : conserv\xe9 sans effet.")),!1):"completed"===t.status||"error"===t.status&&t.lastError===e.message||(await this.saveVideoMetadata({...t,status:"error",progress:0,integrityChecked:!1,error:e.message||"NATIVE_TRANSFER_FAILED",lastError:e.message||"NATIVE_TRANSFER_FAILED"}),console.info("[OfflineMediaStorage] ".concat(t.videoId," : \xe9chec rattrap\xe9 par le journal natif ")+"(".concat(e.message||"sans message",").")),!0)}checkOfflineValidity(e){if(!e||"completed"!==e.status)return{isValid:!1,remainingDays:0,isExpired:!1,isClockTampered:!1,reason:"NOT_COMPLETED"};let t=Date.now(),r=e.lastVerifiedAt||e.downloadedAt||t,n=e.offlineSecurityDays||30,a=e.expiresAt||r+24*n*36e5;if(t<r-6e4)return{isValid:!1,remainingDays:0,isExpired:!0,isClockTampered:!0,expiresAt:a,lastVerifiedAt:r,reason:"CLOCK_TAMPERED"};let i=t>a;return{isValid:!i,remainingDays:Math.ceil(Math.max(0,a-t)/864e5),isExpired:i,isClockTampered:!1,expiresAt:a,lastVerifiedAt:r}}async renewOfflineValidity(e){let{silent:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=await this.getDownloadedVideo(e);if(!r)return null;let n=Date.now(),a=r.offlineSecurityDays||30;return r.lastVerifiedAt=n,r.expiresAt=n+24*a*36e5,await this.saveVideoMetadata(r,{silent:t}),r}async refreshAllOfflineEntitlements(){let{courseId:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("undefined"!=typeof navigator&&!1===navigator.onLine)return 0;let t=(await this.getAllDownloadedVideos()).filter(t=>"completed"===t.status&&(!e||String(t.courseId)===String(e)));if(0===t.length)return 0;let r=Date.now(),n=0;for(let e of t){let t=e.offlineSecurityDays||30;e.lastVerifiedAt=r,e.expiresAt=r+24*t*36e5,await this.saveVideoMetadata(e,{silent:!0}),n++}try{await this.syncManifestToLocalDisk()}catch(e){console.warn("[OfflineMediaStorage] Erreur syncManifest apr\xe8s renouvellement:",e)}return this.notifyListeners({type:"renew",courseId:e||null,count:n}),n}async getVideoBlob(e){let t=await this.getDownloadedVideo(e);if(!t||"completed"!==t.status||b(t)||!t.cacheKey||!("caches"in window))return null;try{let e=await caches.open(s),r=await e.match(t.cacheKey);if(!r)return null;let n=await r.blob();if("hls_aes128"===t.streamType&&t.keyCacheKey&&t.iv){let r=await e.match(t.keyCacheKey);if(r){let e=await r.arrayBuffer(),a=await n.arrayBuffer(),i=await O(a,e,t.iv);return new Blob([i],{type:"video/mp4"})}}return n}catch(e){return console.error("[OfflineMediaStorage] Erreur lecture cache video:",e),null}}async getVideoPlaybackUrl(e){let t=await this.getDownloadedVideo(e);if(!t)return{url:null,nativeId:null,metadata:null,validity:{isValid:!1},error:"VIDEO_NOT_FOUND"};if("completed"!==t.status)return{url:null,nativeId:null,metadata:t,validity:{isValid:!1},error:"downloading"===t.status?"DOWNLOADING":"NOT_COMPLETED"};let r=this.checkOfflineValidity(t);if(!r.isValid)return{url:null,nativeId:null,metadata:t,validity:r,error:r.isClockTampered?"CLOCK_TAMPERED":"EXPIRED_30_DAYS"};let n=x(t);if(n){if(!S())return{url:null,nativeId:null,metadata:t,validity:r,error:"NATIVE_UNAVAILABLE"};let e=null;try{e="function"==typeof i.hasMedia?await (0,i.hasMedia)(n):null}catch(t){e=null}if(!(null==e?void 0:e.exists))return{url:null,nativeId:null,metadata:t,validity:r,error:"NATIVE_FILE_MISSING"};let a=!0===t.integrityChecked&&Number(t.filesize)||0,o=null==e.bytes?NaN:Number(e.bytes);if(a>0&&Number.isFinite(o)&&o<a){console.warn("[OfflineMediaStorage] ".concat(t.videoId," : le fichier natif est tomb\xe9 \xe0 ")+"".concat(o," octets pour ").concat(a," v\xe9rifi\xe9s â le\xe7on \xe0 reconstruire."));try{await this.saveVideoMetadata({...t,status:"error",integrityChecked:!1,filesize:o,error:"NATIVE_FILE_TRUNCATED",lastError:"NATIVE_FILE_TRUNCATED"})}catch(e){console.warn("[OfflineMediaStorage] Ligne tronqu\xe9e non r\xe9\xe9crite:",e)}return{url:null,nativeId:null,metadata:t,validity:r,error:"NATIVE_FILE_MISSING"}}return{url:null,nativeId:n,isHls:!1,metadata:t,validity:r}}let a=await this.getVideoBlob(e);return a?{url:URL.createObjectURL(a),nativeId:null,isHls:"hls_aes128"===t.streamType,metadata:t,validity:r}:{url:null,nativeId:null,metadata:t,validity:r,error:"BLOB_NOT_FOUND"}}revokePlaybackUrl(e){if(e&&"string"==typeof e&&e.startsWith("blob:"))try{var t;(null==(t=window.URL)?void 0:t.revokeObjectURL)?window.URL.revokeObjectURL(e):"undefined"!=typeof URL&&URL.revokeObjectURL&&URL.revokeObjectURL(e)}catch(e){}}
11async downloadChapter(e){let{course:t,chapter:r,quality:n=null,onProgress:a}=e;if(!r)throw Error("Chapitre manquant");let i=this.resolveEffectiveQuality(n),o=e=>{let t=[];return(e.videoId||e.mediaId||e._id&&!e.children)&&t.push(e),Array.isArray(e.videos)&&t.push(...e.videos),Array.isArray(e.children)&&e.children.forEach(e=>t.push(...o(e))),t},s=o(r);if(!s.length)throw Error("Aucune vid\xe9o trouv\xe9e dans ce chapitre");let l=0,u=s.length;for(let e of s)try{await this.downloadVideo({course:t,chapter:r,video:e,quality:i,onProgress:e=>{if(a){let t=Math.round((l+e/100)/u*100);a(t)}}}),l++}catch(t){console.error("[OfflineMediaStorage] Erreur t\xe9l\xe9chargement vid\xe9o ".concat(e.title,":"),t)}return l}async downloadCourse(e){let{course:t,quality:r=null,onProgress:n}=e,a=(null==t?void 0:t._id)||(null==t?void 0:t.url);if(!a)throw Error("Identifiant de formation manquant");let i=this.resolveEffectiveQuality(r),o=await fetch("/api/courses/".concat(a,"/offline-links?quality=").concat(i));if(!o.ok)throw Error((await o.json().catch(()=>({}))).error||"Impossible de r\xe9cup\xe9rer les liens du cours");let s=(await o.json()).videos||[];if(!s.length)throw Error("Aucune vid\xe9o disponible pour le t\xe9l\xe9chargement");let l=0,u=s.length;for(let e of s)try{let a=((null==t?void 0:t.chapters)||[]).find(t=>String(t._id)===String(e.chapterId))||{_id:e.chapterId,title:"Chapitre"};await this.downloadVideo({course:t,chapter:a,video:e,quality:r,onProgress:e=>{if(n){let t=Math.round((l+e/100)/u*100);n(t)}}}),l++}catch(t){console.error("[OfflineMediaStorage] Erreur cours vid\xe9o ".concat(e.title,":"),t)}return l}async deleteDownloadedVideo(e){let{silent:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return;let r=await this.getDownloadedVideo(e);if(!r)return;let n=x(r);if(n){let e=!1;try{e="function"==typeof i.removeMedia&&await (0,i.removeMedia)(n)}catch(t){console.warn("[OfflineMediaStorage] Erreur suppression du fichier natif:",t),e=!1}if(!e){let e=!0;if(S())try{let t="function"==typeof i.hasMedia?await (0,i.hasMedia)(n):null;e=!!(null==t?void 0:t.exists)}catch(t){e=!0}if(e)throw Error(S()?"Le fichier local nâa pas pu \xeatre effac\xe9 de cet appareil.":"Cette le\xe7on a \xe9t\xe9 enregistr\xe9e par une version plus r\xe9cente de lâapplication : mets-la \xe0 jour pour pouvoir la supprimer.")}}if("caches"in window)try{let e=await caches.open(s);r.cacheKey&&await e.delete(r.cacheKey),r.keyCacheKey&&await e.delete(r.keyCacheKey),r.playlistCacheKey&&await e.delete(r.playlistCacheKey)}catch(e){throw console.warn("[OfflineMediaStorage] Erreur suppression cache:",e),Error("Les fichiers locaux nâont pas pu \xeatre effac\xe9s de cet appareil.")}let a=await this.getDB();if(a&&await new Promise((t,r)=>{let n=a.transaction([o],"readwrite").objectStore(o).delete(String(e));n.onsuccess=()=>t(),n.onerror=e=>r(e.target.error)}),!t){this.notifyListeners({type:"delete",videoId:e});try{await this.syncManifestToLocalDisk()}catch(e){console.warn("[OfflineMediaStorage] Erreur syncManifest apr\xe8s deleteDownloadedVideo:",e)}}}async deleteDownloadedVideos(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=Array.isArray(e)?e.filter(Boolean):[];if(0===t.length)return 0;let r=0;for(let e of t)try{await this.deleteDownloadedVideo(e,{silent:!0}),r++}catch(e){console.warn("[OfflineMediaStorage] Erreur suppression en lot:",e)}try{await this.syncManifestToLocalDisk()}catch(e){console.warn("[OfflineMediaStorage] Erreur syncManifest apr\xe8s deleteDownloadedVideos:",e)}return this.notifyListeners({type:"delete",videoIds:t}),r}async deleteDownloadedChapter(e,t){if(e){for(let r of(await this.getAllDownloadedVideos()).filter(r=>String(r.chapterId)===String(e)&&(!t||String(r.courseId)===String(t))))try{await this.deleteDownloadedVideo(r.videoId,{silent:!0})}catch(e){console.warn("[OfflineMediaStorage] Erreur suppression chapitre (le\xe7on ignor\xe9e):",e)}try{await this.syncManifestToLocalDisk()}catch(e){console.warn("[OfflineMediaStorage] Erreur syncManifest apr\xe8s deleteDownloadedChapter:",e)}this.notifyListeners({type:"delete",chapterId:e,courseId:t||null})}}async deleteDownloadedCourse(e){if(e){for(let t of(await this.getAllDownloadedVideos()).filter(t=>String(t.courseId)===String(e)))try{await this.deleteDownloadedVideo(t.videoId,{silent:!0})}catch(e){console.warn("[OfflineMediaStorage] Erreur suppression formation (le\xe7on ignor\xe9e):",e)}try{await this.syncManifestToLocalDisk()}catch(e){console.warn("[OfflineMediaStorage] Erreur syncManifest apr\xe8s deleteDownloadedCourse:",e)}this.notifyListeners({type:"delete",courseId:e})}}async getStorageStats(){let e=await this.getAllDownloadedVideos(),t=e.filter(e=>"completed"===e.status),r=t.reduce((e,t)=>
11e+(Number(t.filesize)||0),0),n=await this.measureUsableCapacity(r),a=await this.inspectLegacyMediaMigration(e);return{emparaBytes:r,emparaMB:Math.round(r/1048576*10)/10,emparaGB:Math.round(r/0x40000000*100)/100,totalVideosCount:t.length,...n,legacyMigration:a}}async measureUsableCapacity(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=Number(e)||0,r=await I(),n="proven"===r.state?r.capacity:null;if(n){let e=Number(n.safeUsableBytes);if(Number.isFinite(e)&&e>=0){let r=Number(n.usedByAppBytes),a=Number(n.totalBytes),i=Number(n.freeBytes);return{capacitySource:"native",isEstimateReliable:!0,totalDeviceGB:T(t+e),freeDeviceGB:T(e),safeUsableBytes:e,deviceTotalBytes:Number.isFinite(a)?a:null,deviceFreeBytes:Number.isFinite(i)?i:null,nativeUsedByAppBytes:Number.isFinite(r)?r:null}}}if(S()&&!await this.hasLegacyMediaCache())return{...A};if("undefined"!=typeof navigator&&navigator.storage&&navigator.storage.estimate)try{let e=await navigator.storage.estimate(),r=Number(null==e?void 0:e.quota);if(Number.isFinite(r)&&r>0){let n=Number(null==e?void 0:e.usage),a=Number.isFinite(n)?n:t,i=Math.max(0,r-a);return{capacitySource:"web-estimate",isEstimateReliable:!0,totalDeviceGB:T(r),freeDeviceGB:T(i),safeUsableBytes:i,deviceTotalBytes:r,deviceFreeBytes:i,nativeUsedByAppBytes:null}}}catch(e){}return{...A}}async hasLegacyMediaCache(){if(!0===this.legacyCacheKnownAbsent)return!1;let e=E();if(!e)return this.legacyCacheKnownAbsent=!0,!1;try{let t=await e.has(s);return t||(this.legacyCacheKnownAbsent=!0),t}catch(e){return!1}}getLegacyMigrationRecord(){if(!window.localStorage)return null;try{let e=localStorage.getItem(y);if(!e)return null;let t=JSON.parse(e);return t&&Number.isFinite(Number(t.version))?t:null}catch(e){return null}}async inspectLegacyMediaMigration(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=this.getLegacyMigrationRecord(),r={needed:!1,version:v,videoCount:0,bytes:0,courseCount:0,hasLegacyCache:!1,completedAt:(null==t?void 0:t.completedAt)||null,blockedReason:null};if("proven"!==(await I()).state)return{...r,blockedReason:"NATIVE_NOT_PROVEN"};let n=e;if(!Array.isArray(n)&&null===(n=await this.readAllDownloadedVideosOrNull()))return console.warn("[OfflineMediaStorage] \xc9tat des lieux de migration impossible : les lignes de t\xe9l\xe9chargement ne sont pas lisibles."),{...r,blockedReason:"LEGACY_ROWS_UNREADABLE"};let a=n.filter(w),i=new Set(a.map(e=>String(e.courseId||"unknown_course"))),o=a.reduce((e,t)=>e+(Number(t.filesize)||0),0),s=!1;return s=a.length>0||await this.hasLegacyMediaCache(),{...r,needed:a.length>0||s,videoCount:a.length,bytes:o,courseCount:i.size,hasLegacyCache:s}}async runLegacyMediaMigration(){let{acknowledged:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=await this.inspectLegacyMediaMigration();if(t.blockedReason)return console.warn("[OfflineMediaStorage] Migration refus\xe9e : \xe9tat des lieux bloqu\xe9 (".concat(t.blockedReason,").")),{migrated:!1,reason:t.blockedReason,removedVideos:0,removedBytes:0,inspection:t};if(!t.needed)return{migrated:!1,reason:"NOTHING_TO_MIGRATE",removedVideos:0,removedBytes:0,inspection:t};if(!e)return console.warn("[OfflineMediaStorage] Migration refus\xe9e : consentement utilisateur absent."),{migrated:!1,reason:"NOT_ACKNOWLEDGED",removedVideos:0,removedBytes:0,inspection:t};if("proven"!==(await I({force:!0})).state)return console.warn("[OfflineMediaStorage] Migration refus\xe9e : magasin natif non prouv\xe9."),{migrated:!1,reason:"NATIVE_NOT_PROVEN",removedVideos:0,removedBytes:0,inspection:t};let r=null;try{r="function"==typeof i.selftest?await (0,i.selftest)():null}catch(e){console.warn("[OfflineMediaStorage] Auto-test du magasin natif impossible:",e),r=null}if(!(null==r?void 0:r.ok))return console.warn("[OfflineMediaStorage] Migration refus\xe9e : auto-test du magasin natif en \xe9chec.",r),{migrated:!1,reason:"NATIVE_SELFTEST_FAILED",removedVideos:0,removedBytes:0,inspection:t};let n=await this.readAllDownloadedVideosOrNull();if(null===n)return console.warn("[OfflineMediaStorage] Migration refus\xe9e : les lignes de t\xe9l\xe9chargement ne sont pas lisibles, impossible de savoir ce qui serait d\xe9truit."),{migrated:!1,reason:"LEGACY_ROWS_UNREADABLE",removedVideos:0,removedBytes:0,inspection:t};let a=n.filter(w),o=a.reduce((e,t)=>
11e+(Number(t.filesize)||0),0),l=0;a.length>0&&(l=await this.deleteDownloadedVideos(a.map(e=>e.videoId)));let u=E();if(u)try{await u.delete(s),this.legacyCacheKnownAbsent=!0}catch(e){return console.error("[OfflineMediaStorage] \xc9chec purge du cache vid\xe9o h\xe9rit\xe9:",e),{migrated:!1,reason:"CACHE_PURGE_FAILED",removedVideos:l,removedBytes:o,inspection:t}}try{await this.syncManifestToLocalDisk()}catch(e){console.warn("[OfflineMediaStorage] Erreur syncManifest apr\xe8s migration:",e)}if(window.localStorage)try{localStorage.setItem(y,JSON.stringify({version:v,completedAt:Date.now(),removedVideos:l,removedBytes:o}))}catch(e){console.warn("[OfflineMediaStorage] Marqueur de migration non persist\xe9:",e)}return this.notifyListeners({type:"legacy_media_migrated",removedVideos:l,removedBytes:o}),{migrated:!0,removedVideos:l,removedBytes:o,inspection:t}}constructor(){this.db=null,this.dbPromise=null,this.listeners=new Set,this.legacyCacheKnownAbsent=void 0,this.manifestDiagnostics={lastWriteAt:null,lastWriteOk:null,lastManifestChars:0,lastStatsChars:0,writeFailures:0,lastError:null},this.nativeOutcomeDrain=null,this.nativeOutcomeInflight=null,this.nativeOutcomeDrainedAt=0,this.nativeOutcomeWakeBound=!1}}let M=new L},57776:(e,t,r)=>{"use strict";r.d(t,{G_:()=>i,mg:()=>o});var n=r(14232);let a=(0,n.createContext)(null);function i({clientId:e,nonce:t,onScriptLoadSuccess:r,onScriptLoadError:i,children:o}){let s=function(e={}){let{nonce:t,onScriptLoadSuccess:r,onScriptLoadError:a}=e,[i,o]=(0,n.useState)(!1),s=(0,n.useRef)(r);s.current=r;let l=(0,n.useRef)(a);return l.current=a,(0,n.useEffect)(()=>{let e=document.createElement("script");return e.src="https://accounts.google.com/gsi/client",e.async=!0,e.defer=!0,e.nonce=t,e.onload=()=>{var e;o(!0),null==(e=s.current)||e.call(s)},e.onerror=()=>{var e;o(!1),null==(e=l.current)||e.call(l)},document.body.appendChild(e),()=>{document.body.removeChild(e)}},[t]),i}({nonce:t,onScriptLoadSuccess:r,onScriptLoadError:i}),l=(0,n.useMemo)(()=>({clientId:e,scriptLoadedSuccessfully:s}),[e,s]);return n.createElement(a.Provider,{value:l},o)}function o({flow:e="implicit",scope:t="",onSuccess:r,onError:i,onNonOAuthError:o,overrideScope:s,state:l,...u}){let{clientId:c,scriptLoadedSuccessfully:d}=function(){let e=(0,n.useContext)(a);if(!e)throw Error("Google OAuth components must be used within GoogleOAuthProvider");return e}(),h=(0,n.useRef)(),f=(0,n.useRef)(r);f.current=r;let p=(0,n.useRef)(i);p.current=i;let m=(0,n.useRef)(o);m.current=o,(0,n.useEffect)(()=>{var r,n;if(!d)return;let a="implicit"===e?"initTokenClient":"initCodeClient";h.current=null==(n=null==(r=null==window?void 0:window.google)?void 0:r.accounts)?void 0:n.oauth2[a]({client_id:c,scope:s?t:`openid profile email ${t}`,callback:e=>{var t,r;if(e.error)return null==(t=p.current)?void 0:t.call(p,e);null==(r=f.current)||r.call(f,e)},error_callback:e=>{var t;null==(t=m.current)||t.call(m,e)},state:l,...u})},[c,d,e,t,l]);let g=(0,n.useCallback)(e=>{var t;return null==(t=h.current)?void 0:t.requestAccessToken(e)},[]),y=(0,n.useCallback)(()=>{var e;return null==(e=h.current)?void 0:e.requestCode()},[]);return"implicit"===e?g:y}},58162:(e,t,r)=>{"use strict";r.d(t,{i:()=>s});var n,a=r(14232),i=r(81285),o=(n||(n=r.t(a,2)))[" useInsertionEffect ".trim().toString()]||i.N;function s({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){let[i,s,l]=function({defaultProp:e,onChange:t}){let[r,n]=a.useState(e),i=a.useRef(r),s=a.useRef(t);return o(()=>{s.current=t},[t]),a.useEffect(()=>{i.current!==r&&(s.current?.(r),i.current=r)},[r,i]),[r,n,s]}({defaultProp:t,onChange:r}),u=void 0!==e,c=u?e:i;{let t=a.useRef(void 0!==e);a.useEffect(()=>{let e=t.current;if(e!==u){let t=u?"controlled":"uncontrolled";console.warn(`${n} is changing from ${e?"controlled":"uncontrolled"} to ${t}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=u},[u,n])}return[c,a.useCallback(t=>{if(u){let r="function"==typeof t?t(e):t;r!==e&&l.current?.(r)}else s(t)},[u,e,s,l])]}Symbol("RADIX:SYNC_STATE")},58444:(e,t,r)=>{"use strict";r.d(t,{X:()=>s,k:()=>l});
11var n=r(37149),a=r(60388),i=r(48149),o=r(46305),s=class extends o.k{#I;#T;#A;#m;#y;#o;#_;constructor(e){super(),this.#_=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#m=e.client,this.#A=this.#m.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#I=u(this.options),this.state=e.state??this.#I,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#y?.promise}setOptions(e){if(this.options={...this.#o,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let e=u(this.options);void 0!==e.data&&(this.setData(e.data,{updatedAt:e.dataUpdatedAt,manual:!0}),this.#I=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#A.remove(this)}setData(e,t){let r=(0,n.pl)(this.state.data,e,this.options);return this.#v({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e,t){this.#v({type:"setState",state:e,setStateOptions:t})}cancel(e){let t=this.#y?.promise;return this.#y?.cancel(e),t?t.then(n.lQ).catch(n.lQ):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#I)}isActive(){return this.observers.some(e=>!1!==(0,n.Eh)(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===n.hT||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===(0,n.d2)(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!(0,n.j3)(this.state.dataUpdatedAt,e))}onFocus(){let e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#y?.continue()}onOnline(){let e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#y?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#A.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#y&&(this.#_?this.#y.cancel({revert:!0}):this.#y.cancelRetry()),this.scheduleGc()),this.#A.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#v({type:"invalidate"})}async fetch(e,t){if("idle"!==this.state.fetchStatus&&this.#y?.status()!=="rejected"){if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#y)return this.#y.continueRetry(),this.#y.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let r=new AbortController,a=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#_=!0,r.signal)})},o=()=>{let e=(0,n.ZM)(this.options,t),r=(()=>{let e={client:this.#m,queryKey:this.queryKey,meta:this.meta};return a(e),e})();return(this.#_=!1,this.options.persister)?this.options.persister(e,r,this):e(r)},s=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#m,state:this.state,fetchFn:o};return a(e),e})();this.options.behavior?.onFetch(s,this),this.#T=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==s.fetchOptions?.meta)&&this.#v({type:"fetch",meta:s.fetchOptions?.meta}),this.#y=(0,i.II)({initialPromise:t?.initialPromise,fn:s.fetchFn,onCancel:e=>{e instanceof i.cc&&e.revert&&this.setState({...this.#T,fetchStatus:"idle"}),r.abort()},onFail:(e,t)=>{this.#v({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#v({type:"pause"})},onContinue:()=>{this.#v({type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0});try{let e=await this.#y.start();if(void 0===e)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#A.config.onSuccess?.(e,this),this.#A.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof i.cc){if(e.silent)return this.#y.promise;else if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw this.#v({type:"error",error:e}),this.#A.config.onError?.(e,this),this.#A.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#v(e){let t=t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...l(t.data,this.options),fetchMeta:e.meta??null};case"success":let r={...t,data:e.data,dataUpdateCount:t.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#T=e.manual?r:void 0,r;case"error":let n=e.error;
11return{...t,error:n,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error"};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}};this.state=t(this.state),a.jG.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#A.notify({query:this,type:"updated",action:e})})}};function l(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:(0,i.v_)(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function u(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,n=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}},58725:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(17963).A)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},59688:(e,t,r)=>{"use strict";r.d(t,{l$:()=>x,oR:()=>g});var n=r(14232),a=r(98477);let i=Array(12).fill(0),o=({visible:e,className:t})=>n.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},n.createElement("div",{className:"sonner-spinner"},i.map((e,t)=>n.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${t}`})))),s=n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},n.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),l=n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},n.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),u=n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},n.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),c=n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},n.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),d=n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),h=1;class f{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:r,...n}=e,a="number"==typeof(null==e?void 0:e.id)||(null==(t=e.id)?void 0:t.length)>0?e.id:h++,i=this.toasts.find(e=>e.id===a),o=void 0===e.dismissible||e.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),i?this.toasts=this.toasts.map(t=>t.id===a?(this.publish({...t,...e,id:a,title:r}),{...t,...e,id:a,dismissible:o,title:r}):t):this.addToast({title:r,...n,dismissible:o,id:a}),a},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>
11this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{let r,a;if(!t)return;void 0!==t.loading&&(a=this.create({...t,promise:e,type:"loading",message:t.loading,description:"function"!=typeof t.description?t.description:void 0}));let i=Promise.resolve(e instanceof Function?e():e),o=void 0!==a,s=i.then(async e=>{if(r=["resolve",e],n.isValidElement(e))o=!1,this.create({id:a,type:"default",message:e});else if(m(e)&&!e.ok){o=!1;let r="function"==typeof t.error?await t.error(`HTTP error! status: ${e.status}`):t.error,i="function"==typeof t.description?await t.description(`HTTP error! status: ${e.status}`):t.description,s="object"!=typeof r||n.isValidElement(r)?{message:r}:r;this.create({id:a,type:"error",description:i,...s})}else if(e instanceof Error){o=!1;let r="function"==typeof t.error?await t.error(e):t.error,i="function"==typeof t.description?await t.description(e):t.description,s="object"!=typeof r||n.isValidElement(r)?{message:r}:r;this.create({id:a,type:"error",description:i,...s})}else if(void 0!==t.success){o=!1;let r="function"==typeof t.success?await t.success(e):t.success,i="function"==typeof t.description?await t.description(e):t.description,s="object"!=typeof r||n.isValidElement(r)?{message:r}:r;this.create({id:a,type:"success",description:i,...s})}}).catch(async e=>{if(r=["reject",e],void 0!==t.error){o=!1;let r="function"==typeof t.error?await t.error(e):t.error,i="function"==typeof t.description?await t.description(e):t.description,s="object"!=typeof r||n.isValidElement(r)?{message:r}:r;this.create({id:a,type:"error",description:i,...s})}}).finally(()=>{o&&(this.dismiss(a),a=void 0),null==t.finally||t.finally.call(t)}),l=()=>new Promise((e,t)=>s.then(()=>"reject"===r[0]?t(r[1]):e(r[1])).catch(t));return"string"!=typeof a&&"number"!=typeof a?{unwrap:l}:Object.assign(a,{unwrap:l})},this.custom=(e,t)=>{let r=(null==t?void 0:t.id)||h++;return this.create({jsx:e(r),id:r,...t}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}let p=new f,m=e=>e&&"object"==typeof e&&"ok"in e&&"boolean"==typeof e.ok&&"status"in e&&"number"==typeof e.status,g=Object.assign((e,t)=>{let r=(null==t?void 0:t.id)||h++;return p.addToast({title:e,...t,id:r}),r},{success:p.success,info:p.info,warning:p.warning,error:p.error,custom:p.custom,message:p.message,promise:p.promise,dismiss:p.dismiss,loading:p.loading},{getHistory:()=>p.toasts,getToasts:()=>p.getActiveToasts()});function y(e){return void 0!==e.label}function v(...e){return e.filter(Boolean).join(" ")}!function(e){if(!e||"undefined"==typeof document)return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}
vendor: 14,864 bytes, line 11
11("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");
11let w=e=>{var t,r,a,i,h,f,p,m,g,w,b;let{invert:x,toast:E,unstyled:S,interacting:k,setHeights:P,visibleToasts:C,heights:I,index:T,toasts:A,expanded:_,removeToast:O,defaultRichColors:q,closeButton:R,style:D,cancelButtonStyle:N,actionButtonStyle:j,className:L="",descriptionClassName:M="",duration:B,position:U,gap:F,expandByDefault:z,classNames:V,icons:W,closeButtonAriaLabel:H="Close toast"}=e,[G,Q]=n.useState(null),[K,$]=n.useState(null),[Y,J]=n.useState(!1),[X,Z]=n.useState(!1),[ee,et]=n.useState(!1),[er,en]=n.useState(!1),[ea,ei]=n.useState(!1),[eo,es]=n.useState(0),[el,eu]=n.useState(0),ec=n.useRef(E.duration||B||4e3),ed=n.useRef(null),eh=n.useRef(null),ef=0===T,ep=T+1<=C,em=E.type,eg=!1!==E.dismissible,ey=E.className||"",ev=E.descriptionClassName||"",ew=n.useMemo(()=>I.findIndex(e=>e.toastId===E.id)||0,[I,E.id]),eb=n.useMemo(()=>{var e;return null!=(e=E.closeButton)?e:R},[E.closeButton,R]),ex=n.useMemo(()=>E.duration||B||4e3,[E.duration,B]),eE=n.useRef(0),eS=n.useRef(0),ek=n.useRef(0),eP=n.useRef(null),[eC,eI]=U.split("-"),eT=n.useMemo(()=>I.reduce((e,t,r)=>r>=ew?e:e+t.height,0),[I,ew]),eA=(()=>{let[e,t]=n.useState(document.hidden);return n.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",e),()=>window.removeEventListener("visibilitychange",e)},[]),e})(),e_=E.invert||x,eO="loading"===em;eS.current=n.useMemo(()=>ew*F+eT,[ew,eT]),n.useEffect(()=>{ec.current=ex},[ex]),n.useEffect(()=>{J(!0)},[]),n.useEffect(()=>{let e=eh.current;if(e){let t=e.getBoundingClientRect().height;return eu(t),P(e=>[{toastId:E.id,height:t,position:E.position},...e]),()=>P(e=>e.filter(e=>e.toastId!==E.id))}},[P,E.id]),n.useLayoutEffect(()=>{if(!Y)return;let e=eh.current,t=e.style.height;e.style.height="auto";let r=e.getBoundingClientRect().height;e.style.height=t,eu(r),P(e=>e.find(e=>e.toastId===E.id)?e.map(e=>e.toastId===E.id?{...e,height:r}:e):[{toastId:E.id,height:r,position:E.position},...e])},[Y,E.title,E.description,P,E.id,E.jsx,E.action,E.cancel]);let eq=n.useCallback(()=>{Z(!0),es(eS.current),P(e=>e.filter(e=>e.toastId!==E.id)),setTimeout(()=>{O(E)},200)},[E,O,P,eS]);n.useEffect(()=>{let e;if((!E.promise||"loading"!==em)&&E.duration!==1/0&&"loading"!==E.type)return _||k||eA?(()=>{if(ek.current<eE.current){let e=new Date().getTime()-eE.current;ec.current=ec.current-e}ek.current=new Date().getTime()})():ec.current!==1/0&&(eE.current=new Date().getTime(),e=setTimeout(()=>{null==E.onAutoClose||E.onAutoClose.call(E,E),eq()},ec.current)),()=>clearTimeout(e)},[_,k,E,em,eA,eq]),n.useEffect(()=>{E.delete&&(eq(),null==E.onDismiss||E.onDismiss.call(E,E))},[eq,E.delete]);let eR=E.icon||(null==W?void 0:W[em])||(e=>{switch(e){case"success":return s;case"info":return u;case"warning":return l;case"error":return c;default:return null}})(em);return n.createElement("li",{tabIndex:0,ref:eh,className:v(L,ey,null==V?void 0:V.toast,null==E||null==(t=E.classNames)?void 0:t.toast,null==V?void 0:V.default,null==V?void 0:V[em],null==E||null==(r=E.classNames)?void 0:r[em]),"data-sonner-toast":"","data-rich-colors":null!=(w=E.richColors)?w:q,"data-styled":!(E.jsx||E.unstyled||S),"data-mounted":Y,"data-promise":!!E.promise,"data-swiped":ea,"data-removed":X,"data-visible":ep,"data-y-position":eC,"data-x-position":eI,"data-index":T,"data-front":ef,"data-swiping":ee,"data-dismissible":eg,"data-type":em,"data-invert":e_,"data-swipe-out":er,"data-swipe-direction":K,"data-expanded":!!(_||z&&Y),"data-testid":E.testId,style:{"--index":T,"--toasts-before":T,"--z-index":A.length-T,"--offset":`${X?eo:eS.current}px`,"--initial-height":z?"auto":`${el}px`,...D,...E.style},onDragEnd:()=>{et(!1),Q(null),eP.current=null},onPointerDown:e=>{2!==e.button&&!eO&&eg&&(ed.current=new Date,es(eS.current),e.target.setPointerCapture(e.pointerId),"BUTTON"!==e.target.tagName&&(et(!0),eP.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{var e,t,r,n,a;if(er||!eg)return;eP.current=null;let i=Number((null==(e=eh.current)?void 0:e.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),o=Number((null==(t=eh.current)?void 0:t.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),s=new Date().getTime()-(null==(r=ed.current)?void 0:r.getTime()),l="x"===G?i:o,u=Math.abs(l)/s;if(Math.abs(l)>=45||u>.11){es(eS.current),null==E.onDismiss||E.onDismiss.call(E,E),"x"===G?$(i>0?"right":"left"):$(o>0?"down":"up"),eq(),en(!0);return}null==(n=eh.current)||n.style.setProperty("--swipe-amount-x","0px"),null==(a=eh.current)||a.style.setProperty("--swipe-amount-y","0px"),ei(!1),et(!1),Q(null)},onPointerMove:t=>{var r,n,a,i;if(!eP.current||!eg||(null==(r=window.getSelection())?void 0:r.toString().length)>0)return;let o=t.clientY-eP.current.y,s=t.clientX-eP.current.x,l=null!=(i=e.swipeDirections)?i:function(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}(U);!G&&(Math.abs(s)>1||Math.abs(o)>1)&&Q(Math.abs(s)>Math.abs(o)?"x":"y");let u={x:0,y:0},c=e=>1/(1.5+Math.abs(e)/20);if("y"===G){if(l.includes("top")||l.includes("bottom"))if(l.includes("top")&&o<0||l.includes("bottom")&&o>0)u.y=o;else{let e=o*c(o);u.y=Math.abs(e)<Math.abs(o)?e:o}}else if("x"===G&&(l.includes("left")||l.includes("right")))if(l.includes("left")&&s<0||l.includes("right")&&s>0)u.x=s;else{let e=s*c(s);u.x=Math.abs(e)<Math.abs(s)?e:s}(Math.abs(u.x)>0||Math.abs(u.y)>0)&&ei(!0),null==(n=eh.current)||n.style.setProperty("--swipe-amount-x",`${u.x}px`),null==(a=eh.current)||a.style.setProperty("--swipe-amount-y",`${u.y}px`)}},eb&&!E.jsx&&"loading"!==em?n.createElement("button",{"aria-label":H,"data-disabled":eO,"data-close-button":!0,onClick:eO||!eg?()=>{}:()=>{eq(),null==E.onDismiss||E.onDismiss.call(E,E)},className:v(null==V?void 0:V.closeButton,null==E||null==(a=E.classNames)?void 0:a.closeButton)},null!=(b=null==W?void 0:W.close)?b:d):null,(em||E.icon||E.promise)&&null!==E.icon&&((null==W?void 0:W[em])!==null||E.icon)?n.createElement("div",{"data-icon":"",className:v(null==V?void 0:V.icon,null==E||null==(i=E.classNames)?void 0:i.icon)},E.promise||"loading"===E.type&&!E.icon?E.icon||function(){var e,t;return(null==W?void 0:W.loading)?n.createElement("div",{className:v(null==V?void 0:V.loader,null==E||null==(t=E.classNames)?void 0:t.loader,"sonner-loader"),"data-visible":"loading"===em},W.loading):n.createElement(o,{className:v(null==V?void 0:V.loader,null==E||null==(e=E.classNames)?void 0:e.loader),visible:"loading"===em})}():null,"loading"!==E.type?eR:null):null,n.createElement("div",{"data-content":"",className:v(null==V?void 0:V.content,null==E||null==(h=E.classNames)?void 0:h.content)},n.createElement("div",{"data-title":"",className:v(null==V?void 0:V.title,null==E||null==(f=E.classNames)?void 0:f.title)},E.jsx?E.jsx:"function"==typeof E.title?E.title():E.title),E.description?n.createElement("div",{"data-description":"",className:v(M,ev,null==V?void 0:V.description,null==E||null==(p=E.classNames)?void 0:p.description)},"function"==typeof E.description?E.description():E.description):null),n.isValidElement(E.cancel)?E.cancel:E.cancel&&y(E.cancel)?n.createElement("button",{"data-button":!0,"data-cancel":!0,style:E.cancelButtonStyle||N,onClick:e=>{y(E.cancel)&&eg&&(null==E.cancel.onClick||E.cancel.onClick.call(E.cancel,e),eq())}
11,className:v(null==V?void 0:V.cancelButton,null==E||null==(m=E.classNames)?void 0:m.cancelButton)},E.cancel.label):null,n.isValidElement(E.action)?E.action:E.action&&y(E.action)?n.createElement("button",{"data-button":!0,"data-action":!0,style:E.actionButtonStyle||j,onClick:e=>{y(E.action)&&(null==E.action.onClick||E.action.onClick.call(E.action,e),e.defaultPrevented||eq())},className:v(null==V?void 0:V.actionButton,null==E||null==(g=E.classNames)?void 0:g.actionButton)},E.action.label):null)};function b(){if("undefined"==typeof window||"undefined"==typeof document)return"ltr";let e=document.documentElement.getAttribute("dir");return"auto"!==e&&e?e:window.getComputedStyle(document.documentElement).direction}let x=n.forwardRef(function(e,t){let{id:r,invert:i,position:o="bottom-right",hotkey:s=["altKey","KeyT"],expand:l,closeButton:u,className:c,offset:d,mobileOffset:h,theme:f="light",richColors:m,duration:g,style:y,visibleToasts:v=3,toastOptions:x,dir:E=b(),gap:S=14,icons:k,containerAriaLabel:P="Notifications"}=e,[C,I]=n.useState([]),T=n.useMemo(()=>r?C.filter(e=>e.toasterId===r):C.filter(e=>!e.toasterId),[C,r]),A=n.useMemo(()=>Array.from(new Set([o].concat(T.filter(e=>e.position).map(e=>e.position)))),[T,o]),[_,O]=n.useState([]),[q,R]=n.useState(!1),[D,N]=n.useState(!1),[j,L]=n.useState("system"!==f?f:"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),M=n.useRef(null),B=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),U=n.useRef(null),F=n.useRef(!1),z=n.useCallback(e=>{I(t=>{var r;return(null==(r=t.find(t=>t.id===e.id))?void 0:r.delete)||p.dismiss(e.id),t.filter(({id:t})=>t!==e.id)})},[]);return n.useEffect(()=>p.subscribe(e=>{if(e.dismiss)return void requestAnimationFrame(()=>{I(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});setTimeout(()=>{a.flushSync(()=>{I(t=>{let r=t.findIndex(t=>t.id===e.id);return -1!==r?[...t.slice(0,r),{...t[r],...e},...t.slice(r+1)]:[e,...t]})})})}),[C]),n.useEffect(()=>{if("system"!==f)return void L(f);if("system"===f&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?L("dark"):L("light")),"undefined"==typeof window)return;let e=window.matchMedia("(prefers-color-scheme: dark)");try{e.addEventListener("change",({matches:e})=>{e?L("dark"):L("light")})}catch(t){e.addListener(({matches:e})=>{try{e?L("dark"):L("light")}catch(e){console.error(e)}})}},[f]),n.useEffect(()=>{C.length<=1&&R(!1)},[C]),n.useEffect(()=>{let e=e=>{var t,r;s.every(t=>e[t]||e.code===t)&&(R(!0),null==(r=M.current)||r.focus()),"Escape"===e.code&&(document.activeElement===M.current||(null==(t=M.current)?void 0:t.contains(document.activeElement)))&&R(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[s]),n.useEffect(()=>{if(M.current)return()=>{U.current&&(U.current.focus({preventScroll:!0}),U.current=null,F.current=!1)}},[M.current]),n.createElement("section",{ref:t,"aria-label":`${P} ${B}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},A.map((t,r)=>{var a;let[o,s]=t.split("-");return T.length?n.createElement("ol",{key:t,dir:"auto"===E?b():E,tabIndex:-1,ref:M,className:c,"data-sonner-toaster":!0,"data-sonner-theme":j,"data-y-position":o,"data-x-position":s,style:{"--front-toast-height":`${(null==(a=_[0])?void 0:a.height)||0}px`,"--width":"356px","--gap":`${S}px`,...y,...function(e,t){let r={};return[e,t].forEach((e,t)=>{let n=1===t,a=n?"--mobile-offset":"--offset",i=n?"16px":"24px";function o(e){["top","right","bottom","left"].forEach(t=>{r[`${a}-${t}`]="number"==typeof e?`${e}px`:e})}"number"==typeof e||"string"==typeof e?o(e):"object"==typeof e?["top","right","bottom","left"].forEach(t=>{void 0===e[t]?r[`${a}-${t}`]=i:r[`${a}-${t}`]="number"==typeof e[t]?`${e[t]}px`:e[t]}):o(i)}),r}(d,h)},onBlur:e=>{F.current&&!e.currentTarget.contains(e.relatedTarget)&&(F.current=!1,U.current&&(U.current.focus({preventScroll:!0}),U.current=null))},onFocus:e=>{!(e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible)&&(F.current||(F.current=!0,U.current=e.relatedTarget))},onMouseEnter:()=>R(!0),onMouseMove:()=>R(!0),onMouseLeave:()=>{D||R(!1)},onDragEnd:()=>R(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible||N(!0)},onPointerUp:()=>N(!1)},T.filter(e=>!e.position&&0===r||e.position===t).map((r,a)=>{var o,s;return n.createElement(w,{key:r.id,icons:k,index:a,toast:r,defaultRichColors:m,duration:null!=(o=null==x?void 0:x.duration)?o:g,className:null==x?void 0:x.className,descriptionClassName:null==x?void 0:x.descriptionClassName,invert:i,visibleToasts:v,closeButton:null!=(s=null==x?void 0:x.closeButton)?s:u,interacting:D,position:t,style:null==x?void 0:x.style,unstyled:null==x?void 0:x.unstyled,classNames:null==x?void 0:x.classNames,cancelButtonStyle:null==x?void 0:x.cancelButtonStyle,actionButtonStyle:null==x?void 0:x.actionButtonStyle,closeButtonAriaLabel:null==x?void 0:x.closeButtonAriaLabel,removeToast:z,toasts:T.filter(e=>e.position==r.position),heights:_.filter(e=>e.position==r.position),setHeights:O,expandByDefault:l,gap:S,expanded:q,swipeDirections:e.swipeDirections})})):null}))})},59911:(e,t,r)=>{"use strict";r.d(t,{OY:()=>a});let n=/EmparaApp\/(ios|android)/i;function a(){try{var e,t,r;if(r="object"==typeof navigator&&null!==navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:"","string"==typeof r&&n.test(r))return!0;let a="object"==typeof document&&null!==document&&document.documentElement?document.documentElement.getAttribute("data-platform"):null;if("ios"===a||"android"===a)return!0;return(null==(t=window.Capacitor)||null==(e=t.isNativePlatform)?void 0:e.call(t))===!0}catch(e){return!1}}},60388:(e,t,r)=>{"use strict";r.d(t,{jG:()=>a});var n=r(48306).Zq,a=function(){let e=[],t=0,r=e=>{e()},a=e=>{e()},i=n,o=n=>
11{t?e.push(n):i(()=>{r(n)})};return{batch:n=>{let o;t++;try{o=n()}finally{--t||(()=>{let t=e;e=[],t.length&&i(()=>{a(()=>{t.forEach(e=>{r(e)})})})})()}return o},batchCalls:e=>(...t)=>{o(()=>{e(...t)})},schedule:o,setNotifyFunction:e=>{r=e},setBatchNotifyFunction:e=>{a=e},setScheduler:e=>{i=e}}}()},62146:(e,t,r)=>{"use strict";r.d(t,{c:()=>a});var n=r(14232);function a(e){let t=n.useRef(e);return n.useEffect(()=>{t.current=e}),n.useMemo(()=>(...e)=>t.current?.(...e),[])}},62734:(e,t,r)=>{"use strict";r.d(t,{Ly:()=>a,Nl:()=>o,p9:()=>i,zK:()=>n});let n="669e79968ec21fdf49740140",a=new Set(["6422ef8b64f899ec5e5cd3fa"]),i={learning:"Empara",best:"Popularit\xe9",progress:"Progressivit\xe9",recent:"Plus r\xe9cent"},o=[{Offres:[{label:"Passionn\xe9",key:"Passionn\xe9"},{label:"Pro",key:"Pro"},{label:"Gratuit",key:"Gratuit"}],key:"offer"},{Catégories:[{label:"Prise de vue",key:"624bf88773f427237b0f5086"},{label:"Business",key:"669e70108ec21fdf4974013e"},{label:"Post-production",key:"669e70478ec21fdf4974013f"},{label:"R\xe9sum\xe9",key:n}],key:"subdomains"},{"Mes cours":[{label:"En cours",key:"watching"},{label:"D\xe9j\xe0 vus",key:"watched"},{label:"Favoris",key:"favorite"},{label:"Acc\xe8s \xe0 vie",key:"owned"},{label:"Exclure les termin\xe9es",key:"removeWatched"}],key:"userCourses",userDependant:!0}]},63786:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useIntersection",{enumerable:!0,get:function(){return l}});let n=r(14232),a=r(43273),i="function"==typeof IntersectionObserver,o=new Map,s=[];function l(e){let{rootRef:t,rootMargin:r,disabled:l}=e,u=l||!i,[c,d]=(0,n.useState)(!1),h=(0,n.useRef)(null),f=(0,n.useCallback)(e=>{h.current=e},[]);return(0,n.useEffect)(()=>{if(i){if(u||c)return;let e=h.current;if(e&&e.tagName)return function(e,t,r){let{id:n,observer:a,elements:i}=function(e){let t,r={root:e.root||null,margin:e.rootMargin||""},n=s.find(e=>e.root===r.root&&e.margin===r.margin);if(n&&(t=o.get(n)))return t;let a=new Map;return t={id:r,observer:new IntersectionObserver(e=>{e.forEach(e=>{let t=a.get(e.target),r=e.isIntersecting||e.intersectionRatio>0;t&&r&&t(r)})},e),elements:a},s.push(r),o.set(r,t),t}(r);return i.set(e,t),a.observe(e),function(){if(i.delete(e),a.unobserve(e),0===i.size){a.disconnect(),o.delete(n);let e=s.findIndex(e=>e.root===n.root&&e.margin===n.margin);e>-1&&s.splice(e,1)}}}(e,e=>e&&d(e),{root:null==t?void 0:t.current,rootMargin:r})}else if(!c){let e=(0,a.requestIdleCallback)(()=>d(!0));return()=>(0,a.cancelIdleCallback)(e)}},[u,r,t,c,h.current]),[f,c,(0,n.useCallback)(()=>{d(!1)},[])]}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},64642:(e,t,r)=>{"use strict";r.d(t,{C:()=>n});let n=function(e){var t,r;if(null==e)return i;if("function"==typeof e)return a(e);if("object"==typeof e){return Array.isArray(e)?function(e){let t=[],r=-1;for(;++r<e.length;)t[r]=n(e[r]);return a(function(...e){let r=-1;for(;++r<t.length;)if(t[r].apply(this,e))return!0;return!1})}(e):(t=e,a(function(e){let r;for(r in t)if(e[r]!==t[r])return!1;return!0}))}if("string"==typeof e){return r=e,a(function(e){return e&&e.type===r})}throw Error("Expected function, string, or object as test")};function a(e){return function(t,r,n){return!!(function(e){return null!==e&&"object"==typeof e&&"type"in e}(t)&&e.call(this,t,"number"==typeof r?r:void 0,n||void 0))}}function i(){return!0}},65364:(e,t,r)=>{"use strict";var n,a;e.exports=(null==(n=r.g.process)?void 0:n.env)&&"object"==typeof(null==(a=r.g.process)?void 0:a.env)?r.g.process:r(15861)},65721:(e,t,r)=>{"use strict";r.d(t,{T:()=>u});var n=r(84787);let a={basename:function(e,t){let r;if(void 0!==t&&"string"!=typeof t)throw TypeError('"ext" argument must be a string');i(e);let n=0,a=-1,o=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;o--;)if(47===e.codePointAt(o)){if(r){n=o+1;break}}else a<0&&(r=!0,a=o+1);return a<0?"":e.slice(n,a)}if(t===e)return"";let s=-1,l=t.length-1;for(;o--;)if(47===e.codePointAt(o)){if(r){n=o+1;break}}else s<0&&(r=!0,s=o+1),l>-1&&(e.codePointAt(o)===t.codePointAt(l--)?l<0&&(a=o):(l=-1,a=s));return n===a?a=s:a<0&&(a=e.length),e.slice(n,a)},dirname:function(e){let t;if(i(e),0===e.length)return".";let r=-1,n=e.length;for(;--n;)if(47===e.codePointAt(n)){if(t){r=n;break}}else t||(t=!0);return r<0?47===e.codePointAt(0)?"/":".":1===r&&47===e.codePointAt(0)?"//":e.slice(0,r)},extname:function(e){let t;i(e);let r=e.length,n=-1,a=0,o=-1,s=0;for(;r--;){let i=e.codePointAt(r);if(47===i){if(t){a=r+1;break}continue}n<0&&(t=!0,n=r+1),46===i?o<0?o=r:1!==s&&(s=1):o>-1&&(s=-1)}return o<0||n<0||0===s||1===s&&o===n-1&&o===a+1?"":e.slice(o,n)},join:function(...e){let t,r=-1;for(;++r<e.length;)i(e[r]),e[r]&&(t=void 0===t?e[r]:t+"/"+e[r]);return void 0===t?".":function(e){i(e);let t=47===e.codePointAt(0),r=function(e,t){let r,n,a="",i=0,o=-1,s=0,l=-1;for(;++l<=e.length;){if(l<e.length)r=e.codePointAt(l);else if(47===r)break;else r=47;if(47===r){if(o===l-1||1===s);else if(o!==l-1&&2===s){if(a.length<2||2!==i||46!==a.codePointAt(a.length-1)||46!==a.codePointAt(a.length-2)){if(a.length>2){if((n=a.lastIndexOf("/"))!==a.length-1){n<0?(a="",i=0):i=(a=a.slice(0,n)).length-1-a.lastIndexOf("/"),o=l,s=0;continue}}else if(a.length>0){a="",i=0,o=l,s=0;continue}}t&&(a=a.length>0?a+"/..":"..",i=2)}else a.length>0?a+="/"+e.slice(o+1,l):a=e.slice(o+1,l),i=l-o-1;o=l,s=0}else 46===r&&s>-1?s++:s=-1}return a}(e,!t);return 0!==r.length||t||(r="."),r.length>0&&47===e.codePointAt(e.length-1)&&(r+="/"),t?"/"+r:r}(t)},sep:"/"};function i(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}let o={cwd:function(){return"/"}};function s(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}let l=["history","path","basename","stem","extname","dirname"];class u{constructor(e){let t,r;t=e?s(e)?{path:e}:"string"==typeof e||function(e){return!!(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":o.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<l.length;){let e=l[n];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(r in t)l.includes(r)||(this[r]=t[r])}get basename(){return"string"==typeof this.path?a.basename(this.path):void 0}
11set basename(e){d(e,"basename"),c(e,"basename"),this.path=a.join(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?a.dirname(this.path):void 0}set dirname(e){h(this.basename,"dirname"),this.path=a.join(e||"",this.basename)}get extname(){return"string"==typeof this.path?a.extname(this.path):void 0}set extname(e){if(c(e,"extname"),h(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw Error("`extname` must start with `.`");if(e.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=a.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){s(e)&&(e=function(e){if("string"==typeof e)e=new URL(e);else if(!s(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){let e=TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){let e=TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}let t=e.pathname,r=-1;for(;++r<t.length;)if(37===t.codePointAt(r)&&50===t.codePointAt(r+1)){let e=t.codePointAt(r+2);if(70===e||102===e){let e=TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}(e)),d(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?a.basename(this.path,this.extname):void 0}set stem(e){d(e,"stem"),c(e,"stem"),this.path=a.join(this.dirname||"",e+(this.extname||""))}fail(e,t,r){let n=this.message(e,t,r);throw n.fatal=!0,n}info(e,t,r){let n=this.message(e,t,r);return n.fatal=void 0,n}message(e,t,r){let a=new n.o(e,t,r);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(e){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(e||void 0).decode(this.value)}}function c(e,t){if(e&&e.includes(a.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+a.sep+"`")}function d(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function h(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}},66720:e=>{var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e){return e?e.replace(l,""):""}e.exports=function(e,l){if("string"!=typeof e)throw TypeError("First argument must be a string");if(!e)return[];l=l||{};var c=1,d=1;function h(e){var t=e.match(r);t&&(c+=t.length);var n=e.lastIndexOf("\n");d=~n?e.length-n:d+e.length}function f(){var e={line:c,column:d};return function(t){return t.position=new p(e),y(n),t}}function p(e){this.start=e,this.end={line:c,column:d},this.source=l.source}p.prototype.content=e;var m=[];function g(t){var r=Error(l.source+":"+c+":"+d+": "+t);if(r.reason=t,r.filename=l.source,r.line=c,r.column=d,r.source=e,l.silent)m.push(r);else throw r}function y(t){var r=t.exec(e);if(r){var n=r[0];return h(n),e=e.slice(n.length),r}}function v(e){var t;for(e=e||[];t=w();)!1!==t&&e.push(t);return e}function w(){var t=f();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var r=2;""!=e.charAt(r)&&("*"!=e.charAt(r)||"/"!=e.charAt(r+1));)++r;if(r+=2,""===e.charAt(r-1))return g("End of comment missing");var n=e.slice(2,r-2);return d+=2,h(n),e=e.slice(r),d+=2,t({type:"comment",comment:n})}}y(n);var b,x=[];for(v(x);b=function(){var e=f(),r=y(a);if(r){if(w(),!y(i))return g("property missing ':'");var n=y(o),l=e({type:"declaration",property:u(r[0].replace(t,"")),value:n?u(n[0].replace(t,"")):""});return y(s),l}}();)!1!==b&&(x.push(b),v(x));return x}},67768:(e,t,r)=>{"use strict";r.d(t,{Ht:()=>s,jE:()=>o});var n=r(14232),a=r(37876),i=n.createContext(void 0),o=e=>{let t=n.useContext(i);if(e)return e;if(!t)throw Error("No QueryClient set, use QueryClientProvider to set one");return t},s=({client:e,children:t})=>(n.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,a.jsx)(i.Provider,{value:e,children:t}))},67776:(e,t,r)=>{"use strict";function n(e,t,r,n){let a,i=e.length,o=0;if(t=t<0?-t>i?0:i+t:t>i?i:t,r=r>0?r:0,n.length<1e4)(a=Array.from(n)).unshift(t,r),e.splice(...a);else for(r&&e.splice(t,r);o<n.length;)(a=n.slice(o,o+1e4)).unshift(t,0),e.splice(...a),o+=1e4,t+=1e4}function a(e,t){return e.length>0?(n(e,e.length,0,t),e):t}r.d(t,{V:()=>a,m:()=>n})},67914:(e,t,r)=>{"use strict";r.d(t,{I:()=>b});var n=r(98275),a=r(60388),i=r(58444),o=r(90089),s=r(81883),l=r(37149),u=r(48306),c=class extends o.Q{constructor(e,t){super(),this.options=t,this.#m=e,this.#O=null,this.#q=(0,s.T)(),this.bindMethods(),this.setOptions(t)}#m;#R=void 0;#D=void 0;#w=void 0;#N;#j;#q;#O;#L;#M;#B;#U;#F;#z;#V=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#R.addObserver(this),d(this.#R,this.options)?this.#W():this.updateResult(),this.#H())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return h(this.#R,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return h(this.#R,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#G(),this.#Q(),this.#R.removeObserver(this)}setOptions(e){let t=this.options,r=this.#R;if(this.options=this.#m.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof(0,l.Eh)(this.options.enabled,this.#R))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#K(),this.#R.setOptions(this.options),t._defaulted&&!(0,l.f8)(this.options,t)&&this.#m.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#R,observer:this});let n=this.hasListeners();n&&f(this.#R,r,this.options,t)&&this.#W(),this.updateResult(),n&&(this.#R!==r||(0,l.Eh)(this.options.enabled,this.#R)!==(0,l.Eh)(t.enabled,this.#R)||(0,l.d2)(this.options.staleTime,this.#R)!==(0,l.d2)(t.staleTime,this.#R))&&this.#$();let a=this.#Y();n&&(this.#R!==r||(0,l.Eh)(this.options.enabled,this.#R)!==(0,l.Eh)(t.enabled,this.#R)||a!==this.#z)&&this.#J(a)}getOptimisticResult(e){var t,r;let n=this.#m.getQueryCache().build(this.#m,e),a=this.createResult(n,e);return t=this,r=a,(0,l.f8)(t.getCurrentResult(),r)||(this.#w=a,this.#j=this.options,this.#N=this.#R.state),a}getCurrentResult(){return this.#w}trackResult(e,t){return new Proxy(e,{get:(e,r)=>(this.trackProp(r),t?.(r),"promise"!==r||this.options.experimental_prefetchInRender||"pending"!==this.#q.status||this.#q.reject(Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(e,r))})}trackProp(e){this.#V.add(e)}getCurrentQuery(){return this.#R}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#m.defaultQueryOptions(e),r=this.#m.getQueryCache().build(this.#m,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#W({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#w))}#W(e){this.#K();let t=this.#R.fetch(this.options,e);return e?.throwOnError||(t=t.catch(l.lQ)),t}#$(){this.#G();let e=(0,l.d2)(this.options.staleTime,this.#R);if(l.S$||this.#w.isStale||!(0,l.gn)(e))return;let t=(0,l.j3)(this.#w.dataUpdatedAt,e);this.#U=u.zs.setTimeout(()=>{this.#w.isStale||this.updateResult()},t+1)}#Y(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#R):this.options.refetchInterval)??!1}#J(e){this.#Q(),this.#z=e,!l.S$&&!1!==(0,l.Eh)(this.options.enabled,this.#R)&&(0,l.gn)(this.#z)&&0!==this.#z&&(this.#F=u.zs.setInterval(()=>
11{(this.options.refetchIntervalInBackground||n.m.isFocused())&&this.#W()},this.#z))}#H(){this.#$(),this.#J(this.#Y())}#G(){this.#U&&(u.zs.clearTimeout(this.#U),this.#U=void 0)}#Q(){this.#F&&(u.zs.clearInterval(this.#F),this.#F=void 0)}createResult(e,t){let r,n=this.#R,a=this.options,o=this.#w,u=this.#N,c=this.#j,h=e!==n?e.state:this.#D,{state:m}=e,g={...m},y=!1;if(t._optimisticResults){let r=this.hasListeners(),o=!r&&d(e,t),s=r&&f(e,n,t,a);(o||s)&&(g={...g,...(0,i.k)(m.data,e.options)}),"isRestoring"===t._optimisticResults&&(g.fetchStatus="idle")}let{error:v,errorUpdatedAt:w,status:b}=g;r=g.data;let x=!1;if(void 0!==t.placeholderData&&void 0===r&&"pending"===b){let e;o?.isPlaceholderData&&t.placeholderData===c?.placeholderData?(e=o.data,x=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#B?.state.data,this.#B):t.placeholderData,void 0!==e&&(b="success",r=(0,l.pl)(o?.data,e,t),y=!0)}if(t.select&&void 0!==r&&!x)if(o&&r===u?.data&&t.select===this.#L)r=this.#M;else try{this.#L=t.select,r=t.select(r),r=(0,l.pl)(o?.data,r,t),this.#M=r,this.#O=null}catch(e){this.#O=e}this.#O&&(v=this.#O,r=this.#M,w=Date.now(),b="error");let E="fetching"===g.fetchStatus,S="pending"===b,k="error"===b,P=S&&E,C=void 0!==r,I={status:b,fetchStatus:g.fetchStatus,isPending:S,isSuccess:"success"===b,isError:k,isInitialLoading:P,isLoading:P,data:r,dataUpdatedAt:g.dataUpdatedAt,error:v,errorUpdatedAt:w,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:g.dataUpdateCount>0||g.errorUpdateCount>0,isFetchedAfterMount:g.dataUpdateCount>h.dataUpdateCount||g.errorUpdateCount>h.errorUpdateCount,isFetching:E,isRefetching:E&&!S,isLoadingError:k&&!C,isPaused:"paused"===g.fetchStatus,isPlaceholderData:y,isRefetchError:k&&C,isStale:p(e,t),refetch:this.refetch,promise:this.#q,isEnabled:!1!==(0,l.Eh)(t.enabled,e)};if(this.options.experimental_prefetchInRender){let t=e=>{"error"===I.status?e.reject(I.error):void 0!==I.data&&e.resolve(I.data)},r=()=>{t(this.#q=I.promise=(0,s.T)())},a=this.#q;switch(a.status){case"pending":e.queryHash===n.queryHash&&t(a);break;case"fulfilled":("error"===I.status||I.data!==a.value)&&r();break;case"rejected":("error"!==I.status||I.error!==a.reason)&&r()}}return I}updateResult(){let e=this.#w,t=this.createResult(this.#R,this.options);if(this.#N=this.#R.state,this.#j=this.options,void 0!==this.#N.data&&(this.#B=this.#R),(0,l.f8)(t,e))return;this.#w=t;let r=()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!this.#V.size)return!0;let n=new Set(r??this.#V);return this.options.throwOnError&&n.add("error"),Object.keys(this.#w).some(t=>this.#w[t]!==e[t]&&n.has(t))};this.#S({listeners:r()})}#K(){let e=this.#m.getQueryCache().build(this.#m,this.options);if(e===this.#R)return;let t=this.#R;this.#R=e,this.#D=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#H()}#S(e){a.jG.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#w)}),this.#m.getQueryCache().notify({query:this.#R,type:"observerResultsUpdated"})})}};function d(e,t){return!1!==(0,l.Eh)(t.enabled,e)&&void 0===e.state.data&&("error"!==e.state.status||!1!==t.retryOnMount)||void 0!==e.state.data&&h(e,t,t.refetchOnMount)}function h(e,t,r){if(!1!==(0,l.Eh)(t.enabled,e)&&"static"!==(0,l.d2)(t.staleTime,e)){let n="function"==typeof r?r(e):r;return"always"===n||!1!==n&&p(e,t)}return!1}function f(e,t,r,n){return(e!==t||!1===(0,l.Eh)(n.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&p(e,r)}function p(e,t){return!1!==(0,l.Eh)(t.enabled,e)&&e.isStaleByTime((0,l.d2)(t.staleTime,e))}var m=r(14232),g=r(67768);r(37876);var y=m.createContext(function(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}()),v=m.createContext(!1);v.Provider;var w=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function b(e,t){return function(e,t,r){let n=m.useContext(v),i=m.useContext(y),o=(0,g.jE)(r),s=o.defaultQueryOptions(e);if(o.getDefaultOptions().queries?._experimental_beforeQuery?.(s),s._optimisticResults=n?"isRestoring":"optimistic",s.suspense){let e=e=>"static"===e?e:Math.max(e??1e3,1e3),t=s.staleTime;s.staleTime="function"==typeof t?(...r)=>e(t(...r)):e(t),"number"==typeof s.gcTime&&(s.gcTime=Math.max(s.gcTime,1e3))}(s.suspense||s.throwOnError||s.experimental_prefetchInRender)&&!i.isReset()&&(s.retryOnMount=!1),m.useEffect(()=>{i.clearReset()},[i]);let u=!o.getQueryCache().get(s.queryHash),[c]=m.useState(()=>new t(o,s)),d=c.getOptimisticResult(s),h=!n&&!1!==e.subscribed;if(m.useSyncExternalStore(m.useCallback(e=>{let t=h?c.subscribe(a.jG.batchCalls(e)):l.lQ;return c.updateResult(),t},[c,h]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),m.useEffect(()=>{c.setOptions(s)},[s,c]),s?.suspense&&d.isPending)throw w(s,c,i);if((({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(a&&void 0===e.data||(0,l.GU)(r,[e.error,n])))({result:d,errorResetBoundary:i,throwOnError:s.throwOnError,query:o.getQueryCache().get(s.queryHash),suspense:s.suspense}))throw d.error;if(o.getDefaultOptions().queries?._experimental_afterQuery?.(s,d),s.experimental_prefetchInRender&&!l.S$&&d.isLoading&&d.isFetching&&!n){let e=u?w(s,c,i):o.getQueryCache().get(s.queryHash)?.promise;e?.catch(l.lQ).finally(()=>{c.updateResult()})}return s.notifyOnChangeProps?d:c.trackResult(d)}(e,c,t)}},68581:(e,t,r)=>{"use strict";r.d(t,{Y:()=>l});var n=r(97770);function a(e,t){let r=t.referenceType,n="]";if("collapsed"===r?n+="[]":"full"===r&&(n+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+n}];let a=e.all(t),i=a[0];i&&"text"===i.type?i.value="["+i.value:a.unshift({type:"text",value:"["});let o=a[a.length-1];return o&&"text"===o.type?o.value+=n:a.push({type:"text",value:n}),a}function i(e){let t=e.spread;return null==t?e.children.length>1:t}var o=r(46029);function s(e,t,r){let n=0,a=e.length;if(t){let t=e.codePointAt(n);for(;9===t||32===t;)n++,t=e.codePointAt(n)}if(r){let t=e.codePointAt(a-1);for(;9===t||32===t;)a--,t=e.codePointAt(a-1)}return a>n?e.slice(n,a):""}let l={blockquote:function(e,t){let r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,r),e.applyData(t,r)},break:function(e,t){let r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,r),[e.applyData(t,r),{type:"text",value:"\n"}]},code:function(e,t){let r=t.value?t.value+"\n":"",n={},a=t.lang?t.lang.split(/\s+/):[];a.length>0&&(n.className=["language-"+a[0]]);let i={type:"element",tagName:"code",properties:n,children:[{type:"text",value:r}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i={type:"element",tagName:"pre",properties:{},children:[i=e.applyData(t,i)]},e.patch(t,i),i},delete:function(e,t){let r={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},emphasis:function(e,t){let r={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}
11,footnoteReference:function(e,t){let r,a="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),o=(0,n.e)(i.toLowerCase()),s=e.footnoteOrder.indexOf(i),l=e.footnoteCounts.get(i);void 0===l?(l=0,e.footnoteOrder.push(i),r=e.footnoteOrder.length):r=s+1,l+=1,e.footnoteCounts.set(i,l);let u={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+o,id:a+"fnref-"+o+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(r)}]};e.patch(t,u);let c={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,c),e.applyData(t,c)},heading:function(e,t){let r={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},html:function(e,t){if(e.options.allowDangerousHtml){let r={type:"raw",value:t.value};return e.patch(t,r),e.applyData(t,r)}},imageReference:function(e,t){let r=String(t.identifier).toUpperCase(),i=e.definitionById.get(r);if(!i)return a(e,t);let o={src:(0,n.e)(i.url||""),alt:t.alt};null!==i.title&&void 0!==i.title&&(o.title=i.title);let s={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,s),e.applyData(t,s)},image:function(e,t){let r={src:(0,n.e)(t.url)};null!==t.alt&&void 0!==t.alt&&(r.alt=t.alt),null!==t.title&&void 0!==t.title&&(r.title=t.title);let a={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,a),e.applyData(t,a)},inlineCode:function(e,t){let r={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,r);let n={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(t,n),e.applyData(t,n)},linkReference:function(e,t){let r=String(t.identifier).toUpperCase(),i=e.definitionById.get(r);if(!i)return a(e,t);let o={href:(0,n.e)(i.url||"")};null!==i.title&&void 0!==i.title&&(o.title=i.title);let s={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)},link:function(e,t){let r={href:(0,n.e)(t.url)};null!==t.title&&void 0!==t.title&&(r.title=t.title);let a={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)},listItem:function(e,t,r){let n=e.all(t),a=r?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;let r=e.children,n=-1;for(;!t&&++n<r.length;)t=i(r[n])}return t}(r):i(t),o={},s=[];if("boolean"==typeof t.checked){let e,r=n[0];r&&"element"===r.type&&"p"===r.tagName?e=r:(e={type:"element",tagName:"p",properties:{},children:[]},n.unshift(e)),e.children.length>0&&e.children.unshift({type:"text",value:" "}),e.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let l=-1;for(;++l<n.length;){let e=n[l];(a||0!==l||"element"!==e.type||"p"!==e.tagName)&&s.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||a?s.push(e):s.push(...e.children)}let u=n[n.length-1];u&&(a||"element"!==u.type||"p"!==u.tagName)&&s.push({type:"text",value:"\n"});let c={type:"element",tagName:"li",properties:o,children:s};return e.patch(t,c),e.applyData(t,c)},list:function(e,t){let r={},n=e.all(t),a=-1;for("number"==typeof t.start&&1!==t.start&&(r.start=t.start);++a<n.length;){let e=n[a];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}let i={type:"element",tagName:t.ordered?"ol":"ul",properties:r,children:e.wrap(n,!0)};return e.patch(t,i),e.applyData(t,i)},paragraph:function(e,t){let r={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},root:function(e,t){let r={type:"root",children:e.wrap(e.all(t))};return e.patch(t,r),e.applyData(t,r)},strong:function(e,t){let r={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},table:function(e,t){let r=e.all(t),n=r.shift(),a=[];if(n){let r={type:"element",tagName:"thead",properties:{},children:e.wrap([n],!0)};e.patch(t.children[0],r),a.push(r)}if(r.length>0){let n={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},i=(0,o.PW)(t.children[1]),s=(0,o.Y)(t.children[t.children.length-1]);i&&s&&(n.position={start:i,end:s}),a.push(n)}let i={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,i),e.applyData(t,i)},tableCell:function(e,t){let r={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},tableRow:function(e,t,r){let n=r?r.children:void 0,a=0===(n?n.indexOf(t):1)?"th":"td",i=r&&"table"===r.type?r.align:void 0,o=i?i.length:t.children.length,s=-1,l=[];for(;++s<o;){let r=t.children[s],n={},o=i?i[s]:void 0;o&&(n.align=o);let u={type:"element",tagName:a,properties:n,children:[]};r&&(u.children=e.all(r),e.patch(r,u),u=e.applyData(r,u)),l.push(u)}let u={type:"element",tagName:"tr",properties:{},children:e.wrap(l,!0)};
11return e.patch(t,u),e.applyData(t,u)},text:function(e,t){let r={type:"text",value:function(e){let t=String(e),r=/\r?\n|\r/g,n=r.exec(t),a=0,i=[];for(;n;)i.push(s(t.slice(a,n.index),a>0,!0),n[0]),a=n.index+n[0].length,n=r.exec(t);return i.push(s(t.slice(a),a>0,!1)),i.join("")}(String(t.value))};return e.patch(t,r),e.applyData(t,r)},thematicBreak:function(e,t){let r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,r),e.applyData(t,r)},toml:u,yaml:u,definition:u,footnoteDefinition:u};function u(){}},69050:(e,t,r)=>{"use strict";r.d(t,{_h:()=>i,rT:()=>a});var n=r(7566);let a=e=>e&&e.showCountdown?!1!==e.countdownUseEndDate&&e.useScheduling&&e.endDate?e.endDate:e.countdownEndDate||null:null,i=(e,t)=>{let{pathname:r,user:a,isLearningSpace:i=!1,isPaymentLink:o=!1,isLandingPage:s=!1,isLivePage:l=!1}=t;return(e||[]).filter(e=>!l&&(!i||!!e.showOnLearningSpace)&&(!o||!!e.showOnPaymentLinks)&&(!s||!!e.showOnLandingPages)&&!!((e,t)=>{let r=(null==e?void 0:e.audience)||"all";if("all"===r)return!0;let a=!!t,i=a&&(0,n.gD)(t);switch(r){case"loggedIn":return a;case"loggedOut":return!a;case"activeSubscribers":return i;case"nonSubscribers":return!i;default:return!0}})(e,a)&&(!e.specificPages||0===e.specificPages.length||e.specificPages.some(e=>{if(e.endsWith("*")){let t=e.slice(0,-1);return r.startsWith(t)}return r===e||r.startsWith(e+"/")})))}},69122:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"notFound",{enumerable:!0,get:function(){return a}});let n=""+r(38811).HTTP_ERROR_FALLBACK_ERROR_CODE+";404";function a(){let e=Object.defineProperty(Error(n),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});throw e.digest=n,e}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},69241:(e,t,r)=>{"use strict";function n(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=function e(t){var r,n,a="";if("string"==typeof t||"number"==typeof t)a+=t;else if("object"==typeof t)if(Array.isArray(t)){var i=t.length;for(r=0;r<i;r++)t[r]&&(n=e(t[r]))&&(a&&(a+=" "),a+=n)}else for(n in t)t[n]&&(a&&(a+=" "),a+=n);return a}(e))&&(n&&(n+=" "),n+=t);return n}r.d(t,{$:()=>n,A:()=>a});let a=n},69591:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{ReadonlyURLSearchParams:function(){return c},RedirectType:function(){return a.RedirectType},forbidden:function(){return o.forbidden},notFound:function(){return i.notFound},permanentRedirect:function(){return n.permanentRedirect},redirect:function(){return n.redirect},unauthorized:function(){return s.unauthorized},unstable_isUnrecognizedActionError:function(){return d},unstable_rethrow:function(){return l.unstable_rethrow}});let n=r(75026),a=r(61481),i=r(69122),o=r(79331),s=r(90376),l=r(18444);class u extends Error{constructor(){super("Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams")}}class c extends URLSearchParams{append(){throw new u}delete(){throw new u}set(){throw new u}sort(){throw new u}}function d(){throw Object.defineProperty(Error("`unstable_isUnrecognizedActionError` can only be used on the client."),"__NEXT_ERROR_CODE",{value:"E776",enumerable:!1,configurable:!0})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},69782:(e,t,r)=>{"use strict";r.d(t,{B:()=>i});var n=r(71368),a=r(15711);let i={partial:!0,tokenize:function(e,t,r){return function(t){return(0,a.On)(t)?(0,n.N)(e,i,"linePrefix")(t):i(t)};function i(e){return null===e||(0,a.HP)(e)?t(e):r(e)}}}},70294:(e,t,r)=>{"use strict";r.d(t,{B:()=>l});var n,a=r(14232),i=r(81285),o=(n||(n=r.t(a,2)))[" useId ".trim().toString()]||(()=>void 0),s=0;function l(e){let[t,r]=a.useState(o());return(0,i.N)(()=>{e||r(e=>e??String(s++))},[e]),e||(t?`radix-${t}`:"")}},70531:(e,t,r)=>{"use strict";r.d(t,{wh:()=>p,Yw:()=>m});var n=r(37876),a=r(45195),i=r(96473),o=r(14232);let s=o.forwardRef(function(e,t){let{title:r,titleId:n,...a}=e;return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":n},a),r?o.createElement("title",{id:n},r):null,o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.593 3.322c1.1.128 1.907 1.077 1.907 2.185V21L12 17.25 4.5 21V5.507c0-1.108.806-2.057 1.907-2.185a48.507 48.507 0 0 1 11.
11186 0Z"}))});var l=r(29349),u=r(84862);let c=o.forwardRef(function(e,t){let{title:r,titleId:n,...a}=e;return o.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":n},a),r?o.createElement("title",{id:n},r):null,o.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 7.5 7.5 3m0 0L12 7.5M7.5 3v13.5m13.5 0L16.5 21m0 0L12 16.5m4.5 4.5V7.5"}))});var d=r(7021),h=r(74550);function f(e){let{canEdit:t,isAdmin:r,onAddVideo:i,className:o}=e;if(!t)return(0,n.jsxs)("div",{className:(0,a.cn)("text-center text-gray-300",o),children:[(0,n.jsx)("div",{className:"mx-auto flex items-center justify-center w-12 h-12 rounded-full bg-[#262626] mb-4",children:(0,n.jsx)(s,{className:"w-6 h-6 text-gray-400"})}),(0,n.jsx)("h3",{className:"text-lg font-semibold text-white",children:"Playlist en pr\xe9paration"}),(0,n.jsx)("p",{className:"mt-2 text-sm text-gray-400 max-w-sm mx-auto",children:"Cette playlist ne contient pas encore de vid\xe9o. Seul son auteur peut la modifier â reviens un peu plus tard pour d\xe9couvrir son contenu. En attendant, tu peux l'enregistrer pour la retrouver facilement."})]});let f=[{Icon:l.A,title:"Ajouter une vid\xe9o de cours",description:"Clique sur \xab Ajouter une vid\xe9o \xbb. Tu seras redirig\xe9 vers le catalogue : ouvre une vid\xe9o dans un cours, puis clique sur le bouton \xab + \xbb de la banni\xe8re en bas de l'\xe9cran pour l'ajouter ici. La banni\xe8re reste affich\xe9e pendant que tu parcours les cours, tu peux en ajouter plusieurs \xe0 la suite."},{Icon:u.A,title:"Organiser en chapitres",description:"Regroupe tes vid\xe9os en chapitres pour structurer ta playlist, via le bouton \xab + \xbb puis \xab Ajouter un chapitre \xbb."},{Icon:c,title:"R\xe9ordonner par glisser-d\xe9poser",description:"Fais glisser les vid\xe9os et les chapitres pour les remettre dans l'ordre de ton choix. Double-clique pour s\xe9lectionner et d\xe9placer plusieurs \xe9l\xe9ments \xe0 la fois."}];return r&&f.push({Icon:d.A,title:"Aller plus loin",description:"En tant qu'administrateur, tu peux aussi ajouter une vid\xe9o externe (Kinescope), une page \xe9ditoriale ou un encadr\xe9 d'information depuis le menu \xab + \xbb."}),(0,n.jsxs)("div",{className:(0,a.cn)("text-gray-200",o),children:[(0,n.jsx)("h3",{className:"text-lg font-semibold text-white",children:"Compose ta playlist"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-gray-400",children:"Une playlist regroupe les vid\xe9os de ton choix dans l'ordre que tu veux. Voici comment l'enrichir."}),(0,n.jsx)("ol",{className:"mt-6 space-y-4",children:f.map((e,t)=>{let{Icon:r,title:a,description:i}=e;return(0,n.jsxs)("li",{className:"flex gap-3",children:[(0,n.jsx)("span",{className:"flex-shrink-0 flex items-center justify-center w-6 h-6 rounded-full bg-[#262626] text-xs font-semibold text-gray-300",children:t+1}),(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsxs)("p",{className:"text-sm font-medium text-white inline-flex items-center gap-1.5",children:[(0,n.jsx)(r,{className:"w-4 h-4 text-gray-400"}),a]}),(0,n.jsx)("p",{className:"mt-0.5 text-sm text-gray-400",children:i})]})]},a)})}),i&&(0,n.jsxs)("div",{className:"mt-6",children:[(0,n.jsxs)("button",{type:"button",onClick:i,className:"inline-flex items-center gap-2 rounded-md bg-[#aa484d] px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-[#974044] cursor-pointer",children:[(0,n.jsx)(h.A,{className:"w-4 h-4"}),"Ajouter une vid\xe9o"]}),(0,n.jsx)("p",{className:"mt-2 text-xs text-gray-500",children:"Astuce : une banni\xe8re d'ajout rapide appara\xeetra en bas de l'\xe9cran et te suivra de page en page jusqu'\xe0 ce que tu aies termin\xe9."})]})]})}function p(e){let{canEdit:t,isAdmin:r,onAddVideo:i}=e;return(0,n.jsx)("div",{className:"flex justify-center px-4 py-0",children:(0,n.jsx)("div",{className:(0,a.cn)("w-full max-w-md rounded-xl border border-[#262626] bg-[#171717] p-6",!t&&"text-center"),children:(0,n.jsx)(f,{canEdit:t,isAdmin:r,onAddVideo:i})})})}function m(e){let{open:t,onOpenChange:r,canEdit:a,isAdmin:o,onAddVideo:s}=e;return(0,n.jsx)(i.lG,{open:t,onOpenChange:r,children:(0,n.jsxs)(i.Cf,{className:"dark sm:max-w-md bg-[#171717] border-[#262626] text-gray-200",children:[(0,n.jsx)(i.c7,{children:(0,n.jsx)(i.L3,{className:"text-white"})}),(0,n.jsx)(f,{canEdit:a,isAdmin:o,onAddVideo:s?()=>{r(!1),s()}:void 0})]})})}},71368:(e,t,r)=>{"use strict";r.d(t,{N:()=>a});var n=r(15711);function a(e,t,r,a){let i=a?a-1:1/0,o=0;return function(a){return(0,n.On)(a)?(e.enter(r),function a(s){return(0,n.On)(s)&&o++<i?(e.consume(s),a):(e.exit(r),t(s))}(a)):t(a)}}},72091:(e,t,r)=>{"use strict";r.d(t,{mU:()=>o});let n=/^v?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?
11:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$/,a=e=>{if("string"!=typeof e)return null;let t=e.trim(),r=n.exec(t);if(!r)return null;let[,a,i,o,s]=r,l=s?s.split(".").map(e=>/^\d+$/.test(e)?Number(e):e):[];return{major:Number(a),minor:Number(i),patch:Number(o),prerelease:l}},i=(e,t)=>{let r="number"==typeof e,n="number"==typeof t;return r&&n?e===t?0:e<t?-1:1:r&&!n?-1:!r&&n?1:e===t?0:e<t?-1:1},o=(e,t)=>{let r="string"==typeof e?a(e):e,n="string"==typeof t?a(t):t;return r&&n?r.major!==n.major?r.major<n.major?-1:1:r.minor!==n.minor?r.minor<n.minor?-1:1:r.patch!==n.patch?r.patch<n.patch?-1:1:((e,t)=>{if(0===e.length&&0===t.length)return 0;if(0===e.length)return 1;if(0===t.length)return -1;let r=Math.max(e.length,t.length);for(let n=0;n<r;n+=1){if(n>=e.length)return -1;if(n>=t.length)return 1;let r=i(e[n],t[n]);if(0!==r)return r}return 0})(r.prerelease,n.prerelease):null}},72389:(e,t,r)=>{"use strict";r.d(t,{O5:()=>p,Tp:()=>y,UL:()=>f,Wt:()=>g,Yk:()=>m,c4:()=>h});var n=r(29454),a=r(88220).Buffer;let i="empara_auth_token",o="token",s="empara_cached_user",l="token";function u(e){if(!e||"string"!=typeof e)return null;let t=e.trim().replace(/^["']|["']$/g,"");return t.length>0?t:null}function c(){return"localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname||window.location.hostname.endsWith(".local")?{expires:1e3,path:"/"}:{expires:1e3,path:"/",domain:".empara.fr"}}function d(e){let t=u(e);if(!t)return null;try{let e=t.split(".");if(e.length<2)return null;let r=e[1].replace(/-/g,"+").replace(/_/g,"/");for(;r.length%4;)r+="=";if("function"==typeof window.atob){let e=window.atob(r),t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);let n=new TextDecoder().decode(t);return JSON.parse(n)}if(void 0!==a){let e=a.from(r,"base64").toString("utf-8");return JSON.parse(e)}return null}catch(e){return null}}function h(){let e=u(n.A.get(l)),t=null;try{t=u(window.localStorage.getItem(i)||window.localStorage.getItem(o))}catch(e){console.warn("[tokenStorage] Erreur lecture localStorage:",e)}if(e){if(t!==e)try{window.localStorage.setItem(i,e),window.localStorage.setItem(o,e);let r=d(t),n=d(e),a=(null==r?void 0:r.sub)||(null==r?void 0:r._id)||(null==r?void 0:r.id)||null,l=(null==n?void 0:n.sub)||(null==n?void 0:n._id)||(null==n?void 0:n.id)||null;a&&l&&String(a)!==String(l)&&window.localStorage.removeItem(s)}catch(e){}return e}if(t){try{n.A.set(l,t,c())}catch(e){}return t}return null}function f(){let e=h();if(!e)return null;let t=d(e);if(t){let e=t.sub||t._id||t.id||t.userId||null;return e?String(e):null}return null}function p(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=u(e);if(!r)return void y();try{n.A.set(l,r,c())}catch(e){console.warn("[tokenStorage] Erreur \xe9criture cookie token:",e)}try{window.localStorage.setItem(i,r),window.localStorage.setItem(o,r)}catch(e){console.warn("[tokenStorage] Erreur \xe9criture token dans localStorage:",e)}t&&"object"==typeof t&&g(t)}function m(){try{let e=window.localStorage.getItem(s);if(!e)return null;return JSON.parse(e)}catch(e){return console.warn("[tokenStorage] Erreur lecture user en cache:",e),null}}function g(e){try{e?window.localStorage.setItem(s,JSON.stringify(e)):window.localStorage.removeItem(s)}catch(e){console.warn("[tokenStorage] Erreur sauvegarde user en cache:",e)}}function y(){!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l;try{n.A.remove(e),n.A.remove(e,{path:"/"}),n.A.remove(e,{path:"/",domain:".empara.fr"}),n.A.remove(e,{path:"/",domain:"empara.fr"}),void 0!==window.location&&window.location.hostname&&n.A.remove(e,{path:"/",domain:window.location.hostname})}catch(e){console.warn("[tokenStorage] Erreur suppression cookie:",e)}}(l);try{window.localStorage.removeItem(i),window.localStorage.removeItem(o),window.localStorage.removeItem(s),window.localStorage.removeItem("circleUrl")}catch(e){console.warn("[tokenStorage] Erreur suppression localStorage:",e)}}},73435:(e,t,r)=>{"use strict";r.d(t,{YR:()=>a});var n=r(982);function a(e,t,r,a){let i,o,s;"function"==typeof t&&"function"!=typeof r?(o=void 0,s=t,i=r):(o=t,s=r,i=a),(0,n.VG)(e,o,function(e,t){let r=t[t.length-1],n=r?r.children.indexOf(e):void 0;return s(e,n,r)},i)}},74206:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});
11let n=(0,r(17963).A)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},74358:(e,t,r)=>{"use strict";r.d(t,{S:()=>a});var n=r(15711);function a(e){return null===e||(0,n.Ee)(e)||(0,n.Ny)(e)?1:(0,n.es)(e)?2:void 0}},74453:(e,t,r)=>{"use strict";r.d(t,{Qd:()=>k,Uf:()=>S});var n=r(14232);let a="emailVerificationSent",i="emailVerificationSentAt",o=Object.freeze({isSending:!1,justSent:!1,error:null,isEmailSent:!1,cooldownSeconds:0}),s=o,l=null,u=!1,c=null,d=new Set,h=()=>{if(!l)return 0;let e=l+99e3-Date.now();return e>0?Math.ceil(e/1e3):0},f=e=>{s={...s,...e},d.forEach(e=>e())},p=()=>{c&&clearInterval(c),c=null},m=()=>{let e=h();e!==s.cooldownSeconds&&f({cooldownSeconds:e}),e<=0&&p()},g=()=>{c||0>=h()||(c=setInterval(m,1e3))},y=()=>{if(!u){u=!0;try{let e=parseInt(sessionStorage.getItem(i),10);l=Number.isFinite(e)?e:null,s={...s,isEmailSent:"true"===sessionStorage.getItem(a),cooldownSeconds:h()}}catch(e){}}},v=()=>{"visible"===document.visibilityState&&m()},w=e=>(d.add(e),1===d.size&&"undefined"!=typeof document&&document.addEventListener("visibilitychange",v),g(),()=>{d.delete(e),0===d.size&&(p(),"undefined"!=typeof document&&document.removeEventListener("visibilitychange",v))}),b=()=>(y(),s),x=()=>o,E=async()=>{if(y(),s.isSending||h()>0)return!1;f({isSending:!0,error:null,justSent:!1});try{let e=await fetch("/api/user/verify-email",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({redirectUrl:window.location.pathname})}),t=await e.json();if(!t.success)return f({isSending:!1,error:t.error||"Une erreur est survenue"}),setTimeout(()=>f({error:null}),5e3),!1;l=Date.now();try{sessionStorage.setItem(a,"true"),sessionStorage.setItem(i,String(l))}catch(e){}return f({isSending:!1,justSent:!0,isEmailSent:!0,cooldownSeconds:h()}),g(),setTimeout(()=>f({justSent:!1}),3e3),!0}catch(e){return f({isSending:!1,error:"Impossible d'envoyer l'email. R\xe9essaie plus tard."}),setTimeout(()=>f({error:null}),5e3),!1}};function S(){let e=(0,n.useSyncExternalStore)(w,b,x),t=(0,n.useCallback)(()=>E(),[]);return{...e,send:t,isDisabled:e.isSending||e.cooldownSeconds>0}}function k(e,t){return e.isSending?"Envoi...":e.cooldownSeconds>0?"Renvoyer (".concat(e.cooldownSeconds,"s)"):t}},74550:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(14232);let a=n.forwardRef(function(e,t){let{title:r,titleId:a,...i}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":a},i),r?n.createElement("title",{id:a},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"}))})},75026:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{getRedirectError:function(){return o},getRedirectStatusCodeFromError:function(){return d},getRedirectTypeFromError:function(){return c},getURLFromRedirectError:function(){return u},permanentRedirect:function(){return l},redirect:function(){return s}});let n=r(46843),a=r(61481),i=void 0;function o(e,t,r){void 0===r&&(r=n.RedirectStatusCode.TemporaryRedirect);let i=Object.defineProperty(Error(a.REDIRECT_ERROR_CODE),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return i.digest=a.REDIRECT_ERROR_CODE+";"+t+";"+e+";"+r+";",i}function s(e,t){var r;throw null!=t||(t=(null==i||null==(r=i.getStore())?void 0:r.isAction)?a.RedirectType.push:a.RedirectType.replace),o(e,t,n.RedirectStatusCode.TemporaryRedirect)}function l(e,t){throw void 0===t&&(t=a.RedirectType.replace),o(e,t,n.RedirectStatusCode.PermanentRedirect)}function u(e){return(0,a.isRedirectError)(e)?e.digest.split(";").slice(2,-2).join(";"):null}function c(e){if(!(0,a.isRedirectError)(e))throw Object.defineProperty(Error("Not a redirect error"),"__NEXT_ERROR_CODE",{value:"E260",enumerable:!1,configurable:!0});return e.digest.split(";",2)[1]}function d(e){if(!(0,a.isRedirectError)(e))throw Object.defineProperty(Error("Not a redirect error"),"__NEXT_ERROR_CODE",{value:"E260",enumerable:!1,
11configurable:!0});return Number(e.digest.split(";").at(-2))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},75433:(e,t,r)=>{"use strict";let n;r.r(t),r.d(t,{cancelMedia:()=>x,capacity:()=>w,clearAllMedia:()=>C,consumeOutcome:()=>D,default:()=>ee,downloadMedia:()=>b,getPlaybackUrl:()=>U,hasMedia:()=>S,isNativeMediaAvailable:()=>p,isOutcomeJournalAvailable:()=>O,listMedia:()=>k,nativeMediaStore:()=>Z,onComplete:()=>$,onFailed:()=>Y,onProgress:()=>K,pendingOutcomes:()=>R,reconcileNativeMedia:()=>P,releasePlaybackUrl:()=>V,removeMedia:()=>E,selftest:()=>J,switchToOfflineShell:()=>X,watchPlaybackUrl:()=>z});var a=r(50900);let i="EmparaOfflineMedia",o="downloadProgress",s="downloadComplete",l="downloadFailed",u="[NativeMediaStore]",c=null,d=!1,h=!1;function f(){if(void 0!==n)return n;let e=!1;try{var t,r,o;e=!!(null==(r=window.Capacitor)||null==(t=r.isNativePlatform)?void 0:t.call(r))||!!(null===a.Ii||void 0===a.Ii||null==(o=a.Ii.isNativePlatform)?void 0:o.call(a.Ii))}catch(t){e=!1}if(!e)return null;if(!function(){let e=null;try{var t;e=(null==(t=window.Capacitor)?void 0:t.PluginHeaders)||(null===a.Ii||void 0===a.Ii?void 0:a.Ii.PluginHeaders)||null}catch(e){return!1}return!!Array.isArray(e)&&e.some(e=>(null==e?void 0:e.name)===i)}())return d||(d=!0,console.warn("".concat(u," Plugin \xab ").concat(i," \xbb absent du binaire install\xe9 : ")+"le stockage m\xe9dia natif est d\xe9sactiv\xe9 (aucun appel ne sera \xe9mis).")),n=null,null;try{return c||(c=(0,a.F3)(i)),n=c}catch(e){return console.warn("".concat(u," Enregistrement du plugin impossible :"),e),n=null,null}}function p(){return null!==f()}async function m(e,t,r){let n=f();if(!n)return r;try{return await t(n)}catch(t){return console.warn("".concat(u," ").concat(e," a \xe9chou\xe9 :"),t),r}}function g(e){let t=Number(e);return Number.isFinite(t)&&t>0?t:0}function y(e){if(null==e||""===e)return null;let t=Number(e);return Number.isFinite(t)?t>0?t:0:null}function v(e){let t=Number(e);return!Number.isFinite(t)||t<=0?null:t<1e11?1e3*t:t}async function w(){let e=await m("capacity()",e=>e.capacity(),null);if(!e)return null;let t=y(e.safeUsableBytes);return null===t?(console.warn("".concat(u," capacity() : mesure inexploitable rendue par le natif :"),e),null):{totalBytes:y(e.totalBytes),freeBytes:y(e.freeBytes),usedByAppBytes:y(e.usedByAppBytes),safeUsableBytes:t}}async function b(){let{id:e,url:t,headers:r,expectedBytes:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=null==e?"":String(e);if(!a||!t)return console.warn("".concat(u," downloadMedia() ignor\xe9 : id ou url manquant.")),null;let i=f();if(!i)return null;let o={id:a,url:String(t)};r&&"object"==typeof r&&(o.headers=r),g(n)>0&&(o.expectedBytes=g(n));try{let e=await i.download(o);return{id:String((null==e?void 0:e.id)||a)}}catch(e){return console.warn("".concat(u," downloadMedia(").concat(a,") refus\xe9 par le natif :"),e),G(l,{id:a,message:(null==e?void 0:e.message)?String(e.message):"T\xe9l\xe9chargement refus\xe9 par le stockage natif",at:null}),null}}async function x(e){let t=null==e?"":String(e);return!!t&&(B(t),m("cancelMedia(".concat(t,")"),async e=>(await e.cancel({id:t}),!0),!1))}async function E(e){let t=null==e?"":String(e);return!!t&&(B(t),m("removeMedia(".concat(t,")"),async e=>(await e.remove({id:t}),!0),!1))}async function S(e){let t=null==e?"":String(e);if(!t)return null;let r=await m("hasMedia(".concat(t,")"),e=>e.has({id:t}),null);if(!r)return null;let n=!!r.exists;return{exists:n,bytes:n?y(r.bytes):0}}async function k(){let e=await m("listMedia()",e=>e.list(),null);return e&&Array.isArray(e.items)?e.items.filter(e=>e&&null!=e.id).map(e=>({id:String(e.id),bytes:g(e.bytes),createdAt:Number.isFinite(Number(e.createdAt))&&Number(e.createdAt)>0?Number(e.createdAt):null})):null}async function P(e){if(null==e||"string"==typeof e||"function"!=typeof e[Symbol.iterator])return{status:"no-inventory"};let t=await k();if(null===t)return{status:"unavailable"};let r=new Set;for(let t of e){let e=null==t?"":String(t);e&&r.add(e)}let n=new Set(t.map(e=>e.id)),a=[],i=[];
11t.forEach(e=>{r.has(e.id)?a.push(e.id):i.push(e)});let o=Array.from(r).filter(e=>!n.has(e)),s=i.reduce((e,t)=>e+g(t.bytes),0);return{status:"reconciled",files:t,matched:a,orphanFiles:i,missingFiles:o,orphanBytes:s}}async function C(){return Array.from(M.values()).forEach(e=>clearTimeout(e)),M.clear(),N.clear(),j.clear(),m("clearAllMedia()",async e=>(await e.clearAll(),!0),!1)}let I="pendingOutcomes",T="consumeOutcome",A=!1;function _(e){let t=null;try{var r;t=(null==(r=window.Capacitor)?void 0:r.PluginHeaders)||(null===a.Ii||void 0===a.Ii?void 0:a.Ii.PluginHeaders)||null}catch(e){return!1}if(!Array.isArray(t))return!1;let n=t.find(e=>(null==e?void 0:e.name)===i),o=n&&Array.isArray(n.methods)?n.methods:null;return!!o&&o.some(t=>(null==t?void 0:t.name)===e)}function O(){return null!==f()&&_(I)&&_(T)}function q(e){let t=(null==e?void 0:e.id)==null?"":String(e.id);if(!t)return null;let r="string"==typeof(null==e?void 0:e.kind)?e.kind.toLowerCase():"",n=null;if("complete"===r||"completed"===r||"success"===r?n="complete":"failed"===r||"failure"===r||"error"===r?n="failed":"boolean"==typeof(null==e?void 0:e.success)&&(n=e.success?"complete":"failed"),!n)return null;let a=v(null==e?void 0:e.at);return{id:t,kind:n,bytes:g(null==e?void 0:e.bytes),message:(null==e?void 0:e.message)?String(e.message):"",at:a}}async function R(){if(!f())return null;if(!_(I))return A||(A=!0,console.warn("".concat(u," Le plugin install\xe9 ne sert pas \xab ").concat(I," \xbb : ")+"les ach\xe8vements survenus hors fen\xeatre d'\xe9coute ne pourront pas \xeatre rattrap\xe9s.")),null;let e=await m("pendingOutcomes()",e=>e[I](),null);return e&&Array.isArray(e.items)?e.items.map(q).filter(Boolean).sort((e,t)=>(e.at||0)-(t.at||0)):null}async function D(e){let{at:t=null}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null==e?"":String(e);if(!r||!f()||!_(T))return!1;let n=Number(t),a={id:r};return Number.isFinite(n)&&n>0&&(a.at=n),m("consumeOutcome(".concat(r,")"),async e=>{let t=await e[T](a);return!t||"object"!=typeof t||!("consumed"in t)||!!t.consumed},!1)}let N=new Map,j=new Map,L=new Map,M=new Map;function B(e){N.delete(e),j.delete(e);let t=M.get(e);t&&(clearTimeout(t),M.delete(e))}async function U(e){let{ttlSeconds:t,forceRefresh:r=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null==e?"":String(e);if(!n)return null;let a=Number.isFinite(Number(t))&&Number(t)>0?Math.round(Number(t)):3600;if(!r){let e=N.get(n);if(e&&e.expiresAt-Date.now()>12e4)return{url:e.url,expiresAt:e.expiresAt}}r&&j.delete(n);let i=await function(e,t){let r=j.get(e);if(r)return r;let n=m("getPlaybackUrl(".concat(e,")"),r=>r.playbackUrl({id:e,ttlSeconds:t}),null).then(r=>{if(j.delete(e),!(null==r?void 0:r.url))return null;let n={url:String(r.url),expiresAt:function(e,t){let r=Date.now()+1e3*t;if(null==e)return r;if("string"==typeof e){let t=Date.parse(e);return Number.isFinite(t)?t:r}let n=Number(e);return!Number.isFinite(n)||n<=0?r:n<1e11?1e3*n:n}(r.expiresAt,t),ttlSeconds:t};return N.set(e,n),F(e),{url:n.url,expiresAt:n.expiresAt}}
11).catch(t=>(j.delete(e),console.warn("".concat(u," Normalisation du bail (").concat(e,") impossible :"),t),null));return j.set(e,n),n}(n,a);if(i)return i;let o=N.get(n);return o&&o.expiresAt>Date.now()?{url:o.url,expiresAt:o.expiresAt}:null}function F(e){let t=M.get(e);t&&(clearTimeout(t),M.delete(e));let r=L.get(e);if(!r||0===r.size)return;let n=N.get(e);if(!n)return;let a=n.expiresAt-Date.now(),i=setTimeout(()=>{M.delete(e);let t=L.get(e);t&&0!==t.size&&U(e,{ttlSeconds:n.ttlSeconds,forceRefresh:!0}).then(t=>{if(!t)return;let r=L.get(e);r&&r.forEach(e=>{try{e(t)}catch(e){console.error("".concat(u," Abonn\xe9 au renouvellement de bail en erreur :"),e)}})}).catch(()=>{})},a>18e4?a-18e4:Math.max(5e3,Math.floor(a/2)));M.set(e,i)}function z(e,t){let r=null==e?"":String(e);if(!r||"function"!=typeof t)return()=>{};let n=L.get(r);return n||(n=new Set,L.set(r,n)),n.add(t),F(r),()=>{let e=L.get(r);if(e&&(e.delete(t),0===e.size)){L.delete(r);let e=M.get(r);e&&(clearTimeout(e),M.delete(r))}}}function V(e){let t=null==e?"":String(e);t&&(L.delete(t),B(t))}let W={[o]:new Set,[s]:new Set,[l]:new Set},H=new Map;function G(e,t){let r=W[e];r&&0!==r.size&&r.forEach(r=>{try{r(t)}catch(t){console.error("".concat(u," Abonn\xe9 \xab ").concat(e," \xbb en erreur :"),t)}})}function Q(e,t){if("function"!=typeof t)return()=>{};let r=W[e];r.add(t),function(e){let t;if(H.has(e))return;let r=f();if(r){var n;let l;if(!function(){let e=null;try{e=window.Capacitor||a.Ii||null}catch(e){return!1}if(!e)return!1;let t=Array.isArray(e.PluginHeaders)?e.PluginHeaders:null,r=t?t.find(e=>(null==e?void 0:e.name)===i):null;if(!r)return!1;let n=(Array.isArray(r.methods)?r.methods:[]).find(e=>(null==e?void 0:e.name)==="addListener");return!!n&&"function"==typeof e["promise"===n.rtype?"nativePromise":"nativeCallback"]}()){h||(h=!0,console.warn("".concat(u," Pont natif incapable de servir \xab addListener \xbb : ")+"les \xe9v\xe9nements de t\xe9l\xe9chargement natifs ne seront pas relay\xe9s."));return}try{t=r.addListener(e,t=>{let r=function(e,t){let r=(null==t?void 0:t.id)==null?"":String(t.id);if(!r)return null;if(e===o){let e=g(t.receivedBytes),n=g(t.totalBytes),a=n>0?Math.min(99,Math.floor(e/n*100)):null;return{id:r,receivedBytes:e,totalBytes:n,percent:a}}return e===s?{id:r,bytes:g(t.bytes),at:v(null==t?void 0:t.at)}:{id:r,message:(null==t?void 0:t.message)?String(t.message):"T\xe9l\xe9chargement \xe9chou\xe9",at:v(null==t?void 0:t.at)}}(e,t);r&&G(e,r)})}catch(t){console.warn("".concat(u," Abonnement natif \xab ").concat(e," \xbb impossible :"),t);return}H.set(e,(n=Promise.resolve(t),l=new Promise(t=>{let r=!1,a=setTimeout(()=>{r||(r=!0,console.warn("".concat(u," Abonnement natif \xab ").concat(e," \xbb sans r\xe9ponse apr\xe8s ")+"".concat(1e4," ms : canal consid\xe9r\xe9 comme non ouvert.")),H.get(e)===l&&H.delete(e),t(null))},1e4);a&&"function"==typeof a.unref&&a.unref();let i=e=>{r||(r=!0,clearTimeout(a),t(e))};n.then(e=>i(e||null),t=>{console.warn("".concat(u," Abonnement natif \xab ").concat(e," \xbb impossible :"),t),H.get(e)===l&&H.delete(e),i(null)})})))}}(e);let n=!1;return()=>{n||(n=!0,r.delete(t),0===r.size&&function(e){let t=H.get(e);t&&(H.delete(e),Promise.resolve(t).then(e=>{var t;return null==e||null==(t=e.remove)?void 0:t.call(e)}).catch(t=>{console.warn("".concat(u," Retrait de l'abonnement natif \xab ").concat(e," \xbb impossible :"),t)}))}(e))}}function K(e){return Q(o,e)}function $(e){return Q(s,t=>{B(t.id),e(t)})}function Y(e){return Q(l,e)}async function J(){let e=p(),t=await m("selftest()",e=>e.selftest(),null);return t?{ok:!!t.ok,checks:Array.isArray(t.checks)?t.checks:[]}:{ok:!1,checks:[],reason:e?"NATIVE_ERROR":"NATIVE_UNAVAILABLE"}}async function X(){try{let e=await m("switchToOfflineShell()",e=>"function"==typeof e.switchToOfflineShell?e.switchToOfflineShell():Promise.resolve(),null);return null!==e}catch(e){return console.error(u,"switchToOfflineShell a \xe9chou\xe9 :",e),!1}}let Z={isAvailable:p,capacity:w,downloadMedia:b,cancelMedia:x,removeMedia:E,hasMedia:S,listMedia:k,reconcileNativeMedia:P,clearAllMedia:C,isOutcomeJournalAvailable:O,pendingOutcomes:R,consumeOutcome:D,getPlaybackUrl:U,watchPlaybackUrl:z,releasePlaybackUrl:V,onProgress:K,onComplete:$,onFailed:Y,selftest:J,switchToOfflineShell:X},ee=Z},77328:(e,t,r)=>{e.exports=r(29269)},77806:(e,t,r)=>{"use strict";r.d(t,{E:()=>o});var n=r(79174),a=r(17315);let i=Object.keys(a);class o extends n.R{constructor(e,t,r,n){let o=-1;if(super(e,t),function(e,t,r){r&&(e[t]=r)}(this,"space",n),"number"==typeof r)for(;++o<i.length;){let e=i[o];!function(e,t,r){r&&(e[t]=r)}(this,i[o],(r&a[e])===a[e])}}}o.prototype.defined=!0},78676:(e,t,r)=>{"use strict";r.d(t,{$:()=>s,A:()=>l});var n=r(37876),a=r(19169),i=r(14232);let o=(0,i.createContext)(),s=()=>(0,i.useContext)(o),l=function(e){let{children:t}=e,[r,s]=(0,i.useState)(!1),[l,u]=(0,i.useState)(!1),[c,d]=(0,i.useState)(!1),[h,f]=(0,i.useState)(""),[p,m]=(0,i.useState)({}),[g,y]=(0,i.useState)({}),[v,w]=(0,i.useState)({}),[b,x]=(0,i.useState)({}),[E,S]=(0,i.useState)({}),[k,P]=(0,i.useState)({}),[C,I]=(0,i.useState)(0),[T,A]=(0,i.useState)([]),[_,O]=(0,i.useState)(0),[q,R]=(0,i.useState)(),[D,N]=(0,i.useState)(!0),j=e=>{e.stopPropagation(),N(!D)};(0,i.useEffect)(()=>
11{if(!h||0===h.trim().length){y({}),I(0),A([]),O(0),w({}),x({}),S({}),P({});return}let e=setTimeout(async()=>{try{var e,t,r,n;R(!0);let i=p&&Object.values(p).some(e=>Array.isArray(e)&&e.length>0),[o,s]=await Promise.all([i?(async()=>{let e={...p,meta_categorie:null==p?void 0:p.categorie};return delete e.categorie,(0,a.fY)(h,e)})():(0,a.$P)(h),(0,a.ng)(h)]);A((null==s?void 0:s.hits)||[]),O((null==s?void 0:s.nbHits)||0),I((null==o?void 0:o.nbHits)||0),w((null==o||null==(e=o.facets)?void 0:e.formation)||{}),x((null==o||null==(t=o.facets)?void 0:t.formateur)||{}),S((null==o||null==(r=o.facets)?void 0:r.meta_categorie)||{}),P((null==o||null==(n=o.facets)?void 0:n.type)||{});let l=((null==o?void 0:o.hits)||[]).reduce((e,t)=>(e[t.formation]?e[t.formation].push(t):e[t.formation]=[t],e),{});y(l)}catch(e){console.error("[SearchContext] Erreur lors de la recherche Algolia:",e)}},300);return()=>{clearTimeout(e)}},[h,p]);let L=(0,i.useCallback)((e,t)=>{var r;(null==p||null==(r=p[t])?void 0:r.includes(e))?m({...p,[t]:p[t].filter(t=>t!==e)}):m({...p,[t]:p[t]?[...p[t],e]:[e]})},[p]),M=(0,i.useMemo)(()=>({sortedFormations:g,setSortedFormations:y,formationsFilters:v,setFormationsFilters:w,trainersFilters:b,setTrainersFilters:x,hitsNumber:C,setHitsNumber:I,searchValue:h,setSearchValue:f,filters:p,handleSelectFilters:L,setCategoriesFilters:S,setTypesFilters:P,typesFilters:k,categoriesFilters:E,pages:T,setPages:A,pagesHits:_,foldFormations:q,setFoldFormations:R,mute:D,handleMute:j,searchMode:l,filterMode:c,setSearchMode:u,setFilterMode:d,showSearchbar:r,setShowSearchbar:s}),[g,y,v,w,b,x,C,I,h,f,p,L,S,P,k,E,T,A,_,q,R,D,j,l,c,u,d,r,s]);return(0,n.jsx)(o.Provider,{value:M,children:t})}},79174:(e,t,r)=>{"use strict";r.d(t,{R:()=>n});class n{constructor(e,t){this.attribute=t,this.property=e}}n.prototype.attribute="",n.prototype.booleanish=!1,n.prototype.boolean=!1,n.prototype.commaOrSpaceSeparated=!1,n.prototype.commaSeparated=!1,n.prototype.defined=!1,n.prototype.mustUseProperty=!1,n.prototype.number=!1,n.prototype.overloadedBoolean=!1,n.prototype.property="",n.prototype.spaceSeparated=!1,n.prototype.space=void 0},79331:(e,t,r)=>{"use strict";function n(){throw Object.defineProperty(Error("`forbidden()` is experimental and only allowed to be enabled when `experimental.authInterrupts` is enabled."),"__NEXT_ERROR_CODE",{value:"E488",enumerable:!1,configurable:!0})}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"forbidden",{enumerable:!0,get:function(){return n}}),r(38811).HTTP_ERROR_FALLBACK_ERROR_CODE,("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},80574:(e,t,r)=>{"use strict";r.d(t,{m:()=>a});let n=/[ \t\n\f\r]/g;function a(e){return"object"==typeof e?"text"===e.type&&i(e.value):i(e)}function i(e){return""===e.replace(n,"")}},81285:(e,t,r)=>{"use strict";r.d(t,{N:()=>a});var n=r(14232),a=globalThis?.document?n.useLayoutEffect:()=>{}},81883:(e,t,r)=>{"use strict";function n(){let e,t,r=new Promise((r,n)=>{e=r,t=n});function n(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=t=>{n({status:"fulfilled",value:t}),e(t)},r.reject=e=>{n({status:"rejected",reason:e}),t(e)},r}r.d(t,{T:()=>n})},82987:(e,t,r)=>{"use strict";r.d(t,{DX:()=>d,TL:()=>c});var n,a=r(14232),i=r(10714),o=r(37876),s=Symbol.for("react.lazy"),l=(n||(n=r.t(a,2)))[" use ".trim().toString()];function u(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===s&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}function c(e){let t=function(e){let t=a.forwardRef((e,t)=>{let{children:r,...n}=e;if(u(r)&&"function"==typeof l&&(r=l(r._payload)),a.isValidElement(r)){var o;let e,s,l=(o=r,(s=(e=Object.getOwnPropertyDescriptor(o.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?o.ref:(s=(e=Object.getOwnPropertyDescriptor(o,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?o.props.ref:o.props.ref||o.ref),u=function(e,t){let r={...t};for(let n in t){let a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...e)=>{let t=i(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...i}
11:"className"===n&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==a.Fragment&&(u.ref=t?(0,i.t)(t,l):l),a.cloneElement(r,u)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}(e),r=a.forwardRef((e,r)=>{let{children:n,...i}=e;u(n)&&"function"==typeof l&&(n=l(n._payload));let s=a.Children.toArray(n),c=s.find(f);if(c){let e=c.props.children,n=s.map(t=>t!==c?t:a.Children.count(e)>1?a.Children.only(null):a.isValidElement(e)?e.props.children:null);return(0,o.jsx)(t,{...i,ref:r,children:a.isValidElement(e)?a.cloneElement(e,void 0,n):null})}return(0,o.jsx)(t,{...i,ref:r,children:n})});return r.displayName=`${e}.Slot`,r}var d=c("Slot"),h=Symbol("radix.slottable");function f(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===h}},83817:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{UnrecognizedActionError:function(){return r},unstable_isUnrecognizedActionError:function(){return n}});class r extends Error{constructor(...e){super(...e),this.name="UnrecognizedActionError"}}function n(e){return!!(e&&"object"==typeof e&&e instanceof r)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},83833:function(e,t,r){"use strict";var n=(this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(r(48945)),a=r(24181);function i(e,t){var r={};return e&&"string"==typeof e&&(0,n.default)(e,function(e,n){e&&n&&(r[(0,a.camelCase)(e,t)]=n)}),r}i.default=i,e.exports=i},84787:(e,t,r)=>{"use strict";r.d(t,{o:()=>a});var n=r(30649);class a extends Error{constructor(e,t,r){super(),"string"==typeof t&&(r=t,t=void 0);let a="",i={},o=!1;if(t&&(i="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?a=e:!i.cause&&e&&(o=!0,a=e.message,i.cause=e),!i.ruleId&&!i.source&&"string"==typeof r){let e=r.indexOf(":");-1===e?i.ruleId=r:(i.source=r.slice(0,e),i.ruleId=r.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let s=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=s?s.line:void 0,this.name=(0,n.L)(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=o&&i.cause&&"string"==typeof i.cause.stack?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}a.prototype.file="",a.prototype.name="",a.prototype.reason="",a.prototype.message="",a.prototype.stack="",a.prototype.column=void 0,a.prototype.line=void 0,a.prototype.ancestors=void 0,a.prototype.cause=void 0,a.prototype.fatal=void 0,a.prototype.place=void 0,a.prototype.ruleId=void 0,a.prototype.source=void 0},84862:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var n=r(14232);let a=n.forwardRef(function(e,t){let{title:r,titleId:a,...i}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":a},i),r?n.createElement("title",{id:a},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 10.5v6m3-3H9m4.06-7.19-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"}))})},85583:(e,t,r)=>{"use strict";r.d(t,{s:()=>a});let n=document.createElement("i");function a(e){let t="&"+e+";";n.innerHTML=t;let r=n.textContent;return(59!==r.charCodeAt(r.length-1)||"semi"===e)&&r!==t&&r}},86324:(e,t,r)=>{"use strict";r.d(t,{A:()=>H});var n,a,i=r(4902),o=r(14232),s="right-scroll-bar-position",l="width-before-scroll-bar";function u(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var c="undefined"!=typeof window?o.useLayoutEffect:o.useEffect,d=new WeakMap;function h(e){return e}var f=function(e){void 0===e&&(e={});var t,r,n,a=(void 0===t&&(t=h),r=[],n=!1,{read:function(){if(n)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:null},useMedium:function(e){var a=t(e,n);return r.push(a),function(){r=r.filter(function(e){return e!==a})}},assignSyncMedium:function(e){for(n=!0;r.length;){var t=r;r=[],t.forEach(e)}r={push:function(t){return e(t)},filter:function(){return r}}},assignMedium:function(e){n=!0;var t=[];if(r.length){var a=r;r=[],a.forEach(e),t=r}var i=function(){var r=t;t=[],r.forEach(e)},o=function(){return Promise.resolve().then(i)};o(),r={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),r}}}});return a.options=(0,i.Cl)({async:!0,ssr:!1},e),a}(),p=function(){},m=o.forwardRef(function(e,t){var r,n,a,s,l=o.useRef(null),h=o.useState({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:p}),m=h[0],g=h[1],y=e.forwardProps,v=e.children,w=e.className,b=e.removeScrollBar,x=e.enabled,E=e.shards,S=e.sideCar,k=e.noRelative,P=e.noIsolation,C=e.inert,I=e.allowPinchZoom,T=e.as,A=e.gapMode,_=(0,i.Tt)(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=(r=[l,t],n=function(e){return r.forEach(function(t){return u(t,e)})},(a=(0,o.useState)(function(){return{value:null,callback:n,facade:{get current(){return a.value},set current(value){var e=a.value;e!==value&&(a.value=value,a.callback(value,e))}}}})[0]).callback=n,s=a.facade,c(function(){var e=d.get(s);if(e){var t=new Set(e),n=new Set(r),a=s.current;t.forEach(function(e){n.has(e)||u(e,null)}
11),n.forEach(function(e){t.has(e)||u(e,a)})}d.set(s,r)},[r]),s),q=(0,i.Cl)((0,i.Cl)({},_),m);return o.createElement(o.Fragment,null,x&&o.createElement(S,{sideCar:f,removeScrollBar:b,shards:E,noRelative:k,noIsolation:P,inert:C,setCallbacks:g,allowPinchZoom:!!I,lockRef:l,gapMode:A}),y?o.cloneElement(o.Children.only(v),(0,i.Cl)((0,i.Cl)({},q),{ref:O})):o.createElement(void 0===T?"div":T,(0,i.Cl)({},q,{className:w,ref:O}),v))});m.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},m.classNames={fullWidth:l,zeroRight:s};var g=function(e){var t=e.sideCar,r=(0,i.Tt)(e,["sideCar"]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw Error("Sidecar medium not found");return o.createElement(n,(0,i.Cl)({},r))};g.isSideCarExport=!0;var y=function(){var e=0,t=null;return{add:function(n){if(0==e&&(t=function(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=a||r.nc;return t&&e.setAttribute("nonce",t),e}())){var i,o;(i=t).styleSheet?i.styleSheet.cssText=n:i.appendChild(document.createTextNode(n)),o=t,(document.head||document.getElementsByTagName("head")[0]).appendChild(o)}e++},remove:function(){--e||!t||(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},v=function(){var e=y();return function(t,r){o.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},w=function(){var e=v();return function(t){return e(t.styles,t.dynamic),null}},b={left:0,top:0,right:0,gap:0},x=function(e){return parseInt(e||"",10)||0},E=function(e){var t=window.getComputedStyle(document.body),r=t["padding"===e?"paddingLeft":"marginLeft"],n=t["padding"===e?"paddingTop":"marginTop"],a=t["padding"===e?"paddingRight":"marginRight"];return[x(r),x(n),x(a)]},S=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return b;var t=E(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},k=w(),P="data-scroll-locked",C=function(e,t,r,n){var a=e.left,i=e.top,o=e.right,u=e.gap;return void 0===r&&(r="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(n,";\n padding-right: ").concat(u,"px ").concat(n,";\n }\n body[").concat(P,"] {\n overflow: hidden ").concat(n,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(n,";"),"margin"===r&&"\n padding-left: ".concat(a,"px;\n padding-top: ").concat(i,"px;\n padding-right: ").concat(o,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(u,"px ").concat(n,";\n "),"padding"===r&&"padding-right: ".concat(u,"px ").concat(n,";")].filter(Boolean).join(""),"\n }\n \n .").concat(s," {\n right: ").concat(u,"px ").concat(n,";\n }\n \n .").concat(l," {\n margin-right: ").concat(u,"px ").concat(n,";\n }\n \n .").concat(s," .").concat(s," {\n right: 0 ").concat(n,";\n }\n \n .").concat(l," .").concat(l," {\n margin-right: 0 ").concat(n,";\n }\n \n body[").concat(P,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(u,"px;\n }\n")},I=function(){var e=parseInt(document.body.getAttribute(P)||"0",10);return isFinite(e)?e:0},T=function(){o.useEffect(function(){return document.body.setAttribute(P,(I()+1).toString()),function(){var e=I()-1;e<=0?document.body.removeAttribute(P):document.body.setAttribute(P,e.toString())}},[])},A=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,a=void 0===n?"margin":n;T();var i=o.useMemo(function(){return S(a)},[a]);return o.createElement(k,{styles:C(i,!t,a,r?"":"!important")})},_=!1;if("undefined"!=typeof window)try{var O=Object.defineProperty({},"passive",{get:function(){return _=!0,!0}});window.addEventListener("test",O,O),window.removeEventListener("test",O,O)}catch(e){_=!1}var q=!!_&&{passive:!1},R=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return"hidden"!==r[t]&&(r.overflowY!==r.overflowX||"TEXTAREA"===e.tagName||"visible"!==r[t])},D=function(e,t){var r=t.ownerDocument,n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),N(e,n
11)){var a=j(e,n);if(a[1]>a[2])return!0}n=n.parentNode}while(n&&n!==r.body);return!1},N=function(e,t){return"v"===e?R(t,"overflowY"):R(t,"overflowX")},j=function(e,t){return"v"===e?[t.scrollTop,t.scrollHeight,t.clientHeight]:[t.scrollLeft,t.scrollWidth,t.clientWidth]},L=function(e,t,r,n,a){var i,o=(i=window.getComputedStyle(t).direction,"h"===e&&"rtl"===i?-1:1),s=o*n,l=r.target,u=t.contains(l),c=!1,d=s>0,h=0,f=0;do{if(!l)break;var p=j(e,l),m=p[0],g=p[1]-p[2]-o*m;(m||g)&&N(e,l)&&(h+=g,f+=m);var y=l.parentNode;l=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!u&&l!==document.body||u&&(t.contains(l)||t===l));return d&&(a&&1>Math.abs(h)||!a&&s>h)?c=!0:!d&&(a&&1>Math.abs(f)||!a&&-s>f)&&(c=!0),c},M=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},B=function(e){return[e.deltaX,e.deltaY]},U=function(e){return e&&"current"in e?e.current:e},F=0,z=[];let V=(n=function(e){var t=o.useRef([]),r=o.useRef([0,0]),n=o.useRef(),a=o.useState(F++)[0],s=o.useState(w)[0],l=o.useRef(e);o.useEffect(function(){l.current=e},[e]),o.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var t=(0,i.fX)([e.lockRef.current],(e.shards||[]).map(U),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var u=o.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!l.current.allowPinchZoom;var a,i=M(e),o=r.current,s="deltaX"in e?e.deltaX:o[0]-i[0],u="deltaY"in e?e.deltaY:o[1]-i[1],c=e.target,d=Math.abs(s)>Math.abs(u)?"h":"v";if("touches"in e&&"h"===d&&"range"===c.type)return!1;var h=D(d,c);if(!h)return!0;if(h?a=d:(a="v"===d?"h":"v",h=D(d,c)),!h)return!1;if(!n.current&&"changedTouches"in e&&(s||u)&&(n.current=a),!a)return!0;var f=n.current||a;return L(f,t,e,"h"===f?s:u,!0)},[]),c=o.useCallback(function(e){if(z.length&&z[z.length-1]===s){var r="deltaY"in e?B(e):M(e),n=t.current.filter(function(t){var n;return t.name===e.type&&(t.target===e.target||e.target===t.shadowParent)&&(n=t.delta,n[0]===r[0]&&n[1]===r[1])})[0];if(n&&n.should){e.cancelable&&e.preventDefault();return}if(!n){var a=(l.current.shards||[]).map(U).filter(Boolean).filter(function(t){return t.contains(e.target)});(a.length>0?u(e,a[0]):!l.current.noIsolation)&&e.cancelable&&e.preventDefault()}}},[]),d=o.useCallback(function(e,r,n,a){var i={name:e,delta:r,target:n,should:a,shadowParent:function(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}(n)};t.current.push(i),setTimeout(function(){t.current=t.current.filter(function(e){return e!==i})},1)},[]),h=o.useCallback(function(e){r.current=M(e),n.current=void 0},[]),f=o.useCallback(function(t){d(t.type,B(t),t.target,u(t,e.lockRef.current))},[]),p=o.useCallback(function(t){d(t.type,M(t),t.target,u(t,e.lockRef.current))},[]);o.useEffect(function(){return z.push(s),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",c,q),document.addEventListener("touchmove",c,q),document.addEventListener("touchstart",h,q),function(){z=z.filter(function(e){return e!==s}),document.removeEventListener("wheel",c,q),document.removeEventListener("touchmove",c,q),document.removeEventListener("touchstart",h,q)}},[]);var m=e.removeScrollBar,g=e.inert;return o.createElement(o.Fragment,null,g?o.createElement(s,{styles:"\n .block-interactivity-".concat(a," {pointer-events: none;}\n .allow-interactivity-").concat(a," {pointer-events: all;}\n")}):null,m?o.createElement(A,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},f.useMedium(n),g);var W=o.forwardRef(function(e,t){return o.createElement(m,(0,i.Cl)({},e,{ref:t,sideCar:V}))});W.classNames=m.classNames;let H=W},86581:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"LoadableContext",{enumerable:!0,get:function(){return n}});let n=r(72687)._(r(14232)).default.createContext(null)},87072:(e,t,r)=>{"use strict";r.d(t,{A:()=>v});var n=r(37876),a=r(48230),i=r.n(a),o=r(53568),s=r(45195),l=r(53529),u=r.n(l);let c={primary:u().Primary,secondary:u().Secondary},d={display:"inline-flex",verticalAlign:"middle",margin:"0.15rem 0.35rem",textDecoration:"none"};function h(e){let{children:t}=e;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:u().SpanTransition}),(0,n.jsx)("div",{className:u().Text,children:t})]})}var f=r(14232),p=r(1859),m=r.n(p);function g(e){let{endDate:t}=e,[r,a]=(0,f.useState)(null);if((0,f.useEffect)(()=>
11{if(!t)return void a(null);let e=function(e){if(!e||"string"!=typeof e)return null;let[t,r=""]=e.split("T"),[n,a,i]=t.split("-").map(Number),[o=0,s=0,l=0]=r.split(":").map(Number);if(!n||!a||!i)return null;let u=Date.UTC(n,a-1,i,o,s,l),c=function(e){let t=new Intl.DateTimeFormat("en-US",{timeZone:"Europe/Paris",hour12:!1,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).formatToParts(e).reduce((e,t)=>("literal"!==t.type&&(e[t.type]=t.value),e),{}),r="24"===t.hour?0:Number(t.hour);return Date.UTC(Number(t.year),Number(t.month)-1,Number(t.day),r,Number(t.minute),Number(t.second))-e.getTime()}(new Date(u));return u-c}(t),r=()=>{if(null==e)return null;let t=e-Date.now();return t>0?{days:Math.floor(t/864e5),hours:Math.floor(t/36e5%24),minutes:Math.floor(t/1e3/60%60),seconds:Math.floor(t/1e3%60)}:null};a(r());let n=setInterval(()=>{a(r())},1e3);return()=>clearInterval(n)},[t]),!r)return null;let i=r.days>0;return(0,n.jsxs)("div",{className:m().countdown,children:[i&&(0,n.jsxs)("div",{className:m().timeBlock,children:[String(r.days).padStart(2,"0"),(0,n.jsx)("span",{className:m().timeLabel,children:"j"})]}),(0,n.jsxs)("div",{className:m().timeBlock,children:[String(r.hours).padStart(2,"0"),(0,n.jsx)("span",{className:m().timeLabel,children:"h"})]}),(0,n.jsxs)("div",{className:m().timeBlock,children:[String(r.minutes).padStart(2,"0"),(0,n.jsx)("span",{className:m().timeLabel,children:"m"})]}),(0,n.jsxs)("div",{className:m().timeBlock,children:[String(r.seconds).padStart(2,"0"),(0,n.jsx)("span",{className:m().timeLabel,children:"s"})]})]})}var y=r(69050);function v(e){let{banner:t,onDismiss:r}=e;t.basicId||t._id;let a=(0,y.rT)(t),l={backgroundColor:t.backgroundColor,color:t.textColor},f=(0,n.jsx)("div",{className:m().banner,style:l,children:(0,n.jsxs)("div",{className:m().container,children:[(0,n.jsx)("div",{className:m().content,children:(0,n.jsx)(o.oz,{components:function(e){let{textColor:t,asSpan:r=!1}=e,a={color:t,textDecoration:"underline",fontWeight:"bold"};return{a:e=>{let{node:t,href:i,title:o,children:l}=e,f="primary"===o||"secondary"===o?o:null;if(f){let e=(0,s.cn)(c[f]||u().Secondary,u().small);return r?(0,n.jsx)("span",{className:e,style:d,children:(0,n.jsx)(h,{children:l})}):(0,n.jsx)("a",{className:e,href:i,target:"_blank",rel:"noopener noreferrer",style:d,children:(0,n.jsx)(h,{children:l})})}return r?(0,n.jsx)("span",{style:a,children:l}):(0,n.jsx)("a",{href:i,target:"_blank",rel:"noopener noreferrer",style:a,children:l})},p:e=>{let{node:t,children:r,...a}=e;return(0,n.jsx)("p",{...a,children:r})},strong:e=>{let{node:t,...r}=e;return(0,n.jsx)("strong",{...r})},em:e=>{let{node:t,...r}=e;return(0,n.jsx)("em",{...r})},br:e=>{let{node:t,...r}=e;return(0,n.jsx)("br",{...r})}}}({textColor:t.textColor,asSpan:!!t.link}),children:t.content})}),a&&(0,n.jsx)(g,{endDate:a})]})});return t.link?t.link.startsWith("http")?(0,n.jsx)("a",{href:t.link,target:"_blank",rel:"noopener noreferrer",className:m().bannerLink,children:f}):(0,n.jsx)(i(),{href:t.link,className:m().bannerLink,children:f}):f}},88220:e=>{!function(){var t={675:function(e,t){"use strict";t.byteLength=function(e){var t=l(e),r=t[0],n=t[1];return(r+n)*3/4-n},t.toByteArray=function(e){var t,r,i=l(e),o=i[0],s=i[1],u=new a((o+s)*3/4-s),c=0,d=s>0?o-4:o;for(r=0;r<d;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],u[c++]=t>>16&255,u[c++]=t>>8&255,u[c++]=255&t;return 2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[c++]=255&t),1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t),u},t.fromByteArray=function(e){for(var t,n=e.length,a=n%3,i=[],o=0,s=n-a;o<s;o+=16383)i.push(function(e,t,n){for(var a,i=[],o=t;o<n;o+=3)a=(e[o]<<16&0xff0000)+(e[o+1]<<8&65280)+(255&e[o+2]),i.push(r[a>>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return i.join("")}(e,o,o+16383>s?s:o+16383));return 1===a?i.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===a&&i.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),i.join("")};for(var r=[],n=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
vendor: 18,999 bytes, line 11
11+/",o=0,s=i.length;o<s;++o)r[o]=i[o],n[i.charCodeAt(o)]=o;function l(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}n[45]=62,n[95]=63},72:function(e,t,r){"use strict";var n=r(675),a=r(783),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function o(e){if(e>0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,s.prototype),t}function s(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return c(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e){var n=e,a=t;if(("string"!=typeof a||""===a)&&(a="utf8"),!s.isEncoding(a))throw TypeError("Unknown encoding: "+a);var i=0|f(n,a),l=o(i),u=l.write(n,a);return u!==i&&(l=l.slice(0,u)),l}if(ArrayBuffer.isView(e))return d(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(A(e,ArrayBuffer)||e&&A(e.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(A(e,SharedArrayBuffer)||e&&A(e.buffer,SharedArrayBuffer)))return function(e,t,r){var n;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),s.prototype),n}(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var c=e.valueOf&&e.valueOf();if(null!=c&&c!==e)return s.from(c,t,r);var p=function(e){if(s.isBuffer(e)){var t=0|h(e.length),r=o(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||function(e){return e!=e}(e.length)?o(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(p)return p;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return s.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return u(e),o(e<0?0:0|h(e))}function d(e){for(var t=e.length<0?0:0|h(e.length),r=o(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}t.Buffer=s,t.SlowBuffer=function(e){return+e!=e&&(e=0),s.alloc(+e)},t.INSPECT_MAX_BYTES=50,t.kMaxLength=0x7fffffff,s.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),s.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),s.poolSize=8192,s.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array),s.alloc=function(e,t,r){return(u(e),e<=0)?o(e):void 0!==t?"string"==typeof r?o(e).fill(t,r):o(e).fill(t):o(e)},s.allocUnsafe=function(e){return c(e)},s.allocUnsafeSlow=function(e){return c(e)};function h(e){if(e>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function f(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||A(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var a=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return P(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return I(e).length;default:if(a)return n?-1:P(e).length;t=(""+t).toLowerCase(),a=!0}}function p(e,t,r){var a,i,o,s=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var a="",i=t;i<r;++i)a+=_[e[i]];return a}(this,t,r);case"utf8":case"utf-8":return v(this,t,r);case"ascii":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var a=t;a<r;++a)n+=String.fromCharCode(127&e[a]);return n}(this,t,r);case"latin1":case"binary":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var a=t;a<r;++a)n+=String.fromCharCode(e[a]);return n}(this,t,r);case"base64":return a=this,i=t,o=r,0===i&&o===a.length?n.fromByteArray(a):n.fromByteArray(a.slice(i,o));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,r){for(var n=e.slice(t,r),a="",i=0;i<n.length;i+=2)a+=String.fromCharCode(n[i]+256*n[i+1]);return a}(this,t,r);default:if(s)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),s=!0}}function m(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function g(e,t,r,n,a){var i;if(0===e.length)return -1;if("string"==typeof r?(n=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(i=r*=1)!=i&&(r=a?0:e.length-1),r<0&&(r=e.length+r),r>=e.length)if(a)return -1;else r=e.length-1;else if(r<0)if(!a)return -1;else r=0;if("string"==typeof t&&(t=s.from(t,n)),s.isBuffer(t))return 0===t.length?-1:y(e,t,r,n,a);if("number"==typeof t){if(t&=255,"function"==typeof Uint8Array.prototype.indexOf)if(a)return Uint8Array.prototype.indexOf.call(e,t,r);else return Uint8Array.prototype.lastIndexOf.call(e,t,r);return y(e,[t],r,n,a)}throw TypeError("val must be string, number or Buffer")}function y(e,t,r,n,a){var i,o=1,s=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;o=2,s/=2,l/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(a){var c=-1;for(i=r;i<s;i++)if(u(e,i)===u(t,-1===c?0:i-c)){if(-1===c&&(c=i),i-c+1===l)return c*o}else -1!==c&&(i-=i-c),c=-1}else for(r+l>s&&(r=s-l),i=r;i>=0;i--){for(var d=!0,h=0;h<l;h++)if(u(e,i+h)!==u(t,h)){d=!1;break}if(d)return i}return -1}s.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==s.prototype},s.compare=function(e,t){if(A(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),A(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,a=0,i=Math.min(r,n);a<i;++a)if(e[a]!==t[a]){r=e[a],n=t[a];break}return r<n?-1:+(n<r)},s.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(e,t){if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return s.alloc(0);if(void 0===t)for(r=0,t=0;r<e.length;++r)t+=e[r].length;var r,n=s.allocUnsafe(t),a=0;for(r=0;r<e.length;++r){var i=e[r];if(A(i,Uint8Array)&&(i=s.from(i)),!s.isBuffer(i))throw TypeError('"list" argument must be an Array of Buffers');i.copy(n,a),a+=i.length}return n},s.byteLength=f,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)m(this,t,t+1);return this},s.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},s.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},s.prototype.toString=function(){var e=this.length;return 0===e?"":0==arguments.length?v(this,0,e):p.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(e){if(!s.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===s.compare(this,e)},s.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},i&&(s.prototype[i]=s.prototype.inspect),s.prototype.compare=function(e,t,r,n,a){if(A(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===a&&(a=this.length),t<0||r>e.length||n<0||a>this.length)throw RangeError("out of range index");if(n>=a&&t>=r)return 0;if(n>=a)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,a>>>=0,this===e)return 0;for(var i=a-n,o=r-t,l=Math.min(i,o),u=this.slice(n,a),c=e.slice(t,r),d=0;d<l;++d)if(u[d]!==c[d]){i=u[d],o=c[d];break}return i<o?-1:+(o<i)},s.prototype.includes=function(e,t,r){return -1!==this.indexOf(e,t,r)},s.prototype.indexOf=function(e,t,r){return g(this,e,t,r,!0)},s.prototype.lastIndexOf=function(e,t,r){return g(this,e,t,r,!1)};function v(e,t,r){r=Math.min(e.length,r);for(var n=[],a=t;a<r;){var i,o,s,l,u=e[a],c=null,d=u>239?4:u>223?3:u>191?2:1;if(a+d<=r)switch(d){case 1:u<128&&(c=u);break;case 2:(192&(i=e[a+1]))==128&&(l=(31&u)<<6|63&i)>127&&(c=l);break;case 3:i=e[a+1],o=e[a+2],(192&i)==128&&(192&o)==128&&(l=(15&u)<<12|(63&i)<<6|63&o)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:i=e[a+1],o=e[a+2],s=e[a+3],(192&i)==128&&(192&o)==128&&(192&s)==128&&(l=(15&u)<<18|(63&i)<<12|(63&o)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,d=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),a+=d}var h=n,f=h.length;if(f<=4096)return String.fromCharCode.apply(String,h);for(var p="",m=0;m<f;)p+=String.fromCharCode.apply(String,h.slice(m,m+=4096));return p}function w(e,t,r){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}function b(e,t,r,n,a,i){if(!s.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>a||t<i)throw RangeError('"value" argument is out of bounds');if(r+n>e.length)throw RangeError("Index out of range")}function x(e,t,r,n,a,i){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function E(e,t,r,n,i){return t*=1,r>>>=0,i||x(e,t,r,4,34028234663852886e22,-34028234663852886e22),a.write(e,t,r,n,23,4),r+4}function S(e,t,r,n,i){return t*=1,r>>>=0,i||x(e,t,r,8,17976931348623157e292,-17976931348623157e292),a.write(e,t,r,n,52,8),r+8}s.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var a,i,o,s,l,u,c,d,h=this.length-t;if((void 0===r||r>h)&&(r=h),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var f=!1;;)switch(n){case"hex":return function(e,t,r,n){r=Number(r)||0;var a=e.length-r;n?(n=Number(n))>a&&(n=a):n=a;var i=t.length;n>i/2&&(n=i/2);for(var o=0;o<n;++o){var s,l=parseInt(t.substr(2*o,2),16);if((s=l)!=s)break;e[r+o]=l}return o}(this,e,t,r);case"utf8":case"utf-8":return a=t,i=r,T(P(e,this.length-a),this,a,i);case"ascii":return o=t,s=r,T(C(e),this,o,s);case"latin1":case"binary":return function(e,t,r,n){return T(C(t),e,r,n)}(this,e,t,r);case"base64":return l=t,u=r,T(I(e),this,l,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c=t,d=r,T(function(e,t){for(var r,n,a=[],i=0;i<e.length&&!((t-=2)<0);++i)n=(r=e.charCodeAt(i))>>8,a.push(r%256),a.push(n);return a}(e,this.length-c),this,c,d);default:if(f)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),f=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},s.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,s.prototype),n},s.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);for(var n=this[e],a=1,i=0;++i<t&&(a*=256);)n+=this[e+i]*a;return n},s.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);for(var n=this[e+--t],a=1;t>0&&(a*=256);)n+=this[e+--t]*a;return n},s.prototype.readUInt8=function(e,t){return e>>>=0,t||w(e,1,this.length),this[e]},s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||w(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||w(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||w(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||w(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);for(var n=this[e],a=1,i=0;++i<t&&(a*=256);)n+=this[e+i]*a;return n>=(a*=128)&&(n-=Math.pow(2,8*t)),n},s.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);for(var n=t,a=1,i=this[e+--n];n>0&&(a*=256);)i+=this[e+--n]*a;return i>=(a*=128)&&(i-=Math.pow(2,8*t)),i},s.prototype.readInt8=function(e,t){return(e>>>=0,t||w(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||w(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},s.prototype.readInt16BE=function(e,t){e>>>=0,t||w(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||w(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||w(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readFloatLE=function(e,t){return e>>>=0,t||w(e,4,this.length),a.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||w(e,4,this.length),a.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||w(e,8,this.length),a.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||w(e,8,this.length),a.read(this,e,!1,52,8)},s.prototype.writeUIntLE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){var a=Math.pow(2,8*r)-1;b(this,e,t,r,a,0)}var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},s.prototype.writeUIntBE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){var a=Math.pow(2,8*r)-1;b(this,e,t,r,a,0)}var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},s.prototype.writeUInt8=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,1,255,0),this[t]=255&e,t+1},s.prototype.writeUInt16LE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeUInt16BE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeUInt32LE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},s.prototype.writeUInt32BE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeIntLE=function(e,t,r,n){if(e*=1,t>>>=0,!n){var a=Math.pow(2,8*r-1);b(this,e,t,r,a-1,-a)}var i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o|0)-s&255;return t+r},s.prototype.writeIntBE=function(e,t,r,n){if(e*=1,t>>>=0,!n){var a=Math.pow(2,8*r-1);b(this,e,t,r,a-1,-a)}var i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o|0)-s&255;return t+r},s.prototype.writeInt8=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeInt32LE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,r){return e*=1,t>>>=0,r||b(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeFloatLE=function(e,t,r){return E(this,e,t,!0,r)},s.prototype.writeFloatBE=function(e,t,r){return E(this,e,t,!1,r)},s.prototype.writeDoubleLE=function(e,t,r){return S(this,e,t,!0,r)},s.prototype.writeDoubleBE=function(e,t,r){return S(this,e,t,!1,r)},s.prototype.copy=function(e,t,r,n){if(!s.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var a=n-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,n);else if(this===e&&r<t&&t<n)for(var i=a-1;i>=0;--i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return a},s.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){var a,i=e.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(e=i)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a<r;++a)this[a]=e;else{var o=s.isBuffer(e)?e:s.from(e,n),l=o.length;
11if(0===l)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(a=0;a<r-t;++a)this[a+t]=o[a%l]}return this};var k=/[^+/0-9A-Za-z-_]/g;function P(e,t){t=t||1/0;for(var r,n=e.length,a=null,i=[],o=0;o<n;++o){if((r=e.charCodeAt(o))>55295&&r<57344){if(!a){if(r>56319||o+1===n){(t-=3)>-1&&i.push(239,191,189);continue}a=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),a=r;continue}r=(a-55296<<10|r-56320)+65536}else a&&(t-=3)>-1&&i.push(239,191,189);if(a=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return i}function C(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function I(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(k,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function T(e,t,r,n){for(var a=0;a<n&&!(a+r>=t.length)&&!(a>=e.length);++a)t[a+r]=e[a];return a}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var _=function(){for(var e="0123456789abcdef",t=Array(256),r=0;r<16;++r)for(var n=16*r,a=0;a<16;++a)t[n+a]=e[r]+e[a];return t}()},783:function(e,t){t.read=function(e,t,r,n,a){var i,o,s=8*a-n-1,l=(1<<s)-1,u=l>>1,c=-7,d=r?a-1:0,h=r?-1:1,f=e[t+d];for(d+=h,i=f&(1<<-c)-1,f>>=-c,c+=s;c>0;i=256*i+e[t+d],d+=h,c-=8);for(o=i&(1<<-c)-1,i>>=-c,c+=n;c>0;o=256*o+e[t+d],d+=h,c-=8);if(0===i)i=1-u;else{if(i===l)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,n),i-=u}return(f?-1:1)*o*Math.pow(2,i-n)},t.write=function(e,t,r,n,a,i){var o,s,l,u=8*i-a-1,c=(1<<u)-1,d=c>>1,h=5960464477539062e-23*(23===a),f=n?0:i-1,p=n?1:-1,m=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(s=+!!isNaN(t),o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+d>=1?t+=h/l:t+=h*Math.pow(2,1-d),t*l>=2&&(o++,l/=2),o+d>=c?(s=0,o=c):o+d>=1?(s=(t*l-1)*Math.pow(2,a),o+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,a),o=0));a>=8;e[r+f]=255&s,f+=p,s/=256,a-=8);for(o=o<<a|s,u+=a;u>0;e[r+f]=255&o,f+=p,o/=256,u-=8);e[r+f-p]|=128*m}}},r={};function n(e){var a=r[e];if(void 0!==a)return a.exports;var i=r[e]={exports:{}},o=!0;try{t[e](i,i.exports,n),o=!1}finally{o&&delete r[e]}return i.exports}n.ab="//",e.exports=n(72)}()},88367:(e,t,r)=>{"use strict";r.d(t,{qy:()=>y,JW:()=>v});class n{constructor(e,t,r){this.normal=t,this.property=e,r&&(this.space=r)}}function a(e,t){let r={},a={};for(let t of e)Object.assign(r,t.property),Object.assign(a,t.normal);return new n(r,a,t)}n.prototype.normal={},n.prototype.property={},n.prototype.space=void 0;var i=r(93e3),o=r(77806);function s(e){let t={},r={};for(let[n,a]of Object.entries(e.properties)){let s=new o.E(n,e.transform(e.attributes||{},n),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(n)&&(s.mustUseProperty=!0),t[n]=s,r[(0,i.S)(n)]=n,r[(0,i.S)(s.attribute)]=n}return new n(t,r,e.space)}var l=r(17315);let u=s({properties:{ariaActiveDescendant:null,ariaAtomic:l.booleanish,ariaAutoComplete:null,ariaBusy:l.booleanish,ariaChecked:l.booleanish,ariaColCount:l.number,ariaColIndex:l.number,ariaColSpan:l.number,ariaControls:l.spaceSeparated,ariaCurrent:null,ariaDescribedBy:l.spaceSeparated,ariaDetails:null,ariaDisabled:l.booleanish,ariaDropEffect:l.spaceSeparated,ariaErrorMessage:null,ariaExpanded:l.booleanish,ariaFlowTo:l.spaceSeparated,ariaGrabbed:l.booleanish,ariaHasPopup:null,ariaHidden:l.booleanish,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:l.spaceSeparated,ariaLevel:l.number,ariaLive:null,ariaModal:l.booleanish,ariaMultiLine:l.booleanish,ariaMultiSelectable:l.booleanish,ariaOrientation:null,ariaOwns:l.spaceSeparated,ariaPlaceholder:null,ariaPosInSet:l.number,ariaPressed:l.booleanish,ariaReadOnly:l.booleanish,ariaRelevant:null,ariaRequired:l.booleanish,ariaRoleDescription:l.spaceSeparated,ariaRowCount:l.number,ariaRowIndex:l.number,ariaRowSpan:l.number,ariaSelected:l.booleanish,ariaSetSize:l.number,ariaSort:null,ariaValueMax:l.number,ariaValueMin:l.number,ariaValueNow:l.number,ariaValueText:null,role:null},transform:(e,t)=>
11"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function c(e,t){return t in e?e[t]:t}function d(e,t){return c(e,t.toLowerCase())}let h=s({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:l.commaSeparated,acceptCharset:l.spaceSeparated,accessKey:l.spaceSeparated,action:null,allow:null,allowFullScreen:l.boolean,allowPaymentRequest:l.boolean,allowUserMedia:l.boolean,alt:null,as:null,async:l.boolean,autoCapitalize:null,autoComplete:l.spaceSeparated,autoFocus:l.boolean,autoPlay:l.boolean,blocking:l.spaceSeparated,capture:null,charSet:null,checked:l.boolean,cite:null,className:l.spaceSeparated,cols:l.number,colSpan:null,content:null,contentEditable:l.booleanish,controls:l.boolean,controlsList:l.spaceSeparated,coords:l.number|l.commaSeparated,crossOrigin:null,data:null,dateTime:null,decoding:null,default:l.boolean,defer:l.boolean,dir:null,dirName:null,disabled:l.boolean,download:l.overloadedBoolean,draggable:l.booleanish,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:l.boolean,formTarget:null,headers:l.spaceSeparated,height:l.number,hidden:l.overloadedBoolean,high:l.number,href:null,hrefLang:null,htmlFor:l.spaceSeparated,httpEquiv:l.spaceSeparated,id:null,imageSizes:null,imageSrcSet:null,inert:l.boolean,inputMode:null,integrity:null,is:null,isMap:l.boolean,itemId:null,itemProp:l.spaceSeparated,itemRef:l.spaceSeparated,itemScope:l.boolean,itemType:l.spaceSeparated,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:l.boolean,low:l.number,manifest:null,max:null,maxLength:l.number,media:null,method:null,min:null,minLength:l.number,multiple:l.boolean,muted:l.boolean,name:null,nonce:null,noModule:l.boolean,noValidate:l.boolean,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:l.boolean,optimum:l.number,pattern:null,ping:l.spaceSeparated,placeholder:null,playsInline:l.boolean,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:l.boolean,referrerPolicy:null,rel:l.spaceSeparated,required:l.boolean,reversed:l.boolean,rows:l.number,rowSpan:l.number,sandbox:l.spaceSeparated,scope:null,scoped:l.boolean,seamless:l.boolean,selected:l.boolean,shadowRootClonable:l.boolean,shadowRootDelegatesFocus:l.boolean,shadowRootMode:null,shape:null,size:l.number,sizes:null,slot:null,span:l.number,spellCheck:l.booleanish,src:null,srcDoc:null,srcLang:null,srcSet:null,start:l.number,step:null,style:null,tabIndex:l.number,target:null,title:null,translate:null,type:null,typeMustMatch:l.boolean,useMap:null,value:l.booleanish,width:l.number,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:l.spaceSeparated,axis:null,background:null,bgColor:null,border:l.number,borderColor:null,bottomMargin:l.number,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:l.boolean,declare:l.boolean,event:null,face:null,frame:null,frameBorder:null,hSpace:l.number,leftMargin:l.number,link:null,longDesc:null,lowSrc:null,marginHeight:l.number,marginWidth:l.number,noResize:l.boolean,noHref:l.boolean,noShade:l.boolean,noWrap:l.boolean,object:null,profile:null,prompt:null,rev:null,rightMargin:l.number,rules:null,scheme:null,scrolling:l.booleanish,standby:null,summary:null,text:null,topMargin:l.number,valueType:null,version:null,vAlign:null,vLink:null,vSpace:l.number,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:l.boolean,disableRemotePlayback:l.boolean,prefix:null,property:null,results:l.number,security:null,unselectable:null},space:"html",transform:d}),f=s({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRen
11dering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:l.commaOrSpaceSeparated,accentHeight:l.number,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:l.number,amplitude:l.number,arabicForm:null,ascent:l.number,attributeName:null,attributeType:null,azimuth:l.number,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:l.number,by:null,calcMode:null,capHeight:l.number,className:l.spaceSeparated,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRen
11dering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:l.number,diffuseConstant:l.number,direction:null,display:null,dur:null,divisor:l.number,dominantBaseline:null,download:l.boolean,dx:null,dy:null,edgeMode:null,editable:null,elevation:l.number,enableBackground:null,end:null,event:null,exponent:l.number,externalResourcesRequired:null,fill:null,fillOpacity:l.number,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:l.commaSeparated,g2:l.commaSeparated,glyphName:l.commaSeparated,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:l.number,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:l.number,horizOriginX:l.number,horizOriginY:l.number,id:null,ideographic:l.number,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:l.number,k:l.number,k1:l.number,k2:l.number,k3:l.number,k4:l.number,kernelMatrix:l.commaOrSpaceSeparated,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:l.number,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:l.number,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:l.number,overlineThickness:l.number,paintOrder:null,panose1:null,path:null,pathLength:l.number,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:l.spaceSeparated,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:l.number,pointsAtY:l.number,pointsAtZ:l.number,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:l.commaOrSpaceSeparated,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:l.commaOrSpaceSeparated,rev:l.commaOrSpaceSeparated,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:l.commaOrSpaceSeparated,requiredFeatures:l.commaOrSpaceSeparated,requiredFonts:l.commaOrSpaceSeparated,requiredFormats:l.commaOrSpaceSeparated,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,
11scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:l.number,specularExponent:l.number,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:l.number,strikethroughThickness:l.number,string:null,stroke:null,strokeDashArray:l.commaOrSpaceSeparated,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:l.number,strokeOpacity:l.number,strokeWidth:null,style:null,surfaceScale:l.number,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:l.commaOrSpaceSeparated,tabIndex:l.number,tableValues:null,target:null,targetX:l.number,targetY:l.number,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:l.commaOrSpaceSeparated,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:l.number,underlineThickness:l.number,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:l.number,values:null,vAlphabetic:l.number,vMathematical:l.number,vectorEffect:null,vHanging:l.number,vIdeographic:l.number,version:null,vertAdvY:l.number,vertOriginX:l.number,vertOriginY:l.number,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:l.number,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:c}),p=s({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),m=s({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:d}),g=s({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),y=a([u,h,p,m,g],"html"),v=a([u,f,p,m,g],"svg")},89099:(e,t,r)=>{e.exports=r(16296)},89203:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useMergedRef",{enumerable:!0,get:function(){return a}});let n=r(14232);function a(e,t){let r=(0,n.useRef)(null),a=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=a.current;t&&(a.current=null,t())}else e&&(r.current=i(e,n)),t&&(a.current=i(t,n))},[e,t])}function i(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},89936:(e,t,r)=>{"use strict";r.d(t,{r:()=>a});var n=r(14232);function a(){let[e,t]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{{let e=window.location.hostname;t("localhost"===e||"127.0.0.1"===e||e.endsWith(".local")||e.startsWith("192.168."))}},[]),e}},90089:(e,t,r)=>{"use strict";r.d(t,{Q:()=>n});var n=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}},90293:(e,t,r)=>{"use strict";r.d(t,{$D:()=>h,A9:()=>l,JN:()=>d,PN:()=>c,gw:()=>u});let n=["/pwdRecover"],a=["newpwd","email"],i=/^[a-z][a-z0-9+.-]*:/i,o=e=>{if("string"!=typeof e||""===e)return null;try{if(i.test(e))return new URL(e);return new URL("".concat("http://relative.invalid").concat(e.startsWith("/")?"":"/").concat(e))}catch(e){return null}},s=e=>{let t=(e=>{let t=e;try{t=decodeURIComponent(e)}catch(e){}return t.toLowerCase().replace(/\/{2,}/g,"/")})(e);return n.find(e=>{let r=e.toLowerCase();return t===r||t.startsWith("".concat(r,"/"))})},l=e=>{let t=o(e);return!!t&&(!!(e=>"string"==typeof e&&!!s(e))(t.pathname)||a.some(e=>
11t.searchParams.has(e)))},u=e=>{if(!l(e))return e;let t=o(e),r=s(t.pathname),n=r?"".concat(r,"/*"):t.pathname;return i.test(e)?"".concat(t.origin).concat(n):n},c=(e,t)=>t&&"object"==typeof t?{...t,url:u(t.url),referrer:u(t.referrer)}:t,d=e=>e&&"object"==typeof e?{...e,url:u(e.url)}:e,h=e=>{var t;return!l(null==e||null==(t=e.metadata)?void 0:t.page_url)}},90295:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return h}});let n=r(72687)._(r(14232)),a=r(86581),i=[],o=[],s=!1;function l(e){let t=e(),r={loading:!0,loaded:null,error:null};return r.promise=t.then(e=>(r.loading=!1,r.loaded=e,e)).catch(e=>{throw r.loading=!1,r.error=e,e}),r}class u{promise(){return this._res.promise}retry(){this._clearTimeouts(),this._res=this._loadFn(this._opts.loader),this._state={pastDelay:!1,timedOut:!1};let{_res:e,_opts:t}=this;e.loading&&("number"==typeof t.delay&&(0===t.delay?this._state.pastDelay=!0:this._delay=setTimeout(()=>{this._update({pastDelay:!0})},t.delay)),"number"==typeof t.timeout&&(this._timeout=setTimeout(()=>{this._update({timedOut:!0})},t.timeout))),this._res.promise.then(()=>{this._update({}),this._clearTimeouts()}).catch(e=>{this._update({}),this._clearTimeouts()}),this._update({})}_update(e){this._state={...this._state,error:this._res.error,loaded:this._res.loaded,loading:this._res.loading,...e},this._callbacks.forEach(e=>e())}_clearTimeouts(){clearTimeout(this._delay),clearTimeout(this._timeout)}getCurrentValue(){return this._state}subscribe(e){return this._callbacks.add(e),()=>{this._callbacks.delete(e)}}constructor(e,t){this._loadFn=e,this._opts=t,this._callbacks=new Set,this._delay=null,this._timeout=null,this.retry()}}function c(e){return function(e,t){let r=Object.assign({loader:null,loading:null,delay:200,timeout:null,webpack:null,modules:null},t),i=null;function l(){if(!i){let t=new u(e,r);i={getCurrentValue:t.getCurrentValue.bind(t),subscribe:t.subscribe.bind(t),retry:t.retry.bind(t),promise:t.promise.bind(t)}}return i.promise()}if(!s){let e=r.webpack&&1?r.webpack():r.modules;e&&o.push(t=>{for(let r of e)if(t.includes(r))return l()})}function c(e,t){l();let o=n.default.useContext(a.LoadableContext);o&&Array.isArray(r.modules)&&r.modules.forEach(e=>{o(e)});let s=n.default.useSyncExternalStore(i.subscribe,i.getCurrentValue,i.getCurrentValue);return n.default.useImperativeHandle(t,()=>({retry:i.retry}),[]),n.default.useMemo(()=>{var t;return s.loading||s.error?n.default.createElement(r.loading,{isLoading:s.loading,pastDelay:s.pastDelay,timedOut:s.timedOut,error:s.error,retry:i.retry}):s.loaded?n.default.createElement((t=s.loaded)&&t.default?t.default:t,e):null},[e,s])}return c.preload=()=>l(),c.displayName="LoadableComponent",n.default.forwardRef(c)}(l,e)}function d(e,t){let r=[];for(;e.length;){let n=e.pop();r.push(n(t))}return Promise.all(r).then(()=>{if(e.length)return d(e,t)})}c.preloadAll=()=>new Promise((e,t)=>{d(i).then(e,t)}),c.preloadReady=e=>(void 0===e&&(e=[]),new Promise(t=>{let r=()=>(s=!0,t());d(o,e).then(r,r)})),window.__NEXT_PRELOADREADY=c.preloadReady;let h=c},90376:(e,t,r)=>{"use strict";function n(){throw Object.defineProperty(Error("`unauthorized()` is experimental and only allowed to be used when `experimental.authInterrupts` is enabled."),"__NEXT_ERROR_CODE",{value:"E411",enumerable:!1,configurable:!0})}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"unauthorized",{enumerable:!0,get:function(){return n}}),r(38811).HTTP_ERROR_FALLBACK_ERROR_CODE,("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},91023:(e,t,r)=>{"use strict";r.d(t,{V:()=>o});var n=r(14232),a=r(5824);r(37876);let i=(0,n.createContext)(null);function o(){let e=(0,n.useContext)(i),[t,r]=(0,n.useState)(()=>({...(0,a.a4)(e||"undefined"!=typeof document&&document.documentElement.getAttribute("data-platform")||"web"),isReady:!1}));return(0,n.useEffect)(()=>{let e=(0,a.O2)();r(t=>t.isReady&&t.platform===e.platform?t:{...e,isReady:!0})},[]),t}},91844:(e,t,r)=>{"use strict";r.d(t,{A:()=>
11o,q:()=>i});var n=r(14232),a=r(37876);function i(e,t){let r=n.createContext(t),i=e=>{let{children:t,...i}=e,o=n.useMemo(()=>i,Object.values(i));return(0,a.jsx)(r.Provider,{value:o,children:t})};return i.displayName=e+"Provider",[i,function(a){let i=n.useContext(r);if(i)return i;if(void 0!==t)return t;throw Error(`\`${a}\` must be used within \`${e}\``)}]}function o(e,t=[]){let r=[],i=()=>{let t=r.map(e=>n.createContext(e));return function(r){let a=r?.[e]||t;return n.useMemo(()=>({[`__scope${e}`]:{...r,[e]:a}}),[r,a])}};return i.scopeName=e,[function(t,i){let o=n.createContext(i),s=r.length;r=[...r,i];let l=t=>{let{scope:r,children:i,...l}=t,u=r?.[e]?.[s]||o,c=n.useMemo(()=>l,Object.values(l));return(0,a.jsx)(u.Provider,{value:c,children:i})};return l.displayName=t+"Provider",[l,function(r,a){let l=a?.[e]?.[s]||o,u=n.useContext(l);if(u)return u;if(void 0!==i)return i;throw Error(`\`${r}\` must be used within \`${t}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let r=()=>{let r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let a=r.reduce((t,{useScope:r,scopeName:n})=>{let a=r(e)[`__scope${n}`];return{...t,...a}},{});return n.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}(i,...t)]}},92035:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var n=r(37876),a=r(14232),i=r(53529),o=r.n(i),s=r(45195),l=r(15707);let u={primary:o().Primary,secondary:o().Empty,secondaryDark:o().SecondaryDark,buyCourse:o().BuyCourseButton,rsvped:o().Rsvped,loading:o().Loading,empty:o().Empty,emptyWhite:o().EmptyWhite,inverted:o().Inverted,legacy:o().Legacy,legacyRsvped:o().LegacyRsvped},c=a.forwardRef((e,t)=>{let{children:r,onClick:i,variant:c,size:d,type:h="button",disabled:f=!1,fullWidth:p=!1,pulseHover:m=!1,trackingData:g={},isLoading:y=!1,loadingText:v="...",inverse:w=!1,className:b="",...x}=e,[E,S]=(0,a.useState)(!1),k=u[c]||o().Secondary;w&&"secondary"===c&&(k=o().EmptyInverse);let P=d&&o()[d]?o()[d]:"",C=p?o().FullWidth:"",I=m&&!E?o().PulseHover:"",T=y?o().LoadingState:"",A=(0,s.cn)(k,P,C,I,T,b),_="rsvped"===c||"legacyRsvped"===c,O=f||y;return(0,n.jsxs)("button",{ref:t,type:h,className:A,onClick:e=>{!O&&!_&&g&&Object.keys(g).length>0&&(0,l.trackCTAClick)({ctaType:g.ctaType||"button",ctaText:g.ctaText||("string"==typeof r?r:""),ctaLocation:g.ctaLocation||"",ctaDestination:g.ctaDestination||"",ctaVariant:g.ctaVariant||c||"",userId:g.userId||null}),i&&!_&&i(e)},disabled:O,onMouseEnter:()=>S(!0),onMouseLeave:()=>S(!1),...x,children:[(0,n.jsx)("span",{className:o().SpanTransition}),(0,n.jsx)("div",{className:o().Text,children:y?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:o().Spinner}),v&&"..."!==v&&(0,n.jsx)("span",{style:{marginLeft:"8px"},children:v})]}):r})]})})},92070:(e,t,r)=>{"use strict";r.d(t,{YF:()=>u,_z:()=>l});var n=r(37876),a=r(14232),i=r(89099),o=r(55811);let s=(0,a.createContext)();function l(e){let{children:t}=e,[r,l]=(0,a.useState)(!1),[u,c]=(0,a.useState)("login"),[d,h]=(0,a.useState)(""),[f,p]=(0,a.useState)(""),[m,g]=(0,a.useState)(!1),[y,v]=(0,a.useState)(null),[w,b]=(0,a.useState)(!1),[x,E]=(0,a.useState)(null),[S,k]=(0,a.useState)(""),[P,C]=(0,a.useState)(!1),[I,T]=(0,a.useState)(""),[A,_]=(0,a.useState)(!1),{asPath:O="",pathname:q=""}=(0,i.useRouter)()||{},R=(0,a.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;c("login"),h(e),p(t),g(r),v(()=>n),E(a),l(!0)},[]),D=(0,a.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";c("signup"),h(e),p(t),v(()=>r),E(n),k(a),l(!0)},[]),N=(0,a.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{skipRedirect:t=!1}=e;if(!t){let e=new URLSearchParams(window.location.search).get("closeRedirect");e&&(0,o.vW)(e)}l(!1),h(""),p(""),g(!1),v(null),b(!1),E(null),k("")},[]),j=(0,a.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";l(!1),T(e),C(!0)},[]),L=(0,a.useCallback)(()=>{C(!1),T("")},[]),M=(0,a.useCallback)(()=>{_(!0)},[]),B=(0,a.useCallback)(()=>{_(!1)},[]),U=(0,a.useCallback)(()=>
11{if(y){v(null),b(!0),setTimeout(()=>{try{y(),setTimeout(()=>{b(!1),N({skipRedirect:!0})},2e3)}catch(e){console.error("â Error in success callback:",e),b(!1),N({skipRedirect:!0})}},100);return}N({skipRedirect:!0}),setTimeout(()=>{if(f&&""!==f)(0,o.vW)(f);else{let e=new URLSearchParams(window.location.search).get("redirect");e?(0,o.vW)(e):(0,o.vW)(window.location.href,{reload:!0})}},300)},[N,f,y]);return(0,n.jsx)(s.Provider,{value:{isOpen:r,initialState:u,initialEmail:d,redirectUrl:f,showAccountExistsMessage:m,isProcessingCallback:w,callbackType:x,signUpFromAction:S,accountNotActivatedOpen:P,accountNotActivatedEmail:I,emailVerifiedOpen:A,openLoginPopup:R,openSignupPopup:D,openAccountNotActivated:j,closeAccountNotActivated:L,openEmailVerified:M,closeEmailVerified:B,closePopup:N,handleSuccess:U},children:t})}let u=()=>{let e=(0,a.useContext)(s);if(!e)throw Error("useAuthPopup must be used within an AuthPopupProvider");return e}},92216:(e,t,r)=>{"use strict";r.d(t,{U:()=>i});var n=r(14232),a=r(62146);function i(e,t=globalThis?.document){let r=(0,a.c)(e);n.useEffect(()=>{let e=e=>{"Escape"===e.key&&r(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[r,t])}},93e3:(e,t,r)=>{"use strict";function n(e){return e.toLowerCase()}r.d(t,{S:()=>n})},94769:(e,t,r)=>{"use strict";r.d(t,{Eq:()=>u});var n=new WeakMap,a=new WeakMap,i={},o=0,s=function(e){return e&&(e.host||s(e.parentNode))},l=function(e,t,r,l){var u=(Array.isArray(e)?e:[e]).map(function(e){if(t.contains(e))return e;var r=s(e);return r&&t.contains(r)?r:(console.error("aria-hidden",e,"in not contained inside",t,". Doing nothing"),null)}).filter(function(e){return!!e});i[r]||(i[r]=new WeakMap);var c=i[r],d=[],h=new Set,f=new Set(u),p=function(e){!e||h.has(e)||(h.add(e),p(e.parentNode))};u.forEach(p);var m=function(e){!e||f.has(e)||Array.prototype.forEach.call(e.children,function(e){if(h.has(e))m(e);else try{var t=e.getAttribute(l),i=null!==t&&"false"!==t,o=(n.get(e)||0)+1,s=(c.get(e)||0)+1;n.set(e,o),c.set(e,s),d.push(e),1===o&&i&&a.set(e,!0),1===s&&e.setAttribute(r,"true"),i||e.setAttribute(l,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return m(t),h.clear(),o++,function(){d.forEach(function(e){var t=n.get(e)-1,i=c.get(e)-1;n.set(e,t),c.set(e,i),t||(a.has(e)||e.removeAttribute(l),a.delete(e)),i||e.removeAttribute(r)}),--o||(n=new WeakMap,n=new WeakMap,a=new WeakMap,i={})}},u=function(e,t,r){void 0===r&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),a=t||("undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body);return a?(n.push.apply(n,Array.from(a.querySelectorAll("[aria-live], script"))),l(n,a,r,"aria-hidden")):function(){return null}}},94988:(e,t,r)=>{"use strict";r.d(t,{y:()=>i});var n=r(67776);let a={}.hasOwnProperty;function i(e){let t={},r=-1;for(;++r<e.length;)!function(e,t){let r;for(r in t){let i,o=(a.call(e,r)?e[r]:void 0)||(e[r]={}),s=t[r];if(s)for(i in s){a.call(o,i)||(o[i]=[]);let e=s[i];!function(e,t){let r=-1,a=[];for(;++r<t.length;)("after"===t[r].add?e:a).push(t[r]);(0,n.m)(e,0,0,a)}(o[i],Array.isArray(e)?e:e?[e]:[])}}}(t,e[r]);return t}},95092:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{ReadonlyURLSearchParams:function(){return l.ReadonlyURLSearchParams},RedirectType:function(){return l.RedirectType},ServerInsertedHTMLContext:function(){return u.ServerInsertedHTMLContext},forbidden:function(){return l.forbidden},notFound:function(){return l.notFound},permanentRedirect:function(){return l.permanentRedirect},redirect:function(){return l.redirect},unauthorized:function(){return l.unauthorized},unstable_isUnrecognizedActionError:function(){return c.unstable_isUnrecognizedActionError},unstable_rethrow:function(){return l.unstable_rethrow},useParams:function(){return m},usePathname:function(){return f},useRouter:function(){return p},useSearchParams:function(){return h},useSelectedLayoutSegment:function(){return y},useSelectedLayoutSegments:function(){return g},useServerInsertedHTML:function(){return u.useServerInsertedHTML}});let n=r(14232),a=r(15792),i=r(88797),o=r(37601),s=r(1744),l=r(69591),u=r(14159),c=r(83817),d=void 0;function h(){let e=(0,n.useContext)(i.SearchParamsContext);return(0,n.useMemo)(()=>e?new l.ReadonlyURLSearchParams(e):null,[e])}function f(){return null==d||d("usePathname()"),(0,n.useContext)(i.PathnameContext)}function p(){let e=(0,n.useContext)(a.AppRouterContext);if(null===e)throw Object.defineProperty(Error("invariant expected app router to be mou
11nted"),"__NEXT_ERROR_CODE",{value:"E238",enumerable:!1,configurable:!0});return e}function m(){return null==d||d("useParams()"),(0,n.useContext)(i.PathParamsContext)}function g(e){void 0===e&&(e="children"),null==d||d("useSelectedLayoutSegments()");let t=(0,n.useContext)(a.LayoutRouterContext);return t?function e(t,r,n,a){let i;if(void 0===n&&(n=!0),void 0===a&&(a=[]),n)i=t[1][r];else{var l;let e=t[1];i=null!=(l=e.children)?l:Object.values(e)[0]}if(!i)return a;let u=i[0],c=(0,o.getSegmentValue)(u);return!c||c.startsWith(s.PAGE_SEGMENT_KEY)?a:(a.push(c),e(i,r,!1,a))}(t.parentTree,e):null}function y(e){void 0===e&&(e="children"),null==d||d("useSelectedLayoutSegment()");let t=g(e);if(!t||0===t.length)return null;let r="children"===e?t[0]:t[t.length-1];return r===s.DEFAULT_SEGMENT_KEY?null:r}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},95925:(e,t,r)=>{"use strict";r.r(t),r.d(t,{APP_CACHE_NAME:()=>a,STATIC_CACHE_NAME:()=>i,cacheOfflineAppAndPages:()=>f,clearOfflineAppCache:()=>h,registerServiceWorker:()=>d});var n=r(5824);let a="empara-offline-app-v1",i="empara-offline-static-v1",o="empara_diag_native_sent",s=!1,l=["/fonts/RamaGothicCW03-SemiBold.otf","/fonts/WorkSans.ttf","/fonts/BostonSkylineRough.otf","/fonts/gotham-light-webfont.woff2","/fonts/gotham-book-webfont.woff2","/fonts/gotham-medium-webfont.woff2","/fonts/gotham-bold-webfont.woff2"];async function u(){if(!("caches"in window))return null;try{if("function"!=typeof caches.keys)return null;return await caches.keys()}catch(e){return null}}async function c(e){let{supported:t,registered:r}=e,a=!1;try{a=!!("undefined"!=typeof navigator&&navigator.serviceWorker&&navigator.serviceWorker.controller)}catch(e){}let i=null;try{var l;i=(null==(l=window.__NEXT_DATA__)?void 0:l.buildId)||null}catch(e){}let c={supported:!!t,registered:!!r,hasController:a,cacheKeys:await u(),platform:(0,n.O2)().platform,buildId:i,at:new Date().toISOString()};try{window.__EMPARA_SW__=c}catch(e){}return(0,n.JK)()&&function(e){if(!s){s=!0;try{if(window.sessionStorage.getItem(o))return!1;window.sessionStorage.setItem(o,"1")}catch(e){}try{if("undefined"==typeof navigator||"function"!=typeof navigator.sendBeacon)return!1;let t={...e,ua:String(navigator.userAgent||"").slice(0,200)},r=JSON.stringify(t);r.length>2048&&(r=JSON.stringify({...t,cacheKeys:Array.isArray(e.cacheKeys)?e.cacheKeys.length:null,truncated:!0})),r.length>2048&&(r=JSON.stringify({supported:t.supported,registered:t.registered,platform:t.platform,oversized:!0}));let n="undefined"!=typeof Blob?new Blob([r],{type:"application/json"}):r;navigator.sendBeacon("/api/diag/native",n)}catch(e){return!1}}}(c),c}async function d(){let e="undefined"!=typeof navigator&&"serviceWorker"in navigator,t=(0,n.JK)();if(!e)return t&&console.error("[SW] `serviceWorker` ABSENT de navigator sur plateforme native "+"(".concat((0,n.O2)().platform,") : aucune interception r\xe9seau n'est possible, ")+"tout le hors-ligne EN LECTURE est inerte. Les caches restent \xe9crits en direct (CacheStorage), mais rien ne les sert. D\xe9tail : window.__EMPARA_SW__"),await c({supported:!1,registered:!1}),null;if(!t){try{for(let e of(await navigator.serviceWorker.getRegistrations()))await e.unregister()}catch(e){}return null}try{let e=await navigator.serviceWorker.register("/sw.js",{scope:"/"});return e.addEventListener("updatefound",()=>{let t=e.installing;t&&t.addEventListener("statechange",()=>{"installed"===t.state&&(navigator.serviceWorker.controller?console.log("[SW] Nouvelle version disponible."):console.log("[SW] Contenu mis en cache pour une utilisation hors-ligne."))})}),await c({supported:!0,registered:!0}),e}catch(e){return console.warn("[SW] \xc9chec enregistrement Service Worker:",e),await c({supported:!0,registered:!1}),null}}async function h(){if(!("caches"in window))return!1;try{let e=null;try{e="function"==typeof caches.keys?await caches.keys():null}catch(t){e=null}let t=Array.isArray(e)?e.filter(e=>e.startsWith("empara-")&&"empara-offline-videos-v1"!==e&&"empara-offline-shell-v1"!==e):[a,i];return await Promise.all(t.map(e=>caches.delete(e))),!0}catch(e){return console.warn("[OfflineAppCache] \xc9chec purge des caches applicatifs:",e),!1}}async function f(){let{courseSlug:e,courseCover:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!("caches"in window)||!(0,n.JK)())return!1;try{var r;let n=new Set;
11["/my","/cours","/my/telechargements"].forEach(e=>n.add(e));let o=e?String(e).replace(/^\/cours\//,"").replace(/\/learn$/,"").trim():null;o&&n.add("/cours/".concat(o,"/learn"));let s=null==(r=window.__NEXT_DATA__)?void 0:r.buildId;s&&(n.add("/_next/data/".concat(s,"/my.json")),n.add("/_next/data/".concat(s,"/cours.json")),n.add("/_next/data/".concat(s,"/my/telechargements.json")),o&&n.add("/_next/data/".concat(s,"/cours/").concat(o,"/learn.json"))),t&&"string"==typeof t&&t.trim()&&n.add(t.trim()),"undefined"!=typeof document&&(document.querySelectorAll('link[rel="stylesheet"]').forEach(e=>{let t=e.getAttribute("href");t&&(t.startsWith("/")||t.startsWith(window.location.origin))&&n.add(t)}),document.querySelectorAll("script[src]").forEach(e=>{let t=e.getAttribute("src");t&&(t.startsWith("/")||t.startsWith(window.location.origin))&&n.add(t)}),document.querySelectorAll('img[src*="/cours"], img[src*="vercel-storage"], img[src*="cloudinary"], img[src*="empara"], img[src*="/images/"]').forEach(e=>{let t=e.getAttribute("src");t&&(t.startsWith("/")||t.startsWith("http"))&&n.add(t)})),l.forEach(e=>n.add(e));let u=Array.from(n).filter(Boolean),c=await caches.open(a),d=await caches.open(i),h=0;
11if(await Promise.allSettled(u.map(async e=>{try{let r=e.includes("/_next/static/")||e.startsWith("/fonts/")||e.startsWith("/images/")||e.endsWith(".otf")||e.endsWith(".woff2")||e.endsWith(".woff")||e.endsWith(".ttf")||e.endsWith(".css")||e.endsWith(".js")||e.endsWith(".png")||e.endsWith(".jpg")||e.endsWith(".jpeg")||e.endsWith(".webp")||e.endsWith(".svg")||e.endsWith(".ico")||e.includes("vercel-storage.com")||e.includes("cloudinary.com")||e===t,n=await fetch(e,{cache:r?"default":"no-cache"});if(!n.ok)return;if(n.redirected||"opaqueredirect"===n.type)return void console.warn("[OfflineAppCache] R\xe9ponse redirig\xe9e, non mise en cache:",e);await (r?d:c).put(e,n),h+=1}catch(t){console.warn("[OfflineAppCache] \xc9chec de mise en cache URL:",e,t)}})),"undefined"!=typeof navigator&&"serviceWorker"in navigator&&navigator.serviceWorker.controller)try{navigator.serviceWorker.controller.postMessage({type:"CACHE_OFFLINE_PAGES",urls:u})}catch(e){console.warn("[OfflineAppCache] \xc9chec postMessage SW:",e)}return 0===h?console.warn("[OfflineAppCache] Pr\xe9cache SANS EFFET : 0 entr\xe9e \xe9crite sur ".concat(u.length," URL(s). ")+"Les caches hors-ligne sont vides, le sas hors-ligne n'aura rien \xe0 afficher."):console.log("[OfflineAppCache] Pr\xe9cache : ".concat(h,"/").concat(u.length," entr\xe9e(s) \xe9crite(s).")),h>0}catch(e){return console.error("[OfflineAppCache] Erreur lors de la mise en cache de l'application:",e),!1}}},96473:(e,t,r)=>{"use strict";r.d(t,{Cf:()=>f,Es:()=>m,HM:()=>d,L3:()=>g,c7:()=>p,lG:()=>l,rr:()=>y,zM:()=>u});var n=r(37876),a=r(14232),i=r(41222),o=r(28249),s=r(45195);let l=i.bL,u=i.l9,c=i.ZL,d=i.bm,h=a.forwardRef(function(e,t){let{className:r,...a}=e;return(0,n.jsx)(i.hJ,{ref:t,"data-slot":"dialog-overlay",className:(0,s.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-[10000] bg-black/50",r),...a})});h.displayName=i.hJ.displayName;let f=a.forwardRef(function(e,t){let{className:r,overlayClassName:a,children:l,showCloseButton:u=!0,size:d="3xl",...f}=e,p={sm:"sm:max-w-sm",md:"sm:max-w-md",lg:"sm:max-w-lg",xl:"sm:max-w-xl","2xl":"sm:max-w-2xl","3xl":"sm:max-w-3xl","4xl":"sm:max-w-4xl","5xl":"sm:max-w-5xl"};return(0,n.jsxs)(c,{"data-slot":"dialog-portal",children:[(0,n.jsx)(h,{className:a}),(0,n.jsxs)(i.UC,{ref:t,"data-slot":"dialog-content",className:(0,s.cn)("bg-popover 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 fixed top-[50%] left-[50%] z-[10001] grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 overflow-y-auto max-h-[95vh]",p[d]||p.lg,r),...f,children:[l,u&&(0,n.jsxs)(i.bm,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[(0,n.jsx)(o.A,{}),(0,n.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});function p(e){let{className:t,...r}=e;return(0,n.jsx)("div",{"data-slot":"dialog-header",className:(0,s.cn)("flex flex-col gap-2 text-center sm:text-left",t),...r})}function m(e){let{className:t,...r}=e;return(0,n.jsx)("div",{"data-slot":"dialog-footer",className:(0,s.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...r})}f.displayName=i.UC.displayName;let g=a.forwardRef(function(e,t){let{className:r,...a}=e;return(0,n.jsx)(i.hE,{ref:t,"data-slot":"dialog-title",className:(0,s.cn)("text-popover-foreground text-lg leading-none font-semibold",r),...a})});g.displayName=i.hE.displayName;let y=a.forwardRef(function(e,t){let{className:r,...a}=e;return(0,n.jsx)(i.VY,{ref:t,"data-slot":"dialog-description",className:(0,s.cn)("text-muted-foreground dark:text-muted-foreground
11/90 text-sm",r),...a})});y.displayName=i.VY.displayName},97770:(e,t,r)=>{"use strict";r.d(t,{e:()=>a});var n=r(15711);function a(e){let t=[],r=-1,a=0,i=0;for(;++r<e.length;){let o=e.charCodeAt(r),s="";if(37===o&&(0,n.lV)(e.charCodeAt(r+1))&&(0,n.lV)(e.charCodeAt(r+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){let t=e.charCodeAt(r+1);o<56320&&t>56319&&t<57344?(s=String.fromCharCode(o,t),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(a,r),encodeURIComponent(s)),a=r+i+1,s=""),i&&(r+=i,i=0)}return t.join("")+e.slice(a)}},98275:(e,t,r)=>{"use strict";r.d(t,{m:()=>i});var n=r(90089),a=r(37149),i=new class extends n.Q{#X;#f;#p;constructor(){super(),this.#p=e=>{if(!a.S$&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#f||this.setEventListener(this.#p)}onUnsubscribe(){this.hasListeners()||(this.#f?.(),this.#f=void 0)}setEventListener(e){this.#p=e,this.#f?.(),this.#f=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#X!==e&&(this.#X=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#X?this.#X:globalThis.document?.visibilityState!=="hidden"}}},99551:()=>{},99735:e=>{"use strict";var t=Object.prototype.hasOwnProperty,r=Object.prototype.toString,n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===r.call(e)},o=function(e){if(!e||"[object Object]"!==r.call(e))return!1;var n,a=t.call(e,"constructor"),i=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!a&&!i)return!1;for(n in e);return void 0===n||t.call(e,n)},s=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,r){if("__proto__"===r){if(!t.call(e,r))return;else if(a)return a(e,r).value}return e[r]};e.exports=function e(){var t,r,n,a,u,c,d=arguments[0],h=1,f=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},h=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});h<f;++h)if(t=arguments[h],null!=t)for(r in t)n=l(d,r),d!==(a=l(t,r))&&(p&&a&&(o(a)||(u=i(a)))?(u?(u=!1,c=n&&i(n)?n:[]):c=n&&o(n)?n:{},s(d,{name:r,newValue:e(p,c,a)})):void 0!==a&&s(d,{name:r,newValue:a}));return d}},99783:(e,t,r)=>{"use strict";r.r(t),r.d(t,{OFFLINE_DB_NAME:()=>i,OFFLINE_DB_VERSION:()=>o,OFFLINE_STORES:()=>s,applyOfflineDbUpgrade:()=>l,offlineStorage:()=>d,openOfflineDb:()=>u});let n="empara_offline_db",a={SYNC_QUEUE:"sync_queue",LOCAL_PROGRESSION:"local_progression",DOWNLOADED_MEDIA:"downloaded_media",COURSE_SNAPSHOTS:"course_snapshots"},i=n,o=3,s=a;function l(e){if(e){if(!e.objectStoreNames.contains(a.SYNC_QUEUE)){let t=e.createObjectStore(a.SYNC_QUEUE,{keyPath:"id"});t.createIndex("by_status","status",{unique:!1}),t.createIndex("by_createdAt","createdAt",{unique:!1}),t.createIndex("by_courseId","courseId",{unique:!1}),t.createIndex("by_entity",["userId","courseId","videoId"],{unique:!1})}if(e.objectStoreNames.contains(a.LOCAL_PROGRESSION)||e.createObjectStore(a.LOCAL_PROGRESSION,{keyPath:"cacheKey"}),!e.objectStoreNames.contains(a.DOWNLOADED_MEDIA)){let t=e.createObjectStore(a.DOWNLOADED_MEDIA,{keyPath:"videoId"});t.createIndex("by_courseId","courseId",{unique:!1}),t.createIndex("by_chapterId","chapterId",{unique:!1}),t.createIndex("by_downloadedAt","downloadedAt",{unique:!1})}e.objectStoreNames.contains(a.COURSE_SNAPSHOTS)||e.createObjectStore(a.COURSE_SNAPSHOTS,{keyPath:"courseId"}).createIndex("by_savedAt","savedAt",{unique:!1})}}function u(){return window.indexedDB?new Promise((e,t)=>{let r=!1,a=null,i=()=>{null!==a&&(clearTimeout(a),a=null)},o=t=>{if(i(),r){try{var n;null==t||null==(n=t.close)||n.call(t)}catch(e){}return}r=!0,e(t)},s=e=>{i(),r||(r=!0,t(e))},u=window.indexedDB.open(n,3);u.onupgradeneeded=e=>l(e.target.result),u.onblocked=()=>{console.warn("[OfflineStorage] Mont\xe9e en v".concat(3," de \xab ").concat(n," \xbb bloqu\xe9e par une autre ")+"connexion ouverte. Abandon dans ".concat(Math.round(8),"s si elle ne se ferme pas.")),null===a&&(a=setTimeout(()=>{a=null;let e=Error("OfflineDbBlocked: \xab ".concat(n," \xbb est rest\xe9e bloqu\xe9e par une autre connexion ouverte ")+"pendant ".concat(Math.round(8),"s (mont\xe9e en v").concat(3,")."));e.name="OfflineDbBlockedError",s(e)},8e3))},u.onsuccess=e=>o(e.target.result),u.onerror=e=>{var t;i();let r=null==e||null==(t=e.target)?void 0:t.error;if(r&&"VersionError"===r.name){console.warn("[OfflineStorage] Base plus r\xe9cente que ce bundle, ouverture sans version.");let e=window.indexedDB.open(n);e.onsuccess=e=>o(e.target.result),e.onerror=e=>{var t;return s((null==e||null==(t=e.target)?void 0:t.error)||r)};return}s(r)}}):Promise.resolve(null)}class c{async getDB(){return this.db?this.db:this.dbPromise?this.dbPromise:window.indexedDB?(this.dbPromise=u().then(e=>e?(this.db=e,this.db.onversionchange=()=>{this.db.close(),this.db=null,this.dbPromise=null},e):(this.dbPromise=null,null)).catch(e=>{throw this.dbPromise=null,e}),this.dbPromise):null}async enqueueMutation(e){let t=await this.getDB();return t?new Promise((r,n)=>{let i=t.transaction([a.SYNC_QUEUE],"readwrite").objectStore(a.SYNC_QUEUE).put(e);i.onsuccess=()=>r(e),i.onerror=e=>n(e.target.error)}):e}async findPendingMutationForVideo(e,t,r){let n=await this.getDB();return n?new Promise((i,o)=>{let s=n.transaction([a.SYNC_QUEUE],"readonly").objectStore(a.SYNC_QUEUE).index("by_entity"),l=IDBKeyRange.only([e,t,r]),u=s.openCursor(l,"prev");u.onsuccess=e=>{let t=e.target.result;if(t){let e=t.value;if("pending"===e.status&&"TIMEUPDATE"===e.type)return void i(e);t.continue()}else i(null)},u.onerror=e=>o(e.target.error)}):null}async getPendingMutations(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,t=await this.getDB();return t?new Promise((r,n)=>{let i=t.transaction([a.SYNC_QUEUE],"readonly").objectStore(a.SYNC_QUEUE).index("by_status"),o=IDBKeyRange.only("pending"),s=i.openCursor(o),l=[];s.onsuccess=t=>{let n=t.target.result;n&&l.length<e?(l.push(n.value),n.continue()):(l.sort((e,t)=>
11e.createdAt-t.createdAt),r(l))},s.onerror=e=>n(e.target.error)}):[]}async updateMutationsStatus(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=await this.getDB();if(n)return new Promise((i,o)=>{let s=n.transaction([a.SYNC_QUEUE],"readwrite"),l=s.objectStore(a.SYNC_QUEUE);for(let n of(s.oncomplete=()=>i(),s.onerror=e=>o(e.target.error),e))l.get(n).onsuccess=e=>{let n=e.target.result;n&&(Object.assign(n,{status:t,...r}),l.put(n))}})}async deleteMutations(e){let t=await this.getDB();if(t)return new Promise((r,n)=>{let i=t.transaction([a.SYNC_QUEUE],"readwrite"),o=i.objectStore(a.SYNC_QUEUE);for(let t of(i.oncomplete=()=>r(),i.onerror=e=>n(e.target.error),e))o.delete(t)})}async saveLocalProgression(e,t,r){let n=await this.getDB();if(n)return new Promise((i,o)=>{let s=n.transaction([a.LOCAL_PROGRESSION],"readwrite").objectStore(a.LOCAL_PROGRESSION),l="".concat(e,":").concat(t),u=s.put({cacheKey:l,userId:e,courseId:t,data:r,updatedAt:Date.now()});u.onsuccess=()=>i(),u.onerror=e=>o(e.target.error)})}async getLocalProgression(e,t){let r=await this.getDB();return r?new Promise((n,i)=>{let o=r.transaction([a.LOCAL_PROGRESSION],"readonly").objectStore(a.LOCAL_PROGRESSION),s="".concat(e,":").concat(t),l=o.get(s);l.onsuccess=e=>{var t;return n((null==(t=e.target.result)?void 0:t.data)||null)},l.onerror=e=>i(e.target.error)}):null}async countPendingMutations(){let e=await this.getDB();return e?new Promise((t,r)=>{let n=e.transaction([a.SYNC_QUEUE],"readonly").objectStore(a.SYNC_QUEUE).index("by_status").count(IDBKeyRange.only("pending"));n.onsuccess=e=>t(e.target.result),n.onerror=e=>r(e.target.error)}):0}constructor(){this.db=null,this.dbPromise=null}}let d=new c}},e=>{var t=t=>e(e.s=t);e.O(0,[6593,8792],()=>(t(56556),t(16296))),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.