import{S as R,i as B,s as L,M as W,e as w,k as j,a as f,b as q,f as y,l as c,V as _,p as h,J as X,K as Y,L as Z,u as x,v as $,h as A,r as ee,z as te,D as b,B as le,d as ae,F as D,g as ne,n as U}from"./index.3c784113.js";function ie(l){let e,a,n,r,s,u;const o=l[13].default,d=W(o,l,l[12],null);return{c(){e=w("div"),d&&d.c(),a=j(),n=w("input"),f(n,"class","hidden-upload hidden"),f(n,"type","file"),f(n,"accept",l[0]),n.multiple=l[3]==="multiple"||void 0,f(n,"webkitdirectory",l[3]==="directory"||void 0),f(n,"mozdirectory",l[3]==="directory"||void 0),f(e,"class","w-full cursor-pointer h-full flex items-center justify-center text-center text-gray-400 md:text-xl max-h-[15rem] xl:max-h-[18rem] 2xl:max-h-[20rem] min-h-[10rem] md:min-h-[15rem]"),f(e,"theme",l[1])},m(i,g){q(i,e,g),d&&d.m(e,null),y(e,a),y(e,n),l[21](n),r=!0,s||(u=[c(n,"change",l[6]),c(e,"drag",_(h(l[14]))),c(e,"dragstart",_(h(l[15]))),c(e,"dragend",_(h(l[16]))),c(e,"dragover",_(h(l[17]))),c(e,"dragenter",_(h(l[18]))),c(e,"dragleave",_(h(l[19]))),c(e,"drop",_(h(l[20]))),c(e,"click",l[5]),c(e,"drop",l[7]),c(e,"dragenter",l[4]),c(e,"dragleave",l[4])],s=!0)},p(i,[g]){d&&d.p&&(!r||g&4096)&&X(d,o,i,i[12],r?Z(o,i[12],g,null):Y(i[12]),null),(!r||g&1)&&f(n,"accept",i[0]),(!r||g&2)&&f(e,"theme",i[1])},i(i){r||(x(d,i),r=!0)},o(i){$(d,i),r=!1},d(i){i&&A(e),d&&d.d(i),l[21](null),s=!1,ee(u)}}}function re(l,e,a){let{$$slots:n={},$$scope:r}=e,{filetype:s=void 0}=e,{theme:u="default"}=e,{single_file:o=!0}=e,{include_file_metadata:d=!0}=e,{dragging:i=!1}=e,{style:g=""}=e,p,E;const S=te(),T=()=>{a(8,i=!i)},C=()=>{p.click()},v=t=>{let m=Array.from(t);if(!(!t.length||!window.FileReader)){var F=[];m.forEach((k,Q)=>{let z=new FileReader;z.readAsDataURL(k),z.onloadend=function(){F[Q]=d?{name:k.name,size:k.size,data:this.result}:this.result,F.length===t.length&&S("load",o?F[0]:F)}})}},J=t=>{const m=t.target;!m.files||v(m.files)},K=t=>{var m;a(8,i=!1),(m=t.dataTransfer)!=null&&m.files&&v(t.dataTransfer.files)};function M(t){b.call(this,l,t)}function O(t){b.call(this,l,t)}function V(t){b.call(this,l,t)}function G(t){b.call(this,l,t)}function H(t){b.call(this,l,t)}function I(t){b.call(this,l,t)}function N(t){b.call(this,l,t)}function P(t){le[t?"unshift":"push"](()=>{p=t,a(2,p)})}return l.$$set=t=>{"filetype"in t&&a(0,s=t.filetype),"theme"in t&&a(1,u=t.theme),"single_file"in t&&a(9,o=t.single_file),"include_file_metadata"in t&&a(10,d=t.include_file_metadata),"dragging"in t&&a(8,i=t.dragging),"style"in t&&a(11,g=t.style),"$$scope"in t&&a(12,r=t.$$scope)},[s,u,p,E,T,C,J,K,i,o,d,g,r,n,M,O,V,G,H,I,N,P]}class ue extends R{constructor(e){super(),B(this,e,re,ie,L,{filetype:0,theme:1,single_file:9,include_file_metadata:10,dragging:8,style:11})}}function se(l){let e,a,n,r,s;return{c(){e=w("div"),a=w("img"),r=j(),s=ae(l[0]),D(a.src,n=l[1])||f(a,"src",n),f(a,"alt",""),f(a,"class","mr-2 h-[12px] w-[12px] opacity-50"),f(e,"class","absolute left-0 top-0 py-1 px-2 rounded-br-lg shadow-sm text-xs text-gray-500 flex items-center pointer-events-none bg-white z-20 border-b border-r border-gray-100")},m(u,o){q(u,e,o),y(e,a),y(e,r),y(e,s)},p(u,[o]){o&2&&!D(a.src,n=u[1])&&f(a,"src",n),o&1&&ne(s,u[0])},i:U,o:U,d(u){u&&A(e)}}}function de(l,e,a){let{label:n=null}=e,{image:r=void 0}=e;return l.$$set=s=>{"label"in s&&a(0,n=s.label),"image"in s&&a(1,r=s.image)},[n,r]}class oe extends R{constructor(e){super(),B(this,e,de,se,L,{label:0,image:1})}}export{oe as B,ue as U};
