import{g as k,p as C,r as p,u as _,a as c,n as h,b as w,d as I,E as z,F as B,i as F,G as b,J as V,K as s,c as t,an as P,ao as S,am as L,L as R,N as m,b1 as A,b2 as D,a$ as E,P as N}from"./main.js";import{t as T,f as K,v as q,k as M,_ as $,h as j,V as G,i as J}from"./logo.js";import{V as U,g as W,q as H}from"./VBtn.js";const O=C({...I(),...q()},"VForm"),Q=k()({name:"VForm",props:O(),emits:{"update:modelValue":r=>!0,submit:r=>!0},setup(r,f){let{slots:l,emit:i}=f;const a=T(r),u=p();function v(o){o.preventDefault(),a.reset()}function e(o){const d=o,n=a.validate();d.then=n.then.bind(n),d.catch=n.catch.bind(n),d.finally=n.finally.bind(n),i("submit",d),d.defaultPrevented||n.then(y=>{var g;let{valid:x}=y;x&&((g=u.value)==null||g.submit())}),d.preventDefault()}return _(()=>{var o;return c("form",{ref:u,class:w(["v-form",r.class]),style:h(r.style),novalidate:!0,onReset:v,onSubmit:e},[(o=l.default)==null?void 0:o.call(l,a)])}),K(a,u)}}),ee=z({__name:"welcome",setup(r){const f=B(),l=p(""),i=p(!1),a=p("");F(()=>f.getBranding);const u=async()=>{if(!l.value.trim()){a.value="Inserisci un External ID valido";return}i.value=!0,a.value="";try{(await N.login(l.value.trim())).success?f.setAuthenticated(!0):a.value="Autenticazione fallita. Verifica l'External ID e riprova."}catch{a.value="Errore durante l'autenticazione. Verifica l'External ID e riprova."}finally{i.value=!1}};return(v,e)=>(V(),b(E,{class:"fill-height my-auto",fluid:""},{default:s(()=>[t(P,{align:"center",class:"fill-height",justify:"center"},{default:s(()=>[t(S,{cols:"12",lg:"6",md:"6",sm:"8",xl:"5"},{default:s(()=>[t(M,{class:"pa-2 pa-md-6 pa-lg-8",flat:"",rounded:"md"},{default:s(()=>[t(L,{class:"text-center pb-4"},{default:s(()=>[t(U,{alt:"Brand Logo",class:"mx-auto","max-width":"400",src:$})]),_:1}),t(j,null,{default:s(()=>[e[4]||(e[4]=c("p",{class:"text-h5 font-weight-bold mb-2"}," Come funziona ",-1)),e[5]||(e[5]=c("p",{class:"pa-0 text-body-1 mt-2 mb-8"},[m(" Con il plugin "),c("b",null,"LegalBlink"),m(" puoi integrare i servizi LegalBlink sul tuo attuale sito WordPress. "),c("br"),m(" Per eseguire la procedura è necessario inserire un token, che potrai generare accedendo alla piattaforma LegalBlink, dalla sezione Impostazioni. "),c("br"),m(" In questo modo potrai aggiungere sul tuo sito web i documenti legali creati. ")],-1)),t(Q,{onSubmit:A(u,["prevent"])},{default:s(()=>[t(G,{modelValue:l.value,"onUpdate:modelValue":e[0]||(e[0]=o=>l.value=o),class:"mb-4","hide-details":"auto",label:"Token",placeholder:"Inserisci token","prepend-inner-icon":"mdi-account-key",variant:"outlined",onKeyup:D(u,["enter"])},null,8,["modelValue"]),t(W,{block:"",class:"mb-4",color:"primary",disabled:!l.value||i.value,loading:i.value,size:"large",type:"submit"},{default:s(()=>[t(H,{start:""},{default:s(()=>e[2]||(e[2]=[m("mdi-login")])),_:1,__:[2]}),e[3]||(e[3]=m(" Accedi "))]),_:1,__:[3]},8,["disabled","loading"])]),_:1}),a.value?(V(),b(J,{key:0,closable:"",text:a.value,type:"error",variant:"tonal","onClick:close":e[1]||(e[1]=o=>a.value="")},null,8,["text"])):R("",!0)]),_:1,__:[4,5]})]),_:1})]),_:1})]),_:1})]),_:1}))}});export{ee as default};
