@exulu/frontend 1.8.0 → 1.10.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/dist/.next/BUILD_ID +1 -1
- package/dist/.next/app-build-manifest.json +153 -155
- package/dist/.next/app-path-routes-manifest.json +1 -1
- package/dist/.next/build-manifest.json +2 -2
- package/dist/.next/prerender-manifest.json +1 -1
- package/dist/.next/server/app/(application)/agents/edit/[id]/page.js +1 -1
- package/dist/.next/server/app/(application)/agents/edit/[id]/page.js.nft.json +1 -1
- package/dist/.next/server/app/(application)/agents/edit/[id]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/agents/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/chat/[agent]/[session]/page.js +8 -8
- package/dist/.next/server/app/(application)/chat/[agent]/[session]/page.js.nft.json +1 -1
- package/dist/.next/server/app/(application)/chat/[agent]/[session]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/chat/[agent]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/chat/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/configuration/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/dashboard/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/data/[[...query]]/page.js +4 -4
- package/dist/.next/server/app/(application)/data/[[...query]]/page.js.nft.json +1 -1
- package/dist/.next/server/app/(application)/data/[[...query]]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/evals/[id]/page.js +1 -1
- package/dist/.next/server/app/(application)/evals/[id]/page.js.nft.json +1 -1
- package/dist/.next/server/app/(application)/evals/[id]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/evals/cases/page.js +1 -1
- package/dist/.next/server/app/(application)/evals/cases/page.js.nft.json +1 -1
- package/dist/.next/server/app/(application)/evals/cases/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/evals/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/explorer/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/keys/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/projects/[project]/page.js +1 -1
- package/dist/.next/server/app/(application)/projects/[project]/page.js.nft.json +1 -1
- package/dist/.next/server/app/(application)/projects/[project]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/projects/page.js +1 -1
- package/dist/.next/server/app/(application)/projects/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/prompts/page.js +1 -1
- package/dist/.next/server/app/(application)/prompts/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/roles/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/token/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/users/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/variables/create/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/variables/edit/[variable_id]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/variables/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/variables/usage/[variable_id]/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(application)/workflows/page.js +1 -1
- package/dist/.next/server/app/(application)/workflows/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/(authentication)/login/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/.next/server/app/_not-found.html +1 -1
- package/dist/.next/server/app/_not-found.rsc +1 -1
- package/dist/.next/server/app-paths-manifest.json +5 -5
- package/dist/.next/server/chunks/1025.js +1 -0
- package/dist/.next/server/chunks/2270.js +18 -44
- package/dist/.next/server/chunks/3434.js +1 -1
- package/dist/.next/server/chunks/3503.js +1 -0
- package/dist/.next/server/chunks/5084.js +1 -0
- package/dist/.next/server/chunks/5192.js +1 -1
- package/dist/.next/server/chunks/5485.js +1 -1
- package/dist/.next/server/chunks/5600.js +1 -1
- package/dist/.next/server/chunks/5974.js +1 -0
- package/dist/.next/server/chunks/6590.js +1 -1
- package/dist/.next/server/chunks/7471.js +1 -1
- package/dist/.next/server/chunks/8286.js +1 -1
- package/dist/.next/server/chunks/{3679.js → 9874.js} +5 -5
- package/dist/.next/server/middleware-manifest.json +5 -5
- package/dist/.next/server/pages/404.html +1 -1
- package/dist/.next/server/pages/500.html +1 -1
- package/dist/.next/server/server-reference-manifest.json +1 -1
- package/dist/.next/static/chunks/1685-939396dad2f8f1e0.js +2 -0
- package/dist/.next/static/chunks/1685-939396dad2f8f1e0.js.map +1 -0
- package/dist/.next/static/chunks/{4811-316807e25b634f9f.js → 192-72d6868cd891ccc6.js} +8 -8
- package/dist/.next/static/chunks/192-72d6868cd891ccc6.js.map +1 -0
- package/dist/.next/static/chunks/1957-cf44b1d31a9c7d5c.js +2 -0
- package/dist/.next/static/chunks/1957-cf44b1d31a9c7d5c.js.map +1 -0
- package/dist/.next/static/chunks/342-d9c2d6ae9f9435cb.js +2 -0
- package/dist/.next/static/chunks/342-d9c2d6ae9f9435cb.js.map +1 -0
- package/dist/.next/static/chunks/3750-e3d1b2cccd265190.js +2 -0
- package/dist/.next/static/chunks/3750-e3d1b2cccd265190.js.map +1 -0
- package/dist/.next/static/chunks/{3832-417a5eeee712a793.js → 3832-d7782d6a2771ae6c.js} +1 -1
- package/dist/.next/static/chunks/{3832-417a5eeee712a793.js.map → 3832-d7782d6a2771ae6c.js.map} +1 -1
- package/dist/.next/static/chunks/552-39155a93c527ec6d.js +2 -0
- package/dist/.next/static/chunks/552-39155a93c527ec6d.js.map +1 -0
- package/dist/.next/static/chunks/6280-50b751f993f2fe4f.js +2 -0
- package/dist/.next/static/chunks/6280-50b751f993f2fe4f.js.map +1 -0
- package/dist/.next/static/chunks/6367-59655a85d75e19be.js +2 -0
- package/dist/.next/static/chunks/6367-59655a85d75e19be.js.map +1 -0
- package/dist/.next/static/chunks/6373-aef582adc575d3ca.js +2 -0
- package/dist/.next/static/chunks/6373-aef582adc575d3ca.js.map +1 -0
- package/dist/.next/static/chunks/8030-9c926ea4dfd3a54e.js +2 -0
- package/dist/.next/static/chunks/8030-9c926ea4dfd3a54e.js.map +1 -0
- package/dist/.next/static/chunks/{6805-792cc8008b165c07.js → 8293-ba5cd36594e6fde1.js} +10 -10
- package/dist/.next/static/chunks/8293-ba5cd36594e6fde1.js.map +1 -0
- package/dist/.next/static/chunks/9105-d8ff41060f7ffc85.js +2 -0
- package/dist/.next/static/chunks/9105-d8ff41060f7ffc85.js.map +1 -0
- package/dist/.next/static/chunks/9953-95900a236271a222.js +2 -0
- package/dist/.next/static/chunks/9953-95900a236271a222.js.map +1 -0
- package/dist/.next/static/chunks/app/(application)/agents/edit/[id]/page-e4a4693953329671.js +2 -0
- package/dist/.next/static/chunks/app/(application)/agents/edit/[id]/page-e4a4693953329671.js.map +1 -0
- package/dist/.next/static/chunks/app/(application)/chat/[agent]/[session]/page-d59534ca19eee51f.js +2 -0
- package/dist/.next/static/chunks/app/(application)/chat/[agent]/[session]/page-d59534ca19eee51f.js.map +1 -0
- package/dist/.next/static/chunks/app/(application)/data/[[...query]]/layout-0c7c1b0e1713bf60.js +2 -0
- package/dist/.next/static/chunks/app/(application)/data/[[...query]]/layout-0c7c1b0e1713bf60.js.map +1 -0
- package/dist/.next/static/chunks/app/(application)/data/[[...query]]/page-7db6bfbf02606136.js +2 -0
- package/dist/.next/static/chunks/app/(application)/data/[[...query]]/page-7db6bfbf02606136.js.map +1 -0
- package/dist/.next/static/chunks/app/(application)/evals/[id]/page-a7728cf9b0524489.js +2 -0
- package/dist/.next/static/chunks/app/(application)/evals/[id]/page-a7728cf9b0524489.js.map +1 -0
- package/dist/.next/static/chunks/app/(application)/evals/cases/{page-a39fef7444581565.js → page-827f50c6d1f150d0.js} +2 -2
- package/dist/.next/static/chunks/app/(application)/evals/cases/{page-a39fef7444581565.js.map → page-827f50c6d1f150d0.js.map} +1 -1
- package/dist/.next/static/chunks/app/(application)/explorer/{page-1d676c9dfe3ed58b.js → page-e6b1c034c07776e2.js} +1 -1
- package/dist/.next/static/chunks/app/(application)/explorer/{page-1d676c9dfe3ed58b.js.map → page-e6b1c034c07776e2.js.map} +1 -1
- package/dist/.next/static/chunks/app/(application)/projects/[project]/page-f04fd5291a1ef7b1.js +2 -0
- package/dist/.next/static/chunks/app/(application)/projects/[project]/page-f04fd5291a1ef7b1.js.map +1 -0
- package/dist/.next/static/chunks/app/(application)/prompts/page-2c500e9898447506.js +2 -0
- package/dist/.next/static/chunks/app/(application)/prompts/page-2c500e9898447506.js.map +1 -0
- package/dist/.next/static/chunks/app/(application)/token/{page-3f74f711f3d04fce.js → page-3acc39cb8a718331.js} +1 -1
- package/dist/.next/static/chunks/app/(application)/token/{page-3f74f711f3d04fce.js.map → page-3acc39cb8a718331.js.map} +1 -1
- package/dist/.next/static/chunks/app/(application)/workflows/{page-47dedb88cec600d5.js → page-e38f9456120dab69.js} +2 -2
- package/dist/.next/static/chunks/app/(application)/workflows/page-e38f9456120dab69.js.map +1 -0
- package/dist/.next/static/chunks/ba12c10f-85ed008ce7746dbe.js +2 -0
- package/dist/.next/static/chunks/ba12c10f-85ed008ce7746dbe.js.map +1 -0
- package/dist/.next/static/css/9c08ae5d990a6b14.css +4 -0
- package/dist/.next/static/css/9c08ae5d990a6b14.css.map +1 -0
- package/dist/.next/static/css/e3f2a16ab7676b05.css.map +1 -1
- package/dist/package.json +1 -1
- package/package.json +1 -1
- package/dist/.next/server/chunks/2948.js +0 -1
- package/dist/.next/server/chunks/38.js +0 -1
- package/dist/.next/server/chunks/7958.js +0 -1
- package/dist/.next/server/chunks/8050.js +0 -1
- package/dist/.next/static/chunks/1685-9cacdee7e3f0942f.js +0 -2
- package/dist/.next/static/chunks/1685-9cacdee7e3f0942f.js.map +0 -1
- package/dist/.next/static/chunks/1957-39a01a3915f246ab.js +0 -2
- package/dist/.next/static/chunks/1957-39a01a3915f246ab.js.map +0 -1
- package/dist/.next/static/chunks/3750-f45c59ef1cc79417.js +0 -2
- package/dist/.next/static/chunks/3750-f45c59ef1cc79417.js.map +0 -1
- package/dist/.next/static/chunks/4811-316807e25b634f9f.js.map +0 -1
- package/dist/.next/static/chunks/5282-68f9880f1f951f44.js +0 -2
- package/dist/.next/static/chunks/5282-68f9880f1f951f44.js.map +0 -1
- package/dist/.next/static/chunks/572-2940a399da1e3a3b.js +0 -2
- package/dist/.next/static/chunks/572-2940a399da1e3a3b.js.map +0 -1
- package/dist/.next/static/chunks/6367-59cef3c74213925b.js +0 -2
- package/dist/.next/static/chunks/6367-59cef3c74213925b.js.map +0 -1
- package/dist/.next/static/chunks/6373-4c5dffaf4193621c.js +0 -2
- package/dist/.next/static/chunks/6373-4c5dffaf4193621c.js.map +0 -1
- package/dist/.next/static/chunks/6805-792cc8008b165c07.js.map +0 -1
- package/dist/.next/static/chunks/8030-c1b6be46253076cb.js +0 -2
- package/dist/.next/static/chunks/8030-c1b6be46253076cb.js.map +0 -1
- package/dist/.next/static/chunks/9105-dfbce1bad8e3e8dd.js +0 -2
- package/dist/.next/static/chunks/9105-dfbce1bad8e3e8dd.js.map +0 -1
- package/dist/.next/static/chunks/9621-f81c4d7c0ecf5a67.js +0 -2
- package/dist/.next/static/chunks/9621-f81c4d7c0ecf5a67.js.map +0 -1
- package/dist/.next/static/chunks/9953-dfb5fc0e5b74ec09.js +0 -2
- package/dist/.next/static/chunks/9953-dfb5fc0e5b74ec09.js.map +0 -1
- package/dist/.next/static/chunks/app/(application)/agents/edit/[id]/page-4e7e02768ed1a72a.js +0 -2
- package/dist/.next/static/chunks/app/(application)/agents/edit/[id]/page-4e7e02768ed1a72a.js.map +0 -1
- package/dist/.next/static/chunks/app/(application)/chat/[agent]/[session]/page-38f845d5ccdad76b.js +0 -2
- package/dist/.next/static/chunks/app/(application)/chat/[agent]/[session]/page-38f845d5ccdad76b.js.map +0 -1
- package/dist/.next/static/chunks/app/(application)/data/[[...query]]/layout-2d47be0ee80dd89d.js +0 -2
- package/dist/.next/static/chunks/app/(application)/data/[[...query]]/layout-2d47be0ee80dd89d.js.map +0 -1
- package/dist/.next/static/chunks/app/(application)/data/[[...query]]/page-a391b8407f74e9b4.js +0 -2
- package/dist/.next/static/chunks/app/(application)/data/[[...query]]/page-a391b8407f74e9b4.js.map +0 -1
- package/dist/.next/static/chunks/app/(application)/evals/[id]/page-cf6f8d2bd4e9c819.js +0 -2
- package/dist/.next/static/chunks/app/(application)/evals/[id]/page-cf6f8d2bd4e9c819.js.map +0 -1
- package/dist/.next/static/chunks/app/(application)/projects/[project]/page-bc859da58d8505f7.js +0 -2
- package/dist/.next/static/chunks/app/(application)/projects/[project]/page-bc859da58d8505f7.js.map +0 -1
- package/dist/.next/static/chunks/app/(application)/prompts/page-d2f36ff149385efd.js +0 -2
- package/dist/.next/static/chunks/app/(application)/prompts/page-d2f36ff149385efd.js.map +0 -1
- package/dist/.next/static/chunks/app/(application)/workflows/page-47dedb88cec600d5.js.map +0 -1
- package/dist/.next/static/chunks/ba12c10f-aaafcb074f608624.js +0 -2
- package/dist/.next/static/chunks/ba12c10f-aaafcb074f608624.js.map +0 -1
- package/dist/.next/static/css/c8c015815c72d053.css +0 -4
- package/dist/.next/static/css/c8c015815c72d053.css.map +0 -1
- /package/dist/.next/static/{GOwerAkBncYx0J8q1TqQb → 3j63p6b3zZZB_v1Hn8Mxp}/_buildManifest.js +0 -0
- /package/dist/.next/static/{GOwerAkBncYx0J8q1TqQb → 3j63p6b3zZZB_v1Hn8Mxp}/_ssgManifest.js +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4811],{85110:function(e){"use strict";e.exports=function(e){if("number"!=typeof e||Number.isNaN(e))throw TypeError(`Expected a number, got ${typeof e}`);let t=Math.abs(e);if(e<0&&(t=-t),0===t)return"0 B";let i=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],r=Math.min(Math.floor(Math.log(t)/Math.log(1024)),i.length-1),s=Number(t/1024**r),n=i[r];return`${s>=10||s%1==0?Math.round(s):s.toFixed(1)} ${n}`}},59196:function(e,t){"use strict";t.byteLength=function(e){var t=l(e),i=t[0],r=t[1];return(i+r)*3/4-r},t.toByteArray=function(e){var t,i,n=l(e),a=n[0],o=n[1],u=new s((a+o)*3/4-o),h=0,p=o>0?a-4:a;for(i=0;i<p;i+=4)t=r[e.charCodeAt(i)]<<18|r[e.charCodeAt(i+1)]<<12|r[e.charCodeAt(i+2)]<<6|r[e.charCodeAt(i+3)],u[h++]=t>>16&255,u[h++]=t>>8&255,u[h++]=255&t;return 2===o&&(t=r[e.charCodeAt(i)]<<2|r[e.charCodeAt(i+1)]>>4,u[h++]=255&t),1===o&&(t=r[e.charCodeAt(i)]<<10|r[e.charCodeAt(i+1)]<<4|r[e.charCodeAt(i+2)]>>2,u[h++]=t>>8&255,u[h++]=255&t),u},t.fromByteArray=function(e){for(var t,r=e.length,s=r%3,n=[],a=0,o=r-s;a<o;a+=16383)n.push(function(e,t,r){for(var s,n=[],a=t;a<r;a+=3)n.push(i[(s=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]))>>18&63]+i[s>>12&63]+i[s>>6&63]+i[63&s]);return n.join("")}(e,a,a+16383>o?o:a+16383));return 1===s?n.push(i[(t=e[r-1])>>2]+i[t<<4&63]+"=="):2===s&&n.push(i[(t=(e[r-2]<<8)+e[r-1])>>10]+i[t>>4&63]+i[t<<2&63]+"="),n.join("")};for(var i=[],r=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,o=n.length;a<o;++a)i[a]=n[a],r[n.charCodeAt(a)]=a;function l(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var i=e.indexOf("=");-1===i&&(i=t);var r=i===t?0:4-i%4;return[i,r]}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},82957:function(e,t,i){"use strict";var r=i(59196),s=i(68848),n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function a(e){if(e>2147483647)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,o.prototype),t}function o(e,t,i){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return h(e)}return l(e,t,i)}function l(e,t,i){if("string"==typeof e)return function(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!o.isEncoding(t))throw TypeError("Unknown encoding: "+t);var i=0|f(e,t),r=a(i),s=r.write(e,t);return s!==i&&(r=r.slice(0,s)),r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(A(e,Uint8Array)){var t=new Uint8Array(e);return d(t.buffer,t.byteOffset,t.byteLength)}return p(e)}(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(A(e,ArrayBuffer)||e&&A(e.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(A(e,SharedArrayBuffer)||e&&A(e.buffer,SharedArrayBuffer)))return d(e,t,i);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return o.from(r,t,i);var s=function(e){if(o.isBuffer(e)){var t,i=0|c(e.length),r=a(i);return 0===r.length||e.copy(r,0,0,i),r}return void 0!==e.length?"number"!=typeof e.length||(t=e.length)!=t?a(0):p(e):"Buffer"===e.type&&Array.isArray(e.data)?p(e.data):void 0}(e);if(s)return s;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,i);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function h(e){return u(e),a(e<0?0:0|c(e))}function p(e){for(var t=e.length<0?0:0|c(e.length),i=a(t),r=0;r<t;r+=1)i[r]=255&e[r];return i}function d(e,t,i){var r;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(i||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(r=void 0===t&&void 0===i?new Uint8Array(e):void 0===i?new Uint8Array(e,t):new Uint8Array(e,t,i),o.prototype),r}function c(e){if(e>=2147483647)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function f(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||A(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var i=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===i)return 0;for(var s=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return k(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return T(e).length;default:if(s)return r?-1:k(e).length;t=(""+t).toLowerCase(),s=!0}}function g(e,t,i){var s,n,a=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===i||i>this.length)&&(i=this.length),i<=0||(i>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,i){var r=e.length;(!t||t<0)&&(t=0),(!i||i<0||i>r)&&(i=r);for(var s="",n=t;n<i;++n)s+=x[e[n]];return s}(this,t,i);case"utf8":case"utf-8":return b(this,t,i);case"ascii":return function(e,t,i){var r="";i=Math.min(e.length,i);for(var s=t;s<i;++s)r+=String.fromCharCode(127&e[s]);return r}(this,t,i);case"latin1":case"binary":return function(e,t,i){var r="";i=Math.min(e.length,i);for(var s=t;s<i;++s)r+=String.fromCharCode(e[s]);return r}(this,t,i);case"base64":return s=t,n=i,0===s&&n===this.length?r.fromByteArray(this):r.fromByteArray(this.slice(s,n));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,i){for(var r=e.slice(t,i),s="",n=0;n<r.length-1;n+=2)s+=String.fromCharCode(r[n]+256*r[n+1]);return s}(this,t,i);default:if(a)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),a=!0}}function m(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function y(e,t,i,r,s){var n;if(0===e.length)return -1;if("string"==typeof i?(r=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),(n=i=+i)!=n&&(i=s?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(s)return -1;i=e.length-1}else if(i<0){if(!s)return -1;i=0}if("string"==typeof t&&(t=o.from(t,r)),o.isBuffer(t))return 0===t.length?-1:v(e,t,i,r,s);if("number"==typeof t)return(t&=255,"function"==typeof Uint8Array.prototype.indexOf)?s?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):v(e,[t],i,r,s);throw TypeError("val must be string, number or Buffer")}function v(e,t,i,r,s){var n,a=1,o=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return -1;a=2,o/=2,l/=2,i/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(s){var h=-1;for(n=i;n<o;n++)if(u(e,n)===u(t,-1===h?0:n-h)){if(-1===h&&(h=n),n-h+1===l)return h*a}else -1!==h&&(n-=n-h),h=-1}else for(i+l>o&&(i=o-l),n=i;n>=0;n--){for(var p=!0,d=0;d<l;d++)if(u(e,n+d)!==u(t,d)){p=!1;break}if(p)return n}return -1}function b(e,t,i){i=Math.min(e.length,i);for(var r=[],s=t;s<i;){var n,a,o,l,u=e[s],h=null,p=u>239?4:u>223?3:u>191?2:1;if(s+p<=i)switch(p){case 1:u<128&&(h=u);break;case 2:(192&(n=e[s+1]))==128&&(l=(31&u)<<6|63&n)>127&&(h=l);break;case 3:n=e[s+1],a=e[s+2],(192&n)==128&&(192&a)==128&&(l=(15&u)<<12|(63&n)<<6|63&a)>2047&&(l<55296||l>57343)&&(h=l);break;case 4:n=e[s+1],a=e[s+2],o=e[s+3],(192&n)==128&&(192&a)==128&&(192&o)==128&&(l=(15&u)<<18|(63&n)<<12|(63&a)<<6|63&o)>65535&&l<1114112&&(h=l)}null===h?(h=65533,p=1):h>65535&&(h-=65536,r.push(h>>>10&1023|55296),h=56320|1023&h),r.push(h),s+=p}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var i="",r=0;r<t;)i+=String.fromCharCode.apply(String,e.slice(r,r+=4096));return i}(r)}function w(e,t,i){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>i)throw RangeError("Trying to access beyond buffer length")}function _(e,t,i,r,s,n){if(!o.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>s||t<n)throw RangeError('"value" argument is out of bounds');if(i+r>e.length)throw RangeError("Index out of range")}function S(e,t,i,r,s,n){if(i+r>e.length||i<0)throw RangeError("Index out of range")}function C(e,t,i,r,n){return t=+t,i>>>=0,n||S(e,t,i,4,34028234663852886e22,-34028234663852886e22),s.write(e,t,i,r,23,4),i+4}function P(e,t,i,r,n){return t=+t,i>>>=0,n||S(e,t,i,8,17976931348623157e292,-17976931348623157e292),s.write(e,t,i,r,52,8),i+8}t.lW=o,t.h2=50,o.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),o.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}}),o.poolSize=8192,o.from=function(e,t,i){return l(e,t,i)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),o.alloc=function(e,t,i){return(u(e),e<=0)?a(e):void 0!==t?"string"==typeof i?a(e).fill(t,i):a(e).fill(t):a(e)},o.allocUnsafe=function(e){return h(e)},o.allocUnsafeSlow=function(e){return h(e)},o.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==o.prototype},o.compare=function(e,t){if(A(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),A(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(e)||!o.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var i=e.length,r=t.length,s=0,n=Math.min(i,r);s<n;++s)if(e[s]!==t[s]){i=e[s],r=t[s];break}return i<r?-1:r<i?1:0},o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(e,t){if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);if(void 0===t)for(i=0,t=0;i<e.length;++i)t+=e[i].length;var i,r=o.allocUnsafe(t),s=0;for(i=0;i<e.length;++i){var n=e[i];if(A(n,Uint8Array))s+n.length>r.length?o.from(n).copy(r,s):Uint8Array.prototype.set.call(r,n,s);else if(o.isBuffer(n))n.copy(r,s);else throw TypeError('"list" argument must be an Array of Buffers');s+=n.length}return r},o.byteLength=f,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)m(this,t,t+1);return this},o.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},o.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},o.prototype.toString=function(){var e=this.length;return 0===e?"":0==arguments.length?b(this,0,e):g.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(e){if(!o.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},o.prototype.inspect=function(){var e="",i=t.h2;return e=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(e+=" ... "),"<Buffer "+e+">"},n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=function(e,t,i,r,s){if(A(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===i&&(i=e?e.length:0),void 0===r&&(r=0),void 0===s&&(s=this.length),t<0||i>e.length||r<0||s>this.length)throw RangeError("out of range index");if(r>=s&&t>=i)return 0;if(r>=s)return -1;if(t>=i)return 1;if(t>>>=0,i>>>=0,r>>>=0,s>>>=0,this===e)return 0;for(var n=s-r,a=i-t,l=Math.min(n,a),u=this.slice(r,s),h=e.slice(t,i),p=0;p<l;++p)if(u[p]!==h[p]){n=u[p],a=h[p];break}return n<a?-1:a<n?1:0},o.prototype.includes=function(e,t,i){return -1!==this.indexOf(e,t,i)},o.prototype.indexOf=function(e,t,i){return y(this,e,t,i,!0)},o.prototype.lastIndexOf=function(e,t,i){return y(this,e,t,i,!1)},o.prototype.write=function(e,t,i,r){if(void 0===t)r="utf8",i=this.length,t=0;else if(void 0===i&&"string"==typeof t)r=t,i=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(i)?(i>>>=0,void 0===r&&(r="utf8")):(r=i,i=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var s,n,a,o,l,u,h,p,d=this.length-t;if((void 0===i||i>d)&&(i=d),e.length>0&&(i<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var c=!1;;)switch(r){case"hex":return function(e,t,i,r){i=Number(i)||0;var s=e.length-i;r?(r=Number(r))>s&&(r=s):r=s;var n=t.length;r>n/2&&(r=n/2);for(var a=0;a<r;++a){var o=parseInt(t.substr(2*a,2),16);if(o!=o)break;e[i+a]=o}return a}(this,e,t,i);case"utf8":case"utf-8":return s=t,n=i,E(k(e,this.length-s),this,s,n);case"ascii":case"latin1":case"binary":return a=t,o=i,E(function(e){for(var t=[],i=0;i<e.length;++i)t.push(255&e.charCodeAt(i));return t}(e),this,a,o);case"base64":return l=t,u=i,E(T(e),this,l,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return h=t,p=i,E(function(e,t){for(var i,r,s=[],n=0;n<e.length&&!((t-=2)<0);++n)r=(i=e.charCodeAt(n))>>8,s.push(i%256),s.push(r);return s}(e,this.length-h),this,h,p);default:if(c)throw TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),c=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},o.prototype.slice=function(e,t){var i=this.length;e=~~e,t=void 0===t?i:~~t,e<0?(e+=i)<0&&(e=0):e>i&&(e=i),t<0?(t+=i)<0&&(t=0):t>i&&(t=i),t<e&&(t=e);var r=this.subarray(e,t);return Object.setPrototypeOf(r,o.prototype),r},o.prototype.readUintLE=o.prototype.readUIntLE=function(e,t,i){e>>>=0,t>>>=0,i||w(e,t,this.length);for(var r=this[e],s=1,n=0;++n<t&&(s*=256);)r+=this[e+n]*s;return r},o.prototype.readUintBE=o.prototype.readUIntBE=function(e,t,i){e>>>=0,t>>>=0,i||w(e,t,this.length);for(var r=this[e+--t],s=1;t>0&&(s*=256);)r+=this[e+--t]*s;return r},o.prototype.readUint8=o.prototype.readUInt8=function(e,t){return e>>>=0,t||w(e,1,this.length),this[e]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||w(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||w(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||w(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(e,t){return e>>>=0,t||w(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,i){e>>>=0,t>>>=0,i||w(e,t,this.length);for(var r=this[e],s=1,n=0;++n<t&&(s*=256);)r+=this[e+n]*s;return r>=(s*=128)&&(r-=Math.pow(2,8*t)),r},o.prototype.readIntBE=function(e,t,i){e>>>=0,t>>>=0,i||w(e,t,this.length);for(var r=t,s=1,n=this[e+--r];r>0&&(s*=256);)n+=this[e+--r]*s;return n>=(s*=128)&&(n-=Math.pow(2,8*t)),n},o.prototype.readInt8=function(e,t){return(e>>>=0,t||w(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||w(e,2,this.length);var i=this[e]|this[e+1]<<8;return 32768&i?4294901760|i:i},o.prototype.readInt16BE=function(e,t){e>>>=0,t||w(e,2,this.length);var i=this[e+1]|this[e]<<8;return 32768&i?4294901760|i:i},o.prototype.readInt32LE=function(e,t){return e>>>=0,t||w(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e>>>=0,t||w(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return e>>>=0,t||w(e,4,this.length),s.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e>>>=0,t||w(e,4,this.length),s.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e>>>=0,t||w(e,8,this.length),s.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e>>>=0,t||w(e,8,this.length),s.read(this,e,!1,52,8)},o.prototype.writeUintLE=o.prototype.writeUIntLE=function(e,t,i,r){if(e=+e,t>>>=0,i>>>=0,!r){var s=Math.pow(2,8*i)-1;_(this,e,t,i,s,0)}var n=1,a=0;for(this[t]=255&e;++a<i&&(n*=256);)this[t+a]=e/n&255;return t+i},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(e,t,i,r){if(e=+e,t>>>=0,i>>>=0,!r){var s=Math.pow(2,8*i)-1;_(this,e,t,i,s,0)}var n=i-1,a=1;for(this[t+n]=255&e;--n>=0&&(a*=256);)this[t+n]=e/a&255;return t+i},o.prototype.writeUint8=o.prototype.writeUInt8=function(e,t,i){return e=+e,t>>>=0,i||_(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(e,t,i){return e=+e,t>>>=0,i||_(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(e,t,i){return e=+e,t>>>=0,i||_(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(e,t,i){return e=+e,t>>>=0,i||_(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(e,t,i){return e=+e,t>>>=0,i||_(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeIntLE=function(e,t,i,r){if(e=+e,t>>>=0,!r){var s=Math.pow(2,8*i-1);_(this,e,t,i,s-1,-s)}var n=0,a=1,o=0;for(this[t]=255&e;++n<i&&(a*=256);)e<0&&0===o&&0!==this[t+n-1]&&(o=1),this[t+n]=(e/a>>0)-o&255;return t+i},o.prototype.writeIntBE=function(e,t,i,r){if(e=+e,t>>>=0,!r){var s=Math.pow(2,8*i-1);_(this,e,t,i,s-1,-s)}var n=i-1,a=1,o=0;for(this[t+n]=255&e;--n>=0&&(a*=256);)e<0&&0===o&&0!==this[t+n+1]&&(o=1),this[t+n]=(e/a>>0)-o&255;return t+i},o.prototype.writeInt8=function(e,t,i){return e=+e,t>>>=0,i||_(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,i){return e=+e,t>>>=0,i||_(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,i){return e=+e,t>>>=0,i||_(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,i){return e=+e,t>>>=0,i||_(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,i){return e=+e,t>>>=0,i||_(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeFloatLE=function(e,t,i){return C(this,e,t,!0,i)},o.prototype.writeFloatBE=function(e,t,i){return C(this,e,t,!1,i)},o.prototype.writeDoubleLE=function(e,t,i){return P(this,e,t,!0,i)},o.prototype.writeDoubleBE=function(e,t,i){return P(this,e,t,!1,i)},o.prototype.copy=function(e,t,i,r){if(!o.isBuffer(e))throw TypeError("argument should be a Buffer");if(i||(i=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<i&&(r=i),r===i||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw RangeError("Index out of range");if(r<0)throw RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-i&&(r=e.length-t+i);var s=r-i;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,i,r):Uint8Array.prototype.set.call(e,this.subarray(i,r),t),s},o.prototype.fill=function(e,t,i,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,i=this.length):"string"==typeof i&&(r=i,i=this.length),void 0!==r&&"string"!=typeof r)throw TypeError("encoding must be a string");if("string"==typeof r&&!o.isEncoding(r))throw TypeError("Unknown encoding: "+r);if(1===e.length){var s,n=e.charCodeAt(0);("utf8"===r&&n<128||"latin1"===r)&&(e=n)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<i)throw RangeError("Out of range index");if(i<=t)return this;if(t>>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"==typeof e)for(s=t;s<i;++s)this[s]=e;else{var a=o.isBuffer(e)?e:o.from(e,r),l=a.length;if(0===l)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(s=0;s<i-t;++s)this[s+t]=a[s%l]}return this};var F=/[^+/0-9A-Za-z-_]/g;function k(e,t){t=t||1/0;for(var i,r=e.length,s=null,n=[],a=0;a<r;++a){if((i=e.charCodeAt(a))>55295&&i<57344){if(!s){if(i>56319||a+1===r){(t-=3)>-1&&n.push(239,191,189);continue}s=i;continue}if(i<56320){(t-=3)>-1&&n.push(239,191,189),s=i;continue}i=(s-55296<<10|i-56320)+65536}else s&&(t-=3)>-1&&n.push(239,191,189);if(s=null,i<128){if((t-=1)<0)break;n.push(i)}else if(i<2048){if((t-=2)<0)break;n.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;n.push(i>>12|224,i>>6&63|128,63&i|128)}else if(i<1114112){if((t-=4)<0)break;n.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}else throw Error("Invalid code point")}return n}function T(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(F,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function E(e,t,i,r){for(var s=0;s<r&&!(s+i>=t.length)&&!(s>=e.length);++s)t[s+i]=e[s];return s}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var x=function(){for(var e="0123456789abcdef",t=Array(256),i=0;i<16;++i)for(var r=16*i,s=0;s<16;++s)t[r+s]=e[i]+e[s];return t}()},68848:function(e,t){t.read=function(e,t,i,r,s){var n,a,o=8*s-r-1,l=(1<<o)-1,u=l>>1,h=-7,p=i?s-1:0,d=i?-1:1,c=e[t+p];for(p+=d,n=c&(1<<-h)-1,c>>=-h,h+=o;h>0;n=256*n+e[t+p],p+=d,h-=8);for(a=n&(1<<-h)-1,n>>=-h,h+=r;h>0;a=256*a+e[t+p],p+=d,h-=8);if(0===n)n=1-u;else{if(n===l)return a?NaN:1/0*(c?-1:1);a+=Math.pow(2,r),n-=u}return(c?-1:1)*a*Math.pow(2,n-r)},t.write=function(e,t,i,r,s,n){var a,o,l,u=8*n-s-1,h=(1<<u)-1,p=h>>1,d=23===s?5960464477539062e-23:0,c=r?0:n-1,f=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(isNaN(t=Math.abs(t))||t===1/0?(o=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+p>=1?t+=d/l:t+=d*Math.pow(2,1-p),t*l>=2&&(a++,l/=2),a+p>=h?(o=0,a=h):a+p>=1?(o=(t*l-1)*Math.pow(2,s),a+=p):(o=t*Math.pow(2,p-1)*Math.pow(2,s),a=0));s>=8;e[i+c]=255&o,c+=f,o/=256,s-=8);for(a=a<<s|o,u+=s;u>0;e[i+c]=255&a,c+=f,a/=256,u-=8);e[i+c-f]|=128*g}},23910:function(e,t,i){var r=i(74288).Symbol;e.exports=r},54506:function(e,t,i){var r=i(23910),s=i(4479),n=i(80910),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?s(e):n(e)}},55041:function(e,t,i){var r=i(5035),s=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(s,""):e}},17071:function(e,t,i){var r="object"==typeof i.g&&i.g&&i.g.Object===Object&&i.g;e.exports=r},4479:function(e,t,i){var r=i(23910),s=Object.prototype,n=s.hasOwnProperty,a=s.toString,o=r?r.toStringTag:void 0;e.exports=function(e){var t=n.call(e,o),i=e[o];try{e[o]=void 0;var r=!0}catch(e){}var s=a.call(e);return r&&(t?e[o]=i:delete e[o]),s}},80910:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},74288:function(e,t,i){var r=i(17071),s="object"==typeof self&&self&&self.Object===Object&&self,n=r||s||Function("return this")();e.exports=n},5035:function(e){var t=/\s/;e.exports=function(e){for(var i=e.length;i--&&t.test(e.charAt(i)););return i}},7310:function(e,t,i){var r=i(28302),s=i(11121),n=i(6660),a=Math.max,o=Math.min;e.exports=function(e,t,i){var l,u,h,p,d,c,f=0,g=!1,m=!1,y=!0;if("function"!=typeof e)throw TypeError("Expected a function");function v(t){var i=l,r=u;return l=u=void 0,f=t,p=e.apply(r,i)}function b(e){var i=e-c,r=e-f;return void 0===c||i>=t||i<0||m&&r>=h}function w(){var e,i,r,n=s();if(b(n))return _(n);d=setTimeout(w,(e=n-c,i=n-f,r=t-e,m?o(r,h-i):r))}function _(e){return(d=void 0,y&&l)?v(e):(l=u=void 0,p)}function S(){var e,i=s(),r=b(i);if(l=arguments,u=this,c=i,r){if(void 0===d)return f=e=c,d=setTimeout(w,t),g?v(e):p;if(m)return clearTimeout(d),d=setTimeout(w,t),v(c)}return void 0===d&&(d=setTimeout(w,t)),p}return t=n(t)||0,r(i)&&(g=!!i.leading,h=(m="maxWait"in i)?a(n(i.maxWait)||0,t):h,y="trailing"in i?!!i.trailing:y),S.cancel=function(){void 0!==d&&clearTimeout(d),f=0,l=c=u=d=void 0},S.flush=function(){return void 0===d?p:_(s())},S}},28302:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},10303:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},78371:function(e,t,i){var r=i(54506),s=i(10303);e.exports=function(e){return"symbol"==typeof e||s(e)&&"[object Symbol]"==r(e)}},11121:function(e,t,i){var r=i(74288);e.exports=function(){return r.Date.now()}},37065:function(e,t,i){var r=i(7310),s=i(28302);e.exports=function(e,t,i){var n=!0,a=!0;if("function"!=typeof e)throw TypeError("Expected a function");return s(i)&&(n="leading"in i?!!i.leading:n,a="trailing"in i?!!i.trailing:a),r(e,t,{leading:n,maxWait:t,trailing:a})}},6660:function(e,t,i){var r=i(55041),s=i(28302),n=i(78371),a=0/0,o=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,u=/^0o[0-7]+$/i,h=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(n(e))return a;if(s(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=s(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var i=l.test(e);return i||u.test(e)?h(e.slice(2),i?2:8):o.test(e)?a:+e}},92451:function(e,t,i){"use strict";i.d(t,{Z:function(){return r}});let r=(0,i(39763).Z)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},92735:function(e,t,i){"use strict";i.d(t,{Z:function(){return r}});let r=(0,i(39763).Z)("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]])},88964:function(e,t,i){"use strict";i.d(t,{Z:function(){return r}});let r=(0,i(39763).Z)("FilePlus",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["line",{x1:"12",x2:"12",y1:"18",y2:"12",key:"1tsf04"}],["line",{x1:"9",x2:"15",y1:"15",y2:"15",key:"110plj"}]])},48736:function(e,t,i){"use strict";i.d(t,{Z:function(){return r}});let r=(0,i(39763).Z)("FileText",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["line",{x1:"16",x2:"8",y1:"13",y2:"13",key:"14keom"}],["line",{x1:"16",x2:"8",y1:"17",y2:"17",key:"17nazh"}],["line",{x1:"10",x2:"8",y1:"9",y2:"9",key:"1a5vjj"}]])},30044:function(e,t,i){"use strict";i.d(t,{Z:function(){return r}});let r=(0,i(39763).Z)("FileWarning",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},69658:function(e,t,i){"use strict";i.d(t,{Z:function(){return r}});let r=(0,i(39763).Z)("File",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}]])},53113:function(e,t,i){"use strict";i.d(t,{Z:function(){return r}});let r=(0,i(39763).Z)("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]])},15001:function(e,t,i){"use strict";i.d(t,{Z:function(){return r}});let r=(0,i(39763).Z)("Loader",[["line",{x1:"12",x2:"12",y1:"2",y2:"6",key:"gza1u7"}],["line",{x1:"12",x2:"12",y1:"18",y2:"22",key:"1qhbu9"}],["line",{x1:"4.93",x2:"7.76",y1:"4.93",y2:"7.76",key:"xae44r"}],["line",{x1:"16.24",x2:"19.07",y1:"16.24",y2:"19.07",key:"bxnmvf"}],["line",{x1:"2",x2:"6",y1:"12",y2:"12",key:"89khin"}],["line",{x1:"18",x2:"22",y1:"12",y2:"12",key:"pb8tfm"}],["line",{x1:"4.93",x2:"7.76",y1:"19.07",y2:"16.24",key:"1uxjnu"}],["line",{x1:"16.24",x2:"19.07",y1:"7.76",y2:"4.93",key:"6duxfx"}]])},99397:function(e,t,i){"use strict";i.d(t,{Z:function(){return r}});let r=(0,i(39763).Z)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},67385:function(e,t,i){var r=i(40548),s=/[\/\+\.]/;e.exports=function(e,t){function i(t){var i=r(t,e,s);return i&&i.length>=2}return t?i(t.split(";")[0]):i}},71157:function(e){e.exports=function(){var e={},t=e._fns={};return e.emit=function(e,i,r,s,n,a,o){var l=function(e){for(var i=t[e]?t[e]:[],r=e.indexOf(":"),s=-1===r?[e]:[e.substring(0,r),e.substring(r+1)],n=Object.keys(t),a=0,o=n.length;a<o;a++){var l=n[a];if("*"===l&&(i=i.concat(t[l])),2===s.length&&s[0]===l){i=i.concat(t[l]);break}}return i}(e);l.length&&function(e,t,i){for(var r=0,s=t.length;r<s&&t[r];r++)t[r].event=e,t[r].apply(t[r],i)}(e,l,[i,r,s,n,a,o])},e.on=function(e,i){t[e]||(t[e]=[]),t[e].push(i)},e.once=function(t,i){this.on(t,function r(){i.apply(this,arguments),e.off(t,r)})},e.off=function(e,t){var i=[];if(e&&t)for(var r=this._fns[e],s=0,n=r?r.length:0;s<n;s++)r[s]!==t&&i.push(r[s]);i.length?this._fns[e]=i:delete this._fns[e]},e}},66703:function(e){"use strict";var t=Object.prototype.hasOwnProperty,i="~";function r(){}function s(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function n(e,t,r,n,a){if("function"!=typeof r)throw TypeError("The listener must be a function");var o=new s(r,n||e,a),l=i?i+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],o]:e._events[l].push(o):(e._events[l]=o,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function o(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(i=!1)),o.prototype.eventNames=function(){var e,r,s=[];if(0===this._eventsCount)return s;for(r in e=this._events)t.call(e,r)&&s.push(i?r.slice(1):r);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(e)):s},o.prototype.listeners=function(e){var t=i?i+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var s=0,n=r.length,a=Array(n);s<n;s++)a[s]=r[s].fn;return a},o.prototype.listenerCount=function(e){var t=i?i+e:e,r=this._events[t];return r?r.fn?1:r.length:0},o.prototype.emit=function(e,t,r,s,n,a){var o=i?i+e:e;if(!this._events[o])return!1;var l,u,h=this._events[o],p=arguments.length;if(h.fn){switch(h.once&&this.removeListener(e,h.fn,void 0,!0),p){case 1:return h.fn.call(h.context),!0;case 2:return h.fn.call(h.context,t),!0;case 3:return h.fn.call(h.context,t,r),!0;case 4:return h.fn.call(h.context,t,r,s),!0;case 5:return h.fn.call(h.context,t,r,s,n),!0;case 6:return h.fn.call(h.context,t,r,s,n,a),!0}for(u=1,l=Array(p-1);u<p;u++)l[u-1]=arguments[u];h.fn.apply(h.context,l)}else{var d,c=h.length;for(u=0;u<c;u++)switch(h[u].once&&this.removeListener(e,h[u].fn,void 0,!0),p){case 1:h[u].fn.call(h[u].context);break;case 2:h[u].fn.call(h[u].context,t);break;case 3:h[u].fn.call(h[u].context,t,r);break;case 4:h[u].fn.call(h[u].context,t,r,s);break;default:if(!l)for(d=1,l=Array(p-1);d<p;d++)l[d-1]=arguments[d];h[u].fn.apply(h[u].context,l)}}return!0},o.prototype.on=function(e,t,i){return n(this,e,t,i,!1)},o.prototype.once=function(e,t,i){return n(this,e,t,i,!0)},o.prototype.removeListener=function(e,t,r,s){var n=i?i+e:e;if(!this._events[n])return this;if(!t)return a(this,n),this;var o=this._events[n];if(o.fn)o.fn!==t||s&&!o.once||r&&o.context!==r||a(this,n);else{for(var l=0,u=[],h=o.length;l<h;l++)(o[l].fn!==t||s&&!o[l].once||r&&o[l].context!==r)&&u.push(o[l]);u.length?this._events[n]=1===u.length?u[0]:u:a(this,n)}return this},o.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&a(this,t)):(this._events=new r,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=i,o.EventEmitter=o,e.exports=o},46220:function(e,t,i){e.exports=i(94776)},94776:function(e,t,i){var r=i(95428);t.operation=function(e){return new r(t.timeouts(e),{forever:e&&(e.forever||e.retries===1/0),unref:e&&e.unref,maxRetryTime:e&&e.maxRetryTime})},t.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1};for(var i in e)t[i]=e[i];if(t.minTimeout>t.maxTimeout)throw Error("minTimeout is greater than maxTimeout");for(var r=[],s=0;s<t.retries;s++)r.push(this.createTimeout(s,t));return e&&e.forever&&!r.length&&r.push(this.createTimeout(s,t)),r.sort(function(e,t){return e-t}),r},t.createTimeout=function(e,t){return Math.min(Math.round((t.randomize?Math.random()+1:1)*Math.max(t.minTimeout,1)*Math.pow(t.factor,e)),t.maxTimeout)},t.wrap=function(e,i,r){if(i instanceof Array&&(r=i,i=null),!r)for(var s in r=[],e)"function"==typeof e[s]&&r.push(s);for(var n=0;n<r.length;n++){var a=r[n],o=e[a];e[a]=(function(r){var s=t.operation(i),n=Array.prototype.slice.call(arguments,1),a=n.pop();n.push(function(e){s.retry(e)||(e&&(arguments[0]=s.mainError()),a.apply(this,arguments))}),s.attempt(function(){r.apply(e,n)})}).bind(e,o),e[a].options=i}}},95428:function(e){function t(e,t){"boolean"==typeof t&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}e.exports=t,t.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},t.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},t.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=new Date().getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var i=this._timeouts.shift();if(void 0===i){if(!this._cachedTimeouts)return!1;this._errors.splice(0,this._errors.length-1),i=this._cachedTimeouts.slice(-1)}var r=this;return this._timer=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},i),this._options.unref&&this._timer.unref(),!0},t.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var i=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){i._operationTimeoutCb()},i._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},t.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},t.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)},t.prototype.start=t.prototype.try,t.prototype.errors=function(){return this._errors},t.prototype.attempts=function(){return this._attempts},t.prototype.mainError=function(){if(0===this._errors.length)return null;for(var e={},t=null,i=0,r=0;r<this._errors.length;r++){var s=this._errors[r],n=s.message,a=(e[n]||0)+1;e[n]=a,a>=i&&(t=s,i=a)}return t}},95274:function(e,t,i){"use strict";var r=i(2265);r.useSyncExternalStore,r.useRef,r.useEffect,r.useMemo,r.useDebugValue},76548:function(e,t,i){"use strict";i(95274)},40548:function(e){"use strict";function t(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}t.prototype.match=function(e){var t,i,r=!0,s=this.parts,n=s.length;if("string"==typeof e||e instanceof String){if(this.hasWild||this.text==e){for(t=0,i=(e||"").split(this.separator);r&&t<n;t++)"*"!==s[t]&&(r=t<i.length&&s[t]===i[t]);r=r&&i}else r=!1}else if("function"==typeof e.splice)for(r=[],t=e.length;t--;)this.match(e[t])&&(r[r.length]=e[t]);else if("object"==typeof e)for(var a in r={},e)this.match(a)&&(r[a]=e[a]);return r},e.exports=function(e,i,r){var s=new t(e,r||/[\/\.]/);return void 0!==i?s.match(i):s}},46693:function(){},51832:function(){},36760:function(e,t){var i;!function(){"use strict";var r={}.hasOwnProperty;function s(){for(var e="",t=0;t<arguments.length;t++){var i=arguments[t];i&&(e=n(e,function(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return s.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var i in e)r.call(e,i)&&e[i]&&(t=n(t,i));return t}(i)))}return e}function n(e,t){return t?e?e+" "+t:e+t:e}e.exports?(s.default=s,e.exports=s):void 0!==(i=(function(){return s}).apply(t,[]))&&(e.exports=i)}()},2894:function(e,t,i){"use strict";i.d(t,{R:function(){return o},m:function(){return a}});var r=i(18238),s=i(7989),n=i(11255),a=class extends s.F{#e;#t;#i;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||o(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(t=>t!==e),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||("pending"===this.state.status?this.scheduleGc():this.#t.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#r({type:"continue"})};this.#i=(0,n.Mz)({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#r({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});let i="pending"===this.state.status,r=!this.#i.canStart();try{if(i)t();else{this.#r({type:"pending",variables:e,isPaused:r}),await this.#t.config.onMutate?.(e,this);let t=await this.options.onMutate?.(e);t!==this.state.context&&this.#r({type:"pending",context:t,variables:e,isPaused:r})}let s=await this.#i.start();return await this.#t.config.onSuccess?.(s,e,this.state.context,this),await this.options.onSuccess?.(s,e,this.state.context),await this.#t.config.onSettled?.(s,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(s,null,e,this.state.context),this.#r({type:"success",data:s}),s}catch(t){try{throw await this.#t.config.onError?.(t,e,this.state.context,this),await this.options.onError?.(t,e,this.state.context),await this.#t.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,t,e,this.state.context),t}finally{this.#r({type:"error",error:t})}}finally{this.#t.runNext(this)}}#r(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),r.Vr.batch(()=>{this.#e.forEach(t=>{t.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function o(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}},21770:function(e,t,i){"use strict";i.d(t,{D:function(){return h}});var r=i(2265),s=i(2894),n=i(18238),a=i(24112),o=i(45345),l=class extends a.l{#s;#n=void 0;#a;#o;constructor(e,t){super(),this.#s=e,this.setOptions(t),this.bindMethods(),this.#l()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#s.defaultMutationOptions(e),(0,o.VS)(this.options,t)||this.#s.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#a,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,o.Ym)(t.mutationKey)!==(0,o.Ym)(this.options.mutationKey)?this.reset():this.#a?.state.status==="pending"&&this.#a.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#a?.removeObserver(this)}onMutationUpdate(e){this.#l(),this.#u(e)}getCurrentResult(){return this.#n}reset(){this.#a?.removeObserver(this),this.#a=void 0,this.#l(),this.#u()}mutate(e,t){return this.#o=t,this.#a?.removeObserver(this),this.#a=this.#s.getMutationCache().build(this.#s,this.options),this.#a.addObserver(this),this.#a.execute(e)}#l(){let e=this.#a?.state??(0,s.R)();this.#n={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#u(e){n.Vr.batch(()=>{if(this.#o&&this.hasListeners()){let t=this.#n.variables,i=this.#n.context;e?.type==="success"?(this.#o.onSuccess?.(e.data,t,i),this.#o.onSettled?.(e.data,null,t,i)):e?.type==="error"&&(this.#o.onError?.(e.error,t,i),this.#o.onSettled?.(void 0,e.error,t,i))}this.listeners.forEach(e=>{e(this.#n)})})}},u=i(29827);function h(e,t){let i=(0,u.NL)(t),[s]=r.useState(()=>new l(i,e));r.useEffect(()=>{s.setOptions(e)},[s,e]);let a=r.useSyncExternalStore(r.useCallback(e=>s.subscribe(n.Vr.batchCalls(e)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),h=r.useCallback((e,t)=>{s.mutate(e,t).catch(o.ZT)},[s]);if(a.error&&(0,o.L3)(s.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:h,mutateAsync:a.mutate}}},1109:function(e,t,i){"use strict";function r(e,t){return Object.hasOwn(e,t)}i.d(t,{Z:function(){return q}});class s extends Error{isNetworkError;cause;constructor(e,t){super(e),this.cause=t?.cause,this.cause&&r(this.cause,"isNetworkError")?this.isNetworkError=this.cause.isNetworkError:this.isNetworkError=!1}}class n extends Error{cause;isNetworkError;request;constructor(e,t=null){super("This looks like a network error, the endpoint might be blocked by an internet provider or a firewall."),this.cause=e,this.isNetworkError=!0,this.request=t}}class a extends Error{name="UserFacingApiError"}var o=i(46220);let l=Object.prototype.toString,u=e=>"[object Error]"===l.call(e),h=new Set(["network error","Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Load failed","Network request failed","fetch failed","terminated"]);class p extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=Error(e),this.originalError.stack=this.stack),this.name="AbortError",this.message=e}}let d=(e,t,i)=>{let r=i.retries-(t-1);return e.attemptNumber=t,e.retriesLeft=r,e};async function c(e,t){return new Promise((i,r)=>{t={...t},t.onFailedAttempt??=()=>{},t.shouldRetry??=()=>!0,t.retries??=10;let s=o.operation(t),n=()=>{s.stop(),r(t.signal?.reason)};t.signal&&!t.signal.aborted&&t.signal.addEventListener("abort",n,{once:!0});let a=()=>{t.signal?.removeEventListener("abort",n),s.stop()};s.attempt(async n=>{try{let t=await e(n);a(),i(t)}catch(e){try{if(!(e instanceof Error))throw TypeError(`Non-error was thrown: "${e}". You should only throw errors.`);if(e instanceof p)throw e.originalError;if(e instanceof TypeError&&!(e&&u(e)&&"TypeError"===e.name&&"string"==typeof e.message&&("Load failed"===e.message?void 0===e.stack:h.has(e.message))))throw e;if(d(e,n,t),await t.shouldRetry(e)||(s.stop(),r(e)),await t.onFailedAttempt(e),!s.retry(e))throw s.mainError()}catch(e){d(e,n,t),a(),r(e)}}})})}class f extends Error{isAuthError;constructor(){super("Authorization required"),this.name="AuthError",this.isAuthError=!0}}class g extends Error{statusCode;constructor({statusCode:e,message:t}){super(t),this.name="HttpError",this.statusCode=e}}async function m(e){let t;if(401===e.status)throw new f;if(e.ok)return e.json();let i=`Failed request with status: ${e.status}. ${e.statusText}`;try{(t=await e.json()).message&&(i=`${i} message: ${t.message}`),t.requestId&&(i=`${i} request-Id: ${t.requestId}`)}catch(e){throw Error(i,{cause:e})}if(e.status>=400&&e.status<=499&&t.message)throw new a(t.message);throw new g({statusCode:e.status,message:i})}class y{static VERSION="4.5.1";#h;uppy;opts;constructor(e,t){this.uppy=e,this.opts=t,this.onReceiveResponse=this.onReceiveResponse.bind(this),this.#h=t.companionHeaders}setCompanionHeaders(e){this.#h=e}[Symbol.for("uppy test: getCompanionHeaders")](){return this.#h}get hostname(){let{companion:e}=this.uppy.getState(),t=this.opts.companionUrl;return(e?.[t]?e[t]:t).replace(/\/$/,"")}async headers(e=!1){return{...{Accept:"application/json",...e?void 0:{"Content-Type":"application/json"}},...this.#h}}onReceiveResponse(e){let{headers:t}=e,i=this.uppy.getState().companion||{},r=this.opts.companionUrl;t.has("i-am")&&t.get("i-am")!==i[r]&&this.uppy.setState({companion:{...i,[r]:t.get("i-am")}})}#p(e){return/^(https?:|)\/\//.test(e)?e:`${this.hostname}/${e}`}async request({path:e,method:t="GET",data:i,skipPostResponse:r,signal:a}){try{let s=await this.headers(!i),o=await function(...e){return fetch(...e).catch(e=>{if("AbortError"===e.name)throw e;throw new n(e)})}(this.#p(e),{method:t,signal:a,headers:s,credentials:this.opts.companionCookiesRule||"same-origin",body:i?JSON.stringify(i):null});return r||this.onReceiveResponse(o),await m(o)}catch(i){if(i.isAuthError||"UserFacingApiError"===i.name||"AbortError"===i.name)throw i;throw new s(`Could not ${t} ${this.#p(e)}`,{cause:i})}}async get(e,t){return this.request({...t,path:e})}async post(e,t,i){return this.request({...i,path:e,method:"POST",data:t})}async delete(e,t,i){return this.request({...i,path:e,method:"DELETE",data:t})}async uploadRemoteFile(e,t,i){try{let{signal:r,getQueue:s}=i||{};return await c(async()=>{let i=this.uppy.getFile(e.id)?.serverToken;if(null!=i)return this.uppy.log(`Connecting to exiting websocket ${i}`),this.#d({file:e,queue:s(),signal:r});let n=s().wrapPromiseFunction(async(...e)=>{try{return await this.#c(...e)}catch(t){if(t.isAuthError)throw new p(t);if(null==t.cause)throw t;let e=t.cause;if("HttpError"===e.name&&!([408,409,429,418,423].includes(e.statusCode)||e.statusCode>=500&&e.statusCode<=599&&![501,505].includes(e.statusCode)))throw new p(e);throw e}},{priority:-1}),a=await n({file:e,postBody:t,signal:r}).abortOn(r);if(this.uppy.getFile(e.id))return this.uppy.setFileState(e.id,{serverToken:a}),this.#d({file:this.uppy.getFile(e.id),queue:s(),signal:r})},{retries:10,signal:r,onFailedAttempt:e=>this.uppy.log(`Retrying upload due to: ${e.message}`,"warning")})}catch(t){if("AbortError"===t.name)return;throw this.uppy.emit("upload-error",e,t),t}}#c=async({file:e,postBody:t,signal:i})=>{if(e.remote?.url==null)throw Error("Cannot connect to an undefined URL");return(await this.post(e.remote.url,{...e.remote.body,...t},{signal:i})).token};async #d({file:e,queue:t,signal:i}){let r;let{capabilities:s}=this.uppy.getState();try{return await new Promise((n,a)=>{let o,l,u;let h=e.serverToken,p=function(e){let t=/^(?:https?:\/\/|\/\/)?(?:[^@\n]+@)?([^\n]+)/i.exec(e)?.[1],i=/^http:\/\//i.test(e)?"ws":"wss";return`${i}://${t}`}(e.remote.companionUrl),{isPaused:d}=e,f=(t,i)=>{if(null==o||o.readyState!==o.OPEN){this.uppy.log(`Cannot send "${t}" to socket ${e.id} because the socket state was ${String(o?.readyState)}`,"warning");return}o.send(JSON.stringify({action:t,payload:i??{}}))};function g(){s.resumableUploads&&(d?f("pause"):f("resume"))}let m=async()=>{l&&l.abort(),l=new AbortController;let i=t=>{this.uppy.setFileState(e.id,{serverToken:null}),l?.abort?.(),a(t)};function r(){clearTimeout(u),d||(u=setTimeout(()=>i(Error("Timeout waiting for message from Companion socket")),3e5))}try{await t.wrapPromiseFunction(async()=>{let t=async()=>new Promise((t,s)=>{o=new WebSocket(`${p}/api/${h}`),r(),o.addEventListener("close",()=>{o=void 0,s(Error("Socket closed unexpectedly"))}),o.addEventListener("error",e=>{this.uppy.log(`Companion socket error ${JSON.stringify(e)}, closing socket`,"warning"),o?.close()}),o.addEventListener("open",()=>{g()}),o.addEventListener("message",t=>{r();try{let{action:i,payload:r}=JSON.parse(t.data);switch(i){case"progress":!function(e,t,i){let{progress:r,bytesUploaded:s,bytesTotal:n}=t;r&&(e.uppy.log(`Upload progress: ${r}`),e.uppy.emit("upload-progress",i,{uploadStarted:i.progress.uploadStarted??0,bytesUploaded:s,bytesTotal:n}))}(this,r,this.uppy.getFile(e.id));break;case"success":{let t=r.response?.responseText;this.uppy.emit("upload-success",this.uppy.getFile(e.id),{uploadURL:r.url,status:r.response?.status??200,body:t?JSON.parse(t):void 0}),l?.abort?.(),n();break}case"error":{let{message:e}=r.error;throw Object.assign(Error(e),{cause:r.error})}default:this.uppy.log(`Companion socket unknown action ${i}`,"warning")}}catch(e){i(e)}});let a=()=>{this.uppy.log(`Closing socket ${e.id}`),clearTimeout(u),o&&o.close(),o=void 0};l.signal.addEventListener("abort",()=>{a()})});await c(t,{retries:10,signal:l.signal,onFailedAttempt:()=>{l.signal.aborted||this.uppy.log(`Retrying websocket ${e.id}`)}})})().abortOn(l.signal)}catch(e){if(l.signal.aborted)return;i(e)}},y=e=>{s.resumableUploads&&(d=e,o&&g())},v=t=>{s.individualCancellation&&t.id===e.id&&(f("cancel"),l?.abort?.(),this.uppy.log(`upload ${e.id} was removed`),n())},b=()=>{f("cancel"),l?.abort?.(),this.uppy.log(`upload ${e.id} was canceled`),n()},w=(t,i)=>{t?.id===e.id&&y(i)},_=()=>y(!0),S=()=>y(!1);this.uppy.on("file-removed",v),this.uppy.on("cancel-all",b),this.uppy.on("upload-pause",w),this.uppy.on("pause-all",_),this.uppy.on("resume-all",S),r=()=>{this.uppy.off("file-removed",v),this.uppy.off("cancel-all",b),this.uppy.off("upload-pause",w),this.uppy.off("pause-all",_),this.uppy.off("resume-all",S)},i.addEventListener("abort",()=>{l?.abort()}),m()})}finally{r?.()}}}var v=i(48629);class b{#f;#g=[];constructor(e){this.#f=e}on(e,t){return this.#g.push([e,t]),this.#f.on(e,t)}remove(){for(let[e,t]of this.#g.splice(0))this.#f.off(e,t)}onFilePause(e,t){this.on("upload-pause",(i,r)=>{e===i?.id&&t(r)})}onFileRemove(e,t){this.on("file-removed",i=>{e===i.id&&t(i.id)})}onPause(e,t){this.on("upload-pause",(i,r)=>{e===i?.id&&t(r)})}onRetry(e,t){this.on("upload-retry",i=>{e===i?.id&&t()})}onRetryAll(e,t){this.on("retry-all",()=>{this.#f.getFile(e)&&t()})}onPauseAll(e,t){this.on("pause-all",()=>{this.#f.getFile(e)&&t()})}onCancelAll(e,t){this.on("cancel-all",(...i)=>{this.#f.getFile(e)&&t(...i)})}onResumeAll(e,t){this.on("resume-all",()=>{this.#f.getFile(e)&&t()})}}let{AbortController:w}=globalThis,{AbortSignal:_}=globalThis,S=(e="Aborted",t)=>{let i=new DOMException(e,"AbortError");return null!=t&&r(t,"cause")&&Object.defineProperty(i,"cause",{__proto__:null,configurable:!0,writable:!0,value:t.cause}),i};function C(e,t){return!0===e?Object.keys(t):Array.isArray(e)?e:[]}function P(e){if(null!=e){let t=()=>this.abort(e.reason);e.addEventListener("abort",t,{once:!0});let i=()=>{e.removeEventListener("abort",t)};this.then?.(i,i)}return this}class F{#m=0;#y=[];#v=!1;#b;#w=1;#_;#S;limit;constructor(e){"number"!=typeof e||0===e?this.limit=1/0:this.limit=e}#C(e){let t;this.#m+=1;let i=!1;try{t=e()}catch(e){throw this.#m-=1,e}return{abort:e=>{i||(i=!0,this.#m-=1,t?.(e),this.#P())},done:()=>{i||(i=!0,this.#m-=1,this.#P())}}}#P(){queueMicrotask(()=>this.#F())}#F(){if(this.#v||this.#m>=this.limit||0===this.#y.length)return;let e=this.#y.shift();if(null==e)throw Error("Invariant violation: next is null");let t=this.#C(e.fn);e.abort=t.abort,e.done=t.done}#k(e,t){let i={fn:e,priority:t?.priority||0,abort:()=>{this.#T(i)},done:()=>{throw Error("Cannot mark a queued request as done: this indicates a bug")}},r=this.#y.findIndex(e=>i.priority>e.priority);return -1===r?this.#y.push(i):this.#y.splice(r,0,i),i}#T(e){let t=this.#y.indexOf(e);-1!==t&&this.#y.splice(t,1)}run(e,t){return!this.#v&&this.#m<this.limit?this.#C(e):this.#k(e,t)}wrapSyncFunction(e,t){return(...i)=>{let r=this.run(()=>(e(...i),queueMicrotask(()=>r.done()),()=>{}),t);return{abortOn:P,abort(){r.abort()}}}}wrapPromiseFunction(e,t){return(...i)=>{let r;let s=new Promise((s,n)=>{r=this.run(()=>{let t,a;try{a=Promise.resolve(e(...i))}catch(e){a=Promise.reject(e)}return a.then(e=>{t?n(t):(r.done(),s(e))},e=>{t?n(t):(r.done(),n(e))}),e=>{t=Error("Cancelled",{cause:e})}},t)});return s.abort=e=>{r.abort(e)},s.abortOn=P,s}}resume(){this.#v=!1,clearTimeout(this.#b);for(let e=0;e<this.limit;e++)this.#P()}#E=()=>this.resume();pause(e=null){this.#v=!0,clearTimeout(this.#b),null!=e&&(this.#b=setTimeout(this.#E,e))}rateLimit(e){clearTimeout(this.#S),this.pause(e),this.limit>1&&Number.isFinite(this.limit)&&(this.#_=this.limit-1,this.limit=this.#w,this.#S=setTimeout(this.#A,e))}#A=()=>{if(this.#v){this.#S=setTimeout(this.#A,0);return}this.#w=this.limit,this.limit=Math.ceil((this.#_+this.#w)/2);for(let e=this.#w;e<=this.limit;e++)this.#P();this.#_-this.#w>3?this.#S=setTimeout(this.#A,2e3):this.#w=Math.floor(this.#w/2)};get isPaused(){return this.#v}}Symbol("__queue");let k=new TextEncoder,T={name:"HMAC",hash:"SHA-256"};async function E(e){let{subtle:t}=globalThis.crypto;return t.digest(T.hash,k.encode(e))}async function A(e){let{subtle:t}=globalThis.crypto;return t.importKey("raw","string"==typeof e?k.encode(e):e,T,!1,["sign"])}function x(e){let t=new Uint8Array(e),i="";for(let e=0;e<t.length;e++)i+=t[e].toString(16).padStart(2,"0");return i}async function I(e,t){let{subtle:i}=globalThis.crypto;return i.sign(T,await A(e),k.encode(t))}async function U({accountKey:e,accountSecret:t,sessionToken:i,bucketName:r,Key:s,Region:n,expires:a,uploadId:o,partNumber:l}){let u=`s3.${n}.amazonaws.com`,h=`/${r}/${encodeURI(s).replace(/[;?:@&=+$,#!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}`,p="UNSIGNED-PAYLOAD",d=new Date().toISOString().replace(/[-:]|\.\d+/g,""),c=d.slice(0,8),f=`${c}/${n}/s3/aws4_request`,g=new URL(`https://${u}${h}`);g.searchParams.set("X-Amz-Algorithm","AWS4-HMAC-SHA256"),g.searchParams.set("X-Amz-Content-Sha256",p),g.searchParams.set("X-Amz-Credential",`${e}/${f}`),g.searchParams.set("X-Amz-Date",d),g.searchParams.set("X-Amz-Expires",a),g.searchParams.set("X-Amz-Security-Token",i),g.searchParams.set("X-Amz-SignedHeaders","host"),l&&g.searchParams.set("partNumber",l),o&&g.searchParams.set("uploadId",o),g.searchParams.set("x-id",l&&o?"UploadPart":"PutObject");let m=function({method:e="PUT",CanonicalUri:t="/",CanonicalQueryString:i="",SignedHeaders:r,HashedPayload:s}){let n=Object.keys(r).map(e=>e.toLowerCase()).sort();return[e,t,i,...n.map(e=>`${e}:${r[e]}`),"",n.join(";"),s].join("\n")}({CanonicalUri:h,CanonicalQueryString:g.search.slice(1),SignedHeaders:{host:u},HashedPayload:p}),y=["AWS4-HMAC-SHA256",d,f,x(await E(m))].join("\n"),v=await I(`AWS4${t}`,c),b=await I(v,n),w=await I(b,"s3"),_=await I(w,"aws4_request"),S=x(await I(_,y));return g.searchParams.set("X-Amz-Signature",S),g}let O={getChunkSize:e=>Math.ceil(e.size/1e4),onProgress(){},onPartComplete(){},onSuccess(){},onError(e){throw e}},D=Symbol("pausing upload, not an actual error");class R{options;#x=new w;#I=[];#U=[];#O;#D;#R=!1;#N;#M;#B;#L;#z=e=>e?.cause===D?null:this.#N(e);#$=1e4;#q=5242880;constructor(e,t){this.options={...O,...t},this.options.getChunkSize??=O.getChunkSize,this.#O=e,this.#D=t.file,this.#M=this.options.onSuccess,this.#N=this.options.onError,this.#B=this.options.shouldUseMultipart,this.#L=t.uploadId&&t.key,this.#H()}#H(){let e=this.#O.size,t="function"==typeof this.#B?this.#B(this.#D):!!this.#B;if(t&&e>this.#q){let i=Math.max(this.options.getChunkSize(this.#O),this.#q),r=Math.floor(e/i);r>this.#$&&(r=this.#$,i=e/this.#$),this.#I=Array(r);for(let r=0,s=0;r<e;r+=i,s++){let n=Math.min(e,r+i),a=()=>{let e=r;return this.#O.slice(e,n)};if(this.#I[s]={getData:a,onProgress:this.#j(s),onComplete:this.#V(s),shouldUseMultipart:t},this.#L){let t=r+i>e?e-r:i;this.#I[s].setAsUploaded=()=>{this.#I[s]=null,this.#U[s].uploaded=t}}}}else this.#I=[{getData:()=>this.#O,onProgress:this.#j(0),onComplete:this.#V(0),shouldUseMultipart:t}];this.#U=this.#I.map(()=>({uploaded:0}))}#W(){this.options.companionComm.uploadFile(this.#D,this.#I,this.#x.signal).then(this.#M,this.#z),this.#R=!0}#G(){this.options.companionComm.resumeUploadFile(this.#D,this.#I,this.#x.signal).then(this.#M,this.#z)}#j=e=>t=>{if(!t.lengthComputable)return;this.#U[e].uploaded=function(e){if("string"==typeof e)return parseInt(e,10);if("number"==typeof e)return e;throw TypeError("Expected a number")}(t.loaded);let i=this.#U.reduce((e,t)=>e+t.uploaded,0);this.options.onProgress(i,this.#O.size)};#V=e=>t=>{this.#I[e]=null,this.#U[e].etag=t,this.#U[e].done=!0,this.options.onPartComplete({PartNumber:e+1,ETag:t})};#K(){this.#x.abort(),this.options.companionComm.abortFileUpload(this.#D).catch(e=>this.options.log(e))}start(){this.#R?(this.#x.signal.aborted||this.#x.abort(D),this.#x=new w,this.#G()):this.#L?(this.options.companionComm.restoreUploadFile(this.#D,{uploadId:this.options.uploadId,key:this.options.key}),this.#G()):this.#W()}pause(){this.#x.abort(D),this.#x=new w}abort(e){e?.really?this.#K():this.pause()}[Symbol.for("uppy test: getChunkState")](){return this.#U}}function N(e){if(e?.aborted)throw S("The operation was aborted",{cause:e.reason})}class M{#X;#Z=new WeakMap;#Y;#Q;#J;#ee;#et;#ei;#er;#es;#en;#ea;#eo;constructor(e,t,i,r){this.#ei=e,this.#en=i,this.#eo=r,this.setOptions(t)}setOptions(e){let t=this.#ei;"abortMultipartUpload"in e&&(this.#X=t.wrapPromiseFunction(e.abortMultipartUpload,{priority:1})),"createMultipartUpload"in e&&(this.#Y=t.wrapPromiseFunction(e.createMultipartUpload,{priority:-1})),"signPart"in e&&(this.#Q=t.wrapPromiseFunction(e.signPart)),"listParts"in e&&(this.#ee=t.wrapPromiseFunction(e.listParts)),"completeMultipartUpload"in e&&(this.#es=t.wrapPromiseFunction(e.completeMultipartUpload,{priority:1})),"retryDelays"in e&&(this.#er=e.retryDelays??[]),"uploadPartBytes"in e&&(this.#ea=t.wrapPromiseFunction(e.uploadPartBytes,{priority:1/0})),"getUploadParameters"in e&&(this.#J=t.wrapPromiseFunction(e.getUploadParameters))}async #el(e,t){let i=this.#ei,r=e?.source?.status;if(null==r)return!1;if(403===r&&"Request has expired"===e.message){if(!i.isPaused){if(1===i.limit||null==this.#et){let e=t.next();if(null==e||e.done)return!1;this.#et=e.value}i.rateLimit(0),await new Promise(e=>setTimeout(e,this.#et))}}else if(429===r){if(!i.isPaused){let e=t.next();if(null==e||e.done)return!1;i.rateLimit(e.value)}}else if(r>400&&r<500&&409!==r)return!1;else if("undefined"!=typeof navigator&&!1===navigator.onLine)i.isPaused||(i.pause(),window.addEventListener("online",()=>{i.resume()},{once:!0}));else{let e=t.next();if(null==e||e.done)return!1;await new Promise(t=>setTimeout(t,e.value))}return!0}async getUploadId(e,t){let i;for(;null!=(i=this.#Z.get(e.data));)try{return await i}catch{}let r=this.#Y(this.#eo(e),t),s=()=>{r.abort(t.reason),this.#Z.delete(e.data)};return t.addEventListener("abort",s,{once:!0}),this.#Z.set(e.data,r),r.then(async i=>{t.removeEventListener("abort",s),this.#en(e,i),this.#Z.set(e.data,i)},()=>{t.removeEventListener("abort",s),this.#Z.delete(e.data)}),r}async abortFileUpload(e){let t;let i=this.#Z.get(e.data);if(null!=i){this.#Z.delete(e.data),this.#en(e,Object.create(null));try{t=await i}catch{return}await this.#X(this.#eo(e),t)}}async #eu(e,t,i){let r;let{method:s="POST",url:n,fields:a,headers:o}=await this.#J(this.#eo(e),{signal:i}).abortOn(i),l=t.getData();if("POST"===s.toUpperCase()){let e=new FormData;Object.entries(a).forEach(([t,i])=>e.set(t,i)),e.set("file",l),r=e}else r=l;let{onProgress:u,onComplete:h}=t,p=await this.#ea({signature:{url:n,headers:o,method:s},body:r,size:l.size,onProgress:u,onComplete:h,signal:i}).abortOn(i),d=a?.key;return this.#en(e,{key:d}),{...p,location:p.location??function(e){let t=new URL(e);return t.search="",t.hash="",t.href}(n),bucket:a?.bucket,key:d}}async uploadFile(e,t,i){if(N(i),1===t.length&&!t[0].shouldUseMultipart)return this.#eu(e,t[0],i);let{uploadId:r,key:s}=await this.getUploadId(e,i);N(i);try{let n=await Promise.all(t.map((t,r)=>this.uploadChunk(e,r+1,t,i)));return N(i),await this.#es(this.#eo(e),{key:s,uploadId:r,parts:n,signal:i},i).abortOn(i)}catch(t){throw t?.cause!==D&&t?.name!=="AbortError"&&this.abortFileUpload(e),t}}restoreUploadFile(e,t){this.#Z.set(e.data,t)}async resumeUploadFile(e,t,i){if(N(i),1===t.length&&null!=t[0]&&!t[0].shouldUseMultipart)return this.#eu(e,t[0],i);let{uploadId:r,key:s}=await this.getUploadId(e,i);N(i);let n=await this.#ee(this.#eo(e),{uploadId:r,key:s,signal:i},i).abortOn(i);N(i);let a=await Promise.all(t.map((t,r)=>{let s=r+1,a=n.find(({PartNumber:e})=>e===s);return null==a?this.uploadChunk(e,s,t,i):(t?.setAsUploaded?.(),{PartNumber:s,ETag:a.ETag})}));return N(i),this.#es(this.#eo(e),{key:s,uploadId:r,parts:a,signal:i},i).abortOn(i)}async uploadChunk(e,t,i,r){N(r);let{uploadId:s,key:n}=await this.getUploadId(e,r),a=this.#er.values(),o=this.#er.values(),l=()=>{let e=a.next();return null==e||e.done?null:e.value};for(;;){let a;N(r);let u=i.getData(),{onProgress:h,onComplete:p}=i;try{a=await this.#Q(this.#eo(e),{uploadId:s,key:n,partNumber:t,body:u,signal:r}).abortOn(r)}catch(t){let e=l();if(null==e||r.aborted)throw t;await new Promise(t=>setTimeout(t,e));continue}N(r);try{return{PartNumber:t,...await this.#ea({signature:a,body:u,size:u.size,onProgress:h,onComplete:p,signal:r}).abortOn(r)}}catch(e){if(!await this.#el(e,o))throw e}}}}function B(e){if(e?.error){let t=Error(e.message);throw Object.assign(t,e.error),t}return e}function L(e){let t=e.Expiration;if(t){let e=Math.floor((new Date(t)-Date.now())/1e3);if(e>9)return e}}function z({meta:e,allowedMetaFields:t,querify:i=!1}){let r=t??Object.keys(e);return e?Object.fromEntries(r.filter(t=>null!=e[t]).map(t=>[i?`metadata[${t}]`:t,String(e[t])])):{}}let $={allowedMetaFields:!0,limit:6,getTemporarySecurityCredentials:!1,shouldUseMultipart:e=>(e.size||0)>104857600,retryDelays:[0,1e3,3e3,5e3]};class q extends v.Z{static VERSION="4.3.1";#eh;#s;requests;uploaderEvents;uploaders;constructor(e,t){super(e,{...$,uploadPartBytes:q.uploadPartBytes,createMultipartUpload:null,listParts:null,abortMultipartUpload:null,completeMultipartUpload:null,signPart:null,getUploadParameters:null,...t}),this.type="uploader",this.id=this.opts.id||"AwsS3Multipart",this.#ep(t);let i={createMultipartUpload:this.createMultipartUpload,listParts:this.listParts,abortMultipartUpload:this.abortMultipartUpload,completeMultipartUpload:this.completeMultipartUpload,signPart:t?.getTemporarySecurityCredentials?this.createSignedURL:this.signPart,getUploadParameters:t?.getTemporarySecurityCredentials?this.createSignedURL:this.getUploadParameters};for(let e of Object.keys(i))null==this.opts[e]&&(this.opts[e]=i[e].bind(this));this.requests=this.opts.rateLimitedQueue??new F(this.opts.limit),this.#eh=new M(this.requests,this.opts,this.#en,this.#eo),this.uploaders=Object.create(null),this.uploaderEvents=Object.create(null)}[Symbol.for("uppy test: getClient")](){return this.#s}#ep(e){null!=e&&("endpoint"in e||"companionUrl"in e||"headers"in e||"companionHeaders"in e||"cookiesRule"in e||"companionCookiesRule"in e)&&("companionUrl"in e&&!("endpoint"in e)&&this.uppy.log("`companionUrl` option has been removed in @uppy/aws-s3, use `endpoint` instead.","warning"),"companionHeaders"in e&&!("headers"in e)&&this.uppy.log("`companionHeaders` option has been removed in @uppy/aws-s3, use `headers` instead.","warning"),"companionCookiesRule"in e&&!("cookiesRule"in e)&&this.uppy.log("`companionCookiesRule` option has been removed in @uppy/aws-s3, use `cookiesRule` instead.","warning"),"endpoint"in e?this.#s=new y(this.uppy,{pluginId:this.id,provider:"AWS",companionUrl:this.opts.endpoint,companionHeaders:this.opts.headers,companionCookiesRule:this.opts.cookiesRule}):("headers"in e&&this.#ed(),"cookiesRule"in e&&(this.#s.opts.companionCookiesRule=e.cookiesRule)))}setOptions(e){this.#eh.setOptions(e),super.setOptions(e),this.#ep(e)}resetUploaderReferences(e,t){this.uploaders[e]&&(this.uploaders[e].abort({really:t?.abort||!1}),this.uploaders[e]=null),this.uploaderEvents[e]&&(this.uploaderEvents[e].remove(),this.uploaderEvents[e]=null)}#ec(e){if(!this.#s)throw Error(`Expected a \`endpoint\` option containing a URL, or if you are not using Companion, a custom \`${e}\` implementation.`)}createMultipartUpload(e,t){this.#ec("createMultipartUpload"),N(t);let i=C(this.opts.allowedMetaFields,e.meta),r=z({meta:e.meta,allowedMetaFields:i});return this.#s.post("s3/multipart",{filename:e.name,type:e.type,metadata:r},{signal:t}).then(B)}listParts(e,{key:t,uploadId:i,signal:r},s){r??=s,this.#ec("listParts"),N(r);let n=encodeURIComponent(t);return this.#s.get(`s3/multipart/${encodeURIComponent(i)}?key=${n}`,{signal:r}).then(B)}completeMultipartUpload(e,{key:t,uploadId:i,parts:r,signal:s},n){s??=n,this.#ec("completeMultipartUpload"),N(s);let a=encodeURIComponent(t),o=encodeURIComponent(i);return this.#s.post(`s3/multipart/${o}/complete?key=${a}`,{parts:r.map(({ETag:e,PartNumber:t})=>({ETag:e,PartNumber:t}))},{signal:s}).then(B)}#ef;async #eg(e){if(N(e?.signal),null==this.#ef){let{getTemporarySecurityCredentials:t}=this.opts;!0===t?(this.#ec("getTemporarySecurityCredentials"),this.#ef=this.#s.get("s3/sts",e).then(B)):this.#ef=t(e),this.#ef=await this.#ef,setTimeout(()=>{this.#ef=null},500*(L(this.#ef.credentials)||0))}return this.#ef}async createSignedURL(e,t){let i=await this.#eg(t),r=L(i.credentials)||604800,{uploadId:s,key:n,partNumber:a}=t;return{method:"PUT",expires:r,fields:{},url:`${await U({accountKey:i.credentials.AccessKeyId,accountSecret:i.credentials.SecretAccessKey,sessionToken:i.credentials.SessionToken,expires:r,bucketName:i.bucket,Region:i.region,Key:n??`${crypto.randomUUID()}-${e.name}`,uploadId:s,partNumber:a})}`,headers:{"Content-Type":e.type}}}signPart(e,{uploadId:t,key:i,partNumber:r,signal:s}){if(this.#ec("signPart"),N(s),null==t||null==i||null==r)throw Error("Cannot sign without a key, an uploadId, and a partNumber");let n=encodeURIComponent(i);return this.#s.get(`s3/multipart/${encodeURIComponent(t)}/${r}?key=${n}`,{signal:s}).then(B)}abortMultipartUpload(e,{key:t,uploadId:i,signal:r}){this.#ec("abortMultipartUpload");let s=encodeURIComponent(t),n=encodeURIComponent(i);return this.#s.delete(`s3/multipart/${n}?key=${s}`,void 0,{signal:r}).then(B)}getUploadParameters(e,t){this.#ec("getUploadParameters");let{meta:i}=e,{type:r,name:s}=i,n=new URLSearchParams({filename:s,type:r,...z({meta:i,allowedMetaFields:C(this.opts.allowedMetaFields,e.meta),querify:!0})});return this.#s.get(`s3/params?${n}`,t)}static async uploadPartBytes({signature:{url:e,expires:t,headers:i,method:r="PUT"},body:s,size:n=s.size,onProgress:a,onComplete:o,signal:l}){if(N(l),null==e)throw Error("Cannot upload to an undefined URL");return new Promise((u,h)=>{let p=new XMLHttpRequest;function d(){p.abort()}function c(){l?.removeEventListener("abort",d)}p.open(r,e,!0),i&&Object.keys(i).forEach(e=>{p.setRequestHeader(e,i[e])}),p.responseType="text","number"==typeof t&&(p.timeout=1e3*t),l?.addEventListener("abort",d),p.upload.addEventListener("progress",e=>{a(e)}),p.addEventListener("abort",()=>{c(),h(S())}),p.addEventListener("timeout",()=>{c();let e=Error("Request has expired");e.source={status:403},h(e)}),p.addEventListener("load",()=>{if(c(),403===p.status&&p.responseText.includes("<Message>Request has expired</Message>")){let e=Error("Request has expired");e.source=p,h(e);return}if(p.status<200||p.status>=300){let e=Error("Non 2xx");e.source=p,h(e);return}a?.({loaded:n,lengthComputable:!0});let e=p.getAllResponseHeaders().trim().split(/[\r\n]+/),t={__proto__:null};for(let i of e){let e=i.split(": "),r=e.shift(),s=e.join(": ");t[r]=s}let{etag:i,location:s}=t;if("POST"===r.toUpperCase()&&null==s&&console.error("@uppy/aws-s3: Could not read the Location header. This likely means CORS is not configured correctly on the S3 Bucket. See https://uppy.io/docs/aws-s3/#setting-up-your-s3-bucket"),null==i){console.error("@uppy/aws-s3: Could not read the ETag header. This likely means CORS is not configured correctly on the S3 Bucket. See https://uppy.io/docs/aws-s3/#setting-up-your-s3-bucket");return}o?.(i),u({...t,ETag:i})}),p.addEventListener("error",e=>{c();let t=Error("Unknown error");t.source=e.target,h(t)}),p.send(s)})}#en=(e,{key:t,uploadId:i})=>{let r=this.uppy.getFile(e.id);null!=r&&this.uppy.setFileState(e.id,{s3Multipart:{...r.s3Multipart,key:t,uploadId:i}})};#eo=e=>this.uppy.getFile(e.id)||e;#em(e){return new Promise((t,i)=>{let r=new R(e.data,{companionComm:this.#eh,log:(...e)=>this.uppy.log(...e),getChunkSize:this.opts.getChunkSize?this.opts.getChunkSize.bind(this):void 0,onProgress:(t,i)=>{let r=this.uppy.getFile(e.id);this.uppy.emit("upload-progress",r,{uploadStarted:r.progress.uploadStarted??0,bytesUploaded:t,bytesTotal:i})},onError:t=>{this.uppy.log(t),this.uppy.emit("upload-error",e,t),this.resetUploaderReferences(e.id),i(t)},onSuccess:i=>{let r={body:{...i},status:200,uploadURL:i.location};this.resetUploaderReferences(e.id),this.uppy.emit("upload-success",this.#eo(e),r),i.location&&this.uppy.log(`Download ${e.name} from ${i.location}`),t(void 0)},onPartComplete:t=>{this.uppy.emit("s3-multipart:part-uploaded",this.#eo(e),t)},file:e,shouldUseMultipart:this.opts.shouldUseMultipart,...e.s3Multipart});this.uploaders[e.id]=r;let s=new b(this.uppy);this.uploaderEvents[e.id]=s,s.onFileRemove(e.id,i=>{r.abort(),this.resetUploaderReferences(e.id,{abort:!0}),t(`upload ${i} was removed`)}),s.onCancelAll(e.id,()=>{r.abort(),this.resetUploaderReferences(e.id,{abort:!0}),t(`upload ${e.id} was canceled`)}),s.onFilePause(e.id,e=>{e?r.pause():r.start()}),s.onPauseAll(e.id,()=>{r.pause()}),s.onResumeAll(e.id,()=>{r.start()}),r.start()})}#ey(e){return{...e.remote?.body,protocol:"s3-multipart",size:e.data.size,metadata:e.meta}}#ev=async e=>{if(0===e.length)return;let t=function(e){let t=e=>"error"in e&&!!e.error;return e.filter(e=>!t(e))}(this.uppy.getFilesByIds(e)),i=t.filter(e=>!e.progress?.uploadStarted||!e.isRestored);this.uppy.emit("upload-start",i);let r=t.map(e=>{if(e.isRemote){this.#eb(!1);let t=new AbortController,i=i=>{i.id===e.id&&t.abort()};this.uppy.on("file-removed",i);let r=this.uppy.getRequestClientForFile(e).uploadRemoteFile(e,this.#ey(e),{signal:t.signal,getQueue:()=>this.requests});return this.requests.wrapSyncFunction(()=>{this.uppy.off("file-removed",i)},{priority:-1})(),r}return this.#em(e)}),s=await Promise.allSettled(r);return this.#eb(!0),s};#ed=()=>{this.#s?.setCompanionHeaders(this.opts.headers)};#eb=e=>{let{capabilities:t}=this.uppy.getState();this.uppy.setState({capabilities:{...t,resumableUploads:e}})};#ew=()=>{this.#eb(!0)};install(){this.#eb(!0),this.uppy.addPreProcessor(this.#ed),this.uppy.addUploader(this.#ev),this.uppy.on("cancel-all",this.#ew)}uninstall(){this.uppy.removePreProcessor(this.#ed),this.uppy.removeUploader(this.#ev),this.uppy.off("cancel-all",this.#ew)}}},48629:function(e,t,i){"use strict";i.d(t,{Z:function(){return s}});var r=i(52304);class s{uppy;opts;id;defaultLocale;i18n;i18nArray;type;VERSION;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:{...t,[this.id]:{...t[this.id],...e}}})}setOptions(e){this.opts={...this.opts,...e},this.setPluginState(void 0),this.i18nInit()}i18nInit(){let e=new r.Z([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 Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}update(e){}afterUpdate(){}}},47632:function(e,t,i){"use strict";i.d(t,{Z:function(){return C}});class r{static VERSION="4.3.1";state={};#e_=new Set;getState(){return this.state}setState(e){let t={...this.state},i={...this.state,...e};this.state=i,this.#eS(t,i,e)}subscribe(e){return this.#e_.add(e),()=>{this.#e_.delete(e)}}#eS(...e){this.#e_.forEach(t=>{t(...e)})}}var s=i(72658),n=i(66547),a=i(2925),o=i(52304),l=i(37065),u=i(71157);let h=(e=21)=>{let t="",i=0|e;for(;i--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t};var p={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 d(e){return e<10?`0${e}`:e.toString()}function c(){let e=new Date,t=d(e.getHours()),i=d(e.getMinutes()),r=d(e.getSeconds());return`${t}:${i}:${r}`}let f={debug:()=>{},warn:()=>{},error:(...e)=>console.error(`[Uppy] [${c()}]`,...e)},g={debug:(...e)=>console.debug(`[Uppy] [${c()}]`,...e),warn:(...e)=>console.warn(`[Uppy] [${c()}]`,...e),error:(...e)=>console.error(`[Uppy] [${c()}]`,...e)};var m=i(85110),y=i(67385);let v={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]};class b extends Error{isUserFacing;file;constructor(e,t){super(e),this.isUserFacing=t?.isUserFacing??!0,t?.file&&(this.file=t.file)}isRestriction=!0}class w{getI18n;getOpts;constructor(e,t){this.getI18n=t,this.getOpts=()=>{let t=e();if(t.restrictions?.allowedFileTypes!=null&&!Array.isArray(t.restrictions.allowedFileTypes))throw TypeError("`restrictions.allowedFileTypes` must be an array");return t}}validateAggregateRestrictions(e,t){let{maxTotalFileSize:i,maxNumberOfFiles:r}=this.getOpts().restrictions;if(r&&e.filter(e=>!e.isGhost).length+t.length>r)throw new b(`${this.getI18n()("youCanOnlyUploadX",{smart_count:r})}`);if(i){let r=[...e,...t].reduce((e,t)=>e+(t.size??0),0);if(r>i)throw new b(this.getI18n()("aggregateExceedsSize",{sizeAllowed:m(i),size:m(r)}))}}validateSingleFile(e){let{maxFileSize:t,minFileSize:i,allowedFileTypes:r}=this.getOpts().restrictions;if(r&&!r.some(t=>t.includes("/")?!!e.type&&y(e.type.replace(/;.*?$/,""),t):"."===t[0]&&!!e.extension&&e.extension.toLowerCase()===t.slice(1).toLowerCase())){let t=r.join(", ");throw new b(this.getI18n()("youCanOnlyUploadFileTypes",{types:t}),{file:e})}if(t&&null!=e.size&&e.size>t)throw new b(this.getI18n()("exceedsSize",{size:m(t),file:e.name??this.getI18n()("unnamed")}),{file:e});if(i&&null!=e.size&&e.size<i)throw new b(this.getI18n()("inferiorSize",{size:m(i)}),{file:e})}validate(e,t){t.forEach(e=>{this.validateSingleFile(e)}),this.validateAggregateRestrictions(e,t)}validateMinNumberOfFiles(e){let{minNumberOfFiles:t}=this.getOpts().restrictions;if(t&&Object.keys(e).length<t)throw new b(this.getI18n()("youHaveToAtLeastSelectX",{smart_count:t}))}getMissingRequiredMetaFields(e){let t=new b(this.getI18n()("missingRequiredMetaFieldOnFile",{fileName:e.name??this.getI18n()("unnamed")})),{requiredMetaFields:i}=this.getOpts().restrictions,r=[];for(let t of i)Object.hasOwn(e.meta,t)&&""!==e.meta[t]||r.push(t);return{missingFields:r,error:t}}}let _={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null};class S{static VERSION="4.5.1";#eC=Object.create(null);#eP;#eF;#ek=u();#eT=new Set;#eE=new Set;#eA=new Set;defaultLocale;locale;opts;store;i18n;i18nArray;scheduledAutoProceed=null;wasOffline=!1;constructor(e){this.defaultLocale=p;let t={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:v,meta:{},onBeforeFileAdded:(e,t)=>!Object.hasOwn(t,e.id),onBeforeUpload:e=>e,store:new r,logger:f,infoTimeout:5e3},i={...t,...e};this.opts={...i,restrictions:{...t.restrictions,...e?.restrictions}},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?.debug&&(this.opts.logger=g),this.log(`Using Core v${S.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState({..._,plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:function(e){if(null==e&&"undefined"!=typeof navigator&&(e=navigator.userAgent),!e)return!0;let t=/Edge\/(\d+\.\d+)/.exec(e);if(!t)return!0;let i=t[1].split(".",2),r=parseInt(i[0],10),s=parseInt(i[1],10);return r<15||15===r&&s<15063||r>18||18===r&&s>=18218}(),individualCancellation:!0,resumableUploads:!1},meta:{...this.opts.meta},info:[]}),this.#eP=new w(()=>this.opts,()=>this.i18n),this.#eF=this.store.subscribe((e,t,i)=>{this.emit("state-update",e,t,i),this.updateAll(t)}),this.opts.debug&&"undefined"!=typeof window&&(window[this.opts.id]=this),this.#ex()}emit(e,...t){this.#ek.emit(e,...t)}on(e,t){return this.#ek.on(e,t),this}once(e,t){return this.#ek.once(e,t),this}off(e,t){return this.#ek.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:{...t,...Object.fromEntries(Object.entries(e).map(([e,i])=>[e,{...t[e],...i}]))}})}setFileState(e,t){if(!this.getState().files[e])throw Error(`Can’t set state for ${e} (the file could have been removed)`);this.patchFilesState({[e]:t})}i18nInit(){let e=new o.Z([this.defaultLocale,this.opts.locale],{onMissingKey:e=>this.log(`Missing i18n string: ${e}`,"error")});this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.locale=e.locale}setOptions(e){this.opts={...this.opts,...e,restrictions:{...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={...this.getState().files},i=Object.create(null);Object.keys(t).forEach(r=>{i[r]={...t[r],progress:{...t[r].progress,...e},tus:void 0,transloadit:void 0}}),this.setState({files:i,..._})}clear(){let{capabilities:e,currentUploads:t}=this.getState();if(Object.keys(t).length>0&&!e.individualCancellation)throw Error("The installed uploader plugin does not allow removing files during an upload.");this.setState({..._,files:{}})}addPreProcessor(e){this.#eT.add(e)}removePreProcessor(e){return this.#eT.delete(e)}addPostProcessor(e){this.#eA.add(e)}removePostProcessor(e){return this.#eA.delete(e)}addUploader(e){this.#eE.add(e)}removeUploader(e){return this.#eE.delete(e)}setMeta(e){let t={...this.getState().meta,...e},i={...this.getState().files};Object.keys(i).forEach(t=>{i[t]={...i[t],meta:{...i[t].meta,...e}}}),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:i})}setFileMeta(e,t){let i={...this.getState().files};if(!i[e]){this.log(`Was trying to set metadata for a file that has been removed: ${e}`);return}let r={...i[e].meta,...t};i[e]={...i[e],meta:r},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(e=>this.getFile(e))}getObjectOfFilesPerState(){let{files:e,totalProgress:t,error:i}=this.getState(),r=Object.values(e),s=[],n=[],a=[],o=[],l=[],u=[],h=[],p=[],d=[];for(let e of r){let{progress:t}=e;t.uploadComplete||!t.uploadStarted||(s.push(e),e.isPaused||p.push(e)),t.uploadStarted||n.push(e),(t.uploadStarted||t.preprocess||t.postprocess)&&a.push(e),t.uploadStarted&&o.push(e),e.isPaused&&l.push(e),t.uploadComplete&&u.push(e),e.error&&h.push(e),(t.preprocess||t.postprocess)&&d.push(e)}return{newFiles:n,startedFiles:a,uploadStartedFiles:o,pausedFiles:l,completeFiles:u,erroredFiles:h,inProgressFiles:s,inProgressNotPausedFiles:p,processingFiles:d,isUploadStarted:o.length>0,isAllComplete:100===t&&u.length===r.length&&0===d.length,isAllErrored:!!i&&h.length===r.length,isAllPaused:0!==s.length&&l.length===s.length,isUploadInProgress:s.length>0,isSomeGhost:r.some(e=>e.isGhost)}}#eI(e){for(let t of e)t.isRestriction?this.emit("restriction-failed",t.file,t):this.emit("error",t,t.file),this.log(t,"warning");let t=e.filter(e=>e.isUserFacing),i=t.slice(0,4),r=t.slice(4);i.forEach(({message:e,details:t=""})=>{this.info({message:e,details:t},"error",this.opts.infoTimeout)}),r.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:r.length})})}validateRestrictions(e,t=this.getFiles()){try{this.#eP.validate(t,[e])}catch(e){return e}return null}validateSingleFile(e){try{this.#eP.validateSingleFile(e)}catch(e){return e.message}return null}validateAggregateRestrictions(e){let t=this.getFiles();try{this.#eP.validateAggregateRestrictions(t,e)}catch(e){return e.message}return null}#eU(e){let{missingFields:t,error:i}=this.#eP.getMissingRequiredMetaFields(e);return t.length>0?(this.setFileState(e.id,{missingRequiredMetaFields:t}),this.log(i.message),this.emit("restriction-failed",e,i),!1):(0===t.length&&e.missingRequiredMetaFields&&this.setFileState(e.id,{missingRequiredMetaFields:[]}),!0)}#eO(e){let t=!0;for(let i of Object.values(e))this.#eU(i)||(t=!1);return t}#eD(e){let{allowNewUpload:t}=this.getState();if(!1===t){let t=new b(this.i18n("noMoreFilesAllowed"),{file:e});throw this.#eI([t]),t}}checkIfFileAlreadyExists(e){let{files:t}=this.getState();return!!t[e]&&!t[e].isGhost}#eR(e){let t=e instanceof File?{name:e.name,type:e.type,size:e.size,data:e}:e,i=(0,a.Z)(t),r=t.name?t.name:"image"===i.split("/")[0]?`${i.split("/")[0]}.${i.split("/")[1]}`:"noname",o=(0,n.Z)(r).extension,l=(0,s.H)(t,this.getID()),u=t.meta||{};u.name=r,u.type=i;let h=Number.isFinite(t.data.size)?t.data.size:null;return{source:t.source||"",id:l,name:r,extension:o||"",meta:{...this.getState().meta,...u},type:i,data:t.data,progress:{percentage:0,bytesUploaded:!1,bytesTotal:h,uploadComplete:!1,uploadStarted:null},size:h,isGhost:!1,isRemote:t.isRemote||!1,remote:t.remote,preview:t.preview}}#eN(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(e=>{e.isRestriction||this.log(e.stack||e.message||e)})},4))}#eM(e){let{files:t}=this.getState(),i={...t},r=[],s=[];for(let n of e)try{let e=this.#eR(n),s=t[e.id]?.isGhost;s&&(e={...t[e.id],isGhost:!1,data:n.data},this.log(`Replaced the blob in the restored ghost file: ${e.name}, ${e.id}`));let a=this.opts.onBeforeFileAdded(e,i);if(i={...t=this.getState().files,...i},!a&&this.checkIfFileAlreadyExists(e.id))throw new b(this.i18n("noDuplicates",{fileName:e.name??this.i18n("unnamed")}),{file:n});if(!1!==a||s)"object"==typeof a&&null!==a&&(e=a);else throw new b("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:n});this.#eP.validateSingleFile(e),i[e.id]=e,r.push(e)}catch(e){s.push(e)}try{this.#eP.validateAggregateRestrictions(Object.values(t),r)}catch(e){return s.push(e),{nextFilesState:t,validFilesToAdd:[],errors:s}}return{nextFilesState:i,validFilesToAdd:r,errors:s}}addFile(e){this.#eD(e);let{nextFilesState:t,validFilesToAdd:i,errors:r}=this.#eM([e]),s=r.filter(e=>e.isRestriction);if(this.#eI(s),r.length>0)throw r[0];this.setState({files:t});let[n]=i;return this.emit("file-added",n),this.emit("files-added",i),this.log(`Added file: ${n.name}, ${n.id}, mime type: ${n.type}`),this.#eN(),n.id}addFiles(e){this.#eD();let{nextFilesState:t,validFilesToAdd:i,errors:r}=this.#eM(e),s=r.filter(e=>e.isRestriction);this.#eI(s);let n=r.filter(e=>!e.isRestriction);if(n.length>0){let e="Multiple errors occurred while adding files:\n";if(n.forEach(t=>{e+=`
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[192],{85110:function(e){"use strict";e.exports=function(e){if("number"!=typeof e||Number.isNaN(e))throw TypeError(`Expected a number, got ${typeof e}`);let t=Math.abs(e);if(e<0&&(t=-t),0===t)return"0 B";let i=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],r=Math.min(Math.floor(Math.log(t)/Math.log(1024)),i.length-1),s=Number(t/1024**r),n=i[r];return`${s>=10||s%1==0?Math.round(s):s.toFixed(1)} ${n}`}},59196:function(e,t){"use strict";t.byteLength=function(e){var t=l(e),i=t[0],r=t[1];return(i+r)*3/4-r},t.toByteArray=function(e){var t,i,n=l(e),a=n[0],o=n[1],u=new s((a+o)*3/4-o),h=0,d=o>0?a-4:a;for(i=0;i<d;i+=4)t=r[e.charCodeAt(i)]<<18|r[e.charCodeAt(i+1)]<<12|r[e.charCodeAt(i+2)]<<6|r[e.charCodeAt(i+3)],u[h++]=t>>16&255,u[h++]=t>>8&255,u[h++]=255&t;return 2===o&&(t=r[e.charCodeAt(i)]<<2|r[e.charCodeAt(i+1)]>>4,u[h++]=255&t),1===o&&(t=r[e.charCodeAt(i)]<<10|r[e.charCodeAt(i+1)]<<4|r[e.charCodeAt(i+2)]>>2,u[h++]=t>>8&255,u[h++]=255&t),u},t.fromByteArray=function(e){for(var t,r=e.length,s=r%3,n=[],a=0,o=r-s;a<o;a+=16383)n.push(function(e,t,r){for(var s,n=[],a=t;a<r;a+=3)n.push(i[(s=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]))>>18&63]+i[s>>12&63]+i[s>>6&63]+i[63&s]);return n.join("")}(e,a,a+16383>o?o:a+16383));return 1===s?n.push(i[(t=e[r-1])>>2]+i[t<<4&63]+"=="):2===s&&n.push(i[(t=(e[r-2]<<8)+e[r-1])>>10]+i[t>>4&63]+i[t<<2&63]+"="),n.join("")};for(var i=[],r=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,o=n.length;a<o;++a)i[a]=n[a],r[n.charCodeAt(a)]=a;function l(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var i=e.indexOf("=");-1===i&&(i=t);var r=i===t?0:4-i%4;return[i,r]}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},82957:function(e,t,i){"use strict";var r=i(59196),s=i(68848),n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function a(e){if(e>2147483647)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,o.prototype),t}function o(e,t,i){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return h(e)}return l(e,t,i)}function l(e,t,i){if("string"==typeof e)return function(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!o.isEncoding(t))throw TypeError("Unknown encoding: "+t);var i=0|f(e,t),r=a(i),s=r.write(e,t);return s!==i&&(r=r.slice(0,s)),r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(A(e,Uint8Array)){var t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(A(e,ArrayBuffer)||e&&A(e.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(A(e,SharedArrayBuffer)||e&&A(e.buffer,SharedArrayBuffer)))return p(e,t,i);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return o.from(r,t,i);var s=function(e){if(o.isBuffer(e)){var t,i=0|c(e.length),r=a(i);return 0===r.length||e.copy(r,0,0,i),r}return void 0!==e.length?"number"!=typeof e.length||(t=e.length)!=t?a(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(s)return s;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,i);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function h(e){return u(e),a(e<0?0:0|c(e))}function d(e){for(var t=e.length<0?0:0|c(e.length),i=a(t),r=0;r<t;r+=1)i[r]=255&e[r];return i}function p(e,t,i){var r;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(i||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(r=void 0===t&&void 0===i?new Uint8Array(e):void 0===i?new Uint8Array(e,t):new Uint8Array(e,t,i),o.prototype),r}function c(e){if(e>=2147483647)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function f(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||A(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var i=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===i)return 0;for(var s=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return k(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return T(e).length;default:if(s)return r?-1:k(e).length;t=(""+t).toLowerCase(),s=!0}}function g(e,t,i){var s,n,a=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===i||i>this.length)&&(i=this.length),i<=0||(i>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,i){var r=e.length;(!t||t<0)&&(t=0),(!i||i<0||i>r)&&(i=r);for(var s="",n=t;n<i;++n)s+=x[e[n]];return s}(this,t,i);case"utf8":case"utf-8":return b(this,t,i);case"ascii":return function(e,t,i){var r="";i=Math.min(e.length,i);for(var s=t;s<i;++s)r+=String.fromCharCode(127&e[s]);return r}(this,t,i);case"latin1":case"binary":return function(e,t,i){var r="";i=Math.min(e.length,i);for(var s=t;s<i;++s)r+=String.fromCharCode(e[s]);return r}(this,t,i);case"base64":return s=t,n=i,0===s&&n===this.length?r.fromByteArray(this):r.fromByteArray(this.slice(s,n));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,i){for(var r=e.slice(t,i),s="",n=0;n<r.length-1;n+=2)s+=String.fromCharCode(r[n]+256*r[n+1]);return s}(this,t,i);default:if(a)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),a=!0}}function m(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function y(e,t,i,r,s){var n;if(0===e.length)return -1;if("string"==typeof i?(r=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),(n=i=+i)!=n&&(i=s?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(s)return -1;i=e.length-1}else if(i<0){if(!s)return -1;i=0}if("string"==typeof t&&(t=o.from(t,r)),o.isBuffer(t))return 0===t.length?-1:v(e,t,i,r,s);if("number"==typeof t)return(t&=255,"function"==typeof Uint8Array.prototype.indexOf)?s?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):v(e,[t],i,r,s);throw TypeError("val must be string, number or Buffer")}function v(e,t,i,r,s){var n,a=1,o=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return -1;a=2,o/=2,l/=2,i/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(s){var h=-1;for(n=i;n<o;n++)if(u(e,n)===u(t,-1===h?0:n-h)){if(-1===h&&(h=n),n-h+1===l)return h*a}else -1!==h&&(n-=n-h),h=-1}else for(i+l>o&&(i=o-l),n=i;n>=0;n--){for(var d=!0,p=0;p<l;p++)if(u(e,n+p)!==u(t,p)){d=!1;break}if(d)return n}return -1}function b(e,t,i){i=Math.min(e.length,i);for(var r=[],s=t;s<i;){var n,a,o,l,u=e[s],h=null,d=u>239?4:u>223?3:u>191?2:1;if(s+d<=i)switch(d){case 1:u<128&&(h=u);break;case 2:(192&(n=e[s+1]))==128&&(l=(31&u)<<6|63&n)>127&&(h=l);break;case 3:n=e[s+1],a=e[s+2],(192&n)==128&&(192&a)==128&&(l=(15&u)<<12|(63&n)<<6|63&a)>2047&&(l<55296||l>57343)&&(h=l);break;case 4:n=e[s+1],a=e[s+2],o=e[s+3],(192&n)==128&&(192&a)==128&&(192&o)==128&&(l=(15&u)<<18|(63&n)<<12|(63&a)<<6|63&o)>65535&&l<1114112&&(h=l)}null===h?(h=65533,d=1):h>65535&&(h-=65536,r.push(h>>>10&1023|55296),h=56320|1023&h),r.push(h),s+=d}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var i="",r=0;r<t;)i+=String.fromCharCode.apply(String,e.slice(r,r+=4096));return i}(r)}function w(e,t,i){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>i)throw RangeError("Trying to access beyond buffer length")}function _(e,t,i,r,s,n){if(!o.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>s||t<n)throw RangeError('"value" argument is out of bounds');if(i+r>e.length)throw RangeError("Index out of range")}function S(e,t,i,r,s,n){if(i+r>e.length||i<0)throw RangeError("Index out of range")}function C(e,t,i,r,n){return t=+t,i>>>=0,n||S(e,t,i,4,34028234663852886e22,-34028234663852886e22),s.write(e,t,i,r,23,4),i+4}function P(e,t,i,r,n){return t=+t,i>>>=0,n||S(e,t,i,8,17976931348623157e292,-17976931348623157e292),s.write(e,t,i,r,52,8),i+8}t.lW=o,t.h2=50,o.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),o.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}}),o.poolSize=8192,o.from=function(e,t,i){return l(e,t,i)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),o.alloc=function(e,t,i){return(u(e),e<=0)?a(e):void 0!==t?"string"==typeof i?a(e).fill(t,i):a(e).fill(t):a(e)},o.allocUnsafe=function(e){return h(e)},o.allocUnsafeSlow=function(e){return h(e)},o.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==o.prototype},o.compare=function(e,t){if(A(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),A(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(e)||!o.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var i=e.length,r=t.length,s=0,n=Math.min(i,r);s<n;++s)if(e[s]!==t[s]){i=e[s],r=t[s];break}return i<r?-1:r<i?1:0},o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(e,t){if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);if(void 0===t)for(i=0,t=0;i<e.length;++i)t+=e[i].length;var i,r=o.allocUnsafe(t),s=0;for(i=0;i<e.length;++i){var n=e[i];if(A(n,Uint8Array))s+n.length>r.length?o.from(n).copy(r,s):Uint8Array.prototype.set.call(r,n,s);else if(o.isBuffer(n))n.copy(r,s);else throw TypeError('"list" argument must be an Array of Buffers');s+=n.length}return r},o.byteLength=f,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)m(this,t,t+1);return this},o.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},o.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},o.prototype.toString=function(){var e=this.length;return 0===e?"":0==arguments.length?b(this,0,e):g.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(e){if(!o.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},o.prototype.inspect=function(){var e="",i=t.h2;return e=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(e+=" ... "),"<Buffer "+e+">"},n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=function(e,t,i,r,s){if(A(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===i&&(i=e?e.length:0),void 0===r&&(r=0),void 0===s&&(s=this.length),t<0||i>e.length||r<0||s>this.length)throw RangeError("out of range index");if(r>=s&&t>=i)return 0;if(r>=s)return -1;if(t>=i)return 1;if(t>>>=0,i>>>=0,r>>>=0,s>>>=0,this===e)return 0;for(var n=s-r,a=i-t,l=Math.min(n,a),u=this.slice(r,s),h=e.slice(t,i),d=0;d<l;++d)if(u[d]!==h[d]){n=u[d],a=h[d];break}return n<a?-1:a<n?1:0},o.prototype.includes=function(e,t,i){return -1!==this.indexOf(e,t,i)},o.prototype.indexOf=function(e,t,i){return y(this,e,t,i,!0)},o.prototype.lastIndexOf=function(e,t,i){return y(this,e,t,i,!1)},o.prototype.write=function(e,t,i,r){if(void 0===t)r="utf8",i=this.length,t=0;else if(void 0===i&&"string"==typeof t)r=t,i=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(i)?(i>>>=0,void 0===r&&(r="utf8")):(r=i,i=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var s,n,a,o,l,u,h,d,p=this.length-t;if((void 0===i||i>p)&&(i=p),e.length>0&&(i<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var c=!1;;)switch(r){case"hex":return function(e,t,i,r){i=Number(i)||0;var s=e.length-i;r?(r=Number(r))>s&&(r=s):r=s;var n=t.length;r>n/2&&(r=n/2);for(var a=0;a<r;++a){var o=parseInt(t.substr(2*a,2),16);if(o!=o)break;e[i+a]=o}return a}(this,e,t,i);case"utf8":case"utf-8":return s=t,n=i,E(k(e,this.length-s),this,s,n);case"ascii":case"latin1":case"binary":return a=t,o=i,E(function(e){for(var t=[],i=0;i<e.length;++i)t.push(255&e.charCodeAt(i));return t}(e),this,a,o);case"base64":return l=t,u=i,E(T(e),this,l,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return h=t,d=i,E(function(e,t){for(var i,r,s=[],n=0;n<e.length&&!((t-=2)<0);++n)r=(i=e.charCodeAt(n))>>8,s.push(i%256),s.push(r);return s}(e,this.length-h),this,h,d);default:if(c)throw TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),c=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},o.prototype.slice=function(e,t){var i=this.length;e=~~e,t=void 0===t?i:~~t,e<0?(e+=i)<0&&(e=0):e>i&&(e=i),t<0?(t+=i)<0&&(t=0):t>i&&(t=i),t<e&&(t=e);var r=this.subarray(e,t);return Object.setPrototypeOf(r,o.prototype),r},o.prototype.readUintLE=o.prototype.readUIntLE=function(e,t,i){e>>>=0,t>>>=0,i||w(e,t,this.length);for(var r=this[e],s=1,n=0;++n<t&&(s*=256);)r+=this[e+n]*s;return r},o.prototype.readUintBE=o.prototype.readUIntBE=function(e,t,i){e>>>=0,t>>>=0,i||w(e,t,this.length);for(var r=this[e+--t],s=1;t>0&&(s*=256);)r+=this[e+--t]*s;return r},o.prototype.readUint8=o.prototype.readUInt8=function(e,t){return e>>>=0,t||w(e,1,this.length),this[e]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||w(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||w(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||w(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(e,t){return e>>>=0,t||w(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,i){e>>>=0,t>>>=0,i||w(e,t,this.length);for(var r=this[e],s=1,n=0;++n<t&&(s*=256);)r+=this[e+n]*s;return r>=(s*=128)&&(r-=Math.pow(2,8*t)),r},o.prototype.readIntBE=function(e,t,i){e>>>=0,t>>>=0,i||w(e,t,this.length);for(var r=t,s=1,n=this[e+--r];r>0&&(s*=256);)n+=this[e+--r]*s;return n>=(s*=128)&&(n-=Math.pow(2,8*t)),n},o.prototype.readInt8=function(e,t){return(e>>>=0,t||w(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||w(e,2,this.length);var i=this[e]|this[e+1]<<8;return 32768&i?4294901760|i:i},o.prototype.readInt16BE=function(e,t){e>>>=0,t||w(e,2,this.length);var i=this[e+1]|this[e]<<8;return 32768&i?4294901760|i:i},o.prototype.readInt32LE=function(e,t){return e>>>=0,t||w(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e>>>=0,t||w(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return e>>>=0,t||w(e,4,this.length),s.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e>>>=0,t||w(e,4,this.length),s.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e>>>=0,t||w(e,8,this.length),s.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e>>>=0,t||w(e,8,this.length),s.read(this,e,!1,52,8)},o.prototype.writeUintLE=o.prototype.writeUIntLE=function(e,t,i,r){if(e=+e,t>>>=0,i>>>=0,!r){var s=Math.pow(2,8*i)-1;_(this,e,t,i,s,0)}var n=1,a=0;for(this[t]=255&e;++a<i&&(n*=256);)this[t+a]=e/n&255;return t+i},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(e,t,i,r){if(e=+e,t>>>=0,i>>>=0,!r){var s=Math.pow(2,8*i)-1;_(this,e,t,i,s,0)}var n=i-1,a=1;for(this[t+n]=255&e;--n>=0&&(a*=256);)this[t+n]=e/a&255;return t+i},o.prototype.writeUint8=o.prototype.writeUInt8=function(e,t,i){return e=+e,t>>>=0,i||_(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(e,t,i){return e=+e,t>>>=0,i||_(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(e,t,i){return e=+e,t>>>=0,i||_(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(e,t,i){return e=+e,t>>>=0,i||_(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(e,t,i){return e=+e,t>>>=0,i||_(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeIntLE=function(e,t,i,r){if(e=+e,t>>>=0,!r){var s=Math.pow(2,8*i-1);_(this,e,t,i,s-1,-s)}var n=0,a=1,o=0;for(this[t]=255&e;++n<i&&(a*=256);)e<0&&0===o&&0!==this[t+n-1]&&(o=1),this[t+n]=(e/a>>0)-o&255;return t+i},o.prototype.writeIntBE=function(e,t,i,r){if(e=+e,t>>>=0,!r){var s=Math.pow(2,8*i-1);_(this,e,t,i,s-1,-s)}var n=i-1,a=1,o=0;for(this[t+n]=255&e;--n>=0&&(a*=256);)e<0&&0===o&&0!==this[t+n+1]&&(o=1),this[t+n]=(e/a>>0)-o&255;return t+i},o.prototype.writeInt8=function(e,t,i){return e=+e,t>>>=0,i||_(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,i){return e=+e,t>>>=0,i||_(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,i){return e=+e,t>>>=0,i||_(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,i){return e=+e,t>>>=0,i||_(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,i){return e=+e,t>>>=0,i||_(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeFloatLE=function(e,t,i){return C(this,e,t,!0,i)},o.prototype.writeFloatBE=function(e,t,i){return C(this,e,t,!1,i)},o.prototype.writeDoubleLE=function(e,t,i){return P(this,e,t,!0,i)},o.prototype.writeDoubleBE=function(e,t,i){return P(this,e,t,!1,i)},o.prototype.copy=function(e,t,i,r){if(!o.isBuffer(e))throw TypeError("argument should be a Buffer");if(i||(i=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<i&&(r=i),r===i||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw RangeError("Index out of range");if(r<0)throw RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-i&&(r=e.length-t+i);var s=r-i;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,i,r):Uint8Array.prototype.set.call(e,this.subarray(i,r),t),s},o.prototype.fill=function(e,t,i,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,i=this.length):"string"==typeof i&&(r=i,i=this.length),void 0!==r&&"string"!=typeof r)throw TypeError("encoding must be a string");if("string"==typeof r&&!o.isEncoding(r))throw TypeError("Unknown encoding: "+r);if(1===e.length){var s,n=e.charCodeAt(0);("utf8"===r&&n<128||"latin1"===r)&&(e=n)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<i)throw RangeError("Out of range index");if(i<=t)return this;if(t>>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"==typeof e)for(s=t;s<i;++s)this[s]=e;else{var a=o.isBuffer(e)?e:o.from(e,r),l=a.length;if(0===l)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(s=0;s<i-t;++s)this[s+t]=a[s%l]}return this};var F=/[^+/0-9A-Za-z-_]/g;function k(e,t){t=t||1/0;for(var i,r=e.length,s=null,n=[],a=0;a<r;++a){if((i=e.charCodeAt(a))>55295&&i<57344){if(!s){if(i>56319||a+1===r){(t-=3)>-1&&n.push(239,191,189);continue}s=i;continue}if(i<56320){(t-=3)>-1&&n.push(239,191,189),s=i;continue}i=(s-55296<<10|i-56320)+65536}else s&&(t-=3)>-1&&n.push(239,191,189);if(s=null,i<128){if((t-=1)<0)break;n.push(i)}else if(i<2048){if((t-=2)<0)break;n.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;n.push(i>>12|224,i>>6&63|128,63&i|128)}else if(i<1114112){if((t-=4)<0)break;n.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}else throw Error("Invalid code point")}return n}function T(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(F,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function E(e,t,i,r){for(var s=0;s<r&&!(s+i>=t.length)&&!(s>=e.length);++s)t[s+i]=e[s];return s}function A(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var x=function(){for(var e="0123456789abcdef",t=Array(256),i=0;i<16;++i)for(var r=16*i,s=0;s<16;++s)t[r+s]=e[i]+e[s];return t}()},68848:function(e,t){t.read=function(e,t,i,r,s){var n,a,o=8*s-r-1,l=(1<<o)-1,u=l>>1,h=-7,d=i?s-1:0,p=i?-1:1,c=e[t+d];for(d+=p,n=c&(1<<-h)-1,c>>=-h,h+=o;h>0;n=256*n+e[t+d],d+=p,h-=8);for(a=n&(1<<-h)-1,n>>=-h,h+=r;h>0;a=256*a+e[t+d],d+=p,h-=8);if(0===n)n=1-u;else{if(n===l)return a?NaN:1/0*(c?-1:1);a+=Math.pow(2,r),n-=u}return(c?-1:1)*a*Math.pow(2,n-r)},t.write=function(e,t,i,r,s,n){var a,o,l,u=8*n-s-1,h=(1<<u)-1,d=h>>1,p=23===s?5960464477539062e-23:0,c=r?0:n-1,f=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(isNaN(t=Math.abs(t))||t===1/0?(o=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+d>=1?t+=p/l:t+=p*Math.pow(2,1-d),t*l>=2&&(a++,l/=2),a+d>=h?(o=0,a=h):a+d>=1?(o=(t*l-1)*Math.pow(2,s),a+=d):(o=t*Math.pow(2,d-1)*Math.pow(2,s),a=0));s>=8;e[i+c]=255&o,c+=f,o/=256,s-=8);for(a=a<<s|o,u+=s;u>0;e[i+c]=255&a,c+=f,a/=256,u-=8);e[i+c-f]|=128*g}},23910:function(e,t,i){var r=i(74288).Symbol;e.exports=r},54506:function(e,t,i){var r=i(23910),s=i(4479),n=i(80910),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?s(e):n(e)}},55041:function(e,t,i){var r=i(5035),s=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(s,""):e}},17071:function(e,t,i){var r="object"==typeof i.g&&i.g&&i.g.Object===Object&&i.g;e.exports=r},4479:function(e,t,i){var r=i(23910),s=Object.prototype,n=s.hasOwnProperty,a=s.toString,o=r?r.toStringTag:void 0;e.exports=function(e){var t=n.call(e,o),i=e[o];try{e[o]=void 0;var r=!0}catch(e){}var s=a.call(e);return r&&(t?e[o]=i:delete e[o]),s}},80910:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},74288:function(e,t,i){var r=i(17071),s="object"==typeof self&&self&&self.Object===Object&&self,n=r||s||Function("return this")();e.exports=n},5035:function(e){var t=/\s/;e.exports=function(e){for(var i=e.length;i--&&t.test(e.charAt(i)););return i}},7310:function(e,t,i){var r=i(28302),s=i(11121),n=i(6660),a=Math.max,o=Math.min;e.exports=function(e,t,i){var l,u,h,d,p,c,f=0,g=!1,m=!1,y=!0;if("function"!=typeof e)throw TypeError("Expected a function");function v(t){var i=l,r=u;return l=u=void 0,f=t,d=e.apply(r,i)}function b(e){var i=e-c,r=e-f;return void 0===c||i>=t||i<0||m&&r>=h}function w(){var e,i,r,n=s();if(b(n))return _(n);p=setTimeout(w,(e=n-c,i=n-f,r=t-e,m?o(r,h-i):r))}function _(e){return(p=void 0,y&&l)?v(e):(l=u=void 0,d)}function S(){var e,i=s(),r=b(i);if(l=arguments,u=this,c=i,r){if(void 0===p)return f=e=c,p=setTimeout(w,t),g?v(e):d;if(m)return clearTimeout(p),p=setTimeout(w,t),v(c)}return void 0===p&&(p=setTimeout(w,t)),d}return t=n(t)||0,r(i)&&(g=!!i.leading,h=(m="maxWait"in i)?a(n(i.maxWait)||0,t):h,y="trailing"in i?!!i.trailing:y),S.cancel=function(){void 0!==p&&clearTimeout(p),f=0,l=c=u=p=void 0},S.flush=function(){return void 0===p?d:_(s())},S}},28302:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},10303:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},78371:function(e,t,i){var r=i(54506),s=i(10303);e.exports=function(e){return"symbol"==typeof e||s(e)&&"[object Symbol]"==r(e)}},11121:function(e,t,i){var r=i(74288);e.exports=function(){return r.Date.now()}},37065:function(e,t,i){var r=i(7310),s=i(28302);e.exports=function(e,t,i){var n=!0,a=!0;if("function"!=typeof e)throw TypeError("Expected a function");return s(i)&&(n="leading"in i?!!i.leading:n,a="trailing"in i?!!i.trailing:a),r(e,t,{leading:n,maxWait:t,trailing:a})}},6660:function(e,t,i){var r=i(55041),s=i(28302),n=i(78371),a=0/0,o=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,u=/^0o[0-7]+$/i,h=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(n(e))return a;if(s(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=s(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var i=l.test(e);return i||u.test(e)?h(e.slice(2),i?2:8):o.test(e)?a:+e}},92451:function(e,t,i){"use strict";i.d(t,{Z:function(){return r}});let r=(0,i(39763).Z)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},92735:function(e,t,i){"use strict";i.d(t,{Z:function(){return r}});let r=(0,i(39763).Z)("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]])},88964:function(e,t,i){"use strict";i.d(t,{Z:function(){return r}});let r=(0,i(39763).Z)("FilePlus",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["line",{x1:"12",x2:"12",y1:"18",y2:"12",key:"1tsf04"}],["line",{x1:"9",x2:"15",y1:"15",y2:"15",key:"110plj"}]])},48736:function(e,t,i){"use strict";i.d(t,{Z:function(){return r}});let r=(0,i(39763).Z)("FileText",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["line",{x1:"16",x2:"8",y1:"13",y2:"13",key:"14keom"}],["line",{x1:"16",x2:"8",y1:"17",y2:"17",key:"17nazh"}],["line",{x1:"10",x2:"8",y1:"9",y2:"9",key:"1a5vjj"}]])},30044:function(e,t,i){"use strict";i.d(t,{Z:function(){return r}});let r=(0,i(39763).Z)("FileWarning",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},69658:function(e,t,i){"use strict";i.d(t,{Z:function(){return r}});let r=(0,i(39763).Z)("File",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}]])},53113:function(e,t,i){"use strict";i.d(t,{Z:function(){return r}});let r=(0,i(39763).Z)("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]])},15001:function(e,t,i){"use strict";i.d(t,{Z:function(){return r}});let r=(0,i(39763).Z)("Loader",[["line",{x1:"12",x2:"12",y1:"2",y2:"6",key:"gza1u7"}],["line",{x1:"12",x2:"12",y1:"18",y2:"22",key:"1qhbu9"}],["line",{x1:"4.93",x2:"7.76",y1:"4.93",y2:"7.76",key:"xae44r"}],["line",{x1:"16.24",x2:"19.07",y1:"16.24",y2:"19.07",key:"bxnmvf"}],["line",{x1:"2",x2:"6",y1:"12",y2:"12",key:"89khin"}],["line",{x1:"18",x2:"22",y1:"12",y2:"12",key:"pb8tfm"}],["line",{x1:"4.93",x2:"7.76",y1:"19.07",y2:"16.24",key:"1uxjnu"}],["line",{x1:"16.24",x2:"19.07",y1:"7.76",y2:"4.93",key:"6duxfx"}]])},99397:function(e,t,i){"use strict";i.d(t,{Z:function(){return r}});let r=(0,i(39763).Z)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},67385:function(e,t,i){var r=i(40548),s=/[\/\+\.]/;e.exports=function(e,t){function i(t){var i=r(t,e,s);return i&&i.length>=2}return t?i(t.split(";")[0]):i}},71157:function(e){e.exports=function(){var e={},t=e._fns={};return e.emit=function(e,i,r,s,n,a,o){var l=function(e){for(var i=t[e]?t[e]:[],r=e.indexOf(":"),s=-1===r?[e]:[e.substring(0,r),e.substring(r+1)],n=Object.keys(t),a=0,o=n.length;a<o;a++){var l=n[a];if("*"===l&&(i=i.concat(t[l])),2===s.length&&s[0]===l){i=i.concat(t[l]);break}}return i}(e);l.length&&function(e,t,i){for(var r=0,s=t.length;r<s&&t[r];r++)t[r].event=e,t[r].apply(t[r],i)}(e,l,[i,r,s,n,a,o])},e.on=function(e,i){t[e]||(t[e]=[]),t[e].push(i)},e.once=function(t,i){this.on(t,function r(){i.apply(this,arguments),e.off(t,r)})},e.off=function(e,t){var i=[];if(e&&t)for(var r=this._fns[e],s=0,n=r?r.length:0;s<n;s++)r[s]!==t&&i.push(r[s]);i.length?this._fns[e]=i:delete this._fns[e]},e}},66703:function(e){"use strict";var t=Object.prototype.hasOwnProperty,i="~";function r(){}function s(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function n(e,t,r,n,a){if("function"!=typeof r)throw TypeError("The listener must be a function");var o=new s(r,n||e,a),l=i?i+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],o]:e._events[l].push(o):(e._events[l]=o,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function o(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(i=!1)),o.prototype.eventNames=function(){var e,r,s=[];if(0===this._eventsCount)return s;for(r in e=this._events)t.call(e,r)&&s.push(i?r.slice(1):r);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(e)):s},o.prototype.listeners=function(e){var t=i?i+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var s=0,n=r.length,a=Array(n);s<n;s++)a[s]=r[s].fn;return a},o.prototype.listenerCount=function(e){var t=i?i+e:e,r=this._events[t];return r?r.fn?1:r.length:0},o.prototype.emit=function(e,t,r,s,n,a){var o=i?i+e:e;if(!this._events[o])return!1;var l,u,h=this._events[o],d=arguments.length;if(h.fn){switch(h.once&&this.removeListener(e,h.fn,void 0,!0),d){case 1:return h.fn.call(h.context),!0;case 2:return h.fn.call(h.context,t),!0;case 3:return h.fn.call(h.context,t,r),!0;case 4:return h.fn.call(h.context,t,r,s),!0;case 5:return h.fn.call(h.context,t,r,s,n),!0;case 6:return h.fn.call(h.context,t,r,s,n,a),!0}for(u=1,l=Array(d-1);u<d;u++)l[u-1]=arguments[u];h.fn.apply(h.context,l)}else{var p,c=h.length;for(u=0;u<c;u++)switch(h[u].once&&this.removeListener(e,h[u].fn,void 0,!0),d){case 1:h[u].fn.call(h[u].context);break;case 2:h[u].fn.call(h[u].context,t);break;case 3:h[u].fn.call(h[u].context,t,r);break;case 4:h[u].fn.call(h[u].context,t,r,s);break;default:if(!l)for(p=1,l=Array(d-1);p<d;p++)l[p-1]=arguments[p];h[u].fn.apply(h[u].context,l)}}return!0},o.prototype.on=function(e,t,i){return n(this,e,t,i,!1)},o.prototype.once=function(e,t,i){return n(this,e,t,i,!0)},o.prototype.removeListener=function(e,t,r,s){var n=i?i+e:e;if(!this._events[n])return this;if(!t)return a(this,n),this;var o=this._events[n];if(o.fn)o.fn!==t||s&&!o.once||r&&o.context!==r||a(this,n);else{for(var l=0,u=[],h=o.length;l<h;l++)(o[l].fn!==t||s&&!o[l].once||r&&o[l].context!==r)&&u.push(o[l]);u.length?this._events[n]=1===u.length?u[0]:u:a(this,n)}return this},o.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&a(this,t)):(this._events=new r,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=i,o.EventEmitter=o,e.exports=o},46220:function(e,t,i){e.exports=i(94776)},94776:function(e,t,i){var r=i(95428);t.operation=function(e){return new r(t.timeouts(e),{forever:e&&(e.forever||e.retries===1/0),unref:e&&e.unref,maxRetryTime:e&&e.maxRetryTime})},t.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1};for(var i in e)t[i]=e[i];if(t.minTimeout>t.maxTimeout)throw Error("minTimeout is greater than maxTimeout");for(var r=[],s=0;s<t.retries;s++)r.push(this.createTimeout(s,t));return e&&e.forever&&!r.length&&r.push(this.createTimeout(s,t)),r.sort(function(e,t){return e-t}),r},t.createTimeout=function(e,t){return Math.min(Math.round((t.randomize?Math.random()+1:1)*Math.max(t.minTimeout,1)*Math.pow(t.factor,e)),t.maxTimeout)},t.wrap=function(e,i,r){if(i instanceof Array&&(r=i,i=null),!r)for(var s in r=[],e)"function"==typeof e[s]&&r.push(s);for(var n=0;n<r.length;n++){var a=r[n],o=e[a];e[a]=(function(r){var s=t.operation(i),n=Array.prototype.slice.call(arguments,1),a=n.pop();n.push(function(e){s.retry(e)||(e&&(arguments[0]=s.mainError()),a.apply(this,arguments))}),s.attempt(function(){r.apply(e,n)})}).bind(e,o),e[a].options=i}}},95428:function(e){function t(e,t){"boolean"==typeof t&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}e.exports=t,t.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},t.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},t.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=new Date().getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var i=this._timeouts.shift();if(void 0===i){if(!this._cachedTimeouts)return!1;this._errors.splice(0,this._errors.length-1),i=this._cachedTimeouts.slice(-1)}var r=this;return this._timer=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},i),this._options.unref&&this._timer.unref(),!0},t.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var i=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){i._operationTimeoutCb()},i._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},t.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},t.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)},t.prototype.start=t.prototype.try,t.prototype.errors=function(){return this._errors},t.prototype.attempts=function(){return this._attempts},t.prototype.mainError=function(){if(0===this._errors.length)return null;for(var e={},t=null,i=0,r=0;r<this._errors.length;r++){var s=this._errors[r],n=s.message,a=(e[n]||0)+1;e[n]=a,a>=i&&(t=s,i=a)}return t}},95274:function(e,t,i){"use strict";var r=i(2265);r.useSyncExternalStore,r.useRef,r.useEffect,r.useMemo,r.useDebugValue},76548:function(e,t,i){"use strict";i(95274)},40548:function(e){"use strict";function t(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}t.prototype.match=function(e){var t,i,r=!0,s=this.parts,n=s.length;if("string"==typeof e||e instanceof String){if(this.hasWild||this.text==e){for(t=0,i=(e||"").split(this.separator);r&&t<n;t++)"*"!==s[t]&&(r=t<i.length&&s[t]===i[t]);r=r&&i}else r=!1}else if("function"==typeof e.splice)for(r=[],t=e.length;t--;)this.match(e[t])&&(r[r.length]=e[t]);else if("object"==typeof e)for(var a in r={},e)this.match(a)&&(r[a]=e[a]);return r},e.exports=function(e,i,r){var s=new t(e,r||/[\/\.]/);return void 0!==i?s.match(i):s}},46693:function(){},51832:function(){},36760:function(e,t){var i;!function(){"use strict";var r={}.hasOwnProperty;function s(){for(var e="",t=0;t<arguments.length;t++){var i=arguments[t];i&&(e=n(e,function(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return s.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var i in e)r.call(e,i)&&e[i]&&(t=n(t,i));return t}(i)))}return e}function n(e,t){return t?e?e+" "+t:e+t:e}e.exports?(s.default=s,e.exports=s):void 0!==(i=(function(){return s}).apply(t,[]))&&(e.exports=i)}()},88985:function(e,t,i){"use strict";i.d(t,{zF:function(){return v},Fw:function(){return S},wy:function(){return w},fC:function(){return F}});var r=i(2265);"undefined"!=typeof window&&window.document&&window.document.createElement;var s=i(73966),n=i(80886),a=i(61188),o=i(98575),l=i(66840),u=e=>{var t,i;let s,n;let{present:l,children:u}=e,d=function(e){var t,i;let[s,n]=r.useState(),o=r.useRef(null),l=r.useRef(e),u=r.useRef("none"),[d,p]=(t=e?"mounted":"unmounted",i={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},r.useReducer((e,t)=>{let r=i[e][t];return null!=r?r:e},t));return r.useEffect(()=>{let e=h(o.current);u.current="mounted"===d?e:"none"},[d]),(0,a.b)(()=>{let t=o.current,i=l.current;if(i!==e){let r=u.current,s=h(t);e?p("MOUNT"):"none"===s||(null==t?void 0:t.display)==="none"?p("UNMOUNT"):i&&r!==s?p("ANIMATION_OUT"):p("UNMOUNT"),l.current=e}},[e,p]),(0,a.b)(()=>{if(s){var e;let t;let i=null!==(e=s.ownerDocument.defaultView)&&void 0!==e?e:window,r=e=>{let r=h(o.current).includes(CSS.escape(e.animationName));if(e.target===s&&r&&(p("ANIMATION_END"),!l.current)){let e=s.style.animationFillMode;s.style.animationFillMode="forwards",t=i.setTimeout(()=>{"forwards"===s.style.animationFillMode&&(s.style.animationFillMode=e)})}},n=e=>{e.target===s&&(u.current=h(o.current))};return s.addEventListener("animationstart",n),s.addEventListener("animationcancel",r),s.addEventListener("animationend",r),()=>{i.clearTimeout(t),s.removeEventListener("animationstart",n),s.removeEventListener("animationcancel",r),s.removeEventListener("animationend",r)}}p("ANIMATION_END")},[s,p]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:r.useCallback(e=>{o.current=e?getComputedStyle(e):null,n(e)},[])}}(l),p="function"==typeof u?u({present:d.isPresent}):r.Children.only(u),c=(0,o.e)(d.ref,(s=null===(t=Object.getOwnPropertyDescriptor(p.props,"ref"))||void 0===t?void 0:t.get)&&"isReactWarning"in s&&s.isReactWarning?p.ref:(s=null===(i=Object.getOwnPropertyDescriptor(p,"ref"))||void 0===i?void 0:i.get)&&"isReactWarning"in s&&s.isReactWarning?p.props.ref:p.props.ref||p.ref);return"function"==typeof u||d.isPresent?r.cloneElement(p,{ref:c}):null};function h(e){return(null==e?void 0:e.animationName)||"none"}u.displayName="Presence";var d=i(99255),p=i(57437),c="Collapsible",[f,g]=(0,s.b)(c),[m,y]=f(c),v=r.forwardRef((e,t)=>{let{__scopeCollapsible:i,open:s,defaultOpen:a,disabled:o,onOpenChange:u,...h}=e,[f,g]=(0,n.T)({prop:s,defaultProp:null!=a&&a,onChange:u,caller:c});return(0,p.jsx)(m,{scope:i,disabled:o,contentId:(0,d.M)(),open:f,onOpenToggle:r.useCallback(()=>g(e=>!e),[g]),children:(0,p.jsx)(l.WV.div,{"data-state":P(f),"data-disabled":o?"":void 0,...h,ref:t})})});v.displayName=c;var b="CollapsibleTrigger",w=r.forwardRef((e,t)=>{let{__scopeCollapsible:i,...r}=e,s=y(b,i);return(0,p.jsx)(l.WV.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":P(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:t,onClick:function(e,t,{checkForDefaultPrevented:i=!0}={}){return function(r){if(e?.(r),!1===i||!r.defaultPrevented)return t?.(r)}}(e.onClick,s.onOpenToggle)})});w.displayName=b;var _="CollapsibleContent",S=r.forwardRef((e,t)=>{let{forceMount:i,...r}=e,s=y(_,e.__scopeCollapsible);return(0,p.jsx)(u,{present:i||s.open,children:e=>{let{present:i}=e;return(0,p.jsx)(C,{...r,ref:t,present:i})}})});S.displayName=_;var C=r.forwardRef((e,t)=>{let{__scopeCollapsible:i,present:s,children:n,...u}=e,h=y(_,i),[d,c]=r.useState(s),f=r.useRef(null),g=(0,o.e)(t,f),m=r.useRef(0),v=m.current,b=r.useRef(0),w=b.current,S=h.open||d,C=r.useRef(S),F=r.useRef(void 0);return r.useEffect(()=>{let e=requestAnimationFrame(()=>C.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,a.b)(()=>{let e=f.current;if(e){F.current=F.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration="0s",e.style.animationName="none";let t=e.getBoundingClientRect();m.current=t.height,b.current=t.width,C.current||(e.style.transitionDuration=F.current.transitionDuration,e.style.animationName=F.current.animationName),c(s)}},[h.open,s]),(0,p.jsx)(l.WV.div,{"data-state":P(h.open),"data-disabled":h.disabled?"":void 0,id:h.contentId,hidden:!S,...u,ref:g,style:{"--radix-collapsible-content-height":v?"".concat(v,"px"):void 0,"--radix-collapsible-content-width":w?"".concat(w,"px"):void 0,...e.style},children:S&&n})});function P(e){return e?"open":"closed"}var F=v},2894:function(e,t,i){"use strict";i.d(t,{R:function(){return o},m:function(){return a}});var r=i(18238),s=i(7989),n=i(11255),a=class extends s.F{#e;#t;#i;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||o(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(t=>t!==e),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||("pending"===this.state.status?this.scheduleGc():this.#t.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#r({type:"continue"})};this.#i=(0,n.Mz)({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#r({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});let i="pending"===this.state.status,r=!this.#i.canStart();try{if(i)t();else{this.#r({type:"pending",variables:e,isPaused:r}),await this.#t.config.onMutate?.(e,this);let t=await this.options.onMutate?.(e);t!==this.state.context&&this.#r({type:"pending",context:t,variables:e,isPaused:r})}let s=await this.#i.start();return await this.#t.config.onSuccess?.(s,e,this.state.context,this),await this.options.onSuccess?.(s,e,this.state.context),await this.#t.config.onSettled?.(s,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(s,null,e,this.state.context),this.#r({type:"success",data:s}),s}catch(t){try{throw await this.#t.config.onError?.(t,e,this.state.context,this),await this.options.onError?.(t,e,this.state.context),await this.#t.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,t,e,this.state.context),t}finally{this.#r({type:"error",error:t})}}finally{this.#t.runNext(this)}}#r(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),r.Vr.batch(()=>{this.#e.forEach(t=>{t.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function o(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}},21770:function(e,t,i){"use strict";i.d(t,{D:function(){return h}});var r=i(2265),s=i(2894),n=i(18238),a=i(24112),o=i(45345),l=class extends a.l{#s;#n=void 0;#a;#o;constructor(e,t){super(),this.#s=e,this.setOptions(t),this.bindMethods(),this.#l()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#s.defaultMutationOptions(e),(0,o.VS)(this.options,t)||this.#s.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#a,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,o.Ym)(t.mutationKey)!==(0,o.Ym)(this.options.mutationKey)?this.reset():this.#a?.state.status==="pending"&&this.#a.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#a?.removeObserver(this)}onMutationUpdate(e){this.#l(),this.#u(e)}getCurrentResult(){return this.#n}reset(){this.#a?.removeObserver(this),this.#a=void 0,this.#l(),this.#u()}mutate(e,t){return this.#o=t,this.#a?.removeObserver(this),this.#a=this.#s.getMutationCache().build(this.#s,this.options),this.#a.addObserver(this),this.#a.execute(e)}#l(){let e=this.#a?.state??(0,s.R)();this.#n={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#u(e){n.Vr.batch(()=>{if(this.#o&&this.hasListeners()){let t=this.#n.variables,i=this.#n.context;e?.type==="success"?(this.#o.onSuccess?.(e.data,t,i),this.#o.onSettled?.(e.data,null,t,i)):e?.type==="error"&&(this.#o.onError?.(e.error,t,i),this.#o.onSettled?.(void 0,e.error,t,i))}this.listeners.forEach(e=>{e(this.#n)})})}},u=i(29827);function h(e,t){let i=(0,u.NL)(t),[s]=r.useState(()=>new l(i,e));r.useEffect(()=>{s.setOptions(e)},[s,e]);let a=r.useSyncExternalStore(r.useCallback(e=>s.subscribe(n.Vr.batchCalls(e)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),h=r.useCallback((e,t)=>{s.mutate(e,t).catch(o.ZT)},[s]);if(a.error&&(0,o.L3)(s.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:h,mutateAsync:a.mutate}}},1109:function(e,t,i){"use strict";function r(e,t){return Object.hasOwn(e,t)}i.d(t,{Z:function(){return q}});class s extends Error{isNetworkError;cause;constructor(e,t){super(e),this.cause=t?.cause,this.cause&&r(this.cause,"isNetworkError")?this.isNetworkError=this.cause.isNetworkError:this.isNetworkError=!1}}class n extends Error{cause;isNetworkError;request;constructor(e,t=null){super("This looks like a network error, the endpoint might be blocked by an internet provider or a firewall."),this.cause=e,this.isNetworkError=!0,this.request=t}}class a extends Error{name="UserFacingApiError"}var o=i(46220);let l=Object.prototype.toString,u=e=>"[object Error]"===l.call(e),h=new Set(["network error","Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Load failed","Network request failed","fetch failed","terminated"]);class d extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=Error(e),this.originalError.stack=this.stack),this.name="AbortError",this.message=e}}let p=(e,t,i)=>{let r=i.retries-(t-1);return e.attemptNumber=t,e.retriesLeft=r,e};async function c(e,t){return new Promise((i,r)=>{t={...t},t.onFailedAttempt??=()=>{},t.shouldRetry??=()=>!0,t.retries??=10;let s=o.operation(t),n=()=>{s.stop(),r(t.signal?.reason)};t.signal&&!t.signal.aborted&&t.signal.addEventListener("abort",n,{once:!0});let a=()=>{t.signal?.removeEventListener("abort",n),s.stop()};s.attempt(async n=>{try{let t=await e(n);a(),i(t)}catch(e){try{if(!(e instanceof Error))throw TypeError(`Non-error was thrown: "${e}". You should only throw errors.`);if(e instanceof d)throw e.originalError;if(e instanceof TypeError&&!(e&&u(e)&&"TypeError"===e.name&&"string"==typeof e.message&&("Load failed"===e.message?void 0===e.stack:h.has(e.message))))throw e;if(p(e,n,t),await t.shouldRetry(e)||(s.stop(),r(e)),await t.onFailedAttempt(e),!s.retry(e))throw s.mainError()}catch(e){p(e,n,t),a(),r(e)}}})})}class f extends Error{isAuthError;constructor(){super("Authorization required"),this.name="AuthError",this.isAuthError=!0}}class g extends Error{statusCode;constructor({statusCode:e,message:t}){super(t),this.name="HttpError",this.statusCode=e}}async function m(e){let t;if(401===e.status)throw new f;if(e.ok)return e.json();let i=`Failed request with status: ${e.status}. ${e.statusText}`;try{(t=await e.json()).message&&(i=`${i} message: ${t.message}`),t.requestId&&(i=`${i} request-Id: ${t.requestId}`)}catch(e){throw Error(i,{cause:e})}if(e.status>=400&&e.status<=499&&t.message)throw new a(t.message);throw new g({statusCode:e.status,message:i})}class y{static VERSION="4.5.1";#h;uppy;opts;constructor(e,t){this.uppy=e,this.opts=t,this.onReceiveResponse=this.onReceiveResponse.bind(this),this.#h=t.companionHeaders}setCompanionHeaders(e){this.#h=e}[Symbol.for("uppy test: getCompanionHeaders")](){return this.#h}get hostname(){let{companion:e}=this.uppy.getState(),t=this.opts.companionUrl;return(e?.[t]?e[t]:t).replace(/\/$/,"")}async headers(e=!1){return{...{Accept:"application/json",...e?void 0:{"Content-Type":"application/json"}},...this.#h}}onReceiveResponse(e){let{headers:t}=e,i=this.uppy.getState().companion||{},r=this.opts.companionUrl;t.has("i-am")&&t.get("i-am")!==i[r]&&this.uppy.setState({companion:{...i,[r]:t.get("i-am")}})}#d(e){return/^(https?:|)\/\//.test(e)?e:`${this.hostname}/${e}`}async request({path:e,method:t="GET",data:i,skipPostResponse:r,signal:a}){try{let s=await this.headers(!i),o=await function(...e){return fetch(...e).catch(e=>{if("AbortError"===e.name)throw e;throw new n(e)})}(this.#d(e),{method:t,signal:a,headers:s,credentials:this.opts.companionCookiesRule||"same-origin",body:i?JSON.stringify(i):null});return r||this.onReceiveResponse(o),await m(o)}catch(i){if(i.isAuthError||"UserFacingApiError"===i.name||"AbortError"===i.name)throw i;throw new s(`Could not ${t} ${this.#d(e)}`,{cause:i})}}async get(e,t){return this.request({...t,path:e})}async post(e,t,i){return this.request({...i,path:e,method:"POST",data:t})}async delete(e,t,i){return this.request({...i,path:e,method:"DELETE",data:t})}async uploadRemoteFile(e,t,i){try{let{signal:r,getQueue:s}=i||{};return await c(async()=>{let i=this.uppy.getFile(e.id)?.serverToken;if(null!=i)return this.uppy.log(`Connecting to exiting websocket ${i}`),this.#p({file:e,queue:s(),signal:r});let n=s().wrapPromiseFunction(async(...e)=>{try{return await this.#c(...e)}catch(t){if(t.isAuthError)throw new d(t);if(null==t.cause)throw t;let e=t.cause;if("HttpError"===e.name&&!([408,409,429,418,423].includes(e.statusCode)||e.statusCode>=500&&e.statusCode<=599&&![501,505].includes(e.statusCode)))throw new d(e);throw e}},{priority:-1}),a=await n({file:e,postBody:t,signal:r}).abortOn(r);if(this.uppy.getFile(e.id))return this.uppy.setFileState(e.id,{serverToken:a}),this.#p({file:this.uppy.getFile(e.id),queue:s(),signal:r})},{retries:10,signal:r,onFailedAttempt:e=>this.uppy.log(`Retrying upload due to: ${e.message}`,"warning")})}catch(t){if("AbortError"===t.name)return;throw this.uppy.emit("upload-error",e,t),t}}#c=async({file:e,postBody:t,signal:i})=>{if(e.remote?.url==null)throw Error("Cannot connect to an undefined URL");return(await this.post(e.remote.url,{...e.remote.body,...t},{signal:i})).token};async #p({file:e,queue:t,signal:i}){let r;let{capabilities:s}=this.uppy.getState();try{return await new Promise((n,a)=>{let o,l,u;let h=e.serverToken,d=function(e){let t=/^(?:https?:\/\/|\/\/)?(?:[^@\n]+@)?([^\n]+)/i.exec(e)?.[1],i=/^http:\/\//i.test(e)?"ws":"wss";return`${i}://${t}`}(e.remote.companionUrl),{isPaused:p}=e,f=(t,i)=>{if(null==o||o.readyState!==o.OPEN){this.uppy.log(`Cannot send "${t}" to socket ${e.id} because the socket state was ${String(o?.readyState)}`,"warning");return}o.send(JSON.stringify({action:t,payload:i??{}}))};function g(){s.resumableUploads&&(p?f("pause"):f("resume"))}let m=async()=>{l&&l.abort(),l=new AbortController;let i=t=>{this.uppy.setFileState(e.id,{serverToken:null}),l?.abort?.(),a(t)};function r(){clearTimeout(u),p||(u=setTimeout(()=>i(Error("Timeout waiting for message from Companion socket")),3e5))}try{await t.wrapPromiseFunction(async()=>{let t=async()=>new Promise((t,s)=>{o=new WebSocket(`${d}/api/${h}`),r(),o.addEventListener("close",()=>{o=void 0,s(Error("Socket closed unexpectedly"))}),o.addEventListener("error",e=>{this.uppy.log(`Companion socket error ${JSON.stringify(e)}, closing socket`,"warning"),o?.close()}),o.addEventListener("open",()=>{g()}),o.addEventListener("message",t=>{r();try{let{action:i,payload:r}=JSON.parse(t.data);switch(i){case"progress":!function(e,t,i){let{progress:r,bytesUploaded:s,bytesTotal:n}=t;r&&(e.uppy.log(`Upload progress: ${r}`),e.uppy.emit("upload-progress",i,{uploadStarted:i.progress.uploadStarted??0,bytesUploaded:s,bytesTotal:n}))}(this,r,this.uppy.getFile(e.id));break;case"success":{let t=r.response?.responseText;this.uppy.emit("upload-success",this.uppy.getFile(e.id),{uploadURL:r.url,status:r.response?.status??200,body:t?JSON.parse(t):void 0}),l?.abort?.(),n();break}case"error":{let{message:e}=r.error;throw Object.assign(Error(e),{cause:r.error})}default:this.uppy.log(`Companion socket unknown action ${i}`,"warning")}}catch(e){i(e)}});let a=()=>{this.uppy.log(`Closing socket ${e.id}`),clearTimeout(u),o&&o.close(),o=void 0};l.signal.addEventListener("abort",()=>{a()})});await c(t,{retries:10,signal:l.signal,onFailedAttempt:()=>{l.signal.aborted||this.uppy.log(`Retrying websocket ${e.id}`)}})})().abortOn(l.signal)}catch(e){if(l.signal.aborted)return;i(e)}},y=e=>{s.resumableUploads&&(p=e,o&&g())},v=t=>{s.individualCancellation&&t.id===e.id&&(f("cancel"),l?.abort?.(),this.uppy.log(`upload ${e.id} was removed`),n())},b=()=>{f("cancel"),l?.abort?.(),this.uppy.log(`upload ${e.id} was canceled`),n()},w=(t,i)=>{t?.id===e.id&&y(i)},_=()=>y(!0),S=()=>y(!1);this.uppy.on("file-removed",v),this.uppy.on("cancel-all",b),this.uppy.on("upload-pause",w),this.uppy.on("pause-all",_),this.uppy.on("resume-all",S),r=()=>{this.uppy.off("file-removed",v),this.uppy.off("cancel-all",b),this.uppy.off("upload-pause",w),this.uppy.off("pause-all",_),this.uppy.off("resume-all",S)},i.addEventListener("abort",()=>{l?.abort()}),m()})}finally{r?.()}}}var v=i(48629);class b{#f;#g=[];constructor(e){this.#f=e}on(e,t){return this.#g.push([e,t]),this.#f.on(e,t)}remove(){for(let[e,t]of this.#g.splice(0))this.#f.off(e,t)}onFilePause(e,t){this.on("upload-pause",(i,r)=>{e===i?.id&&t(r)})}onFileRemove(e,t){this.on("file-removed",i=>{e===i.id&&t(i.id)})}onPause(e,t){this.on("upload-pause",(i,r)=>{e===i?.id&&t(r)})}onRetry(e,t){this.on("upload-retry",i=>{e===i?.id&&t()})}onRetryAll(e,t){this.on("retry-all",()=>{this.#f.getFile(e)&&t()})}onPauseAll(e,t){this.on("pause-all",()=>{this.#f.getFile(e)&&t()})}onCancelAll(e,t){this.on("cancel-all",(...i)=>{this.#f.getFile(e)&&t(...i)})}onResumeAll(e,t){this.on("resume-all",()=>{this.#f.getFile(e)&&t()})}}let{AbortController:w}=globalThis,{AbortSignal:_}=globalThis,S=(e="Aborted",t)=>{let i=new DOMException(e,"AbortError");return null!=t&&r(t,"cause")&&Object.defineProperty(i,"cause",{__proto__:null,configurable:!0,writable:!0,value:t.cause}),i};function C(e,t){return!0===e?Object.keys(t):Array.isArray(e)?e:[]}function P(e){if(null!=e){let t=()=>this.abort(e.reason);e.addEventListener("abort",t,{once:!0});let i=()=>{e.removeEventListener("abort",t)};this.then?.(i,i)}return this}class F{#m=0;#y=[];#v=!1;#b;#w=1;#_;#S;limit;constructor(e){"number"!=typeof e||0===e?this.limit=1/0:this.limit=e}#C(e){let t;this.#m+=1;let i=!1;try{t=e()}catch(e){throw this.#m-=1,e}return{abort:e=>{i||(i=!0,this.#m-=1,t?.(e),this.#P())},done:()=>{i||(i=!0,this.#m-=1,this.#P())}}}#P(){queueMicrotask(()=>this.#F())}#F(){if(this.#v||this.#m>=this.limit||0===this.#y.length)return;let e=this.#y.shift();if(null==e)throw Error("Invariant violation: next is null");let t=this.#C(e.fn);e.abort=t.abort,e.done=t.done}#k(e,t){let i={fn:e,priority:t?.priority||0,abort:()=>{this.#T(i)},done:()=>{throw Error("Cannot mark a queued request as done: this indicates a bug")}},r=this.#y.findIndex(e=>i.priority>e.priority);return -1===r?this.#y.push(i):this.#y.splice(r,0,i),i}#T(e){let t=this.#y.indexOf(e);-1!==t&&this.#y.splice(t,1)}run(e,t){return!this.#v&&this.#m<this.limit?this.#C(e):this.#k(e,t)}wrapSyncFunction(e,t){return(...i)=>{let r=this.run(()=>(e(...i),queueMicrotask(()=>r.done()),()=>{}),t);return{abortOn:P,abort(){r.abort()}}}}wrapPromiseFunction(e,t){return(...i)=>{let r;let s=new Promise((s,n)=>{r=this.run(()=>{let t,a;try{a=Promise.resolve(e(...i))}catch(e){a=Promise.reject(e)}return a.then(e=>{t?n(t):(r.done(),s(e))},e=>{t?n(t):(r.done(),n(e))}),e=>{t=Error("Cancelled",{cause:e})}},t)});return s.abort=e=>{r.abort(e)},s.abortOn=P,s}}resume(){this.#v=!1,clearTimeout(this.#b);for(let e=0;e<this.limit;e++)this.#P()}#E=()=>this.resume();pause(e=null){this.#v=!0,clearTimeout(this.#b),null!=e&&(this.#b=setTimeout(this.#E,e))}rateLimit(e){clearTimeout(this.#S),this.pause(e),this.limit>1&&Number.isFinite(this.limit)&&(this.#_=this.limit-1,this.limit=this.#w,this.#S=setTimeout(this.#A,e))}#A=()=>{if(this.#v){this.#S=setTimeout(this.#A,0);return}this.#w=this.limit,this.limit=Math.ceil((this.#_+this.#w)/2);for(let e=this.#w;e<=this.limit;e++)this.#P();this.#_-this.#w>3?this.#S=setTimeout(this.#A,2e3):this.#w=Math.floor(this.#w/2)};get isPaused(){return this.#v}}Symbol("__queue");let k=new TextEncoder,T={name:"HMAC",hash:"SHA-256"};async function E(e){let{subtle:t}=globalThis.crypto;return t.digest(T.hash,k.encode(e))}async function A(e){let{subtle:t}=globalThis.crypto;return t.importKey("raw","string"==typeof e?k.encode(e):e,T,!1,["sign"])}function x(e){let t=new Uint8Array(e),i="";for(let e=0;e<t.length;e++)i+=t[e].toString(16).padStart(2,"0");return i}async function I(e,t){let{subtle:i}=globalThis.crypto;return i.sign(T,await A(e),k.encode(t))}async function O({accountKey:e,accountSecret:t,sessionToken:i,bucketName:r,Key:s,Region:n,expires:a,uploadId:o,partNumber:l}){let u=`s3.${n}.amazonaws.com`,h=`/${r}/${encodeURI(s).replace(/[;?:@&=+$,#!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}`,d="UNSIGNED-PAYLOAD",p=new Date().toISOString().replace(/[-:]|\.\d+/g,""),c=p.slice(0,8),f=`${c}/${n}/s3/aws4_request`,g=new URL(`https://${u}${h}`);g.searchParams.set("X-Amz-Algorithm","AWS4-HMAC-SHA256"),g.searchParams.set("X-Amz-Content-Sha256",d),g.searchParams.set("X-Amz-Credential",`${e}/${f}`),g.searchParams.set("X-Amz-Date",p),g.searchParams.set("X-Amz-Expires",a),g.searchParams.set("X-Amz-Security-Token",i),g.searchParams.set("X-Amz-SignedHeaders","host"),l&&g.searchParams.set("partNumber",l),o&&g.searchParams.set("uploadId",o),g.searchParams.set("x-id",l&&o?"UploadPart":"PutObject");let m=function({method:e="PUT",CanonicalUri:t="/",CanonicalQueryString:i="",SignedHeaders:r,HashedPayload:s}){let n=Object.keys(r).map(e=>e.toLowerCase()).sort();return[e,t,i,...n.map(e=>`${e}:${r[e]}`),"",n.join(";"),s].join("\n")}({CanonicalUri:h,CanonicalQueryString:g.search.slice(1),SignedHeaders:{host:u},HashedPayload:d}),y=["AWS4-HMAC-SHA256",p,f,x(await E(m))].join("\n"),v=await I(`AWS4${t}`,c),b=await I(v,n),w=await I(b,"s3"),_=await I(w,"aws4_request"),S=x(await I(_,y));return g.searchParams.set("X-Amz-Signature",S),g}let U={getChunkSize:e=>Math.ceil(e.size/1e4),onProgress(){},onPartComplete(){},onSuccess(){},onError(e){throw e}},D=Symbol("pausing upload, not an actual error");class N{options;#x=new w;#I=[];#O=[];#U;#D;#N=!1;#R;#M;#B;#L;#z=e=>e?.cause===D?null:this.#R(e);#$=1e4;#q=5242880;constructor(e,t){this.options={...U,...t},this.options.getChunkSize??=U.getChunkSize,this.#U=e,this.#D=t.file,this.#M=this.options.onSuccess,this.#R=this.options.onError,this.#B=this.options.shouldUseMultipart,this.#L=t.uploadId&&t.key,this.#j()}#j(){let e=this.#U.size,t="function"==typeof this.#B?this.#B(this.#D):!!this.#B;if(t&&e>this.#q){let i=Math.max(this.options.getChunkSize(this.#U),this.#q),r=Math.floor(e/i);r>this.#$&&(r=this.#$,i=e/this.#$),this.#I=Array(r);for(let r=0,s=0;r<e;r+=i,s++){let n=Math.min(e,r+i),a=()=>{let e=r;return this.#U.slice(e,n)};if(this.#I[s]={getData:a,onProgress:this.#H(s),onComplete:this.#V(s),shouldUseMultipart:t},this.#L){let t=r+i>e?e-r:i;this.#I[s].setAsUploaded=()=>{this.#I[s]=null,this.#O[s].uploaded=t}}}}else this.#I=[{getData:()=>this.#U,onProgress:this.#H(0),onComplete:this.#V(0),shouldUseMultipart:t}];this.#O=this.#I.map(()=>({uploaded:0}))}#W(){this.options.companionComm.uploadFile(this.#D,this.#I,this.#x.signal).then(this.#M,this.#z),this.#N=!0}#G(){this.options.companionComm.resumeUploadFile(this.#D,this.#I,this.#x.signal).then(this.#M,this.#z)}#H=e=>t=>{if(!t.lengthComputable)return;this.#O[e].uploaded=function(e){if("string"==typeof e)return parseInt(e,10);if("number"==typeof e)return e;throw TypeError("Expected a number")}(t.loaded);let i=this.#O.reduce((e,t)=>e+t.uploaded,0);this.options.onProgress(i,this.#U.size)};#V=e=>t=>{this.#I[e]=null,this.#O[e].etag=t,this.#O[e].done=!0,this.options.onPartComplete({PartNumber:e+1,ETag:t})};#K(){this.#x.abort(),this.options.companionComm.abortFileUpload(this.#D).catch(e=>this.options.log(e))}start(){this.#N?(this.#x.signal.aborted||this.#x.abort(D),this.#x=new w,this.#G()):this.#L?(this.options.companionComm.restoreUploadFile(this.#D,{uploadId:this.options.uploadId,key:this.options.key}),this.#G()):this.#W()}pause(){this.#x.abort(D),this.#x=new w}abort(e){e?.really?this.#K():this.pause()}[Symbol.for("uppy test: getChunkState")](){return this.#O}}function R(e){if(e?.aborted)throw S("The operation was aborted",{cause:e.reason})}class M{#X;#Z=new WeakMap;#Y;#Q;#J;#ee;#et;#ei;#er;#es;#en;#ea;#eo;constructor(e,t,i,r){this.#ei=e,this.#en=i,this.#eo=r,this.setOptions(t)}setOptions(e){let t=this.#ei;"abortMultipartUpload"in e&&(this.#X=t.wrapPromiseFunction(e.abortMultipartUpload,{priority:1})),"createMultipartUpload"in e&&(this.#Y=t.wrapPromiseFunction(e.createMultipartUpload,{priority:-1})),"signPart"in e&&(this.#Q=t.wrapPromiseFunction(e.signPart)),"listParts"in e&&(this.#ee=t.wrapPromiseFunction(e.listParts)),"completeMultipartUpload"in e&&(this.#es=t.wrapPromiseFunction(e.completeMultipartUpload,{priority:1})),"retryDelays"in e&&(this.#er=e.retryDelays??[]),"uploadPartBytes"in e&&(this.#ea=t.wrapPromiseFunction(e.uploadPartBytes,{priority:1/0})),"getUploadParameters"in e&&(this.#J=t.wrapPromiseFunction(e.getUploadParameters))}async #el(e,t){let i=this.#ei,r=e?.source?.status;if(null==r)return!1;if(403===r&&"Request has expired"===e.message){if(!i.isPaused){if(1===i.limit||null==this.#et){let e=t.next();if(null==e||e.done)return!1;this.#et=e.value}i.rateLimit(0),await new Promise(e=>setTimeout(e,this.#et))}}else if(429===r){if(!i.isPaused){let e=t.next();if(null==e||e.done)return!1;i.rateLimit(e.value)}}else if(r>400&&r<500&&409!==r)return!1;else if("undefined"!=typeof navigator&&!1===navigator.onLine)i.isPaused||(i.pause(),window.addEventListener("online",()=>{i.resume()},{once:!0}));else{let e=t.next();if(null==e||e.done)return!1;await new Promise(t=>setTimeout(t,e.value))}return!0}async getUploadId(e,t){let i;for(;null!=(i=this.#Z.get(e.data));)try{return await i}catch{}let r=this.#Y(this.#eo(e),t),s=()=>{r.abort(t.reason),this.#Z.delete(e.data)};return t.addEventListener("abort",s,{once:!0}),this.#Z.set(e.data,r),r.then(async i=>{t.removeEventListener("abort",s),this.#en(e,i),this.#Z.set(e.data,i)},()=>{t.removeEventListener("abort",s),this.#Z.delete(e.data)}),r}async abortFileUpload(e){let t;let i=this.#Z.get(e.data);if(null!=i){this.#Z.delete(e.data),this.#en(e,Object.create(null));try{t=await i}catch{return}await this.#X(this.#eo(e),t)}}async #eu(e,t,i){let r;let{method:s="POST",url:n,fields:a,headers:o}=await this.#J(this.#eo(e),{signal:i}).abortOn(i),l=t.getData();if("POST"===s.toUpperCase()){let e=new FormData;Object.entries(a).forEach(([t,i])=>e.set(t,i)),e.set("file",l),r=e}else r=l;let{onProgress:u,onComplete:h}=t,d=await this.#ea({signature:{url:n,headers:o,method:s},body:r,size:l.size,onProgress:u,onComplete:h,signal:i}).abortOn(i),p=a?.key;return this.#en(e,{key:p}),{...d,location:d.location??function(e){let t=new URL(e);return t.search="",t.hash="",t.href}(n),bucket:a?.bucket,key:p}}async uploadFile(e,t,i){if(R(i),1===t.length&&!t[0].shouldUseMultipart)return this.#eu(e,t[0],i);let{uploadId:r,key:s}=await this.getUploadId(e,i);R(i);try{let n=await Promise.all(t.map((t,r)=>this.uploadChunk(e,r+1,t,i)));return R(i),await this.#es(this.#eo(e),{key:s,uploadId:r,parts:n,signal:i},i).abortOn(i)}catch(t){throw t?.cause!==D&&t?.name!=="AbortError"&&this.abortFileUpload(e),t}}restoreUploadFile(e,t){this.#Z.set(e.data,t)}async resumeUploadFile(e,t,i){if(R(i),1===t.length&&null!=t[0]&&!t[0].shouldUseMultipart)return this.#eu(e,t[0],i);let{uploadId:r,key:s}=await this.getUploadId(e,i);R(i);let n=await this.#ee(this.#eo(e),{uploadId:r,key:s,signal:i},i).abortOn(i);R(i);let a=await Promise.all(t.map((t,r)=>{let s=r+1,a=n.find(({PartNumber:e})=>e===s);return null==a?this.uploadChunk(e,s,t,i):(t?.setAsUploaded?.(),{PartNumber:s,ETag:a.ETag})}));return R(i),this.#es(this.#eo(e),{key:s,uploadId:r,parts:a,signal:i},i).abortOn(i)}async uploadChunk(e,t,i,r){R(r);let{uploadId:s,key:n}=await this.getUploadId(e,r),a=this.#er.values(),o=this.#er.values(),l=()=>{let e=a.next();return null==e||e.done?null:e.value};for(;;){let a;R(r);let u=i.getData(),{onProgress:h,onComplete:d}=i;try{a=await this.#Q(this.#eo(e),{uploadId:s,key:n,partNumber:t,body:u,signal:r}).abortOn(r)}catch(t){let e=l();if(null==e||r.aborted)throw t;await new Promise(t=>setTimeout(t,e));continue}R(r);try{return{PartNumber:t,...await this.#ea({signature:a,body:u,size:u.size,onProgress:h,onComplete:d,signal:r}).abortOn(r)}}catch(e){if(!await this.#el(e,o))throw e}}}}function B(e){if(e?.error){let t=Error(e.message);throw Object.assign(t,e.error),t}return e}function L(e){let t=e.Expiration;if(t){let e=Math.floor((new Date(t)-Date.now())/1e3);if(e>9)return e}}function z({meta:e,allowedMetaFields:t,querify:i=!1}){let r=t??Object.keys(e);return e?Object.fromEntries(r.filter(t=>null!=e[t]).map(t=>[i?`metadata[${t}]`:t,String(e[t])])):{}}let $={allowedMetaFields:!0,limit:6,getTemporarySecurityCredentials:!1,shouldUseMultipart:e=>(e.size||0)>104857600,retryDelays:[0,1e3,3e3,5e3]};class q extends v.Z{static VERSION="4.3.1";#eh;#s;requests;uploaderEvents;uploaders;constructor(e,t){super(e,{...$,uploadPartBytes:q.uploadPartBytes,createMultipartUpload:null,listParts:null,abortMultipartUpload:null,completeMultipartUpload:null,signPart:null,getUploadParameters:null,...t}),this.type="uploader",this.id=this.opts.id||"AwsS3Multipart",this.#ed(t);let i={createMultipartUpload:this.createMultipartUpload,listParts:this.listParts,abortMultipartUpload:this.abortMultipartUpload,completeMultipartUpload:this.completeMultipartUpload,signPart:t?.getTemporarySecurityCredentials?this.createSignedURL:this.signPart,getUploadParameters:t?.getTemporarySecurityCredentials?this.createSignedURL:this.getUploadParameters};for(let e of Object.keys(i))null==this.opts[e]&&(this.opts[e]=i[e].bind(this));this.requests=this.opts.rateLimitedQueue??new F(this.opts.limit),this.#eh=new M(this.requests,this.opts,this.#en,this.#eo),this.uploaders=Object.create(null),this.uploaderEvents=Object.create(null)}[Symbol.for("uppy test: getClient")](){return this.#s}#ed(e){null!=e&&("endpoint"in e||"companionUrl"in e||"headers"in e||"companionHeaders"in e||"cookiesRule"in e||"companionCookiesRule"in e)&&("companionUrl"in e&&!("endpoint"in e)&&this.uppy.log("`companionUrl` option has been removed in @uppy/aws-s3, use `endpoint` instead.","warning"),"companionHeaders"in e&&!("headers"in e)&&this.uppy.log("`companionHeaders` option has been removed in @uppy/aws-s3, use `headers` instead.","warning"),"companionCookiesRule"in e&&!("cookiesRule"in e)&&this.uppy.log("`companionCookiesRule` option has been removed in @uppy/aws-s3, use `cookiesRule` instead.","warning"),"endpoint"in e?this.#s=new y(this.uppy,{pluginId:this.id,provider:"AWS",companionUrl:this.opts.endpoint,companionHeaders:this.opts.headers,companionCookiesRule:this.opts.cookiesRule}):("headers"in e&&this.#ep(),"cookiesRule"in e&&(this.#s.opts.companionCookiesRule=e.cookiesRule)))}setOptions(e){this.#eh.setOptions(e),super.setOptions(e),this.#ed(e)}resetUploaderReferences(e,t){this.uploaders[e]&&(this.uploaders[e].abort({really:t?.abort||!1}),this.uploaders[e]=null),this.uploaderEvents[e]&&(this.uploaderEvents[e].remove(),this.uploaderEvents[e]=null)}#ec(e){if(!this.#s)throw Error(`Expected a \`endpoint\` option containing a URL, or if you are not using Companion, a custom \`${e}\` implementation.`)}createMultipartUpload(e,t){this.#ec("createMultipartUpload"),R(t);let i=C(this.opts.allowedMetaFields,e.meta),r=z({meta:e.meta,allowedMetaFields:i});return this.#s.post("s3/multipart",{filename:e.name,type:e.type,metadata:r},{signal:t}).then(B)}listParts(e,{key:t,uploadId:i,signal:r},s){r??=s,this.#ec("listParts"),R(r);let n=encodeURIComponent(t);return this.#s.get(`s3/multipart/${encodeURIComponent(i)}?key=${n}`,{signal:r}).then(B)}completeMultipartUpload(e,{key:t,uploadId:i,parts:r,signal:s},n){s??=n,this.#ec("completeMultipartUpload"),R(s);let a=encodeURIComponent(t),o=encodeURIComponent(i);return this.#s.post(`s3/multipart/${o}/complete?key=${a}`,{parts:r.map(({ETag:e,PartNumber:t})=>({ETag:e,PartNumber:t}))},{signal:s}).then(B)}#ef;async #eg(e){if(R(e?.signal),null==this.#ef){let{getTemporarySecurityCredentials:t}=this.opts;!0===t?(this.#ec("getTemporarySecurityCredentials"),this.#ef=this.#s.get("s3/sts",e).then(B)):this.#ef=t(e),this.#ef=await this.#ef,setTimeout(()=>{this.#ef=null},500*(L(this.#ef.credentials)||0))}return this.#ef}async createSignedURL(e,t){let i=await this.#eg(t),r=L(i.credentials)||604800,{uploadId:s,key:n,partNumber:a}=t;return{method:"PUT",expires:r,fields:{},url:`${await O({accountKey:i.credentials.AccessKeyId,accountSecret:i.credentials.SecretAccessKey,sessionToken:i.credentials.SessionToken,expires:r,bucketName:i.bucket,Region:i.region,Key:n??`${crypto.randomUUID()}-${e.name}`,uploadId:s,partNumber:a})}`,headers:{"Content-Type":e.type}}}signPart(e,{uploadId:t,key:i,partNumber:r,signal:s}){if(this.#ec("signPart"),R(s),null==t||null==i||null==r)throw Error("Cannot sign without a key, an uploadId, and a partNumber");let n=encodeURIComponent(i);return this.#s.get(`s3/multipart/${encodeURIComponent(t)}/${r}?key=${n}`,{signal:s}).then(B)}abortMultipartUpload(e,{key:t,uploadId:i,signal:r}){this.#ec("abortMultipartUpload");let s=encodeURIComponent(t),n=encodeURIComponent(i);return this.#s.delete(`s3/multipart/${n}?key=${s}`,void 0,{signal:r}).then(B)}getUploadParameters(e,t){this.#ec("getUploadParameters");let{meta:i}=e,{type:r,name:s}=i,n=new URLSearchParams({filename:s,type:r,...z({meta:i,allowedMetaFields:C(this.opts.allowedMetaFields,e.meta),querify:!0})});return this.#s.get(`s3/params?${n}`,t)}static async uploadPartBytes({signature:{url:e,expires:t,headers:i,method:r="PUT"},body:s,size:n=s.size,onProgress:a,onComplete:o,signal:l}){if(R(l),null==e)throw Error("Cannot upload to an undefined URL");return new Promise((u,h)=>{let d=new XMLHttpRequest;function p(){d.abort()}function c(){l?.removeEventListener("abort",p)}d.open(r,e,!0),i&&Object.keys(i).forEach(e=>{d.setRequestHeader(e,i[e])}),d.responseType="text","number"==typeof t&&(d.timeout=1e3*t),l?.addEventListener("abort",p),d.upload.addEventListener("progress",e=>{a(e)}),d.addEventListener("abort",()=>{c(),h(S())}),d.addEventListener("timeout",()=>{c();let e=Error("Request has expired");e.source={status:403},h(e)}),d.addEventListener("load",()=>{if(c(),403===d.status&&d.responseText.includes("<Message>Request has expired</Message>")){let e=Error("Request has expired");e.source=d,h(e);return}if(d.status<200||d.status>=300){let e=Error("Non 2xx");e.source=d,h(e);return}a?.({loaded:n,lengthComputable:!0});let e=d.getAllResponseHeaders().trim().split(/[\r\n]+/),t={__proto__:null};for(let i of e){let e=i.split(": "),r=e.shift(),s=e.join(": ");t[r]=s}let{etag:i,location:s}=t;if("POST"===r.toUpperCase()&&null==s&&console.error("@uppy/aws-s3: Could not read the Location header. This likely means CORS is not configured correctly on the S3 Bucket. See https://uppy.io/docs/aws-s3/#setting-up-your-s3-bucket"),null==i){console.error("@uppy/aws-s3: Could not read the ETag header. This likely means CORS is not configured correctly on the S3 Bucket. See https://uppy.io/docs/aws-s3/#setting-up-your-s3-bucket");return}o?.(i),u({...t,ETag:i})}),d.addEventListener("error",e=>{c();let t=Error("Unknown error");t.source=e.target,h(t)}),d.send(s)})}#en=(e,{key:t,uploadId:i})=>{let r=this.uppy.getFile(e.id);null!=r&&this.uppy.setFileState(e.id,{s3Multipart:{...r.s3Multipart,key:t,uploadId:i}})};#eo=e=>this.uppy.getFile(e.id)||e;#em(e){return new Promise((t,i)=>{let r=new N(e.data,{companionComm:this.#eh,log:(...e)=>this.uppy.log(...e),getChunkSize:this.opts.getChunkSize?this.opts.getChunkSize.bind(this):void 0,onProgress:(t,i)=>{let r=this.uppy.getFile(e.id);this.uppy.emit("upload-progress",r,{uploadStarted:r.progress.uploadStarted??0,bytesUploaded:t,bytesTotal:i})},onError:t=>{this.uppy.log(t),this.uppy.emit("upload-error",e,t),this.resetUploaderReferences(e.id),i(t)},onSuccess:i=>{let r={body:{...i},status:200,uploadURL:i.location};this.resetUploaderReferences(e.id),this.uppy.emit("upload-success",this.#eo(e),r),i.location&&this.uppy.log(`Download ${e.name} from ${i.location}`),t(void 0)},onPartComplete:t=>{this.uppy.emit("s3-multipart:part-uploaded",this.#eo(e),t)},file:e,shouldUseMultipart:this.opts.shouldUseMultipart,...e.s3Multipart});this.uploaders[e.id]=r;let s=new b(this.uppy);this.uploaderEvents[e.id]=s,s.onFileRemove(e.id,i=>{r.abort(),this.resetUploaderReferences(e.id,{abort:!0}),t(`upload ${i} was removed`)}),s.onCancelAll(e.id,()=>{r.abort(),this.resetUploaderReferences(e.id,{abort:!0}),t(`upload ${e.id} was canceled`)}),s.onFilePause(e.id,e=>{e?r.pause():r.start()}),s.onPauseAll(e.id,()=>{r.pause()}),s.onResumeAll(e.id,()=>{r.start()}),r.start()})}#ey(e){return{...e.remote?.body,protocol:"s3-multipart",size:e.data.size,metadata:e.meta}}#ev=async e=>{if(0===e.length)return;let t=function(e){let t=e=>"error"in e&&!!e.error;return e.filter(e=>!t(e))}(this.uppy.getFilesByIds(e)),i=t.filter(e=>!e.progress?.uploadStarted||!e.isRestored);this.uppy.emit("upload-start",i);let r=t.map(e=>{if(e.isRemote){this.#eb(!1);let t=new AbortController,i=i=>{i.id===e.id&&t.abort()};this.uppy.on("file-removed",i);let r=this.uppy.getRequestClientForFile(e).uploadRemoteFile(e,this.#ey(e),{signal:t.signal,getQueue:()=>this.requests});return this.requests.wrapSyncFunction(()=>{this.uppy.off("file-removed",i)},{priority:-1})(),r}return this.#em(e)}),s=await Promise.allSettled(r);return this.#eb(!0),s};#ep=()=>{this.#s?.setCompanionHeaders(this.opts.headers)};#eb=e=>{let{capabilities:t}=this.uppy.getState();this.uppy.setState({capabilities:{...t,resumableUploads:e}})};#ew=()=>{this.#eb(!0)};install(){this.#eb(!0),this.uppy.addPreProcessor(this.#ep),this.uppy.addUploader(this.#ev),this.uppy.on("cancel-all",this.#ew)}uninstall(){this.uppy.removePreProcessor(this.#ep),this.uppy.removeUploader(this.#ev),this.uppy.off("cancel-all",this.#ew)}}},48629:function(e,t,i){"use strict";i.d(t,{Z:function(){return s}});var r=i(52304);class s{uppy;opts;id;defaultLocale;i18n;i18nArray;type;VERSION;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:{...t,[this.id]:{...t[this.id],...e}}})}setOptions(e){this.opts={...this.opts,...e},this.setPluginState(void 0),this.i18nInit()}i18nInit(){let e=new r.Z([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 Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}update(e){}afterUpdate(){}}},47632:function(e,t,i){"use strict";i.d(t,{Z:function(){return C}});class r{static VERSION="4.3.1";state={};#e_=new Set;getState(){return this.state}setState(e){let t={...this.state},i={...this.state,...e};this.state=i,this.#eS(t,i,e)}subscribe(e){return this.#e_.add(e),()=>{this.#e_.delete(e)}}#eS(...e){this.#e_.forEach(t=>{t(...e)})}}var s=i(72658),n=i(66547),a=i(2925),o=i(52304),l=i(37065),u=i(71157);let h=(e=21)=>{let t="",i=0|e;for(;i--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t};var d={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 p(e){return e<10?`0${e}`:e.toString()}function c(){let e=new Date,t=p(e.getHours()),i=p(e.getMinutes()),r=p(e.getSeconds());return`${t}:${i}:${r}`}let f={debug:()=>{},warn:()=>{},error:(...e)=>console.error(`[Uppy] [${c()}]`,...e)},g={debug:(...e)=>console.debug(`[Uppy] [${c()}]`,...e),warn:(...e)=>console.warn(`[Uppy] [${c()}]`,...e),error:(...e)=>console.error(`[Uppy] [${c()}]`,...e)};var m=i(85110),y=i(67385);let v={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]};class b extends Error{isUserFacing;file;constructor(e,t){super(e),this.isUserFacing=t?.isUserFacing??!0,t?.file&&(this.file=t.file)}isRestriction=!0}class w{getI18n;getOpts;constructor(e,t){this.getI18n=t,this.getOpts=()=>{let t=e();if(t.restrictions?.allowedFileTypes!=null&&!Array.isArray(t.restrictions.allowedFileTypes))throw TypeError("`restrictions.allowedFileTypes` must be an array");return t}}validateAggregateRestrictions(e,t){let{maxTotalFileSize:i,maxNumberOfFiles:r}=this.getOpts().restrictions;if(r&&e.filter(e=>!e.isGhost).length+t.length>r)throw new b(`${this.getI18n()("youCanOnlyUploadX",{smart_count:r})}`);if(i){let r=[...e,...t].reduce((e,t)=>e+(t.size??0),0);if(r>i)throw new b(this.getI18n()("aggregateExceedsSize",{sizeAllowed:m(i),size:m(r)}))}}validateSingleFile(e){let{maxFileSize:t,minFileSize:i,allowedFileTypes:r}=this.getOpts().restrictions;if(r&&!r.some(t=>t.includes("/")?!!e.type&&y(e.type.replace(/;.*?$/,""),t):"."===t[0]&&!!e.extension&&e.extension.toLowerCase()===t.slice(1).toLowerCase())){let t=r.join(", ");throw new b(this.getI18n()("youCanOnlyUploadFileTypes",{types:t}),{file:e})}if(t&&null!=e.size&&e.size>t)throw new b(this.getI18n()("exceedsSize",{size:m(t),file:e.name??this.getI18n()("unnamed")}),{file:e});if(i&&null!=e.size&&e.size<i)throw new b(this.getI18n()("inferiorSize",{size:m(i)}),{file:e})}validate(e,t){t.forEach(e=>{this.validateSingleFile(e)}),this.validateAggregateRestrictions(e,t)}validateMinNumberOfFiles(e){let{minNumberOfFiles:t}=this.getOpts().restrictions;if(t&&Object.keys(e).length<t)throw new b(this.getI18n()("youHaveToAtLeastSelectX",{smart_count:t}))}getMissingRequiredMetaFields(e){let t=new b(this.getI18n()("missingRequiredMetaFieldOnFile",{fileName:e.name??this.getI18n()("unnamed")})),{requiredMetaFields:i}=this.getOpts().restrictions,r=[];for(let t of i)Object.hasOwn(e.meta,t)&&""!==e.meta[t]||r.push(t);return{missingFields:r,error:t}}}let _={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null};class S{static VERSION="4.5.1";#eC=Object.create(null);#eP;#eF;#ek=u();#eT=new Set;#eE=new Set;#eA=new Set;defaultLocale;locale;opts;store;i18n;i18nArray;scheduledAutoProceed=null;wasOffline=!1;constructor(e){this.defaultLocale=d;let t={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:v,meta:{},onBeforeFileAdded:(e,t)=>!Object.hasOwn(t,e.id),onBeforeUpload:e=>e,store:new r,logger:f,infoTimeout:5e3},i={...t,...e};this.opts={...i,restrictions:{...t.restrictions,...e?.restrictions}},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?.debug&&(this.opts.logger=g),this.log(`Using Core v${S.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState({..._,plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:function(e){if(null==e&&"undefined"!=typeof navigator&&(e=navigator.userAgent),!e)return!0;let t=/Edge\/(\d+\.\d+)/.exec(e);if(!t)return!0;let i=t[1].split(".",2),r=parseInt(i[0],10),s=parseInt(i[1],10);return r<15||15===r&&s<15063||r>18||18===r&&s>=18218}(),individualCancellation:!0,resumableUploads:!1},meta:{...this.opts.meta},info:[]}),this.#eP=new w(()=>this.opts,()=>this.i18n),this.#eF=this.store.subscribe((e,t,i)=>{this.emit("state-update",e,t,i),this.updateAll(t)}),this.opts.debug&&"undefined"!=typeof window&&(window[this.opts.id]=this),this.#ex()}emit(e,...t){this.#ek.emit(e,...t)}on(e,t){return this.#ek.on(e,t),this}once(e,t){return this.#ek.once(e,t),this}off(e,t){return this.#ek.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:{...t,...Object.fromEntries(Object.entries(e).map(([e,i])=>[e,{...t[e],...i}]))}})}setFileState(e,t){if(!this.getState().files[e])throw Error(`Can’t set state for ${e} (the file could have been removed)`);this.patchFilesState({[e]:t})}i18nInit(){let e=new o.Z([this.defaultLocale,this.opts.locale],{onMissingKey:e=>this.log(`Missing i18n string: ${e}`,"error")});this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.locale=e.locale}setOptions(e){this.opts={...this.opts,...e,restrictions:{...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={...this.getState().files},i=Object.create(null);Object.keys(t).forEach(r=>{i[r]={...t[r],progress:{...t[r].progress,...e},tus:void 0,transloadit:void 0}}),this.setState({files:i,..._})}clear(){let{capabilities:e,currentUploads:t}=this.getState();if(Object.keys(t).length>0&&!e.individualCancellation)throw Error("The installed uploader plugin does not allow removing files during an upload.");this.setState({..._,files:{}})}addPreProcessor(e){this.#eT.add(e)}removePreProcessor(e){return this.#eT.delete(e)}addPostProcessor(e){this.#eA.add(e)}removePostProcessor(e){return this.#eA.delete(e)}addUploader(e){this.#eE.add(e)}removeUploader(e){return this.#eE.delete(e)}setMeta(e){let t={...this.getState().meta,...e},i={...this.getState().files};Object.keys(i).forEach(t=>{i[t]={...i[t],meta:{...i[t].meta,...e}}}),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:i})}setFileMeta(e,t){let i={...this.getState().files};if(!i[e]){this.log(`Was trying to set metadata for a file that has been removed: ${e}`);return}let r={...i[e].meta,...t};i[e]={...i[e],meta:r},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(e=>this.getFile(e))}getObjectOfFilesPerState(){let{files:e,totalProgress:t,error:i}=this.getState(),r=Object.values(e),s=[],n=[],a=[],o=[],l=[],u=[],h=[],d=[],p=[];for(let e of r){let{progress:t}=e;t.uploadComplete||!t.uploadStarted||(s.push(e),e.isPaused||d.push(e)),t.uploadStarted||n.push(e),(t.uploadStarted||t.preprocess||t.postprocess)&&a.push(e),t.uploadStarted&&o.push(e),e.isPaused&&l.push(e),t.uploadComplete&&u.push(e),e.error&&h.push(e),(t.preprocess||t.postprocess)&&p.push(e)}return{newFiles:n,startedFiles:a,uploadStartedFiles:o,pausedFiles:l,completeFiles:u,erroredFiles:h,inProgressFiles:s,inProgressNotPausedFiles:d,processingFiles:p,isUploadStarted:o.length>0,isAllComplete:100===t&&u.length===r.length&&0===p.length,isAllErrored:!!i&&h.length===r.length,isAllPaused:0!==s.length&&l.length===s.length,isUploadInProgress:s.length>0,isSomeGhost:r.some(e=>e.isGhost)}}#eI(e){for(let t of e)t.isRestriction?this.emit("restriction-failed",t.file,t):this.emit("error",t,t.file),this.log(t,"warning");let t=e.filter(e=>e.isUserFacing),i=t.slice(0,4),r=t.slice(4);i.forEach(({message:e,details:t=""})=>{this.info({message:e,details:t},"error",this.opts.infoTimeout)}),r.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:r.length})})}validateRestrictions(e,t=this.getFiles()){try{this.#eP.validate(t,[e])}catch(e){return e}return null}validateSingleFile(e){try{this.#eP.validateSingleFile(e)}catch(e){return e.message}return null}validateAggregateRestrictions(e){let t=this.getFiles();try{this.#eP.validateAggregateRestrictions(t,e)}catch(e){return e.message}return null}#eO(e){let{missingFields:t,error:i}=this.#eP.getMissingRequiredMetaFields(e);return t.length>0?(this.setFileState(e.id,{missingRequiredMetaFields:t}),this.log(i.message),this.emit("restriction-failed",e,i),!1):(0===t.length&&e.missingRequiredMetaFields&&this.setFileState(e.id,{missingRequiredMetaFields:[]}),!0)}#eU(e){let t=!0;for(let i of Object.values(e))this.#eO(i)||(t=!1);return t}#eD(e){let{allowNewUpload:t}=this.getState();if(!1===t){let t=new b(this.i18n("noMoreFilesAllowed"),{file:e});throw this.#eI([t]),t}}checkIfFileAlreadyExists(e){let{files:t}=this.getState();return!!t[e]&&!t[e].isGhost}#eN(e){let t=e instanceof File?{name:e.name,type:e.type,size:e.size,data:e}:e,i=(0,a.Z)(t),r=t.name?t.name:"image"===i.split("/")[0]?`${i.split("/")[0]}.${i.split("/")[1]}`:"noname",o=(0,n.Z)(r).extension,l=(0,s.H)(t,this.getID()),u=t.meta||{};u.name=r,u.type=i;let h=Number.isFinite(t.data.size)?t.data.size:null;return{source:t.source||"",id:l,name:r,extension:o||"",meta:{...this.getState().meta,...u},type:i,data:t.data,progress:{percentage:0,bytesUploaded:!1,bytesTotal:h,uploadComplete:!1,uploadStarted:null},size:h,isGhost:!1,isRemote:t.isRemote||!1,remote:t.remote,preview:t.preview}}#eR(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(e=>{e.isRestriction||this.log(e.stack||e.message||e)})},4))}#eM(e){let{files:t}=this.getState(),i={...t},r=[],s=[];for(let n of e)try{let e=this.#eN(n),s=t[e.id]?.isGhost;s&&(e={...t[e.id],isGhost:!1,data:n.data},this.log(`Replaced the blob in the restored ghost file: ${e.name}, ${e.id}`));let a=this.opts.onBeforeFileAdded(e,i);if(i={...t=this.getState().files,...i},!a&&this.checkIfFileAlreadyExists(e.id))throw new b(this.i18n("noDuplicates",{fileName:e.name??this.i18n("unnamed")}),{file:n});if(!1!==a||s)"object"==typeof a&&null!==a&&(e=a);else throw new b("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:n});this.#eP.validateSingleFile(e),i[e.id]=e,r.push(e)}catch(e){s.push(e)}try{this.#eP.validateAggregateRestrictions(Object.values(t),r)}catch(e){return s.push(e),{nextFilesState:t,validFilesToAdd:[],errors:s}}return{nextFilesState:i,validFilesToAdd:r,errors:s}}addFile(e){this.#eD(e);let{nextFilesState:t,validFilesToAdd:i,errors:r}=this.#eM([e]),s=r.filter(e=>e.isRestriction);if(this.#eI(s),r.length>0)throw r[0];this.setState({files:t});let[n]=i;return this.emit("file-added",n),this.emit("files-added",i),this.log(`Added file: ${n.name}, ${n.id}, mime type: ${n.type}`),this.#eR(),n.id}addFiles(e){this.#eD();let{nextFilesState:t,validFilesToAdd:i,errors:r}=this.#eM(e),s=r.filter(e=>e.isRestriction);this.#eI(s);let n=r.filter(e=>!e.isRestriction);if(n.length>0){let e="Multiple errors occurred while adding files:\n";if(n.forEach(t=>{e+=`
|
|
2
2
|
* ${t.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:n.length}),details:e},"error",this.opts.infoTimeout),"function"==typeof AggregateError)throw AggregateError(n,e);{let t=Error(e);throw t.errors=n,t}}this.setState({files:t}),i.forEach(e=>{this.emit("file-added",e)}),this.emit("files-added",i),i.length>5?this.log(`Added batch of ${i.length} files`):Object.values(i).forEach(e=>{this.log(`Added file: ${e.name}
|
|
3
3
|
id: ${e.id}
|
|
4
|
-
type: ${e.type}`)}),i.length>0&&this.#
|
|
5
|
-
Uppy plugins must have unique \`id\` options.`);return e.VERSION&&this.log(`Using ${r} v${e.VERSION}`),i.type in this.#eC?this.#eC[i.type].push(i):this.#eC[i.type]=[i],i.install(),this.emit("plugin-added",i),this}getPlugin(e){for(let t of Object.values(this.#eC)){let i=t.find(t=>t.id===e);if(null!=i)return i}}[Symbol.for("uppy test: getPlugins")](e){return this.#eC[e]}iteratePlugins(e){Object.values(this.#eC).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();let t=this.#eC[e.type],i=t.findIndex(t=>t.id===e.id);-1!==i&&t.splice(i,1);let r={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(r)}destroy(){this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll(),this.#eF(),this.iteratePlugins(e=>{this.removePlugin(e)}),"undefined"!=typeof window&&window.removeEventListener&&(window.removeEventListener("online",this.#eV),window.removeEventListener("offline",this.#eV))}hideInfo(){let{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,t="info",i=3e3){let r="object"==typeof e;this.setState({info:[...this.getState().info,{type:t,message:r?e.message:e,details:r?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)}}#eW=new Map;registerRequestClient(e,t){this.#eW.set(e,t)}getRequestClientForFile(e){if(!e.remote)throw Error(`Tried to get RequestClient for a non-remote file ${e.id}`);let t=this.#eW.get(e.remote.requestClientId);if(null==t)throw 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])?this.#e$(e):(this.#eG(e),Promise.reject(Error("Nonexistent upload")))}#W(e,t={}){let{forceAllowNewUpload:i=!1}=t,{allowNewUpload:r,currentUploads:s}=this.getState();if(!r&&!i)throw Error("Cannot create a new upload: already uploading.");let n=h();return this.emit("upload",n,this.getFilesByIds(e)),this.setState({allowNewUpload:!1!==this.opts.allowMultipleUploadBatches&&!1!==this.opts.allowMultipleUploads,currentUploads:{...s,[n]:{fileIDs:e,step:0,result:{}}}}),n}[Symbol.for("uppy test: createUpload")](...e){return this.#W(...e)}#eK(e){let{currentUploads:t}=this.getState();return t[e]}addResultData(e,t){if(!this.#eK(e)){this.log(`Not setting result for an upload that has been removed: ${e}`);return}let{currentUploads:i}=this.getState(),r={...i[e],result:{...i[e].result,...t}};this.setState({currentUploads:{...i,[e]:r}})}#eG(e){let t={...this.getState().currentUploads};delete t[e],this.setState({currentUploads:t})}async #e$(e){let t;let i=()=>{let{currentUploads:t}=this.getState();return t[e]},r=i(),s=[...this.#eT,...this.#eE,...this.#eA];try{for(let t=r.step||0;t<s.length&&r;t++){let n=s[t];this.setState({currentUploads:{...this.getState().currentUploads,[e]:{...r,step:t}}});let{fileIDs:a}=r;await n(a,e),r=i()}}catch(t){throw this.#eG(e),t}if(r){r.fileIDs.forEach(e=>{let t=this.getFile(e);t?.progress.postprocess&&this.emit("postprocess-complete",t)});let t=r.fileIDs.map(e=>this.getFile(e)),s=t.filter(e=>!e.error),n=t.filter(e=>e.error);this.addResultData(e,{successful:s,failed:n,uploadID:e}),r=i()}return r&&(t=r.result,this.#eG(e)),null==t&&(this.log(`Not setting result for an upload that has been removed: ${e}`),t={successful:[],failed:[],uploadID:e}),t}async upload(){this.#eC.uploader?.length||this.log("No uploader type plugins are used","warning");let{files:e}=this.getState();if(this.#eL().length>0){let t=await this.#ez();if(!(this.getFiles().filter(e=>null==e.progress.uploadStarted).length>0))return this.emit("complete",t),t;({files:e}=this.getState())}let t=this.opts.onBeforeUpload(e);return!1===t?Promise.reject(Error("Not starting the upload because onBeforeUpload returned false")):(t&&"object"==typeof t&&(e=t,this.setState({files:e})),Promise.resolve().then(()=>this.#eP.validateMinNumberOfFiles(e)).catch(e=>{throw this.#eI([e]),e}).then(()=>{if(!this.#eO(e))throw new b(this.i18n("missingRequiredMetaField"))}).catch(e=>{throw e}).then(async()=>{let{currentUploads:t}=this.getState(),i=Object.values(t).flatMap(e=>e.fileIDs),r=[];Object.keys(e).forEach(e=>{let t=this.getFile(e);t.progress.uploadStarted||-1!==i.indexOf(e)||r.push(t.id)});let s=this.#W(r),n=await this.#e$(s);return this.emit("complete",n),n}).catch(e=>{throw this.emit("error",e),this.log(e,"error"),e}))}}var C=S},80007:function(e,t,i){"use strict";let r;function s(e){return"object"==typeof e&&null!==e&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}i.d(t,{A:function(){return se}});var n,a,o,l,u,h,p,d,c,f,g=function(e){for(;e&&!e.dir;)e=e.parentNode;return e?.dir},m={},y=[],v=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,b=Array.isArray;function w(e,t){for(var i in t)e[i]=t[i];return e}function _(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function S(e,t,i){var r,s,a,o={};for(a in t)"key"==a?r=t[a]:"ref"==a?s=t[a]:o[a]=t[a];if(arguments.length>2&&(o.children=arguments.length>3?n.call(arguments,2):i),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===o[a]&&(o[a]=e.defaultProps[a]);return C(e,o,r,s,null)}function C(e,t,i,r,s){var n={type:e,props:t,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==s?++o:s,__i:-1,__u:0};return null==s&&null!=a.vnode&&a.vnode(n),n}function P(e){return e.children}function F(e,t){this.props=e,this.context=t}function k(e,t){if(null==t)return e.__?k(e.__,e.__i+1):null;for(var i;t<e.__k.length;t++)if(null!=(i=e.__k[t])&&null!=i.__e)return i.__e;return"function"==typeof e.type?k(e):null}function T(e){(!e.__d&&(e.__d=!0)&&l.push(e)&&!E.__r++||u!==a.debounceRendering)&&((u=a.debounceRendering)||h)(E)}function E(){var e,t,i,r,s,n,o,u;for(l.sort(p);e=l.shift();)e.__d&&(t=l.length,r=void 0,n=(s=(i=e).__v).__e,o=[],u=[],i.__P&&((r=w({},s)).__v=s.__v+1,a.vnode&&a.vnode(r),D(i.__P,r,s,i.__n,i.__P.namespaceURI,32&s.__u?[n]:null,o,null==n?k(s):n,!!(32&s.__u),u),r.__v=s.__v,r.__.__k[r.__i]=r,R(o,r,u),r.__e!=n&&function e(t){var i,r;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,i=0;i<t.__k.length;i++)if(null!=(r=t.__k[i])&&null!=r.__e){t.__e=t.__c.base=r.__e;break}return e(t)}}(r)),l.length>t&&l.sort(p));E.__r=0}function A(e,t,i,r,s,n,o,l,u,h,p){var d,c,f,g,v,w=r&&r.__k||y,S=t.length;for(i.__d=u,function(e,t,i){var r,s,n,o,l,u=t.length,h=i.length,p=h,d=0;for(e.__k=[],r=0;r<u;r++)null!=(s=t[r])&&"boolean"!=typeof s&&"function"!=typeof s?(o=r+d,(s=e.__k[r]="string"==typeof s||"number"==typeof s||"bigint"==typeof s||s.constructor==String?C(null,s,null,null,null):b(s)?C(P,{children:s},null,null,null):void 0===s.constructor&&s.__b>0?C(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=e,s.__b=e.__b+1,n=null,-1!==(l=s.__i=function(e,t,i,r){var s=e.key,n=e.type,a=i-1,o=i+1,l=t[i];if(null===l||l&&s==l.key&&n===l.type&&0==(131072&l.__u))return i;if(r>(null!=l&&0==(131072&l.__u)?1:0))for(;a>=0||o<t.length;){if(a>=0){if((l=t[a])&&0==(131072&l.__u)&&s==l.key&&n===l.type)return a;a--}if(o<t.length){if((l=t[o])&&0==(131072&l.__u)&&s==l.key&&n===l.type)return o;o++}}return -1}(s,i,o,p))&&(p--,(n=i[l])&&(n.__u|=131072)),null==n||null===n.__v?(-1==l&&d--,"function"!=typeof s.type&&(s.__u|=65536)):l!==o&&(l==o-1?d--:l==o+1?d++:(l>o?d--:d++,s.__u|=65536))):s=e.__k[r]=null;if(p)for(r=0;r<h;r++)null!=(n=i[r])&&0==(131072&n.__u)&&(n.__e==e.__d&&(e.__d=k(n)),function e(t,i,r){var s,n;if(a.unmount&&a.unmount(t),(s=t.ref)&&(s.current&&s.current!==t.__e||N(s,null,i)),null!=(s=t.__c)){if(s.componentWillUnmount)try{s.componentWillUnmount()}catch(e){a.__e(e,i)}s.base=s.__P=null}if(s=t.__k)for(n=0;n<s.length;n++)s[n]&&e(s[n],i,r||"function"!=typeof t.type);r||_(t.__e),t.__c=t.__=t.__e=t.__d=void 0}(n,n))}(i,t,w),u=i.__d,d=0;d<S;d++)null!=(f=i.__k[d])&&(c=-1===f.__i?m:w[f.__i]||m,f.__i=d,D(e,f,c,s,n,o,l,u,h,p),g=f.__e,f.ref&&c.ref!=f.ref&&(c.ref&&N(c.ref,null,f),p.push(f.ref,f.__c||g,f)),null==v&&null!=g&&(v=g),65536&f.__u||c.__k===f.__k?u=function e(t,i,r){var s,n;if("function"==typeof t.type){for(s=t.__k,n=0;s&&n<s.length;n++)s[n]&&(s[n].__=t,i=e(s[n],i,r));return i}t.__e!=i&&(i&&t.type&&!r.contains(i)&&(i=k(t)),r.insertBefore(t.__e,i||null),i=t.__e);do i=i&&i.nextSibling;while(null!=i&&8===i.nodeType);return i}(f,u,e):"function"==typeof f.type&&void 0!==f.__d?u=f.__d:g&&(u=g.nextSibling),f.__d=void 0,f.__u&=-196609);i.__d=u,i.__e=v}function x(e,t){return t=t||[],null==e||"boolean"==typeof e||(b(e)?e.some(function(e){x(e,t)}):t.push(e)),t}function I(e,t,i){"-"===t[0]?e.setProperty(t,null==i?"":i):e[t]=null==i?"":"number"!=typeof i||v.test(t)?i:i+"px"}function U(e,t,i,r,s){var n;e:if("style"===t){if("string"==typeof i)e.style.cssText=i;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)i&&t in i||I(e.style,t,"");if(i)for(t in i)r&&i[t]===r[t]||I(e.style,t,i[t])}}else if("o"===t[0]&&"n"===t[1])n=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase() in e||"onFocusOut"===t||"onFocusIn"===t?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+n]=i,i?r?i.u=r.u:(i.u=d,e.addEventListener(t,n?f:c,n)):e.removeEventListener(t,n?f:c,n);else{if("http://www.w3.org/2000/svg"==s)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==i?"":i;break e}catch(e){}"function"==typeof i||(null==i||!1===i&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==i?"":i))}}function O(e){return function(t){if(this.l){var i=this.l[t.type+e];if(null==t.t)t.t=d++;else if(t.t<i.u)return;return i(a.event?a.event(t):t)}}}function D(e,t,i,r,s,o,l,u,h,p){var d,c,f,g,y,v,S,C,T,E,x,I,O,D,R,N,B=t.type;if(void 0!==t.constructor)return null;128&i.__u&&(h=!!(32&i.__u),o=[u=t.__e=i.__e]),(d=a.__b)&&d(t);e:if("function"==typeof B)try{if(C=t.props,T="prototype"in B&&B.prototype.render,E=(d=B.contextType)&&r[d.__c],x=d?E?E.props.value:d.__:r,i.__c?S=(c=t.__c=i.__c).__=c.__E:(T?t.__c=c=new B(C,x):(t.__c=c=new F(C,x),c.constructor=B,c.render=M),E&&E.sub(c),c.props=C,c.state||(c.state={}),c.context=x,c.__n=r,f=c.__d=!0,c.__h=[],c._sb=[]),T&&null==c.__s&&(c.__s=c.state),T&&null!=B.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=w({},c.__s)),w(c.__s,B.getDerivedStateFromProps(C,c.__s))),g=c.props,y=c.state,c.__v=t,f)T&&null==B.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),T&&null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(T&&null==B.getDerivedStateFromProps&&C!==g&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(C,x),!c.__e&&(null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(C,c.__s,x)||t.__v===i.__v)){for(t.__v!==i.__v&&(c.props=C,c.state=c.__s,c.__d=!1),t.__e=i.__e,t.__k=i.__k,t.__k.some(function(e){e&&(e.__=t)}),I=0;I<c._sb.length;I++)c.__h.push(c._sb[I]);c._sb=[],c.__h.length&&l.push(c);break e}null!=c.componentWillUpdate&&c.componentWillUpdate(C,c.__s,x),T&&null!=c.componentDidUpdate&&c.__h.push(function(){c.componentDidUpdate(g,y,v)})}if(c.context=x,c.props=C,c.__P=e,c.__e=!1,O=a.__r,D=0,T){for(c.state=c.__s,c.__d=!1,O&&O(t),d=c.render(c.props,c.state,c.context),R=0;R<c._sb.length;R++)c.__h.push(c._sb[R]);c._sb=[]}else do c.__d=!1,O&&O(t),d=c.render(c.props,c.state,c.context),c.state=c.__s;while(c.__d&&++D<25);c.state=c.__s,null!=c.getChildContext&&(r=w(w({},r),c.getChildContext())),T&&!f&&null!=c.getSnapshotBeforeUpdate&&(v=c.getSnapshotBeforeUpdate(g,y)),A(e,b(N=null!=d&&d.type===P&&null==d.key?d.props.children:d)?N:[N],t,i,r,s,o,l,u,h,p),c.base=t.__e,t.__u&=-161,c.__h.length&&l.push(c),S&&(c.__E=c.__=null)}catch(e){if(t.__v=null,h||null!=o){for(t.__u|=h?160:128;u&&8===u.nodeType&&u.nextSibling;)u=u.nextSibling;o[o.indexOf(u)]=null,t.__e=u}else t.__e=i.__e,t.__k=i.__k;a.__e(e,t,i)}else null==o&&t.__v===i.__v?(t.__k=i.__k,t.__e=i.__e):t.__e=function(e,t,i,r,s,o,l,u,h){var p,d,c,f,g,y,v,w=i.props,S=t.props,C=t.type;if("svg"===C?s="http://www.w3.org/2000/svg":"math"===C?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),null!=o){for(p=0;p<o.length;p++)if((g=o[p])&&"setAttribute"in g==!!C&&(C?g.localName===C:3===g.nodeType)){e=g,o[p]=null;break}}if(null==e){if(null===C)return document.createTextNode(S);e=document.createElementNS(s,C,S.is&&S),u&&(a.__m&&a.__m(t,o),u=!1),o=null}if(null===C)w===S||u&&e.data===S||(e.data=S);else{if(o=o&&n.call(e.childNodes),w=i.props||m,!u&&null!=o)for(w={},p=0;p<e.attributes.length;p++)w[(g=e.attributes[p]).name]=g.value;for(p in w)if(g=w[p],"children"==p);else if("dangerouslySetInnerHTML"==p)c=g;else if(!(p in S)){if("value"==p&&"defaultValue"in S||"checked"==p&&"defaultChecked"in S)continue;U(e,p,null,g,s)}for(p in S)g=S[p],"children"==p?f=g:"dangerouslySetInnerHTML"==p?d=g:"value"==p?y=g:"checked"==p?v=g:u&&"function"!=typeof g||w[p]===g||U(e,p,g,w[p],s);if(d)u||c&&(d.__html===c.__html||d.__html===e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(c&&(e.innerHTML=""),A(e,b(f)?f:[f],t,i,r,"foreignObject"===C?"http://www.w3.org/1999/xhtml":s,o,l,o?o[0]:i.__k&&k(i,0),u,h),null!=o)for(p=o.length;p--;)_(o[p]);u||(p="value","progress"===C&&null==y?e.removeAttribute("value"):void 0===y||y===e[p]&&("progress"!==C||y)&&("option"!==C||y===w[p])||U(e,p,y,w[p],s),p="checked",void 0!==v&&v!==e[p]&&U(e,p,v,w[p],s))}return e}(i.__e,t,i,r,s,o,l,h,p);(d=a.diffed)&&d(t)}function R(e,t,i){t.__d=void 0;for(var r=0;r<i.length;r++)N(i[r],i[++r],i[++r]);a.__c&&a.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){a.__e(e,t.__v)}})}function N(e,t,i){try{if("function"==typeof e){var r="function"==typeof e.__u;r&&e.__u(),r&&null==t||(e.__u=e(t))}else e.current=t}catch(e){a.__e(e,i)}}function M(e,t,i){return this.constructor(e,i)}function B(e,t,i){var r,s,a,o,l=w({},e.props);for(a in e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)"key"==a?r=t[a]:"ref"==a?s=t[a]:l[a]=void 0===t[a]&&void 0!==o?o[a]:t[a];return arguments.length>2&&(l.children=arguments.length>3?n.call(arguments,2):i),C(e.type,l,r||e.key,s||e.ref,null)}n=y.slice,a={__e:function(e,t,i,r){for(var s,n,a;t=t.__;)if((s=t.__c)&&!s.__)try{if((n=s.constructor)&&null!=n.getDerivedStateFromError&&(s.setState(n.getDerivedStateFromError(e)),a=s.__d),null!=s.componentDidCatch&&(s.componentDidCatch(e,r||{}),a=s.__d),a)return s.__E=s}catch(t){e=t}throw e}},o=0,F.prototype.setState=function(e,t){var i;i=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=w({},this.state),"function"==typeof e&&(e=e(w({},i),this.props)),e&&w(i,e),null!=e&&this.__v&&(t&&this._sb.push(t),T(this))},F.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),T(this))},F.prototype.render=P,l=[],h="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,p=function(e,t){return e.__v.__b-t.__v.__b},E.__r=0,d=0,c=O(!1),f=O(!0);var L,z,$,q,H=0,j=[],V=a,W=V.__b,G=V.__r,K=V.diffed,X=V.__c,Z=V.unmount,Y=V.__;function Q(e,t){V.__h&&V.__h(z,e,H||t),H=0;var i=z.__H||(z.__H={__:[],__h:[]});return e>=i.__.length&&i.__.push({}),i.__[e]}function J(e){return H=1,function(e,t,i){var r=Q(L++,2);if(r.t=e,!r.__c&&(r.__=[eu(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],i=r.t(t,e);t!==i&&(r.__N=[i,r.__[1]],r.__c.setState({}))}],r.__c=z,!z.u)){var s=function(e,t,i){if(!r.__c.__H)return!0;var s=r.__c.__H.__.filter(function(e){return!!e.__c});if(s.every(function(e){return!e.__N}))return!n||n.call(this,e,t,i);var a=!1;return s.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(a=!0)}}),!(!a&&r.__c.props===e)&&(!n||n.call(this,e,t,i))};z.u=!0;var n=z.shouldComponentUpdate,a=z.componentWillUpdate;z.componentWillUpdate=function(e,t,i){if(this.__e){var r=n;n=void 0,s(e,t,i),n=r}a&&a.call(this,e,t,i)},z.shouldComponentUpdate=s}return r.__N||r.__}(eu,e)}function ee(e,t){var i=Q(L++,3);!V.__s&&el(i.__H,t)&&(i.__=e,i.i=t,z.__H.__h.push(i))}function et(e){return H=5,ei(function(){return{current:e}},[])}function ei(e,t){var i=Q(L++,7);return el(i.__H,t)&&(i.__=e(),i.__H=t,i.__h=e),i.__}function er(e,t){return H=8,ei(function(){return e},t)}function es(){for(var e;e=j.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(ea),e.__H.__h.forEach(eo),e.__H.__h=[]}catch(t){e.__H.__h=[],V.__e(t,e.__v)}}V.__b=function(e){z=null,W&&W(e)},V.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Y&&Y(e,t)},V.__r=function(e){G&&G(e),L=0;var t=(z=e.__c).__H;t&&($===z?(t.__h=[],z.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.i=e.__N=void 0})):(t.__h.forEach(ea),t.__h.forEach(eo),t.__h=[],L=0)),$=z},V.diffed=function(e){K&&K(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==j.push(t)&&q===V.requestAnimationFrame||((q=V.requestAnimationFrame)||function(e){var t,i=function(){clearTimeout(r),en&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(i,100);en&&(t=requestAnimationFrame(i))})(es)),t.__H.__.forEach(function(e){e.i&&(e.__H=e.i),e.i=void 0})),$=z=null},V.__c=function(e,t){t.some(function(e){try{e.__h.forEach(ea),e.__h=e.__h.filter(function(e){return!e.__||eo(e)})}catch(i){t.some(function(e){e.__h&&(e.__h=[])}),t=[],V.__e(i,e.__v)}}),X&&X(e,t)},V.unmount=function(e){Z&&Z(e);var t,i=e.__c;i&&i.__H&&(i.__H.__.forEach(function(e){try{ea(e)}catch(e){t=e}}),i.__H=void 0,t&&V.__e(t,i.__v))};var en="function"==typeof requestAnimationFrame;function ea(e){var t=z,i=e.__c;"function"==typeof i&&(e.__c=void 0,i()),z=t}function eo(e){var t=z;e.__c=e.__(),z=t}function el(e,t){return!e||e.length!==t.length||t.some(function(t,i){return t!==e[i]})}function eu(e,t){return"function"==typeof t?t(e):t}function eh(e,t){for(var i in e)if("__source"!==i&&!(i in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function ep(e,t){this.props=e,this.context=t}(ep.prototype=new F).isPureReactComponent=!0,ep.prototype.shouldComponentUpdate=function(e,t){return eh(this.props,e)||eh(this.state,t)};var ed=a.__b;a.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),ed&&ed(e)},"undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref");var ec=a.__e;a.__e=function(e,t,i,r){if(e.then){for(var s,n=t;n=n.__;)if((s=n.__c)&&s.__c)return null==t.__e&&(t.__e=i.__e,t.__k=i.__k),s.__c(e,t)}ec(e,t,i,r)};var ef=a.unmount;function eg(){this.__u=0,this.t=null,this.__b=null}function em(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function ey(){this.u=null,this.o=null}a.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),ef&&ef(e)},(eg.prototype=new F).__c=function(e,t){var i=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(i);var s=em(r.__v),n=!1,a=function(){n||(n=!0,i.__R=null,s?s(o):o())};i.__R=a;var o=function(){if(!--r.__u){if(r.state.__a){var e,t=r.state.__a;r.__v.__k[0]=function e(t,i,r){return t&&r&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(t){return e(t,i,r)}),t.__c&&t.__c.__P===i&&(t.__e&&r.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=r)),t}(t,t.__c.__P,t.__c.__O)}for(r.setState({__a:r.__b=null});e=r.t.pop();)e.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(a,a)},eg.prototype.componentWillUnmount=function(){this.t=[]},eg.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var i=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=function e(t,i,r){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),t.__c.__H=null),null!=(t=function(e,t){for(var i in t)e[i]=t[i];return e}({},t)).__c&&(t.__c.__P===r&&(t.__c.__P=i),t.__c=null),t.__k=t.__k&&t.__k.map(function(t){return e(t,i,r)})),t}(this.__b,i,r.__O=r.__P)}this.__b=null}var s=t.__a&&S(P,null,e.fallback);return s&&(s.__u&=-33),[S(P,null,t.__a?null:e.children),s]};var ev=function(e,t,i){if(++i[1]===i[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(i=e.u;i;){for(;i.length>3;)i.pop()();if(i[1]<i[0])break;e.u=i=i[2]}};(ey.prototype=new F).__a=function(e){var t=this,i=em(t.__v),r=t.o.get(e);return r[0]++,function(s){var n=function(){t.props.revealOrder?(r.push(s),ev(t,e,r)):s()};i?i(n):n()}},ey.prototype.render=function(e){this.u=null,this.o=new Map;var t=x(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var i=t.length;i--;)this.o.set(t[i],this.u=[1,0,this.u]);return e.children},ey.prototype.componentDidUpdate=ey.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,i){ev(e,i,t)})};var eb="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,ew=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,e_=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,eS=/[A-Z0-9]/g,eC="undefined"!=typeof document;function eP(e,t,i){var r,s,o,l,u;return null==t.__k&&(t.textContent=""),r=e,a.__&&a.__(r,t),o=s&&s.__k||t.__k,l=[],u=[],D(t,r=(s||t).__k=S(P,null,[r]),o||m,m,t.namespaceURI,s?[s]:o?null:t.firstChild?n.call(t.childNodes):null,l,s||(o?o.__e:t.firstChild),!1,u),R(l,r,u),"function"==typeof i&&i(),e?e.__c:null}F.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(F.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var eF=a.event;function ek(){}function eT(){return this.cancelBubble}function eE(){return this.defaultPrevented}a.event=function(e){return eF&&(e=eF(e)),e.persist=ek,e.isPropagationStopped=eT,e.isDefaultPrevented=eE,e.nativeEvent=e};var eA={enumerable:!1,configurable:!0,get:function(){return this.class}},ex=a.vnode;a.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,i=e.type,r={},s=-1===i.indexOf("-");for(var n in t){var a=t[n];if(!("value"===n&&"defaultValue"in t&&null==a||eC&&"children"===n&&"noscript"===i||"class"===n||"className"===n)){var o,l=n.toLowerCase();"defaultValue"===n&&"value"in t&&null==t.value?n="value":"download"===n&&!0===a?a="":"translate"===l&&"no"===a?a=!1:"o"===l[0]&&"n"===l[1]?"ondoubleclick"===l?n="ondblclick":"onchange"!==l||"input"!==i&&"textarea"!==i||(o=t.type,("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(o))?"onfocus"===l?n="onfocusin":"onblur"===l?n="onfocusout":e_.test(n)&&(n=l):l=n="oninput":s&&ew.test(n)?n=n.replace(eS,"-$&").toLowerCase():null===a&&(a=void 0),"oninput"===l&&r[n=l]&&(n="oninputCapture"),r[n]=a}}"select"==i&&r.multiple&&Array.isArray(r.value)&&(r.value=x(t.children).forEach(function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)})),"select"==i&&null!=r.defaultValue&&(r.value=x(t.children).forEach(function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value})),t.class&&!t.className?(r.class=t.class,Object.defineProperty(r,"className",eA)):(t.className&&!t.class||t.class&&t.className)&&(r.class=r.className=t.className),e.props=r}(e),e.$$typeof=eb,ex&&ex(e)};var eI=a.__r;a.__r=function(e){eI&&eI(e),e.__c};var eU=a.diffed;a.diffed=function(e){eU&&eU(e);var t=e.props,i=e.__e;null!=i&&"textarea"===e.type&&"value"in t&&t.value!==i.value&&(i.value=null==t.value?"":t.value)};var eO=i(48629);class eD extends eO.Z{#eX;isTargetDOMEl;el;parent;title;getTargetPlugin(e){let t;return"function"==typeof e?.addTarget?(t=e)instanceof eD||console.warn(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:eD}})):"function"==typeof e&&this.uppy.iteratePlugins(i=>{i instanceof e&&(t=i)}),t}mount(e,t){let i=t.id,r=function(e,t=document){return"string"==typeof e?t.querySelector(e):s(e)?e:null}(e);if(r){var n;let t,s;this.isTargetDOMEl=!0;let a=document.createElement("div");return a.classList.add("uppy-Root"),this.#eX=(n=e=>{this.uppy.getPlugin(this.id)&&(eP(this.render(e,a),a),this.afterUpdate())},s=null,(...e)=>(t=e,s||(s=Promise.resolve().then(()=>(s=null,n(...t)))),s)),this.uppy.log(`Installing ${i} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(r.innerHTML=""),eP(this.render(this.uppy.getState(),a),a),this.el=a,r.appendChild(a),a.dir=this.opts.direction||g(a)||"ltr",this.onMount(),this.el}let a=this.getTargetPlugin(e);if(a)return this.uppy.log(`Installing ${i} to ${a.id}`),this.parent=a,this.el=a.addTarget(t),this.onMount(),this.el;this.uppy.log(`Not installing ${i}`);let o=`Invalid target option given to ${i}.`;throw"function"==typeof e?o+=" 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.":o+="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.",Error(o)}render(e,t){throw Error("Extend the render method to add your plugin to a DOM element")}update(e){null!=this.el&&this.#eX?.(e)}unmount(){this.isTargetDOMEl&&this.el?.remove(),this.onUnmount()}onMount(){}onUnmount(){}}var eR=eD,eN=0;function eM(e,t,i,r,s,n){t||(t={});var o,l,u=t;"ref"in t&&(o=t.ref,delete t.ref);var h={type:e,props:u,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--eN,__i:-1,__u:0,__source:s,__self:n};if("function"==typeof e&&(o=e.defaultProps))for(l in o)void 0===u[l]&&(u[l]=o[l]);return a.vnode&&a.vnode(h),h}class eB extends F{ref={current:null};componentWillEnter(e){this.ref.current.style.opacity="1",this.ref.current.style.transform="none",setTimeout(e,300)}componentWillLeave(e){this.ref.current.style.opacity="0",this.ref.current.style.transform="translateY(350%)",setTimeout(e,300)}render(){let{children:e}=this.props;return eM("div",{className:"uppy-Informer-animated",ref:this.ref,children:e})}}function eL(e){let t={};for(let s=0;s<e.length;s++)if(null!=e[s]){var i,r;t[i=e[s],r=s.toString(36),i?.key??r]=e[s]}return t}class ez extends F{constructor(e,t){super(e,t),this.refs={},this.state={children:eL(x(x(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 e=this.state.children;for(let t in e)e[t]&&this.performAppear(t)}componentWillReceiveProps(e){let t;let i=eL(x(e.children)||[]),r=this.state.children;for(t in this.setState(e=>({children:function(e,t){e=e||{},t=t||{};let i=i=>Object.hasOwn(t,i)?t[i]:e[i],r={},s=[];for(let i in e)Object.hasOwn(t,i)?s.length&&(r[i]=s,s=[]):s.push(i);let n={};for(let e in t){if(Object.hasOwn(r,e))for(let t=0;t<r[e].length;t++){let s=r[e][t];n[r[e][t]]=i(s)}n[e]=i(e)}for(let e=0;e<s.length;e++)n[s[e]]=i(s[e]);return n}(e.children,i)})),i)if(Object.hasOwn(i,t)){let e=r&&Object.hasOwn(r,t);i[t]&&e&&this.currentlyTransitioningKeys[t]?(this.keysToEnter.push(t),this.keysToAbortLeave.push(t)):!i[t]||e||this.currentlyTransitioningKeys[t]||this.keysToEnter.push(t)}for(t in r)if(Object.hasOwn(r,t)){let e=i&&Object.hasOwn(i,t);!r[t]||e||this.currentlyTransitioningKeys[t]||this.keysToLeave.push(t)}}componentDidUpdate(){let{keysToEnter:e}=this;this.keysToEnter=[],e.forEach(this.performEnter);let{keysToLeave:t}=this;this.keysToLeave=[],t.forEach(this.performLeave)}_finishAbort(e){let t=this.keysToAbortLeave.indexOf(e);-1!==t&&this.keysToAbortLeave.splice(t,1)}performAppear(e){this.currentlyTransitioningKeys[e]=!0;let t=this.refs[e];t?.componentWillAppear?t.componentWillAppear(this._handleDoneAppearing.bind(this,e)):this._handleDoneAppearing(e)}_handleDoneAppearing(e){let t=this.refs[e];t?.componentDidAppear&&t.componentDidAppear(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);let i=eL(x(this.props.children)||[]);i&&Object.hasOwn(i,e)||this.performLeave(e)}performEnter(e){this.currentlyTransitioningKeys[e]=!0;let t=this.refs[e];t?.componentWillEnter?t.componentWillEnter(this._handleDoneEntering.bind(this,e)):this._handleDoneEntering(e)}_handleDoneEntering(e){let t=this.refs[e];t?.componentDidEnter&&t.componentDidEnter(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);let i=eL(x(this.props.children)||[]);i&&Object.hasOwn(i,e)||this.performLeave(e)}performLeave(e){if(-1!==this.keysToAbortLeave.indexOf(e))return;this.currentlyTransitioningKeys[e]=!0;let t=this.refs[e];t?.componentWillLeave?t.componentWillLeave(this._handleDoneLeaving.bind(this,e)):this._handleDoneLeaving(e)}_handleDoneLeaving(e){if(-1!==this.keysToAbortLeave.indexOf(e))return;let t=this.refs[e];t?.componentDidLeave&&t.componentDidLeave(),delete this.currentlyTransitioningKeys[e];let i=eL(x(this.props.children)||[]);if(i&&Object.hasOwn(i,e))this.performEnter(e);else{let t=Object.assign({},this.state.children);delete t[e],this.setState({children:t})}}render({childFactory:e,transitionLeave:t,transitionName:i,transitionAppear:r,transitionEnter:s,transitionLeaveTimeout:n,transitionEnterTimeout:a,transitionAppearTimeout:o,component:l,...u},{children:h}){return S(l,u,Object.entries(h).map(([t,i])=>{if(!i)return;let r=function(e,t){let i=e._ptgLinkedRefs||(e._ptgLinkedRefs={});return i[t]||(i[t]=i=>{e.refs[t]=i})}(this,t);return B(e(i),{ref:r,key:t})}).filter(Boolean))}}ez.defaultProps={component:"span",childFactory:e=>e};class e$ extends eR{static VERSION="4.3.1";constructor(e,t){super(e,t),this.type="progressindicator",this.id=this.opts.id||"Informer",this.title="Informer"}render=e=>eM("div",{className:"uppy uppy-Informer",children:eM(ez,{children:e.info.map(e=>eM(eB,{children:eM("p",{role:"alert",children:[e.message," ",e.details&&eM("span",{"aria-label":e.details,"data-microtip-position":"top-left","data-microtip-size":"medium",role:"tooltip",onClick:()=>alert(`${e.message}
|
|
4
|
+
type: ${e.type}`)}),i.length>0&&this.#eR()}removeFiles(e){let{files:t,currentUploads:i}=this.getState(),r={...t},s={...i},n=Object.create(null);function a(e){return void 0===n[e]}e.forEach(e=>{t[e]&&(n[e]=t[e],delete r[e])}),Object.keys(s).forEach(e=>{let t=i[e].fileIDs.filter(a);if(0===t.length){delete s[e];return}let{capabilities:r}=this.getState();if(t.length!==i[e].fileIDs.length&&!r.individualCancellation)throw Error("The installed uploader plugin does not allow removing files during an upload.");s[e]={...i[e],fileIDs:t}});let o={currentUploads:s,files:r};0===Object.keys(r).length&&(o.allowNewUpload=!0,o.error=null,o.recoveredState=null),this.setState(o),this.#eB();let l=Object.keys(n);l.forEach(e=>{this.emit("file-removed",n[e])}),l.length>5?this.log(`Removed ${l.length} files`):this.log(`Removed files: ${l.join(", ")}`)}removeFile(e){this.removeFiles([e])}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).progress.uploadComplete)return;let t=this.getFile(e),i=!t.isPaused;return this.setFileState(e,{isPaused:i}),this.emit("upload-pause",t,i),i}pauseAll(){let e={...this.getState().files};Object.keys(e).filter(t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted).forEach(t=>{let i={...e[t],isPaused:!0};e[t]=i}),this.setState({files:e}),this.emit("pause-all")}resumeAll(){let e={...this.getState().files};Object.keys(e).filter(t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted).forEach(t=>{let i={...e[t],isPaused:!1,error:null};e[t]=i}),this.setState({files:e}),this.emit("resume-all")}#eL(){let{files:e}=this.getState();return Object.keys(e).filter(t=>e[t].error)}async #ez(){let e=this.#eL(),t={...this.getState().files};if(e.forEach(e=>{t[e]={...t[e],isPaused:!1,error:null}}),this.setState({files:t,error:null}),this.emit("retry-all",this.getFilesByIds(e)),0===e.length)return{successful:[],failed:[]};let i=this.#W(e,{forceAllowNewUpload:!0});return this.#e$(i)}async retryAll(){let e=await this.#ez();return this.emit("complete",e),e}cancelAll(){this.emit("cancel-all");let{files:e}=this.getState(),t=Object.keys(e);t.length&&this.removeFiles(t),this.setState(_)}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",this.getFile(e));let t=this.#W([e],{forceAllowNewUpload:!0});return this.#e$(t)}logout(){this.iteratePlugins(e=>{e.provider?.logout?.()})}#eq=(e,t)=>{let i=e?this.getFile(e.id):void 0;if(null==e||!i){this.log(`Not setting progress for a file that has been removed: ${e?.id}`);return}if(100===i.progress.percentage){this.log(`Not setting progress for a file that has been already uploaded: ${e.id}`);return}let r={bytesTotal:t.bytesTotal,percentage:null!=t.bytesTotal&&Number.isFinite(t.bytesTotal)&&t.bytesTotal>0?Math.round(t.bytesUploaded/t.bytesTotal*100):void 0};null!=i.progress.uploadStarted?this.setFileState(e.id,{progress:{...i.progress,...r,bytesUploaded:t.bytesUploaded}}):this.setFileState(e.id,{progress:{...i.progress,...r}}),this.#eB()};#ej(){let e=this.#eH(),t=null;null!=e&&((t=Math.round(100*e))>100?t=100:t<0&&(t=0)),this.emit("progress",t??0),this.setState({totalProgress:t??0})}#eB=l(()=>this.#ej(),500,{leading:!0,trailing:!0});[Symbol.for("uppy test: updateTotalProgress")](){return this.#ej()}#eH(){let e=this.getFiles().filter(e=>e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess);if(0===e.length)return 0;if(e.every(e=>e.progress.uploadComplete))return 1;let t=e=>null!=e.progress.bytesTotal&&0!==e.progress.bytesTotal,i=e.filter(t),r=e.filter(e=>!t(e));if(i.every(e=>e.progress.uploadComplete)&&r.length>0&&!r.every(e=>e.progress.uploadComplete))return null;let s=i.reduce((e,t)=>e+(t.progress.bytesTotal??0),0),n=i.reduce((e,t)=>e+(t.progress.bytesUploaded||0),0);return 0===s?0:n/s}#ex(){let e=(e,t,i)=>{let r=e.message||"Unknown error";e.details&&(r+=` ${e.details}`),this.setState({error:r}),null!=t&&t.id in this.getState().files&&this.setFileState(t.id,{error:r,response:i})};this.on("error",e),this.on("upload-error",(t,i,r)=>{if(e(i,t,r),"object"==typeof i&&i.message){this.log(i.message,"error");let e=Error(this.i18n("failedToUpload",{file:t?.name??""}));e.isUserFacing=!0,e.details=i.message,i.details&&(e.details+=` ${i.details}`),this.#eI([e])}else this.#eI([i])});let t=null;this.on("upload-stalled",(e,i)=>{let{message:r}=e,s=i.map(e=>e.meta.name).join(", ");t||(this.info({message:r,details:s},"warning",this.opts.infoTimeout),t=setTimeout(()=>{t=null},this.opts.infoTimeout)),this.log(`${r} ${s}`.trim(),"warning")}),this.on("upload",()=>{this.setState({error:null})}),this.on("upload-start",e=>{let t=Object.fromEntries(e.filter(e=>{let t=null!=e&&this.getFile(e.id);return t||this.log(`Not setting progress for a file that has been removed: ${e?.id}`),t}).map(e=>[e.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,bytesUploaded:0,bytesTotal:e.size}}]));this.patchFilesState(t)}),this.on("upload-progress",this.#eq),this.on("upload-success",(e,t)=>{if(null==e||!this.getFile(e.id)){this.log(`Not setting progress for a file that has been removed: ${e?.id}`);return}let i=this.getFile(e.id).progress;this.setFileState(e.id,{progress:{...i,postprocess:this.#eA.size>0?{mode:"indeterminate"}:void 0,uploadComplete:!0,percentage:100,bytesUploaded:i.bytesTotal},response:t,uploadURL:t.uploadURL,isPaused:!1}),null==e.size&&this.setFileState(e.id,{size:t.bytesUploaded||i.bytesTotal}),this.#eB()}),this.on("preprocess-progress",(e,t)=>{if(null==e||!this.getFile(e.id)){this.log(`Not setting progress for a file that has been removed: ${e?.id}`);return}this.setFileState(e.id,{progress:{...this.getFile(e.id).progress,preprocess:t}})}),this.on("preprocess-complete",e=>{if(null==e||!this.getFile(e.id)){this.log(`Not setting progress for a file that has been removed: ${e?.id}`);return}let t={...this.getState().files};t[e.id]={...t[e.id],progress:{...t[e.id].progress}},delete t[e.id].progress.preprocess,this.setState({files:t})}),this.on("postprocess-progress",(e,t)=>{if(null==e||!this.getFile(e.id)){this.log(`Not setting progress for a file that has been removed: ${e?.id}`);return}this.setFileState(e.id,{progress:{...this.getState().files[e.id].progress,postprocess:t}})}),this.on("postprocess-complete",e=>{if(null==e||!this.getFile(e.id)){this.log(`Not setting progress for a file that has been removed: ${e?.id}`);return}let t={...this.getState().files};t[e.id]={...t[e.id],progress:{...t[e.id].progress}},delete t[e.id].progress.postprocess,this.setState({files:t})}),this.on("restored",()=>{this.#eB()}),this.on("dashboard:file-edit-complete",e=>{e&&this.#eO(e)}),"undefined"!=typeof window&&window.addEventListener&&(window.addEventListener("online",this.#eV),window.addEventListener("offline",this.#eV),setTimeout(this.#eV,3e3))}updateOnlineStatus(){window.navigator.onLine??!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)}#eV=this.updateOnlineStatus.bind(this);getID(){return this.opts.id}use(e,...t){if("function"!=typeof e)throw TypeError(`Expected a plugin class, but got ${null===e?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`);let i=new e(this,...t),r=i.id;if(!r)throw Error("Your plugin must have an id");if(!i.type)throw Error("Your plugin must have a type");let s=this.getPlugin(r);if(s)throw Error(`Already found a plugin named '${s.id}'. Tried to use: '${r}'.
|
|
5
|
+
Uppy plugins must have unique \`id\` options.`);return e.VERSION&&this.log(`Using ${r} v${e.VERSION}`),i.type in this.#eC?this.#eC[i.type].push(i):this.#eC[i.type]=[i],i.install(),this.emit("plugin-added",i),this}getPlugin(e){for(let t of Object.values(this.#eC)){let i=t.find(t=>t.id===e);if(null!=i)return i}}[Symbol.for("uppy test: getPlugins")](e){return this.#eC[e]}iteratePlugins(e){Object.values(this.#eC).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();let t=this.#eC[e.type],i=t.findIndex(t=>t.id===e.id);-1!==i&&t.splice(i,1);let r={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(r)}destroy(){this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll(),this.#eF(),this.iteratePlugins(e=>{this.removePlugin(e)}),"undefined"!=typeof window&&window.removeEventListener&&(window.removeEventListener("online",this.#eV),window.removeEventListener("offline",this.#eV))}hideInfo(){let{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,t="info",i=3e3){let r="object"==typeof e;this.setState({info:[...this.getState().info,{type:t,message:r?e.message:e,details:r?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)}}#eW=new Map;registerRequestClient(e,t){this.#eW.set(e,t)}getRequestClientForFile(e){if(!e.remote)throw Error(`Tried to get RequestClient for a non-remote file ${e.id}`);let t=this.#eW.get(e.remote.requestClientId);if(null==t)throw 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])?this.#e$(e):(this.#eG(e),Promise.reject(Error("Nonexistent upload")))}#W(e,t={}){let{forceAllowNewUpload:i=!1}=t,{allowNewUpload:r,currentUploads:s}=this.getState();if(!r&&!i)throw Error("Cannot create a new upload: already uploading.");let n=h();return this.emit("upload",n,this.getFilesByIds(e)),this.setState({allowNewUpload:!1!==this.opts.allowMultipleUploadBatches&&!1!==this.opts.allowMultipleUploads,currentUploads:{...s,[n]:{fileIDs:e,step:0,result:{}}}}),n}[Symbol.for("uppy test: createUpload")](...e){return this.#W(...e)}#eK(e){let{currentUploads:t}=this.getState();return t[e]}addResultData(e,t){if(!this.#eK(e)){this.log(`Not setting result for an upload that has been removed: ${e}`);return}let{currentUploads:i}=this.getState(),r={...i[e],result:{...i[e].result,...t}};this.setState({currentUploads:{...i,[e]:r}})}#eG(e){let t={...this.getState().currentUploads};delete t[e],this.setState({currentUploads:t})}async #e$(e){let t;let i=()=>{let{currentUploads:t}=this.getState();return t[e]},r=i(),s=[...this.#eT,...this.#eE,...this.#eA];try{for(let t=r.step||0;t<s.length&&r;t++){let n=s[t];this.setState({currentUploads:{...this.getState().currentUploads,[e]:{...r,step:t}}});let{fileIDs:a}=r;await n(a,e),r=i()}}catch(t){throw this.#eG(e),t}if(r){r.fileIDs.forEach(e=>{let t=this.getFile(e);t?.progress.postprocess&&this.emit("postprocess-complete",t)});let t=r.fileIDs.map(e=>this.getFile(e)),s=t.filter(e=>!e.error),n=t.filter(e=>e.error);this.addResultData(e,{successful:s,failed:n,uploadID:e}),r=i()}return r&&(t=r.result,this.#eG(e)),null==t&&(this.log(`Not setting result for an upload that has been removed: ${e}`),t={successful:[],failed:[],uploadID:e}),t}async upload(){this.#eC.uploader?.length||this.log("No uploader type plugins are used","warning");let{files:e}=this.getState();if(this.#eL().length>0){let t=await this.#ez();if(!(this.getFiles().filter(e=>null==e.progress.uploadStarted).length>0))return this.emit("complete",t),t;({files:e}=this.getState())}let t=this.opts.onBeforeUpload(e);return!1===t?Promise.reject(Error("Not starting the upload because onBeforeUpload returned false")):(t&&"object"==typeof t&&(e=t,this.setState({files:e})),Promise.resolve().then(()=>this.#eP.validateMinNumberOfFiles(e)).catch(e=>{throw this.#eI([e]),e}).then(()=>{if(!this.#eU(e))throw new b(this.i18n("missingRequiredMetaField"))}).catch(e=>{throw e}).then(async()=>{let{currentUploads:t}=this.getState(),i=Object.values(t).flatMap(e=>e.fileIDs),r=[];Object.keys(e).forEach(e=>{let t=this.getFile(e);t.progress.uploadStarted||-1!==i.indexOf(e)||r.push(t.id)});let s=this.#W(r),n=await this.#e$(s);return this.emit("complete",n),n}).catch(e=>{throw this.emit("error",e),this.log(e,"error"),e}))}}var C=S},80007:function(e,t,i){"use strict";let r;function s(e){return"object"==typeof e&&null!==e&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}i.d(t,{A:function(){return se}});var n,a,o,l,u,h,d,p,c,f,g=function(e){for(;e&&!e.dir;)e=e.parentNode;return e?.dir},m={},y=[],v=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,b=Array.isArray;function w(e,t){for(var i in t)e[i]=t[i];return e}function _(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function S(e,t,i){var r,s,a,o={};for(a in t)"key"==a?r=t[a]:"ref"==a?s=t[a]:o[a]=t[a];if(arguments.length>2&&(o.children=arguments.length>3?n.call(arguments,2):i),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===o[a]&&(o[a]=e.defaultProps[a]);return C(e,o,r,s,null)}function C(e,t,i,r,s){var n={type:e,props:t,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==s?++o:s,__i:-1,__u:0};return null==s&&null!=a.vnode&&a.vnode(n),n}function P(e){return e.children}function F(e,t){this.props=e,this.context=t}function k(e,t){if(null==t)return e.__?k(e.__,e.__i+1):null;for(var i;t<e.__k.length;t++)if(null!=(i=e.__k[t])&&null!=i.__e)return i.__e;return"function"==typeof e.type?k(e):null}function T(e){(!e.__d&&(e.__d=!0)&&l.push(e)&&!E.__r++||u!==a.debounceRendering)&&((u=a.debounceRendering)||h)(E)}function E(){var e,t,i,r,s,n,o,u;for(l.sort(d);e=l.shift();)e.__d&&(t=l.length,r=void 0,n=(s=(i=e).__v).__e,o=[],u=[],i.__P&&((r=w({},s)).__v=s.__v+1,a.vnode&&a.vnode(r),D(i.__P,r,s,i.__n,i.__P.namespaceURI,32&s.__u?[n]:null,o,null==n?k(s):n,!!(32&s.__u),u),r.__v=s.__v,r.__.__k[r.__i]=r,N(o,r,u),r.__e!=n&&function e(t){var i,r;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,i=0;i<t.__k.length;i++)if(null!=(r=t.__k[i])&&null!=r.__e){t.__e=t.__c.base=r.__e;break}return e(t)}}(r)),l.length>t&&l.sort(d));E.__r=0}function A(e,t,i,r,s,n,o,l,u,h,d){var p,c,f,g,v,w=r&&r.__k||y,S=t.length;for(i.__d=u,function(e,t,i){var r,s,n,o,l,u=t.length,h=i.length,d=h,p=0;for(e.__k=[],r=0;r<u;r++)null!=(s=t[r])&&"boolean"!=typeof s&&"function"!=typeof s?(o=r+p,(s=e.__k[r]="string"==typeof s||"number"==typeof s||"bigint"==typeof s||s.constructor==String?C(null,s,null,null,null):b(s)?C(P,{children:s},null,null,null):void 0===s.constructor&&s.__b>0?C(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=e,s.__b=e.__b+1,n=null,-1!==(l=s.__i=function(e,t,i,r){var s=e.key,n=e.type,a=i-1,o=i+1,l=t[i];if(null===l||l&&s==l.key&&n===l.type&&0==(131072&l.__u))return i;if(r>(null!=l&&0==(131072&l.__u)?1:0))for(;a>=0||o<t.length;){if(a>=0){if((l=t[a])&&0==(131072&l.__u)&&s==l.key&&n===l.type)return a;a--}if(o<t.length){if((l=t[o])&&0==(131072&l.__u)&&s==l.key&&n===l.type)return o;o++}}return -1}(s,i,o,d))&&(d--,(n=i[l])&&(n.__u|=131072)),null==n||null===n.__v?(-1==l&&p--,"function"!=typeof s.type&&(s.__u|=65536)):l!==o&&(l==o-1?p--:l==o+1?p++:(l>o?p--:p++,s.__u|=65536))):s=e.__k[r]=null;if(d)for(r=0;r<h;r++)null!=(n=i[r])&&0==(131072&n.__u)&&(n.__e==e.__d&&(e.__d=k(n)),function e(t,i,r){var s,n;if(a.unmount&&a.unmount(t),(s=t.ref)&&(s.current&&s.current!==t.__e||R(s,null,i)),null!=(s=t.__c)){if(s.componentWillUnmount)try{s.componentWillUnmount()}catch(e){a.__e(e,i)}s.base=s.__P=null}if(s=t.__k)for(n=0;n<s.length;n++)s[n]&&e(s[n],i,r||"function"!=typeof t.type);r||_(t.__e),t.__c=t.__=t.__e=t.__d=void 0}(n,n))}(i,t,w),u=i.__d,p=0;p<S;p++)null!=(f=i.__k[p])&&(c=-1===f.__i?m:w[f.__i]||m,f.__i=p,D(e,f,c,s,n,o,l,u,h,d),g=f.__e,f.ref&&c.ref!=f.ref&&(c.ref&&R(c.ref,null,f),d.push(f.ref,f.__c||g,f)),null==v&&null!=g&&(v=g),65536&f.__u||c.__k===f.__k?u=function e(t,i,r){var s,n;if("function"==typeof t.type){for(s=t.__k,n=0;s&&n<s.length;n++)s[n]&&(s[n].__=t,i=e(s[n],i,r));return i}t.__e!=i&&(i&&t.type&&!r.contains(i)&&(i=k(t)),r.insertBefore(t.__e,i||null),i=t.__e);do i=i&&i.nextSibling;while(null!=i&&8===i.nodeType);return i}(f,u,e):"function"==typeof f.type&&void 0!==f.__d?u=f.__d:g&&(u=g.nextSibling),f.__d=void 0,f.__u&=-196609);i.__d=u,i.__e=v}function x(e,t){return t=t||[],null==e||"boolean"==typeof e||(b(e)?e.some(function(e){x(e,t)}):t.push(e)),t}function I(e,t,i){"-"===t[0]?e.setProperty(t,null==i?"":i):e[t]=null==i?"":"number"!=typeof i||v.test(t)?i:i+"px"}function O(e,t,i,r,s){var n;e:if("style"===t){if("string"==typeof i)e.style.cssText=i;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)i&&t in i||I(e.style,t,"");if(i)for(t in i)r&&i[t]===r[t]||I(e.style,t,i[t])}}else if("o"===t[0]&&"n"===t[1])n=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase() in e||"onFocusOut"===t||"onFocusIn"===t?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+n]=i,i?r?i.u=r.u:(i.u=p,e.addEventListener(t,n?f:c,n)):e.removeEventListener(t,n?f:c,n);else{if("http://www.w3.org/2000/svg"==s)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==i?"":i;break e}catch(e){}"function"==typeof i||(null==i||!1===i&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==i?"":i))}}function U(e){return function(t){if(this.l){var i=this.l[t.type+e];if(null==t.t)t.t=p++;else if(t.t<i.u)return;return i(a.event?a.event(t):t)}}}function D(e,t,i,r,s,o,l,u,h,d){var p,c,f,g,y,v,S,C,T,E,x,I,U,D,N,R,B=t.type;if(void 0!==t.constructor)return null;128&i.__u&&(h=!!(32&i.__u),o=[u=t.__e=i.__e]),(p=a.__b)&&p(t);e:if("function"==typeof B)try{if(C=t.props,T="prototype"in B&&B.prototype.render,E=(p=B.contextType)&&r[p.__c],x=p?E?E.props.value:p.__:r,i.__c?S=(c=t.__c=i.__c).__=c.__E:(T?t.__c=c=new B(C,x):(t.__c=c=new F(C,x),c.constructor=B,c.render=M),E&&E.sub(c),c.props=C,c.state||(c.state={}),c.context=x,c.__n=r,f=c.__d=!0,c.__h=[],c._sb=[]),T&&null==c.__s&&(c.__s=c.state),T&&null!=B.getDerivedStateFromProps&&(c.__s==c.state&&(c.__s=w({},c.__s)),w(c.__s,B.getDerivedStateFromProps(C,c.__s))),g=c.props,y=c.state,c.__v=t,f)T&&null==B.getDerivedStateFromProps&&null!=c.componentWillMount&&c.componentWillMount(),T&&null!=c.componentDidMount&&c.__h.push(c.componentDidMount);else{if(T&&null==B.getDerivedStateFromProps&&C!==g&&null!=c.componentWillReceiveProps&&c.componentWillReceiveProps(C,x),!c.__e&&(null!=c.shouldComponentUpdate&&!1===c.shouldComponentUpdate(C,c.__s,x)||t.__v===i.__v)){for(t.__v!==i.__v&&(c.props=C,c.state=c.__s,c.__d=!1),t.__e=i.__e,t.__k=i.__k,t.__k.some(function(e){e&&(e.__=t)}),I=0;I<c._sb.length;I++)c.__h.push(c._sb[I]);c._sb=[],c.__h.length&&l.push(c);break e}null!=c.componentWillUpdate&&c.componentWillUpdate(C,c.__s,x),T&&null!=c.componentDidUpdate&&c.__h.push(function(){c.componentDidUpdate(g,y,v)})}if(c.context=x,c.props=C,c.__P=e,c.__e=!1,U=a.__r,D=0,T){for(c.state=c.__s,c.__d=!1,U&&U(t),p=c.render(c.props,c.state,c.context),N=0;N<c._sb.length;N++)c.__h.push(c._sb[N]);c._sb=[]}else do c.__d=!1,U&&U(t),p=c.render(c.props,c.state,c.context),c.state=c.__s;while(c.__d&&++D<25);c.state=c.__s,null!=c.getChildContext&&(r=w(w({},r),c.getChildContext())),T&&!f&&null!=c.getSnapshotBeforeUpdate&&(v=c.getSnapshotBeforeUpdate(g,y)),A(e,b(R=null!=p&&p.type===P&&null==p.key?p.props.children:p)?R:[R],t,i,r,s,o,l,u,h,d),c.base=t.__e,t.__u&=-161,c.__h.length&&l.push(c),S&&(c.__E=c.__=null)}catch(e){if(t.__v=null,h||null!=o){for(t.__u|=h?160:128;u&&8===u.nodeType&&u.nextSibling;)u=u.nextSibling;o[o.indexOf(u)]=null,t.__e=u}else t.__e=i.__e,t.__k=i.__k;a.__e(e,t,i)}else null==o&&t.__v===i.__v?(t.__k=i.__k,t.__e=i.__e):t.__e=function(e,t,i,r,s,o,l,u,h){var d,p,c,f,g,y,v,w=i.props,S=t.props,C=t.type;if("svg"===C?s="http://www.w3.org/2000/svg":"math"===C?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),null!=o){for(d=0;d<o.length;d++)if((g=o[d])&&"setAttribute"in g==!!C&&(C?g.localName===C:3===g.nodeType)){e=g,o[d]=null;break}}if(null==e){if(null===C)return document.createTextNode(S);e=document.createElementNS(s,C,S.is&&S),u&&(a.__m&&a.__m(t,o),u=!1),o=null}if(null===C)w===S||u&&e.data===S||(e.data=S);else{if(o=o&&n.call(e.childNodes),w=i.props||m,!u&&null!=o)for(w={},d=0;d<e.attributes.length;d++)w[(g=e.attributes[d]).name]=g.value;for(d in w)if(g=w[d],"children"==d);else if("dangerouslySetInnerHTML"==d)c=g;else if(!(d in S)){if("value"==d&&"defaultValue"in S||"checked"==d&&"defaultChecked"in S)continue;O(e,d,null,g,s)}for(d in S)g=S[d],"children"==d?f=g:"dangerouslySetInnerHTML"==d?p=g:"value"==d?y=g:"checked"==d?v=g:u&&"function"!=typeof g||w[d]===g||O(e,d,g,w[d],s);if(p)u||c&&(p.__html===c.__html||p.__html===e.innerHTML)||(e.innerHTML=p.__html),t.__k=[];else if(c&&(e.innerHTML=""),A(e,b(f)?f:[f],t,i,r,"foreignObject"===C?"http://www.w3.org/1999/xhtml":s,o,l,o?o[0]:i.__k&&k(i,0),u,h),null!=o)for(d=o.length;d--;)_(o[d]);u||(d="value","progress"===C&&null==y?e.removeAttribute("value"):void 0===y||y===e[d]&&("progress"!==C||y)&&("option"!==C||y===w[d])||O(e,d,y,w[d],s),d="checked",void 0!==v&&v!==e[d]&&O(e,d,v,w[d],s))}return e}(i.__e,t,i,r,s,o,l,h,d);(p=a.diffed)&&p(t)}function N(e,t,i){t.__d=void 0;for(var r=0;r<i.length;r++)R(i[r],i[++r],i[++r]);a.__c&&a.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){a.__e(e,t.__v)}})}function R(e,t,i){try{if("function"==typeof e){var r="function"==typeof e.__u;r&&e.__u(),r&&null==t||(e.__u=e(t))}else e.current=t}catch(e){a.__e(e,i)}}function M(e,t,i){return this.constructor(e,i)}function B(e,t,i){var r,s,a,o,l=w({},e.props);for(a in e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)"key"==a?r=t[a]:"ref"==a?s=t[a]:l[a]=void 0===t[a]&&void 0!==o?o[a]:t[a];return arguments.length>2&&(l.children=arguments.length>3?n.call(arguments,2):i),C(e.type,l,r||e.key,s||e.ref,null)}n=y.slice,a={__e:function(e,t,i,r){for(var s,n,a;t=t.__;)if((s=t.__c)&&!s.__)try{if((n=s.constructor)&&null!=n.getDerivedStateFromError&&(s.setState(n.getDerivedStateFromError(e)),a=s.__d),null!=s.componentDidCatch&&(s.componentDidCatch(e,r||{}),a=s.__d),a)return s.__E=s}catch(t){e=t}throw e}},o=0,F.prototype.setState=function(e,t){var i;i=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=w({},this.state),"function"==typeof e&&(e=e(w({},i),this.props)),e&&w(i,e),null!=e&&this.__v&&(t&&this._sb.push(t),T(this))},F.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),T(this))},F.prototype.render=P,l=[],h="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,d=function(e,t){return e.__v.__b-t.__v.__b},E.__r=0,p=0,c=U(!1),f=U(!0);var L,z,$,q,j=0,H=[],V=a,W=V.__b,G=V.__r,K=V.diffed,X=V.__c,Z=V.unmount,Y=V.__;function Q(e,t){V.__h&&V.__h(z,e,j||t),j=0;var i=z.__H||(z.__H={__:[],__h:[]});return e>=i.__.length&&i.__.push({}),i.__[e]}function J(e){return j=1,function(e,t,i){var r=Q(L++,2);if(r.t=e,!r.__c&&(r.__=[eu(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],i=r.t(t,e);t!==i&&(r.__N=[i,r.__[1]],r.__c.setState({}))}],r.__c=z,!z.u)){var s=function(e,t,i){if(!r.__c.__H)return!0;var s=r.__c.__H.__.filter(function(e){return!!e.__c});if(s.every(function(e){return!e.__N}))return!n||n.call(this,e,t,i);var a=!1;return s.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(a=!0)}}),!(!a&&r.__c.props===e)&&(!n||n.call(this,e,t,i))};z.u=!0;var n=z.shouldComponentUpdate,a=z.componentWillUpdate;z.componentWillUpdate=function(e,t,i){if(this.__e){var r=n;n=void 0,s(e,t,i),n=r}a&&a.call(this,e,t,i)},z.shouldComponentUpdate=s}return r.__N||r.__}(eu,e)}function ee(e,t){var i=Q(L++,3);!V.__s&&el(i.__H,t)&&(i.__=e,i.i=t,z.__H.__h.push(i))}function et(e){return j=5,ei(function(){return{current:e}},[])}function ei(e,t){var i=Q(L++,7);return el(i.__H,t)&&(i.__=e(),i.__H=t,i.__h=e),i.__}function er(e,t){return j=8,ei(function(){return e},t)}function es(){for(var e;e=H.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(ea),e.__H.__h.forEach(eo),e.__H.__h=[]}catch(t){e.__H.__h=[],V.__e(t,e.__v)}}V.__b=function(e){z=null,W&&W(e)},V.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Y&&Y(e,t)},V.__r=function(e){G&&G(e),L=0;var t=(z=e.__c).__H;t&&($===z?(t.__h=[],z.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.i=e.__N=void 0})):(t.__h.forEach(ea),t.__h.forEach(eo),t.__h=[],L=0)),$=z},V.diffed=function(e){K&&K(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==H.push(t)&&q===V.requestAnimationFrame||((q=V.requestAnimationFrame)||function(e){var t,i=function(){clearTimeout(r),en&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(i,100);en&&(t=requestAnimationFrame(i))})(es)),t.__H.__.forEach(function(e){e.i&&(e.__H=e.i),e.i=void 0})),$=z=null},V.__c=function(e,t){t.some(function(e){try{e.__h.forEach(ea),e.__h=e.__h.filter(function(e){return!e.__||eo(e)})}catch(i){t.some(function(e){e.__h&&(e.__h=[])}),t=[],V.__e(i,e.__v)}}),X&&X(e,t)},V.unmount=function(e){Z&&Z(e);var t,i=e.__c;i&&i.__H&&(i.__H.__.forEach(function(e){try{ea(e)}catch(e){t=e}}),i.__H=void 0,t&&V.__e(t,i.__v))};var en="function"==typeof requestAnimationFrame;function ea(e){var t=z,i=e.__c;"function"==typeof i&&(e.__c=void 0,i()),z=t}function eo(e){var t=z;e.__c=e.__(),z=t}function el(e,t){return!e||e.length!==t.length||t.some(function(t,i){return t!==e[i]})}function eu(e,t){return"function"==typeof t?t(e):t}function eh(e,t){for(var i in e)if("__source"!==i&&!(i in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function ed(e,t){this.props=e,this.context=t}(ed.prototype=new F).isPureReactComponent=!0,ed.prototype.shouldComponentUpdate=function(e,t){return eh(this.props,e)||eh(this.state,t)};var ep=a.__b;a.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),ep&&ep(e)},"undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref");var ec=a.__e;a.__e=function(e,t,i,r){if(e.then){for(var s,n=t;n=n.__;)if((s=n.__c)&&s.__c)return null==t.__e&&(t.__e=i.__e,t.__k=i.__k),s.__c(e,t)}ec(e,t,i,r)};var ef=a.unmount;function eg(){this.__u=0,this.t=null,this.__b=null}function em(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function ey(){this.u=null,this.o=null}a.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),ef&&ef(e)},(eg.prototype=new F).__c=function(e,t){var i=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(i);var s=em(r.__v),n=!1,a=function(){n||(n=!0,i.__R=null,s?s(o):o())};i.__R=a;var o=function(){if(!--r.__u){if(r.state.__a){var e,t=r.state.__a;r.__v.__k[0]=function e(t,i,r){return t&&r&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(t){return e(t,i,r)}),t.__c&&t.__c.__P===i&&(t.__e&&r.appendChild(t.__e),t.__c.__e=!0,t.__c.__P=r)),t}(t,t.__c.__P,t.__c.__O)}for(r.setState({__a:r.__b=null});e=r.t.pop();)e.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(a,a)},eg.prototype.componentWillUnmount=function(){this.t=[]},eg.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var i=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=function e(t,i,r){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),t.__c.__H=null),null!=(t=function(e,t){for(var i in t)e[i]=t[i];return e}({},t)).__c&&(t.__c.__P===r&&(t.__c.__P=i),t.__c=null),t.__k=t.__k&&t.__k.map(function(t){return e(t,i,r)})),t}(this.__b,i,r.__O=r.__P)}this.__b=null}var s=t.__a&&S(P,null,e.fallback);return s&&(s.__u&=-33),[S(P,null,t.__a?null:e.children),s]};var ev=function(e,t,i){if(++i[1]===i[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(i=e.u;i;){for(;i.length>3;)i.pop()();if(i[1]<i[0])break;e.u=i=i[2]}};(ey.prototype=new F).__a=function(e){var t=this,i=em(t.__v),r=t.o.get(e);return r[0]++,function(s){var n=function(){t.props.revealOrder?(r.push(s),ev(t,e,r)):s()};i?i(n):n()}},ey.prototype.render=function(e){this.u=null,this.o=new Map;var t=x(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var i=t.length;i--;)this.o.set(t[i],this.u=[1,0,this.u]);return e.children},ey.prototype.componentDidUpdate=ey.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,i){ev(e,i,t)})};var eb="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,ew=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,e_=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,eS=/[A-Z0-9]/g,eC="undefined"!=typeof document;function eP(e,t,i){var r,s,o,l,u;return null==t.__k&&(t.textContent=""),r=e,a.__&&a.__(r,t),o=s&&s.__k||t.__k,l=[],u=[],D(t,r=(s||t).__k=S(P,null,[r]),o||m,m,t.namespaceURI,s?[s]:o?null:t.firstChild?n.call(t.childNodes):null,l,s||(o?o.__e:t.firstChild),!1,u),N(l,r,u),"function"==typeof i&&i(),e?e.__c:null}F.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(F.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var eF=a.event;function ek(){}function eT(){return this.cancelBubble}function eE(){return this.defaultPrevented}a.event=function(e){return eF&&(e=eF(e)),e.persist=ek,e.isPropagationStopped=eT,e.isDefaultPrevented=eE,e.nativeEvent=e};var eA={enumerable:!1,configurable:!0,get:function(){return this.class}},ex=a.vnode;a.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,i=e.type,r={},s=-1===i.indexOf("-");for(var n in t){var a=t[n];if(!("value"===n&&"defaultValue"in t&&null==a||eC&&"children"===n&&"noscript"===i||"class"===n||"className"===n)){var o,l=n.toLowerCase();"defaultValue"===n&&"value"in t&&null==t.value?n="value":"download"===n&&!0===a?a="":"translate"===l&&"no"===a?a=!1:"o"===l[0]&&"n"===l[1]?"ondoubleclick"===l?n="ondblclick":"onchange"!==l||"input"!==i&&"textarea"!==i||(o=t.type,("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(o))?"onfocus"===l?n="onfocusin":"onblur"===l?n="onfocusout":e_.test(n)&&(n=l):l=n="oninput":s&&ew.test(n)?n=n.replace(eS,"-$&").toLowerCase():null===a&&(a=void 0),"oninput"===l&&r[n=l]&&(n="oninputCapture"),r[n]=a}}"select"==i&&r.multiple&&Array.isArray(r.value)&&(r.value=x(t.children).forEach(function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)})),"select"==i&&null!=r.defaultValue&&(r.value=x(t.children).forEach(function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value})),t.class&&!t.className?(r.class=t.class,Object.defineProperty(r,"className",eA)):(t.className&&!t.class||t.class&&t.className)&&(r.class=r.className=t.className),e.props=r}(e),e.$$typeof=eb,ex&&ex(e)};var eI=a.__r;a.__r=function(e){eI&&eI(e),e.__c};var eO=a.diffed;a.diffed=function(e){eO&&eO(e);var t=e.props,i=e.__e;null!=i&&"textarea"===e.type&&"value"in t&&t.value!==i.value&&(i.value=null==t.value?"":t.value)};var eU=i(48629);class eD extends eU.Z{#eX;isTargetDOMEl;el;parent;title;getTargetPlugin(e){let t;return"function"==typeof e?.addTarget?(t=e)instanceof eD||console.warn(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:eD}})):"function"==typeof e&&this.uppy.iteratePlugins(i=>{i instanceof e&&(t=i)}),t}mount(e,t){let i=t.id,r=function(e,t=document){return"string"==typeof e?t.querySelector(e):s(e)?e:null}(e);if(r){var n;let t,s;this.isTargetDOMEl=!0;let a=document.createElement("div");return a.classList.add("uppy-Root"),this.#eX=(n=e=>{this.uppy.getPlugin(this.id)&&(eP(this.render(e,a),a),this.afterUpdate())},s=null,(...e)=>(t=e,s||(s=Promise.resolve().then(()=>(s=null,n(...t)))),s)),this.uppy.log(`Installing ${i} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(r.innerHTML=""),eP(this.render(this.uppy.getState(),a),a),this.el=a,r.appendChild(a),a.dir=this.opts.direction||g(a)||"ltr",this.onMount(),this.el}let a=this.getTargetPlugin(e);if(a)return this.uppy.log(`Installing ${i} to ${a.id}`),this.parent=a,this.el=a.addTarget(t),this.onMount(),this.el;this.uppy.log(`Not installing ${i}`);let o=`Invalid target option given to ${i}.`;throw"function"==typeof e?o+=" 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.":o+="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.",Error(o)}render(e,t){throw Error("Extend the render method to add your plugin to a DOM element")}update(e){null!=this.el&&this.#eX?.(e)}unmount(){this.isTargetDOMEl&&this.el?.remove(),this.onUnmount()}onMount(){}onUnmount(){}}var eN=eD,eR=0;function eM(e,t,i,r,s,n){t||(t={});var o,l,u=t;"ref"in t&&(o=t.ref,delete t.ref);var h={type:e,props:u,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--eR,__i:-1,__u:0,__source:s,__self:n};if("function"==typeof e&&(o=e.defaultProps))for(l in o)void 0===u[l]&&(u[l]=o[l]);return a.vnode&&a.vnode(h),h}class eB extends F{ref={current:null};componentWillEnter(e){this.ref.current.style.opacity="1",this.ref.current.style.transform="none",setTimeout(e,300)}componentWillLeave(e){this.ref.current.style.opacity="0",this.ref.current.style.transform="translateY(350%)",setTimeout(e,300)}render(){let{children:e}=this.props;return eM("div",{className:"uppy-Informer-animated",ref:this.ref,children:e})}}function eL(e){let t={};for(let s=0;s<e.length;s++)if(null!=e[s]){var i,r;t[i=e[s],r=s.toString(36),i?.key??r]=e[s]}return t}class ez extends F{constructor(e,t){super(e,t),this.refs={},this.state={children:eL(x(x(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 e=this.state.children;for(let t in e)e[t]&&this.performAppear(t)}componentWillReceiveProps(e){let t;let i=eL(x(e.children)||[]),r=this.state.children;for(t in this.setState(e=>({children:function(e,t){e=e||{},t=t||{};let i=i=>Object.hasOwn(t,i)?t[i]:e[i],r={},s=[];for(let i in e)Object.hasOwn(t,i)?s.length&&(r[i]=s,s=[]):s.push(i);let n={};for(let e in t){if(Object.hasOwn(r,e))for(let t=0;t<r[e].length;t++){let s=r[e][t];n[r[e][t]]=i(s)}n[e]=i(e)}for(let e=0;e<s.length;e++)n[s[e]]=i(s[e]);return n}(e.children,i)})),i)if(Object.hasOwn(i,t)){let e=r&&Object.hasOwn(r,t);i[t]&&e&&this.currentlyTransitioningKeys[t]?(this.keysToEnter.push(t),this.keysToAbortLeave.push(t)):!i[t]||e||this.currentlyTransitioningKeys[t]||this.keysToEnter.push(t)}for(t in r)if(Object.hasOwn(r,t)){let e=i&&Object.hasOwn(i,t);!r[t]||e||this.currentlyTransitioningKeys[t]||this.keysToLeave.push(t)}}componentDidUpdate(){let{keysToEnter:e}=this;this.keysToEnter=[],e.forEach(this.performEnter);let{keysToLeave:t}=this;this.keysToLeave=[],t.forEach(this.performLeave)}_finishAbort(e){let t=this.keysToAbortLeave.indexOf(e);-1!==t&&this.keysToAbortLeave.splice(t,1)}performAppear(e){this.currentlyTransitioningKeys[e]=!0;let t=this.refs[e];t?.componentWillAppear?t.componentWillAppear(this._handleDoneAppearing.bind(this,e)):this._handleDoneAppearing(e)}_handleDoneAppearing(e){let t=this.refs[e];t?.componentDidAppear&&t.componentDidAppear(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);let i=eL(x(this.props.children)||[]);i&&Object.hasOwn(i,e)||this.performLeave(e)}performEnter(e){this.currentlyTransitioningKeys[e]=!0;let t=this.refs[e];t?.componentWillEnter?t.componentWillEnter(this._handleDoneEntering.bind(this,e)):this._handleDoneEntering(e)}_handleDoneEntering(e){let t=this.refs[e];t?.componentDidEnter&&t.componentDidEnter(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);let i=eL(x(this.props.children)||[]);i&&Object.hasOwn(i,e)||this.performLeave(e)}performLeave(e){if(-1!==this.keysToAbortLeave.indexOf(e))return;this.currentlyTransitioningKeys[e]=!0;let t=this.refs[e];t?.componentWillLeave?t.componentWillLeave(this._handleDoneLeaving.bind(this,e)):this._handleDoneLeaving(e)}_handleDoneLeaving(e){if(-1!==this.keysToAbortLeave.indexOf(e))return;let t=this.refs[e];t?.componentDidLeave&&t.componentDidLeave(),delete this.currentlyTransitioningKeys[e];let i=eL(x(this.props.children)||[]);if(i&&Object.hasOwn(i,e))this.performEnter(e);else{let t=Object.assign({},this.state.children);delete t[e],this.setState({children:t})}}render({childFactory:e,transitionLeave:t,transitionName:i,transitionAppear:r,transitionEnter:s,transitionLeaveTimeout:n,transitionEnterTimeout:a,transitionAppearTimeout:o,component:l,...u},{children:h}){return S(l,u,Object.entries(h).map(([t,i])=>{if(!i)return;let r=function(e,t){let i=e._ptgLinkedRefs||(e._ptgLinkedRefs={});return i[t]||(i[t]=i=>{e.refs[t]=i})}(this,t);return B(e(i),{ref:r,key:t})}).filter(Boolean))}}ez.defaultProps={component:"span",childFactory:e=>e};class e$ extends eN{static VERSION="4.3.1";constructor(e,t){super(e,t),this.type="progressindicator",this.id=this.opts.id||"Informer",this.title="Informer"}render=e=>eM("div",{className:"uppy uppy-Informer",children:eM(ez,{children:e.info.map(e=>eM(eB,{children:eM("p",{role:"alert",children:[e.message," ",e.details&&eM("span",{"aria-label":e.details,"data-microtip-position":"top-left","data-microtip-size":"medium",role:"tooltip",onClick:()=>alert(`${e.message}
|
|
6
6
|
|
|
7
|
-
${e.details}`),children:"?"})]})},e.message))})});install(){let{target:e}=this.opts;e&&this.mount(e,this)}}function eq(){return eM("svg",{width:"26",height:"26",viewBox:"0 0 26 26",xmlns:"http://www.w3.org/2000/svg",children:eM("g",{fill:"none","fill-rule":"evenodd",children:[eM("circle",{fill:"#FFF",cx:"13",cy:"13",r:"13"}),eM("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"}),eM("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"}),eM("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"}),eM("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"}),eM("path",{d:"M4 4h18v18H4z"})]})})}function eH({pluginName:e,i18n:t,onAuth:i}){let r="Google Drive"===e;return eM("form",{onSubmit:er(e=>{e.preventDefault(),i()},[i]),children:r?eM("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,children:[eM(eq,{}),t("signInWithGoogle")]}):eM("button",{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn","data-uppy-super-focusable":!0,children:t("authenticateWith",{pluginName:e})})})}let ej=({pluginName:e,i18n:t,onAuth:i})=>eM(eH,{pluginName:e,i18n:t,onAuth:i});function eV({loading:e,pluginName:t,pluginIcon:i,i18n:r,handleAuth:s,renderForm:n=ej}){return eM("div",{className:"uppy-Provider-auth",children:[eM("div",{className:"uppy-Provider-authIcon",children:i()}),eM("div",{className:"uppy-Provider-authTitle",children:r("authenticateWithTitle",{pluginName:t})}),n({pluginName:t,i18n:r,loading:e,onAuth:s})]})}var eW=i(66547);function eG(e){return{...e,type:e.mimeType,extension:e.name?(0,eW.Z)(e.name).extension:null}}var eK=i(36760),eX="4.5.1";let eZ={position:"relative",width:"100%",minHeight:"100%"},eY={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"};class eQ extends F{constructor(e){super(e),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?.parentNode&&document.activeElement!==this.focusElement&&this.focusElement.focus(),this.focusElement=null,this.resize()}componentWillUnmount(){window.removeEventListener("resize",this.handleResize)}handleScroll=()=>{this.setState({offset:this.base.scrollTop})};handleResize=()=>{this.resize()};resize(){let{height:e}=this.state;e!==this.base.offsetHeight&&this.setState({height:this.base.offsetHeight})}render({data:e,rowHeight:t,renderRow:i,overscanCount:r=10,...s}){let{offset:n,height:a}=this.state,o=Math.floor(n/t),l=Math.floor(a/t);r&&(o=Math.max(0,o-o%r),l+=r);let u=o+l+4,h=e.slice(o,u),p={...eZ,height:e.length*t},d={...eY,top:o*t};return eM("div",{onScroll:this.handleScroll,...s,children:eM("div",{role:"presentation",style:p,children:eM("div",{role:"presentation",style:d,children:h.map(i)})})})}}function eJ(){return eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:11,height:14.5,viewBox:"0 0 44 58",children:eM("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 e1(){return eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",style:{minWidth:16,marginRight:3},viewBox:"0 0 276.157 276.157",children:eM("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 e0(){return eM("svg",{"aria-hidden":"true",focusable:"false",style:{width:16,marginRight:4},viewBox:"0 0 58 58",children:[eM("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"}),eM("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 e2({itemIconString:e,alt:t}){if(null===e)return null;switch(e){case"file":return eM(eJ,{});case"folder":return eM(e1,{});case"video":return eM(e0,{});default:return eM("img",{src:e,alt:t,referrerPolicy:"no-referrer",loading:"lazy",width:16,height:16})}}var e5=function({file:e,toggleCheckbox:t,className:i,isDisabled:r,restrictionError:s,showTitles:n,children:a=null,i18n:o}){return eM("li",{className:i,title:r&&s?s:void 0,children:[eM("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox uppy-ProviderBrowserItem-checkbox--grid",onChange:t,name:"listitem",id:e.id,checked:"checked"===e.status,disabled:r,"data-uppy-super-focusable":!0}),eM("label",{htmlFor:e.id,"aria-label":e.data.name??o("unnamed"),className:"uppy-u-reset uppy-ProviderBrowserItem-inner",children:[eM(e2,{itemIconString:e.data.thumbnail||e.data.icon}),n&&(e.data.name??o("unnamed")),a]})]})};function e3({file:e,openFolder:t,className:i,isDisabled:r,restrictionError:s,toggleCheckbox:n,showTitles:a,i18n:o}){return eM("li",{className:i,title:"checked"!==e.status&&s?s:void 0,children:[eM("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox",onChange:n,name:"listitem",id:e.id,checked:"checked"===e.status,"aria-label":e.data.isFolder?o("allFilesFromFolderNamed",{name:e.data.name??o("unnamed")}):null,disabled:r,"data-uppy-super-focusable":!0}),e.data.isFolder?eM("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowserItem-inner",onClick:()=>t(e.id),"aria-label":o("openFolderNamed",{name:e.data.name??o("unnamed")}),children:[eM("div",{className:"uppy-ProviderBrowserItem-iconWrap",children:eM(e2,{itemIconString:e.data.icon})}),a&&e.data.name?eM("span",{children:e.data.name}):o("unnamed")]}):eM("label",{htmlFor:e.id,className:"uppy-u-reset uppy-ProviderBrowserItem-inner",children:[eM("div",{className:"uppy-ProviderBrowserItem-iconWrap",children:eM(e2,{itemIconString:e.data.icon})}),a&&(e.data.name??o("unnamed"))]})]})}function e8(e){let{viewType:t,toggleCheckbox:i,showTitles:r,i18n:s,openFolder:n,file:a,utmSource:o}=e,l="folder"===a.type?null:a.restrictionError,u=!!l&&"checked"!==a.status,h={file:a,openFolder:n,toggleCheckbox:i,utmSource:o,i18n:s,viewType:t,showTitles:r,className:eK("uppy-ProviderBrowserItem",{"uppy-ProviderBrowserItem--disabled":u},{"uppy-ProviderBrowserItem--noPreview":"video"===a.data.icon},{"uppy-ProviderBrowserItem--is-checked":"checked"===a.status},{"uppy-ProviderBrowserItem--is-partial":"partial"===a.status}),isDisabled:u,restrictionError:l};switch(t){case"grid":return eM(e5,{...h});case"list":return eM(e3,{...h});case"unsplash":return eM(e5,{...h,children:eM("a",{href:`${a.data.author.url}?utm_source=${o}&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer",className:"uppy-ProviderBrowserItem-author",tabIndex:-1,children:a.data.author.name})});default:throw Error(`There is no such type ${t}`)}}var e4=function(e){let{displayedPartialTree:t,viewType:i,toggleCheckbox:r,handleScroll:s,showTitles:n,i18n:a,isLoading:o,openFolder:l,noResultsLabel:u,virtualList:h,utmSource:p}=e,[d,c]=J(!1);if(ee(()=>{let e=e=>{"Shift"===e.key&&c(!1)},t=e=>{"Shift"===e.key&&c(!0)};return document.addEventListener("keyup",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("keyup",e),document.removeEventListener("keydown",t)}},[]),o)return eM("div",{className:"uppy-Provider-loading",children:"string"==typeof o?o:a("loading")});if(0===t.length)return eM("div",{className:"uppy-Provider-empty",children:u});let f=e=>eM(e8,{viewType:i,toggleCheckbox:t=>{t.stopPropagation(),t.preventDefault(),document.getSelection()?.removeAllRanges(),r(e,d)},showTitles:n,i18n:a,openFolder:l,file:e,utmSource:p});return h?eM("div",{className:"uppy-ProviderBrowser-body",children:eM("ul",{className:"uppy-ProviderBrowser-list",children:eM(eQ,{data:t,renderRow:f,rowHeight:31})})}):eM("div",{className:"uppy-ProviderBrowser-body",children:eM("ul",{className:"uppy-ProviderBrowser-list",onScroll:s,tabIndex:-1,children:t.map(f)})})},e6=e=>e.filter(t=>"file"===t.type&&"checked"===t.status||"folder"===t.type&&"checked"===t.status&&!e.some(e=>"root"!==e.type&&e.parentId===t.id)).length;function e7({cancelSelection:e,donePicking:t,i18n:i,partialTree:r,validateAggregateRestrictions:s}){let n=ei(()=>s(r),[r,s]),a=ei(()=>e6(r),[r]);return 0===a?null:eM("div",{className:"uppy-ProviderBrowser-footer",children:[eM("div",{className:"uppy-ProviderBrowser-footer-buttons",children:[eM("button",{className:eK("uppy-u-reset uppy-c-btn uppy-c-btn-primary",{"uppy-c-btn--disabled":n}),disabled:!!n,onClick:t,type:"button",children:i("selectX",{smart_count:a})}),eM("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link",onClick:e,type:"button",children:i("cancel")})]}),n&&eM("div",{className:"uppy-ProviderBrowser-footer-error",children:n})]})}let e9=(e=21)=>{let t="",i=0|e;for(;i--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t};var te=function({searchString:e,setSearchString:t,submitSearchString:i,wrapperClassName:r,inputClassName:s,inputLabel:n,clearSearchLabel:a="",showButton:o=!1,buttonLabel:l="",buttonCSSClassName:u=""}){let h=er(e=>{e.preventDefault(),i()},[i]),[p]=J(()=>{let e=document.createElement("form");return e.setAttribute("tabindex","-1"),e.id=e9(),e});return ee(()=>(document.body.appendChild(p),p.addEventListener("submit",h),()=>{p.removeEventListener("submit",h),document.body.removeChild(p)}),[p,h]),eM("section",{className:r,children:[eM("input",{className:`uppy-u-reset ${s}`,type:"search","aria-label":n,placeholder:n,value:e,onInput:e=>{t(e.target.value)},form:p.id,"data-uppy-super-focusable":!0}),!o&&eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-ProviderBrowser-searchFilterIcon",width:"12",height:"12",viewBox:"0 0 12 12",children:eM("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"})}),!o&&e&&eM("button",{className:"uppy-u-reset uppy-ProviderBrowser-searchFilterReset",type:"button","aria-label":a,title:a,onClick:()=>t(""),children:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",viewBox:"0 0 19 19",children:eM("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"})})}),o&&eM("button",{className:`uppy-u-reset uppy-c-btn uppy-c-btn-primary ${u}`,type:"submit",form:p.id,children:l})]})},tt=i(72658),ti=(e,t,i)=>({id:e.id,source:t.id,name:e.name||e.id,type:e.mimeType,isRemote:!0,data:e,preview:e.thumbnail||void 0,meta:{authorName:e.author?.name,authorUrl:e.author?.url,relativePath:e.relDirPath||null,absolutePath:e.absDirPath},body:{fileId:e.id},remote:{companionUrl:t.opts.companionUrl,url:`${i.fileUrl(e.requestPath)}`,body:{fileId:e.id},providerName:i.name,provider:i.provider,requestClientId:i.provider}}),tr=(e,t,i)=>{let r=e.map(e=>ti(e,t,i)),s=[],n=[];r.forEach(e=>{t.uppy.checkIfFileAlreadyExists((0,tt.H)(e,t.uppy.getID()))?n.push(e):s.push(e)}),s.length>0&&t.uppy.info(t.uppy.i18n("addedNumFiles",{numFiles:s.length})),n.length>0&&t.uppy.info(`Not adding ${n.length} files because they already exist`),t.uppy.addFiles(s)},ts=(e,t,i,r)=>{let s=t.findIndex(e=>e.id===r);if(-1!==s&&i){let i=t.findIndex(t=>t.id===e);return t.slice(Math.min(s,i),Math.max(s,i)+1).map(e=>e.id)}return[e]},tn=e=>t=>{if(!t.isAuthError){if("AbortError"===t.name){e.log("Aborting request","warning");return}e.log(t,"error"),"UserFacingApiError"===t.name&&e.info({message:e.i18n("companionError"),details:e.i18n(t.message)},"warning",5e3)}},ta=(e,t)=>{let i=e.find(e=>e.id===t),r=[];for(;r=[i,...r],"root"!==i.type;){let t=i.parentId;i=e.find(e=>e.id===t)}return r};let to=(e,t,i)=>{let r=null===t?"null":t;if(i[r])return i[r];let s=e.find(e=>e.id===t);if("root"===s.type)return[];let n=[...to(e,s.parentId,i),s];return i[r]=n,n};var tl=e=>{let t=Object.create(null);return e.filter(e=>"file"===e.type&&"checked"===e.status).map(i=>{let r=to(e,i.id,t),s=r.findIndex(e=>"folder"===e.type&&"checked"===e.status),n=r.slice(s),a=`/${r.map(e=>e.data.name).join("/")}`,o=1===n.length?void 0:n.map(e=>e.data.name).join("/");return{...i.data,absDirPath:a,relDirPath:o}})},tu=i(66703);class th extends Error{constructor(e){super(e),this.name="TimeoutError"}}class tp extends Error{constructor(e){super(),this.name="AbortError",this.message=e}}let td=e=>void 0===globalThis.DOMException?new tp(e):new DOMException(e),tc=e=>{let t=void 0===e.reason?td("This operation was aborted."):e.reason;return t instanceof Error?t:td(t)};class tf{#k=[];enqueue(e,t){let i={priority:(t={priority:0,...t}).priority,id:t.id,run:e};if(0===this.size||this.#k[this.size-1].priority>=t.priority){this.#k.push(i);return}let r=function(e,t,i){let r=0,s=e.length;for(;s>0;){let n=Math.trunc(s/2),a=r+n;0>=i(e[a],t)?(r=++a,s-=n+1):s=n}return r}(this.#k,i,(e,t)=>t.priority-e.priority);this.#k.splice(r,0,i)}setPriority(e,t){let i=this.#k.findIndex(t=>t.id===e);if(-1===i)throw ReferenceError(`No promise function with the id "${e}" exists in the queue.`);let[r]=this.#k.splice(i,1);this.enqueue(r.run,{priority:t,id:e})}dequeue(){let e=this.#k.shift();return e?.run}filter(e){return this.#k.filter(t=>t.priority===e.priority).map(e=>e.run)}get size(){return this.#k.length}}class tg extends tu{#eZ;#eY;#eQ=0;#eJ;#e1;#e0=0;#e2;#e5;#k;#e3;#e8=0;#e4;#e6;#e7;#e9=1n;timeout;constructor(e){if(super(),!("number"==typeof(e={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:tf,...e}).intervalCap&&e.intervalCap>=1))throw TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${e.intervalCap?.toString()??""}\` (${typeof e.intervalCap})`);if(void 0===e.interval||!(Number.isFinite(e.interval)&&e.interval>=0))throw TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${e.interval?.toString()??""}\` (${typeof e.interval})`);this.#eZ=e.carryoverConcurrencyCount,this.#eY=e.intervalCap===Number.POSITIVE_INFINITY||0===e.interval,this.#eJ=e.intervalCap,this.#e1=e.interval,this.#k=new e.queueClass,this.#e3=e.queueClass,this.concurrency=e.concurrency,this.timeout=e.timeout,this.#e7=!0===e.throwOnTimeout,this.#e6=!1===e.autoStart}get #te(){return this.#eY||this.#eQ<this.#eJ}get #tt(){return this.#e8<this.#e4}#F(){this.#e8--,this.#ti(),this.emit("next")}#tr(){this.#ts(),this.#tn(),this.#e5=void 0}get #ta(){let e=Date.now();if(void 0===this.#e2){let t=this.#e0-e;if(!(t<0))return void 0===this.#e5&&(this.#e5=setTimeout(()=>{this.#tr()},t)),!0;this.#eQ=this.#eZ?this.#e8:0}return!1}#ti(){if(0===this.#k.size)return this.#e2&&clearInterval(this.#e2),this.#e2=void 0,this.emit("empty"),0===this.#e8&&this.emit("idle"),!1;if(!this.#e6){let e=!this.#ta;if(this.#te&&this.#tt){let t=this.#k.dequeue();return!!t&&(this.emit("active"),t(),e&&this.#tn(),!0)}}return!1}#tn(){this.#eY||void 0!==this.#e2||(this.#e2=setInterval(()=>{this.#ts()},this.#e1),this.#e0=Date.now()+this.#e1)}#ts(){0===this.#eQ&&0===this.#e8&&this.#e2&&(clearInterval(this.#e2),this.#e2=void 0),this.#eQ=this.#eZ?this.#e8:0,this.#to()}#to(){for(;this.#ti(););}get concurrency(){return this.#e4}set concurrency(e){if(!("number"==typeof e&&e>=1))throw TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this.#e4=e,this.#to()}async #tl(e){return new Promise((t,i)=>{e.addEventListener("abort",()=>{i(e.reason)},{once:!0})})}setPriority(e,t){this.#k.setPriority(e,t)}async add(e,t={}){return t.id??=(this.#e9++).toString(),t={timeout:this.timeout,throwOnTimeout:this.#e7,...t},new Promise((i,r)=>{this.#k.enqueue(async()=>{this.#e8++,this.#eQ++;try{t.signal?.throwIfAborted();let r=e({signal:t.signal});t.timeout&&(r=function(e,t){let i,r;let{milliseconds:s,fallback:n,message:a,customTimers:o={setTimeout,clearTimeout}}=t,l=new Promise((l,u)=>{if("number"!=typeof s||1!==Math.sign(s))throw TypeError(`Expected \`milliseconds\` to be a positive number, got \`${s}\``);if(t.signal){let{signal:e}=t;e.aborted&&u(tc(e)),r=()=>{u(tc(e))},e.addEventListener("abort",r,{once:!0})}if(s===Number.POSITIVE_INFINITY){e.then(l,u);return}let h=new th;i=o.setTimeout.call(void 0,()=>{if(n){try{l(n())}catch(e){u(e)}return}"function"==typeof e.cancel&&e.cancel(),!1===a?l():a instanceof Error?u(a):(h.message=a??`Promise timed out after ${s} milliseconds`,u(h))},s),(async()=>{try{l(await e)}catch(e){u(e)}})()}).finally(()=>{l.clear(),r&&t.signal&&t.signal.removeEventListener("abort",r)});return l.clear=()=>{o.clearTimeout.call(void 0,i),i=void 0},l}(Promise.resolve(r),{milliseconds:t.timeout})),t.signal&&(r=Promise.race([r,this.#tl(t.signal)]));let s=await r;i(s),this.emit("completed",s)}catch(e){if(e instanceof th&&!t.throwOnTimeout){i();return}r(e),this.emit("error",e)}finally{this.#F()}},t),this.emit("add"),this.#ti()})}async addAll(e,t){return Promise.all(e.map(async e=>this.add(e,t)))}start(){return this.#e6&&(this.#e6=!1,this.#to()),this}pause(){this.#e6=!0}clear(){this.#k=new this.#e3}async onEmpty(){0!==this.#k.size&&await this.#tu("empty")}async onSizeLessThan(e){this.#k.size<e||await this.#tu("next",()=>this.#k.size<e)}async onIdle(){(0!==this.#e8||0!==this.#k.size)&&await this.#tu("idle")}async #tu(e,t){return new Promise(i=>{let r=()=>{(!t||t())&&(this.off(e,r),i())};this.on(e,r)})}get size(){return this.#k.size}sizeBy(e){return this.#k.filter(e).length}get pending(){return this.#e8}get isPaused(){return this.#e6}}var tm=e=>e.map(e=>({...e}));let ty=async(e,t,i,r,s)=>{let n=[],a=i.cached?i.nextPagePath:i.id;for(;a;){let e=await r(a);n=n.concat(e.items),a=e.nextPagePath}let o=n.filter(e=>!0===e.isFolder),l=n.filter(e=>!1===e.isFolder),u=o.map(e=>({type:"folder",id:e.requestPath,cached:!1,nextPagePath:null,status:"checked",parentId:i.id,data:e})),h=l.map(e=>{let t=s(e);return{type:"file",id:e.requestPath,restrictionError:t,status:t?"unchecked":"checked",parentId:i.id,data:e}});i.cached=!0,i.nextPagePath=null,t.push(...h,...u),u.forEach(async i=>{e.add(()=>ty(e,t,i,r,s))})},tv=(e,t,i)=>{e.filter(e=>"root"!==e.type&&e.parentId===t).forEach(t=>{t.status=i&&!("file"===t.type&&t.restrictionError)?"checked":"unchecked",tv(e,t.id,i)})},tb=(e,t)=>{let i=e.find(e=>e.id===t);if("root"===i.type)return;let r=e.filter(e=>"root"!==e.type&&e.parentId===i.id&&!("file"===e.type&&e.restrictionError)),s=r.every(e=>"checked"===e.status),n=r.every(e=>"unchecked"===e.status);s?i.status="checked":n?i.status="unchecked":i.status="partial",tb(e,i.parentId)};var tw={afterOpenFolder:(e,t,i,r,s)=>{let n=t.filter(e=>!0===e.isFolder),a=t.filter(e=>!1===e.isFolder),o="folder"===i.type&&"checked"===i.status,l=n.map(e=>({type:"folder",id:e.requestPath,cached:!1,nextPagePath:null,status:o?"checked":"unchecked",parentId:i.id,data:e})),u=a.map(e=>{let t=s(e);return{type:"file",id:e.requestPath,restrictionError:t,status:o&&!t?"checked":"unchecked",parentId:i.id,data:e}}),h={...i,cached:!0,nextPagePath:r};return[...e.map(e=>e.id===h.id?h:e),...l,...u]},afterScrollFolder:(e,t,i,r,s)=>{let n=e.find(e=>e.id===t),a=i.filter(e=>!0===e.isFolder),o=i.filter(e=>!1===e.isFolder),l={...n,nextPagePath:r},u=e.map(e=>e.id===l.id?l:e),h="folder"===l.type&&"checked"===l.status;return[...u,...a.map(e=>({type:"folder",id:e.requestPath,cached:!1,nextPagePath:null,status:h?"checked":"unchecked",parentId:l.id,data:e})),...o.map(e=>{let t=s(e);return{type:"file",id:e.requestPath,restrictionError:t,status:h&&!t?"checked":"unchecked",parentId:l.id,data:e}})]},afterToggleCheckbox:(e,t)=>{let i=tm(e);if(t.length>=2){let e=i.filter(e=>"root"!==e.type&&t.includes(e.id));e.forEach(e=>{"file"===e.type?e.status=e.restrictionError?"unchecked":"checked":e.status="checked"}),e.forEach(e=>{tv(i,e.id,!0)}),tb(i,e[0].parentId)}else{let e=i.find(e=>e.id===t[0]);e.status="checked"===e.status?"unchecked":"checked",tv(i,e.id,"checked"===e.status),tb(i,e.parentId)}return i},afterFill:async(e,t,i,r)=>{let s=new tg({concurrency:6}),n=tm(e);return n.filter(e=>"folder"===e.type&&"checked"===e.status&&(!1===e.cached||e.nextPagePath)).forEach(e=>{s.add(()=>ty(s,n,e,t,i))}),s.on("completed",()=>{r(n.filter(e=>"file"===e.type&&"checked"===e.status).length)}),await s.onIdle(),n}},t_=e=>{let{scrollHeight:t,scrollTop:i,offsetHeight:r}=e.target;return t-(i+r)<50};function tS(e){let{openFolder:t,title:i,breadcrumbsIcon:r,breadcrumbs:s,i18n:n}=e;return eM("div",{className:"uppy-Provider-breadcrumbs",children:[eM("div",{className:"uppy-Provider-breadcrumbsIcon",children:r}),s.map((e,r)=>eM(P,{children:[eM("button",{type:"button",className:"uppy-u-reset uppy-c-btn",onClick:()=>t(e.id),children:"root"===e.type?i:e.data.name??n("unnamed")},e.id),s.length===r+1?"":" / "]}))]})}function tC({i18n:e,logout:t,username:i}){return eM(P,{children:[i&&eM("span",{className:"uppy-ProviderBrowser-user",children:i},"username"),eM("button",{type:"button",onClick:t,className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowser-userLogout",children:e("logOut")},"logout")]})}function tP(e){return eM("div",{className:"uppy-ProviderBrowser-header",children:eM("div",{className:eK("uppy-ProviderBrowser-headerBar",!e.showBreadcrumbs&&"uppy-ProviderBrowser-headerBar--simple"),children:[e.showBreadcrumbs&&eM(tS,{openFolder:e.openFolder,breadcrumbs:e.breadcrumbs,breadcrumbsIcon:e.pluginIcon?.(),title:e.title,i18n:e.i18n}),eM(tC,{logout:e.logout,username:e.username,i18n:e.i18n})]})})}function tF(){return eM("svg",{"aria-hidden":"true",focusable:"false",width:"30",height:"30",viewBox:"0 0 30 30",children:eM("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"})})}let tk=e=>({authenticated:void 0,partialTree:[{type:"root",id:e,cached:!1,nextPagePath:null}],currentFolderId:e,searchString:"",didFirstRender:!1,username:null,loading:!1});class tT{static VERSION=eX;plugin;provider;opts;isHandlingScroll=!1;lastCheckbox=null;constructor(e,t){this.plugin=e,this.provider=t.provider,this.opts={viewType:"list",showTitles:!0,showFilter:!0,showBreadcrumbs:!0,loadAllFiles:!1,virtualList:!1,...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(tk(this.plugin.rootFolderId))}tearDown(){}setLoading(e){this.plugin.setPluginState({loading:e})}cancelSelection(){let{partialTree:e}=this.plugin.getPluginState(),t=e.map(e=>"root"===e.type?e:{...e,status:"unchecked"});this.plugin.setPluginState({partialTree:t})}#x;async #th(e){this.#x?.abort();let t=new AbortController;this.#x=t;let i=()=>{t.abort()};try{this.plugin.uppy.on("dashboard:close-panel",i),this.plugin.uppy.on("cancel-all",i),await e(t.signal)}finally{this.plugin.uppy.off("dashboard:close-panel",i),this.plugin.uppy.off("cancel-all",i),this.#x=void 0}}async openFolder(e){this.lastCheckbox=null;let{partialTree:t}=this.plugin.getPluginState(),i=t.find(t=>t.id===e);if(i.cached){this.plugin.setPluginState({currentFolderId:e,searchString:""});return}this.setLoading(!0),await this.#th(async r=>{let s=e,n=[];do{let{username:e,nextPagePath:t,items:i}=await this.provider.list(s,{signal:r});this.plugin.setPluginState({username:e}),s=t,n=n.concat(i),this.setLoading(this.plugin.uppy.i18n("loadedXFiles",{numFiles:n.length}))}while(this.opts.loadAllFiles&&s);let a=tw.afterOpenFolder(t,n,i,s,this.validateSingleFile);this.plugin.setPluginState({partialTree:a,currentFolderId:e,searchString:""})}).catch(tn(this.plugin.uppy)),this.setLoading(!1)}async logout(){await this.#th(async e=>{let t=await this.provider.logout({signal:e});if(t.ok){if(!t.revoked){let e=this.plugin.uppy.i18n("companionUnauthorizeHint",{provider:this.plugin.title,url:t.manual_revoke_url});this.plugin.uppy.info(e,"info",7e3)}this.plugin.setPluginState({...tk(this.plugin.rootFolderId),authenticated:!1})}}).catch(tn(this.plugin.uppy))}async handleAuth(e){await this.#th(async t=>{this.setLoading(!0),await this.provider.login({authFormData:e,signal:t}),this.plugin.setPluginState({authenticated:!0}),await Promise.all([this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId)])}).catch(tn(this.plugin.uppy)),this.setLoading(!1)}async handleScroll(e){let{partialTree:t,currentFolderId:i}=this.plugin.getPluginState(),r=t.find(e=>e.id===i);t_(e)&&!this.isHandlingScroll&&r.nextPagePath&&(this.isHandlingScroll=!0,await this.#th(async e=>{let{nextPagePath:s,items:n}=await this.provider.list(r.nextPagePath,{signal:e}),a=tw.afterScrollFolder(t,i,n,s,this.validateSingleFile);this.plugin.setPluginState({partialTree:a})}).catch(tn(this.plugin.uppy)),this.isHandlingScroll=!1)}validateSingleFile=e=>{let t=eG(e);return this.plugin.uppy.validateSingleFile(t)};async donePicking(){let{partialTree:e}=this.plugin.getPluginState();this.setLoading(!0),await this.#th(async t=>{let i=await tw.afterFill(e,e=>this.provider.list(e,{signal:t}),this.validateSingleFile,e=>{this.setLoading(this.plugin.uppy.i18n("addedNumFiles",{numFiles:e}))});if(this.validateAggregateRestrictions(i)){this.plugin.setPluginState({partialTree:i});return}tr(tl(i),this.plugin,this.provider),this.resetPluginState()}).catch(tn(this.plugin.uppy)),this.setLoading(!1)}toggleCheckbox(e,t){let{partialTree:i}=this.plugin.getPluginState(),r=ts(e.id,this.getDisplayedPartialTree(),t,this.lastCheckbox),s=tw.afterToggleCheckbox(i,r);this.plugin.setPluginState({partialTree:s}),this.lastCheckbox=e.id}getDisplayedPartialTree=()=>{let{partialTree:e,currentFolderId:t,searchString:i}=this.plugin.getPluginState(),r=e.filter(e=>"root"!==e.type&&e.parentId===t);return""===i?r:r.filter(e=>-1!==(e.data.name??this.plugin.uppy.i18n("unnamed")).toLowerCase().indexOf(i.toLowerCase()))};getBreadcrumbs=()=>{let{partialTree:e,currentFolderId:t}=this.plugin.getPluginState();return ta(e,t)};getSelectedAmount=()=>{let{partialTree:e}=this.plugin.getPluginState();return e6(e)};validateAggregateRestrictions=e=>{let t=e.filter(e=>"file"===e.type&&"checked"===e.status).map(e=>e.data);return this.plugin.uppy.validateAggregateRestrictions(t)};render(e,t={}){let{didFirstRender:i}=this.plugin.getPluginState(),{i18n:r}=this.plugin.uppy;i||(this.plugin.setPluginState({didFirstRender:!0}),this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId));let s={...this.opts,...t},{authenticated:n,loading:a}=this.plugin.getPluginState(),o=this.plugin.icon||tF;if(!1===n)return eM(eV,{pluginName:this.plugin.title,pluginIcon:o,handleAuth:this.handleAuth,i18n:this.plugin.uppy.i18n,renderForm:s.renderAuthForm,loading:a});let{partialTree:l,username:u,searchString:h}=this.plugin.getPluginState(),p=this.getBreadcrumbs();return eM("div",{className:eK("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${s.viewType}`),children:[eM(tP,{showBreadcrumbs:s.showBreadcrumbs,openFolder:this.openFolder,breadcrumbs:p,pluginIcon:o,title:this.plugin.title,logout:this.logout,username:u,i18n:r}),s.showFilter&&eM(te,{searchString:h,setSearchString:e=>{this.plugin.setPluginState({searchString:e})},submitSearchString:()=>{},inputLabel:r("filter"),clearSearchLabel:r("resetFilter"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),eM(e4,{toggleCheckbox:this.toggleCheckbox,displayedPartialTree:this.getDisplayedPartialTree(),openFolder:this.openFolder,virtualList:s.virtualList,noResultsLabel:r("noFilesFound"),handleScroll:this.handleScroll,viewType:s.viewType,showTitles:s.showTitles,i18n:this.plugin.uppy.i18n,isLoading:a,utmSource:"Companion"}),eM(e7,{partialTree:l,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:r,validateAggregateRestrictions:this.validateAggregateRestrictions})]})}}let tE={loading:!1,searchString:"",partialTree:[{type:"root",id:null,cached:!1,nextPagePath:null}],currentFolderId:null,isInputMode:!0},tA={viewType:"grid",showTitles:!0,showFilter:!0,utmSource:"Companion"};class tx{static VERSION=eX;plugin;provider;opts;isHandlingScroll=!1;lastCheckbox=null;constructor(e,t){this.plugin=e,this.provider=t.provider,this.opts={...tA,...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(tE)}cancelSelection(){let{partialTree:e}=this.plugin.getPluginState(),t=e.map(e=>"root"===e.type?e:{...e,status:"unchecked"});this.plugin.setPluginState({partialTree:t})}async search(){let{searchString:e}=this.plugin.getPluginState();if(""!==e){this.setLoading(!0);try{let t=await this.provider.search(e),i=[{type:"root",id:null,cached:!1,nextPagePath:t.nextPageQuery},...t.items.map(e=>({type:"file",id:e.requestPath,status:"unchecked",parentId:null,data:e}))];this.plugin.setPluginState({partialTree:i,isInputMode:!1})}catch(e){tn(this.plugin.uppy)(e)}this.setLoading(!1)}}async handleScroll(e){let{partialTree:t,searchString:i}=this.plugin.getPluginState(),r=t.find(e=>"root"===e.type);if(t_(e)&&!this.isHandlingScroll&&r.nextPagePath){this.isHandlingScroll=!0;try{let e=await this.provider.search(i,r.nextPagePath),s={...r,nextPagePath:e.nextPageQuery},n=t.filter(e=>"root"!==e.type),a=[s,...n,...e.items.map(e=>({type:"file",id:e.requestPath,status:"unchecked",parentId:null,data:e}))];this.plugin.setPluginState({partialTree:a})}catch(e){tn(this.plugin.uppy)(e)}this.isHandlingScroll=!1}}async donePicking(){let{partialTree:e}=this.plugin.getPluginState();tr(tl(e),this.plugin,this.provider),this.resetPluginState()}toggleCheckbox(e,t){let{partialTree:i}=this.plugin.getPluginState(),r=ts(e.id,this.getDisplayedPartialTree(),t,this.lastCheckbox),s=tw.afterToggleCheckbox(i,r);this.plugin.setPluginState({partialTree:s}),this.lastCheckbox=e.id}validateSingleFile=e=>{let t=eG(e);return this.plugin.uppy.validateSingleFile(t)};getDisplayedPartialTree=()=>{let{partialTree:e}=this.plugin.getPluginState();return e.filter(e=>"root"!==e.type)};setSearchString=e=>{this.plugin.setPluginState({searchString:e}),""===e&&this.plugin.setPluginState({partialTree:[]})};validateAggregateRestrictions=e=>{let t=e.filter(e=>"file"===e.type&&"checked"===e.status).map(e=>e.data);return this.plugin.uppy.validateAggregateRestrictions(t)};render(e,t={}){let{isInputMode:i,searchString:r,loading:s,partialTree:n}=this.plugin.getPluginState(),{i18n:a}=this.plugin.uppy,o={...this.opts,...t};return i?eM(te,{searchString:r,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:a("enterTextToSearch"),buttonLabel:a("searchImages"),wrapperClassName:"uppy-SearchProvider",inputClassName:"uppy-c-textInput uppy-SearchProvider-input",showButton:!0,buttonCSSClassName:"uppy-SearchProvider-searchButton"}):eM("div",{className:eK("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${o.viewType}`),children:[o.showFilter&&eM(te,{searchString:r,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:a("search"),clearSearchLabel:a("resetSearch"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),eM(e4,{toggleCheckbox:this.toggleCheckbox,displayedPartialTree:this.getDisplayedPartialTree(),handleScroll:this.handleScroll,openFolder:async()=>{},noResultsLabel:a("noSearchResults"),viewType:o.viewType,showTitles:o.showTitles,isLoading:s,i18n:a,virtualList:!1,utmSource:this.opts.utmSource}),eM(e7,{partialTree:n,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:a,validateAggregateRestrictions:this.validateAggregateRestrictions})]})}}function tI(e,t,i,r){return 0===i||e===t?e:0===r?t:e+(t-e)*2**(-r/i)}var tU={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"}},tO={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete"},tD=i(85110);let tR=`\u00B7`,tN=()=>` ${tR} `;function tM(e){let{newFiles:t,isUploadStarted:i,recoveredState:r,i18n:s,uploadState:n,isSomeGhost:a,startUpload:o}=e,l=eK("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--upload",{"uppy-c-btn-primary":n===tO.STATE_WAITING},{"uppy-StatusBar-actionBtn--disabled":a}),u=s(t&&i&&!r?"uploadXNewFiles":"uploadXFiles",{smart_count:t});return eM("button",{type:"button",className:l,"aria-label":s("uploadXFiles",{smart_count:t}),onClick:o,disabled:a,"data-uppy-super-focusable":!0,children:u})}function tB(e){let{i18n:t,uppy:i}=e;return eM("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--retry","aria-label":t("retryUpload"),onClick:()=>i.retryAll().catch(()=>{}),"data-uppy-super-focusable":!0,"data-cy":"retry",children:[eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"8",height:"10",viewBox:"0 0 8 10",children:eM("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"})}),t("retry")]})}function tL(e){let{i18n:t,uppy:i}=e;return eM("button",{type:"button",className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",title:t("cancel"),"aria-label":t("cancel"),onClick:()=>i.cancelAll(),"data-cy":"cancel","data-uppy-super-focusable":!0,children:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16",children:eM("g",{fill:"none",fillRule:"evenodd",children:[eM("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),eM("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 tz(e){let{isAllPaused:t,i18n:i,isAllComplete:r,resumableUploads:s,uppy:n}=e,a=i(t?"resume":"pause");return eM("button",{title:a,"aria-label":a,className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",type:"button",onClick:function(){if(!r){if(!s){n.cancelAll();return}if(t){n.resumeAll();return}n.pauseAll()}},"data-cy":"togglePauseResume","data-uppy-super-focusable":!0,children:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16",children:eM("g",{fill:"none",fillRule:"evenodd",children:[eM("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),eM("path",{fill:"#FFF",d:t?"M6 4.25L11.5 8 6 11.75z":"M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z"})]})})})}function t$(e){let{i18n:t,doneButtonHandler:i}=e;return eM("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--done",onClick:i,"data-uppy-super-focusable":!0,children:t("done")})}function tq(){return eM("svg",{className:"uppy-StatusBar-spinner","aria-hidden":"true",focusable:"false",width:"14",height:"14",children:eM("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 tH(e){let{progress:t}=e,{value:i,mode:r,message:s}=t,n=`\u00B7`;return eM("div",{className:"uppy-StatusBar-content",children:[eM(tq,{}),"determinate"===r?`${Math.round(100*i)}% ${n} `:"",s]})}function tj(e){let{numUploads:t,complete:i,totalUploadedSize:r,totalSize:s,totalETA:n,i18n:a}=e,o=t>1,l=tD(r);return eM("div",{className:"uppy-StatusBar-statusSecondary",children:[o&&a("filesUploadedOfTotal",{complete:i,smart_count:t}),eM("span",{className:"uppy-StatusBar-additionalInfo",children:[o&&tN(),null!=s?a("dataUploadedOfTotal",{complete:l,total:tD(s)}):a("dataUploadedOfUnknown",{complete:l}),tN(),null!=n&&a("xTimeLeft",{time:function(e){let t={hours:Math.floor(e/3600)%24,minutes:Math.floor(e/60)%60,seconds:Math.floor(e%60)},i=0===t.hours?"":`${t.hours}h`,r=0===t.minutes?"":`${0===t.hours?t.minutes:` ${t.minutes.toString(10).padStart(2,"0")}`}m`,s=0!==t.hours?"":`${0===t.minutes?t.seconds:` ${t.seconds.toString(10).padStart(2,"0")}`}s`;return`${i}${r}${s}`}(n)})]})]})}function tV(e){let{i18n:t,complete:i,numUploads:r}=e;return eM("div",{className:"uppy-StatusBar-statusSecondary",children:t("filesUploadedOfTotal",{complete:i,smart_count:r})})}function tW(e){let{i18n:t,newFiles:i,startUpload:r}=e,s=eK("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--uploadNewlyAdded");return eM("div",{className:"uppy-StatusBar-statusSecondary",children:[eM("div",{className:"uppy-StatusBar-statusSecondaryHint",children:t("xMoreFilesAdded",{smart_count:i})}),eM("button",{type:"button",className:s,"aria-label":t("uploadXFiles",{smart_count:i}),onClick:r,children:t("upload")})]})}function tG(e){let{i18n:t,supportsUploadProgress:i,totalProgress:r,showProgressDetails:s,isUploadStarted:n,isAllComplete:a,isAllPaused:o,newFiles:l,numUploads:u,complete:h,totalUploadedSize:p,totalSize:d,totalETA:c,startUpload:f}=e,g=l&&n;if(!n||a)return null;let m=t(o?"paused":"uploading");return eM("div",{className:"uppy-StatusBar-content",title:m,children:[o?null:eM(tq,{}),eM("div",{className:"uppy-StatusBar-status",children:[eM("div",{className:"uppy-StatusBar-statusPrimary",children:i&&0!==r?`${m}: ${r}%`:m}),o||g||!s?null:i?eM(tj,{numUploads:u,complete:h,totalUploadedSize:p,totalSize:d,totalETA:c,i18n:t}):eM(tV,{i18n:t,complete:h,numUploads:u}),g?eM(tW,{i18n:t,newFiles:l,startUpload:f}):null]})]})}function tK(e){let{i18n:t}=e;return eM("div",{className:"uppy-StatusBar-content",role:"status",title:t("complete"),children:eM("div",{className:"uppy-StatusBar-status",children:eM("div",{className:"uppy-StatusBar-statusPrimary",children:[eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"15",height:"11",viewBox:"0 0 15 11",children:eM("path",{d:"M.414 5.843L1.627 4.63l3.472 3.472L13.202 0l1.212 1.213L5.1 10.528z"})}),t("complete")]})})})}function tX(e){let{error:t,i18n:i,complete:r,numUploads:s}=e;return eM("div",{className:"uppy-StatusBar-content",title:i("uploadFailed"),children:[eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"11",height:"11",viewBox:"0 0 11 11",children:eM("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"})}),eM("div",{className:"uppy-StatusBar-status",children:[eM("div",{className:"uppy-StatusBar-statusPrimary",children:[i("uploadFailed"),eM("button",{className:"uppy-u-reset uppy-StatusBar-details","aria-label":i("showErrorDetails"),"data-microtip-position":"top-right","data-microtip-size":"medium",onClick:function(){alert(`${i("uploadFailed")}
|
|
7
|
+
${e.details}`),children:"?"})]})},e.message))})});install(){let{target:e}=this.opts;e&&this.mount(e,this)}}function eq(){return eM("svg",{width:"26",height:"26",viewBox:"0 0 26 26",xmlns:"http://www.w3.org/2000/svg",children:eM("g",{fill:"none","fill-rule":"evenodd",children:[eM("circle",{fill:"#FFF",cx:"13",cy:"13",r:"13"}),eM("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"}),eM("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"}),eM("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"}),eM("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"}),eM("path",{d:"M4 4h18v18H4z"})]})})}function ej({pluginName:e,i18n:t,onAuth:i}){let r="Google Drive"===e;return eM("form",{onSubmit:er(e=>{e.preventDefault(),i()},[i]),children:r?eM("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,children:[eM(eq,{}),t("signInWithGoogle")]}):eM("button",{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn","data-uppy-super-focusable":!0,children:t("authenticateWith",{pluginName:e})})})}let eH=({pluginName:e,i18n:t,onAuth:i})=>eM(ej,{pluginName:e,i18n:t,onAuth:i});function eV({loading:e,pluginName:t,pluginIcon:i,i18n:r,handleAuth:s,renderForm:n=eH}){return eM("div",{className:"uppy-Provider-auth",children:[eM("div",{className:"uppy-Provider-authIcon",children:i()}),eM("div",{className:"uppy-Provider-authTitle",children:r("authenticateWithTitle",{pluginName:t})}),n({pluginName:t,i18n:r,loading:e,onAuth:s})]})}var eW=i(66547);function eG(e){return{...e,type:e.mimeType,extension:e.name?(0,eW.Z)(e.name).extension:null}}var eK=i(36760),eX="4.5.1";let eZ={position:"relative",width:"100%",minHeight:"100%"},eY={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"};class eQ extends F{constructor(e){super(e),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?.parentNode&&document.activeElement!==this.focusElement&&this.focusElement.focus(),this.focusElement=null,this.resize()}componentWillUnmount(){window.removeEventListener("resize",this.handleResize)}handleScroll=()=>{this.setState({offset:this.base.scrollTop})};handleResize=()=>{this.resize()};resize(){let{height:e}=this.state;e!==this.base.offsetHeight&&this.setState({height:this.base.offsetHeight})}render({data:e,rowHeight:t,renderRow:i,overscanCount:r=10,...s}){let{offset:n,height:a}=this.state,o=Math.floor(n/t),l=Math.floor(a/t);r&&(o=Math.max(0,o-o%r),l+=r);let u=o+l+4,h=e.slice(o,u),d={...eZ,height:e.length*t},p={...eY,top:o*t};return eM("div",{onScroll:this.handleScroll,...s,children:eM("div",{role:"presentation",style:d,children:eM("div",{role:"presentation",style:p,children:h.map(i)})})})}}function eJ(){return eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:11,height:14.5,viewBox:"0 0 44 58",children:eM("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 e0(){return eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",style:{minWidth:16,marginRight:3},viewBox:"0 0 276.157 276.157",children:eM("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 e1(){return eM("svg",{"aria-hidden":"true",focusable:"false",style:{width:16,marginRight:4},viewBox:"0 0 58 58",children:[eM("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"}),eM("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 e2({itemIconString:e,alt:t}){if(null===e)return null;switch(e){case"file":return eM(eJ,{});case"folder":return eM(e0,{});case"video":return eM(e1,{});default:return eM("img",{src:e,alt:t,referrerPolicy:"no-referrer",loading:"lazy",width:16,height:16})}}var e5=function({file:e,toggleCheckbox:t,className:i,isDisabled:r,restrictionError:s,showTitles:n,children:a=null,i18n:o}){return eM("li",{className:i,title:r&&s?s:void 0,children:[eM("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox uppy-ProviderBrowserItem-checkbox--grid",onChange:t,name:"listitem",id:e.id,checked:"checked"===e.status,disabled:r,"data-uppy-super-focusable":!0}),eM("label",{htmlFor:e.id,"aria-label":e.data.name??o("unnamed"),className:"uppy-u-reset uppy-ProviderBrowserItem-inner",children:[eM(e2,{itemIconString:e.data.thumbnail||e.data.icon}),n&&(e.data.name??o("unnamed")),a]})]})};function e3({file:e,openFolder:t,className:i,isDisabled:r,restrictionError:s,toggleCheckbox:n,showTitles:a,i18n:o}){return eM("li",{className:i,title:"checked"!==e.status&&s?s:void 0,children:[eM("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox",onChange:n,name:"listitem",id:e.id,checked:"checked"===e.status,"aria-label":e.data.isFolder?o("allFilesFromFolderNamed",{name:e.data.name??o("unnamed")}):null,disabled:r,"data-uppy-super-focusable":!0}),e.data.isFolder?eM("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowserItem-inner",onClick:()=>t(e.id),"aria-label":o("openFolderNamed",{name:e.data.name??o("unnamed")}),children:[eM("div",{className:"uppy-ProviderBrowserItem-iconWrap",children:eM(e2,{itemIconString:e.data.icon})}),a&&e.data.name?eM("span",{children:e.data.name}):o("unnamed")]}):eM("label",{htmlFor:e.id,className:"uppy-u-reset uppy-ProviderBrowserItem-inner",children:[eM("div",{className:"uppy-ProviderBrowserItem-iconWrap",children:eM(e2,{itemIconString:e.data.icon})}),a&&(e.data.name??o("unnamed"))]})]})}function e8(e){let{viewType:t,toggleCheckbox:i,showTitles:r,i18n:s,openFolder:n,file:a,utmSource:o}=e,l="folder"===a.type?null:a.restrictionError,u=!!l&&"checked"!==a.status,h={file:a,openFolder:n,toggleCheckbox:i,utmSource:o,i18n:s,viewType:t,showTitles:r,className:eK("uppy-ProviderBrowserItem",{"uppy-ProviderBrowserItem--disabled":u},{"uppy-ProviderBrowserItem--noPreview":"video"===a.data.icon},{"uppy-ProviderBrowserItem--is-checked":"checked"===a.status},{"uppy-ProviderBrowserItem--is-partial":"partial"===a.status}),isDisabled:u,restrictionError:l};switch(t){case"grid":return eM(e5,{...h});case"list":return eM(e3,{...h});case"unsplash":return eM(e5,{...h,children:eM("a",{href:`${a.data.author.url}?utm_source=${o}&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer",className:"uppy-ProviderBrowserItem-author",tabIndex:-1,children:a.data.author.name})});default:throw Error(`There is no such type ${t}`)}}var e4=function(e){let{displayedPartialTree:t,viewType:i,toggleCheckbox:r,handleScroll:s,showTitles:n,i18n:a,isLoading:o,openFolder:l,noResultsLabel:u,virtualList:h,utmSource:d}=e,[p,c]=J(!1);if(ee(()=>{let e=e=>{"Shift"===e.key&&c(!1)},t=e=>{"Shift"===e.key&&c(!0)};return document.addEventListener("keyup",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("keyup",e),document.removeEventListener("keydown",t)}},[]),o)return eM("div",{className:"uppy-Provider-loading",children:"string"==typeof o?o:a("loading")});if(0===t.length)return eM("div",{className:"uppy-Provider-empty",children:u});let f=e=>eM(e8,{viewType:i,toggleCheckbox:t=>{t.stopPropagation(),t.preventDefault(),document.getSelection()?.removeAllRanges(),r(e,p)},showTitles:n,i18n:a,openFolder:l,file:e,utmSource:d});return h?eM("div",{className:"uppy-ProviderBrowser-body",children:eM("ul",{className:"uppy-ProviderBrowser-list",children:eM(eQ,{data:t,renderRow:f,rowHeight:31})})}):eM("div",{className:"uppy-ProviderBrowser-body",children:eM("ul",{className:"uppy-ProviderBrowser-list",onScroll:s,tabIndex:-1,children:t.map(f)})})},e6=e=>e.filter(t=>"file"===t.type&&"checked"===t.status||"folder"===t.type&&"checked"===t.status&&!e.some(e=>"root"!==e.type&&e.parentId===t.id)).length;function e7({cancelSelection:e,donePicking:t,i18n:i,partialTree:r,validateAggregateRestrictions:s}){let n=ei(()=>s(r),[r,s]),a=ei(()=>e6(r),[r]);return 0===a?null:eM("div",{className:"uppy-ProviderBrowser-footer",children:[eM("div",{className:"uppy-ProviderBrowser-footer-buttons",children:[eM("button",{className:eK("uppy-u-reset uppy-c-btn uppy-c-btn-primary",{"uppy-c-btn--disabled":n}),disabled:!!n,onClick:t,type:"button",children:i("selectX",{smart_count:a})}),eM("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link",onClick:e,type:"button",children:i("cancel")})]}),n&&eM("div",{className:"uppy-ProviderBrowser-footer-error",children:n})]})}let e9=(e=21)=>{let t="",i=0|e;for(;i--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t};var te=function({searchString:e,setSearchString:t,submitSearchString:i,wrapperClassName:r,inputClassName:s,inputLabel:n,clearSearchLabel:a="",showButton:o=!1,buttonLabel:l="",buttonCSSClassName:u=""}){let h=er(e=>{e.preventDefault(),i()},[i]),[d]=J(()=>{let e=document.createElement("form");return e.setAttribute("tabindex","-1"),e.id=e9(),e});return ee(()=>(document.body.appendChild(d),d.addEventListener("submit",h),()=>{d.removeEventListener("submit",h),document.body.removeChild(d)}),[d,h]),eM("section",{className:r,children:[eM("input",{className:`uppy-u-reset ${s}`,type:"search","aria-label":n,placeholder:n,value:e,onInput:e=>{t(e.target.value)},form:d.id,"data-uppy-super-focusable":!0}),!o&&eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-ProviderBrowser-searchFilterIcon",width:"12",height:"12",viewBox:"0 0 12 12",children:eM("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"})}),!o&&e&&eM("button",{className:"uppy-u-reset uppy-ProviderBrowser-searchFilterReset",type:"button","aria-label":a,title:a,onClick:()=>t(""),children:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",viewBox:"0 0 19 19",children:eM("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"})})}),o&&eM("button",{className:`uppy-u-reset uppy-c-btn uppy-c-btn-primary ${u}`,type:"submit",form:d.id,children:l})]})},tt=i(72658),ti=(e,t,i)=>({id:e.id,source:t.id,name:e.name||e.id,type:e.mimeType,isRemote:!0,data:e,preview:e.thumbnail||void 0,meta:{authorName:e.author?.name,authorUrl:e.author?.url,relativePath:e.relDirPath||null,absolutePath:e.absDirPath},body:{fileId:e.id},remote:{companionUrl:t.opts.companionUrl,url:`${i.fileUrl(e.requestPath)}`,body:{fileId:e.id},providerName:i.name,provider:i.provider,requestClientId:i.provider}}),tr=(e,t,i)=>{let r=e.map(e=>ti(e,t,i)),s=[],n=[];r.forEach(e=>{t.uppy.checkIfFileAlreadyExists((0,tt.H)(e,t.uppy.getID()))?n.push(e):s.push(e)}),s.length>0&&t.uppy.info(t.uppy.i18n("addedNumFiles",{numFiles:s.length})),n.length>0&&t.uppy.info(`Not adding ${n.length} files because they already exist`),t.uppy.addFiles(s)},ts=(e,t,i,r)=>{let s=t.findIndex(e=>e.id===r);if(-1!==s&&i){let i=t.findIndex(t=>t.id===e);return t.slice(Math.min(s,i),Math.max(s,i)+1).map(e=>e.id)}return[e]},tn=e=>t=>{if(!t.isAuthError){if("AbortError"===t.name){e.log("Aborting request","warning");return}e.log(t,"error"),"UserFacingApiError"===t.name&&e.info({message:e.i18n("companionError"),details:e.i18n(t.message)},"warning",5e3)}},ta=(e,t)=>{let i=e.find(e=>e.id===t),r=[];for(;r=[i,...r],"root"!==i.type;){let t=i.parentId;i=e.find(e=>e.id===t)}return r};let to=(e,t,i)=>{let r=null===t?"null":t;if(i[r])return i[r];let s=e.find(e=>e.id===t);if("root"===s.type)return[];let n=[...to(e,s.parentId,i),s];return i[r]=n,n};var tl=e=>{let t=Object.create(null);return e.filter(e=>"file"===e.type&&"checked"===e.status).map(i=>{let r=to(e,i.id,t),s=r.findIndex(e=>"folder"===e.type&&"checked"===e.status),n=r.slice(s),a=`/${r.map(e=>e.data.name).join("/")}`,o=1===n.length?void 0:n.map(e=>e.data.name).join("/");return{...i.data,absDirPath:a,relDirPath:o}})},tu=i(66703);class th extends Error{constructor(e){super(e),this.name="TimeoutError"}}class td extends Error{constructor(e){super(),this.name="AbortError",this.message=e}}let tp=e=>void 0===globalThis.DOMException?new td(e):new DOMException(e),tc=e=>{let t=void 0===e.reason?tp("This operation was aborted."):e.reason;return t instanceof Error?t:tp(t)};class tf{#k=[];enqueue(e,t){let i={priority:(t={priority:0,...t}).priority,id:t.id,run:e};if(0===this.size||this.#k[this.size-1].priority>=t.priority){this.#k.push(i);return}let r=function(e,t,i){let r=0,s=e.length;for(;s>0;){let n=Math.trunc(s/2),a=r+n;0>=i(e[a],t)?(r=++a,s-=n+1):s=n}return r}(this.#k,i,(e,t)=>t.priority-e.priority);this.#k.splice(r,0,i)}setPriority(e,t){let i=this.#k.findIndex(t=>t.id===e);if(-1===i)throw ReferenceError(`No promise function with the id "${e}" exists in the queue.`);let[r]=this.#k.splice(i,1);this.enqueue(r.run,{priority:t,id:e})}dequeue(){let e=this.#k.shift();return e?.run}filter(e){return this.#k.filter(t=>t.priority===e.priority).map(e=>e.run)}get size(){return this.#k.length}}class tg extends tu{#eZ;#eY;#eQ=0;#eJ;#e0;#e1=0;#e2;#e5;#k;#e3;#e8=0;#e4;#e6;#e7;#e9=1n;timeout;constructor(e){if(super(),!("number"==typeof(e={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:tf,...e}).intervalCap&&e.intervalCap>=1))throw TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${e.intervalCap?.toString()??""}\` (${typeof e.intervalCap})`);if(void 0===e.interval||!(Number.isFinite(e.interval)&&e.interval>=0))throw TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${e.interval?.toString()??""}\` (${typeof e.interval})`);this.#eZ=e.carryoverConcurrencyCount,this.#eY=e.intervalCap===Number.POSITIVE_INFINITY||0===e.interval,this.#eJ=e.intervalCap,this.#e0=e.interval,this.#k=new e.queueClass,this.#e3=e.queueClass,this.concurrency=e.concurrency,this.timeout=e.timeout,this.#e7=!0===e.throwOnTimeout,this.#e6=!1===e.autoStart}get #te(){return this.#eY||this.#eQ<this.#eJ}get #tt(){return this.#e8<this.#e4}#F(){this.#e8--,this.#ti(),this.emit("next")}#tr(){this.#ts(),this.#tn(),this.#e5=void 0}get #ta(){let e=Date.now();if(void 0===this.#e2){let t=this.#e1-e;if(!(t<0))return void 0===this.#e5&&(this.#e5=setTimeout(()=>{this.#tr()},t)),!0;this.#eQ=this.#eZ?this.#e8:0}return!1}#ti(){if(0===this.#k.size)return this.#e2&&clearInterval(this.#e2),this.#e2=void 0,this.emit("empty"),0===this.#e8&&this.emit("idle"),!1;if(!this.#e6){let e=!this.#ta;if(this.#te&&this.#tt){let t=this.#k.dequeue();return!!t&&(this.emit("active"),t(),e&&this.#tn(),!0)}}return!1}#tn(){this.#eY||void 0!==this.#e2||(this.#e2=setInterval(()=>{this.#ts()},this.#e0),this.#e1=Date.now()+this.#e0)}#ts(){0===this.#eQ&&0===this.#e8&&this.#e2&&(clearInterval(this.#e2),this.#e2=void 0),this.#eQ=this.#eZ?this.#e8:0,this.#to()}#to(){for(;this.#ti(););}get concurrency(){return this.#e4}set concurrency(e){if(!("number"==typeof e&&e>=1))throw TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this.#e4=e,this.#to()}async #tl(e){return new Promise((t,i)=>{e.addEventListener("abort",()=>{i(e.reason)},{once:!0})})}setPriority(e,t){this.#k.setPriority(e,t)}async add(e,t={}){return t.id??=(this.#e9++).toString(),t={timeout:this.timeout,throwOnTimeout:this.#e7,...t},new Promise((i,r)=>{this.#k.enqueue(async()=>{this.#e8++,this.#eQ++;try{t.signal?.throwIfAborted();let r=e({signal:t.signal});t.timeout&&(r=function(e,t){let i,r;let{milliseconds:s,fallback:n,message:a,customTimers:o={setTimeout,clearTimeout}}=t,l=new Promise((l,u)=>{if("number"!=typeof s||1!==Math.sign(s))throw TypeError(`Expected \`milliseconds\` to be a positive number, got \`${s}\``);if(t.signal){let{signal:e}=t;e.aborted&&u(tc(e)),r=()=>{u(tc(e))},e.addEventListener("abort",r,{once:!0})}if(s===Number.POSITIVE_INFINITY){e.then(l,u);return}let h=new th;i=o.setTimeout.call(void 0,()=>{if(n){try{l(n())}catch(e){u(e)}return}"function"==typeof e.cancel&&e.cancel(),!1===a?l():a instanceof Error?u(a):(h.message=a??`Promise timed out after ${s} milliseconds`,u(h))},s),(async()=>{try{l(await e)}catch(e){u(e)}})()}).finally(()=>{l.clear(),r&&t.signal&&t.signal.removeEventListener("abort",r)});return l.clear=()=>{o.clearTimeout.call(void 0,i),i=void 0},l}(Promise.resolve(r),{milliseconds:t.timeout})),t.signal&&(r=Promise.race([r,this.#tl(t.signal)]));let s=await r;i(s),this.emit("completed",s)}catch(e){if(e instanceof th&&!t.throwOnTimeout){i();return}r(e),this.emit("error",e)}finally{this.#F()}},t),this.emit("add"),this.#ti()})}async addAll(e,t){return Promise.all(e.map(async e=>this.add(e,t)))}start(){return this.#e6&&(this.#e6=!1,this.#to()),this}pause(){this.#e6=!0}clear(){this.#k=new this.#e3}async onEmpty(){0!==this.#k.size&&await this.#tu("empty")}async onSizeLessThan(e){this.#k.size<e||await this.#tu("next",()=>this.#k.size<e)}async onIdle(){(0!==this.#e8||0!==this.#k.size)&&await this.#tu("idle")}async #tu(e,t){return new Promise(i=>{let r=()=>{(!t||t())&&(this.off(e,r),i())};this.on(e,r)})}get size(){return this.#k.size}sizeBy(e){return this.#k.filter(e).length}get pending(){return this.#e8}get isPaused(){return this.#e6}}var tm=e=>e.map(e=>({...e}));let ty=async(e,t,i,r,s)=>{let n=[],a=i.cached?i.nextPagePath:i.id;for(;a;){let e=await r(a);n=n.concat(e.items),a=e.nextPagePath}let o=n.filter(e=>!0===e.isFolder),l=n.filter(e=>!1===e.isFolder),u=o.map(e=>({type:"folder",id:e.requestPath,cached:!1,nextPagePath:null,status:"checked",parentId:i.id,data:e})),h=l.map(e=>{let t=s(e);return{type:"file",id:e.requestPath,restrictionError:t,status:t?"unchecked":"checked",parentId:i.id,data:e}});i.cached=!0,i.nextPagePath=null,t.push(...h,...u),u.forEach(async i=>{e.add(()=>ty(e,t,i,r,s))})},tv=(e,t,i)=>{e.filter(e=>"root"!==e.type&&e.parentId===t).forEach(t=>{t.status=i&&!("file"===t.type&&t.restrictionError)?"checked":"unchecked",tv(e,t.id,i)})},tb=(e,t)=>{let i=e.find(e=>e.id===t);if("root"===i.type)return;let r=e.filter(e=>"root"!==e.type&&e.parentId===i.id&&!("file"===e.type&&e.restrictionError)),s=r.every(e=>"checked"===e.status),n=r.every(e=>"unchecked"===e.status);s?i.status="checked":n?i.status="unchecked":i.status="partial",tb(e,i.parentId)};var tw={afterOpenFolder:(e,t,i,r,s)=>{let n=t.filter(e=>!0===e.isFolder),a=t.filter(e=>!1===e.isFolder),o="folder"===i.type&&"checked"===i.status,l=n.map(e=>({type:"folder",id:e.requestPath,cached:!1,nextPagePath:null,status:o?"checked":"unchecked",parentId:i.id,data:e})),u=a.map(e=>{let t=s(e);return{type:"file",id:e.requestPath,restrictionError:t,status:o&&!t?"checked":"unchecked",parentId:i.id,data:e}}),h={...i,cached:!0,nextPagePath:r};return[...e.map(e=>e.id===h.id?h:e),...l,...u]},afterScrollFolder:(e,t,i,r,s)=>{let n=e.find(e=>e.id===t),a=i.filter(e=>!0===e.isFolder),o=i.filter(e=>!1===e.isFolder),l={...n,nextPagePath:r},u=e.map(e=>e.id===l.id?l:e),h="folder"===l.type&&"checked"===l.status;return[...u,...a.map(e=>({type:"folder",id:e.requestPath,cached:!1,nextPagePath:null,status:h?"checked":"unchecked",parentId:l.id,data:e})),...o.map(e=>{let t=s(e);return{type:"file",id:e.requestPath,restrictionError:t,status:h&&!t?"checked":"unchecked",parentId:l.id,data:e}})]},afterToggleCheckbox:(e,t)=>{let i=tm(e);if(t.length>=2){let e=i.filter(e=>"root"!==e.type&&t.includes(e.id));e.forEach(e=>{"file"===e.type?e.status=e.restrictionError?"unchecked":"checked":e.status="checked"}),e.forEach(e=>{tv(i,e.id,!0)}),tb(i,e[0].parentId)}else{let e=i.find(e=>e.id===t[0]);e.status="checked"===e.status?"unchecked":"checked",tv(i,e.id,"checked"===e.status),tb(i,e.parentId)}return i},afterFill:async(e,t,i,r)=>{let s=new tg({concurrency:6}),n=tm(e);return n.filter(e=>"folder"===e.type&&"checked"===e.status&&(!1===e.cached||e.nextPagePath)).forEach(e=>{s.add(()=>ty(s,n,e,t,i))}),s.on("completed",()=>{r(n.filter(e=>"file"===e.type&&"checked"===e.status).length)}),await s.onIdle(),n}},t_=e=>{let{scrollHeight:t,scrollTop:i,offsetHeight:r}=e.target;return t-(i+r)<50};function tS(e){let{openFolder:t,title:i,breadcrumbsIcon:r,breadcrumbs:s,i18n:n}=e;return eM("div",{className:"uppy-Provider-breadcrumbs",children:[eM("div",{className:"uppy-Provider-breadcrumbsIcon",children:r}),s.map((e,r)=>eM(P,{children:[eM("button",{type:"button",className:"uppy-u-reset uppy-c-btn",onClick:()=>t(e.id),children:"root"===e.type?i:e.data.name??n("unnamed")},e.id),s.length===r+1?"":" / "]}))]})}function tC({i18n:e,logout:t,username:i}){return eM(P,{children:[i&&eM("span",{className:"uppy-ProviderBrowser-user",children:i},"username"),eM("button",{type:"button",onClick:t,className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowser-userLogout",children:e("logOut")},"logout")]})}function tP(e){return eM("div",{className:"uppy-ProviderBrowser-header",children:eM("div",{className:eK("uppy-ProviderBrowser-headerBar",!e.showBreadcrumbs&&"uppy-ProviderBrowser-headerBar--simple"),children:[e.showBreadcrumbs&&eM(tS,{openFolder:e.openFolder,breadcrumbs:e.breadcrumbs,breadcrumbsIcon:e.pluginIcon?.(),title:e.title,i18n:e.i18n}),eM(tC,{logout:e.logout,username:e.username,i18n:e.i18n})]})})}function tF(){return eM("svg",{"aria-hidden":"true",focusable:"false",width:"30",height:"30",viewBox:"0 0 30 30",children:eM("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"})})}let tk=e=>({authenticated:void 0,partialTree:[{type:"root",id:e,cached:!1,nextPagePath:null}],currentFolderId:e,searchString:"",didFirstRender:!1,username:null,loading:!1});class tT{static VERSION=eX;plugin;provider;opts;isHandlingScroll=!1;lastCheckbox=null;constructor(e,t){this.plugin=e,this.provider=t.provider,this.opts={viewType:"list",showTitles:!0,showFilter:!0,showBreadcrumbs:!0,loadAllFiles:!1,virtualList:!1,...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(tk(this.plugin.rootFolderId))}tearDown(){}setLoading(e){this.plugin.setPluginState({loading:e})}cancelSelection(){let{partialTree:e}=this.plugin.getPluginState(),t=e.map(e=>"root"===e.type?e:{...e,status:"unchecked"});this.plugin.setPluginState({partialTree:t})}#x;async #th(e){this.#x?.abort();let t=new AbortController;this.#x=t;let i=()=>{t.abort()};try{this.plugin.uppy.on("dashboard:close-panel",i),this.plugin.uppy.on("cancel-all",i),await e(t.signal)}finally{this.plugin.uppy.off("dashboard:close-panel",i),this.plugin.uppy.off("cancel-all",i),this.#x=void 0}}async openFolder(e){this.lastCheckbox=null;let{partialTree:t}=this.plugin.getPluginState(),i=t.find(t=>t.id===e);if(i.cached){this.plugin.setPluginState({currentFolderId:e,searchString:""});return}this.setLoading(!0),await this.#th(async r=>{let s=e,n=[];do{let{username:e,nextPagePath:t,items:i}=await this.provider.list(s,{signal:r});this.plugin.setPluginState({username:e}),s=t,n=n.concat(i),this.setLoading(this.plugin.uppy.i18n("loadedXFiles",{numFiles:n.length}))}while(this.opts.loadAllFiles&&s);let a=tw.afterOpenFolder(t,n,i,s,this.validateSingleFile);this.plugin.setPluginState({partialTree:a,currentFolderId:e,searchString:""})}).catch(tn(this.plugin.uppy)),this.setLoading(!1)}async logout(){await this.#th(async e=>{let t=await this.provider.logout({signal:e});if(t.ok){if(!t.revoked){let e=this.plugin.uppy.i18n("companionUnauthorizeHint",{provider:this.plugin.title,url:t.manual_revoke_url});this.plugin.uppy.info(e,"info",7e3)}this.plugin.setPluginState({...tk(this.plugin.rootFolderId),authenticated:!1})}}).catch(tn(this.plugin.uppy))}async handleAuth(e){await this.#th(async t=>{this.setLoading(!0),await this.provider.login({authFormData:e,signal:t}),this.plugin.setPluginState({authenticated:!0}),await Promise.all([this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId)])}).catch(tn(this.plugin.uppy)),this.setLoading(!1)}async handleScroll(e){let{partialTree:t,currentFolderId:i}=this.plugin.getPluginState(),r=t.find(e=>e.id===i);t_(e)&&!this.isHandlingScroll&&r.nextPagePath&&(this.isHandlingScroll=!0,await this.#th(async e=>{let{nextPagePath:s,items:n}=await this.provider.list(r.nextPagePath,{signal:e}),a=tw.afterScrollFolder(t,i,n,s,this.validateSingleFile);this.plugin.setPluginState({partialTree:a})}).catch(tn(this.plugin.uppy)),this.isHandlingScroll=!1)}validateSingleFile=e=>{let t=eG(e);return this.plugin.uppy.validateSingleFile(t)};async donePicking(){let{partialTree:e}=this.plugin.getPluginState();this.setLoading(!0),await this.#th(async t=>{let i=await tw.afterFill(e,e=>this.provider.list(e,{signal:t}),this.validateSingleFile,e=>{this.setLoading(this.plugin.uppy.i18n("addedNumFiles",{numFiles:e}))});if(this.validateAggregateRestrictions(i)){this.plugin.setPluginState({partialTree:i});return}tr(tl(i),this.plugin,this.provider),this.resetPluginState()}).catch(tn(this.plugin.uppy)),this.setLoading(!1)}toggleCheckbox(e,t){let{partialTree:i}=this.plugin.getPluginState(),r=ts(e.id,this.getDisplayedPartialTree(),t,this.lastCheckbox),s=tw.afterToggleCheckbox(i,r);this.plugin.setPluginState({partialTree:s}),this.lastCheckbox=e.id}getDisplayedPartialTree=()=>{let{partialTree:e,currentFolderId:t,searchString:i}=this.plugin.getPluginState(),r=e.filter(e=>"root"!==e.type&&e.parentId===t);return""===i?r:r.filter(e=>-1!==(e.data.name??this.plugin.uppy.i18n("unnamed")).toLowerCase().indexOf(i.toLowerCase()))};getBreadcrumbs=()=>{let{partialTree:e,currentFolderId:t}=this.plugin.getPluginState();return ta(e,t)};getSelectedAmount=()=>{let{partialTree:e}=this.plugin.getPluginState();return e6(e)};validateAggregateRestrictions=e=>{let t=e.filter(e=>"file"===e.type&&"checked"===e.status).map(e=>e.data);return this.plugin.uppy.validateAggregateRestrictions(t)};render(e,t={}){let{didFirstRender:i}=this.plugin.getPluginState(),{i18n:r}=this.plugin.uppy;i||(this.plugin.setPluginState({didFirstRender:!0}),this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId));let s={...this.opts,...t},{authenticated:n,loading:a}=this.plugin.getPluginState(),o=this.plugin.icon||tF;if(!1===n)return eM(eV,{pluginName:this.plugin.title,pluginIcon:o,handleAuth:this.handleAuth,i18n:this.plugin.uppy.i18n,renderForm:s.renderAuthForm,loading:a});let{partialTree:l,username:u,searchString:h}=this.plugin.getPluginState(),d=this.getBreadcrumbs();return eM("div",{className:eK("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${s.viewType}`),children:[eM(tP,{showBreadcrumbs:s.showBreadcrumbs,openFolder:this.openFolder,breadcrumbs:d,pluginIcon:o,title:this.plugin.title,logout:this.logout,username:u,i18n:r}),s.showFilter&&eM(te,{searchString:h,setSearchString:e=>{this.plugin.setPluginState({searchString:e})},submitSearchString:()=>{},inputLabel:r("filter"),clearSearchLabel:r("resetFilter"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),eM(e4,{toggleCheckbox:this.toggleCheckbox,displayedPartialTree:this.getDisplayedPartialTree(),openFolder:this.openFolder,virtualList:s.virtualList,noResultsLabel:r("noFilesFound"),handleScroll:this.handleScroll,viewType:s.viewType,showTitles:s.showTitles,i18n:this.plugin.uppy.i18n,isLoading:a,utmSource:"Companion"}),eM(e7,{partialTree:l,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:r,validateAggregateRestrictions:this.validateAggregateRestrictions})]})}}let tE={loading:!1,searchString:"",partialTree:[{type:"root",id:null,cached:!1,nextPagePath:null}],currentFolderId:null,isInputMode:!0},tA={viewType:"grid",showTitles:!0,showFilter:!0,utmSource:"Companion"};class tx{static VERSION=eX;plugin;provider;opts;isHandlingScroll=!1;lastCheckbox=null;constructor(e,t){this.plugin=e,this.provider=t.provider,this.opts={...tA,...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(tE)}cancelSelection(){let{partialTree:e}=this.plugin.getPluginState(),t=e.map(e=>"root"===e.type?e:{...e,status:"unchecked"});this.plugin.setPluginState({partialTree:t})}async search(){let{searchString:e}=this.plugin.getPluginState();if(""!==e){this.setLoading(!0);try{let t=await this.provider.search(e),i=[{type:"root",id:null,cached:!1,nextPagePath:t.nextPageQuery},...t.items.map(e=>({type:"file",id:e.requestPath,status:"unchecked",parentId:null,data:e}))];this.plugin.setPluginState({partialTree:i,isInputMode:!1})}catch(e){tn(this.plugin.uppy)(e)}this.setLoading(!1)}}async handleScroll(e){let{partialTree:t,searchString:i}=this.plugin.getPluginState(),r=t.find(e=>"root"===e.type);if(t_(e)&&!this.isHandlingScroll&&r.nextPagePath){this.isHandlingScroll=!0;try{let e=await this.provider.search(i,r.nextPagePath),s={...r,nextPagePath:e.nextPageQuery},n=t.filter(e=>"root"!==e.type),a=[s,...n,...e.items.map(e=>({type:"file",id:e.requestPath,status:"unchecked",parentId:null,data:e}))];this.plugin.setPluginState({partialTree:a})}catch(e){tn(this.plugin.uppy)(e)}this.isHandlingScroll=!1}}async donePicking(){let{partialTree:e}=this.plugin.getPluginState();tr(tl(e),this.plugin,this.provider),this.resetPluginState()}toggleCheckbox(e,t){let{partialTree:i}=this.plugin.getPluginState(),r=ts(e.id,this.getDisplayedPartialTree(),t,this.lastCheckbox),s=tw.afterToggleCheckbox(i,r);this.plugin.setPluginState({partialTree:s}),this.lastCheckbox=e.id}validateSingleFile=e=>{let t=eG(e);return this.plugin.uppy.validateSingleFile(t)};getDisplayedPartialTree=()=>{let{partialTree:e}=this.plugin.getPluginState();return e.filter(e=>"root"!==e.type)};setSearchString=e=>{this.plugin.setPluginState({searchString:e}),""===e&&this.plugin.setPluginState({partialTree:[]})};validateAggregateRestrictions=e=>{let t=e.filter(e=>"file"===e.type&&"checked"===e.status).map(e=>e.data);return this.plugin.uppy.validateAggregateRestrictions(t)};render(e,t={}){let{isInputMode:i,searchString:r,loading:s,partialTree:n}=this.plugin.getPluginState(),{i18n:a}=this.plugin.uppy,o={...this.opts,...t};return i?eM(te,{searchString:r,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:a("enterTextToSearch"),buttonLabel:a("searchImages"),wrapperClassName:"uppy-SearchProvider",inputClassName:"uppy-c-textInput uppy-SearchProvider-input",showButton:!0,buttonCSSClassName:"uppy-SearchProvider-searchButton"}):eM("div",{className:eK("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${o.viewType}`),children:[o.showFilter&&eM(te,{searchString:r,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:a("search"),clearSearchLabel:a("resetSearch"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),eM(e4,{toggleCheckbox:this.toggleCheckbox,displayedPartialTree:this.getDisplayedPartialTree(),handleScroll:this.handleScroll,openFolder:async()=>{},noResultsLabel:a("noSearchResults"),viewType:o.viewType,showTitles:o.showTitles,isLoading:s,i18n:a,virtualList:!1,utmSource:this.opts.utmSource}),eM(e7,{partialTree:n,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:a,validateAggregateRestrictions:this.validateAggregateRestrictions})]})}}function tI(e,t,i,r){return 0===i||e===t?e:0===r?t:e+(t-e)*2**(-r/i)}var tO={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"}},tU={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete"},tD=i(85110);let tN=`\u00B7`,tR=()=>` ${tN} `;function tM(e){let{newFiles:t,isUploadStarted:i,recoveredState:r,i18n:s,uploadState:n,isSomeGhost:a,startUpload:o}=e,l=eK("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--upload",{"uppy-c-btn-primary":n===tU.STATE_WAITING},{"uppy-StatusBar-actionBtn--disabled":a}),u=s(t&&i&&!r?"uploadXNewFiles":"uploadXFiles",{smart_count:t});return eM("button",{type:"button",className:l,"aria-label":s("uploadXFiles",{smart_count:t}),onClick:o,disabled:a,"data-uppy-super-focusable":!0,children:u})}function tB(e){let{i18n:t,uppy:i}=e;return eM("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--retry","aria-label":t("retryUpload"),onClick:()=>i.retryAll().catch(()=>{}),"data-uppy-super-focusable":!0,"data-cy":"retry",children:[eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"8",height:"10",viewBox:"0 0 8 10",children:eM("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"})}),t("retry")]})}function tL(e){let{i18n:t,uppy:i}=e;return eM("button",{type:"button",className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",title:t("cancel"),"aria-label":t("cancel"),onClick:()=>i.cancelAll(),"data-cy":"cancel","data-uppy-super-focusable":!0,children:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16",children:eM("g",{fill:"none",fillRule:"evenodd",children:[eM("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),eM("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 tz(e){let{isAllPaused:t,i18n:i,isAllComplete:r,resumableUploads:s,uppy:n}=e,a=i(t?"resume":"pause");return eM("button",{title:a,"aria-label":a,className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",type:"button",onClick:function(){if(!r){if(!s){n.cancelAll();return}if(t){n.resumeAll();return}n.pauseAll()}},"data-cy":"togglePauseResume","data-uppy-super-focusable":!0,children:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16",children:eM("g",{fill:"none",fillRule:"evenodd",children:[eM("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),eM("path",{fill:"#FFF",d:t?"M6 4.25L11.5 8 6 11.75z":"M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z"})]})})})}function t$(e){let{i18n:t,doneButtonHandler:i}=e;return eM("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--done",onClick:i,"data-uppy-super-focusable":!0,children:t("done")})}function tq(){return eM("svg",{className:"uppy-StatusBar-spinner","aria-hidden":"true",focusable:"false",width:"14",height:"14",children:eM("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 tj(e){let{progress:t}=e,{value:i,mode:r,message:s}=t,n=`\u00B7`;return eM("div",{className:"uppy-StatusBar-content",children:[eM(tq,{}),"determinate"===r?`${Math.round(100*i)}% ${n} `:"",s]})}function tH(e){let{numUploads:t,complete:i,totalUploadedSize:r,totalSize:s,totalETA:n,i18n:a}=e,o=t>1,l=tD(r);return eM("div",{className:"uppy-StatusBar-statusSecondary",children:[o&&a("filesUploadedOfTotal",{complete:i,smart_count:t}),eM("span",{className:"uppy-StatusBar-additionalInfo",children:[o&&tR(),null!=s?a("dataUploadedOfTotal",{complete:l,total:tD(s)}):a("dataUploadedOfUnknown",{complete:l}),tR(),null!=n&&a("xTimeLeft",{time:function(e){let t={hours:Math.floor(e/3600)%24,minutes:Math.floor(e/60)%60,seconds:Math.floor(e%60)},i=0===t.hours?"":`${t.hours}h`,r=0===t.minutes?"":`${0===t.hours?t.minutes:` ${t.minutes.toString(10).padStart(2,"0")}`}m`,s=0!==t.hours?"":`${0===t.minutes?t.seconds:` ${t.seconds.toString(10).padStart(2,"0")}`}s`;return`${i}${r}${s}`}(n)})]})]})}function tV(e){let{i18n:t,complete:i,numUploads:r}=e;return eM("div",{className:"uppy-StatusBar-statusSecondary",children:t("filesUploadedOfTotal",{complete:i,smart_count:r})})}function tW(e){let{i18n:t,newFiles:i,startUpload:r}=e,s=eK("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--uploadNewlyAdded");return eM("div",{className:"uppy-StatusBar-statusSecondary",children:[eM("div",{className:"uppy-StatusBar-statusSecondaryHint",children:t("xMoreFilesAdded",{smart_count:i})}),eM("button",{type:"button",className:s,"aria-label":t("uploadXFiles",{smart_count:i}),onClick:r,children:t("upload")})]})}function tG(e){let{i18n:t,supportsUploadProgress:i,totalProgress:r,showProgressDetails:s,isUploadStarted:n,isAllComplete:a,isAllPaused:o,newFiles:l,numUploads:u,complete:h,totalUploadedSize:d,totalSize:p,totalETA:c,startUpload:f}=e,g=l&&n;if(!n||a)return null;let m=t(o?"paused":"uploading");return eM("div",{className:"uppy-StatusBar-content",title:m,children:[o?null:eM(tq,{}),eM("div",{className:"uppy-StatusBar-status",children:[eM("div",{className:"uppy-StatusBar-statusPrimary",children:i&&0!==r?`${m}: ${r}%`:m}),o||g||!s?null:i?eM(tH,{numUploads:u,complete:h,totalUploadedSize:d,totalSize:p,totalETA:c,i18n:t}):eM(tV,{i18n:t,complete:h,numUploads:u}),g?eM(tW,{i18n:t,newFiles:l,startUpload:f}):null]})]})}function tK(e){let{i18n:t}=e;return eM("div",{className:"uppy-StatusBar-content",role:"status",title:t("complete"),children:eM("div",{className:"uppy-StatusBar-status",children:eM("div",{className:"uppy-StatusBar-statusPrimary",children:[eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"15",height:"11",viewBox:"0 0 15 11",children:eM("path",{d:"M.414 5.843L1.627 4.63l3.472 3.472L13.202 0l1.212 1.213L5.1 10.528z"})}),t("complete")]})})})}function tX(e){let{error:t,i18n:i,complete:r,numUploads:s}=e;return eM("div",{className:"uppy-StatusBar-content",title:i("uploadFailed"),children:[eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"11",height:"11",viewBox:"0 0 11 11",children:eM("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"})}),eM("div",{className:"uppy-StatusBar-status",children:[eM("div",{className:"uppy-StatusBar-statusPrimary",children:[i("uploadFailed"),eM("button",{className:"uppy-u-reset uppy-StatusBar-details","aria-label":i("showErrorDetails"),"data-microtip-position":"top-right","data-microtip-size":"medium",onClick:function(){alert(`${i("uploadFailed")}
|
|
8
8
|
|
|
9
|
-
${t}`)},type:"button",children:"?"})]}),eM(tV,{i18n:i,complete:r,numUploads:s})]})]})}function tZ(e){let t;let i=[],r="indeterminate";for(let{progress:s}of Object.values(e)){let{preprocess:e,postprocess:n}=s;null==t&&(e||n)&&({mode:r,message:t}=e||n),e?.mode==="determinate"&&i.push(e.value),n?.mode==="determinate"&&i.push(n.value)}return{mode:r,message:t,value:i.reduce((e,t)=>e+t/i.length,0)}}let{STATE_ERROR:tY,STATE_WAITING:tQ,STATE_PREPROCESSING:tJ,STATE_UPLOADING:t1,STATE_POSTPROCESSING:t0,STATE_COMPLETE:t2}=tO,t5={hideUploadButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideCancelButton:!1,showProgressDetails:!1,hideAfterFinish:!0,doneButtonHandler:null};class t3 extends eR{static VERSION="4.2.1";#tp;#td;#tc;#tf;constructor(e,t){super(e,{...t5,...t}),this.id=this.opts.id||"StatusBar",this.title="StatusBar",this.type="progressindicator",this.defaultLocale=tU,this.i18nInit(),this.render=this.render.bind(this),this.install=this.install.bind(this)}#tg(e){if(null==e.total||0===e.total)return null;let t=e.total-e.uploaded;if(t<=0)return null;this.#tp??=performance.now();let i=performance.now()-this.#tp;if(0===i)return Math.round((this.#tf??0)/100)/10;let r=e.uploaded-this.#td;if(this.#td=e.uploaded,r<=0)return Math.round((this.#tf??0)/100)/10;let s=r/i,n=null==this.#tc?s:tI(s,this.#tc,2e3,i);this.#tc=n;let a=t/n,o=Math.max(this.#tf-i,0),l=null==this.#tf?a:tI(a,o,2e3,i);return this.#tf=l,this.#tp=performance.now(),Math.round(l/100)/10}startUpload=()=>this.uppy.upload().catch(()=>{});render(e){let{capabilities:t,files:i,allowNewUpload:r,totalProgress:s,error:n,recoveredState:a}=e,{newFiles:o,startedFiles:l,completeFiles:u,isUploadStarted:h,isAllComplete:p,isAllPaused:d,isUploadInProgress:c,isSomeGhost:f}=this.uppy.getObjectOfFilesPerState(),g=a?Object.values(i):o,m=!!t.resumableUploads,y=!1!==t.uploadProgress,v=null,b=0;l.every(e=>null!=e.progress.bytesTotal&&0!==e.progress.bytesTotal)?(v=0,l.forEach(e=>{v+=e.progress.bytesTotal||0,b+=e.progress.bytesUploaded||0})):l.forEach(e=>{b+=e.progress.bytesUploaded||0});let w=this.#tg({uploaded:b,total:v});return function({newFiles:e,allowNewUpload:t,isUploadInProgress:i,isAllPaused:r,resumableUploads:s,error:n,hideUploadButton:a,hidePauseResumeButton:o=!1,hideCancelButton:l=!1,hideRetryButton:u=!1,recoveredState:h,uploadState:p,totalProgress:d,files:c,supportsUploadProgress:f,hideAfterFinish:g=!1,isSomeGhost:m,doneButtonHandler:y,isUploadStarted:v,i18n:b,startUpload:w,uppy:_,isAllComplete:S,showProgressDetails:C,numUploads:P,complete:F,totalSize:k,totalETA:T,totalUploadedSize:E}){let A=function(){switch(p){case t0:case tJ:{let e=tZ(c);if("determinate"===e.mode)return 100*e.value;return d}case tY:return null;case t1:if(!f)return null;return d;default:return d}}(),x=A??100,I=!n&&e&&(!i&&!r||h)&&t&&!a,U=!l&&p!==tQ&&p!==t2,O=s&&!o&&p===t1,D=n&&!S&&!u,R=y&&p===t2,N=eK("uppy-StatusBar-progress",{"is-indeterminate":function(){switch(p){case t0:case tJ:{let{mode:e}=tZ(c);return"indeterminate"===e}case t1:if(!f)return!0;return!1;default:return!1}}()}),M=eK("uppy-StatusBar",`is-${p}`,{"has-ghosts":m}),B=(()=>{switch(p){case tJ:case t0:return eM(tH,{progress:tZ(c)});case t2:return eM(tK,{i18n:b});case tY:return eM(tX,{error:n,i18n:b,numUploads:P,complete:F});case t1:return eM(tG,{i18n:b,supportsUploadProgress:f,totalProgress:d,showProgressDetails:C,isUploadStarted:v,isAllComplete:S,isAllPaused:r,newFiles:e,numUploads:P,complete:F,totalUploadedSize:E,totalSize:k,totalETA:T,startUpload:w});default:return null}})();return(I||D||O||U||R||B)&&(p!==t2||!g)?eM("div",{className:M,children:[eM("div",{className:N,style:{width:`${x}%`},role:"progressbar","aria-label":`${x}%`,"aria-valuetext":`${x}%`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":A}),B,eM("div",{className:"uppy-StatusBar-actions",children:[I?eM(tM,{newFiles:e,isUploadStarted:v,recoveredState:h,i18n:b,isSomeGhost:m,startUpload:w,uploadState:p}):null,D?eM(tB,{i18n:b,uppy:_}):null,O?eM(tz,{isAllPaused:r,i18n:b,isAllComplete:S,resumableUploads:s,uppy:_}):null,U?eM(tL,{i18n:b,uppy:_}):null,R?eM(t$,{i18n:b,doneButtonHandler:y}):null]})]}):null}({error:n,uploadState:function(e,t,i,r){if(e)return tO.STATE_ERROR;if(t)return tO.STATE_COMPLETE;if(i)return tO.STATE_WAITING;let s=tO.STATE_WAITING,n=Object.keys(r);for(let e=0;e<n.length;e++){let{progress:t}=r[n[e]];if(t.uploadStarted&&!t.uploadComplete)return tO.STATE_UPLOADING;t.preprocess&&(s=tO.STATE_PREPROCESSING),t.postprocess&&s!==tO.STATE_PREPROCESSING&&(s=tO.STATE_POSTPROCESSING)}return s}(n,p,a,e.files||{}),allowNewUpload:r,totalProgress:s,totalSize:v,totalUploadedSize:b,isAllComplete:!1,isAllPaused:d,isUploadStarted:h,isUploadInProgress:c,isSomeGhost:f,recoveredState:a,complete:u.length,newFiles:g.length,numUploads:l.length,totalETA:w,files:i,i18n:this.i18n,uppy:this.uppy,startUpload:this.startUpload,doneButtonHandler:this.opts.doneButtonHandler,resumableUploads:m,supportsUploadProgress:y,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;g(e)||(e.dir="ltr")}#tm=()=>{let{recoveredState:e}=this.uppy.getState();if(this.#tc=null,this.#tf=null,e){this.#td=Object.values(e.files).reduce((e,{progress:t})=>e+t.bytesUploaded,0),this.uppy.emit("restore-confirmed");return}this.#tp=performance.now(),this.#td=0};install(){let{target:e}=this.opts;e&&this.mount(e,this),this.uppy.on("upload",this.#tm),this.#tp=performance.now(),this.#td=this.uppy.getFiles().reduce((e,t)=>e+t.progress.bytesUploaded,0)}uninstall(){this.unmount(),this.uppy.off("upload",this.#tm)}}let t8=/^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/;var t4=function(e,t,i){let r;let s=t8.exec(e),n=t.mimeType??s?.[1]??"plain/text";if(s?.[2]!=null){let e=atob(decodeURIComponent(s[3])),t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);r=[t]}else s?.[3]!=null&&(r=[decodeURIComponent(s[3])]);return i?new File(r,t.name||"",{type:n}):new Blob(r,{type:n})};function t6(e){return e.startsWith("blob:")}function t7(e){return!!e&&/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(e)}var t9=i(40257),ie=i(82957).lW;function it(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var ii="undefined"!=typeof self?self:global;let ir="undefined"!=typeof navigator,is=ir&&"undefined"==typeof HTMLImageElement,ia=!("undefined"==typeof global||void 0===t9||!t9.versions||!t9.versions.node),io=ii.Buffer,il=!!io,iu=e=>void 0!==e;function ih(e){return void 0===e||(e instanceof Map?0===e.size:0===Object.values(e).filter(iu).length)}function ip(e){let t=Error(e);throw delete t.stack,t}function id(e){let t;let i=(t=0,e.ifd0.enabled&&(t+=1024),e.exif.enabled&&(t+=2048),e.makerNote&&(t+=2048),e.userComment&&(t+=1024),e.gps.enabled&&(t+=512),e.interop.enabled&&(t+=100),e.ifd1.enabled&&(t+=1024),t+2048);return e.jfif.enabled&&(i+=50),e.xmp.enabled&&(i+=2e4),e.iptc.enabled&&(i+=14e3),e.icc.enabled&&(i+=6e3),i}let ic=e=>String.fromCharCode.apply(null,e),ig="undefined"!=typeof TextDecoder?new TextDecoder("utf-8"):void 0;class im{static from(e,t){return e instanceof this&&e.le===t?e:new im(e,void 0,void 0,t)}constructor(e,t=0,i,r){if("boolean"==typeof r&&(this.le=r),Array.isArray(e)&&(e=new Uint8Array(e)),0===e)this.byteOffset=0,this.byteLength=0;else if(e instanceof ArrayBuffer){void 0===i&&(i=e.byteLength-t);let r=new DataView(e,t,i);this._swapDataView(r)}else if(e instanceof Uint8Array||e instanceof DataView||e instanceof im){void 0===i&&(i=e.byteLength-t),(t+=e.byteOffset)+i>e.byteOffset+e.byteLength&&ip("Creating view outside of available memory in ArrayBuffer");let r=new DataView(e.buffer,t,i);this._swapDataView(r)}else if("number"==typeof e){let t=new DataView(new ArrayBuffer(e));this._swapDataView(t)}else ip("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=im){return e instanceof DataView||e instanceof im?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Uint8Array||ip("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 im(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){let i=this.getUint8Array(e,t);return ig?ig.decode(i):il?ie.from(i).toString("utf8"):decodeURIComponent(escape(ic(i)))}getLatin1String(e=0,t=this.byteLength){return ic(this.getUint8Array(e,t))}getUnicodeString(e=0,t=this.byteLength){let i=[];for(let r=0;r<t&&e+r<this.byteLength;r+=2)i.push(this.getUint16(e+r));return ic(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 iy(e,t){ip(`${e} '${t}' was not loaded, try using full build of exifr.`)}class iv extends Map{constructor(e){super(),this.kind=e}get(e,t){var i;return this.has(e)||iy(this.kind,e),t&&(e in t||(i=this.kind,ip(`Unknown ${i} '${e}'.`)),t[e].enabled||iy(this.kind,e)),super.get(e)}keyList(){return Array.from(this.keys())}}var ib=new iv("file parser"),iw=new iv("segment parser"),i_=new iv("file reader");let iS=ii.fetch;function iC(e,t){return e.startsWith("data:")||e.length>1e4?iF(e,t,"base64"):ia&&e.includes("://")?iP(e,t,"url",ik):ia?iF(e,t,"fs"):ir?iP(e,t,"url",ik):void ip("Invalid input argument")}async function iP(e,t,i,r){return i_.has(i)?iF(e,t,i):r?async function(e,t){return new im(await t(e))}(e,r):void ip(`Parser ${i} is not loaded`)}async function iF(e,t,i){let r=new(i_.get(i))(e,t);return await r.read(),r}let ik=e=>iS(e).then(e=>e.arrayBuffer()),iT=e=>new Promise((t,i)=>{let r=new FileReader;r.onloadend=()=>t(r.result||new ArrayBuffer),r.onerror=i,r.readAsArrayBuffer(e)});class iE 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 iA(e,t,i){let r=new iE;for(let[e,t]of i)r.set(e,t);if(Array.isArray(t))for(let i of t)e.set(i,r);else e.set(t,r);return r}function ix(e,t,i){let r,s=e.get(t);for(r of i)s.set(r[0],r[1])}let iI=new Map,iU=new Map,iO=new Map,iD=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],iR=["jfif","xmp","icc","iptc","ihdr"],iN=["tiff",...iR],iM=["ifd0","ifd1","exif","gps","interop"],iB=[...iN,...iM],iL=["makerNote","userComment"],iz=["translateKeys","translateValues","reviveValues","multiSegment"],i$=[...iz,"sanitize","mergeOutput","silentErrors"];class iq{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}}class iH extends iq{get needed(){return this.enabled||this.deps.size>0}constructor(e,t,i,r){if(super(),it(this,"enabled",!1),it(this,"skip",new Set),it(this,"pick",new Set),it(this,"deps",new Set),it(this,"translateKeys",!1),it(this,"translateValues",!1),it(this,"reviveValues",!1),this.key=e,this.enabled=t,this.parse=this.enabled,this.applyInheritables(r),this.canBeFiltered=iM.includes(e),this.canBeFiltered&&(this.dict=iI.get(e)),void 0!==i){if(Array.isArray(i))this.parse=this.enabled=!0,this.canBeFiltered&&i.length>0&&this.translateTagSet(i,this.pick);else if("object"==typeof i){if(this.enabled=!0,this.parse=!1!==i.parse,this.canBeFiltered){let{pick:e,skip:t}=i;e&&e.length>0&&this.translateTagSet(e,this.pick),t&&t.length>0&&this.translateTagSet(t,this.skip)}this.applyInheritables(i)}else!0===i||!1===i?this.parse=this.enabled=i:ip(`Invalid options argument: ${i}`)}}applyInheritables(e){let t,i;for(t of iz)void 0!==(i=e[t])&&(this[t]=i)}translateTagSet(e,t){if(this.dict){let i,r,{tagKeys:s,tagValues:n}=this.dict;for(i of e)"string"==typeof i?(-1===(r=n.indexOf(i))&&(r=s.indexOf(Number(i))),-1!==r&&t.add(Number(s[r]))):t.add(i)}else for(let i of e)t.add(i)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,iX(this.pick,this.deps)):this.enabled&&this.pick.size>0&&iX(this.pick,this.deps)}}var ij={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},iV=new Map;class iW extends iq{static useCached(e){let t=iV.get(e);return void 0!==t||(t=new this(e),iV.set(e,t)),t}constructor(e){super(),!0===e?this.setupFromTrue():void 0===e?this.setupFromUndefined():Array.isArray(e)?this.setupFromArray(e):"object"==typeof e?this.setupFromObject(e):ip(`Invalid options argument ${e}`),void 0===this.firstChunkSize&&(this.firstChunkSize=ir?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let e;for(e of iD)this[e]=ij[e];for(e of i$)this[e]=ij[e];for(e of iL)this[e]=ij[e];for(e of iB)this[e]=new iH(e,ij[e],void 0,this)}setupFromTrue(){let e;for(e of iD)this[e]=ij[e];for(e of i$)this[e]=ij[e];for(e of iL)this[e]=!0;for(e of iB)this[e]=new iH(e,!0,void 0,this)}setupFromArray(e){let t;for(t of iD)this[t]=ij[t];for(t of i$)this[t]=ij[t];for(t of iL)this[t]=ij[t];for(t of iB)this[t]=new iH(t,!1,void 0,this);this.setupGlobalFilters(e,void 0,iM)}setupFromObject(e){let t;for(t of(iM.ifd0=iM.ifd0||iM.image,iM.ifd1=iM.ifd1||iM.thumbnail,Object.assign(this,e),iD))this[t]=iK(e[t],ij[t]);for(t of i$)this[t]=iK(e[t],ij[t]);for(t of iL)this[t]=iK(e[t],ij[t]);for(t of iN)this[t]=new iH(t,ij[t],e[t],this);for(t of iM)this[t]=new iH(t,ij[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,iM,iB),!0===e.tiff?this.batchEnableWithBool(iM,!0):!1===e.tiff?this.batchEnableWithUserValue(iM,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,iM):"object"==typeof e.tiff&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,iM)}batchEnableWithBool(e,t){for(let i of e)this[i].enabled=t}batchEnableWithUserValue(e,t){for(let i of e){let e=t[i];this[i].enabled=!1!==e&&void 0!==e}}setupGlobalFilters(e,t,i,r=i){if(e&&e.length){for(let e of r)this[e].enabled=!1;for(let[t,r]of iG(e,i))iX(this[t].pick,r),this[t].enabled=!0}else if(t&&t.length)for(let[e,r]of iG(t,i))iX(this[e].skip,r)}filterNestedSegmentTags(){let{ifd0:e,exif:t,xmp:i,iptc:r,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),r.enabled||e.skip.add(33723),s.enabled||e.skip.add(34675)}traverseTiffDependencyTree(){let{ifd0:e,exif:t,gps:i,interop:r}=this;for(let s of(r.needed&&(t.deps.add(40965),e.deps.add(40965)),t.needed&&e.deps.add(34665),i.needed&&e.deps.add(34853),this.tiff.enabled=iM.some(e=>!0===this[e].enabled)||this.makerNote||this.userComment,iM))this[s].finalizeFilters()}get onlyTiff(){return!iR.map(e=>this[e].enabled).some(e=>!0===e)&&this.tiff.enabled}checkLoadedPlugins(){for(let e of iN)this[e].enabled&&!iw.has(e)&&iy("segment parser",e)}}function iG(e,t){let i,r,s,n,a=[];for(s of t){for(n of(i=iI.get(s),r=[],i))(e.includes(n[0])||e.includes(n[1]))&&r.push(n[0]);r.length&&a.push([s,r])}return a}function iK(e,t){return void 0!==e?e:void 0!==t?t:void 0}function iX(e,t){for(let i of t)e.add(i)}it(iW,"default",ij);class iZ{constructor(e){it(this,"parsers",{}),it(this,"output",{}),it(this,"errors",[]),it(this,"pushToErrors",e=>this.errors.push(e)),this.options=iW.useCached(e)}async read(e){var t;this.file=await (t=this.options,"string"==typeof e?iC(e,t):ir&&!is&&e instanceof HTMLImageElement?iC(e.src,t):e instanceof Uint8Array||e instanceof ArrayBuffer||e instanceof DataView?new im(e):ir&&e instanceof Blob?iP(e,t,"blob",iT):void ip("Invalid input argument"))}setup(){if(this.fileParser)return;let{file:e}=this,t=e.getUint16(0);for(let[i,r]of ib)if(r.canHandle(e,t))return this.fileParser=new r(this.options,this.file,this.parsers),e[i]=!0;this.file.close&&this.file.close(),ip("Unknown file format")}async parse(){let{output:e,errors:t}=this;return this.setup(),this.options.silentErrors?(await this.executeParsers().catch(this.pushToErrors),t.push(...this.fileParser.errors)):await this.executeParsers(),this.file.close&&this.file.close(),this.options.silentErrors&&t.length>0&&(e.errors=t),ih(e)?void 0:e}async executeParsers(){let{output:e}=this;await this.fileParser.parse();let t=Object.values(this.parsers).map(async t=>{let i=await t.parse();t.assignToOutput(e,i)});this.options.silentErrors&&(t=t.map(e=>e.catch(this.pushToErrors))),await Promise.all(t)}async extractThumbnail(){var e;this.setup();let{options:t,file:i}=this,r=iw.get("tiff",t);if(i.tiff?e={start:0,type:"tiff"}:i.jpeg&&(e=await this.fileParser.getOrFindSegment("tiff")),void 0===e)return;let s=await this.fileParser.ensureSegmentChunk(e),n=this.parsers.tiff=new r(s,t,i),a=await n.extractThumbnail();return i.close&&i.close(),a}}async function iY(e,t){let i=new iZ(t);return await i.read(e),i.parse()}var iQ=Object.freeze({__proto__:null,parse:iY,Exifr:iZ,fileParsers:ib,segmentParsers:iw,fileReaders:i_,tagKeys:iI,tagValues:iU,tagRevivers:iO,createDictionary:iA,extendDictionary:ix,fetchUrlAsArrayBuffer:ik,readBlobAsArrayBuffer:iT,chunkedProps:iD,otherSegments:iR,segments:iN,tiffBlocks:iM,segmentsAndBlocks:iB,tiffExtractables:iL,inheritables:iz,allFormatters:i$,Options:iW});class iJ{static findPosition(e,t){let i=e.getUint16(t+2)+2,r="function"==typeof this.headerLength?this.headerLength(e,t,i):this.headerLength,s=t+r,n=i-r;return{offset:t,length:i,headerLength:r,start:s,size:n,end:s+n}}static parse(e,t={}){return new this(e,new iW({[this.type]:t}),e).parse()}normalizeInput(e){return e instanceof im?e:new im(e)}constructor(e,t={},i){it(this,"errors",[]),it(this,"raw",new Map),it(this,"handleError",e=>{if(!this.options.silentErrors)throw e;this.errors.push(e.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=iO.get(t),r=iU.get(t),s=iI.get(t),n=this.options[t],a=n.reviveValues&&!!i,o=n.translateValues&&!!r,l=n.translateKeys&&!!s,u={};for(let[t,n]of e)a&&i.has(t)?n=i.get(t)(n):o&&r.has(t)&&(n=this.translateValue(n,r.get(t))),l&&s.has(t)&&(t=s.get(t)||t),u[t]=n;return u}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}}it(iJ,"headerLength",4),it(iJ,"type",void 0),it(iJ,"multiSegment",!1),it(iJ,"canHandle",()=>!1);class i1 extends class{constructor(e,t,i){it(this,"errors",[]),it(this,"ensureSegmentChunk",async e=>{let t=e.start,i=e.size||65536;if(this.file.chunked){if(this.file.available(t,i))e.chunk=this.file.subarray(t,i);else try{e.chunk=await this.file.readChunk(t,i)}catch(t){ip(`Couldn't read segment: ${JSON.stringify(e)}. ${t.message}`)}}else this.file.byteLength>t+i?e.chunk=this.file.subarray(t,i):void 0===e.size?e.chunk=this.file.subarray(t):ip("Segment unreachable: "+JSON.stringify(e));return e.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(iw.get(e))(t,this.options,this.file);return this.parsers[e]=i}createParsers(e){for(let t of e){let{type:e,chunk:i}=t,r=this.options[e];if(r&&r.enabled){let t=this.parsers[e];t&&t.append||t||this.createParser(e,i)}}}async readSegments(e){let t=e.map(this.ensureSegmentChunk);await Promise.all(t)}}{constructor(...e){super(...e),it(this,"appSegments",[]),it(this,"jpegSegments",[]),it(this,"unknownSegments",[])}static canHandle(e,t){return 65496===t}async parse(){await this.findAppSegments(),await this.readSegments(this.appSegments),this.mergeMultiSegments(),this.createParsers(this.mergedAppSegments||this.appSegments)}setupSegmentFinderArgs(e){!0===e?(this.findAll=!0,this.wanted=new Set(iw.keyList())):(e=void 0===e?iw.keyList().filter(e=>this.options[e].enabled):e.filter(e=>this.options[e].enabled&&iw.has(e)),this.findAll=!1,this.remaining=new Set(e),this.wanted=new Set(e)),this.unfinishedMultiSegment=!1}async findAppSegments(e=0,t){this.setupSegmentFinderArgs(t);let{file:i,findAll:r,wanted:s,remaining:n}=this;if(!r&&this.file.chunked&&(r=Array.from(s).some(e=>{let t=iw.get(e),i=this.options[e];return t.multiSegment&&i.multiSegment}))&&await this.file.readWhole(),e=this.findAppSegmentsInRange(e,i.byteLength),!this.options.onlyTiff&&i.chunked){let t=!1;for(;n.size>0&&!t&&(i.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:r}=i,s=this.appSegments.some(e=>!this.file.available(e.offset||e.start,e.length||e.size));if(t=e>r&&!s?!await i.readNextChunk(e):!await i.readNextChunk(r),void 0===(e=this.findAppSegmentsInRange(e,i.byteLength)))return}}}findAppSegmentsInRange(e,t){t-=2;let i,r,s,n,a,o,{file:l,findAll:u,wanted:h,remaining:p,options:d}=this;for(;e<t;e++)if(255===l.getUint8(e)){var c;if((c=i=l.getUint8(e+1))>=224&&c<=239){if(r=l.getUint16(e+2),(s=function(e,t,i){for(let[r,s]of iw)if(s.canHandle(e,t,i))return r}(l,e,r))&&h.has(s)&&(a=(n=iw.get(s)).findPosition(l,e),o=d[s],a.type=s,this.appSegments.push(a),!u&&(n.multiSegment&&o.multiSegment?(this.unfinishedMultiSegment=a.chunkNumber<a.chunkCount,this.unfinishedMultiSegment||p.delete(s)):p.delete(s),0===p.size)))break;d.recordUnknownSegments&&((a=iJ.findPosition(l,e)).marker=i,this.unknownSegments.push(a)),e+=r+1}else if(192===i||194===i||196===i||219===i||221===i||218===i||254===i){if(r=l.getUint16(e+2),218===i&&!1!==d.stopAfterSos)return;d.recordJpegSegments&&this.jpegSegments.push({offset:e,length:r,marker:i}),e+=r+1}}return e}mergeMultiSegments(){if(!this.appSegments.some(e=>e.multiSegment))return;let e=function(e,t){let i,r,s,n=new Map;for(let a=0;a<e.length;a++)r=(i=e[a])[t],n.has(r)?s=n.get(r):n.set(r,s=[]),s.push(i);return Array.from(n)}(this.appSegments,"type");this.mergedAppSegments=e.map(([e,t])=>{let i=iw.get(e,this.options);return i.handleMultiSegments?{type:e,chunk:i.handleMultiSegments(t)}:t[0]})}getSegment(e){return this.appSegments.find(t=>t.type===e)}async getOrFindSegment(e){let t=this.getSegment(e);return void 0===t&&(await this.findAppSegments(0,[e]),t=this.getSegment(e)),t}}it(i1,"type","jpeg"),ib.set("jpeg",i1);let i0=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4];class i2 extends iJ{parseHeader(){var e=this.chunk.getUint16();18761===e?this.le=!0:19789===e&&(this.le=!1),this.chunk.le=this.le,this.headerParsed=!0}parseTags(e,t,i=new Map){let{pick:r,skip:s}=this.options[t],n=(r=new Set(r)).size>0,a=0===s.size,o=this.chunk.getUint16(e);e+=2;for(let l=0;l<o;l++){let o=this.chunk.getUint16(e);if(n){if(r.has(o)&&(i.set(o,this.parseTag(e,o,t)),r.delete(o),0===r.size))break}else!a&&s.has(o)||i.set(o,this.parseTag(e,o,t));e+=12}return i}parseTag(e,t,i){var r;let{chunk:s}=this,n=s.getUint16(e+2),a=s.getUint32(e+4),o=i0[n];if(o*a<=4?e+=8:e=s.getUint32(e+8),(n<1||n>13)&&ip(`Invalid TIFF value type. block: ${i.toUpperCase()}, tag: ${t.toString(16)}, type: ${n}, offset ${e}`),e>s.byteLength&&ip(`Invalid TIFF value offset. block: ${i.toUpperCase()}, tag: ${t.toString(16)}, type: ${n}, offset ${e} is outside of chunk size ${s.byteLength}`),1===n)return s.getUint8Array(e,a);if(2===n)return""===(r=(function(e){for(;e.endsWith("\0");)e=e.slice(0,-1);return e})(r=s.getString(e,a)).trim())?void 0:r;if(7===n)return s.getUint8Array(e,a);if(1===a)return this.parseTagValue(n,e);{let t=new(function(e){switch(e){case 1:return Uint8Array;case 3:return Uint16Array;case 4:return Uint32Array;case 5:case 10:default:return Array;case 6:return Int8Array;case 8:return Int16Array;case 9:return Int32Array;case 11:return Float32Array;case 12:return Float64Array}}(n))(a);for(let i=0;i<a;i++)t[i]=this.parseTagValue(n,e),e+=o;return t}}parseTagValue(e,t){let{chunk:i}=this;switch(e){case 1:return i.getUint8(t);case 3:return i.getUint16(t);case 4:case 13: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);default:ip(`Invalid tiff type ${e}`)}}}class i5 extends i2{static canHandle(e,t){return 225===e.getUint8(t+1)&&1165519206===e.getUint32(t+4)&&0===e.getUint16(t+8)}async parse(){this.parseHeader();let{options:e}=this;return e.ifd0.enabled&&await this.parseIfd0Block(),e.exif.enabled&&await this.safeParse("parseExifBlock"),e.gps.enabled&&await this.safeParse("parseGpsBlock"),e.interop.enabled&&await this.safeParse("parseInteropBlock"),e.ifd1.enabled&&await this.safeParse("parseThumbnailBlock"),this.createOutput()}safeParse(e){let t=this[e]();return void 0!==t.catch&&(t=t.catch(this.handleError)),t}findIfd0Offset(){void 0===this.ifd0Offset&&(this.ifd0Offset=this.chunk.getUint32(4))}findIfd1Offset(){if(void 0===this.ifd1Offset){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}async parseIfd0Block(){if(this.ifd0)return;let{file:e}=this;this.findIfd0Offset(),this.ifd0Offset<8&&ip("Malformed EXIF data"),!e.chunked&&this.ifd0Offset>e.byteLength&&ip(`IFD0 offset points to outside of file.
|
|
10
|
-
this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&await e.ensureChunk(this.ifd0Offset,id(this.options));let t=this.parseBlock(this.ifd0Offset,"ifd0");return 0!==t.size?(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}async parseExifBlock(){if(this.exif||(this.ifd0||await this.parseIfd0Block(),void 0===this.exifOffset))return;this.file.tiff&&await this.file.ensureChunk(this.exifOffset,id(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&&1===i.length&&e.set(t,i[0])}async parseGpsBlock(){if(this.gps||(this.ifd0||await this.parseIfd0Block(),void 0===this.gpsOffset))return;let e=this.parseBlock(this.gpsOffset,"gps");return e&&e.has(2)&&e.has(4)&&(e.set("latitude",i3(...e.get(2),e.get(1))),e.set("longitude",i3(...e.get(4),e.get(3)))),e}async parseInteropBlock(){if(!this.interop&&(this.ifd0||await this.parseIfd0Block(),void 0!==this.interopOffset||this.exif||await this.parseExifBlock(),void 0!==this.interopOffset))return this.parseBlock(this.interopOffset,"interop")}async parseThumbnailBlock(e=!1){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}async extractThumbnail(){if(this.headerParsed||this.parseHeader(),this.ifd1Parsed||await this.parseThumbnailBlock(!0),void 0===this.ifd1)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,r={};for(t of iM)if(!ih(e=this[t])){if(i=this.canTranslate?this.translateBlock(e,t):Object.fromEntries(e),this.options.mergeOutput){if("ifd1"===t)continue;Object.assign(r,i)}else r[t]=i}return this.makerNote&&(r.makerNote=this.makerNote),this.userComment&&(r.userComment=this.userComment),r}assignToOutput(e,t){if(this.globalOptions.mergeOutput)Object.assign(e,t);else for(let[i,r]of Object.entries(t))this.assignObjectToOutput(e,i,r)}}function i3(e,t,i,r){var s=e+t/60+i/3600;return"S"!==r&&"W"!==r||(s*=-1),s}it(i5,"type","tiff"),it(i5,"headerLength",10),iw.set("tiff",i5),Object.freeze({__proto__:null,default:iQ,Exifr:iZ,fileParsers:ib,segmentParsers:iw,fileReaders:i_,tagKeys:iI,tagValues:iU,tagRevivers:iO,createDictionary:iA,extendDictionary:ix,fetchUrlAsArrayBuffer:ik,readBlobAsArrayBuffer:iT,chunkedProps:iD,otherSegments:iR,segments:iN,tiffBlocks:iM,segmentsAndBlocks:iB,tiffExtractables:iL,inheritables:iz,allFormatters:i$,Options:iW,parse:iY});let i8={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1};Object.assign({},i8,{firstChunkSize:4e4,gps:[1,2,3,4]}),Object.assign({},i8,{tiff:!1,ifd1:!0,mergeOutput:!1});let i4=Object.assign({},i8,{firstChunkSize:4e4,ifd0:[274]});async function i6(e){let t=new iZ(i4);await t.read(e);let i=await t.parse();if(i&&i.ifd0)return i.ifd0[274]}let i7=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}}),i9=!0,re=!0;if("object"==typeof navigator){let e=navigator.userAgent;if(e.includes("iPad")||e.includes("iPhone")){let t=e.match(/OS (\d+)_(\d+)/);if(t){let[,e,i]=t;i9=Number(e)+.1*Number(i)<13.4,re=!1}}else if(e.includes("OS X 10")){let[,t]=e.match(/OS X 10[_.](\d+)/);i9=re=15>Number(t)}if(e.includes("Chrome/")){let[,t]=e.match(/Chrome\/(\d+)/);i9=re=81>Number(t)}else if(e.includes("Firefox/")){let[,t]=e.match(/Firefox\/(\d+)/);i9=re=77>Number(t)}}async function rt(e){let t=await i6(e);return Object.assign({canvas:i9,css:re},i7[t])}class ri extends im{constructor(...e){super(...e),it(this,"ranges",new rr),0!==this.byteLength&&this.ranges.add(0,this.byteLength)}_tryExtend(e,t,i){if(0===e&&0===this.byteLength&&i){let e=new DataView(i.buffer||i,i.byteOffset,i.byteLength);this._swapDataView(e)}else{let i=e+t;if(i>this.byteLength){let{dataView:e}=this._extend(i);this._swapDataView(e)}}}_extend(e){let t;let i=new DataView((t=il?io.allocUnsafe(e):new Uint8Array(e)).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 r=super.set(e,t);return this.ranges.add(t,r.byteLength),r}async ensureChunk(e,t){this.chunked&&(this.ranges.available(e,t)||await this.readChunk(e,t))}available(e,t){return this.ranges.available(e,t)}}class rr{constructor(){it(this,"list",[])}get length(){return this.list.length}add(e,t,i=0){let r=e+t,s=this.list.filter(t=>{var i,s,n,a,o,l;return i=e,s=t.offset,n=r,i<=s&&s<=n||(a=e,o=t.end,l=r,a<=o&&o<=l)});if(s.length>0){e=Math.min(e,...s.map(e=>e.offset)),t=(r=Math.max(r,...s.map(e=>e.end)))-e;let i=s.shift();i.offset=e,i.length=t,i.end=r,this.list=this.list.filter(e=>!s.includes(e))}else this.list.push({offset:e,length:t,end:r})}available(e,t){let i=e+t;return this.list.some(t=>t.offset<=e&&i<=t.end)}}class rs extends ri{constructor(e,t){super(0),it(this,"chunksRead",0),this.input=e,this.options=t}async readWhole(){this.chunked=!1,await this.readChunk(this.nextChunkOffset)}async readChunked(){this.chunked=!0,await this.readChunk(0,this.options.firstChunkSize)}async readNextChunk(e=this.nextChunkOffset){if(this.fullyRead)return this.chunksRead++,!1;let t=this.options.chunkSize,i=await this.readChunk(e,t);return!!i&&i.byteLength===t}async readChunk(e,t){if(this.chunksRead++,0!==(t=this.safeWrapAddress(e,t)))return this._readChunk(e,t)}safeWrapAddress(e,t){return void 0!==this.size&&e+t>this.size?Math.max(0,this.size-e):t}get nextChunkOffset(){if(0!==this.ranges.list.length)return this.ranges.list[0].length}get canReadNextChunk(){return this.chunksRead<this.options.chunkLimit}get fullyRead(){return void 0!==this.size&&this.nextChunkOffset===this.size}read(){return this.options.chunked?this.readChunked():this.readWhole()}close(){}}i_.set("blob",class extends rs{async readWhole(){this.chunked=!1;let e=await iT(this.input);this._swapArrayBuffer(e)}readChunked(){return this.chunked=!0,this.size=this.input.size,super.readChunked()}async _readChunk(e,t){let i=t?e+t:void 0,r=this.input.slice(e,i),s=await iT(r);return this.set(s,e,!0)}});var rn={strings:{generatingThumbnails:"Generating thumbnails..."}};let ra={thumbnailWidth:null,thumbnailHeight:null,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,lazy:!1};class ro extends eR{static VERSION="4.2.1";queue;queueProcessing;defaultThumbnailDimension;thumbnailType;constructor(e,t){if(super(e,{...ra,...t}),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=rn,this.i18nInit(),this.opts.lazy&&this.opts.waitForThumbnailsBeforeUpload)throw 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 r=URL.createObjectURL(e.data);return Promise.all([new Promise((e,t)=>{let i=new Image;i.src=r,i.addEventListener("load",()=>{URL.revokeObjectURL(r),e(i)}),i.addEventListener("error",e=>{URL.revokeObjectURL(r),t(e.error||Error("Could not create thumbnail"))})}),rt(e.data).catch(()=>1)]).then(([e,r])=>{let s=this.getProportionalDimensions(e,t,i,r.deg),n=function(e,t){let i=e.width,r=e.height;(90===t.deg||270===t.deg)&&(i=e.height,r=e.width);let s=document.createElement("canvas");s.width=i,s.height=r;let n=s.getContext("2d");return n.translate(i/2,r/2),t.canvas&&(n.rotate(t.rad),n.scale(t.scaleX,t.scaleY)),n.drawImage(e,-e.width/2,-e.height/2,e.width,e.height),s}(e,r);return function(e,t,i){try{e.getContext("2d").getImageData(0,0,1,1)}catch(e){if(18===e.code)return Promise.reject(Error("cannot read image, probably an svg with external resources"))}return e.toBlob?new Promise(i=>{e.toBlob(i,t,80)}).then(e=>{if(null===e)throw Error("cannot read image, probably an svg with external resources");return e}):Promise.resolve().then(()=>t4(e.toDataURL(t,80),{})).then(e=>{if(null===e)throw Error("could not extract blob, probably an old browser");return e})}(this.resizeImage(n,s.width,s.height),this.thumbnailType,0)}).then(e=>URL.createObjectURL(e))}getProportionalDimensions(e,t,i,r){let s=e.width/e.height;return((90===r||270===r)&&(s=e.height/e.width),null!=t)?{width:t,height:Math.round(t/s)}:null!=i?{width:Math.round(i*s),height:i}:{width:this.defaultThumbnailDimension,height:Math.round(this.defaultThumbnailDimension/s)}}resizeImage(e,t,i){let r=function(e){let t=e.width/e.height,i=Math.floor(Math.sqrt(5e6*t)),r=Math.floor(5e6/Math.sqrt(5e6*t));if(i>4096&&(r=Math.round((i=4096)/t)),r>4096&&(i=Math.round(t*(r=4096))),e.width>i){let t=document.createElement("canvas");return t.width=i,t.height=r,t.getContext("2d").drawImage(e,0,0,i,r),t}return e}(e),s=Math.ceil(Math.log2(r.width/t));s<1&&(s=1);let n=t*2**(s-1),a=i*2**(s-1);for(;s--;){let e=document.createElement("canvas");e.width=n,e.height=a,e.getContext("2d").drawImage(r,0,0,n,a),r=e,n=Math.round(n/2),a=Math.round(a/2)}return r}setPreviewURL(e,t){this.uppy.setFileState(e,{preview:t})}addToQueue(e){this.queue.push(e),!1===this.queueProcessing&&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 t7(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()}onFileAdded=e=>{!e.preview&&e.data&&t7(e.type)&&!e.isRemote&&this.addToQueue(e.id)};onCancelRequest=e=>{let t=this.queue.indexOf(e.id);-1!==t&&this.queue.splice(t,1)};onFileRemoved=e=>{let t=this.queue.indexOf(e.id);-1!==t&&this.queue.splice(t,1),e.preview&&t6(e.preview)&&URL.revokeObjectURL(e.preview)};onRestored=()=>{this.uppy.getFiles().filter(e=>e.isRestored).forEach(e=>{(!e.preview||t6(e.preview))&&this.addToQueue(e.id)})};onAllFilesRemoved=()=>{this.queue=[]};waitUntilAllProcessed=e=>{e.forEach(e=>{let t=this.uppy.getFile(e);this.uppy.emit("preprocess-progress",t,{mode:"indeterminate",message:this.i18n("generatingThumbnails")})});let t=()=>{e.forEach(e=>{let t=this.uppy.getFile(e);this.uppy.emit("preprocess-complete",t)})};return new Promise(e=>{this.queueProcessing?this.uppy.once("thumbnail:all-generated",()=>{t(),e()}):(t(),e())})};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)}}var rl=function(e){if("string"==typeof e){let t=document.querySelectorAll(e);return 0===t.length?null:Array.from(t)}return"object"==typeof e&&s(e)?[e]:null},ru=Array.from;async function*rh(e,t,i){let r=()=>`${t}/${e.name}`;if("file"===e.kind){let s=await e.getFile();null!=s?(s.relativePath=t?r():null,yield s):null!=i&&(yield i)}else if("directory"===e.kind)for await(let i of e.values())yield*rh(i,t?r():e.name);else null!=i&&(yield i)}async function*rp(e,t){for(let{lastResortFile:i,fileSystemHandle:r}of(await Promise.all(Array.from(e.items,async e=>{let i;return{fileSystemHandle:i??=function e(t,i){return null==t?t:{kind:t.isFile?"file":t.isDirectory?"directory":void 0,name:t.name,getFile:()=>new Promise((e,i)=>t.file(e,i)),async *values(){let r=t.createReader(),s=await new Promise(t=>{!function e(t,i,r,{onSuccess:s}){t.readEntries(n=>{let a=[...i,...n];n.length?queueMicrotask(()=>{e(t,a,r,{onSuccess:s})}):s(a)},e=>{r(e),s(i)})}(r,[],i,{onSuccess:r=>t(r.map(t=>e(t,i)))})});yield*s},isSameEntry:void 0}}("function"==typeof e.getAsEntry?e.getAsEntry():e.webkitGetAsEntry(),t),lastResortFile:e.getAsFile()}}))))if(null!=r)try{yield*rh(r,"",i)}catch(e){null!=i?yield i:t(e)}else null!=i&&(yield i)}async function rd(e,t){let i=t?.logDropError??Function.prototype;try{let t=[];for await(let r of rp(e,i))t.push(r);return t}catch{return Promise.resolve(ru(e.files))}}let rc=(e=21)=>{let t="",i=0|e;for(;i--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t};function rf(){let e=document.body;return!!("draggable"in e&&"ondragstart"in e&&"ondrop"in e&&"FormData"in window&&"FileReader"in window)}class rg extends F{fileInput=null;folderInput=null;mobilePhotoFileInput=null;mobileVideoFileInput=null;triggerFileInputClick=()=>{this.fileInput?.click()};triggerFolderInputClick=()=>{this.folderInput?.click()};triggerVideoCameraInputClick=()=>{this.mobileVideoFileInput?.click()};triggerPhotoCameraInputClick=()=>{this.mobilePhotoFileInput?.click()};onFileInputChange=e=>{this.props.handleInputChange(e),e.currentTarget.value=""};renderHiddenInput=(e,t)=>eM("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,webkitdirectory:e,type:"file",name:"files[]",multiple:1!==this.props.maxNumberOfFiles,onChange:this.onFileInputChange,accept:this.props.allowedFileTypes?.join(", "),ref:t});renderHiddenCameraInput=(e,t,i)=>eM("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,type:"file",name:`camera-${e}`,onChange:this.onFileInputChange,capture:""===t?"environment":t,accept:{photo:"image/*",video:"video/*"}[e],ref:i});renderMyDeviceAcquirer=()=>eM("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MyDevice",children:eM("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,children:[eM("div",{className:"uppy-DashboardTab-inner",children:eM("svg",{className:"uppy-DashboardTab-iconMyDevice","aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32",children:eM("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"})})}),eM("div",{className:"uppy-DashboardTab-name",children:this.props.i18n("myDevice")})]})});renderPhotoCamera=()=>eM("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobilePhotoCamera",children:eM("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,children:[eM("div",{className:"uppy-DashboardTab-inner",children:eM("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32",children:eM("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"})})}),eM("div",{className:"uppy-DashboardTab-name",children:this.props.i18n("takePictureBtn")})]})});renderVideoCamera=()=>eM("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobileVideoCamera",children:eM("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,children:[eM("div",{className:"uppy-DashboardTab-inner",children:eM("svg",{"aria-hidden":"true",width:"32",height:"32",viewBox:"0 0 32 32",children:eM("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 "})})}),eM("div",{className:"uppy-DashboardTab-name",children:this.props.i18n("recordVideoBtn")})]})});renderBrowseButton=(e,t)=>eM("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-browse",onClick:t,"data-uppy-super-focusable":0===this.props.acquirers.length,children:e});renderDropPasteBrowseTagline=e=>{let t=this.renderBrowseButton(this.props.i18n("browseFiles"),this.triggerFileInputClick),i=this.renderBrowseButton(this.props.i18n("browseFolders"),this.triggerFolderInputClick),r=this.props.fileManagerSelectionType,s=r.charAt(0).toUpperCase()+r.slice(1);return eM("div",{class:"uppy-Dashboard-AddFiles-title",children: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})})};[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")}renderAcquirer=e=>eM("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":e.id,children:eM("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":this.props.activePickerPanel?.id===e.id,"data-uppy-super-focusable":!0,onClick:()=>this.props.showPanel(e.id),children:[eM("div",{className:"uppy-DashboardTab-inner",children:e.icon()}),eM("div",{className:"uppy-DashboardTab-name",children:e.name})]})});renderAcquirers=e=>{let t=[...e],i=t.splice(e.length-2,e.length);return eM(P,{children:[t.map(e=>this.renderAcquirer(e)),eM("span",{role:"presentation",style:{"white-space":"nowrap"},children:i.map(e=>this.renderAcquirer(e))})]})};renderSourcesList=(e,t)=>{let{showNativePhotoCameraButton:i,showNativeVideoCameraButton:r}=this.props,s=[],n="myDevice";t||s.push({key:n,elements:this.renderMyDeviceAcquirer()}),i&&s.push({key:"nativePhotoCameraButton",elements:this.renderPhotoCamera()}),r&&s.push({key:"nativePhotoCameraButton",elements:this.renderVideoCamera()}),s.push(...e.map(e=>({key:e.id,elements:this.renderAcquirer(e)}))),1===s.length&&s[0].key===n&&(s=[]);let a=[...s],o=a.splice(s.length-2,s.length);return eM(P,{children:[this.renderDropPasteBrowseTagline(s.length),eM("div",{className:"uppy-Dashboard-AddFiles-list",role:"tablist",children:[a.map(({key:e,elements:t})=>eM(P,{children:t},e)),eM("span",{role:"presentation",style:{"white-space":"nowrap"},children:o.map(({key:e,elements:t})=>eM(P,{children:t},e))})]})]})};renderPoweredByUppy(){let{i18nArray:e}=this.props,t=e("poweredBy",{uppy:eM("span",{children:[eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-poweredByIcon",width:"11",height:"11",viewBox:"0 0 11 11",children:eM("path",{d:"M7.365 10.5l-.01-4.045h2.612L5.5.806l-4.467 5.65h2.604l.01 4.044h3.718z",fillRule:"evenodd"})}),eM("span",{className:"uppy-Dashboard-poweredByUppy",children:"Uppy"})]})});return eM("a",{tabIndex:-1,href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",className:"uppy-Dashboard-poweredBy",children:t})}render(){let{showNativePhotoCameraButton:e,showNativeVideoCameraButton:t,nativeCameraFacingMode:i}=this.props;return eM("div",{className:"uppy-Dashboard-AddFiles",children:[this.renderHiddenInput(!1,e=>{this.fileInput=e}),this.renderHiddenInput(!0,e=>{this.folderInput=e}),e&&this.renderHiddenCameraInput("photo",i,e=>{this.mobilePhotoFileInput=e}),t&&this.renderHiddenCameraInput("video",i,e=>{this.mobileVideoFileInput=e}),this.renderSourcesList(this.props.acquirers,this.props.disableLocalFiles),eM("div",{className:"uppy-Dashboard-AddFiles-info",children:[this.props.note&&eM("div",{className:"uppy-Dashboard-note",children:this.props.note}),this.props.proudlyDisplayPoweredByUppy&&this.renderPoweredByUppy()]})]})}}var rm=e=>eM("div",{className:eK("uppy-Dashboard-AddFilesPanel",e.className),"data-uppy-panelType":"AddFiles","aria-hidden":!e.showAddFilesPanel,children:[eM("div",{className:"uppy-DashboardContent-bar",children:[eM("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":1,children:e.i18n("addingMoreFiles")}),eM("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>e.toggleAddFilesPanel(!1),children:e.i18n("back")})]}),eM(rg,{...e})]}),ry=function(e){let t=e.files[e.fileCardFor];return eM("div",{className:eK("uppy-DashboardContent-panel",e.className),role:"tabpanel","data-uppy-panelType":"FileEditor",id:"uppy-DashboardContent-panel--editor",children:[eM("div",{className:"uppy-DashboardContent-bar",children:[eM("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":1,children:e.i18nArray("editing",{file:eM("span",{className:"uppy-DashboardContent-titleFile",children:t.meta?t.meta.name:t.name})})}),eM("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>{e.uppy.emit("file-editor:cancel",t),e.closeFileEditor()},children:e.i18n("cancel")}),eM("button",{className:"uppy-DashboardContent-save",type:"button",onClick:e.saveFileEditor,children:e.i18n("save")})]}),eM("div",{className:"uppy-DashboardContent-panelBody",children:e.editors.map(t=>e.uppy.getPlugin(t.id).render(e.state))})]})};function rv(e){let t={color:"#838999",icon:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:eM("g",{fill:"#A7AFB7",fillRule:"nonzero",children:[eM("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"}),eM("path",{d:"M15 4v3a1 1 0 0 0 1 1h3V7h-3V4h-1z"})]})})};if(!e)return t;let i=e.split("/")[0],r=e.split("/")[1];return"text"===i?{color:"#5a5e69",icon:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:eM("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"})})}:"image"===i?{color:"#686de0",icon:eM("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25",children:eM("g",{fill:"#686DE0",fillRule:"evenodd",children:[eM("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"}),eM("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"}),eM("circle",{cx:"7.5",cy:"9.5",r:"1.5"})]})})}:"audio"===i?{color:"#068dbb",icon:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:eM("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"})})}:"video"===i?{color:"#19af67",icon:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:eM("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"})})}:"application"===i&&"pdf"===r?{color:"#e25149",icon:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:eM("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"})})}:"application"===i&&-1!==["zip","x-7z-compressed","x-zip-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(r)?{color:"#00C469",icon:eM("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25",children:eM("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"})})}:t}var rb=function(e){let{tagName:t}=e.target;if("INPUT"===t||"TEXTAREA"===t){e.stopPropagation();return}e.preventDefault(),e.stopPropagation()};function rw(e){let{file:t}=e;if(t.preview)return eM("img",{draggable:!1,className:"uppy-Dashboard-Item-previewImg",alt:t.name,src:t.preview});let{color:i,icon:r}=rv(t.type);return eM("div",{className:"uppy-Dashboard-Item-previewIconWrap",children:[eM("span",{className:"uppy-Dashboard-Item-previewIcon",style:{color:i},children:r}),eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-Dashboard-Item-previewIconBg",width:"58",height:"76",viewBox:"0 0 58 76",children:eM("rect",{fill:"#FFF",width:"58",height:"76",rx:"3",fillRule:"evenodd"})})]})}function r_(e){let{computedMetaFields:t,requiredMetaFields:i,updateMeta:r,form:s,formState:n}=e,a={text:"uppy-u-reset uppy-c-textInput uppy-Dashboard-FileCard-input"};return t.map(e=>{let t=`uppy-Dashboard-FileCard-input-${e.id}`,o=i.includes(e.id);return eM("fieldset",{className:"uppy-Dashboard-FileCard-fieldset",children:[eM("label",{className:"uppy-Dashboard-FileCard-label",htmlFor:t,children:e.name}),void 0!==e.render?e.render({value:n[e.id],onChange:t=>r(t,e.id),fieldCSSClasses:a,required:o,form:s.id},S):eM("input",{className:a.text,id:t,form:s.id,type:e.type||"text",required:o,value:n[e.id],placeholder:e.placeholder,onInput:t=>r(t.target.value,e.id),"data-uppy-super-focusable":!0})]},e.id)})}function rS(e){let{files:t,fileCardFor:i,toggleFileCard:r,saveFileCard:s,metaFields:n,requiredMetaFields:a,openFileEditor:o,i18n:l,i18nArray:u,className:h,canEditFile:p}=e,d=t[i],c=("function"==typeof n?n(t[i]):n)??[],f=p(d),g={};c.forEach(e=>{g[e.id]=d.meta[e.id]??""});let[m,y]=J(g),v=er(e=>{e.preventDefault(),s(m,i)},[s,m,i]),b=()=>{r(!1)},[w]=J(()=>{let e=document.createElement("form");return e.setAttribute("tabindex","-1"),e.id=rc(),e});return ee(()=>(document.body.appendChild(w),w.addEventListener("submit",v),()=>{w.removeEventListener("submit",v),document.body.removeChild(w)}),[w,v]),eM("div",{className:eK("uppy-Dashboard-FileCard",h),"data-uppy-panelType":"FileCard",onDragOver:rb,onDragLeave:rb,onDrop:rb,onPaste:rb,children:[eM("div",{className:"uppy-DashboardContent-bar",children:[eM("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":1,children:u("editing",{file:eM("span",{className:"uppy-DashboardContent-titleFile",children:d.meta?d.meta.name:d.name})})}),eM("button",{className:"uppy-DashboardContent-back",type:"button",form:w.id,title:l("finishEditingFile"),onClick:b,children:l("cancel")})]}),eM("div",{className:"uppy-Dashboard-FileCard-inner",children:[eM("div",{className:"uppy-Dashboard-FileCard-preview",style:{backgroundColor:rv(d.type).color},children:[eM(rw,{file:d}),f&&eM("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-FileCard-edit",onClick:e=>{v(e),o(d)},children:l("editImage")})]}),eM("div",{className:"uppy-Dashboard-FileCard-info",children:eM(r_,{computedMetaFields:c,requiredMetaFields:a,updateMeta:(e,t)=>{y({...m,[t]:e})},form:w,formState:m})}),eM("div",{className:"uppy-Dashboard-FileCard-actions",children:[eM("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Dashboard-FileCard-actionsBtn",type:"submit",form:w.id,children:l("saveChanges")}),eM("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link uppy-Dashboard-FileCard-actionsBtn",type:"button",onClick:b,form:w.id,children:l("cancel")})]})]})]})}function rC({file:e,uploadInProgressOrComplete:t,metaFields:i,canEditFile:r,i18n:s,onClick:n}){return!t&&i&&i.length>0||!t&&r(e)?eM("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:()=>n(),children:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 14",children:eM("g",{fillRule:"evenodd",children:[eM("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"}),eM("rect",{x:"1",y:"12.293",width:"11",height:"1",rx:".5"}),eM("path",{fillRule:"nonzero",d:"M6.793 2.5L9.5 5.207l.707-.707L7.5 1.793z"})]})})}):null}function rP({i18n:e,onClick:t,file:i}){return eM("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(),children:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"18",height:"18",viewBox:"0 0 18 18",children:[eM("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"}),eM("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 rF({file:e,uppy:t,i18n:i}){let r=r=>{(function(e,t="Copy the URL below"){return new Promise(i=>{let r=document.createElement("textarea");r.setAttribute("style",{position:"fixed",top:0,left:0,width:"2em",height:"2em",padding:0,border:"none",outline:"none",boxShadow:"none",background:"transparent"}),r.value=e,document.body.appendChild(r),r.select();let s=()=>{document.body.removeChild(r),window.prompt(t,e),i()};try{if(!document.execCommand("copy"))return s();return document.body.removeChild(r),i()}catch(e){return document.body.removeChild(r),s()}})})(e.uploadURL,i("copyLinkToClipboardFallback")).then(()=>{t.log("Link copied to clipboard."),t.info(i("copyLinkToClipboardSuccess"),"info",3e3)}).catch(t.log).then(()=>r.target.focus({preventScroll:!0}))};return eM("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--copyLink",type:"button","aria-label":i("copyLink"),title:i("copyLink"),onClick:e=>r(e),children:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 12",children:eM("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 rk(e){let{uppy:t,file:i,uploadInProgressOrComplete:r,canEditFile:s,metaFields:n,showLinkToFileUploadResult:a,showRemoveButton:o,i18n:l,toggleFileCard:u,openFileEditor:h}=e;return eM("div",{className:"uppy-Dashboard-Item-actionWrapper",children:[eM(rC,{i18n:l,file:i,uploadInProgressOrComplete:r,canEditFile:s,metaFields:n,onClick:()=>{n&&n.length>0?u(!0,i.id):h(i)}}),a&&i.uploadURL?eM(rF,{file:i,uppy:t,i18n:l}):null,o?eM(rP,{i18n:l,file:i,onClick:()=>t.removeFile(i.id)}):null]})}function rT(e,t){if(0===t)return"";if(e.length<=t)return e;if(t<=4)return`${e.slice(0,t-1)}…`;let i=t-3;return e.slice(0,Math.ceil(i/2))+"..."+e.slice(-Math.floor(i/2))}let rE=(e,t)=>("function"==typeof t?t():t).filter(t=>t.id===e)[0].name;function rA(e){let{file:t,toggleFileCard:i,i18n:r,metaFields:s}=e,{missingRequiredMetaFields:n}=t;if(!n?.length)return null;let a=n.map(e=>rE(e,s)).join(", ");return eM("div",{className:"uppy-Dashboard-Item-errorMessage",children:[r("missingRequiredMetaFields",{smart_count:n.length,fields:a})," ",eM("button",{type:"button",class:"uppy-u-reset uppy-Dashboard-Item-errorMessageBtn",onClick:()=>i(!0,t.id),children:r("editFile")})]})}let rx=e=>{let{author:t,name:i}=e.file.meta;return eM("div",{className:"uppy-Dashboard-Item-name",title:i,children:rT(i,e.isSingleFile&&e.containerHeight>=350?90:e.containerWidth<=352?35:e.containerWidth<=576?60:t?20:30)})},rI=e=>{let{author:t}=e.file.meta,i=e.file.remote?.providerName,r=`\u00B7`;return t?eM("div",{className:"uppy-Dashboard-Item-author",children:[eM("a",{href:`${t.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer",children:rT(t.name,13)}),i?eM(P,{children:[` ${r} `,i,` ${r} `]}):null]}):null},rU=e=>e.file.size&&eM("div",{className:"uppy-Dashboard-Item-statusSize",children:tD(e.file.size)}),rO=e=>e.file.isGhost&&eM("span",{children:[" • ",eM("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-reSelect",type:"button",onClick:()=>e.toggleAddFilesPanel(!0),children:e.i18n("reSelect")})]}),rD=({file:e,onClick:t})=>e.error?eM("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",children:"?"}):null;function rR(e){let{file:t,i18n:i,toggleFileCard:r,metaFields:s,toggleAddFilesPanel:n,isSingleFile:a,containerHeight:o,containerWidth:l}=e;return eM("div",{className:"uppy-Dashboard-Item-fileInfo","data-uppy-file-source":t.source,children:[eM("div",{className:"uppy-Dashboard-Item-fileName",children:[rx({file:t,isSingleFile:a,containerHeight:o,containerWidth:l}),eM(rD,{file:t,onClick:()=>alert(t.error)})]}),eM("div",{className:"uppy-Dashboard-Item-status",children:[rI({file:t}),rU({file:t}),rO({file:t,toggleAddFilesPanel:n,i18n:i})]}),eM(rA,{file:t,i18n:i,toggleFileCard:r,metaFields:s})]})}function rN(e){let{file:t,i18n:i,toggleFileCard:r,metaFields:s,showLinkToFileUploadResult:n}=e;return eM("div",{className:"uppy-Dashboard-Item-previewInnerWrap",style:{backgroundColor:t.preview?"rgba(255, 255, 255, 0.5)":rv(t.type).color},children:[n&&t.uploadURL&&eM("a",{className:"uppy-Dashboard-Item-previewLink",href:t.uploadURL,rel:"noreferrer noopener",target:"_blank","aria-label":t.meta.name,children:eM("span",{hidden:!0,children:t.meta.name})}),eM(rw,{file:t}),eM(rA,{file:t,i18n:i,toggleFileCard:r,metaFields:s})]})}function rM(e){return e.isUploaded?e.i18n("uploadComplete"):e.error?e.i18n("retryUpload"):e.resumableUploads?e.file.isPaused?e.i18n("resumeUpload"):e.i18n("pauseUpload"):e.individualCancellation?e.i18n("cancelUpload"):""}function rB(e){return eM("div",{className:"uppy-Dashboard-Item-progress",children:eM("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-progressIndicator",type:"button","aria-label":rM(e),title:rM(e),onClick:()=>(function(e){if(!e.isUploaded){if(e.error&&!e.hideRetryButton){e.uppy.retryUpload(e.file.id);return}e.resumableUploads&&!e.hidePauseResumeButton?e.uppy.pauseResume(e.file.id):e.individualCancellation&&!e.hideCancelButton&&e.uppy.removeFile(e.file.id)}})(e),children:e.children})})}function rL({children:e}){return eM("svg",{"aria-hidden":"true",focusable:"false",width:"70",height:"70",viewBox:"0 0 36 36",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--circle",children:e})}function rz({progress:e}){let t=2*Math.PI*15;return eM("g",{children:[eM("circle",{className:"uppy-Dashboard-Item-progressIcon--bg",r:"15",cx:"18",cy:"18","stroke-width":"2",fill:"none"}),eM("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 r$(e){return e.file.progress.uploadStarted&&void 0!==e.file.progress.percentage?e.isUploaded?eM("div",{className:"uppy-Dashboard-Item-progress",children:eM("div",{className:"uppy-Dashboard-Item-progressIndicator",children:eM(rL,{children:[eM("circle",{r:"15",cx:"18",cy:"18",fill:"#1bb240"}),eM("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"})]})})}):e.recoveredState?null:e.error&&!e.hideRetryButton?eM(rB,{...e,children:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--retry",width:"28",height:"31",viewBox:"0 0 16 19",children:[eM("path",{d:"M16 11a8 8 0 1 1-8-8v2a6 6 0 1 0 6 6h2z"}),eM("path",{d:"M7.9 3H10v2H7.9z"}),eM("path",{d:"M8.536.5l3.535 3.536-1.414 1.414L7.12 1.914z"}),eM("path",{d:"M10.657 2.621l1.414 1.415L8.536 7.57 7.12 6.157z"})]})}):e.resumableUploads&&!e.hidePauseResumeButton?eM(rB,{...e,children:eM(rL,{children:[eM(rz,{progress:e.file.progress.percentage}),e.file.isPaused?eM("polygon",{className:"uppy-Dashboard-Item-progressIcon--play",transform:"translate(3, 3)",points:"12 20 12 10 20 15"}):eM("g",{className:"uppy-Dashboard-Item-progressIcon--pause",transform:"translate(14.5, 13)",children:[eM("rect",{x:"0",y:"0",width:"2",height:"10",rx:"0"}),eM("rect",{x:"5",y:"0",width:"2",height:"10",rx:"0"})]})]})}):e.resumableUploads||!e.individualCancellation||e.hideCancelButton?eM("div",{className:"uppy-Dashboard-Item-progress",children:eM("div",{className:"uppy-Dashboard-Item-progressIndicator",children:eM(rL,{children:eM(rz,{progress:e.file.progress.percentage})})})}):eM(rB,{...e,children:eM(rL,{children:[eM(rz,{progress:e.file.progress.percentage}),eM("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"})]})}):null}class rq extends F{componentDidMount(){let{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}shouldComponentUpdate(e){return!function(e,t){if(e===t)return!0;if(!e||!t)return!1;let i=Object.keys(e),r=Object.keys(t),s=i.length;if(r.length!==s)return!1;for(let r=0;r<s;r++){let s=i[r];if(e[s]!==t[s]||!Object.prototype.hasOwnProperty.call(t,s))return!1}return!0}(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,r=!!e.progress.uploadStarted||!!t,s=e.progress.uploadStarted&&!e.progress.uploadComplete||t,n=e.error||!1,{isGhost:a}=e,o=this.props.individualCancellation?!i:!s&&!i;return i&&this.props.showRemoveButtonAfterComplete&&(o=!0),eM("div",{className:eK({"uppy-Dashboard-Item":!0,"is-inprogress":s&&!this.props.recoveredState,"is-processing":t,"is-complete":i,"is-error":!!n,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation,"is-ghost":a}),id:`uppy_${e.id}`,role:this.props.role,children:[eM("div",{className:"uppy-Dashboard-Item-preview",children:[eM(rN,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,i18n:this.props.i18n,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),eM(r$,{uppy:this.props.uppy,file:e,error:n,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})]}),eM("div",{className:"uppy-Dashboard-Item-fileInfoAndButtons",children:[eM(rR,{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}),eM(rk,{file:e,metaFields:this.props.metaFields,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,showRemoveButton:o,canEditFile:this.props.canEditFile,uploadInProgressOrComplete:r,toggleFileCard:this.props.toggleFileCard,openFileEditor:this.props.openFileEditor,uppy:this.props.uppy,i18n:this.props.i18n})]})]})}}function rH({id:e,i18n:t,uppy:i,files:r,resumableUploads:s,hideRetryButton:n,hidePauseResumeButton:a,hideCancelButton:o,showLinkToFileUploadResult:l,showRemoveButtonAfterComplete:u,metaFields:h,isSingleFile:p,toggleFileCard:d,handleRequestThumbnail:c,handleCancelThumbnail:f,recoveredState:g,individualCancellation:m,itemsPerRow:y,openFileEditor:v,canEditFile:b,toggleAddFilesPanel:w,containerWidth:_,containerHeight:S}){let C=1===y?71:200,P=ei(()=>{let e=Object.keys(r);return g&&e.sort((e,t)=>Number(r[t].isGhost)-Number(r[e].isGhost)),function(e,t){let i=[],r=[];return e.forEach(e=>{r.length<t?r.push(e):(i.push(r),r=[e])}),r.length&&i.push(r),i}(e,y)},[r,y,g]),F=y=>eM("div",{class:"uppy-Dashboard-filesInner",role:"presentation",children:y.map(y=>eM(rq,{uppy:i,id:e,i18n:t,resumableUploads:s,individualCancellation:m,hideRetryButton:n,hidePauseResumeButton:a,hideCancelButton:o,showLinkToFileUploadResult:l,showRemoveButtonAfterComplete:u,metaFields:h,recoveredState:g,isSingleFile:p,containerWidth:_,containerHeight:S,toggleFileCard:d,handleRequestThumbnail:c,handleCancelThumbnail:f,role:"listitem",openFileEditor:v,canEditFile:b,toggleAddFilesPanel:w,file:r[y]},y))},y[0]);return p?eM("div",{class:"uppy-Dashboard-files",children:F(P[0])}):eM(eQ,{class:"uppy-Dashboard-files",role:"list",data:P,renderRow:F,rowHeight:C})}var rj=function({activePickerPanel:e,className:t,hideAllPanels:i,i18n:r,state:s,uppy:n}){let a=et(null);return eM("div",{className:eK("uppy-DashboardContent-panel",t),role:"tabpanel","data-uppy-panelType":"PickerPanel",id:`uppy-DashboardContent-panel--${e.id}`,onDragOver:rb,onDragLeave:rb,onDrop:rb,onPaste:rb,children:[eM("div",{className:"uppy-DashboardContent-bar",children:[eM("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":1,children:r("importFrom",{name:e.name})}),eM("button",{className:"uppy-DashboardContent-back",type:"button",onClick:i,children:r("cancel")})]}),eM("div",{ref:a,className:"uppy-DashboardContent-panelBody",children:n.getPlugin(e.id).render(s,a.current)})]})};let rV={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete",STATE_PAUSED:"paused"};function rW({files:e,i18n:t,isAllComplete:i,isAllErrored:r,isAllPaused:s,inProgressNotPausedFiles:n,newFiles:a,processingFiles:o}){switch(function(e,t,i,r={}){if(e)return rV.STATE_ERROR;if(t)return rV.STATE_COMPLETE;if(i)return rV.STATE_PAUSED;let s=rV.STATE_WAITING,n=Object.keys(r);for(let e=0;e<n.length;e++){let{progress:t}=r[n[e]];if(t.uploadStarted&&!t.uploadComplete)return rV.STATE_UPLOADING;t.preprocess&&s!==rV.STATE_UPLOADING&&(s=rV.STATE_PREPROCESSING),t.postprocess&&s!==rV.STATE_UPLOADING&&s!==rV.STATE_PREPROCESSING&&(s=rV.STATE_POSTPROCESSING)}return s}(r,i,s,e)){case"uploading":return t("uploadingXFiles",{smart_count:n.length});case"preprocessing":case"postprocessing":return t("processingXFiles",{smart_count:o.length});case"paused":return t("uploadPaused");case"waiting":return t("xFilesSelected",{smart_count:a.length});case"complete":return t("uploadComplete");case"error":return t("error")}}var rG=function(e){let{i18n:t,isAllComplete:i,hideCancelButton:r,maxNumberOfFiles:s,toggleAddFilesPanel:n,uppy:a}=e,{allowNewUpload:o}=e;return o&&s&&(o=e.totalFileCount<e.maxNumberOfFiles),eM("div",{className:"uppy-DashboardContent-bar",children:[i||r?eM("div",{}):eM("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>a.cancelAll(),children:t("cancel")}),eM("div",{className:"uppy-DashboardContent-title",children:eM(rW,{...e})}),o?eM("button",{className:"uppy-DashboardContent-addMore",type:"button","aria-label":t("addMoreFiles"),title:t("addMoreFiles"),onClick:()=>n(!0),children:[eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"15",height:"15",viewBox:"0 0 15 15",children:eM("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"})}),eM("span",{className:"uppy-DashboardContent-addMoreCaption",children:t("addMore")})]}):eM("div",{})]})};let rK="uppy-transition-slideDownUp";var rX=function({children:e}){let[t,i]=J(null),[r,s]=J(""),n=et(),a=et(),o=et(),l=()=>{s(`${rK}-enter`),cancelAnimationFrame(o.current),clearTimeout(a.current),a.current=void 0,o.current=requestAnimationFrame(()=>{s(`${rK}-enter ${rK}-enter-active`),n.current=setTimeout(()=>{s("")},250)})},u=()=>{s(`${rK}-leave`),cancelAnimationFrame(o.current),clearTimeout(n.current),n.current=void 0,o.current=requestAnimationFrame(()=>{s(`${rK}-leave ${rK}-leave-active`),a.current=setTimeout(()=>{i(null),s("")},250)})};return(ee(()=>{let r=x(e)[0];t!==r&&(r&&!t?l():!t||r||a.current||u(),i(r))},[e,t]),ee(()=>()=>{clearTimeout(n.current),clearTimeout(a.current),cancelAnimationFrame(o.current)},[]),t)?B(t,{className:eK(r,t.props.className)}):null},rZ={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"}},rY=['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])'],rQ=i(7310);function rJ(e,t){if(t){let i=e.querySelector(`[data-uppy-paneltype="${t}"]`);if(i)return i}return e}function r1(e,t){let i=t[0];i&&(i.focus(),e.preventDefault())}function r0(e,t,i){let r=rJ(i,t),s=ru(r.querySelectorAll(rY)),n=s.indexOf(document.activeElement);r.contains(document.activeElement)?e.shiftKey&&0===n?function(e,t){let i=t[t.length-1];i&&(i.focus(),e.preventDefault())}(e,s):e.shiftKey||n!==s.length-1||r1(e,s):r1(e,s)}function r2(){let e={};return e.promise=new Promise((t,i)=>{e.resolve=t,e.reject=i}),e}let r5={target:"body",metaFields:[],thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:tF,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};class r3 extends eR{static VERSION="4.4.1";#ty;modalName=`uppy-Dashboard-${rc()}`;superFocus=(r=!1,rQ((e,t)=>{let i=rJ(e,t),s=i.contains(document.activeElement);if(s&&r)return;let n=i.querySelector("[data-uppy-super-focusable]");if(!s||n){if(n)n.focus({preventScroll:!0}),r=!0;else{let e=i.querySelector(rY);e?.focus({preventScroll:!0}),r=!1}}},260));ifFocusedOnUppyRecently=!1;dashboardIsDisabled;savedScrollPosition;savedActiveElement;resizeObserver;darkModeMediaQuery;makeDashboardInsidesVisibleAnywayTimeout;constructor(e,t){super(e,{...r5,...t,autoOpen:t?.autoOpen??null}),this.id=this.opts.id||"Dashboard",this.title="Dashboard",this.type="orchestrator",this.defaultLocale=rZ,void 0===this.opts.doneButtonHandler&&(this.opts.doneButtonHandler=()=>{this.uppy.clear(),this.requestCloseModal()}),this.opts.onRequestCloseModal??=()=>this.closeModal(),this.i18nInit()}removeTarget=e=>{let t=this.getPluginState().targets.filter(t=>t.id!==e.id);this.setPluginState({targets:t})};addTarget=e=>{let t=e.id||e.constructor.name,i=e.title||t,r=e.type;if("acquirer"!==r&&"progressindicator"!==r&&"editor"!==r)return this.uppy.log("Dashboard: can only be targeted by plugins of types: acquirer, progressindicator, editor","error"),null;let s=this.getPluginState().targets.slice();return s.push({id:t,name:i,type:r}),this.setPluginState({targets:s}),this.el};hideAllPanels=()=>{let e=this.getPluginState(),t={activePickerPanel:void 0,showAddFilesPanel:!1,activeOverlayType:null,fileCardFor:null,showFileEditor:!1};(e.activePickerPanel!==t.activePickerPanel||e.showAddFilesPanel!==t.showAddFilesPanel||e.showFileEditor!==t.showFileEditor||e.activeOverlayType!==t.activeOverlayType)&&(this.setPluginState(t),this.uppy.emit("dashboard:close-panel",e.activePickerPanel?.id))};showPanel=e=>{let{targets:t}=this.getPluginState(),i=t.find(t=>"acquirer"===t.type&&t.id===e);this.setPluginState({activePickerPanel:i,activeOverlayType:"PickerPanel"}),this.uppy.emit("dashboard:show-panel",e)};canEditFile=e=>{let{targets:t}=this.getPluginState();return this.#tv(t).some(t=>this.uppy.getPlugin(t.id).canEditFile(e))};openFileEditor=e=>{let{targets:t}=this.getPluginState(),i=this.#tv(t);this.setPluginState({showFileEditor:!0,fileCardFor:e.id||null,activeOverlayType:"FileEditor"}),i.forEach(t=>{this.uppy.getPlugin(t.id).selectFile(e)})};closeFileEditor=()=>{let{metaFields:e}=this.getPluginState();e&&e.length>0?this.setPluginState({showFileEditor:!1,activeOverlayType:"FileCard"}):this.setPluginState({showFileEditor:!1,fileCardFor:null,activeOverlayType:"AddFiles"})};saveFileEditor=()=>{let{targets:e}=this.getPluginState();this.#tv(e).forEach(e=>{this.uppy.getPlugin(e.id).save()}),this.closeFileEditor()};openModal=()=>{let{promise:e,resolve:t}=r2();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 e=()=>{this.setPluginState({isHidden:!1}),this.el.removeEventListener("animationend",e,!1),t()};this.el.addEventListener("animationend",e,!1)}else this.setPluginState({isHidden:!1}),t();return this.opts.browserBackButtonClose&&this.updateBrowserHistory(),document.addEventListener("keydown",this.handleKeyDownInModal),this.uppy.emit("dashboard:modal-open"),e};closeModal=e=>{let t=e?.manualClose??!0,{isHidden:i,isClosing:r}=this.getPluginState();if(i||r)return;let{promise:s,resolve:n}=r2();if(this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.opts.animateOpenClose){this.setPluginState({isClosing:!0});let e=()=>{this.setPluginState({isHidden:!0,isClosing:!1}),this.superFocus.cancel(),this.savedActiveElement.focus(),this.el.removeEventListener("animationend",e,!1),n()};this.el.addEventListener("animationend",e,!1)}else this.setPluginState({isHidden:!0}),this.superFocus.cancel(),this.savedActiveElement.focus(),n();return document.removeEventListener("keydown",this.handleKeyDownInModal),t&&this.opts.browserBackButtonClose&&history.state?.[this.modalName]&&history.back(),this.uppy.emit("dashboard:modal-closed"),s};isModalOpen=()=>!this.getPluginState().isHidden;requestCloseModal=()=>this.opts.onRequestCloseModal?this.opts.onRequestCloseModal():this.closeModal();setDarkModeCapability=e=>{let{capabilities:t}=this.uppy.getState();this.uppy.setState({capabilities:{...t,darkMode:e}})};handleSystemDarkModeChange=e=>{let t=e.matches;this.uppy.log(`[Dashboard] Dark mode is ${t?"on":"off"}`),this.setDarkModeCapability(t)};toggleFileCard=(e,t)=>{let i=this.uppy.getFile(t);e?this.uppy.emit("dashboard:file-edit-start",i):this.uppy.emit("dashboard:file-edit-complete",i),this.setPluginState({fileCardFor:e?t:null,activeOverlayType:e?"FileCard":null})};toggleAddFilesPanel=e=>{this.setPluginState({showAddFilesPanel:e,activeOverlayType:e?"AddFiles":null})};addFiles=e=>{let t=e.map(e=>({source:this.id,name:e.name,type:e.type,data:e,meta:{relativePath:e.relativePath||e.webkitRelativePath||null}}));try{this.uppy.addFiles(t)}catch(e){this.uppy.log(e)}};startListeningToResize=()=>{this.resizeObserver=new ResizeObserver(e=>{let{width:t,height:i}=e[0].contentRect;this.setPluginState({containerWidth:t,containerHeight:i,areInsidesReadyToBeVisible:!0})}),this.resizeObserver.observe(this.el.querySelector(".uppy-Dashboard-inner")),this.makeDashboardInsidesVisibleAnywayTimeout=setTimeout(()=>{let e=this.getPluginState(),t=!this.opts.inline&&e.isHidden;e.areInsidesReadyToBeVisible||t||(this.uppy.log("[Dashboard] resize event didn’t fire on time: defaulted to mobile layout","warning"),this.setPluginState({areInsidesReadyToBeVisible:!0}))},1e3)};stopListeningToResize=()=>{this.resizeObserver.disconnect(),clearTimeout(this.makeDashboardInsidesVisibleAnywayTimeout)};recordIfFocusedOnUppyRecently=e=>{this.el.contains(e.target)?this.ifFocusedOnUppyRecently=!0:(this.ifFocusedOnUppyRecently=!1,this.superFocus.cancel())};disableInteractiveElements=e=>{let t=this.#ty??ru(this.el.querySelectorAll(["a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])",'[role="button"]:not([disabled])'])).filter(e=>!e.classList.contains("uppy-Dashboard-close"));for(let i of t)"A"===i.tagName?i.setAttribute("aria-disabled",e):i.disabled=e;e?this.#ty=t:this.#ty=null,this.dashboardIsDisabled=e};updateBrowserHistory=()=>{history.state?.[this.modalName]||history.pushState({...history.state,[this.modalName]:!0},""),window.addEventListener("popstate",this.handlePopState,!1)};handlePopState=e=>{!this.isModalOpen()||e.state&&e.state[this.modalName]||this.closeModal({manualClose:!1}),!this.isModalOpen()&&e.state?.[this.modalName]&&history.back()};handleKeyDownInModal=e=>{27===e.keyCode&&this.requestCloseModal(),9===e.keyCode&&r0(e,this.getPluginState().activeOverlayType,this.el)};handleClickOutside=()=>{this.opts.closeModalOnClickOutside&&this.requestCloseModal()};handlePaste=e=>{this.uppy.iteratePlugins(t=>{"acquirer"===t.type&&t.handleRootPaste?.(e)});let t=ru(e.clipboardData.files);t.length>0&&(this.uppy.log("[Dashboard] Files pasted"),this.addFiles(t))};handleInputChange=e=>{e.preventDefault();let t=ru(e.currentTarget.files||[]);t.length>0&&(this.uppy.log("[Dashboard] Files selected through input"),this.addFiles(t))};handleDragOver=e=>{e.preventDefault(),e.stopPropagation();let t=(()=>{let t=!0;return this.uppy.iteratePlugins(i=>{i.canHandleRootDrop?.(e)&&(t=!0)}),t})(),i=(()=>{let{types:t}=e.dataTransfer;return t.some(e=>"Files"===e)})();if(!t&&!i||this.opts.disabled||this.opts.disableLocalFiles&&(i||!t)||!this.uppy.getState().allowNewUpload){e.dataTransfer.dropEffect="none";return}e.dataTransfer.dropEffect="copy",this.setPluginState({isDraggingOver:!0}),this.opts.onDragOver(e)};handleDragLeave=e=>{e.preventDefault(),e.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.opts.onDragLeave(e)};handleDrop=async e=>{e.preventDefault(),e.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins(t=>{"acquirer"===t.type&&t.handleRootDrop?.(e)});let t=!1;this.uppy.log("[Dashboard] Processing dropped files");let i=await rd(e.dataTransfer,{logDropError:e=>{this.uppy.log(e,"error"),t||(this.uppy.info(e.message,"error"),t=!0)}});i.length>0&&(this.uppy.log("[Dashboard] Files dropped"),this.addFiles(i)),this.opts.onDrop(e)};handleRequestThumbnail=e=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:request",e)};handleCancelThumbnail=e=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:cancel",e)};handleKeyDownInInline=e=>{if(9===e.keyCode){var t,i;t=this.getPluginState().activeOverlayType,i=this.el,null===t||r0(e,t,i)}};handlePasteOnBody=e=>{this.el.contains(document.activeElement)&&this.handlePaste(e)};handleComplete=({failed:e})=>{this.opts.closeAfterFinish&&!e?.length&&this.requestCloseModal()};handleCancelRestore=()=>{this.uppy.emit("restore-canceled")};#tb=()=>{if(this.opts.disableThumbnailGenerator)return;let e=this.uppy.getFiles();if(1===e.length){let t=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);t?.setOptions({thumbnailWidth:600});let i={...e[0],preview:void 0};t?.requestThumbnail(i).then(()=>{t?.setOptions({thumbnailWidth:this.opts.thumbnailWidth})})}};#tw=e=>{let t=e[0],{metaFields:i}=this.getPluginState(),r=i&&i.length>0,s=this.canEditFile(t);r&&"metaEditor"===this.opts.autoOpen?this.toggleFileCard(!0,t.id):s&&"imageEditor"===this.opts.autoOpen&&this.openFileEditor(t)};initEvents=()=>{if(this.opts.trigger&&!this.opts.inline){let e=rl(this.opts.trigger);e?e.forEach(e=>e.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",this.#t_),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",this.#tb),this.uppy.on("file-removed",this.#tb),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",this.#tw)};removeEvents=()=>{let e=rl(this.opts.trigger);!this.opts.inline&&e&&e.forEach(e=>e.removeEventListener("click",this.openModal)),this.stopListeningToResize(),document.removeEventListener("paste",this.handlePasteOnBody),window.removeEventListener("popstate",this.handlePopState,!1),this.uppy.off("plugin-added",this.#t_),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",this.#tb),this.uppy.off("file-removed",this.#tb),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",this.#tw)};superFocusOnEachUpdate=()=>{let e=this.el.contains(document.activeElement),t=document.activeElement===document.body||null===document.activeElement,i=0===this.uppy.getState().info.length,r=!this.opts.inline;i&&(r||e||t&&this.ifFocusedOnUppyRecently)?this.superFocus(this.el,this.getPluginState().activeOverlayType):this.superFocus.cancel()};afterUpdate=()=>{if(this.opts.disabled&&!this.dashboardIsDisabled){this.disableInteractiveElements(!0);return}!this.opts.disabled&&this.dashboardIsDisabled&&this.disableInteractiveElements(!1),this.superFocusOnEachUpdate()};saveFileCard=(e,t)=>{this.uppy.setFileMeta(t,e),this.toggleFileCard(!1,t)};#tS=e=>{let t=this.uppy.getPlugin(e.id);return{...e,icon:t.icon||this.opts.defaultPickerIcon,render:t.render}};#tC=e=>{let t=this.uppy.getPlugin(e.id);return"function"!=typeof t.isSupported||t.isSupported()};#tP=e=>e.filter(e=>"acquirer"===e.type&&this.#tC(e)).map(this.#tS);#tF=e=>e.filter(e=>"progressindicator"===e.type).map(this.#tS);#tv=e=>e.filter(e=>"editor"===e.type).map(this.#tS);render=e=>{let t;let i=this.getPluginState(),{files:r,capabilities:s,allowNewUpload:n}=e,{newFiles:a,uploadStartedFiles:o,completeFiles:l,erroredFiles:u,inProgressFiles:h,inProgressNotPausedFiles:p,processingFiles:d,isUploadStarted:c,isAllComplete:f,isAllPaused:g}=this.uppy.getObjectOfFilesPerState(),m=this.#tP(i.targets),y=this.#tF(i.targets),v=this.#tv(i.targets);return t="auto"===this.opts.theme?s.darkMode?"dark":"light":this.opts.theme,0>["files","folders","both"].indexOf(this.opts.fileManagerSelectionType)&&(this.opts.fileManagerSelectionType="files",console.warn(`Unsupported option for "fileManagerSelectionType". Using default of "${this.opts.fileManagerSelectionType}".`)),function(e){let t=0===e.totalFileCount,i=1===e.totalFileCount,r=e.containerWidth>576,s=e.containerHeight>330,n=eK({"uppy-Dashboard":!0,"uppy-Dashboard--isDisabled":e.disabled,"uppy-Dashboard--animateOpenClose":e.animateOpenClose,"uppy-Dashboard--isClosing":e.isClosing,"uppy-Dashboard--isDraggingOver":e.isDraggingOver,"uppy-Dashboard--modal":!e.inline,"uppy-size--md":e.containerWidth>576,"uppy-size--lg":e.containerWidth>700,"uppy-size--xl":e.containerWidth>900,"uppy-size--height-md":e.containerHeight>330,"uppy-Dashboard--isAddFilesPanelVisible":e.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":e.areInsidesReadyToBeVisible,"uppy-Dashboard--singleFile":e.singleFileFullScreen&&i&&s}),a=1;e.containerWidth>900?a=5:e.containerWidth>700?a=4:e.containerWidth>576&&(a=3);let o=e.showSelectedFiles&&!t,l=e.recoveredState?Object.keys(e.recoveredState.files).length:null,u=e.files?Object.keys(e.files).filter(t=>e.files[t].isGhost).length:0;return eM("div",{className:n,"data-uppy-theme":e.theme,"data-uppy-num-acquirers":e.acquirers.length,"data-uppy-drag-drop-supported":!e.disableLocalFiles&&rf(),"aria-hidden":e.inline?"false":e.isHidden,"aria-disabled":e.disabled,"aria-label":e.inline?e.i18n("dashboardTitle"):e.i18n("dashboardWindowTitle"),onPaste:e.handlePaste,onDragOver:e.handleDragOver,onDragLeave:e.handleDragLeave,onDrop:e.handleDrop,children:[eM("div",{"aria-hidden":"true",className:"uppy-Dashboard-overlay",tabIndex:-1,onClick:e.handleClickOutside}),eM("div",{className:"uppy-Dashboard-inner",role:e.inline?void 0:"dialog",style:{width:e.inline&&e.width?e.width:"",height:e.inline&&e.height?e.height:""},children:[e.inline?null:eM("button",{className:"uppy-u-reset uppy-Dashboard-close",type:"button","aria-label":e.i18n("closeModal"),title:e.i18n("closeModal"),onClick:e.closeModal,children:eM("span",{"aria-hidden":"true",children:"\xd7"})}),eM("div",{className:"uppy-Dashboard-innerWrap",children:[eM("div",{className:"uppy-Dashboard-dropFilesHereHint",children:e.i18n("dropHint")}),o&&eM(rG,{...e}),l&&eM("div",{className:"uppy-Dashboard-serviceMsg",children:[eM("svg",{className:"uppy-Dashboard-serviceMsg-icon","aria-hidden":"true",focusable:"false",width:"21",height:"16",viewBox:"0 0 24 19",children:eM("g",{transform:"translate(0 -1)",fill:"none",fillRule:"evenodd",children:[eM("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"}),eM("path",{fill:"#000",d:"M11 6h2l-.3 8h-1.4z"}),eM("circle",{fill:"#000",cx:"12",cy:"17",r:"1"})]})}),eM("strong",{className:"uppy-Dashboard-serviceMsg-title",children:e.i18n("sessionRestored")}),eM("div",{className:"uppy-Dashboard-serviceMsg-text",children:u>0?e.i18n("recoveredXFiles",{smart_count:u}):e.i18n("recoveredAllFiles")})]}),o?eM(rH,{id:e.id,i18n:e.i18n,uppy:e.uppy,files:e.files,resumableUploads:e.resumableUploads,hideRetryButton:e.hideRetryButton,hidePauseResumeButton:e.hidePauseResumeButton,hideCancelButton:e.hideCancelButton,showLinkToFileUploadResult:e.showLinkToFileUploadResult,showRemoveButtonAfterComplete:e.showRemoveButtonAfterComplete,metaFields:e.metaFields,toggleFileCard:e.toggleFileCard,handleRequestThumbnail:e.handleRequestThumbnail,handleCancelThumbnail:e.handleCancelThumbnail,recoveredState:e.recoveredState,individualCancellation:e.individualCancellation,openFileEditor:e.openFileEditor,canEditFile:e.canEditFile,toggleAddFilesPanel:e.toggleAddFilesPanel,isSingleFile:i,itemsPerRow:a,containerWidth:e.containerWidth,containerHeight:e.containerHeight}):eM(rg,{i18n:e.i18n,i18nArray:e.i18nArray,acquirers:e.acquirers,handleInputChange:e.handleInputChange,maxNumberOfFiles:e.maxNumberOfFiles,allowedFileTypes:e.allowedFileTypes,showNativePhotoCameraButton:e.showNativePhotoCameraButton,showNativeVideoCameraButton:e.showNativeVideoCameraButton,nativeCameraFacingMode:e.nativeCameraFacingMode,showPanel:e.showPanel,activePickerPanel:e.activePickerPanel,disableLocalFiles:e.disableLocalFiles,fileManagerSelectionType:e.fileManagerSelectionType,note:e.note,proudlyDisplayPoweredByUppy:e.proudlyDisplayPoweredByUppy}),eM(rX,{children:e.showAddFilesPanel?eM(rm,{...e,isSizeMD:r},"AddFiles"):null}),eM(rX,{children:e.fileCardFor?eM(rS,{...e},"FileCard"):null}),eM(rX,{children:e.activePickerPanel?eM(rj,{...e},"Picker"):null}),eM(rX,{children:e.showFileEditor?eM(ry,{...e},"Editor"):null}),eM("div",{className:"uppy-Dashboard-progressindicators",children:e.progressindicators.map(t=>e.uppy.getPlugin(t.id).render(e.state))})]})]})]})}({state:e,isHidden:i.isHidden,files:r,newFiles:a,uploadStartedFiles:o,completeFiles:l,erroredFiles:u,inProgressFiles:h,inProgressNotPausedFiles:p,processingFiles:d,isUploadStarted:c,isAllComplete:f,isAllPaused:g,totalFileCount:Object.keys(r).length,totalProgress:e.totalProgress,allowNewUpload:n,acquirers:m,theme:t,disabled:this.opts.disabled,disableLocalFiles:this.opts.disableLocalFiles,direction:this.opts.direction,activePickerPanel:i.activePickerPanel,showFileEditor:i.showFileEditor,saveFileEditor:this.saveFileEditor,closeFileEditor:this.closeFileEditor,disableInteractiveElements:this.disableInteractiveElements,animateOpenClose:this.opts.animateOpenClose,isClosing:i.isClosing,progressindicators:y,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:e.recoveredState,metaFields:i.metaFields,resumableUploads:s.resumableUploads||!1,individualCancellation:s.individualCancellation,isMobileDevice:s.isMobileDevice,fileCardFor:i.fileCardFor,toggleFileCard:this.toggleFileCard,toggleAddFilesPanel:this.toggleAddFilesPanel,showAddFilesPanel:i.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:i.containerWidth,containerHeight:i.containerHeight,areInsidesReadyToBeVisible:i.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:i.isDraggingOver,handleDragOver:this.handleDragOver,handleDragLeave:this.handleDragLeave,handleDrop:this.handleDrop})};#tk=()=>{let{plugins:e}=this.opts;e.forEach(e=>{let t=this.uppy.getPlugin(e);t?t.mount(this,t):this.uppy.log(`[Uppy] Dashboard could not find plugin '${e}', make sure to uppy.use() the plugins you are specifying`,"warning")})};#tT=()=>{this.uppy.iteratePlugins(this.#t_)};#t_=e=>{e&&!e.opts?.target&&["acquirer","editor"].includes(e.type)&&!this.getPluginState().targets.some(t=>e.id===t.id)&&e.mount(this,e)};#tE(){let{hideUploadButton:e,hideRetryButton:t,hidePauseResumeButton:i,hideCancelButton:r,showProgressDetails:s,hideProgressAfterFinish:n,locale:a,doneButtonHandler:o}=this.opts;return{hideUploadButton:e,hideRetryButton:t,hidePauseResumeButton:i,hideCancelButton:r,showProgressDetails:s,hideAfterFinish:n,locale:a,doneButtonHandler:o}}#tA(){let{thumbnailWidth:e,thumbnailHeight:t,thumbnailType:i,waitForThumbnailsBeforeUpload:r}=this.opts;return{thumbnailWidth:e,thumbnailHeight:t,thumbnailType:i,waitForThumbnailsBeforeUpload:r,lazy:!r}}#tx(){return{}}setOptions(e){super.setOptions(e),this.uppy.getPlugin(this.#tI())?.setOptions(this.#tE()),this.uppy.getPlugin(this.#tU())?.setOptions(this.#tA())}#tI(){return`${this.id}:StatusBar`}#tU(){return`${this.id}:ThumbnailGenerator`}#tO(){return`${this.id}:Informer`}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:e,closeAfterFinish:t}=this.opts;if(e&&t)throw 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:i,allowMultipleUploadBatches:r}=this.uppy.opts;(i||r)&&t&&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:s}=this.opts;s&&this.mount(s,this),this.opts.disableStatusBar||this.uppy.use(t3,{id:this.#tI(),target:this,...this.#tE()}),this.opts.disableInformer||this.uppy.use(e$,{id:this.#tO(),target:this,...this.#tx()}),this.opts.disableThumbnailGenerator||this.uppy.use(ro,{id:this.#tU(),...this.#tA()}),this.darkModeMediaQuery="undefined"!=typeof window&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;let n=!!this.darkModeMediaQuery&&this.darkModeMediaQuery.matches;this.uppy.log(`[Dashboard] Dark mode is ${n?"on":"off"}`),this.setDarkModeCapability(n),"auto"===this.opts.theme&&this.darkModeMediaQuery?.addListener(this.handleSystemDarkModeChange),this.#tk(),this.#tT(),this.initEvents()};uninstall=()=>{if(!this.opts.disableInformer){let e=this.uppy.getPlugin(`${this.id}:Informer`);e&&this.uppy.removePlugin(e)}if(!this.opts.disableStatusBar){let e=this.uppy.getPlugin(`${this.id}:StatusBar`);e&&this.uppy.removePlugin(e)}if(!this.opts.disableThumbnailGenerator){let e=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);e&&this.uppy.removePlugin(e)}let{plugins:e}=this.opts;e.forEach(e=>{let t=this.uppy.getPlugin(e);t&&t.unmount()}),"auto"===this.opts.theme&&this.darkModeMediaQuery?.removeListener(this.handleSystemDarkModeChange),this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.unmount(),this.removeEvents()}}var r8=i(2265);let r4=["defaultChecked","defaultValue","suppressContentEditableWarning","suppressHydrationWarning","dangerouslySetInnerHTML","accessKey","className","contentEditable","contextMenu","dir","draggable","hidden","id","lang","placeholder","slot","spellCheck","style","tabIndex","title","translate","radioGroup","role","about","datatype","inlist","prefix","property","resource","typeof","vocab","autoCapitalize","autoCorrect","autoSave","color","itemProp","itemScope","itemType","itemID","itemRef","results","security","unselectable","inputMode","is","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],r6=/^(aria-|data-)/;var r7=e=>Object.fromEntries(Object.entries(e).filter(([e])=>r6.test(e)||r4.includes(e)));class r9 extends r8.Component{container;plugin;componentDidMount(){this.installPlugin()}componentDidUpdate(e){if(e.uppy!==this.props.uppy)this.uninstallPlugin(e),this.installPlugin();else if(function(e,t){let i=r7(e);return Object.keys(e).some(r=>!Object.hasOwn(i,r)&&e[r]!==t[r])}(this.props,e)){let{uppy:e,...t}={...this.props,target:this.container};this.plugin.setOptions(t)}}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){let{uppy:e,...t}={id:"Dashboard",...this.props,inline:!0,target:this.container};e.use(r3,t),this.plugin=e.getPlugin(t.id)}uninstallPlugin(e=this.props){let{uppy:t}=e;t.removePlugin(this.plugin)}render(){return(0,r8.createElement)("div",{className:"uppy-Container",ref:e=>{this.container=e},...r7(this.props)})}}var se=r9,st={strings:{dropHereOr:"Drop here or %{browse}",browse:"browse"}};let si={inputName:"files[]",width:"100%",height:"100%"};class sr extends eR{static VERSION="4.2.1";isDragDropSupported=rf();fileInputRef;constructor(e,t){super(e,{...si,...t}),this.type="acquirer",this.id=this.opts.id||"DragDrop",this.title="Drag & Drop",this.defaultLocale=st,this.i18nInit()}addFiles=e=>{let t=e.map(e=>({source:this.id,name:e.name,type:e.type,data:e,meta:{relativePath:e.relativePath||null}}));try{this.uppy.addFiles(t)}catch(e){this.uppy.log(e)}};onInputChange=e=>{let t=ru(e.currentTarget.files||[]);t.length>0&&(this.uppy.log("[DragDrop] Files selected through input"),this.addFiles(t)),e.currentTarget.value=""};handleDragOver=e=>{e.preventDefault(),e.stopPropagation();let{types:t}=e.dataTransfer,i=t.some(e=>"Files"===e),{allowNewUpload:r}=this.uppy.getState();if(!i||!r){e.dataTransfer.dropEffect="none";return}e.dataTransfer.dropEffect="copy",this.setPluginState({isDraggingOver:!0}),this.opts.onDragOver?.(e)};handleDragLeave=e=>{e.preventDefault(),e.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.opts.onDragLeave?.(e)};handleDrop=async e=>{e.preventDefault(),e.stopPropagation(),this.setPluginState({isDraggingOver:!1});let t=await rd(e.dataTransfer,{logDropError:e=>{this.uppy.log(e,"error")}});t.length>0&&(this.uppy.log("[DragDrop] Files dropped"),this.addFiles(t)),this.opts.onDrop?.(e)};renderHiddenFileInput(){let{restrictions:e}=this.uppy.opts;return eM("input",{className:"uppy-DragDrop-input",type:"file",hidden:!0,ref:e=>{this.fileInputRef=e},name:this.opts.inputName,multiple:1!==e.maxNumberOfFiles,accept:e.allowedFileTypes?.join(", "),onChange:this.onInputChange})}static renderArrowSvg(){return eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-DragDrop-arrow",width:"16",height:"16",viewBox:"0 0 16 16",children:eM("path",{d:"M11 10V0H5v10H2l6 6 6-6h-3zm0 0",fillRule:"evenodd"})})}renderLabel(){return eM("div",{className:"uppy-DragDrop-label",children:this.i18nArray("dropHereOr",{browse:eM("span",{className:"uppy-DragDrop-browse",children:this.i18n("browse")})})})}renderNote(){return eM("span",{className:"uppy-DragDrop-note",children:this.opts.note})}render(){return eM("button",{type:"button",className:`uppy-u-reset
|
|
9
|
+
${t}`)},type:"button",children:"?"})]}),eM(tV,{i18n:i,complete:r,numUploads:s})]})]})}function tZ(e){let t;let i=[],r="indeterminate";for(let{progress:s}of Object.values(e)){let{preprocess:e,postprocess:n}=s;null==t&&(e||n)&&({mode:r,message:t}=e||n),e?.mode==="determinate"&&i.push(e.value),n?.mode==="determinate"&&i.push(n.value)}return{mode:r,message:t,value:i.reduce((e,t)=>e+t/i.length,0)}}let{STATE_ERROR:tY,STATE_WAITING:tQ,STATE_PREPROCESSING:tJ,STATE_UPLOADING:t0,STATE_POSTPROCESSING:t1,STATE_COMPLETE:t2}=tU,t5={hideUploadButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideCancelButton:!1,showProgressDetails:!1,hideAfterFinish:!0,doneButtonHandler:null};class t3 extends eN{static VERSION="4.2.1";#td;#tp;#tc;#tf;constructor(e,t){super(e,{...t5,...t}),this.id=this.opts.id||"StatusBar",this.title="StatusBar",this.type="progressindicator",this.defaultLocale=tO,this.i18nInit(),this.render=this.render.bind(this),this.install=this.install.bind(this)}#tg(e){if(null==e.total||0===e.total)return null;let t=e.total-e.uploaded;if(t<=0)return null;this.#td??=performance.now();let i=performance.now()-this.#td;if(0===i)return Math.round((this.#tf??0)/100)/10;let r=e.uploaded-this.#tp;if(this.#tp=e.uploaded,r<=0)return Math.round((this.#tf??0)/100)/10;let s=r/i,n=null==this.#tc?s:tI(s,this.#tc,2e3,i);this.#tc=n;let a=t/n,o=Math.max(this.#tf-i,0),l=null==this.#tf?a:tI(a,o,2e3,i);return this.#tf=l,this.#td=performance.now(),Math.round(l/100)/10}startUpload=()=>this.uppy.upload().catch(()=>{});render(e){let{capabilities:t,files:i,allowNewUpload:r,totalProgress:s,error:n,recoveredState:a}=e,{newFiles:o,startedFiles:l,completeFiles:u,isUploadStarted:h,isAllComplete:d,isAllPaused:p,isUploadInProgress:c,isSomeGhost:f}=this.uppy.getObjectOfFilesPerState(),g=a?Object.values(i):o,m=!!t.resumableUploads,y=!1!==t.uploadProgress,v=null,b=0;l.every(e=>null!=e.progress.bytesTotal&&0!==e.progress.bytesTotal)?(v=0,l.forEach(e=>{v+=e.progress.bytesTotal||0,b+=e.progress.bytesUploaded||0})):l.forEach(e=>{b+=e.progress.bytesUploaded||0});let w=this.#tg({uploaded:b,total:v});return function({newFiles:e,allowNewUpload:t,isUploadInProgress:i,isAllPaused:r,resumableUploads:s,error:n,hideUploadButton:a,hidePauseResumeButton:o=!1,hideCancelButton:l=!1,hideRetryButton:u=!1,recoveredState:h,uploadState:d,totalProgress:p,files:c,supportsUploadProgress:f,hideAfterFinish:g=!1,isSomeGhost:m,doneButtonHandler:y,isUploadStarted:v,i18n:b,startUpload:w,uppy:_,isAllComplete:S,showProgressDetails:C,numUploads:P,complete:F,totalSize:k,totalETA:T,totalUploadedSize:E}){let A=function(){switch(d){case t1:case tJ:{let e=tZ(c);if("determinate"===e.mode)return 100*e.value;return p}case tY:return null;case t0:if(!f)return null;return p;default:return p}}(),x=A??100,I=!n&&e&&(!i&&!r||h)&&t&&!a,O=!l&&d!==tQ&&d!==t2,U=s&&!o&&d===t0,D=n&&!S&&!u,N=y&&d===t2,R=eK("uppy-StatusBar-progress",{"is-indeterminate":function(){switch(d){case t1:case tJ:{let{mode:e}=tZ(c);return"indeterminate"===e}case t0:if(!f)return!0;return!1;default:return!1}}()}),M=eK("uppy-StatusBar",`is-${d}`,{"has-ghosts":m}),B=(()=>{switch(d){case tJ:case t1:return eM(tj,{progress:tZ(c)});case t2:return eM(tK,{i18n:b});case tY:return eM(tX,{error:n,i18n:b,numUploads:P,complete:F});case t0:return eM(tG,{i18n:b,supportsUploadProgress:f,totalProgress:p,showProgressDetails:C,isUploadStarted:v,isAllComplete:S,isAllPaused:r,newFiles:e,numUploads:P,complete:F,totalUploadedSize:E,totalSize:k,totalETA:T,startUpload:w});default:return null}})();return(I||D||U||O||N||B)&&(d!==t2||!g)?eM("div",{className:M,children:[eM("div",{className:R,style:{width:`${x}%`},role:"progressbar","aria-label":`${x}%`,"aria-valuetext":`${x}%`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":A}),B,eM("div",{className:"uppy-StatusBar-actions",children:[I?eM(tM,{newFiles:e,isUploadStarted:v,recoveredState:h,i18n:b,isSomeGhost:m,startUpload:w,uploadState:d}):null,D?eM(tB,{i18n:b,uppy:_}):null,U?eM(tz,{isAllPaused:r,i18n:b,isAllComplete:S,resumableUploads:s,uppy:_}):null,O?eM(tL,{i18n:b,uppy:_}):null,N?eM(t$,{i18n:b,doneButtonHandler:y}):null]})]}):null}({error:n,uploadState:function(e,t,i,r){if(e)return tU.STATE_ERROR;if(t)return tU.STATE_COMPLETE;if(i)return tU.STATE_WAITING;let s=tU.STATE_WAITING,n=Object.keys(r);for(let e=0;e<n.length;e++){let{progress:t}=r[n[e]];if(t.uploadStarted&&!t.uploadComplete)return tU.STATE_UPLOADING;t.preprocess&&(s=tU.STATE_PREPROCESSING),t.postprocess&&s!==tU.STATE_PREPROCESSING&&(s=tU.STATE_POSTPROCESSING)}return s}(n,d,a,e.files||{}),allowNewUpload:r,totalProgress:s,totalSize:v,totalUploadedSize:b,isAllComplete:!1,isAllPaused:p,isUploadStarted:h,isUploadInProgress:c,isSomeGhost:f,recoveredState:a,complete:u.length,newFiles:g.length,numUploads:l.length,totalETA:w,files:i,i18n:this.i18n,uppy:this.uppy,startUpload:this.startUpload,doneButtonHandler:this.opts.doneButtonHandler,resumableUploads:m,supportsUploadProgress:y,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;g(e)||(e.dir="ltr")}#tm=()=>{let{recoveredState:e}=this.uppy.getState();if(this.#tc=null,this.#tf=null,e){this.#tp=Object.values(e.files).reduce((e,{progress:t})=>e+t.bytesUploaded,0),this.uppy.emit("restore-confirmed");return}this.#td=performance.now(),this.#tp=0};install(){let{target:e}=this.opts;e&&this.mount(e,this),this.uppy.on("upload",this.#tm),this.#td=performance.now(),this.#tp=this.uppy.getFiles().reduce((e,t)=>e+t.progress.bytesUploaded,0)}uninstall(){this.unmount(),this.uppy.off("upload",this.#tm)}}let t8=/^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/;var t4=function(e,t,i){let r;let s=t8.exec(e),n=t.mimeType??s?.[1]??"plain/text";if(s?.[2]!=null){let e=atob(decodeURIComponent(s[3])),t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);r=[t]}else s?.[3]!=null&&(r=[decodeURIComponent(s[3])]);return i?new File(r,t.name||"",{type:n}):new Blob(r,{type:n})};function t6(e){return e.startsWith("blob:")}function t7(e){return!!e&&/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(e)}var t9=i(40257),ie=i(82957).lW;function it(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var ii="undefined"!=typeof self?self:global;let ir="undefined"!=typeof navigator,is=ir&&"undefined"==typeof HTMLImageElement,ia=!("undefined"==typeof global||void 0===t9||!t9.versions||!t9.versions.node),io=ii.Buffer,il=!!io,iu=e=>void 0!==e;function ih(e){return void 0===e||(e instanceof Map?0===e.size:0===Object.values(e).filter(iu).length)}function id(e){let t=Error(e);throw delete t.stack,t}function ip(e){let t;let i=(t=0,e.ifd0.enabled&&(t+=1024),e.exif.enabled&&(t+=2048),e.makerNote&&(t+=2048),e.userComment&&(t+=1024),e.gps.enabled&&(t+=512),e.interop.enabled&&(t+=100),e.ifd1.enabled&&(t+=1024),t+2048);return e.jfif.enabled&&(i+=50),e.xmp.enabled&&(i+=2e4),e.iptc.enabled&&(i+=14e3),e.icc.enabled&&(i+=6e3),i}let ic=e=>String.fromCharCode.apply(null,e),ig="undefined"!=typeof TextDecoder?new TextDecoder("utf-8"):void 0;class im{static from(e,t){return e instanceof this&&e.le===t?e:new im(e,void 0,void 0,t)}constructor(e,t=0,i,r){if("boolean"==typeof r&&(this.le=r),Array.isArray(e)&&(e=new Uint8Array(e)),0===e)this.byteOffset=0,this.byteLength=0;else if(e instanceof ArrayBuffer){void 0===i&&(i=e.byteLength-t);let r=new DataView(e,t,i);this._swapDataView(r)}else if(e instanceof Uint8Array||e instanceof DataView||e instanceof im){void 0===i&&(i=e.byteLength-t),(t+=e.byteOffset)+i>e.byteOffset+e.byteLength&&id("Creating view outside of available memory in ArrayBuffer");let r=new DataView(e.buffer,t,i);this._swapDataView(r)}else if("number"==typeof e){let t=new DataView(new ArrayBuffer(e));this._swapDataView(t)}else id("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=im){return e instanceof DataView||e instanceof im?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Uint8Array||id("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 im(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){let i=this.getUint8Array(e,t);return ig?ig.decode(i):il?ie.from(i).toString("utf8"):decodeURIComponent(escape(ic(i)))}getLatin1String(e=0,t=this.byteLength){return ic(this.getUint8Array(e,t))}getUnicodeString(e=0,t=this.byteLength){let i=[];for(let r=0;r<t&&e+r<this.byteLength;r+=2)i.push(this.getUint16(e+r));return ic(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 iy(e,t){id(`${e} '${t}' was not loaded, try using full build of exifr.`)}class iv extends Map{constructor(e){super(),this.kind=e}get(e,t){var i;return this.has(e)||iy(this.kind,e),t&&(e in t||(i=this.kind,id(`Unknown ${i} '${e}'.`)),t[e].enabled||iy(this.kind,e)),super.get(e)}keyList(){return Array.from(this.keys())}}var ib=new iv("file parser"),iw=new iv("segment parser"),i_=new iv("file reader");let iS=ii.fetch;function iC(e,t){return e.startsWith("data:")||e.length>1e4?iF(e,t,"base64"):ia&&e.includes("://")?iP(e,t,"url",ik):ia?iF(e,t,"fs"):ir?iP(e,t,"url",ik):void id("Invalid input argument")}async function iP(e,t,i,r){return i_.has(i)?iF(e,t,i):r?async function(e,t){return new im(await t(e))}(e,r):void id(`Parser ${i} is not loaded`)}async function iF(e,t,i){let r=new(i_.get(i))(e,t);return await r.read(),r}let ik=e=>iS(e).then(e=>e.arrayBuffer()),iT=e=>new Promise((t,i)=>{let r=new FileReader;r.onloadend=()=>t(r.result||new ArrayBuffer),r.onerror=i,r.readAsArrayBuffer(e)});class iE 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 iA(e,t,i){let r=new iE;for(let[e,t]of i)r.set(e,t);if(Array.isArray(t))for(let i of t)e.set(i,r);else e.set(t,r);return r}function ix(e,t,i){let r,s=e.get(t);for(r of i)s.set(r[0],r[1])}let iI=new Map,iO=new Map,iU=new Map,iD=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],iN=["jfif","xmp","icc","iptc","ihdr"],iR=["tiff",...iN],iM=["ifd0","ifd1","exif","gps","interop"],iB=[...iR,...iM],iL=["makerNote","userComment"],iz=["translateKeys","translateValues","reviveValues","multiSegment"],i$=[...iz,"sanitize","mergeOutput","silentErrors"];class iq{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}}class ij extends iq{get needed(){return this.enabled||this.deps.size>0}constructor(e,t,i,r){if(super(),it(this,"enabled",!1),it(this,"skip",new Set),it(this,"pick",new Set),it(this,"deps",new Set),it(this,"translateKeys",!1),it(this,"translateValues",!1),it(this,"reviveValues",!1),this.key=e,this.enabled=t,this.parse=this.enabled,this.applyInheritables(r),this.canBeFiltered=iM.includes(e),this.canBeFiltered&&(this.dict=iI.get(e)),void 0!==i){if(Array.isArray(i))this.parse=this.enabled=!0,this.canBeFiltered&&i.length>0&&this.translateTagSet(i,this.pick);else if("object"==typeof i){if(this.enabled=!0,this.parse=!1!==i.parse,this.canBeFiltered){let{pick:e,skip:t}=i;e&&e.length>0&&this.translateTagSet(e,this.pick),t&&t.length>0&&this.translateTagSet(t,this.skip)}this.applyInheritables(i)}else!0===i||!1===i?this.parse=this.enabled=i:id(`Invalid options argument: ${i}`)}}applyInheritables(e){let t,i;for(t of iz)void 0!==(i=e[t])&&(this[t]=i)}translateTagSet(e,t){if(this.dict){let i,r,{tagKeys:s,tagValues:n}=this.dict;for(i of e)"string"==typeof i?(-1===(r=n.indexOf(i))&&(r=s.indexOf(Number(i))),-1!==r&&t.add(Number(s[r]))):t.add(i)}else for(let i of e)t.add(i)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,iX(this.pick,this.deps)):this.enabled&&this.pick.size>0&&iX(this.pick,this.deps)}}var iH={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},iV=new Map;class iW extends iq{static useCached(e){let t=iV.get(e);return void 0!==t||(t=new this(e),iV.set(e,t)),t}constructor(e){super(),!0===e?this.setupFromTrue():void 0===e?this.setupFromUndefined():Array.isArray(e)?this.setupFromArray(e):"object"==typeof e?this.setupFromObject(e):id(`Invalid options argument ${e}`),void 0===this.firstChunkSize&&(this.firstChunkSize=ir?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let e;for(e of iD)this[e]=iH[e];for(e of i$)this[e]=iH[e];for(e of iL)this[e]=iH[e];for(e of iB)this[e]=new ij(e,iH[e],void 0,this)}setupFromTrue(){let e;for(e of iD)this[e]=iH[e];for(e of i$)this[e]=iH[e];for(e of iL)this[e]=!0;for(e of iB)this[e]=new ij(e,!0,void 0,this)}setupFromArray(e){let t;for(t of iD)this[t]=iH[t];for(t of i$)this[t]=iH[t];for(t of iL)this[t]=iH[t];for(t of iB)this[t]=new ij(t,!1,void 0,this);this.setupGlobalFilters(e,void 0,iM)}setupFromObject(e){let t;for(t of(iM.ifd0=iM.ifd0||iM.image,iM.ifd1=iM.ifd1||iM.thumbnail,Object.assign(this,e),iD))this[t]=iK(e[t],iH[t]);for(t of i$)this[t]=iK(e[t],iH[t]);for(t of iL)this[t]=iK(e[t],iH[t]);for(t of iR)this[t]=new ij(t,iH[t],e[t],this);for(t of iM)this[t]=new ij(t,iH[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,iM,iB),!0===e.tiff?this.batchEnableWithBool(iM,!0):!1===e.tiff?this.batchEnableWithUserValue(iM,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,iM):"object"==typeof e.tiff&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,iM)}batchEnableWithBool(e,t){for(let i of e)this[i].enabled=t}batchEnableWithUserValue(e,t){for(let i of e){let e=t[i];this[i].enabled=!1!==e&&void 0!==e}}setupGlobalFilters(e,t,i,r=i){if(e&&e.length){for(let e of r)this[e].enabled=!1;for(let[t,r]of iG(e,i))iX(this[t].pick,r),this[t].enabled=!0}else if(t&&t.length)for(let[e,r]of iG(t,i))iX(this[e].skip,r)}filterNestedSegmentTags(){let{ifd0:e,exif:t,xmp:i,iptc:r,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),r.enabled||e.skip.add(33723),s.enabled||e.skip.add(34675)}traverseTiffDependencyTree(){let{ifd0:e,exif:t,gps:i,interop:r}=this;for(let s of(r.needed&&(t.deps.add(40965),e.deps.add(40965)),t.needed&&e.deps.add(34665),i.needed&&e.deps.add(34853),this.tiff.enabled=iM.some(e=>!0===this[e].enabled)||this.makerNote||this.userComment,iM))this[s].finalizeFilters()}get onlyTiff(){return!iN.map(e=>this[e].enabled).some(e=>!0===e)&&this.tiff.enabled}checkLoadedPlugins(){for(let e of iR)this[e].enabled&&!iw.has(e)&&iy("segment parser",e)}}function iG(e,t){let i,r,s,n,a=[];for(s of t){for(n of(i=iI.get(s),r=[],i))(e.includes(n[0])||e.includes(n[1]))&&r.push(n[0]);r.length&&a.push([s,r])}return a}function iK(e,t){return void 0!==e?e:void 0!==t?t:void 0}function iX(e,t){for(let i of t)e.add(i)}it(iW,"default",iH);class iZ{constructor(e){it(this,"parsers",{}),it(this,"output",{}),it(this,"errors",[]),it(this,"pushToErrors",e=>this.errors.push(e)),this.options=iW.useCached(e)}async read(e){var t;this.file=await (t=this.options,"string"==typeof e?iC(e,t):ir&&!is&&e instanceof HTMLImageElement?iC(e.src,t):e instanceof Uint8Array||e instanceof ArrayBuffer||e instanceof DataView?new im(e):ir&&e instanceof Blob?iP(e,t,"blob",iT):void id("Invalid input argument"))}setup(){if(this.fileParser)return;let{file:e}=this,t=e.getUint16(0);for(let[i,r]of ib)if(r.canHandle(e,t))return this.fileParser=new r(this.options,this.file,this.parsers),e[i]=!0;this.file.close&&this.file.close(),id("Unknown file format")}async parse(){let{output:e,errors:t}=this;return this.setup(),this.options.silentErrors?(await this.executeParsers().catch(this.pushToErrors),t.push(...this.fileParser.errors)):await this.executeParsers(),this.file.close&&this.file.close(),this.options.silentErrors&&t.length>0&&(e.errors=t),ih(e)?void 0:e}async executeParsers(){let{output:e}=this;await this.fileParser.parse();let t=Object.values(this.parsers).map(async t=>{let i=await t.parse();t.assignToOutput(e,i)});this.options.silentErrors&&(t=t.map(e=>e.catch(this.pushToErrors))),await Promise.all(t)}async extractThumbnail(){var e;this.setup();let{options:t,file:i}=this,r=iw.get("tiff",t);if(i.tiff?e={start:0,type:"tiff"}:i.jpeg&&(e=await this.fileParser.getOrFindSegment("tiff")),void 0===e)return;let s=await this.fileParser.ensureSegmentChunk(e),n=this.parsers.tiff=new r(s,t,i),a=await n.extractThumbnail();return i.close&&i.close(),a}}async function iY(e,t){let i=new iZ(t);return await i.read(e),i.parse()}var iQ=Object.freeze({__proto__:null,parse:iY,Exifr:iZ,fileParsers:ib,segmentParsers:iw,fileReaders:i_,tagKeys:iI,tagValues:iO,tagRevivers:iU,createDictionary:iA,extendDictionary:ix,fetchUrlAsArrayBuffer:ik,readBlobAsArrayBuffer:iT,chunkedProps:iD,otherSegments:iN,segments:iR,tiffBlocks:iM,segmentsAndBlocks:iB,tiffExtractables:iL,inheritables:iz,allFormatters:i$,Options:iW});class iJ{static findPosition(e,t){let i=e.getUint16(t+2)+2,r="function"==typeof this.headerLength?this.headerLength(e,t,i):this.headerLength,s=t+r,n=i-r;return{offset:t,length:i,headerLength:r,start:s,size:n,end:s+n}}static parse(e,t={}){return new this(e,new iW({[this.type]:t}),e).parse()}normalizeInput(e){return e instanceof im?e:new im(e)}constructor(e,t={},i){it(this,"errors",[]),it(this,"raw",new Map),it(this,"handleError",e=>{if(!this.options.silentErrors)throw e;this.errors.push(e.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=iU.get(t),r=iO.get(t),s=iI.get(t),n=this.options[t],a=n.reviveValues&&!!i,o=n.translateValues&&!!r,l=n.translateKeys&&!!s,u={};for(let[t,n]of e)a&&i.has(t)?n=i.get(t)(n):o&&r.has(t)&&(n=this.translateValue(n,r.get(t))),l&&s.has(t)&&(t=s.get(t)||t),u[t]=n;return u}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}}it(iJ,"headerLength",4),it(iJ,"type",void 0),it(iJ,"multiSegment",!1),it(iJ,"canHandle",()=>!1);class i0 extends class{constructor(e,t,i){it(this,"errors",[]),it(this,"ensureSegmentChunk",async e=>{let t=e.start,i=e.size||65536;if(this.file.chunked){if(this.file.available(t,i))e.chunk=this.file.subarray(t,i);else try{e.chunk=await this.file.readChunk(t,i)}catch(t){id(`Couldn't read segment: ${JSON.stringify(e)}. ${t.message}`)}}else this.file.byteLength>t+i?e.chunk=this.file.subarray(t,i):void 0===e.size?e.chunk=this.file.subarray(t):id("Segment unreachable: "+JSON.stringify(e));return e.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(iw.get(e))(t,this.options,this.file);return this.parsers[e]=i}createParsers(e){for(let t of e){let{type:e,chunk:i}=t,r=this.options[e];if(r&&r.enabled){let t=this.parsers[e];t&&t.append||t||this.createParser(e,i)}}}async readSegments(e){let t=e.map(this.ensureSegmentChunk);await Promise.all(t)}}{constructor(...e){super(...e),it(this,"appSegments",[]),it(this,"jpegSegments",[]),it(this,"unknownSegments",[])}static canHandle(e,t){return 65496===t}async parse(){await this.findAppSegments(),await this.readSegments(this.appSegments),this.mergeMultiSegments(),this.createParsers(this.mergedAppSegments||this.appSegments)}setupSegmentFinderArgs(e){!0===e?(this.findAll=!0,this.wanted=new Set(iw.keyList())):(e=void 0===e?iw.keyList().filter(e=>this.options[e].enabled):e.filter(e=>this.options[e].enabled&&iw.has(e)),this.findAll=!1,this.remaining=new Set(e),this.wanted=new Set(e)),this.unfinishedMultiSegment=!1}async findAppSegments(e=0,t){this.setupSegmentFinderArgs(t);let{file:i,findAll:r,wanted:s,remaining:n}=this;if(!r&&this.file.chunked&&(r=Array.from(s).some(e=>{let t=iw.get(e),i=this.options[e];return t.multiSegment&&i.multiSegment}))&&await this.file.readWhole(),e=this.findAppSegmentsInRange(e,i.byteLength),!this.options.onlyTiff&&i.chunked){let t=!1;for(;n.size>0&&!t&&(i.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:r}=i,s=this.appSegments.some(e=>!this.file.available(e.offset||e.start,e.length||e.size));if(t=e>r&&!s?!await i.readNextChunk(e):!await i.readNextChunk(r),void 0===(e=this.findAppSegmentsInRange(e,i.byteLength)))return}}}findAppSegmentsInRange(e,t){t-=2;let i,r,s,n,a,o,{file:l,findAll:u,wanted:h,remaining:d,options:p}=this;for(;e<t;e++)if(255===l.getUint8(e)){var c;if((c=i=l.getUint8(e+1))>=224&&c<=239){if(r=l.getUint16(e+2),(s=function(e,t,i){for(let[r,s]of iw)if(s.canHandle(e,t,i))return r}(l,e,r))&&h.has(s)&&(a=(n=iw.get(s)).findPosition(l,e),o=p[s],a.type=s,this.appSegments.push(a),!u&&(n.multiSegment&&o.multiSegment?(this.unfinishedMultiSegment=a.chunkNumber<a.chunkCount,this.unfinishedMultiSegment||d.delete(s)):d.delete(s),0===d.size)))break;p.recordUnknownSegments&&((a=iJ.findPosition(l,e)).marker=i,this.unknownSegments.push(a)),e+=r+1}else if(192===i||194===i||196===i||219===i||221===i||218===i||254===i){if(r=l.getUint16(e+2),218===i&&!1!==p.stopAfterSos)return;p.recordJpegSegments&&this.jpegSegments.push({offset:e,length:r,marker:i}),e+=r+1}}return e}mergeMultiSegments(){if(!this.appSegments.some(e=>e.multiSegment))return;let e=function(e,t){let i,r,s,n=new Map;for(let a=0;a<e.length;a++)r=(i=e[a])[t],n.has(r)?s=n.get(r):n.set(r,s=[]),s.push(i);return Array.from(n)}(this.appSegments,"type");this.mergedAppSegments=e.map(([e,t])=>{let i=iw.get(e,this.options);return i.handleMultiSegments?{type:e,chunk:i.handleMultiSegments(t)}:t[0]})}getSegment(e){return this.appSegments.find(t=>t.type===e)}async getOrFindSegment(e){let t=this.getSegment(e);return void 0===t&&(await this.findAppSegments(0,[e]),t=this.getSegment(e)),t}}it(i0,"type","jpeg"),ib.set("jpeg",i0);let i1=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4];class i2 extends iJ{parseHeader(){var e=this.chunk.getUint16();18761===e?this.le=!0:19789===e&&(this.le=!1),this.chunk.le=this.le,this.headerParsed=!0}parseTags(e,t,i=new Map){let{pick:r,skip:s}=this.options[t],n=(r=new Set(r)).size>0,a=0===s.size,o=this.chunk.getUint16(e);e+=2;for(let l=0;l<o;l++){let o=this.chunk.getUint16(e);if(n){if(r.has(o)&&(i.set(o,this.parseTag(e,o,t)),r.delete(o),0===r.size))break}else!a&&s.has(o)||i.set(o,this.parseTag(e,o,t));e+=12}return i}parseTag(e,t,i){var r;let{chunk:s}=this,n=s.getUint16(e+2),a=s.getUint32(e+4),o=i1[n];if(o*a<=4?e+=8:e=s.getUint32(e+8),(n<1||n>13)&&id(`Invalid TIFF value type. block: ${i.toUpperCase()}, tag: ${t.toString(16)}, type: ${n}, offset ${e}`),e>s.byteLength&&id(`Invalid TIFF value offset. block: ${i.toUpperCase()}, tag: ${t.toString(16)}, type: ${n}, offset ${e} is outside of chunk size ${s.byteLength}`),1===n)return s.getUint8Array(e,a);if(2===n)return""===(r=(function(e){for(;e.endsWith("\0");)e=e.slice(0,-1);return e})(r=s.getString(e,a)).trim())?void 0:r;if(7===n)return s.getUint8Array(e,a);if(1===a)return this.parseTagValue(n,e);{let t=new(function(e){switch(e){case 1:return Uint8Array;case 3:return Uint16Array;case 4:return Uint32Array;case 5:case 10:default:return Array;case 6:return Int8Array;case 8:return Int16Array;case 9:return Int32Array;case 11:return Float32Array;case 12:return Float64Array}}(n))(a);for(let i=0;i<a;i++)t[i]=this.parseTagValue(n,e),e+=o;return t}}parseTagValue(e,t){let{chunk:i}=this;switch(e){case 1:return i.getUint8(t);case 3:return i.getUint16(t);case 4:case 13: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);default:id(`Invalid tiff type ${e}`)}}}class i5 extends i2{static canHandle(e,t){return 225===e.getUint8(t+1)&&1165519206===e.getUint32(t+4)&&0===e.getUint16(t+8)}async parse(){this.parseHeader();let{options:e}=this;return e.ifd0.enabled&&await this.parseIfd0Block(),e.exif.enabled&&await this.safeParse("parseExifBlock"),e.gps.enabled&&await this.safeParse("parseGpsBlock"),e.interop.enabled&&await this.safeParse("parseInteropBlock"),e.ifd1.enabled&&await this.safeParse("parseThumbnailBlock"),this.createOutput()}safeParse(e){let t=this[e]();return void 0!==t.catch&&(t=t.catch(this.handleError)),t}findIfd0Offset(){void 0===this.ifd0Offset&&(this.ifd0Offset=this.chunk.getUint32(4))}findIfd1Offset(){if(void 0===this.ifd1Offset){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}async parseIfd0Block(){if(this.ifd0)return;let{file:e}=this;this.findIfd0Offset(),this.ifd0Offset<8&&id("Malformed EXIF data"),!e.chunked&&this.ifd0Offset>e.byteLength&&id(`IFD0 offset points to outside of file.
|
|
10
|
+
this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&await e.ensureChunk(this.ifd0Offset,ip(this.options));let t=this.parseBlock(this.ifd0Offset,"ifd0");return 0!==t.size?(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}async parseExifBlock(){if(this.exif||(this.ifd0||await this.parseIfd0Block(),void 0===this.exifOffset))return;this.file.tiff&&await this.file.ensureChunk(this.exifOffset,ip(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&&1===i.length&&e.set(t,i[0])}async parseGpsBlock(){if(this.gps||(this.ifd0||await this.parseIfd0Block(),void 0===this.gpsOffset))return;let e=this.parseBlock(this.gpsOffset,"gps");return e&&e.has(2)&&e.has(4)&&(e.set("latitude",i3(...e.get(2),e.get(1))),e.set("longitude",i3(...e.get(4),e.get(3)))),e}async parseInteropBlock(){if(!this.interop&&(this.ifd0||await this.parseIfd0Block(),void 0!==this.interopOffset||this.exif||await this.parseExifBlock(),void 0!==this.interopOffset))return this.parseBlock(this.interopOffset,"interop")}async parseThumbnailBlock(e=!1){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}async extractThumbnail(){if(this.headerParsed||this.parseHeader(),this.ifd1Parsed||await this.parseThumbnailBlock(!0),void 0===this.ifd1)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,r={};for(t of iM)if(!ih(e=this[t])){if(i=this.canTranslate?this.translateBlock(e,t):Object.fromEntries(e),this.options.mergeOutput){if("ifd1"===t)continue;Object.assign(r,i)}else r[t]=i}return this.makerNote&&(r.makerNote=this.makerNote),this.userComment&&(r.userComment=this.userComment),r}assignToOutput(e,t){if(this.globalOptions.mergeOutput)Object.assign(e,t);else for(let[i,r]of Object.entries(t))this.assignObjectToOutput(e,i,r)}}function i3(e,t,i,r){var s=e+t/60+i/3600;return"S"!==r&&"W"!==r||(s*=-1),s}it(i5,"type","tiff"),it(i5,"headerLength",10),iw.set("tiff",i5),Object.freeze({__proto__:null,default:iQ,Exifr:iZ,fileParsers:ib,segmentParsers:iw,fileReaders:i_,tagKeys:iI,tagValues:iO,tagRevivers:iU,createDictionary:iA,extendDictionary:ix,fetchUrlAsArrayBuffer:ik,readBlobAsArrayBuffer:iT,chunkedProps:iD,otherSegments:iN,segments:iR,tiffBlocks:iM,segmentsAndBlocks:iB,tiffExtractables:iL,inheritables:iz,allFormatters:i$,Options:iW,parse:iY});let i8={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1};Object.assign({},i8,{firstChunkSize:4e4,gps:[1,2,3,4]}),Object.assign({},i8,{tiff:!1,ifd1:!0,mergeOutput:!1});let i4=Object.assign({},i8,{firstChunkSize:4e4,ifd0:[274]});async function i6(e){let t=new iZ(i4);await t.read(e);let i=await t.parse();if(i&&i.ifd0)return i.ifd0[274]}let i7=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}}),i9=!0,re=!0;if("object"==typeof navigator){let e=navigator.userAgent;if(e.includes("iPad")||e.includes("iPhone")){let t=e.match(/OS (\d+)_(\d+)/);if(t){let[,e,i]=t;i9=Number(e)+.1*Number(i)<13.4,re=!1}}else if(e.includes("OS X 10")){let[,t]=e.match(/OS X 10[_.](\d+)/);i9=re=15>Number(t)}if(e.includes("Chrome/")){let[,t]=e.match(/Chrome\/(\d+)/);i9=re=81>Number(t)}else if(e.includes("Firefox/")){let[,t]=e.match(/Firefox\/(\d+)/);i9=re=77>Number(t)}}async function rt(e){let t=await i6(e);return Object.assign({canvas:i9,css:re},i7[t])}class ri extends im{constructor(...e){super(...e),it(this,"ranges",new rr),0!==this.byteLength&&this.ranges.add(0,this.byteLength)}_tryExtend(e,t,i){if(0===e&&0===this.byteLength&&i){let e=new DataView(i.buffer||i,i.byteOffset,i.byteLength);this._swapDataView(e)}else{let i=e+t;if(i>this.byteLength){let{dataView:e}=this._extend(i);this._swapDataView(e)}}}_extend(e){let t;let i=new DataView((t=il?io.allocUnsafe(e):new Uint8Array(e)).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 r=super.set(e,t);return this.ranges.add(t,r.byteLength),r}async ensureChunk(e,t){this.chunked&&(this.ranges.available(e,t)||await this.readChunk(e,t))}available(e,t){return this.ranges.available(e,t)}}class rr{constructor(){it(this,"list",[])}get length(){return this.list.length}add(e,t,i=0){let r=e+t,s=this.list.filter(t=>{var i,s,n,a,o,l;return i=e,s=t.offset,n=r,i<=s&&s<=n||(a=e,o=t.end,l=r,a<=o&&o<=l)});if(s.length>0){e=Math.min(e,...s.map(e=>e.offset)),t=(r=Math.max(r,...s.map(e=>e.end)))-e;let i=s.shift();i.offset=e,i.length=t,i.end=r,this.list=this.list.filter(e=>!s.includes(e))}else this.list.push({offset:e,length:t,end:r})}available(e,t){let i=e+t;return this.list.some(t=>t.offset<=e&&i<=t.end)}}class rs extends ri{constructor(e,t){super(0),it(this,"chunksRead",0),this.input=e,this.options=t}async readWhole(){this.chunked=!1,await this.readChunk(this.nextChunkOffset)}async readChunked(){this.chunked=!0,await this.readChunk(0,this.options.firstChunkSize)}async readNextChunk(e=this.nextChunkOffset){if(this.fullyRead)return this.chunksRead++,!1;let t=this.options.chunkSize,i=await this.readChunk(e,t);return!!i&&i.byteLength===t}async readChunk(e,t){if(this.chunksRead++,0!==(t=this.safeWrapAddress(e,t)))return this._readChunk(e,t)}safeWrapAddress(e,t){return void 0!==this.size&&e+t>this.size?Math.max(0,this.size-e):t}get nextChunkOffset(){if(0!==this.ranges.list.length)return this.ranges.list[0].length}get canReadNextChunk(){return this.chunksRead<this.options.chunkLimit}get fullyRead(){return void 0!==this.size&&this.nextChunkOffset===this.size}read(){return this.options.chunked?this.readChunked():this.readWhole()}close(){}}i_.set("blob",class extends rs{async readWhole(){this.chunked=!1;let e=await iT(this.input);this._swapArrayBuffer(e)}readChunked(){return this.chunked=!0,this.size=this.input.size,super.readChunked()}async _readChunk(e,t){let i=t?e+t:void 0,r=this.input.slice(e,i),s=await iT(r);return this.set(s,e,!0)}});var rn={strings:{generatingThumbnails:"Generating thumbnails..."}};let ra={thumbnailWidth:null,thumbnailHeight:null,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,lazy:!1};class ro extends eN{static VERSION="4.2.1";queue;queueProcessing;defaultThumbnailDimension;thumbnailType;constructor(e,t){if(super(e,{...ra,...t}),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=rn,this.i18nInit(),this.opts.lazy&&this.opts.waitForThumbnailsBeforeUpload)throw 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 r=URL.createObjectURL(e.data);return Promise.all([new Promise((e,t)=>{let i=new Image;i.src=r,i.addEventListener("load",()=>{URL.revokeObjectURL(r),e(i)}),i.addEventListener("error",e=>{URL.revokeObjectURL(r),t(e.error||Error("Could not create thumbnail"))})}),rt(e.data).catch(()=>1)]).then(([e,r])=>{let s=this.getProportionalDimensions(e,t,i,r.deg),n=function(e,t){let i=e.width,r=e.height;(90===t.deg||270===t.deg)&&(i=e.height,r=e.width);let s=document.createElement("canvas");s.width=i,s.height=r;let n=s.getContext("2d");return n.translate(i/2,r/2),t.canvas&&(n.rotate(t.rad),n.scale(t.scaleX,t.scaleY)),n.drawImage(e,-e.width/2,-e.height/2,e.width,e.height),s}(e,r);return function(e,t,i){try{e.getContext("2d").getImageData(0,0,1,1)}catch(e){if(18===e.code)return Promise.reject(Error("cannot read image, probably an svg with external resources"))}return e.toBlob?new Promise(i=>{e.toBlob(i,t,80)}).then(e=>{if(null===e)throw Error("cannot read image, probably an svg with external resources");return e}):Promise.resolve().then(()=>t4(e.toDataURL(t,80),{})).then(e=>{if(null===e)throw Error("could not extract blob, probably an old browser");return e})}(this.resizeImage(n,s.width,s.height),this.thumbnailType,0)}).then(e=>URL.createObjectURL(e))}getProportionalDimensions(e,t,i,r){let s=e.width/e.height;return((90===r||270===r)&&(s=e.height/e.width),null!=t)?{width:t,height:Math.round(t/s)}:null!=i?{width:Math.round(i*s),height:i}:{width:this.defaultThumbnailDimension,height:Math.round(this.defaultThumbnailDimension/s)}}resizeImage(e,t,i){let r=function(e){let t=e.width/e.height,i=Math.floor(Math.sqrt(5e6*t)),r=Math.floor(5e6/Math.sqrt(5e6*t));if(i>4096&&(r=Math.round((i=4096)/t)),r>4096&&(i=Math.round(t*(r=4096))),e.width>i){let t=document.createElement("canvas");return t.width=i,t.height=r,t.getContext("2d").drawImage(e,0,0,i,r),t}return e}(e),s=Math.ceil(Math.log2(r.width/t));s<1&&(s=1);let n=t*2**(s-1),a=i*2**(s-1);for(;s--;){let e=document.createElement("canvas");e.width=n,e.height=a,e.getContext("2d").drawImage(r,0,0,n,a),r=e,n=Math.round(n/2),a=Math.round(a/2)}return r}setPreviewURL(e,t){this.uppy.setFileState(e,{preview:t})}addToQueue(e){this.queue.push(e),!1===this.queueProcessing&&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 t7(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()}onFileAdded=e=>{!e.preview&&e.data&&t7(e.type)&&!e.isRemote&&this.addToQueue(e.id)};onCancelRequest=e=>{let t=this.queue.indexOf(e.id);-1!==t&&this.queue.splice(t,1)};onFileRemoved=e=>{let t=this.queue.indexOf(e.id);-1!==t&&this.queue.splice(t,1),e.preview&&t6(e.preview)&&URL.revokeObjectURL(e.preview)};onRestored=()=>{this.uppy.getFiles().filter(e=>e.isRestored).forEach(e=>{(!e.preview||t6(e.preview))&&this.addToQueue(e.id)})};onAllFilesRemoved=()=>{this.queue=[]};waitUntilAllProcessed=e=>{e.forEach(e=>{let t=this.uppy.getFile(e);this.uppy.emit("preprocess-progress",t,{mode:"indeterminate",message:this.i18n("generatingThumbnails")})});let t=()=>{e.forEach(e=>{let t=this.uppy.getFile(e);this.uppy.emit("preprocess-complete",t)})};return new Promise(e=>{this.queueProcessing?this.uppy.once("thumbnail:all-generated",()=>{t(),e()}):(t(),e())})};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)}}var rl=function(e){if("string"==typeof e){let t=document.querySelectorAll(e);return 0===t.length?null:Array.from(t)}return"object"==typeof e&&s(e)?[e]:null},ru=Array.from;async function*rh(e,t,i){let r=()=>`${t}/${e.name}`;if("file"===e.kind){let s=await e.getFile();null!=s?(s.relativePath=t?r():null,yield s):null!=i&&(yield i)}else if("directory"===e.kind)for await(let i of e.values())yield*rh(i,t?r():e.name);else null!=i&&(yield i)}async function*rd(e,t){for(let{lastResortFile:i,fileSystemHandle:r}of(await Promise.all(Array.from(e.items,async e=>{let i;return{fileSystemHandle:i??=function e(t,i){return null==t?t:{kind:t.isFile?"file":t.isDirectory?"directory":void 0,name:t.name,getFile:()=>new Promise((e,i)=>t.file(e,i)),async *values(){let r=t.createReader(),s=await new Promise(t=>{!function e(t,i,r,{onSuccess:s}){t.readEntries(n=>{let a=[...i,...n];n.length?queueMicrotask(()=>{e(t,a,r,{onSuccess:s})}):s(a)},e=>{r(e),s(i)})}(r,[],i,{onSuccess:r=>t(r.map(t=>e(t,i)))})});yield*s},isSameEntry:void 0}}("function"==typeof e.getAsEntry?e.getAsEntry():e.webkitGetAsEntry(),t),lastResortFile:e.getAsFile()}}))))if(null!=r)try{yield*rh(r,"",i)}catch(e){null!=i?yield i:t(e)}else null!=i&&(yield i)}async function rp(e,t){let i=t?.logDropError??Function.prototype;try{let t=[];for await(let r of rd(e,i))t.push(r);return t}catch{return Promise.resolve(ru(e.files))}}let rc=(e=21)=>{let t="",i=0|e;for(;i--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t};function rf(){let e=document.body;return!!("draggable"in e&&"ondragstart"in e&&"ondrop"in e&&"FormData"in window&&"FileReader"in window)}class rg extends F{fileInput=null;folderInput=null;mobilePhotoFileInput=null;mobileVideoFileInput=null;triggerFileInputClick=()=>{this.fileInput?.click()};triggerFolderInputClick=()=>{this.folderInput?.click()};triggerVideoCameraInputClick=()=>{this.mobileVideoFileInput?.click()};triggerPhotoCameraInputClick=()=>{this.mobilePhotoFileInput?.click()};onFileInputChange=e=>{this.props.handleInputChange(e),e.currentTarget.value=""};renderHiddenInput=(e,t)=>eM("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,webkitdirectory:e,type:"file",name:"files[]",multiple:1!==this.props.maxNumberOfFiles,onChange:this.onFileInputChange,accept:this.props.allowedFileTypes?.join(", "),ref:t});renderHiddenCameraInput=(e,t,i)=>eM("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,type:"file",name:`camera-${e}`,onChange:this.onFileInputChange,capture:""===t?"environment":t,accept:{photo:"image/*",video:"video/*"}[e],ref:i});renderMyDeviceAcquirer=()=>eM("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MyDevice",children:eM("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,children:[eM("div",{className:"uppy-DashboardTab-inner",children:eM("svg",{className:"uppy-DashboardTab-iconMyDevice","aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32",children:eM("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"})})}),eM("div",{className:"uppy-DashboardTab-name",children:this.props.i18n("myDevice")})]})});renderPhotoCamera=()=>eM("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobilePhotoCamera",children:eM("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,children:[eM("div",{className:"uppy-DashboardTab-inner",children:eM("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32",children:eM("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"})})}),eM("div",{className:"uppy-DashboardTab-name",children:this.props.i18n("takePictureBtn")})]})});renderVideoCamera=()=>eM("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobileVideoCamera",children:eM("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,children:[eM("div",{className:"uppy-DashboardTab-inner",children:eM("svg",{"aria-hidden":"true",width:"32",height:"32",viewBox:"0 0 32 32",children:eM("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 "})})}),eM("div",{className:"uppy-DashboardTab-name",children:this.props.i18n("recordVideoBtn")})]})});renderBrowseButton=(e,t)=>eM("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-browse",onClick:t,"data-uppy-super-focusable":0===this.props.acquirers.length,children:e});renderDropPasteBrowseTagline=e=>{let t=this.renderBrowseButton(this.props.i18n("browseFiles"),this.triggerFileInputClick),i=this.renderBrowseButton(this.props.i18n("browseFolders"),this.triggerFolderInputClick),r=this.props.fileManagerSelectionType,s=r.charAt(0).toUpperCase()+r.slice(1);return eM("div",{class:"uppy-Dashboard-AddFiles-title",children: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})})};[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")}renderAcquirer=e=>eM("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":e.id,children:eM("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":this.props.activePickerPanel?.id===e.id,"data-uppy-super-focusable":!0,onClick:()=>this.props.showPanel(e.id),children:[eM("div",{className:"uppy-DashboardTab-inner",children:e.icon()}),eM("div",{className:"uppy-DashboardTab-name",children:e.name})]})});renderAcquirers=e=>{let t=[...e],i=t.splice(e.length-2,e.length);return eM(P,{children:[t.map(e=>this.renderAcquirer(e)),eM("span",{role:"presentation",style:{"white-space":"nowrap"},children:i.map(e=>this.renderAcquirer(e))})]})};renderSourcesList=(e,t)=>{let{showNativePhotoCameraButton:i,showNativeVideoCameraButton:r}=this.props,s=[],n="myDevice";t||s.push({key:n,elements:this.renderMyDeviceAcquirer()}),i&&s.push({key:"nativePhotoCameraButton",elements:this.renderPhotoCamera()}),r&&s.push({key:"nativePhotoCameraButton",elements:this.renderVideoCamera()}),s.push(...e.map(e=>({key:e.id,elements:this.renderAcquirer(e)}))),1===s.length&&s[0].key===n&&(s=[]);let a=[...s],o=a.splice(s.length-2,s.length);return eM(P,{children:[this.renderDropPasteBrowseTagline(s.length),eM("div",{className:"uppy-Dashboard-AddFiles-list",role:"tablist",children:[a.map(({key:e,elements:t})=>eM(P,{children:t},e)),eM("span",{role:"presentation",style:{"white-space":"nowrap"},children:o.map(({key:e,elements:t})=>eM(P,{children:t},e))})]})]})};renderPoweredByUppy(){let{i18nArray:e}=this.props,t=e("poweredBy",{uppy:eM("span",{children:[eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-poweredByIcon",width:"11",height:"11",viewBox:"0 0 11 11",children:eM("path",{d:"M7.365 10.5l-.01-4.045h2.612L5.5.806l-4.467 5.65h2.604l.01 4.044h3.718z",fillRule:"evenodd"})}),eM("span",{className:"uppy-Dashboard-poweredByUppy",children:"Uppy"})]})});return eM("a",{tabIndex:-1,href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",className:"uppy-Dashboard-poweredBy",children:t})}render(){let{showNativePhotoCameraButton:e,showNativeVideoCameraButton:t,nativeCameraFacingMode:i}=this.props;return eM("div",{className:"uppy-Dashboard-AddFiles",children:[this.renderHiddenInput(!1,e=>{this.fileInput=e}),this.renderHiddenInput(!0,e=>{this.folderInput=e}),e&&this.renderHiddenCameraInput("photo",i,e=>{this.mobilePhotoFileInput=e}),t&&this.renderHiddenCameraInput("video",i,e=>{this.mobileVideoFileInput=e}),this.renderSourcesList(this.props.acquirers,this.props.disableLocalFiles),eM("div",{className:"uppy-Dashboard-AddFiles-info",children:[this.props.note&&eM("div",{className:"uppy-Dashboard-note",children:this.props.note}),this.props.proudlyDisplayPoweredByUppy&&this.renderPoweredByUppy()]})]})}}var rm=e=>eM("div",{className:eK("uppy-Dashboard-AddFilesPanel",e.className),"data-uppy-panelType":"AddFiles","aria-hidden":!e.showAddFilesPanel,children:[eM("div",{className:"uppy-DashboardContent-bar",children:[eM("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":1,children:e.i18n("addingMoreFiles")}),eM("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>e.toggleAddFilesPanel(!1),children:e.i18n("back")})]}),eM(rg,{...e})]}),ry=function(e){let t=e.files[e.fileCardFor];return eM("div",{className:eK("uppy-DashboardContent-panel",e.className),role:"tabpanel","data-uppy-panelType":"FileEditor",id:"uppy-DashboardContent-panel--editor",children:[eM("div",{className:"uppy-DashboardContent-bar",children:[eM("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":1,children:e.i18nArray("editing",{file:eM("span",{className:"uppy-DashboardContent-titleFile",children:t.meta?t.meta.name:t.name})})}),eM("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>{e.uppy.emit("file-editor:cancel",t),e.closeFileEditor()},children:e.i18n("cancel")}),eM("button",{className:"uppy-DashboardContent-save",type:"button",onClick:e.saveFileEditor,children:e.i18n("save")})]}),eM("div",{className:"uppy-DashboardContent-panelBody",children:e.editors.map(t=>e.uppy.getPlugin(t.id).render(e.state))})]})};function rv(e){let t={color:"#838999",icon:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:eM("g",{fill:"#A7AFB7",fillRule:"nonzero",children:[eM("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"}),eM("path",{d:"M15 4v3a1 1 0 0 0 1 1h3V7h-3V4h-1z"})]})})};if(!e)return t;let i=e.split("/")[0],r=e.split("/")[1];return"text"===i?{color:"#5a5e69",icon:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:eM("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"})})}:"image"===i?{color:"#686de0",icon:eM("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25",children:eM("g",{fill:"#686DE0",fillRule:"evenodd",children:[eM("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"}),eM("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"}),eM("circle",{cx:"7.5",cy:"9.5",r:"1.5"})]})})}:"audio"===i?{color:"#068dbb",icon:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:eM("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"})})}:"video"===i?{color:"#19af67",icon:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:eM("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"})})}:"application"===i&&"pdf"===r?{color:"#e25149",icon:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:eM("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"})})}:"application"===i&&-1!==["zip","x-7z-compressed","x-zip-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(r)?{color:"#00C469",icon:eM("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25",children:eM("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"})})}:t}var rb=function(e){let{tagName:t}=e.target;if("INPUT"===t||"TEXTAREA"===t){e.stopPropagation();return}e.preventDefault(),e.stopPropagation()};function rw(e){let{file:t}=e;if(t.preview)return eM("img",{draggable:!1,className:"uppy-Dashboard-Item-previewImg",alt:t.name,src:t.preview});let{color:i,icon:r}=rv(t.type);return eM("div",{className:"uppy-Dashboard-Item-previewIconWrap",children:[eM("span",{className:"uppy-Dashboard-Item-previewIcon",style:{color:i},children:r}),eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-Dashboard-Item-previewIconBg",width:"58",height:"76",viewBox:"0 0 58 76",children:eM("rect",{fill:"#FFF",width:"58",height:"76",rx:"3",fillRule:"evenodd"})})]})}function r_(e){let{computedMetaFields:t,requiredMetaFields:i,updateMeta:r,form:s,formState:n}=e,a={text:"uppy-u-reset uppy-c-textInput uppy-Dashboard-FileCard-input"};return t.map(e=>{let t=`uppy-Dashboard-FileCard-input-${e.id}`,o=i.includes(e.id);return eM("fieldset",{className:"uppy-Dashboard-FileCard-fieldset",children:[eM("label",{className:"uppy-Dashboard-FileCard-label",htmlFor:t,children:e.name}),void 0!==e.render?e.render({value:n[e.id],onChange:t=>r(t,e.id),fieldCSSClasses:a,required:o,form:s.id},S):eM("input",{className:a.text,id:t,form:s.id,type:e.type||"text",required:o,value:n[e.id],placeholder:e.placeholder,onInput:t=>r(t.target.value,e.id),"data-uppy-super-focusable":!0})]},e.id)})}function rS(e){let{files:t,fileCardFor:i,toggleFileCard:r,saveFileCard:s,metaFields:n,requiredMetaFields:a,openFileEditor:o,i18n:l,i18nArray:u,className:h,canEditFile:d}=e,p=t[i],c=("function"==typeof n?n(t[i]):n)??[],f=d(p),g={};c.forEach(e=>{g[e.id]=p.meta[e.id]??""});let[m,y]=J(g),v=er(e=>{e.preventDefault(),s(m,i)},[s,m,i]),b=()=>{r(!1)},[w]=J(()=>{let e=document.createElement("form");return e.setAttribute("tabindex","-1"),e.id=rc(),e});return ee(()=>(document.body.appendChild(w),w.addEventListener("submit",v),()=>{w.removeEventListener("submit",v),document.body.removeChild(w)}),[w,v]),eM("div",{className:eK("uppy-Dashboard-FileCard",h),"data-uppy-panelType":"FileCard",onDragOver:rb,onDragLeave:rb,onDrop:rb,onPaste:rb,children:[eM("div",{className:"uppy-DashboardContent-bar",children:[eM("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":1,children:u("editing",{file:eM("span",{className:"uppy-DashboardContent-titleFile",children:p.meta?p.meta.name:p.name})})}),eM("button",{className:"uppy-DashboardContent-back",type:"button",form:w.id,title:l("finishEditingFile"),onClick:b,children:l("cancel")})]}),eM("div",{className:"uppy-Dashboard-FileCard-inner",children:[eM("div",{className:"uppy-Dashboard-FileCard-preview",style:{backgroundColor:rv(p.type).color},children:[eM(rw,{file:p}),f&&eM("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-FileCard-edit",onClick:e=>{v(e),o(p)},children:l("editImage")})]}),eM("div",{className:"uppy-Dashboard-FileCard-info",children:eM(r_,{computedMetaFields:c,requiredMetaFields:a,updateMeta:(e,t)=>{y({...m,[t]:e})},form:w,formState:m})}),eM("div",{className:"uppy-Dashboard-FileCard-actions",children:[eM("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Dashboard-FileCard-actionsBtn",type:"submit",form:w.id,children:l("saveChanges")}),eM("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link uppy-Dashboard-FileCard-actionsBtn",type:"button",onClick:b,form:w.id,children:l("cancel")})]})]})]})}function rC({file:e,uploadInProgressOrComplete:t,metaFields:i,canEditFile:r,i18n:s,onClick:n}){return!t&&i&&i.length>0||!t&&r(e)?eM("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:()=>n(),children:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 14",children:eM("g",{fillRule:"evenodd",children:[eM("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"}),eM("rect",{x:"1",y:"12.293",width:"11",height:"1",rx:".5"}),eM("path",{fillRule:"nonzero",d:"M6.793 2.5L9.5 5.207l.707-.707L7.5 1.793z"})]})})}):null}function rP({i18n:e,onClick:t,file:i}){return eM("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(),children:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"18",height:"18",viewBox:"0 0 18 18",children:[eM("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"}),eM("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 rF({file:e,uppy:t,i18n:i}){let r=r=>{(function(e,t="Copy the URL below"){return new Promise(i=>{let r=document.createElement("textarea");r.setAttribute("style",{position:"fixed",top:0,left:0,width:"2em",height:"2em",padding:0,border:"none",outline:"none",boxShadow:"none",background:"transparent"}),r.value=e,document.body.appendChild(r),r.select();let s=()=>{document.body.removeChild(r),window.prompt(t,e),i()};try{if(!document.execCommand("copy"))return s();return document.body.removeChild(r),i()}catch(e){return document.body.removeChild(r),s()}})})(e.uploadURL,i("copyLinkToClipboardFallback")).then(()=>{t.log("Link copied to clipboard."),t.info(i("copyLinkToClipboardSuccess"),"info",3e3)}).catch(t.log).then(()=>r.target.focus({preventScroll:!0}))};return eM("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--copyLink",type:"button","aria-label":i("copyLink"),title:i("copyLink"),onClick:e=>r(e),children:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 12",children:eM("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 rk(e){let{uppy:t,file:i,uploadInProgressOrComplete:r,canEditFile:s,metaFields:n,showLinkToFileUploadResult:a,showRemoveButton:o,i18n:l,toggleFileCard:u,openFileEditor:h}=e;return eM("div",{className:"uppy-Dashboard-Item-actionWrapper",children:[eM(rC,{i18n:l,file:i,uploadInProgressOrComplete:r,canEditFile:s,metaFields:n,onClick:()=>{n&&n.length>0?u(!0,i.id):h(i)}}),a&&i.uploadURL?eM(rF,{file:i,uppy:t,i18n:l}):null,o?eM(rP,{i18n:l,file:i,onClick:()=>t.removeFile(i.id)}):null]})}function rT(e,t){if(0===t)return"";if(e.length<=t)return e;if(t<=4)return`${e.slice(0,t-1)}…`;let i=t-3;return e.slice(0,Math.ceil(i/2))+"..."+e.slice(-Math.floor(i/2))}let rE=(e,t)=>("function"==typeof t?t():t).filter(t=>t.id===e)[0].name;function rA(e){let{file:t,toggleFileCard:i,i18n:r,metaFields:s}=e,{missingRequiredMetaFields:n}=t;if(!n?.length)return null;let a=n.map(e=>rE(e,s)).join(", ");return eM("div",{className:"uppy-Dashboard-Item-errorMessage",children:[r("missingRequiredMetaFields",{smart_count:n.length,fields:a})," ",eM("button",{type:"button",class:"uppy-u-reset uppy-Dashboard-Item-errorMessageBtn",onClick:()=>i(!0,t.id),children:r("editFile")})]})}let rx=e=>{let{author:t,name:i}=e.file.meta;return eM("div",{className:"uppy-Dashboard-Item-name",title:i,children:rT(i,e.isSingleFile&&e.containerHeight>=350?90:e.containerWidth<=352?35:e.containerWidth<=576?60:t?20:30)})},rI=e=>{let{author:t}=e.file.meta,i=e.file.remote?.providerName,r=`\u00B7`;return t?eM("div",{className:"uppy-Dashboard-Item-author",children:[eM("a",{href:`${t.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer",children:rT(t.name,13)}),i?eM(P,{children:[` ${r} `,i,` ${r} `]}):null]}):null},rO=e=>e.file.size&&eM("div",{className:"uppy-Dashboard-Item-statusSize",children:tD(e.file.size)}),rU=e=>e.file.isGhost&&eM("span",{children:[" • ",eM("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-reSelect",type:"button",onClick:()=>e.toggleAddFilesPanel(!0),children:e.i18n("reSelect")})]}),rD=({file:e,onClick:t})=>e.error?eM("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",children:"?"}):null;function rN(e){let{file:t,i18n:i,toggleFileCard:r,metaFields:s,toggleAddFilesPanel:n,isSingleFile:a,containerHeight:o,containerWidth:l}=e;return eM("div",{className:"uppy-Dashboard-Item-fileInfo","data-uppy-file-source":t.source,children:[eM("div",{className:"uppy-Dashboard-Item-fileName",children:[rx({file:t,isSingleFile:a,containerHeight:o,containerWidth:l}),eM(rD,{file:t,onClick:()=>alert(t.error)})]}),eM("div",{className:"uppy-Dashboard-Item-status",children:[rI({file:t}),rO({file:t}),rU({file:t,toggleAddFilesPanel:n,i18n:i})]}),eM(rA,{file:t,i18n:i,toggleFileCard:r,metaFields:s})]})}function rR(e){let{file:t,i18n:i,toggleFileCard:r,metaFields:s,showLinkToFileUploadResult:n}=e;return eM("div",{className:"uppy-Dashboard-Item-previewInnerWrap",style:{backgroundColor:t.preview?"rgba(255, 255, 255, 0.5)":rv(t.type).color},children:[n&&t.uploadURL&&eM("a",{className:"uppy-Dashboard-Item-previewLink",href:t.uploadURL,rel:"noreferrer noopener",target:"_blank","aria-label":t.meta.name,children:eM("span",{hidden:!0,children:t.meta.name})}),eM(rw,{file:t}),eM(rA,{file:t,i18n:i,toggleFileCard:r,metaFields:s})]})}function rM(e){return e.isUploaded?e.i18n("uploadComplete"):e.error?e.i18n("retryUpload"):e.resumableUploads?e.file.isPaused?e.i18n("resumeUpload"):e.i18n("pauseUpload"):e.individualCancellation?e.i18n("cancelUpload"):""}function rB(e){return eM("div",{className:"uppy-Dashboard-Item-progress",children:eM("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-progressIndicator",type:"button","aria-label":rM(e),title:rM(e),onClick:()=>(function(e){if(!e.isUploaded){if(e.error&&!e.hideRetryButton){e.uppy.retryUpload(e.file.id);return}e.resumableUploads&&!e.hidePauseResumeButton?e.uppy.pauseResume(e.file.id):e.individualCancellation&&!e.hideCancelButton&&e.uppy.removeFile(e.file.id)}})(e),children:e.children})})}function rL({children:e}){return eM("svg",{"aria-hidden":"true",focusable:"false",width:"70",height:"70",viewBox:"0 0 36 36",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--circle",children:e})}function rz({progress:e}){let t=2*Math.PI*15;return eM("g",{children:[eM("circle",{className:"uppy-Dashboard-Item-progressIcon--bg",r:"15",cx:"18",cy:"18","stroke-width":"2",fill:"none"}),eM("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 r$(e){return e.file.progress.uploadStarted&&void 0!==e.file.progress.percentage?e.isUploaded?eM("div",{className:"uppy-Dashboard-Item-progress",children:eM("div",{className:"uppy-Dashboard-Item-progressIndicator",children:eM(rL,{children:[eM("circle",{r:"15",cx:"18",cy:"18",fill:"#1bb240"}),eM("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"})]})})}):e.recoveredState?null:e.error&&!e.hideRetryButton?eM(rB,{...e,children:eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--retry",width:"28",height:"31",viewBox:"0 0 16 19",children:[eM("path",{d:"M16 11a8 8 0 1 1-8-8v2a6 6 0 1 0 6 6h2z"}),eM("path",{d:"M7.9 3H10v2H7.9z"}),eM("path",{d:"M8.536.5l3.535 3.536-1.414 1.414L7.12 1.914z"}),eM("path",{d:"M10.657 2.621l1.414 1.415L8.536 7.57 7.12 6.157z"})]})}):e.resumableUploads&&!e.hidePauseResumeButton?eM(rB,{...e,children:eM(rL,{children:[eM(rz,{progress:e.file.progress.percentage}),e.file.isPaused?eM("polygon",{className:"uppy-Dashboard-Item-progressIcon--play",transform:"translate(3, 3)",points:"12 20 12 10 20 15"}):eM("g",{className:"uppy-Dashboard-Item-progressIcon--pause",transform:"translate(14.5, 13)",children:[eM("rect",{x:"0",y:"0",width:"2",height:"10",rx:"0"}),eM("rect",{x:"5",y:"0",width:"2",height:"10",rx:"0"})]})]})}):e.resumableUploads||!e.individualCancellation||e.hideCancelButton?eM("div",{className:"uppy-Dashboard-Item-progress",children:eM("div",{className:"uppy-Dashboard-Item-progressIndicator",children:eM(rL,{children:eM(rz,{progress:e.file.progress.percentage})})})}):eM(rB,{...e,children:eM(rL,{children:[eM(rz,{progress:e.file.progress.percentage}),eM("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"})]})}):null}class rq extends F{componentDidMount(){let{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}shouldComponentUpdate(e){return!function(e,t){if(e===t)return!0;if(!e||!t)return!1;let i=Object.keys(e),r=Object.keys(t),s=i.length;if(r.length!==s)return!1;for(let r=0;r<s;r++){let s=i[r];if(e[s]!==t[s]||!Object.prototype.hasOwnProperty.call(t,s))return!1}return!0}(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,r=!!e.progress.uploadStarted||!!t,s=e.progress.uploadStarted&&!e.progress.uploadComplete||t,n=e.error||!1,{isGhost:a}=e,o=this.props.individualCancellation?!i:!s&&!i;return i&&this.props.showRemoveButtonAfterComplete&&(o=!0),eM("div",{className:eK({"uppy-Dashboard-Item":!0,"is-inprogress":s&&!this.props.recoveredState,"is-processing":t,"is-complete":i,"is-error":!!n,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation,"is-ghost":a}),id:`uppy_${e.id}`,role:this.props.role,children:[eM("div",{className:"uppy-Dashboard-Item-preview",children:[eM(rR,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,i18n:this.props.i18n,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),eM(r$,{uppy:this.props.uppy,file:e,error:n,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})]}),eM("div",{className:"uppy-Dashboard-Item-fileInfoAndButtons",children:[eM(rN,{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}),eM(rk,{file:e,metaFields:this.props.metaFields,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,showRemoveButton:o,canEditFile:this.props.canEditFile,uploadInProgressOrComplete:r,toggleFileCard:this.props.toggleFileCard,openFileEditor:this.props.openFileEditor,uppy:this.props.uppy,i18n:this.props.i18n})]})]})}}function rj({id:e,i18n:t,uppy:i,files:r,resumableUploads:s,hideRetryButton:n,hidePauseResumeButton:a,hideCancelButton:o,showLinkToFileUploadResult:l,showRemoveButtonAfterComplete:u,metaFields:h,isSingleFile:d,toggleFileCard:p,handleRequestThumbnail:c,handleCancelThumbnail:f,recoveredState:g,individualCancellation:m,itemsPerRow:y,openFileEditor:v,canEditFile:b,toggleAddFilesPanel:w,containerWidth:_,containerHeight:S}){let C=1===y?71:200,P=ei(()=>{let e=Object.keys(r);return g&&e.sort((e,t)=>Number(r[t].isGhost)-Number(r[e].isGhost)),function(e,t){let i=[],r=[];return e.forEach(e=>{r.length<t?r.push(e):(i.push(r),r=[e])}),r.length&&i.push(r),i}(e,y)},[r,y,g]),F=y=>eM("div",{class:"uppy-Dashboard-filesInner",role:"presentation",children:y.map(y=>eM(rq,{uppy:i,id:e,i18n:t,resumableUploads:s,individualCancellation:m,hideRetryButton:n,hidePauseResumeButton:a,hideCancelButton:o,showLinkToFileUploadResult:l,showRemoveButtonAfterComplete:u,metaFields:h,recoveredState:g,isSingleFile:d,containerWidth:_,containerHeight:S,toggleFileCard:p,handleRequestThumbnail:c,handleCancelThumbnail:f,role:"listitem",openFileEditor:v,canEditFile:b,toggleAddFilesPanel:w,file:r[y]},y))},y[0]);return d?eM("div",{class:"uppy-Dashboard-files",children:F(P[0])}):eM(eQ,{class:"uppy-Dashboard-files",role:"list",data:P,renderRow:F,rowHeight:C})}var rH=function({activePickerPanel:e,className:t,hideAllPanels:i,i18n:r,state:s,uppy:n}){let a=et(null);return eM("div",{className:eK("uppy-DashboardContent-panel",t),role:"tabpanel","data-uppy-panelType":"PickerPanel",id:`uppy-DashboardContent-panel--${e.id}`,onDragOver:rb,onDragLeave:rb,onDrop:rb,onPaste:rb,children:[eM("div",{className:"uppy-DashboardContent-bar",children:[eM("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":1,children:r("importFrom",{name:e.name})}),eM("button",{className:"uppy-DashboardContent-back",type:"button",onClick:i,children:r("cancel")})]}),eM("div",{ref:a,className:"uppy-DashboardContent-panelBody",children:n.getPlugin(e.id).render(s,a.current)})]})};let rV={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete",STATE_PAUSED:"paused"};function rW({files:e,i18n:t,isAllComplete:i,isAllErrored:r,isAllPaused:s,inProgressNotPausedFiles:n,newFiles:a,processingFiles:o}){switch(function(e,t,i,r={}){if(e)return rV.STATE_ERROR;if(t)return rV.STATE_COMPLETE;if(i)return rV.STATE_PAUSED;let s=rV.STATE_WAITING,n=Object.keys(r);for(let e=0;e<n.length;e++){let{progress:t}=r[n[e]];if(t.uploadStarted&&!t.uploadComplete)return rV.STATE_UPLOADING;t.preprocess&&s!==rV.STATE_UPLOADING&&(s=rV.STATE_PREPROCESSING),t.postprocess&&s!==rV.STATE_UPLOADING&&s!==rV.STATE_PREPROCESSING&&(s=rV.STATE_POSTPROCESSING)}return s}(r,i,s,e)){case"uploading":return t("uploadingXFiles",{smart_count:n.length});case"preprocessing":case"postprocessing":return t("processingXFiles",{smart_count:o.length});case"paused":return t("uploadPaused");case"waiting":return t("xFilesSelected",{smart_count:a.length});case"complete":return t("uploadComplete");case"error":return t("error")}}var rG=function(e){let{i18n:t,isAllComplete:i,hideCancelButton:r,maxNumberOfFiles:s,toggleAddFilesPanel:n,uppy:a}=e,{allowNewUpload:o}=e;return o&&s&&(o=e.totalFileCount<e.maxNumberOfFiles),eM("div",{className:"uppy-DashboardContent-bar",children:[i||r?eM("div",{}):eM("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>a.cancelAll(),children:t("cancel")}),eM("div",{className:"uppy-DashboardContent-title",children:eM(rW,{...e})}),o?eM("button",{className:"uppy-DashboardContent-addMore",type:"button","aria-label":t("addMoreFiles"),title:t("addMoreFiles"),onClick:()=>n(!0),children:[eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"15",height:"15",viewBox:"0 0 15 15",children:eM("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"})}),eM("span",{className:"uppy-DashboardContent-addMoreCaption",children:t("addMore")})]}):eM("div",{})]})};let rK="uppy-transition-slideDownUp";var rX=function({children:e}){let[t,i]=J(null),[r,s]=J(""),n=et(),a=et(),o=et(),l=()=>{s(`${rK}-enter`),cancelAnimationFrame(o.current),clearTimeout(a.current),a.current=void 0,o.current=requestAnimationFrame(()=>{s(`${rK}-enter ${rK}-enter-active`),n.current=setTimeout(()=>{s("")},250)})},u=()=>{s(`${rK}-leave`),cancelAnimationFrame(o.current),clearTimeout(n.current),n.current=void 0,o.current=requestAnimationFrame(()=>{s(`${rK}-leave ${rK}-leave-active`),a.current=setTimeout(()=>{i(null),s("")},250)})};return(ee(()=>{let r=x(e)[0];t!==r&&(r&&!t?l():!t||r||a.current||u(),i(r))},[e,t]),ee(()=>()=>{clearTimeout(n.current),clearTimeout(a.current),cancelAnimationFrame(o.current)},[]),t)?B(t,{className:eK(r,t.props.className)}):null},rZ={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"}},rY=['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])'],rQ=i(7310);function rJ(e,t){if(t){let i=e.querySelector(`[data-uppy-paneltype="${t}"]`);if(i)return i}return e}function r0(e,t){let i=t[0];i&&(i.focus(),e.preventDefault())}function r1(e,t,i){let r=rJ(i,t),s=ru(r.querySelectorAll(rY)),n=s.indexOf(document.activeElement);r.contains(document.activeElement)?e.shiftKey&&0===n?function(e,t){let i=t[t.length-1];i&&(i.focus(),e.preventDefault())}(e,s):e.shiftKey||n!==s.length-1||r0(e,s):r0(e,s)}function r2(){let e={};return e.promise=new Promise((t,i)=>{e.resolve=t,e.reject=i}),e}let r5={target:"body",metaFields:[],thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:tF,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};class r3 extends eN{static VERSION="4.4.1";#ty;modalName=`uppy-Dashboard-${rc()}`;superFocus=(r=!1,rQ((e,t)=>{let i=rJ(e,t),s=i.contains(document.activeElement);if(s&&r)return;let n=i.querySelector("[data-uppy-super-focusable]");if(!s||n){if(n)n.focus({preventScroll:!0}),r=!0;else{let e=i.querySelector(rY);e?.focus({preventScroll:!0}),r=!1}}},260));ifFocusedOnUppyRecently=!1;dashboardIsDisabled;savedScrollPosition;savedActiveElement;resizeObserver;darkModeMediaQuery;makeDashboardInsidesVisibleAnywayTimeout;constructor(e,t){super(e,{...r5,...t,autoOpen:t?.autoOpen??null}),this.id=this.opts.id||"Dashboard",this.title="Dashboard",this.type="orchestrator",this.defaultLocale=rZ,void 0===this.opts.doneButtonHandler&&(this.opts.doneButtonHandler=()=>{this.uppy.clear(),this.requestCloseModal()}),this.opts.onRequestCloseModal??=()=>this.closeModal(),this.i18nInit()}removeTarget=e=>{let t=this.getPluginState().targets.filter(t=>t.id!==e.id);this.setPluginState({targets:t})};addTarget=e=>{let t=e.id||e.constructor.name,i=e.title||t,r=e.type;if("acquirer"!==r&&"progressindicator"!==r&&"editor"!==r)return this.uppy.log("Dashboard: can only be targeted by plugins of types: acquirer, progressindicator, editor","error"),null;let s=this.getPluginState().targets.slice();return s.push({id:t,name:i,type:r}),this.setPluginState({targets:s}),this.el};hideAllPanels=()=>{let e=this.getPluginState(),t={activePickerPanel:void 0,showAddFilesPanel:!1,activeOverlayType:null,fileCardFor:null,showFileEditor:!1};(e.activePickerPanel!==t.activePickerPanel||e.showAddFilesPanel!==t.showAddFilesPanel||e.showFileEditor!==t.showFileEditor||e.activeOverlayType!==t.activeOverlayType)&&(this.setPluginState(t),this.uppy.emit("dashboard:close-panel",e.activePickerPanel?.id))};showPanel=e=>{let{targets:t}=this.getPluginState(),i=t.find(t=>"acquirer"===t.type&&t.id===e);this.setPluginState({activePickerPanel:i,activeOverlayType:"PickerPanel"}),this.uppy.emit("dashboard:show-panel",e)};canEditFile=e=>{let{targets:t}=this.getPluginState();return this.#tv(t).some(t=>this.uppy.getPlugin(t.id).canEditFile(e))};openFileEditor=e=>{let{targets:t}=this.getPluginState(),i=this.#tv(t);this.setPluginState({showFileEditor:!0,fileCardFor:e.id||null,activeOverlayType:"FileEditor"}),i.forEach(t=>{this.uppy.getPlugin(t.id).selectFile(e)})};closeFileEditor=()=>{let{metaFields:e}=this.getPluginState();e&&e.length>0?this.setPluginState({showFileEditor:!1,activeOverlayType:"FileCard"}):this.setPluginState({showFileEditor:!1,fileCardFor:null,activeOverlayType:"AddFiles"})};saveFileEditor=()=>{let{targets:e}=this.getPluginState();this.#tv(e).forEach(e=>{this.uppy.getPlugin(e.id).save()}),this.closeFileEditor()};openModal=()=>{let{promise:e,resolve:t}=r2();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 e=()=>{this.setPluginState({isHidden:!1}),this.el.removeEventListener("animationend",e,!1),t()};this.el.addEventListener("animationend",e,!1)}else this.setPluginState({isHidden:!1}),t();return this.opts.browserBackButtonClose&&this.updateBrowserHistory(),document.addEventListener("keydown",this.handleKeyDownInModal),this.uppy.emit("dashboard:modal-open"),e};closeModal=e=>{let t=e?.manualClose??!0,{isHidden:i,isClosing:r}=this.getPluginState();if(i||r)return;let{promise:s,resolve:n}=r2();if(this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.opts.animateOpenClose){this.setPluginState({isClosing:!0});let e=()=>{this.setPluginState({isHidden:!0,isClosing:!1}),this.superFocus.cancel(),this.savedActiveElement.focus(),this.el.removeEventListener("animationend",e,!1),n()};this.el.addEventListener("animationend",e,!1)}else this.setPluginState({isHidden:!0}),this.superFocus.cancel(),this.savedActiveElement.focus(),n();return document.removeEventListener("keydown",this.handleKeyDownInModal),t&&this.opts.browserBackButtonClose&&history.state?.[this.modalName]&&history.back(),this.uppy.emit("dashboard:modal-closed"),s};isModalOpen=()=>!this.getPluginState().isHidden;requestCloseModal=()=>this.opts.onRequestCloseModal?this.opts.onRequestCloseModal():this.closeModal();setDarkModeCapability=e=>{let{capabilities:t}=this.uppy.getState();this.uppy.setState({capabilities:{...t,darkMode:e}})};handleSystemDarkModeChange=e=>{let t=e.matches;this.uppy.log(`[Dashboard] Dark mode is ${t?"on":"off"}`),this.setDarkModeCapability(t)};toggleFileCard=(e,t)=>{let i=this.uppy.getFile(t);e?this.uppy.emit("dashboard:file-edit-start",i):this.uppy.emit("dashboard:file-edit-complete",i),this.setPluginState({fileCardFor:e?t:null,activeOverlayType:e?"FileCard":null})};toggleAddFilesPanel=e=>{this.setPluginState({showAddFilesPanel:e,activeOverlayType:e?"AddFiles":null})};addFiles=e=>{let t=e.map(e=>({source:this.id,name:e.name,type:e.type,data:e,meta:{relativePath:e.relativePath||e.webkitRelativePath||null}}));try{this.uppy.addFiles(t)}catch(e){this.uppy.log(e)}};startListeningToResize=()=>{this.resizeObserver=new ResizeObserver(e=>{let{width:t,height:i}=e[0].contentRect;this.setPluginState({containerWidth:t,containerHeight:i,areInsidesReadyToBeVisible:!0})}),this.resizeObserver.observe(this.el.querySelector(".uppy-Dashboard-inner")),this.makeDashboardInsidesVisibleAnywayTimeout=setTimeout(()=>{let e=this.getPluginState(),t=!this.opts.inline&&e.isHidden;e.areInsidesReadyToBeVisible||t||(this.uppy.log("[Dashboard] resize event didn’t fire on time: defaulted to mobile layout","warning"),this.setPluginState({areInsidesReadyToBeVisible:!0}))},1e3)};stopListeningToResize=()=>{this.resizeObserver.disconnect(),clearTimeout(this.makeDashboardInsidesVisibleAnywayTimeout)};recordIfFocusedOnUppyRecently=e=>{this.el.contains(e.target)?this.ifFocusedOnUppyRecently=!0:(this.ifFocusedOnUppyRecently=!1,this.superFocus.cancel())};disableInteractiveElements=e=>{let t=this.#ty??ru(this.el.querySelectorAll(["a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])",'[role="button"]:not([disabled])'])).filter(e=>!e.classList.contains("uppy-Dashboard-close"));for(let i of t)"A"===i.tagName?i.setAttribute("aria-disabled",e):i.disabled=e;e?this.#ty=t:this.#ty=null,this.dashboardIsDisabled=e};updateBrowserHistory=()=>{history.state?.[this.modalName]||history.pushState({...history.state,[this.modalName]:!0},""),window.addEventListener("popstate",this.handlePopState,!1)};handlePopState=e=>{!this.isModalOpen()||e.state&&e.state[this.modalName]||this.closeModal({manualClose:!1}),!this.isModalOpen()&&e.state?.[this.modalName]&&history.back()};handleKeyDownInModal=e=>{27===e.keyCode&&this.requestCloseModal(),9===e.keyCode&&r1(e,this.getPluginState().activeOverlayType,this.el)};handleClickOutside=()=>{this.opts.closeModalOnClickOutside&&this.requestCloseModal()};handlePaste=e=>{this.uppy.iteratePlugins(t=>{"acquirer"===t.type&&t.handleRootPaste?.(e)});let t=ru(e.clipboardData.files);t.length>0&&(this.uppy.log("[Dashboard] Files pasted"),this.addFiles(t))};handleInputChange=e=>{e.preventDefault();let t=ru(e.currentTarget.files||[]);t.length>0&&(this.uppy.log("[Dashboard] Files selected through input"),this.addFiles(t))};handleDragOver=e=>{e.preventDefault(),e.stopPropagation();let t=(()=>{let t=!0;return this.uppy.iteratePlugins(i=>{i.canHandleRootDrop?.(e)&&(t=!0)}),t})(),i=(()=>{let{types:t}=e.dataTransfer;return t.some(e=>"Files"===e)})();if(!t&&!i||this.opts.disabled||this.opts.disableLocalFiles&&(i||!t)||!this.uppy.getState().allowNewUpload){e.dataTransfer.dropEffect="none";return}e.dataTransfer.dropEffect="copy",this.setPluginState({isDraggingOver:!0}),this.opts.onDragOver(e)};handleDragLeave=e=>{e.preventDefault(),e.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.opts.onDragLeave(e)};handleDrop=async e=>{e.preventDefault(),e.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins(t=>{"acquirer"===t.type&&t.handleRootDrop?.(e)});let t=!1;this.uppy.log("[Dashboard] Processing dropped files");let i=await rp(e.dataTransfer,{logDropError:e=>{this.uppy.log(e,"error"),t||(this.uppy.info(e.message,"error"),t=!0)}});i.length>0&&(this.uppy.log("[Dashboard] Files dropped"),this.addFiles(i)),this.opts.onDrop(e)};handleRequestThumbnail=e=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:request",e)};handleCancelThumbnail=e=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:cancel",e)};handleKeyDownInInline=e=>{if(9===e.keyCode){var t,i;t=this.getPluginState().activeOverlayType,i=this.el,null===t||r1(e,t,i)}};handlePasteOnBody=e=>{this.el.contains(document.activeElement)&&this.handlePaste(e)};handleComplete=({failed:e})=>{this.opts.closeAfterFinish&&!e?.length&&this.requestCloseModal()};handleCancelRestore=()=>{this.uppy.emit("restore-canceled")};#tb=()=>{if(this.opts.disableThumbnailGenerator)return;let e=this.uppy.getFiles();if(1===e.length){let t=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);t?.setOptions({thumbnailWidth:600});let i={...e[0],preview:void 0};t?.requestThumbnail(i).then(()=>{t?.setOptions({thumbnailWidth:this.opts.thumbnailWidth})})}};#tw=e=>{let t=e[0],{metaFields:i}=this.getPluginState(),r=i&&i.length>0,s=this.canEditFile(t);r&&"metaEditor"===this.opts.autoOpen?this.toggleFileCard(!0,t.id):s&&"imageEditor"===this.opts.autoOpen&&this.openFileEditor(t)};initEvents=()=>{if(this.opts.trigger&&!this.opts.inline){let e=rl(this.opts.trigger);e?e.forEach(e=>e.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",this.#t_),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",this.#tb),this.uppy.on("file-removed",this.#tb),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",this.#tw)};removeEvents=()=>{let e=rl(this.opts.trigger);!this.opts.inline&&e&&e.forEach(e=>e.removeEventListener("click",this.openModal)),this.stopListeningToResize(),document.removeEventListener("paste",this.handlePasteOnBody),window.removeEventListener("popstate",this.handlePopState,!1),this.uppy.off("plugin-added",this.#t_),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",this.#tb),this.uppy.off("file-removed",this.#tb),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",this.#tw)};superFocusOnEachUpdate=()=>{let e=this.el.contains(document.activeElement),t=document.activeElement===document.body||null===document.activeElement,i=0===this.uppy.getState().info.length,r=!this.opts.inline;i&&(r||e||t&&this.ifFocusedOnUppyRecently)?this.superFocus(this.el,this.getPluginState().activeOverlayType):this.superFocus.cancel()};afterUpdate=()=>{if(this.opts.disabled&&!this.dashboardIsDisabled){this.disableInteractiveElements(!0);return}!this.opts.disabled&&this.dashboardIsDisabled&&this.disableInteractiveElements(!1),this.superFocusOnEachUpdate()};saveFileCard=(e,t)=>{this.uppy.setFileMeta(t,e),this.toggleFileCard(!1,t)};#tS=e=>{let t=this.uppy.getPlugin(e.id);return{...e,icon:t.icon||this.opts.defaultPickerIcon,render:t.render}};#tC=e=>{let t=this.uppy.getPlugin(e.id);return"function"!=typeof t.isSupported||t.isSupported()};#tP=e=>e.filter(e=>"acquirer"===e.type&&this.#tC(e)).map(this.#tS);#tF=e=>e.filter(e=>"progressindicator"===e.type).map(this.#tS);#tv=e=>e.filter(e=>"editor"===e.type).map(this.#tS);render=e=>{let t;let i=this.getPluginState(),{files:r,capabilities:s,allowNewUpload:n}=e,{newFiles:a,uploadStartedFiles:o,completeFiles:l,erroredFiles:u,inProgressFiles:h,inProgressNotPausedFiles:d,processingFiles:p,isUploadStarted:c,isAllComplete:f,isAllPaused:g}=this.uppy.getObjectOfFilesPerState(),m=this.#tP(i.targets),y=this.#tF(i.targets),v=this.#tv(i.targets);return t="auto"===this.opts.theme?s.darkMode?"dark":"light":this.opts.theme,0>["files","folders","both"].indexOf(this.opts.fileManagerSelectionType)&&(this.opts.fileManagerSelectionType="files",console.warn(`Unsupported option for "fileManagerSelectionType". Using default of "${this.opts.fileManagerSelectionType}".`)),function(e){let t=0===e.totalFileCount,i=1===e.totalFileCount,r=e.containerWidth>576,s=e.containerHeight>330,n=eK({"uppy-Dashboard":!0,"uppy-Dashboard--isDisabled":e.disabled,"uppy-Dashboard--animateOpenClose":e.animateOpenClose,"uppy-Dashboard--isClosing":e.isClosing,"uppy-Dashboard--isDraggingOver":e.isDraggingOver,"uppy-Dashboard--modal":!e.inline,"uppy-size--md":e.containerWidth>576,"uppy-size--lg":e.containerWidth>700,"uppy-size--xl":e.containerWidth>900,"uppy-size--height-md":e.containerHeight>330,"uppy-Dashboard--isAddFilesPanelVisible":e.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":e.areInsidesReadyToBeVisible,"uppy-Dashboard--singleFile":e.singleFileFullScreen&&i&&s}),a=1;e.containerWidth>900?a=5:e.containerWidth>700?a=4:e.containerWidth>576&&(a=3);let o=e.showSelectedFiles&&!t,l=e.recoveredState?Object.keys(e.recoveredState.files).length:null,u=e.files?Object.keys(e.files).filter(t=>e.files[t].isGhost).length:0;return eM("div",{className:n,"data-uppy-theme":e.theme,"data-uppy-num-acquirers":e.acquirers.length,"data-uppy-drag-drop-supported":!e.disableLocalFiles&&rf(),"aria-hidden":e.inline?"false":e.isHidden,"aria-disabled":e.disabled,"aria-label":e.inline?e.i18n("dashboardTitle"):e.i18n("dashboardWindowTitle"),onPaste:e.handlePaste,onDragOver:e.handleDragOver,onDragLeave:e.handleDragLeave,onDrop:e.handleDrop,children:[eM("div",{"aria-hidden":"true",className:"uppy-Dashboard-overlay",tabIndex:-1,onClick:e.handleClickOutside}),eM("div",{className:"uppy-Dashboard-inner",role:e.inline?void 0:"dialog",style:{width:e.inline&&e.width?e.width:"",height:e.inline&&e.height?e.height:""},children:[e.inline?null:eM("button",{className:"uppy-u-reset uppy-Dashboard-close",type:"button","aria-label":e.i18n("closeModal"),title:e.i18n("closeModal"),onClick:e.closeModal,children:eM("span",{"aria-hidden":"true",children:"\xd7"})}),eM("div",{className:"uppy-Dashboard-innerWrap",children:[eM("div",{className:"uppy-Dashboard-dropFilesHereHint",children:e.i18n("dropHint")}),o&&eM(rG,{...e}),l&&eM("div",{className:"uppy-Dashboard-serviceMsg",children:[eM("svg",{className:"uppy-Dashboard-serviceMsg-icon","aria-hidden":"true",focusable:"false",width:"21",height:"16",viewBox:"0 0 24 19",children:eM("g",{transform:"translate(0 -1)",fill:"none",fillRule:"evenodd",children:[eM("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"}),eM("path",{fill:"#000",d:"M11 6h2l-.3 8h-1.4z"}),eM("circle",{fill:"#000",cx:"12",cy:"17",r:"1"})]})}),eM("strong",{className:"uppy-Dashboard-serviceMsg-title",children:e.i18n("sessionRestored")}),eM("div",{className:"uppy-Dashboard-serviceMsg-text",children:u>0?e.i18n("recoveredXFiles",{smart_count:u}):e.i18n("recoveredAllFiles")})]}),o?eM(rj,{id:e.id,i18n:e.i18n,uppy:e.uppy,files:e.files,resumableUploads:e.resumableUploads,hideRetryButton:e.hideRetryButton,hidePauseResumeButton:e.hidePauseResumeButton,hideCancelButton:e.hideCancelButton,showLinkToFileUploadResult:e.showLinkToFileUploadResult,showRemoveButtonAfterComplete:e.showRemoveButtonAfterComplete,metaFields:e.metaFields,toggleFileCard:e.toggleFileCard,handleRequestThumbnail:e.handleRequestThumbnail,handleCancelThumbnail:e.handleCancelThumbnail,recoveredState:e.recoveredState,individualCancellation:e.individualCancellation,openFileEditor:e.openFileEditor,canEditFile:e.canEditFile,toggleAddFilesPanel:e.toggleAddFilesPanel,isSingleFile:i,itemsPerRow:a,containerWidth:e.containerWidth,containerHeight:e.containerHeight}):eM(rg,{i18n:e.i18n,i18nArray:e.i18nArray,acquirers:e.acquirers,handleInputChange:e.handleInputChange,maxNumberOfFiles:e.maxNumberOfFiles,allowedFileTypes:e.allowedFileTypes,showNativePhotoCameraButton:e.showNativePhotoCameraButton,showNativeVideoCameraButton:e.showNativeVideoCameraButton,nativeCameraFacingMode:e.nativeCameraFacingMode,showPanel:e.showPanel,activePickerPanel:e.activePickerPanel,disableLocalFiles:e.disableLocalFiles,fileManagerSelectionType:e.fileManagerSelectionType,note:e.note,proudlyDisplayPoweredByUppy:e.proudlyDisplayPoweredByUppy}),eM(rX,{children:e.showAddFilesPanel?eM(rm,{...e,isSizeMD:r},"AddFiles"):null}),eM(rX,{children:e.fileCardFor?eM(rS,{...e},"FileCard"):null}),eM(rX,{children:e.activePickerPanel?eM(rH,{...e},"Picker"):null}),eM(rX,{children:e.showFileEditor?eM(ry,{...e},"Editor"):null}),eM("div",{className:"uppy-Dashboard-progressindicators",children:e.progressindicators.map(t=>e.uppy.getPlugin(t.id).render(e.state))})]})]})]})}({state:e,isHidden:i.isHidden,files:r,newFiles:a,uploadStartedFiles:o,completeFiles:l,erroredFiles:u,inProgressFiles:h,inProgressNotPausedFiles:d,processingFiles:p,isUploadStarted:c,isAllComplete:f,isAllPaused:g,totalFileCount:Object.keys(r).length,totalProgress:e.totalProgress,allowNewUpload:n,acquirers:m,theme:t,disabled:this.opts.disabled,disableLocalFiles:this.opts.disableLocalFiles,direction:this.opts.direction,activePickerPanel:i.activePickerPanel,showFileEditor:i.showFileEditor,saveFileEditor:this.saveFileEditor,closeFileEditor:this.closeFileEditor,disableInteractiveElements:this.disableInteractiveElements,animateOpenClose:this.opts.animateOpenClose,isClosing:i.isClosing,progressindicators:y,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:e.recoveredState,metaFields:i.metaFields,resumableUploads:s.resumableUploads||!1,individualCancellation:s.individualCancellation,isMobileDevice:s.isMobileDevice,fileCardFor:i.fileCardFor,toggleFileCard:this.toggleFileCard,toggleAddFilesPanel:this.toggleAddFilesPanel,showAddFilesPanel:i.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:i.containerWidth,containerHeight:i.containerHeight,areInsidesReadyToBeVisible:i.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:i.isDraggingOver,handleDragOver:this.handleDragOver,handleDragLeave:this.handleDragLeave,handleDrop:this.handleDrop})};#tk=()=>{let{plugins:e}=this.opts;e.forEach(e=>{let t=this.uppy.getPlugin(e);t?t.mount(this,t):this.uppy.log(`[Uppy] Dashboard could not find plugin '${e}', make sure to uppy.use() the plugins you are specifying`,"warning")})};#tT=()=>{this.uppy.iteratePlugins(this.#t_)};#t_=e=>{e&&!e.opts?.target&&["acquirer","editor"].includes(e.type)&&!this.getPluginState().targets.some(t=>e.id===t.id)&&e.mount(this,e)};#tE(){let{hideUploadButton:e,hideRetryButton:t,hidePauseResumeButton:i,hideCancelButton:r,showProgressDetails:s,hideProgressAfterFinish:n,locale:a,doneButtonHandler:o}=this.opts;return{hideUploadButton:e,hideRetryButton:t,hidePauseResumeButton:i,hideCancelButton:r,showProgressDetails:s,hideAfterFinish:n,locale:a,doneButtonHandler:o}}#tA(){let{thumbnailWidth:e,thumbnailHeight:t,thumbnailType:i,waitForThumbnailsBeforeUpload:r}=this.opts;return{thumbnailWidth:e,thumbnailHeight:t,thumbnailType:i,waitForThumbnailsBeforeUpload:r,lazy:!r}}#tx(){return{}}setOptions(e){super.setOptions(e),this.uppy.getPlugin(this.#tI())?.setOptions(this.#tE()),this.uppy.getPlugin(this.#tO())?.setOptions(this.#tA())}#tI(){return`${this.id}:StatusBar`}#tO(){return`${this.id}:ThumbnailGenerator`}#tU(){return`${this.id}:Informer`}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:e,closeAfterFinish:t}=this.opts;if(e&&t)throw 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:i,allowMultipleUploadBatches:r}=this.uppy.opts;(i||r)&&t&&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:s}=this.opts;s&&this.mount(s,this),this.opts.disableStatusBar||this.uppy.use(t3,{id:this.#tI(),target:this,...this.#tE()}),this.opts.disableInformer||this.uppy.use(e$,{id:this.#tU(),target:this,...this.#tx()}),this.opts.disableThumbnailGenerator||this.uppy.use(ro,{id:this.#tO(),...this.#tA()}),this.darkModeMediaQuery="undefined"!=typeof window&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;let n=!!this.darkModeMediaQuery&&this.darkModeMediaQuery.matches;this.uppy.log(`[Dashboard] Dark mode is ${n?"on":"off"}`),this.setDarkModeCapability(n),"auto"===this.opts.theme&&this.darkModeMediaQuery?.addListener(this.handleSystemDarkModeChange),this.#tk(),this.#tT(),this.initEvents()};uninstall=()=>{if(!this.opts.disableInformer){let e=this.uppy.getPlugin(`${this.id}:Informer`);e&&this.uppy.removePlugin(e)}if(!this.opts.disableStatusBar){let e=this.uppy.getPlugin(`${this.id}:StatusBar`);e&&this.uppy.removePlugin(e)}if(!this.opts.disableThumbnailGenerator){let e=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);e&&this.uppy.removePlugin(e)}let{plugins:e}=this.opts;e.forEach(e=>{let t=this.uppy.getPlugin(e);t&&t.unmount()}),"auto"===this.opts.theme&&this.darkModeMediaQuery?.removeListener(this.handleSystemDarkModeChange),this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.unmount(),this.removeEvents()}}var r8=i(2265);let r4=["defaultChecked","defaultValue","suppressContentEditableWarning","suppressHydrationWarning","dangerouslySetInnerHTML","accessKey","className","contentEditable","contextMenu","dir","draggable","hidden","id","lang","placeholder","slot","spellCheck","style","tabIndex","title","translate","radioGroup","role","about","datatype","inlist","prefix","property","resource","typeof","vocab","autoCapitalize","autoCorrect","autoSave","color","itemProp","itemScope","itemType","itemID","itemRef","results","security","unselectable","inputMode","is","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],r6=/^(aria-|data-)/;var r7=e=>Object.fromEntries(Object.entries(e).filter(([e])=>r6.test(e)||r4.includes(e)));class r9 extends r8.Component{container;plugin;componentDidMount(){this.installPlugin()}componentDidUpdate(e){if(e.uppy!==this.props.uppy)this.uninstallPlugin(e),this.installPlugin();else if(function(e,t){let i=r7(e);return Object.keys(e).some(r=>!Object.hasOwn(i,r)&&e[r]!==t[r])}(this.props,e)){let{uppy:e,...t}={...this.props,target:this.container};this.plugin.setOptions(t)}}componentWillUnmount(){this.uninstallPlugin()}installPlugin(){let{uppy:e,...t}={id:"Dashboard",...this.props,inline:!0,target:this.container};e.use(r3,t),this.plugin=e.getPlugin(t.id)}uninstallPlugin(e=this.props){let{uppy:t}=e;t.removePlugin(this.plugin)}render(){return(0,r8.createElement)("div",{className:"uppy-Container",ref:e=>{this.container=e},...r7(this.props)})}}var se=r9,st={strings:{dropHereOr:"Drop here or %{browse}",browse:"browse"}};let si={inputName:"files[]",width:"100%",height:"100%"};class sr extends eN{static VERSION="4.2.1";isDragDropSupported=rf();fileInputRef;constructor(e,t){super(e,{...si,...t}),this.type="acquirer",this.id=this.opts.id||"DragDrop",this.title="Drag & Drop",this.defaultLocale=st,this.i18nInit()}addFiles=e=>{let t=e.map(e=>({source:this.id,name:e.name,type:e.type,data:e,meta:{relativePath:e.relativePath||null}}));try{this.uppy.addFiles(t)}catch(e){this.uppy.log(e)}};onInputChange=e=>{let t=ru(e.currentTarget.files||[]);t.length>0&&(this.uppy.log("[DragDrop] Files selected through input"),this.addFiles(t)),e.currentTarget.value=""};handleDragOver=e=>{e.preventDefault(),e.stopPropagation();let{types:t}=e.dataTransfer,i=t.some(e=>"Files"===e),{allowNewUpload:r}=this.uppy.getState();if(!i||!r){e.dataTransfer.dropEffect="none";return}e.dataTransfer.dropEffect="copy",this.setPluginState({isDraggingOver:!0}),this.opts.onDragOver?.(e)};handleDragLeave=e=>{e.preventDefault(),e.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.opts.onDragLeave?.(e)};handleDrop=async e=>{e.preventDefault(),e.stopPropagation(),this.setPluginState({isDraggingOver:!1});let t=await rp(e.dataTransfer,{logDropError:e=>{this.uppy.log(e,"error")}});t.length>0&&(this.uppy.log("[DragDrop] Files dropped"),this.addFiles(t)),this.opts.onDrop?.(e)};renderHiddenFileInput(){let{restrictions:e}=this.uppy.opts;return eM("input",{className:"uppy-DragDrop-input",type:"file",hidden:!0,ref:e=>{this.fileInputRef=e},name:this.opts.inputName,multiple:1!==e.maxNumberOfFiles,accept:e.allowedFileTypes?.join(", "),onChange:this.onInputChange})}static renderArrowSvg(){return eM("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-DragDrop-arrow",width:"16",height:"16",viewBox:"0 0 16 16",children:eM("path",{d:"M11 10V0H5v10H2l6 6 6-6h-3zm0 0",fillRule:"evenodd"})})}renderLabel(){return eM("div",{className:"uppy-DragDrop-label",children:this.i18nArray("dropHereOr",{browse:eM("span",{className:"uppy-DragDrop-browse",children:this.i18n("browse")})})})}renderNote(){return eM("span",{className:"uppy-DragDrop-note",children:this.opts.note})}render(){return eM("button",{type:"button",className:`uppy-u-reset
|
|
11
11
|
uppy-DragDrop-container
|
|
12
12
|
${this.isDragDropSupported?"uppy-DragDrop--isDragDropSupported":""}
|
|
13
13
|
${this.getPluginState().isDraggingOver?"uppy-DragDrop--isDraggingOver":""}
|
|
14
|
-
`,style:{width:this.opts.width,height:this.opts.height},onClick:()=>this.fileInputRef.click(),onDragOver:this.handleDragOver,onDragLeave:this.handleDragLeave,onDrop:this.handleDrop,children:[this.renderHiddenFileInput(),eM("div",{className:"uppy-DragDrop-inner",children:[sr.renderArrowSvg(),this.renderLabel(),this.renderNote()]})]})}install(){let{target:e}=this.opts;this.setPluginState({isDraggingOver:!1}),e&&this.mount(e,this)}uninstall(){this.unmount()}}var ss={strings:{chooseFiles:"Choose files"}};let sn={pretty:!0,inputName:"files[]"};class sa extends
|
|
15
|
-
//# sourceMappingURL=
|
|
14
|
+
`,style:{width:this.opts.width,height:this.opts.height},onClick:()=>this.fileInputRef.click(),onDragOver:this.handleDragOver,onDragLeave:this.handleDragLeave,onDrop:this.handleDrop,children:[this.renderHiddenFileInput(),eM("div",{className:"uppy-DragDrop-inner",children:[sr.renderArrowSvg(),this.renderLabel(),this.renderNote()]})]})}install(){let{target:e}=this.opts;this.setPluginState({isDraggingOver:!1}),e&&this.mount(e,this)}uninstall(){this.unmount()}}var ss={strings:{chooseFiles:"Choose files"}};let sn={pretty:!0,inputName:"files[]"};class sa extends eN{static VERSION="4.2.1";input=null;constructor(e,t){super(e,{...sn,...t}),this.id=this.opts.id||"FileInput",this.title="File Input",this.type="acquirer",this.defaultLocale=ss,this.i18nInit(),this.render=this.render.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleClick=this.handleClick.bind(this)}addFiles(e){let t=e.map(e=>({source:this.id,name:e.name,type:e.type,data:e}));try{this.uppy.addFiles(t)}catch(e){this.uppy.log(e)}}handleInputChange(e){this.uppy.log("[FileInput] Something selected through input...");let t=ru(e.currentTarget.files||[]);this.addFiles(t),e.currentTarget.value=""}handleClick(){this.input.click()}render(){let{restrictions:e}=this.uppy.opts;return eM("div",{className:"uppy-FileInput-container",children:[eM("input",{className:"uppy-FileInput-input",style:this.opts.pretty?{width:"0.1px",height:"0.1px",opacity:0,overflow:"hidden",position:"absolute",zIndex:-1}:void 0,type:"file",name:this.opts.inputName,onChange:this.handleInputChange,multiple:1!==e.maxNumberOfFiles,accept:e.allowedFileTypes?.join(", "),ref:e=>{this.input=e}}),this.opts.pretty&&eM("button",{className:"uppy-FileInput-btn",type:"button",onClick:this.handleClick,children:this.i18n("chooseFiles")})]})}install(){let{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}}i(57437),Object.prototype.hasOwnProperty,(0,r8.createContext)({uppy:void 0,status:"init",progress:0});let so={fixed:!1,hideAfterFinish:!0};class sl extends eN{static VERSION="4.3.1";constructor(e,t){super(e,{...so,...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=(0===t||100===t)&&this.opts.hideAfterFinish;return eM("div",{className:"uppy uppy-ProgressBar",style:{position:this.opts.fixed?"fixed":"initial"},"aria-hidden":i,children:[eM("div",{className:"uppy-ProgressBar-inner",style:{width:`${t}%`}}),eM("div",{className:"uppy-ProgressBar-percentage",children:t})]})}install(){let{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}}i(82558),i(76548)},52304:function(e,t,i){"use strict";function r(e,t){let i=/\$/g,r=[e];if(null==t)return r;for(let e of Object.keys(t))if("_"!==e){let s=t[e];"string"==typeof s&&(s=i[Symbol.replace](s,"$$$$")),r=function(e,t,i){let r=[];return e.forEach(e=>"string"!=typeof e?r.push(e):t[Symbol.split](e).forEach((e,t,s)=>{""!==e&&r.push(e),t<s.length-1&&r.push(i)})),r}(r,RegExp(`%\\{${e}\\}`,"g"),s)}return r}i.d(t,{Z:function(){return n}});let s=e=>{throw Error(`missing string: ${e}`)};class n{locale;constructor(e,{onMissingKey:t=s}={}){this.locale={strings:{},pluralize:e=>1===e?0:1},Array.isArray(e)?e.forEach(this.#tD,this):this.#tD(e),this.#tN=t}#tN;#tD(e){if(!e?.strings)return;let t=this.locale;Object.assign(this.locale,{strings:{...t.strings,...e.strings},pluralize:e.pluralize||t.pluralize})}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){let i=this.locale.strings[e];if(null==i&&(this.#tN(e),i=e),"object"==typeof i){if(t&&void 0!==t.smart_count)return r(i[this.locale.pluralize(t.smart_count)],t);throw Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if("string"!=typeof i)throw Error("string was not a string");return r(i,t)}}},72658:function(e,t,i){"use strict";i.d(t,{H:function(){return n}});var r=i(2925);function s(e){let t="";return e.replace(/[^A-Z0-9]/gi,e=>(t+=`-${e.charCodeAt(0).toString(32)}`,"/"))+t}function n(e,t){var i;let n;if(e.isRemote&&e.remote&&new Set(["box","dropbox","drive","facebook","unsplash"]).has(e.remote.provider))return e.id;let a=(0,r.Z)(e);return i={...e,type:a},n=t||"uppy","string"==typeof i.name&&(n+=`-${s(i.name.toLowerCase())}`),void 0!==i.type&&(n+=`-${i.type}`),i.meta&&"string"==typeof i.meta.relativePath&&(n+=`-${s(i.meta.relativePath.toLowerCase())}`),void 0!==i.data.size&&(n+=`-${i.data.size}`),void 0!==i.data.lastModified&&(n+=`-${i.data.lastModified}`),n}},66547:function(e,t,i){"use strict";function r(e){let t=e.lastIndexOf(".");return -1===t||t===e.length-1?{name:e,extension:void 0}:{name:e.slice(0,t),extension:e.slice(t+1)}}i.d(t,{Z:function(){return r}})},2925:function(e,t,i){"use strict";i.d(t,{Z:function(){return n}});var r=i(66547),s={__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",msg:"application/vnd.ms-outlook",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 n(e){if(e.type)return e.type;let t=e.name?r.Z(e.name).extension?.toLowerCase():null;return t&&t in s?s[t]:"application/octet-stream"}}}]);
|
|
15
|
+
//# sourceMappingURL=192-72d6868cd891ccc6.js.map
|