import{S as Ee,i as Fe,s as we,J as Te,e as z,k as Ae,c as N,a as $,m as ke,d as I,b as h,f as Oe,g as ee,I as B,R as p,L as Ce,M as Se,N as Ie,q as Le,o as Pe,G as je,Y as Me,v as Re,Z as ze,t as Ne,h as Be,E as Ge,_ as J}from"./index-54fc4347.js";/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function k(e,t,n,s){function a(i){return i instanceof n?i:new n(function(c){c(i)})}return new(n||(n=Promise))(function(i,c){function u(f){try{o(s.next(f))}catch(l){c(l)}}function m(f){try{o(s.throw(f))}catch(l){c(l)}}function o(f){f.done?i(f.value):a(f.value).then(u,m)}o((s=s.apply(e,t||[])).next())})}function O(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},s,a,i,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(o){return function(f){return m([o,f])}}function m(o){if(s)throw new TypeError("Generator is already executing.");for(;n;)try{if(s=1,a&&(i=o[0]&2?a.return:o[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,o[1])).done)return i;switch(a=0,i&&(o=[o[0]&2,i.value]),o[0]){case 0:case 1:i=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,a=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1]<i[3])){n.label=o[1];break}if(o[0]===6&&n.label<i[1]){n.label=i[1],i=o;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(o);break}i[2]&&n.ops.pop(),n.trys.pop();continue}o=t.call(e,n)}catch(f){o=[6,f],a=0}finally{s=i=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}}function Ke(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var s=n.call(e),a,i=[],c;try{for(;(t===void 0||t-- >0)&&!(a=s.next()).done;)i.push(a.value)}catch(u){c={error:u}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(c)throw c.error}}return i}function We(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Ke(arguments[t]));return e}var Ye=new Map([["avi","video/avi"],["gif","image/gif"],["ico","image/x-icon"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["mkv","video/x-matroska"],["mov","video/quicktime"],["mp4","video/mp4"],["pdf","application/pdf"],["png","image/png"],["zip","application/zip"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"]]);function L(e,t){var n=qe(e);if(typeof n.path!="string"){var s=e.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof t=="string"?t:typeof s=="string"&&s.length>0?s:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function qe(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var s=t.split(".").pop().toLowerCase(),a=Ye.get(s);a&&Object.defineProperty(e,"type",{value:a,writable:!1,configurable:!1,enumerable:!0})}return e}var He=[".DS_Store","Thumbs.db"];function Je(e){return k(this,void 0,void 0,function(){return O(this,function(t){return[2,Ve(e)&&e.dataTransfer?Qe(e.dataTransfer,e.type):Ue(e)]})})}function Ve(e){return!!e.dataTransfer}function Ue(e){var t=Ze(e.target)?e.target.files?G(e.target.files):[]:[];return t.map(function(n){return L(n)})}function Ze(e){return e!==null}function Qe(e,t){return k(this,void 0,void 0,function(){var n,s;return O(this,function(a){switch(a.label){case 0:return e.items?(n=G(e.items).filter(function(i){return i.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(Xe))]):[3,2];case 1:return s=a.sent(),[2,V(te(s))];case 2:return[2,V(G(e.files).map(function(i){return L(i)}))]}})})}function V(e){return e.filter(function(t){return He.indexOf(t.name)===-1})}function G(e){for(var t=[],n=0;n<e.length;n++){var s=e[n];t.push(s)}return t}function Xe(e){if(typeof e.webkitGetAsEntry!="function")return U(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?ne(t):U(e)}function te(e){return e.reduce(function(t,n){return We(t,Array.isArray(n)?te(n):[n])},[])}function U(e){var t=e.getAsFile();if(!t)return Promise.reject(e+" is not a File");var n=L(t);return Promise.resolve(n)}function xe(e){return k(this,void 0,void 0,function(){return O(this,function(t){return[2,e.isDirectory?ne(e):$e(e)]})})}function ne(e){var t=e.createReader();return new Promise(function(n,s){var a=[];function i(){var c=this;t.readEntries(function(u){return k(c,void 0,void 0,function(){var m,o,f;return O(this,function(l){switch(l.label){case 0:if(u.length)return[3,5];l.label=1;case 1:return l.trys.push([1,3,,4]),[4,Promise.all(a)];case 2:return m=l.sent(),n(m),[3,4];case 3:return o=l.sent(),s(o),[3,4];case 4:return[3,6];case 5:f=Promise.all(u.map(xe)),a.push(f),i(),l.label=6;case 6:return[2]}})})},function(u){s(u)})}i()})}function $e(e){return k(this,void 0,void 0,function(){return O(this,function(t){return[2,new Promise(function(n,s){e.file(function(a){var i=L(a,e.fullPath);n(i)},function(a){s(a)})})]})})}function et(e,t){if(e&&t){const n=Array.isArray(t)?t:t.split(","),s=e.name||"",a=(e.type||"").toLowerCase(),i=a.replace(/\/.*$/,"");return n.some(c=>{const u=c.trim().toLowerCase();return u.charAt(0)==="."?s.toLowerCase().endsWith(u):u.endsWith("/*")?i===u.replace(/\/.*$/,""):a===u})}return!0}const tt="file-invalid-type",nt="file-too-large",rt="file-too-small",it="too-many-files",at=e=>{e=Array.isArray(e)&&e.length===1?e[0]:e;const t=Array.isArray(e)?`one of ${e.join(", ")}`:e;return{code:tt,message:`File type must be ${t}`}},Z=e=>({code:nt,message:`File is larger than ${e} bytes`}),Q=e=>({code:rt,message:`File is smaller than ${e} bytes`}),ot={code:it,message:"Too many files"};function st(e,t){const n=e.type==="application/x-moz-file"||et(e,t);return[n,n?null:at(t)]}function lt(e,t,n){if(A(e.size))if(A(t)&&A(n)){if(e.size>n)return[!1,Z(n)];if(e.size<t)return[!1,Q(t)]}else{if(A(t)&&e.size<t)return[!1,Q(t)];if(A(n)&&e.size>n)return[!1,Z(n)]}return[!0,null]}function A(e){return e!=null}function X(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble!="undefined"?e.cancelBubble:!1}function S(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,t=>t==="Files"||t==="application/x-moz-file"):!!e.target&&!!e.target.files}function x(e){e.preventDefault()}function ft(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function ut(e){return e.indexOf("Edge/")!==-1}function ct(e=window.navigator.userAgent){return ft(e)||ut(e)}function dt(e){let t,n;return{c(){t=z("p"),n=Ne("Drag 'n' drop some files here, or click to select files")},l(s){t=N(s,"P",{});var a=$(t);n=Be(a,"Drag 'n' drop some files here, or click to select files"),a.forEach(I)},m(s,a){ee(s,t,a),B(t,n)},p:Ge,d(s){s&&I(t)}}}function gt(e){let t,n,s,a,i,c,u;const m=e[28].default,o=Te(m,e,e[27],null),f=o||dt();return{c(){t=z("div"),n=z("input"),s=Ae(),f&&f.c(),this.h()},l(l){t=N(l,"DIV",{tabindex:!0,class:!0,style:!0});var d=$(t);n=N(d,"INPUT",{accept:!0,type:!0,autocomplete:!0,tabindex:!0,style:!0}),s=ke(d),f&&f.l(d),d.forEach(I),this.h()},h(){h(n,"accept",e[0]),n.multiple=e[1],h(n,"type","file"),h(n,"autocomplete","off"),h(n,"tabindex","-1"),Oe(n,"display","none"),h(t,"tabindex","0"),h(t,"class",a=(e[4]?"":"dropzone")+" "+e[2]+" svelte-4uigcm"),h(t,"style",e[3])},m(l,d){ee(l,t,d),B(t,n),e[29](n),B(t,s),f&&f.m(t,null),e[30](t),i=!0,c||(u=[p(n,"change",e[14]),p(n,"click",mt),p(t,"keydown",e[16](e[7])),p(t,"focus",e[16](e[8])),p(t,"blur",e[16](e[9])),p(t,"click",e[15](e[10])),p(t,"dragenter",e[17](e[11])),p(t,"dragover",e[17](e[12])),p(t,"dragleave",e[17](e[13])),p(t,"drop",e[17](e[14]))],c=!0)},p(l,d){(!i||d[0]&1)&&h(n,"accept",l[0]),(!i||d[0]&2)&&(n.multiple=l[1]),o&&o.p&&(!i||d[0]&134217728)&&Ce(o,m,l,l[27],i?Ie(m,l[27],d,null):Se(l[27]),null),(!i||d[0]&20&&a!==(a=(l[4]?"":"dropzone")+" "+l[2]+" svelte-4uigcm"))&&h(t,"class",a),(!i||d[0]&8)&&h(t,"style",l[3])},i(l){i||(Le(f,l),i=!0)},o(l){Pe(f,l),i=!1},d(l){l&&I(t),e[29](null),f&&f.d(l),e[30](null),c=!1,je(u)}}}function mt(e){e.stopPropagation()}function yt(e,t,n){let{$$slots:s={},$$scope:a}=t,{accept:i}=t,{disabled:c=!1}=t,{getFilesFromEvent:u=Je}=t,{maxSize:m=1/0}=t,{minSize:o=0}=t,{multiple:f=!0}=t,{preventDropOnDocument:l=!0}=t,{noClick:d=!1}=t,{noKeyboard:P=!1}=t,{noDrag:j=!1}=t,{noDragEventsBubbling:T=!1}=t,{containerClasses:K=""}=t,{containerStyles:W=""}=t,{disableDefaultStyles:Y=!1}=t;const E=Me();let g={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,draggedFiles:[],acceptedFiles:[],fileRejections:[]},b,v;function re(){g.isFileDialogActive=!1,g.isDragActive=!1,g.draggedFiles=[],g.acceptedFiles=[],g.fileRejections=[]}function M(){v&&(n(6,v.value=null,v),g.isFileDialogActive=!0,v.click())}function ie(r){!b||!b.isEqualNode(r.target)||(r.keyCode===32||r.keyCode===13)&&(r.preventDefault(),M())}function ae(){g.isFocused=!0}function oe(){g.isFocused=!1}function se(){d||(ct()?setTimeout(M,0):M())}function le(r){r.preventDefault(),C(r),F=[...F,r.target],S(r)&&Promise.resolve(u(r)).then(D=>{X(r)&&!T||(g.draggedFiles=D,g.isDragActive=!0,E("dragenter",{dragEvent:r}))})}function fe(r){if(r.preventDefault(),C(r),r.dataTransfer)try{r.dataTransfer.dropEffect="copy"}catch{}return S(r)&&E("dragover",{dragEvent:r}),!1}function ue(r){r.preventDefault(),C(r);const D=F.filter(_=>b&&b.contains(_)),y=D.indexOf(r.target);y!==-1&&D.splice(y,1),F=D,!(D.length>0)&&(g.isDragActive=!1,g.draggedFiles=[],S(r)&&E("dragleave",{dragEvent:r}))}function ce(r){r.preventDefault(),C(r),F=[],S(r)&&Promise.resolve(u(r)).then(D=>{if(X(r)&&!T)return;const y=[],_=[];D.forEach(w=>{const[he,pe]=st(w,i),[be,ve]=lt(w,o,m);if(he&&be)y.push(w);else{const De=[pe,ve].filter(_e=>_e);_.push({file:w,errors:De})}}),!f&&y.length>1&&(y.forEach(w=>{_.push({file:w,errors:[ot]})}),y.splice(0)),g.acceptedFiles=y,g.fileRejections=_,E("drop",{acceptedFiles:y,fileRejections:_,event:r}),_.length>0&&E("droprejected",{fileRejections:_,event:r}),y.length>0&&E("dropaccepted",{acceptedFiles:y,event:r})}),re()}function R(r){return c?null:r}function de(r){return P?null:R(r)}function ge(r){return j?null:R(r)}function C(r){T&&r.stopPropagation()}let F=[];function q(r){b&&b.contains(r.target)||(r.preventDefault(),F=[])}function H(){g.isFileDialogActive&&setTimeout(()=>{if(v){const{files:r}=v;r.length||(g.isFileDialogActive=!1,E("filedialogcancel"))}},300)}Re(()=>{window.addEventListener("focus",H,!1),l&&(document.addEventListener("dragover",x,!1),document.addEventListener("drop",q,!1))}),ze(()=>{window.removeEventListener("focus",H,!1),l&&(document.removeEventListener("dragover",x),document.removeEventListener("drop",q))});function me(r){J[r?"unshift":"push"](()=>{v=r,n(6,v)})}function ye(r){J[r?"unshift":"push"](()=>{b=r,n(5,b)})}return e.$$set=r=>{"accept"in r&&n(0,i=r.accept),"disabled"in r&&n(18,c=r.disabled),"getFilesFromEvent"in r&&n(19,u=r.getFilesFromEvent),"maxSize"in r&&n(20,m=r.maxSize),"minSize"in r&&n(21,o=r.minSize),"multiple"in r&&n(1,f=r.multiple),"preventDropOnDocument"in r&&n(22,l=r.preventDropOnDocument),"noClick"in r&&n(23,d=r.noClick),"noKeyboard"in r&&n(24,P=r.noKeyboard),"noDrag"in r&&n(25,j=r.noDrag),"noDragEventsBubbling"in r&&n(26,T=r.noDragEventsBubbling),"containerClasses"in r&&n(2,K=r.containerClasses),"containerStyles"in r&&n(3,W=r.containerStyles),"disableDefaultStyles"in r&&n(4,Y=r.disableDefaultStyles),"$$scope"in r&&n(27,a=r.$$scope)},[i,f,K,W,Y,b,v,ie,ae,oe,se,le,fe,ue,ce,R,de,ge,c,u,m,o,l,d,P,j,T,a,s,me,ye]}class pt extends Ee{constructor(t){super(),Fe(this,t,yt,gt,we,{accept:0,disabled:18,getFilesFromEvent:19,maxSize:20,minSize:21,multiple:1,preventDropOnDocument:22,noClick:23,noKeyboard:24,noDrag:25,noDragEventsBubbling:26,containerClasses:2,containerStyles:3,disableDefaultStyles:4},null,[-1,-1])}}export{pt as D};
