tiny-essentials 1.11.0 → 1.12.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.
Files changed (72) hide show
  1. package/README.md +12 -3
  2. package/dist/node_modules/firebase-functions/lib/common/trace.cjs +82 -0
  3. package/dist/node_modules/firebase-functions/lib/logger/common.cjs +57 -0
  4. package/dist/node_modules/firebase-functions/lib/logger/index.cjs +158 -0
  5. package/dist/v1/TinyBasicsEs.js +1653 -1
  6. package/dist/v1/TinyBasicsEs.min.js +1 -1
  7. package/dist/v1/TinyDragDropDetector.js +307 -0
  8. package/dist/v1/TinyDragDropDetector.min.js +1 -0
  9. package/dist/v1/TinyDragger.js +3563 -0
  10. package/dist/v1/TinyDragger.min.js +2 -0
  11. package/dist/v1/TinyDragger.min.js.LICENSE.txt +8 -0
  12. package/dist/v1/TinyEssentials.js +2783 -2
  13. package/dist/v1/TinyEssentials.min.js +1 -1
  14. package/dist/v1/TinyNotifyCenter.js +32 -0
  15. package/dist/v1/TinyNotifyCenter.min.js +1 -1
  16. package/dist/v1/TinyToastNotify.js +24 -0
  17. package/dist/v1/TinyToastNotify.min.js +1 -1
  18. package/dist/v1/TinyUploadClicker.js +5235 -0
  19. package/dist/v1/TinyUploadClicker.min.js +2 -0
  20. package/dist/v1/TinyUploadClicker.min.js.LICENSE.txt +8 -0
  21. package/dist/v1/basics/fileManager.cjs +524 -0
  22. package/dist/v1/basics/fileManager.d.mts +209 -0
  23. package/dist/v1/basics/fileManager.mjs +443 -0
  24. package/dist/v1/basics/fullScreen.cjs +134 -0
  25. package/dist/v1/basics/fullScreen.d.mts +8 -0
  26. package/dist/v1/basics/fullScreen.mjs +121 -0
  27. package/dist/v1/basics/html.cjs +262 -0
  28. package/dist/v1/basics/html.d.mts +63 -0
  29. package/dist/v1/basics/html.mjs +208 -0
  30. package/dist/v1/basics/index.cjs +40 -0
  31. package/dist/v1/basics/index.d.mts +38 -1
  32. package/dist/v1/basics/index.mjs +4 -1
  33. package/dist/v1/build/TinyDragDropDetector.cjs +7 -0
  34. package/dist/v1/build/TinyDragDropDetector.d.mts +3 -0
  35. package/dist/v1/build/TinyDragDropDetector.mjs +2 -0
  36. package/dist/v1/build/TinyDragger.cjs +7 -0
  37. package/dist/v1/build/TinyDragger.d.mts +3 -0
  38. package/dist/v1/build/TinyDragger.mjs +2 -0
  39. package/dist/v1/build/TinyUploadClicker.cjs +7 -0
  40. package/dist/v1/build/TinyUploadClicker.d.mts +3 -0
  41. package/dist/v1/build/TinyUploadClicker.mjs +2 -0
  42. package/dist/v1/css/TinyDraggerExample.css +21 -0
  43. package/dist/v1/css/TinyDraggerExample.min.css +1 -0
  44. package/dist/v1/index.cjs +44 -0
  45. package/dist/v1/index.d.mts +40 -1
  46. package/dist/v1/index.mjs +6 -1
  47. package/dist/v1/libs/TinyDragDropDetector.cjs +268 -0
  48. package/dist/v1/libs/TinyDragDropDetector.d.mts +123 -0
  49. package/dist/v1/libs/TinyDragDropDetector.mjs +228 -0
  50. package/dist/v1/libs/TinyDragger.cjs +801 -0
  51. package/dist/v1/libs/TinyDragger.d.mts +300 -0
  52. package/dist/v1/libs/TinyDragger.mjs +689 -0
  53. package/dist/v1/libs/TinyNotifyCenter.cjs +32 -0
  54. package/dist/v1/libs/TinyNotifyCenter.d.mts +9 -0
  55. package/dist/v1/libs/TinyNotifyCenter.mjs +28 -0
  56. package/dist/v1/libs/TinyToastNotify.cjs +24 -0
  57. package/dist/v1/libs/TinyToastNotify.d.mts +8 -0
  58. package/dist/v1/libs/TinyToastNotify.mjs +20 -0
  59. package/dist/v1/libs/TinyUploadClicker.cjs +223 -0
  60. package/dist/v1/libs/TinyUploadClicker.d.mts +80 -0
  61. package/dist/v1/libs/TinyUploadClicker.mjs +182 -0
  62. package/docs/v1/README.md +8 -2
  63. package/docs/v1/basics/fileManager.md +222 -0
  64. package/docs/v1/basics/fullScreen.md +183 -0
  65. package/docs/v1/basics/html.md +243 -0
  66. package/docs/v1/libs/TinyDragDropDetector.md +143 -0
  67. package/docs/v1/libs/TinyDragger.md +415 -0
  68. package/docs/v1/libs/TinyLevelUp.md +1 -1
  69. package/docs/v1/libs/TinyNotifyCenter.md +20 -0
  70. package/docs/v1/libs/TinyToastNotify.md +19 -0
  71. package/docs/v1/libs/TinyUploadClicker.md +108 -0
  72. package/package.json +12 -2
