import{_ as Z}from"./BRp5arjK.js";import{_ as R}from"./y3iHaeSb.js";import{n as j,E as I,s as E,r as p,z as C,K as O,o as m,c as v,a as t,t as a,I as i,J as d,v as s,N as A,M as J,D as K,B as T,C as N,d as U,F as q,p as z,e as H,_ as P,u as G,ac as Q,b as S,w as V}from"./DECyKjgI.js";import{_ as W}from"./CKwk35vx.js";const X=j("/modal-img1.jpg"),g=r=>(z("data-v-033db2a4"),r=r(),H(),r),Y=g(()=>t("svg",{width:"28",height:"20",viewBox:"0 0 28 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t("path",{d:"M26.5 1.25H1V18.75H26.5V1.25Z",stroke:"#C71F03","stroke-width":"2"}),t("path",{d:"M1.5 1.25L14 11.75L26.5 1.25",stroke:"#C71F03","stroke-width":"2"}),t("path",{d:"M1 18.75L10.5 9.25M26.5 18.75L17 9.25",stroke:"#C71F03","stroke-width":"2"})],-1)),tt=g(()=>t("svg",{width:"27",height:"27",viewBox:"0 0 27 27",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t("rect",{x:"24.1074",y:"0.242188",width:"3.75",height:"33.75",transform:"rotate(45 24.1074 0.242188)"}),t("rect",{x:"0.242188",y:"2.89453",width:"3.75",height:"33.75",transform:"rotate(-45 0.242188 2.89453)"})],-1)),et=[tt],st={class:"flex flex-wrap items-stretch md:flex-nowrap md:justify-between"},ot={class:"text"},lt={class:"text-with-border mb-25 pr-40"},nt={class:"mb-10"},at={class:"flex w-full flex-wrap items-center"},it={for:"email"},ct=g(()=>t("td",null,null,-1)),dt=["disabled"],rt={class:"text flex flex-col items-center justify-center"},ut={class:"mb-25"},_t=g(()=>t("svg",{width:"98",height:"98",viewBox:"0 0 98 98",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t("rect",{width:"98",height:"98",rx:"49",fill:"#C71F03"}),t("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M69.3301 35.0596L65.9489 32.269L46.6529 55.6057L35.2012 44.1646L32.1001 47.2628L46.9623 62.1113L69.3301 35.0596Z",fill:"white"})],-1)),ht={class:"text flex flex-col items-center justify-center"},pt={class:"mb-25"},mt=g(()=>t("div",{class:"illustration"},[t("img",{src:X,alt:""})],-1)),ft=I({__name:"SendByEmail",setup(r){const x=E(),f=p(!1),c=p(""),u=p(),n=p(null);function y(){var e;n.value=null,l.value=!1,f.value=!0,(e=u.value)==null||e.showModal()}function B(){var e;n.value=null,l.value=!1,f.value=!1,(e=u.value)==null||e.close()}const w=C(()=>!!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(c.value)),M=O().locale.value,l=p(!1),b=async()=>{l.value=!0,await x.getPdfData(M,"send_email",{share_email:c.value}).then(e=>(n.value=!0,e.error&&(n.value=!1),e)).catch(()=>{n.value=!1}).finally(()=>{l.value=!1})};return(e,L)=>{const o=R;return m(),v(q,null,[t("button",{onClick:y,class:"option"},[Y,t("span",null,a(e.$t("send-me")),1)]),t("dialog",{ref_key:"dialog",ref:u},[t("button",{onClick:B,class:"close"},et),t("div",st,[i(t("div",ot,[t("div",lt,[t("h2",nt,a(e.$t("send-email-heading")),1)]),t("div",at,[t("form",null,[t("table",null,[t("tr",null,[t("td",null,[t("label",it,a(e.$t("e-mail"))+" *",1)]),t("td",null,[i(t("input",{type:"text","onUpdate:modelValue":L[0]||(L[0]=_=>A(c)?c.value=_:null),name:"email",id:"email"},null,512),[[J,s(c)]])])]),t("tr",null,[ct,t("td",null,[t("button",{type:"button",onClick:b,disabled:s(l),class:K([{disabled:s(l)||!s(w)},"button button-red flex"])},[s(l)?(m(),T(o,{key:0,width:"32"})):N("",!0),U(" "+a(e.$t("send")),1)],10,dt)])])])])])],512),[[d,s(n)===null]]),i(t("div",rt,[t("h2",ut,a(e.$t("send-email-success")),1),_t],512),[[d,s(n)===!0]]),i(t("div",ht,[t("h2",pt,a(e.$t("send-email-failure")),1),t("button",{type:"button",onClick:b,class:"button button-red"},a(e.$t("send-again")),1)],512),[[d,s(n)===!1]]),mt])],512)],64)}}}),wt=P(ft,[["__scopeId","data-v-033db2a4"]]),vt=j("/logo-mobile.svg"),h=r=>(z("data-v-a64e2882"),r=r(),H(),r),gt={class:"content"},xt=h(()=>t("img",{src:W,class:"hidden h-[60px] md:block",alt:"Diamant"},null,-1)),bt=h(()=>t("img",{src:vt,class:"block h-[32px] sm:h-[40px] md:hidden",alt:"Diamant"},null,-1)),Lt={class:"flex"},$t={class:"options"},kt={width:"24",height:"28",viewBox:"0 0 24 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ct=h(()=>t("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M18.8496 10.601L17.1526 8.87939L13.2011 12.8881L13.2011 4.87065C13.2011 4.19831 12.6638 3.65326 12.0011 3.65326C11.3383 3.65326 10.8011 4.19831 10.8011 4.87065L10.8011 12.8881L6.84961 8.87939L5.15255 10.601L12.0011 17.5488L18.8496 10.601Z",fill:"#C71F03"},null,-1)),yt=h(()=>t("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M4.80039 18.7656V19.983C4.80039 20.6554 5.33765 21.2004 6.00039 21.2004L18.0004 21.2004C18.6631 21.2004 19.2004 20.6554 19.2004 19.983V18.7656H21.6004V19.983C21.6004 22.0001 19.9886 23.6352 18.0004 23.6352L6.00039 23.6352C4.01217 23.6352 2.40039 22.0001 2.40039 19.983V18.7656H4.80039Z",fill:"#C71F03"},null,-1)),Bt=[Ct,yt],Mt={class:"relative"},Dt={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 640 512",class:"h-6 w-6"},Ft=h(()=>t("path",{fill:"#C71F03",d:"M579.8 267.7c56.5-56.5 56.5-148 0-204.5c-50-50-128.8-56.5-186.3-15.4l-1.6 1.1c-14.4 10.3-17.7 30.3-7.4 44.6s30.3 17.7 44.6 7.4l1.6-1.1c32.1-22.9 76-19.3 103.8 8.6c31.5 31.5 31.5 82.5 0 114L422.3 334.8c-31.5 31.5-82.5 31.5-114 0c-27.9-27.9-31.5-71.8-8.6-103.8l1.1-1.6c10.3-14.4 6.9-34.4-7.4-44.6s-34.4-6.9-44.6 7.4l-1.1 1.6C206.5 251.2 213 330 263 380c56.5 56.5 148 56.5 204.5 0L579.8 267.7zM60.2 244.3c-56.5 56.5-56.5 148 0 204.5c50 50 128.8 56.5 186.3 15.4l1.6-1.1c14.4-10.3 17.7-30.3 7.4-44.6s-30.3-17.7-44.6-7.4l-1.6 1.1c-32.1 22.9-76 19.3-103.8-8.6C74 372 74 321 105.5 289.5L217.7 177.2c31.5-31.5 82.5-31.5 114 0c27.9 27.9 31.5 71.8 8.6 103.9l-1.1 1.6c-10.3 14.4-6.9 34.4 7.4 44.6s34.4 6.9 44.6-7.4l1.1-1.6C433.5 260.8 427 182 377 132c-56.5-56.5-148-56.5-204.5 0L60.2 244.3z"},null,-1)),St=[Ft],Vt={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"#C71F03",class:"h-6 w-6"},Rt=h(()=>t("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m4.5 12.75 6 6 9-13.5"},null,-1)),jt=[Rt],It={class:"text-sm shadow-lg absolute left-[50%] top-full mt-[13px] w-auto -translate-x-1/2 rounded bg-[#5E88D3] px-[13px] py-[8px] text-white"},Et={class:"flex w-full items-center justify-center text-[12px]"},Ot=h(()=>t("span",{class:"ml-5 inline-block"},[t("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t("rect",{width:"24",height:"24",rx:"12",fill:"white"}),t("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M17.4716 8.74589L16.4951 7.85426L10.922 15.3107L7.61449 11.6551L6.71883 12.645L11.0113 17.3894L17.4716 8.74589Z",fill:"#22282A"})])],-1)),Tt=h(()=>t("div",{class:"absolute left-1/2 top-[-7px] h-4 w-4 -translate-x-1/2 rotate-45 transform bg-[#5E88D3]"},null,-1)),Nt=I({__name:"Header",setup(r){const x=G(),f=E(),c=Q(),u=p(!1),n=C(()=>f.$state.order),y=()=>{navigator.clipboard.writeText(window.location.href),u.value=!0,setTimeout(()=>{u.value=!1},2e3)},B=()=>{var _;const o=(_=c==null?void 0:c.name)==null?void 0:_.match(/^order-(.*?)___/);return o?o[1]:c.name},w=C(()=>B()==="summary"),M=O().locale.value,l=p(!1),b=async()=>{l.value=!0;const o=await f.getPdfData(M).then(_=>_);e(o,"application/pdf",`${n.value.code}.pdf`),setTimeout(()=>{l.value=!1},2e3)},e=function(o,_="application/pdf",$="file.pdf"){const D=o;if(window.navigator&&window.navigator.msSaveOrOpenBlob){window.navigator.msSaveOrOpenBlob(D);return}const k=window.URL.createObjectURL(o),F=document.createElement("a");F.href=k,F.download=$,F.click(),setTimeout(function(){window.URL.revokeObjectURL(k)},100)},L=C(()=>x(`/${n.value.id}/summary`));return(o,_)=>{const $=Z,D=R,k=wt;return m(),v("header",null,[t("div",gt,[S($,{to:s(x)("/")},{default:V(()=>[xt,bt]),_:1},8,["to"]),t("div",Lt,[t("div",$t,[i(S($,{to:s(L),class:"option flex !px-10 xl:!hidden"},{default:V(()=>[U(a(o.$t("summary")),1)]),_:1},8,["to"]),[[d,!s(w)]]),i(t("button",{onClick:b,class:"option"},[i((m(),v("svg",kt,Bt,512)),[[d,!s(l)]]),i(S(D,{width:"32"},null,512),[[d,s(l)]]),t("span",null,a(o.$t("pdf")),1)],512),[[d,s(w)]]),s(w)?(m(),T(k,{key:0})):N("",!0),t("div",Mt,[t("button",{onClick:y,class:"option"},[i((m(),v("svg",Dt,St,512)),[[d,!s(u)]]),i((m(),v("svg",Vt,jt,512)),[[d,s(u)]]),t("span",null,a(o.$t("copy-link")),1)]),i(t("div",It,[t("div",Et,[t("span",null,a(o.$t("copy-link-done")),1),Ot]),Tt],512),[[d,s(u)]])])])])])])}}}),Zt=P(Nt,[["__scopeId","data-v-a64e2882"]]);export{Zt as _};
