dealpos 1.0.0
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.
- package/POS/3rdpartylicenses.txt +1645 -0
- package/POS/assets/icons/icon-128x128.png +0 -0
- package/POS/assets/icons/icon-144x144.png +0 -0
- package/POS/assets/icons/icon-152x152.png +0 -0
- package/POS/assets/icons/icon-192x192.png +0 -0
- package/POS/assets/icons/icon-384x384.png +0 -0
- package/POS/assets/icons/icon-512x512.png +0 -0
- package/POS/assets/icons/icon-72x72.png +0 -0
- package/POS/assets/icons/icon-96x96.png +0 -0
- package/POS/chunk-26YXEYJK.js +1 -0
- package/POS/chunk-2DNKBN6G.js +1 -0
- package/POS/chunk-2FKYC63K.js +1 -0
- package/POS/chunk-2FWFPV5I.js +1 -0
- package/POS/chunk-2OSKJOSS.js +1 -0
- package/POS/chunk-2OXMYDYT.js +1 -0
- package/POS/chunk-2OZMF5DL.js +1 -0
- package/POS/chunk-2W3MAOOP.js +1 -0
- package/POS/chunk-33XCA4ER.js +14 -0
- package/POS/chunk-35V3VL6F.js +1 -0
- package/POS/chunk-3A7KA4YN.js +1 -0
- package/POS/chunk-3BODNSIH.js +1 -0
- package/POS/chunk-3FOIEYAT.js +4 -0
- package/POS/chunk-3PFXZUB6.js +7 -0
- package/POS/chunk-3QABPVXZ.js +3 -0
- package/POS/chunk-4BDQDYVB.js +1 -0
- package/POS/chunk-4CBDK52E.js +4 -0
- package/POS/chunk-4G26RHGA.js +1 -0
- package/POS/chunk-4MX7Q77M.js +2 -0
- package/POS/chunk-4UAHOTBD.js +1 -0
- package/POS/chunk-56EQRIAH.js +1 -0
- package/POS/chunk-5KBFQLSN.js +1 -0
- package/POS/chunk-5W7F4VJH.js +1 -0
- package/POS/chunk-64PDX5ZX.js +1 -0
- package/POS/chunk-65YDOCXF.js +1 -0
- package/POS/chunk-67VBXFVT.js +6 -0
- package/POS/chunk-6BQZINLH.js +1 -0
- package/POS/chunk-6L6CIH5M.js +1 -0
- package/POS/chunk-6PXJEE4K.js +1 -0
- package/POS/chunk-6S4Q5VRA.js +1 -0
- package/POS/chunk-75STMWUR.js +6 -0
- package/POS/chunk-76C33PK5.js +1 -0
- package/POS/chunk-77D6X2SQ.js +11 -0
- package/POS/chunk-7DWKYGA4.js +1 -0
- package/POS/chunk-7M6CWVRI.js +1 -0
- package/POS/chunk-7Q3437BR.js +1 -0
- package/POS/chunk-AA32I4UN.js +1 -0
- package/POS/chunk-AJMKP7YZ.js +1 -0
- package/POS/chunk-AOJW6WJT.js +1 -0
- package/POS/chunk-AOPKPEVH.js +1 -0
- package/POS/chunk-APJK7OH2.js +2 -0
- package/POS/chunk-APYNCJ2H.js +1 -0
- package/POS/chunk-AUYYX2UQ.js +45 -0
- package/POS/chunk-AVDGNFC7.js +1 -0
- package/POS/chunk-AWGZKLLY.js +1 -0
- package/POS/chunk-AYKDALBT.js +1 -0
- package/POS/chunk-B2OT7HA4.js +4 -0
- package/POS/chunk-B36XIZVJ.js +1 -0
- package/POS/chunk-B5FODXLM.js +1 -0
- package/POS/chunk-B7RM5KKA.js +1 -0
- package/POS/chunk-BCVO66L3.js +5 -0
- package/POS/chunk-BETKNHFK.js +1 -0
- package/POS/chunk-BH2ZVZIU.js +1 -0
- package/POS/chunk-BHXS5IA6.js +1 -0
- package/POS/chunk-BLZEDUEI.js +1 -0
- package/POS/chunk-BYXBJQAS.js +0 -0
- package/POS/chunk-BZC5JINN.js +5 -0
- package/POS/chunk-C43IYFVU.js +1 -0
- package/POS/chunk-CBW7IA6S.js +1 -0
- package/POS/chunk-CCGPOEE3.js +4 -0
- package/POS/chunk-CFIFFKWA.js +1 -0
- package/POS/chunk-CI45CZMG.js +1 -0
- package/POS/chunk-CJO25BBP.js +1 -0
- package/POS/chunk-CLL3TEL5.js +1 -0
- package/POS/chunk-CPUGWH3I.js +1 -0
- package/POS/chunk-CPW6IWAB.js +1 -0
- package/POS/chunk-CRSUSQ3W.js +1 -0
- package/POS/chunk-CW27R4N3.js +2 -0
- package/POS/chunk-CWU5DTSS.js +1 -0
- package/POS/chunk-CY2FQLP4.js +1 -0
- package/POS/chunk-DRGWLGRP.js +1 -0
- package/POS/chunk-DXF4M3Z6.js +1 -0
- package/POS/chunk-E72IOARD.js +1 -0
- package/POS/chunk-EA7CLJMQ.js +18 -0
- package/POS/chunk-ECMSF3OR.js +1 -0
- package/POS/chunk-EOFWQEK7.js +1 -0
- package/POS/chunk-EQOB7536.js +156 -0
- package/POS/chunk-ESD5O3BQ.js +1 -0
- package/POS/chunk-EZCHVNC5.js +3 -0
- package/POS/chunk-F3ZYFWTM.js +1 -0
- package/POS/chunk-F6GAPEFT.js +1 -0
- package/POS/chunk-FBR7TAEJ.js +5 -0
- package/POS/chunk-FE5LZK5I.js +1 -0
- package/POS/chunk-FOEYBSQT.js +2 -0
- package/POS/chunk-FWVI7M5F.js +1 -0
- package/POS/chunk-G4DDQBH4.js +1 -0
- package/POS/chunk-GDFWXFK2.js +1 -0
- package/POS/chunk-GHQFOULJ.js +2 -0
- package/POS/chunk-GNSQPTDB.js +1 -0
- package/POS/chunk-GSLPZSSX.js +1 -0
- package/POS/chunk-GVXSG66Q.js +1 -0
- package/POS/chunk-H55AJAX5.js +8 -0
- package/POS/chunk-HIRUHGYD.js +2 -0
- package/POS/chunk-HKR2C3HA.js +1 -0
- package/POS/chunk-HSOC6U4B.js +1 -0
- package/POS/chunk-I6CGSFEU.js +1 -0
- package/POS/chunk-I6YPWC52.js +1 -0
- package/POS/chunk-IDDHFZWG.js +1 -0
- package/POS/chunk-IE5R6YWY.js +1 -0
- package/POS/chunk-IOQ3OION.js +1 -0
- package/POS/chunk-IUKSWU5B.js +1 -0
- package/POS/chunk-IY6EDHBT.js +1 -0
- package/POS/chunk-IZGPRDGN.js +2 -0
- package/POS/chunk-J3W6DQKW.js +1 -0
- package/POS/chunk-JLWKTGB2.js +1 -0
- package/POS/chunk-JM3SJLS7.js +1 -0
- package/POS/chunk-JNUC6PO5.js +1 -0
- package/POS/chunk-K5XVN3MT.js +1 -0
- package/POS/chunk-KBQ5ZM55.js +1 -0
- package/POS/chunk-KCNSCS4R.js +1 -0
- package/POS/chunk-KI2MQKDF.js +1 -0
- package/POS/chunk-KNRLGMUT.js +1 -0
- package/POS/chunk-KR4OPCRF.js +1 -0
- package/POS/chunk-KW4B7WMB.js +1 -0
- package/POS/chunk-KYX6U2UX.js +1 -0
- package/POS/chunk-KZNSGBGF.js +2 -0
- package/POS/chunk-L3UWNQXB.js +1 -0
- package/POS/chunk-LHWN2J4H.js +15 -0
- package/POS/chunk-LJUP6CCS.js +1 -0
- package/POS/chunk-LY4FOMQ6.css +1 -0
- package/POS/chunk-LZ3SKBTU.js +1 -0
- package/POS/chunk-M5ONTRWK.js +1 -0
- package/POS/chunk-MA7NEQCZ.js +1 -0
- package/POS/chunk-MDKYCLYA.js +17 -0
- package/POS/chunk-MGDA6GY6.js +1 -0
- package/POS/chunk-MWWGZRMN.js +1 -0
- package/POS/chunk-NCATMO6T.js +1 -0
- package/POS/chunk-NDAI7L23.js +1 -0
- package/POS/chunk-NHUK6IK5.js +40 -0
- package/POS/chunk-NUZ5K7GT.js +1 -0
- package/POS/chunk-O2PELRQA.js +1 -0
- package/POS/chunk-OUOP65JB.js +1 -0
- package/POS/chunk-OXSD6KML.js +1 -0
- package/POS/chunk-PEOMRJUI.js +3 -0
- package/POS/chunk-PHGK3EAU.js +1 -0
- package/POS/chunk-PLC4GZ67.js +1 -0
- package/POS/chunk-PTF6AQY6.js +1 -0
- package/POS/chunk-PTXKBWBA.js +1 -0
- package/POS/chunk-Q3SJOSAG.js +1 -0
- package/POS/chunk-QBDEGNJP.js +1 -0
- package/POS/chunk-QCTMAR3L.js +1 -0
- package/POS/chunk-QZWOQRAM.js +1 -0
- package/POS/chunk-R5VG3XDC.js +1 -0
- package/POS/chunk-R7NR3M2Q.js +1 -0
- package/POS/chunk-RBKYZOZX.js +3 -0
- package/POS/chunk-RHQGCHFI.js +1 -0
- package/POS/chunk-RL3GYZVU.js +8 -0
- package/POS/chunk-RRKCUSBB.js +1 -0
- package/POS/chunk-S4OLP2TR.js +18 -0
- package/POS/chunk-SDH32O74.js +1 -0
- package/POS/chunk-SE7OFLAL.js +1 -0
- package/POS/chunk-SEVYM4GA.js +1 -0
- package/POS/chunk-SGRJ5YG2.js +1 -0
- package/POS/chunk-SNNLFZQ3.js +3 -0
- package/POS/chunk-SVNOJVQF.js +1 -0
- package/POS/chunk-TCLYGBIP.js +1 -0
- package/POS/chunk-TIDDF777.js +1 -0
- package/POS/chunk-TJQIORGG.js +1 -0
- package/POS/chunk-TK5H65DN.js +1 -0
- package/POS/chunk-TLHNFDPP.js +1 -0
- package/POS/chunk-TVNDX4KA.js +3 -0
- package/POS/chunk-TX6G2LAN.js +1 -0
- package/POS/chunk-U3O6FO5X.js +1 -0
- package/POS/chunk-UJMXJABS.js +1 -0
- package/POS/chunk-UNGT7KQO.js +1 -0
- package/POS/chunk-UPRH3DLS.js +1 -0
- package/POS/chunk-UVFDCVT4.js +2 -0
- package/POS/chunk-V22EVF6N.js +1 -0
- package/POS/chunk-V4RKZMUB.js +11 -0
- package/POS/chunk-VBOV2ZGQ.js +1 -0
- package/POS/chunk-VGGNSOCP.js +1 -0
- package/POS/chunk-VLGOEX3D.js +24 -0
- package/POS/chunk-VPAQFQA7.js +1 -0
- package/POS/chunk-VSMYP4AC.js +1 -0
- package/POS/chunk-VXCP4DBC.js +1 -0
- package/POS/chunk-W43P2XHR.js +1 -0
- package/POS/chunk-W7PIRMKD.js +1 -0
- package/POS/chunk-WG6PV6VL.js +4 -0
- package/POS/chunk-WK4T26FX.js +2 -0
- package/POS/chunk-WKS7JIOA.js +1 -0
- package/POS/chunk-WKXE4B24.js +1 -0
- package/POS/chunk-WLRXTHLM.js +1 -0
- package/POS/chunk-WSZGVB3P.js +1 -0
- package/POS/chunk-WXHOQKTU.js +1 -0
- package/POS/chunk-X55EKFUZ.js +1 -0
- package/POS/chunk-X7QMXCEW.js +4 -0
- package/POS/chunk-XIGLLWLV.js +1 -0
- package/POS/chunk-XRKZOON6.js +4 -0
- package/POS/chunk-XW2QKXZF.js +5 -0
- package/POS/chunk-XZPCPUT7.js +1 -0
- package/POS/chunk-Y5SPDICN.js +2 -0
- package/POS/chunk-Y7XBMFXR.js +1 -0
- package/POS/chunk-YATUCULL.js +1 -0
- package/POS/chunk-YBFOOZH4.js +2 -0
- package/POS/chunk-YBINYTS7.js +1 -0
- package/POS/chunk-YE2HNBMX.js +1 -0
- package/POS/chunk-YENHZRM5.js +9 -0
- package/POS/chunk-YHCFOJEX.js +1 -0
- package/POS/chunk-YKBQYDEJ.js +2 -0
- package/POS/chunk-YPFXYXHP.js +8 -0
- package/POS/chunk-YRHYSRBM.js +1 -0
- package/POS/chunk-YRITVFOW.js +1 -0
- package/POS/chunk-YRNTUREW.js +1 -0
- package/POS/chunk-YXRRTX7W.js +1 -0
- package/POS/chunk-Z426RGUL.js +24 -0
- package/POS/chunk-ZB45Y55B.js +1 -0
- package/POS/chunk-ZGRVB4IB.js +1 -0
- package/POS/chunk-ZJ3TX62Q.js +1 -0
- package/POS/chunk-ZKWXTWYY.js +1 -0
- package/POS/index.html +33 -0
- package/POS/main-CNMNNNEI.js +4 -0
- package/POS/main-VPAR6OBK.css +1 -0
- package/POS/manifest.webmanifest +59 -0
- package/POS/media/color-727V6BA6.png +0 -0
- package/POS/media/hue-3YTJE6JS.png +0 -0
- package/POS/media/primeicons-4GST5W3O.woff2 +0 -0
- package/POS/media/primeicons-DHQU4SEP.svg +345 -0
- package/POS/media/primeicons-GEFHGEHP.ttf +0 -0
- package/POS/media/primeicons-P53SE5CV.woff +0 -0
- package/POS/media/primeicons-RSSEDYLY.eot +0 -0
- package/POS/polyfills-FHOOFFEX.js +2 -0
- package/POS/scripts-3E2G6IZ4.js +10 -0
- package/POS/styles-T7FPZRNG.css +25 -0
- package/Styles/Master/app_custom.css +18 -0
- package/Styles/Master/login_custom.css +0 -0
- package/Styles/Print/PaperSize8cm_custom.css +1 -0
- package/Styles/Print/PaperSizeA4_custom.css +1 -0
- package/StylesB/Master/app_custom.css +0 -0
- package/package.json +1 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import{$b as zo,Ab as or,Bb as Ai,Cb as tn,Db as rn,Ea as tr,Ha as Ao,I as Va,Ia as Xa,Jc as Uo,Kb as _r,Nd as pn,Qa as Ya,Sc as an,Sd as dn,Ua as ut,Va as Ja,Zb as sr,_b as on,bb as Ei,c as rt,cd as nn,d as $a,eb as Qa,gb as Oo,gc as sn,gd as ot,ha as Ci,ia as Wa,ka as Bi,kd as ln,la as Eo,mb as rr,ob as Za,p as qa,pa as Ti,qa as Ga,s as it,ub as en,va as Ka,zb as ir}from"./chunk-H55AJAX5.js";import{a as m,b as O,d as ki,e as me,g as ue,j as _,k as er,l as _i,m as Ii,n as Di}from"./chunk-KW4B7WMB.js";var gn=me((jf,mn)=>{mn.exports=function(){var e={},t=e._fns={};e.emit=function(a,n,l,d,h,u,g){var y=i(a);y.length&&o(a,y,[n,l,d,h,u,g])},e.on=function(a,n){t[a]||(t[a]=[]),t[a].push(n)},e.once=function(a,n){function l(){n.apply(this,arguments),e.off(a,l)}this.on(a,l)},e.off=function(a,n){var l=[];if(a&&n){var d=this._fns[a],h=0,u=d?d.length:0;for(h;h<u;h++)d[h]!==n&&l.push(d[h])}l.length?this._fns[a]=l:delete this._fns[a]};function i(s){var a=t[s]?t[s]:[],n=s.indexOf(":"),l=n===-1?[s]:[s.substring(0,n),s.substring(n+1)],d=Object.keys(t),h=0,u=d.length;for(h;h<u;h++){var g=d[h];if(g==="*"&&(a=a.concat(t[g])),l.length===2&&l[0]===g){a=a.concat(t[g]);break}}return a}function o(s,a,n){var l=0,d=a.length;for(l;l<d&&a[l];l++)a[l].event=s,a[l].apply(a[l],n)}return e}});var zi=me(($f,yn)=>{function Ed(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}yn.exports=Ed});var vn=me((qf,bn)=>{var Ad=typeof global=="object"&&global&&global.Object===Object&&global;bn.exports=Ad});var Ro=me((Vf,wn)=>{var Od=vn(),zd=typeof self=="object"&&self&&self.Object===Object&&self,Ud=Od||zd||Function("return this")();wn.exports=Ud});var Pn=me((Wf,xn)=>{var Md=Ro(),Rd=function(){return Md.Date.now()};xn.exports=Rd});var Fn=me((Gf,Sn)=>{var Nd=/\s/;function Ld(r){for(var e=r.length;e--&&Nd.test(r.charAt(e)););return e}Sn.exports=Ld});var _n=me((Kf,kn)=>{var jd=Fn(),Hd=/^\s+/;function $d(r){return r&&r.slice(0,jd(r)+1).replace(Hd,"")}kn.exports=$d});var No=me((Xf,In)=>{var qd=Ro(),Vd=qd.Symbol;In.exports=Vd});var Tn=me((Yf,Bn)=>{var Dn=No(),Cn=Object.prototype,Wd=Cn.hasOwnProperty,Gd=Cn.toString,Cr=Dn?Dn.toStringTag:void 0;function Kd(r){var e=Wd.call(r,Cr),t=r[Cr];try{r[Cr]=void 0;var i=!0}catch{}var o=Gd.call(r);return i&&(e?r[Cr]=t:delete r[Cr]),o}Bn.exports=Kd});var An=me((Jf,En)=>{var Xd=Object.prototype,Yd=Xd.toString;function Jd(r){return Yd.call(r)}En.exports=Jd});var Mn=me((Qf,Un)=>{var On=No(),Qd=Tn(),Zd=An(),eu="[object Null]",tu="[object Undefined]",zn=On?On.toStringTag:void 0;function ru(r){return r==null?r===void 0?tu:eu:zn&&zn in Object(r)?Qd(r):Zd(r)}Un.exports=ru});var Nn=me((Zf,Rn)=>{function iu(r){return r!=null&&typeof r=="object"}Rn.exports=iu});var jn=me((em,Ln)=>{var ou=Mn(),su=Nn(),au="[object Symbol]";function nu(r){return typeof r=="symbol"||su(r)&&ou(r)==au}Ln.exports=nu});var Vn=me((tm,qn)=>{var lu=_n(),Hn=zi(),pu=jn(),$n=NaN,du=/^[-+]0x[0-9a-f]+$/i,uu=/^0b[01]+$/i,hu=/^0o[0-7]+$/i,cu=parseInt;function fu(r){if(typeof r=="number")return r;if(pu(r))return $n;if(Hn(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=Hn(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=lu(r);var t=uu.test(r);return t||hu.test(r)?cu(r.slice(2),t?2:8):du.test(r)?$n:+r}qn.exports=fu});var jo=me((rm,Gn)=>{var mu=zi(),Lo=Pn(),Wn=Vn(),gu="Expected a function",yu=Math.max,bu=Math.min;function vu(r,e,t){var i,o,s,a,n,l,d=0,h=!1,u=!1,g=!0;if(typeof r!="function")throw new TypeError(gu);e=Wn(e)||0,mu(t)&&(h=!!t.leading,u="maxWait"in t,s=u?yu(Wn(t.maxWait)||0,e):s,g="trailing"in t?!!t.trailing:g);function y(c){var f=i,v=o;return i=o=void 0,d=c,a=r.apply(v,f),a}function w(c){return d=c,n=setTimeout(L,e),h?y(c):a}function B(c){var f=c-l,v=c-d,k=e-f;return u?bu(k,s-v):k}function $(c){var f=c-l,v=c-d;return l===void 0||f>=e||f<0||u&&v>=s}function L(){var c=Lo();if($(c))return j(c);n=setTimeout(L,B(c))}function j(c){return n=void 0,g&&i?y(c):(i=o=void 0,a)}function Z(){n!==void 0&&clearTimeout(n),d=0,i=l=o=n=void 0}function G(){return n===void 0?a:j(Lo())}function V(){var c=Lo(),f=$(c);if(i=arguments,o=this,l=c,f){if(n===void 0)return w(l);if(u)return clearTimeout(n),n=setTimeout(L,e),y(l)}return n===void 0&&(n=setTimeout(L,e)),a}return V.cancel=Z,V.flush=G,V}Gn.exports=vu});var Xn=me((im,Kn)=>{var wu=jo(),xu=zi(),Pu="Expected a function";function Su(r,e,t){var i=!0,o=!0;if(typeof r!="function")throw new TypeError(Pu);return xu(t)&&(i="leading"in t?!!t.leading:i,o="trailing"in t?!!t.trailing:o),wu(r,e,{leading:i,maxWait:e,trailing:o})}Kn.exports=Su});var Tr=me((vm,rl)=>{"use strict";rl.exports=function(e){if(typeof e!="number"||Number.isNaN(e))throw new TypeError(`Expected a number, got ${typeof e}`);let t=e<0,i=Math.abs(e);if(t&&(i=-i),i===0)return"0 B";let o=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],s=Math.min(Math.floor(Math.log(i)/Math.log(1024)),o.length-1),a=Number(i/1024**s),n=o[s];return`${a>=10||a%1===0?Math.round(a):a.toFixed(1)} ${n}`}});var sl=me((wm,ol)=>{"use strict";function il(r,e){this.text=r=r||"",this.hasWild=~r.indexOf("*"),this.separator=e,this.parts=r.split(e)}il.prototype.match=function(r){var e=!0,t=this.parts,i,o=t.length,s;if(typeof r=="string"||r instanceof String)if(!this.hasWild&&this.text!=r)e=!1;else{for(s=(r||"").split(this.separator),i=0;e&&i<o;i++)t[i]!=="*"&&(i<s.length?e=t[i]===s[i]:e=!1);e=e&&s}else if(typeof r.splice=="function")for(e=[],i=r.length;i--;)this.match(r[i])&&(e[e.length]=r[i]);else if(typeof r=="object"){e={};for(var a in r)this.match(a)&&(e[a]=r[a])}return e};ol.exports=function(r,e,t){var i=new il(r,t||/[\/\.]/);return typeof e<"u"?i.match(e):i}});var nl=me((xm,al)=>{var Cu=sl(),Bu=/[\/\+\.]/;al.exports=function(r,e){function t(i){var o=Cu(i,r,Bu);return o&&o.length>=2}return e?t(e.split(";")[0]):t}});var Te=me((rg,Ki)=>{(function(){"use strict";var r={}.hasOwnProperty;function e(){for(var o="",s=0;s<arguments.length;s++){var a=arguments[s];a&&(o=i(o,t(a)))}return o}function t(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return e.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var s="";for(var a in o)r.call(o,a)&&o[a]&&(s=i(s,a));return s}function i(o,s){return s?o?o+" "+s:o+s:o}typeof Ki<"u"&&Ki.exports?(e.default=e,Ki.exports=e):typeof define=="function"&&typeof define.amd=="object"&&define.amd?define("classnames",[],function(){return e}):window.classNames=e})()});var Dp=me((n0,Ws)=>{"use strict";var sc=Object.prototype.hasOwnProperty,Ae="~";function li(){}Object.create&&(li.prototype=Object.create(null),new li().__proto__||(Ae=!1));function ac(r,e,t){this.fn=r,this.context=e,this.once=t||!1}function Ip(r,e,t,i,o){if(typeof t!="function")throw new TypeError("The listener must be a function");var s=new ac(t,i||r,o),a=Ae?Ae+e:e;return r._events[a]?r._events[a].fn?r._events[a]=[r._events[a],s]:r._events[a].push(s):(r._events[a]=s,r._eventsCount++),r}function fo(r,e){--r._eventsCount===0?r._events=new li:delete r._events[e]}function De(){this._events=new li,this._eventsCount=0}De.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)sc.call(t,i)&&e.push(Ae?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};De.prototype.listeners=function(e){var t=Ae?Ae+e:e,i=this._events[t];if(!i)return[];if(i.fn)return[i.fn];for(var o=0,s=i.length,a=new Array(s);o<s;o++)a[o]=i[o].fn;return a};De.prototype.listenerCount=function(e){var t=Ae?Ae+e:e,i=this._events[t];return i?i.fn?1:i.length:0};De.prototype.emit=function(e,t,i,o,s,a){var n=Ae?Ae+e:e;if(!this._events[n])return!1;var l=this._events[n],d=arguments.length,h,u;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),d){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,i),!0;case 4:return l.fn.call(l.context,t,i,o),!0;case 5:return l.fn.call(l.context,t,i,o,s),!0;case 6:return l.fn.call(l.context,t,i,o,s,a),!0}for(u=1,h=new Array(d-1);u<d;u++)h[u-1]=arguments[u];l.fn.apply(l.context,h)}else{var g=l.length,y;for(u=0;u<g;u++)switch(l[u].once&&this.removeListener(e,l[u].fn,void 0,!0),d){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,t);break;case 3:l[u].fn.call(l[u].context,t,i);break;case 4:l[u].fn.call(l[u].context,t,i,o);break;default:if(!h)for(y=1,h=new Array(d-1);y<d;y++)h[y-1]=arguments[y];l[u].fn.apply(l[u].context,h)}}return!0};De.prototype.on=function(e,t,i){return Ip(this,e,t,i,!1)};De.prototype.once=function(e,t,i){return Ip(this,e,t,i,!0)};De.prototype.removeListener=function(e,t,i,o){var s=Ae?Ae+e:e;if(!this._events[s])return this;if(!t)return fo(this,s),this;var a=this._events[s];if(a.fn)a.fn===t&&(!o||a.once)&&(!i||a.context===i)&&fo(this,s);else{for(var n=0,l=[],d=a.length;n<d;n++)(a[n].fn!==t||o&&!a[n].once||i&&a[n].context!==i)&&l.push(a[n]);l.length?this._events[s]=l.length===1?l[0]:l:fo(this,s)}return this};De.prototype.removeAllListeners=function(e){var t;return e?(t=Ae?Ae+e:e,this._events[t]&&fo(this,t)):(this._events=new li,this._eventsCount=0),this};De.prototype.off=De.prototype.removeListener;De.prototype.addListener=De.prototype.on;De.prefixed=Ae;De.EventEmitter=De;typeof Ws<"u"&&(Ws.exports=De)});var yd=me((Ia,Da)=>{(function(r,e){typeof Ia=="object"&&typeof Da<"u"?Da.exports=e():typeof define=="function"&&define.amd?define(e):(r=typeof globalThis<"u"?globalThis:r||self,r.Compressor=e())})(Ia,function(){"use strict";function r(F,b){var x=Object.keys(F);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(F);b&&(P=P.filter(function(D){return Object.getOwnPropertyDescriptor(F,D).enumerable})),x.push.apply(x,P)}return x}function e(F){for(var b=1;b<arguments.length;b++){var x=arguments[b]!=null?arguments[b]:{};b%2?r(Object(x),!0).forEach(function(P){s(F,P,x[P])}):Object.getOwnPropertyDescriptors?Object.defineProperties(F,Object.getOwnPropertyDescriptors(x)):r(Object(x)).forEach(function(P){Object.defineProperty(F,P,Object.getOwnPropertyDescriptor(x,P))})}return F}function t(F,b){if(!(F instanceof b))throw new TypeError("Cannot call a class as a function")}function i(F,b){for(var x=0;x<b.length;x++){var P=b[x];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(F,l(P.key),P)}}function o(F,b,x){return b&&i(F.prototype,b),x&&i(F,x),Object.defineProperty(F,"prototype",{writable:!1}),F}function s(F,b,x){return b=l(b),b in F?Object.defineProperty(F,b,{value:x,enumerable:!0,configurable:!0,writable:!0}):F[b]=x,F}function a(){return a=Object.assign?Object.assign.bind():function(F){for(var b=1;b<arguments.length;b++){var x=arguments[b];for(var P in x)Object.prototype.hasOwnProperty.call(x,P)&&(F[P]=x[P])}return F},a.apply(this,arguments)}function n(F,b){if(typeof F!="object"||F===null)return F;var x=F[Symbol.toPrimitive];if(x!==void 0){var P=x.call(F,b||"default");if(typeof P!="object")return P;throw new TypeError("@@toPrimitive must return a primitive value.")}return(b==="string"?String:Number)(F)}function l(F){var b=n(F,"string");return typeof b=="symbol"?b:String(b)}var d={exports:{}};(function(F){typeof window>"u"||function(b){var x=b.HTMLCanvasElement&&b.HTMLCanvasElement.prototype,P=b.Blob&&function(){try{return!!new Blob}catch{return!1}}(),D=P&&b.Uint8Array&&function(){try{return new Blob([new Uint8Array(100)]).size===100}catch{return!1}}(),S=b.BlobBuilder||b.WebKitBlobBuilder||b.MozBlobBuilder||b.MSBlobBuilder,H=/^data:((.*?)(;charset=.*?)?)(;base64)?,/,U=(P||S)&&b.atob&&b.ArrayBuffer&&b.Uint8Array&&function(M){var A,X,K,Y,ee,R,ce,ae,Pe;if(A=M.match(H),!A)throw new Error("invalid data URI");for(X=A[2]?A[1]:"text/plain"+(A[3]||";charset=US-ASCII"),K=!!A[4],Y=M.slice(A[0].length),K?ee=atob(Y):ee=decodeURIComponent(Y),R=new ArrayBuffer(ee.length),ce=new Uint8Array(R),ae=0;ae<ee.length;ae+=1)ce[ae]=ee.charCodeAt(ae);return P?new Blob([D?ce:R],{type:X}):(Pe=new S,Pe.append(R),Pe.getBlob(X))};b.HTMLCanvasElement&&!x.toBlob&&(x.mozGetAsFile?x.toBlob=function(M,A,X){var K=this;setTimeout(function(){X&&x.toDataURL&&U?M(U(K.toDataURL(A,X))):M(K.mozGetAsFile("blob",A))})}:x.toDataURL&&U&&(x.msToBlob?x.toBlob=function(M,A,X){var K=this;setTimeout(function(){(A&&A!=="image/png"||X)&&x.toDataURL&&U?M(U(K.toDataURL(A,X))):M(K.msToBlob(A))})}:x.toBlob=function(M,A,X){var K=this;setTimeout(function(){M(U(K.toDataURL(A,X)))})})),F.exports?F.exports=U:b.dataURLtoBlob=U}(window)})(d);var h=d.exports,u=function(b){return typeof Blob>"u"?!1:b instanceof Blob||Object.prototype.toString.call(b)==="[object Blob]"},g={strict:!0,checkOrientation:!0,retainExif:!1,maxWidth:1/0,maxHeight:1/0,minWidth:0,minHeight:0,width:void 0,height:void 0,resize:"none",quality:.8,mimeType:"auto",convertTypes:["image/png"],convertSize:5e6,beforeDraw:null,drew:null,success:null,error:null},y=typeof window<"u"&&typeof window.document<"u",w=y?window:{},B=function(b){return b>0&&b<1/0},$=Array.prototype.slice;function L(F){return Array.from?Array.from(F):$.call(F)}var j=/^image\/.+$/;function Z(F){return j.test(F)}function G(F){var b=Z(F)?F.substr(6):"";return b==="jpeg"&&(b="jpg"),".".concat(b)}var V=String.fromCharCode;function c(F,b,x){var P="",D;for(x+=b,D=b;D<x;D+=1)P+=V(F.getUint8(D));return P}var f=w.btoa;function v(F,b){for(var x=[],P=8192,D=new Uint8Array(F);D.length>0;)x.push(V.apply(null,L(D.subarray(0,P)))),D=D.subarray(P);return"data:".concat(b,";base64,").concat(f(x.join("")))}function k(F){var b=new DataView(F),x;try{var P,D,S;if(b.getUint8(0)===255&&b.getUint8(1)===216)for(var H=b.byteLength,U=2;U+1<H;){if(b.getUint8(U)===255&&b.getUint8(U+1)===225){D=U;break}U+=1}if(D){var M=D+4,A=D+10;if(c(b,M,4)==="Exif"){var X=b.getUint16(A);if(P=X===18761,(P||X===19789)&&b.getUint16(A+2,P)===42){var K=b.getUint32(A+4,P);K>=8&&(S=A+K)}}}if(S){var Y=b.getUint16(S,P),ee,R;for(R=0;R<Y;R+=1)if(ee=S+R*12+2,b.getUint16(ee,P)===274){ee+=8,x=b.getUint16(ee,P),b.setUint16(ee,1,P);break}}}catch{x=1}return x}function C(F){var b=0,x=1,P=1;switch(F){case 2:x=-1;break;case 3:b=-180;break;case 4:P=-1;break;case 5:b=90,P=-1;break;case 6:b=90;break;case 7:b=90,x=-1;break;case 8:b=-90;break}return{rotate:b,scaleX:x,scaleY:P}}var T=/\.\d*(?:0|9){12}\d*$/;function q(F){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return T.test(F)?Math.round(F*b)/b:F}function oe(F){var b=F.aspectRatio,x=F.height,P=F.width,D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"none",S=B(P),H=B(x);if(S&&H){var U=x*b;(D==="contain"||D==="none")&&U>P||D==="cover"&&U<P?x=P/b:P=x*b}else S?x=P/b:H&&(P=x*b);return{width:P,height:x}}function ie(F){for(var b=L(new Uint8Array(F)),x=b.length,P=[],D=0;D+3<x;){var S=b[D],H=b[D+1];if(S===255&&H===218)break;if(S===255&&H===216)D+=2;else{var U=b[D+2]*256+b[D+3],M=D+U+2,A=b.slice(D,M);P.push(A),D=M}}return P.reduce(function(X,K){return K[0]===255&&K[1]===225?X.concat(K):X},[])}function z(F,b){var x=L(new Uint8Array(F));if(x[2]!==255||x[3]!==224)return F;var P=x[4]*256+x[5],D=[255,216].concat(b,x.slice(4+P));return new Uint8Array(D)}var se=w.ArrayBuffer,N=w.FileReader,ye=w.URL||w.webkitURL,be=/\.\w+$/,E=w.Compressor,re=function(){function F(b,x){t(this,F),this.file=b,this.exif=[],this.image=new Image,this.options=e(e({},g),x),this.aborted=!1,this.result=null,this.init()}return o(F,[{key:"init",value:function(){var x=this,P=this.file,D=this.options;if(!u(P)){this.fail(new Error("The first argument must be a File or Blob object."));return}var S=P.type;if(!Z(S)){this.fail(new Error("The first argument must be an image File or Blob object."));return}if(!ye||!N){this.fail(new Error("The current browser does not support image compression."));return}se||(D.checkOrientation=!1,D.retainExif=!1);var H=S==="image/jpeg",U=H&&D.checkOrientation,M=H&&D.retainExif;if(ye&&!U&&!M)this.load({url:ye.createObjectURL(P)});else{var A=new N;this.reader=A,A.onload=function(X){var K=X.target,Y=K.result,ee={},R=1;U&&(R=k(Y),R>1&&a(ee,C(R))),M&&(x.exif=ie(Y)),U||M?!ye||R>1?ee.url=v(Y,S):ee.url=ye.createObjectURL(P):ee.url=Y,x.load(ee)},A.onabort=function(){x.fail(new Error("Aborted to read the image with FileReader."))},A.onerror=function(){x.fail(new Error("Failed to read the image with FileReader."))},A.onloadend=function(){x.reader=null},U||M?A.readAsArrayBuffer(P):A.readAsDataURL(P)}}},{key:"load",value:function(x){var P=this,D=this.file,S=this.image;S.onload=function(){P.draw(e(e({},x),{},{naturalWidth:S.naturalWidth,naturalHeight:S.naturalHeight}))},S.onabort=function(){P.fail(new Error("Aborted to load the image."))},S.onerror=function(){P.fail(new Error("Failed to load the image."))},w.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(w.navigator.userAgent)&&(S.crossOrigin="anonymous"),S.alt=D.name,S.src=x.url}},{key:"draw",value:function(x){var P=this,D=x.naturalWidth,S=x.naturalHeight,H=x.rotate,U=H===void 0?0:H,M=x.scaleX,A=M===void 0?1:M,X=x.scaleY,K=X===void 0?1:X,Y=this.file,ee=this.image,R=this.options,ce=document.createElement("canvas"),ae=ce.getContext("2d"),Pe=Math.abs(U)%180===90,ne=(R.resize==="contain"||R.resize==="cover")&&B(R.width)&&B(R.height),le=Math.max(R.maxWidth,0)||1/0,Ne=Math.max(R.maxHeight,0)||1/0,Q=Math.max(R.minWidth,0)||0,Ke=Math.max(R.minHeight,0)||0,Ie=D/S,fe=R.width,de=R.height;if(Pe){var Ye=[Ne,le];le=Ye[0],Ne=Ye[1];var Je=[Ke,Q];Q=Je[0],Ke=Je[1];var Ce=[de,fe];fe=Ce[0],de=Ce[1]}ne&&(Ie=fe/de);var It=oe({aspectRatio:Ie,width:le,height:Ne},"contain");le=It.width,Ne=It.height;var Be=oe({aspectRatio:Ie,width:Q,height:Ke},"cover");if(Q=Be.width,Ke=Be.height,ne){var Sr=oe({aspectRatio:Ie,width:fe,height:de},R.resize);fe=Sr.width,de=Sr.height}else{var Qt=oe({aspectRatio:Ie,width:fe,height:de}),Ea=Qt.width;fe=Ea===void 0?D:Ea;var Aa=Qt.height;de=Aa===void 0?S:Aa}fe=Math.floor(q(Math.min(Math.max(fe,Q),le))),de=Math.floor(q(Math.min(Math.max(de,Ke),Ne)));var Sd=-fe/2,Fd=-de/2,kd=fe,_d=de,Do=[];if(ne){var Oa=0,za=0,Co=D,Bo=S,Ua=oe({aspectRatio:Ie,width:D,height:S},{contain:"cover",cover:"contain"}[R.resize]);Co=Ua.width,Bo=Ua.height,Oa=(D-Co)/2,za=(S-Bo)/2,Do.push(Oa,za,Co,Bo)}if(Do.push(Sd,Fd,kd,_d),Pe){var Ma=[de,fe];fe=Ma[0],de=Ma[1]}ce.width=fe,ce.height=de,Z(R.mimeType)||(R.mimeType=Y.type);var Ra="transparent";Y.size>R.convertSize&&R.convertTypes.indexOf(R.mimeType)>=0&&(R.mimeType="image/jpeg");var Na=R.mimeType==="image/jpeg";if(Na&&(Ra="#fff"),ae.fillStyle=Ra,ae.fillRect(0,0,fe,de),R.beforeDraw&&R.beforeDraw.call(this,ae,ce),!this.aborted&&(ae.save(),ae.translate(fe/2,de/2),ae.rotate(U*Math.PI/180),ae.scale(A,K),ae.drawImage.apply(ae,[ee].concat(Do)),ae.restore(),R.drew&&R.drew.call(this,ae,ce),!this.aborted)){var La=function(Fr){if(!P.aborted){var ja=function(kr){return P.done({naturalWidth:D,naturalHeight:S,result:kr})};if(Fr&&Na&&R.retainExif&&P.exif&&P.exif.length>0){var Ha=function(kr){return ja(h(v(z(kr,P.exif),R.mimeType)))};if(Fr.arrayBuffer)Fr.arrayBuffer().then(Ha).catch(function(){P.fail(new Error("Failed to read the compressed image with Blob.arrayBuffer()."))});else{var Zt=new N;P.reader=Zt,Zt.onload=function(To){var kr=To.target;Ha(kr.result)},Zt.onabort=function(){P.fail(new Error("Aborted to read the compressed image with FileReader."))},Zt.onerror=function(){P.fail(new Error("Failed to read the compressed image with FileReader."))},Zt.onloadend=function(){P.reader=null},Zt.readAsArrayBuffer(Fr)}}else ja(Fr)}};ce.toBlob?ce.toBlob(La,R.mimeType,R.quality):La(h(ce.toDataURL(R.mimeType,R.quality)))}}},{key:"done",value:function(x){var P=x.naturalWidth,D=x.naturalHeight,S=x.result,H=this.file,U=this.image,M=this.options;if(ye&&U.src.indexOf("blob:")===0&&ye.revokeObjectURL(U.src),S)if(M.strict&&!M.retainExif&&S.size>H.size&&M.mimeType===H.type&&!(M.width>P||M.height>D||M.minWidth>P||M.minHeight>D||M.maxWidth<P||M.maxHeight<D))S=H;else{var A=new Date;S.lastModified=A.getTime(),S.lastModifiedDate=A,S.name=H.name,S.name&&S.type!==H.type&&(S.name=S.name.replace(be,G(S.type)))}else S=H;this.result=S,M.success&&M.success.call(this,S)}},{key:"fail",value:function(x){var P=this.options;if(P.error)P.error.call(this,x);else throw x}},{key:"abort",value:function(){this.aborted||(this.aborted=!0,this.reader?this.reader.abort():this.image.complete?this.fail(new Error("The compression process has been aborted.")):(this.image.onload=null,this.image.onabort()))}}],[{key:"noConflict",value:function(){return window.Compressor=E,F}},{key:"setDefaults",value:function(x){a(g,x)}}]),F}();return re})});var xd=me((Ba,Ta)=>{(function(r,e){typeof define=="function"&&define.amd?define([],e):typeof Ta=="object"&&typeof Ba<"u"?Ta.exports=e():r.Papa=e()})(Ba,function r(){"use strict";var e=typeof self<"u"?self:typeof window<"u"?window:e!==void 0?e:{},t=!e.document&&!!e.postMessage,i=e.IS_PAPA_WORKER||!1,o={},s=0,a={parse:function(c,f){var v=(f=f||{}).dynamicTyping||!1;if(V(v)&&(f.dynamicTypingFunction=v,v={}),f.dynamicTyping=v,f.transform=!!V(f.transform)&&f.transform,f.worker&&a.WORKERS_SUPPORTED){var k=function(){if(!a.WORKERS_SUPPORTED)return!1;var T=(oe=e.URL||e.webkitURL||null,ie=r.toString(),a.BLOB_URL||(a.BLOB_URL=oe.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",ie,")();"],{type:"text/javascript"})))),q=new e.Worker(T),oe,ie;return q.onmessage=$,q.id=s++,o[q.id]=q}();return k.userStep=f.step,k.userChunk=f.chunk,k.userComplete=f.complete,k.userError=f.error,f.step=V(f.step),f.chunk=V(f.chunk),f.complete=V(f.complete),f.error=V(f.error),delete f.worker,void k.postMessage({input:c,config:f,workerId:k.id})}var C=null;return a.NODE_STREAM_INPUT,typeof c=="string"?(c=function(T){return T.charCodeAt(0)===65279?T.slice(1):T}(c),C=f.download?new d(f):new u(f)):c.readable===!0&&V(c.read)&&V(c.on)?C=new g(f):(e.File&&c instanceof File||c instanceof Object)&&(C=new h(f)),C.stream(c)},unparse:function(c,f){var v=!1,k=!0,C=",",T=`\r
|
|
2
|
+
`,q='"',oe=q+q,ie=!1,z=null,se=!1;(function(){if(typeof f=="object"){if(typeof f.delimiter!="string"||a.BAD_DELIMITERS.filter(function(E){return f.delimiter.indexOf(E)!==-1}).length||(C=f.delimiter),(typeof f.quotes=="boolean"||typeof f.quotes=="function"||Array.isArray(f.quotes))&&(v=f.quotes),typeof f.skipEmptyLines!="boolean"&&typeof f.skipEmptyLines!="string"||(ie=f.skipEmptyLines),typeof f.newline=="string"&&(T=f.newline),typeof f.quoteChar=="string"&&(q=f.quoteChar),typeof f.header=="boolean"&&(k=f.header),Array.isArray(f.columns)){if(f.columns.length===0)throw new Error("Option columns is empty");z=f.columns}f.escapeChar!==void 0&&(oe=f.escapeChar+q),(typeof f.escapeFormulae=="boolean"||f.escapeFormulae instanceof RegExp)&&(se=f.escapeFormulae instanceof RegExp?f.escapeFormulae:/^[=+\-@\t\r].*$/)}})();var N=new RegExp(w(q),"g");if(typeof c=="string"&&(c=JSON.parse(c)),Array.isArray(c)){if(!c.length||Array.isArray(c[0]))return ye(null,c,ie);if(typeof c[0]=="object")return ye(z||Object.keys(c[0]),c,ie)}else if(typeof c=="object")return typeof c.data=="string"&&(c.data=JSON.parse(c.data)),Array.isArray(c.data)&&(c.fields||(c.fields=c.meta&&c.meta.fields||z),c.fields||(c.fields=Array.isArray(c.data[0])?c.fields:typeof c.data[0]=="object"?Object.keys(c.data[0]):[]),Array.isArray(c.data[0])||typeof c.data[0]=="object"||(c.data=[c.data])),ye(c.fields||[],c.data||[],ie);throw new Error("Unable to serialize unrecognized input");function ye(E,re,F){var b="";typeof E=="string"&&(E=JSON.parse(E)),typeof re=="string"&&(re=JSON.parse(re));var x=Array.isArray(E)&&0<E.length,P=!Array.isArray(re[0]);if(x&&k){for(var D=0;D<E.length;D++)0<D&&(b+=C),b+=be(E[D],D);0<re.length&&(b+=T)}for(var S=0;S<re.length;S++){var H=x?E.length:re[S].length,U=!1,M=x?Object.keys(re[S]).length===0:re[S].length===0;if(F&&!x&&(U=F==="greedy"?re[S].join("").trim()==="":re[S].length===1&&re[S][0].length===0),F==="greedy"&&x){for(var A=[],X=0;X<H;X++){var K=P?E[X]:X;A.push(re[S][K])}U=A.join("").trim()===""}if(!U){for(var Y=0;Y<H;Y++){0<Y&&!M&&(b+=C);var ee=x&&P?E[Y]:Y;b+=be(re[S][ee],Y)}S<re.length-1&&(!F||0<H&&!M)&&(b+=T)}}return b}function be(E,re){if(E==null)return"";if(E.constructor===Date)return JSON.stringify(E).slice(1,25);var F=!1;se&&typeof E=="string"&&se.test(E)&&(E="'"+E,F=!0);var b=E.toString().replace(N,oe);return(F=F||v===!0||typeof v=="function"&&v(E,re)||Array.isArray(v)&&v[re]||function(x,P){for(var D=0;D<P.length;D++)if(-1<x.indexOf(P[D]))return!0;return!1}(b,a.BAD_DELIMITERS)||-1<b.indexOf(C)||b.charAt(0)===" "||b.charAt(b.length-1)===" ")?q+b+q:b}}};if(a.RECORD_SEP="",a.UNIT_SEP="",a.BYTE_ORDER_MARK="\uFEFF",a.BAD_DELIMITERS=["\r",`
|
|
3
|
+
`,'"',a.BYTE_ORDER_MARK],a.WORKERS_SUPPORTED=!t&&!!e.Worker,a.NODE_STREAM_INPUT=1,a.LocalChunkSize=10485760,a.RemoteChunkSize=5242880,a.DefaultDelimiter=",",a.Parser=B,a.ParserHandle=y,a.NetworkStreamer=d,a.FileStreamer=h,a.StringStreamer=u,a.ReadableStreamStreamer=g,e.jQuery){var n=e.jQuery;n.fn.parse=function(c){var f=c.config||{},v=[];return this.each(function(T){if(!(n(this).prop("tagName").toUpperCase()==="INPUT"&&n(this).attr("type").toLowerCase()==="file"&&e.FileReader)||!this.files||this.files.length===0)return!0;for(var q=0;q<this.files.length;q++)v.push({file:this.files[q],inputElem:this,instanceConfig:n.extend({},f)})}),k(),this;function k(){if(v.length!==0){var T,q,oe,ie,z=v[0];if(V(c.before)){var se=c.before(z.file,z.inputElem);if(typeof se=="object"){if(se.action==="abort")return T="AbortError",q=z.file,oe=z.inputElem,ie=se.reason,void(V(c.error)&&c.error({name:T},q,oe,ie));if(se.action==="skip")return void C();typeof se.config=="object"&&(z.instanceConfig=n.extend(z.instanceConfig,se.config))}else if(se==="skip")return void C()}var N=z.instanceConfig.complete;z.instanceConfig.complete=function(ye){V(N)&&N(ye,z.file,z.inputElem),C()},a.parse(z.file,z.instanceConfig)}else V(c.complete)&&c.complete()}function C(){v.splice(0,1),k()}}}function l(c){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(f){var v=Z(f);v.chunkSize=parseInt(v.chunkSize),f.step||f.chunk||(v.chunkSize=null),this._handle=new y(v),(this._handle.streamer=this)._config=v}.call(this,c),this.parseChunk=function(f,v){if(this.isFirstChunk&&V(this._config.beforeFirstChunk)){var k=this._config.beforeFirstChunk(f);k!==void 0&&(f=k)}this.isFirstChunk=!1,this._halted=!1;var C=this._partialLine+f;this._partialLine="";var T=this._handle.parse(C,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var q=T.meta.cursor;this._finished||(this._partialLine=C.substring(q-this._baseIndex),this._baseIndex=q),T&&T.data&&(this._rowCount+=T.data.length);var oe=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(i)e.postMessage({results:T,workerId:a.WORKER_ID,finished:oe});else if(V(this._config.chunk)&&!v){if(this._config.chunk(T,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);T=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(T.data),this._completeResults.errors=this._completeResults.errors.concat(T.errors),this._completeResults.meta=T.meta),this._completed||!oe||!V(this._config.complete)||T&&T.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),oe||T&&T.meta.paused||this._nextChunk(),T}this._halted=!0},this._sendError=function(f){V(this._config.error)?this._config.error(f):i&&this._config.error&&e.postMessage({workerId:a.WORKER_ID,error:f,finished:!1})}}function d(c){var f;(c=c||{}).chunkSize||(c.chunkSize=a.RemoteChunkSize),l.call(this,c),this._nextChunk=t?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(v){this._input=v,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(f=new XMLHttpRequest,this._config.withCredentials&&(f.withCredentials=this._config.withCredentials),t||(f.onload=G(this._chunkLoaded,this),f.onerror=G(this._chunkError,this)),f.open(this._config.downloadRequestBody?"POST":"GET",this._input,!t),this._config.downloadRequestHeaders){var v=this._config.downloadRequestHeaders;for(var k in v)f.setRequestHeader(k,v[k])}if(this._config.chunkSize){var C=this._start+this._config.chunkSize-1;f.setRequestHeader("Range","bytes="+this._start+"-"+C)}try{f.send(this._config.downloadRequestBody)}catch(T){this._chunkError(T.message)}t&&f.status===0&&this._chunkError()}},this._chunkLoaded=function(){f.readyState===4&&(f.status<200||400<=f.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:f.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(v){var k=v.getResponseHeader("Content-Range");return k===null?-1:parseInt(k.substring(k.lastIndexOf("/")+1))}(f),this.parseChunk(f.responseText)))},this._chunkError=function(v){var k=f.statusText||v;this._sendError(new Error(k))}}function h(c){var f,v;(c=c||{}).chunkSize||(c.chunkSize=a.LocalChunkSize),l.call(this,c);var k=typeof FileReader<"u";this.stream=function(C){this._input=C,v=C.slice||C.webkitSlice||C.mozSlice,k?((f=new FileReader).onload=G(this._chunkLoaded,this),f.onerror=G(this._chunkError,this)):f=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var C=this._input;if(this._config.chunkSize){var T=Math.min(this._start+this._config.chunkSize,this._input.size);C=v.call(C,this._start,T)}var q=f.readAsText(C,this._config.encoding);k||this._chunkLoaded({target:{result:q}})},this._chunkLoaded=function(C){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(C.target.result)},this._chunkError=function(){this._sendError(f.error)}}function u(c){var f;l.call(this,c=c||{}),this.stream=function(v){return f=v,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var v,k=this._config.chunkSize;return k?(v=f.substring(0,k),f=f.substring(k)):(v=f,f=""),this._finished=!f,this.parseChunk(v)}}}function g(c){l.call(this,c=c||{});var f=[],v=!0,k=!1;this.pause=function(){l.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){l.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(C){this._input=C,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){k&&f.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),f.length?this.parseChunk(f.shift()):v=!0},this._streamData=G(function(C){try{f.push(typeof C=="string"?C:C.toString(this._config.encoding)),v&&(v=!1,this._checkIsFinished(),this.parseChunk(f.shift()))}catch(T){this._streamError(T)}},this),this._streamError=G(function(C){this._streamCleanUp(),this._sendError(C)},this),this._streamEnd=G(function(){this._streamCleanUp(),k=!0,this._streamData("")},this),this._streamCleanUp=G(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function y(c){var f,v,k,C=Math.pow(2,53),T=-C,q=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,oe=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,ie=this,z=0,se=0,N=!1,ye=!1,be=[],E={data:[],errors:[],meta:{}};if(V(c.step)){var re=c.step;c.step=function(S){if(E=S,x())b();else{if(b(),E.data.length===0)return;z+=S.data.length,c.preview&&z>c.preview?v.abort():(E.data=E.data[0],re(E,ie))}}}function F(S){return c.skipEmptyLines==="greedy"?S.join("").trim()==="":S.length===1&&S[0].length===0}function b(){return E&&k&&(D("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+a.DefaultDelimiter+"'"),k=!1),c.skipEmptyLines&&(E.data=E.data.filter(function(S){return!F(S)})),x()&&function(){if(!E)return;function S(U,M){V(c.transformHeader)&&(U=c.transformHeader(U,M)),be.push(U)}if(Array.isArray(E.data[0])){for(var H=0;x()&&H<E.data.length;H++)E.data[H].forEach(S);E.data.splice(0,1)}else E.data.forEach(S)}(),function(){if(!E||!c.header&&!c.dynamicTyping&&!c.transform)return E;function S(U,M){var A,X=c.header?{}:[];for(A=0;A<U.length;A++){var K=A,Y=U[A];c.header&&(K=A>=be.length?"__parsed_extra":be[A]),c.transform&&(Y=c.transform(Y,K)),Y=P(K,Y),K==="__parsed_extra"?(X[K]=X[K]||[],X[K].push(Y)):X[K]=Y}return c.header&&(A>be.length?D("FieldMismatch","TooManyFields","Too many fields: expected "+be.length+" fields but parsed "+A,se+M):A<be.length&&D("FieldMismatch","TooFewFields","Too few fields: expected "+be.length+" fields but parsed "+A,se+M)),X}var H=1;return!E.data.length||Array.isArray(E.data[0])?(E.data=E.data.map(S),H=E.data.length):E.data=S(E.data,0),c.header&&E.meta&&(E.meta.fields=be),se+=H,E}()}function x(){return c.header&&be.length===0}function P(S,H){return U=S,c.dynamicTypingFunction&&c.dynamicTyping[U]===void 0&&(c.dynamicTyping[U]=c.dynamicTypingFunction(U)),(c.dynamicTyping[U]||c.dynamicTyping)===!0?H==="true"||H==="TRUE"||H!=="false"&&H!=="FALSE"&&(function(M){if(q.test(M)){var A=parseFloat(M);if(T<A&&A<C)return!0}return!1}(H)?parseFloat(H):oe.test(H)?new Date(H):H===""?null:H):H;var U}function D(S,H,U,M){var A={type:S,code:H,message:U};M!==void 0&&(A.row=M),E.errors.push(A)}this.parse=function(S,H,U){var M=c.quoteChar||'"';if(c.newline||(c.newline=function(K,Y){K=K.substring(0,1048576);var ee=new RegExp(w(Y)+"([^]*?)"+w(Y),"gm"),R=(K=K.replace(ee,"")).split("\r"),ce=K.split(`
|
|
4
|
+
`),ae=1<ce.length&&ce[0].length<R[0].length;if(R.length===1||ae)return`
|
|
5
|
+
`;for(var Pe=0,ne=0;ne<R.length;ne++)R[ne][0]===`
|
|
6
|
+
`&&Pe++;return Pe>=R.length/2?`\r
|
|
7
|
+
`:"\r"}(S,M)),k=!1,c.delimiter)V(c.delimiter)&&(c.delimiter=c.delimiter(S),E.meta.delimiter=c.delimiter);else{var A=function(K,Y,ee,R,ce){var ae,Pe,ne,le;ce=ce||[","," ","|",";",a.RECORD_SEP,a.UNIT_SEP];for(var Ne=0;Ne<ce.length;Ne++){var Q=ce[Ne],Ke=0,Ie=0,fe=0;ne=void 0;for(var de=new B({comments:R,delimiter:Q,newline:Y,preview:10}).parse(K),Ye=0;Ye<de.data.length;Ye++)if(ee&&F(de.data[Ye]))fe++;else{var Je=de.data[Ye].length;Ie+=Je,ne!==void 0?0<Je&&(Ke+=Math.abs(Je-ne),ne=Je):ne=Je}0<de.data.length&&(Ie/=de.data.length-fe),(Pe===void 0||Ke<=Pe)&&(le===void 0||le<Ie)&&1.99<Ie&&(Pe=Ke,ae=Q,le=Ie)}return{successful:!!(c.delimiter=ae),bestDelimiter:ae}}(S,c.newline,c.skipEmptyLines,c.comments,c.delimitersToGuess);A.successful?c.delimiter=A.bestDelimiter:(k=!0,c.delimiter=a.DefaultDelimiter),E.meta.delimiter=c.delimiter}var X=Z(c);return c.preview&&c.header&&X.preview++,f=S,v=new B(X),E=v.parse(f,H,U),b(),N?{meta:{paused:!0}}:E||{meta:{paused:!1}}},this.paused=function(){return N},this.pause=function(){N=!0,v.abort(),f=V(c.chunk)?"":f.substring(v.getCharIndex())},this.resume=function(){ie.streamer._halted?(N=!1,ie.streamer.parseChunk(f,!0)):setTimeout(ie.resume,3)},this.aborted=function(){return ye},this.abort=function(){ye=!0,v.abort(),E.meta.aborted=!0,V(c.complete)&&c.complete(E),f=""}}function w(c){return c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function B(c){var f,v=(c=c||{}).delimiter,k=c.newline,C=c.comments,T=c.step,q=c.preview,oe=c.fastMode,ie=f=c.quoteChar===void 0||c.quoteChar===null?'"':c.quoteChar;if(c.escapeChar!==void 0&&(ie=c.escapeChar),(typeof v!="string"||-1<a.BAD_DELIMITERS.indexOf(v))&&(v=","),C===v)throw new Error("Comment character same as delimiter");C===!0?C="#":(typeof C!="string"||-1<a.BAD_DELIMITERS.indexOf(C))&&(C=!1),k!==`
|
|
8
|
+
`&&k!=="\r"&&k!==`\r
|
|
9
|
+
`&&(k=`
|
|
10
|
+
`);var z=0,se=!1;this.parse=function(N,ye,be){if(typeof N!="string")throw new Error("Input must be a string");var E=N.length,re=v.length,F=k.length,b=C.length,x=V(T),P=[],D=[],S=[],H=z=0;if(!N)return Ce();if(c.header&&!ye){var U=N.split(k)[0].split(v),M=[],A={},X=!1;for(var K in U){var Y=U[K];V(c.transformHeader)&&(Y=c.transformHeader(Y,K));var ee=Y,R=A[Y]||0;for(0<R&&(X=!0,ee=Y+"_"+R),A[Y]=R+1;M.includes(ee);)ee=ee+"_"+R;M.push(ee)}if(X){var ce=N.split(k);ce[0]=M.join(v),N=ce.join(k)}}if(oe||oe!==!1&&N.indexOf(f)===-1){for(var ae=N.split(k),Pe=0;Pe<ae.length;Pe++){if(S=ae[Pe],z+=S.length,Pe!==ae.length-1)z+=k.length;else if(be)return Ce();if(!C||S.substring(0,b)!==C){if(x){if(P=[],fe(S.split(v)),It(),se)return Ce()}else fe(S.split(v));if(q&&q<=Pe)return P=P.slice(0,q),Ce(!0)}}return Ce()}for(var ne=N.indexOf(v,z),le=N.indexOf(k,z),Ne=new RegExp(w(ie)+w(f),"g"),Q=N.indexOf(f,z);;)if(N[z]!==f)if(C&&S.length===0&&N.substring(z,z+b)===C){if(le===-1)return Ce();z=le+F,le=N.indexOf(k,z),ne=N.indexOf(v,z)}else if(ne!==-1&&(ne<le||le===-1))S.push(N.substring(z,ne)),z=ne+re,ne=N.indexOf(v,z);else{if(le===-1)break;if(S.push(N.substring(z,le)),Je(le+F),x&&(It(),se))return Ce();if(q&&P.length>=q)return Ce(!0)}else for(Q=z,z++;;){if((Q=N.indexOf(f,Q+1))===-1)return be||D.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:P.length,index:z}),Ye();if(Q===E-1)return Ye(N.substring(z,Q).replace(Ne,f));if(f!==ie||N[Q+1]!==ie){if(f===ie||Q===0||N[Q-1]!==ie){ne!==-1&&ne<Q+1&&(ne=N.indexOf(v,Q+1)),le!==-1&&le<Q+1&&(le=N.indexOf(k,Q+1));var Ke=de(le===-1?ne:Math.min(ne,le));if(N.substr(Q+1+Ke,re)===v){S.push(N.substring(z,Q).replace(Ne,f)),N[z=Q+1+Ke+re]!==f&&(Q=N.indexOf(f,z)),ne=N.indexOf(v,z),le=N.indexOf(k,z);break}var Ie=de(le);if(N.substring(Q+1+Ie,Q+1+Ie+F)===k){if(S.push(N.substring(z,Q).replace(Ne,f)),Je(Q+1+Ie+F),ne=N.indexOf(v,z),Q=N.indexOf(f,z),x&&(It(),se))return Ce();if(q&&P.length>=q)return Ce(!0);break}D.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:P.length,index:z}),Q++}}else Q++}return Ye();function fe(Be){P.push(Be),H=z}function de(Be){var Sr=0;if(Be!==-1){var Qt=N.substring(Q+1,Be);Qt&&Qt.trim()===""&&(Sr=Qt.length)}return Sr}function Ye(Be){return be||(Be===void 0&&(Be=N.substring(z)),S.push(Be),z=E,fe(S),x&&It()),Ce()}function Je(Be){z=Be,fe(S),S=[],le=N.indexOf(k,z)}function Ce(Be){return{data:P,errors:D,meta:{delimiter:v,linebreak:k,aborted:se,truncated:!!Be,cursor:H+(ye||0)}}}function It(){T(Ce()),P=[],D=[]}},this.abort=function(){se=!0},this.getCharIndex=function(){return z}}function $(c){var f=c.data,v=o[f.workerId],k=!1;if(f.error)v.userError(f.error,f.file);else if(f.results&&f.results.data){var C={abort:function(){k=!0,L(f.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:j,resume:j};if(V(v.userStep)){for(var T=0;T<f.results.data.length&&(v.userStep({data:f.results.data[T],errors:f.results.errors,meta:f.results.meta},C),!k);T++);delete f.results}else V(v.userChunk)&&(v.userChunk(f.results,C,f.file),delete f.results)}f.finished&&!k&&L(f.workerId,f.results)}function L(c,f){var v=o[c];V(v.userComplete)&&v.userComplete(f),v.terminate(),delete o[c]}function j(){throw new Error("Not implemented.")}function Z(c){if(typeof c!="object"||c===null)return c;var f=Array.isArray(c)?[]:{};for(var v in c)f[v]=Z(c[v]);return f}function G(c,f){return function(){c.apply(f,arguments)}}function V(c){return typeof c=="function"}return i&&(e.onmessage=function(c){var f=c.data;if(a.WORKER_ID===void 0&&f&&(a.WORKER_ID=f.workerId),typeof f.input=="string")e.postMessage({workerId:a.WORKER_ID,results:a.parse(f.input,f.config),finished:!0});else if(e.File&&f.input instanceof File||f.input instanceof Object){var v=a.parse(f.input,f.config);v&&e.postMessage({workerId:a.WORKER_ID,results:v,finished:!0})}}),(d.prototype=Object.create(l.prototype)).constructor=d,(h.prototype=Object.create(l.prototype)).constructor=h,(u.prototype=Object.create(u.prototype)).constructor=u,(g.prototype=Object.create(l.prototype)).constructor=g,a})});var un=(()=>{class r{constructor(){this.subject$=new $a}onFileLoad(t){let o=t.target.result,s=!1,a=[],n=[],l=0;for(let d of o.split(/[\r\n]+/))if(s){let h={};for(let u=0;u<l;u++)h[n[u]]=d.split(",")[u];a.push(h)}else{for(let h=0;h<d.split(",").length;h++)l=d.split(",").length,n.push(d.split(",")[h].replace(/ /g,""));s=!0}return a.splice(-1),a}convertFile(t){let i=t,o=new FileReader;return o.onload=s=>{let a=this.onFileLoad(s);this.subject$.next(a)},o.readAsText(i,"UTF-8"),this.subject$.asObservable()}static{this.\u0275fac=function(i){return new(i||r)}}static{this.\u0275prov=Ci({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();var hn=(()=>{class r{constructor(t,i,o){this.http=t,this.toastr=i,this.router=o}PostToUrlEncode(t,i,o=1e5){let s=new ot;return s=s.set("Content-Type","application/x-www-form-urlencoded"),new rt(a=>{this.http.post(t,i,{headers:s}).pipe(it(o)).subscribe(n=>{a.next(n),a.complete()})})}GetText(t=1e5){let i=localStorage.getItem("Token"),s={responseType:"text",headers:new ot({Authorization:"Bearer "+i})};return new rt(a=>{this.http.get("/API/Token/GetZendeskJWT",s).pipe(it(t)).subscribe(n=>{a.next(n),a.complete()})})}POSText(t,i,o=1e5){let s=localStorage.getItem("Token"),n={responseType:"text",headers:new ot({"Content-Type":"application/json","Cache-Control":"no-cache",Authorization:"Bearer "+s})};return new rt(l=>{this.http.post(t,i,n).pipe(it(o)).subscribe(d=>{l.next(d),l.complete()})})}get(t){let i=localStorage.getItem("Token"),o=new ot({"Content-Type":"application/json","Cache-Control":"no-cache"});i&&(o=o.append("Authorization","Bearer "+i));let s={headers:o};return this.http.get(t,s).pipe(Va(a=>{if(!this.unauthorizedErrorHandling(a)){let l=this.errorMessageHandling(a);this.toastr.error(l.Message!=""?l.Message:"An unknown error has occured!",l.header),this.paymentErrorHandling(a)}return qa(()=>a)}))}getNews(t){return this.http.get(t)}paymentErrorHandling(t){t.status==402&&this.router.navigate(["/menu/Profile/Main/My_Subscription"])}post(t,i,o=1e5){return new rt(s=>{let a=localStorage.getItem("Token"),n=new ot({"Content-Type":"application/json","Cache-Control":"no-cache"});a&&(n=n.append("Authorization","Bearer "+a));let l={headers:n};Date.prototype.toJSON=function(){return this.getFullYear()+"-"+d(this.getMonth()+1)+"-"+d(this.getDate())+"T"+d(this.getHours())+":"+d(this.getMinutes())+":"+d(this.getSeconds())+".000"};function d(h){return h<10?"0"+h:h}this.http.post(t,i,l).pipe(it(o)).subscribe({next:h=>{s.next(h),s.complete()},error:h=>{if(h.status==200)s.next(h.error.text),s.complete();else{if(!this.unauthorizedErrorHandling(h)){let g=this.errorMessageHandling(h);this.toastr.error(g.Message!=""?g.Message:"An unknown error has occured!",g.header,{enableHtml:!0})}s.error(h)}}})})}postFile(t,i,o=1e5){return new rt(s=>{let a=localStorage.getItem("Token"),n=new ot({"Content-Type":"application/json","Cache-Control":"no-cache"});a&&(n=n.append("Authorization","Bearer "+a)),this.http.post(t,i,{headers:n,observe:"response",responseType:"blob"}).pipe(it(o)).subscribe({next:l=>{s.next({title:l.headers.get("Content-Disposition"),file:l.body}),s.complete()},error:l=>{if(l.headers.get("Content-Type")==="application/json; charset=utf-8"){let d=new FileReader;d.addEventListener("loadend",h=>{let u=JSON.parse(h.srcElement.result)?.Message;if(!this.unauthorizedErrorHandling(l)){let y=this.errorMessageHandling(l);this.toastr.error(u??"An unknown error has occured!",y.header,{enableHtml:!0})}}),d.readAsText(l.error)}s.error(l)}})})}put(t,i,o=1e5){return new rt(s=>{let a=localStorage.getItem("Token"),n=new ot({"Content-Type":"application/json","Cache-Control":"no-cache"});a&&(n=n.append("Authorization","Bearer "+a));let l={headers:n};this.http.put(t,i,l).pipe(it(o)).subscribe({next:d=>{s.next(d),s.complete()},error:d=>{if(d.status==200)s.next(d.error.text),s.complete();else{if(!this.unauthorizedErrorHandling(d)){let u=this.errorMessageHandling(d);this.toastr.error(u.Message!=""?u.Message:"An unknown error has occured!",u.header)}s.error(d)}}})})}delete(t,i,o=1e5){return new rt(s=>{let a=localStorage.getItem("Token"),n=new ot({"Content-Type":"application/json","Cache-Control":"no-cache"});a&&(n=n.append("Authorization","Bearer "+a));let l={headers:n,body:i};this.http.delete(t,l).pipe(it(o)).subscribe({next:d=>{s.next(d),s.complete()},error:d=>{if(d.status==200)s.next(d.error.text),s.complete();else{if(!this.unauthorizedErrorHandling(d)){let u=this.errorMessageHandling(d);this.toastr.error(u.Message!=""?u.Message:"An unknown error has occured!",u.header)}s.error(d)}}})})}unauthorizedErrorHandling(t){let i=!1;return(t.status==401||t.status==403)&&(localStorage.getItem("Token")?this.router.navigate(["/menu/Unauthorized/Main/Unauthorized"]):window.location.href="/",i=!0),i}errorMessageHandling(t){let i="API Error",o="Exception Message";return t.error?(i="API Error - "+t.status,t.status==451&&(i="Error"),t.error&&(o=t.error.Message)):t.Message&&(i="API Error - "+t.name,o=t.Message),{header:i,Message:o}}postFormDataWithoutBearer(t,i){return new rt(o=>{this.http.post(t,i).pipe(it(1e5)).subscribe({next:s=>{o.next(s),o.complete()},error:s=>{s.status==200&&(o.next(s.error.text),o.complete()),o.error(s)}})})}postFormData(t,i,o=!0){return new rt(s=>{let a=localStorage.getItem("Token"),l={headers:new ot({Authorization:"Bearer "+a})};this.http.post(t,i,l).pipe(it(1e5)).subscribe({next:d=>{s.next(d),s.complete()},error:d=>{if(d.status==200)s.next(d.error.text),s.complete();else{if(!this.unauthorizedErrorHandling(d)&&o){let u=this.errorMessageHandling(d);this.toastr.error(u.Message!=""?u.Message:"An unknown error has occured!",u.header)}s.error(d)}}})})}static{this.\u0275fac=function(i){return new(i||r)(Bi(ln),Bi(dn),Bi(pn))}}static{this.\u0275prov=Ci({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();function Oi(r,e){if(!{}.hasOwnProperty.call(r,e))throw new TypeError("attempted to use private field on non-instance");return r}var Id=0;function fn(r){return"__private_"+Id+++"_"+r}function Dd(r,e,t){let i=[];return r.forEach(o=>typeof o!="string"?i.push(o):e[Symbol.split](o).forEach((s,a,n)=>{s!==""&&i.push(s),a<n.length-1&&i.push(t)})),i}function cn(r,e){let t=/\$/g,i="$$$$",o=[r];if(e==null)return o;for(let s of Object.keys(e))if(s!=="_"){let a=e[s];typeof a=="string"&&(a=t[Symbol.replace](a,i)),o=Dd(o,new RegExp(`%\\{${s}\\}`,"g"),a)}return o}var Cd=r=>{throw new Error(`missing string: ${r}`)},Ir=fn("onMissingKey"),Dr=fn("apply"),ar=class{constructor(e,t){let{onMissingKey:i=Cd}=t===void 0?{}:t;Object.defineProperty(this,Dr,{value:Bd}),Object.defineProperty(this,Ir,{writable:!0,value:void 0}),this.locale={strings:{},pluralize(o){return o===1?0:1}},Array.isArray(e)?e.forEach(Oi(this,Dr)[Dr],this):Oi(this,Dr)[Dr](e),Oi(this,Ir)[Ir]=i}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){let i=this.locale.strings[e];if(i==null&&(Oi(this,Ir)[Ir](e),i=e),typeof i=="object"){if(t&&typeof t.smart_count<"u"){let s=this.locale.pluralize(t.smart_count);return cn(i[s],t)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if(typeof i!="string")throw new Error("string was not a string");return cn(i,t)}};function Bd(r){if(!(r!=null&&r.strings))return;let e=this.locale;Object.assign(this.locale,{strings:m(m({},e.strings),r.strings),pluralize:r.pluralize||e.pluralize})}var ul=ue(gn(),1);var Td="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Ft=(r=21)=>{let e="",t=r|0;for(;t--;)e+=Td[Math.random()*64|0];return e};var hl=ue(Xn(),1);function Ui(r,e){if(!{}.hasOwnProperty.call(r,e))throw new TypeError("attempted to use private field on non-instance");return r}var Fu=0;function Yn(r){return"__private_"+Fu+++"_"+r}var ku={version:"4.1.2"},Dt=Yn("callbacks"),Ho=Yn("publish"),Mi=class{constructor(){Object.defineProperty(this,Ho,{value:_u}),this.state={},Object.defineProperty(this,Dt,{writable:!0,value:new Set})}getState(){return this.state}setState(e){let t=m({},this.state),i=m(m({},this.state),e);this.state=i,Ui(this,Ho)[Ho](t,i,e)}subscribe(e){return Ui(this,Dt)[Dt].add(e),()=>{Ui(this,Dt)[Dt].delete(e)}}};function _u(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];Ui(this,Dt)[Dt].forEach(i=>{i(...e)})}Mi.VERSION=ku.version;var Jn=Mi;function st(r){let e=r.lastIndexOf(".");return e===-1||e===r.length-1?{name:r,extension:void 0}:{name:r.slice(0,e),extension:r.slice(e+1)}}var $o={__proto__:null,md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",webp:"image/webp",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",dicom:"application/dicom",doc:"application/msword",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"};function Br(r){var e;if(r.type)return r.type;let t=r.name?(e=st(r.name).extension)==null?void 0:e.toLowerCase():null;return t&&t in $o?$o[t]:"application/octet-stream"}function Iu(r){return r.charCodeAt(0).toString(32)}function Qn(r){let e="";return r.replace(/[^A-Z0-9]/gi,t=>(e+=`-${Iu(t)}`,"/"))+e}function Zn(r,e){let t=e||"uppy";return typeof r.name=="string"&&(t+=`-${Qn(r.name.toLowerCase())}`),r.type!==void 0&&(t+=`-${r.type}`),r.meta&&typeof r.meta.relativePath=="string"&&(t+=`-${Qn(r.meta.relativePath.toLowerCase())}`),r.data.size!==void 0&&(t+=`-${r.data.size}`),r.data.lastModified!==void 0&&(t+=`-${r.data.lastModified}`),t}function Du(r){return!r.isRemote||!r.remote?!1:new Set(["box","dropbox","drive","facebook","unsplash"]).has(r.remote.provider)}function Ri(r,e){if(Du(r))return r.id;let t=Br(r);return Zn(O(m({},r),{type:t}),e)}function qo(r){if(r==null&&typeof navigator<"u"&&(r=navigator.userAgent),!r)return!0;let e=/Edge\/(\d+\.\d+)/.exec(r);if(!e)return!0;let i=e[1].split(".",2),o=parseInt(i[0],10),s=parseInt(i[1],10);return o<15||o===15&&s<15063||o>18||o===18&&s>=18218}function Vo(r,e){return e.name?e.name:r.split("/")[0]==="image"?`${r.split("/")[0]}.${r.split("/")[1]}`:"noname"}function Wo(r){return r<10?`0${r}`:r.toString()}function nr(){let r=new Date,e=Wo(r.getHours()),t=Wo(r.getMinutes()),i=Wo(r.getSeconds());return`${e}:${t}:${i}`}var el={debug:()=>{},warn:()=>{},error:function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return console.error(`[Uppy] [${nr()}]`,...e)}},tl={debug:function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return console.debug(`[Uppy] [${nr()}]`,...e)},warn:function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return console.warn(`[Uppy] [${nr()}]`,...e)},error:function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return console.error(`[Uppy] [${nr()}]`,...e)}};var Er=ue(Tr(),1),ll=ue(nl(),1),pl={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]},Ue=class extends Error{constructor(e,t){var i;super(e),this.isRestriction=!0,this.isUserFacing=(i=t?.isUserFacing)!=null?i:!0,t!=null&&t.file&&(this.file=t.file)}},Ni=class{constructor(e,t){this.getI18n=t,this.getOpts=()=>{var i;let o=e();if(((i=o.restrictions)==null?void 0:i.allowedFileTypes)!=null&&!Array.isArray(o.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return o}}validateAggregateRestrictions(e,t){let{maxTotalFileSize:i,maxNumberOfFiles:o}=this.getOpts().restrictions;if(o&&e.filter(a=>!a.isGhost).length+t.length>o)throw new Ue(`${this.getI18n()("youCanOnlyUploadX",{smart_count:o})}`);if(i){let s=[...e,...t].reduce((a,n)=>{var l;return a+((l=n.size)!=null?l:0)},0);if(s>i)throw new Ue(this.getI18n()("aggregateExceedsSize",{sizeAllowed:(0,Er.default)(i),size:(0,Er.default)(s)}))}}validateSingleFile(e){let{maxFileSize:t,minFileSize:i,allowedFileTypes:o}=this.getOpts().restrictions;if(o&&!o.some(n=>n.includes("/")?e.type?(0,ll.default)(e.type.replace(/;.*?$/,""),n):!1:n[0]==="."&&e.extension?e.extension.toLowerCase()===n.slice(1).toLowerCase():!1)){let n=o.join(", ");throw new Ue(this.getI18n()("youCanOnlyUploadFileTypes",{types:n}),{file:e})}if(t&&e.size!=null&&e.size>t){var s;throw new Ue(this.getI18n()("exceedsSize",{size:(0,Er.default)(t),file:(s=e.name)!=null?s:this.getI18n()("unnamed")}),{file:e})}if(i&&e.size!=null&&e.size<i)throw new Ue(this.getI18n()("inferiorSize",{size:(0,Er.default)(i)}),{file:e})}validate(e,t){t.forEach(i=>{this.validateSingleFile(i)}),this.validateAggregateRestrictions(e,t)}validateMinNumberOfFiles(e){let{minNumberOfFiles:t}=this.getOpts().restrictions;if(t&&Object.keys(e).length<t)throw new Ue(this.getI18n()("youHaveToAtLeastSelectX",{smart_count:t}))}getMissingRequiredMetaFields(e){var t;let i=new Ue(this.getI18n()("missingRequiredMetaFieldOnFile",{fileName:(t=e.name)!=null?t:this.getI18n()("unnamed")})),{requiredMetaFields:o}=this.getOpts().restrictions,s=[];for(let a of o)(!Object.hasOwn(e.meta,a)||e.meta[a]==="")&&s.push(a);return{missingFields:s,error:i}}};var dl={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},aggregateExceedsSize:"You selected %{size} of files, but maximum allowed size is %{sizeAllowed}",exceedsSize:"%{file} exceeds maximum allowed size of %{size}",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noMoreFilesAllowed:"Cannot add more files",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",authAborted:"Authentication aborted",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",noSearchResults:"Unfortunately, there are no results for this search",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",logIn:"Log in",pickFiles:"Pick files",pickPhotos:"Pick photos",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",loadedXFiles:"Loaded %{numFiles} files",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",signInWithGoogle:"Sign in with Google",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",search:"Search",resetSearch:"Reset search",emptyFolderAdded:"No files were added from empty folder",addedNumFiles:"Added %{numFiles} file(s)",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"},additionalRestrictionsFailed:"%{count} additional restrictions were not fulfilled",unnamed:"Unnamed",pleaseWait:"Please wait"}};function I(r,e){if(!{}.hasOwnProperty.call(r,e))throw new TypeError("attempted to use private field on non-instance");return r}var Tu=0;function he(r){return"__private_"+Tu+++"_"+r}var Eu={version:"4.3.1"},Li={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null},Fe=he("plugins"),ke=he("restricter"),Ar=he("storeUnsubscribe"),ht=he("emitter"),Ct=he("preProcessors"),Bt=he("uploaders"),mt=he("postProcessors"),Le=he("informAndEmit"),Nr=he("checkRequiredMetaFieldsOnFile"),Go=he("checkRequiredMetaFields"),Or=he("assertNewUploadAllowed"),Yo=he("transformFile"),zr=he("startIfAutoProceed"),Ur=he("checkAndUpdateFileState"),Jo=he("handleUploadProgress"),Mr=he("updateTotalProgress"),gt=he("updateTotalProgressThrottled"),Qo=he("calculateTotalProgress"),Ko=he("addListeners"),Qe=he("updateOnlineStatus"),Rr=he("requestClientById"),ct=he("createUpload"),Xo=he("getUpload"),Tt=he("removeUpload"),ft=he("runUpload"),ji=class r{constructor(e){Object.defineProperty(this,ft,{value:Wu}),Object.defineProperty(this,Tt,{value:Vu}),Object.defineProperty(this,Xo,{value:qu}),Object.defineProperty(this,ct,{value:$u}),Object.defineProperty(this,Ko,{value:Hu}),Object.defineProperty(this,Qo,{value:ju}),Object.defineProperty(this,Mr,{value:Lu}),Object.defineProperty(this,Ur,{value:Nu}),Object.defineProperty(this,zr,{value:Ru}),Object.defineProperty(this,Yo,{value:Mu}),Object.defineProperty(this,Or,{value:Uu}),Object.defineProperty(this,Go,{value:zu}),Object.defineProperty(this,Nr,{value:Ou}),Object.defineProperty(this,Le,{value:Au}),Object.defineProperty(this,Fe,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,ke,{writable:!0,value:void 0}),Object.defineProperty(this,Ar,{writable:!0,value:void 0}),Object.defineProperty(this,ht,{writable:!0,value:(0,ul.default)()}),Object.defineProperty(this,Ct,{writable:!0,value:new Set}),Object.defineProperty(this,Bt,{writable:!0,value:new Set}),Object.defineProperty(this,mt,{writable:!0,value:new Set}),this.scheduledAutoProceed=null,this.wasOffline=!1,Object.defineProperty(this,Jo,{writable:!0,value:(o,s)=>{let a=o?this.getFile(o.id):void 0;if(o==null||!a){this.log(`Not setting progress for a file that has been removed: ${o?.id}`);return}if(a.progress.percentage===100){this.log(`Not setting progress for a file that has been already uploaded: ${o.id}`);return}let n={bytesTotal:s.bytesTotal,percentage:s.bytesTotal!=null&&Number.isFinite(s.bytesTotal)&&s.bytesTotal>0?Math.round(s.bytesUploaded/s.bytesTotal*100):void 0};a.progress.uploadStarted!=null?this.setFileState(o.id,{progress:O(m(m({},a.progress),n),{bytesUploaded:s.bytesUploaded})}):this.setFileState(o.id,{progress:m(m({},a.progress),n)}),I(this,gt)[gt]()}}),Object.defineProperty(this,gt,{writable:!0,value:(0,hl.default)(()=>I(this,Mr)[Mr](),500,{leading:!0,trailing:!0})}),Object.defineProperty(this,Qe,{writable:!0,value:this.updateOnlineStatus.bind(this)}),Object.defineProperty(this,Rr,{writable:!0,value:new Map}),this.defaultLocale=dl;let t={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:pl,meta:{},onBeforeFileAdded:(o,s)=>!Object.hasOwn(s,o.id),onBeforeUpload:o=>o,store:new Jn,logger:el,infoTimeout:5e3},i=m(m({},t),e);this.opts=O(m({},i),{restrictions:m(m({},t.restrictions),e&&e.restrictions)}),e&&e.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e&&e.debug&&(this.opts.logger=tl),this.log(`Using Core v${r.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState(O(m({},Li),{plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:qo(),individualCancellation:!0,resumableUploads:!1},meta:m({},this.opts.meta),info:[]})),I(this,ke)[ke]=new Ni(()=>this.opts,()=>this.i18n),I(this,Ar)[Ar]=this.store.subscribe((o,s,a)=>{this.emit("state-update",o,s,a),this.updateAll(s)}),this.opts.debug&&typeof window<"u"&&(window[this.opts.id]=this),I(this,Ko)[Ko]()}emit(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];I(this,ht)[ht].emit(e,...i)}on(e,t){return I(this,ht)[ht].on(e,t),this}once(e,t){return I(this,ht)[ht].once(e,t),this}off(e,t){return I(this,ht)[ht].off(e,t),this}updateAll(e){this.iteratePlugins(t=>{t.update(e)})}setState(e){this.store.setState(e)}getState(){return this.store.getState()}patchFilesState(e){let t=this.getState().files;this.setState({files:m(m({},t),Object.fromEntries(Object.entries(e).map(i=>{let[o,s]=i;return[o,m(m({},t[o]),s)]})))})}setFileState(e,t){if(!this.getState().files[e])throw new Error(`Can\u2019t set state for ${e} (the file could have been removed)`);this.patchFilesState({[e]:t})}i18nInit(){let e=i=>this.log(`Missing i18n string: ${i}`,"error"),t=new ar([this.defaultLocale,this.opts.locale],{onMissingKey:e});this.i18n=t.translate.bind(t),this.i18nArray=t.translateArray.bind(t),this.locale=t.locale}setOptions(e){this.opts=O(m(m({},this.opts),e),{restrictions:m(m({},this.opts.restrictions),e?.restrictions)}),e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins(t=>{t.setOptions(e)}),this.setState(void 0)}resetProgress(){let e={percentage:0,bytesUploaded:!1,uploadComplete:!1,uploadStarted:null},t=m({},this.getState().files),i=Object.create(null);Object.keys(t).forEach(o=>{i[o]=O(m({},t[o]),{progress:m(m({},t[o].progress),e),tus:void 0,transloadit:void 0})}),this.setState(m({files:i},Li))}clear(){let{capabilities:e,currentUploads:t}=this.getState();if(Object.keys(t).length>0&&!e.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");this.setState(O(m({},Li),{files:{}}))}addPreProcessor(e){I(this,Ct)[Ct].add(e)}removePreProcessor(e){return I(this,Ct)[Ct].delete(e)}addPostProcessor(e){I(this,mt)[mt].add(e)}removePostProcessor(e){return I(this,mt)[mt].delete(e)}addUploader(e){I(this,Bt)[Bt].add(e)}removeUploader(e){return I(this,Bt)[Bt].delete(e)}setMeta(e){let t=m(m({},this.getState().meta),e),i=m({},this.getState().files);Object.keys(i).forEach(o=>{i[o]=O(m({},i[o]),{meta:m(m({},i[o].meta),e)})}),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:i})}setFileMeta(e,t){let i=m({},this.getState().files);if(!i[e]){this.log(`Was trying to set metadata for a file that has been removed: ${e}`);return}let o=m(m({},i[e].meta),t);i[e]=O(m({},i[e]),{meta:o}),this.setState({files:i})}getFile(e){return this.getState().files[e]}getFiles(){let{files:e}=this.getState();return Object.values(e)}getFilesByIds(e){return e.map(t=>this.getFile(t))}getObjectOfFilesPerState(){let{files:e,totalProgress:t,error:i}=this.getState(),o=Object.values(e),s=[],a=[],n=[],l=[],d=[],h=[],u=[],g=[],y=[];for(let w of o){let{progress:B}=w;!B.uploadComplete&&B.uploadStarted&&(s.push(w),w.isPaused||g.push(w)),B.uploadStarted||a.push(w),(B.uploadStarted||B.preprocess||B.postprocess)&&n.push(w),B.uploadStarted&&l.push(w),w.isPaused&&d.push(w),B.uploadComplete&&h.push(w),w.error&&u.push(w),(B.preprocess||B.postprocess)&&y.push(w)}return{newFiles:a,startedFiles:n,uploadStartedFiles:l,pausedFiles:d,completeFiles:h,erroredFiles:u,inProgressFiles:s,inProgressNotPausedFiles:g,processingFiles:y,isUploadStarted:l.length>0,isAllComplete:t===100&&h.length===o.length&&y.length===0,isAllErrored:!!i&&u.length===o.length,isAllPaused:s.length!==0&&d.length===s.length,isUploadInProgress:s.length>0,isSomeGhost:o.some(w=>w.isGhost)}}validateRestrictions(e,t){t===void 0&&(t=this.getFiles());try{I(this,ke)[ke].validate(t,[e])}catch(i){return i}return null}validateSingleFile(e){try{I(this,ke)[ke].validateSingleFile(e)}catch(t){return t.message}return null}validateAggregateRestrictions(e){let t=this.getFiles();try{I(this,ke)[ke].validateAggregateRestrictions(t,e)}catch(i){return i.message}return null}checkIfFileAlreadyExists(e){let{files:t}=this.getState();return!!(t[e]&&!t[e].isGhost)}addFile(e){I(this,Or)[Or](e);let{nextFilesState:t,validFilesToAdd:i,errors:o}=I(this,Ur)[Ur]([e]),s=o.filter(n=>n.isRestriction);if(I(this,Le)[Le](s),o.length>0)throw o[0];this.setState({files:t});let[a]=i;return this.emit("file-added",a),this.emit("files-added",i),this.log(`Added file: ${a.name}, ${a.id}, mime type: ${a.type}`),I(this,zr)[zr](),a.id}addFiles(e){I(this,Or)[Or]();let{nextFilesState:t,validFilesToAdd:i,errors:o}=I(this,Ur)[Ur](e),s=o.filter(n=>n.isRestriction);I(this,Le)[Le](s);let a=o.filter(n=>!n.isRestriction);if(a.length>0){let n=`Multiple errors occurred while adding files:
|
|
11
|
+
`;if(a.forEach(l=>{n+=`
|
|
12
|
+
* ${l.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:a.length}),details:n},"error",this.opts.infoTimeout),typeof AggregateError=="function")throw new AggregateError(a,n);{let l=new Error(n);throw l.errors=a,l}}this.setState({files:t}),i.forEach(n=>{this.emit("file-added",n)}),this.emit("files-added",i),i.length>5?this.log(`Added batch of ${i.length} files`):Object.values(i).forEach(n=>{this.log(`Added file: ${n.name}
|
|
13
|
+
id: ${n.id}
|
|
14
|
+
type: ${n.type}`)}),i.length>0&&I(this,zr)[zr]()}removeFiles(e){let{files:t,currentUploads:i}=this.getState(),o=m({},t),s=m({},i),a=Object.create(null);e.forEach(h=>{t[h]&&(a[h]=t[h],delete o[h])});function n(h){return a[h]===void 0}Object.keys(s).forEach(h=>{let u=i[h].fileIDs.filter(n);if(u.length===0){delete s[h];return}let{capabilities:g}=this.getState();if(u.length!==i[h].fileIDs.length&&!g.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");s[h]=O(m({},i[h]),{fileIDs:u})});let l={currentUploads:s,files:o};Object.keys(o).length===0&&(l.allowNewUpload=!0,l.error=null,l.recoveredState=null),this.setState(l),I(this,gt)[gt]();let d=Object.keys(a);d.forEach(h=>{this.emit("file-removed",a[h])}),d.length>5?this.log(`Removed ${d.length} files`):this.log(`Removed files: ${d.join(", ")}`)}removeFile(e){this.removeFiles([e])}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).progress.uploadComplete)return;let t=this.getFile(e),o=!(t.isPaused||!1);return this.setFileState(e,{isPaused:o}),this.emit("upload-pause",t,o),o}pauseAll(){let e=m({},this.getState().files);Object.keys(e).filter(i=>!e[i].progress.uploadComplete&&e[i].progress.uploadStarted).forEach(i=>{let o=O(m({},e[i]),{isPaused:!0});e[i]=o}),this.setState({files:e}),this.emit("pause-all")}resumeAll(){let e=m({},this.getState().files);Object.keys(e).filter(i=>!e[i].progress.uploadComplete&&e[i].progress.uploadStarted).forEach(i=>{let o=O(m({},e[i]),{isPaused:!1,error:null});e[i]=o}),this.setState({files:e}),this.emit("resume-all")}retryAll(){let e=m({},this.getState().files),t=Object.keys(e).filter(o=>e[o].error);if(t.forEach(o=>{let s=O(m({},e[o]),{isPaused:!1,error:null});e[o]=s}),this.setState({files:e,error:null}),this.emit("retry-all",Object.values(e)),t.length===0)return Promise.resolve({successful:[],failed:[]});let i=I(this,ct)[ct](t,{forceAllowNewUpload:!0});return I(this,ft)[ft](i)}cancelAll(){this.emit("cancel-all");let{files:e}=this.getState(),t=Object.keys(e);t.length&&this.removeFiles(t),this.setState(Li)}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",this.getFile(e));let t=I(this,ct)[ct]([e],{forceAllowNewUpload:!0});return I(this,ft)[ft](t)}logout(){this.iteratePlugins(e=>{var t;(t=e.provider)==null||t.logout==null||t.logout()})}[Symbol.for("uppy test: updateTotalProgress")](){return I(this,Mr)[Mr]()}updateOnlineStatus(){var e;((e=window.navigator.onLine)!=null?e:!0)?(this.emit("is-online"),this.wasOffline&&(this.emit("back-online"),this.info(this.i18n("connectedToInternet"),"success",3e3),this.wasOffline=!1)):(this.emit("is-offline"),this.info(this.i18n("noInternetConnection"),"error",0),this.wasOffline=!0)}getID(){return this.opts.id}use(e){if(typeof e!="function"){let l=`Expected a plugin class, but got ${e===null?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`;throw new TypeError(l)}for(var t=arguments.length,i=new Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];let s=new e(this,...i),a=s.id;if(!a)throw new Error("Your plugin must have an id");if(!s.type)throw new Error("Your plugin must have a type");let n=this.getPlugin(a);if(n){let l=`Already found a plugin named '${n.id}'. Tried to use: '${a}'.
|
|
15
|
+
Uppy plugins must have unique \`id\` options.`;throw new Error(l)}return e.VERSION&&this.log(`Using ${a} v${e.VERSION}`),s.type in I(this,Fe)[Fe]?I(this,Fe)[Fe][s.type].push(s):I(this,Fe)[Fe][s.type]=[s],s.install(),this.emit("plugin-added",s),this}getPlugin(e){for(let t of Object.values(I(this,Fe)[Fe])){let i=t.find(o=>o.id===e);if(i!=null)return i}}[Symbol.for("uppy test: getPlugins")](e){return I(this,Fe)[Fe][e]}iteratePlugins(e){Object.values(I(this,Fe)[Fe]).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();let t=I(this,Fe)[Fe][e.type],i=t.findIndex(a=>a.id===e.id);i!==-1&&t.splice(i,1);let o=this.getState(),s={plugins:O(m({},o.plugins),{[e.id]:void 0})};this.setState(s)}destroy(){this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll(),I(this,Ar)[Ar](),this.iteratePlugins(e=>{this.removePlugin(e)}),typeof window<"u"&&window.removeEventListener&&(window.removeEventListener("online",I(this,Qe)[Qe]),window.removeEventListener("offline",I(this,Qe)[Qe]))}hideInfo(){let{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,t,i){t===void 0&&(t="info"),i===void 0&&(i=3e3);let o=typeof e=="object";this.setState({info:[...this.getState().info,{type:t,message:o?e.message:e,details:o?e.details:null}]}),setTimeout(()=>this.hideInfo(),i),this.emit("info-visible")}log(e,t){let{logger:i}=this.opts;switch(t){case"error":i.error(e);break;case"warning":i.warn(e);break;default:i.debug(e);break}}registerRequestClient(e,t){I(this,Rr)[Rr].set(e,t)}getRequestClientForFile(e){if(!e.remote)throw new Error(`Tried to get RequestClient for a non-remote file ${e.id}`);let t=I(this,Rr)[Rr].get(e.remote.requestClientId);if(t==null)throw new Error(`requestClientId "${e.remote.requestClientId}" not registered for file "${e.id}"`);return t}restore(e){return this.log(`Core: attempting to restore upload "${e}"`),this.getState().currentUploads[e]?I(this,ft)[ft](e):(I(this,Tt)[Tt](e),Promise.reject(new Error("Nonexistent upload")))}[Symbol.for("uppy test: createUpload")](){return I(this,ct)[ct](...arguments)}addResultData(e,t){if(!I(this,Xo)[Xo](e)){this.log(`Not setting result for an upload that has been removed: ${e}`);return}let{currentUploads:i}=this.getState(),o=O(m({},i[e]),{result:m(m({},i[e].result),t)});this.setState({currentUploads:O(m({},i),{[e]:o})})}upload(){var e;(e=I(this,Fe)[Fe].uploader)!=null&&e.length||this.log("No uploader type plugins are used","warning");let{files:t}=this.getState(),i=this.opts.onBeforeUpload(t);return i===!1?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(i&&typeof i=="object"&&(t=i,this.setState({files:t})),Promise.resolve().then(()=>I(this,ke)[ke].validateMinNumberOfFiles(t)).catch(o=>{throw I(this,Le)[Le]([o]),o}).then(()=>{if(!I(this,Go)[Go](t))throw new Ue(this.i18n("missingRequiredMetaField"))}).catch(o=>{throw o}).then(()=>{let{currentUploads:o}=this.getState(),s=Object.values(o).flatMap(l=>l.fileIDs),a=[];Object.keys(t).forEach(l=>{let d=this.getFile(l);!d.progress.uploadStarted&&s.indexOf(l)===-1&&a.push(d.id)});let n=I(this,ct)[ct](a);return I(this,ft)[ft](n)}).catch(o=>{throw this.emit("error",o),this.log(o,"error"),o}))}};function Au(r){for(let s of r)s.isRestriction?this.emit("restriction-failed",s.file,s):this.emit("error",s,s.file),this.log(s,"warning");let e=r.filter(s=>s.isUserFacing),t=4,i=e.slice(0,t),o=e.slice(t);i.forEach(s=>{let{message:a,details:n=""}=s;this.info({message:a,details:n},"error",this.opts.infoTimeout)}),o.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:o.length})})}function Ou(r){let{missingFields:e,error:t}=I(this,ke)[ke].getMissingRequiredMetaFields(r);return e.length>0?(this.setFileState(r.id,{missingRequiredMetaFields:e}),this.log(t.message),this.emit("restriction-failed",r,t),!1):!0}function zu(r){let e=!0;for(let t of Object.values(r))I(this,Nr)[Nr](t)||(e=!1);return e}function Uu(r){let{allowNewUpload:e}=this.getState();if(e===!1){let t=new Ue(this.i18n("noMoreFilesAllowed"),{file:r});throw I(this,Le)[Le]([t]),t}}function Mu(r){let e=r instanceof File?{name:r.name,type:r.type,size:r.size,data:r}:r,t=Br(e),i=Vo(t,e),o=st(i).extension,s=Ri(e,this.getID()),a=e.meta||{};a.name=i,a.type=t;let n=Number.isFinite(e.data.size)?e.data.size:null;return{source:e.source||"",id:s,name:i,extension:o||"",meta:m(m({},this.getState().meta),a),type:t,data:e.data,progress:{percentage:0,bytesUploaded:!1,bytesTotal:n,uploadComplete:!1,uploadStarted:null},size:n,isGhost:!1,isRemote:e.isRemote||!1,remote:e.remote,preview:e.preview}}function Ru(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(r=>{r.isRestriction||this.log(r.stack||r.message||r)})},4))}function Nu(r){let{files:e}=this.getState(),t=m({},e),i=[],o=[];for(let n of r)try{var s;let l=I(this,Yo)[Yo](n),d=(s=e[l.id])==null?void 0:s.isGhost;if(d){let u=e[l.id];l=O(m({},u),{isGhost:!1,data:n.data}),this.log(`Replaced the blob in the restored ghost file: ${l.name}, ${l.id}`)}let h=this.opts.onBeforeFileAdded(l,t);if(!h&&this.checkIfFileAlreadyExists(l.id)){var a;throw new Ue(this.i18n("noDuplicates",{fileName:(a=l.name)!=null?a:this.i18n("unnamed")}),{file:n})}if(h===!1&&!d)throw new Ue("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:n});typeof h=="object"&&h!==null&&(l=h),I(this,ke)[ke].validateSingleFile(l),t[l.id]=l,i.push(l)}catch(l){o.push(l)}try{I(this,ke)[ke].validateAggregateRestrictions(Object.values(e),i)}catch(n){return o.push(n),{nextFilesState:e,validFilesToAdd:[],errors:o}}return{nextFilesState:t,validFilesToAdd:i,errors:o}}function Lu(){var r,e;let t=I(this,Qo)[Qo](),i=null;t!=null&&(i=Math.round(t*100),i>100?i=100:i<0&&(i=0)),this.emit("progress",(r=i)!=null?r:0),this.setState({totalProgress:(e=i)!=null?e:0})}function ju(){let e=this.getFiles().filter(n=>n.progress.uploadStarted||n.progress.preprocess||n.progress.postprocess);if(e.length===0)return 0;if(e.every(n=>n.progress.uploadComplete))return 1;let t=n=>n.progress.bytesTotal!=null&&n.progress.bytesTotal!==0,i=e.filter(t),o=e.filter(n=>!t(n));if(i.every(n=>n.progress.uploadComplete)&&o.length>0&&!o.every(n=>n.progress.uploadComplete))return null;let s=i.reduce((n,l)=>{var d;return n+((d=l.progress.bytesTotal)!=null?d:0)},0),a=i.reduce((n,l)=>n+(l.progress.bytesUploaded||0),0);return s===0?0:a/s}function Hu(){let r=(i,o,s)=>{let a=i.message||"Unknown error";i.details&&(a+=` ${i.details}`),this.setState({error:a}),o!=null&&o.id in this.getState().files&&this.setFileState(o.id,{error:a,response:s})};this.on("error",r),this.on("upload-error",(i,o,s)=>{if(r(o,i,s),typeof o=="object"&&o.message){var a;this.log(o.message,"error");let n=new Error(this.i18n("failedToUpload",{file:(a=i?.name)!=null?a:""}));n.isUserFacing=!0,n.details=o.message,o.details&&(n.details+=` ${o.details}`),I(this,Le)[Le]([n])}else I(this,Le)[Le]([o])});let e=null;this.on("upload-stalled",(i,o)=>{let{message:s}=i,a=o.map(n=>n.meta.name).join(", ");e||(this.info({message:s,details:a},"warning",this.opts.infoTimeout),e=setTimeout(()=>{e=null},this.opts.infoTimeout)),this.log(`${s} ${a}`.trim(),"warning")}),this.on("upload",()=>{this.setState({error:null})});let t=i=>{let o=i.filter(a=>{let n=a!=null&&this.getFile(a.id);return n||this.log(`Not setting progress for a file that has been removed: ${a?.id}`),n}),s=Object.fromEntries(o.map(a=>[a.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,bytesUploaded:0,bytesTotal:a.size}}]));this.patchFilesState(s)};this.on("upload-start",t),this.on("upload-progress",I(this,Jo)[Jo]),this.on("upload-success",(i,o)=>{if(i==null||!this.getFile(i.id)){this.log(`Not setting progress for a file that has been removed: ${i?.id}`);return}let s=this.getFile(i.id).progress;this.setFileState(i.id,{progress:O(m({},s),{postprocess:I(this,mt)[mt].size>0?{mode:"indeterminate"}:void 0,uploadComplete:!0,percentage:100,bytesUploaded:s.bytesTotal}),response:o,uploadURL:o.uploadURL,isPaused:!1}),i.size==null&&this.setFileState(i.id,{size:o.bytesUploaded||s.bytesTotal}),I(this,gt)[gt]()}),this.on("preprocess-progress",(i,o)=>{if(i==null||!this.getFile(i.id)){this.log(`Not setting progress for a file that has been removed: ${i?.id}`);return}this.setFileState(i.id,{progress:O(m({},this.getFile(i.id).progress),{preprocess:o})})}),this.on("preprocess-complete",i=>{if(i==null||!this.getFile(i.id)){this.log(`Not setting progress for a file that has been removed: ${i?.id}`);return}let o=m({},this.getState().files);o[i.id]=O(m({},o[i.id]),{progress:m({},o[i.id].progress)}),delete o[i.id].progress.preprocess,this.setState({files:o})}),this.on("postprocess-progress",(i,o)=>{if(i==null||!this.getFile(i.id)){this.log(`Not setting progress for a file that has been removed: ${i?.id}`);return}this.setFileState(i.id,{progress:O(m({},this.getState().files[i.id].progress),{postprocess:o})})}),this.on("postprocess-complete",i=>{if(i==null||!this.getFile(i.id)){this.log(`Not setting progress for a file that has been removed: ${i?.id}`);return}let o=m({},this.getState().files);o[i.id]=O(m({},o[i.id]),{progress:m({},o[i.id].progress)}),delete o[i.id].progress.postprocess,this.setState({files:o})}),this.on("restored",()=>{I(this,gt)[gt]()}),this.on("dashboard:file-edit-complete",i=>{i&&I(this,Nr)[Nr](i)}),typeof window<"u"&&window.addEventListener&&(window.addEventListener("online",I(this,Qe)[Qe]),window.addEventListener("offline",I(this,Qe)[Qe]),setTimeout(I(this,Qe)[Qe],3e3))}function $u(r,e){e===void 0&&(e={});let{forceAllowNewUpload:t=!1}=e,{allowNewUpload:i,currentUploads:o}=this.getState();if(!i&&!t)throw new Error("Cannot create a new upload: already uploading.");let s=Ft();return this.emit("upload",s,this.getFilesByIds(r)),this.setState({allowNewUpload:this.opts.allowMultipleUploadBatches!==!1&&this.opts.allowMultipleUploads!==!1,currentUploads:O(m({},o),{[s]:{fileIDs:r,step:0,result:{}}})}),s}function qu(r){let{currentUploads:e}=this.getState();return e[r]}function Vu(r){let e=m({},this.getState().currentUploads);delete e[r],this.setState({currentUploads:e})}function Wu(r){return _(this,null,function*(){let e=()=>{let{currentUploads:s}=this.getState();return s[r]},t=e(),i=[...I(this,Ct)[Ct],...I(this,Bt)[Bt],...I(this,mt)[mt]];try{for(let s=t.step||0;s<i.length&&t;s++){let a=i[s];this.setState({currentUploads:O(m({},this.getState().currentUploads),{[r]:O(m({},t),{step:s})})});let{fileIDs:n}=t;yield a(n,r),t=e()}}catch(s){throw I(this,Tt)[Tt](r),s}if(t){t.fileIDs.forEach(l=>{let d=this.getFile(l);d&&d.progress.postprocess&&this.emit("postprocess-complete",d)});let s=t.fileIDs.map(l=>this.getFile(l)),a=s.filter(l=>!l.error),n=s.filter(l=>l.error);this.addResultData(r,{successful:a,failed:n,uploadID:r}),t=e()}let o;return t&&(o=t.result,this.emit("complete",o),I(this,Tt)[Tt](r)),o==null&&this.log(`Not setting result for an upload that has been removed: ${r}`),o})}ji.VERSION=Eu.version;var Lr=ji;var $r,pe,yl,Gu,Et,cl,bl,Zo,vl,rs,es,ts,Ku,Hr={},wl=[],Xu=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,qi=Array.isArray;function yt(r,e){for(var t in e)r[t]=e[t];return r}function is(r){r&&r.parentNode&&r.parentNode.removeChild(r)}function p(r,e,t){var i,o,s,a={};for(s in e)s=="key"?i=e[s]:s=="ref"?o=e[s]:a[s]=e[s];if(arguments.length>2&&(a.children=arguments.length>3?$r.call(arguments,2):t),typeof r=="function"&&r.defaultProps!=null)for(s in r.defaultProps)a[s]===void 0&&(a[s]=r.defaultProps[s]);return jr(r,a,i,o,null)}function jr(r,e,t,i,o){var s={type:r,props:e,key:t,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++yl,__i:-1,__u:0};return o==null&&pe.vnode!=null&&pe.vnode(s),s}function xl(){return{current:null}}function je(r){return r.children}function Me(r,e){this.props=r,this.context=e}function lr(r,e){if(e==null)return r.__?lr(r.__,r.__i+1):null;for(var t;e<r.__k.length;e++)if((t=r.__k[e])!=null&&t.__e!=null)return t.__e;return typeof r.type=="function"?lr(r):null}function Pl(r){var e,t;if((r=r.__)!=null&&r.__c!=null){for(r.__e=r.__c.base=null,e=0;e<r.__k.length;e++)if((t=r.__k[e])!=null&&t.__e!=null){r.__e=r.__c.base=t.__e;break}return Pl(r)}}function fl(r){(!r.__d&&(r.__d=!0)&&Et.push(r)&&!$i.__r++||cl!==pe.debounceRendering)&&((cl=pe.debounceRendering)||bl)($i)}function $i(){var r,e,t,i,o,s,a,n;for(Et.sort(Zo);r=Et.shift();)r.__d&&(e=Et.length,i=void 0,s=(o=(t=r).__v).__e,a=[],n=[],t.__P&&((i=yt({},o)).__v=o.__v+1,pe.vnode&&pe.vnode(i),os(t.__P,i,o,t.__n,t.__P.namespaceURI,32&o.__u?[s]:null,a,s??lr(o),!!(32&o.__u),n),i.__v=o.__v,i.__.__k[i.__i]=i,kl(a,i,n),i.__e!=s&&Pl(i)),Et.length>e&&Et.sort(Zo));$i.__r=0}function Sl(r,e,t,i,o,s,a,n,l,d,h){var u,g,y,w,B,$,L=i&&i.__k||wl,j=e.length;for(l=Yu(t,e,L,l,j),u=0;u<j;u++)(y=t.__k[u])!=null&&(g=y.__i===-1?Hr:L[y.__i]||Hr,y.__i=u,$=os(r,y,g,o,s,a,n,l,d,h),w=y.__e,y.ref&&g.ref!=y.ref&&(g.ref&&ss(g.ref,null,y),h.push(y.ref,y.__c||w,y)),B==null&&w!=null&&(B=w),4&y.__u||g.__k===y.__k?l=Fl(y,l,r):typeof y.type=="function"&&$!==void 0?l=$:w&&(l=w.nextSibling),y.__u&=-7);return t.__e=B,l}function Yu(r,e,t,i,o){var s,a,n,l,d,h=t.length,u=h,g=0;for(r.__k=new Array(o),s=0;s<o;s++)(a=e[s])!=null&&typeof a!="boolean"&&typeof a!="function"?(l=s+g,(a=r.__k[s]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?jr(null,a,null,null,null):qi(a)?jr(je,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?jr(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=r,a.__b=r.__b+1,n=null,(d=a.__i=Ju(a,t,l,u))!==-1&&(u--,(n=t[d])&&(n.__u|=2)),n==null||n.__v===null?(d==-1&&g--,typeof a.type!="function"&&(a.__u|=4)):d!=l&&(d==l-1?g--:d==l+1?g++:(d>l?g--:g++,a.__u|=4))):r.__k[s]=null;if(u)for(s=0;s<h;s++)(n=t[s])!=null&&!(2&n.__u)&&(n.__e==i&&(i=lr(n)),_l(n,n));return i}function Fl(r,e,t){var i,o;if(typeof r.type=="function"){for(i=r.__k,o=0;i&&o<i.length;o++)i[o]&&(i[o].__=r,e=Fl(i[o],e,t));return e}r.__e!=e&&(e&&r.type&&!t.contains(e)&&(e=lr(r)),t.insertBefore(r.__e,e||null),e=r.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function at(r,e){return e=e||[],r==null||typeof r=="boolean"||(qi(r)?r.some(function(t){at(t,e)}):e.push(r)),e}function Ju(r,e,t,i){var o,s,a=r.key,n=r.type,l=e[t];if(l===null||l&&a==l.key&&n===l.type&&!(2&l.__u))return t;if(i>(l!=null&&!(2&l.__u)?1:0))for(o=t-1,s=t+1;o>=0||s<e.length;){if(o>=0){if((l=e[o])&&!(2&l.__u)&&a==l.key&&n===l.type)return o;o--}if(s<e.length){if((l=e[s])&&!(2&l.__u)&&a==l.key&&n===l.type)return s;s++}}return-1}function ml(r,e,t){e[0]=="-"?r.setProperty(e,t??""):r[e]=t==null?"":typeof t!="number"||Xu.test(e)?t:t+"px"}function Hi(r,e,t,i,o){var s;e:if(e=="style")if(typeof t=="string")r.style.cssText=t;else{if(typeof i=="string"&&(r.style.cssText=i=""),i)for(e in i)t&&e in t||ml(r.style,e,"");if(t)for(e in t)i&&t[e]===i[e]||ml(r.style,e,t[e])}else if(e[0]=="o"&&e[1]=="n")s=e!=(e=e.replace(vl,"$1")),e=e.toLowerCase()in r||e=="onFocusOut"||e=="onFocusIn"?e.toLowerCase().slice(2):e.slice(2),r.l||(r.l={}),r.l[e+s]=t,t?i?t.u=i.u:(t.u=rs,r.addEventListener(e,s?ts:es,s)):r.removeEventListener(e,s?ts:es,s);else{if(o=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in r)try{r[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!="-"?r.removeAttribute(e):r.setAttribute(e,e=="popover"&&t==1?"":t))}}function gl(r){return function(e){if(this.l){var t=this.l[e.type+r];if(e.t==null)e.t=rs++;else if(e.t<t.u)return;return t(pe.event?pe.event(e):e)}}}function os(r,e,t,i,o,s,a,n,l,d){var h,u,g,y,w,B,$,L,j,Z,G,V,c,f,v,k,C,T=e.type;if(e.constructor!==void 0)return null;128&t.__u&&(l=!!(32&t.__u),s=[n=e.__e=t.__e]),(h=pe.__b)&&h(e);e:if(typeof T=="function")try{if(L=e.props,j="prototype"in T&&T.prototype.render,Z=(h=T.contextType)&&i[h.__c],G=h?Z?Z.props.value:h.__:i,t.__c?$=(u=e.__c=t.__c).__=u.__E:(j?e.__c=u=new T(L,G):(e.__c=u=new Me(L,G),u.constructor=T,u.render=Zu),Z&&Z.sub(u),u.props=L,u.state||(u.state={}),u.context=G,u.__n=i,g=u.__d=!0,u.__h=[],u._sb=[]),j&&u.__s==null&&(u.__s=u.state),j&&T.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=yt({},u.__s)),yt(u.__s,T.getDerivedStateFromProps(L,u.__s))),y=u.props,w=u.state,u.__v=e,g)j&&T.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),j&&u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(j&&T.getDerivedStateFromProps==null&&L!==y&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(L,G),!u.__e&&(u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(L,u.__s,G)===!1||e.__v==t.__v)){for(e.__v!=t.__v&&(u.props=L,u.state=u.__s,u.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.some(function(q){q&&(q.__=e)}),V=0;V<u._sb.length;V++)u.__h.push(u._sb[V]);u._sb=[],u.__h.length&&a.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(L,u.__s,G),j&&u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(y,w,B)})}if(u.context=G,u.props=L,u.__P=r,u.__e=!1,c=pe.__r,f=0,j){for(u.state=u.__s,u.__d=!1,c&&c(e),h=u.render(u.props,u.state,u.context),v=0;v<u._sb.length;v++)u.__h.push(u._sb[v]);u._sb=[]}else do u.__d=!1,c&&c(e),h=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++f<25);u.state=u.__s,u.getChildContext!=null&&(i=yt(yt({},i),u.getChildContext())),j&&!g&&u.getSnapshotBeforeUpdate!=null&&(B=u.getSnapshotBeforeUpdate(y,w)),n=Sl(r,qi(k=h!=null&&h.type===je&&h.key==null?h.props.children:h)?k:[k],e,t,i,o,s,a,n,l,d),u.base=e.__e,e.__u&=-161,u.__h.length&&a.push(u),$&&(u.__E=u.__=null)}catch(q){if(e.__v=null,l||s!=null)if(q.then){for(e.__u|=l?160:128;n&&n.nodeType==8&&n.nextSibling;)n=n.nextSibling;s[s.indexOf(n)]=null,e.__e=n}else for(C=s.length;C--;)is(s[C]);else e.__e=t.__e,e.__k=t.__k;pe.__e(q,e,t)}else s==null&&e.__v==t.__v?(e.__k=t.__k,e.__e=t.__e):n=e.__e=Qu(t.__e,e,t,i,o,s,a,l,d);return(h=pe.diffed)&&h(e),128&e.__u?void 0:n}function kl(r,e,t){for(var i=0;i<t.length;i++)ss(t[i],t[++i],t[++i]);pe.__c&&pe.__c(e,r),r.some(function(o){try{r=o.__h,o.__h=[],r.some(function(s){s.call(o)})}catch(s){pe.__e(s,o.__v)}})}function Qu(r,e,t,i,o,s,a,n,l){var d,h,u,g,y,w,B,$=t.props,L=e.props,j=e.type;if(j=="svg"?o="http://www.w3.org/2000/svg":j=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),s!=null){for(d=0;d<s.length;d++)if((y=s[d])&&"setAttribute"in y==!!j&&(j?y.localName==j:y.nodeType==3)){r=y,s[d]=null;break}}if(r==null){if(j==null)return document.createTextNode(L);r=document.createElementNS(o,j,L.is&&L),n&&(pe.__m&&pe.__m(e,s),n=!1),s=null}if(j===null)$===L||n&&r.data===L||(r.data=L);else{if(s=s&&$r.call(r.childNodes),$=t.props||Hr,!n&&s!=null)for($={},d=0;d<r.attributes.length;d++)$[(y=r.attributes[d]).name]=y.value;for(d in $)if(y=$[d],d!="children"){if(d=="dangerouslySetInnerHTML")u=y;else if(!(d in L)){if(d=="value"&&"defaultValue"in L||d=="checked"&&"defaultChecked"in L)continue;Hi(r,d,null,y,o)}}for(d in L)y=L[d],d=="children"?g=y:d=="dangerouslySetInnerHTML"?h=y:d=="value"?w=y:d=="checked"?B=y:n&&typeof y!="function"||$[d]===y||Hi(r,d,y,$[d],o);if(h)n||u&&(h.__html===u.__html||h.__html===r.innerHTML)||(r.innerHTML=h.__html),e.__k=[];else if(u&&(r.innerHTML=""),Sl(r,qi(g)?g:[g],e,t,i,j=="foreignObject"?"http://www.w3.org/1999/xhtml":o,s,a,s?s[0]:t.__k&&lr(t,0),n,l),s!=null)for(d=s.length;d--;)is(s[d]);n||(d="value",j=="progress"&&w==null?r.removeAttribute("value"):w!==void 0&&(w!==r[d]||j=="progress"&&!w||j=="option"&&w!==$[d])&&Hi(r,d,w,$[d],o),d="checked",B!==void 0&&B!==r[d]&&Hi(r,d,B,$[d],o))}return r}function ss(r,e,t){try{if(typeof r=="function"){var i=typeof r.__u=="function";i&&r.__u(),i&&e==null||(r.__u=r(e))}else r.current=e}catch(o){pe.__e(o,t)}}function _l(r,e,t){var i,o;if(pe.unmount&&pe.unmount(r),(i=r.ref)&&(i.current&&i.current!==r.__e||ss(i,null,e)),(i=r.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(s){pe.__e(s,e)}i.base=i.__P=null}if(i=r.__k)for(o=0;o<i.length;o++)i[o]&&_l(i[o],e,t||typeof r.type!="function");t||is(r.__e),r.__c=r.__=r.__e=void 0}function Zu(r,e,t){return this.constructor(r,t)}function as(r,e,t){var i,o,s,a;e==document&&(e=document.documentElement),pe.__&&pe.__(r,e),o=(i=typeof t=="function")?null:t&&t.__k||e.__k,s=[],a=[],os(e,r=(!i&&t||e).__k=p(je,null,[r]),o||Hr,Hr,e.namespaceURI,!i&&t?[t]:o?null:e.firstChild?$r.call(e.childNodes):null,s,!i&&t?t:o?o.__e:e.firstChild,i,a),kl(s,r,a)}function Vi(r,e,t){var i,o,s,a,n=yt({},r.props);for(s in r.type&&r.type.defaultProps&&(a=r.type.defaultProps),e)s=="key"?i=e[s]:s=="ref"?o=e[s]:n[s]=e[s]===void 0&&a!==void 0?a[s]:e[s];return arguments.length>2&&(n.children=arguments.length>3?$r.call(arguments,2):t),jr(r.type,n,i||r.key,o||r.ref,null)}$r=wl.slice,pe={__e:function(r,e,t,i){for(var o,s,a;e=e.__;)if((o=e.__c)&&!o.__)try{if((s=o.constructor)&&s.getDerivedStateFromError!=null&&(o.setState(s.getDerivedStateFromError(r)),a=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(r,i||{}),a=o.__d),a)return o.__E=o}catch(n){r=n}throw r}},yl=0,Gu=function(r){return r!=null&&r.constructor==null},Me.prototype.setState=function(r,e){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=yt({},this.state),typeof r=="function"&&(r=r(yt({},t),this.props)),r&&yt(t,r),r!=null&&this.__v&&(e&&this._sb.push(e),fl(this))},Me.prototype.forceUpdate=function(r){this.__v&&(this.__e=!0,r&&this.__h.push(r),fl(this))},Me.prototype.render=je,Et=[],bl=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Zo=function(r,e){return r.__v.__b-e.__v.__b},$i.__r=0,vl=/(PointerCapture)$|Capture$/i,rs=0,es=gl(!1),ts=gl(!0),Ku=0;function qr(r){return typeof r!="object"||r===null||!("nodeType"in r)?!1:r.nodeType===Node.ELEMENT_NODE}function eh(r,e){return e===void 0&&(e=document),typeof r=="string"?e.querySelector(r):qr(r)?r:null}var Il=eh;function th(r){for(var e;r&&!r.dir;)r=r.parentNode;return(e=r)==null?void 0:e.dir}var Wi=th;var At=class{constructor(e,t){this.uppy=e,this.opts=t??{}}getPluginState(){let{plugins:e}=this.uppy.getState();return e?.[this.id]||{}}setPluginState(e){let{plugins:t}=this.uppy.getState();this.uppy.setState({plugins:O(m({},t),{[this.id]:m(m({},t[this.id]),e)})})}setOptions(e){this.opts=m(m({},this.opts),e),this.setPluginState(void 0),this.i18nInit()}i18nInit(){let e=new ar([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.setPluginState(void 0)}addTarget(e){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}update(e){}afterUpdate(){}};function Dl(r,e){if(!{}.hasOwnProperty.call(r,e))throw new TypeError("attempted to use private field on non-instance");return r}var rh=0;function ih(r){return"__private_"+rh+++"_"+r}function oh(r){let e=null,t;return function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return t=o,e||(e=Promise.resolve().then(()=>(e=null,r(...t)))),e}}var Vr=ih("updateUI"),ns=class r extends At{constructor(){super(...arguments),Object.defineProperty(this,Vr,{writable:!0,value:void 0})}getTargetPlugin(e){let t;if(typeof e?.addTarget=="function")t=e,t instanceof r||console.warn(new Error("The provided plugin is not an instance of UIPlugin. This is an indication of a bug with the way Uppy is bundled.",{cause:{targetPlugin:t,UIPlugin:r}}));else if(typeof e=="function"){let i=e;this.uppy.iteratePlugins(o=>{o instanceof i&&(t=o)})}return t}mount(e,t){let i=t.id,o=Il(e);if(o){this.isTargetDOMEl=!0;let n=document.createElement("div");return n.classList.add("uppy-Root"),Dl(this,Vr)[Vr]=oh(l=>{this.uppy.getPlugin(this.id)&&(as(this.render(l,n),n),this.afterUpdate())}),this.uppy.log(`Installing ${i} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(o.innerHTML=""),as(this.render(this.uppy.getState(),n),n),this.el=n,o.appendChild(n),n.dir=this.opts.direction||Wi(n)||"ltr",this.onMount(),this.el}let s=this.getTargetPlugin(e);if(s)return this.uppy.log(`Installing ${i} to ${s.id}`),this.parent=s,this.el=s.addTarget(t),this.onMount(),this.el;this.uppy.log(`Not installing ${i}`);let a=`Invalid target option given to ${i}.`;throw typeof e=="function"?a+=" The given target is not a Plugin class. Please check that you're not specifying a React Component instead of a plugin. If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly.":a+="If you meant to target an HTML element, please make sure that the element exists. Check that the <script> tag initializing Uppy is right before the closing </body> tag at the end of the page. (see https://github.com/transloadit/uppy/issues/1042)\n\nIf you meant to target a plugin, please confirm that your `import` statements or `require` calls are correct.",new Error(a)}render(e,t){throw new Error("Extend the render method to add your plugin to a DOM element")}update(e){if(this.el!=null){var t,i;(t=(i=Dl(this,Vr))[Vr])==null||t.call(i,e)}}unmount(){if(this.isTargetDOMEl){var e;(e=this.el)==null||e.remove()}this.onUnmount()}onMount(){}onUnmount(){}},He=ns;function Gi(r,e,t,i){return t===0||r===e?r:i===0?e:r+(e-r)*2**(-i/t)}var $e={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete"};var fs=ue(Te(),1);function Wr(r){let e=[],t="indeterminate",i;for(let{progress:s}of Object.values(r)){let{preprocess:a,postprocess:n}=s;i==null&&(a||n)&&({mode:t,message:i}=a||n),a?.mode==="determinate"&&e.push(a.value),n?.mode==="determinate"&&e.push(n.value)}let o=e.reduce((s,a)=>s+a/e.length,0);return{mode:t,message:i,value:o}}var us=ue(Te(),1),ds=ue(Tr(),1);function ls(r){let e=Math.floor(r/3600)%24,t=Math.floor(r/60)%60,i=Math.floor(r%60);return{hours:e,minutes:t,seconds:i}}function ps(r){let e=ls(r),t=e.hours===0?"":`${e.hours}h`,i=e.minutes===0?"":`${e.hours===0?e.minutes:` ${e.minutes.toString(10).padStart(2,"0")}`}m`,o=e.hours!==0?"":`${e.minutes===0?e.seconds:` ${e.seconds.toString(10).padStart(2,"0")}`}s`;return`${t}${i}${o}`}var sh="\xB7",Cl=()=>` ${sh} `;function Bl(r){let{newFiles:e,isUploadStarted:t,recoveredState:i,i18n:o,uploadState:s,isSomeGhost:a,startUpload:n}=r,l=(0,us.default)("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--upload",{"uppy-c-btn-primary":s===$e.STATE_WAITING},{"uppy-StatusBar-actionBtn--disabled":a}),d=e&&t&&!i?o("uploadXNewFiles",{smart_count:e}):o("uploadXFiles",{smart_count:e});return p("button",{type:"button",className:l,"aria-label":o("uploadXFiles",{smart_count:e}),onClick:n,disabled:a,"data-uppy-super-focusable":!0},d)}function Tl(r){let{i18n:e,uppy:t}=r;return p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--retry","aria-label":e("retryUpload"),onClick:()=>t.retryAll().catch(()=>{}),"data-uppy-super-focusable":!0,"data-cy":"retry"},p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"8",height:"10",viewBox:"0 0 8 10"},p("path",{d:"M4 2.408a2.75 2.75 0 1 0 2.75 2.75.626.626 0 0 1 1.25.018v.023a4 4 0 1 1-4-4.041V.25a.25.25 0 0 1 .389-.208l2.299 1.533a.25.25 0 0 1 0 .416l-2.3 1.533A.25.25 0 0 1 4 3.316v-.908z"})),e("retry"))}function El(r){let{i18n:e,uppy:t}=r;return p("button",{type:"button",className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",title:e("cancel"),"aria-label":e("cancel"),onClick:()=>t.cancelAll(),"data-cy":"cancel","data-uppy-super-focusable":!0},p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},p("g",{fill:"none",fillRule:"evenodd"},p("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),p("path",{fill:"#FFF",d:"M9.283 8l2.567 2.567-1.283 1.283L8 9.283 5.433 11.85 4.15 10.567 6.717 8 4.15 5.433 5.433 4.15 8 6.717l2.567-2.567 1.283 1.283z"}))))}function Al(r){let{isAllPaused:e,i18n:t,isAllComplete:i,resumableUploads:o,uppy:s}=r,a=t(e?"resume":"pause");function n(){if(!i){if(!o){s.cancelAll();return}if(e){s.resumeAll();return}s.pauseAll()}}return p("button",{title:a,"aria-label":a,className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",type:"button",onClick:n,"data-cy":"togglePauseResume","data-uppy-super-focusable":!0},p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},p("g",{fill:"none",fillRule:"evenodd"},p("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),p("path",{fill:"#FFF",d:e?"M6 4.25L11.5 8 6 11.75z":"M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z"}))))}function Ol(r){let{i18n:e,doneButtonHandler:t}=r;return p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--done",onClick:t,"data-uppy-super-focusable":!0},e("done"))}function zl(){return p("svg",{className:"uppy-StatusBar-spinner","aria-hidden":"true",focusable:"false",width:"14",height:"14"},p("path",{d:"M13.983 6.547c-.12-2.509-1.64-4.893-3.939-5.936-2.48-1.127-5.488-.656-7.556 1.094C.524 3.367-.398 6.048.162 8.562c.556 2.495 2.46 4.52 4.94 5.183 2.932.784 5.61-.602 7.256-3.015-1.493 1.993-3.745 3.309-6.298 2.868-2.514-.434-4.578-2.349-5.153-4.84a6.226 6.226 0 0 1 2.98-6.778C6.34.586 9.74 1.1 11.373 3.493c.407.596.693 1.282.842 1.988.127.598.073 1.197.161 1.794.078.525.543 1.257 1.15.864.525-.341.49-1.05.456-1.592-.007-.15.02.3 0 0",fillRule:"evenodd"}))}function Ul(r){let{progress:e}=r,{value:t,mode:i,message:o}=e;return p("div",{className:"uppy-StatusBar-content"},p(zl,null),i==="determinate"?`${Math.round(t*100)}% \xB7 `:"",o)}function ah(r){let{numUploads:e,complete:t,totalUploadedSize:i,totalSize:o,totalETA:s,i18n:a}=r,n=e>1,l=(0,ds.default)(i);return p("div",{className:"uppy-StatusBar-statusSecondary"},n&&a("filesUploadedOfTotal",{complete:t,smart_count:e}),p("span",{className:"uppy-StatusBar-additionalInfo"},n&&Cl(),o!=null?a("dataUploadedOfTotal",{complete:l,total:(0,ds.default)(o)}):a("dataUploadedOfUnknown",{complete:l}),Cl(),s!=null&&a("xTimeLeft",{time:ps(s)})))}function Ml(r){let{i18n:e,complete:t,numUploads:i}=r;return p("div",{className:"uppy-StatusBar-statusSecondary"},e("filesUploadedOfTotal",{complete:t,smart_count:i}))}function nh(r){let{i18n:e,newFiles:t,startUpload:i}=r,o=(0,us.default)("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--uploadNewlyAdded");return p("div",{className:"uppy-StatusBar-statusSecondary"},p("div",{className:"uppy-StatusBar-statusSecondaryHint"},e("xMoreFilesAdded",{smart_count:t})),p("button",{type:"button",className:o,"aria-label":e("uploadXFiles",{smart_count:t}),onClick:i},e("upload")))}function Rl(r){let{i18n:e,supportsUploadProgress:t,totalProgress:i,showProgressDetails:o,isUploadStarted:s,isAllComplete:a,isAllPaused:n,newFiles:l,numUploads:d,complete:h,totalUploadedSize:u,totalSize:g,totalETA:y,startUpload:w}=r,B=l&&s;if(!s||a)return null;let $=e(n?"paused":"uploading");function L(){return!n&&!B&&o?t?p(ah,{numUploads:d,complete:h,totalUploadedSize:u,totalSize:g,totalETA:y,i18n:e}):p(Ml,{i18n:e,complete:h,numUploads:d}):null}return p("div",{className:"uppy-StatusBar-content","aria-label":$,title:$},n?null:p(zl,null),p("div",{className:"uppy-StatusBar-status"},p("div",{className:"uppy-StatusBar-statusPrimary"},t&&i!==0?`${$}: ${i}%`:$),L(),B?p(nh,{i18n:e,newFiles:l,startUpload:w}):null))}function Nl(r){let{i18n:e}=r;return p("div",{className:"uppy-StatusBar-content",role:"status",title:e("complete")},p("div",{className:"uppy-StatusBar-status"},p("div",{className:"uppy-StatusBar-statusPrimary"},p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"15",height:"11",viewBox:"0 0 15 11"},p("path",{d:"M.414 5.843L1.627 4.63l3.472 3.472L13.202 0l1.212 1.213L5.1 10.528z"})),e("complete"))))}function Ll(r){let{error:e,i18n:t,complete:i,numUploads:o}=r;function s(){let a=`${t("uploadFailed")}
|
|
16
|
+
|
|
17
|
+
${e}`;alert(a)}return p("div",{className:"uppy-StatusBar-content",title:t("uploadFailed")},p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"11",height:"11",viewBox:"0 0 11 11"},p("path",{d:"M4.278 5.5L0 1.222 1.222 0 5.5 4.278 9.778 0 11 1.222 6.722 5.5 11 9.778 9.778 11 5.5 6.722 1.222 11 0 9.778z"})),p("div",{className:"uppy-StatusBar-status"},p("div",{className:"uppy-StatusBar-statusPrimary"},t("uploadFailed"),p("button",{className:"uppy-u-reset uppy-StatusBar-details","aria-label":t("showErrorDetails"),"data-microtip-position":"top-right","data-microtip-size":"medium",onClick:s,type:"button"},"?")),p(Ml,{i18n:t,complete:i,numUploads:o})))}var{STATE_ERROR:jl,STATE_WAITING:lh,STATE_PREPROCESSING:hs,STATE_UPLOADING:Xi,STATE_POSTPROCESSING:cs,STATE_COMPLETE:Yi}=$e;function ms(r){let{newFiles:e,allowNewUpload:t,isUploadInProgress:i,isAllPaused:o,resumableUploads:s,error:a,hideUploadButton:n=void 0,hidePauseResumeButton:l=!1,hideCancelButton:d=!1,hideRetryButton:h=!1,recoveredState:u,uploadState:g,totalProgress:y,files:w,supportsUploadProgress:B,hideAfterFinish:$=!1,isSomeGhost:L,doneButtonHandler:j=void 0,isUploadStarted:Z,i18n:G,startUpload:V,uppy:c,isAllComplete:f,showProgressDetails:v=void 0,numUploads:k,complete:C,totalSize:T,totalETA:q,totalUploadedSize:oe}=r;function ie(){switch(g){case cs:case hs:{let U=Wr(w);return U.mode==="determinate"?U.value*100:y}case jl:return null;case Xi:return B?y:null;default:return y}}function z(){switch(g){case cs:case hs:{let{mode:U}=Wr(w);return U==="indeterminate"}case Xi:return!B;default:return!1}}let se=ie(),N=se??100,ye=!a&&e&&(!i&&!o||u)&&t&&!n,be=!d&&g!==lh&&g!==Yi,E=s&&!l&&g===Xi,re=a&&!f&&!h,F=j&&g===Yi,b=(0,fs.default)("uppy-StatusBar-progress",{"is-indeterminate":z()}),x=(0,fs.default)("uppy-StatusBar",`is-${g}`,{"has-ghosts":L}),P=(()=>{switch(g){case hs:case cs:return p(Ul,{progress:Wr(w)});case Yi:return p(Nl,{i18n:G});case jl:return p(Ll,{error:a,i18n:G,numUploads:k,complete:C});case Xi:return p(Rl,{i18n:G,supportsUploadProgress:B,totalProgress:y,showProgressDetails:v,isUploadStarted:Z,isAllComplete:f,isAllPaused:o,newFiles:e,numUploads:k,complete:C,totalUploadedSize:oe,totalSize:T,totalETA:q,startUpload:V});default:return null}})();return p("div",{className:x,"aria-hidden":!(ye||re||E||be||F)&&!P||g===Yi&&$},p("div",{className:b,style:{width:`${N}%`},role:"progressbar","aria-label":`${N}%`,"aria-valuetext":`${N}%`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":se}),P,p("div",{className:"uppy-StatusBar-actions"},ye?p(Bl,{newFiles:e,isUploadStarted:Z,recoveredState:u,i18n:G,isSomeGhost:L,startUpload:V,uploadState:g}):null,re?p(Tl,{i18n:G,uppy:c}):null,E?p(Al,{isAllPaused:o,i18n:G,isAllComplete:f,resumableUploads:s,uppy:c}):null,be?p(El,{i18n:G,uppy:c}):null,F?p(Ol,{i18n:G,doneButtonHandler:j}):null))}var Hl={strings:{uploading:"Uploading",complete:"Complete",uploadFailed:"Upload failed",paused:"Paused",retry:"Retry",cancel:"Cancel",pause:"Pause",resume:"Resume",done:"Done",filesUploadedOfTotal:{0:"%{complete} of %{smart_count} file uploaded",1:"%{complete} of %{smart_count} files uploaded"},dataUploadedOfTotal:"%{complete} of %{total}",dataUploadedOfUnknown:"%{complete} of unknown",xTimeLeft:"%{time} left",uploadXFiles:{0:"Upload %{smart_count} file",1:"Upload %{smart_count} files"},uploadXNewFiles:{0:"Upload +%{smart_count} file",1:"Upload +%{smart_count} files"},upload:"Upload",retryUpload:"Retry upload",xMoreFilesAdded:{0:"%{smart_count} more file added",1:"%{smart_count} more files added"},showErrorDetails:"Show error details"}};function ge(r,e){if(!{}.hasOwnProperty.call(r,e))throw new TypeError("attempted to use private field on non-instance");return r}var ph=0;function pr(r){return"__private_"+ph+++"_"+r}var dh={version:"4.0.6"},uh=2e3,hh=2e3;function ch(r,e,t,i){if(r)return $e.STATE_ERROR;if(e)return $e.STATE_COMPLETE;if(t)return $e.STATE_WAITING;let o=$e.STATE_WAITING,s=Object.keys(i);for(let a=0;a<s.length;a++){let{progress:n}=i[s[a]];if(n.uploadStarted&&!n.uploadComplete)return $e.STATE_UPLOADING;n.preprocess&&(o=$e.STATE_PREPROCESSING),n.postprocess&&o!==$e.STATE_PREPROCESSING&&(o=$e.STATE_POSTPROCESSING)}return o}var fh={hideUploadButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideCancelButton:!1,showProgressDetails:!1,hideAfterFinish:!0,doneButtonHandler:null},Xe=pr("lastUpdateTime"),Ze=pr("previousUploadedBytes"),bt=pr("previousSpeed"),qe=pr("previousETA"),gs=pr("computeSmoothETA"),Gr=pr("onUploadStart"),Ot=class extends He{constructor(e,t){super(e,m(m({},fh),t)),Object.defineProperty(this,gs,{value:mh}),Object.defineProperty(this,Xe,{writable:!0,value:void 0}),Object.defineProperty(this,Ze,{writable:!0,value:void 0}),Object.defineProperty(this,bt,{writable:!0,value:void 0}),Object.defineProperty(this,qe,{writable:!0,value:void 0}),this.startUpload=()=>this.uppy.upload().catch(()=>{}),Object.defineProperty(this,Gr,{writable:!0,value:()=>{let{recoveredState:i}=this.uppy.getState();if(ge(this,bt)[bt]=null,ge(this,qe)[qe]=null,i){ge(this,Ze)[Ze]=Object.values(i.files).reduce((o,s)=>{let{progress:a}=s;return o+a.bytesUploaded},0),this.uppy.emit("restore-confirmed");return}ge(this,Xe)[Xe]=performance.now(),ge(this,Ze)[Ze]=0}}),this.id=this.opts.id||"StatusBar",this.title="StatusBar",this.type="progressindicator",this.defaultLocale=Hl,this.i18nInit(),this.render=this.render.bind(this),this.install=this.install.bind(this)}render(e){let{capabilities:t,files:i,allowNewUpload:o,totalProgress:s,error:a,recoveredState:n}=e,{newFiles:l,startedFiles:d,completeFiles:h,isUploadStarted:u,isAllComplete:g,isAllPaused:y,isUploadInProgress:w,isSomeGhost:B}=this.uppy.getObjectOfFilesPerState(),$=n?Object.values(i):l,L=!!t.resumableUploads,j=t.uploadProgress!==!1,Z=null,G=0;d.every(c=>c.progress.bytesTotal!=null&&c.progress.bytesTotal!==0)&&(Z=0,d.forEach(c=>{Z+=c.progress.bytesTotal||0,G+=c.progress.bytesUploaded||0})),d.forEach(c=>{G+=c.progress.bytesUploaded||0});let V=ge(this,gs)[gs]({uploaded:G,total:Z});return ms({error:a,uploadState:ch(a,g,n,e.files||{}),allowNewUpload:o,totalProgress:s,totalSize:Z,totalUploadedSize:G,isAllComplete:!1,isAllPaused:y,isUploadStarted:u,isUploadInProgress:w,isSomeGhost:B,recoveredState:n,complete:h.length,newFiles:$.length,numUploads:d.length,totalETA:V,files:i,i18n:this.i18n,uppy:this.uppy,startUpload:this.startUpload,doneButtonHandler:this.opts.doneButtonHandler,resumableUploads:L,supportsUploadProgress:j,showProgressDetails:this.opts.showProgressDetails,hideUploadButton:this.opts.hideUploadButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,hideCancelButton:this.opts.hideCancelButton,hideAfterFinish:this.opts.hideAfterFinish})}onMount(){let e=this.el;Wi(e)||(e.dir="ltr")}install(){let{target:e}=this.opts;e&&this.mount(e,this),this.uppy.on("upload",ge(this,Gr)[Gr]),ge(this,Xe)[Xe]=performance.now(),ge(this,Ze)[Ze]=this.uppy.getFiles().reduce((t,i)=>t+i.progress.bytesUploaded,0)}uninstall(){this.unmount(),this.uppy.off("upload",ge(this,Gr)[Gr])}};function mh(r){var e,t;if(r.total==null||r.total===0)return null;let i=r.total-r.uploaded;if(i<=0)return null;(t=(e=ge(this,Xe))[Xe])!=null||(e[Xe]=performance.now());let o=performance.now()-ge(this,Xe)[Xe];if(o===0){var s;return Math.round(((s=ge(this,qe)[qe])!=null?s:0)/100)/10}let a=r.uploaded-ge(this,Ze)[Ze];if(ge(this,Ze)[Ze]=r.uploaded,a<=0){var n;return Math.round(((n=ge(this,qe)[qe])!=null?n:0)/100)/10}let l=a/o,d=ge(this,bt)[bt]==null?l:Gi(l,ge(this,bt)[bt],uh,o);ge(this,bt)[bt]=d;let h=i/d,u=Math.max(ge(this,qe)[qe]-o,0),g=ge(this,qe)[qe]==null?h:Gi(h,u,hh,o);return ge(this,qe)[qe]=g,ge(this,Xe)[Xe]=performance.now(),Math.round(g/100)/10}Ot.VERSION=dh.version;var $l=300,Ji=class extends Me{constructor(){super(...arguments),this.ref=xl()}componentWillEnter(e){this.ref.current.style.opacity="1",this.ref.current.style.transform="none",setTimeout(e,$l)}componentWillLeave(e){this.ref.current.style.opacity="0",this.ref.current.style.transform="translateY(350%)",setTimeout(e,$l)}render(){let{children:e}=this.props;return p("div",{className:"uppy-Informer-animated",ref:this.ref},e)}};function gh(r,e){return Object.assign(r,e)}function yh(r,e){var t;return(t=r?.key)!=null?t:e}function bh(r,e){let t=r._ptgLinkedRefs||(r._ptgLinkedRefs={});return t[e]||(t[e]=i=>{r.refs[e]=i})}function Kr(r){let e={};for(let t=0;t<r.length;t++)if(r[t]!=null){let i=yh(r[t],t.toString(36));e[i]=r[t]}return e}function vh(r,e){r=r||{},e=e||{};let t=a=>e.hasOwnProperty(a)?e[a]:r[a],i={},o=[];for(let a in r)e.hasOwnProperty(a)?o.length&&(i[a]=o,o=[]):o.push(a);let s={};for(let a in e){if(i.hasOwnProperty(a))for(let n=0;n<i[a].length;n++){let l=i[a][n];s[i[a][n]]=t(l)}s[a]=t(a)}for(let a=0;a<o.length;a++)s[o[a]]=t(o[a]);return s}var wh=r=>r,xh=(()=>{class r extends Me{constructor(t,i){super(t,i),this.refs={},this.state={children:Kr(at(at(this.props.children))||[])},this.performAppear=this.performAppear.bind(this),this.performEnter=this.performEnter.bind(this),this.performLeave=this.performLeave.bind(this)}componentWillMount(){this.currentlyTransitioningKeys={},this.keysToAbortLeave=[],this.keysToEnter=[],this.keysToLeave=[]}componentDidMount(){let t=this.state.children;for(let i in t)t[i]&&this.performAppear(i)}componentWillReceiveProps(t){let i=Kr(at(t.children)||[]),o=this.state.children;this.setState(a=>({children:vh(a.children,i)}));let s;for(s in i)if(i.hasOwnProperty(s)){let a=o&&o.hasOwnProperty(s);i[s]&&a&&this.currentlyTransitioningKeys[s]?(this.keysToEnter.push(s),this.keysToAbortLeave.push(s)):i[s]&&!a&&!this.currentlyTransitioningKeys[s]&&this.keysToEnter.push(s)}for(s in o)if(o.hasOwnProperty(s)){let a=i&&i.hasOwnProperty(s);o[s]&&!a&&!this.currentlyTransitioningKeys[s]&&this.keysToLeave.push(s)}}componentDidUpdate(){let{keysToEnter:t}=this;this.keysToEnter=[],t.forEach(this.performEnter);let{keysToLeave:i}=this;this.keysToLeave=[],i.forEach(this.performLeave)}_finishAbort(t){let i=this.keysToAbortLeave.indexOf(t);i!==-1&&this.keysToAbortLeave.splice(i,1)}performAppear(t){this.currentlyTransitioningKeys[t]=!0;let i=this.refs[t];i!=null&&i.componentWillAppear?i.componentWillAppear(this._handleDoneAppearing.bind(this,t)):this._handleDoneAppearing(t)}_handleDoneAppearing(t){let i=this.refs[t];i!=null&&i.componentDidAppear&&i.componentDidAppear(),delete this.currentlyTransitioningKeys[t],this._finishAbort(t);let o=Kr(at(this.props.children)||[]);(!o||!o.hasOwnProperty(t))&&this.performLeave(t)}performEnter(t){this.currentlyTransitioningKeys[t]=!0;let i=this.refs[t];i!=null&&i.componentWillEnter?i.componentWillEnter(this._handleDoneEntering.bind(this,t)):this._handleDoneEntering(t)}_handleDoneEntering(t){let i=this.refs[t];i!=null&&i.componentDidEnter&&i.componentDidEnter(),delete this.currentlyTransitioningKeys[t],this._finishAbort(t);let o=Kr(at(this.props.children)||[]);(!o||!o.hasOwnProperty(t))&&this.performLeave(t)}performLeave(t){if(this.keysToAbortLeave.indexOf(t)!==-1)return;this.currentlyTransitioningKeys[t]=!0;let o=this.refs[t];o!=null&&o.componentWillLeave?o.componentWillLeave(this._handleDoneLeaving.bind(this,t)):this._handleDoneLeaving(t)}_handleDoneLeaving(t){if(this.keysToAbortLeave.indexOf(t)!==-1)return;let o=this.refs[t];o!=null&&o.componentDidLeave&&o.componentDidLeave(),delete this.currentlyTransitioningKeys[t];let s=Kr(at(this.props.children)||[]);if(s&&s.hasOwnProperty(t))this.performEnter(t);else{let a=gh({},this.state.children);delete a[t],this.setState({children:a})}}render(t,i){let $=t,{childFactory:o,transitionLeave:s,transitionName:a,transitionAppear:n,transitionEnter:l,transitionLeaveTimeout:d,transitionEnterTimeout:h,transitionAppearTimeout:u,component:g}=$,y=ki($,["childFactory","transitionLeave","transitionName","transitionAppear","transitionEnter","transitionLeaveTimeout","transitionEnterTimeout","transitionAppearTimeout","component"]),{children:w}=i,B=Object.entries(w).map(L=>{let[j,Z]=L;if(!Z)return;let G=bh(this,j);return Vi(o(Z),{ref:G,key:j})}).filter(Boolean);return p(g,y,B)}}return r.defaultProps={component:"span",childFactory:wh},r})(),ql=xh;var Ph={version:"4.1.2"},zt=class extends He{constructor(e,t){super(e,t),this.render=i=>p("div",{className:"uppy uppy-Informer"},p(ql,null,i.info.map(o=>p(Ji,{key:o.message},p("p",{role:"alert"},o.message," ",o.details&&p("span",{"aria-label":o.details,"data-microtip-position":"top-left","data-microtip-size":"medium",role:"tooltip",onClick:()=>alert(`${o.message}
|
|
18
|
+
|
|
19
|
+
${o.details}`)},"?")))))),this.type="progressindicator",this.id=this.opts.id||"Informer",this.title="Informer"}install(){let{target:e}=this.opts;e&&this.mount(e,this)}};zt.VERSION=Ph.version;var Sh=/^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/;function Fh(r,e,t){var i,o;let s=Sh.exec(r),a=(i=(o=e.mimeType)!=null?o:s?.[1])!=null?i:"plain/text",n;if(s?.[2]!=null){let l=atob(decodeURIComponent(s[3])),d=new Uint8Array(l.length);for(let h=0;h<l.length;h++)d[h]=l.charCodeAt(h);n=[d]}else s?.[3]!=null&&(n=[decodeURIComponent(s[3])]);return t?new File(n,e.name||"",{type:a}):new Blob(n,{type:a})}var Vl=Fh;function Qi(r){return r.startsWith("blob:")}function Zi(r){return r?/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(r):!1}function te(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}var ep=typeof self<"u"?self:global,Qr=typeof navigator<"u",kh=Qr&&typeof HTMLImageElement>"u",Wl=!(typeof global>"u"||typeof process>"u"||!process.versions||!process.versions.node),tp=ep.Buffer,rp=!!tp,_h=r=>r!==void 0;function ip(r){return r===void 0||(r instanceof Map?r.size===0:Object.values(r).filter(_h).length===0)}function Se(r){let e=new Error(r);throw delete e.stack,e}function Gl(r){let e=function(t){let i=0;return t.ifd0.enabled&&(i+=1024),t.exif.enabled&&(i+=2048),t.makerNote&&(i+=2048),t.userComment&&(i+=1024),t.gps.enabled&&(i+=512),t.interop.enabled&&(i+=100),t.ifd1.enabled&&(i+=1024),i+2048}(r);return r.jfif.enabled&&(e+=50),r.xmp.enabled&&(e+=2e4),r.iptc.enabled&&(e+=14e3),r.icc.enabled&&(e+=6e3),e}var ys=r=>String.fromCharCode.apply(null,r),Kl=typeof TextDecoder<"u"?new TextDecoder("utf-8"):void 0,Mt=class r{static from(e,t){return e instanceof this&&e.le===t?e:new r(e,void 0,void 0,t)}constructor(e,t=0,i,o){if(typeof o=="boolean"&&(this.le=o),Array.isArray(e)&&(e=new Uint8Array(e)),e===0)this.byteOffset=0,this.byteLength=0;else if(e instanceof ArrayBuffer){i===void 0&&(i=e.byteLength-t);let s=new DataView(e,t,i);this._swapDataView(s)}else if(e instanceof Uint8Array||e instanceof DataView||e instanceof r){i===void 0&&(i=e.byteLength-t),(t+=e.byteOffset)+i>e.byteOffset+e.byteLength&&Se("Creating view outside of available memory in ArrayBuffer");let s=new DataView(e.buffer,t,i);this._swapDataView(s)}else if(typeof e=="number"){let s=new DataView(new ArrayBuffer(e));this._swapDataView(s)}else Se("Invalid input argument for BufferView: "+e)}_swapArrayBuffer(e){this._swapDataView(new DataView(e))}_swapBuffer(e){this._swapDataView(new DataView(e.buffer,e.byteOffset,e.byteLength))}_swapDataView(e){this.dataView=e,this.buffer=e.buffer,this.byteOffset=e.byteOffset,this.byteLength=e.byteLength}_lengthToEnd(e){return this.byteLength-e}set(e,t,i=r){return e instanceof DataView||e instanceof r?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Uint8Array||Se("BufferView.set(): Invalid data argument."),this.toUint8().set(e,t),new i(this,t,e.byteLength)}subarray(e,t){return t=t||this._lengthToEnd(e),new r(this,e,t)}toUint8(){return new Uint8Array(this.buffer,this.byteOffset,this.byteLength)}getUint8Array(e,t){return new Uint8Array(this.buffer,this.byteOffset+e,t)}getString(e=0,t=this.byteLength){return o=this.getUint8Array(e,t),Kl?Kl.decode(o):rp?Buffer.from(o).toString("utf8"):decodeURIComponent(escape(ys(o)));var o}getLatin1String(e=0,t=this.byteLength){let i=this.getUint8Array(e,t);return ys(i)}getUnicodeString(e=0,t=this.byteLength){let i=[];for(let o=0;o<t&&e+o<this.byteLength;o+=2)i.push(this.getUint16(e+o));return ys(i)}getInt8(e){return this.dataView.getInt8(e)}getUint8(e){return this.dataView.getUint8(e)}getInt16(e,t=this.le){return this.dataView.getInt16(e,t)}getInt32(e,t=this.le){return this.dataView.getInt32(e,t)}getUint16(e,t=this.le){return this.dataView.getUint16(e,t)}getUint32(e,t=this.le){return this.dataView.getUint32(e,t)}getFloat32(e,t=this.le){return this.dataView.getFloat32(e,t)}getFloat64(e,t=this.le){return this.dataView.getFloat64(e,t)}getFloat(e,t=this.le){return this.dataView.getFloat32(e,t)}getDouble(e,t=this.le){return this.dataView.getFloat64(e,t)}getUintBytes(e,t,i){switch(t){case 1:return this.getUint8(e,i);case 2:return this.getUint16(e,i);case 4:return this.getUint32(e,i);case 8:return this.getUint64&&this.getUint64(e,i)}}getUint(e,t,i){switch(t){case 8:return this.getUint8(e,i);case 16:return this.getUint16(e,i);case 32:return this.getUint32(e,i);case 64:return this.getUint64&&this.getUint64(e,i)}}toString(e){return this.dataView.toString(e,this.constructor.name)}ensureChunk(){}};function vs(r,e){Se(`${r} '${e}' was not loaded, try using full build of exifr.`)}var Zr=class extends Map{constructor(e){super(),this.kind=e}get(e,t){return this.has(e)||vs(this.kind,e),t&&(e in t||function(i,o){Se(`Unknown ${i} '${o}'.`)}(this.kind,e),t[e].enabled||vs(this.kind,e)),super.get(e)}keyList(){return Array.from(this.keys())}},oo=new Zr("file parser"),Ve=new Zr("segment parser"),ri=new Zr("file reader"),Ih=ep.fetch;function Xl(r,e){return(t=r).startsWith("data:")||t.length>1e4?xs(r,e,"base64"):Wl&&r.includes("://")?ws(r,e,"url",eo):Wl?xs(r,e,"fs"):Qr?ws(r,e,"url",eo):void Se("Invalid input argument");var t}function ws(r,e,t,i){return _(this,null,function*(){return ri.has(t)?xs(r,e,t):i?function(o,s){return _(this,null,function*(){let a=yield s(o);return new Mt(a)})}(r,i):void Se(`Parser ${t} is not loaded`)})}function xs(r,e,t){return _(this,null,function*(){let i=new(ri.get(t))(r,e);return yield i.read(),i})}var eo=r=>Ih(r).then(e=>e.arrayBuffer()),ei=r=>new Promise((e,t)=>{let i=new FileReader;i.onloadend=()=>e(i.result||new ArrayBuffer),i.onerror=t,i.readAsArrayBuffer(r)}),Ps=class extends Map{get tagKeys(){return this.allKeys||(this.allKeys=Array.from(this.keys())),this.allKeys}get tagValues(){return this.allValues||(this.allValues=Array.from(this.values())),this.allValues}};function op(r,e,t){let i=new Ps;for(let[o,s]of t)i.set(o,s);if(Array.isArray(e))for(let o of e)r.set(o,i);else r.set(e,i);return i}function sp(r,e,t){let i,o=r.get(e);for(i of t)o.set(i[0],i[1])}var ii=new Map,Is=new Map,Ds=new Map,dr=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],so=["jfif","xmp","icc","iptc","ihdr"],ti=["tiff",...so],we=["ifd0","ifd1","exif","gps","interop"],ur=[...ti,...we],hr=["makerNote","userComment"],ao=["translateKeys","translateValues","reviveValues","multiSegment"],cr=[...ao,"sanitize","mergeOutput","silentErrors"],to=class{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}},Ut=class extends to{get needed(){return this.enabled||this.deps.size>0}constructor(e,t,i,o){if(super(),te(this,"enabled",!1),te(this,"skip",new Set),te(this,"pick",new Set),te(this,"deps",new Set),te(this,"translateKeys",!1),te(this,"translateValues",!1),te(this,"reviveValues",!1),this.key=e,this.enabled=t,this.parse=this.enabled,this.applyInheritables(o),this.canBeFiltered=we.includes(e),this.canBeFiltered&&(this.dict=ii.get(e)),i!==void 0)if(Array.isArray(i))this.parse=this.enabled=!0,this.canBeFiltered&&i.length>0&&this.translateTagSet(i,this.pick);else if(typeof i=="object"){if(this.enabled=!0,this.parse=i.parse!==!1,this.canBeFiltered){let{pick:s,skip:a}=i;s&&s.length>0&&this.translateTagSet(s,this.pick),a&&a.length>0&&this.translateTagSet(a,this.skip)}this.applyInheritables(i)}else i===!0||i===!1?this.parse=this.enabled=i:Se(`Invalid options argument: ${i}`)}applyInheritables(e){let t,i;for(t of ao)i=e[t],i!==void 0&&(this[t]=i)}translateTagSet(e,t){if(this.dict){let i,o,{tagKeys:s,tagValues:a}=this.dict;for(i of e)typeof i=="string"?(o=a.indexOf(i),o===-1&&(o=s.indexOf(Number(i))),o!==-1&&t.add(Number(s[o]))):t.add(i)}else for(let i of e)t.add(i)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,ro(this.pick,this.deps)):this.enabled&&this.pick.size>0&&ro(this.pick,this.deps)}},Ee={jfif:!1,tiff:!0,xmp:!1,icc:!1,iptc:!1,ifd0:!0,ifd1:!1,exif:!0,gps:!0,interop:!1,ihdr:void 0,makerNote:!1,userComment:!1,multiSegment:!1,skip:[],pick:[],translateKeys:!0,translateValues:!0,reviveValues:!0,sanitize:!0,mergeOutput:!0,silentErrors:!0,chunked:!0,firstChunkSize:void 0,firstChunkSizeNode:512,firstChunkSizeBrowser:65536,chunkSize:65536,chunkLimit:5},Yl=new Map,Rt=class extends to{static useCached(e){let t=Yl.get(e);return t!==void 0||(t=new this(e),Yl.set(e,t)),t}constructor(e){super(),e===!0?this.setupFromTrue():e===void 0?this.setupFromUndefined():Array.isArray(e)?this.setupFromArray(e):typeof e=="object"?this.setupFromObject(e):Se(`Invalid options argument ${e}`),this.firstChunkSize===void 0&&(this.firstChunkSize=Qr?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let e;for(e of dr)this[e]=Ee[e];for(e of cr)this[e]=Ee[e];for(e of hr)this[e]=Ee[e];for(e of ur)this[e]=new Ut(e,Ee[e],void 0,this)}setupFromTrue(){let e;for(e of dr)this[e]=Ee[e];for(e of cr)this[e]=Ee[e];for(e of hr)this[e]=!0;for(e of ur)this[e]=new Ut(e,!0,void 0,this)}setupFromArray(e){let t;for(t of dr)this[t]=Ee[t];for(t of cr)this[t]=Ee[t];for(t of hr)this[t]=Ee[t];for(t of ur)this[t]=new Ut(t,!1,void 0,this);this.setupGlobalFilters(e,void 0,we)}setupFromObject(e){let t;for(t of(we.ifd0=we.ifd0||we.image,we.ifd1=we.ifd1||we.thumbnail,Object.assign(this,e),dr))this[t]=bs(e[t],Ee[t]);for(t of cr)this[t]=bs(e[t],Ee[t]);for(t of hr)this[t]=bs(e[t],Ee[t]);for(t of ti)this[t]=new Ut(t,Ee[t],e[t],this);for(t of we)this[t]=new Ut(t,Ee[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,we,ur),e.tiff===!0?this.batchEnableWithBool(we,!0):e.tiff===!1?this.batchEnableWithUserValue(we,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,we):typeof e.tiff=="object"&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,we)}batchEnableWithBool(e,t){for(let i of e)this[i].enabled=t}batchEnableWithUserValue(e,t){for(let i of e){let o=t[i];this[i].enabled=o!==!1&&o!==void 0}}setupGlobalFilters(e,t,i,o=i){if(e&&e.length){for(let a of o)this[a].enabled=!1;let s=Jl(e,i);for(let[a,n]of s)ro(this[a].pick,n),this[a].enabled=!0}else if(t&&t.length){let s=Jl(t,i);for(let[a,n]of s)ro(this[a].skip,n)}}filterNestedSegmentTags(){let{ifd0:e,exif:t,xmp:i,iptc:o,icc:s}=this;this.makerNote?t.deps.add(37500):t.skip.add(37500),this.userComment?t.deps.add(37510):t.skip.add(37510),i.enabled||e.skip.add(700),o.enabled||e.skip.add(33723),s.enabled||e.skip.add(34675)}traverseTiffDependencyTree(){let{ifd0:e,exif:t,gps:i,interop:o}=this;o.needed&&(t.deps.add(40965),e.deps.add(40965)),t.needed&&e.deps.add(34665),i.needed&&e.deps.add(34853),this.tiff.enabled=we.some(s=>this[s].enabled===!0)||this.makerNote||this.userComment;for(let s of we)this[s].finalizeFilters()}get onlyTiff(){return!so.map(e=>this[e].enabled).some(e=>e===!0)&&this.tiff.enabled}checkLoadedPlugins(){for(let e of ti)this[e].enabled&&!Ve.has(e)&&vs("segment parser",e)}};function Jl(r,e){let t,i,o,s,a=[];for(o of e){for(s of(t=ii.get(o),i=[],t))(r.includes(s[0])||r.includes(s[1]))&&i.push(s[0]);i.length&&a.push([o,i])}return a}function bs(r,e){return r!==void 0?r:e!==void 0?e:void 0}function ro(r,e){for(let t of e)r.add(t)}te(Rt,"default",Ee);var fr=class{constructor(e){te(this,"parsers",{}),te(this,"output",{}),te(this,"errors",[]),te(this,"pushToErrors",t=>this.errors.push(t)),this.options=Rt.useCached(e)}read(e){return _(this,null,function*(){this.file=yield function(t,i){return typeof t=="string"?Xl(t,i):Qr&&!kh&&t instanceof HTMLImageElement?Xl(t.src,i):t instanceof Uint8Array||t instanceof ArrayBuffer||t instanceof DataView?new Mt(t):Qr&&t instanceof Blob?ws(t,i,"blob",ei):void Se("Invalid input argument")}(e,this.options)})}setup(){if(this.fileParser)return;let{file:e}=this,t=e.getUint16(0);for(let[i,o]of oo)if(o.canHandle(e,t))return this.fileParser=new o(this.options,this.file,this.parsers),e[i]=!0;this.file.close&&this.file.close(),Se("Unknown file format")}parse(){return _(this,null,function*(){let{output:e,errors:t}=this;return this.setup(),this.options.silentErrors?(yield this.executeParsers().catch(this.pushToErrors),t.push(...this.fileParser.errors)):yield this.executeParsers(),this.file.close&&this.file.close(),this.options.silentErrors&&t.length>0&&(e.errors=t),ip(i=e)?void 0:i;var i})}executeParsers(){return _(this,null,function*(){let{output:e}=this;yield this.fileParser.parse();let t=Object.values(this.parsers).map(i=>_(this,null,function*(){let o=yield i.parse();i.assignToOutput(e,o)}));this.options.silentErrors&&(t=t.map(i=>i.catch(this.pushToErrors))),yield Promise.all(t)})}extractThumbnail(){return _(this,null,function*(){this.setup();let{options:e,file:t}=this,i=Ve.get("tiff",e);var o;if(t.tiff?o={start:0,type:"tiff"}:t.jpeg&&(o=yield this.fileParser.getOrFindSegment("tiff")),o===void 0)return;let s=yield this.fileParser.ensureSegmentChunk(o),a=this.parsers.tiff=new i(s,e,t),n=yield a.extractThumbnail();return t.close&&t.close(),n})}};function ap(r,e){return _(this,null,function*(){let t=new fr(e);return yield t.read(r),t.parse()})}var Dh=Object.freeze({__proto__:null,parse:ap,Exifr:fr,fileParsers:oo,segmentParsers:Ve,fileReaders:ri,tagKeys:ii,tagValues:Is,tagRevivers:Ds,createDictionary:op,extendDictionary:sp,fetchUrlAsArrayBuffer:eo,readBlobAsArrayBuffer:ei,chunkedProps:dr,otherSegments:so,segments:ti,tiffBlocks:we,segmentsAndBlocks:ur,tiffExtractables:hr,inheritables:ao,allFormatters:cr,Options:Rt}),kt=class{static findPosition(e,t){let i=e.getUint16(t+2)+2,o=typeof this.headerLength=="function"?this.headerLength(e,t,i):this.headerLength,s=t+o,a=i-o;return{offset:t,length:i,headerLength:o,start:s,size:a,end:s+a}}static parse(e,t={}){return new this(e,new Rt({[this.type]:t}),e).parse()}normalizeInput(e){return e instanceof Mt?e:new Mt(e)}constructor(e,t={},i){te(this,"errors",[]),te(this,"raw",new Map),te(this,"handleError",o=>{if(!this.options.silentErrors)throw o;this.errors.push(o.message)}),this.chunk=this.normalizeInput(e),this.file=i,this.type=this.constructor.type,this.globalOptions=this.options=t,this.localOptions=t[this.type],this.canTranslate=this.localOptions&&this.localOptions.translate}translate(){this.canTranslate&&(this.translated=this.translateBlock(this.raw,this.type))}get output(){return this.translated?this.translated:this.raw?Object.fromEntries(this.raw):void 0}translateBlock(e,t){let i=Ds.get(t),o=Is.get(t),s=ii.get(t),a=this.options[t],n=a.reviveValues&&!!i,l=a.translateValues&&!!o,d=a.translateKeys&&!!s,h={};for(let[u,g]of e)n&&i.has(u)?g=i.get(u)(g):l&&o.has(u)&&(g=this.translateValue(g,o.get(u))),d&&s.has(u)&&(u=s.get(u)||u),h[u]=g;return h}translateValue(e,t){return t[e]||t.DEFAULT||e}assignToOutput(e,t){this.assignObjectToOutput(e,this.constructor.type,t)}assignObjectToOutput(e,t,i){if(this.globalOptions.mergeOutput)return Object.assign(e,i);e[t]?Object.assign(e[t],i):e[t]=i}};te(kt,"headerLength",4),te(kt,"type",void 0),te(kt,"multiSegment",!1),te(kt,"canHandle",()=>!1);function Ch(r){return r===192||r===194||r===196||r===219||r===221||r===218||r===254}function Bh(r){return r>=224&&r<=239}function Th(r,e,t){for(let[i,o]of Ve)if(o.canHandle(r,e,t))return i}var io=class extends class{constructor(e,t,i){te(this,"errors",[]),te(this,"ensureSegmentChunk",o=>_(this,null,function*(){let s=o.start,a=o.size||65536;if(this.file.chunked)if(this.file.available(s,a))o.chunk=this.file.subarray(s,a);else try{o.chunk=yield this.file.readChunk(s,a)}catch(n){Se(`Couldn't read segment: ${JSON.stringify(o)}. ${n.message}`)}else this.file.byteLength>s+a?o.chunk=this.file.subarray(s,a):o.size===void 0?o.chunk=this.file.subarray(s):Se("Segment unreachable: "+JSON.stringify(o));return o.chunk})),this.extendOptions&&this.extendOptions(e),this.options=e,this.file=t,this.parsers=i}injectSegment(e,t){this.options[e].enabled&&this.createParser(e,t)}createParser(e,t){let i=new(Ve.get(e))(t,this.options,this.file);return this.parsers[e]=i}createParsers(e){for(let t of e){let{type:i,chunk:o}=t,s=this.options[i];if(s&&s.enabled){let a=this.parsers[i];a&&a.append||a||this.createParser(i,o)}}}readSegments(e){return _(this,null,function*(){let t=e.map(this.ensureSegmentChunk);yield Promise.all(t)})}}{constructor(...e){super(...e),te(this,"appSegments",[]),te(this,"jpegSegments",[]),te(this,"unknownSegments",[])}static canHandle(e,t){return t===65496}parse(){return _(this,null,function*(){yield this.findAppSegments(),yield this.readSegments(this.appSegments),this.mergeMultiSegments(),this.createParsers(this.mergedAppSegments||this.appSegments)})}setupSegmentFinderArgs(e){e===!0?(this.findAll=!0,this.wanted=new Set(Ve.keyList())):(e=e===void 0?Ve.keyList().filter(t=>this.options[t].enabled):e.filter(t=>this.options[t].enabled&&Ve.has(t)),this.findAll=!1,this.remaining=new Set(e),this.wanted=new Set(e)),this.unfinishedMultiSegment=!1}findAppSegments(e=0,t){return _(this,null,function*(){this.setupSegmentFinderArgs(t);let{file:i,findAll:o,wanted:s,remaining:a}=this;if(!o&&this.file.chunked&&(o=Array.from(s).some(n=>{let l=Ve.get(n),d=this.options[n];return l.multiSegment&&d.multiSegment}),o&&(yield this.file.readWhole())),e=this.findAppSegmentsInRange(e,i.byteLength),!this.options.onlyTiff&&i.chunked){let n=!1;for(;a.size>0&&!n&&(i.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:l}=i,d=this.appSegments.some(h=>!this.file.available(h.offset||h.start,h.length||h.size));if(n=e>l&&!d?!(yield i.readNextChunk(e)):!(yield i.readNextChunk(l)),(e=this.findAppSegmentsInRange(e,i.byteLength))===void 0)return}}})}findAppSegmentsInRange(e,t){t-=2;let i,o,s,a,n,l,{file:d,findAll:h,wanted:u,remaining:g,options:y}=this;for(;e<t;e++)if(d.getUint8(e)===255){if(i=d.getUint8(e+1),Bh(i)){if(o=d.getUint16(e+2),s=Th(d,e,o),s&&u.has(s)&&(a=Ve.get(s),n=a.findPosition(d,e),l=y[s],n.type=s,this.appSegments.push(n),!h&&(a.multiSegment&&l.multiSegment?(this.unfinishedMultiSegment=n.chunkNumber<n.chunkCount,this.unfinishedMultiSegment||g.delete(s)):g.delete(s),g.size===0)))break;y.recordUnknownSegments&&(n=kt.findPosition(d,e),n.marker=i,this.unknownSegments.push(n)),e+=o+1}else if(Ch(i)){if(o=d.getUint16(e+2),i===218&&y.stopAfterSos!==!1)return;y.recordJpegSegments&&this.jpegSegments.push({offset:e,length:o,marker:i}),e+=o+1}}return e}mergeMultiSegments(){if(!this.appSegments.some(t=>t.multiSegment))return;let e=function(t,i){let o,s,a,n=new Map;for(let l=0;l<t.length;l++)o=t[l],s=o[i],n.has(s)?a=n.get(s):n.set(s,a=[]),a.push(o);return Array.from(n)}(this.appSegments,"type");this.mergedAppSegments=e.map(([t,i])=>{let o=Ve.get(t,this.options);return o.handleMultiSegments?{type:t,chunk:o.handleMultiSegments(i)}:i[0]})}getSegment(e){return this.appSegments.find(t=>t.type===e)}getOrFindSegment(e){return _(this,null,function*(){let t=this.getSegment(e);return t===void 0&&(yield this.findAppSegments(0,[e]),t=this.getSegment(e)),t})}};te(io,"type","jpeg"),oo.set("jpeg",io);var Eh=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4],Ss=class extends kt{parseHeader(){var e=this.chunk.getUint16();e===18761?this.le=!0:e===19789&&(this.le=!1),this.chunk.le=this.le,this.headerParsed=!0}parseTags(e,t,i=new Map){let{pick:o,skip:s}=this.options[t];o=new Set(o);let a=o.size>0,n=s.size===0,l=this.chunk.getUint16(e);e+=2;for(let d=0;d<l;d++){let h=this.chunk.getUint16(e);if(a){if(o.has(h)&&(i.set(h,this.parseTag(e,h,t)),o.delete(h),o.size===0))break}else!n&&s.has(h)||i.set(h,this.parseTag(e,h,t));e+=12}return i}parseTag(e,t,i){let{chunk:o}=this,s=o.getUint16(e+2),a=o.getUint32(e+4),n=Eh[s];if(n*a<=4?e+=8:e=o.getUint32(e+8),(s<1||s>13)&&Se(`Invalid TIFF value type. block: ${i.toUpperCase()}, tag: ${t.toString(16)}, type: ${s}, offset ${e}`),e>o.byteLength&&Se(`Invalid TIFF value offset. block: ${i.toUpperCase()}, tag: ${t.toString(16)}, type: ${s}, offset ${e} is outside of chunk size ${o.byteLength}`),s===1)return o.getUint8Array(e,a);if(s===2)return(l=function(d){for(;d.endsWith("\0");)d=d.slice(0,-1);return d}(l=o.getString(e,a)).trim())===""?void 0:l;var l;if(s===7)return o.getUint8Array(e,a);if(a===1)return this.parseTagValue(s,e);{let d=new(function(u){switch(u){case 1:return Uint8Array;case 3:return Uint16Array;case 4:return Uint32Array;case 5:return Array;case 6:return Int8Array;case 8:return Int16Array;case 9:return Int32Array;case 10:return Array;case 11:return Float32Array;case 12:return Float64Array;default:return Array}}(s))(a),h=n;for(let u=0;u<a;u++)d[u]=this.parseTagValue(s,e),e+=h;return d}}parseTagValue(e,t){let{chunk:i}=this;switch(e){case 1:return i.getUint8(t);case 3:return i.getUint16(t);case 4:return i.getUint32(t);case 5:return i.getUint32(t)/i.getUint32(t+4);case 6:return i.getInt8(t);case 8:return i.getInt16(t);case 9:return i.getInt32(t);case 10:return i.getInt32(t)/i.getInt32(t+4);case 11:return i.getFloat(t);case 12:return i.getDouble(t);case 13:return i.getUint32(t);default:Se(`Invalid tiff type ${e}`)}}},Jr=class extends Ss{static canHandle(e,t){return e.getUint8(t+1)===225&&e.getUint32(t+4)===1165519206&&e.getUint16(t+8)===0}parse(){return _(this,null,function*(){this.parseHeader();let{options:e}=this;return e.ifd0.enabled&&(yield this.parseIfd0Block()),e.exif.enabled&&(yield this.safeParse("parseExifBlock")),e.gps.enabled&&(yield this.safeParse("parseGpsBlock")),e.interop.enabled&&(yield this.safeParse("parseInteropBlock")),e.ifd1.enabled&&(yield this.safeParse("parseThumbnailBlock")),this.createOutput()})}safeParse(e){let t=this[e]();return t.catch!==void 0&&(t=t.catch(this.handleError)),t}findIfd0Offset(){this.ifd0Offset===void 0&&(this.ifd0Offset=this.chunk.getUint32(4))}findIfd1Offset(){if(this.ifd1Offset===void 0){this.findIfd0Offset();let e=this.chunk.getUint16(this.ifd0Offset),t=this.ifd0Offset+2+12*e;this.ifd1Offset=this.chunk.getUint32(t)}}parseBlock(e,t){let i=new Map;return this[t]=i,this.parseTags(e,t,i),i}parseIfd0Block(){return _(this,null,function*(){if(this.ifd0)return;let{file:e}=this;this.findIfd0Offset(),this.ifd0Offset<8&&Se("Malformed EXIF data"),!e.chunked&&this.ifd0Offset>e.byteLength&&Se(`IFD0 offset points to outside of file.
|
|
20
|
+
this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&(yield e.ensureChunk(this.ifd0Offset,Gl(this.options)));let t=this.parseBlock(this.ifd0Offset,"ifd0");return t.size!==0?(this.exifOffset=t.get(34665),this.interopOffset=t.get(40965),this.gpsOffset=t.get(34853),this.xmp=t.get(700),this.iptc=t.get(33723),this.icc=t.get(34675),this.options.sanitize&&(t.delete(34665),t.delete(40965),t.delete(34853),t.delete(700),t.delete(33723),t.delete(34675)),t):void 0})}parseExifBlock(){return _(this,null,function*(){if(this.exif||(this.ifd0||(yield this.parseIfd0Block()),this.exifOffset===void 0))return;this.file.tiff&&(yield this.file.ensureChunk(this.exifOffset,Gl(this.options)));let e=this.parseBlock(this.exifOffset,"exif");return this.interopOffset||(this.interopOffset=e.get(40965)),this.makerNote=e.get(37500),this.userComment=e.get(37510),this.options.sanitize&&(e.delete(40965),e.delete(37500),e.delete(37510)),this.unpack(e,41728),this.unpack(e,41729),e})}unpack(e,t){let i=e.get(t);i&&i.length===1&&e.set(t,i[0])}parseGpsBlock(){return _(this,null,function*(){if(this.gps||(this.ifd0||(yield this.parseIfd0Block()),this.gpsOffset===void 0))return;let e=this.parseBlock(this.gpsOffset,"gps");return e&&e.has(2)&&e.has(4)&&(e.set("latitude",Ql(...e.get(2),e.get(1))),e.set("longitude",Ql(...e.get(4),e.get(3)))),e})}parseInteropBlock(){return _(this,null,function*(){if(!this.interop&&(this.ifd0||(yield this.parseIfd0Block()),this.interopOffset!==void 0||this.exif||(yield this.parseExifBlock()),this.interopOffset!==void 0))return this.parseBlock(this.interopOffset,"interop")})}parseThumbnailBlock(e=!1){return _(this,null,function*(){if(!this.ifd1&&!this.ifd1Parsed&&(!this.options.mergeOutput||e))return this.findIfd1Offset(),this.ifd1Offset>0&&(this.parseBlock(this.ifd1Offset,"ifd1"),this.ifd1Parsed=!0),this.ifd1})}extractThumbnail(){return _(this,null,function*(){if(this.headerParsed||this.parseHeader(),this.ifd1Parsed||(yield this.parseThumbnailBlock(!0)),this.ifd1===void 0)return;let e=this.ifd1.get(513),t=this.ifd1.get(514);return this.chunk.getUint8Array(e,t)})}get image(){return this.ifd0}get thumbnail(){return this.ifd1}createOutput(){let e,t,i,o={};for(t of we)if(e=this[t],!ip(e))if(i=this.canTranslate?this.translateBlock(e,t):Object.fromEntries(e),this.options.mergeOutput){if(t==="ifd1")continue;Object.assign(o,i)}else o[t]=i;return this.makerNote&&(o.makerNote=this.makerNote),this.userComment&&(o.userComment=this.userComment),o}assignToOutput(e,t){if(this.globalOptions.mergeOutput)Object.assign(e,t);else for(let[i,o]of Object.entries(t))this.assignObjectToOutput(e,i,o)}};function Ql(r,e,t,i){var o=r+e/60+t/3600;return i!=="S"&&i!=="W"||(o*=-1),o}te(Jr,"type","tiff"),te(Jr,"headerLength",10),Ve.set("tiff",Jr);var Hg=Object.freeze({__proto__:null,default:Dh,Exifr:fr,fileParsers:oo,segmentParsers:Ve,fileReaders:ri,tagKeys:ii,tagValues:Is,tagRevivers:Ds,createDictionary:op,extendDictionary:sp,fetchUrlAsArrayBuffer:eo,readBlobAsArrayBuffer:ei,chunkedProps:dr,otherSegments:so,segments:ti,tiffBlocks:we,segmentsAndBlocks:ur,tiffExtractables:hr,inheritables:ao,allFormatters:cr,Options:Rt,parse:ap}),Cs={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1},$g=Object.assign({},Cs,{firstChunkSize:4e4,gps:[1,2,3,4]});var qg=Object.assign({},Cs,{tiff:!1,ifd1:!0,mergeOutput:!1});var Ah=Object.assign({},Cs,{firstChunkSize:4e4,ifd0:[274]});function Oh(r){return _(this,null,function*(){let e=new fr(Ah);yield e.read(r);let t=yield e.parse();if(t&&t.ifd0)return t.ifd0[274]})}var zh=Object.freeze({1:{dimensionSwapped:!1,scaleX:1,scaleY:1,deg:0,rad:0},2:{dimensionSwapped:!1,scaleX:-1,scaleY:1,deg:0,rad:0},3:{dimensionSwapped:!1,scaleX:1,scaleY:1,deg:180,rad:180*Math.PI/180},4:{dimensionSwapped:!1,scaleX:-1,scaleY:1,deg:180,rad:180*Math.PI/180},5:{dimensionSwapped:!0,scaleX:1,scaleY:-1,deg:90,rad:90*Math.PI/180},6:{dimensionSwapped:!0,scaleX:1,scaleY:1,deg:90,rad:90*Math.PI/180},7:{dimensionSwapped:!0,scaleX:1,scaleY:-1,deg:270,rad:270*Math.PI/180},8:{dimensionSwapped:!0,scaleX:1,scaleY:1,deg:270,rad:270*Math.PI/180}}),Xr=!0,Yr=!0;if(typeof navigator=="object"){let r=navigator.userAgent;if(r.includes("iPad")||r.includes("iPhone")){let e=r.match(/OS (\d+)_(\d+)/);if(e){let[,t,i]=e;Xr=Number(t)+.1*Number(i)<13.4,Yr=!1}}else if(r.includes("OS X 10")){let[,e]=r.match(/OS X 10[_.](\d+)/);Xr=Yr=Number(e)<15}if(r.includes("Chrome/")){let[,e]=r.match(/Chrome\/(\d+)/);Xr=Yr=Number(e)<81}else if(r.includes("Firefox/")){let[,e]=r.match(/Firefox\/(\d+)/);Xr=Yr=Number(e)<77}}function np(r){return _(this,null,function*(){let e=yield Oh(r);return Object.assign({canvas:Xr,css:Yr},zh[e])})}var Fs=class extends Mt{constructor(...e){super(...e),te(this,"ranges",new ks),this.byteLength!==0&&this.ranges.add(0,this.byteLength)}_tryExtend(e,t,i){if(e===0&&this.byteLength===0&&i){let o=new DataView(i.buffer||i,i.byteOffset,i.byteLength);this._swapDataView(o)}else{let o=e+t;if(o>this.byteLength){let{dataView:s}=this._extend(o);this._swapDataView(s)}}}_extend(e){let t;t=rp?tp.allocUnsafe(e):new Uint8Array(e);let i=new DataView(t.buffer,t.byteOffset,t.byteLength);return t.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:t,dataView:i}}subarray(e,t,i=!1){return t=t||this._lengthToEnd(e),i&&this._tryExtend(e,t),this.ranges.add(e,t),super.subarray(e,t)}set(e,t,i=!1){i&&this._tryExtend(t,e.byteLength,e);let o=super.set(e,t);return this.ranges.add(t,o.byteLength),o}ensureChunk(e,t){return _(this,null,function*(){this.chunked&&(this.ranges.available(e,t)||(yield this.readChunk(e,t)))})}available(e,t){return this.ranges.available(e,t)}},ks=class{constructor(){te(this,"list",[])}get length(){return this.list.length}add(e,t,i=0){let o=e+t,s=this.list.filter(a=>Zl(e,a.offset,o)||Zl(e,a.end,o));if(s.length>0){e=Math.min(e,...s.map(n=>n.offset)),o=Math.max(o,...s.map(n=>n.end)),t=o-e;let a=s.shift();a.offset=e,a.length=t,a.end=o,this.list=this.list.filter(n=>!s.includes(n))}else this.list.push({offset:e,length:t,end:o})}available(e,t){let i=e+t;return this.list.some(o=>o.offset<=e&&i<=o.end)}};function Zl(r,e,t){return r<=e&&e<=t}var _s=class extends Fs{constructor(e,t){super(0),te(this,"chunksRead",0),this.input=e,this.options=t}readWhole(){return _(this,null,function*(){this.chunked=!1,yield this.readChunk(this.nextChunkOffset)})}readChunked(){return _(this,null,function*(){this.chunked=!0,yield this.readChunk(0,this.options.firstChunkSize)})}readNextChunk(){return _(this,arguments,function*(e=this.nextChunkOffset){if(this.fullyRead)return this.chunksRead++,!1;let t=this.options.chunkSize,i=yield this.readChunk(e,t);return!!i&&i.byteLength===t})}readChunk(e,t){return _(this,null,function*(){if(this.chunksRead++,(t=this.safeWrapAddress(e,t))!==0)return this._readChunk(e,t)})}safeWrapAddress(e,t){return this.size!==void 0&&e+t>this.size?Math.max(0,this.size-e):t}get nextChunkOffset(){if(this.ranges.list.length!==0)return this.ranges.list[0].length}get canReadNextChunk(){return this.chunksRead<this.options.chunkLimit}get fullyRead(){return this.size!==void 0&&this.nextChunkOffset===this.size}read(){return this.options.chunked?this.readChunked():this.readWhole()}close(){}};ri.set("blob",class extends _s{readWhole(){return _(this,null,function*(){this.chunked=!1;let r=yield ei(this.input);this._swapArrayBuffer(r)})}readChunked(){return this.chunked=!0,this.size=this.input.size,super.readChunked()}_readChunk(r,e){return _(this,null,function*(){let t=e?r+e:void 0,i=this.input.slice(r,t),o=yield ei(i);return this.set(o,r,!0)})}});var lp={strings:{generatingThumbnails:"Generating thumbnails..."}};var Uh={version:"4.0.2"};function Mh(r,e,t){try{r.getContext("2d").getImageData(0,0,1,1)}catch(i){if(i.code===18)return Promise.reject(new Error("cannot read image, probably an svg with external resources"))}return r.toBlob?new Promise(i=>{r.toBlob(i,e,t)}).then(i=>{if(i===null)throw new Error("cannot read image, probably an svg with external resources");return i}):Promise.resolve().then(()=>Vl(r.toDataURL(e,t),{})).then(i=>{if(i===null)throw new Error("could not extract blob, probably an old browser");return i})}function Rh(r,e){let t=r.width,i=r.height;(e.deg===90||e.deg===270)&&(t=r.height,i=r.width);let o=document.createElement("canvas");o.width=t,o.height=i;let s=o.getContext("2d");return s.translate(t/2,i/2),e.canvas&&(s.rotate(e.rad),s.scale(e.scaleX,e.scaleY)),s.drawImage(r,-r.width/2,-r.height/2,r.width,r.height),o}function Nh(r){let e=r.width/r.height,t=5e6,i=4096,o=Math.floor(Math.sqrt(t*e)),s=Math.floor(t/Math.sqrt(t*e));if(o>i&&(o=i,s=Math.round(o/e)),s>i&&(s=i,o=Math.round(e*s)),r.width>o){let a=document.createElement("canvas");return a.width=o,a.height=s,a.getContext("2d").drawImage(r,0,0,o,s),a}return r}var Lh={thumbnailWidth:null,thumbnailHeight:null,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,lazy:!1},mr=class extends He{constructor(e,t){if(super(e,m(m({},Lh),t)),this.onFileAdded=i=>{!i.preview&&i.data&&Zi(i.type)&&!i.isRemote&&this.addToQueue(i.id)},this.onCancelRequest=i=>{let o=this.queue.indexOf(i.id);o!==-1&&this.queue.splice(o,1)},this.onFileRemoved=i=>{let o=this.queue.indexOf(i.id);o!==-1&&this.queue.splice(o,1),i.preview&&Qi(i.preview)&&URL.revokeObjectURL(i.preview)},this.onRestored=()=>{this.uppy.getFiles().filter(o=>o.isRestored).forEach(o=>{(!o.preview||Qi(o.preview))&&this.addToQueue(o.id)})},this.onAllFilesRemoved=()=>{this.queue=[]},this.waitUntilAllProcessed=i=>{i.forEach(s=>{let a=this.uppy.getFile(s);this.uppy.emit("preprocess-progress",a,{mode:"indeterminate",message:this.i18n("generatingThumbnails")})});let o=()=>{i.forEach(s=>{let a=this.uppy.getFile(s);this.uppy.emit("preprocess-complete",a)})};return new Promise(s=>{this.queueProcessing?this.uppy.once("thumbnail:all-generated",()=>{o(),s()}):(o(),s())})},this.type="modifier",this.id=this.opts.id||"ThumbnailGenerator",this.title="Thumbnail Generator",this.queue=[],this.queueProcessing=!1,this.defaultThumbnailDimension=200,this.thumbnailType=this.opts.thumbnailType,this.defaultLocale=lp,this.i18nInit(),this.opts.lazy&&this.opts.waitForThumbnailsBeforeUpload)throw new Error("ThumbnailGenerator: The `lazy` and `waitForThumbnailsBeforeUpload` options are mutually exclusive. Please ensure at most one of them is set to `true`.")}createThumbnail(e,t,i){let o=URL.createObjectURL(e.data),s=new Promise((n,l)=>{let d=new Image;d.src=o,d.addEventListener("load",()=>{URL.revokeObjectURL(o),n(d)}),d.addEventListener("error",h=>{URL.revokeObjectURL(o),l(h.error||new Error("Could not create thumbnail"))})}),a=np(e.data).catch(()=>1);return Promise.all([s,a]).then(n=>{let[l,d]=n,h=this.getProportionalDimensions(l,t,i,d.deg),u=Rh(l,d),g=this.resizeImage(u,h.width,h.height);return Mh(g,this.thumbnailType,80)}).then(n=>URL.createObjectURL(n))}getProportionalDimensions(e,t,i,o){let s=e.width/e.height;return(o===90||o===270)&&(s=e.height/e.width),t!=null?{width:t,height:Math.round(t/s)}:i!=null?{width:Math.round(i*s),height:i}:{width:this.defaultThumbnailDimension,height:Math.round(this.defaultThumbnailDimension/s)}}resizeImage(e,t,i){let o=Nh(e),s=Math.ceil(Math.log2(o.width/t));s<1&&(s=1);let a=t*2**(s-1),n=i*2**(s-1),l=2;for(;s--;){let d=document.createElement("canvas");d.width=a,d.height=n,d.getContext("2d").drawImage(o,0,0,a,n),o=d,a=Math.round(a/l),n=Math.round(n/l)}return o}setPreviewURL(e,t){this.uppy.setFileState(e,{preview:t})}addToQueue(e){this.queue.push(e),this.queueProcessing===!1&&this.processQueue()}processQueue(){if(this.queueProcessing=!0,this.queue.length>0){let e=this.uppy.getFile(this.queue.shift());return e?this.requestThumbnail(e).catch(()=>{}).then(()=>this.processQueue()):(this.uppy.log("[ThumbnailGenerator] file was removed before a thumbnail could be generated, but not removed from the queue. This is probably a bug","error"),Promise.resolve())}return this.queueProcessing=!1,this.uppy.log("[ThumbnailGenerator] Emptied thumbnail queue"),this.uppy.emit("thumbnail:all-generated"),Promise.resolve()}requestThumbnail(e){return Zi(e.type)&&!e.isRemote?this.createThumbnail(e,this.opts.thumbnailWidth,this.opts.thumbnailHeight).then(t=>{this.setPreviewURL(e.id,t),this.uppy.log(`[ThumbnailGenerator] Generated thumbnail for ${e.id}`),this.uppy.emit("thumbnail:generated",this.uppy.getFile(e.id),t)}).catch(t=>{this.uppy.log(`[ThumbnailGenerator] Failed thumbnail for ${e.id}:`,"warning"),this.uppy.log(t,"warning"),this.uppy.emit("thumbnail:error",this.uppy.getFile(e.id),t)}):Promise.resolve()}install(){this.uppy.on("file-removed",this.onFileRemoved),this.uppy.on("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("thumbnail:cancel",this.onCancelRequest)):(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("file-added",this.onFileAdded),this.uppy.on("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.addPreProcessor(this.waitUntilAllProcessed)}uninstall(){this.uppy.off("file-removed",this.onFileRemoved),this.uppy.off("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("thumbnail:cancel",this.onCancelRequest)):(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("file-added",this.onFileAdded),this.uppy.off("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.removePreProcessor(this.waitUntilAllProcessed)}};mr.VERSION=Uh.version;function jh(r){if(typeof r=="string"){let e=document.querySelectorAll(r);return e.length===0?null:Array.from(e)}return typeof r=="object"&&qr(r)?[r]:null}var Bs=jh;var nt=Array.from;function no(r,e,t,i){let{onSuccess:o}=i;r.readEntries(s=>{let a=[...e,...s];s.length?queueMicrotask(()=>{no(r,a,t,{onSuccess:o})}):o(a)},s=>{t(s),o(e)})}function pp(r,e){return r==null?r:{kind:r.isFile?"file":r.isDirectory?"directory":void 0,name:r.name,getFile(){return new Promise((i,o)=>r.file(i,o))},values(){return _i(this,null,function*(){let i=r.createReader(),o=yield new er(new Promise(s=>{no(i,[],e,{onSuccess:a=>s(a.map(n=>pp(n,e)))})}));yield*Ii(o)})},isSameEntry:void 0}}function dp(r,e,t){try{return t===void 0&&(t=void 0),function(){return _i(this,null,function*(){let i=()=>`${e}/${r.name}`;if(r.kind==="file"){let l=yield new er(r.getFile());l!=null?(l.relativePath=e?i():null,yield l):t!=null&&(yield t)}else if(r.kind==="directory")try{for(var o=Di(r.values()),s,a,n;s=!(a=yield new er(o.next())).done;s=!1){let l=a.value;yield*Ii(dp(l,e?i():r.name))}}catch{n=[a]}finally{try{s&&(a=o.return)&&(yield new er(a.call(o)))}finally{if(n)throw n[0]}}else t!=null&&(yield t)})}()}catch(i){return Promise.reject(i)}}function Ts(r,e){return _i(this,null,function*(){let t=yield new er(Promise.all(Array.from(r.items,i=>_(this,null,function*(){var o;let s,a=()=>typeof i.getAsEntry=="function"?i.getAsEntry():i.webkitGetAsEntry();return(o=s)!=null||(s=pp(a(),e)),{fileSystemHandle:s,lastResortFile:i.getAsFile()}}))));for(let{lastResortFile:i,fileSystemHandle:o}of t)if(o!=null)try{yield*Ii(dp(o,"",i))}catch(s){i!=null?yield i:e(s)}else i!=null&&(yield i)})}function Es(r){let e=nt(r.files);return Promise.resolve(e)}function oi(r,e){return _(this,null,function*(){var t;let i=(t=e?.logDropError)!=null?t:Function.prototype;try{let l=[];try{for(var o=Di(Ts(r,i)),s,a,n;s=!(a=yield o.next()).done;s=!1){let d=a.value;l.push(d)}}catch{n=[a]}finally{try{s&&(a=o.return)&&(yield a.call(o))}finally{if(n)throw n[0]}}return l}catch{return Es(r)}})}var Lp=ue(Te(),1);function si(r){return O(m({},r),{type:r.mimeType,extension:r.name?st(r.name).extension:null})}var ai,ve,As,up,ni=0,vp=[],xe=pe,hp=xe.__b,cp=xe.__r,fp=xe.diffed,mp=xe.__c,gp=xe.unmount,yp=xe.__;function zs(r,e){xe.__h&&xe.__h(ve,r,ni||e),ni=0;var t=ve.__H||(ve.__H={__:[],__h:[]});return r>=t.__.length&&t.__.push({}),t.__[r]}function et(r){return ni=1,Hh(xp,r)}function Hh(r,e,t){var i=zs(ai++,2);if(i.t=r,!i.__c&&(i.__=[t?t(e):xp(void 0,e),function(n){var l=i.__N?i.__N[0]:i.__[0],d=i.t(l,n);l!==d&&(i.__N=[d,i.__[1]],i.__c.setState({}))}],i.__c=ve,!ve.u)){var o=function(n,l,d){if(!i.__c.__H)return!0;var h=i.__c.__H.__.filter(function(g){return!!g.__c});if(h.every(function(g){return!g.__N}))return!s||s.call(this,n,l,d);var u=i.__c.props!==n;return h.forEach(function(g){if(g.__N){var y=g.__[0];g.__=g.__N,g.__N=void 0,y!==g.__[0]&&(u=!0)}}),s&&s.call(this,n,l,d)||u};ve.u=!0;var s=ve.shouldComponentUpdate,a=ve.componentWillUpdate;ve.componentWillUpdate=function(n,l,d){if(this.__e){var h=s;s=void 0,o(n,l,d),s=h}a&&a.call(this,n,l,d)},ve.shouldComponentUpdate=o}return i.__N||i.__}function lt(r,e){var t=zs(ai++,3);!xe.__s&&wp(t.__H,e)&&(t.__=r,t.i=e,ve.__H.__h.push(t))}function Nt(r){return ni=5,Lt(function(){return{current:r}},[])}function Lt(r,e){var t=zs(ai++,7);return wp(t.__H,e)&&(t.__=r(),t.__H=e,t.__h=r),t.__}function jt(r,e){return ni=8,Lt(function(){return r},e)}function $h(){for(var r;r=vp.shift();)if(r.__P&&r.__H)try{r.__H.__h.forEach(lo),r.__H.__h.forEach(Os),r.__H.__h=[]}catch(e){r.__H.__h=[],xe.__e(e,r.__v)}}xe.__b=function(r){ve=null,hp&&hp(r)},xe.__=function(r,e){r&&e.__k&&e.__k.__m&&(r.__m=e.__k.__m),yp&&yp(r,e)},xe.__r=function(r){cp&&cp(r),ai=0;var e=(ve=r.__c).__H;e&&(As===ve?(e.__h=[],ve.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.i=t.__N=void 0})):(e.__h.forEach(lo),e.__h.forEach(Os),e.__h=[],ai=0)),As=ve},xe.diffed=function(r){fp&&fp(r);var e=r.__c;e&&e.__H&&(e.__H.__h.length&&(vp.push(e)!==1&&up===xe.requestAnimationFrame||((up=xe.requestAnimationFrame)||qh)($h)),e.__H.__.forEach(function(t){t.i&&(t.__H=t.i),t.i=void 0})),As=ve=null},xe.__c=function(r,e){e.some(function(t){try{t.__h.forEach(lo),t.__h=t.__h.filter(function(i){return!i.__||Os(i)})}catch(i){e.some(function(o){o.__h&&(o.__h=[])}),e=[],xe.__e(i,t.__v)}}),mp&&mp(r,e)},xe.unmount=function(r){gp&&gp(r);var e,t=r.__c;t&&t.__H&&(t.__H.__.forEach(function(i){try{lo(i)}catch(o){e=o}}),t.__H=void 0,e&&xe.__e(e,t.__v))};var bp=typeof requestAnimationFrame=="function";function qh(r){var e,t=function(){clearTimeout(i),bp&&cancelAnimationFrame(e),setTimeout(r)},i=setTimeout(t,100);bp&&(e=requestAnimationFrame(t))}function lo(r){var e=ve,t=r.__c;typeof t=="function"&&(r.__c=void 0,t()),ve=e}function Os(r){var e=ve;r.__c=r.__(),ve=e}function wp(r,e){return!r||r.length!==e.length||e.some(function(t,i){return t!==r[i]})}function xp(r,e){return typeof e=="function"?e(r):e}function Vh(){return p("svg",{width:"26",height:"26",viewBox:"0 0 26 26",xmlns:"http://www.w3.org/2000/svg"},p("g",{fill:"none","fill-rule":"evenodd"},p("circle",{fill:"#FFF",cx:"13",cy:"13",r:"13"}),p("path",{d:"M21.64 13.205c0-.639-.057-1.252-.164-1.841H13v3.481h4.844a4.14 4.14 0 01-1.796 2.716v2.259h2.908c1.702-1.567 2.684-3.875 2.684-6.615z",fill:"#4285F4","fill-rule":"nonzero"}),p("path",{d:"M13 22c2.43 0 4.467-.806 5.956-2.18l-2.908-2.259c-.806.54-1.837.86-3.048.86-2.344 0-4.328-1.584-5.036-3.711H4.957v2.332A8.997 8.997 0 0013 22z",fill:"#34A853","fill-rule":"nonzero"}),p("path",{d:"M7.964 14.71A5.41 5.41 0 017.682 13c0-.593.102-1.17.282-1.71V8.958H4.957A8.996 8.996 0 004 13c0 1.452.348 2.827.957 4.042l3.007-2.332z",fill:"#FBBC05","fill-rule":"nonzero"}),p("path",{d:"M13 7.58c1.321 0 2.508.454 3.44 1.345l2.582-2.58C17.463 4.891 15.426 4 13 4a8.997 8.997 0 00-8.043 4.958l3.007 2.332C8.672 9.163 10.656 7.58 13 7.58z",fill:"#EA4335","fill-rule":"nonzero"}),p("path",{d:"M4 4h18v18H4z"})))}function Wh(r){let{pluginName:e,i18n:t,onAuth:i}=r,o=e==="Google Drive",s=jt(a=>{a.preventDefault(),i()},[i]);return p("form",{onSubmit:s},o?p("button",{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn uppy-Provider-btn-google","data-uppy-super-focusable":!0},p(Vh,null),t("signInWithGoogle")):p("button",{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn","data-uppy-super-focusable":!0},t("authenticateWith",{pluginName:e})))}var Gh=r=>{let{pluginName:e,i18n:t,onAuth:i}=r;return p(Wh,{pluginName:e,i18n:t,onAuth:i})};function po(r){let{loading:e,pluginName:t,pluginIcon:i,i18n:o,handleAuth:s,renderForm:a=Gh}=r;return p("div",{className:"uppy-Provider-auth"},p("div",{className:"uppy-Provider-authIcon"},i()),p("div",{className:"uppy-Provider-authTitle"},o("authenticateWithTitle",{pluginName:t})),a({pluginName:t,i18n:o,loading:e,onAuth:s}))}var Pp=ue(Te(),1);function Us(r){let{i18n:e,logout:t,username:i}=r;return p(je,null,i&&p("span",{className:"uppy-ProviderBrowser-user",key:"username"},i),p("button",{type:"button",onClick:t,className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowser-userLogout",key:"logout"},e("logOut")))}function Ms(r){let{openFolder:e,title:t,breadcrumbsIcon:i,breadcrumbs:o,i18n:s}=r;return p("div",{className:"uppy-Provider-breadcrumbs"},p("div",{className:"uppy-Provider-breadcrumbsIcon"},i),o.map((a,n)=>{var l;return p(je,null,p("button",{key:a.id,type:"button",className:"uppy-u-reset uppy-c-btn",onClick:()=>e(a.id)},a.type==="root"?t:(l=a.data.name)!=null?l:s("unnamed")),o.length===n+1?"":" / ")}))}function Rs(r){return p("div",{className:"uppy-ProviderBrowser-header"},p("div",{className:(0,Pp.default)("uppy-ProviderBrowser-headerBar",!r.showBreadcrumbs&&"uppy-ProviderBrowser-headerBar--simple")},r.showBreadcrumbs&&p(Ms,{openFolder:r.openFolder,breadcrumbs:r.breadcrumbs,breadcrumbsIcon:r.pluginIcon&&r.pluginIcon(),title:r.title,i18n:r.i18n}),p(Us,{logout:r.logout,username:r.username,i18n:r.i18n})))}function Ns(){return Ns=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(r[i]=t[i])}return r},Ns.apply(null,arguments)}var Kh={position:"relative",width:"100%",minHeight:"100%"},Xh={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"},Ls=class extends Me{constructor(e){super(e),this.handleScroll=()=>{this.setState({offset:this.base.scrollTop})},this.handleResize=()=>{this.resize()},this.focusElement=null,this.state={offset:0,height:0}}componentDidMount(){this.resize(),window.addEventListener("resize",this.handleResize)}componentWillUpdate(){this.base.contains(document.activeElement)&&(this.focusElement=document.activeElement)}componentDidUpdate(){this.focusElement&&this.focusElement.parentNode&&document.activeElement!==this.focusElement&&this.focusElement.focus(),this.focusElement=null,this.resize()}componentWillUnmount(){window.removeEventListener("resize",this.handleResize)}resize(){let{height:e}=this.state;e!==this.base.offsetHeight&&this.setState({height:this.base.offsetHeight})}render(e){let B=e,{data:t,rowHeight:i,renderRow:o,overscanCount:s=10}=B,a=ki(B,["data","rowHeight","renderRow","overscanCount"]),{offset:n,height:l}=this.state,d=Math.floor(n/i),h=Math.floor(l/i);s&&(d=Math.max(0,d-d%s),h+=s);let u=d+h+4,g=t.slice(d,u),y=O(m({},Kh),{height:t.length*i}),w=O(m({},Xh),{top:d*i});return p("div",Ns({onScroll:this.handleScroll},a),p("div",{role:"presentation",style:y},p("div",{role:"presentation",style:w},g.map(o))))}},uo=Ls;var Sp=ue(Te(),1);function Yh(){return p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:11,height:14.5,viewBox:"0 0 44 58"},p("path",{d:"M27.437.517a1 1 0 0 0-.094.03H4.25C2.037.548.217 2.368.217 4.58v48.405c0 2.212 1.82 4.03 4.03 4.03H39.03c2.21 0 4.03-1.818 4.03-4.03V15.61a1 1 0 0 0-.03-.28 1 1 0 0 0 0-.093 1 1 0 0 0-.03-.032 1 1 0 0 0 0-.03 1 1 0 0 0-.032-.063 1 1 0 0 0-.03-.063 1 1 0 0 0-.032 0 1 1 0 0 0-.03-.063 1 1 0 0 0-.032-.03 1 1 0 0 0-.03-.063 1 1 0 0 0-.063-.062l-14.593-14a1 1 0 0 0-.062-.062A1 1 0 0 0 28 .708a1 1 0 0 0-.374-.157 1 1 0 0 0-.156 0 1 1 0 0 0-.03-.03l-.003-.003zM4.25 2.547h22.218v9.97c0 2.21 1.82 4.03 4.03 4.03h10.564v36.438a2.02 2.02 0 0 1-2.032 2.032H4.25c-1.13 0-2.032-.9-2.032-2.032V4.58c0-1.13.902-2.032 2.03-2.032zm24.218 1.345l10.375 9.937.75.718H30.5c-1.13 0-2.032-.9-2.032-2.03V3.89z"}))}function Jh(){return p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",style:{minWidth:16,marginRight:3},viewBox:"0 0 276.157 276.157"},p("path",{d:"M273.08 101.378c-3.3-4.65-8.86-7.32-15.254-7.32h-24.34V67.59c0-10.2-8.3-18.5-18.5-18.5h-85.322c-3.63 0-9.295-2.875-11.436-5.805l-6.386-8.735c-4.982-6.814-15.104-11.954-23.546-11.954H58.73c-9.292 0-18.638 6.608-21.737 15.372l-2.033 5.752c-.958 2.71-4.72 5.37-7.596 5.37H18.5C8.3 49.09 0 57.39 0 67.59v167.07c0 .886.16 1.73.443 2.52.152 3.306 1.18 6.424 3.053 9.064 3.3 4.652 8.86 7.32 15.255 7.32h188.487c11.395 0 23.27-8.425 27.035-19.18l40.677-116.188c2.11-6.035 1.43-12.164-1.87-16.816zM18.5 64.088h8.864c9.295 0 18.64-6.607 21.738-15.37l2.032-5.75c.96-2.712 4.722-5.373 7.597-5.373h29.565c3.63 0 9.295 2.876 11.437 5.806l6.386 8.735c4.982 6.815 15.104 11.954 23.546 11.954h85.322c1.898 0 3.5 1.602 3.5 3.5v26.47H69.34c-11.395 0-23.27 8.423-27.035 19.178L15 191.23V67.59c0-1.898 1.603-3.5 3.5-3.5zm242.29 49.15l-40.676 116.188c-1.674 4.78-7.812 9.135-12.877 9.135H18.75c-1.447 0-2.576-.372-3.02-.997-.442-.625-.422-1.814.057-3.18l40.677-116.19c1.674-4.78 7.812-9.134 12.877-9.134h188.487c1.448 0 2.577.372 3.02.997.443.625.423 1.814-.056 3.18z"}))}function Qh(){return p("svg",{"aria-hidden":"true",focusable:"false",style:{width:16,marginRight:4},viewBox:"0 0 58 58"},p("path",{d:"M36.537 28.156l-11-7a1.005 1.005 0 0 0-1.02-.033C24.2 21.3 24 21.635 24 22v14a1 1 0 0 0 1.537.844l11-7a1.002 1.002 0 0 0 0-1.688zM26 34.18V23.82L34.137 29 26 34.18z"}),p("path",{d:"M57 6H1a1 1 0 0 0-1 1v44a1 1 0 0 0 1 1h56a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1zM10 28H2v-9h8v9zm-8 2h8v9H2v-9zm10 10V8h34v42H12V40zm44-12h-8v-9h8v9zm-8 2h8v9h-8v-9zm8-22v9h-8V8h8zM2 8h8v9H2V8zm0 42v-9h8v9H2zm54 0h-8v-9h8v9z"}))}function gr(r){let{itemIconString:e,alt:t=void 0}=r;if(e===null)return null;switch(e){case"file":return p(Yh,null);case"folder":return p(Jh,null);case"video":return p(Qh,null);default:return p("img",{src:e,alt:t,referrerPolicy:"no-referrer",loading:"lazy",width:16,height:16})}}function Zh(r){var e,t;let{file:i,toggleCheckbox:o,className:s,isDisabled:a,restrictionError:n,showTitles:l,children:d=null,i18n:h}=r;return p("li",{className:s,title:a&&n?n:void 0},p("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox uppy-ProviderBrowserItem-checkbox--grid",onChange:o,name:"listitem",id:i.id,checked:i.status==="checked",disabled:a,"data-uppy-super-focusable":!0}),p("label",{htmlFor:i.id,"aria-label":(e=i.data.name)!=null?e:h("unnamed"),className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},p(gr,{itemIconString:i.data.thumbnail||i.data.icon}),l&&((t=i.data.name)!=null?t:h("unnamed")),d))}var js=Zh;function Hs(r){var e,t,i;let{file:o,openFolder:s,className:a,isDisabled:n,restrictionError:l,toggleCheckbox:d,showTitles:h,i18n:u}=r;return p("li",{className:a,title:o.status!=="checked"&&l?l:void 0},p("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox",onChange:d,name:"listitem",id:o.id,checked:o.status==="checked","aria-label":o.data.isFolder?u("allFilesFromFolderNamed",{name:(e=o.data.name)!=null?e:u("unnamed")}):null,disabled:n,"data-uppy-super-focusable":!0}),o.data.isFolder?p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowserItem-inner",onClick:()=>s(o.id),"aria-label":u("openFolderNamed",{name:(t=o.data.name)!=null?t:u("unnamed")})},p("div",{className:"uppy-ProviderBrowserItem-iconWrap"},p(gr,{itemIconString:o.data.icon})),h&&o.data.name?p("span",null,o.data.name):u("unnamed")):p("label",{htmlFor:o.id,className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},p("div",{className:"uppy-ProviderBrowserItem-iconWrap"},p(gr,{itemIconString:o.data.icon})),h&&((i=o.data.name)!=null?i:u("unnamed"))))}function $s(r){let{viewType:e,toggleCheckbox:t,showTitles:i,i18n:o,openFolder:s,file:a}=r,n=a.type==="folder"?null:a.restrictionError,l=!!n&&a.status!=="checked",d={file:a,openFolder:s,toggleCheckbox:t,i18n:o,viewType:e,showTitles:i,className:(0,Sp.default)("uppy-ProviderBrowserItem",{"uppy-ProviderBrowserItem--disabled":l},{"uppy-ProviderBrowserItem--noPreview":a.data.icon==="video"},{"uppy-ProviderBrowserItem--is-checked":a.status==="checked"},{"uppy-ProviderBrowserItem--is-partial":a.status==="partial"}),isDisabled:l,restrictionError:n};switch(e){case"grid":return p(js,d);case"list":return p(Hs,d);case"unsplash":return p(js,d,p("a",{href:`${a.data.author.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer",className:"uppy-ProviderBrowserItem-author",tabIndex:-1},a.data.author.name));default:throw new Error(`There is no such type ${e}`)}}function ec(r){let{displayedPartialTree:e,viewType:t,toggleCheckbox:i,handleScroll:o,showTitles:s,i18n:a,isLoading:n,openFolder:l,noResultsLabel:d,virtualList:h}=r,[u,g]=et(!1);if(lt(()=>{let w=$=>{$.key==="Shift"&&g(!1)},B=$=>{$.key==="Shift"&&g(!0)};return document.addEventListener("keyup",w),document.addEventListener("keydown",B),()=>{document.removeEventListener("keyup",w),document.removeEventListener("keydown",B)}},[]),n)return p("div",{className:"uppy-Provider-loading"},typeof n=="string"?n:a("loading"));if(e.length===0)return p("div",{className:"uppy-Provider-empty"},d);let y=w=>p($s,{viewType:t,toggleCheckbox:B=>{var $;B.stopPropagation(),B.preventDefault(),($=document.getSelection())==null||$.removeAllRanges(),i(w,u)},showTitles:s,i18n:a,openFolder:l,file:w});return h?p("div",{className:"uppy-ProviderBrowser-body"},p("ul",{className:"uppy-ProviderBrowser-list"},p(uo,{data:e,renderRow:y,rowHeight:31}))):p("div",{className:"uppy-ProviderBrowser-body"},p("ul",{className:"uppy-ProviderBrowser-list",onScroll:o,role:"listbox",tabIndex:-1},e.map(y)))}var ho=ec;var tc=(r,e,t,i,o)=>{let s=e.filter(y=>y.isFolder===!0),a=e.filter(y=>y.isFolder===!1),n=t.type==="folder"&&t.status==="checked",l=s.map(y=>({type:"folder",id:y.requestPath,cached:!1,nextPagePath:null,status:n?"checked":"unchecked",parentId:t.id,data:y})),d=a.map(y=>{let w=o(y);return{type:"file",id:y.requestPath,restrictionError:w,status:n&&!w?"checked":"unchecked",parentId:t.id,data:y}}),h=O(m({},t),{cached:!0,nextPagePath:i});return[...r.map(y=>y.id===h.id?h:y),...l,...d]},Fp=tc;var rc=(r,e,t,i,o)=>{let s=r.find(w=>w.id===e),a=t.filter(w=>w.isFolder===!0),n=t.filter(w=>w.isFolder===!1),l=O(m({},s),{nextPagePath:i}),d=r.map(w=>w.id===l.id?l:w),h=l.type==="folder"&&l.status==="checked",u=a.map(w=>({type:"folder",id:w.requestPath,cached:!1,nextPagePath:null,status:h?"checked":"unchecked",parentId:l.id,data:w})),g=n.map(w=>{let B=o(w);return{type:"file",id:w.requestPath,restrictionError:B,status:h&&!B?"checked":"unchecked",parentId:l.id,data:w}});return[...d,...u,...g]},kp=rc;var ic=r=>r.map(e=>m({},e)),co=ic;var qs=(r,e,t)=>{r.filter(o=>o.type!=="root"&&o.parentId===e).forEach(o=>{o.status=t&&!(o.type==="file"&&o.restrictionError)?"checked":"unchecked",qs(r,o.id,t)})},Vs=(r,e)=>{let t=r.find(a=>a.id===e);if(t.type==="root")return;let i=r.filter(a=>a.type!=="root"&&a.parentId===t.id&&!(a.type==="file"&&a.restrictionError)),o=i.every(a=>a.status==="checked"),s=i.every(a=>a.status==="unchecked");o?t.status="checked":s?t.status="unchecked":t.status="partial",Vs(r,t.parentId)},oc=(r,e)=>{let t=co(r);if(e.length>=2){let i=t.filter(o=>o.type!=="root"&&e.includes(o.id));i.forEach(o=>{o.type==="file"?o.status=o.restrictionError?"unchecked":"checked":o.status="checked"}),i.forEach(o=>{qs(t,o.id,!0)}),Vs(t,i[0].parentId)}else{let i=t.find(o=>o.id===e[0]);i.status=i.status==="checked"?"unchecked":"checked",qs(t,i.id,i.status==="checked"),Vs(t,i.parentId)}return t},_p=oc;var Gs=ue(Dp(),1);var pi=class extends Error{constructor(e){super(e),this.name="TimeoutError"}},Ks=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}},Cp=r=>globalThis.DOMException===void 0?new Ks(r):new DOMException(r),Bp=r=>{let e=r.reason===void 0?Cp("This operation was aborted."):r.reason;return e instanceof Error?e:Cp(e)};function Xs(r,e){let{milliseconds:t,fallback:i,message:o,customTimers:s={setTimeout,clearTimeout}}=e,a,l=new Promise((d,h)=>{if(typeof t!="number"||Math.sign(t)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);if(e.signal){let{signal:g}=e;g.aborted&&h(Bp(g));let y=()=>{h(Bp(g))};g.addEventListener("abort",y,{once:!0}),r.finally(()=>{g.removeEventListener("abort",y)})}if(t===Number.POSITIVE_INFINITY){r.then(d,h);return}let u=new pi;a=s.setTimeout.call(void 0,()=>{if(i){try{d(i())}catch(g){h(g)}return}typeof r.cancel=="function"&&r.cancel(),o===!1?d():o instanceof Error?h(o):(u.message=o??`Promise timed out after ${t} milliseconds`,h(u))},t),_(this,null,function*(){try{d(yield r)}catch(g){h(g)}})}).finally(()=>{l.clear()});return l.clear=()=>{s.clearTimeout.call(void 0,a),a=void 0},l}function Ys(r,e,t){let i=0,o=r.length;for(;o>0;){let s=Math.trunc(o/2),a=i+s;t(r[a],e)<=0?(i=++a,o-=s+1):o=s}return i}var mo=class{#e=[];enqueue(e,t){t=m({priority:0},t);let i={priority:t.priority,run:e};if(this.size&&this.#e[this.size-1].priority>=t.priority){this.#e.push(i);return}let o=Ys(this.#e,i,(s,a)=>a.priority-s.priority);this.#e.splice(o,0,i)}dequeue(){return this.#e.shift()?.run}filter(e){return this.#e.filter(t=>t.priority===e.priority).map(t=>t.run)}get size(){return this.#e.length}};var go=class extends Gs.default{#e;#a;#s=0;#c;#n;#f=0;#r;#l;#t;#m;#i=0;#p;#o;#g;timeout;constructor(e){if(super(),e=m({carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:mo},e),!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${e.intervalCap?.toString()??""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${e.interval?.toString()??""}\` (${typeof e.interval})`);this.#e=e.carryoverConcurrencyCount,this.#a=e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,this.#c=e.intervalCap,this.#n=e.interval,this.#t=new e.queueClass,this.#m=e.queueClass,this.concurrency=e.concurrency,this.timeout=e.timeout,this.#g=e.throwOnTimeout===!0,this.#o=e.autoStart===!1}get#v(){return this.#a||this.#s<this.#c}get#w(){return this.#i<this.#p}#x(){this.#i--,this.#d(),this.emit("next")}#P(){this.#b(),this.#y(),this.#l=void 0}get#S(){let e=Date.now();if(this.#r===void 0){let t=this.#f-e;if(t<0)this.#s=this.#e?this.#i:0;else return this.#l===void 0&&(this.#l=setTimeout(()=>{this.#P()},t)),!0}return!1}#d(){if(this.#t.size===0)return this.#r&&clearInterval(this.#r),this.#r=void 0,this.emit("empty"),this.#i===0&&this.emit("idle"),!1;if(!this.#o){let e=!this.#S;if(this.#v&&this.#w){let t=this.#t.dequeue();return t?(this.emit("active"),t(),e&&this.#y(),!0):!1}}return!1}#y(){this.#a||this.#r!==void 0||(this.#r=setInterval(()=>{this.#b()},this.#n),this.#f=Date.now()+this.#n)}#b(){this.#s===0&&this.#i===0&&this.#r&&(clearInterval(this.#r),this.#r=void 0),this.#s=this.#e?this.#i:0,this.#u()}#u(){for(;this.#d(););}get concurrency(){return this.#p}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this.#p=e,this.#u()}#F(e){return _(this,null,function*(){return new Promise((t,i)=>{e.addEventListener("abort",()=>{i(e.reason)},{once:!0})})})}add(i){return _(this,arguments,function*(e,t={}){return t=m({timeout:this.timeout,throwOnTimeout:this.#g},t),new Promise((o,s)=>{this.#t.enqueue(()=>_(this,null,function*(){this.#i++,this.#s++;try{t.signal?.throwIfAborted();let a=e({signal:t.signal});t.timeout&&(a=Xs(Promise.resolve(a),{milliseconds:t.timeout})),t.signal&&(a=Promise.race([a,this.#F(t.signal)]));let n=yield a;o(n),this.emit("completed",n)}catch(a){if(a instanceof pi&&!t.throwOnTimeout){o();return}s(a),this.emit("error",a)}finally{this.#x()}}),t),this.emit("add"),this.#d()})})}addAll(e,t){return _(this,null,function*(){return Promise.all(e.map(i=>_(this,null,function*(){return this.add(i,t)})))})}start(){return this.#o?(this.#o=!1,this.#u(),this):this}pause(){this.#o=!0}clear(){this.#t=new this.#m}onEmpty(){return _(this,null,function*(){this.#t.size!==0&&(yield this.#h("empty"))})}onSizeLessThan(e){return _(this,null,function*(){this.#t.size<e||(yield this.#h("next",()=>this.#t.size<e))})}onIdle(){return _(this,null,function*(){this.#i===0&&this.#t.size===0||(yield this.#h("idle"))})}#h(e,t){return _(this,null,function*(){return new Promise(i=>{let o=()=>{t&&!t()||(this.off(e,o),i())};this.on(e,o)})})}get size(){return this.#t.size}sizeBy(e){return this.#t.filter(e).length}get pending(){return this.#i}get isPaused(){return this.#o}};var Tp=(r,e,t,i,o)=>_(void 0,null,function*(){let s=[],a=t.cached?t.nextPagePath:t.id;for(;a;){let u=yield i(a);s=s.concat(u.items),a=u.nextPagePath}let n=s.filter(u=>u.isFolder===!0),l=s.filter(u=>u.isFolder===!1),d=n.map(u=>({type:"folder",id:u.requestPath,cached:!1,nextPagePath:null,status:"checked",parentId:t.id,data:u})),h=l.map(u=>{let g=o(u);return{type:"file",id:u.requestPath,restrictionError:g,status:g?"unchecked":"checked",parentId:t.id,data:u}});t.cached=!0,t.nextPagePath=null,e.push(...h,...d),d.forEach(u=>_(void 0,null,function*(){r.add(()=>Tp(r,e,u,i,o))}))}),nc=(r,e,t,i)=>_(void 0,null,function*(){let o=new go({concurrency:6}),s=co(r);return s.filter(n=>n.type==="folder"&&n.status==="checked"&&(n.cached===!1||n.nextPagePath)).forEach(n=>{o.add(()=>Tp(o,s,n,e,t))}),o.on("completed",()=>{let n=s.filter(l=>l.type==="file"&&l.status==="checked").length;i(n)}),yield o.onIdle(),s}),Ep=nc;var Ht={afterOpenFolder:Fp,afterScrollFolder:kp,afterToggleCheckbox:_p,afterFill:Ep};var lc=r=>{let{scrollHeight:e,scrollTop:t,offsetHeight:i}=r.target;return e-(t+i)<50},yo=lc;var pc=r=>e=>{if(!e.isAuthError){if(e.name==="AbortError"){r.log("Aborting request","warning");return}r.log(e,"error"),e.name==="UserFacingApiError"&&r.info({message:r.i18n("companionError"),details:r.i18n(e.message)},"warning",5e3)}},vt=pc;var dc=(r,e,t,i)=>{let o=e.findIndex(s=>s.id===i);if(o!==-1&&t){let s=e.findIndex(n=>n.id===r);return e.slice(Math.min(o,s),Math.max(o,s)+1).map(n=>n.id)}return[r]},bo=dc;function uc(r){let{searchString:e,setSearchString:t,submitSearchString:i,wrapperClassName:o,inputClassName:s,inputLabel:a,clearSearchLabel:n="",showButton:l=!1,buttonLabel:d="",buttonCSSClassName:h=""}=r,u=w=>{t(w.target.value)},g=jt(w=>{w.preventDefault(),i()},[i]),[y]=et(()=>{let w=document.createElement("form");return w.setAttribute("tabindex","-1"),w.id=Ft(),w});return lt(()=>(document.body.appendChild(y),y.addEventListener("submit",g),()=>{y.removeEventListener("submit",g),document.body.removeChild(y)}),[y,g]),p("section",{className:o},p("input",{className:`uppy-u-reset ${s}`,type:"search","aria-label":a,placeholder:a,value:e,onInput:u,form:y.id,"data-uppy-super-focusable":!0}),!l&&p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-ProviderBrowser-searchFilterIcon",width:"12",height:"12",viewBox:"0 0 12 12"},p("path",{d:"M8.638 7.99l3.172 3.172a.492.492 0 1 1-.697.697L7.91 8.656a4.977 4.977 0 0 1-2.983.983C2.206 9.639 0 7.481 0 4.819 0 2.158 2.206 0 4.927 0c2.721 0 4.927 2.158 4.927 4.82a4.74 4.74 0 0 1-1.216 3.17zm-3.71.685c2.176 0 3.94-1.726 3.94-3.856 0-2.129-1.764-3.855-3.94-3.855C2.75.964.984 2.69.984 4.819c0 2.13 1.765 3.856 3.942 3.856z"})),!l&&e&&p("button",{className:"uppy-u-reset uppy-ProviderBrowser-searchFilterReset",type:"button","aria-label":n,title:n,onClick:()=>t("")},p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",viewBox:"0 0 19 19"},p("path",{d:"M17.318 17.232L9.94 9.854 9.586 9.5l-.354.354-7.378 7.378h.707l-.62-.62v.706L9.318 9.94l.354-.354-.354-.354L1.94 1.854v.707l.62-.62h-.706l7.378 7.378.354.354.354-.354 7.378-7.378h-.707l.622.62v-.706L9.854 9.232l-.354.354.354.354 7.378 7.378.708-.707-7.38-7.378v.708l7.38-7.38.353-.353-.353-.353-.622-.622-.353-.353-.354.352-7.378 7.38h.708L2.56 1.23 2.208.88l-.353.353-.622.62-.353.355.352.353 7.38 7.38v-.708l-7.38 7.38-.353.353.352.353.622.622.353.353.354-.353 7.38-7.38h-.708l7.38 7.38z"}))),l&&p("button",{className:`uppy-u-reset uppy-c-btn uppy-c-btn-primary ${h}`,type:"submit",form:y.id},d))}var yr=uc;var Op=ue(Te(),1);var hc=r=>r.filter(t=>t.type==="file"&&t.status==="checked"?!0:t.type==="folder"&&t.status==="checked"?!r.some(o=>o.type!=="root"&&o.parentId===t.id):!1).length,Ap=hc;function di(r){let{cancelSelection:e,donePicking:t,i18n:i,partialTree:o,validateAggregateRestrictions:s}=r,a=Lt(()=>s(o),[o,s]),n=Lt(()=>Ap(o),[o]);return n===0?null:p("div",{className:"uppy-ProviderBrowser-footer"},p("div",{className:"uppy-ProviderBrowser-footer-buttons"},p("button",{className:(0,Op.default)("uppy-u-reset uppy-c-btn uppy-c-btn-primary",{"uppy-c-btn--disabled":a}),disabled:!!a,onClick:t,type:"button"},i("selectX",{smart_count:n})),p("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link",onClick:e,type:"button"},i("cancel"))),a&&p("div",{className:"uppy-ProviderBrowser-footer-error"},a))}var cc=(r,e,t)=>{var i,o;return{id:r.id,source:e.id,name:r.name||r.id,type:r.mimeType,isRemote:!0,data:r,preview:r.thumbnail||void 0,meta:{authorName:(i=r.author)==null?void 0:i.name,authorUrl:(o=r.author)==null?void 0:o.url,relativePath:r.relDirPath||null,absolutePath:r.absDirPath},body:{fileId:r.id},remote:{companionUrl:e.opts.companionUrl,url:`${t.fileUrl(r.requestPath)}`,body:{fileId:r.id},providerName:t.name,provider:t.provider,requestClientId:t.provider}}},zp=cc;var fc=(r,e,t)=>{let i=r.map(a=>zp(a,e,t)),o=[],s=[];i.forEach(a=>{e.uppy.checkIfFileAlreadyExists(Ri(a,e.uppy.getID()))?s.push(a):o.push(a)}),o.length>0&&e.uppy.info(e.uppy.i18n("addedNumFiles",{numFiles:o.length})),s.length>0&&e.uppy.info(`Not adding ${s.length} files because they already exist`),e.uppy.addFiles(o)},vo=fc;var Up=(r,e,t)=>{let i=e===null?"null":e;if(t[i])return t[i];let o=r.find(a=>a.id===e);if(o.type==="root")return[];let s=[...Up(r,o.parentId,t),o];return t[i]=s,s},mc=r=>{let e=Object.create(null);return r.filter(o=>o.type==="file"&&o.status==="checked").map(o=>{let s=Up(r,o.id,e),a=s.findIndex(h=>h.type==="folder"&&h.status==="checked"),n=s.slice(a),l=`/${s.map(h=>h.data.name).join("/")}`,d=n.length===1?void 0:n.map(h=>h.data.name).join("/");return O(m({},o.data),{absDirPath:l,relDirPath:d})})},wo=mc;var gc=(r,e)=>{let t=r.find(o=>o.id===e),i=[];for(;i=[t,...i],t.type!=="root";){let o=t.parentId;t=r.find(s=>s.id===o)}return i},Mp=gc;function _t(r,e){if(!{}.hasOwnProperty.call(r,e))throw new TypeError("attempted to use private field on non-instance");return r}var yc=0;function Np(r){return"__private_"+yc+++"_"+r}var bc={version:"4.2.0"};function hi(){return p("svg",{"aria-hidden":"true",focusable:"false",width:"30",height:"30",viewBox:"0 0 30 30"},p("path",{d:"M15 30c8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15C6.716 0 0 6.716 0 15c0 8.284 6.716 15 15 15zm4.258-12.676v6.846h-8.426v-6.846H5.204l9.82-12.364 9.82 12.364H19.26z"}))}var Rp=r=>({authenticated:void 0,partialTree:[{type:"root",id:r,cached:!1,nextPagePath:null}],currentFolderId:r,searchString:"",didFirstRender:!1,username:null,loading:!1}),$t=Np("abortController"),tt=Np("withAbort"),ui=class{constructor(e,t){Object.defineProperty(this,tt,{value:vc}),this.isHandlingScroll=!1,this.lastCheckbox=null,Object.defineProperty(this,$t,{writable:!0,value:void 0}),this.validateSingleFile=o=>{let s=si(o);return this.plugin.uppy.validateSingleFile(s)},this.getDisplayedPartialTree=()=>{let{partialTree:o,currentFolderId:s,searchString:a}=this.plugin.getPluginState(),n=o.filter(d=>d.type!=="root"&&d.parentId===s);return a===""?n:n.filter(d=>{var h;return((h=d.data.name)!=null?h:this.plugin.uppy.i18n("unnamed")).toLowerCase().indexOf(a.toLowerCase())!==-1})},this.validateAggregateRestrictions=o=>{let a=o.filter(n=>n.type==="file"&&n.status==="checked").map(n=>n.data);return this.plugin.uppy.validateAggregateRestrictions(a)},this.plugin=e,this.provider=t.provider;let i={viewType:"list",showTitles:!0,showFilter:!0,showBreadcrumbs:!0,loadAllFiles:!1,virtualList:!1};this.opts=m(m({},i),t),this.openFolder=this.openFolder.bind(this),this.logout=this.logout.bind(this),this.handleAuth=this.handleAuth.bind(this),this.handleScroll=this.handleScroll.bind(this),this.resetPluginState=this.resetPluginState.bind(this),this.donePicking=this.donePicking.bind(this),this.render=this.render.bind(this),this.cancelSelection=this.cancelSelection.bind(this),this.toggleCheckbox=this.toggleCheckbox.bind(this),this.resetPluginState(),this.plugin.uppy.on("dashboard:close-panel",this.resetPluginState),this.plugin.uppy.registerRequestClient(this.provider.provider,this.provider)}resetPluginState(){this.plugin.setPluginState(Rp(this.plugin.rootFolderId))}tearDown(){}setLoading(e){this.plugin.setPluginState({loading:e})}cancelSelection(){let{partialTree:e}=this.plugin.getPluginState(),t=e.map(i=>i.type==="root"?i:O(m({},i),{status:"unchecked"}));this.plugin.setPluginState({partialTree:t})}openFolder(e){return _(this,null,function*(){this.lastCheckbox=null;let{partialTree:t}=this.plugin.getPluginState(),i=t.find(o=>o.id===e);if(i.cached){this.plugin.setPluginState({currentFolderId:e,searchString:""});return}this.setLoading(!0),yield _t(this,tt)[tt](o=>_(this,null,function*(){let s=e,a=[];do{let{username:l,nextPagePath:d,items:h}=yield this.provider.list(s,{signal:o});this.plugin.setPluginState({username:l}),s=d,a=a.concat(h),this.setLoading(this.plugin.uppy.i18n("loadedXFiles",{numFiles:a.length}))}while(this.opts.loadAllFiles&&s);let n=Ht.afterOpenFolder(t,a,i,s,this.validateSingleFile);this.plugin.setPluginState({partialTree:n,currentFolderId:e,searchString:""})})).catch(vt(this.plugin.uppy)),this.setLoading(!1)})}logout(){return _(this,null,function*(){yield _t(this,tt)[tt](e=>_(this,null,function*(){let t=yield this.provider.logout({signal:e});if(t.ok){if(!t.revoked){let i=this.plugin.uppy.i18n("companionUnauthorizeHint",{provider:this.plugin.title,url:t.manual_revoke_url});this.plugin.uppy.info(i,"info",7e3)}this.plugin.setPluginState(O(m({},Rp(this.plugin.rootFolderId)),{authenticated:!1}))}})).catch(vt(this.plugin.uppy))})}handleAuth(e){return _(this,null,function*(){yield _t(this,tt)[tt](t=>_(this,null,function*(){this.setLoading(!0),yield this.provider.login({authFormData:e,signal:t}),this.plugin.setPluginState({authenticated:!0}),yield Promise.all([this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId)])})).catch(vt(this.plugin.uppy)),this.setLoading(!1)})}handleScroll(e){return _(this,null,function*(){let{partialTree:t,currentFolderId:i}=this.plugin.getPluginState(),o=t.find(s=>s.id===i);yo(e)&&!this.isHandlingScroll&&o.nextPagePath&&(this.isHandlingScroll=!0,yield _t(this,tt)[tt](s=>_(this,null,function*(){let{nextPagePath:a,items:n}=yield this.provider.list(o.nextPagePath,{signal:s}),l=Ht.afterScrollFolder(t,i,n,a,this.validateSingleFile);this.plugin.setPluginState({partialTree:l})})).catch(vt(this.plugin.uppy)),this.isHandlingScroll=!1)})}donePicking(){return _(this,null,function*(){let{partialTree:e}=this.plugin.getPluginState();this.setLoading(!0),yield _t(this,tt)[tt](t=>_(this,null,function*(){let i=yield Ht.afterFill(e,a=>this.provider.list(a,{signal:t}),this.validateSingleFile,a=>{this.setLoading(this.plugin.uppy.i18n("addedNumFiles",{numFiles:a}))});if(this.validateAggregateRestrictions(i)){this.plugin.setPluginState({partialTree:i});return}let s=wo(i);vo(s,this.plugin,this.provider),this.resetPluginState()})).catch(vt(this.plugin.uppy)),this.setLoading(!1)})}toggleCheckbox(e,t){let{partialTree:i}=this.plugin.getPluginState(),o=bo(e.id,this.getDisplayedPartialTree(),t,this.lastCheckbox),s=Ht.afterToggleCheckbox(i,o);this.plugin.setPluginState({partialTree:s}),this.lastCheckbox=e.id}render(e,t){t===void 0&&(t={});let{didFirstRender:i}=this.plugin.getPluginState(),{i18n:o}=this.plugin.uppy;i||(this.plugin.setPluginState({didFirstRender:!0}),this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId));let s=m(m({},this.opts),t),{authenticated:a,loading:n}=this.plugin.getPluginState(),l=this.plugin.icon||hi;if(a===!1)return p(po,{pluginName:this.plugin.title,pluginIcon:l,handleAuth:this.handleAuth,i18n:this.plugin.uppy.i18n,renderForm:s.renderAuthForm,loading:n});let{partialTree:d,currentFolderId:h,username:u,searchString:g}=this.plugin.getPluginState(),y=Mp(d,h);return p("div",{className:(0,Lp.default)("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${s.viewType}`)},p(Rs,{showBreadcrumbs:s.showBreadcrumbs,openFolder:this.openFolder,breadcrumbs:y,pluginIcon:l,title:this.plugin.title,logout:this.logout,username:u,i18n:o}),s.showFilter&&p(yr,{searchString:g,setSearchString:w=>{this.plugin.setPluginState({searchString:w})},submitSearchString:()=>{},inputLabel:o("filter"),clearSearchLabel:o("resetFilter"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),p(ho,{toggleCheckbox:this.toggleCheckbox,displayedPartialTree:this.getDisplayedPartialTree(),openFolder:this.openFolder,virtualList:s.virtualList,noResultsLabel:o("noFilesFound"),handleScroll:this.handleScroll,viewType:s.viewType,showTitles:s.showTitles,i18n:this.plugin.uppy.i18n,isLoading:n}),p(di,{partialTree:d,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:o,validateAggregateRestrictions:this.validateAggregateRestrictions}))}};function vc(r){return _(this,null,function*(){var e;(e=_t(this,$t)[$t])==null||e.abort();let t=new AbortController;_t(this,$t)[$t]=t;let i=()=>{t.abort()};try{this.plugin.uppy.on("dashboard:close-panel",i),this.plugin.uppy.on("cancel-all",i),yield r(t.signal)}finally{this.plugin.uppy.off("dashboard:close-panel",i),this.plugin.uppy.off("cancel-all",i),_t(this,$t)[$t]=void 0}})}ui.VERSION=bc.version;var jp=ue(Te(),1);var wc={version:"4.2.0"},xc={loading:!1,searchString:"",partialTree:[{type:"root",id:null,cached:!1,nextPagePath:null}],currentFolderId:null,isInputMode:!0},br=class{constructor(e,t){this.isHandlingScroll=!1,this.lastCheckbox=null,this.validateSingleFile=o=>{let s=si(o);return this.plugin.uppy.validateSingleFile(s)},this.getDisplayedPartialTree=()=>{let{partialTree:o}=this.plugin.getPluginState();return o.filter(s=>s.type!=="root")},this.setSearchString=o=>{this.plugin.setPluginState({searchString:o}),o===""&&this.plugin.setPluginState({partialTree:[]})},this.validateAggregateRestrictions=o=>{let a=o.filter(n=>n.type==="file"&&n.status==="checked").map(n=>n.data);return this.plugin.uppy.validateAggregateRestrictions(a)},this.plugin=e,this.provider=t.provider;let i={viewType:"grid",showTitles:!0,showFilter:!0};this.opts=m(m({},i),t),this.setSearchString=this.setSearchString.bind(this),this.search=this.search.bind(this),this.resetPluginState=this.resetPluginState.bind(this),this.handleScroll=this.handleScroll.bind(this),this.donePicking=this.donePicking.bind(this),this.cancelSelection=this.cancelSelection.bind(this),this.toggleCheckbox=this.toggleCheckbox.bind(this),this.render=this.render.bind(this),this.resetPluginState(),this.plugin.uppy.on("dashboard:close-panel",this.resetPluginState),this.plugin.uppy.registerRequestClient(this.provider.provider,this.provider)}tearDown(){}setLoading(e){this.plugin.setPluginState({loading:e})}resetPluginState(){this.plugin.setPluginState(xc)}cancelSelection(){let{partialTree:e}=this.plugin.getPluginState(),t=e.map(i=>i.type==="root"?i:O(m({},i),{status:"unchecked"}));this.plugin.setPluginState({partialTree:t})}search(){return _(this,null,function*(){let{searchString:e}=this.plugin.getPluginState();if(e!==""){this.setLoading(!0);try{let t=yield this.provider.search(e),i=[{type:"root",id:null,cached:!1,nextPagePath:t.nextPageQuery},...t.items.map(o=>({type:"file",id:o.requestPath,status:"unchecked",parentId:null,data:o}))];this.plugin.setPluginState({partialTree:i,isInputMode:!1})}catch(t){vt(this.plugin.uppy)(t)}this.setLoading(!1)}})}handleScroll(e){return _(this,null,function*(){let{partialTree:t,searchString:i}=this.plugin.getPluginState(),o=t.find(s=>s.type==="root");if(yo(e)&&!this.isHandlingScroll&&o.nextPagePath){this.isHandlingScroll=!0;try{let s=yield this.provider.search(i,o.nextPagePath),a=O(m({},o),{nextPagePath:s.nextPageQuery}),n=t.filter(d=>d.type!=="root"),l=[a,...n,...s.items.map(d=>({type:"file",id:d.requestPath,status:"unchecked",parentId:null,data:d}))];this.plugin.setPluginState({partialTree:l})}catch(s){vt(this.plugin.uppy)(s)}this.isHandlingScroll=!1}})}donePicking(){return _(this,null,function*(){let{partialTree:e}=this.plugin.getPluginState(),t=wo(e);vo(t,this.plugin,this.provider),this.resetPluginState()})}toggleCheckbox(e,t){let{partialTree:i}=this.plugin.getPluginState(),o=bo(e.id,this.getDisplayedPartialTree(),t,this.lastCheckbox),s=Ht.afterToggleCheckbox(i,o);this.plugin.setPluginState({partialTree:s}),this.lastCheckbox=e.id}render(e,t){t===void 0&&(t={});let{isInputMode:i,searchString:o,loading:s,partialTree:a}=this.plugin.getPluginState(),{i18n:n}=this.plugin.uppy,l=m(m({},this.opts),t);return i?p(yr,{searchString:o,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:n("enterTextToSearch"),buttonLabel:n("searchImages"),wrapperClassName:"uppy-SearchProvider",inputClassName:"uppy-c-textInput uppy-SearchProvider-input",showButton:!0,buttonCSSClassName:"uppy-SearchProvider-searchButton"}):p("div",{className:(0,jp.default)("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${l.viewType}`)},l.showFilter&&p(yr,{searchString:o,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:n("search"),clearSearchLabel:n("resetSearch"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),p(ho,{toggleCheckbox:this.toggleCheckbox,displayedPartialTree:this.getDisplayedPartialTree(),handleScroll:this.handleScroll,openFolder:()=>_(this,null,function*(){}),noResultsLabel:n("noSearchResults"),viewType:l.viewType,showTitles:l.showTitles,isLoading:s,i18n:n,virtualList:!1}),p(di,{partialTree:a,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:n,validateAggregateRestrictions:this.validateAggregateRestrictions}))}};br.VERSION=wc.version;var Hp=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function Pc(r,e){return!!(r===e||Hp(r)&&Hp(e))}function Sc(r,e){if(r.length!==e.length)return!1;for(var t=0;t<r.length;t++)if(!Pc(r[t],e[t]))return!1;return!0}function Js(r,e){e===void 0&&(e=Sc);var t=null;function i(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];if(t&&t.lastThis===this&&e(o,t.lastArgs))return t.lastResult;var a=r.apply(this,o);return t={lastResult:a,lastArgs:o,lastThis:this},a}return i.clear=function(){t=null},i}var xo=['a[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','area[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])',"input:not([disabled]):not([inert]):not([aria-hidden])","select:not([disabled]):not([inert]):not([aria-hidden])","textarea:not([disabled]):not([inert]):not([aria-hidden])","button:not([disabled]):not([inert]):not([aria-hidden])",'iframe:not([tabindex^="-"]):not([inert]):not([aria-hidden])','object:not([tabindex^="-"]):not([inert]):not([aria-hidden])','embed:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[contenteditable]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[tabindex]:not([tabindex^="-"]):not([inert]):not([aria-hidden])'];function ci(r,e){if(e){let t=r.querySelector(`[data-uppy-paneltype="${e}"]`);if(t)return t}return r}function $p(r,e){let t=e[0];t&&(t.focus(),r.preventDefault())}function Fc(r,e){let t=e[e.length-1];t&&(t.focus(),r.preventDefault())}function kc(r){return r.contains(document.activeElement)}function Qs(r,e,t){let i=ci(t,e),o=nt(i.querySelectorAll(xo)),s=o.indexOf(document.activeElement);kc(i)?r.shiftKey&&s===0?Fc(r,o):!r.shiftKey&&s===o.length-1&&$p(r,o):$p(r,o)}function qp(r,e,t){e===null||Qs(r,e,t)}var Vp=ue(jo(),1);function Zs(){let r=!1;return(0,Vp.default)((t,i)=>{let o=ci(t,i),s=o.contains(document.activeElement);if(s&&r)return;let a=o.querySelector("[data-uppy-super-focusable]");if(!(s&&!a))if(a)a.focus({preventScroll:!0}),r=!0;else{let n=o.querySelector(xo);n?.focus({preventScroll:!0}),r=!1}},260)}var pd=ue(Te(),1);function fi(){let r=document.body;return!(!("draggable"in r)||!("ondragstart"in r&&"ondrop"in r)||!("FormData"in window)||!("FileReader"in window))}var Xp=ue(Te(),1);function Wp(r,e){if(r===e)return!0;if(!r||!e)return!1;let t=Object.keys(r),i=Object.keys(e),o=t.length;if(i.length!==o)return!1;for(let s=0;s<o;s++){let a=t[s];if(r[a]!==e[a]||!Object.prototype.hasOwnProperty.call(e,a))return!1}return!0}function Ic(){return p("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},p("g",{fill:"#686DE0",fillRule:"evenodd"},p("path",{d:"M5 7v10h15V7H5zm0-1h15a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1z",fillRule:"nonzero"}),p("path",{d:"M6.35 17.172l4.994-5.026a.5.5 0 0 1 .707 0l2.16 2.16 3.505-3.505a.5.5 0 0 1 .707 0l2.336 2.31-.707.72-1.983-1.97-3.505 3.505a.5.5 0 0 1-.707 0l-2.16-2.159-3.938 3.939-1.409.026z",fillRule:"nonzero"}),p("circle",{cx:"7.5",cy:"9.5",r:"1.5"})))}function Dc(){return p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},p("path",{d:"M9.5 18.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V7.25a.5.5 0 0 1 .379-.485l9-2.25A.5.5 0 0 1 18.5 5v11.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V8.67l-8 2v7.97zm8-11v-2l-8 2v2l8-2zM7 19.64c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1zm9-2c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1z",fill:"#049BCF",fillRule:"nonzero"}))}function Cc(){return p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},p("path",{d:"M16 11.834l4.486-2.691A1 1 0 0 1 22 10v6a1 1 0 0 1-1.514.857L16 14.167V17a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v2.834zM15 9H5v8h10V9zm1 4l5 3v-6l-5 3z",fill:"#19AF67",fillRule:"nonzero"}))}function Bc(){return p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},p("path",{d:"M9.766 8.295c-.691-1.843-.539-3.401.747-3.726 1.643-.414 2.505.938 2.39 3.299-.039.79-.194 1.662-.537 3.148.324.49.66.967 1.055 1.51.17.231.382.488.629.757 1.866-.128 3.653.114 4.918.655 1.487.635 2.192 1.685 1.614 2.84-.566 1.133-1.839 1.084-3.416.249-1.141-.604-2.457-1.634-3.51-2.707a13.467 13.467 0 0 0-2.238.426c-1.392 4.051-4.534 6.453-5.707 4.572-.986-1.58 1.38-4.206 4.914-5.375.097-.322.185-.656.264-1.001.08-.353.306-1.31.407-1.737-.678-1.059-1.2-2.031-1.53-2.91zm2.098 4.87c-.033.144-.068.287-.104.427l.033-.01-.012.038a14.065 14.065 0 0 1 1.02-.197l-.032-.033.052-.004a7.902 7.902 0 0 1-.208-.271c-.197-.27-.38-.526-.555-.775l-.006.028-.002-.003c-.076.323-.148.632-.186.8zm5.77 2.978c1.143.605 1.832.632 2.054.187.26-.519-.087-1.034-1.113-1.473-.911-.39-2.175-.608-3.55-.608.845.766 1.787 1.459 2.609 1.894zM6.559 18.789c.14.223.693.16 1.425-.413.827-.648 1.61-1.747 2.208-3.206-2.563 1.064-4.102 2.867-3.633 3.62zm5.345-10.97c.088-1.793-.351-2.48-1.146-2.28-.473.119-.564 1.05-.056 2.405.213.566.52 1.188.908 1.859.18-.858.268-1.453.294-1.984z",fill:"#E2514A",fillRule:"nonzero"}))}function Tc(){return p("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},p("path",{d:"M10.45 2.05h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V2.55a.5.5 0 0 1 .5-.5zm2.05 1.024h1.05a.5.5 0 0 1 .5.5V3.6a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5v-.001zM10.45 0h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V.5a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 3.074h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 1.024h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm-2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-1.656 3.074l-.82 5.946c.52.302 1.174.458 1.976.458.803 0 1.455-.156 1.975-.458l-.82-5.946h-2.311zm0-1.025h2.312c.512 0 .946.378 1.015.885l.82 5.946c.056.412-.142.817-.501 1.026-.686.398-1.515.597-2.49.597-.974 0-1.804-.199-2.49-.597a1.025 1.025 0 0 1-.5-1.026l.819-5.946c.07-.507.503-.885 1.015-.885zm.545 6.6a.5.5 0 0 1-.397-.561l.143-.999a.5.5 0 0 1 .495-.429h.74a.5.5 0 0 1 .495.43l.143.998a.5.5 0 0 1-.397.561c-.404.08-.819.08-1.222 0z",fill:"#00C469",fillRule:"nonzero"}))}function Ec(){return p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},p("g",{fill:"#A7AFB7",fillRule:"nonzero"},p("path",{d:"M5.5 22a.5.5 0 0 1-.5-.5v-18a.5.5 0 0 1 .5-.5h10.719a.5.5 0 0 1 .367.16l3.281 3.556a.5.5 0 0 1 .133.339V21.5a.5.5 0 0 1-.5.5h-14zm.5-1h13V7.25L16 4H6v17z"}),p("path",{d:"M15 4v3a1 1 0 0 0 1 1h3V7h-3V4h-1z"})))}function Ac(){return p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},p("path",{d:"M4.5 7h13a.5.5 0 1 1 0 1h-13a.5.5 0 0 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h10a.5.5 0 1 1 0 1h-10a.5.5 0 1 1 0-1z",fill:"#5A5E69",fillRule:"nonzero"}))}function qt(r){let e={color:"#838999",icon:Ec()};if(!r)return e;let t=r.split("/")[0],i=r.split("/")[1];return t==="text"?{color:"#5a5e69",icon:Ac()}:t==="image"?{color:"#686de0",icon:Ic()}:t==="audio"?{color:"#068dbb",icon:Dc()}:t==="video"?{color:"#19af67",icon:Cc()}:t==="application"&&i==="pdf"?{color:"#e25149",icon:Bc()}:t==="application"&&["zip","x-7z-compressed","x-zip-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(i)!==-1?{color:"#00C469",icon:Tc()}:e}function mi(r){let{file:e}=r;if(e.preview)return p("img",{className:"uppy-Dashboard-Item-previewImg",alt:e.name,src:e.preview});let{color:t,icon:i}=qt(e.type);return p("div",{className:"uppy-Dashboard-Item-previewIconWrap"},p("span",{className:"uppy-Dashboard-Item-previewIcon",style:{color:t}},i),p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-Dashboard-Item-previewIconBg",width:"58",height:"76",viewBox:"0 0 58 76"},p("rect",{fill:"#FFF",width:"58",height:"76",rx:"3",fillRule:"evenodd"})))}var Oc=(r,e)=>(typeof e=="function"?e():e).filter(o=>o.id===r)[0].name;function gi(r){let{file:e,toggleFileCard:t,i18n:i,metaFields:o}=r,{missingRequiredMetaFields:s}=e;if(!(s!=null&&s.length))return null;let a=s.map(n=>Oc(n,o)).join(", ");return p("div",{className:"uppy-Dashboard-Item-errorMessage"},i("missingRequiredMetaFields",{smart_count:s.length,fields:a})," ",p("button",{type:"button",class:"uppy-u-reset uppy-Dashboard-Item-errorMessageBtn",onClick:()=>t(!0,e.id)},i("editFile")))}function ea(r){let{file:e,i18n:t,toggleFileCard:i,metaFields:o,showLinkToFileUploadResult:s}=r,n=e.preview?"rgba(255, 255, 255, 0.5)":qt(e.type).color;return p("div",{className:"uppy-Dashboard-Item-previewInnerWrap",style:{backgroundColor:n}},s&&e.uploadURL&&p("a",{className:"uppy-Dashboard-Item-previewLink",href:e.uploadURL,rel:"noreferrer noopener",target:"_blank","aria-label":e.meta.name},p("span",{hidden:!0},e.meta.name)),p(mi,{file:e}),p(gi,{file:e,i18n:t,toggleFileCard:i,metaFields:o}))}function zc(r){if(!r.isUploaded){if(r.error&&!r.hideRetryButton){r.uppy.retryUpload(r.file.id);return}r.resumableUploads&&!r.hidePauseResumeButton?r.uppy.pauseResume(r.file.id):r.individualCancellation&&!r.hideCancelButton&&r.uppy.removeFile(r.file.id)}}function Gp(r){return r.isUploaded?r.i18n("uploadComplete"):r.error?r.i18n("retryUpload"):r.resumableUploads?r.file.isPaused?r.i18n("resumeUpload"):r.i18n("pauseUpload"):r.individualCancellation?r.i18n("cancelUpload"):""}function ta(r){return p("div",{className:"uppy-Dashboard-Item-progress"},p("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-progressIndicator",type:"button","aria-label":Gp(r),title:Gp(r),onClick:()=>zc(r)},r.children))}function Po(r){let{children:e}=r;return p("svg",{"aria-hidden":"true",focusable:"false",width:"70",height:"70",viewBox:"0 0 36 36",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--circle"},e)}function ra(r){let{progress:e}=r,t=2*Math.PI*15;return p("g",null,p("circle",{className:"uppy-Dashboard-Item-progressIcon--bg",r:"15",cx:"18",cy:"18","stroke-width":"2",fill:"none"}),p("circle",{className:"uppy-Dashboard-Item-progressIcon--progress",r:"15",cx:"18",cy:"18",transform:"rotate(-90, 18, 18)",fill:"none","stroke-width":"2","stroke-dasharray":t,"stroke-dashoffset":t-t/100*e}))}function ia(r){return!r.file.progress.uploadStarted||r.file.progress.percentage===void 0?null:r.isUploaded?p("div",{className:"uppy-Dashboard-Item-progress"},p("div",{className:"uppy-Dashboard-Item-progressIndicator"},p(Po,null,p("circle",{r:"15",cx:"18",cy:"18",fill:"#1bb240"}),p("polygon",{className:"uppy-Dashboard-Item-progressIcon--check",transform:"translate(2, 3)",points:"14 22.5 7 15.2457065 8.99985857 13.1732815 14 18.3547104 22.9729883 9 25 11.1005634"})))):r.recoveredState?null:r.error&&!r.hideRetryButton?p(ta,r,p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--retry",width:"28",height:"31",viewBox:"0 0 16 19"},p("path",{d:"M16 11a8 8 0 1 1-8-8v2a6 6 0 1 0 6 6h2z"}),p("path",{d:"M7.9 3H10v2H7.9z"}),p("path",{d:"M8.536.5l3.535 3.536-1.414 1.414L7.12 1.914z"}),p("path",{d:"M10.657 2.621l1.414 1.415L8.536 7.57 7.12 6.157z"}))):r.resumableUploads&&!r.hidePauseResumeButton?p(ta,r,p(Po,null,p(ra,{progress:r.file.progress.percentage}),r.file.isPaused?p("polygon",{className:"uppy-Dashboard-Item-progressIcon--play",transform:"translate(3, 3)",points:"12 20 12 10 20 15"}):p("g",{className:"uppy-Dashboard-Item-progressIcon--pause",transform:"translate(14.5, 13)"},p("rect",{x:"0",y:"0",width:"2",height:"10",rx:"0"}),p("rect",{x:"5",y:"0",width:"2",height:"10",rx:"0"})))):!r.resumableUploads&&r.individualCancellation&&!r.hideCancelButton?p(ta,r,p(Po,null,p(ra,{progress:r.file.progress.percentage}),p("polygon",{className:"cancel",transform:"translate(2, 2)",points:"19.8856516 11.0625 16 14.9481516 12.1019737 11.0625 11.0625 12.1143484 14.9481516 16 11.0625 19.8980263 12.1019737 20.9375 16 17.0518484 19.8856516 20.9375 20.9375 19.8980263 17.0518484 16 20.9375 12"}))):p("div",{className:"uppy-Dashboard-Item-progress"},p("div",{className:"uppy-Dashboard-Item-progressIndicator"},p(Po,null,p(ra,{progress:r.file.progress.percentage}))))}var Kp=ue(Tr(),1);var oa="...";function So(r,e){if(e===0)return"";if(r.length<=e)return r;if(e<=oa.length+1)return`${r.slice(0,e-1)}\u2026`;let t=e-oa.length,i=Math.ceil(t/2),o=Math.floor(t/2);return r.slice(0,i)+oa+r.slice(-o)}var Uc=r=>{let{author:e,name:t}=r.file.meta;function i(){return r.isSingleFile&&r.containerHeight>=350?90:r.containerWidth<=352?35:r.containerWidth<=576?60:e?20:30}return p("div",{className:"uppy-Dashboard-Item-name",title:t},So(t,i()))},Mc=r=>{var e;let{author:t}=r.file.meta,i=(e=r.file.remote)==null?void 0:e.providerName,o="\xB7";return t?p("div",{className:"uppy-Dashboard-Item-author"},p("a",{href:`${t.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer"},So(t.name,13)),i?p(Fragment,null,` ${o} `,i,` ${o} `):null):null},Rc=r=>r.file.size&&p("div",{className:"uppy-Dashboard-Item-statusSize"},(0,Kp.default)(r.file.size)),Nc=r=>r.file.isGhost&&p("span",null," \u2022 ",p("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-reSelect",type:"button",onClick:()=>r.toggleAddFilesPanel(!0)},r.i18n("reSelect"))),Lc=r=>{let{file:e,onClick:t}=r;return e.error?p("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-errorDetails","aria-label":e.error,"data-microtip-position":"bottom","data-microtip-size":"medium",onClick:t,type:"button"},"?"):null};function sa(r){let{file:e,i18n:t,toggleFileCard:i,metaFields:o,toggleAddFilesPanel:s,isSingleFile:a,containerHeight:n,containerWidth:l}=r;return p("div",{className:"uppy-Dashboard-Item-fileInfo","data-uppy-file-source":e.source},p("div",{className:"uppy-Dashboard-Item-fileName"},Uc({file:e,isSingleFile:a,containerHeight:n,containerWidth:l}),p(Lc,{file:e,onClick:()=>alert(e.error)})),p("div",{className:"uppy-Dashboard-Item-status"},Mc({file:e}),Rc({file:e}),Nc({file:e,toggleAddFilesPanel:s,i18n:t})),p(gi,{file:e,i18n:t,toggleFileCard:i,metaFields:o}))}function aa(r,e){return e===void 0&&(e="Copy the URL below"),new Promise(t=>{let i=document.createElement("textarea");i.setAttribute("style",{position:"fixed",top:0,left:0,width:"2em",height:"2em",padding:0,border:"none",outline:"none",boxShadow:"none",background:"transparent"}),i.value=r,document.body.appendChild(i),i.select();let o=()=>{document.body.removeChild(i),window.prompt(e,r),t()};try{return document.execCommand("copy")?(document.body.removeChild(i),t()):o()}catch{return document.body.removeChild(i),o()}})}function jc(r){let{file:e,uploadInProgressOrComplete:t,metaFields:i,canEditFile:o,i18n:s,onClick:a}=r;return!t&&i&&i.length>0||!t&&o(e)?p("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-action uppy-Dashboard-Item-action--edit",type:"button","aria-label":s("editFileWithFilename",{file:e.meta.name}),title:s("editFileWithFilename",{file:e.meta.name}),onClick:()=>a()},p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 14"},p("g",{fillRule:"evenodd"},p("path",{d:"M1.5 10.793h2.793A1 1 0 0 0 5 10.5L11.5 4a1 1 0 0 0 0-1.414L9.707.793a1 1 0 0 0-1.414 0l-6.5 6.5A1 1 0 0 0 1.5 8v2.793zm1-1V8L9 1.5l1.793 1.793-6.5 6.5H2.5z",fillRule:"nonzero"}),p("rect",{x:"1",y:"12.293",width:"11",height:"1",rx:".5"}),p("path",{fillRule:"nonzero",d:"M6.793 2.5L9.5 5.207l.707-.707L7.5 1.793z"})))):null}function Hc(r){let{i18n:e,onClick:t,file:i}=r;return p("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--remove",type:"button","aria-label":e("removeFile",{file:i.meta.name}),title:e("removeFile",{file:i.meta.name}),onClick:()=>t()},p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"18",height:"18",viewBox:"0 0 18 18"},p("path",{d:"M9 0C4.034 0 0 4.034 0 9s4.034 9 9 9 9-4.034 9-9-4.034-9-9-9z"}),p("path",{fill:"#FFF",d:"M13 12.222l-.778.778L9 9.778 5.778 13 5 12.222 8.222 9 5 5.778 5.778 5 9 8.222 12.222 5l.778.778L9.778 9z"})))}function $c(r){let{file:e,uppy:t,i18n:i}=r,o=s=>{aa(e.uploadURL,i("copyLinkToClipboardFallback")).then(()=>{t.log("Link copied to clipboard."),t.info(i("copyLinkToClipboardSuccess"),"info",3e3)}).catch(t.log).then(()=>s.target.focus({preventScroll:!0}))};return p("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--copyLink",type:"button","aria-label":i("copyLink"),title:i("copyLink"),onClick:s=>o(s)},p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 12"},p("path",{d:"M7.94 7.703a2.613 2.613 0 0 1-.626 2.681l-.852.851a2.597 2.597 0 0 1-1.849.766A2.616 2.616 0 0 1 2.764 7.54l.852-.852a2.596 2.596 0 0 1 2.69-.625L5.267 7.099a1.44 1.44 0 0 0-.833.407l-.852.851a1.458 1.458 0 0 0 1.03 2.486c.39 0 .755-.152 1.03-.426l.852-.852c.231-.231.363-.522.406-.824l1.04-1.038zm4.295-5.937A2.596 2.596 0 0 0 10.387 1c-.698 0-1.355.272-1.849.766l-.852.851a2.614 2.614 0 0 0-.624 2.688l1.036-1.036c.041-.304.173-.6.407-.833l.852-.852c.275-.275.64-.426 1.03-.426a1.458 1.458 0 0 1 1.03 2.486l-.852.851a1.442 1.442 0 0 1-.824.406l-1.04 1.04a2.596 2.596 0 0 0 2.683-.628l.851-.85a2.616 2.616 0 0 0 0-3.697zm-6.88 6.883a.577.577 0 0 0 .82 0l3.474-3.474a.579.579 0 1 0-.819-.82L5.355 7.83a.579.579 0 0 0 0 .819z"})))}function na(r){let{uppy:e,file:t,uploadInProgressOrComplete:i,canEditFile:o,metaFields:s,showLinkToFileUploadResult:a,showRemoveButton:n,i18n:l,toggleFileCard:d,openFileEditor:h}=r;return p("div",{className:"uppy-Dashboard-Item-actionWrapper"},p(jc,{i18n:l,file:t,uploadInProgressOrComplete:i,canEditFile:o,metaFields:s,onClick:()=>{s&&s.length>0?d(!0,t.id):h(t)}}),a&&t.uploadURL?p($c,{file:t,uppy:e,i18n:l}):null,n?p(Hc,{i18n:l,file:t,onClick:()=>e.removeFile(t.id)}):null)}var Fo=class extends Me{componentDidMount(){let{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}shouldComponentUpdate(e){return!Wp(this.props,e)}componentDidUpdate(){let{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}componentWillUnmount(){let{file:e}=this.props;e.preview||this.props.handleCancelThumbnail(e)}render(){let{file:e}=this.props,t=e.progress.preprocess||e.progress.postprocess,i=!!e.progress.uploadComplete&&!t&&!e.error,o=!!e.progress.uploadStarted||!!t,s=e.progress.uploadStarted&&!e.progress.uploadComplete||t,a=e.error||!1,{isGhost:n}=e,l=(this.props.individualCancellation||!s)&&!i;i&&this.props.showRemoveButtonAfterComplete&&(l=!0);let d=(0,Xp.default)({"uppy-Dashboard-Item":!0,"is-inprogress":s&&!this.props.recoveredState,"is-processing":t,"is-complete":i,"is-error":!!a,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation,"is-ghost":n});return p("div",{className:d,id:`uppy_${e.id}`,role:this.props.role},p("div",{className:"uppy-Dashboard-Item-preview"},p(ea,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,i18n:this.props.i18n,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),p(ia,{uppy:this.props.uppy,file:e,error:a,isUploaded:i,hideRetryButton:this.props.hideRetryButton,hideCancelButton:this.props.hideCancelButton,hidePauseResumeButton:this.props.hidePauseResumeButton,recoveredState:this.props.recoveredState,resumableUploads:this.props.resumableUploads,individualCancellation:this.props.individualCancellation,i18n:this.props.i18n})),p("div",{className:"uppy-Dashboard-Item-fileInfoAndButtons"},p(sa,{file:e,containerWidth:this.props.containerWidth,containerHeight:this.props.containerHeight,i18n:this.props.i18n,toggleAddFilesPanel:this.props.toggleAddFilesPanel,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields,isSingleFile:this.props.isSingleFile}),p(na,{file:e,metaFields:this.props.metaFields,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,showRemoveButton:l,canEditFile:this.props.canEditFile,uploadInProgressOrComplete:o,toggleFileCard:this.props.toggleFileCard,openFileEditor:this.props.openFileEditor,uppy:this.props.uppy,i18n:this.props.i18n})))}};function qc(r,e){let t=[],i=[];return r.forEach(o=>{i.length<e?i.push(o):(t.push(i),i=[o])}),i.length&&t.push(i),t}function la(r){let{id:e,i18n:t,uppy:i,files:o,resumableUploads:s,hideRetryButton:a,hidePauseResumeButton:n,hideCancelButton:l,showLinkToFileUploadResult:d,showRemoveButtonAfterComplete:h,metaFields:u,isSingleFile:g,toggleFileCard:y,handleRequestThumbnail:w,handleCancelThumbnail:B,recoveredState:$,individualCancellation:L,itemsPerRow:j,openFileEditor:Z,canEditFile:G,toggleAddFilesPanel:V,containerWidth:c,containerHeight:f}=r,v=j===1?71:200,k=Lt(()=>{let T=(oe,ie)=>Number(o[ie].isGhost)-Number(o[oe].isGhost),q=Object.keys(o);return $&&q.sort(T),qc(q,j)},[o,j,$]),C=T=>p("div",{class:"uppy-Dashboard-filesInner",role:"presentation",key:T[0]},T.map(q=>p(Fo,{key:q,uppy:i,id:e,i18n:t,resumableUploads:s,individualCancellation:L,hideRetryButton:a,hidePauseResumeButton:n,hideCancelButton:l,showLinkToFileUploadResult:d,showRemoveButtonAfterComplete:h,metaFields:u,recoveredState:$,isSingleFile:g,containerWidth:c,containerHeight:f,toggleFileCard:y,handleRequestThumbnail:w,handleCancelThumbnail:B,role:"listitem",openFileEditor:Z,canEditFile:G,toggleAddFilesPanel:V,file:o[q]})));return g?p("div",{class:"uppy-Dashboard-files"},C(k[0])):p(uo,{class:"uppy-Dashboard-files",role:"list",data:k,renderRow:C,rowHeight:v})}var pa=class extends Me{constructor(){super(...arguments),this.fileInput=null,this.folderInput=null,this.mobilePhotoFileInput=null,this.mobileVideoFileInput=null,this.triggerFileInputClick=()=>{var e;(e=this.fileInput)==null||e.click()},this.triggerFolderInputClick=()=>{var e;(e=this.folderInput)==null||e.click()},this.triggerVideoCameraInputClick=()=>{var e;(e=this.mobileVideoFileInput)==null||e.click()},this.triggerPhotoCameraInputClick=()=>{var e;(e=this.mobilePhotoFileInput)==null||e.click()},this.onFileInputChange=e=>{this.props.handleInputChange(e),e.currentTarget.value=""},this.renderHiddenInput=(e,t)=>{var i;return p("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,webkitdirectory:e,type:"file",name:"files[]",multiple:this.props.maxNumberOfFiles!==1,onChange:this.onFileInputChange,accept:(i=this.props.allowedFileTypes)==null?void 0:i.join(", "),ref:t})},this.renderHiddenCameraInput=(e,t,i)=>{let s={photo:"image/*",video:"video/*"}[e];return p("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,type:"file",name:`camera-${e}`,onChange:this.onFileInputChange,capture:t,accept:s,ref:i})},this.renderMyDeviceAcquirer=()=>p("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MyDevice"},p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerFileInputClick},p("div",{className:"uppy-DashboardTab-inner"},p("svg",{className:"uppy-DashboardTab-iconMyDevice","aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},p("path",{d:"M8.45 22.087l-1.305-6.674h17.678l-1.572 6.674H8.45zm4.975-12.412l1.083 1.765a.823.823 0 00.715.386h7.951V13.5H8.587V9.675h4.838zM26.043 13.5h-1.195v-2.598c0-.463-.336-.75-.798-.75h-8.356l-1.082-1.766A.823.823 0 0013.897 8H7.728c-.462 0-.815.256-.815.718V13.5h-.956a.97.97 0 00-.746.37.972.972 0 00-.19.81l1.724 8.565c.095.44.484.755.933.755H24c.44 0 .824-.3.929-.727l2.043-8.568a.972.972 0 00-.176-.825.967.967 0 00-.753-.38z",fill:"currentcolor","fill-rule":"evenodd"}))),p("div",{className:"uppy-DashboardTab-name"},this.props.i18n("myDevice")))),this.renderPhotoCamera=()=>p("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobilePhotoCamera"},p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerPhotoCameraInputClick},p("div",{className:"uppy-DashboardTab-inner"},p("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},p("path",{d:"M23.5 9.5c1.417 0 2.5 1.083 2.5 2.5v9.167c0 1.416-1.083 2.5-2.5 2.5h-15c-1.417 0-2.5-1.084-2.5-2.5V12c0-1.417 1.083-2.5 2.5-2.5h2.917l1.416-2.167C13 7.167 13.25 7 13.5 7h5c.25 0 .5.167.667.333L20.583 9.5H23.5zM16 11.417a4.706 4.706 0 00-4.75 4.75 4.704 4.704 0 004.75 4.75 4.703 4.703 0 004.75-4.75c0-2.663-2.09-4.75-4.75-4.75zm0 7.825c-1.744 0-3.076-1.332-3.076-3.074 0-1.745 1.333-3.077 3.076-3.077 1.744 0 3.074 1.333 3.074 3.076s-1.33 3.075-3.074 3.075z",fill:"#02B383","fill-rule":"nonzero"}))),p("div",{className:"uppy-DashboardTab-name"},this.props.i18n("takePictureBtn")))),this.renderVideoCamera=()=>p("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobileVideoCamera"},p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerVideoCameraInputClick},p("div",{className:"uppy-DashboardTab-inner"},p("svg",{"aria-hidden":"true",width:"32",height:"32",viewBox:"0 0 32 32"},p("path",{fill:"#FF675E",fillRule:"nonzero",d:"m21.254 14.277 2.941-2.588c.797-.313 1.243.818 1.09 1.554-.01 2.094.02 4.189-.017 6.282-.126.915-1.145 1.08-1.58.34l-2.434-2.142c-.192.287-.504 1.305-.738.468-.104-1.293-.028-2.596-.05-3.894.047-.312.381.823.426 1.069.063-.384.206-.744.362-1.09zm-12.939-3.73c3.858.013 7.717-.025 11.574.02.912.129 1.492 1.237 1.351 2.217-.019 2.412.04 4.83-.03 7.239-.17 1.025-1.166 1.59-2.029 1.429-3.705-.012-7.41.025-11.114-.019-.913-.129-1.492-1.237-1.352-2.217.018-2.404-.036-4.813.029-7.214.136-.82.83-1.473 1.571-1.454z "}))),p("div",{className:"uppy-DashboardTab-name"},this.props.i18n("recordVideoBtn")))),this.renderBrowseButton=(e,t)=>{let i=this.props.acquirers.length;return p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-browse",onClick:t,"data-uppy-super-focusable":i===0},e)},this.renderDropPasteBrowseTagline=e=>{let t=this.renderBrowseButton(this.props.i18n("browseFiles"),this.triggerFileInputClick),i=this.renderBrowseButton(this.props.i18n("browseFolders"),this.triggerFolderInputClick),o=this.props.fileManagerSelectionType,s=o.charAt(0).toUpperCase()+o.slice(1);return p("div",{class:"uppy-Dashboard-AddFiles-title"},this.props.disableLocalFiles?this.props.i18n("importFiles"):e>0?this.props.i18nArray(`dropPasteImport${s}`,{browseFiles:t,browseFolders:i,browse:t}):this.props.i18nArray(`dropPaste${s}`,{browseFiles:t,browseFolders:i,browse:t}))},this.renderAcquirer=e=>{var t;return p("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":e.id},p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-cy":e.id,"aria-controls":`uppy-DashboardContent-panel--${e.id}`,"aria-selected":((t=this.props.activePickerPanel)==null?void 0:t.id)===e.id,"data-uppy-super-focusable":!0,onClick:()=>this.props.showPanel(e.id)},p("div",{className:"uppy-DashboardTab-inner"},e.icon()),p("div",{className:"uppy-DashboardTab-name"},e.name)))},this.renderAcquirers=e=>{let t=[...e],i=t.splice(e.length-2,e.length);return p(je,null,t.map(o=>this.renderAcquirer(o)),p("span",{role:"presentation",style:{"white-space":"nowrap"}},i.map(o=>this.renderAcquirer(o))))},this.renderSourcesList=(e,t)=>{let{showNativePhotoCameraButton:i,showNativeVideoCameraButton:o}=this.props,s=[],a="myDevice";t||s.push({key:a,elements:this.renderMyDeviceAcquirer()}),i&&s.push({key:"nativePhotoCameraButton",elements:this.renderPhotoCamera()}),o&&s.push({key:"nativePhotoCameraButton",elements:this.renderVideoCamera()}),s.push(...e.map(h=>({key:h.id,elements:this.renderAcquirer(h)}))),s.length===1&&s[0].key===a&&(s=[]);let l=[...s],d=l.splice(s.length-2,s.length);return p(je,null,this.renderDropPasteBrowseTagline(s.length),p("div",{className:"uppy-Dashboard-AddFiles-list",role:"tablist"},l.map(h=>{let{key:u,elements:g}=h;return p(je,{key:u},g)}),p("span",{role:"presentation",style:{"white-space":"nowrap"}},d.map(h=>{let{key:u,elements:g}=h;return p(je,{key:u},g)}))))}}[Symbol.for("uppy test: disable unused locale key warning")](){this.props.i18nArray("dropPasteBoth"),this.props.i18nArray("dropPasteFiles"),this.props.i18nArray("dropPasteFolders"),this.props.i18nArray("dropPasteImportBoth"),this.props.i18nArray("dropPasteImportFiles"),this.props.i18nArray("dropPasteImportFolders")}renderPoweredByUppy(){let{i18nArray:e}=this.props,t=p("span",null,p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-poweredByIcon",width:"11",height:"11",viewBox:"0 0 11 11"},p("path",{d:"M7.365 10.5l-.01-4.045h2.612L5.5.806l-4.467 5.65h2.604l.01 4.044h3.718z",fillRule:"evenodd"})),p("span",{className:"uppy-Dashboard-poweredByUppy"},"Uppy")),i=e("poweredBy",{uppy:t});return p("a",{tabIndex:-1,href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",className:"uppy-Dashboard-poweredBy"},i)}render(){let{showNativePhotoCameraButton:e,showNativeVideoCameraButton:t,nativeCameraFacingMode:i}=this.props;return p("div",{className:"uppy-Dashboard-AddFiles"},this.renderHiddenInput(!1,o=>{this.fileInput=o}),this.renderHiddenInput(!0,o=>{this.folderInput=o}),e&&this.renderHiddenCameraInput("photo",i,o=>{this.mobilePhotoFileInput=o}),t&&this.renderHiddenCameraInput("video",i,o=>{this.mobileVideoFileInput=o}),this.renderSourcesList(this.props.acquirers,this.props.disableLocalFiles),p("div",{className:"uppy-Dashboard-AddFiles-info"},this.props.note&&p("div",{className:"uppy-Dashboard-note"},this.props.note),this.props.proudlyDisplayPoweredByUppy&&this.renderPoweredByUppy()))}},ko=pa;var Yp=ue(Te(),1);var Vc=r=>p("div",{className:(0,Yp.default)("uppy-Dashboard-AddFilesPanel",r.className),"data-uppy-panelType":"AddFiles","aria-hidden":!r.showAddFilesPanel},p("div",{className:"uppy-DashboardContent-bar"},p("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},r.i18n("addingMoreFiles")),p("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>r.toggleAddFilesPanel(!1)},r.i18n("back"))),p(ko,r)),Jp=Vc;var Qp=ue(Te(),1);function Wc(r){let{tagName:e}=r.target;if(e==="INPUT"||e==="TEXTAREA"){r.stopPropagation();return}r.preventDefault(),r.stopPropagation()}var pt=Wc;function Gc(r){let{activePickerPanel:e,className:t,hideAllPanels:i,i18n:o,state:s,uppy:a}=r,n=Nt(null);return p("div",{className:(0,Qp.default)("uppy-DashboardContent-panel",t),role:"tabpanel","data-uppy-panelType":"PickerPanel",id:`uppy-DashboardContent-panel--${e.id}`,onDragOver:pt,onDragLeave:pt,onDrop:pt,onPaste:pt},p("div",{className:"uppy-DashboardContent-bar"},p("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},o("importFrom",{name:e.name})),p("button",{className:"uppy-DashboardContent-back",type:"button",onClick:i},o("cancel"))),p("div",{ref:n,className:"uppy-DashboardContent-panelBody"},a.getPlugin(e.id).render(s,n.current)))}var Zp=Gc;var ed=ue(Te(),1);function Kc(r){let e=r.files[r.fileCardFor],t=()=>{r.uppy.emit("file-editor:cancel",e),r.closeFileEditor()};return p("div",{className:(0,ed.default)("uppy-DashboardContent-panel",r.className),role:"tabpanel","data-uppy-panelType":"FileEditor",id:"uppy-DashboardContent-panel--editor"},p("div",{className:"uppy-DashboardContent-bar"},p("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},r.i18nArray("editing",{file:p("span",{className:"uppy-DashboardContent-titleFile"},e.meta?e.meta.name:e.name)})),p("button",{className:"uppy-DashboardContent-back",type:"button",onClick:t},r.i18n("cancel")),p("button",{className:"uppy-DashboardContent-save",type:"button",onClick:r.saveFileEditor},r.i18n("save"))),p("div",{className:"uppy-DashboardContent-panelBody"},r.editors.map(i=>r.uppy.getPlugin(i.id).render(r.state))))}var td=Kc;var dt={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete",STATE_PAUSED:"paused"};function Xc(r,e,t,i){if(i===void 0&&(i={}),r)return dt.STATE_ERROR;if(e)return dt.STATE_COMPLETE;if(t)return dt.STATE_PAUSED;let o=dt.STATE_WAITING,s=Object.keys(i);for(let a=0;a<s.length;a++){let{progress:n}=i[s[a]];if(n.uploadStarted&&!n.uploadComplete)return dt.STATE_UPLOADING;n.preprocess&&o!==dt.STATE_UPLOADING&&(o=dt.STATE_PREPROCESSING),n.postprocess&&o!==dt.STATE_UPLOADING&&o!==dt.STATE_PREPROCESSING&&(o=dt.STATE_POSTPROCESSING)}return o}function Yc(r){let{files:e,i18n:t,isAllComplete:i,isAllErrored:o,isAllPaused:s,inProgressNotPausedFiles:a,newFiles:n,processingFiles:l}=r;switch(Xc(o,i,s,e)){case"uploading":return t("uploadingXFiles",{smart_count:a.length});case"preprocessing":case"postprocessing":return t("processingXFiles",{smart_count:l.length});case"paused":return t("uploadPaused");case"waiting":return t("xFilesSelected",{smart_count:n.length});case"complete":return t("uploadComplete");case"error":return t("error");default:}}function Jc(r){let{i18n:e,isAllComplete:t,hideCancelButton:i,maxNumberOfFiles:o,toggleAddFilesPanel:s,uppy:a}=r,{allowNewUpload:n}=r;return n&&o&&(n=r.totalFileCount<r.maxNumberOfFiles),p("div",{className:"uppy-DashboardContent-bar"},!t&&!i?p("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>a.cancelAll()},e("cancel")):p("div",null),p("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},p(Yc,r)),n?p("button",{className:"uppy-DashboardContent-addMore",type:"button","aria-label":e("addMoreFiles"),title:e("addMoreFiles"),onClick:()=>s(!0)},p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"15",height:"15",viewBox:"0 0 15 15"},p("path",{d:"M8 6.5h6a.5.5 0 0 1 .5.5v.5a.5.5 0 0 1-.5.5H8v6a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V8h-6a.5.5 0 0 1-.5-.5V7a.5.5 0 0 1 .5-.5h6v-6A.5.5 0 0 1 7 0h.5a.5.5 0 0 1 .5.5v6z"})),p("span",{className:"uppy-DashboardContent-addMoreCaption"},e("addMore"))):p("div",null))}var rd=Jc;var id=ue(Te(),1);function da(r){let{computedMetaFields:e,requiredMetaFields:t,updateMeta:i,form:o,formState:s}=r,a={text:"uppy-u-reset uppy-c-textInput uppy-Dashboard-FileCard-input"};return e.map(n=>{let l=`uppy-Dashboard-FileCard-input-${n.id}`,d=t.includes(n.id);return p("fieldset",{key:n.id,className:"uppy-Dashboard-FileCard-fieldset"},p("label",{className:"uppy-Dashboard-FileCard-label",htmlFor:l},n.name),n.render!==void 0?n.render({value:s[n.id],onChange:h=>i(h,n.id),fieldCSSClasses:a,required:d,form:o.id},p):p("input",{className:a.text,id:l,form:o.id,type:n.type||"text",required:d,value:s[n.id],placeholder:n.placeholder,onInput:h=>i(h.target.value,n.id),"data-uppy-super-focusable":!0}))})}function ua(r){var e;let{files:t,fileCardFor:i,toggleFileCard:o,saveFileCard:s,metaFields:a,requiredMetaFields:n,openFileEditor:l,i18n:d,i18nArray:h,className:u,canEditFile:g}=r,y=()=>typeof a=="function"?a(t[i]):a,w=t[i],B=(e=y())!=null?e:[],$=g(w),L={};B.forEach(v=>{var k;L[v.id]=(k=w.meta[v.id])!=null?k:""});let[j,Z]=et(L),G=jt(v=>{v.preventDefault(),s(j,i)},[s,j,i]),V=(v,k)=>{Z(O(m({},j),{[k]:v}))},c=()=>{o(!1)},[f]=et(()=>{let v=document.createElement("form");return v.setAttribute("tabindex","-1"),v.id=Ft(),v});return lt(()=>(document.body.appendChild(f),f.addEventListener("submit",G),()=>{f.removeEventListener("submit",G),document.body.removeChild(f)}),[f,G]),p("div",{className:(0,id.default)("uppy-Dashboard-FileCard",u),"data-uppy-panelType":"FileCard",onDragOver:pt,onDragLeave:pt,onDrop:pt,onPaste:pt},p("div",{className:"uppy-DashboardContent-bar"},p("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},h("editing",{file:p("span",{className:"uppy-DashboardContent-titleFile"},w.meta?w.meta.name:w.name)})),p("button",{className:"uppy-DashboardContent-back",type:"button",form:f.id,title:d("finishEditingFile"),onClick:c},d("cancel"))),p("div",{className:"uppy-Dashboard-FileCard-inner"},p("div",{className:"uppy-Dashboard-FileCard-preview",style:{backgroundColor:qt(w.type).color}},p(mi,{file:w}),$&&p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-FileCard-edit",onClick:v=>{G(v),l(w)}},d("editImage"))),p("div",{className:"uppy-Dashboard-FileCard-info"},p(da,{computedMetaFields:B,requiredMetaFields:n,updateMeta:V,form:f,formState:j})),p("div",{className:"uppy-Dashboard-FileCard-actions"},p("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Dashboard-FileCard-actionsBtn",type:"submit",form:f.id},d("saveChanges")),p("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link uppy-Dashboard-FileCard-actionsBtn",type:"button",onClick:c,form:f.id},d("cancel")))))}var sd=ue(Te(),1),vr="uppy-transition-slideDownUp",od=250;function Qc(r){let{children:e}=r,[t,i]=et(null),[o,s]=et(""),a=Nt(),n=Nt(),l=Nt(),d=()=>{s(`${vr}-enter`),cancelAnimationFrame(l.current),clearTimeout(n.current),n.current=void 0,l.current=requestAnimationFrame(()=>{s(`${vr}-enter ${vr}-enter-active`),a.current=setTimeout(()=>{s("")},od)})},h=()=>{s(`${vr}-leave`),cancelAnimationFrame(l.current),clearTimeout(a.current),a.current=void 0,l.current=requestAnimationFrame(()=>{s(`${vr}-leave ${vr}-leave-active`),n.current=setTimeout(()=>{i(null),s("")},od)})};return lt(()=>{let u=at(e)[0];t!==u&&(u&&!t?d():t&&!u&&!n.current&&h(),i(u))},[e,t]),lt(()=>()=>{clearTimeout(a.current),clearTimeout(n.current),cancelAnimationFrame(l.current)},[]),t?Vi(t,{className:(0,sd.default)(o,t.props.className)}):null}var yi=Qc;function wr(){return wr=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(r[i]=t[i])}return r},wr.apply(null,arguments)}var ad=900,nd=700,ha=576,ld=330;function ca(r){let e=r.totalFileCount===0,t=r.totalFileCount===1,i=r.containerWidth>ha,o=r.containerHeight>ld,s=(0,pd.default)({"uppy-Dashboard":!0,"uppy-Dashboard--isDisabled":r.disabled,"uppy-Dashboard--animateOpenClose":r.animateOpenClose,"uppy-Dashboard--isClosing":r.isClosing,"uppy-Dashboard--isDraggingOver":r.isDraggingOver,"uppy-Dashboard--modal":!r.inline,"uppy-size--md":r.containerWidth>ha,"uppy-size--lg":r.containerWidth>nd,"uppy-size--xl":r.containerWidth>ad,"uppy-size--height-md":r.containerHeight>ld,"uppy-Dashboard--isAddFilesPanelVisible":r.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":r.areInsidesReadyToBeVisible,"uppy-Dashboard--singleFile":r.singleFileFullScreen&&t&&o}),a=1;r.containerWidth>ad?a=5:r.containerWidth>nd?a=4:r.containerWidth>ha&&(a=3);let n=r.showSelectedFiles&&!e,l=r.recoveredState?Object.keys(r.recoveredState.files).length:null,d=r.files?Object.keys(r.files).filter(g=>r.files[g].isGhost).length:0,h=()=>d>0?r.i18n("recoveredXFiles",{smart_count:d}):r.i18n("recoveredAllFiles");return p("div",{className:s,"data-uppy-theme":r.theme,"data-uppy-num-acquirers":r.acquirers.length,"data-uppy-drag-drop-supported":!r.disableLocalFiles&&fi(),"aria-hidden":r.inline?"false":r.isHidden,"aria-disabled":r.disabled,"aria-label":r.inline?r.i18n("dashboardTitle"):r.i18n("dashboardWindowTitle"),onPaste:r.handlePaste,onDragOver:r.handleDragOver,onDragLeave:r.handleDragLeave,onDrop:r.handleDrop},p("div",{"aria-hidden":"true",className:"uppy-Dashboard-overlay",tabIndex:-1,onClick:r.handleClickOutside}),p("div",{className:"uppy-Dashboard-inner","aria-modal":!r.inline&&"true",role:r.inline?void 0:"dialog",style:{width:r.inline&&r.width?r.width:"",height:r.inline&&r.height?r.height:""}},r.inline?null:p("button",{className:"uppy-u-reset uppy-Dashboard-close",type:"button","aria-label":r.i18n("closeModal"),title:r.i18n("closeModal"),onClick:r.closeModal},p("span",{"aria-hidden":"true"},"\xD7")),p("div",{className:"uppy-Dashboard-innerWrap"},p("div",{className:"uppy-Dashboard-dropFilesHereHint"},r.i18n("dropHint")),n&&p(rd,r),l&&p("div",{className:"uppy-Dashboard-serviceMsg"},p("svg",{className:"uppy-Dashboard-serviceMsg-icon","aria-hidden":"true",focusable:"false",width:"21",height:"16",viewBox:"0 0 24 19"},p("g",{transform:"translate(0 -1)",fill:"none",fillRule:"evenodd"},p("path",{d:"M12.857 1.43l10.234 17.056A1 1 0 0122.234 20H1.766a1 1 0 01-.857-1.514L11.143 1.429a1 1 0 011.714 0z",fill:"#FFD300"}),p("path",{fill:"#000",d:"M11 6h2l-.3 8h-1.4z"}),p("circle",{fill:"#000",cx:"12",cy:"17",r:"1"}))),p("strong",{className:"uppy-Dashboard-serviceMsg-title"},r.i18n("sessionRestored")),p("div",{className:"uppy-Dashboard-serviceMsg-text"},h())),n?p(la,{id:r.id,i18n:r.i18n,uppy:r.uppy,files:r.files,resumableUploads:r.resumableUploads,hideRetryButton:r.hideRetryButton,hidePauseResumeButton:r.hidePauseResumeButton,hideCancelButton:r.hideCancelButton,showLinkToFileUploadResult:r.showLinkToFileUploadResult,showRemoveButtonAfterComplete:r.showRemoveButtonAfterComplete,metaFields:r.metaFields,toggleFileCard:r.toggleFileCard,handleRequestThumbnail:r.handleRequestThumbnail,handleCancelThumbnail:r.handleCancelThumbnail,recoveredState:r.recoveredState,individualCancellation:r.individualCancellation,openFileEditor:r.openFileEditor,canEditFile:r.canEditFile,toggleAddFilesPanel:r.toggleAddFilesPanel,isSingleFile:t,itemsPerRow:a,containerWidth:r.containerWidth,containerHeight:r.containerHeight}):p(ko,{i18n:r.i18n,i18nArray:r.i18nArray,acquirers:r.acquirers,handleInputChange:r.handleInputChange,maxNumberOfFiles:r.maxNumberOfFiles,allowedFileTypes:r.allowedFileTypes,showNativePhotoCameraButton:r.showNativePhotoCameraButton,showNativeVideoCameraButton:r.showNativeVideoCameraButton,nativeCameraFacingMode:r.nativeCameraFacingMode,showPanel:r.showPanel,activePickerPanel:r.activePickerPanel,disableLocalFiles:r.disableLocalFiles,fileManagerSelectionType:r.fileManagerSelectionType,note:r.note,proudlyDisplayPoweredByUppy:r.proudlyDisplayPoweredByUppy}),p(yi,null,r.showAddFilesPanel?p(Jp,wr({key:"AddFiles"},r,{isSizeMD:i})):null),p(yi,null,r.fileCardFor?p(ua,wr({key:"FileCard"},r)):null),p(yi,null,r.activePickerPanel?p(Zp,wr({key:"Picker"},r)):null),p(yi,null,r.showFileEditor?p(td,wr({key:"Editor"},r)):null),p("div",{className:"uppy-Dashboard-progressindicators"},r.progressindicators.map(g=>r.uppy.getPlugin(g.id).render(r.state))))))}var dd={strings:{closeModal:"Close Modal",addMoreFiles:"Add more files",addingMoreFiles:"Adding more files",importFrom:"Import from %{name}",dashboardWindowTitle:"Uppy Dashboard Window (Press escape to close)",dashboardTitle:"Uppy Dashboard",copyLinkToClipboardSuccess:"Link copied to clipboard.",copyLinkToClipboardFallback:"Copy the URL below",copyLink:"Copy link",back:"Back",removeFile:"Remove file",editFile:"Edit file",editImage:"Edit image",editing:"Editing %{file}",error:"Error",finishEditingFile:"Finish editing file",saveChanges:"Save changes",myDevice:"My Device",dropHint:"Drop your files here",uploadComplete:"Upload complete",uploadPaused:"Upload paused",resumeUpload:"Resume upload",pauseUpload:"Pause upload",retryUpload:"Retry upload",cancelUpload:"Cancel upload",xFilesSelected:{0:"%{smart_count} file selected",1:"%{smart_count} files selected"},uploadingXFiles:{0:"Uploading %{smart_count} file",1:"Uploading %{smart_count} files"},processingXFiles:{0:"Processing %{smart_count} file",1:"Processing %{smart_count} files"},poweredBy:"Powered by %{uppy}",addMore:"Add more",editFileWithFilename:"Edit file %{file}",save:"Save",cancel:"Cancel",dropPasteFiles:"Drop files here or %{browseFiles}",dropPasteFolders:"Drop files here or %{browseFolders}",dropPasteBoth:"Drop files here, %{browseFiles} or %{browseFolders}",dropPasteImportFiles:"Drop files here, %{browseFiles} or import from:",dropPasteImportFolders:"Drop files here, %{browseFolders} or import from:",dropPasteImportBoth:"Drop files here, %{browseFiles}, %{browseFolders} or import from:",importFiles:"Import files from:",browseFiles:"browse files",browseFolders:"browse folders",recoveredXFiles:{0:"We could not fully recover 1 file. Please re-select it and resume the upload.",1:"We could not fully recover %{smart_count} files. Please re-select them and resume the upload."},recoveredAllFiles:"We restored all files. You can now resume the upload.",sessionRestored:"Session restored",reSelect:"Re-select",missingRequiredMetaFields:{0:"Missing required meta field: %{fields}.",1:"Missing required meta fields: %{fields}."},takePictureBtn:"Take Picture",recordVideoBtn:"Record Video"}};function J(r,e){if(!{}.hasOwnProperty.call(r,e))throw new TypeError("attempted to use private field on non-instance");return r}var Zc=0;function _e(r){return"__private_"+Zc+++"_"+r}var ef={version:"4.1.3"},fa=Js.default||Js,ud=9,tf=27;function hd(){let r={};return r.promise=new Promise((e,t)=>{r.resolve=e,r.reject=t}),r}var rf={target:"body",metaFields:[],thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:hi,showLinkToFileUploadResult:!1,showProgressDetails:!1,hideUploadButton:!1,hideCancelButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideProgressAfterFinish:!1,note:null,singleFileFullScreen:!0,disableStatusBar:!1,disableInformer:!1,disableThumbnailGenerator:!1,fileManagerSelectionType:"files",proudlyDisplayPoweredByUppy:!0,showSelectedFiles:!0,showRemoveButtonAfterComplete:!1,showNativePhotoCameraButton:!1,showNativeVideoCameraButton:!1,theme:"light",autoOpen:null,disabled:!1,disableLocalFiles:!1,nativeCameraFacingMode:"",onDragLeave:()=>{},onDragOver:()=>{},onDrop:()=>{},plugins:[],doneButtonHandler:void 0,onRequestCloseModal:null,inline:!1,animateOpenClose:!0,browserBackButtonClose:!1,closeAfterFinish:!1,closeModalOnClickOutside:!1,disablePageScrollWhenModalOpen:!0,trigger:null,width:750,height:550},Vt=_e("disabledNodes"),wt=_e("generateLargeThumbnailIfSingleFile"),bi=_e("openFileEditorWhenFilesAdded"),Wt=_e("attachRenderFunctionToTarget"),ma=_e("isTargetSupported"),ga=_e("getAcquirers"),ya=_e("getProgressIndicators"),xt=_e("getEditors"),ba=_e("addSpecifiedPluginsFromOptions"),va=_e("autoDiscoverPlugins"),Gt=_e("addSupportedPluginIfNoTarget"),vi=_e("getStatusBarOpts"),wi=_e("getThumbnailGeneratorOpts"),wa=_e("getInformerOpts"),xi=_e("getStatusBarId"),Pi=_e("getThumbnailGeneratorId"),xa=_e("getInformerId"),Kt=class extends He{constructor(e,t){var i,o,s;let a=(i=t?.autoOpen)!=null?i:null;super(e,O(m(m({},rf),t),{autoOpen:a})),Object.defineProperty(this,xa,{value:pf}),Object.defineProperty(this,Pi,{value:lf}),Object.defineProperty(this,xi,{value:nf}),Object.defineProperty(this,wa,{value:af}),Object.defineProperty(this,wi,{value:sf}),Object.defineProperty(this,vi,{value:of}),Object.defineProperty(this,Vt,{writable:!0,value:void 0}),this.modalName=`uppy-Dashboard-${Ft()}`,this.superFocus=Zs(),this.ifFocusedOnUppyRecently=!1,this.removeTarget=n=>{let d=this.getPluginState().targets.filter(h=>h.id!==n.id);this.setPluginState({targets:d})},this.addTarget=n=>{let l=n.id||n.constructor.name,d=n.title||l,h=n.type;if(h!=="acquirer"&&h!=="progressindicator"&&h!=="editor")return this.uppy.log("Dashboard: can only be targeted by plugins of types: acquirer, progressindicator, editor","error"),null;let u={id:l,name:d,type:h},y=this.getPluginState().targets.slice();return y.push(u),this.setPluginState({targets:y}),this.el},this.hideAllPanels=()=>{var n;let l=this.getPluginState(),d={activePickerPanel:void 0,showAddFilesPanel:!1,activeOverlayType:null,fileCardFor:null,showFileEditor:!1};l.activePickerPanel===d.activePickerPanel&&l.showAddFilesPanel===d.showAddFilesPanel&&l.showFileEditor===d.showFileEditor&&l.activeOverlayType===d.activeOverlayType||(this.setPluginState(d),this.uppy.emit("dashboard:close-panel",(n=l.activePickerPanel)==null?void 0:n.id))},this.showPanel=n=>{let{targets:l}=this.getPluginState(),d=l.find(h=>h.type==="acquirer"&&h.id===n);this.setPluginState({activePickerPanel:d,activeOverlayType:"PickerPanel"}),this.uppy.emit("dashboard:show-panel",n)},this.canEditFile=n=>{let{targets:l}=this.getPluginState();return J(this,xt)[xt](l).some(h=>this.uppy.getPlugin(h.id).canEditFile(n))},this.openFileEditor=n=>{let{targets:l}=this.getPluginState(),d=J(this,xt)[xt](l);this.setPluginState({showFileEditor:!0,fileCardFor:n.id||null,activeOverlayType:"FileEditor"}),d.forEach(h=>{this.uppy.getPlugin(h.id).selectFile(n)})},this.closeFileEditor=()=>{let{metaFields:n}=this.getPluginState();n&&n.length>0?this.setPluginState({showFileEditor:!1,activeOverlayType:"FileCard"}):this.setPluginState({showFileEditor:!1,fileCardFor:null,activeOverlayType:"AddFiles"})},this.saveFileEditor=()=>{let{targets:n}=this.getPluginState();J(this,xt)[xt](n).forEach(d=>{this.uppy.getPlugin(d.id).save()}),this.closeFileEditor()},this.openModal=()=>{let{promise:n,resolve:l}=hd();if(this.savedScrollPosition=window.pageYOffset,this.savedActiveElement=document.activeElement,this.opts.disablePageScrollWhenModalOpen&&document.body.classList.add("uppy-Dashboard-isFixed"),this.opts.animateOpenClose&&this.getPluginState().isClosing){let d=()=>{this.setPluginState({isHidden:!1}),this.el.removeEventListener("animationend",d,!1),l()};this.el.addEventListener("animationend",d,!1)}else this.setPluginState({isHidden:!1}),l();return this.opts.browserBackButtonClose&&this.updateBrowserHistory(),document.addEventListener("keydown",this.handleKeyDownInModal),this.uppy.emit("dashboard:modal-open"),n},this.closeModal=n=>{var l;let d=(l=n?.manualClose)!=null?l:!0,{isHidden:h,isClosing:u}=this.getPluginState();if(h||u)return;let{promise:g,resolve:y}=hd();if(this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.opts.animateOpenClose){this.setPluginState({isClosing:!0});let B=()=>{this.setPluginState({isHidden:!0,isClosing:!1}),this.superFocus.cancel(),this.savedActiveElement.focus(),this.el.removeEventListener("animationend",B,!1),y()};this.el.addEventListener("animationend",B,!1)}else this.setPluginState({isHidden:!0}),this.superFocus.cancel(),this.savedActiveElement.focus(),y();if(document.removeEventListener("keydown",this.handleKeyDownInModal),d&&this.opts.browserBackButtonClose){var w;(w=history.state)!=null&&w[this.modalName]&&history.back()}return this.uppy.emit("dashboard:modal-closed"),g},this.isModalOpen=()=>!this.getPluginState().isHidden||!1,this.requestCloseModal=()=>this.opts.onRequestCloseModal?this.opts.onRequestCloseModal():this.closeModal(),this.setDarkModeCapability=n=>{let{capabilities:l}=this.uppy.getState();this.uppy.setState({capabilities:O(m({},l),{darkMode:n})})},this.handleSystemDarkModeChange=n=>{let l=n.matches;this.uppy.log(`[Dashboard] Dark mode is ${l?"on":"off"}`),this.setDarkModeCapability(l)},this.toggleFileCard=(n,l)=>{let d=this.uppy.getFile(l);n?this.uppy.emit("dashboard:file-edit-start",d):this.uppy.emit("dashboard:file-edit-complete",d),this.setPluginState({fileCardFor:n?l:null,activeOverlayType:n?"FileCard":null})},this.toggleAddFilesPanel=n=>{this.setPluginState({showAddFilesPanel:n,activeOverlayType:n?"AddFiles":null})},this.addFiles=n=>{let l=n.map(d=>({source:this.id,name:d.name,type:d.type,data:d,meta:{relativePath:d.relativePath||d.webkitRelativePath||null}}));try{this.uppy.addFiles(l)}catch(d){this.uppy.log(d)}},this.startListeningToResize=()=>{this.resizeObserver=new ResizeObserver(n=>{let l=n[0],{width:d,height:h}=l.contentRect;this.setPluginState({containerWidth:d,containerHeight:h,areInsidesReadyToBeVisible:!0})}),this.resizeObserver.observe(this.el.querySelector(".uppy-Dashboard-inner")),this.makeDashboardInsidesVisibleAnywayTimeout=setTimeout(()=>{let n=this.getPluginState(),l=!this.opts.inline&&n.isHidden;!n.areInsidesReadyToBeVisible&&!l&&(this.uppy.log("[Dashboard] resize event didn\u2019t fire on time: defaulted to mobile layout","warning"),this.setPluginState({areInsidesReadyToBeVisible:!0}))},1e3)},this.stopListeningToResize=()=>{this.resizeObserver.disconnect(),clearTimeout(this.makeDashboardInsidesVisibleAnywayTimeout)},this.recordIfFocusedOnUppyRecently=n=>{this.el.contains(n.target)?this.ifFocusedOnUppyRecently=!0:(this.ifFocusedOnUppyRecently=!1,this.superFocus.cancel())},this.disableInteractiveElements=n=>{var l;let d=["a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])",'[role="button"]:not([disabled])'],h=(l=J(this,Vt)[Vt])!=null?l:nt(this.el.querySelectorAll(d)).filter(u=>!u.classList.contains("uppy-Dashboard-close"));for(let u of h)u.tagName==="A"?u.setAttribute("aria-disabled",n):u.disabled=n;n?J(this,Vt)[Vt]=h:J(this,Vt)[Vt]=null,this.dashboardIsDisabled=n},this.updateBrowserHistory=()=>{var n;(n=history.state)!=null&&n[this.modalName]||history.pushState(O(m({},history.state),{[this.modalName]:!0}),""),window.addEventListener("popstate",this.handlePopState,!1)},this.handlePopState=n=>{var l;this.isModalOpen()&&(!n.state||!n.state[this.modalName])&&this.closeModal({manualClose:!1}),!this.isModalOpen()&&(l=n.state)!=null&&l[this.modalName]&&history.back()},this.handleKeyDownInModal=n=>{n.keyCode===tf&&this.requestCloseModal(),n.keyCode===ud&&Qs(n,this.getPluginState().activeOverlayType,this.el)},this.handleClickOutside=()=>{this.opts.closeModalOnClickOutside&&this.requestCloseModal()},this.handlePaste=n=>{this.uppy.iteratePlugins(d=>{d.type==="acquirer"&&(d.handleRootPaste==null||d.handleRootPaste(n))});let l=nt(n.clipboardData.files);l.length>0&&(this.uppy.log("[Dashboard] Files pasted"),this.addFiles(l))},this.handleInputChange=n=>{n.preventDefault();let l=nt(n.currentTarget.files||[]);l.length>0&&(this.uppy.log("[Dashboard] Files selected through input"),this.addFiles(l))},this.handleDragOver=n=>{n.preventDefault(),n.stopPropagation();let l=()=>{let g=!0;return this.uppy.iteratePlugins(y=>{y.canHandleRootDrop!=null&&y.canHandleRootDrop(n)&&(g=!0)}),g},d=()=>{let{types:g}=n.dataTransfer;return g.some(y=>y==="Files")},h=l(),u=d();if(!h&&!u||this.opts.disabled||this.opts.disableLocalFiles&&(u||!h)||!this.uppy.getState().allowNewUpload){n.dataTransfer.dropEffect="none";return}n.dataTransfer.dropEffect="copy",this.setPluginState({isDraggingOver:!0}),this.opts.onDragOver(n)},this.handleDragLeave=n=>{n.preventDefault(),n.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.opts.onDragLeave(n)},this.handleDrop=n=>_(this,null,function*(){n.preventDefault(),n.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins(u=>{u.type==="acquirer"&&(u.handleRootDrop==null||u.handleRootDrop(n))});let l=!1,d=u=>{this.uppy.log(u,"error"),l||(this.uppy.info(u.message,"error"),l=!0)};this.uppy.log("[Dashboard] Processing dropped files");let h=yield oi(n.dataTransfer,{logDropError:d});h.length>0&&(this.uppy.log("[Dashboard] Files dropped"),this.addFiles(h)),this.opts.onDrop(n)}),this.handleRequestThumbnail=n=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:request",n)},this.handleCancelThumbnail=n=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:cancel",n)},this.handleKeyDownInInline=n=>{n.keyCode===ud&&qp(n,this.getPluginState().activeOverlayType,this.el)},this.handlePasteOnBody=n=>{this.el.contains(document.activeElement)&&this.handlePaste(n)},this.handleComplete=n=>{let{failed:l}=n;this.opts.closeAfterFinish&&!(l!=null&&l.length)&&this.requestCloseModal()},this.handleCancelRestore=()=>{this.uppy.emit("restore-canceled")},Object.defineProperty(this,wt,{writable:!0,value:()=>{if(this.opts.disableThumbnailGenerator)return;let n=600,l=this.uppy.getFiles();if(l.length===1){let d=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);d?.setOptions({thumbnailWidth:n});let h=O(m({},l[0]),{preview:void 0});d?.requestThumbnail(h).then(()=>{d?.setOptions({thumbnailWidth:this.opts.thumbnailWidth})})}}}),Object.defineProperty(this,bi,{writable:!0,value:n=>{let l=n[0],{metaFields:d}=this.getPluginState(),h=d&&d.length>0,u=this.canEditFile(l);h&&this.opts.autoOpen==="metaEditor"?this.toggleFileCard(!0,l.id):u&&this.opts.autoOpen==="imageEditor"&&this.openFileEditor(l)}}),this.initEvents=()=>{if(this.opts.trigger&&!this.opts.inline){let n=Bs(this.opts.trigger);n?n.forEach(l=>l.addEventListener("click",this.openModal)):this.uppy.log("Dashboard modal trigger not found. Make sure `trigger` is set in Dashboard options, unless you are planning to call `dashboard.openModal()` method yourself","warning")}this.startListeningToResize(),document.addEventListener("paste",this.handlePasteOnBody),this.uppy.on("plugin-added",J(this,Gt)[Gt]),this.uppy.on("plugin-remove",this.removeTarget),this.uppy.on("file-added",this.hideAllPanels),this.uppy.on("dashboard:modal-closed",this.hideAllPanels),this.uppy.on("complete",this.handleComplete),this.uppy.on("files-added",J(this,wt)[wt]),this.uppy.on("file-removed",J(this,wt)[wt]),document.addEventListener("focus",this.recordIfFocusedOnUppyRecently,!0),document.addEventListener("click",this.recordIfFocusedOnUppyRecently,!0),this.opts.inline&&this.el.addEventListener("keydown",this.handleKeyDownInInline),this.opts.autoOpen&&this.uppy.on("files-added",J(this,bi)[bi])},this.removeEvents=()=>{let n=Bs(this.opts.trigger);!this.opts.inline&&n&&n.forEach(l=>l.removeEventListener("click",this.openModal)),this.stopListeningToResize(),document.removeEventListener("paste",this.handlePasteOnBody),window.removeEventListener("popstate",this.handlePopState,!1),this.uppy.off("plugin-added",J(this,Gt)[Gt]),this.uppy.off("plugin-remove",this.removeTarget),this.uppy.off("file-added",this.hideAllPanels),this.uppy.off("dashboard:modal-closed",this.hideAllPanels),this.uppy.off("complete",this.handleComplete),this.uppy.off("files-added",J(this,wt)[wt]),this.uppy.off("file-removed",J(this,wt)[wt]),document.removeEventListener("focus",this.recordIfFocusedOnUppyRecently),document.removeEventListener("click",this.recordIfFocusedOnUppyRecently),this.opts.inline&&this.el.removeEventListener("keydown",this.handleKeyDownInInline),this.opts.autoOpen&&this.uppy.off("files-added",J(this,bi)[bi])},this.superFocusOnEachUpdate=()=>{let n=this.el.contains(document.activeElement),l=document.activeElement===document.body||document.activeElement===null,d=this.uppy.getState().info.length===0,h=!this.opts.inline;d&&(h||n||l&&this.ifFocusedOnUppyRecently)?this.superFocus(this.el,this.getPluginState().activeOverlayType):this.superFocus.cancel()},this.afterUpdate=()=>{if(this.opts.disabled&&!this.dashboardIsDisabled){this.disableInteractiveElements(!0);return}!this.opts.disabled&&this.dashboardIsDisabled&&this.disableInteractiveElements(!1),this.superFocusOnEachUpdate()},this.saveFileCard=(n,l)=>{this.uppy.setFileMeta(l,n),this.toggleFileCard(!1,l)},Object.defineProperty(this,Wt,{writable:!0,value:n=>{let l=this.uppy.getPlugin(n.id);return O(m({},n),{icon:l.icon||this.opts.defaultPickerIcon,render:l.render})}}),Object.defineProperty(this,ma,{writable:!0,value:n=>{let l=this.uppy.getPlugin(n.id);return typeof l.isSupported!="function"?!0:l.isSupported()}}),Object.defineProperty(this,ga,{writable:!0,value:fa(n=>n.filter(l=>l.type==="acquirer"&&J(this,ma)[ma](l)).map(J(this,Wt)[Wt]))}),Object.defineProperty(this,ya,{writable:!0,value:fa(n=>n.filter(l=>l.type==="progressindicator").map(J(this,Wt)[Wt]))}),Object.defineProperty(this,xt,{writable:!0,value:fa(n=>n.filter(l=>l.type==="editor").map(J(this,Wt)[Wt]))}),this.render=n=>{let l=this.getPluginState(),{files:d,capabilities:h,allowNewUpload:u}=n,{newFiles:g,uploadStartedFiles:y,completeFiles:w,erroredFiles:B,inProgressFiles:$,inProgressNotPausedFiles:L,processingFiles:j,isUploadStarted:Z,isAllComplete:G,isAllPaused:V}=this.uppy.getObjectOfFilesPerState(),c=J(this,ga)[ga](l.targets),f=J(this,ya)[ya](l.targets),v=J(this,xt)[xt](l.targets),k;return this.opts.theme==="auto"?k=h.darkMode?"dark":"light":k=this.opts.theme,["files","folders","both"].indexOf(this.opts.fileManagerSelectionType)<0&&(this.opts.fileManagerSelectionType="files",console.warn(`Unsupported option for "fileManagerSelectionType". Using default of "${this.opts.fileManagerSelectionType}".`)),ca({state:n,isHidden:l.isHidden,files:d,newFiles:g,uploadStartedFiles:y,completeFiles:w,erroredFiles:B,inProgressFiles:$,inProgressNotPausedFiles:L,processingFiles:j,isUploadStarted:Z,isAllComplete:G,isAllPaused:V,totalFileCount:Object.keys(d).length,totalProgress:n.totalProgress,allowNewUpload:u,acquirers:c,theme:k,disabled:this.opts.disabled,disableLocalFiles:this.opts.disableLocalFiles,direction:this.opts.direction,activePickerPanel:l.activePickerPanel,showFileEditor:l.showFileEditor,saveFileEditor:this.saveFileEditor,closeFileEditor:this.closeFileEditor,disableInteractiveElements:this.disableInteractiveElements,animateOpenClose:this.opts.animateOpenClose,isClosing:l.isClosing,progressindicators:f,editors:v,autoProceed:this.uppy.opts.autoProceed,id:this.id,closeModal:this.requestCloseModal,handleClickOutside:this.handleClickOutside,handleInputChange:this.handleInputChange,handlePaste:this.handlePaste,inline:this.opts.inline,showPanel:this.showPanel,hideAllPanels:this.hideAllPanels,i18n:this.i18n,i18nArray:this.i18nArray,uppy:this.uppy,note:this.opts.note,recoveredState:n.recoveredState,metaFields:l.metaFields,resumableUploads:h.resumableUploads||!1,individualCancellation:h.individualCancellation,isMobileDevice:h.isMobileDevice,fileCardFor:l.fileCardFor,toggleFileCard:this.toggleFileCard,toggleAddFilesPanel:this.toggleAddFilesPanel,showAddFilesPanel:l.showAddFilesPanel,saveFileCard:this.saveFileCard,openFileEditor:this.openFileEditor,canEditFile:this.canEditFile,width:this.opts.width,height:this.opts.height,showLinkToFileUploadResult:this.opts.showLinkToFileUploadResult,fileManagerSelectionType:this.opts.fileManagerSelectionType,proudlyDisplayPoweredByUppy:this.opts.proudlyDisplayPoweredByUppy,hideCancelButton:this.opts.hideCancelButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,showRemoveButtonAfterComplete:this.opts.showRemoveButtonAfterComplete,containerWidth:l.containerWidth,containerHeight:l.containerHeight,areInsidesReadyToBeVisible:l.areInsidesReadyToBeVisible,parentElement:this.el,allowedFileTypes:this.uppy.opts.restrictions.allowedFileTypes,maxNumberOfFiles:this.uppy.opts.restrictions.maxNumberOfFiles,requiredMetaFields:this.uppy.opts.restrictions.requiredMetaFields,showSelectedFiles:this.opts.showSelectedFiles,showNativePhotoCameraButton:this.opts.showNativePhotoCameraButton,showNativeVideoCameraButton:this.opts.showNativeVideoCameraButton,nativeCameraFacingMode:this.opts.nativeCameraFacingMode,singleFileFullScreen:this.opts.singleFileFullScreen,handleCancelRestore:this.handleCancelRestore,handleRequestThumbnail:this.handleRequestThumbnail,handleCancelThumbnail:this.handleCancelThumbnail,isDraggingOver:l.isDraggingOver,handleDragOver:this.handleDragOver,handleDragLeave:this.handleDragLeave,handleDrop:this.handleDrop})},Object.defineProperty(this,ba,{writable:!0,value:()=>{let{plugins:n}=this.opts;n.forEach(l=>{let d=this.uppy.getPlugin(l);d?d.mount(this,d):this.uppy.log(`[Uppy] Dashboard could not find plugin '${l}', make sure to uppy.use() the plugins you are specifying`,"warning")})}}),Object.defineProperty(this,va,{writable:!0,value:()=>{this.uppy.iteratePlugins(J(this,Gt)[Gt])}}),Object.defineProperty(this,Gt,{writable:!0,value:n=>{var l;let d=["acquirer","editor"];n&&!((l=n.opts)!=null&&l.target)&&d.includes(n.type)&&(this.getPluginState().targets.some(u=>n.id===u.id)||n.mount(this,n))}}),this.install=()=>{this.setPluginState({isHidden:!0,fileCardFor:null,activeOverlayType:null,showAddFilesPanel:!1,activePickerPanel:void 0,showFileEditor:!1,metaFields:this.opts.metaFields,targets:[],areInsidesReadyToBeVisible:!1,isDraggingOver:!1});let{inline:n,closeAfterFinish:l}=this.opts;if(n&&l)throw new Error("[Dashboard] `closeAfterFinish: true` cannot be used on an inline Dashboard, because an inline Dashboard cannot be closed at all. Either set `inline: false`, or disable the `closeAfterFinish` option.");let{allowMultipleUploads:d,allowMultipleUploadBatches:h}=this.uppy.opts;(d||h)&&l&&this.uppy.log("[Dashboard] When using `closeAfterFinish`, we recommended setting the `allowMultipleUploadBatches` option to `false` in the Uppy constructor. See https://uppy.io/docs/uppy/#allowMultipleUploads-true","warning");let{target:u}=this.opts;u&&this.mount(u,this),this.opts.disableStatusBar||this.uppy.use(Ot,m({id:J(this,xi)[xi](),target:this},J(this,vi)[vi]())),this.opts.disableInformer||this.uppy.use(zt,m({id:J(this,xa)[xa](),target:this},J(this,wa)[wa]())),this.opts.disableThumbnailGenerator||this.uppy.use(mr,m({id:J(this,Pi)[Pi]()},J(this,wi)[wi]())),this.darkModeMediaQuery=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;let g=this.darkModeMediaQuery?this.darkModeMediaQuery.matches:!1;if(this.uppy.log(`[Dashboard] Dark mode is ${g?"on":"off"}`),this.setDarkModeCapability(g),this.opts.theme==="auto"){var y;(y=this.darkModeMediaQuery)==null||y.addListener(this.handleSystemDarkModeChange)}J(this,ba)[ba](),J(this,va)[va](),this.initEvents()},this.uninstall=()=>{if(!this.opts.disableInformer){let d=this.uppy.getPlugin(`${this.id}:Informer`);d&&this.uppy.removePlugin(d)}if(!this.opts.disableStatusBar){let d=this.uppy.getPlugin(`${this.id}:StatusBar`);d&&this.uppy.removePlugin(d)}if(!this.opts.disableThumbnailGenerator){let d=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);d&&this.uppy.removePlugin(d)}let{plugins:n}=this.opts;if(n.forEach(d=>{let h=this.uppy.getPlugin(d);h&&h.unmount()}),this.opts.theme==="auto"){var l;(l=this.darkModeMediaQuery)==null||l.removeListener(this.handleSystemDarkModeChange)}this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.unmount(),this.removeEvents()},this.id=this.opts.id||"Dashboard",this.title="Dashboard",this.type="orchestrator",this.defaultLocale=dd,this.opts.doneButtonHandler===void 0&&(this.opts.doneButtonHandler=()=>{this.uppy.clear(),this.requestCloseModal()}),(s=(o=this.opts).onRequestCloseModal)!=null||(o.onRequestCloseModal=()=>this.closeModal()),this.i18nInit()}setOptions(e){var t,i;super.setOptions(e),(t=this.uppy.getPlugin(J(this,xi)[xi]()))==null||t.setOptions(J(this,vi)[vi]()),(i=this.uppy.getPlugin(J(this,Pi)[Pi]()))==null||i.setOptions(J(this,wi)[wi]())}};function of(){let{hideUploadButton:r,hideRetryButton:e,hidePauseResumeButton:t,hideCancelButton:i,showProgressDetails:o,hideProgressAfterFinish:s,locale:a,doneButtonHandler:n}=this.opts;return{hideUploadButton:r,hideRetryButton:e,hidePauseResumeButton:t,hideCancelButton:i,showProgressDetails:o,hideAfterFinish:s,locale:a,doneButtonHandler:n}}function sf(){let{thumbnailWidth:r,thumbnailHeight:e,thumbnailType:t,waitForThumbnailsBeforeUpload:i}=this.opts;return{thumbnailWidth:r,thumbnailHeight:e,thumbnailType:t,waitForThumbnailsBeforeUpload:i,lazy:!i}}function af(){return{}}function nf(){return`${this.id}:StatusBar`}function lf(){return`${this.id}:ThumbnailGenerator`}function pf(){return`${this.id}:Informer`}Kt.VERSION=ef.version;var df={version:"4.1.0"},uf={fixed:!1,hideAfterFinish:!0},xr=class extends He{constructor(e,t){super(e,m(m({},uf),t)),this.id=this.opts.id||"ProgressBar",this.title="Progress Bar",this.type="progressindicator",this.render=this.render.bind(this)}render(e){let{totalProgress:t}=e,i=(t===0||t===100)&&this.opts.hideAfterFinish;return p("div",{className:"uppy uppy-ProgressBar",style:{position:this.opts.fixed?"fixed":"initial"},"aria-hidden":i},p("div",{className:"uppy-ProgressBar-inner",style:{width:`${t}%`}}),p("div",{className:"uppy-ProgressBar-percentage"},t))}install(){let{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}};xr.VERSION=df.version;var cd={strings:{dropHereOr:"Drop here or %{browse}",browse:"browse"}};var hf={version:"4.0.5"},cf={inputName:"files[]",width:"100%",height:"100%"},Pr=class r extends He{constructor(e,t){super(e,m(m({},cf),t)),this.isDragDropSupported=fi(),this.addFiles=i=>{let o=i.map(s=>({source:this.id,name:s.name,type:s.type,data:s,meta:{relativePath:s.relativePath||null}}));try{this.uppy.addFiles(o)}catch(s){this.uppy.log(s)}},this.onInputChange=i=>{let o=nt(i.currentTarget.files||[]);o.length>0&&(this.uppy.log("[DragDrop] Files selected through input"),this.addFiles(o)),i.currentTarget.value=""},this.handleDragOver=i=>{var o,s;i.preventDefault(),i.stopPropagation();let{types:a}=i.dataTransfer,n=a.some(d=>d==="Files"),{allowNewUpload:l}=this.uppy.getState();if(!n||!l){i.dataTransfer.dropEffect="none";return}i.dataTransfer.dropEffect="copy",this.setPluginState({isDraggingOver:!0}),(o=(s=this.opts).onDragOver)==null||o.call(s,i)},this.handleDragLeave=i=>{var o,s;i.preventDefault(),i.stopPropagation(),this.setPluginState({isDraggingOver:!1}),(o=(s=this.opts).onDragLeave)==null||o.call(s,i)},this.handleDrop=i=>_(this,null,function*(){var o,s;i.preventDefault(),i.stopPropagation(),this.setPluginState({isDraggingOver:!1});let a=l=>{this.uppy.log(l,"error")},n=yield oi(i.dataTransfer,{logDropError:a});n.length>0&&(this.uppy.log("[DragDrop] Files dropped"),this.addFiles(n)),(o=(s=this.opts).onDrop)==null||o.call(s,i)}),this.type="acquirer",this.id=this.opts.id||"DragDrop",this.title="Drag & Drop",this.defaultLocale=cd,this.i18nInit()}renderHiddenFileInput(){var e;let{restrictions:t}=this.uppy.opts;return p("input",{className:"uppy-DragDrop-input",type:"file",hidden:!0,ref:i=>{this.fileInputRef=i},name:this.opts.inputName,multiple:t.maxNumberOfFiles!==1,accept:(e=t.allowedFileTypes)==null?void 0:e.join(", "),onChange:this.onInputChange})}static renderArrowSvg(){return p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-DragDrop-arrow",width:"16",height:"16",viewBox:"0 0 16 16"},p("path",{d:"M11 10V0H5v10H2l6 6 6-6h-3zm0 0",fillRule:"evenodd"}))}renderLabel(){return p("div",{className:"uppy-DragDrop-label"},this.i18nArray("dropHereOr",{browse:p("span",{className:"uppy-DragDrop-browse"},this.i18n("browse"))}))}renderNote(){return p("span",{className:"uppy-DragDrop-note"},this.opts.note)}render(){let e=`uppy-u-reset
|
|
21
|
+
uppy-DragDrop-container
|
|
22
|
+
${this.isDragDropSupported?"uppy-DragDrop--isDragDropSupported":""}
|
|
23
|
+
${this.getPluginState().isDraggingOver?"uppy-DragDrop--isDraggingOver":""}
|
|
24
|
+
`,t={width:this.opts.width,height:this.opts.height};return p("button",{type:"button",className:e,style:t,onClick:()=>this.fileInputRef.click(),onDragOver:this.handleDragOver,onDragLeave:this.handleDragLeave,onDrop:this.handleDrop},this.renderHiddenFileInput(),p("div",{className:"uppy-DragDrop-inner"},r.renderArrowSvg(),this.renderLabel(),this.renderNote()))}install(){let{target:e}=this.opts;this.setPluginState({isDraggingOver:!1}),e&&this.mount(e,this)}uninstall(){this.unmount()}};Pr.VERSION=hf.version;var Pa=class{onMount(e,t){this.options=m(m({},e),this.props),this.uppy.use(t,this.options),this.plugin=this.uppy.getPlugin(this.options.id)}handleChanges(e,t){e.uppy&&this.uppy!==e.uppy.previousValue&&e.uppy.previousValue!==void 0&&(this.uninstall(e.uppy.previousValue),this.uppy.use(t,this.options)),this.options=m(m({},this.options),this.props),this.plugin=this.uppy.getPlugin(this.options.id),e.props&&this.props!==e.props.previousValue&&e.props.previousValue!==void 0&&this.plugin.setOptions(m({},this.options))}uninstall(e=this.uppy){e.removePlugin(this.plugin)}},fd=(()=>{class r extends Pa{constructor(t){super(),this.el=t,this.uppy=new Lr,this.props={}}ngOnInit(){this.onMount({id:"angular:Dashboard",inline:!0,target:this.el.nativeElement},Kt)}ngOnChanges(t){this.handleChanges(t,Kt)}ngOnDestroy(){this.uninstall()}static{this.\u0275fac=function(i){return new(i||r)(Ja(Xa))}}static{this.\u0275cmp=Ti({type:r,selectors:[["uppy-dashboard"]],inputs:{uppy:"uppy",props:"props"},features:[Qa,Ka],decls:0,vars:0,template:function(i,o){},encapsulation:2,changeDetection:0})}}return r})();var md=(()=>{class r{static{this.\u0275fac=function(i){return new(i||r)}}static{this.\u0275mod=Ga({type:r})}static{this.\u0275inj=Wa({})}}return r})();function W(r,e){if(!{}.hasOwnProperty.call(r,e))throw new TypeError("attempted to use private field on non-instance");return r}var mf=0;function Re(r){return"__private_"+mf+++"_"+r}function gf(r){return new Error("Cancelled",{cause:r})}function gd(r){if(r!=null){var e;let t=()=>this.abort(r.reason);r.addEventListener("abort",t,{once:!0});let i=()=>{r.removeEventListener("abort",t)};(e=this.then)==null||e.call(this,i,i)}return this}var Ge=Re("activeRequests"),ze=Re("queuedHandlers"),We=Re("paused"),Xt=Re("pauseTimer"),Oe=Re("downLimit"),Yt=Re("upperLimit"),Pt=Re("rateLimitingTimer"),Si=Re("call"),St=Re("queueNext"),ka=Re("next"),Sa=Re("queue"),_a=Re("dequeue"),Fa=Re("resume"),Jt=Re("increaseLimit"),_o=class{constructor(e){Object.defineProperty(this,_a,{value:xf}),Object.defineProperty(this,Sa,{value:wf}),Object.defineProperty(this,ka,{value:vf}),Object.defineProperty(this,St,{value:bf}),Object.defineProperty(this,Si,{value:yf}),Object.defineProperty(this,Ge,{writable:!0,value:0}),Object.defineProperty(this,ze,{writable:!0,value:[]}),Object.defineProperty(this,We,{writable:!0,value:!1}),Object.defineProperty(this,Xt,{writable:!0,value:void 0}),Object.defineProperty(this,Oe,{writable:!0,value:1}),Object.defineProperty(this,Yt,{writable:!0,value:void 0}),Object.defineProperty(this,Pt,{writable:!0,value:void 0}),Object.defineProperty(this,Fa,{writable:!0,value:()=>this.resume()}),Object.defineProperty(this,Jt,{writable:!0,value:()=>{if(W(this,We)[We]){W(this,Pt)[Pt]=setTimeout(W(this,Jt)[Jt],0);return}W(this,Oe)[Oe]=this.limit,this.limit=Math.ceil((W(this,Yt)[Yt]+W(this,Oe)[Oe])/2);for(let t=W(this,Oe)[Oe];t<=this.limit;t++)W(this,St)[St]();W(this,Yt)[Yt]-W(this,Oe)[Oe]>3?W(this,Pt)[Pt]=setTimeout(W(this,Jt)[Jt],2e3):W(this,Oe)[Oe]=Math.floor(W(this,Oe)[Oe]/2)}}),typeof e!="number"||e===0?this.limit=1/0:this.limit=e}run(e,t){return!W(this,We)[We]&&W(this,Ge)[Ge]<this.limit?W(this,Si)[Si](e):W(this,Sa)[Sa](e,t)}wrapSyncFunction(e,t){var i=this;return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];let n=i.run(()=>(e(...s),queueMicrotask(()=>n.done()),()=>{}),t);return{abortOn:gd,abort(){n.abort()}}}}wrapPromiseFunction(e,t){var i=this;return function(){for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];let n,l=new Promise((d,h)=>{n=i.run(()=>{let u,g;try{g=Promise.resolve(e(...s))}catch(y){g=Promise.reject(y)}return g.then(y=>{u?h(u):(n.done(),d(y))},y=>{u?h(u):(n.done(),h(y))}),y=>{u=gf(y)}},t)});return l.abort=d=>{n.abort(d)},l.abortOn=gd,l}}resume(){W(this,We)[We]=!1,clearTimeout(W(this,Xt)[Xt]);for(let e=0;e<this.limit;e++)W(this,St)[St]()}pause(e){e===void 0&&(e=null),W(this,We)[We]=!0,clearTimeout(W(this,Xt)[Xt]),e!=null&&(W(this,Xt)[Xt]=setTimeout(W(this,Fa)[Fa],e))}rateLimit(e){clearTimeout(W(this,Pt)[Pt]),this.pause(e),this.limit>1&&Number.isFinite(this.limit)&&(W(this,Yt)[Yt]=this.limit-1,this.limit=W(this,Oe)[Oe],W(this,Pt)[Pt]=setTimeout(W(this,Jt)[Jt],e))}get isPaused(){return W(this,We)[We]}};function yf(r){W(this,Ge)[Ge]+=1;let e=!1,t;try{t=r()}catch(i){throw W(this,Ge)[Ge]-=1,i}return{abort:i=>{e||(e=!0,W(this,Ge)[Ge]-=1,t?.(i),W(this,St)[St]())},done:()=>{e||(e=!0,W(this,Ge)[Ge]-=1,W(this,St)[St]())}}}function bf(){queueMicrotask(()=>W(this,ka)[ka]())}function vf(){if(W(this,We)[We]||W(this,Ge)[Ge]>=this.limit||W(this,ze)[ze].length===0)return;let r=W(this,ze)[ze].shift();if(r==null)throw new Error("Invariant violation: next is null");let e=W(this,Si)[Si](r.fn);r.abort=e.abort,r.done=e.done}function wf(r,e){let t={fn:r,priority:e?.priority||0,abort:()=>{W(this,_a)[_a](t)},done:()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")}},i=W(this,ze)[ze].findIndex(o=>t.priority>o.priority);return i===-1?W(this,ze)[ze].push(t):W(this,ze)[ze].splice(i,0,t),t}function xf(r){let e=W(this,ze)[ze].indexOf(r);e!==-1&&W(this,ze)[ze].splice(e,1)}var yw=Symbol("__queue");var Ca=ue(Tr(),1),wd=ue(yd(),1);var bd={strings:{compressingImages:"Compressing images...",compressedX:"Saved %{size} by compressing images"}};function vd(r,e){if(!{}.hasOwnProperty.call(r,e))throw new TypeError("attempted to use private field on non-instance");return r}var Pf=0;function Sf(r){return"__private_"+Pf+++"_"+r}var Ff={quality:.6,limit:10},Fi=Sf("RateLimitedQueue"),Io=class extends At{constructor(e,t){super(e,m(m({},Ff),t)),Object.defineProperty(this,Fi,{writable:!0,value:void 0}),this.id=this.opts.id||"Compressor",this.type="modifier",this.defaultLocale=bd,vd(this,Fi)[Fi]=new _o(this.opts.limit),this.i18nInit(),this.prepareUpload=this.prepareUpload.bind(this),this.compress=this.compress.bind(this)}compress(e){return new Promise((t,i)=>{new wd.default(e,O(m({},this.opts),{success:t,error:i}))})}prepareUpload(e){return _(this,null,function*(){let t=0,i=[],o=vd(this,Fi)[Fi].wrapPromiseFunction(a=>_(this,null,function*(){try{let n=yield this.compress(a.data),l=a.data.size-n.size;this.uppy.log(`[Image Compressor] Image ${a.id} compressed by ${(0,Ca.default)(l)}`),t+=l;let{name:d,type:h,size:u}=n,g=st(d),w=`${st(a.meta.name).name}.${g.extension}`;this.uppy.setFileState(a.id,O(m(m(m(m({},d&&{name:d}),g.extension&&{extension:g.extension}),h&&{type:h}),u&&{size:u}),{data:n,meta:O(m({},a.meta),{type:h,name:w})})),i.push(a)}catch(n){this.uppy.log(`[Image Compressor] Failed to compress ${a.id}:`,"warning"),this.uppy.log(n,"warning")}})),s=e.map(a=>{var n;let l=this.uppy.getFile(a);return this.uppy.emit("preprocess-progress",l,{mode:"indeterminate",message:this.i18n("compressingImages")}),l.isRemote||(l.data.type||(l.data=l.data.slice(0,l.data.size,l.type)),!((n=l.type)!=null&&n.startsWith("image/")))?Promise.resolve():o(l)});yield Promise.all(s),this.uppy.emit("compressor:complete",i),t>1024&&this.uppy.info(this.i18n("compressedX",{size:(0,Ca.default)(t)}),"info");for(let a of e){let n=this.uppy.getFile(a);this.uppy.emit("preprocess-complete",n)}})}install(){this.uppy.addPreProcessor(this.prepareUpload)}uninstall(){this.uppy.removePreProcessor(this.prepareUpload)}};var Pd=ue(xd(),1);function kf(r,e){if(r&1&&(ir(0,"small",5),sr(1),or()),r&2){let t=_r();ut(),on(t.subtitle)}}function _f(r,e){if(r&1&&(ir(0,"a",6),Ai(1,"i",7),sr(2," Download Template "),or()),r&2){let t=_r();Za("top-58",t.subtitle),rr("href",t.sampleUrl,Ya)}}function If(r,e){if(r&1&&(tn(0),sr(1),rn()),r&2){let t=_r(2);ut(),zo("- ",t.rowSummary().rowEmpty," empty in the CSV you uploaded")}}function Df(r,e){if(r&1&&(ir(0,"div",4)(1,"h4",8),sr(2,"CSV File Content Summary"),or(),Ai(3,"hr"),ir(4,"p",9),sr(5),Oo(6,If,2,1,"ng-container",10),or()()),r&2){let t=_r();ut(5),zo("",t.rowSummary().rowCount," rows found "),ut(),rr("ngIf",t.rowSummary().rowEmpty>0)}}var $w=(()=>{class r{static{this.sizes=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"]}static{this.kilobyte=1024}constructor(){this.sampleUrl="",this.subtitle="",this.showSample=!0,this.showSubtitle=!0,this.uppyCoreConfiguration=Ao(),this.dashboardPropsConfiguration=Ao(),this.fileUploaded=new tr,this.fileUploadComplete=new tr,this.fileRemoved=new tr,this.onParser=new tr,this.multipleFilesUploaded=new tr,this.http=Eo(hn),this.csvParser=Eo(un),this.rowSummary=Ei({rowCount:0,rowEmpty:0}),this.file=Ei(null),this.multipleFiles=Ei([]),this.uppy=new Lr({debug:!0,autoProceed:!0,allowMultipleUploadBatches:!1,restrictions:{allowedFileTypes:[".csv"],maxTotalFileSize:1e6}}).use(Io,{mimeType:"image/jpeg",convertSize:1/0,convertTypes:["image/png"]}),this.dashboardProps={hideUploadButton:!0,height:350},Uo(()=>this.uppy.setOptions(m({},this.uppyCoreConfiguration()))),Uo(()=>this.dashboardProps=m(m({},this.dashboardProps),this.dashboardPropsConfiguration())),this.uppy.on("upload",(t,i)=>{let o=i[0]?.data;this.showSample=!1,this.showSubtitle=!1,console.log(t,i,o),this.fileUploaded.emit(o),this.file.set(i[0].data),Pd.default.parse(o,{skipEmptyLines:"greedy",header:!0,beforeFirstChunk:s=>{let a=s.split(/\r?\n/).slice(1);return a[a.length-1]===""&&a.pop(),this.rowSummary.update(n=>O(m({},n),{rowCount:a.length})),a.forEach(n=>{n.split(",").every(d=>d==="")&&this.rowSummary.update(d=>O(m({},d),{rowEmpty:d.rowEmpty+1}))}),s},error(s,a){console.log("ERROR",s,a)},complete:(s,a)=>{this.onParser.emit(s.data)}})}),this.uppy.on("complete",t=>{let i=t.successful?.map(s=>({file:s.data,id:s.id}))??[],o=t.successful[0]?.data;this.showSample=!1,this.showSubtitle=!1,console.log(o),this.fileUploadComplete.emit(o),this.multipleFilesUploaded.emit(i),this.file.set(o),this.multipleFiles.set(i)}),this.uppy.on("transloadit:upload",(t,i)=>{console.log(t,i)}),this.uppy.on("transloadit:result",(t,i)=>{console.log(t,i)}),this.uppy.on("file-removed",t=>{this.showSample=!0,this.showSubtitle=!0,this.file.set(null);let o=this.multipleFiles().filter(s=>s.id!=t.id);this.multipleFiles.set(o),this.fileRemoved.emit(t.id),this.rowSummary.set({rowCount:0,rowEmpty:0})})}formatFileSize(t,i=2){if(t===0)return"0 bytes";let o=Math.floor(Math.log(t)/Math.log(r.kilobyte));return`${(t/Math.pow(r.kilobyte,o)).toFixed(i)} ${r.sizes[o]}`}static{this.\u0275fac=function(i){return new(i||r)}}static{this.\u0275cmp=Ti({type:r,selectors:[["POS-uppy"]],inputs:{sampleUrl:"sampleUrl",subtitle:"subtitle",uppyCoreConfiguration:[1,"uppyCoreConfiguration"],dashboardPropsConfiguration:[1,"dashboardPropsConfiguration"]},outputs:{fileUploaded:"fileUploaded",fileUploadComplete:"fileUploadComplete",fileRemoved:"fileRemoved",onParser:"onParser",multipleFilesUploaded:"multipleFilesUploaded"},standalone:!0,features:[sn],decls:5,vars:5,consts:[[1,"position-relative"],[3,"uppy","props"],["class","subtitle position-absolute",4,"ngIf"],["class","sample position-absolute","role","button",3,"top-58","href",4,"ngIf"],["role","alert",1,"alert","alert-warning","d-flex","flex-column","gap-2",2,"margin","1rem 0 0 0"],[1,"subtitle","position-absolute"],["role","button",1,"sample","position-absolute",3,"href"],[1,"fa-solid","fa-download","ms-3"],[1,"alert-heading"],[1,"fs-6","m-0"],[4,"ngIf"]],template:function(i,o){if(i&1&&(ir(0,"div",0),Ai(1,"uppy-dashboard",1),Oo(2,kf,2,1,"small",2)(3,_f,3,3,"a",3)(4,Df,7,2,"div",4),or()),i&2){let s;ut(),rr("uppy",o.uppy)("props",o.dashboardProps),ut(),rr("ngIf",o.subtitle&&o.showSubtitle),ut(),rr("ngIf",o.sampleUrl&&o.showSample),ut(),en(o.file()&&((s=o.file())==null?null:s.type)==="text/csv"?4:-1)}},dependencies:[md,fd,nn,an],styles:[".uppy-Dashboard-AddFiles-info{display:none!important} .uppy-Dashboard-AddFiles-list{flex:none;flex-direction:row;flex-wrap:wrap;justify-content:center;max-width:600px;margin-top:15px;padding-top:0;overflow-y:visible}.sample[_ngcontent-%COMP%], .subtitle[_ngcontent-%COMP%]{top:56%;width:100%;text-align:center}.top-58[_ngcontent-%COMP%]{top:61%}"]})}}return r})();export{xd as a,$w as b};
|