1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6243],{8133:(e,t,r)=>{r.d(t,{ZF:()=>u,fo:()=>a,n3:()=>s,rl:()=>o,t1:()=>d,wJ:()=>c});var n=r(65364);let s=["Quelle formation pour d\xe9buter en photo ?","Quelles sont les offres d'abonnement ?","Comment fonctionne l'essai gratuit ?","Qui sont les formateurs Empara ?"],i={COURSE:"course",ARTICLE:"article",ARTICLE_FAQ:"article_faq",FAQ:"faq",PLAN:"plan",AUTHOR:"author",FIELD:"field",PLAYLIST_PAGE:"playlist_page",PLAYLIST_ENCADRE:"playlist_encadre",VIDEO_TRANSCRIPT:"video_transcript",COURSE_RESOURCE:"course_resource"};i.COURSE,i.ARTICLE,i.ARTICLE_FAQ,i.FAQ,i.PLAN,i.AUTHOR,i.FIELD,i.PLAYLIST_PAGE,i.PLAYLIST_ENCADRE,i.COURSE_RESOURCE,i.VIDEO_TRANSCRIPT,i.COURSE_RESOURCE,i.COURSE,i.ARTICLE,i.ARTICLE_FAQ,i.FAQ,i.PLAN,i.AUTHOR,i.FIELD,i.PLAYLIST_PAGE,i.PLAYLIST_ENCADRE,i.VIDEO_TRANSCRIPT,i.COURSE_RESOURCE,n.env.ASSISTANT_VIDEO_SOURCE_ENABLED,i.COURSE,i.COURSE_RESOURCE,i.AUTHOR,i.VIDEO_TRANSCRIPT,i.PLAYLIST_PAGE,i.PLAYLIST_ENCADRE,i.ARTICLE,i.ARTICLE_FAQ,i.FAQ,i.PLAN,i.FIELD,n.env.ASSISTANT_ATTRIBUTION_AUDIT,n.env.ASSISTANT_ENTITES_CITEES_ENABLED;let o="assistant",a="depannage",l=[o,a],c={[o]:{id:o,label:"Assistant",description:"Questions sur les formations, les formateurs et les abonnements Empara.",placeholder:"\xc9cris ta questionâ¦",emptyTitle:"Comment puis-je t'aider ?",emptyHint:"Les r\xe9ponses s'appuient uniquement sur les informations d'Empara.",suggestions:s},[a]:{id:a,label:"D\xe9pannage",description:"Un probl\xe8me de compte, d'acc\xe8s, de lecture ou de paiement sur la plateforme.",placeholder:"D\xe9cris le probl\xe8me rencontr\xe9â¦",emptyTitle:"Que se passe-t-il ?",emptyHint:"D\xe9cris ce que tu as fait et ce que tu vois \xe0 l'\xe9cran. Si besoin, la conversation peut \xeatre transmise au support.",suggestions:["On me dit que je regarde d\xe9j\xe0 sur un autre appareil","Une formation que j'ai pay\xe9e n'appara\xeet pas dans mon espace","Mon paiement n'est pas pass\xe9, ma facture est impay\xe9e","Je veux r\xe9silier ou modifier mon abonnement","Je n'ai pas re\xe7u l'email de v\xe9rification de mon compte","Ma progression n'a pas \xe9t\xe9 enregistr\xe9e"]}};function u(e){if("string"!=typeof e)return o;let t=e.trim().toLowerCase();return l.includes(t)?t:o}function d(e){return u(e)===a}},21958:(e,t,r)=>{r.d(t,{E:()=>s,e:()=>i});let n="empara.assistant.home-draft";function s(e){try{let t="string"==typeof e?e.trim():"";t?window.sessionStorage.setItem(n,t):window.sessionStorage.removeItem(n)}catch(e){}}function i(){try{let e=window.sessionStorage.getItem(n)||"";return e&&window.sessionStorage.removeItem(n),e}catch(e){return""}}},48188:(e,t,r)=>{r.d(t,{A:()=>f});var n=r(37876),s=r(14232),i=r(89099),o=r(44692),a=r(71742),l=r(66787),c=r(45691),u=r(71233),d=r(28419),m=r(45195),p=r(8133),x=r(83068);function f(e){let{user:t,latestConversation:r,loading:u=!1,compact:d=!1,suggestions:f=[],draft:g="",onDraftChange:v,onResume:w,onStartConversation:y,onOpenTroubleshooting:A,onOpenSupport:N,className:E,isOpen:j=!0}=e,k=(0,s.useId)(),C="".concat(k,"-title"),S="".concat(k,"-help"),I="".concat(k,"-field"),R="".concat(k,"-hint"),T=(0,s.useRef)(null),[_,L]=(0,s.useState)(!1);"string"==typeof(null==t?void 0:t.firstname)&&t.firstname.trim(),Array.isArray(f)&&f.filter(e=>"string"==typeof e&&e.trim());let D="string"==typeof g?g:"",U=D.trim(),O=(0,i.useRouter)(),[P,F]=(0,s.useState)(()=>Array.isArray(f)&&f.length>0?f.filter(e=>"string"==typeof e&&e.trim()):p.n3);(0,s.useEffect)(()=>{let e=!0,t=(null==O?void 0:O.asPath)||"/";return fetch("/api/assistant/suggestions?path=".concat(encodeURIComponent(t),"&mode=").concat(encodeURIComponent(p.rl))).then(e=>{if(!e.ok)throw Error("Failed to fetch suggestions");return e.json()}).then(t=>{let r=Array.isArray(t)?t:null==t?void 0:t.suggestions;if(e&&Array.isArray(r)&&r.length>0){let e=r.map(e=>"string"==typeof e?e:null==e?void 0:e.question).filter(e=>"string"==typeof e&&e.trim());e.length>0&&F(e)}}).catch(e=>{console.error("[AssistantHome] Erreur suggestions :",e)}),()=>{e=!1}},[null==O?void 0:O.asPath]);let z=(0,s.useCallback)(e=>{"function"==typeof v&&v(e.slice(0,4e3))},[v]),q=(0,s.useCallback)(()=>{let e=T.current;if(e){if(!D){e.style.height="auto";return}e.style.height="auto",e.scrollHeight>0&&(e.style.height="".concat(e.scrollHeight,"px"))}},[D]);(0,s.useEffect)(()=>{q()},[q,j]),(0,s.useEffect)(()=>{"function"==typeof window.matchMedia&&window.matchMedia("(pointer: fine)").matches&&L(!0)},[]),(0,s.useEffect)(()=>
1{if(!j||!_)return;let e=setTimeout(()=>{var e;q(),null==(e=T.current)||e.focus()},50);return()=>clearTimeout(e)},[j,_,q]);let Q=(0,s.useCallback)(e=>{if("function"!=typeof y)return;let t="string"==typeof e?e.trim():"";t&&y(t)},[y]);return(0,n.jsxs)("div",{className:(0,m.cn)("flex min-w-0 flex-col",d?"gap-5":"mx-auto w-full max-w-[720px] gap-6",E),children:[(0,n.jsxs)("section",{"aria-labelledby":C,className:"min-w-0",children:[d?null:(0,n.jsxs)("p",{className:"m-0 mb-[7px] flex items-center gap-2 text-[11px] font-semibold uppercase tracking-[0.18em] text-em-red-text",children:[(0,n.jsx)("span",{"aria-hidden":"true",className:"inline-block h-[3px] w-14 shrink-0 bg-em-red"}),"Assistant Empara"]}),(0,n.jsx)("h2",{id:C,className:(0,m.cn)("m-0 text-white",d?"mb-1.5 text-[17px] font-bold tracking-[-0.01em]":"mb-2.5 font-rama text-[34px] font-semibold uppercase leading-[0.9] tracking-[0.02em] sm:text-[42px]"),children:"que cherches-tu\xa0?"}),(0,n.jsxs)("form",{onSubmit:e=>{e.preventDefault(),Q(D)},className:"min-w-0",children:[(0,n.jsx)("label",{htmlFor:I,className:"sr-only",children:"\xc9cris ta question \xe0 l'assistant"}),(0,n.jsxs)("div",{className:(0,m.cn)("flex items-end gap-2 rounded-2xl border border-em-border bg-em-tile p-2","transition-colors duration-200 focus-within:border-em-border-strong focus-within:bg-em-row"),children:[(0,n.jsx)("textarea",{ref:T,id:I,value:D,onChange:e=>z(e.target.value),onFocus:q,onKeyDown:e=>{var t;_&&(null==(t=e.nativeEvent)||!t.isComposing)&&("Enter"!==e.key||e.shiftKey||(e.preventDefault(),Q(D)))},rows:d?2:3,maxLength:4e3,placeholder:"\xc9cris ta questionâ¦","aria-describedby":R,className:(0,m.cn)("max-h-60 min-w-0 flex-1 resize-none overflow-y-auto bg-transparent px-2 py-2","text-white placeholder:text-em-ink-500 focus:outline-none",d?"min-h-[44px] text-[14px] leading-[1.5]":"min-h-[58px] text-[15px] leading-[1.55]")}),(0,n.jsxs)("button",{type:"submit",disabled:!U,className:(0,m.cn)("inline-flex shrink-0 cursor-pointer items-center gap-1.5 rounded-xl bg-em-red font-medium text-white","transition-all duration-200 hover:bg-em-red-dark active:scale-[0.98]","focus-visible:bg-em-red-dark","disabled:cursor-not-allowed disabled:opacity-60",d?"px-3 py-2.5 text-[13px]":"px-4 py-2.5 text-sm"),children:[(0,n.jsx)(o.A,{"aria-hidden":"true",className:"size-4 shrink-0",strokeWidth:1.8}),(0,n.jsx)("span",{children:"Envoyer"})]})]}),(0,n.jsx)("div",{className:"mt-2 flex items-start justify-between gap-3 px-1",children:D.length>=3500?(0,n.jsxs)("p",{className:"m-0 shrink-0 text-[11.5px] tabular-nums text-em-ink-500","aria-live":"polite",children:[D.length," / ",4e3]}):null})]}),(0,n.jsx)(x.A,{suggestions:P,compact:d,onSelect:e=>{Q(e)},isOpen:j})]}),(0,n.jsx)("div",{"aria-hidden":"true",className:"h-px w-full shrink-0 bg-em-border"}),(0,n.jsxs)("section",{"aria-labelledby":S,className:"min-w-0",children:[(0,n.jsx)("h3",{id:S,className:(0,m.cn)("m-0 font-semibold tracking-[-0.01em] text-em-ink-200",d?"mb-2.5 text-[13px]":"mb-3 text-[14px]"),children:"Reprendre ou se faire aider"}),(0,n.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,n.jsx)(h,{conversation:r,loading:u,compact:d,onResume:()=>{let e=null==r?void 0:r.conversationId;e&&"function"==typeof w&&w(e)}}),(0,n.jsxs)("div",{className:(0,m.cn)("grid gap-2",d?"grid-cols-1":"grid-cols-1 sm:grid-cols-2"),children:[(0,n.jsx)(b,{compact:d,icon:a.A,title:"R\xe9soudre un probl\xe8me",subtitle:"Lecture vid\xe9o, connexion, acc\xe8s \xe0 une formation",onClick:()=>{"function"==typeof A&&A(U)}}),(0,n.jsx)(b,{compact:d,icon:l.A,title:"Contacter l'assistance",subtitle:"Compte, paiement\xa0: une personne prend le relais",onClick:()=>{"function"==typeof N&&N(U)}})]})]}),(0,n.jsx)("p",{className:"m-0 mt-3",children:(0,n.jsxs)("a",{href:"/assistance",target:"_blank",rel:"noopener noreferrer",className:(0,m.cn)("group inline-flex items-center gap-1.5 rounded-sm px-1 py-0.5 text-[12px] text-em-ink-400 no-underline","transition-colors duration-200 hover:text-white focus-visible:bg-em-row focus-visible:text-white"),children:[(0,n.jsx)("span",{className:"underline-offset-4 group-hover:underline",children:"Consulter le centre d'aide"}),(0,n.jsx)(c.A,{"aria-hidden":"true",className:"size-3.5 shrink-0",strokeWidth:1.8}),(0,n.jsx)("span",{className:"sr-only",children:"(nouvelle fen\xeatre)"})]})})]}),(0,n.jsx)("p",{className:"m-0 text-[11px] leading-[1.5] text-em-ink-500",children:"L'assistant peut se tromper. V\xe9rifie les informations importantes (tarifs, dates) sur les pages d\xe9di\xe9es."})]})}
1function h(e){let{conversation:t,loading:r,compact:s,onResume:i}=e;if(r)return(0,n.jsx)(g,{compact:s});let o="string"==typeof(null==t?void 0:t.title)?t.title.trim():"";if(!(null==t?void 0:t.conversationId))return null;let a=function(e){let t=function(e){if(!e)return null;let t=e instanceof Date?e:new Date(e);return Number.isNaN(t.getTime())?null:t}(e);if(!t)return null;let r=new Date,n=Math.round((w(r)-w(t))/864e5);return n<=0?"Aujourd'hui":1===n?"Hier":n<7?"Il y a ".concat(n," jours"):t.toLocaleDateString("fr-FR",{timeZone:"Europe/Paris",day:"numeric",month:"long",...y(t)===y(r)?{}:{year:"numeric"}})}(null==t?void 0:t.lastMessageAt),l=(0,p.t1)(null==t?void 0:t.mode);return(0,n.jsxs)("button",{type:"button",onClick:i,className:(0,m.cn)("group flex w-full min-w-0 cursor-pointer items-center justify-between gap-2.5 rounded-lg border border-em-border/70 bg-em-tile/80 text-left","transition-colors duration-200 hover:border-em-border-strong hover:bg-em-row focus-visible:bg-em-row",s?"px-2.5 py-1.5 text-[12px]":"px-3 py-2 text-[12.5px]"),children:[(0,n.jsxs)("span",{className:"flex min-w-0 flex-1 items-center gap-2",children:[(0,n.jsx)(u.A,{className:"size-3.5 shrink-0 text-em-ink-400 transition-colors group-hover:text-em-ink-200",strokeWidth:1.8}),(0,n.jsx)("span",{className:"shrink-0 font-medium text-em-ink-400",children:"Reprendre :"}),(0,n.jsx)("span",{className:"truncate font-medium text-em-ink-200 transition-colors group-hover:text-white",children:o||"Conversation sans titre"}),a?(0,n.jsxs)("span",{className:"hidden sm:inline shrink-0 text-[11px] text-em-ink-500",children:["\xb7 ",a]}):null,l?(0,n.jsx)("span",{className:"shrink-0 inline-flex items-center rounded border border-em-border/80 bg-em-tile px-1.5 py-[1px] text-[9.5px] font-medium text-em-red-text",children:"D\xe9pannage"}):null]}),(0,n.jsx)(d.A,{"aria-hidden":"true",strokeWidth:1.8,className:"size-3.5 shrink-0 text-em-ink-500 transition-transform duration-200 group-hover:translate-x-0.5 group-hover:text-white"})]})}function g(e){let{compact:t}=e;return(0,n.jsxs)("div",{role:"status",className:(0,m.cn)("flex min-w-0 items-center gap-2 rounded-lg border border-em-border/70 bg-em-tile/80",t?"px-2.5 py-1.5 h-[34px]":"px-3 py-2 h-[38px]"),children:[(0,n.jsx)("span",{className:"sr-only",children:"Chargement de la derni\xe8re conversationâ¦"}),(0,n.jsx)("span",{"aria-hidden":"true",className:"size-3.5 shrink-0 animate-pulse rounded bg-em-tile"}),(0,n.jsx)("span",{"aria-hidden":"true",className:"h-3 w-1/2 animate-pulse rounded-sm bg-em-tile"})]})}function b(e){let{compact:t,icon:r,title:s,subtitle:i,onClick:o}=e;return(0,n.jsxs)("button",{type:"button",onClick:o,className:(0,m.cn)("group flex w-full min-w-0 cursor-pointer items-center justify-between gap-3 rounded-xl border border-em-border bg-em-raised text-left","transition-all duration-200 hover:border-em-border-strong hover:bg-em-row focus-visible:bg-em-row",t?"px-3.5 py-2.5":"px-4 py-3"),children:[(0,n.jsxs)("span",{className:"flex min-w-0 items-center gap-3",children:[(0,n.jsx)("span",{"aria-hidden":"true",className:(0,m.cn)("flex size-8 shrink-0 items-center justify-center rounded-lg bg-em-row text-em-ink-200","transition-colors duration-200 group-hover:bg-em-card group-hover:text-white"),children:(0,n.jsx)(r,{className:"size-4",strokeWidth:1.8})}),(0,n.jsxs)("span",{className:"min-w-0",children:[(0,n.jsx)("span",{className:"block truncate text-[13.5px] font-semibold text-white",children:s}),t?null:(0,n.jsx)("span",{className:"line-clamp-2 text-[11.5px] leading-[1.35] text-em-ink-400",children:i})]})]}),(0,n.jsx)(d.A,{"aria-hidden":"true",strokeWidth:2,className:"size-4 shrink-0 text-em-ink-500 transition-transform duration-200 group-hover:translate-x-0.5 group-hover:text-white"})]})}let v=new Intl.DateTimeFormat("fr-CA",{timeZone:"Europe/Paris",year:"numeric",month:"2-digit",day:"2-digit"});function w(e){return Date.parse("".concat(v.format(e),"T00:00:00Z"))}function y(e){return v.format(e).slice(0,4)}},60238:(e,t,r)=>{r.d(t,{P:()=>n});function n(){var e;return"undefined"!=typeof globalThis&&(null==(e=globalThis.crypto)?void 0:e.randomUUID)?globalThis.crypto.randomUUID():"c_".concat(Date.now(),"_").concat(Math.random().toString(36).slice(2,10))}},60862:(e,t,r)=>{r.d(t,{BF:()=>o,SV:()=>l,_l:()=>c,fY:()=>i,kj:()=>u});var n=r(5824),s=r(65364);function i(e){return e&&void 0!==e._id&&null!==e._id&&""!==e._id?e._id+e.basicId:null}function o(){var e,t;if((0,n.O2)().isNativeApp)return!0;
1if("true"===s.env.NEXT_PUBLIC_ENABLE_CRISP_DEV||(null==(e=window.localStorage)?void 0:e.getItem("enable_crisp_dev"))==="true")return!1;let r=(null==(t=window.location)?void 0:t.hostname)||"";return"localhost"===r||"127.0.0.1"===r||r.includes("ngrok-free.app")}function a(){if(!0===window.__forceCrispUnavailable)return!1;try{var e;return"function"==typeof(null==(e=window.$crisp)?void 0:e.is)}catch(e){return!1}}function l(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:4e3;return a()?Promise.resolve(!0):new Promise(t=>{let r=null,n=null,s=!1,i=e=>{s||(s=!0,null!==r&&window.clearInterval(r),null!==n&&window.clearTimeout(n),r=null,n=null,t(e))};r=window.setInterval(()=>{a()&&i(!0)},150),n=window.setTimeout(()=>i(!1),Math.max(0,e))})}function c(e){if(!a())return!1;try{return window.$crisp.push(["do","chat:open"]),"string"==typeof e&&e.trim()&&window.$crisp.push(["set","message:text",[e]]),!0}catch(e){return console.warn("[crisp] openCrispChat failed:",e),!1}}function u(){if(!a())return!1;try{return window.$crisp.push(["do","chat:close"]),!0}catch(e){return console.warn("[crisp] closeCrispChat failed:",e),!1}}},83068:(e,t,r)=>{r.d(t,{A:()=>d,o:()=>u});var n=r(37876),s=r(14232),i=r(73884),o=r(9552),a=r(29053),l=r(28419),c=r(45195);function u(e){return(e||"").trim().toLowerCase().replace(/\s+/g," ")}function d(e){let{suggestions:t=[],compact:r=!1,onSelect:u,isOpen:d=!0,className:m,title:p="Suggestions"}=e,x=(0,s.useRef)(null),[f,h]=(0,s.useState)(!1),[g,b]=(0,s.useState)(!1),v=(0,s.useCallback)(()=>{if(!x.current)return;let{scrollLeft:e,scrollWidth:t,clientWidth:r}=x.current;h(e>4),b(e+r<t-4)},[]);(0,s.useEffect)(()=>{if(!d)return;v();let e=setTimeout(v,50),t=()=>v();return window.addEventListener("resize",t),()=>{clearTimeout(e),window.removeEventListener("resize",t)}},[t,d,v]);let w=e=>{if(!x.current)return;let t=.7*x.current.clientWidth;x.current.scrollBy({left:"left"===e?-t:t,behavior:"smooth"})};return Array.isArray(t)&&0!==t.length?(0,n.jsxs)("div",{className:(0,c.cn)("min-w-0 flex flex-col",r?"mt-2.5 gap-1.5":"mt-3 gap-2",m),children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-0.5",children:[(0,n.jsxs)("div",{className:"flex items-center gap-1.5 text-em-ink-400",children:[(0,n.jsx)(i.A,{className:"size-3 text-[#d98a8e]",strokeWidth:2}),(0,n.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-[0.14em]",children:p})]}),(f||g)&&(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[(0,n.jsx)("button",{type:"button",onClick:()=>w("left"),disabled:!f,"aria-label":"Faire d\xe9filer les suggestions vers la gauche",className:"flex size-5 cursor-pointer items-center justify-center rounded-md border border-em-border bg-em-tile text-em-ink-400 transition-colors hover:border-em-border-strong hover:bg-em-row hover:text-white disabled:cursor-not-allowed disabled:opacity-30",children:(0,n.jsx)(o.A,{className:"size-3",strokeWidth:2})}),(0,n.jsx)("button",{type:"button",onClick:()=>w("right"),disabled:!g,"aria-label":"Faire d\xe9filer les suggestions vers la droite",className:"flex size-5 cursor-pointer items-center justify-center rounded-md border border-em-border bg-em-tile text-em-ink-400 transition-colors hover:border-em-border-strong hover:bg-em-row hover:text-white disabled:cursor-not-allowed disabled:opacity-30",children:(0,n.jsx)(a.A,{className:"size-3",strokeWidth:2})})]})]}),(0,n.jsx)("div",{ref:x,onScroll:v,className:"flex gap-2 overflow-x-auto pb-1 pt-0.5 scrollbar-none snap-x snap-mandatory",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:t.map((e,t)=>{let s="string"==typeof e?e:(null==e?void 0:e.question)||"";return s?(0,n.jsxs)("button",{type:"button",onClick:()=>null==u?void 0:u(s),className:(0,c.cn)("group shrink-0 snap-start text-left cursor-pointer rounded-xl border border-em-border/80 bg-em-tile text-em-ink-200","transition-all duration-200 hover:border-em-border-strong hover:bg-em-row hover:text-white focus-visible:bg-em-row focus-visible:text-white active:scale-[0.98]","flex items-center gap-2",r?"max-w-[260px] px-3 py-2 text-[12px] leading-snug":"max-w-[300px] px-3.5 py-2 text-[12.5px] leading-snug"),children:[(0,n.jsx)("span",{className:"line-clamp-2 min-w-0 flex-1",children:s}),(0,n.jsx)(l.A,{"aria-hidden":"true",className:"size-3.5 shrink-0 text-em-ink-500 transition-transform duration-200 group-hover:translate-x-0.5 group-hover:text-[#d98a8e]",strokeWidth:2})]},"".concat(s,"-").concat(t)):null})})]}):null}}}]);
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.