dealposbarcode 1.7.5 → 1.7.7
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/{chunk-Y5EY5UIK.js → chunk-2OROAZGC.js} +2 -2
- package/chunk-BPIOBSOO.js +107 -0
- package/{chunk-UZEILQYY.js → chunk-E7PAZX2X.js} +4 -4
- package/{chunk-OLUJFK3F.js → chunk-FV2VOMW2.js} +1 -1
- package/{chunk-2LPJCMSD.js → chunk-YO345NRT.js} +5 -5
- package/{chunk-XUGOIZTN.js → chunk-Z6BWK6U7.js} +1 -1
- package/{chunk-CJ4KUC66.js → chunk-Z7F4NWFT.js} +1 -1
- package/{chunk-TWSIJYU7.js → chunk-ZWVPAUAD.js} +1 -1
- package/index.html +2 -2
- package/main-T2IUPIYV.js +605 -0
- package/ngsw.json +20 -20
- package/package.json +1 -1
- package/chunk-SN5WIPTW.js +0 -107
- package/main-VST7RWDX.js +0 -605
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import{A as $p,B as Ma,C as qp,D as Gp,E as El,F as Xp,G as Yp,a as Sp,b as Da,d as Ia,e as Mr,f as _l,g as Bp,h as Np,i as Ii,j as zp,k as Ar,l as wl,m as xl,n as We,o as Lp,p as Oa,q as ke,r as Fa,s as Hp,t as jp,u as Sl,v as Ra,w as Vp,x as Pl,y as Up,z as Wp}from"./chunk-2OROAZGC.js";import{a as Aa,b as _i,c as oi}from"./chunk-FV2VOMW2.js";import{B as nt,C as Dt,D as ya,E as va,F as ba,G as Yi,H as ht,I as rt,J as $n,K as _a,L as wa,M as xa,N as Ca,O as Sa,P as Pa,R as Ep,S as Dp,T as kp,U as Tp,V as Ip,W as Ea,X as Op,Z as Fp,_ as Ta,a as vi,b as xp,ba as bi,d as Cp,ga as Cl,l as ma,n as Un,q as vl,r as Je,s as pt,t as Pp,u as Wn,v as tt,w as lt,y as it,z as ga}from"./chunk-YO345NRT.js";import{$b as la,Aa as Ir,Ac as Ae,Bb as Or,Bd as Rp,C as Le,Ca as pe,Cd as ka,D as ap,Da as z,Db as hp,Dd as Mp,Ec as je,Fb as na,Fc as jt,Fd as Rr,Gb as ra,Gc as Ti,Gd as Ap,H as mi,Ha as fe,Hc as gl,I as Zt,Ia as Nt,Ic as me,Id as bl,J as ea,Ja as ln,Jb as q,Ka as ta,Kb as pl,Mb as Fr,N as sp,O as rl,Oa as up,P as an,Pb as le,Pc as mp,Qb as fp,Ra as gi,Rb as oa,S as sn,Sa as ae,Sb as Lt,Sc as cn,Ta as se,Tb as P,U as Jt,Uc as Gi,Vb as jn,Wa as Xe,Wb as aa,Xa as Ye,Xc as gp,Y as ol,Yc as yl,Z as Tr,Za as zt,Zb as Ce,_a as Pt,_b as sa,a as v,aa as lp,ab as ul,ac as ei,b as D,bb as Et,bc as ti,c as Ln,ca as al,cc as f,cd as mt,d as j,dc as m,e as De,ea as cp,ec as ue,fa as sl,fc as hl,g as B,gc as fl,h as Hn,hb as pp,hd as ha,i as Qo,ic as Ie,j as Zo,jd as Xi,k as Jo,l as $i,lc as W,ld as Vn,mc as O,md as yp,n as St,nc as ca,oa as ll,oc as da,od as vp,pd as bp,q as et,qa as cl,qc as ua,qd as _p,ra as qi,rc as yi,rd as fa,sa as dl,sc as ii,sd as wp,ta as xe,tc as ni,td as ri,ub as ia,uc as ml,vc as x,wa as dp,wc as I,xa as Ue,xc as Ht,ya as Bt,yb as y,yc as pa,zb as He,zc as _e}from"./chunk-E7PAZX2X.js";var Vt=j(Dl=>{"use strict";Object.defineProperty(Dl,"__esModule",{value:!0});function Hy(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}var jy=function i(e,t){Hy(this,i),this.data=e,this.text=t.text||e,this.options=t};Dl.default=jy});var Zp=j(Ba=>{"use strict";Object.defineProperty(Ba,"__esModule",{value:!0});Ba.CODE39=void 0;var Vy=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),Uy=Vt(),Wy=$y(Uy);function $y(i){return i&&i.__esModule?i:{default:i}}function qy(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Gy(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function Xy(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var Yy=function(i){Xy(e,i);function e(t,n){return qy(this,e),t=t.toUpperCase(),n.mod43&&(t+=Zy(Jy(t))),Gy(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return Vy(e,[{key:"encode",value:function(){for(var n=kl("*"),r=0;r<this.data.length;r++)n+=kl(this.data[r])+"0";return n+=kl("*"),{data:n,text:this.text}}},{key:"valid",value:function(){return this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)!==-1}}]),e}(Wy.default),Kp=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","-","."," ","$","/","+","%","*"],Ky=[20957,29783,23639,30485,20951,29813,23669,20855,29789,23645,29975,23831,30533,22295,30149,24005,21623,29981,23837,22301,30023,23879,30545,22343,30161,24017,21959,30065,23921,22385,29015,18263,29141,17879,29045,18293,17783,29021,18269,17477,17489,17681,20753,35770];function kl(i){return Qy(Qp(i))}function Qy(i){return Ky[i].toString(2)}function Zy(i){return Kp[i]}function Qp(i){return Kp.indexOf(i)}function Jy(i){for(var e=0,t=0;t<i.length;t++)e+=Qp(i[t]);return e=e%43,e}Ba.CODE39=Yy});var qn=j($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});var Br;function Tl(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}var Jp=$e.SET_A=0,eh=$e.SET_B=1,th=$e.SET_C=2,Sk=$e.SHIFT=98,ev=$e.START_A=103,tv=$e.START_B=104,iv=$e.START_C=105,Pk=$e.MODULO=103,Ek=$e.STOP=106,Dk=$e.FNC1=207,kk=$e.SET_BY_CODE=(Br={},Tl(Br,ev,Jp),Tl(Br,tv,eh),Tl(Br,iv,th),Br),Tk=$e.SWAP={101:Jp,100:eh,99:th},Ik=$e.A_START_CHAR="\xD0",Ok=$e.B_START_CHAR="\xD1",Fk=$e.C_START_CHAR="\xD2",Rk=$e.A_CHARS="[\0-_\xC8-\xCF]",Mk=$e.B_CHARS="[ -\x7F\xC8-\xCF]",Ak=$e.C_CHARS="(\xCF*[0-9]{2}\xCF*)",Bk=$e.BARS=[11011001100,11001101100,11001100110,10010011e3,10010001100,10001001100,10011001e3,10011000100,10001100100,11001001e3,11001000100,11000100100,10110011100,10011011100,10011001110,10111001100,10011101100,10011100110,11001110010,11001011100,11001001110,11011100100,11001110100,11101101110,11101001100,11100101100,11100100110,11101100100,11100110100,11100110010,11011011e3,11011000110,11000110110,10100011e3,10001011e3,10001000110,10110001e3,10001101e3,10001100010,11010001e3,11000101e3,11000100010,10110111e3,10110001110,10001101110,10111011e3,10111000110,10001110110,11101110110,11010001110,11000101110,11011101e3,11011100010,11011101110,11101011e3,11101000110,11100010110,11101101e3,11101100010,11100011010,11101111010,11001000010,11110001010,1010011e4,10100001100,1001011e4,10010000110,10000101100,10000100110,1011001e4,10110000100,1001101e4,10011000010,10000110100,10000110010,11000010010,1100101e4,11110111010,11000010100,10001111010,10100111100,10010111100,10010011110,10111100100,10011110100,10011110010,11110100100,11110010100,11110010010,11011011110,11011110110,11110110110,10101111e3,10100011110,10001011110,10111101e3,10111100010,11110101e3,11110100010,10111011110,10111101110,11101011110,11110101110,11010000100,1101001e4,11010011100,1100011101011]});var Nr=j(Il=>{"use strict";Object.defineProperty(Il,"__esModule",{value:!0});var nv=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),rv=Vt(),ov=av(rv),Ut=qn();function av(i){return i&&i.__esModule?i:{default:i}}function sv(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function lv(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function cv(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var dv=function(i){cv(e,i);function e(t,n){sv(this,e);var r=lv(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t.substring(1),n));return r.bytes=t.split("").map(function(o){return o.charCodeAt(0)}),r}return nv(e,[{key:"valid",value:function(){return/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}},{key:"encode",value:function(){var n=this.bytes,r=n.shift()-105,o=Ut.SET_BY_CODE[r];if(o===void 0)throw new RangeError("The encoding does not start with a start character.");this.shouldEncodeAsEan128()===!0&&n.unshift(Ut.FNC1);var a=e.next(n,1,o);return{text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:e.getBar(r)+a.result+e.getBar((a.checksum+r)%Ut.MODULO)+e.getBar(Ut.STOP)}}},{key:"shouldEncodeAsEan128",value:function(){var n=this.options.ean128||!1;return typeof n=="string"&&(n=n.toLowerCase()==="true"),n}}],[{key:"getBar",value:function(n){return Ut.BARS[n]?Ut.BARS[n].toString():""}},{key:"correctIndex",value:function(n,r){if(r===Ut.SET_A){var o=n.shift();return o<32?o+64:o-32}else return r===Ut.SET_B?n.shift()-32:(n.shift()-48)*10+n.shift()-48}},{key:"next",value:function(n,r,o){if(!n.length)return{result:"",checksum:0};var a=void 0,s=void 0;if(n[0]>=200){s=n.shift()-105;var l=Ut.SWAP[s];l!==void 0?a=e.next(n,r+1,l):((o===Ut.SET_A||o===Ut.SET_B)&&s===Ut.SHIFT&&(n[0]=o===Ut.SET_A?n[0]>95?n[0]-96:n[0]:n[0]<32?n[0]+96:n[0]),a=e.next(n,r+1,o))}else s=e.correctIndex(n,o),a=e.next(n,r+1,o);var c=e.getBar(s),d=s*r;return{result:c+a.result,checksum:d+a.checksum}}}]),e}(ov.default);Il.default=dv});var ah=j(Fl=>{"use strict";Object.defineProperty(Fl,"__esModule",{value:!0});var Ki=qn(),ih=function(e){return e.match(new RegExp("^"+Ki.A_CHARS+"*"))[0].length},nh=function(e){return e.match(new RegExp("^"+Ki.B_CHARS+"*"))[0].length},rh=function(e){return e.match(new RegExp("^"+Ki.C_CHARS+"*"))[0]};function Ol(i,e){var t=e?Ki.A_CHARS:Ki.B_CHARS,n=i.match(new RegExp("^("+t+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(n)return n[1]+"\xCC"+oh(i.substring(n[1].length));var r=i.match(new RegExp("^"+t+"+"))[0];return r.length===i.length?i:r+String.fromCharCode(e?205:206)+Ol(i.substring(r.length),!e)}function oh(i){var e=rh(i),t=e.length;if(t===i.length)return i;i=i.substring(t);var n=ih(i)>=nh(i);return e+String.fromCharCode(n?206:205)+Ol(i,n)}Fl.default=function(i){var e=void 0,t=rh(i).length;if(t>=2)e=Ki.C_START_CHAR+oh(i);else{var n=ih(i)>nh(i);e=(n?Ki.A_START_CHAR:Ki.B_START_CHAR)+Ol(i,n)}return e.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(r,o){return"\xCB"+o})}});var lh=j(Ml=>{"use strict";Object.defineProperty(Ml,"__esModule",{value:!0});var uv=Nr(),pv=sh(uv),hv=ah(),fv=sh(hv);function sh(i){return i&&i.__esModule?i:{default:i}}function mv(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Rl(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function gv(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var yv=function(i){gv(e,i);function e(t,n){if(mv(this,e),/^[\x00-\x7F\xC8-\xD3]+$/.test(t))var r=Rl(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,(0,fv.default)(t),n));else var r=Rl(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return Rl(r)}return e}(pv.default);Ml.default=yv});var dh=j(Al=>{"use strict";Object.defineProperty(Al,"__esModule",{value:!0});var vv=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),bv=Nr(),_v=wv(bv),ch=qn();function wv(i){return i&&i.__esModule?i:{default:i}}function xv(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Cv(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function Sv(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var Pv=function(i){Sv(e,i);function e(t,n){return xv(this,e),Cv(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,ch.A_START_CHAR+t,n))}return vv(e,[{key:"valid",value:function(){return new RegExp("^"+ch.A_CHARS+"+$").test(this.data)}}]),e}(_v.default);Al.default=Pv});var ph=j(Bl=>{"use strict";Object.defineProperty(Bl,"__esModule",{value:!0});var Ev=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),Dv=Nr(),kv=Tv(Dv),uh=qn();function Tv(i){return i&&i.__esModule?i:{default:i}}function Iv(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Ov(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function Fv(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var Rv=function(i){Fv(e,i);function e(t,n){return Iv(this,e),Ov(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,uh.B_START_CHAR+t,n))}return Ev(e,[{key:"valid",value:function(){return new RegExp("^"+uh.B_CHARS+"+$").test(this.data)}}]),e}(kv.default);Bl.default=Rv});var fh=j(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});var Mv=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),Av=Nr(),Bv=Nv(Av),hh=qn();function Nv(i){return i&&i.__esModule?i:{default:i}}function zv(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Lv(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function Hv(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var jv=function(i){Hv(e,i);function e(t,n){return zv(this,e),Lv(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,hh.C_START_CHAR+t,n))}return Mv(e,[{key:"valid",value:function(){return new RegExp("^"+hh.C_CHARS+"+$").test(this.data)}}]),e}(Bv.default);Nl.default=jv});var mh=j(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.CODE128C=wi.CODE128B=wi.CODE128A=wi.CODE128=void 0;var Vv=lh(),Uv=Na(Vv),Wv=dh(),$v=Na(Wv),qv=ph(),Gv=Na(qv),Xv=fh(),Yv=Na(Xv);function Na(i){return i&&i.__esModule?i:{default:i}}wi.CODE128=Uv.default;wi.CODE128A=$v.default;wi.CODE128B=Gv.default;wi.CODE128C=Yv.default});var Gn=j(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});var $k=Qi.SIDE_BIN="101",qk=Qi.MIDDLE_BIN="01010",Gk=Qi.BINARIES={L:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],G:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],R:["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"],O:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],E:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"]},Xk=Qi.EAN2_STRUCTURE=["LL","LG","GL","GG"],Yk=Qi.EAN5_STRUCTURE=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"],Kk=Qi.EAN13_STRUCTURE=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"]});var Xn=j(zl=>{"use strict";Object.defineProperty(zl,"__esModule",{value:!0});var Kv=Gn(),Qv=function(e,t,n){var r=e.split("").map(function(a,s){return Kv.BINARIES[t[s]]}).map(function(a,s){return a?a[e[s]]:""});if(n){var o=e.length-1;r=r.map(function(a,s){return s<o?a+n:a})}return r.join("")};zl.default=Qv});var Hl=j(Ll=>{"use strict";Object.defineProperty(Ll,"__esModule",{value:!0});var Zv=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),Yn=Gn(),Jv=Xn(),gh=yh(Jv),eb=Vt(),tb=yh(eb);function yh(i){return i&&i.__esModule?i:{default:i}}function ib(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function nb(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function rb(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var ob=function(i){rb(e,i);function e(t,n){ib(this,e);var r=nb(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.fontSize=!n.flat&&n.fontSize>n.width*10?n.width*10:n.fontSize,r.guardHeight=n.height+r.fontSize/2+n.textMargin,r}return Zv(e,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(n,r){return this.text.substr(n,r)}},{key:"leftEncode",value:function(n,r){return(0,gh.default)(n,r)}},{key:"rightText",value:function(n,r){return this.text.substr(n,r)}},{key:"rightEncode",value:function(n,r){return(0,gh.default)(n,r)}},{key:"encodeGuarded",value:function(){var n={fontSize:this.fontSize},r={height:this.guardHeight};return[{data:Yn.SIDE_BIN,options:r},{data:this.leftEncode(),text:this.leftText(),options:n},{data:Yn.MIDDLE_BIN,options:r},{data:this.rightEncode(),text:this.rightText(),options:n},{data:Yn.SIDE_BIN,options:r}]}},{key:"encodeFlat",value:function(){var n=[Yn.SIDE_BIN,this.leftEncode(),Yn.MIDDLE_BIN,this.rightEncode(),Yn.SIDE_BIN];return{data:n.join(""),text:this.text}}}]),e}(tb.default);Ll.default=ob});var bh=j(jl=>{"use strict";Object.defineProperty(jl,"__esModule",{value:!0});var ab=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),zr=function i(e,t,n){e===null&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,t);if(r===void 0){var o=Object.getPrototypeOf(e);return o===null?void 0:i(o,t,n)}else{if("value"in r)return r.value;var a=r.get;return a===void 0?void 0:a.call(n)}},sb=Gn(),lb=Hl(),cb=db(lb);function db(i){return i&&i.__esModule?i:{default:i}}function ub(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function pb(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function hb(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var vh=function(e){var t=e.substr(0,12).split("").map(function(n){return+n}).reduce(function(n,r,o){return o%2?n+r*3:n+r},0);return(10-t%10)%10},fb=function(i){hb(e,i);function e(t,n){ub(this,e),t.search(/^[0-9]{12}$/)!==-1&&(t+=vh(t));var r=pb(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.lastChar=n.lastChar,r}return ab(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{13}$/)!==-1&&+this.data[12]===vh(this.data)}},{key:"leftText",value:function(){return zr(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftText",this).call(this,1,6)}},{key:"leftEncode",value:function(){var n=this.data.substr(1,6),r=sb.EAN13_STRUCTURE[this.data[0]];return zr(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftEncode",this).call(this,n,r)}},{key:"rightText",value:function(){return zr(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightText",this).call(this,7,6)}},{key:"rightEncode",value:function(){var n=this.data.substr(7,6);return zr(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightEncode",this).call(this,n,"RRRRRR")}},{key:"encodeGuarded",value:function(){var n=zr(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"encodeGuarded",this).call(this);return this.options.displayValue&&(n.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),this.options.lastChar&&(n.push({data:"00"}),n.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}}))),n}}]),e}(cb.default);jl.default=fb});var wh=j(Vl=>{"use strict";Object.defineProperty(Vl,"__esModule",{value:!0});var mb=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),za=function i(e,t,n){e===null&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,t);if(r===void 0){var o=Object.getPrototypeOf(e);return o===null?void 0:i(o,t,n)}else{if("value"in r)return r.value;var a=r.get;return a===void 0?void 0:a.call(n)}},gb=Hl(),yb=vb(gb);function vb(i){return i&&i.__esModule?i:{default:i}}function bb(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function _b(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function wb(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var _h=function(e){var t=e.substr(0,7).split("").map(function(n){return+n}).reduce(function(n,r,o){return o%2?n+r:n+r*3},0);return(10-t%10)%10},xb=function(i){wb(e,i);function e(t,n){return bb(this,e),t.search(/^[0-9]{7}$/)!==-1&&(t+=_h(t)),_b(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return mb(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{8}$/)!==-1&&+this.data[7]===_h(this.data)}},{key:"leftText",value:function(){return za(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftText",this).call(this,0,4)}},{key:"leftEncode",value:function(){var n=this.data.substr(0,4);return za(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftEncode",this).call(this,n,"LLLL")}},{key:"rightText",value:function(){return za(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightText",this).call(this,4,4)}},{key:"rightEncode",value:function(){var n=this.data.substr(4,4);return za(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightEncode",this).call(this,n,"RRRR")}}]),e}(yb.default);Vl.default=xb});var Ch=j(Ul=>{"use strict";Object.defineProperty(Ul,"__esModule",{value:!0});var Cb=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),Sb=Gn(),Pb=Xn(),Eb=xh(Pb),Db=Vt(),kb=xh(Db);function xh(i){return i&&i.__esModule?i:{default:i}}function Tb(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Ib(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function Ob(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var Fb=function(e){var t=e.split("").map(function(n){return+n}).reduce(function(n,r,o){return o%2?n+r*9:n+r*3},0);return t%10},Rb=function(i){Ob(e,i);function e(t,n){return Tb(this,e),Ib(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return Cb(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{5}$/)!==-1}},{key:"encode",value:function(){var n=Sb.EAN5_STRUCTURE[Fb(this.data)];return{data:"1011"+(0,Eb.default)(this.data,n,"01"),text:this.text}}}]),e}(kb.default);Ul.default=Rb});var Ph=j(Wl=>{"use strict";Object.defineProperty(Wl,"__esModule",{value:!0});var Mb=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),Ab=Gn(),Bb=Xn(),Nb=Sh(Bb),zb=Vt(),Lb=Sh(zb);function Sh(i){return i&&i.__esModule?i:{default:i}}function Hb(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function jb(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function Vb(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var Ub=function(i){Vb(e,i);function e(t,n){return Hb(this,e),jb(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return Mb(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{2}$/)!==-1}},{key:"encode",value:function(){var n=Ab.EAN2_STRUCTURE[parseInt(this.data)%4];return{data:"1011"+(0,Nb.default)(this.data,n,"01"),text:this.text}}}]),e}(Lb.default);Wl.default=Ub});var ql=j(La=>{"use strict";Object.defineProperty(La,"__esModule",{value:!0});var Wb=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}();La.checksum=$l;var $b=Xn(),Kn=Eh($b),qb=Vt(),Gb=Eh(qb);function Eh(i){return i&&i.__esModule?i:{default:i}}function Xb(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Yb(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function Kb(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var Qb=function(i){Kb(e,i);function e(t,n){Xb(this,e),t.search(/^[0-9]{11}$/)!==-1&&(t+=$l(t));var r=Yb(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.displayValue=n.displayValue,n.fontSize>n.width*10?r.fontSize=n.width*10:r.fontSize=n.fontSize,r.guardHeight=n.height+r.fontSize/2+n.textMargin,r}return Wb(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{12}$/)!==-1&&this.data[11]==$l(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var n="";return n+="101",n+=(0,Kn.default)(this.data.substr(0,6),"LLLLLL"),n+="01010",n+=(0,Kn.default)(this.data.substr(6,6),"RRRRRR"),n+="101",{data:n,text:this.text}}},{key:"guardedEncoding",value:function(){var n=[];return this.displayValue&&n.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),n.push({data:"101"+(0,Kn.default)(this.data[0],"L"),options:{height:this.guardHeight}}),n.push({data:(0,Kn.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),n.push({data:"01010",options:{height:this.guardHeight}}),n.push({data:(0,Kn.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),n.push({data:(0,Kn.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&n.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),n}}]),e}(Gb.default);function $l(i){var e=0,t;for(t=1;t<11;t+=2)e+=parseInt(i[t]);for(t=0;t<11;t+=2)e+=parseInt(i[t])*3;return(10-e%10)%10}La.default=Qb});var Th=j(Xl=>{"use strict";Object.defineProperty(Xl,"__esModule",{value:!0});var Zb=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),Jb=Xn(),e1=kh(Jb),t1=Vt(),i1=kh(t1),n1=ql();function kh(i){return i&&i.__esModule?i:{default:i}}function r1(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Gl(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function o1(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var a1=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],s1=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]],l1=function(i){o1(e,i);function e(t,n){r1(this,e);var r=Gl(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));if(r.isValid=!1,t.search(/^[0-9]{6}$/)!==-1)r.middleDigits=t,r.upcA=Dh(t,"0"),r.text=n.text||""+r.upcA[0]+t+r.upcA[r.upcA.length-1],r.isValid=!0;else if(t.search(/^[01][0-9]{7}$/)!==-1)if(r.middleDigits=t.substring(1,t.length-1),r.upcA=Dh(r.middleDigits,t[0]),r.upcA[r.upcA.length-1]===t[t.length-1])r.isValid=!0;else return Gl(r);else return Gl(r);return r.displayValue=n.displayValue,n.fontSize>n.width*10?r.fontSize=n.width*10:r.fontSize=n.fontSize,r.guardHeight=n.height+r.fontSize/2+n.textMargin,r}return Zb(e,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var n="";return n+="101",n+=this.encodeMiddleDigits(),n+="010101",{data:n,text:this.text}}},{key:"guardedEncoding",value:function(){var n=[];return this.displayValue&&n.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),n.push({data:"101",options:{height:this.guardHeight}}),n.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),n.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&n.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),n}},{key:"encodeMiddleDigits",value:function(){var n=this.upcA[0],r=this.upcA[this.upcA.length-1],o=s1[parseInt(r)][parseInt(n)];return(0,e1.default)(this.middleDigits,o)}}]),e}(i1.default);function Dh(i,e){for(var t=parseInt(i[i.length-1]),n=a1[t],r="",o=0,a=0;a<n.length;a++){var s=n[a];s==="X"?r+=i[o++]:r+=s}return r=""+e+r,""+r+(0,n1.checksum)(r)}Xl.default=l1});var Ih=j(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.UPCE=kt.UPC=kt.EAN2=kt.EAN5=kt.EAN8=kt.EAN13=void 0;var c1=bh(),d1=Qn(c1),u1=wh(),p1=Qn(u1),h1=Ch(),f1=Qn(h1),m1=Ph(),g1=Qn(m1),y1=ql(),v1=Qn(y1),b1=Th(),_1=Qn(b1);function Qn(i){return i&&i.__esModule?i:{default:i}}kt.EAN13=d1.default;kt.EAN8=p1.default;kt.EAN5=f1.default;kt.EAN2=g1.default;kt.UPC=v1.default;kt.UPCE=_1.default});var Oh=j(Lr=>{"use strict";Object.defineProperty(Lr,"__esModule",{value:!0});var sT=Lr.START_BIN="1010",lT=Lr.END_BIN="11101",cT=Lr.BINARIES=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"]});var Kl=j(Yl=>{"use strict";Object.defineProperty(Yl,"__esModule",{value:!0});var w1=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),Ha=Oh(),x1=Vt(),C1=S1(x1);function S1(i){return i&&i.__esModule?i:{default:i}}function P1(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function E1(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function D1(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var k1=function(i){D1(e,i);function e(){return P1(this,e),E1(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return w1(e,[{key:"valid",value:function(){return this.data.search(/^([0-9]{2})+$/)!==-1}},{key:"encode",value:function(){var n=this,r=this.data.match(/.{2}/g).map(function(o){return n.encodePair(o)}).join("");return{data:Ha.START_BIN+r+Ha.END_BIN,text:this.text}}},{key:"encodePair",value:function(n){var r=Ha.BINARIES[n[1]];return Ha.BINARIES[n[0]].split("").map(function(o,a){return(o==="1"?"111":"1")+(r[a]==="1"?"000":"0")}).join("")}}]),e}(C1.default);Yl.default=k1});var Rh=j(Ql=>{"use strict";Object.defineProperty(Ql,"__esModule",{value:!0});var T1=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),I1=Kl(),O1=F1(I1);function F1(i){return i&&i.__esModule?i:{default:i}}function R1(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function M1(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function A1(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var Fh=function(e){var t=e.substr(0,13).split("").map(function(n){return parseInt(n,10)}).reduce(function(n,r,o){return n+r*(3-o%2*2)},0);return Math.ceil(t/10)*10-t},B1=function(i){A1(e,i);function e(t,n){return R1(this,e),t.search(/^[0-9]{13}$/)!==-1&&(t+=Fh(t)),M1(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return T1(e,[{key:"valid",value:function(){return this.data.search(/^[0-9]{14}$/)!==-1&&+this.data[13]===Fh(this.data)}}]),e}(O1.default);Ql.default=B1});var Ah=j(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.ITF14=Zn.ITF=void 0;var N1=Kl(),z1=Mh(N1),L1=Rh(),H1=Mh(L1);function Mh(i){return i&&i.__esModule?i:{default:i}}Zn.ITF=z1.default;Zn.ITF14=H1.default});var Jn=j(Zl=>{"use strict";Object.defineProperty(Zl,"__esModule",{value:!0});var j1=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),V1=Vt(),U1=W1(V1);function W1(i){return i&&i.__esModule?i:{default:i}}function $1(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function q1(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function G1(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var X1=function(i){G1(e,i);function e(t,n){return $1(this,e),q1(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return j1(e,[{key:"encode",value:function(){for(var n="110",r=0;r<this.data.length;r++){var o=parseInt(this.data[r]),a=o.toString(2);a=Y1(a,4-a.length);for(var s=0;s<a.length;s++)n+=a[s]=="0"?"100":"110"}return n+="1001",{data:n,text:this.text}}},{key:"valid",value:function(){return this.data.search(/^[0-9]+$/)!==-1}}]),e}(U1.default);function Y1(i,e){for(var t=0;t<e;t++)i="0"+i;return i}Zl.default=X1});var Hr=j(ja=>{"use strict";Object.defineProperty(ja,"__esModule",{value:!0});ja.mod10=K1;ja.mod11=Q1;function K1(i){for(var e=0,t=0;t<i.length;t++){var n=parseInt(i[t]);(t+i.length)%2===0?e+=n:e+=n*2%10+Math.floor(n*2/10)}return(10-e%10)%10}function Q1(i){for(var e=0,t=[2,3,4,5,6,7],n=0;n<i.length;n++){var r=parseInt(i[i.length-1-n]);e+=t[n%t.length]*r}return(11-e%11)%11}});var Bh=j(Jl=>{"use strict";Object.defineProperty(Jl,"__esModule",{value:!0});var Z1=Jn(),J1=t_(Z1),e_=Hr();function t_(i){return i&&i.__esModule?i:{default:i}}function i_(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function n_(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function r_(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var o_=function(i){r_(e,i);function e(t,n){return i_(this,e),n_(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t+(0,e_.mod10)(t),n))}return e}(J1.default);Jl.default=o_});var Nh=j(ec=>{"use strict";Object.defineProperty(ec,"__esModule",{value:!0});var a_=Jn(),s_=c_(a_),l_=Hr();function c_(i){return i&&i.__esModule?i:{default:i}}function d_(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function u_(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function p_(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var h_=function(i){p_(e,i);function e(t,n){return d_(this,e),u_(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t+(0,l_.mod11)(t),n))}return e}(s_.default);ec.default=h_});var Lh=j(tc=>{"use strict";Object.defineProperty(tc,"__esModule",{value:!0});var f_=Jn(),m_=g_(f_),zh=Hr();function g_(i){return i&&i.__esModule?i:{default:i}}function y_(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function v_(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function b_(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var __=function(i){b_(e,i);function e(t,n){return y_(this,e),t+=(0,zh.mod10)(t),t+=(0,zh.mod10)(t),v_(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return e}(m_.default);tc.default=__});var jh=j(ic=>{"use strict";Object.defineProperty(ic,"__esModule",{value:!0});var w_=Jn(),x_=C_(w_),Hh=Hr();function C_(i){return i&&i.__esModule?i:{default:i}}function S_(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function P_(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function E_(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var D_=function(i){E_(e,i);function e(t,n){return S_(this,e),t+=(0,Hh.mod11)(t),t+=(0,Hh.mod10)(t),P_(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return e}(x_.default);ic.default=D_});var Vh=j(ai=>{"use strict";Object.defineProperty(ai,"__esModule",{value:!0});ai.MSI1110=ai.MSI1010=ai.MSI11=ai.MSI10=ai.MSI=void 0;var k_=Jn(),T_=jr(k_),I_=Bh(),O_=jr(I_),F_=Nh(),R_=jr(F_),M_=Lh(),A_=jr(M_),B_=jh(),N_=jr(B_);function jr(i){return i&&i.__esModule?i:{default:i}}ai.MSI=T_.default;ai.MSI10=O_.default;ai.MSI11=R_.default;ai.MSI1010=A_.default;ai.MSI1110=N_.default});var Uh=j(Va=>{"use strict";Object.defineProperty(Va,"__esModule",{value:!0});Va.pharmacode=void 0;var z_=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),L_=Vt(),H_=j_(L_);function j_(i){return i&&i.__esModule?i:{default:i}}function V_(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function U_(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function W_(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var $_=function(i){W_(e,i);function e(t,n){V_(this,e);var r=U_(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.number=parseInt(t,10),r}return z_(e,[{key:"encode",value:function(){for(var n=this.number,r="";!isNaN(n)&&n!=0;)n%2===0?(r="11100"+r,n=(n-2)/2):(r="100"+r,n=(n-1)/2);return r=r.slice(0,-2),{data:r,text:this.text}}},{key:"valid",value:function(){return this.number>=3&&this.number<=131070}}]),e}(H_.default);Va.pharmacode=$_});var Wh=j(Ua=>{"use strict";Object.defineProperty(Ua,"__esModule",{value:!0});Ua.codabar=void 0;var q_=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),G_=Vt(),X_=Y_(G_);function Y_(i){return i&&i.__esModule?i:{default:i}}function K_(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Q_(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function Z_(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var J_=function(i){Z_(e,i);function e(t,n){K_(this,e),t.search(/^[0-9\-\$\:\.\+\/]+$/)===0&&(t="A"+t+"A");var r=Q_(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t.toUpperCase(),n));return r.text=r.options.text||r.text.replace(/[A-D]/g,""),r}return q_(e,[{key:"valid",value:function(){return this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)!==-1}},{key:"encode",value:function(){for(var n=[],r=this.getEncodings(),o=0;o<this.data.length;o++)n.push(r[this.data.charAt(o)]),o!==this.data.length-1&&n.push("0");return{text:this.text,data:n.join("")}}},{key:"getEncodings",value:function(){return{0:"101010011",1:"101011001",2:"101001011",3:"110010101",4:"101101001",5:"110101001",6:"100101011",7:"100101101",8:"100110101",9:"110100101","-":"101001101",$:"101100101",":":"1101011011","/":"1101101011",".":"1101101101","+":"1011011011",A:"1011001001",B:"1001001011",C:"1010010011",D:"1010011001"}}}]),e}(X_.default);Ua.codabar=J_});var $h=j(Wa=>{"use strict";Object.defineProperty(Wa,"__esModule",{value:!0});Wa.GenericBarcode=void 0;var ew=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),tw=Vt(),iw=nw(tw);function nw(i){return i&&i.__esModule?i:{default:i}}function rw(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function ow(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function aw(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var sw=function(i){aw(e,i);function e(t,n){return rw(this,e),ow(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return ew(e,[{key:"encode",value:function(){return{data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return!0}}]),e}(iw.default);Wa.GenericBarcode=sw});var Gh=j(nc=>{"use strict";Object.defineProperty(nc,"__esModule",{value:!0});var lw=Zp(),$a=mh(),er=Ih(),qh=Ah(),Vr=Vh(),cw=Uh(),dw=Wh(),uw=$h();nc.default={CODE39:lw.CODE39,CODE128:$a.CODE128,CODE128A:$a.CODE128A,CODE128B:$a.CODE128B,CODE128C:$a.CODE128C,EAN13:er.EAN13,EAN8:er.EAN8,EAN5:er.EAN5,EAN2:er.EAN2,UPC:er.UPC,UPCE:er.UPCE,ITF14:qh.ITF14,ITF:qh.ITF,MSI:Vr.MSI,MSI10:Vr.MSI10,MSI11:Vr.MSI11,MSI1010:Vr.MSI1010,MSI1110:Vr.MSI1110,pharmacode:cw.pharmacode,codabar:dw.codabar,GenericBarcode:uw.GenericBarcode}});var Ur=j(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});var pw=Object.assign||function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i};rc.default=function(i,e){return pw({},i,e)}});var Xh=j(oc=>{"use strict";Object.defineProperty(oc,"__esModule",{value:!0});oc.default=hw;function hw(i){var e=[];function t(n){if(Array.isArray(n))for(var r=0;r<n.length;r++)t(n[r]);else n.text=n.text||"",n.data=n.data||"",e.push(n)}return t(i),e}});var Yh=j(ac=>{"use strict";Object.defineProperty(ac,"__esModule",{value:!0});ac.default=fw;function fw(i){return i.marginTop=i.marginTop||i.margin,i.marginBottom=i.marginBottom||i.margin,i.marginRight=i.marginRight||i.margin,i.marginLeft=i.marginLeft||i.margin,i}});var lc=j(sc=>{"use strict";Object.defineProperty(sc,"__esModule",{value:!0});sc.default=mw;function mw(i){var e=["width","height","textMargin","fontSize","margin","marginTop","marginBottom","marginLeft","marginRight"];for(var t in e)e.hasOwnProperty(t)&&(t=e[t],typeof i[t]=="string"&&(i[t]=parseInt(i[t],10)));return typeof i.displayValue=="string"&&(i.displayValue=i.displayValue!="false"),i}});var dc=j(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});var gw={width:2,height:100,format:"auto",displayValue:!0,fontOptions:"",font:"monospace",text:void 0,textAlign:"center",textPosition:"bottom",textMargin:2,fontSize:20,background:"#ffffff",lineColor:"#000000",margin:10,marginTop:void 0,marginBottom:void 0,marginLeft:void 0,marginRight:void 0,valid:function(){}};cc.default=gw});var Zh=j(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});var yw=lc(),vw=Qh(yw),bw=dc(),Kh=Qh(bw);function Qh(i){return i&&i.__esModule?i:{default:i}}function _w(i){var e={};for(var t in Kh.default)Kh.default.hasOwnProperty(t)&&(i.hasAttribute("jsbarcode-"+t.toLowerCase())&&(e[t]=i.getAttribute("jsbarcode-"+t.toLowerCase())),i.hasAttribute("data-"+t.toLowerCase())&&(e[t]=i.getAttribute("data-"+t.toLowerCase())));return e.value=i.getAttribute("jsbarcode-value")||i.getAttribute("data-value"),e=(0,vw.default)(e),e}uc.default=_w});var pc=j(si=>{"use strict";Object.defineProperty(si,"__esModule",{value:!0});si.getTotalWidthOfEncodings=si.calculateEncodingAttributes=si.getBarcodePadding=si.getEncodingHeight=si.getMaximumHeightOfEncodings=void 0;var ww=Ur(),xw=Cw(ww);function Cw(i){return i&&i.__esModule?i:{default:i}}function Jh(i,e){return e.height+(e.displayValue&&i.text.length>0?e.fontSize+e.textMargin:0)+e.marginTop+e.marginBottom}function ef(i,e,t){if(t.displayValue&&e<i){if(t.textAlign=="center")return Math.floor((i-e)/2);if(t.textAlign=="left")return 0;if(t.textAlign=="right")return Math.floor(i-e)}return 0}function Sw(i,e,t){for(var n=0;n<i.length;n++){var r=i[n],o=(0,xw.default)(e,r.options),a;o.displayValue?a=Dw(r.text,o,t):a=0;var s=r.data.length*o.width;r.width=Math.ceil(Math.max(a,s)),r.height=Jh(r,o),r.barcodePadding=ef(a,s,o)}}function Pw(i){for(var e=0,t=0;t<i.length;t++)e+=i[t].width;return e}function Ew(i){for(var e=0,t=0;t<i.length;t++)i[t].height>e&&(e=i[t].height);return e}function Dw(i,e,t){var n;if(t)n=t;else if(typeof document<"u")n=document.createElement("canvas").getContext("2d");else return 0;n.font=e.fontOptions+" "+e.fontSize+"px "+e.font;var r=n.measureText(i);if(!r)return 0;var o=r.width;return o}si.getMaximumHeightOfEncodings=Ew;si.getEncodingHeight=Jh;si.getBarcodePadding=ef;si.calculateEncodingAttributes=Sw;si.getTotalWidthOfEncodings=Pw});var tf=j(fc=>{"use strict";Object.defineProperty(fc,"__esModule",{value:!0});var kw=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),Tw=Ur(),Iw=Ow(Tw),hc=pc();function Ow(i){return i&&i.__esModule?i:{default:i}}function Fw(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}var Rw=function(){function i(e,t,n){Fw(this,i),this.canvas=e,this.encodings=t,this.options=n}return kw(i,[{key:"render",value:function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var t=0;t<this.encodings.length;t++){var n=(0,Iw.default)(this.options,this.encodings[t].options);this.drawCanvasBarcode(n,this.encodings[t]),this.drawCanvasText(n,this.encodings[t]),this.moveCanvasDrawing(this.encodings[t])}this.restoreCanvas()}},{key:"prepareCanvas",value:function(){var t=this.canvas.getContext("2d");t.save(),(0,hc.calculateEncodingAttributes)(this.encodings,this.options,t);var n=(0,hc.getTotalWidthOfEncodings)(this.encodings),r=(0,hc.getMaximumHeightOfEncodings)(this.encodings);this.canvas.width=n+this.options.marginLeft+this.options.marginRight,this.canvas.height=r,t.clearRect(0,0,this.canvas.width,this.canvas.height),this.options.background&&(t.fillStyle=this.options.background,t.fillRect(0,0,this.canvas.width,this.canvas.height)),t.translate(this.options.marginLeft,0)}},{key:"drawCanvasBarcode",value:function(t,n){var r=this.canvas.getContext("2d"),o=n.data,a;t.textPosition=="top"?a=t.marginTop+t.fontSize+t.textMargin:a=t.marginTop,r.fillStyle=t.lineColor;for(var s=0;s<o.length;s++){var l=s*t.width+n.barcodePadding;o[s]==="1"?r.fillRect(l,a,t.width,t.height):o[s]&&r.fillRect(l,a,t.width,t.height*o[s])}}},{key:"drawCanvasText",value:function(t,n){var r=this.canvas.getContext("2d"),o=t.fontOptions+" "+t.fontSize+"px "+t.font;if(t.displayValue){var a,s;t.textPosition=="top"?s=t.marginTop+t.fontSize-t.textMargin:s=t.height+t.textMargin+t.marginTop+t.fontSize,r.font=o,t.textAlign=="left"||n.barcodePadding>0?(a=0,r.textAlign="left"):t.textAlign=="right"?(a=n.width-1,r.textAlign="right"):(a=n.width/2,r.textAlign="center"),r.fillText(n.text,a,s)}}},{key:"moveCanvasDrawing",value:function(t){var n=this.canvas.getContext("2d");n.translate(t.width,0)}},{key:"restoreCanvas",value:function(){var t=this.canvas.getContext("2d");t.restore()}}]),i}();fc.default=Rw});var nf=j(gc=>{"use strict";Object.defineProperty(gc,"__esModule",{value:!0});var Mw=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),Aw=Ur(),Bw=Nw(Aw),mc=pc();function Nw(i){return i&&i.__esModule?i:{default:i}}function zw(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}var qa="http://www.w3.org/2000/svg",Lw=function(){function i(e,t,n){zw(this,i),this.svg=e,this.encodings=t,this.options=n,this.document=n.xmlDocument||document}return Mw(i,[{key:"render",value:function(){var t=this.options.marginLeft;this.prepareSVG();for(var n=0;n<this.encodings.length;n++){var r=this.encodings[n],o=(0,Bw.default)(this.options,r.options),a=this.createGroup(t,o.marginTop,this.svg);this.setGroupOptions(a,o),this.drawSvgBarcode(a,o,r),this.drawSVGText(a,o,r),t+=r.width}}},{key:"prepareSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);(0,mc.calculateEncodingAttributes)(this.encodings,this.options);var t=(0,mc.getTotalWidthOfEncodings)(this.encodings),n=(0,mc.getMaximumHeightOfEncodings)(this.encodings),r=t+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(r,n),this.options.background&&this.drawRect(0,0,r,n,this.svg).setAttribute("style","fill:"+this.options.background+";")}},{key:"drawSvgBarcode",value:function(t,n,r){var o=r.data,a;n.textPosition=="top"?a=n.fontSize+n.textMargin:a=0;for(var s=0,l=0,c=0;c<o.length;c++)l=c*n.width+r.barcodePadding,o[c]==="1"?s++:s>0&&(this.drawRect(l-n.width*s,a,n.width*s,n.height,t),s=0);s>0&&this.drawRect(l-n.width*(s-1),a,n.width*s,n.height,t)}},{key:"drawSVGText",value:function(t,n,r){var o=this.document.createElementNS(qa,"text");if(n.displayValue){var a,s;o.setAttribute("style","font:"+n.fontOptions+" "+n.fontSize+"px "+n.font),n.textPosition=="top"?s=n.fontSize-n.textMargin:s=n.height+n.textMargin+n.fontSize,n.textAlign=="left"||r.barcodePadding>0?(a=0,o.setAttribute("text-anchor","start")):n.textAlign=="right"?(a=r.width-1,o.setAttribute("text-anchor","end")):(a=r.width/2,o.setAttribute("text-anchor","middle")),o.setAttribute("x",a),o.setAttribute("y",s),o.appendChild(this.document.createTextNode(r.text)),t.appendChild(o)}}},{key:"setSvgAttributes",value:function(t,n){var r=this.svg;r.setAttribute("width",t+"px"),r.setAttribute("height",n+"px"),r.setAttribute("x","0px"),r.setAttribute("y","0px"),r.setAttribute("viewBox","0 0 "+t+" "+n),r.setAttribute("xmlns",qa),r.setAttribute("version","1.1"),r.setAttribute("style","transform: translate(0,0)")}},{key:"createGroup",value:function(t,n,r){var o=this.document.createElementNS(qa,"g");return o.setAttribute("transform","translate("+t+", "+n+")"),r.appendChild(o),o}},{key:"setGroupOptions",value:function(t,n){t.setAttribute("style","fill:"+n.lineColor+";")}},{key:"drawRect",value:function(t,n,r,o,a){var s=this.document.createElementNS(qa,"rect");return s.setAttribute("x",t),s.setAttribute("y",n),s.setAttribute("width",r),s.setAttribute("height",o),a.appendChild(s),s}}]),i}();gc.default=Lw});var rf=j(yc=>{"use strict";Object.defineProperty(yc,"__esModule",{value:!0});var Hw=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}();function jw(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}var Vw=function(){function i(e,t,n){jw(this,i),this.object=e,this.encodings=t,this.options=n}return Hw(i,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),i}();yc.default=Vw});var of=j(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});var Uw=tf(),Ww=vc(Uw),$w=nf(),qw=vc($w),Gw=rf(),Xw=vc(Gw);function vc(i){return i&&i.__esModule?i:{default:i}}bc.default={CanvasRenderer:Ww.default,SVGRenderer:qw.default,ObjectRenderer:Xw.default}});var Cc=j(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});function _c(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function wc(i,e){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:i}function xc(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(i,e):i.__proto__=e)}var Yw=function(i){xc(e,i);function e(t,n){_c(this,e);var r=wc(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r.name="InvalidInputException",r.symbology=t,r.input=n,r.message='"'+r.input+'" is not a valid input for '+r.symbology,r}return e}(Error),Kw=function(i){xc(e,i);function e(){_c(this,e);var t=wc(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.name="InvalidElementException",t.message="Not supported type to render on",t}return e}(Error),Qw=function(i){xc(e,i);function e(){_c(this,e);var t=wc(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.name="NoElementException",t.message="No element to render on.",t}return e}(Error);Wr.InvalidInputException=Yw;Wr.InvalidElementException=Kw;Wr.NoElementException=Qw});var sf=j(Ec=>{"use strict";Object.defineProperty(Ec,"__esModule",{value:!0});var Zw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},Jw=Zh(),Sc=af(Jw),ex=of(),$r=af(ex),tx=Cc();function af(i){return i&&i.__esModule?i:{default:i}}function Pc(i){if(typeof i=="string")return ix(i);if(Array.isArray(i)){for(var e=[],t=0;t<i.length;t++)e.push(Pc(i[t]));return e}else{if(typeof HTMLCanvasElement<"u"&&i instanceof HTMLImageElement)return nx(i);if(i&&i.nodeName&&i.nodeName.toLowerCase()==="svg"||typeof SVGElement<"u"&&i instanceof SVGElement)return{element:i,options:(0,Sc.default)(i),renderer:$r.default.SVGRenderer};if(typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement)return{element:i,options:(0,Sc.default)(i),renderer:$r.default.CanvasRenderer};if(i&&i.getContext)return{element:i,renderer:$r.default.CanvasRenderer};if(i&&(typeof i>"u"?"undefined":Zw(i))==="object"&&!i.nodeName)return{element:i,renderer:$r.default.ObjectRenderer};throw new tx.InvalidElementException}}function ix(i){var e=document.querySelectorAll(i);if(e.length!==0){for(var t=[],n=0;n<e.length;n++)t.push(Pc(e[n]));return t}}function nx(i){var e=document.createElement("canvas");return{element:e,options:(0,Sc.default)(i),renderer:$r.default.CanvasRenderer,afterRender:function(){i.setAttribute("src",e.toDataURL())}}}Ec.default=Pc});var lf=j(Dc=>{"use strict";Object.defineProperty(Dc,"__esModule",{value:!0});var rx=function(){function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}();function ox(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}var ax=function(){function i(e){ox(this,i),this.api=e}return rx(i,[{key:"handleCatch",value:function(t){if(t.name==="InvalidInputException")if(this.api._options.valid!==this.api._defaults.valid)this.api._options.valid(!1);else throw t.message;else throw t;this.api.render=function(){}}},{key:"wrapBarcodeCall",value:function(t){try{var n=t.apply(void 0,arguments);return this.api._options.valid(!0),n}catch(r){return this.handleCatch(r),this.api}}}]),i}();Dc.default=ax});var Ic=j((LT,mf)=>{"use strict";var sx=Gh(),dn=Zi(sx),lx=Ur(),qr=Zi(lx),cx=Xh(),df=Zi(cx),dx=Yh(),cf=Zi(dx),ux=sf(),px=Zi(ux),hx=lc(),fx=Zi(hx),mx=lf(),gx=Zi(mx),uf=Cc(),yx=dc(),pf=Zi(yx);function Zi(i){return i&&i.__esModule?i:{default:i}}var Oi=function(){},Ga=function(e,t,n){var r=new Oi;if(typeof e>"u")throw Error("No element to render on was provided.");return r._renderProperties=(0,px.default)(e),r._encodings=[],r._options=pf.default,r._errorHandler=new gx.default(r),typeof t<"u"&&(n=n||{},n.format||(n.format=ff()),r.options(n)[n.format](t,n).render()),r};Ga.getModule=function(i){return dn.default[i]};for(kc in dn.default)dn.default.hasOwnProperty(kc)&&vx(dn.default,kc);var kc;function vx(i,e){Oi.prototype[e]=Oi.prototype[e.toUpperCase()]=Oi.prototype[e.toLowerCase()]=function(t,n){var r=this;return r._errorHandler.wrapBarcodeCall(function(){n.text=typeof n.text>"u"?void 0:""+n.text;var o=(0,qr.default)(r._options,n);o=(0,fx.default)(o);var a=i[e],s=hf(t,a,o);return r._encodings.push(s),r})}}function hf(i,e,t){i=""+i;var n=new e(i,t);if(!n.valid())throw new uf.InvalidInputException(n.constructor.name,i);var r=n.encode();r=(0,df.default)(r);for(var o=0;o<r.length;o++)r[o].options=(0,qr.default)(t,r[o].options);return r}function ff(){return dn.default.CODE128?"CODE128":Object.keys(dn.default)[0]}Oi.prototype.options=function(i){return this._options=(0,qr.default)(this._options,i),this};Oi.prototype.blank=function(i){var e=new Array(i+1).join("0");return this._encodings.push({data:e}),this};Oi.prototype.init=function(){if(this._renderProperties){Array.isArray(this._renderProperties)||(this._renderProperties=[this._renderProperties]);var i;for(var e in this._renderProperties){i=this._renderProperties[e];var t=(0,qr.default)(this._options,i.options);t.format=="auto"&&(t.format=ff()),this._errorHandler.wrapBarcodeCall(function(){var n=t.value,r=dn.default[t.format.toUpperCase()],o=hf(n,r,t);Tc(i,o,t)})}}};Oi.prototype.render=function(){if(!this._renderProperties)throw new uf.NoElementException;if(Array.isArray(this._renderProperties))for(var i=0;i<this._renderProperties.length;i++)Tc(this._renderProperties[i],this._encodings,this._options);else Tc(this._renderProperties,this._encodings,this._options);return this};Oi.prototype._defaults=pf.default;function Tc(i,e,t){e=(0,df.default)(e);for(var n=0;n<e.length;n++)e[n].options=(0,qr.default)(t,e[n].options),(0,cf.default)(e[n].options);(0,cf.default)(t);var r=i.renderer,o=new r(i.element,e,t);o.render(),i.afterRender&&i.afterRender()}typeof window<"u"&&(window.JsBarcode=Ga);typeof jQuery<"u"&&(jQuery.fn.JsBarcode=function(i,e){var t=[];return jQuery(this).each(function(){t.push(this)}),Ga(t,i,e)});mf.exports=Ga});var dm=j((_3,cm)=>{cm.exports=function(){var e={},t=e._fns={};e.emit=function(a,s,l,c,d,u,g){var h=n(a);h.length&&r(a,h,[s,l,c,d,u,g])},e.on=function(a,s){t[a]||(t[a]=[]),t[a].push(s)},e.once=function(a,s){function l(){s.apply(this,arguments),e.off(a,l)}this.on(a,l)},e.off=function(a,s){var l=[];if(a&&s){var c=this._fns[a],d=0,u=c?c.length:0;for(d;d<u;d++)c[d]!==s&&l.push(c[d])}l.length?this._fns[a]=l:delete this._fns[a]};function n(o){var a=t[o]?t[o]:[],s=o.indexOf(":"),l=s===-1?[o]:[o.substring(0,s),o.substring(s+1)],c=Object.keys(t),d=0,u=c.length;for(d;d<u;d++){var g=c[d];if(g==="*"&&(a=a.concat(t[g])),l.length===2&&l[0]===g){a=a.concat(t[g]);break}}return a}function r(o,a,s){var l=0,c=a.length;for(l;l<c&&a[l];l++)a[l].event=o,a[l].apply(a[l],s)}return e}});var as=j((x3,um)=>{function iS(i){var e=typeof i;return i!=null&&(e=="object"||e=="function")}um.exports=iS});var hm=j((C3,pm)=>{var nS=typeof global=="object"&&global&&global.Object===Object&&global;pm.exports=nS});var Qc=j((S3,fm)=>{var rS=hm(),oS=typeof self=="object"&&self&&self.Object===Object&&self,aS=rS||oS||Function("return this")();fm.exports=aS});var gm=j((P3,mm)=>{var sS=Qc(),lS=function(){return sS.Date.now()};mm.exports=lS});var vm=j((E3,ym)=>{var cS=/\s/;function dS(i){for(var e=i.length;e--&&cS.test(i.charAt(e)););return e}ym.exports=dS});var _m=j((D3,bm)=>{var uS=vm(),pS=/^\s+/;function hS(i){return i&&i.slice(0,uS(i)+1).replace(pS,"")}bm.exports=hS});var Zc=j((k3,wm)=>{var fS=Qc(),mS=fS.Symbol;wm.exports=mS});var Pm=j((T3,Sm)=>{var xm=Zc(),Cm=Object.prototype,gS=Cm.hasOwnProperty,yS=Cm.toString,eo=xm?xm.toStringTag:void 0;function vS(i){var e=gS.call(i,eo),t=i[eo];try{i[eo]=void 0;var n=!0}catch{}var r=yS.call(i);return n&&(e?i[eo]=t:delete i[eo]),r}Sm.exports=vS});var Dm=j((I3,Em)=>{var bS=Object.prototype,_S=bS.toString;function wS(i){return _S.call(i)}Em.exports=wS});var Om=j((O3,Im)=>{var km=Zc(),xS=Pm(),CS=Dm(),SS="[object Null]",PS="[object Undefined]",Tm=km?km.toStringTag:void 0;function ES(i){return i==null?i===void 0?PS:SS:Tm&&Tm in Object(i)?xS(i):CS(i)}Im.exports=ES});var Rm=j((F3,Fm)=>{function DS(i){return i!=null&&typeof i=="object"}Fm.exports=DS});var Am=j((R3,Mm)=>{var kS=Om(),TS=Rm(),IS="[object Symbol]";function OS(i){return typeof i=="symbol"||TS(i)&&kS(i)==IS}Mm.exports=OS});var Lm=j((M3,zm)=>{var FS=_m(),Bm=as(),RS=Am(),Nm=NaN,MS=/^[-+]0x[0-9a-f]+$/i,AS=/^0b[01]+$/i,BS=/^0o[0-7]+$/i,NS=parseInt;function zS(i){if(typeof i=="number")return i;if(RS(i))return Nm;if(Bm(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=Bm(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=FS(i);var t=AS.test(i);return t||BS.test(i)?NS(i.slice(2),t?2:8):MS.test(i)?Nm:+i}zm.exports=zS});var ed=j((A3,jm)=>{var LS=as(),Jc=gm(),Hm=Lm(),HS="Expected a function",jS=Math.max,VS=Math.min;function US(i,e,t){var n,r,o,a,s,l,c=0,d=!1,u=!1,g=!0;if(typeof i!="function")throw new TypeError(HS);e=Hm(e)||0,LS(t)&&(d=!!t.leading,u="maxWait"in t,o=u?jS(Hm(t.maxWait)||0,e):o,g="trailing"in t?!!t.trailing:g);function h(b){var w=n,S=r;return n=r=void 0,c=b,a=i.apply(S,w),a}function _(b){return c=b,s=setTimeout(M,e),d?h(b):a}function E(b){var w=b-l,S=b-c,A=e-w;return u?VS(A,o-S):A}function N(b){var w=b-l,S=b-c;return l===void 0||w>=e||w<0||u&&S>=o}function M(){var b=Jc();if(N(b))return U(b);s=setTimeout(M,E(b))}function U(b){return s=void 0,g&&n?h(b):(n=r=void 0,a)}function de(){s!==void 0&&clearTimeout(s),c=0,n=l=r=s=void 0}function oe(){return s===void 0?a:U(Jc())}function ee(){var b=Jc(),w=N(b);if(n=arguments,r=this,l=b,w){if(s===void 0)return _(l);if(u)return clearTimeout(s),s=setTimeout(M,e),h(l)}return s===void 0&&(s=setTimeout(M,e)),a}return ee.cancel=de,ee.flush=oe,ee}jm.exports=US});var Um=j((B3,Vm)=>{var WS=ed(),$S=as(),qS="Expected a function";function GS(i,e,t){var n=!0,r=!0;if(typeof i!="function")throw new TypeError(qS);return $S(t)&&(n="leading"in t?!!t.leading:n,r="trailing"in t?!!t.trailing:r),WS(i,e,{leading:n,maxWait:e,trailing:r})}Vm.exports=GS});var io=j((Z3,Km)=>{"use strict";Km.exports=function(e){if(typeof e!="number"||Number.isNaN(e))throw new TypeError(`Expected a number, got ${typeof e}`);let t=e<0,n=Math.abs(e);if(t&&(n=-n),n===0)return"0 B";let r=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],o=Math.min(Math.floor(Math.log(n)/Math.log(1024)),r.length-1),a=Number(n/1024**o),s=r[o];return`${a>=10||a%1===0?Math.round(a):a.toFixed(1)} ${s}`}});var Jm=j((J3,Zm)=>{"use strict";function Qm(i,e){this.text=i=i||"",this.hasWild=~i.indexOf("*"),this.separator=e,this.parts=i.split(e)}Qm.prototype.match=function(i){var e=!0,t=this.parts,n,r=t.length,o;if(typeof i=="string"||i instanceof String)if(!this.hasWild&&this.text!=i)e=!1;else{for(o=(i||"").split(this.separator),n=0;e&&n<r;n++)t[n]!=="*"&&(n<o.length?e=t[n]===o[n]:e=!1);e=e&&o}else if(typeof i.splice=="function")for(e=[],n=i.length;n--;)this.match(i[n])&&(e[e.length]=i[n]);else if(typeof i=="object"){e={};for(var a in i)this.match(a)&&(e[a]=i[a])}return e};Zm.exports=function(i,e,t){var n=new Qm(i,t||/[\/\.]/);return typeof e<"u"?n.match(e):n}});var tg=j((eF,eg)=>{var JS=Jm(),eP=/[\/\+\.]/;eg.exports=function(i,e){function t(n){var r=JS(n,i,eP);return r&&r.length>=2}return e?t(e.split(";")[0]):t}});var yt=j((AF,bs)=>{(function(){"use strict";var i={}.hasOwnProperty;function e(){for(var r="",o=0;o<arguments.length;o++){var a=arguments[o];a&&(r=n(r,t(a)))}return r}function t(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return e.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var o="";for(var a in r)i.call(r,a)&&r[a]&&(o=n(o,a));return o}function n(r,o){return o?r?r+" "+o:r+o:r}typeof bs<"u"&&bs.exports?(e.default=e,bs.exports=e):typeof define=="function"&&typeof define.amd=="object"&&define.amd?define("classnames",[],function(){return e}):window.classNames=e})()});var x0=j((HM,ou)=>{"use strict";var T2=Object.prototype.hasOwnProperty,bt="~";function Ro(){}Object.create&&(Ro.prototype=Object.create(null),new Ro().__proto__||(bt=!1));function I2(i,e,t){this.fn=i,this.context=e,this.once=t||!1}function w0(i,e,t,n,r){if(typeof t!="function")throw new TypeError("The listener must be a function");var o=new I2(t,n||i,r),a=bt?bt+e:e;return i._events[a]?i._events[a].fn?i._events[a]=[i._events[a],o]:i._events[a].push(o):(i._events[a]=o,i._eventsCount++),i}function zs(i,e){--i._eventsCount===0?i._events=new Ro:delete i._events[e]}function ft(){this._events=new Ro,this._eventsCount=0}ft.prototype.eventNames=function(){var e=[],t,n;if(this._eventsCount===0)return e;for(n in t=this._events)T2.call(t,n)&&e.push(bt?n.slice(1):n);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};ft.prototype.listeners=function(e){var t=bt?bt+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,o=n.length,a=new Array(o);r<o;r++)a[r]=n[r].fn;return a};ft.prototype.listenerCount=function(e){var t=bt?bt+e:e,n=this._events[t];return n?n.fn?1:n.length:0};ft.prototype.emit=function(e,t,n,r,o,a){var s=bt?bt+e:e;if(!this._events[s])return!1;var l=this._events[s],c=arguments.length,d,u;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),c){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,n),!0;case 4:return l.fn.call(l.context,t,n,r),!0;case 5:return l.fn.call(l.context,t,n,r,o),!0;case 6:return l.fn.call(l.context,t,n,r,o,a),!0}for(u=1,d=new Array(c-1);u<c;u++)d[u-1]=arguments[u];l.fn.apply(l.context,d)}else{var g=l.length,h;for(u=0;u<g;u++)switch(l[u].once&&this.removeListener(e,l[u].fn,void 0,!0),c){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,t);break;case 3:l[u].fn.call(l[u].context,t,n);break;case 4:l[u].fn.call(l[u].context,t,n,r);break;default:if(!d)for(h=1,d=new Array(c-1);h<c;h++)d[h-1]=arguments[h];l[u].fn.apply(l[u].context,d)}}return!0};ft.prototype.on=function(e,t,n){return w0(this,e,t,n,!1)};ft.prototype.once=function(e,t,n){return w0(this,e,t,n,!0)};ft.prototype.removeListener=function(e,t,n,r){var o=bt?bt+e:e;if(!this._events[o])return this;if(!t)return zs(this,o),this;var a=this._events[o];if(a.fn)a.fn===t&&(!r||a.once)&&(!n||a.context===n)&&zs(this,o);else{for(var s=0,l=[],c=a.length;s<c;s++)(a[s].fn!==t||r&&!a[s].once||n&&a[s].context!==n)&&l.push(a[s]);l.length?this._events[o]=l.length===1?l[0]:l:zs(this,o)}return this};ft.prototype.removeAllListeners=function(e){var t;return e?(t=bt?bt+e:e,this._events[t]&&zs(this,t)):(this._events=new Ro,this._eventsCount=0),this};ft.prototype.off=ft.prototype.removeListener;ft.prototype.addListener=ft.prototype.on;ft.prefixed=bt;ft.EventEmitter=ft;typeof ou<"u"&&(ou.exports=ft)});var uy=j((Hu,ju)=>{(function(i,e){typeof Hu=="object"&&typeof ju<"u"?ju.exports=e():typeof define=="function"&&define.amd?define(e):(i=typeof globalThis<"u"?globalThis:i||self,i.Compressor=e())})(Hu,function(){"use strict";function i(F,C){var k=Object.keys(F);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(F);C&&(T=T.filter(function(R){return Object.getOwnPropertyDescriptor(F,R).enumerable})),k.push.apply(k,T)}return k}function e(F){for(var C=1;C<arguments.length;C++){var k=arguments[C]!=null?arguments[C]:{};C%2?i(Object(k),!0).forEach(function(T){o(F,T,k[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(F,Object.getOwnPropertyDescriptors(k)):i(Object(k)).forEach(function(T){Object.defineProperty(F,T,Object.getOwnPropertyDescriptor(k,T))})}return F}function t(F,C){if(!(F instanceof C))throw new TypeError("Cannot call a class as a function")}function n(F,C){for(var k=0;k<C.length;k++){var T=C[k];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(F,l(T.key),T)}}function r(F,C,k){return C&&n(F.prototype,C),k&&n(F,k),Object.defineProperty(F,"prototype",{writable:!1}),F}function o(F,C,k){return C=l(C),C in F?Object.defineProperty(F,C,{value:k,enumerable:!0,configurable:!0,writable:!0}):F[C]=k,F}function a(){return a=Object.assign?Object.assign.bind():function(F){for(var C=1;C<arguments.length;C++){var k=arguments[C];for(var T in k)Object.prototype.hasOwnProperty.call(k,T)&&(F[T]=k[T])}return F},a.apply(this,arguments)}function s(F,C){if(typeof F!="object"||F===null)return F;var k=F[Symbol.toPrimitive];if(k!==void 0){var T=k.call(F,C||"default");if(typeof T!="object")return T;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(F)}function l(F){var C=s(F,"string");return typeof C=="symbol"?C:String(C)}var c={exports:{}};(function(F){typeof window>"u"||function(C){var k=C.HTMLCanvasElement&&C.HTMLCanvasElement.prototype,T=C.Blob&&function(){try{return!!new Blob}catch{return!1}}(),R=T&&C.Uint8Array&&function(){try{return new Blob([new Uint8Array(100)]).size===100}catch{return!1}}(),V=C.BlobBuilder||C.WebKitBlobBuilder||C.MozBlobBuilder||C.MSBlobBuilder,ie=/^data:((.*?)(;charset=.*?)?)(;base64)?,/,G=(T||V)&&C.atob&&C.ArrayBuffer&&C.Uint8Array&&function($){var Y,ne,re,ge,Z,J,ve,be,xt;if(Y=$.match(ie),!Y)throw new Error("invalid data URI");for(ne=Y[2]?Y[1]:"text/plain"+(Y[3]||";charset=US-ASCII"),re=!!Y[4],ge=$.slice(Y[0].length),re?Z=atob(ge):Z=decodeURIComponent(ge),J=new ArrayBuffer(Z.length),ve=new Uint8Array(J),be=0;be<Z.length;be+=1)ve[be]=Z.charCodeAt(be);return T?new Blob([R?ve:J],{type:ne}):(xt=new V,xt.append(J),xt.getBlob(ne))};C.HTMLCanvasElement&&!k.toBlob&&(k.mozGetAsFile?k.toBlob=function($,Y,ne){var re=this;setTimeout(function(){ne&&k.toDataURL&&G?$(G(re.toDataURL(Y,ne))):$(re.mozGetAsFile("blob",Y))})}:k.toDataURL&&G&&(k.msToBlob?k.toBlob=function($,Y,ne){var re=this;setTimeout(function(){(Y&&Y!=="image/png"||ne)&&k.toDataURL&&G?$(G(re.toDataURL(Y,ne))):$(re.msToBlob(Y))})}:k.toBlob=function($,Y,ne){var re=this;setTimeout(function(){$(G(re.toDataURL(Y,ne)))})})),F.exports?F.exports=G:C.dataURLtoBlob=G}(window)})(c);var d=c.exports,u=function(C){return typeof Blob>"u"?!1:C instanceof Blob||Object.prototype.toString.call(C)==="[object Blob]"},g={strict:!0,checkOrientation:!0,retainExif:!1,maxWidth:1/0,maxHeight:1/0,minWidth:0,minHeight:0,width:void 0,height:void 0,resize:"none",quality:.8,mimeType:"auto",convertTypes:["image/png"],convertSize:5e6,beforeDraw:null,drew:null,success:null,error:null},h=typeof window<"u"&&typeof window.document<"u",_=h?window:{},E=function(C){return C>0&&C<1/0},N=Array.prototype.slice;function M(F){return Array.from?Array.from(F):N.call(F)}var U=/^image\/.+$/;function de(F){return U.test(F)}function oe(F){var C=de(F)?F.substr(6):"";return C==="jpeg"&&(C="jpg"),".".concat(C)}var ee=String.fromCharCode;function b(F,C,k){var T="",R;for(k+=C,R=C;R<k;R+=1)T+=ee(F.getUint8(R));return T}var w=_.btoa;function S(F,C){for(var k=[],T=8192,R=new Uint8Array(F);R.length>0;)k.push(ee.apply(null,M(R.subarray(0,T)))),R=R.subarray(T);return"data:".concat(C,";base64,").concat(w(k.join("")))}function A(F){var C=new DataView(F),k;try{var T,R,V;if(C.getUint8(0)===255&&C.getUint8(1)===216)for(var ie=C.byteLength,G=2;G+1<ie;){if(C.getUint8(G)===255&&C.getUint8(G+1)===225){R=G;break}G+=1}if(R){var $=R+4,Y=R+10;if(b(C,$,4)==="Exif"){var ne=C.getUint16(Y);if(T=ne===18761,(T||ne===19789)&&C.getUint16(Y+2,T)===42){var re=C.getUint32(Y+4,T);re>=8&&(V=Y+re)}}}if(V){var ge=C.getUint16(V,T),Z,J;for(J=0;J<ge;J+=1)if(Z=V+J*12+2,C.getUint16(Z,T)===274){Z+=8,k=C.getUint16(Z,T),C.setUint16(Z,1,T);break}}}catch{k=1}return k}function L(F){var C=0,k=1,T=1;switch(F){case 2:k=-1;break;case 3:C=-180;break;case 4:T=-1;break;case 5:C=90,T=-1;break;case 6:C=90;break;case 7:C=90,k=-1;break;case 8:C=-90;break}return{rotate:C,scaleX:k,scaleY:T}}var K=/\.\d*(?:0|9){12}\d*$/;function ye(F){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return K.test(F)?Math.round(F*C)/C:F}function Ne(F){var C=F.aspectRatio,k=F.height,T=F.width,R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"none",V=E(T),ie=E(k);if(V&&ie){var G=k*C;(R==="contain"||R==="none")&&G>T||R==="cover"&&G<T?k=T/C:T=k*C}else V?k=T/C:ie&&(T=k*C);return{width:T,height:k}}function Pe(F){for(var C=M(new Uint8Array(F)),k=C.length,T=[],R=0;R+3<k;){var V=C[R],ie=C[R+1];if(V===255&&ie===218)break;if(V===255&&ie===216)R+=2;else{var G=C[R+2]*256+C[R+3],$=R+G+2,Y=C.slice(R,$);T.push(Y),R=$}}return T.reduce(function(ne,re){return re[0]===255&&re[1]===225?ne.concat(re):ne},[])}function Se(F,C){var k=M(new Uint8Array(F));if(k[2]!==255||k[3]!==224)return F;var T=k[4]*256+k[5],R=[255,216].concat(C,k.slice(4+T));return new Uint8Array(R)}var Q=_.ArrayBuffer,ze=_.FileReader,te=_.URL||_.webkitURL,Rt=/\.\w+$/,he=_.Compressor,X=function(){function F(C,k){t(this,F),this.file=C,this.exif=[],this.image=new Image,this.options=e(e({},g),k),this.aborted=!1,this.result=null,this.init()}return r(F,[{key:"init",value:function(){var k=this,T=this.file,R=this.options;if(!u(T)){this.fail(new Error("The first argument must be a File or Blob object."));return}var V=T.type;if(!de(V)){this.fail(new Error("The first argument must be an image File or Blob object."));return}if(!te||!ze){this.fail(new Error("The current browser does not support image compression."));return}Q||(R.checkOrientation=!1,R.retainExif=!1);var ie=V==="image/jpeg",G=ie&&R.checkOrientation,$=ie&&R.retainExif;if(te&&!G&&!$)this.load({url:te.createObjectURL(T)});else{var Y=new ze;this.reader=Y,Y.onload=function(ne){var re=ne.target,ge=re.result,Z={},J=1;G&&(J=A(ge),J>1&&a(Z,L(J))),$&&(k.exif=Pe(ge)),G||$?!te||J>1?Z.url=S(ge,V):Z.url=te.createObjectURL(T):Z.url=ge,k.load(Z)},Y.onabort=function(){k.fail(new Error("Aborted to read the image with FileReader."))},Y.onerror=function(){k.fail(new Error("Failed to read the image with FileReader."))},Y.onloadend=function(){k.reader=null},G||$?Y.readAsArrayBuffer(T):Y.readAsDataURL(T)}}},{key:"load",value:function(k){var T=this,R=this.file,V=this.image;V.onload=function(){T.draw(e(e({},k),{},{naturalWidth:V.naturalWidth,naturalHeight:V.naturalHeight}))},V.onabort=function(){T.fail(new Error("Aborted to load the image."))},V.onerror=function(){T.fail(new Error("Failed to load the image."))},_.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(_.navigator.userAgent)&&(V.crossOrigin="anonymous"),V.alt=R.name,V.src=k.url}},{key:"draw",value:function(k){var T=this,R=k.naturalWidth,V=k.naturalHeight,ie=k.rotate,G=ie===void 0?0:ie,$=k.scaleX,Y=$===void 0?1:$,ne=k.scaleY,re=ne===void 0?1:ne,ge=this.file,Z=this.image,J=this.options,ve=document.createElement("canvas"),be=ve.getContext("2d"),xt=Math.abs(G)%180===90,Mt=(J.resize==="contain"||J.resize==="cover")&&E(J.width)&&E(J.height),Ve=Math.max(J.maxWidth,0)||1/0,Ct=Math.max(J.maxHeight,0)||1/0,Te=Math.max(J.minWidth,0)||0,at=Math.max(J.minHeight,0)||0,st=R/V,Re=J.width,Ze=J.height;if(xt){var ki=[Ct,Ve];Ve=ki[0],Ct=ki[1];var At=[at,Te];Te=At[0],at=At[1];var Wi=[Ze,Re];Re=Wi[0],Ze=Wi[1]}Mt&&(st=Re/Ze);var Er=Ne({aspectRatio:st,width:Ve,height:Ct},"contain");Ve=Er.width,Ct=Er.height;var qu=Ne({aspectRatio:st,width:Te,height:at},"cover");if(Te=qu.width,at=qu.height,Mt){var Gu=Ne({aspectRatio:st,width:Re,height:Ze},J.resize);Re=Gu.width,Ze=Gu.height}else{var Xu=Ne({aspectRatio:st,width:Re,height:Ze}),Yu=Xu.width;Re=Yu===void 0?R:Yu;var Ku=Xu.height;Ze=Ku===void 0?V:Ku}Re=Math.floor(ye(Math.min(Math.max(Re,Te),Ve))),Ze=Math.floor(ye(Math.min(Math.max(Ze,at),Ct)));var By=-Re/2,Ny=-Ze/2,zy=Re,Ly=Ze,el=[];if(Mt){var Qu=0,Zu=0,tl=R,il=V,Ju=Ne({aspectRatio:st,width:R,height:V},{contain:"cover",cover:"contain"}[J.resize]);tl=Ju.width,il=Ju.height,Qu=(R-tl)/2,Zu=(V-il)/2,el.push(Qu,Zu,tl,il)}if(el.push(By,Ny,zy,Ly),xt){var ep=[Ze,Re];Re=ep[0],Ze=ep[1]}ve.width=Re,ve.height=Ze,de(J.mimeType)||(J.mimeType=ge.type);var tp="transparent";ge.size>J.convertSize&&J.convertTypes.indexOf(J.mimeType)>=0&&(J.mimeType="image/jpeg");var ip=J.mimeType==="image/jpeg";if(ip&&(tp="#fff"),be.fillStyle=tp,be.fillRect(0,0,Re,Ze),J.beforeDraw&&J.beforeDraw.call(this,be,ve),!this.aborted&&(be.save(),be.translate(Re/2,Ze/2),be.rotate(G*Math.PI/180),be.scale(Y,re),be.drawImage.apply(be,[Z].concat(el)),be.restore(),J.drew&&J.drew.call(this,be,ve),!this.aborted)){var np=function(Dr){if(!T.aborted){var rp=function(kr){return T.done({naturalWidth:R,naturalHeight:V,result:kr})};if(Dr&&ip&&J.retainExif&&T.exif&&T.exif.length>0){var op=function(kr){return rp(d(S(Se(kr,T.exif),J.mimeType)))};if(Dr.arrayBuffer)Dr.arrayBuffer().then(op).catch(function(){T.fail(new Error("Failed to read the compressed image with Blob.arrayBuffer()."))});else{var zn=new ze;T.reader=zn,zn.onload=function(nl){var kr=nl.target;op(kr.result)},zn.onabort=function(){T.fail(new Error("Aborted to read the compressed image with FileReader."))},zn.onerror=function(){T.fail(new Error("Failed to read the compressed image with FileReader."))},zn.onloadend=function(){T.reader=null},zn.readAsArrayBuffer(Dr)}}else rp(Dr)}};ve.toBlob?ve.toBlob(np,J.mimeType,J.quality):np(d(ve.toDataURL(J.mimeType,J.quality)))}}},{key:"done",value:function(k){var T=k.naturalWidth,R=k.naturalHeight,V=k.result,ie=this.file,G=this.image,$=this.options;if(te&&G.src.indexOf("blob:")===0&&te.revokeObjectURL(G.src),V)if($.strict&&!$.retainExif&&V.size>ie.size&&$.mimeType===ie.type&&!($.width>T||$.height>R||$.minWidth>T||$.minHeight>R||$.maxWidth<T||$.maxHeight<R))V=ie;else{var Y=new Date;V.lastModified=Y.getTime(),V.lastModifiedDate=Y,V.name=ie.name,V.name&&V.type!==ie.type&&(V.name=V.name.replace(Rt,oe(V.type)))}else V=ie;this.result=V,$.success&&$.success.call(this,V)}},{key:"fail",value:function(k){var T=this.options;if(T.error)T.error.call(this,k);else throw k}},{key:"abort",value:function(){this.aborted||(this.aborted=!0,this.reader?this.reader.abort():this.image.complete?this.fail(new Error("The compression process has been aborted.")):(this.image.onload=null,this.image.onabort()))}}],[{key:"noConflict",value:function(){return window.Compressor=he,F}},{key:"setDefaults",value:function(k){a(g,k)}}]),F}();return X})});var my=j((Uu,Wu)=>{((i,e)=>{typeof define=="function"&&define.amd?define([],e):typeof Wu=="object"&&typeof Uu<"u"?Wu.exports=e():i.Papa=e()})(Uu,function i(){var e=typeof self<"u"?self:typeof window<"u"?window:e!==void 0?e:{},t,n=!e.document&&!!e.postMessage,r=e.IS_PAPA_WORKER||!1,o={},a=0,s={};function l(b){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(w){var S=de(w);S.chunkSize=parseInt(S.chunkSize),w.step||w.chunk||(S.chunkSize=null),this._handle=new h(S),(this._handle.streamer=this)._config=S}.call(this,b),this.parseChunk=function(w,S){var A=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<A){let K=this._config.newline;K||(L=this._config.quoteChar||'"',K=this._handle.guessLineEndings(w,L)),w=[...w.split(K).slice(A)].join(K)}this.isFirstChunk&&ee(this._config.beforeFirstChunk)&&(L=this._config.beforeFirstChunk(w))!==void 0&&(w=L),this.isFirstChunk=!1,this._halted=!1;var A=this._partialLine+w,L=(this._partialLine="",this._handle.parse(A,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(w=L.meta.cursor,A=(this._finished||(this._partialLine=A.substring(w-this._baseIndex),this._baseIndex=w),L&&L.data&&(this._rowCount+=L.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),r)e.postMessage({results:L,workerId:s.WORKER_ID,finished:A});else if(ee(this._config.chunk)&&!S){if(this._config.chunk(L,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=L=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(L.data),this._completeResults.errors=this._completeResults.errors.concat(L.errors),this._completeResults.meta=L.meta),this._completed||!A||!ee(this._config.complete)||L&&L.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),A||L&&L.meta.paused||this._nextChunk(),L}this._halted=!0},this._sendError=function(w){ee(this._config.error)?this._config.error(w):r&&this._config.error&&e.postMessage({workerId:s.WORKER_ID,error:w,finished:!1})}}function c(b){var w;(b=b||{}).chunkSize||(b.chunkSize=s.RemoteChunkSize),l.call(this,b),this._nextChunk=n?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(S){this._input=S,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(w=new XMLHttpRequest,this._config.withCredentials&&(w.withCredentials=this._config.withCredentials),n||(w.onload=oe(this._chunkLoaded,this),w.onerror=oe(this._chunkError,this)),w.open(this._config.downloadRequestBody?"POST":"GET",this._input,!n),this._config.downloadRequestHeaders){var S,A=this._config.downloadRequestHeaders;for(S in A)w.setRequestHeader(S,A[S])}var L;this._config.chunkSize&&(L=this._start+this._config.chunkSize-1,w.setRequestHeader("Range","bytes="+this._start+"-"+L));try{w.send(this._config.downloadRequestBody)}catch(K){this._chunkError(K.message)}n&&w.status===0&&this._chunkError()}},this._chunkLoaded=function(){w.readyState===4&&(w.status<200||400<=w.status?this._chunkError():(this._start+=this._config.chunkSize||w.responseText.length,this._finished=!this._config.chunkSize||this._start>=(S=>(S=S.getResponseHeader("Content-Range"))!==null?parseInt(S.substring(S.lastIndexOf("/")+1)):-1)(w),this.parseChunk(w.responseText)))},this._chunkError=function(S){S=w.statusText||S,this._sendError(new Error(S))}}function d(b){(b=b||{}).chunkSize||(b.chunkSize=s.LocalChunkSize),l.call(this,b);var w,S,A=typeof FileReader<"u";this.stream=function(L){this._input=L,S=L.slice||L.webkitSlice||L.mozSlice,A?((w=new FileReader).onload=oe(this._chunkLoaded,this),w.onerror=oe(this._chunkError,this)):w=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var L=this._input,K=(this._config.chunkSize&&(K=Math.min(this._start+this._config.chunkSize,this._input.size),L=S.call(L,this._start,K)),w.readAsText(L,this._config.encoding));A||this._chunkLoaded({target:{result:K}})},this._chunkLoaded=function(L){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(L.target.result)},this._chunkError=function(){this._sendError(w.error)}}function u(b){var w;l.call(this,b=b||{}),this.stream=function(S){return w=S,this._nextChunk()},this._nextChunk=function(){var S,A;if(!this._finished)return S=this._config.chunkSize,w=S?(A=w.substring(0,S),w.substring(S)):(A=w,""),this._finished=!w,this.parseChunk(A)}}function g(b){l.call(this,b=b||{});var w=[],S=!0,A=!1;this.pause=function(){l.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){l.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(L){this._input=L,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){A&&w.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),w.length?this.parseChunk(w.shift()):S=!0},this._streamData=oe(function(L){try{w.push(typeof L=="string"?L:L.toString(this._config.encoding)),S&&(S=!1,this._checkIsFinished(),this.parseChunk(w.shift()))}catch(K){this._streamError(K)}},this),this._streamError=oe(function(L){this._streamCleanUp(),this._sendError(L)},this),this._streamEnd=oe(function(){this._streamCleanUp(),A=!0,this._streamData("")},this),this._streamCleanUp=oe(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function h(b){var w,S,A,L,K=Math.pow(2,53),ye=-K,Ne=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,Pe=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,Se=this,Q=0,ze=0,te=!1,Rt=!1,he=[],X={data:[],errors:[],meta:{}};function F(R){return b.skipEmptyLines==="greedy"?R.join("").trim()==="":R.length===1&&R[0].length===0}function C(){if(X&&A&&(T("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+s.DefaultDelimiter+"'"),A=!1),b.skipEmptyLines&&(X.data=X.data.filter(function($){return!F($)})),k()){let $=function(Y,ne){ee(b.transformHeader)&&(Y=b.transformHeader(Y,ne)),he.push(Y)};var G=$;if(X)if(Array.isArray(X.data[0])){for(var R=0;k()&&R<X.data.length;R++)X.data[R].forEach($);X.data.splice(0,1)}else X.data.forEach($)}function V($,Y){for(var ne=b.header?{}:[],re=0;re<$.length;re++){var ge=re,Z=$[re],Z=((J,ve)=>(be=>(b.dynamicTypingFunction&&b.dynamicTyping[be]===void 0&&(b.dynamicTyping[be]=b.dynamicTypingFunction(be)),(b.dynamicTyping[be]||b.dynamicTyping)===!0))(J)?ve==="true"||ve==="TRUE"||ve!=="false"&&ve!=="FALSE"&&((be=>{if(Ne.test(be)&&(be=parseFloat(be),ye<be&&be<K))return 1})(ve)?parseFloat(ve):Pe.test(ve)?new Date(ve):ve===""?null:ve):ve)(ge=b.header?re>=he.length?"__parsed_extra":he[re]:ge,Z=b.transform?b.transform(Z,ge):Z);ge==="__parsed_extra"?(ne[ge]=ne[ge]||[],ne[ge].push(Z)):ne[ge]=Z}return b.header&&(re>he.length?T("FieldMismatch","TooManyFields","Too many fields: expected "+he.length+" fields but parsed "+re,ze+Y):re<he.length&&T("FieldMismatch","TooFewFields","Too few fields: expected "+he.length+" fields but parsed "+re,ze+Y)),ne}var ie;X&&(b.header||b.dynamicTyping||b.transform)&&(ie=1,!X.data.length||Array.isArray(X.data[0])?(X.data=X.data.map(V),ie=X.data.length):X.data=V(X.data,0),b.header&&X.meta&&(X.meta.fields=he),ze+=ie)}function k(){return b.header&&he.length===0}function T(R,V,ie,G){R={type:R,code:V,message:ie},G!==void 0&&(R.row=G),X.errors.push(R)}ee(b.step)&&(L=b.step,b.step=function(R){X=R,k()?C():(C(),X.data.length!==0&&(Q+=R.data.length,b.preview&&Q>b.preview?S.abort():(X.data=X.data[0],L(X,Se))))}),this.parse=function(R,V,ie){var G=b.quoteChar||'"',G=(b.newline||(b.newline=this.guessLineEndings(R,G)),A=!1,b.delimiter?ee(b.delimiter)&&(b.delimiter=b.delimiter(R),X.meta.delimiter=b.delimiter):((G=(($,Y,ne,re,ge)=>{var Z,J,ve,be;ge=ge||[","," ","|",";",s.RECORD_SEP,s.UNIT_SEP];for(var xt=0;xt<ge.length;xt++){for(var Mt,Ve=ge[xt],Ct=0,Te=0,at=0,st=(ve=void 0,new E({comments:re,delimiter:Ve,newline:Y,preview:10}).parse($)),Re=0;Re<st.data.length;Re++)ne&&F(st.data[Re])?at++:(Mt=st.data[Re].length,Te+=Mt,ve===void 0?ve=Mt:0<Mt&&(Ct+=Math.abs(Mt-ve),ve=Mt));0<st.data.length&&(Te/=st.data.length-at),(J===void 0||Ct<=J)&&(be===void 0||be<Te)&&1.99<Te&&(J=Ct,Z=Ve,be=Te)}return{successful:!!(b.delimiter=Z),bestDelimiter:Z}})(R,b.newline,b.skipEmptyLines,b.comments,b.delimitersToGuess)).successful?b.delimiter=G.bestDelimiter:(A=!0,b.delimiter=s.DefaultDelimiter),X.meta.delimiter=b.delimiter),de(b));return b.preview&&b.header&&G.preview++,w=R,S=new E(G),X=S.parse(w,V,ie),C(),te?{meta:{paused:!0}}:X||{meta:{paused:!1}}},this.paused=function(){return te},this.pause=function(){te=!0,S.abort(),w=ee(b.chunk)?"":w.substring(S.getCharIndex())},this.resume=function(){Se.streamer._halted?(te=!1,Se.streamer.parseChunk(w,!0)):setTimeout(Se.resume,3)},this.aborted=function(){return Rt},this.abort=function(){Rt=!0,S.abort(),X.meta.aborted=!0,ee(b.complete)&&b.complete(X),w=""},this.guessLineEndings=function($,G){$=$.substring(0,1048576);var G=new RegExp(_(G)+"([^]*?)"+_(G),"gm"),ie=($=$.replace(G,"")).split("\r"),G=$.split(`
|
|
2
|
+
`),$=1<G.length&&G[0].length<ie[0].length;if(ie.length===1||$)return`
|
|
3
|
+
`;for(var Y=0,ne=0;ne<ie.length;ne++)ie[ne][0]===`
|
|
4
|
+
`&&Y++;return Y>=ie.length/2?`\r
|
|
5
|
+
`:"\r"}}function _(b){return b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function E(b){var w=(b=b||{}).delimiter,S=b.newline,A=b.comments,L=b.step,K=b.preview,ye=b.fastMode,Ne=null,Pe=b.quoteChar==null?'"':b.quoteChar,Se=Pe;if(b.escapeChar!==void 0&&(Se=b.escapeChar),(typeof w!="string"||-1<s.BAD_DELIMITERS.indexOf(w))&&(w=","),A===w)throw new Error("Comment character same as delimiter");A===!0?A="#":(typeof A!="string"||-1<s.BAD_DELIMITERS.indexOf(A))&&(A=!1),S!==`
|
|
6
|
+
`&&S!=="\r"&&S!==`\r
|
|
7
|
+
`&&(S=`
|
|
8
|
+
`);var Q=0,ze=!1;this.parse=function(te,Rt,he){if(typeof te!="string")throw new Error("Input must be a string");var X=te.length,F=w.length,C=S.length,k=A.length,T=ee(L),R=[],V=[],ie=[],G=Q=0;if(!te)return Ve();if(ye||ye!==!1&&te.indexOf(Pe)===-1){for(var $=te.split(S),Y=0;Y<$.length;Y++){if(ie=$[Y],Q+=ie.length,Y!==$.length-1)Q+=S.length;else if(he)return Ve();if(!A||ie.substring(0,k)!==A){if(T){if(R=[],ve(ie.split(w)),Ct(),ze)return Ve()}else ve(ie.split(w));if(K&&K<=Y)return R=R.slice(0,K),Ve(!0)}}return Ve()}for(var ne=te.indexOf(w,Q),re=te.indexOf(S,Q),ge=new RegExp(_(Se)+_(Pe),"g"),Z=te.indexOf(Pe,Q);;)if(te[Q]===Pe)for(Z=Q,Q++;;){if((Z=te.indexOf(Pe,Z+1))===-1)return he||V.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:R.length,index:Q}),xt();if(Z===X-1)return xt(te.substring(Q,Z).replace(ge,Pe));if(Pe===Se&&te[Z+1]===Se)Z++;else if(Pe===Se||Z===0||te[Z-1]!==Se){ne!==-1&&ne<Z+1&&(ne=te.indexOf(w,Z+1));var J=be((re=re!==-1&&re<Z+1?te.indexOf(S,Z+1):re)===-1?ne:Math.min(ne,re));if(te.substr(Z+1+J,F)===w){ie.push(te.substring(Q,Z).replace(ge,Pe)),te[Q=Z+1+J+F]!==Pe&&(Z=te.indexOf(Pe,Q)),ne=te.indexOf(w,Q),re=te.indexOf(S,Q);break}if(J=be(re),te.substring(Z+1+J,Z+1+J+C)===S){if(ie.push(te.substring(Q,Z).replace(ge,Pe)),Mt(Z+1+J+C),ne=te.indexOf(w,Q),Z=te.indexOf(Pe,Q),T&&(Ct(),ze))return Ve();if(K&&R.length>=K)return Ve(!0);break}V.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:R.length,index:Q}),Z++}}else if(A&&ie.length===0&&te.substring(Q,Q+k)===A){if(re===-1)return Ve();Q=re+C,re=te.indexOf(S,Q),ne=te.indexOf(w,Q)}else if(ne!==-1&&(ne<re||re===-1))ie.push(te.substring(Q,ne)),Q=ne+F,ne=te.indexOf(w,Q);else{if(re===-1)break;if(ie.push(te.substring(Q,re)),Mt(re+C),T&&(Ct(),ze))return Ve();if(K&&R.length>=K)return Ve(!0)}return xt();function ve(Te){R.push(Te),G=Q}function be(Te){var at=0;return at=Te!==-1&&(Te=te.substring(Z+1,Te))&&Te.trim()===""?Te.length:at}function xt(Te){return he||(Te===void 0&&(Te=te.substring(Q)),ie.push(Te),Q=X,ve(ie),T&&Ct()),Ve()}function Mt(Te){Q=Te,ve(ie),ie=[],re=te.indexOf(S,Q)}function Ve(Te){if(b.header&&!Rt&&R.length){var at=R[0],st={},Re=new Set(at);let Ze=!1;for(let ki=0;ki<at.length;ki++){let At=at[ki];if(st[At=ee(b.transformHeader)?b.transformHeader(At,ki):At]){let Wi,Er=st[At];for(;Wi=At+"_"+Er,Er++,Re.has(Wi););Re.add(Wi),at[ki]=Wi,st[At]++,Ze=!0,(Ne=Ne===null?{}:Ne)[Wi]=At}else st[At]=1,at[ki]=At;Re.add(At)}Ze&&console.warn("Duplicate headers found and renamed.")}return{data:R,errors:V,meta:{delimiter:w,linebreak:S,aborted:ze,truncated:!!Te,cursor:G+(Rt||0),renamedHeaders:Ne}}}function Ct(){L(Ve()),R=[],V=[]}},this.abort=function(){ze=!0},this.getCharIndex=function(){return Q}}function N(b){var w=b.data,S=o[w.workerId],A=!1;if(w.error)S.userError(w.error,w.file);else if(w.results&&w.results.data){var L={abort:function(){A=!0,M(w.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:U,resume:U};if(ee(S.userStep)){for(var K=0;K<w.results.data.length&&(S.userStep({data:w.results.data[K],errors:w.results.errors,meta:w.results.meta},L),!A);K++);delete w.results}else ee(S.userChunk)&&(S.userChunk(w.results,L,w.file),delete w.results)}w.finished&&!A&&M(w.workerId,w.results)}function M(b,w){var S=o[b];ee(S.userComplete)&&S.userComplete(w),S.terminate(),delete o[b]}function U(){throw new Error("Not implemented.")}function de(b){if(typeof b!="object"||b===null)return b;var w,S=Array.isArray(b)?[]:{};for(w in b)S[w]=de(b[w]);return S}function oe(b,w){return function(){b.apply(w,arguments)}}function ee(b){return typeof b=="function"}return s.parse=function(b,w){var S=(w=w||{}).dynamicTyping||!1;if(ee(S)&&(w.dynamicTypingFunction=S,S={}),w.dynamicTyping=S,w.transform=!!ee(w.transform)&&w.transform,!w.worker||!s.WORKERS_SUPPORTED)return S=null,s.NODE_STREAM_INPUT,typeof b=="string"?(b=(A=>A.charCodeAt(0)!==65279?A:A.slice(1))(b),S=new(w.download?c:u)(w)):b.readable===!0&&ee(b.read)&&ee(b.on)?S=new g(w):(e.File&&b instanceof File||b instanceof Object)&&(S=new d(w)),S.stream(b);(S=(()=>{var A;return!!s.WORKERS_SUPPORTED&&(A=(()=>{var L=e.URL||e.webkitURL||null,K=i.toString();return s.BLOB_URL||(s.BLOB_URL=L.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",K,")();"],{type:"text/javascript"})))})(),(A=new e.Worker(A)).onmessage=N,A.id=a++,o[A.id]=A)})()).userStep=w.step,S.userChunk=w.chunk,S.userComplete=w.complete,S.userError=w.error,w.step=ee(w.step),w.chunk=ee(w.chunk),w.complete=ee(w.complete),w.error=ee(w.error),delete w.worker,S.postMessage({input:b,config:w,workerId:S.id})},s.unparse=function(b,w){var S=!1,A=!0,L=",",K=`\r
|
|
9
|
+
`,ye='"',Ne=ye+ye,Pe=!1,Se=null,Q=!1,ze=((()=>{if(typeof w=="object"){if(typeof w.delimiter!="string"||s.BAD_DELIMITERS.filter(function(he){return w.delimiter.indexOf(he)!==-1}).length||(L=w.delimiter),typeof w.quotes!="boolean"&&typeof w.quotes!="function"&&!Array.isArray(w.quotes)||(S=w.quotes),typeof w.skipEmptyLines!="boolean"&&typeof w.skipEmptyLines!="string"||(Pe=w.skipEmptyLines),typeof w.newline=="string"&&(K=w.newline),typeof w.quoteChar=="string"&&(ye=w.quoteChar),typeof w.header=="boolean"&&(A=w.header),Array.isArray(w.columns)){if(w.columns.length===0)throw new Error("Option columns is empty");Se=w.columns}w.escapeChar!==void 0&&(Ne=w.escapeChar+ye),w.escapeFormulae instanceof RegExp?Q=w.escapeFormulae:typeof w.escapeFormulae=="boolean"&&w.escapeFormulae&&(Q=/^[=+\-@\t\r].*$/)}})(),new RegExp(_(ye),"g"));if(typeof b=="string"&&(b=JSON.parse(b)),Array.isArray(b)){if(!b.length||Array.isArray(b[0]))return te(null,b,Pe);if(typeof b[0]=="object")return te(Se||Object.keys(b[0]),b,Pe)}else if(typeof b=="object")return typeof b.data=="string"&&(b.data=JSON.parse(b.data)),Array.isArray(b.data)&&(b.fields||(b.fields=b.meta&&b.meta.fields||Se),b.fields||(b.fields=Array.isArray(b.data[0])?b.fields:typeof b.data[0]=="object"?Object.keys(b.data[0]):[]),Array.isArray(b.data[0])||typeof b.data[0]=="object"||(b.data=[b.data])),te(b.fields||[],b.data||[],Pe);throw new Error("Unable to serialize unrecognized input");function te(he,X,F){var C="",k=(typeof he=="string"&&(he=JSON.parse(he)),typeof X=="string"&&(X=JSON.parse(X)),Array.isArray(he)&&0<he.length),T=!Array.isArray(X[0]);if(k&&A){for(var R=0;R<he.length;R++)0<R&&(C+=L),C+=Rt(he[R],R);0<X.length&&(C+=K)}for(var V=0;V<X.length;V++){var ie=(k?he:X[V]).length,G=!1,$=k?Object.keys(X[V]).length===0:X[V].length===0;if(F&&!k&&(G=F==="greedy"?X[V].join("").trim()==="":X[V].length===1&&X[V][0].length===0),F==="greedy"&&k){for(var Y=[],ne=0;ne<ie;ne++){var re=T?he[ne]:ne;Y.push(X[V][re])}G=Y.join("").trim()===""}if(!G){for(var ge=0;ge<ie;ge++){0<ge&&!$&&(C+=L);var Z=k&&T?he[ge]:ge;C+=Rt(X[V][Z],ge)}V<X.length-1&&(!F||0<ie&&!$)&&(C+=K)}}return C}function Rt(he,X){var F,C;return he==null?"":he.constructor===Date?JSON.stringify(he).slice(1,25):(C=!1,Q&&typeof he=="string"&&Q.test(he)&&(he="'"+he,C=!0),F=he.toString().replace(ze,Ne),(C=C||S===!0||typeof S=="function"&&S(he,X)||Array.isArray(S)&&S[X]||((k,T)=>{for(var R=0;R<T.length;R++)if(-1<k.indexOf(T[R]))return!0;return!1})(F,s.BAD_DELIMITERS)||-1<F.indexOf(L)||F.charAt(0)===" "||F.charAt(F.length-1)===" ")?ye+F+ye:F)}},s.RECORD_SEP="",s.UNIT_SEP="",s.BYTE_ORDER_MARK="\uFEFF",s.BAD_DELIMITERS=["\r",`
|
|
10
|
+
`,'"',s.BYTE_ORDER_MARK],s.WORKERS_SUPPORTED=!n&&!!e.Worker,s.NODE_STREAM_INPUT=1,s.LocalChunkSize=10485760,s.RemoteChunkSize=5242880,s.DefaultDelimiter=",",s.Parser=E,s.ParserHandle=h,s.NetworkStreamer=c,s.FileStreamer=d,s.StringStreamer=u,s.ReadableStreamStreamer=g,e.jQuery&&((t=e.jQuery).fn.parse=function(b){var w=b.config||{},S=[];return this.each(function(K){if(!(t(this).prop("tagName").toUpperCase()==="INPUT"&&t(this).attr("type").toLowerCase()==="file"&&e.FileReader)||!this.files||this.files.length===0)return!0;for(var ye=0;ye<this.files.length;ye++)S.push({file:this.files[ye],inputElem:this,instanceConfig:t.extend({},w)})}),A(),this;function A(){if(S.length===0)ee(b.complete)&&b.complete();else{var K,ye,Ne,Pe,Se=S[0];if(ee(b.before)){var Q=b.before(Se.file,Se.inputElem);if(typeof Q=="object"){if(Q.action==="abort")return K="AbortError",ye=Se.file,Ne=Se.inputElem,Pe=Q.reason,void(ee(b.error)&&b.error({name:K},ye,Ne,Pe));if(Q.action==="skip")return void L();typeof Q.config=="object"&&(Se.instanceConfig=t.extend(Se.instanceConfig,Q.config))}else if(Q==="skip")return void L()}var ze=Se.instanceConfig.complete;Se.instanceConfig.complete=function(te){ee(ze)&&ze(te,Se.file,Se.inputElem),L()},s.parse(Se.file,Se.instanceConfig)}}function L(){S.splice(0,1),A()}}),r&&(e.onmessage=function(b){b=b.data,s.WORKER_ID===void 0&&b&&(s.WORKER_ID=b.workerId),typeof b.input=="string"?e.postMessage({workerId:s.WORKER_ID,results:s.parse(b.input,b.config),finished:!0}):(e.File&&b.input instanceof File||b.input instanceof Object)&&(b=s.parse(b.input,b.config))&&e.postMessage({workerId:s.WORKER_ID,results:b,finished:!0})}),(c.prototype=Object.create(l.prototype)).constructor=c,(d.prototype=Object.create(l.prototype)).constructor=d,(u.prototype=Object.create(u.prototype)).constructor=u,(g.prototype=Object.create(l.prototype)).constructor=g,s})});var Oy=j((Js,$u)=>{(function(e,t){typeof Js=="object"&&typeof $u=="object"?$u.exports=t():typeof define=="function"&&define.amd?define([],t):typeof Js=="object"?Js.printJS=t():e.printJS=t()})(window,function(){return function(i){var e={};function t(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return i[n].call(r.exports,r,r.exports,t),r.l=!0,r.exports}return t.m=i,t.c=e,t.d=function(n,r,o){t.o(n,r)||Object.defineProperty(n,r,{enumerable:!0,get:o})},t.r=function(n){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,r){if(r&1&&(n=t(n)),r&8||r&4&&typeof n=="object"&&n&&n.__esModule)return n;var o=Object.create(null);if(t.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:n}),r&2&&typeof n!="string")for(var a in n)t.d(o,a,function(s){return n[s]}.bind(null,a));return o},t.n=function(n){var r=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(r,"a",r),r},t.o=function(n,r){return Object.prototype.hasOwnProperty.call(n,r)},t.p="",t(t.s=0)}({"./src/index.js":function(i,e,t){"use strict";t.r(e);var n=t("./src/sass/index.scss"),r=t.n(n),o=t("./src/js/init.js"),a=o.default.init;typeof window<"u"&&(window.printJS=a),e.default=a},"./src/js/browser.js":function(i,e,t){"use strict";t.r(e);var n={isFirefox:function(){return typeof InstallTrigger<"u"},isIE:function(){return navigator.userAgent.indexOf("MSIE")!==-1||!!document.documentMode},isEdge:function(){return!n.isIE()&&!!window.StyleMedia},isChrome:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window;return!!o.chrome},isSafari:function(){return Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0||navigator.userAgent.toLowerCase().indexOf("safari")!==-1},isIOSChrome:function(){return navigator.userAgent.toLowerCase().indexOf("crios")!==-1}};e.default=n},"./src/js/functions.js":function(i,e,t){"use strict";t.r(e),t.d(e,"addWrapper",function(){return a}),t.d(e,"capitalizePrint",function(){return s}),t.d(e,"collectStyles",function(){return l}),t.d(e,"addHeader",function(){return d}),t.d(e,"cleanUp",function(){return u}),t.d(e,"isRawHTML",function(){return g});var n=t("./src/js/modal.js"),r=t("./src/js/browser.js");function o(h){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?o=function(E){return typeof E}:o=function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},o(h)}function a(h,_){var E="font-family:"+_.font+" !important; font-size: "+_.font_size+" !important; width:100%;";return'<div style="'+E+'">'+h+"</div>"}function s(h){return h.charAt(0).toUpperCase()+h.slice(1)}function l(h,_){for(var E=document.defaultView||window,N="",M=E.getComputedStyle(h,""),U=0;U<M.length;U++)(_.targetStyles.indexOf("*")!==-1||_.targetStyle.indexOf(M[U])!==-1||c(_.targetStyles,M[U]))&&M.getPropertyValue(M[U])&&(N+=M[U]+":"+M.getPropertyValue(M[U])+";");return N+="max-width: "+_.maxWidth+"px !important; font-size: "+_.font_size+" !important;",N}function c(h,_){for(var E=0;E<h.length;E++)if(o(_)==="object"&&_.indexOf(h[E])!==-1)return!0;return!1}function d(h,_){var E=document.createElement("div");if(g(_.header))E.innerHTML=_.header;else{var N=document.createElement("h1"),M=document.createTextNode(_.header);N.appendChild(M),N.setAttribute("style",_.headerStyle),E.appendChild(N)}h.insertBefore(E,h.childNodes[0])}function u(h){h.showModal&&n.default.close(),h.onLoadingEnd&&h.onLoadingEnd(),(h.showModal||h.onLoadingStart)&&window.URL.revokeObjectURL(h.printable);var _="mouseover";(r.default.isChrome()||r.default.isFirefox())&&(_="focus");var E=function N(){window.removeEventListener(_,N),h.onPrintDialogClose();var M=document.getElementById(h.frameId);M&&M.remove()};window.addEventListener(_,E)}function g(h){var _=new RegExp("<([A-Za-z][A-Za-z0-9]*)\\b[^>]*>(.*?)</\\1>");return _.test(h)}},"./src/js/html.js":function(i,e,t){"use strict";t.r(e);var n=t("./src/js/functions.js"),r=t("./src/js/print.js");function o(l){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?o=function(d){return typeof d}:o=function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d},o(l)}e.default={print:function(c,d){var u=s(c.printable)?c.printable:document.getElementById(c.printable);if(!u){window.console.error("Invalid HTML element id: "+c.printable);return}c.printableElement=a(u,c),c.header&&Object(n.addHeader)(c.printableElement,c),r.default.send(c,d)}};function a(l,c){for(var d=l.cloneNode(),u=Array.prototype.slice.call(l.childNodes),g=0;g<u.length;g++)if(c.ignoreElements.indexOf(u[g].id)===-1){var h=a(u[g],c);d.appendChild(h)}switch(c.scanStyles&&l.nodeType===1&&d.setAttribute("style",Object(n.collectStyles)(l,c)),l.tagName){case"SELECT":d.value=l.value;break;case"CANVAS":d.getContext("2d").drawImage(l,0,0);break}return d}function s(l){return o(l)==="object"&&l&&(l instanceof HTMLElement||l.nodeType===1)}},"./src/js/image.js":function(i,e,t){"use strict";t.r(e);var n=t("./src/js/functions.js"),r=t("./src/js/print.js"),o=t("./src/js/browser.js");e.default={print:function(s,l){s.printable.constructor!==Array&&(s.printable=[s.printable]),s.printableElement=document.createElement("div"),s.printable.forEach(function(c){var d=document.createElement("img");if(d.setAttribute("style",s.imageStyle),d.src=c,o.default.isFirefox()){var u=d.src;d.src=u}var g=document.createElement("div");g.appendChild(d),s.printableElement.appendChild(g)}),s.header&&Object(n.addHeader)(s.printableElement,s),r.default.send(s,l)}}},"./src/js/init.js":function(i,e,t){"use strict";t.r(e);var n=t("./src/js/browser.js"),r=t("./src/js/modal.js"),o=t("./src/js/pdf.js"),a=t("./src/js/html.js"),s=t("./src/js/raw-html.js"),l=t("./src/js/image.js"),c=t("./src/js/json.js");function d(g){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?d=function(_){return typeof _}:d=function(_){return _&&typeof Symbol=="function"&&_.constructor===Symbol&&_!==Symbol.prototype?"symbol":typeof _},d(g)}var u=["pdf","html","image","json","raw-html"];e.default={init:function(){var h={printable:null,fallbackPrintable:null,type:"pdf",header:null,headerStyle:"font-weight: 300;",maxWidth:800,properties:null,gridHeaderStyle:"font-weight: bold; padding: 5px; border: 1px solid #dddddd;",gridStyle:"border: 1px solid lightgray; margin-bottom: -1px;",showModal:!1,onError:function(oe){throw oe},onLoadingStart:null,onLoadingEnd:null,onPrintDialogClose:function(){},onIncompatibleBrowser:function(){},modalMessage:"Retrieving Document...",frameId:"printJS",printableElement:null,documentTitle:"Document",targetStyle:["clear","display","width","min-width","height","min-height","max-height"],targetStyles:["border","box","break","text-decoration"],ignoreElements:[],repeatTableHeader:!0,css:null,style:null,scanStyles:!0,base64:!1,onPdfOpen:null,font:"TimesNewRoman",font_size:"12pt",honorMarginPadding:!0,honorColor:!1,imageStyle:"max-width: 100%;"},_=arguments[0];if(_===void 0)throw new Error("printJS expects at least 1 attribute.");switch(d(_)){case"string":h.printable=encodeURI(_),h.fallbackPrintable=h.printable,h.type=arguments[1]||h.type;break;case"object":h.printable=_.printable,h.fallbackPrintable=typeof _.fallbackPrintable<"u"?_.fallbackPrintable:h.printable,h.fallbackPrintable=h.base64?"data:application/pdf;base64,".concat(h.fallbackPrintable):h.fallbackPrintable;for(var E in h)E==="printable"||E==="fallbackPrintable"||(h[E]=typeof _[E]<"u"?_[E]:h[E]);break;default:throw new Error('Unexpected argument type! Expected "string" or "object", got '+d(_))}if(!h.printable)throw new Error("Missing printable information.");if(!h.type||typeof h.type!="string"||u.indexOf(h.type.toLowerCase())===-1)throw new Error("Invalid print type. Available types are: pdf, html, image and json.");h.showModal&&r.default.show(h),h.onLoadingStart&&h.onLoadingStart();var N=document.getElementById(h.frameId);N&&N.parentNode.removeChild(N);var M=document.createElement("iframe");switch(n.default.isFirefox()?M.setAttribute("style","width: 1px; height: 100px; position: fixed; left: 0; top: 0; opacity: 0; border-width: 0; margin: 0; padding: 0"):M.setAttribute("style","visibility: hidden; height: 0; width: 0; position: absolute; border: 0"),M.setAttribute("id",h.frameId),h.type!=="pdf"&&(M.srcdoc="<html><head><title>"+h.documentTitle+"</title>",h.css&&(Array.isArray(h.css)||(h.css=[h.css]),h.css.forEach(function(de){M.srcdoc+='<link rel="stylesheet" href="'+de+'">'})),M.srcdoc+="</head><body></body></html>"),h.type){case"pdf":if(n.default.isIE())try{console.info("Print.js doesn't support PDF printing in Internet Explorer.");var U=window.open(h.fallbackPrintable,"_blank");U.focus(),h.onIncompatibleBrowser()}catch(de){h.onError(de)}finally{h.showModal&&r.default.close(),h.onLoadingEnd&&h.onLoadingEnd()}else o.default.print(h,M);break;case"image":l.default.print(h,M);break;case"html":a.default.print(h,M);break;case"raw-html":s.default.print(h,M);break;case"json":c.default.print(h,M);break}}}},"./src/js/json.js":function(i,e,t){"use strict";t.r(e);var n=t("./src/js/functions.js"),r=t("./src/js/print.js");function o(s){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?o=function(c){return typeof c}:o=function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},o(s)}e.default={print:function(l,c){if(o(l.printable)!=="object")throw new Error("Invalid javascript data object (JSON).");if(typeof l.repeatTableHeader!="boolean")throw new Error("Invalid value for repeatTableHeader attribute (JSON).");if(!l.properties||!Array.isArray(l.properties))throw new Error("Invalid properties array for your JSON data.");l.properties=l.properties.map(function(d){return{field:o(d)==="object"?d.field:d,displayName:o(d)==="object"?d.displayName:d,columnSize:o(d)==="object"&&d.columnSize?d.columnSize+";":100/l.properties.length+"%;"}}),l.printableElement=document.createElement("div"),l.header&&Object(n.addHeader)(l.printableElement,l),l.printableElement.innerHTML+=a(l),r.default.send(l,c)}};function a(s){var l=s.printable,c=s.properties,d='<table style="border-collapse: collapse; width: 100%;">';s.repeatTableHeader&&(d+="<thead>"),d+="<tr>";for(var u=0;u<c.length;u++)d+='<th style="width:'+c[u].columnSize+";"+s.gridHeaderStyle+'">'+Object(n.capitalizePrint)(c[u].displayName)+"</th>";d+="</tr>",s.repeatTableHeader&&(d+="</thead>"),d+="<tbody>";for(var g=0;g<l.length;g++){d+="<tr>";for(var h=0;h<c.length;h++){var _=l[g],E=c[h].field.split(".");if(E.length>1)for(var N=0;N<E.length;N++)_=_[E[N]];else _=_[c[h].field];d+='<td style="width:'+c[h].columnSize+s.gridStyle+'">'+_+"</td>"}d+="</tr>"}return d+="</tbody></table>",d}},"./src/js/modal.js":function(i,e,t){"use strict";t.r(e);var n={show:function(o){var a="font-family:sans-serif; display:table; text-align:center; font-weight:300; font-size:30px; left:0; top:0;position:fixed; z-index: 9990;color: #0460B5; width: 100%; height: 100%; background-color:rgba(255,255,255,.9);transition: opacity .3s ease;",s=document.createElement("div");s.setAttribute("style",a),s.setAttribute("id","printJS-Modal");var l=document.createElement("div");l.setAttribute("style","display:table-cell; vertical-align:middle; padding-bottom:100px;");var c=document.createElement("div");c.setAttribute("class","printClose"),c.setAttribute("id","printClose"),l.appendChild(c);var d=document.createElement("span");d.setAttribute("class","printSpinner"),l.appendChild(d);var u=document.createTextNode(o.modalMessage);l.appendChild(u),s.appendChild(l),document.getElementsByTagName("body")[0].appendChild(s),document.getElementById("printClose").addEventListener("click",function(){n.close()})},close:function(){var o=document.getElementById("printJS-Modal");o&&o.parentNode.removeChild(o)}};e.default=n},"./src/js/pdf.js":function(i,e,t){"use strict";t.r(e);var n=t("./src/js/print.js"),r=t("./src/js/functions.js");e.default={print:function(s,l){if(s.base64){var c=Uint8Array.from(atob(s.printable),function(u){return u.charCodeAt(0)});o(s,l,c);return}s.printable=/^(blob|http|\/\/)/i.test(s.printable)?s.printable:window.location.origin+(s.printable.charAt(0)!=="/"?"/"+s.printable:s.printable);var d=new window.XMLHttpRequest;d.responseType="arraybuffer",d.addEventListener("error",function(){Object(r.cleanUp)(s),s.onError(d.statusText,d)}),d.addEventListener("load",function(){if([200,201].indexOf(d.status)===-1){Object(r.cleanUp)(s),s.onError(d.statusText,d);return}o(s,l,d.response)}),d.open("GET",s.printable,!0),d.send()}};function o(a,s,l){var c=new window.Blob([l],{type:"application/pdf"});c=window.URL.createObjectURL(c),s.setAttribute("src",c),n.default.send(a,s)}},"./src/js/print.js":function(i,e,t){"use strict";t.r(e);var n=t("./src/js/browser.js"),r=t("./src/js/functions.js"),o={send:function(d,u){document.getElementsByTagName("body")[0].appendChild(u);var g=document.getElementById(d.frameId);g.onload=function(){if(d.type==="pdf"){n.default.isFirefox()?setTimeout(function(){return a(g,d)},1e3):a(g,d);return}var h=g.contentWindow||g.contentDocument;if(h.document&&(h=h.document),h.body.appendChild(d.printableElement),d.type!=="pdf"&&d.style){var _=document.createElement("style");_.innerHTML=d.style,h.head.appendChild(_)}var E=h.getElementsByTagName("img");E.length>0?s(Array.from(E)).then(function(){return a(g,d)}):a(g,d)}}};function a(c,d){try{if(c.focus(),n.default.isEdge()||n.default.isIE())try{c.contentWindow.document.execCommand("print",!1,null)}catch{c.contentWindow.print()}else c.contentWindow.print()}catch(u){d.onError(u)}finally{n.default.isFirefox()&&(c.style.visibility="hidden",c.style.left="-1px"),Object(r.cleanUp)(d)}}function s(c){var d=c.map(function(u){if(u.src&&u.src!==window.location.href)return l(u)});return Promise.all(d)}function l(c){return new Promise(function(d){var u=function g(){!c||typeof c.naturalWidth>"u"||c.naturalWidth===0||!c.complete?setTimeout(g,500):d()};u()})}e.default=o},"./src/js/raw-html.js":function(i,e,t){"use strict";t.r(e);var n=t("./src/js/print.js");e.default={print:function(o,a){o.printableElement=document.createElement("div"),o.printableElement.setAttribute("style","width:100%"),o.printableElement.innerHTML=o.printable,n.default.send(o,a)}}},"./src/sass/index.scss":function(i,e,t){},0:function(i,e,t){i.exports=t("./src/index.js")}}).default})});var bx=De(Ic(),1);var tr=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=Nt({type:i})}static{this.\u0275inj=Bt({})}}return i})();function gf(i){let{anchorOffset:e=0,focusOffset:t=0}=i.ownerDocument.getSelection()||{},n=Math.min(e,t),r=Math.max(e,t);return[n,r]}function _x(i,[e,t]){var n,r,o,a;let s=i.ownerDocument,l=s.createRange();l.setStart(i.firstChild||i,Math.min(e,(r=(n=i.textContent)===null||n===void 0?void 0:n.length)!==null&&r!==void 0?r:0)),l.setEnd(i.lastChild||i,Math.min(t,(a=(o=i.textContent)===null||o===void 0?void 0:o.length)!==null&&a!==void 0?a:0));let c=s.getSelection();c&&(c.removeAllRanges(),c.addRange(l))}var Oc=class{constructor(e){this.element=e,this.maxLength=1/0}get value(){return this.element.innerText.replace(/\n\n$/,`
|
|
11
|
+
`)}set value(e){this.element.innerHTML=e.replace(/\n$/,`
|
|
12
|
+
|
|
13
|
+
`)}get selectionStart(){return gf(this.element)[0]}get selectionEnd(){return gf(this.element)[1]}setSelectionRange(e,t){_x(this.element,[e??0,t??0])}select(){this.setSelectionRange(0,this.value.length)}};function wx(i){let e=new Oc(i);return new Proxy(i,{get(t,n){if(n in e)return e[n];let r=t[n];return typeof r=="function"?r.bind(t):r},set(t,n,r,o){return Reflect.set(n in e?e:t,n,r,o)}})}var _f=i=>i.isContentEditable?wx(i):i.querySelector("input,textarea")||i,ir={mask:/^.*$/,preprocessors:[],postprocessors:[],plugins:[],overwriteMode:"shift"},Fc=class{constructor(){this.now=null,this.past=[],this.future=[]}undo(){let e=this.past.pop();e&&this.now&&(this.future.push(this.now),this.updateElement(e,"historyUndo"))}redo(){let e=this.future.pop();e&&this.now&&(this.past.push(this.now),this.updateElement(e,"historyRedo"))}updateHistory(e){if(!this.now){this.now=e;return}let t=this.now.value!==e.value,n=this.now.selection.some((r,o)=>r!==e.selection[o]);!t&&!n||(t&&(this.past.push(this.now),this.future=[]),this.now=e)}updateElement(e,t){this.now=e,this.updateElementState(e,{inputType:t,data:null})}};function xx(i,...e){return e.every(({value:t})=>t===i.value)}function Cx(i,...e){return e.every(({value:t,selection:n})=>t===i.value&&n[0]===i.selection[0]&&n[1]===i.selection[1])}function Sx({value:i,selection:e},t,n){let[r,o]=e,a=typeof n=="function"?n({value:i,selection:e}):n;return{value:i,selection:a==="replace"?[r,Math.max(r+t.length,o)]:[r,o]}}function Qa(i){return typeof i=="string"}function yf(i,e,t,n){let r="";for(let o=e.length;o<i.length;o++){let a=i[o]||"",s=n?.value[o]===a;if(!Qa(a)||a===t&&!s)return r;r+=a}return r}function wf(i,e){return Array.isArray(e)?i.length===e.length&&Array.from(i).every((t,n)=>{let r=e[n]||"";return Qa(r)?t===r:t.match(r)}):e.test(i)}function Px(i,e,t){let n=null,r=null,o=Array.from(i.value).reduce((s,l,c)=>{let d=yf(e,s,l,t),u=s+d,g=e[u.length]||"";return n===null&&c>=i.selection[0]&&(n=u.length),r===null&&c>=i.selection[1]&&(r=u.length),Qa(g)?u+g:l.match(g)?u+l:u},""),a=yf(e,o,"",t);return{value:wf(o+a,e)?o+a:o,selection:[n??o.length,r??o.length]}}function Ex({value:i,selection:e},t){let[n,r]=e,o=n,a=r,s=Array.from(i).reduce((l,c,d)=>{let u=l+c;return n===d&&(o=l.length),r===d&&(a=l.length),u.match(t)?u:l},"");return{value:s,selection:[Math.min(o,s.length),Math.min(a,s.length)]}}function Xa(i,e,t=null){if(wf(i.value,e))return i;let{value:n,selection:r}=Array.isArray(e)?Px(i,e,t):Ex(i,e);return{selection:r,value:Array.isArray(e)?n.slice(0,e.length):n}}function vf(i,e){if(!Array.isArray(e))return i;let[t,n]=i.selection,r=[],o=Array.from(i.value).reduce((a,s,l)=>{let c=e[l]||"";return l===t&&r.push(a.length),l===n&&r.push(a.length),Qa(c)&&c===s?a:a+s},"");return r.length<2&&r.push(...new Array(2-r.length).fill(o.length)),{value:o,selection:[r[0],r[1]]}}var Yr=class{constructor(e,t){this.initialElementState=e,this.maskOptions=t,this.value="",this.selection=[0,0];let{value:n,selection:r}=Xa(this.initialElementState,this.getMaskExpression(this.initialElementState));this.value=n,this.selection=r}addCharacters([e,t],n){let{value:r,maskOptions:o}=this,a=this.getMaskExpression({value:r.slice(0,e)+n+r.slice(t),selection:[e+n.length,e+n.length]}),s={value:r,selection:[e,t]},l=vf(s,a),[c,d]=Sx(l,n,o.overwriteMode).selection,u=l.value.slice(0,c)+n,g=u.length,h=Xa({value:u+l.value.slice(d),selection:[g,g]},a,s);if(r.slice(0,e)===Xa({value:u,selection:[g,g]},a,s).value||Cx(this,h))throw new Error("Invalid mask value");this.value=h.value,this.selection=h.selection}deleteCharacters([e,t]){if(e===t||!t)return;let{value:n}=this,r=this.getMaskExpression({value:n.slice(0,e)+n.slice(t),selection:[e,e]}),o={value:n,selection:[e,t]},a=vf(o,r),[s,l]=a.selection,c=a.value.slice(0,s)+a.value.slice(l),d=Xa({value:c,selection:[s,s]},r,o);this.value=d.value,this.selection=d.selection}getMaskExpression(e){let{mask:t}=this.maskOptions;return typeof t=="function"?t(e):t}},Rc=class{constructor(e){this.element=e,this.listeners=[]}listen(e,t,n){let r=t;this.element.addEventListener(e,r,n),this.listeners.push(()=>this.element.removeEventListener(e,r,n))}destroy(){this.listeners.forEach(e=>e())}},ci={CTRL:1,ALT:2,SHIFT:4,META:8},Gr={Y:89,Z:90};function Xr(i,e,t){return i.ctrlKey===!!(e&ci.CTRL)&&i.altKey===!!(e&ci.ALT)&&i.shiftKey===!!(e&ci.SHIFT)&&i.metaKey===!!(e&ci.META)&&i.keyCode===t}function Dx(i){return Xr(i,ci.CTRL,Gr.Y)||Xr(i,ci.CTRL|ci.SHIFT,Gr.Z)||Xr(i,ci.META|ci.SHIFT,Gr.Z)}function kx(i){return Xr(i,ci.CTRL,Gr.Z)||Xr(i,ci.META,Gr.Z)}function nr(i,e){var t;let n=i.value;if(typeof e=="string")i.value=e;else{let[r,o]=e.selection;i.value=e.value,i.matches(":focus")&&((t=i.setSelectionRange)===null||t===void 0||t.call(i,r,o))}i.value!==n&&i.dispatchEvent(new Event("input",{bubbles:!0}))}function Tx({value:i,selection:e},t){let[n,r]=e;if(n!==r)return[n,r];let o=t?i.slice(n).indexOf(`
|
|
14
|
+
`)+1||i.length:i.slice(0,r).lastIndexOf(`
|
|
15
|
+
`)+1;return[t?n:o,t?o:r]}function Ix({value:i,selection:e},t){let[n,r]=e;return n!==r?[n,r]:(t?[n,r+1]:[n-1,r]).map(a=>Math.min(Math.max(a,0),i.length))}var Ox=/\s+$/g,Fx=/^\s+/g,bf=/\s/;function Rx({value:i,selection:e},t){let[n,r]=e;if(n!==r)return[n,r];if(t){let l=i.slice(n),[c]=l.match(Fx)||[""],d=l.trimStart().search(bf);return[n,d!==-1?n+c.length+d:i.length]}let o=i.slice(0,r),[a]=o.match(Ox)||[""],s=o.trimEnd().split("").reverse().findIndex(l=>bf.exec(l));return[s!==-1?r-a.length-s:0,r]}function Ya(i=[]){return(e,...t)=>i.reduce((n,r)=>Object.assign(Object.assign({},n),r(n,...t)),e)}function un(i,e){let t=Object.assign(Object.assign({},ir),e),n=Ya(t.preprocessors),r=Ya(t.postprocessors),o=typeof i=="string"?{value:i,selection:[0,0]}:i,{elementState:a}=n({elementState:o,data:""},"validation"),s=new Yr(a,t),{value:l,selection:c}=r(s,o);return typeof i=="string"?l:{value:l,selection:c}}var Ka=class extends Fc{constructor(e,t){super(),this.element=e,this.maskitoOptions=t,this.isTextArea=this.element.nodeName==="TEXTAREA",this.eventListener=new Rc(this.element),this.options=Object.assign(Object.assign({},ir),this.maskitoOptions),this.upcomingElementState=null,this.preprocessor=Ya(this.options.preprocessors),this.postprocessor=Ya(this.options.postprocessors),this.teardowns=this.options.plugins.map(n=>n(this.element,this.options)),this.updateHistory(this.elementState),this.eventListener.listen("keydown",n=>{if(Dx(n))return n.preventDefault(),this.redo();if(kx(n))return n.preventDefault(),this.undo()}),this.eventListener.listen("beforeinput",n=>{var r,o,a;let s=n.inputType.includes("Forward");switch(this.updateHistory(this.elementState),n.inputType){case"deleteByCut":case"deleteContentBackward":case"deleteContentForward":return this.handleDelete({event:n,isForward:s,selection:Ix(this.elementState,s)});case"deleteHardLineBackward":case"deleteHardLineForward":case"deleteSoftLineBackward":case"deleteSoftLineForward":return this.handleDelete({event:n,isForward:s,selection:Tx(this.elementState,s),force:!0});case"deleteWordBackward":case"deleteWordForward":return this.handleDelete({event:n,isForward:s,selection:Rx(this.elementState,s),force:!0});case"historyRedo":return n.preventDefault(),this.redo();case"historyUndo":return n.preventDefault(),this.undo();case"insertCompositionText":return;case"insertLineBreak":case"insertParagraph":return this.handleEnter(n);case"insertReplacementText":return;case"insertFromDrop":case"insertFromPaste":case"insertText":default:return this.handleInsert(n,(a=(r=n.data)!==null&&r!==void 0?r:(o=n.dataTransfer)===null||o===void 0?void 0:o.getData("text/plain"))!==null&&a!==void 0?a:"")}}),this.eventListener.listen("input",()=>{this.upcomingElementState&&(this.updateElementState(this.upcomingElementState),this.upcomingElementState=null)},{capture:!0}),this.eventListener.listen("input",({inputType:n})=>{n!=="insertCompositionText"&&(this.ensureValueFitsMask(),this.updateHistory(this.elementState))}),this.eventListener.listen("compositionend",()=>{this.ensureValueFitsMask(),this.updateHistory(this.elementState)})}destroy(){this.eventListener.destroy(),this.teardowns.forEach(e=>e?.())}updateElementState({value:e,selection:t},n){let r=this.elementState.value;this.updateValue(e),this.updateSelectionRange(t),n&&r!==e&&this.dispatchInputEvent(n)}get elementState(){let{value:e,selectionStart:t,selectionEnd:n}=this.element;return{value:e,selection:[t??0,n??0]}}get maxLength(){let{maxLength:e}=this.element;return e===-1?1/0:e}updateSelectionRange([e,t]){var n;let{element:r}=this;r.matches(":focus")&&(r.selectionStart!==e||r.selectionEnd!==t)&&((n=r.setSelectionRange)===null||n===void 0||n.call(r,e,t))}updateValue(e){this.element.value=e}ensureValueFitsMask(){this.updateElementState(un(this.elementState,this.options),{inputType:"insertText",data:null})}dispatchInputEvent(e={inputType:"insertText",data:null}){globalThis.InputEvent&&this.element.dispatchEvent(new InputEvent("input",Object.assign(Object.assign({},e),{bubbles:!0,cancelable:!1})))}handleDelete({event:e,selection:t,isForward:n,force:r=!1}){let o={value:this.elementState.value,selection:t},[a,s]=o.selection,{elementState:l}=this.preprocessor({elementState:o,data:""},n?"deleteForward":"deleteBackward"),c=new Yr(l,this.options),[d,u]=l.selection;c.deleteCharacters([d,u]);let g=this.postprocessor(c,o);if(!(o.value.slice(0,a)+o.value.slice(s)===g.value&&!r&&!this.element.isContentEditable)){if(xx(o,l,c,g))return e.preventDefault(),this.updateSelectionRange(n?[u,u]:[d,d]);this.upcomingElementState=g}}handleInsert(e,t){let{options:n,maxLength:r,element:o,elementState:a}=this,{elementState:s,data:l=t}=this.preprocessor({data:t,elementState:a},"insert"),c=new Yr(s,n);try{c.addCharacters(s.selection,l)}catch{return e.preventDefault()}let[d,u]=s.selection,g=a.value.slice(0,d)+t+a.value.slice(u),h=this.postprocessor(c,a);if(h.value.length>r)return e.preventDefault();(g!==h.value||o.isContentEditable)&&(this.upcomingElementState=h,n.overwriteMode==="replace"&&g.length>r&&this.dispatchInputEvent({inputType:"insertText",data:t}))}handleEnter(e){(this.isTextArea||this.element.isContentEditable)&&this.handleInsert(e,`
|
|
16
|
+
`)}};function rr(i,e,t){let n=Math.min(Number(t),Math.max(Number(e),Number(i)));return i instanceof Date?new Date(n):n}var Mx=[".",",","\u0431","\u044E"];var Ac="\xA0",Ax="\u200B",Ef="\u2013",Df="\u2014",Za="-",Mc="\u2212",kf="\u30FC";var UT=new RegExp(`[${Ac}APM]+$`,"g"),WT=new RegExp(`${Ac}[AP]M$`,"g"),Bx=[":","."];function or(i){return i}function Nx(){}var Tf=/[\\^$.*+?()[\]{}|]/g,zx=new RegExp(Tf.source);function gt(i){return i&&zx.test(i)?i.replaceAll(Tf,String.raw`\$&`):i}function di(i,{prefix:e,postfix:t}){var n,r;let o=new RegExp(`^${gt(e)}`),a=new RegExp(`${gt(t)}$`),[s=""]=(n=i.match(o))!==null&&n!==void 0?n:[],[l=""]=(r=i.match(a))!==null&&r!==void 0?r:[];return{extractedPrefix:s,extractedPostfix:l,cleanValue:s||l?i.slice(s.length,l.length?-l.length:1/0):i}}function Lx(i,e){let t="";for(let n=0;n<i.length;n++){if(i[n]!==e[n])return t;t+=i[n]}return t}function xf(i){return i.replaceAll(/[0-9]/g,e=>String.fromCharCode(e.charCodeAt(0)-65248))}function Hx(){return({elementState:i,data:e})=>{let{value:t,selection:n}=i;return{elementState:{selection:n,value:xf(t)},data:xf(e)}}}var $T=new RegExp(`[${Bx.map(gt).join("")}]$`);function jx(i){let e=new RegExp(`${gt(i)}$`);return i?({value:t,selection:n},r)=>{if(!t&&!r.value.endsWith(i))return{value:t,selection:n};if(!t.endsWith(i)&&!r.value.endsWith(i))return{selection:n,value:t+i};let o=r.value.replace(e,""),a=r.selection[1]>o.length,s=Lx(o,t);return{selection:n,value:Array.from(i).reverse().reduce((l,c,d)=>{let u=l.length-1-d,g=s[u]===c&&a;return l[u]!==c||g?l.slice(0,u+1)+c+l.slice(u+1):l},t)}}:or}function Vx(i){return i?({value:e,selection:t},n)=>{if(e.startsWith(i)||!e&&!n.value.startsWith(i))return{value:e,selection:t};let[r,o]=t,a=Array.from(i).reduce((l,c,d)=>l[d]===c?l:l.slice(0,d)+c+l.slice(d),e),s=a.length-e.length;return{selection:[r+s,o+s],value:a}}:or}function ar(i,e,t){return(n,r)=>{let o=()=>e(n,r);return n.addEventListener(i,o,t),()=>n.removeEventListener(i,o,t)}}function Ux(i){return(e,t)=>{let n=e.ownerDocument,r=0,o=()=>r++,a=()=>{r=Math.max(--r,0)},s=()=>{if(e.matches(":focus")){if(r)return n.addEventListener("mouseup",s,{once:!0,passive:!0});i(e,t)}};return n.addEventListener("selectionchange",s,{passive:!0}),e.addEventListener("mousedown",o,{passive:!0}),n.addEventListener("mouseup",a,{passive:!0}),()=>{n.removeEventListener("selectionchange",s),n.removeEventListener("mousedown",o),n.removeEventListener("mouseup",a)}}}function If(i){return Ux(e=>{var t,n;let r=(t=e.selectionStart)!==null&&t!==void 0?t:0,o=(n=e.selectionEnd)!==null&&n!==void 0?n:0,[a,s]=i(e.value,[r,o]);(a>r||s<o)&&e.setSelectionRange(rr(r,a,s),rr(o,a,s))})}function Wx({prefix:i,postfix:e}){return({elementState:t,data:n})=>{let{cleanValue:r}=di(n,{prefix:i,postfix:e});return{elementState:t,data:r}}}function Of({decimalSeparator:i,isNegativeAllowed:e,precision:t,thousandSeparator:n,prefix:r,postfix:o,decimalPseudoSeparators:a=[],pseudoMinuses:s=[],minusSign:l}){let c=Cf(r),d=String.raw`\d`,u=e?`[${l}${s.map(N=>`\\${N}`).join("")}]?`:"",g=n?`[${d}${gt(n).replaceAll(/\s/g,String.raw`\s`)}]*`:`[${d}]*`,h=Number.isFinite(t)?t:"",_=t>0?`([${gt(i)}${a.map(gt).join("")}]${d}{0,${h}})?`:"",E=Cf(o);return new RegExp(`^${c}${u}${g}${_}${E}$`)}function Cf(i){return i?`${i.split("").map(e=>`${gt(e)}?`).join("")}`:""}function Bc(i,e="."){let t=!!new RegExp(`^\\D*[${Mc}\\${Za}${Ef}${Df}${kf}]`).exec(i),n=gt(e),r=i.replaceAll(new RegExp(`${n}(?!\\d)`,"g"),"").replaceAll(new RegExp(`[^\\d${n}]`,"g"),"").replace(e,e&&".");return r?+`${t?Za:""}${r}`:NaN}function $x(i){var e;let t=String(i),[n="",r]=t.split("e-"),o=t;if(r){let[,a]=n.split("."),s=Number(r)+((e=a?.length)!==null&&e!==void 0?e:0);o=i.toFixed(s)}return o}function Ff(i,{decimalSeparator:e,minusSign:t}){let[n="",r=""]=e?i.split(e):[i],o=gt(t),[,a="",s=""]=new RegExp(`^(?:[^\\d${o}])?(${o})?(.*)`).exec(n)||[];return{minus:a,integerPart:s,decimalPart:r}}function qx({decimalSeparator:i,thousandSeparator:e,decimalPseudoSeparators:t=Mx}){return t.filter(n=>n!==e&&n!==i)}function Gx({decimalSeparator:i,precision:e,decimalZeroPadding:t,prefix:n,postfix:r}){return e<=0||!t?or:({value:o,selection:a})=>{let{cleanValue:s,extractedPrefix:l,extractedPostfix:c}=di(o,{prefix:n,postfix:r});if(Number.isNaN(Bc(s,i)))return{value:o,selection:a};let[d,u=""]=s.split(i);return{value:l+d+i+u.padEnd(e,"0")+c,selection:a}}}function Xx({prefix:i,postfix:e,decimalSeparator:t,minusSign:n}){return({value:r,selection:o})=>{let[a]=o,{cleanValue:s,extractedPrefix:l,extractedPostfix:c}=di(r,{prefix:i,postfix:e}),{minus:d,integerPart:u,decimalPart:g}=Ff(s,{decimalSeparator:t,minusSign:n}),h=!u&&!g&&!!t&&s.includes(t);return!u&&!Number(g)&&a===(d+l).length||h?{selection:o,value:l+d+c}:{value:r,selection:o}}}function Yx({decimalSeparator:i,decimalPseudoSeparators:e,pseudoMinuses:t,prefix:n,postfix:r,minusSign:o}){let a=!0,s=Of({decimalSeparator:i,decimalPseudoSeparators:e,pseudoMinuses:t,prefix:"",postfix:"",thousandSeparator:"",precision:1/0,isNegativeAllowed:!0,minusSign:o});return({elementState:l,data:c})=>{if(!a)return{elementState:l,data:c};a=!1;let{value:d,selection:u}=l,[g,h]=u,{extractedPrefix:_,cleanValue:E,extractedPostfix:N}=di(d,{prefix:n,postfix:r}),M=un({selection:[Math.max(g-_.length,0),rr(h-_.length,0,E.length)],value:E},{mask:s}),[U,de]=M.selection;return{elementState:{selection:[U+_.length,de+_.length],value:_+M.value+N},data:c}}}function Kx({decimalSeparator:i,thousandSeparator:e,prefix:t,postfix:n}){let r=a=>{let s=gt(e);return a.replace(new RegExp(`^(\\D+)?[0${s}]+(?=0)`),"$1").replace(new RegExp(`^(\\D+)?[0${s}]+(?=[1-9])`),"$1")},o=(a,s)=>{let l=a.slice(0,s),c=a.slice(s).startsWith("0");return l.length-r(l).length+(c?1:0)};return({value:a,selection:s})=>{let[l,c]=s,{cleanValue:d,extractedPrefix:u,extractedPostfix:g}=di(a,{prefix:t,postfix:n}),h=!!i&&d.includes(i),[_="",E=""]=i?d.split(i):[d],N=r(_);if(_===N)return{value:a,selection:s};let M=l-o(a,l),U=c-o(a,c);return{value:u+N+(h?i:"")+E+g,selection:[Math.max(M,0),Math.max(U,0)]}}}function Qx({min:i,max:e,decimalSeparator:t,minusSign:n}){return({value:r,selection:o})=>{let a=Bc(r,t),s=a>0?Math.min(a,e):Math.max(a,i);if(a&&s!==a){let l=`${s}`.replace(".",t).replace(Za,n);return{value:l,selection:[l.length,l.length]}}return{value:r,selection:o}}}function Zx({decimalSeparator:i,thousandSeparator:e,decimalZeroPadding:t}){return({elementState:n,data:r},o)=>{let{value:a,selection:s}=n,[l,c]=s,d=a.slice(l,c),u=t?[i,e]:[e],g=t&&l>a.indexOf(i)&&!!d.match(/^0+$/gi);return o!=="deleteBackward"&&o!=="deleteForward"||!u.includes(d)&&!g?{elementState:n,data:r}:{elementState:{value:a,selection:o==="deleteForward"?[c,c]:[l,l]},data:r}}}function Jx({decimalSeparator:i,precision:e,prefix:t,postfix:n}){let r=new RegExp(`^\\D*${gt(i)}`);return({elementState:o,data:a})=>{let{value:s,selection:l}=o,{cleanValue:c,extractedPrefix:d}=di(s,{prefix:t,postfix:n}),[u,g]=l,h=rr(u-d.length,0,c.length),_=rr(g-d.length,0,c.length);if(e<=0||c.slice(0,h).includes(i)||c.slice(_).includes(i)||!a.match(r))return{elementState:o,data:a};let E=/\d+/.exec(c.slice(0,h));return{elementState:o,data:E?a:`0${a}`}}}function Sf({validCharacter:i,pseudoCharacters:e,prefix:t,postfix:n}){let r=new RegExp(`[${e.join("")}]`,"gi");return({elementState:o,data:a})=>{let{value:s,selection:l}=o,{cleanValue:c,extractedPostfix:d,extractedPrefix:u}=di(s,{prefix:t,postfix:n});return{elementState:{selection:l,value:u+c.replace(r,i)+d},data:a.replace(r,i)}}}function eC({decimalSeparator:i,prefix:e,postfix:t}){return i?({elementState:n,data:r})=>{let{value:o,selection:a}=n,[s,l]=a,{cleanValue:c}=di(o,{prefix:e,postfix:t});return{elementState:n,data:!c.includes(i)||o.slice(s,l+1).includes(i)?r:r.replaceAll(new RegExp(gt(i),"gi"),"")}}:or}function tC({thousandSeparator:i,decimalSeparator:e,prefix:t,postfix:n,minusSign:r}){if(!i)return or;let o=(...a)=>a.every(s=>/\s/.test(s));return({value:a,selection:s})=>{let[l,c]=s,[d,u]=s,{cleanValue:g,extractedPostfix:h,extractedPrefix:_}=di(a,{prefix:t,postfix:n}),{minus:E,integerPart:N,decimalPart:M}=Ff(g,{decimalSeparator:e,minusSign:r}),U=e&&g.includes(e),de=g.length-(E+N+(U?e+M:"")).length;de>0&&l&&l<=de&&(d-=de),de>0&&c&&c<=de&&(u-=de);let oe=Array.from(N).reduceRight((ee,b,w)=>{let A=!(!w&&b===i)&&!!ee.length&&(ee.length+1)%4===0,L=b===i||o(b,i);return A&&L?i+ee:!A&&L?(w&&w<=l&&d--,w&&w<=c&&u--,ee):A?(w<l&&d++,w<c&&u++,b+i+ee):b+ee},"");return{value:_+E+oe+(U?e:"")+M+h,selection:[d,u]}}}function iC({precision:i,decimalSeparator:e,prefix:t,postfix:n}){if(i>0||!e)return or;let r=new RegExp(`${gt(e)}.*$`,"g");return({elementState:o,data:a})=>{let{value:s,selection:l}=o,{cleanValue:c,extractedPrefix:d,extractedPostfix:u}=di(s,{prefix:t,postfix:n}),[g,h]=l,_=d+c.replace(r,"")+u;return{elementState:{selection:[Math.min(g,_.length),Math.min(h,_.length)],value:_},data:a.replace(r,"")}}}var Pf=[0,0];function nC({decimalSeparator:i,thousandSeparator:e,prefix:t,postfix:n}){let r=Kx({decimalSeparator:i,thousandSeparator:e,prefix:t,postfix:n});return ar("blur",o=>{let a=r({value:o.value,selection:Pf},{value:"",selection:Pf}).value;nr(o,a)},{capture:!0})}function rC({min:i,max:e,decimalSeparator:t}){return ar("blur",(n,r)=>{let o=Bc(n.value,t),a=rr(o,i,e);!Number.isNaN(o)&&o!==a&&nr(n,un($x(a),r))},{capture:!0})}function oC({decimalSeparator:i,prefix:e,postfix:t}){return i?ar("blur",n=>{let{cleanValue:r,extractedPostfix:o,extractedPrefix:a}=di(n.value,{prefix:e,postfix:t}),s=a+r.replace(new RegExp(`^(\\D+)?${gt(i)}`),`$10${i}`)+o;nr(n,s)},{capture:!0}):Nx}function sr({max:i=Number.MAX_SAFE_INTEGER,min:e=Number.MIN_SAFE_INTEGER,precision:t=0,thousandSeparator:n=Ac,decimalSeparator:r=".",decimalPseudoSeparators:o,decimalZeroPadding:a=!1,prefix:s="",postfix:l="",minusSign:c=Mc}={}){let d=[Za,Ef,Df,kf,Mc].filter(_=>_!==n&&_!==r&&_!==c),u=qx({decimalSeparator:r,thousandSeparator:n,decimalPseudoSeparators:o}),g=s.endsWith(r)&&t>0?`${s}${Ax}`:s,h=Yx({decimalSeparator:r,decimalPseudoSeparators:u,pseudoMinuses:d,prefix:g,postfix:l,minusSign:c});return r=t<=0&&r===n?"":r,Object.assign(Object.assign({},ir),{mask:Of({decimalSeparator:r,precision:t,thousandSeparator:n,prefix:g,postfix:l,isNegativeAllowed:e<0,minusSign:c}),preprocessors:[Hx(),h,Wx({prefix:g,postfix:l}),Sf({validCharacter:c,pseudoCharacters:d,prefix:g,postfix:l}),Sf({validCharacter:r,pseudoCharacters:u,prefix:g,postfix:l}),Jx({decimalSeparator:r,precision:t,prefix:g,postfix:l}),Zx({decimalSeparator:r,decimalZeroPadding:a,thousandSeparator:n}),iC({precision:t,decimalSeparator:r,prefix:g,postfix:l}),eC({decimalSeparator:r,prefix:g,postfix:l})],postprocessors:[Qx({decimalSeparator:r,min:e,max:i,minusSign:c}),Vx(g),jx(l),tC({decimalSeparator:r,thousandSeparator:n,prefix:g,postfix:l,minusSign:c}),Gx({decimalSeparator:r,decimalZeroPadding:a,precision:t,prefix:g,postfix:l}),Xx({prefix:g,postfix:l,decimalSeparator:r,minusSign:c})],plugins:[nC({decimalSeparator:r,thousandSeparator:n,prefix:g,postfix:l}),oC({decimalSeparator:r,prefix:g,postfix:l}),rC({min:e,max:i,decimalSeparator:r})],overwriteMode:a?({value:_,selection:[E]})=>E<=_.indexOf(r)?"shift":"replace":"shift"})}var Ji=(()=>{class i{constructor(){this.elementRef=z(Et).nativeElement,this.ngZone=z(Pt),this.maskedElement=null,this.options=null,this.elementPredicate=_f;let t=z(tt,{self:!0,optional:!0});if(t){let n=t.writeValue.bind(t);t.writeValue=r=>{n(this.options?un(String(r??""),this.options):r)}}}ngOnChanges(){return B(this,null,function*(){let{elementPredicate:t,options:n,maskedElement:r,elementRef:o,ngZone:a}=this;if(r?.destroy(),!n)return;let s=yield t(o);this.elementPredicate!==t||this.options!==n||a.runOutsideAngular(()=>{this.maskedElement=new Ka(s,n)})})}ngOnDestroy(){this.maskedElement?.destroy()}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275dir=ln({type:i,selectors:[["","maskito",""]],inputs:{options:[0,"maskito","options"],elementPredicate:[0,"maskitoElement","elementPredicate"]},standalone:!0,features:[gi]})}}return i})(),Rf=(()=>{class i{transform(t,n){return un(String(t??""),n??ir)}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275pipe=ta({name:"maskito",type:i,pure:!0,standalone:!0})}}return i})();var sC=20,Af=(()=>{class i{constructor(t,n,r){this._ngZone=t,this._platform=n,this._scrolled=new et,this._globalSubscription=null,this._scrolledCount=0,this.scrollContainers=new Map,this._document=r}register(t){this.scrollContainers.has(t)||this.scrollContainers.set(t,t.elementScrolled().subscribe(()=>this._scrolled.next(t)))}deregister(t){let n=this.scrollContainers.get(t);n&&(n.unsubscribe(),this.scrollContainers.delete(t))}scrolled(t=sC){return this._platform.isBrowser?new St(n=>{this._globalSubscription||this._addGlobalListener();let r=t>0?this._scrolled.pipe(ol(t)).subscribe(n):this._scrolled.subscribe(n);return this._scrolledCount++,()=>{r.unsubscribe(),this._scrolledCount--,this._scrolledCount||this._removeGlobalListener()}}):Le()}ngOnDestroy(){this._removeGlobalListener(),this.scrollContainers.forEach((t,n)=>this.deregister(n)),this._scrolled.complete()}ancestorScrolled(t,n){let r=this.getAncestorScrollContainers(t);return this.scrolled(n).pipe(Jt(o=>!o||r.indexOf(o)>-1))}getAncestorScrollContainers(t){let n=[];return this.scrollContainers.forEach((r,o)=>{this._scrollableContainsElement(o,t)&&n.push(o)}),n}_getWindow(){return this._document.defaultView||window}_scrollableContainsElement(t,n){let r=Lp(n),o=t.getElementRef().nativeElement;do if(r==o)return!0;while(r=r.parentElement);return!1}_addGlobalListener(){this._globalSubscription=this._ngZone.runOutsideAngular(()=>{let t=this._getWindow();return an(t.document,"scroll").subscribe(()=>this._scrolled.next())})}_removeGlobalListener(){this._globalSubscription&&(this._globalSubscription.unsubscribe(),this._globalSubscription=null)}static{this.\u0275fac=function(n){return new(n||i)(pe(Pt),pe(Ii),pe(mt,8))}}static{this.\u0275prov=Ue({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var lC=20,Kr=(()=>{class i{constructor(t,n,r){this._platform=t,this._change=new et,this._changeListener=o=>{this._change.next(o)},this._document=r,n.runOutsideAngular(()=>{if(t.isBrowser){let o=this._getWindow();o.addEventListener("resize",this._changeListener),o.addEventListener("orientationchange",this._changeListener)}this.change().subscribe(()=>this._viewportSize=null)})}ngOnDestroy(){if(this._platform.isBrowser){let t=this._getWindow();t.removeEventListener("resize",this._changeListener),t.removeEventListener("orientationchange",this._changeListener)}this._change.complete()}getViewportSize(){this._viewportSize||this._updateViewportSize();let t={width:this._viewportSize.width,height:this._viewportSize.height};return this._platform.isBrowser||(this._viewportSize=null),t}getViewportRect(){let t=this.getViewportScrollPosition(),{width:n,height:r}=this.getViewportSize();return{top:t.top,left:t.left,bottom:t.top+r,right:t.left+n,height:r,width:n}}getViewportScrollPosition(){if(!this._platform.isBrowser)return{top:0,left:0};let t=this._document,n=this._getWindow(),r=t.documentElement,o=r.getBoundingClientRect(),a=-o.top||t.body.scrollTop||n.scrollY||r.scrollTop||0,s=-o.left||t.body.scrollLeft||n.scrollX||r.scrollLeft||0;return{top:a,left:s}}change(t=lC){return t>0?this._change.pipe(ol(t)):this._change}_getWindow(){return this._document.defaultView||window}_updateViewportSize(){let t=this._getWindow();this._viewportSize=this._platform.isBrowser?{width:t.innerWidth,height:t.innerHeight}:{width:0,height:0}}static{this.\u0275fac=function(n){return new(n||i)(pe(Ii),pe(Pt),pe(mt,8))}}static{this.\u0275prov=Ue({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var Ja=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=Nt({type:i})}static{this.\u0275inj=Bt({})}}return i})(),Nc=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=Nt({type:i})}static{this.\u0275inj=Bt({imports:[Mr,Ja,Mr,Ja]})}}return i})();var Nf=zp(),zc=class{constructor(e,t){this._viewportRuler=e,this._previousHTMLStyles={top:"",left:""},this._isEnabled=!1,this._document=t}attach(){}enable(){if(this._canBeEnabled()){let e=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=e.style.left||"",this._previousHTMLStyles.top=e.style.top||"",e.style.left=We(-this._previousScrollPosition.left),e.style.top=We(-this._previousScrollPosition.top),e.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){let e=this._document.documentElement,t=this._document.body,n=e.style,r=t.style,o=n.scrollBehavior||"",a=r.scrollBehavior||"";this._isEnabled=!1,n.left=this._previousHTMLStyles.left,n.top=this._previousHTMLStyles.top,e.classList.remove("cdk-global-scrollblock"),Nf&&(n.scrollBehavior=r.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),Nf&&(n.scrollBehavior=o,r.scrollBehavior=a)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;let t=this._document.body,n=this._viewportRuler.getViewportSize();return t.scrollHeight>n.height||t.scrollWidth>n.width}};var Lc=class{constructor(e,t,n,r){this._scrollDispatcher=e,this._ngZone=t,this._viewportRuler=n,this._config=r,this._scrollSubscription=null,this._detach=()=>{this.disable(),this._overlayRef.hasAttached()&&this._ngZone.run(()=>this._overlayRef.detach())}}attach(e){this._overlayRef,this._overlayRef=e}enable(){if(this._scrollSubscription)return;let e=this._scrollDispatcher.scrolled(0).pipe(Jt(t=>!t||!this._overlayRef.overlayElement.contains(t.getElementRef().nativeElement)));this._config&&this._config.threshold&&this._config.threshold>1?(this._initialScrollPosition=this._viewportRuler.getViewportScrollPosition().top,this._scrollSubscription=e.subscribe(()=>{let t=this._viewportRuler.getViewportScrollPosition().top;Math.abs(t-this._initialScrollPosition)>this._config.threshold?this._detach():this._overlayRef.updatePosition()})):this._scrollSubscription=e.subscribe(this._detach)}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}},es=class{enable(){}disable(){}attach(){}};function Hc(i,e){return e.some(t=>{let n=i.bottom<t.top,r=i.top>t.bottom,o=i.right<t.left,a=i.left>t.right;return n||r||o||a})}function zf(i,e){return e.some(t=>{let n=i.top<t.top,r=i.bottom>t.bottom,o=i.left<t.left,a=i.right>t.right;return n||r||o||a})}var jc=class{constructor(e,t,n,r){this._scrollDispatcher=e,this._viewportRuler=t,this._ngZone=n,this._config=r,this._scrollSubscription=null}attach(e){this._overlayRef,this._overlayRef=e}enable(){if(!this._scrollSubscription){let e=this._config?this._config.scrollThrottle:0;this._scrollSubscription=this._scrollDispatcher.scrolled(e).subscribe(()=>{if(this._overlayRef.updatePosition(),this._config&&this._config.autoClose){let t=this._overlayRef.overlayElement.getBoundingClientRect(),{width:n,height:r}=this._viewportRuler.getViewportSize();Hc(t,[{width:n,height:r,bottom:r,right:n,top:0,left:0}])&&(this.disable(),this._ngZone.run(()=>this._overlayRef.detach()))}})}}disable(){this._scrollSubscription&&(this._scrollSubscription.unsubscribe(),this._scrollSubscription=null)}detach(){this.disable(),this._overlayRef=null}},dC=(()=>{class i{constructor(t,n,r,o){this._scrollDispatcher=t,this._viewportRuler=n,this._ngZone=r,this.noop=()=>new es,this.close=a=>new Lc(this._scrollDispatcher,this._ngZone,this._viewportRuler,a),this.block=()=>new zc(this._viewportRuler,this._document),this.reposition=a=>new jc(this._scrollDispatcher,this._viewportRuler,this._ngZone,a),this._document=o}static{this.\u0275fac=function(n){return new(n||i)(pe(Af),pe(Kr),pe(Pt),pe(mt))}}static{this.\u0275prov=Ue({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),Qr=class{constructor(e){if(this.scrollStrategy=new es,this.panelClass="",this.hasBackdrop=!1,this.backdropClass="cdk-overlay-dark-backdrop",this.disposeOnNavigation=!1,e){let t=Object.keys(e);for(let n of t)e[n]!==void 0&&(this[n]=e[n])}}};var Vc=class{constructor(e,t){this.connectionPair=e,this.scrollableViewProperties=t}};var Wf=(()=>{class i{constructor(t){this._attachedOverlays=[],this._document=t}ngOnDestroy(){this.detach()}add(t){this.remove(t),this._attachedOverlays.push(t)}remove(t){let n=this._attachedOverlays.indexOf(t);n>-1&&this._attachedOverlays.splice(n,1),this._attachedOverlays.length===0&&this.detach()}static{this.\u0275fac=function(n){return new(n||i)(pe(mt))}}static{this.\u0275prov=Ue({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),uC=(()=>{class i extends Wf{constructor(t,n){super(t),this._ngZone=n,this._keydownListener=r=>{let o=this._attachedOverlays;for(let a=o.length-1;a>-1;a--)if(o[a]._keydownEvents.observers.length>0){let s=o[a]._keydownEvents;this._ngZone?this._ngZone.run(()=>s.next(r)):s.next(r);break}}}add(t){super.add(t),this._isAttached||(this._ngZone?this._ngZone.runOutsideAngular(()=>this._document.body.addEventListener("keydown",this._keydownListener)):this._document.body.addEventListener("keydown",this._keydownListener),this._isAttached=!0)}detach(){this._isAttached&&(this._document.body.removeEventListener("keydown",this._keydownListener),this._isAttached=!1)}static{this.\u0275fac=function(n){return new(n||i)(pe(mt),pe(Pt,8))}}static{this.\u0275prov=Ue({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),pC=(()=>{class i extends Wf{constructor(t,n,r){super(t),this._platform=n,this._ngZone=r,this._cursorStyleIsSet=!1,this._pointerDownListener=o=>{this._pointerDownEventTarget=Ar(o)},this._clickListener=o=>{let a=Ar(o),s=o.type==="click"&&this._pointerDownEventTarget?this._pointerDownEventTarget:a;this._pointerDownEventTarget=null;let l=this._attachedOverlays.slice();for(let c=l.length-1;c>-1;c--){let d=l[c];if(d._outsidePointerEvents.observers.length<1||!d.hasAttached())continue;if(Lf(d.overlayElement,a)||Lf(d.overlayElement,s))break;let u=d._outsidePointerEvents;this._ngZone?this._ngZone.run(()=>u.next(o)):u.next(o)}}}add(t){if(super.add(t),!this._isAttached){let n=this._document.body;this._ngZone?this._ngZone.runOutsideAngular(()=>this._addEventListeners(n)):this._addEventListeners(n),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=n.style.cursor,n.style.cursor="pointer",this._cursorStyleIsSet=!0),this._isAttached=!0}}detach(){if(this._isAttached){let t=this._document.body;t.removeEventListener("pointerdown",this._pointerDownListener,!0),t.removeEventListener("click",this._clickListener,!0),t.removeEventListener("auxclick",this._clickListener,!0),t.removeEventListener("contextmenu",this._clickListener,!0),this._platform.IOS&&this._cursorStyleIsSet&&(t.style.cursor=this._cursorOriginalValue,this._cursorStyleIsSet=!1),this._isAttached=!1}}_addEventListeners(t){t.addEventListener("pointerdown",this._pointerDownListener,!0),t.addEventListener("click",this._clickListener,!0),t.addEventListener("auxclick",this._clickListener,!0),t.addEventListener("contextmenu",this._clickListener,!0)}static{this.\u0275fac=function(n){return new(n||i)(pe(mt),pe(Ii),pe(Pt,8))}}static{this.\u0275prov=Ue({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();function Lf(i,e){let t=typeof ShadowRoot<"u"&&ShadowRoot,n=e;for(;n;){if(n===i)return!0;n=t&&n instanceof ShadowRoot?n.host:n.parentNode}return!1}var $f=(()=>{class i{constructor(t,n){this._platform=n,this._document=t}ngOnDestroy(){this._containerElement?.remove()}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){let t="cdk-overlay-container";if(this._platform.isBrowser||wl()){let r=this._document.querySelectorAll(`.${t}[platform="server"], .${t}[platform="test"]`);for(let o=0;o<r.length;o++)r[o].remove()}let n=this._document.createElement("div");n.classList.add(t),wl()?n.setAttribute("platform","test"):this._platform.isBrowser||n.setAttribute("platform","server"),this._document.body.appendChild(n),this._containerElement=n}static{this.\u0275fac=function(n){return new(n||i)(pe(mt),pe(Ii))}}static{this.\u0275prov=Ue({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),Uc=class{constructor(e,t,n,r,o,a,s,l,c,d=!1,u){this._portalOutlet=e,this._host=t,this._pane=n,this._config=r,this._ngZone=o,this._keyboardDispatcher=a,this._document=s,this._location=l,this._outsideClickDispatcher=c,this._animationsDisabled=d,this._injector=u,this._backdropElement=null,this._backdropClick=new et,this._attachments=new et,this._detachments=new et,this._locationChanges=$i.EMPTY,this._backdropClickHandler=g=>this._backdropClick.next(g),this._backdropTransitionendHandler=g=>{this._disposeBackdrop(g.target)},this._keydownEvents=new et,this._outsidePointerEvents=new et,this._renders=new et,r.scrollStrategy&&(this._scrollStrategy=r.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=r.positionStrategy,this._afterRenderRef=gp(()=>fp(()=>{this._renders.next()},{injector:this._injector}))}get overlayElement(){return this._pane}get backdropElement(){return this._backdropElement}get hostElement(){return this._host}attach(e){!this._host.parentElement&&this._previousHostParent&&this._previousHostParent.appendChild(this._host);let t=this._portalOutlet.attach(e);return this._positionStrategy&&this._positionStrategy.attach(this),this._updateStackingOrder(),this._updateElementSize(),this._updateElementDirection(),this._scrollStrategy&&this._scrollStrategy.enable(),this._afterNextRenderRef?.destroy(),this._afterNextRenderRef=oa(()=>{this.hasAttached()&&this.updatePosition()},{injector:this._injector}),this._togglePointerEvents(!0),this._config.hasBackdrop&&this._attachBackdrop(),this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!0),this._attachments.next(),this._keyboardDispatcher.add(this),this._config.disposeOnNavigation&&(this._locationChanges=this._location.subscribe(()=>this.dispose())),this._outsideClickDispatcher.add(this),typeof t?.onDestroy=="function"&&t.onDestroy(()=>{this.hasAttached()&&this._ngZone.runOutsideAngular(()=>Promise.resolve().then(()=>this.detach()))}),t}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();let e=this._portalOutlet.detach();return this._detachments.next(),this._keyboardDispatcher.remove(this),this._detachContentWhenEmpty(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),e}dispose(){let e=this.hasAttached();this._positionStrategy&&this._positionStrategy.dispose(),this._disposeScrollStrategy(),this._disposeBackdrop(this._backdropElement),this._locationChanges.unsubscribe(),this._keyboardDispatcher.remove(this),this._portalOutlet.dispose(),this._attachments.complete(),this._backdropClick.complete(),this._keydownEvents.complete(),this._outsidePointerEvents.complete(),this._outsideClickDispatcher.remove(this),this._host?.remove(),this._afterNextRenderRef?.destroy(),this._previousHostParent=this._pane=this._host=null,e&&this._detachments.next(),this._detachments.complete(),this._afterRenderRef.destroy(),this._renders.complete()}hasAttached(){return this._portalOutlet.hasAttached()}backdropClick(){return this._backdropClick}attachments(){return this._attachments}detachments(){return this._detachments}keydownEvents(){return this._keydownEvents}outsidePointerEvents(){return this._outsidePointerEvents}getConfig(){return this._config}updatePosition(){this._positionStrategy&&this._positionStrategy.apply()}updatePositionStrategy(e){e!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=e,this.hasAttached()&&(e.attach(this),this.updatePosition()))}updateSize(e){this._config=v(v({},this._config),e),this._updateElementSize()}setDirection(e){this._config=D(v({},this._config),{direction:e}),this._updateElementDirection()}addPanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!0)}removePanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!1)}getDirection(){let e=this._config.direction;return e?typeof e=="string"?e:e.value:"ltr"}updateScrollStrategy(e){e!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=e,this.hasAttached()&&(e.attach(this),e.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;let e=this._pane.style;e.width=We(this._config.width),e.height=We(this._config.height),e.minWidth=We(this._config.minWidth),e.minHeight=We(this._config.minHeight),e.maxWidth=We(this._config.maxWidth),e.maxHeight=We(this._config.maxHeight)}_togglePointerEvents(e){this._pane.style.pointerEvents=e?"":"none"}_attachBackdrop(){let e="cdk-overlay-backdrop-showing";this._backdropElement=this._document.createElement("div"),this._backdropElement.classList.add("cdk-overlay-backdrop"),this._animationsDisabled&&this._backdropElement.classList.add("cdk-overlay-backdrop-noop-animation"),this._config.backdropClass&&this._toggleClasses(this._backdropElement,this._config.backdropClass,!0),this._host.parentElement.insertBefore(this._backdropElement,this._host),this._backdropElement.addEventListener("click",this._backdropClickHandler),!this._animationsDisabled&&typeof requestAnimationFrame<"u"?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>{this._backdropElement&&this._backdropElement.classList.add(e)})}):this._backdropElement.classList.add(e)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){let e=this._backdropElement;if(e){if(this._animationsDisabled){this._disposeBackdrop(e);return}e.classList.remove("cdk-overlay-backdrop-showing"),this._ngZone.runOutsideAngular(()=>{e.addEventListener("transitionend",this._backdropTransitionendHandler)}),e.style.pointerEvents="none",this._backdropTimeout=this._ngZone.runOutsideAngular(()=>setTimeout(()=>{this._disposeBackdrop(e)},500))}}_toggleClasses(e,t,n){let r=xl(t||[]).filter(o=>!!o);r.length&&(n?e.classList.add(...r):e.classList.remove(...r))}_detachContentWhenEmpty(){this._ngZone.runOutsideAngular(()=>{let e=this._renders.pipe(dl(sn(this._attachments,this._detachments))).subscribe(()=>{(!this._pane||!this._host||this._pane.children.length===0)&&(this._pane&&this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!1),this._host&&this._host.parentElement&&(this._previousHostParent=this._host.parentElement,this._host.remove()),e.unsubscribe())})})}_disposeScrollStrategy(){let e=this._scrollStrategy;e&&(e.disable(),e.detach&&e.detach())}_disposeBackdrop(e){e&&(e.removeEventListener("click",this._backdropClickHandler),e.removeEventListener("transitionend",this._backdropTransitionendHandler),e.remove(),this._backdropElement===e&&(this._backdropElement=null)),this._backdropTimeout&&(clearTimeout(this._backdropTimeout),this._backdropTimeout=void 0)}},Hf="cdk-overlay-connected-position-bounding-box",hC=/([A-Za-z%]+)$/,Wc=class{get positions(){return this._preferredPositions}constructor(e,t,n,r,o){this._viewportRuler=t,this._document=n,this._platform=r,this._overlayContainer=o,this._lastBoundingBoxSize={width:0,height:0},this._isPushed=!1,this._canPush=!0,this._growAfterOpen=!1,this._hasFlexibleDimensions=!0,this._positionLocked=!1,this._viewportMargin=0,this._scrollables=[],this._preferredPositions=[],this._positionChanges=new et,this._resizeSubscription=$i.EMPTY,this._offsetX=0,this._offsetY=0,this._appliedPanelClasses=[],this.positionChanges=this._positionChanges,this.setOrigin(e)}attach(e){this._overlayRef&&this._overlayRef,this._validatePositions(),e.hostElement.classList.add(Hf),this._overlayRef=e,this._boundingBox=e.hostElement,this._pane=e.overlayElement,this._isDisposed=!1,this._isInitialRender=!0,this._lastPosition=null,this._resizeSubscription.unsubscribe(),this._resizeSubscription=this._viewportRuler.change().subscribe(()=>{this._isInitialRender=!0,this.apply()})}apply(){if(this._isDisposed||!this._platform.isBrowser)return;if(!this._isInitialRender&&this._positionLocked&&this._lastPosition){this.reapplyLastPosition();return}this._clearPanelClasses(),this._resetOverlayElementStyles(),this._resetBoundingBoxStyles(),this._viewportRect=this._getNarrowedViewportRect(),this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._containerRect=this._overlayContainer.getContainerElement().getBoundingClientRect();let e=this._originRect,t=this._overlayRect,n=this._viewportRect,r=this._containerRect,o=[],a;for(let s of this._preferredPositions){let l=this._getOriginPoint(e,r,s),c=this._getOverlayPoint(l,t,s),d=this._getOverlayFit(c,t,n,s);if(d.isCompletelyWithinViewport){this._isPushed=!1,this._applyPosition(s,l);return}if(this._canFitWithFlexibleDimensions(d,c,n)){o.push({position:s,origin:l,overlayRect:t,boundingBoxRect:this._calculateBoundingBoxRect(l,s)});continue}(!a||a.overlayFit.visibleArea<d.visibleArea)&&(a={overlayFit:d,overlayPoint:c,originPoint:l,position:s,overlayRect:t})}if(o.length){let s=null,l=-1;for(let c of o){let d=c.boundingBoxRect.width*c.boundingBoxRect.height*(c.position.weight||1);d>l&&(l=d,s=c)}this._isPushed=!1,this._applyPosition(s.position,s.origin);return}if(this._canPush){this._isPushed=!0,this._applyPosition(a.position,a.originPoint);return}this._applyPosition(a.position,a.originPoint)}detach(){this._clearPanelClasses(),this._lastPosition=null,this._previousPushAmount=null,this._resizeSubscription.unsubscribe()}dispose(){this._isDisposed||(this._boundingBox&&pn(this._boundingBox.style,{top:"",left:"",right:"",bottom:"",height:"",width:"",alignItems:"",justifyContent:""}),this._pane&&this._resetOverlayElementStyles(),this._overlayRef&&this._overlayRef.hostElement.classList.remove(Hf),this.detach(),this._positionChanges.complete(),this._overlayRef=this._boundingBox=null,this._isDisposed=!0)}reapplyLastPosition(){if(this._isDisposed||!this._platform.isBrowser)return;let e=this._lastPosition;if(e){this._originRect=this._getOriginRect(),this._overlayRect=this._pane.getBoundingClientRect(),this._viewportRect=this._getNarrowedViewportRect(),this._containerRect=this._overlayContainer.getContainerElement().getBoundingClientRect();let t=this._getOriginPoint(this._originRect,this._containerRect,e);this._applyPosition(e,t)}else this.apply()}withScrollableContainers(e){return this._scrollables=e,this}withPositions(e){return this._preferredPositions=e,e.indexOf(this._lastPosition)===-1&&(this._lastPosition=null),this._validatePositions(),this}withViewportMargin(e){return this._viewportMargin=e,this}withFlexibleDimensions(e=!0){return this._hasFlexibleDimensions=e,this}withGrowAfterOpen(e=!0){return this._growAfterOpen=e,this}withPush(e=!0){return this._canPush=e,this}withLockedPosition(e=!0){return this._positionLocked=e,this}setOrigin(e){return this._origin=e,this}withDefaultOffsetX(e){return this._offsetX=e,this}withDefaultOffsetY(e){return this._offsetY=e,this}withTransformOriginOn(e){return this._transformOriginSelector=e,this}_getOriginPoint(e,t,n){let r;if(n.originX=="center")r=e.left+e.width/2;else{let a=this._isRtl()?e.right:e.left,s=this._isRtl()?e.left:e.right;r=n.originX=="start"?a:s}t.left<0&&(r-=t.left);let o;return n.originY=="center"?o=e.top+e.height/2:o=n.originY=="top"?e.top:e.bottom,t.top<0&&(o-=t.top),{x:r,y:o}}_getOverlayPoint(e,t,n){let r;n.overlayX=="center"?r=-t.width/2:n.overlayX==="start"?r=this._isRtl()?-t.width:0:r=this._isRtl()?0:-t.width;let o;return n.overlayY=="center"?o=-t.height/2:o=n.overlayY=="top"?0:-t.height,{x:e.x+r,y:e.y+o}}_getOverlayFit(e,t,n,r){let o=Vf(t),{x:a,y:s}=e,l=this._getOffset(r,"x"),c=this._getOffset(r,"y");l&&(a+=l),c&&(s+=c);let d=0-a,u=a+o.width-n.width,g=0-s,h=s+o.height-n.height,_=this._subtractOverflows(o.width,d,u),E=this._subtractOverflows(o.height,g,h),N=_*E;return{visibleArea:N,isCompletelyWithinViewport:o.width*o.height===N,fitsInViewportVertically:E===o.height,fitsInViewportHorizontally:_==o.width}}_canFitWithFlexibleDimensions(e,t,n){if(this._hasFlexibleDimensions){let r=n.bottom-t.y,o=n.right-t.x,a=jf(this._overlayRef.getConfig().minHeight),s=jf(this._overlayRef.getConfig().minWidth),l=e.fitsInViewportVertically||a!=null&&a<=r,c=e.fitsInViewportHorizontally||s!=null&&s<=o;return l&&c}return!1}_pushOverlayOnScreen(e,t,n){if(this._previousPushAmount&&this._positionLocked)return{x:e.x+this._previousPushAmount.x,y:e.y+this._previousPushAmount.y};let r=Vf(t),o=this._viewportRect,a=Math.max(e.x+r.width-o.width,0),s=Math.max(e.y+r.height-o.height,0),l=Math.max(o.top-n.top-e.y,0),c=Math.max(o.left-n.left-e.x,0),d=0,u=0;return r.width<=o.width?d=c||-a:d=e.x<this._viewportMargin?o.left-n.left-e.x:0,r.height<=o.height?u=l||-s:u=e.y<this._viewportMargin?o.top-n.top-e.y:0,this._previousPushAmount={x:d,y:u},{x:e.x+d,y:e.y+u}}_applyPosition(e,t){if(this._setTransformOrigin(e),this._setOverlayElementStyles(t,e),this._setBoundingBoxStyles(t,e),e.panelClass&&this._addPanelClasses(e.panelClass),this._positionChanges.observers.length){let n=this._getScrollVisibility();if(e!==this._lastPosition||!this._lastScrollVisibility||!fC(this._lastScrollVisibility,n)){let r=new Vc(e,n);this._positionChanges.next(r)}this._lastScrollVisibility=n}this._lastPosition=e,this._isInitialRender=!1}_setTransformOrigin(e){if(!this._transformOriginSelector)return;let t=this._boundingBox.querySelectorAll(this._transformOriginSelector),n,r=e.overlayY;e.overlayX==="center"?n="center":this._isRtl()?n=e.overlayX==="start"?"right":"left":n=e.overlayX==="start"?"left":"right";for(let o=0;o<t.length;o++)t[o].style.transformOrigin=`${n} ${r}`}_calculateBoundingBoxRect(e,t){let n=this._viewportRect,r=this._isRtl(),o,a,s;if(t.overlayY==="top")a=e.y,o=n.height-a+this._viewportMargin;else if(t.overlayY==="bottom")s=n.height-e.y+this._viewportMargin*2,o=n.height-s+this._viewportMargin;else{let h=Math.min(n.bottom-e.y+n.top,e.y),_=this._lastBoundingBoxSize.height;o=h*2,a=e.y-h,o>_&&!this._isInitialRender&&!this._growAfterOpen&&(a=e.y-_/2)}let l=t.overlayX==="start"&&!r||t.overlayX==="end"&&r,c=t.overlayX==="end"&&!r||t.overlayX==="start"&&r,d,u,g;if(c)g=n.width-e.x+this._viewportMargin*2,d=e.x-this._viewportMargin;else if(l)u=e.x,d=n.right-e.x;else{let h=Math.min(n.right-e.x+n.left,e.x),_=this._lastBoundingBoxSize.width;d=h*2,u=e.x-h,d>_&&!this._isInitialRender&&!this._growAfterOpen&&(u=e.x-_/2)}return{top:a,left:u,bottom:s,right:g,width:d,height:o}}_setBoundingBoxStyles(e,t){let n=this._calculateBoundingBoxRect(e,t);!this._isInitialRender&&!this._growAfterOpen&&(n.height=Math.min(n.height,this._lastBoundingBoxSize.height),n.width=Math.min(n.width,this._lastBoundingBoxSize.width));let r={};if(this._hasExactPosition())r.top=r.left="0",r.bottom=r.right=r.maxHeight=r.maxWidth="",r.width=r.height="100%";else{let o=this._overlayRef.getConfig().maxHeight,a=this._overlayRef.getConfig().maxWidth;r.height=We(n.height),r.top=We(n.top),r.bottom=We(n.bottom),r.width=We(n.width),r.left=We(n.left),r.right=We(n.right),t.overlayX==="center"?r.alignItems="center":r.alignItems=t.overlayX==="end"?"flex-end":"flex-start",t.overlayY==="center"?r.justifyContent="center":r.justifyContent=t.overlayY==="bottom"?"flex-end":"flex-start",o&&(r.maxHeight=We(o)),a&&(r.maxWidth=We(a))}this._lastBoundingBoxSize=n,pn(this._boundingBox.style,r)}_resetBoundingBoxStyles(){pn(this._boundingBox.style,{top:"0",left:"0",right:"0",bottom:"0",height:"",width:"",alignItems:"",justifyContent:""})}_resetOverlayElementStyles(){pn(this._pane.style,{top:"",left:"",bottom:"",right:"",position:"",transform:""})}_setOverlayElementStyles(e,t){let n={},r=this._hasExactPosition(),o=this._hasFlexibleDimensions,a=this._overlayRef.getConfig();if(r){let d=this._viewportRuler.getViewportScrollPosition();pn(n,this._getExactOverlayY(t,e,d)),pn(n,this._getExactOverlayX(t,e,d))}else n.position="static";let s="",l=this._getOffset(t,"x"),c=this._getOffset(t,"y");l&&(s+=`translateX(${l}px) `),c&&(s+=`translateY(${c}px)`),n.transform=s.trim(),a.maxHeight&&(r?n.maxHeight=We(a.maxHeight):o&&(n.maxHeight="")),a.maxWidth&&(r?n.maxWidth=We(a.maxWidth):o&&(n.maxWidth="")),pn(this._pane.style,n)}_getExactOverlayY(e,t,n){let r={top:"",bottom:""},o=this._getOverlayPoint(t,this._overlayRect,e);if(this._isPushed&&(o=this._pushOverlayOnScreen(o,this._overlayRect,n)),e.overlayY==="bottom"){let a=this._document.documentElement.clientHeight;r.bottom=`${a-(o.y+this._overlayRect.height)}px`}else r.top=We(o.y);return r}_getExactOverlayX(e,t,n){let r={left:"",right:""},o=this._getOverlayPoint(t,this._overlayRect,e);this._isPushed&&(o=this._pushOverlayOnScreen(o,this._overlayRect,n));let a;if(this._isRtl()?a=e.overlayX==="end"?"left":"right":a=e.overlayX==="end"?"right":"left",a==="right"){let s=this._document.documentElement.clientWidth;r.right=`${s-(o.x+this._overlayRect.width)}px`}else r.left=We(o.x);return r}_getScrollVisibility(){let e=this._getOriginRect(),t=this._pane.getBoundingClientRect(),n=this._scrollables.map(r=>r.getElementRef().nativeElement.getBoundingClientRect());return{isOriginClipped:zf(e,n),isOriginOutsideView:Hc(e,n),isOverlayClipped:zf(t,n),isOverlayOutsideView:Hc(t,n)}}_subtractOverflows(e,...t){return t.reduce((n,r)=>n-Math.max(r,0),e)}_getNarrowedViewportRect(){let e=this._document.documentElement.clientWidth,t=this._document.documentElement.clientHeight,n=this._viewportRuler.getViewportScrollPosition();return{top:n.top+this._viewportMargin,left:n.left+this._viewportMargin,right:n.left+e-this._viewportMargin,bottom:n.top+t-this._viewportMargin,width:e-2*this._viewportMargin,height:t-2*this._viewportMargin}}_isRtl(){return this._overlayRef.getDirection()==="rtl"}_hasExactPosition(){return!this._hasFlexibleDimensions||this._isPushed}_getOffset(e,t){return t==="x"?e.offsetX==null?this._offsetX:e.offsetX:e.offsetY==null?this._offsetY:e.offsetY}_validatePositions(){}_addPanelClasses(e){this._pane&&xl(e).forEach(t=>{t!==""&&this._appliedPanelClasses.indexOf(t)===-1&&(this._appliedPanelClasses.push(t),this._pane.classList.add(t))})}_clearPanelClasses(){this._pane&&(this._appliedPanelClasses.forEach(e=>{this._pane.classList.remove(e)}),this._appliedPanelClasses=[])}_getOriginRect(){let e=this._origin;if(e instanceof Et)return e.nativeElement.getBoundingClientRect();if(e instanceof Element)return e.getBoundingClientRect();let t=e.width||0,n=e.height||0;return{top:e.y,bottom:e.y+n,left:e.x,right:e.x+t,height:n,width:t}}};function pn(i,e){for(let t in e)e.hasOwnProperty(t)&&(i[t]=e[t]);return i}function jf(i){if(typeof i!="number"&&i!=null){let[e,t]=i.split(hC);return!t||t==="px"?parseFloat(e):null}return i||null}function Vf(i){return{top:Math.floor(i.top),right:Math.floor(i.right),bottom:Math.floor(i.bottom),left:Math.floor(i.left),width:Math.floor(i.width),height:Math.floor(i.height)}}function fC(i,e){return i===e?!0:i.isOriginClipped===e.isOriginClipped&&i.isOriginOutsideView===e.isOriginOutsideView&&i.isOverlayClipped===e.isOverlayClipped&&i.isOverlayOutsideView===e.isOverlayOutsideView}var Uf="cdk-global-overlay-wrapper",$c=class{constructor(){this._cssPosition="static",this._topOffset="",this._bottomOffset="",this._alignItems="",this._xPosition="",this._xOffset="",this._width="",this._height="",this._isDisposed=!1}attach(e){let t=e.getConfig();this._overlayRef=e,this._width&&!t.width&&e.updateSize({width:this._width}),this._height&&!t.height&&e.updateSize({height:this._height}),e.hostElement.classList.add(Uf),this._isDisposed=!1}top(e=""){return this._bottomOffset="",this._topOffset=e,this._alignItems="flex-start",this}left(e=""){return this._xOffset=e,this._xPosition="left",this}bottom(e=""){return this._topOffset="",this._bottomOffset=e,this._alignItems="flex-end",this}right(e=""){return this._xOffset=e,this._xPosition="right",this}start(e=""){return this._xOffset=e,this._xPosition="start",this}end(e=""){return this._xOffset=e,this._xPosition="end",this}width(e=""){return this._overlayRef?this._overlayRef.updateSize({width:e}):this._width=e,this}height(e=""){return this._overlayRef?this._overlayRef.updateSize({height:e}):this._height=e,this}centerHorizontally(e=""){return this.left(e),this._xPosition="center",this}centerVertically(e=""){return this.top(e),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;let e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement.style,n=this._overlayRef.getConfig(),{width:r,height:o,maxWidth:a,maxHeight:s}=n,l=(r==="100%"||r==="100vw")&&(!a||a==="100%"||a==="100vw"),c=(o==="100%"||o==="100vh")&&(!s||s==="100%"||s==="100vh"),d=this._xPosition,u=this._xOffset,g=this._overlayRef.getConfig().direction==="rtl",h="",_="",E="";l?E="flex-start":d==="center"?(E="center",g?_=u:h=u):g?d==="left"||d==="end"?(E="flex-end",h=u):(d==="right"||d==="start")&&(E="flex-start",_=u):d==="left"||d==="start"?(E="flex-start",h=u):(d==="right"||d==="end")&&(E="flex-end",_=u),e.position=this._cssPosition,e.marginLeft=l?"0":h,e.marginTop=c?"0":this._topOffset,e.marginBottom=this._bottomOffset,e.marginRight=l?"0":_,t.justifyContent=E,t.alignItems=c?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;let e=this._overlayRef.overlayElement.style,t=this._overlayRef.hostElement,n=t.style;t.classList.remove(Uf),n.justifyContent=n.alignItems=e.marginTop=e.marginBottom=e.marginLeft=e.marginRight=e.position="",this._overlayRef=null,this._isDisposed=!0}},mC=(()=>{class i{constructor(t,n,r,o){this._viewportRuler=t,this._document=n,this._platform=r,this._overlayContainer=o}global(){return new $c}flexibleConnectedTo(t){return new Wc(t,this._viewportRuler,this._document,this._platform,this._overlayContainer)}static{this.\u0275fac=function(n){return new(n||i)(pe(Kr),pe(mt),pe(Ii),pe($f))}}static{this.\u0275prov=Ue({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),gC=0,en=(()=>{class i{constructor(t,n,r,o,a,s,l,c,d,u,g,h){this.scrollStrategies=t,this._overlayContainer=n,this._componentFactoryResolver=r,this._positionBuilder=o,this._keyboardDispatcher=a,this._injector=s,this._ngZone=l,this._document=c,this._directionality=d,this._location=u,this._outsideClickDispatcher=g,this._animationsModuleType=h}create(t){let n=this._createHostElement(),r=this._createPaneElement(n),o=this._createPortalOutlet(r),a=new Qr(t);return a.direction=a.direction||this._directionality.value,new Uc(o,n,r,a,this._ngZone,this._keyboardDispatcher,this._document,this._location,this._outsideClickDispatcher,this._animationsModuleType==="NoopAnimations",this._injector.get(up))}position(){return this._positionBuilder}_createPaneElement(t){let n=this._document.createElement("div");return n.id=`cdk-overlay-${gC++}`,n.classList.add("cdk-overlay-pane"),t.appendChild(n),n}_createHostElement(){let t=this._document.createElement("div");return this._overlayContainer.getContainerElement().appendChild(t),t}_createPortalOutlet(t){return this._appRef||(this._appRef=this._injector.get(mp)),new Bp(t,this._componentFactoryResolver,this._appRef,this._injector,this._document)}static{this.\u0275fac=function(n){return new(n||i)(pe(dC),pe($f),pe(hp),pe(mC),pe(uC),pe(Xe),pe(Pt),pe(mt),pe(Ia),pe(ha),pe(pC),pe(pp,8))}}static{this.\u0275prov=Ue({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var yC=new Ir("cdk-connected-overlay-scroll-strategy",{providedIn:"root",factory:()=>{let i=z(en);return()=>i.scrollStrategies.reposition()}});function vC(i){return()=>i.scrollStrategies.reposition()}var bC={provide:yC,deps:[en],useFactory:vC},qf=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=Nt({type:i})}static{this.\u0275inj=Bt({providers:[en,bC],imports:[Mr,Np,Nc,Nc]})}}return i})();var SC=["panel"],PC=["*"];function EC(i,e){if(i&1){let t=Ie();f(0,"div",1,0),W("@panelAnimation.done",function(r){ae(t);let o=O();return se(o._animationDone.next(r))}),da(2),m()}if(i&2){let t=e.id,n=O();aa(n._classList),jn("mat-mdc-autocomplete-visible",n.showPanel)("mat-mdc-autocomplete-hidden",!n.showPanel)("mat-primary",n._color==="primary")("mat-accent",n._color==="accent")("mat-warn",n._color==="warn"),P("id",n.id)("@panelAnimation",n.isOpen?"visible":"hidden"),Lt("aria-label",n.ariaLabel||null)("aria-labelledby",n._getPanelAriaLabelledby(t))}}var DC=Rp("panelAnimation",[Ap("void, hidden",Rr({opacity:0,transform:"scaleY(0.8)"})),bl(":enter, hidden => visible",[Mp([ka("0.03s linear",Rr({opacity:1})),ka("0.12s cubic-bezier(0, 0, 0.2, 1)",Rr({transform:"scaleY(1)"}))])]),bl(":leave, visible => hidden",[ka("0.075s linear",Rr({opacity:0}))])]),kC=0,Gc=class{constructor(e,t){this.source=e,this.option=t}},Yf=new Ir("mat-autocomplete-default-options",{providedIn:"root",factory:TC});function TC(){return{autoActiveFirstOption:!1,autoSelectActiveOption:!1,hideSingleSelectionIndicator:!1,requireSelection:!1}}var Kf=(()=>{class i{get isOpen(){return this._isOpen&&this.showPanel}_setColor(t){this._color=t,this._changeDetectorRef.markForCheck()}set classList(t){this._classList=t,this._elementRef.nativeElement.className=""}get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(t){this._hideSingleSelectionIndicator=t,this._syncParentProperties()}_syncParentProperties(){if(this.options)for(let t of this.options)t._changeDetectorRef.markForCheck()}constructor(t,n,r,o){this._changeDetectorRef=t,this._elementRef=n,this._defaults=r,this._activeOptionChanges=$i.EMPTY,this._animationDone=new zt,this.showPanel=!1,this._isOpen=!1,this.displayWith=null,this.optionSelected=new zt,this.opened=new zt,this.closed=new zt,this.optionActivated=new zt,this.id=`mat-autocomplete-${kC++}`,this.inertGroups=o?.SAFARI||!1,this.autoActiveFirstOption=!!r.autoActiveFirstOption,this.autoSelectActiveOption=!!r.autoSelectActiveOption,this.requireSelection=!!r.requireSelection,this._hideSingleSelectionIndicator=this._defaults.hideSingleSelectionIndicator??!1}ngAfterContentInit(){this._keyManager=new Vp(this.options).withWrap().skipPredicate(this._skipPredicate),this._activeOptionChanges=this._keyManager.change.subscribe(t=>{this.isOpen&&this.optionActivated.emit({source:this,option:this.options.toArray()[t]||null})}),this._setVisibility()}ngOnDestroy(){this._keyManager?.destroy(),this._activeOptionChanges.unsubscribe(),this._animationDone.complete()}_setScrollTop(t){this.panel&&(this.panel.nativeElement.scrollTop=t)}_getScrollTop(){return this.panel?this.panel.nativeElement.scrollTop:0}_setVisibility(){this.showPanel=!!this.options.length,this._changeDetectorRef.markForCheck()}_emitSelectEvent(t){let n=new Gc(this,t);this.optionSelected.emit(n)}_getPanelAriaLabelledby(t){if(this.ariaLabel)return null;let n=t?t+" ":"";return this.ariaLabelledby?n+this.ariaLabelledby:t}_skipPredicate(){return!1}static{this.\u0275fac=function(n){return new(n||i)(He(cn),He(Et),He(Yf),He(Ii))}}static{this.\u0275cmp=fe({type:i,selectors:[["mat-autocomplete"]],contentQueries:function(n,r,o){if(n&1&&(ua(o,Ma,5),ua(o,Wp,5)),n&2){let a;ii(a=ni())&&(r.options=a),ii(a=ni())&&(r.optionGroups=a)}},viewQuery:function(n,r){if(n&1&&(yi(Or,7),yi(SC,5)),n&2){let o;ii(o=ni())&&(r.template=o.first),ii(o=ni())&&(r.panel=o.first)}},hostAttrs:[1,"mat-mdc-autocomplete"],inputs:{ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],displayWith:"displayWith",autoActiveFirstOption:[2,"autoActiveFirstOption","autoActiveFirstOption",Gi],autoSelectActiveOption:[2,"autoSelectActiveOption","autoSelectActiveOption",Gi],requireSelection:[2,"requireSelection","requireSelection",Gi],panelWidth:"panelWidth",disableRipple:[2,"disableRipple","disableRipple",Gi],classList:[0,"class","classList"],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",Gi]},outputs:{optionSelected:"optionSelected",opened:"opened",closed:"closed",optionActivated:"optionActivated"},exportAs:["matAutocomplete"],standalone:!0,features:[pa([{provide:Up,useExisting:i}]),Fr,_e],ngContentSelectors:PC,decls:1,vars:0,consts:[["panel",""],["role","listbox",1,"mat-mdc-autocomplete-panel","mdc-menu-surface","mdc-menu-surface--open",3,"id"]],template:function(n,r){n&1&&(ca(),le(0,EC,3,16,"ng-template"))},styles:["div.mat-mdc-autocomplete-panel{width:100%;max-height:256px;visibility:hidden;transform-origin:center top;overflow:auto;padding:8px 0;box-sizing:border-box;position:static;border-radius:var(--mat-autocomplete-container-shape, var(--mat-app-corner-extra-small));box-shadow:var(--mat-autocomplete-container-elevation-shadow);background-color:var(--mat-autocomplete-background-color, var(--mat-app-surface-container))}.cdk-high-contrast-active div.mat-mdc-autocomplete-panel{outline:solid 1px}.cdk-overlay-pane:not(.mat-mdc-autocomplete-panel-above) div.mat-mdc-autocomplete-panel{border-top-left-radius:0;border-top-right-radius:0}.mat-mdc-autocomplete-panel-above div.mat-mdc-autocomplete-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:center bottom}div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-visible{visibility:visible}div.mat-mdc-autocomplete-panel.mat-mdc-autocomplete-hidden{visibility:hidden;pointer-events:none}mat-autocomplete{display:none}"],encapsulation:2,data:{animation:[DC]},changeDetection:0})}}return i})();var IC={provide:Pp,useExisting:dp(()=>Xc),multi:!0};var Qf=new Ir("mat-autocomplete-scroll-strategy",{providedIn:"root",factory:()=>{let i=z(en);return()=>i.scrollStrategies.reposition()}});function OC(i){return()=>i.scrollStrategies.reposition()}var FC={provide:Qf,deps:[en],useFactory:OC},Xc=(()=>{class i{constructor(t,n,r,o,a,s,l,c,d,u,g){this._element=t,this._overlay=n,this._viewContainerRef=r,this._zone=o,this._changeDetectorRef=a,this._dir=l,this._formField=c,this._document=d,this._viewportRuler=u,this._defaults=g,this._componentDestroyed=!1,this._manuallyFloatingLabel=!1,this._viewportSubscription=$i.EMPTY,this._breakpointObserver=z(Hp),this._handsetLandscapeSubscription=$i.EMPTY,this._canOpenOnNextFocus=!0,this._closeKeyEventStream=new et,this._windowBlurHandler=()=>{this._canOpenOnNextFocus=this._document.activeElement!==this._element.nativeElement||this.panelOpen},this._onChange=()=>{},this._onTouched=()=>{},this.position="auto",this.autocompleteAttribute="off",this._initialized=new et,this._injector=z(Xe),this._aboveClass="mat-mdc-autocomplete-panel-above",this._overlayAttached=!1,this.optionSelections=sp(()=>{let h=this.autocomplete?this.autocomplete.options:null;return h?h.changes.pipe(cl(h),qi(()=>sn(...h.map(_=>_.onSelectionChange)))):this._initialized.pipe(qi(()=>this.optionSelections))}),this._handlePanelKeydown=h=>{(h.keyCode===27&&!Fa(h)||h.keyCode===38&&Fa(h,"altKey"))&&(this._pendingAutoselectedOption&&(this._updateNativeInputValue(this._valueBeforeAutoSelection??""),this._pendingAutoselectedOption=null),this._closeKeyEventStream.next(),this._resetActiveItem(),h.stopPropagation(),h.preventDefault())},this._trackedModal=null,this._scrollStrategy=s}ngAfterViewInit(){this._initialized.next(),this._initialized.complete();let t=this._getWindow();typeof t<"u"&&this._zone.runOutsideAngular(()=>t.addEventListener("blur",this._windowBlurHandler))}ngOnChanges(t){t.position&&this._positionStrategy&&(this._setStrategyPositions(this._positionStrategy),this.panelOpen&&this._overlayRef.updatePosition())}ngOnDestroy(){let t=this._getWindow();typeof t<"u"&&t.removeEventListener("blur",this._windowBlurHandler),this._handsetLandscapeSubscription.unsubscribe(),this._viewportSubscription.unsubscribe(),this._componentDestroyed=!0,this._destroyPanel(),this._closeKeyEventStream.complete(),this._clearFromModal()}get panelOpen(){return this._overlayAttached&&this.autocomplete.showPanel}openPanel(){this._openPanelInternal()}closePanel(){this._resetLabel(),this._overlayAttached&&(this.panelOpen&&this._zone.run(()=>{this.autocomplete.closed.emit()}),this.autocomplete._latestOpeningTrigger===this&&(this.autocomplete._isOpen=!1,this.autocomplete._latestOpeningTrigger=null),this._overlayAttached=!1,this._pendingAutoselectedOption=null,this._overlayRef&&this._overlayRef.hasAttached()&&(this._overlayRef.detach(),this._closingActionsSubscription.unsubscribe()),this._updatePanelState(),this._componentDestroyed||this._changeDetectorRef.detectChanges(),this._trackedModal&&Ra(this._trackedModal,"aria-owns",this.autocomplete.id))}updatePosition(){this._overlayAttached&&this._overlayRef.updatePosition()}get panelClosingActions(){return sn(this.optionSelections,this.autocomplete._keyManager.tabOut.pipe(Jt(()=>this._overlayAttached)),this._closeKeyEventStream,this._getOutsideClickStream(),this._overlayRef?this._overlayRef.detachments().pipe(Jt(()=>this._overlayAttached)):Le()).pipe(Zt(t=>t instanceof $p?t:null))}get activeOption(){return this.autocomplete&&this.autocomplete._keyManager?this.autocomplete._keyManager.activeItem:null}_getOutsideClickStream(){return sn(an(this._document,"click"),an(this._document,"auxclick"),an(this._document,"touchend")).pipe(Jt(t=>{let n=Ar(t),r=this._formField?this._formField.getConnectedOverlayOrigin().nativeElement:null,o=this.connectedTo?this.connectedTo.elementRef.nativeElement:null;return this._overlayAttached&&n!==this._element.nativeElement&&this._document.activeElement!==this._element.nativeElement&&(!r||!r.contains(n))&&(!o||!o.contains(n))&&!!this._overlayRef&&!this._overlayRef.overlayElement.contains(n)}))}writeValue(t){Promise.resolve(null).then(()=>this._assignOptionValue(t))}registerOnChange(t){this._onChange=t}registerOnTouched(t){this._onTouched=t}setDisabledState(t){this._element.nativeElement.disabled=t}_handleKeydown(t){let n=t.keyCode,r=Fa(t);if(n===27&&!r&&t.preventDefault(),this._valueOnLastKeydown=this._element.nativeElement.value,this.activeOption&&n===13&&this.panelOpen&&!r)this.activeOption._selectViaInteraction(),this._resetActiveItem(),t.preventDefault();else if(this.autocomplete){let o=this.autocomplete._keyManager.activeItem,a=n===38||n===40;n===9||a&&!r&&this.panelOpen?this.autocomplete._keyManager.onKeydown(t):a&&this._canOpen()&&this._openPanelInternal(this._valueOnLastKeydown),(a||this.autocomplete._keyManager.activeItem!==o)&&(this._scrollToOption(this.autocomplete._keyManager.activeItemIndex||0),this.autocomplete.autoSelectActiveOption&&this.activeOption&&(this._pendingAutoselectedOption||(this._valueBeforeAutoSelection=this._valueOnLastKeydown),this._pendingAutoselectedOption=this.activeOption,this._assignOptionValue(this.activeOption.value)))}}_handleInput(t){let n=t.target,r=n.value;if(n.type==="number"&&(r=r==""?null:parseFloat(r)),this._previousValue!==r){if(this._previousValue=r,this._pendingAutoselectedOption=null,(!this.autocomplete||!this.autocomplete.requireSelection)&&this._onChange(r),!r)this._clearPreviousSelectedOption(null,!1);else if(this.panelOpen&&!this.autocomplete.requireSelection){let o=this.autocomplete.options?.find(a=>a.selected);if(o){let a=this._getDisplayValue(o.value);r!==a&&o.deselect(!1)}}if(this._canOpen()&&this._document.activeElement===t.target){let o=this._valueOnLastKeydown??this._element.nativeElement.value;this._valueOnLastKeydown=null,this._openPanelInternal(o)}}}_handleFocus(){this._canOpenOnNextFocus?this._canOpen()&&(this._previousValue=this._element.nativeElement.value,this._attachOverlay(this._previousValue),this._floatLabel(!0)):this._canOpenOnNextFocus=!0}_handleClick(){this._canOpen()&&!this.panelOpen&&this._openPanelInternal()}_floatLabel(t=!1){this._formField&&this._formField.floatLabel==="auto"&&(t?this._formField._animateAndLockLabel():this._formField.floatLabel="always",this._manuallyFloatingLabel=!0)}_resetLabel(){this._manuallyFloatingLabel&&(this._formField&&(this._formField.floatLabel="auto"),this._manuallyFloatingLabel=!1)}_subscribeToClosingActions(){let t=new St(r=>{oa(()=>{r.next()},{injector:this._injector})}),n=this.autocomplete.options.changes.pipe(xe(()=>this._positionStrategy.reapplyLastPosition()),cp(0));return sn(t,n).pipe(qi(()=>this._zone.run(()=>{let r=this.panelOpen;return this._resetActiveItem(),this._updatePanelState(),this._changeDetectorRef.detectChanges(),this.panelOpen&&this._overlayRef.updatePosition(),r!==this.panelOpen&&(this.panelOpen?this._emitOpened():this.autocomplete.closed.emit()),this.panelClosingActions})),al(1)).subscribe(r=>this._setValueAndClose(r))}_emitOpened(){this.autocomplete.opened.emit()}_destroyPanel(){this._overlayRef&&(this.closePanel(),this._overlayRef.dispose(),this._overlayRef=null)}_getDisplayValue(t){let n=this.autocomplete;return n&&n.displayWith?n.displayWith(t):t}_assignOptionValue(t){let n=this._getDisplayValue(t);t==null&&this._clearPreviousSelectedOption(null,!1),this._updateNativeInputValue(n??"")}_updateNativeInputValue(t){this._formField?this._formField._control.value=t:this._element.nativeElement.value=t,this._previousValue=t}_setValueAndClose(t){let n=this.autocomplete,r=t?t.source:this._pendingAutoselectedOption;r?(this._clearPreviousSelectedOption(r),this._assignOptionValue(r.value),this._onChange(r.value),n._emitSelectEvent(r),this._element.nativeElement.focus()):n.requireSelection&&this._element.nativeElement.value!==this._valueOnAttach&&(this._clearPreviousSelectedOption(null),this._assignOptionValue(null),n._animationDone?n._animationDone.pipe(al(1)).subscribe(()=>this._onChange(null)):this._onChange(null)),this.closePanel()}_clearPreviousSelectedOption(t,n){this.autocomplete?.options?.forEach(r=>{r!==t&&r.selected&&r.deselect(n)})}_openPanelInternal(t=this._element.nativeElement.value){if(this._attachOverlay(t),this._floatLabel(),this._trackedModal){let n=this.autocomplete.id;Sl(this._trackedModal,"aria-owns",n)}}_attachOverlay(t){this.autocomplete;let n=this._overlayRef;n?(this._positionStrategy.setOrigin(this._getConnectedElement()),n.updateSize({width:this._getPanelWidth()})):(this._portal=new _l(this.autocomplete.template,this._viewContainerRef,{id:this._formField?.getLabelId()}),n=this._overlay.create(this._getOverlayConfig()),this._overlayRef=n,this._viewportSubscription=this._viewportRuler.change().subscribe(()=>{this.panelOpen&&n&&n.updateSize({width:this._getPanelWidth()})}),this._handsetLandscapeSubscription=this._breakpointObserver.observe(jp.HandsetLandscape).subscribe(o=>{o.matches?this._positionStrategy.withFlexibleDimensions(!0).withGrowAfterOpen(!0).withViewportMargin(8):this._positionStrategy.withFlexibleDimensions(!1).withGrowAfterOpen(!1).withViewportMargin(0)})),n&&!n.hasAttached()&&(n.attach(this._portal),this._valueOnAttach=t,this._valueOnLastKeydown=null,this._closingActionsSubscription=this._subscribeToClosingActions());let r=this.panelOpen;this.autocomplete._isOpen=this._overlayAttached=!0,this.autocomplete._latestOpeningTrigger=this,this.autocomplete._setColor(this._formField?.color),this._updatePanelState(),this._applyModalPanelOwnership(),this.panelOpen&&r!==this.panelOpen&&this._emitOpened()}_updatePanelState(){if(this.autocomplete._setVisibility(),this.panelOpen){let t=this._overlayRef;this._keydownSubscription||(this._keydownSubscription=t.keydownEvents().subscribe(this._handlePanelKeydown)),this._outsideClickSubscription||(this._outsideClickSubscription=t.outsidePointerEvents().subscribe())}else this._keydownSubscription?.unsubscribe(),this._outsideClickSubscription?.unsubscribe(),this._keydownSubscription=this._outsideClickSubscription=null}_getOverlayConfig(){return new Qr({positionStrategy:this._getOverlayPosition(),scrollStrategy:this._scrollStrategy(),width:this._getPanelWidth(),direction:this._dir??void 0,panelClass:this._defaults?.overlayPanelClass})}_getOverlayPosition(){let t=this._overlay.position().flexibleConnectedTo(this._getConnectedElement()).withFlexibleDimensions(!1).withPush(!1);return this._setStrategyPositions(t),this._positionStrategy=t,t}_setStrategyPositions(t){let n=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"}],r=this._aboveClass,o=[{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:r},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:r}],a;this.position==="above"?a=o:this.position==="below"?a=n:a=[...n,...o],t.withPositions(a)}_getConnectedElement(){return this.connectedTo?this.connectedTo.elementRef:this._formField?this._formField.getConnectedOverlayOrigin():this._element}_getPanelWidth(){return this.autocomplete.panelWidth||this._getHostWidth()}_getHostWidth(){return this._getConnectedElement().nativeElement.getBoundingClientRect().width}_resetActiveItem(){let t=this.autocomplete;if(t.autoActiveFirstOption){let n=-1;for(let r=0;r<t.options.length;r++)if(!t.options.get(r).disabled){n=r;break}t._keyManager.setActiveItem(n)}else t._keyManager.setActiveItem(-1)}_canOpen(){let t=this._element.nativeElement;return!t.readOnly&&!t.disabled&&!this.autocompleteDisabled}_getWindow(){return this._document?.defaultView||window}_scrollToOption(t){let n=this.autocomplete,r=qp(t,n.options,n.optionGroups);if(t===0&&r===1)n._setScrollTop(0);else if(n.panel){let o=n.options.toArray()[t];if(o){let a=o._getHostElement(),s=Gp(a.offsetTop,a.offsetHeight,n._getScrollTop(),n.panel.nativeElement.offsetHeight);n._setScrollTop(s)}}}_applyModalPanelOwnership(){let t=this._element.nativeElement.closest('body > .cdk-overlay-container [aria-modal="true"]');if(!t)return;let n=this.autocomplete.id;this._trackedModal&&Ra(this._trackedModal,"aria-owns",n),Sl(t,"aria-owns",n),this._trackedModal=t}_clearFromModal(){if(this._trackedModal){let t=this.autocomplete.id;Ra(this._trackedModal,"aria-owns",t),this._trackedModal=null}}static{this.\u0275fac=function(n){return new(n||i)(He(Et),He(en),He(ra),He(Pt),He(cn),He(Qf),He(Ia,8),He(Xp,9),He(mt,8),He(Kr),He(Yf,8))}}static{this.\u0275dir=ln({type:i,selectors:[["input","matAutocomplete",""],["textarea","matAutocomplete",""]],hostAttrs:[1,"mat-mdc-autocomplete-trigger"],hostVars:7,hostBindings:function(n,r){n&1&&W("focusin",function(){return r._handleFocus()})("blur",function(){return r._onTouched()})("input",function(a){return r._handleInput(a)})("keydown",function(a){return r._handleKeydown(a)})("click",function(){return r._handleClick()}),n&2&&Lt("autocomplete",r.autocompleteAttribute)("role",r.autocompleteDisabled?null:"combobox")("aria-autocomplete",r.autocompleteDisabled?null:"list")("aria-activedescendant",r.panelOpen&&r.activeOption?r.activeOption.id:null)("aria-expanded",r.autocompleteDisabled?null:r.panelOpen.toString())("aria-controls",r.autocompleteDisabled||!r.panelOpen||r.autocomplete==null?null:r.autocomplete.id)("aria-haspopup",r.autocompleteDisabled?null:"listbox")},inputs:{autocomplete:[0,"matAutocomplete","autocomplete"],position:[0,"matAutocompletePosition","position"],connectedTo:[0,"matAutocompleteConnectedTo","connectedTo"],autocompleteAttribute:[0,"autocomplete","autocompleteAttribute"],autocompleteDisabled:[2,"matAutocompleteDisabled","autocompleteDisabled",Gi]},exportAs:["matAutocompleteTrigger"],standalone:!0,features:[pa([IC]),Fr,gi]})}}return i})(),Zf=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=Nt({type:i})}static{this.\u0275inj=Bt({providers:[FC],imports:[qf,El,Pl,ri,Ja,El,Pl]})}}return i})();function hn(i="emit"){return e=>e.pipe(xe(t=>console.log(`${i}`,t)))}var Yc={dashboard:{View:"DashV"},estimate:{Create:"EstC",Edit:"EstE",Delete:"EstD"},report:{View:"Rep",Advanced:"RepA",Profit:"RepF"},shift:{View:"Shift",Create:"ShiftC",Edit:"ShiftE",Void:"ShiftVo"},contact:{View:"Con",Create:"ConC",Edit:"ConE",Delete:"ConD",LoyaltyPointEditor:"LoyPE",ContactDetail:"ContD",ContactImageEditor:"ContE",ContactSensitiveField:"ConSF",Supplier:"Supp"},sell:{Create:"Sell",PricebookSelector:"PricebS",Edit:"SellE",Delete:"SellD",Number:"NumE",SalesPerson:"SalesmanE",Return:"Return",Discount:"Disc",UnitPriceEditor:"UnitPE",Commission:"Comms",Tax:"Tax",CustomerInputLock:"CustL",Payment:"PayR",PriceVisible:"PriceV",PriceMinimum:"PriceM",Email:"Email",DeleteItem:"DelItm",Shipping:"Ship",PaymentCodeLock:"PayCL",EraseVoidOrd:"EraseVO",RestoreVoidOrd:"RestVO",RetrieveR:"RetrieveR",BundlingPrice:"BundlP",ClearCartRestriction:"ClearCartRestriction",CreditSalesLock:"CredSL",CouponInputLock:"CouponInputLock",Park:"Park"},orders:{View:"Ord",SupplierBill:"OrdB",VoidInvoice:"OrdVo",Print:"OrdRpr",NoteEditor:"OrdNe",Invoice:"OrdIr",Erase:"EraseVO"},product:{View:"Prod",Delete:"ProdD",ImageEditor:"ImgE",Create:"ProdC",Edit:"ProdE",Cost:"Cost",BarcodePrinting:"BarP",DeleteAllOutletPrice:"DeleteAllOutletPrice",Expense:"Expense",CommissionView:"CommV",ProductSensitiveField:"ProdSF",Price:"PriceV"},payment:{View:"Pay",Delete:"PayD",Create:"PayC",Edit:"PayE"},adjustment:{View:"Adj",Delete:"AdjD",Create:"AdjC",Edit:"AdjE",Approval:"AdjApp",InventoryProductCount:"InvPC"},buy:{Delete:"BuyD",Create:"Buy",Edit:"BuyE",ShippingRestriction:"BuySh",Approval:"PurA",Report:"BuyR"},logistics:{View:"Del",Create:"DelC",Edit:"DelE",Delete:"DelD",TransferOrderEditor:"DelRE",Outbound:"FulF",TransferOrderApproval:"DelA",TransferOrderReceiver:"DelR"},debt:{View:"Debt",Delete:"DebtD",Create:"DebtC",Edit:"DebtE"},prepaidPackage:{View:"Tre",Create:"TreC",Edit:"TreE",Delete:"TreD",TreatmentIncentive:"TreI",SharePackageEditor:"SharPacE",TreatmentNote:"TreN",Doctor:"Doct"},inventory:{View:"Inv",Edit:"InvE"},promotion:{View:"Prom",Create:"PromC",Edit:"PromE",Delete:"PromD",Coupon:"Cou",Pricebook:"Pri"},accounting:{View:"Act",Create:"ActC",Edit:"ActE",Delete:"ActD",Report:"ActRep",Ledger:"ActL",EmptyOutlet:"ActEO",ClosingEditor:"ActCE",Advanced:"ActRA",Recurring:"ActRec"},users:{View:"Use",Create:"UseC",Edit:"UseE",Delete:"UseD",Groups:"Gro",LoginTimeRestriction:"LogTR",UserIPRestriction:"UseIR",GroupsRestriction:"UseG",LogRestriction:"LogResct"},outlets:{View:"Out",Create:"OutC",Edit:"OutE",Delete:"OutD"},setup:{View:"Stp",Create:"StpC",Edit:"StpE",Delete:"StpD",Webhook:"StpWh",Developer:"StpDev"},service:{View:"Serv"},myProfile:{View:"Prof",Notification:"Notf",Subscription:"Subs",Activity:"Actv"},customerDisplay:{View:"Disp"},orderDisplay:{View:"KitD"},global:{Export:"Export",Number:"NumE",Date:"DateE"},apps:{Marketplace:"Mrp",Jurnal:"Jurnal",Tools:"Tools"},fulfillment:{View:"Ful",Edit:"FulE",Create:"FulC",Delete:"FulD",Ship:"FulS"},manufacture:{View:"Man",Create:"ManC",Edit:"ManE",Delete:"ManD"},developer:{Api:"API",View:"Dev",Edit:"DevE"}};var Jf=(()=>{class i{constructor(){this._roles=[],this.parseJWTRoles()}parseJWTRoles(){let t=localStorage.getItem("Token");if(t){var n=Cl(t);this._roles=n["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"],console.log(this._roles)}}isInRole(t,n){let r={};return n.forEach((o,a)=>r[t[a]]=typeof o=="string"?this._roles.includes(o):o(this._roles)),r}isUserHasRole(t){return this._roles.includes(t)}get product(){return this._product||(this._product=this.setBulkRole("product")),this._product}get contact(){return this._contact||(this._contact=this.setBulkRole("contact")),this._contact}get promotion(){return this._promotion||(this._promotion=this.setBulkRole("promotion")),this._promotion}get accounting(){return this._accounting||(this._accounting=this.setBulkRole("accounting")),this._accounting}get users(){return this._users||(this._users=this.setBulkRole("users")),this._users}get outlets(){return this._outlets||(this._outlets=this.setBulkRole("outlets")),this._outlets}get setup(){return this._setup||(this._setup=this.setBulkRole("setup")),this._setup}get service(){return this._service||(this._service=this.setBulkRole("service")),this._service}get profile(){return this._profile||(this._profile=this.setBulkRole("myProfile")),this._profile}get customerDisplay(){return this._customerDisplay||(this._customerDisplay=this.setBulkRole("customerDisplay")),this._customerDisplay}get orderDisplay(){return this._orderDisplay||(this._orderDisplay=this.setBulkRole("orderDisplay")),this._orderDisplay}get global(){return this._global||(this._global=this.setBulkRole("global")),this._global}get apps(){return this._apps||(this._apps=this.setBulkRole("apps")),this._apps}get fulfillment(){return this._fulfillment||(this._fulfillment=this.setBulkRole("fulfillment")),this._fulfillment}get manufacture(){return this._manufacture||(this._manufacture=this.setBulkRole("manufacture")),this._manufacture}get inventory(){return this._inventory||(this._inventory=this.setBulkRole("inventory")),this._inventory}get sell(){return this._sell||(this._sell=this.setBulkRole("sell")),this._sell}get report(){return this._report||(this._report=this.setBulkRole("report")),this._report}get buy(){return this._buy||(this._buy=this.setBulkRole("buy")),this._buy}get adjustment(){return this._adjustment||(this._adjustment=this.setBulkRole("adjustment")),this._adjustment}get debt(){return this._debt||(this._debt=this.setBulkRole("debt")),this._debt}get payment(){return this._payment||(this._payment=this.setBulkRole("payment")),this._payment}get prepaidPackage(){return this._prepaidPackage||(this._prepaidPackage=this.setBulkRole("prepaidPackage")),this._prepaidPackage}get order(){return this._order||(this._order=this.setBulkRole("orders")),this._order}get logistic(){return this._logistic||(this._logistic=this.setBulkRole("logistics")),this._logistic}get estimate(){return this._estimate||(this._estimate=this.setBulkRole("estimate")),this._estimate}get shift(){return this._shift||(this._shift=this.setBulkRole("shift")),this._shift}get developer(){return this._developer||(this._developer=this.setBulkRole("developer")),this._developer}get dashboard(){return this._dashboard||(this._dashboard=this.setBulkRole("dashboard")),this._dashboard}setBulkRole(t){let n={};for(let r in Yc[t])n[r]=this.isUserHasRole(Yc[t][r]);return n}get isSystemUser(){let t=localStorage.getItem("Token");return Cl(t).Type=="System"}resetRoles(){this._roles=[],this._accounting=null,this._adjustment=null,this._apps=null,this._buy=null,this._contact=null,this._customerDisplay=null,this._debt=null,this._fulfillment=null,this._estimate=null,this._global=null,this._inventory=null,this._logistic=null,this._manufacture=null,this._order=null,this._orderDisplay=null,this._outlets=null,this._payment=null,this._product=null,this._prepaidPackage=null,this._profile=null,this._promotion=null,this._report=null,this._sell=null,this._service=null,this._setup=null,this._shift=null,this._users=null,this._developer=null,this._dashboard=null}toJSON(){return{product:this.product,contact:this.contact,promotion:this.promotion,accounting:this.accounting,users:this.users,outlets:this.outlets,setup:this.setup,service:this.service,profile:this.profile,customerDisplay:this.customerDisplay,orderDisplay:this.orderDisplay,global:this.global,apps:this.apps,fulfillment:this.fulfillment,manufacture:this.manufacture,inventory:this.inventory,sell:this.sell,report:this.report,buy:this.buy,adjustment:this.adjustment,debt:this.debt,payment:this.payment,prepaidPackage:this.prepaidPackage,order:this.order,logistic:this.logistic,estimate:this.estimate,shift:this.shift,developer:this.developer,dashboard:this.dashboard}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275prov=Ue({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var em=(i,e)=>e.PromotionID;function MC(i,e){if(i&1&&(f(0,"mat-option",19)(1,"div",20)(2,"span",21),x(3),m(),f(4,"span",22),x(5),m()()()),i&2){let t=e.$implicit;P("value",t),y(3),I(t.Value),y(2),I(t.Code)}}function AC(i,e){if(i&1&&ei(0,MC,6,3,"mat-option",19,sa),i&2){let t=O();ti(t)}}function BC(i,e){i&1&&(f(0,"mat-option",18),x(1,"No items found"),m()),i&2&&P("disabled",!0)}function NC(i,e){i&1&&le(0,AC,2,0)(1,BC,2,1,"mat-option",18),i&2&&Ce(e.length>0?0:1)}function zC(i,e){if(i&1){let t=Ie();f(0,"div",23)(1,"img",24),W("error",function(r){ae(t);let o=O();return se(o.onErrorImage(r))}),m(),f(2,"div",25)(3,"ngb-highlight",26),x(4),m(),f(5,"span"),x(6),m()()()}if(i&2){let t=e.result,n=e.term;y(),P("src",t.ImgUrl,ia)("alt",t.Value),y(2),P("result",t.Value)("term",n),y(),I(t.Value),y(2),I(t.Code)}}function LC(i,e){if(i&1&&(f(0,"ng-option",28),x(1),m()),i&2){let t=e.$implicit;P("value",t.PromotionID),y(),I(t.Name)}}function HC(i,e){if(i&1&&(f(0,"ng-select",27),ei(1,LC,2,2,"ng-option",28,em),m()),i&2){let t=O(2);y(),ti(t)}}function jC(i,e){if(i&1&&(f(0,"ng-option",28),x(1),m()),i&2){let t=e.$implicit;P("value",t),y(),I(t.Name)}}function VC(i,e){if(i&1&&(f(0,"ng-select",27),ei(1,jC,2,2,"ng-option",28,em),m()),i&2){let t=O(2);y(),ti(t)}}function UC(i,e){if(i&1&&(f(0,"div",12)(1,"label",9),x(2,"Promotion Price"),m(),le(3,HC,3,0,"ng-select",27)(4,VC,3,0,"ng-select",27),m()),i&2){let t=O(2);y(3),Ce(t.isEditProduct()?3:4)}}function WC(i,e){i&1&&le(0,UC,5,1,"div",12),i&2&&Ce(e.length?0:-1)}function $C(i,e){if(i&1){let t=Ie();f(0,"button",29),W("click",function(){ae(t);let r=O();return se(r.resetForm())}),x(1," Cancel "),m()}}var is=(()=>{class i{constructor(){this.promotionPrice$=Le([]),this.variant$=Le({}),this.UUidSelected="",this.httpService=z(bi),this.fb=z(Yi),this.router=z(Un),this.storeService=z(ke),this.location=z(ha),this.maskitoOptions=sr({precision:2,thousandSeparator:","}),this.route=z(ma),this.variant={},this.roleService=z(Jf),this.domain="",this.isEditProduct=q(!1)}displayFn(t){return t?t.Value:""}initForm(){this.form=this.fb.group({name:new nt("",[lt.required]),quantity:new nt("",[lt.required]),promotionPrice:new nt("",[]),price:new nt("",[lt.required])})}ngAfterViewInit(){this.domain=`https://${localStorage.getItem("Domain")}`}ngOnInit(){this.initForm(),this.form.get("promotionPrice").valueChanges.pipe(Jt(()=>Object.keys(this.variant).length>0),hn("prommotionPrice"),xe(t=>{if(t)this.form.patchValue({price:+this.variant.UnitPrice}),this.form.get("price").disable();else{console.warn("Invalid UnitPrice, not patching price");let n=[...this.storeService.productItems()],r=n.findIndex(o=>o.VariantID===this.route.snapshot.queryParamMap.get("id"));r!==-1&&this.form.patchValue({price:+this.variant.UnitPrice!=+n[r].UnitPrice?+n[r].UnitPrice:+this.variant.UnitPrice}),this.form.get("price").enable()}})).subscribe(),this.route.queryParamMap.pipe(xe(t=>{this.isEditProduct.set(t.has("id")),console.log("edit",this.isEditProduct()),this.UUidSelected=t.get("id")||""})).subscribe(),this.route.queryParamMap.pipe(qi(t=>{if(t.has("id")){let n=t.get("id"),r=[...this.storeService.productItems()],o=r.findIndex(a=>Object.prototype.hasOwnProperty.call(a,"VariantID")?a.VariantID:a.ID===n);if(o!==-1){let a={EntityID:"00000000-0000-0000-0000-000000000000",ID:Object.prototype.hasOwnProperty.call(r[o],"VariantID")?r[o].VariantID:r[o].ID},s={VariantID:Object.prototype.hasOwnProperty.call(r[o],"VariantID")?r[o].VariantID:r[o].ID};return rl([this.httpService.post("/API/V3/Variant/ID",a,void 0,this.domain),this.roleService.promotion.View?this.httpService.post("/API/v3/PromotionEvent/GetByVariantID",s,void 0,this.domain):Le(null)]).pipe(Zt(([l,c])=>({variant:l,promotion:c,KEY:n})))}return Le(null)}else return this.form.reset(),this.form.enable(),this.promotionPrice$=Le([]),Le(null)}),hn("edit"),xe(t=>{if(t===null)return;this.form.get("name").disable();let{variant:n,promotion:r,KEY:o}=t;this.promotionPrice$=Le(r),this.variant$=Le(n),this.variant=n;let a=[...this.storeService.productItems()],s=a.findIndex(l=>Object.prototype.hasOwnProperty.call(l,"VariantID")?l.VariantID:l.ID);if(s!==-1){let l=r.findIndex(c=>c.PromotionID.toLowerCase()===a[s].Promotions?.PromotionID?.toLowerCase());if(l!==-1){let c=+r[l]?.UnitPrice;isNaN(c)&&(c=+n.UnitPrice),this.form.patchValue({price:+n.UnitPrice!=+a[s].UnitPrice?+a[s].UnitPrice:+n.UnitPrice,promotionPrice:r[l].PromotionID,quantity:+a[s].Quantity,name:{Value:n.Name}}),this.form.get("price").disable()}else this.form.patchValue({price:+n.UnitPrice!=+a[s].UnitPrice?+a[s].UnitPrice:+n.UnitPrice,promotionPrice:null,quantity:+a[s].Quantity,name:{Value:n.Name}})}})).subscribe(),this.variantSuggestion$=this.form.get("name").valueChanges.pipe(lp(200),sl(),qi(t=>{if(t&&t.length>2){let n={count:100,prefix:t},r=`https://${localStorage.getItem("Domain")}`;return this.httpService.post("/API/AC/GetVariantSuggestionByCodeNName",n,void 0,r)}else return Le([])}))}onOptionSelected(t){if(Object.hasOwn(t.option.value,"Key")){let n=t.option.value.Key,r={EntityID:"00000000-0000-0000-0000-000000000000",ID:n},o={VariantID:n};return rl([this.httpService.post("/API/V3/Variant/ID",r,void 0,this.domain),this.roleService.promotion.View?this.httpService.post("/API/v3/PromotionEvent/GetByVariantID",o,void 0,this.domain):Le(null)]).pipe(Zt(([a,s])=>({variant:a,promotion:s})),xe(({variant:a,promotion:s})=>{this.form.patchValue({price:a.UnitPrice,promotionPrice:null,quantity:1}),this.promotionPrice$=Le(s),this.variant$=Le(a),this.variant=a})).subscribe()}else throw new Error("Key not found")}onSubmit(){let{name:t,quantity:n,promotionPrice:r,price:o}=this.form.getRawValue(),a=n.toString().replace(/,/g,""),s=o.toString().replace(/,/g,"");return this.isEditProduct()?ea([this.promotionPrice$,this.variant$]).pipe(Zt(([l,c])=>({promotions:l,variant:c})),Zt(({promotions:l,variant:c})=>{let d=[...this.storeService.productItems()],u=d.findIndex(h=>Object.prototype.hasOwnProperty.call(h,"VariantID")?h.VariantID:h.ID===this.UUidSelected.toLowerCase());if(u!==-1){let h=l.findIndex(_=>_.PromotionID.toLowerCase()===r?.toLowerCase());if(h!==-1){let _=+l[h]?.UnitPrice;isNaN(_)&&(_=+c.UnitPrice),d[u]=D(v({},d[u]),{Quantity:+a,Promotions:l[h],UnitPrice:+s,checked:!1})}else d[u]=D(v({},d[u]),{Quantity:+a,Promotions:r,UnitPrice:+s,checked:!1})}let g=[...d];this.storeService.onChangeProductItems(g),this.form.get("price").enable(),this.form.reset(),this.router.navigate(["/pages"]),this.promotionPrice$=Le([]),this.variant={}})).subscribe():this.variant$.pipe(Zt(l=>D(v({},l),{Quantity:+n,Promotions:r,UnitPrice:+s})),xe(l=>{let c=[...this.storeService.productItems()];c.push(l);let d=[...c];this.storeService.onChangeProductItems(d),this.form.get("price").enable(),this.form.reset(),this.promotionPrice$=Le([])})).subscribe()}onErrorImage(t){console.log(t);let n=t.target;t.type==="error"&&(n.src="assets/images/image-404.svg")}get hasEdit(){return this.route.snapshot.queryParamMap.has("id")}resetForm(){this.form.reset(),this.router.navigate([],{relativeTo:this.route,queryParams:{id:null},queryParamsHandling:"merge"})}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["modal-choose-product"]],standalone:!0,features:[_e],decls:31,vars:14,consts:[["auto","matAutocomplete"],["rt",""],[1,"card","mb-3","w-100","p-0"],[1,"card-header","px-0"],[1,"text-dark","fw-medium","font-robotoslab",2,"margin","0.6rem 0","font-size","16px"],[1,"card-body","px-0","py-0","pt-4"],[1,"d-flex","flex-column","gap-2"],[1,"d-flex","flex-column","gap-3",3,"formGroup"],[1,"form-group","d-flex","flex-column","position-relative"],[1,"text-dark","fs-2","fw-semibold","font-robotoslab"],["type","text","formControlName","name",1,"form-control","form-control-lg","fs-3",3,"matAutocomplete"],["autoActiveFirstOption","",3,"optionSelected","displayWith"],[1,"form-group"],["type","text","formControlName","quantity",1,"form-control","form-control-lg","fs-3",3,"maskito"],["type","text","formControlName","price",1,"form-control","form-control-lg","fs-3",3,"maskito"],[1,"d-flex","gap-4"],["type","button",1,"flex","flex-grow-1","btn","btn-outline-secondary"],["type","button",1,"flex","flex-grow-1","btn","btn-success",3,"click","disabled"],[1,"fs-2",3,"disabled"],[1,"fs-2",3,"value"],[1,"d-flex","flex-column"],[1,"fs-2"],[1,"opacity-75",2,"font-size","11px"],[1,"d-flex","w-100","overflow-x-hidden","gap-2"],[1,"me-1",2,"width","42px","height","42px",3,"error","src","alt"],[1,"flex-grow-1","d-flex","flex-column","flex-wrap"],[3,"result","term"],["formControlName","promotionPrice","placeholder","Select Promotion Price",1,"custom","fs-3"],[1,"fs-3",3,"value"],["type","button",1,"flex","flex-grow-1","btn","btn-outline-secondary",3,"click"]],template:function(n,r){if(n&1){let o=Ie();f(0,"div",2)(1,"div",3)(2,"span",4),x(3),m()(),f(4,"div",5)(5,"div",6)(6,"form",7)(7,"div",8)(8,"label",9),x(9,"Name"),m(),ue(10,"input",10),f(11,"mat-autocomplete",11,0),W("optionSelected",function(s){return ae(o),se(r.onOptionSelected(s))}),le(13,NC,2,1),je(14,"async"),m(),le(15,zC,7,6,"ng-template",null,1,me),m(),f(17,"div",12)(18,"label",9),x(19,"Quantity"),m(),ue(20,"input",13),m(),f(21,"div",12)(22,"label",9),x(23,"Price"),m(),ue(24,"input",14),m(),le(25,WC,1,1),je(26,"async"),f(27,"div",15),le(28,$C,2,0,"button",16),f(29,"button",17),W("click",function(){return ae(o),se(r.onSubmit())}),x(30," Submit "),m()()()()()()}if(n&2){let o,a,s=ml(12);y(3),Ht("",r.UUidSelected?"Update":"Add"," Product"),y(3),P("formGroup",r.form),y(4),P("matAutocomplete",s),y(),P("displayWith",r.displayFn),y(2),Ce((o=jt(14,10,r.variantSuggestion$))?13:-1,o),y(7),P("maskito",r.maskitoOptions),y(4),P("maskito",r.maskitoOptions),y(),Ce((a=jt(26,12,r.promotionPrice$))?25:-1,a),y(3),Ce(r.hasEdit?28:-1),y(),P("disabled",r.form.invalid)}},dependencies:[Sp,oi,_i,Aa,rt,ya,tt,it,ga,va,ba,Fp,vp,Ji,Oa,Zf,Kf,Ma,Xc],styles:[".mat-mdc-autocomplete-panel{background-color:#fff!important} .mat-mdc-autocomplete-panel>.mat-mdc-option.mdc-list-item--disabled{min-height:34px}"]})}}return i})();var tm=(()=>{class i{constructor(){this.transactionType=q([{title:"Supplier Bill",type:0},{title:"Transfer Order",type:1}]),this.storeService=z(ke),this.fb=z(Yi),this.activeModal=z(Ea)}get outlets(){return this.storeService.paperConfig().Outlets}initForm(){this.form=this.fb.group({type:new nt("",[lt.required]),outlet:new nt("",[lt.required]),number:new nt("",[lt.required])})}ngOnInit(){this.initForm()}onOK(){this.activeModal.close({role:"ok",data:this.form.value})}onClose(){this.activeModal.dismiss({role:"close",data:null})}onPaste(t){t.preventDefault();let n=t.clipboardData.getData("text").trim(),r=t.target;r.value+=n,this.form.patchValue({number:r.value})}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-dialog-load-transaction"]],standalone:!0,features:[_e],decls:14,vars:4,consts:[["title","Choose your transaction",3,"onOK","onClose","hasValid"],[1,"d-flex","flex-column","gap-2",3,"formGroup"],[1,"form-group"],[1,"text-dark","fs-2","fw-semibold","font-robotoslab"],["formControlName","type","bindLabel","title","bindValue","type","placeholder","Choose Type",1,"custom","fs-2",3,"items"],["formControlName","outlet","bindLabel","Name","bindValue","Name","placeholder","Choose Outlet",1,"custom","fs-2",3,"items"],["formControlName","number","type","text",1,"form-control","fs-2",2,"height","32px",3,"paste"]],template:function(n,r){n&1&&(f(0,"app-base-modal",0),W("onOK",function(){return r.onOK()})("onClose",function(){return r.onClose()}),f(1,"form",1)(2,"div",2)(3,"label",3),x(4,"Choose Type"),m(),ue(5,"ng-select",4),m(),f(6,"div",2)(7,"label",3),x(8,"Choose Outlet"),m(),ue(9,"ng-select",5),m(),f(10,"div",2)(11,"label",3),x(12,"Invoice Number"),m(),f(13,"input",6),W("paste",function(a){return r.onPaste(a)}),m()()()()),n&2&&(P("hasValid",r.form.valid),y(),P("formGroup",r.form),y(4),P("items",r.transactionType()),y(4),P("items",r.outlets))},dependencies:[Da,oi,_i,ht,ya,tt,it,ga,rt,va,ba],changeDetection:0})}}return i})();var qC=(()=>{class i{constructor(t){this.document=t,this.width=this.getWidth()}getWidth(){let t=this.document.createElement("div");t.style.visibility="hidden",t.style.width="100px",t.style.msOverflowStyle="scrollbar",this.document.body.appendChild(t);let n=t.offsetWidth;t.style.overflow="scroll";let r=this.document.createElement("div");r.style.width="100%",t.appendChild(r);let o=r.offsetWidth;return t.parentNode.removeChild(t),n-o}}return i.\u0275fac=function(t){return new(t||i)(pe(mt))},i.\u0275prov=Ue({token:i,factory:i.\u0275fac}),i})(),GC=(()=>{class i{getDimensions(t){return t.getBoundingClientRect()}}return i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=Ue({token:i,factory:i.\u0275fac}),i})(),XC=(()=>{class i{constructor(){this.columnInputChanges=new et}get columnInputChanges$(){return this.columnInputChanges.asObservable()}onInputChange(){this.columnInputChanges.next()}}return i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=Ue({token:i,factory:i.\u0275fac}),i})();function YC(i){return i=i.replace(/[^a-zA-Z0-9 ]/g," "),i=i.replace(/([a-z](?=[A-Z]))/g,"$1 "),i=i.replace(/([^a-zA-Z0-9 ])|^[0-9]+/g,"").trim().toLowerCase(),i=i.replace(/([ 0-9]+)([a-zA-Z])/g,function(e,t,n){return t.trim()+n.toUpperCase()}),i}var ns={},im=typeof document<"u"?document.createElement("div").style:void 0,Kc=function(){let i=typeof window<"u"?window.getComputedStyle(document.documentElement,""):void 0,e=typeof i<"u"?Array.prototype.slice.call(i).join("").match(/-(moz|webkit|ms)-/):null,t=e!==null?e[1]:void 0,n=typeof t<"u"?"WebKit|Moz|MS|O".match(new RegExp("("+t+")","i"))[1]:void 0;return n?{dom:n,lowercase:t,css:`-${t}-`,js:t[0].toUpperCase()+t.substr(1)}:void 0}();function rs(i){let e=YC(i);return ns[e]||(Kc!==void 0&&im[Kc.css+i]!==void 0?ns[e]=Kc.css+i:im[i]!==void 0&&(ns[e]=i)),ns[e]}var i3=typeof window<"u"?rs("transform"):void 0,n3=typeof window<"u"?rs("backfaceVisibility"):void 0,r3=typeof window<"u"?!!rs("transform"):void 0,o3=typeof window<"u"?!!rs("perspective"):void 0,nm=typeof window<"u"?window.navigator.userAgent:"Chrome",a3=/Safari\//.test(nm)&&!/Chrome\//.test(nm);var rm=(()=>{class i{static forRoot(t){return{ngModule:i,providers:[{provide:"configuration",useValue:t}]}}}return i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=Nt({type:i}),i.\u0275inj=Bt({providers:[qC,GC,XC],imports:[[ri]]}),i})();typeof document<"u"&&!document.elementsFromPoint&&(document.elementsFromPoint=KC);function KC(i,e){let t=[],n=[],r,o,a;for(;(r=document.elementFromPoint(i,e))&&t.indexOf(r)===-1&&r!=null;)t.push(r),n.push({value:r.style.getPropertyValue("pointer-events"),priority:r.style.getPropertyPriority("pointer-events")}),r.style.setProperty("pointer-events","none","important");for(o=n.length;a=n[--o];)t[o].style.setProperty("pointer-events",a.value?a.value:"",a.priority);return t}var om=(()=>{class i{constructor(){this.subject$=new et}onFileLoad(t){let r=t.target.result,o=!1,a=[],s=[],l=0;for(let c of r.split(/[\r\n]+/))if(o){let d={};for(let u=0;u<l;u++)d[s[u]]=c.split(",")[u];a.push(d)}else{for(let d=0;d<c.split(",").length;d++)l=c.split(",").length,s.push(c.split(",")[d].replace(/ /g,""));o=!0}return a.splice(-1),a}convertFile(t){let n=t,r=new FileReader;return r.onload=o=>{let a=this.onFileLoad(o);this.subject$.next(a)},r.readAsText(n,"UTF-8"),this.subject$.asObservable()}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275prov=Ue({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var am=(()=>{class i{constructor(t,n,r){this.http=t,this.toastr=n,this.router=r}PostToUrlEncode(t,n,r=1e5){let o=new vi;return o=o.set("Content-Type","application/x-www-form-urlencoded"),new St(a=>{this.http.post(t,n,{headers:o}).pipe(mi(r)).subscribe(s=>{a.next(s),a.complete()})})}GetText(t=1e5){let n=localStorage.getItem("Token"),o={responseType:"text",headers:new vi({Authorization:"Bearer "+n})};return new St(a=>{this.http.get("/API/Token/GetZendeskJWT",o).pipe(mi(t)).subscribe(s=>{a.next(s),a.complete()})})}POSText(t,n,r=1e5){let o=localStorage.getItem("Token"),s={responseType:"text",headers:new vi({"Content-Type":"application/json","Cache-Control":"no-cache",Authorization:"Bearer "+o})};return new St(l=>{this.http.post(t,n,s).pipe(mi(r)).subscribe(c=>{l.next(c),l.complete()})})}get(t){let n=localStorage.getItem("Token"),r=new vi({"Content-Type":"application/json","Cache-Control":"no-cache"});n&&(r=r.append("Authorization","Bearer "+n));let o={headers:r};return this.http.get(t,o).pipe(Tr(a=>{if(!this.unauthorizedErrorHandling(a)){let l=this.errorMessageHandling(a);this.toastr.error(l.Message!=""?l.Message:"An unknown error has occured!",l.header),this.paymentErrorHandling(a)}return ap(()=>a)}))}getNews(t){return this.http.get(t)}paymentErrorHandling(t){t.status==402&&this.router.navigate(["/menu/Profile/Main/My_Subscription"])}post(t,n,r=1e5){return new St(o=>{let a=localStorage.getItem("Token"),s=new vi({"Content-Type":"application/json","Cache-Control":"no-cache"});a&&(s=s.append("Authorization","Bearer "+a));let l={headers:s};Date.prototype.toJSON=function(){return this.getFullYear()+"-"+c(this.getMonth()+1)+"-"+c(this.getDate())+"T"+c(this.getHours())+":"+c(this.getMinutes())+":"+c(this.getSeconds())+".000"};function c(d){return d<10?"0"+d:d}this.http.post(t,n,l).pipe(mi(r)).subscribe({next:d=>{o.next(d),o.complete()},error:d=>{if(d.status==200)o.next(d.error.text),o.complete();else{if(!this.unauthorizedErrorHandling(d)){let g=this.errorMessageHandling(d);this.toastr.error(g.Message!=""?g.Message:"An unknown error has occured!",g.header,{enableHtml:!0})}o.error(d)}}})})}postFile(t,n,r=1e5){return new St(o=>{let a=localStorage.getItem("Token"),s=new vi({"Content-Type":"application/json","Cache-Control":"no-cache"});a&&(s=s.append("Authorization","Bearer "+a)),this.http.post(t,n,{headers:s,observe:"response",responseType:"blob"}).pipe(mi(r)).subscribe({next:l=>{o.next({title:l.headers.get("Content-Disposition"),file:l.body}),o.complete()},error:l=>{if(l.headers.get("Content-Type")==="application/json; charset=utf-8"){let c=new FileReader;c.addEventListener("loadend",d=>{let u=JSON.parse(d.srcElement.result)?.Message;if(!this.unauthorizedErrorHandling(l)){let h=this.errorMessageHandling(l);this.toastr.error(u??"An unknown error has occured!",h.header,{enableHtml:!0})}}),c.readAsText(l.error)}o.error(l)}})})}put(t,n,r=1e5){return new St(o=>{let a=localStorage.getItem("Token"),s=new vi({"Content-Type":"application/json","Cache-Control":"no-cache"});a&&(s=s.append("Authorization","Bearer "+a));let l={headers:s};this.http.put(t,n,l).pipe(mi(r)).subscribe({next:c=>{o.next(c),o.complete()},error:c=>{if(c.status==200)o.next(c.error.text),o.complete();else{if(!this.unauthorizedErrorHandling(c)){let u=this.errorMessageHandling(c);this.toastr.error(u.Message!=""?u.Message:"An unknown error has occured!",u.header)}o.error(c)}}})})}delete(t,n,r=1e5){return new St(o=>{let a=localStorage.getItem("Token"),s=new vi({"Content-Type":"application/json","Cache-Control":"no-cache"});a&&(s=s.append("Authorization","Bearer "+a));let l={headers:s,body:n};this.http.delete(t,l).pipe(mi(r)).subscribe({next:c=>{o.next(c),o.complete()},error:c=>{if(c.status==200)o.next(c.error.text),o.complete();else{if(!this.unauthorizedErrorHandling(c)){let u=this.errorMessageHandling(c);this.toastr.error(u.Message!=""?u.Message:"An unknown error has occured!",u.header)}o.error(c)}}})})}unauthorizedErrorHandling(t){let n=!1;return(t.status==401||t.status==403)&&(localStorage.getItem("Token")?this.router.navigate(["/menu/Unauthorized/Main/Unauthorized"]):window.location.href="/",n=!0),n}errorMessageHandling(t){let n="API Error",r="Exception Message";return t.error?(n="API Error - "+t.status,t.status==451&&(n="Error"),t.error&&(r=t.error.Message)):t.Message&&(n="API Error - "+t.name,r=t.Message),{header:n,Message:r}}postFormDataWithoutBearer(t,n){return new St(r=>{this.http.post(t,n).pipe(mi(1e5)).subscribe({next:o=>{r.next(o),r.complete()},error:o=>{o.status==200&&(r.next(o.error.text),r.complete()),r.error(o)}})})}postFormData(t,n,r=!0){return new St(o=>{let a=localStorage.getItem("Token"),l={headers:new vi({Authorization:"Bearer "+a})};this.http.post(t,n,l).pipe(mi(1e5)).subscribe({next:c=>{o.next(c),o.complete()},error:c=>{if(c.status==200)o.next(c.error.text),o.complete();else{if(!this.unauthorizedErrorHandling(c)&&r){let u=this.errorMessageHandling(c);this.toastr.error(u.Message!=""?u.Message:"An unknown error has occured!",u.header)}o.error(c)}}})})}static{this.\u0275fac=function(n){return new(n||i)(pe(Cp),pe(Ta),pe(Un))}}static{this.\u0275prov=Ue({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();function os(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var QC=0;function lm(i){return"__private_"+QC+++"_"+i}function ZC(i,e,t){let n=[];return i.forEach(r=>typeof r!="string"?n.push(r):e[Symbol.split](r).forEach((o,a,s)=>{o!==""&&n.push(o),a<s.length-1&&n.push(t)})),n}function sm(i,e){let t=/\$/g,n="$$$$",r=[i];if(e==null)return r;for(let o of Object.keys(e))if(o!=="_"){let a=e[o];typeof a=="string"&&(a=t[Symbol.replace](a,n)),r=ZC(r,new RegExp(`%\\{${o}\\}`,"g"),a)}return r}var JC=i=>{throw new Error(`missing string: ${i}`)},Zr=lm("onMissingKey"),Jr=lm("apply"),lr=class{constructor(e,t){let{onMissingKey:n=JC}=t===void 0?{}:t;Object.defineProperty(this,Jr,{value:eS}),Object.defineProperty(this,Zr,{writable:!0,value:void 0}),this.locale={strings:{},pluralize(r){return r===1?0:1}},Array.isArray(e)?e.forEach(os(this,Jr)[Jr],this):os(this,Jr)[Jr](e),os(this,Zr)[Zr]=n}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){let n=this.locale.strings[e];if(n==null&&(os(this,Zr)[Zr](e),n=e),typeof n=="object"){if(t&&typeof t.smart_count<"u"){let o=this.locale.pluralize(t.smart_count);return sm(n[o],t)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if(typeof n!="string")throw new Error("string was not a string");return sm(n,t)}};function eS(i){if(!(i!=null&&i.strings))return;let e=this.locale;Object.assign(this.locale,{strings:v(v({},e.strings),i.strings),pluralize:i.pluralize||e.pluralize})}var og=De(dm(),1);var tS="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var nn=(i=21)=>{let e="",t=i|0;for(;t--;)e+=tS[Math.random()*64|0];return e};var ag=De(Um(),1);function ss(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var XS=0;function Wm(i){return"__private_"+XS+++"_"+i}var YS={version:"4.2.0"},fn=Wm("callbacks"),td=Wm("publish"),ls=class{constructor(){Object.defineProperty(this,td,{value:KS}),this.state={},Object.defineProperty(this,fn,{writable:!0,value:new Set})}getState(){return this.state}setState(e){let t=v({},this.state),n=v(v({},this.state),e);this.state=n,ss(this,td)[td](t,n,e)}subscribe(e){return ss(this,fn)[fn].add(e),()=>{ss(this,fn)[fn].delete(e)}}};function KS(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];ss(this,fn)[fn].forEach(n=>{n(...e)})}ls.VERSION=YS.version;var $m=ls;function xi(i){let e=i.lastIndexOf(".");return e===-1||e===i.length-1?{name:i,extension:void 0}:{name:i.slice(0,e),extension:i.slice(e+1)}}var id={__proto__:null,md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",webp:"image/webp",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",dicom:"application/dicom",doc:"application/msword",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"};function to(i){var e;if(i.type)return i.type;let t=i.name?(e=xi(i.name).extension)==null?void 0:e.toLowerCase():null;return t&&t in id?id[t]:"application/octet-stream"}function QS(i){return i.charCodeAt(0).toString(32)}function qm(i){let e="";return i.replace(/[^A-Z0-9]/gi,t=>(e+=`-${QS(t)}`,"/"))+e}function Gm(i,e){let t=e||"uppy";return typeof i.name=="string"&&(t+=`-${qm(i.name.toLowerCase())}`),i.type!==void 0&&(t+=`-${i.type}`),i.meta&&typeof i.meta.relativePath=="string"&&(t+=`-${qm(i.meta.relativePath.toLowerCase())}`),i.data.size!==void 0&&(t+=`-${i.data.size}`),i.data.lastModified!==void 0&&(t+=`-${i.data.lastModified}`),t}function ZS(i){return!i.isRemote||!i.remote?!1:new Set(["box","dropbox","drive","facebook","unsplash"]).has(i.remote.provider)}function cs(i,e){if(ZS(i))return i.id;let t=to(i);return Gm(D(v({},i),{type:t}),e)}function nd(i){if(i==null&&typeof navigator<"u"&&(i=navigator.userAgent),!i)return!0;let e=/Edge\/(\d+\.\d+)/.exec(i);if(!e)return!0;let n=e[1].split(".",2),r=parseInt(n[0],10),o=parseInt(n[1],10);return r<15||r===15&&o<15063||r>18||r===18&&o>=18218}function rd(i,e){return e.name?e.name:i.split("/")[0]==="image"?`${i.split("/")[0]}.${i.split("/")[1]}`:"noname"}function od(i){return i<10?`0${i}`:i.toString()}function cr(){let i=new Date,e=od(i.getHours()),t=od(i.getMinutes()),n=od(i.getSeconds());return`${e}:${t}:${n}`}var Xm={debug:()=>{},warn:()=>{},error:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.error(`[Uppy] [${cr()}]`,...e)}},Ym={debug:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.debug(`[Uppy] [${cr()}]`,...e)},warn:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.warn(`[Uppy] [${cr()}]`,...e)},error:function(){for(var i=arguments.length,e=new Array(i),t=0;t<i;t++)e[t]=arguments[t];return console.error(`[Uppy] [${cr()}]`,...e)}};var no=De(io(),1),ig=De(tg(),1),ng={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]},Tt=class extends Error{constructor(e,t){var n;super(e),this.isRestriction=!0,this.isUserFacing=(n=t?.isUserFacing)!=null?n:!0,t!=null&&t.file&&(this.file=t.file)}},ds=class{constructor(e,t){this.getI18n=t,this.getOpts=()=>{var n;let r=e();if(((n=r.restrictions)==null?void 0:n.allowedFileTypes)!=null&&!Array.isArray(r.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return r}}validateAggregateRestrictions(e,t){let{maxTotalFileSize:n,maxNumberOfFiles:r}=this.getOpts().restrictions;if(r&&e.filter(a=>!a.isGhost).length+t.length>r)throw new Tt(`${this.getI18n()("youCanOnlyUploadX",{smart_count:r})}`);if(n){let o=[...e,...t].reduce((a,s)=>{var l;return a+((l=s.size)!=null?l:0)},0);if(o>n)throw new Tt(this.getI18n()("aggregateExceedsSize",{sizeAllowed:(0,no.default)(n),size:(0,no.default)(o)}))}}validateSingleFile(e){let{maxFileSize:t,minFileSize:n,allowedFileTypes:r}=this.getOpts().restrictions;if(r&&!r.some(s=>s.includes("/")?e.type?(0,ig.default)(e.type.replace(/;.*?$/,""),s):!1:s[0]==="."&&e.extension?e.extension.toLowerCase()===s.slice(1).toLowerCase():!1)){let s=r.join(", ");throw new Tt(this.getI18n()("youCanOnlyUploadFileTypes",{types:s}),{file:e})}if(t&&e.size!=null&&e.size>t){var o;throw new Tt(this.getI18n()("exceedsSize",{size:(0,no.default)(t),file:(o=e.name)!=null?o:this.getI18n()("unnamed")}),{file:e})}if(n&&e.size!=null&&e.size<n)throw new Tt(this.getI18n()("inferiorSize",{size:(0,no.default)(n)}),{file:e})}validate(e,t){t.forEach(n=>{this.validateSingleFile(n)}),this.validateAggregateRestrictions(e,t)}validateMinNumberOfFiles(e){let{minNumberOfFiles:t}=this.getOpts().restrictions;if(t&&Object.keys(e).length<t)throw new Tt(this.getI18n()("youHaveToAtLeastSelectX",{smart_count:t}))}getMissingRequiredMetaFields(e){var t;let n=new Tt(this.getI18n()("missingRequiredMetaFieldOnFile",{fileName:(t=e.name)!=null?t:this.getI18n()("unnamed")})),{requiredMetaFields:r}=this.getOpts().restrictions,o=[];for(let a of r)(!Object.hasOwn(e.meta,a)||e.meta[a]==="")&&o.push(a);return{missingFields:o,error:n}}};var rg={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 H(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var tP=0;function Me(i){return"__private_"+tP+++"_"+i}var iP={version:"4.4.1"},us={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null},ct=Me("plugins"),dt=Me("restricter"),ro=Me("storeUnsubscribe"),Fi=Me("emitter"),mn=Me("preProcessors"),gn=Me("uploaders"),Ai=Me("postProcessors"),Wt=Me("informAndEmit"),uo=Me("checkRequiredMetaFieldsOnFile"),ad=Me("checkRequiredMetaFields"),oo=Me("assertNewUploadAllowed"),cd=Me("transformFile"),ao=Me("startIfAutoProceed"),so=Me("checkAndUpdateFileState"),dd=Me("handleUploadProgress"),lo=Me("updateTotalProgress"),Bi=Me("updateTotalProgressThrottled"),ud=Me("calculateTotalProgress"),sd=Me("addListeners"),ui=Me("updateOnlineStatus"),co=Me("requestClientById"),Ri=Me("createUpload"),ld=Me("getUpload"),yn=Me("removeUpload"),Mi=Me("runUpload"),ps=class i{constructor(e){Object.defineProperty(this,Mi,{value:gP}),Object.defineProperty(this,yn,{value:mP}),Object.defineProperty(this,ld,{value:fP}),Object.defineProperty(this,Ri,{value:hP}),Object.defineProperty(this,sd,{value:pP}),Object.defineProperty(this,ud,{value:uP}),Object.defineProperty(this,lo,{value:dP}),Object.defineProperty(this,so,{value:cP}),Object.defineProperty(this,ao,{value:lP}),Object.defineProperty(this,cd,{value:sP}),Object.defineProperty(this,oo,{value:aP}),Object.defineProperty(this,ad,{value:oP}),Object.defineProperty(this,uo,{value:rP}),Object.defineProperty(this,Wt,{value:nP}),Object.defineProperty(this,ct,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,dt,{writable:!0,value:void 0}),Object.defineProperty(this,ro,{writable:!0,value:void 0}),Object.defineProperty(this,Fi,{writable:!0,value:(0,og.default)()}),Object.defineProperty(this,mn,{writable:!0,value:new Set}),Object.defineProperty(this,gn,{writable:!0,value:new Set}),Object.defineProperty(this,Ai,{writable:!0,value:new Set}),this.scheduledAutoProceed=null,this.wasOffline=!1,Object.defineProperty(this,dd,{writable:!0,value:(r,o)=>{let a=r?this.getFile(r.id):void 0;if(r==null||!a){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}if(a.progress.percentage===100){this.log(`Not setting progress for a file that has been already uploaded: ${r.id}`);return}let s={bytesTotal:o.bytesTotal,percentage:o.bytesTotal!=null&&Number.isFinite(o.bytesTotal)&&o.bytesTotal>0?Math.round(o.bytesUploaded/o.bytesTotal*100):void 0};a.progress.uploadStarted!=null?this.setFileState(r.id,{progress:D(v(v({},a.progress),s),{bytesUploaded:o.bytesUploaded})}):this.setFileState(r.id,{progress:v(v({},a.progress),s)}),H(this,Bi)[Bi]()}}),Object.defineProperty(this,Bi,{writable:!0,value:(0,ag.default)(()=>H(this,lo)[lo](),500,{leading:!0,trailing:!0})}),Object.defineProperty(this,ui,{writable:!0,value:this.updateOnlineStatus.bind(this)}),Object.defineProperty(this,co,{writable:!0,value:new Map}),this.defaultLocale=rg;let t={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:ng,meta:{},onBeforeFileAdded:(r,o)=>!Object.hasOwn(o,r.id),onBeforeUpload:r=>r,store:new $m,logger:Xm,infoTimeout:5e3},n=v(v({},t),e);this.opts=D(v({},n),{restrictions:v(v({},t.restrictions),e&&e.restrictions)}),e&&e.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e&&e.debug&&(this.opts.logger=Ym),this.log(`Using Core v${i.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState(D(v({},us),{plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:nd(),individualCancellation:!0,resumableUploads:!1},meta:v({},this.opts.meta),info:[]})),H(this,dt)[dt]=new ds(()=>this.opts,()=>this.i18n),H(this,ro)[ro]=this.store.subscribe((r,o,a)=>{this.emit("state-update",r,o,a),this.updateAll(o)}),this.opts.debug&&typeof window<"u"&&(window[this.opts.id]=this),H(this,sd)[sd]()}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];H(this,Fi)[Fi].emit(e,...n)}on(e,t){return H(this,Fi)[Fi].on(e,t),this}once(e,t){return H(this,Fi)[Fi].once(e,t),this}off(e,t){return H(this,Fi)[Fi].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:v(v({},t),Object.fromEntries(Object.entries(e).map(n=>{let[r,o]=n;return[r,v(v({},t[r]),o)]})))})}setFileState(e,t){if(!this.getState().files[e])throw new Error(`Can\u2019t set state for ${e} (the file could have been removed)`);this.patchFilesState({[e]:t})}i18nInit(){let e=n=>this.log(`Missing i18n string: ${n}`,"error"),t=new lr([this.defaultLocale,this.opts.locale],{onMissingKey:e});this.i18n=t.translate.bind(t),this.i18nArray=t.translateArray.bind(t),this.locale=t.locale}setOptions(e){this.opts=D(v(v({},this.opts),e),{restrictions:v(v({},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=v({},this.getState().files),n=Object.create(null);Object.keys(t).forEach(r=>{n[r]=D(v({},t[r]),{progress:v(v({},t[r].progress),e),tus:void 0,transloadit:void 0})}),this.setState(v({files:n},us))}clear(){let{capabilities:e,currentUploads:t}=this.getState();if(Object.keys(t).length>0&&!e.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");this.setState(D(v({},us),{files:{}}))}addPreProcessor(e){H(this,mn)[mn].add(e)}removePreProcessor(e){return H(this,mn)[mn].delete(e)}addPostProcessor(e){H(this,Ai)[Ai].add(e)}removePostProcessor(e){return H(this,Ai)[Ai].delete(e)}addUploader(e){H(this,gn)[gn].add(e)}removeUploader(e){return H(this,gn)[gn].delete(e)}setMeta(e){let t=v(v({},this.getState().meta),e),n=v({},this.getState().files);Object.keys(n).forEach(r=>{n[r]=D(v({},n[r]),{meta:v(v({},n[r].meta),e)})}),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:n})}setFileMeta(e,t){let n=v({},this.getState().files);if(!n[e]){this.log(`Was trying to set metadata for a file that has been removed: ${e}`);return}let r=v(v({},n[e].meta),t);n[e]=D(v({},n[e]),{meta:r}),this.setState({files:n})}getFile(e){return this.getState().files[e]}getFiles(){let{files:e}=this.getState();return Object.values(e)}getFilesByIds(e){return e.map(t=>this.getFile(t))}getObjectOfFilesPerState(){let{files:e,totalProgress:t,error:n}=this.getState(),r=Object.values(e),o=[],a=[],s=[],l=[],c=[],d=[],u=[],g=[],h=[];for(let _ of r){let{progress:E}=_;!E.uploadComplete&&E.uploadStarted&&(o.push(_),_.isPaused||g.push(_)),E.uploadStarted||a.push(_),(E.uploadStarted||E.preprocess||E.postprocess)&&s.push(_),E.uploadStarted&&l.push(_),_.isPaused&&c.push(_),E.uploadComplete&&d.push(_),_.error&&u.push(_),(E.preprocess||E.postprocess)&&h.push(_)}return{newFiles:a,startedFiles:s,uploadStartedFiles:l,pausedFiles:c,completeFiles:d,erroredFiles:u,inProgressFiles:o,inProgressNotPausedFiles:g,processingFiles:h,isUploadStarted:l.length>0,isAllComplete:t===100&&d.length===r.length&&h.length===0,isAllErrored:!!n&&u.length===r.length,isAllPaused:o.length!==0&&c.length===o.length,isUploadInProgress:o.length>0,isSomeGhost:r.some(_=>_.isGhost)}}validateRestrictions(e,t){t===void 0&&(t=this.getFiles());try{H(this,dt)[dt].validate(t,[e])}catch(n){return n}return null}validateSingleFile(e){try{H(this,dt)[dt].validateSingleFile(e)}catch(t){return t.message}return null}validateAggregateRestrictions(e){let t=this.getFiles();try{H(this,dt)[dt].validateAggregateRestrictions(t,e)}catch(n){return n.message}return null}checkIfFileAlreadyExists(e){let{files:t}=this.getState();return!!(t[e]&&!t[e].isGhost)}addFile(e){H(this,oo)[oo](e);let{nextFilesState:t,validFilesToAdd:n,errors:r}=H(this,so)[so]([e]),o=r.filter(s=>s.isRestriction);if(H(this,Wt)[Wt](o),r.length>0)throw r[0];this.setState({files:t});let[a]=n;return this.emit("file-added",a),this.emit("files-added",n),this.log(`Added file: ${a.name}, ${a.id}, mime type: ${a.type}`),H(this,ao)[ao](),a.id}addFiles(e){H(this,oo)[oo]();let{nextFilesState:t,validFilesToAdd:n,errors:r}=H(this,so)[so](e),o=r.filter(s=>s.isRestriction);H(this,Wt)[Wt](o);let a=r.filter(s=>!s.isRestriction);if(a.length>0){let s=`Multiple errors occurred while adding files:
|
|
17
|
+
`;if(a.forEach(l=>{s+=`
|
|
18
|
+
* ${l.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:a.length}),details:s},"error",this.opts.infoTimeout),typeof AggregateError=="function")throw new AggregateError(a,s);{let l=new Error(s);throw l.errors=a,l}}this.setState({files:t}),n.forEach(s=>{this.emit("file-added",s)}),this.emit("files-added",n),n.length>5?this.log(`Added batch of ${n.length} files`):Object.values(n).forEach(s=>{this.log(`Added file: ${s.name}
|
|
19
|
+
id: ${s.id}
|
|
20
|
+
type: ${s.type}`)}),n.length>0&&H(this,ao)[ao]()}removeFiles(e){let{files:t,currentUploads:n}=this.getState(),r=v({},t),o=v({},n),a=Object.create(null);e.forEach(d=>{t[d]&&(a[d]=t[d],delete r[d])});function s(d){return a[d]===void 0}Object.keys(o).forEach(d=>{let u=n[d].fileIDs.filter(s);if(u.length===0){delete o[d];return}let{capabilities:g}=this.getState();if(u.length!==n[d].fileIDs.length&&!g.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");o[d]=D(v({},n[d]),{fileIDs:u})});let l={currentUploads:o,files:r};Object.keys(r).length===0&&(l.allowNewUpload=!0,l.error=null,l.recoveredState=null),this.setState(l),H(this,Bi)[Bi]();let c=Object.keys(a);c.forEach(d=>{this.emit("file-removed",a[d])}),c.length>5?this.log(`Removed ${c.length} files`):this.log(`Removed files: ${c.join(", ")}`)}removeFile(e){this.removeFiles([e])}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).progress.uploadComplete)return;let t=this.getFile(e),r=!(t.isPaused||!1);return this.setFileState(e,{isPaused:r}),this.emit("upload-pause",t,r),r}pauseAll(){let e=v({},this.getState().files);Object.keys(e).filter(n=>!e[n].progress.uploadComplete&&e[n].progress.uploadStarted).forEach(n=>{let r=D(v({},e[n]),{isPaused:!0});e[n]=r}),this.setState({files:e}),this.emit("pause-all")}resumeAll(){let e=v({},this.getState().files);Object.keys(e).filter(n=>!e[n].progress.uploadComplete&&e[n].progress.uploadStarted).forEach(n=>{let r=D(v({},e[n]),{isPaused:!1,error:null});e[n]=r}),this.setState({files:e}),this.emit("resume-all")}retryAll(){let e=v({},this.getState().files),t=Object.keys(e).filter(r=>e[r].error);if(t.forEach(r=>{let o=D(v({},e[r]),{isPaused:!1,error:null});e[r]=o}),this.setState({files:e,error:null}),this.emit("retry-all",Object.values(e)),t.length===0)return Promise.resolve({successful:[],failed:[]});let n=H(this,Ri)[Ri](t,{forceAllowNewUpload:!0});return H(this,Mi)[Mi](n)}cancelAll(){this.emit("cancel-all");let{files:e}=this.getState(),t=Object.keys(e);t.length&&this.removeFiles(t),this.setState(us)}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",this.getFile(e));let t=H(this,Ri)[Ri]([e],{forceAllowNewUpload:!0});return H(this,Mi)[Mi](t)}logout(){this.iteratePlugins(e=>{var t;(t=e.provider)==null||t.logout==null||t.logout()})}[Symbol.for("uppy test: updateTotalProgress")](){return H(this,lo)[lo]()}updateOnlineStatus(){var e;((e=window.navigator.onLine)!=null?e:!0)?(this.emit("is-online"),this.wasOffline&&(this.emit("back-online"),this.info(this.i18n("connectedToInternet"),"success",3e3),this.wasOffline=!1)):(this.emit("is-offline"),this.info(this.i18n("noInternetConnection"),"error",0),this.wasOffline=!0)}getID(){return this.opts.id}use(e){if(typeof e!="function"){let l=`Expected a plugin class, but got ${e===null?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`;throw new TypeError(l)}for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];let o=new e(this,...n),a=o.id;if(!a)throw new Error("Your plugin must have an id");if(!o.type)throw new Error("Your plugin must have a type");let s=this.getPlugin(a);if(s){let l=`Already found a plugin named '${s.id}'. Tried to use: '${a}'.
|
|
21
|
+
Uppy plugins must have unique \`id\` options.`;throw new Error(l)}return e.VERSION&&this.log(`Using ${a} v${e.VERSION}`),o.type in H(this,ct)[ct]?H(this,ct)[ct][o.type].push(o):H(this,ct)[ct][o.type]=[o],o.install(),this.emit("plugin-added",o),this}getPlugin(e){for(let t of Object.values(H(this,ct)[ct])){let n=t.find(r=>r.id===e);if(n!=null)return n}}[Symbol.for("uppy test: getPlugins")](e){return H(this,ct)[ct][e]}iteratePlugins(e){Object.values(H(this,ct)[ct]).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();let t=H(this,ct)[ct][e.type],n=t.findIndex(a=>a.id===e.id);n!==-1&&t.splice(n,1);let r=this.getState(),o={plugins:D(v({},r.plugins),{[e.id]:void 0})};this.setState(o)}destroy(){this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll(),H(this,ro)[ro](),this.iteratePlugins(e=>{this.removePlugin(e)}),typeof window<"u"&&window.removeEventListener&&(window.removeEventListener("online",H(this,ui)[ui]),window.removeEventListener("offline",H(this,ui)[ui]))}hideInfo(){let{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,t,n){t===void 0&&(t="info"),n===void 0&&(n=3e3);let r=typeof e=="object";this.setState({info:[...this.getState().info,{type:t,message:r?e.message:e,details:r?e.details:null}]}),setTimeout(()=>this.hideInfo(),n),this.emit("info-visible")}log(e,t){let{logger:n}=this.opts;switch(t){case"error":n.error(e);break;case"warning":n.warn(e);break;default:n.debug(e);break}}registerRequestClient(e,t){H(this,co)[co].set(e,t)}getRequestClientForFile(e){if(!e.remote)throw new Error(`Tried to get RequestClient for a non-remote file ${e.id}`);let t=H(this,co)[co].get(e.remote.requestClientId);if(t==null)throw new Error(`requestClientId "${e.remote.requestClientId}" not registered for file "${e.id}"`);return t}restore(e){return this.log(`Core: attempting to restore upload "${e}"`),this.getState().currentUploads[e]?H(this,Mi)[Mi](e):(H(this,yn)[yn](e),Promise.reject(new Error("Nonexistent upload")))}[Symbol.for("uppy test: createUpload")](){return H(this,Ri)[Ri](...arguments)}addResultData(e,t){if(!H(this,ld)[ld](e)){this.log(`Not setting result for an upload that has been removed: ${e}`);return}let{currentUploads:n}=this.getState(),r=D(v({},n[e]),{result:v(v({},n[e].result),t)});this.setState({currentUploads:D(v({},n),{[e]:r})})}upload(){var e;(e=H(this,ct)[ct].uploader)!=null&&e.length||this.log("No uploader type plugins are used","warning");let{files:t}=this.getState(),n=this.opts.onBeforeUpload(t);return n===!1?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(n&&typeof n=="object"&&(t=n,this.setState({files:t})),Promise.resolve().then(()=>H(this,dt)[dt].validateMinNumberOfFiles(t)).catch(r=>{throw H(this,Wt)[Wt]([r]),r}).then(()=>{if(!H(this,ad)[ad](t))throw new Tt(this.i18n("missingRequiredMetaField"))}).catch(r=>{throw r}).then(()=>{let{currentUploads:r}=this.getState(),o=Object.values(r).flatMap(l=>l.fileIDs),a=[];Object.keys(t).forEach(l=>{let c=this.getFile(l);!c.progress.uploadStarted&&o.indexOf(l)===-1&&a.push(c.id)});let s=H(this,Ri)[Ri](a);return H(this,Mi)[Mi](s)}).catch(r=>{throw this.emit("error",r),this.log(r,"error"),r}))}};function nP(i){for(let o of i)o.isRestriction?this.emit("restriction-failed",o.file,o):this.emit("error",o,o.file),this.log(o,"warning");let e=i.filter(o=>o.isUserFacing),t=4,n=e.slice(0,t),r=e.slice(t);n.forEach(o=>{let{message:a,details:s=""}=o;this.info({message:a,details:s},"error",this.opts.infoTimeout)}),r.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:r.length})})}function rP(i){let{missingFields:e,error:t}=H(this,dt)[dt].getMissingRequiredMetaFields(i);return e.length>0?(this.setFileState(i.id,{missingRequiredMetaFields:e}),this.log(t.message),this.emit("restriction-failed",i,t),!1):!0}function oP(i){let e=!0;for(let t of Object.values(i))H(this,uo)[uo](t)||(e=!1);return e}function aP(i){let{allowNewUpload:e}=this.getState();if(e===!1){let t=new Tt(this.i18n("noMoreFilesAllowed"),{file:i});throw H(this,Wt)[Wt]([t]),t}}function sP(i){let e=i instanceof File?{name:i.name,type:i.type,size:i.size,data:i}:i,t=to(e),n=rd(t,e),r=xi(n).extension,o=cs(e,this.getID()),a=e.meta||{};a.name=n,a.type=t;let s=Number.isFinite(e.data.size)?e.data.size:null;return{source:e.source||"",id:o,name:n,extension:r||"",meta:v(v({},this.getState().meta),a),type:t,data:e.data,progress:{percentage:0,bytesUploaded:!1,bytesTotal:s,uploadComplete:!1,uploadStarted:null},size:s,isGhost:!1,isRemote:e.isRemote||!1,remote:e.remote,preview:e.preview}}function lP(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(i=>{i.isRestriction||this.log(i.stack||i.message||i)})},4))}function cP(i){let{files:e}=this.getState(),t=v({},e),n=[],r=[];for(let s of i)try{var o;let l=H(this,cd)[cd](s),c=(o=e[l.id])==null?void 0:o.isGhost;if(c){let u=e[l.id];l=D(v({},u),{isGhost:!1,data:s.data}),this.log(`Replaced the blob in the restored ghost file: ${l.name}, ${l.id}`)}let d=this.opts.onBeforeFileAdded(l,t);if(!d&&this.checkIfFileAlreadyExists(l.id)){var a;throw new Tt(this.i18n("noDuplicates",{fileName:(a=l.name)!=null?a:this.i18n("unnamed")}),{file:s})}if(d===!1&&!c)throw new Tt("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:s});typeof d=="object"&&d!==null&&(l=d),H(this,dt)[dt].validateSingleFile(l),t[l.id]=l,n.push(l)}catch(l){r.push(l)}try{H(this,dt)[dt].validateAggregateRestrictions(Object.values(e),n)}catch(s){return r.push(s),{nextFilesState:e,validFilesToAdd:[],errors:r}}return{nextFilesState:t,validFilesToAdd:n,errors:r}}function dP(){var i,e;let t=H(this,ud)[ud](),n=null;t!=null&&(n=Math.round(t*100),n>100?n=100:n<0&&(n=0)),this.emit("progress",(i=n)!=null?i:0),this.setState({totalProgress:(e=n)!=null?e:0})}function uP(){let e=this.getFiles().filter(s=>s.progress.uploadStarted||s.progress.preprocess||s.progress.postprocess);if(e.length===0)return 0;if(e.every(s=>s.progress.uploadComplete))return 1;let t=s=>s.progress.bytesTotal!=null&&s.progress.bytesTotal!==0,n=e.filter(t),r=e.filter(s=>!t(s));if(n.every(s=>s.progress.uploadComplete)&&r.length>0&&!r.every(s=>s.progress.uploadComplete))return null;let o=n.reduce((s,l)=>{var c;return s+((c=l.progress.bytesTotal)!=null?c:0)},0),a=n.reduce((s,l)=>s+(l.progress.bytesUploaded||0),0);return o===0?0:a/o}function pP(){let i=(n,r,o)=>{let a=n.message||"Unknown error";n.details&&(a+=` ${n.details}`),this.setState({error:a}),r!=null&&r.id in this.getState().files&&this.setFileState(r.id,{error:a,response:o})};this.on("error",i),this.on("upload-error",(n,r,o)=>{if(i(r,n,o),typeof r=="object"&&r.message){var a;this.log(r.message,"error");let s=new Error(this.i18n("failedToUpload",{file:(a=n?.name)!=null?a:""}));s.isUserFacing=!0,s.details=r.message,r.details&&(s.details+=` ${r.details}`),H(this,Wt)[Wt]([s])}else H(this,Wt)[Wt]([r])});let e=null;this.on("upload-stalled",(n,r)=>{let{message:o}=n,a=r.map(s=>s.meta.name).join(", ");e||(this.info({message:o,details:a},"warning",this.opts.infoTimeout),e=setTimeout(()=>{e=null},this.opts.infoTimeout)),this.log(`${o} ${a}`.trim(),"warning")}),this.on("upload",()=>{this.setState({error:null})});let t=n=>{let r=n.filter(a=>{let s=a!=null&&this.getFile(a.id);return s||this.log(`Not setting progress for a file that has been removed: ${a?.id}`),s}),o=Object.fromEntries(r.map(a=>[a.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,bytesUploaded:0,bytesTotal:a.size}}]));this.patchFilesState(o)};this.on("upload-start",t),this.on("upload-progress",H(this,dd)[dd]),this.on("upload-success",(n,r)=>{if(n==null||!this.getFile(n.id)){this.log(`Not setting progress for a file that has been removed: ${n?.id}`);return}let o=this.getFile(n.id).progress;this.setFileState(n.id,{progress:D(v({},o),{postprocess:H(this,Ai)[Ai].size>0?{mode:"indeterminate"}:void 0,uploadComplete:!0,percentage:100,bytesUploaded:o.bytesTotal}),response:r,uploadURL:r.uploadURL,isPaused:!1}),n.size==null&&this.setFileState(n.id,{size:r.bytesUploaded||o.bytesTotal}),H(this,Bi)[Bi]()}),this.on("preprocess-progress",(n,r)=>{if(n==null||!this.getFile(n.id)){this.log(`Not setting progress for a file that has been removed: ${n?.id}`);return}this.setFileState(n.id,{progress:D(v({},this.getFile(n.id).progress),{preprocess:r})})}),this.on("preprocess-complete",n=>{if(n==null||!this.getFile(n.id)){this.log(`Not setting progress for a file that has been removed: ${n?.id}`);return}let r=v({},this.getState().files);r[n.id]=D(v({},r[n.id]),{progress:v({},r[n.id].progress)}),delete r[n.id].progress.preprocess,this.setState({files:r})}),this.on("postprocess-progress",(n,r)=>{if(n==null||!this.getFile(n.id)){this.log(`Not setting progress for a file that has been removed: ${n?.id}`);return}this.setFileState(n.id,{progress:D(v({},this.getState().files[n.id].progress),{postprocess:r})})}),this.on("postprocess-complete",n=>{if(n==null||!this.getFile(n.id)){this.log(`Not setting progress for a file that has been removed: ${n?.id}`);return}let r=v({},this.getState().files);r[n.id]=D(v({},r[n.id]),{progress:v({},r[n.id].progress)}),delete r[n.id].progress.postprocess,this.setState({files:r})}),this.on("restored",()=>{H(this,Bi)[Bi]()}),this.on("dashboard:file-edit-complete",n=>{n&&H(this,uo)[uo](n)}),typeof window<"u"&&window.addEventListener&&(window.addEventListener("online",H(this,ui)[ui]),window.addEventListener("offline",H(this,ui)[ui]),setTimeout(H(this,ui)[ui],3e3))}function hP(i,e){e===void 0&&(e={});let{forceAllowNewUpload:t=!1}=e,{allowNewUpload:n,currentUploads:r}=this.getState();if(!n&&!t)throw new Error("Cannot create a new upload: already uploading.");let o=nn();return this.emit("upload",o,this.getFilesByIds(i)),this.setState({allowNewUpload:this.opts.allowMultipleUploadBatches!==!1&&this.opts.allowMultipleUploads!==!1,currentUploads:D(v({},r),{[o]:{fileIDs:i,step:0,result:{}}})}),o}function fP(i){let{currentUploads:e}=this.getState();return e[i]}function mP(i){let e=v({},this.getState().currentUploads);delete e[i],this.setState({currentUploads:e})}function gP(i){return B(this,null,function*(){let e=()=>{let{currentUploads:o}=this.getState();return o[i]},t=e(),n=[...H(this,mn)[mn],...H(this,gn)[gn],...H(this,Ai)[Ai]];try{for(let o=t.step||0;o<n.length&&t;o++){let a=n[o];this.setState({currentUploads:D(v({},this.getState().currentUploads),{[i]:D(v({},t),{step:o})})});let{fileIDs:s}=t;yield a(s,i),t=e()}}catch(o){throw H(this,yn)[yn](i),o}if(t){t.fileIDs.forEach(l=>{let c=this.getFile(l);c&&c.progress.postprocess&&this.emit("postprocess-complete",c)});let o=t.fileIDs.map(l=>this.getFile(l)),a=o.filter(l=>!l.error),s=o.filter(l=>l.error);this.addResultData(i,{successful:a,failed:s,uploadID:i}),t=e()}let r;return t&&(r=t.result,this.emit("complete",r),H(this,yn)[yn](i)),r==null&&this.log(`Not setting result for an upload that has been removed: ${i}`),r})}ps.VERSION=iP.version;var dr=ps;var fo,Fe,ug,yP,vn,sg,pg,pd,hg,md,hd,fd,vP,ho={},fg=[],bP=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ms=Array.isArray;function Ni(i,e){for(var t in e)i[t]=e[t];return i}function gd(i){i&&i.parentNode&&i.parentNode.removeChild(i)}function p(i,e,t){var n,r,o,a={};for(o in e)o=="key"?n=e[o]:o=="ref"?r=e[o]:a[o]=e[o];if(arguments.length>2&&(a.children=arguments.length>3?fo.call(arguments,2):t),typeof i=="function"&&i.defaultProps!=null)for(o in i.defaultProps)a[o]===void 0&&(a[o]=i.defaultProps[o]);return po(i,a,n,r,null)}function po(i,e,t,n,r){var o={type:i,props:e,key:t,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++ug,__i:-1,__u:0};return r==null&&Fe.vnode!=null&&Fe.vnode(o),o}function mg(){return{current:null}}function $t(i){return i.children}function It(i,e){this.props=i,this.context=e}function ur(i,e){if(e==null)return i.__?ur(i.__,i.__i+1):null;for(var t;e<i.__k.length;e++)if((t=i.__k[e])!=null&&t.__e!=null)return t.__e;return typeof i.type=="function"?ur(i):null}function gg(i){var e,t;if((i=i.__)!=null&&i.__c!=null){for(i.__e=i.__c.base=null,e=0;e<i.__k.length;e++)if((t=i.__k[e])!=null&&t.__e!=null){i.__e=i.__c.base=t.__e;break}return gg(i)}}function lg(i){(!i.__d&&(i.__d=!0)&&vn.push(i)&&!fs.__r++||sg!==Fe.debounceRendering)&&((sg=Fe.debounceRendering)||pg)(fs)}function fs(){var i,e,t,n,r,o,a,s;for(vn.sort(pd);i=vn.shift();)i.__d&&(e=vn.length,n=void 0,o=(r=(t=i).__v).__e,a=[],s=[],t.__P&&((n=Ni({},r)).__v=r.__v+1,Fe.vnode&&Fe.vnode(n),yd(t.__P,n,r,t.__n,t.__P.namespaceURI,32&r.__u?[o]:null,a,o??ur(r),!!(32&r.__u),s),n.__v=r.__v,n.__.__k[n.__i]=n,bg(a,n,s),n.__e!=o&&gg(n)),vn.length>e&&vn.sort(pd));fs.__r=0}function yg(i,e,t,n,r,o,a,s,l,c,d){var u,g,h,_,E,N,M=n&&n.__k||fg,U=e.length;for(l=_P(t,e,M,l,U),u=0;u<U;u++)(h=t.__k[u])!=null&&(g=h.__i===-1?ho:M[h.__i]||ho,h.__i=u,N=yd(i,h,g,r,o,a,s,l,c,d),_=h.__e,h.ref&&g.ref!=h.ref&&(g.ref&&vd(g.ref,null,h),d.push(h.ref,h.__c||_,h)),E==null&&_!=null&&(E=_),4&h.__u||g.__k===h.__k?l=vg(h,l,i):typeof h.type=="function"&&N!==void 0?l=N:_&&(l=_.nextSibling),h.__u&=-7);return t.__e=E,l}function _P(i,e,t,n,r){var o,a,s,l,c,d=t.length,u=d,g=0;for(i.__k=new Array(r),o=0;o<r;o++)(a=e[o])!=null&&typeof a!="boolean"&&typeof a!="function"?(l=o+g,(a=i.__k[o]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?po(null,a,null,null,null):ms(a)?po($t,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?po(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=i,a.__b=i.__b+1,s=null,(c=a.__i=wP(a,t,l,u))!==-1&&(u--,(s=t[c])&&(s.__u|=2)),s==null||s.__v===null?(c==-1&&g--,typeof a.type!="function"&&(a.__u|=4)):c!=l&&(c==l-1?g--:c==l+1?g++:(c>l?g--:g++,a.__u|=4))):i.__k[o]=null;if(u)for(o=0;o<d;o++)(s=t[o])!=null&&!(2&s.__u)&&(s.__e==n&&(n=ur(s)),_g(s,s));return n}function vg(i,e,t){var n,r;if(typeof i.type=="function"){for(n=i.__k,r=0;n&&r<n.length;r++)n[r]&&(n[r].__=i,e=vg(n[r],e,t));return e}i.__e!=e&&(e&&i.type&&!t.contains(e)&&(e=ur(i)),t.insertBefore(i.__e,e||null),e=i.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function Ci(i,e){return e=e||[],i==null||typeof i=="boolean"||(ms(i)?i.some(function(t){Ci(t,e)}):e.push(i)),e}function wP(i,e,t,n){var r,o,a=i.key,s=i.type,l=e[t];if(l===null||l&&a==l.key&&s===l.type&&!(2&l.__u))return t;if(n>(l!=null&&!(2&l.__u)?1:0))for(r=t-1,o=t+1;r>=0||o<e.length;){if(r>=0){if((l=e[r])&&!(2&l.__u)&&a==l.key&&s===l.type)return r;r--}if(o<e.length){if((l=e[o])&&!(2&l.__u)&&a==l.key&&s===l.type)return o;o++}}return-1}function cg(i,e,t){e[0]=="-"?i.setProperty(e,t??""):i[e]=t==null?"":typeof t!="number"||bP.test(e)?t:t+"px"}function hs(i,e,t,n,r){var o;e:if(e=="style")if(typeof t=="string")i.style.cssText=t;else{if(typeof n=="string"&&(i.style.cssText=n=""),n)for(e in n)t&&e in t||cg(i.style,e,"");if(t)for(e in t)n&&t[e]===n[e]||cg(i.style,e,t[e])}else if(e[0]=="o"&&e[1]=="n")o=e!=(e=e.replace(hg,"$1")),e=e.toLowerCase()in i||e=="onFocusOut"||e=="onFocusIn"?e.toLowerCase().slice(2):e.slice(2),i.l||(i.l={}),i.l[e+o]=t,t?n?t.u=n.u:(t.u=md,i.addEventListener(e,o?fd:hd,o)):i.removeEventListener(e,o?fd:hd,o);else{if(r=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in i)try{i[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!="-"?i.removeAttribute(e):i.setAttribute(e,e=="popover"&&t==1?"":t))}}function dg(i){return function(e){if(this.l){var t=this.l[e.type+i];if(e.t==null)e.t=md++;else if(e.t<t.u)return;return t(Fe.event?Fe.event(e):e)}}}function yd(i,e,t,n,r,o,a,s,l,c){var d,u,g,h,_,E,N,M,U,de,oe,ee,b,w,S,A,L,K=e.type;if(e.constructor!==void 0)return null;128&t.__u&&(l=!!(32&t.__u),o=[s=e.__e=t.__e]),(d=Fe.__b)&&d(e);e:if(typeof K=="function")try{if(M=e.props,U="prototype"in K&&K.prototype.render,de=(d=K.contextType)&&n[d.__c],oe=d?de?de.props.value:d.__:n,t.__c?N=(u=e.__c=t.__c).__=u.__E:(U?e.__c=u=new K(M,oe):(e.__c=u=new It(M,oe),u.constructor=K,u.render=CP),de&&de.sub(u),u.props=M,u.state||(u.state={}),u.context=oe,u.__n=n,g=u.__d=!0,u.__h=[],u._sb=[]),U&&u.__s==null&&(u.__s=u.state),U&&K.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=Ni({},u.__s)),Ni(u.__s,K.getDerivedStateFromProps(M,u.__s))),h=u.props,_=u.state,u.__v=e,g)U&&K.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),U&&u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(U&&K.getDerivedStateFromProps==null&&M!==h&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(M,oe),!u.__e&&(u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(M,u.__s,oe)===!1||e.__v==t.__v)){for(e.__v!=t.__v&&(u.props=M,u.state=u.__s,u.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.some(function(ye){ye&&(ye.__=e)}),ee=0;ee<u._sb.length;ee++)u.__h.push(u._sb[ee]);u._sb=[],u.__h.length&&a.push(u);break e}u.componentWillUpdate!=null&&u.componentWillUpdate(M,u.__s,oe),U&&u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(h,_,E)})}if(u.context=oe,u.props=M,u.__P=i,u.__e=!1,b=Fe.__r,w=0,U){for(u.state=u.__s,u.__d=!1,b&&b(e),d=u.render(u.props,u.state,u.context),S=0;S<u._sb.length;S++)u.__h.push(u._sb[S]);u._sb=[]}else do u.__d=!1,b&&b(e),d=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++w<25);u.state=u.__s,u.getChildContext!=null&&(n=Ni(Ni({},n),u.getChildContext())),U&&!g&&u.getSnapshotBeforeUpdate!=null&&(E=u.getSnapshotBeforeUpdate(h,_)),s=yg(i,ms(A=d!=null&&d.type===$t&&d.key==null?d.props.children:d)?A:[A],e,t,n,r,o,a,s,l,c),u.base=e.__e,e.__u&=-161,u.__h.length&&a.push(u),N&&(u.__E=u.__=null)}catch(ye){if(e.__v=null,l||o!=null)if(ye.then){for(e.__u|=l?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;o[o.indexOf(s)]=null,e.__e=s}else for(L=o.length;L--;)gd(o[L]);else e.__e=t.__e,e.__k=t.__k;Fe.__e(ye,e,t)}else o==null&&e.__v==t.__v?(e.__k=t.__k,e.__e=t.__e):s=e.__e=xP(t.__e,e,t,n,r,o,a,l,c);return(d=Fe.diffed)&&d(e),128&e.__u?void 0:s}function bg(i,e,t){for(var n=0;n<t.length;n++)vd(t[n],t[++n],t[++n]);Fe.__c&&Fe.__c(e,i),i.some(function(r){try{i=r.__h,r.__h=[],i.some(function(o){o.call(r)})}catch(o){Fe.__e(o,r.__v)}})}function xP(i,e,t,n,r,o,a,s,l){var c,d,u,g,h,_,E,N=t.props,M=e.props,U=e.type;if(U=="svg"?r="http://www.w3.org/2000/svg":U=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),o!=null){for(c=0;c<o.length;c++)if((h=o[c])&&"setAttribute"in h==!!U&&(U?h.localName==U:h.nodeType==3)){i=h,o[c]=null;break}}if(i==null){if(U==null)return document.createTextNode(M);i=document.createElementNS(r,U,M.is&&M),s&&(Fe.__m&&Fe.__m(e,o),s=!1),o=null}if(U===null)N===M||s&&i.data===M||(i.data=M);else{if(o=o&&fo.call(i.childNodes),N=t.props||ho,!s&&o!=null)for(N={},c=0;c<i.attributes.length;c++)N[(h=i.attributes[c]).name]=h.value;for(c in N)if(h=N[c],c!="children"){if(c=="dangerouslySetInnerHTML")u=h;else if(!(c in M)){if(c=="value"&&"defaultValue"in M||c=="checked"&&"defaultChecked"in M)continue;hs(i,c,null,h,r)}}for(c in M)h=M[c],c=="children"?g=h:c=="dangerouslySetInnerHTML"?d=h:c=="value"?_=h:c=="checked"?E=h:s&&typeof h!="function"||N[c]===h||hs(i,c,h,N[c],r);if(d)s||u&&(d.__html===u.__html||d.__html===i.innerHTML)||(i.innerHTML=d.__html),e.__k=[];else if(u&&(i.innerHTML=""),yg(i,ms(g)?g:[g],e,t,n,U=="foreignObject"?"http://www.w3.org/1999/xhtml":r,o,a,o?o[0]:t.__k&&ur(t,0),s,l),o!=null)for(c=o.length;c--;)gd(o[c]);s||(c="value",U=="progress"&&_==null?i.removeAttribute("value"):_!==void 0&&(_!==i[c]||U=="progress"&&!_||U=="option"&&_!==N[c])&&hs(i,c,_,N[c],r),c="checked",E!==void 0&&E!==i[c]&&hs(i,c,E,N[c],r))}return i}function vd(i,e,t){try{if(typeof i=="function"){var n=typeof i.__u=="function";n&&i.__u(),n&&e==null||(i.__u=i(e))}else i.current=e}catch(r){Fe.__e(r,t)}}function _g(i,e,t){var n,r;if(Fe.unmount&&Fe.unmount(i),(n=i.ref)&&(n.current&&n.current!==i.__e||vd(n,null,e)),(n=i.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(o){Fe.__e(o,e)}n.base=n.__P=null}if(n=i.__k)for(r=0;r<n.length;r++)n[r]&&_g(n[r],e,t||typeof i.type!="function");t||gd(i.__e),i.__c=i.__=i.__e=void 0}function CP(i,e,t){return this.constructor(i,t)}function bd(i,e,t){var n,r,o,a;e==document&&(e=document.documentElement),Fe.__&&Fe.__(i,e),r=(n=typeof t=="function")?null:t&&t.__k||e.__k,o=[],a=[],yd(e,i=(!n&&t||e).__k=p($t,null,[i]),r||ho,ho,e.namespaceURI,!n&&t?[t]:r?null:e.firstChild?fo.call(e.childNodes):null,o,!n&&t?t:r?r.__e:e.firstChild,n,a),bg(o,i,a)}function gs(i,e,t){var n,r,o,a,s=Ni({},i.props);for(o in i.type&&i.type.defaultProps&&(a=i.type.defaultProps),e)o=="key"?n=e[o]:o=="ref"?r=e[o]:s[o]=e[o]===void 0&&a!==void 0?a[o]:e[o];return arguments.length>2&&(s.children=arguments.length>3?fo.call(arguments,2):t),po(i.type,s,n||i.key,r||i.ref,null)}fo=fg.slice,Fe={__e:function(i,e,t,n){for(var r,o,a;e=e.__;)if((r=e.__c)&&!r.__)try{if((o=r.constructor)&&o.getDerivedStateFromError!=null&&(r.setState(o.getDerivedStateFromError(i)),a=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(i,n||{}),a=r.__d),a)return r.__E=r}catch(s){i=s}throw i}},ug=0,yP=function(i){return i!=null&&i.constructor==null},It.prototype.setState=function(i,e){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Ni({},this.state),typeof i=="function"&&(i=i(Ni({},t),this.props)),i&&Ni(t,i),i!=null&&this.__v&&(e&&this._sb.push(e),lg(this))},It.prototype.forceUpdate=function(i){this.__v&&(this.__e=!0,i&&this.__h.push(i),lg(this))},It.prototype.render=$t,vn=[],pg=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,pd=function(i,e){return i.__v.__b-e.__v.__b},fs.__r=0,hg=/(PointerCapture)$|Capture$/i,md=0,hd=dg(!1),fd=dg(!0),vP=0;function mo(i){return typeof i!="object"||i===null||!("nodeType"in i)?!1:i.nodeType===Node.ELEMENT_NODE}function SP(i,e){return e===void 0&&(e=document),typeof i=="string"?e.querySelector(i):mo(i)?i:null}var wg=SP;function PP(i){for(var e;i&&!i.dir;)i=i.parentNode;return(e=i)==null?void 0:e.dir}var ys=PP;var bn=class{constructor(e,t){this.uppy=e,this.opts=t??{}}getPluginState(){let{plugins:e}=this.uppy.getState();return e?.[this.id]||{}}setPluginState(e){let{plugins:t}=this.uppy.getState();this.uppy.setState({plugins:D(v({},t),{[this.id]:v(v({},t[this.id]),e)})})}setOptions(e){this.opts=v(v({},this.opts),e),this.setPluginState(void 0),this.i18nInit()}i18nInit(){let e=new lr([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.setPluginState(void 0)}addTarget(e){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}update(e){}afterUpdate(){}};function xg(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var EP=0;function DP(i){return"__private_"+EP+++"_"+i}function kP(i){let e=null,t;return function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t=r,e||(e=Promise.resolve().then(()=>(e=null,i(...t)))),e}}var go=DP("updateUI"),_d=class i extends bn{constructor(){super(...arguments),Object.defineProperty(this,go,{writable:!0,value:void 0})}getTargetPlugin(e){let t;if(typeof e?.addTarget=="function")t=e,t instanceof i||console.warn(new Error("The provided plugin is not an instance of UIPlugin. This is an indication of a bug with the way Uppy is bundled.",{cause:{targetPlugin:t,UIPlugin:i}}));else if(typeof e=="function"){let n=e;this.uppy.iteratePlugins(r=>{r instanceof n&&(t=r)})}return t}mount(e,t){let n=t.id,r=wg(e);if(r){this.isTargetDOMEl=!0;let s=document.createElement("div");return s.classList.add("uppy-Root"),xg(this,go)[go]=kP(l=>{this.uppy.getPlugin(this.id)&&(bd(this.render(l,s),s),this.afterUpdate())}),this.uppy.log(`Installing ${n} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(r.innerHTML=""),bd(this.render(this.uppy.getState(),s),s),this.el=s,r.appendChild(s),s.dir=this.opts.direction||ys(s)||"ltr",this.onMount(),this.el}let o=this.getTargetPlugin(e);if(o)return this.uppy.log(`Installing ${n} to ${o.id}`),this.parent=o,this.el=o.addTarget(t),this.onMount(),this.el;this.uppy.log(`Not installing ${n}`);let a=`Invalid target option given to ${n}.`;throw typeof e=="function"?a+=" The given target is not a Plugin class. Please check that you're not specifying a React Component instead of a plugin. If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly.":a+="If you meant to target an HTML element, please make sure that the element exists. Check that the <script> tag initializing Uppy is right before the closing </body> tag at the end of the page. (see https://github.com/transloadit/uppy/issues/1042)\n\nIf you meant to target a plugin, please confirm that your `import` statements or `require` calls are correct.",new Error(a)}render(e,t){throw new Error("Extend the render method to add your plugin to a DOM element")}update(e){if(this.el!=null){var t,n;(t=(n=xg(this,go))[go])==null||t.call(n,e)}}unmount(){if(this.isTargetDOMEl){var e;(e=this.el)==null||e.remove()}this.onUnmount()}onMount(){}onUnmount(){}},qt=_d;function vs(i,e,t,n){return t===0||i===e?i:n===0?e:i+(e-i)*2**(-n/t)}var Gt={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete"};var Dd=De(yt(),1);function yo(i){let e=[],t="indeterminate",n;for(let{progress:o}of Object.values(i)){let{preprocess:a,postprocess:s}=o;n==null&&(a||s)&&({mode:t,message:n}=a||s),a?.mode==="determinate"&&e.push(a.value),s?.mode==="determinate"&&e.push(s.value)}let r=e.reduce((o,a)=>o+a/e.length,0);return{mode:t,message:n,value:r}}var Sd=De(yt(),1),Cd=De(io(),1);function wd(i){let e=Math.floor(i/3600)%24,t=Math.floor(i/60)%60,n=Math.floor(i%60);return{hours:e,minutes:t,seconds:n}}function xd(i){let e=wd(i),t=e.hours===0?"":`${e.hours}h`,n=e.minutes===0?"":`${e.hours===0?e.minutes:` ${e.minutes.toString(10).padStart(2,"0")}`}m`,r=e.hours!==0?"":`${e.minutes===0?e.seconds:` ${e.seconds.toString(10).padStart(2,"0")}`}s`;return`${t}${n}${r}`}var TP="\xB7",Cg=()=>` ${TP} `;function Sg(i){let{newFiles:e,isUploadStarted:t,recoveredState:n,i18n:r,uploadState:o,isSomeGhost:a,startUpload:s}=i,l=(0,Sd.default)("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--upload",{"uppy-c-btn-primary":o===Gt.STATE_WAITING},{"uppy-StatusBar-actionBtn--disabled":a}),c=e&&t&&!n?r("uploadXNewFiles",{smart_count:e}):r("uploadXFiles",{smart_count:e});return p("button",{type:"button",className:l,"aria-label":r("uploadXFiles",{smart_count:e}),onClick:s,disabled:a,"data-uppy-super-focusable":!0},c)}function Pg(i){let{i18n:e,uppy:t}=i;return p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--retry","aria-label":e("retryUpload"),onClick:()=>t.retryAll().catch(()=>{}),"data-uppy-super-focusable":!0,"data-cy":"retry"},p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"8",height:"10",viewBox:"0 0 8 10"},p("path",{d:"M4 2.408a2.75 2.75 0 1 0 2.75 2.75.626.626 0 0 1 1.25.018v.023a4 4 0 1 1-4-4.041V.25a.25.25 0 0 1 .389-.208l2.299 1.533a.25.25 0 0 1 0 .416l-2.3 1.533A.25.25 0 0 1 4 3.316v-.908z"})),e("retry"))}function Eg(i){let{i18n:e,uppy:t}=i;return p("button",{type:"button",className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",title:e("cancel"),"aria-label":e("cancel"),onClick:()=>t.cancelAll(),"data-cy":"cancel","data-uppy-super-focusable":!0},p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},p("g",{fill:"none",fillRule:"evenodd"},p("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),p("path",{fill:"#FFF",d:"M9.283 8l2.567 2.567-1.283 1.283L8 9.283 5.433 11.85 4.15 10.567 6.717 8 4.15 5.433 5.433 4.15 8 6.717l2.567-2.567 1.283 1.283z"}))))}function Dg(i){let{isAllPaused:e,i18n:t,isAllComplete:n,resumableUploads:r,uppy:o}=i,a=t(e?"resume":"pause");function s(){if(!n){if(!r){o.cancelAll();return}if(e){o.resumeAll();return}o.pauseAll()}}return p("button",{title:a,"aria-label":a,className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",type:"button",onClick:s,"data-cy":"togglePauseResume","data-uppy-super-focusable":!0},p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},p("g",{fill:"none",fillRule:"evenodd"},p("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),p("path",{fill:"#FFF",d:e?"M6 4.25L11.5 8 6 11.75z":"M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z"}))))}function kg(i){let{i18n:e,doneButtonHandler:t}=i;return p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--done",onClick:t,"data-uppy-super-focusable":!0},e("done"))}function Tg(){return p("svg",{className:"uppy-StatusBar-spinner","aria-hidden":"true",focusable:"false",width:"14",height:"14"},p("path",{d:"M13.983 6.547c-.12-2.509-1.64-4.893-3.939-5.936-2.48-1.127-5.488-.656-7.556 1.094C.524 3.367-.398 6.048.162 8.562c.556 2.495 2.46 4.52 4.94 5.183 2.932.784 5.61-.602 7.256-3.015-1.493 1.993-3.745 3.309-6.298 2.868-2.514-.434-4.578-2.349-5.153-4.84a6.226 6.226 0 0 1 2.98-6.778C6.34.586 9.74 1.1 11.373 3.493c.407.596.693 1.282.842 1.988.127.598.073 1.197.161 1.794.078.525.543 1.257 1.15.864.525-.341.49-1.05.456-1.592-.007-.15.02.3 0 0",fillRule:"evenodd"}))}function Ig(i){let{progress:e}=i,{value:t,mode:n,message:r}=e;return p("div",{className:"uppy-StatusBar-content"},p(Tg,null),n==="determinate"?`${Math.round(t*100)}% \xB7 `:"",r)}function IP(i){let{numUploads:e,complete:t,totalUploadedSize:n,totalSize:r,totalETA:o,i18n:a}=i,s=e>1,l=(0,Cd.default)(n);return p("div",{className:"uppy-StatusBar-statusSecondary"},s&&a("filesUploadedOfTotal",{complete:t,smart_count:e}),p("span",{className:"uppy-StatusBar-additionalInfo"},s&&Cg(),r!=null?a("dataUploadedOfTotal",{complete:l,total:(0,Cd.default)(r)}):a("dataUploadedOfUnknown",{complete:l}),Cg(),o!=null&&a("xTimeLeft",{time:xd(o)})))}function Og(i){let{i18n:e,complete:t,numUploads:n}=i;return p("div",{className:"uppy-StatusBar-statusSecondary"},e("filesUploadedOfTotal",{complete:t,smart_count:n}))}function OP(i){let{i18n:e,newFiles:t,startUpload:n}=i,r=(0,Sd.default)("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--uploadNewlyAdded");return p("div",{className:"uppy-StatusBar-statusSecondary"},p("div",{className:"uppy-StatusBar-statusSecondaryHint"},e("xMoreFilesAdded",{smart_count:t})),p("button",{type:"button",className:r,"aria-label":e("uploadXFiles",{smart_count:t}),onClick:n},e("upload")))}function Fg(i){let{i18n:e,supportsUploadProgress:t,totalProgress:n,showProgressDetails:r,isUploadStarted:o,isAllComplete:a,isAllPaused:s,newFiles:l,numUploads:c,complete:d,totalUploadedSize:u,totalSize:g,totalETA:h,startUpload:_}=i,E=l&&o;if(!o||a)return null;let N=e(s?"paused":"uploading");function M(){return!s&&!E&&r?t?p(IP,{numUploads:c,complete:d,totalUploadedSize:u,totalSize:g,totalETA:h,i18n:e}):p(Og,{i18n:e,complete:d,numUploads:c}):null}return p("div",{className:"uppy-StatusBar-content","aria-label":N,title:N},s?null:p(Tg,null),p("div",{className:"uppy-StatusBar-status"},p("div",{className:"uppy-StatusBar-statusPrimary"},t&&n!==0?`${N}: ${n}%`:N),M(),E?p(OP,{i18n:e,newFiles:l,startUpload:_}):null))}function Rg(i){let{i18n:e}=i;return p("div",{className:"uppy-StatusBar-content",role:"status",title:e("complete")},p("div",{className:"uppy-StatusBar-status"},p("div",{className:"uppy-StatusBar-statusPrimary"},p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"15",height:"11",viewBox:"0 0 15 11"},p("path",{d:"M.414 5.843L1.627 4.63l3.472 3.472L13.202 0l1.212 1.213L5.1 10.528z"})),e("complete"))))}function Mg(i){let{error:e,i18n:t,complete:n,numUploads:r}=i;function o(){let a=`${t("uploadFailed")}
|
|
22
|
+
|
|
23
|
+
${e}`;alert(a)}return p("div",{className:"uppy-StatusBar-content",title:t("uploadFailed")},p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"11",height:"11",viewBox:"0 0 11 11"},p("path",{d:"M4.278 5.5L0 1.222 1.222 0 5.5 4.278 9.778 0 11 1.222 6.722 5.5 11 9.778 9.778 11 5.5 6.722 1.222 11 0 9.778z"})),p("div",{className:"uppy-StatusBar-status"},p("div",{className:"uppy-StatusBar-statusPrimary"},t("uploadFailed"),p("button",{className:"uppy-u-reset uppy-StatusBar-details","aria-label":t("showErrorDetails"),"data-microtip-position":"top-right","data-microtip-size":"medium",onClick:o,type:"button"},"?")),p(Og,{i18n:t,complete:n,numUploads:r})))}var{STATE_ERROR:Ag,STATE_WAITING:FP,STATE_PREPROCESSING:Pd,STATE_UPLOADING:_s,STATE_POSTPROCESSING:Ed,STATE_COMPLETE:ws}=Gt;function kd(i){let{newFiles:e,allowNewUpload:t,isUploadInProgress:n,isAllPaused:r,resumableUploads:o,error:a,hideUploadButton:s=void 0,hidePauseResumeButton:l=!1,hideCancelButton:c=!1,hideRetryButton:d=!1,recoveredState:u,uploadState:g,totalProgress:h,files:_,supportsUploadProgress:E,hideAfterFinish:N=!1,isSomeGhost:M,doneButtonHandler:U=void 0,isUploadStarted:de,i18n:oe,startUpload:ee,uppy:b,isAllComplete:w,showProgressDetails:S=void 0,numUploads:A,complete:L,totalSize:K,totalETA:ye,totalUploadedSize:Ne}=i;function Pe(){switch(g){case Ed:case Pd:{let G=yo(_);return G.mode==="determinate"?G.value*100:h}case Ag:return null;case _s:return E?h:null;default:return h}}function Se(){switch(g){case Ed:case Pd:{let{mode:G}=yo(_);return G==="indeterminate"}case _s:return!E;default:return!1}}let Q=Pe(),ze=Q??100,te=!a&&e&&(!n&&!r||u)&&t&&!s,Rt=!c&&g!==FP&&g!==ws,he=o&&!l&&g===_s,X=a&&!w&&!d,F=U&&g===ws,C=(0,Dd.default)("uppy-StatusBar-progress",{"is-indeterminate":Se()}),k=(0,Dd.default)("uppy-StatusBar",`is-${g}`,{"has-ghosts":M}),T=(()=>{switch(g){case Pd:case Ed:return p(Ig,{progress:yo(_)});case ws:return p(Rg,{i18n:oe});case Ag:return p(Mg,{error:a,i18n:oe,numUploads:A,complete:L});case _s:return p(Fg,{i18n:oe,supportsUploadProgress:E,totalProgress:h,showProgressDetails:S,isUploadStarted:de,isAllComplete:w,isAllPaused:r,newFiles:e,numUploads:A,complete:L,totalUploadedSize:Ne,totalSize:K,totalETA:ye,startUpload:ee});default:return null}})();return p("div",{className:k,"aria-hidden":!(te||X||he||Rt||F)&&!T||g===ws&&N},p("div",{className:C,style:{width:`${ze}%`},role:"progressbar","aria-label":`${ze}%`,"aria-valuetext":`${ze}%`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Q}),T,p("div",{className:"uppy-StatusBar-actions"},te?p(Sg,{newFiles:e,isUploadStarted:de,recoveredState:u,i18n:oe,isSomeGhost:M,startUpload:ee,uploadState:g}):null,X?p(Pg,{i18n:oe,uppy:b}):null,he?p(Dg,{isAllPaused:r,i18n:oe,isAllComplete:w,resumableUploads:o,uppy:b}):null,Rt?p(Eg,{i18n:oe,uppy:b}):null,F?p(kg,{i18n:oe,doneButtonHandler:U}):null))}var Bg={strings:{uploading:"Uploading",complete:"Complete",uploadFailed:"Upload failed",paused:"Paused",retry:"Retry",cancel:"Cancel",pause:"Pause",resume:"Resume",done:"Done",filesUploadedOfTotal:{0:"%{complete} of %{smart_count} file uploaded",1:"%{complete} of %{smart_count} files uploaded"},dataUploadedOfTotal:"%{complete} of %{total}",dataUploadedOfUnknown:"%{complete} of unknown",xTimeLeft:"%{time} left",uploadXFiles:{0:"Upload %{smart_count} file",1:"Upload %{smart_count} files"},uploadXNewFiles:{0:"Upload +%{smart_count} file",1:"Upload +%{smart_count} files"},upload:"Upload",retryUpload:"Retry upload",xMoreFilesAdded:{0:"%{smart_count} more file added",1:"%{smart_count} more files added"},showErrorDetails:"Show error details"}};function Be(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var RP=0;function pr(i){return"__private_"+RP+++"_"+i}var MP={version:"4.1.1"},AP=2e3,BP=2e3;function NP(i,e,t,n){if(i)return Gt.STATE_ERROR;if(e)return Gt.STATE_COMPLETE;if(t)return Gt.STATE_WAITING;let r=Gt.STATE_WAITING,o=Object.keys(n);for(let a=0;a<o.length;a++){let{progress:s}=n[o[a]];if(s.uploadStarted&&!s.uploadComplete)return Gt.STATE_UPLOADING;s.preprocess&&(r=Gt.STATE_PREPROCESSING),s.postprocess&&r!==Gt.STATE_PREPROCESSING&&(r=Gt.STATE_POSTPROCESSING)}return r}var zP={hideUploadButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideCancelButton:!1,showProgressDetails:!1,hideAfterFinish:!0,doneButtonHandler:null},li=pr("lastUpdateTime"),pi=pr("previousUploadedBytes"),zi=pr("previousSpeed"),Xt=pr("previousETA"),Td=pr("computeSmoothETA"),vo=pr("onUploadStart"),_n=class extends qt{constructor(e,t){super(e,v(v({},zP),t)),Object.defineProperty(this,Td,{value:LP}),Object.defineProperty(this,li,{writable:!0,value:void 0}),Object.defineProperty(this,pi,{writable:!0,value:void 0}),Object.defineProperty(this,zi,{writable:!0,value:void 0}),Object.defineProperty(this,Xt,{writable:!0,value:void 0}),this.startUpload=()=>this.uppy.upload().catch(()=>{}),Object.defineProperty(this,vo,{writable:!0,value:()=>{let{recoveredState:n}=this.uppy.getState();if(Be(this,zi)[zi]=null,Be(this,Xt)[Xt]=null,n){Be(this,pi)[pi]=Object.values(n.files).reduce((r,o)=>{let{progress:a}=o;return r+a.bytesUploaded},0),this.uppy.emit("restore-confirmed");return}Be(this,li)[li]=performance.now(),Be(this,pi)[pi]=0}}),this.id=this.opts.id||"StatusBar",this.title="StatusBar",this.type="progressindicator",this.defaultLocale=Bg,this.i18nInit(),this.render=this.render.bind(this),this.install=this.install.bind(this)}render(e){let{capabilities:t,files:n,allowNewUpload:r,totalProgress:o,error:a,recoveredState:s}=e,{newFiles:l,startedFiles:c,completeFiles:d,isUploadStarted:u,isAllComplete:g,isAllPaused:h,isUploadInProgress:_,isSomeGhost:E}=this.uppy.getObjectOfFilesPerState(),N=s?Object.values(n):l,M=!!t.resumableUploads,U=t.uploadProgress!==!1,de=null,oe=0;c.every(b=>b.progress.bytesTotal!=null&&b.progress.bytesTotal!==0)?(de=0,c.forEach(b=>{de+=b.progress.bytesTotal||0,oe+=b.progress.bytesUploaded||0})):c.forEach(b=>{oe+=b.progress.bytesUploaded||0});let ee=Be(this,Td)[Td]({uploaded:oe,total:de});return kd({error:a,uploadState:NP(a,g,s,e.files||{}),allowNewUpload:r,totalProgress:o,totalSize:de,totalUploadedSize:oe,isAllComplete:!1,isAllPaused:h,isUploadStarted:u,isUploadInProgress:_,isSomeGhost:E,recoveredState:s,complete:d.length,newFiles:N.length,numUploads:c.length,totalETA:ee,files:n,i18n:this.i18n,uppy:this.uppy,startUpload:this.startUpload,doneButtonHandler:this.opts.doneButtonHandler,resumableUploads:M,supportsUploadProgress:U,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;ys(e)||(e.dir="ltr")}install(){let{target:e}=this.opts;e&&this.mount(e,this),this.uppy.on("upload",Be(this,vo)[vo]),Be(this,li)[li]=performance.now(),Be(this,pi)[pi]=this.uppy.getFiles().reduce((t,n)=>t+n.progress.bytesUploaded,0)}uninstall(){this.unmount(),this.uppy.off("upload",Be(this,vo)[vo])}};function LP(i){var e,t;if(i.total==null||i.total===0)return null;let n=i.total-i.uploaded;if(n<=0)return null;(t=(e=Be(this,li))[li])!=null||(e[li]=performance.now());let r=performance.now()-Be(this,li)[li];if(r===0){var o;return Math.round(((o=Be(this,Xt)[Xt])!=null?o:0)/100)/10}let a=i.uploaded-Be(this,pi)[pi];if(Be(this,pi)[pi]=i.uploaded,a<=0){var s;return Math.round(((s=Be(this,Xt)[Xt])!=null?s:0)/100)/10}let l=a/r,c=Be(this,zi)[zi]==null?l:vs(l,Be(this,zi)[zi],AP,r);Be(this,zi)[zi]=c;let d=n/c,u=Math.max(Be(this,Xt)[Xt]-r,0),g=Be(this,Xt)[Xt]==null?d:vs(d,u,BP,r);return Be(this,Xt)[Xt]=g,Be(this,li)[li]=performance.now(),Math.round(g/100)/10}_n.VERSION=MP.version;var Ng=300,xs=class extends It{constructor(){super(...arguments),this.ref=mg()}componentWillEnter(e){this.ref.current.style.opacity="1",this.ref.current.style.transform="none",setTimeout(e,Ng)}componentWillLeave(e){this.ref.current.style.opacity="0",this.ref.current.style.transform="translateY(350%)",setTimeout(e,Ng)}render(){let{children:e}=this.props;return p("div",{className:"uppy-Informer-animated",ref:this.ref},e)}};function HP(i,e){return Object.assign(i,e)}function jP(i,e){var t;return(t=i?.key)!=null?t:e}function VP(i,e){let t=i._ptgLinkedRefs||(i._ptgLinkedRefs={});return t[e]||(t[e]=n=>{i.refs[e]=n})}function bo(i){let e={};for(let t=0;t<i.length;t++)if(i[t]!=null){let n=jP(i[t],t.toString(36));e[n]=i[t]}return e}function UP(i,e){i=i||{},e=e||{};let t=a=>e.hasOwnProperty(a)?e[a]:i[a],n={},r=[];for(let a in i)e.hasOwnProperty(a)?r.length&&(n[a]=r,r=[]):r.push(a);let o={};for(let a in e){if(n.hasOwnProperty(a))for(let s=0;s<n[a].length;s++){let l=n[a][s];o[n[a][s]]=t(l)}o[a]=t(a)}for(let a=0;a<r.length;a++)o[r[a]]=t(r[a]);return o}var WP=i=>i,$P=(()=>{class i extends It{constructor(t,n){super(t,n),this.refs={},this.state={children:bo(Ci(Ci(this.props.children))||[])},this.performAppear=this.performAppear.bind(this),this.performEnter=this.performEnter.bind(this),this.performLeave=this.performLeave.bind(this)}componentWillMount(){this.currentlyTransitioningKeys={},this.keysToAbortLeave=[],this.keysToEnter=[],this.keysToLeave=[]}componentDidMount(){let t=this.state.children;for(let n in t)t[n]&&this.performAppear(n)}componentWillReceiveProps(t){let n=bo(Ci(t.children)||[]),r=this.state.children;this.setState(a=>({children:UP(a.children,n)}));let o;for(o in n)if(n.hasOwnProperty(o)){let a=r&&r.hasOwnProperty(o);n[o]&&a&&this.currentlyTransitioningKeys[o]?(this.keysToEnter.push(o),this.keysToAbortLeave.push(o)):n[o]&&!a&&!this.currentlyTransitioningKeys[o]&&this.keysToEnter.push(o)}for(o in r)if(r.hasOwnProperty(o)){let a=n&&n.hasOwnProperty(o);r[o]&&!a&&!this.currentlyTransitioningKeys[o]&&this.keysToLeave.push(o)}}componentDidUpdate(){let{keysToEnter:t}=this;this.keysToEnter=[],t.forEach(this.performEnter);let{keysToLeave:n}=this;this.keysToLeave=[],n.forEach(this.performLeave)}_finishAbort(t){let n=this.keysToAbortLeave.indexOf(t);n!==-1&&this.keysToAbortLeave.splice(n,1)}performAppear(t){this.currentlyTransitioningKeys[t]=!0;let n=this.refs[t];n!=null&&n.componentWillAppear?n.componentWillAppear(this._handleDoneAppearing.bind(this,t)):this._handleDoneAppearing(t)}_handleDoneAppearing(t){let n=this.refs[t];n!=null&&n.componentDidAppear&&n.componentDidAppear(),delete this.currentlyTransitioningKeys[t],this._finishAbort(t);let r=bo(Ci(this.props.children)||[]);(!r||!r.hasOwnProperty(t))&&this.performLeave(t)}performEnter(t){this.currentlyTransitioningKeys[t]=!0;let n=this.refs[t];n!=null&&n.componentWillEnter?n.componentWillEnter(this._handleDoneEntering.bind(this,t)):this._handleDoneEntering(t)}_handleDoneEntering(t){let n=this.refs[t];n!=null&&n.componentDidEnter&&n.componentDidEnter(),delete this.currentlyTransitioningKeys[t],this._finishAbort(t);let r=bo(Ci(this.props.children)||[]);(!r||!r.hasOwnProperty(t))&&this.performLeave(t)}performLeave(t){if(this.keysToAbortLeave.indexOf(t)!==-1)return;this.currentlyTransitioningKeys[t]=!0;let r=this.refs[t];r!=null&&r.componentWillLeave?r.componentWillLeave(this._handleDoneLeaving.bind(this,t)):this._handleDoneLeaving(t)}_handleDoneLeaving(t){if(this.keysToAbortLeave.indexOf(t)!==-1)return;let r=this.refs[t];r!=null&&r.componentDidLeave&&r.componentDidLeave(),delete this.currentlyTransitioningKeys[t];let o=bo(Ci(this.props.children)||[]);if(o&&o.hasOwnProperty(t))this.performEnter(t);else{let a=HP({},this.state.children);delete a[t],this.setState({children:a})}}render(t,n){let N=t,{childFactory:r,transitionLeave:o,transitionName:a,transitionAppear:s,transitionEnter:l,transitionLeaveTimeout:c,transitionEnterTimeout:d,transitionAppearTimeout:u,component:g}=N,h=Ln(N,["childFactory","transitionLeave","transitionName","transitionAppear","transitionEnter","transitionLeaveTimeout","transitionEnterTimeout","transitionAppearTimeout","component"]),{children:_}=n,E=Object.entries(_).map(M=>{let[U,de]=M;if(!de)return;let oe=VP(this,U);return gs(r(de),{ref:oe,key:U})}).filter(Boolean);return p(g,h,E)}}return i.defaultProps={component:"span",childFactory:WP},i})(),zg=$P;var qP={version:"4.2.1"},wn=class extends qt{constructor(e,t){super(e,t),this.render=n=>p("div",{className:"uppy uppy-Informer"},p(zg,null,n.info.map(r=>p(xs,{key:r.message},p("p",{role:"alert"},r.message," ",r.details&&p("span",{"aria-label":r.details,"data-microtip-position":"top-left","data-microtip-size":"medium",role:"tooltip",onClick:()=>alert(`${r.message}
|
|
24
|
+
|
|
25
|
+
${r.details}`)},"?")))))),this.type="progressindicator",this.id=this.opts.id||"Informer",this.title="Informer"}install(){let{target:e}=this.opts;e&&this.mount(e,this)}};wn.VERSION=qP.version;var GP=/^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/;function XP(i,e,t){var n,r;let o=GP.exec(i),a=(n=(r=e.mimeType)!=null?r:o?.[1])!=null?n:"plain/text",s;if(o?.[2]!=null){let l=atob(decodeURIComponent(o[3])),c=new Uint8Array(l.length);for(let d=0;d<l.length;d++)c[d]=l.charCodeAt(d);s=[c]}else o?.[3]!=null&&(s=[decodeURIComponent(o[3])]);return t?new File(s,e.name||"",{type:a}):new Blob(s,{type:a})}var Lg=XP;function Cs(i){return i.startsWith("blob:")}function Ss(i){return i?/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(i):!1}function Ee(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}var Xg=typeof self<"u"?self:global,Co=typeof navigator<"u",YP=Co&&typeof HTMLImageElement>"u",Hg=!(typeof global>"u"||typeof process>"u"||!process.versions||!process.versions.node),Yg=Xg.Buffer,Kg=!!Yg,KP=i=>i!==void 0;function Qg(i){return i===void 0||(i instanceof Map?i.size===0:Object.values(i).filter(KP).length===0)}function ot(i){let e=new Error(i);throw delete e.stack,e}function jg(i){let e=function(t){let n=0;return t.ifd0.enabled&&(n+=1024),t.exif.enabled&&(n+=2048),t.makerNote&&(n+=2048),t.userComment&&(n+=1024),t.gps.enabled&&(n+=512),t.interop.enabled&&(n+=100),t.ifd1.enabled&&(n+=1024),n+2048}(i);return i.jfif.enabled&&(e+=50),i.xmp.enabled&&(e+=2e4),i.iptc.enabled&&(e+=14e3),i.icc.enabled&&(e+=6e3),e}var Id=i=>String.fromCharCode.apply(null,i),Vg=typeof TextDecoder<"u"?new TextDecoder("utf-8"):void 0,Cn=class i{static from(e,t){return e instanceof this&&e.le===t?e:new i(e,void 0,void 0,t)}constructor(e,t=0,n,r){if(typeof r=="boolean"&&(this.le=r),Array.isArray(e)&&(e=new Uint8Array(e)),e===0)this.byteOffset=0,this.byteLength=0;else if(e instanceof ArrayBuffer){n===void 0&&(n=e.byteLength-t);let o=new DataView(e,t,n);this._swapDataView(o)}else if(e instanceof Uint8Array||e instanceof DataView||e instanceof i){n===void 0&&(n=e.byteLength-t),(t+=e.byteOffset)+n>e.byteOffset+e.byteLength&&ot("Creating view outside of available memory in ArrayBuffer");let o=new DataView(e.buffer,t,n);this._swapDataView(o)}else if(typeof e=="number"){let o=new DataView(new ArrayBuffer(e));this._swapDataView(o)}else ot("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,n=i){return e instanceof DataView||e instanceof i?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Uint8Array||ot("BufferView.set(): Invalid data argument."),this.toUint8().set(e,t),new n(this,t,e.byteLength)}subarray(e,t){return t=t||this._lengthToEnd(e),new i(this,e,t)}toUint8(){return new Uint8Array(this.buffer,this.byteOffset,this.byteLength)}getUint8Array(e,t){return new Uint8Array(this.buffer,this.byteOffset+e,t)}getString(e=0,t=this.byteLength){return r=this.getUint8Array(e,t),Vg?Vg.decode(r):Kg?Buffer.from(r).toString("utf8"):decodeURIComponent(escape(Id(r)));var r}getLatin1String(e=0,t=this.byteLength){let n=this.getUint8Array(e,t);return Id(n)}getUnicodeString(e=0,t=this.byteLength){let n=[];for(let r=0;r<t&&e+r<this.byteLength;r+=2)n.push(this.getUint16(e+r));return Id(n)}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,n){switch(t){case 1:return this.getUint8(e,n);case 2:return this.getUint16(e,n);case 4:return this.getUint32(e,n);case 8:return this.getUint64&&this.getUint64(e,n)}}getUint(e,t,n){switch(t){case 8:return this.getUint8(e,n);case 16:return this.getUint16(e,n);case 32:return this.getUint32(e,n);case 64:return this.getUint64&&this.getUint64(e,n)}}toString(e){return this.dataView.toString(e,this.constructor.name)}ensureChunk(){}};function Fd(i,e){ot(`${i} '${e}' was not loaded, try using full build of exifr.`)}var So=class extends Map{constructor(e){super(),this.kind=e}get(e,t){return this.has(e)||Fd(this.kind,e),t&&(e in t||function(n,r){ot(`Unknown ${n} '${r}'.`)}(this.kind,e),t[e].enabled||Fd(this.kind,e)),super.get(e)}keyList(){return Array.from(this.keys())}},Ts=new So("file parser"),Yt=new So("segment parser"),Do=new So("file reader"),QP=Xg.fetch;function Ug(i,e){return(t=i).startsWith("data:")||t.length>1e4?Md(i,e,"base64"):Hg&&i.includes("://")?Rd(i,e,"url",Ps):Hg?Md(i,e,"fs"):Co?Rd(i,e,"url",Ps):void ot("Invalid input argument");var t}function Rd(i,e,t,n){return B(this,null,function*(){return Do.has(t)?Md(i,e,t):n?function(r,o){return B(this,null,function*(){let a=yield o(r);return new Cn(a)})}(i,n):void ot(`Parser ${t} is not loaded`)})}function Md(i,e,t){return B(this,null,function*(){let n=new(Do.get(t))(i,e);return yield n.read(),n})}var Ps=i=>QP(i).then(e=>e.arrayBuffer()),Po=i=>new Promise((e,t)=>{let n=new FileReader;n.onloadend=()=>e(n.result||new ArrayBuffer),n.onerror=t,n.readAsArrayBuffer(i)}),Ad=class extends Map{get tagKeys(){return this.allKeys||(this.allKeys=Array.from(this.keys())),this.allKeys}get tagValues(){return this.allValues||(this.allValues=Array.from(this.values())),this.allValues}};function Zg(i,e,t){let n=new Ad;for(let[r,o]of t)n.set(r,o);if(Array.isArray(e))for(let r of e)i.set(r,n);else i.set(e,n);return n}function Jg(i,e,t){let n,r=i.get(e);for(n of t)r.set(n[0],n[1])}var ko=new Map,Hd=new Map,jd=new Map,hr=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],Is=["jfif","xmp","icc","iptc","ihdr"],Eo=["tiff",...Is],Ke=["ifd0","ifd1","exif","gps","interop"],fr=[...Eo,...Ke],mr=["makerNote","userComment"],Os=["translateKeys","translateValues","reviveValues","multiSegment"],gr=[...Os,"sanitize","mergeOutput","silentErrors"],Es=class{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}},xn=class extends Es{get needed(){return this.enabled||this.deps.size>0}constructor(e,t,n,r){if(super(),Ee(this,"enabled",!1),Ee(this,"skip",new Set),Ee(this,"pick",new Set),Ee(this,"deps",new Set),Ee(this,"translateKeys",!1),Ee(this,"translateValues",!1),Ee(this,"reviveValues",!1),this.key=e,this.enabled=t,this.parse=this.enabled,this.applyInheritables(r),this.canBeFiltered=Ke.includes(e),this.canBeFiltered&&(this.dict=ko.get(e)),n!==void 0)if(Array.isArray(n))this.parse=this.enabled=!0,this.canBeFiltered&&n.length>0&&this.translateTagSet(n,this.pick);else if(typeof n=="object"){if(this.enabled=!0,this.parse=n.parse!==!1,this.canBeFiltered){let{pick:o,skip:a}=n;o&&o.length>0&&this.translateTagSet(o,this.pick),a&&a.length>0&&this.translateTagSet(a,this.skip)}this.applyInheritables(n)}else n===!0||n===!1?this.parse=this.enabled=n:ot(`Invalid options argument: ${n}`)}applyInheritables(e){let t,n;for(t of Os)n=e[t],n!==void 0&&(this[t]=n)}translateTagSet(e,t){if(this.dict){let n,r,{tagKeys:o,tagValues:a}=this.dict;for(n of e)typeof n=="string"?(r=a.indexOf(n),r===-1&&(r=o.indexOf(Number(n))),r!==-1&&t.add(Number(o[r]))):t.add(n)}else for(let n of e)t.add(n)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,Ds(this.pick,this.deps)):this.enabled&&this.pick.size>0&&Ds(this.pick,this.deps)}},vt={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},Wg=new Map,Sn=class extends Es{static useCached(e){let t=Wg.get(e);return t!==void 0||(t=new this(e),Wg.set(e,t)),t}constructor(e){super(),e===!0?this.setupFromTrue():e===void 0?this.setupFromUndefined():Array.isArray(e)?this.setupFromArray(e):typeof e=="object"?this.setupFromObject(e):ot(`Invalid options argument ${e}`),this.firstChunkSize===void 0&&(this.firstChunkSize=Co?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let e;for(e of hr)this[e]=vt[e];for(e of gr)this[e]=vt[e];for(e of mr)this[e]=vt[e];for(e of fr)this[e]=new xn(e,vt[e],void 0,this)}setupFromTrue(){let e;for(e of hr)this[e]=vt[e];for(e of gr)this[e]=vt[e];for(e of mr)this[e]=!0;for(e of fr)this[e]=new xn(e,!0,void 0,this)}setupFromArray(e){let t;for(t of hr)this[t]=vt[t];for(t of gr)this[t]=vt[t];for(t of mr)this[t]=vt[t];for(t of fr)this[t]=new xn(t,!1,void 0,this);this.setupGlobalFilters(e,void 0,Ke)}setupFromObject(e){let t;for(t of(Ke.ifd0=Ke.ifd0||Ke.image,Ke.ifd1=Ke.ifd1||Ke.thumbnail,Object.assign(this,e),hr))this[t]=Od(e[t],vt[t]);for(t of gr)this[t]=Od(e[t],vt[t]);for(t of mr)this[t]=Od(e[t],vt[t]);for(t of Eo)this[t]=new xn(t,vt[t],e[t],this);for(t of Ke)this[t]=new xn(t,vt[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,Ke,fr),e.tiff===!0?this.batchEnableWithBool(Ke,!0):e.tiff===!1?this.batchEnableWithUserValue(Ke,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,Ke):typeof e.tiff=="object"&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,Ke)}batchEnableWithBool(e,t){for(let n of e)this[n].enabled=t}batchEnableWithUserValue(e,t){for(let n of e){let r=t[n];this[n].enabled=r!==!1&&r!==void 0}}setupGlobalFilters(e,t,n,r=n){if(e&&e.length){for(let a of r)this[a].enabled=!1;let o=$g(e,n);for(let[a,s]of o)Ds(this[a].pick,s),this[a].enabled=!0}else if(t&&t.length){let o=$g(t,n);for(let[a,s]of o)Ds(this[a].skip,s)}}filterNestedSegmentTags(){let{ifd0:e,exif:t,xmp:n,iptc:r,icc:o}=this;this.makerNote?t.deps.add(37500):t.skip.add(37500),this.userComment?t.deps.add(37510):t.skip.add(37510),n.enabled||e.skip.add(700),r.enabled||e.skip.add(33723),o.enabled||e.skip.add(34675)}traverseTiffDependencyTree(){let{ifd0:e,exif:t,gps:n,interop:r}=this;r.needed&&(t.deps.add(40965),e.deps.add(40965)),t.needed&&e.deps.add(34665),n.needed&&e.deps.add(34853),this.tiff.enabled=Ke.some(o=>this[o].enabled===!0)||this.makerNote||this.userComment;for(let o of Ke)this[o].finalizeFilters()}get onlyTiff(){return!Is.map(e=>this[e].enabled).some(e=>e===!0)&&this.tiff.enabled}checkLoadedPlugins(){for(let e of Eo)this[e].enabled&&!Yt.has(e)&&Fd("segment parser",e)}};function $g(i,e){let t,n,r,o,a=[];for(r of e){for(o of(t=ko.get(r),n=[],t))(i.includes(o[0])||i.includes(o[1]))&&n.push(o[0]);n.length&&a.push([r,n])}return a}function Od(i,e){return i!==void 0?i:e!==void 0?e:void 0}function Ds(i,e){for(let t of e)i.add(t)}Ee(Sn,"default",vt);var yr=class{constructor(e){Ee(this,"parsers",{}),Ee(this,"output",{}),Ee(this,"errors",[]),Ee(this,"pushToErrors",t=>this.errors.push(t)),this.options=Sn.useCached(e)}read(e){return B(this,null,function*(){this.file=yield function(t,n){return typeof t=="string"?Ug(t,n):Co&&!YP&&t instanceof HTMLImageElement?Ug(t.src,n):t instanceof Uint8Array||t instanceof ArrayBuffer||t instanceof DataView?new Cn(t):Co&&t instanceof Blob?Rd(t,n,"blob",Po):void ot("Invalid input argument")}(e,this.options)})}setup(){if(this.fileParser)return;let{file:e}=this,t=e.getUint16(0);for(let[n,r]of Ts)if(r.canHandle(e,t))return this.fileParser=new r(this.options,this.file,this.parsers),e[n]=!0;this.file.close&&this.file.close(),ot("Unknown file format")}parse(){return B(this,null,function*(){let{output:e,errors:t}=this;return this.setup(),this.options.silentErrors?(yield this.executeParsers().catch(this.pushToErrors),t.push(...this.fileParser.errors)):yield this.executeParsers(),this.file.close&&this.file.close(),this.options.silentErrors&&t.length>0&&(e.errors=t),Qg(n=e)?void 0:n;var n})}executeParsers(){return B(this,null,function*(){let{output:e}=this;yield this.fileParser.parse();let t=Object.values(this.parsers).map(n=>B(this,null,function*(){let r=yield n.parse();n.assignToOutput(e,r)}));this.options.silentErrors&&(t=t.map(n=>n.catch(this.pushToErrors))),yield Promise.all(t)})}extractThumbnail(){return B(this,null,function*(){this.setup();let{options:e,file:t}=this,n=Yt.get("tiff",e);var r;if(t.tiff?r={start:0,type:"tiff"}:t.jpeg&&(r=yield this.fileParser.getOrFindSegment("tiff")),r===void 0)return;let o=yield this.fileParser.ensureSegmentChunk(r),a=this.parsers.tiff=new n(o,e,t),s=yield a.extractThumbnail();return t.close&&t.close(),s})}};function e0(i,e){return B(this,null,function*(){let t=new yr(e);return yield t.read(i),t.parse()})}var ZP=Object.freeze({__proto__:null,parse:e0,Exifr:yr,fileParsers:Ts,segmentParsers:Yt,fileReaders:Do,tagKeys:ko,tagValues:Hd,tagRevivers:jd,createDictionary:Zg,extendDictionary:Jg,fetchUrlAsArrayBuffer:Ps,readBlobAsArrayBuffer:Po,chunkedProps:hr,otherSegments:Is,segments:Eo,tiffBlocks:Ke,segmentsAndBlocks:fr,tiffExtractables:mr,inheritables:Os,allFormatters:gr,Options:Sn}),rn=class{static findPosition(e,t){let n=e.getUint16(t+2)+2,r=typeof this.headerLength=="function"?this.headerLength(e,t,n):this.headerLength,o=t+r,a=n-r;return{offset:t,length:n,headerLength:r,start:o,size:a,end:o+a}}static parse(e,t={}){return new this(e,new Sn({[this.type]:t}),e).parse()}normalizeInput(e){return e instanceof Cn?e:new Cn(e)}constructor(e,t={},n){Ee(this,"errors",[]),Ee(this,"raw",new Map),Ee(this,"handleError",r=>{if(!this.options.silentErrors)throw r;this.errors.push(r.message)}),this.chunk=this.normalizeInput(e),this.file=n,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 n=jd.get(t),r=Hd.get(t),o=ko.get(t),a=this.options[t],s=a.reviveValues&&!!n,l=a.translateValues&&!!r,c=a.translateKeys&&!!o,d={};for(let[u,g]of e)s&&n.has(u)?g=n.get(u)(g):l&&r.has(u)&&(g=this.translateValue(g,r.get(u))),c&&o.has(u)&&(u=o.get(u)||u),d[u]=g;return d}translateValue(e,t){return t[e]||t.DEFAULT||e}assignToOutput(e,t){this.assignObjectToOutput(e,this.constructor.type,t)}assignObjectToOutput(e,t,n){if(this.globalOptions.mergeOutput)return Object.assign(e,n);e[t]?Object.assign(e[t],n):e[t]=n}};Ee(rn,"headerLength",4),Ee(rn,"type",void 0),Ee(rn,"multiSegment",!1),Ee(rn,"canHandle",()=>!1);function JP(i){return i===192||i===194||i===196||i===219||i===221||i===218||i===254}function e2(i){return i>=224&&i<=239}function t2(i,e,t){for(let[n,r]of Yt)if(r.canHandle(i,e,t))return n}var ks=class extends class{constructor(e,t,n){Ee(this,"errors",[]),Ee(this,"ensureSegmentChunk",r=>B(this,null,function*(){let o=r.start,a=r.size||65536;if(this.file.chunked)if(this.file.available(o,a))r.chunk=this.file.subarray(o,a);else try{r.chunk=yield this.file.readChunk(o,a)}catch(s){ot(`Couldn't read segment: ${JSON.stringify(r)}. ${s.message}`)}else this.file.byteLength>o+a?r.chunk=this.file.subarray(o,a):r.size===void 0?r.chunk=this.file.subarray(o):ot("Segment unreachable: "+JSON.stringify(r));return r.chunk})),this.extendOptions&&this.extendOptions(e),this.options=e,this.file=t,this.parsers=n}injectSegment(e,t){this.options[e].enabled&&this.createParser(e,t)}createParser(e,t){let n=new(Yt.get(e))(t,this.options,this.file);return this.parsers[e]=n}createParsers(e){for(let t of e){let{type:n,chunk:r}=t,o=this.options[n];if(o&&o.enabled){let a=this.parsers[n];a&&a.append||a||this.createParser(n,r)}}}readSegments(e){return B(this,null,function*(){let t=e.map(this.ensureSegmentChunk);yield Promise.all(t)})}}{constructor(...e){super(...e),Ee(this,"appSegments",[]),Ee(this,"jpegSegments",[]),Ee(this,"unknownSegments",[])}static canHandle(e,t){return t===65496}parse(){return B(this,null,function*(){yield this.findAppSegments(),yield this.readSegments(this.appSegments),this.mergeMultiSegments(),this.createParsers(this.mergedAppSegments||this.appSegments)})}setupSegmentFinderArgs(e){e===!0?(this.findAll=!0,this.wanted=new Set(Yt.keyList())):(e=e===void 0?Yt.keyList().filter(t=>this.options[t].enabled):e.filter(t=>this.options[t].enabled&&Yt.has(t)),this.findAll=!1,this.remaining=new Set(e),this.wanted=new Set(e)),this.unfinishedMultiSegment=!1}findAppSegments(e=0,t){return B(this,null,function*(){this.setupSegmentFinderArgs(t);let{file:n,findAll:r,wanted:o,remaining:a}=this;if(!r&&this.file.chunked&&(r=Array.from(o).some(s=>{let l=Yt.get(s),c=this.options[s];return l.multiSegment&&c.multiSegment}),r&&(yield this.file.readWhole())),e=this.findAppSegmentsInRange(e,n.byteLength),!this.options.onlyTiff&&n.chunked){let s=!1;for(;a.size>0&&!s&&(n.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:l}=n,c=this.appSegments.some(d=>!this.file.available(d.offset||d.start,d.length||d.size));if(s=e>l&&!c?!(yield n.readNextChunk(e)):!(yield n.readNextChunk(l)),(e=this.findAppSegmentsInRange(e,n.byteLength))===void 0)return}}})}findAppSegmentsInRange(e,t){t-=2;let n,r,o,a,s,l,{file:c,findAll:d,wanted:u,remaining:g,options:h}=this;for(;e<t;e++)if(c.getUint8(e)===255){if(n=c.getUint8(e+1),e2(n)){if(r=c.getUint16(e+2),o=t2(c,e,r),o&&u.has(o)&&(a=Yt.get(o),s=a.findPosition(c,e),l=h[o],s.type=o,this.appSegments.push(s),!d&&(a.multiSegment&&l.multiSegment?(this.unfinishedMultiSegment=s.chunkNumber<s.chunkCount,this.unfinishedMultiSegment||g.delete(o)):g.delete(o),g.size===0)))break;h.recordUnknownSegments&&(s=rn.findPosition(c,e),s.marker=n,this.unknownSegments.push(s)),e+=r+1}else if(JP(n)){if(r=c.getUint16(e+2),n===218&&h.stopAfterSos!==!1)return;h.recordJpegSegments&&this.jpegSegments.push({offset:e,length:r,marker:n}),e+=r+1}}return e}mergeMultiSegments(){if(!this.appSegments.some(t=>t.multiSegment))return;let e=function(t,n){let r,o,a,s=new Map;for(let l=0;l<t.length;l++)r=t[l],o=r[n],s.has(o)?a=s.get(o):s.set(o,a=[]),a.push(r);return Array.from(s)}(this.appSegments,"type");this.mergedAppSegments=e.map(([t,n])=>{let r=Yt.get(t,this.options);return r.handleMultiSegments?{type:t,chunk:r.handleMultiSegments(n)}:n[0]})}getSegment(e){return this.appSegments.find(t=>t.type===e)}getOrFindSegment(e){return B(this,null,function*(){let t=this.getSegment(e);return t===void 0&&(yield this.findAppSegments(0,[e]),t=this.getSegment(e)),t})}};Ee(ks,"type","jpeg"),Ts.set("jpeg",ks);var i2=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4],Bd=class extends rn{parseHeader(){var e=this.chunk.getUint16();e===18761?this.le=!0:e===19789&&(this.le=!1),this.chunk.le=this.le,this.headerParsed=!0}parseTags(e,t,n=new Map){let{pick:r,skip:o}=this.options[t];r=new Set(r);let a=r.size>0,s=o.size===0,l=this.chunk.getUint16(e);e+=2;for(let c=0;c<l;c++){let d=this.chunk.getUint16(e);if(a){if(r.has(d)&&(n.set(d,this.parseTag(e,d,t)),r.delete(d),r.size===0))break}else!s&&o.has(d)||n.set(d,this.parseTag(e,d,t));e+=12}return n}parseTag(e,t,n){let{chunk:r}=this,o=r.getUint16(e+2),a=r.getUint32(e+4),s=i2[o];if(s*a<=4?e+=8:e=r.getUint32(e+8),(o<1||o>13)&&ot(`Invalid TIFF value type. block: ${n.toUpperCase()}, tag: ${t.toString(16)}, type: ${o}, offset ${e}`),e>r.byteLength&&ot(`Invalid TIFF value offset. block: ${n.toUpperCase()}, tag: ${t.toString(16)}, type: ${o}, offset ${e} is outside of chunk size ${r.byteLength}`),o===1)return r.getUint8Array(e,a);if(o===2)return(l=function(c){for(;c.endsWith("\0");)c=c.slice(0,-1);return c}(l=r.getString(e,a)).trim())===""?void 0:l;var l;if(o===7)return r.getUint8Array(e,a);if(a===1)return this.parseTagValue(o,e);{let c=new(function(u){switch(u){case 1:return Uint8Array;case 3:return Uint16Array;case 4:return Uint32Array;case 5:return Array;case 6:return Int8Array;case 8:return Int16Array;case 9:return Int32Array;case 10:return Array;case 11:return Float32Array;case 12:return Float64Array;default:return Array}}(o))(a),d=s;for(let u=0;u<a;u++)c[u]=this.parseTagValue(o,e),e+=d;return c}}parseTagValue(e,t){let{chunk:n}=this;switch(e){case 1:return n.getUint8(t);case 3:return n.getUint16(t);case 4:return n.getUint32(t);case 5:return n.getUint32(t)/n.getUint32(t+4);case 6:return n.getInt8(t);case 8:return n.getInt16(t);case 9:return n.getInt32(t);case 10:return n.getInt32(t)/n.getInt32(t+4);case 11:return n.getFloat(t);case 12:return n.getDouble(t);case 13:return n.getUint32(t);default:ot(`Invalid tiff type ${e}`)}}},xo=class extends Bd{static canHandle(e,t){return e.getUint8(t+1)===225&&e.getUint32(t+4)===1165519206&&e.getUint16(t+8)===0}parse(){return B(this,null,function*(){this.parseHeader();let{options:e}=this;return e.ifd0.enabled&&(yield this.parseIfd0Block()),e.exif.enabled&&(yield this.safeParse("parseExifBlock")),e.gps.enabled&&(yield this.safeParse("parseGpsBlock")),e.interop.enabled&&(yield this.safeParse("parseInteropBlock")),e.ifd1.enabled&&(yield this.safeParse("parseThumbnailBlock")),this.createOutput()})}safeParse(e){let t=this[e]();return t.catch!==void 0&&(t=t.catch(this.handleError)),t}findIfd0Offset(){this.ifd0Offset===void 0&&(this.ifd0Offset=this.chunk.getUint32(4))}findIfd1Offset(){if(this.ifd1Offset===void 0){this.findIfd0Offset();let e=this.chunk.getUint16(this.ifd0Offset),t=this.ifd0Offset+2+12*e;this.ifd1Offset=this.chunk.getUint32(t)}}parseBlock(e,t){let n=new Map;return this[t]=n,this.parseTags(e,t,n),n}parseIfd0Block(){return B(this,null,function*(){if(this.ifd0)return;let{file:e}=this;this.findIfd0Offset(),this.ifd0Offset<8&&ot("Malformed EXIF data"),!e.chunked&&this.ifd0Offset>e.byteLength&&ot(`IFD0 offset points to outside of file.
|
|
26
|
+
this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&(yield e.ensureChunk(this.ifd0Offset,jg(this.options)));let t=this.parseBlock(this.ifd0Offset,"ifd0");return t.size!==0?(this.exifOffset=t.get(34665),this.interopOffset=t.get(40965),this.gpsOffset=t.get(34853),this.xmp=t.get(700),this.iptc=t.get(33723),this.icc=t.get(34675),this.options.sanitize&&(t.delete(34665),t.delete(40965),t.delete(34853),t.delete(700),t.delete(33723),t.delete(34675)),t):void 0})}parseExifBlock(){return B(this,null,function*(){if(this.exif||(this.ifd0||(yield this.parseIfd0Block()),this.exifOffset===void 0))return;this.file.tiff&&(yield this.file.ensureChunk(this.exifOffset,jg(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 n=e.get(t);n&&n.length===1&&e.set(t,n[0])}parseGpsBlock(){return B(this,null,function*(){if(this.gps||(this.ifd0||(yield this.parseIfd0Block()),this.gpsOffset===void 0))return;let e=this.parseBlock(this.gpsOffset,"gps");return e&&e.has(2)&&e.has(4)&&(e.set("latitude",qg(...e.get(2),e.get(1))),e.set("longitude",qg(...e.get(4),e.get(3)))),e})}parseInteropBlock(){return B(this,null,function*(){if(!this.interop&&(this.ifd0||(yield this.parseIfd0Block()),this.interopOffset!==void 0||this.exif||(yield this.parseExifBlock()),this.interopOffset!==void 0))return this.parseBlock(this.interopOffset,"interop")})}parseThumbnailBlock(e=!1){return B(this,null,function*(){if(!this.ifd1&&!this.ifd1Parsed&&(!this.options.mergeOutput||e))return this.findIfd1Offset(),this.ifd1Offset>0&&(this.parseBlock(this.ifd1Offset,"ifd1"),this.ifd1Parsed=!0),this.ifd1})}extractThumbnail(){return B(this,null,function*(){if(this.headerParsed||this.parseHeader(),this.ifd1Parsed||(yield this.parseThumbnailBlock(!0)),this.ifd1===void 0)return;let e=this.ifd1.get(513),t=this.ifd1.get(514);return this.chunk.getUint8Array(e,t)})}get image(){return this.ifd0}get thumbnail(){return this.ifd1}createOutput(){let e,t,n,r={};for(t of Ke)if(e=this[t],!Qg(e))if(n=this.canTranslate?this.translateBlock(e,t):Object.fromEntries(e),this.options.mergeOutput){if(t==="ifd1")continue;Object.assign(r,n)}else r[t]=n;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[n,r]of Object.entries(t))this.assignObjectToOutput(e,n,r)}};function qg(i,e,t,n){var r=i+e/60+t/3600;return n!=="S"&&n!=="W"||(r*=-1),r}Ee(xo,"type","tiff"),Ee(xo,"headerLength",10),Yt.set("tiff",xo);var wR=Object.freeze({__proto__:null,default:ZP,Exifr:yr,fileParsers:Ts,segmentParsers:Yt,fileReaders:Do,tagKeys:ko,tagValues:Hd,tagRevivers:jd,createDictionary:Zg,extendDictionary:Jg,fetchUrlAsArrayBuffer:Ps,readBlobAsArrayBuffer:Po,chunkedProps:hr,otherSegments:Is,segments:Eo,tiffBlocks:Ke,segmentsAndBlocks:fr,tiffExtractables:mr,inheritables:Os,allFormatters:gr,Options:Sn,parse:e0}),Vd={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1},xR=Object.assign({},Vd,{firstChunkSize:4e4,gps:[1,2,3,4]});var CR=Object.assign({},Vd,{tiff:!1,ifd1:!0,mergeOutput:!1});var n2=Object.assign({},Vd,{firstChunkSize:4e4,ifd0:[274]});function r2(i){return B(this,null,function*(){let e=new yr(n2);yield e.read(i);let t=yield e.parse();if(t&&t.ifd0)return t.ifd0[274]})}var o2=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}}),_o=!0,wo=!0;if(typeof navigator=="object"){let i=navigator.userAgent;if(i.includes("iPad")||i.includes("iPhone")){let e=i.match(/OS (\d+)_(\d+)/);if(e){let[,t,n]=e;_o=Number(t)+.1*Number(n)<13.4,wo=!1}}else if(i.includes("OS X 10")){let[,e]=i.match(/OS X 10[_.](\d+)/);_o=wo=Number(e)<15}if(i.includes("Chrome/")){let[,e]=i.match(/Chrome\/(\d+)/);_o=wo=Number(e)<81}else if(i.includes("Firefox/")){let[,e]=i.match(/Firefox\/(\d+)/);_o=wo=Number(e)<77}}function t0(i){return B(this,null,function*(){let e=yield r2(i);return Object.assign({canvas:_o,css:wo},o2[e])})}var Nd=class extends Cn{constructor(...e){super(...e),Ee(this,"ranges",new zd),this.byteLength!==0&&this.ranges.add(0,this.byteLength)}_tryExtend(e,t,n){if(e===0&&this.byteLength===0&&n){let r=new DataView(n.buffer||n,n.byteOffset,n.byteLength);this._swapDataView(r)}else{let r=e+t;if(r>this.byteLength){let{dataView:o}=this._extend(r);this._swapDataView(o)}}}_extend(e){let t;t=Kg?Yg.allocUnsafe(e):new Uint8Array(e);let n=new DataView(t.buffer,t.byteOffset,t.byteLength);return t.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:t,dataView:n}}subarray(e,t,n=!1){return t=t||this._lengthToEnd(e),n&&this._tryExtend(e,t),this.ranges.add(e,t),super.subarray(e,t)}set(e,t,n=!1){n&&this._tryExtend(t,e.byteLength,e);let r=super.set(e,t);return this.ranges.add(t,r.byteLength),r}ensureChunk(e,t){return B(this,null,function*(){this.chunked&&(this.ranges.available(e,t)||(yield this.readChunk(e,t)))})}available(e,t){return this.ranges.available(e,t)}},zd=class{constructor(){Ee(this,"list",[])}get length(){return this.list.length}add(e,t,n=0){let r=e+t,o=this.list.filter(a=>Gg(e,a.offset,r)||Gg(e,a.end,r));if(o.length>0){e=Math.min(e,...o.map(s=>s.offset)),r=Math.max(r,...o.map(s=>s.end)),t=r-e;let a=o.shift();a.offset=e,a.length=t,a.end=r,this.list=this.list.filter(s=>!o.includes(s))}else this.list.push({offset:e,length:t,end:r})}available(e,t){let n=e+t;return this.list.some(r=>r.offset<=e&&n<=r.end)}};function Gg(i,e,t){return i<=e&&e<=t}var Ld=class extends Nd{constructor(e,t){super(0),Ee(this,"chunksRead",0),this.input=e,this.options=t}readWhole(){return B(this,null,function*(){this.chunked=!1,yield this.readChunk(this.nextChunkOffset)})}readChunked(){return B(this,null,function*(){this.chunked=!0,yield this.readChunk(0,this.options.firstChunkSize)})}readNextChunk(){return B(this,arguments,function*(e=this.nextChunkOffset){if(this.fullyRead)return this.chunksRead++,!1;let t=this.options.chunkSize,n=yield this.readChunk(e,t);return!!n&&n.byteLength===t})}readChunk(e,t){return B(this,null,function*(){if(this.chunksRead++,(t=this.safeWrapAddress(e,t))!==0)return this._readChunk(e,t)})}safeWrapAddress(e,t){return this.size!==void 0&&e+t>this.size?Math.max(0,this.size-e):t}get nextChunkOffset(){if(this.ranges.list.length!==0)return this.ranges.list[0].length}get canReadNextChunk(){return this.chunksRead<this.options.chunkLimit}get fullyRead(){return this.size!==void 0&&this.nextChunkOffset===this.size}read(){return this.options.chunked?this.readChunked():this.readWhole()}close(){}};Do.set("blob",class extends Ld{readWhole(){return B(this,null,function*(){this.chunked=!1;let i=yield Po(this.input);this._swapArrayBuffer(i)})}readChunked(){return this.chunked=!0,this.size=this.input.size,super.readChunked()}_readChunk(i,e){return B(this,null,function*(){let t=e?i+e:void 0,n=this.input.slice(i,t),r=yield Po(n);return this.set(r,i,!0)})}});var i0={strings:{generatingThumbnails:"Generating thumbnails..."}};var a2={version:"4.1.1"};function s2(i,e,t){try{i.getContext("2d").getImageData(0,0,1,1)}catch(n){if(n.code===18)return Promise.reject(new Error("cannot read image, probably an svg with external resources"))}return i.toBlob?new Promise(n=>{i.toBlob(n,e,t)}).then(n=>{if(n===null)throw new Error("cannot read image, probably an svg with external resources");return n}):Promise.resolve().then(()=>Lg(i.toDataURL(e,t),{})).then(n=>{if(n===null)throw new Error("could not extract blob, probably an old browser");return n})}function l2(i,e){let t=i.width,n=i.height;(e.deg===90||e.deg===270)&&(t=i.height,n=i.width);let r=document.createElement("canvas");r.width=t,r.height=n;let o=r.getContext("2d");return o.translate(t/2,n/2),e.canvas&&(o.rotate(e.rad),o.scale(e.scaleX,e.scaleY)),o.drawImage(i,-i.width/2,-i.height/2,i.width,i.height),r}function c2(i){let e=i.width/i.height,t=5e6,n=4096,r=Math.floor(Math.sqrt(t*e)),o=Math.floor(t/Math.sqrt(t*e));if(r>n&&(r=n,o=Math.round(r/e)),o>n&&(o=n,r=Math.round(e*o)),i.width>r){let a=document.createElement("canvas");return a.width=r,a.height=o,a.getContext("2d").drawImage(i,0,0,r,o),a}return i}var d2={thumbnailWidth:null,thumbnailHeight:null,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,lazy:!1},vr=class extends qt{constructor(e,t){if(super(e,v(v({},d2),t)),this.onFileAdded=n=>{!n.preview&&n.data&&Ss(n.type)&&!n.isRemote&&this.addToQueue(n.id)},this.onCancelRequest=n=>{let r=this.queue.indexOf(n.id);r!==-1&&this.queue.splice(r,1)},this.onFileRemoved=n=>{let r=this.queue.indexOf(n.id);r!==-1&&this.queue.splice(r,1),n.preview&&Cs(n.preview)&&URL.revokeObjectURL(n.preview)},this.onRestored=()=>{this.uppy.getFiles().filter(r=>r.isRestored).forEach(r=>{(!r.preview||Cs(r.preview))&&this.addToQueue(r.id)})},this.onAllFilesRemoved=()=>{this.queue=[]},this.waitUntilAllProcessed=n=>{n.forEach(o=>{let a=this.uppy.getFile(o);this.uppy.emit("preprocess-progress",a,{mode:"indeterminate",message:this.i18n("generatingThumbnails")})});let r=()=>{n.forEach(o=>{let a=this.uppy.getFile(o);this.uppy.emit("preprocess-complete",a)})};return new Promise(o=>{this.queueProcessing?this.uppy.once("thumbnail:all-generated",()=>{r(),o()}):(r(),o())})},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=i0,this.i18nInit(),this.opts.lazy&&this.opts.waitForThumbnailsBeforeUpload)throw new Error("ThumbnailGenerator: The `lazy` and `waitForThumbnailsBeforeUpload` options are mutually exclusive. Please ensure at most one of them is set to `true`.")}createThumbnail(e,t,n){let r=URL.createObjectURL(e.data),o=new Promise((s,l)=>{let c=new Image;c.src=r,c.addEventListener("load",()=>{URL.revokeObjectURL(r),s(c)}),c.addEventListener("error",d=>{URL.revokeObjectURL(r),l(d.error||new Error("Could not create thumbnail"))})}),a=t0(e.data).catch(()=>1);return Promise.all([o,a]).then(s=>{let[l,c]=s,d=this.getProportionalDimensions(l,t,n,c.deg),u=l2(l,c),g=this.resizeImage(u,d.width,d.height);return s2(g,this.thumbnailType,80)}).then(s=>URL.createObjectURL(s))}getProportionalDimensions(e,t,n,r){let o=e.width/e.height;return(r===90||r===270)&&(o=e.height/e.width),t!=null?{width:t,height:Math.round(t/o)}:n!=null?{width:Math.round(n*o),height:n}:{width:this.defaultThumbnailDimension,height:Math.round(this.defaultThumbnailDimension/o)}}resizeImage(e,t,n){let r=c2(e),o=Math.ceil(Math.log2(r.width/t));o<1&&(o=1);let a=t*2**(o-1),s=n*2**(o-1),l=2;for(;o--;){let c=document.createElement("canvas");c.width=a,c.height=s,c.getContext("2d").drawImage(r,0,0,a,s),r=c,a=Math.round(a/l),s=Math.round(s/l)}return r}setPreviewURL(e,t){this.uppy.setFileState(e,{preview:t})}addToQueue(e){this.queue.push(e),this.queueProcessing===!1&&this.processQueue()}processQueue(){if(this.queueProcessing=!0,this.queue.length>0){let e=this.uppy.getFile(this.queue.shift());return e?this.requestThumbnail(e).catch(()=>{}).then(()=>this.processQueue()):(this.uppy.log("[ThumbnailGenerator] file was removed before a thumbnail could be generated, but not removed from the queue. This is probably a bug","error"),Promise.resolve())}return this.queueProcessing=!1,this.uppy.log("[ThumbnailGenerator] Emptied thumbnail queue"),this.uppy.emit("thumbnail:all-generated"),Promise.resolve()}requestThumbnail(e){return Ss(e.type)&&!e.isRemote?this.createThumbnail(e,this.opts.thumbnailWidth,this.opts.thumbnailHeight).then(t=>{this.setPreviewURL(e.id,t),this.uppy.log(`[ThumbnailGenerator] Generated thumbnail for ${e.id}`),this.uppy.emit("thumbnail:generated",this.uppy.getFile(e.id),t)}).catch(t=>{this.uppy.log(`[ThumbnailGenerator] Failed thumbnail for ${e.id}:`,"warning"),this.uppy.log(t,"warning"),this.uppy.emit("thumbnail:error",this.uppy.getFile(e.id),t)}):Promise.resolve()}install(){this.uppy.on("file-removed",this.onFileRemoved),this.uppy.on("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("thumbnail:cancel",this.onCancelRequest)):(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("file-added",this.onFileAdded),this.uppy.on("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.addPreProcessor(this.waitUntilAllProcessed)}uninstall(){this.uppy.off("file-removed",this.onFileRemoved),this.uppy.off("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("thumbnail:cancel",this.onCancelRequest)):(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("file-added",this.onFileAdded),this.uppy.off("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.removePreProcessor(this.waitUntilAllProcessed)}};vr.VERSION=a2.version;function u2(i){if(typeof i=="string"){let e=document.querySelectorAll(i);return e.length===0?null:Array.from(e)}return typeof i=="object"&&mo(i)?[i]:null}var Ud=u2;var Si=Array.from;function Fs(i,e,t,n){let{onSuccess:r}=n;i.readEntries(o=>{let a=[...e,...o];o.length?queueMicrotask(()=>{Fs(i,a,t,{onSuccess:r})}):r(a)},o=>{t(o),r(e)})}function n0(i,e){return i==null?i:{kind:i.isFile?"file":i.isDirectory?"directory":void 0,name:i.name,getFile(){return new Promise((n,r)=>i.file(n,r))},values(){return Qo(this,null,function*(){let n=i.createReader(),r=yield new Hn(new Promise(o=>{Fs(n,[],e,{onSuccess:a=>o(a.map(s=>n0(s,e)))})}));yield*Zo(r)})},isSameEntry:void 0}}function r0(i,e,t){try{return t===void 0&&(t=void 0),function(){return Qo(this,null,function*(){let n=()=>`${e}/${i.name}`;if(i.kind==="file"){let l=yield new Hn(i.getFile());l!=null?(l.relativePath=e?n():null,yield l):t!=null&&(yield t)}else if(i.kind==="directory")try{for(var r=Jo(i.values()),o,a,s;o=!(a=yield new Hn(r.next())).done;o=!1){let l=a.value;yield*Zo(r0(l,e?n():i.name))}}catch{s=[a]}finally{try{o&&(a=r.return)&&(yield new Hn(a.call(r)))}finally{if(s)throw s[0]}}else t!=null&&(yield t)})}()}catch(n){return Promise.reject(n)}}function Wd(i,e){return Qo(this,null,function*(){let t=yield new Hn(Promise.all(Array.from(i.items,n=>B(this,null,function*(){var r;let o,a=()=>typeof n.getAsEntry=="function"?n.getAsEntry():n.webkitGetAsEntry();return(r=o)!=null||(o=n0(a(),e)),{fileSystemHandle:o,lastResortFile:n.getAsFile()}}))));for(let{lastResortFile:n,fileSystemHandle:r}of t)if(r!=null)try{yield*Zo(r0(r,"",n))}catch(o){n!=null?yield n:e(o)}else n!=null&&(yield n)})}function $d(i){let e=Si(i.files);return Promise.resolve(e)}function To(i,e){return B(this,null,function*(){var t;let n=(t=e?.logDropError)!=null?t:Function.prototype;try{let l=[];try{for(var r=Jo(Wd(i,n)),o,a,s;o=!(a=yield r.next()).done;o=!1){let c=a.value;l.push(c)}}catch{s=[a]}finally{try{o&&(a=r.return)&&(yield a.call(r))}finally{if(s)throw s[0]}}return l}catch{return $d(i)}})}var M0=De(yt(),1);function Io(i){return D(v({},i),{type:i.mimeType,extension:i.name?xi(i.name).extension:null})}var Oo,qe,qd,o0,Fo=0,h0=[],Qe=Fe,a0=Qe.__b,s0=Qe.__r,l0=Qe.diffed,c0=Qe.__c,d0=Qe.unmount,u0=Qe.__;function Xd(i,e){Qe.__h&&Qe.__h(qe,i,Fo||e),Fo=0;var t=qe.__H||(qe.__H={__:[],__h:[]});return i>=t.__.length&&t.__.push({}),t.__[i]}function hi(i){return Fo=1,p2(m0,i)}function p2(i,e,t){var n=Xd(Oo++,2);if(n.t=i,!n.__c&&(n.__=[t?t(e):m0(void 0,e),function(s){var l=n.__N?n.__N[0]:n.__[0],c=n.t(l,s);l!==c&&(n.__N=[c,n.__[1]],n.__c.setState({}))}],n.__c=qe,!qe.u)){var r=function(s,l,c){if(!n.__c.__H)return!0;var d=n.__c.__H.__.filter(function(g){return!!g.__c});if(d.every(function(g){return!g.__N}))return!o||o.call(this,s,l,c);var u=n.__c.props!==s;return d.forEach(function(g){if(g.__N){var h=g.__[0];g.__=g.__N,g.__N=void 0,h!==g.__[0]&&(u=!0)}}),o&&o.call(this,s,l,c)||u};qe.u=!0;var o=qe.shouldComponentUpdate,a=qe.componentWillUpdate;qe.componentWillUpdate=function(s,l,c){if(this.__e){var d=o;o=void 0,r(s,l,c),o=d}a&&a.call(this,s,l,c)},qe.shouldComponentUpdate=r}return n.__N||n.__}function Pi(i,e){var t=Xd(Oo++,3);!Qe.__s&&f0(t.__H,e)&&(t.__=i,t.i=e,qe.__H.__h.push(t))}function Pn(i){return Fo=5,En(function(){return{current:i}},[])}function En(i,e){var t=Xd(Oo++,7);return f0(t.__H,e)&&(t.__=i(),t.__H=e,t.__h=i),t.__}function Dn(i,e){return Fo=8,En(function(){return i},e)}function h2(){for(var i;i=h0.shift();)if(i.__P&&i.__H)try{i.__H.__h.forEach(Rs),i.__H.__h.forEach(Gd),i.__H.__h=[]}catch(e){i.__H.__h=[],Qe.__e(e,i.__v)}}Qe.__b=function(i){qe=null,a0&&a0(i)},Qe.__=function(i,e){i&&e.__k&&e.__k.__m&&(i.__m=e.__k.__m),u0&&u0(i,e)},Qe.__r=function(i){s0&&s0(i),Oo=0;var e=(qe=i.__c).__H;e&&(qd===qe?(e.__h=[],qe.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.i=t.__N=void 0})):(e.__h.forEach(Rs),e.__h.forEach(Gd),e.__h=[],Oo=0)),qd=qe},Qe.diffed=function(i){l0&&l0(i);var e=i.__c;e&&e.__H&&(e.__H.__h.length&&(h0.push(e)!==1&&o0===Qe.requestAnimationFrame||((o0=Qe.requestAnimationFrame)||f2)(h2)),e.__H.__.forEach(function(t){t.i&&(t.__H=t.i),t.i=void 0})),qd=qe=null},Qe.__c=function(i,e){e.some(function(t){try{t.__h.forEach(Rs),t.__h=t.__h.filter(function(n){return!n.__||Gd(n)})}catch(n){e.some(function(r){r.__h&&(r.__h=[])}),e=[],Qe.__e(n,t.__v)}}),c0&&c0(i,e)},Qe.unmount=function(i){d0&&d0(i);var e,t=i.__c;t&&t.__H&&(t.__H.__.forEach(function(n){try{Rs(n)}catch(r){e=r}}),t.__H=void 0,e&&Qe.__e(e,t.__v))};var p0=typeof requestAnimationFrame=="function";function f2(i){var e,t=function(){clearTimeout(n),p0&&cancelAnimationFrame(e),setTimeout(i)},n=setTimeout(t,100);p0&&(e=requestAnimationFrame(t))}function Rs(i){var e=qe,t=i.__c;typeof t=="function"&&(i.__c=void 0,t()),qe=e}function Gd(i){var e=qe;i.__c=i.__(),qe=e}function f0(i,e){return!i||i.length!==e.length||e.some(function(t,n){return t!==i[n]})}function m0(i,e){return typeof e=="function"?e(i):e}function m2(){return p("svg",{width:"26",height:"26",viewBox:"0 0 26 26",xmlns:"http://www.w3.org/2000/svg"},p("g",{fill:"none","fill-rule":"evenodd"},p("circle",{fill:"#FFF",cx:"13",cy:"13",r:"13"}),p("path",{d:"M21.64 13.205c0-.639-.057-1.252-.164-1.841H13v3.481h4.844a4.14 4.14 0 01-1.796 2.716v2.259h2.908c1.702-1.567 2.684-3.875 2.684-6.615z",fill:"#4285F4","fill-rule":"nonzero"}),p("path",{d:"M13 22c2.43 0 4.467-.806 5.956-2.18l-2.908-2.259c-.806.54-1.837.86-3.048.86-2.344 0-4.328-1.584-5.036-3.711H4.957v2.332A8.997 8.997 0 0013 22z",fill:"#34A853","fill-rule":"nonzero"}),p("path",{d:"M7.964 14.71A5.41 5.41 0 017.682 13c0-.593.102-1.17.282-1.71V8.958H4.957A8.996 8.996 0 004 13c0 1.452.348 2.827.957 4.042l3.007-2.332z",fill:"#FBBC05","fill-rule":"nonzero"}),p("path",{d:"M13 7.58c1.321 0 2.508.454 3.44 1.345l2.582-2.58C17.463 4.891 15.426 4 13 4a8.997 8.997 0 00-8.043 4.958l3.007 2.332C8.672 9.163 10.656 7.58 13 7.58z",fill:"#EA4335","fill-rule":"nonzero"}),p("path",{d:"M4 4h18v18H4z"})))}function g2(i){let{pluginName:e,i18n:t,onAuth:n}=i,r=e==="Google Drive",o=Dn(a=>{a.preventDefault(),n()},[n]);return p("form",{onSubmit:o},r?p("button",{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn uppy-Provider-btn-google","data-uppy-super-focusable":!0},p(m2,null),t("signInWithGoogle")):p("button",{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn","data-uppy-super-focusable":!0},t("authenticateWith",{pluginName:e})))}var y2=i=>{let{pluginName:e,i18n:t,onAuth:n}=i;return p(g2,{pluginName:e,i18n:t,onAuth:n})};function Ms(i){let{loading:e,pluginName:t,pluginIcon:n,i18n:r,handleAuth:o,renderForm:a=y2}=i;return p("div",{className:"uppy-Provider-auth"},p("div",{className:"uppy-Provider-authIcon"},n()),p("div",{className:"uppy-Provider-authTitle"},r("authenticateWithTitle",{pluginName:t})),a({pluginName:t,i18n:r,loading:e,onAuth:o}))}var g0=De(yt(),1);function Yd(i){let{i18n:e,logout:t,username:n}=i;return p($t,null,n&&p("span",{className:"uppy-ProviderBrowser-user",key:"username"},n),p("button",{type:"button",onClick:t,className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowser-userLogout",key:"logout"},e("logOut")))}function Kd(i){let{openFolder:e,title:t,breadcrumbsIcon:n,breadcrumbs:r,i18n:o}=i;return p("div",{className:"uppy-Provider-breadcrumbs"},p("div",{className:"uppy-Provider-breadcrumbsIcon"},n),r.map((a,s)=>{var l;return p($t,null,p("button",{key:a.id,type:"button",className:"uppy-u-reset uppy-c-btn",onClick:()=>e(a.id)},a.type==="root"?t:(l=a.data.name)!=null?l:o("unnamed")),r.length===s+1?"":" / ")}))}function Qd(i){return p("div",{className:"uppy-ProviderBrowser-header"},p("div",{className:(0,g0.default)("uppy-ProviderBrowser-headerBar",!i.showBreadcrumbs&&"uppy-ProviderBrowser-headerBar--simple")},i.showBreadcrumbs&&p(Kd,{openFolder:i.openFolder,breadcrumbs:i.breadcrumbs,breadcrumbsIcon:i.pluginIcon&&i.pluginIcon(),title:i.title,i18n:i.i18n}),p(Yd,{logout:i.logout,username:i.username,i18n:i.i18n})))}function Zd(){return Zd=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},Zd.apply(null,arguments)}var v2={position:"relative",width:"100%",minHeight:"100%"},b2={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"},Jd=class extends It{constructor(e){super(e),this.handleScroll=()=>{this.setState({offset:this.base.scrollTop})},this.handleResize=()=>{this.resize()},this.focusElement=null,this.state={offset:0,height:0}}componentDidMount(){this.resize(),window.addEventListener("resize",this.handleResize)}componentWillUpdate(){this.base.contains(document.activeElement)&&(this.focusElement=document.activeElement)}componentDidUpdate(){this.focusElement&&this.focusElement.parentNode&&document.activeElement!==this.focusElement&&this.focusElement.focus(),this.focusElement=null,this.resize()}componentWillUnmount(){window.removeEventListener("resize",this.handleResize)}resize(){let{height:e}=this.state;e!==this.base.offsetHeight&&this.setState({height:this.base.offsetHeight})}render(e){let E=e,{data:t,rowHeight:n,renderRow:r,overscanCount:o=10}=E,a=Ln(E,["data","rowHeight","renderRow","overscanCount"]),{offset:s,height:l}=this.state,c=Math.floor(s/n),d=Math.floor(l/n);o&&(c=Math.max(0,c-c%o),d+=o);let u=c+d+4,g=t.slice(c,u),h=D(v({},v2),{height:t.length*n}),_=D(v({},b2),{top:c*n});return p("div",Zd({onScroll:this.handleScroll},a),p("div",{role:"presentation",style:h},p("div",{role:"presentation",style:_},g.map(r))))}},As=Jd;var y0=De(yt(),1);function _2(){return p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:11,height:14.5,viewBox:"0 0 44 58"},p("path",{d:"M27.437.517a1 1 0 0 0-.094.03H4.25C2.037.548.217 2.368.217 4.58v48.405c0 2.212 1.82 4.03 4.03 4.03H39.03c2.21 0 4.03-1.818 4.03-4.03V15.61a1 1 0 0 0-.03-.28 1 1 0 0 0 0-.093 1 1 0 0 0-.03-.032 1 1 0 0 0 0-.03 1 1 0 0 0-.032-.063 1 1 0 0 0-.03-.063 1 1 0 0 0-.032 0 1 1 0 0 0-.03-.063 1 1 0 0 0-.032-.03 1 1 0 0 0-.03-.063 1 1 0 0 0-.063-.062l-14.593-14a1 1 0 0 0-.062-.062A1 1 0 0 0 28 .708a1 1 0 0 0-.374-.157 1 1 0 0 0-.156 0 1 1 0 0 0-.03-.03l-.003-.003zM4.25 2.547h22.218v9.97c0 2.21 1.82 4.03 4.03 4.03h10.564v36.438a2.02 2.02 0 0 1-2.032 2.032H4.25c-1.13 0-2.032-.9-2.032-2.032V4.58c0-1.13.902-2.032 2.03-2.032zm24.218 1.345l10.375 9.937.75.718H30.5c-1.13 0-2.032-.9-2.032-2.03V3.89z"}))}function w2(){return p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",style:{minWidth:16,marginRight:3},viewBox:"0 0 276.157 276.157"},p("path",{d:"M273.08 101.378c-3.3-4.65-8.86-7.32-15.254-7.32h-24.34V67.59c0-10.2-8.3-18.5-18.5-18.5h-85.322c-3.63 0-9.295-2.875-11.436-5.805l-6.386-8.735c-4.982-6.814-15.104-11.954-23.546-11.954H58.73c-9.292 0-18.638 6.608-21.737 15.372l-2.033 5.752c-.958 2.71-4.72 5.37-7.596 5.37H18.5C8.3 49.09 0 57.39 0 67.59v167.07c0 .886.16 1.73.443 2.52.152 3.306 1.18 6.424 3.053 9.064 3.3 4.652 8.86 7.32 15.255 7.32h188.487c11.395 0 23.27-8.425 27.035-19.18l40.677-116.188c2.11-6.035 1.43-12.164-1.87-16.816zM18.5 64.088h8.864c9.295 0 18.64-6.607 21.738-15.37l2.032-5.75c.96-2.712 4.722-5.373 7.597-5.373h29.565c3.63 0 9.295 2.876 11.437 5.806l6.386 8.735c4.982 6.815 15.104 11.954 23.546 11.954h85.322c1.898 0 3.5 1.602 3.5 3.5v26.47H69.34c-11.395 0-23.27 8.423-27.035 19.178L15 191.23V67.59c0-1.898 1.603-3.5 3.5-3.5zm242.29 49.15l-40.676 116.188c-1.674 4.78-7.812 9.135-12.877 9.135H18.75c-1.447 0-2.576-.372-3.02-.997-.442-.625-.422-1.814.057-3.18l40.677-116.19c1.674-4.78 7.812-9.134 12.877-9.134h188.487c1.448 0 2.577.372 3.02.997.443.625.423 1.814-.056 3.18z"}))}function x2(){return p("svg",{"aria-hidden":"true",focusable:"false",style:{width:16,marginRight:4},viewBox:"0 0 58 58"},p("path",{d:"M36.537 28.156l-11-7a1.005 1.005 0 0 0-1.02-.033C24.2 21.3 24 21.635 24 22v14a1 1 0 0 0 1.537.844l11-7a1.002 1.002 0 0 0 0-1.688zM26 34.18V23.82L34.137 29 26 34.18z"}),p("path",{d:"M57 6H1a1 1 0 0 0-1 1v44a1 1 0 0 0 1 1h56a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1zM10 28H2v-9h8v9zm-8 2h8v9H2v-9zm10 10V8h34v42H12V40zm44-12h-8v-9h8v9zm-8 2h8v9h-8v-9zm8-22v9h-8V8h8zM2 8h8v9H2V8zm0 42v-9h8v9H2zm54 0h-8v-9h8v9z"}))}function br(i){let{itemIconString:e,alt:t=void 0}=i;if(e===null)return null;switch(e){case"file":return p(_2,null);case"folder":return p(w2,null);case"video":return p(x2,null);default:return p("img",{src:e,alt:t,referrerPolicy:"no-referrer",loading:"lazy",width:16,height:16})}}function C2(i){var e,t;let{file:n,toggleCheckbox:r,className:o,isDisabled:a,restrictionError:s,showTitles:l,children:c=null,i18n:d}=i;return p("li",{className:o,title:a&&s?s:void 0},p("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox uppy-ProviderBrowserItem-checkbox--grid",onChange:r,name:"listitem",id:n.id,checked:n.status==="checked",disabled:a,"data-uppy-super-focusable":!0}),p("label",{htmlFor:n.id,"aria-label":(e=n.data.name)!=null?e:d("unnamed"),className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},p(br,{itemIconString:n.data.thumbnail||n.data.icon}),l&&((t=n.data.name)!=null?t:d("unnamed")),c))}var eu=C2;function tu(i){var e,t,n;let{file:r,openFolder:o,className:a,isDisabled:s,restrictionError:l,toggleCheckbox:c,showTitles:d,i18n:u}=i;return p("li",{className:a,title:r.status!=="checked"&&l?l:void 0},p("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox",onChange:c,name:"listitem",id:r.id,checked:r.status==="checked","aria-label":r.data.isFolder?u("allFilesFromFolderNamed",{name:(e=r.data.name)!=null?e:u("unnamed")}):null,disabled:s,"data-uppy-super-focusable":!0}),r.data.isFolder?p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowserItem-inner",onClick:()=>o(r.id),"aria-label":u("openFolderNamed",{name:(t=r.data.name)!=null?t:u("unnamed")})},p("div",{className:"uppy-ProviderBrowserItem-iconWrap"},p(br,{itemIconString:r.data.icon})),d&&r.data.name?p("span",null,r.data.name):u("unnamed")):p("label",{htmlFor:r.id,className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},p("div",{className:"uppy-ProviderBrowserItem-iconWrap"},p(br,{itemIconString:r.data.icon})),d&&((n=r.data.name)!=null?n:u("unnamed"))))}function iu(i){let{viewType:e,toggleCheckbox:t,showTitles:n,i18n:r,openFolder:o,file:a,utmSource:s}=i,l=a.type==="folder"?null:a.restrictionError,c=!!l&&a.status!=="checked",d={file:a,openFolder:o,toggleCheckbox:t,utmSource:s,i18n:r,viewType:e,showTitles:n,className:(0,y0.default)("uppy-ProviderBrowserItem",{"uppy-ProviderBrowserItem--disabled":c},{"uppy-ProviderBrowserItem--noPreview":a.data.icon==="video"},{"uppy-ProviderBrowserItem--is-checked":a.status==="checked"},{"uppy-ProviderBrowserItem--is-partial":a.status==="partial"}),isDisabled:c,restrictionError:l};switch(e){case"grid":return p(eu,d);case"list":return p(tu,d);case"unsplash":return p(eu,d,p("a",{href:`${a.data.author.url}?utm_source=${s}&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer",className:"uppy-ProviderBrowserItem-author",tabIndex:-1},a.data.author.name));default:throw new Error(`There is no such type ${e}`)}}function S2(i){let{displayedPartialTree:e,viewType:t,toggleCheckbox:n,handleScroll:r,showTitles:o,i18n:a,isLoading:s,openFolder:l,noResultsLabel:c,virtualList:d,utmSource:u}=i,[g,h]=hi(!1);if(Pi(()=>{let E=M=>{M.key==="Shift"&&h(!1)},N=M=>{M.key==="Shift"&&h(!0)};return document.addEventListener("keyup",E),document.addEventListener("keydown",N),()=>{document.removeEventListener("keyup",E),document.removeEventListener("keydown",N)}},[]),s)return p("div",{className:"uppy-Provider-loading"},typeof s=="string"?s:a("loading"));if(e.length===0)return p("div",{className:"uppy-Provider-empty"},c);let _=E=>p(iu,{viewType:t,toggleCheckbox:N=>{var M;N.stopPropagation(),N.preventDefault(),(M=document.getSelection())==null||M.removeAllRanges(),n(E,g)},showTitles:o,i18n:a,openFolder:l,file:E,utmSource:u});return d?p("div",{className:"uppy-ProviderBrowser-body"},p("ul",{className:"uppy-ProviderBrowser-list"},p(As,{data:e,renderRow:_,rowHeight:31}))):p("div",{className:"uppy-ProviderBrowser-body"},p("ul",{className:"uppy-ProviderBrowser-list",onScroll:r,role:"listbox",tabIndex:-1},e.map(_)))}var Bs=S2;var P2=(i,e,t,n,r)=>{let o=e.filter(h=>h.isFolder===!0),a=e.filter(h=>h.isFolder===!1),s=t.type==="folder"&&t.status==="checked",l=o.map(h=>({type:"folder",id:h.requestPath,cached:!1,nextPagePath:null,status:s?"checked":"unchecked",parentId:t.id,data:h})),c=a.map(h=>{let _=r(h);return{type:"file",id:h.requestPath,restrictionError:_,status:s&&!_?"checked":"unchecked",parentId:t.id,data:h}}),d=D(v({},t),{cached:!0,nextPagePath:n});return[...i.map(h=>h.id===d.id?d:h),...l,...c]},v0=P2;var E2=(i,e,t,n,r)=>{let o=i.find(_=>_.id===e),a=t.filter(_=>_.isFolder===!0),s=t.filter(_=>_.isFolder===!1),l=D(v({},o),{nextPagePath:n}),c=i.map(_=>_.id===l.id?l:_),d=l.type==="folder"&&l.status==="checked",u=a.map(_=>({type:"folder",id:_.requestPath,cached:!1,nextPagePath:null,status:d?"checked":"unchecked",parentId:l.id,data:_})),g=s.map(_=>{let E=r(_);return{type:"file",id:_.requestPath,restrictionError:E,status:d&&!E?"checked":"unchecked",parentId:l.id,data:_}});return[...c,...u,...g]},b0=E2;var D2=i=>i.map(e=>v({},e)),Ns=D2;var nu=(i,e,t)=>{i.filter(r=>r.type!=="root"&&r.parentId===e).forEach(r=>{r.status=t&&!(r.type==="file"&&r.restrictionError)?"checked":"unchecked",nu(i,r.id,t)})},ru=(i,e)=>{let t=i.find(a=>a.id===e);if(t.type==="root")return;let n=i.filter(a=>a.type!=="root"&&a.parentId===t.id&&!(a.type==="file"&&a.restrictionError)),r=n.every(a=>a.status==="checked"),o=n.every(a=>a.status==="unchecked");r?t.status="checked":o?t.status="unchecked":t.status="partial",ru(i,t.parentId)},k2=(i,e)=>{let t=Ns(i);if(e.length>=2){let n=t.filter(r=>r.type!=="root"&&e.includes(r.id));n.forEach(r=>{r.type==="file"?r.status=r.restrictionError?"unchecked":"checked":r.status="checked"}),n.forEach(r=>{nu(t,r.id,!0)}),ru(t,n[0].parentId)}else{let n=t.find(r=>r.id===e[0]);n.status=n.status==="checked"?"unchecked":"checked",nu(t,n.id,n.status==="checked"),ru(t,n.parentId)}return t},_0=k2;var au=De(x0(),1);var Mo=class extends Error{constructor(e){super(e),this.name="TimeoutError"}},su=class extends Error{constructor(e){super(),this.name="AbortError",this.message=e}},C0=i=>globalThis.DOMException===void 0?new su(i):new DOMException(i),S0=i=>{let e=i.reason===void 0?C0("This operation was aborted."):i.reason;return e instanceof Error?e:C0(e)};function lu(i,e){let{milliseconds:t,fallback:n,message:r,customTimers:o={setTimeout,clearTimeout}}=e,a,s,c=new Promise((d,u)=>{if(typeof t!="number"||Math.sign(t)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);if(e.signal){let{signal:h}=e;h.aborted&&u(S0(h)),s=()=>{u(S0(h))},h.addEventListener("abort",s,{once:!0})}if(t===Number.POSITIVE_INFINITY){i.then(d,u);return}let g=new Mo;a=o.setTimeout.call(void 0,()=>{if(n){try{d(n())}catch(h){u(h)}return}typeof i.cancel=="function"&&i.cancel(),r===!1?d():r instanceof Error?u(r):(g.message=r??`Promise timed out after ${t} milliseconds`,u(g))},t),B(this,null,function*(){try{d(yield i)}catch(h){u(h)}})}).finally(()=>{c.clear(),s&&e.signal&&e.signal.removeEventListener("abort",s)});return c.clear=()=>{o.clearTimeout.call(void 0,a),a=void 0},c}function cu(i,e,t){let n=0,r=i.length;for(;r>0;){let o=Math.trunc(r/2),a=n+o;t(i[a],e)<=0?(n=++a,r-=o+1):r=o}return n}var Ls=class{#e=[];enqueue(e,t){t=v({priority:0},t);let n={priority:t.priority,run:e};if(this.size&&this.#e[this.size-1].priority>=t.priority){this.#e.push(n);return}let r=cu(this.#e,n,(o,a)=>a.priority-o.priority);this.#e.splice(r,0,n)}dequeue(){return this.#e.shift()?.run}filter(e){return this.#e.filter(t=>t.priority===e.priority).map(t=>t.run)}get size(){return this.#e.length}};var Hs=class extends au.default{#e;#a;#o=0;#h;#s;#f=0;#i;#l;#t;#m;#n=0;#c;#r;#g;timeout;constructor(e){if(super(),e=v({carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:Ls},e),!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${e.intervalCap?.toString()??""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${e.interval?.toString()??""}\` (${typeof e.interval})`);this.#e=e.carryoverConcurrencyCount,this.#a=e.intervalCap===Number.POSITIVE_INFINITY||e.interval===0,this.#h=e.intervalCap,this.#s=e.interval,this.#t=new e.queueClass,this.#m=e.queueClass,this.concurrency=e.concurrency,this.timeout=e.timeout,this.#g=e.throwOnTimeout===!0,this.#r=e.autoStart===!1}get#b(){return this.#a||this.#o<this.#h}get#_(){return this.#n<this.#c}#w(){this.#n--,this.#d(),this.emit("next")}#x(){this.#v(),this.#y(),this.#l=void 0}get#C(){let e=Date.now();if(this.#i===void 0){let t=this.#f-e;if(t<0)this.#o=this.#e?this.#n:0;else return this.#l===void 0&&(this.#l=setTimeout(()=>{this.#x()},t)),!0}return!1}#d(){if(this.#t.size===0)return this.#i&&clearInterval(this.#i),this.#i=void 0,this.emit("empty"),this.#n===0&&this.emit("idle"),!1;if(!this.#r){let e=!this.#C;if(this.#b&&this.#_){let t=this.#t.dequeue();return t?(this.emit("active"),t(),e&&this.#y(),!0):!1}}return!1}#y(){this.#a||this.#i!==void 0||(this.#i=setInterval(()=>{this.#v()},this.#s),this.#f=Date.now()+this.#s)}#v(){this.#o===0&&this.#n===0&&this.#i&&(clearInterval(this.#i),this.#i=void 0),this.#o=this.#e?this.#n:0,this.#u()}#u(){for(;this.#d(););}get concurrency(){return this.#c}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this.#c=e,this.#u()}#S(e){return B(this,null,function*(){return new Promise((t,n)=>{e.addEventListener("abort",()=>{n(e.reason)},{once:!0})})})}add(n){return B(this,arguments,function*(e,t={}){return t=v({timeout:this.timeout,throwOnTimeout:this.#g},t),new Promise((r,o)=>{this.#t.enqueue(()=>B(this,null,function*(){this.#n++,this.#o++;try{t.signal?.throwIfAborted();let a=e({signal:t.signal});t.timeout&&(a=lu(Promise.resolve(a),{milliseconds:t.timeout})),t.signal&&(a=Promise.race([a,this.#S(t.signal)]));let s=yield a;r(s),this.emit("completed",s)}catch(a){if(a instanceof Mo&&!t.throwOnTimeout){r();return}o(a),this.emit("error",a)}finally{this.#w()}}),t),this.emit("add"),this.#d()})})}addAll(e,t){return B(this,null,function*(){return Promise.all(e.map(n=>B(this,null,function*(){return this.add(n,t)})))})}start(){return this.#r?(this.#r=!1,this.#u(),this):this}pause(){this.#r=!0}clear(){this.#t=new this.#m}onEmpty(){return B(this,null,function*(){this.#t.size!==0&&(yield this.#p("empty"))})}onSizeLessThan(e){return B(this,null,function*(){this.#t.size<e||(yield this.#p("next",()=>this.#t.size<e))})}onIdle(){return B(this,null,function*(){this.#n===0&&this.#t.size===0||(yield this.#p("idle"))})}#p(e,t){return B(this,null,function*(){return new Promise(n=>{let r=()=>{t&&!t()||(this.off(e,r),n())};this.on(e,r)})})}get size(){return this.#t.size}sizeBy(e){return this.#t.filter(e).length}get pending(){return this.#n}get isPaused(){return this.#r}};var P0=(i,e,t,n,r)=>B(void 0,null,function*(){let o=[],a=t.cached?t.nextPagePath:t.id;for(;a;){let u=yield n(a);o=o.concat(u.items),a=u.nextPagePath}let s=o.filter(u=>u.isFolder===!0),l=o.filter(u=>u.isFolder===!1),c=s.map(u=>({type:"folder",id:u.requestPath,cached:!1,nextPagePath:null,status:"checked",parentId:t.id,data:u})),d=l.map(u=>{let g=r(u);return{type:"file",id:u.requestPath,restrictionError:g,status:g?"unchecked":"checked",parentId:t.id,data:u}});t.cached=!0,t.nextPagePath=null,e.push(...d,...c),c.forEach(u=>B(void 0,null,function*(){i.add(()=>P0(i,e,u,n,r))}))}),O2=(i,e,t,n)=>B(void 0,null,function*(){let r=new Hs({concurrency:6}),o=Ns(i);return o.filter(s=>s.type==="folder"&&s.status==="checked"&&(s.cached===!1||s.nextPagePath)).forEach(s=>{r.add(()=>P0(r,o,s,e,t))}),r.on("completed",()=>{let s=o.filter(l=>l.type==="file"&&l.status==="checked").length;n(s)}),yield r.onIdle(),o}),E0=O2;var kn={afterOpenFolder:v0,afterScrollFolder:b0,afterToggleCheckbox:_0,afterFill:E0};var F2=i=>{let{scrollHeight:e,scrollTop:t,offsetHeight:n}=i.target;return e-(t+n)<50},js=F2;var R2=i=>e=>{if(!e.isAuthError){if(e.name==="AbortError"){i.log("Aborting request","warning");return}i.log(e,"error"),e.name==="UserFacingApiError"&&i.info({message:i.i18n("companionError"),details:i.i18n(e.message)},"warning",5e3)}},Li=R2;var M2=(i,e,t,n)=>{let r=e.findIndex(o=>o.id===n);if(r!==-1&&t){let o=e.findIndex(s=>s.id===i);return e.slice(Math.min(r,o),Math.max(r,o)+1).map(s=>s.id)}return[i]},Vs=M2;function A2(i){let{searchString:e,setSearchString:t,submitSearchString:n,wrapperClassName:r,inputClassName:o,inputLabel:a,clearSearchLabel:s="",showButton:l=!1,buttonLabel:c="",buttonCSSClassName:d=""}=i,u=_=>{t(_.target.value)},g=Dn(_=>{_.preventDefault(),n()},[n]),[h]=hi(()=>{let _=document.createElement("form");return _.setAttribute("tabindex","-1"),_.id=nn(),_});return Pi(()=>(document.body.appendChild(h),h.addEventListener("submit",g),()=>{h.removeEventListener("submit",g),document.body.removeChild(h)}),[h,g]),p("section",{className:r},p("input",{className:`uppy-u-reset ${o}`,type:"search","aria-label":a,placeholder:a,value:e,onInput:u,form:h.id,"data-uppy-super-focusable":!0}),!l&&p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-ProviderBrowser-searchFilterIcon",width:"12",height:"12",viewBox:"0 0 12 12"},p("path",{d:"M8.638 7.99l3.172 3.172a.492.492 0 1 1-.697.697L7.91 8.656a4.977 4.977 0 0 1-2.983.983C2.206 9.639 0 7.481 0 4.819 0 2.158 2.206 0 4.927 0c2.721 0 4.927 2.158 4.927 4.82a4.74 4.74 0 0 1-1.216 3.17zm-3.71.685c2.176 0 3.94-1.726 3.94-3.856 0-2.129-1.764-3.855-3.94-3.855C2.75.964.984 2.69.984 4.819c0 2.13 1.765 3.856 3.942 3.856z"})),!l&&e&&p("button",{className:"uppy-u-reset uppy-ProviderBrowser-searchFilterReset",type:"button","aria-label":s,title:s,onClick:()=>t("")},p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",viewBox:"0 0 19 19"},p("path",{d:"M17.318 17.232L9.94 9.854 9.586 9.5l-.354.354-7.378 7.378h.707l-.62-.62v.706L9.318 9.94l.354-.354-.354-.354L1.94 1.854v.707l.62-.62h-.706l7.378 7.378.354.354.354-.354 7.378-7.378h-.707l.622.62v-.706L9.854 9.232l-.354.354.354.354 7.378 7.378.708-.707-7.38-7.378v.708l7.38-7.38.353-.353-.353-.353-.622-.622-.353-.353-.354.352-7.378 7.38h.708L2.56 1.23 2.208.88l-.353.353-.622.62-.353.355.352.353 7.38 7.38v-.708l-7.38 7.38-.353.353.352.353.622.622.353.353.354-.353 7.38-7.38h-.708l7.38 7.38z"}))),l&&p("button",{className:`uppy-u-reset uppy-c-btn uppy-c-btn-primary ${d}`,type:"submit",form:h.id},c))}var _r=A2;var k0=De(yt(),1);var B2=i=>i.filter(t=>t.type==="file"&&t.status==="checked"?!0:t.type==="folder"&&t.status==="checked"?!i.some(r=>r.type!=="root"&&r.parentId===t.id):!1).length,D0=B2;function Ao(i){let{cancelSelection:e,donePicking:t,i18n:n,partialTree:r,validateAggregateRestrictions:o}=i,a=En(()=>o(r),[r,o]),s=En(()=>D0(r),[r]);return s===0?null:p("div",{className:"uppy-ProviderBrowser-footer"},p("div",{className:"uppy-ProviderBrowser-footer-buttons"},p("button",{className:(0,k0.default)("uppy-u-reset uppy-c-btn uppy-c-btn-primary",{"uppy-c-btn--disabled":a}),disabled:!!a,onClick:t,type:"button"},n("selectX",{smart_count:s})),p("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link",onClick:e,type:"button"},n("cancel"))),a&&p("div",{className:"uppy-ProviderBrowser-footer-error"},a))}var N2=(i,e,t)=>{var n,r;return{id:i.id,source:e.id,name:i.name||i.id,type:i.mimeType,isRemote:!0,data:i,preview:i.thumbnail||void 0,meta:{authorName:(n=i.author)==null?void 0:n.name,authorUrl:(r=i.author)==null?void 0:r.url,relativePath:i.relDirPath||null,absolutePath:i.absDirPath},body:{fileId:i.id},remote:{companionUrl:e.opts.companionUrl,url:`${t.fileUrl(i.requestPath)}`,body:{fileId:i.id},providerName:t.name,provider:t.provider,requestClientId:t.provider}}},T0=N2;var z2=(i,e,t)=>{let n=i.map(a=>T0(a,e,t)),r=[],o=[];n.forEach(a=>{e.uppy.checkIfFileAlreadyExists(cs(a,e.uppy.getID()))?o.push(a):r.push(a)}),r.length>0&&e.uppy.info(e.uppy.i18n("addedNumFiles",{numFiles:r.length})),o.length>0&&e.uppy.info(`Not adding ${o.length} files because they already exist`),e.uppy.addFiles(r)},Us=z2;var I0=(i,e,t)=>{let n=e===null?"null":e;if(t[n])return t[n];let r=i.find(a=>a.id===e);if(r.type==="root")return[];let o=[...I0(i,r.parentId,t),r];return t[n]=o,o},L2=i=>{let e=Object.create(null);return i.filter(r=>r.type==="file"&&r.status==="checked").map(r=>{let o=I0(i,r.id,e),a=o.findIndex(d=>d.type==="folder"&&d.status==="checked"),s=o.slice(a),l=`/${o.map(d=>d.data.name).join("/")}`,c=s.length===1?void 0:s.map(d=>d.data.name).join("/");return D(v({},r.data),{absDirPath:l,relDirPath:c})})},Ws=L2;var H2=(i,e)=>{let t=i.find(r=>r.id===e),n=[];for(;n=[t,...n],t.type!=="root";){let r=t.parentId;t=i.find(o=>o.id===r)}return n},O0=H2;function on(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var j2=0;function R0(i){return"__private_"+j2+++"_"+i}var V2={version:"4.4.1"};function No(){return p("svg",{"aria-hidden":"true",focusable:"false",width:"30",height:"30",viewBox:"0 0 30 30"},p("path",{d:"M15 30c8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15C6.716 0 0 6.716 0 15c0 8.284 6.716 15 15 15zm4.258-12.676v6.846h-8.426v-6.846H5.204l9.82-12.364 9.82 12.364H19.26z"}))}var F0=i=>({authenticated:void 0,partialTree:[{type:"root",id:i,cached:!1,nextPagePath:null}],currentFolderId:i,searchString:"",didFirstRender:!1,username:null,loading:!1}),Tn=R0("abortController"),fi=R0("withAbort"),Bo=class{constructor(e,t){Object.defineProperty(this,fi,{value:U2}),this.isHandlingScroll=!1,this.lastCheckbox=null,Object.defineProperty(this,Tn,{writable:!0,value:void 0}),this.validateSingleFile=r=>{let o=Io(r);return this.plugin.uppy.validateSingleFile(o)},this.getDisplayedPartialTree=()=>{let{partialTree:r,currentFolderId:o,searchString:a}=this.plugin.getPluginState(),s=r.filter(c=>c.type!=="root"&&c.parentId===o);return a===""?s:s.filter(c=>{var d;return((d=c.data.name)!=null?d:this.plugin.uppy.i18n("unnamed")).toLowerCase().indexOf(a.toLowerCase())!==-1})},this.validateAggregateRestrictions=r=>{let a=r.filter(s=>s.type==="file"&&s.status==="checked").map(s=>s.data);return this.plugin.uppy.validateAggregateRestrictions(a)},this.plugin=e,this.provider=t.provider;let n={viewType:"list",showTitles:!0,showFilter:!0,showBreadcrumbs:!0,loadAllFiles:!1,virtualList:!1};this.opts=v(v({},n),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(F0(this.plugin.rootFolderId))}tearDown(){}setLoading(e){this.plugin.setPluginState({loading:e})}cancelSelection(){let{partialTree:e}=this.plugin.getPluginState(),t=e.map(n=>n.type==="root"?n:D(v({},n),{status:"unchecked"}));this.plugin.setPluginState({partialTree:t})}openFolder(e){return B(this,null,function*(){this.lastCheckbox=null;let{partialTree:t}=this.plugin.getPluginState(),n=t.find(r=>r.id===e);if(n.cached){this.plugin.setPluginState({currentFolderId:e,searchString:""});return}this.setLoading(!0),yield on(this,fi)[fi](r=>B(this,null,function*(){let o=e,a=[];do{let{username:l,nextPagePath:c,items:d}=yield this.provider.list(o,{signal:r});this.plugin.setPluginState({username:l}),o=c,a=a.concat(d),this.setLoading(this.plugin.uppy.i18n("loadedXFiles",{numFiles:a.length}))}while(this.opts.loadAllFiles&&o);let s=kn.afterOpenFolder(t,a,n,o,this.validateSingleFile);this.plugin.setPluginState({partialTree:s,currentFolderId:e,searchString:""})})).catch(Li(this.plugin.uppy)),this.setLoading(!1)})}logout(){return B(this,null,function*(){yield on(this,fi)[fi](e=>B(this,null,function*(){let t=yield this.provider.logout({signal:e});if(t.ok){if(!t.revoked){let n=this.plugin.uppy.i18n("companionUnauthorizeHint",{provider:this.plugin.title,url:t.manual_revoke_url});this.plugin.uppy.info(n,"info",7e3)}this.plugin.setPluginState(D(v({},F0(this.plugin.rootFolderId)),{authenticated:!1}))}})).catch(Li(this.plugin.uppy))})}handleAuth(e){return B(this,null,function*(){yield on(this,fi)[fi](t=>B(this,null,function*(){this.setLoading(!0),yield this.provider.login({authFormData:e,signal:t}),this.plugin.setPluginState({authenticated:!0}),yield Promise.all([this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId)])})).catch(Li(this.plugin.uppy)),this.setLoading(!1)})}handleScroll(e){return B(this,null,function*(){let{partialTree:t,currentFolderId:n}=this.plugin.getPluginState(),r=t.find(o=>o.id===n);js(e)&&!this.isHandlingScroll&&r.nextPagePath&&(this.isHandlingScroll=!0,yield on(this,fi)[fi](o=>B(this,null,function*(){let{nextPagePath:a,items:s}=yield this.provider.list(r.nextPagePath,{signal:o}),l=kn.afterScrollFolder(t,n,s,a,this.validateSingleFile);this.plugin.setPluginState({partialTree:l})})).catch(Li(this.plugin.uppy)),this.isHandlingScroll=!1)})}donePicking(){return B(this,null,function*(){let{partialTree:e}=this.plugin.getPluginState();this.setLoading(!0),yield on(this,fi)[fi](t=>B(this,null,function*(){let n=yield kn.afterFill(e,a=>this.provider.list(a,{signal:t}),this.validateSingleFile,a=>{this.setLoading(this.plugin.uppy.i18n("addedNumFiles",{numFiles:a}))});if(this.validateAggregateRestrictions(n)){this.plugin.setPluginState({partialTree:n});return}let o=Ws(n);Us(o,this.plugin,this.provider),this.resetPluginState()})).catch(Li(this.plugin.uppy)),this.setLoading(!1)})}toggleCheckbox(e,t){let{partialTree:n}=this.plugin.getPluginState(),r=Vs(e.id,this.getDisplayedPartialTree(),t,this.lastCheckbox),o=kn.afterToggleCheckbox(n,r);this.plugin.setPluginState({partialTree:o}),this.lastCheckbox=e.id}render(e,t){t===void 0&&(t={});let{didFirstRender:n}=this.plugin.getPluginState(),{i18n:r}=this.plugin.uppy;n||(this.plugin.setPluginState({didFirstRender:!0}),this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId));let o=v(v({},this.opts),t),{authenticated:a,loading:s}=this.plugin.getPluginState(),l=this.plugin.icon||No;if(a===!1)return p(Ms,{pluginName:this.plugin.title,pluginIcon:l,handleAuth:this.handleAuth,i18n:this.plugin.uppy.i18n,renderForm:o.renderAuthForm,loading:s});let{partialTree:c,currentFolderId:d,username:u,searchString:g}=this.plugin.getPluginState(),h=O0(c,d);return p("div",{className:(0,M0.default)("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${o.viewType}`)},p(Qd,{showBreadcrumbs:o.showBreadcrumbs,openFolder:this.openFolder,breadcrumbs:h,pluginIcon:l,title:this.plugin.title,logout:this.logout,username:u,i18n:r}),o.showFilter&&p(_r,{searchString:g,setSearchString:_=>{this.plugin.setPluginState({searchString:_})},submitSearchString:()=>{},inputLabel:r("filter"),clearSearchLabel:r("resetFilter"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),p(Bs,{toggleCheckbox:this.toggleCheckbox,displayedPartialTree:this.getDisplayedPartialTree(),openFolder:this.openFolder,virtualList:o.virtualList,noResultsLabel:r("noFilesFound"),handleScroll:this.handleScroll,viewType:o.viewType,showTitles:o.showTitles,i18n:this.plugin.uppy.i18n,isLoading:s,utmSource:"Companion"}),p(Ao,{partialTree:c,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:r,validateAggregateRestrictions:this.validateAggregateRestrictions}))}};function U2(i){return B(this,null,function*(){var e;(e=on(this,Tn)[Tn])==null||e.abort();let t=new AbortController;on(this,Tn)[Tn]=t;let n=()=>{t.abort()};try{this.plugin.uppy.on("dashboard:close-panel",n),this.plugin.uppy.on("cancel-all",n),yield i(t.signal)}finally{this.plugin.uppy.off("dashboard:close-panel",n),this.plugin.uppy.off("cancel-all",n),on(this,Tn)[Tn]=void 0}})}Bo.VERSION=V2.version;var A0=De(yt(),1);var W2={version:"4.4.1"},$2={loading:!1,searchString:"",partialTree:[{type:"root",id:null,cached:!1,nextPagePath:null}],currentFolderId:null,isInputMode:!0},q2={viewType:"grid",showTitles:!0,showFilter:!0,utmSource:"Companion"},wr=class{constructor(e,t){this.isHandlingScroll=!1,this.lastCheckbox=null,this.validateSingleFile=n=>{let r=Io(n);return this.plugin.uppy.validateSingleFile(r)},this.getDisplayedPartialTree=()=>{let{partialTree:n}=this.plugin.getPluginState();return n.filter(r=>r.type!=="root")},this.setSearchString=n=>{this.plugin.setPluginState({searchString:n}),n===""&&this.plugin.setPluginState({partialTree:[]})},this.validateAggregateRestrictions=n=>{let o=n.filter(a=>a.type==="file"&&a.status==="checked").map(a=>a.data);return this.plugin.uppy.validateAggregateRestrictions(o)},this.plugin=e,this.provider=t.provider,this.opts=v(v({},q2),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($2)}cancelSelection(){let{partialTree:e}=this.plugin.getPluginState(),t=e.map(n=>n.type==="root"?n:D(v({},n),{status:"unchecked"}));this.plugin.setPluginState({partialTree:t})}search(){return B(this,null,function*(){let{searchString:e}=this.plugin.getPluginState();if(e!==""){this.setLoading(!0);try{let t=yield this.provider.search(e),n=[{type:"root",id:null,cached:!1,nextPagePath:t.nextPageQuery},...t.items.map(r=>({type:"file",id:r.requestPath,status:"unchecked",parentId:null,data:r}))];this.plugin.setPluginState({partialTree:n,isInputMode:!1})}catch(t){Li(this.plugin.uppy)(t)}this.setLoading(!1)}})}handleScroll(e){return B(this,null,function*(){let{partialTree:t,searchString:n}=this.plugin.getPluginState(),r=t.find(o=>o.type==="root");if(js(e)&&!this.isHandlingScroll&&r.nextPagePath){this.isHandlingScroll=!0;try{let o=yield this.provider.search(n,r.nextPagePath),a=D(v({},r),{nextPagePath:o.nextPageQuery}),s=t.filter(c=>c.type!=="root"),l=[a,...s,...o.items.map(c=>({type:"file",id:c.requestPath,status:"unchecked",parentId:null,data:c}))];this.plugin.setPluginState({partialTree:l})}catch(o){Li(this.plugin.uppy)(o)}this.isHandlingScroll=!1}})}donePicking(){return B(this,null,function*(){let{partialTree:e}=this.plugin.getPluginState(),t=Ws(e);Us(t,this.plugin,this.provider),this.resetPluginState()})}toggleCheckbox(e,t){let{partialTree:n}=this.plugin.getPluginState(),r=Vs(e.id,this.getDisplayedPartialTree(),t,this.lastCheckbox),o=kn.afterToggleCheckbox(n,r);this.plugin.setPluginState({partialTree:o}),this.lastCheckbox=e.id}render(e,t){t===void 0&&(t={});let{isInputMode:n,searchString:r,loading:o,partialTree:a}=this.plugin.getPluginState(),{i18n:s}=this.plugin.uppy,l=v(v({},this.opts),t);return n?p(_r,{searchString:r,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:s("enterTextToSearch"),buttonLabel:s("searchImages"),wrapperClassName:"uppy-SearchProvider",inputClassName:"uppy-c-textInput uppy-SearchProvider-input",showButton:!0,buttonCSSClassName:"uppy-SearchProvider-searchButton"}):p("div",{className:(0,A0.default)("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${l.viewType}`)},l.showFilter&&p(_r,{searchString:r,setSearchString:this.setSearchString,submitSearchString:this.search,inputLabel:s("search"),clearSearchLabel:s("resetSearch"),wrapperClassName:"uppy-ProviderBrowser-searchFilter",inputClassName:"uppy-ProviderBrowser-searchFilterInput"}),p(Bs,{toggleCheckbox:this.toggleCheckbox,displayedPartialTree:this.getDisplayedPartialTree(),handleScroll:this.handleScroll,openFolder:()=>B(this,null,function*(){}),noResultsLabel:s("noSearchResults"),viewType:l.viewType,showTitles:l.showTitles,isLoading:o,i18n:s,virtualList:!1,utmSource:this.opts.utmSource}),p(Ao,{partialTree:a,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:s,validateAggregateRestrictions:this.validateAggregateRestrictions}))}};wr.VERSION=W2.version;var B0=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function G2(i,e){return!!(i===e||B0(i)&&B0(e))}function X2(i,e){if(i.length!==e.length)return!1;for(var t=0;t<i.length;t++)if(!G2(i[t],e[t]))return!1;return!0}function du(i,e){e===void 0&&(e=X2);var t=null;function n(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];if(t&&t.lastThis===this&&e(r,t.lastArgs))return t.lastResult;var a=i.apply(this,r);return t={lastResult:a,lastArgs:r,lastThis:this},a}return n.clear=function(){t=null},n}var $s=['a[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','area[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])',"input:not([disabled]):not([inert]):not([aria-hidden])","select:not([disabled]):not([inert]):not([aria-hidden])","textarea:not([disabled]):not([inert]):not([aria-hidden])","button:not([disabled]):not([inert]):not([aria-hidden])",'iframe:not([tabindex^="-"]):not([inert]):not([aria-hidden])','object:not([tabindex^="-"]):not([inert]):not([aria-hidden])','embed:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[contenteditable]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[tabindex]:not([tabindex^="-"]):not([inert]):not([aria-hidden])'];function zo(i,e){if(e){let t=i.querySelector(`[data-uppy-paneltype="${e}"]`);if(t)return t}return i}function N0(i,e){let t=e[0];t&&(t.focus(),i.preventDefault())}function Y2(i,e){let t=e[e.length-1];t&&(t.focus(),i.preventDefault())}function K2(i){return i.contains(document.activeElement)}function uu(i,e,t){let n=zo(t,e),r=Si(n.querySelectorAll($s)),o=r.indexOf(document.activeElement);K2(n)?i.shiftKey&&o===0?Y2(i,r):!i.shiftKey&&o===r.length-1&&N0(i,r):N0(i,r)}function z0(i,e,t){e===null||uu(i,e,t)}var L0=De(ed(),1);function pu(){let i=!1;return(0,L0.default)((t,n)=>{let r=zo(t,n),o=r.contains(document.activeElement);if(o&&i)return;let a=r.querySelector("[data-uppy-super-focusable]");if(!(o&&!a))if(a)a.focus({preventScroll:!0}),i=!0;else{let s=r.querySelector($s);s?.focus({preventScroll:!0}),i=!1}},260)}var ny=De(yt(),1);function Lo(){let i=document.body;return!(!("draggable"in i)||!("ondragstart"in i&&"ondrop"in i)||!("FormData"in window)||!("FileReader"in window))}var U0=De(yt(),1);function H0(i,e){if(i===e)return!0;if(!i||!e)return!1;let t=Object.keys(i),n=Object.keys(e),r=t.length;if(n.length!==r)return!1;for(let o=0;o<r;o++){let a=t[o];if(i[a]!==e[a]||!Object.prototype.hasOwnProperty.call(e,a))return!1}return!0}function Z2(){return p("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},p("g",{fill:"#686DE0",fillRule:"evenodd"},p("path",{d:"M5 7v10h15V7H5zm0-1h15a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1z",fillRule:"nonzero"}),p("path",{d:"M6.35 17.172l4.994-5.026a.5.5 0 0 1 .707 0l2.16 2.16 3.505-3.505a.5.5 0 0 1 .707 0l2.336 2.31-.707.72-1.983-1.97-3.505 3.505a.5.5 0 0 1-.707 0l-2.16-2.159-3.938 3.939-1.409.026z",fillRule:"nonzero"}),p("circle",{cx:"7.5",cy:"9.5",r:"1.5"})))}function J2(){return p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},p("path",{d:"M9.5 18.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V7.25a.5.5 0 0 1 .379-.485l9-2.25A.5.5 0 0 1 18.5 5v11.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V8.67l-8 2v7.97zm8-11v-2l-8 2v2l8-2zM7 19.64c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1zm9-2c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1z",fill:"#049BCF",fillRule:"nonzero"}))}function eE(){return p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},p("path",{d:"M16 11.834l4.486-2.691A1 1 0 0 1 22 10v6a1 1 0 0 1-1.514.857L16 14.167V17a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v2.834zM15 9H5v8h10V9zm1 4l5 3v-6l-5 3z",fill:"#19AF67",fillRule:"nonzero"}))}function tE(){return p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},p("path",{d:"M9.766 8.295c-.691-1.843-.539-3.401.747-3.726 1.643-.414 2.505.938 2.39 3.299-.039.79-.194 1.662-.537 3.148.324.49.66.967 1.055 1.51.17.231.382.488.629.757 1.866-.128 3.653.114 4.918.655 1.487.635 2.192 1.685 1.614 2.84-.566 1.133-1.839 1.084-3.416.249-1.141-.604-2.457-1.634-3.51-2.707a13.467 13.467 0 0 0-2.238.426c-1.392 4.051-4.534 6.453-5.707 4.572-.986-1.58 1.38-4.206 4.914-5.375.097-.322.185-.656.264-1.001.08-.353.306-1.31.407-1.737-.678-1.059-1.2-2.031-1.53-2.91zm2.098 4.87c-.033.144-.068.287-.104.427l.033-.01-.012.038a14.065 14.065 0 0 1 1.02-.197l-.032-.033.052-.004a7.902 7.902 0 0 1-.208-.271c-.197-.27-.38-.526-.555-.775l-.006.028-.002-.003c-.076.323-.148.632-.186.8zm5.77 2.978c1.143.605 1.832.632 2.054.187.26-.519-.087-1.034-1.113-1.473-.911-.39-2.175-.608-3.55-.608.845.766 1.787 1.459 2.609 1.894zM6.559 18.789c.14.223.693.16 1.425-.413.827-.648 1.61-1.747 2.208-3.206-2.563 1.064-4.102 2.867-3.633 3.62zm5.345-10.97c.088-1.793-.351-2.48-1.146-2.28-.473.119-.564 1.05-.056 2.405.213.566.52 1.188.908 1.859.18-.858.268-1.453.294-1.984z",fill:"#E2514A",fillRule:"nonzero"}))}function iE(){return p("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},p("path",{d:"M10.45 2.05h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V2.55a.5.5 0 0 1 .5-.5zm2.05 1.024h1.05a.5.5 0 0 1 .5.5V3.6a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5v-.001zM10.45 0h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V.5a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 3.074h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 1.024h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm-2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-1.656 3.074l-.82 5.946c.52.302 1.174.458 1.976.458.803 0 1.455-.156 1.975-.458l-.82-5.946h-2.311zm0-1.025h2.312c.512 0 .946.378 1.015.885l.82 5.946c.056.412-.142.817-.501 1.026-.686.398-1.515.597-2.49.597-.974 0-1.804-.199-2.49-.597a1.025 1.025 0 0 1-.5-1.026l.819-5.946c.07-.507.503-.885 1.015-.885zm.545 6.6a.5.5 0 0 1-.397-.561l.143-.999a.5.5 0 0 1 .495-.429h.74a.5.5 0 0 1 .495.43l.143.998a.5.5 0 0 1-.397.561c-.404.08-.819.08-1.222 0z",fill:"#00C469",fillRule:"nonzero"}))}function nE(){return p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},p("g",{fill:"#A7AFB7",fillRule:"nonzero"},p("path",{d:"M5.5 22a.5.5 0 0 1-.5-.5v-18a.5.5 0 0 1 .5-.5h10.719a.5.5 0 0 1 .367.16l3.281 3.556a.5.5 0 0 1 .133.339V21.5a.5.5 0 0 1-.5.5h-14zm.5-1h13V7.25L16 4H6v17z"}),p("path",{d:"M15 4v3a1 1 0 0 0 1 1h3V7h-3V4h-1z"})))}function rE(){return p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},p("path",{d:"M4.5 7h13a.5.5 0 1 1 0 1h-13a.5.5 0 0 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h10a.5.5 0 1 1 0 1h-10a.5.5 0 1 1 0-1z",fill:"#5A5E69",fillRule:"nonzero"}))}function In(i){let e={color:"#838999",icon:nE()};if(!i)return e;let t=i.split("/")[0],n=i.split("/")[1];return t==="text"?{color:"#5a5e69",icon:rE()}:t==="image"?{color:"#686de0",icon:Z2()}:t==="audio"?{color:"#068dbb",icon:J2()}:t==="video"?{color:"#19af67",icon:eE()}:t==="application"&&n==="pdf"?{color:"#e25149",icon:tE()}:t==="application"&&["zip","x-7z-compressed","x-zip-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(n)!==-1?{color:"#00C469",icon:iE()}:e}function Ho(i){let{file:e}=i;if(e.preview)return p("img",{className:"uppy-Dashboard-Item-previewImg",alt:e.name,src:e.preview});let{color:t,icon:n}=In(e.type);return p("div",{className:"uppy-Dashboard-Item-previewIconWrap"},p("span",{className:"uppy-Dashboard-Item-previewIcon",style:{color:t}},n),p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-Dashboard-Item-previewIconBg",width:"58",height:"76",viewBox:"0 0 58 76"},p("rect",{fill:"#FFF",width:"58",height:"76",rx:"3",fillRule:"evenodd"})))}var oE=(i,e)=>(typeof e=="function"?e():e).filter(r=>r.id===i)[0].name;function jo(i){let{file:e,toggleFileCard:t,i18n:n,metaFields:r}=i,{missingRequiredMetaFields:o}=e;if(!(o!=null&&o.length))return null;let a=o.map(s=>oE(s,r)).join(", ");return p("div",{className:"uppy-Dashboard-Item-errorMessage"},n("missingRequiredMetaFields",{smart_count:o.length,fields:a})," ",p("button",{type:"button",class:"uppy-u-reset uppy-Dashboard-Item-errorMessageBtn",onClick:()=>t(!0,e.id)},n("editFile")))}function hu(i){let{file:e,i18n:t,toggleFileCard:n,metaFields:r,showLinkToFileUploadResult:o}=i,s=e.preview?"rgba(255, 255, 255, 0.5)":In(e.type).color;return p("div",{className:"uppy-Dashboard-Item-previewInnerWrap",style:{backgroundColor:s}},o&&e.uploadURL&&p("a",{className:"uppy-Dashboard-Item-previewLink",href:e.uploadURL,rel:"noreferrer noopener",target:"_blank","aria-label":e.meta.name},p("span",{hidden:!0},e.meta.name)),p(Ho,{file:e}),p(jo,{file:e,i18n:t,toggleFileCard:n,metaFields:r}))}function aE(i){if(!i.isUploaded){if(i.error&&!i.hideRetryButton){i.uppy.retryUpload(i.file.id);return}i.resumableUploads&&!i.hidePauseResumeButton?i.uppy.pauseResume(i.file.id):i.individualCancellation&&!i.hideCancelButton&&i.uppy.removeFile(i.file.id)}}function j0(i){return i.isUploaded?i.i18n("uploadComplete"):i.error?i.i18n("retryUpload"):i.resumableUploads?i.file.isPaused?i.i18n("resumeUpload"):i.i18n("pauseUpload"):i.individualCancellation?i.i18n("cancelUpload"):""}function fu(i){return p("div",{className:"uppy-Dashboard-Item-progress"},p("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-progressIndicator",type:"button","aria-label":j0(i),title:j0(i),onClick:()=>aE(i)},i.children))}function qs(i){let{children:e}=i;return p("svg",{"aria-hidden":"true",focusable:"false",width:"70",height:"70",viewBox:"0 0 36 36",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--circle"},e)}function mu(i){let{progress:e}=i,t=2*Math.PI*15;return p("g",null,p("circle",{className:"uppy-Dashboard-Item-progressIcon--bg",r:"15",cx:"18",cy:"18","stroke-width":"2",fill:"none"}),p("circle",{className:"uppy-Dashboard-Item-progressIcon--progress",r:"15",cx:"18",cy:"18",transform:"rotate(-90, 18, 18)",fill:"none","stroke-width":"2","stroke-dasharray":t,"stroke-dashoffset":t-t/100*e}))}function gu(i){return!i.file.progress.uploadStarted||i.file.progress.percentage===void 0?null:i.isUploaded?p("div",{className:"uppy-Dashboard-Item-progress"},p("div",{className:"uppy-Dashboard-Item-progressIndicator"},p(qs,null,p("circle",{r:"15",cx:"18",cy:"18",fill:"#1bb240"}),p("polygon",{className:"uppy-Dashboard-Item-progressIcon--check",transform:"translate(2, 3)",points:"14 22.5 7 15.2457065 8.99985857 13.1732815 14 18.3547104 22.9729883 9 25 11.1005634"})))):i.recoveredState?null:i.error&&!i.hideRetryButton?p(fu,i,p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--retry",width:"28",height:"31",viewBox:"0 0 16 19"},p("path",{d:"M16 11a8 8 0 1 1-8-8v2a6 6 0 1 0 6 6h2z"}),p("path",{d:"M7.9 3H10v2H7.9z"}),p("path",{d:"M8.536.5l3.535 3.536-1.414 1.414L7.12 1.914z"}),p("path",{d:"M10.657 2.621l1.414 1.415L8.536 7.57 7.12 6.157z"}))):i.resumableUploads&&!i.hidePauseResumeButton?p(fu,i,p(qs,null,p(mu,{progress:i.file.progress.percentage}),i.file.isPaused?p("polygon",{className:"uppy-Dashboard-Item-progressIcon--play",transform:"translate(3, 3)",points:"12 20 12 10 20 15"}):p("g",{className:"uppy-Dashboard-Item-progressIcon--pause",transform:"translate(14.5, 13)"},p("rect",{x:"0",y:"0",width:"2",height:"10",rx:"0"}),p("rect",{x:"5",y:"0",width:"2",height:"10",rx:"0"})))):!i.resumableUploads&&i.individualCancellation&&!i.hideCancelButton?p(fu,i,p(qs,null,p(mu,{progress:i.file.progress.percentage}),p("polygon",{className:"cancel",transform:"translate(2, 2)",points:"19.8856516 11.0625 16 14.9481516 12.1019737 11.0625 11.0625 12.1143484 14.9481516 16 11.0625 19.8980263 12.1019737 20.9375 16 17.0518484 19.8856516 20.9375 20.9375 19.8980263 17.0518484 16 20.9375 12"}))):p("div",{className:"uppy-Dashboard-Item-progress"},p("div",{className:"uppy-Dashboard-Item-progressIndicator"},p(qs,null,p(mu,{progress:i.file.progress.percentage}))))}var V0=De(io(),1);var yu="...";function Gs(i,e){if(e===0)return"";if(i.length<=e)return i;if(e<=yu.length+1)return`${i.slice(0,e-1)}\u2026`;let t=e-yu.length,n=Math.ceil(t/2),r=Math.floor(t/2);return i.slice(0,n)+yu+i.slice(-r)}var sE=i=>{let{author:e,name:t}=i.file.meta;function n(){return i.isSingleFile&&i.containerHeight>=350?90:i.containerWidth<=352?35:i.containerWidth<=576?60:e?20:30}return p("div",{className:"uppy-Dashboard-Item-name",title:t},Gs(t,n()))},lE=i=>{var e;let{author:t}=i.file.meta,n=(e=i.file.remote)==null?void 0:e.providerName,r="\xB7";return t?p("div",{className:"uppy-Dashboard-Item-author"},p("a",{href:`${t.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer"},Gs(t.name,13)),n?p(Fragment,null,` ${r} `,n,` ${r} `):null):null},cE=i=>i.file.size&&p("div",{className:"uppy-Dashboard-Item-statusSize"},(0,V0.default)(i.file.size)),dE=i=>i.file.isGhost&&p("span",null," \u2022 ",p("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-reSelect",type:"button",onClick:()=>i.toggleAddFilesPanel(!0)},i.i18n("reSelect"))),uE=i=>{let{file:e,onClick:t}=i;return e.error?p("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-errorDetails","aria-label":e.error,"data-microtip-position":"bottom","data-microtip-size":"medium",onClick:t,type:"button"},"?"):null};function vu(i){let{file:e,i18n:t,toggleFileCard:n,metaFields:r,toggleAddFilesPanel:o,isSingleFile:a,containerHeight:s,containerWidth:l}=i;return p("div",{className:"uppy-Dashboard-Item-fileInfo","data-uppy-file-source":e.source},p("div",{className:"uppy-Dashboard-Item-fileName"},sE({file:e,isSingleFile:a,containerHeight:s,containerWidth:l}),p(uE,{file:e,onClick:()=>alert(e.error)})),p("div",{className:"uppy-Dashboard-Item-status"},lE({file:e}),cE({file:e}),dE({file:e,toggleAddFilesPanel:o,i18n:t})),p(jo,{file:e,i18n:t,toggleFileCard:n,metaFields:r}))}function bu(i,e){return e===void 0&&(e="Copy the URL below"),new Promise(t=>{let n=document.createElement("textarea");n.setAttribute("style",{position:"fixed",top:0,left:0,width:"2em",height:"2em",padding:0,border:"none",outline:"none",boxShadow:"none",background:"transparent"}),n.value=i,document.body.appendChild(n),n.select();let r=()=>{document.body.removeChild(n),window.prompt(e,i),t()};try{return document.execCommand("copy")?(document.body.removeChild(n),t()):r()}catch{return document.body.removeChild(n),r()}})}function pE(i){let{file:e,uploadInProgressOrComplete:t,metaFields:n,canEditFile:r,i18n:o,onClick:a}=i;return!t&&n&&n.length>0||!t&&r(e)?p("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-action uppy-Dashboard-Item-action--edit",type:"button","aria-label":o("editFileWithFilename",{file:e.meta.name}),title:o("editFileWithFilename",{file:e.meta.name}),onClick:()=>a()},p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 14"},p("g",{fillRule:"evenodd"},p("path",{d:"M1.5 10.793h2.793A1 1 0 0 0 5 10.5L11.5 4a1 1 0 0 0 0-1.414L9.707.793a1 1 0 0 0-1.414 0l-6.5 6.5A1 1 0 0 0 1.5 8v2.793zm1-1V8L9 1.5l1.793 1.793-6.5 6.5H2.5z",fillRule:"nonzero"}),p("rect",{x:"1",y:"12.293",width:"11",height:"1",rx:".5"}),p("path",{fillRule:"nonzero",d:"M6.793 2.5L9.5 5.207l.707-.707L7.5 1.793z"})))):null}function hE(i){let{i18n:e,onClick:t,file:n}=i;return p("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--remove",type:"button","aria-label":e("removeFile",{file:n.meta.name}),title:e("removeFile",{file:n.meta.name}),onClick:()=>t()},p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"18",height:"18",viewBox:"0 0 18 18"},p("path",{d:"M9 0C4.034 0 0 4.034 0 9s4.034 9 9 9 9-4.034 9-9-4.034-9-9-9z"}),p("path",{fill:"#FFF",d:"M13 12.222l-.778.778L9 9.778 5.778 13 5 12.222 8.222 9 5 5.778 5.778 5 9 8.222 12.222 5l.778.778L9.778 9z"})))}function fE(i){let{file:e,uppy:t,i18n:n}=i,r=o=>{bu(e.uploadURL,n("copyLinkToClipboardFallback")).then(()=>{t.log("Link copied to clipboard."),t.info(n("copyLinkToClipboardSuccess"),"info",3e3)}).catch(t.log).then(()=>o.target.focus({preventScroll:!0}))};return p("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--copyLink",type:"button","aria-label":n("copyLink"),title:n("copyLink"),onClick:o=>r(o)},p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 12"},p("path",{d:"M7.94 7.703a2.613 2.613 0 0 1-.626 2.681l-.852.851a2.597 2.597 0 0 1-1.849.766A2.616 2.616 0 0 1 2.764 7.54l.852-.852a2.596 2.596 0 0 1 2.69-.625L5.267 7.099a1.44 1.44 0 0 0-.833.407l-.852.851a1.458 1.458 0 0 0 1.03 2.486c.39 0 .755-.152 1.03-.426l.852-.852c.231-.231.363-.522.406-.824l1.04-1.038zm4.295-5.937A2.596 2.596 0 0 0 10.387 1c-.698 0-1.355.272-1.849.766l-.852.851a2.614 2.614 0 0 0-.624 2.688l1.036-1.036c.041-.304.173-.6.407-.833l.852-.852c.275-.275.64-.426 1.03-.426a1.458 1.458 0 0 1 1.03 2.486l-.852.851a1.442 1.442 0 0 1-.824.406l-1.04 1.04a2.596 2.596 0 0 0 2.683-.628l.851-.85a2.616 2.616 0 0 0 0-3.697zm-6.88 6.883a.577.577 0 0 0 .82 0l3.474-3.474a.579.579 0 1 0-.819-.82L5.355 7.83a.579.579 0 0 0 0 .819z"})))}function _u(i){let{uppy:e,file:t,uploadInProgressOrComplete:n,canEditFile:r,metaFields:o,showLinkToFileUploadResult:a,showRemoveButton:s,i18n:l,toggleFileCard:c,openFileEditor:d}=i;return p("div",{className:"uppy-Dashboard-Item-actionWrapper"},p(pE,{i18n:l,file:t,uploadInProgressOrComplete:n,canEditFile:r,metaFields:o,onClick:()=>{o&&o.length>0?c(!0,t.id):d(t)}}),a&&t.uploadURL?p(fE,{file:t,uppy:e,i18n:l}):null,s?p(hE,{i18n:l,file:t,onClick:()=>e.removeFile(t.id)}):null)}var Xs=class extends It{componentDidMount(){let{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}shouldComponentUpdate(e){return!H0(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,n=!!e.progress.uploadComplete&&!t&&!e.error,r=!!e.progress.uploadStarted||!!t,o=e.progress.uploadStarted&&!e.progress.uploadComplete||t,a=e.error||!1,{isGhost:s}=e,l=(this.props.individualCancellation||!o)&&!n;n&&this.props.showRemoveButtonAfterComplete&&(l=!0);let c=(0,U0.default)({"uppy-Dashboard-Item":!0,"is-inprogress":o&&!this.props.recoveredState,"is-processing":t,"is-complete":n,"is-error":!!a,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation,"is-ghost":s});return p("div",{className:c,id:`uppy_${e.id}`,role:this.props.role},p("div",{className:"uppy-Dashboard-Item-preview"},p(hu,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,i18n:this.props.i18n,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),p(gu,{uppy:this.props.uppy,file:e,error:a,isUploaded:n,hideRetryButton:this.props.hideRetryButton,hideCancelButton:this.props.hideCancelButton,hidePauseResumeButton:this.props.hidePauseResumeButton,recoveredState:this.props.recoveredState,resumableUploads:this.props.resumableUploads,individualCancellation:this.props.individualCancellation,i18n:this.props.i18n})),p("div",{className:"uppy-Dashboard-Item-fileInfoAndButtons"},p(vu,{file:e,containerWidth:this.props.containerWidth,containerHeight:this.props.containerHeight,i18n:this.props.i18n,toggleAddFilesPanel:this.props.toggleAddFilesPanel,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields,isSingleFile:this.props.isSingleFile}),p(_u,{file:e,metaFields:this.props.metaFields,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,showRemoveButton:l,canEditFile:this.props.canEditFile,uploadInProgressOrComplete:r,toggleFileCard:this.props.toggleFileCard,openFileEditor:this.props.openFileEditor,uppy:this.props.uppy,i18n:this.props.i18n})))}};function mE(i,e){let t=[],n=[];return i.forEach(r=>{n.length<e?n.push(r):(t.push(n),n=[r])}),n.length&&t.push(n),t}function wu(i){let{id:e,i18n:t,uppy:n,files:r,resumableUploads:o,hideRetryButton:a,hidePauseResumeButton:s,hideCancelButton:l,showLinkToFileUploadResult:c,showRemoveButtonAfterComplete:d,metaFields:u,isSingleFile:g,toggleFileCard:h,handleRequestThumbnail:_,handleCancelThumbnail:E,recoveredState:N,individualCancellation:M,itemsPerRow:U,openFileEditor:de,canEditFile:oe,toggleAddFilesPanel:ee,containerWidth:b,containerHeight:w}=i,S=U===1?71:200,A=En(()=>{let K=(Ne,Pe)=>Number(r[Pe].isGhost)-Number(r[Ne].isGhost),ye=Object.keys(r);return N&&ye.sort(K),mE(ye,U)},[r,U,N]),L=K=>p("div",{class:"uppy-Dashboard-filesInner",role:"presentation",key:K[0]},K.map(ye=>p(Xs,{key:ye,uppy:n,id:e,i18n:t,resumableUploads:o,individualCancellation:M,hideRetryButton:a,hidePauseResumeButton:s,hideCancelButton:l,showLinkToFileUploadResult:c,showRemoveButtonAfterComplete:d,metaFields:u,recoveredState:N,isSingleFile:g,containerWidth:b,containerHeight:w,toggleFileCard:h,handleRequestThumbnail:_,handleCancelThumbnail:E,role:"listitem",openFileEditor:de,canEditFile:oe,toggleAddFilesPanel:ee,file:r[ye]})));return g?p("div",{class:"uppy-Dashboard-files"},L(A[0])):p(As,{class:"uppy-Dashboard-files",role:"list",data:A,renderRow:L,rowHeight:S})}var xu=class extends It{constructor(){super(...arguments),this.fileInput=null,this.folderInput=null,this.mobilePhotoFileInput=null,this.mobileVideoFileInput=null,this.triggerFileInputClick=()=>{var e;(e=this.fileInput)==null||e.click()},this.triggerFolderInputClick=()=>{var e;(e=this.folderInput)==null||e.click()},this.triggerVideoCameraInputClick=()=>{var e;(e=this.mobileVideoFileInput)==null||e.click()},this.triggerPhotoCameraInputClick=()=>{var e;(e=this.mobilePhotoFileInput)==null||e.click()},this.onFileInputChange=e=>{this.props.handleInputChange(e),e.currentTarget.value=""},this.renderHiddenInput=(e,t)=>{var n;return p("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,webkitdirectory:e,type:"file",name:"files[]",multiple:this.props.maxNumberOfFiles!==1,onChange:this.onFileInputChange,accept:(n=this.props.allowedFileTypes)==null?void 0:n.join(", "),ref:t})},this.renderHiddenCameraInput=(e,t,n)=>{let o={photo:"image/*",video:"video/*"}[e];return p("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,type:"file",name:`camera-${e}`,onChange:this.onFileInputChange,capture:t,accept:o,ref:n})},this.renderMyDeviceAcquirer=()=>p("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MyDevice"},p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerFileInputClick},p("div",{className:"uppy-DashboardTab-inner"},p("svg",{className:"uppy-DashboardTab-iconMyDevice","aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},p("path",{d:"M8.45 22.087l-1.305-6.674h17.678l-1.572 6.674H8.45zm4.975-12.412l1.083 1.765a.823.823 0 00.715.386h7.951V13.5H8.587V9.675h4.838zM26.043 13.5h-1.195v-2.598c0-.463-.336-.75-.798-.75h-8.356l-1.082-1.766A.823.823 0 0013.897 8H7.728c-.462 0-.815.256-.815.718V13.5h-.956a.97.97 0 00-.746.37.972.972 0 00-.19.81l1.724 8.565c.095.44.484.755.933.755H24c.44 0 .824-.3.929-.727l2.043-8.568a.972.972 0 00-.176-.825.967.967 0 00-.753-.38z",fill:"currentcolor","fill-rule":"evenodd"}))),p("div",{className:"uppy-DashboardTab-name"},this.props.i18n("myDevice")))),this.renderPhotoCamera=()=>p("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobilePhotoCamera"},p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerPhotoCameraInputClick},p("div",{className:"uppy-DashboardTab-inner"},p("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},p("path",{d:"M23.5 9.5c1.417 0 2.5 1.083 2.5 2.5v9.167c0 1.416-1.083 2.5-2.5 2.5h-15c-1.417 0-2.5-1.084-2.5-2.5V12c0-1.417 1.083-2.5 2.5-2.5h2.917l1.416-2.167C13 7.167 13.25 7 13.5 7h5c.25 0 .5.167.667.333L20.583 9.5H23.5zM16 11.417a4.706 4.706 0 00-4.75 4.75 4.704 4.704 0 004.75 4.75 4.703 4.703 0 004.75-4.75c0-2.663-2.09-4.75-4.75-4.75zm0 7.825c-1.744 0-3.076-1.332-3.076-3.074 0-1.745 1.333-3.077 3.076-3.077 1.744 0 3.074 1.333 3.074 3.076s-1.33 3.075-3.074 3.075z",fill:"#02B383","fill-rule":"nonzero"}))),p("div",{className:"uppy-DashboardTab-name"},this.props.i18n("takePictureBtn")))),this.renderVideoCamera=()=>p("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobileVideoCamera"},p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerVideoCameraInputClick},p("div",{className:"uppy-DashboardTab-inner"},p("svg",{"aria-hidden":"true",width:"32",height:"32",viewBox:"0 0 32 32"},p("path",{fill:"#FF675E",fillRule:"nonzero",d:"m21.254 14.277 2.941-2.588c.797-.313 1.243.818 1.09 1.554-.01 2.094.02 4.189-.017 6.282-.126.915-1.145 1.08-1.58.34l-2.434-2.142c-.192.287-.504 1.305-.738.468-.104-1.293-.028-2.596-.05-3.894.047-.312.381.823.426 1.069.063-.384.206-.744.362-1.09zm-12.939-3.73c3.858.013 7.717-.025 11.574.02.912.129 1.492 1.237 1.351 2.217-.019 2.412.04 4.83-.03 7.239-.17 1.025-1.166 1.59-2.029 1.429-3.705-.012-7.41.025-11.114-.019-.913-.129-1.492-1.237-1.352-2.217.018-2.404-.036-4.813.029-7.214.136-.82.83-1.473 1.571-1.454z "}))),p("div",{className:"uppy-DashboardTab-name"},this.props.i18n("recordVideoBtn")))),this.renderBrowseButton=(e,t)=>{let n=this.props.acquirers.length;return p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-browse",onClick:t,"data-uppy-super-focusable":n===0},e)},this.renderDropPasteBrowseTagline=e=>{let t=this.renderBrowseButton(this.props.i18n("browseFiles"),this.triggerFileInputClick),n=this.renderBrowseButton(this.props.i18n("browseFolders"),this.triggerFolderInputClick),r=this.props.fileManagerSelectionType,o=r.charAt(0).toUpperCase()+r.slice(1);return p("div",{class:"uppy-Dashboard-AddFiles-title"},this.props.disableLocalFiles?this.props.i18n("importFiles"):e>0?this.props.i18nArray(`dropPasteImport${o}`,{browseFiles:t,browseFolders:n,browse:t}):this.props.i18nArray(`dropPaste${o}`,{browseFiles:t,browseFolders:n,browse:t}))},this.renderAcquirer=e=>{var t;return p("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":e.id},p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-cy":e.id,"aria-controls":`uppy-DashboardContent-panel--${e.id}`,"aria-selected":((t=this.props.activePickerPanel)==null?void 0:t.id)===e.id,"data-uppy-super-focusable":!0,onClick:()=>this.props.showPanel(e.id)},p("div",{className:"uppy-DashboardTab-inner"},e.icon()),p("div",{className:"uppy-DashboardTab-name"},e.name)))},this.renderAcquirers=e=>{let t=[...e],n=t.splice(e.length-2,e.length);return p($t,null,t.map(r=>this.renderAcquirer(r)),p("span",{role:"presentation",style:{"white-space":"nowrap"}},n.map(r=>this.renderAcquirer(r))))},this.renderSourcesList=(e,t)=>{let{showNativePhotoCameraButton:n,showNativeVideoCameraButton:r}=this.props,o=[],a="myDevice";t||o.push({key:a,elements:this.renderMyDeviceAcquirer()}),n&&o.push({key:"nativePhotoCameraButton",elements:this.renderPhotoCamera()}),r&&o.push({key:"nativePhotoCameraButton",elements:this.renderVideoCamera()}),o.push(...e.map(d=>({key:d.id,elements:this.renderAcquirer(d)}))),o.length===1&&o[0].key===a&&(o=[]);let l=[...o],c=l.splice(o.length-2,o.length);return p($t,null,this.renderDropPasteBrowseTagline(o.length),p("div",{className:"uppy-Dashboard-AddFiles-list",role:"tablist"},l.map(d=>{let{key:u,elements:g}=d;return p($t,{key:u},g)}),p("span",{role:"presentation",style:{"white-space":"nowrap"}},c.map(d=>{let{key:u,elements:g}=d;return p($t,{key:u},g)}))))}}[Symbol.for("uppy test: disable unused locale key warning")](){this.props.i18nArray("dropPasteBoth"),this.props.i18nArray("dropPasteFiles"),this.props.i18nArray("dropPasteFolders"),this.props.i18nArray("dropPasteImportBoth"),this.props.i18nArray("dropPasteImportFiles"),this.props.i18nArray("dropPasteImportFolders")}renderPoweredByUppy(){let{i18nArray:e}=this.props,t=p("span",null,p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-poweredByIcon",width:"11",height:"11",viewBox:"0 0 11 11"},p("path",{d:"M7.365 10.5l-.01-4.045h2.612L5.5.806l-4.467 5.65h2.604l.01 4.044h3.718z",fillRule:"evenodd"})),p("span",{className:"uppy-Dashboard-poweredByUppy"},"Uppy")),n=e("poweredBy",{uppy:t});return p("a",{tabIndex:-1,href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",className:"uppy-Dashboard-poweredBy"},n)}render(){let{showNativePhotoCameraButton:e,showNativeVideoCameraButton:t,nativeCameraFacingMode:n}=this.props;return p("div",{className:"uppy-Dashboard-AddFiles"},this.renderHiddenInput(!1,r=>{this.fileInput=r}),this.renderHiddenInput(!0,r=>{this.folderInput=r}),e&&this.renderHiddenCameraInput("photo",n,r=>{this.mobilePhotoFileInput=r}),t&&this.renderHiddenCameraInput("video",n,r=>{this.mobileVideoFileInput=r}),this.renderSourcesList(this.props.acquirers,this.props.disableLocalFiles),p("div",{className:"uppy-Dashboard-AddFiles-info"},this.props.note&&p("div",{className:"uppy-Dashboard-note"},this.props.note),this.props.proudlyDisplayPoweredByUppy&&this.renderPoweredByUppy()))}},Ys=xu;var W0=De(yt(),1);var gE=i=>p("div",{className:(0,W0.default)("uppy-Dashboard-AddFilesPanel",i.className),"data-uppy-panelType":"AddFiles","aria-hidden":!i.showAddFilesPanel},p("div",{className:"uppy-DashboardContent-bar"},p("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},i.i18n("addingMoreFiles")),p("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>i.toggleAddFilesPanel(!1)},i.i18n("back"))),p(Ys,i)),$0=gE;var q0=De(yt(),1);function yE(i){let{tagName:e}=i.target;if(e==="INPUT"||e==="TEXTAREA"){i.stopPropagation();return}i.preventDefault(),i.stopPropagation()}var Ei=yE;function vE(i){let{activePickerPanel:e,className:t,hideAllPanels:n,i18n:r,state:o,uppy:a}=i,s=Pn(null);return p("div",{className:(0,q0.default)("uppy-DashboardContent-panel",t),role:"tabpanel","data-uppy-panelType":"PickerPanel",id:`uppy-DashboardContent-panel--${e.id}`,onDragOver:Ei,onDragLeave:Ei,onDrop:Ei,onPaste:Ei},p("div",{className:"uppy-DashboardContent-bar"},p("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},r("importFrom",{name:e.name})),p("button",{className:"uppy-DashboardContent-back",type:"button",onClick:n},r("cancel"))),p("div",{ref:s,className:"uppy-DashboardContent-panelBody"},a.getPlugin(e.id).render(o,s.current)))}var G0=vE;var X0=De(yt(),1);function bE(i){let e=i.files[i.fileCardFor],t=()=>{i.uppy.emit("file-editor:cancel",e),i.closeFileEditor()};return p("div",{className:(0,X0.default)("uppy-DashboardContent-panel",i.className),role:"tabpanel","data-uppy-panelType":"FileEditor",id:"uppy-DashboardContent-panel--editor"},p("div",{className:"uppy-DashboardContent-bar"},p("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},i.i18nArray("editing",{file:p("span",{className:"uppy-DashboardContent-titleFile"},e.meta?e.meta.name:e.name)})),p("button",{className:"uppy-DashboardContent-back",type:"button",onClick:t},i.i18n("cancel")),p("button",{className:"uppy-DashboardContent-save",type:"button",onClick:i.saveFileEditor},i.i18n("save"))),p("div",{className:"uppy-DashboardContent-panelBody"},i.editors.map(n=>i.uppy.getPlugin(n.id).render(i.state))))}var Y0=bE;var Di={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete",STATE_PAUSED:"paused"};function _E(i,e,t,n){if(n===void 0&&(n={}),i)return Di.STATE_ERROR;if(e)return Di.STATE_COMPLETE;if(t)return Di.STATE_PAUSED;let r=Di.STATE_WAITING,o=Object.keys(n);for(let a=0;a<o.length;a++){let{progress:s}=n[o[a]];if(s.uploadStarted&&!s.uploadComplete)return Di.STATE_UPLOADING;s.preprocess&&r!==Di.STATE_UPLOADING&&(r=Di.STATE_PREPROCESSING),s.postprocess&&r!==Di.STATE_UPLOADING&&r!==Di.STATE_PREPROCESSING&&(r=Di.STATE_POSTPROCESSING)}return r}function wE(i){let{files:e,i18n:t,isAllComplete:n,isAllErrored:r,isAllPaused:o,inProgressNotPausedFiles:a,newFiles:s,processingFiles:l}=i;switch(_E(r,n,o,e)){case"uploading":return t("uploadingXFiles",{smart_count:a.length});case"preprocessing":case"postprocessing":return t("processingXFiles",{smart_count:l.length});case"paused":return t("uploadPaused");case"waiting":return t("xFilesSelected",{smart_count:s.length});case"complete":return t("uploadComplete");case"error":return t("error");default:}}function xE(i){let{i18n:e,isAllComplete:t,hideCancelButton:n,maxNumberOfFiles:r,toggleAddFilesPanel:o,uppy:a}=i,{allowNewUpload:s}=i;return s&&r&&(s=i.totalFileCount<i.maxNumberOfFiles),p("div",{className:"uppy-DashboardContent-bar"},!t&&!n?p("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>a.cancelAll()},e("cancel")):p("div",null),p("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},p(wE,i)),s?p("button",{className:"uppy-DashboardContent-addMore",type:"button","aria-label":e("addMoreFiles"),title:e("addMoreFiles"),onClick:()=>o(!0)},p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"15",height:"15",viewBox:"0 0 15 15"},p("path",{d:"M8 6.5h6a.5.5 0 0 1 .5.5v.5a.5.5 0 0 1-.5.5H8v6a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V8h-6a.5.5 0 0 1-.5-.5V7a.5.5 0 0 1 .5-.5h6v-6A.5.5 0 0 1 7 0h.5a.5.5 0 0 1 .5.5v6z"})),p("span",{className:"uppy-DashboardContent-addMoreCaption"},e("addMore"))):p("div",null))}var K0=xE;var Q0=De(yt(),1);function Cu(i){let{computedMetaFields:e,requiredMetaFields:t,updateMeta:n,form:r,formState:o}=i,a={text:"uppy-u-reset uppy-c-textInput uppy-Dashboard-FileCard-input"};return e.map(s=>{let l=`uppy-Dashboard-FileCard-input-${s.id}`,c=t.includes(s.id);return p("fieldset",{key:s.id,className:"uppy-Dashboard-FileCard-fieldset"},p("label",{className:"uppy-Dashboard-FileCard-label",htmlFor:l},s.name),s.render!==void 0?s.render({value:o[s.id],onChange:d=>n(d,s.id),fieldCSSClasses:a,required:c,form:r.id},p):p("input",{className:a.text,id:l,form:r.id,type:s.type||"text",required:c,value:o[s.id],placeholder:s.placeholder,onInput:d=>n(d.target.value,s.id),"data-uppy-super-focusable":!0}))})}function Su(i){var e;let{files:t,fileCardFor:n,toggleFileCard:r,saveFileCard:o,metaFields:a,requiredMetaFields:s,openFileEditor:l,i18n:c,i18nArray:d,className:u,canEditFile:g}=i,h=()=>typeof a=="function"?a(t[n]):a,_=t[n],E=(e=h())!=null?e:[],N=g(_),M={};E.forEach(S=>{var A;M[S.id]=(A=_.meta[S.id])!=null?A:""});let[U,de]=hi(M),oe=Dn(S=>{S.preventDefault(),o(U,n)},[o,U,n]),ee=(S,A)=>{de(D(v({},U),{[A]:S}))},b=()=>{r(!1)},[w]=hi(()=>{let S=document.createElement("form");return S.setAttribute("tabindex","-1"),S.id=nn(),S});return Pi(()=>(document.body.appendChild(w),w.addEventListener("submit",oe),()=>{w.removeEventListener("submit",oe),document.body.removeChild(w)}),[w,oe]),p("div",{className:(0,Q0.default)("uppy-Dashboard-FileCard",u),"data-uppy-panelType":"FileCard",onDragOver:Ei,onDragLeave:Ei,onDrop:Ei,onPaste:Ei},p("div",{className:"uppy-DashboardContent-bar"},p("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},d("editing",{file:p("span",{className:"uppy-DashboardContent-titleFile"},_.meta?_.meta.name:_.name)})),p("button",{className:"uppy-DashboardContent-back",type:"button",form:w.id,title:c("finishEditingFile"),onClick:b},c("cancel"))),p("div",{className:"uppy-Dashboard-FileCard-inner"},p("div",{className:"uppy-Dashboard-FileCard-preview",style:{backgroundColor:In(_.type).color}},p(Ho,{file:_}),N&&p("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-FileCard-edit",onClick:S=>{oe(S),l(_)}},c("editImage"))),p("div",{className:"uppy-Dashboard-FileCard-info"},p(Cu,{computedMetaFields:E,requiredMetaFields:s,updateMeta:ee,form:w,formState:U})),p("div",{className:"uppy-Dashboard-FileCard-actions"},p("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Dashboard-FileCard-actionsBtn",type:"submit",form:w.id},c("saveChanges")),p("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link uppy-Dashboard-FileCard-actionsBtn",type:"button",onClick:b,form:w.id},c("cancel")))))}var J0=De(yt(),1),xr="uppy-transition-slideDownUp",Z0=250;function CE(i){let{children:e}=i,[t,n]=hi(null),[r,o]=hi(""),a=Pn(),s=Pn(),l=Pn(),c=()=>{o(`${xr}-enter`),cancelAnimationFrame(l.current),clearTimeout(s.current),s.current=void 0,l.current=requestAnimationFrame(()=>{o(`${xr}-enter ${xr}-enter-active`),a.current=setTimeout(()=>{o("")},Z0)})},d=()=>{o(`${xr}-leave`),cancelAnimationFrame(l.current),clearTimeout(a.current),a.current=void 0,l.current=requestAnimationFrame(()=>{o(`${xr}-leave ${xr}-leave-active`),s.current=setTimeout(()=>{n(null),o("")},Z0)})};return Pi(()=>{let u=Ci(e)[0];t!==u&&(u&&!t?c():t&&!u&&!s.current&&d(),n(u))},[e,t]),Pi(()=>()=>{clearTimeout(a.current),clearTimeout(s.current),cancelAnimationFrame(l.current)},[]),t?gs(t,{className:(0,J0.default)(r,t.props.className)}):null}var Vo=CE;function Cr(){return Cr=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},Cr.apply(null,arguments)}var ey=900,ty=700,Pu=576,iy=330;function Eu(i){let e=i.totalFileCount===0,t=i.totalFileCount===1,n=i.containerWidth>Pu,r=i.containerHeight>iy,o=(0,ny.default)({"uppy-Dashboard":!0,"uppy-Dashboard--isDisabled":i.disabled,"uppy-Dashboard--animateOpenClose":i.animateOpenClose,"uppy-Dashboard--isClosing":i.isClosing,"uppy-Dashboard--isDraggingOver":i.isDraggingOver,"uppy-Dashboard--modal":!i.inline,"uppy-size--md":i.containerWidth>Pu,"uppy-size--lg":i.containerWidth>ty,"uppy-size--xl":i.containerWidth>ey,"uppy-size--height-md":i.containerHeight>iy,"uppy-Dashboard--isAddFilesPanelVisible":i.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":i.areInsidesReadyToBeVisible,"uppy-Dashboard--singleFile":i.singleFileFullScreen&&t&&r}),a=1;i.containerWidth>ey?a=5:i.containerWidth>ty?a=4:i.containerWidth>Pu&&(a=3);let s=i.showSelectedFiles&&!e,l=i.recoveredState?Object.keys(i.recoveredState.files).length:null,c=i.files?Object.keys(i.files).filter(g=>i.files[g].isGhost).length:0,d=()=>c>0?i.i18n("recoveredXFiles",{smart_count:c}):i.i18n("recoveredAllFiles");return p("div",{className:o,"data-uppy-theme":i.theme,"data-uppy-num-acquirers":i.acquirers.length,"data-uppy-drag-drop-supported":!i.disableLocalFiles&&Lo(),"aria-hidden":i.inline?"false":i.isHidden,"aria-disabled":i.disabled,"aria-label":i.inline?i.i18n("dashboardTitle"):i.i18n("dashboardWindowTitle"),onPaste:i.handlePaste,onDragOver:i.handleDragOver,onDragLeave:i.handleDragLeave,onDrop:i.handleDrop},p("div",{"aria-hidden":"true",className:"uppy-Dashboard-overlay",tabIndex:-1,onClick:i.handleClickOutside}),p("div",{className:"uppy-Dashboard-inner","aria-modal":!i.inline&&"true",role:i.inline?void 0:"dialog",style:{width:i.inline&&i.width?i.width:"",height:i.inline&&i.height?i.height:""}},i.inline?null:p("button",{className:"uppy-u-reset uppy-Dashboard-close",type:"button","aria-label":i.i18n("closeModal"),title:i.i18n("closeModal"),onClick:i.closeModal},p("span",{"aria-hidden":"true"},"\xD7")),p("div",{className:"uppy-Dashboard-innerWrap"},p("div",{className:"uppy-Dashboard-dropFilesHereHint"},i.i18n("dropHint")),s&&p(K0,i),l&&p("div",{className:"uppy-Dashboard-serviceMsg"},p("svg",{className:"uppy-Dashboard-serviceMsg-icon","aria-hidden":"true",focusable:"false",width:"21",height:"16",viewBox:"0 0 24 19"},p("g",{transform:"translate(0 -1)",fill:"none",fillRule:"evenodd"},p("path",{d:"M12.857 1.43l10.234 17.056A1 1 0 0122.234 20H1.766a1 1 0 01-.857-1.514L11.143 1.429a1 1 0 011.714 0z",fill:"#FFD300"}),p("path",{fill:"#000",d:"M11 6h2l-.3 8h-1.4z"}),p("circle",{fill:"#000",cx:"12",cy:"17",r:"1"}))),p("strong",{className:"uppy-Dashboard-serviceMsg-title"},i.i18n("sessionRestored")),p("div",{className:"uppy-Dashboard-serviceMsg-text"},d())),s?p(wu,{id:i.id,i18n:i.i18n,uppy:i.uppy,files:i.files,resumableUploads:i.resumableUploads,hideRetryButton:i.hideRetryButton,hidePauseResumeButton:i.hidePauseResumeButton,hideCancelButton:i.hideCancelButton,showLinkToFileUploadResult:i.showLinkToFileUploadResult,showRemoveButtonAfterComplete:i.showRemoveButtonAfterComplete,metaFields:i.metaFields,toggleFileCard:i.toggleFileCard,handleRequestThumbnail:i.handleRequestThumbnail,handleCancelThumbnail:i.handleCancelThumbnail,recoveredState:i.recoveredState,individualCancellation:i.individualCancellation,openFileEditor:i.openFileEditor,canEditFile:i.canEditFile,toggleAddFilesPanel:i.toggleAddFilesPanel,isSingleFile:t,itemsPerRow:a,containerWidth:i.containerWidth,containerHeight:i.containerHeight}):p(Ys,{i18n:i.i18n,i18nArray:i.i18nArray,acquirers:i.acquirers,handleInputChange:i.handleInputChange,maxNumberOfFiles:i.maxNumberOfFiles,allowedFileTypes:i.allowedFileTypes,showNativePhotoCameraButton:i.showNativePhotoCameraButton,showNativeVideoCameraButton:i.showNativeVideoCameraButton,nativeCameraFacingMode:i.nativeCameraFacingMode,showPanel:i.showPanel,activePickerPanel:i.activePickerPanel,disableLocalFiles:i.disableLocalFiles,fileManagerSelectionType:i.fileManagerSelectionType,note:i.note,proudlyDisplayPoweredByUppy:i.proudlyDisplayPoweredByUppy}),p(Vo,null,i.showAddFilesPanel?p($0,Cr({key:"AddFiles"},i,{isSizeMD:n})):null),p(Vo,null,i.fileCardFor?p(Su,Cr({key:"FileCard"},i)):null),p(Vo,null,i.activePickerPanel?p(G0,Cr({key:"Picker"},i)):null),p(Vo,null,i.showFileEditor?p(Y0,Cr({key:"Editor"},i)):null),p("div",{className:"uppy-Dashboard-progressindicators"},i.progressindicators.map(g=>i.uppy.getPlugin(g.id).render(i.state))))))}var ry={strings:{closeModal:"Close Modal",addMoreFiles:"Add more files",addingMoreFiles:"Adding more files",importFrom:"Import from %{name}",dashboardWindowTitle:"Uppy Dashboard Window (Press escape to close)",dashboardTitle:"Uppy Dashboard",copyLinkToClipboardSuccess:"Link copied to clipboard.",copyLinkToClipboardFallback:"Copy the URL below",copyLink:"Copy link",back:"Back",removeFile:"Remove file",editFile:"Edit file",editImage:"Edit image",editing:"Editing %{file}",error:"Error",finishEditingFile:"Finish editing file",saveChanges:"Save changes",myDevice:"My Device",dropHint:"Drop your files here",uploadComplete:"Upload complete",uploadPaused:"Upload paused",resumeUpload:"Resume upload",pauseUpload:"Pause upload",retryUpload:"Retry upload",cancelUpload:"Cancel upload",xFilesSelected:{0:"%{smart_count} file selected",1:"%{smart_count} files selected"},uploadingXFiles:{0:"Uploading %{smart_count} file",1:"Uploading %{smart_count} files"},processingXFiles:{0:"Processing %{smart_count} file",1:"Processing %{smart_count} files"},poweredBy:"Powered by %{uppy}",addMore:"Add more",editFileWithFilename:"Edit file %{file}",save:"Save",cancel:"Cancel",dropPasteFiles:"Drop files here or %{browseFiles}",dropPasteFolders:"Drop files here or %{browseFolders}",dropPasteBoth:"Drop files here, %{browseFiles} or %{browseFolders}",dropPasteImportFiles:"Drop files here, %{browseFiles} or import from:",dropPasteImportFolders:"Drop files here, %{browseFolders} or import from:",dropPasteImportBoth:"Drop files here, %{browseFiles}, %{browseFolders} or import from:",importFiles:"Import files from:",browseFiles:"browse files",browseFolders:"browse folders",recoveredXFiles:{0:"We could not fully recover 1 file. Please re-select it and resume the upload.",1:"We could not fully recover %{smart_count} files. Please re-select them and resume the upload."},recoveredAllFiles:"We restored all files. You can now resume the upload.",sessionRestored:"Session restored",reSelect:"Re-select",missingRequiredMetaFields:{0:"Missing required meta field: %{fields}.",1:"Missing required meta fields: %{fields}."},takePictureBtn:"Take Picture",recordVideoBtn:"Record Video"}};function we(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var SE=0;function ut(i){return"__private_"+SE+++"_"+i}var PE={version:"4.3.1"},Du=du.default||du,oy=9,EE=27;function ay(){let i={};return i.promise=new Promise((e,t)=>{i.resolve=e,i.reject=t}),i}var DE={target:"body",metaFields:[],thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:No,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},On=ut("disabledNodes"),Hi=ut("generateLargeThumbnailIfSingleFile"),Uo=ut("openFileEditorWhenFilesAdded"),Fn=ut("attachRenderFunctionToTarget"),ku=ut("isTargetSupported"),Tu=ut("getAcquirers"),Iu=ut("getProgressIndicators"),ji=ut("getEditors"),Ou=ut("addSpecifiedPluginsFromOptions"),Fu=ut("autoDiscoverPlugins"),Rn=ut("addSupportedPluginIfNoTarget"),Wo=ut("getStatusBarOpts"),$o=ut("getThumbnailGeneratorOpts"),Ru=ut("getInformerOpts"),qo=ut("getStatusBarId"),Go=ut("getThumbnailGeneratorId"),Mu=ut("getInformerId"),Mn=class extends qt{constructor(e,t){var n,r,o;let a=(n=t?.autoOpen)!=null?n:null;super(e,D(v(v({},DE),t),{autoOpen:a})),Object.defineProperty(this,Mu,{value:RE}),Object.defineProperty(this,Go,{value:FE}),Object.defineProperty(this,qo,{value:OE}),Object.defineProperty(this,Ru,{value:IE}),Object.defineProperty(this,$o,{value:TE}),Object.defineProperty(this,Wo,{value:kE}),Object.defineProperty(this,On,{writable:!0,value:void 0}),this.modalName=`uppy-Dashboard-${nn()}`,this.superFocus=pu(),this.ifFocusedOnUppyRecently=!1,this.removeTarget=s=>{let c=this.getPluginState().targets.filter(d=>d.id!==s.id);this.setPluginState({targets:c})},this.addTarget=s=>{let l=s.id||s.constructor.name,c=s.title||l,d=s.type;if(d!=="acquirer"&&d!=="progressindicator"&&d!=="editor")return this.uppy.log("Dashboard: can only be targeted by plugins of types: acquirer, progressindicator, editor","error"),null;let u={id:l,name:c,type:d},h=this.getPluginState().targets.slice();return h.push(u),this.setPluginState({targets:h}),this.el},this.hideAllPanels=()=>{var s;let l=this.getPluginState(),c={activePickerPanel:void 0,showAddFilesPanel:!1,activeOverlayType:null,fileCardFor:null,showFileEditor:!1};l.activePickerPanel===c.activePickerPanel&&l.showAddFilesPanel===c.showAddFilesPanel&&l.showFileEditor===c.showFileEditor&&l.activeOverlayType===c.activeOverlayType||(this.setPluginState(c),this.uppy.emit("dashboard:close-panel",(s=l.activePickerPanel)==null?void 0:s.id))},this.showPanel=s=>{let{targets:l}=this.getPluginState(),c=l.find(d=>d.type==="acquirer"&&d.id===s);this.setPluginState({activePickerPanel:c,activeOverlayType:"PickerPanel"}),this.uppy.emit("dashboard:show-panel",s)},this.canEditFile=s=>{let{targets:l}=this.getPluginState();return we(this,ji)[ji](l).some(d=>this.uppy.getPlugin(d.id).canEditFile(s))},this.openFileEditor=s=>{let{targets:l}=this.getPluginState(),c=we(this,ji)[ji](l);this.setPluginState({showFileEditor:!0,fileCardFor:s.id||null,activeOverlayType:"FileEditor"}),c.forEach(d=>{this.uppy.getPlugin(d.id).selectFile(s)})},this.closeFileEditor=()=>{let{metaFields:s}=this.getPluginState();s&&s.length>0?this.setPluginState({showFileEditor:!1,activeOverlayType:"FileCard"}):this.setPluginState({showFileEditor:!1,fileCardFor:null,activeOverlayType:"AddFiles"})},this.saveFileEditor=()=>{let{targets:s}=this.getPluginState();we(this,ji)[ji](s).forEach(c=>{this.uppy.getPlugin(c.id).save()}),this.closeFileEditor()},this.openModal=()=>{let{promise:s,resolve:l}=ay();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 c=()=>{this.setPluginState({isHidden:!1}),this.el.removeEventListener("animationend",c,!1),l()};this.el.addEventListener("animationend",c,!1)}else this.setPluginState({isHidden:!1}),l();return this.opts.browserBackButtonClose&&this.updateBrowserHistory(),document.addEventListener("keydown",this.handleKeyDownInModal),this.uppy.emit("dashboard:modal-open"),s},this.closeModal=s=>{var l;let c=(l=s?.manualClose)!=null?l:!0,{isHidden:d,isClosing:u}=this.getPluginState();if(d||u)return;let{promise:g,resolve:h}=ay();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),h()};this.el.addEventListener("animationend",E,!1)}else this.setPluginState({isHidden:!0}),this.superFocus.cancel(),this.savedActiveElement.focus(),h();if(document.removeEventListener("keydown",this.handleKeyDownInModal),c&&this.opts.browserBackButtonClose){var _;(_=history.state)!=null&&_[this.modalName]&&history.back()}return this.uppy.emit("dashboard:modal-closed"),g},this.isModalOpen=()=>!this.getPluginState().isHidden||!1,this.requestCloseModal=()=>this.opts.onRequestCloseModal?this.opts.onRequestCloseModal():this.closeModal(),this.setDarkModeCapability=s=>{let{capabilities:l}=this.uppy.getState();this.uppy.setState({capabilities:D(v({},l),{darkMode:s})})},this.handleSystemDarkModeChange=s=>{let l=s.matches;this.uppy.log(`[Dashboard] Dark mode is ${l?"on":"off"}`),this.setDarkModeCapability(l)},this.toggleFileCard=(s,l)=>{let c=this.uppy.getFile(l);s?this.uppy.emit("dashboard:file-edit-start",c):this.uppy.emit("dashboard:file-edit-complete",c),this.setPluginState({fileCardFor:s?l:null,activeOverlayType:s?"FileCard":null})},this.toggleAddFilesPanel=s=>{this.setPluginState({showAddFilesPanel:s,activeOverlayType:s?"AddFiles":null})},this.addFiles=s=>{let l=s.map(c=>({source:this.id,name:c.name,type:c.type,data:c,meta:{relativePath:c.relativePath||c.webkitRelativePath||null}}));try{this.uppy.addFiles(l)}catch(c){this.uppy.log(c)}},this.startListeningToResize=()=>{this.resizeObserver=new ResizeObserver(s=>{let l=s[0],{width:c,height:d}=l.contentRect;this.setPluginState({containerWidth:c,containerHeight:d,areInsidesReadyToBeVisible:!0})}),this.resizeObserver.observe(this.el.querySelector(".uppy-Dashboard-inner")),this.makeDashboardInsidesVisibleAnywayTimeout=setTimeout(()=>{let s=this.getPluginState(),l=!this.opts.inline&&s.isHidden;!s.areInsidesReadyToBeVisible&&!l&&(this.uppy.log("[Dashboard] resize event didn\u2019t fire on time: defaulted to mobile layout","warning"),this.setPluginState({areInsidesReadyToBeVisible:!0}))},1e3)},this.stopListeningToResize=()=>{this.resizeObserver.disconnect(),clearTimeout(this.makeDashboardInsidesVisibleAnywayTimeout)},this.recordIfFocusedOnUppyRecently=s=>{this.el.contains(s.target)?this.ifFocusedOnUppyRecently=!0:(this.ifFocusedOnUppyRecently=!1,this.superFocus.cancel())},this.disableInteractiveElements=s=>{var l;let c=["a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])",'[role="button"]:not([disabled])'],d=(l=we(this,On)[On])!=null?l:Si(this.el.querySelectorAll(c)).filter(u=>!u.classList.contains("uppy-Dashboard-close"));for(let u of d)u.tagName==="A"?u.setAttribute("aria-disabled",s):u.disabled=s;s?we(this,On)[On]=d:we(this,On)[On]=null,this.dashboardIsDisabled=s},this.updateBrowserHistory=()=>{var s;(s=history.state)!=null&&s[this.modalName]||history.pushState(D(v({},history.state),{[this.modalName]:!0}),""),window.addEventListener("popstate",this.handlePopState,!1)},this.handlePopState=s=>{var l;this.isModalOpen()&&(!s.state||!s.state[this.modalName])&&this.closeModal({manualClose:!1}),!this.isModalOpen()&&(l=s.state)!=null&&l[this.modalName]&&history.back()},this.handleKeyDownInModal=s=>{s.keyCode===EE&&this.requestCloseModal(),s.keyCode===oy&&uu(s,this.getPluginState().activeOverlayType,this.el)},this.handleClickOutside=()=>{this.opts.closeModalOnClickOutside&&this.requestCloseModal()},this.handlePaste=s=>{this.uppy.iteratePlugins(c=>{c.type==="acquirer"&&(c.handleRootPaste==null||c.handleRootPaste(s))});let l=Si(s.clipboardData.files);l.length>0&&(this.uppy.log("[Dashboard] Files pasted"),this.addFiles(l))},this.handleInputChange=s=>{s.preventDefault();let l=Si(s.currentTarget.files||[]);l.length>0&&(this.uppy.log("[Dashboard] Files selected through input"),this.addFiles(l))},this.handleDragOver=s=>{s.preventDefault(),s.stopPropagation();let l=()=>{let g=!0;return this.uppy.iteratePlugins(h=>{h.canHandleRootDrop!=null&&h.canHandleRootDrop(s)&&(g=!0)}),g},c=()=>{let{types:g}=s.dataTransfer;return g.some(h=>h==="Files")},d=l(),u=c();if(!d&&!u||this.opts.disabled||this.opts.disableLocalFiles&&(u||!d)||!this.uppy.getState().allowNewUpload){s.dataTransfer.dropEffect="none";return}s.dataTransfer.dropEffect="copy",this.setPluginState({isDraggingOver:!0}),this.opts.onDragOver(s)},this.handleDragLeave=s=>{s.preventDefault(),s.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.opts.onDragLeave(s)},this.handleDrop=s=>B(this,null,function*(){s.preventDefault(),s.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins(u=>{u.type==="acquirer"&&(u.handleRootDrop==null||u.handleRootDrop(s))});let l=!1,c=u=>{this.uppy.log(u,"error"),l||(this.uppy.info(u.message,"error"),l=!0)};this.uppy.log("[Dashboard] Processing dropped files");let d=yield To(s.dataTransfer,{logDropError:c});d.length>0&&(this.uppy.log("[Dashboard] Files dropped"),this.addFiles(d)),this.opts.onDrop(s)}),this.handleRequestThumbnail=s=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:request",s)},this.handleCancelThumbnail=s=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:cancel",s)},this.handleKeyDownInInline=s=>{s.keyCode===oy&&z0(s,this.getPluginState().activeOverlayType,this.el)},this.handlePasteOnBody=s=>{this.el.contains(document.activeElement)&&this.handlePaste(s)},this.handleComplete=s=>{let{failed:l}=s;this.opts.closeAfterFinish&&!(l!=null&&l.length)&&this.requestCloseModal()},this.handleCancelRestore=()=>{this.uppy.emit("restore-canceled")},Object.defineProperty(this,Hi,{writable:!0,value:()=>{if(this.opts.disableThumbnailGenerator)return;let s=600,l=this.uppy.getFiles();if(l.length===1){let c=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);c?.setOptions({thumbnailWidth:s});let d=D(v({},l[0]),{preview:void 0});c?.requestThumbnail(d).then(()=>{c?.setOptions({thumbnailWidth:this.opts.thumbnailWidth})})}}}),Object.defineProperty(this,Uo,{writable:!0,value:s=>{let l=s[0],{metaFields:c}=this.getPluginState(),d=c&&c.length>0,u=this.canEditFile(l);d&&this.opts.autoOpen==="metaEditor"?this.toggleFileCard(!0,l.id):u&&this.opts.autoOpen==="imageEditor"&&this.openFileEditor(l)}}),this.initEvents=()=>{if(this.opts.trigger&&!this.opts.inline){let s=Ud(this.opts.trigger);s?s.forEach(l=>l.addEventListener("click",this.openModal)):this.uppy.log("Dashboard modal trigger not found. Make sure `trigger` is set in Dashboard options, unless you are planning to call `dashboard.openModal()` method yourself","warning")}this.startListeningToResize(),document.addEventListener("paste",this.handlePasteOnBody),this.uppy.on("plugin-added",we(this,Rn)[Rn]),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",we(this,Hi)[Hi]),this.uppy.on("file-removed",we(this,Hi)[Hi]),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",we(this,Uo)[Uo])},this.removeEvents=()=>{let s=Ud(this.opts.trigger);!this.opts.inline&&s&&s.forEach(l=>l.removeEventListener("click",this.openModal)),this.stopListeningToResize(),document.removeEventListener("paste",this.handlePasteOnBody),window.removeEventListener("popstate",this.handlePopState,!1),this.uppy.off("plugin-added",we(this,Rn)[Rn]),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",we(this,Hi)[Hi]),this.uppy.off("file-removed",we(this,Hi)[Hi]),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",we(this,Uo)[Uo])},this.superFocusOnEachUpdate=()=>{let s=this.el.contains(document.activeElement),l=document.activeElement===document.body||document.activeElement===null,c=this.uppy.getState().info.length===0,d=!this.opts.inline;c&&(d||s||l&&this.ifFocusedOnUppyRecently)?this.superFocus(this.el,this.getPluginState().activeOverlayType):this.superFocus.cancel()},this.afterUpdate=()=>{if(this.opts.disabled&&!this.dashboardIsDisabled){this.disableInteractiveElements(!0);return}!this.opts.disabled&&this.dashboardIsDisabled&&this.disableInteractiveElements(!1),this.superFocusOnEachUpdate()},this.saveFileCard=(s,l)=>{this.uppy.setFileMeta(l,s),this.toggleFileCard(!1,l)},Object.defineProperty(this,Fn,{writable:!0,value:s=>{let l=this.uppy.getPlugin(s.id);return D(v({},s),{icon:l.icon||this.opts.defaultPickerIcon,render:l.render})}}),Object.defineProperty(this,ku,{writable:!0,value:s=>{let l=this.uppy.getPlugin(s.id);return typeof l.isSupported!="function"?!0:l.isSupported()}}),Object.defineProperty(this,Tu,{writable:!0,value:Du(s=>s.filter(l=>l.type==="acquirer"&&we(this,ku)[ku](l)).map(we(this,Fn)[Fn]))}),Object.defineProperty(this,Iu,{writable:!0,value:Du(s=>s.filter(l=>l.type==="progressindicator").map(we(this,Fn)[Fn]))}),Object.defineProperty(this,ji,{writable:!0,value:Du(s=>s.filter(l=>l.type==="editor").map(we(this,Fn)[Fn]))}),this.render=s=>{let l=this.getPluginState(),{files:c,capabilities:d,allowNewUpload:u}=s,{newFiles:g,uploadStartedFiles:h,completeFiles:_,erroredFiles:E,inProgressFiles:N,inProgressNotPausedFiles:M,processingFiles:U,isUploadStarted:de,isAllComplete:oe,isAllPaused:ee}=this.uppy.getObjectOfFilesPerState(),b=we(this,Tu)[Tu](l.targets),w=we(this,Iu)[Iu](l.targets),S=we(this,ji)[ji](l.targets),A;return this.opts.theme==="auto"?A=d.darkMode?"dark":"light":A=this.opts.theme,["files","folders","both"].indexOf(this.opts.fileManagerSelectionType)<0&&(this.opts.fileManagerSelectionType="files",console.warn(`Unsupported option for "fileManagerSelectionType". Using default of "${this.opts.fileManagerSelectionType}".`)),Eu({state:s,isHidden:l.isHidden,files:c,newFiles:g,uploadStartedFiles:h,completeFiles:_,erroredFiles:E,inProgressFiles:N,inProgressNotPausedFiles:M,processingFiles:U,isUploadStarted:de,isAllComplete:oe,isAllPaused:ee,totalFileCount:Object.keys(c).length,totalProgress:s.totalProgress,allowNewUpload:u,acquirers:b,theme:A,disabled:this.opts.disabled,disableLocalFiles:this.opts.disableLocalFiles,direction:this.opts.direction,activePickerPanel:l.activePickerPanel,showFileEditor:l.showFileEditor,saveFileEditor:this.saveFileEditor,closeFileEditor:this.closeFileEditor,disableInteractiveElements:this.disableInteractiveElements,animateOpenClose:this.opts.animateOpenClose,isClosing:l.isClosing,progressindicators:w,editors:S,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:s.recoveredState,metaFields:l.metaFields,resumableUploads:d.resumableUploads||!1,individualCancellation:d.individualCancellation,isMobileDevice:d.isMobileDevice,fileCardFor:l.fileCardFor,toggleFileCard:this.toggleFileCard,toggleAddFilesPanel:this.toggleAddFilesPanel,showAddFilesPanel:l.showAddFilesPanel,saveFileCard:this.saveFileCard,openFileEditor:this.openFileEditor,canEditFile:this.canEditFile,width:this.opts.width,height:this.opts.height,showLinkToFileUploadResult:this.opts.showLinkToFileUploadResult,fileManagerSelectionType:this.opts.fileManagerSelectionType,proudlyDisplayPoweredByUppy:this.opts.proudlyDisplayPoweredByUppy,hideCancelButton:this.opts.hideCancelButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,showRemoveButtonAfterComplete:this.opts.showRemoveButtonAfterComplete,containerWidth:l.containerWidth,containerHeight:l.containerHeight,areInsidesReadyToBeVisible:l.areInsidesReadyToBeVisible,parentElement:this.el,allowedFileTypes:this.uppy.opts.restrictions.allowedFileTypes,maxNumberOfFiles:this.uppy.opts.restrictions.maxNumberOfFiles,requiredMetaFields:this.uppy.opts.restrictions.requiredMetaFields,showSelectedFiles:this.opts.showSelectedFiles,showNativePhotoCameraButton:this.opts.showNativePhotoCameraButton,showNativeVideoCameraButton:this.opts.showNativeVideoCameraButton,nativeCameraFacingMode:this.opts.nativeCameraFacingMode,singleFileFullScreen:this.opts.singleFileFullScreen,handleCancelRestore:this.handleCancelRestore,handleRequestThumbnail:this.handleRequestThumbnail,handleCancelThumbnail:this.handleCancelThumbnail,isDraggingOver:l.isDraggingOver,handleDragOver:this.handleDragOver,handleDragLeave:this.handleDragLeave,handleDrop:this.handleDrop})},Object.defineProperty(this,Ou,{writable:!0,value:()=>{let{plugins:s}=this.opts;s.forEach(l=>{let c=this.uppy.getPlugin(l);c?c.mount(this,c):this.uppy.log(`[Uppy] Dashboard could not find plugin '${l}', make sure to uppy.use() the plugins you are specifying`,"warning")})}}),Object.defineProperty(this,Fu,{writable:!0,value:()=>{this.uppy.iteratePlugins(we(this,Rn)[Rn])}}),Object.defineProperty(this,Rn,{writable:!0,value:s=>{var l;let c=["acquirer","editor"];s&&!((l=s.opts)!=null&&l.target)&&c.includes(s.type)&&(this.getPluginState().targets.some(u=>s.id===u.id)||s.mount(this,s))}}),this.install=()=>{this.setPluginState({isHidden:!0,fileCardFor:null,activeOverlayType:null,showAddFilesPanel:!1,activePickerPanel:void 0,showFileEditor:!1,metaFields:this.opts.metaFields,targets:[],areInsidesReadyToBeVisible:!1,isDraggingOver:!1});let{inline:s,closeAfterFinish:l}=this.opts;if(s&&l)throw new Error("[Dashboard] `closeAfterFinish: true` cannot be used on an inline Dashboard, because an inline Dashboard cannot be closed at all. Either set `inline: false`, or disable the `closeAfterFinish` option.");let{allowMultipleUploads:c,allowMultipleUploadBatches:d}=this.uppy.opts;(c||d)&&l&&this.uppy.log("[Dashboard] When using `closeAfterFinish`, we recommended setting the `allowMultipleUploadBatches` option to `false` in the Uppy constructor. See https://uppy.io/docs/uppy/#allowMultipleUploads-true","warning");let{target:u}=this.opts;u&&this.mount(u,this),this.opts.disableStatusBar||this.uppy.use(_n,v({id:we(this,qo)[qo](),target:this},we(this,Wo)[Wo]())),this.opts.disableInformer||this.uppy.use(wn,v({id:we(this,Mu)[Mu](),target:this},we(this,Ru)[Ru]())),this.opts.disableThumbnailGenerator||this.uppy.use(vr,v({id:we(this,Go)[Go]()},we(this,$o)[$o]())),this.darkModeMediaQuery=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;let g=this.darkModeMediaQuery?this.darkModeMediaQuery.matches:!1;if(this.uppy.log(`[Dashboard] Dark mode is ${g?"on":"off"}`),this.setDarkModeCapability(g),this.opts.theme==="auto"){var h;(h=this.darkModeMediaQuery)==null||h.addListener(this.handleSystemDarkModeChange)}we(this,Ou)[Ou](),we(this,Fu)[Fu](),this.initEvents()},this.uninstall=()=>{if(!this.opts.disableInformer){let c=this.uppy.getPlugin(`${this.id}:Informer`);c&&this.uppy.removePlugin(c)}if(!this.opts.disableStatusBar){let c=this.uppy.getPlugin(`${this.id}:StatusBar`);c&&this.uppy.removePlugin(c)}if(!this.opts.disableThumbnailGenerator){let c=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);c&&this.uppy.removePlugin(c)}let{plugins:s}=this.opts;if(s.forEach(c=>{let d=this.uppy.getPlugin(c);d&&d.unmount()}),this.opts.theme==="auto"){var l;(l=this.darkModeMediaQuery)==null||l.removeListener(this.handleSystemDarkModeChange)}this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.unmount(),this.removeEvents()},this.id=this.opts.id||"Dashboard",this.title="Dashboard",this.type="orchestrator",this.defaultLocale=ry,this.opts.doneButtonHandler===void 0&&(this.opts.doneButtonHandler=()=>{this.uppy.clear(),this.requestCloseModal()}),(o=(r=this.opts).onRequestCloseModal)!=null||(r.onRequestCloseModal=()=>this.closeModal()),this.i18nInit()}setOptions(e){var t,n;super.setOptions(e),(t=this.uppy.getPlugin(we(this,qo)[qo]()))==null||t.setOptions(we(this,Wo)[Wo]()),(n=this.uppy.getPlugin(we(this,Go)[Go]()))==null||n.setOptions(we(this,$o)[$o]())}};function kE(){let{hideUploadButton:i,hideRetryButton:e,hidePauseResumeButton:t,hideCancelButton:n,showProgressDetails:r,hideProgressAfterFinish:o,locale:a,doneButtonHandler:s}=this.opts;return{hideUploadButton:i,hideRetryButton:e,hidePauseResumeButton:t,hideCancelButton:n,showProgressDetails:r,hideAfterFinish:o,locale:a,doneButtonHandler:s}}function TE(){let{thumbnailWidth:i,thumbnailHeight:e,thumbnailType:t,waitForThumbnailsBeforeUpload:n}=this.opts;return{thumbnailWidth:i,thumbnailHeight:e,thumbnailType:t,waitForThumbnailsBeforeUpload:n,lazy:!n}}function IE(){return{}}function OE(){return`${this.id}:StatusBar`}function FE(){return`${this.id}:ThumbnailGenerator`}function RE(){return`${this.id}:Informer`}Mn.VERSION=PE.version;var ME={version:"4.2.1"},AE={fixed:!1,hideAfterFinish:!0},Sr=class extends qt{constructor(e,t){super(e,v(v({},AE),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,n=(t===0||t===100)&&this.opts.hideAfterFinish;return p("div",{className:"uppy uppy-ProgressBar",style:{position:this.opts.fixed?"fixed":"initial"},"aria-hidden":n},p("div",{className:"uppy-ProgressBar-inner",style:{width:`${t}%`}}),p("div",{className:"uppy-ProgressBar-percentage"},t))}install(){let{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}};Sr.VERSION=ME.version;var sy={strings:{dropHereOr:"Drop here or %{browse}",browse:"browse"}};var BE={version:"4.1.1"},NE={inputName:"files[]",width:"100%",height:"100%"},Pr=class i extends qt{constructor(e,t){super(e,v(v({},NE),t)),this.isDragDropSupported=Lo(),this.addFiles=n=>{let r=n.map(o=>({source:this.id,name:o.name,type:o.type,data:o,meta:{relativePath:o.relativePath||null}}));try{this.uppy.addFiles(r)}catch(o){this.uppy.log(o)}},this.onInputChange=n=>{let r=Si(n.currentTarget.files||[]);r.length>0&&(this.uppy.log("[DragDrop] Files selected through input"),this.addFiles(r)),n.currentTarget.value=""},this.handleDragOver=n=>{var r,o;n.preventDefault(),n.stopPropagation();let{types:a}=n.dataTransfer,s=a.some(c=>c==="Files"),{allowNewUpload:l}=this.uppy.getState();if(!s||!l){n.dataTransfer.dropEffect="none";return}n.dataTransfer.dropEffect="copy",this.setPluginState({isDraggingOver:!0}),(r=(o=this.opts).onDragOver)==null||r.call(o,n)},this.handleDragLeave=n=>{var r,o;n.preventDefault(),n.stopPropagation(),this.setPluginState({isDraggingOver:!1}),(r=(o=this.opts).onDragLeave)==null||r.call(o,n)},this.handleDrop=n=>B(this,null,function*(){var r,o;n.preventDefault(),n.stopPropagation(),this.setPluginState({isDraggingOver:!1});let a=l=>{this.uppy.log(l,"error")},s=yield To(n.dataTransfer,{logDropError:a});s.length>0&&(this.uppy.log("[DragDrop] Files dropped"),this.addFiles(s)),(r=(o=this.opts).onDrop)==null||r.call(o,n)}),this.type="acquirer",this.id=this.opts.id||"DragDrop",this.title="Drag & Drop",this.defaultLocale=sy,this.i18nInit()}renderHiddenFileInput(){var e;let{restrictions:t}=this.uppy.opts;return p("input",{className:"uppy-DragDrop-input",type:"file",hidden:!0,ref:n=>{this.fileInputRef=n},name:this.opts.inputName,multiple:t.maxNumberOfFiles!==1,accept:(e=t.allowedFileTypes)==null?void 0:e.join(", "),onChange:this.onInputChange})}static renderArrowSvg(){return p("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-DragDrop-arrow",width:"16",height:"16",viewBox:"0 0 16 16"},p("path",{d:"M11 10V0H5v10H2l6 6 6-6h-3zm0 0",fillRule:"evenodd"}))}renderLabel(){return p("div",{className:"uppy-DragDrop-label"},this.i18nArray("dropHereOr",{browse:p("span",{className:"uppy-DragDrop-browse"},this.i18n("browse"))}))}renderNote(){return p("span",{className:"uppy-DragDrop-note"},this.opts.note)}render(){let e=`uppy-u-reset
|
|
27
|
+
uppy-DragDrop-container
|
|
28
|
+
${this.isDragDropSupported?"uppy-DragDrop--isDragDropSupported":""}
|
|
29
|
+
${this.getPluginState().isDraggingOver?"uppy-DragDrop--isDraggingOver":""}
|
|
30
|
+
`,t={width:this.opts.width,height:this.opts.height};return p("button",{type:"button",className:e,style:t,onClick:()=>this.fileInputRef.click(),onDragOver:this.handleDragOver,onDragLeave:this.handleDragLeave,onDrop:this.handleDrop},this.renderHiddenFileInput(),p("div",{className:"uppy-DragDrop-inner"},i.renderArrowSvg(),this.renderLabel(),this.renderNote()))}install(){let{target:e}=this.opts;this.setPluginState({isDraggingOver:!1}),e&&this.mount(e,this)}uninstall(){this.unmount()}};Pr.VERSION=BE.version;var Au=class{onMount(e,t){this.options=v(v({},e),this.props),this.uppy.use(t,this.options),this.plugin=this.uppy.getPlugin(this.options.id)}handleChanges(e,t){e.uppy&&this.uppy!==e.uppy.previousValue&&e.uppy.previousValue!==void 0&&(this.uninstall(e.uppy.previousValue),this.uppy.use(t,this.options)),this.options=v(v({},this.options),this.props),this.plugin=this.uppy.getPlugin(this.options.id),e.props&&this.props!==e.props.previousValue&&e.props.previousValue!==void 0&&this.plugin.setOptions(v({},this.options))}uninstall(e=this.uppy){e.removePlugin(this.plugin)}},ly=(()=>{class i extends Au{constructor(t){super(),this.el=t,this.uppy=new dr,this.props={}}ngOnInit(){this.onMount({id:"angular:Dashboard",inline:!0,target:this.el.nativeElement},Mn)}ngOnChanges(t){this.handleChanges(t,Mn)}ngOnDestroy(){this.uninstall()}static{this.\u0275fac=function(n){return new(n||i)(He(Et))}}static{this.\u0275cmp=fe({type:i,selectors:[["uppy-dashboard"]],inputs:{uppy:"uppy",props:"props"},features:[pl,gi],decls:0,vars:0,template:function(n,r){},encapsulation:2,changeDetection:0})}}return i})();var cy=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=Nt({type:i})}static{this.\u0275inj=Bt({})}}return i})();function ce(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var LE=0;function Ot(i){return"__private_"+LE+++"_"+i}function HE(i){return new Error("Cancelled",{cause:i})}function dy(i){if(i!=null){var e;let t=()=>this.abort(i.reason);i.addEventListener("abort",t,{once:!0});let n=()=>{i.removeEventListener("abort",t)};(e=this.then)==null||e.call(this,n,n)}return this}var Qt=Ot("activeRequests"),wt=Ot("queuedHandlers"),Kt=Ot("paused"),An=Ot("pauseTimer"),_t=Ot("downLimit"),Bn=Ot("upperLimit"),Vi=Ot("rateLimitingTimer"),Xo=Ot("call"),Ui=Ot("queueNext"),zu=Ot("next"),Bu=Ot("queue"),Lu=Ot("dequeue"),Nu=Ot("resume"),Nn=Ot("increaseLimit"),Ks=class{constructor(e){Object.defineProperty(this,Lu,{value:$E}),Object.defineProperty(this,Bu,{value:WE}),Object.defineProperty(this,zu,{value:UE}),Object.defineProperty(this,Ui,{value:VE}),Object.defineProperty(this,Xo,{value:jE}),Object.defineProperty(this,Qt,{writable:!0,value:0}),Object.defineProperty(this,wt,{writable:!0,value:[]}),Object.defineProperty(this,Kt,{writable:!0,value:!1}),Object.defineProperty(this,An,{writable:!0,value:void 0}),Object.defineProperty(this,_t,{writable:!0,value:1}),Object.defineProperty(this,Bn,{writable:!0,value:void 0}),Object.defineProperty(this,Vi,{writable:!0,value:void 0}),Object.defineProperty(this,Nu,{writable:!0,value:()=>this.resume()}),Object.defineProperty(this,Nn,{writable:!0,value:()=>{if(ce(this,Kt)[Kt]){ce(this,Vi)[Vi]=setTimeout(ce(this,Nn)[Nn],0);return}ce(this,_t)[_t]=this.limit,this.limit=Math.ceil((ce(this,Bn)[Bn]+ce(this,_t)[_t])/2);for(let t=ce(this,_t)[_t];t<=this.limit;t++)ce(this,Ui)[Ui]();ce(this,Bn)[Bn]-ce(this,_t)[_t]>3?ce(this,Vi)[Vi]=setTimeout(ce(this,Nn)[Nn],2e3):ce(this,_t)[_t]=Math.floor(ce(this,_t)[_t]/2)}}),typeof e!="number"||e===0?this.limit=1/0:this.limit=e}run(e,t){return!ce(this,Kt)[Kt]&&ce(this,Qt)[Qt]<this.limit?ce(this,Xo)[Xo](e):ce(this,Bu)[Bu](e,t)}wrapSyncFunction(e,t){var n=this;return function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];let s=n.run(()=>(e(...o),queueMicrotask(()=>s.done()),()=>{}),t);return{abortOn:dy,abort(){s.abort()}}}}wrapPromiseFunction(e,t){var n=this;return function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];let s,l=new Promise((c,d)=>{s=n.run(()=>{let u,g;try{g=Promise.resolve(e(...o))}catch(h){g=Promise.reject(h)}return g.then(h=>{u?d(u):(s.done(),c(h))},h=>{u?d(u):(s.done(),d(h))}),h=>{u=HE(h)}},t)});return l.abort=c=>{s.abort(c)},l.abortOn=dy,l}}resume(){ce(this,Kt)[Kt]=!1,clearTimeout(ce(this,An)[An]);for(let e=0;e<this.limit;e++)ce(this,Ui)[Ui]()}pause(e){e===void 0&&(e=null),ce(this,Kt)[Kt]=!0,clearTimeout(ce(this,An)[An]),e!=null&&(ce(this,An)[An]=setTimeout(ce(this,Nu)[Nu],e))}rateLimit(e){clearTimeout(ce(this,Vi)[Vi]),this.pause(e),this.limit>1&&Number.isFinite(this.limit)&&(ce(this,Bn)[Bn]=this.limit-1,this.limit=ce(this,_t)[_t],ce(this,Vi)[Vi]=setTimeout(ce(this,Nn)[Nn],e))}get isPaused(){return ce(this,Kt)[Kt]}};function jE(i){ce(this,Qt)[Qt]+=1;let e=!1,t;try{t=i()}catch(n){throw ce(this,Qt)[Qt]-=1,n}return{abort:n=>{e||(e=!0,ce(this,Qt)[Qt]-=1,t?.(n),ce(this,Ui)[Ui]())},done:()=>{e||(e=!0,ce(this,Qt)[Qt]-=1,ce(this,Ui)[Ui]())}}}function VE(){queueMicrotask(()=>ce(this,zu)[zu]())}function UE(){if(ce(this,Kt)[Kt]||ce(this,Qt)[Qt]>=this.limit||ce(this,wt)[wt].length===0)return;let i=ce(this,wt)[wt].shift();if(i==null)throw new Error("Invariant violation: next is null");let e=ce(this,Xo)[Xo](i.fn);i.abort=e.abort,i.done=e.done}function WE(i,e){let t={fn:i,priority:e?.priority||0,abort:()=>{ce(this,Lu)[Lu](t)},done:()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")}},n=ce(this,wt)[wt].findIndex(r=>t.priority>r.priority);return n===-1?ce(this,wt)[wt].push(t):ce(this,wt)[wt].splice(n,0,t),t}function $E(i){let e=ce(this,wt)[wt].indexOf(i);e!==-1&&ce(this,wt)[wt].splice(e,1)}var K4=Symbol("__queue");var Vu=De(io(),1),fy=De(uy(),1);var py={strings:{compressingImages:"Compressing images...",compressedX:"Saved %{size} by compressing images"}};function hy(i,e){if(!{}.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}var qE=0;function GE(i){return"__private_"+qE+++"_"+i}var XE={quality:.6,limit:10},Yo=GE("RateLimitedQueue"),Qs=class extends bn{constructor(e,t){super(e,v(v({},XE),t)),Object.defineProperty(this,Yo,{writable:!0,value:void 0}),this.id=this.opts.id||"Compressor",this.type="modifier",this.defaultLocale=py,hy(this,Yo)[Yo]=new Ks(this.opts.limit),this.i18nInit(),this.prepareUpload=this.prepareUpload.bind(this),this.compress=this.compress.bind(this)}compress(e){return new Promise((t,n)=>{new fy.default(e,D(v({},this.opts),{success:t,error:n}))})}prepareUpload(e){return B(this,null,function*(){let t=0,n=[],r=hy(this,Yo)[Yo].wrapPromiseFunction(a=>B(this,null,function*(){try{let s=yield this.compress(a.data),l=a.data.size-s.size;this.uppy.log(`[Image Compressor] Image ${a.id} compressed by ${(0,Vu.default)(l)}`),t+=l;let{name:c,type:d,size:u}=s,g=xi(c),_=`${xi(a.meta.name).name}.${g.extension}`;this.uppy.setFileState(a.id,D(v(v(v(v({},c&&{name:c}),g.extension&&{extension:g.extension}),d&&{type:d}),u&&{size:u}),{data:s,meta:D(v({},a.meta),{type:d,name:_})})),n.push(a)}catch(s){this.uppy.log(`[Image Compressor] Failed to compress ${a.id}:`,"warning"),this.uppy.log(s,"warning")}})),o=e.map(a=>{var s;let l=this.uppy.getFile(a);return this.uppy.emit("preprocess-progress",l,{mode:"indeterminate",message:this.i18n("compressingImages")}),l.isRemote||(l.data.type||(l.data=l.data.slice(0,l.data.size,l.type)),!((s=l.type)!=null&&s.startsWith("image/")))?Promise.resolve():r(l)});yield Promise.all(o),this.uppy.emit("compressor:complete",n),t>1024&&this.uppy.info(this.i18n("compressedX",{size:(0,Vu.default)(t)}),"info");for(let a of e){let s=this.uppy.getFile(a);this.uppy.emit("preprocess-complete",s)}})}install(){this.uppy.addPreProcessor(this.prepareUpload)}uninstall(){this.uppy.removePreProcessor(this.prepareUpload)}};var gy=De(my(),1);function YE(i,e){if(i&1&&(f(0,"small",5),x(1),m()),i&2){let t=O();y(),I(t.subtitle)}}function KE(i,e){if(i&1&&(f(0,"a",6),ue(1,"i",7),x(2," Download Template "),m()),i&2){let t=O();jn("top-58",t.subtitle),P("href",t.sampleUrl,ia)}}function QE(i,e){if(i&1&&(hl(0),x(1),fl()),i&2){let t=O(2);y(),Ht("- ",t.rowSummary().rowEmpty," empty in the CSV you uploaded")}}function ZE(i,e){if(i&1&&(f(0,"div",4)(1,"h4",8),x(2,"CSV File Content Summary"),m(),ue(3,"hr"),f(4,"p",9),x(5),le(6,QE,2,1,"ng-container",10),m()()),i&2){let t=O();y(5),Ht("",t.rowSummary().rowCount," rows found "),y(),P("ngIf",t.rowSummary().rowEmpty>0)}}var yy=(()=>{class i{static{this.sizes=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"]}static{this.kilobyte=1024}constructor(){this.sampleUrl="",this.subtitle="",this.showSample=!0,this.showSubtitle=!0,this.uppyCoreConfiguration=ul(),this.dashboardPropsConfiguration=ul(),this.fileUploaded=new zt,this.fileUploadComplete=new zt,this.fileRemoved=new zt,this.onParser=new zt,this.multipleFilesUploaded=new zt,this.http=z(am),this.csvParser=z(om),this.rowSummary=q({rowCount:0,rowEmpty:0}),this.file=q(null),this.multipleFiles=q([]),this.uppy=new dr({debug:!0,autoProceed:!0,allowMultipleUploadBatches:!1,restrictions:{allowedFileTypes:[".csv"],maxTotalFileSize:1e6}}).use(Qs,{mimeType:"image/jpeg",convertSize:1/0,convertTypes:["image/png"]}),this.dashboardProps={hideUploadButton:!0,height:350},yl(()=>this.uppy.setOptions(v({},this.uppyCoreConfiguration()))),yl(()=>this.dashboardProps=v(v({},this.dashboardProps),this.dashboardPropsConfiguration())),this.uppy.on("upload",(t,n)=>{let r=n[0]?.data;this.showSample=!1,this.showSubtitle=!1,console.log(t,n,r),this.fileUploaded.emit(r),this.file.set(n[0].data),gy.default.parse(r,{skipEmptyLines:"greedy",header:!0,beforeFirstChunk:o=>{let a=o.split(/\r?\n/).slice(1);return a[a.length-1]===""&&a.pop(),this.rowSummary.update(s=>D(v({},s),{rowCount:a.length})),a.forEach(s=>{s.split(",").every(c=>c==="")&&this.rowSummary.update(c=>D(v({},c),{rowEmpty:c.rowEmpty+1}))}),o},error(o,a){console.log("ERROR",o,a)},complete:(o,a)=>{this.onParser.emit(o.data)}})}),this.uppy.on("complete",t=>{let n=t.successful?.map(o=>({file:o.data,id:o.id}))??[],r=t.successful[0]?.data;this.showSample=!1,this.showSubtitle=!1,console.log(r),this.fileUploadComplete.emit(r),this.multipleFilesUploaded.emit(n),this.file.set(r),this.multipleFiles.set(n)}),this.uppy.on("transloadit:upload",(t,n)=>{console.log(t,n)}),this.uppy.on("transloadit:result",(t,n)=>{console.log(t,n)}),this.uppy.on("file-removed",t=>{this.showSample=!0,this.showSubtitle=!0,this.file.set(null);let r=this.multipleFiles().filter(o=>o.id!=t.id);this.multipleFiles.set(r),this.fileRemoved.emit(t.id),this.rowSummary.set({rowCount:0,rowEmpty:0})})}formatFileSize(t,n=2){if(t===0)return"0 bytes";let r=Math.floor(Math.log(t)/Math.log(i.kilobyte));return`${(t/Math.pow(i.kilobyte,r)).toFixed(n)} ${i.sizes[r]}`}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["POS-uppy"]],inputs:{sampleUrl:"sampleUrl",subtitle:"subtitle",uppyCoreConfiguration:[1,"uppyCoreConfiguration"],dashboardPropsConfiguration:[1,"dashboardPropsConfiguration"]},outputs:{fileUploaded:"fileUploaded",fileUploadComplete:"fileUploadComplete",fileRemoved:"fileRemoved",onParser:"onParser",multipleFilesUploaded:"multipleFilesUploaded"},standalone:!0,features:[_e],decls:5,vars:5,consts:[[1,"position-relative"],[3,"uppy","props"],["class","subtitle position-absolute",4,"ngIf"],["class","sample position-absolute","role","button",3,"top-58","href",4,"ngIf"],["role","alert",1,"alert","alert-warning","d-flex","flex-column","gap-2",2,"margin","1rem 0 0 0"],[1,"subtitle","position-absolute"],["role","button",1,"sample","position-absolute",3,"href"],[1,"fa-solid","fa-download","ms-3"],[1,"alert-heading"],[1,"fs-6","m-0"],[4,"ngIf"]],template:function(n,r){if(n&1&&(f(0,"div",0),ue(1,"uppy-dashboard",1),le(2,YE,2,1,"small",2)(3,KE,3,3,"a",3)(4,ZE,7,2,"div",4),m()),n&2){let o;y(),P("uppy",r.uppy)("props",r.dashboardProps),y(),P("ngIf",r.subtitle&&r.showSubtitle),y(),P("ngIf",r.sampleUrl&&r.showSample),y(),Ce(r.file()&&((o=r.file())==null?null:o.type)==="text/csv"?4:-1)}},dependencies:[cy,ly,ri,Vn],styles:[".uppy-Dashboard-AddFiles-info{display:none!important} .uppy-Dashboard-AddFiles-list{flex:none;flex-direction:row;flex-wrap:wrap;justify-content:center;max-width:600px;margin-top:15px;padding-top:0;overflow-y:visible}.sample[_ngcontent-%COMP%], .subtitle[_ngcontent-%COMP%]{top:56%;width:100%;text-align:center}.top-58[_ngcontent-%COMP%]{top:61%}"]})}}return i})();var vy=(()=>{class i{constructor(){this.file=null,this.sample_URL="https://res.cloudinary.com/pos/raw/upload/POS/CSV/Barcode_DealPOS.csv",this.fb=z(Yi),this.httpService=z(bi),this.destroyRef=z(Ye),this.activeModal=z(Ea)}ngOnInit(){this.form=this.fb.group({file:new nt("",[lt.required])})}onSelectFile(t){t instanceof File&&(this.file=t)}onOK(){let t=`https://${localStorage.getItem("Domain")}`;if(this.file){let n=new FormData;n.append("file",this.file,this.file.name),n.append("OutletID",""),this.httpService.postFormData("API/catalog/product/UploadCSVforBarcode",n,void 0,t).pipe(Je(this.destroyRef)).subscribe({next:r=>{this.activeModal.close(r)}})}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-dialog-import-product"]],standalone:!0,features:[_e],decls:2,vars:2,consts:[["title","Upload New Product Barcode?",3,"onOK","hasValid"],[3,"fileUploaded","sampleUrl"]],template:function(n,r){n&1&&(f(0,"app-base-modal",0),W("onOK",function(){return r.onOK()}),f(1,"POS-uppy",1),W("fileUploaded",function(a){return r.onSelectFile(a)}),m()()),n&2&&(P("hasValid",r.form.valid),y(),P("sampleUrl",r.sample_URL))},dependencies:[Da,rt,yy],styles:["pos-uppy div div h4{font-size:14px;margin:0} pos-uppy div div hr{margin:0!important} pos-uppy div div p.fs-6{font-size:1rem!important}"]})}}return i})();var by=()=>{let i=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=Math.random()*16;return t=(i+t)%16|0,i=Math.floor(i/16),(e==="x"?t:t&3|8).toString(16)})};var JE=(i,e)=>e.VariantID;function eD(i,e){if(i&1&&(f(0,"span",46),x(1),je(2,"maskito"),m()),i&2){let t=O(2).$implicit,n=O();y(),I(Ti(2,1,n.promotionDiscount(t.Promotions),n.options))}}function tD(i,e){if(i&1&&(f(0,"div",37)(1,"span",44),x(2),je(3,"maskito"),m(),le(4,eD,3,4,"span",45),m()),i&2){let t=O().$implicit,n=O();y(2),I(Ti(3,2,t.UnitPrice,n.options)),y(2),P("ngIf",t.Promotions)}}function iD(i,e){if(i&1&&(f(0,"div",37)(1,"span"),x(2),je(3,"maskito"),m()()),i&2){let t=O(2).$implicit,n=O();y(2),I(Ti(3,1,t.Print[0].UnitPrice,n.options))}}function nD(i,e){if(i&1&&(f(0,"div",37)(1,"span"),x(2),je(3,"maskito"),m()()),i&2){let t=O(2).$implicit,n=O();y(2),I(Ti(3,1,t.UnitPrice,n.options))}}function rD(i,e){if(i&1&&le(0,iD,4,4,"div",37)(1,nD,4,4,"div",37),i&2){let t=O().$implicit;Ce(t.Print&&t.Print.length>0?0:1)}}function oD(i,e){i&1&&ue(0,"i",40)}function aD(i,e){i&1&&ue(0,"i",41)}function sD(i,e){if(i&1){let t=Ie();f(0,"tr")(1,"td"),x(2),m(),f(3,"td"),x(4),m(),f(5,"td"),x(6),je(7,"number"),m(),f(8,"td"),le(9,tD,5,5,"div",37)(10,rD,2,1),m(),f(11,"td")(12,"div",38)(13,"button",39),W("click",function(){let r=ae(t).$implicit,o=O();return se(o.onToggleSelected(r))}),le(14,oD,1,0,"i",40)(15,aD,1,0,"i",41),m(),f(16,"button",42),W("click",function(){let r=ae(t).$implicit,o=O();return se(o.onRemoveItem(r))}),ue(17,"i",43),m()()()()}if(i&2){let t=e.$implicit,n=O();y(2),I(t.Name),y(2),I(t.Code),y(2),I(jt(7,6,t.Quantity)),y(3),Ce(t.Promotions?9:10),y(5),Ce(t.isSelected&&n.productEdit?14:15),y(2),P("disabled",t.isSelected&&n.productEdit)}}var _y=(()=>{class i{constructor(){this.productItems=[],this.storeService=z(ke),this.Object=Object,this.options=sr({precision:2,thousandSeparator:","}),this.modalService=z(Op),this.httpService=z(bi),this.router=z(Un),this.route=z(ma)}ngOnInit(){}onNext(){this.storeService.onNextStep(),this.storeService.productItems().length>0&&(this.storeService.stepperRef().selected.completed=!0,this.storeService.stepperRef().next())}onOpenModalChooseProduct(){return B(this,null,function*(){let n=yield this.modalService.open(is,{centered:!0}).result;if(n){let r=[...this.storeService.productItems()],o=r.findIndex(s=>s.ID===n.ID);o!==-1?r[o].Quantity+=n.Quantity:r.push(n);let a=[...r];this.storeService.onChangeProductItems(a),vl.production||localStorage.setItem("productItems",JSON.stringify(a))}})}onOpenModalEdit(t){return B(this,null,function*(){let n=this.modalService.open(is,{centered:!0,scrollable:!0});n.componentInstance.data=t;try{let r=yield n.result;if(r){let o=[...this.storeService.productItems()],a=o.findIndex(l=>l.ID===r.ID);a!==-1?o[a]=r:o.push(r);let s=[...o];this.storeService.onChangeProductItems(s),vl.production||localStorage.setItem("productItems",JSON.stringify(s))}}catch{}})}ngAfterViewInit(){this.productItems=this.storeService.productItems().map(t=>D(v({},t),{isSelected:!1}))}onToggleSelected(t){let n=[...this.storeService.productItems()],r=n.findIndex(o=>Object.prototype.hasOwnProperty.call(o,"VariantID")?o.VariantID===t.VariantID:o.ID===t.ID);r!==-1?n[r].checked=!0:n.forEach(o=>o.checked=!1),this.router.navigate(["/pages"],{queryParams:{id:n[r].checked?Object.prototype.hasOwnProperty.call(n[r],"VariantID")?t.VariantID:t.ID:null}})}onOpenDialogImportProduct(){return B(this,null,function*(){let n=yield this.modalService.open(vy,{scrollable:!0,centered:!0}).result,r=[...this.storeService.productItems()];n.forEach(o=>{r.push(D(v({},o),{Uuid:by(),ID:o.VariantID}))}),this.storeService.onChangeProductItems(r),console.log("result",n)})}onOpenDialogLoadTransaction(){return B(this,null,function*(){let n=yield this.modalService.open(tm,{scrollable:!0,centered:!0}).result,o=`https://${localStorage.getItem("Domain")}`;if(console.log("result",n),n!==void 0)switch(n.role){case"ok":let a={Number:n.data.number,Outlet:n.data.outlet},s=n.data.type===0?"/API/V3/Bill/Number":"/API/V3/TransferOrder/Detail ";this.httpService.post(s,a,void 0,o).pipe(Zt(l=>D(v({},l),{Variants:l.Variants.map(c=>D(v({},c),{UnitPrice:c.Price,checked:!1}))})),xe(l=>{let c=[...this.storeService.productItems()];l.Variants.forEach(d=>{let u=c.findIndex(g=>g.VariantID===d.VariantID);u!==-1?c[u].Quantity+=d.Quantity:c.push(d)}),this.storeService.onChangeProductItems(c)})).subscribe();break}})}onRemoveItem(t){let r=[...this.storeService.productItems()].filter(o=>o.VariantID!==t.VariantID);this.storeService.onChangeProductItems(r)}onActivate(t){return B(this,null,function*(){t.type==="click"&&(yield this.onOpenModalEdit(t.row))})}promotionDiscount(t){try{return Object.keys(t).length?t.Discount&&t.Discount>0?t.UnitPrice-t.UnitPrice*t.Discount/100:t.UnitPrice:0}catch(n){throw new Error("error: ",n)}}onClear(){this.storeService.onChangeProductItems([])}get productEdit(){return this.route.snapshot.queryParamMap.has("id")}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["choose-product"]],viewQuery:function(n,r){if(n&1&&yi(Yp,5),n&2){let o;ii(o=ni())&&(r.verticalSidebar=o.first)}},standalone:!0,features:[_e],decls:58,vars:5,consts:[[1,"d-flex","flex-column","gap-3","h-100"],[1,"topbar","position-static"],[1,"d-flex","top-navbar","navbar-expand-lg",3,"ngClass"],["id","navbarSupportedContent",1,"navbar-collapse","collapse","m-0",3,"ngbCollapse"],[1,"w-100","d-flex","align-items-center","px-3"],[1,"navbar-nav","float-start","me-auto","h-100","d-flex","align-items-center"],[1,"nav-item","d-none","d-lg-block"],[1,"font-robotoslab","m-0"],[1,"navbar-nav","float-end","py-2"],[1,"d-flex","gap-2"],[1,"btn-group"],["ngbDropdown","","placement","bottom-end",1,"btn-group"],["type","button",1,"btn","btn-outline-secondary","text-dark","d-flex","gap-2","align-items-baseline",3,"click"],[1,"fa-solid","fa-upload","fs-3"],[1,"fs-3"],["type","button","ngbDropdownToggle","",1,"btn","btn-outline-secondary","dropdown-toggle-split"],["ngbDropdownMenu","","aria-labelledby","dropdownBasic1"],["ngbDropdownItem","",1,"dropdown-item","text-dark","d-flex","gap-2","align-items-baseline",3,"click"],[1,"fa-regular","fa-file-lines","fs-3"],[1,"fa-solid","fa-trash","fs-3"],["type","button",1,"btn","btn-outline-secondary","d-flex","gap-1","align-items-center",3,"click","disabled"],[1,"f","fas","fa-angle-right"],[1,"mx-3","flex-grow-1"],[1,"row"],[1,"col-8"],[1,"container",2,"padding-left","2px","padding-right","0px"],[1,"card","h-100"],[1,"card-body",2,"padding","0.8rem","height","calc(100vh - 100px)"],[1,"table-responsive",2,"max-height","100%","height","100%","overflow-y","auto"],[1,"table"],[2,"position","sticky","top","0","background-color","white","border","1px solid rgba(0, 0, 0, 0.12)","z-index","1"],["scope","col"],["scope","col",2,"width","10%"],["scope","col",1,"text-end",2,"width","10%"],[1,"col"],[1,"card"],[1,"card-body",2,"padding","0.8rem"],[1,"d-flex","flex-column","text-end"],[1,"w-100","d-flex","justify-content-end","align-items-center"],["type","button",1,"btn","btn-link",3,"click"],[1,"fa-solid","fa-check","fs-5","text-primary"],[1,"fa-solid","fa-pen-to-square","fs-5"],["type","button",1,"btn","btn-link",3,"click","disabled"],[1,"fas","fa-trash","me-1","text-danger","fs-5"],[1,"text-decoration-line-through","text-danger"],["class","text-dark",4,"ngIf"],[1,"text-dark"]],template:function(n,r){n&1&&(f(0,"div",0)(1,"header",1)(2,"nav",2)(3,"div",3)(4,"div",4)(5,"ul",5)(6,"li",6)(7,"h3",7),x(8,"Choose Product"),m()()(),f(9,"ul",8)(10,"div",9)(11,"div",10)(12,"div",11)(13,"button",12),W("click",function(){return r.onOpenDialogImportProduct()}),ue(14,"i",13),f(15,"span",14),x(16,"Upload"),m()(),ue(17,"button",15),f(18,"div",16)(19,"button",17),W("click",function(){return r.onOpenDialogLoadTransaction()}),ue(20,"i",18),f(21,"span",14),x(22,"Load Transaction"),m()(),f(23,"button",17),W("click",function(){return r.onClear()}),ue(24,"i",19),f(25,"span",14),x(26,"Clear"),m()()()()(),f(27,"button",20),W("click",function(){return r.onNext()}),f(28,"span",14),x(29,"Next"),m(),ue(30,"i",21),m()()()()(),x(31,' " '),m()(),f(32,"div",22)(33,"div",23)(34,"div",24)(35,"div",25)(36,"div",26)(37,"div",27)(38,"div",28)(39,"table",29)(40,"thead",30)(41,"tr")(42,"th",31),x(43,"Name"),m(),f(44,"th",31),x(45,"Code"),m(),f(46,"th",32),x(47,"Qty"),m(),f(48,"th",33),x(49," Price "),m(),ue(50,"th",32),m()(),f(51,"tbody"),ei(52,sD,18,8,"tr",null,JE),m()()()()()()(),f(54,"div",34)(55,"div",35)(56,"div",36),ue(57,"modal-choose-product"),m()()()()()()),n&2&&(y(),Lt("data-navbarbg",r.storeService.options().navbarbg),y(),P("ngClass",r.storeService.options().navbarbg=="skin6"?"navbar-light":"navbar-dark"),y(),P("ngbCollapse",!r.storeService.options().isCollapsed),Lt("data-navbarbg",r.storeService.options().navbarbg),y(24),P("disabled",r.storeService.productItems().length<=0),y(25),ti(r.storeService.productItems()))},dependencies:[ri,Xi,Vn,fa,Ip,Dp,Ep,kp,Tp,$n,Rf,rm,is],styles:[".dropdown-toggle:after{display:inline-block!important}[_nghost-%COMP%] .ngx-datatable.fixed-header .datatable-header .datatable-header-inner .datatable-header-cell{background:#f6f6f6!important;font-weight:600;font-size:14px;color:#3b3b3b}[_nghost-%COMP%] .ngx-datatable .datatable-body{border:none}[_nghost-%COMP%] .ngx-datatable.material{border:none}[_ngcontent-%COMP%]:hover .ngx-datatable.material .datatable-header{border:1px solid rgba(0,0,0,.12)}[_nghost-%COMP%] .ngx-datatable.material .datatable-body .datatable-body-row .datatable-body-cell{display:flex;align-items:center;font-size:12px}[_nghost-%COMP%] .ngx-datatable.material .datatable-body .datatable-body-row .datatable-body-cell .datatable-body-cell-label{width:100%}[_nghost-%COMP%] .ngx-datatable.material .empty-row{font-size:12px}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%]{background:#f6f6f6!important;font-weight:600;font-size:14px;color:#3b3b3b}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border:1px solid rgba(0,0,0,.12)}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{font-weight:400;font-size:12px;vertical-align:middle}.dropdown-item[_ngcontent-%COMP%]:hover{background-color:#ddd;color:#333}.dropdown-menu.show[_ngcontent-%COMP%]{padding:.5rem 0}"],changeDetection:0})}}return i})();var Ko="px",wy=sr({postfix:Ko,min:0,thousandSeparator:""}),{plugins:lD}=wy,cD=Ln(wy,["plugins"]),Ft=D(v({},cD),{plugins:[...lD,If(i=>[0,i.length-Ko.length]),ar("focus",i=>{i.setSelectionRange(0,i.value.length-Ko.length)}),ar("blur",i=>{i.value===Ko&&nr(i,`0${Ko}`)})]});function dD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.barcodeHeight)}}function uD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.fontSize)}}function pD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.barcode)}}function hD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.code)}}function fD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.price)}}function mD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.name)}}function gD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.moveProductName)}}function yD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.releaseDate)}}function vD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.discountVisible)}}function bD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.pricebookPrice)}}function _D(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O();y(),I(t.tooltip.pricebookFontSize)}}var xy=(()=>{class i{constructor(){this.options=Ft,this.barcodeHeight=q(0),this.fontSize=q(0),this.barcode=q(!1),this.code=q(!1),this.price=q(!1),this.name=q(!1),this.moveProductName=q(!1),this.releaseDate=q(!1),this.discountVisible=q(!1),this.pricebookPrice=q(!1),this.pricebookFontSize=q(0),this.UOMVisible=q(!1),this.tooltip={barcodeHeight:"The height of the generated barcode in pixels",fontSize:"Change all font size (except price)",barcode:"Whether barcode is visible",code:"Whether variant code is visible",price:"Whether variant price is visible",name:"Whether variant name is visible",moveProductName:"Whether move variant name below variant code or below variant price",releaseDate:"Whether release data is visible",discountVisible:"Whether variant's sell price discount is visible",pricebookPrice:"Whether pricebook price is visible",pricebookFontSize:"Change font size for pricebook price",UOMVisible:"Whether UOM is visible"},this.storeService=z(ke),this.injector=z(Xe),this.destroyRef=z(Ye)}ngOnInit(){pt(this.storeService.paperConfiguration,{injector:this.injector}).pipe(Je(this.destroyRef),xe(t=>{this.barcodeHeight.set(t.BarcodeHeight),this.fontSize.set(t.ProductNameFontSize),this.barcode.set(t.BarcodeVisible),this.code.set(t.CodeVisible),this.price.set(t.PriceVisible),this.name.set(t.NameVisible),this.moveProductName.set(t.MoveProductNameOnTop),this.releaseDate.set(t.ShowReleasedDate),this.discountVisible.set(t.ShowPriceDiscount),this.pricebookPrice.set(t.PricebookVisible),this.pricebookFontSize.set(t.PricebookFontSize),this.UOMVisible.set(t.UOMNameVisible)})).subscribe()}onInputHandler(t,n){switch(console.log("value",t),n){case"barcodeHeight":this.barcodeHeight.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{BarcodeHeight:this.barcodeHeight()}));break;case"fontSize":this.fontSize.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{ProductNameFontSize:this.fontSize()}));break;case"barcode":this.barcode.set(!!t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{BarcodeVisible:this.barcode()}));break;case"code":this.code.set(!!t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{CodeVisible:this.code()}));break;case"price":this.price.set(!!t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{PriceVisible:this.price()}));break;case"name":this.name.set(!!t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{NameVisible:this.name()}));break;case"moveProductName":this.moveProductName.set(!!t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{MoveProductNameOnTop:this.moveProductName()}));break;case"releaseDate":this.releaseDate.set(!!t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{ShowReleasedDate:this.releaseDate()}));break;case"discountVisible":this.discountVisible.set(!!t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{ShowPriceDiscount:this.discountVisible()}));break;case"pricebookPrice":this.pricebookPrice.set(!!t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{PricebookVisible:this.pricebookPrice()}));break;case"pricebookFontSize":this.pricebookFontSize.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{PricebookFontSize:this.pricebookFontSize()}));break;case"UOMVisible":this.UOMVisible.set(!!t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{UOMNameVisible:this.UOMVisible()}));break}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-barcode-view"]],standalone:!0,features:[_e],decls:114,vars:20,consts:[["barcodeHeightTemplate",""],["fontSizeTemplate",""],["barcodeTemplate",""],["codeTemplate",""],["priceTemplate",""],["nameTemplate",""],["moveProductNameTemplate",""],["releaseDateTemplate",""],["discountVisibleTemplate",""],["pricebookPriceTemplate",""],["pricebookFontSizeTemplate",""],[1,"table","table-bordered"],["for","barcode",1,"fs-2"],[1,"form-check","form-switch"],["id","barcode","name","barcode","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","checked","ngModel"],[1,"form-text","fst-italic","fw-normal","fs-2"],["for","code",1,"fs-2"],["id","code","name","code","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","checked","ngModel"],["for","price",1,"fs-2"],["id","price","name","price","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","ngModel"],["for","name",1,"fs-2"],["id","name","name","name","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","ngModel"],["for","moveProductName",1,"fs-2","d-inline-block","text-truncate"],["id","moveProductName","name","moveProductName","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","ngModel"],["for","releaseDate",1,"fs-2"],["id","releaseDate","name","releaseDate","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","ngModel"],["for","discountVisible",1,"fs-2"],["id","discountVisible","name","discountVisible","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","ngModel"],["for","pricebookPrice",1,"fs-2"],["id","pricebookPrice","name","pricebookPrice","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","ngModel"],[1,"fst-italic"]],template:function(n,r){if(n&1){let o=Ie();f(0,"table",11)(1,"tbody")(2,"tr")(3,"td")(4,"label",12),x(5,"Barcode"),m()(),f(6,"td")(7,"div",13)(8,"input",14),W("ngModelChange",function(s){return ae(o),se(r.onInputHandler(s,"barcode"))}),m()()(),f(9,"td")(10,"span",15),x(11),m()()(),f(12,"tr")(13,"td")(14,"label",16),x(15,"Code"),m()(),f(16,"td")(17,"div",13)(18,"input",17),W("ngModelChange",function(s){return ae(o),se(r.onInputHandler(s,"code"))}),m()()(),f(19,"td")(20,"span",15),x(21),m()()(),f(22,"tr")(23,"th")(24,"label",18),x(25,"Price"),m()(),f(26,"td")(27,"div",13)(28,"input",19),W("ngModelChange",function(s){return ae(o),se(r.onInputHandler(s,"price"))}),m()()(),f(29,"td")(30,"span",15),x(31),m()()(),f(32,"tr")(33,"td")(34,"label",20),x(35,"Name"),m()(),f(36,"td")(37,"div",13)(38,"input",21),W("ngModelChange",function(s){return ae(o),se(r.onInputHandler(s,"name"))}),m()()(),f(39,"td")(40,"span",15),x(41),m()()(),f(42,"tr")(43,"td")(44,"label",22),x(45,"Move Product Name"),m()(),f(46,"td")(47,"div",13)(48,"input",23),W("ngModelChange",function(s){return ae(o),se(r.onInputHandler(s,"moveProductName"))}),m()()(),f(49,"td")(50,"span",15),x(51),m()()(),f(52,"tr")(53,"td")(54,"label",24),x(55,"Release Date"),m()(),f(56,"td")(57,"div",13)(58,"input",25),W("ngModelChange",function(s){return ae(o),se(r.onInputHandler(s,"releaseDate"))}),m()()(),f(59,"td")(60,"span",15),x(61),m()()(),f(62,"tr")(63,"td")(64,"label",26),x(65,"Discount Visible"),m()(),f(66,"td")(67,"div",13)(68,"input",27),W("ngModelChange",function(s){return ae(o),se(r.onInputHandler(s,"discountVisible"))}),m()()(),f(69,"td")(70,"span",15),x(71),m()()(),f(72,"tr")(73,"td")(74,"label",26),x(75,"UOM Visible"),m()(),f(76,"td")(77,"div",13)(78,"input",27),W("ngModelChange",function(s){return ae(o),se(r.onInputHandler(s,"UOMVisible"))}),m()()(),f(79,"td")(80,"span",15),x(81),m()()(),f(82,"tr")(83,"td")(84,"label",28),x(85,"Pricebook Price"),m()(),f(86,"td")(87,"div",13)(88,"input",29),W("ngModelChange",function(s){return ae(o),se(r.onInputHandler(s,"pricebookPrice"))}),m()()(),f(89,"td")(90,"span",15),x(91),m()()()()(),le(92,dD,2,1,"ng-template",null,0,me)(94,uD,2,1,"ng-template",null,1,me)(96,pD,2,1,"ng-template",null,2,me)(98,hD,2,1,"ng-template",null,3,me)(100,fD,2,1,"ng-template",null,4,me)(102,mD,2,1,"ng-template",null,5,me)(104,gD,2,1,"ng-template",null,6,me)(106,yD,2,1,"ng-template",null,7,me)(108,vD,2,1,"ng-template",null,8,me)(110,bD,2,1,"ng-template",null,9,me)(112,_D,2,1,"ng-template",null,10,me)}n&2&&(y(8),P("checked",r.barcode())("ngModel",r.barcode()),y(3),I(r.tooltip.barcode),y(7),P("checked",r.code())("ngModel",r.code()),y(3),I(r.tooltip.code),y(7),P("ngModel",r.price()),y(3),I(r.tooltip.price),y(7),P("ngModel",r.name()),y(3),I(r.tooltip.name),y(7),P("ngModel",r.moveProductName()),y(3),I(r.tooltip.moveProductName),y(7),P("ngModel",r.releaseDate()),y(3),I(r.tooltip.releaseDate),y(7),P("ngModel",r.discountVisible()),y(3),I(r.tooltip.discountVisible),y(7),P("ngModel",r.UOMVisible()),y(3),I(r.tooltip.UOMVisible),y(7),P("ngModel",r.pricebookPrice()),y(3),I(r.tooltip.pricebookPrice))},dependencies:[ht,Wn,it,Dt,rt,Oa],styles:[".col[_ngcontent-%COMP%]{padding:0!important}.fas[_ngcontent-%COMP%] .fa-info-circle[_ngcontent-%COMP%]{font-size:12px}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{vertical-align:middle}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:last-child{width:50%}"],changeDetection:0})}}return i})();function wD(i,e){if(i&1&&(f(0,"span",16),x(1),m()),i&2){let t=O();y(),I(t.tooltip.priceWithTax)}}function xD(i,e){if(i&1&&(f(0,"span",16),x(1),m()),i&2){let t=O();y(),I(t.tooltip.selectedTax)}}function CD(i,e){if(i&1&&(f(0,"span",16),x(1),m()),i&2){let t=O();y(),I(t.tooltip.currency)}}function SD(i,e){if(i&1&&(f(0,"span",16),x(1),m()),i&2){let t=O();y(),I(t.tooltip.fontSize)}}function PD(i,e){if(i&1&&(f(0,"span",16),x(1),m()),i&2){let t=O();y(),I(t.tooltip.outletPrice)}}var Cy=(()=>{class i{constructor(){this.options=Ft,this.hasPriceTax=q(!1),this.selectedTax=q(""),this.taxType=q({}),this.currency=q(""),this.fontSize=q(0),this.outletPrice=q(""),this.tooltip={priceWithTax:"Tax is added to the product base price true",selectedTax:"Applied Tax ex: 100 + 10% = 110",currency:"The default currency",fontSize:"Change font size for price",outletPrice:"Price will be set according to the outlet price assigned when selected the outlet"},this.storeService=z(ke),this.destroyRef=z(Ye),this.injector=z(Xe),this.outlets=q([])}get taxs(){return this.storeService.taxs()}ngOnInit(){pt(this.storeService.paperConfiguration,{injector:this.injector}).pipe(Je(this.destroyRef),xe(o=>{this.hasPriceTax.set(o.PriceWithTax),this.selectedTax.set(o.TaxType&&o.TaxType.ID),this.currency.set(o.CurrencySymbol),this.fontSize.set(o.PriceFontSize),this.outletPrice.set(o.OutletID)})).subscribe();let t=this.storeService.paperConfig().Outlets,n=this.storeService.productItems(),r=t.filter(o=>n?n.some(a=>a.OutletPrice?.some(s=>s.Outlet===o.Name)):[]);this.outlets.set(r),pt(this.storeService.productItems,{injector:this.injector}).pipe(xe(o=>{let a=o.some(s=>s.Promotions);this.outletPrice.set(a?"":this.outletPrice())})).subscribe(),pt(this.outletPrice,{injector:this.injector}).pipe(Jt(o=>!!o),xe(()=>{let o=[...this.storeService.productItems().map(a=>D(v({},a),{Promotions:null}))];this.storeService.onChangeProductItems(o)})).subscribe()}onInputHandler(t,n){switch(n){case"hasPriceTax":this.hasPriceTax.set(!!t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{PriceWithTax:this.hasPriceTax()}));break;case"selectedTax":let r=this.storeService.taxs().findIndex(o=>o.ID===t);r!==-1&&(this.selectedTax.set(t),this.taxType.set(this.storeService.taxs()[r])),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{TaxType:this.taxType()}));break;case"currency":this.currency.set(t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{CurrencySymbol:this.currency()}));break;case"fontSize":this.fontSize.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{PriceFontSize:this.fontSize()}));break;case"outletPrice":if(this.outletPrice.set(t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{OutletID:this.outletPrice()})),this.storeService.paperConfiguration().OutletID){let o=[...this.storeService.productItems().map(a=>D(v({},a),{Promotions:null}))];this.storeService.onChangeProductItems(o)}break}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-price"]],standalone:!0,features:[_e],decls:49,vars:11,consts:[["priceWithTaxTemplate",""],["selectedTaxTemplate",""],["currencyTemplate",""],["fontSizeTemplate",""],["outletPriceTemplate",""],[1,"table","table-bordered"],["for","hasPriceTax",1,"fs-2","d-inline-block","text-truncate"],[1,"form-check","form-switch"],["id","hasPriceTax","name","hasPriceTax","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","checked","ngModel"],[1,"form-text","fst-italic","fw-normal","fs-2"],["for","selectedTax",1,"fs-2","d-inline-block","text-truncate"],["id","selectedTax","name","selectedTax","bindLabel","Name","bindValue","ID","placeholder","Select Column",1,"custom","w-100","fs-2",3,"ngModelChange","ngModel","items"],["for","currency",1,"fs-2","d-inline-block","text-truncate"],["id","currency","name","currency","type","text",1,"form-control","fs-2",3,"ngModelChange","ngModel"],["for","outletPrice",1,"fs-2","d-inline-block","text-truncate"],["id","outletPrice","name","outletPrice","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"custom","w-100","fs-2",3,"ngModelChange","ngModel","items"],[1,"fst-italic"]],template:function(n,r){if(n&1){let o=Ie();f(0,"table",5)(1,"tbody")(2,"tr")(3,"td")(4,"label",6),x(5,"Price With Tax"),m()(),f(6,"td")(7,"div",7)(8,"input",8),W("ngModelChange",function(s){return ae(o),se(r.onInputHandler(s,"hasPriceTax"))}),m()()(),f(9,"td")(10,"span",9),x(11),m()()(),f(12,"tr")(13,"td")(14,"label",10),x(15,"Selected Tax"),m()(),f(16,"td")(17,"ng-select",11),W("ngModelChange",function(s){return ae(o),se(r.onInputHandler(s,"selectedTax"))}),m()(),f(18,"td")(19,"span",9),x(20),m()()(),f(21,"tr")(22,"td")(23,"label",12),x(24,"Currency"),m()(),f(25,"td")(26,"input",13),W("ngModelChange",function(s){return ae(o),se(r.onInputHandler(s,"currency"))}),m()(),f(27,"td")(28,"span",9),x(29),m()()(),f(30,"tr")(31,"th")(32,"label",14),x(33,"Outlet Price"),m()(),f(34,"td")(35,"ng-select",15),W("ngModelChange",function(s){return ae(o),se(r.onInputHandler(s,"outletPrice"))}),m()(),f(36,"td")(37,"span",9),x(38),m()()()()(),le(39,wD,2,1,"ng-template",null,0,me)(41,xD,2,1,"ng-template",null,1,me)(43,CD,2,1,"ng-template",null,2,me)(45,SD,2,1,"ng-template",null,3,me)(47,PD,2,1,"ng-template",null,4,me)}n&2&&(y(8),P("checked",r.hasPriceTax())("ngModel",r.hasPriceTax()),y(3),I(r.tooltip.priceWithTax),y(6),P("ngModel",r.selectedTax())("items",r.taxs),y(3),I(r.tooltip.selectedTax),y(6),P("ngModel",r.currency()),y(3),I(r.tooltip.currency),y(6),P("ngModel",r.outletPrice())("items",r.outlets()),y(3),I(r.tooltip.outletPrice))},dependencies:[ht,tt,Wn,it,Dt,rt,oi,_i],styles:["table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{vertical-align:middle}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:last-child{width:50%}"],changeDetection:0})}}return i})();function ED(i,e){if(i&1&&(f(0,"span",21),x(1),m()),i&2){let t=O();y(),I(t.tooltip.maxCharacter)}}function DD(i,e){if(i&1&&(f(0,"span",21),x(1),m()),i&2){let t=O();y(),I(t.tooltip.namePrefix)}}function kD(i,e){if(i&1&&(f(0,"span",21),x(1),m()),i&2){let t=O();y(),I(t.tooltip.storeName)}}function TD(i,e){if(i&1&&(f(0,"span",21),x(1),m()),i&2){let t=O();y(),I(t.tooltip.orientation)}}function ID(i,e){if(i&1&&(f(0,"span",21),x(1),m()),i&2){let t=O();y(),I(t.tooltip.useDescriptionAsCode)}}function OD(i,e){if(i&1&&(f(0,"span",21),x(1),m()),i&2){let t=O();y(),I(t.tooltip.removeDefault)}}var Sy=(()=>{class i{constructor(){this.storeService=z(ke),this.fb=z(Yi),this.destroyRef=z(Ye),this.injector=z(Xe),this.tooltip={maxCharacter:"The max character of the product name",namePrefix:"A word, letter, or number placed before product name",storeName:"The name of the store",orientation:"Horizontal or vertical position store name label",useDescriptionAsCode:"Copy product description into product code",removeDefault:"Remove 'Default' label from product name"},this.maxCharacter=q(0),this.namePrefix=q(""),this.storeName=q(""),this.orientation=q(0),this.useDescriptionAsCode=q(!1),this.removeDefault=q(!1),this.options=Ft}ngOnInit(){this.initForm(),pt(this.storeService.paperConfiguration,{injector:this.injector}).pipe(Je(this.destroyRef),xe(t=>{this.maxCharacter.set(t.ProductNameMaxLength),this.namePrefix.set(t.ProductNamePrefix),this.storeName.set(t.StoreName),this.orientation.set(t.Orientation),this.useDescriptionAsCode.set(t.DescriptionAsCode),this.removeDefault.set(!1)})).subscribe(),this.form.valueChanges.pipe(Je(this.destroyRef),xe(t=>{let n=D(v({},this.storeService.paperConfiguration()),{ProductNameMaxLength:t.maxCharacter,ProductNamePrefix:t.namePrefix,StoreName:t.storeName,Orientation:t.orientation,DescriptionAsCode:!!t.useDescriptionAsCode});this.storeService.onChangePaperConfiguration(n);let o=["ProductNameMaxLength","ProductNamePrefix","StoreName","Orientation","DescriptionAsCode"].reduce((a,s)=>(s in this.storeService.paperConfiguration()&&(a[s]=this.storeService.paperConfiguration()[s]),a),{});console.log("filtered advanced",o)})).subscribe()}onInputHandler(t,n){switch(n){case"maxCharacter":this.maxCharacter.set(+t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{ProductNameMaxLength:this.maxCharacter()}));break;case"namePrefix":this.namePrefix.set(t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{ProductNamePrefix:this.namePrefix()}));break;case"storeName":this.storeName.set(t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{StoreName:this.storeName()}));break;case"orientation":this.orientation.set(+t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{Orientation:this.orientation()}));break;case"useDescriptionAsCode":this.useDescriptionAsCode.set(!!t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{DescriptionAsCode:this.useDescriptionAsCode()}));break;case"removeDefault":this.removeDefault.set(!!t);break}}initForm(){this.form=this.fb.group({maxCharacter:new nt(this.storeService.paperConfiguration().ProductNameMaxLength,[lt.required]),namePrefix:new nt(null,[lt.required]),storeName:new nt(null,[lt.required]),orientation:new nt(null,[lt.required]),useDescriptionAsCode:new nt(null,[lt.required]),removeDefault:new nt("0",[lt.required])}),this.form.patchValue({maxCharacter:this.storeService.paperConfiguration().ProductNameMaxLength,namePrefix:this.storeService.paperConfiguration().ProductNamePrefix,storeName:this.storeService.paperConfiguration().StoreName,orientation:this.storeService.paperConfiguration().Orientation,useDescriptionAsCode:Number(this.storeService.paperConfiguration().DescriptionAsCode).toString()})}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-advanced"]],standalone:!0,features:[_e],decls:70,vars:15,consts:[["maxCharacterTemplate",""],["namePrefixTemplate",""],["storeNameTemplate",""],["orientationTemplate",""],["useDescriptionAsCodeTemplate",""],["removeDefaultTemplate",""],[1,"table","table-bordered"],["for","MaxCharacter",1,"fs-2","d-inline-block","text-truncate"],["id","maxCharacter","name","maxCharacter","type","text",1,"form-control","fs-2",3,"ngModelChange","ngModel"],[1,"form-text","fst-italic","fw-medium","fs-2"],["for","namePrefix",1,"fs-2","d-inline-block","text-truncate"],["name","namePrefix","type","text",1,"form-control","fs-2",3,"ngModelChange","ngModel"],["for","storeName",1,"fs-2","d-inline-block","text-truncate"],["id","storeName","name","storeName","type","text",1,"form-control","fs-2",3,"ngModelChange","ngModel"],["for","orientation",1,"fs-2","d-inline-block","text-truncate"],["id","orientation","name","orientation","bindLabel","Value","bindValue","Key","placeholder","Select Column",1,"custom","w-100","fs-2",3,"ngModelChange","ngModel","items"],["for","useDescriptionAsCode",1,"fs-2","d-inline-block","text-truncate"],[1,"form-check","form-switch"],["id","useDescriptionAsCode","name","barcode","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","checked","ngModel"],["for","removeDefault",1,"fs-2","d-inline-block","text-truncate"],["id","removeDefault","name","removeDefault","role","switch","type","checkbox",1,"form-check-input","fs-2",3,"ngModelChange","checked","ngModel"],[1,"fst-italic"]],template:function(n,r){if(n&1){let o=Ie();f(0,"table",6)(1,"tbody")(2,"tr")(3,"td")(4,"label",7),x(5,"Max Character"),m()(),f(6,"td")(7,"input",8),W("ngModelChange",function(s){return ae(o),se(r.onInputHandler(s,"maxCharacter"))}),m()(),f(8,"td")(9,"span",9),x(10),m()()(),f(11,"tr")(12,"td")(13,"label",10),x(14,"Name Prefix"),m()(),f(15,"td")(16,"input",11),W("ngModelChange",function(s){return ae(o),se(r.onInputHandler(s,"namePrefix"))}),m()(),f(17,"td")(18,"span",9),x(19),m()()(),f(20,"tr")(21,"td")(22,"label",12),x(23,"Store Name"),m()(),f(24,"td")(25,"input",13),W("ngModelChange",function(s){return ae(o),se(r.onInputHandler(s,"storeName"))}),m()(),f(26,"td")(27,"span",9),x(28),m()()(),f(29,"tr")(30,"th")(31,"label",14),x(32,"Orientation"),m()(),f(33,"td")(34,"ng-select",15),W("ngModelChange",function(s){return ae(o),se(r.onInputHandler(s,"orientation"))}),m()(),f(35,"td")(36,"span",9),x(37),m()()(),f(38,"tr")(39,"td")(40,"label",16),x(41,"Use description as code"),m()(),f(42,"td")(43,"div",17)(44,"input",18),W("ngModelChange",function(s){return ae(o),se(r.onInputHandler(s,"useDescriptionAsCode"))}),m()()(),f(45,"td")(46,"span",9),x(47),m()()(),f(48,"tr")(49,"td")(50,"label",19),x(51,'Remove "Default"'),m()(),f(52,"td")(53,"div",17)(54,"input",20),W("ngModelChange",function(s){return ae(o),se(r.onInputHandler(s,"removeDefault"))}),m()()(),f(55,"td")(56,"span",9),x(57),m()()()()(),le(58,ED,2,1,"ng-template",null,0,me)(60,DD,2,1,"ng-template",null,1,me)(62,kD,2,1,"ng-template",null,2,me)(64,TD,2,1,"ng-template",null,3,me)(66,ID,2,1,"ng-template",null,4,me)(68,OD,2,1,"ng-template",null,5,me)}n&2&&(y(7),P("ngModel",r.maxCharacter()),y(3),I(r.tooltip.maxCharacter),y(6),P("ngModel",r.namePrefix()),y(3),I(r.tooltip.namePrefix),y(6),P("ngModel",r.storeName()),y(3),I(r.tooltip.storeName),y(6),P("ngModel",r.orientation())("items",r.storeService.paperConfiguration().OrientationChoice),y(3),I(r.tooltip.orientation),y(7),P("checked",r.useDescriptionAsCode())("ngModel",r.useDescriptionAsCode()),y(3),I(r.tooltip.useDescriptionAsCode),y(7),P("checked",r.removeDefault())("ngModel",r.removeDefault()),y(3),I(r.tooltip.removeDefault))},dependencies:[rt,tt,Wn,it,oi,_i,ht,Dt],styles:["table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{vertical-align:middle}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:last-child{width:50%}"],changeDetection:0})}}return i})();var Py=(()=>{class i{transform(t,...n){let r=Number(t),o=Number(n[0]);return r*o/100+r}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275pipe=ta({name:"taxs",type:i,pure:!0,standalone:!0})}}return i})();var Ey=De(Ic());var FD=["barcode"],RD=(i,e)=>e.VariantID,MD=i=>({"h-100":i}),Ge=i=>({"font-size.px":i});function AD(i,e){if(i&1&&(f(0,"div",3),ue(1,"canvas",12,0),m()),i&2){let t=O(2);y(),P("ngStyle",t.barcodeStyle)}}function BD(i,e){if(i&1&&(f(0,"span",5),x(1),m()),i&2){let t=O().$implicit,n=O();P("ngStyle",Ae(2,Ge,n.storeService.paperConfiguration().ProductNameFontSize)),y(),I(t.Code)}}function ND(i,e){if(i&1&&(f(0,"span",14),x(1),m()),i&2){let t=O(3);P("ngStyle",Ae(2,Ge,t.storeService.paperConfiguration().ProductNameFontSize)),y(),I(t.storeService.paperConfiguration().ProductNamePrefix)}}function zD(i,e){if(i&1&&(f(0,"div",6),le(1,ND,2,4,"span",13),f(2,"span",14),x(3),je(4,"slice"),m()()),i&2){let t=O().$implicit,n=O();y(),P("ngIf",n.storeService.paperConfiguration().ProductNamePrefix),y(),P("ngStyle",Ae(7,Ge,n.storeService.paperConfiguration().ProductNameFontSize)),y(),I(gl(4,3,t.Name,0,n.storeService.paperConfiguration().ProductNameMaxLength))}}function LD(i,e){if(i&1&&(f(0,"span",25),x(1),m()),i&2){let t=O(3);P("ngStyle",Ae(2,Ge,t.storeService.paperConfiguration().PriceFontSize)),y(),I(t.storeService.paperConfiguration().CurrencySymbol)}}function HD(i,e){if(i&1&&(f(0,"span"),x(1),m()),i&2){let t=O(2).$implicit;y(),Ht("/",t.UOMName||"pcs","")}}function jD(i,e){if(i&1&&(f(0,"span",26),x(1),m()),i&2){let t=O(3);P("ngStyle",Ae(2,Ge,t.storeService.paperConfiguration().PriceFontSize)),y(),I(t.storeService.paperConfiguration().CurrencySymbol)}}function VD(i,e){if(i&1&&(f(0,"div",7)(1,"div",15)(2,"div",16),x(3),m(),f(4,"div",17),le(5,LD,2,4,"span",18),f(6,"span",19),x(7),je(8,"number"),m(),x(9),je(10,"json"),le(11,HD,2,1,"span",20),m()(),f(12,"div",15)(13,"div",21),x(14),m(),f(15,"div",22),le(16,jD,2,4,"span",23),f(17,"span",24),x(18),je(19,"number"),m()()()()),i&2){let t=O().$implicit,n=O();y(2),P("ngStyle",Ae(18,Ge,n.storeService.paperConfiguration().ProductNameFontSize)),y(),Ht(" ",n.storeService.paperConfiguration().BasicPriceLabel," "),y(2),P("ngIf",n.storeService.paperConfiguration().CurrencySymbol),y(),P("ngStyle",Ae(20,Ge,n.storeService.paperConfiguration().PriceFontSize)),y(),I(jt(8,12,t.UnitPrice)),y(2),Ht(" ",jt(10,14,n.storeService.paperConfiguration().UOMNameVisible)," "),y(2),P("ngIf",n.storeService.paperConfiguration().UOMNameVisible),y(2),P("ngStyle",Ae(22,Ge,n.storeService.paperConfiguration().ProductNameFontSize)),y(),Ht(" ",n.storeService.paperConfiguration().PromotionPriceLabel," "),y(2),P("ngIf",n.storeService.paperConfiguration().CurrencySymbol),y(),P("ngStyle",Ae(24,Ge,n.storeService.paperConfiguration().PriceFontSize)),y(),I(jt(19,16,n.promotionDiscount(t.Promotions)))}}function UD(i,e){if(i&1&&(f(0,"span",28),x(1),m()),i&2){let t=O(3);P("ngStyle",Ae(2,Ge,t.storeService.paperConfiguration().PriceFontSize)),y(),I(t.storeService.paperConfiguration().CurrencySymbol)}}function WD(i,e){if(i&1&&(f(0,"span",30),x(1),m()),i&2){let t=O(2).$implicit,n=O();P("ngStyle",Ae(2,Ge,n.storeService.paperConfiguration().PriceFontSize)),y(),Ht("/",t.UOMName||"pcs","")}}function $D(i,e){if(i&1&&(f(0,"div",8),le(1,UD,2,4,"span",27),f(2,"span",28),x(3),je(4,"taxs"),je(5,"number"),m(),le(6,WD,2,4,"span",29),m()),i&2){let t=O().$implicit,n=O();y(),P("ngIf",n.storeService.paperConfiguration().CurrencySymbol),y(),P("ngStyle",Ae(9,Ge,n.storeService.paperConfiguration().PriceFontSize)),y(),I(jt(5,7,Ti(4,4,t.UnitPrice,n.taxRate))),y(3),P("ngIf",n.storeService.paperConfiguration().UOMNameVisible)}}function qD(i,e){if(i&1&&(f(0,"span",28),x(1),m()),i&2){let t=O(5);P("ngStyle",Ae(2,Ge,t.storeService.paperConfiguration().PriceFontSize)),y(),I(t.storeService.paperConfiguration().CurrencySymbol)}}function GD(i,e){if(i&1&&(f(0,"div",10),le(1,qD,2,4,"span",27),f(2,"span",28),x(3),je(4,"taxs"),je(5,"number"),m()()),i&2){let t=O().$implicit,n=O(3);y(),P("ngIf",n.storeService.paperConfiguration().CurrencySymbol),y(),P("ngStyle",Ae(8,Ge,n.storeService.paperConfiguration().PriceFontSize)),y(),I(jt(5,6,Ti(4,3,t.Price,n.taxRate)))}}function XD(i,e){if(i&1&&le(0,GD,6,10,"div",10),i&2){let t=e.$implicit,n=O(3);Ce(t.Outlet===n.storeService.outlet$().Name?0:-1)}}function YD(i,e){if(i&1&&ei(0,XD,1,1,null,null,sa),i&2){let t=O().$implicit;ti(t.OutletPrice)}}function KD(i,e){if(i&1&&(f(0,"span",14),x(1),m()),i&2){let t=O(3);P("ngStyle",Ae(2,Ge,t.storeService.paperConfiguration().ProductNameFontSize)),y(),I(t.storeService.paperConfiguration().ProductNamePrefix)}}function QD(i,e){if(i&1&&(f(0,"div",9),le(1,KD,2,4,"span",13),f(2,"span",14),x(3),je(4,"slice"),m()()),i&2){let t=O().$implicit,n=O();y(),P("ngIf",n.storeService.paperConfiguration().ProductNamePrefix),y(),P("ngStyle",Ae(7,Ge,n.storeService.paperConfiguration().ProductNameFontSize)),y(),I(gl(4,3,t.Name,0,n.storeService.paperConfiguration().ProductNameMaxLength))}}function ZD(i,e){if(i&1&&(f(0,"div",31)(1,"span",14),x(2),m()()),i&2){let t=O(3);y(),P("ngStyle",Ae(2,Ge,t.storeService.paperConfiguration().ProductNameFontSize)),y(),I(t.storeService.paperConfiguration().StoreName)}}function JD(i,e){if(i&1&&(f(0,"div",32)(1,"span",14),x(2),m()()),i&2){let t=O(3);y(),P("ngStyle",Ae(2,Ge,t.storeService.paperConfiguration().ProductNameFontSize)),y(),I(t.storeService.paperConfiguration().StoreName)}}function ek(i,e){if(i&1&&le(0,ZD,3,4,"div",31)(1,JD,3,4,"div",32),i&2){let t=O(2);Ce(t.storeService.paperConfiguration().Orientation===0?0:1)}}function tk(i,e){if(i&1&&(f(0,"div",10)(1,"span",14),x(2),je(3,"date"),m()()),i&2){let t=O().$implicit,n=O();y(),P("ngStyle",Ae(5,Ge,n.storeService.paperConfiguration().ProductNameFontSize)),y(),I(Ti(3,2,t.ReleasedDate,"dd MMM yyyy"))}}function ik(i,e){if(i&1&&(f(0,"div",10)(1,"span",14),x(2),m()()),i&2){let t=O().$implicit,n=O();y(),P("ngStyle",Ae(2,Ge,n.storeService.paperConfiguration().ProductNameFontSize)),y(),Ht("",t.PriceDiscount,"% Off")}}function nk(i,e){if(i&1&&(f(0,"span"),x(1),m(),f(2,"span"),x(3,"-"),m(),f(4,"span"),x(5),m(),f(6,"span"),x(7,"-"),m(),f(8,"span"),x(9),je(10,"number"),m()),i&2){let t=e.$implicit;y(),I(t.Name),y(4),I(t.MinimumQuantity),y(4),I(jt(10,3,t.UnitPrice))}}function rk(i,e){if(i&1&&(f(0,"div",11),ei(1,nk,11,5,null,null,la),m()),i&2){let t=O().$implicit,n=O();P("ngStyle",Ae(1,Ge,n.storeService.paperConfiguration().PricebookFontSize)),y(),ti(t.Pricebook)}}function ok(i,e){if(i&1&&(f(0,"div",2),le(1,AD,3,1,"div",3),f(2,"div",4),le(3,BD,2,4,"span",5)(4,zD,5,9,"div",6)(5,VD,20,26,"div",7)(6,$D,7,11,"div",8)(7,YD,2,0)(8,QD,5,9,"div",9)(9,ek,2,1)(10,tk,4,7,"div",10)(11,ik,3,4,"div",10)(12,rk,3,3,"div",11),m()()),i&2){let t=e.$implicit,n=O();P("ngStyle",n.stickerStyles),y(),Ce(n.storeService.paperConfiguration().BarcodeVisible?1:-1),y(),P("ngClass",Ae(13,MD,!n.storeService.paperConfiguration().BarcodeVisible)),y(),Ce(n.storeService.paperConfiguration().CodeVisible?3:-1),y(),Ce(n.storeService.paperConfiguration().MoveProductNameOnTop&&n.storeService.paperConfiguration().NameVisible?4:-1),y(),Ce(t.Promotions&&n.storeService.paperConfiguration().PriceVisible?5:-1),y(),Ce(!t.Promotions&&!n.storeService.paperConfiguration().OutletID&&n.storeService.paperConfiguration().PriceVisible?6:-1),y(),Ce(n.storeService.paperConfiguration().OutletID&&n.storeService.paperConfiguration().PriceVisible?7:-1),y(),Ce(!n.storeService.paperConfiguration().MoveProductNameOnTop&&n.storeService.paperConfiguration().NameVisible?8:-1),y(),Ce(n.storeService.paperConfiguration().StoreName?9:-1),y(),Ce(n.storeService.paperConfiguration().ShowReleasedDate?10:-1),y(),Ce(n.storeService.paperConfiguration().ShowPriceDiscount?11:-1),y(),Ce(n.storeService.paperConfiguration().PricebookVisible?12:-1)}}var Zs=(()=>{class i{constructor(){this.items=[],this.previewType="single",this.storeService=z(ke),this.Object=Object,this.cdr=z(cn),this.renderer=z(na),this.elementsInitialized=!1,this.injector=z(Xe)}get barcodeContainerStyles(){let t=0;switch(this.storeService.paperSource()){case"Continuous - 3 Column":t=3;break;case"Continuous - 2 Column":t=2;break;case"Continuous - 1 Column":t=1;break;case"Tom & Jerry 107":t=3;break;case"Tom & Jerry 108":t=5;break}let n={display:"grid",gridTemplateColumns:`repeat(${t}, ${this.items.length===1?"1fr":this.storeService.paperConfiguration().StickerWidth}px)`,gridAutoRows:`${this.storeService.paperConfiguration().StickerHeight}px`,columnGap:`${this.storeService.paperConfiguration().ColumnSpacing}px`,rowGap:`${this.storeService.paperConfiguration().RowSpacing}px`,margin:`${this.storeService.paperConfiguration().MarginTop}px ${this.storeService.paperConfiguration().MarginLeft}px`,maxHeight:"100%",height:`${this.previewType==="single"?"90px":"100%"}`,width:`${this.previewType==="single"?"250px":this.storeService.paperConfiguration().PaperWidth+"px"}`};return console.log("style",n),n}get stickerStyles(){let t=this.storeService.paperConfiguration().StickerWidth,n=this.storeService.paperConfiguration().StickerHeight,r=this.items.length===1&&this.previewType==="single"?"250px":`${typeof t=="number"?t+"px":t}`,o=`${this.previewType==="single"?"90px":n+"px"}`;return{width:r,height:o,overflow:"hidden"}}get barcodeStyle(){return{width:"100%",height:`${this.previewType==="single"?"25px":this.storeService.paperConfiguration().BarcodeHeight+"px"}`}}get taxRate(){if(this.storeService.paperConfiguration().TaxType){let n=this.storeService.taxs().findIndex(r=>r.ID===this.storeService.paperConfiguration().TaxType.ID);if(n!==-1)return this.storeService.taxs()[n].Rate}return 0}get stickerStoreName(){let t={order:"4",lineHeight:"15px"},n={position:"absolute",right:"0",top:"0",transform:"translate(0%, 20%) rotate(270deg)"};return this.storeService.paperConfiguration().Orientation===0?t:n}ngOnInit(){}ngAfterViewInit(){this.elementsInitialized=!0}ngAfterViewChecked(){this.generateBarcodes(),this.elementsInitialized&&(this.generateBarcodes(),this.elementsInitialized=!1)}generateBarcodes(){this.storeService.expandProductItems().forEach((t,n)=>{let r=this.barcodeRef.get(n)?.nativeElement;r&&(0,Ey.default)(r,t.Code,{format:"CODE128",lineColor:"#000",width:20,displayValue:!1})})}promotionDiscount(t){try{return Object.keys(t).length?t.Discount&&t.Discount>0?t.UnitPrice-t.UnitPrice*t.Discount/100:t.UnitPrice:0}catch(n){throw new Error("error: ",n)}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-barcode-preview"]],viewQuery:function(n,r){if(n&1&&yi(FD,5,Et),n&2){let o;ii(o=ni())&&(r.barcodeRef=o)}},inputs:{items:"items",previewType:"previewType"},standalone:!0,features:[_e],decls:3,vars:1,consts:[["barcode",""],["id","barcode-container",1,"barcode-container",3,"ngStyle"],[1,"sticker","position-relative","border","border-dark","d-flex","flex-column",3,"ngStyle"],[1,"sticker-header","d-flex","justify-content-center","px-1"],[1,"sticker-body","d-flex","flex-column","align-items-center","justify-content-center",3,"ngClass"],[1,"text-dark",2,"line-height","1",3,"ngStyle"],[2,"line-height","0.3","width","100%","text-align","center"],[1,"d-flex","flex-column",2,"line-height","1"],[1,"d-flex","align-items-baseline",2,"line-height","1"],[2,"line-height","0","width","100%","text-align","center"],[2,"line-height","1"],[1,"d-flex","gap-1",2,"line-height","1",3,"ngStyle"],["id","barcode",3,"ngStyle"],["class","text-dark",3,"ngStyle",4,"ngIf"],[1,"text-dark",3,"ngStyle"],[1,"d-flex","gap-2","align-items-center"],[1,"promotion__normalprice_label","text-dark","d-flex","justify-content-end",3,"ngStyle"],[1,"d-flex","gap-1","align-items-baseline"],["class","promotion__normalprice text-dark",3,"ngStyle",4,"ngIf"],[1,"promotion__normalprice","text-decoration-line-through","text-danger",3,"ngStyle"],[4,"ngIf"],[1,"promotion__price_label","text-dark","d-flex","justify-content-end",3,"ngStyle"],[1,"d-flex","gap-2"],["class","text-danger promotion__price text-dark",3,"ngStyle",4,"ngIf"],[1,"promotion__price","text-danger","text-dark",3,"ngStyle"],[1,"promotion__normalprice","text-dark",3,"ngStyle"],[1,"text-danger","promotion__price","text-dark",3,"ngStyle"],["class","price text-dark",3,"ngStyle",4,"ngIf"],[1,"price","text-dark",3,"ngStyle"],[3,"ngStyle",4,"ngIf"],[3,"ngStyle"],["id","store-name-horizontal",1,"",2,"line-height","1"],["id","store-name-vertical",1,"position-absolute",2,"line-height","1"]],template:function(n,r){n&1&&(f(0,"div",1),ei(1,ok,13,15,"div",2,RD),m()),n&2&&(P("ngStyle",r.barcodeContainerStyles),y(),ti(r.items))},dependencies:[yp,Py,_p,Vn,bp,ri,Xi,wp,fa],styles:["#barcode[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{height:100%}.storename[_ngcontent-%COMP%]{position:absolute;right:0;top:0;transform:translateY(20%) rotate(270deg)}#store-name-vertical[_ngcontent-%COMP%]{top:50%;right:0;transform:translateY(-50%) rotate(-90deg)}.sticker-body[_ngcontent-%COMP%]{width:100%;display:inline-flex}.sticker-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{line-height:.9!important}"],changeDetection:0})}}return i})();var Dy=(()=>{class i{constructor(){this.storeService=z(ke)}ngOnInit(){}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-customize-label"]],standalone:!0,features:[_e],decls:58,vars:9,consts:[["scrollContainer",""],[1,"d-flex","flex-column","gap-3","h-100"],[1,"topbar","position-static"],[1,"d-flex","top-navbar","navbar-expand-lg",3,"ngClass"],["id","navbarSupportedContent",1,"navbar-collapse","collapse","m-0",3,"ngbCollapse"],[1,"w-100","d-flex","align-items-center","px-3"],[1,"navbar-nav","float-start","me-auto","h-100","d-flex","align-items-center"],[1,"nav-item","d-none","d-lg-block"],[1,"font-robotoslab","m-0"],[1,"navbar-nav","float-end","py-2"],[1,"d-flex","gap-2"],["type","button",1,"btn","btn-outline-secondary","d-flex","gap-1","align-items-center",3,"click"],[1,"f","fas","fa-angle-left"],[1,"fs-3"],[1,"f","fas","fa-angle-right"],[1,"row","mx-2","flex-grow-1","overflow-x-auto",2,"margin-bottom","1rem"],[1,"col-lg-6","col-md-6","d-flex","justify-content-center"],[1,"card","sticky-md-top",2,"height","fit-content"],[1,"card-body","d-flex","justify-content-center","align-items-center"],[3,"items"],[1,"col-lg-6","col-md-6"],[1,"card"],[1,"p-3"],[1,"card-title","mb-0","font-robotoslab",2,"font-size","16px"],[1,"card-body","border-top","p-1"],["ngbAccordion","",3,"closeOthers"],["ngbAccordionItem","",3,"collapsed"],["ngbAccordionHeader",""],["ngbAccordionButton",""],[1,"",2,"font-size","14px"],["ngbAccordionCollapse",""],["ngbAccordionBody","",1,"scroll-container"],[2,"font-size","14px"]],template:function(n,r){if(n&1){let o=Ie();f(0,"div",1)(1,"header",2)(2,"nav",3)(3,"div",4)(4,"div",5)(5,"ul",6)(6,"li",7)(7,"h3",8),x(8,"Customize Label"),m()()(),f(9,"ul",9)(10,"div",10)(11,"button",11),W("click",function(){return ae(o),se(r.storeService.onPrevStep())}),ue(12,"i",12),f(13,"span",13),x(14,"Back"),m()(),f(15,"button",11),W("click",function(){return ae(o),se(r.storeService.onNextStep())}),f(16,"span",13),x(17,"Next"),m(),ue(18,"i",14),m()()()()()()(),f(19,"div",15)(20,"div",16)(21,"div",17)(22,"div",18),ue(23,"app-barcode-preview",19),m()()(),f(24,"div",20)(25,"div",21)(26,"div",22)(27,"h4",23),x(28," Sticker Content "),m()(),f(29,"div",24)(30,"div",25)(31,"div",26)(32,"h2",27)(33,"button",28)(34,"span",29),x(35,"Barcode View"),m()()(),f(36,"div",30)(37,"div",31,0),ue(39,"app-barcode-view"),m()()(),f(40,"div",26)(41,"h2",27)(42,"button",28)(43,"span",32),x(44,"Price"),m()()(),f(45,"div",30)(46,"div",31,0),ue(48,"app-price"),m()()(),f(49,"div",26)(50,"h2",27)(51,"button",28)(52,"span",32),x(53,"Advanced"),m()()(),f(54,"div",30)(55,"div",31,0),ue(57,"app-advanced"),m()()()()()()()()()}n&2&&(y(),Lt("data-navbarbg",r.storeService.options().navbarbg),y(),P("ngClass",r.storeService.options().navbarbg=="skin6"?"navbar-light":"navbar-dark"),y(),P("ngbCollapse",!r.storeService.options().isCollapsed),Lt("data-navbarbg",r.storeService.options().navbarbg),y(20),P("items",r.storeService.expandProductItem()),y(7),P("closeOthers",!0),y(),P("collapsed",!1),y(9),P("collapsed",!0),y(9),P("collapsed",!0))},dependencies:[_a,xa,wa,Pa,Ca,Sa,tr,$n,Xi,xy,Cy,Sy,Zs],styles:[".scroll-container[_ngcontent-%COMP%]{overflow-y:auto;max-height:100vh}"],changeDetection:0})}}return i})();function ak(i,e){if(i&1&&(f(0,"ng-option",3),x(1),m()),i&2){let t=e.$implicit;P("value",t.Name),y(),I(t.Name)}}var ky=(()=>{class i{onInputHandler(t,n){switch(n){case"paperWidth":this.paperWidth.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{PaperWidth:this.paperWidth()}));break;case"stickerWidth":this.stickerWidth.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{StickerWidth:this.stickerWidth()}));break;case"stickerHeight":this.stickerHeight.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{StickerHeight:this.stickerHeight()}));break;case"barcodeHeight":this.barcodeHeight.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{BarcodeHeight:this.barcodeHeight()}));break;case"fontSize":this.fontSize.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{ProductNameFontSize:this.fontSize()}));break}}constructor(){this.options=Ft,this.storeService=z(ke),this.destroyRef=z(Ye),this.injector=z(Xe),this.paperWidth=q(0),this.stickerWidth=q(0),this.stickerHeight=q(0),this.paperSource=q(""),this.barcodeHeight=q(0),this.fontSize=q(0),this.tooltip={paperWidth:"The width of the paper",stickerWidth:"The width of the sticker",stickerHeight:"The height of the sticker",barcodeHeight:"The height of the generated barcode in pixels",fontSize:"Change all font size (except price)"}}ngOnInit(){pt(this.storeService.paperConfiguration,{injector:this.injector}).pipe(xe(t=>{this.paperWidth.set(t.PaperWidth),this.stickerWidth.set(t.StickerWidth),this.stickerHeight.set(t.StickerHeight),this.barcodeHeight.set(t.BarcodeHeight),this.fontSize.set(t.ProductNameFontSize)})).subscribe(),this.paperWidth.set(this.storeService.paperConfiguration().PaperWidth),this.stickerWidth.set(this.storeService.paperConfiguration().StickerWidth),this.stickerHeight.set(this.storeService.paperConfiguration().StickerHeight),this.paperSource.set(this.storeService.paperConfig().PaperFormats[0].Name),this.storeService.paperSource().length==0&&this.storeService.onChangePaperSource(this.storeService.paperConfig().PaperFormats[0].Name)}onChangePaperSource(t){let n=this.storeService.paperConfig().PaperFormats.findIndex(r=>r.Name===t);n!==-1&&(this.storeService.onChangePaperSource(this.storeService.paperConfig().PaperFormats[n].Name),this.storeService.onChangePaperConfiguration(this.storeService.paperConfig().PaperFormats[n]))}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-pp-paper"]],standalone:!0,features:[_e],decls:58,vars:17,consts:[[1,"table","table-bordered"],["for","paperSource",1,"fs-2","d-inline-block","text-truncate"],["searchable","false","clearable","false","id","paperSource","name","paperSource","selecte","",1,"custom","w-100","fs-2",3,"ngModelChange","ngModel"],[3,"value"],[1,"form-text","fst-italic","fw-normal","fs-2"],["for","paperWidth",1,"fs-2","d-inline-block","text-truncate"],["id","paperWidth","name","paperWidth","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],["for","stickerWidth",1,"fs-2","d-inline-block","text-truncate"],["name","stickerWidth","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],["for","stickerHeight",1,"fs-2","d-inline-block","text-truncate"],["id","stickerHeight","name","stickerHeight","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],["for","barcode",1,"fs-2"],["id","barcodeHeight","name","barcodeHeight","type","text",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],["for","fontSize",1,"fs-2","d-inline-block","text-truncate"],["id","fontSize","name","fontSize","type","text",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"]],template:function(n,r){n&1&&(f(0,"table",0)(1,"tbody")(2,"tr")(3,"td")(4,"label",1),x(5,"Paper Source"),m()(),f(6,"td")(7,"ng-select",2),W("ngModelChange",function(a){return r.onChangePaperSource(a)}),ei(8,ak,2,2,"ng-option",3,la),m()(),f(10,"td")(11,"span",4),x(12),m()()(),f(13,"tr")(14,"td")(15,"label",5),x(16,"Paper Width"),m()(),f(17,"td")(18,"input",6),W("ngModelChange",function(a){return r.onInputHandler(a,"paperWidth")}),m()(),f(19,"td")(20,"span",4),x(21),m()()(),f(22,"tr")(23,"td")(24,"label",7),x(25,"Sticker Width"),m()(),f(26,"td")(27,"input",8),W("ngModelChange",function(a){return r.onInputHandler(a,"stickerWidth")}),m()(),f(28,"td")(29,"span",4),x(30),m()()(),f(31,"tr")(32,"th")(33,"label",9),x(34,"Sticker Height"),m()(),f(35,"td")(36,"input",10),W("ngModelChange",function(a){return r.onInputHandler(a,"stickerHeight")}),m()(),f(37,"td")(38,"span",4),x(39),m()()(),f(40,"tr")(41,"td")(42,"label",11),x(43,"Barcode Height"),m()(),f(44,"td")(45,"input",12),W("ngModelChange",function(a){return r.onInputHandler(a,"barcodeHeight")}),m()(),f(46,"td")(47,"span",4),x(48),m()()(),f(49,"tr")(50,"td")(51,"label",13),x(52,"Font Size"),m()(),f(53,"td")(54,"input",14),W("ngModelChange",function(a){return r.onInputHandler(a,"fontSize")}),m()(),f(55,"td")(56,"span",4),x(57),m()()()()()),n&2&&(y(7),P("ngModel",r.storeService.paperSource()),y(),ti(r.storeService.paperConfig().PaperFormats),y(4),I(r.tooltip.paperWidth),y(6),P("maskito",r.options)("ngModel",r.paperWidth()),y(3),I(r.tooltip.paperWidth),y(6),P("maskito",r.options)("ngModel",r.stickerWidth()),y(3),I(r.tooltip.stickerWidth),y(6),P("maskito",r.options)("ngModel",r.stickerHeight()),y(3),I(r.tooltip.stickerHeight),y(6),P("maskito",r.options)("ngModel",r.barcodeHeight()),y(3),I(r.tooltip.barcodeHeight),y(6),P("maskito",r.options)("ngModel",r.fontSize()),y(3),I(r.tooltip.fontSize))},dependencies:[ht,tt,it,Dt,rt,oi,_i,Aa,Ji],styles:["table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{vertical-align:middle}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:last-child{width:50%}"],changeDetection:0})}}return i})();function sk(i,e){if(i&1&&(f(0,"span",14),x(1),m()),i&2){let t=O();y(),I(t.tooltip.leftIndent)}}function lk(i,e){if(i&1&&(f(0,"span",14),x(1),m()),i&2){let t=O();y(),I(t.tooltip.topIndent)}}function ck(i,e){if(i&1&&(f(0,"span",14),x(1),m()),i&2){let t=O();y(),I(t.tooltip.rowSpacing)}}function dk(i,e){if(i&1&&(f(0,"span",14),x(1),m()),i&2){let t=O();y(),I(t.tooltip.columnSpacing)}}var Ty=(()=>{class i{constructor(){this.options=Ft,this.tooltip={leftIndent:"The number of pixels appended before the first COLUMN",topIndent:"The number of pixels appended after the first ROW",rowSpacing:"The number of pixels between each ROW",columnSpacing:"The number of pixels between each COLUMN"},this.leftIndent=q(0),this.topIndent=q(0),this.rowSpacing=q(0),this.columnSpacing=q(0),this.storeService=z(ke),this.destroyRef=z(Ye),this.injector=z(Xe)}onInputHandler(t,n){switch(n){case"marginLeft":this.leftIndent.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{MarginLeft:this.leftIndent()}));break;case"marginTop":this.topIndent.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{MarginTop:this.topIndent()}));break;case"rowSpacing":this.rowSpacing.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{RowSpacing:this.rowSpacing()}));break;case"columnSpacing":this.columnSpacing.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{ColumnSpacing:this.columnSpacing()}));break}}ngOnInit(){pt(this.storeService.paperConfiguration,{injector:this.injector}).pipe(Je(this.destroyRef),xe(t=>{this.leftIndent.set(t.MarginLeft),this.topIndent.set(t.MarginTop),this.rowSpacing.set(t.RowSpacing),this.columnSpacing.set(t.ColumnSpacing)})).subscribe()}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-pp-spacing"]],standalone:!0,features:[_e],decls:46,vars:12,consts:[["leftIndentTemplate",""],["topIndentTemplate",""],["rowSpacingTemplate",""],["columnSpacingTemplate",""],[1,"table","table-bordered"],["for","leftIndent",1,"fs-2","d-inline-block","text-truncate"],["id","leftIndent","name","leftIndent","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],[1,"form-text","fst-italic","fs-2","fw-normal"],["for","topIndent",1,"fs-2","d-inline-block","text-truncate"],["id","topIndent","name","topIndent","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],["for","rowSpacing",1,"fs-2","d-inline-block","text-truncate"],["id","rowSpacing","name","rowSpacing","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],["for","columnSpacing",1,"fs-2","d-inline-block","text-truncate"],["id","columnSpacing","name","columnSpacing","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],[1,"fst-italic"]],template:function(n,r){if(n&1){let o=Ie();f(0,"table",4)(1,"tbody")(2,"tr")(3,"td")(4,"label",5),x(5,"Left Indent"),m()(),f(6,"td")(7,"input",6),W("ngModelChange",function(s){return ae(o),se(r.onInputHandler(s,"marginLeft"))}),m()(),f(8,"td")(9,"span",7),x(10),m()()(),f(11,"tr")(12,"td")(13,"label",8),x(14,"Top Indent"),m()(),f(15,"td")(16,"input",9),W("ngModelChange",function(s){return ae(o),se(r.onInputHandler(s,"marginTop"))}),m()(),f(17,"td")(18,"span",7),x(19),m()()(),f(20,"tr")(21,"td")(22,"label",10),x(23,"Row Spacing"),m()(),f(24,"td")(25,"input",11),W("ngModelChange",function(s){return ae(o),se(r.onInputHandler(s,"rowSpacing"))}),m()(),f(26,"td")(27,"span",7),x(28),m()()(),f(29,"tr")(30,"th")(31,"label",12),x(32,"Column Spacing"),m()(),f(33,"td")(34,"input",13),W("ngModelChange",function(s){return ae(o),se(r.onInputHandler(s,"columnSpacing"))}),m()(),f(35,"td")(36,"span",7),x(37),m()()()()(),le(38,sk,2,1,"ng-template",null,0,me)(40,lk,2,1,"ng-template",null,1,me)(42,ck,2,1,"ng-template",null,2,me)(44,dk,2,1,"ng-template",null,3,me)}n&2&&(y(7),P("maskito",r.options)("ngModel",r.leftIndent()),y(3),I(r.tooltip.leftIndent),y(6),P("maskito",r.options)("ngModel",r.topIndent()),y(3),I(r.tooltip.topIndent),y(6),P("maskito",r.options)("ngModel",r.rowSpacing()),y(3),I(r.tooltip.rowSpacing),y(6),P("maskito",r.options)("ngModel",r.columnSpacing()),y(3),I(r.tooltip.columnSpacing))},dependencies:[ht,tt,it,Dt,rt,Ji,oi],styles:["table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{vertical-align:middle}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:last-child{width:50%}"],changeDetection:0})}}return i})();function uk(i,e){if(i&1&&(f(0,"span",8),x(1),m()),i&2){let t=O();y(),I(t.tooltip.basicPriceLabel)}}function pk(i,e){if(i&1&&(f(0,"span",8),x(1),m()),i&2){let t=O();y(),I(t.tooltip.promotionPriceLabel)}}var Iy=(()=>{class i{constructor(){this.tooltip={basicPriceLabel:"Custom label normal price",promotionPriceLabel:"Custom label promotion price"},this.storeService=z(ke),this.destroyRef=z(Ye),this.injector=z(Xe),this.basicPriceLabel=q(""),this.promotionPriceLabel=q(""),this.options=Ft}ngOnInit(){pt(this.storeService.paperConfiguration,{injector:this.injector}).pipe(Je(this.destroyRef),xe(t=>{this.basicPriceLabel.set(t.BasicPriceLabel),this.promotionPriceLabel.set(t.PromotionPriceLabel)})).subscribe()}onInputHandler(t,n){switch(n){case"basicPriceLabel":this.basicPriceLabel.set(t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{BasicPriceLabel:this.basicPriceLabel()}));break;case"promotionPriceLabel":this.promotionPriceLabel.set(t),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{PromotionPriceLabel:this.promotionPriceLabel()}));break}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-pp-label"]],standalone:!0,features:[_e],decls:24,vars:4,consts:[["basicPriceLabelTemplate",""],["promotionPriceLabelTemplate",""],[1,"table","table-bordered"],["for","normalPrice",1,"fs-2","d-inline-block","text-truncate"],["id","normalPrice","name","basicPriceLabel","type","text",1,"form-control","fs-2",3,"ngModelChange","ngModel"],[1,"form-text","fst-italic","fs-2","fw-normal"],["for","promotionPrice",1,"fs-2","d-inline-block","text-truncate"],["id","promotionPrice","name","promotionPriceLabel","type","text",1,"form-control","fs-1",3,"ngModelChange","ngModel"],[1,"fst-italic"]],template:function(n,r){if(n&1){let o=Ie();f(0,"table",2)(1,"tbody")(2,"tr")(3,"td")(4,"label",3),x(5,"Normal Price"),m()(),f(6,"td")(7,"input",4),W("ngModelChange",function(s){return ae(o),se(r.onInputHandler(s,"basicPriceLabel"))}),m()(),f(8,"td")(9,"span",5),x(10),m()()(),f(11,"tr")(12,"td")(13,"label",6),x(14,"Promotion Price"),m()(),f(15,"td")(16,"input",7),W("ngModelChange",function(s){return ae(o),se(r.onInputHandler(s,"promotionPriceLabel"))}),m()(),f(17,"td")(18,"span",5),x(19),m()()()()(),le(20,uk,2,1,"ng-template",null,0,me)(22,pk,2,1,"ng-template",null,1,me)}n&2&&(y(7),P("ngModel",r.basicPriceLabel()),y(3),I(r.tooltip.basicPriceLabel),y(6),P("ngModel",r.promotionPriceLabel()),y(3),I(r.tooltip.promotionPriceLabel))},dependencies:[ht,tt,it,Dt,rt],styles:["table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{vertical-align:middle}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:last-child{width:50%}"],changeDetection:0})}}return i})();var Ry=De(Oy());function hk(i,e){if(i&1){let t=Ie();f(0,"tr")(1,"td")(2,"label",6),x(3,"Pricebook Font Size"),m()(),f(4,"td")(5,"input",7),W("ngModelChange",function(r){ae(t);let o=O();return se(o.onInputHandler(r,"pricebookFontSize"))}),m()(),f(6,"td")(7,"span",5),x(8),m()()()}if(i&2){let t=O();y(5),P("maskito",t.options)("ngModel",t.pricebookFontSize()),y(3),I(t.tooltip.pricebookFontSize)}}function fk(i,e){if(i&1&&(f(0,"span",8),x(1),m()),i&2){let t=O();y(),I(t.tooltip.pricebookFontSize)}}function mk(i,e){if(i&1&&(f(0,"span",8),x(1),m()),i&2){let t=O();y(),I(t.tooltip.fontSize)}}var Fy=(()=>{class i{constructor(){this.options=Ft,this.barcodeHeight=q(0),this.fontSize=q(0),this.barcode=q(!1),this.code=q(!1),this.price=q(!1),this.name=q(!1),this.moveProductName=q(!1),this.releaseDate=q(!1),this.discountVisible=q(!1),this.pricebookPrice=q(!1),this.pricebookFontSize=q(0),this.tooltip={fontSize:"Change font size for price",pricebookFontSize:"Change font size for pricebook price"},this.storeService=z(ke),this.injector=z(Xe),this.destroyRef=z(Ye)}ngOnInit(){pt(this.storeService.paperConfiguration,{injector:this.injector}).pipe(Je(this.destroyRef),xe(t=>{this.pricebookFontSize.set(t.PricebookFontSize),this.fontSize.set(t.PriceFontSize)})).subscribe()}onInputHandler(t,n){switch(console.log("value",t),n){case"pricebookFontSize":this.fontSize.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{ProductNameFontSize:this.fontSize()}));break;case"fontSize":this.fontSize.set(parseFloat(t.replace("px",""))),this.storeService.onChangePaperConfiguration(D(v({},this.storeService.paperConfiguration()),{PriceFontSize:this.fontSize()}));break}}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-price-fontsize"]],standalone:!0,features:[_e],decls:16,vars:4,consts:[["pricebookFontSizeTemplate",""],["fontSizeTemplate",""],[1,"table","table-bordered"],["for","fontSize",1,"fs-2","d-inline-block","text-truncate"],["id","fontSize","name","fontSize","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],[1,"form-text","fst-italic","fs-2","fw-normal"],["for","pricebookFontSize",1,"fs-2","d-inline-block","text-truncate"],["id","pricebookFontSize","name","pricebookFontSize","type","text","inputmode","number",1,"form-control","fs-2",3,"ngModelChange","maskito","ngModel"],[1,"fst-italic"]],template:function(n,r){if(n&1){let o=Ie();f(0,"table",2)(1,"tbody"),le(2,hk,9,3,"tr"),f(3,"tr")(4,"td")(5,"label",3),x(6,"Font Size"),m()(),f(7,"td")(8,"input",4),W("ngModelChange",function(s){return ae(o),se(r.onInputHandler(s,"fontSize"))}),m()(),f(9,"td")(10,"span",5),x(11),m()()()()(),le(12,fk,2,1,"ng-template",null,0,me)(14,mk,2,1,"ng-template",null,1,me)}n&2&&(y(2),Ce(r.storeService.paperConfiguration().PricebookVisible?2:-1),y(6),P("maskito",r.options)("ngModel",r.fontSize()),y(3),I(r.tooltip.fontSize))},dependencies:[Ji,ri,ht,tt,it,Dt],styles:["table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{vertical-align:middle}table[_ngcontent-%COMP%] > tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]:last-child{width:50%}"]})}}return i})();function gk(i,e){i&1&&(f(0,"button",14)(1,"span",13),x(2,"Next"),m(),ue(3,"i",33),m())}function yk(i,e){if(i&1){let t=Ie();f(0,"button",34),W("click",function(){ae(t);let r=O();return se(r.printBarcode())}),f(1,"span",13),x(2,"Print"),m()()}}var My=(()=>{class i{constructor(){this.storeService=z(ke),this.httpService=z(bi),this.toastr=z(Ta),this.destroyRef=z(Ye)}ngOnInit(){document.addEventListener("keydown",t=>{t instanceof KeyboardEvent&&t.key==="p"&&t.ctrlKey&&(t.preventDefault(),this.printBarcode())})}printBarcode(){let t=0;switch(this.storeService.paperSource()){case"Continuous - 3 Column":t=3;break;case"Continuous - 2 Column":t=2;break;case"Continuous - 1 Column":t=1;break;case"Tom & Jerry 107":t=3;break;case"Tom & Jerry 108":t=5;break}(0,Ry.default)({printable:"barcode-container",type:"html",css:"https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css",style:`
|
|
31
|
+
body {
|
|
32
|
+
font-family: Arial, Helvetica, sans-serif;
|
|
33
|
+
font-size: ${this.storeService.paperConfiguration().ProductNameFontSize}px;
|
|
34
|
+
margin: 0;
|
|
35
|
+
padding: 0;
|
|
36
|
+
|
|
37
|
+
}
|
|
38
|
+
.barcode-container {
|
|
39
|
+
|
|
40
|
+
display: grid;
|
|
41
|
+
grid-template-columns: repeat(${t}, ${this.storeService.paperConfiguration().StickerWidth}px);
|
|
42
|
+
grid-auto-rows: ${this.storeService.paperConfiguration().StickerHeight}px;
|
|
43
|
+
gap: ${this.storeService.paperConfiguration().RowSpacing}px ${this.storeService.paperConfiguration().ColumnSpacing}px;
|
|
44
|
+
padding-left: ${this.storeService.paperConfiguration().MarginLeft}px;
|
|
45
|
+
padding-top: ${this.storeService.paperConfiguration().MarginTop}px;
|
|
46
|
+
}
|
|
47
|
+
.sticker {
|
|
48
|
+
border: none !important;
|
|
49
|
+
height: ${this.storeService.paperConfiguration().StickerHeight}px;
|
|
50
|
+
// margin-top: ${this.storeService.paperConfiguration().MarginTop}px;
|
|
51
|
+
overflow: hidden;
|
|
52
|
+
}
|
|
53
|
+
.sticker-body {
|
|
54
|
+
display: flex;
|
|
55
|
+
flex-direction: column;
|
|
56
|
+
justify-content: center;
|
|
57
|
+
|
|
58
|
+
}
|
|
59
|
+
.sticker-body div {
|
|
60
|
+
width: 100%;
|
|
61
|
+
text-align: center;
|
|
62
|
+
}
|
|
63
|
+
.sticker-body div {
|
|
64
|
+
line-height: 1;
|
|
65
|
+
width: 100%;
|
|
66
|
+
display: inline-flex;
|
|
67
|
+
justify-content: center;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.sticker-header canvas {
|
|
71
|
+
height: ${this.storeService.paperConfiguration().BarcodeHeight}px;
|
|
72
|
+
width: 100%;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
#store-name-vertical {
|
|
78
|
+
top: 50%;
|
|
79
|
+
right: 5%;
|
|
80
|
+
transform: translate(50%, -50%) rotate(-90deg);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.sticker-body .price {
|
|
84
|
+
|
|
85
|
+
font-size: ${this.storeService.paperConfiguration().PriceFontSize}px !important;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.sticker-body .promotion__normalprice_label {
|
|
89
|
+
font-size: ${this.storeService.paperConfiguration().ProductNameFontSize}px !important;
|
|
90
|
+
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.sticker-body .promotion__price_label {
|
|
94
|
+
|
|
95
|
+
font-size: ${this.storeService.paperConfiguration().ProductNameFontSize}px !important;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.sticker-body .promotion__normalprice {
|
|
99
|
+
text-decoration-color: red !important;
|
|
100
|
+
color: #000 !important;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.sticker-body .promotion__price {
|
|
104
|
+
color: #000 !important;
|
|
105
|
+
}
|
|
106
|
+
`,font_size:"",targetStyle:["*"],onError:n=>{console.error("printjs",n)},onLoadingEnd:()=>{this.onSaveConfig()}})}ngAfterViewInit(){}onSaveConfig(){let t=this.storeService.paperConfig().PaperFormats,n=t.findIndex(a=>a.Name===this.storeService.paperConfiguration().Name);n!==-1&&(t[n]=this.storeService.paperConfiguration());let r={PaperFormats:[...t],SubDomain:localStorage.getItem("Domain")};console.log("Debug \u{1F41E} ==> Class: PrintPreviewComponent, Function: onSaveConfig, Line 189 payload(): ",`
|
|
107
|
+
`,r);let o={responseType:"text",observe:"response"};this.httpService.post("api/Config/SaveConfig",r,o).pipe(Je(this.destroyRef),hn("response"),xe(a=>{a instanceof xp&&a.status===200&&this.toastr.success(a.body,"success")}),ll(1)).subscribe()}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-print-preview"]],standalone:!0,features:[_e],decls:66,vars:11,consts:[["scrollContainer",""],[1,"d-flex","flex-column","gap-4","h-100"],[1,"topbar","position-static"],[1,"d-flex","top-navbar","navbar-expand-lg",3,"ngClass"],["id","navbarSupportedContent",1,"navbar-collapse","collapse","m-0",3,"ngbCollapse"],[1,"w-100","d-flex","align-items-center","px-3"],[1,"navbar-nav","float-start","me-auto","h-100","d-flex","align-items-center"],[1,"nav-item","d-none","d-lg-block"],[1,"font-robotoslab","m-0"],[1,"navbar-nav","float-end","py-2"],[1,"d-flex","gap-2"],["type","button",1,"btn","btn-outline-secondary","d-flex","gap-1","align-items-center",3,"click"],[1,"f","fas","fa-angle-left"],[1,"fs-3"],["type","button",1,"btn","btn-info","d-flex","gap-1","align-items-center"],["type","button",1,"btn","btn-success"],[1,"row","mx-2","flex-grow-1","overflow-x-auto",2,"margin-bottom","1rem"],[1,"col-lg-6","col-md-12"],[1,"card","h-100"],[1,"card-body","d-flex","justify-content-center",2,"height","0"],["id","barcode-container",1,"scroll-container",2,"border","1px dashed black"],["previewType","multiple",3,"items"],[1,"card"],[1,"p-3"],[1,"card-title","mb-0",2,"font-size","16px"],[1,"card-body","border-top","p-1"],["ngbAccordion","",3,"closeOthers"],["ngbAccordionItem","",3,"collapsed"],["ngbAccordionHeader",""],["ngbAccordionButton",""],[2,"font-size","14px"],["ngbAccordionCollapse",""],["ngbAccordionBody","",1,"scroll-container"],[1,"f","fas","fa-angle-right"],["type","button",1,"btn","btn-success",3,"click"]],template:function(n,r){if(n&1){let o=Ie();f(0,"div",1)(1,"header",2)(2,"nav",3)(3,"div",4)(4,"div",5)(5,"ul",6)(6,"li",7)(7,"h3",8),x(8,"Print Preview"),m()()(),f(9,"ul",9)(10,"div",10)(11,"button",11),W("click",function(){return ae(o),se(r.storeService.onPrevStep())}),ue(12,"i",12),f(13,"span",13),x(14,"Back"),m()(),le(15,gk,4,0,"button",14)(16,yk,3,0,"button",15),m()()()()()(),f(17,"div",16)(18,"div",17)(19,"div",18)(20,"div",19)(21,"div",20),ue(22,"app-barcode-preview",21),m()()()(),f(23,"div",17)(24,"div",22)(25,"div",23)(26,"h4",24),x(27,"Label Spacing"),m()(),f(28,"div",25)(29,"div",26)(30,"div",27)(31,"h2",28)(32,"button",29)(33,"span",30),x(34,"Paper"),m()()(),f(35,"div",31)(36,"div",32,0),ue(38,"app-pp-paper"),m()()(),f(39,"div",27)(40,"h2",28)(41,"button",29)(42,"span",30),x(43,"Price Font Size"),m()()(),f(44,"div",31)(45,"div",32,0),ue(47,"app-price-fontsize"),m()()(),f(48,"div",27)(49,"h2",28)(50,"button",29)(51,"span",30),x(52,"Spacing"),m()()(),f(53,"div",31)(54,"div",32,0),ue(56,"app-pp-spacing"),m()()(),f(57,"div",27)(58,"h2",28)(59,"button",29)(60,"span",30),x(61,"Label"),m()()(),f(62,"div",31)(63,"div",32,0),ue(65,"app-pp-label"),m()()()()()()()()()}n&2&&(y(),Lt("data-navbarbg",r.storeService.options().navbarbg),y(),P("ngClass",r.storeService.options().navbarbg=="skin6"?"navbar-light":"navbar-dark"),y(),P("ngbCollapse",!r.storeService.options().isCollapsed),Lt("data-navbarbg",r.storeService.options().navbarbg),y(12),Ce(r.storeService.stepper$().state<2?15:16),y(7),P("items",r.storeService.expandProductItems()),y(7),P("closeOthers",!0),y(),P("collapsed",!1),y(9),P("collapsed",!0),y(9),P("collapsed",!0),y(9),P("collapsed",!0))},dependencies:[_a,xa,wa,Pa,Ca,Sa,tr,Xi,$n,ky,Ty,Iy,Zs,Fy],styles:[".scroll-container[_ngcontent-%COMP%]{overflow-y:auto;max-height:100%;overflow-x:hidden}#barcode-container[_ngcontent-%COMP%] div[_ngcontent-%COMP%] .metadata[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0} .barcode{width:100%} .barcode img{width:inherit}"]})}}return i})();function vk(i,e){i&1&&ue(0,"choose-product")}function bk(i,e){i&1&&ue(0,"app-customize-label")}function _k(i,e){i&1&&ue(0,"app-print-preview")}var Ay=(()=>{class i{constructor(){this.storeService=z(ke),this.httpService=z(bi),this.destroyRef=z(Ye),this.options=this.storeService.options()}ngOnInit(){this.storeService.onReset(),console.log(localStorage.getItem("Domain"))}checkProtocol(t){return!!t.match(/^(https?):\/\//)}ngAfterViewInit(){let t=localStorage.getItem("Domain"),n=this.checkProtocol(t)?new URL(t).hostname:t;ea([this.httpService.post("api/Config/PaperConfig",{SubDomain:n},void 0).pipe(Tr(r=>Le({error:r}))),this.httpService.get("/API/V3/Tax",void 0,`https://${n}`).pipe(Tr(r=>Le({error:r})))]).pipe(Je(this.destroyRef),hn("response"),Zt(([r,o])=>"error"in r||"error"in o?(console.warn("Error in one or more requests",{paperConfig:r,taxs:o}),{paperConfig:null,taxs:null}):{paperConfig:r,taxs:o}),xe(({paperConfig:r,taxs:o})=>{r&&(this.storeService.onChangePaperConfig(D(v({},r),{PaperFormats:r.PaperFormats.map(a=>D(v({},a),{OutletID:null}))})),r.PaperFormats.length>0&&this.storeService.onChangePaperConfiguration(r.PaperFormats[0])),o&&this.storeService.onChangeTaxs(o)})).subscribe()}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=fe({type:i,selectors:[["app-dashboard"]],standalone:!0,features:[_e],decls:3,vars:1,template:function(n,r){if(n&1&&le(0,vk,1,0,"choose-product")(1,bk,1,0,"app-customize-label")(2,_k,1,0,"app-print-preview"),n&2){let o;Ce((o=r.storeService.stepper$().state)===0?0:o===1?1:o===2?2:-1)}},dependencies:[tr,_y,Dy,My]})}}return i})();var a6=[{path:"",children:[{path:"",component:Ay}]}];export{a6 as dashboardRoutes};
|