import{r as e,c as s,h as o,H as r}from"./p-BIRwgFLv.js";import{VerdocsEndpoint as i}from"@verdocs/js-sdk";import{u as l}from"./p-COC8ZzcY.js";const d='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 c=class{constructor(o){e(this,o);this.fileSelected=s(this,"fileSelected");this.endpoint=i.getDefault()}handleFileChanged(e){var s,o;this.file=((s=e.target.files)===null||s===void 0?void 0:s[0])||null;(o=this.fileSelected)===null||o===void 0?void 0:o.emit({file:this.file});console.debug("[CHOOSER] Selected file",this.file)}handleSelectFile(e){var s,o;e.stopPropagation();this.file=null;(s=this.fileSelected)===null||s===void 0?void 0:s.emit({file:null});(o=document.getElementById("verdocs-file-chooser"))===null||o===void 0?void 0:o.click()}render(){const e=this.file?"Select a different file":"Select a file from your computer";return o(r,{key:"d2388c9f8fa3aa1de54d359698fd8b9b7a2dd39a"},o("input",{key:"d848ef1b6f60d6e57d7c4939dc44c8ed320e97b3",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)}),o("div",{key:"d94e8fbc7b94f460fdbc51cf055a17fce83a2673",class:"upload-box"},o("div",{key:"02dcf9d0f6c6f687eee3598c06e44b31de34b5c7",class:"selected-filename"},this.file?this.file.name:"Drag a file here"),o("div",{key:"d8c20dddc52d531c6d05078f7c76d2a6924d78e0",class:"or-prefer"},this.file?l:"Or, if you prefer..."),o("verdocs-button",{key:"5d65da28787d44f563ce72685e5458bb1322973d",label:e,size:"small",onClick:e=>this.handleSelectFile(e)})))}};c.style=d;const a='verdocs-progress-bar{font-family:"Inter", "Barlow", sans-serif;width:100%;display:-ms-flexbox;display:flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-progress-bar .labels{display:-ms-flexbox;display:flex;margin:0 0 8px 0;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:justify;justify-content:space-between}verdocs-progress-bar .labels .label{display:-ms-flexbox;display:flex;font-size:14px;font-weight:600;margin-right:8px;color:#33364b}verdocs-progress-bar .bar{display:-ms-flexbox;display:flex;-ms-flex:0 0 10px;flex:0 0 10px;border-radius:5px;background-color:#cccccc}verdocs-progress-bar .bar .slider{display:-ms-flexbox;display:flex;border-radius:5px;background-color:#55bc81}';const t=class{constructor(s){e(this,s);this.label="";this.showPercent=false;this.percent=0}render(){const e=Math.ceil(100*Math.min(this.percent,100)/100);console.log("Rendering progress bar",{widthPercent:e,label:this.label,showPercent:this.showPercent,percent:this.percent});return o(r,{key:"0fccebe012d4176accce818db93549436353a12b"},o("div",{key:"866545106432fe477688dbcff60c0416fe7f6eeb",class:"labels"},this.label&&o("div",{key:"8449f4aed2d3071f285dccb88fd05ce1c13e89e2",class:"label"},this.label),this.showPercent&&o("div",{key:"62c472c07786bb1251743554e543b0e64639449d",class:"label"},this.percent,"%")),o("div",{key:"2eb42e0ebfeab8596a0c08f79b87d8ac132ee243",class:"bar"},o("div",{key:"ad6f73e950a0244ebd6b0e91f1846cb490f41767",class:"slider",style:{width:`${e}%`}})))}};t.style=a;export{c as verdocs_file_chooser,t as verdocs_progress_bar};
//# sourceMappingURL=p-8bc61e88.entry.js.map