@@ -0,0 +1,2 @@
1
+ /*! For license information please see TinyUploadClicker.min.js.LICENSE.txt */
2
+ (()=>{var t={41:()=>{},251:(t,e)=>{e.read=function(t,e,r,n,i){var o,f,s=8*i-n-1,u=(1<<s)-1,a=u>>1,h=-7,c=r?i-1:0,l=r?-1:1,p=t[e+c];for(c+=l,o=p&(1<<-h)-1,p>>=-h,h+=s;h>0;o=256*o+t[e+c],c+=l,h-=8);for(f=o&(1<<-h)-1,o>>=-h,h+=n;h>0;f=256*f+t[e+c],c+=l,h-=8);if(0===o)o=1-a;else{if(o===u)return f?NaN:1/0*(p?-1:1);f+=Math.pow(2,n),o-=a}return(p?-1:1)*f*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var f,s,u,a=8*o-i-1,h=(1<<a)-1,c=h>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,y=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,f=h):(f=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-f))<1&&(f--,u*=2),(e+=f+c>=1?l/u:l*Math.pow(2,1-c))*u>=2&&(f++,u/=2),f+c>=h?(s=0,f=h):f+c>=1?(s=(e*u-1)*Math.pow(2,i),f+=c):(s=e*Math.pow(2,c-1)*Math.pow(2,i),f=0));i>=8;t[r+p]=255&s,p+=y,s/=256,i-=8);for(f=f<<i|s,a+=i;a>0;t[r+p]=255&f,p+=y,f/=256,a-=8);t[r+p-y]|=128*g}},287:(t,e,r)=>{"use strict";var n=r(526),i=r(251),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.hp=u,e.IS=50;var f=2147483647;function s(t){if(t>f)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,u.prototype),e}function u(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return c(t)}return a(t,e,r)}function a(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|g(t,e),n=s(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(_(t,Uint8Array)){var e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return l(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(_(t,ArrayBuffer)||t&&_(t.buffer,ArrayBuffer))return p(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(_(t,SharedArrayBuffer)||t&&_(t.buffer,SharedArrayBuffer)))return p(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return u.from(n,e,r);var i=function(t){if(u.isBuffer(t)){var e=0|y(t.length),r=s(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||D(t.length)?s(0):l(t):"Buffer"===t.type&&Array.isArray(t.data)?l(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return u.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function c(t){return h(t),s(t<0?0:0|y(t))}function l(t){for(var e=t.length<0?0:0|y(t.length),r=s(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function p(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,u.prototype),n}function y(t){if(t>=f)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+f.toString(16)+" bytes");return 0|t}function g(t,e){if(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||_(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return F(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(t).length;default:if(i)return n?-1:F(t).length;e=(""+e).toLowerCase(),i=!0}}function d(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return x(this,e,r);case"utf8":case"utf-8":return B(this,e,r);case"ascii":return k(this,e,r);case"latin1":case"binary":return O(this,e,r);case"base64":return U(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function w(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function v(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),D(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,n,i){var o,f=1,s=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;f=2,s/=2,u/=2,r/=2}function a(t,e){return 1===f?t[e]:t.readUInt16BE(e*f)}if(i){var h=-1;for(o=r;o<s;o++)if(a(t,o)===a(e,-1===h?0:o-h)){if(-1===h&&(h=o),o-h+1===u)return h*f}else-1!==h&&(o-=o-h),h=-1}else for(r+u>s&&(r=s-u),o=r;o>=0;o--){for(var c=!0,l=0;l<u;l++)if(a(t,o+l)!==a(e,l)){c=!1;break}if(c)return o}return-1}function m(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;n>o/2&&(n=o/2);for(var f=0;f<n;++f){var s=parseInt(e.substr(2*f,2),16);if(D(s))return f;t[r+f]=s}return f}function E(t,e,r,n){return H(F(e,t.length-r),t,r,n)}function A(t,e,r,n){return H(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function T(t,e,r,n){return H(z(e),t,r,n)}function C(t,e,r,n){return H(function(t,e){for(var r,n,i,o=[],f=0;f<t.length&&!((e-=2)<0);++f)n=(r=t.charCodeAt(f))>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function U(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function B(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,f,s,u,a=t[i],h=null,c=a>239?4:a>223?3:a>191?2:1;if(i+c<=r)switch(c){case 1:a<128&&(h=a);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&a)<<6|63&o)>127&&(h=u);break;case 3:o=t[i+1],f=t[i+2],128==(192&o)&&128==(192&f)&&(u=(15&a)<<12|(63&o)<<6|63&f)>2047&&(u<55296||u>57343)&&(h=u);break;case 4:o=t[i+1],f=t[i+2],s=t[i+3],128==(192&o)&&128==(192&f)&&128==(192&s)&&(u=(15&a)<<18|(63&o)<<12|(63&f)<<6|63&s)>65535&&u<1114112&&(h=u)}null===h?(h=65533,c=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),i+=c}return function(t){var e=t.length;if(e<=L)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=L));return r}(n)}u.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),u.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(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(t,e,r){return a(t,e,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(t,e,r){return function(t,e,r){return h(t),t<=0?s(t):void 0!==e?"string"==typeof r?s(t).fill(e,r):s(t).fill(e):s(t)}(t,e,r)},u.allocUnsafe=function(t){return c(t)},u.allocUnsafeSlow=function(t){return c(t)},u.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==u.prototype},u.compare=function(t,e){if(_(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),_(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(t){switch(String(t).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}},u.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=u.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var o=t[r];if(_(o,Uint8Array))i+o.length>n.length?u.from(o).copy(n,i):Uint8Array.prototype.set.call(n,o,i);else{if(!u.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i)}i+=o.length}return n},u.byteLength=g,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)w(this,e,e+1);return this},u.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)w(this,e,e+3),w(this,e+1,e+2);return this},u.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)w(this,e,e+7),w(this,e+1,e+6),w(this,e+2,e+5),w(this,e+3,e+4);return this},u.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?B(this,0,t):d.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",r=e.IS;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(t,e,r,n,i){if(_(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),f=(r>>>=0)-(e>>>=0),s=Math.min(o,f),a=this.slice(n,i),h=t.slice(e,r),c=0;c<s;++c)if(a[c]!==h[c]){o=a[c],f=h[c];break}return o<f?-1:f<o?1:0},u.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},u.prototype.indexOf=function(t,e,r){return v(this,t,e,r,!0)},u.prototype.lastIndexOf=function(t,e,r){return v(this,t,e,r,!1)},u.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return m(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":case"latin1":case"binary":return A(this,t,e,r);case"base64":return T(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var L=4096;function k(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function O(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function x(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=q[t[o]];return i}function I(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function S(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function M(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function R(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function j(t,e,r,n,o){return e=+e,r>>>=0,o||R(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function P(t,e,r,n,o){return e=+e,r>>>=0,o||R(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||S(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||S(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(t,e){return t>>>=0,e||S(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||S(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||S(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||S(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,e){return t>>>=0,e||S(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||S(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||S(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return t>>>=0,e||S(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||S(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){t>>>=0,e||S(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||S(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return t>>>=0,e||S(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return t>>>=0,e||S(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||S(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||S(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||S(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||M(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||M(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,1,255,0),this[e]=255&t,e+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);M(this,t,e,r,i-1,-i)}var o=0,f=1,s=0;for(this[e]=255&t;++o<r&&(f*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/f|0)-s&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);M(this,t,e,r,i-1,-i)}var o=r-1,f=1,s=0;for(this[e+o]=255&t;--o>=0&&(f*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/f|0)-s&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeFloatLE=function(t,e,r){return j(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return j(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return P(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return P(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},u.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var f=u.isBuffer(t)?t:u.from(t,n),s=f.length;if(0===s)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-e;++o)this[o+e]=f[o%s]}return this};var N=/[^+/0-9A-Za-z-_]/g;function F(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],f=0;f<n;++f){if((r=t.charCodeAt(f))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(f+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function z(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(N,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function H(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function _(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function D(t){return t!=t}var q=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)e[n+i]=t[r]+t[i];return e}()},526:(t,e)=>{"use strict";e.byteLength=function(t){var e=s(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=s(t),f=o[0],u=o[1],a=new i(function(t,e,r){return 3*(e+r)/4-r}(0,f,u)),h=0,c=u>0?f-4:f;for(r=0;r<c;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],a[h++]=e>>16&255,a[h++]=e>>8&255,a[h++]=255&e;return 2===u&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,a[h++]=255&e),1===u&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,a[h++]=e>>8&255,a[h++]=255&e),a},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],f=16383,s=0,a=n-i;s<a;s+=f)o.push(u(t,s,s+f>a?a:s+f));return 1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=0;f<64;++f)r[f]=o[f],n[o.charCodeAt(f)]=f;function s(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function u(t,e,n){for(var i,o,f=[],s=e;s<n;s+=3)i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),f.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return f.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},606:t=>{var e,r,n=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function f(t){if(e===setTimeout)return setTimeout(t,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:i}catch(t){e=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(t){r=o}}();var s,u=[],a=!1,h=-1;function c(){a&&s&&(a=!1,s.length?u=s.concat(u):h=-1,u.length&&l())}function l(){if(!a){var t=f(c);a=!0;for(var e=u.length;e;){for(s=u,u=[];++h<e;)s&&s[h].run();h=-1,e=u.length}s=null,a=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{return r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function y(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];u.push(new p(t,e)),1!==u.length||a||f(l)},p.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=y,n.addListener=y,n.once=y,n.off=y,n.removeListener=y,n.removeAllListeners=y,n.emit=y,n.prependListener=y,n.prependOnceListener=y,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},975:(t,e,r)=>{"use strict";var n=r(606);function i(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function o(t,e){for(var r,n="",i=0,o=-1,f=0,s=0;s<=t.length;++s){if(s<t.length)r=t.charCodeAt(s);else{if(47===r)break;r=47}if(47===r){if(o===s-1||1===f);else if(o!==s-1&&2===f){if(n.length<2||2!==i||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var u=n.lastIndexOf("/");if(u!==n.length-1){-1===u?(n="",i=0):i=(n=n.slice(0,u)).length-1-n.lastIndexOf("/"),o=s,f=0;continue}}else if(2===n.length||1===n.length){n="",i=0,o=s,f=0;continue}e&&(n.length>0?n+="/..":n="..",i=2)}else n.length>0?n+="/"+t.slice(o+1,s):n=t.slice(o+1,s),i=s-o-1;o=s,f=0}else 46===r&&-1!==f?++f:f=-1}return n}var f={resolve:function(){for(var t,e="",r=!1,f=arguments.length-1;f>=-1&&!r;f--){var s;f>=0?s=arguments[f]:(void 0===t&&(t=n.cwd()),s=t),i(s),0!==s.length&&(e=s+"/"+e,r=47===s.charCodeAt(0))}return e=o(e,!r),r?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(t){if(i(t),0===t.length)return".";var e=47===t.charCodeAt(0),r=47===t.charCodeAt(t.length-1);return 0!==(t=o(t,!e)).length||e||(t="."),t.length>0&&r&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return i(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,e=0;e<arguments.length;++e){var r=arguments[e];i(r),r.length>0&&(void 0===t?t=r:t+="/"+r)}return void 0===t?".":f.normalize(t)},relative:function(t,e){if(i(t),i(e),t===e)return"";if((t=f.resolve(t))===(e=f.resolve(e)))return"";for(var r=1;r<t.length&&47===t.charCodeAt(r);++r);for(var n=t.length,o=n-r,s=1;s<e.length&&47===e.charCodeAt(s);++s);for(var u=e.length-s,a=o<u?o:u,h=-1,c=0;c<=a;++c){if(c===a){if(u>a){if(47===e.charCodeAt(s+c))return e.slice(s+c+1);if(0===c)return e.slice(s+c)}else o>a&&(47===t.charCodeAt(r+c)?h=c:0===c&&(h=0));break}var l=t.charCodeAt(r+c);if(l!==e.charCodeAt(s+c))break;47===l&&(h=c)}var p="";for(c=r+h+1;c<=n;++c)c!==n&&47!==t.charCodeAt(c)||(0===p.length?p+="..":p+="/..");return p.length>0?p+e.slice(s+h):(s+=h,47===e.charCodeAt(s)&&++s,e.slice(s))},_makeLong:function(t){return t},dirname:function(t){if(i(t),0===t.length)return".";for(var e=t.charCodeAt(0),r=47===e,n=-1,o=!0,f=t.length-1;f>=1;--f)if(47===(e=t.charCodeAt(f))){if(!o){n=f;break}}else o=!1;return-1===n?r?"/":".":r&&1===n?"//":t.slice(0,n)},basename:function(t,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('"ext" argument must be a string');i(t);var r,n=0,o=-1,f=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var s=e.length-1,u=-1;for(r=t.length-1;r>=0;--r){var a=t.charCodeAt(r);if(47===a){if(!f){n=r+1;break}}else-1===u&&(f=!1,u=r+1),s>=0&&(a===e.charCodeAt(s)?-1==--s&&(o=r):(s=-1,o=u))}return n===o?o=u:-1===o&&(o=t.length),t.slice(n,o)}for(r=t.length-1;r>=0;--r)if(47===t.charCodeAt(r)){if(!f){n=r+1;break}}else-1===o&&(f=!1,o=r+1);return-1===o?"":t.slice(n,o)},extname:function(t){i(t);for(var e=-1,r=0,n=-1,o=!0,f=0,s=t.length-1;s>=0;--s){var u=t.charCodeAt(s);if(47!==u)-1===n&&(o=!1,n=s+1),46===u?-1===e?e=s:1!==f&&(f=1):-1!==e&&(f=-1);else if(!o){r=s+1;break}}return-1===e||-1===n||0===f||1===f&&e===n-1&&e===r+1?"":t.slice(e,n)},format:function(t){if(null===t||"object"!=typeof t)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return function(t,e){var r=e.dir||e.root,n=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+n:r+"/"+n:n}(0,t)},parse:function(t){i(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var r,n=t.charCodeAt(0),o=47===n;o?(e.root="/",r=1):r=0;for(var f=-1,s=0,u=-1,a=!0,h=t.length-1,c=0;h>=r;--h)if(47!==(n=t.charCodeAt(h)))-1===u&&(a=!1,u=h+1),46===n?-1===f?f=h:1!==c&&(c=1):-1!==f&&(c=-1);else if(!a){s=h+1;break}return-1===f||-1===u||0===c||1===c&&f===u-1&&f===s+1?-1!==u&&(e.base=e.name=0===s&&o?t.slice(1,u):t.slice(s,u)):(0===s&&o?(e.name=t.slice(1,f),e.base=t.slice(1,u)):(e.name=t.slice(s,f),e.base=t.slice(s,u)),e.ext=t.slice(f,u)),s>0?e.dir=t.slice(0,s-1):o&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};f.posix=f,t.exports=f}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n](o,o.exports,r),o.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var n={};(()=>{"use strict";r.d(n,{TinyUploadClicker:()=>s});var t=r(287);const e="undefined"!=typeof window&&void 0!==window.document,i={items:{},order:[]};function o(t,e){const r=[],n=Array.isArray(t)?t:Object.entries(t);for(const[t,o]of n)if(!i.items.hasOwnProperty(t)){i.items[t]=o;let n="number"==typeof e?e:-1;if(-1===n){const t=i.order.indexOf("object");n=t>-1?t:i.order.length}n=Math.min(Math.max(0,n),i.order.length),i.order.splice(n,0,t),r.push(t)}return r}function f(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&"[object Object]"===Object.prototype.toString.call(t)}o([["undefined",t=>void 0===t],["null",t=>null===t],["boolean",t=>"boolean"==typeof t],["number",t=>"number"==typeof t&&!Number.isNaN(t)],["bigint",t=>"bigint"==typeof t],["string",t=>"string"==typeof t],["symbol",t=>"symbol"==typeof t],["function",t=>"function"==typeof t],["array",t=>Array.isArray(t)]]),e||o([["buffer",e=>void 0!==t.hp&&t.hp.isBuffer(e)]]),e&&o([["file",t=>"undefined"!=typeof File&&t instanceof File]]),o([["date",t=>t instanceof Date],["regexp",t=>t instanceof RegExp],["map",t=>t instanceof Map],["set",t=>t instanceof Set],["weakmap",t=>t instanceof WeakMap],["weakset",t=>t instanceof WeakSet],["promise",t=>t instanceof Promise]]),e&&o([["htmlelement",t=>"undefined"!=typeof HTMLElement&&t instanceof HTMLElement]]),o([["object",t=>f(t)]]),r(41),r(975);const s=class{#t;#e=[];#r=new WeakMap;#n;constructor(t){if(!f(t))throw new TypeError('TinyUploadClicker: "options" must be a valid object.');this.#t={multiple:!1,accept:"",inputAttributes:{},inputStyles:{display:"none"},onClick:null,onFileLoad:null,...t};const{triggers:e}=t;if(!(Array.isArray(e)||"string"==typeof e||e instanceof HTMLElement))throw new TypeError('TinyUploadClicker: "triggers" is required and must be a string, HTMLElement, or an array of them.');const r=(Array.isArray(this.#t.triggers)?this.#t.triggers:[this.#t.triggers]).map((t=>{if("string"==typeof t){const e=document.querySelector(t);if(!e)throw new Error(`TinyUploadClicker: No element found for selector "${t}".`);return e}if(!(t instanceof HTMLElement))throw new TypeError("TinyUploadClicker: All triggers must be either strings (selectors) or HTMLElements.");return t}));if(void 0!==t.accept&&"string"!=typeof t.accept&&!Array.isArray(t.accept))throw new TypeError('TinyUploadClicker: "accept" must be a string or an array of strings.');if(void 0!==t.onClick&&"function"!=typeof t.onClick&&null!==t.onClick)throw new TypeError('TinyUploadClicker: "onClick" must be a function or null.');if(void 0!==t.onFileLoad&&"function"!=typeof t.onFileLoad&&null!==t.onFileLoad)throw new TypeError('TinyUploadClicker: "onFileLoad" must be a function or null.');if(void 0!==t.inputAttributes&&!f(t.inputAttributes))throw new TypeError('TinyUploadClicker: "inputAttributes" must be an object.');if(void 0!==t.inputStyles&&!f(t.inputStyles))throw new TypeError('TinyUploadClicker: "inputStyles" must be an object.');this.#n=this.#i.bind(this),this.#e=r,this.#e.forEach((t=>{if(!(t instanceof HTMLElement))return;const e=document.createElement("input");e.type="file",this.#t.multiple&&(e.multiple=!0),"string"==typeof this.#t.accept?e.accept=this.#t.accept:Array.isArray(this.#t.accept)&&(e.accept=this.#t.accept.join(","));const r=this.#t.inputAttributes;if(r&&"object"==typeof r)for(const[t,n]of Object.entries(r))e.setAttribute(t,n);Object.assign(e.style,this.#t.inputStyles||{display:"none"}),e.addEventListener("change",(()=>{e.files&&"function"==typeof this.#t.onFileLoad&&this.#t.onFileLoad(e.files,t),e.value=""})),document.body.appendChild(e),this.#r.set(t,e),t.addEventListener("click",this.#n)}))}#i(t){const e=t.currentTarget;if(!(e instanceof HTMLElement))return;const r=this.#r.get(e);r&&("function"==typeof this.#t.onClick&&this.#t.onClick(e),r.click())}destroy(){for(const t of this.#e){if(!(t instanceof HTMLElement))return;t.removeEventListener("click",this.#n);const e=this.#r.get(t);e&&e.parentNode&&e.remove(),this.#r.delete(t)}this.#e=[]}}})(),window.TinyUploadClicker=n.TinyUploadClicker})();
@@ -0,0 +1,8 @@
1
+ /*!
2
+ * The buffer module from node.js, for the browser.
3
+ *
4
+ * @author Feross Aboukhadijeh <https://feross.org>
5
+ * @license MIT
6
+ */
7
+
8
+ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
@@ -0,0 +1,524 @@
1
+ 'use strict';
2
+
3
+ var fs = require('fs');
4
+ var path = require('path');
5
+ var text = require('./text.cjs');
6
+
7
+ /*========================*
8
+ * JSON Operations
9
+ *========================*/
10
+
11
+ /**
12
+ * Reads and parses a JSON file.
13
+ * Throws an error if the file content is not valid JSON.
14
+ * @param {string} filePath
15
+ * @returns {any}
16
+ */
17
+ function readJsonFile(filePath) {
18
+ if (!fs.existsSync(filePath)) throw new Error(`File not found: ${filePath}`);
19
+ const content = fs.readFileSync(filePath, 'utf-8');
20
+ return JSON.parse(content);
21
+ }
22
+
23
+ /**
24
+ * Saves an object as JSON to a file.
25
+ * Automatically creates the directory if it does not exist.
26
+ * @param {string} filePath
27
+ * @param {any} data
28
+ * @param {number} [spaces=2]
29
+ */
30
+ function writeJsonFile(filePath, data, spaces = 2) {
31
+ const json = JSON.stringify(data, null, spaces);
32
+ fs.writeFileSync(filePath, json, 'utf-8');
33
+ }
34
+
35
+ /**
36
+ * Reads and parses a JSON file.
37
+ * Throws an error if the file content is not valid JSON.
38
+ * @param {string} filePath
39
+ * @returns {Promise<any>}
40
+ */
41
+ async function readJsonFileAsync(filePath) {
42
+ if (!fs.existsSync(filePath)) throw new Error(`File not found: ${filePath}`);
43
+ const content = await fs.promises.readFile(filePath, 'utf-8');
44
+ return JSON.parse(content);
45
+ }
46
+
47
+ /**
48
+ * Saves an object as JSON to a file.
49
+ * Automatically creates the directory if it does not exist.
50
+ * @param {string} filePath
51
+ * @param {any} data
52
+ * @param {number} [spaces=2]
53
+ * @returns {Promise<void>}
54
+ */
55
+ function writeJsonFileAsync(filePath, data, spaces = 2) {
56
+ const json = JSON.stringify(data, null, spaces);
57
+ return fs.promises.writeFile(filePath, json, 'utf-8');
58
+ }
59
+
60
+ /*========================*
61
+ * Directory Management
62
+ *========================*/
63
+
64
+ /**
65
+ * Ensures that the directory exists, creating it recursively if needed.
66
+ * @param {string} dirPath
67
+ */
68
+ function ensureDirectory(dirPath) {
69
+ if (!fs.existsSync(dirPath)) {
70
+ fs.mkdirSync(dirPath, { recursive: true });
71
+ }
72
+ }
73
+
74
+ /**
75
+ * Clears all contents inside a directory but keeps the directory.
76
+ * @param {string} dirPath
77
+ */
78
+ function clearDirectory(dirPath) {
79
+ if (!fs.existsSync(dirPath)) return;
80
+ const files = fs.readdirSync(dirPath);
81
+ for (const file of files) {
82
+ const fullPath = path.join(dirPath, file);
83
+ const stat = fs.lstatSync(fullPath);
84
+ if (stat.isDirectory()) {
85
+ fs.rmSync(fullPath, { recursive: true, force: true });
86
+ } else {
87
+ fs.unlinkSync(fullPath);
88
+ }
89
+ }
90
+ }
91
+
92
+ /*========================*
93
+ * File Checks
94
+ *========================*/
95
+
96
+ /**
97
+ * Checks whether a file exists.
98
+ * @param {string} filePath
99
+ * @returns {boolean}
100
+ */
101
+ function fileExists(filePath) {
102
+ return fs.existsSync(filePath) && fs.lstatSync(filePath).isFile();
103
+ }
104
+
105
+ /**
106
+ * Checks whether a directory exists.
107
+ * @param {string} dirPath
108
+ * @returns {boolean}
109
+ */
110
+ function dirExists(dirPath) {
111
+ return fs.existsSync(dirPath) && fs.lstatSync(dirPath).isDirectory();
112
+ }
113
+
114
+ /**
115
+ * Checks whether a directory is empty.
116
+ * @param {string} dirPath
117
+ * @returns {boolean}
118
+ */
119
+ function isDirEmpty(dirPath) {
120
+ return fs.existsSync(dirPath) && fs.readdirSync(dirPath).length === 0;
121
+ }
122
+
123
+ /*========================*
124
+ * File Operations
125
+ *========================*/
126
+
127
+ /**
128
+ * Copies a file to a destination.
129
+ * @param {string} src
130
+ * @param {string} dest
131
+ * @param {number} [mode]
132
+ */
133
+ function ensureCopyFile(src, dest, mode) {
134
+ ensureDirectory(path.dirname(dest));
135
+ fs.copyFileSync(src, dest, mode);
136
+ }
137
+
138
+ /**
139
+ * Deletes a file (If the file exists).
140
+ * @param {string} filePath
141
+ * @returns {boolean}
142
+ */
143
+ function tryDeleteFile(filePath) {
144
+ if (fileExists(filePath)) {
145
+ fs.unlinkSync(filePath);
146
+ return true;
147
+ }
148
+ return false;
149
+ }
150
+
151
+ /**
152
+ * Copies a file to a destination.
153
+ * @param {string} src
154
+ * @param {string} dest
155
+ * @param {number} [mode]
156
+ * @returns {Promise<void>}
157
+ */
158
+ function ensureCopyFileAsync(src, dest, mode) {
159
+ ensureDirectory(path.dirname(dest));
160
+ return fs.promises.copyFile(src, dest, mode);
161
+ }
162
+
163
+ /**
164
+ * Deletes a file (If the file exists).
165
+ * @param {string} filePath
166
+ * @returns {Promise<boolean>}
167
+ */
168
+ async function tryDeleteFileAsync(filePath) {
169
+ if (fileExists(filePath)) {
170
+ await fs.promises.unlink(filePath);
171
+ return true;
172
+ }
173
+ return false;
174
+ }
175
+
176
+ /*========================*
177
+ * Text Operations
178
+ *========================*/
179
+
180
+ /**
181
+ * Writes text to a file (Ensures that the directory exists, creating it recursively if needed).
182
+ * @param {string} filePath
183
+ * @param {string} content
184
+ * @param {fs.WriteFileOptions} [ops='utf-8']
185
+ */
186
+ function writeTextFile(filePath, content, ops = 'utf-8') {
187
+ const dir = path.dirname(filePath);
188
+ ensureDirectory(dir);
189
+ fs.writeFileSync(filePath, content, ops);
190
+ }
191
+
192
+ /**
193
+ * Writes text to a file (Ensures that the directory exists, creating it recursively if needed).
194
+ * @param {string} filePath
195
+ * @param {string} content
196
+ * @param {fs.WriteFileOptions} [ops='utf-8']
197
+ * @returns {Promise<void>}
198
+ */
199
+ function writeTextFileAsync(filePath, content, ops = 'utf-8') {
200
+ const dir = path.dirname(filePath);
201
+ ensureDirectory(dir);
202
+ return fs.promises.writeFile(filePath, content, ops);
203
+ }
204
+
205
+ /*========================*
206
+ * Directory Listings
207
+ *========================*/
208
+
209
+ /**
210
+ * Lists all files and dirs in a directory (optionally recursive).
211
+ * @param {string} dirPath
212
+ * @param {boolean} [recursive=false]
213
+ * @returns {{ files: string[]; dirs: string[] }}
214
+ */
215
+ function listFiles(dirPath, recursive = false) {
216
+ /** @type {{ files: string[]; dirs: string[] }} */
217
+ const results = { files: [], dirs: [] };
218
+ if (!dirExists(dirPath)) return results;
219
+
220
+ const entries = fs.readdirSync(dirPath);
221
+ for (const entry of entries) {
222
+ const fullPath = path.join(dirPath, entry);
223
+ const stat = fs.lstatSync(fullPath);
224
+ if (stat.isDirectory()) {
225
+ results.dirs.push(fullPath);
226
+ if (recursive) {
227
+ const results2 = listFiles(fullPath, true);
228
+ results.files.push(...results2.files);
229
+ results.dirs.push(...results2.dirs);
230
+ }
231
+ } else {
232
+ results.files.push(fullPath);
233
+ }
234
+ }
235
+ return results;
236
+ }
237
+
238
+ /**
239
+ * Lists all directories in a directory (optionally recursive).
240
+ * @param {string} dirPath
241
+ * @param {boolean} [recursive=false]
242
+ * @returns {string[]}
243
+ */
244
+ function listDirs(dirPath, recursive = false) {
245
+ /** @type {string[]} */
246
+ const results = [];
247
+ if (!dirExists(dirPath)) return results;
248
+
249
+ const entries = fs.readdirSync(dirPath);
250
+ for (const entry of entries) {
251
+ const fullPath = path.join(dirPath, entry);
252
+ const stat = fs.lstatSync(fullPath);
253
+ if (stat.isDirectory()) {
254
+ results.push(fullPath);
255
+ if (recursive) {
256
+ results.push(...listDirs(fullPath, true));
257
+ }
258
+ }
259
+ }
260
+ return results;
261
+ }
262
+
263
+ /*========================*
264
+ * File Info
265
+ *========================*/
266
+
267
+ /**
268
+ * Returns the size of a file in bytes.
269
+ * @param {string} filePath
270
+ * @returns {number}
271
+ */
272
+ function fileSize(filePath) {
273
+ if (!fileExists(filePath)) return 0;
274
+ const stats = fs.statSync(filePath);
275
+ return stats.size;
276
+ }
277
+
278
+ /**
279
+ * Returns the total size of a directory in bytes.
280
+ * @param {string} dirPath
281
+ * @returns {number}
282
+ */
283
+ function dirSize(dirPath) {
284
+ let total = 0;
285
+ const files = listFiles(dirPath, true).files;
286
+ for (const file of files) {
287
+ total += fileSize(file);
288
+ }
289
+ return total;
290
+ }
291
+
292
+ /*========================*
293
+ * Backup Utilities
294
+ *========================*/
295
+
296
+ /**
297
+ * Creates a backup copy of a file with .bak timestamp suffix.
298
+ * @param {string} filePath
299
+ * @param {string} [ext='bak']
300
+ */
301
+ function backupFile(filePath, ext = 'bak') {
302
+ if (!fileExists(filePath)) return;
303
+ const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
304
+ const backupPath = `${filePath}.${ext}.${timestamp}`;
305
+ ensureCopyFile(filePath, backupPath);
306
+ }
307
+
308
+ /**
309
+ * Returns the most recent backup file path for a given file.
310
+ * @param {string} filePath
311
+ * @param {string} [ext='bak']
312
+ * @returns {string} Full path to the most recent backup
313
+ */
314
+ function getLatestBackupPath(filePath, ext = 'bak') {
315
+ const dir = path.dirname(filePath);
316
+ const baseName = path.basename(filePath);
317
+ const backups = fs
318
+ .readdirSync(dir)
319
+ .filter((name) => name.startsWith(`${baseName}.${ext}.`))
320
+ .sort()
321
+ .reverse();
322
+
323
+ if (backups.length === 0) throw new Error(`No backups found for ${filePath}`);
324
+
325
+ return path.join(dir, backups[0]);
326
+ }
327
+
328
+ /**
329
+ * Restores the most recent backup of a file.
330
+ * @param {string} filePath
331
+ * @param {string} [ext='bak']
332
+ */
333
+ function restoreLatestBackup(filePath, ext = 'bak') {
334
+ const latestBackup = getLatestBackupPath(filePath, ext);
335
+ ensureCopyFile(latestBackup, filePath);
336
+ }
337
+
338
+ /**
339
+ * Restores the most recent backup of a file.
340
+ * @param {string} filePath
341
+ * @param {string} [ext='bak']
342
+ * @returns {Promise<void>}
343
+ */
344
+ function restoreLatestBackupAsync(filePath, ext = 'bak') {
345
+ const latestBackup = getLatestBackupPath(filePath, ext);
346
+ return ensureCopyFileAsync(latestBackup, filePath);
347
+ }
348
+
349
+ /**
350
+ * Creates a backup copy of a file with .bak timestamp suffix.
351
+ * @param {string} filePath
352
+ * @param {string} [ext='bak']
353
+ * @returns {Promise<void>}
354
+ */
355
+ async function backupFileAsync(filePath, ext = 'bak') {
356
+ if (!fileExists(filePath)) return;
357
+ const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
358
+ const backupPath = `${filePath}.${ext}.${timestamp}`;
359
+ return ensureCopyFileAsync(filePath, backupPath);
360
+ }
361
+
362
+ /*========================*
363
+ * Rename Utilities
364
+ *========================*/
365
+
366
+ /**
367
+ * Renames multiple files in a directory using a rename function.
368
+ * @param {string} dirPath - The target directory.
369
+ * @param {(original: string, index: number) => string} renameFn - Function that returns new filename.
370
+ * @param {string[]} [extensions] - Optional: Only rename files with these extensions.
371
+ *
372
+ * @throws {TypeError} If any argument has an invalid type.
373
+ * @throws {Error} If the directory does not exist or contains invalid files.
374
+ */
375
+ function renameFileBatch(dirPath, renameFn, extensions = []) {
376
+ // Validate types
377
+ if (typeof dirPath !== 'string') throw new TypeError('dirPath must be a string');
378
+ if (typeof renameFn !== 'function') throw new TypeError('renameFn must be a function');
379
+ if (!Array.isArray(extensions)) throw new TypeError('extensions must be an array of strings');
380
+ if (!fs.existsSync(dirPath) || !fs.statSync(dirPath).isDirectory())
381
+ throw new Error(`Directory not found or invalid: ${dirPath}`);
382
+ for (const ext of extensions) {
383
+ if (typeof ext !== 'string' || !ext.startsWith('.'))
384
+ throw new TypeError(`Invalid extension: ${ext}`);
385
+ }
386
+
387
+ const files = listFiles(dirPath).files;
388
+ let index = 0;
389
+
390
+ for (const file of files) {
391
+ const ext = path.extname(file);
392
+ if (extensions.length && !extensions.includes(ext)) continue;
393
+
394
+ const originalName = path.basename(file);
395
+ const newName = renameFn(originalName, index++);
396
+ const newPath = path.join(dirPath, newName);
397
+
398
+ if (originalName === newName) continue;
399
+
400
+ fs.renameSync(file, newPath);
401
+ }
402
+ }
403
+
404
+ /**
405
+ * Renames files using regex replacement.
406
+ * @param {string} dirPath
407
+ * @param {RegExp} pattern - Regex to match in the filename.
408
+ * @param {string} replacement - Replacement string.
409
+ * @param {string[]} [extensions]
410
+ */
411
+ function renameFileRegex(dirPath, pattern, replacement, extensions = []) {
412
+ renameFileBatch(
413
+ dirPath,
414
+ (filename) => {
415
+ const ext = path.extname(filename);
416
+ const name = path.basename(filename, ext).replace(pattern, replacement);
417
+ return `${name}${ext}`;
418
+ },
419
+ extensions,
420
+ );
421
+ }
422
+
423
+ /**
424
+ * Adds a prefix or suffix to filenames.
425
+ * @param {string} dirPath
426
+ * @param {{ prefix?: string, suffix?: string }} options
427
+ * @param {string[]} [extensions]
428
+ */
429
+ function renameFileAddPrefixSuffix(dirPath, { prefix = '', suffix = '' }, extensions = []) {
430
+ renameFileBatch(
431
+ dirPath,
432
+ (filename) => {
433
+ const ext = path.extname(filename);
434
+ const name = path.basename(filename, ext);
435
+ return `${prefix}${name}${suffix}${ext}`;
436
+ },
437
+ extensions,
438
+ );
439
+ }
440
+
441
+ /**
442
+ * Normalizes all filenames to lowercase (or uppercase).
443
+ * @param {string} dirPath
444
+ * @param {'lower' | 'upper' | 'title'} mode
445
+ * @param {string[]} [extensions]
446
+ * @param {boolean} [normalizeExt=false] - Whether to apply case change to file extensions too.
447
+ * @throws {Error} If mode is invalid.
448
+ */
449
+ function renameFileNormalizeCase(
450
+ dirPath,
451
+ mode = 'lower',
452
+ extensions = [],
453
+ normalizeExt = false,
454
+ ) {
455
+ if (typeof mode !== 'string' || !['lower', 'upper', 'title'].includes(mode))
456
+ throw new Error(`Invalid mode "${mode}". Must be 'lower', 'upper' or 'title'.`);
457
+ renameFileBatch(
458
+ dirPath,
459
+ (filename) => {
460
+ /**
461
+ * @param {string} text
462
+ * @returns {string}
463
+ */
464
+ const changeToMode = (text$1) => {
465
+ if (mode === 'lower') return text$1.toLowerCase();
466
+ else if (mode === 'upper') return text$1.toUpperCase();
467
+ else if (mode === 'title') return text.toTitleCase(text$1);
468
+ else return text$1;
469
+ };
470
+
471
+ const rawExt = path.extname(filename);
472
+ const ext = normalizeExt ? changeToMode(rawExt) : rawExt;
473
+ const name = changeToMode(path.basename(filename, rawExt));
474
+ return `${name}${ext}`;
475
+ },
476
+ extensions,
477
+ );
478
+ }
479
+
480
+ /**
481
+ * Pads numbers in filenames (e.g., "img1.jpg" -> "img001.jpg").
482
+ * @param {string} dirPath
483
+ * @param {number} totalDigits
484
+ * @param {string[]} [extensions]
485
+ */
486
+ function renameFilePadNumbers(dirPath, totalDigits = 3, extensions = []) {
487
+ renameFileBatch(
488
+ dirPath,
489
+ (filename) => {
490
+ return filename.replace(/\d+/, (match) => match.padStart(totalDigits, '0'));
491
+ },
492
+ extensions,
493
+ );
494
+ }
495
+
496
+ exports.backupFile = backupFile;
497
+ exports.backupFileAsync = backupFileAsync;
498
+ exports.clearDirectory = clearDirectory;
499
+ exports.dirExists = dirExists;
500
+ exports.dirSize = dirSize;
501
+ exports.ensureCopyFile = ensureCopyFile;
502
+ exports.ensureCopyFileAsync = ensureCopyFileAsync;
503
+ exports.ensureDirectory = ensureDirectory;
504
+ exports.fileExists = fileExists;
505
+ exports.fileSize = fileSize;
506
+ exports.getLatestBackupPath = getLatestBackupPath;
507
+ exports.isDirEmpty = isDirEmpty;
508
+ exports.listDirs = listDirs;
509
+ exports.listFiles = listFiles;
510
+ exports.readJsonFile = readJsonFile;
511
+ exports.readJsonFileAsync = readJsonFileAsync;
512
+ exports.renameFileAddPrefixSuffix = renameFileAddPrefixSuffix;
513
+ exports.renameFileBatch = renameFileBatch;
514
+ exports.renameFileNormalizeCase = renameFileNormalizeCase;
515
+ exports.renameFilePadNumbers = renameFilePadNumbers;
516
+ exports.renameFileRegex = renameFileRegex;
517
+ exports.restoreLatestBackup = restoreLatestBackup;
518
+ exports.restoreLatestBackupAsync = restoreLatestBackupAsync;
519
+ exports.tryDeleteFile = tryDeleteFile;
520
+ exports.tryDeleteFileAsync = tryDeleteFileAsync;
521
+ exports.writeJsonFile = writeJsonFile;
522
+ exports.writeJsonFileAsync = writeJsonFileAsync;
523
+ exports.writeTextFile = writeTextFile;
524
+ exports.writeTextFileAsync = writeTextFileAsync;