System.register(["./index.vue_vue_type_script_setup_true_lang-legacy-LjZ-8uGn.js?v=1773287522785","./index-legacy-DEYz4m3y.js?v=1773287522785","./vue-core-legacy-Cn1vuJ3s.js?v=1773287522785","./ssl-legacy-BRxc0DyI.js?v=1773287522785","./index-legacy-DQdImDha.js?v=1773287522785","./naive-ui-legacy-BW82sq8q.js?v=1773287522785","./prismjs-legacy-BN0FEcG9.js?v=1773287522785"],(function(e,a){"use strict";var r,t,l,n,o,s,d,c,u,p,i,v,x,_,g,f,S,m,y,h,b,w,L;return{setters:[e=>{r=e._},e=>{t=e._},e=>{l=e.k,n=e.R,o=e.r,s=e.e,d=e.$,c=e.Z,u=e.a0,p=e.a9,i=e.j,v=e.aa,x=e._,_=e.aj,g=e.L,f=e.S,S=e.N},e=>{m=e.I},e=>{y=e.m,h=e.c},e=>{b=e.ad,w=e.k,L=e.a1},null],execute:function(){var a=document.createElement("style");a.textContent=".n-alert[data-v-74e286a3]{margin-bottom:16px;--n-content-text-color: #20a53a;--n-color: var(--domains-lets-ssl-upload-text)}.drag-box[data-v-74e286a3]{width:100%;padding:5px;border:2px dashed var(--domains-lets-ssl-upload-border);border-radius:6px}.hover[data-v-74e286a3]{border-color:#20a53a}\n/*$vite$:1*/",document.head.appendChild(a);const k={class:"p-20px"};e("default",h(l({__name:"index",props:{onRefresh:{}},setup(e,{expose:a}){const{t:l}=n(),h=e,{onRefresh:j}=h,$=o(!1),D=o(!1),C=(e,a)=>{a.preventDefault(),$.value="key"!==e&&$.value,D.value="cert"!==e&&D.value;const r=a.dataTransfer?.files;if(!r||0===r.length)return y.error(l("SSL.index_38"));const t=r[0],n=t.name.split(".").pop()?.toLowerCase();if(![".pem",".crt",".cer",".key",".der",".pfx",".p12",".p7b",".p7c",".csr"].includes(`.${n}`))return y.error(l("SSL.index_38"));if(window.FileReader){const a=new FileReader;a.onload=a=>{a.target?.result&&(F[e]=a.target.result)},a.onerror=()=>{y.error(l("SSL.index_39"))},a.readAsText(t)}else y.error(l("SSL.index_40"))},R=o(null),F=s({key:"",cert:""}),U={key:{required:!0,trigger:"change",message:l("SSL.index_35")},cert:{required:!0,trigger:"change",message:l("SSL.index_37")}};return a({onConfirm:async()=>{await(R.value?.validate()),await m(S(F)),y.success(l("Component.UploadFile.index_9")),j?.()}}),(e,a)=>{const l=b,n=t,o=L,s=w,S=r;return d(),c("div",k,[u(l,{type:"success","show-icon":!1},{default:p((()=>[i(v(e.$t("SSL.index_33"))+" ",1),a[8]||(a[8]=x("div",{class:"pt-5px"},"Supported formats: pem, crt, cer, key, der, pfx, p12, p7b, p7c, csr. ",-1))])),_:1,__:[8]}),u(S,{ref_key:"formRef",ref:R,model:f(F),rules:U,"label-placement":"top"},{default:p((()=>[u(s,{class:"w-full flex-nowrap!"},{default:p((()=>[u(o,{label:e.$t("SSL.index_34"),path:"key",class:"w-full"},{default:p((()=>[x("div",{class:g(["drag-box",{hover:f($)}]),onDrop:a[1]||(a[1]=e=>C("key",e)),onDragover:a[2]||(a[2]=_((e=>$.value=!0),["prevent"])),onDragleave:a[3]||(a[3]=_((e=>$.value=!1),["prevent"]))},[u(n,{value:f(F).key,"onUpdate:value":a[0]||(a[0]=e=>f(F).key=e),rows:16,placeholder:e.$t("SSL.index_35")},null,8,["value","placeholder"])],34)])),_:1},8,["label"]),u(o,{label:e.$t("SSL.index_36"),path:"cert",class:"w-full"},{default:p((()=>[x("div",{class:g(["drag-box",{hover:f(D)}]),onDrop:a[5]||(a[5]=e=>C("cert",e)),onDragover:a[6]||(a[6]=_((e=>D.value=!0),["prevent"])),onDragleave:a[7]||(a[7]=_((e=>D.value=!1),["prevent"]))},[u(n,{value:f(F).cert,"onUpdate:value":a[4]||(a[4]=e=>f(F).cert=e),rows:16,placeholder:e.$t("SSL.index_37")},null,8,["value","placeholder"])],34)])),_:1},8,["label"])])),_:1})])),_:1},8,["model"])])}}}),[["__scopeId","data-v-74e286a3"]]))}}}));
