@esri/solution-common 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/resources/convert-item-resource-to-storage-resource.d.ts +4 -2
- package/dist/esm/resources/convert-item-resource-to-storage-resource.js +24 -2
- package/dist/esm/resources/convert-item-resource-to-storage-resource.js.map +1 -1
- package/dist/node/resources/convert-item-resource-to-storage-resource.d.ts +4 -2
- package/dist/node/resources/convert-item-resource-to-storage-resource.js +24 -2
- package/dist/node/resources/convert-item-resource-to-storage-resource.js.map +1 -1
- package/dist/umd/common.umd.js +53 -32
- package/dist/umd/common.umd.js.map +1 -1
- package/dist/umd/common.umd.min.js +3 -3
- package/dist/umd/common.umd.min.js.map +1 -1
- package/dist/umd/resources/convert-item-resource-to-storage-resource.d.ts +4 -2
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* @preserve
|
|
2
|
-
* @esri/solution-common - v1.3.
|
|
2
|
+
* @esri/solution-common - v1.3.2 - Apache-2.0
|
|
3
3
|
* Copyright (c) 2018-2022 Esri, Inc.
|
|
4
|
-
* Thu
|
|
4
|
+
* Thu Mar 03 2022 14:32:59 GMT-0800 (Pacific Standard Time)
|
|
5
5
|
*
|
|
6
6
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
7
|
* you may not use this file except in compliance with the License.
|
|
@@ -15,5 +15,5 @@
|
|
|
15
15
|
* See the License for the specific language governing permissions and
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@esri/arcgis-rest-feature-layer"),require("@esri/hub-common"),require("@esri/arcgis-rest-portal"),require("@esri/arcgis-rest-request"),require("@esri/arcgis-rest-auth"),require("@esri/arcgis-rest-service-admin"),require("@esri/hub-sites")):"function"==typeof define&&define.amd?define(["exports","@esri/arcgis-rest-feature-layer","@esri/hub-common","@esri/arcgis-rest-portal","@esri/arcgis-rest-request","@esri/arcgis-rest-auth","@esri/arcgis-rest-service-admin","@esri/hub-sites"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).arcgisSolution=e.arcgisSolution||{},e.arcgisRest,e.arcgisHub,e.arcgisRest,e.arcgisRest,e.arcgisRest,e.arcgisRest,e.arcgisHub)}(this,(function(e,t,r,n,i,o,a,s){"use strict";function l(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var c=l(n),u=l(s),f="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},d=[],h=[],p="undefined"!=typeof Uint8Array?Uint8Array:Array,m=!1;function g(){m=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,r=e.length;t<r;++t)d[t]=e[t],h[e.charCodeAt(t)]=t;h["-".charCodeAt(0)]=62,h["_".charCodeAt(0)]=63}function y(e,t,r){for(var n,i,o=[],a=t;a<r;a+=3)n=(e[a]<<16)+(e[a+1]<<8)+e[a+2],o.push(d[(i=n)>>18&63]+d[i>>12&63]+d[i>>6&63]+d[63&i]);return o.join("")}function v(e){var t;m||g();for(var r=e.length,n=r%3,i="",o=[],a=16383,s=0,l=r-n;s<l;s+=a)o.push(y(e,s,s+a>l?l:s+a));return 1===n?(t=e[r-1],i+=d[t>>2],i+=d[t<<4&63],i+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],i+=d[t>>10],i+=d[t>>4&63],i+=d[t<<2&63],i+="="),o.push(i),o.join("")}function b(e,t,r,n,i){var o,a,s=8*i-n-1,l=(1<<s)-1,c=l>>1,u=-7,f=r?i-1:0,d=r?-1:1,h=e[t+f];for(f+=d,o=h&(1<<-u)-1,h>>=-u,u+=s;u>0;o=256*o+e[t+f],f+=d,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=n;u>0;a=256*a+e[t+f],f+=d,u-=8);if(0===o)o=1-c;else{if(o===l)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),o-=c}return(h?-1:1)*a*Math.pow(2,o-n)}function w(e,t,r,n,i,o){var a,s,l,c=8*o-i-1,u=(1<<c)-1,f=u>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,p=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+f>=1?d/l:d*Math.pow(2,1-f))*l>=2&&(a++,l/=2),a+f>=u?(s=0,a=u):a+f>=1?(s=(t*l-1)*Math.pow(2,i),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;e[r+h]=255&s,h+=p,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;e[r+h]=255&a,h+=p,a/=256,c-=8);e[r+h-p]|=128*m}var _={}.toString,x=Array.isArray||function(e){return"[object Array]"==_.call(e)};function I(){return S.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function k(e,t){if(I()<t)throw new RangeError("Invalid typed array length");return S.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=S.prototype:(null===e&&(e=new S(t)),e.length=t),e}function S(e,t,r){if(!(S.TYPED_ARRAY_SUPPORT||this instanceof S))return new S(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return T(this,e)}return E(this,e,t,r)}function E(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n);S.TYPED_ARRAY_SUPPORT?(e=t).__proto__=S.prototype:e=P(e,t);return e}(e,t,r,n):"string"==typeof t?function(e,t,r){"string"==typeof r&&""!==r||(r="utf8");if(!S.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|R(t,r),i=(e=k(e,n)).write(t,r);i!==n&&(e=e.slice(0,i));return e}(e,t,r):function(e,t){if(F(t)){var r=0|O(t.length);return 0===(e=k(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?k(e,0):P(e,t);if("Buffer"===t.type&&x(t.data))return P(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function A(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function T(e,t){if(A(t),e=k(e,t<0?0:0|O(t)),!S.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function P(e,t){var r=t.length<0?0:0|O(t.length);e=k(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function O(e){if(e>=I())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+I().toString(16)+" bytes");return 0|e}function F(e){return!(null==e||!e._isBuffer)}function R(e,t){if(F(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return oe(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return ae(e).length;default:if(n)return oe(e).length;t=(""+t).toLowerCase(),n=!0}}function C(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return $(this,t,r);case"utf8":case"utf-8":return G(this,t,r);case"ascii":return q(this,t,r);case"latin1":case"binary":return Y(this,t,r);case"base64":return V(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return H(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function z(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function D(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=S.from(t,n)),F(t))return 0===t.length?-1:L(e,t,r,n,i);if("number"==typeof t)return t&=255,S.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):L(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function L(e,t,r,n,i){var o,a=1,s=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,l/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var u=-1;for(o=r;o<s;o++)if(c(e,o)===c(t,-1===u?0:o-u)){if(-1===u&&(u=o),o-u+1===l)return u*a}else-1!==u&&(o-=o-u),u=-1}else for(r+l>s&&(r=s-l),o=r;o>=0;o--){for(var f=!0,d=0;d<l;d++)if(c(e,o+d)!==c(t,d)){f=!1;break}if(f)return o}return-1}function U(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[r+a]=s}return a}function B(e,t,r,n){return se(oe(t,e.length-r),e,r,n)}function N(e,t,r,n){return se(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function j(e,t,r,n){return N(e,t,r,n)}function M(e,t,r,n){return se(ae(t),e,r,n)}function W(e,t,r,n){return se(function(e,t){for(var r,n,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)n=(r=e.charCodeAt(a))>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function V(e,t,r){return 0===t&&r===e.length?v(e):v(e.slice(t,r))}function G(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,a,s,l,c=e[i],u=null,f=c>239?4:c>223?3:c>191?2:1;if(i+f<=r)switch(f){case 1:c<128&&(u=c);break;case 2:128==(192&(o=e[i+1]))&&(l=(31&c)<<6|63&o)>127&&(u=l);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(l=(15&c)<<12|(63&o)<<6|63&a)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(l=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(u=l)}null===u?(u=65533,f=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),i+=f}return function(e){var t=e.length;if(t<=Z)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=Z));return r}(n)}S.TYPED_ARRAY_SUPPORT=void 0===f.TYPED_ARRAY_SUPPORT||f.TYPED_ARRAY_SUPPORT,S.poolSize=8192,S._augment=function(e){return e.__proto__=S.prototype,e},S.from=function(e,t,r){return E(null,e,t,r)},S.TYPED_ARRAY_SUPPORT&&(S.prototype.__proto__=Uint8Array.prototype,S.__proto__=Uint8Array),S.alloc=function(e,t,r){return function(e,t,r,n){return A(t),t<=0?k(e,t):void 0!==r?"string"==typeof n?k(e,t).fill(r,n):k(e,t).fill(r):k(e,t)}(null,e,t,r)},S.allocUnsafe=function(e){return T(null,e)},S.allocUnsafeSlow=function(e){return T(null,e)},S.isBuffer=le,S.compare=function(e,t){if(!F(e)||!F(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},S.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},S.concat=function(e,t){if(!x(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return S.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=S.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var o=e[r];if(!F(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},S.byteLength=R,S.prototype._isBuffer=!0,S.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)z(this,t,t+1);return this},S.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)z(this,t,t+3),z(this,t+1,t+2);return this},S.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)z(this,t,t+7),z(this,t+1,t+6),z(this,t+2,t+5),z(this,t+3,t+4);return this},S.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?G(this,0,e):C.apply(this,arguments)},S.prototype.equals=function(e){if(!F(e))throw new TypeError("Argument must be a Buffer");return this===e||0===S.compare(this,e)},S.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},S.prototype.compare=function(e,t,r,n,i){if(!F(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(n,i),c=e.slice(t,r),u=0;u<s;++u)if(l[u]!==c[u]){o=l[u],a=c[u];break}return o<a?-1:a<o?1:0},S.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},S.prototype.indexOf=function(e,t,r){return D(this,e,t,r,!0)},S.prototype.lastIndexOf=function(e,t,r){return D(this,e,t,r,!1)},S.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return U(this,e,t,r);case"utf8":case"utf-8":return B(this,e,t,r);case"ascii":return N(this,e,t,r);case"latin1":case"binary":return j(this,e,t,r);case"base64":return M(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return W(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},S.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Z=4096;function q(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function Y(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function $(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=ie(e[o]);return i}function H(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function J(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function K(e,t,r,n,i,o){if(!F(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function X(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i<o;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function Q(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i<o;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function ee(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function te(e,t,r,n,i){return i||ee(e,0,r,4),w(e,t,r,n,23,4),r+4}function re(e,t,r,n,i){return i||ee(e,0,r,8),w(e,t,r,n,52,8),r+8}S.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),S.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=S.prototype;else{var i=t-e;r=new S(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+e]}return r},S.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||J(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},S.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||J(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},S.prototype.readUInt8=function(e,t){return t||J(e,1,this.length),this[e]},S.prototype.readUInt16LE=function(e,t){return t||J(e,2,this.length),this[e]|this[e+1]<<8},S.prototype.readUInt16BE=function(e,t){return t||J(e,2,this.length),this[e]<<8|this[e+1]},S.prototype.readUInt32LE=function(e,t){return t||J(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},S.prototype.readUInt32BE=function(e,t){return t||J(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},S.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||J(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},S.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||J(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},S.prototype.readInt8=function(e,t){return t||J(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},S.prototype.readInt16LE=function(e,t){t||J(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},S.prototype.readInt16BE=function(e,t){t||J(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},S.prototype.readInt32LE=function(e,t){return t||J(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},S.prototype.readInt32BE=function(e,t){return t||J(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},S.prototype.readFloatLE=function(e,t){return t||J(e,4,this.length),b(this,e,!0,23,4)},S.prototype.readFloatBE=function(e,t){return t||J(e,4,this.length),b(this,e,!1,23,4)},S.prototype.readDoubleLE=function(e,t){return t||J(e,8,this.length),b(this,e,!0,52,8)},S.prototype.readDoubleBE=function(e,t){return t||J(e,8,this.length),b(this,e,!1,52,8)},S.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||K(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},S.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||K(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},S.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||K(this,e,t,1,255,0),S.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},S.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||K(this,e,t,2,65535,0),S.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):X(this,e,t,!0),t+2},S.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||K(this,e,t,2,65535,0),S.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):X(this,e,t,!1),t+2},S.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||K(this,e,t,4,4294967295,0),S.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):Q(this,e,t,!0),t+4},S.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||K(this,e,t,4,4294967295,0),S.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Q(this,e,t,!1),t+4},S.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);K(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<r&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},S.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);K(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},S.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||K(this,e,t,1,127,-128),S.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},S.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||K(this,e,t,2,32767,-32768),S.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):X(this,e,t,!0),t+2},S.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||K(this,e,t,2,32767,-32768),S.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):X(this,e,t,!1),t+2},S.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||K(this,e,t,4,2147483647,-2147483648),S.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Q(this,e,t,!0),t+4},S.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||K(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),S.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Q(this,e,t,!1),t+4},S.prototype.writeFloatLE=function(e,t,r){return te(this,e,t,!0,r)},S.prototype.writeFloatBE=function(e,t,r){return te(this,e,t,!1,r)},S.prototype.writeDoubleLE=function(e,t,r){return re(this,e,t,!0,r)},S.prototype.writeDoubleBE=function(e,t,r){return re(this,e,t,!1,r)},S.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i,o=n-r;if(this===e&&r<t&&t<n)for(i=o-1;i>=0;--i)e[i+t]=this[i+r];else if(o<1e3||!S.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+o),t);return o},S.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!S.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{var a=F(e)?e:oe(new S(e,n).toString()),s=a.length;for(o=0;o<r-t;++o)this[o+t]=a[o%s]}return this};var ne=/[^+\/0-9A-Za-z-_]/g;function ie(e){return e<16?"0"+e.toString(16):e.toString(16)}function oe(e,t){var r;t=t||1/0;for(var n=e.length,i=null,o=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function ae(e){return function(e){var t,r,n,i,o,a;m||g();var s=e.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===e[s-2]?2:"="===e[s-1]?1:0,a=new p(3*s/4-o),n=o>0?s-4:s;var l=0;for(t=0,r=0;t<n;t+=4,r+=3)i=h[e.charCodeAt(t)]<<18|h[e.charCodeAt(t+1)]<<12|h[e.charCodeAt(t+2)]<<6|h[e.charCodeAt(t+3)],a[l++]=i>>16&255,a[l++]=i>>8&255,a[l++]=255&i;return 2===o?(i=h[e.charCodeAt(t)]<<2|h[e.charCodeAt(t+1)]>>4,a[l++]=255&i):1===o&&(i=h[e.charCodeAt(t)]<<10|h[e.charCodeAt(t+1)]<<4|h[e.charCodeAt(t+2)]>>2,a[l++]=i>>8&255,a[l++]=255&i),a}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(ne,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function se(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function le(e){return null!=e&&(!!e._isBuffer||ce(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&ce(e.slice(0,0))}(e))}function ce(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var ue="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function fe(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var de={exports:{}};!function(e,t){e.exports=function e(t,r,n){function i(a,s){if(!r[a]){if(!t[a]){if(!s&&fe)return fe(a);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[a]={exports:{}};t[a][0].call(c.exports,(function(e){return i(t[a][1][e]||e)}),c,c.exports,e,t,r,n)}return r[a].exports}for(var o=fe,a=0;a<n.length;a++)i(n[a]);return i}({1:[function(e,t,r){var n=e("./utils"),i=e("./support"),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.encode=function(e){for(var t,r,i,a,s,l,c,u=[],f=0,d=e.length,h=d,p="string"!==n.getTypeOf(e);f<e.length;)h=d-f,i=p?(t=e[f++],r=f<d?e[f++]:0,f<d?e[f++]:0):(t=e.charCodeAt(f++),r=f<d?e.charCodeAt(f++):0,f<d?e.charCodeAt(f++):0),a=t>>2,s=(3&t)<<4|r>>4,l=1<h?(15&r)<<2|i>>6:64,c=2<h?63&i:64,u.push(o.charAt(a)+o.charAt(s)+o.charAt(l)+o.charAt(c));return u.join("")},r.decode=function(e){var t,r,n,a,s,l,c=0,u=0,f="data:";if(e.substr(0,f.length)===f)throw new Error("Invalid base64 input, it looks like a data url.");var d,h=3*(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(e.charAt(e.length-1)===o.charAt(64)&&h--,e.charAt(e.length-2)===o.charAt(64)&&h--,h%1!=0)throw new Error("Invalid base64 input, bad content length.");for(d=i.uint8array?new Uint8Array(0|h):new Array(0|h);c<e.length;)t=o.indexOf(e.charAt(c++))<<2|(a=o.indexOf(e.charAt(c++)))>>4,r=(15&a)<<4|(s=o.indexOf(e.charAt(c++)))>>2,n=(3&s)<<6|(l=o.indexOf(e.charAt(c++))),d[u++]=t,64!==s&&(d[u++]=r),64!==l&&(d[u++]=n);return d}},{"./support":30,"./utils":32}],2:[function(e,t,r){var n=e("./external"),i=e("./stream/DataWorker"),o=e("./stream/Crc32Probe"),a=e("./stream/DataLengthProbe");function s(e,t,r,n,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=r,this.compression=n,this.compressedContent=i}s.prototype={getContentWorker:function(){var e=new i(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a("data_length")),t=this;return e.on("end",(function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),e},getCompressedWorker:function(){return new i(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},s.createWorkerFrom=function(e,t,r){return e.pipe(new o).pipe(new a("uncompressedSize")).pipe(t.compressWorker(r)).pipe(new a("compressedSize")).withStreamInfo("compression",t)},t.exports=s},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,r){var n=e("./stream/GenericWorker");r.STORE={magic:"\0\0",compressWorker:function(e){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},r.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,r){var n=e("./utils"),i=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t){return void 0!==e&&e.length?"string"!==n.getTypeOf(e)?function(e,t,r,n){var o=i,a=n+r;e^=-1;for(var s=n;s<a;s++)e=e>>>8^o[255&(e^t[s])];return-1^e}(0|t,e,e.length,0):function(e,t,r,n){var o=i,a=n+r;e^=-1;for(var s=n;s<a;s++)e=e>>>8^o[255&(e^t.charCodeAt(s))];return-1^e}(0|t,e,e.length,0):0}},{"./utils":32}],5:[function(e,t,r){r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(e,t,r){var n=null;n="undefined"!=typeof Promise?Promise:e("lie"),t.exports={Promise:n}},{lie:37}],7:[function(e,t,r){var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,i=e("pako"),o=e("./utils"),a=e("./stream/GenericWorker"),s=n?"uint8array":"array";function l(e,t){a.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}r.magic="\b\0",o.inherits(l,a),l.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(o.transformTo(s,e.data),!1)},l.prototype.flush=function(){a.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},l.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},l.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},r.compressWorker=function(e){return new l("Deflate",e)},r.uncompressWorker=function(){return new l("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,r){function n(e,t){var r,n="";for(r=0;r<t;r++)n+=String.fromCharCode(255&e),e>>>=8;return n}function i(e,t,r,i,a,u){var f,d,h=e.file,p=e.compression,m=u!==s.utf8encode,g=o.transformTo("string",u(h.name)),y=o.transformTo("string",s.utf8encode(h.name)),v=h.comment,b=o.transformTo("string",u(v)),w=o.transformTo("string",s.utf8encode(v)),_=y.length!==h.name.length,x=w.length!==v.length,I="",k="",S="",E=h.dir,A=h.date,T={crc32:0,compressedSize:0,uncompressedSize:0};t&&!r||(T.crc32=e.crc32,T.compressedSize=e.compressedSize,T.uncompressedSize=e.uncompressedSize);var P=0;t&&(P|=8),m||!_&&!x||(P|=2048);var O=0,F=0;E&&(O|=16),"UNIX"===a?(F=798,O|=function(e,t){var r=e;return e||(r=t?16893:33204),(65535&r)<<16}(h.unixPermissions,E)):(F=20,O|=function(e){return 63&(e||0)}(h.dosPermissions)),f=A.getUTCHours(),f<<=6,f|=A.getUTCMinutes(),f<<=5,f|=A.getUTCSeconds()/2,d=A.getUTCFullYear()-1980,d<<=4,d|=A.getUTCMonth()+1,d<<=5,d|=A.getUTCDate(),_&&(k=n(1,1)+n(l(g),4)+y,I+="up"+n(k.length,2)+k),x&&(S=n(1,1)+n(l(b),4)+w,I+="uc"+n(S.length,2)+S);var R="";return R+="\n\0",R+=n(P,2),R+=p.magic,R+=n(f,2),R+=n(d,2),R+=n(T.crc32,4),R+=n(T.compressedSize,4),R+=n(T.uncompressedSize,4),R+=n(g.length,2),R+=n(I.length,2),{fileRecord:c.LOCAL_FILE_HEADER+R+g+I,dirRecord:c.CENTRAL_FILE_HEADER+n(F,2)+R+n(b.length,2)+"\0\0\0\0"+n(O,4)+n(i,4)+g+I+b}}var o=e("../utils"),a=e("../stream/GenericWorker"),s=e("../utf8"),l=e("../crc32"),c=e("../signature");function u(e,t,r,n){a.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}o.inherits(u,a),u.prototype.push=function(e){var t=e.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,a.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:r?(t+100*(r-n-1))/r:100}}))},u.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var r=i(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},u.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,r=i(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),t)this.push({data:function(e){return c.DATA_DESCRIPTOR+n(e.crc32,4)+n(e.compressedSize,4)+n(e.uncompressedSize,4)}(e),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},u.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t<this.dirRecords.length;t++)this.push({data:this.dirRecords[t],meta:{percent:100}});var r=this.bytesWritten-e,i=function(e,t,r,i,a){var s=o.transformTo("string",a(i));return c.CENTRAL_DIRECTORY_END+"\0\0\0\0"+n(e,2)+n(e,2)+n(t,4)+n(r,4)+n(s.length,2)+s}(this.dirRecords.length,r,e,this.zipComment,this.encodeFileName);this.push({data:i,meta:{percent:100}})},u.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},u.prototype.registerPrevious=function(e){this._sources.push(e);var t=this;return e.on("data",(function(e){t.processChunk(e)})),e.on("end",(function(){t.closedSource(t.previous.streamInfo),t._sources.length?t.prepareNextSource():t.end()})),e.on("error",(function(e){t.error(e)})),this},u.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},u.prototype.error=function(e){var t=this._sources;if(!a.prototype.error.call(this,e))return!1;for(var r=0;r<t.length;r++)try{t[r].error(e)}catch(e){}return!0},u.prototype.lock=function(){a.prototype.lock.call(this);for(var e=this._sources,t=0;t<e.length;t++)e[t].lock()},t.exports=u},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(e,t,r){var n=e("../compressions"),i=e("./ZipFileWorker");r.generateWorker=function(e,t,r){var o=new i(t.streamFiles,r,t.platform,t.encodeFileName),a=0;try{e.forEach((function(e,r){a++;var i=function(e,t){var r=e||t,i=n[r];if(!i)throw new Error(r+" is not a valid compression method !");return i}(r.options.compression,t.compression),s=r.options.compressionOptions||t.compressionOptions||{},l=r.dir,c=r.date;r._compressWorker(i,s).withStreamInfo("file",{name:e,dir:l,date:c,comment:r.comment||"",unixPermissions:r.unixPermissions,dosPermissions:r.dosPermissions}).pipe(o)})),o.entriesCount=a}catch(e){o.error(e)}return o}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(e,t,r){function n(){if(!(this instanceof n))return new n;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var e=new n;for(var t in this)"function"!=typeof this[t]&&(e[t]=this[t]);return e}}(n.prototype=e("./object")).loadAsync=e("./load"),n.support=e("./support"),n.defaults=e("./defaults"),n.version="3.7.1",n.loadAsync=function(e,t){return(new n).loadAsync(e,t)},n.external=e("./external"),t.exports=n},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(e,t,r){var n=e("./utils"),i=e("./external"),o=e("./utf8"),a=e("./zipEntries"),s=e("./stream/Crc32Probe"),l=e("./nodejsUtils");function c(e){return new i.Promise((function(t,r){var n=e.decompressed.getContentWorker().pipe(new s);n.on("error",(function(e){r(e)})).on("end",(function(){n.streamInfo.crc32!==e.decompressed.crc32?r(new Error("Corrupted zip : CRC32 mismatch")):t()})).resume()}))}t.exports=function(e,t){var r=this;return t=n.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:o.utf8decode}),l.isNode&&l.isStream(e)?i.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):n.prepareContent("the loaded zip file",e,!0,t.optimizedBinaryString,t.base64).then((function(e){var r=new a(t);return r.load(e),r})).then((function(e){var r=[i.Promise.resolve(e)],n=e.files;if(t.checkCRC32)for(var o=0;o<n.length;o++)r.push(c(n[o]));return i.Promise.all(r)})).then((function(e){for(var n=e.shift(),i=n.files,o=0;o<i.length;o++){var a=i[o];r.file(a.fileNameStr,a.decompressed,{binary:!0,optimizedBinaryString:!0,date:a.date,dir:a.dir,comment:a.fileCommentStr.length?a.fileCommentStr:null,unixPermissions:a.unixPermissions,dosPermissions:a.dosPermissions,createFolders:t.createFolders})}return n.zipComment.length&&(r.comment=n.zipComment),r}))}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(e,t,r){var n=e("../utils"),i=e("../stream/GenericWorker");function o(e,t){i.call(this,"Nodejs stream input adapter for "+e),this._upstreamEnded=!1,this._bindStream(t)}n.inherits(o,i),o.prototype._bindStream=function(e){var t=this;(this._stream=e).pause(),e.on("data",(function(e){t.push({data:e,meta:{percent:0}})})).on("error",(function(e){t.isPaused?this.generatedError=e:t.error(e)})).on("end",(function(){t.isPaused?t._upstreamEnded=!0:t.end()}))},o.prototype.pause=function(){return!!i.prototype.pause.call(this)&&(this._stream.pause(),!0)},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},t.exports=o},{"../stream/GenericWorker":28,"../utils":32}],13:[function(e,t,r){var n=e("readable-stream").Readable;function i(e,t,r){n.call(this,t),this._helper=e;var i=this;e.on("data",(function(e,t){i.push(e)||i._helper.pause(),r&&r(t)})).on("error",(function(e){i.emit("error",e)})).on("end",(function(){i.push(null)}))}e("../utils").inherits(i,n),i.prototype._read=function(){this._helper.resume()},t.exports=i},{"../utils":32,"readable-stream":16}],14:[function(e,t,r){t.exports={isNode:!0,newBufferFrom:function(e,t){if(S.from&&S.from!==Uint8Array.from)return S.from(e,t);if("number"==typeof e)throw new Error('The "data" argument must not be a number');return new S(e,t)},allocBuffer:function(e){if(S.alloc)return S.alloc(e);var t=new S(e);return t.fill(0),t},isBuffer:function(e){return le(e)},isStream:function(e){return e&&"function"==typeof e.on&&"function"==typeof e.pause&&"function"==typeof e.resume}}},{}],15:[function(e,t,r){function n(e,t,r){var n,i=o.getTypeOf(t),s=o.extend(r||{},l);s.date=s.date||new Date,null!==s.compression&&(s.compression=s.compression.toUpperCase()),"string"==typeof s.unixPermissions&&(s.unixPermissions=parseInt(s.unixPermissions,8)),s.unixPermissions&&16384&s.unixPermissions&&(s.dir=!0),s.dosPermissions&&16&s.dosPermissions&&(s.dir=!0),s.dir&&(e=m(e)),s.createFolders&&(n=p(e))&&g.call(this,n,!0);var f="string"===i&&!1===s.binary&&!1===s.base64;r&&void 0!==r.binary||(s.binary=!f),(t instanceof c&&0===t.uncompressedSize||s.dir||!t||0===t.length)&&(s.base64=!1,s.binary=!0,t="",s.compression="STORE",i="string");var y=null;y=t instanceof c||t instanceof a?t:d.isNode&&d.isStream(t)?new h(e,t):o.prepareContent(e,t,s.binary,s.optimizedBinaryString,s.base64);var v=new u(e,y,s);this.files[e]=v}var i=e("./utf8"),o=e("./utils"),a=e("./stream/GenericWorker"),s=e("./stream/StreamHelper"),l=e("./defaults"),c=e("./compressedObject"),u=e("./zipObject"),f=e("./generate"),d=e("./nodejsUtils"),h=e("./nodejs/NodejsStreamInputAdapter"),p=function(e){"/"===e.slice(-1)&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return 0<t?e.substring(0,t):""},m=function(e){return"/"!==e.slice(-1)&&(e+="/"),e},g=function(e,t){return t=void 0!==t?t:l.createFolders,e=m(e),this.files[e]||n.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function y(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var v={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,r,n;for(t in this.files)n=this.files[t],(r=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(r,n)},filter:function(e){var t=[];return this.forEach((function(r,n){e(r,n)&&t.push(n)})),t},file:function(e,t,r){if(1!==arguments.length)return e=this.root+e,n.call(this,e,t,r),this;if(y(e)){var i=e;return this.filter((function(e,t){return!t.dir&&i.test(e)}))}var o=this.files[this.root+e];return o&&!o.dir?o:null},folder:function(e){if(!e)return this;if(y(e))return this.filter((function(t,r){return r.dir&&e.test(t)}));var t=this.root+e,r=g.call(this,t),n=this.clone();return n.root=r.name,n},remove:function(e){e=this.root+e;var t=this.files[e];if(t||("/"!==e.slice(-1)&&(e+="/"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var r=this.filter((function(t,r){return r.name.slice(0,e.length)===e})),n=0;n<r.length;n++)delete this.files[r[n].name];return this},generate:function(e){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(e){var t,r={};try{if((r=o.extend(e||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:i.utf8encode})).type=r.type.toLowerCase(),r.compression=r.compression.toUpperCase(),"binarystring"===r.type&&(r.type="string"),!r.type)throw new Error("No output type specified.");o.checkSupport(r.type),"darwin"!==r.platform&&"freebsd"!==r.platform&&"linux"!==r.platform&&"sunos"!==r.platform||(r.platform="UNIX"),"win32"===r.platform&&(r.platform="DOS");var n=r.comment||this.comment||"";t=f.generateWorker(this,r,n)}catch(e){(t=new a("error")).error(e)}return new s(t,r.type||"string",r.mimeType)},generateAsync:function(e,t){return this.generateInternalStream(e).accumulate(t)},generateNodeStream:function(e,t){return(e=e||{}).type||(e.type="nodebuffer"),this.generateInternalStream(e).toNodejsStream(t)}};t.exports=v},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(e,t,r){t.exports=e("stream")},{stream:void 0}],17:[function(e,t,r){var n=e("./DataReader");function i(e){n.call(this,e);for(var t=0;t<this.data.length;t++)e[t]=255&e[t]}e("../utils").inherits(i,n),i.prototype.byteAt=function(e){return this.data[this.zero+e]},i.prototype.lastIndexOfSignature=function(e){for(var t=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2),i=e.charCodeAt(3),o=this.length-4;0<=o;--o)if(this.data[o]===t&&this.data[o+1]===r&&this.data[o+2]===n&&this.data[o+3]===i)return o-this.zero;return-1},i.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2),i=e.charCodeAt(3),o=this.readData(4);return t===o[0]&&r===o[1]&&n===o[2]&&i===o[3]},i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],18:[function(e,t,r){var n=e("../utils");function i(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}i.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length<this.zero+e||e<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+e+"). Corrupted zip ?")},setIndex:function(e){this.checkIndex(e),this.index=e},skip:function(e){this.setIndex(this.index+e)},byteAt:function(e){},readInt:function(e){var t,r=0;for(this.checkOffset(e),t=this.index+e-1;t>=this.index;t--)r=(r<<8)+this.byteAt(t);return this.index+=e,r},readString:function(e){return n.transformTo("string",this.readData(e))},readData:function(e){},lastIndexOfSignature:function(e){},readAndCheckSignature:function(e){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=i},{"../utils":32}],19:[function(e,t,r){var n=e("./Uint8ArrayReader");function i(e){n.call(this,e)}e("../utils").inherits(i,n),i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,r){var n=e("./DataReader");function i(e){n.call(this,e)}e("../utils").inherits(i,n),i.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},i.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},i.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],21:[function(e,t,r){var n=e("./ArrayReader");function i(e){n.call(this,e)}e("../utils").inherits(i,n),i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,r){var n=e("../utils"),i=e("../support"),o=e("./ArrayReader"),a=e("./StringReader"),s=e("./NodeBufferReader"),l=e("./Uint8ArrayReader");t.exports=function(e){var t=n.getTypeOf(e);return n.checkSupport(t),"string"!==t||i.uint8array?"nodebuffer"===t?new s(e):i.uint8array?new l(n.transformTo("uint8array",e)):new o(n.transformTo("array",e)):new a(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,r){r.LOCAL_FILE_HEADER="PK",r.CENTRAL_FILE_HEADER="PK",r.CENTRAL_DIRECTORY_END="PK",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",r.ZIP64_CENTRAL_DIRECTORY_END="PK",r.DATA_DESCRIPTOR="PK\b"},{}],24:[function(e,t,r){var n=e("./GenericWorker"),i=e("../utils");function o(e){n.call(this,"ConvertWorker to "+e),this.destType=e}i.inherits(o,n),o.prototype.processChunk=function(e){this.push({data:i.transformTo(this.destType,e.data),meta:e.meta})},t.exports=o},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,r){var n=e("./GenericWorker"),i=e("../crc32");function o(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}e("../utils").inherits(o,n),o.prototype.processChunk=function(e){this.streamInfo.crc32=i(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=o},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,r){var n=e("../utils"),i=e("./GenericWorker");function o(e){i.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}n.inherits(o,i),o.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}i.prototype.processChunk.call(this,e)},t.exports=o},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,r){var n=e("../utils"),i=e("./GenericWorker");function o(e){i.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then((function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=n.getTypeOf(e),t.isPaused||t._tickAndRepeat()}),(function(e){t.error(e)}))}n.inherits(o,i),o.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},o.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},o.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=o},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,r){function n(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var r=0;r<this._listeners[e].length;r++)this._listeners[e][r].call(this,t)},pipe:function(e){return e.registerPrevious(this)},registerPrevious:function(e){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=e.streamInfo,this.mergeStreamInfo(),this.previous=e;var t=this;return e.on("data",(function(e){t.processChunk(e)})),e.on("end",(function(){t.end()})),e.on("error",(function(e){t.error(e)})),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var e=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),e=!0),this.previous&&this.previous.resume(),!e},flush:function(){},processChunk:function(e){this.push(e)},withStreamInfo:function(e,t){return this.extraStreamInfo[e]=t,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var e in this.extraStreamInfo)this.extraStreamInfo.hasOwnProperty(e)&&(this.streamInfo[e]=this.extraStreamInfo[e])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var e="Worker "+this.name;return this.previous?this.previous+" -> "+e:e}},t.exports=n},{}],29:[function(e,t,r){var n=e("../utils"),i=e("./ConvertWorker"),o=e("./GenericWorker"),a=e("../base64"),s=e("../support"),l=e("../external"),c=null;if(s.nodestream)try{c=e("../nodejs/NodejsStreamOutputAdapter")}catch(e){}function u(e,t){return new l.Promise((function(r,i){var o=[],s=e._internalType,l=e._outputType,c=e._mimeType;e.on("data",(function(e,r){o.push(e),t&&t(r)})).on("error",(function(e){o=[],i(e)})).on("end",(function(){try{var e=function(e,t,r){switch(e){case"blob":return n.newBlob(n.transformTo("arraybuffer",t),r);case"base64":return a.encode(t);default:return n.transformTo(e,t)}}(l,function(e,t){var r,n=0,i=null,o=0;for(r=0;r<t.length;r++)o+=t[r].length;switch(e){case"string":return t.join("");case"array":return Array.prototype.concat.apply([],t);case"uint8array":for(i=new Uint8Array(o),r=0;r<t.length;r++)i.set(t[r],n),n+=t[r].length;return i;case"nodebuffer":return S.concat(t);default:throw new Error("concat : unsupported type '"+e+"'")}}(s,o),c);r(e)}catch(e){i(e)}o=[]})).resume()}))}function f(e,t,r){var a=t;switch(t){case"blob":case"arraybuffer":a="uint8array";break;case"base64":a="string"}try{this._internalType=a,this._outputType=t,this._mimeType=r,n.checkSupport(a),this._worker=e.pipe(new i(a)),e.lock()}catch(e){this._worker=new o("error"),this._worker.error(e)}}f.prototype={accumulate:function(e){return u(this,e)},on:function(e,t){var r=this;return"data"===e?this._worker.on(e,(function(e){t.call(r,e.data,e.meta)})):this._worker.on(e,(function(){n.delay(t,arguments,r)})),this},resume:function(){return n.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(e){if(n.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new c(this,{objectMode:"nodebuffer"!==this._outputType},e)}},t.exports=f},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(e,t,r){if(r.base64=!0,r.array=!0,r.string=!0,r.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,r.nodebuffer=!0,r.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)r.blob=!1;else{var n=new ArrayBuffer(0);try{r.blob=0===new Blob([n],{type:"application/zip"}).size}catch(e){try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(n),r.blob=0===i.getBlob("application/zip").size}catch(e){r.blob=!1}}}try{r.nodestream=!!e("readable-stream").Readable}catch(e){r.nodestream=!1}},{"readable-stream":16}],31:[function(e,t,r){for(var n=e("./utils"),i=e("./support"),o=e("./nodejsUtils"),a=e("./stream/GenericWorker"),s=new Array(256),l=0;l<256;l++)s[l]=252<=l?6:248<=l?5:240<=l?4:224<=l?3:192<=l?2:1;function c(){a.call(this,"utf-8 decode"),this.leftOver=null}function u(){a.call(this,"utf-8 encode")}s[254]=s[254]=1,r.utf8encode=function(e){return i.nodebuffer?o.newBufferFrom(e,"utf-8"):function(e){var t,r,n,o,a,s=e.length,l=0;for(o=0;o<s;o++)55296==(64512&(r=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(n=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(n-56320),o++),l+=r<128?1:r<2048?2:r<65536?3:4;for(t=i.uint8array?new Uint8Array(l):new Array(l),o=a=0;a<l;o++)55296==(64512&(r=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(n=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(n-56320),o++),r<128?t[a++]=r:(r<2048?t[a++]=192|r>>>6:(r<65536?t[a++]=224|r>>>12:(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63),t[a++]=128|r>>>6&63),t[a++]=128|63&r);return t}(e)},r.utf8decode=function(e){return i.nodebuffer?n.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,r,i,o,a=e.length,l=new Array(2*a);for(t=r=0;t<a;)if((i=e[t++])<128)l[r++]=i;else if(4<(o=s[i]))l[r++]=65533,t+=o-1;else{for(i&=2===o?31:3===o?15:7;1<o&&t<a;)i=i<<6|63&e[t++],o--;1<o?l[r++]=65533:i<65536?l[r++]=i:(i-=65536,l[r++]=55296|i>>10&1023,l[r++]=56320|1023&i)}return l.length!==r&&(l.subarray?l=l.subarray(0,r):l.length=r),n.applyFromCharCode(l)}(e=n.transformTo(i.uint8array?"uint8array":"array",e))},n.inherits(c,a),c.prototype.processChunk=function(e){var t=n.transformTo(i.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var o=t;(t=new Uint8Array(o.length+this.leftOver.length)).set(this.leftOver,0),t.set(o,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var a=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return r<0||0===r?t:r+s[e[r]]>t?r:t}(t),l=t;a!==t.length&&(i.uint8array?(l=t.subarray(0,a),this.leftOver=t.subarray(a,t.length)):(l=t.slice(0,a),this.leftOver=t.slice(a,t.length))),this.push({data:r.utf8decode(l),meta:e.meta})},c.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:r.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},r.Utf8DecodeWorker=c,n.inherits(u,a),u.prototype.processChunk=function(e){this.push({data:r.utf8encode(e.data),meta:e.meta})},r.Utf8EncodeWorker=u},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,r){var n=e("./support"),i=e("./base64"),o=e("./nodejsUtils"),a=e("set-immediate-shim"),s=e("./external");function l(e){return e}function c(e,t){for(var r=0;r<e.length;++r)t[r]=255&e.charCodeAt(r);return t}r.newBlob=function(e,t){r.checkSupport("blob");try{return new Blob([e],{type:t})}catch(r){try{var n=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return n.append(e),n.getBlob(t)}catch(e){throw new Error("Bug : can't construct the Blob.")}}};var u={stringifyByChunk:function(e,t,r){var n=[],i=0,o=e.length;if(o<=r)return String.fromCharCode.apply(null,e);for(;i<o;)"array"===t||"nodebuffer"===t?n.push(String.fromCharCode.apply(null,e.slice(i,Math.min(i+r,o)))):n.push(String.fromCharCode.apply(null,e.subarray(i,Math.min(i+r,o)))),i+=r;return n.join("")},stringifyByChar:function(e){for(var t="",r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},applyCanBeUsed:{uint8array:function(){try{return n.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(e){return!1}}(),nodebuffer:function(){try{return n.nodebuffer&&1===String.fromCharCode.apply(null,o.allocBuffer(1)).length}catch(e){return!1}}()}};function f(e){var t=65536,n=r.getTypeOf(e),i=!0;if("uint8array"===n?i=u.applyCanBeUsed.uint8array:"nodebuffer"===n&&(i=u.applyCanBeUsed.nodebuffer),i)for(;1<t;)try{return u.stringifyByChunk(e,n,t)}catch(e){t=Math.floor(t/2)}return u.stringifyByChar(e)}function d(e,t){for(var r=0;r<e.length;r++)t[r]=e[r];return t}r.applyFromCharCode=f;var h={};h.string={string:l,array:function(e){return c(e,new Array(e.length))},arraybuffer:function(e){return h.string.uint8array(e).buffer},uint8array:function(e){return c(e,new Uint8Array(e.length))},nodebuffer:function(e){return c(e,o.allocBuffer(e.length))}},h.array={string:f,array:l,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return o.newBufferFrom(e)}},h.arraybuffer={string:function(e){return f(new Uint8Array(e))},array:function(e){return d(new Uint8Array(e),new Array(e.byteLength))},arraybuffer:l,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return o.newBufferFrom(new Uint8Array(e))}},h.uint8array={string:f,array:function(e){return d(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:l,nodebuffer:function(e){return o.newBufferFrom(e)}},h.nodebuffer={string:f,array:function(e){return d(e,new Array(e.length))},arraybuffer:function(e){return h.nodebuffer.uint8array(e).buffer},uint8array:function(e){return d(e,new Uint8Array(e.length))},nodebuffer:l},r.transformTo=function(e,t){if(t=t||"",!e)return t;r.checkSupport(e);var n=r.getTypeOf(t);return h[n][e](t)},r.getTypeOf=function(e){return"string"==typeof e?"string":"[object Array]"===Object.prototype.toString.call(e)?"array":n.nodebuffer&&o.isBuffer(e)?"nodebuffer":n.uint8array&&e instanceof Uint8Array?"uint8array":n.arraybuffer&&e instanceof ArrayBuffer?"arraybuffer":void 0},r.checkSupport=function(e){if(!n[e.toLowerCase()])throw new Error(e+" is not supported by this platform")},r.MAX_VALUE_16BITS=65535,r.MAX_VALUE_32BITS=-1,r.pretty=function(e){var t,r,n="";for(r=0;r<(e||"").length;r++)n+="\\x"+((t=e.charCodeAt(r))<16?"0":"")+t.toString(16).toUpperCase();return n},r.delay=function(e,t,r){a((function(){e.apply(r||null,t||[])}))},r.inherits=function(e,t){function r(){}r.prototype=t.prototype,e.prototype=new r},r.extend=function(){var e,t,r={};for(e=0;e<arguments.length;e++)for(t in arguments[e])arguments[e].hasOwnProperty(t)&&void 0===r[t]&&(r[t]=arguments[e][t]);return r},r.prepareContent=function(e,t,o,a,l){return s.Promise.resolve(t).then((function(e){return n.blob&&(e instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(e)))&&"undefined"!=typeof FileReader?new s.Promise((function(t,r){var n=new FileReader;n.onload=function(e){t(e.target.result)},n.onerror=function(e){r(e.target.error)},n.readAsArrayBuffer(e)})):e})).then((function(t){var u=r.getTypeOf(t);return u?("arraybuffer"===u?t=r.transformTo("uint8array",t):"string"===u&&(l?t=i.decode(t):o&&!0!==a&&(t=function(e){return c(e,n.uint8array?new Uint8Array(e.length):new Array(e.length))}(t))),t):s.Promise.reject(new Error("Can't read the data of '"+e+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))}))}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,"set-immediate-shim":54}],33:[function(e,t,r){var n=e("./reader/readerFor"),i=e("./utils"),o=e("./signature"),a=e("./zipEntry"),s=(e("./utf8"),e("./support"));function l(e){this.files=[],this.loadOptions=e}l.prototype={checkSignature:function(e){if(!this.reader.readAndCheckSignature(e)){this.reader.index-=4;var t=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+i.pretty(t)+", expected "+i.pretty(e)+")")}},isSignature:function(e,t){var r=this.reader.index;this.reader.setIndex(e);var n=this.reader.readString(4)===t;return this.reader.setIndex(r),n},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var e=this.reader.readData(this.zipCommentLength),t=s.uint8array?"uint8array":"array",r=i.transformTo(t,e);this.zipComment=this.loadOptions.decodeFileName(r)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var e,t,r,n=this.zip64EndOfCentralSize-44;0<n;)e=this.reader.readInt(2),t=this.reader.readInt(4),r=this.reader.readData(t),this.zip64ExtensibleData[e]={id:e,length:t,value:r}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e<this.files.length;e++)t=this.files[e],this.reader.setIndex(t.localHeaderOffset),this.checkSignature(o.LOCAL_FILE_HEADER),t.readLocalPart(this.reader),t.handleUTF8(),t.processAttributes()},readCentralDir:function(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(o.CENTRAL_FILE_HEADER);)(e=new a({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(e);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var e=this.reader.lastIndexOfSignature(o.CENTRAL_DIRECTORY_END);if(e<0)throw this.isSignature(0,o.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(e);var t=e;if(this.checkSignature(o.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===i.MAX_VALUE_16BITS||this.diskWithCentralDirStart===i.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===i.MAX_VALUE_16BITS||this.centralDirRecords===i.MAX_VALUE_16BITS||this.centralDirSize===i.MAX_VALUE_32BITS||this.centralDirOffset===i.MAX_VALUE_32BITS){if(this.zip64=!0,(e=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(e),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,o.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var r=this.centralDirOffset+this.centralDirSize;this.zip64&&(r+=20,r+=12+this.zip64EndOfCentralSize);var n=t-r;if(0<n)this.isSignature(t,o.CENTRAL_FILE_HEADER)||(this.reader.zero=n);else if(n<0)throw new Error("Corrupted zip: missing "+Math.abs(n)+" bytes.")},prepareReader:function(e){this.reader=n(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},t.exports=l},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utf8":31,"./utils":32,"./zipEntry":34}],34:[function(e,t,r){var n=e("./reader/readerFor"),i=e("./utils"),o=e("./compressedObject"),a=e("./crc32"),s=e("./utf8"),l=e("./compressions"),c=e("./support");function u(e,t){this.options=e,this.loadOptions=t}u.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(e){var t,r;if(e.skip(22),this.fileNameLength=e.readInt(2),r=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(r),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(t=function(e){for(var t in l)if(l.hasOwnProperty(t)&&l[t].magic===e)return l[t];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+i.pretty(this.compressionMethod)+" unknown (inner file : "+i.transformTo("string",this.fileName)+")");this.decompressed=new o(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0==e&&(this.dosPermissions=63&this.externalFileAttributes),3==e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(e){if(this.extraFields[1]){var t=n(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(e){var t,r,n,i=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+4<i;)t=e.readInt(2),r=e.readInt(2),n=e.readData(r),this.extraFields[t]={id:t,length:r,value:n};e.setIndex(i)},handleUTF8:function(){var e=c.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=s.utf8decode(this.fileName),this.fileCommentStr=s.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();if(null!==t)this.fileNameStr=t;else{var r=i.transformTo(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(r)}var n=this.findExtraFieldUnicodeComment();if(null!==n)this.fileCommentStr=n;else{var o=i.transformTo(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(o)}}},findExtraFieldUnicodePath:function(){var e=this.extraFields[28789];if(e){var t=n(e.value);return 1!==t.readInt(1)||a(this.fileName)!==t.readInt(4)?null:s.utf8decode(t.readData(e.length-5))}return null},findExtraFieldUnicodeComment:function(){var e=this.extraFields[25461];if(e){var t=n(e.value);return 1!==t.readInt(1)||a(this.fileComment)!==t.readInt(4)?null:s.utf8decode(t.readData(e.length-5))}return null}},t.exports=u},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(e,t,r){function n(e,t,r){this.name=e,this.dir=r.dir,this.date=r.date,this.comment=r.comment,this.unixPermissions=r.unixPermissions,this.dosPermissions=r.dosPermissions,this._data=t,this._dataBinary=r.binary,this.options={compression:r.compression,compressionOptions:r.compressionOptions}}var i=e("./stream/StreamHelper"),o=e("./stream/DataWorker"),a=e("./utf8"),s=e("./compressedObject"),l=e("./stream/GenericWorker");n.prototype={internalStream:function(e){var t=null,r="string";try{if(!e)throw new Error("No output type specified.");var n="string"===(r=e.toLowerCase())||"text"===r;"binarystring"!==r&&"text"!==r||(r="string"),t=this._decompressWorker();var o=!this._dataBinary;o&&!n&&(t=t.pipe(new a.Utf8EncodeWorker)),!o&&n&&(t=t.pipe(new a.Utf8DecodeWorker))}catch(e){(t=new l("error")).error(e)}return new i(t,r,"")},async:function(e,t){return this.internalStream(e).accumulate(t)},nodeStream:function(e,t){return this.internalStream(e||"nodebuffer").toNodejsStream(t)},_compressWorker:function(e,t){if(this._data instanceof s&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var r=this._decompressWorker();return this._dataBinary||(r=r.pipe(new a.Utf8EncodeWorker)),s.createWorkerFrom(r,e,t)},_decompressWorker:function(){return this._data instanceof s?this._data.getContentWorker():this._data instanceof l?this._data:new o(this._data)}};for(var c=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],u=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},f=0;f<c.length;f++)n.prototype[c[f]]=u;t.exports=n},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(e,t,r){(function(e){var r,n,i=e.MutationObserver||e.WebKitMutationObserver;if(i){var o=0,a=new i(u),s=e.document.createTextNode("");a.observe(s,{characterData:!0}),r=function(){s.data=o=++o%2}}else if(e.setImmediate||void 0===e.MessageChannel)r="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){u(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(u,0)};else{var l=new e.MessageChannel;l.port1.onmessage=u,r=function(){l.port2.postMessage(0)}}var c=[];function u(){var e,t;n=!0;for(var r=c.length;r;){for(t=c,c=[],e=-1;++e<r;)t[e]();r=c.length}n=!1}t.exports=function(e){1!==c.push(e)||n||r()}}).call(this,void 0!==ue?ue:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],37:[function(e,t,r){var n=e("immediate");function i(){}var o={},a=["REJECTED"],s=["FULFILLED"],l=["PENDING"];function c(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=l,this.queue=[],this.outcome=void 0,e!==i&&h(this,e)}function u(e,t,r){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function f(e,t,r){n((function(){var n;try{n=t(r)}catch(n){return o.reject(e,n)}n===e?o.reject(e,new TypeError("Cannot resolve promise with itself")):o.resolve(e,n)}))}function d(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function h(e,t){var r=!1;function n(t){r||(r=!0,o.reject(e,t))}function i(t){r||(r=!0,o.resolve(e,t))}var a=p((function(){t(i,n)}));"error"===a.status&&n(a.value)}function p(e,t){var r={};try{r.value=e(t),r.status="success"}catch(e){r.status="error",r.value=e}return r}(t.exports=c).prototype.finally=function(e){if("function"!=typeof e)return this;var t=this.constructor;return this.then((function(r){return t.resolve(e()).then((function(){return r}))}),(function(r){return t.resolve(e()).then((function(){throw r}))}))},c.prototype.catch=function(e){return this.then(null,e)},c.prototype.then=function(e,t){if("function"!=typeof e&&this.state===s||"function"!=typeof t&&this.state===a)return this;var r=new this.constructor(i);return this.state!==l?f(r,this.state===s?e:t,this.outcome):this.queue.push(new u(r,e,t)),r},u.prototype.callFulfilled=function(e){o.resolve(this.promise,e)},u.prototype.otherCallFulfilled=function(e){f(this.promise,this.onFulfilled,e)},u.prototype.callRejected=function(e){o.reject(this.promise,e)},u.prototype.otherCallRejected=function(e){f(this.promise,this.onRejected,e)},o.resolve=function(e,t){var r=p(d,t);if("error"===r.status)return o.reject(e,r.value);var n=r.value;if(n)h(e,n);else{e.state=s,e.outcome=t;for(var i=-1,a=e.queue.length;++i<a;)e.queue[i].callFulfilled(t)}return e},o.reject=function(e,t){e.state=a,e.outcome=t;for(var r=-1,n=e.queue.length;++r<n;)e.queue[r].callRejected(t);return e},c.resolve=function(e){return e instanceof this?e:o.resolve(new this(i),e)},c.reject=function(e){var t=new this(i);return o.reject(t,e)},c.all=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,n=!1;if(!r)return this.resolve([]);for(var a=new Array(r),s=0,l=-1,c=new this(i);++l<r;)u(e[l],l);return c;function u(e,i){t.resolve(e).then((function(e){a[i]=e,++s!==r||n||(n=!0,o.resolve(c,a))}),(function(e){n||(n=!0,o.reject(c,e))}))}},c.race=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,n=!1;if(!r)return this.resolve([]);for(var a,s=-1,l=new this(i);++s<r;)a=e[s],t.resolve(a).then((function(e){n||(n=!0,o.resolve(l,e))}),(function(e){n||(n=!0,o.reject(l,e))}));return l}},{immediate:36}],38:[function(e,t,r){var n={};(0,e("./lib/utils/common").assign)(n,e("./lib/deflate"),e("./lib/inflate"),e("./lib/zlib/constants")),t.exports=n},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(e,t,r){var n=e("./zlib/deflate"),i=e("./utils/common"),o=e("./utils/strings"),a=e("./zlib/messages"),s=e("./zlib/zstream"),l=Object.prototype.toString,c=0,u=-1,f=0,d=8;function h(e){if(!(this instanceof h))return new h(e);this.options=i.assign({level:u,method:d,chunkSize:16384,windowBits:15,memLevel:8,strategy:f,to:""},e||{});var t=this.options;t.raw&&0<t.windowBits?t.windowBits=-t.windowBits:t.gzip&&0<t.windowBits&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var r=n.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==c)throw new Error(a[r]);if(t.header&&n.deflateSetHeader(this.strm,t.header),t.dictionary){var p;if(p="string"==typeof t.dictionary?o.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(r=n.deflateSetDictionary(this.strm,p))!==c)throw new Error(a[r]);this._dict_set=!0}}function p(e,t){var r=new h(t);if(r.push(e,!0),r.err)throw r.msg||a[r.err];return r.result}h.prototype.push=function(e,t){var r,a,s=this.strm,u=this.options.chunkSize;if(this.ended)return!1;a=t===~~t?t:!0===t?4:0,"string"==typeof e?s.input=o.string2buf(e):"[object ArrayBuffer]"===l.call(e)?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new i.Buf8(u),s.next_out=0,s.avail_out=u),1!==(r=n.deflate(s,a))&&r!==c)return this.onEnd(r),!(this.ended=!0);0!==s.avail_out&&(0!==s.avail_in||4!==a&&2!==a)||("string"===this.options.to?this.onData(o.buf2binstring(i.shrinkBuf(s.output,s.next_out))):this.onData(i.shrinkBuf(s.output,s.next_out)))}while((0<s.avail_in||0===s.avail_out)&&1!==r);return 4===a?(r=n.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===c):2!==a||(this.onEnd(c),!(s.avail_out=0))},h.prototype.onData=function(e){this.chunks.push(e)},h.prototype.onEnd=function(e){e===c&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},r.Deflate=h,r.deflate=p,r.deflateRaw=function(e,t){return(t=t||{}).raw=!0,p(e,t)},r.gzip=function(e,t){return(t=t||{}).gzip=!0,p(e,t)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(e,t,r){var n=e("./zlib/inflate"),i=e("./utils/common"),o=e("./utils/strings"),a=e("./zlib/constants"),s=e("./zlib/messages"),l=e("./zlib/zstream"),c=e("./zlib/gzheader"),u=Object.prototype.toString;function f(e){if(!(this instanceof f))return new f(e);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&0<=t.windowBits&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(0<=t.windowBits&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),15<t.windowBits&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var r=n.inflateInit2(this.strm,t.windowBits);if(r!==a.Z_OK)throw new Error(s[r]);this.header=new c,n.inflateGetHeader(this.strm,this.header)}function d(e,t){var r=new f(t);if(r.push(e,!0),r.err)throw r.msg||s[r.err];return r.result}f.prototype.push=function(e,t){var r,s,l,c,f,d,h=this.strm,p=this.options.chunkSize,m=this.options.dictionary,g=!1;if(this.ended)return!1;s=t===~~t?t:!0===t?a.Z_FINISH:a.Z_NO_FLUSH,"string"==typeof e?h.input=o.binstring2buf(e):"[object ArrayBuffer]"===u.call(e)?h.input=new Uint8Array(e):h.input=e,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new i.Buf8(p),h.next_out=0,h.avail_out=p),(r=n.inflate(h,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&m&&(d="string"==typeof m?o.string2buf(m):"[object ArrayBuffer]"===u.call(m)?new Uint8Array(m):m,r=n.inflateSetDictionary(this.strm,d)),r===a.Z_BUF_ERROR&&!0===g&&(r=a.Z_OK,g=!1),r!==a.Z_STREAM_END&&r!==a.Z_OK)return this.onEnd(r),!(this.ended=!0);h.next_out&&(0!==h.avail_out&&r!==a.Z_STREAM_END&&(0!==h.avail_in||s!==a.Z_FINISH&&s!==a.Z_SYNC_FLUSH)||("string"===this.options.to?(l=o.utf8border(h.output,h.next_out),c=h.next_out-l,f=o.buf2string(h.output,l),h.next_out=c,h.avail_out=p-c,c&&i.arraySet(h.output,h.output,l,c,0),this.onData(f)):this.onData(i.shrinkBuf(h.output,h.next_out)))),0===h.avail_in&&0===h.avail_out&&(g=!0)}while((0<h.avail_in||0===h.avail_out)&&r!==a.Z_STREAM_END);return r===a.Z_STREAM_END&&(s=a.Z_FINISH),s===a.Z_FINISH?(r=n.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===a.Z_OK):s!==a.Z_SYNC_FLUSH||(this.onEnd(a.Z_OK),!(h.avail_out=0))},f.prototype.onData=function(e){this.chunks.push(e)},f.prototype.onEnd=function(e){e===a.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},r.Inflate=f,r.inflate=d,r.inflateRaw=function(e,t){return(t=t||{}).raw=!0,d(e,t)},r.ungzip=d},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(e,t,r){var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;r.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var n in r)r.hasOwnProperty(n)&&(e[n]=r[n])}}return e},r.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){var t,r,n,i,o,a;for(t=n=0,r=e.length;t<r;t++)n+=e[t].length;for(a=new Uint8Array(n),t=i=0,r=e.length;t<r;t++)o=e[t],a.set(o,i),i+=o.length;return a}},o={arraySet:function(e,t,r,n,i){for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){return[].concat.apply([],e)}};r.setTyped=function(e){e?(r.Buf8=Uint8Array,r.Buf16=Uint16Array,r.Buf32=Int32Array,r.assign(r,i)):(r.Buf8=Array,r.Buf16=Array,r.Buf32=Array,r.assign(r,o))},r.setTyped(n)},{}],42:[function(e,t,r){var n=e("./common"),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(e){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){o=!1}for(var a=new n.Buf8(256),s=0;s<256;s++)a[s]=252<=s?6:248<=s?5:240<=s?4:224<=s?3:192<=s?2:1;function l(e,t){if(t<65537&&(e.subarray&&o||!e.subarray&&i))return String.fromCharCode.apply(null,n.shrinkBuf(e,t));for(var r="",a=0;a<t;a++)r+=String.fromCharCode(e[a]);return r}a[254]=a[254]=1,r.string2buf=function(e){var t,r,i,o,a,s=e.length,l=0;for(o=0;o<s;o++)55296==(64512&(r=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(i=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(i-56320),o++),l+=r<128?1:r<2048?2:r<65536?3:4;for(t=new n.Buf8(l),o=a=0;a<l;o++)55296==(64512&(r=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(i=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(i-56320),o++),r<128?t[a++]=r:(r<2048?t[a++]=192|r>>>6:(r<65536?t[a++]=224|r>>>12:(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63),t[a++]=128|r>>>6&63),t[a++]=128|63&r);return t},r.buf2binstring=function(e){return l(e,e.length)},r.binstring2buf=function(e){for(var t=new n.Buf8(e.length),r=0,i=t.length;r<i;r++)t[r]=e.charCodeAt(r);return t},r.buf2string=function(e,t){var r,n,i,o,s=t||e.length,c=new Array(2*s);for(r=n=0;r<s;)if((i=e[r++])<128)c[n++]=i;else if(4<(o=a[i]))c[n++]=65533,r+=o-1;else{for(i&=2===o?31:3===o?15:7;1<o&&r<s;)i=i<<6|63&e[r++],o--;1<o?c[n++]=65533:i<65536?c[n++]=i:(i-=65536,c[n++]=55296|i>>10&1023,c[n++]=56320|1023&i)}return l(c,n)},r.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return r<0||0===r?t:r+a[e[r]]>t?r:t}},{"./common":41}],43:[function(e,t,r){t.exports=function(e,t,r,n){for(var i=65535&e|0,o=e>>>16&65535|0,a=0;0!==r;){for(r-=a=2e3<r?2e3:r;o=o+(i=i+t[n++]|0)|0,--a;);i%=65521,o%=65521}return i|o<<16|0}},{}],44:[function(e,t,r){t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(e,t,r){var n=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,i){var o=n,a=i+r;e^=-1;for(var s=i;s<a;s++)e=e>>>8^o[255&(e^t[s])];return-1^e}},{}],46:[function(e,t,r){var n,i=e("../utils/common"),o=e("./trees"),a=e("./adler32"),s=e("./crc32"),l=e("./messages"),c=0,u=4,f=0,d=-2,h=-1,p=4,m=2,g=8,y=9,v=286,b=30,w=19,_=2*v+1,x=15,I=3,k=258,S=k+I+1,E=42,A=113,T=1,P=2,O=3,F=4;function R(e,t){return e.msg=l[t],t}function C(e){return(e<<1)-(4<e?9:0)}function z(e){for(var t=e.length;0<=--t;)e[t]=0}function D(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(i.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function L(e,t){o._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,D(e.strm)}function U(e,t){e.pending_buf[e.pending++]=t}function B(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function N(e,t){var r,n,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match,l=e.strstart>e.w_size-S?e.strstart-(e.w_size-S):0,c=e.window,u=e.w_mask,f=e.prev,d=e.strstart+k,h=c[o+a-1],p=c[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(c[(r=t)+a]===p&&c[r+a-1]===h&&c[r]===c[o]&&c[++r]===c[o+1]){o+=2,r++;do{}while(c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&o<d);if(n=k-(d-o),o=d-k,a<n){if(e.match_start=t,s<=(a=n))break;h=c[o+a-1],p=c[o+a]}}}while((t=f[t&u])>l&&0!=--i);return a<=e.lookahead?a:e.lookahead}function j(e){var t,r,n,o,l,c,u,f,d,h,p=e.w_size;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=p+(p-S)){for(i.arraySet(e.window,e.window,p,p,0),e.match_start-=p,e.strstart-=p,e.block_start-=p,t=r=e.hash_size;n=e.head[--t],e.head[t]=p<=n?n-p:0,--r;);for(t=r=p;n=e.prev[--t],e.prev[t]=p<=n?n-p:0,--r;);o+=p}if(0===e.strm.avail_in)break;if(c=e.strm,u=e.window,f=e.strstart+e.lookahead,h=void 0,(d=o)<(h=c.avail_in)&&(h=d),r=0===h?0:(c.avail_in-=h,i.arraySet(u,c.input,c.next_in,h,f),1===c.state.wrap?c.adler=a(c.adler,u,h,f):2===c.state.wrap&&(c.adler=s(c.adler,u,h,f)),c.next_in+=h,c.total_in+=h,h),e.lookahead+=r,e.lookahead+e.insert>=I)for(l=e.strstart-e.insert,e.ins_h=e.window[l],e.ins_h=(e.ins_h<<e.hash_shift^e.window[l+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[l+I-1])&e.hash_mask,e.prev[l&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=l,l++,e.insert--,!(e.lookahead+e.insert<I)););}while(e.lookahead<S&&0!==e.strm.avail_in)}function M(e,t){for(var r,n;;){if(e.lookahead<S){if(j(e),e.lookahead<S&&t===c)return T;if(0===e.lookahead)break}if(r=0,e.lookahead>=I&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+I-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-S&&(e.match_length=N(e,r)),e.match_length>=I)if(n=o._tr_tally(e,e.strstart-e.match_start,e.match_length-I),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=I){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+I-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart,0!=--e.match_length;);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(L(e,!1),0===e.strm.avail_out))return T}return e.insert=e.strstart<I-1?e.strstart:I-1,t===u?(L(e,!0),0===e.strm.avail_out?O:F):e.last_lit&&(L(e,!1),0===e.strm.avail_out)?T:P}function W(e,t){for(var r,n,i;;){if(e.lookahead<S){if(j(e),e.lookahead<S&&t===c)return T;if(0===e.lookahead)break}if(r=0,e.lookahead>=I&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+I-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=I-1,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-S&&(e.match_length=N(e,r),e.match_length<=5&&(1===e.strategy||e.match_length===I&&4096<e.strstart-e.match_start)&&(e.match_length=I-1)),e.prev_length>=I&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-I,n=o._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-I),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+I-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!=--e.prev_length;);if(e.match_available=0,e.match_length=I-1,e.strstart++,n&&(L(e,!1),0===e.strm.avail_out))return T}else if(e.match_available){if((n=o._tr_tally(e,0,e.window[e.strstart-1]))&&L(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return T}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=o._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<I-1?e.strstart:I-1,t===u?(L(e,!0),0===e.strm.avail_out?O:F):e.last_lit&&(L(e,!1),0===e.strm.avail_out)?T:P}function V(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}function G(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=g,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(2*_),this.dyn_dtree=new i.Buf16(2*(2*b+1)),this.bl_tree=new i.Buf16(2*(2*w+1)),z(this.dyn_ltree),z(this.dyn_dtree),z(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(x+1),this.heap=new i.Buf16(2*v+1),z(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(2*v+1),z(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Z(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=m,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?E:A,e.adler=2===t.wrap?0:1,t.last_flush=c,o._tr_init(t),f):R(e,d)}function q(e){var t=Z(e);return t===f&&function(e){e.window_size=2*e.w_size,z(e.head),e.max_lazy_match=n[e.level].max_lazy,e.good_match=n[e.level].good_length,e.nice_match=n[e.level].nice_length,e.max_chain_length=n[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=I-1,e.match_available=0,e.ins_h=0}(e.state),t}function Y(e,t,r,n,o,a){if(!e)return d;var s=1;if(t===h&&(t=6),n<0?(s=0,n=-n):15<n&&(s=2,n-=16),o<1||y<o||r!==g||n<8||15<n||t<0||9<t||a<0||p<a)return R(e,d);8===n&&(n=9);var l=new G;return(e.state=l).strm=e,l.wrap=s,l.gzhead=null,l.w_bits=n,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=o+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+I-1)/I),l.window=new i.Buf8(2*l.w_size),l.head=new i.Buf16(l.hash_size),l.prev=new i.Buf16(l.w_size),l.lit_bufsize=1<<o+6,l.pending_buf_size=4*l.lit_bufsize,l.pending_buf=new i.Buf8(l.pending_buf_size),l.d_buf=1*l.lit_bufsize,l.l_buf=3*l.lit_bufsize,l.level=t,l.strategy=a,l.method=r,q(e)}n=[new V(0,0,0,0,(function(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(j(e),0===e.lookahead&&t===c)return T;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,L(e,!1),0===e.strm.avail_out))return T;if(e.strstart-e.block_start>=e.w_size-S&&(L(e,!1),0===e.strm.avail_out))return T}return e.insert=0,t===u?(L(e,!0),0===e.strm.avail_out?O:F):(e.strstart>e.block_start&&(L(e,!1),e.strm.avail_out),T)})),new V(4,4,8,4,M),new V(4,5,16,8,M),new V(4,6,32,32,M),new V(4,4,16,16,W),new V(8,16,32,32,W),new V(8,16,128,128,W),new V(8,32,128,256,W),new V(32,128,258,1024,W),new V(32,258,258,4096,W)],r.deflateInit=function(e,t){return Y(e,t,g,15,8,0)},r.deflateInit2=Y,r.deflateReset=q,r.deflateResetKeep=Z,r.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?d:(e.state.gzhead=t,f):d},r.deflate=function(e,t){var r,i,a,l;if(!e||!e.state||5<t||t<0)return e?R(e,d):d;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||666===i.status&&t!==u)return R(e,0===e.avail_out?-5:d);if(i.strm=e,r=i.last_flush,i.last_flush=t,i.status===E)if(2===i.wrap)e.adler=0,U(i,31),U(i,139),U(i,8),i.gzhead?(U(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),U(i,255&i.gzhead.time),U(i,i.gzhead.time>>8&255),U(i,i.gzhead.time>>16&255),U(i,i.gzhead.time>>24&255),U(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),U(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(U(i,255&i.gzhead.extra.length),U(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=s(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(U(i,0),U(i,0),U(i,0),U(i,0),U(i,0),U(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),U(i,3),i.status=A);else{var h=g+(i.w_bits-8<<4)<<8;h|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(h|=32),h+=31-h%31,i.status=A,B(i,h),0!==i.strstart&&(B(i,e.adler>>>16),B(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(a=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),D(e),a=i.pending,i.pending!==i.pending_buf_size));)U(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),D(e),a=i.pending,i.pending===i.pending_buf_size)){l=1;break}l=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,U(i,l)}while(0!==l);i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),0===l&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),D(e),a=i.pending,i.pending===i.pending_buf_size)){l=1;break}l=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,U(i,l)}while(0!==l);i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),0===l&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&D(e),i.pending+2<=i.pending_buf_size&&(U(i,255&e.adler),U(i,e.adler>>8&255),e.adler=0,i.status=A)):i.status=A),0!==i.pending){if(D(e),0===e.avail_out)return i.last_flush=-1,f}else if(0===e.avail_in&&C(t)<=C(r)&&t!==u)return R(e,-5);if(666===i.status&&0!==e.avail_in)return R(e,-5);if(0!==e.avail_in||0!==i.lookahead||t!==c&&666!==i.status){var p=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(j(e),0===e.lookahead)){if(t===c)return T;break}if(e.match_length=0,r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(L(e,!1),0===e.strm.avail_out))return T}return e.insert=0,t===u?(L(e,!0),0===e.strm.avail_out?O:F):e.last_lit&&(L(e,!1),0===e.strm.avail_out)?T:P}(i,t):3===i.strategy?function(e,t){for(var r,n,i,a,s=e.window;;){if(e.lookahead<=k){if(j(e),e.lookahead<=k&&t===c)return T;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=I&&0<e.strstart&&(n=s[i=e.strstart-1])===s[++i]&&n===s[++i]&&n===s[++i]){a=e.strstart+k;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&i<a);e.match_length=k-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=I?(r=o._tr_tally(e,1,e.match_length-I),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(L(e,!1),0===e.strm.avail_out))return T}return e.insert=0,t===u?(L(e,!0),0===e.strm.avail_out?O:F):e.last_lit&&(L(e,!1),0===e.strm.avail_out)?T:P}(i,t):n[i.level].func(i,t);if(p!==O&&p!==F||(i.status=666),p===T||p===O)return 0===e.avail_out&&(i.last_flush=-1),f;if(p===P&&(1===t?o._tr_align(i):5!==t&&(o._tr_stored_block(i,0,0,!1),3===t&&(z(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),D(e),0===e.avail_out))return i.last_flush=-1,f}return t!==u?f:i.wrap<=0?1:(2===i.wrap?(U(i,255&e.adler),U(i,e.adler>>8&255),U(i,e.adler>>16&255),U(i,e.adler>>24&255),U(i,255&e.total_in),U(i,e.total_in>>8&255),U(i,e.total_in>>16&255),U(i,e.total_in>>24&255)):(B(i,e.adler>>>16),B(i,65535&e.adler)),D(e),0<i.wrap&&(i.wrap=-i.wrap),0!==i.pending?f:1)},r.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==E&&69!==t&&73!==t&&91!==t&&103!==t&&t!==A&&666!==t?R(e,d):(e.state=null,t===A?R(e,-3):f):d},r.deflateSetDictionary=function(e,t){var r,n,o,s,l,c,u,h,p=t.length;if(!e||!e.state)return d;if(2===(s=(r=e.state).wrap)||1===s&&r.status!==E||r.lookahead)return d;for(1===s&&(e.adler=a(e.adler,t,p,0)),r.wrap=0,p>=r.w_size&&(0===s&&(z(r.head),r.strstart=0,r.block_start=0,r.insert=0),h=new i.Buf8(r.w_size),i.arraySet(h,t,p-r.w_size,r.w_size,0),t=h,p=r.w_size),l=e.avail_in,c=e.next_in,u=e.input,e.avail_in=p,e.next_in=0,e.input=t,j(r);r.lookahead>=I;){for(n=r.strstart,o=r.lookahead-(I-1);r.ins_h=(r.ins_h<<r.hash_shift^r.window[n+I-1])&r.hash_mask,r.prev[n&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=n,n++,--o;);r.strstart=n,r.lookahead=I-1,j(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=I-1,r.match_available=0,e.next_in=c,e.input=u,e.avail_in=l,r.wrap=s,f},r.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(e,t,r){t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(e,t,r){t.exports=function(e,t){var r,n,i,o,a,s,l,c,u,f,d,h,p,m,g,y,v,b,w,_,x,I,k,S,E;r=e.state,n=e.next_in,S=e.input,i=n+(e.avail_in-5),o=e.next_out,E=e.output,a=o-(t-e.avail_out),s=o+(e.avail_out-257),l=r.dmax,c=r.wsize,u=r.whave,f=r.wnext,d=r.window,h=r.hold,p=r.bits,m=r.lencode,g=r.distcode,y=(1<<r.lenbits)-1,v=(1<<r.distbits)-1;e:do{p<15&&(h+=S[n++]<<p,p+=8,h+=S[n++]<<p,p+=8),b=m[h&y];t:for(;;){if(h>>>=w=b>>>24,p-=w,0==(w=b>>>16&255))E[o++]=65535&b;else{if(!(16&w)){if(0==(64&w)){b=m[(65535&b)+(h&(1<<w)-1)];continue t}if(32&w){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}_=65535&b,(w&=15)&&(p<w&&(h+=S[n++]<<p,p+=8),_+=h&(1<<w)-1,h>>>=w,p-=w),p<15&&(h+=S[n++]<<p,p+=8,h+=S[n++]<<p,p+=8),b=g[h&v];r:for(;;){if(h>>>=w=b>>>24,p-=w,!(16&(w=b>>>16&255))){if(0==(64&w)){b=g[(65535&b)+(h&(1<<w)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(x=65535&b,p<(w&=15)&&(h+=S[n++]<<p,(p+=8)<w&&(h+=S[n++]<<p,p+=8)),l<(x+=h&(1<<w)-1)){e.msg="invalid distance too far back",r.mode=30;break e}if(h>>>=w,p-=w,(w=o-a)<x){if(u<(w=x-w)&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(k=d,(I=0)===f){if(I+=c-w,w<_){for(_-=w;E[o++]=d[I++],--w;);I=o-x,k=E}}else if(f<w){if(I+=c+f-w,(w-=f)<_){for(_-=w;E[o++]=d[I++],--w;);if(I=0,f<_){for(_-=w=f;E[o++]=d[I++],--w;);I=o-x,k=E}}}else if(I+=f-w,w<_){for(_-=w;E[o++]=d[I++],--w;);I=o-x,k=E}for(;2<_;)E[o++]=k[I++],E[o++]=k[I++],E[o++]=k[I++],_-=3;_&&(E[o++]=k[I++],1<_&&(E[o++]=k[I++]))}else{for(I=o-x;E[o++]=E[I++],E[o++]=E[I++],E[o++]=E[I++],2<(_-=3););_&&(E[o++]=E[I++],1<_&&(E[o++]=E[I++]))}break}}break}}while(n<i&&o<s);n-=_=p>>3,h&=(1<<(p-=_<<3))-1,e.next_in=n,e.next_out=o,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=o<s?s-o+257:257-(o-s),r.hold=h,r.bits=p}},{}],49:[function(e,t,r){var n=e("../utils/common"),i=e("./adler32"),o=e("./crc32"),a=e("./inffast"),s=e("./inftrees"),l=1,c=2,u=0,f=-2,d=1,h=852,p=592;function m(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function g(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function y(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=d,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(h),t.distcode=t.distdyn=new n.Buf32(p),t.sane=1,t.back=-1,u):f}function v(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,y(e)):f}function b(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15<t)?f:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,v(e))):f}function w(e,t){var r,n;return e?(n=new g,(e.state=n).window=null,(r=b(e,t))!==u&&(e.state=null),r):f}var _,x,I=!0;function k(e){if(I){var t;for(_=new n.Buf32(512),x=new n.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(s(l,e.lens,0,288,_,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(c,e.lens,0,32,x,0,e.work,{bits:5}),I=!1}e.lencode=_,e.lenbits=9,e.distcode=x,e.distbits=5}function S(e,t,r,i){var o,a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new n.Buf8(a.wsize)),i>=a.wsize?(n.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(i<(o=a.wsize-a.wnext)&&(o=i),n.arraySet(a.window,t,r-i,o,a.wnext),(i-=o)?(n.arraySet(a.window,t,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=o))),0}r.inflateReset=v,r.inflateReset2=b,r.inflateResetKeep=y,r.inflateInit=function(e){return w(e,15)},r.inflateInit2=w,r.inflate=function(e,t){var r,h,p,g,y,v,b,w,_,x,I,E,A,T,P,O,F,R,C,z,D,L,U,B,N=0,j=new n.Buf8(4),M=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return f;12===(r=e.state).mode&&(r.mode=13),y=e.next_out,p=e.output,b=e.avail_out,g=e.next_in,h=e.input,v=e.avail_in,w=r.hold,_=r.bits,x=v,I=b,L=u;e:for(;;)switch(r.mode){case d:if(0===r.wrap){r.mode=13;break}for(;_<16;){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}if(2&r.wrap&&35615===w){j[r.check=0]=255&w,j[1]=w>>>8&255,r.check=o(r.check,j,2,0),_=w=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&w)<<8)+(w>>8))%31){e.msg="incorrect header check",r.mode=30;break}if(8!=(15&w)){e.msg="unknown compression method",r.mode=30;break}if(_-=4,D=8+(15&(w>>>=4)),0===r.wbits)r.wbits=D;else if(D>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<<D,e.adler=r.check=1,r.mode=512&w?10:12,_=w=0;break;case 2:for(;_<16;){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}if(r.flags=w,8!=(255&r.flags)){e.msg="unknown compression method",r.mode=30;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=30;break}r.head&&(r.head.text=w>>8&1),512&r.flags&&(j[0]=255&w,j[1]=w>>>8&255,r.check=o(r.check,j,2,0)),_=w=0,r.mode=3;case 3:for(;_<32;){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}r.head&&(r.head.time=w),512&r.flags&&(j[0]=255&w,j[1]=w>>>8&255,j[2]=w>>>16&255,j[3]=w>>>24&255,r.check=o(r.check,j,4,0)),_=w=0,r.mode=4;case 4:for(;_<16;){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}r.head&&(r.head.xflags=255&w,r.head.os=w>>8),512&r.flags&&(j[0]=255&w,j[1]=w>>>8&255,r.check=o(r.check,j,2,0)),_=w=0,r.mode=5;case 5:if(1024&r.flags){for(;_<16;){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}r.length=w,r.head&&(r.head.extra_len=w),512&r.flags&&(j[0]=255&w,j[1]=w>>>8&255,r.check=o(r.check,j,2,0)),_=w=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(v<(E=r.length)&&(E=v),E&&(r.head&&(D=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,h,g,E,D)),512&r.flags&&(r.check=o(r.check,h,E,g)),v-=E,g+=E,r.length-=E),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===v)break e;for(E=0;D=h[g+E++],r.head&&D&&r.length<65536&&(r.head.name+=String.fromCharCode(D)),D&&E<v;);if(512&r.flags&&(r.check=o(r.check,h,E,g)),v-=E,g+=E,D)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===v)break e;for(E=0;D=h[g+E++],r.head&&D&&r.length<65536&&(r.head.comment+=String.fromCharCode(D)),D&&E<v;);if(512&r.flags&&(r.check=o(r.check,h,E,g)),v-=E,g+=E,D)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;_<16;){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}if(w!==(65535&r.check)){e.msg="header crc mismatch",r.mode=30;break}_=w=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;_<32;){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}e.adler=r.check=m(w),_=w=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=y,e.avail_out=b,e.next_in=g,e.avail_in=v,r.hold=w,r.bits=_,2;e.adler=r.check=1,r.mode=12;case 12:if(5===t||6===t)break e;case 13:if(r.last){w>>>=7&_,_-=7&_,r.mode=27;break}for(;_<3;){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}switch(r.last=1&w,_-=1,3&(w>>>=1)){case 0:r.mode=14;break;case 1:if(k(r),r.mode=20,6!==t)break;w>>>=2,_-=2;break e;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}w>>>=2,_-=2;break;case 14:for(w>>>=7&_,_-=7&_;_<32;){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}if((65535&w)!=(w>>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&w,_=w=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(E=r.length){if(v<E&&(E=v),b<E&&(E=b),0===E)break e;n.arraySet(p,h,g,E,y),v-=E,g+=E,b-=E,y+=E,r.length-=E;break}r.mode=12;break;case 17:for(;_<14;){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}if(r.nlen=257+(31&w),w>>>=5,_-=5,r.ndist=1+(31&w),w>>>=5,_-=5,r.ncode=4+(15&w),w>>>=4,_-=4,286<r.nlen||30<r.ndist){e.msg="too many length or distance symbols",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;_<3;){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}r.lens[M[r.have++]]=7&w,w>>>=3,_-=3}for(;r.have<19;)r.lens[M[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,U={bits:r.lenbits},L=s(0,r.lens,0,19,r.lencode,0,r.work,U),r.lenbits=U.bits,L){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;O=(N=r.lencode[w&(1<<r.lenbits)-1])>>>16&255,F=65535&N,!((P=N>>>24)<=_);){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}if(F<16)w>>>=P,_-=P,r.lens[r.have++]=F;else{if(16===F){for(B=P+2;_<B;){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}if(w>>>=P,_-=P,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}D=r.lens[r.have-1],E=3+(3&w),w>>>=2,_-=2}else if(17===F){for(B=P+3;_<B;){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}_-=P,D=0,E=3+(7&(w>>>=P)),w>>>=3,_-=3}else{for(B=P+7;_<B;){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}_-=P,D=0,E=11+(127&(w>>>=P)),w>>>=7,_-=7}if(r.have+E>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;E--;)r.lens[r.have++]=D}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,U={bits:r.lenbits},L=s(l,r.lens,0,r.nlen,r.lencode,0,r.work,U),r.lenbits=U.bits,L){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,U={bits:r.distbits},L=s(c,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,U),r.distbits=U.bits,L){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(6<=v&&258<=b){e.next_out=y,e.avail_out=b,e.next_in=g,e.avail_in=v,r.hold=w,r.bits=_,a(e,I),y=e.next_out,p=e.output,b=e.avail_out,g=e.next_in,h=e.input,v=e.avail_in,w=r.hold,_=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;O=(N=r.lencode[w&(1<<r.lenbits)-1])>>>16&255,F=65535&N,!((P=N>>>24)<=_);){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}if(O&&0==(240&O)){for(R=P,C=O,z=F;O=(N=r.lencode[z+((w&(1<<R+C)-1)>>R)])>>>16&255,F=65535&N,!(R+(P=N>>>24)<=_);){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}w>>>=R,_-=R,r.back+=R}if(w>>>=P,_-=P,r.back+=P,r.length=F,0===O){r.mode=26;break}if(32&O){r.back=-1,r.mode=12;break}if(64&O){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&O,r.mode=22;case 22:if(r.extra){for(B=r.extra;_<B;){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}r.length+=w&(1<<r.extra)-1,w>>>=r.extra,_-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;O=(N=r.distcode[w&(1<<r.distbits)-1])>>>16&255,F=65535&N,!((P=N>>>24)<=_);){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}if(0==(240&O)){for(R=P,C=O,z=F;O=(N=r.distcode[z+((w&(1<<R+C)-1)>>R)])>>>16&255,F=65535&N,!(R+(P=N>>>24)<=_);){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}w>>>=R,_-=R,r.back+=R}if(w>>>=P,_-=P,r.back+=P,64&O){e.msg="invalid distance code",r.mode=30;break}r.offset=F,r.extra=15&O,r.mode=24;case 24:if(r.extra){for(B=r.extra;_<B;){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}r.offset+=w&(1<<r.extra)-1,w>>>=r.extra,_-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===b)break e;if(E=I-b,r.offset>E){if((E=r.offset-E)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}A=E>r.wnext?(E-=r.wnext,r.wsize-E):r.wnext-E,E>r.length&&(E=r.length),T=r.window}else T=p,A=y-r.offset,E=r.length;for(b<E&&(E=b),b-=E,r.length-=E;p[y++]=T[A++],--E;);0===r.length&&(r.mode=21);break;case 26:if(0===b)break e;p[y++]=r.length,b--,r.mode=21;break;case 27:if(r.wrap){for(;_<32;){if(0===v)break e;v--,w|=h[g++]<<_,_+=8}if(I-=b,e.total_out+=I,r.total+=I,I&&(e.adler=r.check=r.flags?o(r.check,p,I,y-I):i(r.check,p,I,y-I)),I=b,(r.flags?w:m(w))!==r.check){e.msg="incorrect data check",r.mode=30;break}_=w=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;_<32;){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}if(w!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=30;break}_=w=0}r.mode=29;case 29:L=1;break e;case 30:L=-3;break e;case 31:return-4;default:return f}return e.next_out=y,e.avail_out=b,e.next_in=g,e.avail_in=v,r.hold=w,r.bits=_,(r.wsize||I!==e.avail_out&&r.mode<30&&(r.mode<27||4!==t))&&S(e,e.output,e.next_out,I-e.avail_out)?(r.mode=31,-4):(x-=e.avail_in,I-=e.avail_out,e.total_in+=x,e.total_out+=I,r.total+=I,r.wrap&&I&&(e.adler=r.check=r.flags?o(r.check,p,I,e.next_out-I):i(r.check,p,I,e.next_out-I)),e.data_type=r.bits+(r.last?64:0)+(12===r.mode?128:0)+(20===r.mode||15===r.mode?256:0),(0==x&&0===I||4===t)&&L===u&&(L=-5),L)},r.inflateEnd=function(e){if(!e||!e.state)return f;var t=e.state;return t.window&&(t.window=null),e.state=null,u},r.inflateGetHeader=function(e,t){var r;return e&&e.state?0==(2&(r=e.state).wrap)?f:((r.head=t).done=!1,u):f},r.inflateSetDictionary=function(e,t){var r,n=t.length;return e&&e.state?0!==(r=e.state).wrap&&11!==r.mode?f:11===r.mode&&i(1,t,n,0)!==r.check?-3:S(e,t,n,n)?(r.mode=31,-4):(r.havedict=1,u):f},r.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(e,t,r){var n=e("../utils/common"),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],a=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],s=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,r,l,c,u,f,d){var h,p,m,g,y,v,b,w,_,x=d.bits,I=0,k=0,S=0,E=0,A=0,T=0,P=0,O=0,F=0,R=0,C=null,z=0,D=new n.Buf16(16),L=new n.Buf16(16),U=null,B=0;for(I=0;I<=15;I++)D[I]=0;for(k=0;k<l;k++)D[t[r+k]]++;for(A=x,E=15;1<=E&&0===D[E];E--);if(E<A&&(A=E),0===E)return c[u++]=20971520,c[u++]=20971520,d.bits=1,0;for(S=1;S<E&&0===D[S];S++);for(A<S&&(A=S),I=O=1;I<=15;I++)if(O<<=1,(O-=D[I])<0)return-1;if(0<O&&(0===e||1!==E))return-1;for(L[1]=0,I=1;I<15;I++)L[I+1]=L[I]+D[I];for(k=0;k<l;k++)0!==t[r+k]&&(f[L[t[r+k]]++]=k);if(v=0===e?(C=U=f,19):1===e?(C=i,z-=257,U=o,B-=257,256):(C=a,U=s,-1),I=S,y=u,P=k=R=0,m=-1,g=(F=1<<(T=A))-1,1===e&&852<F||2===e&&592<F)return 1;for(;;){for(b=I-P,_=f[k]<v?(w=0,f[k]):f[k]>v?(w=U[B+f[k]],C[z+f[k]]):(w=96,0),h=1<<I-P,S=p=1<<T;c[y+(R>>P)+(p-=h)]=b<<24|w<<16|_|0,0!==p;);for(h=1<<I-1;R&h;)h>>=1;if(0!==h?(R&=h-1,R+=h):R=0,k++,0==--D[I]){if(I===E)break;I=t[r+f[k]]}if(A<I&&(R&g)!==m){for(0===P&&(P=A),y+=S,O=1<<(T=I-P);T+P<E&&!((O-=D[T+P])<=0);)T++,O<<=1;if(F+=1<<T,1===e&&852<F||2===e&&592<F)return 1;c[m=R&g]=A<<24|T<<16|y-u|0}}return 0!==R&&(c[y+R]=I-P<<24|64<<16|0),d.bits=A,0}},{"../utils/common":41}],51:[function(e,t,r){t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(e,t,r){var n=e("../utils/common"),i=0,o=1;function a(e){for(var t=e.length;0<=--t;)e[t]=0}var s=0,l=29,c=256,u=c+1+l,f=30,d=19,h=2*u+1,p=15,m=16,g=7,y=256,v=16,b=17,w=18,_=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],x=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],I=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],k=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S=new Array(2*(u+2));a(S);var E=new Array(2*f);a(E);var A=new Array(512);a(A);var T=new Array(256);a(T);var P=new Array(l);a(P);var O,F,R,C=new Array(f);function z(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function D(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function L(e){return e<256?A[e]:A[256+(e>>>7)]}function U(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function B(e,t,r){e.bi_valid>m-r?(e.bi_buf|=t<<e.bi_valid&65535,U(e,e.bi_buf),e.bi_buf=t>>m-e.bi_valid,e.bi_valid+=r-m):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function N(e,t,r){B(e,r[2*t],r[2*t+1])}function j(e,t){for(var r=0;r|=1&e,e>>>=1,r<<=1,0<--t;);return r>>>1}function M(e,t,r){var n,i,o=new Array(p+1),a=0;for(n=1;n<=p;n++)o[n]=a=a+r[n-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=j(o[s]++,s))}}function W(e){var t;for(t=0;t<u;t++)e.dyn_ltree[2*t]=0;for(t=0;t<f;t++)e.dyn_dtree[2*t]=0;for(t=0;t<d;t++)e.bl_tree[2*t]=0;e.dyn_ltree[2*y]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function V(e){8<e.bi_valid?U(e,e.bi_buf):0<e.bi_valid&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function G(e,t,r,n){var i=2*t,o=2*r;return e[i]<e[o]||e[i]===e[o]&&n[t]<=n[r]}function Z(e,t,r){for(var n=e.heap[r],i=r<<1;i<=e.heap_len&&(i<e.heap_len&&G(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!G(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n}function q(e,t,r){var n,i,o,a,s=0;if(0!==e.last_lit)for(;n=e.pending_buf[e.d_buf+2*s]<<8|e.pending_buf[e.d_buf+2*s+1],i=e.pending_buf[e.l_buf+s],s++,0===n?N(e,i,t):(N(e,(o=T[i])+c+1,t),0!==(a=_[o])&&B(e,i-=P[o],a),N(e,o=L(--n),r),0!==(a=x[o])&&B(e,n-=C[o],a)),s<e.last_lit;);N(e,y,t)}function Y(e,t){var r,n,i,o=t.dyn_tree,a=t.stat_desc.static_tree,s=t.stat_desc.has_stree,l=t.stat_desc.elems,c=-1;for(e.heap_len=0,e.heap_max=h,r=0;r<l;r++)0!==o[2*r]?(e.heap[++e.heap_len]=c=r,e.depth[r]=0):o[2*r+1]=0;for(;e.heap_len<2;)o[2*(i=e.heap[++e.heap_len]=c<2?++c:0)]=1,e.depth[i]=0,e.opt_len--,s&&(e.static_len-=a[2*i+1]);for(t.max_code=c,r=e.heap_len>>1;1<=r;r--)Z(e,o,r);for(i=l;r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Z(e,o,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,o[2*i]=o[2*r]+o[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,o[2*r+1]=o[2*n+1]=i,e.heap[1]=i++,Z(e,o,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,o,a,s,l=t.dyn_tree,c=t.max_code,u=t.stat_desc.static_tree,f=t.stat_desc.has_stree,d=t.stat_desc.extra_bits,m=t.stat_desc.extra_base,g=t.stat_desc.max_length,y=0;for(o=0;o<=p;o++)e.bl_count[o]=0;for(l[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<h;r++)g<(o=l[2*l[2*(n=e.heap[r])+1]+1]+1)&&(o=g,y++),l[2*n+1]=o,c<n||(e.bl_count[o]++,a=0,m<=n&&(a=d[n-m]),s=l[2*n],e.opt_len+=s*(o+a),f&&(e.static_len+=s*(u[2*n+1]+a)));if(0!==y){do{for(o=g-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[g]--,y-=2}while(0<y);for(o=g;0!==o;o--)for(n=e.bl_count[o];0!==n;)c<(i=e.heap[--r])||(l[2*i+1]!==o&&(e.opt_len+=(o-l[2*i+1])*l[2*i],l[2*i+1]=o),n--)}}(e,t),M(o,c,e.bl_count)}function $(e,t,r){var n,i,o=-1,a=t[1],s=0,l=7,c=4;for(0===a&&(l=138,c=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=a,a=t[2*(n+1)+1],++s<l&&i===a||(s<c?e.bl_tree[2*i]+=s:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[2*v]++):s<=10?e.bl_tree[2*b]++:e.bl_tree[2*w]++,o=i,c=(s=0)===a?(l=138,3):i===a?(l=6,3):(l=7,4))}function H(e,t,r){var n,i,o=-1,a=t[1],s=0,l=7,c=4;for(0===a&&(l=138,c=3),n=0;n<=r;n++)if(i=a,a=t[2*(n+1)+1],!(++s<l&&i===a)){if(s<c)for(;N(e,i,e.bl_tree),0!=--s;);else 0!==i?(i!==o&&(N(e,i,e.bl_tree),s--),N(e,v,e.bl_tree),B(e,s-3,2)):s<=10?(N(e,b,e.bl_tree),B(e,s-3,3)):(N(e,w,e.bl_tree),B(e,s-11,7));o=i,c=(s=0)===a?(l=138,3):i===a?(l=6,3):(l=7,4)}}a(C);var J=!1;function K(e,t,r,i){B(e,(s<<1)+(i?1:0),3),function(e,t,r,i){V(e),i&&(U(e,r),U(e,~r)),n.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}(e,t,r,!0)}r._tr_init=function(e){J||(function(){var e,t,r,n,i,o=new Array(p+1);for(n=r=0;n<l-1;n++)for(P[n]=r,e=0;e<1<<_[n];e++)T[r++]=n;for(T[r-1]=n,n=i=0;n<16;n++)for(C[n]=i,e=0;e<1<<x[n];e++)A[i++]=n;for(i>>=7;n<f;n++)for(C[n]=i<<7,e=0;e<1<<x[n]-7;e++)A[256+i++]=n;for(t=0;t<=p;t++)o[t]=0;for(e=0;e<=143;)S[2*e+1]=8,e++,o[8]++;for(;e<=255;)S[2*e+1]=9,e++,o[9]++;for(;e<=279;)S[2*e+1]=7,e++,o[7]++;for(;e<=287;)S[2*e+1]=8,e++,o[8]++;for(M(S,u+1,o),e=0;e<f;e++)E[2*e+1]=5,E[2*e]=j(e,5);O=new z(S,_,c+1,u,p),F=new z(E,x,0,f,p),R=new z(new Array(0),I,0,d,g)}(),J=!0),e.l_desc=new D(e.dyn_ltree,O),e.d_desc=new D(e.dyn_dtree,F),e.bl_desc=new D(e.bl_tree,R),e.bi_buf=0,e.bi_valid=0,W(e)},r._tr_stored_block=K,r._tr_flush_block=function(e,t,r,n){var a,s,l=0;0<e.level?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return i;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return o;for(t=32;t<c;t++)if(0!==e.dyn_ltree[2*t])return o;return i}(e)),Y(e,e.l_desc),Y(e,e.d_desc),l=function(e){var t;for($(e,e.dyn_ltree,e.l_desc.max_code),$(e,e.dyn_dtree,e.d_desc.max_code),Y(e,e.bl_desc),t=d-1;3<=t&&0===e.bl_tree[2*k[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),a=e.opt_len+3+7>>>3,(s=e.static_len+3+7>>>3)<=a&&(a=s)):a=s=r+5,r+4<=a&&-1!==t?K(e,t,r,n):4===e.strategy||s===a?(B(e,2+(n?1:0),3),q(e,S,E)):(B(e,4+(n?1:0),3),function(e,t,r,n){var i;for(B(e,t-257,5),B(e,r-1,5),B(e,n-4,4),i=0;i<n;i++)B(e,e.bl_tree[2*k[i]+1],3);H(e,e.dyn_ltree,t-1),H(e,e.dyn_dtree,r-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,l+1),q(e,e.dyn_ltree,e.dyn_dtree)),W(e),n&&V(e)},r._tr_tally=function(e,t,r){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(T[r]+c+1)]++,e.dyn_dtree[2*L(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){B(e,2,3),N(e,y,S),function(e){16===e.bi_valid?(U(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":41}],53:[function(e,t,r){t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,t,r){t.exports="function"==typeof setImmediate?setImmediate:function(){var e=[].slice.apply(arguments);e.splice(1,0,0),setTimeout.apply(null,e)}},{}]},{},[10])(10)}(de);var he=de.exports;var pe,me,ge=Function.prototype,ye=Object.prototype,ve=ge.toString,be=ye.hasOwnProperty,we=ve.call(Object),_e=ye.toString,xe=(pe=Object.getPrototypeOf,me=Object,function(e){return pe(me(e))});var Ie=function(e){if(!function(e){return!!e&&"object"==typeof e}(e)||"[object Object]"!=_e.call(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e))return!1;var t=xe(e);if(null===t)return!0;var r=be.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&ve.call(r)==we},ke={exports:{}},Se={},Ee={exports:{}},Ae={};function Te(){var e={"align-content":!1,"align-items":!1,"align-self":!1,"alignment-adjust":!1,"alignment-baseline":!1,all:!1,"anchor-point":!1,animation:!1,"animation-delay":!1,"animation-direction":!1,"animation-duration":!1,"animation-fill-mode":!1,"animation-iteration-count":!1,"animation-name":!1,"animation-play-state":!1,"animation-timing-function":!1,azimuth:!1,"backface-visibility":!1,background:!0,"background-attachment":!0,"background-clip":!0,"background-color":!0,"background-image":!0,"background-origin":!0,"background-position":!0,"background-repeat":!0,"background-size":!0,"baseline-shift":!1,binding:!1,bleed:!1,"bookmark-label":!1,"bookmark-level":!1,"bookmark-state":!1,border:!0,"border-bottom":!0,"border-bottom-color":!0,"border-bottom-left-radius":!0,"border-bottom-right-radius":!0,"border-bottom-style":!0,"border-bottom-width":!0,"border-collapse":!0,"border-color":!0,"border-image":!0,"border-image-outset":!0,"border-image-repeat":!0,"border-image-slice":!0,"border-image-source":!0,"border-image-width":!0,"border-left":!0,"border-left-color":!0,"border-left-style":!0,"border-left-width":!0,"border-radius":!0,"border-right":!0,"border-right-color":!0,"border-right-style":!0,"border-right-width":!0,"border-spacing":!0,"border-style":!0,"border-top":!0,"border-top-color":!0,"border-top-left-radius":!0,"border-top-right-radius":!0,"border-top-style":!0,"border-top-width":!0,"border-width":!0,bottom:!1,"box-decoration-break":!0,"box-shadow":!0,"box-sizing":!0,"box-snap":!0,"box-suppress":!0,"break-after":!0,"break-before":!0,"break-inside":!0,"caption-side":!1,chains:!1,clear:!0,clip:!1,"clip-path":!1,"clip-rule":!1,color:!0,"color-interpolation-filters":!0,"column-count":!1,"column-fill":!1,"column-gap":!1,"column-rule":!1,"column-rule-color":!1,"column-rule-style":!1,"column-rule-width":!1,"column-span":!1,"column-width":!1,columns:!1,contain:!1,content:!1,"counter-increment":!1,"counter-reset":!1,"counter-set":!1,crop:!1,cue:!1,"cue-after":!1,"cue-before":!1,cursor:!1,direction:!1,display:!0,"display-inside":!0,"display-list":!0,"display-outside":!0,"dominant-baseline":!1,elevation:!1,"empty-cells":!1,filter:!1,flex:!1,"flex-basis":!1,"flex-direction":!1,"flex-flow":!1,"flex-grow":!1,"flex-shrink":!1,"flex-wrap":!1,float:!1,"float-offset":!1,"flood-color":!1,"flood-opacity":!1,"flow-from":!1,"flow-into":!1,font:!0,"font-family":!0,"font-feature-settings":!0,"font-kerning":!0,"font-language-override":!0,"font-size":!0,"font-size-adjust":!0,"font-stretch":!0,"font-style":!0,"font-synthesis":!0,"font-variant":!0,"font-variant-alternates":!0,"font-variant-caps":!0,"font-variant-east-asian":!0,"font-variant-ligatures":!0,"font-variant-numeric":!0,"font-variant-position":!0,"font-weight":!0,grid:!1,"grid-area":!1,"grid-auto-columns":!1,"grid-auto-flow":!1,"grid-auto-rows":!1,"grid-column":!1,"grid-column-end":!1,"grid-column-start":!1,"grid-row":!1,"grid-row-end":!1,"grid-row-start":!1,"grid-template":!1,"grid-template-areas":!1,"grid-template-columns":!1,"grid-template-rows":!1,"hanging-punctuation":!1,height:!0,hyphens:!1,icon:!1,"image-orientation":!1,"image-resolution":!1,"ime-mode":!1,"initial-letters":!1,"inline-box-align":!1,"justify-content":!1,"justify-items":!1,"justify-self":!1,left:!1,"letter-spacing":!0,"lighting-color":!0,"line-box-contain":!1,"line-break":!1,"line-grid":!1,"line-height":!1,"line-snap":!1,"line-stacking":!1,"line-stacking-ruby":!1,"line-stacking-shift":!1,"line-stacking-strategy":!1,"list-style":!0,"list-style-image":!0,"list-style-position":!0,"list-style-type":!0,margin:!0,"margin-bottom":!0,"margin-left":!0,"margin-right":!0,"margin-top":!0,"marker-offset":!1,"marker-side":!1,marks:!1,mask:!1,"mask-box":!1,"mask-box-outset":!1,"mask-box-repeat":!1,"mask-box-slice":!1,"mask-box-source":!1,"mask-box-width":!1,"mask-clip":!1,"mask-image":!1,"mask-origin":!1,"mask-position":!1,"mask-repeat":!1,"mask-size":!1,"mask-source-type":!1,"mask-type":!1,"max-height":!0,"max-lines":!1,"max-width":!0,"min-height":!0,"min-width":!0,"move-to":!1,"nav-down":!1,"nav-index":!1,"nav-left":!1,"nav-right":!1,"nav-up":!1,"object-fit":!1,"object-position":!1,opacity:!1,order:!1,orphans:!1,outline:!1,"outline-color":!1,"outline-offset":!1,"outline-style":!1,"outline-width":!1,overflow:!1,"overflow-wrap":!1,"overflow-x":!1,"overflow-y":!1,padding:!0,"padding-bottom":!0,"padding-left":!0,"padding-right":!0,"padding-top":!0,page:!1,"page-break-after":!1,"page-break-before":!1,"page-break-inside":!1,"page-policy":!1,pause:!1,"pause-after":!1,"pause-before":!1,perspective:!1,"perspective-origin":!1,pitch:!1,"pitch-range":!1,"play-during":!1,position:!1,"presentation-level":!1,quotes:!1,"region-fragment":!1,resize:!1,rest:!1,"rest-after":!1,"rest-before":!1,richness:!1,right:!1,rotation:!1,"rotation-point":!1,"ruby-align":!1,"ruby-merge":!1,"ruby-position":!1,"shape-image-threshold":!1,"shape-outside":!1,"shape-margin":!1,size:!1,speak:!1,"speak-as":!1,"speak-header":!1,"speak-numeral":!1,"speak-punctuation":!1,"speech-rate":!1,stress:!1,"string-set":!1,"tab-size":!1,"table-layout":!1,"text-align":!0,"text-align-last":!0,"text-combine-upright":!0,"text-decoration":!0,"text-decoration-color":!0,"text-decoration-line":!0,"text-decoration-skip":!0,"text-decoration-style":!0,"text-emphasis":!0,"text-emphasis-color":!0,"text-emphasis-position":!0,"text-emphasis-style":!0,"text-height":!0,"text-indent":!0,"text-justify":!0,"text-orientation":!0,"text-overflow":!0,"text-shadow":!0,"text-space-collapse":!0,"text-transform":!0,"text-underline-position":!0,"text-wrap":!0,top:!1,transform:!1,"transform-origin":!1,"transform-style":!1,transition:!1,"transition-delay":!1,"transition-duration":!1,"transition-property":!1,"transition-timing-function":!1,"unicode-bidi":!1,"vertical-align":!1,visibility:!1,"voice-balance":!1,"voice-duration":!1,"voice-family":!1,"voice-pitch":!1,"voice-range":!1,"voice-rate":!1,"voice-stress":!1,"voice-volume":!1,volume:!1,"white-space":!1,widows:!1,width:!0,"will-change":!1,"word-break":!0,"word-spacing":!0,"word-wrap":!0,"wrap-flow":!1,"wrap-through":!1,"writing-mode":!1,"z-index":!1};return e}var Pe=/javascript\s*\:/gim;Ae.whiteList=Te(),Ae.getDefaultWhiteList=Te,Ae.onAttr=function(e,t,r){},Ae.onIgnoreAttr=function(e,t,r){},Ae.safeAttrValue=function(e,t){return Pe.test(t)?"":t};var Oe={indexOf:function(e,t){var r,n;if(Array.prototype.indexOf)return e.indexOf(t);for(r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1},forEach:function(e,t,r){var n,i;if(Array.prototype.forEach)return e.forEach(t,r);for(n=0,i=e.length;n<i;n++)t.call(r,e[n],n,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},trimRight:function(e){return String.prototype.trimRight?e.trimRight():e.replace(/(\s*$)/g,"")}};var Fe=function(e,t){";"!==(e=Oe.trimRight(e))[e.length-1]&&(e+=";");var r=e.length,n=!1,i=0,o=0,a="";function s(){if(!n){var r=Oe.trim(e.slice(i,o)),s=r.indexOf(":");if(-1!==s){var l=Oe.trim(r.slice(0,s)),c=Oe.trim(r.slice(s+1));if(l){var u=t(i,a.length,l,c,r);u&&(a+=u+"; ")}}}i=o+1}for(;o<r;o++){var l=e[o];if("/"===l&&"*"===e[o+1]){var c=e.indexOf("*/",o+2);if(-1===c)break;i=(o=c+1)+1,n=!1}else"("===l?n=!0:")"===l?n=!1:";"===l?n||s():"\n"===l&&s()}return Oe.trim(a)},Re=Ae,Ce=Fe;function ze(e){return null==e}function De(e){(e=function(e){var t={};for(var r in e)t[r]=e[r];return t}(e||{})).whiteList=e.whiteList||Re.whiteList,e.onAttr=e.onAttr||Re.onAttr,e.onIgnoreAttr=e.onIgnoreAttr||Re.onIgnoreAttr,e.safeAttrValue=e.safeAttrValue||Re.safeAttrValue,this.options=e}De.prototype.process=function(e){if(!(e=(e=e||"").toString()))return"";var t=this.options,r=t.whiteList,n=t.onAttr,i=t.onIgnoreAttr,o=t.safeAttrValue;return Ce(e,(function(e,t,a,s,l){var c=r[a],u=!1;if(!0===c?u=c:"function"==typeof c?u=c(s):c instanceof RegExp&&(u=c.test(s)),!0!==u&&(u=!1),s=o(a,s)){var f,d={position:t,sourcePosition:e,source:l,isWhite:u};return u?ze(f=n(a,s,d))?a+":"+s:f:ze(f=i(a,s,d))?void 0:f}}))};var Le=De;!function(e,t){var r=Ae,n=Le;for(var i in(t=e.exports=function(e,t){return new n(t).process(e)}).FilterCSS=n,r)t[i]=r[i]}(Ee,Ee.exports);var Ue={indexOf:function(e,t){var r,n;if(Array.prototype.indexOf)return e.indexOf(t);for(r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1},forEach:function(e,t,r){var n,i;if(Array.prototype.forEach)return e.forEach(t,r);for(n=0,i=e.length;n<i;n++)t.call(r,e[n],n,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},spaceIndex:function(e){var t=/\s|\n|\t/.exec(e);return t?t.index:-1}},Be=Ee.exports.FilterCSS,Ne=Ee.exports.getDefaultWhiteList,je=Ue;function Me(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height"],ins:["datetime"],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}}var We=new Be;function Ve(e){return e.replace(Ge,"<").replace(Ze,">")}var Ge=/</g,Ze=/>/g,qe=/"/g,Ye=/"/g,$e=/&#([a-zA-Z0-9]*);?/gim,He=/:?/gim,Je=/&newline;?/gim,Ke=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a)\:/gi,Xe=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,Qe=/u\s*r\s*l\s*\(.*/gi;function et(e){return e.replace(qe,""")}function tt(e){return e.replace(Ye,'"')}function rt(e){return e.replace($e,(function(e,t){return"x"===t[0]||"X"===t[0]?String.fromCharCode(parseInt(t.substr(1),16)):String.fromCharCode(parseInt(t,10))}))}function nt(e){return e.replace(He,":").replace(Je," ")}function it(e){for(var t="",r=0,n=e.length;r<n;r++)t+=e.charCodeAt(r)<32?" ":e.charAt(r);return je.trim(t)}function ot(e){return e=it(e=nt(e=rt(e=tt(e))))}function at(e){return e=Ve(e=et(e))}Se.whiteList={a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height"],ins:["datetime"],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]},Se.getDefaultWhiteList=Me,Se.onTag=function(e,t,r){},Se.onIgnoreTag=function(e,t,r){},Se.onTagAttr=function(e,t,r){},Se.onIgnoreTagAttr=function(e,t,r){},Se.safeAttrValue=function(e,t,r,n){if(r=ot(r),"href"===t||"src"===t){if("#"===(r=je.trim(r)))return"#";if("http://"!==r.substr(0,7)&&"https://"!==r.substr(0,8)&&"mailto:"!==r.substr(0,7)&&"tel:"!==r.substr(0,4)&&"data:image/"!==r.substr(0,11)&&"ftp://"!==r.substr(0,6)&&"./"!==r.substr(0,2)&&"../"!==r.substr(0,3)&&"#"!==r[0]&&"/"!==r[0])return""}else if("background"===t){if(Ke.lastIndex=0,Ke.test(r))return""}else if("style"===t){if(Xe.lastIndex=0,Xe.test(r))return"";if(Qe.lastIndex=0,Qe.test(r)&&(Ke.lastIndex=0,Ke.test(r)))return"";!1!==n&&(r=(n=n||We).process(r))}return r=at(r)},Se.escapeHtml=Ve,Se.escapeQuote=et,Se.unescapeQuote=tt,Se.escapeHtmlEntities=rt,Se.escapeDangerHtml5Entities=nt,Se.clearNonPrintableCharacter=it,Se.friendlyAttrValue=ot,Se.escapeAttrValue=at,Se.onIgnoreTagStripAll=function(){return""},Se.StripTagBody=function(e,t){"function"!=typeof t&&(t=function(){});var r=!Array.isArray(e),n=[],i=!1;return{onIgnoreTag:function(o,a,s){if(function(t){return!!r||-1!==je.indexOf(e,t)}(o)){if(s.isClosing){var l="[/removed]",c=s.position+l.length;return n.push([!1!==i?i:s.position,c]),i=!1,l}return i||(i=s.position),"[removed]"}return t(o,a,s)},remove:function(e){var t="",r=0;return je.forEach(n,(function(n){t+=e.slice(r,n[0]),r=n[1]})),t+=e.slice(r)}}},Se.stripCommentTag=function(e){for(var t="",r=0;r<e.length;){var n=e.indexOf("\x3c!--",r);if(-1===n){t+=e.slice(r);break}t+=e.slice(r,n);var i=e.indexOf("--\x3e",n);if(-1===i)break;r=i+3}return t},Se.stripBlankChar=function(e){var t=e.split("");return(t=t.filter((function(e){var t=e.charCodeAt(0);return 127!==t&&(!(t<=31)||(10===t||13===t))}))).join("")},Se.cssFilter=We,Se.getDefaultCSSWhiteList=Ne;var st={},lt=Ue;function ct(e){var t=lt.spaceIndex(e);if(-1===t)var r=e.slice(1,-1);else r=e.slice(1,t+1);return"/"===(r=lt.trim(r).toLowerCase()).slice(0,1)&&(r=r.slice(1)),"/"===r.slice(-1)&&(r=r.slice(0,-1)),r}function ut(e){return"</"===e.slice(0,2)}var ft=/[^a-zA-Z0-9_:\.\-]/gim;function dt(e,t){for(;t<e.length;t++){var r=e[t];if(" "!==r)return"="===r?t:-1}}function ht(e,t){for(;t>0;t--){var r=e[t];if(" "!==r)return"="===r?t:-1}}function pt(e){return function(e){return'"'===e[0]&&'"'===e[e.length-1]||"'"===e[0]&&"'"===e[e.length-1]}(e)?e.substr(1,e.length-2):e}st.parseTag=function(e,t,r){var n="",i=0,o=!1,a=!1,s=0,l=e.length,c="",u="";e:for(s=0;s<l;s++){var f=e.charAt(s);if(!1===o){if("<"===f){o=s;continue}}else if(!1===a){if("<"===f){n+=r(e.slice(i,s)),o=s,i=s;continue}if(">"===f){n+=r(e.slice(i,o)),c=ct(u=e.slice(o,s+1)),n+=t(o,n.length,c,u,ut(u)),i=s+1,o=!1;continue}if('"'===f||"'"===f)for(var d=1,h=e.charAt(s-d);""===h.trim()||"="===h;){if("="===h){a=f;continue e}h=e.charAt(s-++d)}}else if(f===a){a=!1;continue}}return i<e.length&&(n+=r(e.substr(i))),n},st.parseAttr=function(e,t){var r=0,n=[],i=!1,o=e.length;function a(e,r){if(!((e=(e=lt.trim(e)).replace(ft,"").toLowerCase()).length<1)){var i=t(e,r||"");i&&n.push(i)}}for(var s=0;s<o;s++){var l,c=e.charAt(s);if(!1!==i||"="!==c)if(!1===i||s!==r||'"'!==c&&"'"!==c||"="!==e.charAt(s-1))if(/\s|\n|\t/.test(c)){if(e=e.replace(/\s|\n|\t/g," "),!1===i){if(-1===(l=dt(e,s))){a(lt.trim(e.slice(r,s))),i=!1,r=s+1;continue}s=l-1;continue}if(-1===(l=ht(e,s-1))){a(i,pt(lt.trim(e.slice(r,s)))),i=!1,r=s+1;continue}}else;else{if(-1===(l=e.indexOf(c,s+1)))break;a(i,lt.trim(e.slice(r+1,l))),i=!1,r=(s=l)+1}else i=e.slice(r,s),r=s+1}return r<e.length&&(!1===i?a(e.slice(r)):a(i,pt(lt.trim(e.slice(r))))),lt.trim(n.join(" "))};var mt=Ee.exports.FilterCSS,gt=Se,yt=st,vt=yt.parseTag,bt=yt.parseAttr,wt=Ue;function _t(e){return null==e}function xt(e){(e=function(e){var t={};for(var r in e)t[r]=e[r];return t}(e||{})).stripIgnoreTag&&(e.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),e.onIgnoreTag=gt.onIgnoreTagStripAll),e.whiteList=e.whiteList||gt.whiteList,e.onTag=e.onTag||gt.onTag,e.onTagAttr=e.onTagAttr||gt.onTagAttr,e.onIgnoreTag=e.onIgnoreTag||gt.onIgnoreTag,e.onIgnoreTagAttr=e.onIgnoreTagAttr||gt.onIgnoreTagAttr,e.safeAttrValue=e.safeAttrValue||gt.safeAttrValue,e.escapeHtml=e.escapeHtml||gt.escapeHtml,this.options=e,!1===e.css?this.cssFilter=!1:(e.css=e.css||{},this.cssFilter=new mt(e.css))}xt.prototype.process=function(e){if(!(e=(e=e||"").toString()))return"";var t=this.options,r=t.whiteList,n=t.onTag,i=t.onIgnoreTag,o=t.onTagAttr,a=t.onIgnoreTagAttr,s=t.safeAttrValue,l=t.escapeHtml,c=this.cssFilter;t.stripBlankChar&&(e=gt.stripBlankChar(e)),t.allowCommentTag||(e=gt.stripCommentTag(e));var u=!1;if(t.stripIgnoreTagBody){u=gt.StripTagBody(t.stripIgnoreTagBody,i);i=u.onIgnoreTag}var f=vt(e,(function(e,t,u,f,d){var h,p={sourcePosition:e,position:t,isClosing:d,isWhite:r.hasOwnProperty(u)};if(!_t(h=n(u,f,p)))return h;if(p.isWhite){if(p.isClosing)return"</"+u+">";var m=function(e){var t=wt.spaceIndex(e);if(-1===t)return{html:"",closing:"/"===e[e.length-2]};var r="/"===(e=wt.trim(e.slice(t+1,-1)))[e.length-1];return r&&(e=wt.trim(e.slice(0,-1))),{html:e,closing:r}}(f),g=r[u],y=bt(m.html,(function(e,t){var r,n=-1!==wt.indexOf(g,e);return _t(r=o(u,e,t,n))?n?(t=s(u,e,t,c))?e+'="'+t+'"':e:_t(r=a(u,e,t,n))?void 0:r:r}));f="<"+u;return y&&(f+=" "+y),m.closing&&(f+=" /"),f+=">"}return _t(h=i(u,f,p))?l(f):h}),l);return u&&(f=u.remove(f)),f};var It=xt;!function(e,t){var r=Se,n=st,i=It;function o(e,t){return new i(t).process(e)}for(var a in(t=e.exports=o).filterXSS=o,t.FilterXSS=i,r)t[a]=r[a];for(var a in n)t[a]=n[a];"undefined"!=typeof self&&"undefined"!=typeof DedicatedWorkerGlobalScope&&self instanceof DedicatedWorkerGlobalScope&&(self.filterXSS=e.exports)}(ke,ke.exports);var kt=function(){function e(e,t){var r,n=this;this.arcgisWhiteList={a:["href","target","style"],abbr:["title"],img:["src","width","height","border","alt","style"],video:["autoplay","controls","height","loop","muted","poster","preload","width"],audio:["autoplay","controls","loop","muted","preload"],source:["media","src","type"],span:["style"],table:["width","height","cellpadding","cellspacing","border","style"],div:["style","align"],font:["size","color","style","face"],tr:["height","valign","align","style"],td:["height","width","valign","align","colspan","rowspan","nowrap","style"],th:["height","width","valign","align","colspan","rowspan","nowrap","style"],p:["style"],b:[],strong:[],i:[],em:[],u:[],br:[],li:[],ul:[],ol:[],hr:[],tbody:[]},this.allowedProtocols=["http","https","mailto","iform","tel","flow","lfmobile","arcgis-navigator","arcgis-appstudio-player","arcgis-survey123","arcgis-collector","arcgis-workforce","arcgis-explorer","arcgis-trek2there","arcgis-quickcapture","mspbi","comgooglemaps","pdfefile","pdfehttp","pdfehttps","boxapp","boxemm","awb","awbs","gropen","radarscope"],this.arcgisFilterOptions={allowCommentTag:!0,safeAttrValue:function(e,t,r,i){return"a"===e&&"href"===t||("img"===e||"source"===e)&&"src"===t?n.sanitizeUrl(r):ke.exports.safeAttrValue(e,t,r,i)}},e&&!t?r=e:e&&t?(r=Object.create(this.arcgisFilterOptions),Object.keys(e).forEach((function(t){"whiteList"===t?r.whiteList=n._extendObjectOfArrays([n.arcgisWhiteList,e.whiteList||{}]):r[t]=e[t]}))):(r=Object.create(this.arcgisFilterOptions)).whiteList=this.arcgisWhiteList,this.xssFilterOptions=r,this._xssFilter=new ke.exports.FilterXSS(r)}return e.prototype.sanitize=function(e,t){switch(void 0===t&&(t={}),typeof e){case"number":return isNaN(e)||!isFinite(e)?null:e;case"boolean":return e;case"string":return this._xssFilter.process(e);case"object":return this._iterateOverObject(e,t);default:if(t.allowUndefined&&void 0===e)return;return null}},e.prototype.sanitizeUrl=function(e){var t=this._trim(e.substring(0,e.indexOf(":")));return"/"===e||"#"===e||"#"===e[0]||this.allowedProtocols.indexOf(t.toLowerCase())>-1?ke.exports.escapeAttrValue(e):""},e.prototype.sanitizeHTMLAttribute=function(e,t,r,n){return"function"==typeof this.xssFilterOptions.safeAttrValue?this.xssFilterOptions.safeAttrValue(e,t,r,n):ke.exports.safeAttrValue(e,t,r,n)},e.prototype.validate=function(e,t){void 0===t&&(t={});var r=this.sanitize(e,t);return{isValid:e===r,sanitized:r}},e.prototype._extendObjectOfArrays=function(e){var t={};return e.forEach((function(e){Object.keys(e).forEach((function(r){Array.isArray(e[r])&&Array.isArray(t[r])?t[r]=t[r].concat(e[r]):t[r]=e[r]}))})),t},e.prototype._iterateOverObject=function(e,t){var r=this;void 0===t&&(t={});try{var n=!1,i=void 0;if(Array.isArray(e))i=e.reduce((function(e,i){var o=r.validate(i,t);return o.isValid?e.concat([i]):(n=!0,e.concat([o.sanitized]))}),[]);else{if(!Ie(e)){if(t.allowUndefined&&void 0===e)return;return null}i=Object.keys(e).reduce((function(i,o){var a=e[o],s=r.validate(a,t);return s.isValid?i[o]=a:(n=!0,i[o]=s.sanitized),i}),{})}return n?i:e}catch(e){return null}},e.prototype._trim=function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},e}();function St(e,t,r){return new Promise(((n,i)=>{const o=new he;let a=o;r&&(a=o.folder(r)),t.forEach((e=>a.file(e.name,e,{binary:!0}))),o.generateAsync({type:"blob"}).then((t=>n(Ot(t,e,"application/zip"))),i)}))}function Et(e,t){return t||(t=new kt),t.sanitize(e)}function At(e,t,r){let n;try{n=new File(e,t,r)}catch(i){n=function(){void 0===r&&(r={type:""});const n=new Blob(e,r);return n.lastModified=new Date,n.name=t,n}()}return n}function Tt(e,t){return e+(-1===e.indexOf("?")?"?":"&")+t}function Pt(e){return new Promise((t=>{Ft(e).then((e=>{try{t(JSON.parse(e))}catch(e){t(null)}}),(()=>t(null)))}))}function Ot(e,t,r){return e?At([e],t||"",{type:r||e.type}):null}function Ft(e){return new Promise((t=>{const r=new FileReader;r.onload=function(e){const r=e.target.result;t(r||"")},r.readAsText(e)}))}function Rt(e){return e?e.endsWith("/")?e:e+"/":e}function Ct(){return($t(.2777777777777778,.9999999999996456).toString(36)+"0000000").substr(2,8)}function zt(e){const t=JSON.stringify(e),r=[];for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return new Blob([new Uint8Array(r)],{type:"application/octet-stream"})}function Dt(e){let t={};if(Array.isArray(e))t=e.map(Dt);else if("object"==typeof e)if(e instanceof File){const r=e.type?{type:e.type}:void 0;t=new File([e],e.name,r)}else for(const r in e)null!=e[r]&&"object"==typeof e[r]?t[r]=Dt(e[r]):t[r]=e[r];else t=e;return t}function Lt(e,t){let r=[];const n=Jt(e),i=Jt(t);if(n!==i)("undefined"!==n&&"null"!==n||"null"!==i&&"undefined"!==i)&&r.push("Type difference: "+n+" vs. "+i);else if(e!==t)switch(n){case"boolean":case"number":r.push("Value difference: "+e+" vs. "+t);break;case"string":r.push('String difference: "'+e+'" vs. "'+t+'"');break;case"object":const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length||JSON.stringify(n)!==JSON.stringify(i))Array.isArray(e)&&Array.isArray(t)?r.push("Array length difference: ["+n.length+"] vs. ["+i.length+"]"):r.push("Props difference: "+JSON.stringify(n)+" vs. "+JSON.stringify(i));else for(let o=0;o<n.length;++o){const a=Lt(e[n[o]],t[i[o]]);a.length>0&&(r=r.concat(a))}}return r}function Ut(e,t){const r=t.split(".");if(Array.isArray(e))e.forEach((e=>Ut(e,t)));else{const n=r.slice(1).join(".");void 0!==e[r[0]]&&(1===r.length?delete e[t]:Ut(e[r[0]],n))}}function Bt(e,t){t.forEach((t=>{Ut(e,t)}))}function Nt(e){return e?{success:!1,error:e.response?.error||e.error||e}:{success:!1}}function jt(e){return Yt(e,/({*)(\b[0-9A-F]{32}\b)/gi).reduce((function(e,t){return t.indexOf("{{")<0&&e.push(t.replace("{","")),e}),[])}function Mt(e,t){return t.split(".").reduce((function(e,t){return e?e[t]:void 0}),e)}function Wt(e,t){jt(e).forEach((e=>{-1===t.indexOf(e)&&t.push(e)}))}function Vt(e,t,r){const n=t.split(".");n.reduce(((e,t,i)=>i===n.length-1?(e[t]=r,r):(e[t]||(e[t]={}),e[t])),e)}function Gt(e,t,r){if(Mt(e,t)){const n=t.split(".");n.reduce(((e,t,i)=>i===n.length-1?(e[t]=r,r):e[t]),e)}}function Zt(e,t,r){e=e?e.trim():"_";const n=(Mt(t,r)||[]).map((e=>e.title));let i=e,o=0;for(;n.indexOf(i)>-1;)o++,i=e+" "+o;return i}function qt(e){return e?e.replace("{{","").replace(".itemId}}",""):e}function Yt(e,t){return e&&t.test(e)?e.match(t):[]}function $t(e,t){return Math.random()*(t-e)+e}function Ht(e,t){let r=e.toString();const n=t-r.length;return n>0&&(r="0".repeat(n)+r),r}function Jt(e){return null===e?"null":typeof e}var Kt=function(e,t,r){return void 0===r&&(r=void 0),t.split(".").reduce((function(e,t){return e?e[t]:r}),e)};function Xt(e,t){return Object.keys(e).reduce((function(r,n){return r[n]=t(e[n],n,e),r}),{})}function Qt(e,t,r){return r=r||"",Array.isArray(e)?e.map(n):!e||"object"!=typeof e||function(e){return e instanceof Date}(e)||function(e){return e instanceof RegExp}(e)||function(e){return"function"==typeof e}(e)?t(e,r):Object.assign({},e,Xt(e,n));function n(e,n){return Qt(e,t,r?r+"."+n:n)}}function er(e,t){return Array.isArray(e)?function(e){var t=e,r=e.reduce((function(e,t){if(nr(t)&&rr(t)){var r=tr(t);r>e&&(e=r)}return e}),-1);r>-1&&(t=0===r?[]:"{{delete:"+(r-1)+"}}");return t}(e.map(r).filter((function(e){return null!=e}))):e&&"object"==typeof e?function(e){var t,r={obj:{},maxLevel:-1},n=Object.keys(e).reduce((function(t,r){var n=e[r];if(nr(n)&&rr(n)){var i=tr(n);i>t.maxLevel&&(t.maxLevel=i)}else t.obj[r]=n;return t}),r);t=n.maxLevel>0?1===n.maxLevel?void 0:"{{delete:"+(n.maxLevel-1)+"}}":n.obj;return t}(Xt(e,r)):function(e){var t=e;"string"==typeof e&&rr(e)&&(t=function(e){var t=e,r=tr(e);t=0===r?void 0:"{{delete:"+r+"}}";return t}(e));return t}(e);function r(e,t){return er(e)}}var tr=function(e){return parseInt(e.replace(/{|}/g,"").split(":")[1])};function rr(e){return!(!e||"string"!=typeof e)&&e.indexOf("{{delete")>-1}var nr=function(e){return"string"==typeof e};function ir(e,t,r,n){void 0===n&&(n=0);var i=t;return t||(i="{{delete:"+n+"}}"),i}var or=function(e){var t={};if(Array.isArray(e))t=e.map(or);else if("object"==typeof e)for(var r in e)null!=e[r]&&"object"==typeof e[r]?t[r]=or(e[r]):t[r]=e[r];else t=e;return t},ar=/{{\s*?[\w].*?}}/g;function sr(e){return e||""===e||0===e}function lr(e,t,r){if(void 0===r&&(r=null),(r=or(r)||{}).optional)throw new Error("Please do not pass in an `optional` transform; adlib provides that internally.");r.optional=ir;var n=Qt(e,(function(e,n){if("string"!=typeof e)return e;var i,o=e.match(ar);if(o&&o.length){var a=o.map((function(e){var n=!1,i=e.replace(/{|}/g,"").trim();if(i.indexOf("||")>-1){var o=i.split("||").map((function(e){return e.trim()})),a=o.length;i=o.find((function(e,r){var i,o;return(i=t,o=e.split(":")[0],null!=Kt(i,o,null))?e:r+1===a&&(n=!0,isNaN(e)||(e=parseInt(e)),e)}))}var s={key:e,value:i};if(!n){var l=function(e,t,r){var n,i=e.split(":");if(i.length>1){var o,a=i[0],s=i[1];if(i[2]&&(o=i[2]),!r||!r[s]||"function"!=typeof r[s])throw new Error("Attempted to apply non-existant transform "+s+" on "+a+" with params "+e);n=Kt(t,a),n=r[s](a,n,t,o)}else n=Kt(t,e);return n}(i,t,r);s.value=sr(l)?l:e}return s}));return a.forEach((function(t){e===t.key?("string"==typeof t.value&&(isNaN(t.value)||""===t.value||(t.value.indexOf(".")>-1?t.value=parseFloat(t.value):t.value=parseInt(t.value))),i=t.value):e=e.replace(t.key,t.value)})),sr(i)?i:e}return e}));return er(n)}const cr="organization.helperServices.geocode:getDefaultLocatorURL",ur={getDefaultLocatorURL:(e,t)=>t?t[0].url:`{{${cr}}}`};function fr(e,t=""){return{itemId:e,type:t,key:Ct(),item:{id:e,type:t},data:{},resources:[],dependencies:[],groups:[],properties:{},estimatedDeploymentCostFactor:2}}function dr(e){let t=Mt(e,"metadata.version");return t?"string"==typeof t?(t=parseInt(e.metadata.version,10),isNaN(t)?0:t):t:0}function hr(e,t){const r=t;return e.findIndex((e=>r===e.itemId))}function pr(e,t){const r=hr(e,t);return r>=0?e[r]:null}function mr(e){return(t=e,t&&JSON.stringify(t).match(/{{.+?}}/gim)||[]).length>0;var t}function gr(e){const t=e.extent;return null===t||Array.isArray(t)&&0===t.length?t:"{{solutionItemExtent}}"}function yr(e,t){return lr(e,t,ur)}function vr(e,t,r=""){if(!e)return e;const n=new RegExp(t,"g");return e.replace(n,"{{"+t+r+"}}")}function br(e,t){return t.startsWith("{{")?t:String(vr(e,e,"."+String(t).toLowerCase()))}function wr(e){let t=JSON.stringify(e);const n=/[0-9A-F]{32}/gim;if(e&&n.test(t)){t.match(n).filter(r.unique).forEach((e=>{const r=new RegExp(e,"gm");t=t.replace(r,"{{"+e+".itemId}}")})),e=JSON.parse(t)}return e}function _r(e,t,r={}){if(!e)return Promise.reject("Url must be provided");const n={authentication:t,rawResponse:!0,...r};return i.request(e,n).then((e=>e.blob()))}function xr(e){return e.getUser()}function Ir(e,t,r,n=[],i){return new Promise(((o,a)=>{kr(e,r,n).then((e=>o(e?Ot(e,t,i):null)),a)}))}function kr(e,t,r=[]){return new Promise(((n,i)=>{_r(e,t).then((e=>{Gr(e).then((e=>{"application/json"===e.type?Pt(e).then((t=>{if(t?.error){const e=t.error.code;void 0!==e&&r.indexOf(e)>=0?n(null):i(t)}else n(e)})):n(e)}),i)}),i)}))}function Sr(e,t){const r={authentication:t};return n.getItem(e,r)}function Er(e,t,r){return new Promise((n=>{Tr(e,r).then((e=>n(Ot(e,t))),(()=>n(null)))}))}function Ar(e,t){return new Promise((r=>{Tr(e,t).then((e=>r(Pt(e))),(()=>r(null)))}))}function Tr(e,t){return new Promise((r=>{kr(Pr(e,t),t,[400,500]).then((e=>r(Gr(e))),(()=>r(null)))}))}function Pr(e,t){return`${Mr(t)}/content/items/${e}/data`}function Or(e,t){return`${Mr(t)}/content/items/${e}/info/`}function Fr(e,t){return new Promise((r=>{Rr(e,t).then((e=>{!e||e&&e.type.startsWith("application/json")?r(null):r(Ot(e,"metadata.xml"))}),(()=>r(null)))}))}function Rr(e,t){return new Promise(((r,n)=>{kr(Cr(e,t),t,[400]).then(r,n)}))}function Cr(e,t){return Or(e,t)+"metadata/metadata.xml"}function zr(e,t,r,i){return new Promise((o=>{const a={id:e,relationshipType:t,direction:r,authentication:i};n.getRelatedItems(a).then((e=>{o(e)}),(()=>{o({total:0,start:1,num:0,nextStart:-1,relatedItems:[]})}))}))}function Dr(e,t,r){return new Promise((n=>{const i=["APIKey2Item","Area2CustomPackage","Area2Package","Item2Attachment","Item2Report","Listed2Provisioned","Map2AppConfig","Map2Area","Map2FeatureCollection","Map2Service","MobileApp2Code","Service2Data","Service2Layer","Service2Route","Service2Service","Service2Style","Solution2Item","Style2Style","Survey2Data","Survey2Service","SurveyAddIn2Data","Theme2Story","TrackView2Map","WebStyle2DesktopStyle","WMA2Code","WorkforceMap2FeatureService"],o=i.map((n=>zr(e,n,t,r)));Promise.all(o).then((e=>{const t=[];for(let r=0;r<i.length;++r)e[r].total>0&&t.push({relationshipType:i[r],relatedItemIds:e[r].relatedItems.map((e=>e.id))});n(t)}))}))}function Lr(e,t){return new Promise((r=>{const i={authentication:t};n.getItemResources(e,i).then(r,(()=>{r({total:0,start:1,num:0,nextStart:-1,resources:[]})}))}))}function Ur(e,t){return new Promise(((r,n)=>{qr(e,{start:1,num:100},t).then((e=>{Promise.all(e).then(r,n)}),n)}))}function Br(e,t){return zr(e,"Solution2Item","forward",t).then((e=>e.relatedItems))}function Nr(e,t,r,n){return new Promise(((i,o)=>{if(!t)return void i(null);const a=jr(e,t,r,n),s=t.lastIndexOf("/")+1;Ir(a,t.substring(s),n,[400,500]).then(i,o)}))}function jr(e,t,r,n){return Rt(Mr(n))+(r?"community/groups/":"content/items/")+e+"/info/"+t}function Mr(e){return Mt(e,"portal")||"https://www.arcgis.com/sharing/rest"}function Wr(e,t){return zr(e,"Solution2Item","reverse",t).then((e=>e.relatedItems.map((e=>e.id))))}function Vr(e,t,r){return new Promise((n=>{Ir(e,t,r,[500]).then(n,(()=>n(null)))}))}function Gr(e){return new Promise(((t,r)=>{e&&e.size>0&&(e.type.startsWith("text/plain")||e.type.startsWith("application/json"))?Ft(e).then((r=>{try{JSON.parse(r),t(new Blob([e],{type:"application/json"}))}catch(n){r.length>4&&"PK"===r.substr(0,4)?t(new Blob([e],{type:"application/zip"})):r.startsWith("<")?t(new Blob([e],{type:"text/xml"})):t(e)}}),r):e?t(e):r()}))}function Zr(e,t,r){return new Promise(((i,o)=>{const a={paging:t,authentication:r};n.getGroupContent(e,a).then((n=>{if(n.num>0){const s=n.items.map((e=>e.id));n.nextStart>0?(a.paging.start=n.nextStart,Zr(e,t,r).then((e=>{i(s.concat(e))}),o)):i(s)}else i([])}),o)}))}function qr(e,t,r){return new Promise(((n,o)=>{const a=Mr(r),s=`${a}/content/items/${e}/resources`,l=[],c={params:{...t},authentication:r};i.request(s,c).then((i=>{i.num>0?(i.resources.forEach((t=>{const n=`${a}/content/items/${e}/resources/${t.resource}`;l.push(Ir(n,t.resource,r))})),i.nextStart>0?(t.start=i.nextStart,qr(e,t,r).then((e=>{n(l.concat(e))}),o)):n(l)):n([])}),o)}))}function Yr(e,t){if(!t.locationTrackingEnabled&&e.some((e=>(Mt(e,"item.typeKeywords")||[]).indexOf("Location Tracking View")>-1)))throw console.error("Location tracking not enabled or user is not admin."),new Error("Location tracking not enabled or user is not admin.")}function $r(e,t){const r=Mt(e,"item.typeKeywords")||Mt(t,"typeKeywords"),n=Mt(e,"item.properties.trackViewGroup")||Mt(t,"properties.trackViewGroup");return!!(r&&r.indexOf("Location Tracking View")>-1&&n)}function Hr(e){if($r(e)){const t=Mt(e,"item.properties.trackViewGroup");e.groups.push(t),e.dependencies.push(t);const r=vr(t,t,".itemId");Gt(e,"item.properties.trackViewGroup",r),Jr(e,"item.name",t,r),Jr(e,"properties.service.adminServiceInfo.name",t,r);(e.properties.layers||[]).concat(e.properties.tables||[]).forEach((e=>{Kr(e,"adminLayerInfo.viewLayerDefinition.sourceServiceItemId")}))}}function Jr(e,t,r,n){const i=Mt(e,t);i&&Gt(e,t,i.replace(r,n))}function Kr(e,t){const r=Mt(e,t);r&&Gt(e,t,vr(r,r,".itemId"))}function Xr(e,t,r){return $r(e)&&(Vt(t,"owner",r.locationTracking.owner),Vt(t.item,"name",e.item.name),Vt(t.item,"isView",!0),Vt(t.item,"owner",r.locationTracking.owner),Vt(t.params,"isView",!0),Vt(t.params,"outputType","locationTrackingService"),delete t.folderId),t.item}function Qr(e){["definitionQuery"].forEach((t=>{Ut(e,t)}))}function en(e,t,r){e&&e.fields&&(t[e.id]={sourceFields:JSON.parse(JSON.stringify(e.fields)),type:e.type,id:e.id});const n={editFieldsInfo:r,types:r,templates:r,relationships:!0,drawingInfo:r,timeInfo:r,viewDefinitionQuery:r};return Object.keys(n).forEach((r=>{tn(e,r,t,n[r])})),t}function tn(e,t,r,n){e&&e.hasOwnProperty(t)&&r&&r.hasOwnProperty(e.id)&&(r[e.id][t]=e[t],n&&"editFieldsInfo"!==t&&(e[t]=null))}function rn(e,t,r){r.forEach((r=>{r&&r.hasOwnProperty("popupInfo")&&(e[t][r.id]=r.popupInfo,r.popupInfo={})}))}function nn(e,t){const r=Mt(e,"item.typeKeywords"),n=Mt(t,"typeKeywords");return r&&n&&Gt(e,"item.typeKeywords",r.concat(n.filter((e=>r.indexOf(e)<0)))),e}function on(e,t,r,n){const i={};return Object.keys(e).forEach((o=>{const a=Mt(e[o],"item.id"),s=parseInt(a,10)>-1,l=s&&n?n[a]:s?a:o;i[`layer${s?a:o}`]={fields:gi(e,o),url:Rt(t)+l,layerId:l,itemId:r},Ut(e[o],"newFields"),Ut(e[o],"sourceFields")})),i}function an(e,t){const r=e.dependencies,n=e.itemId,i=Object.keys(t);i.forEach((e=>{n===t[e].itemId&&r.forEach((r=>{i.forEach((n=>{if(r===n){const i={};i[r]=Mt(t[n],"fieldInfos"),t[e].sourceServiceFields=t[e].sourceServiceFields?{...t[e].sourceServiceFields,...i}:i;Object.keys(t[n]).forEach((r=>{r.startsWith("layer")&&(t[e][r]=t[n][r])}))}}))}))}))}function sn(e,t,r,n){return Object.keys(e).forEach((t=>{e[t].hasOwnProperty("templates")&&(e[t].templates=JSON.parse(yr(JSON.stringify(e[t].templates),n))),e[t].hasOwnProperty("adminLayerInfo")&&(r[t].viewLayerDefinition.table.relatedTables=e[t].adminLayerInfo,Ut(e[t],"adminLayerInfo")),e[t].hasOwnProperty("types")&&(e[t].types=JSON.parse(yr(JSON.stringify(e[t].types),n)))})),{popupInfos:yr(t,n),fieldInfos:yr(e,n),adminLayerInfos:yr(r,n)}}function ln(e){const t=e.properties,r=[];return(t.layers||[]).forEach((function(e){r.push({item:e,type:"layer"})})),(t.tables||[]).forEach((function(e){r.push({item:e,type:"table"})})),r}function cn(e,t,r,n,i,o,a,s){return new Promise(((i,l)=>{if($r(s))i(null);else{let c={layers:[],tables:[],authentication:n};Mt(s,"properties.service.hasViews")&&yn(s,r);const u=20,f=[];t.forEach(((e,i)=>{let l=e.item;const u=l.id;a=en(l,a,r.isPortal),l.isView&&Qr(l),s.properties.service.isView&&(gn(l.adminLayerInfo,r),o[u]=l.adminLayerInfo,an(s,r),l.adminLayerInfo=yr(l.adminLayerInfo,r),!r.isPortal&&a&&a.hasOwnProperty(l.id)&&(Object.keys(r).some((e=>r[e].itemId===s.itemId&&(a[l.id].sourceServiceFields=r[e].sourceServiceFields,!0))),En(a[l.id],l))),r.isPortal&&(l=dn(l,s,r)),fn(l),c=un(s,l,c,f,n),"Feature Layer"===l.type?c.layers.push(l):c.tables.push(l),i+1===t.length&&(f.push(Object.assign({},c)),c={layers:[],tables:[],authentication:n})}));const d=t.length>u;f.reduce(((t,r)=>t.then((()=>Yi(e,r,!1,d)))),Promise.resolve(null)).then((()=>i(null)),(e=>l(Nt(e))))}}))}function un(e,t,r,n,i){const o=Mt(e,"properties.service.isMultiServicesView")||!1,a=Mt(e,"item.name");if(o){const e=Mt(t,"adminLayerInfo.viewLayerDefinition.table");if(e){const t=(e.relatedTables||[]).map((e=>e.sourceServiceName));t.push(e.sourceServiceName),t.some((e=>e===a))&&(r.layers.length>0||r.tables.length>0)&&(n.push(Object.assign({},r)),r={layers:[],tables:[],authentication:i})}}return r}function fn(e){e.multiScaleGeometryInfo&&Ut(e,"multiScaleGeometryInfo")}function dn(e,t,r){if(e.uniqueIdField&&e.uniqueIdField.name&&(e.uniqueIdField.name=String(e.uniqueIdField.name).toLocaleLowerCase()),"Table"===e.type&&e.adminLayerInfo&&Ut(e.adminLayerInfo,"geometryField"),e.isView){const n=Mt(e,"adminLayerInfo.viewLayerDefinition.table");let i=[];if(n){const o=hn(n,t,r);i=i.concat(o),Gt(e,"adminLayerInfo.viewLayerDefinition.table",mn(n,o)),Array.isArray(n.relatedTables)&&n.relatedTables.map((e=>{const n=hn(e,t,r);return i=i.concat(n),mn(e,n)}))}else Object.keys(r).some((t=>{if(r[t].itemId===e.serviceItemId){const n=r[t][`layer${e.id}`];return n&&n.fields&&(i=Array.isArray(n.fields)?n.fields.map((e=>e.name)):Object.keys(n.fields)),!0}}));e=pn(e,i)}return Ut(e,"sourceSchemaChangesAllowed"),Ut(e,"isView"),e}function hn(e,t,r){let n=[];const i=e.sourceLayerId;if("number"==typeof i)return t.dependencies.forEach((t=>{const o=r[t][`layer${i}`];o&&o.fields&&r[t].name===e.sourceServiceName&&(n=Array.isArray(o.fields)?n.concat(o.fields.map((e=>e.name))):n.concat(Object.keys(o.fields)))})),n}function pn(e,t){return t.length>0&&(e.fields&&(e.fields=e.fields.filter((e=>t.indexOf(e.name)>-1))),e.indexes&&(e.indexes=e.indexes.filter((e=>t.indexOf(e.fields)>-1)))),e}function mn(e,t){return Array.isArray(e.sourceLayerFields)&&e.sourceLayerFields.length>0&&t.length>0&&Gt(e,"sourceLayerFields",e.sourceLayerFields.filter((e=>t.indexOf(e.source.toLowerCase())>-1))),e}function gn(e,t){const r=Mt(e,"viewLayerDefinition.table.name"),n=Mt(e,"geometryField.name");if(n&&r){Gt(e,"geometryField.name",t.isPortal?`${r}.shape`:`${r}.Shape`)}else!n&&Mt(e,"geometryField")&&Ut(e,"geometryField")}function yn(e,t,r=!0){const n=e.properties.layers,i=e.properties.tables,o=n.concat(i),a={};o.forEach((e=>{a[e.id]=e.fields})),Object.keys(t).some((n=>(r?t[n].itemId===e.itemId:n===e.itemId)&&(t[n].fieldInfos=a,!0)))}function vn(e,t,r){r&&Vt(e,`${t}.defaultSpatialReference`,r)}function bn(e,t,r){if(Mt(e,"service.isView")){let n,i;t.dependencies.some((e=>{const t=r[e],o=Mt(t,"defaultSpatialReference");!n&&o&&(n=o);const a=Mt(t,"defaultExtent");return!i&&a&&(i=a),n&&i}));const o=Mt(n,"wkid"),a=Mt(e,"service.spatialReference.wkid");o&&a&&o!==a&&Vt(e,"service.spatialReference",n);const s=Mt(e,"service.fullExtent");i&&s&&JSON.stringify(i)!==JSON.stringify(s)&&Vt(e,"defaultExtent",i)}}function wn(e,t,r,n,i){return new Promise(((o,a)=>{_n(e,t,r,n,i).then((t=>{Pn(e,t.popupInfos),o({itemTemplate:e,layerInfos:t})}),(e=>a(Nt(e))))}))}function _n(e,t,r,n,i){return new Promise(((o,a)=>{if(e.item.url){const a=e.itemId,s=Object.keys(i);let l;s.some((e=>i[e].itemId===a&&(l=i[e],!0)));const c=e.properties.layers,u=e.properties.tables;c.concat(u).forEach((r=>{const n=r.isView||e.properties.service.isView;if(t&&t.hasOwnProperty(r.id)){const e=t[r.id];if(e.isView=r.isView,e.newFields=r.fields,e.sourceSchemaChangesAllowed=r.sourceSchemaChangesAllowed,r.editFieldsInfo&&(e.newEditFieldsInfo=JSON.parse(JSON.stringify(r.editFieldsInfo))),n&&l&&i.isPortal){e.sourceServiceFields=l.sourceServiceFields;let t=In(e);t=kn(e,t),t.length>0&&(e.fields=t),e.typeIdField=xn(r);const n=e.newFields.map((e=>e.name));Ln(e,n),Un(e,n)}}})),s.forEach((e=>{a===i[e].itemId&&(i[e]=Object.assign(i[e],on(t,i[e].url,a)))})),o(sn(t,r,n,i))}else a(Nt("Feature layer "+e.itemId+" does not have a URL"))}))}function xn(e){const t=e.fields.filter((t=>t.name&&e.typeIdField&&t.name.toLowerCase()===e.typeIdField.toLowerCase()));return Array.isArray(t)&&1===t.length?t[0].name:e.typeIdField}function In(e){const t=[];if(e&&e.sourceFields&&e.newFields){const r=e.sourceFields.reduce(((e,t)=>(e[String(t.name).toLocaleLowerCase()]=t.visible,e)),{});e.newFields.forEach((e=>{const n=String(e.name).toLocaleLowerCase();r.hasOwnProperty(n)&&!r[n]&&t.push({name:e.name,visible:r[n]})}))}return t}function kn(e,t){const r=An(e),n=r.domainFields,i=r.domainNames,o=r.aliasFields,a=r.aliasNames;return e.newFields.forEach((e=>{Sn(e,i,n,"domain",t),Sn(e,a,o,"alias",t)})),t}function Sn(e,t,r,n,i){if(e.hasOwnProperty(n)&&e[n]){const o=t.indexOf(String(e.name).toLocaleLowerCase());if(JSON.stringify(e[n])!==(o>-1?JSON.stringify(r[o]):"")){let t=!1;if(i.some((r=>(r.name===e.name&&(t=!0,r[n]=e[n]),t))),!t){const t={name:e.name};t[n]=e[n],i.push(t)}}}}function En(e,t){const r=An(e),n=r.domainFields,i=r.domainNames,o=r.aliasFields,a=r.aliasNames;t.fields.map((e=>(Tn(e,i,n,"domain"),Tn(e,a,o,"alias"),e)))}function An(e){const t=[],r=[],n=[],i=[];return e.sourceServiceFields&&Object.keys(e.sourceServiceFields).forEach((o=>{e.sourceServiceFields[o]&&Object.keys(e.sourceServiceFields[o]).forEach((a=>{e.sourceServiceFields[o][a].forEach((e=>{e.hasOwnProperty("domain")&&e.domain&&(t.push(e.domain),r.push(String(e.name).toLocaleLowerCase())),e.hasOwnProperty("alias")&&e.alias&&(n.push(e.alias),i.push(String(e.name).toLocaleLowerCase()))}))}))})),{aliasFields:n,aliasNames:i,domainFields:t,domainNames:r}}function Tn(e,t,r,n){if(e.hasOwnProperty(n)&&e[n]){const i=t.indexOf(String(e.name).toLocaleLowerCase());JSON.stringify(e[n])!==(i>-1?JSON.stringify(r[i]):"")&&(e.isViewOverride=!0)}}function Pn(e,t){["layers","tables"].forEach((r=>{const n=Mt(e,"data."+r);n&&Array.isArray(n)&&n.forEach((e=>{e.popupInfo=Mt(t,r+"."+e.id)||{}}))}))}function On(e,t,r){return t.startsWith("{{")?t:String(vr(e,e,"."+String(t).toLowerCase()+(r?"."+r:"")))}function Fn(e,t,r,n){e&&e.hasOwnProperty(t)&&e[t]&&(e[t]=On(r,e[t],n))}function Rn(e,t,r,n,i,o){Cn(t),i&&Nn(e,r.itemId,t,n);const a=[t];e&&a.push(e),a.forEach((e=>{e.hasOwnProperty("name")&&(e.name=vr(e.serviceItemId+".layer"+e.id,e.serviceItemId+".layer"+e.id,".name||"+e.name)),e.hasOwnProperty("extent")&&(e.extent=vr(e.serviceItemId,e.serviceItemId,".solutionExtent")),e.hasOwnProperty("serviceItemId")&&(e.serviceItemId=vr(e.serviceItemId,e.serviceItemId,".itemId")),e.hasOwnProperty("adminLayerInfo")&&(e.adminLayerInfo=jn(e,n,o))}))}function Cn(e){const t=(e.fields||[]).map((e=>e.name));zn(e,t),Dn(e,t),Ln(e,t),Un(e,t),Bn(e,t)}function zn(e,t){const r=e.displayField||"";let n=-1;if(t.some((e=>(n+=1,e===r||e===r.toLowerCase()))))e.displayField=t[n];else{const r=[],n=Mt(e,"uniqueIdField.name");n&&r.push(n);const i=Mt(e,"globalIdField");i&&r.push(i),t.some((t=>-1===r.indexOf(t)&&(e.displayField=t,!0)))}}function Dn(e,t){const r=e.indexes;if(r){const n=[];e.indexes=r.reduce(((e,r)=>{const i=r.fields.split(","),o=[];return i.forEach((e=>{-1===n.indexOf(e)&&(n.push(e),t.indexOf(e)>-1&&o.push(e))})),o.length>0&&(r.fields=o.join(","),e.push(r)),e}),[])}}function Ln(e,t){const r=e.templates;r&&(e.templates=r.map((e=>{const r=Mt(e,"prototype.attributes");return r&&(Object.keys(r).forEach((e=>{-1===t.indexOf(e)&&delete r[e]})),Gt(e,"prototype.attributes",r)),e})))}function Un(e,t){const r=e.types;r&&(e.types=r.map((e=>(Ln(e,t),e))))}function Bn(e,t){const r=e.editFieldsInfo;if(r){Object.keys(r).forEach((e=>{const n=r[e];n&&t.some((t=>t===n||t===n.toLowerCase()&&(r[e]=t,!0)))}))}}function Nn(e,t,r,n){const i=t+".layer"+r.id+".fields",o=r.fields.map((e=>e.name));e&&(Vn(e,n),$n(e,r,i,t,o)),Vn(r,n),Yn(r,t),ti(r,i,o),ri(r,i,o),ii(r,i,o),fi(r,i),di(r,i),pi(r,i),mi(r,i,o)}function jn(e,t,r){const n=Object.assign({},e.adminLayerInfo);if(gn(n,r),Ut(n,"xssTrustedFields"),Ut(n,"tableName"),n.viewLayerDefinition){const e=Object.assign({},n.viewLayerDefinition);Mn(e,t),e.table&&(Mn(e.table,t),e.table.relatedTables&&e.table.relatedTables.forEach((e=>{Mn(e,t)}))),n.viewLayerDefinition=e}return n}function Mn(e,t){Ut(e,"sourceId"),e.hasOwnProperty("sourceServiceName")&&(e.sourceServiceName=Wn(e.sourceServiceName,t))}function Wn(e,t){const r=t.filter((t=>t.name===e));return 1===r.length?On(r[0].id,"name"):void 0}function Vn(e,t){const r=Mt(e,"adminLayerInfo.viewLayerDefinition.table");if(r){let n=Gn(r.sourceServiceName,t);const i=n+".layer"+r.sourceLayerId+".fields";Zn(r.sourceLayerFields||[],i);const o=Mt(e,"adminLayerInfo.viewLayerDefinition.table.relatedTables")||[];o.length>0&&o.forEach((e=>{n=Gn(e.sourceServiceName,t);const r=n+".layer"+e.sourceLayerId+".fields";qn(e.topFilter||{},r),Zn(e.sourceLayerFields||[],r);const o=e.parentKeyFields||[];e.parentKeyFields=o.map((e=>On(i,e,"name")));const a=e.keyFields||[];e.keyFields=a.map((e=>On(r,e,"name")))}))}}function Gn(e,t){const r=t.filter((t=>t.name===e));return 1===r.length?r[0].id:""}function Zn(e,t){e.forEach((e=>Fn(e,"source",t,"name")))}function qn(e,t){if(e){const r=e.orderByFields||"";if(""!==r){const n=r.split(" ")[0];e.orderByFields=e.orderByFields.replace(n,On(t,n,"name"))}const n=e.groupByFields||"";if(""!==n){const r=n.split(",");if(r.length>0){const n=r.map((e=>On(t,e,"name")));e.groupByFields=n.join(",")}}}}function Yn(e,t){if(e&&e.relationships){e.relationships.forEach((r=>{if(r.keyField){Fn(r,"keyField",t+".layer"+e.id+".fields","name")}}))}}function $n(e,t,r,n,i){if(i&&e.popupInfo){const o=e.popupInfo;Hn(o,"title",i,r),Hn(o,"description",i,r);Jn(o.fieldInfos||[],t,n,r);Xn(o.expressionInfos||[],i,r);Qn(o.popupElements||[],r,t,n,i);ei(o.mediaInfos||[],i,r,t,n)}}function Hn(e,t,r,n){e.hasOwnProperty(t)&&r.forEach((r=>{const i=new RegExp("(\\b"+r+"\\b(?![}]{2}))","gm");i.test(e[t])&&(e[t]=e[t].replace(i,On(n,r,"name")))}))}function Jn(e,t,r,n){e.forEach((e=>{e.fieldName=Kn(e.fieldName,t,r,n)}))}function Kn(e,t,r,n){if(e.indexOf("relationships/")>-1){const n=e.split("/"),i=n[1],o=Mt(t,"adminLayerInfo.viewLayerDefinition.table.relatedTables"),a=t.relationships||o;if(a&&a.length>parseInt(i,10)){const t=a[i],o=r+".layer"+t[Mt(t,"relatedTableId")?"relatedTableId":"sourceLayerId"]+".fields";n[2]=On(o,n[2],"name"),e=n.join("/")}}else-1===e.indexOf("expression/")&&(e=On(n,e,"name"));return e}function Xn(e,t,r){return e.map((e=>(t.forEach((t=>{e.expression=ci(e.expression,t,r)})),e)))}function Qn(e,t,r,n,i){e.forEach((e=>{e.hasOwnProperty("fieldInfos")&&Jn(e.fieldInfos,r,n,t),e.hasOwnProperty("mediaInfos")&&ei(e.mediaInfos,i,t,r,n)}))}function ei(e,t,r,n,i){["title","caption"].forEach((n=>Hn(e,n,t,r))),e.forEach((e=>{if(e.hasOwnProperty("value")){const t=e.value,o=t.fields||[];t.fields=o.map((e=>Kn(e,n,i,r))),t.hasOwnProperty("normalizeField")&&Fn(t,"normalizeField",r,"name"),t.hasOwnProperty("tooltipField")&&(t.tooltipField=Kn(t.tooltipField,n,i,r))}}))}function ti(e,t,r){if(e){const n=e.definitionEditor||{};if(n){const e=n.inputs;e&&e.forEach((e=>{e.parameters&&e.parameters.forEach((e=>{Fn(e,"fieldName",t,"name")}))})),n.hasOwnProperty("parameterizedExpression")&&(n.parameterizedExpression=ni(n.parameterizedExpression||"",t,r,"name"))}}}function ri(e,t,r){e&&e.hasOwnProperty("definitionExpression")&&(e.definitionExpression=ni(e.definitionExpression||"",t,r,"name"))}function ni(e,t,r,n){return r.forEach((r=>{const i=new RegExp("\\b"+r+"\\b(?![}]{2})","gm");e&&i.test(e)&&(e=e.replace(i,On(t,r,n)))})),e}function ii(e,t,r){if(e){const n=e.drawingInfo;if(n){oi(n.renderer||{},t,r);ui(n.labelingInfo||[],t,r)}}}function oi(e,t,r){switch(e.type){case"classBreaks":case"uniqueValue":case"predominance":case"simple":case"heatmap":ai(e,t,r);break;case"temporal":si(e,t,r)}}function ai(e,t,r){if(e){const n=e.authoringInfo;n&&li(n,t,r);const i=["field","normalizationField"];i.forEach((r=>Fn(e,r,t,"name")));["field1","field2","field3"].forEach((r=>Fn(e,r,t,"name")));const o=e.rotationExpression;o&&r.forEach((r=>{const n=new RegExp("(\\["+r+"\\])","gm");n.test(o)&&(e.rotationExpression=o.replace(n,"["+On(t,r,"name")+"]"))})),e.valueExpression&&r.forEach((r=>{e.valueExpression=ci(e.valueExpression,r,t)}));const a=e.visualVariables;a&&a.forEach((e=>{i.forEach((r=>Fn(e,r,t,"name"))),e.valueExpression&&r.forEach((r=>{e.valueExpression=ci(e.valueExpression,r,t)}))}))}}function si(e,t,r){[e.latestObservationRenderer,e.observationRenderer,e.trackRenderer].forEach((e=>{oi(e,t,r)}))}function li(e,t,r){if(e){const n=["field","normalizationField"],i=e.field1;n.forEach((e=>Fn(i,e,t,"name")));const o=e.field2;n.forEach((e=>Fn(o,e,t,"name")));const a=e.fields;a&&(e.fields=a.map((e=>On(t,e,"name"))));const s=["endTime","field","startTime"],l=e.visualVariables;l&&s.forEach((e=>{r.indexOf(l[e])>-1&&Fn(l,e,t,"name")}))}}function ci(e,t,r){const n=On(r,t,"name");if(e){let r="(?:\\$feature\\.)("+t+")\\b",i=new RegExp(r,"gm");e=i.test(e)?e.replace(i,"$feature."+n):e,r="(?:[$]feature)(\\[\\\"?\\'?)"+t+"(\\\"?\\'?\\])",i=new RegExp(r,"gm");let o=i.exec(e);o&&(e=e.replace(i,"$feature"+o[1]+n+o[2])),r="(?:[$]feature)(\\[\\\"?\\'?)(\\w+)[.]"+t+"(\\\"?\\'?\\])",i=new RegExp(r,"gm"),o=i.exec(e),o&&o.length>3&&(e=e.replace(i,"$feature"+o[1]+o[2]+"."+n+o[3])),r="(\\\"|\\')+"+t+"(\\\"|\\')+",i=new RegExp(r,"gm"),o=i.exec(e),o&&(e=e.replace(i,o[1]+n+o[2]))}return e}function ui(e,t,r){e.forEach((e=>{if(e.hasOwnProperty("fieldInfos")){(e.fieldInfos||[]).forEach((e=>Fn(e,"fieldName",t,"name")))}const n=e.labelExpression||"",i=e.labelExpressionInfo||{};r.forEach((r=>{const o=On(t,r,"name"),a=new RegExp('(\\[\\"*)+('+r+')(\\"*\\])+',"gm");let s=a.exec(n);if(s&&(e.labelExpression=n.replace(a,s[1]+o+s[3])),i.value){let t=i.value;const n=new RegExp("(\\{"+r+"\\})","gm");t=n.test(t)?t.replace(n,"{"+o+"}"):t,s=a.exec(t),t=s?t.replace(a,s[1]+o+s[3]):t,e.labelExpressionInfo.value=t}i.expression&&(e.labelExpressionInfo.expression=ci(i.expression,r,t))}))}))}function fi(e,t){(e.templates||[]).forEach((e=>{const r=hi(Mt(e,"prototype.attributes"),t,"name");r&&(e.prototype.attributes=r)}))}function di(e,t){const r=e.types;r&&Array.isArray(r)&&r.length>0&&r.forEach((e=>{const r=hi(e.domains,t,"name");r&&(e.domains=r);const n=e.templates;n&&n.length>0&&n.forEach((e=>{const r=hi(Mt(e,"prototype.attributes"),t,"name");r&&(e.prototype.attributes=r)}))}))}function hi(e,t,r){let n;if(e){n={};const i=Object.keys(e);i&&i.length>0&&i.forEach((i=>{n[On(t,i,r)]=e[i]}))}return n}function pi(e,t){if(e.timeInfo){const r=e.timeInfo;["endTimeField","startTimeField","trackIdField"].forEach((e=>{""!==r[e]?Fn(r,e,t,"name"):r[e]=null}))}}function mi(e,t,r){e&&e.hasOwnProperty("viewDefinitionQuery")&&(e.viewDefinitionQuery=ni(e.viewDefinitionQuery||"",t,r,"name")),e&&e.hasOwnProperty("definitionQuery")&&(e.definitionQuery=ni(e.definitionQuery||"",t,r,"name"))}function gi(e,t){const r=e[t],n={},i=r.newFields,o=i?i.map((e=>e.name)):[];if((r.sourceFields||[]).forEach((e=>{const t=String(e.name).toLowerCase();i.forEach((r=>{-1===o.indexOf(e.name)&&-1===o.indexOf(t)&&r.alias&&r.alias===e.alias&&(n[t]={name:r.name,alias:r.alias,type:r.type?r.type:""}),String(r.name).toLowerCase()===t&&(n[t]={name:r.name,alias:r.alias?r.alias:"",type:r.type?r.type:""})}))})),r.editFieldsInfo&&r.newEditFieldsInfo){const e=JSON.parse(JSON.stringify(r.editFieldsInfo)),t=JSON.parse(JSON.stringify(r.newEditFieldsInfo)),i=Object.keys(n);Object.keys(e).forEach((a=>{const s=String(e[a]).toLowerCase();if((-1===i.indexOf(s)||n[s].name!==t[a])&&o.indexOf(s)>-1){let i;r.sourceSchemaChangesAllowed&&!r.isView&&(r.hasOwnProperty("deleteFields")||(r.deleteFields=[]),r.deleteFields.push(s)),r.sourceFields.some((t=>(t.name===e[a]&&(i=t),t.name===e[a]))),n[s]={name:t[a],alias:i&&i.alias?i.alias:"",type:i&&i.type?i.type:""}}})),Ut(r,"sourceSchemaChangesAllowed"),Ut(r,"editFieldsInfo"),Ut(r,"newEditFieldsInfo"),Ut(r,"isView")}return n}function yi(){return 20}var vi,bi,wi;e.EFileType=void 0,(vi=e.EFileType||(e.EFileType={}))[vi.Data=0]="Data",vi[vi.Info=1]="Info",vi[vi.Metadata=2]="Metadata",vi[vi.Resource=3]="Resource",vi[vi.Thumbnail=4]="Thumbnail",e.SFileType=void 0,(bi=e.SFileType||(e.SFileType={}))[bi.Data=0]="Data",bi[bi.Info=1]="Info",bi[bi.Metadata=2]="Metadata",bi[bi.Resource=3]="Resource",bi[bi.Thumbnail=4]="Thumbnail",e.EItemProgressStatus=void 0,(wi=e.EItemProgressStatus||(e.EItemProgressStatus={}))[wi.Started=0]="Started",wi[wi.Created=1]="Created",wi[wi.Cancelled=2]="Cancelled",wi[wi.Finished=3]="Finished",wi[wi.Ignored=4]="Ignored",wi[wi.Failed=5]="Failed",wi[wi.Unknown=6]="Unknown";const _i=["1 Started","2 Created","3 Cancelled","3 Finished","3 Ignored","3 Failed","Unknown"];function xi(e,t,r){return new Promise(((n,i)=>{const o=[];if(t.forEach((t=>{const r=Mt(e,t+".serviceItemId"),n=Mt(e,t);r?-1===o.indexOf(r)&&o.push(r):Wt(n,o)})),Mt(e,"assignmentIntegrations")){let t=[],a=[];e.assignmentIntegrations.forEach((e=>{if(e.assignmentTypes){Object.keys(e.assignmentTypes).forEach((n=>{const i=e.assignmentTypes[n].urlTemplate;Wt(i,o);const s=Ui(i,r);Array.isArray(s.requests)&&s.requests.length>0&&(t=t.concat(s.requests),a=a.concat(s.urls))}))}})),t.length>0?Promise.all(t).then((e=>{const t={};Array.isArray(e)&&e.forEach(((e,r)=>{e.serviceItemId&&(t[a[r]]=e.serviceItemId,-1===o.indexOf(e.serviceItemId)&&o.push(e.serviceItemId))})),n({dependencies:o,urlHash:t})}),(e=>i(Nt(e)))):n({dependencies:o,urlHash:{}})}else n({dependencies:o,urlHash:{}})}))}function Ii(e,t,r){t.forEach((t=>{if(Mt(e,t))if(Mt(e[t],"serviceItemId")){const r=e[t].serviceItemId;let n=".itemId";if(Mt(e[t],"url")){const i=Fi(e[t].url);e[t].url=vr(r,r,Ri(i,".url")),n=Ri(i,n)}e[t].serviceItemId=vr(r,r,n)}else e[t]=vr(e[t],e[t],".itemId")})),e.folderId="{{folderId}}";return(e.assignmentIntegrations||[]).forEach((e=>{if(Oi(e,r),e.assignmentTypes){Object.keys(e.assignmentTypes).forEach((t=>{Oi(e.assignmentTypes[t],r)}))}})),e}function ki(e,t){const r=e.item.properties||{},n=Li(2);t=n.reduce((function(e,n){return r[n]&&t.indexOf(r[n])<0&&e.push(r[n]),e}),t);const i=Mt(e,"properties.workforceInfos.assignmentIntegrationInfos");return i&&i.length>0&&i.forEach((e=>{Object.keys(e).indexOf("dependencies")>-1&&e.dependencies.forEach((e=>{t.indexOf(e)<0&&t.push(e)}))})),t.map((e=>({id:e,name:""})))}function Si(e,r,n){return new Promise(((i,o)=>{r=ji(r=r.replace("/rest/admin/services","/rest/services"));const a=[t.queryFeatures({url:`${r}3`,where:"1=1",authentication:n}),t.queryFeatures({url:`${r}4`,where:"1=1",authentication:n})];Promise.all(a).then((t=>{const[r,a]=t;e.workforceInfos={assignmentTypeInfos:Ai(r)},Ti(a,n).then((t=>{e.workforceInfos.assignmentIntegrationInfos=t,Ei(e.workforceInfos),i(e)}),(e=>o(Nt(e))))}),(e=>o(Nt(e))))}))}function Ei(e){const t=e=>(e.GlobalID&&(e.GlobalID=`{${e.GlobalID}}`),e.assignmenttype&&(e.assignmenttype=`{${e.assignmenttype}}`),e),r=Mt(e,"assignmentIntegrationInfos");r&&Array.isArray(r)&&Gt(e,"assignmentIntegrationInfos",r.map(t));const n=Mt(e,"assignmentTypeInfos");n&&Array.isArray(n)&&Gt(e,"assignmentTypeInfos",n.map(t))}function Ai(e){const t=[],r=["description",e.globalIdFieldName];return e.features.forEach((e=>{const n={};r.forEach((t=>{n[t]=e.attributes[t]})),t.push(n)})),t}function Ti(e,t){return new Promise(((r,n)=>{let i=[],o=[];const a=[],s=["appid",e.globalIdFieldName,"prompt","urltemplate","assignmenttype"];e.features.forEach((e=>{const r={};s.forEach((n=>{if(r[n]=e.attributes[n],"urltemplate"===n){const a=e.attributes[n],s=jt(a);r.dependencies=s;const l=Ui(a,t);Array.isArray(l.requests)&&l.requests.length>0&&(i=i.concat(l.requests),o=o.concat(l.urls))}})),a.push(r)})),Pi(i,o).then((e=>{a.forEach((t=>{Oi(t,e.urlHash)})),r(a)}),(e=>n(Nt(e))))}))}function Pi(e,t){return new Promise(((r,n)=>{const i=[];e.length>0?Promise.all(e).then((e=>{const n={};Array.isArray(e)&&e.forEach(((e,r)=>{e.serviceItemId&&(n[t[r]]=e.serviceItemId,-1===i.indexOf(e.serviceItemId)&&i.push(e.serviceItemId))})),r({dependencies:i,urlHash:n})}),(e=>n(Nt(e)))):r({dependencies:i,urlHash:{}})}))}function Oi(e,t){const r=Mt(e,"urlTemplate")?"urlTemplate":"urltemplate";let n=Mt(e,r);if(n){jt(n).forEach((e=>{n=n.replace(e,vr(e,e,".itemId"))}));Bi(n).forEach((r=>{const i=Ri(Fi(r),".url"),o=t[r];Array.isArray(e.dependencies)&&e.dependencies.indexOf(o)<0&&e.dependencies.push(o),n=n.replace(r,vr(o,o,i))})),Gt(e,r,n)}}function Fi(e){return e.indexOf("FeatureServer/")>-1?e.substr(e.lastIndexOf("/")+1):void 0}function Ri(e,t){return isNaN(Number.parseInt(e,10))?`${t}`:`.layer${e}${t}`}function Ci(e,t){if(Di(e)){const r=e.item.properties||{},n=Li(2),i=r.workforceProjectGroupId,o=[];Object.keys(r).forEach((t=>{if(n.indexOf(t)>-1){const n=r[t];n!==i&&o.push(n),e.item.properties[t]=vr(r[t],r[t],".itemId")}})),e.dependencies=e.dependencies.filter((e=>e!==i&&o.indexOf(e)<0));const a=Mt(e,"properties.workforceInfos");a&&Object.keys(a).forEach((t=>{a[t].forEach((t=>{t.dependencies&&(t.dependencies.forEach((t=>{o.indexOf(t)<0&&o.push(t);const r=e.dependencies.indexOf(t);r>-1&&e.dependencies.splice(r,1)})),delete t.dependencies)}))})),t[i]=o}return e}function zi(e,t){if((e.item.typeKeywords||[]).indexOf(t)>-1){const t=(e.item.properties||{}).workforceFeatureServiceId;t&&(e.item.properties.workforceFeatureServiceId=vr(t,t,".itemId"))}return e}function Di(e){return(e.item.typeKeywords||[]).indexOf("Workforce Project")>-1}function Li(e){return 1===e?["groupId","workerWebMapId","dispatcherWebMapId","dispatchers","assignments","workers","tracks"]:["workforceDispatcherMapId","workforceProjectGroupId","workforceWorkerMapId"]}function Ui(e,t){const r=Bi(e),n=[];return r.forEach((e=>{const r={f:"json",authentication:t};n.push(i.request(e,r))})),{requests:n,urls:r}}function Bi(e){return Yt(e,/=(http.*?FeatureServer.*?(?=&|$))/gi).map((e=>e.replace("=","")))}function Ni(e,t,r){return new Promise(((n,o)=>{const a={f:"json",fields:"*",authentication:r};e=ji(e);const s=[];t.forEach((t=>{s.push(i.request(`${e}${t}`,a))})),Promise.all(s).then((t=>{const r={};t.forEach((t=>{r[`${e}${t.id}`]=t.fields.map((e=>e.name))})),n(r)}),(e=>o(Nt(e))))}))}function ji(e){return e+=e.endsWith("/")?"":"/"}function Mi(e,t){const r=[];return e.forEach((e=>{const n={};Object.keys(e).forEach((r=>{const i=Wi(r,t);n[i]=e[r]})),r.push({attributes:n})})),r}function Wi(e,t){return t.filter((t=>t.toLowerCase()===e.toLowerCase()))[0]}function Vi(e,r,n,i,o){return new Promise(((a,s)=>{if(e){const l=o?"userid":"userId";t.queryFeatures({url:e,where:`${l} = '${r}'`,authentication:i}).then((t=>{if(t&&t.features)if(0===t.features.length){const t=[{attributes:{name:n}}];t[0].attributes[l]=r,Gi(e,t,i).then(a,s)}else a(!0);else a(!1)}),(e=>s(Nt(e))))}else a(!1)}))}function Gi(e,r,n,i=!1){return new Promise(((o,a)=>{r.length>0?t.applyEdits({url:e,adds:r,useGlobalIds:i,authentication:n}).then((e=>{e&&e.addResults?o(!0):a(Nt({success:!1,message:"Failed to add dispatch record."}))}),(e=>a(Nt({success:!1,message:"Failed to add dispatch record.",error:e})))):o(!0)}))}function Zi(e,t,r,i){return new Promise((o=>{const a={originItemId:e,destinationItemId:t,relationshipType:r,authentication:i};n.addItemRelationship(a).then((t=>{o({success:t.success,itemId:e})}),(()=>{o({success:!1,itemId:e})}))}))}function qi(e,t){return new Promise((r=>{e&&t?t.getToken(e).then((t=>{t&&(e=Tt(e,"token="+t)),r(e)}),(()=>r(e))):r(e)}))}function Yi(e,t,r=!1,n=!1){return n&&(t.params={...t.params,async:!0}),new Promise(((n,i)=>{a.addToServiceDefinition(e,t).then((e=>{$i(e,t.authentication).then((()=>n(null)),(e=>i(Nt(e))))}),(o=>{r?i(Nt(o)):Yi(e,t,!0,!0).then((()=>n(null)),(e=>i(e)))}))}))}function $i(e,t){return new Promise(((r,n)=>{if(e.statusURL){const o=setInterval((()=>{i.request(e.statusURL,{authentication:t}).then((e=>{"Completed"===e.status?(clearInterval(o),r()):"Failed"===e.status&&(clearInterval(o),n(e))}),(e=>{clearInterval(o),n(e)}))}),2e3)}else r()}))}function Hi(e){let t={q:"",start:1,num:100};return"string"==typeof e?t.q=e:e instanceof n.SearchQueryBuilder?t.q=e.toParam():t={...t,...e},t}function Ji(e){return("number"!=typeof e.xmin||"number"!=typeof e.xmax||"number"!=typeof e.ymax||"number"!=typeof e.ymin)&&(e.xmin=-179,e.xmax=179,e.ymax=89,e.ymin=-89,e.spatialReference={wkid:4326}),e}function Ki(e,t,r,n,i){return new Promise(((o,a)=>{const s={xmin:-179,xmax:179,ymin:-89,ymax:89,spatialReference:{wkid:4326}};Xi(Ji(e),r,n,i).then((e=>{JSON.stringify(e)===JSON.stringify(Ji(e))?o(e):Xi(t||s,r,n,i).then(o,(e=>a(Nt(e))))}),(()=>{Xi(s,r,n,i).then(o,(e=>a(Nt(e))))}))}))}function Xi(e,t,r,n){const o={authentication:n};return new Promise(((n,a)=>{e.spatialReference.wkid!==t?.wkid&&t?(o.params={f:"json",inSR:e.spatialReference.wkid,outSR:t.wkid,extentOfInterest:JSON.stringify(e)},i.request(Rt(r)+"findTransformations",o).then((s=>{const l=s&&s.transformations?s.transformations:void 0;let c;l&&l.length>0&&(c=l[0].wkid?l[0].wkid:l[0].geoTransforms?l[0]:void 0),o.params={f:"json",outSR:t.wkid,inSR:e.spatialReference.wkid,geometries:{geometryType:"esriGeometryPoint",geometries:[{x:e.xmin,y:e.ymin},{x:e.xmax,y:e.ymax}]},transformation:c},i.request(Rt(r)+"project",o).then((e=>{const r=2===e.geometries.length?e.geometries:void 0;n(r?{xmin:r[0].x,ymin:r[0].y,xmax:r[1].x,ymax:r[1].y,spatialReference:t}:void 0)}),(e=>a(Nt(e))))}),(e=>a(Nt(e))))):n(e)}))}function Qi(e,t){const r=e.itemTemplate.item.url.replace("rest/services","rest/admin/services"),n=[],i=bo(r,null,null,e,"refresh");if(n.push(i),Object.keys(e.objects).forEach((o=>{const a=Object.assign({},e.objects[o]);t&&Bt(a,["type","id","relationships","sourceServiceFields"]),a.hasOwnProperty("deleteFields")&&(n.push(bo(r,o,a,e,"delete")),Ut(a,"deleteFields"),n.push(bo(r,null,null,e,"refresh"))),t&&(n.push(bo(r,o,a,e,"update")),n.push(i))})),!e.itemTemplate.properties.service.isView){const t=vo({message:"updated layer relationships",objects:e.objects,itemTemplate:e.itemTemplate,authentication:e.authentication});t.layers=eo(e.itemTemplate.properties.layers,e.itemTemplate.properties.tables,t),t.layers.length>0&&(n.push(bo(r,null,t,e,"add")),n.push(i))}return n}function eo(e,t,r){const n=[].concat(e.map((e=>e.id)),t.map((e=>e.id))),i=[];return n.forEach((e=>{r.layers.some((t=>e===t.id&&(i.push(t),!0)))})),i}function to(e,t,r){const n=Mt(e,"properties.service.sourceSchemaChangesAllowed"),i=Mt(e,"properties.service.isView");if(n&&i){const i=e.item.url.replace("rest/services","rest/admin/services"),o={authentication:t,message:"final service update"},a={sourceSchemaChangesAllowed:n};r.push(bo(i,null,a,o,"update"))}return r}function ro(e,t=!1,r=!1){return new Promise(((n,o)=>{const a={params:e.params,authentication:e.args.authentication};(r&&e.url.indexOf("addToDefinition")>-1||e.url.indexOf("updateDefinition")>-1||e.url.indexOf("deleteFromDefinition")>-1)&&(a.params={...a.params,async:!0}),i.request(e.url,a).then((e=>{$i(e,a.authentication).then((()=>n(null)),(e=>o(Nt(e))))}),(r=>{t?o(r):ro(e,!0,!0).then((()=>n()),(e=>o(e)))}))}))}function no(e,t,r=!1){return new Promise(((n,o)=>{const a={service:{},layers:[],tables:[]};e=e.replace("/rest/services","/rest/admin/services"),i.request(e+"?f=json",{authentication:t}).then((i=>{a.service=io(i),i.adminServiceInfo?.cacheMaxAge&&(a.service.cacheMaxAge=i.adminServiceInfo.cacheMaxAge),i.layers&&(a.layers=i.layers,a.layers.forEach((e=>{e.serviceItemId=a.service.serviceItemId,e.extent=null,fn(e)}))),delete i.layers,i.tables&&(a.tables=i.tables,a.tables.forEach((e=>{e.serviceItemId=a.service.serviceItemId,e.extent=null}))),delete i.tables,xo(a),r?Si(a,e,t).then(n,o):n(a)}),(e=>o(Nt(e))))}))}function io(e){const t=e.layers||[],r=e.tables||[];return Vt(e,"layers",t.filter((e=>"Feature Layer"===e.type))),Vt(e,"tables",r.concat(t.filter((e=>"Table"===e.type)))),e}function oo(e,t){return new Promise(((r,i)=>{const o={id:e,authentication:t};n.removeGroup(o).then((e=>e.success?r(e):i(e)),i)}))}function ao(e,t){return new Promise(((r,i)=>{const o={id:e,authentication:t};n.removeItem(o).then((e=>e.success?r(e):i(e)),i)}))}function so(e){return n.searchItems(e)}function lo(e,t,r){const i={q:e,params:{...r},authentication:t};return n.searchGroups(i)}function co(e,t,r,n){const i=n||{start:1,num:24},o={sortField:"title",sortOrder:"asc",...i};let a=r||[];return new Promise(((r,n)=>{lo(e,t,o).then((n=>{a=a.concat(n.results),n.nextStart>0?(i.start=n.nextStart,r(co(e,t,a,i))):r(a)}),(e=>n(e)))}))}function uo(e,t,r,i,o){const a={groupId:e,q:t,params:Object.assign({num:100},i),authentication:r,portal:o};return Array.isArray(a.params.categories)&&(a.params.categories=a.params.categories.map((e=>e.split(",")))),n.searchGroupContent(a)}function fo(e,t,r,i){return new Promise(((o,a)=>{const s={item:e,folderId:r,authentication:t,params:{...i??{}}};n.updateItem(s).then((e=>e.success?o(e):a(e)),(e=>a(e)))}))}function ho(e,t,r,i,o,a){return new Promise(((s,l)=>{const c={item:e,params:{text:t||{}},authentication:r};i&&(c.params.thumbnail=i),$r(void 0,e)&&a&&(c.owner=a.locationTracking.owner),n.updateItem(c).then((t=>{if(o&&"private"!==o){const i={id:e.id,access:"public"===o?"public":"org",authentication:r};n.setItemAccess(i).then((()=>s(t)),(e=>l(Nt(e))))}else s(t)}),(e=>l(Nt(e))))}))}function po(e,t,r){return new Promise(((i,o)=>{const a=t=>{const a={id:e,data:t,authentication:r};n.addItemData(a).then(i,o)};t.type.startsWith("text/plain")?Ft(t).then(a,o):"application/json"===t.type?Pt(t).then(a,o):a(t)}))}function mo(e,t,r){return new Promise(((i,o)=>{const a={item:{id:e},params:{metadata:t},authentication:r};n.updateItem(a).then(i,o)}))}function go(e,t,r){return new Promise(((n,i)=>{const o=e.properties,a=r.folderId,s=r.isPortal,l=e.itemId;bn(o,e,r);const c=yo(o,r),u={},f={item:{...{title:e.item.title,name:e.item.name},preserveLayerIds:!0},folderId:a,params:u,authentication:t};f.item=$r(e)?Xr(e,f,r):_o(f.item,e,o,u,s),Ki(r.organization.defaultExtent,c,o.service.spatialReference,r.organization.helperServices.geometry.url,t).then((t=>{r[l].solutionExtent=t,vn(r,l,t.spatialReference),f.item=yr(f.item,r),f.params=yr(f.params,r),e.item.thumbnail&&(f.params.thumbnail=e.item.thumbnail),n(f)}),(e=>i(Nt(e))))}))}function yo(e,t){const r=e.service.spatialReference,n=Mt(e,"defaultExtent.spatialReference.wkid"),i=Mt(t,"params.defaultExtent");return n&&n===r.wkid?e.defaultExtent:i||e.defaultExtent}function vo(e){const t={layers:[]};return Object.keys(e.objects).forEach((r=>{const n=e.objects[r];n.relationships&&n.relationships.length>0&&t.layers.push({id:n.id,relationships:n.relationships}),Ut(n,"relationships")})),t}function bo(e,t,r,n,i){const o={delete:{url:Rt(e)+t+"/deleteFromDefinition",params:{deleteFromDefinition:{fields:r&&r.hasOwnProperty("deleteFields")?r.deleteFields:[]}}},update:{url:Rt(e)+(t?`${t}/updateDefinition`:"updateDefinition"),params:{updateDefinition:r}},add:{url:Rt(e)+"addToDefinition",params:{addToDefinition:r}},refresh:{url:Rt(e)+"refresh",params:{f:"json"}}};return{url:o[i].url,params:o[i].params,args:n}}function wo(e,t,r,n){const i=e=>JSON.stringify(e).match(/{{.+?}}/gim);r&&mr(r)&&console.log(e+" ("+t+") contains variables in base: "+JSON.stringify(i(r))),n&&mr(n)&&console.log(e+" ("+t+") contains variables in data: "+JSON.stringify(i(n)))}function _o(e,t,r,n,i){const o=["Create","Query","Editing","Update","Delete","Uploads","Sync","Extract"],a=Mt(r,"service.capabilities")||(i?"":[]);e.capabilities=i?a.split(",").filter((e=>o.indexOf(e)>-1)).join(","):a,r.service.capabilities&&(r.service.capabilities=e.capabilities),xo(r);const s=["isView","sourceSchemaChangesAllowed","isUpdatableView","capabilities","isMultiServicesView"],l=["layers","tables"];i&&l.push("adminServiceInfo");const c=Object.keys(e);return Object.keys(r.service).forEach((t=>{-1===c.indexOf(t)&&l.indexOf(t)<0&&(e[t]=r.service[t],r.service.isView&&s.indexOf(t)>-1&&(n[t]=r.service[t]))})),e.isMultiServicesView&&Mt(e,"editorTrackingInfo.enableEditorTracking")&&(e.editorTrackingInfo.enableEditorTracking=!1,n.editorTrackingInfo=e.editorTrackingInfo),i&&Object.keys(e).indexOf("initialExtent")>-1&&!e.initialExtent&&Ut(e,"initialExtent"),e}function xo(e){(e.layers||[]).concat(e.tables||[]).forEach((e=>{const t=e.relationships,r=e.indexes;if(t&&t.length>0&&r&&r.length>0){const e=t.reduce(((e,t)=>("esriRelRoleOrigin"===t.role&&t.keyField&&e.indexOf(t.keyField)<0&&e.push(t.keyField),e)),[]);r.map((t=>(e.some((e=>new RegExp(`\\b${e}\\b`).test(t.fields)))&&(t.isUnique=!0),t)))}}))}function Io(e,t,r,i=1){return new Promise(((o,a)=>{const s={item:{id:e,url:t},authentication:r};n.updateItem(s).then((s=>{s.success?setTimeout((()=>{n.getItem(e,{authentication:r}).then((n=>{const s=n.url.indexOf("{");if(s>-1&&console.warn(e+" has template variable: "+n.url.substr(s)),t===n.url)o(e);else{const s="URL not updated for "+n.type+" "+n.id+": "+n.url+" ("+i+")";--i>0?Io(e,t,r,i).then(o,a):(console.error(e+": "+s+"; FAILED"),a(s))}}),(e=>a(Nt(e))))}),1e3):a(Nt(s))}),(e=>a(Nt(e))))}))}function ko(e,t={}){const i=[];return t.organization?i.push(Promise.resolve(t.organization)):i.push(n.getSelf({authentication:e})),i.push(n.getUser({authentication:e})),Promise.all(i).then((([t,n])=>{t.user=n;const i={authentication:e,portalSelf:t,isPortal:t.isPortal};return t.isPortal||(i.hubApiUrl=r.getHubUrlFromPortal(t)),i}))}function So(e,t){let r,n;return t.getUsername().then((n=>(r=n,c.getGroup(e,{authentication:t})))).then((i=>{if(i.owner!==r)return Promise.resolve(null);n=i.protected;const o={paging:{num:1},authentication:t};return c.getGroupContent(e,o)})).then((r=>{if(!r||r.total>0)return Promise.resolve({success:!1});if(n){const r={id:e,authentication:t};return c.unprotectGroup(r)}return Promise.resolve({success:!0})})).then((r=>{if(r.success){const r={id:e,authentication:t};return c.removeGroup(r)}return Promise.resolve({success:!1})})).then((e=>Promise.resolve(e.success))).catch((()=>Promise.resolve(!1)))}function Eo(e,t){return 0===e.length?Promise.resolve([]):Promise.all(e.map((e=>So(e,t)))).then((t=>e.filter(((e,r)=>t[r]))))}function Ao(e,t,r){return r.getUser({authentication:r}).then((e=>{const n=(new c.SearchQueryBuilder).match(r.username).in("owner").and().match(e.orgId).in("orgid").and().match(t).in("ownerfolder");return c.searchItems({q:n,authentication:r})})).then((n=>0===n.results.map((e=>e.id)).filter((t=>!e.includes(t))).length?c.removeFolder({folderId:t,owner:r.username,authentication:r}):Promise.resolve({success:!0}))).then((e=>e.success))}function To(e,t){const r={id:e,authentication:t};return c.unprotectItem(r).then((r=>r.success?ao(e,t):Promise.resolve(r))).then((t=>Promise.resolve({success:t.success,itemId:e})))}function Po(e){let t=[];const r=[],n={},i={},o={};function a(o){i[o]=Oo.InProgress;const s=pr(e,o);(s.dependencies||[]).concat(Mt(s,"properties.syncViews")||[]).forEach((function(e){i[e]===Oo.NotYetVisited?a(e):i[e]===Oo.InProgress?n[o]?n[o].push(e):n[o]=[e]:i[e]!==Oo.Finished&&r.indexOf(e)<0&&r.push(e)})),i[o]=Oo.Finished,t.push(o)}e.forEach((function(e){i[e.itemId]=Oo.NotYetVisited,o[e.itemId]=e.item?.typeKeywords&&e.item.typeKeywords.includes("View Service")?"View Service":e.item?.tags&&e.item.tags.includes("Location Tracking Group")?"Location Tracking Group":e.type})),e.forEach((function(e){i[e.itemId]===Oo.NotYetVisited&&a(e.itemId)}));const s=[],l=[],c=[],u=[];do{const e=t.shift();e&&("Location Tracking Group"===o[e]?s.push(e):"Feature Service"===o[e]?l.push(e):"View Service"===o[e]?c.push(e):u.push(e))}while(t.length>0);t=s.concat(l,c,u);return{buildOrder:t,missingDependencies:r,itemsToBePatched:n}}var Oo;function Fo(e){return Po(e).buildOrder}function Ro(t,r,n="",i=e.EItemProgressStatus.Started){const o=Math.round(t);r.progressCallback&&r.progressCallback(o,r.jobId,{event:"",data:n}),r.consoleProgress&&console.log(Date.now(),n,r.jobId??"",_i[i],o+"%")}function Co(t,r,n,i,o,a={}){let s,l;const f=t.items.shift(),d=i+o*(t.items.length+1);return f?Co(t,r,n,i,o,a).then((e=>([s,l]=e,c.unprotectItem({id:f.id,authentication:n})))).then((async()=>{if(r.includes(f.id)){const e=await ko(n);return u.removeSite(f.id,e)}return ao(f.id,n)})).then((()=>(s.items.push(f),Ro(d,a,f.id,e.EItemProgressStatus.Finished),[s,l]))).catch((t=>{const r=t.error?.message||t.message;return r&&r.includes("Item does not exist or is inaccessible")?Ro(d,a,f.id,e.EItemProgressStatus.Ignored):(l.items.push(f),Ro(d,a,f.id,e.EItemProgressStatus.Failed)),[s,l]})):(s={id:t.id,title:t.title,folder:t.folder,items:[],groups:[]},l={id:t.id,title:t.title,folder:t.folder,items:[],groups:[]},Promise.resolve([s,l]))}function zo(t,r,n,i){const o=i||{};let a,s,l=0,c=0,u=[];return new Promise((i=>{let f=Promise.resolve([{id:r.id,title:r.title,folder:r.folder,items:[],groups:[]},{id:r.id,title:r.title,folder:r.folder,items:[],groups:[]}]);if(r.items.length>0){u=r.items.map((e=>e.id)).concat([t]);const e=r.items.filter((e=>"Hub Site Application"===e.type)).map((e=>e.id));l=100/(r.items.length+2),Ro(c+=l,o),f=Co(r,e,n,c,l,o)}f.then((e=>([a,s]=e,new Promise((t=>{Eo(r.groups,n).then((()=>{t(e)}))}))))).then((()=>0===s.items.length?To(t,n):Promise.resolve({success:!1,itemId:t}))).then((i=>i.success?(Ro(99,o,t,e.EItemProgressStatus.Finished),Ao(u,r.folder,n)):Promise.resolve(!1))).then((()=>{i([a,s])})).catch((()=>{i([a,s])}))}))}function Do(e,t){const r={id:e,title:"",folder:"",items:[],groups:[]};let n,i=[],o=1;return Promise.all([Sr(e,t),Ar(e,t)]).then((a=>{const s=a[0];if(n=a[1],"Solution"!==s.type||!s.typeKeywords.includes("Solution")||!s.typeKeywords.includes("Deployed"))throw new Error("Item "+e+" is not a deployed Solution");return r.title=s.title,r.folder=s.ownerFolder,o=dr(n),i=n.templates,Br(e,t)})).then((e=>{r.items=e.map((e=>({id:e.id,type:e.type,title:e.title,modified:e.modified,owner:e.owner})));let t=[];t=o<1?Fo(i):i.map((e=>e.itemId));let a=new Set;return n.templates.forEach((e=>{e.groups.forEach((e=>{a=a.add(e)}))})),r.groups=[],a.forEach((e=>r.groups.push(e))),r.items.sort(((e,r)=>t.indexOf(e.id)-t.indexOf(r.id))),r}))}function Lo(e,t){let r;return new Promise(((n,i)=>{Do(e,t).then((e=>{r=e;const n=r.items.map((e=>Wr(e.id,t)));return Promise.all(n)})).then((e=>{r.items=r.items.filter(((t,r)=>1===e[r].length)),n(r)})).catch(i)}))}function Uo(e){const t=`${n.getPortalUrl(e)}/portals/self/subscriptioninfo`,r={httpMethod:"GET",...e};return i.request(t,r)}function Bo(e){if(r.getProp(e,"item.properties.schemaVersion")>=1)return e;const t=r.cloneObject(e);t.item.properties||(t.item.properties={});const n=r.getProp(t,"data.templates")||[];return t.data.templates=n.map((e=>({key:e.fieldName||e.key,type:e.type,item:e.item,data:e.data,itemId:e.itemId||e.fieldName||e.key,resources:e.resources||[]}))),t.item.properties.schemaVersion=1,t}function No(e){if(r.getProp(e,"item.properties.schemaVersion")>=2)return e;const t=r.cloneObject(e),n=(r.getProp(t,"data.configurationSettings")||[]).find((e=>"Indicators"===e.category));return t.data.indicators=function(e={}){e.fields&&Array.isArray(e.fields)||(e.fields=[]);return e.fields.map(jo)}(n),delete t.data.configurationSettings,t.item.properties.schemaVersion=2,t}!function(e){e[e.NotYetVisited=0]="NotYetVisited",e[e.InProgress=1]="InProgress",e[e.Finished=2]="Finished"}(Oo||(Oo={}));const jo=function(e){return{id:e.fieldName,type:"Data",name:e.label||e.fieldName,optional:e.optional||!1,definition:{description:e.label||e.fieldName,supportedTypes:[].concat(e.layerOptions.supportedTypes),geometryTypes:[].concat(e.layerOptions.geometryTypes),fields:e.fields.map(Mo)}}},Mo=function(e){return{id:e.fieldName,name:e.label,optional:e.optional||!1,description:e.tooltip,supportedTypes:[].concat(e.supportedTypes)}};function Wo(e){return r.getProp(e,"item.properties.schemaVersion")>=2.1||(e.data.templates=e.data.templates.map((e=>(e.key=e.fieldName||e.key,e.itemId=e.itemId||e.key,e))),e.item.properties.schemaVersion=2.1),e}function Vo(e){if(Mt(e,"item.properties.schemaVersion")>=2.2)return e;const t=r.cloneObject(e);return[{src:"{{solution.name}}",val:"{{solution.title}}"},{src:"{{initiative.name}}",val:"{{solution.title}}"},{src:"{{initiative.title}}",val:"{{solution.title}}"},{src:"{{initiative.extent}}",val:"{{organization.defaultExtentBBox}}"},{src:"{{initiative.collaborationGroupId",val:"{{teams.collaborationGroupId"},{src:"{{initiative.openDataGroupId",val:"{{teams.contentGroupId"},{src:"{{initiative.contentGroupId",val:"{{teams.contentGroupId"},{src:"{{initiative.followersGroupId",val:"{{teams.followersGroupId"},{src:"{{collaborationGroupId",val:"{{teams.collaborationGroupId"},{src:"{{contentGroupId",val:"{{teams.contentGroupId"},{src:"{{followersGroupId",val:"{{teams.followersGroupId"},{src:"{{initiative.id",val:"{{initiative.item.id"},{src:"{{organization.portalBaseUrl",val:"{{portalBaseUrl"}].forEach((e=>{t.data=r.deepStringReplace(t.data,e.src,e.val)})),t.item.properties.schemaVersion=2.2,t}function Go(e){if(Mt(e,"item.properties.schemaVersion")>=2.3)return e;const t=r.cloneObject(e);return t.data.templates=t.data.templates.map((e=>(e.resources?(e.assets=e.resources.map((e=>({name:e,type:"resource"}))),delete e.resources):e.assets=[],e))),t.item.properties.schemaVersion=2.3,t}function Zo(e){if(r.getProp(e,"item.properties.schemaVersion")>=2.4)return e;{const t=r.cloneObject(e);return t.data.templates.map((e=>({src:`{{${e.key}.item.id}}`,val:`{{${e.itemId}.itemId}}`}))).forEach((e=>{t.data=r.deepStringReplace(t.data,e.src,e.val)})),t.data.templates=t.data.templates.map((e=>(e.assets&&(e.resources=e.assets.map((t=>{let r=t.name;return r.indexOf("/")>-1&&(r=r.split("/")[1]),`${e.itemId}-${r}`}))),e.estimatedDeploymentCostFactor||(e.estimatedDeploymentCostFactor=1),e))),t.item.properties.schemaVersion=2.4,t}}function qo(e){if(Mt(e,"item.properties.schemaVersion")>=2.5)return e;{const t=Dt(e);return t.data.templates.forEach((e=>{if("Form"===e.type){Mt(e,"properties.form.portalUrl")&&(e.properties.form.portalUrl="{{portalBaseUrl}}");const t=parseFloat(Mt(e,"properties.form.version")||"2.5");if(!Mt(e,"properties.form")||t>=3.8)return e;e.properties.form.layerName="survey",Mt(e,"properties.form.theme")&&(e.properties.form.themes=[e.properties.form.theme],delete e.properties.form.theme);const r=e=>(e.appearance&&e.appearance.layout&&(e.appearance.layout="vertical"),e);e.properties.form.questions=e.properties.form.questions.map((e=>e.questions?{...e,questions:e.questions.map(r)}:r(e))),e.properties.form.version=3.8}})),t.item.properties.schemaVersion=2.5,t}}function Yo(e){if(Mt(e,"item.properties.schemaVersion")>=2.6)return e;{const t=Dt(e),r=(e,t)=>(Mt(t,"properties.form.questions.length")&&t.properties.form.questions.forEach((r=>{r.maps&&r.maps.forEach((r=>{const n=qt(r.itemId);t.dependencies=t.dependencies.filter((e=>e!==n)),e.push(n)}))})),e),n=t.data.templates.filter((({type:e})=>"Form"===e)).reduce(r,[]);return t.data.templates=t.data.templates.filter((e=>!n.includes(e.itemId))),t.item.properties.schemaVersion=2.6,t}}function $o(e){return r.getProp(e,"item.properties.schemaVersion")>=2.7||(e.data.templates=e.data.templates.map(((e,t,n)=>(e.itemId||(e.itemId=r.createId()),e.dependencies||(e.dependencies=[]),t>0&&0===e.dependencies.length&&(e.dependencies=[n[t-1].itemId]),e))),e.item.properties.schemaVersion=2.7),e}function Ho(e){if(Mt(e,"item.properties.schemaVersion")>=3)return e;{const t=Dt(e);return t.item.properties.schemaVersion=3,t}}function Jo(e,t,r=0){let n=e,i=t;const o=i.lastIndexOf("/");if(o>=0){let e=i.substr(0,o);0===r?(e=e.replace("/","_"),n+="_"+e):n+="/"+e,i=i.substr(o+1)}return{folder:n,filename:i}}function Ko(t,r=0){const n=t.split("/");let i=n.pop(),o="";const a=n.shift();let s=e.EFileType.Resource;if(a)if(a.endsWith("_info_thumbnail"))s=e.EFileType.Thumbnail;else if(a.endsWith("_info_metadata"))s=e.EFileType.Metadata,i="metadata.xml";else if(a.endsWith("_info_data"))s=e.EFileType.Data;else if(a.endsWith("_info_dataz"))i=i.replace(/\.zip$/,""),s=e.EFileType.Data;else if(r<1){const e=a.indexOf("_");e>0&&(o=a.substr(e+1))}else o=n.join("/");return{type:s,folder:o,filename:i}}function Xo(e,t,r){return{...e,fetchedFromSource:t,copiedToDestination:r}}function Qo(e,t,r,n){return new Promise((i=>{_r(e.url,t).then((t=>{fo({id:r,data:ea({blob:t,filename:e.filename,mimeType:e.mimeType||t.type})},n,e.folder).then((()=>i(Xo(e,!0,!0))),(()=>i(Xo(e,!0,!1))))}),(()=>i(Xo(e,!1))))}))}function ea(e){return At([e.blob],e.filename,{type:e.mimeType})}function ta(e,t,r){const i={item:{id:t},params:{metadata:e},authentication:r};return n.updateItem(i)}function ra(e,t,r,n){return new Promise((i=>{_r(e.url,t).then((t=>{"text/xml"===t.type||"application/xml"===t.type?ta(t,r,n).then((()=>i(Xo(e,!0,!0))),(()=>i(Xo(e,!0,!1)))):i(Xo(e,!1))}),(()=>i(Xo(e,!1))))}))}function na(e,t){return e.folder?t.zip.folder(e.folder).file(e.filename,e.file,{binary:!0}):t.zip.file(e.filename,e.file,{binary:!0}),t.filelist.push(e),Xo(e,!0)}function ia(e,t,r){return new Promise((n=>{Ir(e.url,e.filename,t).then((t=>{e.folder?r.zip.folder(e.folder).file(e.filename,t,{binary:!0}):r.zip.file(e.filename,t,{binary:!0}),r.filelist.push(e),n(Xo(e,!0))}),(()=>n(Xo(e,!1))))}))}function oa(e,t,r){return new Promise((i=>{e.zip.generateAsync({type:"blob"}).then((t=>Ot(t,e.filename,"application/zip"))).then((e=>{const i={id:t,resource:e,authentication:r,params:{archive:!0}};return n.addItemResource(i)})).then((()=>i(Xo(e,!0,!0))),(()=>i(Xo(e,!0,!1))))}))}function aa(e,t,n,i=40){return new Promise((o=>{let a=[];const s=[];if(e.length>0){r.chunkArray(e,i).forEach(((e,t)=>{const r={filename:`resources${t}.zip`,zip:new he,filelist:[]};a=a.concat(e.map((e=>na(e,r)))),s.push(r)}))}a.length>0?Promise.all(a).then((e=>{e=e.filter((e=>!(e.fetchedFromSource&&void 0===e.copiedToDestination))),la(s,t,n).then((t=>{o(e.concat(t))}))})):o([])}))}function sa(t,n,i,o){return new Promise((a=>{let s=[],l=t;s=t.filter((t=>t.type===e.EFileType.Data||t.type===e.EFileType.Metadata)).map((t=>{switch(t.type){case e.EFileType.Data:return Qo(t,n,i,o);case e.EFileType.Metadata:return ra(t,n,i,o)}})),l=t.filter((t=>t.type===e.EFileType.Info||t.type===e.EFileType.Resource));const c=[];if(l.length>0){r.chunkArray(l,40).forEach(((e,t)=>{const r={filename:`resources${t}.zip`,zip:new he,filelist:[]};s=s.concat(e.map((e=>ia(e,n,r)))),c.push(r)}))}s.length>0?Promise.all(s).then((e=>{e=e.filter((e=>!(e.fetchedFromSource&&void 0===e.copiedToDestination))),la(c,i,o).then((t=>{a(e.concat(t))}))})):a([])}))}function la(e,t,r){return new Promise((n=>{const i=[],o=e.filter((e=>Object.keys(e.zip.files).length>0));o.length>0?ca(o,t,r).then((e=>{n(e)})):n(i)}))}function ca(e,t,r){return new Promise((n=>{let i=[];const o=e.pop();let a=Promise.resolve([]);e.length>0&&(a=ca(e,t,r)),a.then((e=>(i=e,new Promise((e=>{setTimeout((()=>e()),1e3)}))))).then((()=>oa(o,t,r))).then((e=>{e.filelist.forEach((t=>{i.push(Xo(t,!0,e.copiedToDestination))})),n(i)}))}))}function ua(e){return{folder:e+"_info_metadata",filename:"metadata.xml"}}function fa(e,t,r,n,i=!1,o=0){const a=n.map((r=>({itemId:t,url:ha(e,t,r),...Jo(t,r,o)})));if(a.push({itemId:t,url:da(e,t,i),...ua(t)}),r){const n={itemId:t,url:Tt(pa(e,t,r,i),"w=400"),...ma(t,r)};a.push(n)}return a}function da(e,t,r=!1){return Rt(e)+(r?"community/groups/":"content/items/")+t+"/info/metadata/metadata.xml"}function ha(e,t,r){return Rt(e)+"content/items/"+t+"/resources/"+r}function pa(e,t,r,n=!1){return Rt(e)+(n?"community/groups/":"content/items/")+t+"/info/"+r}function ma(e,t){const r=e+"_info_thumbnail",n=t.split("/");return{folder:r,filename:1===n.length?n[0]:n[1]}}function ga(e){const t=e.match(/\.([a-z]+)$/i);return!!t&&"|.json|.xml|.txt|.png|.pbf|.zip|.jpeg|.jpg|.gif|.bmp|.gz|.svg|.svgz|.geodatabase|".indexOf("|"+t[0]+"|")>=0}var ya;e.SolutionResourceType=void 0,(ya=e.SolutionResourceType||(e.SolutionResourceType={}))[ya.thumbnail=0]="thumbnail",ya[ya.metadata=1]="metadata",ya[ya.resource=2]="resource",ya[ya.data=3]="data",ya[ya.fakezip=4]="fakezip",ya[ya.info=5]="info";function va(e,t){let r=JSON.stringify(e);if(r.indexOf(t)>-1){r=r.replace(new RegExp(`${t}`,"gi"),"{{velocityUrl}}");const e=new RegExp("{{velocityUrl}}.+?(?=/[A-Za-z]+Server)","gi"),n=r.match(e);if(n){n.filter(((e,t,r)=>r.indexOf(e)===t)).forEach((e=>{r=r.replaceAll(e,`${e}_{{solutionItemId}}`)}))}return JSON.parse(r)}return e}Object.defineProperty(e,"rest_addFeatures",{enumerable:!0,get:function(){return t.addFeatures}}),Object.defineProperty(e,"rest_queryFeatures",{enumerable:!0,get:function(){return t.queryFeatures}}),Object.defineProperty(e,"rest_request",{enumerable:!0,get:function(){return i.request}}),Object.defineProperty(e,"UserSession",{enumerable:!0,get:function(){return o.UserSession}}),e.BASE_NAMES=["feat-lyr-new","feat-lyr-existing","stream-lyr-new"],e.CURRENT_SCHEMA_VERSION=3,e.DeployedSolutionFormatVersion=1,e.GEOCODE_SERVER_NAME=cr,e.GEOMETRY_SERVER_NAME="organization.helperServices.geometry.url",e.NA_SERVER_NAME="organization.helperServices.route.url",e.PRINT_SERVER_NAME="organization.helperServices.printTask.url",e.PROP_NAMES=[".portal.mapServicePortalItemID",".portal.featureServicePortalItemID",".portal.streamServicePortalItemID",".portalItemId"],e.SERVER_NAME="portalBaseUrl",e.SItemProgressStatus=_i,e.Sanitizer=kt,e.SolutionTemplateFormatVersion=1,e.TRANSFORMS=ur,e._addItemDataFile=po,e._addItemMetadataFile=mo,e._applyEdits=Gi,e._cacheFieldInfo=tn,e._cachePopupInfo=rn,e._copyAssociatedFileZips=la,e._countRelationships=function(e){return e.reduce(((e,t)=>e+(t.relationships?t.relationships.length:0)),0)},e._fixTextBlobType=Gr,e._getAddFeatures=Mi,e._getAssignmentIntegrationInfos=Ti,e._getAssignmentTypeInfos=Ai,e._getCreateServiceOptions=go,e._getDependantItemId=Gn,e._getDomainAndAliasInfos=An,e._getFallbackExtent=yo,e._getField=Wi,e._getFieldNames=hn,e._getFieldVisibilityUpdates=In,e._getFields=Ni,e._getGroupContentsTranche=Zr,e._getItemResourcesTranche=qr,e._getLayerChunkSize=yi,e._getNameMapping=gi,e._getPortalViewFieldUpdates=Sn,e._getRandomNumberInRange=$t,e._getRelationshipUpdates=vo,e._getTypeIdField=xn,e._getURLs=Bi,e._getUpdate=bo,e._isViewFieldOverride=Tn,e._padPositiveNum=Ht,e._parseAdminServiceData=io,e._processAdminObject=Mn,e._replaceVelocityUrls=va,e._reportVariablesInItem=wo,e._setItemProperties=_o,e._setName=Jr,e._sortRelationships=eo,e._templatize=On,e._templatizeAdminLayerInfo=jn,e._templatizeAdminLayerInfoFields=Vn,e._templatizeAdminSourceLayerFields=Zn,e._templatizeArcadeExpressions=ci,e._templatizeAuthoringInfo=li,e._templatizeDefinitionEditor=ti,e._templatizeDefinitionExpression=ri,e._templatizeDefinitionQuery=mi,e._templatizeDrawingInfo=ii,e._templatizeExpressionInfos=Xn,e._templatizeFieldName=Kn,e._templatizeGenRenderer=ai,e._templatizeKeys=hi,e._templatizeLabelingInfo=ui,e._templatizeLayer=Rn,e._templatizeLayerFieldReferences=Nn,e._templatizeMediaInfos=ei,e._templatizeName=Hn,e._templatizePopupElements=Qn,e._templatizePopupInfo=$n,e._templatizePopupInfoFieldInfos=Jn,e._templatizeProperty=Fn,e._templatizeRelationshipFields=Yn,e._templatizeRenderer=oi,e._templatizeSimpleName=ni,e._templatizeSourceServiceName=Wn,e._templatizeTemplates=fi,e._templatizeTemporalRenderer=si,e._templatizeTimeInfo=pi,e._templatizeTopFilter=qn,e._templatizeTypeTemplates=di,e._templatizeUrlTemplate=Oi,e._templatizeWorkforceDispatcherOrWorker=zi,e._templatizeWorkforceProject=Ci,e._updateAddOptions=un,e._updateDispatchers=Vi,e._updateForPortal=dn,e._updateGeomFieldName=gn,e._updateGlobalIdAndAssignmentType=Ei,e._updateIndexesForRelationshipKeyFields=xo,e._updateItemFields=pn,e._updateItemURL=Io,e._updateSourceLayerFields=mn,e._updateTemplateDictionaryFields=yn,e._updateTypeKeywords=nn,e._updateUrl=ji,e._validateDisplayField=zn,e._validateDomains=kn,e._validateEditFieldsInfo=Bn,e._validateExtent=Ji,e._validateFields=Cn,e._validateIndexes=Dn,e._validateTemplatesFields=Ln,e._validateTrackingTemplates=Yr,e._validateTypesTemplates=Un,e._validateViewDomainsAndAlias=En,e.addFeatureServiceDefinition=cn,e.addFeatureServiceLayersAndTables=function(e,t,r,n){return new Promise(((i,o)=>{if($r(e))i(null);else{const a={},s={},l=ln(e);l.length>0?cn(e.item.url||"",l,t,n,e.key,s,a,e).then((()=>{wn(e,a,r,s,t).then((e=>{let r=Qi({message:"updated layer definition",objects:e.layerInfos.fieldInfos,itemTemplate:e.itemTemplate,authentication:n},t.isPortal);t.isPortal&&(r=to(e.itemTemplate,n,r)),r.reduce(((e,t)=>e.then((()=>ro(t)))),Promise.resolve(null)).then((()=>i(null)),(e=>o(Nt(e))))}))}),(e=>o(Nt(e)))):i(null)}}))},e.addForwardItemRelationship=Zi,e.addForwardItemRelationships=function(e,t,r){return new Promise((n=>{const i=new Array;t.forEach((t=>{t.relatedItemIds.forEach((n=>{i.push(Zi(e,n,t.relationshipType,r))}))})),Promise.all(i).then((e=>n(e)))}))},e.addMetadataFromBlob=ta,e.addResourceFromBlob=function(e,t,r,o,a){if(o&&o.indexOf(".")<0)return new Promise(((e,t)=>{t(new i.ArcGISAuthError("Filename must have an extension indicating its type"))}));const s={id:t,resource:e,name:o,authentication:a,params:{}};return r&&(s.params={resourcesPrefix:r}),n.addItemResource(s)},e.addThumbnailFromBlob=function(e,t,r,i=!1){const o={params:{thumbnail:e},authentication:r};return o[i?"group":"item"]={id:t},i?n.updateGroup(o):n.updateItem(o)},e.addToServiceDefinition=Yi,e.addTokenToUrl=qi,e.appendQueryParam=Tt,e.blobToFile=Ot,e.blobToJson=Pt,e.blobToText=Ft,e.cacheFieldInfos=en,e.cachePopupInfos=function(e){const t={layers:{},tables:{}};return e&&e.layers&&e.layers.length>0&&rn(t,"layers",e.layers),e&&e.tables&&e.tables.length>0&&rn(t,"tables",e.tables),t},e.checkJsonForError=function(e){return void 0!==e?.error},e.checkRequestStatus=$i,e.checkUrlPathTermination=Rt,e.cleanItemId=qt,e.cleanLayerBasedItemId=function(e){return e?e.replace("{{","").replace(/([.]layer([0-9]|[1-9][0-9])[.](item|layer)Id)[}]{2}/,""):e},e.cleanLayerId=function(e){return e?.toString()?parseInt(e.toString().replace(/[{]{2}.{32}[.]layer/,"").replace(/[.]layerId[}]{2}/,""),10):e},e.cloneObject=Dt,e.compareJSON=function(e,t){return JSON.stringify(e)===JSON.stringify(t)},e.compareJSONNoEmptyStrings=function(e,t){return JSON.stringify(e).replace(/":""/g,'":null')===JSON.stringify(t).replace(/":""/g,'":null')},e.compareJSONProperties=Lt,e.convertBlobToSupportableResource=function(e,t=""){const r=e.name||t;let n=r;return n&&!ga(n)&&(n+=".zip"),{blob:At([e],n,{type:e.type}),filename:r,mimeType:e.type}},e.convertExtent=Xi,e.convertExtentWithFallback=Ki,e.convertItemResourceToStorageResource=Jo,e.convertStorageResourceToItemResource=Ko,e.convertToISearchOptions=Hi,e.convertWorkforceItemToTemplate=function(e,t){return new Promise(((r,n)=>{const i=Li(1),o=e.data;o?xi(o,i,t).then((t=>{e.dependencies=t.dependencies,e.data=Ii(o,i,t.urlHash),r(e)}),(e=>n(Nt(e)))):r(e)}))},e.copyAssociatedFilesByType=sa,e.copyDataIntoItem=Qo,e.copyFilesAsResources=aa,e.copyFilesFromStorageItem=function(t,r,n,i,o,a={}){const s=a.properties||null;return a.itemId&&(r=r.map((e=>(0===e.filename.indexOf(a.itemId)&&""===e.folder&&(e.filename=e.filename.replace(`${a.itemId}-`,"")),e)))),new Promise(((a,l)=>{sa(r.map((t=>({folder:t.type===e.EFileType.Data?n:t.folder,filename:t.filename,type:t.type,mimeType:s?s[t.filename]:"",url:t.url}))),t,i,o).then((e=>{e.filter((e=>"metadata.xml"!==e.filename)).map((e=>e.fetchedFromSource&&e.copiedToDestination)).reduce(((e,t)=>e&&t),!0)?a(!0):l()}))}))},e.copyFilesToStorageItem=function(e,t,r){return new Promise((n=>{aa(e,t,r).then((e=>{n(e.filter((e=>e.fetchedFromSource&&e.copiedToDestination)).map((e=>e.folder+"/"+e.filename)))}))}))},e.copyMetadataIntoItem=ra,e.copyResourceIntoZip=na,e.copyResourceIntoZipFromInfo=ia,e.copyZipIntoItem=oa,e.createCopyResults=Xo,e.createFeatureService=function(e,t,r){return new Promise(((n,i)=>{go(e,t,r).then((e=>{a.createFeatureService(e).then((e=>{n(e)}),(e=>i(Nt(e))))}),(e=>i(Nt(e))))}))},e.createFullItem=function(e,t,r,i,o,a,s,l,c="private"){return new Promise(((u,f)=>{const d={item:{...e},folderId:t,authentication:r};qi(i,o).then((e=>{e&&(d.item.thumbnailurl=Tt(e,"w=400")),n.createItemInFolder(d).then((e=>{if(e.success){let t;if("private"!==c){const i={id:e.id,access:"public"===c?"public":"org",authentication:r};t=n.setItemAccess(i)}else t=Promise.resolve({itemId:e.id});t.then((()=>{const t=[];a&&t.push(po(e.id,a,r)),Array.isArray(l)&&l.length>0&&t.push(new Promise(((t,i)=>{St("resources.zip",l).then((o=>{const a={id:e.id,resource:o,authentication:r,params:{archive:!0}};n.addItemResource(a).then(t,i)}),i)}))),s&&t.push(mo(e.id,s,r)),Promise.all(t).then((()=>u(e)),(e=>f(Nt(e))))}),(e=>f(Nt(e))))}else f(Nt())}),(e=>f(Nt(e))))}))}))},e.createHubRequestOptions=ko,e.createInitializedGroupTemplate=function(e){const t=fr(e.id,e.type);return t.item={...t.item,description:e.description,snippet:e.snippet,tags:e.tags,typeKeywords:e.typeKeywords,title:e.title,thumbnail:e.thumbnail},t},e.createInitializedItemTemplate=function(e){const t=fr(e.id,e.type);return t.item={...t.item,accessInformation:e.accessInformation,categories:e.categories,contentStatus:e.contentStatus,created:e.created,culture:e.culture,description:e.description,extent:gr(e),licenseInfo:e.licenseInfo,modified:e.modified,name:e.name,origUrl:e.origUrl,properties:e.properties,snippet:e.snippet,spatialReference:void 0,tags:e.tags,thumbnail:e.thumbnail,title:e.title,typeKeywords:e.typeKeywords,url:e.url},t},e.createItemWithData=function(e,t,r,i,o="private"){return new Promise(((a,s)=>{const l={item:{title:"_",...e,data:t},folderId:i,authentication:r};e.thumbnail&&(l.params={thumbnail:e.thumbnail},delete l.item.thumbnail),n.createItemInFolder(l).then((e=>{if(e.success)if("private"!==o){const t={id:e.id,access:"public"===o?"public":"org",authentication:r};n.setItemAccess(t).then((()=>{a({folder:e.folder,id:e.id,success:!0})}),(e=>s(Nt(e))))}else a({folder:e.folder,id:e.id,success:!0});else s(Nt())}),(e=>s(Nt(e))))}))},e.createLongId=function(){return r.createId("")+r.createId("")+r.createId("")+r.createId("")},e.createMimeTypedFile=ea,e.createPlaceholderTemplate=fr,e.createShortId=Ct,e.createUniqueFolder=function e(t,r,i){return new Promise(((o,a)=>{const s=Zt(t,r,"user.folders"),l={title:s,authentication:i};n.createFolder(l).then((e=>o(e)),(n=>{const l=Mt(n,"response.error.details");if(Array.isArray(l)&&l.length>0){const c="Folder title '"+s+"' not available.";l.indexOf(c)>=0?(Mt(r,"user.folders")||Vt(r,"user.folders",[]),r.user.folders.push({title:s}),e(t,r,i).then(o,a)):a(n)}else a(n)}))}))},e.createUniqueGroup=function e(t,r,i,o,a){return new Promise(((s,l)=>{let c;c=a&&a!==o.username?co(`(owner:${a}) orgid:${i.organization.id}`,o):Promise.resolve([]),c.then((a=>{i.allGroups=a.concat(Mt(i,"user.groups")),r.title=Zt(t,i,"allGroups");const c={group:r,authentication:o};n.createGroup(c).then(s,(n=>{const a=Mt(n,"response.error.details");if(Array.isArray(a)&&a.length>0){const c="You already have a group named '"+r.title+"'. Try a different name.";a.indexOf(c)>=0?(i.user.groups.push({title:r.title}),e(t,r,i,o).then(s,l)):l(n)}else l(n)}))}),(e=>l(e)))}))},e.createZip=St,e.deTemplatizeFieldInfos=sn,e.dedupe=function(e=[]){if(0===e.length)return[];const t=new Set(e),r=[];return t.forEach((e=>r.push(e))),r},e.deleteEmptyGroups=Eo,e.deleteGroupIfEmpty=So,e.deleteItemProps=function(e){const t=["accessInformation","appCategories","banner","categories","culture","description","documentation","extent","groupDesignations","industries","languages","licenseInfo","listed","name","properties","proxyFilter","screenshots","size","snippet","spatialReference","tags","title","type","typeKeywords","url"];return Bt(e,Object.keys(e).filter((e=>t.indexOf(e)<0))),e},e.deleteProp=Ut,e.deleteProps=Bt,e.deleteSolution=function(e,t,r){return Lo(e,t).then((n=>zo(e,n,t,r))).catch((()=>[void 0,void 0]))},e.deleteSolutionByComponents=function(e,t,r,n,i,o){const a={id:e,title:"",folder:n.folderId,items:[],groups:[]};let s=r.map((e=>({id:e.itemId,type:e.type,title:e.item.title,modified:0,owner:""}))).map((e=>(e.id=n[e.id].itemId,e))).filter((e=>!!e.id));return s=s.filter((e=>t.includes(e.id))),s.sort(((e,r)=>t.indexOf(e.id)-t.indexOf(r.id))),s.forEach((e=>{"Group"===e.type?a.groups.push(e.id):a.items.push(e)})),zo(e,a,i,o)},e.deleteSolutionFolder=Ao,e.deleteSolutionItem=To,e.deleteViewProps=Qr,e.extractDependencies=function(e,t){const r=[];return new Promise(((n,o)=>{e.properties.service.isView&&e.item.url&&!$r(e)?i.request(Rt(e.item.url)+"sources?f=json",{authentication:t}).then((e=>{e&&e.services&&e.services.forEach((e=>{r.push({id:e.serviceItemId,name:e.name})})),n(r)}),(e=>o(Nt(e)))):Di(e)?n(ki(e,r)):n(r)}))},e.extractSolutionVersion=dr,e.extractWorkforceDependencies=xi,e.fail=Nt,e.failWithIds=function(e,t){return t?{success:!1,itemIds:e,error:t.error||t}:{success:!1,itemIds:e}},e.findTemplateInList=pr,e.findTemplateIndexInList=hr,e.fineTuneCreatedWorkforceItem=function(e,t,r,n){return new Promise(((i,o)=>{t.getUser().then((a=>{r=ji(r);const s=Mt(e,"data.dispatchers");Vi(s&&s.url?s.url:`${r}2`,a.username||"",a.fullName||"",t,n.isPortal).then((a=>{let s=Mt(e,"properties.workforceInfos");s&&r?(s=yr(s,n),Ni(r,[2,3,4],t).then((e=>{const n=`${r}3`,a=Gi(n,Mi(s.assignmentTypeInfos,e[n]),t,!0),l=`${r}4`,c=Gi(l,Mi(s.assignmentIntegrationInfos,e[l]),t,!0);Promise.all([a,c]).then(i,o)}),(e=>o(Nt(e))))):i({success:a})}),(e=>o(Nt(e))))}),(e=>o(Nt(e))))}))},e.generateEmptyCreationResponse=function(e,t=""){return{item:null,id:t,type:e,postProcess:!1}},e.generateMetadataStorageFilename=ua,e.generateSourceFilePaths=fa,e.generateSourceMetadataUrl=da,e.generateSourceResourceUrl=ha,e.generateSourceThumbnailUrl=pa,e.generateStorageFilePaths=function(e,t,r=[],n=0){return r.map((r=>({url:ha(e,t,r),...Ko(r,n)})))},e.generateThumbnailStorageFilename=ma,e.getBlob=_r,e.getBlobAsFile=Ir,e.getBlobCheckForError=kr,e.getBlobText=function(e){let t;return t=void 0!==e.text?e.text():new Promise(((t,r)=>{const n=new FileReader;n.onload=function(e){e.target&&e.target.result?t(e.target.result):t("")},n.onerror=function(e){r(e)},n.readAsText(e)})),t},e.getCompleteItem=function(e,t){let r,n;return Sr(e,t).then((n=>(r=n,Promise.all([Er(e,r.name,t),Nr(e,r.thumbnail,!1,t),Fr(e,t),Ur(e,t),Dr(e,"forward",t),Dr(e,"reverse",t)])))).then((e=>{const[i,o,a,s,l,c]=e;return n={base:r,data:i,thumbnail:o,metadata:a,resources:s,fwdRelatedItems:l,revRelatedItems:c},"Feature Service"===r.type?no(r.url,t):Promise.resolve(null)})).then((e=>(e&&(n.featureServiceProperties=e),Promise.resolve(n))))},e.getDefaultExtent=gr,e.getDeletableSolutionInfo=Lo,e.getExistingLayersAndTables=function(e,t,r){return new Promise((n=>{const o=t.map((t=>i.request(Rt(e)+t,{authentication:r})));Promise.all(o.map((e=>e.catch((e=>e))))).then(n)}))},e.getFeatureServiceProperties=no,e.getFilenameFromUrl=function(e){if(!e)return"";let t=e.indexOf("?");t<0&&(t=e.length);const r=e.lastIndexOf("/",t)+1;return r<t?e.substring(r,t):""},e.getFinalServiceUpdates=to,e.getFoldersAndGroups=function(e){return new Promise(((t,r)=>{const n={httpMethod:"GET",authentication:e,rawResponse:!1},o=`${e.portal}/content/users/${encodeURIComponent(e.username)}`,a=`${e.portal}/community/users/${encodeURIComponent(e.username)}`;Promise.all([i.request(o,n),i.request(a,n)]).then((e=>{t({folders:e[0].folders||[],groups:e[1].groups||[]})}),(e=>r(e)))}))},e.getGroupBase=function(e,t){const r={authentication:t};return n.getGroup(e,r)},e.getGroupCategorySchema=function(e,t){const r={authentication:t};return n.getGroupCategorySchema(e,r)},e.getGroupContents=function(e,t){return new Promise(((r,n)=>{Zr(e,{start:1,num:100},t).then((e=>{r(e)}),n)}))},e.getIDs=jt,e.getIdsInTemplatesList=function(e){return e.map((e=>e.itemId))},e.getItemBase=Sr,e.getItemDataAsFile=Er,e.getItemDataAsJson=Ar,e.getItemDataBlob=Tr,e.getItemDataBlobUrl=Pr,e.getItemInfoFileUrlPrefix=Or,e.getItemMetadataAsFile=Fr,e.getItemMetadataBlob=Rr,e.getItemMetadataBlobUrl=Cr,e.getItemRelatedItems=zr,e.getItemRelatedItemsInSameDirection=Dr,e.getItemResources=Lr,e.getItemResourcesFiles=Ur,e.getItemResourcesFilesFromPaths=function(e,t){return Promise.all(e.map((e=>new Promise((r=>{Ir(e.url,e.filename,t).then((t=>{r({itemId:e.itemId,file:t,folder:e.folder,filename:e.filename})}),(()=>{r(null)}))}))))).then((e=>e.filter((e=>!!e))))},e.getItemResourcesPaths=function(e,t,r,n=0){return Lr(e.itemId,r).then((t=>{const i=t.resources.map((e=>e.resource)).filter((t=>{let r=!0;return"StoryMap"===e.type&&(-1!==["oembed.json","oembed.xml"].indexOf(t)&&(r=!1),t.match(/^draft_[\s\S]*.json$/)&&(r=!1)),"Web Experience"===e.type&&"config/config.json"===t&&(r=!1),r})),o=fa(r.portal,e.itemId,e.item.thumbnail,i,"Group"===e.type,n);return Promise.resolve(o)}))},e.getItemThumbnail=function(e,t,r,n){return new Promise(((i,o)=>{if(!t)return void i(null);kr(jr(e,t,r,n),n,[500]).then((e=>i(Gr(e))),o)}))},e.getItemThumbnailAsFile=Nr,e.getItemThumbnailUrl=jr,e.getItemTypeAbbrev=function(e){return{Group:"grp","Big Data Analytic":"bda","Feature Collection":"col","Feature Service":"svc",Feed:"fee","Geocoding Service":"xxx","Geodata Service":"xxx","Geometry Service":"xxx","Geoprocessing Service":"xxx","Globe Service":"xxx","Image Service":"xxx",KML:"xxx","Map Service":"xxx","Network Analysis Service":"xxx","Real Time Analytic":"rta","Relational Database Connection":"xxx","Scene Service":"xxx","Stream Service":"xxx",Tool:"xxx","Vector Tile Service":"xxx",WFS:"xxx",WMS:"xxx",WMTS:"xxx","Workflow Manager Service":"xxx","3D Web Scene":"xxx","Web Map":"map","Web Scene":"sc2",Application:"xxx","Data Store":"xxx","Desktop Application":"xxx","Excalibur Imagery Project":"xxx",Form:"frm","Hub Initiative":"hin","Hub Page":"hpg","Hub Site Application":"hsa","Insights Model":"xxx","Insights Page":"xxx","Insights Theme":"xxx","Insights Workbook":"xxx",Mission:"xxx","Mobile Application":"xxx","Native Application":"xxx",Notebook:"nbk","Oriented Imagery Catalog":"oic","Ortho Mapping Project":"xxx","QuickCapture Project":"qck","Site Application":"xxx","Site Initiative":"xxx","Site Page":"xxx",Solution:"sol",StoryMap:"sty","Urban Model":"xxx","Web Experience Template":"wxt","Web Experience":"wex","Web Mapping Application":"wma","Workforce Project":"wrk","360 VR Experience":"xxx","AppBuilder Extension":"xxx","AppBuilder Widget Package":"xxx","Application Configuration":"xxx","ArcGIS Pro Add In":"pro","ArcGIS Pro Configuration":"xxx","ArcPad Package":"xxx","Basemap Package":"xxx","CAD Drawing":"xxx","CityEngine Web Scene":"xxx","Code Attachment":"cod","Code Sample":"sam","Color Set":"xxx","Compact Tile Package":"xxx","CSV Collection":"xxx",CSV:"csv",Dashboard:"dsh","Deep Learning Package":"xxx","Desktop Add In":"dai","Desktop Application Template":"dat","Desktop Style":"xxx","Document Link":"doc","Explorer Add In":"xxx","Explorer Layer":"xxx","Explorer Map":"xxx","Feature Collection Template":"xxx","File Geodatabase":"xxx",GeoJson:"jsn",GeoPackage:"xxx","Geoprocessing Package":"gpk","Geoprocessing Sample":"geo","Globe Document":"xxx","Image Collection":"xxx",Image:"img","iWork Keynote":"xxx","iWork Numbers":"xxx","iWork Pages":"xxx","KML Collection":"xxx","Layer Package":"lyp","Layer Template":"xxx",Layer:"xxx",Layout:"xxx","Locator Package":"xxx","Map Document":"xxx","Map Package":"xxx","Map Template":"mpt","Microsoft Excel":"xls","Microsoft Powerpoint":"ppt","Microsoft Word":"wrd","Mobile Basemap Package":"xxx","Mobile Map Package":"xxx","Mobile Scene Package":"xxx","Native Application Installer":"xxx","Native Application Template":"xxx",netCDF:"xxx","Operation View":"opv","Operations Dashboard Add In":"xxx","Operations Dashboard Extension":"xxx",PDF:"xxx","Pro Layer Package":"xxx","Pro Layer":"xxx","Pro Map Package":"prm","Pro Map":"xxx","Pro Report":"xxx","Project Package":"ppk","Project Template":"prt","Published Map":"xxx","Raster function template":"xxx","Report Template":"xxx","Rule Package":"xxx","Scene Document":"xxx","Scene Package":"xxx","Service Definition":"xxx",Shapefile:"xxx","Statistical Data Collection":"xxx",Style:"xxx","Survey123 Add In":"xxx","Symbol Set":"xxx","Task File":"xxx","Tile Package":"xxx","Toolbox Package":"xxx","Vector Tile Package":"xxx","Viewer Configuration":"xxx","Visio Document":"xxx","Window Mobile Package":"xxx","Windows Mobile Package":"xxx","Windows Viewer Add In":"xxx","Windows Viewer Configuration":"xxx","Workflow Manager Package":"xxx",Undefined:"und",Unsupported:"unk"}[e]||"xxx"},e.getItemsRelatedToASolution=Br,e.getJson=function(e,t){return _r(e,t,{httpMethod:"GET"}).then((e=>Gr(e))).then((e=>"application/json"===e.type?Pt(e):Promise.resolve(null)))},e.getKeyWorkforceProperties=Li,e.getLayerId=Fi,e.getLayerSettings=on,e.getLayerUpdates=Qi,e.getLayers=function(e,t,r){return new Promise(((n,o)=>{0===t.length&&n([]),e=e.replace("/rest/services","/rest/admin/services");const a=[];t.forEach((t=>{const n={authentication:r};a.push(i.request(Rt(e)+t.id+"?f=json",n))})),Promise.all(a).then((e=>n(e)),(e=>o(Nt(e))))}))},e.getLayersAndTables=ln,e.getPortal=function(e,t){const r={authentication:t};return n.getPortal(e,r)},e.getPortalDefaultBasemap=function(e,t,r){return lo(e,r,{num:1}).then((({results:[e]})=>{if(!e)throw new Error("No basemap group found");return uo(e.id,`title:${t}`,r,{num:1})})).then((({results:[e]})=>{if(!e)throw new Error("No basemap found");return e}))},e.getPortalSharingUrlFromAuth=Mr,e.getPortalUrlFromAuth=function(e){return Mr(e).replace("/sharing/rest","")},e.getProp=Mt,e.getPropWithDefault=function(e,t,r){const n=t.split(".").reduce((function(e,t){return e?e[t]:void 0}),e);return void 0===n?r:n},e.getProps=function(e,t){return t.reduce(((t,r)=>{const n=Mt(e,r);return n&&t.push(n),t}),[])},e.getReplaceValue=Ri,e.getRequest=ro,e.getServiceLayersAndTables=function(e,t){return new Promise(((r,n)=>{const i=Di(e);e.item.url?no(e.item.url,t,i).then((t=>{e.properties=t,r(e)}),(e=>n(Nt(e)))):r(e)}))},e.getSolutionSummary=Do,e.getSolutionsRelatedToAnItem=Wr,e.getSubscriptionInfo=Uo,e.getTackingServiceOwner=function(e,t){if(e.locationTrackingEnabled){return Sr(e.locationTracking.id,t).then((r=>(e.locationTracking.owner=r.owner,e[r.id]={itemId:r.id},Promise.resolve(r&&r.owner===t.username))),(()=>Promise.resolve(!1)))}return Promise.resolve(!1)},e.getTemplateById=function(e,t){let r;return(e||[]).some((e=>e.itemId===t&&(r=e,!0))),r},e.getThumbnailFile=Vr,e.getThumbnailFromStorageItem=function(t,r){let n,i;return r.forEach((t=>{t.type===e.EFileType.Thumbnail&&(n=t.url,i=t.filename)})),n?Vr(n,i,t):Promise.resolve(null)},e.getUTCTimestamp=function(){const e=new Date;return Ht(e.getUTCFullYear(),4)+Ht(e.getUTCMonth()+1,2)+Ht(e.getUTCDate(),2)+"_"+Ht(e.getUTCHours(),2)+Ht(e.getUTCMinutes(),2)+"_"+Ht(e.getUTCSeconds(),2)+Ht(e.getUTCMilliseconds(),3)},e.getUniqueTitle=Zt,e.getUrlDependencies=Pi,e.getUser=xr,e.getUserSession=function(e={}){return new o.UserSession(e)},e.getUsername=function(e){return new Promise(((t,r)=>{xr(e).then((e=>t(e.username)),r)}))},e.getVelocityUrlBase=function(e,t){return t.hasOwnProperty("velocityUrl")?Promise.resolve(t.velocityUrl):Uo({authentication:e}).then((e=>{let r="";const n=Mt(e,"orgCapabilities");return Array.isArray(n)&&n.some((e=>("velocity"===e.id&&"active"===e.status&&e.velocityUrl&&(r=e.velocityUrl),r))),t.velocityUrl=r,Promise.resolve(r)}))},e.getWorkforceDependencies=ki,e.getWorkforceServiceInfo=Si,e.globalStringReplace=function e(t,r,n){return t&&Object.keys(t).forEach((i=>{const o=t[i];o&&("object"==typeof o?e(o,r,n):"string"==typeof o&&(t[i]=t[i].replace(r,n)))})),t},e.hasAnyKeyword=function(e,t){const r=Mt(e,"item.typeKeywords")||e.typeKeywords||[];return t.reduce(((e,t)=>(e||(e=r.includes(t)),e)),!1)},e.hasDatasource=function(e,t,r){return e.some((e=>e.itemId===t&&e.layerId===r))},e.hasInvalidGroupDesignations=function(e){return!!e&&["livingatlas"].indexOf(e)>-1},e.hasTypeKeyword=function(e,t){return(Mt(e,"item.typeKeywords")||e.typeKeywords||[]).includes(t)},e.hasUnresolvedVariables=mr,e.idTest=Wt,e.isSupportedFileType=ga,e.isTrackingViewGroup=function(e){const t=Mt(e,"item.tags");return!!(t&&t.indexOf("Location Tracking Group")>-1)},e.isTrackingViewTemplate=$r,e.isWorkforceProject=Di,e.jsonToBlob=zt,e.jsonToFile=function(e,t,r="application/json"){return Ot(zt(e),t,r)},e.migrateSchema=function(e){r.getProp(e,"item.properties")||(e.item.properties={});const t=r.getProp(e,"item.properties.schemaVersion");if(3===t)return Promise.resolve(e);{const r=function(e){let t=!1;const r=Mt(e,"item.typeKeywords")||[];return r.includes("Template")||r.includes("hubSolutionTemplate")&&r.includes("solutionTemplate")&&(t=!0),t}(e),n=[];return t||r?(n.push(Bo,No,Wo,Vo,Go,Zo,qo,Yo,$o),n.push(Ho)):n.push(Ho),n.reduce(((e,t)=>e.then((e=>t(e)))),Promise.resolve(e))}},e.new_File=At,e.placeholder=function(e){return"{{"+e+"}}"},e.postProcessFields=_n,e.postProcessWorkforceTemplates=function(e){const t={};return e.map((e=>(e=zi(e=Ci(e,t),"Workforce Dispatcher"),e=zi(e,"Workforce Worker")))).map((e=>(t[e.itemId]&&(e.dependencies=e.dependencies.concat(t[e.itemId])),e)))},e.reassignGroup=function(e,t,r){const n={authentication:r,params:{targetUsername:t}};return i.request(`${r.portal}/community/groups/${e}/reassign`,n)},e.reconstructBuildOrderIds=Fo,e.regExTest=Yt,e.removeFolder=function(e,t){return new Promise(((r,i)=>{const o={folderId:e,authentication:t};n.removeFolder(o).then((e=>e.success?r(e):i(e)),i)}))},e.removeGroup=oo,e.removeItem=ao,e.removeItemOrGroup=function(e,t){return new Promise(((r,n)=>{ao(e,t).then(r,(i=>{oo(e,t).then(r,(()=>n(i)))}))}))},e.removeItems=Co,e.removeLayerOptimization=fn,e.removeTemplate=function(e,t){const r=hr(e,t);r>=0&&e.splice(r,1)},e.removeUsers=function(e,t,r){return n.removeGroupUsers({id:e,users:t,authentication:r})},e.replaceInTemplate=yr,e.replaceTemplate=function(e,t,r){const n=hr(e,t);return n>=0&&(e[n]=r,!0)},e.reportProgress=Ro,e.sanitizeHTML=function(e,t){return t||(t=new kt),t.sanitize(e)},e.sanitizeJSON=Et,e.sanitizeJSONAndReportChanges=function(e,t){const r=Et(e,t),n=Lt(e,r);return n.length>0&&(console.warn("Changed "+n.length+(1===n.length?" property":" properties")),n.forEach((e=>console.warn(" "+e)))),r},e.sanitizeURLProtocol=function(e,t){return t||(t=new kt),t.sanitizeUrl(e)},e.saveBlobAsFile=function(e,t){return new Promise((r=>{const n=URL.createObjectURL(t),i=document.createElement("a");i.setAttribute("href",n),i.setAttribute("download",e),i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i),setTimeout((()=>{URL.revokeObjectURL(n),r(null)}),500)}))},e.searchAllGroups=co,e.searchAllItems=function e(t,r){const n=Hi(t),i=r||{query:n.q,start:1,num:100,nextStart:-1,total:0,results:[]};return new Promise(((r,o)=>{so(t).then((t=>{i.results=i.results.concat(t.results),i.num=i.total=i.results.length,t.nextStart>0?(n.start=t.nextStart,r(e(n,i))):r(i)}),(e=>o(e)))}))},e.searchGroupAllContents=function e(t,r,n,i,o,a){i=i||{};const s=a||{query:r,start:1,num:100,nextStart:-1,total:0,results:[]};return new Promise(((a,l)=>{uo(t,r,n,i,o).then((l=>{s.results=s.results.concat(l.results),s.num=s.total=s.results.length,l.nextStart>0?(i.start=l.nextStart,a(e(t,r,n,i,o,s))):a(s)}),(e=>l(e)))}))},e.searchGroupContents=uo,e.searchGroups=lo,e.searchItems=so,e.setCreateProp=Vt,e.setDefaultSpatialReference=vn,e.setLocationTrackingEnabled=function(e,t,r,n){const i=Mt(e,"helperServices.locationTracking");i&&(r.locationTracking=i),r.locationTrackingEnabled=!(!r.locationTracking||"org_admin"!==Mt(t,"role")),n&&Yr(n,r)},e.setNamesAndTitles=function(e,t){const r=[];return e.map((e=>{if("Feature Service"===e.item.type&&(e.item.title=e.item.title||e.item.name,!$r(e))){let n=e.item.name||e.item.title;n=n.replace(/_[0-9A-F]{32}/gi,"");const i=n.substring(0,50)+"_"+t;e.item.name=-1===r.indexOf(i)?i:`${i}_${r.filter((e=>e===i)).length}`,r.push(i)}return e}))},e.setProp=Gt,e.setTrackingOptions=Xr,e.shareItem=function(e,t,r,i){return new Promise(((o,a)=>{const s={groupId:e,id:t,authentication:r};i&&(s.owner=i),n.shareItemWithGroup(s).then((()=>o(null)),(e=>a(Nt(e))))}))},e.shareItemToGroups=function(e,t,r,i){return Promise.all(e.map((e=>{const o={id:t,groupId:e,authentication:r};return i&&(o.owner=i),n.shareItemWithGroup(o)})))},e.templatize=function(e,t,r,n){n=n||{};const i=e.item.id,o=e.item.url;e.item={...e.item,id:vr(i,i,".itemId"),url:On(i,"url"),typeKeywords:wr(e.item.typeKeywords)},Hr(e);const a=e.properties.layers||[],s=e.properties.tables||[],l=a.concat(s),c=e.data||{},u=c.layers||[],f=c.tables||[],d=u.concat(f);n[o]=e.item.url,l.concat(d).forEach((e=>{n[o+"/"+e.id]=On(i,"layer"+e.id+".url")})),e.properties.service.serviceItemId=vr(e.properties.service.serviceItemId,e.properties.service.serviceItemId,".itemId");const h=Mt(e,"properties.service.initialExtent");h&&(e.properties.service.initialExtent=vr(i,i,".solutionExtent"));const p=Mt(e,"properties.service.fullExtent");p&&(e.properties.service.fullExtent=vr(i,i,".solutionExtent")),e.properties.defaultExtent=h||p,!Mt(e,"properties.service.spatialReference")&&Mt(e,"properties.defaultExtent.spatialReference")&&Vt(e,"properties.service.spatialReference",e.properties.defaultExtent.spatialReference);let m=!1;return l.forEach((i=>{const o=d.filter((e=>i.id===e.id)),a=1===o.length?o[0]:void 0;Rn(a,i,e,t,r,n),m=!!(i.hasZ||a&&a.hasZ)||m})),m&&(e.properties.service.enableZDefaults=!0,e.properties.service.zDefault=0),e},e.templatizeFieldReferences=function(e,t,r,n=!1){let i=JSON.stringify(e);return t.forEach((e=>{let t="\\b"+e.name+"\\b(?![.])(?![}]{2})";n||(t+='(?!":)'),i=i.replace(new RegExp(t,"g"),br(r,e.name+".name"))})),JSON.parse(i)},e.templatizeIds=wr,e.templatizeServiceItemId=Kr,e.templatizeTerm=vr,e.templatizeToLowerCase=br,e.templatizeTracker=Hr,e.templatizeWorkforce=Ii,e.topologicallySortItems=Po,e.updateGroup=function(e,t,r){return new Promise(((i,o)=>{const a={group:e,authentication:t,params:{...r??{}}};n.updateGroup(a).then((e=>e.success?i(e):o(e)),(e=>o(e)))}))},e.updateItem=fo,e.updateItemExtended=ho,e.updateItemResourceText=function(e,t,r,i){return n.updateItemResource({id:e,name:t,content:r,authentication:i})},e.updateItemTemplateFromDictionary=function(e,t,r){return new Promise(((n,i)=>{Promise.all([Sr(e,r),Ar(e,r)]).then((([n,i])=>{if(mr(n)||mr(i)){const{item:o,data:a}=yr({item:n,data:i},t);return wo(e,n.type,o,a),ho(o,a,r)}return Promise.resolve({success:!0,id:e})})).then((e=>n(e))).catch((e=>i(e)))}))},e.updateItemURL=function(e,t,r){return Io(e,t,r,3)},e.updateLayerFieldReferences=wn,e.updatePopupInfo=Pn,e.updateSettingsFieldInfos=an,e.updateTemplate=function(e,t,r){return nn(e,r),t[e.itemId]=Object.assign(t[e.itemId]||{},{itemId:r.serviceItemId,url:Rt(r.serviceurl),name:r.name}),e.itemId=r.serviceItemId,yr(e,t)},e.updateTemplateForInvalidDesignations=function(e,t){return new Promise(((r,n)=>{if(e.properties.hasInvalidDesignations=!0,e.item.url){const o=e.item.url;i.request(o+"?f=json",{authentication:t}).then((t=>{const n={};(t.layers||[]).concat(t.tables||[]).forEach((e=>{e&&e.hasOwnProperty("id")&&(n[e.id]=e)})),e.data[e.itemId]=Object.assign({itemId:e.itemId},on(n,o,e.itemId)),r(e)}),(e=>n(Nt(e))))}else r(e)}))},e.updateVelocityReferences=function(e,t,r){const n=r.velocityUrl;if(e&&"Web Map"===t&&n){(e.operationalLayers||[]).concat(e.tables||[]).forEach((e=>{e.url&&e.url.indexOf(n)>-1&&e.itemId&&delete e.itemId}))}return n&&e?va(e,n):e},e.urlTest=Ui,e.validateHTML=function(e,t){return t||(t=new kt),t.validate(e)},e.validateSpatialReferenceAndExtent=bn,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
18
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@esri/arcgis-rest-feature-layer"),require("@esri/hub-common"),require("@esri/arcgis-rest-portal"),require("@esri/arcgis-rest-request"),require("@esri/arcgis-rest-auth"),require("@esri/arcgis-rest-service-admin"),require("@esri/hub-sites")):"function"==typeof define&&define.amd?define(["exports","@esri/arcgis-rest-feature-layer","@esri/hub-common","@esri/arcgis-rest-portal","@esri/arcgis-rest-request","@esri/arcgis-rest-auth","@esri/arcgis-rest-service-admin","@esri/hub-sites"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).arcgisSolution=e.arcgisSolution||{},e.arcgisRest,e.arcgisHub,e.arcgisRest,e.arcgisRest,e.arcgisRest,e.arcgisRest,e.arcgisHub)}(this,(function(e,t,r,n,i,o,a,s){"use strict";function l(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var c=l(n),u=l(s),f="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},d=[],h=[],p="undefined"!=typeof Uint8Array?Uint8Array:Array,m=!1;function g(){m=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,r=e.length;t<r;++t)d[t]=e[t],h[e.charCodeAt(t)]=t;h["-".charCodeAt(0)]=62,h["_".charCodeAt(0)]=63}function y(e,t,r){for(var n,i,o=[],a=t;a<r;a+=3)n=(e[a]<<16)+(e[a+1]<<8)+e[a+2],o.push(d[(i=n)>>18&63]+d[i>>12&63]+d[i>>6&63]+d[63&i]);return o.join("")}function v(e){var t;m||g();for(var r=e.length,n=r%3,i="",o=[],a=16383,s=0,l=r-n;s<l;s+=a)o.push(y(e,s,s+a>l?l:s+a));return 1===n?(t=e[r-1],i+=d[t>>2],i+=d[t<<4&63],i+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],i+=d[t>>10],i+=d[t>>4&63],i+=d[t<<2&63],i+="="),o.push(i),o.join("")}function b(e,t,r,n,i){var o,a,s=8*i-n-1,l=(1<<s)-1,c=l>>1,u=-7,f=r?i-1:0,d=r?-1:1,h=e[t+f];for(f+=d,o=h&(1<<-u)-1,h>>=-u,u+=s;u>0;o=256*o+e[t+f],f+=d,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=n;u>0;a=256*a+e[t+f],f+=d,u-=8);if(0===o)o=1-c;else{if(o===l)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),o-=c}return(h?-1:1)*a*Math.pow(2,o-n)}function w(e,t,r,n,i,o){var a,s,l,c=8*o-i-1,u=(1<<c)-1,f=u>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,p=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+f>=1?d/l:d*Math.pow(2,1-f))*l>=2&&(a++,l/=2),a+f>=u?(s=0,a=u):a+f>=1?(s=(t*l-1)*Math.pow(2,i),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;e[r+h]=255&s,h+=p,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;e[r+h]=255&a,h+=p,a/=256,c-=8);e[r+h-p]|=128*m}var _={}.toString,x=Array.isArray||function(e){return"[object Array]"==_.call(e)};function I(){return S.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function k(e,t){if(I()<t)throw new RangeError("Invalid typed array length");return S.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=S.prototype:(null===e&&(e=new S(t)),e.length=t),e}function S(e,t,r){if(!(S.TYPED_ARRAY_SUPPORT||this instanceof S))return new S(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return T(this,e)}return E(this,e,t,r)}function E(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n);S.TYPED_ARRAY_SUPPORT?(e=t).__proto__=S.prototype:e=P(e,t);return e}(e,t,r,n):"string"==typeof t?function(e,t,r){"string"==typeof r&&""!==r||(r="utf8");if(!S.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|R(t,r),i=(e=k(e,n)).write(t,r);i!==n&&(e=e.slice(0,i));return e}(e,t,r):function(e,t){if(F(t)){var r=0|O(t.length);return 0===(e=k(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?k(e,0):P(e,t);if("Buffer"===t.type&&x(t.data))return P(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function A(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function T(e,t){if(A(t),e=k(e,t<0?0:0|O(t)),!S.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function P(e,t){var r=t.length<0?0:0|O(t.length);e=k(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function O(e){if(e>=I())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+I().toString(16)+" bytes");return 0|e}function F(e){return!(null==e||!e._isBuffer)}function R(e,t){if(F(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return oe(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return ae(e).length;default:if(n)return oe(e).length;t=(""+t).toLowerCase(),n=!0}}function C(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return Y(this,t,r);case"utf8":case"utf-8":return G(this,t,r);case"ascii":return q(this,t,r);case"latin1":case"binary":return $(this,t,r);case"base64":return V(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return H(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function z(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function D(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=S.from(t,n)),F(t))return 0===t.length?-1:L(e,t,r,n,i);if("number"==typeof t)return t&=255,S.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):L(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function L(e,t,r,n,i){var o,a=1,s=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,l/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var u=-1;for(o=r;o<s;o++)if(c(e,o)===c(t,-1===u?0:o-u)){if(-1===u&&(u=o),o-u+1===l)return u*a}else-1!==u&&(o-=o-u),u=-1}else for(r+l>s&&(r=s-l),o=r;o>=0;o--){for(var f=!0,d=0;d<l;d++)if(c(e,o+d)!==c(t,d)){f=!1;break}if(f)return o}return-1}function U(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[r+a]=s}return a}function B(e,t,r,n){return se(oe(t,e.length-r),e,r,n)}function N(e,t,r,n){return se(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function j(e,t,r,n){return N(e,t,r,n)}function M(e,t,r,n){return se(ae(t),e,r,n)}function W(e,t,r,n){return se(function(e,t){for(var r,n,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)n=(r=e.charCodeAt(a))>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function V(e,t,r){return 0===t&&r===e.length?v(e):v(e.slice(t,r))}function G(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,a,s,l,c=e[i],u=null,f=c>239?4:c>223?3:c>191?2:1;if(i+f<=r)switch(f){case 1:c<128&&(u=c);break;case 2:128==(192&(o=e[i+1]))&&(l=(31&c)<<6|63&o)>127&&(u=l);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(l=(15&c)<<12|(63&o)<<6|63&a)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(l=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(u=l)}null===u?(u=65533,f=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),i+=f}return function(e){var t=e.length;if(t<=Z)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=Z));return r}(n)}S.TYPED_ARRAY_SUPPORT=void 0===f.TYPED_ARRAY_SUPPORT||f.TYPED_ARRAY_SUPPORT,S.poolSize=8192,S._augment=function(e){return e.__proto__=S.prototype,e},S.from=function(e,t,r){return E(null,e,t,r)},S.TYPED_ARRAY_SUPPORT&&(S.prototype.__proto__=Uint8Array.prototype,S.__proto__=Uint8Array),S.alloc=function(e,t,r){return function(e,t,r,n){return A(t),t<=0?k(e,t):void 0!==r?"string"==typeof n?k(e,t).fill(r,n):k(e,t).fill(r):k(e,t)}(null,e,t,r)},S.allocUnsafe=function(e){return T(null,e)},S.allocUnsafeSlow=function(e){return T(null,e)},S.isBuffer=le,S.compare=function(e,t){if(!F(e)||!F(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},S.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},S.concat=function(e,t){if(!x(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return S.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=S.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var o=e[r];if(!F(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},S.byteLength=R,S.prototype._isBuffer=!0,S.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)z(this,t,t+1);return this},S.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)z(this,t,t+3),z(this,t+1,t+2);return this},S.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)z(this,t,t+7),z(this,t+1,t+6),z(this,t+2,t+5),z(this,t+3,t+4);return this},S.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?G(this,0,e):C.apply(this,arguments)},S.prototype.equals=function(e){if(!F(e))throw new TypeError("Argument must be a Buffer");return this===e||0===S.compare(this,e)},S.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},S.prototype.compare=function(e,t,r,n,i){if(!F(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(n,i),c=e.slice(t,r),u=0;u<s;++u)if(l[u]!==c[u]){o=l[u],a=c[u];break}return o<a?-1:a<o?1:0},S.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},S.prototype.indexOf=function(e,t,r){return D(this,e,t,r,!0)},S.prototype.lastIndexOf=function(e,t,r){return D(this,e,t,r,!1)},S.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return U(this,e,t,r);case"utf8":case"utf-8":return B(this,e,t,r);case"ascii":return N(this,e,t,r);case"latin1":case"binary":return j(this,e,t,r);case"base64":return M(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return W(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},S.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Z=4096;function q(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function $(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function Y(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=ie(e[o]);return i}function H(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function J(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function K(e,t,r,n,i,o){if(!F(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function X(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i<o;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function Q(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i<o;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function ee(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function te(e,t,r,n,i){return i||ee(e,0,r,4),w(e,t,r,n,23,4),r+4}function re(e,t,r,n,i){return i||ee(e,0,r,8),w(e,t,r,n,52,8),r+8}S.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),S.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=S.prototype;else{var i=t-e;r=new S(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+e]}return r},S.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||J(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},S.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||J(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},S.prototype.readUInt8=function(e,t){return t||J(e,1,this.length),this[e]},S.prototype.readUInt16LE=function(e,t){return t||J(e,2,this.length),this[e]|this[e+1]<<8},S.prototype.readUInt16BE=function(e,t){return t||J(e,2,this.length),this[e]<<8|this[e+1]},S.prototype.readUInt32LE=function(e,t){return t||J(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},S.prototype.readUInt32BE=function(e,t){return t||J(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},S.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||J(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},S.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||J(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},S.prototype.readInt8=function(e,t){return t||J(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},S.prototype.readInt16LE=function(e,t){t||J(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},S.prototype.readInt16BE=function(e,t){t||J(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},S.prototype.readInt32LE=function(e,t){return t||J(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},S.prototype.readInt32BE=function(e,t){return t||J(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},S.prototype.readFloatLE=function(e,t){return t||J(e,4,this.length),b(this,e,!0,23,4)},S.prototype.readFloatBE=function(e,t){return t||J(e,4,this.length),b(this,e,!1,23,4)},S.prototype.readDoubleLE=function(e,t){return t||J(e,8,this.length),b(this,e,!0,52,8)},S.prototype.readDoubleBE=function(e,t){return t||J(e,8,this.length),b(this,e,!1,52,8)},S.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||K(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},S.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||K(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},S.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||K(this,e,t,1,255,0),S.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},S.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||K(this,e,t,2,65535,0),S.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):X(this,e,t,!0),t+2},S.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||K(this,e,t,2,65535,0),S.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):X(this,e,t,!1),t+2},S.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||K(this,e,t,4,4294967295,0),S.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):Q(this,e,t,!0),t+4},S.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||K(this,e,t,4,4294967295,0),S.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Q(this,e,t,!1),t+4},S.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);K(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<r&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},S.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);K(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},S.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||K(this,e,t,1,127,-128),S.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},S.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||K(this,e,t,2,32767,-32768),S.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):X(this,e,t,!0),t+2},S.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||K(this,e,t,2,32767,-32768),S.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):X(this,e,t,!1),t+2},S.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||K(this,e,t,4,2147483647,-2147483648),S.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Q(this,e,t,!0),t+4},S.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||K(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),S.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Q(this,e,t,!1),t+4},S.prototype.writeFloatLE=function(e,t,r){return te(this,e,t,!0,r)},S.prototype.writeFloatBE=function(e,t,r){return te(this,e,t,!1,r)},S.prototype.writeDoubleLE=function(e,t,r){return re(this,e,t,!0,r)},S.prototype.writeDoubleBE=function(e,t,r){return re(this,e,t,!1,r)},S.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i,o=n-r;if(this===e&&r<t&&t<n)for(i=o-1;i>=0;--i)e[i+t]=this[i+r];else if(o<1e3||!S.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+o),t);return o},S.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!S.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{var a=F(e)?e:oe(new S(e,n).toString()),s=a.length;for(o=0;o<r-t;++o)this[o+t]=a[o%s]}return this};var ne=/[^+\/0-9A-Za-z-_]/g;function ie(e){return e<16?"0"+e.toString(16):e.toString(16)}function oe(e,t){var r;t=t||1/0;for(var n=e.length,i=null,o=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function ae(e){return function(e){var t,r,n,i,o,a;m||g();var s=e.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o="="===e[s-2]?2:"="===e[s-1]?1:0,a=new p(3*s/4-o),n=o>0?s-4:s;var l=0;for(t=0,r=0;t<n;t+=4,r+=3)i=h[e.charCodeAt(t)]<<18|h[e.charCodeAt(t+1)]<<12|h[e.charCodeAt(t+2)]<<6|h[e.charCodeAt(t+3)],a[l++]=i>>16&255,a[l++]=i>>8&255,a[l++]=255&i;return 2===o?(i=h[e.charCodeAt(t)]<<2|h[e.charCodeAt(t+1)]>>4,a[l++]=255&i):1===o&&(i=h[e.charCodeAt(t)]<<10|h[e.charCodeAt(t+1)]<<4|h[e.charCodeAt(t+2)]>>2,a[l++]=i>>8&255,a[l++]=255&i),a}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(ne,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function se(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function le(e){return null!=e&&(!!e._isBuffer||ce(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&ce(e.slice(0,0))}(e))}function ce(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var ue="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function fe(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var de={exports:{}};!function(e,t){e.exports=function e(t,r,n){function i(a,s){if(!r[a]){if(!t[a]){if(!s&&fe)return fe(a);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[a]={exports:{}};t[a][0].call(c.exports,(function(e){return i(t[a][1][e]||e)}),c,c.exports,e,t,r,n)}return r[a].exports}for(var o=fe,a=0;a<n.length;a++)i(n[a]);return i}({1:[function(e,t,r){var n=e("./utils"),i=e("./support"),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.encode=function(e){for(var t,r,i,a,s,l,c,u=[],f=0,d=e.length,h=d,p="string"!==n.getTypeOf(e);f<e.length;)h=d-f,i=p?(t=e[f++],r=f<d?e[f++]:0,f<d?e[f++]:0):(t=e.charCodeAt(f++),r=f<d?e.charCodeAt(f++):0,f<d?e.charCodeAt(f++):0),a=t>>2,s=(3&t)<<4|r>>4,l=1<h?(15&r)<<2|i>>6:64,c=2<h?63&i:64,u.push(o.charAt(a)+o.charAt(s)+o.charAt(l)+o.charAt(c));return u.join("")},r.decode=function(e){var t,r,n,a,s,l,c=0,u=0,f="data:";if(e.substr(0,f.length)===f)throw new Error("Invalid base64 input, it looks like a data url.");var d,h=3*(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(e.charAt(e.length-1)===o.charAt(64)&&h--,e.charAt(e.length-2)===o.charAt(64)&&h--,h%1!=0)throw new Error("Invalid base64 input, bad content length.");for(d=i.uint8array?new Uint8Array(0|h):new Array(0|h);c<e.length;)t=o.indexOf(e.charAt(c++))<<2|(a=o.indexOf(e.charAt(c++)))>>4,r=(15&a)<<4|(s=o.indexOf(e.charAt(c++)))>>2,n=(3&s)<<6|(l=o.indexOf(e.charAt(c++))),d[u++]=t,64!==s&&(d[u++]=r),64!==l&&(d[u++]=n);return d}},{"./support":30,"./utils":32}],2:[function(e,t,r){var n=e("./external"),i=e("./stream/DataWorker"),o=e("./stream/Crc32Probe"),a=e("./stream/DataLengthProbe");function s(e,t,r,n,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=r,this.compression=n,this.compressedContent=i}s.prototype={getContentWorker:function(){var e=new i(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a("data_length")),t=this;return e.on("end",(function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),e},getCompressedWorker:function(){return new i(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},s.createWorkerFrom=function(e,t,r){return e.pipe(new o).pipe(new a("uncompressedSize")).pipe(t.compressWorker(r)).pipe(new a("compressedSize")).withStreamInfo("compression",t)},t.exports=s},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,r){var n=e("./stream/GenericWorker");r.STORE={magic:"\0\0",compressWorker:function(e){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},r.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,r){var n=e("./utils"),i=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t){return void 0!==e&&e.length?"string"!==n.getTypeOf(e)?function(e,t,r,n){var o=i,a=n+r;e^=-1;for(var s=n;s<a;s++)e=e>>>8^o[255&(e^t[s])];return-1^e}(0|t,e,e.length,0):function(e,t,r,n){var o=i,a=n+r;e^=-1;for(var s=n;s<a;s++)e=e>>>8^o[255&(e^t.charCodeAt(s))];return-1^e}(0|t,e,e.length,0):0}},{"./utils":32}],5:[function(e,t,r){r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(e,t,r){var n=null;n="undefined"!=typeof Promise?Promise:e("lie"),t.exports={Promise:n}},{lie:37}],7:[function(e,t,r){var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,i=e("pako"),o=e("./utils"),a=e("./stream/GenericWorker"),s=n?"uint8array":"array";function l(e,t){a.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}r.magic="\b\0",o.inherits(l,a),l.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(o.transformTo(s,e.data),!1)},l.prototype.flush=function(){a.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},l.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},l.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},r.compressWorker=function(e){return new l("Deflate",e)},r.uncompressWorker=function(){return new l("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,r){function n(e,t){var r,n="";for(r=0;r<t;r++)n+=String.fromCharCode(255&e),e>>>=8;return n}function i(e,t,r,i,a,u){var f,d,h=e.file,p=e.compression,m=u!==s.utf8encode,g=o.transformTo("string",u(h.name)),y=o.transformTo("string",s.utf8encode(h.name)),v=h.comment,b=o.transformTo("string",u(v)),w=o.transformTo("string",s.utf8encode(v)),_=y.length!==h.name.length,x=w.length!==v.length,I="",k="",S="",E=h.dir,A=h.date,T={crc32:0,compressedSize:0,uncompressedSize:0};t&&!r||(T.crc32=e.crc32,T.compressedSize=e.compressedSize,T.uncompressedSize=e.uncompressedSize);var P=0;t&&(P|=8),m||!_&&!x||(P|=2048);var O=0,F=0;E&&(O|=16),"UNIX"===a?(F=798,O|=function(e,t){var r=e;return e||(r=t?16893:33204),(65535&r)<<16}(h.unixPermissions,E)):(F=20,O|=function(e){return 63&(e||0)}(h.dosPermissions)),f=A.getUTCHours(),f<<=6,f|=A.getUTCMinutes(),f<<=5,f|=A.getUTCSeconds()/2,d=A.getUTCFullYear()-1980,d<<=4,d|=A.getUTCMonth()+1,d<<=5,d|=A.getUTCDate(),_&&(k=n(1,1)+n(l(g),4)+y,I+="up"+n(k.length,2)+k),x&&(S=n(1,1)+n(l(b),4)+w,I+="uc"+n(S.length,2)+S);var R="";return R+="\n\0",R+=n(P,2),R+=p.magic,R+=n(f,2),R+=n(d,2),R+=n(T.crc32,4),R+=n(T.compressedSize,4),R+=n(T.uncompressedSize,4),R+=n(g.length,2),R+=n(I.length,2),{fileRecord:c.LOCAL_FILE_HEADER+R+g+I,dirRecord:c.CENTRAL_FILE_HEADER+n(F,2)+R+n(b.length,2)+"\0\0\0\0"+n(O,4)+n(i,4)+g+I+b}}var o=e("../utils"),a=e("../stream/GenericWorker"),s=e("../utf8"),l=e("../crc32"),c=e("../signature");function u(e,t,r,n){a.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}o.inherits(u,a),u.prototype.push=function(e){var t=e.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,a.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:r?(t+100*(r-n-1))/r:100}}))},u.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var r=i(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},u.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,r=i(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),t)this.push({data:function(e){return c.DATA_DESCRIPTOR+n(e.crc32,4)+n(e.compressedSize,4)+n(e.uncompressedSize,4)}(e),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},u.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t<this.dirRecords.length;t++)this.push({data:this.dirRecords[t],meta:{percent:100}});var r=this.bytesWritten-e,i=function(e,t,r,i,a){var s=o.transformTo("string",a(i));return c.CENTRAL_DIRECTORY_END+"\0\0\0\0"+n(e,2)+n(e,2)+n(t,4)+n(r,4)+n(s.length,2)+s}(this.dirRecords.length,r,e,this.zipComment,this.encodeFileName);this.push({data:i,meta:{percent:100}})},u.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},u.prototype.registerPrevious=function(e){this._sources.push(e);var t=this;return e.on("data",(function(e){t.processChunk(e)})),e.on("end",(function(){t.closedSource(t.previous.streamInfo),t._sources.length?t.prepareNextSource():t.end()})),e.on("error",(function(e){t.error(e)})),this},u.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},u.prototype.error=function(e){var t=this._sources;if(!a.prototype.error.call(this,e))return!1;for(var r=0;r<t.length;r++)try{t[r].error(e)}catch(e){}return!0},u.prototype.lock=function(){a.prototype.lock.call(this);for(var e=this._sources,t=0;t<e.length;t++)e[t].lock()},t.exports=u},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(e,t,r){var n=e("../compressions"),i=e("./ZipFileWorker");r.generateWorker=function(e,t,r){var o=new i(t.streamFiles,r,t.platform,t.encodeFileName),a=0;try{e.forEach((function(e,r){a++;var i=function(e,t){var r=e||t,i=n[r];if(!i)throw new Error(r+" is not a valid compression method !");return i}(r.options.compression,t.compression),s=r.options.compressionOptions||t.compressionOptions||{},l=r.dir,c=r.date;r._compressWorker(i,s).withStreamInfo("file",{name:e,dir:l,date:c,comment:r.comment||"",unixPermissions:r.unixPermissions,dosPermissions:r.dosPermissions}).pipe(o)})),o.entriesCount=a}catch(e){o.error(e)}return o}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(e,t,r){function n(){if(!(this instanceof n))return new n;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var e=new n;for(var t in this)"function"!=typeof this[t]&&(e[t]=this[t]);return e}}(n.prototype=e("./object")).loadAsync=e("./load"),n.support=e("./support"),n.defaults=e("./defaults"),n.version="3.7.1",n.loadAsync=function(e,t){return(new n).loadAsync(e,t)},n.external=e("./external"),t.exports=n},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(e,t,r){var n=e("./utils"),i=e("./external"),o=e("./utf8"),a=e("./zipEntries"),s=e("./stream/Crc32Probe"),l=e("./nodejsUtils");function c(e){return new i.Promise((function(t,r){var n=e.decompressed.getContentWorker().pipe(new s);n.on("error",(function(e){r(e)})).on("end",(function(){n.streamInfo.crc32!==e.decompressed.crc32?r(new Error("Corrupted zip : CRC32 mismatch")):t()})).resume()}))}t.exports=function(e,t){var r=this;return t=n.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:o.utf8decode}),l.isNode&&l.isStream(e)?i.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):n.prepareContent("the loaded zip file",e,!0,t.optimizedBinaryString,t.base64).then((function(e){var r=new a(t);return r.load(e),r})).then((function(e){var r=[i.Promise.resolve(e)],n=e.files;if(t.checkCRC32)for(var o=0;o<n.length;o++)r.push(c(n[o]));return i.Promise.all(r)})).then((function(e){for(var n=e.shift(),i=n.files,o=0;o<i.length;o++){var a=i[o];r.file(a.fileNameStr,a.decompressed,{binary:!0,optimizedBinaryString:!0,date:a.date,dir:a.dir,comment:a.fileCommentStr.length?a.fileCommentStr:null,unixPermissions:a.unixPermissions,dosPermissions:a.dosPermissions,createFolders:t.createFolders})}return n.zipComment.length&&(r.comment=n.zipComment),r}))}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(e,t,r){var n=e("../utils"),i=e("../stream/GenericWorker");function o(e,t){i.call(this,"Nodejs stream input adapter for "+e),this._upstreamEnded=!1,this._bindStream(t)}n.inherits(o,i),o.prototype._bindStream=function(e){var t=this;(this._stream=e).pause(),e.on("data",(function(e){t.push({data:e,meta:{percent:0}})})).on("error",(function(e){t.isPaused?this.generatedError=e:t.error(e)})).on("end",(function(){t.isPaused?t._upstreamEnded=!0:t.end()}))},o.prototype.pause=function(){return!!i.prototype.pause.call(this)&&(this._stream.pause(),!0)},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},t.exports=o},{"../stream/GenericWorker":28,"../utils":32}],13:[function(e,t,r){var n=e("readable-stream").Readable;function i(e,t,r){n.call(this,t),this._helper=e;var i=this;e.on("data",(function(e,t){i.push(e)||i._helper.pause(),r&&r(t)})).on("error",(function(e){i.emit("error",e)})).on("end",(function(){i.push(null)}))}e("../utils").inherits(i,n),i.prototype._read=function(){this._helper.resume()},t.exports=i},{"../utils":32,"readable-stream":16}],14:[function(e,t,r){t.exports={isNode:!0,newBufferFrom:function(e,t){if(S.from&&S.from!==Uint8Array.from)return S.from(e,t);if("number"==typeof e)throw new Error('The "data" argument must not be a number');return new S(e,t)},allocBuffer:function(e){if(S.alloc)return S.alloc(e);var t=new S(e);return t.fill(0),t},isBuffer:function(e){return le(e)},isStream:function(e){return e&&"function"==typeof e.on&&"function"==typeof e.pause&&"function"==typeof e.resume}}},{}],15:[function(e,t,r){function n(e,t,r){var n,i=o.getTypeOf(t),s=o.extend(r||{},l);s.date=s.date||new Date,null!==s.compression&&(s.compression=s.compression.toUpperCase()),"string"==typeof s.unixPermissions&&(s.unixPermissions=parseInt(s.unixPermissions,8)),s.unixPermissions&&16384&s.unixPermissions&&(s.dir=!0),s.dosPermissions&&16&s.dosPermissions&&(s.dir=!0),s.dir&&(e=m(e)),s.createFolders&&(n=p(e))&&g.call(this,n,!0);var f="string"===i&&!1===s.binary&&!1===s.base64;r&&void 0!==r.binary||(s.binary=!f),(t instanceof c&&0===t.uncompressedSize||s.dir||!t||0===t.length)&&(s.base64=!1,s.binary=!0,t="",s.compression="STORE",i="string");var y=null;y=t instanceof c||t instanceof a?t:d.isNode&&d.isStream(t)?new h(e,t):o.prepareContent(e,t,s.binary,s.optimizedBinaryString,s.base64);var v=new u(e,y,s);this.files[e]=v}var i=e("./utf8"),o=e("./utils"),a=e("./stream/GenericWorker"),s=e("./stream/StreamHelper"),l=e("./defaults"),c=e("./compressedObject"),u=e("./zipObject"),f=e("./generate"),d=e("./nodejsUtils"),h=e("./nodejs/NodejsStreamInputAdapter"),p=function(e){"/"===e.slice(-1)&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return 0<t?e.substring(0,t):""},m=function(e){return"/"!==e.slice(-1)&&(e+="/"),e},g=function(e,t){return t=void 0!==t?t:l.createFolders,e=m(e),this.files[e]||n.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function y(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var v={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,r,n;for(t in this.files)n=this.files[t],(r=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(r,n)},filter:function(e){var t=[];return this.forEach((function(r,n){e(r,n)&&t.push(n)})),t},file:function(e,t,r){if(1!==arguments.length)return e=this.root+e,n.call(this,e,t,r),this;if(y(e)){var i=e;return this.filter((function(e,t){return!t.dir&&i.test(e)}))}var o=this.files[this.root+e];return o&&!o.dir?o:null},folder:function(e){if(!e)return this;if(y(e))return this.filter((function(t,r){return r.dir&&e.test(t)}));var t=this.root+e,r=g.call(this,t),n=this.clone();return n.root=r.name,n},remove:function(e){e=this.root+e;var t=this.files[e];if(t||("/"!==e.slice(-1)&&(e+="/"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var r=this.filter((function(t,r){return r.name.slice(0,e.length)===e})),n=0;n<r.length;n++)delete this.files[r[n].name];return this},generate:function(e){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(e){var t,r={};try{if((r=o.extend(e||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:i.utf8encode})).type=r.type.toLowerCase(),r.compression=r.compression.toUpperCase(),"binarystring"===r.type&&(r.type="string"),!r.type)throw new Error("No output type specified.");o.checkSupport(r.type),"darwin"!==r.platform&&"freebsd"!==r.platform&&"linux"!==r.platform&&"sunos"!==r.platform||(r.platform="UNIX"),"win32"===r.platform&&(r.platform="DOS");var n=r.comment||this.comment||"";t=f.generateWorker(this,r,n)}catch(e){(t=new a("error")).error(e)}return new s(t,r.type||"string",r.mimeType)},generateAsync:function(e,t){return this.generateInternalStream(e).accumulate(t)},generateNodeStream:function(e,t){return(e=e||{}).type||(e.type="nodebuffer"),this.generateInternalStream(e).toNodejsStream(t)}};t.exports=v},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(e,t,r){t.exports=e("stream")},{stream:void 0}],17:[function(e,t,r){var n=e("./DataReader");function i(e){n.call(this,e);for(var t=0;t<this.data.length;t++)e[t]=255&e[t]}e("../utils").inherits(i,n),i.prototype.byteAt=function(e){return this.data[this.zero+e]},i.prototype.lastIndexOfSignature=function(e){for(var t=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2),i=e.charCodeAt(3),o=this.length-4;0<=o;--o)if(this.data[o]===t&&this.data[o+1]===r&&this.data[o+2]===n&&this.data[o+3]===i)return o-this.zero;return-1},i.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2),i=e.charCodeAt(3),o=this.readData(4);return t===o[0]&&r===o[1]&&n===o[2]&&i===o[3]},i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],18:[function(e,t,r){var n=e("../utils");function i(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}i.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length<this.zero+e||e<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+e+"). Corrupted zip ?")},setIndex:function(e){this.checkIndex(e),this.index=e},skip:function(e){this.setIndex(this.index+e)},byteAt:function(e){},readInt:function(e){var t,r=0;for(this.checkOffset(e),t=this.index+e-1;t>=this.index;t--)r=(r<<8)+this.byteAt(t);return this.index+=e,r},readString:function(e){return n.transformTo("string",this.readData(e))},readData:function(e){},lastIndexOfSignature:function(e){},readAndCheckSignature:function(e){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=i},{"../utils":32}],19:[function(e,t,r){var n=e("./Uint8ArrayReader");function i(e){n.call(this,e)}e("../utils").inherits(i,n),i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,r){var n=e("./DataReader");function i(e){n.call(this,e)}e("../utils").inherits(i,n),i.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},i.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},i.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],21:[function(e,t,r){var n=e("./ArrayReader");function i(e){n.call(this,e)}e("../utils").inherits(i,n),i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,r){var n=e("../utils"),i=e("../support"),o=e("./ArrayReader"),a=e("./StringReader"),s=e("./NodeBufferReader"),l=e("./Uint8ArrayReader");t.exports=function(e){var t=n.getTypeOf(e);return n.checkSupport(t),"string"!==t||i.uint8array?"nodebuffer"===t?new s(e):i.uint8array?new l(n.transformTo("uint8array",e)):new o(n.transformTo("array",e)):new a(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,r){r.LOCAL_FILE_HEADER="PK",r.CENTRAL_FILE_HEADER="PK",r.CENTRAL_DIRECTORY_END="PK",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",r.ZIP64_CENTRAL_DIRECTORY_END="PK",r.DATA_DESCRIPTOR="PK\b"},{}],24:[function(e,t,r){var n=e("./GenericWorker"),i=e("../utils");function o(e){n.call(this,"ConvertWorker to "+e),this.destType=e}i.inherits(o,n),o.prototype.processChunk=function(e){this.push({data:i.transformTo(this.destType,e.data),meta:e.meta})},t.exports=o},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,r){var n=e("./GenericWorker"),i=e("../crc32");function o(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}e("../utils").inherits(o,n),o.prototype.processChunk=function(e){this.streamInfo.crc32=i(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=o},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,r){var n=e("../utils"),i=e("./GenericWorker");function o(e){i.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}n.inherits(o,i),o.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}i.prototype.processChunk.call(this,e)},t.exports=o},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,r){var n=e("../utils"),i=e("./GenericWorker");function o(e){i.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then((function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=n.getTypeOf(e),t.isPaused||t._tickAndRepeat()}),(function(e){t.error(e)}))}n.inherits(o,i),o.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},o.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},o.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=o},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,r){function n(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var r=0;r<this._listeners[e].length;r++)this._listeners[e][r].call(this,t)},pipe:function(e){return e.registerPrevious(this)},registerPrevious:function(e){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=e.streamInfo,this.mergeStreamInfo(),this.previous=e;var t=this;return e.on("data",(function(e){t.processChunk(e)})),e.on("end",(function(){t.end()})),e.on("error",(function(e){t.error(e)})),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var e=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),e=!0),this.previous&&this.previous.resume(),!e},flush:function(){},processChunk:function(e){this.push(e)},withStreamInfo:function(e,t){return this.extraStreamInfo[e]=t,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var e in this.extraStreamInfo)this.extraStreamInfo.hasOwnProperty(e)&&(this.streamInfo[e]=this.extraStreamInfo[e])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var e="Worker "+this.name;return this.previous?this.previous+" -> "+e:e}},t.exports=n},{}],29:[function(e,t,r){var n=e("../utils"),i=e("./ConvertWorker"),o=e("./GenericWorker"),a=e("../base64"),s=e("../support"),l=e("../external"),c=null;if(s.nodestream)try{c=e("../nodejs/NodejsStreamOutputAdapter")}catch(e){}function u(e,t){return new l.Promise((function(r,i){var o=[],s=e._internalType,l=e._outputType,c=e._mimeType;e.on("data",(function(e,r){o.push(e),t&&t(r)})).on("error",(function(e){o=[],i(e)})).on("end",(function(){try{var e=function(e,t,r){switch(e){case"blob":return n.newBlob(n.transformTo("arraybuffer",t),r);case"base64":return a.encode(t);default:return n.transformTo(e,t)}}(l,function(e,t){var r,n=0,i=null,o=0;for(r=0;r<t.length;r++)o+=t[r].length;switch(e){case"string":return t.join("");case"array":return Array.prototype.concat.apply([],t);case"uint8array":for(i=new Uint8Array(o),r=0;r<t.length;r++)i.set(t[r],n),n+=t[r].length;return i;case"nodebuffer":return S.concat(t);default:throw new Error("concat : unsupported type '"+e+"'")}}(s,o),c);r(e)}catch(e){i(e)}o=[]})).resume()}))}function f(e,t,r){var a=t;switch(t){case"blob":case"arraybuffer":a="uint8array";break;case"base64":a="string"}try{this._internalType=a,this._outputType=t,this._mimeType=r,n.checkSupport(a),this._worker=e.pipe(new i(a)),e.lock()}catch(e){this._worker=new o("error"),this._worker.error(e)}}f.prototype={accumulate:function(e){return u(this,e)},on:function(e,t){var r=this;return"data"===e?this._worker.on(e,(function(e){t.call(r,e.data,e.meta)})):this._worker.on(e,(function(){n.delay(t,arguments,r)})),this},resume:function(){return n.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(e){if(n.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new c(this,{objectMode:"nodebuffer"!==this._outputType},e)}},t.exports=f},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(e,t,r){if(r.base64=!0,r.array=!0,r.string=!0,r.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,r.nodebuffer=!0,r.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)r.blob=!1;else{var n=new ArrayBuffer(0);try{r.blob=0===new Blob([n],{type:"application/zip"}).size}catch(e){try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(n),r.blob=0===i.getBlob("application/zip").size}catch(e){r.blob=!1}}}try{r.nodestream=!!e("readable-stream").Readable}catch(e){r.nodestream=!1}},{"readable-stream":16}],31:[function(e,t,r){for(var n=e("./utils"),i=e("./support"),o=e("./nodejsUtils"),a=e("./stream/GenericWorker"),s=new Array(256),l=0;l<256;l++)s[l]=252<=l?6:248<=l?5:240<=l?4:224<=l?3:192<=l?2:1;function c(){a.call(this,"utf-8 decode"),this.leftOver=null}function u(){a.call(this,"utf-8 encode")}s[254]=s[254]=1,r.utf8encode=function(e){return i.nodebuffer?o.newBufferFrom(e,"utf-8"):function(e){var t,r,n,o,a,s=e.length,l=0;for(o=0;o<s;o++)55296==(64512&(r=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(n=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(n-56320),o++),l+=r<128?1:r<2048?2:r<65536?3:4;for(t=i.uint8array?new Uint8Array(l):new Array(l),o=a=0;a<l;o++)55296==(64512&(r=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(n=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(n-56320),o++),r<128?t[a++]=r:(r<2048?t[a++]=192|r>>>6:(r<65536?t[a++]=224|r>>>12:(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63),t[a++]=128|r>>>6&63),t[a++]=128|63&r);return t}(e)},r.utf8decode=function(e){return i.nodebuffer?n.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,r,i,o,a=e.length,l=new Array(2*a);for(t=r=0;t<a;)if((i=e[t++])<128)l[r++]=i;else if(4<(o=s[i]))l[r++]=65533,t+=o-1;else{for(i&=2===o?31:3===o?15:7;1<o&&t<a;)i=i<<6|63&e[t++],o--;1<o?l[r++]=65533:i<65536?l[r++]=i:(i-=65536,l[r++]=55296|i>>10&1023,l[r++]=56320|1023&i)}return l.length!==r&&(l.subarray?l=l.subarray(0,r):l.length=r),n.applyFromCharCode(l)}(e=n.transformTo(i.uint8array?"uint8array":"array",e))},n.inherits(c,a),c.prototype.processChunk=function(e){var t=n.transformTo(i.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var o=t;(t=new Uint8Array(o.length+this.leftOver.length)).set(this.leftOver,0),t.set(o,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var a=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return r<0||0===r?t:r+s[e[r]]>t?r:t}(t),l=t;a!==t.length&&(i.uint8array?(l=t.subarray(0,a),this.leftOver=t.subarray(a,t.length)):(l=t.slice(0,a),this.leftOver=t.slice(a,t.length))),this.push({data:r.utf8decode(l),meta:e.meta})},c.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:r.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},r.Utf8DecodeWorker=c,n.inherits(u,a),u.prototype.processChunk=function(e){this.push({data:r.utf8encode(e.data),meta:e.meta})},r.Utf8EncodeWorker=u},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,r){var n=e("./support"),i=e("./base64"),o=e("./nodejsUtils"),a=e("set-immediate-shim"),s=e("./external");function l(e){return e}function c(e,t){for(var r=0;r<e.length;++r)t[r]=255&e.charCodeAt(r);return t}r.newBlob=function(e,t){r.checkSupport("blob");try{return new Blob([e],{type:t})}catch(r){try{var n=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return n.append(e),n.getBlob(t)}catch(e){throw new Error("Bug : can't construct the Blob.")}}};var u={stringifyByChunk:function(e,t,r){var n=[],i=0,o=e.length;if(o<=r)return String.fromCharCode.apply(null,e);for(;i<o;)"array"===t||"nodebuffer"===t?n.push(String.fromCharCode.apply(null,e.slice(i,Math.min(i+r,o)))):n.push(String.fromCharCode.apply(null,e.subarray(i,Math.min(i+r,o)))),i+=r;return n.join("")},stringifyByChar:function(e){for(var t="",r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},applyCanBeUsed:{uint8array:function(){try{return n.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(e){return!1}}(),nodebuffer:function(){try{return n.nodebuffer&&1===String.fromCharCode.apply(null,o.allocBuffer(1)).length}catch(e){return!1}}()}};function f(e){var t=65536,n=r.getTypeOf(e),i=!0;if("uint8array"===n?i=u.applyCanBeUsed.uint8array:"nodebuffer"===n&&(i=u.applyCanBeUsed.nodebuffer),i)for(;1<t;)try{return u.stringifyByChunk(e,n,t)}catch(e){t=Math.floor(t/2)}return u.stringifyByChar(e)}function d(e,t){for(var r=0;r<e.length;r++)t[r]=e[r];return t}r.applyFromCharCode=f;var h={};h.string={string:l,array:function(e){return c(e,new Array(e.length))},arraybuffer:function(e){return h.string.uint8array(e).buffer},uint8array:function(e){return c(e,new Uint8Array(e.length))},nodebuffer:function(e){return c(e,o.allocBuffer(e.length))}},h.array={string:f,array:l,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return o.newBufferFrom(e)}},h.arraybuffer={string:function(e){return f(new Uint8Array(e))},array:function(e){return d(new Uint8Array(e),new Array(e.byteLength))},arraybuffer:l,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return o.newBufferFrom(new Uint8Array(e))}},h.uint8array={string:f,array:function(e){return d(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:l,nodebuffer:function(e){return o.newBufferFrom(e)}},h.nodebuffer={string:f,array:function(e){return d(e,new Array(e.length))},arraybuffer:function(e){return h.nodebuffer.uint8array(e).buffer},uint8array:function(e){return d(e,new Uint8Array(e.length))},nodebuffer:l},r.transformTo=function(e,t){if(t=t||"",!e)return t;r.checkSupport(e);var n=r.getTypeOf(t);return h[n][e](t)},r.getTypeOf=function(e){return"string"==typeof e?"string":"[object Array]"===Object.prototype.toString.call(e)?"array":n.nodebuffer&&o.isBuffer(e)?"nodebuffer":n.uint8array&&e instanceof Uint8Array?"uint8array":n.arraybuffer&&e instanceof ArrayBuffer?"arraybuffer":void 0},r.checkSupport=function(e){if(!n[e.toLowerCase()])throw new Error(e+" is not supported by this platform")},r.MAX_VALUE_16BITS=65535,r.MAX_VALUE_32BITS=-1,r.pretty=function(e){var t,r,n="";for(r=0;r<(e||"").length;r++)n+="\\x"+((t=e.charCodeAt(r))<16?"0":"")+t.toString(16).toUpperCase();return n},r.delay=function(e,t,r){a((function(){e.apply(r||null,t||[])}))},r.inherits=function(e,t){function r(){}r.prototype=t.prototype,e.prototype=new r},r.extend=function(){var e,t,r={};for(e=0;e<arguments.length;e++)for(t in arguments[e])arguments[e].hasOwnProperty(t)&&void 0===r[t]&&(r[t]=arguments[e][t]);return r},r.prepareContent=function(e,t,o,a,l){return s.Promise.resolve(t).then((function(e){return n.blob&&(e instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(e)))&&"undefined"!=typeof FileReader?new s.Promise((function(t,r){var n=new FileReader;n.onload=function(e){t(e.target.result)},n.onerror=function(e){r(e.target.error)},n.readAsArrayBuffer(e)})):e})).then((function(t){var u=r.getTypeOf(t);return u?("arraybuffer"===u?t=r.transformTo("uint8array",t):"string"===u&&(l?t=i.decode(t):o&&!0!==a&&(t=function(e){return c(e,n.uint8array?new Uint8Array(e.length):new Array(e.length))}(t))),t):s.Promise.reject(new Error("Can't read the data of '"+e+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))}))}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,"set-immediate-shim":54}],33:[function(e,t,r){var n=e("./reader/readerFor"),i=e("./utils"),o=e("./signature"),a=e("./zipEntry"),s=(e("./utf8"),e("./support"));function l(e){this.files=[],this.loadOptions=e}l.prototype={checkSignature:function(e){if(!this.reader.readAndCheckSignature(e)){this.reader.index-=4;var t=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+i.pretty(t)+", expected "+i.pretty(e)+")")}},isSignature:function(e,t){var r=this.reader.index;this.reader.setIndex(e);var n=this.reader.readString(4)===t;return this.reader.setIndex(r),n},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var e=this.reader.readData(this.zipCommentLength),t=s.uint8array?"uint8array":"array",r=i.transformTo(t,e);this.zipComment=this.loadOptions.decodeFileName(r)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var e,t,r,n=this.zip64EndOfCentralSize-44;0<n;)e=this.reader.readInt(2),t=this.reader.readInt(4),r=this.reader.readData(t),this.zip64ExtensibleData[e]={id:e,length:t,value:r}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e<this.files.length;e++)t=this.files[e],this.reader.setIndex(t.localHeaderOffset),this.checkSignature(o.LOCAL_FILE_HEADER),t.readLocalPart(this.reader),t.handleUTF8(),t.processAttributes()},readCentralDir:function(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(o.CENTRAL_FILE_HEADER);)(e=new a({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(e);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var e=this.reader.lastIndexOfSignature(o.CENTRAL_DIRECTORY_END);if(e<0)throw this.isSignature(0,o.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(e);var t=e;if(this.checkSignature(o.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===i.MAX_VALUE_16BITS||this.diskWithCentralDirStart===i.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===i.MAX_VALUE_16BITS||this.centralDirRecords===i.MAX_VALUE_16BITS||this.centralDirSize===i.MAX_VALUE_32BITS||this.centralDirOffset===i.MAX_VALUE_32BITS){if(this.zip64=!0,(e=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(e),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,o.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var r=this.centralDirOffset+this.centralDirSize;this.zip64&&(r+=20,r+=12+this.zip64EndOfCentralSize);var n=t-r;if(0<n)this.isSignature(t,o.CENTRAL_FILE_HEADER)||(this.reader.zero=n);else if(n<0)throw new Error("Corrupted zip: missing "+Math.abs(n)+" bytes.")},prepareReader:function(e){this.reader=n(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},t.exports=l},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utf8":31,"./utils":32,"./zipEntry":34}],34:[function(e,t,r){var n=e("./reader/readerFor"),i=e("./utils"),o=e("./compressedObject"),a=e("./crc32"),s=e("./utf8"),l=e("./compressions"),c=e("./support");function u(e,t){this.options=e,this.loadOptions=t}u.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(e){var t,r;if(e.skip(22),this.fileNameLength=e.readInt(2),r=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(r),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(t=function(e){for(var t in l)if(l.hasOwnProperty(t)&&l[t].magic===e)return l[t];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+i.pretty(this.compressionMethod)+" unknown (inner file : "+i.transformTo("string",this.fileName)+")");this.decompressed=new o(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0==e&&(this.dosPermissions=63&this.externalFileAttributes),3==e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(e){if(this.extraFields[1]){var t=n(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(e){var t,r,n,i=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+4<i;)t=e.readInt(2),r=e.readInt(2),n=e.readData(r),this.extraFields[t]={id:t,length:r,value:n};e.setIndex(i)},handleUTF8:function(){var e=c.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=s.utf8decode(this.fileName),this.fileCommentStr=s.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();if(null!==t)this.fileNameStr=t;else{var r=i.transformTo(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(r)}var n=this.findExtraFieldUnicodeComment();if(null!==n)this.fileCommentStr=n;else{var o=i.transformTo(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(o)}}},findExtraFieldUnicodePath:function(){var e=this.extraFields[28789];if(e){var t=n(e.value);return 1!==t.readInt(1)||a(this.fileName)!==t.readInt(4)?null:s.utf8decode(t.readData(e.length-5))}return null},findExtraFieldUnicodeComment:function(){var e=this.extraFields[25461];if(e){var t=n(e.value);return 1!==t.readInt(1)||a(this.fileComment)!==t.readInt(4)?null:s.utf8decode(t.readData(e.length-5))}return null}},t.exports=u},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(e,t,r){function n(e,t,r){this.name=e,this.dir=r.dir,this.date=r.date,this.comment=r.comment,this.unixPermissions=r.unixPermissions,this.dosPermissions=r.dosPermissions,this._data=t,this._dataBinary=r.binary,this.options={compression:r.compression,compressionOptions:r.compressionOptions}}var i=e("./stream/StreamHelper"),o=e("./stream/DataWorker"),a=e("./utf8"),s=e("./compressedObject"),l=e("./stream/GenericWorker");n.prototype={internalStream:function(e){var t=null,r="string";try{if(!e)throw new Error("No output type specified.");var n="string"===(r=e.toLowerCase())||"text"===r;"binarystring"!==r&&"text"!==r||(r="string"),t=this._decompressWorker();var o=!this._dataBinary;o&&!n&&(t=t.pipe(new a.Utf8EncodeWorker)),!o&&n&&(t=t.pipe(new a.Utf8DecodeWorker))}catch(e){(t=new l("error")).error(e)}return new i(t,r,"")},async:function(e,t){return this.internalStream(e).accumulate(t)},nodeStream:function(e,t){return this.internalStream(e||"nodebuffer").toNodejsStream(t)},_compressWorker:function(e,t){if(this._data instanceof s&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var r=this._decompressWorker();return this._dataBinary||(r=r.pipe(new a.Utf8EncodeWorker)),s.createWorkerFrom(r,e,t)},_decompressWorker:function(){return this._data instanceof s?this._data.getContentWorker():this._data instanceof l?this._data:new o(this._data)}};for(var c=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],u=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},f=0;f<c.length;f++)n.prototype[c[f]]=u;t.exports=n},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(e,t,r){(function(e){var r,n,i=e.MutationObserver||e.WebKitMutationObserver;if(i){var o=0,a=new i(u),s=e.document.createTextNode("");a.observe(s,{characterData:!0}),r=function(){s.data=o=++o%2}}else if(e.setImmediate||void 0===e.MessageChannel)r="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){u(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(u,0)};else{var l=new e.MessageChannel;l.port1.onmessage=u,r=function(){l.port2.postMessage(0)}}var c=[];function u(){var e,t;n=!0;for(var r=c.length;r;){for(t=c,c=[],e=-1;++e<r;)t[e]();r=c.length}n=!1}t.exports=function(e){1!==c.push(e)||n||r()}}).call(this,void 0!==ue?ue:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],37:[function(e,t,r){var n=e("immediate");function i(){}var o={},a=["REJECTED"],s=["FULFILLED"],l=["PENDING"];function c(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=l,this.queue=[],this.outcome=void 0,e!==i&&h(this,e)}function u(e,t,r){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function f(e,t,r){n((function(){var n;try{n=t(r)}catch(n){return o.reject(e,n)}n===e?o.reject(e,new TypeError("Cannot resolve promise with itself")):o.resolve(e,n)}))}function d(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function h(e,t){var r=!1;function n(t){r||(r=!0,o.reject(e,t))}function i(t){r||(r=!0,o.resolve(e,t))}var a=p((function(){t(i,n)}));"error"===a.status&&n(a.value)}function p(e,t){var r={};try{r.value=e(t),r.status="success"}catch(e){r.status="error",r.value=e}return r}(t.exports=c).prototype.finally=function(e){if("function"!=typeof e)return this;var t=this.constructor;return this.then((function(r){return t.resolve(e()).then((function(){return r}))}),(function(r){return t.resolve(e()).then((function(){throw r}))}))},c.prototype.catch=function(e){return this.then(null,e)},c.prototype.then=function(e,t){if("function"!=typeof e&&this.state===s||"function"!=typeof t&&this.state===a)return this;var r=new this.constructor(i);return this.state!==l?f(r,this.state===s?e:t,this.outcome):this.queue.push(new u(r,e,t)),r},u.prototype.callFulfilled=function(e){o.resolve(this.promise,e)},u.prototype.otherCallFulfilled=function(e){f(this.promise,this.onFulfilled,e)},u.prototype.callRejected=function(e){o.reject(this.promise,e)},u.prototype.otherCallRejected=function(e){f(this.promise,this.onRejected,e)},o.resolve=function(e,t){var r=p(d,t);if("error"===r.status)return o.reject(e,r.value);var n=r.value;if(n)h(e,n);else{e.state=s,e.outcome=t;for(var i=-1,a=e.queue.length;++i<a;)e.queue[i].callFulfilled(t)}return e},o.reject=function(e,t){e.state=a,e.outcome=t;for(var r=-1,n=e.queue.length;++r<n;)e.queue[r].callRejected(t);return e},c.resolve=function(e){return e instanceof this?e:o.resolve(new this(i),e)},c.reject=function(e){var t=new this(i);return o.reject(t,e)},c.all=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,n=!1;if(!r)return this.resolve([]);for(var a=new Array(r),s=0,l=-1,c=new this(i);++l<r;)u(e[l],l);return c;function u(e,i){t.resolve(e).then((function(e){a[i]=e,++s!==r||n||(n=!0,o.resolve(c,a))}),(function(e){n||(n=!0,o.reject(c,e))}))}},c.race=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,n=!1;if(!r)return this.resolve([]);for(var a,s=-1,l=new this(i);++s<r;)a=e[s],t.resolve(a).then((function(e){n||(n=!0,o.resolve(l,e))}),(function(e){n||(n=!0,o.reject(l,e))}));return l}},{immediate:36}],38:[function(e,t,r){var n={};(0,e("./lib/utils/common").assign)(n,e("./lib/deflate"),e("./lib/inflate"),e("./lib/zlib/constants")),t.exports=n},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(e,t,r){var n=e("./zlib/deflate"),i=e("./utils/common"),o=e("./utils/strings"),a=e("./zlib/messages"),s=e("./zlib/zstream"),l=Object.prototype.toString,c=0,u=-1,f=0,d=8;function h(e){if(!(this instanceof h))return new h(e);this.options=i.assign({level:u,method:d,chunkSize:16384,windowBits:15,memLevel:8,strategy:f,to:""},e||{});var t=this.options;t.raw&&0<t.windowBits?t.windowBits=-t.windowBits:t.gzip&&0<t.windowBits&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var r=n.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==c)throw new Error(a[r]);if(t.header&&n.deflateSetHeader(this.strm,t.header),t.dictionary){var p;if(p="string"==typeof t.dictionary?o.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(r=n.deflateSetDictionary(this.strm,p))!==c)throw new Error(a[r]);this._dict_set=!0}}function p(e,t){var r=new h(t);if(r.push(e,!0),r.err)throw r.msg||a[r.err];return r.result}h.prototype.push=function(e,t){var r,a,s=this.strm,u=this.options.chunkSize;if(this.ended)return!1;a=t===~~t?t:!0===t?4:0,"string"==typeof e?s.input=o.string2buf(e):"[object ArrayBuffer]"===l.call(e)?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new i.Buf8(u),s.next_out=0,s.avail_out=u),1!==(r=n.deflate(s,a))&&r!==c)return this.onEnd(r),!(this.ended=!0);0!==s.avail_out&&(0!==s.avail_in||4!==a&&2!==a)||("string"===this.options.to?this.onData(o.buf2binstring(i.shrinkBuf(s.output,s.next_out))):this.onData(i.shrinkBuf(s.output,s.next_out)))}while((0<s.avail_in||0===s.avail_out)&&1!==r);return 4===a?(r=n.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===c):2!==a||(this.onEnd(c),!(s.avail_out=0))},h.prototype.onData=function(e){this.chunks.push(e)},h.prototype.onEnd=function(e){e===c&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},r.Deflate=h,r.deflate=p,r.deflateRaw=function(e,t){return(t=t||{}).raw=!0,p(e,t)},r.gzip=function(e,t){return(t=t||{}).gzip=!0,p(e,t)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(e,t,r){var n=e("./zlib/inflate"),i=e("./utils/common"),o=e("./utils/strings"),a=e("./zlib/constants"),s=e("./zlib/messages"),l=e("./zlib/zstream"),c=e("./zlib/gzheader"),u=Object.prototype.toString;function f(e){if(!(this instanceof f))return new f(e);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&0<=t.windowBits&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(0<=t.windowBits&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),15<t.windowBits&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var r=n.inflateInit2(this.strm,t.windowBits);if(r!==a.Z_OK)throw new Error(s[r]);this.header=new c,n.inflateGetHeader(this.strm,this.header)}function d(e,t){var r=new f(t);if(r.push(e,!0),r.err)throw r.msg||s[r.err];return r.result}f.prototype.push=function(e,t){var r,s,l,c,f,d,h=this.strm,p=this.options.chunkSize,m=this.options.dictionary,g=!1;if(this.ended)return!1;s=t===~~t?t:!0===t?a.Z_FINISH:a.Z_NO_FLUSH,"string"==typeof e?h.input=o.binstring2buf(e):"[object ArrayBuffer]"===u.call(e)?h.input=new Uint8Array(e):h.input=e,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new i.Buf8(p),h.next_out=0,h.avail_out=p),(r=n.inflate(h,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&m&&(d="string"==typeof m?o.string2buf(m):"[object ArrayBuffer]"===u.call(m)?new Uint8Array(m):m,r=n.inflateSetDictionary(this.strm,d)),r===a.Z_BUF_ERROR&&!0===g&&(r=a.Z_OK,g=!1),r!==a.Z_STREAM_END&&r!==a.Z_OK)return this.onEnd(r),!(this.ended=!0);h.next_out&&(0!==h.avail_out&&r!==a.Z_STREAM_END&&(0!==h.avail_in||s!==a.Z_FINISH&&s!==a.Z_SYNC_FLUSH)||("string"===this.options.to?(l=o.utf8border(h.output,h.next_out),c=h.next_out-l,f=o.buf2string(h.output,l),h.next_out=c,h.avail_out=p-c,c&&i.arraySet(h.output,h.output,l,c,0),this.onData(f)):this.onData(i.shrinkBuf(h.output,h.next_out)))),0===h.avail_in&&0===h.avail_out&&(g=!0)}while((0<h.avail_in||0===h.avail_out)&&r!==a.Z_STREAM_END);return r===a.Z_STREAM_END&&(s=a.Z_FINISH),s===a.Z_FINISH?(r=n.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===a.Z_OK):s!==a.Z_SYNC_FLUSH||(this.onEnd(a.Z_OK),!(h.avail_out=0))},f.prototype.onData=function(e){this.chunks.push(e)},f.prototype.onEnd=function(e){e===a.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},r.Inflate=f,r.inflate=d,r.inflateRaw=function(e,t){return(t=t||{}).raw=!0,d(e,t)},r.ungzip=d},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(e,t,r){var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;r.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var n in r)r.hasOwnProperty(n)&&(e[n]=r[n])}}return e},r.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){var t,r,n,i,o,a;for(t=n=0,r=e.length;t<r;t++)n+=e[t].length;for(a=new Uint8Array(n),t=i=0,r=e.length;t<r;t++)o=e[t],a.set(o,i),i+=o.length;return a}},o={arraySet:function(e,t,r,n,i){for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){return[].concat.apply([],e)}};r.setTyped=function(e){e?(r.Buf8=Uint8Array,r.Buf16=Uint16Array,r.Buf32=Int32Array,r.assign(r,i)):(r.Buf8=Array,r.Buf16=Array,r.Buf32=Array,r.assign(r,o))},r.setTyped(n)},{}],42:[function(e,t,r){var n=e("./common"),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(e){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){o=!1}for(var a=new n.Buf8(256),s=0;s<256;s++)a[s]=252<=s?6:248<=s?5:240<=s?4:224<=s?3:192<=s?2:1;function l(e,t){if(t<65537&&(e.subarray&&o||!e.subarray&&i))return String.fromCharCode.apply(null,n.shrinkBuf(e,t));for(var r="",a=0;a<t;a++)r+=String.fromCharCode(e[a]);return r}a[254]=a[254]=1,r.string2buf=function(e){var t,r,i,o,a,s=e.length,l=0;for(o=0;o<s;o++)55296==(64512&(r=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(i=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(i-56320),o++),l+=r<128?1:r<2048?2:r<65536?3:4;for(t=new n.Buf8(l),o=a=0;a<l;o++)55296==(64512&(r=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(i=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(i-56320),o++),r<128?t[a++]=r:(r<2048?t[a++]=192|r>>>6:(r<65536?t[a++]=224|r>>>12:(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63),t[a++]=128|r>>>6&63),t[a++]=128|63&r);return t},r.buf2binstring=function(e){return l(e,e.length)},r.binstring2buf=function(e){for(var t=new n.Buf8(e.length),r=0,i=t.length;r<i;r++)t[r]=e.charCodeAt(r);return t},r.buf2string=function(e,t){var r,n,i,o,s=t||e.length,c=new Array(2*s);for(r=n=0;r<s;)if((i=e[r++])<128)c[n++]=i;else if(4<(o=a[i]))c[n++]=65533,r+=o-1;else{for(i&=2===o?31:3===o?15:7;1<o&&r<s;)i=i<<6|63&e[r++],o--;1<o?c[n++]=65533:i<65536?c[n++]=i:(i-=65536,c[n++]=55296|i>>10&1023,c[n++]=56320|1023&i)}return l(c,n)},r.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return r<0||0===r?t:r+a[e[r]]>t?r:t}},{"./common":41}],43:[function(e,t,r){t.exports=function(e,t,r,n){for(var i=65535&e|0,o=e>>>16&65535|0,a=0;0!==r;){for(r-=a=2e3<r?2e3:r;o=o+(i=i+t[n++]|0)|0,--a;);i%=65521,o%=65521}return i|o<<16|0}},{}],44:[function(e,t,r){t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(e,t,r){var n=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,i){var o=n,a=i+r;e^=-1;for(var s=i;s<a;s++)e=e>>>8^o[255&(e^t[s])];return-1^e}},{}],46:[function(e,t,r){var n,i=e("../utils/common"),o=e("./trees"),a=e("./adler32"),s=e("./crc32"),l=e("./messages"),c=0,u=4,f=0,d=-2,h=-1,p=4,m=2,g=8,y=9,v=286,b=30,w=19,_=2*v+1,x=15,I=3,k=258,S=k+I+1,E=42,A=113,T=1,P=2,O=3,F=4;function R(e,t){return e.msg=l[t],t}function C(e){return(e<<1)-(4<e?9:0)}function z(e){for(var t=e.length;0<=--t;)e[t]=0}function D(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(i.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function L(e,t){o._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,D(e.strm)}function U(e,t){e.pending_buf[e.pending++]=t}function B(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function N(e,t){var r,n,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match,l=e.strstart>e.w_size-S?e.strstart-(e.w_size-S):0,c=e.window,u=e.w_mask,f=e.prev,d=e.strstart+k,h=c[o+a-1],p=c[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(c[(r=t)+a]===p&&c[r+a-1]===h&&c[r]===c[o]&&c[++r]===c[o+1]){o+=2,r++;do{}while(c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&o<d);if(n=k-(d-o),o=d-k,a<n){if(e.match_start=t,s<=(a=n))break;h=c[o+a-1],p=c[o+a]}}}while((t=f[t&u])>l&&0!=--i);return a<=e.lookahead?a:e.lookahead}function j(e){var t,r,n,o,l,c,u,f,d,h,p=e.w_size;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=p+(p-S)){for(i.arraySet(e.window,e.window,p,p,0),e.match_start-=p,e.strstart-=p,e.block_start-=p,t=r=e.hash_size;n=e.head[--t],e.head[t]=p<=n?n-p:0,--r;);for(t=r=p;n=e.prev[--t],e.prev[t]=p<=n?n-p:0,--r;);o+=p}if(0===e.strm.avail_in)break;if(c=e.strm,u=e.window,f=e.strstart+e.lookahead,h=void 0,(d=o)<(h=c.avail_in)&&(h=d),r=0===h?0:(c.avail_in-=h,i.arraySet(u,c.input,c.next_in,h,f),1===c.state.wrap?c.adler=a(c.adler,u,h,f):2===c.state.wrap&&(c.adler=s(c.adler,u,h,f)),c.next_in+=h,c.total_in+=h,h),e.lookahead+=r,e.lookahead+e.insert>=I)for(l=e.strstart-e.insert,e.ins_h=e.window[l],e.ins_h=(e.ins_h<<e.hash_shift^e.window[l+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[l+I-1])&e.hash_mask,e.prev[l&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=l,l++,e.insert--,!(e.lookahead+e.insert<I)););}while(e.lookahead<S&&0!==e.strm.avail_in)}function M(e,t){for(var r,n;;){if(e.lookahead<S){if(j(e),e.lookahead<S&&t===c)return T;if(0===e.lookahead)break}if(r=0,e.lookahead>=I&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+I-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-S&&(e.match_length=N(e,r)),e.match_length>=I)if(n=o._tr_tally(e,e.strstart-e.match_start,e.match_length-I),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=I){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+I-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart,0!=--e.match_length;);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(L(e,!1),0===e.strm.avail_out))return T}return e.insert=e.strstart<I-1?e.strstart:I-1,t===u?(L(e,!0),0===e.strm.avail_out?O:F):e.last_lit&&(L(e,!1),0===e.strm.avail_out)?T:P}function W(e,t){for(var r,n,i;;){if(e.lookahead<S){if(j(e),e.lookahead<S&&t===c)return T;if(0===e.lookahead)break}if(r=0,e.lookahead>=I&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+I-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=I-1,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-S&&(e.match_length=N(e,r),e.match_length<=5&&(1===e.strategy||e.match_length===I&&4096<e.strstart-e.match_start)&&(e.match_length=I-1)),e.prev_length>=I&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-I,n=o._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-I),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+I-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!=--e.prev_length;);if(e.match_available=0,e.match_length=I-1,e.strstart++,n&&(L(e,!1),0===e.strm.avail_out))return T}else if(e.match_available){if((n=o._tr_tally(e,0,e.window[e.strstart-1]))&&L(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return T}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=o._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<I-1?e.strstart:I-1,t===u?(L(e,!0),0===e.strm.avail_out?O:F):e.last_lit&&(L(e,!1),0===e.strm.avail_out)?T:P}function V(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}function G(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=g,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(2*_),this.dyn_dtree=new i.Buf16(2*(2*b+1)),this.bl_tree=new i.Buf16(2*(2*w+1)),z(this.dyn_ltree),z(this.dyn_dtree),z(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(x+1),this.heap=new i.Buf16(2*v+1),z(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(2*v+1),z(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Z(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=m,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?E:A,e.adler=2===t.wrap?0:1,t.last_flush=c,o._tr_init(t),f):R(e,d)}function q(e){var t=Z(e);return t===f&&function(e){e.window_size=2*e.w_size,z(e.head),e.max_lazy_match=n[e.level].max_lazy,e.good_match=n[e.level].good_length,e.nice_match=n[e.level].nice_length,e.max_chain_length=n[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=I-1,e.match_available=0,e.ins_h=0}(e.state),t}function $(e,t,r,n,o,a){if(!e)return d;var s=1;if(t===h&&(t=6),n<0?(s=0,n=-n):15<n&&(s=2,n-=16),o<1||y<o||r!==g||n<8||15<n||t<0||9<t||a<0||p<a)return R(e,d);8===n&&(n=9);var l=new G;return(e.state=l).strm=e,l.wrap=s,l.gzhead=null,l.w_bits=n,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=o+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+I-1)/I),l.window=new i.Buf8(2*l.w_size),l.head=new i.Buf16(l.hash_size),l.prev=new i.Buf16(l.w_size),l.lit_bufsize=1<<o+6,l.pending_buf_size=4*l.lit_bufsize,l.pending_buf=new i.Buf8(l.pending_buf_size),l.d_buf=1*l.lit_bufsize,l.l_buf=3*l.lit_bufsize,l.level=t,l.strategy=a,l.method=r,q(e)}n=[new V(0,0,0,0,(function(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(j(e),0===e.lookahead&&t===c)return T;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,L(e,!1),0===e.strm.avail_out))return T;if(e.strstart-e.block_start>=e.w_size-S&&(L(e,!1),0===e.strm.avail_out))return T}return e.insert=0,t===u?(L(e,!0),0===e.strm.avail_out?O:F):(e.strstart>e.block_start&&(L(e,!1),e.strm.avail_out),T)})),new V(4,4,8,4,M),new V(4,5,16,8,M),new V(4,6,32,32,M),new V(4,4,16,16,W),new V(8,16,32,32,W),new V(8,16,128,128,W),new V(8,32,128,256,W),new V(32,128,258,1024,W),new V(32,258,258,4096,W)],r.deflateInit=function(e,t){return $(e,t,g,15,8,0)},r.deflateInit2=$,r.deflateReset=q,r.deflateResetKeep=Z,r.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?d:(e.state.gzhead=t,f):d},r.deflate=function(e,t){var r,i,a,l;if(!e||!e.state||5<t||t<0)return e?R(e,d):d;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||666===i.status&&t!==u)return R(e,0===e.avail_out?-5:d);if(i.strm=e,r=i.last_flush,i.last_flush=t,i.status===E)if(2===i.wrap)e.adler=0,U(i,31),U(i,139),U(i,8),i.gzhead?(U(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),U(i,255&i.gzhead.time),U(i,i.gzhead.time>>8&255),U(i,i.gzhead.time>>16&255),U(i,i.gzhead.time>>24&255),U(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),U(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(U(i,255&i.gzhead.extra.length),U(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=s(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(U(i,0),U(i,0),U(i,0),U(i,0),U(i,0),U(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),U(i,3),i.status=A);else{var h=g+(i.w_bits-8<<4)<<8;h|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(h|=32),h+=31-h%31,i.status=A,B(i,h),0!==i.strstart&&(B(i,e.adler>>>16),B(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(a=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),D(e),a=i.pending,i.pending!==i.pending_buf_size));)U(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),D(e),a=i.pending,i.pending===i.pending_buf_size)){l=1;break}l=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,U(i,l)}while(0!==l);i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),0===l&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),D(e),a=i.pending,i.pending===i.pending_buf_size)){l=1;break}l=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,U(i,l)}while(0!==l);i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),0===l&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&D(e),i.pending+2<=i.pending_buf_size&&(U(i,255&e.adler),U(i,e.adler>>8&255),e.adler=0,i.status=A)):i.status=A),0!==i.pending){if(D(e),0===e.avail_out)return i.last_flush=-1,f}else if(0===e.avail_in&&C(t)<=C(r)&&t!==u)return R(e,-5);if(666===i.status&&0!==e.avail_in)return R(e,-5);if(0!==e.avail_in||0!==i.lookahead||t!==c&&666!==i.status){var p=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(j(e),0===e.lookahead)){if(t===c)return T;break}if(e.match_length=0,r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(L(e,!1),0===e.strm.avail_out))return T}return e.insert=0,t===u?(L(e,!0),0===e.strm.avail_out?O:F):e.last_lit&&(L(e,!1),0===e.strm.avail_out)?T:P}(i,t):3===i.strategy?function(e,t){for(var r,n,i,a,s=e.window;;){if(e.lookahead<=k){if(j(e),e.lookahead<=k&&t===c)return T;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=I&&0<e.strstart&&(n=s[i=e.strstart-1])===s[++i]&&n===s[++i]&&n===s[++i]){a=e.strstart+k;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&i<a);e.match_length=k-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=I?(r=o._tr_tally(e,1,e.match_length-I),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(L(e,!1),0===e.strm.avail_out))return T}return e.insert=0,t===u?(L(e,!0),0===e.strm.avail_out?O:F):e.last_lit&&(L(e,!1),0===e.strm.avail_out)?T:P}(i,t):n[i.level].func(i,t);if(p!==O&&p!==F||(i.status=666),p===T||p===O)return 0===e.avail_out&&(i.last_flush=-1),f;if(p===P&&(1===t?o._tr_align(i):5!==t&&(o._tr_stored_block(i,0,0,!1),3===t&&(z(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),D(e),0===e.avail_out))return i.last_flush=-1,f}return t!==u?f:i.wrap<=0?1:(2===i.wrap?(U(i,255&e.adler),U(i,e.adler>>8&255),U(i,e.adler>>16&255),U(i,e.adler>>24&255),U(i,255&e.total_in),U(i,e.total_in>>8&255),U(i,e.total_in>>16&255),U(i,e.total_in>>24&255)):(B(i,e.adler>>>16),B(i,65535&e.adler)),D(e),0<i.wrap&&(i.wrap=-i.wrap),0!==i.pending?f:1)},r.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==E&&69!==t&&73!==t&&91!==t&&103!==t&&t!==A&&666!==t?R(e,d):(e.state=null,t===A?R(e,-3):f):d},r.deflateSetDictionary=function(e,t){var r,n,o,s,l,c,u,h,p=t.length;if(!e||!e.state)return d;if(2===(s=(r=e.state).wrap)||1===s&&r.status!==E||r.lookahead)return d;for(1===s&&(e.adler=a(e.adler,t,p,0)),r.wrap=0,p>=r.w_size&&(0===s&&(z(r.head),r.strstart=0,r.block_start=0,r.insert=0),h=new i.Buf8(r.w_size),i.arraySet(h,t,p-r.w_size,r.w_size,0),t=h,p=r.w_size),l=e.avail_in,c=e.next_in,u=e.input,e.avail_in=p,e.next_in=0,e.input=t,j(r);r.lookahead>=I;){for(n=r.strstart,o=r.lookahead-(I-1);r.ins_h=(r.ins_h<<r.hash_shift^r.window[n+I-1])&r.hash_mask,r.prev[n&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=n,n++,--o;);r.strstart=n,r.lookahead=I-1,j(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=I-1,r.match_available=0,e.next_in=c,e.input=u,e.avail_in=l,r.wrap=s,f},r.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(e,t,r){t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(e,t,r){t.exports=function(e,t){var r,n,i,o,a,s,l,c,u,f,d,h,p,m,g,y,v,b,w,_,x,I,k,S,E;r=e.state,n=e.next_in,S=e.input,i=n+(e.avail_in-5),o=e.next_out,E=e.output,a=o-(t-e.avail_out),s=o+(e.avail_out-257),l=r.dmax,c=r.wsize,u=r.whave,f=r.wnext,d=r.window,h=r.hold,p=r.bits,m=r.lencode,g=r.distcode,y=(1<<r.lenbits)-1,v=(1<<r.distbits)-1;e:do{p<15&&(h+=S[n++]<<p,p+=8,h+=S[n++]<<p,p+=8),b=m[h&y];t:for(;;){if(h>>>=w=b>>>24,p-=w,0==(w=b>>>16&255))E[o++]=65535&b;else{if(!(16&w)){if(0==(64&w)){b=m[(65535&b)+(h&(1<<w)-1)];continue t}if(32&w){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}_=65535&b,(w&=15)&&(p<w&&(h+=S[n++]<<p,p+=8),_+=h&(1<<w)-1,h>>>=w,p-=w),p<15&&(h+=S[n++]<<p,p+=8,h+=S[n++]<<p,p+=8),b=g[h&v];r:for(;;){if(h>>>=w=b>>>24,p-=w,!(16&(w=b>>>16&255))){if(0==(64&w)){b=g[(65535&b)+(h&(1<<w)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(x=65535&b,p<(w&=15)&&(h+=S[n++]<<p,(p+=8)<w&&(h+=S[n++]<<p,p+=8)),l<(x+=h&(1<<w)-1)){e.msg="invalid distance too far back",r.mode=30;break e}if(h>>>=w,p-=w,(w=o-a)<x){if(u<(w=x-w)&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(k=d,(I=0)===f){if(I+=c-w,w<_){for(_-=w;E[o++]=d[I++],--w;);I=o-x,k=E}}else if(f<w){if(I+=c+f-w,(w-=f)<_){for(_-=w;E[o++]=d[I++],--w;);if(I=0,f<_){for(_-=w=f;E[o++]=d[I++],--w;);I=o-x,k=E}}}else if(I+=f-w,w<_){for(_-=w;E[o++]=d[I++],--w;);I=o-x,k=E}for(;2<_;)E[o++]=k[I++],E[o++]=k[I++],E[o++]=k[I++],_-=3;_&&(E[o++]=k[I++],1<_&&(E[o++]=k[I++]))}else{for(I=o-x;E[o++]=E[I++],E[o++]=E[I++],E[o++]=E[I++],2<(_-=3););_&&(E[o++]=E[I++],1<_&&(E[o++]=E[I++]))}break}}break}}while(n<i&&o<s);n-=_=p>>3,h&=(1<<(p-=_<<3))-1,e.next_in=n,e.next_out=o,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=o<s?s-o+257:257-(o-s),r.hold=h,r.bits=p}},{}],49:[function(e,t,r){var n=e("../utils/common"),i=e("./adler32"),o=e("./crc32"),a=e("./inffast"),s=e("./inftrees"),l=1,c=2,u=0,f=-2,d=1,h=852,p=592;function m(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function g(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function y(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=d,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(h),t.distcode=t.distdyn=new n.Buf32(p),t.sane=1,t.back=-1,u):f}function v(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,y(e)):f}function b(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15<t)?f:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,v(e))):f}function w(e,t){var r,n;return e?(n=new g,(e.state=n).window=null,(r=b(e,t))!==u&&(e.state=null),r):f}var _,x,I=!0;function k(e){if(I){var t;for(_=new n.Buf32(512),x=new n.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(s(l,e.lens,0,288,_,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(c,e.lens,0,32,x,0,e.work,{bits:5}),I=!1}e.lencode=_,e.lenbits=9,e.distcode=x,e.distbits=5}function S(e,t,r,i){var o,a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new n.Buf8(a.wsize)),i>=a.wsize?(n.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(i<(o=a.wsize-a.wnext)&&(o=i),n.arraySet(a.window,t,r-i,o,a.wnext),(i-=o)?(n.arraySet(a.window,t,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=o))),0}r.inflateReset=v,r.inflateReset2=b,r.inflateResetKeep=y,r.inflateInit=function(e){return w(e,15)},r.inflateInit2=w,r.inflate=function(e,t){var r,h,p,g,y,v,b,w,_,x,I,E,A,T,P,O,F,R,C,z,D,L,U,B,N=0,j=new n.Buf8(4),M=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return f;12===(r=e.state).mode&&(r.mode=13),y=e.next_out,p=e.output,b=e.avail_out,g=e.next_in,h=e.input,v=e.avail_in,w=r.hold,_=r.bits,x=v,I=b,L=u;e:for(;;)switch(r.mode){case d:if(0===r.wrap){r.mode=13;break}for(;_<16;){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}if(2&r.wrap&&35615===w){j[r.check=0]=255&w,j[1]=w>>>8&255,r.check=o(r.check,j,2,0),_=w=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&w)<<8)+(w>>8))%31){e.msg="incorrect header check",r.mode=30;break}if(8!=(15&w)){e.msg="unknown compression method",r.mode=30;break}if(_-=4,D=8+(15&(w>>>=4)),0===r.wbits)r.wbits=D;else if(D>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<<D,e.adler=r.check=1,r.mode=512&w?10:12,_=w=0;break;case 2:for(;_<16;){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}if(r.flags=w,8!=(255&r.flags)){e.msg="unknown compression method",r.mode=30;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=30;break}r.head&&(r.head.text=w>>8&1),512&r.flags&&(j[0]=255&w,j[1]=w>>>8&255,r.check=o(r.check,j,2,0)),_=w=0,r.mode=3;case 3:for(;_<32;){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}r.head&&(r.head.time=w),512&r.flags&&(j[0]=255&w,j[1]=w>>>8&255,j[2]=w>>>16&255,j[3]=w>>>24&255,r.check=o(r.check,j,4,0)),_=w=0,r.mode=4;case 4:for(;_<16;){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}r.head&&(r.head.xflags=255&w,r.head.os=w>>8),512&r.flags&&(j[0]=255&w,j[1]=w>>>8&255,r.check=o(r.check,j,2,0)),_=w=0,r.mode=5;case 5:if(1024&r.flags){for(;_<16;){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}r.length=w,r.head&&(r.head.extra_len=w),512&r.flags&&(j[0]=255&w,j[1]=w>>>8&255,r.check=o(r.check,j,2,0)),_=w=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(v<(E=r.length)&&(E=v),E&&(r.head&&(D=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,h,g,E,D)),512&r.flags&&(r.check=o(r.check,h,E,g)),v-=E,g+=E,r.length-=E),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===v)break e;for(E=0;D=h[g+E++],r.head&&D&&r.length<65536&&(r.head.name+=String.fromCharCode(D)),D&&E<v;);if(512&r.flags&&(r.check=o(r.check,h,E,g)),v-=E,g+=E,D)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===v)break e;for(E=0;D=h[g+E++],r.head&&D&&r.length<65536&&(r.head.comment+=String.fromCharCode(D)),D&&E<v;);if(512&r.flags&&(r.check=o(r.check,h,E,g)),v-=E,g+=E,D)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;_<16;){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}if(w!==(65535&r.check)){e.msg="header crc mismatch",r.mode=30;break}_=w=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;_<32;){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}e.adler=r.check=m(w),_=w=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=y,e.avail_out=b,e.next_in=g,e.avail_in=v,r.hold=w,r.bits=_,2;e.adler=r.check=1,r.mode=12;case 12:if(5===t||6===t)break e;case 13:if(r.last){w>>>=7&_,_-=7&_,r.mode=27;break}for(;_<3;){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}switch(r.last=1&w,_-=1,3&(w>>>=1)){case 0:r.mode=14;break;case 1:if(k(r),r.mode=20,6!==t)break;w>>>=2,_-=2;break e;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}w>>>=2,_-=2;break;case 14:for(w>>>=7&_,_-=7&_;_<32;){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}if((65535&w)!=(w>>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&w,_=w=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(E=r.length){if(v<E&&(E=v),b<E&&(E=b),0===E)break e;n.arraySet(p,h,g,E,y),v-=E,g+=E,b-=E,y+=E,r.length-=E;break}r.mode=12;break;case 17:for(;_<14;){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}if(r.nlen=257+(31&w),w>>>=5,_-=5,r.ndist=1+(31&w),w>>>=5,_-=5,r.ncode=4+(15&w),w>>>=4,_-=4,286<r.nlen||30<r.ndist){e.msg="too many length or distance symbols",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;_<3;){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}r.lens[M[r.have++]]=7&w,w>>>=3,_-=3}for(;r.have<19;)r.lens[M[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,U={bits:r.lenbits},L=s(0,r.lens,0,19,r.lencode,0,r.work,U),r.lenbits=U.bits,L){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;O=(N=r.lencode[w&(1<<r.lenbits)-1])>>>16&255,F=65535&N,!((P=N>>>24)<=_);){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}if(F<16)w>>>=P,_-=P,r.lens[r.have++]=F;else{if(16===F){for(B=P+2;_<B;){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}if(w>>>=P,_-=P,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}D=r.lens[r.have-1],E=3+(3&w),w>>>=2,_-=2}else if(17===F){for(B=P+3;_<B;){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}_-=P,D=0,E=3+(7&(w>>>=P)),w>>>=3,_-=3}else{for(B=P+7;_<B;){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}_-=P,D=0,E=11+(127&(w>>>=P)),w>>>=7,_-=7}if(r.have+E>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;E--;)r.lens[r.have++]=D}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,U={bits:r.lenbits},L=s(l,r.lens,0,r.nlen,r.lencode,0,r.work,U),r.lenbits=U.bits,L){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,U={bits:r.distbits},L=s(c,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,U),r.distbits=U.bits,L){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(6<=v&&258<=b){e.next_out=y,e.avail_out=b,e.next_in=g,e.avail_in=v,r.hold=w,r.bits=_,a(e,I),y=e.next_out,p=e.output,b=e.avail_out,g=e.next_in,h=e.input,v=e.avail_in,w=r.hold,_=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;O=(N=r.lencode[w&(1<<r.lenbits)-1])>>>16&255,F=65535&N,!((P=N>>>24)<=_);){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}if(O&&0==(240&O)){for(R=P,C=O,z=F;O=(N=r.lencode[z+((w&(1<<R+C)-1)>>R)])>>>16&255,F=65535&N,!(R+(P=N>>>24)<=_);){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}w>>>=R,_-=R,r.back+=R}if(w>>>=P,_-=P,r.back+=P,r.length=F,0===O){r.mode=26;break}if(32&O){r.back=-1,r.mode=12;break}if(64&O){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&O,r.mode=22;case 22:if(r.extra){for(B=r.extra;_<B;){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}r.length+=w&(1<<r.extra)-1,w>>>=r.extra,_-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;O=(N=r.distcode[w&(1<<r.distbits)-1])>>>16&255,F=65535&N,!((P=N>>>24)<=_);){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}if(0==(240&O)){for(R=P,C=O,z=F;O=(N=r.distcode[z+((w&(1<<R+C)-1)>>R)])>>>16&255,F=65535&N,!(R+(P=N>>>24)<=_);){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}w>>>=R,_-=R,r.back+=R}if(w>>>=P,_-=P,r.back+=P,64&O){e.msg="invalid distance code",r.mode=30;break}r.offset=F,r.extra=15&O,r.mode=24;case 24:if(r.extra){for(B=r.extra;_<B;){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}r.offset+=w&(1<<r.extra)-1,w>>>=r.extra,_-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===b)break e;if(E=I-b,r.offset>E){if((E=r.offset-E)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}A=E>r.wnext?(E-=r.wnext,r.wsize-E):r.wnext-E,E>r.length&&(E=r.length),T=r.window}else T=p,A=y-r.offset,E=r.length;for(b<E&&(E=b),b-=E,r.length-=E;p[y++]=T[A++],--E;);0===r.length&&(r.mode=21);break;case 26:if(0===b)break e;p[y++]=r.length,b--,r.mode=21;break;case 27:if(r.wrap){for(;_<32;){if(0===v)break e;v--,w|=h[g++]<<_,_+=8}if(I-=b,e.total_out+=I,r.total+=I,I&&(e.adler=r.check=r.flags?o(r.check,p,I,y-I):i(r.check,p,I,y-I)),I=b,(r.flags?w:m(w))!==r.check){e.msg="incorrect data check",r.mode=30;break}_=w=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;_<32;){if(0===v)break e;v--,w+=h[g++]<<_,_+=8}if(w!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=30;break}_=w=0}r.mode=29;case 29:L=1;break e;case 30:L=-3;break e;case 31:return-4;default:return f}return e.next_out=y,e.avail_out=b,e.next_in=g,e.avail_in=v,r.hold=w,r.bits=_,(r.wsize||I!==e.avail_out&&r.mode<30&&(r.mode<27||4!==t))&&S(e,e.output,e.next_out,I-e.avail_out)?(r.mode=31,-4):(x-=e.avail_in,I-=e.avail_out,e.total_in+=x,e.total_out+=I,r.total+=I,r.wrap&&I&&(e.adler=r.check=r.flags?o(r.check,p,I,e.next_out-I):i(r.check,p,I,e.next_out-I)),e.data_type=r.bits+(r.last?64:0)+(12===r.mode?128:0)+(20===r.mode||15===r.mode?256:0),(0==x&&0===I||4===t)&&L===u&&(L=-5),L)},r.inflateEnd=function(e){if(!e||!e.state)return f;var t=e.state;return t.window&&(t.window=null),e.state=null,u},r.inflateGetHeader=function(e,t){var r;return e&&e.state?0==(2&(r=e.state).wrap)?f:((r.head=t).done=!1,u):f},r.inflateSetDictionary=function(e,t){var r,n=t.length;return e&&e.state?0!==(r=e.state).wrap&&11!==r.mode?f:11===r.mode&&i(1,t,n,0)!==r.check?-3:S(e,t,n,n)?(r.mode=31,-4):(r.havedict=1,u):f},r.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(e,t,r){var n=e("../utils/common"),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],a=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],s=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,r,l,c,u,f,d){var h,p,m,g,y,v,b,w,_,x=d.bits,I=0,k=0,S=0,E=0,A=0,T=0,P=0,O=0,F=0,R=0,C=null,z=0,D=new n.Buf16(16),L=new n.Buf16(16),U=null,B=0;for(I=0;I<=15;I++)D[I]=0;for(k=0;k<l;k++)D[t[r+k]]++;for(A=x,E=15;1<=E&&0===D[E];E--);if(E<A&&(A=E),0===E)return c[u++]=20971520,c[u++]=20971520,d.bits=1,0;for(S=1;S<E&&0===D[S];S++);for(A<S&&(A=S),I=O=1;I<=15;I++)if(O<<=1,(O-=D[I])<0)return-1;if(0<O&&(0===e||1!==E))return-1;for(L[1]=0,I=1;I<15;I++)L[I+1]=L[I]+D[I];for(k=0;k<l;k++)0!==t[r+k]&&(f[L[t[r+k]]++]=k);if(v=0===e?(C=U=f,19):1===e?(C=i,z-=257,U=o,B-=257,256):(C=a,U=s,-1),I=S,y=u,P=k=R=0,m=-1,g=(F=1<<(T=A))-1,1===e&&852<F||2===e&&592<F)return 1;for(;;){for(b=I-P,_=f[k]<v?(w=0,f[k]):f[k]>v?(w=U[B+f[k]],C[z+f[k]]):(w=96,0),h=1<<I-P,S=p=1<<T;c[y+(R>>P)+(p-=h)]=b<<24|w<<16|_|0,0!==p;);for(h=1<<I-1;R&h;)h>>=1;if(0!==h?(R&=h-1,R+=h):R=0,k++,0==--D[I]){if(I===E)break;I=t[r+f[k]]}if(A<I&&(R&g)!==m){for(0===P&&(P=A),y+=S,O=1<<(T=I-P);T+P<E&&!((O-=D[T+P])<=0);)T++,O<<=1;if(F+=1<<T,1===e&&852<F||2===e&&592<F)return 1;c[m=R&g]=A<<24|T<<16|y-u|0}}return 0!==R&&(c[y+R]=I-P<<24|64<<16|0),d.bits=A,0}},{"../utils/common":41}],51:[function(e,t,r){t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(e,t,r){var n=e("../utils/common"),i=0,o=1;function a(e){for(var t=e.length;0<=--t;)e[t]=0}var s=0,l=29,c=256,u=c+1+l,f=30,d=19,h=2*u+1,p=15,m=16,g=7,y=256,v=16,b=17,w=18,_=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],x=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],I=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],k=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S=new Array(2*(u+2));a(S);var E=new Array(2*f);a(E);var A=new Array(512);a(A);var T=new Array(256);a(T);var P=new Array(l);a(P);var O,F,R,C=new Array(f);function z(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function D(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function L(e){return e<256?A[e]:A[256+(e>>>7)]}function U(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function B(e,t,r){e.bi_valid>m-r?(e.bi_buf|=t<<e.bi_valid&65535,U(e,e.bi_buf),e.bi_buf=t>>m-e.bi_valid,e.bi_valid+=r-m):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function N(e,t,r){B(e,r[2*t],r[2*t+1])}function j(e,t){for(var r=0;r|=1&e,e>>>=1,r<<=1,0<--t;);return r>>>1}function M(e,t,r){var n,i,o=new Array(p+1),a=0;for(n=1;n<=p;n++)o[n]=a=a+r[n-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=j(o[s]++,s))}}function W(e){var t;for(t=0;t<u;t++)e.dyn_ltree[2*t]=0;for(t=0;t<f;t++)e.dyn_dtree[2*t]=0;for(t=0;t<d;t++)e.bl_tree[2*t]=0;e.dyn_ltree[2*y]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function V(e){8<e.bi_valid?U(e,e.bi_buf):0<e.bi_valid&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function G(e,t,r,n){var i=2*t,o=2*r;return e[i]<e[o]||e[i]===e[o]&&n[t]<=n[r]}function Z(e,t,r){for(var n=e.heap[r],i=r<<1;i<=e.heap_len&&(i<e.heap_len&&G(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!G(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n}function q(e,t,r){var n,i,o,a,s=0;if(0!==e.last_lit)for(;n=e.pending_buf[e.d_buf+2*s]<<8|e.pending_buf[e.d_buf+2*s+1],i=e.pending_buf[e.l_buf+s],s++,0===n?N(e,i,t):(N(e,(o=T[i])+c+1,t),0!==(a=_[o])&&B(e,i-=P[o],a),N(e,o=L(--n),r),0!==(a=x[o])&&B(e,n-=C[o],a)),s<e.last_lit;);N(e,y,t)}function $(e,t){var r,n,i,o=t.dyn_tree,a=t.stat_desc.static_tree,s=t.stat_desc.has_stree,l=t.stat_desc.elems,c=-1;for(e.heap_len=0,e.heap_max=h,r=0;r<l;r++)0!==o[2*r]?(e.heap[++e.heap_len]=c=r,e.depth[r]=0):o[2*r+1]=0;for(;e.heap_len<2;)o[2*(i=e.heap[++e.heap_len]=c<2?++c:0)]=1,e.depth[i]=0,e.opt_len--,s&&(e.static_len-=a[2*i+1]);for(t.max_code=c,r=e.heap_len>>1;1<=r;r--)Z(e,o,r);for(i=l;r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Z(e,o,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,o[2*i]=o[2*r]+o[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,o[2*r+1]=o[2*n+1]=i,e.heap[1]=i++,Z(e,o,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,o,a,s,l=t.dyn_tree,c=t.max_code,u=t.stat_desc.static_tree,f=t.stat_desc.has_stree,d=t.stat_desc.extra_bits,m=t.stat_desc.extra_base,g=t.stat_desc.max_length,y=0;for(o=0;o<=p;o++)e.bl_count[o]=0;for(l[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<h;r++)g<(o=l[2*l[2*(n=e.heap[r])+1]+1]+1)&&(o=g,y++),l[2*n+1]=o,c<n||(e.bl_count[o]++,a=0,m<=n&&(a=d[n-m]),s=l[2*n],e.opt_len+=s*(o+a),f&&(e.static_len+=s*(u[2*n+1]+a)));if(0!==y){do{for(o=g-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[g]--,y-=2}while(0<y);for(o=g;0!==o;o--)for(n=e.bl_count[o];0!==n;)c<(i=e.heap[--r])||(l[2*i+1]!==o&&(e.opt_len+=(o-l[2*i+1])*l[2*i],l[2*i+1]=o),n--)}}(e,t),M(o,c,e.bl_count)}function Y(e,t,r){var n,i,o=-1,a=t[1],s=0,l=7,c=4;for(0===a&&(l=138,c=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=a,a=t[2*(n+1)+1],++s<l&&i===a||(s<c?e.bl_tree[2*i]+=s:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[2*v]++):s<=10?e.bl_tree[2*b]++:e.bl_tree[2*w]++,o=i,c=(s=0)===a?(l=138,3):i===a?(l=6,3):(l=7,4))}function H(e,t,r){var n,i,o=-1,a=t[1],s=0,l=7,c=4;for(0===a&&(l=138,c=3),n=0;n<=r;n++)if(i=a,a=t[2*(n+1)+1],!(++s<l&&i===a)){if(s<c)for(;N(e,i,e.bl_tree),0!=--s;);else 0!==i?(i!==o&&(N(e,i,e.bl_tree),s--),N(e,v,e.bl_tree),B(e,s-3,2)):s<=10?(N(e,b,e.bl_tree),B(e,s-3,3)):(N(e,w,e.bl_tree),B(e,s-11,7));o=i,c=(s=0)===a?(l=138,3):i===a?(l=6,3):(l=7,4)}}a(C);var J=!1;function K(e,t,r,i){B(e,(s<<1)+(i?1:0),3),function(e,t,r,i){V(e),i&&(U(e,r),U(e,~r)),n.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}(e,t,r,!0)}r._tr_init=function(e){J||(function(){var e,t,r,n,i,o=new Array(p+1);for(n=r=0;n<l-1;n++)for(P[n]=r,e=0;e<1<<_[n];e++)T[r++]=n;for(T[r-1]=n,n=i=0;n<16;n++)for(C[n]=i,e=0;e<1<<x[n];e++)A[i++]=n;for(i>>=7;n<f;n++)for(C[n]=i<<7,e=0;e<1<<x[n]-7;e++)A[256+i++]=n;for(t=0;t<=p;t++)o[t]=0;for(e=0;e<=143;)S[2*e+1]=8,e++,o[8]++;for(;e<=255;)S[2*e+1]=9,e++,o[9]++;for(;e<=279;)S[2*e+1]=7,e++,o[7]++;for(;e<=287;)S[2*e+1]=8,e++,o[8]++;for(M(S,u+1,o),e=0;e<f;e++)E[2*e+1]=5,E[2*e]=j(e,5);O=new z(S,_,c+1,u,p),F=new z(E,x,0,f,p),R=new z(new Array(0),I,0,d,g)}(),J=!0),e.l_desc=new D(e.dyn_ltree,O),e.d_desc=new D(e.dyn_dtree,F),e.bl_desc=new D(e.bl_tree,R),e.bi_buf=0,e.bi_valid=0,W(e)},r._tr_stored_block=K,r._tr_flush_block=function(e,t,r,n){var a,s,l=0;0<e.level?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return i;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return o;for(t=32;t<c;t++)if(0!==e.dyn_ltree[2*t])return o;return i}(e)),$(e,e.l_desc),$(e,e.d_desc),l=function(e){var t;for(Y(e,e.dyn_ltree,e.l_desc.max_code),Y(e,e.dyn_dtree,e.d_desc.max_code),$(e,e.bl_desc),t=d-1;3<=t&&0===e.bl_tree[2*k[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),a=e.opt_len+3+7>>>3,(s=e.static_len+3+7>>>3)<=a&&(a=s)):a=s=r+5,r+4<=a&&-1!==t?K(e,t,r,n):4===e.strategy||s===a?(B(e,2+(n?1:0),3),q(e,S,E)):(B(e,4+(n?1:0),3),function(e,t,r,n){var i;for(B(e,t-257,5),B(e,r-1,5),B(e,n-4,4),i=0;i<n;i++)B(e,e.bl_tree[2*k[i]+1],3);H(e,e.dyn_ltree,t-1),H(e,e.dyn_dtree,r-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,l+1),q(e,e.dyn_ltree,e.dyn_dtree)),W(e),n&&V(e)},r._tr_tally=function(e,t,r){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(T[r]+c+1)]++,e.dyn_dtree[2*L(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){B(e,2,3),N(e,y,S),function(e){16===e.bi_valid?(U(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":41}],53:[function(e,t,r){t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,t,r){t.exports="function"==typeof setImmediate?setImmediate:function(){var e=[].slice.apply(arguments);e.splice(1,0,0),setTimeout.apply(null,e)}},{}]},{},[10])(10)}(de);var he=de.exports;var pe,me,ge=Function.prototype,ye=Object.prototype,ve=ge.toString,be=ye.hasOwnProperty,we=ve.call(Object),_e=ye.toString,xe=(pe=Object.getPrototypeOf,me=Object,function(e){return pe(me(e))});var Ie=function(e){if(!function(e){return!!e&&"object"==typeof e}(e)||"[object Object]"!=_e.call(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e))return!1;var t=xe(e);if(null===t)return!0;var r=be.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&ve.call(r)==we},ke={exports:{}},Se={},Ee={exports:{}},Ae={};function Te(){var e={"align-content":!1,"align-items":!1,"align-self":!1,"alignment-adjust":!1,"alignment-baseline":!1,all:!1,"anchor-point":!1,animation:!1,"animation-delay":!1,"animation-direction":!1,"animation-duration":!1,"animation-fill-mode":!1,"animation-iteration-count":!1,"animation-name":!1,"animation-play-state":!1,"animation-timing-function":!1,azimuth:!1,"backface-visibility":!1,background:!0,"background-attachment":!0,"background-clip":!0,"background-color":!0,"background-image":!0,"background-origin":!0,"background-position":!0,"background-repeat":!0,"background-size":!0,"baseline-shift":!1,binding:!1,bleed:!1,"bookmark-label":!1,"bookmark-level":!1,"bookmark-state":!1,border:!0,"border-bottom":!0,"border-bottom-color":!0,"border-bottom-left-radius":!0,"border-bottom-right-radius":!0,"border-bottom-style":!0,"border-bottom-width":!0,"border-collapse":!0,"border-color":!0,"border-image":!0,"border-image-outset":!0,"border-image-repeat":!0,"border-image-slice":!0,"border-image-source":!0,"border-image-width":!0,"border-left":!0,"border-left-color":!0,"border-left-style":!0,"border-left-width":!0,"border-radius":!0,"border-right":!0,"border-right-color":!0,"border-right-style":!0,"border-right-width":!0,"border-spacing":!0,"border-style":!0,"border-top":!0,"border-top-color":!0,"border-top-left-radius":!0,"border-top-right-radius":!0,"border-top-style":!0,"border-top-width":!0,"border-width":!0,bottom:!1,"box-decoration-break":!0,"box-shadow":!0,"box-sizing":!0,"box-snap":!0,"box-suppress":!0,"break-after":!0,"break-before":!0,"break-inside":!0,"caption-side":!1,chains:!1,clear:!0,clip:!1,"clip-path":!1,"clip-rule":!1,color:!0,"color-interpolation-filters":!0,"column-count":!1,"column-fill":!1,"column-gap":!1,"column-rule":!1,"column-rule-color":!1,"column-rule-style":!1,"column-rule-width":!1,"column-span":!1,"column-width":!1,columns:!1,contain:!1,content:!1,"counter-increment":!1,"counter-reset":!1,"counter-set":!1,crop:!1,cue:!1,"cue-after":!1,"cue-before":!1,cursor:!1,direction:!1,display:!0,"display-inside":!0,"display-list":!0,"display-outside":!0,"dominant-baseline":!1,elevation:!1,"empty-cells":!1,filter:!1,flex:!1,"flex-basis":!1,"flex-direction":!1,"flex-flow":!1,"flex-grow":!1,"flex-shrink":!1,"flex-wrap":!1,float:!1,"float-offset":!1,"flood-color":!1,"flood-opacity":!1,"flow-from":!1,"flow-into":!1,font:!0,"font-family":!0,"font-feature-settings":!0,"font-kerning":!0,"font-language-override":!0,"font-size":!0,"font-size-adjust":!0,"font-stretch":!0,"font-style":!0,"font-synthesis":!0,"font-variant":!0,"font-variant-alternates":!0,"font-variant-caps":!0,"font-variant-east-asian":!0,"font-variant-ligatures":!0,"font-variant-numeric":!0,"font-variant-position":!0,"font-weight":!0,grid:!1,"grid-area":!1,"grid-auto-columns":!1,"grid-auto-flow":!1,"grid-auto-rows":!1,"grid-column":!1,"grid-column-end":!1,"grid-column-start":!1,"grid-row":!1,"grid-row-end":!1,"grid-row-start":!1,"grid-template":!1,"grid-template-areas":!1,"grid-template-columns":!1,"grid-template-rows":!1,"hanging-punctuation":!1,height:!0,hyphens:!1,icon:!1,"image-orientation":!1,"image-resolution":!1,"ime-mode":!1,"initial-letters":!1,"inline-box-align":!1,"justify-content":!1,"justify-items":!1,"justify-self":!1,left:!1,"letter-spacing":!0,"lighting-color":!0,"line-box-contain":!1,"line-break":!1,"line-grid":!1,"line-height":!1,"line-snap":!1,"line-stacking":!1,"line-stacking-ruby":!1,"line-stacking-shift":!1,"line-stacking-strategy":!1,"list-style":!0,"list-style-image":!0,"list-style-position":!0,"list-style-type":!0,margin:!0,"margin-bottom":!0,"margin-left":!0,"margin-right":!0,"margin-top":!0,"marker-offset":!1,"marker-side":!1,marks:!1,mask:!1,"mask-box":!1,"mask-box-outset":!1,"mask-box-repeat":!1,"mask-box-slice":!1,"mask-box-source":!1,"mask-box-width":!1,"mask-clip":!1,"mask-image":!1,"mask-origin":!1,"mask-position":!1,"mask-repeat":!1,"mask-size":!1,"mask-source-type":!1,"mask-type":!1,"max-height":!0,"max-lines":!1,"max-width":!0,"min-height":!0,"min-width":!0,"move-to":!1,"nav-down":!1,"nav-index":!1,"nav-left":!1,"nav-right":!1,"nav-up":!1,"object-fit":!1,"object-position":!1,opacity:!1,order:!1,orphans:!1,outline:!1,"outline-color":!1,"outline-offset":!1,"outline-style":!1,"outline-width":!1,overflow:!1,"overflow-wrap":!1,"overflow-x":!1,"overflow-y":!1,padding:!0,"padding-bottom":!0,"padding-left":!0,"padding-right":!0,"padding-top":!0,page:!1,"page-break-after":!1,"page-break-before":!1,"page-break-inside":!1,"page-policy":!1,pause:!1,"pause-after":!1,"pause-before":!1,perspective:!1,"perspective-origin":!1,pitch:!1,"pitch-range":!1,"play-during":!1,position:!1,"presentation-level":!1,quotes:!1,"region-fragment":!1,resize:!1,rest:!1,"rest-after":!1,"rest-before":!1,richness:!1,right:!1,rotation:!1,"rotation-point":!1,"ruby-align":!1,"ruby-merge":!1,"ruby-position":!1,"shape-image-threshold":!1,"shape-outside":!1,"shape-margin":!1,size:!1,speak:!1,"speak-as":!1,"speak-header":!1,"speak-numeral":!1,"speak-punctuation":!1,"speech-rate":!1,stress:!1,"string-set":!1,"tab-size":!1,"table-layout":!1,"text-align":!0,"text-align-last":!0,"text-combine-upright":!0,"text-decoration":!0,"text-decoration-color":!0,"text-decoration-line":!0,"text-decoration-skip":!0,"text-decoration-style":!0,"text-emphasis":!0,"text-emphasis-color":!0,"text-emphasis-position":!0,"text-emphasis-style":!0,"text-height":!0,"text-indent":!0,"text-justify":!0,"text-orientation":!0,"text-overflow":!0,"text-shadow":!0,"text-space-collapse":!0,"text-transform":!0,"text-underline-position":!0,"text-wrap":!0,top:!1,transform:!1,"transform-origin":!1,"transform-style":!1,transition:!1,"transition-delay":!1,"transition-duration":!1,"transition-property":!1,"transition-timing-function":!1,"unicode-bidi":!1,"vertical-align":!1,visibility:!1,"voice-balance":!1,"voice-duration":!1,"voice-family":!1,"voice-pitch":!1,"voice-range":!1,"voice-rate":!1,"voice-stress":!1,"voice-volume":!1,volume:!1,"white-space":!1,widows:!1,width:!0,"will-change":!1,"word-break":!0,"word-spacing":!0,"word-wrap":!0,"wrap-flow":!1,"wrap-through":!1,"writing-mode":!1,"z-index":!1};return e}var Pe=/javascript\s*\:/gim;Ae.whiteList=Te(),Ae.getDefaultWhiteList=Te,Ae.onAttr=function(e,t,r){},Ae.onIgnoreAttr=function(e,t,r){},Ae.safeAttrValue=function(e,t){return Pe.test(t)?"":t};var Oe={indexOf:function(e,t){var r,n;if(Array.prototype.indexOf)return e.indexOf(t);for(r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1},forEach:function(e,t,r){var n,i;if(Array.prototype.forEach)return e.forEach(t,r);for(n=0,i=e.length;n<i;n++)t.call(r,e[n],n,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},trimRight:function(e){return String.prototype.trimRight?e.trimRight():e.replace(/(\s*$)/g,"")}};var Fe=function(e,t){";"!==(e=Oe.trimRight(e))[e.length-1]&&(e+=";");var r=e.length,n=!1,i=0,o=0,a="";function s(){if(!n){var r=Oe.trim(e.slice(i,o)),s=r.indexOf(":");if(-1!==s){var l=Oe.trim(r.slice(0,s)),c=Oe.trim(r.slice(s+1));if(l){var u=t(i,a.length,l,c,r);u&&(a+=u+"; ")}}}i=o+1}for(;o<r;o++){var l=e[o];if("/"===l&&"*"===e[o+1]){var c=e.indexOf("*/",o+2);if(-1===c)break;i=(o=c+1)+1,n=!1}else"("===l?n=!0:")"===l?n=!1:";"===l?n||s():"\n"===l&&s()}return Oe.trim(a)},Re=Ae,Ce=Fe;function ze(e){return null==e}function De(e){(e=function(e){var t={};for(var r in e)t[r]=e[r];return t}(e||{})).whiteList=e.whiteList||Re.whiteList,e.onAttr=e.onAttr||Re.onAttr,e.onIgnoreAttr=e.onIgnoreAttr||Re.onIgnoreAttr,e.safeAttrValue=e.safeAttrValue||Re.safeAttrValue,this.options=e}De.prototype.process=function(e){if(!(e=(e=e||"").toString()))return"";var t=this.options,r=t.whiteList,n=t.onAttr,i=t.onIgnoreAttr,o=t.safeAttrValue;return Ce(e,(function(e,t,a,s,l){var c=r[a],u=!1;if(!0===c?u=c:"function"==typeof c?u=c(s):c instanceof RegExp&&(u=c.test(s)),!0!==u&&(u=!1),s=o(a,s)){var f,d={position:t,sourcePosition:e,source:l,isWhite:u};return u?ze(f=n(a,s,d))?a+":"+s:f:ze(f=i(a,s,d))?void 0:f}}))};var Le=De;!function(e,t){var r=Ae,n=Le;for(var i in(t=e.exports=function(e,t){return new n(t).process(e)}).FilterCSS=n,r)t[i]=r[i]}(Ee,Ee.exports);var Ue={indexOf:function(e,t){var r,n;if(Array.prototype.indexOf)return e.indexOf(t);for(r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1},forEach:function(e,t,r){var n,i;if(Array.prototype.forEach)return e.forEach(t,r);for(n=0,i=e.length;n<i;n++)t.call(r,e[n],n,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},spaceIndex:function(e){var t=/\s|\n|\t/.exec(e);return t?t.index:-1}},Be=Ee.exports.FilterCSS,Ne=Ee.exports.getDefaultWhiteList,je=Ue;function Me(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height"],ins:["datetime"],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}}var We=new Be;function Ve(e){return e.replace(Ge,"<").replace(Ze,">")}var Ge=/</g,Ze=/>/g,qe=/"/g,$e=/"/g,Ye=/&#([a-zA-Z0-9]*);?/gim,He=/:?/gim,Je=/&newline;?/gim,Ke=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a)\:/gi,Xe=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,Qe=/u\s*r\s*l\s*\(.*/gi;function et(e){return e.replace(qe,""")}function tt(e){return e.replace($e,'"')}function rt(e){return e.replace(Ye,(function(e,t){return"x"===t[0]||"X"===t[0]?String.fromCharCode(parseInt(t.substr(1),16)):String.fromCharCode(parseInt(t,10))}))}function nt(e){return e.replace(He,":").replace(Je," ")}function it(e){for(var t="",r=0,n=e.length;r<n;r++)t+=e.charCodeAt(r)<32?" ":e.charAt(r);return je.trim(t)}function ot(e){return e=it(e=nt(e=rt(e=tt(e))))}function at(e){return e=Ve(e=et(e))}Se.whiteList={a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height"],ins:["datetime"],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]},Se.getDefaultWhiteList=Me,Se.onTag=function(e,t,r){},Se.onIgnoreTag=function(e,t,r){},Se.onTagAttr=function(e,t,r){},Se.onIgnoreTagAttr=function(e,t,r){},Se.safeAttrValue=function(e,t,r,n){if(r=ot(r),"href"===t||"src"===t){if("#"===(r=je.trim(r)))return"#";if("http://"!==r.substr(0,7)&&"https://"!==r.substr(0,8)&&"mailto:"!==r.substr(0,7)&&"tel:"!==r.substr(0,4)&&"data:image/"!==r.substr(0,11)&&"ftp://"!==r.substr(0,6)&&"./"!==r.substr(0,2)&&"../"!==r.substr(0,3)&&"#"!==r[0]&&"/"!==r[0])return""}else if("background"===t){if(Ke.lastIndex=0,Ke.test(r))return""}else if("style"===t){if(Xe.lastIndex=0,Xe.test(r))return"";if(Qe.lastIndex=0,Qe.test(r)&&(Ke.lastIndex=0,Ke.test(r)))return"";!1!==n&&(r=(n=n||We).process(r))}return r=at(r)},Se.escapeHtml=Ve,Se.escapeQuote=et,Se.unescapeQuote=tt,Se.escapeHtmlEntities=rt,Se.escapeDangerHtml5Entities=nt,Se.clearNonPrintableCharacter=it,Se.friendlyAttrValue=ot,Se.escapeAttrValue=at,Se.onIgnoreTagStripAll=function(){return""},Se.StripTagBody=function(e,t){"function"!=typeof t&&(t=function(){});var r=!Array.isArray(e),n=[],i=!1;return{onIgnoreTag:function(o,a,s){if(function(t){return!!r||-1!==je.indexOf(e,t)}(o)){if(s.isClosing){var l="[/removed]",c=s.position+l.length;return n.push([!1!==i?i:s.position,c]),i=!1,l}return i||(i=s.position),"[removed]"}return t(o,a,s)},remove:function(e){var t="",r=0;return je.forEach(n,(function(n){t+=e.slice(r,n[0]),r=n[1]})),t+=e.slice(r)}}},Se.stripCommentTag=function(e){for(var t="",r=0;r<e.length;){var n=e.indexOf("\x3c!--",r);if(-1===n){t+=e.slice(r);break}t+=e.slice(r,n);var i=e.indexOf("--\x3e",n);if(-1===i)break;r=i+3}return t},Se.stripBlankChar=function(e){var t=e.split("");return(t=t.filter((function(e){var t=e.charCodeAt(0);return 127!==t&&(!(t<=31)||(10===t||13===t))}))).join("")},Se.cssFilter=We,Se.getDefaultCSSWhiteList=Ne;var st={},lt=Ue;function ct(e){var t=lt.spaceIndex(e);if(-1===t)var r=e.slice(1,-1);else r=e.slice(1,t+1);return"/"===(r=lt.trim(r).toLowerCase()).slice(0,1)&&(r=r.slice(1)),"/"===r.slice(-1)&&(r=r.slice(0,-1)),r}function ut(e){return"</"===e.slice(0,2)}var ft=/[^a-zA-Z0-9_:\.\-]/gim;function dt(e,t){for(;t<e.length;t++){var r=e[t];if(" "!==r)return"="===r?t:-1}}function ht(e,t){for(;t>0;t--){var r=e[t];if(" "!==r)return"="===r?t:-1}}function pt(e){return function(e){return'"'===e[0]&&'"'===e[e.length-1]||"'"===e[0]&&"'"===e[e.length-1]}(e)?e.substr(1,e.length-2):e}st.parseTag=function(e,t,r){var n="",i=0,o=!1,a=!1,s=0,l=e.length,c="",u="";e:for(s=0;s<l;s++){var f=e.charAt(s);if(!1===o){if("<"===f){o=s;continue}}else if(!1===a){if("<"===f){n+=r(e.slice(i,s)),o=s,i=s;continue}if(">"===f){n+=r(e.slice(i,o)),c=ct(u=e.slice(o,s+1)),n+=t(o,n.length,c,u,ut(u)),i=s+1,o=!1;continue}if('"'===f||"'"===f)for(var d=1,h=e.charAt(s-d);""===h.trim()||"="===h;){if("="===h){a=f;continue e}h=e.charAt(s-++d)}}else if(f===a){a=!1;continue}}return i<e.length&&(n+=r(e.substr(i))),n},st.parseAttr=function(e,t){var r=0,n=[],i=!1,o=e.length;function a(e,r){if(!((e=(e=lt.trim(e)).replace(ft,"").toLowerCase()).length<1)){var i=t(e,r||"");i&&n.push(i)}}for(var s=0;s<o;s++){var l,c=e.charAt(s);if(!1!==i||"="!==c)if(!1===i||s!==r||'"'!==c&&"'"!==c||"="!==e.charAt(s-1))if(/\s|\n|\t/.test(c)){if(e=e.replace(/\s|\n|\t/g," "),!1===i){if(-1===(l=dt(e,s))){a(lt.trim(e.slice(r,s))),i=!1,r=s+1;continue}s=l-1;continue}if(-1===(l=ht(e,s-1))){a(i,pt(lt.trim(e.slice(r,s)))),i=!1,r=s+1;continue}}else;else{if(-1===(l=e.indexOf(c,s+1)))break;a(i,lt.trim(e.slice(r+1,l))),i=!1,r=(s=l)+1}else i=e.slice(r,s),r=s+1}return r<e.length&&(!1===i?a(e.slice(r)):a(i,pt(lt.trim(e.slice(r))))),lt.trim(n.join(" "))};var mt=Ee.exports.FilterCSS,gt=Se,yt=st,vt=yt.parseTag,bt=yt.parseAttr,wt=Ue;function _t(e){return null==e}function xt(e){(e=function(e){var t={};for(var r in e)t[r]=e[r];return t}(e||{})).stripIgnoreTag&&(e.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),e.onIgnoreTag=gt.onIgnoreTagStripAll),e.whiteList=e.whiteList||gt.whiteList,e.onTag=e.onTag||gt.onTag,e.onTagAttr=e.onTagAttr||gt.onTagAttr,e.onIgnoreTag=e.onIgnoreTag||gt.onIgnoreTag,e.onIgnoreTagAttr=e.onIgnoreTagAttr||gt.onIgnoreTagAttr,e.safeAttrValue=e.safeAttrValue||gt.safeAttrValue,e.escapeHtml=e.escapeHtml||gt.escapeHtml,this.options=e,!1===e.css?this.cssFilter=!1:(e.css=e.css||{},this.cssFilter=new mt(e.css))}xt.prototype.process=function(e){if(!(e=(e=e||"").toString()))return"";var t=this.options,r=t.whiteList,n=t.onTag,i=t.onIgnoreTag,o=t.onTagAttr,a=t.onIgnoreTagAttr,s=t.safeAttrValue,l=t.escapeHtml,c=this.cssFilter;t.stripBlankChar&&(e=gt.stripBlankChar(e)),t.allowCommentTag||(e=gt.stripCommentTag(e));var u=!1;if(t.stripIgnoreTagBody){u=gt.StripTagBody(t.stripIgnoreTagBody,i);i=u.onIgnoreTag}var f=vt(e,(function(e,t,u,f,d){var h,p={sourcePosition:e,position:t,isClosing:d,isWhite:r.hasOwnProperty(u)};if(!_t(h=n(u,f,p)))return h;if(p.isWhite){if(p.isClosing)return"</"+u+">";var m=function(e){var t=wt.spaceIndex(e);if(-1===t)return{html:"",closing:"/"===e[e.length-2]};var r="/"===(e=wt.trim(e.slice(t+1,-1)))[e.length-1];return r&&(e=wt.trim(e.slice(0,-1))),{html:e,closing:r}}(f),g=r[u],y=bt(m.html,(function(e,t){var r,n=-1!==wt.indexOf(g,e);return _t(r=o(u,e,t,n))?n?(t=s(u,e,t,c))?e+'="'+t+'"':e:_t(r=a(u,e,t,n))?void 0:r:r}));f="<"+u;return y&&(f+=" "+y),m.closing&&(f+=" /"),f+=">"}return _t(h=i(u,f,p))?l(f):h}),l);return u&&(f=u.remove(f)),f};var It=xt;!function(e,t){var r=Se,n=st,i=It;function o(e,t){return new i(t).process(e)}for(var a in(t=e.exports=o).filterXSS=o,t.FilterXSS=i,r)t[a]=r[a];for(var a in n)t[a]=n[a];"undefined"!=typeof self&&"undefined"!=typeof DedicatedWorkerGlobalScope&&self instanceof DedicatedWorkerGlobalScope&&(self.filterXSS=e.exports)}(ke,ke.exports);var kt=function(){function e(e,t){var r,n=this;this.arcgisWhiteList={a:["href","target","style"],abbr:["title"],img:["src","width","height","border","alt","style"],video:["autoplay","controls","height","loop","muted","poster","preload","width"],audio:["autoplay","controls","loop","muted","preload"],source:["media","src","type"],span:["style"],table:["width","height","cellpadding","cellspacing","border","style"],div:["style","align"],font:["size","color","style","face"],tr:["height","valign","align","style"],td:["height","width","valign","align","colspan","rowspan","nowrap","style"],th:["height","width","valign","align","colspan","rowspan","nowrap","style"],p:["style"],b:[],strong:[],i:[],em:[],u:[],br:[],li:[],ul:[],ol:[],hr:[],tbody:[]},this.allowedProtocols=["http","https","mailto","iform","tel","flow","lfmobile","arcgis-navigator","arcgis-appstudio-player","arcgis-survey123","arcgis-collector","arcgis-workforce","arcgis-explorer","arcgis-trek2there","arcgis-quickcapture","mspbi","comgooglemaps","pdfefile","pdfehttp","pdfehttps","boxapp","boxemm","awb","awbs","gropen","radarscope"],this.arcgisFilterOptions={allowCommentTag:!0,safeAttrValue:function(e,t,r,i){return"a"===e&&"href"===t||("img"===e||"source"===e)&&"src"===t?n.sanitizeUrl(r):ke.exports.safeAttrValue(e,t,r,i)}},e&&!t?r=e:e&&t?(r=Object.create(this.arcgisFilterOptions),Object.keys(e).forEach((function(t){"whiteList"===t?r.whiteList=n._extendObjectOfArrays([n.arcgisWhiteList,e.whiteList||{}]):r[t]=e[t]}))):(r=Object.create(this.arcgisFilterOptions)).whiteList=this.arcgisWhiteList,this.xssFilterOptions=r,this._xssFilter=new ke.exports.FilterXSS(r)}return e.prototype.sanitize=function(e,t){switch(void 0===t&&(t={}),typeof e){case"number":return isNaN(e)||!isFinite(e)?null:e;case"boolean":return e;case"string":return this._xssFilter.process(e);case"object":return this._iterateOverObject(e,t);default:if(t.allowUndefined&&void 0===e)return;return null}},e.prototype.sanitizeUrl=function(e){var t=this._trim(e.substring(0,e.indexOf(":")));return"/"===e||"#"===e||"#"===e[0]||this.allowedProtocols.indexOf(t.toLowerCase())>-1?ke.exports.escapeAttrValue(e):""},e.prototype.sanitizeHTMLAttribute=function(e,t,r,n){return"function"==typeof this.xssFilterOptions.safeAttrValue?this.xssFilterOptions.safeAttrValue(e,t,r,n):ke.exports.safeAttrValue(e,t,r,n)},e.prototype.validate=function(e,t){void 0===t&&(t={});var r=this.sanitize(e,t);return{isValid:e===r,sanitized:r}},e.prototype._extendObjectOfArrays=function(e){var t={};return e.forEach((function(e){Object.keys(e).forEach((function(r){Array.isArray(e[r])&&Array.isArray(t[r])?t[r]=t[r].concat(e[r]):t[r]=e[r]}))})),t},e.prototype._iterateOverObject=function(e,t){var r=this;void 0===t&&(t={});try{var n=!1,i=void 0;if(Array.isArray(e))i=e.reduce((function(e,i){var o=r.validate(i,t);return o.isValid?e.concat([i]):(n=!0,e.concat([o.sanitized]))}),[]);else{if(!Ie(e)){if(t.allowUndefined&&void 0===e)return;return null}i=Object.keys(e).reduce((function(i,o){var a=e[o],s=r.validate(a,t);return s.isValid?i[o]=a:(n=!0,i[o]=s.sanitized),i}),{})}return n?i:e}catch(e){return null}},e.prototype._trim=function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},e}();function St(e,t,r){return new Promise(((n,i)=>{const o=new he;let a=o;r&&(a=o.folder(r)),t.forEach((e=>a.file(e.name,e,{binary:!0}))),o.generateAsync({type:"blob"}).then((t=>n(Ot(t,e,"application/zip"))),i)}))}function Et(e,t){return t||(t=new kt),t.sanitize(e)}function At(e,t,r){let n;try{n=new File(e,t,r)}catch(i){n=function(){void 0===r&&(r={type:""});const n=new Blob(e,r);return n.lastModified=new Date,n.name=t,n}()}return n}function Tt(e,t){return e+(-1===e.indexOf("?")?"?":"&")+t}function Pt(e){return new Promise((t=>{Ft(e).then((e=>{try{t(JSON.parse(e))}catch(e){t(null)}}),(()=>t(null)))}))}function Ot(e,t,r){return e?At([e],t||"",{type:r||e.type}):null}function Ft(e){return new Promise((t=>{const r=new FileReader;r.onload=function(e){const r=e.target.result;t(r||"")},r.readAsText(e)}))}function Rt(e){return e?e.endsWith("/")?e:e+"/":e}function Ct(){return(Yt(.2777777777777778,.9999999999996456).toString(36)+"0000000").substr(2,8)}function zt(e){const t=JSON.stringify(e),r=[];for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return new Blob([new Uint8Array(r)],{type:"application/octet-stream"})}function Dt(e){let t={};if(Array.isArray(e))t=e.map(Dt);else if("object"==typeof e)if(e instanceof File){const r=e.type?{type:e.type}:void 0;t=new File([e],e.name,r)}else for(const r in e)null!=e[r]&&"object"==typeof e[r]?t[r]=Dt(e[r]):t[r]=e[r];else t=e;return t}function Lt(e,t){let r=[];const n=Jt(e),i=Jt(t);if(n!==i)("undefined"!==n&&"null"!==n||"null"!==i&&"undefined"!==i)&&r.push("Type difference: "+n+" vs. "+i);else if(e!==t)switch(n){case"boolean":case"number":r.push("Value difference: "+e+" vs. "+t);break;case"string":r.push('String difference: "'+e+'" vs. "'+t+'"');break;case"object":const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length||JSON.stringify(n)!==JSON.stringify(i))Array.isArray(e)&&Array.isArray(t)?r.push("Array length difference: ["+n.length+"] vs. ["+i.length+"]"):r.push("Props difference: "+JSON.stringify(n)+" vs. "+JSON.stringify(i));else for(let o=0;o<n.length;++o){const a=Lt(e[n[o]],t[i[o]]);a.length>0&&(r=r.concat(a))}}return r}function Ut(e,t){const r=t.split(".");if(Array.isArray(e))e.forEach((e=>Ut(e,t)));else{const n=r.slice(1).join(".");void 0!==e[r[0]]&&(1===r.length?delete e[t]:Ut(e[r[0]],n))}}function Bt(e,t){t.forEach((t=>{Ut(e,t)}))}function Nt(e){return e?{success:!1,error:e.response?.error||e.error||e}:{success:!1}}function jt(e){return $t(e,/({*)(\b[0-9A-F]{32}\b)/gi).reduce((function(e,t){return t.indexOf("{{")<0&&e.push(t.replace("{","")),e}),[])}function Mt(e,t){return t.split(".").reduce((function(e,t){return e?e[t]:void 0}),e)}function Wt(e,t){jt(e).forEach((e=>{-1===t.indexOf(e)&&t.push(e)}))}function Vt(e,t,r){const n=t.split(".");n.reduce(((e,t,i)=>i===n.length-1?(e[t]=r,r):(e[t]||(e[t]={}),e[t])),e)}function Gt(e,t,r){if(Mt(e,t)){const n=t.split(".");n.reduce(((e,t,i)=>i===n.length-1?(e[t]=r,r):e[t]),e)}}function Zt(e,t,r){e=e?e.trim():"_";const n=(Mt(t,r)||[]).map((e=>e.title));let i=e,o=0;for(;n.indexOf(i)>-1;)o++,i=e+" "+o;return i}function qt(e){return e?e.replace("{{","").replace(".itemId}}",""):e}function $t(e,t){return e&&t.test(e)?e.match(t):[]}function Yt(e,t){return Math.random()*(t-e)+e}function Ht(e,t){let r=e.toString();const n=t-r.length;return n>0&&(r="0".repeat(n)+r),r}function Jt(e){return null===e?"null":typeof e}var Kt=function(e,t,r){return void 0===r&&(r=void 0),t.split(".").reduce((function(e,t){return e?e[t]:r}),e)};function Xt(e,t){return Object.keys(e).reduce((function(r,n){return r[n]=t(e[n],n,e),r}),{})}function Qt(e,t,r){return r=r||"",Array.isArray(e)?e.map(n):!e||"object"!=typeof e||function(e){return e instanceof Date}(e)||function(e){return e instanceof RegExp}(e)||function(e){return"function"==typeof e}(e)?t(e,r):Object.assign({},e,Xt(e,n));function n(e,n){return Qt(e,t,r?r+"."+n:n)}}function er(e,t){return Array.isArray(e)?function(e){var t=e,r=e.reduce((function(e,t){if(nr(t)&&rr(t)){var r=tr(t);r>e&&(e=r)}return e}),-1);r>-1&&(t=0===r?[]:"{{delete:"+(r-1)+"}}");return t}(e.map(r).filter((function(e){return null!=e}))):e&&"object"==typeof e?function(e){var t,r={obj:{},maxLevel:-1},n=Object.keys(e).reduce((function(t,r){var n=e[r];if(nr(n)&&rr(n)){var i=tr(n);i>t.maxLevel&&(t.maxLevel=i)}else t.obj[r]=n;return t}),r);t=n.maxLevel>0?1===n.maxLevel?void 0:"{{delete:"+(n.maxLevel-1)+"}}":n.obj;return t}(Xt(e,r)):function(e){var t=e;"string"==typeof e&&rr(e)&&(t=function(e){var t=e,r=tr(e);t=0===r?void 0:"{{delete:"+r+"}}";return t}(e));return t}(e);function r(e,t){return er(e)}}var tr=function(e){return parseInt(e.replace(/{|}/g,"").split(":")[1])};function rr(e){return!(!e||"string"!=typeof e)&&e.indexOf("{{delete")>-1}var nr=function(e){return"string"==typeof e};function ir(e,t,r,n){void 0===n&&(n=0);var i=t;return t||(i="{{delete:"+n+"}}"),i}var or=function(e){var t={};if(Array.isArray(e))t=e.map(or);else if("object"==typeof e)for(var r in e)null!=e[r]&&"object"==typeof e[r]?t[r]=or(e[r]):t[r]=e[r];else t=e;return t},ar=/{{\s*?[\w].*?}}/g;function sr(e){return e||""===e||0===e}function lr(e,t,r){if(void 0===r&&(r=null),(r=or(r)||{}).optional)throw new Error("Please do not pass in an `optional` transform; adlib provides that internally.");r.optional=ir;var n=Qt(e,(function(e,n){if("string"!=typeof e)return e;var i,o=e.match(ar);if(o&&o.length){var a=o.map((function(e){var n=!1,i=e.replace(/{|}/g,"").trim();if(i.indexOf("||")>-1){var o=i.split("||").map((function(e){return e.trim()})),a=o.length;i=o.find((function(e,r){var i,o;return(i=t,o=e.split(":")[0],null!=Kt(i,o,null))?e:r+1===a&&(n=!0,isNaN(e)||(e=parseInt(e)),e)}))}var s={key:e,value:i};if(!n){var l=function(e,t,r){var n,i=e.split(":");if(i.length>1){var o,a=i[0],s=i[1];if(i[2]&&(o=i[2]),!r||!r[s]||"function"!=typeof r[s])throw new Error("Attempted to apply non-existant transform "+s+" on "+a+" with params "+e);n=Kt(t,a),n=r[s](a,n,t,o)}else n=Kt(t,e);return n}(i,t,r);s.value=sr(l)?l:e}return s}));return a.forEach((function(t){e===t.key?("string"==typeof t.value&&(isNaN(t.value)||""===t.value||(t.value.indexOf(".")>-1?t.value=parseFloat(t.value):t.value=parseInt(t.value))),i=t.value):e=e.replace(t.key,t.value)})),sr(i)?i:e}return e}));return er(n)}const cr="organization.helperServices.geocode:getDefaultLocatorURL",ur={getDefaultLocatorURL:(e,t)=>t?t[0].url:`{{${cr}}}`};function fr(e,t=""){return{itemId:e,type:t,key:Ct(),item:{id:e,type:t},data:{},resources:[],dependencies:[],groups:[],properties:{},estimatedDeploymentCostFactor:2}}function dr(e){let t=Mt(e,"metadata.version");return t?"string"==typeof t?(t=parseInt(e.metadata.version,10),isNaN(t)?0:t):t:0}function hr(e,t){const r=t;return e.findIndex((e=>r===e.itemId))}function pr(e,t){const r=hr(e,t);return r>=0?e[r]:null}function mr(e){return(t=e,t&&JSON.stringify(t).match(/{{.+?}}/gim)||[]).length>0;var t}function gr(e){const t=e.extent;return null===t||Array.isArray(t)&&0===t.length?t:"{{solutionItemExtent}}"}function yr(e,t){return lr(e,t,ur)}function vr(e,t,r=""){if(!e)return e;const n=new RegExp(t,"g");return e.replace(n,"{{"+t+r+"}}")}function br(e,t){return t.startsWith("{{")?t:String(vr(e,e,"."+String(t).toLowerCase()))}function wr(e){let t=JSON.stringify(e);const n=/[0-9A-F]{32}/gim;if(e&&n.test(t)){t.match(n).filter(r.unique).forEach((e=>{const r=new RegExp(e,"gm");t=t.replace(r,"{{"+e+".itemId}}")})),e=JSON.parse(t)}return e}function _r(e,t,r={}){if(!e)return Promise.reject("Url must be provided");const n={authentication:t,rawResponse:!0,...r};return i.request(e,n).then((e=>e.blob()))}function xr(e){return e.getUser()}function Ir(e,t,r,n=[],i){return new Promise(((o,a)=>{kr(e,r,n).then((e=>o(e?Ot(e,t,i):null)),a)}))}function kr(e,t,r=[]){return new Promise(((n,i)=>{_r(e,t).then((e=>{Gr(e).then((e=>{"application/json"===e.type?Pt(e).then((t=>{if(t?.error){const e=t.error.code;void 0!==e&&r.indexOf(e)>=0?n(null):i(t)}else n(e)})):n(e)}),i)}),i)}))}function Sr(e,t){const r={authentication:t};return n.getItem(e,r)}function Er(e,t,r){return new Promise((n=>{Tr(e,r).then((e=>n(Ot(e,t))),(()=>n(null)))}))}function Ar(e,t){return new Promise((r=>{Tr(e,t).then((e=>r(Pt(e))),(()=>r(null)))}))}function Tr(e,t){return new Promise((r=>{kr(Pr(e,t),t,[400,500]).then((e=>r(Gr(e))),(()=>r(null)))}))}function Pr(e,t){return`${Mr(t)}/content/items/${e}/data`}function Or(e,t){return`${Mr(t)}/content/items/${e}/info/`}function Fr(e,t){return new Promise((r=>{Rr(e,t).then((e=>{!e||e&&e.type.startsWith("application/json")?r(null):r(Ot(e,"metadata.xml"))}),(()=>r(null)))}))}function Rr(e,t){return new Promise(((r,n)=>{kr(Cr(e,t),t,[400]).then(r,n)}))}function Cr(e,t){return Or(e,t)+"metadata/metadata.xml"}function zr(e,t,r,i){return new Promise((o=>{const a={id:e,relationshipType:t,direction:r,authentication:i};n.getRelatedItems(a).then((e=>{o(e)}),(()=>{o({total:0,start:1,num:0,nextStart:-1,relatedItems:[]})}))}))}function Dr(e,t,r){return new Promise((n=>{const i=["APIKey2Item","Area2CustomPackage","Area2Package","Item2Attachment","Item2Report","Listed2Provisioned","Map2AppConfig","Map2Area","Map2FeatureCollection","Map2Service","MobileApp2Code","Service2Data","Service2Layer","Service2Route","Service2Service","Service2Style","Solution2Item","Style2Style","Survey2Data","Survey2Service","SurveyAddIn2Data","Theme2Story","TrackView2Map","WebStyle2DesktopStyle","WMA2Code","WorkforceMap2FeatureService"],o=i.map((n=>zr(e,n,t,r)));Promise.all(o).then((e=>{const t=[];for(let r=0;r<i.length;++r)e[r].total>0&&t.push({relationshipType:i[r],relatedItemIds:e[r].relatedItems.map((e=>e.id))});n(t)}))}))}function Lr(e,t){return new Promise((r=>{const i={authentication:t};n.getItemResources(e,i).then(r,(()=>{r({total:0,start:1,num:0,nextStart:-1,resources:[]})}))}))}function Ur(e,t){return new Promise(((r,n)=>{qr(e,{start:1,num:100},t).then((e=>{Promise.all(e).then(r,n)}),n)}))}function Br(e,t){return zr(e,"Solution2Item","forward",t).then((e=>e.relatedItems))}function Nr(e,t,r,n){return new Promise(((i,o)=>{if(!t)return void i(null);const a=jr(e,t,r,n),s=t.lastIndexOf("/")+1;Ir(a,t.substring(s),n,[400,500]).then(i,o)}))}function jr(e,t,r,n){return Rt(Mr(n))+(r?"community/groups/":"content/items/")+e+"/info/"+t}function Mr(e){return Mt(e,"portal")||"https://www.arcgis.com/sharing/rest"}function Wr(e,t){return zr(e,"Solution2Item","reverse",t).then((e=>e.relatedItems.map((e=>e.id))))}function Vr(e,t,r){return new Promise((n=>{Ir(e,t,r,[500]).then(n,(()=>n(null)))}))}function Gr(e){return new Promise(((t,r)=>{e&&e.size>0&&(e.type.startsWith("text/plain")||e.type.startsWith("application/json"))?Ft(e).then((r=>{try{JSON.parse(r),t(new Blob([e],{type:"application/json"}))}catch(n){r.length>4&&"PK"===r.substr(0,4)?t(new Blob([e],{type:"application/zip"})):r.startsWith("<")?t(new Blob([e],{type:"text/xml"})):t(e)}}),r):e?t(e):r()}))}function Zr(e,t,r){return new Promise(((i,o)=>{const a={paging:t,authentication:r};n.getGroupContent(e,a).then((n=>{if(n.num>0){const s=n.items.map((e=>e.id));n.nextStart>0?(a.paging.start=n.nextStart,Zr(e,t,r).then((e=>{i(s.concat(e))}),o)):i(s)}else i([])}),o)}))}function qr(e,t,r){return new Promise(((n,o)=>{const a=Mr(r),s=`${a}/content/items/${e}/resources`,l=[],c={params:{...t},authentication:r};i.request(s,c).then((i=>{i.num>0?(i.resources.forEach((t=>{const n=`${a}/content/items/${e}/resources/${t.resource}`;l.push(Ir(n,t.resource,r))})),i.nextStart>0?(t.start=i.nextStart,qr(e,t,r).then((e=>{n(l.concat(e))}),o)):n(l)):n([])}),o)}))}function $r(e,t){if(!t.locationTrackingEnabled&&e.some((e=>(Mt(e,"item.typeKeywords")||[]).indexOf("Location Tracking View")>-1)))throw console.error("Location tracking not enabled or user is not admin."),new Error("Location tracking not enabled or user is not admin.")}function Yr(e,t){const r=Mt(e,"item.typeKeywords")||Mt(t,"typeKeywords"),n=Mt(e,"item.properties.trackViewGroup")||Mt(t,"properties.trackViewGroup");return!!(r&&r.indexOf("Location Tracking View")>-1&&n)}function Hr(e){if(Yr(e)){const t=Mt(e,"item.properties.trackViewGroup");e.groups.push(t),e.dependencies.push(t);const r=vr(t,t,".itemId");Gt(e,"item.properties.trackViewGroup",r),Jr(e,"item.name",t,r),Jr(e,"properties.service.adminServiceInfo.name",t,r);(e.properties.layers||[]).concat(e.properties.tables||[]).forEach((e=>{Kr(e,"adminLayerInfo.viewLayerDefinition.sourceServiceItemId")}))}}function Jr(e,t,r,n){const i=Mt(e,t);i&&Gt(e,t,i.replace(r,n))}function Kr(e,t){const r=Mt(e,t);r&&Gt(e,t,vr(r,r,".itemId"))}function Xr(e,t,r){return Yr(e)&&(Vt(t,"owner",r.locationTracking.owner),Vt(t.item,"name",e.item.name),Vt(t.item,"isView",!0),Vt(t.item,"owner",r.locationTracking.owner),Vt(t.params,"isView",!0),Vt(t.params,"outputType","locationTrackingService"),delete t.folderId),t.item}function Qr(e){["definitionQuery"].forEach((t=>{Ut(e,t)}))}function en(e,t,r){e&&e.fields&&(t[e.id]={sourceFields:JSON.parse(JSON.stringify(e.fields)),type:e.type,id:e.id});const n={editFieldsInfo:r,types:r,templates:r,relationships:!0,drawingInfo:r,timeInfo:r,viewDefinitionQuery:r};return Object.keys(n).forEach((r=>{tn(e,r,t,n[r])})),t}function tn(e,t,r,n){e&&e.hasOwnProperty(t)&&r&&r.hasOwnProperty(e.id)&&(r[e.id][t]=e[t],n&&"editFieldsInfo"!==t&&(e[t]=null))}function rn(e,t,r){r.forEach((r=>{r&&r.hasOwnProperty("popupInfo")&&(e[t][r.id]=r.popupInfo,r.popupInfo={})}))}function nn(e,t){const r=Mt(e,"item.typeKeywords"),n=Mt(t,"typeKeywords");return r&&n&&Gt(e,"item.typeKeywords",r.concat(n.filter((e=>r.indexOf(e)<0)))),e}function on(e,t,r,n){const i={};return Object.keys(e).forEach((o=>{const a=Mt(e[o],"item.id"),s=parseInt(a,10)>-1,l=s&&n?n[a]:s?a:o;i[`layer${s?a:o}`]={fields:gi(e,o),url:Rt(t)+l,layerId:l,itemId:r},Ut(e[o],"newFields"),Ut(e[o],"sourceFields")})),i}function an(e,t){const r=e.dependencies,n=e.itemId,i=Object.keys(t);i.forEach((e=>{n===t[e].itemId&&r.forEach((r=>{i.forEach((n=>{if(r===n){const i={};i[r]=Mt(t[n],"fieldInfos"),t[e].sourceServiceFields=t[e].sourceServiceFields?{...t[e].sourceServiceFields,...i}:i;Object.keys(t[n]).forEach((r=>{r.startsWith("layer")&&(t[e][r]=t[n][r])}))}}))}))}))}function sn(e,t,r,n){return Object.keys(e).forEach((t=>{e[t].hasOwnProperty("templates")&&(e[t].templates=JSON.parse(yr(JSON.stringify(e[t].templates),n))),e[t].hasOwnProperty("adminLayerInfo")&&(r[t].viewLayerDefinition.table.relatedTables=e[t].adminLayerInfo,Ut(e[t],"adminLayerInfo")),e[t].hasOwnProperty("types")&&(e[t].types=JSON.parse(yr(JSON.stringify(e[t].types),n)))})),{popupInfos:yr(t,n),fieldInfos:yr(e,n),adminLayerInfos:yr(r,n)}}function ln(e){const t=e.properties,r=[];return(t.layers||[]).forEach((function(e){r.push({item:e,type:"layer"})})),(t.tables||[]).forEach((function(e){r.push({item:e,type:"table"})})),r}function cn(e,t,r,n,i,o,a,s){return new Promise(((i,l)=>{if(Yr(s))i(null);else{let c={layers:[],tables:[],authentication:n};Mt(s,"properties.service.hasViews")&&yn(s,r);const u=20,f=[];t.forEach(((e,i)=>{let l=e.item;const u=l.id;a=en(l,a,r.isPortal),l.isView&&Qr(l),s.properties.service.isView&&(gn(l.adminLayerInfo,r),o[u]=l.adminLayerInfo,an(s,r),l.adminLayerInfo=yr(l.adminLayerInfo,r),!r.isPortal&&a&&a.hasOwnProperty(l.id)&&(Object.keys(r).some((e=>r[e].itemId===s.itemId&&(a[l.id].sourceServiceFields=r[e].sourceServiceFields,!0))),En(a[l.id],l))),r.isPortal&&(l=dn(l,s,r)),fn(l),c=un(s,l,c,f,n),"Feature Layer"===l.type?c.layers.push(l):c.tables.push(l),i+1===t.length&&(f.push(Object.assign({},c)),c={layers:[],tables:[],authentication:n})}));const d=t.length>u;f.reduce(((t,r)=>t.then((()=>$i(e,r,!1,d)))),Promise.resolve(null)).then((()=>i(null)),(e=>l(Nt(e))))}}))}function un(e,t,r,n,i){const o=Mt(e,"properties.service.isMultiServicesView")||!1,a=Mt(e,"item.name");if(o){const e=Mt(t,"adminLayerInfo.viewLayerDefinition.table");if(e){const t=(e.relatedTables||[]).map((e=>e.sourceServiceName));t.push(e.sourceServiceName),t.some((e=>e===a))&&(r.layers.length>0||r.tables.length>0)&&(n.push(Object.assign({},r)),r={layers:[],tables:[],authentication:i})}}return r}function fn(e){e.multiScaleGeometryInfo&&Ut(e,"multiScaleGeometryInfo")}function dn(e,t,r){if(e.uniqueIdField&&e.uniqueIdField.name&&(e.uniqueIdField.name=String(e.uniqueIdField.name).toLocaleLowerCase()),"Table"===e.type&&e.adminLayerInfo&&Ut(e.adminLayerInfo,"geometryField"),e.isView){const n=Mt(e,"adminLayerInfo.viewLayerDefinition.table");let i=[];if(n){const o=hn(n,t,r);i=i.concat(o),Gt(e,"adminLayerInfo.viewLayerDefinition.table",mn(n,o)),Array.isArray(n.relatedTables)&&n.relatedTables.map((e=>{const n=hn(e,t,r);return i=i.concat(n),mn(e,n)}))}else Object.keys(r).some((t=>{if(r[t].itemId===e.serviceItemId){const n=r[t][`layer${e.id}`];return n&&n.fields&&(i=Array.isArray(n.fields)?n.fields.map((e=>e.name)):Object.keys(n.fields)),!0}}));e=pn(e,i)}return Ut(e,"sourceSchemaChangesAllowed"),Ut(e,"isView"),e}function hn(e,t,r){let n=[];const i=e.sourceLayerId;if("number"==typeof i)return t.dependencies.forEach((t=>{const o=r[t][`layer${i}`];o&&o.fields&&r[t].name===e.sourceServiceName&&(n=Array.isArray(o.fields)?n.concat(o.fields.map((e=>e.name))):n.concat(Object.keys(o.fields)))})),n}function pn(e,t){return t.length>0&&(e.fields&&(e.fields=e.fields.filter((e=>t.indexOf(e.name)>-1))),e.indexes&&(e.indexes=e.indexes.filter((e=>t.indexOf(e.fields)>-1)))),e}function mn(e,t){return Array.isArray(e.sourceLayerFields)&&e.sourceLayerFields.length>0&&t.length>0&&Gt(e,"sourceLayerFields",e.sourceLayerFields.filter((e=>t.indexOf(e.source.toLowerCase())>-1))),e}function gn(e,t){const r=Mt(e,"viewLayerDefinition.table.name"),n=Mt(e,"geometryField.name");if(n&&r){Gt(e,"geometryField.name",t.isPortal?`${r}.shape`:`${r}.Shape`)}else!n&&Mt(e,"geometryField")&&Ut(e,"geometryField")}function yn(e,t,r=!0){const n=e.properties.layers,i=e.properties.tables,o=n.concat(i),a={};o.forEach((e=>{a[e.id]=e.fields})),Object.keys(t).some((n=>(r?t[n].itemId===e.itemId:n===e.itemId)&&(t[n].fieldInfos=a,!0)))}function vn(e,t,r){r&&Vt(e,`${t}.defaultSpatialReference`,r)}function bn(e,t,r){if(Mt(e,"service.isView")){let n,i;t.dependencies.some((e=>{const t=r[e],o=Mt(t,"defaultSpatialReference");!n&&o&&(n=o);const a=Mt(t,"defaultExtent");return!i&&a&&(i=a),n&&i}));const o=Mt(n,"wkid"),a=Mt(e,"service.spatialReference.wkid");o&&a&&o!==a&&Vt(e,"service.spatialReference",n);const s=Mt(e,"service.fullExtent");i&&s&&JSON.stringify(i)!==JSON.stringify(s)&&Vt(e,"defaultExtent",i)}}function wn(e,t,r,n,i){return new Promise(((o,a)=>{_n(e,t,r,n,i).then((t=>{Pn(e,t.popupInfos),o({itemTemplate:e,layerInfos:t})}),(e=>a(Nt(e))))}))}function _n(e,t,r,n,i){return new Promise(((o,a)=>{if(e.item.url){const a=e.itemId,s=Object.keys(i);let l;s.some((e=>i[e].itemId===a&&(l=i[e],!0)));const c=e.properties.layers,u=e.properties.tables;c.concat(u).forEach((r=>{const n=r.isView||e.properties.service.isView;if(t&&t.hasOwnProperty(r.id)){const e=t[r.id];if(e.isView=r.isView,e.newFields=r.fields,e.sourceSchemaChangesAllowed=r.sourceSchemaChangesAllowed,r.editFieldsInfo&&(e.newEditFieldsInfo=JSON.parse(JSON.stringify(r.editFieldsInfo))),n&&l&&i.isPortal){e.sourceServiceFields=l.sourceServiceFields;let t=In(e);t=kn(e,t),t.length>0&&(e.fields=t),e.typeIdField=xn(r);const n=e.newFields.map((e=>e.name));Ln(e,n),Un(e,n)}}})),s.forEach((e=>{a===i[e].itemId&&(i[e]=Object.assign(i[e],on(t,i[e].url,a)))})),o(sn(t,r,n,i))}else a(Nt("Feature layer "+e.itemId+" does not have a URL"))}))}function xn(e){const t=e.fields.filter((t=>t.name&&e.typeIdField&&t.name.toLowerCase()===e.typeIdField.toLowerCase()));return Array.isArray(t)&&1===t.length?t[0].name:e.typeIdField}function In(e){const t=[];if(e&&e.sourceFields&&e.newFields){const r=e.sourceFields.reduce(((e,t)=>(e[String(t.name).toLocaleLowerCase()]=t.visible,e)),{});e.newFields.forEach((e=>{const n=String(e.name).toLocaleLowerCase();r.hasOwnProperty(n)&&!r[n]&&t.push({name:e.name,visible:r[n]})}))}return t}function kn(e,t){const r=An(e),n=r.domainFields,i=r.domainNames,o=r.aliasFields,a=r.aliasNames;return e.newFields.forEach((e=>{Sn(e,i,n,"domain",t),Sn(e,a,o,"alias",t)})),t}function Sn(e,t,r,n,i){if(e.hasOwnProperty(n)&&e[n]){const o=t.indexOf(String(e.name).toLocaleLowerCase());if(JSON.stringify(e[n])!==(o>-1?JSON.stringify(r[o]):"")){let t=!1;if(i.some((r=>(r.name===e.name&&(t=!0,r[n]=e[n]),t))),!t){const t={name:e.name};t[n]=e[n],i.push(t)}}}}function En(e,t){const r=An(e),n=r.domainFields,i=r.domainNames,o=r.aliasFields,a=r.aliasNames;t.fields.map((e=>(Tn(e,i,n,"domain"),Tn(e,a,o,"alias"),e)))}function An(e){const t=[],r=[],n=[],i=[];return e.sourceServiceFields&&Object.keys(e.sourceServiceFields).forEach((o=>{e.sourceServiceFields[o]&&Object.keys(e.sourceServiceFields[o]).forEach((a=>{e.sourceServiceFields[o][a].forEach((e=>{e.hasOwnProperty("domain")&&e.domain&&(t.push(e.domain),r.push(String(e.name).toLocaleLowerCase())),e.hasOwnProperty("alias")&&e.alias&&(n.push(e.alias),i.push(String(e.name).toLocaleLowerCase()))}))}))})),{aliasFields:n,aliasNames:i,domainFields:t,domainNames:r}}function Tn(e,t,r,n){if(e.hasOwnProperty(n)&&e[n]){const i=t.indexOf(String(e.name).toLocaleLowerCase());JSON.stringify(e[n])!==(i>-1?JSON.stringify(r[i]):"")&&(e.isViewOverride=!0)}}function Pn(e,t){["layers","tables"].forEach((r=>{const n=Mt(e,"data."+r);n&&Array.isArray(n)&&n.forEach((e=>{e.popupInfo=Mt(t,r+"."+e.id)||{}}))}))}function On(e,t,r){return t.startsWith("{{")?t:String(vr(e,e,"."+String(t).toLowerCase()+(r?"."+r:"")))}function Fn(e,t,r,n){e&&e.hasOwnProperty(t)&&e[t]&&(e[t]=On(r,e[t],n))}function Rn(e,t,r,n,i,o){Cn(t),i&&Nn(e,r.itemId,t,n);const a=[t];e&&a.push(e),a.forEach((e=>{e.hasOwnProperty("name")&&(e.name=vr(e.serviceItemId+".layer"+e.id,e.serviceItemId+".layer"+e.id,".name||"+e.name)),e.hasOwnProperty("extent")&&(e.extent=vr(e.serviceItemId,e.serviceItemId,".solutionExtent")),e.hasOwnProperty("serviceItemId")&&(e.serviceItemId=vr(e.serviceItemId,e.serviceItemId,".itemId")),e.hasOwnProperty("adminLayerInfo")&&(e.adminLayerInfo=jn(e,n,o))}))}function Cn(e){const t=(e.fields||[]).map((e=>e.name));zn(e,t),Dn(e,t),Ln(e,t),Un(e,t),Bn(e,t)}function zn(e,t){const r=e.displayField||"";let n=-1;if(t.some((e=>(n+=1,e===r||e===r.toLowerCase()))))e.displayField=t[n];else{const r=[],n=Mt(e,"uniqueIdField.name");n&&r.push(n);const i=Mt(e,"globalIdField");i&&r.push(i),t.some((t=>-1===r.indexOf(t)&&(e.displayField=t,!0)))}}function Dn(e,t){const r=e.indexes;if(r){const n=[];e.indexes=r.reduce(((e,r)=>{const i=r.fields.split(","),o=[];return i.forEach((e=>{-1===n.indexOf(e)&&(n.push(e),t.indexOf(e)>-1&&o.push(e))})),o.length>0&&(r.fields=o.join(","),e.push(r)),e}),[])}}function Ln(e,t){const r=e.templates;r&&(e.templates=r.map((e=>{const r=Mt(e,"prototype.attributes");return r&&(Object.keys(r).forEach((e=>{-1===t.indexOf(e)&&delete r[e]})),Gt(e,"prototype.attributes",r)),e})))}function Un(e,t){const r=e.types;r&&(e.types=r.map((e=>(Ln(e,t),e))))}function Bn(e,t){const r=e.editFieldsInfo;if(r){Object.keys(r).forEach((e=>{const n=r[e];n&&t.some((t=>t===n||t===n.toLowerCase()&&(r[e]=t,!0)))}))}}function Nn(e,t,r,n){const i=t+".layer"+r.id+".fields",o=r.fields.map((e=>e.name));e&&(Vn(e,n),Yn(e,r,i,t,o)),Vn(r,n),$n(r,t),ti(r,i,o),ri(r,i,o),ii(r,i,o),fi(r,i),di(r,i),pi(r,i),mi(r,i,o)}function jn(e,t,r){const n=Object.assign({},e.adminLayerInfo);if(gn(n,r),Ut(n,"xssTrustedFields"),Ut(n,"tableName"),n.viewLayerDefinition){const e=Object.assign({},n.viewLayerDefinition);Mn(e,t),e.table&&(Mn(e.table,t),e.table.relatedTables&&e.table.relatedTables.forEach((e=>{Mn(e,t)}))),n.viewLayerDefinition=e}return n}function Mn(e,t){Ut(e,"sourceId"),e.hasOwnProperty("sourceServiceName")&&(e.sourceServiceName=Wn(e.sourceServiceName,t))}function Wn(e,t){const r=t.filter((t=>t.name===e));return 1===r.length?On(r[0].id,"name"):void 0}function Vn(e,t){const r=Mt(e,"adminLayerInfo.viewLayerDefinition.table");if(r){let n=Gn(r.sourceServiceName,t);const i=n+".layer"+r.sourceLayerId+".fields";Zn(r.sourceLayerFields||[],i);const o=Mt(e,"adminLayerInfo.viewLayerDefinition.table.relatedTables")||[];o.length>0&&o.forEach((e=>{n=Gn(e.sourceServiceName,t);const r=n+".layer"+e.sourceLayerId+".fields";qn(e.topFilter||{},r),Zn(e.sourceLayerFields||[],r);const o=e.parentKeyFields||[];e.parentKeyFields=o.map((e=>On(i,e,"name")));const a=e.keyFields||[];e.keyFields=a.map((e=>On(r,e,"name")))}))}}function Gn(e,t){const r=t.filter((t=>t.name===e));return 1===r.length?r[0].id:""}function Zn(e,t){e.forEach((e=>Fn(e,"source",t,"name")))}function qn(e,t){if(e){const r=e.orderByFields||"";if(""!==r){const n=r.split(" ")[0];e.orderByFields=e.orderByFields.replace(n,On(t,n,"name"))}const n=e.groupByFields||"";if(""!==n){const r=n.split(",");if(r.length>0){const n=r.map((e=>On(t,e,"name")));e.groupByFields=n.join(",")}}}}function $n(e,t){if(e&&e.relationships){e.relationships.forEach((r=>{if(r.keyField){Fn(r,"keyField",t+".layer"+e.id+".fields","name")}}))}}function Yn(e,t,r,n,i){if(i&&e.popupInfo){const o=e.popupInfo;Hn(o,"title",i,r),Hn(o,"description",i,r);Jn(o.fieldInfos||[],t,n,r);Xn(o.expressionInfos||[],i,r);Qn(o.popupElements||[],r,t,n,i);ei(o.mediaInfos||[],i,r,t,n)}}function Hn(e,t,r,n){e.hasOwnProperty(t)&&r.forEach((r=>{const i=new RegExp("(\\b"+r+"\\b(?![}]{2}))","gm");i.test(e[t])&&(e[t]=e[t].replace(i,On(n,r,"name")))}))}function Jn(e,t,r,n){e.forEach((e=>{e.fieldName=Kn(e.fieldName,t,r,n)}))}function Kn(e,t,r,n){if(e.indexOf("relationships/")>-1){const n=e.split("/"),i=n[1],o=Mt(t,"adminLayerInfo.viewLayerDefinition.table.relatedTables"),a=t.relationships||o;if(a&&a.length>parseInt(i,10)){const t=a[i],o=r+".layer"+t[Mt(t,"relatedTableId")?"relatedTableId":"sourceLayerId"]+".fields";n[2]=On(o,n[2],"name"),e=n.join("/")}}else-1===e.indexOf("expression/")&&(e=On(n,e,"name"));return e}function Xn(e,t,r){return e.map((e=>(t.forEach((t=>{e.expression=ci(e.expression,t,r)})),e)))}function Qn(e,t,r,n,i){e.forEach((e=>{e.hasOwnProperty("fieldInfos")&&Jn(e.fieldInfos,r,n,t),e.hasOwnProperty("mediaInfos")&&ei(e.mediaInfos,i,t,r,n)}))}function ei(e,t,r,n,i){["title","caption"].forEach((n=>Hn(e,n,t,r))),e.forEach((e=>{if(e.hasOwnProperty("value")){const t=e.value,o=t.fields||[];t.fields=o.map((e=>Kn(e,n,i,r))),t.hasOwnProperty("normalizeField")&&Fn(t,"normalizeField",r,"name"),t.hasOwnProperty("tooltipField")&&(t.tooltipField=Kn(t.tooltipField,n,i,r))}}))}function ti(e,t,r){if(e){const n=e.definitionEditor||{};if(n){const e=n.inputs;e&&e.forEach((e=>{e.parameters&&e.parameters.forEach((e=>{Fn(e,"fieldName",t,"name")}))})),n.hasOwnProperty("parameterizedExpression")&&(n.parameterizedExpression=ni(n.parameterizedExpression||"",t,r,"name"))}}}function ri(e,t,r){e&&e.hasOwnProperty("definitionExpression")&&(e.definitionExpression=ni(e.definitionExpression||"",t,r,"name"))}function ni(e,t,r,n){return r.forEach((r=>{const i=new RegExp("\\b"+r+"\\b(?![}]{2})","gm");e&&i.test(e)&&(e=e.replace(i,On(t,r,n)))})),e}function ii(e,t,r){if(e){const n=e.drawingInfo;if(n){oi(n.renderer||{},t,r);ui(n.labelingInfo||[],t,r)}}}function oi(e,t,r){switch(e.type){case"classBreaks":case"uniqueValue":case"predominance":case"simple":case"heatmap":ai(e,t,r);break;case"temporal":si(e,t,r)}}function ai(e,t,r){if(e){const n=e.authoringInfo;n&&li(n,t,r);const i=["field","normalizationField"];i.forEach((r=>Fn(e,r,t,"name")));["field1","field2","field3"].forEach((r=>Fn(e,r,t,"name")));const o=e.rotationExpression;o&&r.forEach((r=>{const n=new RegExp("(\\["+r+"\\])","gm");n.test(o)&&(e.rotationExpression=o.replace(n,"["+On(t,r,"name")+"]"))})),e.valueExpression&&r.forEach((r=>{e.valueExpression=ci(e.valueExpression,r,t)}));const a=e.visualVariables;a&&a.forEach((e=>{i.forEach((r=>Fn(e,r,t,"name"))),e.valueExpression&&r.forEach((r=>{e.valueExpression=ci(e.valueExpression,r,t)}))}))}}function si(e,t,r){[e.latestObservationRenderer,e.observationRenderer,e.trackRenderer].forEach((e=>{oi(e,t,r)}))}function li(e,t,r){if(e){const n=["field","normalizationField"],i=e.field1;n.forEach((e=>Fn(i,e,t,"name")));const o=e.field2;n.forEach((e=>Fn(o,e,t,"name")));const a=e.fields;a&&(e.fields=a.map((e=>On(t,e,"name"))));const s=["endTime","field","startTime"],l=e.visualVariables;l&&s.forEach((e=>{r.indexOf(l[e])>-1&&Fn(l,e,t,"name")}))}}function ci(e,t,r){const n=On(r,t,"name");if(e){let r="(?:\\$feature\\.)("+t+")\\b",i=new RegExp(r,"gm");e=i.test(e)?e.replace(i,"$feature."+n):e,r="(?:[$]feature)(\\[\\\"?\\'?)"+t+"(\\\"?\\'?\\])",i=new RegExp(r,"gm");let o=i.exec(e);o&&(e=e.replace(i,"$feature"+o[1]+n+o[2])),r="(?:[$]feature)(\\[\\\"?\\'?)(\\w+)[.]"+t+"(\\\"?\\'?\\])",i=new RegExp(r,"gm"),o=i.exec(e),o&&o.length>3&&(e=e.replace(i,"$feature"+o[1]+o[2]+"."+n+o[3])),r="(\\\"|\\')+"+t+"(\\\"|\\')+",i=new RegExp(r,"gm"),o=i.exec(e),o&&(e=e.replace(i,o[1]+n+o[2]))}return e}function ui(e,t,r){e.forEach((e=>{if(e.hasOwnProperty("fieldInfos")){(e.fieldInfos||[]).forEach((e=>Fn(e,"fieldName",t,"name")))}const n=e.labelExpression||"",i=e.labelExpressionInfo||{};r.forEach((r=>{const o=On(t,r,"name"),a=new RegExp('(\\[\\"*)+('+r+')(\\"*\\])+',"gm");let s=a.exec(n);if(s&&(e.labelExpression=n.replace(a,s[1]+o+s[3])),i.value){let t=i.value;const n=new RegExp("(\\{"+r+"\\})","gm");t=n.test(t)?t.replace(n,"{"+o+"}"):t,s=a.exec(t),t=s?t.replace(a,s[1]+o+s[3]):t,e.labelExpressionInfo.value=t}i.expression&&(e.labelExpressionInfo.expression=ci(i.expression,r,t))}))}))}function fi(e,t){(e.templates||[]).forEach((e=>{const r=hi(Mt(e,"prototype.attributes"),t,"name");r&&(e.prototype.attributes=r)}))}function di(e,t){const r=e.types;r&&Array.isArray(r)&&r.length>0&&r.forEach((e=>{const r=hi(e.domains,t,"name");r&&(e.domains=r);const n=e.templates;n&&n.length>0&&n.forEach((e=>{const r=hi(Mt(e,"prototype.attributes"),t,"name");r&&(e.prototype.attributes=r)}))}))}function hi(e,t,r){let n;if(e){n={};const i=Object.keys(e);i&&i.length>0&&i.forEach((i=>{n[On(t,i,r)]=e[i]}))}return n}function pi(e,t){if(e.timeInfo){const r=e.timeInfo;["endTimeField","startTimeField","trackIdField"].forEach((e=>{""!==r[e]?Fn(r,e,t,"name"):r[e]=null}))}}function mi(e,t,r){e&&e.hasOwnProperty("viewDefinitionQuery")&&(e.viewDefinitionQuery=ni(e.viewDefinitionQuery||"",t,r,"name")),e&&e.hasOwnProperty("definitionQuery")&&(e.definitionQuery=ni(e.definitionQuery||"",t,r,"name"))}function gi(e,t){const r=e[t],n={},i=r.newFields,o=i?i.map((e=>e.name)):[];if((r.sourceFields||[]).forEach((e=>{const t=String(e.name).toLowerCase();i.forEach((r=>{-1===o.indexOf(e.name)&&-1===o.indexOf(t)&&r.alias&&r.alias===e.alias&&(n[t]={name:r.name,alias:r.alias,type:r.type?r.type:""}),String(r.name).toLowerCase()===t&&(n[t]={name:r.name,alias:r.alias?r.alias:"",type:r.type?r.type:""})}))})),r.editFieldsInfo&&r.newEditFieldsInfo){const e=JSON.parse(JSON.stringify(r.editFieldsInfo)),t=JSON.parse(JSON.stringify(r.newEditFieldsInfo)),i=Object.keys(n);Object.keys(e).forEach((a=>{const s=String(e[a]).toLowerCase();if((-1===i.indexOf(s)||n[s].name!==t[a])&&o.indexOf(s)>-1){let i;r.sourceSchemaChangesAllowed&&!r.isView&&(r.hasOwnProperty("deleteFields")||(r.deleteFields=[]),r.deleteFields.push(s)),r.sourceFields.some((t=>(t.name===e[a]&&(i=t),t.name===e[a]))),n[s]={name:t[a],alias:i&&i.alias?i.alias:"",type:i&&i.type?i.type:""}}})),Ut(r,"sourceSchemaChangesAllowed"),Ut(r,"editFieldsInfo"),Ut(r,"newEditFieldsInfo"),Ut(r,"isView")}return n}function yi(){return 20}var vi,bi,wi;e.EFileType=void 0,(vi=e.EFileType||(e.EFileType={}))[vi.Data=0]="Data",vi[vi.Info=1]="Info",vi[vi.Metadata=2]="Metadata",vi[vi.Resource=3]="Resource",vi[vi.Thumbnail=4]="Thumbnail",e.SFileType=void 0,(bi=e.SFileType||(e.SFileType={}))[bi.Data=0]="Data",bi[bi.Info=1]="Info",bi[bi.Metadata=2]="Metadata",bi[bi.Resource=3]="Resource",bi[bi.Thumbnail=4]="Thumbnail",e.EItemProgressStatus=void 0,(wi=e.EItemProgressStatus||(e.EItemProgressStatus={}))[wi.Started=0]="Started",wi[wi.Created=1]="Created",wi[wi.Cancelled=2]="Cancelled",wi[wi.Finished=3]="Finished",wi[wi.Ignored=4]="Ignored",wi[wi.Failed=5]="Failed",wi[wi.Unknown=6]="Unknown";const _i=["1 Started","2 Created","3 Cancelled","3 Finished","3 Ignored","3 Failed","Unknown"];function xi(e,t,r){return new Promise(((n,i)=>{const o=[];if(t.forEach((t=>{const r=Mt(e,t+".serviceItemId"),n=Mt(e,t);r?-1===o.indexOf(r)&&o.push(r):Wt(n,o)})),Mt(e,"assignmentIntegrations")){let t=[],a=[];e.assignmentIntegrations.forEach((e=>{if(e.assignmentTypes){Object.keys(e.assignmentTypes).forEach((n=>{const i=e.assignmentTypes[n].urlTemplate;Wt(i,o);const s=Ui(i,r);Array.isArray(s.requests)&&s.requests.length>0&&(t=t.concat(s.requests),a=a.concat(s.urls))}))}})),t.length>0?Promise.all(t).then((e=>{const t={};Array.isArray(e)&&e.forEach(((e,r)=>{e.serviceItemId&&(t[a[r]]=e.serviceItemId,-1===o.indexOf(e.serviceItemId)&&o.push(e.serviceItemId))})),n({dependencies:o,urlHash:t})}),(e=>i(Nt(e)))):n({dependencies:o,urlHash:{}})}else n({dependencies:o,urlHash:{}})}))}function Ii(e,t,r){t.forEach((t=>{if(Mt(e,t))if(Mt(e[t],"serviceItemId")){const r=e[t].serviceItemId;let n=".itemId";if(Mt(e[t],"url")){const i=Fi(e[t].url);e[t].url=vr(r,r,Ri(i,".url")),n=Ri(i,n)}e[t].serviceItemId=vr(r,r,n)}else e[t]=vr(e[t],e[t],".itemId")})),e.folderId="{{folderId}}";return(e.assignmentIntegrations||[]).forEach((e=>{if(Oi(e,r),e.assignmentTypes){Object.keys(e.assignmentTypes).forEach((t=>{Oi(e.assignmentTypes[t],r)}))}})),e}function ki(e,t){const r=e.item.properties||{},n=Li(2);t=n.reduce((function(e,n){return r[n]&&t.indexOf(r[n])<0&&e.push(r[n]),e}),t);const i=Mt(e,"properties.workforceInfos.assignmentIntegrationInfos");return i&&i.length>0&&i.forEach((e=>{Object.keys(e).indexOf("dependencies")>-1&&e.dependencies.forEach((e=>{t.indexOf(e)<0&&t.push(e)}))})),t.map((e=>({id:e,name:""})))}function Si(e,r,n){return new Promise(((i,o)=>{r=ji(r=r.replace("/rest/admin/services","/rest/services"));const a=[t.queryFeatures({url:`${r}3`,where:"1=1",authentication:n}),t.queryFeatures({url:`${r}4`,where:"1=1",authentication:n})];Promise.all(a).then((t=>{const[r,a]=t;e.workforceInfos={assignmentTypeInfos:Ai(r)},Ti(a,n).then((t=>{e.workforceInfos.assignmentIntegrationInfos=t,Ei(e.workforceInfos),i(e)}),(e=>o(Nt(e))))}),(e=>o(Nt(e))))}))}function Ei(e){const t=e=>(e.GlobalID&&(e.GlobalID=`{${e.GlobalID}}`),e.assignmenttype&&(e.assignmenttype=`{${e.assignmenttype}}`),e),r=Mt(e,"assignmentIntegrationInfos");r&&Array.isArray(r)&&Gt(e,"assignmentIntegrationInfos",r.map(t));const n=Mt(e,"assignmentTypeInfos");n&&Array.isArray(n)&&Gt(e,"assignmentTypeInfos",n.map(t))}function Ai(e){const t=[],r=["description",e.globalIdFieldName];return e.features.forEach((e=>{const n={};r.forEach((t=>{n[t]=e.attributes[t]})),t.push(n)})),t}function Ti(e,t){return new Promise(((r,n)=>{let i=[],o=[];const a=[],s=["appid",e.globalIdFieldName,"prompt","urltemplate","assignmenttype"];e.features.forEach((e=>{const r={};s.forEach((n=>{if(r[n]=e.attributes[n],"urltemplate"===n){const a=e.attributes[n],s=jt(a);r.dependencies=s;const l=Ui(a,t);Array.isArray(l.requests)&&l.requests.length>0&&(i=i.concat(l.requests),o=o.concat(l.urls))}})),a.push(r)})),Pi(i,o).then((e=>{a.forEach((t=>{Oi(t,e.urlHash)})),r(a)}),(e=>n(Nt(e))))}))}function Pi(e,t){return new Promise(((r,n)=>{const i=[];e.length>0?Promise.all(e).then((e=>{const n={};Array.isArray(e)&&e.forEach(((e,r)=>{e.serviceItemId&&(n[t[r]]=e.serviceItemId,-1===i.indexOf(e.serviceItemId)&&i.push(e.serviceItemId))})),r({dependencies:i,urlHash:n})}),(e=>n(Nt(e)))):r({dependencies:i,urlHash:{}})}))}function Oi(e,t){const r=Mt(e,"urlTemplate")?"urlTemplate":"urltemplate";let n=Mt(e,r);if(n){jt(n).forEach((e=>{n=n.replace(e,vr(e,e,".itemId"))}));Bi(n).forEach((r=>{const i=Ri(Fi(r),".url"),o=t[r];Array.isArray(e.dependencies)&&e.dependencies.indexOf(o)<0&&e.dependencies.push(o),n=n.replace(r,vr(o,o,i))})),Gt(e,r,n)}}function Fi(e){return e.indexOf("FeatureServer/")>-1?e.substr(e.lastIndexOf("/")+1):void 0}function Ri(e,t){return isNaN(Number.parseInt(e,10))?`${t}`:`.layer${e}${t}`}function Ci(e,t){if(Di(e)){const r=e.item.properties||{},n=Li(2),i=r.workforceProjectGroupId,o=[];Object.keys(r).forEach((t=>{if(n.indexOf(t)>-1){const n=r[t];n!==i&&o.push(n),e.item.properties[t]=vr(r[t],r[t],".itemId")}})),e.dependencies=e.dependencies.filter((e=>e!==i&&o.indexOf(e)<0));const a=Mt(e,"properties.workforceInfos");a&&Object.keys(a).forEach((t=>{a[t].forEach((t=>{t.dependencies&&(t.dependencies.forEach((t=>{o.indexOf(t)<0&&o.push(t);const r=e.dependencies.indexOf(t);r>-1&&e.dependencies.splice(r,1)})),delete t.dependencies)}))})),t[i]=o}return e}function zi(e,t){if((e.item.typeKeywords||[]).indexOf(t)>-1){const t=(e.item.properties||{}).workforceFeatureServiceId;t&&(e.item.properties.workforceFeatureServiceId=vr(t,t,".itemId"))}return e}function Di(e){return(e.item.typeKeywords||[]).indexOf("Workforce Project")>-1}function Li(e){return 1===e?["groupId","workerWebMapId","dispatcherWebMapId","dispatchers","assignments","workers","tracks"]:["workforceDispatcherMapId","workforceProjectGroupId","workforceWorkerMapId"]}function Ui(e,t){const r=Bi(e),n=[];return r.forEach((e=>{const r={f:"json",authentication:t};n.push(i.request(e,r))})),{requests:n,urls:r}}function Bi(e){return $t(e,/=(http.*?FeatureServer.*?(?=&|$))/gi).map((e=>e.replace("=","")))}function Ni(e,t,r){return new Promise(((n,o)=>{const a={f:"json",fields:"*",authentication:r};e=ji(e);const s=[];t.forEach((t=>{s.push(i.request(`${e}${t}`,a))})),Promise.all(s).then((t=>{const r={};t.forEach((t=>{r[`${e}${t.id}`]=t.fields.map((e=>e.name))})),n(r)}),(e=>o(Nt(e))))}))}function ji(e){return e+=e.endsWith("/")?"":"/"}function Mi(e,t){const r=[];return e.forEach((e=>{const n={};Object.keys(e).forEach((r=>{const i=Wi(r,t);n[i]=e[r]})),r.push({attributes:n})})),r}function Wi(e,t){return t.filter((t=>t.toLowerCase()===e.toLowerCase()))[0]}function Vi(e,r,n,i,o){return new Promise(((a,s)=>{if(e){const l=o?"userid":"userId";t.queryFeatures({url:e,where:`${l} = '${r}'`,authentication:i}).then((t=>{if(t&&t.features)if(0===t.features.length){const t=[{attributes:{name:n}}];t[0].attributes[l]=r,Gi(e,t,i).then(a,s)}else a(!0);else a(!1)}),(e=>s(Nt(e))))}else a(!1)}))}function Gi(e,r,n,i=!1){return new Promise(((o,a)=>{r.length>0?t.applyEdits({url:e,adds:r,useGlobalIds:i,authentication:n}).then((e=>{e&&e.addResults?o(!0):a(Nt({success:!1,message:"Failed to add dispatch record."}))}),(e=>a(Nt({success:!1,message:"Failed to add dispatch record.",error:e})))):o(!0)}))}function Zi(e,t,r,i){return new Promise((o=>{const a={originItemId:e,destinationItemId:t,relationshipType:r,authentication:i};n.addItemRelationship(a).then((t=>{o({success:t.success,itemId:e})}),(()=>{o({success:!1,itemId:e})}))}))}function qi(e,t){return new Promise((r=>{e&&t?t.getToken(e).then((t=>{t&&(e=Tt(e,"token="+t)),r(e)}),(()=>r(e))):r(e)}))}function $i(e,t,r=!1,n=!1){return n&&(t.params={...t.params,async:!0}),new Promise(((n,i)=>{a.addToServiceDefinition(e,t).then((e=>{Yi(e,t.authentication).then((()=>n(null)),(e=>i(Nt(e))))}),(o=>{r?i(Nt(o)):$i(e,t,!0,!0).then((()=>n(null)),(e=>i(e)))}))}))}function Yi(e,t){return new Promise(((r,n)=>{if(e.statusURL){const o=setInterval((()=>{i.request(e.statusURL,{authentication:t}).then((e=>{"Completed"===e.status?(clearInterval(o),r()):"Failed"===e.status&&(clearInterval(o),n(e))}),(e=>{clearInterval(o),n(e)}))}),2e3)}else r()}))}function Hi(e){let t={q:"",start:1,num:100};return"string"==typeof e?t.q=e:e instanceof n.SearchQueryBuilder?t.q=e.toParam():t={...t,...e},t}function Ji(e){return("number"!=typeof e.xmin||"number"!=typeof e.xmax||"number"!=typeof e.ymax||"number"!=typeof e.ymin)&&(e.xmin=-179,e.xmax=179,e.ymax=89,e.ymin=-89,e.spatialReference={wkid:4326}),e}function Ki(e,t,r,n,i){return new Promise(((o,a)=>{const s={xmin:-179,xmax:179,ymin:-89,ymax:89,spatialReference:{wkid:4326}};Xi(Ji(e),r,n,i).then((e=>{JSON.stringify(e)===JSON.stringify(Ji(e))?o(e):Xi(t||s,r,n,i).then(o,(e=>a(Nt(e))))}),(()=>{Xi(s,r,n,i).then(o,(e=>a(Nt(e))))}))}))}function Xi(e,t,r,n){const o={authentication:n};return new Promise(((n,a)=>{e.spatialReference.wkid!==t?.wkid&&t?(o.params={f:"json",inSR:e.spatialReference.wkid,outSR:t.wkid,extentOfInterest:JSON.stringify(e)},i.request(Rt(r)+"findTransformations",o).then((s=>{const l=s&&s.transformations?s.transformations:void 0;let c;l&&l.length>0&&(c=l[0].wkid?l[0].wkid:l[0].geoTransforms?l[0]:void 0),o.params={f:"json",outSR:t.wkid,inSR:e.spatialReference.wkid,geometries:{geometryType:"esriGeometryPoint",geometries:[{x:e.xmin,y:e.ymin},{x:e.xmax,y:e.ymax}]},transformation:c},i.request(Rt(r)+"project",o).then((e=>{const r=2===e.geometries.length?e.geometries:void 0;n(r?{xmin:r[0].x,ymin:r[0].y,xmax:r[1].x,ymax:r[1].y,spatialReference:t}:void 0)}),(e=>a(Nt(e))))}),(e=>a(Nt(e))))):n(e)}))}function Qi(e,t){const r=e.itemTemplate.item.url.replace("rest/services","rest/admin/services"),n=[],i=bo(r,null,null,e,"refresh");if(n.push(i),Object.keys(e.objects).forEach((o=>{const a=Object.assign({},e.objects[o]);t&&Bt(a,["type","id","relationships","sourceServiceFields"]),a.hasOwnProperty("deleteFields")&&(n.push(bo(r,o,a,e,"delete")),Ut(a,"deleteFields"),n.push(bo(r,null,null,e,"refresh"))),t&&(n.push(bo(r,o,a,e,"update")),n.push(i))})),!e.itemTemplate.properties.service.isView){const t=vo({message:"updated layer relationships",objects:e.objects,itemTemplate:e.itemTemplate,authentication:e.authentication});t.layers=eo(e.itemTemplate.properties.layers,e.itemTemplate.properties.tables,t),t.layers.length>0&&(n.push(bo(r,null,t,e,"add")),n.push(i))}return n}function eo(e,t,r){const n=[].concat(e.map((e=>e.id)),t.map((e=>e.id))),i=[];return n.forEach((e=>{r.layers.some((t=>e===t.id&&(i.push(t),!0)))})),i}function to(e,t,r){const n=Mt(e,"properties.service.sourceSchemaChangesAllowed"),i=Mt(e,"properties.service.isView");if(n&&i){const i=e.item.url.replace("rest/services","rest/admin/services"),o={authentication:t,message:"final service update"},a={sourceSchemaChangesAllowed:n};r.push(bo(i,null,a,o,"update"))}return r}function ro(e,t=!1,r=!1){return new Promise(((n,o)=>{const a={params:e.params,authentication:e.args.authentication};(r&&e.url.indexOf("addToDefinition")>-1||e.url.indexOf("updateDefinition")>-1||e.url.indexOf("deleteFromDefinition")>-1)&&(a.params={...a.params,async:!0}),i.request(e.url,a).then((e=>{Yi(e,a.authentication).then((()=>n(null)),(e=>o(Nt(e))))}),(r=>{t?o(r):ro(e,!0,!0).then((()=>n()),(e=>o(e)))}))}))}function no(e,t,r=!1){return new Promise(((n,o)=>{const a={service:{},layers:[],tables:[]};e=e.replace("/rest/services","/rest/admin/services"),i.request(e+"?f=json",{authentication:t}).then((i=>{a.service=io(i),i.adminServiceInfo?.cacheMaxAge&&(a.service.cacheMaxAge=i.adminServiceInfo.cacheMaxAge),i.layers&&(a.layers=i.layers,a.layers.forEach((e=>{e.serviceItemId=a.service.serviceItemId,e.extent=null,fn(e)}))),delete i.layers,i.tables&&(a.tables=i.tables,a.tables.forEach((e=>{e.serviceItemId=a.service.serviceItemId,e.extent=null}))),delete i.tables,xo(a),r?Si(a,e,t).then(n,o):n(a)}),(e=>o(Nt(e))))}))}function io(e){const t=e.layers||[],r=e.tables||[];return Vt(e,"layers",t.filter((e=>"Feature Layer"===e.type))),Vt(e,"tables",r.concat(t.filter((e=>"Table"===e.type)))),e}function oo(e,t){return new Promise(((r,i)=>{const o={id:e,authentication:t};n.removeGroup(o).then((e=>e.success?r(e):i(e)),i)}))}function ao(e,t){return new Promise(((r,i)=>{const o={id:e,authentication:t};n.removeItem(o).then((e=>e.success?r(e):i(e)),i)}))}function so(e){return n.searchItems(e)}function lo(e,t,r){const i={q:e,params:{...r},authentication:t};return n.searchGroups(i)}function co(e,t,r,n){const i=n||{start:1,num:24},o={sortField:"title",sortOrder:"asc",...i};let a=r||[];return new Promise(((r,n)=>{lo(e,t,o).then((n=>{a=a.concat(n.results),n.nextStart>0?(i.start=n.nextStart,r(co(e,t,a,i))):r(a)}),(e=>n(e)))}))}function uo(e,t,r,i,o){const a={groupId:e,q:t,params:Object.assign({num:100},i),authentication:r,portal:o};return Array.isArray(a.params.categories)&&(a.params.categories=a.params.categories.map((e=>e.split(",")))),n.searchGroupContent(a)}function fo(e,t,r,i){return new Promise(((o,a)=>{const s={item:e,folderId:r,authentication:t,params:{...i??{}}};n.updateItem(s).then((e=>e.success?o(e):a(e)),(e=>a(e)))}))}function ho(e,t,r,i,o,a){return new Promise(((s,l)=>{const c={item:e,params:{text:t||{}},authentication:r};i&&(c.params.thumbnail=i),Yr(void 0,e)&&a&&(c.owner=a.locationTracking.owner),n.updateItem(c).then((t=>{if(o&&"private"!==o){const i={id:e.id,access:"public"===o?"public":"org",authentication:r};n.setItemAccess(i).then((()=>s(t)),(e=>l(Nt(e))))}else s(t)}),(e=>l(Nt(e))))}))}function po(e,t,r){return new Promise(((i,o)=>{const a=t=>{const a={id:e,data:t,authentication:r};n.addItemData(a).then(i,o)};t.type.startsWith("text/plain")?Ft(t).then(a,o):"application/json"===t.type?Pt(t).then(a,o):a(t)}))}function mo(e,t,r){return new Promise(((i,o)=>{const a={item:{id:e},params:{metadata:t},authentication:r};n.updateItem(a).then(i,o)}))}function go(e,t,r){return new Promise(((n,i)=>{const o=e.properties,a=r.folderId,s=r.isPortal,l=e.itemId;bn(o,e,r);const c=yo(o,r),u={},f={item:{...{title:e.item.title,name:e.item.name},preserveLayerIds:!0},folderId:a,params:u,authentication:t};f.item=Yr(e)?Xr(e,f,r):_o(f.item,e,o,u,s),Ki(r.organization.defaultExtent,c,o.service.spatialReference,r.organization.helperServices.geometry.url,t).then((t=>{r[l].solutionExtent=t,vn(r,l,t.spatialReference),f.item=yr(f.item,r),f.params=yr(f.params,r),e.item.thumbnail&&(f.params.thumbnail=e.item.thumbnail),n(f)}),(e=>i(Nt(e))))}))}function yo(e,t){const r=e.service.spatialReference,n=Mt(e,"defaultExtent.spatialReference.wkid"),i=Mt(t,"params.defaultExtent");return n&&n===r.wkid?e.defaultExtent:i||e.defaultExtent}function vo(e){const t={layers:[]};return Object.keys(e.objects).forEach((r=>{const n=e.objects[r];n.relationships&&n.relationships.length>0&&t.layers.push({id:n.id,relationships:n.relationships}),Ut(n,"relationships")})),t}function bo(e,t,r,n,i){const o={delete:{url:Rt(e)+t+"/deleteFromDefinition",params:{deleteFromDefinition:{fields:r&&r.hasOwnProperty("deleteFields")?r.deleteFields:[]}}},update:{url:Rt(e)+(t?`${t}/updateDefinition`:"updateDefinition"),params:{updateDefinition:r}},add:{url:Rt(e)+"addToDefinition",params:{addToDefinition:r}},refresh:{url:Rt(e)+"refresh",params:{f:"json"}}};return{url:o[i].url,params:o[i].params,args:n}}function wo(e,t,r,n){const i=e=>JSON.stringify(e).match(/{{.+?}}/gim);r&&mr(r)&&console.log(e+" ("+t+") contains variables in base: "+JSON.stringify(i(r))),n&&mr(n)&&console.log(e+" ("+t+") contains variables in data: "+JSON.stringify(i(n)))}function _o(e,t,r,n,i){const o=["Create","Query","Editing","Update","Delete","Uploads","Sync","Extract"],a=Mt(r,"service.capabilities")||(i?"":[]);e.capabilities=i?a.split(",").filter((e=>o.indexOf(e)>-1)).join(","):a,r.service.capabilities&&(r.service.capabilities=e.capabilities),xo(r);const s=["isView","sourceSchemaChangesAllowed","isUpdatableView","capabilities","isMultiServicesView"],l=["layers","tables"];i&&l.push("adminServiceInfo");const c=Object.keys(e);return Object.keys(r.service).forEach((t=>{-1===c.indexOf(t)&&l.indexOf(t)<0&&(e[t]=r.service[t],r.service.isView&&s.indexOf(t)>-1&&(n[t]=r.service[t]))})),e.isMultiServicesView&&Mt(e,"editorTrackingInfo.enableEditorTracking")&&(e.editorTrackingInfo.enableEditorTracking=!1,n.editorTrackingInfo=e.editorTrackingInfo),i&&Object.keys(e).indexOf("initialExtent")>-1&&!e.initialExtent&&Ut(e,"initialExtent"),e}function xo(e){(e.layers||[]).concat(e.tables||[]).forEach((e=>{const t=e.relationships,r=e.indexes;if(t&&t.length>0&&r&&r.length>0){const e=t.reduce(((e,t)=>("esriRelRoleOrigin"===t.role&&t.keyField&&e.indexOf(t.keyField)<0&&e.push(t.keyField),e)),[]);r.map((t=>(e.some((e=>new RegExp(`\\b${e}\\b`).test(t.fields)))&&(t.isUnique=!0),t)))}}))}function Io(e,t,r,i=1){return new Promise(((o,a)=>{const s={item:{id:e,url:t},authentication:r};n.updateItem(s).then((s=>{s.success?setTimeout((()=>{n.getItem(e,{authentication:r}).then((n=>{const s=n.url.indexOf("{");if(s>-1&&console.warn(e+" has template variable: "+n.url.substr(s)),t===n.url)o(e);else{const s="URL not updated for "+n.type+" "+n.id+": "+n.url+" ("+i+")";--i>0?Io(e,t,r,i).then(o,a):(console.error(e+": "+s+"; FAILED"),a(s))}}),(e=>a(Nt(e))))}),1e3):a(Nt(s))}),(e=>a(Nt(e))))}))}function ko(e,t={}){const i=[];return t.organization?i.push(Promise.resolve(t.organization)):i.push(n.getSelf({authentication:e})),i.push(n.getUser({authentication:e})),Promise.all(i).then((([t,n])=>{t.user=n;const i={authentication:e,portalSelf:t,isPortal:t.isPortal};return t.isPortal||(i.hubApiUrl=r.getHubUrlFromPortal(t)),i}))}function So(e,t){let r,n;return t.getUsername().then((n=>(r=n,c.getGroup(e,{authentication:t})))).then((i=>{if(i.owner!==r)return Promise.resolve(null);n=i.protected;const o={paging:{num:1},authentication:t};return c.getGroupContent(e,o)})).then((r=>{if(!r||r.total>0)return Promise.resolve({success:!1});if(n){const r={id:e,authentication:t};return c.unprotectGroup(r)}return Promise.resolve({success:!0})})).then((r=>{if(r.success){const r={id:e,authentication:t};return c.removeGroup(r)}return Promise.resolve({success:!1})})).then((e=>Promise.resolve(e.success))).catch((()=>Promise.resolve(!1)))}function Eo(e,t){return 0===e.length?Promise.resolve([]):Promise.all(e.map((e=>So(e,t)))).then((t=>e.filter(((e,r)=>t[r]))))}function Ao(e,t,r){return r.getUser({authentication:r}).then((e=>{const n=(new c.SearchQueryBuilder).match(r.username).in("owner").and().match(e.orgId).in("orgid").and().match(t).in("ownerfolder");return c.searchItems({q:n,authentication:r})})).then((n=>0===n.results.map((e=>e.id)).filter((t=>!e.includes(t))).length?c.removeFolder({folderId:t,owner:r.username,authentication:r}):Promise.resolve({success:!0}))).then((e=>e.success))}function To(e,t){const r={id:e,authentication:t};return c.unprotectItem(r).then((r=>r.success?ao(e,t):Promise.resolve(r))).then((t=>Promise.resolve({success:t.success,itemId:e})))}function Po(e){let t=[];const r=[],n={},i={},o={};function a(o){i[o]=Oo.InProgress;const s=pr(e,o);(s.dependencies||[]).concat(Mt(s,"properties.syncViews")||[]).forEach((function(e){i[e]===Oo.NotYetVisited?a(e):i[e]===Oo.InProgress?n[o]?n[o].push(e):n[o]=[e]:i[e]!==Oo.Finished&&r.indexOf(e)<0&&r.push(e)})),i[o]=Oo.Finished,t.push(o)}e.forEach((function(e){i[e.itemId]=Oo.NotYetVisited,o[e.itemId]=e.item?.typeKeywords&&e.item.typeKeywords.includes("View Service")?"View Service":e.item?.tags&&e.item.tags.includes("Location Tracking Group")?"Location Tracking Group":e.type})),e.forEach((function(e){i[e.itemId]===Oo.NotYetVisited&&a(e.itemId)}));const s=[],l=[],c=[],u=[];do{const e=t.shift();e&&("Location Tracking Group"===o[e]?s.push(e):"Feature Service"===o[e]?l.push(e):"View Service"===o[e]?c.push(e):u.push(e))}while(t.length>0);t=s.concat(l,c,u);return{buildOrder:t,missingDependencies:r,itemsToBePatched:n}}var Oo;function Fo(e){return Po(e).buildOrder}function Ro(t,r,n="",i=e.EItemProgressStatus.Started){const o=Math.round(t);r.progressCallback&&r.progressCallback(o,r.jobId,{event:"",data:n}),r.consoleProgress&&console.log(Date.now(),n,r.jobId??"",_i[i],o+"%")}function Co(t,r,n,i,o,a={}){let s,l;const f=t.items.shift(),d=i+o*(t.items.length+1);return f?Co(t,r,n,i,o,a).then((e=>([s,l]=e,c.unprotectItem({id:f.id,authentication:n})))).then((async()=>{if(r.includes(f.id)){const e=await ko(n);return u.removeSite(f.id,e)}return ao(f.id,n)})).then((()=>(s.items.push(f),Ro(d,a,f.id,e.EItemProgressStatus.Finished),[s,l]))).catch((t=>{const r=t.error?.message||t.message;return r&&r.includes("Item does not exist or is inaccessible")?Ro(d,a,f.id,e.EItemProgressStatus.Ignored):(l.items.push(f),Ro(d,a,f.id,e.EItemProgressStatus.Failed)),[s,l]})):(s={id:t.id,title:t.title,folder:t.folder,items:[],groups:[]},l={id:t.id,title:t.title,folder:t.folder,items:[],groups:[]},Promise.resolve([s,l]))}function zo(t,r,n,i){const o=i||{};let a,s,l=0,c=0,u=[];return new Promise((i=>{let f=Promise.resolve([{id:r.id,title:r.title,folder:r.folder,items:[],groups:[]},{id:r.id,title:r.title,folder:r.folder,items:[],groups:[]}]);if(r.items.length>0){u=r.items.map((e=>e.id)).concat([t]);const e=r.items.filter((e=>"Hub Site Application"===e.type)).map((e=>e.id));l=100/(r.items.length+2),Ro(c+=l,o),f=Co(r,e,n,c,l,o)}f.then((e=>([a,s]=e,new Promise((t=>{Eo(r.groups,n).then((()=>{t(e)}))}))))).then((()=>0===s.items.length?To(t,n):Promise.resolve({success:!1,itemId:t}))).then((i=>i.success?(Ro(99,o,t,e.EItemProgressStatus.Finished),Ao(u,r.folder,n)):Promise.resolve(!1))).then((()=>{i([a,s])})).catch((()=>{i([a,s])}))}))}function Do(e,t){const r={id:e,title:"",folder:"",items:[],groups:[]};let n,i=[],o=1;return Promise.all([Sr(e,t),Ar(e,t)]).then((a=>{const s=a[0];if(n=a[1],"Solution"!==s.type||!s.typeKeywords.includes("Solution")||!s.typeKeywords.includes("Deployed"))throw new Error("Item "+e+" is not a deployed Solution");return r.title=s.title,r.folder=s.ownerFolder,o=dr(n),i=n.templates,Br(e,t)})).then((e=>{r.items=e.map((e=>({id:e.id,type:e.type,title:e.title,modified:e.modified,owner:e.owner})));let t=[];t=o<1?Fo(i):i.map((e=>e.itemId));let a=new Set;return n.templates.forEach((e=>{e.groups.forEach((e=>{a=a.add(e)}))})),r.groups=[],a.forEach((e=>r.groups.push(e))),r.items.sort(((e,r)=>t.indexOf(e.id)-t.indexOf(r.id))),r}))}function Lo(e,t){let r;return new Promise(((n,i)=>{Do(e,t).then((e=>{r=e;const n=r.items.map((e=>Wr(e.id,t)));return Promise.all(n)})).then((e=>{r.items=r.items.filter(((t,r)=>1===e[r].length)),n(r)})).catch(i)}))}function Uo(e){const t=`${n.getPortalUrl(e)}/portals/self/subscriptioninfo`,r={httpMethod:"GET",...e};return i.request(t,r)}function Bo(e){if(r.getProp(e,"item.properties.schemaVersion")>=1)return e;const t=r.cloneObject(e);t.item.properties||(t.item.properties={});const n=r.getProp(t,"data.templates")||[];return t.data.templates=n.map((e=>({key:e.fieldName||e.key,type:e.type,item:e.item,data:e.data,itemId:e.itemId||e.fieldName||e.key,resources:e.resources||[]}))),t.item.properties.schemaVersion=1,t}function No(e){if(r.getProp(e,"item.properties.schemaVersion")>=2)return e;const t=r.cloneObject(e),n=(r.getProp(t,"data.configurationSettings")||[]).find((e=>"Indicators"===e.category));return t.data.indicators=function(e={}){e.fields&&Array.isArray(e.fields)||(e.fields=[]);return e.fields.map(jo)}(n),delete t.data.configurationSettings,t.item.properties.schemaVersion=2,t}!function(e){e[e.NotYetVisited=0]="NotYetVisited",e[e.InProgress=1]="InProgress",e[e.Finished=2]="Finished"}(Oo||(Oo={}));const jo=function(e){return{id:e.fieldName,type:"Data",name:e.label||e.fieldName,optional:e.optional||!1,definition:{description:e.label||e.fieldName,supportedTypes:[].concat(e.layerOptions.supportedTypes),geometryTypes:[].concat(e.layerOptions.geometryTypes),fields:e.fields.map(Mo)}}},Mo=function(e){return{id:e.fieldName,name:e.label,optional:e.optional||!1,description:e.tooltip,supportedTypes:[].concat(e.supportedTypes)}};function Wo(e){return r.getProp(e,"item.properties.schemaVersion")>=2.1||(e.data.templates=e.data.templates.map((e=>(e.key=e.fieldName||e.key,e.itemId=e.itemId||e.key,e))),e.item.properties.schemaVersion=2.1),e}function Vo(e){if(Mt(e,"item.properties.schemaVersion")>=2.2)return e;const t=r.cloneObject(e);return[{src:"{{solution.name}}",val:"{{solution.title}}"},{src:"{{initiative.name}}",val:"{{solution.title}}"},{src:"{{initiative.title}}",val:"{{solution.title}}"},{src:"{{initiative.extent}}",val:"{{organization.defaultExtentBBox}}"},{src:"{{initiative.collaborationGroupId",val:"{{teams.collaborationGroupId"},{src:"{{initiative.openDataGroupId",val:"{{teams.contentGroupId"},{src:"{{initiative.contentGroupId",val:"{{teams.contentGroupId"},{src:"{{initiative.followersGroupId",val:"{{teams.followersGroupId"},{src:"{{collaborationGroupId",val:"{{teams.collaborationGroupId"},{src:"{{contentGroupId",val:"{{teams.contentGroupId"},{src:"{{followersGroupId",val:"{{teams.followersGroupId"},{src:"{{initiative.id",val:"{{initiative.item.id"},{src:"{{organization.portalBaseUrl",val:"{{portalBaseUrl"}].forEach((e=>{t.data=r.deepStringReplace(t.data,e.src,e.val)})),t.item.properties.schemaVersion=2.2,t}function Go(e){if(Mt(e,"item.properties.schemaVersion")>=2.3)return e;const t=r.cloneObject(e);return t.data.templates=t.data.templates.map((e=>(e.resources?(e.assets=e.resources.map((e=>({name:e,type:"resource"}))),delete e.resources):e.assets=[],e))),t.item.properties.schemaVersion=2.3,t}function Zo(e){if(r.getProp(e,"item.properties.schemaVersion")>=2.4)return e;{const t=r.cloneObject(e);return t.data.templates.map((e=>({src:`{{${e.key}.item.id}}`,val:`{{${e.itemId}.itemId}}`}))).forEach((e=>{t.data=r.deepStringReplace(t.data,e.src,e.val)})),t.data.templates=t.data.templates.map((e=>(e.assets&&(e.resources=e.assets.map((t=>{let r=t.name;return r.indexOf("/")>-1&&(r=r.split("/")[1]),`${e.itemId}-${r}`}))),e.estimatedDeploymentCostFactor||(e.estimatedDeploymentCostFactor=1),e))),t.item.properties.schemaVersion=2.4,t}}function qo(e){if(Mt(e,"item.properties.schemaVersion")>=2.5)return e;{const t=Dt(e);return t.data.templates.forEach((e=>{if("Form"===e.type){Mt(e,"properties.form.portalUrl")&&(e.properties.form.portalUrl="{{portalBaseUrl}}");const t=parseFloat(Mt(e,"properties.form.version")||"2.5");if(!Mt(e,"properties.form")||t>=3.8)return e;e.properties.form.layerName="survey",Mt(e,"properties.form.theme")&&(e.properties.form.themes=[e.properties.form.theme],delete e.properties.form.theme);const r=e=>(e.appearance&&e.appearance.layout&&(e.appearance.layout="vertical"),e);e.properties.form.questions=e.properties.form.questions.map((e=>e.questions?{...e,questions:e.questions.map(r)}:r(e))),e.properties.form.version=3.8}})),t.item.properties.schemaVersion=2.5,t}}function $o(e){if(Mt(e,"item.properties.schemaVersion")>=2.6)return e;{const t=Dt(e),r=(e,t)=>(Mt(t,"properties.form.questions.length")&&t.properties.form.questions.forEach((r=>{r.maps&&r.maps.forEach((r=>{const n=qt(r.itemId);t.dependencies=t.dependencies.filter((e=>e!==n)),e.push(n)}))})),e),n=t.data.templates.filter((({type:e})=>"Form"===e)).reduce(r,[]);return t.data.templates=t.data.templates.filter((e=>!n.includes(e.itemId))),t.item.properties.schemaVersion=2.6,t}}function Yo(e){return r.getProp(e,"item.properties.schemaVersion")>=2.7||(e.data.templates=e.data.templates.map(((e,t,n)=>(e.itemId||(e.itemId=r.createId()),e.dependencies||(e.dependencies=[]),t>0&&0===e.dependencies.length&&(e.dependencies=[n[t-1].itemId]),e))),e.item.properties.schemaVersion=2.7),e}function Ho(e){if(Mt(e,"item.properties.schemaVersion")>=3)return e;{const t=Dt(e);return t.item.properties.schemaVersion=3,t}}var Jo;function Ko(t,r,n=0,i){if(void 0!==i)switch(i){case e.SolutionResourceType.data:t=`${t}_info_data`;break;case e.SolutionResourceType.fakezip:t=`${t}_info_dataz`;break;case e.SolutionResourceType.info:t=`${t}_info`;break;case e.SolutionResourceType.metadata:t=`${t}_info_metadata`;break;case e.SolutionResourceType.thumbnail:t=`${t}_info_thumbnail`}let o=t,a=r;const s=a.lastIndexOf("/");if(s>=0){let e=a.substr(0,s);0===n?(e=e.replace("/","_"),o+="_"+e):o+="/"+e,a=a.substr(s+1)}return{folder:o,filename:a}}function Xo(t,r=0){const n=t.split("/");let i=n.pop(),o="";const a=n.shift();let s=e.EFileType.Resource;if(a)if(a.endsWith("_info_thumbnail"))s=e.EFileType.Thumbnail;else if(a.endsWith("_info_metadata"))s=e.EFileType.Metadata,i="metadata.xml";else if(a.endsWith("_info_data"))s=e.EFileType.Data;else if(a.endsWith("_info_dataz"))i=i.replace(/\.zip$/,""),s=e.EFileType.Data;else if(r<1){const e=a.indexOf("_");e>0&&(o=a.substr(e+1))}else o=n.join("/");return{type:s,folder:o,filename:i}}function Qo(e,t,r){return{...e,fetchedFromSource:t,copiedToDestination:r}}function ea(e,t,r,n){return new Promise((i=>{_r(e.url,t).then((t=>{fo({id:r,data:ta({blob:t,filename:e.filename,mimeType:e.mimeType||t.type})},n,e.folder).then((()=>i(Qo(e,!0,!0))),(()=>i(Qo(e,!0,!1))))}),(()=>i(Qo(e,!1))))}))}function ta(e){return At([e.blob],e.filename,{type:e.mimeType})}function ra(e,t,r){const i={item:{id:t},params:{metadata:e},authentication:r};return n.updateItem(i)}function na(e,t,r,n){return new Promise((i=>{_r(e.url,t).then((t=>{"text/xml"===t.type||"application/xml"===t.type?ra(t,r,n).then((()=>i(Qo(e,!0,!0))),(()=>i(Qo(e,!0,!1)))):i(Qo(e,!1))}),(()=>i(Qo(e,!1))))}))}function ia(e,t){return e.folder?t.zip.folder(e.folder).file(e.filename,e.file,{binary:!0}):t.zip.file(e.filename,e.file,{binary:!0}),t.filelist.push(e),Qo(e,!0)}function oa(e,t,r){return new Promise((n=>{Ir(e.url,e.filename,t).then((t=>{e.folder?r.zip.folder(e.folder).file(e.filename,t,{binary:!0}):r.zip.file(e.filename,t,{binary:!0}),r.filelist.push(e),n(Qo(e,!0))}),(()=>n(Qo(e,!1))))}))}function aa(e,t,r){return new Promise((i=>{e.zip.generateAsync({type:"blob"}).then((t=>Ot(t,e.filename,"application/zip"))).then((e=>{const i={id:t,resource:e,authentication:r,params:{archive:!0}};return n.addItemResource(i)})).then((()=>i(Qo(e,!0,!0))),(()=>i(Qo(e,!0,!1))))}))}function sa(e,t,n,i=40){return new Promise((o=>{let a=[];const s=[];if(e.length>0){r.chunkArray(e,i).forEach(((e,t)=>{const r={filename:`resources${t}.zip`,zip:new he,filelist:[]};a=a.concat(e.map((e=>ia(e,r)))),s.push(r)}))}a.length>0?Promise.all(a).then((e=>{e=e.filter((e=>!(e.fetchedFromSource&&void 0===e.copiedToDestination))),ca(s,t,n).then((t=>{o(e.concat(t))}))})):o([])}))}function la(t,n,i,o){return new Promise((a=>{let s=[],l=t;s=t.filter((t=>t.type===e.EFileType.Data||t.type===e.EFileType.Metadata)).map((t=>{switch(t.type){case e.EFileType.Data:return ea(t,n,i,o);case e.EFileType.Metadata:return na(t,n,i,o)}})),l=t.filter((t=>t.type===e.EFileType.Info||t.type===e.EFileType.Resource));const c=[];if(l.length>0){r.chunkArray(l,40).forEach(((e,t)=>{const r={filename:`resources${t}.zip`,zip:new he,filelist:[]};s=s.concat(e.map((e=>oa(e,n,r)))),c.push(r)}))}s.length>0?Promise.all(s).then((e=>{e=e.filter((e=>!(e.fetchedFromSource&&void 0===e.copiedToDestination))),ca(c,i,o).then((t=>{a(e.concat(t))}))})):a([])}))}function ca(e,t,r){return new Promise((n=>{const i=[],o=e.filter((e=>Object.keys(e.zip.files).length>0));o.length>0?ua(o,t,r).then((e=>{n(e)})):n(i)}))}function ua(e,t,r){return new Promise((n=>{let i=[];const o=e.pop();let a=Promise.resolve([]);e.length>0&&(a=ua(e,t,r)),a.then((e=>(i=e,new Promise((e=>{setTimeout((()=>e()),1e3)}))))).then((()=>aa(o,t,r))).then((e=>{e.filelist.forEach((t=>{i.push(Qo(t,!0,e.copiedToDestination))})),n(i)}))}))}function fa(e){return{folder:e+"_info_metadata",filename:"metadata.xml"}}function da(e,t,r,n,i=!1,o=0){const a=n.map((r=>({itemId:t,url:pa(e,t,r),...Ko(t,r,o)})));if(a.push({itemId:t,url:ha(e,t,i),...fa(t)}),r){const n={itemId:t,url:Tt(ma(e,t,r,i),"w=400"),...ga(t,r)};a.push(n)}return a}function ha(e,t,r=!1){return Rt(e)+(r?"community/groups/":"content/items/")+t+"/info/metadata/metadata.xml"}function pa(e,t,r){return Rt(e)+"content/items/"+t+"/resources/"+r}function ma(e,t,r,n=!1){return Rt(e)+(n?"community/groups/":"content/items/")+t+"/info/"+r}function ga(e,t){const r=e+"_info_thumbnail",n=t.split("/");return{folder:r,filename:1===n.length?n[0]:n[1]}}function ya(e){const t=e.match(/\.([a-z]+)$/i);return!!t&&"|.json|.xml|.txt|.png|.pbf|.zip|.jpeg|.jpg|.gif|.bmp|.gz|.svg|.svgz|.geodatabase|".indexOf("|"+t[0]+"|")>=0}e.SolutionResourceType=void 0,(Jo=e.SolutionResourceType||(e.SolutionResourceType={}))[Jo.thumbnail=0]="thumbnail",Jo[Jo.metadata=1]="metadata",Jo[Jo.resource=2]="resource",Jo[Jo.data=3]="data",Jo[Jo.fakezip=4]="fakezip",Jo[Jo.info=5]="info";function va(e,t){let r=JSON.stringify(e);if(r.indexOf(t)>-1){r=r.replace(new RegExp(`${t}`,"gi"),"{{velocityUrl}}");const e=new RegExp("{{velocityUrl}}.+?(?=/[A-Za-z]+Server)","gi"),n=r.match(e);if(n){n.filter(((e,t,r)=>r.indexOf(e)===t)).forEach((e=>{r=r.replaceAll(e,`${e}_{{solutionItemId}}`)}))}return JSON.parse(r)}return e}Object.defineProperty(e,"rest_addFeatures",{enumerable:!0,get:function(){return t.addFeatures}}),Object.defineProperty(e,"rest_queryFeatures",{enumerable:!0,get:function(){return t.queryFeatures}}),Object.defineProperty(e,"rest_request",{enumerable:!0,get:function(){return i.request}}),Object.defineProperty(e,"UserSession",{enumerable:!0,get:function(){return o.UserSession}}),e.BASE_NAMES=["feat-lyr-new","feat-lyr-existing","stream-lyr-new"],e.CURRENT_SCHEMA_VERSION=3,e.DeployedSolutionFormatVersion=1,e.GEOCODE_SERVER_NAME=cr,e.GEOMETRY_SERVER_NAME="organization.helperServices.geometry.url",e.NA_SERVER_NAME="organization.helperServices.route.url",e.PRINT_SERVER_NAME="organization.helperServices.printTask.url",e.PROP_NAMES=[".portal.mapServicePortalItemID",".portal.featureServicePortalItemID",".portal.streamServicePortalItemID",".portalItemId"],e.SERVER_NAME="portalBaseUrl",e.SItemProgressStatus=_i,e.Sanitizer=kt,e.SolutionTemplateFormatVersion=1,e.TRANSFORMS=ur,e._addItemDataFile=po,e._addItemMetadataFile=mo,e._applyEdits=Gi,e._cacheFieldInfo=tn,e._cachePopupInfo=rn,e._copyAssociatedFileZips=ca,e._countRelationships=function(e){return e.reduce(((e,t)=>e+(t.relationships?t.relationships.length:0)),0)},e._fixTextBlobType=Gr,e._getAddFeatures=Mi,e._getAssignmentIntegrationInfos=Ti,e._getAssignmentTypeInfos=Ai,e._getCreateServiceOptions=go,e._getDependantItemId=Gn,e._getDomainAndAliasInfos=An,e._getFallbackExtent=yo,e._getField=Wi,e._getFieldNames=hn,e._getFieldVisibilityUpdates=In,e._getFields=Ni,e._getGroupContentsTranche=Zr,e._getItemResourcesTranche=qr,e._getLayerChunkSize=yi,e._getNameMapping=gi,e._getPortalViewFieldUpdates=Sn,e._getRandomNumberInRange=Yt,e._getRelationshipUpdates=vo,e._getTypeIdField=xn,e._getURLs=Bi,e._getUpdate=bo,e._isViewFieldOverride=Tn,e._padPositiveNum=Ht,e._parseAdminServiceData=io,e._processAdminObject=Mn,e._replaceVelocityUrls=va,e._reportVariablesInItem=wo,e._setItemProperties=_o,e._setName=Jr,e._sortRelationships=eo,e._templatize=On,e._templatizeAdminLayerInfo=jn,e._templatizeAdminLayerInfoFields=Vn,e._templatizeAdminSourceLayerFields=Zn,e._templatizeArcadeExpressions=ci,e._templatizeAuthoringInfo=li,e._templatizeDefinitionEditor=ti,e._templatizeDefinitionExpression=ri,e._templatizeDefinitionQuery=mi,e._templatizeDrawingInfo=ii,e._templatizeExpressionInfos=Xn,e._templatizeFieldName=Kn,e._templatizeGenRenderer=ai,e._templatizeKeys=hi,e._templatizeLabelingInfo=ui,e._templatizeLayer=Rn,e._templatizeLayerFieldReferences=Nn,e._templatizeMediaInfos=ei,e._templatizeName=Hn,e._templatizePopupElements=Qn,e._templatizePopupInfo=Yn,e._templatizePopupInfoFieldInfos=Jn,e._templatizeProperty=Fn,e._templatizeRelationshipFields=$n,e._templatizeRenderer=oi,e._templatizeSimpleName=ni,e._templatizeSourceServiceName=Wn,e._templatizeTemplates=fi,e._templatizeTemporalRenderer=si,e._templatizeTimeInfo=pi,e._templatizeTopFilter=qn,e._templatizeTypeTemplates=di,e._templatizeUrlTemplate=Oi,e._templatizeWorkforceDispatcherOrWorker=zi,e._templatizeWorkforceProject=Ci,e._updateAddOptions=un,e._updateDispatchers=Vi,e._updateForPortal=dn,e._updateGeomFieldName=gn,e._updateGlobalIdAndAssignmentType=Ei,e._updateIndexesForRelationshipKeyFields=xo,e._updateItemFields=pn,e._updateItemURL=Io,e._updateSourceLayerFields=mn,e._updateTemplateDictionaryFields=yn,e._updateTypeKeywords=nn,e._updateUrl=ji,e._validateDisplayField=zn,e._validateDomains=kn,e._validateEditFieldsInfo=Bn,e._validateExtent=Ji,e._validateFields=Cn,e._validateIndexes=Dn,e._validateTemplatesFields=Ln,e._validateTrackingTemplates=$r,e._validateTypesTemplates=Un,e._validateViewDomainsAndAlias=En,e.addFeatureServiceDefinition=cn,e.addFeatureServiceLayersAndTables=function(e,t,r,n){return new Promise(((i,o)=>{if(Yr(e))i(null);else{const a={},s={},l=ln(e);l.length>0?cn(e.item.url||"",l,t,n,e.key,s,a,e).then((()=>{wn(e,a,r,s,t).then((e=>{let r=Qi({message:"updated layer definition",objects:e.layerInfos.fieldInfos,itemTemplate:e.itemTemplate,authentication:n},t.isPortal);t.isPortal&&(r=to(e.itemTemplate,n,r)),r.reduce(((e,t)=>e.then((()=>ro(t)))),Promise.resolve(null)).then((()=>i(null)),(e=>o(Nt(e))))}))}),(e=>o(Nt(e)))):i(null)}}))},e.addForwardItemRelationship=Zi,e.addForwardItemRelationships=function(e,t,r){return new Promise((n=>{const i=new Array;t.forEach((t=>{t.relatedItemIds.forEach((n=>{i.push(Zi(e,n,t.relationshipType,r))}))})),Promise.all(i).then((e=>n(e)))}))},e.addMetadataFromBlob=ra,e.addResourceFromBlob=function(e,t,r,o,a){if(o&&o.indexOf(".")<0)return new Promise(((e,t)=>{t(new i.ArcGISAuthError("Filename must have an extension indicating its type"))}));const s={id:t,resource:e,name:o,authentication:a,params:{}};return r&&(s.params={resourcesPrefix:r}),n.addItemResource(s)},e.addThumbnailFromBlob=function(e,t,r,i=!1){const o={params:{thumbnail:e},authentication:r};return o[i?"group":"item"]={id:t},i?n.updateGroup(o):n.updateItem(o)},e.addToServiceDefinition=$i,e.addTokenToUrl=qi,e.appendQueryParam=Tt,e.blobToFile=Ot,e.blobToJson=Pt,e.blobToText=Ft,e.cacheFieldInfos=en,e.cachePopupInfos=function(e){const t={layers:{},tables:{}};return e&&e.layers&&e.layers.length>0&&rn(t,"layers",e.layers),e&&e.tables&&e.tables.length>0&&rn(t,"tables",e.tables),t},e.checkJsonForError=function(e){return void 0!==e?.error},e.checkRequestStatus=Yi,e.checkUrlPathTermination=Rt,e.cleanItemId=qt,e.cleanLayerBasedItemId=function(e){return e?e.replace("{{","").replace(/([.]layer([0-9]|[1-9][0-9])[.](item|layer)Id)[}]{2}/,""):e},e.cleanLayerId=function(e){return e?.toString()?parseInt(e.toString().replace(/[{]{2}.{32}[.]layer/,"").replace(/[.]layerId[}]{2}/,""),10):e},e.cloneObject=Dt,e.compareJSON=function(e,t){return JSON.stringify(e)===JSON.stringify(t)},e.compareJSONNoEmptyStrings=function(e,t){return JSON.stringify(e).replace(/":""/g,'":null')===JSON.stringify(t).replace(/":""/g,'":null')},e.compareJSONProperties=Lt,e.convertBlobToSupportableResource=function(e,t=""){const r=e.name||t;let n=r;return n&&!ya(n)&&(n+=".zip"),{blob:At([e],n,{type:e.type}),filename:r,mimeType:e.type}},e.convertExtent=Xi,e.convertExtentWithFallback=Ki,e.convertItemResourceToStorageResource=Ko,e.convertStorageResourceToItemResource=Xo,e.convertToISearchOptions=Hi,e.convertWorkforceItemToTemplate=function(e,t){return new Promise(((r,n)=>{const i=Li(1),o=e.data;o?xi(o,i,t).then((t=>{e.dependencies=t.dependencies,e.data=Ii(o,i,t.urlHash),r(e)}),(e=>n(Nt(e)))):r(e)}))},e.copyAssociatedFilesByType=la,e.copyDataIntoItem=ea,e.copyFilesAsResources=sa,e.copyFilesFromStorageItem=function(t,r,n,i,o,a={}){const s=a.properties||null;return a.itemId&&(r=r.map((e=>(0===e.filename.indexOf(a.itemId)&&""===e.folder&&(e.filename=e.filename.replace(`${a.itemId}-`,"")),e)))),new Promise(((a,l)=>{la(r.map((t=>({folder:t.type===e.EFileType.Data?n:t.folder,filename:t.filename,type:t.type,mimeType:s?s[t.filename]:"",url:t.url}))),t,i,o).then((e=>{e.filter((e=>"metadata.xml"!==e.filename)).map((e=>e.fetchedFromSource&&e.copiedToDestination)).reduce(((e,t)=>e&&t),!0)?a(!0):l()}))}))},e.copyFilesToStorageItem=function(e,t,r){return new Promise((n=>{sa(e,t,r).then((e=>{n(e.filter((e=>e.fetchedFromSource&&e.copiedToDestination)).map((e=>e.folder+"/"+e.filename)))}))}))},e.copyMetadataIntoItem=na,e.copyResourceIntoZip=ia,e.copyResourceIntoZipFromInfo=oa,e.copyZipIntoItem=aa,e.createCopyResults=Qo,e.createFeatureService=function(e,t,r){return new Promise(((n,i)=>{go(e,t,r).then((e=>{a.createFeatureService(e).then((e=>{n(e)}),(e=>i(Nt(e))))}),(e=>i(Nt(e))))}))},e.createFullItem=function(e,t,r,i,o,a,s,l,c="private"){return new Promise(((u,f)=>{const d={item:{...e},folderId:t,authentication:r};qi(i,o).then((e=>{e&&(d.item.thumbnailurl=Tt(e,"w=400")),n.createItemInFolder(d).then((e=>{if(e.success){let t;if("private"!==c){const i={id:e.id,access:"public"===c?"public":"org",authentication:r};t=n.setItemAccess(i)}else t=Promise.resolve({itemId:e.id});t.then((()=>{const t=[];a&&t.push(po(e.id,a,r)),Array.isArray(l)&&l.length>0&&t.push(new Promise(((t,i)=>{St("resources.zip",l).then((o=>{const a={id:e.id,resource:o,authentication:r,params:{archive:!0}};n.addItemResource(a).then(t,i)}),i)}))),s&&t.push(mo(e.id,s,r)),Promise.all(t).then((()=>u(e)),(e=>f(Nt(e))))}),(e=>f(Nt(e))))}else f(Nt())}),(e=>f(Nt(e))))}))}))},e.createHubRequestOptions=ko,e.createInitializedGroupTemplate=function(e){const t=fr(e.id,e.type);return t.item={...t.item,description:e.description,snippet:e.snippet,tags:e.tags,typeKeywords:e.typeKeywords,title:e.title,thumbnail:e.thumbnail},t},e.createInitializedItemTemplate=function(e){const t=fr(e.id,e.type);return t.item={...t.item,accessInformation:e.accessInformation,categories:e.categories,contentStatus:e.contentStatus,created:e.created,culture:e.culture,description:e.description,extent:gr(e),licenseInfo:e.licenseInfo,modified:e.modified,name:e.name,origUrl:e.origUrl,properties:e.properties,snippet:e.snippet,spatialReference:void 0,tags:e.tags,thumbnail:e.thumbnail,title:e.title,typeKeywords:e.typeKeywords,url:e.url},t},e.createItemWithData=function(e,t,r,i,o="private"){return new Promise(((a,s)=>{const l={item:{title:"_",...e,data:t},folderId:i,authentication:r};e.thumbnail&&(l.params={thumbnail:e.thumbnail},delete l.item.thumbnail),n.createItemInFolder(l).then((e=>{if(e.success)if("private"!==o){const t={id:e.id,access:"public"===o?"public":"org",authentication:r};n.setItemAccess(t).then((()=>{a({folder:e.folder,id:e.id,success:!0})}),(e=>s(Nt(e))))}else a({folder:e.folder,id:e.id,success:!0});else s(Nt())}),(e=>s(Nt(e))))}))},e.createLongId=function(){return r.createId("")+r.createId("")+r.createId("")+r.createId("")},e.createMimeTypedFile=ta,e.createPlaceholderTemplate=fr,e.createShortId=Ct,e.createUniqueFolder=function e(t,r,i){return new Promise(((o,a)=>{const s=Zt(t,r,"user.folders"),l={title:s,authentication:i};n.createFolder(l).then((e=>o(e)),(n=>{const l=Mt(n,"response.error.details");if(Array.isArray(l)&&l.length>0){const c="Folder title '"+s+"' not available.";l.indexOf(c)>=0?(Mt(r,"user.folders")||Vt(r,"user.folders",[]),r.user.folders.push({title:s}),e(t,r,i).then(o,a)):a(n)}else a(n)}))}))},e.createUniqueGroup=function e(t,r,i,o,a){return new Promise(((s,l)=>{let c;c=a&&a!==o.username?co(`(owner:${a}) orgid:${i.organization.id}`,o):Promise.resolve([]),c.then((a=>{i.allGroups=a.concat(Mt(i,"user.groups")),r.title=Zt(t,i,"allGroups");const c={group:r,authentication:o};n.createGroup(c).then(s,(n=>{const a=Mt(n,"response.error.details");if(Array.isArray(a)&&a.length>0){const c="You already have a group named '"+r.title+"'. Try a different name.";a.indexOf(c)>=0?(i.user.groups.push({title:r.title}),e(t,r,i,o).then(s,l)):l(n)}else l(n)}))}),(e=>l(e)))}))},e.createZip=St,e.deTemplatizeFieldInfos=sn,e.dedupe=function(e=[]){if(0===e.length)return[];const t=new Set(e),r=[];return t.forEach((e=>r.push(e))),r},e.deleteEmptyGroups=Eo,e.deleteGroupIfEmpty=So,e.deleteItemProps=function(e){const t=["accessInformation","appCategories","banner","categories","culture","description","documentation","extent","groupDesignations","industries","languages","licenseInfo","listed","name","properties","proxyFilter","screenshots","size","snippet","spatialReference","tags","title","type","typeKeywords","url"];return Bt(e,Object.keys(e).filter((e=>t.indexOf(e)<0))),e},e.deleteProp=Ut,e.deleteProps=Bt,e.deleteSolution=function(e,t,r){return Lo(e,t).then((n=>zo(e,n,t,r))).catch((()=>[void 0,void 0]))},e.deleteSolutionByComponents=function(e,t,r,n,i,o){const a={id:e,title:"",folder:n.folderId,items:[],groups:[]};let s=r.map((e=>({id:e.itemId,type:e.type,title:e.item.title,modified:0,owner:""}))).map((e=>(e.id=n[e.id].itemId,e))).filter((e=>!!e.id));return s=s.filter((e=>t.includes(e.id))),s.sort(((e,r)=>t.indexOf(e.id)-t.indexOf(r.id))),s.forEach((e=>{"Group"===e.type?a.groups.push(e.id):a.items.push(e)})),zo(e,a,i,o)},e.deleteSolutionFolder=Ao,e.deleteSolutionItem=To,e.deleteViewProps=Qr,e.extractDependencies=function(e,t){const r=[];return new Promise(((n,o)=>{e.properties.service.isView&&e.item.url&&!Yr(e)?i.request(Rt(e.item.url)+"sources?f=json",{authentication:t}).then((e=>{e&&e.services&&e.services.forEach((e=>{r.push({id:e.serviceItemId,name:e.name})})),n(r)}),(e=>o(Nt(e)))):Di(e)?n(ki(e,r)):n(r)}))},e.extractSolutionVersion=dr,e.extractWorkforceDependencies=xi,e.fail=Nt,e.failWithIds=function(e,t){return t?{success:!1,itemIds:e,error:t.error||t}:{success:!1,itemIds:e}},e.findTemplateInList=pr,e.findTemplateIndexInList=hr,e.fineTuneCreatedWorkforceItem=function(e,t,r,n){return new Promise(((i,o)=>{t.getUser().then((a=>{r=ji(r);const s=Mt(e,"data.dispatchers");Vi(s&&s.url?s.url:`${r}2`,a.username||"",a.fullName||"",t,n.isPortal).then((a=>{let s=Mt(e,"properties.workforceInfos");s&&r?(s=yr(s,n),Ni(r,[2,3,4],t).then((e=>{const n=`${r}3`,a=Gi(n,Mi(s.assignmentTypeInfos,e[n]),t,!0),l=`${r}4`,c=Gi(l,Mi(s.assignmentIntegrationInfos,e[l]),t,!0);Promise.all([a,c]).then(i,o)}),(e=>o(Nt(e))))):i({success:a})}),(e=>o(Nt(e))))}),(e=>o(Nt(e))))}))},e.generateEmptyCreationResponse=function(e,t=""){return{item:null,id:t,type:e,postProcess:!1}},e.generateMetadataStorageFilename=fa,e.generateSourceFilePaths=da,e.generateSourceMetadataUrl=ha,e.generateSourceResourceUrl=pa,e.generateSourceThumbnailUrl=ma,e.generateStorageFilePaths=function(e,t,r=[],n=0){return r.map((r=>({url:pa(e,t,r),...Xo(r,n)})))},e.generateThumbnailStorageFilename=ga,e.getBlob=_r,e.getBlobAsFile=Ir,e.getBlobCheckForError=kr,e.getBlobText=function(e){let t;return t=void 0!==e.text?e.text():new Promise(((t,r)=>{const n=new FileReader;n.onload=function(e){e.target&&e.target.result?t(e.target.result):t("")},n.onerror=function(e){r(e)},n.readAsText(e)})),t},e.getCompleteItem=function(e,t){let r,n;return Sr(e,t).then((n=>(r=n,Promise.all([Er(e,r.name,t),Nr(e,r.thumbnail,!1,t),Fr(e,t),Ur(e,t),Dr(e,"forward",t),Dr(e,"reverse",t)])))).then((e=>{const[i,o,a,s,l,c]=e;return n={base:r,data:i,thumbnail:o,metadata:a,resources:s,fwdRelatedItems:l,revRelatedItems:c},"Feature Service"===r.type?no(r.url,t):Promise.resolve(null)})).then((e=>(e&&(n.featureServiceProperties=e),Promise.resolve(n))))},e.getDefaultExtent=gr,e.getDeletableSolutionInfo=Lo,e.getExistingLayersAndTables=function(e,t,r){return new Promise((n=>{const o=t.map((t=>i.request(Rt(e)+t,{authentication:r})));Promise.all(o.map((e=>e.catch((e=>e))))).then(n)}))},e.getFeatureServiceProperties=no,e.getFilenameFromUrl=function(e){if(!e)return"";let t=e.indexOf("?");t<0&&(t=e.length);const r=e.lastIndexOf("/",t)+1;return r<t?e.substring(r,t):""},e.getFinalServiceUpdates=to,e.getFoldersAndGroups=function(e){return new Promise(((t,r)=>{const n={httpMethod:"GET",authentication:e,rawResponse:!1},o=`${e.portal}/content/users/${encodeURIComponent(e.username)}`,a=`${e.portal}/community/users/${encodeURIComponent(e.username)}`;Promise.all([i.request(o,n),i.request(a,n)]).then((e=>{t({folders:e[0].folders||[],groups:e[1].groups||[]})}),(e=>r(e)))}))},e.getGroupBase=function(e,t){const r={authentication:t};return n.getGroup(e,r)},e.getGroupCategorySchema=function(e,t){const r={authentication:t};return n.getGroupCategorySchema(e,r)},e.getGroupContents=function(e,t){return new Promise(((r,n)=>{Zr(e,{start:1,num:100},t).then((e=>{r(e)}),n)}))},e.getIDs=jt,e.getIdsInTemplatesList=function(e){return e.map((e=>e.itemId))},e.getItemBase=Sr,e.getItemDataAsFile=Er,e.getItemDataAsJson=Ar,e.getItemDataBlob=Tr,e.getItemDataBlobUrl=Pr,e.getItemInfoFileUrlPrefix=Or,e.getItemMetadataAsFile=Fr,e.getItemMetadataBlob=Rr,e.getItemMetadataBlobUrl=Cr,e.getItemRelatedItems=zr,e.getItemRelatedItemsInSameDirection=Dr,e.getItemResources=Lr,e.getItemResourcesFiles=Ur,e.getItemResourcesFilesFromPaths=function(e,t){return Promise.all(e.map((e=>new Promise((r=>{Ir(e.url,e.filename,t).then((t=>{r({itemId:e.itemId,file:t,folder:e.folder,filename:e.filename})}),(()=>{r(null)}))}))))).then((e=>e.filter((e=>!!e))))},e.getItemResourcesPaths=function(e,t,r,n=0){return Lr(e.itemId,r).then((t=>{const i=t.resources.map((e=>e.resource)).filter((t=>{let r=!0;return"StoryMap"===e.type&&(-1!==["oembed.json","oembed.xml"].indexOf(t)&&(r=!1),t.match(/^draft_[\s\S]*.json$/)&&(r=!1)),"Web Experience"===e.type&&"config/config.json"===t&&(r=!1),r})),o=da(r.portal,e.itemId,e.item.thumbnail,i,"Group"===e.type,n);return Promise.resolve(o)}))},e.getItemThumbnail=function(e,t,r,n){return new Promise(((i,o)=>{if(!t)return void i(null);kr(jr(e,t,r,n),n,[500]).then((e=>i(Gr(e))),o)}))},e.getItemThumbnailAsFile=Nr,e.getItemThumbnailUrl=jr,e.getItemTypeAbbrev=function(e){return{Group:"grp","Big Data Analytic":"bda","Feature Collection":"col","Feature Service":"svc",Feed:"fee","Geocoding Service":"xxx","Geodata Service":"xxx","Geometry Service":"xxx","Geoprocessing Service":"xxx","Globe Service":"xxx","Image Service":"xxx",KML:"xxx","Map Service":"xxx","Network Analysis Service":"xxx","Real Time Analytic":"rta","Relational Database Connection":"xxx","Scene Service":"xxx","Stream Service":"xxx",Tool:"xxx","Vector Tile Service":"xxx",WFS:"xxx",WMS:"xxx",WMTS:"xxx","Workflow Manager Service":"xxx","3D Web Scene":"xxx","Web Map":"map","Web Scene":"sc2",Application:"xxx","Data Store":"xxx","Desktop Application":"xxx","Excalibur Imagery Project":"xxx",Form:"frm","Hub Initiative":"hin","Hub Page":"hpg","Hub Site Application":"hsa","Insights Model":"xxx","Insights Page":"xxx","Insights Theme":"xxx","Insights Workbook":"xxx",Mission:"xxx","Mobile Application":"xxx","Native Application":"xxx",Notebook:"nbk","Oriented Imagery Catalog":"oic","Ortho Mapping Project":"xxx","QuickCapture Project":"qck","Site Application":"xxx","Site Initiative":"xxx","Site Page":"xxx",Solution:"sol",StoryMap:"sty","Urban Model":"xxx","Web Experience Template":"wxt","Web Experience":"wex","Web Mapping Application":"wma","Workforce Project":"wrk","360 VR Experience":"xxx","AppBuilder Extension":"xxx","AppBuilder Widget Package":"xxx","Application Configuration":"xxx","ArcGIS Pro Add In":"pro","ArcGIS Pro Configuration":"xxx","ArcPad Package":"xxx","Basemap Package":"xxx","CAD Drawing":"xxx","CityEngine Web Scene":"xxx","Code Attachment":"cod","Code Sample":"sam","Color Set":"xxx","Compact Tile Package":"xxx","CSV Collection":"xxx",CSV:"csv",Dashboard:"dsh","Deep Learning Package":"xxx","Desktop Add In":"dai","Desktop Application Template":"dat","Desktop Style":"xxx","Document Link":"doc","Explorer Add In":"xxx","Explorer Layer":"xxx","Explorer Map":"xxx","Feature Collection Template":"xxx","File Geodatabase":"xxx",GeoJson:"jsn",GeoPackage:"xxx","Geoprocessing Package":"gpk","Geoprocessing Sample":"geo","Globe Document":"xxx","Image Collection":"xxx",Image:"img","iWork Keynote":"xxx","iWork Numbers":"xxx","iWork Pages":"xxx","KML Collection":"xxx","Layer Package":"lyp","Layer Template":"xxx",Layer:"xxx",Layout:"xxx","Locator Package":"xxx","Map Document":"xxx","Map Package":"xxx","Map Template":"mpt","Microsoft Excel":"xls","Microsoft Powerpoint":"ppt","Microsoft Word":"wrd","Mobile Basemap Package":"xxx","Mobile Map Package":"xxx","Mobile Scene Package":"xxx","Native Application Installer":"xxx","Native Application Template":"xxx",netCDF:"xxx","Operation View":"opv","Operations Dashboard Add In":"xxx","Operations Dashboard Extension":"xxx",PDF:"xxx","Pro Layer Package":"xxx","Pro Layer":"xxx","Pro Map Package":"prm","Pro Map":"xxx","Pro Report":"xxx","Project Package":"ppk","Project Template":"prt","Published Map":"xxx","Raster function template":"xxx","Report Template":"xxx","Rule Package":"xxx","Scene Document":"xxx","Scene Package":"xxx","Service Definition":"xxx",Shapefile:"xxx","Statistical Data Collection":"xxx",Style:"xxx","Survey123 Add In":"xxx","Symbol Set":"xxx","Task File":"xxx","Tile Package":"xxx","Toolbox Package":"xxx","Vector Tile Package":"xxx","Viewer Configuration":"xxx","Visio Document":"xxx","Window Mobile Package":"xxx","Windows Mobile Package":"xxx","Windows Viewer Add In":"xxx","Windows Viewer Configuration":"xxx","Workflow Manager Package":"xxx",Undefined:"und",Unsupported:"unk"}[e]||"xxx"},e.getItemsRelatedToASolution=Br,e.getJson=function(e,t){return _r(e,t,{httpMethod:"GET"}).then((e=>Gr(e))).then((e=>"application/json"===e.type?Pt(e):Promise.resolve(null)))},e.getKeyWorkforceProperties=Li,e.getLayerId=Fi,e.getLayerSettings=on,e.getLayerUpdates=Qi,e.getLayers=function(e,t,r){return new Promise(((n,o)=>{0===t.length&&n([]),e=e.replace("/rest/services","/rest/admin/services");const a=[];t.forEach((t=>{const n={authentication:r};a.push(i.request(Rt(e)+t.id+"?f=json",n))})),Promise.all(a).then((e=>n(e)),(e=>o(Nt(e))))}))},e.getLayersAndTables=ln,e.getPortal=function(e,t){const r={authentication:t};return n.getPortal(e,r)},e.getPortalDefaultBasemap=function(e,t,r){return lo(e,r,{num:1}).then((({results:[e]})=>{if(!e)throw new Error("No basemap group found");return uo(e.id,`title:${t}`,r,{num:1})})).then((({results:[e]})=>{if(!e)throw new Error("No basemap found");return e}))},e.getPortalSharingUrlFromAuth=Mr,e.getPortalUrlFromAuth=function(e){return Mr(e).replace("/sharing/rest","")},e.getProp=Mt,e.getPropWithDefault=function(e,t,r){const n=t.split(".").reduce((function(e,t){return e?e[t]:void 0}),e);return void 0===n?r:n},e.getProps=function(e,t){return t.reduce(((t,r)=>{const n=Mt(e,r);return n&&t.push(n),t}),[])},e.getReplaceValue=Ri,e.getRequest=ro,e.getServiceLayersAndTables=function(e,t){return new Promise(((r,n)=>{const i=Di(e);e.item.url?no(e.item.url,t,i).then((t=>{e.properties=t,r(e)}),(e=>n(Nt(e)))):r(e)}))},e.getSolutionSummary=Do,e.getSolutionsRelatedToAnItem=Wr,e.getSubscriptionInfo=Uo,e.getTackingServiceOwner=function(e,t){if(e.locationTrackingEnabled){return Sr(e.locationTracking.id,t).then((r=>(e.locationTracking.owner=r.owner,e[r.id]={itemId:r.id},Promise.resolve(r&&r.owner===t.username))),(()=>Promise.resolve(!1)))}return Promise.resolve(!1)},e.getTemplateById=function(e,t){let r;return(e||[]).some((e=>e.itemId===t&&(r=e,!0))),r},e.getThumbnailFile=Vr,e.getThumbnailFromStorageItem=function(t,r){let n,i;return r.forEach((t=>{t.type===e.EFileType.Thumbnail&&(n=t.url,i=t.filename)})),n?Vr(n,i,t):Promise.resolve(null)},e.getUTCTimestamp=function(){const e=new Date;return Ht(e.getUTCFullYear(),4)+Ht(e.getUTCMonth()+1,2)+Ht(e.getUTCDate(),2)+"_"+Ht(e.getUTCHours(),2)+Ht(e.getUTCMinutes(),2)+"_"+Ht(e.getUTCSeconds(),2)+Ht(e.getUTCMilliseconds(),3)},e.getUniqueTitle=Zt,e.getUrlDependencies=Pi,e.getUser=xr,e.getUserSession=function(e={}){return new o.UserSession(e)},e.getUsername=function(e){return new Promise(((t,r)=>{xr(e).then((e=>t(e.username)),r)}))},e.getVelocityUrlBase=function(e,t){return t.hasOwnProperty("velocityUrl")?Promise.resolve(t.velocityUrl):Uo({authentication:e}).then((e=>{let r="";const n=Mt(e,"orgCapabilities");return Array.isArray(n)&&n.some((e=>("velocity"===e.id&&"active"===e.status&&e.velocityUrl&&(r=e.velocityUrl),r))),t.velocityUrl=r,Promise.resolve(r)}))},e.getWorkforceDependencies=ki,e.getWorkforceServiceInfo=Si,e.globalStringReplace=function e(t,r,n){return t&&Object.keys(t).forEach((i=>{const o=t[i];o&&("object"==typeof o?e(o,r,n):"string"==typeof o&&(t[i]=t[i].replace(r,n)))})),t},e.hasAnyKeyword=function(e,t){const r=Mt(e,"item.typeKeywords")||e.typeKeywords||[];return t.reduce(((e,t)=>(e||(e=r.includes(t)),e)),!1)},e.hasDatasource=function(e,t,r){return e.some((e=>e.itemId===t&&e.layerId===r))},e.hasInvalidGroupDesignations=function(e){return!!e&&["livingatlas"].indexOf(e)>-1},e.hasTypeKeyword=function(e,t){return(Mt(e,"item.typeKeywords")||e.typeKeywords||[]).includes(t)},e.hasUnresolvedVariables=mr,e.idTest=Wt,e.isSupportedFileType=ya,e.isTrackingViewGroup=function(e){const t=Mt(e,"item.tags");return!!(t&&t.indexOf("Location Tracking Group")>-1)},e.isTrackingViewTemplate=Yr,e.isWorkforceProject=Di,e.jsonToBlob=zt,e.jsonToFile=function(e,t,r="application/json"){return Ot(zt(e),t,r)},e.migrateSchema=function(e){r.getProp(e,"item.properties")||(e.item.properties={});const t=r.getProp(e,"item.properties.schemaVersion");if(3===t)return Promise.resolve(e);{const r=function(e){let t=!1;const r=Mt(e,"item.typeKeywords")||[];return r.includes("Template")||r.includes("hubSolutionTemplate")&&r.includes("solutionTemplate")&&(t=!0),t}(e),n=[];return t||r?(n.push(Bo,No,Wo,Vo,Go,Zo,qo,$o,Yo),n.push(Ho)):n.push(Ho),n.reduce(((e,t)=>e.then((e=>t(e)))),Promise.resolve(e))}},e.new_File=At,e.placeholder=function(e){return"{{"+e+"}}"},e.postProcessFields=_n,e.postProcessWorkforceTemplates=function(e){const t={};return e.map((e=>(e=zi(e=Ci(e,t),"Workforce Dispatcher"),e=zi(e,"Workforce Worker")))).map((e=>(t[e.itemId]&&(e.dependencies=e.dependencies.concat(t[e.itemId])),e)))},e.reassignGroup=function(e,t,r){const n={authentication:r,params:{targetUsername:t}};return i.request(`${r.portal}/community/groups/${e}/reassign`,n)},e.reconstructBuildOrderIds=Fo,e.regExTest=$t,e.removeFolder=function(e,t){return new Promise(((r,i)=>{const o={folderId:e,authentication:t};n.removeFolder(o).then((e=>e.success?r(e):i(e)),i)}))},e.removeGroup=oo,e.removeItem=ao,e.removeItemOrGroup=function(e,t){return new Promise(((r,n)=>{ao(e,t).then(r,(i=>{oo(e,t).then(r,(()=>n(i)))}))}))},e.removeItems=Co,e.removeLayerOptimization=fn,e.removeTemplate=function(e,t){const r=hr(e,t);r>=0&&e.splice(r,1)},e.removeUsers=function(e,t,r){return n.removeGroupUsers({id:e,users:t,authentication:r})},e.replaceInTemplate=yr,e.replaceTemplate=function(e,t,r){const n=hr(e,t);return n>=0&&(e[n]=r,!0)},e.reportProgress=Ro,e.sanitizeHTML=function(e,t){return t||(t=new kt),t.sanitize(e)},e.sanitizeJSON=Et,e.sanitizeJSONAndReportChanges=function(e,t){const r=Et(e,t),n=Lt(e,r);return n.length>0&&(console.warn("Changed "+n.length+(1===n.length?" property":" properties")),n.forEach((e=>console.warn(" "+e)))),r},e.sanitizeURLProtocol=function(e,t){return t||(t=new kt),t.sanitizeUrl(e)},e.saveBlobAsFile=function(e,t){return new Promise((r=>{const n=URL.createObjectURL(t),i=document.createElement("a");i.setAttribute("href",n),i.setAttribute("download",e),i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i),setTimeout((()=>{URL.revokeObjectURL(n),r(null)}),500)}))},e.searchAllGroups=co,e.searchAllItems=function e(t,r){const n=Hi(t),i=r||{query:n.q,start:1,num:100,nextStart:-1,total:0,results:[]};return new Promise(((r,o)=>{so(t).then((t=>{i.results=i.results.concat(t.results),i.num=i.total=i.results.length,t.nextStart>0?(n.start=t.nextStart,r(e(n,i))):r(i)}),(e=>o(e)))}))},e.searchGroupAllContents=function e(t,r,n,i,o,a){i=i||{};const s=a||{query:r,start:1,num:100,nextStart:-1,total:0,results:[]};return new Promise(((a,l)=>{uo(t,r,n,i,o).then((l=>{s.results=s.results.concat(l.results),s.num=s.total=s.results.length,l.nextStart>0?(i.start=l.nextStart,a(e(t,r,n,i,o,s))):a(s)}),(e=>l(e)))}))},e.searchGroupContents=uo,e.searchGroups=lo,e.searchItems=so,e.setCreateProp=Vt,e.setDefaultSpatialReference=vn,e.setLocationTrackingEnabled=function(e,t,r,n){const i=Mt(e,"helperServices.locationTracking");i&&(r.locationTracking=i),r.locationTrackingEnabled=!(!r.locationTracking||"org_admin"!==Mt(t,"role")),n&&$r(n,r)},e.setNamesAndTitles=function(e,t){const r=[];return e.map((e=>{if("Feature Service"===e.item.type&&(e.item.title=e.item.title||e.item.name,!Yr(e))){let n=e.item.name||e.item.title;n=n.replace(/_[0-9A-F]{32}/gi,"");const i=n.substring(0,50)+"_"+t;e.item.name=-1===r.indexOf(i)?i:`${i}_${r.filter((e=>e===i)).length}`,r.push(i)}return e}))},e.setProp=Gt,e.setTrackingOptions=Xr,e.shareItem=function(e,t,r,i){return new Promise(((o,a)=>{const s={groupId:e,id:t,authentication:r};i&&(s.owner=i),n.shareItemWithGroup(s).then((()=>o(null)),(e=>a(Nt(e))))}))},e.shareItemToGroups=function(e,t,r,i){return Promise.all(e.map((e=>{const o={id:t,groupId:e,authentication:r};return i&&(o.owner=i),n.shareItemWithGroup(o)})))},e.templatize=function(e,t,r,n){n=n||{};const i=e.item.id,o=e.item.url;e.item={...e.item,id:vr(i,i,".itemId"),url:On(i,"url"),typeKeywords:wr(e.item.typeKeywords)},Hr(e);const a=e.properties.layers||[],s=e.properties.tables||[],l=a.concat(s),c=e.data||{},u=c.layers||[],f=c.tables||[],d=u.concat(f);n[o]=e.item.url,l.concat(d).forEach((e=>{n[o+"/"+e.id]=On(i,"layer"+e.id+".url")})),e.properties.service.serviceItemId=vr(e.properties.service.serviceItemId,e.properties.service.serviceItemId,".itemId");const h=Mt(e,"properties.service.initialExtent");h&&(e.properties.service.initialExtent=vr(i,i,".solutionExtent"));const p=Mt(e,"properties.service.fullExtent");p&&(e.properties.service.fullExtent=vr(i,i,".solutionExtent")),e.properties.defaultExtent=h||p,!Mt(e,"properties.service.spatialReference")&&Mt(e,"properties.defaultExtent.spatialReference")&&Vt(e,"properties.service.spatialReference",e.properties.defaultExtent.spatialReference);let m=!1;return l.forEach((i=>{const o=d.filter((e=>i.id===e.id)),a=1===o.length?o[0]:void 0;Rn(a,i,e,t,r,n),m=!!(i.hasZ||a&&a.hasZ)||m})),m&&(e.properties.service.enableZDefaults=!0,e.properties.service.zDefault=0),e},e.templatizeFieldReferences=function(e,t,r,n=!1){let i=JSON.stringify(e);return t.forEach((e=>{let t="\\b"+e.name+"\\b(?![.])(?![}]{2})";n||(t+='(?!":)'),i=i.replace(new RegExp(t,"g"),br(r,e.name+".name"))})),JSON.parse(i)},e.templatizeIds=wr,e.templatizeServiceItemId=Kr,e.templatizeTerm=vr,e.templatizeToLowerCase=br,e.templatizeTracker=Hr,e.templatizeWorkforce=Ii,e.topologicallySortItems=Po,e.updateGroup=function(e,t,r){return new Promise(((i,o)=>{const a={group:e,authentication:t,params:{...r??{}}};n.updateGroup(a).then((e=>e.success?i(e):o(e)),(e=>o(e)))}))},e.updateItem=fo,e.updateItemExtended=ho,e.updateItemResourceText=function(e,t,r,i){return n.updateItemResource({id:e,name:t,content:r,authentication:i})},e.updateItemTemplateFromDictionary=function(e,t,r){return new Promise(((n,i)=>{Promise.all([Sr(e,r),Ar(e,r)]).then((([n,i])=>{if(mr(n)||mr(i)){const{item:o,data:a}=yr({item:n,data:i},t);return wo(e,n.type,o,a),ho(o,a,r)}return Promise.resolve({success:!0,id:e})})).then((e=>n(e))).catch((e=>i(e)))}))},e.updateItemURL=function(e,t,r){return Io(e,t,r,3)},e.updateLayerFieldReferences=wn,e.updatePopupInfo=Pn,e.updateSettingsFieldInfos=an,e.updateTemplate=function(e,t,r){return nn(e,r),t[e.itemId]=Object.assign(t[e.itemId]||{},{itemId:r.serviceItemId,url:Rt(r.serviceurl),name:r.name}),e.itemId=r.serviceItemId,yr(e,t)},e.updateTemplateForInvalidDesignations=function(e,t){return new Promise(((r,n)=>{if(e.properties.hasInvalidDesignations=!0,e.item.url){const o=e.item.url;i.request(o+"?f=json",{authentication:t}).then((t=>{const n={};(t.layers||[]).concat(t.tables||[]).forEach((e=>{e&&e.hasOwnProperty("id")&&(n[e.id]=e)})),e.data[e.itemId]=Object.assign({itemId:e.itemId},on(n,o,e.itemId)),r(e)}),(e=>n(Nt(e))))}else r(e)}))},e.updateVelocityReferences=function(e,t,r){const n=r.velocityUrl;if(e&&"Web Map"===t&&n){(e.operationalLayers||[]).concat(e.tables||[]).forEach((e=>{e.url&&e.url.indexOf(n)>-1&&e.itemId&&delete e.itemId}))}return n&&e?va(e,n):e},e.urlTest=Ui,e.validateHTML=function(e,t){return t||(t=new kt),t.validate(e)},e.validateSpatialReferenceAndExtent=bn,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
19
19
|
//# sourceMappingURL=common.umd.min.js.map
|