handy-uploader 2.0.2 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- (function(x,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(x=typeof globalThis<"u"?globalThis:x||self,e(x.HandyUploaderVue={},x.Vue))})(this,function(x,e){"use strict";const O=e.defineComponent({__name:"SelectFileIconType",props:{fileFormat:{},size:{default:30}},setup(a){const i=a,t=e.computed(()=>({pdf:{icon:"mdi-file-pdf-outline",color:"red darken-1"},doc:{icon:"mdi-file-word-outline",color:"blue darken-1"},docx:{icon:"mdi-file-word-outline",color:"blue darken-1"},odt:{icon:"mdi-file-word-outline",color:"blue darken-1"},jpg:{icon:"mdi-file-image-outline",color:"deep-purple darken-1"},jpeg:{icon:"mdi-file-image-outline",color:"deep-purple darken-1"},png:{icon:"mdi-file-image-outline",color:"deep-purple darken-1"},tif:{icon:"mdi-file-image-outline",color:"deep-purple darken-1"},bmp:{icon:"mdi-file-image-outline",color:"deep-purple darken-1"},xls:{icon:"mdi-file-excel-outline",color:"teal darken-1"},xlsx:{icon:"mdi-file-excel-outline",color:"teal darken-1"},ppt:{icon:"mdi-file-powerpoint-outline",color:"orange darken-3"},pptx:{icon:"mdi-file-powerpoint-outline",color:"orange darken-3"},pptm:{icon:"mdi-file-powerpoint-outline",color:"orange darken-3"},mp4:{icon:"mdi-file-video-outline",color:"red lighten-1"},mov:{icon:"mdi-file-video-outline",color:"red lighten-1"},flv:{icon:"mdi-file-video-outline",color:"red lighten-1"},wmv:{icon:"mdi-file-video-outline",color:"red lighten-1"},avi:{icon:"mdi-file-video-outline",color:"red lighten-1"},dwg:{icon:"mdi-file-cad",color:"indigo lighten-2"},zip:{icon:"mdi-folder-zip-outline",color:"lime lighten-1"},rar:{icon:"mdi-folder-zip-outline",color:"lime lighten-1"},"7-zip":{icon:"mdi-folder-zip-outline",color:"lime lighten-1"},txt:{icon:"mdi-script-text-outline",color:"light-green darken-3"}})[i.fileFormat]||{icon:"mdi-file-question-outline",color:"indigo lighten-1"});return(o,m)=>{const w=e.resolveComponent("v-icon");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(w,{size:i.size,color:t.value.color,textContent:e.toDisplayString(t.value.icon)},null,8,["size","color","textContent"])])}}});function G(a){const i=a/1024,t=i/1024;return t>=1?{text:`${t.toFixed(2)} MB`,color:t>10?"red":t>5?"orange":"green"}:{text:`${i.toFixed(2)} KB`,color:i>1e3?"orange":"green"}}function W(a,i){var o;const t=((o=a.split(".").pop())==null?void 0:o.toLowerCase())||"";return["jpg","jpeg","png","gif","bmp","svg","webp","tiff"].includes(t)||i!=null&&i.startsWith("image/")?"image":["pdf","doc","docx","txt","rtf","odt"].includes(t)?"document":["xls","xlsx","csv","ods"].includes(t)?"spreadsheet":["ppt","pptx","odp"].includes(t)?"presentation":["zip","rar","7z","tar","gz"].includes(t)?"archive":["mp4","avi","mov","wmv","flv","webm"].includes(t)?"video":["mp3","wav","flac","aac","ogg"].includes(t)?"audio":"file"}function oe(a,i){const t=W(a,i),o={image:{icon:"mdi-file-image",color:"blue"},document:{icon:"mdi-file-document",color:"red"},spreadsheet:{icon:"mdi-file-excel",color:"green"},presentation:{icon:"mdi-file-powerpoint",color:"orange"},archive:{icon:"mdi-folder-zip",color:"purple"},video:{icon:"mdi-file-video",color:"pink"},audio:{icon:"mdi-file-music",color:"teal"},file:{icon:"mdi-file",color:"grey"}};return o[t]||o.file}function Q(a,i){return W(a,i)==="image"}function le(a,i){return a<=i}function ne(a,i){return a<i}function v(a){var o;const i=((o=a.split(".").pop())==null?void 0:o.toLowerCase())||"";return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",bmp:"image/bmp",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp",mp4:"video/mp4",avi:"video/x-msvideo",mov:"video/quicktime",wmv:"video/x-ms-wmv",flv:"video/x-flv",webm:"video/webm",pdf:"application/pdf",doc:"application/msword",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",txt:"text/plain",csv:"text/csv",zip:"application/zip",rar:"application/x-rar-compressed"}[i]||"application/octet-stream"}function ie(a,i){const t=a.replace(/^data:image\/[a-zA-Z]+;base64,/,"");return`data:${i.startsWith("image/")?i:`image/${i}`};base64,${t}`}function ae(a,i=.8,t=1920,o=1080){return new Promise((m,w)=>{const V=document.createElement("canvas"),f=V.getContext("2d"),p=new Image;p.onload=()=>{let{width:u,height:h}=p;if(u>t||h>o){const y=Math.min(t/u,o/h);u*=y,h*=y}V.width=u,V.height=h,f==null||f.drawImage(p,0,0,u,h);const B=V.toDataURL("image/jpeg",i);m(B)},p.onerror=()=>w(new Error("Failed to load image for compression"));const F=new FileReader;F.onload=u=>{var h;p.src=(h=u.target)==null?void 0:h.result},F.onerror=()=>w(new Error("Failed to read file")),F.readAsDataURL(a)})}function ee(a){return new Promise((i,t)=>{const o=new FileReader;o.onload=()=>{const m=o.result,w=m.split(",")[1]||m;i(w)},o.onerror=()=>t(new Error("Failed to read file")),o.readAsDataURL(a)})}const de={key:1,style:{height:"200px","background-color":"#f5f5f5",position:"relative",overflow:"hidden",display:"flex","align-items":"center","justify-content":"center"}},ce=["src","onError"],me={key:1,style:{width:"100%",height:"100%",background:"#e0e0e0",display:"flex","align-items":"center","justify-content":"center"}},pe={class:"d-flex justify-center align-center",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",background:"rgba(0,0,0,0.7)","border-radius":"50%",width:"60px",height:"60px",cursor:"pointer"}},fe={key:2,class:"d-flex justify-center align-center",style:{height:"200px","background-color":"#f5f5f5"}},ge={class:"BYekan"},ue={class:"BYekan"},he={key:0},Y=e.defineComponent({__name:"ThumbnailUploader",props:{lang:{default:"en"},documentAttachment:{},thumb:{type:Boolean,default:!0},cols:{default:4},editPermission:{type:Boolean,default:!0},deletePermission:{type:Boolean,default:!0},selectedLang:{},cardType:{},outlined:{type:Boolean,default:!1},raised:{type:Boolean,default:!1},shaped:{type:Boolean,default:!1},tile:{type:Boolean,default:!1}},emits:["openDeleteDialog","openEditDocumentDialog"],setup(a,{emit:i}){const t=a,o=i,m=l=>{const n=W(l)==="video";return console.log("🎥 Checking if video file:",l,"result:",n,"fileType:",W(l)),n},w=l=>ie(l.base64,l.format),V=l=>{var n;console.error("Image failed to load:",{name:l.name,format:l.format,base64Length:((n=l.base64)==null?void 0:n.length)||0})},f=e.reactive(new Map),p=l=>(console.log("🎬 Starting video thumbnail generation for:",l.name),new Promise((n,d)=>{var P;const c=document.createElement("video"),C=document.createElement("canvas"),N=C.getContext("2d");if(!N){console.error("❌ Canvas context not available"),d(new Error("Canvas context not available"));return}c.crossOrigin="anonymous",c.preload="metadata",c.muted=!0,c.onloadedmetadata=()=>{if(console.log("📹 Video metadata loaded:",{duration:c.duration,width:c.videoWidth,height:c.videoHeight,readyState:c.readyState,networkState:c.networkState}),c.duration===0||isNaN(c.duration)){console.error("❌ Invalid video duration:",c.duration);const U=F(l);u.delete(U),d(new Error("Invalid video duration"));return}if(c.videoWidth===0||c.videoHeight===0){console.error("❌ Invalid video dimensions:",c.videoWidth,"x",c.videoHeight);const U=F(l);u.delete(U),d(new Error("Invalid video dimensions"));return}C.width=c.videoWidth,C.height=c.videoHeight;const T=Math.min(1,c.duration*.1);console.log("⏰ Seeking to time:",T,"of total duration:",c.duration),c.currentTime=T},c.onseeked=()=>{console.log("🎯 Video seeked successfully to:",c.currentTime);try{console.log("🖼️ Canvas setup:",{width:C.width,height:C.height,videoCurrentTime:c.currentTime,videoReadyState:c.readyState}),N.drawImage(c,0,0,C.width,C.height);const U=N.getImageData(0,0,C.width,C.height).data.some(M=>M!==0);console.log("🎨 Canvas content check:",U?"Has content":"Empty/transparent");const _=C.toDataURL("image/jpeg",.8);console.log("✅ Generated thumbnail:",{dataUrlLength:_.length,startsWithData:_.startsWith("data:image/jpeg"),preview:_.substring(0,50)+"..."}),n(_)}catch(T){console.error("❌ Error during thumbnail generation:",T),d(T)}},c.onabort=()=>{console.warn("⚠️ Video loading aborted"),d(new Error("Video loading aborted"))},c.onstalled=()=>{console.warn("⚠️ Video loading stalled")},c.onerror=T=>{console.error("❌ Video failed to load for thumbnail generation:",T),d(new Error("Video failed to load for thumbnail generation"))},c.onloadstart=()=>{console.log("🔄 Video load started")},c.oncanplay=()=>{console.log("▶️ Video can play")};const b=((P=l.base64)==null?void 0:P.replace(/^data:[^;]+;base64,/,""))||"";let D;l.format.startsWith("video/")?D=l.format:(D=v(l.name),D.startsWith("video/")||(D=`video/${l.format}`));const S=`data:${D};base64,${b}`;console.log("🔗 Setting video source:",{fileName:l.name,format:l.format,mimeType:D,base64Length:b.length,videoSrcLength:S.length}),c.src=S})),F=l=>{var n;return`${l.name}_${(n=l.base64)==null?void 0:n.substring(0,50)}`};e.computed(()=>(console.log("🔄 Video thumbnails computed updated:",Array.from(f.keys())),f));const u=new Set,h=l=>{const n=F(l);if(console.log("🔍 Getting video thumbnail for:",l.name,"cache key:",n),f.has(n))return console.log("💾 Returning cached thumbnail for:",l.name),f.get(n);if(u.has(n)){console.log("⏳ Thumbnail already being generated for:",l.name);return}console.log("🚀 No cached thumbnail, generating new one for:",l.name),u.add(n),p(l).then(d=>{console.log("✅ Thumbnail generated and cached for:",l.name),f.set(n,d),u.delete(n),e.nextTick(()=>{console.log("🔄 UI update triggered for:",l.name)})}).catch(d=>{console.error("❌ Failed to generate video thumbnail for:",l.name,d),u.delete(n)})},B=l=>{console.error("Video thumbnail failed to load:",{name:l.name,format:l.format});const n=F(l);f.delete(n)},y=l=>oe(l),z=l=>l.tags.length>0||!!l.description,L=l=>{l.showDetailState=!l.showDetailState},$=(l,n)=>{o("openDeleteDialog",l,n)},s=(l,n)=>{o("openEditDocumentDialog",l,n)},r=()=>{console.log("🎯 Generating thumbnails for videos, total attachments:",t.documentAttachment.length);const l=t.documentAttachment.filter(n=>m(n.file.name));console.log("📹 Found video attachments:",l.length,l.map(n=>n.file.name)),l.forEach(n=>{console.log("🎬 Processing video:",n.file.name),h(n.file)})};return e.watch(()=>t.documentAttachment,r,{immediate:!0}),e.onMounted(r),(l,n)=>{const d=e.resolveComponent("v-img"),c=e.resolveComponent("v-icon"),C=e.resolveComponent("v-card-subtitle"),N=e.resolveComponent("v-chip"),b=e.resolveComponent("v-divider"),D=e.resolveComponent("v-btn"),S=e.resolveComponent("v-tooltip"),P=e.resolveComponent("v-spacer"),T=e.resolveComponent("v-card-actions"),U=e.resolveComponent("v-chip-group"),_=e.resolveComponent("v-card-text"),M=e.resolveComponent("v-expand-transition"),I=e.resolveComponent("v-card"),H=e.resolveComponent("v-col"),q=e.resolveComponent("v-row");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(q,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.documentAttachment,(k,R)=>(e.openBlock(),e.createBlock(H,{key:`attachment-${R}`,cols:"12",md:l.cols,xs:"12"},{default:e.withCtx(()=>[e.createVNode(I,{shaped:l.shaped,outlined:l.outlined,raised:l.raised,tile:l.tile,class:"mx-auto","max-width":"344"},{default:e.withCtx(()=>[e.unref(Q)(k.file.name)?(e.openBlock(),e.createBlock(d,{key:0,src:w(k.file),height:"200px",onError:E=>V(k.file)},null,8,["src","onError"])):m(k.file.name)?(e.openBlock(),e.createElementBlock("div",de,[h(k.file)?(e.openBlock(),e.createElementBlock("img",{key:0,src:h(k.file),style:{width:"100%",height:"100%","object-fit":"cover"},onError:E=>B(k.file)},null,40,ce)):(e.openBlock(),e.createElementBlock("div",me,[e.createVNode(c,{size:"60",color:"grey"},{default:e.withCtx(()=>n[0]||(n[0]=[e.createTextVNode("mdi-video")])),_:1})])),e.createElementVNode("div",pe,[e.createVNode(c,{color:"white",size:"30"},{default:e.withCtx(()=>n[1]||(n[1]=[e.createTextVNode("mdi-play")])),_:1})])])):(e.openBlock(),e.createElementBlock("div",fe,[e.createVNode(c,{size:"120",color:y(k.file.name).color},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(y(k.file.name).icon),1)]),_:2},1032,["color"])])),e.createVNode(C,{class:"text-truncate py-2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(k.file.name),1)]),_:2},1024),e.createVNode(C,{class:"pt-2 pb-3"},{default:e.withCtx(()=>[e.createVNode(N,{color:e.unref(G)(k.file.size).color,label:"","text-color":"white"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(G)(k.file.size).text)+" ",1),e.createVNode(c,{right:""},{default:e.withCtx(()=>n[2]||(n[2]=[e.createTextVNode("mdi-harddisk")])),_:1})]),_:2},1032,["color"])]),_:2},1024),e.createVNode(b,{class:"mx-4"}),e.createVNode(T,{style:{padding:"0"}},{default:e.withCtx(()=>[e.createVNode(S,{right:""},{activator:e.withCtx(({props:E})=>[l.deletePermission?(e.openBlock(),e.createBlock(D,e.mergeProps({key:0,text:"",fab:"",ref_for:!0},E,{onClick:K=>$(R,"")}),{default:e.withCtx(()=>[e.createVNode(c,{color:"red"},{default:e.withCtx(()=>n[3]||(n[3]=[e.createTextVNode("mdi-trash-can-outline")])),_:1})]),_:2},1040,["onClick"])):e.createCommentVNode("",!0)]),default:e.withCtx(()=>[e.createElementVNode("span",ge,e.toDisplayString(l.selectedLang[l.lang].delete),1)]),_:2},1024),e.createVNode(S,{right:""},{activator:e.withCtx(({props:E})=>[l.editPermission?(e.openBlock(),e.createBlock(D,e.mergeProps({key:0,text:"",fab:"",ref_for:!0},E,{onClick:K=>s(k,R)}),{default:e.withCtx(()=>[e.createVNode(c,{color:"green"},{default:e.withCtx(()=>n[4]||(n[4]=[e.createTextVNode("mdi-pencil-outline")])),_:1})]),_:2},1040,["onClick"])):e.createCommentVNode("",!0)]),default:e.withCtx(()=>[e.createElementVNode("span",ue,e.toDisplayString(l.selectedLang[l.lang].edit),1)]),_:2},1024),e.createVNode(P),z(k.file)?(e.openBlock(),e.createBlock(D,{key:0,icon:"",onClick:E=>L(k.file)},{default:e.withCtx(()=>[e.createVNode(c,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(k.file.showDetailState?"mdi-chevron-up":"mdi-chevron-down"),1)]),_:2},1024)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0)]),_:2},1024),e.createVNode(M,null,{default:e.withCtx(()=>[z(k.file)?e.withDirectives((e.openBlock(),e.createElementBlock("div",he,[e.createVNode(b),k.file.tags.length?(e.openBlock(),e.createBlock(U,{key:0,multiple:"","active-class":"primary--text",class:"pa-2"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.file.tags,(E,K)=>(e.openBlock(),e.createBlock(N,{key:`tag-${K}`,class:"ma-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(E),1)]),_:2},1024))),128))]),_:2},1024)):e.createCommentVNode("",!0),k.file.description?(e.openBlock(),e.createBlock(_,{key:1,class:"text-justify"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(k.file.description),1)]),_:2},1024)):e.createCommentVNode("",!0)],512)),[[e.vShow,k.file.showDetailState]]):e.createCommentVNode("",!0)]),_:2},1024)]),_:2},1032,["shaped","outlined","raised","tile"])]),_:2},1032,["md"]))),128))]),_:1})])}}}),Ce={key:0,class:"text-left"},be={class:"text-left"},we={class:"text-left"},ke={class:"text-left"},xe={key:0},ye={class:"BYekan"},X=e.defineComponent({__name:"TableUploader",props:{documentAttachment:{},thumb:{type:Boolean,default:!0},lang:{default:"en"},cols:{default:4},editPermission:{type:Boolean,default:!0},deletePermission:{type:Boolean,default:!0},tableThumbColumn:{type:Boolean},tableFixedHeader:{type:Boolean,default:!0},tableHeight:{default:400},selectedLang:{}},emits:["openDeleteDialog","openEditDocumentDialog"],setup(a,{emit:i}){const t=a,o=i,m=f=>{var p;return f&&((p=f.split(".").pop())==null?void 0:p.toLowerCase())||""},w=(f,p)=>{o("openDeleteDialog",f,p)},V=(f,p)=>{o("openEditDocumentDialog",f,p)};return(f,p)=>{const F=e.resolveComponent("v-img"),u=e.resolveComponent("v-icon"),h=e.resolveComponent("v-chip"),B=e.resolveComponent("v-card-subtitle"),y=e.resolveComponent("v-btn"),z=e.resolveComponent("v-tooltip"),L=e.resolveComponent("v-simple-table"),$=e.resolveComponent("v-col"),s=e.resolveComponent("v-row");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(s,null,{default:e.withCtx(()=>[e.createVNode($,{cols:"12",lg:"12",md:"12",xs:"12"},{default:e.withCtx(()=>[e.createVNode(L,{"fixed-header":t.tableFixedHeader,height:t.tableHeight+"px"},{default:e.withCtx(()=>[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[t.tableThumbColumn?(e.openBlock(),e.createElementBlock("th",Ce,e.toDisplayString(t.selectedLang[f.lang].table.thumb),1)):e.createCommentVNode("",!0),e.createElementVNode("th",be,e.toDisplayString(t.selectedLang[f.lang].table.name),1),e.createElementVNode("th",we,e.toDisplayString(t.selectedLang[f.lang].table.size),1),e.createElementVNode("th",ke,e.toDisplayString(t.selectedLang[f.lang].table.action.action),1)])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.documentAttachment,(r,l)=>{var n;return e.openBlock(),e.createElementBlock("tr",{key:`attachment-${l}`},[t.tableThumbColumn?(e.openBlock(),e.createElementBlock("td",xe,[r.file.name&&["jpg","jpeg","png","tif","bmp"].includes(((n=r.file.name.split(".").pop())==null?void 0:n.toLowerCase())||"")?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.thumb?(e.openBlock(),e.createBlock(F,{key:0,style:{margin:"10px"},src:"data:"+r.file.format+","+r.file.base64,height:"50px",width:"50px"},null,8,["src"])):(e.openBlock(),e.createBlock(u,{key:1,style:{"margin-left":"10px"},size:"50","file-word-outline":"",color:"deep-purple darken-1"},{default:e.withCtx(()=>p[0]||(p[0]=[e.createTextVNode("mdi-file-image-outline")])),_:1}))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[m(r.file.name)==="pdf"?(e.openBlock(),e.createBlock(u,{key:0,style:{"margin-left":"10px"},size:"50","file-word-outline":"",color:"red darken-1"},{default:e.withCtx(()=>p[1]||(p[1]=[e.createTextVNode("mdi-file-pdf-outline")])),_:1})):["doc","docx","odt"].includes(m(r.file.name))?(e.openBlock(),e.createBlock(u,{key:1,style:{"margin-left":"10px"},size:"50","file-word-outline":"",color:"blue darken-1"},{default:e.withCtx(()=>p[2]||(p[2]=[e.createTextVNode("mdi-file-word-outline")])),_:1})):["xls","xlsx"].includes(m(r.file.name))?(e.openBlock(),e.createBlock(u,{key:2,style:{"margin-left":"10px"},size:"50","file-word-outline":"",color:"teal darken-1"},{default:e.withCtx(()=>p[3]||(p[3]=[e.createTextVNode("mdi-file-excel-outline")])),_:1})):["pptx","pptm","ppt"].includes(m(r.file.name))?(e.openBlock(),e.createBlock(u,{key:3,style:{"margin-left":"10px"},size:"50","file-word-outline":"",color:"orange darken-3"},{default:e.withCtx(()=>p[4]||(p[4]=[e.createTextVNode("mdi-file-powerpoint-outline")])),_:1})):["mp4","mov","flv","wmv","avi"].includes(m(r.file.name))?(e.openBlock(),e.createBlock(u,{key:4,style:{"margin-left":"10px"},size:"50","file-word-outline":"",color:"red lighten-1"},{default:e.withCtx(()=>p[5]||(p[5]=[e.createTextVNode("mdi-file-video-outline")])),_:1})):m(r.file.name)==="dwg"?(e.openBlock(),e.createBlock(u,{key:5,style:{"margin-left":"10px"},size:"50","file-word-outline":"",color:"indigo lighten-2"},{default:e.withCtx(()=>p[6]||(p[6]=[e.createTextVNode("mdi-file-cad")])),_:1})):["zip","rar","7-zip"].includes(m(r.file.name))?(e.openBlock(),e.createBlock(u,{key:6,size:"120","file-word-outline":"",color:"lime lighten-1"},{default:e.withCtx(()=>p[7]||(p[7]=[e.createTextVNode("mdi-folder-zip-outline")])),_:1})):m(r.file.name)==="txt"?(e.openBlock(),e.createBlock(u,{key:7,style:{"margin-left":"10px"},size:"50","file-word-outline":"",color:"light-green darken-3"},{default:e.withCtx(()=>p[8]||(p[8]=[e.createTextVNode("mdi-script-text-outline")])),_:1})):(e.openBlock(),e.createBlock(u,{key:8,"x-large":"","file-word-outline":"",color:"indigo lighten-1"},{default:e.withCtx(()=>p[9]||(p[9]=[e.createTextVNode("mdi-file-question-outline")])),_:1}))],64))])):e.createCommentVNode("",!0),e.createElementVNode("td",null,e.toDisplayString(r.file.name),1),e.createElementVNode("td",null,[Number((r.file.size/1e3).toFixed(1))<1024?(e.openBlock(),e.createBlock(B,{key:0,class:"mt2"},{default:e.withCtx(()=>[e.createVNode(h,{color:"teal lighten-2",label:"","text-color":"white"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Number((r.file.size/1e3).toFixed(1))+f.selectedLang[f.lang].size.kb)+" ",1),e.createVNode(u,{right:""},{default:e.withCtx(()=>p[10]||(p[10]=[e.createTextVNode("mdi-harddisk")])),_:1})]),_:2},1024)]),_:2},1024)):e.createCommentVNode("",!0),Number((r.file.size/1e3).toFixed(1))>1024?(e.openBlock(),e.createBlock(B,{key:1},{default:e.withCtx(()=>[e.createVNode(h,{color:"teal lighten-2",label:"","text-color":"white"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Number((r.file.size/1e3/1024).toFixed(1))+f.selectedLang[f.lang].size.mb)+" ",1),e.createVNode(u,{right:""},{default:e.withCtx(()=>p[11]||(p[11]=[e.createTextVNode("mdi-harddisk")])),_:1})]),_:2},1024)]),_:2},1024)):e.createCommentVNode("",!0)]),e.createElementVNode("td",null,[e.createVNode(z,{top:""},{activator:e.withCtx(({props:d})=>[f.deletePermission?(e.openBlock(),e.createBlock(y,e.mergeProps({key:0,icon:"",color:"red",ref_for:!0},d,{onClick:c=>w(l,"")}),{default:e.withCtx(()=>[e.createVNode(u,null,{default:e.withCtx(()=>p[12]||(p[12]=[e.createTextVNode("mdi-delete")])),_:1})]),_:2},1040,["onClick"])):e.createCommentVNode("",!0)]),default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(f.selectedLang[f.lang].table.action.deleteTooltip),1)]),_:2},1024),e.createVNode(z,{top:""},{activator:e.withCtx(({props:d})=>[f.editPermission?(e.openBlock(),e.createBlock(y,e.mergeProps({key:0,text:"",fab:"",ref_for:!0},d,{onClick:c=>V(r,l)}),{default:e.withCtx(()=>[e.createVNode(u,{color:"green"},{default:e.withCtx(()=>p[13]||(p[13]=[e.createTextVNode("mdi-pencil-outline")])),_:1})]),_:2},1040,["onClick"])):e.createCommentVNode("",!0)]),default:e.withCtx(()=>[e.createElementVNode("span",ye,e.toDisplayString(f.selectedLang[f.lang].edit),1)]),_:2},1024)])])}),128))])]),_:1},8,["fixed-header","height"])]),_:1})]),_:1})])}}}),Z=e.defineComponent({__name:"SimpleUploader",props:{documentAttachment:{},lang:{default:"en"},thumb:{type:Boolean,default:!0},cols:{default:4},editPermission:{type:Boolean,default:!0},cardType:{},outlined:{type:Boolean},raised:{type:Boolean},shaped:{type:Boolean},tile:{type:Boolean},deletePermission:{type:Boolean,default:!0},selectedLang:{}},emits:["setCardTheme","openDeleteDialog","openEditDocumentDialog"],setup(a,{emit:i}){const t=a,o=i,m=u=>{const h=u/1e3;return h<1024?`${h.toFixed(1)} ${t.selectedLang[t.lang].size.kb}`:`${(h/1024).toFixed(1)} ${t.selectedLang[t.lang].size.mb}`},w=u=>{var h;return["jpg","jpeg","png","tif","bmp"].includes(((h=u.split(".").pop())==null?void 0:h.toLowerCase())||"")},V=u=>{var y;const h=(y=u.split(".").pop())==null?void 0:y.toLowerCase();return h&&{pdf:"mdi-file-pdf-outline",doc:"mdi-file-word-outline",docx:"mdi-file-word-outline",odt:"mdi-file-word-outline",jpg:"mdi-file-image-outline",jpeg:"mdi-file-image-outline",png:"mdi-file-image-outline",tif:"mdi-file-image-outline",bmp:"mdi-file-image-outline",xls:"mdi-file-excel-outline",xlsx:"mdi-file-excel-outline",pptx:"mdi-file-powerpoint-outline",pptm:"mdi-file-powerpoint-outline",ppt:"mdi-file-powerpoint-outline",mp4:"mdi-file-video-outline",mov:"mdi-file-video-outline",flv:"mdi-file-video-outline",wmv:"mdi-file-video-outline",avi:"mdi-file-video-outline",dwg:"mdi-file-cad",zip:"mdi-folder-zip-outline",rar:"mdi-folder-zip-outline","7-zip":"mdi-folder-zip-outline",txt:"mdi-script-text-outline"}[h]||"mdi-file-question-outline"},f=u=>{var y;const h=(y=u.split(".").pop())==null?void 0:y.toLowerCase();return h&&{pdf:"red darken-1",doc:"blue darken-1",docx:"blue darken-1",odt:"blue darken-1",jpg:"deep-purple darken-1",jpeg:"deep-purple darken-1",png:"deep-purple darken-1",tif:"deep-purple darken-1",bmp:"deep-purple darken-1",xls:"teal darken-1",xlsx:"teal darken-1",pptx:"orange darken-3",pptm:"orange darken-3",ppt:"orange darken-3",mp4:"red lighten-1",mov:"red lighten-1",flv:"red lighten-1",wmv:"red lighten-1",avi:"red lighten-1",dwg:"indigo lighten-2",zip:"lime lighten-1",rar:"lime lighten-1","7-zip":"lime lighten-1",txt:"light-green darken-3"}[h]||"indigo lighten-1"},p=(u,h)=>o("openDeleteDialog",u,h),F=(u,h)=>o("openEditDocumentDialog",u,h);return(u,h)=>{const B=e.resolveComponent("v-list-item-subtitle"),y=e.resolveComponent("v-icon"),z=e.resolveComponent("v-chip"),L=e.resolveComponent("v-list-item-content"),$=e.resolveComponent("v-img"),s=e.resolveComponent("v-avatar"),r=e.resolveComponent("v-list-item-title"),l=e.resolveComponent("v-list-item"),n=e.resolveComponent("v-divider"),d=e.resolveComponent("v-btn"),c=e.resolveComponent("v-tooltip"),C=e.resolveComponent("v-spacer"),N=e.resolveComponent("v-card-actions"),b=e.resolveComponent("v-chip-group"),D=e.resolveComponent("v-card-text"),S=e.resolveComponent("v-expand-transition"),P=e.resolveComponent("v-card"),T=e.resolveComponent("v-col"),U=e.resolveComponent("v-row");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(U,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.documentAttachment,(_,M)=>(e.openBlock(),e.createBlock(T,{key:`attachment-${M}`,cols:"12",md:t.cols,xs:"12"},{default:e.withCtx(()=>[e.createVNode(P,{shaped:t.shaped,outlined:t.outlined,raised:t.raised,tile:t.tile},{default:e.withCtx(()=>[e.createVNode(l,{"three-line":""},{default:e.withCtx(()=>[e.createVNode(L,null,{default:e.withCtx(()=>[e.createVNode(B,{color:"blue-grey darken-3"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(_.file.name),1)]),_:2},1024),e.createVNode(B,null,{default:e.withCtx(()=>[e.createVNode(z,{color:"teal lighten-2",label:"","text-color":"white"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m(_.file.size))+" ",1),e.createVNode(y,{right:""},{default:e.withCtx(()=>h[0]||(h[0]=[e.createTextVNode("mdi-harddisk")])),_:1})]),_:2},1024)]),_:2},1024)]),_:2},1024),e.createVNode(l,null,{prepend:e.withCtx(()=>[e.createVNode(s,{size:"80",color:"blue-grey lighten-5"},{default:e.withCtx(()=>[w(_.file.name)&&t.thumb?(e.openBlock(),e.createBlock($,{key:0,src:"data:"+_.file.format+","+_.file.base64},null,8,["src"])):(e.openBlock(),e.createBlock(y,{key:1,color:f(_.file.name),size:"50"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(V(_.file.name)),1)]),_:2},1032,["color"]))]),_:2},1024)]),default:e.withCtx(()=>[e.createVNode(r,null,{default:e.withCtx(()=>h[1]||(h[1]=[e.createTextVNode("File Title Here")])),_:1})]),_:2},1024)]),_:2},1024),e.createVNode(n,{class:"mx-4"}),e.createVNode(N,{style:{padding:"0"}},{default:e.withCtx(()=>[e.createVNode(c,{right:""},{activator:e.withCtx(({props:I})=>[t.deletePermission?(e.openBlock(),e.createBlock(d,e.mergeProps({key:0,text:"",fab:"",ref_for:!0},I,{onClick:H=>p(M,"")}),{default:e.withCtx(()=>[e.createVNode(y,{color:"red"},{default:e.withCtx(()=>h[2]||(h[2]=[e.createTextVNode("mdi-trash-can-outline")])),_:1})]),_:2},1040,["onClick"])):e.createCommentVNode("",!0)]),default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(t.selectedLang[u.lang].delete),1)]),_:2},1024),e.createVNode(c,{right:""},{activator:e.withCtx(({props:I})=>[t.editPermission?(e.openBlock(),e.createBlock(d,e.mergeProps({key:0,text:"",fab:"",ref_for:!0},I,{onClick:H=>F(_,M)}),{default:e.withCtx(()=>[e.createVNode(y,{color:"green"},{default:e.withCtx(()=>h[3]||(h[3]=[e.createTextVNode("mdi-pencil-outline")])),_:1})]),_:2},1040,["onClick"])):e.createCommentVNode("",!0)]),default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(t.selectedLang[u.lang].edit),1)]),_:2},1024),e.createVNode(C),_.file.tags.length>0||_.file.description?(e.openBlock(),e.createBlock(d,{key:0,icon:"",onClick:e.withModifiers(I=>_.file.showDetailState=!_.file.showDetailState,["prevent"])},{default:e.withCtx(()=>[e.createVNode(y,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(_.file.showDetailState?"mdi-chevron-up":"mdi-chevron-down"),1)]),_:2},1024)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0)]),_:2},1024),e.createVNode(S,null,{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",null,[e.createVNode(n),_.file.tags.length?(e.openBlock(),e.createBlock(b,{key:0,multiple:"","active-class":"primary--text",style:{padding:"8px"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.file.tags,(I,H)=>(e.openBlock(),e.createBlock(z,{key:`tag-${H}`,style:{margin:"5px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(I),1)]),_:2},1024))),128))]),_:2},1024)):e.createCommentVNode("",!0),_.file.description?(e.openBlock(),e.createBlock(D,{key:1,style:{"text-align":"justify"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(_.file.description),1)]),_:2},1024)):e.createCommentVNode("",!0)],512),[[e.vShow,_.file.showDetailState]])]),_:2},1024)]),_:2},1032,["shaped","outlined","raised","tile"])]),_:2},1032,["md"]))),128))]),_:1})])}}}),J=e.defineComponent({__name:"InsertButton",props:{documentAttachment:{},badgeCounter:{type:Boolean},btnColor:{},lang:{},maxFileCount:{},selectedLang:{}},emits:["openInputDocumentModal"],setup(a,{emit:i}){const t=i,o=a,m=()=>{t("openInputDocumentModal")};return(w,V)=>{const f=e.resolveComponent("v-btn"),p=e.resolveComponent("v-badge");return e.openBlock(),e.createElementBlock("div",null,[o.badgeCounter?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[o.documentAttachment.length>0?(e.openBlock(),e.createBlock(p,{key:0,bordered:"",color:o.documentAttachment.length===o.maxFileCount?"error":"success",overlap:"",content:w.documentAttachment.length},{default:e.withCtx(()=>[e.createVNode(f,{color:o.btnColor,onClick:m,class:"mb-4"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.selectedLang[w.lang].insertFile),1)]),_:1},8,["color"])]),_:1},8,["color","content"])):(e.openBlock(),e.createBlock(f,{key:1,color:o.btnColor,onClick:m,class:"mb-4"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.selectedLang[w.lang].insertFile),1)]),_:1},8,["color"]))],64)):e.createCommentVNode("",!0),o.badgeCounter?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(f,{key:1,color:w.btnColor,onClick:m,class:"mb-4"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.selectedLang[w.lang].insertFile),1)]),_:1},8,["color"]))])}}}),re={en:{insertFile:"Insert File",insertNewFile:"Insert New File",add:"Add",delete:"Delete",edit:"Edit",deleteDialog:{message:"Are you sure you want to delete the file?",cancel:"cancel"},table:{thumb:"Thumb",name:"Name",size:"Size",tags:"tags",action:{action:"Action",deleteTooltip:"Delete"}},size:{kb:"KB",mb:"MB"},maxFileSizeAlert:"Max file Size is",maxFileCountAlert:"Max file Count is",fileName:"File Name",fileDescription:"File Description",fileTags:"File Tags"},fa:{insertFile:"افزودن فایل",insertNewFile:"افزودن فایل جدید",add:"افزودن",delete:"حذف",edit:"ویرایش",deleteDialog:{message:"آیا برای حذف فایل اطمینان دارید؟",cancel:"لغو"},table:{thumb:"پیش نمایش",name:"نام",size:"حجم",action:{action:"عملیات",deleteTooltip:"حذف"}},size:{kb:"کیلو بایت",mb:"مگابایت"},maxFileSizeAlert:"حداکثر حجم فایل انتحابی ",maxFileCountAlert:"حداکثر تعداد فایل انتخابی",fileName:"نام فایل",fileDescription:"توضیحات فایل",fileTags:"برچسب فایل"},fr:{insertFile:"Insérer un fichier",insertNewFile:"Insérer un nouveau fichier",add:"Ajouter",delete:"Supprimer",edit:"Éditer",deleteDialog:{message:"Voulez-vous vraiment supprimer le fichier?",cancel:"Annuler"},table:{thumb:"la vignette",name:"Nom",size:"Taille",action:{action:"Action",deleteTooltip:"Supprimer"}},size:{kb:"KB",mb:"MB"},maxFileSizeAlert:"La taille maximale du fichier est",maxFileCountAlert:"Le nombre maximal de fichiers est",fileName:"Nom de fichier",fileDescription:"description du fichier",fileTags:"Balises de fichier"},ch:{insertFile:"插入档案",insertNewFile:"插入新文件",add:"加",delete:"删除",edit:"编辑",deleteDialog:{message:"您确定要删除文件吗?",cancel:"取消"},table:{thumb:"缩图",name:"名称",size:"尺寸",action:{action:"行动",deleteTooltip:"删除"}},size:{kb:"KB",mb:"MB"},maxFileSizeAlert:"档案大小上限为",maxFileCountAlert:"现“最大文件数”为",fileName:"文档名称",fileDescription:"文件描述",fileTags:"文件标签"},ar:{insertFile:"إدراج ملف",insertNewFile:"إدراج ملف جديد",add:"أضف",delete:"حذف",edit:"تعديل",deleteDialog:{message:"هل أنت متأكد أنك تريد حذف الملف؟",cancel:"إلغاء"},table:{thumb:"ظفري",name:"اسم",size:"بحجم",action:{action:"عمل",deleteTooltip:"حذف"}},size:{kb:"کیلو بایت",mb:"ميغا بايت"},maxFileSizeAlert:"الحجم الأقصى للملف هو",maxFileCountAlert:"الحد الأقصى لعدد الملفات هو",fileName:"اسم الملف",fileDescription:"وصف الملف",fileTags:"علامات الملف"}};function _e(a,i={}){const{maxFileSize:t=5*1024*1024,maxFileCount:o=10,imageCompressor:m=!1,imageCompressLevel:w=.8,fileAccept:V="*"}=i,f=e.ref(!1),p=e.ref({show:!1,text:"",color:"success"}),F=e.computed(()=>a.value.length),u=e.computed(()=>F.value<o),h=e.computed(()=>a.value.reduce((l,n)=>l+n.file.size,0));function B(l,n="success"){p.value={show:!0,text:l,color:n}}function y(l){var n;if(!le(l.size,t))return{valid:!1,error:`File size exceeds maximum allowed size of ${(t/1048576).toFixed(1)}MB`};if(!ne(F.value,o))return{valid:!1,error:`Maximum file count of ${o} reached`};if(V!=="*"){const d=V.split(",").map(b=>b.trim()),c=`.${(n=l.name.split(".").pop())==null?void 0:n.toLowerCase()}`,C=l.type;if(!d.some(b=>b.startsWith(".")?b===c:b.includes("/*")?C.startsWith(b.replace("/*","")):b===C))return{valid:!1,error:`File type not accepted. Allowed types: ${V}`}}return{valid:!0}}async function z(l){let n;if(m&&Q(l.name,l.type))try{n=(await ae(l,w)).split(",")[1]}catch(C){console.warn("Image compression failed, using original file:",C),n=await ee(l)}else n=await ee(l);const d=G(l.size),c=v(l.name);return{base64:n,size:d.text,name:l.name,tags:[],description:"",showDetailState:!1,format:c}}async function L(l){if(f.value)return!1;f.value=!0;const n=Array.from(l),d=[];for(const c of n){const C=y(c);C.valid?d.push(c):B(C.error,"error")}if(d.length===0)return f.value=!1,!1;try{const C=(await Promise.all(d.map(b=>z(b)))).map(b=>{var D;return{file:{name:b.name,format:b.format,base64:b.base64,size:((D=d.find(S=>S.name===b.name))==null?void 0:D.size)||0,tags:b.tags,description:b.description,showDetailState:b.showDetailState}}});a.value.push(...C);const N=d.length===1?`File "${d[0].name}" uploaded successfully`:`${d.length} files uploaded successfully`;return B(N,"success"),!0}catch(c){return console.error("File upload error:",c),B("Failed to upload files. Please try again.","error"),!1}finally{f.value=!1}}function $(l){if(l>=0&&l<a.value.length){const n=a.value[l];return a.value.splice(l,1),B(`File "${n.file.name}" removed`,"warning"),!0}return!1}function s(l,n){if(l>=0&&l<a.value.length){const d=a.value[l].file;return Object.assign(d,n),B("File updated successfully","success"),!0}return!1}function r(){const l=a.value.length;a.value.splice(0),B(`${l} files cleared`,"warning")}return{isUploading:f,snackbar:p,fileCount:F,canAddMoreFiles:u,totalSize:h,uploadFiles:L,removeFile:$,updateFileMetadata:s,clearAllFiles:r,validateFile:y,showSnackbar:B}}function Me(a){return a}function Ve(a={}){const{maxErrors:i=10,autoRemoveTimeout:t=5e3,logToConsole:o=!0}=a,m=e.ref([]),w=e.ref(!1);function V(){return`error_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}function f(n,d="error",c,C){const N={id:V(),message:n,type:d,timestamp:new Date,context:c,action:C};return o&&(d==="error"?console.error:d==="warning"?console.warn:d==="info"?console.info:console.log)(`[${d.toUpperCase()}] ${n}`,c||""),m.value.unshift(N),m.value.length>i&&(m.value=m.value.slice(0,i)),t>0&&setTimeout(()=>{p(N.id)},t),N.id}function p(n){const d=m.value.findIndex(c=>c.id===n);return d!==-1?(m.value.splice(d,1),!0):!1}function F(){m.value=[]}function u(n){m.value=m.value.filter(d=>d.type!==n)}async function h(n,d,c){w.value=!0;try{return await n()}catch(C){const N=d||(C instanceof Error?C.message:"An unexpected error occurred");return f(N,"error",{...c,originalError:C instanceof Error?C.message:String(C)}),null}finally{w.value=!1}}function B(n,d,c){return n||f(d,"error",c),n}function y(n,d){return f(n,"success",d)}function z(n,d){return f(n,"warning",d)}function L(n,d){return f(n,"info",d)}function $(n){return m.value.filter(d=>d.type===n)}function s(){return m.value[0]||null}function r(n){return n?m.value.some(d=>d.type===n):m.value.length>0}const l={fileSizeExceeded:(n,d)=>f(`File "${n}" exceeds maximum size of ${(d/(1024*1024)).toFixed(1)}MB`,"error",{fileName:n,maxSize:d,category:"file-upload"}),fileCountExceeded:n=>f(`Maximum file count of ${n} reached`,"error",{maxCount:n,category:"file-upload"}),invalidFileType:(n,d)=>f(`File "${n}" type not allowed. Accepted types: ${d}`,"error",{fileName:n,allowedTypes:d,category:"file-upload"}),uploadFailed:(n,d)=>f(`Failed to upload "${n}"${d?`: ${d}`:""}`,"error",{fileName:n,reason:d,category:"file-upload"}),compressionFailed:n=>f(`Image compression failed for "${n}", using original file`,"warning",{fileName:n,category:"file-upload"})};return{errors:m,isLoading:w,addError:f,removeError:p,clearErrors:F,clearErrorsByType:u,handleAsync:h,validate:B,showSuccess:y,showWarning:z,showInfo:L,getErrorsByType:$,getLatestError:s,hasErrors:r,fileUploadErrors:l}}function je(a){return a}function Be(a){const i=["simple","thumbnail","table"],t={isValid:!0,errors:[],warnings:[]};return typeof a!="string"?(t.isValid=!1,t.errors.push("File uploader type must be a string")):i.includes(a)||(t.isValid=!1,t.errors.push(`File uploader type must be one of: ${i.join(", ")}`)),t}function Ne(a){const i=["default","outlined","shaped","raised","tile"],t={isValid:!0,errors:[],warnings:[]};return a!==void 0&&typeof a!="string"?(t.isValid=!1,t.errors.push("Card type must be a string")):a&&!i.includes(a)&&(t.isValid=!1,t.errors.push(`Card type must be one of: ${i.join(", ")}`)),t}function De(a){const i=["en","fa","fr","ch","ar"],t={isValid:!0,errors:[],warnings:[]};return typeof a!="string"?(t.isValid=!1,t.errors.push("Language code must be a string")):i.includes(a)||(t.isValid=!1,t.errors.push(`Language code must be one of: ${i.join(", ")}`)),t}function Fe(a){const i={isValid:!0,errors:[],warnings:[]};return typeof a!="number"?(i.isValid=!1,i.errors.push("File size must be a number")):a<=0?(i.isValid=!1,i.errors.push("File size must be greater than 0")):a>100*1024*1024&&i.warnings.push("File size limit is very large (>100MB), consider reducing for better performance"),i}function Te(a){const i={isValid:!0,errors:[],warnings:[]};return typeof a!="number"?(i.isValid=!1,i.errors.push("File count must be a number")):a<0?(i.isValid=!1,i.errors.push("File count cannot be negative")):a>100&&i.warnings.push("File count limit is very high (>100), consider reducing for better performance"),i}function Se(a){const i={isValid:!0,errors:[],warnings:[]};return typeof a!="number"?(i.isValid=!1,i.errors.push("Compression level must be a number")):a<0||a>1?(i.isValid=!1,i.errors.push("Compression level must be between 0 and 1")):a<.1?i.warnings.push("Very low compression level may result in poor image quality"):a>.9&&i.warnings.push("Very high compression level may not reduce file size significantly"),i}function ze(a){const i={isValid:!0,errors:[],warnings:[]};return a!==void 0&&typeof a!="string"?(i.isValid=!1,i.errors.push("File accept pattern must be a string")):a&&a.trim()===""&&i.warnings.push("Empty file accept pattern will accept all files"),i}function Ae(a){const i={isValid:!0,errors:[],warnings:[]};return typeof a!="number"?(i.isValid=!1,i.errors.push("Columns count must be a number")):(a<1||a>12)&&(i.isValid=!1,i.errors.push("Columns count must be between 1 and 12")),i}function Le(a){const i={isValid:!0,errors:[],warnings:[]};return a!==void 0&&typeof a!="number"?(i.isValid=!1,i.errors.push("Table height must be a number")):a&&a<100?i.warnings.push("Table height is very small (<100px), content may not be visible"):a&&a>1e3&&i.warnings.push("Table height is very large (>1000px), consider reducing for better UX"),i}function Ee(a){const i={isValid:!0,errors:[],warnings:[]};return Array.isArray(a)?(a.forEach((t,o)=>{if(!t||typeof t!="object"){i.errors.push(`Attachment at index ${o} must be an object`);return}if(!t.file||typeof t.file!="object"){i.errors.push(`Attachment at index ${o} must have a file property`);return}const m=t.file;["name","format","base64","size"].forEach(V=>{V in m||i.errors.push(`File at index ${o} is missing required field: ${V}`)}),m.name&&typeof m.name!="string"&&i.errors.push(`File name at index ${o} must be a string`),m.format&&typeof m.format!="string"&&i.errors.push(`File format at index ${o} must be a string`),m.base64&&typeof m.base64!="string"&&i.errors.push(`File base64 at index ${o} must be a string`),m.size&&typeof m.size!="number"&&i.errors.push(`File size at index ${o} must be a number`),m.tags&&!Array.isArray(m.tags)&&i.errors.push(`File tags at index ${o} must be an array`)}),i.errors.length>0&&(i.isValid=!1),i):(i.isValid=!1,i.errors.push("Document attachment must be an array"),i)}function $e(a){const i={isValid:!0,errors:[],warnings:[]};return[{key:"fileUploaderType",validator:Be},{key:"cardType",validator:Ne},{key:"lang",validator:De},{key:"maxFileSize",validator:Fe},{key:"maxFileCount",validator:Te},{key:"imageCompressLevel",validator:Se},{key:"fileAccept",validator:ze},{key:"cols",validator:Ae},{key:"tableHeight",validator:Le},{key:"documentAttachment",validator:Ee}].forEach(({key:o,validator:m})=>{if(o in a){const w=m(a[o]);i.errors.push(...w.errors.map(V=>`${o}: ${V}`)),i.warnings.push(...w.warnings.map(V=>`${o}: ${V}`)),w.isValid||(i.isValid=!1)}}),i}const te=e.defineComponent({__name:"handyUploader",props:{documentAttachment:{},lang:{default:"en"},maxFileSize:{default:5242880},fileUploaderType:{default:"thumbnail"},maxFileCount:{default:10},badgeCounter:{type:Boolean,default:!0},btnColor:{default:"info"},imageCompressor:{type:Boolean},imageCompressLevel:{default:.8},fileAccept:{},thumb:{type:Boolean,default:!0},tableThumbColumn:{type:Boolean},tableFixedHeader:{type:Boolean,default:!0},tableHeight:{default:400},rtlSupport:{type:Boolean,default:!1},changeFileName:{type:Boolean,default:!1},addFileDescription:{type:Boolean,default:!1},addFileTag:{type:Boolean,default:!1},tags:{},customLang:{default:null},insertPermission:{type:Boolean,default:!0},cols:{default:3},editPermission:{type:Boolean,default:!0},deletePermission:{type:Boolean,default:!0},cardType:{default:"default"},outlined:{type:Boolean},raised:{type:Boolean},shaped:{type:Boolean},tile:{type:Boolean}},emits:["updateCardType","updateBadgeCounter","updateMaxFileCount","updateMaxFileSize","updateImageCompressor","updateImageCompressLevel","updateFileAccept","updateThumb","updateChangeFileName","updateAddFileDescription","updateTableThumbColumn","updateTableFixedHeader","updateTableHeight","updateLang","updateDocumentAttachment"],setup(a,{emit:i}){const t=a;if(process.env.NODE_ENV==="development"){const s=$e(t);s.isValid||console.error("HandyUploader prop validation failed:",s.errors),s.warnings.length>0&&console.warn("HandyUploader prop validation warnings:",s.warnings)}const o=e.reactive({insertDocumentDialog:!1,editDocumentDialog:!1,deleteDocumentDialog:!1,tempAttachment:[],tempAttachmentChanged:[],fileUploaderSnackBarAlert:!1,fileUploaderSnackText:"",fileUploaderSnackBarAlertColor:"green",readerFile:null,registryDocFile:[],documentAttachmentAPI:[],btnLoader:!1,showDetail:!1,showDetailState:[],selectedIndex:0,selectedId:"",returnedRecord:{},outlined:!1,raised:!1,shaped:!1,tile:!1,selectedLang:{},beforeInsertAttachments:{},attachmentIndex:0}),m=i;e.onBeforeMount(()=>{V(),o.registryDocFile=t.documentAttachment,t.rtlSupport&&f(),p()}),e.watch(()=>o.tempAttachment,s=>{s&&s.length>0?z(s):o.tempAttachmentChanged=[]}),e.watch(()=>t.cardType,s=>{m("updateCardType",s),p()}),e.watch(()=>t.badgeCounter,s=>{m("updateBadgeCounter",s)}),e.watch(()=>t.maxFileCount,s=>{m("updateMaxFileCount",s)}),e.watch(()=>t.maxFileSize,s=>{m("updateMaxFileSize",s)}),e.watch(()=>t.maxFileSize,s=>{m("updateMaxFileSize",s)}),e.watch(()=>t.imageCompressor,s=>{m("updateImageCompressor",s)}),e.watch(()=>t.imageCompressLevel,s=>{m("updateImageCompressLevel",s)}),e.watch(()=>t.fileAccept,s=>{m("updateFileAccept",s)}),e.watch(()=>t.thumb,s=>{m("updateThumb",s)}),e.watch(()=>t.changeFileName,s=>{m("updateChangeFileName",s)}),e.watch(()=>t.addFileDescription,s=>{m("updateAddFileDescription",s)}),e.watch(()=>t.addFileTag,s=>{m("updateAddFileDescription",s)}),e.watch(()=>t.tableThumbColumn,s=>{m("updateTableThumbColumn",s)}),e.watch(()=>t.tableFixedHeader,s=>{m("updateTableFixedHeader",s)}),e.watch(()=>t.tableHeight,s=>{m("updateTableHeight",s)}),e.watch(()=>t.lang,s=>{m("updateLang",s)}),e.onDeactivated(()=>{o.registryDocFile=[]});const w=()=>{o.btnLoader=!1,o.tempAttachment=[],o.insertDocumentDialog=!0},V=()=>{t.customLang!==null?o.selectedLang=t.customLang:o.selectedLang=re},f=()=>{},p=()=>{const r={default:{outlined:!1,raised:!1,shaped:!1,tile:!1},outlined:{outlined:!0,raised:!1,shaped:!1,tile:!1},shaped:{outlined:!1,raised:!1,shaped:!0,tile:!1},raised:{outlined:!1,raised:!0,shaped:!1,tile:!1},tile:{outlined:!1,raised:!1,shaped:!1,tile:!0}}[t.cardType||"default"];o.outlined=r.outlined,o.raised=r.raised,o.shaped=r.shaped,o.tile=r.tile},F=s=>{let r=new FileReader;return new Promise(function(l){r.onloadend=()=>{l(r.result)},r.readAsDataURL(s)})},u=async()=>{o.btnLoader=!0;const s=(r,l)=>{o.fileUploaderSnackText=r,o.fileUploaderSnackBarAlertColor=l,o.fileUploaderSnackBarAlert=!0};for(const[r,l]of o.tempAttachmentChanged.entries()){if(t.documentAttachment.length>=t.maxFileCount){s(`${o.selectedLang[t.lang].maxFileCountAlert} ${t.maxFileCount}`,"red");break}if(l.file.size/1e3>t.maxFileSize){s(`${o.selectedLang[t.lang].maxFileSizeAlert} ${Math.round(t.maxFileSize/1024)} ${o.selectedLang[t.lang].size.mb}`,"red");continue}let n={},d={};const c=l.file,C=c.format;let N=!1,b="",D=c.base64;t.imageCompressor&&["image/png","image/jpg","image/jpeg","image/webp"].includes(C)&&(N=!0,b=await h(`data:${C};base64,${D}`),D=b.split(",")[1]);try{const S=D.replace(/\s/g,"");n={base64:S,size:N?(atob(S).length/1024).toFixed(1):c.size.toString(),name:`${c.name}.${c.format}`,tags:c.tags||[],description:c.description||"",showDetailState:!1,format:C},d.file=n,o.registryDocFile.push(d),m("updateDocumentAttachment",o.registryDocFile)}catch(S){console.error("Error processing Base64 string:",S),s("File could not be processed due to an invalid format.","red");continue}}o.documentAttachmentAPI=[],o.tempAttachmentChanged=[],o.insertDocumentDialog=!1,o.btnLoader=!1},h=s=>{const r=document.createElement("canvas"),l=document.createElement("img");return new Promise((n,d)=>{let c=t.imageCompressLevel;l.onload=function(){let C=l.width,N=l.height;r.width=C,r.height=N;const b=r.getContext("2d");b==null||b.drawImage(l,0,0,C,N),n(r.toDataURL("image/jpeg",c))},l.onerror=function(C){d(C)},l.src=s})},B=(s,r)=>{o.btnLoader=!1,o.selectedIndex=s,o.selectedId=r,o.deleteDocumentDialog=!0},y=()=>{o.registryDocFile.splice(o.selectedIndex,1),m("updateDocumentAttachment",o.registryDocFile),o.deleteDocumentDialog=!1},z=async s=>{for(let r of s){let l="";try{l=await F(r)}catch(c){console.log(c);continue}let d={file:{name:r.name.split(".")[0],format:r.name.substr(r.name.lastIndexOf(".")+1),base64:l.split(",")[1],size:r.size,tags:[],description:null,showDetailState:!1}};o.tempAttachmentChanged.push(d)}},L=(s,r)=>{o.btnLoader=!1,o.attachmentIndex=r,o.editDocumentDialog=!0,o.tempAttachmentChanged=[s]},$=()=>{const s=[...t.documentAttachment];s.splice(o.attachmentIndex,1,o.tempAttachmentChanged[0]),m("updateDocumentAttachment",s),o.editDocumentDialog=!1};return(s,r)=>{const l=e.resolveComponent("v-col"),n=e.resolveComponent("v-row"),d=e.resolveComponent("v-icon"),c=e.resolveComponent("v-card-title"),C=e.resolveComponent("v-file-input"),N=e.resolveComponent("v-expansion-panel-title"),b=e.resolveComponent("v-text-field"),D=e.resolveComponent("v-textarea"),S=e.resolveComponent("v-autocomplete"),P=e.resolveComponent("v-img"),T=e.resolveComponent("v-card"),U=e.resolveComponent("v-expansion-panel-text"),_=e.resolveComponent("v-expansion-panel"),M=e.resolveComponent("v-expansion-panels"),I=e.resolveComponent("v-list-item-title"),H=e.resolveComponent("v-list-item"),q=e.resolveComponent("v-card-text"),k=e.resolveComponent("v-btn"),R=e.resolveComponent("v-card-actions"),E=e.resolveComponent("v-dialog"),K=e.resolveComponent("v-snackbar"),Ie=e.resolveComponent("v-spacer"),Pe=e.resolveComponent("v-container");return e.openBlock(),e.createBlock(Pe,null,{default:e.withCtx(()=>[e.createVNode(n,null,{default:e.withCtx(()=>[e.createVNode(l,{cols:"12",md:"12",xs:"12"},{default:e.withCtx(()=>[e.createVNode(J,{documentAttachment:t.documentAttachment,selectedLang:o.selectedLang,lang:t.lang,badgeCounter:t.badgeCounter,btnColor:t.btnColor,maxFileCount:t.maxFileCount,onOpenInputDocumentModal:w},null,8,["documentAttachment","selectedLang","lang","badgeCounter","btnColor","maxFileCount"]),t.fileUploaderType==="simple"?(e.openBlock(),e.createBlock(Z,{key:0,documentAttachment:t.documentAttachment,cols:t.cols,thumb:t.thumb,outlined:o.outlined,raised:o.raised,shaped:o.shaped,tile:o.tile,lang:t.lang,cardType:t.cardType,deletePermission:t.deletePermission,editPermission:t.editPermission,selectedLang:o.selectedLang,onSetCardTheme:p,onOpenDeleteDialog:B,onOpenEditDocumentDialog:L},null,8,["documentAttachment","cols","thumb","outlined","raised","shaped","tile","lang","cardType","deletePermission","editPermission","selectedLang"])):e.createCommentVNode("",!0),t.fileUploaderType==="thumbnail"?(e.openBlock(),e.createBlock(Y,{key:1,documentAttachment:t.documentAttachment,cols:t.cols,thumb:t.thumb,outlined:o.outlined,raised:o.raised,shaped:o.shaped,tile:o.tile,lang:t.lang,cardType:t.cardType,deletePermission:t.deletePermission,editPermission:t.editPermission,selectedLang:o.selectedLang,onSetCardTheme:p,onOpenDeleteDialog:r[0]||(r[0]=(g,j)=>B(g,j)),onOpenEditDocumentDialog:r[1]||(r[1]=(g,j)=>L(g,j))},null,8,["documentAttachment","cols","thumb","outlined","raised","shaped","tile","lang","cardType","deletePermission","editPermission","selectedLang"])):e.createCommentVNode("",!0),t.fileUploaderType==="table"?(e.openBlock(),e.createBlock(X,{key:2,documentAttachment:t.documentAttachment,cols:t.cols,thumb:t.thumb,outlined:o.outlined,raised:o.raised,shaped:o.shaped,tile:o.tile,lang:t.lang,tableThumbColumn:t.tableThumbColumn,tableFixedHeader:t.tableFixedHeader,tableHeight:t.tableHeight,cardType:t.cardType,deletePermission:t.deletePermission,editPermission:t.editPermission,selectedLang:o.selectedLang,onSetCardTheme:p,onOpenDeleteDialog:B,onOpenEditDocumentDialog:L},null,8,["documentAttachment","cols","thumb","outlined","raised","shaped","tile","lang","tableThumbColumn","tableFixedHeader","tableHeight","cardType","deletePermission","editPermission","selectedLang"])):e.createCommentVNode("",!0)]),_:1})]),_:1}),e.createVNode(n,{justify:"center"},{default:e.withCtx(()=>[e.createVNode(E,{modelValue:o.insertDocumentDialog,"onUpdate:modelValue":r[5]||(r[5]=g=>o.insertDocumentDialog=g),scrollable:!1,persistent:"",width:"50%"},{default:e.withCtx(()=>[e.createVNode(T,null,{default:e.withCtx(()=>[e.createVNode(c,null,{default:e.withCtx(()=>[e.createVNode(d,{onClick:r[2]||(r[2]=g=>o.insertDocumentDialog=!1)},{default:e.withCtx(()=>r[12]||(r[12]=[e.createTextVNode("mdi-close")])),_:1})]),_:1}),e.createVNode(q,null,{default:e.withCtx(()=>[o.tempAttachment.length===0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.fileAccept!==""?(e.openBlock(),e.createBlock(C,{key:0,multiple:"",accept:t.fileAccept,chip:"",modelValue:o.tempAttachment,"onUpdate:modelValue":r[3]||(r[3]=g=>o.tempAttachment=g),label:o.selectedLang[s.lang].insertNewFile},null,8,["accept","modelValue","label"])):(e.openBlock(),e.createBlock(C,{key:1,multiple:"",modelValue:o.tempAttachment,"onUpdate:modelValue":r[4]||(r[4]=g=>o.tempAttachment=g),label:o.selectedLang[s.lang].insertNewFile},null,8,["modelValue","label"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.addFileTag||t.addFileDescription||t.changeFileName?(e.openBlock(),e.createBlock(M,{key:0},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.tempAttachmentChanged,(g,j)=>(e.openBlock(),e.createBlock(_,{key:`attachment-${j}`},{default:e.withCtx(()=>[e.createVNode(N,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g.file.name),1)]),_:2},1024),e.createVNode(U,null,{default:e.withCtx(()=>[e.createVNode(n,{align:"center",justify:"center"},{default:e.withCtx(()=>[e.createVNode(l,{cols:"12",lg:"9",md:"9",xs:"12"},{default:e.withCtx(()=>[t.changeFileName?(e.openBlock(),e.createBlock(b,{key:0,label:o.selectedLang[s.lang].fileName,modelValue:g.file.name,"onUpdate:modelValue":A=>g.file.name=A},null,8,["label","modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0),t.addFileDescription?(e.openBlock(),e.createBlock(D,{key:1,label:o.selectedLang[s.lang].fileDescription,"auto-grow":"","row-height":"1",modelValue:g.file.description,"onUpdate:modelValue":A=>g.file.description=A},null,8,["label","modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0),t.addFileTag?(e.openBlock(),e.createBlock(S,{key:2,modelValue:g.file.tags,"onUpdate:modelValue":A=>g.file.tags=A,items:t.tags,dense:"",chips:"",label:o.selectedLang[s.lang].fileTags,multiple:""},null,8,["modelValue","onUpdate:modelValue","items","label"])):e.createCommentVNode("",!0)]),_:2},1024),e.createVNode(l,{align:"center",cols:"12",lg:"3",md:"3",xs:"12"},{default:e.withCtx(()=>[g.file.format==="jpg"||g.file.format==="jpeg"||g.file.format==="png"||g.file.format==="tif"||g.file.format==="bmp"?(e.openBlock(),e.createBlock(T,{key:0},{default:e.withCtx(()=>[e.createVNode(P,{src:"data:"+g.file.format+";base64,"+g.file.base64},null,8,["src"])]),_:2},1024)):(e.openBlock(),e.createBlock(O,{key:1,"file-format":g.file.format,size:60},null,8,["file-format"]))]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))]),_:1})):(e.openBlock(),e.createBlock(T,{key:1,class:"mx-auto",tile:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.tempAttachmentChanged,(g,j)=>(e.openBlock(),e.createBlock(H,{key:`attachment-${j}`,style:{"border-bottom":"1px solid #E0E0E0"}},{default:e.withCtx(()=>[e.createVNode(I,null,{default:e.withCtx(()=>[e.createVNode(O,{"file-format":g.file.format,size:24},null,8,["file-format"]),e.createTextVNode(" "+e.toDisplayString(g.file.name)+"."+e.toDisplayString(g.file.format),1)]),_:2},1024)]),_:2},1024))),128))]),_:1}))],64))]),_:1}),e.createVNode(R,null,{default:e.withCtx(()=>[e.createVNode(k,{disabled:o.tempAttachment==null||o.btnLoader,loading:o.btnLoader,color:t.btnColor,onClick:u},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.selectedLang[s.lang].add),1)]),_:1},8,["disabled","loading","color"])]),_:1})]),_:1})]),_:1},8,["modelValue"])]),_:1}),e.createVNode(n,{justify:"center"},{default:e.withCtx(()=>[e.createVNode(E,{modelValue:o.editDocumentDialog,"onUpdate:modelValue":r[7]||(r[7]=g=>o.editDocumentDialog=g),scrollable:!1,persistent:"",width:"50%"},{default:e.withCtx(()=>[e.createVNode(T,null,{default:e.withCtx(()=>[e.createVNode(c,null,{default:e.withCtx(()=>[e.createVNode(d,{onClick:r[6]||(r[6]=g=>o.editDocumentDialog=!1)},{default:e.withCtx(()=>r[13]||(r[13]=[e.createTextVNode("mdi-close")])),_:1})]),_:1}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.tempAttachmentChanged,(g,j)=>(e.openBlock(),e.createBlock(q,{key:`attachment-${j}`},{default:e.withCtx(()=>[e.createVNode(n,{align:"center",justify:"center"},{default:e.withCtx(()=>[e.createVNode(l,{cols:"12",lg:"9",md:"9",xs:"12"},{default:e.withCtx(()=>[t.changeFileName?(e.openBlock(),e.createBlock(b,{key:0,label:o.selectedLang[s.lang].fileName,modelValue:g.file.name,"onUpdate:modelValue":A=>g.file.name=A},null,8,["label","modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0),t.addFileDescription?(e.openBlock(),e.createBlock(D,{key:1,label:o.selectedLang[s.lang].fileDescription,"auto-grow":"","row-height":"1",modelValue:g.file.description,"onUpdate:modelValue":A=>g.file.description=A},null,8,["label","modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0),t.addFileTag?(e.openBlock(),e.createBlock(S,{key:2,modelValue:g.file.tags,"onUpdate:modelValue":A=>g.file.tags=A,items:t.tags,dense:"",chips:"",label:o.selectedLang[s.lang].fileTags,multiple:""},null,8,["modelValue","onUpdate:modelValue","items","label"])):e.createCommentVNode("",!0)]),_:2},1024),e.createVNode(l,{align:"center",cols:"12",lg:"3",md:"3",xs:"12"},{default:e.withCtx(()=>{var A;return[g.file.name&&["jpg","jpeg","png","tif","bmp"].includes(((A=g.file.name.split(".").pop())==null?void 0:A.toLowerCase())||"")?(e.openBlock(),e.createBlock(T,{key:0},{default:e.withCtx(()=>[e.createVNode(P,{src:"data:"+g.file.format+";base64,"+g.file.base64},null,8,["src"])]),_:2},1024)):(e.openBlock(),e.createBlock(O,{key:1,"file-format":g.file.format,size:60},null,8,["file-format"]))]}),_:2},1024)]),_:2},1024)]),_:2},1024))),128)),e.createVNode(R,null,{default:e.withCtx(()=>[e.createVNode(k,{disabled:o.tempAttachment===null||o.btnLoader,loading:o.btnLoader,color:t.btnColor,onClick:$},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.selectedLang[s.lang].edit),1)]),_:1},8,["disabled","loading","color"])]),_:1})]),_:1})]),_:1},8,["modelValue"])]),_:1}),e.createVNode(K,{modelValue:o.fileUploaderSnackBarAlert,"onUpdate:modelValue":r[9]||(r[9]=g=>o.fileUploaderSnackBarAlert=g),right:"",bottom:"",color:o.fileUploaderSnackBarAlertColor,timeout:3e3},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.fileUploaderSnackText)+" ",1),e.createVNode(k,{color:"white",text:"",onClick:r[8]||(r[8]=g=>o.fileUploaderSnackBarAlert=!1)},{default:e.withCtx(()=>[e.createVNode(d,null,{default:e.withCtx(()=>r[14]||(r[14]=[e.createTextVNode("mdi-close")])),_:1})]),_:1})]),_:1},8,["modelValue","color"]),e.createVNode(n,{justify:"center"},{default:e.withCtx(()=>[e.createVNode(E,{modelValue:o.deleteDocumentDialog,"onUpdate:modelValue":r[11]||(r[11]=g=>o.deleteDocumentDialog=g),persistent:"",width:"30%"},{default:e.withCtx(()=>[e.createVNode(T,null,{default:e.withCtx(()=>[e.createVNode(c,null,{default:e.withCtx(()=>[e.createVNode(d,{color:"red"})]),_:1}),e.createVNode(q,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.selectedLang[s.lang].deleteDialog.message),1)]),_:1}),e.createVNode(R,null,{default:e.withCtx(()=>[e.createVNode(Ie),e.createVNode(k,{color:"green darken-1",text:"",onClick:r[10]||(r[10]=g=>o.deleteDocumentDialog=!1)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.selectedLang[s.lang].deleteDialog.cancel),1)]),_:1}),e.createVNode(k,{color:"primary",disabled:o.btnLoader,loading:o.btnLoader,onClick:y},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.selectedLang[s.lang].delete),1)]),_:1},8,["disabled","loading"])]),_:1})]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1})}}}),Ue={ThumbnailUploader:Y,TableUploader:X,SimpleUploader:Z,HandyUploader:te,InsertButton:J,SelectFileIconType:O};function se(a){a.component("ThumbnailUploader",Y),a.component("TableUploader",X),a.component("SimpleUploader",Z),a.component("HandyUploader",te),a.component("InsertButton",J),a.component("SelectFileIconType",O)}typeof window<"u"&&window.Vue&&se(window.Vue),x.HandyUploader=te,x.InsertButton=J,x.SelectFileIconType=O,x.SimpleUploader=Z,x.TableUploader=X,x.ThumbnailUploader=Y,x.compressImage=ae,x.constructImageDataUrl=ie,x.default=Ue,x.fileToBase64=ee,x.formatFileSize=G,x.getFileIcon=oe,x.getFileType=W,x.getMimeTypeFromExtension=v,x.install=se,x.isImageFile=Q,x.languageData=re,x.useErrorHandler=Ve,x.useFileUpload=_e,x.validateFileCount=ne,x.validateFileSize=le,Object.defineProperties(x,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(k,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(k=typeof globalThis<"u"?globalThis:k||self,e(k.HandyUploaderVue={},k.Vue))})(this,(function(k,e){"use strict";function q(n){const a=n/1024,t=a/1024;return t>=1?{text:`${t.toFixed(2)} MB`,color:t>10?"red":t>5?"orange":"green"}:{text:`${a.toFixed(2)} KB`,color:a>1e3?"orange":"green"}}function O(n,a){var o;const t=((o=n.split(".").pop())==null?void 0:o.toLowerCase())||"";return["jpg","jpeg","png","gif","bmp","svg","webp","tiff"].includes(t)||a!=null&&a.startsWith("image/")?"image":["pdf","doc","docx","txt","rtf","odt"].includes(t)?"document":["xls","xlsx","csv","ods"].includes(t)?"spreadsheet":["ppt","pptx","odp"].includes(t)?"presentation":["zip","rar","7z","tar","gz"].includes(t)?"archive":["mp4","avi","mov","wmv","flv","webm"].includes(t)?"video":["mp3","wav","flac","aac","ogg"].includes(t)?"audio":"unknown"}const Z={pdf:{icon:"mdi-file-pdf-box",color:"red darken-1"},doc:{icon:"mdi-file-word-outline",color:"blue darken-1"},docx:{icon:"mdi-file-word-outline",color:"blue darken-1"},odt:{icon:"mdi-file-word-outline",color:"blue darken-1"},jpg:{icon:"mdi-file-image-outline",color:"deep-purple darken-1"},jpeg:{icon:"mdi-file-image-outline",color:"deep-purple darken-1"},png:{icon:"mdi-file-image-outline",color:"deep-purple darken-1"},gif:{icon:"mdi-file-image-outline",color:"deep-purple darken-1"},bmp:{icon:"mdi-file-image-outline",color:"deep-purple darken-1"},tif:{icon:"mdi-file-image-outline",color:"deep-purple darken-1"},tiff:{icon:"mdi-file-image-outline",color:"deep-purple darken-1"},svg:{icon:"mdi-file-image-outline",color:"deep-purple darken-1"},webp:{icon:"mdi-file-image-outline",color:"deep-purple darken-1"},xls:{icon:"mdi-file-excel-outline",color:"teal darken-1"},xlsx:{icon:"mdi-file-excel-outline",color:"teal darken-1"},csv:{icon:"mdi-file-excel-outline",color:"teal darken-1"},ods:{icon:"mdi-file-excel-outline",color:"teal darken-1"},ppt:{icon:"mdi-file-powerpoint-outline",color:"orange darken-3"},pptx:{icon:"mdi-file-powerpoint-outline",color:"orange darken-3"},pptm:{icon:"mdi-file-powerpoint-outline",color:"orange darken-3"},odp:{icon:"mdi-file-powerpoint-outline",color:"orange darken-3"},mp4:{icon:"mdi-file-video-outline",color:"red lighten-1"},mov:{icon:"mdi-file-video-outline",color:"red lighten-1"},flv:{icon:"mdi-file-video-outline",color:"red lighten-1"},wmv:{icon:"mdi-file-video-outline",color:"red lighten-1"},avi:{icon:"mdi-file-video-outline",color:"red lighten-1"},webm:{icon:"mdi-file-video-outline",color:"red lighten-1"},mp3:{icon:"mdi-file-music-outline",color:"purple darken-1"},wav:{icon:"mdi-file-music-outline",color:"purple darken-1"},flac:{icon:"mdi-file-music-outline",color:"purple darken-1"},aac:{icon:"mdi-file-music-outline",color:"purple darken-1"},ogg:{icon:"mdi-file-music-outline",color:"purple darken-1"},dwg:{icon:"mdi-file-cad",color:"indigo lighten-2"},zip:{icon:"mdi-folder-zip-outline",color:"lime lighten-1"},rar:{icon:"mdi-folder-zip-outline",color:"lime lighten-1"},"7z":{icon:"mdi-folder-zip-outline",color:"lime lighten-1"},"7-zip":{icon:"mdi-folder-zip-outline",color:"lime lighten-1"},tar:{icon:"mdi-folder-zip-outline",color:"lime lighten-1"},gz:{icon:"mdi-folder-zip-outline",color:"lime lighten-1"},txt:{icon:"mdi-script-text-outline",color:"light-green darken-3"},rtf:{icon:"mdi-script-text-outline",color:"light-green darken-3"},unknown:{icon:"mdi-file-question-outline",color:"grey darken-1"}};function fe(n,a){const t=O(n,a),o={image:{icon:"mdi-file-image",color:"blue"},document:{icon:"mdi-file-document",color:"red"},spreadsheet:{icon:"mdi-file-excel",color:"green"},presentation:{icon:"mdi-file-powerpoint",color:"orange"},archive:{icon:"mdi-folder-zip",color:"purple"},video:{icon:"mdi-file-video",color:"pink"},audio:{icon:"mdi-file-music",color:"teal"},file:{icon:"mdi-file",color:"grey"},unknown:{icon:"mdi-file-question-outline",color:"grey darken-1"}};return o[t]||o.unknown}function v(n){var t;const a=(t=n.split(".").pop())==null?void 0:t.toLowerCase();return a&&Z[a]||Z.unknown}function ee(n){return v(n).icon}function te(n){return v(n).color}function G(n,a){return O(n,a)==="image"}function ae(n,a){return n<=a}function re(n,a){return n<a}function oe(n){var o;const a=((o=n.split(".").pop())==null?void 0:o.toLowerCase())||"";return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",bmp:"image/bmp",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp",mp4:"video/mp4",avi:"video/x-msvideo",mov:"video/quicktime",wmv:"video/x-ms-wmv",flv:"video/x-flv",webm:"video/webm",pdf:"application/pdf",doc:"application/msword",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",txt:"text/plain",csv:"text/csv",zip:"application/zip",rar:"application/x-rar-compressed"}[a]||"application/octet-stream"}function se(n,a){if(!n||!a)return console.warn("constructImageDataUrl: missing base64 or format",{hasBase64:!!n,format:a}),"";const t=n.replace(/^data:[^;]+;base64,/,"");return`data:${a.startsWith("image/")?a:`image/${a}`};base64,${t}`}function ce(n,a=.8,t=1920,o=1080){return new Promise((c,_)=>{const B=document.createElement("canvas"),x=B.getContext("2d"),w=new Image;w.onload=()=>{let{width:f,height:C}=w;if(f>t||C>o){const F=Math.min(t/f,o/C);f*=F,C*=F}B.width=f,B.height=C,x==null||x.drawImage(w,0,0,f,C);const V=B.toDataURL("image/jpeg",a);c(V)},w.onerror=()=>_(new Error("Failed to load image for compression"));const h=new FileReader;h.onload=f=>{var C;w.src=(C=f.target)==null?void 0:C.result},h.onerror=()=>_(new Error("Failed to read file")),h.readAsDataURL(n)})}function ne(n){return new Promise((a,t)=>{const o=new FileReader;o.onload=()=>{const c=o.result,_=c.split(",")[1]||c;a(_)},o.onerror=()=>t(new Error("Failed to read file")),o.readAsDataURL(n)})}const H=e.defineComponent({__name:"SelectFileIconType",props:{fileFormat:{},size:{default:30}},setup(n){const a=n,t=e.computed(()=>{const o=`file.${a.fileFormat}`;return v(o)});return(o,c)=>{const _=e.resolveComponent("v-icon");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(_,{size:a.size,color:t.value.color},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.value.icon),1)]),_:1},8,["size","color"])])}}}),ge={key:0,style:{height:"200px",display:"flex","align-items":"center","justify-content":"center","background-color":"#f5f5f5",overflow:"hidden"}},ue=["src","onError"],he={key:1,style:{height:"200px","background-color":"#f5f5f5",position:"relative",overflow:"hidden",display:"flex","align-items":"center","justify-content":"center"}},be=["src","onError"],xe={key:1,style:{width:"100%",height:"100%",background:"#e0e0e0",display:"flex","align-items":"center","justify-content":"center"}},Ce={class:"d-flex justify-center align-center",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",background:"rgba(0,0,0,0.7)","border-radius":"50%",width:"60px",height:"60px",cursor:"pointer"}},we={key:2,class:"d-flex justify-center align-center",style:{height:"200px","background-color":"#f5f5f5"}},ye={class:"BYekan"},ke={class:"BYekan"},_e={key:0},Y=e.defineComponent({__name:"ThumbnailUploader",props:{lang:{default:"en"},documentAttachment:{},thumb:{type:Boolean,default:!0},cols:{default:4},editPermission:{type:Boolean,default:!0},deletePermission:{type:Boolean,default:!0},selectedLang:{},cardType:{},outlined:{type:Boolean,default:!1},raised:{type:Boolean,default:!1},shaped:{type:Boolean,default:!1},tile:{type:Boolean,default:!1}},emits:["openDeleteDialog","openEditDocumentDialog"],setup(n,{emit:a}){const t=l=>{const i=G(l);return console.log("🔍 isImageFile check:",l,"→",i),i},o=n,c=a,_=l=>{const i=O(l)==="video";return console.log("🎥 Checking if video file:",l,"result:",i,"fileType:",O(l)),i},B=l=>{var p;if(!l.base64||!l.format)return console.error("❌ Missing base64 or format for:",l.name,{base64:!!l.base64,format:l.format}),"";const i=se(l.base64,l.format);return console.log("🖼️ Image source for:",l.name,{format:l.format,base64Length:((p=l.base64)==null?void 0:p.length)||0,srcLength:i.length,srcPreview:i.substring(0,100)+"..."}),i},x=l=>{var i;console.error("Image failed to load:",{name:l.name,format:l.format,base64Length:((i=l.base64)==null?void 0:i.length)||0})},w=e.reactive(new Map),h=l=>(console.log("🎬 Starting video thumbnail generation for:",l.name),new Promise((i,p)=>{var L;const r=document.createElement("video"),b=document.createElement("canvas"),u=b.getContext("2d");if(!u){console.error("❌ Canvas context not available"),p(new Error("Canvas context not available"));return}r.crossOrigin="anonymous",r.preload="metadata",r.muted=!0,r.onloadedmetadata=()=>{if(console.log("📹 Video metadata loaded:",{duration:r.duration,width:r.videoWidth,height:r.videoHeight,readyState:r.readyState,networkState:r.networkState}),r.duration===0||isNaN(r.duration)){console.error("❌ Invalid video duration:",r.duration);const I=f(l);C.delete(I),p(new Error("Invalid video duration"));return}if(r.videoWidth===0||r.videoHeight===0){console.error("❌ Invalid video dimensions:",r.videoWidth,"x",r.videoHeight);const I=f(l);C.delete(I),p(new Error("Invalid video dimensions"));return}b.width=r.videoWidth,b.height=r.videoHeight;const z=Math.min(1,r.duration*.1);console.log("⏰ Seeking to time:",z,"of total duration:",r.duration),r.currentTime=z},r.onseeked=()=>{console.log("🎯 Video seeked successfully to:",r.currentTime);try{console.log("🖼️ Canvas setup:",{width:b.width,height:b.height,videoCurrentTime:r.currentTime,videoReadyState:r.readyState}),u.drawImage(r,0,0,b.width,b.height);const I=u.getImageData(0,0,b.width,b.height).data.some(R=>R!==0);console.log("🎨 Canvas content check:",I?"Has content":"Empty/transparent");const P=b.toDataURL("image/jpeg",.8);console.log("✅ Generated thumbnail:",{dataUrlLength:P.length,startsWithData:P.startsWith("data:image/jpeg"),preview:P.substring(0,50)+"..."}),i(P)}catch(z){console.error("❌ Error during thumbnail generation:",z),p(z)}},r.onabort=()=>{console.warn("⚠️ Video loading aborted"),p(new Error("Video loading aborted"))},r.onstalled=()=>{console.warn("⚠️ Video loading stalled")},r.onerror=z=>{console.error("❌ Video failed to load for thumbnail generation:",z),p(new Error("Video failed to load for thumbnail generation"))},r.onloadstart=()=>{console.log("🔄 Video load started")},r.oncanplay=()=>{console.log("▶️ Video can play")};const D=((L=l.base64)==null?void 0:L.replace(/^data:[^;]+;base64,/,""))||"";let N;l.format.startsWith("video/")?N=l.format:(N=oe(l.name),N.startsWith("video/")||(N=`video/${l.format}`));const M=`data:${N};base64,${D}`;console.log("🔗 Setting video source:",{fileName:l.name,format:l.format,mimeType:N,base64Length:D.length,videoSrcLength:M.length}),r.src=M})),f=l=>{var i;return`${l.name}_${(i=l.base64)==null?void 0:i.substring(0,50)}`};e.computed(()=>(console.log("🔄 Video thumbnails computed updated:",Array.from(w.keys())),w));const C=new Set,V=l=>{const i=f(l);if(console.log("🔍 Getting video thumbnail for:",l.name,"cache key:",i),w.has(i))return console.log("💾 Returning cached thumbnail for:",l.name),w.get(i);if(C.has(i)){console.log("⏳ Thumbnail already being generated for:",l.name);return}console.log("🚀 No cached thumbnail, generating new one for:",l.name),C.add(i),h(l).then(p=>{console.log("✅ Thumbnail generated and cached for:",l.name),w.set(i,p),C.delete(i),e.nextTick(()=>{console.log("🔄 UI update triggered for:",l.name)})}).catch(p=>{console.error("❌ Failed to generate video thumbnail for:",l.name,p),C.delete(i)})},F=l=>{console.error("Video thumbnail failed to load:",{name:l.name,format:l.format});const i=f(l);w.delete(i)},E=l=>({icon:ee(l),color:te(l)}),T=l=>l.tags.length>0||!!l.description,A=l=>{l.showDetailState=!l.showDetailState},d=(l,i)=>{c("openDeleteDialog",l,i)},m=(l,i)=>{c("openEditDocumentDialog",l,i)},s=()=>{console.log("🎯 Generating thumbnails for videos, total attachments:",o.documentAttachment.length);const l=o.documentAttachment.filter(i=>_(i.file.name));console.log("📹 Found video attachments:",l.length,l.map(i=>i.file.name)),l.forEach(i=>{console.log("🎬 Processing video:",i.file.name),V(i.file)})};return e.watch(()=>o.documentAttachment,s,{immediate:!0}),e.onMounted(s),(l,i)=>{const p=e.resolveComponent("v-icon"),r=e.resolveComponent("v-card-subtitle"),b=e.resolveComponent("v-chip"),u=e.resolveComponent("v-divider"),D=e.resolveComponent("v-btn"),N=e.resolveComponent("v-tooltip"),M=e.resolveComponent("v-spacer"),L=e.resolveComponent("v-card-actions"),z=e.resolveComponent("v-chip-group"),I=e.resolveComponent("v-card-text"),P=e.resolveComponent("v-expand-transition"),R=e.resolveComponent("v-card"),ie=e.resolveComponent("v-col"),W=e.resolveComponent("v-row");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(W,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.documentAttachment,(y,j)=>(e.openBlock(),e.createBlock(ie,{key:`attachment-${j}`,cols:"12",md:n.cols,xs:"12"},{default:e.withCtx(()=>[e.createVNode(R,{shaped:n.shaped,outlined:n.outlined,raised:n.raised,tile:n.tile,class:"mx-auto","max-width":"344"},{default:e.withCtx(()=>[t(y.file.name)?(e.openBlock(),e.createElementBlock("div",ge,[e.createElementVNode("img",{src:B(y.file),style:{"max-width":"100%","max-height":"100%","object-fit":"contain"},onError:$=>x(y.file)},null,40,ue)])):_(y.file.name)?(e.openBlock(),e.createElementBlock("div",he,[V(y.file)?(e.openBlock(),e.createElementBlock("img",{key:0,src:V(y.file),style:{width:"100%",height:"100%","object-fit":"cover"},onError:$=>F(y.file)},null,40,be)):(e.openBlock(),e.createElementBlock("div",xe,[e.createVNode(p,{size:"60",color:"grey"},{default:e.withCtx(()=>[...i[0]||(i[0]=[e.createTextVNode("mdi-video",-1)])]),_:1})])),e.createElementVNode("div",Ce,[e.createVNode(p,{color:"white",size:"30"},{default:e.withCtx(()=>[...i[1]||(i[1]=[e.createTextVNode("mdi-play",-1)])]),_:1})])])):(e.openBlock(),e.createElementBlock("div",we,[e.createVNode(p,{size:"120",color:E(y.file.name).color},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(E(y.file.name).icon),1)]),_:2},1032,["color"])])),e.createVNode(r,{class:"text-truncate py-2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(y.file.name),1)]),_:2},1024),e.createVNode(r,{class:"pt-2 pb-3"},{default:e.withCtx(()=>[e.createVNode(b,{color:e.unref(q)(y.file.size).color,label:"","text-color":"white"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(q)(y.file.size).text)+" ",1),e.createVNode(p,{right:""},{default:e.withCtx(()=>[...i[2]||(i[2]=[e.createTextVNode("mdi-harddisk",-1)])]),_:1})]),_:2},1032,["color"])]),_:2},1024),e.createVNode(u,{class:"mx-4"}),e.createVNode(L,{style:{padding:"0"}},{default:e.withCtx(()=>[e.createVNode(N,{right:""},{activator:e.withCtx(({props:$})=>[n.deletePermission?(e.openBlock(),e.createBlock(D,e.mergeProps({key:0,text:"",fab:""},{ref_for:!0},$,{onClick:K=>d(j,"")}),{default:e.withCtx(()=>[e.createVNode(p,{color:"red"},{default:e.withCtx(()=>[...i[3]||(i[3]=[e.createTextVNode("mdi-trash-can-outline",-1)])]),_:1})]),_:1},16,["onClick"])):e.createCommentVNode("",!0)]),default:e.withCtx(()=>[e.createElementVNode("span",ye,e.toDisplayString(n.selectedLang[n.lang].delete),1)]),_:2},1024),e.createVNode(N,{right:""},{activator:e.withCtx(({props:$})=>[n.editPermission?(e.openBlock(),e.createBlock(D,e.mergeProps({key:0,text:"",fab:""},{ref_for:!0},$,{onClick:K=>m(y,j)}),{default:e.withCtx(()=>[e.createVNode(p,{color:"green"},{default:e.withCtx(()=>[...i[4]||(i[4]=[e.createTextVNode("mdi-pencil-outline",-1)])]),_:1})]),_:1},16,["onClick"])):e.createCommentVNode("",!0)]),default:e.withCtx(()=>[e.createElementVNode("span",ke,e.toDisplayString(n.selectedLang[n.lang].edit),1)]),_:2},1024),e.createVNode(M),T(y.file)?(e.openBlock(),e.createBlock(D,{key:0,icon:"",onClick:$=>A(y.file)},{default:e.withCtx(()=>[e.createVNode(p,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(y.file.showDetailState?"mdi-chevron-up":"mdi-chevron-down"),1)]),_:2},1024)]),_:2},1032,["onClick"])):e.createCommentVNode("",!0)]),_:2},1024),e.createVNode(P,null,{default:e.withCtx(()=>[T(y.file)?e.withDirectives((e.openBlock(),e.createElementBlock("div",_e,[e.createVNode(u),y.file.tags.length?(e.openBlock(),e.createBlock(z,{key:0,multiple:"","active-class":"primary--text",class:"pa-2"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.file.tags,($,K)=>(e.openBlock(),e.createBlock(b,{key:`tag-${K}`,class:"ma-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString($),1)]),_:2},1024))),128))]),_:2},1024)):e.createCommentVNode("",!0),y.file.description?(e.openBlock(),e.createBlock(I,{key:1,class:"text-justify"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(y.file.description),1)]),_:2},1024)):e.createCommentVNode("",!0)],512)),[[e.vShow,y.file.showDetailState]]):e.createCommentVNode("",!0)]),_:2},1024)]),_:2},1032,["shaped","outlined","raised","tile"])]),_:2},1032,["md"]))),128))]),_:1})])}}}),Ve={class:"text-left",style:{width:"80px"}},Be={class:"text-center"},De={class:"text-left",style:{width:"120px"}},Ne={class:"text-left",style:{width:"120px"}},Fe={class:"text-center pa-3"},Te={class:"text-left pa-3"},Se={class:"text-left pa-3"},Ee={class:"text-center pa-2"},Ae={class:"d-flex justify-center ga-1"},ze=e.defineComponent({__name:"TableUploader",props:{documentAttachment:{},thumb:{type:Boolean,default:!0},lang:{default:"en"},cols:{default:4},editPermission:{type:Boolean,default:!0},deletePermission:{type:Boolean,default:!0},tableThumbColumn:{type:Boolean},tableFixedHeader:{type:Boolean,default:!0},tableHeight:{default:400},selectedLang:{}},emits:["openDeleteDialog","openEditDocumentDialog"],setup(n,{emit:a}){const t=n,o=a,c=h=>h?G(h):!1,_=h=>{const f=h/1e3,C=f/1024;return C>=1?`${C.toFixed(1)} MB`:`${f.toFixed(1)} KB`},B=h=>{const f=h/1024e3;return f<1?"success":f<5?"warning":"error"},x=(h,f)=>{o("openDeleteDialog",h,f)},w=(h,f)=>{o("openEditDocumentDialog",h,f)};return(h,f)=>{const C=e.resolveComponent("v-img"),V=e.resolveComponent("v-icon"),F=e.resolveComponent("v-tooltip"),E=e.resolveComponent("v-chip"),T=e.resolveComponent("v-btn"),A=e.resolveComponent("v-table"),d=e.resolveComponent("v-col"),m=e.resolveComponent("v-row");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(m,null,{default:e.withCtx(()=>[e.createVNode(d,{cols:"12"},{default:e.withCtx(()=>[e.createVNode(A,{"fixed-header":t.tableFixedHeader,height:t.tableHeight+"px",class:"elevation-1"},{default:e.withCtx(()=>[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[e.createElementVNode("th",Ve,e.toDisplayString(t.selectedLang[n.lang].table.thumb),1),e.createElementVNode("th",Be,e.toDisplayString(t.selectedLang[n.lang].table.name),1),e.createElementVNode("th",De,e.toDisplayString(t.selectedLang[n.lang].table.size),1),e.createElementVNode("th",Ne,e.toDisplayString(t.selectedLang[n.lang].table.action.action),1)])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.documentAttachment,(s,l)=>(e.openBlock(),e.createElementBlock("tr",{key:`attachment-${l}`,class:"table-row"},[e.createElementVNode("td",Fe,[e.createVNode(F,{location:"top"},{activator:e.withCtx(({props:i})=>[e.createElementVNode("div",e.mergeProps({class:"d-flex justify-center align-center",style:{height:"60px",width:"60px"}},{ref_for:!0},i),[c(s.file.name)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.thumb&&s.file.base64?(e.openBlock(),e.createBlock(C,{key:0,style:{height:"40px",width:"40px"},src:"data:"+s.file.format+";base64,"+s.file.base64,height:"40",width:"40",class:"rounded",contain:""},null,8,["src"])):(e.openBlock(),e.createBlock(V,{key:1,size:"40",color:"deep-purple"},{default:e.withCtx(()=>[...f[0]||(f[0]=[e.createTextVNode(" mdi-file-image-outline ",-1)])]),_:1}))],64)):(e.openBlock(),e.createBlock(V,{key:1,icon:e.unref(ee)(s.file.name),color:e.unref(te)(s.file.name),size:"40"},null,8,["icon","color"]))],16)]),default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(s.file.name),1)]),_:2},1024)]),e.createElementVNode("td",Te,[e.createVNode(F,{location:"top"},{activator:e.withCtx(({props:i})=>[e.createElementVNode("span",e.mergeProps({ref_for:!0},i),e.toDisplayString((()=>{const p=s.file.name.split(".").pop(),r=s.file.name.slice(0,s.file.name.lastIndexOf("."));return`${r.length>10?r.slice(0,10)+"...":r}.${p}`})()),17)]),default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(s.file.name),1)]),_:2},1024)]),e.createElementVNode("td",Se,[e.createVNode(E,{color:B(s.file.size),variant:"tonal",size:"small",class:"text-caption"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(_(s.file.size)),1)]),_:2},1032,["color"])]),e.createElementVNode("td",Ee,[e.createElementVNode("div",Ae,[n.editPermission?(e.openBlock(),e.createBlock(F,{key:0,location:"top"},{activator:e.withCtx(({props:i})=>[e.createVNode(T,e.mergeProps({icon:"",size:"small",color:"success",variant:"text"},{ref_for:!0},i,{onClick:p=>w(s,l)}),{default:e.withCtx(()=>[e.createVNode(V,{size:"18"},{default:e.withCtx(()=>[...f[1]||(f[1]=[e.createTextVNode("mdi-pencil-outline",-1)])]),_:1})]),_:1},16,["onClick"])]),default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(n.selectedLang[n.lang].edit),1)]),_:2},1024)):e.createCommentVNode("",!0),n.deletePermission?(e.openBlock(),e.createBlock(F,{key:1,location:"top"},{activator:e.withCtx(({props:i})=>[e.createVNode(T,e.mergeProps({icon:"",size:"small",color:"error",variant:"text"},{ref_for:!0},i,{onClick:p=>x(l,"")}),{default:e.withCtx(()=>[e.createVNode(V,{size:"18"},{default:e.withCtx(()=>[...f[2]||(f[2]=[e.createTextVNode("mdi-delete",-1)])]),_:1})]),_:1},16,["onClick"])]),default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(n.selectedLang[n.lang].table.action.deleteTooltip),1)]),_:2},1024)):e.createCommentVNode("",!0)])])]))),128))])]),_:1},8,["fixed-header","height"])]),_:1})]),_:1})])}}}),de=(n,a)=>{const t=n.__vccOpts||n;for(const[o,c]of a)t[o]=c;return t},X=de(ze,[["__scopeId","data-v-d05b814b"]]),$e={class:"d-flex align-center pa-3",style:{height:"100%"}},Le={class:"flex-grow-1 pr-4",style:{"max-width":"60%"}},Ie={class:"text-subtitle-1 font-weight-medium mb-2",style:{overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap","max-width":"100%"}},Ue={class:"flex-shrink-0",style:{"min-width":"80px"}},Pe={key:0,class:"thumbnail-container"},Me={key:1,class:"d-flex align-center justify-center"},je={class:"d-flex gap-2 pb-1"},J=de(e.defineComponent({__name:"SimpleUploader",props:{documentAttachment:{},lang:{default:"en"},thumb:{type:Boolean,default:!0},cols:{default:4},editPermission:{type:Boolean,default:!0},cardType:{},outlined:{type:Boolean},raised:{type:Boolean},shaped:{type:Boolean},tile:{type:Boolean},deletePermission:{type:Boolean,default:!0},selectedLang:{}},emits:["setCardTheme","openDeleteDialog","openEditDocumentDialog"],setup(n,{emit:a}){const t=n,o=a,c=h=>{const f=h/1e3;return f<1024?`${f.toFixed(1)} ${t.selectedLang[t.lang].size.kb}`:`${(f/1024).toFixed(1)} ${t.selectedLang[t.lang].size.mb}`},_=h=>{var f;return["jpg","jpeg","png","tif","bmp"].includes(((f=h.split(".").pop())==null?void 0:f.toLowerCase())||"")},B=h=>h.base64?h.base64.startsWith("data:")?h.base64:`data:${h.format};base64,${h.base64}`:"",x=(h,f)=>o("openDeleteDialog",h,f),w=(h,f)=>o("openEditDocumentDialog",h,f);return(h,f)=>{const C=e.resolveComponent("v-icon"),V=e.resolveComponent("v-chip"),F=e.resolveComponent("v-img"),E=e.resolveComponent("v-divider"),T=e.resolveComponent("v-btn"),A=e.resolveComponent("v-tooltip"),d=e.resolveComponent("v-chip-group"),m=e.resolveComponent("v-card-text"),s=e.resolveComponent("v-expand-transition"),l=e.resolveComponent("v-card"),i=e.resolveComponent("v-col"),p=e.resolveComponent("v-row");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(p,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.documentAttachment,(r,b)=>(e.openBlock(),e.createBlock(i,{key:`attachment-${b}`,cols:"12",sm:"6",md:"4",lg:"3"},{default:e.withCtx(()=>[e.createVNode(l,{class:"file-card",shaped:t.shaped,outlined:t.outlined,raised:t.raised,tile:t.tile,height:"180"},{default:e.withCtx(()=>[e.createElementVNode("div",$e,[e.createElementVNode("div",Le,[e.createElementVNode("div",Ie,e.toDisplayString(r.file.name),1),e.createVNode(V,{color:"teal",variant:"flat",size:"small",class:"text-white mb-2"},{default:e.withCtx(()=>[e.createVNode(C,{start:"",size:"16"},{default:e.withCtx(()=>[...f[0]||(f[0]=[e.createTextVNode("mdi-harddisk",-1)])]),_:1}),e.createTextVNode(" "+e.toDisplayString(c(r.file.size)),1)]),_:2},1024)]),e.createElementVNode("div",Ue,[_(r.file.name)&&t.thumb?(e.openBlock(),e.createElementBlock("div",Pe,[e.createVNode(F,{src:B(r.file),height:"80",width:"80",cover:"",class:"rounded"},null,8,["src"])])):(e.openBlock(),e.createElementBlock("div",Me,[e.createVNode(C,{color:e.unref(te)(r.file.name),size:"60"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(ee)(r.file.name)),1)]),_:2},1032,["color"])]))])]),e.createVNode(E,{class:"my-2"}),e.createElementVNode("div",je,[e.createVNode(A,{bottom:""},{activator:e.withCtx(({props:u})=>[t.deletePermission?(e.openBlock(),e.createBlock(T,e.mergeProps({key:0,icon:"",variant:"text",size:"small"},{ref_for:!0},u,{onClick:D=>x(b,"")}),{default:e.withCtx(()=>[e.createVNode(C,{color:"red",size:"20"},{default:e.withCtx(()=>[...f[1]||(f[1]=[e.createTextVNode("mdi-delete-outline",-1)])]),_:1})]),_:1},16,["onClick"])):e.createCommentVNode("",!0)]),default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(t.selectedLang[n.lang].delete),1)]),_:2},1024),e.createVNode(A,{bottom:""},{activator:e.withCtx(({props:u})=>[t.editPermission?(e.openBlock(),e.createBlock(T,e.mergeProps({key:0,icon:"",variant:"text",size:"small"},{ref_for:!0},u,{onClick:D=>w(r,b)}),{default:e.withCtx(()=>[e.createVNode(C,{color:"green",size:"20"},{default:e.withCtx(()=>[...f[2]||(f[2]=[e.createTextVNode("mdi-pencil-outline",-1)])]),_:1})]),_:1},16,["onClick"])):e.createCommentVNode("",!0)]),default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(t.selectedLang[n.lang].edit),1)]),_:2},1024)]),e.createVNode(s,null,{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",null,[e.createVNode(E),r.file.tags.length?(e.openBlock(),e.createBlock(d,{key:0,multiple:"","active-class":"primary--text",style:{padding:"8px"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.file.tags,(u,D)=>(e.openBlock(),e.createBlock(V,{key:`tag-${D}`,style:{margin:"5px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u),1)]),_:2},1024))),128))]),_:2},1024)):e.createCommentVNode("",!0),r.file.description?(e.openBlock(),e.createBlock(m,{key:1,style:{"text-align":"justify"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.file.description),1)]),_:2},1024)):e.createCommentVNode("",!0)],512),[[e.vShow,r.file.showDetailState]])]),_:2},1024)]),_:2},1032,["shaped","outlined","raised","tile"])]),_:2},1024))),128))]),_:1})])}}}),[["__scopeId","data-v-f7000da4"]]),Q=e.defineComponent({__name:"InsertButton",props:{documentAttachment:{},badgeCounter:{type:Boolean},btnColor:{},lang:{},maxFileCount:{},selectedLang:{}},emits:["openInputDocumentModal"],setup(n,{emit:a}){const t=a,o=n,c=()=>{t("openInputDocumentModal")};return(_,B)=>{const x=e.resolveComponent("v-btn"),w=e.resolveComponent("v-badge");return e.openBlock(),e.createElementBlock("div",null,[o.badgeCounter?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[o.documentAttachment.length>0?(e.openBlock(),e.createBlock(w,{key:0,bordered:"",color:o.documentAttachment.length===o.maxFileCount?"error":"success",overlap:"",content:n.documentAttachment.length},{default:e.withCtx(()=>[e.createVNode(x,{color:o.btnColor,onClick:c,class:"mb-4"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.selectedLang[n.lang].insertFile),1)]),_:1},8,["color"])]),_:1},8,["color","content"])):(e.openBlock(),e.createBlock(x,{key:1,color:o.btnColor,onClick:c,class:"mb-4"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.selectedLang[n.lang].insertFile),1)]),_:1},8,["color"]))],64)):e.createCommentVNode("",!0),o.badgeCounter?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(x,{key:1,color:n.btnColor,onClick:c,class:"mb-4"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.selectedLang[n.lang].insertFile),1)]),_:1},8,["color"]))])}}}),me={en:{insertFile:"Insert File",insertNewFile:"Insert New File",add:"Add",delete:"Delete",edit:"Edit",deleteDialog:{message:"Are you sure you want to delete the file?",cancel:"cancel"},table:{thumb:"Thumb",name:"Name",size:"Size",tags:"tags",action:{action:"Action",deleteTooltip:"Delete"}},size:{kb:"KB",mb:"MB"},maxFileSizeAlert:"Max file Size is",maxFileCountAlert:"Max file Count is",fileName:"File Name",fileDescription:"File Description",fileTags:"File Tags"},fa:{insertFile:"افزودن فایل",insertNewFile:"افزودن فایل جدید",add:"افزودن",delete:"حذف",edit:"ویرایش",deleteDialog:{message:"آیا برای حذف فایل اطمینان دارید؟",cancel:"لغو"},table:{thumb:"پیش نمایش",name:"نام",size:"حجم",action:{action:"عملیات",deleteTooltip:"حذف"}},size:{kb:"کیلو بایت",mb:"مگابایت"},maxFileSizeAlert:"حداکثر حجم فایل انتحابی ",maxFileCountAlert:"حداکثر تعداد فایل انتخابی",fileName:"نام فایل",fileDescription:"توضیحات فایل",fileTags:"برچسب فایل"},fr:{insertFile:"Insérer un fichier",insertNewFile:"Insérer un nouveau fichier",add:"Ajouter",delete:"Supprimer",edit:"Éditer",deleteDialog:{message:"Voulez-vous vraiment supprimer le fichier?",cancel:"Annuler"},table:{thumb:"la vignette",name:"Nom",size:"Taille",action:{action:"Action",deleteTooltip:"Supprimer"}},size:{kb:"KB",mb:"MB"},maxFileSizeAlert:"La taille maximale du fichier est",maxFileCountAlert:"Le nombre maximal de fichiers est",fileName:"Nom de fichier",fileDescription:"description du fichier",fileTags:"Balises de fichier"},ch:{insertFile:"插入档案",insertNewFile:"插入新文件",add:"加",delete:"删除",edit:"编辑",deleteDialog:{message:"您确定要删除文件吗?",cancel:"取消"},table:{thumb:"缩图",name:"名称",size:"尺寸",action:{action:"行动",deleteTooltip:"删除"}},size:{kb:"KB",mb:"MB"},maxFileSizeAlert:"档案大小上限为",maxFileCountAlert:"现“最大文件数”为",fileName:"文档名称",fileDescription:"文件描述",fileTags:"文件标签"},ar:{insertFile:"إدراج ملف",insertNewFile:"إدراج ملف جديد",add:"أضف",delete:"حذف",edit:"تعديل",deleteDialog:{message:"هل أنت متأكد أنك تريد حذف الملف؟",cancel:"إلغاء"},table:{thumb:"ظفري",name:"اسم",size:"بحجم",action:{action:"عمل",deleteTooltip:"حذف"}},size:{kb:"کیلو بایت",mb:"ميغا بايت"},maxFileSizeAlert:"الحجم الأقصى للملف هو",maxFileCountAlert:"الحد الأقصى لعدد الملفات هو",fileName:"اسم الملف",fileDescription:"وصف الملف",fileTags:"علامات الملف"}};function He(n,a={}){const{maxFileSize:t=5*1024*1024,maxFileCount:o=10,imageCompressor:c=!1,imageCompressLevel:_=.8,fileAccept:B="*"}=a,x=e.ref(!1),w=e.ref({show:!1,text:"",color:"success"}),h=e.computed(()=>n.value.length),f=e.computed(()=>h.value<o),C=e.computed(()=>n.value.reduce((s,l)=>s+l.file.size,0));function V(s,l="success"){w.value={show:!0,text:s,color:l}}function F(s){var l;if(!ae(s.size,t))return{valid:!1,error:`File size exceeds maximum allowed size of ${(t/1048576).toFixed(1)}MB`};if(!re(h.value,o))return{valid:!1,error:`Maximum file count of ${o} reached`};if(B!=="*"){const i=B.split(",").map(u=>u.trim()),p=`.${(l=s.name.split(".").pop())==null?void 0:l.toLowerCase()}`,r=s.type;if(!i.some(u=>u.startsWith(".")?u===p:u.includes("/*")?r.startsWith(u.replace("/*","")):u===r))return{valid:!1,error:`File type not accepted. Allowed types: ${B}`}}return{valid:!0}}async function E(s){let l;if(c&&G(s.name,s.type))try{l=(await ce(s,_)).split(",")[1]}catch(r){console.warn("Image compression failed, using original file:",r),l=await ne(s)}else l=await ne(s);const i=q(s.size),p=oe(s.name);return{base64:l,size:i.text,name:s.name,tags:[],description:"",showDetailState:!1,format:p}}async function T(s){if(x.value)return!1;x.value=!0;const l=Array.from(s),i=[];for(const p of l){const r=F(p);r.valid?i.push(p):V(r.error,"error")}if(i.length===0)return x.value=!1,!1;try{const r=(await Promise.all(i.map(u=>E(u)))).map(u=>{var D;return{file:{name:u.name,format:u.format,base64:u.base64,size:((D=i.find(N=>N.name===u.name))==null?void 0:D.size)||0,tags:u.tags,description:u.description,showDetailState:u.showDetailState}}});n.value.push(...r);const b=i.length===1?`File "${i[0].name}" uploaded successfully`:`${i.length} files uploaded successfully`;return V(b,"success"),!0}catch(p){return console.error("File upload error:",p),V("Failed to upload files. Please try again.","error"),!1}finally{x.value=!1}}function A(s){if(s>=0&&s<n.value.length){const l=n.value[s];return n.value.splice(s,1),V(`File "${l.file.name}" removed`,"warning"),!0}return!1}function d(s,l){if(s>=0&&s<n.value.length){const i=n.value[s].file;return Object.assign(i,l),V("File updated successfully","success"),!0}return!1}function m(){const s=n.value.length;n.value.splice(0),V(`${s} files cleared`,"warning")}return{isUploading:x,snackbar:w,fileCount:h,canAddMoreFiles:f,totalSize:C,uploadFiles:T,removeFile:A,updateFileMetadata:d,clearAllFiles:m,validateFile:F,showSnackbar:V}}function lt(n){return n}function Oe(n={}){const{maxErrors:a=10,autoRemoveTimeout:t=5e3,logToConsole:o=!0}=n,c=e.ref([]),_=e.ref(!1);function B(){return`error_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}function x(l,i="error",p,r){const b={id:B(),message:l,type:i,timestamp:new Date,context:p,action:r};return o&&(i==="error"?console.error:i==="warning"?console.warn:i==="info"?console.info:console.log)(`[${i.toUpperCase()}] ${l}`,p||""),c.value.unshift(b),c.value.length>a&&(c.value=c.value.slice(0,a)),t>0&&setTimeout(()=>{w(b.id)},t),b.id}function w(l){const i=c.value.findIndex(p=>p.id===l);return i!==-1?(c.value.splice(i,1),!0):!1}function h(){c.value=[]}function f(l){c.value=c.value.filter(i=>i.type!==l)}async function C(l,i,p){_.value=!0;try{return await l()}catch(r){const b=i||(r instanceof Error?r.message:"An unexpected error occurred");return x(b,"error",{...p,originalError:r instanceof Error?r.message:String(r)}),null}finally{_.value=!1}}function V(l,i,p){return l||x(i,"error",p),l}function F(l,i){return x(l,"success",i)}function E(l,i){return x(l,"warning",i)}function T(l,i){return x(l,"info",i)}function A(l){return c.value.filter(i=>i.type===l)}function d(){return c.value[0]||null}function m(l){return l?c.value.some(i=>i.type===l):c.value.length>0}const s={fileSizeExceeded:(l,i)=>x(`File "${l}" exceeds maximum size of ${(i/(1024*1024)).toFixed(1)}MB`,"error",{fileName:l,maxSize:i,category:"file-upload"}),fileCountExceeded:l=>x(`Maximum file count of ${l} reached`,"error",{maxCount:l,category:"file-upload"}),invalidFileType:(l,i)=>x(`File "${l}" type not allowed. Accepted types: ${i}`,"error",{fileName:l,allowedTypes:i,category:"file-upload"}),uploadFailed:(l,i)=>x(`Failed to upload "${l}"${i?`: ${i}`:""}`,"error",{fileName:l,reason:i,category:"file-upload"}),compressionFailed:l=>x(`Image compression failed for "${l}", using original file`,"warning",{fileName:l,category:"file-upload"})};return{errors:c,isLoading:_,addError:x,removeError:w,clearErrors:h,clearErrorsByType:f,handleAsync:C,validate:V,showSuccess:F,showWarning:E,showInfo:T,getErrorsByType:A,getLatestError:d,hasErrors:m,fileUploadErrors:s}}function it(n){return n}function Re(n){const a=["simple","thumbnail","table"],t={isValid:!0,errors:[],warnings:[]};return typeof n!="string"?(t.isValid=!1,t.errors.push("File uploader type must be a string")):a.includes(n)||(t.isValid=!1,t.errors.push(`File uploader type must be one of: ${a.join(", ")}`)),t}function We(n){const a=["default","outlined","shaped","raised","tile"],t={isValid:!0,errors:[],warnings:[]};return n!==void 0&&typeof n!="string"?(t.isValid=!1,t.errors.push("Card type must be a string")):n&&!a.includes(n)&&(t.isValid=!1,t.errors.push(`Card type must be one of: ${a.join(", ")}`)),t}function Ke(n){const a=["en","fa","fr","ch","ar"],t={isValid:!0,errors:[],warnings:[]};return typeof n!="string"?(t.isValid=!1,t.errors.push("Language code must be a string")):a.includes(n)||(t.isValid=!1,t.errors.push(`Language code must be one of: ${a.join(", ")}`)),t}function qe(n){const a={isValid:!0,errors:[],warnings:[]};return typeof n!="number"?(a.isValid=!1,a.errors.push("File size must be a number")):n<=0?(a.isValid=!1,a.errors.push("File size must be greater than 0")):n>100*1024*1024&&a.warnings.push("File size limit is very large (>100MB), consider reducing for better performance"),a}function Ge(n){const a={isValid:!0,errors:[],warnings:[]};return typeof n!="number"?(a.isValid=!1,a.errors.push("File count must be a number")):n<0?(a.isValid=!1,a.errors.push("File count cannot be negative")):n>100&&a.warnings.push("File count limit is very high (>100), consider reducing for better performance"),a}function Ye(n){const a={isValid:!0,errors:[],warnings:[]};return typeof n!="number"?(a.isValid=!1,a.errors.push("Compression level must be a number")):n<0||n>1?(a.isValid=!1,a.errors.push("Compression level must be between 0 and 1")):n<.1?a.warnings.push("Very low compression level may result in poor image quality"):n>.9&&a.warnings.push("Very high compression level may not reduce file size significantly"),a}function Xe(n){const a={isValid:!0,errors:[],warnings:[]};return n!==void 0&&typeof n!="string"?(a.isValid=!1,a.errors.push("File accept pattern must be a string")):n&&n.trim()===""&&a.warnings.push("Empty file accept pattern will accept all files"),a}function Je(n){const a={isValid:!0,errors:[],warnings:[]};return typeof n!="number"?(a.isValid=!1,a.errors.push("Columns count must be a number")):(n<1||n>12)&&(a.isValid=!1,a.errors.push("Columns count must be between 1 and 12")),a}function Qe(n){const a={isValid:!0,errors:[],warnings:[]};return n!==void 0&&typeof n!="number"?(a.isValid=!1,a.errors.push("Table height must be a number")):n&&n<100?a.warnings.push("Table height is very small (<100px), content may not be visible"):n&&n>1e3&&a.warnings.push("Table height is very large (>1000px), consider reducing for better UX"),a}function Ze(n){const a={isValid:!0,errors:[],warnings:[]};return Array.isArray(n)?(n.forEach((t,o)=>{if(!t||typeof t!="object"){a.errors.push(`Attachment at index ${o} must be an object`);return}if(!t.file||typeof t.file!="object"){a.errors.push(`Attachment at index ${o} must have a file property`);return}const c=t.file;["name","format","base64","size"].forEach(B=>{B in c||a.errors.push(`File at index ${o} is missing required field: ${B}`)}),c.name&&typeof c.name!="string"&&a.errors.push(`File name at index ${o} must be a string`),c.format&&typeof c.format!="string"&&a.errors.push(`File format at index ${o} must be a string`),c.base64&&typeof c.base64!="string"&&a.errors.push(`File base64 at index ${o} must be a string`),c.size&&typeof c.size!="number"&&a.errors.push(`File size at index ${o} must be a number`),c.tags&&!Array.isArray(c.tags)&&a.errors.push(`File tags at index ${o} must be an array`)}),a.errors.length>0&&(a.isValid=!1),a):(a.isValid=!1,a.errors.push("Document attachment must be an array"),a)}function ve(n){const a={isValid:!0,errors:[],warnings:[]};return[{key:"fileUploaderType",validator:Re},{key:"cardType",validator:We},{key:"lang",validator:Ke},{key:"maxFileSize",validator:qe},{key:"maxFileCount",validator:Ge},{key:"imageCompressLevel",validator:Ye},{key:"fileAccept",validator:Xe},{key:"cols",validator:Je},{key:"tableHeight",validator:Qe},{key:"documentAttachment",validator:Ze}].forEach(({key:o,validator:c})=>{if(o in n){const _=c(n[o]);a.errors.push(..._.errors.map(B=>`${o}: ${B}`)),a.warnings.push(..._.warnings.map(B=>`${o}: ${B}`)),_.isValid||(a.isValid=!1)}}),a}const le=e.defineComponent({__name:"handyUploader",props:{documentAttachment:{},lang:{default:"en"},maxFileSize:{default:5242880},fileUploaderType:{default:"thumbnail"},maxFileCount:{default:10},badgeCounter:{type:Boolean,default:!0},btnColor:{default:"info"},imageCompressor:{type:Boolean},imageCompressLevel:{default:.8},fileAccept:{},thumb:{type:Boolean,default:!0},tableThumbColumn:{type:Boolean},tableFixedHeader:{type:Boolean,default:!0},tableHeight:{default:400},rtlSupport:{type:Boolean,default:!1},changeFileName:{type:Boolean,default:!1},addFileDescription:{type:Boolean,default:!1},addFileTag:{type:Boolean,default:!1},tags:{},customLang:{default:null},insertPermission:{type:Boolean,default:!0},cols:{default:3},editPermission:{type:Boolean,default:!0},deletePermission:{type:Boolean,default:!0},cardType:{default:"default"},outlined:{type:Boolean},raised:{type:Boolean},shaped:{type:Boolean},tile:{type:Boolean}},emits:["updateCardType","updateBadgeCounter","updateMaxFileCount","updateMaxFileSize","updateImageCompressor","updateImageCompressLevel","updateFileAccept","updateThumb","updateChangeFileName","updateAddFileDescription","updateTableThumbColumn","updateTableFixedHeader","updateTableHeight","updateLang","updateDocumentAttachment"],setup(n,{emit:a}){const t=n;if(process.env.NODE_ENV==="development"){const d=ve(t);d.isValid||console.error("HandyUploader prop validation failed:",d.errors),d.warnings.length>0&&console.warn("HandyUploader prop validation warnings:",d.warnings)}const o=e.reactive({insertDocumentDialog:!1,editDocumentDialog:!1,deleteDocumentDialog:!1,tempAttachment:[],tempAttachmentChanged:[],fileUploaderSnackBarAlert:!1,fileUploaderSnackText:"",fileUploaderSnackBarAlertColor:"green",readerFile:null,registryDocFile:[],documentAttachmentAPI:[],btnLoader:!1,showDetail:!1,showDetailState:[],selectedIndex:0,selectedId:"",returnedRecord:{},outlined:!1,raised:!1,shaped:!1,tile:!1,selectedLang:{},beforeInsertAttachments:{},attachmentIndex:0}),c=a;e.onBeforeMount(()=>{B(),o.registryDocFile=t.documentAttachment,t.rtlSupport&&x(),w()}),e.watch(()=>o.tempAttachment,d=>{d&&d.length>0?E(d):o.tempAttachmentChanged=[]}),e.watch(()=>t.cardType,d=>{c("updateCardType",d),w()}),e.watch(()=>t.badgeCounter,d=>{c("updateBadgeCounter",d)}),e.watch(()=>t.maxFileCount,d=>{c("updateMaxFileCount",d)}),e.watch(()=>t.maxFileSize,d=>{c("updateMaxFileSize",d)}),e.watch(()=>t.maxFileSize,d=>{c("updateMaxFileSize",d)}),e.watch(()=>t.imageCompressor,d=>{c("updateImageCompressor",d)}),e.watch(()=>t.imageCompressLevel,d=>{c("updateImageCompressLevel",d)}),e.watch(()=>t.fileAccept,d=>{c("updateFileAccept",d)}),e.watch(()=>t.thumb,d=>{c("updateThumb",d)}),e.watch(()=>t.changeFileName,d=>{c("updateChangeFileName",d)}),e.watch(()=>t.addFileDescription,d=>{c("updateAddFileDescription",d)}),e.watch(()=>t.addFileTag,d=>{c("updateAddFileDescription",d)}),e.watch(()=>t.tableThumbColumn,d=>{c("updateTableThumbColumn",d)}),e.watch(()=>t.tableFixedHeader,d=>{c("updateTableFixedHeader",d)}),e.watch(()=>t.tableHeight,d=>{c("updateTableHeight",d)}),e.watch(()=>t.lang,d=>{c("updateLang",d)}),e.onDeactivated(()=>{o.registryDocFile=[]});const _=()=>{o.btnLoader=!1,o.tempAttachment=[],o.insertDocumentDialog=!0},B=()=>{t.customLang!==null?o.selectedLang=t.customLang:o.selectedLang=me},x=()=>{},w=()=>{const m={default:{outlined:!1,raised:!1,shaped:!1,tile:!1},outlined:{outlined:!0,raised:!1,shaped:!1,tile:!1},shaped:{outlined:!1,raised:!1,shaped:!0,tile:!1},raised:{outlined:!1,raised:!0,shaped:!1,tile:!1},tile:{outlined:!1,raised:!1,shaped:!1,tile:!0}}[t.cardType||"default"];o.outlined=m.outlined,o.raised=m.raised,o.shaped=m.shaped,o.tile=m.tile},h=d=>{const m=new FileReader;return new Promise(function(s){m.onloadend=()=>{s(m.result)},m.readAsDataURL(d)})},f=async()=>{o.btnLoader=!0;const d=(m,s)=>{o.fileUploaderSnackText=m,o.fileUploaderSnackBarAlertColor=s,o.fileUploaderSnackBarAlert=!0};for(const[m,s]of o.tempAttachmentChanged.entries()){if(t.documentAttachment.length>=t.maxFileCount){d(`${o.selectedLang[t.lang].maxFileCountAlert} ${t.maxFileCount}`,"red");break}if(s.file.size/1e3>t.maxFileSize){d(`${o.selectedLang[t.lang].maxFileSizeAlert} ${Math.round(t.maxFileSize/1024)} ${o.selectedLang[t.lang].size.mb}`,"red");continue}let l={};const i={},p=s.file,r=p.format;let b=!1,u="",D=p.base64;t.imageCompressor&&["image/png","image/jpg","image/jpeg","image/webp"].includes(r)&&(b=!0,u=await C(`data:${r};base64,${D}`),D=u.split(",")[1]);try{const N=D.replace(/\s/g,"");l={base64:N,size:b?(atob(N).length/1024).toFixed(1):p.size.toString(),name:`${p.name}.${p.format}`,tags:p.tags||[],description:p.description||"",showDetailState:!1,format:r},i.file=l,o.registryDocFile.push(i),c("updateDocumentAttachment",o.registryDocFile)}catch(N){console.error("Error processing Base64 string:",N),d("File could not be processed due to an invalid format.","red");continue}}o.documentAttachmentAPI=[],o.tempAttachmentChanged=[],o.insertDocumentDialog=!1,o.btnLoader=!1},C=d=>{const m=document.createElement("canvas"),s=document.createElement("img");return new Promise((l,i)=>{const p=t.imageCompressLevel;s.onload=function(){const r=s.width,b=s.height;m.width=r,m.height=b;const u=m.getContext("2d");u==null||u.drawImage(s,0,0,r,b),l(m.toDataURL("image/jpeg",p))},s.onerror=function(r){i(r)},s.src=d})},V=(d,m)=>{o.btnLoader=!1,o.selectedIndex=d,o.selectedId=m,o.deleteDocumentDialog=!0},F=()=>{o.registryDocFile.splice(o.selectedIndex,1),c("updateDocumentAttachment",o.registryDocFile),o.deleteDocumentDialog=!1},E=async d=>{for(const m of d){let s="";try{s=await h(m)}catch(p){console.log(p);continue}const i={file:{name:m.name.split(".")[0],format:m.name.substr(m.name.lastIndexOf(".")+1),base64:s.split(",")[1],size:m.size,tags:[],description:null,showDetailState:!1}};o.tempAttachmentChanged.push(i)}},T=(d,m)=>{o.btnLoader=!1,o.attachmentIndex=m,o.editDocumentDialog=!0,o.tempAttachmentChanged=[d]},A=()=>{const d=[...t.documentAttachment];d.splice(o.attachmentIndex,1,o.tempAttachmentChanged[0]),c("updateDocumentAttachment",d),o.editDocumentDialog=!1};return(d,m)=>{const s=e.resolveComponent("v-col"),l=e.resolveComponent("v-row"),i=e.resolveComponent("v-icon"),p=e.resolveComponent("v-card-title"),r=e.resolveComponent("v-file-input"),b=e.resolveComponent("v-expansion-panel-title"),u=e.resolveComponent("v-text-field"),D=e.resolveComponent("v-textarea"),N=e.resolveComponent("v-autocomplete"),M=e.resolveComponent("v-img"),L=e.resolveComponent("v-card"),z=e.resolveComponent("v-expansion-panel-text"),I=e.resolveComponent("v-expansion-panel"),P=e.resolveComponent("v-expansion-panels"),R=e.resolveComponent("v-list-item-title"),ie=e.resolveComponent("v-list-item"),W=e.resolveComponent("v-card-text"),y=e.resolveComponent("v-btn"),j=e.resolveComponent("v-card-actions"),$=e.resolveComponent("v-dialog"),K=e.resolveComponent("v-snackbar"),tt=e.resolveComponent("v-spacer"),ot=e.resolveComponent("v-container");return e.openBlock(),e.createBlock(ot,null,{default:e.withCtx(()=>[e.createVNode(l,null,{default:e.withCtx(()=>[e.createVNode(s,{cols:"12",md:"12",xs:"12"},{default:e.withCtx(()=>[e.createVNode(Q,{documentAttachment:t.documentAttachment,selectedLang:o.selectedLang,lang:t.lang,badgeCounter:t.badgeCounter,btnColor:t.btnColor,maxFileCount:t.maxFileCount,onOpenInputDocumentModal:_},null,8,["documentAttachment","selectedLang","lang","badgeCounter","btnColor","maxFileCount"]),t.fileUploaderType==="simple"?(e.openBlock(),e.createBlock(J,{key:0,documentAttachment:t.documentAttachment,cols:t.cols,thumb:t.thumb,outlined:o.outlined,raised:o.raised,shaped:o.shaped,tile:o.tile,lang:t.lang,cardType:t.cardType,deletePermission:t.deletePermission,editPermission:t.editPermission,selectedLang:o.selectedLang,onSetCardTheme:w,onOpenDeleteDialog:V,onOpenEditDocumentDialog:T},null,8,["documentAttachment","cols","thumb","outlined","raised","shaped","tile","lang","cardType","deletePermission","editPermission","selectedLang"])):e.createCommentVNode("",!0),t.fileUploaderType==="thumbnail"?(e.openBlock(),e.createBlock(Y,{key:1,documentAttachment:t.documentAttachment,cols:t.cols,thumb:t.thumb,outlined:o.outlined,raised:o.raised,shaped:o.shaped,tile:o.tile,lang:t.lang,cardType:t.cardType,deletePermission:t.deletePermission,editPermission:t.editPermission,selectedLang:o.selectedLang,onSetCardTheme:w,onOpenDeleteDialog:m[0]||(m[0]=(g,U)=>V(g,U)),onOpenEditDocumentDialog:m[1]||(m[1]=(g,U)=>T(g,U))},null,8,["documentAttachment","cols","thumb","outlined","raised","shaped","tile","lang","cardType","deletePermission","editPermission","selectedLang"])):e.createCommentVNode("",!0),t.fileUploaderType==="table"?(e.openBlock(),e.createBlock(X,{key:2,documentAttachment:t.documentAttachment,cols:t.cols,thumb:t.thumb,outlined:o.outlined,raised:o.raised,shaped:o.shaped,tile:o.tile,lang:t.lang,tableThumbColumn:t.tableThumbColumn,tableFixedHeader:t.tableFixedHeader,tableHeight:t.tableHeight,cardType:t.cardType,deletePermission:t.deletePermission,editPermission:t.editPermission,selectedLang:o.selectedLang,onSetCardTheme:w,onOpenDeleteDialog:V,onOpenEditDocumentDialog:T},null,8,["documentAttachment","cols","thumb","outlined","raised","shaped","tile","lang","tableThumbColumn","tableFixedHeader","tableHeight","cardType","deletePermission","editPermission","selectedLang"])):e.createCommentVNode("",!0)]),_:1})]),_:1}),e.createVNode(l,{justify:"center"},{default:e.withCtx(()=>[e.createVNode($,{modelValue:o.insertDocumentDialog,"onUpdate:modelValue":m[5]||(m[5]=g=>o.insertDocumentDialog=g),scrollable:!1,persistent:"",width:"50%"},{default:e.withCtx(()=>[e.createVNode(L,null,{default:e.withCtx(()=>[e.createVNode(p,null,{default:e.withCtx(()=>[e.createVNode(i,{onClick:m[2]||(m[2]=g=>o.insertDocumentDialog=!1)},{default:e.withCtx(()=>[...m[12]||(m[12]=[e.createTextVNode("mdi-close",-1)])]),_:1})]),_:1}),e.createVNode(W,null,{default:e.withCtx(()=>[o.tempAttachment.length===0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.fileAccept!==""?(e.openBlock(),e.createBlock(r,{key:0,multiple:"",accept:t.fileAccept,chip:"",modelValue:o.tempAttachment,"onUpdate:modelValue":m[3]||(m[3]=g=>o.tempAttachment=g),label:o.selectedLang[n.lang].insertNewFile},null,8,["accept","modelValue","label"])):(e.openBlock(),e.createBlock(r,{key:1,multiple:"",modelValue:o.tempAttachment,"onUpdate:modelValue":m[4]||(m[4]=g=>o.tempAttachment=g),label:o.selectedLang[n.lang].insertNewFile},null,8,["modelValue","label"]))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.addFileTag||t.addFileDescription||t.changeFileName?(e.openBlock(),e.createBlock(P,{key:0},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.tempAttachmentChanged,(g,U)=>(e.openBlock(),e.createBlock(I,{key:`attachment-${U}`},{default:e.withCtx(()=>[e.createVNode(b,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g.file.name),1)]),_:2},1024),e.createVNode(z,null,{default:e.withCtx(()=>[e.createVNode(l,{align:"center",justify:"center"},{default:e.withCtx(()=>[e.createVNode(s,{cols:"12",lg:"9",md:"9",xs:"12"},{default:e.withCtx(()=>[t.changeFileName?(e.openBlock(),e.createBlock(u,{key:0,label:o.selectedLang[n.lang].fileName,modelValue:g.file.name,"onUpdate:modelValue":S=>g.file.name=S},null,8,["label","modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0),t.addFileDescription?(e.openBlock(),e.createBlock(D,{key:1,label:o.selectedLang[n.lang].fileDescription,"auto-grow":"","row-height":"1",modelValue:g.file.description,"onUpdate:modelValue":S=>g.file.description=S},null,8,["label","modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0),t.addFileTag?(e.openBlock(),e.createBlock(N,{key:2,modelValue:g.file.tags,"onUpdate:modelValue":S=>g.file.tags=S,items:t.tags,dense:"",chips:"",label:o.selectedLang[n.lang].fileTags,multiple:""},null,8,["modelValue","onUpdate:modelValue","items","label"])):e.createCommentVNode("",!0)]),_:2},1024),e.createVNode(s,{align:"center",cols:"12",lg:"3",md:"3",xs:"12"},{default:e.withCtx(()=>[g.file.format==="jpg"||g.file.format==="jpeg"||g.file.format==="png"||g.file.format==="tif"||g.file.format==="bmp"?(e.openBlock(),e.createBlock(L,{key:0},{default:e.withCtx(()=>[e.createVNode(M,{src:"data:"+g.file.format+";base64,"+g.file.base64},null,8,["src"])]),_:2},1024)):(e.openBlock(),e.createBlock(H,{key:1,"file-format":g.file.format,size:60},null,8,["file-format"]))]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))]),_:1})):(e.openBlock(),e.createBlock(L,{key:1,class:"mx-auto",tile:""},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.tempAttachmentChanged,(g,U)=>(e.openBlock(),e.createBlock(ie,{key:`attachment-${U}`,style:{"border-bottom":"1px solid #E0E0E0"}},{default:e.withCtx(()=>[e.createVNode(R,null,{default:e.withCtx(()=>[e.createVNode(H,{"file-format":g.file.format,size:24},null,8,["file-format"]),e.createTextVNode(" "+e.toDisplayString(g.file.name)+"."+e.toDisplayString(g.file.format),1)]),_:2},1024)]),_:2},1024))),128))]),_:1}))],64))]),_:1}),e.createVNode(j,null,{default:e.withCtx(()=>[e.createVNode(y,{disabled:o.tempAttachment==null||o.btnLoader,loading:o.btnLoader,color:t.btnColor,onClick:f},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.selectedLang[n.lang].add),1)]),_:1},8,["disabled","loading","color"])]),_:1})]),_:1})]),_:1},8,["modelValue"])]),_:1}),e.createVNode(l,{justify:"center"},{default:e.withCtx(()=>[e.createVNode($,{modelValue:o.editDocumentDialog,"onUpdate:modelValue":m[7]||(m[7]=g=>o.editDocumentDialog=g),scrollable:!1,persistent:"",width:"50%"},{default:e.withCtx(()=>[e.createVNode(L,null,{default:e.withCtx(()=>[e.createVNode(p,null,{default:e.withCtx(()=>[e.createVNode(i,{onClick:m[6]||(m[6]=g=>o.editDocumentDialog=!1)},{default:e.withCtx(()=>[...m[13]||(m[13]=[e.createTextVNode("mdi-close",-1)])]),_:1})]),_:1}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.tempAttachmentChanged,(g,U)=>(e.openBlock(),e.createBlock(W,{key:`attachment-${U}`},{default:e.withCtx(()=>[e.createVNode(l,{align:"center",justify:"center"},{default:e.withCtx(()=>[e.createVNode(s,{cols:"12",lg:"9",md:"9",xs:"12"},{default:e.withCtx(()=>[t.changeFileName?(e.openBlock(),e.createBlock(u,{key:0,label:o.selectedLang[n.lang].fileName,modelValue:g.file.name,"onUpdate:modelValue":S=>g.file.name=S},null,8,["label","modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0),t.addFileDescription?(e.openBlock(),e.createBlock(D,{key:1,label:o.selectedLang[n.lang].fileDescription,"auto-grow":"","row-height":"1",modelValue:g.file.description,"onUpdate:modelValue":S=>g.file.description=S},null,8,["label","modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0),t.addFileTag?(e.openBlock(),e.createBlock(N,{key:2,modelValue:g.file.tags,"onUpdate:modelValue":S=>g.file.tags=S,items:t.tags,dense:"",chips:"",label:o.selectedLang[n.lang].fileTags,multiple:""},null,8,["modelValue","onUpdate:modelValue","items","label"])):e.createCommentVNode("",!0)]),_:2},1024),e.createVNode(s,{align:"center",cols:"12",lg:"3",md:"3",xs:"12"},{default:e.withCtx(()=>{var S;return[g.file.name&&["jpg","jpeg","png","tif","bmp"].includes(((S=g.file.name.split(".").pop())==null?void 0:S.toLowerCase())||"")?(e.openBlock(),e.createBlock(L,{key:0},{default:e.withCtx(()=>[e.createVNode(M,{src:"data:"+g.file.format+";base64,"+g.file.base64},null,8,["src"])]),_:2},1024)):(e.openBlock(),e.createBlock(H,{key:1,"file-format":g.file.format,size:60},null,8,["file-format"]))]}),_:2},1024)]),_:2},1024)]),_:2},1024))),128)),e.createVNode(j,null,{default:e.withCtx(()=>[e.createVNode(y,{disabled:o.tempAttachment===null||o.btnLoader,loading:o.btnLoader,color:t.btnColor,onClick:A},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.selectedLang[n.lang].edit),1)]),_:1},8,["disabled","loading","color"])]),_:1})]),_:1})]),_:1},8,["modelValue"])]),_:1}),e.createVNode(K,{modelValue:o.fileUploaderSnackBarAlert,"onUpdate:modelValue":m[9]||(m[9]=g=>o.fileUploaderSnackBarAlert=g),right:"",bottom:"",color:o.fileUploaderSnackBarAlertColor,timeout:3e3},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.fileUploaderSnackText)+" ",1),e.createVNode(y,{color:"white",text:"",onClick:m[8]||(m[8]=g=>o.fileUploaderSnackBarAlert=!1)},{default:e.withCtx(()=>[e.createVNode(i,null,{default:e.withCtx(()=>[...m[14]||(m[14]=[e.createTextVNode("mdi-close",-1)])]),_:1})]),_:1})]),_:1},8,["modelValue","color"]),e.createVNode(l,{justify:"center"},{default:e.withCtx(()=>[e.createVNode($,{modelValue:o.deleteDocumentDialog,"onUpdate:modelValue":m[11]||(m[11]=g=>o.deleteDocumentDialog=g),persistent:"",width:"30%"},{default:e.withCtx(()=>[e.createVNode(L,null,{default:e.withCtx(()=>[e.createVNode(p,null,{default:e.withCtx(()=>[e.createVNode(i,{color:"red"})]),_:1}),e.createVNode(W,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.selectedLang[n.lang].deleteDialog.message),1)]),_:1}),e.createVNode(j,null,{default:e.withCtx(()=>[e.createVNode(tt),e.createVNode(y,{color:"green darken-1",text:"",onClick:m[10]||(m[10]=g=>o.deleteDocumentDialog=!1)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.selectedLang[n.lang].deleteDialog.cancel),1)]),_:1}),e.createVNode(y,{color:"primary",disabled:o.btnLoader,loading:o.btnLoader,onClick:F},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.selectedLang[n.lang].delete),1)]),_:1},8,["disabled","loading"])]),_:1})]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1})}}}),et={ThumbnailUploader:Y,TableUploader:X,SimpleUploader:J,HandyUploader:le,InsertButton:Q,SelectFileIconType:H};function pe(n){n.component("ThumbnailUploader",Y),n.component("TableUploader",X),n.component("SimpleUploader",J),n.component("HandyUploader",le),n.component("InsertButton",Q),n.component("SelectFileIconType",H)}typeof window<"u"&&window.Vue&&pe(window.Vue),k.HandyUploader=le,k.InsertButton=Q,k.SelectFileIconType=H,k.SimpleUploader=J,k.TableUploader=X,k.ThumbnailUploader=Y,k.compressImage=ce,k.constructImageDataUrl=se,k.default=et,k.fileToBase64=ne,k.formatFileSize=q,k.getFileIcon=fe,k.getFileType=O,k.getMimeTypeFromExtension=oe,k.install=pe,k.isImageFile=G,k.languageData=me,k.useErrorHandler=Oe,k.useFileUpload=He,k.validateFileCount=re,k.validateFileSize=ae,Object.defineProperties(k,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));