@gudhub/core 1.2.4-beta.48 → 1.2.4-beta.49

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.
Binary file
Binary file
@@ -7,7 +7,7 @@
7
7
  130/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/fake_server/fake_server_data/chunks_mocks/bcjyuoqaewybudfyhir_8263.js1733309347057076203 0
8
8
  102/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/fake_server/fake_server_data/chunks_mocks1733309347057076203 1
9
9
  100/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/fake_server/fake_server_data/app_132.js1733309347046076292 0
10
- 103/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/dist/PARCEL_APP_REQUEST_WORKER_FILENAME.js1739180522986603329 0
10
+ 103/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/dist/PARCEL_APP_REQUEST_WORKER_FILENAME.js1739180898842358188 0
11
11
  83/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/dist/gudhub.es.copy.js1737970173095072751 0
12
12
  106/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/.cache/b8/c0f9ecdf7c60d602d0bfd6b2eabef4.json1733309318215311104 0
13
13
  70/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/.cache/b81733309318215311104 1
@@ -385,7 +385,7 @@
385
385
  114/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/jsdom/lib/jsdom/living/generated/Node.js499162500000000000 0
386
386
  126/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/jsdom/lib/jsdom/living/generated/HTMLDListElement.js499162500000000000 0
387
387
  123/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/jsdom/lib/jsdom/living/generated/RadioNodeList.js499162500000000000 0
388
- 79/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/dist/gudhub.umd.js1739180399179123889 0
388
+ 79/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/dist/gudhub.umd.js1739180531116564411 0
389
389
  126/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/jsdom/lib/jsdom/living/generated/HTMLTableElement.js499162500000000000 0
390
390
  124/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/jsdom/lib/jsdom/living/generated/HTMLCollection.js499162500000000000 0
391
391
  120/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/jsdom/lib/jsdom/living/generated/SVGElement.js499162500000000000 0
@@ -3354,7 +3354,7 @@
3354
3354
  135/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/date-fns/esm/fp/eachMinuteOfIntervalWithOptions/index.js.flow499162500000000000 0
3355
3355
  113/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/date-fns/esm/fp/previousFriday/index.js499162500000000000 0
3356
3356
  118/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/date-fns/esm/fp/previousFriday/index.js.flow499162500000000000 0
3357
- 65/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/dist1739180522987603324 1
3357
+ 65/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/dist1739180898843358181 1
3358
3358
  127/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/date-fns/esm/fp/startOfWeekYearWithOptions/index.d.ts499162500000000000 0
3359
3359
  125/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/date-fns/esm/fp/startOfWeekYearWithOptions/index.js499162500000000000 0
3360
3360
  130/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/date-fns/esm/fp/startOfWeekYearWithOptions/index.js.flow499162500000000000 0
@@ -7507,7 +7507,7 @@
7507
7507
  97/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/lodash.get/package.json1737624233021066452 0
7508
7508
  93/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/lodash.get/index.js1471109647000000000 0
7509
7509
  107/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/core-js-pure/full/string/small.js499162500000000000 0
7510
- 89/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/GUDHUB/DataService/IndexedDB1739180521631609762 1
7510
+ 89/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/GUDHUB/DataService/IndexedDB1739180897514367386 1
7511
7511
  94/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/lodash.get/README.md1471109647000000000 0
7512
7512
  118/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/@babel/runtime-corejs3/core-js/symbol/for.js456789000000000000 0
7513
7513
  84/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/lodash.get1737624233026066215 1
@@ -10234,7 +10234,7 @@
10234
10234
  115/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/@babel/core/lib/config/files/utils.js.map456789000000000000 0
10235
10235
  117/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/@babel/runtime-corejs3/core-js/math/sign.js456789000000000000 0
10236
10236
  95/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/@parcel/codeframe/src1737624225670417640 1
10237
- 112/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/GUDHUB/DataService/IndexedDB/IndexedDBAppService.js1739180521630609767 0
10237
+ 112/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/GUDHUB/DataService/IndexedDB/IndexedDBAppService.js1739180897514367386 0
10238
10238
  106/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/core-js/web/url-search-params.js499162500000000000 0
10239
10239
  110/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/@babel/plugin-transform-dotall-regex1737624232874073441 1
10240
10240
  120/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/core-js-pure/stable/typed-array/copy-within.js499162500000000000 0
@@ -15137,7 +15137,7 @@
15137
15137
  139/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/@parcel/transformer-posthtml/node_modules/posthtml-parser/license499162500000000000 0
15138
15138
  125/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/dom-serializer/node_modules/entities/lib/index.d.ts499162500000000000 0
15139
15139
  141/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/@parcel/transformer-posthtml/node_modules/domhandler/lib/index.d.ts499162500000000000 0
15140
- 78/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/package-lock.json1739180518854622901 0
15140
+ 78/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/package-lock.json1739180894313389529 0
15141
15141
  123/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/caniuse-lite/data/features/css-overflow-anchor.js499162500000000000 0
15142
15142
  106/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/core-js/full/typed-array/with.js499162500000000000 0
15143
15143
  110/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/core-js-pure/es/typed-array/index.js499162500000000000 0
@@ -17372,7 +17372,7 @@
17372
17372
  115/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/core-js-pure/full/symbol/async-dispose.js499162500000000000 0
17373
17373
  114/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/core-js-pure/full/symbol/has-instance.js499162500000000000 0
17374
17374
  114/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/core-js/stable/typed-array/find-index.js499162500000000000 0
17375
- 73/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/package.json1739180518834622995 0
17375
+ 73/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/package.json1739180894296389647 0
17376
17376
  93/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/argparse/lib/sub.js499162500000000000 0
17377
17377
  116/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/@babel/runtime-corejs3/helpers/defaults.js456789000000000000 0
17378
17378
  109/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/date-fns/fp/previousFriday/index.js499162500000000000 0
@@ -19138,7 +19138,7 @@
19138
19138
  109/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/core-js/internals/iterator-close.js499162500000000000 0
19139
19139
  89/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/@babel/core/lib1737624225031448338 1
19140
19140
  128/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/fake_server/fake_server_data/chunks_mocks/tpajkpolmzklodcba_8263.js1733309347058076195 0
19141
- 78/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/dist/gudhub.es.js1739180399031124424 0
19141
+ 78/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/dist/gudhub.es.js1739180530973565100 0
19142
19142
  106/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/core-js/internals/to-set-like.js499162500000000000 0
19143
19143
  97/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/acorn-walk/dist/walk.js499162500000000000 0
19144
19144
  115/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/core-js-pure/proposals/promise-finally.js499162500000000000 0
@@ -21060,7 +21060,7 @@
21060
21060
  121/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/date-fns/locale/lb/_lib/formatDistance/index.js499162500000000000 0
21061
21061
  119/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/date-fns/esm/locale/ar-MA/_lib/formatRelative1737624230391191672 1
21062
21062
  106/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/core-js-pure/es/function/name.js499162500000000000 0
21063
- 60/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub1739180518855622896 1
21063
+ 60/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub1739180894314389522 1
21064
21064
  112/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/sinon/lib/sinon/collect-own-methods.js499162500000000000 0
21065
21065
  97/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/underscore/amd/unzip.js499162500000000000 0
21066
21066
  99/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/underscore/amd/countBy.js499162500000000000 0
@@ -21716,7 +21716,7 @@
21716
21716
  112/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/date-fns/fp/getWeeksInMonth/index.d.ts499162500000000000 0
21717
21717
  104/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/cosmiconfig/dist/Explorer.d.ts499162500000000000 0
21718
21718
  125/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/date-fns/esm/fp/roundToNearestMinutes/index.js.flow499162500000000000 0
21719
- 109/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/GUDHUB/DataService/IndexedDB/IndexedDBService.js1738847982253582156 0
21719
+ 109/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/GUDHUB/DataService/IndexedDB/IndexedDBService.js1739180869592559155 0
21720
21720
  115/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/core-js-pure/features/math/rad-per-deg.js499162500000000000 0
21721
21721
  101/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/cosmiconfig/dist/types.d.ts499162500000000000 0
21722
21722
  112/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub/node_modules/date-fns/esm/locale/az/_lib/formatLong1737624230398191338 1
@@ -13,6 +13,8 @@ export class IndexedDBManager extends StoreBackend {
13
13
  dbName,
14
14
  storeNameList,
15
15
  ) {
16
+ super();
17
+
16
18
  if (
17
19
  !IndexedDBManager.dbNameToInstanceMap
18
20
  ) {
package/dist/gudhub.es.js CHANGED
@@ -14983,7 +14983,7 @@ class StoreBackend {
14983
14983
  }
14984
14984
  class IndexedDBManager extends StoreBackend {
14985
14985
  constructor(e, t) {
14986
- if (IndexedDBManager.dbNameToInstanceMap || (IndexedDBManager.dbNameToInstanceMap = /* @__PURE__ */ new Map()), IndexedDBManager.dbNameToInstanceMap.has(e)) return IndexedDBManager.dbNameToInstanceMap.get(e);
14986
+ if (super(), IndexedDBManager.dbNameToInstanceMap || (IndexedDBManager.dbNameToInstanceMap = /* @__PURE__ */ new Map()), IndexedDBManager.dbNameToInstanceMap.has(e)) return IndexedDBManager.dbNameToInstanceMap.get(e);
14987
14987
  this.db = null, this.dbName = e, this.storeNameList = t, IndexedDBManager.dbNameToInstanceMap.set(e, this);
14988
14988
  }
14989
14989
  async checkAndCreateStore(e) {
@@ -15223,7 +15223,7 @@ class IndexedDBChunkService extends ChunkDataService$1 {
15223
15223
  }
15224
15224
  }
15225
15225
  const jsContent = `(function(){"use strict";(()=>{let Ut,vt,Tr,Gt;var le=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};function G(n){return n&&n.__esModule?n.default:n}function Pr(n,e,t,r){Object.defineProperty(n,e,{get:t,set:r,enumerable:!0,configurable:!0})}var Wt={},wt={},A=le.parcelRequire94c2;A==null&&((A=function(n){if(n in Wt)return Wt[n].exports;if(n in wt){var e=wt[n];delete wt[n];var t={id:n,exports:{}};return Wt[n]=t,e.call(t.exports,t,t.exports),t.exports}var r=Error("Cannot find module '"+n+"'");throw r.code="MODULE_NOT_FOUND",r}).register=function(n,e){wt[n]=e},le.parcelRequire94c2=A);var L=A.register;L("1ufAB",function(n,e){var t=A("iEaqd"),r=A("iNZzY"),a=A("2VbXH"),i=A("6Mx50");function l(u){var o=new a(u),p=r(a.prototype.request,o);return t.extend(p,a.prototype,o),t.extend(p,o),p}var s=l(A("bM4se"));s.Axios=a,s.create=function(u){return l(i(s.defaults,u))},s.Cancel=A("g2liO"),s.CancelToken=A("14PRn"),s.isCancel=A("8kGOw"),s.all=function(u){return Promise.all(u)},s.spread=A("i3hBo"),s.isAxiosError=A("dhYWP"),n.exports=s,n.exports.default=s}),L("iEaqd",function(n,e){var t=A("iNZzY"),r=Object.prototype.toString;function a(I){return r.call(I)==="[object Array]"}function i(I){return I===void 0}function l(I){return I!==null&&!i(I)&&I.constructor!==null&&!i(I.constructor)&&typeof I.constructor.isBuffer=="function"&&I.constructor.isBuffer(I)}function s(I){return r.call(I)==="[object ArrayBuffer]"}function u(I){return typeof FormData<"u"&&I instanceof FormData}function o(I){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(I):I&&I.buffer&&I.buffer instanceof ArrayBuffer}function p(I){return typeof I=="string"}function m(I){return typeof I=="number"}function d(I){return I!==null&&typeof I=="object"}function y(I){if(r.call(I)!=="[object Object]")return!1;var F=Object.getPrototypeOf(I);return F===null||F===Object.prototype}function f(I){return r.call(I)==="[object Date]"}function S(I){return r.call(I)==="[object File]"}function v(I){return r.call(I)==="[object Blob]"}function w(I){return r.call(I)==="[object Function]"}function g(I){return d(I)&&w(I.pipe)}function _(I){return typeof URLSearchParams<"u"&&I instanceof URLSearchParams}function $(I){return I.trim?I.trim():I.replace(/^\\s+|\\s+$/g,"")}function x(){return(typeof navigator>"u"||navigator.product!=="ReactNative"&&navigator.product!=="NativeScript"&&navigator.product!=="NS")&&typeof window<"u"&&typeof document<"u"}function T(I,F){if(I!=null)if(typeof I!="object"&&(I=[I]),a(I))for(var C=0,B=I.length;C<B;C++)F.call(null,I[C],C,I);else for(var V in I)Object.prototype.hasOwnProperty.call(I,V)&&F.call(null,I[V],V,I)}function P(){var I={};function F(V,X){y(I[X])&&y(V)?I[X]=P(I[X],V):y(V)?I[X]=P({},V):a(V)?I[X]=V.slice():I[X]=V}for(var C=0,B=arguments.length;C<B;C++)T(arguments[C],F);return I}function D(I,F,C){return T(F,function(B,V){C&&typeof B=="function"?I[V]=t(B,C):I[V]=B}),I}function R(I){return I.charCodeAt(0)===65279&&(I=I.slice(1)),I}n.exports={isArray:a,isArrayBuffer:s,isBuffer:l,isFormData:u,isArrayBufferView:o,isString:p,isNumber:m,isObject:d,isPlainObject:y,isUndefined:i,isDate:f,isFile:S,isBlob:v,isFunction:w,isStream:g,isURLSearchParams:_,isStandardBrowserEnv:x,forEach:T,merge:P,extend:D,trim:$,stripBOM:R}}),L("iNZzY",function(n,e){n.exports=function(t,r){return function(){for(var a=Array(arguments.length),i=0;i<a.length;i++)a[i]=arguments[i];return t.apply(r,a)}}}),L("2VbXH",function(n,e){var t=A("iEaqd"),r=A("gWG2h"),a=A("4m3Da"),i=A("d4try"),l=A("6Mx50"),s=A("hiYAY"),u=s.validators;function o(p){this.defaults=p,this.interceptors={request:new a,response:new a}}o.prototype.request=function(p){typeof p=="string"?(p=arguments[1]||{},p.url=arguments[0]):p=p||{},(p=l(this.defaults,p)).method?p.method=p.method.toLowerCase():this.defaults.method?p.method=this.defaults.method.toLowerCase():p.method="get";var m,d=p.transitional;d!==void 0&&s.assertOptions(d,{silentJSONParsing:u.transitional(u.boolean,"1.0.0"),forcedJSONParsing:u.transitional(u.boolean,"1.0.0"),clarifyTimeoutError:u.transitional(u.boolean,"1.0.0")},!1);var y=[],f=!0;this.interceptors.request.forEach(function($){(typeof $.runWhen!="function"||$.runWhen(p)!==!1)&&(f=f&&$.synchronous,y.unshift($.fulfilled,$.rejected))});var S=[];if(this.interceptors.response.forEach(function($){S.push($.fulfilled,$.rejected)}),!f){var v=[i,void 0];for(Array.prototype.unshift.apply(v,y),v=v.concat(S),m=Promise.resolve(p);v.length;)m=m.then(v.shift(),v.shift());return m}for(var w=p;y.length;){var g=y.shift(),_=y.shift();try{w=g(w)}catch($){_($);break}}try{m=i(w)}catch($){return Promise.reject($)}for(;S.length;)m=m.then(S.shift(),S.shift());return m},o.prototype.getUri=function(p){return r((p=l(this.defaults,p)).url,p.params,p.paramsSerializer).replace(/^\\?/,"")},t.forEach(["delete","get","head","options"],function(p){o.prototype[p]=function(m,d){return this.request(l(d||{},{method:p,url:m,data:(d||{}).data}))}}),t.forEach(["post","put","patch"],function(p){o.prototype[p]=function(m,d,y){return this.request(l(y||{},{method:p,url:m,data:d}))}}),n.exports=o}),L("gWG2h",function(n,e){var t=A("iEaqd");function r(a){return encodeURIComponent(a).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}n.exports=function(a,i,l){if(!i)return a;if(l)s=l(i);else if(t.isURLSearchParams(i))s=i.toString();else{var s,u=[];t.forEach(i,function(p,m){p!=null&&(t.isArray(p)?m+="[]":p=[p],t.forEach(p,function(d){t.isDate(d)?d=d.toISOString():t.isObject(d)&&(d=JSON.stringify(d)),u.push(r(m)+"="+r(d))}))}),s=u.join("&")}if(s){var o=a.indexOf("#");o!==-1&&(a=a.slice(0,o)),a+=(a.indexOf("?")===-1?"?":"&")+s}return a}}),L("4m3Da",function(n,e){var t=A("iEaqd");function r(){this.handlers=[]}r.prototype.use=function(a,i,l){return this.handlers.push({fulfilled:a,rejected:i,synchronous:!!l&&l.synchronous,runWhen:l?l.runWhen:null}),this.handlers.length-1},r.prototype.eject=function(a){this.handlers[a]&&(this.handlers[a]=null)},r.prototype.forEach=function(a){t.forEach(this.handlers,function(i){i!==null&&a(i)})},n.exports=r}),L("d4try",function(n,e){var t=A("iEaqd"),r=A("gu59S"),a=A("8kGOw"),i=A("bM4se");function l(s){s.cancelToken&&s.cancelToken.throwIfRequested()}n.exports=function(s){return l(s),s.headers=s.headers||{},s.data=r.call(s,s.data,s.headers,s.transformRequest),s.headers=t.merge(s.headers.common||{},s.headers[s.method]||{},s.headers),t.forEach(["delete","get","head","post","put","patch","common"],function(u){delete s.headers[u]}),(s.adapter||i.adapter)(s).then(function(u){return l(s),u.data=r.call(s,u.data,u.headers,s.transformResponse),u},function(u){return!a(u)&&(l(s),u&&u.response&&(u.response.data=r.call(s,u.response.data,u.response.headers,s.transformResponse))),Promise.reject(u)})}}),L("gu59S",function(n,e){var t=A("iEaqd"),r=A("bM4se");n.exports=function(a,i,l){var s=this||r;return t.forEach(l,function(u){a=u.call(s,a,i)}),a}}),L("bM4se",function(n,e){var t=A("2dKjk"),r=A("iEaqd"),a=A("4xE2z"),i=A("9na6w"),l={"Content-Type":"application/x-www-form-urlencoded"};function s(p,m){!r.isUndefined(p)&&r.isUndefined(p["Content-Type"])&&(p["Content-Type"]=m)}function u(p,m,d){if(r.isString(p))try{return(m||JSON.parse)(p),r.trim(p)}catch(y){if(y.name!=="SyntaxError")throw y}return(0,JSON.stringify)(p)}var o={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:function(){var p;return(typeof XMLHttpRequest<"u"||t!==void 0&&Object.prototype.toString.call(t)==="[object process]")&&(p=A("kHaX1")),p}(),transformRequest:[function(p,m){return a(m,"Accept"),a(m,"Content-Type"),r.isFormData(p)||r.isArrayBuffer(p)||r.isBuffer(p)||r.isStream(p)||r.isFile(p)||r.isBlob(p)?p:r.isArrayBufferView(p)?p.buffer:r.isURLSearchParams(p)?(s(m,"application/x-www-form-urlencoded;charset=utf-8"),p.toString()):r.isObject(p)||m&&m["Content-Type"]==="application/json"?(s(m,"application/json"),u(p)):p}],transformResponse:[function(p){var m=this.transitional,d=m&&m.silentJSONParsing,y=m&&m.forcedJSONParsing,f=!d&&this.responseType==="json";if(f||y&&r.isString(p)&&p.length)try{return JSON.parse(p)}catch(S){if(f)throw S.name==="SyntaxError"?i(S,this,"E_JSON_PARSE"):S}return p}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(p){return p>=200&&p<300}};o.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],function(p){o.headers[p]={}}),r.forEach(["post","put","patch"],function(p){o.headers[p]=r.merge(l)}),n.exports=o}),L("2dKjk",function(n,e){var t,r,a,i=n.exports={};function l(){throw Error("setTimeout has not been defined")}function s(){throw Error("clearTimeout has not been defined")}function u(w){if(t===setTimeout)return setTimeout(w,0);if((t===l||!t)&&setTimeout)return t=setTimeout,setTimeout(w,0);try{return t(w,0)}catch{try{return t.call(null,w,0)}catch{return t.call(this,w,0)}}}function o(w){if(r===clearTimeout)return clearTimeout(w);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(w);try{return r(w)}catch{try{return r.call(null,w)}catch{return r.call(this,w)}}}(function(){try{t=typeof setTimeout=="function"?setTimeout:l}catch{t=l}try{r=typeof clearTimeout=="function"?clearTimeout:s}catch{r=s}})();var p=[],m=!1,d=-1;function y(){m&&a&&(m=!1,a.length?p=a.concat(p):d=-1,p.length&&f())}function f(){if(!m){var w=u(y);m=!0;for(var g=p.length;g;){for(a=p,p=[];++d<g;)a&&a[d].run();d=-1,g=p.length}a=null,m=!1,o(w)}}function S(w,g){this.fun=w,this.array=g}function v(){}i.nextTick=function(w){var g=Array(arguments.length-1);if(arguments.length>1)for(var _=1;_<arguments.length;_++)g[_-1]=arguments[_];p.push(new S(w,g)),p.length!==1||m||u(f)},S.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,i.listeners=function(w){return[]},i.binding=function(w){throw Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(w){throw Error("process.chdir is not supported")},i.umask=function(){return 0}}),L("4xE2z",function(n,e){var t=A("iEaqd");n.exports=function(r,a){t.forEach(r,function(i,l){l!==a&&l.toUpperCase()===a.toUpperCase()&&(r[a]=i,delete r[l])})}}),L("9na6w",function(n,e){n.exports=function(t,r,a,i,l){return t.config=r,a&&(t.code=a),t.request=i,t.response=l,t.isAxiosError=!0,t.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},t}}),L("kHaX1",function(n,e){var t=A("iEaqd"),r=A("hAgIk"),a=A("gIEx2"),i=A("gWG2h"),l=A("e3Yo9"),s=A("lo19V"),u=A("eg6xZ"),o=A("iUqaj");n.exports=function(p){return new Promise(function(m,d){var y=p.data,f=p.headers,S=p.responseType;t.isFormData(y)&&delete f["Content-Type"];var v=new XMLHttpRequest;if(p.auth){var w=p.auth.username||"",g=p.auth.password?unescape(encodeURIComponent(p.auth.password)):"";f.Authorization="Basic "+btoa(w+":"+g)}var _=l(p.baseURL,p.url);function $(){if(v){var T="getAllResponseHeaders"in v?s(v.getAllResponseHeaders()):null,P=S&&S!=="text"&&S!=="json"?v.response:v.responseText,D={data:P,status:v.status,statusText:v.statusText,headers:T,config:p,request:v};r(m,d,D),v=null}}if(v.open(p.method.toUpperCase(),i(_,p.params,p.paramsSerializer),!0),v.timeout=p.timeout,"onloadend"in v?v.onloadend=$:v.onreadystatechange=function(){v&&v.readyState===4&&(v.status!==0||v.responseURL&&v.responseURL.indexOf("file:")===0)&&setTimeout($)},v.onabort=function(){v&&(d(o("Request aborted",p,"ECONNABORTED",v)),v=null)},v.onerror=function(){d(o("Network Error",p,null,v)),v=null},v.ontimeout=function(){var T="timeout of "+p.timeout+"ms exceeded";p.timeoutErrorMessage&&(T=p.timeoutErrorMessage),d(o(T,p,p.transitional&&p.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",v)),v=null},t.isStandardBrowserEnv()){var x=(p.withCredentials||u(_))&&p.xsrfCookieName?a.read(p.xsrfCookieName):void 0;x&&(f[p.xsrfHeaderName]=x)}"setRequestHeader"in v&&t.forEach(f,function(T,P){y===void 0&&P.toLowerCase()==="content-type"?delete f[P]:v.setRequestHeader(P,T)}),t.isUndefined(p.withCredentials)||(v.withCredentials=!!p.withCredentials),S&&S!=="json"&&(v.responseType=p.responseType),typeof p.onDownloadProgress=="function"&&v.addEventListener("progress",p.onDownloadProgress),typeof p.onUploadProgress=="function"&&v.upload&&v.upload.addEventListener("progress",p.onUploadProgress),p.cancelToken&&p.cancelToken.promise.then(function(T){v&&(v.abort(),d(T),v=null)}),y||(y=null),v.send(y)})}}),L("hAgIk",function(n,e){var t=A("iUqaj");n.exports=function(r,a,i){var l=i.config.validateStatus;!i.status||!l||l(i.status)?r(i):a(t("Request failed with status code "+i.status,i.config,null,i.request,i))}}),L("iUqaj",function(n,e){var t=A("9na6w");n.exports=function(r,a,i,l,s){return t(Error(r),a,i,l,s)}}),L("gIEx2",function(n,e){var t=A("iEaqd");n.exports=t.isStandardBrowserEnv()?function(){return{write:function(r,a,i,l,s,u){var o=[];o.push(r+"="+encodeURIComponent(a)),t.isNumber(i)&&o.push("expires="+new Date(i).toGMTString()),t.isString(l)&&o.push("path="+l),t.isString(s)&&o.push("domain="+s),u===!0&&o.push("secure"),document.cookie=o.join("; ")},read:function(r){var a=document.cookie.match(RegExp("(^|;\\\\s*)("+r+")=([^;]*)"));return a?decodeURIComponent(a[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()}),L("e3Yo9",function(n,e){var t=A("2rjk0"),r=A("5nGHC");n.exports=function(a,i){return a&&!t(i)?r(a,i):i}}),L("2rjk0",function(n,e){n.exports=function(t){return/^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(t)}}),L("5nGHC",function(n,e){n.exports=function(t,r){return r?t.replace(/\\/+$/,"")+"/"+r.replace(/^\\/+/,""):t}}),L("lo19V",function(n,e){var t=A("iEaqd"),r=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];n.exports=function(a){var i,l,s,u={};return a&&t.forEach(a.split(\`
15226
- \`),function(o){s=o.indexOf(":"),i=t.trim(o.substr(0,s)).toLowerCase(),l=t.trim(o.substr(s+1)),i&&!(u[i]&&r.indexOf(i)>=0)&&(i==="set-cookie"?u[i]=(u[i]?u[i]:[]).concat([l]):u[i]=u[i]?u[i]+", "+l:l)}),u}}),L("eg6xZ",function(n,e){var t=A("iEaqd");n.exports=t.isStandardBrowserEnv()?function(){var r,a=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a");function l(s){var u=s;return a&&(i.setAttribute("href",u),u=i.href),i.setAttribute("href",u),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:i.pathname.charAt(0)==="/"?i.pathname:"/"+i.pathname}}return r=l(window.location.href),function(s){var u=t.isString(s)?l(s):s;return u.protocol===r.protocol&&u.host===r.host}}():function(){return function(){return!0}}()}),L("8kGOw",function(n,e){n.exports=function(t){return!!(t&&t.__CANCEL__)}}),L("6Mx50",function(n,e){var t=A("iEaqd");n.exports=function(r,a){a=a||{};var i={},l=["url","method","data"],s=["headers","auth","proxy","params"],u=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],o=["validateStatus"];function p(f,S){return t.isPlainObject(f)&&t.isPlainObject(S)?t.merge(f,S):t.isPlainObject(S)?t.merge({},S):t.isArray(S)?S.slice():S}function m(f){t.isUndefined(a[f])?t.isUndefined(r[f])||(i[f]=p(void 0,r[f])):i[f]=p(r[f],a[f])}t.forEach(l,function(f){t.isUndefined(a[f])||(i[f]=p(void 0,a[f]))}),t.forEach(s,m),t.forEach(u,function(f){t.isUndefined(a[f])?t.isUndefined(r[f])||(i[f]=p(void 0,r[f])):i[f]=p(void 0,a[f])}),t.forEach(o,function(f){f in a?i[f]=p(r[f],a[f]):f in r&&(i[f]=p(void 0,r[f]))});var d=l.concat(s).concat(u).concat(o),y=Object.keys(r).concat(Object.keys(a)).filter(function(f){return d.indexOf(f)===-1});return t.forEach(y,m),i}}),L("hiYAY",function(n,e){var t=A("bTAft"),r={};["object","boolean","number","function","string","symbol"].forEach(function(u,o){r[u]=function(p){return typeof p===u||"a"+(o<1?"n ":" ")+u}});var a={},i=t.version.split(".");function l(u,o){for(var p=o?o.split("."):i,m=u.split("."),d=0;d<3;d++){if(p[d]>m[d])return!0;if(p[d]<m[d])break}return!1}function s(u,o,p){if(typeof u!="object")throw TypeError("options must be an object");for(var m=Object.keys(u),d=m.length;d-- >0;){var y=m[d],f=o[y];if(f){var S=u[y],v=S===void 0||f(S,y,u);if(v!==!0)throw TypeError("option "+y+" must be "+v);continue}if(p!==!0)throw Error("Unknown option "+y)}}r.transitional=function(u,o,p){var m=o&&l(o);function d(y,f){return"[Axios v"+t.version+"] Transitional option '"+y+"'"+f+(p?". "+p:"")}return function(y,f,S){if(u===!1)throw Error(d(f," has been removed in "+o));return m&&!a[f]&&(a[f]=!0,console.warn(d(f," has been deprecated since v"+o+" and will be removed in the near future"))),!u||u(y,f,S)}},n.exports={isOlderVersion:l,assertOptions:s,validators:r}}),L("bTAft",function(n,e){n.exports=JSON.parse('{"_args":[["axios@0.21.4","/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub"]],"_from":"axios@0.21.4","_id":"axios@0.21.4","_inBundle":false,"_integrity":"sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==","_location":"/axios","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"axios@0.21.4","name":"axios","escapedName":"axios","rawSpec":"0.21.4","saveSpec":null,"fetchSpec":"0.21.4"},"_requiredBy":["/"],"_resolved":"https://registry.npmjs.org/axios/-/axios-0.21.4.tgz","_spec":"0.21.4","_where":"/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub","author":{"name":"Matt Zabriskie"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"bugs":{"url":"https://github.com/axios/axios/issues"},"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}],"dependencies":{"follow-redirects":"^1.14.0"},"description":"Promise based HTTP client for the browser and node.js","devDependencies":{"coveralls":"^3.0.0","es6-promise":"^4.2.4","grunt":"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1","karma":"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2","minimist":"^1.2.0","mocha":"^8.2.1","sinon":"^4.5.0","terser-webpack-plugin":"^4.2.3","typescript":"^4.0.5","url-search-params":"^0.10.0","webpack":"^4.44.2","webpack-dev-server":"^3.11.0"},"homepage":"https://axios-http.com","jsdelivr":"dist/axios.min.js","keywords":["xhr","http","ajax","promise","node"],"license":"MIT","main":"index.js","name":"axios","repository":{"type":"git","url":"git+https://github.com/axios/axios.git"},"scripts":{"build":"NODE_ENV=production grunt build","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","examples":"node ./examples/server.js","fix":"eslint --fix lib/**/*.js","postversion":"git push && git push --tags","preversion":"npm test","start":"node ./sandbox/server.js","test":"grunt test","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json"},"typings":"./index.d.ts","unpkg":"dist/axios.min.js","version":"0.21.4"}')}),L("g2liO",function(n,e){function t(r){this.message=r}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,n.exports=t}),L("14PRn",function(n,e){var t=A("g2liO");function r(a){if(typeof a!="function")throw TypeError("executor must be a function.");this.promise=new Promise(function(s){i=s});var i,l=this;a(function(s){l.reason||(l.reason=new t(s),i(l.reason))})}r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},r.source=function(){var a;return{token:new r(function(i){a=i}),cancel:a}},n.exports=r}),L("i3hBo",function(n,e){n.exports=function(t){return function(r){return t.apply(null,r)}}}),L("dhYWP",function(n,e){n.exports=function(t){return typeof t=="object"&&t.isAxiosError===!0}}),L("kfIQl",function(n,e){var t=typeof Symbol<"u"&&Symbol,r=A("lyEFc");n.exports=function(){return typeof t=="function"&&typeof Symbol=="function"&&typeof t("foo")=="symbol"&&typeof Symbol("bar")=="symbol"&&r()}}),L("lyEFc",function(n,e){n.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),a=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(a)!=="[object Symbol]")return!1;var i=42;for(r in t[r]=i,t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var l=Object.getOwnPropertySymbols(t);if(l.length!==1||l[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(t,r);if(s.value!==i||s.enumerable!==!0)return!1}return!0}}),L("bJ3CN",function(n,e){var t={__proto__:null,foo:{}},r=Object;n.exports=function(){return{__proto__:t}.foo===t.foo&&!(t instanceof r)}}),L("9cNUg",function(n,e){var t=A("hGGZx"),r=function(){return!!t};r.hasArrayLengthDefineBug=function(){if(!t)return null;try{return t([],"length",{value:1}).length!==1}catch{return!0}},n.exports=r}),L("hGGZx",function(n,e){var t=A("hMrGw")("%Object.defineProperty%",!0)||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}n.exports=t}),L("hMrGw",function(n,e){var t=A("dUpie"),r=A("48xLS"),a=A("4Vqmv"),i=A("7x6DQ"),l=A("kPNod"),s=A("b9GfH"),u=A("8DBKi"),o=Function,p=function(H){try{return o('"use strict"; return ('+H+").constructor;")()}catch{}},m=Object.getOwnPropertyDescriptor;if(m)try{m({},"")}catch{m=null}var d=function(){throw new s},y=m?function(){try{return arguments.callee,d}catch{try{return m(arguments,"callee").get}catch{return d}}}():d,f=A("kfIQl")(),S=A("bJ3CN")(),v=Object.getPrototypeOf||(S?function(H){return H.__proto__}:null),w={},g=typeof Uint8Array<"u"&&v?v(Uint8Array):void 0,_={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?void 0:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?void 0:ArrayBuffer,"%ArrayIteratorPrototype%":f&&v?v([][Symbol.iterator]()):void 0,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":w,"%AsyncGenerator%":w,"%AsyncGeneratorFunction%":w,"%AsyncIteratorPrototype%":w,"%Atomics%":typeof Atomics>"u"?void 0:Atomics,"%BigInt%":typeof BigInt>"u"?void 0:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?void 0:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?void 0:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?void 0:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":r,"%Float32Array%":typeof Float32Array>"u"?void 0:Float32Array,"%Float64Array%":typeof Float64Array>"u"?void 0:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?void 0:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":w,"%Int8Array%":typeof Int8Array>"u"?void 0:Int8Array,"%Int16Array%":typeof Int16Array>"u"?void 0:Int16Array,"%Int32Array%":typeof Int32Array>"u"?void 0:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":f&&v?v(v([][Symbol.iterator]())):void 0,"%JSON%":typeof JSON=="object"?JSON:void 0,"%Map%":typeof Map>"u"?void 0:Map,"%MapIteratorPrototype%":typeof Map<"u"&&f&&v?v(new Map()[Symbol.iterator]()):void 0,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?void 0:Promise,"%Proxy%":typeof Proxy>"u"?void 0:Proxy,"%RangeError%":a,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?void 0:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?void 0:Set,"%SetIteratorPrototype%":typeof Set<"u"&&f&&v?v(new Set()[Symbol.iterator]()):void 0,"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?void 0:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":f&&v?v(""[Symbol.iterator]()):void 0,"%Symbol%":f?Symbol:void 0,"%SyntaxError%":l,"%ThrowTypeError%":y,"%TypedArray%":g,"%TypeError%":s,"%Uint8Array%":typeof Uint8Array>"u"?void 0:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?void 0:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?void 0:Uint32Array,"%URIError%":u,"%WeakMap%":typeof WeakMap>"u"?void 0:WeakMap,"%WeakRef%":typeof WeakRef>"u"?void 0:WeakRef,"%WeakSet%":typeof WeakSet>"u"?void 0:WeakSet};if(v)try{null.error}catch(H){var $=v(v(H));_["%Error.prototype%"]=$}var x=function H(ie){var ee;if(ie==="%AsyncFunction%")ee=p("async function () {}");else if(ie==="%GeneratorFunction%")ee=p("function* () {}");else if(ie==="%AsyncGeneratorFunction%")ee=p("async function* () {}");else if(ie==="%AsyncGenerator%"){var k=H("%AsyncGeneratorFunction%");k&&(ee=k.prototype)}else if(ie==="%AsyncIteratorPrototype%"){var O=H("%AsyncGenerator%");O&&v&&(ee=v(O.prototype))}return _[ie]=ee,ee},T={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},P=A("hweMw"),D=A("23C6u"),R=P.call(Function.call,Array.prototype.concat),I=P.call(Function.apply,Array.prototype.splice),F=P.call(Function.call,String.prototype.replace),C=P.call(Function.call,String.prototype.slice),B=P.call(Function.call,RegExp.prototype.exec),V=/[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g,X=/\\\\(\\\\)?/g,oe=function(H){var ie=C(H,0,1),ee=C(H,-1);if(ie==="%"&&ee!=="%")throw new l("invalid intrinsic syntax, expected closing \`%\`");if(ee==="%"&&ie!=="%")throw new l("invalid intrinsic syntax, expected opening \`%\`");var k=[];return F(H,V,function(O,N,K,se){k[k.length]=K?F(se,X,"$1"):N||O}),k},we=function(H,ie){var ee,k=H;if(D(T,k)&&(k="%"+(ee=T[k])[0]+"%"),D(_,k)){var O=_[k];if(O===w&&(O=x(k)),O===void 0&&!ie)throw new s("intrinsic "+H+" exists, but is not available. Please file an issue!");return{alias:ee,name:k,value:O}}throw new l("intrinsic "+H+" does not exist!")};n.exports=function(H,ie){if(typeof H!="string"||H.length===0)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ie!="boolean")throw new s('"allowMissing" argument must be a boolean');if(B(/^%?[^%]*%?$/,H)===null)throw new l("\`%\` may not be present anywhere but at the beginning and end of the intrinsic name");var ee=oe(H),k=ee.length>0?ee[0]:"",O=we("%"+k+"%",ie),N=O.name,K=O.value,se=!1,te=O.alias;te&&(k=te[0],I(ee,R([0,1],te)));for(var J=1,ce=!0;J<ee.length;J+=1){var re=ee[J],fe=C(re,0,1),Ae=C(re,-1);if((fe==='"'||fe==="'"||fe==="\`"||Ae==='"'||Ae==="'"||Ae==="\`")&&fe!==Ae)throw new l("property names with quotes must have matching quotes");if(re!=="constructor"&&ce||(se=!0),k+="."+re,D(_,N="%"+k+"%"))K=_[N];else if(K!=null){if(!(re in K)){if(!ie)throw new s("base intrinsic for "+H+" exists, but the property is not available.");return}if(m&&J+1>=ee.length){var Ie=m(K,re);K=(ce=!!Ie)&&"get"in Ie&&!("originalValue"in Ie.get)?Ie.get:K[re]}else ce=D(K,re),K=K[re];ce&&!se&&(_[N]=K)}}return K}}),L("dUpie",function(n,e){n.exports=Error}),L("48xLS",function(n,e){n.exports=EvalError}),L("4Vqmv",function(n,e){n.exports=RangeError}),L("7x6DQ",function(n,e){n.exports=ReferenceError}),L("kPNod",function(n,e){n.exports=SyntaxError}),L("b9GfH",function(n,e){n.exports=TypeError}),L("8DBKi",function(n,e){n.exports=URIError}),L("hweMw",function(n,e){var t=A("2Eytq");n.exports=Function.prototype.bind||t}),L("2Eytq",function(n,e){var t="Function.prototype.bind called on incompatible ",r=Object.prototype.toString,a=Math.max,i="[object Function]",l=function(o,p){for(var m=[],d=0;d<o.length;d+=1)m[d]=o[d];for(var y=0;y<p.length;y+=1)m[y+o.length]=p[y];return m},s=function(o,p){for(var m=[],d=p,y=0;d<o.length;d+=1,y+=1)m[y]=o[d];return m},u=function(o,p){for(var m="",d=0;d<o.length;d+=1)m+=o[d],d+1<o.length&&(m+=p);return m};n.exports=function(o){var p,m=this;if(typeof m!="function"||r.apply(m)!==i)throw TypeError(t+m);for(var d=s(arguments,1),y=function(){if(this instanceof p){var g=m.apply(this,l(d,arguments));return Object(g)===g?g:this}return m.apply(o,l(d,arguments))},f=a(0,m.length-d.length),S=[],v=0;v<f;v++)S[v]="$"+v;if(p=Function("binder","return function ("+u(S,",")+"){ return binder.apply(this,arguments); }")(y),m.prototype){var w=function(){};w.prototype=m.prototype,p.prototype=new w,w.prototype=null}return p}}),L("23C6u",function(n,e){var t=Function.prototype.call,r=Object.prototype.hasOwnProperty,a=A("hweMw");n.exports=a.call(t,r)}),L("5ZWAZ",function(n,e){function t(r){return n.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},n.exports.__esModule=!0,n.exports.default=n.exports,t(r)}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports}),L("fgq5y",function(n,e){var t=A("f3Ywx").default;Object.defineProperty(n.exports,"__esModule",{value:!0}),n.exports.default=l;var r=t(A("a9VQw")),a=t(A("glRwo")),i=t(A("ayR3G"));function l(s,u){(0,i.default)(2,arguments);var o=(0,a.default)(s),p=(0,r.default)(u);return isNaN(p)?new Date(NaN):(p&&o.setDate(o.getDate()+p),o)}n.exports=n.exports.default}),L("f3Ywx",function(n,e){function t(r){return r&&r.__esModule?r:{default:r}}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports}),L("a9VQw",function(n,e){function t(r){if(r===null||r===!0||r===!1)return NaN;var a=Number(r);return isNaN(a)?a:a<0?Math.ceil(a):Math.floor(a)}Object.defineProperty(n.exports,"__esModule",{value:!0}),n.exports.default=t,n.exports=n.exports.default}),L("glRwo",function(n,e){var t=A("f3Ywx").default;Object.defineProperty(n.exports,"__esModule",{value:!0}),n.exports.default=i;var r=t(A("5ZWAZ")),a=t(A("ayR3G"));function i(l){(0,a.default)(1,arguments);var s=Object.prototype.toString.call(l);return l instanceof Date||(0,r.default)(l)==="object"&&s==="[object Date]"?new Date(l.getTime()):typeof l=="number"||s==="[object Number]"?new Date(l):((typeof l=="string"||s==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use \`parseISO\` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(Error().stack)),new Date(NaN))}n.exports=n.exports.default}),L("ayR3G",function(n,e){function t(r,a){if(a.length<r)throw TypeError(r+" argument"+(r>1?"s":"")+" required, but only "+a.length+" present")}Object.defineProperty(n.exports,"__esModule",{value:!0}),n.exports.default=t,n.exports=n.exports.default}),L("byyO9",function(n,e){var t=A("f3Ywx").default;Object.defineProperty(n.exports,"__esModule",{value:!0}),n.exports.default=l;var r=t(A("a9VQw")),a=t(A("glRwo")),i=t(A("ayR3G"));function l(s,u){(0,i.default)(2,arguments);var o=(0,a.default)(s),p=(0,r.default)(u);if(isNaN(p))return new Date(NaN);if(!p)return o;var m=o.getDate(),d=new Date(o.getTime());return d.setMonth(o.getMonth()+p+1,0),m>=d.getDate()?d:(o.setFullYear(d.getFullYear(),d.getMonth(),m),o)}n.exports=n.exports.default}),L("hLz6R",function(n,e){var t=A("f3Ywx").default;Object.defineProperty(n.exports,"__esModule",{value:!0}),n.exports.default=s;var r=t(A("glRwo")),a=t(A("a9VQw")),i=t(A("ayR3G")),l=A("lmyOi");function s(u,o){(0,i.default)(1,arguments);var p,m,d,y,f,S,v,w,g=(0,l.getDefaultOptions)(),_=(0,a.default)((p=(m=(d=(y=o==null?void 0:o.weekStartsOn)!==null&&y!==void 0?y:o==null||(f=o.locale)===null||f===void 0||(S=f.options)===null||S===void 0?void 0:S.weekStartsOn)!==null&&d!==void 0?d:g.weekStartsOn)!==null&&m!==void 0?m:(v=g.locale)===null||v===void 0||(w=v.options)===null||w===void 0?void 0:w.weekStartsOn)!==null&&p!==void 0?p:0);if(!(_>=0&&_<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");var $=(0,r.default)(u),x=$.getDay(),T=(x<_?7:0)+x-_;return $.setDate($.getDate()-T),$.setHours(0,0,0,0),$}n.exports=n.exports.default}),L("lmyOi",function(n,e){Object.defineProperty(n.exports,"__esModule",{value:!0}),n.exports.getDefaultOptions=r,n.exports.setDefaultOptions=a;var t={};function r(){return t}function a(i){t=i}}),L("kmcAT",function(n,e){A("akXK4"),A("5xozB")}),L("akXK4",function(n,e){n.exports=A("1ufAB")}),L("5xozB",function(n,e){Pr(n.exports,"IS_BROWSER_MAIN_THREAD",()=>r),Pr(n.exports,"IS_BROWSER",()=>i);var t=A("2dKjk");let r=typeof window<"u"&&typeof document<"u",a=typeof self=="object"&&typeof WorkerGlobalScope<"u",i=r||a;t!==void 0&&t.versions!=null&&t.versions.node});var me=A("5xozB");let ca="https://gudhub.com/GudHub_Test",ua="wss://gudhub.com/GudHub/ws/app/",pa="https://gudhub.com/api/services/prod",da="build/latest/async_modules_node/",fa="build/latest/automation_modules/",ha="https://gudhub.com",Cr=!0,Nr=!1,Ke=!0;me.IS_BROWSER||(Ke=!1);var me=A("5xozB");class Mr{}class $t extends Mr{constructor(e,t,r){super(),this.chunkDataService=new vt(e,Gt,r),this.gudhub=r}isWithCache(){return!1}async processRequestedApp(e,t){if(!this.isWithCache()){let r=await this.chunkDataService.getMergedChunkForIDList(e,t.chunks);return r&&(t.items_list=await this.gudhub.util.mergeChunks([r,t])),t}}}class ma{constructor(e){this.req=e}async getApp(e){return this.req.get({url:"/api/app/get",params:{app_id:e}})}}let Rr=(n,...e)=>{for(let t of e)if(t)for(let r of Object.keys(t)){let a=Object.getOwnPropertyDescriptor(t,r);a.enumerable&&Object.defineProperty(n,r,a)}};class St{}class He extends $t{constructor(e,t,r){super(e,t,r),this.appApi=new ma(e),Rr(this,new St(t))}async getApp(e){let t=await this.appApi.getApp(e);return this.processRequestedApp(e,t)}async getAppWithoutProcessing(e){return this.appApi.getApp(e)}async putApp(e,t){}static[Symbol.hasInstance](e){try{return e instanceof He||e instanceof St}catch{return!1}}}class Fr extends Mr{getMergedChunkForIDList(e){}isWithCache(){return!1}}class ga{constructor(e){this.req=e}async getChunk(e,t){return this.req.get({url:\`\${this.req.root}/api/get-items-chunk/\${e}/\${t}\`,method:"GET"})}async getLastChunk(e){return this.req.axiosRequest({url:\`\${this.req.root}/api/get-last-items-chunk/\${e}\`,method:"GET"})}}class xt extends Fr{constructor(e,t){super(),this.chunkApi=new ga(e),Rr(this,new St(t))}async getChunk(e,t){return this.chunkApi.getChunk(e,t)}async getChunksForId(e){return[]}getCachedMergedChunk(e,t){}getMergedChunkForIDList(e,t){}putChunk(){}static[Symbol.hasInstance](e){try{return e instanceof xt||e instanceof St}catch{return!1}}}let Et={store:"apps"},Ht={store:"chunks"},ya="gudhub",zt={store:"chunksMergeCache"};class _a{}class ze extends _a{constructor(e,t){if(ze.dbNameToInstanceMap||(ze.dbNameToInstanceMap=new Map),ze.dbNameToInstanceMap.has(e))return ze.dbNameToInstanceMap.get(e);this.db=null,this.dbName=e,this.storeNameList=t,ze.dbNameToInstanceMap.set(e,this)}async checkAndCreateStore(e){let t=(await indexedDB.databases()).find(i=>i.name===this.dbName),r=!1,a=this;return t&&(r=await new Promise((i,l)=>{let s=indexedDB.open(a.dbName);s.onsuccess=function(u){let o=u.target.result,p=o.objectStoreNames.contains(e);o.close(),i(p)},s.onerror=function(u){l(u.target.error)}})),!!r||new Promise((i,l)=>{let s=indexedDB.open(a.dbName,t?t.version+1:1);s.onupgradeneeded=function(u){let o=u.target.result;o.objectStoreNames.contains(e)||o.createObjectStore(e)},s.onsuccess=function(u){u.target.result.close(),i()},s.onerror=l})}async openDB(){let e,t;if(this.db)return this.db;let r=new Promise((l,s)=>{e=l,t=s});for(let l of this.storeNameList)await this.checkAndCreateStore(l);let a=this,i=indexedDB.open(this.dbName);return i.onsuccess=l=>{a.db=l.target.result,e(this.db)},i.onerror=t,r}async executeOperation(e,t){let r=await this.openDB();return new Promise((a,i)=>{let l=r.transaction(e,"readwrite"),s=l.objectStore(e);l.oncomplete=()=>a(),l.onerror=u=>i(\`Transaction failed: \${u.target.error}\`);try{t(s)}catch(u){i(\`Operation failed: \${u.message}\`)}})}}let Lr=new ze(ya,[Et.store,Ht.store,zt.store]);class Dr{constructor(e,t){this.storeBackend=e,this.storeName=t}async addItem(e,t){return new Promise(async(r,a)=>{this.storeBackend.executeOperation(this.storeName,i=>{let l=i.add(t,e);l.onsuccess=r,l.onerror=a})})}async putItem(e,t){return new Promise(async(r,a)=>{this.storeBackend.executeOperation(this.storeName,i=>{let l=i.put(t,e);l.onsuccess=r,l.onerror=a})})}async hasItem(e){try{return!!await this.getItem(e)}catch{return!1}}async getItem(e){return new Promise(async(t,r)=>{this.storeBackend.executeOperation(this.storeName,a=>{let i=a.get(e);i.onsuccess=()=>{t(i.result)},i.onerror=r})})}async updateItem(e,t){return new Promise(async(r,a)=>{this.storeBackend.executeOperation(this.storeName,i=>{let l=i.get(e);l.onsuccess=()=>{let s=l.result;Object.assign(s,t),i.put(s,e),r()},l.onerror=a})})}async deleteItem(e){return new Promise(async(t,r)=>{this.storeBackend.executeOperation(this.storeName,a=>{let i=a.delete(e);i.onsuccess=t,i.onerror=r})})}}class qr extends Dr{constructor(){super(Lr,Et.store)}async getApp(e){return this.getItem(e)}async addApp(e,t){return this.addItem(e,t)}async putApp(e,t){return this.putItem(e,t)}async hasApp(e){return this.hasItem(e)}async deleteApp(e){return this.deleteItem(e)}}class ba extends Dr{constructor(){super(Lr,zt.store)}async get(e){return this.getItem(e)}async add(e,t){return this.addItem(e,t)}async put(e,t){return this.putItem(e,t)}async delete(e){return this.deleteItem(e)}}class st extends Fr{constructor(e,t,r){super(e,t),this.dataService=new xt(e),this.requestCache=new Map,this.gudhub=r,this.storeManager=new ba}static[Symbol.hasInstance](e){try{return e instanceof st}catch{return!1}}async getCachedMergedChunk(e,t){try{return(await this.storeManager.get(e)).mergedData}catch{let a=t.map(s=>this.dataService.getChunk(e,s)),i=await Promise.all(a),l=await this.gudhub.util.mergeChunks(i);return this.putMergedChunks(e,{hashes:t,mergedData:{items_list:l}}),{items_list:l}}}isWithCache(){return!0}async getMergedChunkForApp(e){}async getMergedChunkForIDList(e,t){try{let r,a=!0,i=await this.storeManager.get(e);try{if(t.length<i.hashes.length)throw Error();for(let u of i.hashes)t.indexOf(u)!=i.hashes.indexOf(u)&&(a=!1)}catch{a=!1}let l=[],s=[];if(t.length>i.hashes.length&&(l=t.slice(i.hashes.length)),a||(l=t),l.length>0){let u=l.map(o=>this.dataService.getChunk(e,o));s=await Promise.all(u)}return a||(r=await this.gudhub.util.mergeChunks([...s])),a&&(r=await this.gudhub.util.mergeChunks([i.mergedData,...s])),l.length>0&&this.putMergedChunks(e,{hashes:t,mergedData:{items_list:r}}),{items_list:r}}catch{let a=t.map(s=>this.dataService.getChunk(e,s)),i=await Promise.all(a),l=await this.gudhub.util.mergeChunks(i);return this.putMergedChunks(e,{hashes:t,mergedData:{items_list:l}}),{items_list:l}}}async putMergedChunks(e,t){return this.storeManager.put(e,t)}}let xe={INIT:1,REQUEST_APP:2,PROCESS_DATA:3,DECLINE_PROCESS_DATA_REQUEST:4};class Vt extends $t{constructor(e,t,r){super(e,t,r),this.dataService=new He(e,t,r),this.requestCache=new Map,this.gudhub=r,this.resolveFnMap=new Map,this.appRequestAndProcessWorker=new AppRequestWorkerScript,this.appRequestAndProcessWorker.postMessage({type:xe.INIT,gudhubSerialized:this.gudhub.serialized});let a=this;this.appRequestAndProcessWorker.onerror=function(i){},this.appRequestAndProcessWorker.onmessage=function(i){i.data.type==xe.REQUEST_APP&&a.resolveFnMap.has(i.data.id)&&a.resolveFnMap.get(i.data.id)(i.data.data),i.data.type==xe.PROCESS_DATA&&(a.gudhub.itemProcessor.handleDiff(i.data.id,i.data.compareRes),(i.data.viewListChanged||i.data.fieldListChanged)&&a.gudhub.appProcessor.updateAppFieldsAndViews(i.data.newVersion))},this.isWithCache(),this.storeManager=new qr}static[Symbol.hasInstance](e){try{return e instanceof Vt}catch{return!1}}isWithCache(){return!0}async getApp(e){if(this.requestCache.has(e))return this.requestCache.get(e);let t=this;await this.has(e);{let r=new Promise((a,i)=>{t.resolveFnMap.set(e,a)});return this.requestCache.set(e,r),this.appRequestAndProcessWorker.postMessage({type:xe.REQUEST_APP,id:e}),r}}async getCached(e){return this.storeManager.getApp(e)}async has(e){try{return this.storeManager.hasApp(e)}catch{}}async putApp(e,t){return this.storeManager.putApp(e,t)}}class Br extends $t{constructor(e,t,r){super(e,t,r),this.dataService=new He(e,null,r),this.requestCache=new Map,this.gudhub=r}isWithCache(){return!1}async getAppWithoutProcessing(e){let t=await this.dataService.getAppWithoutProcessing(e);return await this.putApp(e,t),t}async getApp(e){let t;if(this.requestCache.has(e))return this.requestCache.get(e);let r=new Promise((l,s)=>{t=l});this.requestCache.set(e,r);let a=await this.dataService.getAppWithoutProcessing(e),i=await this.processRequestedApp(e,a);return t(i),i}async has(e){return!1}async getCached(e){throw Error()}async putApp(e,t){throw Error()}}class va extends $t{constructor(e,t,r){super(e,t,r),this.dataService=new He(e,t,r),this.requestCache=new Map,this.gudhub=r,this.resolveFnMap=new Map,this.appRequestAndProcessWorker=new AppRequestWorkerScript,this.appRequestAndProcessWorker.postMessage({type:xe.INIT,gudhubSerialized:this.gudhub.serialized});let a=this;this.appRequestAndProcessWorker.onerror=function(i){},this.appRequestAndProcessWorker.onmessage=function(i){i.data.type==xe.REQUEST_APP&&a.resolveFnMap.has(i.data.id)&&a.resolveFnMap.get(i.data.id)(i.data.data),i.data.type==xe.PROCESS_DATA&&(a.gudhub.itemProcessor.handleDiff(i.data.id,i.data.compareRes),(i.data.viewListChanged||i.data.fieldListChanged)&&a.gudhub.appProcessor.updateAppFieldsAndViews(i.data.newVersion))},this.isWithCache(),this.storeManager=new qr}static[Symbol.hasInstance](e){try{return e instanceof Vt}catch{return!1}}isWithCache(){return!1}async getApp(e){if(this.requestCache.has(e))return this.requestCache.get(e);let t=new Promise((r,a)=>{self.resolveFnMap.set(e,r)});return this.requestCache.set(e,t),this.appRequestAndProcessWorker.postMessage({type:xe.REQUEST_APP,id:e}),t}async getCached(e){return this.storeManager.getApp(e)}async has(e){try{return this.storeManager.hasApp(e)}catch{}}async putApp(e,t){return this.storeManager.putApp(e,t)}}A("5xozB"),me.IS_BROWSER,me.IS_BROWSER&&Ke&&(Ut=va,Tr=Et),me.IS_BROWSER||(Ut=He),Ke&&(Ur=Br),me.IS_BROWSER&&Cr&&!Ke&&(vt=st,Gt=Ht),me.IS_BROWSER&&Cr&&Ke&&(vt=st,Gt=Ht),me.IS_BROWSER||(vt=xt);let Ur=Br,wa=st;var me=A("5xozB");class Gr{constructor(e,t,r,a,i,l,s){this.storage=e,this.pipeService=t,this.req=r,this.ws=a,this.applistReceived=!1,this.activateSW=l,this.util=i,this.appListeners(),this.dataService=s,this.appRequestCache=new Map}async createNewAppApi(e){try{let t=await this.req.post({url:"/api/app/create",form:{app:JSON.stringify(e)}});return t.from_apps_list=!0,t}catch(t){return console.log(t),null}}async updateAppApi(e){try{return await this.req.post({url:"/api/app/update",form:{app:JSON.stringify(e)}})}catch(t){return console.log(t),null}}async deleteAppApi(e){try{return await this.req.post({url:"/api/app/delete",form:{app_id:e}})}catch(t){return console.log(t),null}}async getAppListApi(){try{return(await this.req.get({url:"/api/applist/get"})).apps_list.map(e=>(e.from_apps_list=!0,e))}catch(e){return console.log(e),null}}getAppListFromStorage(){return this.storage.getAppsList()}getAppFromStorage(e){let t=this.storage.getApp(e);return t&&t.field_list.length?t:null}addNewAppToStorage(e){return this.storage.getAppsList().push(e)}saveAppInStorage(e){e.items_object={};for(let r=0;r<e.items_list.length;r++){e.items_object[e.items_list[r].item_id]={};for(let a=0;a<e.items_list[r].fields.length;a++)e.items_object[e.items_list[r].item_id][e.items_list[r].fields[a].field_id]=e.items_list[r].fields[a]}let t=this.storage.getApp(e.app_id);return t?(e.from_apps_list=t.from_apps_list,e.permission=t.permission,this.storage.updateApp(e)):(e.from_apps_list=!1,this.addNewAppToStorage(e)),this.getAppFromStorage(e.app_id)}updateAppFieldsAndViews(e){let t=this.getAppFromStorage(e.app_id);e.items_list=t.items_list,e.file_list=t.file_list,e.from_apps_list=t.from_apps_list,e.items_object=t.items_object,this.storage.updateApp(e),this.pipeService.emit("gh_app_views_update",{app_id:e.app_id},e.views_list),e.field_list.forEach(r=>{this.pipeService.emit("gh_model_update",{app_id:e.app_id,field_id:r.field_id},r)})}updateAppInStorage(e){this.storage.getApp(e.app_id)?(this.storage.updateApp(e),this.pipeService.emit("gh_app_update",{app_id:e.app_id},e),this.pipeService.emit("gh_items_update",{app_id:e.app_id},e.items_list)):this.addNewAppToStorage(e)}deletingAppFromStorage(e){let t=this.storage.getAppsList();return t.forEach((r,a)=>{r.app_id==e&&t.splice(a)}),t}updateAppsListInStorage(e=[]){for(let t of e){let r=this.storage.getApp(t.app_id);r?(r.from_apps_list=t.from_apps_list,r.permission=t.permission):this.addNewAppToStorage(t)}}async refreshApps(e=[]){for(let t of e)if(t!=null)try{let r=await this.dataService.getApp(t);if(r){r.items_object={};for(let a=0;a<r.items_list.length;a++){r.items_object[r.items_list[a].item_id]={};for(let i=0;i<r.items_list[a].fields.length;i++)r.items_object[r.items_list[a].item_id][r.items_list[a].fields[i].field_id]=r.items_list[a].fields[i]}this.updateAppInStorage(r),this.pipeService.emit("gh_app_views_update",{app_id:r.app_id},r.views_list)}}catch(r){console.log(r)}console.log("Apps refreshed: ",JSON.stringify(e))}async refreshAppsList(){let e=this.getAppListFromStorage(),t=(await this.getAppListApi()).map(r=>({...r,...e.find(a=>a.app_id===r.app_id)}));this.updateAppsListInStorage(t),this.pipeService.emit("gh_apps_list_refreshed",{})}async getAppsList(){let e=this.getAppListFromStorage();if(!this.applistReceived){let t=await this.getAppListApi();if(!t)return null;this.updateAppsListInStorage(t),this.applistReceived=!0,e=t}return e}async getAppInfo(e){let t=await this.getAppsList();return t?t.find(r=>r.app_id==e):null}async deleteApp(e){return await this.deleteAppApi(e),this.deletingAppFromStorage(e)}async getApp(e,t=!1){if(!e)return null;let r=this.getAppFromStorage(e);if(r)return r;if(this.appRequestCache.has(e))return this.appRequestCache.get(e);let a=this,i=new Promise(async(l,s)=>{try{let u=await a.dataService.getApp(e);u||s();let o=t?u:{...u,items_list:u.items_list.filter(p=>!p.trash)};o=t?o:{...o,field_list:o.field_list.filter(p=>!p.trash)},l(o),a.saveAppInStorage(o),a.ws.addSubscription(e)}catch{s()}});return a.appRequestCache.set(e,i),i}async updateApp(e){if(!e.views_list||!e.views_list.length||!e.show){let r=await this.getApp(e.app_id);e.views_list&&e.views_list.length||(e.views_list=r.views_list),e.show===void 0&&(e.show=r.show)}let t=await this.updateAppApi(e);return this.updateAppFieldsAndViews(t),t}async updateAppInfo(e={}){return this.pipeService.emit("gh_app_info_update",{app_id:e.app_id},e),this.updateApp(e)}async createNewApp(e){let t=await this.createNewAppApi(e);return t.items_object={},this.addNewAppToStorage(t),t}async getAppViews(e){if(e)return(await this.getApp(e)).views_list}clearAppProcessor(){this.getAppListPromises=null,this.getAppPromises={},this.applistReceived=!1}appListeners(){this.pipeService.onRoot("gh_app_get",{},async(e,t)=>{if(t&&t.app_id){let r=await this.getApp(t.app_id);this.pipeService.emit("gh_app_get",t,r)}}),this.pipeService.onRoot("gh_apps_list_get",{},async(e,t)=>{let r=await this.getAppsList();this.pipeService.emit("gh_apps_list_get",t,r)}),this.pipeService.onRoot("gh_delete_app",{},async(e,t)=>{let r=await this.deleteApp(t.app_id);this.pipeService.emit("gh_apps_list_update",{recipient:"all"},r)}),this.pipeService.onRoot("gh_app_update",{},async(e,t)=>{t.app.items_list=[],t.app.file_list=[];let r=await this.updateApp(t.app);this.pipeService.emit("gh_app_views_update",{app_id:r.app_id},r.views_list);let a=await this.getAppsList();this.pipeService.emit("gh_apps_list_update",{recipient:"all"},a),r.field_list.forEach(i=>{this.pipeService.emit("gh_model_update",{app_id:r.app_id,field_id:i.field_id},i)})}),this.pipeService.onRoot("gh_app_view_get",{},async(e,t)=>{if(t&&t.app_id){let r=await this.getApp(t.app_id);r.views_list.forEach((a,i)=>{a.view_id==t.view_id&&this.pipeService.emit("gh_app_view_get",t,r.views_list[i])})}}),this.pipeService.onRoot("gh_app_info_get",{},async(e,t)=>{let r=await this.getAppInfo(t.app_id);r&&this.pipeService.emit("gh_app_info_get",t,r)}),this.pipeService.onRoot("gh_app_info_update",{},async(e,t)=>{if(t&&t.app){let r=await this.updateAppInfo(t.app);this.pipeService.emit("gh_app_info_update",{app_id:t.app.app_id},r)}}),this.pipeService.onRoot("gh_app_create",{},async(e,t)=>{await this.createNewApp(t.app);let r=await this.getAppsList();this.pipeService.emit("gh_apps_list_update",{recipient:"all"},r)}),me.IS_BROWSER_MAIN_THREAD&&this.activateSW&&navigator.serviceWorker.addEventListener("message",async e=>{if(e.data.type==="refresh app"){let t=await this.getApp(e.data.payload.app_id);t&&this.util.compareAppsItemsLists(t.items_list,e.data.payload.items_list.filter(r=>!r.trash),({diff_fields_items:r,diff_fields_items_Ids:a,diff_items:i,newItems:l,deletedItems:s})=>{(i.length||l.length||s.length)&&(this.pipeService.emit("gh_items_update",{app_id:e.data.payload.app_id},e.data.payload.items_list.filter(u=>!u.trash)),i.forEach(u=>this.pipeService.emit("gh_item_update",{app_id:e.data.payload.app_id,item_id:u.item_id},u))),a.forEach(u=>{let o=r[u];o&&o.forEach(p=>{this.pipeService.emit("gh_value_update",{app_id:e.data.payload.app_id,item_id:u,field_id:p.field_id},p.field_value)})})}),e.data.payload.items_list=await this.util.mergeChunks([t,e.data.payload]),this.saveAppInStorage(e.data.payload)}})}}var gt=A("akXK4");function Wr(n=[]){return n.filter(e=>e.field_value!=null)}function $a(n={}){let e=Object.entries(n);return e.length?\`&\${e.map(([t,r])=>\`\${t}=\${r}\`).join("&")}\`:""}var kt={},Hr={},Jt={},ve=A("hMrGw"),Ve={},ve=A("hMrGw"),ot={},Qt=A("hweMw"),ve=A("hMrGw"),zr={},ve=A("hMrGw"),Yt={},ct=A("hGGZx"),Sa=A("kPNod"),$e=A("b9GfH"),lt={},ve=A("hMrGw"),At=ve("%Object.getOwnPropertyDescriptor%",!0);if(At)try{At([],"length")}catch{At=null}lt=At,Yt=function(n,e,t){if(!n||typeof n!="object"&&typeof n!="function")throw new $e("\`obj\` must be an object or a function\`");if(typeof e!="string"&&typeof e!="symbol")throw new $e("\`property\` must be a string or a symbol\`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new $e("\`nonEnumerable\`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new $e("\`nonWritable\`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new $e("\`nonConfigurable\`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new $e("\`loose\`, if provided, must be a boolean");var r=arguments.length>3?arguments[3]:null,a=arguments.length>4?arguments[4]:null,i=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],s=!!lt&&lt(n,e);if(ct)ct(n,e,{configurable:i===null&&s?s.configurable:!i,enumerable:r===null&&s?s.enumerable:!r,value:t,writable:a===null&&s?s.writable:!a});else{if(!l&&(r||a||i))throw new Sa("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");n[e]=t}};var xa=A("9cNUg")(),$e=A("b9GfH"),Ea=ve("%Math.floor%");zr=function(n,e){if(typeof n!="function")throw new $e("\`fn\` is not a function");if(typeof e!="number"||e<0||e>4294967295||Ea(e)!==e)throw new $e("\`length\` must be a positive 32-bit integer");var t=arguments.length>2&&!!arguments[2],r=!0,a=!0;if("length"in n&&lt){var i=lt(n,"length");i&&!i.configurable&&(r=!1),i&&!i.writable&&(a=!1)}return(r||a||!t)&&(xa?Yt(n,"length",e,!0,!0):Yt(n,"length",e)),n};var $e=A("b9GfH"),Vr=ve("%Function.prototype.apply%"),Jr=ve("%Function.prototype.call%"),Qr=ve("%Reflect.apply%",!0)||Qt.call(Jr,Vr),ct=A("hGGZx"),ka=ve("%Math.max%");ot=function(n){if(typeof n!="function")throw new $e("a function is required");var e=Qr(Qt,Jr,arguments);return zr(e,1+ka(0,n.length-(arguments.length-1)),!0)};var Yr=function(){return Qr(Qt,Vr,arguments)};ct?ct(ot,"apply",{value:Yr}):ot.apply=Yr;var Aa=ot(ve("String.prototype.indexOf"));Ve=function(n,e){var t=ve(n,!!e);return typeof t=="function"&&Aa(n,".prototype.")>-1?ot(t):t};var Xr={},Xt=typeof Map=="function"&&Map.prototype,Kt=Object.getOwnPropertyDescriptor&&Xt?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,It=Xt&&Kt&&typeof Kt.get=="function"?Kt.get:null,Kr=Xt&&Map.prototype.forEach,Zt=typeof Set=="function"&&Set.prototype,er=Object.getOwnPropertyDescriptor&&Zt?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Ot=Zt&&er&&typeof er.get=="function"?er.get:null,Zr=Zt&&Set.prototype.forEach,Ia=typeof WeakMap=="function"&&WeakMap.prototype,ut=Ia?WeakMap.prototype.has:null,Oa=typeof WeakSet=="function"&&WeakSet.prototype,pt=Oa?WeakSet.prototype.has:null,ja=typeof WeakRef=="function"&&WeakRef.prototype,en=ja?WeakRef.prototype.deref:null,Ta=Boolean.prototype.valueOf,Pa=Object.prototype.toString,Ca=Function.prototype.toString,Na=String.prototype.match,tr=String.prototype.slice,De=String.prototype.replace,Ma=String.prototype.toUpperCase,tn=String.prototype.toLowerCase,rn=RegExp.prototype.test,nn=Array.prototype.concat,je=Array.prototype.join,Ra=Array.prototype.slice,an=Math.floor,rr=typeof BigInt=="function"?BigInt.prototype.valueOf:null,nr=Object.getOwnPropertySymbols,ar=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Ze=typeof Symbol=="function"&&typeof Symbol.iterator=="object",ye=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Ze||!0)?Symbol.toStringTag:null,sn=Object.prototype.propertyIsEnumerable,on=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(n){return n.__proto__}:null);function ln(n,e){if(n===1/0||n===-1/0||n!=n||n&&n>-1e3&&n<1e3||rn.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof n=="number"){var r=n<0?-an(-n):an(n);if(r!==n){var a=String(r),i=tr.call(e,a.length+1);return De.call(a,t,"$&_")+"."+De.call(De.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return De.call(e,t,"$&_")}var ir={},cn=ir.custom,un=fn(cn)?cn:null;function pn(n,e,t){var r=(t.quoteStyle||e)==="double"?'"':"'";return r+n+r}function Fa(n){return De.call(String(n),/"/g,"&quot;")}function sr(n){return Be(n)==="[object Array]"&&(!ye||!(typeof n=="object"&&ye in n))}function La(n){return Be(n)==="[object Date]"&&(!ye||!(typeof n=="object"&&ye in n))}function dn(n){return Be(n)==="[object RegExp]"&&(!ye||!(typeof n=="object"&&ye in n))}function Da(n){return Be(n)==="[object Error]"&&(!ye||!(typeof n=="object"&&ye in n))}function qa(n){return Be(n)==="[object String]"&&(!ye||!(typeof n=="object"&&ye in n))}function Ba(n){return Be(n)==="[object Number]"&&(!ye||!(typeof n=="object"&&ye in n))}function Ua(n){return Be(n)==="[object Boolean]"&&(!ye||!(typeof n=="object"&&ye in n))}function fn(n){if(Ze)return n&&typeof n=="object"&&n instanceof Symbol;if(typeof n=="symbol")return!0;if(!n||typeof n!="object"||!ar)return!1;try{return ar.call(n),!0}catch{}return!1}function Ga(n){if(!n||typeof n!="object"||!rr)return!1;try{return rr.call(n),!0}catch{}return!1}Xr=function n(e,t,r,a){var i=t||{};if(qe(i,"quoteStyle")&&i.quoteStyle!=="single"&&i.quoteStyle!=="double")throw TypeError('option "quoteStyle" must be "single" or "double"');if(qe(i,"maxStringLength")&&(typeof i.maxStringLength=="number"?i.maxStringLength<0&&i.maxStringLength!==1/0:i.maxStringLength!==null))throw TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or \`null\`');var l=!qe(i,"customInspect")||i.customInspect;if(typeof l!="boolean"&&l!=="symbol")throw TypeError("option \\"customInspect\\", if provided, must be \`true\`, \`false\`, or \`'symbol'\`");if(qe(i,"indent")&&i.indent!==null&&i.indent!==" "&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw TypeError('option "indent" must be "\\\\t", an integer > 0, or \`null\`');if(qe(i,"numericSeparator")&&typeof i.numericSeparator!="boolean")throw TypeError('option "numericSeparator", if provided, must be \`true\` or \`false\`');var s=i.numericSeparator;if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return mn(e,i);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var u=String(e);return s?ln(e,u):u}if(typeof e=="bigint"){var o=String(e)+"n";return s?ln(e,o):o}var p=i.depth===void 0?5:i.depth;if(r===void 0&&(r=0),r>=p&&p>0&&typeof e=="object")return sr(e)?"[Array]":"[Object]";var m=ei(i,r);if(a===void 0)a=[];else if(hn(a,e)>=0)return"[Circular]";function d(C,B,V){if(B&&(a=Ra.call(a)).push(B),V){var X={depth:i.depth};return qe(i,"quoteStyle")&&(X.quoteStyle=i.quoteStyle),n(C,X,r+1,a)}return n(C,i,r+1,a)}if(typeof e=="function"&&!dn(e)){var y=Ha(e),f=jt(e,d);return"[Function"+(y?": "+y:" (anonymous)")+"]"+(f.length>0?" { "+je.call(f,", ")+" }":"")}if(fn(e)){var S=Ze?De.call(String(e),/^(Symbol\\(.*\\))_[^)]*$/,"$1"):ar.call(e);return typeof e!="object"||Ze?S:dt(S)}if(Xa(e)){for(var v="<"+tn.call(String(e.nodeName)),w=e.attributes||[],g=0;g<w.length;g++)v+=" "+w[g].name+"="+pn(Fa(w[g].value),"double",i);return v+=">",e.childNodes&&e.childNodes.length&&(v+="..."),v+="</"+tn.call(String(e.nodeName))+">"}if(sr(e)){if(e.length===0)return"[]";var _=jt(e,d);return m&&!Za(_)?"["+lr(_,m)+"]":"[ "+je.call(_,", ")+" ]"}if(Da(e)){var $=jt(e,d);return"cause"in Error.prototype||!("cause"in e)||sn.call(e,"cause")?$.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+je.call($,", ")+" }":"{ ["+String(e)+"] "+je.call(nn.call("[cause]: "+d(e.cause),$),", ")+" }"}if(typeof e=="object"&&l){if(un&&typeof e[un]=="function"&&ir)return ir(e,{depth:p-r});if(l!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(za(e)){var x=[];return Kr&&Kr.call(e,function(C,B){x.push(d(B,e,!0)+" => "+d(C,e))}),gn("Map",It.call(e),x,m)}if(Qa(e)){var T=[];return Zr&&Zr.call(e,function(C){T.push(d(C,e))}),gn("Set",Ot.call(e),T,m)}if(Va(e))return or("WeakMap");if(Ya(e))return or("WeakSet");if(Ja(e))return or("WeakRef");if(Ba(e))return dt(d(Number(e)));if(Ga(e))return dt(d(rr.call(e)));if(Ua(e))return dt(Ta.call(e));if(qa(e))return dt(d(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(e===le)return"{ [object globalThis] }";if(!La(e)&&!dn(e)){var P=jt(e,d),D=on?on(e)===Object.prototype:e instanceof Object||e.constructor===Object,R=e instanceof Object?"":"null prototype",I=!D&&ye&&Object(e)===e&&ye in e?tr.call(Be(e),8,-1):R?"Object":"",F=(D||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"")+(I||R?"["+je.call(nn.call([],I||[],R||[]),": ")+"] ":"");return P.length===0?F+"{}":m?F+"{"+lr(P,m)+"}":F+"{ "+je.call(P,", ")+" }"}return String(e)};var Wa=Object.prototype.hasOwnProperty||function(n){return n in this};function qe(n,e){return Wa.call(n,e)}function Be(n){return Pa.call(n)}function Ha(n){if(n.name)return n.name;var e=Na.call(Ca.call(n),/^function\\s*([\\w$]+)/);return e?e[1]:null}function hn(n,e){if(n.indexOf)return n.indexOf(e);for(var t=0,r=n.length;t<r;t++)if(n[t]===e)return t;return-1}function za(n){if(!It||!n||typeof n!="object")return!1;try{It.call(n);try{Ot.call(n)}catch{return!0}return n instanceof Map}catch{}return!1}function Va(n){if(!ut||!n||typeof n!="object")return!1;try{ut.call(n,ut);try{pt.call(n,pt)}catch{return!0}return n instanceof WeakMap}catch{}return!1}function Ja(n){if(!en||!n||typeof n!="object")return!1;try{return en.call(n),!0}catch{}return!1}function Qa(n){if(!Ot||!n||typeof n!="object")return!1;try{Ot.call(n);try{It.call(n)}catch{return!0}return n instanceof Set}catch{}return!1}function Ya(n){if(!pt||!n||typeof n!="object")return!1;try{pt.call(n,pt);try{ut.call(n,ut)}catch{return!0}return n instanceof WeakSet}catch{}return!1}function Xa(n){return!!n&&typeof n=="object"&&(typeof HTMLElement<"u"&&n instanceof HTMLElement||typeof n.nodeName=="string"&&typeof n.getAttribute=="function")}function mn(n,e){if(n.length>e.maxStringLength){var t=n.length-e.maxStringLength,r="... "+t+" more character"+(t>1?"s":"");return mn(tr.call(n,0,e.maxStringLength),e)+r}return pn(De.call(De.call(n,/(['\\\\])/g,"\\\\$1"),/[\\x00-\\x1f]/g,Ka),"single",e)}function Ka(n){var e=n.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\\\"+t:"\\\\x"+(e<16?"0":"")+Ma.call(e.toString(16))}function dt(n){return"Object("+n+")"}function or(n){return n+" { ? }"}function gn(n,e,t,r){return n+" ("+e+") {"+(r?lr(t,r):je.call(t,", "))+"}"}function Za(n){for(var e=0;e<n.length;e++)if(hn(n[e],\`
15226
+ \`),function(o){s=o.indexOf(":"),i=t.trim(o.substr(0,s)).toLowerCase(),l=t.trim(o.substr(s+1)),i&&!(u[i]&&r.indexOf(i)>=0)&&(i==="set-cookie"?u[i]=(u[i]?u[i]:[]).concat([l]):u[i]=u[i]?u[i]+", "+l:l)}),u}}),L("eg6xZ",function(n,e){var t=A("iEaqd");n.exports=t.isStandardBrowserEnv()?function(){var r,a=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a");function l(s){var u=s;return a&&(i.setAttribute("href",u),u=i.href),i.setAttribute("href",u),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:i.pathname.charAt(0)==="/"?i.pathname:"/"+i.pathname}}return r=l(window.location.href),function(s){var u=t.isString(s)?l(s):s;return u.protocol===r.protocol&&u.host===r.host}}():function(){return function(){return!0}}()}),L("8kGOw",function(n,e){n.exports=function(t){return!!(t&&t.__CANCEL__)}}),L("6Mx50",function(n,e){var t=A("iEaqd");n.exports=function(r,a){a=a||{};var i={},l=["url","method","data"],s=["headers","auth","proxy","params"],u=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],o=["validateStatus"];function p(f,S){return t.isPlainObject(f)&&t.isPlainObject(S)?t.merge(f,S):t.isPlainObject(S)?t.merge({},S):t.isArray(S)?S.slice():S}function m(f){t.isUndefined(a[f])?t.isUndefined(r[f])||(i[f]=p(void 0,r[f])):i[f]=p(r[f],a[f])}t.forEach(l,function(f){t.isUndefined(a[f])||(i[f]=p(void 0,a[f]))}),t.forEach(s,m),t.forEach(u,function(f){t.isUndefined(a[f])?t.isUndefined(r[f])||(i[f]=p(void 0,r[f])):i[f]=p(void 0,a[f])}),t.forEach(o,function(f){f in a?i[f]=p(r[f],a[f]):f in r&&(i[f]=p(void 0,r[f]))});var d=l.concat(s).concat(u).concat(o),y=Object.keys(r).concat(Object.keys(a)).filter(function(f){return d.indexOf(f)===-1});return t.forEach(y,m),i}}),L("hiYAY",function(n,e){var t=A("bTAft"),r={};["object","boolean","number","function","string","symbol"].forEach(function(u,o){r[u]=function(p){return typeof p===u||"a"+(o<1?"n ":" ")+u}});var a={},i=t.version.split(".");function l(u,o){for(var p=o?o.split("."):i,m=u.split("."),d=0;d<3;d++){if(p[d]>m[d])return!0;if(p[d]<m[d])break}return!1}function s(u,o,p){if(typeof u!="object")throw TypeError("options must be an object");for(var m=Object.keys(u),d=m.length;d-- >0;){var y=m[d],f=o[y];if(f){var S=u[y],v=S===void 0||f(S,y,u);if(v!==!0)throw TypeError("option "+y+" must be "+v);continue}if(p!==!0)throw Error("Unknown option "+y)}}r.transitional=function(u,o,p){var m=o&&l(o);function d(y,f){return"[Axios v"+t.version+"] Transitional option '"+y+"'"+f+(p?". "+p:"")}return function(y,f,S){if(u===!1)throw Error(d(f," has been removed in "+o));return m&&!a[f]&&(a[f]=!0,console.warn(d(f," has been deprecated since v"+o+" and will be removed in the near future"))),!u||u(y,f,S)}},n.exports={isOlderVersion:l,assertOptions:s,validators:r}}),L("bTAft",function(n,e){n.exports=JSON.parse('{"_args":[["axios@0.21.4","/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub"]],"_from":"axios@0.21.4","_id":"axios@0.21.4","_inBundle":false,"_integrity":"sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==","_location":"/axios","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"axios@0.21.4","name":"axios","escapedName":"axios","rawSpec":"0.21.4","saveSpec":null,"fetchSpec":"0.21.4"},"_requiredBy":["/"],"_resolved":"https://registry.npmjs.org/axios/-/axios-0.21.4.tgz","_spec":"0.21.4","_where":"/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub","author":{"name":"Matt Zabriskie"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"bugs":{"url":"https://github.com/axios/axios/issues"},"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}],"dependencies":{"follow-redirects":"^1.14.0"},"description":"Promise based HTTP client for the browser and node.js","devDependencies":{"coveralls":"^3.0.0","es6-promise":"^4.2.4","grunt":"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1","karma":"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2","minimist":"^1.2.0","mocha":"^8.2.1","sinon":"^4.5.0","terser-webpack-plugin":"^4.2.3","typescript":"^4.0.5","url-search-params":"^0.10.0","webpack":"^4.44.2","webpack-dev-server":"^3.11.0"},"homepage":"https://axios-http.com","jsdelivr":"dist/axios.min.js","keywords":["xhr","http","ajax","promise","node"],"license":"MIT","main":"index.js","name":"axios","repository":{"type":"git","url":"git+https://github.com/axios/axios.git"},"scripts":{"build":"NODE_ENV=production grunt build","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","examples":"node ./examples/server.js","fix":"eslint --fix lib/**/*.js","postversion":"git push && git push --tags","preversion":"npm test","start":"node ./sandbox/server.js","test":"grunt test","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json"},"typings":"./index.d.ts","unpkg":"dist/axios.min.js","version":"0.21.4"}')}),L("g2liO",function(n,e){function t(r){this.message=r}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,n.exports=t}),L("14PRn",function(n,e){var t=A("g2liO");function r(a){if(typeof a!="function")throw TypeError("executor must be a function.");this.promise=new Promise(function(s){i=s});var i,l=this;a(function(s){l.reason||(l.reason=new t(s),i(l.reason))})}r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},r.source=function(){var a;return{token:new r(function(i){a=i}),cancel:a}},n.exports=r}),L("i3hBo",function(n,e){n.exports=function(t){return function(r){return t.apply(null,r)}}}),L("dhYWP",function(n,e){n.exports=function(t){return typeof t=="object"&&t.isAxiosError===!0}}),L("kfIQl",function(n,e){var t=typeof Symbol<"u"&&Symbol,r=A("lyEFc");n.exports=function(){return typeof t=="function"&&typeof Symbol=="function"&&typeof t("foo")=="symbol"&&typeof Symbol("bar")=="symbol"&&r()}}),L("lyEFc",function(n,e){n.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),a=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(a)!=="[object Symbol]")return!1;var i=42;for(r in t[r]=i,t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var l=Object.getOwnPropertySymbols(t);if(l.length!==1||l[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(t,r);if(s.value!==i||s.enumerable!==!0)return!1}return!0}}),L("bJ3CN",function(n,e){var t={__proto__:null,foo:{}},r=Object;n.exports=function(){return{__proto__:t}.foo===t.foo&&!(t instanceof r)}}),L("9cNUg",function(n,e){var t=A("hGGZx"),r=function(){return!!t};r.hasArrayLengthDefineBug=function(){if(!t)return null;try{return t([],"length",{value:1}).length!==1}catch{return!0}},n.exports=r}),L("hGGZx",function(n,e){var t=A("hMrGw")("%Object.defineProperty%",!0)||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}n.exports=t}),L("hMrGw",function(n,e){var t=A("dUpie"),r=A("48xLS"),a=A("4Vqmv"),i=A("7x6DQ"),l=A("kPNod"),s=A("b9GfH"),u=A("8DBKi"),o=Function,p=function(H){try{return o('"use strict"; return ('+H+").constructor;")()}catch{}},m=Object.getOwnPropertyDescriptor;if(m)try{m({},"")}catch{m=null}var d=function(){throw new s},y=m?function(){try{return arguments.callee,d}catch{try{return m(arguments,"callee").get}catch{return d}}}():d,f=A("kfIQl")(),S=A("bJ3CN")(),v=Object.getPrototypeOf||(S?function(H){return H.__proto__}:null),w={},g=typeof Uint8Array<"u"&&v?v(Uint8Array):void 0,_={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?void 0:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?void 0:ArrayBuffer,"%ArrayIteratorPrototype%":f&&v?v([][Symbol.iterator]()):void 0,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":w,"%AsyncGenerator%":w,"%AsyncGeneratorFunction%":w,"%AsyncIteratorPrototype%":w,"%Atomics%":typeof Atomics>"u"?void 0:Atomics,"%BigInt%":typeof BigInt>"u"?void 0:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?void 0:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?void 0:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?void 0:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":r,"%Float32Array%":typeof Float32Array>"u"?void 0:Float32Array,"%Float64Array%":typeof Float64Array>"u"?void 0:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?void 0:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":w,"%Int8Array%":typeof Int8Array>"u"?void 0:Int8Array,"%Int16Array%":typeof Int16Array>"u"?void 0:Int16Array,"%Int32Array%":typeof Int32Array>"u"?void 0:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":f&&v?v(v([][Symbol.iterator]())):void 0,"%JSON%":typeof JSON=="object"?JSON:void 0,"%Map%":typeof Map>"u"?void 0:Map,"%MapIteratorPrototype%":typeof Map<"u"&&f&&v?v(new Map()[Symbol.iterator]()):void 0,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?void 0:Promise,"%Proxy%":typeof Proxy>"u"?void 0:Proxy,"%RangeError%":a,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?void 0:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?void 0:Set,"%SetIteratorPrototype%":typeof Set<"u"&&f&&v?v(new Set()[Symbol.iterator]()):void 0,"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?void 0:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":f&&v?v(""[Symbol.iterator]()):void 0,"%Symbol%":f?Symbol:void 0,"%SyntaxError%":l,"%ThrowTypeError%":y,"%TypedArray%":g,"%TypeError%":s,"%Uint8Array%":typeof Uint8Array>"u"?void 0:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?void 0:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?void 0:Uint32Array,"%URIError%":u,"%WeakMap%":typeof WeakMap>"u"?void 0:WeakMap,"%WeakRef%":typeof WeakRef>"u"?void 0:WeakRef,"%WeakSet%":typeof WeakSet>"u"?void 0:WeakSet};if(v)try{null.error}catch(H){var $=v(v(H));_["%Error.prototype%"]=$}var x=function H(ie){var ee;if(ie==="%AsyncFunction%")ee=p("async function () {}");else if(ie==="%GeneratorFunction%")ee=p("function* () {}");else if(ie==="%AsyncGeneratorFunction%")ee=p("async function* () {}");else if(ie==="%AsyncGenerator%"){var k=H("%AsyncGeneratorFunction%");k&&(ee=k.prototype)}else if(ie==="%AsyncIteratorPrototype%"){var O=H("%AsyncGenerator%");O&&v&&(ee=v(O.prototype))}return _[ie]=ee,ee},T={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},P=A("hweMw"),D=A("23C6u"),R=P.call(Function.call,Array.prototype.concat),I=P.call(Function.apply,Array.prototype.splice),F=P.call(Function.call,String.prototype.replace),C=P.call(Function.call,String.prototype.slice),B=P.call(Function.call,RegExp.prototype.exec),V=/[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g,X=/\\\\(\\\\)?/g,oe=function(H){var ie=C(H,0,1),ee=C(H,-1);if(ie==="%"&&ee!=="%")throw new l("invalid intrinsic syntax, expected closing \`%\`");if(ee==="%"&&ie!=="%")throw new l("invalid intrinsic syntax, expected opening \`%\`");var k=[];return F(H,V,function(O,N,K,se){k[k.length]=K?F(se,X,"$1"):N||O}),k},we=function(H,ie){var ee,k=H;if(D(T,k)&&(k="%"+(ee=T[k])[0]+"%"),D(_,k)){var O=_[k];if(O===w&&(O=x(k)),O===void 0&&!ie)throw new s("intrinsic "+H+" exists, but is not available. Please file an issue!");return{alias:ee,name:k,value:O}}throw new l("intrinsic "+H+" does not exist!")};n.exports=function(H,ie){if(typeof H!="string"||H.length===0)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ie!="boolean")throw new s('"allowMissing" argument must be a boolean');if(B(/^%?[^%]*%?$/,H)===null)throw new l("\`%\` may not be present anywhere but at the beginning and end of the intrinsic name");var ee=oe(H),k=ee.length>0?ee[0]:"",O=we("%"+k+"%",ie),N=O.name,K=O.value,se=!1,te=O.alias;te&&(k=te[0],I(ee,R([0,1],te)));for(var J=1,ce=!0;J<ee.length;J+=1){var re=ee[J],fe=C(re,0,1),Ae=C(re,-1);if((fe==='"'||fe==="'"||fe==="\`"||Ae==='"'||Ae==="'"||Ae==="\`")&&fe!==Ae)throw new l("property names with quotes must have matching quotes");if(re!=="constructor"&&ce||(se=!0),k+="."+re,D(_,N="%"+k+"%"))K=_[N];else if(K!=null){if(!(re in K)){if(!ie)throw new s("base intrinsic for "+H+" exists, but the property is not available.");return}if(m&&J+1>=ee.length){var Ie=m(K,re);K=(ce=!!Ie)&&"get"in Ie&&!("originalValue"in Ie.get)?Ie.get:K[re]}else ce=D(K,re),K=K[re];ce&&!se&&(_[N]=K)}}return K}}),L("dUpie",function(n,e){n.exports=Error}),L("48xLS",function(n,e){n.exports=EvalError}),L("4Vqmv",function(n,e){n.exports=RangeError}),L("7x6DQ",function(n,e){n.exports=ReferenceError}),L("kPNod",function(n,e){n.exports=SyntaxError}),L("b9GfH",function(n,e){n.exports=TypeError}),L("8DBKi",function(n,e){n.exports=URIError}),L("hweMw",function(n,e){var t=A("2Eytq");n.exports=Function.prototype.bind||t}),L("2Eytq",function(n,e){var t="Function.prototype.bind called on incompatible ",r=Object.prototype.toString,a=Math.max,i="[object Function]",l=function(o,p){for(var m=[],d=0;d<o.length;d+=1)m[d]=o[d];for(var y=0;y<p.length;y+=1)m[y+o.length]=p[y];return m},s=function(o,p){for(var m=[],d=p,y=0;d<o.length;d+=1,y+=1)m[y]=o[d];return m},u=function(o,p){for(var m="",d=0;d<o.length;d+=1)m+=o[d],d+1<o.length&&(m+=p);return m};n.exports=function(o){var p,m=this;if(typeof m!="function"||r.apply(m)!==i)throw TypeError(t+m);for(var d=s(arguments,1),y=function(){if(this instanceof p){var g=m.apply(this,l(d,arguments));return Object(g)===g?g:this}return m.apply(o,l(d,arguments))},f=a(0,m.length-d.length),S=[],v=0;v<f;v++)S[v]="$"+v;if(p=Function("binder","return function ("+u(S,",")+"){ return binder.apply(this,arguments); }")(y),m.prototype){var w=function(){};w.prototype=m.prototype,p.prototype=new w,w.prototype=null}return p}}),L("23C6u",function(n,e){var t=Function.prototype.call,r=Object.prototype.hasOwnProperty,a=A("hweMw");n.exports=a.call(t,r)}),L("5ZWAZ",function(n,e){function t(r){return n.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},n.exports.__esModule=!0,n.exports.default=n.exports,t(r)}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports}),L("fgq5y",function(n,e){var t=A("f3Ywx").default;Object.defineProperty(n.exports,"__esModule",{value:!0}),n.exports.default=l;var r=t(A("a9VQw")),a=t(A("glRwo")),i=t(A("ayR3G"));function l(s,u){(0,i.default)(2,arguments);var o=(0,a.default)(s),p=(0,r.default)(u);return isNaN(p)?new Date(NaN):(p&&o.setDate(o.getDate()+p),o)}n.exports=n.exports.default}),L("f3Ywx",function(n,e){function t(r){return r&&r.__esModule?r:{default:r}}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports}),L("a9VQw",function(n,e){function t(r){if(r===null||r===!0||r===!1)return NaN;var a=Number(r);return isNaN(a)?a:a<0?Math.ceil(a):Math.floor(a)}Object.defineProperty(n.exports,"__esModule",{value:!0}),n.exports.default=t,n.exports=n.exports.default}),L("glRwo",function(n,e){var t=A("f3Ywx").default;Object.defineProperty(n.exports,"__esModule",{value:!0}),n.exports.default=i;var r=t(A("5ZWAZ")),a=t(A("ayR3G"));function i(l){(0,a.default)(1,arguments);var s=Object.prototype.toString.call(l);return l instanceof Date||(0,r.default)(l)==="object"&&s==="[object Date]"?new Date(l.getTime()):typeof l=="number"||s==="[object Number]"?new Date(l):((typeof l=="string"||s==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use \`parseISO\` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(Error().stack)),new Date(NaN))}n.exports=n.exports.default}),L("ayR3G",function(n,e){function t(r,a){if(a.length<r)throw TypeError(r+" argument"+(r>1?"s":"")+" required, but only "+a.length+" present")}Object.defineProperty(n.exports,"__esModule",{value:!0}),n.exports.default=t,n.exports=n.exports.default}),L("byyO9",function(n,e){var t=A("f3Ywx").default;Object.defineProperty(n.exports,"__esModule",{value:!0}),n.exports.default=l;var r=t(A("a9VQw")),a=t(A("glRwo")),i=t(A("ayR3G"));function l(s,u){(0,i.default)(2,arguments);var o=(0,a.default)(s),p=(0,r.default)(u);if(isNaN(p))return new Date(NaN);if(!p)return o;var m=o.getDate(),d=new Date(o.getTime());return d.setMonth(o.getMonth()+p+1,0),m>=d.getDate()?d:(o.setFullYear(d.getFullYear(),d.getMonth(),m),o)}n.exports=n.exports.default}),L("hLz6R",function(n,e){var t=A("f3Ywx").default;Object.defineProperty(n.exports,"__esModule",{value:!0}),n.exports.default=s;var r=t(A("glRwo")),a=t(A("a9VQw")),i=t(A("ayR3G")),l=A("lmyOi");function s(u,o){(0,i.default)(1,arguments);var p,m,d,y,f,S,v,w,g=(0,l.getDefaultOptions)(),_=(0,a.default)((p=(m=(d=(y=o==null?void 0:o.weekStartsOn)!==null&&y!==void 0?y:o==null||(f=o.locale)===null||f===void 0||(S=f.options)===null||S===void 0?void 0:S.weekStartsOn)!==null&&d!==void 0?d:g.weekStartsOn)!==null&&m!==void 0?m:(v=g.locale)===null||v===void 0||(w=v.options)===null||w===void 0?void 0:w.weekStartsOn)!==null&&p!==void 0?p:0);if(!(_>=0&&_<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");var $=(0,r.default)(u),x=$.getDay(),T=(x<_?7:0)+x-_;return $.setDate($.getDate()-T),$.setHours(0,0,0,0),$}n.exports=n.exports.default}),L("lmyOi",function(n,e){Object.defineProperty(n.exports,"__esModule",{value:!0}),n.exports.getDefaultOptions=r,n.exports.setDefaultOptions=a;var t={};function r(){return t}function a(i){t=i}}),L("kmcAT",function(n,e){A("akXK4"),A("5xozB")}),L("akXK4",function(n,e){n.exports=A("1ufAB")}),L("5xozB",function(n,e){Pr(n.exports,"IS_BROWSER_MAIN_THREAD",()=>r),Pr(n.exports,"IS_BROWSER",()=>i);var t=A("2dKjk");let r=typeof window<"u"&&typeof document<"u",a=typeof self=="object"&&typeof WorkerGlobalScope<"u",i=r||a;t!==void 0&&t.versions!=null&&t.versions.node});var me=A("5xozB");let ca="https://gudhub.com/GudHub_Test",ua="wss://gudhub.com/GudHub/ws/app/",pa="https://gudhub.com/api/services/prod",da="build/latest/async_modules_node/",fa="build/latest/automation_modules/",ha="https://gudhub.com",Cr=!0,Nr=!1,Ke=!0;me.IS_BROWSER||(Ke=!1);var me=A("5xozB");class Mr{}class $t extends Mr{constructor(e,t,r){super(),this.chunkDataService=new vt(e,Gt,r),this.gudhub=r}isWithCache(){return!1}async processRequestedApp(e,t){if(!this.isWithCache()){let r=await this.chunkDataService.getMergedChunkForIDList(e,t.chunks);return r&&(t.items_list=await this.gudhub.util.mergeChunks([r,t])),t}}}class ma{constructor(e){this.req=e}async getApp(e){return this.req.get({url:"/api/app/get",params:{app_id:e}})}}let Rr=(n,...e)=>{for(let t of e)if(t)for(let r of Object.keys(t)){let a=Object.getOwnPropertyDescriptor(t,r);a.enumerable&&Object.defineProperty(n,r,a)}};class St{}class He extends $t{constructor(e,t,r){super(e,t,r),this.appApi=new ma(e),Rr(this,new St(t))}async getApp(e){let t=await this.appApi.getApp(e);return this.processRequestedApp(e,t)}async getAppWithoutProcessing(e){return this.appApi.getApp(e)}async putApp(e,t){}static[Symbol.hasInstance](e){try{return e instanceof He||e instanceof St}catch{return!1}}}class Fr extends Mr{getMergedChunkForIDList(e){}isWithCache(){return!1}}class ga{constructor(e){this.req=e}async getChunk(e,t){return this.req.get({url:\`\${this.req.root}/api/get-items-chunk/\${e}/\${t}\`,method:"GET"})}async getLastChunk(e){return this.req.axiosRequest({url:\`\${this.req.root}/api/get-last-items-chunk/\${e}\`,method:"GET"})}}class xt extends Fr{constructor(e,t){super(),this.chunkApi=new ga(e),Rr(this,new St(t))}async getChunk(e,t){return this.chunkApi.getChunk(e,t)}async getChunksForId(e){return[]}getCachedMergedChunk(e,t){}getMergedChunkForIDList(e,t){}putChunk(){}static[Symbol.hasInstance](e){try{return e instanceof xt||e instanceof St}catch{return!1}}}let Et={store:"apps"},Ht={store:"chunks"},ya="gudhub",zt={store:"chunksMergeCache"};class _a{}class ze extends _a{constructor(e,t){if(super(),ze.dbNameToInstanceMap||(ze.dbNameToInstanceMap=new Map),ze.dbNameToInstanceMap.has(e))return ze.dbNameToInstanceMap.get(e);this.db=null,this.dbName=e,this.storeNameList=t,ze.dbNameToInstanceMap.set(e,this)}async checkAndCreateStore(e){let t=(await indexedDB.databases()).find(i=>i.name===this.dbName),r=!1,a=this;return t&&(r=await new Promise((i,l)=>{let s=indexedDB.open(a.dbName);s.onsuccess=function(u){let o=u.target.result,p=o.objectStoreNames.contains(e);o.close(),i(p)},s.onerror=function(u){l(u.target.error)}})),!!r||new Promise((i,l)=>{let s=indexedDB.open(a.dbName,t?t.version+1:1);s.onupgradeneeded=function(u){let o=u.target.result;o.objectStoreNames.contains(e)||o.createObjectStore(e)},s.onsuccess=function(u){u.target.result.close(),i()},s.onerror=l})}async openDB(){let e,t;if(this.db)return this.db;let r=new Promise((l,s)=>{e=l,t=s});for(let l of this.storeNameList)await this.checkAndCreateStore(l);let a=this,i=indexedDB.open(this.dbName);return i.onsuccess=l=>{a.db=l.target.result,e(this.db)},i.onerror=t,r}async executeOperation(e,t){let r=await this.openDB();return new Promise((a,i)=>{let l=r.transaction(e,"readwrite"),s=l.objectStore(e);l.oncomplete=()=>a(),l.onerror=u=>i(\`Transaction failed: \${u.target.error}\`);try{t(s)}catch(u){i(\`Operation failed: \${u.message}\`)}})}}let Lr=new ze(ya,[Et.store,Ht.store,zt.store]);class Dr{constructor(e,t){this.storeBackend=e,this.storeName=t}async addItem(e,t){return new Promise(async(r,a)=>{this.storeBackend.executeOperation(this.storeName,i=>{let l=i.add(t,e);l.onsuccess=r,l.onerror=a})})}async putItem(e,t){return new Promise(async(r,a)=>{this.storeBackend.executeOperation(this.storeName,i=>{let l=i.put(t,e);l.onsuccess=r,l.onerror=a})})}async hasItem(e){try{return!!await this.getItem(e)}catch{return!1}}async getItem(e){return new Promise(async(t,r)=>{this.storeBackend.executeOperation(this.storeName,a=>{let i=a.get(e);i.onsuccess=()=>{t(i.result)},i.onerror=r})})}async updateItem(e,t){return new Promise(async(r,a)=>{this.storeBackend.executeOperation(this.storeName,i=>{let l=i.get(e);l.onsuccess=()=>{let s=l.result;Object.assign(s,t),i.put(s,e),r()},l.onerror=a})})}async deleteItem(e){return new Promise(async(t,r)=>{this.storeBackend.executeOperation(this.storeName,a=>{let i=a.delete(e);i.onsuccess=t,i.onerror=r})})}}class qr extends Dr{constructor(){super(Lr,Et.store)}async getApp(e){return this.getItem(e)}async addApp(e,t){return this.addItem(e,t)}async putApp(e,t){return this.putItem(e,t)}async hasApp(e){return this.hasItem(e)}async deleteApp(e){return this.deleteItem(e)}}class ba extends Dr{constructor(){super(Lr,zt.store)}async get(e){return this.getItem(e)}async add(e,t){return this.addItem(e,t)}async put(e,t){return this.putItem(e,t)}async delete(e){return this.deleteItem(e)}}class st extends Fr{constructor(e,t,r){super(e,t),this.dataService=new xt(e),this.requestCache=new Map,this.gudhub=r,this.storeManager=new ba}static[Symbol.hasInstance](e){try{return e instanceof st}catch{return!1}}async getCachedMergedChunk(e,t){try{return(await this.storeManager.get(e)).mergedData}catch{let a=t.map(s=>this.dataService.getChunk(e,s)),i=await Promise.all(a),l=await this.gudhub.util.mergeChunks(i);return this.putMergedChunks(e,{hashes:t,mergedData:{items_list:l}}),{items_list:l}}}isWithCache(){return!0}async getMergedChunkForApp(e){}async getMergedChunkForIDList(e,t){try{let r,a=!0,i=await this.storeManager.get(e);try{if(t.length<i.hashes.length)throw Error();for(let u of i.hashes)t.indexOf(u)!=i.hashes.indexOf(u)&&(a=!1)}catch{a=!1}let l=[],s=[];if(t.length>i.hashes.length&&(l=t.slice(i.hashes.length)),a||(l=t),l.length>0){let u=l.map(o=>this.dataService.getChunk(e,o));s=await Promise.all(u)}return a||(r=await this.gudhub.util.mergeChunks([...s])),a&&(r=await this.gudhub.util.mergeChunks([i.mergedData,...s])),l.length>0&&this.putMergedChunks(e,{hashes:t,mergedData:{items_list:r}}),{items_list:r}}catch{let a=t.map(s=>this.dataService.getChunk(e,s)),i=await Promise.all(a),l=await this.gudhub.util.mergeChunks(i);return this.putMergedChunks(e,{hashes:t,mergedData:{items_list:l}}),{items_list:l}}}async putMergedChunks(e,t){return this.storeManager.put(e,t)}}let xe={INIT:1,REQUEST_APP:2,PROCESS_DATA:3,DECLINE_PROCESS_DATA_REQUEST:4};class Vt extends $t{constructor(e,t,r){super(e,t,r),this.dataService=new He(e,t,r),this.requestCache=new Map,this.gudhub=r,this.resolveFnMap=new Map,this.appRequestAndProcessWorker=new AppRequestWorkerScript,this.appRequestAndProcessWorker.postMessage({type:xe.INIT,gudhubSerialized:this.gudhub.serialized});let a=this;this.appRequestAndProcessWorker.onerror=function(i){},this.appRequestAndProcessWorker.onmessage=function(i){i.data.type==xe.REQUEST_APP&&a.resolveFnMap.has(i.data.id)&&a.resolveFnMap.get(i.data.id)(i.data.data),i.data.type==xe.PROCESS_DATA&&(a.gudhub.itemProcessor.handleDiff(i.data.id,i.data.compareRes),(i.data.viewListChanged||i.data.fieldListChanged)&&a.gudhub.appProcessor.updateAppFieldsAndViews(i.data.newVersion))},this.isWithCache(),this.storeManager=new qr}static[Symbol.hasInstance](e){try{return e instanceof Vt}catch{return!1}}isWithCache(){return!0}async getApp(e){if(this.requestCache.has(e))return this.requestCache.get(e);let t=this;await this.has(e);{let r=new Promise((a,i)=>{t.resolveFnMap.set(e,a)});return this.requestCache.set(e,r),this.appRequestAndProcessWorker.postMessage({type:xe.REQUEST_APP,id:e}),r}}async getCached(e){return this.storeManager.getApp(e)}async has(e){try{return this.storeManager.hasApp(e)}catch{}}async putApp(e,t){return this.storeManager.putApp(e,t)}}class Br extends $t{constructor(e,t,r){super(e,t,r),this.dataService=new He(e,null,r),this.requestCache=new Map,this.gudhub=r}isWithCache(){return!1}async getAppWithoutProcessing(e){let t=await this.dataService.getAppWithoutProcessing(e);return await this.putApp(e,t),t}async getApp(e){let t;if(this.requestCache.has(e))return this.requestCache.get(e);let r=new Promise((l,s)=>{t=l});this.requestCache.set(e,r);let a=await this.dataService.getAppWithoutProcessing(e),i=await this.processRequestedApp(e,a);return t(i),i}async has(e){return!1}async getCached(e){throw Error()}async putApp(e,t){throw Error()}}class va extends $t{constructor(e,t,r){super(e,t,r),this.dataService=new He(e,t,r),this.requestCache=new Map,this.gudhub=r,this.resolveFnMap=new Map,this.appRequestAndProcessWorker=new AppRequestWorkerScript,this.appRequestAndProcessWorker.postMessage({type:xe.INIT,gudhubSerialized:this.gudhub.serialized});let a=this;this.appRequestAndProcessWorker.onerror=function(i){},this.appRequestAndProcessWorker.onmessage=function(i){i.data.type==xe.REQUEST_APP&&a.resolveFnMap.has(i.data.id)&&a.resolveFnMap.get(i.data.id)(i.data.data),i.data.type==xe.PROCESS_DATA&&(a.gudhub.itemProcessor.handleDiff(i.data.id,i.data.compareRes),(i.data.viewListChanged||i.data.fieldListChanged)&&a.gudhub.appProcessor.updateAppFieldsAndViews(i.data.newVersion))},this.isWithCache(),this.storeManager=new qr}static[Symbol.hasInstance](e){try{return e instanceof Vt}catch{return!1}}isWithCache(){return!1}async getApp(e){if(this.requestCache.has(e))return this.requestCache.get(e);let t=new Promise((r,a)=>{self.resolveFnMap.set(e,r)});return this.requestCache.set(e,t),this.appRequestAndProcessWorker.postMessage({type:xe.REQUEST_APP,id:e}),t}async getCached(e){return this.storeManager.getApp(e)}async has(e){try{return this.storeManager.hasApp(e)}catch{}}async putApp(e,t){return this.storeManager.putApp(e,t)}}A("5xozB"),me.IS_BROWSER,me.IS_BROWSER&&Ke&&(Ut=va,Tr=Et),me.IS_BROWSER||(Ut=He),Ke&&(Ur=Br),me.IS_BROWSER&&Cr&&!Ke&&(vt=st,Gt=Ht),me.IS_BROWSER&&Cr&&Ke&&(vt=st,Gt=Ht),me.IS_BROWSER||(vt=xt);let Ur=Br,wa=st;var me=A("5xozB");class Gr{constructor(e,t,r,a,i,l,s){this.storage=e,this.pipeService=t,this.req=r,this.ws=a,this.applistReceived=!1,this.activateSW=l,this.util=i,this.appListeners(),this.dataService=s,this.appRequestCache=new Map}async createNewAppApi(e){try{let t=await this.req.post({url:"/api/app/create",form:{app:JSON.stringify(e)}});return t.from_apps_list=!0,t}catch(t){return console.log(t),null}}async updateAppApi(e){try{return await this.req.post({url:"/api/app/update",form:{app:JSON.stringify(e)}})}catch(t){return console.log(t),null}}async deleteAppApi(e){try{return await this.req.post({url:"/api/app/delete",form:{app_id:e}})}catch(t){return console.log(t),null}}async getAppListApi(){try{return(await this.req.get({url:"/api/applist/get"})).apps_list.map(e=>(e.from_apps_list=!0,e))}catch(e){return console.log(e),null}}getAppListFromStorage(){return this.storage.getAppsList()}getAppFromStorage(e){let t=this.storage.getApp(e);return t&&t.field_list.length?t:null}addNewAppToStorage(e){return this.storage.getAppsList().push(e)}saveAppInStorage(e){e.items_object={};for(let r=0;r<e.items_list.length;r++){e.items_object[e.items_list[r].item_id]={};for(let a=0;a<e.items_list[r].fields.length;a++)e.items_object[e.items_list[r].item_id][e.items_list[r].fields[a].field_id]=e.items_list[r].fields[a]}let t=this.storage.getApp(e.app_id);return t?(e.from_apps_list=t.from_apps_list,e.permission=t.permission,this.storage.updateApp(e)):(e.from_apps_list=!1,this.addNewAppToStorage(e)),this.getAppFromStorage(e.app_id)}updateAppFieldsAndViews(e){let t=this.getAppFromStorage(e.app_id);e.items_list=t.items_list,e.file_list=t.file_list,e.from_apps_list=t.from_apps_list,e.items_object=t.items_object,this.storage.updateApp(e),this.pipeService.emit("gh_app_views_update",{app_id:e.app_id},e.views_list),e.field_list.forEach(r=>{this.pipeService.emit("gh_model_update",{app_id:e.app_id,field_id:r.field_id},r)})}updateAppInStorage(e){this.storage.getApp(e.app_id)?(this.storage.updateApp(e),this.pipeService.emit("gh_app_update",{app_id:e.app_id},e),this.pipeService.emit("gh_items_update",{app_id:e.app_id},e.items_list)):this.addNewAppToStorage(e)}deletingAppFromStorage(e){let t=this.storage.getAppsList();return t.forEach((r,a)=>{r.app_id==e&&t.splice(a)}),t}updateAppsListInStorage(e=[]){for(let t of e){let r=this.storage.getApp(t.app_id);r?(r.from_apps_list=t.from_apps_list,r.permission=t.permission):this.addNewAppToStorage(t)}}async refreshApps(e=[]){for(let t of e)if(t!=null)try{let r=await this.dataService.getApp(t);if(r){r.items_object={};for(let a=0;a<r.items_list.length;a++){r.items_object[r.items_list[a].item_id]={};for(let i=0;i<r.items_list[a].fields.length;i++)r.items_object[r.items_list[a].item_id][r.items_list[a].fields[i].field_id]=r.items_list[a].fields[i]}this.updateAppInStorage(r),this.pipeService.emit("gh_app_views_update",{app_id:r.app_id},r.views_list)}}catch(r){console.log(r)}console.log("Apps refreshed: ",JSON.stringify(e))}async refreshAppsList(){let e=this.getAppListFromStorage(),t=(await this.getAppListApi()).map(r=>({...r,...e.find(a=>a.app_id===r.app_id)}));this.updateAppsListInStorage(t),this.pipeService.emit("gh_apps_list_refreshed",{})}async getAppsList(){let e=this.getAppListFromStorage();if(!this.applistReceived){let t=await this.getAppListApi();if(!t)return null;this.updateAppsListInStorage(t),this.applistReceived=!0,e=t}return e}async getAppInfo(e){let t=await this.getAppsList();return t?t.find(r=>r.app_id==e):null}async deleteApp(e){return await this.deleteAppApi(e),this.deletingAppFromStorage(e)}async getApp(e,t=!1){if(!e)return null;let r=this.getAppFromStorage(e);if(r)return r;if(this.appRequestCache.has(e))return this.appRequestCache.get(e);let a=this,i=new Promise(async(l,s)=>{try{let u=await a.dataService.getApp(e);u||s();let o=t?u:{...u,items_list:u.items_list.filter(p=>!p.trash)};o=t?o:{...o,field_list:o.field_list.filter(p=>!p.trash)},l(o),a.saveAppInStorage(o),a.ws.addSubscription(e)}catch{s()}});return a.appRequestCache.set(e,i),i}async updateApp(e){if(!e.views_list||!e.views_list.length||!e.show){let r=await this.getApp(e.app_id);e.views_list&&e.views_list.length||(e.views_list=r.views_list),e.show===void 0&&(e.show=r.show)}let t=await this.updateAppApi(e);return this.updateAppFieldsAndViews(t),t}async updateAppInfo(e={}){return this.pipeService.emit("gh_app_info_update",{app_id:e.app_id},e),this.updateApp(e)}async createNewApp(e){let t=await this.createNewAppApi(e);return t.items_object={},this.addNewAppToStorage(t),t}async getAppViews(e){if(e)return(await this.getApp(e)).views_list}clearAppProcessor(){this.getAppListPromises=null,this.getAppPromises={},this.applistReceived=!1}appListeners(){this.pipeService.onRoot("gh_app_get",{},async(e,t)=>{if(t&&t.app_id){let r=await this.getApp(t.app_id);this.pipeService.emit("gh_app_get",t,r)}}),this.pipeService.onRoot("gh_apps_list_get",{},async(e,t)=>{let r=await this.getAppsList();this.pipeService.emit("gh_apps_list_get",t,r)}),this.pipeService.onRoot("gh_delete_app",{},async(e,t)=>{let r=await this.deleteApp(t.app_id);this.pipeService.emit("gh_apps_list_update",{recipient:"all"},r)}),this.pipeService.onRoot("gh_app_update",{},async(e,t)=>{t.app.items_list=[],t.app.file_list=[];let r=await this.updateApp(t.app);this.pipeService.emit("gh_app_views_update",{app_id:r.app_id},r.views_list);let a=await this.getAppsList();this.pipeService.emit("gh_apps_list_update",{recipient:"all"},a),r.field_list.forEach(i=>{this.pipeService.emit("gh_model_update",{app_id:r.app_id,field_id:i.field_id},i)})}),this.pipeService.onRoot("gh_app_view_get",{},async(e,t)=>{if(t&&t.app_id){let r=await this.getApp(t.app_id);r.views_list.forEach((a,i)=>{a.view_id==t.view_id&&this.pipeService.emit("gh_app_view_get",t,r.views_list[i])})}}),this.pipeService.onRoot("gh_app_info_get",{},async(e,t)=>{let r=await this.getAppInfo(t.app_id);r&&this.pipeService.emit("gh_app_info_get",t,r)}),this.pipeService.onRoot("gh_app_info_update",{},async(e,t)=>{if(t&&t.app){let r=await this.updateAppInfo(t.app);this.pipeService.emit("gh_app_info_update",{app_id:t.app.app_id},r)}}),this.pipeService.onRoot("gh_app_create",{},async(e,t)=>{await this.createNewApp(t.app);let r=await this.getAppsList();this.pipeService.emit("gh_apps_list_update",{recipient:"all"},r)}),me.IS_BROWSER_MAIN_THREAD&&this.activateSW&&navigator.serviceWorker.addEventListener("message",async e=>{if(e.data.type==="refresh app"){let t=await this.getApp(e.data.payload.app_id);t&&this.util.compareAppsItemsLists(t.items_list,e.data.payload.items_list.filter(r=>!r.trash),({diff_fields_items:r,diff_fields_items_Ids:a,diff_items:i,newItems:l,deletedItems:s})=>{(i.length||l.length||s.length)&&(this.pipeService.emit("gh_items_update",{app_id:e.data.payload.app_id},e.data.payload.items_list.filter(u=>!u.trash)),i.forEach(u=>this.pipeService.emit("gh_item_update",{app_id:e.data.payload.app_id,item_id:u.item_id},u))),a.forEach(u=>{let o=r[u];o&&o.forEach(p=>{this.pipeService.emit("gh_value_update",{app_id:e.data.payload.app_id,item_id:u,field_id:p.field_id},p.field_value)})})}),e.data.payload.items_list=await this.util.mergeChunks([t,e.data.payload]),this.saveAppInStorage(e.data.payload)}})}}var gt=A("akXK4");function Wr(n=[]){return n.filter(e=>e.field_value!=null)}function $a(n={}){let e=Object.entries(n);return e.length?\`&\${e.map(([t,r])=>\`\${t}=\${r}\`).join("&")}\`:""}var kt={},Hr={},Jt={},ve=A("hMrGw"),Ve={},ve=A("hMrGw"),ot={},Qt=A("hweMw"),ve=A("hMrGw"),zr={},ve=A("hMrGw"),Yt={},ct=A("hGGZx"),Sa=A("kPNod"),$e=A("b9GfH"),lt={},ve=A("hMrGw"),At=ve("%Object.getOwnPropertyDescriptor%",!0);if(At)try{At([],"length")}catch{At=null}lt=At,Yt=function(n,e,t){if(!n||typeof n!="object"&&typeof n!="function")throw new $e("\`obj\` must be an object or a function\`");if(typeof e!="string"&&typeof e!="symbol")throw new $e("\`property\` must be a string or a symbol\`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new $e("\`nonEnumerable\`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new $e("\`nonWritable\`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new $e("\`nonConfigurable\`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new $e("\`loose\`, if provided, must be a boolean");var r=arguments.length>3?arguments[3]:null,a=arguments.length>4?arguments[4]:null,i=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],s=!!lt&&lt(n,e);if(ct)ct(n,e,{configurable:i===null&&s?s.configurable:!i,enumerable:r===null&&s?s.enumerable:!r,value:t,writable:a===null&&s?s.writable:!a});else{if(!l&&(r||a||i))throw new Sa("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");n[e]=t}};var xa=A("9cNUg")(),$e=A("b9GfH"),Ea=ve("%Math.floor%");zr=function(n,e){if(typeof n!="function")throw new $e("\`fn\` is not a function");if(typeof e!="number"||e<0||e>4294967295||Ea(e)!==e)throw new $e("\`length\` must be a positive 32-bit integer");var t=arguments.length>2&&!!arguments[2],r=!0,a=!0;if("length"in n&&lt){var i=lt(n,"length");i&&!i.configurable&&(r=!1),i&&!i.writable&&(a=!1)}return(r||a||!t)&&(xa?Yt(n,"length",e,!0,!0):Yt(n,"length",e)),n};var $e=A("b9GfH"),Vr=ve("%Function.prototype.apply%"),Jr=ve("%Function.prototype.call%"),Qr=ve("%Reflect.apply%",!0)||Qt.call(Jr,Vr),ct=A("hGGZx"),ka=ve("%Math.max%");ot=function(n){if(typeof n!="function")throw new $e("a function is required");var e=Qr(Qt,Jr,arguments);return zr(e,1+ka(0,n.length-(arguments.length-1)),!0)};var Yr=function(){return Qr(Qt,Vr,arguments)};ct?ct(ot,"apply",{value:Yr}):ot.apply=Yr;var Aa=ot(ve("String.prototype.indexOf"));Ve=function(n,e){var t=ve(n,!!e);return typeof t=="function"&&Aa(n,".prototype.")>-1?ot(t):t};var Xr={},Xt=typeof Map=="function"&&Map.prototype,Kt=Object.getOwnPropertyDescriptor&&Xt?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,It=Xt&&Kt&&typeof Kt.get=="function"?Kt.get:null,Kr=Xt&&Map.prototype.forEach,Zt=typeof Set=="function"&&Set.prototype,er=Object.getOwnPropertyDescriptor&&Zt?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Ot=Zt&&er&&typeof er.get=="function"?er.get:null,Zr=Zt&&Set.prototype.forEach,Ia=typeof WeakMap=="function"&&WeakMap.prototype,ut=Ia?WeakMap.prototype.has:null,Oa=typeof WeakSet=="function"&&WeakSet.prototype,pt=Oa?WeakSet.prototype.has:null,ja=typeof WeakRef=="function"&&WeakRef.prototype,en=ja?WeakRef.prototype.deref:null,Ta=Boolean.prototype.valueOf,Pa=Object.prototype.toString,Ca=Function.prototype.toString,Na=String.prototype.match,tr=String.prototype.slice,De=String.prototype.replace,Ma=String.prototype.toUpperCase,tn=String.prototype.toLowerCase,rn=RegExp.prototype.test,nn=Array.prototype.concat,je=Array.prototype.join,Ra=Array.prototype.slice,an=Math.floor,rr=typeof BigInt=="function"?BigInt.prototype.valueOf:null,nr=Object.getOwnPropertySymbols,ar=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Ze=typeof Symbol=="function"&&typeof Symbol.iterator=="object",ye=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Ze||!0)?Symbol.toStringTag:null,sn=Object.prototype.propertyIsEnumerable,on=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(n){return n.__proto__}:null);function ln(n,e){if(n===1/0||n===-1/0||n!=n||n&&n>-1e3&&n<1e3||rn.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof n=="number"){var r=n<0?-an(-n):an(n);if(r!==n){var a=String(r),i=tr.call(e,a.length+1);return De.call(a,t,"$&_")+"."+De.call(De.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return De.call(e,t,"$&_")}var ir={},cn=ir.custom,un=fn(cn)?cn:null;function pn(n,e,t){var r=(t.quoteStyle||e)==="double"?'"':"'";return r+n+r}function Fa(n){return De.call(String(n),/"/g,"&quot;")}function sr(n){return Be(n)==="[object Array]"&&(!ye||!(typeof n=="object"&&ye in n))}function La(n){return Be(n)==="[object Date]"&&(!ye||!(typeof n=="object"&&ye in n))}function dn(n){return Be(n)==="[object RegExp]"&&(!ye||!(typeof n=="object"&&ye in n))}function Da(n){return Be(n)==="[object Error]"&&(!ye||!(typeof n=="object"&&ye in n))}function qa(n){return Be(n)==="[object String]"&&(!ye||!(typeof n=="object"&&ye in n))}function Ba(n){return Be(n)==="[object Number]"&&(!ye||!(typeof n=="object"&&ye in n))}function Ua(n){return Be(n)==="[object Boolean]"&&(!ye||!(typeof n=="object"&&ye in n))}function fn(n){if(Ze)return n&&typeof n=="object"&&n instanceof Symbol;if(typeof n=="symbol")return!0;if(!n||typeof n!="object"||!ar)return!1;try{return ar.call(n),!0}catch{}return!1}function Ga(n){if(!n||typeof n!="object"||!rr)return!1;try{return rr.call(n),!0}catch{}return!1}Xr=function n(e,t,r,a){var i=t||{};if(qe(i,"quoteStyle")&&i.quoteStyle!=="single"&&i.quoteStyle!=="double")throw TypeError('option "quoteStyle" must be "single" or "double"');if(qe(i,"maxStringLength")&&(typeof i.maxStringLength=="number"?i.maxStringLength<0&&i.maxStringLength!==1/0:i.maxStringLength!==null))throw TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or \`null\`');var l=!qe(i,"customInspect")||i.customInspect;if(typeof l!="boolean"&&l!=="symbol")throw TypeError("option \\"customInspect\\", if provided, must be \`true\`, \`false\`, or \`'symbol'\`");if(qe(i,"indent")&&i.indent!==null&&i.indent!==" "&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw TypeError('option "indent" must be "\\\\t", an integer > 0, or \`null\`');if(qe(i,"numericSeparator")&&typeof i.numericSeparator!="boolean")throw TypeError('option "numericSeparator", if provided, must be \`true\` or \`false\`');var s=i.numericSeparator;if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return mn(e,i);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var u=String(e);return s?ln(e,u):u}if(typeof e=="bigint"){var o=String(e)+"n";return s?ln(e,o):o}var p=i.depth===void 0?5:i.depth;if(r===void 0&&(r=0),r>=p&&p>0&&typeof e=="object")return sr(e)?"[Array]":"[Object]";var m=ei(i,r);if(a===void 0)a=[];else if(hn(a,e)>=0)return"[Circular]";function d(C,B,V){if(B&&(a=Ra.call(a)).push(B),V){var X={depth:i.depth};return qe(i,"quoteStyle")&&(X.quoteStyle=i.quoteStyle),n(C,X,r+1,a)}return n(C,i,r+1,a)}if(typeof e=="function"&&!dn(e)){var y=Ha(e),f=jt(e,d);return"[Function"+(y?": "+y:" (anonymous)")+"]"+(f.length>0?" { "+je.call(f,", ")+" }":"")}if(fn(e)){var S=Ze?De.call(String(e),/^(Symbol\\(.*\\))_[^)]*$/,"$1"):ar.call(e);return typeof e!="object"||Ze?S:dt(S)}if(Xa(e)){for(var v="<"+tn.call(String(e.nodeName)),w=e.attributes||[],g=0;g<w.length;g++)v+=" "+w[g].name+"="+pn(Fa(w[g].value),"double",i);return v+=">",e.childNodes&&e.childNodes.length&&(v+="..."),v+="</"+tn.call(String(e.nodeName))+">"}if(sr(e)){if(e.length===0)return"[]";var _=jt(e,d);return m&&!Za(_)?"["+lr(_,m)+"]":"[ "+je.call(_,", ")+" ]"}if(Da(e)){var $=jt(e,d);return"cause"in Error.prototype||!("cause"in e)||sn.call(e,"cause")?$.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+je.call($,", ")+" }":"{ ["+String(e)+"] "+je.call(nn.call("[cause]: "+d(e.cause),$),", ")+" }"}if(typeof e=="object"&&l){if(un&&typeof e[un]=="function"&&ir)return ir(e,{depth:p-r});if(l!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(za(e)){var x=[];return Kr&&Kr.call(e,function(C,B){x.push(d(B,e,!0)+" => "+d(C,e))}),gn("Map",It.call(e),x,m)}if(Qa(e)){var T=[];return Zr&&Zr.call(e,function(C){T.push(d(C,e))}),gn("Set",Ot.call(e),T,m)}if(Va(e))return or("WeakMap");if(Ya(e))return or("WeakSet");if(Ja(e))return or("WeakRef");if(Ba(e))return dt(d(Number(e)));if(Ga(e))return dt(d(rr.call(e)));if(Ua(e))return dt(Ta.call(e));if(qa(e))return dt(d(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(e===le)return"{ [object globalThis] }";if(!La(e)&&!dn(e)){var P=jt(e,d),D=on?on(e)===Object.prototype:e instanceof Object||e.constructor===Object,R=e instanceof Object?"":"null prototype",I=!D&&ye&&Object(e)===e&&ye in e?tr.call(Be(e),8,-1):R?"Object":"",F=(D||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"")+(I||R?"["+je.call(nn.call([],I||[],R||[]),": ")+"] ":"");return P.length===0?F+"{}":m?F+"{"+lr(P,m)+"}":F+"{ "+je.call(P,", ")+" }"}return String(e)};var Wa=Object.prototype.hasOwnProperty||function(n){return n in this};function qe(n,e){return Wa.call(n,e)}function Be(n){return Pa.call(n)}function Ha(n){if(n.name)return n.name;var e=Na.call(Ca.call(n),/^function\\s*([\\w$]+)/);return e?e[1]:null}function hn(n,e){if(n.indexOf)return n.indexOf(e);for(var t=0,r=n.length;t<r;t++)if(n[t]===e)return t;return-1}function za(n){if(!It||!n||typeof n!="object")return!1;try{It.call(n);try{Ot.call(n)}catch{return!0}return n instanceof Map}catch{}return!1}function Va(n){if(!ut||!n||typeof n!="object")return!1;try{ut.call(n,ut);try{pt.call(n,pt)}catch{return!0}return n instanceof WeakMap}catch{}return!1}function Ja(n){if(!en||!n||typeof n!="object")return!1;try{return en.call(n),!0}catch{}return!1}function Qa(n){if(!Ot||!n||typeof n!="object")return!1;try{Ot.call(n);try{It.call(n)}catch{return!0}return n instanceof Set}catch{}return!1}function Ya(n){if(!pt||!n||typeof n!="object")return!1;try{pt.call(n,pt);try{ut.call(n,ut)}catch{return!0}return n instanceof WeakSet}catch{}return!1}function Xa(n){return!!n&&typeof n=="object"&&(typeof HTMLElement<"u"&&n instanceof HTMLElement||typeof n.nodeName=="string"&&typeof n.getAttribute=="function")}function mn(n,e){if(n.length>e.maxStringLength){var t=n.length-e.maxStringLength,r="... "+t+" more character"+(t>1?"s":"");return mn(tr.call(n,0,e.maxStringLength),e)+r}return pn(De.call(De.call(n,/(['\\\\])/g,"\\\\$1"),/[\\x00-\\x1f]/g,Ka),"single",e)}function Ka(n){var e=n.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\\\"+t:"\\\\x"+(e<16?"0":"")+Ma.call(e.toString(16))}function dt(n){return"Object("+n+")"}function or(n){return n+" { ? }"}function gn(n,e,t,r){return n+" ("+e+") {"+(r?lr(t,r):je.call(t,", "))+"}"}function Za(n){for(var e=0;e<n.length;e++)if(hn(n[e],\`
15227
15227
  \`)>=0)return!1;return!0}function ei(n,e){var t;if(n.indent===" ")t=" ";else{if(typeof n.indent!="number"||!(n.indent>0))return null;t=je.call(Array(n.indent+1)," ")}return{base:t,prev:je.call(Array(e+1),t)}}function lr(n,e){if(n.length===0)return"";var t=\`
15228
15228
  \`+e.prev+e.base;return t+je.call(n,","+t)+\`
15229
15229
  \`+e.prev}function jt(n,e){var t,r=sr(n),a=[];if(r){a.length=n.length;for(var i=0;i<n.length;i++)a[i]=qe(n,i)?e(n[i],n):""}var l=typeof nr=="function"?nr(n):[];if(Ze){t={};for(var s=0;s<l.length;s++)t["$"+l[s]]=l[s]}for(var u in n)if(qe(n,u)&&(!r||String(Number(u))!==u||!(u<n.length))){if(Ze&&t["$"+u]instanceof Symbol)continue;rn.call(/[^\\w$]/,u)?a.push(e(u,n)+": "+e(n[u],n)):a.push(u+": "+e(n[u],n))}if(typeof nr=="function")for(var o=0;o<l.length;o++)sn.call(n,l[o])&&a.push("["+e(l[o])+"]: "+e(n[l[o]],n));return a}var $e=A("b9GfH"),Tt=ve("%WeakMap%",!0),Pt=ve("%Map%",!0),ti=Ve("WeakMap.prototype.get",!0),ri=Ve("WeakMap.prototype.set",!0),ni=Ve("WeakMap.prototype.has",!0),ai=Ve("Map.prototype.get",!0),ii=Ve("Map.prototype.set",!0),si=Ve("Map.prototype.has",!0),cr=function(n,e){for(var t,r=n;(t=r.next)!==null;r=t)if(t.key===e)return r.next=t.next,t.next=n.next,n.next=t,t},oi=function(n,e){var t=cr(n,e);return t&&t.value},li=function(n,e,t){var r=cr(n,e);r?r.value=t:n.next={key:e,next:n.next,value:t}},ci=function(n,e){return!!cr(n,e)};Jt=function(){var n,e,t,r={assert:function(a){if(!r.has(a))throw new $e("Side channel does not contain "+Xr(a))},get:function(a){if(Tt&&a&&(typeof a=="object"||typeof a=="function")){if(n)return ti(n,a)}else if(Pt){if(e)return ai(e,a)}else if(t)return oi(t,a)},has:function(a){if(Tt&&a&&(typeof a=="object"||typeof a=="function")){if(n)return ni(n,a)}else if(Pt){if(e)return si(e,a)}else if(t)return ci(t,a);return!1},set:function(a,i){Tt&&a&&(typeof a=="object"||typeof a=="function")?(n||(n=new Tt),ri(n,a,i)):Pt?(e||(e=new Pt),ii(e,a,i)):(t||(t={key:{},next:null}),li(t,a,i))}};return r};var Ee={},Ue={},ui=String.prototype.replace,pi=/%20/g,ur={RFC1738:"RFC1738",RFC3986:"RFC3986"};Ue={default:ur.RFC3986,formatters:{RFC1738:function(n){return ui.call(n,pi,"+")},RFC3986:function(n){return String(n)}},RFC1738:ur.RFC1738,RFC3986:ur.RFC3986};var pr=Object.prototype.hasOwnProperty,Je=Array.isArray,Te=function(){for(var n=[],e=0;e<256;++e)n.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return n}(),di=function(n){for(;n.length>1;){var e=n.pop(),t=e.obj[e.prop];if(Je(t)){for(var r=[],a=0;a<t.length;++a)t[a]!==void 0&&r.push(t[a]);e.obj[e.prop]=r}}},yn=function(n,e){for(var t=e&&e.plainObjects?Object.create(null):{},r=0;r<n.length;++r)n[r]!==void 0&&(t[r]=n[r]);return t},fi=function n(e,t,r){if(!t)return e;if(typeof t!="object"){if(Je(e))e.push(t);else{if(!e||typeof e!="object")return[e,t];(r&&(r.plainObjects||r.allowPrototypes)||!pr.call(Object.prototype,t))&&(e[t]=!0)}return e}if(!e||typeof e!="object")return[e].concat(t);var a=e;return Je(e)&&!Je(t)&&(a=yn(e,r)),Je(e)&&Je(t)?(t.forEach(function(i,l){if(pr.call(e,l)){var s=e[l];s&&typeof s=="object"&&i&&typeof i=="object"?e[l]=n(s,i,r):e.push(i)}else e[l]=i}),e):Object.keys(t).reduce(function(i,l){var s=t[l];return pr.call(i,l)?i[l]=n(i[l],s,r):i[l]=s,i},a)},hi=function(n,e){return Object.keys(e).reduce(function(t,r){return t[r]=e[r],t},n)},mi=function(n,e,t){var r=n.replace(/\\+/g," ");if(t==="iso-8859-1")return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch{return r}},gi=function(n,e,t,r,a){if(n.length===0)return n;var i=n;if(typeof n=="symbol"?i=Symbol.prototype.toString.call(n):typeof n!="string"&&(i=String(n)),t==="iso-8859-1")return escape(i).replace(/%u[0-9a-f]{4}/gi,function(o){return"%26%23"+parseInt(o.slice(2),16)+"%3B"});for(var l="",s=0;s<i.length;++s){var u=i.charCodeAt(s);if(u===45||u===46||u===95||u===126||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||a===Ue.RFC1738&&(u===40||u===41)){l+=i.charAt(s);continue}if(u<128){l+=Te[u];continue}if(u<2048){l+=Te[192|u>>6]+Te[128|63&u];continue}if(u<55296||u>=57344){l+=Te[224|u>>12]+Te[128|u>>6&63]+Te[128|63&u];continue}s+=1,l+=Te[240|(u=65536+((1023&u)<<10|1023&i.charCodeAt(s)))>>18]+Te[128|u>>12&63]+Te[128|u>>6&63]+Te[128|63&u]}return l},yi=function(n){for(var e=[{obj:{o:n},prop:"o"}],t=[],r=0;r<e.length;++r)for(var a=e[r],i=a.obj[a.prop],l=Object.keys(i),s=0;s<l.length;++s){var u=l[s],o=i[u];typeof o=="object"&&o!==null&&t.indexOf(o)===-1&&(e.push({obj:i,prop:u}),t.push(o))}return di(e),n},_i=function(n){return Object.prototype.toString.call(n)==="[object RegExp]"},bi=function(n){return!!n&&typeof n=="object"&&!!(n.constructor&&n.constructor.isBuffer&&n.constructor.isBuffer(n))},vi=function(n,e){return[].concat(n,e)},wi=function(n,e){if(Je(n)){for(var t=[],r=0;r<n.length;r+=1)t.push(e(n[r]));return t}return e(n)};Ee={arrayToObject:yn,assign:hi,combine:vi,compact:yi,decode:mi,encode:gi,isBuffer:bi,isRegExp:_i,maybeMap:wi,merge:fi};var $i=Object.prototype.hasOwnProperty,_n={brackets:function(n){return n+"[]"},comma:"comma",indices:function(n,e){return n+"["+e+"]"},repeat:function(n){return n}},Re=Array.isArray,Si=Array.prototype.push,bn=function(n,e){Si.apply(n,Re(e)?e:[e])},xi=Date.prototype.toISOString,vn=Ue.default,_e={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Ee.encode,encodeValuesOnly:!1,format:vn,formatter:Ue.formatters[vn],indices:!1,serializeDate:function(n){return xi.call(n)},skipNulls:!1,strictNullHandling:!1},Ei=function(n){return typeof n=="string"||typeof n=="number"||typeof n=="boolean"||typeof n=="symbol"||typeof n=="bigint"},dr={},ki=function n(e,t,r,a,i,l,s,u,o,p,m,d,y,f,S,v){for(var w,g=e,_=v,$=0,x=!1;(_=_.get(dr))!==void 0&&!x;){var T=_.get(e);if($+=1,T!==void 0){if(T===$)throw RangeError("Cyclic object value");x=!0}_.get(dr)===void 0&&($=0)}if(typeof u=="function"?g=u(t,g):g instanceof Date?g=m(g):r==="comma"&&Re(g)&&(g=Ee.maybeMap(g,function(X){return X instanceof Date?m(X):X})),g===null){if(i)return s&&!f?s(t,_e.encoder,S,"key",d):t;g=""}if(Ei(g)||Ee.isBuffer(g))return s?[y(f?t:s(t,_e.encoder,S,"key",d))+"="+y(s(g,_e.encoder,S,"value",d))]:[y(t)+"="+y(String(g))];var P=[];if(g===void 0)return P;if(r==="comma"&&Re(g))f&&s&&(g=Ee.maybeMap(g,s)),w=[{value:g.length>0?g.join(",")||null:void 0}];else if(Re(u))w=u;else{var D=Object.keys(g);w=o?D.sort(o):D}for(var R=a&&Re(g)&&g.length===1?t+"[]":t,I=0;I<w.length;++I){var F=w[I],C=typeof F=="object"&&F.value!==void 0?F.value:g[F];if(!l||C!==null){var B=Re(g)?typeof r=="function"?r(R,F):R:R+(p?"."+F:"["+F+"]");v.set(e,$);var V=Jt();V.set(dr,v),bn(P,n(C,B,r,a,i,l,r==="comma"&&f&&Re(g)?null:s,u,o,p,m,d,y,f,S,V))}}return P},Ai=function(n){if(!n)return _e;if(n.encoder!==null&&n.encoder!==void 0&&typeof n.encoder!="function")throw TypeError("Encoder has to be a function.");var e=n.charset||_e.charset;if(n.charset!==void 0&&n.charset!=="utf-8"&&n.charset!=="iso-8859-1")throw TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=Ue.default;if(n.format!==void 0){if(!$i.call(Ue.formatters,n.format))throw TypeError("Unknown format option provided.");t=n.format}var r=Ue.formatters[t],a=_e.filter;return(typeof n.filter=="function"||Re(n.filter))&&(a=n.filter),{addQueryPrefix:typeof n.addQueryPrefix=="boolean"?n.addQueryPrefix:_e.addQueryPrefix,allowDots:n.allowDots===void 0?_e.allowDots:!!n.allowDots,charset:e,charsetSentinel:typeof n.charsetSentinel=="boolean"?n.charsetSentinel:_e.charsetSentinel,delimiter:n.delimiter===void 0?_e.delimiter:n.delimiter,encode:typeof n.encode=="boolean"?n.encode:_e.encode,encoder:typeof n.encoder=="function"?n.encoder:_e.encoder,encodeValuesOnly:typeof n.encodeValuesOnly=="boolean"?n.encodeValuesOnly:_e.encodeValuesOnly,filter:a,format:t,formatter:r,serializeDate:typeof n.serializeDate=="function"?n.serializeDate:_e.serializeDate,skipNulls:typeof n.skipNulls=="boolean"?n.skipNulls:_e.skipNulls,sort:typeof n.sort=="function"?n.sort:null,strictNullHandling:typeof n.strictNullHandling=="boolean"?n.strictNullHandling:_e.strictNullHandling}};Hr=function(n,e){var t,r,a=n,i=Ai(e);typeof i.filter=="function"?a=i.filter("",a):Re(i.filter)&&(t=i.filter);var l=[];if(typeof a!="object"||a===null)return"";r=e&&e.arrayFormat in _n?e.arrayFormat:e&&"indices"in e?e.indices?"indices":"repeat":"indices";var s=_n[r];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw TypeError("\`commaRoundTrip\` must be a boolean, or absent");var u=s==="comma"&&e&&e.commaRoundTrip;t||(t=Object.keys(a)),i.sort&&t.sort(i.sort);for(var o=Jt(),p=0;p<t.length;++p){var m=t[p];i.skipNulls&&a[m]===null||bn(l,ki(a[m],m,s,u,i.strictNullHandling,i.skipNulls,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.format,i.formatter,i.encodeValuesOnly,i.charset,o))}var d=l.join(i.delimiter),y=i.addQueryPrefix===!0?"?":"";return i.charsetSentinel&&(i.charset==="iso-8859-1"?y+="utf8=%26%2310003%3B&":y+="utf8=%E2%9C%93&"),d.length>0?y+d:""};var wn={},fr=Object.prototype.hasOwnProperty,Ii=Array.isArray,de={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Ee.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Oi=function(n){return n.replace(/&#(\\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},$n=function(n,e){return n&&typeof n=="string"&&e.comma&&n.indexOf(",")>-1?n.split(","):n},ji="utf8=%26%2310003%3B",Ti="utf8=%E2%9C%93",Pi=function(n,e){var t={__proto__:null},r=e.ignoreQueryPrefix?n.replace(/^\\?/,""):n,a=e.parameterLimit===1/0?void 0:e.parameterLimit,i=r.split(e.delimiter,a),l=-1,s=e.charset;if(e.charsetSentinel)for(u=0;u<i.length;++u)i[u].indexOf("utf8=")===0&&(i[u]===Ti?s="utf-8":i[u]===ji&&(s="iso-8859-1"),l=u,u=i.length);for(u=0;u<i.length;++u)if(u!==l){var u,o,p,m=i[u],d=m.indexOf("]="),y=d===-1?m.indexOf("="):d+1;y===-1?(o=e.decoder(m,de.decoder,s,"key"),p=e.strictNullHandling?null:""):(o=e.decoder(m.slice(0,y),de.decoder,s,"key"),p=Ee.maybeMap($n(m.slice(y+1),e),function(f){return e.decoder(f,de.decoder,s,"value")})),p&&e.interpretNumericEntities&&s==="iso-8859-1"&&(p=Oi(p)),m.indexOf("[]=")>-1&&(p=Ii(p)?[p]:p),fr.call(t,o)?t[o]=Ee.combine(t[o],p):t[o]=p}return t},Ci=function(n,e,t,r){for(var a=r?e:$n(e,t),i=n.length-1;i>=0;--i){var l,s=n[i];if(s==="[]"&&t.parseArrays)l=[].concat(a);else{l=t.plainObjects?Object.create(null):{};var u=s.charAt(0)==="["&&s.charAt(s.length-1)==="]"?s.slice(1,-1):s,o=parseInt(u,10);t.parseArrays||u!==""?!isNaN(o)&&s!==u&&String(o)===u&&o>=0&&t.parseArrays&&o<=t.arrayLimit?(l=[])[o]=a:u!=="__proto__"&&(l[u]=a):l={0:a}}a=l}return a},Ni=function(n,e,t,r){if(n){var a=t.allowDots?n.replace(/\\.([^.[]+)/g,"[$1]"):n,i=/(\\[[^[\\]]*])/,l=/(\\[[^[\\]]*])/g,s=t.depth>0&&i.exec(a),u=s?a.slice(0,s.index):a,o=[];if(u){if(!t.plainObjects&&fr.call(Object.prototype,u)&&!t.allowPrototypes)return;o.push(u)}for(var p=0;t.depth>0&&(s=l.exec(a))!==null&&p<t.depth;){if(p+=1,!t.plainObjects&&fr.call(Object.prototype,s[1].slice(1,-1))&&!t.allowPrototypes)return;o.push(s[1])}return s&&o.push("["+a.slice(s.index)+"]"),Ci(o,e,t,r)}},Mi=function(n){if(!n)return de;if(n.decoder!==null&&n.decoder!==void 0&&typeof n.decoder!="function")throw TypeError("Decoder has to be a function.");if(n.charset!==void 0&&n.charset!=="utf-8"&&n.charset!=="iso-8859-1")throw TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e=n.charset===void 0?de.charset:n.charset;return{allowDots:n.allowDots===void 0?de.allowDots:!!n.allowDots,allowPrototypes:typeof n.allowPrototypes=="boolean"?n.allowPrototypes:de.allowPrototypes,allowSparse:typeof n.allowSparse=="boolean"?n.allowSparse:de.allowSparse,arrayLimit:typeof n.arrayLimit=="number"?n.arrayLimit:de.arrayLimit,charset:e,charsetSentinel:typeof n.charsetSentinel=="boolean"?n.charsetSentinel:de.charsetSentinel,comma:typeof n.comma=="boolean"?n.comma:de.comma,decoder:typeof n.decoder=="function"?n.decoder:de.decoder,delimiter:typeof n.delimiter=="string"||Ee.isRegExp(n.delimiter)?n.delimiter:de.delimiter,depth:typeof n.depth=="number"||n.depth===!1?+n.depth:de.depth,ignoreQueryPrefix:n.ignoreQueryPrefix===!0,interpretNumericEntities:typeof n.interpretNumericEntities=="boolean"?n.interpretNumericEntities:de.interpretNumericEntities,parameterLimit:typeof n.parameterLimit=="number"?n.parameterLimit:de.parameterLimit,parseArrays:n.parseArrays!==!1,plainObjects:typeof n.plainObjects=="boolean"?n.plainObjects:de.plainObjects,strictNullHandling:typeof n.strictNullHandling=="boolean"?n.strictNullHandling:de.strictNullHandling}};wn=function(n,e){var t=Mi(e);if(n===""||n==null)return t.plainObjects?Object.create(null):{};for(var r=typeof n=="string"?Pi(n,t):n,a=t.plainObjects?Object.create(null):{},i=Object.keys(r),l=0;l<i.length;++l){var s=i[l],u=Ni(s,r[s],t,typeof n=="string");a=Ee.merge(a,u,t)}return t.allowSparse===!0?a:Ee.compact(a)},kt={formats:Ue,parse:wn,stringify:Hr};class Ri{constructor(e){this.root=e,this.requestPromises=[]}init(e){this.getToken=e}async get(e){let t=await this.getToken(),r=this.getHashCode(e);if(this.requestPromises[r])return this.requestPromises[r].promise;let a=new Promise((i,l)=>{let s;e.externalResource?s=e.url:(s=this.root+e.url,s=\`\${s}\${/\\?/.test(s)?"&":"?"}token=\${t}\${$a(e.params)}\`),G(gt).get(s,{validateStatus:function(u){return u<400}}).then(function(u){u.status!=200&&console.error(\`GUDHUB HTTP SERVICE: GET ERROR: \${u.status}\`,u),i(u.data)}).catch(function(u){console.error(\`GUDHUB HTTP SERVICE: GET ERROR: \${u.response.status}
@@ -95,8 +95,8 @@ Expecting `+te.join(", ")+", got '"+(this.terminals_[F]||F)+"'":Z="Parse error o
95
95
  const diff = compareItemsLists(items_list1, items_list2);
96
96
  self.postMessage({ diff });
97
97
  });`}function compiler(n,e,t,r,i){async function a(h,y,m){let v=null;if(h.type==="array"&&(Number(h.is_static)?v=new Array(await u(h.childs,y,m)):v=await s(h,y,m)),h.type==="object"&&(Number(h.current_item)?v=await l(h,y):v=await u(h.childs,y,m)),h.type==="property"&&(v=await o(h,y,m)),typeof h=="object"&&typeof h.type>"u"){const p={};for(const E in h)if(h.hasOwnProperty(E)){const S=h[E],w=await a(S,y,m);p[E]=w[S.property_name]}return p}return{[h.property_name]:v}}async function s(h,y,m){const v=await t.gudhub.getApp(Number(h.app_id));let p=await d(h.filter,v.items_list,m,y);if(h.isSortable&&h.field_id_to_sort&&h.field_id_to_sort!==""){let S=p.flatMap(g=>{let b=g.fields.find(A=>A.field_id==h.field_id_to_sort);return!b||b.field_value==""?[]:g}),w=p.filter(g=>{if(!S.includes(g))return g});S=S.sort((g,b)=>h.sortType=="desc"?b.fields.find(A=>A.field_id==h.field_id_to_sort).field_value-g.fields.find(A=>A.field_id==h.field_id_to_sort).field_value:g.fields.find(A=>A.field_id==h.field_id_to_sort).field_value-b.fields.find(A=>A.field_id==h.field_id_to_sort).field_value),p=[...S,...w]}if(h.offset){let S;h.use_variables_for_limit_and_offset&&r?S=r[h.offset]:S=/^[0-9]+$/.test(h.offset)?h.offset:0,p=p.slice(S)}if(h.limit){let S;h.use_variables_for_limit_and_offset&&r?S=r[h.limit]:S=/^[0-9]+$/.test(h.limit)||0,S!==0&&(p=p.slice(0,S))}const E=p.map(async S=>u(h.childs,S,v.app_id));return Promise.all(E)}async function l(h,y){const m=await t.gudhub.getApp(h.app_id),v=m.items_list||[];return u(h.childs,y||v[0],m.app_id)}async function u(h,y,m){const v=await h.map(async E=>a(E,y,m));return(await Promise.all(v)).reduce((E,S)=>_objectSpread2(_objectSpread2({},E),S),{})}async function o(h,y,m){switch(h.property_type){case"static":return h.static_field_value;case"variable":switch(h.variable_type){case"app_id":return m;case"current_item":default:return"".concat(m,".").concat(y.item_id)}case"field_id":return h.field_id;case"function":return typeof h.function=="function"?h.function(y,m,t.gudhub,...h.args):await new Function("item, appId, gudhub","return (async "+h.function+")(item, appId, gudhub)")(y,m,t.gudhub);case"field_value":default:return!h.field_id&&h.name_space&&(h.field_id=await t.gudhub.getFieldIdByNameSpace(m,h.name_space)),Number(h.interpretation)?await t.gudhub.getInterpretationById(Number(m),Number(y.item_id),Number(h.field_id),"value"):await t.gudhub.getFieldValue(Number(m),Number(y.item_id),Number(h.field_id))}}async function f(h,y,m,v,p){const E=await t.gudhub.prefilter(JSON.parse(JSON.stringify(h)),_objectSpread2({element_app_id:y,app_id:m,item_id:v},r));return t.gudhub.filter(p,[...E,...h])}async function d(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",v=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return h.length?f(h,m,m,v.item_id,y):[...y]}return a(n,e,i)}class AppsTemplateService{constructor(e){this.gudhub=e,this.appsConnectingMap={apps:[],fields:[],items:[],views:[]}}createAppsFromTemplate(e,t,r,i){const a=this;return new Promise(s=>{const u=100/(e.apps.length*6);let o=0;a.createApps(e,f=>{o+=1,r&&r.call(this,{percent:o*u,status:f})},i).then(f=>{a.createItems(f,t,d=>{typeof d=="string"?(o+=1,r&&r.call(this,{percent:o*u,status:d})):typeof d=="object"&&(r&&r.call(this,{status:"Done",apps:d}),s())},i)})})}createItems(e,t,r,i){return new Promise(async a=>{const s=t||1e5,l=this;let u=[],o=[];const{accesstoken:f}=await l.gudhub.req.axiosRequest({method:"POST",url:"https://gudhub.com/GudHub_Test/auth/login",form:{auth_key:"3HMOtCbC0M/1/1e4y4Uxo/Kh/aFN4V5LG2//5ixx7TZyiUfMb7IHAAHCj9PsLrOSDrZuuWkbX4BIX23f51H+eA=="}});e.forEach(d=>{o.push(new Promise(async h=>{let y;i?y=await l.gudhub.req.axiosRequest({url:"https://gudhub.com/GudHub_Test/api/app/get?token=".concat(f,"&app_id=").concat(l._searchOldAppId(d.app_id,l.appsConnectingMap.apps)),method:"GET"}):y=await l.gudhub.getApp(l._searchOldAppId(d.app_id,l.appsConnectingMap.apps)),r&&r.call(this,"GET APP: ".concat(y.app_name," (Items steps)"));let m=JSON.parse(JSON.stringify(y)),v=m.items_list.map(p=>({index_number:p.index_number,item_id:0,fields:[]})).filter((p,E)=>E<=s);l.gudhub.addNewItems(d.app_id,v).then(p=>{r&&r.call(this,"ADD NEW ITEMS: ".concat(y.app_name," (Items steps)")),d.items_list=p,l._updateMap(d.items_list,m.items_list),l._addFieldValue(m.items_list,d.items_list,l.appsConnectingMap),u.push(d),h()})}))}),Promise.all(o).then(()=>{u.forEach(d=>{d.items_list.forEach(h=>{h.fields.forEach(y=>{l.appsConnectingMap.fields.forEach(m=>{y.field_id===m.old_field_id&&(y.field_id=m.new_field_id,y.element_id=m.new_field_id)})})})}),l.deleteField(u),l.replaceValue(u,l.appsConnectingMap).then(()=>{const d=[];u.forEach(h=>{d.push(new Promise(y=>{let m=h.items_list.map(v=>(v.fields.forEach(p=>{delete p.data_id}),v));l.gudhub.updateItems(h.app_id,m).then(()=>{r&&r.call(this,"REPLACE VALUE: ".concat(h.app_name," (Items steps)")),y()})}))}),Promise.all(d).then(()=>{r.call(this,u),a()})})})})}deleteField(e){e.forEach(t=>{t.items_list.forEach(r=>{r.fields=r.fields.filter(i=>t.field_list.findIndex(a=>a.field_id==i.field_id)>-1)})})}replaceValue(e,t){return new Promise(async r=>{const i=[],a=this;e.forEach(s=>{s.field_list.forEach(l=>{l.data_type==="item_ref"&&a._replaceValueItemRef(s,l,t),i.push(new Promise(u=>{a.gudhub.ghconstructor.getInstance(l.data_type).then(o=>{if(typeof o>"u"){console.log("ERROR WHILE GETTING INSTANCE OF ",l.data_type),u({type:l.data_type});return}if(o.getTemplate().constructor=="file")return a.gudhub.util.fileInstallerHelper(s.app_id,s.items_list,l.field_id).then(f=>{u(f)});o.getTemplate().constructor=="document"?a.documentInstallerHelper(s.app_id,s.items_list,l.field_id).then(f=>{u(o)}):u(o)})}))})}),i.length>0?Promise.all(i).then(s=>{r(s)}):r(result)})}documentInstallerHelper(e,t,r){const i=this,a=[];return new Promise(async s=>{for(const l of t){const u=l.item_id,o=l.fields.find(f=>f.element_id===r);if(o&&o.field_value&&o.field_value.length>0){const f=await i.gudhub.getDocument({_id:o.field_value});if(f&&f.data){const d=await i.gudhub.createDocument({app_id:e,item_id:u,element_id:r,data:f.data});o.field_value=d._id,a.push(l)}}}s(a)})}_replaceValueItemRef(e,t,r){e.items_list.forEach(i=>{i.fields.forEach(a=>{if(a.field_id===t.field_id&&a.field_value){let s=a.field_value.split(",");s.forEach((l,u)=>{let o=l.split(".");r.apps.forEach(f=>{o[0]==f.old_app_id&&(o[0]=f.new_app_id)}),r.items.forEach(f=>{o[1]==f.old_item_id&&(o[1]=f.new_item_id)}),s[u]=o.join(".")}),a.field_value=s.join(",")}})})}_addFieldValue(e,t,r){t.forEach(i=>{r.items.forEach(a=>{i.item_id===a.new_item_id&&e.forEach(s=>{a.old_item_id===s.item_id&&(i.fields=s.fields)})})})}_updateMap(e,t){t.forEach(r=>{e.forEach(i=>{r.index_number===i.index_number&&this.appsConnectingMap.items.push({old_item_id:r.item_id,new_item_id:i.item_id})})})}_searchOldAppId(e,t){let r=0;return t.forEach(i=>{i.new_app_id===e&&(r=i.old_app_id)}),r}createApps(e,t,r){const i=this;let a={step_size:100/(e.apps.length*3),apps:[]};return new Promise(async s=>{let l={},u=[],o=[];const{accesstoken:f}=await i.gudhub.req.axiosRequest({method:"POST",url:"https://gudhub.com/GudHub_Test/auth/login",form:{auth_key:"3HMOtCbC0M/1/1e4y4Uxo/Kh/aFN4V5LG2//5ixx7TZyiUfMb7IHAAHCj9PsLrOSDrZuuWkbX4BIX23f51H+eA=="}});for(const d of e.apps){let h;r?h=await i.gudhub.req.axiosRequest({url:"https://gudhub.com/GudHub_Test/api/app/get?token=".concat(f,"&app_id=").concat(d),method:"GET"}):h=await i.gudhub.getApp(d),t&&t.call(this,"GET APP: ".concat(h.app_name," (App steps)"));let y=JSON.parse(JSON.stringify(h));l[y.app_id]=y,a.apps.push(y.icon);let m=i.prepareAppTemplate(y);m.app_name=m.app_name+" New",m.privacy=1,e.data_to_change&&(e.data_to_change.name&&(m.app_name=e.data_to_change.name),e.data_to_change.icon&&(m.icon=e.data_to_change.icon)),i.resetViewsIds(m),i.gudhub.createNewApp(m).then(v=>{t&&t.call(this,"CREATE NEW APP: ".concat(h.app_name," (App steps)")),u.push(v),i.mapApp(y,v,i.appsConnectingMap),e.apps.length==u.length&&(i.connectApps(u,i.appsConnectingMap,l),u.forEach(p=>{i.gudhub.updateApp(p).then(E=>{t&&t.call(this,"UPDATE APP: ".concat(h.app_name," (App steps)")),o.push(E),e.apps.length==o.length&&s(o)})}))})}})}mapApp(e,t,r){r.apps.push({old_app_id:e.app_id,new_app_id:t.app_id,old_view_init:e.view_init,new_view_init:t.view_init}),e.field_list.forEach(i=>{t.field_list.forEach(a=>{i.name_space==a.name_space&&r.fields.push({name_space:i.name_space,old_field_id:i.field_id,new_field_id:a.field_id})})}),e.views_list.forEach(i=>{t.views_list.forEach(a=>{i.name==a.name&&r.views.push({name:i.name,old_view_id:i.view_id,new_view_id:a.view_id})})})}crawling(e,t){let r=e===null?[]:Object.keys(e);const i=this;r.length>0&&r.forEach(a=>{let s=e[a];typeof s<"u"&&typeof e!="string"&&(t(a,s,e),i.crawling(s,t))})}resetViewsIds(e){e.view_init=0,this.crawling(e.views_list,function(t,r,i){(t=="view_id"||t=="container_id")&&(i[t]=0)})}connectApps(e,t,r){const i=this;return e.forEach(a=>{t.apps.forEach(s=>{a.view_init===s.new_view_init&&t.views.forEach(l=>{s.old_view_init===l.old_view_id&&(a.view_init=l.new_view_id)})}),i.crawling(a.field_list,function(s,l,u){if(s.indexOf("field_id")!==-1||s.indexOf("FieldId")!==-1||s.indexOf("destination_field")!==-1){let o=String(l).split(","),f=[];t.fields.forEach(d=>{o.forEach(h=>{h==d.old_field_id&&f.push(d.new_field_id)})}),f.length&&(u[s]=f.join(","))}if((s.indexOf("app_id")!=-1||s.indexOf("AppId")!=-1||s.indexOf("destination_app")!=-1)&&t.apps.forEach(o=>{l==o.old_app_id&&(u[s]=o.new_app_id)}),s.indexOf("view_id")!==-1&&t.views.forEach(o=>{l==o.old_view_id&&(u[s]=o.new_view_id)}),s.indexOf("src")!==-1&&isFinite(l)){const o="container_id",f=t.apps.find(h=>h.new_app_id===a.app_id).old_app_id,d=i.findPath(r[f].views_list,o,l);u[s]="".concat(i.getValueByPath(a.views_list,d,o))}if(s.indexOf("trigger")!==-1&&l.model&&l.model.nodes){const o=l.model.nodes,f=["inputs","outputs"];for(const d in o)f.forEach(h=>{const y=o[d];Object.keys(y[h]).filter(v=>v!==""&&!isNaN(v)).forEach(v=>{const p=t.fields.filter(E=>E.old_field_id==v);if(p.length!==0&&p[0].new_field_id){const E=p[0].new_field_id.toString(),S=y[h][v];S.connections.forEach(w=>{w.input==v&&(w.input=E),w.output==v&&(w.output=E)}),delete y[h][v],y[h][E]=S}})})}})}),e}getValueByPath(e,t,r){let i=e;return t.split(".").forEach(a=>{i=i[a]}),i[r]}findPath(e,t,r){const i=this;let a=!1,s=!1,l=[];return i.crawling(e,function(u,o,f){s&&l.reverse().forEach(d=>{s&&(d.delete=!0,d.parent===f&&(s=!1,l=l.filter(h=>!h.delete),l.reverse()))}),a||(typeof f[u]=="object"&&l.push({prop:u,parent:f}),o==r&&t===u?a=!0:Object.keys(f).pop()===u&&typeof f[u]!="object"&&(s=!0))}),l.map(u=>u.prop).join(".")}prepareAppTemplate(e){const t=this;let r=JSON.parse(JSON.stringify(e));return t.crawling(r.views_list,function(i,a,s){i=="element_id"&&(s.element_id=-Number(a),s.create_element=-Number(a))}),r.field_list.forEach(i=>{i.create_field=-Number(i.field_id),i.element_id=-Number(i.field_id),i.field_id=-Number(i.field_id),i.field_value=""}),r.items_list=[],delete r.app_id,delete r.icon.id,delete r.group_id,delete r.trash,delete r.last_update,delete r.file_list,r}}class FileHelper{constructor(e){this.gudhub=e}fileInstallerHelper(e,t,r){const i=this;return new Promise(a=>{const s=[[]];let l=Promise.resolve(),u=[];t.forEach(o=>{const f=o.item_id,d=o.fields.find(h=>h.element_id===r);d&&d.field_value&&d.field_value.split(".").forEach(y=>{const m={source:y,destination:{app_id:e,item_id:f,element_id:r}};s[s.length-1].length!==10?s[s.length-1].push(m):s.push([m])})}),s.forEach(o=>{l=l.then(()=>i.gudhub.duplicateFile(o)).then(f=>{u=[...u,...f]})}),l.then(()=>{t.forEach(o=>{const f=o.item_id,d=o.fields.find(h=>h.element_id===r);d&&d.field_value&&(d.field_value="",u.forEach(h=>{h.item_id===f&&(d.field_value=d.field_value.split(",").filter(y=>y).concat(h.file_id).join(","))}))}),a()})})}}function compareObjects(n,e){return JSON.stringify(n)===JSON.stringify(e)}async function dynamicPromiseAll(n){await Promise.all(n);let e=!0;for(const t of n){const r=await _checkPromiseStatus(t);if(r.state==="pending"){e=!1;break}if(r.state==="rejected")throw r.reason}return e?!0:dynamicPromiseAll(n)}function _checkPromiseStatus(n){const e={state:"pending"};return Promise.race([n,e]).then(t=>t===e?t:{state:"resolved",value:t},t=>({state:"rejected",reason:t}))}function sortItems(n,e){if(!n||!n.length)return[];if(!n[0].fields.length)return n;var t=e&&e.sort_field_id||n[0].fields[0].field_id;function r(i){for(var a=null,s=0;s<i.fields.length;s++)if(i.fields[s].field_id==t){a=i.fields[s].field_value;break}return a}return n.sort(function(i,a){var s=r(i),l=r(a);return s===null?-1:l===null?1:/^\d+$/.test(s)&&/^\d+$/.test(l)?Number(s)<Number(l)?-1:1:/^\d+$/.test(s)||/^\d+$/.test(l)?/^\d+$/.test(s)?-1:1:s.toLowerCase()>l.toLowerCase()?1:-1}),e&&e.descending?n.reverse():n}class Utils{constructor(e){this.gudhub=e,this.MergeFields=new FieldsOperator(e),this.ItemsSelection=new ItemsSelection(e),this.AppsTemplateService=new AppsTemplateService(e),this.FileHelper=new FileHelper(e)}prefilter(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return filterPreparation(e,this.gudhub.storage,this.gudhub.pipeService,t)}filter(e,t){return filter(e,t)}mergeFilters(e,t){return mergeFilters(e,t)}group(e,t){return group(e,t)}async getFilteredItems(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:"",l=arguments.length>6?arguments[6]:void 0,u=arguments.length>7?arguments[7]:void 0;const o=await this.prefilter(t,{element_app_id:r,app_id:i,item_id:a}),f=this.filter(e,o);return this.group(s,f).filter(h=>l?searchValue([h],l).length===1:!0).filter(h=>u?searchValue([h],u).length===1:!0)}jsonToItems(e,t){return jsonToItems(e,t)}getDate(e){return getDate(e)}checkRecurringDate(e,t){return checkRecurringDate(e,t)}populateItems(e,t,r){return populateItems(e,t,r)}populateWithDate(e,t){return populateWithDate(e,t)}populateWithItemRef(e,t,r,i,a,s){return populateWithItemRef(e,t,r,i,a,s)}compareItems(e,t,r){return compareItems(e,t,r)}mergeItems(e,t,r){return mergeItems(e,t,r)}mergeObjects(e,t,r){return mergeObjects(e,t,r)}makeNestedList(e,t,r,i,a){return makeNestedList(e,t,r,i,a)}async mergeChunks(e){return mergeChunks(e)}mergeFieldLists(e,t){return this.MergeFields.mergeFieldLists(e,t)}createFieldsListToView(e,t){return this.MergeFields.createFieldsListToView(e,t)}createFieldsListToViewWithDataType(e,t){return this.MergeFields.createFieldsListToViewWithDataType(e,t)}selectItems(e,t){return this.ItemsSelection.selectItems(e,t)}getSelectedItems(e){return this.ItemsSelection.getSelectedItems(e)}clearSelectedItems(e){return this.ItemsSelection.clearSelectedItems(e)}isItemSelected(e,t){return this.ItemsSelection.isItemSelected(e,t)}jsonConstructor(e,t,r,i){return compiler(e,t,this,r,i)}fileInstallerHelper(e,t,r){return this.FileHelper.fileInstallerHelper(e,t,r)}createAppsFromTemplate(e,t,r,i){return this.AppsTemplateService.createAppsFromTemplate(e,t,r,i)}createApps(e){return this.AppsTemplateService.createApps(e)}createItems(e,t){return this.AppsTemplateService.createItems(e,t)}areViewListsEqual(e,t){let r=e.sort((a,s)=>a.view_id-s.view_id),i=t.sort((a,s)=>a.view_id-s.view_id);return this.compareObjects(r,i)}areFieldListsEqual(e,t){let r=e.sort((a,s)=>a.field_id-s.field_id),i=t.sort((a,s)=>a.field_id-s.field_id);return this.compareObjects(r,i)}compareObjects(e,t){return compareObjects(e,t)}compareAppsItemsLists(e,t,r){const i=new Blob([compare_items_lists_Worker()],{type:"application/javascript"});this.worker=new Worker(URL.createObjectURL(i)),this.worker.postMessage({items_list1:e,items_list2:t}),this.worker.addEventListener("message",a=>{const{diff:s}=a.data;r(s)})}dynamicPromiseAll(e){return dynamicPromiseAll(e)}sortItems(e,t){return sortItems(e,t)}debounce(e,t){let r;return function(){for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];clearTimeout(r),r=setTimeout(()=>{e.apply(this,a)},t)}}}class Auth{constructor(e,t){this.req=e,this.storage=t}async login(){let{username:e,password:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const r=await this.loginApi(e,t);return this.storage.updateUser(r),r}async loginWithToken(e){const t=await this.loginWithTokenApi(e);return this.storage.updateUser(t),t}async logout(e){return await this.logoutApi(e)}async signup(e){return await this.signupApi(e)}async updateToken(e){return await this.updateTokenApi(e)}async updateUser(e){const t=await this.updateUserApi(e);return this.storage.updateUser(t),t}async updateAvatar(e){const t=await this.avatarUploadApi(e);return this.storage.updateUser(t),t}async getUsersList(e){return await this.getUsersListApi(e)}async loginApi(e,t){try{return await this.req.axiosRequest({method:"POST",url:"".concat(this.req.root,"/auth/login"),form:{username:e,password:t}})}catch(r){console.log(r)}}async loginWithTokenApi(e){try{return await this.req.axiosRequest({method:"POST",url:"".concat(this.req.root,"/auth/login?accesstoken=").concat(e)})}catch(t){console.log(t)}}async updateTokenApi(e){try{return await this.req.axiosRequest({method:"POST",url:"".concat(this.req.root,"/auth/login"),form:{auth_key:e}})}catch(t){console.log(t)}}logoutApi(e){return this.req.post({url:"/auth/logout",form:{token:e}})}signupApi(e){return this.req.axiosRequest({method:"POST",url:"".concat(this.req.root,"/auth/singup"),form:{user:JSON.stringify(e)}})}getUsersListApi(e){return this.req.get({url:"/auth/userlist",params:{keyword:e}})}updateUserApi(e){return this.req.post({url:"/auth/updateuser",form:{user:JSON.stringify(e)}})}avatarUploadApi(e){return this.req.post({url:"/auth/avatar-upload",form:{image:e}})}getUserByIdApi(e){return this.req.get({url:"/auth/getuserbyid",params:{id:e}})}getVersion(){return this.req.get({url:"/version"})}getUserFromStorage(e){return this.storage.getUsersList().find(t=>t.user_id==e)}saveUserToStorage(e){const t=this.storage.getUsersList(),r=t.find(i=>i.user_id==e.user_id);return r||(t.push(e),e)}async getUserById(e){let t=this.getUserFromStorage(e);if(!t){let r=await this.getUserByIdApi(e);if(!r)return null;t=this.getUserFromStorage(e),t||(this.saveUserToStorage(r),t=r)}return t}async getToken(){const e=new Date(this.storage.getUser().expirydate),t=new Date;let r=this.storage.getUser().accesstoken;if(e<t||!r){const i=await this.updateToken(this.storage.getUser().auth_key);this.storage.updateUser(i),r=i.accesstoken}return r}}let $q={when:function(n){return new Promise(e=>{e(n)})}},factoryReturns={};class AngularClass{module(){return angular}directive(){return angular}factory(e,t){try{typeof t=="object"?factoryReturns[e]=t[t.length-1]($q):factoryReturns[e]=t($q)}catch(r){console.log("Errror in data type: ",e),console.log(r)}return angular}service(){return angular}run(){return angular}filter(){return angular}controller(){return angular}value(){return angular}element(){return angular}injector(){return angular}invoke(){return angular}}let angular=new AngularClass;async function createAngularModuleInstance(gudhub,module_id,module_url,angularInjector,nodeWindow){try{let angularModule,importedClass;if(IS_BROWSER_MAIN_THREAD)if(window.angular){angularInjector.has(module_id)||await angularInjector.get("$ocLazyLoad").load(module_url),angularModule=await angularInjector.get(module_id);let module=await axios.get(module_url);module=module.data;try{eval(module)}catch(n){console.error("ERROR WHILE EVAL() IN GHCONSTRUCTOR. MODULE ID: ".concat(module_id)),console.log(n)}importedClass=factoryReturns[module_id]}else{let module=await axios.get(module_url);module=module.data;try{eval(module)}catch(n){console.log("Error while importing module: ".concat(module_id)),console.log(n)}importedClass=factoryReturns[module_id]}else{const n=new Proxy(nodeWindow,{get:(a,s)=>a[s],set:(a,s,l)=>(a[s]=l,global[s]=l,!0)});global.hasOwnProperty("window")||(global.window=n,global.document=nodeWindow.document,global.Element=nodeWindow.Element,global.CharacterData=nodeWindow.CharacterData,global.this=n,global.self=n,global.Blob=nodeWindow.Blob,global.Node=nodeWindow.Node,global.navigator=nodeWindow.navigator,global.HTMLElement=nodeWindow.HTMLElement,global.XMLHttpRequest=nodeWindow.XMLHttpRequest,global.WebSocket=nodeWindow.WebSocket,global.crypto=nodeWindow.crypto,global.DOMParser=nodeWindow.DOMParser,global.Symbol=nodeWindow.Symbol,global.document.queryCommandSupported=a=>!1,global.angular=angular);let t=(await axios.get(module_url)).data,r=encodeURIComponent(t);r="data:text/javascript;charset=utf-8,"+r;let i;try{i=await import(r)}catch(a){console.log("Error while importing module: ".concat(module_id)),console.log(a)}importedClass=new i.default}let result={type:module_id,getTemplate:function(n,e,t,r,i,a){let s=t!=="false";return importedClass.getTemplate(n,e,s,r,i,a)},getDefaultValue:function(n,e,t,r){return new Promise(async i=>{let a=importedClass.getDefaultValue;if(a){let s=await a(n,e,t,r);i(s)}else i(null)})},getSettings:function(n,e,t){return importedClass.getSettings(n,e,t)},filter:{getSearchOptions:function(n){let e=importedClass;return e.filter&&e.filter.getSearchOptions?importedClass.filter.getSearchOptions(n)||null:[]},getDropdownValues:function(){let n=importedClass;return n.filter&&n.filter.getDropdownValues?n.filter.getDropdownValues()||null:[]}},getInterpretation:function(n,e,t,r,i,a){return new Promise(async s=>{let l=importedClass;try{let u=await l.getInterpretation(gudhub,n,a,i,r,t),f=await(u.find(d=>d.id==e)||u.find(d=>d.id=="default")).content();s({html:f})}catch(u){console.log("ERROR IN ".concat(module_id),u),s({html:"<span>no interpretation</span>"})}})},getInterpretationsList:function(n,e,t,r){return importedClass.getInterpretation(n,e,t,r)},getInterpretatedValue:function(n,e,t,r){return new Promise(async i=>{let a=importedClass.getInterpretatedValue;if(a){let s=await a(n,e,t,r);i(s)}else i(n)})},onMessage:function(n,e,t){return new Promise(async r=>{const i=importedClass.onMessage;if(i){const a=await i(n,e,t);r(a)}r(null)})}};return IS_BROWSER_MAIN_THREAD&&(result.extendController=function(n){angularModule.getActionScope(n)},result.runAction=function(n){try{angularModule.runAction(n)}catch{}},result.getWindowScope=function(n){return angularModule.getWindowScope(n)},result.getWindowHTML=function(n){return angularModule.getWindowHTML(n)}),result}catch(n){console.log(n),console.log("Failed in createAngularModuleInstance (ghconstructor). Module id: ".concat(module_id,"."))}}async function createClassInstance(n,e,t,r,i){try{t||console.error("JS link must be provided for this data type - ".concat(e));let s=await(f=>(IS_BROWSER_MAIN_THREAD||(global.window=proxy,global.document=i.document,global.Element=i.Element,global.CharacterData=i.CharacterData,global.this=proxy,global.self=proxy,global.Blob=i.Blob,global.Node=i.Node,global.navigator=i.navigator,global.HTMLElement=i.HTMLElement,global.XMLHttpRequest=i.XMLHttpRequest,global.WebSocket=i.WebSocket,global.crypto=i.crypto,global.DOMParser=i.DOMParser,global.Symbol=i.Symbol,global.document.queryCommandSupported=d=>(console.log("QUERY COMMAND SUPPORTED: ",d),!1),global.angular=angular),new Promise(async d=>{let h=await axios.get(f).catch(v=>{console.log("Failed to fetch: ".concat(f," in ghconstructor. Module id: ").concat(e))}),m="data:text/javascript;charset=utf-8,"+encodeURIComponent(h.data);d(m)})))(t),l;try{l=await import(s)}catch(f){console.log("Error while importing module: ".concat(e)),console.log(f)}let u=new l.default(e);if(r&&IS_BROWSER){const f=document.createElement("link");f.href=r,f.setAttribute("data-module",e),f.setAttribute("rel","stylesheet"),document.getElementsByTagName("head")[0].appendChild(f)}return{type:e,getTemplate:function(f,d,h,y,m,v){let p=h!=="false";return u.getTemplate(f,d,p,y,m,v)},getDefaultValue:function(f,d,h,y){return new Promise(async m=>{let v=u.getDefaultValue;if(v){let p=await v(f,d,h,y);m(p)}else m(null)})},getSettings:function(f,d,h){return u.getSettings(f,d,h)},filter:{getSearchOptions:function(f){let d=u;return d.filter&&d.filter.getSearchOptions?u.filter.getSearchOptions(f):[]},getDropdownValues:function(){let f=u;return f.filter&&f.filter.getDropdownValues?f.filter.getDropdownValues():[]}},getInterpretation:function(f,d,h,y,m,v){return new Promise(async p=>{let E=u;try{let S=await E.getInterpretation(n,f,v,m,y,h),g=await(S.find(b=>b.id==d)||S.find(b=>b.id=="default")).content();p({html:g})}catch(S){console.log("ERROR IN ".concat(e),S),p({html:"<span>no interpretation</span>"})}})},getInterpretationsList:function(f,d,h,y){return u.getInterpretation(f,d,h,y)},getInterpretatedValue:function(f,d,h,y){return new Promise(async m=>{let v=u.getInterpretatedValue;if(v){let p=await v(f,d,h,y);m(p)}else m(f)})},onMessage:function(f,d,h){return new Promise(async y=>{const m=u.onMessage;if(m){const v=await m(f,d,h);y(v)}y(null)})},extendController:function(f){u.getActionScope(f)},runAction:function(f){try{u.runAction(f)}catch{}},getWindowScope:function(f){return u.getWindowScope(f)},getWindowHTML:function(f){return u.getWindowHTML(f)}}}catch(a){console.log(a),console.log("Failed in createClassInstance (ghconstructor). Module id: ".concat(e,". JS url: ").concat(t))}}class GHConstructor{constructor(e){this.gudhub=e,this.cache={},this.modulesQueue={},this.angularInjector,this.nodeWindow}async getInstance(e){return this.getCached(e)?this.getCached(e):(this.modulesQueue[e]?await this.modulesQueue[e]:(this.modulesQueue[e]=this.createInstance(e),await this.modulesQueue[e]),this.getCached(e))}pupToCache(e,t){this.cache[e]=t}getCached(e){return this.cache[e]}initAngularInjector(e){this.angularInjector=e}initJsdomWindow(e){this.nodeWindow=e}async createInstance(e){let t=this.gudhub.storage.getModuleUrl(e);if(!t){console.log("Cannot find module: ".concat(e));return}let r;return t.type==="gh_element"&&(t.technology==="angular"?r=await createAngularModuleInstance(this.gudhub,e,t.url,this.angularInjector,this.nodeWindow):t.technology==="class"&&(r=await createClassInstance(this.gudhub,e,t.js,t.css,this.nodeWindow))),r&&this.pupToCache(e,r),r}}class AppProcessor{constructor(e,t,r,i,a,s,l){this.storage=e,this.pipeService=t,this.req=r,this.ws=i,this.applistReceived=!1,this.activateSW=s,this.util=a,this.appListeners(),this.dataService=l,this.appRequestCache=new Map}async createNewAppApi(e){try{const t=await this.req.post({url:"/api/app/create",form:{app:JSON.stringify(e)}});return t.from_apps_list=!0,t}catch(t){return console.log(t),null}}async updateAppApi(e){try{return await this.req.post({url:"/api/app/update",form:{app:JSON.stringify(e)}})}catch(t){return console.log(t),null}}async deleteAppApi(e){try{return await this.req.post({url:"/api/app/delete",form:{app_id:e}})}catch(t){return console.log(t),null}}async getAppListApi(){try{return(await this.req.get({url:"/api/applist/get"})).apps_list.map(t=>(t.from_apps_list=!0,t))}catch(e){return console.log(e),null}}getAppListFromStorage(){return this.storage.getAppsList()}getAppFromStorage(e){const t=this.storage.getApp(e);return t&&t.field_list.length?t:null}addNewAppToStorage(e){return this.storage.getAppsList().push(e)}saveAppInStorage(e){e.items_object={};for(let r=0;r<e.items_list.length;r++){e.items_object[e.items_list[r].item_id]={};for(let i=0;i<e.items_list[r].fields.length;i++)e.items_object[e.items_list[r].item_id][e.items_list[r].fields[i].field_id]=e.items_list[r].fields[i]}const t=this.storage.getApp(e.app_id);return t?(e.from_apps_list=t.from_apps_list,e.permission=t.permission,this.storage.updateApp(e)):(e.from_apps_list=!1,this.addNewAppToStorage(e)),this.getAppFromStorage(e.app_id)}updateAppFieldsAndViews(e){const t=this.getAppFromStorage(e.app_id);e.items_list=t.items_list,e.file_list=t.file_list,e.from_apps_list=t.from_apps_list,e.items_object=t.items_object,this.storage.updateApp(e),this.pipeService.emit("gh_app_views_update",{app_id:e.app_id},e.views_list),e.field_list.forEach(r=>{this.pipeService.emit("gh_model_update",{app_id:e.app_id,field_id:r.field_id},r)})}updateAppInStorage(e){this.storage.getApp(e.app_id)?(this.storage.updateApp(e),this.pipeService.emit("gh_app_update",{app_id:e.app_id},e),this.pipeService.emit("gh_items_update",{app_id:e.app_id},e.items_list)):this.addNewAppToStorage(e)}deletingAppFromStorage(e){let t=this.storage.getAppsList();return t.forEach((r,i)=>{r.app_id==e&&t.splice(i)}),t}updateAppsListInStorage(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];for(const t of e){const r=this.storage.getApp(t.app_id);r?(r.from_apps_list=t.from_apps_list,r.permission=t.permission):this.addNewAppToStorage(t)}}async refreshApps(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];for(const t of e)if(t!=null)try{const r=await this.dataService.getApp(t);if(r){r.items_object={};for(let i=0;i<r.items_list.length;i++){r.items_object[r.items_list[i].item_id]={};for(let a=0;a<r.items_list[i].fields.length;a++)r.items_object[r.items_list[i].item_id][r.items_list[i].fields[a].field_id]=r.items_list[i].fields[a]}this.updateAppInStorage(r),this.pipeService.emit("gh_app_views_update",{app_id:r.app_id},r.views_list)}}catch(r){console.log(r)}console.log("Apps refreshed: ",JSON.stringify(e))}async refreshAppsList(){let e=this.getAppListFromStorage(),r=(await this.getAppListApi()).map(i=>_objectSpread2(_objectSpread2({},i),e.find(a=>a.app_id===i.app_id)));this.updateAppsListInStorage(r),this.pipeService.emit("gh_apps_list_refreshed",{})}async getAppsList(){let e=this.getAppListFromStorage();if(!this.applistReceived){let t=await this.getAppListApi();if(!t)return null;this.updateAppsListInStorage(t),this.applistReceived=!0,e=t}return e}async getAppInfo(e){const t=await this.getAppsList();return t?t.find(r=>r.app_id==e):null}async deleteApp(e){return await this.deleteAppApi(e),this.deletingAppFromStorage(e)}async getApp(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!e)return null;let r=this.getAppFromStorage(e);if(r)return r;if(this.appRequestCache.has(e))return this.appRequestCache.get(e);let i=this,a=new Promise(async(s,l)=>{try{let u=await i.dataService.getApp(e);u||l();//!!! temporary check !!!! if app has chanks property then we start getting it
98
- let o=t?u:_objectSpread2(_objectSpread2({},u),{},{items_list:u.items_list.filter(f=>!f.trash)});o=t?o:_objectSpread2(_objectSpread2({},o),{},{field_list:o.field_list.filter(f=>!f.trash)}),s(o),i.saveAppInStorage(o),i.ws.addSubscription(e)}catch{l()}});return i.appRequestCache.set(e,a),a}async updateApp(e){if(!e.views_list||!e.views_list.length||!e.show){const r=await this.getApp(e.app_id);(!e.views_list||!e.views_list.length)&&(e.views_list=r.views_list),typeof e.show>"u"&&(e.show=r.show)}const t=await this.updateAppApi(e);return this.updateAppFieldsAndViews(t),t}async updateAppInfo(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.pipeService.emit("gh_app_info_update",{app_id:e.app_id},e),this.updateApp(e)}async createNewApp(e){const t=await this.createNewAppApi(e);return t.items_object={},this.addNewAppToStorage(t),t}async getAppViews(e){if(e)return(await this.getApp(e)).views_list}clearAppProcessor(){this.getAppListPromises=null,this.getAppPromises={},this.applistReceived=!1}appListeners(){this.pipeService.onRoot("gh_app_get",{},async(e,t)=>{if(t&&t.app_id){const r=await this.getApp(t.app_id);this.pipeService.emit("gh_app_get",t,r)}}),this.pipeService.onRoot("gh_apps_list_get",{},async(e,t)=>{const r=await this.getAppsList();this.pipeService.emit("gh_apps_list_get",t,r)}),this.pipeService.onRoot("gh_delete_app",{},async(e,t)=>{const r=await this.deleteApp(t.app_id);this.pipeService.emit("gh_apps_list_update",{recipient:"all"},r)}),this.pipeService.onRoot("gh_app_update",{},async(e,t)=>{t.app.items_list=[],t.app.file_list=[];const r=await this.updateApp(t.app);this.pipeService.emit("gh_app_views_update",{app_id:r.app_id},r.views_list);const i=await this.getAppsList();this.pipeService.emit("gh_apps_list_update",{recipient:"all"},i),r.field_list.forEach(a=>{this.pipeService.emit("gh_model_update",{app_id:r.app_id,field_id:a.field_id},a)})}),this.pipeService.onRoot("gh_app_view_get",{},async(e,t)=>{if(t&&t.app_id){const r=await this.getApp(t.app_id);r.views_list.forEach((i,a)=>{i.view_id==t.view_id&&this.pipeService.emit("gh_app_view_get",t,r.views_list[a])})}}),this.pipeService.onRoot("gh_app_info_get",{},async(e,t)=>{const r=await this.getAppInfo(t.app_id);r&&this.pipeService.emit("gh_app_info_get",t,r)}),this.pipeService.onRoot("gh_app_info_update",{},async(e,t)=>{if(t&&t.app){const r=await this.updateAppInfo(t.app);this.pipeService.emit("gh_app_info_update",{app_id:t.app.app_id},r)}}),this.pipeService.onRoot("gh_app_create",{},async(e,t)=>{await this.createNewApp(t.app);const r=await this.getAppsList();this.pipeService.emit("gh_apps_list_update",{recipient:"all"},r)}),IS_BROWSER_MAIN_THREAD&&this.activateSW&&navigator.serviceWorker.addEventListener("message",async e=>{if(e.data.type==="refresh app"){const t=await this.getApp(e.data.payload.app_id);t&&this.util.compareAppsItemsLists(t.items_list,e.data.payload.items_list.filter(r=>!r.trash),r=>{let{diff_fields_items:i,diff_fields_items_Ids:a,diff_items:s,newItems:l,deletedItems:u}=r;(s.length||l.length||u.length)&&(this.pipeService.emit("gh_items_update",{app_id:e.data.payload.app_id},e.data.payload.items_list.filter(o=>!o.trash)),s.forEach(o=>this.pipeService.emit("gh_item_update",{app_id:e.data.payload.app_id,item_id:o.item_id},o))),a.forEach(o=>{const f=i[o];f&&f.forEach(d=>{this.pipeService.emit("gh_value_update",{app_id:e.data.payload.app_id,item_id:o,field_id:d.field_id},d.field_value)})})}),e.data.payload.items_list=await this.util.mergeChunks([t,e.data.payload]),this.saveAppInStorage(e.data.payload)}})}}class ItemProcessor{constructor(e,t,r,i,a){this.storage=e,this.pipeService=t,this.req=r,this.appProcessor=i,this.util=a,this.itemListeners()}async addItemsApi(e,t){try{return await this.req.post({url:"/api/items/add",form:{items:JSON.stringify(t),app_id:e}})}catch(r){return console.log(r),null}}async updateItemsApi(e,t){try{return await this.req.post({url:"/api/items/update",form:{items:JSON.stringify(t),app_id:e}})}catch(r){return console.log(r),null}}deleteItemsApi(e){try{const t=this.req.post({url:"/api/items/delete",form:{items_ids:JSON.stringify(e)}});return t.from_apps_list=!0,t}catch(t){return console.log(t),null}}async addItemsToStorage(e,t){const r=await this.appProcessor.getApp(e);return r&&(t.forEach(i=>{r.items_list.push(i),r.items_object[i.item_id]={};for(let a=0;a<i.fields.length;a++)r.items_object[i.item_id][i.fields[a].field_id]=i.fields[a];this.pipeService.emit("gh_item_update",{app_id:e},[i])}),this.pipeService.emit("gh_items_update",{app_id:e},r.items_list),this.storage.updateApp(r)),r}async updateItemsInStorage(e,t){this.pipeService.emit("gh_items_update",{app_id:e},t);const r=await this.appProcessor.getApp(e);return r&&t&&t.forEach(i=>{const a={app_id:e};this.pipeService.emit("gh_item_update",a,[i]),a.item_id=i.item_id,this.pipeService.emit("gh_item_update",a,i);const s=r.items_list.find(l=>l.item_id==i.item_id);s&&i.fields.forEach(l=>{const u=s.fields.find(o=>o.field_id==l.field_id);a.field_id=l.field_id,u?u.field_value!=l.field_value&&(u.field_value=l.field_value,r.items_object[s.item_id][u.field_id]=u,this.pipeService.emit("gh_value_update",a,l.field_value)):(s.fields.push(l),r.items_object[s.item_id][l.field_id]=l,this.pipeService.emit("gh_value_update",a,l.field_value))})}),t}handleDiff(e,t){this.updateItemsInStorage(e,t.diff_src_items),this.addItemsToStorage(e,t.new_src_items),this.deleteItemsFromStorage(e,t.trash_src_items)}async deleteItemsFromStorage(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const r=await this.appProcessor.getApp(e);r&&(r.items_list=r.items_list.filter(i=>t.find(a=>i.item_id==a.item_id)?(delete r.items_object[i.item_id],!1):!0),this.pipeService.emit("gh_items_update",{app_id:e},r.items_list),this.storage.updateApp(r))}async getItems(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=await this.appProcessor.getApp(e,t);return r?r.items_list:null}async addNewItems(e,t){const r=t.map(a=>_objectSpread2(_objectSpread2({},a),{},{fields:filterFields(a.fields)})),i=await this.addItemsApi(e,r);return await this.addItemsToStorage(e,i),this.pipeService.emit("gh_items_add",{app_id:e},i),i}async updateItems(e,t){const r=t.map(a=>_objectSpread2(_objectSpread2({},a),{},{fields:filterFields(a.fields)})),i=await this.updateItemsApi(e,r);return await this.updateItemsInStorage(e,i)}async deleteItems(e,t){return this.deleteItemsApi(t).then(async r=>await this.deleteItemsFromStorage(e,r))}itemListeners(){this.pipeService.onRoot("gh_items_get",{},async(e,t)=>{if(t&&t.app_id){const r=await this.getItems(t.app_id);r?this.pipeService.emit("gh_items_get",t,r):this.pipeService.emit("gh_items_get",t,[])}}),this.pipeService.onRoot("gh_items_add",{},async(e,t)=>{if(t&&t.app_id&&t.items){const r=await this.addNewItems(t.app_id,t.items);r?this.pipeService.emit("gh_items_add",t,r):this.pipeService.emit("gh_items_add",t,[])}}),this.pipeService.onRoot("gh_items_update",{},async(e,t)=>{if(t&&t.app_id&&t.items){const r=await this.updateItems(t.app_id,t.items);r?this.pipeService.emit("gh_items_update",t,r):this.pipeService.emit("gh_items_update",t,[])}}),this.pipeService.onRoot("gh_item_get",{},async(e,t)=>{if(t&&t.app_id){const i=(await this.getItems(t.app_id)).find(a=>a.item_id==t.item_id);this.pipeService.emit("gh_item_get",t,i)}}),this.pipeService.onRoot("gh_filtered_items_get",{},async(e,t)=>{if(t&&t.element_app_id){const r=await this.getItems(t.element_app_id),i=await this.util.getFilteredItems(r,t.filters_list,t.element_app_id,t.app_id,t.item_id,t.field_groupe,t.search,t.search_params);this.pipeService.emit("gh_filtered_items_get",t,i)}}),this.pipeService.onRoot("gh_filter_items",{},async(e,t)=>{if(t&&t.items){const r=await this.util.getFilteredItems(t.items,t.filters_list,t.element_app_id,t.app_id,t.item_id,t.field_groupe,t.search,t.search_params);this.pipeService.emit("gh_filter_items",t,r)}})}}class FieldProcessor{constructor(e,t,r,i,a){this.storage=e,this.req=t,this.appProcessor=r,this.itemProcessor=i,this.pipeService=a,this.fieldListeners()}deleteFieldApi(e){return this.req.post({url:"/api/app/delete-field",form:{field_id:e}})}async updatedFieldApi(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=await this.appProcessor.getApp(e),i={app_id:e,app_name:r.app_name,group_id:r.group_id,icon:r.icon,field_list:r.field_list.map(a=>a.field_id==t.field_id?_objectSpread2(_objectSpread2({},a),t):a),views_list:r.views_list};return this.appProcessor.updateApp(i)}setFieldValueApi(e,t,r,i){const a=[{item_id:t,fields:[{field_id:r,field_value:i}]}];return this.itemProcessor.updateItems(e,a)}deleteFieldInStorage(e,t){const r=this.storage.getApp(e);return r.field_list=r.field_list.filter(i=>i.file_id!=t),r.items_list=r.items_list.map(i=>(i.fields=i.fields.filter(a=>a.field_id!=t),i)),this.storage.updateApp(r),!0}updateFieldInStorage(e,t){const r=this.storage.getApp(e);return r.field_list=r.field_list.map(i=>i.field_id==t.field_id?_objectSpread2(_objectSpread2({},i),t):i),this.storage.updateApp(r),t}updateFieldValue(e,t,r,i){const a=this.storage.getApp(e);return a.items_list.forEach(s=>{s.item_id==t&&s.fields.forEach(l=>{l.field_id==r&&(l.field_value=i,a.items_object[s.item_id][l.field_id]=l)})}),this.storage.updateApp(a),i}async getField(e,t){const r=await this.appProcessor.getApp(e);if(!r)return null;for(let i=0;i<r.field_list.length;i++)if(r.field_list[i].field_id==t)return r.field_list[i];return null}async getFieldIdByNameSpace(e,t){const r=await this.appProcessor.getApp(e);if(!r)return null;for(let i=0;i<r.field_list.length;i++)if(r.field_list[i].name_space==t)return r.field_list[i].field_id;return null}async getFieldModels(e){const t=await this.appProcessor.getApp(e);return t?t.field_list:null}async updateField(e,t){if(!e||!t)return;const r=await this.updatedFieldApi(e,t);return this.updateFieldInStorage(e,r)}async deleteField(e,t){return await this.deleteFieldApi(t),this.deleteFieldInStorage(e,t)}async getFieldValue(e,t,r){let i=null;const a=await this.appProcessor.getApp(e);try{i=a.items_object[t][r].field_value}catch{}return i}async setFieldValue(e,t,r,i){if(!(!e||!t||!r))return await this.setFieldValueApi(e,t,r,i),this.updateFieldValue(e,t,r,i)}fieldListeners(){this.pipeService.onRoot("gh_value_get",{},async(e,t)=>{if(t.app_id&&t.item_id&&t.field_id){let r=await this.getFieldValue(t.app_id,t.item_id,t.field_id);this.pipeService.emit("gh_value_get",t,r)}}),this.pipeService.onRoot("gh_value_set",{},async(e,t)=>{t.item_id&&(this.setFieldValue(t.app_id,t.item_id,t.field_id,t.new_value),delete t.new_value)}),this.pipeService.onRoot("gh_model_get",{},async(e,t)=>{try{let r=await this.getField(t.app_id,t.field_id);this.pipeService.emit("gh_model_get",t,r)}catch(r){console.log("Field model: ",r)}}),this.pipeService.onRoot("gh_model_update",{},async(e,t)=>{let r=await this.updateField(t.app_id,t.field_model);this.pipeService.emit("gh_model_update",{app_id:t.app_id,field_id:t.field_id},r)}),this.pipeService.onRoot("gh_models_get",{},async(e,t)=>{let r=await this.getFieldModels(t.app_id);this.pipeService.emit("gh_models_get",t,r)}),this.pipeService.onRoot("gh_model_delete",{},async(e,t)=>{let r=await this.deleteField(t.app_id,t.field_id);this.pipeService.emit("gh_model_delete",t,r)})}}class FileManager{constructor(e,t,r,i){this.storage=e,this.pipeService=t,this.req=r,this.appProcessor=i}async uploadFileApi(e,t,r){try{const i={"file-0":e,app_id:t,item_id:r};return await this.req.post({url:"/file/formupload",form:i})}catch(i){return console.log(i),null}}async uploadFileFromStringApi(e){try{return await this.req.post({url:"/file/upload",form:{file:JSON.stringify(e)}})}catch(t){return console.log(t),null}}async updateFileFromStringApi(e,t,r,i,a,s,l){try{const u={file_name:r,extension:i,file_id:t,format:a,source:e,alt:s,title:l};return await this.req.post({url:"/file/update",form:{file:JSON.stringify(u)}})}catch(u){return console.log(u),null}}async duplicateFileApi(e){return this.req.post({url:"/api/new/file/duplicate",headers:{"Content-Type":"application/x-www-form-urlencoded"},form:{files:JSON.stringify(e)}})}async downloadFileFromString(e,t){if(await this.isFileExists(e,t)){let r=await this.getFile(e,t),i=await this.req.get({url:r.url+"?timestamp="+r.last_update,externalResource:!0});return{file:r,data:i,type:"file"}}else return!1}async duplicateFile(e){let t=await this.duplicateFileApi(e);return t.forEach(r=>{this.addFileToStorage(r.app_id,r)}),t}async deleteFileApi(e){try{return await this.req.get({url:"/file/delete?file_id=".concat(e)})}catch(t){return console.log(t),null}}addFileToStorage(e,t){const r=this.storage.getApp(e);r&&(r.file_list.push(t),this.storage.updateApp(r),this.pipeService.emit("gh_file_upload",{app_id:e,item_id:t.item_id,file_id:t.file_id},t))}addFilesToStorage(e,t){const r=this.storage.getApp(e);r&&(r.file_list.push(...t),this.storage.updateApp(r),t.forEach(i=>{this.pipeService.emit("gh_file_upload",{app_id:e,item_id:i.item_id,file_id:i.file_id},i)}))}deleteFileFromStorage(e,t){const r=this.storage.getApp(t);if(r){let i;r.file_list=r.file_list.filter(a=>a.file_id!=e?!0:(i=a,!1)),this.storage.updateApp(r),this.pipeService.emit("gh_file_delete",{file_id:e},i)}}updateFileInStorage(e,t,r){const i=this.storage.getApp(t);i&&(i.file_list=i.file_list.map(a=>a.file_id==e?r:a),this.storage.updateApp(i),this.pipeService.emit("gh_file_update",{file_id:e}))}async getFile(e,t){const r=await this.appProcessor.getApp(e);return new Promise((i,a)=>{let s=r.file_list.find(l=>l.file_id==t);i(s||"")})}async getFiles(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const r=await this.appProcessor.getApp(e);return new Promise((i,a)=>{let s=r.file_list.filter(l=>t.some(u=>u==l.file_id));i(s||"")})}async uploadFile(e,t,r){const i=await this.uploadFileApi(e,t,r);return this.addFileToStorage(t,i),i}async uploadFileFromString(e){const t=await this.uploadFileFromStringApi(e);return this.addFileToStorage(t.app_id,t),t}async updateFileFromString(e,t,r,i,a,s,l){const u=await this.updateFileFromStringApi(e,t,r,i,a,s,l);return this.updateFileInStorage(t,u.app_id,u),u}async deleteFile(e,t){return await this.deleteFileApi(e),this.deleteFileFromStorage(e,t),!0}async isFileExists(e,t){let r=/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/;if(t){let i=await this.getFile(e,t);return i?r.test(i.url):!1}else return!1}}class DocumentManager{constructor(e,t){this.req=e,this.pipeService=t}createDocument(e){return this.emitDocumentInsert(e),this.req.post({url:"/api/new/document/insert-one",headers:{"Content-Type":"application/x-www-form-urlencoded"},form:{document:JSON.stringify(e)}})}emitDocumentInsert(e){const t=typeof e.data=="string"?JSON.parse(e.data):e.data;this.pipeService.emit("gh_document_insert_one",{app_id:e.app_id,item_id:e.item_id,element_id:e.element_id},t)}getDocument(e){return this.req.post({url:"/api/new/document/find-one",headers:{"Content-Type":"application/x-www-form-urlencoded"},form:{document:JSON.stringify(e)}})}getDocuments(e){return this.req.post({url:"/api/new/document/find",headers:{"Content-Type":"application/x-www-form-urlencoded"},form:{document:JSON.stringify(e)}})}deleteDocument(e){return this.req.post({url:"/api/new/document/remove-one",headers:{"Content-Type":"application/x-www-form-urlencoded"},form:{document:JSON.stringify(e)}})}}class Interpritate{constructor(e){this.gudhub=e}async getInterpretationObj(e,t,r,i,a,s){var l=[],u=t.data_model.interpretation.find(function(d){return d.src==r})||t.data_model.interpretation.find(function(d){return d.src=="table"})||{id:"default"},o=u;if(e.data_model&&e.data_model.interpretation){for(var f=0;f<e.data_model.interpretation.length;f++)(e.data_model.interpretation[f].src==r||e.data_model.interpretation[f].src==i)&&l.push(e.data_model.interpretation[f]);for(var f=0;f<l.length;f++)if(l[f].settings&&l[f].settings.condition_filter&&l[f].settings.filters_list.length>0){const h=await gudhub.getItem(s,a);if(h&&gudhub.filter([h],l[f].settings.filters_list).length>0){o=l[f];break}}else o=gudhub.mergeObjects(o,l[f])}return o}getInterpretation(e,t,r,i,a,s,l){const u=this;return new Promise(async(o,f)=>{var d=t&&t.data_type?t.data_type:r;d?gudhub.ghconstructor.getInstance(d).then(async function(h){if(h){var y=await u.getInterpretationObj(t,h.getTemplate().model,i,l,a,s);h.getInterpretation(e,y.id,d,t,a,s).then(function(m){o(gudhub.mergeObjects(m,y))},function(m){f()})}},function(h){}):console.error("Get Interpretation: data_type is undefined",r,t)})}async getInterpretationById(e,t,r,i){let a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:null,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:null,l=a??await this.gudhub.getFieldValue(e,t,r),u=s??await this.gudhub.getField(e,r);if(u==null)return"";const f=await(await this.gudhub.ghconstructor.getInstance(u.data_type)).getInterpretation(l,i,u.data_type,u,t,e);return f.html=="<span>no interpretation</span>"?l:f.html}}function WebsocketHandler(n,e){switch(e.api){case"/items/update":console.log("/items/update - ",e),n.itemProcessor.updateItemsInStorage(e.app_id,e.response);break;case"/items/add":console.log("/items/add - ",e),n.itemProcessor.addItemsToStorage(e.app_id,e.response);break;case"/items/delete":console.log("/items/delete - ",e),n.itemProcessor.deleteItemsFromStorage(e.app_id,e.response);break;case"/app/update":console.log("/app/update - ",e),n.appProcessor.updateAppFieldsAndViews(e.response);break;case"/file/delete":console.log("file/delete - ",e),n.fileManager.deleteFileFromStorage(e.response.file_id,e.app_id);break;case"/file/upload":console.log("file/upload - ",e),n.fileManager.addFileToStorage(e.app_id,e.response);break;case"/file/formupload":console.log("file/formupload - ",e);break;case"/file/update":n.fileManager.updateFileInStorage(e.response.file_id,e.response.app_id,e.response),console.log("file/update - ",e);break;case"/new/file/duplicate":n.fileManager.addFilesToStorage(e.app_id,e.response),console.log("new/file/duplicate - ",e);break;case"/api/new/document/insert-one":n.documentManager.emitDocumentInsert(e.response),console.log("/api/new/document/insert-one - ",e);break;case"/ws/emit-to-user":console.log("/ws/emit-to-user - ",e);break;case"/ws/broadcast-to-app-subscribers":console.log("/ws/broadcast-to-app-subscribers - ",e);const t=JSON.parse(e.response);if(!t.data_type)return;n.ghconstructor.getInstance(t.data_type).then(r=>{r.onMessage(e.app_id,e.user_id,t)});break;default:console.warn("WEBSOCKETS is not process this API:",e.api)}}class GroupManager{constructor(e,t){this.req=t,this.gudhub=e}async createGroupApi(e){try{const t={token:await this.gudhub.auth.getToken(),group_name:e};return await this.req.post({url:"/api/sharing-group/create-group",form:t})}catch(t){return console.log(t),null}}async updateGroupApi(e,t){try{const r={token:await this.gudhub.auth.getToken(),group_name:t,group_id:e};return await this.req.post({url:"/api/sharing-group/update-group",form:r})}catch(r){return console.log(r),null}}async deleteGroupApi(e){try{const t={token:await this.gudhub.auth.getToken(),group_id:e};return await this.req.post({url:"/api/sharing-group/delete-group",form:t})}catch(t){return console.log(t),null}}async addUserToGroupApi(e,t,r){try{const i={token:await this.gudhub.auth.getToken(),group_id:e,user_id:t,group_permission:r};return await this.req.post({url:"/api/sharing-group/add-user-to-group",form:i})}catch(i){return console.log(i),null}}async getUsersByGroupApi(e){try{const t={token:await this.gudhub.auth.getToken(),group_id:e};return await this.req.post({url:"/api/sharing-group/get-users-by-group",form:t})}catch(t){return console.log(t),null}}async updateUserInGroupApi(e,t,r){try{const i={token:await this.gudhub.auth.getToken(),user_id:e,group_id:t,group_permission:r};return await this.req.post({url:"/api/sharing-group/update-user-in-group",form:i})}catch(i){return console.log(i),null}}async deleteUserFromGroupApi(e,t){try{const r={token:await this.gudhub.auth.getToken(),user_id:e,group_id:t};return await this.req.post({url:"/api/sharing-group/delete-user-from-group",form:r})}catch(r){return console.log(r),null}}async getGroupsByUserApi(e){try{const t={token:await this.gudhub.auth.getToken(),user_id:e};return await this.req.post({url:"/api/sharing-group/get-groups-by-user",form:t})}catch(t){return console.log(t),null}}}class AppGroupSharing{constructor(e,t){this.req=t,this.gudhub=e}async addAppToGroupApi(e,t,r){try{const i={token:await this.gudhub.auth.getToken(),app_id:e,group_id:t,app_permission:r};return await this.req.post({url:"/api/sharing-group/add-app-to-group",form:i})}catch(i){return console.log(i),null}}async getAppsByGroupApi(e){try{const t={token:await this.gudhub.auth.getToken(),group_id:e};return await this.req.post({url:"/api/sharing-group/get-apps-by-group",form:t})}catch(t){return console.log(t),null}}async updateAppInGroupApi(e,t,r){try{const i={token:await this.gudhub.auth.getToken(),group_id:t,app_id:e,app_permission:r};return await this.req.post({url:"/api/sharing-group/update-app-in-group",form:i})}catch(i){return console.log(i),null}}async deleteAppFromGroupApi(e,t,r){try{const i={token:await this.gudhub.auth.getToken(),group_id:t,app_id:e,app_permission:r};return await this.req.post({url:"/api/sharing-group/delete-app-from-group",form:i})}catch(i){return console.log(i),null}}async getGroupsByAppApi(e){try{const t={token:await this.gudhub.auth.getToken(),app_id:e};return await this.req.post({url:"/api/sharing-group/get-groups-by-app",form:t})}catch(t){return console.log(t),null}}}class GroupSharing{constructor(e,t,r){this.req=t,this.gudhub=e,this.pipeService=r,this.groupManager=new GroupManager(e,t),this.appGroupSharing=new AppGroupSharing(e,t)}createGroup(e){return this.groupManager.createGroupApi(e)}updateGroup(e,t){return this.groupManager.updateGroupApi(e,t)}deleteGroup(e){return this.groupManager.deleteGroupApi(e)}async addUserToGroup(e,t,r){let i=await this.groupManager.addUserToGroupApi(e,t,r);return this.pipeService.emit("group_members_add",{app_id:"group_sharing"},i),i}getUsersByGroup(e){return this.groupManager.getUsersByGroupApi(e)}async updateUserInGroup(e,t,r){let i=await this.groupManager.updateUserInGroupApi(e,t,r);return this.pipeService.emit("group_members_update",{app_id:"group_sharing"},i),i}async deleteUserFromGroup(e,t){let r=await this.groupManager.deleteUserFromGroupApi(e,t);return this.pipeService.emit("group_members_delete",{app_id:"group_sharing"},r),r}getGroupsByUser(e){return this.groupManager.getGroupsByUserApi(e)}addAppToGroup(e,t,r){return this.appGroupSharing.addAppToGroupApi(e,t,r)}getAppsByGroup(e){return this.appGroupSharing.getAppsByGroupApi(e)}updateAppInGroup(e,t,r){return this.appGroupSharing.updateAppInGroupApi(e,t,r)}deleteAppFromGroup(e,t,r){return this.appGroupSharing.deleteAppFromGroupApi(e,t,r)}getGroupsByApp(e){return this.appGroupSharing.getGroupsByAppApi(e)}}class Sharing{constructor(e,t){this.req=t,this.gudhub=e}async add(e,t,r){try{const i={token:await this.gudhub.auth.getToken(),app_id:e,user_id:t,sharing_permission:r};return await this.req.post({url:"/sharing/add",form:i})}catch(i){return console.log(i),null}}async update(e,t,r){try{const i={token:await this.gudhub.auth.getToken(),app_id:e,user_id:t,sharing_permission:r};return await this.req.post({url:"/sharing/update",form:i})}catch(i){return console.log(i),null}}async delete(e,t){try{const r={token:await this.gudhub.auth.getToken(),app_id:e,user_id:t};return await this.req.post({url:"/sharing/delete",form:r})}catch(r){return console.log(r),null}}async getAppUsers(e){try{const t={token:await this.gudhub.auth.getToken(),app_id:e};return await this.req.post({url:"/sharing/get-app-users",form:t})}catch(t){return console.log(t),null}}async addInvitation(e,t){try{const r={token:await this.gudhub.auth.getToken(),guests_emails:e,apps:t};return await this.req.post({url:"/api/invitation/add",form:r})}catch(r){return console.log(r),null}}}class WebSocketEmitter{constructor(e){this.gudhub=e}async emitToUser(e,t){const r={user_id:e,data:typeof t=="object"?JSON.stringify(t):t};return await this.gudhub.req.post({url:"/ws/emit-to-user",form:r})}async broadcastToAppSubscribers(e,t,r){const i={app_id:e,data:JSON.stringify({data_type:t,data:r})};return await this.gudhub.req.post({url:"/ws/broadcast-to-app-subscribers",form:i})}}class DataService{}let AppDataService$1=class extends DataService{constructor(e,t,r){super(),this.chunkDataService=new ChunkDataService(e,chunkDataServiceConf,r),this.gudhub=r}isWithCache(){return!1}async processRequestedApp(e,t){if(!this.isWithCache()){let r=await this.chunkDataService.getMergedChunkForIDList(e,t.chunks);return r&&(t.items_list=await this.gudhub.util.mergeChunks([r,t])),t}}};class AppAPI{constructor(e){this.req=e}async getApp(e){return this.req.get({url:"/api/app/get",params:{app_id:e}})}}let objectAssignWithOverride=function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];for(let i of t)if(i)for(let a of Object.keys(i)){const s=Object.getOwnPropertyDescriptor(i,a);s.enumerable&&Object.defineProperty(n,a,s)}};class HttpService{}class AppHttpService extends AppDataService$1{constructor(e,t,r){super(e,t,r),this.appApi=new AppAPI(e);let i=new HttpService(t);objectAssignWithOverride(this,i)}async getApp(e){let t=await this.appApi.getApp(e);return this.processRequestedApp(e,t)}async getAppWithoutProcessing(e){return this.appApi.getApp(e)}async putApp(e,t){}static[Symbol.hasInstance](e){try{return e instanceof AppHttpService||e instanceof HttpService}catch{return!1}}}let ChunkDataService$1=class extends DataService{getMergedChunkForIDList(e){}isWithCache(){return!1}};class ChunkAPI{constructor(e){this.req=e}async getChunk(e,t){return this.req.get({url:"".concat(this.req.root,"/api/get-items-chunk/").concat(e,"/").concat(t),method:"GET"})}async getLastChunk(e){return this.req.axiosRequest({url:"".concat(this.req.root,"/api/get-last-items-chunk/").concat(e),method:"GET"})}}class ChunkHttpService extends ChunkDataService$1{constructor(e,t){super(),this.chunkApi=new ChunkAPI(e);let r=new HttpService(t);objectAssignWithOverride(this,r)}async getChunk(e,t){return this.chunkApi.getChunk(e,t)}async getChunksForId(e){return[]}getCachedMergedChunk(e,t){}getMergedChunkForIDList(e,t){}putChunk(){}static[Symbol.hasInstance](e){try{return e instanceof ChunkHttpService||e instanceof HttpService}catch{return!1}}}const appsConf={store:"apps"},chunksConf={store:"chunks"},dbName="gudhub",chunksMergeConf={store:"chunksMergeCache"};class StoreBackend{}class IndexedDBManager extends StoreBackend{constructor(e,t){if(IndexedDBManager.dbNameToInstanceMap||(IndexedDBManager.dbNameToInstanceMap=new Map),IndexedDBManager.dbNameToInstanceMap.has(e))return IndexedDBManager.dbNameToInstanceMap.get(e);this.db=null,this.dbName=e,this.storeNameList=t,IndexedDBManager.dbNameToInstanceMap.set(e,this)}async checkAndCreateStore(e){const r=(await indexedDB.databases()).find(s=>s.name===this.dbName);let i=!1,a=this;return r&&(i=await new Promise((s,l)=>{const u=indexedDB.open(a.dbName);u.onsuccess=function(o){const f=o.target.result,d=f.objectStoreNames.contains(e);f.close(),s(d)},u.onerror=function(o){l(o.target.error)}})),i?!0:new Promise((s,l)=>{const u=indexedDB.open(a.dbName,r?r.version+1:1);u.onupgradeneeded=function(o){const f=o.target.result;f.objectStoreNames.contains(e)||f.createObjectStore(e)},u.onsuccess=function(o){o.target.result.close(),s()},u.onerror=l})}async openDB(){if(this.db)return this.db;let e,t,r=new Promise((s,l)=>{e=s,t=l});for(let s of this.storeNameList)await this.checkAndCreateStore(s);let i=this;const a=indexedDB.open(this.dbName);return a.onsuccess=s=>{i.db=s.target.result,e(this.db)},a.onerror=t,r}async executeOperation(e,t){let r=await this.openDB();return new Promise((i,a)=>{const s=r.transaction(e,"readwrite"),l=s.objectStore(e);s.oncomplete=()=>i(),s.onerror=u=>a("Transaction failed: ".concat(u.target.error));try{t(l)}catch(u){a("Operation failed: ".concat(u.message))}})}}const indexedDBStoreBackendSingleton=new IndexedDBManager(dbName,[appsConf.store,chunksConf.store,chunksMergeConf.store]);class BaseStoreManager{constructor(e,t){this.storeBackend=e,this.storeName=t}async addItem(e,t){return new Promise(async(r,i)=>{this.storeBackend.executeOperation(this.storeName,a=>{const s=a.add(t,e);s.onsuccess=r,s.onerror=i})})}async putItem(e,t){return new Promise(async(r,i)=>{this.storeBackend.executeOperation(this.storeName,a=>{const s=a.put(t,e);s.onsuccess=r,s.onerror=i})})}async hasItem(e){try{return!!await this.getItem(e)}catch{return!1}}async getItem(e){return new Promise(async(t,r)=>{this.storeBackend.executeOperation(this.storeName,i=>{const a=i.get(e);a.onsuccess=()=>{const s=a.result;t(s)},a.onerror=r})})}async updateItem(e,t){return new Promise(async(r,i)=>{this.storeBackend.executeOperation(this.storeName,a=>{const s=a.get(e);s.onsuccess=()=>{const l=s.result;Object.assign(l,t),a.put(l,e),r()},s.onerror=i})})}async deleteItem(e){return new Promise(async(t,r)=>{this.storeBackend.executeOperation(this.storeName,i=>{const a=i.delete(e);a.onsuccess=t,a.onerror=r})})}}class AppStoreManager extends BaseStoreManager{constructor(){super(indexedDBStoreBackendSingleton,appsConf.store)}async getApp(e){return this.getItem(e)}async addApp(e,t){return this.addItem(e,t)}async putApp(e,t){return this.putItem(e,t)}async hasApp(e){return this.hasItem(e)}async deleteApp(e){return this.deleteItem(e)}}class MergedChunksStoreManager extends BaseStoreManager{constructor(){super(indexedDBStoreBackendSingleton,chunksMergeConf.store)}async get(e){return this.getItem(e)}async add(e,t){return this.addItem(e,t)}async put(e,t){return this.putItem(e,t)}async delete(e){return this.deleteItem(e)}}class IndexedDBChunkService extends ChunkDataService$1{constructor(e,t,r){super(e,t),this.dataService=new ChunkHttpService(e),this.requestCache=new Map,this.gudhub=r,this.storeManager=new MergedChunksStoreManager}static[Symbol.hasInstance](e){try{return e instanceof IndexedDBChunkService}catch{return!1}}async getCachedMergedChunk(e,t){try{return(await this.storeManager.get(e)).mergedData}catch{const i=t.map(l=>this.dataService.getChunk(e,l)),a=await Promise.all(i);let s=await this.gudhub.util.mergeChunks(a);return this.putMergedChunks(e,{hashes:t,mergedData:{items_list:s}}),{items_list:s}}}isWithCache(){return!0}async getMergedChunkForApp(e){}async getMergedChunkForIDList(e,t){try{let r=!0,i=await this.storeManager.get(e);try{if(t.length<i.hashes.length)throw new Error;for(let u of i.hashes)t.indexOf(u)!=i.hashes.indexOf(u)&&(r=!1)}catch{r=!1}let a=[],s=[];if(t.length>i.hashes.length&&(a=t.slice(i.hashes.length)),r||(a=t),a.length>0){const u=a.map(o=>this.dataService.getChunk(e,o));s=await Promise.all(u)}let l;return r||(l=await this.gudhub.util.mergeChunks([...s])),r&&(l=await this.gudhub.util.mergeChunks([i.mergedData,...s])),a.length>0&&this.putMergedChunks(e,{hashes:t,mergedData:{items_list:l}}),{items_list:l}}catch{const i=t.map(l=>this.dataService.getChunk(e,l)),a=await Promise.all(i);let s=await this.gudhub.util.mergeChunks(a);return this.putMergedChunks(e,{hashes:t,mergedData:{items_list:s}}),{items_list:s}}}async putMergedChunks(e,t){return this.storeManager.put(e,t)}}const jsContent=`(function(){"use strict";(()=>{let Ut,vt,Tr,Gt;var le=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};function G(n){return n&&n.__esModule?n.default:n}function Pr(n,e,t,r){Object.defineProperty(n,e,{get:t,set:r,enumerable:!0,configurable:!0})}var Wt={},wt={},A=le.parcelRequire94c2;A==null&&((A=function(n){if(n in Wt)return Wt[n].exports;if(n in wt){var e=wt[n];delete wt[n];var t={id:n,exports:{}};return Wt[n]=t,e.call(t.exports,t,t.exports),t.exports}var r=Error("Cannot find module '"+n+"'");throw r.code="MODULE_NOT_FOUND",r}).register=function(n,e){wt[n]=e},le.parcelRequire94c2=A);var L=A.register;L("1ufAB",function(n,e){var t=A("iEaqd"),r=A("iNZzY"),a=A("2VbXH"),i=A("6Mx50");function l(u){var o=new a(u),p=r(a.prototype.request,o);return t.extend(p,a.prototype,o),t.extend(p,o),p}var s=l(A("bM4se"));s.Axios=a,s.create=function(u){return l(i(s.defaults,u))},s.Cancel=A("g2liO"),s.CancelToken=A("14PRn"),s.isCancel=A("8kGOw"),s.all=function(u){return Promise.all(u)},s.spread=A("i3hBo"),s.isAxiosError=A("dhYWP"),n.exports=s,n.exports.default=s}),L("iEaqd",function(n,e){var t=A("iNZzY"),r=Object.prototype.toString;function a(I){return r.call(I)==="[object Array]"}function i(I){return I===void 0}function l(I){return I!==null&&!i(I)&&I.constructor!==null&&!i(I.constructor)&&typeof I.constructor.isBuffer=="function"&&I.constructor.isBuffer(I)}function s(I){return r.call(I)==="[object ArrayBuffer]"}function u(I){return typeof FormData<"u"&&I instanceof FormData}function o(I){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(I):I&&I.buffer&&I.buffer instanceof ArrayBuffer}function p(I){return typeof I=="string"}function m(I){return typeof I=="number"}function d(I){return I!==null&&typeof I=="object"}function y(I){if(r.call(I)!=="[object Object]")return!1;var F=Object.getPrototypeOf(I);return F===null||F===Object.prototype}function f(I){return r.call(I)==="[object Date]"}function S(I){return r.call(I)==="[object File]"}function v(I){return r.call(I)==="[object Blob]"}function w(I){return r.call(I)==="[object Function]"}function g(I){return d(I)&&w(I.pipe)}function _(I){return typeof URLSearchParams<"u"&&I instanceof URLSearchParams}function $(I){return I.trim?I.trim():I.replace(/^\\s+|\\s+$/g,"")}function x(){return(typeof navigator>"u"||navigator.product!=="ReactNative"&&navigator.product!=="NativeScript"&&navigator.product!=="NS")&&typeof window<"u"&&typeof document<"u"}function T(I,F){if(I!=null)if(typeof I!="object"&&(I=[I]),a(I))for(var C=0,B=I.length;C<B;C++)F.call(null,I[C],C,I);else for(var V in I)Object.prototype.hasOwnProperty.call(I,V)&&F.call(null,I[V],V,I)}function P(){var I={};function F(V,X){y(I[X])&&y(V)?I[X]=P(I[X],V):y(V)?I[X]=P({},V):a(V)?I[X]=V.slice():I[X]=V}for(var C=0,B=arguments.length;C<B;C++)T(arguments[C],F);return I}function D(I,F,C){return T(F,function(B,V){C&&typeof B=="function"?I[V]=t(B,C):I[V]=B}),I}function R(I){return I.charCodeAt(0)===65279&&(I=I.slice(1)),I}n.exports={isArray:a,isArrayBuffer:s,isBuffer:l,isFormData:u,isArrayBufferView:o,isString:p,isNumber:m,isObject:d,isPlainObject:y,isUndefined:i,isDate:f,isFile:S,isBlob:v,isFunction:w,isStream:g,isURLSearchParams:_,isStandardBrowserEnv:x,forEach:T,merge:P,extend:D,trim:$,stripBOM:R}}),L("iNZzY",function(n,e){n.exports=function(t,r){return function(){for(var a=Array(arguments.length),i=0;i<a.length;i++)a[i]=arguments[i];return t.apply(r,a)}}}),L("2VbXH",function(n,e){var t=A("iEaqd"),r=A("gWG2h"),a=A("4m3Da"),i=A("d4try"),l=A("6Mx50"),s=A("hiYAY"),u=s.validators;function o(p){this.defaults=p,this.interceptors={request:new a,response:new a}}o.prototype.request=function(p){typeof p=="string"?(p=arguments[1]||{},p.url=arguments[0]):p=p||{},(p=l(this.defaults,p)).method?p.method=p.method.toLowerCase():this.defaults.method?p.method=this.defaults.method.toLowerCase():p.method="get";var m,d=p.transitional;d!==void 0&&s.assertOptions(d,{silentJSONParsing:u.transitional(u.boolean,"1.0.0"),forcedJSONParsing:u.transitional(u.boolean,"1.0.0"),clarifyTimeoutError:u.transitional(u.boolean,"1.0.0")},!1);var y=[],f=!0;this.interceptors.request.forEach(function($){(typeof $.runWhen!="function"||$.runWhen(p)!==!1)&&(f=f&&$.synchronous,y.unshift($.fulfilled,$.rejected))});var S=[];if(this.interceptors.response.forEach(function($){S.push($.fulfilled,$.rejected)}),!f){var v=[i,void 0];for(Array.prototype.unshift.apply(v,y),v=v.concat(S),m=Promise.resolve(p);v.length;)m=m.then(v.shift(),v.shift());return m}for(var w=p;y.length;){var g=y.shift(),_=y.shift();try{w=g(w)}catch($){_($);break}}try{m=i(w)}catch($){return Promise.reject($)}for(;S.length;)m=m.then(S.shift(),S.shift());return m},o.prototype.getUri=function(p){return r((p=l(this.defaults,p)).url,p.params,p.paramsSerializer).replace(/^\\?/,"")},t.forEach(["delete","get","head","options"],function(p){o.prototype[p]=function(m,d){return this.request(l(d||{},{method:p,url:m,data:(d||{}).data}))}}),t.forEach(["post","put","patch"],function(p){o.prototype[p]=function(m,d,y){return this.request(l(y||{},{method:p,url:m,data:d}))}}),n.exports=o}),L("gWG2h",function(n,e){var t=A("iEaqd");function r(a){return encodeURIComponent(a).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}n.exports=function(a,i,l){if(!i)return a;if(l)s=l(i);else if(t.isURLSearchParams(i))s=i.toString();else{var s,u=[];t.forEach(i,function(p,m){p!=null&&(t.isArray(p)?m+="[]":p=[p],t.forEach(p,function(d){t.isDate(d)?d=d.toISOString():t.isObject(d)&&(d=JSON.stringify(d)),u.push(r(m)+"="+r(d))}))}),s=u.join("&")}if(s){var o=a.indexOf("#");o!==-1&&(a=a.slice(0,o)),a+=(a.indexOf("?")===-1?"?":"&")+s}return a}}),L("4m3Da",function(n,e){var t=A("iEaqd");function r(){this.handlers=[]}r.prototype.use=function(a,i,l){return this.handlers.push({fulfilled:a,rejected:i,synchronous:!!l&&l.synchronous,runWhen:l?l.runWhen:null}),this.handlers.length-1},r.prototype.eject=function(a){this.handlers[a]&&(this.handlers[a]=null)},r.prototype.forEach=function(a){t.forEach(this.handlers,function(i){i!==null&&a(i)})},n.exports=r}),L("d4try",function(n,e){var t=A("iEaqd"),r=A("gu59S"),a=A("8kGOw"),i=A("bM4se");function l(s){s.cancelToken&&s.cancelToken.throwIfRequested()}n.exports=function(s){return l(s),s.headers=s.headers||{},s.data=r.call(s,s.data,s.headers,s.transformRequest),s.headers=t.merge(s.headers.common||{},s.headers[s.method]||{},s.headers),t.forEach(["delete","get","head","post","put","patch","common"],function(u){delete s.headers[u]}),(s.adapter||i.adapter)(s).then(function(u){return l(s),u.data=r.call(s,u.data,u.headers,s.transformResponse),u},function(u){return!a(u)&&(l(s),u&&u.response&&(u.response.data=r.call(s,u.response.data,u.response.headers,s.transformResponse))),Promise.reject(u)})}}),L("gu59S",function(n,e){var t=A("iEaqd"),r=A("bM4se");n.exports=function(a,i,l){var s=this||r;return t.forEach(l,function(u){a=u.call(s,a,i)}),a}}),L("bM4se",function(n,e){var t=A("2dKjk"),r=A("iEaqd"),a=A("4xE2z"),i=A("9na6w"),l={"Content-Type":"application/x-www-form-urlencoded"};function s(p,m){!r.isUndefined(p)&&r.isUndefined(p["Content-Type"])&&(p["Content-Type"]=m)}function u(p,m,d){if(r.isString(p))try{return(m||JSON.parse)(p),r.trim(p)}catch(y){if(y.name!=="SyntaxError")throw y}return(0,JSON.stringify)(p)}var o={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:function(){var p;return(typeof XMLHttpRequest<"u"||t!==void 0&&Object.prototype.toString.call(t)==="[object process]")&&(p=A("kHaX1")),p}(),transformRequest:[function(p,m){return a(m,"Accept"),a(m,"Content-Type"),r.isFormData(p)||r.isArrayBuffer(p)||r.isBuffer(p)||r.isStream(p)||r.isFile(p)||r.isBlob(p)?p:r.isArrayBufferView(p)?p.buffer:r.isURLSearchParams(p)?(s(m,"application/x-www-form-urlencoded;charset=utf-8"),p.toString()):r.isObject(p)||m&&m["Content-Type"]==="application/json"?(s(m,"application/json"),u(p)):p}],transformResponse:[function(p){var m=this.transitional,d=m&&m.silentJSONParsing,y=m&&m.forcedJSONParsing,f=!d&&this.responseType==="json";if(f||y&&r.isString(p)&&p.length)try{return JSON.parse(p)}catch(S){if(f)throw S.name==="SyntaxError"?i(S,this,"E_JSON_PARSE"):S}return p}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(p){return p>=200&&p<300}};o.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],function(p){o.headers[p]={}}),r.forEach(["post","put","patch"],function(p){o.headers[p]=r.merge(l)}),n.exports=o}),L("2dKjk",function(n,e){var t,r,a,i=n.exports={};function l(){throw Error("setTimeout has not been defined")}function s(){throw Error("clearTimeout has not been defined")}function u(w){if(t===setTimeout)return setTimeout(w,0);if((t===l||!t)&&setTimeout)return t=setTimeout,setTimeout(w,0);try{return t(w,0)}catch{try{return t.call(null,w,0)}catch{return t.call(this,w,0)}}}function o(w){if(r===clearTimeout)return clearTimeout(w);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(w);try{return r(w)}catch{try{return r.call(null,w)}catch{return r.call(this,w)}}}(function(){try{t=typeof setTimeout=="function"?setTimeout:l}catch{t=l}try{r=typeof clearTimeout=="function"?clearTimeout:s}catch{r=s}})();var p=[],m=!1,d=-1;function y(){m&&a&&(m=!1,a.length?p=a.concat(p):d=-1,p.length&&f())}function f(){if(!m){var w=u(y);m=!0;for(var g=p.length;g;){for(a=p,p=[];++d<g;)a&&a[d].run();d=-1,g=p.length}a=null,m=!1,o(w)}}function S(w,g){this.fun=w,this.array=g}function v(){}i.nextTick=function(w){var g=Array(arguments.length-1);if(arguments.length>1)for(var _=1;_<arguments.length;_++)g[_-1]=arguments[_];p.push(new S(w,g)),p.length!==1||m||u(f)},S.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,i.listeners=function(w){return[]},i.binding=function(w){throw Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(w){throw Error("process.chdir is not supported")},i.umask=function(){return 0}}),L("4xE2z",function(n,e){var t=A("iEaqd");n.exports=function(r,a){t.forEach(r,function(i,l){l!==a&&l.toUpperCase()===a.toUpperCase()&&(r[a]=i,delete r[l])})}}),L("9na6w",function(n,e){n.exports=function(t,r,a,i,l){return t.config=r,a&&(t.code=a),t.request=i,t.response=l,t.isAxiosError=!0,t.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},t}}),L("kHaX1",function(n,e){var t=A("iEaqd"),r=A("hAgIk"),a=A("gIEx2"),i=A("gWG2h"),l=A("e3Yo9"),s=A("lo19V"),u=A("eg6xZ"),o=A("iUqaj");n.exports=function(p){return new Promise(function(m,d){var y=p.data,f=p.headers,S=p.responseType;t.isFormData(y)&&delete f["Content-Type"];var v=new XMLHttpRequest;if(p.auth){var w=p.auth.username||"",g=p.auth.password?unescape(encodeURIComponent(p.auth.password)):"";f.Authorization="Basic "+btoa(w+":"+g)}var _=l(p.baseURL,p.url);function $(){if(v){var T="getAllResponseHeaders"in v?s(v.getAllResponseHeaders()):null,P=S&&S!=="text"&&S!=="json"?v.response:v.responseText,D={data:P,status:v.status,statusText:v.statusText,headers:T,config:p,request:v};r(m,d,D),v=null}}if(v.open(p.method.toUpperCase(),i(_,p.params,p.paramsSerializer),!0),v.timeout=p.timeout,"onloadend"in v?v.onloadend=$:v.onreadystatechange=function(){v&&v.readyState===4&&(v.status!==0||v.responseURL&&v.responseURL.indexOf("file:")===0)&&setTimeout($)},v.onabort=function(){v&&(d(o("Request aborted",p,"ECONNABORTED",v)),v=null)},v.onerror=function(){d(o("Network Error",p,null,v)),v=null},v.ontimeout=function(){var T="timeout of "+p.timeout+"ms exceeded";p.timeoutErrorMessage&&(T=p.timeoutErrorMessage),d(o(T,p,p.transitional&&p.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",v)),v=null},t.isStandardBrowserEnv()){var x=(p.withCredentials||u(_))&&p.xsrfCookieName?a.read(p.xsrfCookieName):void 0;x&&(f[p.xsrfHeaderName]=x)}"setRequestHeader"in v&&t.forEach(f,function(T,P){y===void 0&&P.toLowerCase()==="content-type"?delete f[P]:v.setRequestHeader(P,T)}),t.isUndefined(p.withCredentials)||(v.withCredentials=!!p.withCredentials),S&&S!=="json"&&(v.responseType=p.responseType),typeof p.onDownloadProgress=="function"&&v.addEventListener("progress",p.onDownloadProgress),typeof p.onUploadProgress=="function"&&v.upload&&v.upload.addEventListener("progress",p.onUploadProgress),p.cancelToken&&p.cancelToken.promise.then(function(T){v&&(v.abort(),d(T),v=null)}),y||(y=null),v.send(y)})}}),L("hAgIk",function(n,e){var t=A("iUqaj");n.exports=function(r,a,i){var l=i.config.validateStatus;!i.status||!l||l(i.status)?r(i):a(t("Request failed with status code "+i.status,i.config,null,i.request,i))}}),L("iUqaj",function(n,e){var t=A("9na6w");n.exports=function(r,a,i,l,s){return t(Error(r),a,i,l,s)}}),L("gIEx2",function(n,e){var t=A("iEaqd");n.exports=t.isStandardBrowserEnv()?function(){return{write:function(r,a,i,l,s,u){var o=[];o.push(r+"="+encodeURIComponent(a)),t.isNumber(i)&&o.push("expires="+new Date(i).toGMTString()),t.isString(l)&&o.push("path="+l),t.isString(s)&&o.push("domain="+s),u===!0&&o.push("secure"),document.cookie=o.join("; ")},read:function(r){var a=document.cookie.match(RegExp("(^|;\\\\s*)("+r+")=([^;]*)"));return a?decodeURIComponent(a[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()}),L("e3Yo9",function(n,e){var t=A("2rjk0"),r=A("5nGHC");n.exports=function(a,i){return a&&!t(i)?r(a,i):i}}),L("2rjk0",function(n,e){n.exports=function(t){return/^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(t)}}),L("5nGHC",function(n,e){n.exports=function(t,r){return r?t.replace(/\\/+$/,"")+"/"+r.replace(/^\\/+/,""):t}}),L("lo19V",function(n,e){var t=A("iEaqd"),r=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];n.exports=function(a){var i,l,s,u={};return a&&t.forEach(a.split(\`
99
- \`),function(o){s=o.indexOf(":"),i=t.trim(o.substr(0,s)).toLowerCase(),l=t.trim(o.substr(s+1)),i&&!(u[i]&&r.indexOf(i)>=0)&&(i==="set-cookie"?u[i]=(u[i]?u[i]:[]).concat([l]):u[i]=u[i]?u[i]+", "+l:l)}),u}}),L("eg6xZ",function(n,e){var t=A("iEaqd");n.exports=t.isStandardBrowserEnv()?function(){var r,a=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a");function l(s){var u=s;return a&&(i.setAttribute("href",u),u=i.href),i.setAttribute("href",u),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:i.pathname.charAt(0)==="/"?i.pathname:"/"+i.pathname}}return r=l(window.location.href),function(s){var u=t.isString(s)?l(s):s;return u.protocol===r.protocol&&u.host===r.host}}():function(){return function(){return!0}}()}),L("8kGOw",function(n,e){n.exports=function(t){return!!(t&&t.__CANCEL__)}}),L("6Mx50",function(n,e){var t=A("iEaqd");n.exports=function(r,a){a=a||{};var i={},l=["url","method","data"],s=["headers","auth","proxy","params"],u=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],o=["validateStatus"];function p(f,S){return t.isPlainObject(f)&&t.isPlainObject(S)?t.merge(f,S):t.isPlainObject(S)?t.merge({},S):t.isArray(S)?S.slice():S}function m(f){t.isUndefined(a[f])?t.isUndefined(r[f])||(i[f]=p(void 0,r[f])):i[f]=p(r[f],a[f])}t.forEach(l,function(f){t.isUndefined(a[f])||(i[f]=p(void 0,a[f]))}),t.forEach(s,m),t.forEach(u,function(f){t.isUndefined(a[f])?t.isUndefined(r[f])||(i[f]=p(void 0,r[f])):i[f]=p(void 0,a[f])}),t.forEach(o,function(f){f in a?i[f]=p(r[f],a[f]):f in r&&(i[f]=p(void 0,r[f]))});var d=l.concat(s).concat(u).concat(o),y=Object.keys(r).concat(Object.keys(a)).filter(function(f){return d.indexOf(f)===-1});return t.forEach(y,m),i}}),L("hiYAY",function(n,e){var t=A("bTAft"),r={};["object","boolean","number","function","string","symbol"].forEach(function(u,o){r[u]=function(p){return typeof p===u||"a"+(o<1?"n ":" ")+u}});var a={},i=t.version.split(".");function l(u,o){for(var p=o?o.split("."):i,m=u.split("."),d=0;d<3;d++){if(p[d]>m[d])return!0;if(p[d]<m[d])break}return!1}function s(u,o,p){if(typeof u!="object")throw TypeError("options must be an object");for(var m=Object.keys(u),d=m.length;d-- >0;){var y=m[d],f=o[y];if(f){var S=u[y],v=S===void 0||f(S,y,u);if(v!==!0)throw TypeError("option "+y+" must be "+v);continue}if(p!==!0)throw Error("Unknown option "+y)}}r.transitional=function(u,o,p){var m=o&&l(o);function d(y,f){return"[Axios v"+t.version+"] Transitional option '"+y+"'"+f+(p?". "+p:"")}return function(y,f,S){if(u===!1)throw Error(d(f," has been removed in "+o));return m&&!a[f]&&(a[f]=!0,console.warn(d(f," has been deprecated since v"+o+" and will be removed in the near future"))),!u||u(y,f,S)}},n.exports={isOlderVersion:l,assertOptions:s,validators:r}}),L("bTAft",function(n,e){n.exports=JSON.parse('{"_args":[["axios@0.21.4","/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub"]],"_from":"axios@0.21.4","_id":"axios@0.21.4","_inBundle":false,"_integrity":"sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==","_location":"/axios","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"axios@0.21.4","name":"axios","escapedName":"axios","rawSpec":"0.21.4","saveSpec":null,"fetchSpec":"0.21.4"},"_requiredBy":["/"],"_resolved":"https://registry.npmjs.org/axios/-/axios-0.21.4.tgz","_spec":"0.21.4","_where":"/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub","author":{"name":"Matt Zabriskie"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"bugs":{"url":"https://github.com/axios/axios/issues"},"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}],"dependencies":{"follow-redirects":"^1.14.0"},"description":"Promise based HTTP client for the browser and node.js","devDependencies":{"coveralls":"^3.0.0","es6-promise":"^4.2.4","grunt":"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1","karma":"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2","minimist":"^1.2.0","mocha":"^8.2.1","sinon":"^4.5.0","terser-webpack-plugin":"^4.2.3","typescript":"^4.0.5","url-search-params":"^0.10.0","webpack":"^4.44.2","webpack-dev-server":"^3.11.0"},"homepage":"https://axios-http.com","jsdelivr":"dist/axios.min.js","keywords":["xhr","http","ajax","promise","node"],"license":"MIT","main":"index.js","name":"axios","repository":{"type":"git","url":"git+https://github.com/axios/axios.git"},"scripts":{"build":"NODE_ENV=production grunt build","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","examples":"node ./examples/server.js","fix":"eslint --fix lib/**/*.js","postversion":"git push && git push --tags","preversion":"npm test","start":"node ./sandbox/server.js","test":"grunt test","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json"},"typings":"./index.d.ts","unpkg":"dist/axios.min.js","version":"0.21.4"}')}),L("g2liO",function(n,e){function t(r){this.message=r}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,n.exports=t}),L("14PRn",function(n,e){var t=A("g2liO");function r(a){if(typeof a!="function")throw TypeError("executor must be a function.");this.promise=new Promise(function(s){i=s});var i,l=this;a(function(s){l.reason||(l.reason=new t(s),i(l.reason))})}r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},r.source=function(){var a;return{token:new r(function(i){a=i}),cancel:a}},n.exports=r}),L("i3hBo",function(n,e){n.exports=function(t){return function(r){return t.apply(null,r)}}}),L("dhYWP",function(n,e){n.exports=function(t){return typeof t=="object"&&t.isAxiosError===!0}}),L("kfIQl",function(n,e){var t=typeof Symbol<"u"&&Symbol,r=A("lyEFc");n.exports=function(){return typeof t=="function"&&typeof Symbol=="function"&&typeof t("foo")=="symbol"&&typeof Symbol("bar")=="symbol"&&r()}}),L("lyEFc",function(n,e){n.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),a=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(a)!=="[object Symbol]")return!1;var i=42;for(r in t[r]=i,t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var l=Object.getOwnPropertySymbols(t);if(l.length!==1||l[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(t,r);if(s.value!==i||s.enumerable!==!0)return!1}return!0}}),L("bJ3CN",function(n,e){var t={__proto__:null,foo:{}},r=Object;n.exports=function(){return{__proto__:t}.foo===t.foo&&!(t instanceof r)}}),L("9cNUg",function(n,e){var t=A("hGGZx"),r=function(){return!!t};r.hasArrayLengthDefineBug=function(){if(!t)return null;try{return t([],"length",{value:1}).length!==1}catch{return!0}},n.exports=r}),L("hGGZx",function(n,e){var t=A("hMrGw")("%Object.defineProperty%",!0)||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}n.exports=t}),L("hMrGw",function(n,e){var t=A("dUpie"),r=A("48xLS"),a=A("4Vqmv"),i=A("7x6DQ"),l=A("kPNod"),s=A("b9GfH"),u=A("8DBKi"),o=Function,p=function(H){try{return o('"use strict"; return ('+H+").constructor;")()}catch{}},m=Object.getOwnPropertyDescriptor;if(m)try{m({},"")}catch{m=null}var d=function(){throw new s},y=m?function(){try{return arguments.callee,d}catch{try{return m(arguments,"callee").get}catch{return d}}}():d,f=A("kfIQl")(),S=A("bJ3CN")(),v=Object.getPrototypeOf||(S?function(H){return H.__proto__}:null),w={},g=typeof Uint8Array<"u"&&v?v(Uint8Array):void 0,_={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?void 0:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?void 0:ArrayBuffer,"%ArrayIteratorPrototype%":f&&v?v([][Symbol.iterator]()):void 0,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":w,"%AsyncGenerator%":w,"%AsyncGeneratorFunction%":w,"%AsyncIteratorPrototype%":w,"%Atomics%":typeof Atomics>"u"?void 0:Atomics,"%BigInt%":typeof BigInt>"u"?void 0:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?void 0:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?void 0:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?void 0:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":r,"%Float32Array%":typeof Float32Array>"u"?void 0:Float32Array,"%Float64Array%":typeof Float64Array>"u"?void 0:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?void 0:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":w,"%Int8Array%":typeof Int8Array>"u"?void 0:Int8Array,"%Int16Array%":typeof Int16Array>"u"?void 0:Int16Array,"%Int32Array%":typeof Int32Array>"u"?void 0:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":f&&v?v(v([][Symbol.iterator]())):void 0,"%JSON%":typeof JSON=="object"?JSON:void 0,"%Map%":typeof Map>"u"?void 0:Map,"%MapIteratorPrototype%":typeof Map<"u"&&f&&v?v(new Map()[Symbol.iterator]()):void 0,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?void 0:Promise,"%Proxy%":typeof Proxy>"u"?void 0:Proxy,"%RangeError%":a,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?void 0:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?void 0:Set,"%SetIteratorPrototype%":typeof Set<"u"&&f&&v?v(new Set()[Symbol.iterator]()):void 0,"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?void 0:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":f&&v?v(""[Symbol.iterator]()):void 0,"%Symbol%":f?Symbol:void 0,"%SyntaxError%":l,"%ThrowTypeError%":y,"%TypedArray%":g,"%TypeError%":s,"%Uint8Array%":typeof Uint8Array>"u"?void 0:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?void 0:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?void 0:Uint32Array,"%URIError%":u,"%WeakMap%":typeof WeakMap>"u"?void 0:WeakMap,"%WeakRef%":typeof WeakRef>"u"?void 0:WeakRef,"%WeakSet%":typeof WeakSet>"u"?void 0:WeakSet};if(v)try{null.error}catch(H){var $=v(v(H));_["%Error.prototype%"]=$}var x=function H(ie){var ee;if(ie==="%AsyncFunction%")ee=p("async function () {}");else if(ie==="%GeneratorFunction%")ee=p("function* () {}");else if(ie==="%AsyncGeneratorFunction%")ee=p("async function* () {}");else if(ie==="%AsyncGenerator%"){var k=H("%AsyncGeneratorFunction%");k&&(ee=k.prototype)}else if(ie==="%AsyncIteratorPrototype%"){var O=H("%AsyncGenerator%");O&&v&&(ee=v(O.prototype))}return _[ie]=ee,ee},T={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},P=A("hweMw"),D=A("23C6u"),R=P.call(Function.call,Array.prototype.concat),I=P.call(Function.apply,Array.prototype.splice),F=P.call(Function.call,String.prototype.replace),C=P.call(Function.call,String.prototype.slice),B=P.call(Function.call,RegExp.prototype.exec),V=/[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g,X=/\\\\(\\\\)?/g,oe=function(H){var ie=C(H,0,1),ee=C(H,-1);if(ie==="%"&&ee!=="%")throw new l("invalid intrinsic syntax, expected closing \`%\`");if(ee==="%"&&ie!=="%")throw new l("invalid intrinsic syntax, expected opening \`%\`");var k=[];return F(H,V,function(O,N,K,se){k[k.length]=K?F(se,X,"$1"):N||O}),k},we=function(H,ie){var ee,k=H;if(D(T,k)&&(k="%"+(ee=T[k])[0]+"%"),D(_,k)){var O=_[k];if(O===w&&(O=x(k)),O===void 0&&!ie)throw new s("intrinsic "+H+" exists, but is not available. Please file an issue!");return{alias:ee,name:k,value:O}}throw new l("intrinsic "+H+" does not exist!")};n.exports=function(H,ie){if(typeof H!="string"||H.length===0)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ie!="boolean")throw new s('"allowMissing" argument must be a boolean');if(B(/^%?[^%]*%?$/,H)===null)throw new l("\`%\` may not be present anywhere but at the beginning and end of the intrinsic name");var ee=oe(H),k=ee.length>0?ee[0]:"",O=we("%"+k+"%",ie),N=O.name,K=O.value,se=!1,te=O.alias;te&&(k=te[0],I(ee,R([0,1],te)));for(var J=1,ce=!0;J<ee.length;J+=1){var re=ee[J],fe=C(re,0,1),Ae=C(re,-1);if((fe==='"'||fe==="'"||fe==="\`"||Ae==='"'||Ae==="'"||Ae==="\`")&&fe!==Ae)throw new l("property names with quotes must have matching quotes");if(re!=="constructor"&&ce||(se=!0),k+="."+re,D(_,N="%"+k+"%"))K=_[N];else if(K!=null){if(!(re in K)){if(!ie)throw new s("base intrinsic for "+H+" exists, but the property is not available.");return}if(m&&J+1>=ee.length){var Ie=m(K,re);K=(ce=!!Ie)&&"get"in Ie&&!("originalValue"in Ie.get)?Ie.get:K[re]}else ce=D(K,re),K=K[re];ce&&!se&&(_[N]=K)}}return K}}),L("dUpie",function(n,e){n.exports=Error}),L("48xLS",function(n,e){n.exports=EvalError}),L("4Vqmv",function(n,e){n.exports=RangeError}),L("7x6DQ",function(n,e){n.exports=ReferenceError}),L("kPNod",function(n,e){n.exports=SyntaxError}),L("b9GfH",function(n,e){n.exports=TypeError}),L("8DBKi",function(n,e){n.exports=URIError}),L("hweMw",function(n,e){var t=A("2Eytq");n.exports=Function.prototype.bind||t}),L("2Eytq",function(n,e){var t="Function.prototype.bind called on incompatible ",r=Object.prototype.toString,a=Math.max,i="[object Function]",l=function(o,p){for(var m=[],d=0;d<o.length;d+=1)m[d]=o[d];for(var y=0;y<p.length;y+=1)m[y+o.length]=p[y];return m},s=function(o,p){for(var m=[],d=p,y=0;d<o.length;d+=1,y+=1)m[y]=o[d];return m},u=function(o,p){for(var m="",d=0;d<o.length;d+=1)m+=o[d],d+1<o.length&&(m+=p);return m};n.exports=function(o){var p,m=this;if(typeof m!="function"||r.apply(m)!==i)throw TypeError(t+m);for(var d=s(arguments,1),y=function(){if(this instanceof p){var g=m.apply(this,l(d,arguments));return Object(g)===g?g:this}return m.apply(o,l(d,arguments))},f=a(0,m.length-d.length),S=[],v=0;v<f;v++)S[v]="$"+v;if(p=Function("binder","return function ("+u(S,",")+"){ return binder.apply(this,arguments); }")(y),m.prototype){var w=function(){};w.prototype=m.prototype,p.prototype=new w,w.prototype=null}return p}}),L("23C6u",function(n,e){var t=Function.prototype.call,r=Object.prototype.hasOwnProperty,a=A("hweMw");n.exports=a.call(t,r)}),L("5ZWAZ",function(n,e){function t(r){return n.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},n.exports.__esModule=!0,n.exports.default=n.exports,t(r)}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports}),L("fgq5y",function(n,e){var t=A("f3Ywx").default;Object.defineProperty(n.exports,"__esModule",{value:!0}),n.exports.default=l;var r=t(A("a9VQw")),a=t(A("glRwo")),i=t(A("ayR3G"));function l(s,u){(0,i.default)(2,arguments);var o=(0,a.default)(s),p=(0,r.default)(u);return isNaN(p)?new Date(NaN):(p&&o.setDate(o.getDate()+p),o)}n.exports=n.exports.default}),L("f3Ywx",function(n,e){function t(r){return r&&r.__esModule?r:{default:r}}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports}),L("a9VQw",function(n,e){function t(r){if(r===null||r===!0||r===!1)return NaN;var a=Number(r);return isNaN(a)?a:a<0?Math.ceil(a):Math.floor(a)}Object.defineProperty(n.exports,"__esModule",{value:!0}),n.exports.default=t,n.exports=n.exports.default}),L("glRwo",function(n,e){var t=A("f3Ywx").default;Object.defineProperty(n.exports,"__esModule",{value:!0}),n.exports.default=i;var r=t(A("5ZWAZ")),a=t(A("ayR3G"));function i(l){(0,a.default)(1,arguments);var s=Object.prototype.toString.call(l);return l instanceof Date||(0,r.default)(l)==="object"&&s==="[object Date]"?new Date(l.getTime()):typeof l=="number"||s==="[object Number]"?new Date(l):((typeof l=="string"||s==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use \`parseISO\` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(Error().stack)),new Date(NaN))}n.exports=n.exports.default}),L("ayR3G",function(n,e){function t(r,a){if(a.length<r)throw TypeError(r+" argument"+(r>1?"s":"")+" required, but only "+a.length+" present")}Object.defineProperty(n.exports,"__esModule",{value:!0}),n.exports.default=t,n.exports=n.exports.default}),L("byyO9",function(n,e){var t=A("f3Ywx").default;Object.defineProperty(n.exports,"__esModule",{value:!0}),n.exports.default=l;var r=t(A("a9VQw")),a=t(A("glRwo")),i=t(A("ayR3G"));function l(s,u){(0,i.default)(2,arguments);var o=(0,a.default)(s),p=(0,r.default)(u);if(isNaN(p))return new Date(NaN);if(!p)return o;var m=o.getDate(),d=new Date(o.getTime());return d.setMonth(o.getMonth()+p+1,0),m>=d.getDate()?d:(o.setFullYear(d.getFullYear(),d.getMonth(),m),o)}n.exports=n.exports.default}),L("hLz6R",function(n,e){var t=A("f3Ywx").default;Object.defineProperty(n.exports,"__esModule",{value:!0}),n.exports.default=s;var r=t(A("glRwo")),a=t(A("a9VQw")),i=t(A("ayR3G")),l=A("lmyOi");function s(u,o){(0,i.default)(1,arguments);var p,m,d,y,f,S,v,w,g=(0,l.getDefaultOptions)(),_=(0,a.default)((p=(m=(d=(y=o==null?void 0:o.weekStartsOn)!==null&&y!==void 0?y:o==null||(f=o.locale)===null||f===void 0||(S=f.options)===null||S===void 0?void 0:S.weekStartsOn)!==null&&d!==void 0?d:g.weekStartsOn)!==null&&m!==void 0?m:(v=g.locale)===null||v===void 0||(w=v.options)===null||w===void 0?void 0:w.weekStartsOn)!==null&&p!==void 0?p:0);if(!(_>=0&&_<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");var $=(0,r.default)(u),x=$.getDay(),T=(x<_?7:0)+x-_;return $.setDate($.getDate()-T),$.setHours(0,0,0,0),$}n.exports=n.exports.default}),L("lmyOi",function(n,e){Object.defineProperty(n.exports,"__esModule",{value:!0}),n.exports.getDefaultOptions=r,n.exports.setDefaultOptions=a;var t={};function r(){return t}function a(i){t=i}}),L("kmcAT",function(n,e){A("akXK4"),A("5xozB")}),L("akXK4",function(n,e){n.exports=A("1ufAB")}),L("5xozB",function(n,e){Pr(n.exports,"IS_BROWSER_MAIN_THREAD",()=>r),Pr(n.exports,"IS_BROWSER",()=>i);var t=A("2dKjk");let r=typeof window<"u"&&typeof document<"u",a=typeof self=="object"&&typeof WorkerGlobalScope<"u",i=r||a;t!==void 0&&t.versions!=null&&t.versions.node});var me=A("5xozB");let ca="https://gudhub.com/GudHub_Test",ua="wss://gudhub.com/GudHub/ws/app/",pa="https://gudhub.com/api/services/prod",da="build/latest/async_modules_node/",fa="build/latest/automation_modules/",ha="https://gudhub.com",Cr=!0,Nr=!1,Ke=!0;me.IS_BROWSER||(Ke=!1);var me=A("5xozB");class Mr{}class $t extends Mr{constructor(e,t,r){super(),this.chunkDataService=new vt(e,Gt,r),this.gudhub=r}isWithCache(){return!1}async processRequestedApp(e,t){if(!this.isWithCache()){let r=await this.chunkDataService.getMergedChunkForIDList(e,t.chunks);return r&&(t.items_list=await this.gudhub.util.mergeChunks([r,t])),t}}}class ma{constructor(e){this.req=e}async getApp(e){return this.req.get({url:"/api/app/get",params:{app_id:e}})}}let Rr=(n,...e)=>{for(let t of e)if(t)for(let r of Object.keys(t)){let a=Object.getOwnPropertyDescriptor(t,r);a.enumerable&&Object.defineProperty(n,r,a)}};class St{}class He extends $t{constructor(e,t,r){super(e,t,r),this.appApi=new ma(e),Rr(this,new St(t))}async getApp(e){let t=await this.appApi.getApp(e);return this.processRequestedApp(e,t)}async getAppWithoutProcessing(e){return this.appApi.getApp(e)}async putApp(e,t){}static[Symbol.hasInstance](e){try{return e instanceof He||e instanceof St}catch{return!1}}}class Fr extends Mr{getMergedChunkForIDList(e){}isWithCache(){return!1}}class ga{constructor(e){this.req=e}async getChunk(e,t){return this.req.get({url:\`\${this.req.root}/api/get-items-chunk/\${e}/\${t}\`,method:"GET"})}async getLastChunk(e){return this.req.axiosRequest({url:\`\${this.req.root}/api/get-last-items-chunk/\${e}\`,method:"GET"})}}class xt extends Fr{constructor(e,t){super(),this.chunkApi=new ga(e),Rr(this,new St(t))}async getChunk(e,t){return this.chunkApi.getChunk(e,t)}async getChunksForId(e){return[]}getCachedMergedChunk(e,t){}getMergedChunkForIDList(e,t){}putChunk(){}static[Symbol.hasInstance](e){try{return e instanceof xt||e instanceof St}catch{return!1}}}let Et={store:"apps"},Ht={store:"chunks"},ya="gudhub",zt={store:"chunksMergeCache"};class _a{}class ze extends _a{constructor(e,t){if(ze.dbNameToInstanceMap||(ze.dbNameToInstanceMap=new Map),ze.dbNameToInstanceMap.has(e))return ze.dbNameToInstanceMap.get(e);this.db=null,this.dbName=e,this.storeNameList=t,ze.dbNameToInstanceMap.set(e,this)}async checkAndCreateStore(e){let t=(await indexedDB.databases()).find(i=>i.name===this.dbName),r=!1,a=this;return t&&(r=await new Promise((i,l)=>{let s=indexedDB.open(a.dbName);s.onsuccess=function(u){let o=u.target.result,p=o.objectStoreNames.contains(e);o.close(),i(p)},s.onerror=function(u){l(u.target.error)}})),!!r||new Promise((i,l)=>{let s=indexedDB.open(a.dbName,t?t.version+1:1);s.onupgradeneeded=function(u){let o=u.target.result;o.objectStoreNames.contains(e)||o.createObjectStore(e)},s.onsuccess=function(u){u.target.result.close(),i()},s.onerror=l})}async openDB(){let e,t;if(this.db)return this.db;let r=new Promise((l,s)=>{e=l,t=s});for(let l of this.storeNameList)await this.checkAndCreateStore(l);let a=this,i=indexedDB.open(this.dbName);return i.onsuccess=l=>{a.db=l.target.result,e(this.db)},i.onerror=t,r}async executeOperation(e,t){let r=await this.openDB();return new Promise((a,i)=>{let l=r.transaction(e,"readwrite"),s=l.objectStore(e);l.oncomplete=()=>a(),l.onerror=u=>i(\`Transaction failed: \${u.target.error}\`);try{t(s)}catch(u){i(\`Operation failed: \${u.message}\`)}})}}let Lr=new ze(ya,[Et.store,Ht.store,zt.store]);class Dr{constructor(e,t){this.storeBackend=e,this.storeName=t}async addItem(e,t){return new Promise(async(r,a)=>{this.storeBackend.executeOperation(this.storeName,i=>{let l=i.add(t,e);l.onsuccess=r,l.onerror=a})})}async putItem(e,t){return new Promise(async(r,a)=>{this.storeBackend.executeOperation(this.storeName,i=>{let l=i.put(t,e);l.onsuccess=r,l.onerror=a})})}async hasItem(e){try{return!!await this.getItem(e)}catch{return!1}}async getItem(e){return new Promise(async(t,r)=>{this.storeBackend.executeOperation(this.storeName,a=>{let i=a.get(e);i.onsuccess=()=>{t(i.result)},i.onerror=r})})}async updateItem(e,t){return new Promise(async(r,a)=>{this.storeBackend.executeOperation(this.storeName,i=>{let l=i.get(e);l.onsuccess=()=>{let s=l.result;Object.assign(s,t),i.put(s,e),r()},l.onerror=a})})}async deleteItem(e){return new Promise(async(t,r)=>{this.storeBackend.executeOperation(this.storeName,a=>{let i=a.delete(e);i.onsuccess=t,i.onerror=r})})}}class qr extends Dr{constructor(){super(Lr,Et.store)}async getApp(e){return this.getItem(e)}async addApp(e,t){return this.addItem(e,t)}async putApp(e,t){return this.putItem(e,t)}async hasApp(e){return this.hasItem(e)}async deleteApp(e){return this.deleteItem(e)}}class ba extends Dr{constructor(){super(Lr,zt.store)}async get(e){return this.getItem(e)}async add(e,t){return this.addItem(e,t)}async put(e,t){return this.putItem(e,t)}async delete(e){return this.deleteItem(e)}}class st extends Fr{constructor(e,t,r){super(e,t),this.dataService=new xt(e),this.requestCache=new Map,this.gudhub=r,this.storeManager=new ba}static[Symbol.hasInstance](e){try{return e instanceof st}catch{return!1}}async getCachedMergedChunk(e,t){try{return(await this.storeManager.get(e)).mergedData}catch{let a=t.map(s=>this.dataService.getChunk(e,s)),i=await Promise.all(a),l=await this.gudhub.util.mergeChunks(i);return this.putMergedChunks(e,{hashes:t,mergedData:{items_list:l}}),{items_list:l}}}isWithCache(){return!0}async getMergedChunkForApp(e){}async getMergedChunkForIDList(e,t){try{let r,a=!0,i=await this.storeManager.get(e);try{if(t.length<i.hashes.length)throw Error();for(let u of i.hashes)t.indexOf(u)!=i.hashes.indexOf(u)&&(a=!1)}catch{a=!1}let l=[],s=[];if(t.length>i.hashes.length&&(l=t.slice(i.hashes.length)),a||(l=t),l.length>0){let u=l.map(o=>this.dataService.getChunk(e,o));s=await Promise.all(u)}return a||(r=await this.gudhub.util.mergeChunks([...s])),a&&(r=await this.gudhub.util.mergeChunks([i.mergedData,...s])),l.length>0&&this.putMergedChunks(e,{hashes:t,mergedData:{items_list:r}}),{items_list:r}}catch{let a=t.map(s=>this.dataService.getChunk(e,s)),i=await Promise.all(a),l=await this.gudhub.util.mergeChunks(i);return this.putMergedChunks(e,{hashes:t,mergedData:{items_list:l}}),{items_list:l}}}async putMergedChunks(e,t){return this.storeManager.put(e,t)}}let xe={INIT:1,REQUEST_APP:2,PROCESS_DATA:3,DECLINE_PROCESS_DATA_REQUEST:4};class Vt extends $t{constructor(e,t,r){super(e,t,r),this.dataService=new He(e,t,r),this.requestCache=new Map,this.gudhub=r,this.resolveFnMap=new Map,this.appRequestAndProcessWorker=new AppRequestWorkerScript,this.appRequestAndProcessWorker.postMessage({type:xe.INIT,gudhubSerialized:this.gudhub.serialized});let a=this;this.appRequestAndProcessWorker.onerror=function(i){},this.appRequestAndProcessWorker.onmessage=function(i){i.data.type==xe.REQUEST_APP&&a.resolveFnMap.has(i.data.id)&&a.resolveFnMap.get(i.data.id)(i.data.data),i.data.type==xe.PROCESS_DATA&&(a.gudhub.itemProcessor.handleDiff(i.data.id,i.data.compareRes),(i.data.viewListChanged||i.data.fieldListChanged)&&a.gudhub.appProcessor.updateAppFieldsAndViews(i.data.newVersion))},this.isWithCache(),this.storeManager=new qr}static[Symbol.hasInstance](e){try{return e instanceof Vt}catch{return!1}}isWithCache(){return!0}async getApp(e){if(this.requestCache.has(e))return this.requestCache.get(e);let t=this;await this.has(e);{let r=new Promise((a,i)=>{t.resolveFnMap.set(e,a)});return this.requestCache.set(e,r),this.appRequestAndProcessWorker.postMessage({type:xe.REQUEST_APP,id:e}),r}}async getCached(e){return this.storeManager.getApp(e)}async has(e){try{return this.storeManager.hasApp(e)}catch{}}async putApp(e,t){return this.storeManager.putApp(e,t)}}class Br extends $t{constructor(e,t,r){super(e,t,r),this.dataService=new He(e,null,r),this.requestCache=new Map,this.gudhub=r}isWithCache(){return!1}async getAppWithoutProcessing(e){let t=await this.dataService.getAppWithoutProcessing(e);return await this.putApp(e,t),t}async getApp(e){let t;if(this.requestCache.has(e))return this.requestCache.get(e);let r=new Promise((l,s)=>{t=l});this.requestCache.set(e,r);let a=await this.dataService.getAppWithoutProcessing(e),i=await this.processRequestedApp(e,a);return t(i),i}async has(e){return!1}async getCached(e){throw Error()}async putApp(e,t){throw Error()}}class va extends $t{constructor(e,t,r){super(e,t,r),this.dataService=new He(e,t,r),this.requestCache=new Map,this.gudhub=r,this.resolveFnMap=new Map,this.appRequestAndProcessWorker=new AppRequestWorkerScript,this.appRequestAndProcessWorker.postMessage({type:xe.INIT,gudhubSerialized:this.gudhub.serialized});let a=this;this.appRequestAndProcessWorker.onerror=function(i){},this.appRequestAndProcessWorker.onmessage=function(i){i.data.type==xe.REQUEST_APP&&a.resolveFnMap.has(i.data.id)&&a.resolveFnMap.get(i.data.id)(i.data.data),i.data.type==xe.PROCESS_DATA&&(a.gudhub.itemProcessor.handleDiff(i.data.id,i.data.compareRes),(i.data.viewListChanged||i.data.fieldListChanged)&&a.gudhub.appProcessor.updateAppFieldsAndViews(i.data.newVersion))},this.isWithCache(),this.storeManager=new qr}static[Symbol.hasInstance](e){try{return e instanceof Vt}catch{return!1}}isWithCache(){return!1}async getApp(e){if(this.requestCache.has(e))return this.requestCache.get(e);let t=new Promise((r,a)=>{self.resolveFnMap.set(e,r)});return this.requestCache.set(e,t),this.appRequestAndProcessWorker.postMessage({type:xe.REQUEST_APP,id:e}),t}async getCached(e){return this.storeManager.getApp(e)}async has(e){try{return this.storeManager.hasApp(e)}catch{}}async putApp(e,t){return this.storeManager.putApp(e,t)}}A("5xozB"),me.IS_BROWSER,me.IS_BROWSER&&Ke&&(Ut=va,Tr=Et),me.IS_BROWSER||(Ut=He),Ke&&(Ur=Br),me.IS_BROWSER&&Cr&&!Ke&&(vt=st,Gt=Ht),me.IS_BROWSER&&Cr&&Ke&&(vt=st,Gt=Ht),me.IS_BROWSER||(vt=xt);let Ur=Br,wa=st;var me=A("5xozB");class Gr{constructor(e,t,r,a,i,l,s){this.storage=e,this.pipeService=t,this.req=r,this.ws=a,this.applistReceived=!1,this.activateSW=l,this.util=i,this.appListeners(),this.dataService=s,this.appRequestCache=new Map}async createNewAppApi(e){try{let t=await this.req.post({url:"/api/app/create",form:{app:JSON.stringify(e)}});return t.from_apps_list=!0,t}catch(t){return console.log(t),null}}async updateAppApi(e){try{return await this.req.post({url:"/api/app/update",form:{app:JSON.stringify(e)}})}catch(t){return console.log(t),null}}async deleteAppApi(e){try{return await this.req.post({url:"/api/app/delete",form:{app_id:e}})}catch(t){return console.log(t),null}}async getAppListApi(){try{return(await this.req.get({url:"/api/applist/get"})).apps_list.map(e=>(e.from_apps_list=!0,e))}catch(e){return console.log(e),null}}getAppListFromStorage(){return this.storage.getAppsList()}getAppFromStorage(e){let t=this.storage.getApp(e);return t&&t.field_list.length?t:null}addNewAppToStorage(e){return this.storage.getAppsList().push(e)}saveAppInStorage(e){e.items_object={};for(let r=0;r<e.items_list.length;r++){e.items_object[e.items_list[r].item_id]={};for(let a=0;a<e.items_list[r].fields.length;a++)e.items_object[e.items_list[r].item_id][e.items_list[r].fields[a].field_id]=e.items_list[r].fields[a]}let t=this.storage.getApp(e.app_id);return t?(e.from_apps_list=t.from_apps_list,e.permission=t.permission,this.storage.updateApp(e)):(e.from_apps_list=!1,this.addNewAppToStorage(e)),this.getAppFromStorage(e.app_id)}updateAppFieldsAndViews(e){let t=this.getAppFromStorage(e.app_id);e.items_list=t.items_list,e.file_list=t.file_list,e.from_apps_list=t.from_apps_list,e.items_object=t.items_object,this.storage.updateApp(e),this.pipeService.emit("gh_app_views_update",{app_id:e.app_id},e.views_list),e.field_list.forEach(r=>{this.pipeService.emit("gh_model_update",{app_id:e.app_id,field_id:r.field_id},r)})}updateAppInStorage(e){this.storage.getApp(e.app_id)?(this.storage.updateApp(e),this.pipeService.emit("gh_app_update",{app_id:e.app_id},e),this.pipeService.emit("gh_items_update",{app_id:e.app_id},e.items_list)):this.addNewAppToStorage(e)}deletingAppFromStorage(e){let t=this.storage.getAppsList();return t.forEach((r,a)=>{r.app_id==e&&t.splice(a)}),t}updateAppsListInStorage(e=[]){for(let t of e){let r=this.storage.getApp(t.app_id);r?(r.from_apps_list=t.from_apps_list,r.permission=t.permission):this.addNewAppToStorage(t)}}async refreshApps(e=[]){for(let t of e)if(t!=null)try{let r=await this.dataService.getApp(t);if(r){r.items_object={};for(let a=0;a<r.items_list.length;a++){r.items_object[r.items_list[a].item_id]={};for(let i=0;i<r.items_list[a].fields.length;i++)r.items_object[r.items_list[a].item_id][r.items_list[a].fields[i].field_id]=r.items_list[a].fields[i]}this.updateAppInStorage(r),this.pipeService.emit("gh_app_views_update",{app_id:r.app_id},r.views_list)}}catch(r){console.log(r)}console.log("Apps refreshed: ",JSON.stringify(e))}async refreshAppsList(){let e=this.getAppListFromStorage(),t=(await this.getAppListApi()).map(r=>({...r,...e.find(a=>a.app_id===r.app_id)}));this.updateAppsListInStorage(t),this.pipeService.emit("gh_apps_list_refreshed",{})}async getAppsList(){let e=this.getAppListFromStorage();if(!this.applistReceived){let t=await this.getAppListApi();if(!t)return null;this.updateAppsListInStorage(t),this.applistReceived=!0,e=t}return e}async getAppInfo(e){let t=await this.getAppsList();return t?t.find(r=>r.app_id==e):null}async deleteApp(e){return await this.deleteAppApi(e),this.deletingAppFromStorage(e)}async getApp(e,t=!1){if(!e)return null;let r=this.getAppFromStorage(e);if(r)return r;if(this.appRequestCache.has(e))return this.appRequestCache.get(e);let a=this,i=new Promise(async(l,s)=>{try{let u=await a.dataService.getApp(e);u||s();let o=t?u:{...u,items_list:u.items_list.filter(p=>!p.trash)};o=t?o:{...o,field_list:o.field_list.filter(p=>!p.trash)},l(o),a.saveAppInStorage(o),a.ws.addSubscription(e)}catch{s()}});return a.appRequestCache.set(e,i),i}async updateApp(e){if(!e.views_list||!e.views_list.length||!e.show){let r=await this.getApp(e.app_id);e.views_list&&e.views_list.length||(e.views_list=r.views_list),e.show===void 0&&(e.show=r.show)}let t=await this.updateAppApi(e);return this.updateAppFieldsAndViews(t),t}async updateAppInfo(e={}){return this.pipeService.emit("gh_app_info_update",{app_id:e.app_id},e),this.updateApp(e)}async createNewApp(e){let t=await this.createNewAppApi(e);return t.items_object={},this.addNewAppToStorage(t),t}async getAppViews(e){if(e)return(await this.getApp(e)).views_list}clearAppProcessor(){this.getAppListPromises=null,this.getAppPromises={},this.applistReceived=!1}appListeners(){this.pipeService.onRoot("gh_app_get",{},async(e,t)=>{if(t&&t.app_id){let r=await this.getApp(t.app_id);this.pipeService.emit("gh_app_get",t,r)}}),this.pipeService.onRoot("gh_apps_list_get",{},async(e,t)=>{let r=await this.getAppsList();this.pipeService.emit("gh_apps_list_get",t,r)}),this.pipeService.onRoot("gh_delete_app",{},async(e,t)=>{let r=await this.deleteApp(t.app_id);this.pipeService.emit("gh_apps_list_update",{recipient:"all"},r)}),this.pipeService.onRoot("gh_app_update",{},async(e,t)=>{t.app.items_list=[],t.app.file_list=[];let r=await this.updateApp(t.app);this.pipeService.emit("gh_app_views_update",{app_id:r.app_id},r.views_list);let a=await this.getAppsList();this.pipeService.emit("gh_apps_list_update",{recipient:"all"},a),r.field_list.forEach(i=>{this.pipeService.emit("gh_model_update",{app_id:r.app_id,field_id:i.field_id},i)})}),this.pipeService.onRoot("gh_app_view_get",{},async(e,t)=>{if(t&&t.app_id){let r=await this.getApp(t.app_id);r.views_list.forEach((a,i)=>{a.view_id==t.view_id&&this.pipeService.emit("gh_app_view_get",t,r.views_list[i])})}}),this.pipeService.onRoot("gh_app_info_get",{},async(e,t)=>{let r=await this.getAppInfo(t.app_id);r&&this.pipeService.emit("gh_app_info_get",t,r)}),this.pipeService.onRoot("gh_app_info_update",{},async(e,t)=>{if(t&&t.app){let r=await this.updateAppInfo(t.app);this.pipeService.emit("gh_app_info_update",{app_id:t.app.app_id},r)}}),this.pipeService.onRoot("gh_app_create",{},async(e,t)=>{await this.createNewApp(t.app);let r=await this.getAppsList();this.pipeService.emit("gh_apps_list_update",{recipient:"all"},r)}),me.IS_BROWSER_MAIN_THREAD&&this.activateSW&&navigator.serviceWorker.addEventListener("message",async e=>{if(e.data.type==="refresh app"){let t=await this.getApp(e.data.payload.app_id);t&&this.util.compareAppsItemsLists(t.items_list,e.data.payload.items_list.filter(r=>!r.trash),({diff_fields_items:r,diff_fields_items_Ids:a,diff_items:i,newItems:l,deletedItems:s})=>{(i.length||l.length||s.length)&&(this.pipeService.emit("gh_items_update",{app_id:e.data.payload.app_id},e.data.payload.items_list.filter(u=>!u.trash)),i.forEach(u=>this.pipeService.emit("gh_item_update",{app_id:e.data.payload.app_id,item_id:u.item_id},u))),a.forEach(u=>{let o=r[u];o&&o.forEach(p=>{this.pipeService.emit("gh_value_update",{app_id:e.data.payload.app_id,item_id:u,field_id:p.field_id},p.field_value)})})}),e.data.payload.items_list=await this.util.mergeChunks([t,e.data.payload]),this.saveAppInStorage(e.data.payload)}})}}var gt=A("akXK4");function Wr(n=[]){return n.filter(e=>e.field_value!=null)}function $a(n={}){let e=Object.entries(n);return e.length?\`&\${e.map(([t,r])=>\`\${t}=\${r}\`).join("&")}\`:""}var kt={},Hr={},Jt={},ve=A("hMrGw"),Ve={},ve=A("hMrGw"),ot={},Qt=A("hweMw"),ve=A("hMrGw"),zr={},ve=A("hMrGw"),Yt={},ct=A("hGGZx"),Sa=A("kPNod"),$e=A("b9GfH"),lt={},ve=A("hMrGw"),At=ve("%Object.getOwnPropertyDescriptor%",!0);if(At)try{At([],"length")}catch{At=null}lt=At,Yt=function(n,e,t){if(!n||typeof n!="object"&&typeof n!="function")throw new $e("\`obj\` must be an object or a function\`");if(typeof e!="string"&&typeof e!="symbol")throw new $e("\`property\` must be a string or a symbol\`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new $e("\`nonEnumerable\`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new $e("\`nonWritable\`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new $e("\`nonConfigurable\`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new $e("\`loose\`, if provided, must be a boolean");var r=arguments.length>3?arguments[3]:null,a=arguments.length>4?arguments[4]:null,i=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],s=!!lt&&lt(n,e);if(ct)ct(n,e,{configurable:i===null&&s?s.configurable:!i,enumerable:r===null&&s?s.enumerable:!r,value:t,writable:a===null&&s?s.writable:!a});else{if(!l&&(r||a||i))throw new Sa("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");n[e]=t}};var xa=A("9cNUg")(),$e=A("b9GfH"),Ea=ve("%Math.floor%");zr=function(n,e){if(typeof n!="function")throw new $e("\`fn\` is not a function");if(typeof e!="number"||e<0||e>4294967295||Ea(e)!==e)throw new $e("\`length\` must be a positive 32-bit integer");var t=arguments.length>2&&!!arguments[2],r=!0,a=!0;if("length"in n&&lt){var i=lt(n,"length");i&&!i.configurable&&(r=!1),i&&!i.writable&&(a=!1)}return(r||a||!t)&&(xa?Yt(n,"length",e,!0,!0):Yt(n,"length",e)),n};var $e=A("b9GfH"),Vr=ve("%Function.prototype.apply%"),Jr=ve("%Function.prototype.call%"),Qr=ve("%Reflect.apply%",!0)||Qt.call(Jr,Vr),ct=A("hGGZx"),ka=ve("%Math.max%");ot=function(n){if(typeof n!="function")throw new $e("a function is required");var e=Qr(Qt,Jr,arguments);return zr(e,1+ka(0,n.length-(arguments.length-1)),!0)};var Yr=function(){return Qr(Qt,Vr,arguments)};ct?ct(ot,"apply",{value:Yr}):ot.apply=Yr;var Aa=ot(ve("String.prototype.indexOf"));Ve=function(n,e){var t=ve(n,!!e);return typeof t=="function"&&Aa(n,".prototype.")>-1?ot(t):t};var Xr={},Xt=typeof Map=="function"&&Map.prototype,Kt=Object.getOwnPropertyDescriptor&&Xt?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,It=Xt&&Kt&&typeof Kt.get=="function"?Kt.get:null,Kr=Xt&&Map.prototype.forEach,Zt=typeof Set=="function"&&Set.prototype,er=Object.getOwnPropertyDescriptor&&Zt?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Ot=Zt&&er&&typeof er.get=="function"?er.get:null,Zr=Zt&&Set.prototype.forEach,Ia=typeof WeakMap=="function"&&WeakMap.prototype,ut=Ia?WeakMap.prototype.has:null,Oa=typeof WeakSet=="function"&&WeakSet.prototype,pt=Oa?WeakSet.prototype.has:null,ja=typeof WeakRef=="function"&&WeakRef.prototype,en=ja?WeakRef.prototype.deref:null,Ta=Boolean.prototype.valueOf,Pa=Object.prototype.toString,Ca=Function.prototype.toString,Na=String.prototype.match,tr=String.prototype.slice,De=String.prototype.replace,Ma=String.prototype.toUpperCase,tn=String.prototype.toLowerCase,rn=RegExp.prototype.test,nn=Array.prototype.concat,je=Array.prototype.join,Ra=Array.prototype.slice,an=Math.floor,rr=typeof BigInt=="function"?BigInt.prototype.valueOf:null,nr=Object.getOwnPropertySymbols,ar=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Ze=typeof Symbol=="function"&&typeof Symbol.iterator=="object",ye=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Ze||!0)?Symbol.toStringTag:null,sn=Object.prototype.propertyIsEnumerable,on=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(n){return n.__proto__}:null);function ln(n,e){if(n===1/0||n===-1/0||n!=n||n&&n>-1e3&&n<1e3||rn.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof n=="number"){var r=n<0?-an(-n):an(n);if(r!==n){var a=String(r),i=tr.call(e,a.length+1);return De.call(a,t,"$&_")+"."+De.call(De.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return De.call(e,t,"$&_")}var ir={},cn=ir.custom,un=fn(cn)?cn:null;function pn(n,e,t){var r=(t.quoteStyle||e)==="double"?'"':"'";return r+n+r}function Fa(n){return De.call(String(n),/"/g,"&quot;")}function sr(n){return Be(n)==="[object Array]"&&(!ye||!(typeof n=="object"&&ye in n))}function La(n){return Be(n)==="[object Date]"&&(!ye||!(typeof n=="object"&&ye in n))}function dn(n){return Be(n)==="[object RegExp]"&&(!ye||!(typeof n=="object"&&ye in n))}function Da(n){return Be(n)==="[object Error]"&&(!ye||!(typeof n=="object"&&ye in n))}function qa(n){return Be(n)==="[object String]"&&(!ye||!(typeof n=="object"&&ye in n))}function Ba(n){return Be(n)==="[object Number]"&&(!ye||!(typeof n=="object"&&ye in n))}function Ua(n){return Be(n)==="[object Boolean]"&&(!ye||!(typeof n=="object"&&ye in n))}function fn(n){if(Ze)return n&&typeof n=="object"&&n instanceof Symbol;if(typeof n=="symbol")return!0;if(!n||typeof n!="object"||!ar)return!1;try{return ar.call(n),!0}catch{}return!1}function Ga(n){if(!n||typeof n!="object"||!rr)return!1;try{return rr.call(n),!0}catch{}return!1}Xr=function n(e,t,r,a){var i=t||{};if(qe(i,"quoteStyle")&&i.quoteStyle!=="single"&&i.quoteStyle!=="double")throw TypeError('option "quoteStyle" must be "single" or "double"');if(qe(i,"maxStringLength")&&(typeof i.maxStringLength=="number"?i.maxStringLength<0&&i.maxStringLength!==1/0:i.maxStringLength!==null))throw TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or \`null\`');var l=!qe(i,"customInspect")||i.customInspect;if(typeof l!="boolean"&&l!=="symbol")throw TypeError("option \\"customInspect\\", if provided, must be \`true\`, \`false\`, or \`'symbol'\`");if(qe(i,"indent")&&i.indent!==null&&i.indent!==" "&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw TypeError('option "indent" must be "\\\\t", an integer > 0, or \`null\`');if(qe(i,"numericSeparator")&&typeof i.numericSeparator!="boolean")throw TypeError('option "numericSeparator", if provided, must be \`true\` or \`false\`');var s=i.numericSeparator;if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return mn(e,i);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var u=String(e);return s?ln(e,u):u}if(typeof e=="bigint"){var o=String(e)+"n";return s?ln(e,o):o}var p=i.depth===void 0?5:i.depth;if(r===void 0&&(r=0),r>=p&&p>0&&typeof e=="object")return sr(e)?"[Array]":"[Object]";var m=ei(i,r);if(a===void 0)a=[];else if(hn(a,e)>=0)return"[Circular]";function d(C,B,V){if(B&&(a=Ra.call(a)).push(B),V){var X={depth:i.depth};return qe(i,"quoteStyle")&&(X.quoteStyle=i.quoteStyle),n(C,X,r+1,a)}return n(C,i,r+1,a)}if(typeof e=="function"&&!dn(e)){var y=Ha(e),f=jt(e,d);return"[Function"+(y?": "+y:" (anonymous)")+"]"+(f.length>0?" { "+je.call(f,", ")+" }":"")}if(fn(e)){var S=Ze?De.call(String(e),/^(Symbol\\(.*\\))_[^)]*$/,"$1"):ar.call(e);return typeof e!="object"||Ze?S:dt(S)}if(Xa(e)){for(var v="<"+tn.call(String(e.nodeName)),w=e.attributes||[],g=0;g<w.length;g++)v+=" "+w[g].name+"="+pn(Fa(w[g].value),"double",i);return v+=">",e.childNodes&&e.childNodes.length&&(v+="..."),v+="</"+tn.call(String(e.nodeName))+">"}if(sr(e)){if(e.length===0)return"[]";var _=jt(e,d);return m&&!Za(_)?"["+lr(_,m)+"]":"[ "+je.call(_,", ")+" ]"}if(Da(e)){var $=jt(e,d);return"cause"in Error.prototype||!("cause"in e)||sn.call(e,"cause")?$.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+je.call($,", ")+" }":"{ ["+String(e)+"] "+je.call(nn.call("[cause]: "+d(e.cause),$),", ")+" }"}if(typeof e=="object"&&l){if(un&&typeof e[un]=="function"&&ir)return ir(e,{depth:p-r});if(l!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(za(e)){var x=[];return Kr&&Kr.call(e,function(C,B){x.push(d(B,e,!0)+" => "+d(C,e))}),gn("Map",It.call(e),x,m)}if(Qa(e)){var T=[];return Zr&&Zr.call(e,function(C){T.push(d(C,e))}),gn("Set",Ot.call(e),T,m)}if(Va(e))return or("WeakMap");if(Ya(e))return or("WeakSet");if(Ja(e))return or("WeakRef");if(Ba(e))return dt(d(Number(e)));if(Ga(e))return dt(d(rr.call(e)));if(Ua(e))return dt(Ta.call(e));if(qa(e))return dt(d(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(e===le)return"{ [object globalThis] }";if(!La(e)&&!dn(e)){var P=jt(e,d),D=on?on(e)===Object.prototype:e instanceof Object||e.constructor===Object,R=e instanceof Object?"":"null prototype",I=!D&&ye&&Object(e)===e&&ye in e?tr.call(Be(e),8,-1):R?"Object":"",F=(D||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"")+(I||R?"["+je.call(nn.call([],I||[],R||[]),": ")+"] ":"");return P.length===0?F+"{}":m?F+"{"+lr(P,m)+"}":F+"{ "+je.call(P,", ")+" }"}return String(e)};var Wa=Object.prototype.hasOwnProperty||function(n){return n in this};function qe(n,e){return Wa.call(n,e)}function Be(n){return Pa.call(n)}function Ha(n){if(n.name)return n.name;var e=Na.call(Ca.call(n),/^function\\s*([\\w$]+)/);return e?e[1]:null}function hn(n,e){if(n.indexOf)return n.indexOf(e);for(var t=0,r=n.length;t<r;t++)if(n[t]===e)return t;return-1}function za(n){if(!It||!n||typeof n!="object")return!1;try{It.call(n);try{Ot.call(n)}catch{return!0}return n instanceof Map}catch{}return!1}function Va(n){if(!ut||!n||typeof n!="object")return!1;try{ut.call(n,ut);try{pt.call(n,pt)}catch{return!0}return n instanceof WeakMap}catch{}return!1}function Ja(n){if(!en||!n||typeof n!="object")return!1;try{return en.call(n),!0}catch{}return!1}function Qa(n){if(!Ot||!n||typeof n!="object")return!1;try{Ot.call(n);try{It.call(n)}catch{return!0}return n instanceof Set}catch{}return!1}function Ya(n){if(!pt||!n||typeof n!="object")return!1;try{pt.call(n,pt);try{ut.call(n,ut)}catch{return!0}return n instanceof WeakSet}catch{}return!1}function Xa(n){return!!n&&typeof n=="object"&&(typeof HTMLElement<"u"&&n instanceof HTMLElement||typeof n.nodeName=="string"&&typeof n.getAttribute=="function")}function mn(n,e){if(n.length>e.maxStringLength){var t=n.length-e.maxStringLength,r="... "+t+" more character"+(t>1?"s":"");return mn(tr.call(n,0,e.maxStringLength),e)+r}return pn(De.call(De.call(n,/(['\\\\])/g,"\\\\$1"),/[\\x00-\\x1f]/g,Ka),"single",e)}function Ka(n){var e=n.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\\\"+t:"\\\\x"+(e<16?"0":"")+Ma.call(e.toString(16))}function dt(n){return"Object("+n+")"}function or(n){return n+" { ? }"}function gn(n,e,t,r){return n+" ("+e+") {"+(r?lr(t,r):je.call(t,", "))+"}"}function Za(n){for(var e=0;e<n.length;e++)if(hn(n[e],\`
98
+ let o=t?u:_objectSpread2(_objectSpread2({},u),{},{items_list:u.items_list.filter(f=>!f.trash)});o=t?o:_objectSpread2(_objectSpread2({},o),{},{field_list:o.field_list.filter(f=>!f.trash)}),s(o),i.saveAppInStorage(o),i.ws.addSubscription(e)}catch{l()}});return i.appRequestCache.set(e,a),a}async updateApp(e){if(!e.views_list||!e.views_list.length||!e.show){const r=await this.getApp(e.app_id);(!e.views_list||!e.views_list.length)&&(e.views_list=r.views_list),typeof e.show>"u"&&(e.show=r.show)}const t=await this.updateAppApi(e);return this.updateAppFieldsAndViews(t),t}async updateAppInfo(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.pipeService.emit("gh_app_info_update",{app_id:e.app_id},e),this.updateApp(e)}async createNewApp(e){const t=await this.createNewAppApi(e);return t.items_object={},this.addNewAppToStorage(t),t}async getAppViews(e){if(e)return(await this.getApp(e)).views_list}clearAppProcessor(){this.getAppListPromises=null,this.getAppPromises={},this.applistReceived=!1}appListeners(){this.pipeService.onRoot("gh_app_get",{},async(e,t)=>{if(t&&t.app_id){const r=await this.getApp(t.app_id);this.pipeService.emit("gh_app_get",t,r)}}),this.pipeService.onRoot("gh_apps_list_get",{},async(e,t)=>{const r=await this.getAppsList();this.pipeService.emit("gh_apps_list_get",t,r)}),this.pipeService.onRoot("gh_delete_app",{},async(e,t)=>{const r=await this.deleteApp(t.app_id);this.pipeService.emit("gh_apps_list_update",{recipient:"all"},r)}),this.pipeService.onRoot("gh_app_update",{},async(e,t)=>{t.app.items_list=[],t.app.file_list=[];const r=await this.updateApp(t.app);this.pipeService.emit("gh_app_views_update",{app_id:r.app_id},r.views_list);const i=await this.getAppsList();this.pipeService.emit("gh_apps_list_update",{recipient:"all"},i),r.field_list.forEach(a=>{this.pipeService.emit("gh_model_update",{app_id:r.app_id,field_id:a.field_id},a)})}),this.pipeService.onRoot("gh_app_view_get",{},async(e,t)=>{if(t&&t.app_id){const r=await this.getApp(t.app_id);r.views_list.forEach((i,a)=>{i.view_id==t.view_id&&this.pipeService.emit("gh_app_view_get",t,r.views_list[a])})}}),this.pipeService.onRoot("gh_app_info_get",{},async(e,t)=>{const r=await this.getAppInfo(t.app_id);r&&this.pipeService.emit("gh_app_info_get",t,r)}),this.pipeService.onRoot("gh_app_info_update",{},async(e,t)=>{if(t&&t.app){const r=await this.updateAppInfo(t.app);this.pipeService.emit("gh_app_info_update",{app_id:t.app.app_id},r)}}),this.pipeService.onRoot("gh_app_create",{},async(e,t)=>{await this.createNewApp(t.app);const r=await this.getAppsList();this.pipeService.emit("gh_apps_list_update",{recipient:"all"},r)}),IS_BROWSER_MAIN_THREAD&&this.activateSW&&navigator.serviceWorker.addEventListener("message",async e=>{if(e.data.type==="refresh app"){const t=await this.getApp(e.data.payload.app_id);t&&this.util.compareAppsItemsLists(t.items_list,e.data.payload.items_list.filter(r=>!r.trash),r=>{let{diff_fields_items:i,diff_fields_items_Ids:a,diff_items:s,newItems:l,deletedItems:u}=r;(s.length||l.length||u.length)&&(this.pipeService.emit("gh_items_update",{app_id:e.data.payload.app_id},e.data.payload.items_list.filter(o=>!o.trash)),s.forEach(o=>this.pipeService.emit("gh_item_update",{app_id:e.data.payload.app_id,item_id:o.item_id},o))),a.forEach(o=>{const f=i[o];f&&f.forEach(d=>{this.pipeService.emit("gh_value_update",{app_id:e.data.payload.app_id,item_id:o,field_id:d.field_id},d.field_value)})})}),e.data.payload.items_list=await this.util.mergeChunks([t,e.data.payload]),this.saveAppInStorage(e.data.payload)}})}}class ItemProcessor{constructor(e,t,r,i,a){this.storage=e,this.pipeService=t,this.req=r,this.appProcessor=i,this.util=a,this.itemListeners()}async addItemsApi(e,t){try{return await this.req.post({url:"/api/items/add",form:{items:JSON.stringify(t),app_id:e}})}catch(r){return console.log(r),null}}async updateItemsApi(e,t){try{return await this.req.post({url:"/api/items/update",form:{items:JSON.stringify(t),app_id:e}})}catch(r){return console.log(r),null}}deleteItemsApi(e){try{const t=this.req.post({url:"/api/items/delete",form:{items_ids:JSON.stringify(e)}});return t.from_apps_list=!0,t}catch(t){return console.log(t),null}}async addItemsToStorage(e,t){const r=await this.appProcessor.getApp(e);return r&&(t.forEach(i=>{r.items_list.push(i),r.items_object[i.item_id]={};for(let a=0;a<i.fields.length;a++)r.items_object[i.item_id][i.fields[a].field_id]=i.fields[a];this.pipeService.emit("gh_item_update",{app_id:e},[i])}),this.pipeService.emit("gh_items_update",{app_id:e},r.items_list),this.storage.updateApp(r)),r}async updateItemsInStorage(e,t){this.pipeService.emit("gh_items_update",{app_id:e},t);const r=await this.appProcessor.getApp(e);return r&&t&&t.forEach(i=>{const a={app_id:e};this.pipeService.emit("gh_item_update",a,[i]),a.item_id=i.item_id,this.pipeService.emit("gh_item_update",a,i);const s=r.items_list.find(l=>l.item_id==i.item_id);s&&i.fields.forEach(l=>{const u=s.fields.find(o=>o.field_id==l.field_id);a.field_id=l.field_id,u?u.field_value!=l.field_value&&(u.field_value=l.field_value,r.items_object[s.item_id][u.field_id]=u,this.pipeService.emit("gh_value_update",a,l.field_value)):(s.fields.push(l),r.items_object[s.item_id][l.field_id]=l,this.pipeService.emit("gh_value_update",a,l.field_value))})}),t}handleDiff(e,t){this.updateItemsInStorage(e,t.diff_src_items),this.addItemsToStorage(e,t.new_src_items),this.deleteItemsFromStorage(e,t.trash_src_items)}async deleteItemsFromStorage(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const r=await this.appProcessor.getApp(e);r&&(r.items_list=r.items_list.filter(i=>t.find(a=>i.item_id==a.item_id)?(delete r.items_object[i.item_id],!1):!0),this.pipeService.emit("gh_items_update",{app_id:e},r.items_list),this.storage.updateApp(r))}async getItems(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=await this.appProcessor.getApp(e,t);return r?r.items_list:null}async addNewItems(e,t){const r=t.map(a=>_objectSpread2(_objectSpread2({},a),{},{fields:filterFields(a.fields)})),i=await this.addItemsApi(e,r);return await this.addItemsToStorage(e,i),this.pipeService.emit("gh_items_add",{app_id:e},i),i}async updateItems(e,t){const r=t.map(a=>_objectSpread2(_objectSpread2({},a),{},{fields:filterFields(a.fields)})),i=await this.updateItemsApi(e,r);return await this.updateItemsInStorage(e,i)}async deleteItems(e,t){return this.deleteItemsApi(t).then(async r=>await this.deleteItemsFromStorage(e,r))}itemListeners(){this.pipeService.onRoot("gh_items_get",{},async(e,t)=>{if(t&&t.app_id){const r=await this.getItems(t.app_id);r?this.pipeService.emit("gh_items_get",t,r):this.pipeService.emit("gh_items_get",t,[])}}),this.pipeService.onRoot("gh_items_add",{},async(e,t)=>{if(t&&t.app_id&&t.items){const r=await this.addNewItems(t.app_id,t.items);r?this.pipeService.emit("gh_items_add",t,r):this.pipeService.emit("gh_items_add",t,[])}}),this.pipeService.onRoot("gh_items_update",{},async(e,t)=>{if(t&&t.app_id&&t.items){const r=await this.updateItems(t.app_id,t.items);r?this.pipeService.emit("gh_items_update",t,r):this.pipeService.emit("gh_items_update",t,[])}}),this.pipeService.onRoot("gh_item_get",{},async(e,t)=>{if(t&&t.app_id){const i=(await this.getItems(t.app_id)).find(a=>a.item_id==t.item_id);this.pipeService.emit("gh_item_get",t,i)}}),this.pipeService.onRoot("gh_filtered_items_get",{},async(e,t)=>{if(t&&t.element_app_id){const r=await this.getItems(t.element_app_id),i=await this.util.getFilteredItems(r,t.filters_list,t.element_app_id,t.app_id,t.item_id,t.field_groupe,t.search,t.search_params);this.pipeService.emit("gh_filtered_items_get",t,i)}}),this.pipeService.onRoot("gh_filter_items",{},async(e,t)=>{if(t&&t.items){const r=await this.util.getFilteredItems(t.items,t.filters_list,t.element_app_id,t.app_id,t.item_id,t.field_groupe,t.search,t.search_params);this.pipeService.emit("gh_filter_items",t,r)}})}}class FieldProcessor{constructor(e,t,r,i,a){this.storage=e,this.req=t,this.appProcessor=r,this.itemProcessor=i,this.pipeService=a,this.fieldListeners()}deleteFieldApi(e){return this.req.post({url:"/api/app/delete-field",form:{field_id:e}})}async updatedFieldApi(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=await this.appProcessor.getApp(e),i={app_id:e,app_name:r.app_name,group_id:r.group_id,icon:r.icon,field_list:r.field_list.map(a=>a.field_id==t.field_id?_objectSpread2(_objectSpread2({},a),t):a),views_list:r.views_list};return this.appProcessor.updateApp(i)}setFieldValueApi(e,t,r,i){const a=[{item_id:t,fields:[{field_id:r,field_value:i}]}];return this.itemProcessor.updateItems(e,a)}deleteFieldInStorage(e,t){const r=this.storage.getApp(e);return r.field_list=r.field_list.filter(i=>i.file_id!=t),r.items_list=r.items_list.map(i=>(i.fields=i.fields.filter(a=>a.field_id!=t),i)),this.storage.updateApp(r),!0}updateFieldInStorage(e,t){const r=this.storage.getApp(e);return r.field_list=r.field_list.map(i=>i.field_id==t.field_id?_objectSpread2(_objectSpread2({},i),t):i),this.storage.updateApp(r),t}updateFieldValue(e,t,r,i){const a=this.storage.getApp(e);return a.items_list.forEach(s=>{s.item_id==t&&s.fields.forEach(l=>{l.field_id==r&&(l.field_value=i,a.items_object[s.item_id][l.field_id]=l)})}),this.storage.updateApp(a),i}async getField(e,t){const r=await this.appProcessor.getApp(e);if(!r)return null;for(let i=0;i<r.field_list.length;i++)if(r.field_list[i].field_id==t)return r.field_list[i];return null}async getFieldIdByNameSpace(e,t){const r=await this.appProcessor.getApp(e);if(!r)return null;for(let i=0;i<r.field_list.length;i++)if(r.field_list[i].name_space==t)return r.field_list[i].field_id;return null}async getFieldModels(e){const t=await this.appProcessor.getApp(e);return t?t.field_list:null}async updateField(e,t){if(!e||!t)return;const r=await this.updatedFieldApi(e,t);return this.updateFieldInStorage(e,r)}async deleteField(e,t){return await this.deleteFieldApi(t),this.deleteFieldInStorage(e,t)}async getFieldValue(e,t,r){let i=null;const a=await this.appProcessor.getApp(e);try{i=a.items_object[t][r].field_value}catch{}return i}async setFieldValue(e,t,r,i){if(!(!e||!t||!r))return await this.setFieldValueApi(e,t,r,i),this.updateFieldValue(e,t,r,i)}fieldListeners(){this.pipeService.onRoot("gh_value_get",{},async(e,t)=>{if(t.app_id&&t.item_id&&t.field_id){let r=await this.getFieldValue(t.app_id,t.item_id,t.field_id);this.pipeService.emit("gh_value_get",t,r)}}),this.pipeService.onRoot("gh_value_set",{},async(e,t)=>{t.item_id&&(this.setFieldValue(t.app_id,t.item_id,t.field_id,t.new_value),delete t.new_value)}),this.pipeService.onRoot("gh_model_get",{},async(e,t)=>{try{let r=await this.getField(t.app_id,t.field_id);this.pipeService.emit("gh_model_get",t,r)}catch(r){console.log("Field model: ",r)}}),this.pipeService.onRoot("gh_model_update",{},async(e,t)=>{let r=await this.updateField(t.app_id,t.field_model);this.pipeService.emit("gh_model_update",{app_id:t.app_id,field_id:t.field_id},r)}),this.pipeService.onRoot("gh_models_get",{},async(e,t)=>{let r=await this.getFieldModels(t.app_id);this.pipeService.emit("gh_models_get",t,r)}),this.pipeService.onRoot("gh_model_delete",{},async(e,t)=>{let r=await this.deleteField(t.app_id,t.field_id);this.pipeService.emit("gh_model_delete",t,r)})}}class FileManager{constructor(e,t,r,i){this.storage=e,this.pipeService=t,this.req=r,this.appProcessor=i}async uploadFileApi(e,t,r){try{const i={"file-0":e,app_id:t,item_id:r};return await this.req.post({url:"/file/formupload",form:i})}catch(i){return console.log(i),null}}async uploadFileFromStringApi(e){try{return await this.req.post({url:"/file/upload",form:{file:JSON.stringify(e)}})}catch(t){return console.log(t),null}}async updateFileFromStringApi(e,t,r,i,a,s,l){try{const u={file_name:r,extension:i,file_id:t,format:a,source:e,alt:s,title:l};return await this.req.post({url:"/file/update",form:{file:JSON.stringify(u)}})}catch(u){return console.log(u),null}}async duplicateFileApi(e){return this.req.post({url:"/api/new/file/duplicate",headers:{"Content-Type":"application/x-www-form-urlencoded"},form:{files:JSON.stringify(e)}})}async downloadFileFromString(e,t){if(await this.isFileExists(e,t)){let r=await this.getFile(e,t),i=await this.req.get({url:r.url+"?timestamp="+r.last_update,externalResource:!0});return{file:r,data:i,type:"file"}}else return!1}async duplicateFile(e){let t=await this.duplicateFileApi(e);return t.forEach(r=>{this.addFileToStorage(r.app_id,r)}),t}async deleteFileApi(e){try{return await this.req.get({url:"/file/delete?file_id=".concat(e)})}catch(t){return console.log(t),null}}addFileToStorage(e,t){const r=this.storage.getApp(e);r&&(r.file_list.push(t),this.storage.updateApp(r),this.pipeService.emit("gh_file_upload",{app_id:e,item_id:t.item_id,file_id:t.file_id},t))}addFilesToStorage(e,t){const r=this.storage.getApp(e);r&&(r.file_list.push(...t),this.storage.updateApp(r),t.forEach(i=>{this.pipeService.emit("gh_file_upload",{app_id:e,item_id:i.item_id,file_id:i.file_id},i)}))}deleteFileFromStorage(e,t){const r=this.storage.getApp(t);if(r){let i;r.file_list=r.file_list.filter(a=>a.file_id!=e?!0:(i=a,!1)),this.storage.updateApp(r),this.pipeService.emit("gh_file_delete",{file_id:e},i)}}updateFileInStorage(e,t,r){const i=this.storage.getApp(t);i&&(i.file_list=i.file_list.map(a=>a.file_id==e?r:a),this.storage.updateApp(i),this.pipeService.emit("gh_file_update",{file_id:e}))}async getFile(e,t){const r=await this.appProcessor.getApp(e);return new Promise((i,a)=>{let s=r.file_list.find(l=>l.file_id==t);i(s||"")})}async getFiles(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const r=await this.appProcessor.getApp(e);return new Promise((i,a)=>{let s=r.file_list.filter(l=>t.some(u=>u==l.file_id));i(s||"")})}async uploadFile(e,t,r){const i=await this.uploadFileApi(e,t,r);return this.addFileToStorage(t,i),i}async uploadFileFromString(e){const t=await this.uploadFileFromStringApi(e);return this.addFileToStorage(t.app_id,t),t}async updateFileFromString(e,t,r,i,a,s,l){const u=await this.updateFileFromStringApi(e,t,r,i,a,s,l);return this.updateFileInStorage(t,u.app_id,u),u}async deleteFile(e,t){return await this.deleteFileApi(e),this.deleteFileFromStorage(e,t),!0}async isFileExists(e,t){let r=/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/;if(t){let i=await this.getFile(e,t);return i?r.test(i.url):!1}else return!1}}class DocumentManager{constructor(e,t){this.req=e,this.pipeService=t}createDocument(e){return this.emitDocumentInsert(e),this.req.post({url:"/api/new/document/insert-one",headers:{"Content-Type":"application/x-www-form-urlencoded"},form:{document:JSON.stringify(e)}})}emitDocumentInsert(e){const t=typeof e.data=="string"?JSON.parse(e.data):e.data;this.pipeService.emit("gh_document_insert_one",{app_id:e.app_id,item_id:e.item_id,element_id:e.element_id},t)}getDocument(e){return this.req.post({url:"/api/new/document/find-one",headers:{"Content-Type":"application/x-www-form-urlencoded"},form:{document:JSON.stringify(e)}})}getDocuments(e){return this.req.post({url:"/api/new/document/find",headers:{"Content-Type":"application/x-www-form-urlencoded"},form:{document:JSON.stringify(e)}})}deleteDocument(e){return this.req.post({url:"/api/new/document/remove-one",headers:{"Content-Type":"application/x-www-form-urlencoded"},form:{document:JSON.stringify(e)}})}}class Interpritate{constructor(e){this.gudhub=e}async getInterpretationObj(e,t,r,i,a,s){var l=[],u=t.data_model.interpretation.find(function(d){return d.src==r})||t.data_model.interpretation.find(function(d){return d.src=="table"})||{id:"default"},o=u;if(e.data_model&&e.data_model.interpretation){for(var f=0;f<e.data_model.interpretation.length;f++)(e.data_model.interpretation[f].src==r||e.data_model.interpretation[f].src==i)&&l.push(e.data_model.interpretation[f]);for(var f=0;f<l.length;f++)if(l[f].settings&&l[f].settings.condition_filter&&l[f].settings.filters_list.length>0){const h=await gudhub.getItem(s,a);if(h&&gudhub.filter([h],l[f].settings.filters_list).length>0){o=l[f];break}}else o=gudhub.mergeObjects(o,l[f])}return o}getInterpretation(e,t,r,i,a,s,l){const u=this;return new Promise(async(o,f)=>{var d=t&&t.data_type?t.data_type:r;d?gudhub.ghconstructor.getInstance(d).then(async function(h){if(h){var y=await u.getInterpretationObj(t,h.getTemplate().model,i,l,a,s);h.getInterpretation(e,y.id,d,t,a,s).then(function(m){o(gudhub.mergeObjects(m,y))},function(m){f()})}},function(h){}):console.error("Get Interpretation: data_type is undefined",r,t)})}async getInterpretationById(e,t,r,i){let a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:null,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:null,l=a??await this.gudhub.getFieldValue(e,t,r),u=s??await this.gudhub.getField(e,r);if(u==null)return"";const f=await(await this.gudhub.ghconstructor.getInstance(u.data_type)).getInterpretation(l,i,u.data_type,u,t,e);return f.html=="<span>no interpretation</span>"?l:f.html}}function WebsocketHandler(n,e){switch(e.api){case"/items/update":console.log("/items/update - ",e),n.itemProcessor.updateItemsInStorage(e.app_id,e.response);break;case"/items/add":console.log("/items/add - ",e),n.itemProcessor.addItemsToStorage(e.app_id,e.response);break;case"/items/delete":console.log("/items/delete - ",e),n.itemProcessor.deleteItemsFromStorage(e.app_id,e.response);break;case"/app/update":console.log("/app/update - ",e),n.appProcessor.updateAppFieldsAndViews(e.response);break;case"/file/delete":console.log("file/delete - ",e),n.fileManager.deleteFileFromStorage(e.response.file_id,e.app_id);break;case"/file/upload":console.log("file/upload - ",e),n.fileManager.addFileToStorage(e.app_id,e.response);break;case"/file/formupload":console.log("file/formupload - ",e);break;case"/file/update":n.fileManager.updateFileInStorage(e.response.file_id,e.response.app_id,e.response),console.log("file/update - ",e);break;case"/new/file/duplicate":n.fileManager.addFilesToStorage(e.app_id,e.response),console.log("new/file/duplicate - ",e);break;case"/api/new/document/insert-one":n.documentManager.emitDocumentInsert(e.response),console.log("/api/new/document/insert-one - ",e);break;case"/ws/emit-to-user":console.log("/ws/emit-to-user - ",e);break;case"/ws/broadcast-to-app-subscribers":console.log("/ws/broadcast-to-app-subscribers - ",e);const t=JSON.parse(e.response);if(!t.data_type)return;n.ghconstructor.getInstance(t.data_type).then(r=>{r.onMessage(e.app_id,e.user_id,t)});break;default:console.warn("WEBSOCKETS is not process this API:",e.api)}}class GroupManager{constructor(e,t){this.req=t,this.gudhub=e}async createGroupApi(e){try{const t={token:await this.gudhub.auth.getToken(),group_name:e};return await this.req.post({url:"/api/sharing-group/create-group",form:t})}catch(t){return console.log(t),null}}async updateGroupApi(e,t){try{const r={token:await this.gudhub.auth.getToken(),group_name:t,group_id:e};return await this.req.post({url:"/api/sharing-group/update-group",form:r})}catch(r){return console.log(r),null}}async deleteGroupApi(e){try{const t={token:await this.gudhub.auth.getToken(),group_id:e};return await this.req.post({url:"/api/sharing-group/delete-group",form:t})}catch(t){return console.log(t),null}}async addUserToGroupApi(e,t,r){try{const i={token:await this.gudhub.auth.getToken(),group_id:e,user_id:t,group_permission:r};return await this.req.post({url:"/api/sharing-group/add-user-to-group",form:i})}catch(i){return console.log(i),null}}async getUsersByGroupApi(e){try{const t={token:await this.gudhub.auth.getToken(),group_id:e};return await this.req.post({url:"/api/sharing-group/get-users-by-group",form:t})}catch(t){return console.log(t),null}}async updateUserInGroupApi(e,t,r){try{const i={token:await this.gudhub.auth.getToken(),user_id:e,group_id:t,group_permission:r};return await this.req.post({url:"/api/sharing-group/update-user-in-group",form:i})}catch(i){return console.log(i),null}}async deleteUserFromGroupApi(e,t){try{const r={token:await this.gudhub.auth.getToken(),user_id:e,group_id:t};return await this.req.post({url:"/api/sharing-group/delete-user-from-group",form:r})}catch(r){return console.log(r),null}}async getGroupsByUserApi(e){try{const t={token:await this.gudhub.auth.getToken(),user_id:e};return await this.req.post({url:"/api/sharing-group/get-groups-by-user",form:t})}catch(t){return console.log(t),null}}}class AppGroupSharing{constructor(e,t){this.req=t,this.gudhub=e}async addAppToGroupApi(e,t,r){try{const i={token:await this.gudhub.auth.getToken(),app_id:e,group_id:t,app_permission:r};return await this.req.post({url:"/api/sharing-group/add-app-to-group",form:i})}catch(i){return console.log(i),null}}async getAppsByGroupApi(e){try{const t={token:await this.gudhub.auth.getToken(),group_id:e};return await this.req.post({url:"/api/sharing-group/get-apps-by-group",form:t})}catch(t){return console.log(t),null}}async updateAppInGroupApi(e,t,r){try{const i={token:await this.gudhub.auth.getToken(),group_id:t,app_id:e,app_permission:r};return await this.req.post({url:"/api/sharing-group/update-app-in-group",form:i})}catch(i){return console.log(i),null}}async deleteAppFromGroupApi(e,t,r){try{const i={token:await this.gudhub.auth.getToken(),group_id:t,app_id:e,app_permission:r};return await this.req.post({url:"/api/sharing-group/delete-app-from-group",form:i})}catch(i){return console.log(i),null}}async getGroupsByAppApi(e){try{const t={token:await this.gudhub.auth.getToken(),app_id:e};return await this.req.post({url:"/api/sharing-group/get-groups-by-app",form:t})}catch(t){return console.log(t),null}}}class GroupSharing{constructor(e,t,r){this.req=t,this.gudhub=e,this.pipeService=r,this.groupManager=new GroupManager(e,t),this.appGroupSharing=new AppGroupSharing(e,t)}createGroup(e){return this.groupManager.createGroupApi(e)}updateGroup(e,t){return this.groupManager.updateGroupApi(e,t)}deleteGroup(e){return this.groupManager.deleteGroupApi(e)}async addUserToGroup(e,t,r){let i=await this.groupManager.addUserToGroupApi(e,t,r);return this.pipeService.emit("group_members_add",{app_id:"group_sharing"},i),i}getUsersByGroup(e){return this.groupManager.getUsersByGroupApi(e)}async updateUserInGroup(e,t,r){let i=await this.groupManager.updateUserInGroupApi(e,t,r);return this.pipeService.emit("group_members_update",{app_id:"group_sharing"},i),i}async deleteUserFromGroup(e,t){let r=await this.groupManager.deleteUserFromGroupApi(e,t);return this.pipeService.emit("group_members_delete",{app_id:"group_sharing"},r),r}getGroupsByUser(e){return this.groupManager.getGroupsByUserApi(e)}addAppToGroup(e,t,r){return this.appGroupSharing.addAppToGroupApi(e,t,r)}getAppsByGroup(e){return this.appGroupSharing.getAppsByGroupApi(e)}updateAppInGroup(e,t,r){return this.appGroupSharing.updateAppInGroupApi(e,t,r)}deleteAppFromGroup(e,t,r){return this.appGroupSharing.deleteAppFromGroupApi(e,t,r)}getGroupsByApp(e){return this.appGroupSharing.getGroupsByAppApi(e)}}class Sharing{constructor(e,t){this.req=t,this.gudhub=e}async add(e,t,r){try{const i={token:await this.gudhub.auth.getToken(),app_id:e,user_id:t,sharing_permission:r};return await this.req.post({url:"/sharing/add",form:i})}catch(i){return console.log(i),null}}async update(e,t,r){try{const i={token:await this.gudhub.auth.getToken(),app_id:e,user_id:t,sharing_permission:r};return await this.req.post({url:"/sharing/update",form:i})}catch(i){return console.log(i),null}}async delete(e,t){try{const r={token:await this.gudhub.auth.getToken(),app_id:e,user_id:t};return await this.req.post({url:"/sharing/delete",form:r})}catch(r){return console.log(r),null}}async getAppUsers(e){try{const t={token:await this.gudhub.auth.getToken(),app_id:e};return await this.req.post({url:"/sharing/get-app-users",form:t})}catch(t){return console.log(t),null}}async addInvitation(e,t){try{const r={token:await this.gudhub.auth.getToken(),guests_emails:e,apps:t};return await this.req.post({url:"/api/invitation/add",form:r})}catch(r){return console.log(r),null}}}class WebSocketEmitter{constructor(e){this.gudhub=e}async emitToUser(e,t){const r={user_id:e,data:typeof t=="object"?JSON.stringify(t):t};return await this.gudhub.req.post({url:"/ws/emit-to-user",form:r})}async broadcastToAppSubscribers(e,t,r){const i={app_id:e,data:JSON.stringify({data_type:t,data:r})};return await this.gudhub.req.post({url:"/ws/broadcast-to-app-subscribers",form:i})}}class DataService{}let AppDataService$1=class extends DataService{constructor(e,t,r){super(),this.chunkDataService=new ChunkDataService(e,chunkDataServiceConf,r),this.gudhub=r}isWithCache(){return!1}async processRequestedApp(e,t){if(!this.isWithCache()){let r=await this.chunkDataService.getMergedChunkForIDList(e,t.chunks);return r&&(t.items_list=await this.gudhub.util.mergeChunks([r,t])),t}}};class AppAPI{constructor(e){this.req=e}async getApp(e){return this.req.get({url:"/api/app/get",params:{app_id:e}})}}let objectAssignWithOverride=function(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];for(let i of t)if(i)for(let a of Object.keys(i)){const s=Object.getOwnPropertyDescriptor(i,a);s.enumerable&&Object.defineProperty(n,a,s)}};class HttpService{}class AppHttpService extends AppDataService$1{constructor(e,t,r){super(e,t,r),this.appApi=new AppAPI(e);let i=new HttpService(t);objectAssignWithOverride(this,i)}async getApp(e){let t=await this.appApi.getApp(e);return this.processRequestedApp(e,t)}async getAppWithoutProcessing(e){return this.appApi.getApp(e)}async putApp(e,t){}static[Symbol.hasInstance](e){try{return e instanceof AppHttpService||e instanceof HttpService}catch{return!1}}}let ChunkDataService$1=class extends DataService{getMergedChunkForIDList(e){}isWithCache(){return!1}};class ChunkAPI{constructor(e){this.req=e}async getChunk(e,t){return this.req.get({url:"".concat(this.req.root,"/api/get-items-chunk/").concat(e,"/").concat(t),method:"GET"})}async getLastChunk(e){return this.req.axiosRequest({url:"".concat(this.req.root,"/api/get-last-items-chunk/").concat(e),method:"GET"})}}class ChunkHttpService extends ChunkDataService$1{constructor(e,t){super(),this.chunkApi=new ChunkAPI(e);let r=new HttpService(t);objectAssignWithOverride(this,r)}async getChunk(e,t){return this.chunkApi.getChunk(e,t)}async getChunksForId(e){return[]}getCachedMergedChunk(e,t){}getMergedChunkForIDList(e,t){}putChunk(){}static[Symbol.hasInstance](e){try{return e instanceof ChunkHttpService||e instanceof HttpService}catch{return!1}}}const appsConf={store:"apps"},chunksConf={store:"chunks"},dbName="gudhub",chunksMergeConf={store:"chunksMergeCache"};class StoreBackend{}class IndexedDBManager extends StoreBackend{constructor(e,t){if(super(),IndexedDBManager.dbNameToInstanceMap||(IndexedDBManager.dbNameToInstanceMap=new Map),IndexedDBManager.dbNameToInstanceMap.has(e))return IndexedDBManager.dbNameToInstanceMap.get(e);this.db=null,this.dbName=e,this.storeNameList=t,IndexedDBManager.dbNameToInstanceMap.set(e,this)}async checkAndCreateStore(e){const r=(await indexedDB.databases()).find(s=>s.name===this.dbName);let i=!1,a=this;return r&&(i=await new Promise((s,l)=>{const u=indexedDB.open(a.dbName);u.onsuccess=function(o){const f=o.target.result,d=f.objectStoreNames.contains(e);f.close(),s(d)},u.onerror=function(o){l(o.target.error)}})),i?!0:new Promise((s,l)=>{const u=indexedDB.open(a.dbName,r?r.version+1:1);u.onupgradeneeded=function(o){const f=o.target.result;f.objectStoreNames.contains(e)||f.createObjectStore(e)},u.onsuccess=function(o){o.target.result.close(),s()},u.onerror=l})}async openDB(){if(this.db)return this.db;let e,t,r=new Promise((s,l)=>{e=s,t=l});for(let s of this.storeNameList)await this.checkAndCreateStore(s);let i=this;const a=indexedDB.open(this.dbName);return a.onsuccess=s=>{i.db=s.target.result,e(this.db)},a.onerror=t,r}async executeOperation(e,t){let r=await this.openDB();return new Promise((i,a)=>{const s=r.transaction(e,"readwrite"),l=s.objectStore(e);s.oncomplete=()=>i(),s.onerror=u=>a("Transaction failed: ".concat(u.target.error));try{t(l)}catch(u){a("Operation failed: ".concat(u.message))}})}}const indexedDBStoreBackendSingleton=new IndexedDBManager(dbName,[appsConf.store,chunksConf.store,chunksMergeConf.store]);class BaseStoreManager{constructor(e,t){this.storeBackend=e,this.storeName=t}async addItem(e,t){return new Promise(async(r,i)=>{this.storeBackend.executeOperation(this.storeName,a=>{const s=a.add(t,e);s.onsuccess=r,s.onerror=i})})}async putItem(e,t){return new Promise(async(r,i)=>{this.storeBackend.executeOperation(this.storeName,a=>{const s=a.put(t,e);s.onsuccess=r,s.onerror=i})})}async hasItem(e){try{return!!await this.getItem(e)}catch{return!1}}async getItem(e){return new Promise(async(t,r)=>{this.storeBackend.executeOperation(this.storeName,i=>{const a=i.get(e);a.onsuccess=()=>{const s=a.result;t(s)},a.onerror=r})})}async updateItem(e,t){return new Promise(async(r,i)=>{this.storeBackend.executeOperation(this.storeName,a=>{const s=a.get(e);s.onsuccess=()=>{const l=s.result;Object.assign(l,t),a.put(l,e),r()},s.onerror=i})})}async deleteItem(e){return new Promise(async(t,r)=>{this.storeBackend.executeOperation(this.storeName,i=>{const a=i.delete(e);a.onsuccess=t,a.onerror=r})})}}class AppStoreManager extends BaseStoreManager{constructor(){super(indexedDBStoreBackendSingleton,appsConf.store)}async getApp(e){return this.getItem(e)}async addApp(e,t){return this.addItem(e,t)}async putApp(e,t){return this.putItem(e,t)}async hasApp(e){return this.hasItem(e)}async deleteApp(e){return this.deleteItem(e)}}class MergedChunksStoreManager extends BaseStoreManager{constructor(){super(indexedDBStoreBackendSingleton,chunksMergeConf.store)}async get(e){return this.getItem(e)}async add(e,t){return this.addItem(e,t)}async put(e,t){return this.putItem(e,t)}async delete(e){return this.deleteItem(e)}}class IndexedDBChunkService extends ChunkDataService$1{constructor(e,t,r){super(e,t),this.dataService=new ChunkHttpService(e),this.requestCache=new Map,this.gudhub=r,this.storeManager=new MergedChunksStoreManager}static[Symbol.hasInstance](e){try{return e instanceof IndexedDBChunkService}catch{return!1}}async getCachedMergedChunk(e,t){try{return(await this.storeManager.get(e)).mergedData}catch{const i=t.map(l=>this.dataService.getChunk(e,l)),a=await Promise.all(i);let s=await this.gudhub.util.mergeChunks(a);return this.putMergedChunks(e,{hashes:t,mergedData:{items_list:s}}),{items_list:s}}}isWithCache(){return!0}async getMergedChunkForApp(e){}async getMergedChunkForIDList(e,t){try{let r=!0,i=await this.storeManager.get(e);try{if(t.length<i.hashes.length)throw new Error;for(let u of i.hashes)t.indexOf(u)!=i.hashes.indexOf(u)&&(r=!1)}catch{r=!1}let a=[],s=[];if(t.length>i.hashes.length&&(a=t.slice(i.hashes.length)),r||(a=t),a.length>0){const u=a.map(o=>this.dataService.getChunk(e,o));s=await Promise.all(u)}let l;return r||(l=await this.gudhub.util.mergeChunks([...s])),r&&(l=await this.gudhub.util.mergeChunks([i.mergedData,...s])),a.length>0&&this.putMergedChunks(e,{hashes:t,mergedData:{items_list:l}}),{items_list:l}}catch{const i=t.map(l=>this.dataService.getChunk(e,l)),a=await Promise.all(i);let s=await this.gudhub.util.mergeChunks(a);return this.putMergedChunks(e,{hashes:t,mergedData:{items_list:s}}),{items_list:s}}}async putMergedChunks(e,t){return this.storeManager.put(e,t)}}const jsContent=`(function(){"use strict";(()=>{let Ut,vt,Tr,Gt;var le=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};function G(n){return n&&n.__esModule?n.default:n}function Pr(n,e,t,r){Object.defineProperty(n,e,{get:t,set:r,enumerable:!0,configurable:!0})}var Wt={},wt={},A=le.parcelRequire94c2;A==null&&((A=function(n){if(n in Wt)return Wt[n].exports;if(n in wt){var e=wt[n];delete wt[n];var t={id:n,exports:{}};return Wt[n]=t,e.call(t.exports,t,t.exports),t.exports}var r=Error("Cannot find module '"+n+"'");throw r.code="MODULE_NOT_FOUND",r}).register=function(n,e){wt[n]=e},le.parcelRequire94c2=A);var L=A.register;L("1ufAB",function(n,e){var t=A("iEaqd"),r=A("iNZzY"),a=A("2VbXH"),i=A("6Mx50");function l(u){var o=new a(u),p=r(a.prototype.request,o);return t.extend(p,a.prototype,o),t.extend(p,o),p}var s=l(A("bM4se"));s.Axios=a,s.create=function(u){return l(i(s.defaults,u))},s.Cancel=A("g2liO"),s.CancelToken=A("14PRn"),s.isCancel=A("8kGOw"),s.all=function(u){return Promise.all(u)},s.spread=A("i3hBo"),s.isAxiosError=A("dhYWP"),n.exports=s,n.exports.default=s}),L("iEaqd",function(n,e){var t=A("iNZzY"),r=Object.prototype.toString;function a(I){return r.call(I)==="[object Array]"}function i(I){return I===void 0}function l(I){return I!==null&&!i(I)&&I.constructor!==null&&!i(I.constructor)&&typeof I.constructor.isBuffer=="function"&&I.constructor.isBuffer(I)}function s(I){return r.call(I)==="[object ArrayBuffer]"}function u(I){return typeof FormData<"u"&&I instanceof FormData}function o(I){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(I):I&&I.buffer&&I.buffer instanceof ArrayBuffer}function p(I){return typeof I=="string"}function m(I){return typeof I=="number"}function d(I){return I!==null&&typeof I=="object"}function y(I){if(r.call(I)!=="[object Object]")return!1;var F=Object.getPrototypeOf(I);return F===null||F===Object.prototype}function f(I){return r.call(I)==="[object Date]"}function S(I){return r.call(I)==="[object File]"}function v(I){return r.call(I)==="[object Blob]"}function w(I){return r.call(I)==="[object Function]"}function g(I){return d(I)&&w(I.pipe)}function _(I){return typeof URLSearchParams<"u"&&I instanceof URLSearchParams}function $(I){return I.trim?I.trim():I.replace(/^\\s+|\\s+$/g,"")}function x(){return(typeof navigator>"u"||navigator.product!=="ReactNative"&&navigator.product!=="NativeScript"&&navigator.product!=="NS")&&typeof window<"u"&&typeof document<"u"}function T(I,F){if(I!=null)if(typeof I!="object"&&(I=[I]),a(I))for(var C=0,B=I.length;C<B;C++)F.call(null,I[C],C,I);else for(var V in I)Object.prototype.hasOwnProperty.call(I,V)&&F.call(null,I[V],V,I)}function P(){var I={};function F(V,X){y(I[X])&&y(V)?I[X]=P(I[X],V):y(V)?I[X]=P({},V):a(V)?I[X]=V.slice():I[X]=V}for(var C=0,B=arguments.length;C<B;C++)T(arguments[C],F);return I}function D(I,F,C){return T(F,function(B,V){C&&typeof B=="function"?I[V]=t(B,C):I[V]=B}),I}function R(I){return I.charCodeAt(0)===65279&&(I=I.slice(1)),I}n.exports={isArray:a,isArrayBuffer:s,isBuffer:l,isFormData:u,isArrayBufferView:o,isString:p,isNumber:m,isObject:d,isPlainObject:y,isUndefined:i,isDate:f,isFile:S,isBlob:v,isFunction:w,isStream:g,isURLSearchParams:_,isStandardBrowserEnv:x,forEach:T,merge:P,extend:D,trim:$,stripBOM:R}}),L("iNZzY",function(n,e){n.exports=function(t,r){return function(){for(var a=Array(arguments.length),i=0;i<a.length;i++)a[i]=arguments[i];return t.apply(r,a)}}}),L("2VbXH",function(n,e){var t=A("iEaqd"),r=A("gWG2h"),a=A("4m3Da"),i=A("d4try"),l=A("6Mx50"),s=A("hiYAY"),u=s.validators;function o(p){this.defaults=p,this.interceptors={request:new a,response:new a}}o.prototype.request=function(p){typeof p=="string"?(p=arguments[1]||{},p.url=arguments[0]):p=p||{},(p=l(this.defaults,p)).method?p.method=p.method.toLowerCase():this.defaults.method?p.method=this.defaults.method.toLowerCase():p.method="get";var m,d=p.transitional;d!==void 0&&s.assertOptions(d,{silentJSONParsing:u.transitional(u.boolean,"1.0.0"),forcedJSONParsing:u.transitional(u.boolean,"1.0.0"),clarifyTimeoutError:u.transitional(u.boolean,"1.0.0")},!1);var y=[],f=!0;this.interceptors.request.forEach(function($){(typeof $.runWhen!="function"||$.runWhen(p)!==!1)&&(f=f&&$.synchronous,y.unshift($.fulfilled,$.rejected))});var S=[];if(this.interceptors.response.forEach(function($){S.push($.fulfilled,$.rejected)}),!f){var v=[i,void 0];for(Array.prototype.unshift.apply(v,y),v=v.concat(S),m=Promise.resolve(p);v.length;)m=m.then(v.shift(),v.shift());return m}for(var w=p;y.length;){var g=y.shift(),_=y.shift();try{w=g(w)}catch($){_($);break}}try{m=i(w)}catch($){return Promise.reject($)}for(;S.length;)m=m.then(S.shift(),S.shift());return m},o.prototype.getUri=function(p){return r((p=l(this.defaults,p)).url,p.params,p.paramsSerializer).replace(/^\\?/,"")},t.forEach(["delete","get","head","options"],function(p){o.prototype[p]=function(m,d){return this.request(l(d||{},{method:p,url:m,data:(d||{}).data}))}}),t.forEach(["post","put","patch"],function(p){o.prototype[p]=function(m,d,y){return this.request(l(y||{},{method:p,url:m,data:d}))}}),n.exports=o}),L("gWG2h",function(n,e){var t=A("iEaqd");function r(a){return encodeURIComponent(a).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}n.exports=function(a,i,l){if(!i)return a;if(l)s=l(i);else if(t.isURLSearchParams(i))s=i.toString();else{var s,u=[];t.forEach(i,function(p,m){p!=null&&(t.isArray(p)?m+="[]":p=[p],t.forEach(p,function(d){t.isDate(d)?d=d.toISOString():t.isObject(d)&&(d=JSON.stringify(d)),u.push(r(m)+"="+r(d))}))}),s=u.join("&")}if(s){var o=a.indexOf("#");o!==-1&&(a=a.slice(0,o)),a+=(a.indexOf("?")===-1?"?":"&")+s}return a}}),L("4m3Da",function(n,e){var t=A("iEaqd");function r(){this.handlers=[]}r.prototype.use=function(a,i,l){return this.handlers.push({fulfilled:a,rejected:i,synchronous:!!l&&l.synchronous,runWhen:l?l.runWhen:null}),this.handlers.length-1},r.prototype.eject=function(a){this.handlers[a]&&(this.handlers[a]=null)},r.prototype.forEach=function(a){t.forEach(this.handlers,function(i){i!==null&&a(i)})},n.exports=r}),L("d4try",function(n,e){var t=A("iEaqd"),r=A("gu59S"),a=A("8kGOw"),i=A("bM4se");function l(s){s.cancelToken&&s.cancelToken.throwIfRequested()}n.exports=function(s){return l(s),s.headers=s.headers||{},s.data=r.call(s,s.data,s.headers,s.transformRequest),s.headers=t.merge(s.headers.common||{},s.headers[s.method]||{},s.headers),t.forEach(["delete","get","head","post","put","patch","common"],function(u){delete s.headers[u]}),(s.adapter||i.adapter)(s).then(function(u){return l(s),u.data=r.call(s,u.data,u.headers,s.transformResponse),u},function(u){return!a(u)&&(l(s),u&&u.response&&(u.response.data=r.call(s,u.response.data,u.response.headers,s.transformResponse))),Promise.reject(u)})}}),L("gu59S",function(n,e){var t=A("iEaqd"),r=A("bM4se");n.exports=function(a,i,l){var s=this||r;return t.forEach(l,function(u){a=u.call(s,a,i)}),a}}),L("bM4se",function(n,e){var t=A("2dKjk"),r=A("iEaqd"),a=A("4xE2z"),i=A("9na6w"),l={"Content-Type":"application/x-www-form-urlencoded"};function s(p,m){!r.isUndefined(p)&&r.isUndefined(p["Content-Type"])&&(p["Content-Type"]=m)}function u(p,m,d){if(r.isString(p))try{return(m||JSON.parse)(p),r.trim(p)}catch(y){if(y.name!=="SyntaxError")throw y}return(0,JSON.stringify)(p)}var o={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:function(){var p;return(typeof XMLHttpRequest<"u"||t!==void 0&&Object.prototype.toString.call(t)==="[object process]")&&(p=A("kHaX1")),p}(),transformRequest:[function(p,m){return a(m,"Accept"),a(m,"Content-Type"),r.isFormData(p)||r.isArrayBuffer(p)||r.isBuffer(p)||r.isStream(p)||r.isFile(p)||r.isBlob(p)?p:r.isArrayBufferView(p)?p.buffer:r.isURLSearchParams(p)?(s(m,"application/x-www-form-urlencoded;charset=utf-8"),p.toString()):r.isObject(p)||m&&m["Content-Type"]==="application/json"?(s(m,"application/json"),u(p)):p}],transformResponse:[function(p){var m=this.transitional,d=m&&m.silentJSONParsing,y=m&&m.forcedJSONParsing,f=!d&&this.responseType==="json";if(f||y&&r.isString(p)&&p.length)try{return JSON.parse(p)}catch(S){if(f)throw S.name==="SyntaxError"?i(S,this,"E_JSON_PARSE"):S}return p}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(p){return p>=200&&p<300}};o.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],function(p){o.headers[p]={}}),r.forEach(["post","put","patch"],function(p){o.headers[p]=r.merge(l)}),n.exports=o}),L("2dKjk",function(n,e){var t,r,a,i=n.exports={};function l(){throw Error("setTimeout has not been defined")}function s(){throw Error("clearTimeout has not been defined")}function u(w){if(t===setTimeout)return setTimeout(w,0);if((t===l||!t)&&setTimeout)return t=setTimeout,setTimeout(w,0);try{return t(w,0)}catch{try{return t.call(null,w,0)}catch{return t.call(this,w,0)}}}function o(w){if(r===clearTimeout)return clearTimeout(w);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(w);try{return r(w)}catch{try{return r.call(null,w)}catch{return r.call(this,w)}}}(function(){try{t=typeof setTimeout=="function"?setTimeout:l}catch{t=l}try{r=typeof clearTimeout=="function"?clearTimeout:s}catch{r=s}})();var p=[],m=!1,d=-1;function y(){m&&a&&(m=!1,a.length?p=a.concat(p):d=-1,p.length&&f())}function f(){if(!m){var w=u(y);m=!0;for(var g=p.length;g;){for(a=p,p=[];++d<g;)a&&a[d].run();d=-1,g=p.length}a=null,m=!1,o(w)}}function S(w,g){this.fun=w,this.array=g}function v(){}i.nextTick=function(w){var g=Array(arguments.length-1);if(arguments.length>1)for(var _=1;_<arguments.length;_++)g[_-1]=arguments[_];p.push(new S(w,g)),p.length!==1||m||u(f)},S.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,i.listeners=function(w){return[]},i.binding=function(w){throw Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(w){throw Error("process.chdir is not supported")},i.umask=function(){return 0}}),L("4xE2z",function(n,e){var t=A("iEaqd");n.exports=function(r,a){t.forEach(r,function(i,l){l!==a&&l.toUpperCase()===a.toUpperCase()&&(r[a]=i,delete r[l])})}}),L("9na6w",function(n,e){n.exports=function(t,r,a,i,l){return t.config=r,a&&(t.code=a),t.request=i,t.response=l,t.isAxiosError=!0,t.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},t}}),L("kHaX1",function(n,e){var t=A("iEaqd"),r=A("hAgIk"),a=A("gIEx2"),i=A("gWG2h"),l=A("e3Yo9"),s=A("lo19V"),u=A("eg6xZ"),o=A("iUqaj");n.exports=function(p){return new Promise(function(m,d){var y=p.data,f=p.headers,S=p.responseType;t.isFormData(y)&&delete f["Content-Type"];var v=new XMLHttpRequest;if(p.auth){var w=p.auth.username||"",g=p.auth.password?unescape(encodeURIComponent(p.auth.password)):"";f.Authorization="Basic "+btoa(w+":"+g)}var _=l(p.baseURL,p.url);function $(){if(v){var T="getAllResponseHeaders"in v?s(v.getAllResponseHeaders()):null,P=S&&S!=="text"&&S!=="json"?v.response:v.responseText,D={data:P,status:v.status,statusText:v.statusText,headers:T,config:p,request:v};r(m,d,D),v=null}}if(v.open(p.method.toUpperCase(),i(_,p.params,p.paramsSerializer),!0),v.timeout=p.timeout,"onloadend"in v?v.onloadend=$:v.onreadystatechange=function(){v&&v.readyState===4&&(v.status!==0||v.responseURL&&v.responseURL.indexOf("file:")===0)&&setTimeout($)},v.onabort=function(){v&&(d(o("Request aborted",p,"ECONNABORTED",v)),v=null)},v.onerror=function(){d(o("Network Error",p,null,v)),v=null},v.ontimeout=function(){var T="timeout of "+p.timeout+"ms exceeded";p.timeoutErrorMessage&&(T=p.timeoutErrorMessage),d(o(T,p,p.transitional&&p.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",v)),v=null},t.isStandardBrowserEnv()){var x=(p.withCredentials||u(_))&&p.xsrfCookieName?a.read(p.xsrfCookieName):void 0;x&&(f[p.xsrfHeaderName]=x)}"setRequestHeader"in v&&t.forEach(f,function(T,P){y===void 0&&P.toLowerCase()==="content-type"?delete f[P]:v.setRequestHeader(P,T)}),t.isUndefined(p.withCredentials)||(v.withCredentials=!!p.withCredentials),S&&S!=="json"&&(v.responseType=p.responseType),typeof p.onDownloadProgress=="function"&&v.addEventListener("progress",p.onDownloadProgress),typeof p.onUploadProgress=="function"&&v.upload&&v.upload.addEventListener("progress",p.onUploadProgress),p.cancelToken&&p.cancelToken.promise.then(function(T){v&&(v.abort(),d(T),v=null)}),y||(y=null),v.send(y)})}}),L("hAgIk",function(n,e){var t=A("iUqaj");n.exports=function(r,a,i){var l=i.config.validateStatus;!i.status||!l||l(i.status)?r(i):a(t("Request failed with status code "+i.status,i.config,null,i.request,i))}}),L("iUqaj",function(n,e){var t=A("9na6w");n.exports=function(r,a,i,l,s){return t(Error(r),a,i,l,s)}}),L("gIEx2",function(n,e){var t=A("iEaqd");n.exports=t.isStandardBrowserEnv()?function(){return{write:function(r,a,i,l,s,u){var o=[];o.push(r+"="+encodeURIComponent(a)),t.isNumber(i)&&o.push("expires="+new Date(i).toGMTString()),t.isString(l)&&o.push("path="+l),t.isString(s)&&o.push("domain="+s),u===!0&&o.push("secure"),document.cookie=o.join("; ")},read:function(r){var a=document.cookie.match(RegExp("(^|;\\\\s*)("+r+")=([^;]*)"));return a?decodeURIComponent(a[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()}),L("e3Yo9",function(n,e){var t=A("2rjk0"),r=A("5nGHC");n.exports=function(a,i){return a&&!t(i)?r(a,i):i}}),L("2rjk0",function(n,e){n.exports=function(t){return/^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(t)}}),L("5nGHC",function(n,e){n.exports=function(t,r){return r?t.replace(/\\/+$/,"")+"/"+r.replace(/^\\/+/,""):t}}),L("lo19V",function(n,e){var t=A("iEaqd"),r=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];n.exports=function(a){var i,l,s,u={};return a&&t.forEach(a.split(\`
99
+ \`),function(o){s=o.indexOf(":"),i=t.trim(o.substr(0,s)).toLowerCase(),l=t.trim(o.substr(s+1)),i&&!(u[i]&&r.indexOf(i)>=0)&&(i==="set-cookie"?u[i]=(u[i]?u[i]:[]).concat([l]):u[i]=u[i]?u[i]+", "+l:l)}),u}}),L("eg6xZ",function(n,e){var t=A("iEaqd");n.exports=t.isStandardBrowserEnv()?function(){var r,a=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a");function l(s){var u=s;return a&&(i.setAttribute("href",u),u=i.href),i.setAttribute("href",u),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:i.pathname.charAt(0)==="/"?i.pathname:"/"+i.pathname}}return r=l(window.location.href),function(s){var u=t.isString(s)?l(s):s;return u.protocol===r.protocol&&u.host===r.host}}():function(){return function(){return!0}}()}),L("8kGOw",function(n,e){n.exports=function(t){return!!(t&&t.__CANCEL__)}}),L("6Mx50",function(n,e){var t=A("iEaqd");n.exports=function(r,a){a=a||{};var i={},l=["url","method","data"],s=["headers","auth","proxy","params"],u=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],o=["validateStatus"];function p(f,S){return t.isPlainObject(f)&&t.isPlainObject(S)?t.merge(f,S):t.isPlainObject(S)?t.merge({},S):t.isArray(S)?S.slice():S}function m(f){t.isUndefined(a[f])?t.isUndefined(r[f])||(i[f]=p(void 0,r[f])):i[f]=p(r[f],a[f])}t.forEach(l,function(f){t.isUndefined(a[f])||(i[f]=p(void 0,a[f]))}),t.forEach(s,m),t.forEach(u,function(f){t.isUndefined(a[f])?t.isUndefined(r[f])||(i[f]=p(void 0,r[f])):i[f]=p(void 0,a[f])}),t.forEach(o,function(f){f in a?i[f]=p(r[f],a[f]):f in r&&(i[f]=p(void 0,r[f]))});var d=l.concat(s).concat(u).concat(o),y=Object.keys(r).concat(Object.keys(a)).filter(function(f){return d.indexOf(f)===-1});return t.forEach(y,m),i}}),L("hiYAY",function(n,e){var t=A("bTAft"),r={};["object","boolean","number","function","string","symbol"].forEach(function(u,o){r[u]=function(p){return typeof p===u||"a"+(o<1?"n ":" ")+u}});var a={},i=t.version.split(".");function l(u,o){for(var p=o?o.split("."):i,m=u.split("."),d=0;d<3;d++){if(p[d]>m[d])return!0;if(p[d]<m[d])break}return!1}function s(u,o,p){if(typeof u!="object")throw TypeError("options must be an object");for(var m=Object.keys(u),d=m.length;d-- >0;){var y=m[d],f=o[y];if(f){var S=u[y],v=S===void 0||f(S,y,u);if(v!==!0)throw TypeError("option "+y+" must be "+v);continue}if(p!==!0)throw Error("Unknown option "+y)}}r.transitional=function(u,o,p){var m=o&&l(o);function d(y,f){return"[Axios v"+t.version+"] Transitional option '"+y+"'"+f+(p?". "+p:"")}return function(y,f,S){if(u===!1)throw Error(d(f," has been removed in "+o));return m&&!a[f]&&(a[f]=!0,console.warn(d(f," has been deprecated since v"+o+" and will be removed in the near future"))),!u||u(y,f,S)}},n.exports={isOlderVersion:l,assertOptions:s,validators:r}}),L("bTAft",function(n,e){n.exports=JSON.parse('{"_args":[["axios@0.21.4","/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub"]],"_from":"axios@0.21.4","_id":"axios@0.21.4","_inBundle":false,"_integrity":"sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==","_location":"/axios","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"axios@0.21.4","name":"axios","escapedName":"axios","rawSpec":"0.21.4","saveSpec":null,"fetchSpec":"0.21.4"},"_requiredBy":["/"],"_resolved":"https://registry.npmjs.org/axios/-/axios-0.21.4.tgz","_spec":"0.21.4","_where":"/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub","author":{"name":"Matt Zabriskie"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"bugs":{"url":"https://github.com/axios/axios/issues"},"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}],"dependencies":{"follow-redirects":"^1.14.0"},"description":"Promise based HTTP client for the browser and node.js","devDependencies":{"coveralls":"^3.0.0","es6-promise":"^4.2.4","grunt":"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1","karma":"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2","minimist":"^1.2.0","mocha":"^8.2.1","sinon":"^4.5.0","terser-webpack-plugin":"^4.2.3","typescript":"^4.0.5","url-search-params":"^0.10.0","webpack":"^4.44.2","webpack-dev-server":"^3.11.0"},"homepage":"https://axios-http.com","jsdelivr":"dist/axios.min.js","keywords":["xhr","http","ajax","promise","node"],"license":"MIT","main":"index.js","name":"axios","repository":{"type":"git","url":"git+https://github.com/axios/axios.git"},"scripts":{"build":"NODE_ENV=production grunt build","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","examples":"node ./examples/server.js","fix":"eslint --fix lib/**/*.js","postversion":"git push && git push --tags","preversion":"npm test","start":"node ./sandbox/server.js","test":"grunt test","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json"},"typings":"./index.d.ts","unpkg":"dist/axios.min.js","version":"0.21.4"}')}),L("g2liO",function(n,e){function t(r){this.message=r}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,n.exports=t}),L("14PRn",function(n,e){var t=A("g2liO");function r(a){if(typeof a!="function")throw TypeError("executor must be a function.");this.promise=new Promise(function(s){i=s});var i,l=this;a(function(s){l.reason||(l.reason=new t(s),i(l.reason))})}r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},r.source=function(){var a;return{token:new r(function(i){a=i}),cancel:a}},n.exports=r}),L("i3hBo",function(n,e){n.exports=function(t){return function(r){return t.apply(null,r)}}}),L("dhYWP",function(n,e){n.exports=function(t){return typeof t=="object"&&t.isAxiosError===!0}}),L("kfIQl",function(n,e){var t=typeof Symbol<"u"&&Symbol,r=A("lyEFc");n.exports=function(){return typeof t=="function"&&typeof Symbol=="function"&&typeof t("foo")=="symbol"&&typeof Symbol("bar")=="symbol"&&r()}}),L("lyEFc",function(n,e){n.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),a=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(a)!=="[object Symbol]")return!1;var i=42;for(r in t[r]=i,t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var l=Object.getOwnPropertySymbols(t);if(l.length!==1||l[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(t,r);if(s.value!==i||s.enumerable!==!0)return!1}return!0}}),L("bJ3CN",function(n,e){var t={__proto__:null,foo:{}},r=Object;n.exports=function(){return{__proto__:t}.foo===t.foo&&!(t instanceof r)}}),L("9cNUg",function(n,e){var t=A("hGGZx"),r=function(){return!!t};r.hasArrayLengthDefineBug=function(){if(!t)return null;try{return t([],"length",{value:1}).length!==1}catch{return!0}},n.exports=r}),L("hGGZx",function(n,e){var t=A("hMrGw")("%Object.defineProperty%",!0)||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}n.exports=t}),L("hMrGw",function(n,e){var t=A("dUpie"),r=A("48xLS"),a=A("4Vqmv"),i=A("7x6DQ"),l=A("kPNod"),s=A("b9GfH"),u=A("8DBKi"),o=Function,p=function(H){try{return o('"use strict"; return ('+H+").constructor;")()}catch{}},m=Object.getOwnPropertyDescriptor;if(m)try{m({},"")}catch{m=null}var d=function(){throw new s},y=m?function(){try{return arguments.callee,d}catch{try{return m(arguments,"callee").get}catch{return d}}}():d,f=A("kfIQl")(),S=A("bJ3CN")(),v=Object.getPrototypeOf||(S?function(H){return H.__proto__}:null),w={},g=typeof Uint8Array<"u"&&v?v(Uint8Array):void 0,_={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?void 0:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?void 0:ArrayBuffer,"%ArrayIteratorPrototype%":f&&v?v([][Symbol.iterator]()):void 0,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":w,"%AsyncGenerator%":w,"%AsyncGeneratorFunction%":w,"%AsyncIteratorPrototype%":w,"%Atomics%":typeof Atomics>"u"?void 0:Atomics,"%BigInt%":typeof BigInt>"u"?void 0:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?void 0:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?void 0:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?void 0:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":r,"%Float32Array%":typeof Float32Array>"u"?void 0:Float32Array,"%Float64Array%":typeof Float64Array>"u"?void 0:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?void 0:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":w,"%Int8Array%":typeof Int8Array>"u"?void 0:Int8Array,"%Int16Array%":typeof Int16Array>"u"?void 0:Int16Array,"%Int32Array%":typeof Int32Array>"u"?void 0:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":f&&v?v(v([][Symbol.iterator]())):void 0,"%JSON%":typeof JSON=="object"?JSON:void 0,"%Map%":typeof Map>"u"?void 0:Map,"%MapIteratorPrototype%":typeof Map<"u"&&f&&v?v(new Map()[Symbol.iterator]()):void 0,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?void 0:Promise,"%Proxy%":typeof Proxy>"u"?void 0:Proxy,"%RangeError%":a,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?void 0:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?void 0:Set,"%SetIteratorPrototype%":typeof Set<"u"&&f&&v?v(new Set()[Symbol.iterator]()):void 0,"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?void 0:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":f&&v?v(""[Symbol.iterator]()):void 0,"%Symbol%":f?Symbol:void 0,"%SyntaxError%":l,"%ThrowTypeError%":y,"%TypedArray%":g,"%TypeError%":s,"%Uint8Array%":typeof Uint8Array>"u"?void 0:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?void 0:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?void 0:Uint32Array,"%URIError%":u,"%WeakMap%":typeof WeakMap>"u"?void 0:WeakMap,"%WeakRef%":typeof WeakRef>"u"?void 0:WeakRef,"%WeakSet%":typeof WeakSet>"u"?void 0:WeakSet};if(v)try{null.error}catch(H){var $=v(v(H));_["%Error.prototype%"]=$}var x=function H(ie){var ee;if(ie==="%AsyncFunction%")ee=p("async function () {}");else if(ie==="%GeneratorFunction%")ee=p("function* () {}");else if(ie==="%AsyncGeneratorFunction%")ee=p("async function* () {}");else if(ie==="%AsyncGenerator%"){var k=H("%AsyncGeneratorFunction%");k&&(ee=k.prototype)}else if(ie==="%AsyncIteratorPrototype%"){var O=H("%AsyncGenerator%");O&&v&&(ee=v(O.prototype))}return _[ie]=ee,ee},T={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},P=A("hweMw"),D=A("23C6u"),R=P.call(Function.call,Array.prototype.concat),I=P.call(Function.apply,Array.prototype.splice),F=P.call(Function.call,String.prototype.replace),C=P.call(Function.call,String.prototype.slice),B=P.call(Function.call,RegExp.prototype.exec),V=/[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g,X=/\\\\(\\\\)?/g,oe=function(H){var ie=C(H,0,1),ee=C(H,-1);if(ie==="%"&&ee!=="%")throw new l("invalid intrinsic syntax, expected closing \`%\`");if(ee==="%"&&ie!=="%")throw new l("invalid intrinsic syntax, expected opening \`%\`");var k=[];return F(H,V,function(O,N,K,se){k[k.length]=K?F(se,X,"$1"):N||O}),k},we=function(H,ie){var ee,k=H;if(D(T,k)&&(k="%"+(ee=T[k])[0]+"%"),D(_,k)){var O=_[k];if(O===w&&(O=x(k)),O===void 0&&!ie)throw new s("intrinsic "+H+" exists, but is not available. Please file an issue!");return{alias:ee,name:k,value:O}}throw new l("intrinsic "+H+" does not exist!")};n.exports=function(H,ie){if(typeof H!="string"||H.length===0)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ie!="boolean")throw new s('"allowMissing" argument must be a boolean');if(B(/^%?[^%]*%?$/,H)===null)throw new l("\`%\` may not be present anywhere but at the beginning and end of the intrinsic name");var ee=oe(H),k=ee.length>0?ee[0]:"",O=we("%"+k+"%",ie),N=O.name,K=O.value,se=!1,te=O.alias;te&&(k=te[0],I(ee,R([0,1],te)));for(var J=1,ce=!0;J<ee.length;J+=1){var re=ee[J],fe=C(re,0,1),Ae=C(re,-1);if((fe==='"'||fe==="'"||fe==="\`"||Ae==='"'||Ae==="'"||Ae==="\`")&&fe!==Ae)throw new l("property names with quotes must have matching quotes");if(re!=="constructor"&&ce||(se=!0),k+="."+re,D(_,N="%"+k+"%"))K=_[N];else if(K!=null){if(!(re in K)){if(!ie)throw new s("base intrinsic for "+H+" exists, but the property is not available.");return}if(m&&J+1>=ee.length){var Ie=m(K,re);K=(ce=!!Ie)&&"get"in Ie&&!("originalValue"in Ie.get)?Ie.get:K[re]}else ce=D(K,re),K=K[re];ce&&!se&&(_[N]=K)}}return K}}),L("dUpie",function(n,e){n.exports=Error}),L("48xLS",function(n,e){n.exports=EvalError}),L("4Vqmv",function(n,e){n.exports=RangeError}),L("7x6DQ",function(n,e){n.exports=ReferenceError}),L("kPNod",function(n,e){n.exports=SyntaxError}),L("b9GfH",function(n,e){n.exports=TypeError}),L("8DBKi",function(n,e){n.exports=URIError}),L("hweMw",function(n,e){var t=A("2Eytq");n.exports=Function.prototype.bind||t}),L("2Eytq",function(n,e){var t="Function.prototype.bind called on incompatible ",r=Object.prototype.toString,a=Math.max,i="[object Function]",l=function(o,p){for(var m=[],d=0;d<o.length;d+=1)m[d]=o[d];for(var y=0;y<p.length;y+=1)m[y+o.length]=p[y];return m},s=function(o,p){for(var m=[],d=p,y=0;d<o.length;d+=1,y+=1)m[y]=o[d];return m},u=function(o,p){for(var m="",d=0;d<o.length;d+=1)m+=o[d],d+1<o.length&&(m+=p);return m};n.exports=function(o){var p,m=this;if(typeof m!="function"||r.apply(m)!==i)throw TypeError(t+m);for(var d=s(arguments,1),y=function(){if(this instanceof p){var g=m.apply(this,l(d,arguments));return Object(g)===g?g:this}return m.apply(o,l(d,arguments))},f=a(0,m.length-d.length),S=[],v=0;v<f;v++)S[v]="$"+v;if(p=Function("binder","return function ("+u(S,",")+"){ return binder.apply(this,arguments); }")(y),m.prototype){var w=function(){};w.prototype=m.prototype,p.prototype=new w,w.prototype=null}return p}}),L("23C6u",function(n,e){var t=Function.prototype.call,r=Object.prototype.hasOwnProperty,a=A("hweMw");n.exports=a.call(t,r)}),L("5ZWAZ",function(n,e){function t(r){return n.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},n.exports.__esModule=!0,n.exports.default=n.exports,t(r)}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports}),L("fgq5y",function(n,e){var t=A("f3Ywx").default;Object.defineProperty(n.exports,"__esModule",{value:!0}),n.exports.default=l;var r=t(A("a9VQw")),a=t(A("glRwo")),i=t(A("ayR3G"));function l(s,u){(0,i.default)(2,arguments);var o=(0,a.default)(s),p=(0,r.default)(u);return isNaN(p)?new Date(NaN):(p&&o.setDate(o.getDate()+p),o)}n.exports=n.exports.default}),L("f3Ywx",function(n,e){function t(r){return r&&r.__esModule?r:{default:r}}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports}),L("a9VQw",function(n,e){function t(r){if(r===null||r===!0||r===!1)return NaN;var a=Number(r);return isNaN(a)?a:a<0?Math.ceil(a):Math.floor(a)}Object.defineProperty(n.exports,"__esModule",{value:!0}),n.exports.default=t,n.exports=n.exports.default}),L("glRwo",function(n,e){var t=A("f3Ywx").default;Object.defineProperty(n.exports,"__esModule",{value:!0}),n.exports.default=i;var r=t(A("5ZWAZ")),a=t(A("ayR3G"));function i(l){(0,a.default)(1,arguments);var s=Object.prototype.toString.call(l);return l instanceof Date||(0,r.default)(l)==="object"&&s==="[object Date]"?new Date(l.getTime()):typeof l=="number"||s==="[object Number]"?new Date(l):((typeof l=="string"||s==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use \`parseISO\` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(Error().stack)),new Date(NaN))}n.exports=n.exports.default}),L("ayR3G",function(n,e){function t(r,a){if(a.length<r)throw TypeError(r+" argument"+(r>1?"s":"")+" required, but only "+a.length+" present")}Object.defineProperty(n.exports,"__esModule",{value:!0}),n.exports.default=t,n.exports=n.exports.default}),L("byyO9",function(n,e){var t=A("f3Ywx").default;Object.defineProperty(n.exports,"__esModule",{value:!0}),n.exports.default=l;var r=t(A("a9VQw")),a=t(A("glRwo")),i=t(A("ayR3G"));function l(s,u){(0,i.default)(2,arguments);var o=(0,a.default)(s),p=(0,r.default)(u);if(isNaN(p))return new Date(NaN);if(!p)return o;var m=o.getDate(),d=new Date(o.getTime());return d.setMonth(o.getMonth()+p+1,0),m>=d.getDate()?d:(o.setFullYear(d.getFullYear(),d.getMonth(),m),o)}n.exports=n.exports.default}),L("hLz6R",function(n,e){var t=A("f3Ywx").default;Object.defineProperty(n.exports,"__esModule",{value:!0}),n.exports.default=s;var r=t(A("glRwo")),a=t(A("a9VQw")),i=t(A("ayR3G")),l=A("lmyOi");function s(u,o){(0,i.default)(1,arguments);var p,m,d,y,f,S,v,w,g=(0,l.getDefaultOptions)(),_=(0,a.default)((p=(m=(d=(y=o==null?void 0:o.weekStartsOn)!==null&&y!==void 0?y:o==null||(f=o.locale)===null||f===void 0||(S=f.options)===null||S===void 0?void 0:S.weekStartsOn)!==null&&d!==void 0?d:g.weekStartsOn)!==null&&m!==void 0?m:(v=g.locale)===null||v===void 0||(w=v.options)===null||w===void 0?void 0:w.weekStartsOn)!==null&&p!==void 0?p:0);if(!(_>=0&&_<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");var $=(0,r.default)(u),x=$.getDay(),T=(x<_?7:0)+x-_;return $.setDate($.getDate()-T),$.setHours(0,0,0,0),$}n.exports=n.exports.default}),L("lmyOi",function(n,e){Object.defineProperty(n.exports,"__esModule",{value:!0}),n.exports.getDefaultOptions=r,n.exports.setDefaultOptions=a;var t={};function r(){return t}function a(i){t=i}}),L("kmcAT",function(n,e){A("akXK4"),A("5xozB")}),L("akXK4",function(n,e){n.exports=A("1ufAB")}),L("5xozB",function(n,e){Pr(n.exports,"IS_BROWSER_MAIN_THREAD",()=>r),Pr(n.exports,"IS_BROWSER",()=>i);var t=A("2dKjk");let r=typeof window<"u"&&typeof document<"u",a=typeof self=="object"&&typeof WorkerGlobalScope<"u",i=r||a;t!==void 0&&t.versions!=null&&t.versions.node});var me=A("5xozB");let ca="https://gudhub.com/GudHub_Test",ua="wss://gudhub.com/GudHub/ws/app/",pa="https://gudhub.com/api/services/prod",da="build/latest/async_modules_node/",fa="build/latest/automation_modules/",ha="https://gudhub.com",Cr=!0,Nr=!1,Ke=!0;me.IS_BROWSER||(Ke=!1);var me=A("5xozB");class Mr{}class $t extends Mr{constructor(e,t,r){super(),this.chunkDataService=new vt(e,Gt,r),this.gudhub=r}isWithCache(){return!1}async processRequestedApp(e,t){if(!this.isWithCache()){let r=await this.chunkDataService.getMergedChunkForIDList(e,t.chunks);return r&&(t.items_list=await this.gudhub.util.mergeChunks([r,t])),t}}}class ma{constructor(e){this.req=e}async getApp(e){return this.req.get({url:"/api/app/get",params:{app_id:e}})}}let Rr=(n,...e)=>{for(let t of e)if(t)for(let r of Object.keys(t)){let a=Object.getOwnPropertyDescriptor(t,r);a.enumerable&&Object.defineProperty(n,r,a)}};class St{}class He extends $t{constructor(e,t,r){super(e,t,r),this.appApi=new ma(e),Rr(this,new St(t))}async getApp(e){let t=await this.appApi.getApp(e);return this.processRequestedApp(e,t)}async getAppWithoutProcessing(e){return this.appApi.getApp(e)}async putApp(e,t){}static[Symbol.hasInstance](e){try{return e instanceof He||e instanceof St}catch{return!1}}}class Fr extends Mr{getMergedChunkForIDList(e){}isWithCache(){return!1}}class ga{constructor(e){this.req=e}async getChunk(e,t){return this.req.get({url:\`\${this.req.root}/api/get-items-chunk/\${e}/\${t}\`,method:"GET"})}async getLastChunk(e){return this.req.axiosRequest({url:\`\${this.req.root}/api/get-last-items-chunk/\${e}\`,method:"GET"})}}class xt extends Fr{constructor(e,t){super(),this.chunkApi=new ga(e),Rr(this,new St(t))}async getChunk(e,t){return this.chunkApi.getChunk(e,t)}async getChunksForId(e){return[]}getCachedMergedChunk(e,t){}getMergedChunkForIDList(e,t){}putChunk(){}static[Symbol.hasInstance](e){try{return e instanceof xt||e instanceof St}catch{return!1}}}let Et={store:"apps"},Ht={store:"chunks"},ya="gudhub",zt={store:"chunksMergeCache"};class _a{}class ze extends _a{constructor(e,t){if(super(),ze.dbNameToInstanceMap||(ze.dbNameToInstanceMap=new Map),ze.dbNameToInstanceMap.has(e))return ze.dbNameToInstanceMap.get(e);this.db=null,this.dbName=e,this.storeNameList=t,ze.dbNameToInstanceMap.set(e,this)}async checkAndCreateStore(e){let t=(await indexedDB.databases()).find(i=>i.name===this.dbName),r=!1,a=this;return t&&(r=await new Promise((i,l)=>{let s=indexedDB.open(a.dbName);s.onsuccess=function(u){let o=u.target.result,p=o.objectStoreNames.contains(e);o.close(),i(p)},s.onerror=function(u){l(u.target.error)}})),!!r||new Promise((i,l)=>{let s=indexedDB.open(a.dbName,t?t.version+1:1);s.onupgradeneeded=function(u){let o=u.target.result;o.objectStoreNames.contains(e)||o.createObjectStore(e)},s.onsuccess=function(u){u.target.result.close(),i()},s.onerror=l})}async openDB(){let e,t;if(this.db)return this.db;let r=new Promise((l,s)=>{e=l,t=s});for(let l of this.storeNameList)await this.checkAndCreateStore(l);let a=this,i=indexedDB.open(this.dbName);return i.onsuccess=l=>{a.db=l.target.result,e(this.db)},i.onerror=t,r}async executeOperation(e,t){let r=await this.openDB();return new Promise((a,i)=>{let l=r.transaction(e,"readwrite"),s=l.objectStore(e);l.oncomplete=()=>a(),l.onerror=u=>i(\`Transaction failed: \${u.target.error}\`);try{t(s)}catch(u){i(\`Operation failed: \${u.message}\`)}})}}let Lr=new ze(ya,[Et.store,Ht.store,zt.store]);class Dr{constructor(e,t){this.storeBackend=e,this.storeName=t}async addItem(e,t){return new Promise(async(r,a)=>{this.storeBackend.executeOperation(this.storeName,i=>{let l=i.add(t,e);l.onsuccess=r,l.onerror=a})})}async putItem(e,t){return new Promise(async(r,a)=>{this.storeBackend.executeOperation(this.storeName,i=>{let l=i.put(t,e);l.onsuccess=r,l.onerror=a})})}async hasItem(e){try{return!!await this.getItem(e)}catch{return!1}}async getItem(e){return new Promise(async(t,r)=>{this.storeBackend.executeOperation(this.storeName,a=>{let i=a.get(e);i.onsuccess=()=>{t(i.result)},i.onerror=r})})}async updateItem(e,t){return new Promise(async(r,a)=>{this.storeBackend.executeOperation(this.storeName,i=>{let l=i.get(e);l.onsuccess=()=>{let s=l.result;Object.assign(s,t),i.put(s,e),r()},l.onerror=a})})}async deleteItem(e){return new Promise(async(t,r)=>{this.storeBackend.executeOperation(this.storeName,a=>{let i=a.delete(e);i.onsuccess=t,i.onerror=r})})}}class qr extends Dr{constructor(){super(Lr,Et.store)}async getApp(e){return this.getItem(e)}async addApp(e,t){return this.addItem(e,t)}async putApp(e,t){return this.putItem(e,t)}async hasApp(e){return this.hasItem(e)}async deleteApp(e){return this.deleteItem(e)}}class ba extends Dr{constructor(){super(Lr,zt.store)}async get(e){return this.getItem(e)}async add(e,t){return this.addItem(e,t)}async put(e,t){return this.putItem(e,t)}async delete(e){return this.deleteItem(e)}}class st extends Fr{constructor(e,t,r){super(e,t),this.dataService=new xt(e),this.requestCache=new Map,this.gudhub=r,this.storeManager=new ba}static[Symbol.hasInstance](e){try{return e instanceof st}catch{return!1}}async getCachedMergedChunk(e,t){try{return(await this.storeManager.get(e)).mergedData}catch{let a=t.map(s=>this.dataService.getChunk(e,s)),i=await Promise.all(a),l=await this.gudhub.util.mergeChunks(i);return this.putMergedChunks(e,{hashes:t,mergedData:{items_list:l}}),{items_list:l}}}isWithCache(){return!0}async getMergedChunkForApp(e){}async getMergedChunkForIDList(e,t){try{let r,a=!0,i=await this.storeManager.get(e);try{if(t.length<i.hashes.length)throw Error();for(let u of i.hashes)t.indexOf(u)!=i.hashes.indexOf(u)&&(a=!1)}catch{a=!1}let l=[],s=[];if(t.length>i.hashes.length&&(l=t.slice(i.hashes.length)),a||(l=t),l.length>0){let u=l.map(o=>this.dataService.getChunk(e,o));s=await Promise.all(u)}return a||(r=await this.gudhub.util.mergeChunks([...s])),a&&(r=await this.gudhub.util.mergeChunks([i.mergedData,...s])),l.length>0&&this.putMergedChunks(e,{hashes:t,mergedData:{items_list:r}}),{items_list:r}}catch{let a=t.map(s=>this.dataService.getChunk(e,s)),i=await Promise.all(a),l=await this.gudhub.util.mergeChunks(i);return this.putMergedChunks(e,{hashes:t,mergedData:{items_list:l}}),{items_list:l}}}async putMergedChunks(e,t){return this.storeManager.put(e,t)}}let xe={INIT:1,REQUEST_APP:2,PROCESS_DATA:3,DECLINE_PROCESS_DATA_REQUEST:4};class Vt extends $t{constructor(e,t,r){super(e,t,r),this.dataService=new He(e,t,r),this.requestCache=new Map,this.gudhub=r,this.resolveFnMap=new Map,this.appRequestAndProcessWorker=new AppRequestWorkerScript,this.appRequestAndProcessWorker.postMessage({type:xe.INIT,gudhubSerialized:this.gudhub.serialized});let a=this;this.appRequestAndProcessWorker.onerror=function(i){},this.appRequestAndProcessWorker.onmessage=function(i){i.data.type==xe.REQUEST_APP&&a.resolveFnMap.has(i.data.id)&&a.resolveFnMap.get(i.data.id)(i.data.data),i.data.type==xe.PROCESS_DATA&&(a.gudhub.itemProcessor.handleDiff(i.data.id,i.data.compareRes),(i.data.viewListChanged||i.data.fieldListChanged)&&a.gudhub.appProcessor.updateAppFieldsAndViews(i.data.newVersion))},this.isWithCache(),this.storeManager=new qr}static[Symbol.hasInstance](e){try{return e instanceof Vt}catch{return!1}}isWithCache(){return!0}async getApp(e){if(this.requestCache.has(e))return this.requestCache.get(e);let t=this;await this.has(e);{let r=new Promise((a,i)=>{t.resolveFnMap.set(e,a)});return this.requestCache.set(e,r),this.appRequestAndProcessWorker.postMessage({type:xe.REQUEST_APP,id:e}),r}}async getCached(e){return this.storeManager.getApp(e)}async has(e){try{return this.storeManager.hasApp(e)}catch{}}async putApp(e,t){return this.storeManager.putApp(e,t)}}class Br extends $t{constructor(e,t,r){super(e,t,r),this.dataService=new He(e,null,r),this.requestCache=new Map,this.gudhub=r}isWithCache(){return!1}async getAppWithoutProcessing(e){let t=await this.dataService.getAppWithoutProcessing(e);return await this.putApp(e,t),t}async getApp(e){let t;if(this.requestCache.has(e))return this.requestCache.get(e);let r=new Promise((l,s)=>{t=l});this.requestCache.set(e,r);let a=await this.dataService.getAppWithoutProcessing(e),i=await this.processRequestedApp(e,a);return t(i),i}async has(e){return!1}async getCached(e){throw Error()}async putApp(e,t){throw Error()}}class va extends $t{constructor(e,t,r){super(e,t,r),this.dataService=new He(e,t,r),this.requestCache=new Map,this.gudhub=r,this.resolveFnMap=new Map,this.appRequestAndProcessWorker=new AppRequestWorkerScript,this.appRequestAndProcessWorker.postMessage({type:xe.INIT,gudhubSerialized:this.gudhub.serialized});let a=this;this.appRequestAndProcessWorker.onerror=function(i){},this.appRequestAndProcessWorker.onmessage=function(i){i.data.type==xe.REQUEST_APP&&a.resolveFnMap.has(i.data.id)&&a.resolveFnMap.get(i.data.id)(i.data.data),i.data.type==xe.PROCESS_DATA&&(a.gudhub.itemProcessor.handleDiff(i.data.id,i.data.compareRes),(i.data.viewListChanged||i.data.fieldListChanged)&&a.gudhub.appProcessor.updateAppFieldsAndViews(i.data.newVersion))},this.isWithCache(),this.storeManager=new qr}static[Symbol.hasInstance](e){try{return e instanceof Vt}catch{return!1}}isWithCache(){return!1}async getApp(e){if(this.requestCache.has(e))return this.requestCache.get(e);let t=new Promise((r,a)=>{self.resolveFnMap.set(e,r)});return this.requestCache.set(e,t),this.appRequestAndProcessWorker.postMessage({type:xe.REQUEST_APP,id:e}),t}async getCached(e){return this.storeManager.getApp(e)}async has(e){try{return this.storeManager.hasApp(e)}catch{}}async putApp(e,t){return this.storeManager.putApp(e,t)}}A("5xozB"),me.IS_BROWSER,me.IS_BROWSER&&Ke&&(Ut=va,Tr=Et),me.IS_BROWSER||(Ut=He),Ke&&(Ur=Br),me.IS_BROWSER&&Cr&&!Ke&&(vt=st,Gt=Ht),me.IS_BROWSER&&Cr&&Ke&&(vt=st,Gt=Ht),me.IS_BROWSER||(vt=xt);let Ur=Br,wa=st;var me=A("5xozB");class Gr{constructor(e,t,r,a,i,l,s){this.storage=e,this.pipeService=t,this.req=r,this.ws=a,this.applistReceived=!1,this.activateSW=l,this.util=i,this.appListeners(),this.dataService=s,this.appRequestCache=new Map}async createNewAppApi(e){try{let t=await this.req.post({url:"/api/app/create",form:{app:JSON.stringify(e)}});return t.from_apps_list=!0,t}catch(t){return console.log(t),null}}async updateAppApi(e){try{return await this.req.post({url:"/api/app/update",form:{app:JSON.stringify(e)}})}catch(t){return console.log(t),null}}async deleteAppApi(e){try{return await this.req.post({url:"/api/app/delete",form:{app_id:e}})}catch(t){return console.log(t),null}}async getAppListApi(){try{return(await this.req.get({url:"/api/applist/get"})).apps_list.map(e=>(e.from_apps_list=!0,e))}catch(e){return console.log(e),null}}getAppListFromStorage(){return this.storage.getAppsList()}getAppFromStorage(e){let t=this.storage.getApp(e);return t&&t.field_list.length?t:null}addNewAppToStorage(e){return this.storage.getAppsList().push(e)}saveAppInStorage(e){e.items_object={};for(let r=0;r<e.items_list.length;r++){e.items_object[e.items_list[r].item_id]={};for(let a=0;a<e.items_list[r].fields.length;a++)e.items_object[e.items_list[r].item_id][e.items_list[r].fields[a].field_id]=e.items_list[r].fields[a]}let t=this.storage.getApp(e.app_id);return t?(e.from_apps_list=t.from_apps_list,e.permission=t.permission,this.storage.updateApp(e)):(e.from_apps_list=!1,this.addNewAppToStorage(e)),this.getAppFromStorage(e.app_id)}updateAppFieldsAndViews(e){let t=this.getAppFromStorage(e.app_id);e.items_list=t.items_list,e.file_list=t.file_list,e.from_apps_list=t.from_apps_list,e.items_object=t.items_object,this.storage.updateApp(e),this.pipeService.emit("gh_app_views_update",{app_id:e.app_id},e.views_list),e.field_list.forEach(r=>{this.pipeService.emit("gh_model_update",{app_id:e.app_id,field_id:r.field_id},r)})}updateAppInStorage(e){this.storage.getApp(e.app_id)?(this.storage.updateApp(e),this.pipeService.emit("gh_app_update",{app_id:e.app_id},e),this.pipeService.emit("gh_items_update",{app_id:e.app_id},e.items_list)):this.addNewAppToStorage(e)}deletingAppFromStorage(e){let t=this.storage.getAppsList();return t.forEach((r,a)=>{r.app_id==e&&t.splice(a)}),t}updateAppsListInStorage(e=[]){for(let t of e){let r=this.storage.getApp(t.app_id);r?(r.from_apps_list=t.from_apps_list,r.permission=t.permission):this.addNewAppToStorage(t)}}async refreshApps(e=[]){for(let t of e)if(t!=null)try{let r=await this.dataService.getApp(t);if(r){r.items_object={};for(let a=0;a<r.items_list.length;a++){r.items_object[r.items_list[a].item_id]={};for(let i=0;i<r.items_list[a].fields.length;i++)r.items_object[r.items_list[a].item_id][r.items_list[a].fields[i].field_id]=r.items_list[a].fields[i]}this.updateAppInStorage(r),this.pipeService.emit("gh_app_views_update",{app_id:r.app_id},r.views_list)}}catch(r){console.log(r)}console.log("Apps refreshed: ",JSON.stringify(e))}async refreshAppsList(){let e=this.getAppListFromStorage(),t=(await this.getAppListApi()).map(r=>({...r,...e.find(a=>a.app_id===r.app_id)}));this.updateAppsListInStorage(t),this.pipeService.emit("gh_apps_list_refreshed",{})}async getAppsList(){let e=this.getAppListFromStorage();if(!this.applistReceived){let t=await this.getAppListApi();if(!t)return null;this.updateAppsListInStorage(t),this.applistReceived=!0,e=t}return e}async getAppInfo(e){let t=await this.getAppsList();return t?t.find(r=>r.app_id==e):null}async deleteApp(e){return await this.deleteAppApi(e),this.deletingAppFromStorage(e)}async getApp(e,t=!1){if(!e)return null;let r=this.getAppFromStorage(e);if(r)return r;if(this.appRequestCache.has(e))return this.appRequestCache.get(e);let a=this,i=new Promise(async(l,s)=>{try{let u=await a.dataService.getApp(e);u||s();let o=t?u:{...u,items_list:u.items_list.filter(p=>!p.trash)};o=t?o:{...o,field_list:o.field_list.filter(p=>!p.trash)},l(o),a.saveAppInStorage(o),a.ws.addSubscription(e)}catch{s()}});return a.appRequestCache.set(e,i),i}async updateApp(e){if(!e.views_list||!e.views_list.length||!e.show){let r=await this.getApp(e.app_id);e.views_list&&e.views_list.length||(e.views_list=r.views_list),e.show===void 0&&(e.show=r.show)}let t=await this.updateAppApi(e);return this.updateAppFieldsAndViews(t),t}async updateAppInfo(e={}){return this.pipeService.emit("gh_app_info_update",{app_id:e.app_id},e),this.updateApp(e)}async createNewApp(e){let t=await this.createNewAppApi(e);return t.items_object={},this.addNewAppToStorage(t),t}async getAppViews(e){if(e)return(await this.getApp(e)).views_list}clearAppProcessor(){this.getAppListPromises=null,this.getAppPromises={},this.applistReceived=!1}appListeners(){this.pipeService.onRoot("gh_app_get",{},async(e,t)=>{if(t&&t.app_id){let r=await this.getApp(t.app_id);this.pipeService.emit("gh_app_get",t,r)}}),this.pipeService.onRoot("gh_apps_list_get",{},async(e,t)=>{let r=await this.getAppsList();this.pipeService.emit("gh_apps_list_get",t,r)}),this.pipeService.onRoot("gh_delete_app",{},async(e,t)=>{let r=await this.deleteApp(t.app_id);this.pipeService.emit("gh_apps_list_update",{recipient:"all"},r)}),this.pipeService.onRoot("gh_app_update",{},async(e,t)=>{t.app.items_list=[],t.app.file_list=[];let r=await this.updateApp(t.app);this.pipeService.emit("gh_app_views_update",{app_id:r.app_id},r.views_list);let a=await this.getAppsList();this.pipeService.emit("gh_apps_list_update",{recipient:"all"},a),r.field_list.forEach(i=>{this.pipeService.emit("gh_model_update",{app_id:r.app_id,field_id:i.field_id},i)})}),this.pipeService.onRoot("gh_app_view_get",{},async(e,t)=>{if(t&&t.app_id){let r=await this.getApp(t.app_id);r.views_list.forEach((a,i)=>{a.view_id==t.view_id&&this.pipeService.emit("gh_app_view_get",t,r.views_list[i])})}}),this.pipeService.onRoot("gh_app_info_get",{},async(e,t)=>{let r=await this.getAppInfo(t.app_id);r&&this.pipeService.emit("gh_app_info_get",t,r)}),this.pipeService.onRoot("gh_app_info_update",{},async(e,t)=>{if(t&&t.app){let r=await this.updateAppInfo(t.app);this.pipeService.emit("gh_app_info_update",{app_id:t.app.app_id},r)}}),this.pipeService.onRoot("gh_app_create",{},async(e,t)=>{await this.createNewApp(t.app);let r=await this.getAppsList();this.pipeService.emit("gh_apps_list_update",{recipient:"all"},r)}),me.IS_BROWSER_MAIN_THREAD&&this.activateSW&&navigator.serviceWorker.addEventListener("message",async e=>{if(e.data.type==="refresh app"){let t=await this.getApp(e.data.payload.app_id);t&&this.util.compareAppsItemsLists(t.items_list,e.data.payload.items_list.filter(r=>!r.trash),({diff_fields_items:r,diff_fields_items_Ids:a,diff_items:i,newItems:l,deletedItems:s})=>{(i.length||l.length||s.length)&&(this.pipeService.emit("gh_items_update",{app_id:e.data.payload.app_id},e.data.payload.items_list.filter(u=>!u.trash)),i.forEach(u=>this.pipeService.emit("gh_item_update",{app_id:e.data.payload.app_id,item_id:u.item_id},u))),a.forEach(u=>{let o=r[u];o&&o.forEach(p=>{this.pipeService.emit("gh_value_update",{app_id:e.data.payload.app_id,item_id:u,field_id:p.field_id},p.field_value)})})}),e.data.payload.items_list=await this.util.mergeChunks([t,e.data.payload]),this.saveAppInStorage(e.data.payload)}})}}var gt=A("akXK4");function Wr(n=[]){return n.filter(e=>e.field_value!=null)}function $a(n={}){let e=Object.entries(n);return e.length?\`&\${e.map(([t,r])=>\`\${t}=\${r}\`).join("&")}\`:""}var kt={},Hr={},Jt={},ve=A("hMrGw"),Ve={},ve=A("hMrGw"),ot={},Qt=A("hweMw"),ve=A("hMrGw"),zr={},ve=A("hMrGw"),Yt={},ct=A("hGGZx"),Sa=A("kPNod"),$e=A("b9GfH"),lt={},ve=A("hMrGw"),At=ve("%Object.getOwnPropertyDescriptor%",!0);if(At)try{At([],"length")}catch{At=null}lt=At,Yt=function(n,e,t){if(!n||typeof n!="object"&&typeof n!="function")throw new $e("\`obj\` must be an object or a function\`");if(typeof e!="string"&&typeof e!="symbol")throw new $e("\`property\` must be a string or a symbol\`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new $e("\`nonEnumerable\`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new $e("\`nonWritable\`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new $e("\`nonConfigurable\`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new $e("\`loose\`, if provided, must be a boolean");var r=arguments.length>3?arguments[3]:null,a=arguments.length>4?arguments[4]:null,i=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],s=!!lt&&lt(n,e);if(ct)ct(n,e,{configurable:i===null&&s?s.configurable:!i,enumerable:r===null&&s?s.enumerable:!r,value:t,writable:a===null&&s?s.writable:!a});else{if(!l&&(r||a||i))throw new Sa("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");n[e]=t}};var xa=A("9cNUg")(),$e=A("b9GfH"),Ea=ve("%Math.floor%");zr=function(n,e){if(typeof n!="function")throw new $e("\`fn\` is not a function");if(typeof e!="number"||e<0||e>4294967295||Ea(e)!==e)throw new $e("\`length\` must be a positive 32-bit integer");var t=arguments.length>2&&!!arguments[2],r=!0,a=!0;if("length"in n&&lt){var i=lt(n,"length");i&&!i.configurable&&(r=!1),i&&!i.writable&&(a=!1)}return(r||a||!t)&&(xa?Yt(n,"length",e,!0,!0):Yt(n,"length",e)),n};var $e=A("b9GfH"),Vr=ve("%Function.prototype.apply%"),Jr=ve("%Function.prototype.call%"),Qr=ve("%Reflect.apply%",!0)||Qt.call(Jr,Vr),ct=A("hGGZx"),ka=ve("%Math.max%");ot=function(n){if(typeof n!="function")throw new $e("a function is required");var e=Qr(Qt,Jr,arguments);return zr(e,1+ka(0,n.length-(arguments.length-1)),!0)};var Yr=function(){return Qr(Qt,Vr,arguments)};ct?ct(ot,"apply",{value:Yr}):ot.apply=Yr;var Aa=ot(ve("String.prototype.indexOf"));Ve=function(n,e){var t=ve(n,!!e);return typeof t=="function"&&Aa(n,".prototype.")>-1?ot(t):t};var Xr={},Xt=typeof Map=="function"&&Map.prototype,Kt=Object.getOwnPropertyDescriptor&&Xt?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,It=Xt&&Kt&&typeof Kt.get=="function"?Kt.get:null,Kr=Xt&&Map.prototype.forEach,Zt=typeof Set=="function"&&Set.prototype,er=Object.getOwnPropertyDescriptor&&Zt?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Ot=Zt&&er&&typeof er.get=="function"?er.get:null,Zr=Zt&&Set.prototype.forEach,Ia=typeof WeakMap=="function"&&WeakMap.prototype,ut=Ia?WeakMap.prototype.has:null,Oa=typeof WeakSet=="function"&&WeakSet.prototype,pt=Oa?WeakSet.prototype.has:null,ja=typeof WeakRef=="function"&&WeakRef.prototype,en=ja?WeakRef.prototype.deref:null,Ta=Boolean.prototype.valueOf,Pa=Object.prototype.toString,Ca=Function.prototype.toString,Na=String.prototype.match,tr=String.prototype.slice,De=String.prototype.replace,Ma=String.prototype.toUpperCase,tn=String.prototype.toLowerCase,rn=RegExp.prototype.test,nn=Array.prototype.concat,je=Array.prototype.join,Ra=Array.prototype.slice,an=Math.floor,rr=typeof BigInt=="function"?BigInt.prototype.valueOf:null,nr=Object.getOwnPropertySymbols,ar=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Ze=typeof Symbol=="function"&&typeof Symbol.iterator=="object",ye=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Ze||!0)?Symbol.toStringTag:null,sn=Object.prototype.propertyIsEnumerable,on=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(n){return n.__proto__}:null);function ln(n,e){if(n===1/0||n===-1/0||n!=n||n&&n>-1e3&&n<1e3||rn.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof n=="number"){var r=n<0?-an(-n):an(n);if(r!==n){var a=String(r),i=tr.call(e,a.length+1);return De.call(a,t,"$&_")+"."+De.call(De.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return De.call(e,t,"$&_")}var ir={},cn=ir.custom,un=fn(cn)?cn:null;function pn(n,e,t){var r=(t.quoteStyle||e)==="double"?'"':"'";return r+n+r}function Fa(n){return De.call(String(n),/"/g,"&quot;")}function sr(n){return Be(n)==="[object Array]"&&(!ye||!(typeof n=="object"&&ye in n))}function La(n){return Be(n)==="[object Date]"&&(!ye||!(typeof n=="object"&&ye in n))}function dn(n){return Be(n)==="[object RegExp]"&&(!ye||!(typeof n=="object"&&ye in n))}function Da(n){return Be(n)==="[object Error]"&&(!ye||!(typeof n=="object"&&ye in n))}function qa(n){return Be(n)==="[object String]"&&(!ye||!(typeof n=="object"&&ye in n))}function Ba(n){return Be(n)==="[object Number]"&&(!ye||!(typeof n=="object"&&ye in n))}function Ua(n){return Be(n)==="[object Boolean]"&&(!ye||!(typeof n=="object"&&ye in n))}function fn(n){if(Ze)return n&&typeof n=="object"&&n instanceof Symbol;if(typeof n=="symbol")return!0;if(!n||typeof n!="object"||!ar)return!1;try{return ar.call(n),!0}catch{}return!1}function Ga(n){if(!n||typeof n!="object"||!rr)return!1;try{return rr.call(n),!0}catch{}return!1}Xr=function n(e,t,r,a){var i=t||{};if(qe(i,"quoteStyle")&&i.quoteStyle!=="single"&&i.quoteStyle!=="double")throw TypeError('option "quoteStyle" must be "single" or "double"');if(qe(i,"maxStringLength")&&(typeof i.maxStringLength=="number"?i.maxStringLength<0&&i.maxStringLength!==1/0:i.maxStringLength!==null))throw TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or \`null\`');var l=!qe(i,"customInspect")||i.customInspect;if(typeof l!="boolean"&&l!=="symbol")throw TypeError("option \\"customInspect\\", if provided, must be \`true\`, \`false\`, or \`'symbol'\`");if(qe(i,"indent")&&i.indent!==null&&i.indent!==" "&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw TypeError('option "indent" must be "\\\\t", an integer > 0, or \`null\`');if(qe(i,"numericSeparator")&&typeof i.numericSeparator!="boolean")throw TypeError('option "numericSeparator", if provided, must be \`true\` or \`false\`');var s=i.numericSeparator;if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return mn(e,i);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var u=String(e);return s?ln(e,u):u}if(typeof e=="bigint"){var o=String(e)+"n";return s?ln(e,o):o}var p=i.depth===void 0?5:i.depth;if(r===void 0&&(r=0),r>=p&&p>0&&typeof e=="object")return sr(e)?"[Array]":"[Object]";var m=ei(i,r);if(a===void 0)a=[];else if(hn(a,e)>=0)return"[Circular]";function d(C,B,V){if(B&&(a=Ra.call(a)).push(B),V){var X={depth:i.depth};return qe(i,"quoteStyle")&&(X.quoteStyle=i.quoteStyle),n(C,X,r+1,a)}return n(C,i,r+1,a)}if(typeof e=="function"&&!dn(e)){var y=Ha(e),f=jt(e,d);return"[Function"+(y?": "+y:" (anonymous)")+"]"+(f.length>0?" { "+je.call(f,", ")+" }":"")}if(fn(e)){var S=Ze?De.call(String(e),/^(Symbol\\(.*\\))_[^)]*$/,"$1"):ar.call(e);return typeof e!="object"||Ze?S:dt(S)}if(Xa(e)){for(var v="<"+tn.call(String(e.nodeName)),w=e.attributes||[],g=0;g<w.length;g++)v+=" "+w[g].name+"="+pn(Fa(w[g].value),"double",i);return v+=">",e.childNodes&&e.childNodes.length&&(v+="..."),v+="</"+tn.call(String(e.nodeName))+">"}if(sr(e)){if(e.length===0)return"[]";var _=jt(e,d);return m&&!Za(_)?"["+lr(_,m)+"]":"[ "+je.call(_,", ")+" ]"}if(Da(e)){var $=jt(e,d);return"cause"in Error.prototype||!("cause"in e)||sn.call(e,"cause")?$.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+je.call($,", ")+" }":"{ ["+String(e)+"] "+je.call(nn.call("[cause]: "+d(e.cause),$),", ")+" }"}if(typeof e=="object"&&l){if(un&&typeof e[un]=="function"&&ir)return ir(e,{depth:p-r});if(l!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(za(e)){var x=[];return Kr&&Kr.call(e,function(C,B){x.push(d(B,e,!0)+" => "+d(C,e))}),gn("Map",It.call(e),x,m)}if(Qa(e)){var T=[];return Zr&&Zr.call(e,function(C){T.push(d(C,e))}),gn("Set",Ot.call(e),T,m)}if(Va(e))return or("WeakMap");if(Ya(e))return or("WeakSet");if(Ja(e))return or("WeakRef");if(Ba(e))return dt(d(Number(e)));if(Ga(e))return dt(d(rr.call(e)));if(Ua(e))return dt(Ta.call(e));if(qa(e))return dt(d(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(e===le)return"{ [object globalThis] }";if(!La(e)&&!dn(e)){var P=jt(e,d),D=on?on(e)===Object.prototype:e instanceof Object||e.constructor===Object,R=e instanceof Object?"":"null prototype",I=!D&&ye&&Object(e)===e&&ye in e?tr.call(Be(e),8,-1):R?"Object":"",F=(D||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"")+(I||R?"["+je.call(nn.call([],I||[],R||[]),": ")+"] ":"");return P.length===0?F+"{}":m?F+"{"+lr(P,m)+"}":F+"{ "+je.call(P,", ")+" }"}return String(e)};var Wa=Object.prototype.hasOwnProperty||function(n){return n in this};function qe(n,e){return Wa.call(n,e)}function Be(n){return Pa.call(n)}function Ha(n){if(n.name)return n.name;var e=Na.call(Ca.call(n),/^function\\s*([\\w$]+)/);return e?e[1]:null}function hn(n,e){if(n.indexOf)return n.indexOf(e);for(var t=0,r=n.length;t<r;t++)if(n[t]===e)return t;return-1}function za(n){if(!It||!n||typeof n!="object")return!1;try{It.call(n);try{Ot.call(n)}catch{return!0}return n instanceof Map}catch{}return!1}function Va(n){if(!ut||!n||typeof n!="object")return!1;try{ut.call(n,ut);try{pt.call(n,pt)}catch{return!0}return n instanceof WeakMap}catch{}return!1}function Ja(n){if(!en||!n||typeof n!="object")return!1;try{return en.call(n),!0}catch{}return!1}function Qa(n){if(!Ot||!n||typeof n!="object")return!1;try{Ot.call(n);try{It.call(n)}catch{return!0}return n instanceof Set}catch{}return!1}function Ya(n){if(!pt||!n||typeof n!="object")return!1;try{pt.call(n,pt);try{ut.call(n,ut)}catch{return!0}return n instanceof WeakSet}catch{}return!1}function Xa(n){return!!n&&typeof n=="object"&&(typeof HTMLElement<"u"&&n instanceof HTMLElement||typeof n.nodeName=="string"&&typeof n.getAttribute=="function")}function mn(n,e){if(n.length>e.maxStringLength){var t=n.length-e.maxStringLength,r="... "+t+" more character"+(t>1?"s":"");return mn(tr.call(n,0,e.maxStringLength),e)+r}return pn(De.call(De.call(n,/(['\\\\])/g,"\\\\$1"),/[\\x00-\\x1f]/g,Ka),"single",e)}function Ka(n){var e=n.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\\\"+t:"\\\\x"+(e<16?"0":"")+Ma.call(e.toString(16))}function dt(n){return"Object("+n+")"}function or(n){return n+" { ? }"}function gn(n,e,t,r){return n+" ("+e+") {"+(r?lr(t,r):je.call(t,", "))+"}"}function Za(n){for(var e=0;e<n.length;e++)if(hn(n[e],\`
100
100
  \`)>=0)return!1;return!0}function ei(n,e){var t;if(n.indent===" ")t=" ";else{if(typeof n.indent!="number"||!(n.indent>0))return null;t=je.call(Array(n.indent+1)," ")}return{base:t,prev:je.call(Array(e+1),t)}}function lr(n,e){if(n.length===0)return"";var t=\`
101
101
  \`+e.prev+e.base;return t+je.call(n,","+t)+\`
102
102
  \`+e.prev}function jt(n,e){var t,r=sr(n),a=[];if(r){a.length=n.length;for(var i=0;i<n.length;i++)a[i]=qe(n,i)?e(n[i],n):""}var l=typeof nr=="function"?nr(n):[];if(Ze){t={};for(var s=0;s<l.length;s++)t["$"+l[s]]=l[s]}for(var u in n)if(qe(n,u)&&(!r||String(Number(u))!==u||!(u<n.length))){if(Ze&&t["$"+u]instanceof Symbol)continue;rn.call(/[^\\w$]/,u)?a.push(e(u,n)+": "+e(n[u],n)):a.push(u+": "+e(n[u],n))}if(typeof nr=="function")for(var o=0;o<l.length;o++)sn.call(n,l[o])&&a.push("["+e(l[o])+"]: "+e(n[l[o]],n));return a}var $e=A("b9GfH"),Tt=ve("%WeakMap%",!0),Pt=ve("%Map%",!0),ti=Ve("WeakMap.prototype.get",!0),ri=Ve("WeakMap.prototype.set",!0),ni=Ve("WeakMap.prototype.has",!0),ai=Ve("Map.prototype.get",!0),ii=Ve("Map.prototype.set",!0),si=Ve("Map.prototype.has",!0),cr=function(n,e){for(var t,r=n;(t=r.next)!==null;r=t)if(t.key===e)return r.next=t.next,t.next=n.next,n.next=t,t},oi=function(n,e){var t=cr(n,e);return t&&t.value},li=function(n,e,t){var r=cr(n,e);r?r.value=t:n.next={key:e,next:n.next,value:t}},ci=function(n,e){return!!cr(n,e)};Jt=function(){var n,e,t,r={assert:function(a){if(!r.has(a))throw new $e("Side channel does not contain "+Xr(a))},get:function(a){if(Tt&&a&&(typeof a=="object"||typeof a=="function")){if(n)return ti(n,a)}else if(Pt){if(e)return ai(e,a)}else if(t)return oi(t,a)},has:function(a){if(Tt&&a&&(typeof a=="object"||typeof a=="function")){if(n)return ni(n,a)}else if(Pt){if(e)return si(e,a)}else if(t)return ci(t,a);return!1},set:function(a,i){Tt&&a&&(typeof a=="object"||typeof a=="function")?(n||(n=new Tt),ri(n,a,i)):Pt?(e||(e=new Pt),ii(e,a,i)):(t||(t={key:{},next:null}),li(t,a,i))}};return r};var Ee={},Ue={},ui=String.prototype.replace,pi=/%20/g,ur={RFC1738:"RFC1738",RFC3986:"RFC3986"};Ue={default:ur.RFC3986,formatters:{RFC1738:function(n){return ui.call(n,pi,"+")},RFC3986:function(n){return String(n)}},RFC1738:ur.RFC1738,RFC3986:ur.RFC3986};var pr=Object.prototype.hasOwnProperty,Je=Array.isArray,Te=function(){for(var n=[],e=0;e<256;++e)n.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return n}(),di=function(n){for(;n.length>1;){var e=n.pop(),t=e.obj[e.prop];if(Je(t)){for(var r=[],a=0;a<t.length;++a)t[a]!==void 0&&r.push(t[a]);e.obj[e.prop]=r}}},yn=function(n,e){for(var t=e&&e.plainObjects?Object.create(null):{},r=0;r<n.length;++r)n[r]!==void 0&&(t[r]=n[r]);return t},fi=function n(e,t,r){if(!t)return e;if(typeof t!="object"){if(Je(e))e.push(t);else{if(!e||typeof e!="object")return[e,t];(r&&(r.plainObjects||r.allowPrototypes)||!pr.call(Object.prototype,t))&&(e[t]=!0)}return e}if(!e||typeof e!="object")return[e].concat(t);var a=e;return Je(e)&&!Je(t)&&(a=yn(e,r)),Je(e)&&Je(t)?(t.forEach(function(i,l){if(pr.call(e,l)){var s=e[l];s&&typeof s=="object"&&i&&typeof i=="object"?e[l]=n(s,i,r):e.push(i)}else e[l]=i}),e):Object.keys(t).reduce(function(i,l){var s=t[l];return pr.call(i,l)?i[l]=n(i[l],s,r):i[l]=s,i},a)},hi=function(n,e){return Object.keys(e).reduce(function(t,r){return t[r]=e[r],t},n)},mi=function(n,e,t){var r=n.replace(/\\+/g," ");if(t==="iso-8859-1")return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch{return r}},gi=function(n,e,t,r,a){if(n.length===0)return n;var i=n;if(typeof n=="symbol"?i=Symbol.prototype.toString.call(n):typeof n!="string"&&(i=String(n)),t==="iso-8859-1")return escape(i).replace(/%u[0-9a-f]{4}/gi,function(o){return"%26%23"+parseInt(o.slice(2),16)+"%3B"});for(var l="",s=0;s<i.length;++s){var u=i.charCodeAt(s);if(u===45||u===46||u===95||u===126||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||a===Ue.RFC1738&&(u===40||u===41)){l+=i.charAt(s);continue}if(u<128){l+=Te[u];continue}if(u<2048){l+=Te[192|u>>6]+Te[128|63&u];continue}if(u<55296||u>=57344){l+=Te[224|u>>12]+Te[128|u>>6&63]+Te[128|63&u];continue}s+=1,l+=Te[240|(u=65536+((1023&u)<<10|1023&i.charCodeAt(s)))>>18]+Te[128|u>>12&63]+Te[128|u>>6&63]+Te[128|63&u]}return l},yi=function(n){for(var e=[{obj:{o:n},prop:"o"}],t=[],r=0;r<e.length;++r)for(var a=e[r],i=a.obj[a.prop],l=Object.keys(i),s=0;s<l.length;++s){var u=l[s],o=i[u];typeof o=="object"&&o!==null&&t.indexOf(o)===-1&&(e.push({obj:i,prop:u}),t.push(o))}return di(e),n},_i=function(n){return Object.prototype.toString.call(n)==="[object RegExp]"},bi=function(n){return!!n&&typeof n=="object"&&!!(n.constructor&&n.constructor.isBuffer&&n.constructor.isBuffer(n))},vi=function(n,e){return[].concat(n,e)},wi=function(n,e){if(Je(n)){for(var t=[],r=0;r<n.length;r+=1)t.push(e(n[r]));return t}return e(n)};Ee={arrayToObject:yn,assign:hi,combine:vi,compact:yi,decode:mi,encode:gi,isBuffer:bi,isRegExp:_i,maybeMap:wi,merge:fi};var $i=Object.prototype.hasOwnProperty,_n={brackets:function(n){return n+"[]"},comma:"comma",indices:function(n,e){return n+"["+e+"]"},repeat:function(n){return n}},Re=Array.isArray,Si=Array.prototype.push,bn=function(n,e){Si.apply(n,Re(e)?e:[e])},xi=Date.prototype.toISOString,vn=Ue.default,_e={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Ee.encode,encodeValuesOnly:!1,format:vn,formatter:Ue.formatters[vn],indices:!1,serializeDate:function(n){return xi.call(n)},skipNulls:!1,strictNullHandling:!1},Ei=function(n){return typeof n=="string"||typeof n=="number"||typeof n=="boolean"||typeof n=="symbol"||typeof n=="bigint"},dr={},ki=function n(e,t,r,a,i,l,s,u,o,p,m,d,y,f,S,v){for(var w,g=e,_=v,$=0,x=!1;(_=_.get(dr))!==void 0&&!x;){var T=_.get(e);if($+=1,T!==void 0){if(T===$)throw RangeError("Cyclic object value");x=!0}_.get(dr)===void 0&&($=0)}if(typeof u=="function"?g=u(t,g):g instanceof Date?g=m(g):r==="comma"&&Re(g)&&(g=Ee.maybeMap(g,function(X){return X instanceof Date?m(X):X})),g===null){if(i)return s&&!f?s(t,_e.encoder,S,"key",d):t;g=""}if(Ei(g)||Ee.isBuffer(g))return s?[y(f?t:s(t,_e.encoder,S,"key",d))+"="+y(s(g,_e.encoder,S,"value",d))]:[y(t)+"="+y(String(g))];var P=[];if(g===void 0)return P;if(r==="comma"&&Re(g))f&&s&&(g=Ee.maybeMap(g,s)),w=[{value:g.length>0?g.join(",")||null:void 0}];else if(Re(u))w=u;else{var D=Object.keys(g);w=o?D.sort(o):D}for(var R=a&&Re(g)&&g.length===1?t+"[]":t,I=0;I<w.length;++I){var F=w[I],C=typeof F=="object"&&F.value!==void 0?F.value:g[F];if(!l||C!==null){var B=Re(g)?typeof r=="function"?r(R,F):R:R+(p?"."+F:"["+F+"]");v.set(e,$);var V=Jt();V.set(dr,v),bn(P,n(C,B,r,a,i,l,r==="comma"&&f&&Re(g)?null:s,u,o,p,m,d,y,f,S,V))}}return P},Ai=function(n){if(!n)return _e;if(n.encoder!==null&&n.encoder!==void 0&&typeof n.encoder!="function")throw TypeError("Encoder has to be a function.");var e=n.charset||_e.charset;if(n.charset!==void 0&&n.charset!=="utf-8"&&n.charset!=="iso-8859-1")throw TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=Ue.default;if(n.format!==void 0){if(!$i.call(Ue.formatters,n.format))throw TypeError("Unknown format option provided.");t=n.format}var r=Ue.formatters[t],a=_e.filter;return(typeof n.filter=="function"||Re(n.filter))&&(a=n.filter),{addQueryPrefix:typeof n.addQueryPrefix=="boolean"?n.addQueryPrefix:_e.addQueryPrefix,allowDots:n.allowDots===void 0?_e.allowDots:!!n.allowDots,charset:e,charsetSentinel:typeof n.charsetSentinel=="boolean"?n.charsetSentinel:_e.charsetSentinel,delimiter:n.delimiter===void 0?_e.delimiter:n.delimiter,encode:typeof n.encode=="boolean"?n.encode:_e.encode,encoder:typeof n.encoder=="function"?n.encoder:_e.encoder,encodeValuesOnly:typeof n.encodeValuesOnly=="boolean"?n.encodeValuesOnly:_e.encodeValuesOnly,filter:a,format:t,formatter:r,serializeDate:typeof n.serializeDate=="function"?n.serializeDate:_e.serializeDate,skipNulls:typeof n.skipNulls=="boolean"?n.skipNulls:_e.skipNulls,sort:typeof n.sort=="function"?n.sort:null,strictNullHandling:typeof n.strictNullHandling=="boolean"?n.strictNullHandling:_e.strictNullHandling}};Hr=function(n,e){var t,r,a=n,i=Ai(e);typeof i.filter=="function"?a=i.filter("",a):Re(i.filter)&&(t=i.filter);var l=[];if(typeof a!="object"||a===null)return"";r=e&&e.arrayFormat in _n?e.arrayFormat:e&&"indices"in e?e.indices?"indices":"repeat":"indices";var s=_n[r];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw TypeError("\`commaRoundTrip\` must be a boolean, or absent");var u=s==="comma"&&e&&e.commaRoundTrip;t||(t=Object.keys(a)),i.sort&&t.sort(i.sort);for(var o=Jt(),p=0;p<t.length;++p){var m=t[p];i.skipNulls&&a[m]===null||bn(l,ki(a[m],m,s,u,i.strictNullHandling,i.skipNulls,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.format,i.formatter,i.encodeValuesOnly,i.charset,o))}var d=l.join(i.delimiter),y=i.addQueryPrefix===!0?"?":"";return i.charsetSentinel&&(i.charset==="iso-8859-1"?y+="utf8=%26%2310003%3B&":y+="utf8=%E2%9C%93&"),d.length>0?y+d:""};var wn={},fr=Object.prototype.hasOwnProperty,Ii=Array.isArray,de={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Ee.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Oi=function(n){return n.replace(/&#(\\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},$n=function(n,e){return n&&typeof n=="string"&&e.comma&&n.indexOf(",")>-1?n.split(","):n},ji="utf8=%26%2310003%3B",Ti="utf8=%E2%9C%93",Pi=function(n,e){var t={__proto__:null},r=e.ignoreQueryPrefix?n.replace(/^\\?/,""):n,a=e.parameterLimit===1/0?void 0:e.parameterLimit,i=r.split(e.delimiter,a),l=-1,s=e.charset;if(e.charsetSentinel)for(u=0;u<i.length;++u)i[u].indexOf("utf8=")===0&&(i[u]===Ti?s="utf-8":i[u]===ji&&(s="iso-8859-1"),l=u,u=i.length);for(u=0;u<i.length;++u)if(u!==l){var u,o,p,m=i[u],d=m.indexOf("]="),y=d===-1?m.indexOf("="):d+1;y===-1?(o=e.decoder(m,de.decoder,s,"key"),p=e.strictNullHandling?null:""):(o=e.decoder(m.slice(0,y),de.decoder,s,"key"),p=Ee.maybeMap($n(m.slice(y+1),e),function(f){return e.decoder(f,de.decoder,s,"value")})),p&&e.interpretNumericEntities&&s==="iso-8859-1"&&(p=Oi(p)),m.indexOf("[]=")>-1&&(p=Ii(p)?[p]:p),fr.call(t,o)?t[o]=Ee.combine(t[o],p):t[o]=p}return t},Ci=function(n,e,t,r){for(var a=r?e:$n(e,t),i=n.length-1;i>=0;--i){var l,s=n[i];if(s==="[]"&&t.parseArrays)l=[].concat(a);else{l=t.plainObjects?Object.create(null):{};var u=s.charAt(0)==="["&&s.charAt(s.length-1)==="]"?s.slice(1,-1):s,o=parseInt(u,10);t.parseArrays||u!==""?!isNaN(o)&&s!==u&&String(o)===u&&o>=0&&t.parseArrays&&o<=t.arrayLimit?(l=[])[o]=a:u!=="__proto__"&&(l[u]=a):l={0:a}}a=l}return a},Ni=function(n,e,t,r){if(n){var a=t.allowDots?n.replace(/\\.([^.[]+)/g,"[$1]"):n,i=/(\\[[^[\\]]*])/,l=/(\\[[^[\\]]*])/g,s=t.depth>0&&i.exec(a),u=s?a.slice(0,s.index):a,o=[];if(u){if(!t.plainObjects&&fr.call(Object.prototype,u)&&!t.allowPrototypes)return;o.push(u)}for(var p=0;t.depth>0&&(s=l.exec(a))!==null&&p<t.depth;){if(p+=1,!t.plainObjects&&fr.call(Object.prototype,s[1].slice(1,-1))&&!t.allowPrototypes)return;o.push(s[1])}return s&&o.push("["+a.slice(s.index)+"]"),Ci(o,e,t,r)}},Mi=function(n){if(!n)return de;if(n.decoder!==null&&n.decoder!==void 0&&typeof n.decoder!="function")throw TypeError("Decoder has to be a function.");if(n.charset!==void 0&&n.charset!=="utf-8"&&n.charset!=="iso-8859-1")throw TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e=n.charset===void 0?de.charset:n.charset;return{allowDots:n.allowDots===void 0?de.allowDots:!!n.allowDots,allowPrototypes:typeof n.allowPrototypes=="boolean"?n.allowPrototypes:de.allowPrototypes,allowSparse:typeof n.allowSparse=="boolean"?n.allowSparse:de.allowSparse,arrayLimit:typeof n.arrayLimit=="number"?n.arrayLimit:de.arrayLimit,charset:e,charsetSentinel:typeof n.charsetSentinel=="boolean"?n.charsetSentinel:de.charsetSentinel,comma:typeof n.comma=="boolean"?n.comma:de.comma,decoder:typeof n.decoder=="function"?n.decoder:de.decoder,delimiter:typeof n.delimiter=="string"||Ee.isRegExp(n.delimiter)?n.delimiter:de.delimiter,depth:typeof n.depth=="number"||n.depth===!1?+n.depth:de.depth,ignoreQueryPrefix:n.ignoreQueryPrefix===!0,interpretNumericEntities:typeof n.interpretNumericEntities=="boolean"?n.interpretNumericEntities:de.interpretNumericEntities,parameterLimit:typeof n.parameterLimit=="number"?n.parameterLimit:de.parameterLimit,parseArrays:n.parseArrays!==!1,plainObjects:typeof n.plainObjects=="boolean"?n.plainObjects:de.plainObjects,strictNullHandling:typeof n.strictNullHandling=="boolean"?n.strictNullHandling:de.strictNullHandling}};wn=function(n,e){var t=Mi(e);if(n===""||n==null)return t.plainObjects?Object.create(null):{};for(var r=typeof n=="string"?Pi(n,t):n,a=t.plainObjects?Object.create(null):{},i=Object.keys(r),l=0;l<i.length;++l){var s=i[l],u=Ni(s,r[s],t,typeof n=="string");a=Ee.merge(a,u,t)}return t.allowSparse===!0?a:Ee.compact(a)},kt={formats:Ue,parse:wn,stringify:Hr};class Ri{constructor(e){this.root=e,this.requestPromises=[]}init(e){this.getToken=e}async get(e){let t=await this.getToken(),r=this.getHashCode(e);if(this.requestPromises[r])return this.requestPromises[r].promise;let a=new Promise((i,l)=>{let s;e.externalResource?s=e.url:(s=this.root+e.url,s=\`\${s}\${/\\?/.test(s)?"&":"?"}token=\${t}\${$a(e.params)}\`),G(gt).get(s,{validateStatus:function(u){return u<400}}).then(function(u){u.status!=200&&console.error(\`GUDHUB HTTP SERVICE: GET ERROR: \${u.status}\`,u),i(u.data)}).catch(function(u){console.error(\`GUDHUB HTTP SERVICE: GET ERROR: \${u.response.status}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gudhub/core",
3
- "version": "1.2.4-beta.48",
3
+ "version": "1.2.4-beta.49",
4
4
  "scripts": {
5
5
  "test": "NODE_ENV=test mocha $(find ./GUDHUB -print | grep -i test.js)",
6
6
  "prepublishOnly": "chmod +x ./build.sh; ./build.sh",