import{p as e,H as o,c as s,h as i,d as l,t}from"./p-yZBlG3YQ.js";import{VerdocsEndpoint as r}from"@verdocs/js-sdk";import{u as d}from"./p-BDv5kBUR.js";import{d as c}from"./p-Bdf8pPWm.js";const f=()=>`verdocs-file-chooser{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff;font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif)}verdocs-file-chooser .upload-box{text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;padding:40px 15px;color:rgba(0, 0, 0, 0.54)}verdocs-file-chooser .upload-box svg{width:64px;height:64px;fill:#5c6575}verdocs-file-chooser .selected-filename{font-size:20px;font-weight:bold;overflow-wrap:anywhere}verdocs-file-chooser .or-prefer{height:20px;margin:20px 0;font-size:16px}`;const n=e(class e extends o{constructor(e){super();if(e!==false){this.__registerHost()}this.fileSelected=s(this,"fileSelected");this.endpoint=r.getDefault()}handleFileChanged(e){var o,s;this.file=((o=e.target.files)===null||o===void 0?void 0:o[0])||null;(s=this.fileSelected)===null||s===void 0?void 0:s.emit({file:this.file});console.debug("[CHOOSER] Selected file",this.file)}handleSelectFile(e){var o,s;e.stopPropagation();this.file=null;(o=this.fileSelected)===null||o===void 0?void 0:o.emit({file:null});(s=document.getElementById("verdocs-file-chooser"))===null||s===void 0?void 0:s.click()}render(){const e=this.file?"Select a different file":"Select a file from your computer";return i(l,{key:"9bbcded830636b89e0b47dd545c15117c5b9f8b8"},i("input",{key:"0d8fb69380eb9391ad2e704e07abf29483ed7a01",type:"file",multiple:true,id:"verdocs-file-chooser",accept:"application/pdf,.pdf,.doc,.docx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",style:{display:"none"},onChange:e=>this.handleFileChanged(e)}),i("div",{key:"ac5d2a127e5653ed80effd71e7d5b41024b931a7",class:"upload-box"},i("div",{key:"bfe87d0804272452b31461e4eb714e9336157394",class:"selected-filename"},this.file?this.file.name:"Drag a file here"),i("div",{key:"0999c21ef1c212435cbabd7eca81f8a7463055fe",class:"or-prefer"},this.file?d:"Or, if you prefer..."),i("verdocs-button",{key:"d0b299a80d0cede99f92b06ab512053de0441011",label:e,size:"small",onClick:e=>this.handleSelectFile(e)})))}static get style(){return f()}},[0,"verdocs-file-chooser",{endpoint:[16],file:[32]}]);function a(){if(typeof customElements==="undefined"){return}const e=["verdocs-file-chooser","verdocs-button"];e.forEach((e=>{switch(e){case"verdocs-file-chooser":if(!customElements.get(t(e))){customElements.define(t(e),n)}break;case"verdocs-button":if(!customElements.get(t(e))){c()}break}}))}export{n as V,a as d};
//# sourceMappingURL=p-CLxwSMOV.js.map