@gudhub/core 1.2.4-beta.6 → 1.2.4-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see library.min.js.LICENSE.txt */
2
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.GudHubLibrary=t():e.GudHubLibrary=t()}(this,(()=>(()=>{var __webpack_modules__={9669:(e,t,r)=>{e.exports=r(1609)},5448:(e,t,r)=>{"use strict";var n=r(4867),i=r(6026),a=r(4372),o=r(5327),s=r(4097),l=r(4109),c=r(7985),u=r(5061);e.exports=function(e){return new Promise((function(t,r){var p=e.data,d=e.headers,h=e.responseType;n.isFormData(p)&&delete d["Content-Type"];var f=new XMLHttpRequest;if(e.auth){var m=e.auth.username||"",g=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";d.Authorization="Basic "+btoa(m+":"+g)}var y=s(e.baseURL,e.url);function _(){if(f){var n="getAllResponseHeaders"in f?l(f.getAllResponseHeaders()):null,a={data:h&&"text"!==h&&"json"!==h?f.response:f.responseText,status:f.status,statusText:f.statusText,headers:n,config:e,request:f};i(t,r,a),f=null}}if(f.open(e.method.toUpperCase(),o(y,e.params,e.paramsSerializer),!0),f.timeout=e.timeout,"onloadend"in f?f.onloadend=_:f.onreadystatechange=function(){f&&4===f.readyState&&(0!==f.status||f.responseURL&&0===f.responseURL.indexOf("file:"))&&setTimeout(_)},f.onabort=function(){f&&(r(u("Request aborted",e,"ECONNABORTED",f)),f=null)},f.onerror=function(){r(u("Network Error",e,null,f)),f=null},f.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(u(t,e,e.transitional&&e.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",f)),f=null},n.isStandardBrowserEnv()){var b=(e.withCredentials||c(y))&&e.xsrfCookieName?a.read(e.xsrfCookieName):void 0;b&&(d[e.xsrfHeaderName]=b)}"setRequestHeader"in f&&n.forEach(d,(function(e,t){void 0===p&&"content-type"===t.toLowerCase()?delete d[t]:f.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(f.withCredentials=!!e.withCredentials),h&&"json"!==h&&(f.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&f.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&f.upload&&f.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){f&&(f.abort(),r(e),f=null)})),p||(p=null),f.send(p)}))}},1609:(e,t,r)=>{"use strict";var n=r(4867),i=r(1849),a=r(321),o=r(7185);function s(e){var t=new a(e),r=i(a.prototype.request,t);return n.extend(r,a.prototype,t),n.extend(r,t),r}var l=s(r(5655));l.Axios=a,l.create=function(e){return s(o(l.defaults,e))},l.Cancel=r(5263),l.CancelToken=r(4972),l.isCancel=r(6502),l.all=function(e){return Promise.all(e)},l.spread=r(8713),l.isAxiosError=r(6268),e.exports=l,e.exports.default=l},5263:e=>{"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},4972:(e,t,r)=>{"use strict";var n=r(5263);function i(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.source=function(){var e;return{token:new i((function(t){e=t})),cancel:e}},e.exports=i},6502:e=>{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},321:(e,t,r)=>{"use strict";var n=r(4867),i=r(5327),a=r(782),o=r(3572),s=r(7185),l=r(4875),c=l.validators;function u(e){this.defaults=e,this.interceptors={request:new a,response:new a}}u.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=s(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=e.transitional;void 0!==t&&l.assertOptions(t,{silentJSONParsing:c.transitional(c.boolean,"1.0.0"),forcedJSONParsing:c.transitional(c.boolean,"1.0.0"),clarifyTimeoutError:c.transitional(c.boolean,"1.0.0")},!1);var r=[],n=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(n=n&&t.synchronous,r.unshift(t.fulfilled,t.rejected))}));var i,a=[];if(this.interceptors.response.forEach((function(e){a.push(e.fulfilled,e.rejected)})),!n){var u=[o,void 0];for(Array.prototype.unshift.apply(u,r),u=u.concat(a),i=Promise.resolve(e);u.length;)i=i.then(u.shift(),u.shift());return i}for(var p=e;r.length;){var d=r.shift(),h=r.shift();try{p=d(p)}catch(e){h(e);break}}try{i=o(p)}catch(e){return Promise.reject(e)}for(;a.length;)i=i.then(a.shift(),a.shift());return i},u.prototype.getUri=function(e){return e=s(this.defaults,e),i(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function(e){u.prototype[e]=function(t,r){return this.request(s(r||{},{method:e,url:t,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function(e){u.prototype[e]=function(t,r,n){return this.request(s(n||{},{method:e,url:t,data:r}))}})),e.exports=u},782:(e,t,r)=>{"use strict";var n=r(4867);function i(){this.handlers=[]}i.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=i},4097:(e,t,r)=>{"use strict";var n=r(1793),i=r(7303);e.exports=function(e,t){return e&&!n(t)?i(e,t):t}},5061:(e,t,r)=>{"use strict";var n=r(481);e.exports=function(e,t,r,i,a){var o=new Error(e);return n(o,t,r,i,a)}},3572:(e,t,r)=>{"use strict";var n=r(4867),i=r(8527),a=r(6502),o=r(5655);function s(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return s(e),e.headers=e.headers||{},e.data=i.call(e,e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||o.adapter)(e).then((function(t){return s(e),t.data=i.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return a(t)||(s(e),t&&t.response&&(t.response.data=i.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},481:e=>{"use strict";e.exports=function(e,t,r,n,i){return e.config=t,r&&(e.code=r),e.request=n,e.response=i,e.isAxiosError=!0,e.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}},e}},7185:(e,t,r)=>{"use strict";var n=r(4867);e.exports=function(e,t){t=t||{};var r={},i=["url","method","data"],a=["headers","auth","proxy","params"],o=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],s=["validateStatus"];function l(e,t){return n.isPlainObject(e)&&n.isPlainObject(t)?n.merge(e,t):n.isPlainObject(t)?n.merge({},t):n.isArray(t)?t.slice():t}function c(i){n.isUndefined(t[i])?n.isUndefined(e[i])||(r[i]=l(void 0,e[i])):r[i]=l(e[i],t[i])}n.forEach(i,(function(e){n.isUndefined(t[e])||(r[e]=l(void 0,t[e]))})),n.forEach(a,c),n.forEach(o,(function(i){n.isUndefined(t[i])?n.isUndefined(e[i])||(r[i]=l(void 0,e[i])):r[i]=l(void 0,t[i])})),n.forEach(s,(function(n){n in t?r[n]=l(e[n],t[n]):n in e&&(r[n]=l(void 0,e[n]))}));var u=i.concat(a).concat(o).concat(s),p=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===u.indexOf(e)}));return n.forEach(p,c),r}},6026:(e,t,r)=>{"use strict";var n=r(5061);e.exports=function(e,t,r){var i=r.config.validateStatus;r.status&&i&&!i(r.status)?t(n("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)}},8527:(e,t,r)=>{"use strict";var n=r(4867),i=r(5655);e.exports=function(e,t,r){var a=this||i;return n.forEach(r,(function(r){e=r.call(a,e,t)})),e}},5655:(e,t,r)=>{"use strict";var n=r(4867),i=r(6016),a=r(481),o={"Content-Type":"application/x-www-form-urlencoded"};function s(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var l,c={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(l=r(5448)),l),transformRequest:[function(e,t){return i(t,"Accept"),i(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e)?e:n.isArrayBufferView(e)?e.buffer:n.isURLSearchParams(e)?(s(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):n.isObject(e)||t&&"application/json"===t["Content-Type"]?(s(t,"application/json"),function(e,t,r){if(n.isString(e))try{return(0,JSON.parse)(e),n.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional,r=t&&t.silentJSONParsing,i=t&&t.forcedJSONParsing,o=!r&&"json"===this.responseType;if(o||i&&n.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(o){if("SyntaxError"===e.name)throw a(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){c.headers[e]=n.merge(o)})),e.exports=c},1849:e=>{"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}}},5327:(e,t,r)=>{"use strict";var n=r(4867);function i(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,r){if(!t)return e;var a;if(r)a=r(t);else if(n.isURLSearchParams(t))a=t.toString();else{var o=[];n.forEach(t,(function(e,t){null!=e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,(function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),o.push(i(t)+"="+i(e))})))})),a=o.join("&")}if(a){var s=e.indexOf("#");-1!==s&&(e=e.slice(0,s)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}},7303:e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},4372:(e,t,r)=>{"use strict";var n=r(4867);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,i,a,o){var s=[];s.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),n.isString(i)&&s.push("path="+i),n.isString(a)&&s.push("domain="+a),!0===o&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},1793:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},6268:e=>{"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},7985:(e,t,r)=>{"use strict";var n=r(4867);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function i(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=i(window.location.href),function(t){var r=n.isString(t)?i(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},6016:(e,t,r)=>{"use strict";var n=r(4867);e.exports=function(e,t){n.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},4109:(e,t,r)=>{"use strict";var n=r(4867),i=["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"];e.exports=function(e){var t,r,a,o={};return e?(n.forEach(e.split("\n"),(function(e){if(a=e.indexOf(":"),t=n.trim(e.substr(0,a)).toLowerCase(),r=n.trim(e.substr(a+1)),t){if(o[t]&&i.indexOf(t)>=0)return;o[t]="set-cookie"===t?(o[t]?o[t]:[]).concat([r]):o[t]?o[t]+", "+r:r}})),o):o}},8713:e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},4875:(e,t,r)=>{"use strict";var n=r(8593),i={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){i[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var a={},o=n.version.split(".");function s(e,t){for(var r=t?t.split("."):o,n=e.split("."),i=0;i<3;i++){if(r[i]>n[i])return!0;if(r[i]<n[i])return!1}return!1}i.transitional=function(e,t,r){var i=t&&s(t);function o(e,t){return"[Axios v"+n.version+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,n,s){if(!1===e)throw new Error(o(n," has been removed in "+t));return i&&!a[n]&&(a[n]=!0,console.warn(o(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,n,s)}},e.exports={isOlderVersion:s,assertOptions:function(e,t,r){if("object"!=typeof e)throw new TypeError("options must be an object");for(var n=Object.keys(e),i=n.length;i-- >0;){var a=n[i],o=t[a];if(o){var s=e[a],l=void 0===s||o(s,a,e);if(!0!==l)throw new TypeError("option "+a+" must be "+l)}else if(!0!==r)throw Error("Unknown option "+a)}},validators:i}},4867:(e,t,r)=>{"use strict";var n=r(1849),i=Object.prototype.toString;function a(e){return"[object Array]"===i.call(e)}function o(e){return void 0===e}function s(e){return null!==e&&"object"==typeof e}function l(e){if("[object Object]"!==i.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function c(e){return"[object Function]"===i.call(e)}function u(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),a(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}e.exports={isArray:a,isArrayBuffer:function(e){return"[object ArrayBuffer]"===i.call(e)},isBuffer:function(e){return null!==e&&!o(e)&&null!==e.constructor&&!o(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:s,isPlainObject:l,isUndefined:o,isDate:function(e){return"[object Date]"===i.call(e)},isFile:function(e){return"[object File]"===i.call(e)},isBlob:function(e){return"[object Blob]"===i.call(e)},isFunction:c,isStream:function(e){return s(e)&&c(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:u,merge:function e(){var t={};function r(r,n){l(t[n])&&l(r)?t[n]=e(t[n],r):l(r)?t[n]=e({},r):a(r)?t[n]=r.slice():t[n]=r}for(var n=0,i=arguments.length;n<i;n++)u(arguments[n],r);return t},extend:function(e,t,r){return u(t,(function(t,i){e[i]=r&&"function"==typeof t?n(t,r):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},1924:(e,t,r)=>{"use strict";var n=r(210),i=r(5559),a=i(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&a(e,".prototype.")>-1?i(r):r}},5559:(e,t,r)=>{"use strict";var n=r(8612),i=r(210),a=r(7771),o=r(4453),s=i("%Function.prototype.apply%"),l=i("%Function.prototype.call%"),c=i("%Reflect.apply%",!0)||n.call(l,s),u=r(4429),p=i("%Math.max%");e.exports=function(e){if("function"!=typeof e)throw new o("a function is required");var t=c(n,l,arguments);return a(t,1+p(0,e.length-(arguments.length-1)),!0)};var d=function(){return c(n,s,arguments)};u?u(e.exports,"apply",{value:d}):e.exports.apply=d},8729:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDefaultOptions=function(){return r},t.setDefaultOptions=function(e){r=e};var r={}},8734:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")},e.exports=t.default},2084:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)},e.exports=t.default},5430:(e,t,r)=>{"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if((0,l.default)(2,arguments),!t||"object"!==(0,i.default)(t))return new Date(NaN);var r=t.years?(0,c.default)(t.years):0,n=t.months?(0,c.default)(t.months):0,u=t.weeks?(0,c.default)(t.weeks):0,p=t.days?(0,c.default)(t.days):0,d=t.hours?(0,c.default)(t.hours):0,h=t.minutes?(0,c.default)(t.minutes):0,f=t.seconds?(0,c.default)(t.seconds):0,m=(0,s.default)(e),g=n||r?(0,o.default)(m,n+12*r):m,y=p||u?(0,a.default)(g,p+7*u):g,_=1e3*(f+60*(h+60*d));return new Date(y.getTime()+_)};var i=n(r(8698)),a=n(r(7262)),o=n(r(6581)),s=n(r(1171)),l=n(r(8734)),c=n(r(2084));e.exports=t.default},7262:(e,t,r)=>{"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,o.default)(2,arguments);var r=(0,a.default)(e),n=(0,i.default)(t);return isNaN(n)?new Date(NaN):n?(r.setDate(r.getDate()+n),r):r};var i=n(r(2084)),a=n(r(1171)),o=n(r(8734));e.exports=t.default},6581:(e,t,r)=>{"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,o.default)(2,arguments);var r=(0,a.default)(e),n=(0,i.default)(t);if(isNaN(n))return new Date(NaN);if(!n)return r;var s=r.getDate(),l=new Date(r.getTime());return l.setMonth(r.getMonth()+n+1,0),s>=l.getDate()?l:(r.setFullYear(l.getFullYear(),l.getMonth(),s),r)};var i=n(r(2084)),a=n(r(1171)),o=n(r(8734));e.exports=t.default},5276:(e,t,r)=>{"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){(0,a.default)(2,arguments);var n=(0,i.default)(e,r),o=(0,i.default)(t,r);return n.getTime()===o.getTime()};var i=n(r(2466)),a=n(r(8734));e.exports=t.default},8933:(e,t,r)=>{"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){var n,c,u,p,d,h,f,m;(0,s.default)(2,arguments);var g=(0,l.getDefaultOptions)(),y=(0,o.default)(null!==(n=null!==(c=null!==(u=null!==(p=null==r?void 0:r.weekStartsOn)&&void 0!==p?p:null==r||null===(d=r.locale)||void 0===d||null===(h=d.options)||void 0===h?void 0:h.weekStartsOn)&&void 0!==u?u:g.weekStartsOn)&&void 0!==c?c:null===(f=g.locale)||void 0===f||null===(m=f.options)||void 0===m?void 0:m.weekStartsOn)&&void 0!==n?n:0);if(!(y>=0&&y<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var _=(0,a.default)(e),b=(0,o.default)(t),v=_.getDay(),w=7-y,S=b<0||b>6?b-(v+w)%7:((b%7+7)%7+w)%7-(v+w)%7;return(0,i.default)(_,S)};var i=n(r(7262)),a=n(r(1171)),o=n(r(2084)),s=n(r(8734)),l=r(8729);e.exports=t.default},2466:(e,t,r)=>{"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r,n,l,c,u,p,d,h;(0,o.default)(1,arguments);var f=(0,s.getDefaultOptions)(),m=(0,a.default)(null!==(r=null!==(n=null!==(l=null!==(c=null==t?void 0:t.weekStartsOn)&&void 0!==c?c:null==t||null===(u=t.locale)||void 0===u||null===(p=u.options)||void 0===p?void 0:p.weekStartsOn)&&void 0!==l?l:f.weekStartsOn)&&void 0!==n?n:null===(d=f.locale)||void 0===d||null===(h=d.options)||void 0===h?void 0:h.weekStartsOn)&&void 0!==r?r:0);if(!(m>=0&&m<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var g=(0,i.default)(e),y=g.getDay(),_=(y<m?7:0)+y-m;return g.setDate(g.getDate()-_),g.setHours(0,0,0,0),g};var i=n(r(1171)),a=n(r(2084)),o=n(r(8734)),s=r(8729);e.exports=t.default},1171:(e,t,r)=>{"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){(0,a.default)(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===(0,i.default)(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(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((new Error).stack)),new Date(NaN))};var i=n(r(8698)),a=n(r(8734));e.exports=t.default},2296:(e,t,r)=>{"use strict";var n=r(4429),i=r(3464),a=r(4453),o=r(7296);e.exports=function(e,t,r){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new a("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new a("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new a("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new a("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new a("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new a("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,u=arguments.length>6&&arguments[6],p=!!o&&o(e,t);if(n)n(e,t,{configurable:null===c&&p?p.configurable:!c,enumerable:null===s&&p?p.enumerable:!s,value:r,writable:null===l&&p?p.writable:!l});else{if(!u&&(s||l||c))throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=r}}},4429:(e,t,r)=>{"use strict";var n=r(210)("%Object.defineProperty%",!0)||!1;if(n)try{n({},"a",{value:1})}catch(e){n=!1}e.exports=n},3981:e=>{"use strict";e.exports=EvalError},1648:e=>{"use strict";e.exports=Error},4726:e=>{"use strict";e.exports=RangeError},6712:e=>{"use strict";e.exports=ReferenceError},3464:e=>{"use strict";e.exports=SyntaxError},4453:e=>{"use strict";e.exports=TypeError},3915:e=>{"use strict";e.exports=URIError},7648:e=>{"use strict";var t=Object.prototype.toString,r=Math.max,n=function(e,t){for(var r=[],n=0;n<e.length;n+=1)r[n]=e[n];for(var i=0;i<t.length;i+=1)r[i+e.length]=t[i];return r};e.exports=function(e){var i=this;if("function"!=typeof i||"[object Function]"!==t.apply(i))throw new TypeError("Function.prototype.bind called on incompatible "+i);for(var a,o=function(e,t){for(var r=[],n=1,i=0;n<e.length;n+=1,i+=1)r[i]=e[n];return r}(arguments),s=r(0,i.length-o.length),l=[],c=0;c<s;c++)l[c]="$"+c;if(a=Function("binder","return function ("+function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=",");return r}(l)+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof a){var t=i.apply(this,n(o,arguments));return Object(t)===t?t:this}return i.apply(e,n(o,arguments))})),i.prototype){var u=function(){};u.prototype=i.prototype,a.prototype=new u,u.prototype=null}return a}},8612:(e,t,r)=>{"use strict";var n=r(7648);e.exports=Function.prototype.bind||n},210:(e,t,r)=>{"use strict";var n,i=r(1648),a=r(3981),o=r(4726),s=r(6712),l=r(3464),c=r(4453),u=r(3915),p=Function,d=function(e){try{return p('"use strict"; return ('+e+").constructor;")()}catch(e){}},h=Object.getOwnPropertyDescriptor;if(h)try{h({},"")}catch(e){h=null}var f=function(){throw new c},m=h?function(){try{return f}catch(e){try{return h(arguments,"callee").get}catch(e){return f}}}():f,g=r(1405)(),y=r(8185)(),_=Object.getPrototypeOf||(y?function(e){return e.__proto__}:null),b={},v="undefined"!=typeof Uint8Array&&_?_(Uint8Array):n,w={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":g&&_?_([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":b,"%AsyncGenerator%":b,"%AsyncGeneratorFunction%":b,"%AsyncIteratorPrototype%":b,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":a,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":p,"%GeneratorFunction%":b,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":g&&_?_(_([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&g&&_?_((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":o,"%ReferenceError%":s,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&g&&_?_((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g&&_?_(""[Symbol.iterator]()):n,"%Symbol%":g?Symbol:n,"%SyntaxError%":l,"%ThrowTypeError%":m,"%TypedArray%":v,"%TypeError%":c,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":u,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};if(_)try{null.error}catch(e){var S=_(_(e));w["%Error.prototype%"]=S}var E=function e(t){var r;if("%AsyncFunction%"===t)r=d("async function () {}");else if("%GeneratorFunction%"===t)r=d("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=d("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&_&&(r=_(i.prototype))}return w[t]=r,r},x={__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"]},k=r(8612),A=r(8824),I=k.call(Function.call,Array.prototype.concat),j=k.call(Function.apply,Array.prototype.splice),O=k.call(Function.call,String.prototype.replace),P=k.call(Function.call,String.prototype.slice),T=k.call(Function.call,RegExp.prototype.exec),C=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,N=/\\(\\)?/g,L=function(e,t){var r,n=e;if(A(x,n)&&(n="%"+(r=x[n])[0]+"%"),A(w,n)){var i=w[n];if(i===b&&(i=E(n)),void 0===i&&!t)throw new c("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new l("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new c('"allowMissing" argument must be a boolean');if(null===T(/^%?[^%]*%?$/,e))throw new l("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=P(e,0,1),r=P(e,-1);if("%"===t&&"%"!==r)throw new l("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new l("invalid intrinsic syntax, expected opening `%`");var n=[];return O(e,C,(function(e,t,r,i){n[n.length]=r?O(i,N,"$1"):t||e})),n}(e),n=r.length>0?r[0]:"",i=L("%"+n+"%",t),a=i.name,o=i.value,s=!1,u=i.alias;u&&(n=u[0],j(r,I([0,1],u)));for(var p=1,d=!0;p<r.length;p+=1){var f=r[p],m=P(f,0,1),g=P(f,-1);if(('"'===m||"'"===m||"`"===m||'"'===g||"'"===g||"`"===g)&&m!==g)throw new l("property names with quotes must have matching quotes");if("constructor"!==f&&d||(s=!0),A(w,a="%"+(n+="."+f)+"%"))o=w[a];else if(null!=o){if(!(f in o)){if(!t)throw new c("base intrinsic for "+e+" exists, but the property is not available.");return}if(h&&p+1>=r.length){var y=h(o,f);o=(d=!!y)&&"get"in y&&!("originalValue"in y.get)?y.get:o[f]}else d=A(o,f),o=o[f];d&&!s&&(w[a]=o)}}return o}},7296:(e,t,r)=>{"use strict";var n=r(210)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},1044:(e,t,r)=>{"use strict";var n=r(4429),i=function(){return!!n};i.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(e){return!0}},e.exports=i},8185:e=>{"use strict";var t={__proto__:null,foo:{}},r=Object;e.exports=function(){return{__proto__:t}.foo===t.foo&&!(t instanceof r)}},1405:(e,t,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(5419);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},5419:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},8824:(e,t,r)=>{"use strict";var n=Function.prototype.call,i=Object.prototype.hasOwnProperty,a=r(8612);e.exports=a.call(n,i)},9832:(e,t,r)=>{e.exports=function e(t,r,n){function i(o,s){if(!r[o]){if(!t[o]){if(a)return a(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[o]={exports:{}};t[o][0].call(c.exports,(function(e){return i(t[o][1][e]||e)}),c,c.exports,e,t,r,n)}return r[o].exports}for(var a=void 0,o=0;o<n.length;o++)i(n[o]);return i}({"./aesprim":[function(e,t,r){!function(e,t){"use strict";t(void 0!==r?r:e.esprima={})}(this,(function(e){"use strict";var t,r,n,i,a,o,s,l,c,u,p,d,h,f,m,g,y,_;function b(e,t){if(!e)throw new Error("ASSERT: "+t)}function v(e){return e>=48&&e<=57}function w(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function S(e){return"01234567".indexOf(e)>=0}function E(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0}function x(e){return 10===e||13===e||8232===e||8233===e}function k(e){return 64==e||36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&s.NonAsciiIdentifierStart.test(String.fromCharCode(e))}function A(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&s.NonAsciiIdentifierPart.test(String.fromCharCode(e))}function I(e){switch(e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}}function j(e){return"eval"===e||"arguments"===e}function O(e){if(u&&I(e))return!0;switch(e.length){case 2:return"if"===e||"in"===e||"do"===e;case 3:return"var"===e||"for"===e||"new"===e||"try"===e||"let"===e;case 4:return"this"===e||"else"===e||"case"===e||"void"===e||"with"===e||"enum"===e;case 5:return"while"===e||"break"===e||"catch"===e||"throw"===e||"const"===e||"yield"===e||"class"===e||"super"===e;case 6:return"return"===e||"typeof"===e||"delete"===e||"switch"===e||"export"===e||"import"===e;case 7:return"default"===e||"finally"===e||"extends"===e;case 8:return"function"===e||"continue"===e||"debugger"===e;case 10:return"instanceof"===e;default:return!1}}function P(e,t,r,n,i){var a;b("number"==typeof r,"Comment must have valid position"),y.lastCommentStart>=r||(y.lastCommentStart=r,a={type:e,value:t},_.range&&(a.range=[r,n]),_.loc&&(a.loc=i),_.comments.push(a),_.attachComment&&(_.leadingComments.push(a),_.trailingComments.push(a)))}function T(e){var t,r,n,i;for(t=p-e,r={start:{line:d,column:p-h-e}};p<f;)if(n=c.charCodeAt(p),++p,x(n))return _.comments&&(i=c.slice(t+e,p-1),r.end={line:d,column:p-h-1},P("Line",i,t,p-1,r)),13===n&&10===c.charCodeAt(p)&&++p,++d,void(h=p);_.comments&&(i=c.slice(t+e,p),r.end={line:d,column:p-h},P("Line",i,t,p,r))}function C(){var e,t,r,n;for(_.comments&&(e=p-2,t={start:{line:d,column:p-h-2}});p<f;)if(x(r=c.charCodeAt(p)))13===r&&10===c.charCodeAt(p+1)&&++p,++d,++p,h=p,p>=f&&J({},o.UnexpectedToken,"ILLEGAL");else if(42===r){if(47===c.charCodeAt(p+1))return++p,++p,void(_.comments&&(n=c.slice(e+2,p-2),t.end={line:d,column:p-h},P("Block",n,e,p,t)));++p}else++p;J({},o.UnexpectedToken,"ILLEGAL")}function N(){var e,t;for(t=0===p;p<f;)if(E(e=c.charCodeAt(p)))++p;else if(x(e))++p,13===e&&10===c.charCodeAt(p)&&++p,++d,h=p,t=!0;else if(47===e)if(47===(e=c.charCodeAt(p+1)))++p,++p,T(2),t=!0;else{if(42!==e)break;++p,++p,C()}else if(t&&45===e){if(45!==c.charCodeAt(p+1)||62!==c.charCodeAt(p+2))break;p+=3,T(3)}else{if(60!==e)break;if("!--"!==c.slice(p+1,p+4))break;++p,++p,++p,++p,T(4)}}function L(e){var t,r,n,i=0;for(r="u"===e?4:2,t=0;t<r;++t){if(!(p<f&&w(c[p])))return"";n=c[p++],i=16*i+"0123456789abcdef".indexOf(n.toLowerCase())}return String.fromCharCode(i)}function M(){var e,t;for(e=c.charCodeAt(p++),t=String.fromCharCode(e),92===e&&(117!==c.charCodeAt(p)&&J({},o.UnexpectedToken,"ILLEGAL"),++p,(e=L("u"))&&"\\"!==e&&k(e.charCodeAt(0))||J({},o.UnexpectedToken,"ILLEGAL"),t=e);p<f&&A(e=c.charCodeAt(p));)++p,t+=String.fromCharCode(e),92===e&&(t=t.substr(0,t.length-1),117!==c.charCodeAt(p)&&J({},o.UnexpectedToken,"ILLEGAL"),++p,(e=L("u"))&&"\\"!==e&&A(e.charCodeAt(0))||J({},o.UnexpectedToken,"ILLEGAL"),t+=e);return t}function F(){var e,t;for(e=p++;p<f;){if(92===(t=c.charCodeAt(p)))return p=e,M();if(!A(t))break;++p}return c.slice(e,p)}function R(){var e,r,n,i,a=p,s=c.charCodeAt(p),l=c[p];switch(s){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++p,_.tokenize&&(40===s?_.openParenToken=_.tokens.length:123===s&&(_.openCurlyToken=_.tokens.length)),{type:t.Punctuator,value:String.fromCharCode(s),lineNumber:d,lineStart:h,start:a,end:p};default:if(61===(e=c.charCodeAt(p+1)))switch(s){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return p+=2,{type:t.Punctuator,value:String.fromCharCode(s)+String.fromCharCode(e),lineNumber:d,lineStart:h,start:a,end:p};case 33:case 61:return p+=2,61===c.charCodeAt(p)&&++p,{type:t.Punctuator,value:c.slice(a,p),lineNumber:d,lineStart:h,start:a,end:p}}}return">>>="===(i=c.substr(p,4))?(p+=4,{type:t.Punctuator,value:i,lineNumber:d,lineStart:h,start:a,end:p}):">>>"===(n=i.substr(0,3))||"<<="===n||">>="===n?(p+=3,{type:t.Punctuator,value:n,lineNumber:d,lineStart:h,start:a,end:p}):l===(r=n.substr(0,2))[1]&&"+-<>&|".indexOf(l)>=0||"=>"===r?(p+=2,{type:t.Punctuator,value:r,lineNumber:d,lineStart:h,start:a,end:p}):"<>=!+-*%&|^/".indexOf(l)>=0?(++p,{type:t.Punctuator,value:l,lineNumber:d,lineStart:h,start:a,end:p}):void J({},o.UnexpectedToken,"ILLEGAL")}function D(){var e,r,n;if(b(v((n=c[p]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),r=p,e="","."!==n){if(e=c[p++],n=c[p],"0"===e){if("x"===n||"X"===n)return++p,function(e){for(var r="";p<f&&w(c[p]);)r+=c[p++];return 0===r.length&&J({},o.UnexpectedToken,"ILLEGAL"),k(c.charCodeAt(p))&&J({},o.UnexpectedToken,"ILLEGAL"),{type:t.NumericLiteral,value:parseInt("0x"+r,16),lineNumber:d,lineStart:h,start:e,end:p}}(r);if(S(n))return function(e){for(var r="0"+c[p++];p<f&&S(c[p]);)r+=c[p++];return(k(c.charCodeAt(p))||v(c.charCodeAt(p)))&&J({},o.UnexpectedToken,"ILLEGAL"),{type:t.NumericLiteral,value:parseInt(r,8),octal:!0,lineNumber:d,lineStart:h,start:e,end:p}}(r);n&&v(n.charCodeAt(0))&&J({},o.UnexpectedToken,"ILLEGAL")}for(;v(c.charCodeAt(p));)e+=c[p++];n=c[p]}if("."===n){for(e+=c[p++];v(c.charCodeAt(p));)e+=c[p++];n=c[p]}if("e"===n||"E"===n)if(e+=c[p++],"+"!==(n=c[p])&&"-"!==n||(e+=c[p++]),v(c.charCodeAt(p)))for(;v(c.charCodeAt(p));)e+=c[p++];else J({},o.UnexpectedToken,"ILLEGAL");return k(c.charCodeAt(p))&&J({},o.UnexpectedToken,"ILLEGAL"),{type:t.NumericLiteral,value:parseFloat(e),lineNumber:d,lineStart:h,start:r,end:p}}function q(){var e,r,n,i;return g=null,N(),e=p,r=function(){var e,t,r,n;for(b("/"===(e=c[p]),"Regular expression literal must start with a slash"),t=c[p++],r=!1,n=!1;p<f;)if(t+=e=c[p++],"\\"===e)x((e=c[p++]).charCodeAt(0))&&J({},o.UnterminatedRegExp),t+=e;else if(x(e.charCodeAt(0)))J({},o.UnterminatedRegExp);else if(r)"]"===e&&(r=!1);else{if("/"===e){n=!0;break}"["===e&&(r=!0)}return n||J({},o.UnterminatedRegExp),{value:t.substr(1,t.length-2),literal:t}}(),n=function(){var e,t,r,n;for(t="",r="";p<f&&A((e=c[p]).charCodeAt(0));)if(++p,"\\"===e&&p<f)if("u"===(e=c[p])){if(n=++p,e=L("u"))for(r+=e,t+="\\u";n<p;++n)t+=c[n];else p=n,r+="u",t+="\\u";X({},o.UnexpectedToken,"ILLEGAL")}else t+="\\",X({},o.UnexpectedToken,"ILLEGAL");else r+=e,t+=e;return{value:r,literal:t}}(),i=function(e,t){var r;try{r=new RegExp(e,t)}catch(e){J({},o.InvalidRegExp)}return r}(r.value,n.value),_.tokenize?{type:t.RegularExpression,value:i,lineNumber:d,lineStart:h,start:e,end:p}:{literal:r.literal+n.literal,value:i,start:e,end:p}}function U(){var e,t,r,n;return N(),e=p,t={start:{line:d,column:p-h}},r=q(),t.end={line:d,column:p-h},_.tokenize||(_.tokens.length>0&&(n=_.tokens[_.tokens.length-1]).range[0]===e&&"Punctuator"===n.type&&("/"!==n.value&&"/="!==n.value||_.tokens.pop()),_.tokens.push({type:"RegularExpression",value:r.literal,range:[e,p],loc:t})),r}function B(){var e,r,i;return N(),p>=f?{type:t.EOF,lineNumber:d,lineStart:h,start:p,end:p}:k(e=c.charCodeAt(p))?(r=p,{type:1===(i=92===c.charCodeAt(p)?M():F()).length?t.Identifier:O(i)?t.Keyword:"null"===i?t.NullLiteral:"true"===i||"false"===i?t.BooleanLiteral:t.Identifier,value:i,lineNumber:d,lineStart:h,start:r,end:p}):40===e||41===e||59===e?R():39===e||34===e?function(){var e,r,n,i,a,s,l,u,m="",g=!1;for(l=d,u=h,b("'"===(e=c[p])||'"'===e,"String literal must starts with a quote"),r=p,++p;p<f;){if((n=c[p++])===e){e="";break}if("\\"===n)if((n=c[p++])&&x(n.charCodeAt(0)))++d,"\r"===n&&"\n"===c[p]&&++p,h=p;else switch(n){case"u":case"x":s=p,(a=L(n))?m+=a:(p=s,m+=n);break;case"n":m+="\n";break;case"r":m+="\r";break;case"t":m+="\t";break;case"b":m+="\b";break;case"f":m+="\f";break;case"v":m+="\v";break;default:S(n)?(0!==(i="01234567".indexOf(n))&&(g=!0),p<f&&S(c[p])&&(g=!0,i=8*i+"01234567".indexOf(c[p++]),"0123".indexOf(n)>=0&&p<f&&S(c[p])&&(i=8*i+"01234567".indexOf(c[p++]))),m+=String.fromCharCode(i)):m+=n}else{if(x(n.charCodeAt(0)))break;m+=n}}return""!==e&&J({},o.UnexpectedToken,"ILLEGAL"),{type:t.StringLiteral,value:m,octal:g,startLineNumber:l,startLineStart:u,lineNumber:d,lineStart:h,start:r,end:p}}():46===e?v(c.charCodeAt(p+1))?D():R():v(e)?D():_.tokenize&&47===e?function(){var e,t;if(!(e=_.tokens[_.tokens.length-1]))return U();if("Punctuator"===e.type){if("]"===e.value)return R();if(")"===e.value)return!(t=_.tokens[_.openParenToken-1])||"Keyword"!==t.type||"if"!==t.value&&"while"!==t.value&&"for"!==t.value&&"with"!==t.value?R():U();if("}"===e.value){if(_.tokens[_.openCurlyToken-3]&&"Keyword"===_.tokens[_.openCurlyToken-3].type){if(!(t=_.tokens[_.openCurlyToken-4]))return R()}else{if(!_.tokens[_.openCurlyToken-4]||"Keyword"!==_.tokens[_.openCurlyToken-4].type)return R();if(!(t=_.tokens[_.openCurlyToken-5]))return U()}return n.indexOf(t.value)>=0?R():U()}return U()}return"Keyword"===e.type?U():R()}():R()}function $(){var e,n,i;return N(),e={start:{line:d,column:p-h}},n=B(),e.end={line:d,column:p-h},n.type!==t.EOF&&(i=c.slice(n.start,n.end),_.tokens.push({type:r[n.type],value:i,range:[n.start,n.end],loc:e})),n}function G(){var e;return p=(e=g).end,d=e.lineNumber,h=e.lineStart,g=void 0!==_.tokens?$():B(),p=e.end,d=e.lineNumber,h=e.lineStart,e}function W(){var e,t,r;e=p,t=d,r=h,g=void 0!==_.tokens?$():B(),p=e,d=t,h=r}function H(e,t){this.line=e,this.column=t}function V(e,t,r,n){this.start=new H(e,t),this.end=new H(r,n)}function z(){var e,t,r,n;return e=p,t=d,r=h,N(),n=d!==t,p=e,d=t,h=r,n}function J(e,t){var r,n=Array.prototype.slice.call(arguments,2),i=t.replace(/%(\d)/g,(function(e,t){return b(t<n.length,"Message reference must be in range"),n[t]}));throw"number"==typeof e.lineNumber?((r=new Error("Line "+e.lineNumber+": "+i)).index=e.start,r.lineNumber=e.lineNumber,r.column=e.start-h+1):((r=new Error("Line "+d+": "+i)).index=p,r.lineNumber=d,r.column=p-h+1),r.description=i,r}function X(){try{J.apply(null,arguments)}catch(e){if(!_.errors)throw e;_.errors.push(e)}}function Q(e){if(e.type===t.EOF&&J(e,o.UnexpectedEOS),e.type===t.NumericLiteral&&J(e,o.UnexpectedNumber),e.type===t.StringLiteral&&J(e,o.UnexpectedString),e.type===t.Identifier&&J(e,o.UnexpectedIdentifier),e.type===t.Keyword){if(function(e){switch(e){case"class":case"enum":case"export":case"extends":case"import":case"super":return!0;default:return!1}}(e.value))J(e,o.UnexpectedReserved);else if(u&&I(e.value))return void X(e,o.StrictReservedWord);J(e,o.UnexpectedToken,e.value)}J(e,o.UnexpectedToken,e.value)}function Y(e){var r=G();r.type===t.Punctuator&&r.value===e||Q(r)}function K(e){var r=G();r.type===t.Keyword&&r.value===e||Q(r)}function Z(e){return g.type===t.Punctuator&&g.value===e}function ee(e){return g.type===t.Keyword&&g.value===e}function te(){var e;59===c.charCodeAt(p)||Z(";")?G():(e=d,N(),d===e&&(g.type===t.EOF||Z("}")||Q(g)))}function re(e){return e.type===i.Identifier||e.type===i.MemberExpression}function ne(e,t){var r,n,i;return r=u,i=g,n=Ae(),t&&u&&j(e[0].name)&&X(t,o.StrictParamName),u=r,m.markEnd(m.createFunctionExpression(null,e,[],n),i)}function ie(){var e,r;return r=g,(e=G()).type===t.StringLiteral||e.type===t.NumericLiteral?(u&&e.octal&&X(e,o.StrictOctalLiteral),m.markEnd(m.createLiteral(e),r)):m.markEnd(m.createIdentifier(e.value),r)}function ae(){var e,r,n,i,a,s;return s=g,(e=g).type===t.Identifier?(n=ie(),"get"!==e.value||Z(":")?"set"!==e.value||Z(":")?(Y(":"),i=ge(),m.markEnd(m.createProperty("init",n,i),s)):(r=ie(),Y("("),(e=g).type!==t.Identifier?(Y(")"),X(e,o.UnexpectedToken,e.value),i=ne([])):(a=[be()],Y(")"),i=ne(a,e)),m.markEnd(m.createProperty("set",r,i),s)):(r=ie(),Y("("),Y(")"),i=ne([]),m.markEnd(m.createProperty("get",r,i),s))):e.type!==t.EOF&&e.type!==t.Punctuator?(r=ie(),Y(":"),i=ge(),m.markEnd(m.createProperty("init",r,i),s)):void Q(e)}function oe(){var e,r,n,s;if(Z("("))return function(){var e;return Y("("),e=ye(),Y(")"),e}();if(Z("["))return function(){var e,t=[];for(e=g,Y("[");!Z("]");)Z(",")?(G(),t.push(null)):(t.push(ge()),Z("]")||Y(","));return G(),m.markEnd(m.createArrayExpression(t),e)}();if(Z("{"))return function(){var e,t,r,n,s,l=[],c={},p=String;for(s=g,Y("{");!Z("}");)t=(e=ae()).key.type===i.Identifier?e.key.name:p(e.key.value),n="init"===e.kind?a.Data:"get"===e.kind?a.Get:a.Set,r="$"+t,Object.prototype.hasOwnProperty.call(c,r)?(c[r]===a.Data?u&&n===a.Data?X({},o.StrictDuplicateProperty):n!==a.Data&&X({},o.AccessorDataProperty):n===a.Data?X({},o.AccessorDataProperty):c[r]&n&&X({},o.AccessorGetSet),c[r]|=n):c[r]=n,l.push(e),Z("}")||Y(",");return Y("}"),m.markEnd(m.createObjectExpression(l),s)}();if(e=g.type,s=g,e===t.Identifier)n=m.createIdentifier(G().value);else if(e===t.StringLiteral||e===t.NumericLiteral)u&&g.octal&&X(g,o.StrictOctalLiteral),n=m.createLiteral(G());else if(e===t.Keyword){if(ee("function"))return function(){var e,t,r,n,i,a,s,l,c=null,p=[];return l=g,K("function"),Z("(")||(e=g,c=be(),u?j(e.value)&&X(e,o.StrictFunctionName):j(e.value)?(r=e,n=o.StrictFunctionName):I(e.value)&&(r=e,n=o.StrictReservedWord)),p=(i=Ie(r)).params,t=i.stricted,r=i.firstRestricted,i.message&&(n=i.message),s=u,a=Ae(),u&&r&&J(r,n),u&&t&&X(t,n),u=s,m.markEnd(m.createFunctionExpression(c,p,[],a),l)}();ee("this")?(G(),n=m.createThisExpression()):Q(G())}else e===t.BooleanLiteral?((r=G()).value="true"===r.value,n=m.createLiteral(r)):e===t.NullLiteral?((r=G()).value=null,n=m.createLiteral(r)):Z("/")||Z("/=")?(n=void 0!==_.tokens?m.createLiteral(U()):m.createLiteral(q()),W()):Q(G());return m.markEnd(n,s)}function se(){var e=[];if(Y("("),!Z(")"))for(;p<f&&(e.push(ge()),!Z(")"));)Y(",");return Y(")"),e}function le(){var e,r;return r=g,function(e){return e.type===t.Identifier||e.type===t.Keyword||e.type===t.BooleanLiteral||e.type===t.NullLiteral}(e=G())||Q(e),m.markEnd(m.createIdentifier(e.value),r)}function ce(){return Y("."),le()}function ue(){var e;return Y("["),e=ye(),Y("]"),e}function pe(){var e,t,r;return r=g,K("new"),e=function(){var e,t,r,n;for(n=g,e=y.allowIn,t=ee("new")?pe():oe(),y.allowIn=e;Z(".")||Z("[");)Z("[")?(r=ue(),t=m.createMemberExpression("[",t,r)):(r=ce(),t=m.createMemberExpression(".",t,r)),m.markEnd(t,n);return t}(),t=Z("(")?se():[],m.markEnd(m.createNewExpression(e,t),r)}function de(){var e,r,n=g;return e=function(){var e,t,r,n,i;for(i=g,e=y.allowIn,y.allowIn=!0,t=ee("new")?pe():oe(),y.allowIn=e;;){if(Z("."))n=ce(),t=m.createMemberExpression(".",t,n);else if(Z("("))r=se(),t=m.createCallExpression(t,r);else{if(!Z("["))break;n=ue(),t=m.createMemberExpression("[",t,n)}m.markEnd(t,i)}return t}(),g.type===t.Punctuator&&(!Z("++")&&!Z("--")||z()||(u&&e.type===i.Identifier&&j(e.name)&&X({},o.StrictLHSPostfix),re(e)||X({},o.InvalidLHSInAssignment),r=G(),e=m.markEnd(m.createPostfixExpression(r.value,e),n))),e}function he(){var e,r,n;return g.type!==t.Punctuator&&g.type!==t.Keyword?r=de():Z("++")||Z("--")?(n=g,e=G(),r=he(),u&&r.type===i.Identifier&&j(r.name)&&X({},o.StrictLHSPrefix),re(r)||X({},o.InvalidLHSInAssignment),r=m.createUnaryExpression(e.value,r),r=m.markEnd(r,n)):Z("+")||Z("-")||Z("~")||Z("!")?(n=g,e=G(),r=he(),r=m.createUnaryExpression(e.value,r),r=m.markEnd(r,n)):ee("delete")||ee("void")||ee("typeof")?(n=g,e=G(),r=he(),r=m.createUnaryExpression(e.value,r),r=m.markEnd(r,n),u&&"delete"===r.operator&&r.argument.type===i.Identifier&&X({},o.StrictDelete)):r=de(),r}function fe(e,r){var n=0;if(e.type!==t.Punctuator&&e.type!==t.Keyword)return 0;switch(e.value){case"||":n=1;break;case"&&":n=2;break;case"|":n=3;break;case"^":n=4;break;case"&":n=5;break;case"==":case"!=":case"===":case"!==":n=6;break;case"<":case">":case"<=":case">=":case"instanceof":n=7;break;case"in":n=r?7:0;break;case"<<":case">>":case">>>":n=8;break;case"+":case"-":n=9;break;case"*":case"/":case"%":n=11}return n}function me(){var e,t,r,n,i;return i=g,e=function(){var e,t,r,n,i,a,o,s,l,c;if(e=g,l=he(),0===(i=fe(n=g,y.allowIn)))return l;for(n.prec=i,G(),t=[e,g],a=[l,n,o=he()];(i=fe(g,y.allowIn))>0;){for(;a.length>2&&i<=a[a.length-2].prec;)o=a.pop(),s=a.pop().value,l=a.pop(),r=m.createBinaryExpression(s,l,o),t.pop(),e=t[t.length-1],m.markEnd(r,e),a.push(r);(n=G()).prec=i,a.push(n),t.push(g),r=he(),a.push(r)}for(r=a[c=a.length-1],t.pop();c>1;)r=m.createBinaryExpression(a[c-1].value,a[c-2],r),c-=2,e=t.pop(),m.markEnd(r,e);return r}(),Z("?")&&(G(),t=y.allowIn,y.allowIn=!0,r=ge(),y.allowIn=t,Y(":"),n=ge(),e=m.createConditionalExpression(e,r,n),m.markEnd(e,i)),e}function ge(){var e,r,n,a,s,l;return e=g,s=g,a=r=me(),g.type===t.Punctuator&&("="===(l=g.value)||"*="===l||"/="===l||"%="===l||"+="===l||"-="===l||"<<="===l||">>="===l||">>>="===l||"&="===l||"^="===l||"|="===l)&&(re(r)||X({},o.InvalidLHSInAssignment),u&&r.type===i.Identifier&&j(r.name)&&X(e,o.StrictLHSAssignment),e=G(),n=ge(),a=m.markEnd(m.createAssignmentExpression(e.value,r,n),s)),a}function ye(){var e,t=g;if(e=ge(),Z(",")){for(e=m.createSequenceExpression([e]);p<f&&Z(",");)G(),e.expressions.push(ge());m.markEnd(e,t)}return e}function _e(){var e,t;return t=g,Y("{"),e=function(){for(var e,t=[];p<f&&!Z("}")&&void 0!==(e=Oe());)t.push(e);return t}(),Y("}"),m.markEnd(m.createBlockStatement(e),t)}function be(){var e,r;return r=g,(e=G()).type!==t.Identifier&&Q(e),m.markEnd(m.createIdentifier(e.value),r)}function ve(e){var t,r,n=null;return r=g,t=be(),u&&j(t.name)&&X({},o.StrictVarName),"const"===e?(Y("="),n=ge()):Z("=")&&(G(),n=ge()),m.markEnd(m.createVariableDeclarator(t,n),r)}function we(e){var t=[];do{if(t.push(ve(e)),!Z(","))break;G()}while(p<f);return t}function Se(){var e,t,r,n,i,a,s,l,c,u;return e=t=r=null,K("for"),Y("("),Z(";")?G():(ee("var")||ee("let")?(y.allowIn=!1,u=g,l=G(),c=we(),e=m.markEnd(m.createVariableDeclaration(c,l.value),u),y.allowIn=!0,1===e.declarations.length&&ee("in")&&(G(),n=e,i=ye(),e=null)):(y.allowIn=!1,e=ye(),y.allowIn=!0,ee("in")&&(re(e)||X({},o.InvalidLHSInForIn),G(),n=e,i=ye(),e=null)),void 0===n&&Y(";")),void 0===n&&(Z(";")||(t=ye()),Y(";"),Z(")")||(r=ye())),Y(")"),s=y.inIteration,y.inIteration=!0,a=ke(),y.inIteration=s,void 0===n?m.createForStatement(e,t,r,a):m.createForInStatement(n,i,a)}function Ee(){var e,t,r,n=[];for(r=g,ee("default")?(G(),e=null):(K("case"),e=ye()),Y(":");p<f&&!(Z("}")||ee("default")||ee("case"));)t=ke(),n.push(t);return m.markEnd(m.createSwitchCase(e,n),r)}function xe(){var e,t,r,n,i=[],a=null;return K("try"),e=_e(),ee("catch")&&i.push((n=g,K("catch"),Y("("),Z(")")&&Q(g),t=be(),u&&j(t.name)&&X({},o.StrictCatchVariable),Y(")"),r=_e(),m.markEnd(m.createCatchClause(t,r),n))),ee("finally")&&(G(),a=_e()),0!==i.length||a||J({},o.NoCatchOrFinally),m.createTryStatement(e,[],i,a)}function ke(){var e,r,n,a,s,l,d,h,_,b=g.type;if(b===t.EOF&&Q(g),b===t.Punctuator&&"{"===g.value)return _e();if(a=g,b===t.Punctuator)switch(g.value){case";":return m.markEnd((Y(";"),m.createEmptyStatement()),a);case"(":return m.markEnd(function(){var e=ye();return te(),m.createExpressionStatement(e)}(),a)}if(b===t.Keyword)switch(g.value){case"break":return m.markEnd(function(){var e,r=null;return K("break"),59===c.charCodeAt(p)?(G(),y.inIteration||y.inSwitch||J({},o.IllegalBreak),m.createBreakStatement(null)):z()?(y.inIteration||y.inSwitch||J({},o.IllegalBreak),m.createBreakStatement(null)):(g.type===t.Identifier&&(e="$"+(r=be()).name,Object.prototype.hasOwnProperty.call(y.labelSet,e)||J({},o.UnknownLabel,r.name)),te(),null!==r||y.inIteration||y.inSwitch||J({},o.IllegalBreak),m.createBreakStatement(r))}(),a);case"continue":return m.markEnd(function(){var e,r=null;return K("continue"),59===c.charCodeAt(p)?(G(),y.inIteration||J({},o.IllegalContinue),m.createContinueStatement(null)):z()?(y.inIteration||J({},o.IllegalContinue),m.createContinueStatement(null)):(g.type===t.Identifier&&(e="$"+(r=be()).name,Object.prototype.hasOwnProperty.call(y.labelSet,e)||J({},o.UnknownLabel,r.name)),te(),null!==r||y.inIteration||J({},o.IllegalContinue),m.createContinueStatement(r))}(),a);case"debugger":return m.markEnd((K("debugger"),te(),m.createDebuggerStatement()),a);case"do":return m.markEnd((K("do"),_=y.inIteration,y.inIteration=!0,d=ke(),y.inIteration=_,K("while"),Y("("),h=ye(),Y(")"),Z(";")&&G(),m.createDoWhileStatement(d,h)),a);case"for":return m.markEnd(Se(),a);case"function":return m.markEnd(je(),a);case"if":return m.markEnd(function(){var e,t,r;return K("if"),Y("("),e=ye(),Y(")"),t=ke(),ee("else")?(G(),r=ke()):r=null,m.createIfStatement(e,t,r)}(),a);case"return":return m.markEnd((l=null,K("return"),y.inFunctionBody||X({},o.IllegalReturn),32===c.charCodeAt(p)&&k(c.charCodeAt(p+1))?(l=ye(),te(),m.createReturnStatement(l)):z()?m.createReturnStatement(null):(Z(";")||Z("}")||g.type===t.EOF||(l=ye()),te(),m.createReturnStatement(l))),a);case"switch":return m.markEnd(function(){var e,t,r,n,i;if(K("switch"),Y("("),e=ye(),Y(")"),Y("{"),t=[],Z("}"))return G(),m.createSwitchStatement(e,t);for(n=y.inSwitch,y.inSwitch=!0,i=!1;p<f&&!Z("}");)null===(r=Ee()).test&&(i&&J({},o.MultipleDefaultsInSwitch),i=!0),t.push(r);return y.inSwitch=n,Y("}"),m.createSwitchStatement(e,t)}(),a);case"throw":return m.markEnd(function(){var e;return K("throw"),z()&&J({},o.NewlineAfterThrow),e=ye(),te(),m.createThrowStatement(e)}(),a);case"try":return m.markEnd(xe(),a);case"var":return m.markEnd((K("var"),s=we(),te(),m.createVariableDeclaration(s,"var")),a);case"while":return m.markEnd(function(){var e,t,r;return K("while"),Y("("),e=ye(),Y(")"),r=y.inIteration,y.inIteration=!0,t=ke(),y.inIteration=r,m.createWhileStatement(e,t)}(),a);case"with":return m.markEnd(function(){var e,t;return u&&(N(),X({},o.StrictModeWith)),K("with"),Y("("),e=ye(),Y(")"),t=ke(),m.createWithStatement(e,t)}(),a)}return(e=ye()).type===i.Identifier&&Z(":")?(G(),n="$"+e.name,Object.prototype.hasOwnProperty.call(y.labelSet,n)&&J({},o.Redeclaration,"Label",e.name),y.labelSet[n]=!0,r=ke(),delete y.labelSet[n],m.markEnd(m.createLabeledStatement(e,r),a)):(te(),m.markEnd(m.createExpressionStatement(e),a))}function Ae(){var e,r,n,a,s,l,d,h,_=[];for(h=g,Y("{");p<f&&g.type===t.StringLiteral&&(r=g,e=Oe(),_.push(e),e.expression.type===i.Literal);)"use strict"===c.slice(r.start+1,r.end-1)?(u=!0,n&&X(n,o.StrictOctalLiteral)):!n&&r.octal&&(n=r);for(a=y.labelSet,s=y.inIteration,l=y.inSwitch,d=y.inFunctionBody,y.labelSet={},y.inIteration=!1,y.inSwitch=!1,y.inFunctionBody=!0;p<f&&!Z("}")&&void 0!==(e=Oe());)_.push(e);return Y("}"),y.labelSet=a,y.inIteration=s,y.inSwitch=l,y.inFunctionBody=d,m.markEnd(m.createBlockStatement(_),h)}function Ie(e){var t,r,n,i,a,s,l=[];if(Y("("),!Z(")"))for(i={};p<f&&(r=g,t=be(),a="$"+r.value,u?(j(r.value)&&(n=r,s=o.StrictParamName),Object.prototype.hasOwnProperty.call(i,a)&&(n=r,s=o.StrictParamDupe)):e||(j(r.value)?(e=r,s=o.StrictParamName):I(r.value)?(e=r,s=o.StrictReservedWord):Object.prototype.hasOwnProperty.call(i,a)&&(e=r,s=o.StrictParamDupe)),l.push(t),i[a]=!0,!Z(")"));)Y(",");return Y(")"),{params:l,stricted:n,firstRestricted:e,message:s}}function je(){var e,t,r,n,i,a,s,l,c,p;return c=g,K("function"),r=g,e=be(),u?j(r.value)&&X(r,o.StrictFunctionName):j(r.value)?(a=r,s=o.StrictFunctionName):I(r.value)&&(a=r,s=o.StrictReservedWord),p=(i=Ie(a)).params,n=i.stricted,a=i.firstRestricted,i.message&&(s=i.message),l=u,t=Ae(),u&&a&&J(a,s),u&&n&&X(n,s),u=l,m.markEnd(m.createFunctionDeclaration(e,p,[],t),c)}function Oe(){if(g.type===t.Keyword)switch(g.value){case"const":case"let":return e=g.value,n=g,K(e),r=we(e),te(),m.markEnd(m.createVariableDeclaration(r,e),n);case"function":return je();default:return ke()}var e,r,n;if(g.type!==t.EOF)return ke()}function Pe(){var e,r;return N(),W(),r=g,u=!1,e=function(){for(var e,r,n,a=[];p<f&&(r=g).type===t.StringLiteral&&(e=Oe(),a.push(e),e.expression.type===i.Literal);)"use strict"===c.slice(r.start+1,r.end-1)?(u=!0,n&&X(n,o.StrictOctalLiteral)):!n&&r.octal&&(n=r);for(;p<f&&void 0!==(e=Oe());)a.push(e);return a}(),m.markEnd(m.createProgram(e),r)}function Te(){var e,t,r,n=[];for(e=0;e<_.tokens.length;++e)r={type:(t=_.tokens[e]).type,value:t.value},_.range&&(r.range=t.range),_.loc&&(r.loc=t.loc),n.push(r);_.tokens=n}(r={})[(t={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8,RegularExpression:9}).BooleanLiteral]="Boolean",r[t.EOF]="<end>",r[t.Identifier]="Identifier",r[t.Keyword]="Keyword",r[t.NullLiteral]="Null",r[t.NumericLiteral]="Numeric",r[t.Punctuator]="Punctuator",r[t.StringLiteral]="String",r[t.RegularExpression]="RegularExpression",n=["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="],i={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement"},a={Data:1,Get:2,Set:4},o={UnexpectedToken:"Unexpected token %0",UnexpectedNumber:"Unexpected number",UnexpectedString:"Unexpected string",UnexpectedIdentifier:"Unexpected identifier",UnexpectedReserved:"Unexpected reserved word",UnexpectedEOS:"Unexpected end of input",NewlineAfterThrow:"Illegal newline after throw",InvalidRegExp:"Invalid regular expression",UnterminatedRegExp:"Invalid regular expression: missing /",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NoCatchOrFinally:"Missing catch or finally after try",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared",IllegalContinue:"Illegal continue statement",IllegalBreak:"Illegal break statement",IllegalReturn:"Illegal return statement",StrictModeWith:"Strict mode code may not include a with statement",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictDuplicateProperty:"Duplicate data property in object literal not allowed in strict mode",AccessorDataProperty:"Object literal may not have data and accessor property with the same name",AccessorGetSet:"Object literal may not have multiple get/set accessors with the same name",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode"},s={NonAsciiIdentifierStart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԧԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠࢢ-ࢬࣤ-ࣾऀ-ॣ०-९ॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶᴀ-ᷦ᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‌‍‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺꩻꪀ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︦︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]")},l={name:"SyntaxTree",processComment:function(e){var t,r;if(!(e.type===i.Program&&e.body.length>0)){for(_.trailingComments.length>0?_.trailingComments[0].range[0]>=e.range[1]?(r=_.trailingComments,_.trailingComments=[]):_.trailingComments.length=0:_.bottomRightStack.length>0&&_.bottomRightStack[_.bottomRightStack.length-1].trailingComments&&_.bottomRightStack[_.bottomRightStack.length-1].trailingComments[0].range[0]>=e.range[1]&&(r=_.bottomRightStack[_.bottomRightStack.length-1].trailingComments,delete _.bottomRightStack[_.bottomRightStack.length-1].trailingComments);_.bottomRightStack.length>0&&_.bottomRightStack[_.bottomRightStack.length-1].range[0]>=e.range[0];)t=_.bottomRightStack.pop();t?t.leadingComments&&t.leadingComments[t.leadingComments.length-1].range[1]<=e.range[0]&&(e.leadingComments=t.leadingComments,delete t.leadingComments):_.leadingComments.length>0&&_.leadingComments[_.leadingComments.length-1].range[1]<=e.range[0]&&(e.leadingComments=_.leadingComments,_.leadingComments=[]),r&&(e.trailingComments=r),_.bottomRightStack.push(e)}},markEnd:function(e,t){return _.range&&(e.range=[t.start,p]),_.loc&&(e.loc=new V(void 0===t.startLineNumber?t.lineNumber:t.startLineNumber,t.start-(void 0===t.startLineStart?t.lineStart:t.startLineStart),d,p-h),this.postProcess(e)),_.attachComment&&this.processComment(e),e},postProcess:function(e){return _.source&&(e.loc.source=_.source),e},createArrayExpression:function(e){return{type:i.ArrayExpression,elements:e}},createAssignmentExpression:function(e,t,r){return{type:i.AssignmentExpression,operator:e,left:t,right:r}},createBinaryExpression:function(e,t,r){return{type:"||"===e||"&&"===e?i.LogicalExpression:i.BinaryExpression,operator:e,left:t,right:r}},createBlockStatement:function(e){return{type:i.BlockStatement,body:e}},createBreakStatement:function(e){return{type:i.BreakStatement,label:e}},createCallExpression:function(e,t){return{type:i.CallExpression,callee:e,arguments:t}},createCatchClause:function(e,t){return{type:i.CatchClause,param:e,body:t}},createConditionalExpression:function(e,t,r){return{type:i.ConditionalExpression,test:e,consequent:t,alternate:r}},createContinueStatement:function(e){return{type:i.ContinueStatement,label:e}},createDebuggerStatement:function(){return{type:i.DebuggerStatement}},createDoWhileStatement:function(e,t){return{type:i.DoWhileStatement,body:e,test:t}},createEmptyStatement:function(){return{type:i.EmptyStatement}},createExpressionStatement:function(e){return{type:i.ExpressionStatement,expression:e}},createForStatement:function(e,t,r,n){return{type:i.ForStatement,init:e,test:t,update:r,body:n}},createForInStatement:function(e,t,r){return{type:i.ForInStatement,left:e,right:t,body:r,each:!1}},createFunctionDeclaration:function(e,t,r,n){return{type:i.FunctionDeclaration,id:e,params:t,defaults:r,body:n,rest:null,generator:!1,expression:!1}},createFunctionExpression:function(e,t,r,n){return{type:i.FunctionExpression,id:e,params:t,defaults:r,body:n,rest:null,generator:!1,expression:!1}},createIdentifier:function(e){return{type:i.Identifier,name:e}},createIfStatement:function(e,t,r){return{type:i.IfStatement,test:e,consequent:t,alternate:r}},createLabeledStatement:function(e,t){return{type:i.LabeledStatement,label:e,body:t}},createLiteral:function(e){return{type:i.Literal,value:e.value,raw:c.slice(e.start,e.end)}},createMemberExpression:function(e,t,r){return{type:i.MemberExpression,computed:"["===e,object:t,property:r}},createNewExpression:function(e,t){return{type:i.NewExpression,callee:e,arguments:t}},createObjectExpression:function(e){return{type:i.ObjectExpression,properties:e}},createPostfixExpression:function(e,t){return{type:i.UpdateExpression,operator:e,argument:t,prefix:!1}},createProgram:function(e){return{type:i.Program,body:e}},createProperty:function(e,t,r){return{type:i.Property,key:t,value:r,kind:e}},createReturnStatement:function(e){return{type:i.ReturnStatement,argument:e}},createSequenceExpression:function(e){return{type:i.SequenceExpression,expressions:e}},createSwitchCase:function(e,t){return{type:i.SwitchCase,test:e,consequent:t}},createSwitchStatement:function(e,t){return{type:i.SwitchStatement,discriminant:e,cases:t}},createThisExpression:function(){return{type:i.ThisExpression}},createThrowStatement:function(e){return{type:i.ThrowStatement,argument:e}},createTryStatement:function(e,t,r,n){return{type:i.TryStatement,block:e,guardedHandlers:t,handlers:r,finalizer:n}},createUnaryExpression:function(e,t){return"++"===e||"--"===e?{type:i.UpdateExpression,operator:e,argument:t,prefix:!0}:{type:i.UnaryExpression,operator:e,argument:t,prefix:!0}},createVariableDeclaration:function(e,t){return{type:i.VariableDeclaration,declarations:e,kind:t}},createVariableDeclarator:function(e,t){return{type:i.VariableDeclarator,id:e,init:t}},createWhileStatement:function(e,t){return{type:i.WhileStatement,test:e,body:t}},createWithStatement:function(e,t){return{type:i.WithStatement,object:e,body:t}}},e.version="1.2.2",e.tokenize=function(e,r){var n;"string"==typeof e||e instanceof String||(e=String(e)),m=l,p=0,d=(c=e).length>0?1:0,h=0,f=c.length,g=null,y={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1},_={},(r=r||{}).tokens=!0,_.tokens=[],_.tokenize=!0,_.openParenToken=-1,_.openCurlyToken=-1,_.range="boolean"==typeof r.range&&r.range,_.loc="boolean"==typeof r.loc&&r.loc,"boolean"==typeof r.comment&&r.comment&&(_.comments=[]),"boolean"==typeof r.tolerant&&r.tolerant&&(_.errors=[]);try{if(W(),g.type===t.EOF)return _.tokens;for(G();g.type!==t.EOF;)try{G()}catch(e){if(_.errors){_.errors.push(e);break}throw e}Te(),n=_.tokens,void 0!==_.comments&&(n.comments=_.comments),void 0!==_.errors&&(n.errors=_.errors)}catch(e){throw e}finally{_={}}return n},e.parse=function(e,t){var r,n;n=String,"string"==typeof e||e instanceof String||(e=n(e)),m=l,p=0,d=(c=e).length>0?1:0,h=0,f=c.length,g=null,y={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1},_={},void 0!==t&&(_.range="boolean"==typeof t.range&&t.range,_.loc="boolean"==typeof t.loc&&t.loc,_.attachComment="boolean"==typeof t.attachComment&&t.attachComment,_.loc&&null!==t.source&&void 0!==t.source&&(_.source=n(t.source)),"boolean"==typeof t.tokens&&t.tokens&&(_.tokens=[]),"boolean"==typeof t.comment&&t.comment&&(_.comments=[]),"boolean"==typeof t.tolerant&&t.tolerant&&(_.errors=[]),_.attachComment&&(_.range=!0,_.comments=[],_.bottomRightStack=[],_.trailingComments=[],_.leadingComments=[]));try{r=Pe(),void 0!==_.comments&&(r.comments=_.comments),void 0!==_.tokens&&(Te(),r.tokens=_.tokens),void 0!==_.errors&&(r.errors=_.errors)}catch(e){throw e}finally{_={}}return r},e.Syntax=function(){var e,t={};for(e in"function"==typeof Object.create&&(t=Object.create(null)),i)i.hasOwnProperty(e)&&(t[e]=i[e]);return"function"==typeof Object.freeze&&Object.freeze(t),t}()}))},{}],1:[function(e,t,r){(function(n){var i=function(){var e={trace:function(){},yy:{},symbols_:{error:2,JSON_PATH:3,DOLLAR:4,PATH_COMPONENTS:5,LEADING_CHILD_MEMBER_EXPRESSION:6,PATH_COMPONENT:7,MEMBER_COMPONENT:8,SUBSCRIPT_COMPONENT:9,CHILD_MEMBER_COMPONENT:10,DESCENDANT_MEMBER_COMPONENT:11,DOT:12,MEMBER_EXPRESSION:13,DOT_DOT:14,STAR:15,IDENTIFIER:16,SCRIPT_EXPRESSION:17,INTEGER:18,END:19,CHILD_SUBSCRIPT_COMPONENT:20,DESCENDANT_SUBSCRIPT_COMPONENT:21,"[":22,SUBSCRIPT:23,"]":24,SUBSCRIPT_EXPRESSION:25,SUBSCRIPT_EXPRESSION_LIST:26,SUBSCRIPT_EXPRESSION_LISTABLE:27,",":28,STRING_LITERAL:29,ARRAY_SLICE:30,FILTER_EXPRESSION:31,QQ_STRING:32,Q_STRING:33,$accept:0,$end:1},terminals_:{2:"error",4:"DOLLAR",12:"DOT",14:"DOT_DOT",15:"STAR",16:"IDENTIFIER",17:"SCRIPT_EXPRESSION",18:"INTEGER",19:"END",22:"[",24:"]",28:",",30:"ARRAY_SLICE",31:"FILTER_EXPRESSION",32:"QQ_STRING",33:"Q_STRING"},productions_:[0,[3,1],[3,2],[3,1],[3,2],[5,1],[5,2],[7,1],[7,1],[8,1],[8,1],[10,2],[6,1],[11,2],[13,1],[13,1],[13,1],[13,1],[13,1],[9,1],[9,1],[20,3],[21,4],[23,1],[23,1],[26,1],[26,3],[27,1],[27,1],[27,1],[25,1],[25,1],[25,1],[29,1],[29,1]],performAction:function(e,r,n,i,a,o,s){i.ast||(i.ast=t,t.initialize());var l=o.length-1;switch(a){case 1:return i.ast.set({expression:{type:"root",value:o[l]}}),i.ast.unshift(),i.ast.yield();case 2:return i.ast.set({expression:{type:"root",value:o[l-1]}}),i.ast.unshift(),i.ast.yield();case 3:return i.ast.unshift(),i.ast.yield();case 4:return i.ast.set({operation:"member",scope:"child",expression:{type:"identifier",value:o[l-1]}}),i.ast.unshift(),i.ast.yield();case 5:case 6:case 11:case 13:case 18:case 21:case 22:case 23:break;case 7:i.ast.set({operation:"member"}),i.ast.push();break;case 8:i.ast.set({operation:"subscript"}),i.ast.push();break;case 9:case 19:i.ast.set({scope:"child"});break;case 10:case 20:i.ast.set({scope:"descendant"});break;case 12:i.ast.set({scope:"child",operation:"member"});break;case 14:i.ast.set({expression:{type:"wildcard",value:o[l]}});break;case 15:i.ast.set({expression:{type:"identifier",value:o[l]}});break;case 16:i.ast.set({expression:{type:"script_expression",value:o[l]}});break;case 17:i.ast.set({expression:{type:"numeric_literal",value:parseInt(o[l])}});break;case 24:o[l].length>1?i.ast.set({expression:{type:"union",value:o[l]}}):this.$=o[l];break;case 25:this.$=[o[l]];break;case 26:this.$=o[l-2].concat(o[l]);break;case 27:this.$={expression:{type:"numeric_literal",value:parseInt(o[l])}},i.ast.set(this.$);break;case 28:this.$={expression:{type:"string_literal",value:o[l]}},i.ast.set(this.$);break;case 29:this.$={expression:{type:"slice",value:o[l]}},i.ast.set(this.$);break;case 30:this.$={expression:{type:"wildcard",value:o[l]}},i.ast.set(this.$);break;case 31:this.$={expression:{type:"script_expression",value:o[l]}},i.ast.set(this.$);break;case 32:this.$={expression:{type:"filter_expression",value:o[l]}},i.ast.set(this.$);break;case 33:case 34:this.$=o[l]}},table:[{3:1,4:[1,2],6:3,13:4,15:[1,5],16:[1,6],17:[1,7],18:[1,8],19:[1,9]},{1:[3]},{1:[2,1],5:10,7:11,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,3],5:21,7:11,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,12],12:[2,12],14:[2,12],22:[2,12]},{1:[2,14],12:[2,14],14:[2,14],22:[2,14]},{1:[2,15],12:[2,15],14:[2,15],22:[2,15]},{1:[2,16],12:[2,16],14:[2,16],22:[2,16]},{1:[2,17],12:[2,17],14:[2,17],22:[2,17]},{1:[2,18],12:[2,18],14:[2,18],22:[2,18]},{1:[2,2],7:22,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,5],12:[2,5],14:[2,5],22:[2,5]},{1:[2,7],12:[2,7],14:[2,7],22:[2,7]},{1:[2,8],12:[2,8],14:[2,8],22:[2,8]},{1:[2,9],12:[2,9],14:[2,9],22:[2,9]},{1:[2,10],12:[2,10],14:[2,10],22:[2,10]},{1:[2,19],12:[2,19],14:[2,19],22:[2,19]},{1:[2,20],12:[2,20],14:[2,20],22:[2,20]},{13:23,15:[1,5],16:[1,6],17:[1,7],18:[1,8],19:[1,9]},{13:24,15:[1,5],16:[1,6],17:[1,7],18:[1,8],19:[1,9],22:[1,25]},{15:[1,29],17:[1,30],18:[1,33],23:26,25:27,26:28,27:32,29:34,30:[1,35],31:[1,31],32:[1,36],33:[1,37]},{1:[2,4],7:22,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,6],12:[2,6],14:[2,6],22:[2,6]},{1:[2,11],12:[2,11],14:[2,11],22:[2,11]},{1:[2,13],12:[2,13],14:[2,13],22:[2,13]},{15:[1,29],17:[1,30],18:[1,33],23:38,25:27,26:28,27:32,29:34,30:[1,35],31:[1,31],32:[1,36],33:[1,37]},{24:[1,39]},{24:[2,23]},{24:[2,24],28:[1,40]},{24:[2,30]},{24:[2,31]},{24:[2,32]},{24:[2,25],28:[2,25]},{24:[2,27],28:[2,27]},{24:[2,28],28:[2,28]},{24:[2,29],28:[2,29]},{24:[2,33],28:[2,33]},{24:[2,34],28:[2,34]},{24:[1,41]},{1:[2,21],12:[2,21],14:[2,21],22:[2,21]},{18:[1,33],27:42,29:34,30:[1,35],32:[1,36],33:[1,37]},{1:[2,22],12:[2,22],14:[2,22],22:[2,22]},{24:[2,26],28:[2,26]}],defaultActions:{27:[2,23],29:[2,30],30:[2,31],31:[2,32]},parseError:function(e,t){if(!t.recoverable)throw new Error(e);this.trace(e)},parse:function(e){var t=this,r=[0],n=[null],i=[],a=this.table,o="",s=0,l=0,c=0,u=i.slice.call(arguments,1);this.lexer.setInput(e),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,void 0===this.lexer.yylloc&&(this.lexer.yylloc={});var p=this.lexer.yylloc;i.push(p);var d,h=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError?this.parseError=this.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var f,m,g,y,_,b,v,w,S,E={};;){if(g=r[r.length-1],this.defaultActions[g]?y=this.defaultActions[g]:(null==f&&(d=void 0,"number"!=typeof(d=t.lexer.lex()||1)&&(d=t.symbols_[d]||d),f=d),y=a[g]&&a[g][f]),void 0===y||!y.length||!y[0]){var x;for(b in S=[],a[g])this.terminals_[b]&&b>2&&S.push("'"+this.terminals_[b]+"'");x=this.lexer.showPosition?"Parse error on line "+(s+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+S.join(", ")+", got '"+(this.terminals_[f]||f)+"'":"Parse error on line "+(s+1)+": Unexpected "+(1==f?"end of input":"'"+(this.terminals_[f]||f)+"'"),this.parseError(x,{text:this.lexer.match,token:this.terminals_[f]||f,line:this.lexer.yylineno,loc:p,expected:S})}if(y[0]instanceof Array&&y.length>1)throw new Error("Parse Error: multiple actions possible at state: "+g+", token: "+f);switch(y[0]){case 1:r.push(f),n.push(this.lexer.yytext),i.push(this.lexer.yylloc),r.push(y[1]),f=null,m?(f=m,m=null):(l=this.lexer.yyleng,o=this.lexer.yytext,s=this.lexer.yylineno,p=this.lexer.yylloc,c>0&&c--);break;case 2:if(v=this.productions_[y[1]][1],E.$=n[n.length-v],E._$={first_line:i[i.length-(v||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(v||1)].first_column,last_column:i[i.length-1].last_column},h&&(E._$.range=[i[i.length-(v||1)].range[0],i[i.length-1].range[1]]),void 0!==(_=this.performAction.apply(E,[o,l,s,this.yy,y[1],n,i].concat(u))))return _;v&&(r=r.slice(0,-1*v*2),n=n.slice(0,-1*v),i=i.slice(0,-1*v)),r.push(this.productions_[y[1]][0]),n.push(E.$),i.push(E._$),w=a[r[r.length-2]][r[r.length-1]],r.push(w);break;case 3:return!0}}return!0}},t={initialize:function(){this._nodes=[],this._node={},this._stash=[]},set:function(e){for(var t in e)this._node[t]=e[t];return this._node},node:function(e){return arguments.length&&(this._node=e),this._node},push:function(){this._nodes.push(this._node),this._node={}},unshift:function(){this._nodes.unshift(this._node),this._node={}},yield:function(){var e=this._nodes;return this.initialize(),e}},r={EOF:1,parseError:function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},setInput:function(e){return this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},unput:function(e){var t=e.length,r=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t-1),this.offset-=t;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(e){this.unput(this.match.slice(e))},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},test_match:function(e,t){var r,n,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(n=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],r=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;var e,t,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;a<i.length;a++)if((r=this._input.match(this.rules[i[a]]))&&(!t||r[0].length>t[0].length)){if(t=r,n=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(r,i[a])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,i[n]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){return this.next()||this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},pushState:function(e){this.begin(e)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(e,t,r,n){switch(r){case 0:return 4;case 1:return 14;case 2:return 12;case 3:return 15;case 4:return 16;case 5:return 22;case 6:return 24;case 7:return 28;case 8:return 30;case 9:return 18;case 10:return t.yytext=t.yytext.substr(1,t.yyleng-2),32;case 11:return t.yytext=t.yytext.substr(1,t.yyleng-2),33;case 12:return 17;case 13:return 31}},rules:[/^(?:\$)/,/^(?:\.\.)/,/^(?:\.)/,/^(?:\*)/,/^(?:[a-zA-Z_]+[a-zA-Z0-9_]*)/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?:((-?(?:0|[1-9][0-9]*)))?\:((-?(?:0|[1-9][0-9]*)))?(\:((-?(?:0|[1-9][0-9]*)))?)?)/,/^(?:(-?(?:0|[1-9][0-9]*)))/,/^(?:"(?:\\["bfnrt/\\]|\\u[a-fA-F0-9]{4}|[^"\\])*")/,/^(?:'(?:\\['bfnrt/\\]|\\u[a-fA-F0-9]{4}|[^'\\])*')/,/^(?:\(.+?\)(?=\]))/,/^(?:\?\(.+?\)(?=\]))/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}};function n(){this.yy={}}return e.lexer=r,n.prototype=e,e.Parser=n,new n}();void 0!==e&&void 0!==r&&(r.parser=i,r.Parser=i.Parser,r.parse=function(){return i.parse.apply(i,arguments)},r.main=function(t){t[1]||(console.log("Usage: "+t[0]+" FILE"),n.exit(1));var i=e("fs").readFileSync(e("path").normalize(t[1]),"utf8");return r.parser.parse(i)},void 0!==t&&e.main===t&&r.main(n.argv.slice(1)))}).call(this,e("_process"))},{_process:14,fs:12,path:13}],2:[function(e,t,r){t.exports={identifier:"[a-zA-Z_]+[a-zA-Z0-9_]*",integer:"-?(?:0|[1-9][0-9]*)",qq_string:'"(?:\\\\["bfnrt/\\\\]|\\\\u[a-fA-F0-9]{4}|[^"\\\\])*"',q_string:"'(?:\\\\['bfnrt/\\\\]|\\\\u[a-fA-F0-9]{4}|[^'\\\\])*'"}},{}],3:[function(e,t,r){var n=e("./dict"),i=e("fs"),a={lex:{macros:{esc:"\\\\",int:n.integer},rules:[["\\$","return 'DOLLAR'"],["\\.\\.","return 'DOT_DOT'"],["\\.","return 'DOT'"],["\\*","return 'STAR'"],[n.identifier,"return 'IDENTIFIER'"],["\\[","return '['"],["\\]","return ']'"],[",","return ','"],["({int})?\\:({int})?(\\:({int})?)?","return 'ARRAY_SLICE'"],["{int}","return 'INTEGER'"],[n.qq_string,"yytext = yytext.substr(1,yyleng-2); return 'QQ_STRING';"],[n.q_string,"yytext = yytext.substr(1,yyleng-2); return 'Q_STRING';"],["\\(.+?\\)(?=\\])","return 'SCRIPT_EXPRESSION'"],["\\?\\(.+?\\)(?=\\])","return 'FILTER_EXPRESSION'"]]},start:"JSON_PATH",bnf:{JSON_PATH:[["DOLLAR",'yy.ast.set({ expression: { type: "root", value: $1 } }); yy.ast.unshift(); return yy.ast.yield()'],["DOLLAR PATH_COMPONENTS",'yy.ast.set({ expression: { type: "root", value: $1 } }); yy.ast.unshift(); return yy.ast.yield()'],["LEADING_CHILD_MEMBER_EXPRESSION","yy.ast.unshift(); return yy.ast.yield()"],["LEADING_CHILD_MEMBER_EXPRESSION PATH_COMPONENTS",'yy.ast.set({ operation: "member", scope: "child", expression: { type: "identifier", value: $1 }}); yy.ast.unshift(); return yy.ast.yield()']],PATH_COMPONENTS:[["PATH_COMPONENT",""],["PATH_COMPONENTS PATH_COMPONENT",""]],PATH_COMPONENT:[["MEMBER_COMPONENT",'yy.ast.set({ operation: "member" }); yy.ast.push()'],["SUBSCRIPT_COMPONENT",'yy.ast.set({ operation: "subscript" }); yy.ast.push() ']],MEMBER_COMPONENT:[["CHILD_MEMBER_COMPONENT",'yy.ast.set({ scope: "child" })'],["DESCENDANT_MEMBER_COMPONENT",'yy.ast.set({ scope: "descendant" })']],CHILD_MEMBER_COMPONENT:[["DOT MEMBER_EXPRESSION",""]],LEADING_CHILD_MEMBER_EXPRESSION:[["MEMBER_EXPRESSION",'yy.ast.set({ scope: "child", operation: "member" })']],DESCENDANT_MEMBER_COMPONENT:[["DOT_DOT MEMBER_EXPRESSION",""]],MEMBER_EXPRESSION:[["STAR",'yy.ast.set({ expression: { type: "wildcard", value: $1 } })'],["IDENTIFIER",'yy.ast.set({ expression: { type: "identifier", value: $1 } })'],["SCRIPT_EXPRESSION",'yy.ast.set({ expression: { type: "script_expression", value: $1 } })'],["INTEGER",'yy.ast.set({ expression: { type: "numeric_literal", value: parseInt($1) } })'],["END",""]],SUBSCRIPT_COMPONENT:[["CHILD_SUBSCRIPT_COMPONENT",'yy.ast.set({ scope: "child" })'],["DESCENDANT_SUBSCRIPT_COMPONENT",'yy.ast.set({ scope: "descendant" })']],CHILD_SUBSCRIPT_COMPONENT:[["[ SUBSCRIPT ]",""]],DESCENDANT_SUBSCRIPT_COMPONENT:[["DOT_DOT [ SUBSCRIPT ]",""]],SUBSCRIPT:[["SUBSCRIPT_EXPRESSION",""],["SUBSCRIPT_EXPRESSION_LIST",'$1.length > 1? yy.ast.set({ expression: { type: "union", value: $1 } }) : $$ = $1']],SUBSCRIPT_EXPRESSION_LIST:[["SUBSCRIPT_EXPRESSION_LISTABLE","$$ = [$1]"],["SUBSCRIPT_EXPRESSION_LIST , SUBSCRIPT_EXPRESSION_LISTABLE","$$ = $1.concat($3)"]],SUBSCRIPT_EXPRESSION_LISTABLE:[["INTEGER",'$$ = { expression: { type: "numeric_literal", value: parseInt($1) } }; yy.ast.set($$)'],["STRING_LITERAL",'$$ = { expression: { type: "string_literal", value: $1 } }; yy.ast.set($$)'],["ARRAY_SLICE",'$$ = { expression: { type: "slice", value: $1 } }; yy.ast.set($$)']],SUBSCRIPT_EXPRESSION:[["STAR",'$$ = { expression: { type: "wildcard", value: $1 } }; yy.ast.set($$)'],["SCRIPT_EXPRESSION",'$$ = { expression: { type: "script_expression", value: $1 } }; yy.ast.set($$)'],["FILTER_EXPRESSION",'$$ = { expression: { type: "filter_expression", value: $1 } }; yy.ast.set($$)']],STRING_LITERAL:[["QQ_STRING","$$ = $1"],["Q_STRING","$$ = $1"]]}};i.readFileSync&&(a.moduleInclude=i.readFileSync(e.resolve("../include/module.js")),a.actionInclude=i.readFileSync(e.resolve("../include/action.js"))),t.exports=a},{"./dict":2,fs:12}],4:[function(e,t,r){var n=e("./aesprim"),i=e("./slice"),a=e("static-eval"),o=e("underscore").uniq,s=function(){return this.initialize.apply(this,arguments)};function l(t,r,i){var a=e("./index"),o=h(n.parse(r).body[0].expression,{"@":t.value}),s=i.replace(/\{\{\s*value\s*\}\}/g,o),l=a.nodes(t.value,s);return l.forEach((function(e){e.path=t.path.concat(e.path.slice(1))})),l}function c(e){return Array.isArray(e)}function u(e){return function(t,r,n,i){var a=t.value,o=t.path,s=[],l=function(t,a){var o;c(t)?(t.forEach((function(e,t){s.length>=i||n(t,e,r)&&s.push({path:a.concat(t),value:e})})),t.forEach((function(t,r){s.length>=i||e&&l(t,a.concat(r))}))):(o=t)&&!(o instanceof Array)&&o instanceof Object&&(this.keys(t).forEach((function(e){s.length>=i||n(e,t[e],r)&&s.push({path:a.concat(e),value:t[e]})})),this.keys(t).forEach((function(r){s.length>=i||e&&l(t[r],a.concat(r))})))}.bind(this);return l(a,o),s}}function p(e){return function(t,r,n){return this.descend(r,t.expression.value,e,n)}}function d(e){return function(t,r,n){return this.traverse(r,t.expression.value,e,n)}}function h(){try{return a.apply(this,arguments)}catch(e){}}function f(e){return e=e.filter((function(e){return e})),o(e,(function(e){return e.path.map((function(e){return String(e).replace("-","--")})).join("-")}))}function m(e){var t=String(e);return t.match(/^-?[0-9]+$/)?parseInt(t):null}s.prototype.initialize=function(){this.traverse=u(!0),this.descend=u()},s.prototype.keys=Object.keys,s.prototype.resolve=function(e){var t=[e.operation,e.scope,e.expression.type].join("-"),r=this._fns[t];if(!r)throw new Error("couldn't resolve key: "+t);return r.bind(this)},s.prototype.register=function(e,t){if(!t instanceof Function)throw new Error("handler must be a function");this._fns[e]=t},s.prototype._fns={"member-child-identifier":function(e,t){var r=e.expression.value,n=t.value;if(n instanceof Object&&r in n)return[{value:n[r],path:t.path.concat(r)}]},"member-descendant-identifier":d((function(e,t,r){return e==r})),"subscript-child-numeric_literal":p((function(e,t,r){return e===r})),"member-child-numeric_literal":p((function(e,t,r){return String(e)===String(r)})),"subscript-descendant-numeric_literal":d((function(e,t,r){return e===r})),"member-child-wildcard":p((function(){return!0})),"member-descendant-wildcard":d((function(){return!0})),"subscript-descendant-wildcard":d((function(){return!0})),"subscript-child-wildcard":p((function(){return!0})),"subscript-child-slice":function(e,t){if(c(t.value)){var r=e.expression.value.split(":").map(m),n=t.value.map((function(e,r){return{value:e,path:t.path.concat(r)}}));return i.apply(null,[n].concat(r))}},"subscript-child-union":function(e,t){var r=[];return e.expression.value.forEach((function(e){var n={operation:"subscript",scope:"child",expression:e.expression},i=this.resolve(n)(n,t);i&&(r=r.concat(i))}),this),f(r)},"subscript-descendant-union":function(t,r,n){var i=e(".."),a=this,o=[];return i.nodes(r,"$..*").slice(1).forEach((function(e){o.length>=n||t.expression.value.forEach((function(t){var r={operation:"subscript",scope:"child",expression:t.expression},n=a.resolve(r)(r,e);o=o.concat(n)}))})),f(o)},"subscript-child-filter_expression":function(e,t,r){var i=e.expression.value.slice(2,-1),a=n.parse(i).body[0].expression;return this.descend(t,null,(function(e,t){return h(a,{"@":t})}),r)},"subscript-descendant-filter_expression":function(e,t,r){var i=e.expression.value.slice(2,-1),a=n.parse(i).body[0].expression;return this.traverse(t,null,(function(e,t){return h(a,{"@":t})}),r)},"subscript-child-script_expression":function(e,t){return l(t,e.expression.value.slice(1,-1),"$[{{value}}]")},"member-child-script_expression":function(e,t){return l(t,e.expression.value.slice(1,-1),"$.{{value}}")},"member-descendant-script_expression":function(e,t){return l(t,e.expression.value.slice(1,-1),"$..value")}},s.prototype._fns["subscript-child-string_literal"]=s.prototype._fns["member-child-identifier"],s.prototype._fns["member-descendant-numeric_literal"]=s.prototype._fns["subscript-descendant-string_literal"]=s.prototype._fns["member-descendant-identifier"],t.exports=s},{"..":"jsonpath","./aesprim":"./aesprim","./index":5,"./slice":7,"static-eval":15,underscore:12}],5:[function(e,t,r){var n=e("assert"),i=e("./dict"),a=e("./parser"),o=e("./handlers"),s=function(){this.initialize.apply(this,arguments)};function l(e){return"[object String]"==Object.prototype.toString.call(e)}s.prototype.initialize=function(){this.parser=new a,this.handlers=new o},s.prototype.parse=function(e){return n.ok(l(e),"we need a path"),this.parser.parse(e)},s.prototype.parent=function(e,t){n.ok(e instanceof Object,"obj needs to be an object"),n.ok(t,"we need a path");var r=this.nodes(e,t)[0];return r.path.pop(),this.value(e,r.path)},s.prototype.apply=function(e,t,r){n.ok(e instanceof Object,"obj needs to be an object"),n.ok(t,"we need a path"),n.equal(typeof r,"function","fn needs to be function");var i=this.nodes(e,t).sort((function(e,t){return t.path.length-e.path.length}));return i.forEach((function(t){var n=t.path.pop(),i=this.value(e,this.stringify(t.path)),a=t.value=r.call(e,i[n]);i[n]=a}),this),i},s.prototype.value=function(e,t,r){if(n.ok(e instanceof Object,"obj needs to be an object"),n.ok(t,"we need a path"),arguments.length>=3){var i=this.nodes(e,t).shift();if(!i)return this._vivify(e,t,r);var a=i.path.slice(-1).shift();this.parent(e,this.stringify(i.path))[a]=r}return this.query(e,this.stringify(t),1).shift()},s.prototype._vivify=function(e,t,r){var i=this;n.ok(e instanceof Object,"obj needs to be an object"),n.ok(t,"we need a path");var a=this.parser.parse(t).map((function(e){return e.expression.value})),o=function(t,r){var n=t.pop(),a=i.value(e,t);a||(o(t.concat(),"string"==typeof n?{}:[]),a=i.value(e,t)),a[n]=r};return o(a,r),this.query(e,t)[0]},s.prototype.query=function(e,t,r){return n.ok(e instanceof Object,"obj needs to be an object"),n.ok(l(t),"we need a path"),this.nodes(e,t,r).map((function(e){return e.value}))},s.prototype.paths=function(e,t,r){return n.ok(e instanceof Object,"obj needs to be an object"),n.ok(t,"we need a path"),this.nodes(e,t,r).map((function(e){return e.path}))},s.prototype.nodes=function(e,t,r){if(n.ok(e instanceof Object,"obj needs to be an object"),n.ok(t,"we need a path"),0===r)return[];var i=this.parser.parse(t),a=this.handlers,o=[{path:["$"],value:e}],s=[];return i.length&&"root"==i[0].expression.type&&i.shift(),i.length?(i.forEach((function(e,t){if(!(s.length>=r)){var n=a.resolve(e),l=[];o.forEach((function(a){if(!(s.length>=r)){var o=n(e,a,r);t==i.length-1?s=s.concat(o||[]):l=l.concat(o||[])}})),o=l}})),r?s.slice(0,r):s):o},s.prototype.stringify=function(e){n.ok(e,"we need a path");var t="$",r={"descendant-member":"..{{value}}","child-member":".{{value}}","descendant-subscript":"..[{{value}}]","child-subscript":"[{{value}}]"};return(e=this._normalize(e)).forEach((function(e){if("root"!=e.expression.type){var n,i=[e.scope,e.operation].join("-"),a=r[i];if(n="string_literal"==e.expression.type?JSON.stringify(e.expression.value):e.expression.value,!a)throw new Error("couldn't find template "+i);t+=a.replace(/{{value}}/,n)}})),t},s.prototype._normalize=function(e){if(n.ok(e,"we need a path"),"string"==typeof e)return this.parser.parse(e);if(Array.isArray(e)&&"string"==typeof e[0]){var t=[{expression:{type:"root",value:"$"}}];return e.forEach((function(e,r){if("$"!=e||0!==r)if("string"==typeof e&&e.match("^"+i.identifier+"$"))t.push({operation:"member",scope:"child",expression:{value:e,type:"identifier"}});else{var n="number"==typeof e?"numeric_literal":"string_literal";t.push({operation:"subscript",scope:"child",expression:{value:e,type:n}})}})),t}if(Array.isArray(e)&&"object"==typeof e[0])return e;throw new Error("couldn't understand path "+e)},s.Handlers=o,s.Parser=a;var c=new s;c.JSONPath=s,t.exports=c},{"./dict":2,"./handlers":4,"./parser":6,assert:8}],6:[function(e,t,r){var n=e("./grammar"),i=e("../generated/parser"),a=function(){var e=new i.Parser,t=e.parseError;return e.yy.parseError=function(){e.yy.ast&&e.yy.ast.initialize(),t.apply(e,arguments)},e};a.grammar=n,t.exports=a},{"../generated/parser":1,"./grammar":3}],7:[function(e,t,r){function n(e){return String(e).match(/^[0-9]+$/)?parseInt(e):Number.isFinite(e)?parseInt(e,10):0}t.exports=function(e,t,r,i){if("string"==typeof t)throw new Error("start cannot be a string");if("string"==typeof r)throw new Error("end cannot be a string");if("string"==typeof i)throw new Error("step cannot be a string");var a=e.length;if(0===i)throw new Error("step cannot be zero");if(i=i?n(i):1,r=r<0?a+r:r,t=n(0===(t=t<0?a+t:t)?0:t||(i>0?0:a-1)),r=n(0===r?0:r||(i>0?a:-1)),t=i>0?Math.max(0,t):Math.min(a,t),r=i>0?Math.min(r,a):Math.max(-1,r),i>0&&r<=t)return[];if(i<0&&t<=r)return[];for(var o=[],s=t;s!=r&&!(i<0&&s<=r||i>0&&s>=r);s+=i)o.push(e[s]);return o}},{}],8:[function(e,t,r){var n=e("util/"),i=Array.prototype.slice,a=Object.prototype.hasOwnProperty,o=t.exports=u;function s(e,t){return n.isUndefined(t)?""+t:n.isNumber(t)&&!isFinite(t)||n.isFunction(t)||n.isRegExp(t)?t.toString():t}function l(e,t){return n.isString(e)?e.length<t?e:e.slice(0,t):e}function c(e,t,r,n,i){throw new o.AssertionError({message:r,actual:e,expected:t,operator:n,stackStartFunction:i})}function u(e,t){e||c(e,!0,t,"==",o.ok)}function p(e,t){if(e===t)return!0;if(n.isBuffer(e)&&n.isBuffer(t)){if(e.length!=t.length)return!1;for(var r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}return n.isDate(e)&&n.isDate(t)?e.getTime()===t.getTime():n.isRegExp(e)&&n.isRegExp(t)?e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase:n.isObject(e)||n.isObject(t)?function(e,t){if(n.isNullOrUndefined(e)||n.isNullOrUndefined(t))return!1;if(e.prototype!==t.prototype)return!1;if(n.isPrimitive(e)||n.isPrimitive(t))return e===t;var r=d(e),a=d(t);if(r&&!a||!r&&a)return!1;if(r)return p(e=i.call(e),t=i.call(t));var o,s,l=m(e),c=m(t);if(l.length!=c.length)return!1;for(l.sort(),c.sort(),s=l.length-1;s>=0;s--)if(l[s]!=c[s])return!1;for(s=l.length-1;s>=0;s--)if(!p(e[o=l[s]],t[o]))return!1;return!0}(e,t):e==t}function d(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function h(e,t){return!(!e||!t)&&("[object RegExp]"==Object.prototype.toString.call(t)?t.test(e):e instanceof t||!0===t.call({},e))}function f(e,t,r,i){var a;n.isString(r)&&(i=r,r=null);try{t()}catch(e){a=e}if(i=(r&&r.name?" ("+r.name+").":".")+(i?" "+i:"."),e&&!a&&c(a,r,"Missing expected exception"+i),!e&&h(a,r)&&c(a,r,"Got unwanted exception"+i),e&&a&&r&&!h(a,r)||!e&&a)throw a}o.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return l(JSON.stringify(e.actual,s),128)+" "+e.operator+" "+l(JSON.stringify(e.expected,s),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||c;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var n=r.stack,i=t.name,a=n.indexOf("\n"+i);if(a>=0){var o=n.indexOf("\n",a+1);n=n.substring(o+1)}this.stack=n}}},n.inherits(o.AssertionError,Error),o.fail=c,o.ok=u,o.equal=function(e,t,r){e!=t&&c(e,t,r,"==",o.equal)},o.notEqual=function(e,t,r){e==t&&c(e,t,r,"!=",o.notEqual)},o.deepEqual=function(e,t,r){p(e,t)||c(e,t,r,"deepEqual",o.deepEqual)},o.notDeepEqual=function(e,t,r){p(e,t)&&c(e,t,r,"notDeepEqual",o.notDeepEqual)},o.strictEqual=function(e,t,r){e!==t&&c(e,t,r,"===",o.strictEqual)},o.notStrictEqual=function(e,t,r){e===t&&c(e,t,r,"!==",o.notStrictEqual)},o.throws=function(e,t,r){f.apply(this,[!0].concat(i.call(arguments)))},o.doesNotThrow=function(e,t){f.apply(this,[!1].concat(i.call(arguments)))},o.ifError=function(e){if(e)throw e};var m=Object.keys||function(e){var t=[];for(var r in e)a.call(e,r)&&t.push(r);return t}},{"util/":11}],9:[function(e,t,r){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},{}],10:[function(e,t,r){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],11:[function(e,t,n){(function(t,r){var i=/%[sdj%]/g;n.format=function(e){if(!y(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(s(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,a=n.length,o=String(e).replace(i,(function(e){if("%%"===e)return"%";if(r>=a)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),l=n[r];r<a;l=n[++r])m(l)||!v(l)?o+=" "+l:o+=" "+s(l);return o},n.deprecate=function(e,i){if(_(r.process))return function(){return n.deprecate(e,i).apply(this,arguments)};if(!0===t.noDeprecation)return e;var a=!1;return function(){if(!a){if(t.throwDeprecation)throw new Error(i);t.traceDeprecation?console.trace(i):console.error(i),a=!0}return e.apply(this,arguments)}};var a,o={};function s(e,t){var r={seen:[],stylize:c};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),f(t)?r.showHidden=t:t&&n._extend(r,t),_(r.showHidden)&&(r.showHidden=!1),_(r.depth)&&(r.depth=2),_(r.colors)&&(r.colors=!1),_(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=l),u(r,e,r.depth)}function l(e,t){var r=s.styles[t];return r?"["+s.colors[r][0]+"m"+e+"["+s.colors[r][1]+"m":e}function c(e,t){return e}function u(e,t,r){if(e.customInspect&&t&&E(t.inspect)&&t.inspect!==n.inspect&&(!t.constructor||t.constructor.prototype!==t)){var i=t.inspect(r,e);return y(i)||(i=u(e,i,r)),i}var a=function(e,t){if(_(t))return e.stylize("undefined","undefined");if(y(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return g(t)?e.stylize(""+t,"number"):f(t)?e.stylize(""+t,"boolean"):m(t)?e.stylize("null","null"):void 0}(e,t);if(a)return a;var o=Object.keys(t),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),S(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return p(t);if(0===o.length){if(E(t)){var l=t.name?": "+t.name:"";return e.stylize("[Function"+l+"]","special")}if(b(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(w(t))return e.stylize(Date.prototype.toString.call(t),"date");if(S(t))return p(t)}var c,v="",x=!1,k=["{","}"];return h(t)&&(x=!0,k=["[","]"]),E(t)&&(v=" [Function"+(t.name?": "+t.name:"")+"]"),b(t)&&(v=" "+RegExp.prototype.toString.call(t)),w(t)&&(v=" "+Date.prototype.toUTCString.call(t)),S(t)&&(v=" "+p(t)),0!==o.length||x&&0!=t.length?r<0?b(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),c=x?function(e,t,r,n,i){for(var a=[],o=0,s=t.length;o<s;++o)I(t,String(o))?a.push(d(e,t,r,n,String(o),!0)):a.push("");return i.forEach((function(i){i.match(/^\d+$/)||a.push(d(e,t,r,n,i,!0))})),a}(e,t,r,s,o):o.map((function(n){return d(e,t,r,s,n,x)})),e.seen.pop(),function(e,t,r){return e.reduce((function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(c,v,k)):k[0]+v+k[1]}function p(e){return"["+Error.prototype.toString.call(e)+"]"}function d(e,t,r,n,i,a){var o,s,l;if((l=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(s=e.stylize("[Setter]","special")),I(n,i)||(o="["+i+"]"),s||(e.seen.indexOf(l.value)<0?(s=m(r)?u(e,l.value,null):u(e,l.value,r-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),_(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function h(e){return Array.isArray(e)}function f(e){return"boolean"==typeof e}function m(e){return null===e}function g(e){return"number"==typeof e}function y(e){return"string"==typeof e}function _(e){return void 0===e}function b(e){return v(e)&&"[object RegExp]"===x(e)}function v(e){return"object"==typeof e&&null!==e}function w(e){return v(e)&&"[object Date]"===x(e)}function S(e){return v(e)&&("[object Error]"===x(e)||e instanceof Error)}function E(e){return"function"==typeof e}function x(e){return Object.prototype.toString.call(e)}function k(e){return e<10?"0"+e.toString(10):e.toString(10)}n.debuglog=function(e){if(_(a)&&(a=t.env.NODE_DEBUG||""),e=e.toUpperCase(),!o[e])if(new RegExp("\\b"+e+"\\b","i").test(a)){var r=t.pid;o[e]=function(){var t=n.format.apply(n,arguments);console.error("%s %d: %s",e,r,t)}}else o[e]=function(){};return o[e]},n.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},n.isArray=h,n.isBoolean=f,n.isNull=m,n.isNullOrUndefined=function(e){return null==e},n.isNumber=g,n.isString=y,n.isSymbol=function(e){return"symbol"==typeof e},n.isUndefined=_,n.isRegExp=b,n.isObject=v,n.isDate=w,n.isError=S,n.isFunction=E,n.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},n.isBuffer=e("./support/isBuffer");var A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function I(e,t){return Object.prototype.hasOwnProperty.call(e,t)}n.log=function(){var e,t;console.log("%s - %s",(e=new Date,t=[k(e.getHours()),k(e.getMinutes()),k(e.getSeconds())].join(":"),[e.getDate(),A[e.getMonth()],t].join(" ")),n.format.apply(n,arguments))},n.inherits=e("inherits"),n._extend=function(e,t){if(!t||!v(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}}).call(this,e("_process"),void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":10,_process:14,inherits:9}],12:[function(e,t,r){},{}],13:[function(e,t,r){(function(e){function t(e,t){for(var r=0,n=e.length-1;n>=0;n--){var i=e[n];"."===i?e.splice(n,1):".."===i?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function n(e,t){if(e.filter)return e.filter(t);for(var r=[],n=0;n<e.length;n++)t(e[n],n,e)&&r.push(e[n]);return r}r.resolve=function(){for(var r="",i=!1,a=arguments.length-1;a>=-1&&!i;a--){var o=a>=0?arguments[a]:e.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(r=o+"/"+r,i="/"===o.charAt(0))}return(i?"/":"")+(r=t(n(r.split("/"),(function(e){return!!e})),!i).join("/"))||"."},r.normalize=function(e){var a=r.isAbsolute(e),o="/"===i(e,-1);return(e=t(n(e.split("/"),(function(e){return!!e})),!a).join("/"))||a||(e="."),e&&o&&(e+="/"),(a?"/":"")+e},r.isAbsolute=function(e){return"/"===e.charAt(0)},r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(n(e,(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},r.relative=function(e,t){function n(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=r.resolve(e).substr(1),t=r.resolve(t).substr(1);for(var i=n(e.split("/")),a=n(t.split("/")),o=Math.min(i.length,a.length),s=o,l=0;l<o;l++)if(i[l]!==a[l]){s=l;break}var c=[];for(l=s;l<i.length;l++)c.push("..");return(c=c.concat(a.slice(s))).join("/")},r.sep="/",r.delimiter=":",r.dirname=function(e){if("string"!=typeof e&&(e+=""),0===e.length)return".";for(var t=e.charCodeAt(0),r=47===t,n=-1,i=!0,a=e.length-1;a>=1;--a)if(47===(t=e.charCodeAt(a))){if(!i){n=a;break}}else i=!1;return-1===n?r?"/":".":r&&1===n?"/":e.slice(0,n)},r.basename=function(e,t){var r=function(e){"string"!=typeof e&&(e+="");var t,r=0,n=-1,i=!0;for(t=e.length-1;t>=0;--t)if(47===e.charCodeAt(t)){if(!i){r=t+1;break}}else-1===n&&(i=!1,n=t+1);return-1===n?"":e.slice(r,n)}(e);return t&&r.substr(-1*t.length)===t&&(r=r.substr(0,r.length-t.length)),r},r.extname=function(e){"string"!=typeof e&&(e+="");for(var t=-1,r=0,n=-1,i=!0,a=0,o=e.length-1;o>=0;--o){var s=e.charCodeAt(o);if(47!==s)-1===n&&(i=!1,n=o+1),46===s?-1===t?t=o:1!==a&&(a=1):-1!==t&&(a=-1);else if(!i){r=o+1;break}}return-1===t||-1===n||0===a||1===a&&t===n-1&&t===r+1?"":e.slice(t,n)};var i=function(e,t,r){return e.substr(t,r)}}).call(this,e("_process"))},{_process:14}],14:[function(e,t,r){var n,i,a=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function l(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(e){i=s}}();var c,u=[],p=!1,d=-1;function h(){p&&c&&(p=!1,c.length?u=c.concat(u):d=-1,u.length&&f())}function f(){if(!p){var e=l(h);p=!0;for(var t=u.length;t;){for(c=u,u=[];++d<t;)c&&c[d].run();d=-1,t=u.length}c=null,p=!1,function(e){if(i===clearTimeout)return clearTimeout(e);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{return i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function g(){}a.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new m(e,t)),1!==u.length||p||l(f)},m.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=g,a.addListener=g,a.once=g,a.off=g,a.removeListener=g,a.removeAllListeners=g,a.emit=g,a.prependListener=g,a.prependOnceListener=g,a.listeners=function(e){return[]},a.binding=function(e){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(e){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},{}],15:[function(e,t,r){var n=e("escodegen").generate;t.exports=function(e,t){t||(t={});var r={},i=function e(i,a){if("Literal"===i.type)return i.value;if("UnaryExpression"===i.type){var o=e(i.argument);return"+"===i.operator?+o:"-"===i.operator?-o:"~"===i.operator?~o:"!"===i.operator?!o:r}if("ArrayExpression"===i.type){for(var s=[],l=0,c=i.elements.length;l<c;l++){if((y=e(i.elements[l]))===r)return r;s.push(y)}return s}if("ObjectExpression"===i.type){var u={};for(l=0;l<i.properties.length;l++){var p=null===(_=i.properties[l]).value?_.value:e(_.value);if(p===r)return r;u[_.key.value||_.key.name]=p}return u}if("BinaryExpression"===i.type||"LogicalExpression"===i.type){if((c=e(i.left))===r)return r;var d=e(i.right);if(d===r)return r;var h=i.operator;return"=="===h?c==d:"==="===h?c===d:"!="===h?c!=d:"!=="===h?c!==d:"+"===h?c+d:"-"===h?c-d:"*"===h?c*d:"/"===h?c/d:"%"===h?c%d:"<"===h?c<d:"<="===h?c<=d:">"===h?c>d:">="===h?c>=d:"|"===h?c|d:"&"===h?c&d:"^"===h?c^d:"&&"===h?c&&d:"||"===h?c||d:r}if("Identifier"===i.type)return{}.hasOwnProperty.call(t,i.name)?t[i.name]:r;if("ThisExpression"===i.type)return{}.hasOwnProperty.call(t,"this")?t.this:r;if("CallExpression"===i.type){var f=e(i.callee);if(f===r)return r;if("function"!=typeof f)return r;var m=i.callee.object?e(i.callee.object):r;m===r&&(m=null);var g=[];for(l=0,c=i.arguments.length;l<c;l++){var y;if((y=e(i.arguments[l]))===r)return r;g.push(y)}return f.apply(m,g)}var _;if("MemberExpression"===i.type)return(u=e(i.object))===r||"function"==typeof u?r:"Identifier"===i.property.type?u[i.property.name]:(_=e(i.property))===r?r:u[_];if("ConditionalExpression"===i.type)return(o=e(i.test))===r?r:e(o?i.consequent:i.alternate);if("ExpressionStatement"===i.type)return(o=e(i.expression))===r?r:o;if("ReturnStatement"===i.type)return e(i.argument);if("FunctionExpression"===i.type){var b=i.body.body,v={};for(Object.keys(t).forEach((function(e){v[e]=t[e]})),l=0;l<i.params.length;l++){var w=i.params[l];if("Identifier"!=w.type)return r;t[w.name]=null}for(var l in b)if(e(b[l])===r)return r;t=v;var S=Object.keys(t),E=S.map((function(e){return t[e]}));return Function(S.join(", "),"return "+n(i)).apply(null,E)}if("TemplateLiteral"===i.type){var x="";for(l=0;l<i.expressions.length;l++)x+=e(i.quasis[l]),x+=e(i.expressions[l]);return x+e(i.quasis[l])}if("TaggedTemplateExpression"===i.type){var k=e(i.tag),A=i.quasi,I=A.quasis.map(e),j=A.expressions.map(e);return k.apply(null,[I].concat(j))}return"TemplateElement"===i.type?i.value.cooked:r}(e);return i===r?void 0:i}},{escodegen:12}],jsonpath:[function(e,t,r){t.exports=e("./lib/index")},{"./lib/index":5}]},{},["jsonpath"])("jsonpath")},631:(e,t,r)=>{var n="function"==typeof Map&&Map.prototype,i=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,a=n&&i&&"function"==typeof i.get?i.get:null,o=n&&Map.prototype.forEach,s="function"==typeof Set&&Set.prototype,l=Object.getOwnPropertyDescriptor&&s?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,c=s&&l&&"function"==typeof l.get?l.get:null,u=s&&Set.prototype.forEach,p="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,d="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,h="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,f=Boolean.prototype.valueOf,m=Object.prototype.toString,g=Function.prototype.toString,y=String.prototype.match,_=String.prototype.slice,b=String.prototype.replace,v=String.prototype.toUpperCase,w=String.prototype.toLowerCase,S=RegExp.prototype.test,E=Array.prototype.concat,x=Array.prototype.join,k=Array.prototype.slice,A=Math.floor,I="function"==typeof BigInt?BigInt.prototype.valueOf:null,j=Object.getOwnPropertySymbols,O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,P="function"==typeof Symbol&&"object"==typeof Symbol.iterator,T="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,C=Object.prototype.propertyIsEnumerable,N=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function L(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||S.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var n=e<0?-A(-e):A(e);if(n!==e){var i=String(n),a=_.call(t,i.length+1);return b.call(i,r,"$&_")+"."+b.call(b.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return b.call(t,r,"$&_")}var M=r(4654),F=M.custom,R=$(F)?F:null;function D(e,t,r){var n="double"===(r.quoteStyle||t)?'"':"'";return n+e+n}function q(e){return b.call(String(e),/"/g,"&quot;")}function U(e){return!("[object Array]"!==H(e)||T&&"object"==typeof e&&T in e)}function B(e){return!("[object RegExp]"!==H(e)||T&&"object"==typeof e&&T in e)}function $(e){if(P)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!O)return!1;try{return O.call(e),!0}catch(e){}return!1}e.exports=function e(t,n,i,s){var l=n||{};if(W(l,"quoteStyle")&&"single"!==l.quoteStyle&&"double"!==l.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(W(l,"maxStringLength")&&("number"==typeof l.maxStringLength?l.maxStringLength<0&&l.maxStringLength!==1/0:null!==l.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var m=!W(l,"customInspect")||l.customInspect;if("boolean"!=typeof m&&"symbol"!==m)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(W(l,"indent")&&null!==l.indent&&"\t"!==l.indent&&!(parseInt(l.indent,10)===l.indent&&l.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(W(l,"numericSeparator")&&"boolean"!=typeof l.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var v=l.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return z(t,l);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var S=String(t);return v?L(t,S):S}if("bigint"==typeof t){var A=String(t)+"n";return v?L(t,A):A}var j=void 0===l.depth?5:l.depth;if(void 0===i&&(i=0),i>=j&&j>0&&"object"==typeof t)return U(t)?"[Array]":"[Object]";var F,G=function(e,t){var r;if("\t"===e.indent)r="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;r=x.call(Array(e.indent+1)," ")}return{base:r,prev:x.call(Array(t+1),r)}}(l,i);if(void 0===s)s=[];else if(V(s,t)>=0)return"[Circular]";function J(t,r,n){if(r&&(s=k.call(s)).push(r),n){var a={depth:l.depth};return W(l,"quoteStyle")&&(a.quoteStyle=l.quoteStyle),e(t,a,i+1,s)}return e(t,l,i+1,s)}if("function"==typeof t&&!B(t)){var ee=function(e){if(e.name)return e.name;var t=y.call(g.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}(t),te=Z(t,J);return"[Function"+(ee?": "+ee:" (anonymous)")+"]"+(te.length>0?" { "+x.call(te,", ")+" }":"")}if($(t)){var re=P?b.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):O.call(t);return"object"!=typeof t||P?re:X(re)}if((F=t)&&"object"==typeof F&&("undefined"!=typeof HTMLElement&&F instanceof HTMLElement||"string"==typeof F.nodeName&&"function"==typeof F.getAttribute)){for(var ne="<"+w.call(String(t.nodeName)),ie=t.attributes||[],ae=0;ae<ie.length;ae++)ne+=" "+ie[ae].name+"="+D(q(ie[ae].value),"double",l);return ne+=">",t.childNodes&&t.childNodes.length&&(ne+="..."),ne+"</"+w.call(String(t.nodeName))+">"}if(U(t)){if(0===t.length)return"[]";var oe=Z(t,J);return G&&!function(e){for(var t=0;t<e.length;t++)if(V(e[t],"\n")>=0)return!1;return!0}(oe)?"["+K(oe,G)+"]":"[ "+x.call(oe,", ")+" ]"}if(function(e){return!("[object Error]"!==H(e)||T&&"object"==typeof e&&T in e)}(t)){var se=Z(t,J);return"cause"in Error.prototype||!("cause"in t)||C.call(t,"cause")?0===se.length?"["+String(t)+"]":"{ ["+String(t)+"] "+x.call(se,", ")+" }":"{ ["+String(t)+"] "+x.call(E.call("[cause]: "+J(t.cause),se),", ")+" }"}if("object"==typeof t&&m){if(R&&"function"==typeof t[R]&&M)return M(t,{depth:j-i});if("symbol"!==m&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!a||!e||"object"!=typeof e)return!1;try{a.call(e);try{c.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var le=[];return o&&o.call(t,(function(e,r){le.push(J(r,t,!0)+" => "+J(e,t))})),Y("Map",a.call(t),le,G)}if(function(e){if(!c||!e||"object"!=typeof e)return!1;try{c.call(e);try{a.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var ce=[];return u&&u.call(t,(function(e){ce.push(J(e,t))})),Y("Set",c.call(t),ce,G)}if(function(e){if(!p||!e||"object"!=typeof e)return!1;try{p.call(e,p);try{d.call(e,d)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return Q("WeakMap");if(function(e){if(!d||!e||"object"!=typeof e)return!1;try{d.call(e,d);try{p.call(e,p)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return Q("WeakSet");if(function(e){if(!h||!e||"object"!=typeof e)return!1;try{return h.call(e),!0}catch(e){}return!1}(t))return Q("WeakRef");if(function(e){return!("[object Number]"!==H(e)||T&&"object"==typeof e&&T in e)}(t))return X(J(Number(t)));if(function(e){if(!e||"object"!=typeof e||!I)return!1;try{return I.call(e),!0}catch(e){}return!1}(t))return X(J(I.call(t)));if(function(e){return!("[object Boolean]"!==H(e)||T&&"object"==typeof e&&T in e)}(t))return X(f.call(t));if(function(e){return!("[object String]"!==H(e)||T&&"object"==typeof e&&T in e)}(t))return X(J(String(t)));if("undefined"!=typeof window&&t===window)return"{ [object Window] }";if(t===r.g)return"{ [object globalThis] }";if(!function(e){return!("[object Date]"!==H(e)||T&&"object"==typeof e&&T in e)}(t)&&!B(t)){var ue=Z(t,J),pe=N?N(t)===Object.prototype:t instanceof Object||t.constructor===Object,de=t instanceof Object?"":"null prototype",he=!pe&&T&&Object(t)===t&&T in t?_.call(H(t),8,-1):de?"Object":"",fe=(pe||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(he||de?"["+x.call(E.call([],he||[],de||[]),": ")+"] ":"");return 0===ue.length?fe+"{}":G?fe+"{"+K(ue,G)+"}":fe+"{ "+x.call(ue,", ")+" }"}return String(t)};var G=Object.prototype.hasOwnProperty||function(e){return e in this};function W(e,t){return G.call(e,t)}function H(e){return m.call(e)}function V(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function z(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return z(_.call(e,0,t.maxStringLength),t)+n}return D(b.call(b.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,J),"single",t)}function J(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+v.call(t.toString(16))}function X(e){return"Object("+e+")"}function Q(e){return e+" { ? }"}function Y(e,t,r,n){return e+" ("+t+") {"+(n?K(r,n):x.call(r,", "))+"}"}function K(e,t){if(0===e.length)return"";var r="\n"+t.prev+t.base;return r+x.call(e,","+r)+"\n"+t.prev}function Z(e,t){var r=U(e),n=[];if(r){n.length=e.length;for(var i=0;i<e.length;i++)n[i]=W(e,i)?t(e[i],e):""}var a,o="function"==typeof j?j(e):[];if(P){a={};for(var s=0;s<o.length;s++)a["$"+o[s]]=o[s]}for(var l in e)W(e,l)&&(r&&String(Number(l))===l&&l<e.length||P&&a["$"+l]instanceof Symbol||(S.call(/[^\w$]/,l)?n.push(t(l,e)+": "+t(e[l],e)):n.push(l+": "+t(e[l],e))));if("function"==typeof j)for(var c=0;c<o.length;c++)C.call(e,o[c])&&n.push("["+t(o[c])+"]: "+t(e[o[c]],e));return n}},5798:e=>{"use strict";var t=String.prototype.replace,r=/%20/g,n="RFC3986";e.exports={default:n,formatters:{RFC1738:function(e){return t.call(e,r,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:n}},129:(e,t,r)=>{"use strict";var n=r(8261),i=r(5235),a=r(5798);e.exports={formats:a,parse:i,stringify:n}},5235:(e,t,r)=>{"use strict";var n=r(2769),i=Object.prototype.hasOwnProperty,a=Array.isArray,o={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:n.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},s=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},l=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},c=function(e,t,r,n){if(e){var a=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/g,s=r.depth>0&&/(\[[^[\]]*])/.exec(a),c=s?a.slice(0,s.index):a,u=[];if(c){if(!r.plainObjects&&i.call(Object.prototype,c)&&!r.allowPrototypes)return;u.push(c)}for(var p=0;r.depth>0&&null!==(s=o.exec(a))&&p<r.depth;){if(p+=1,!r.plainObjects&&i.call(Object.prototype,s[1].slice(1,-1))&&!r.allowPrototypes)return;u.push(s[1])}return s&&u.push("["+a.slice(s.index)+"]"),function(e,t,r,n){for(var i=n?t:l(t,r),a=e.length-1;a>=0;--a){var o,s=e[a];if("[]"===s&&r.parseArrays)o=[].concat(i);else{o=r.plainObjects?Object.create(null):{};var c="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,u=parseInt(c,10);r.parseArrays||""!==c?!isNaN(u)&&s!==c&&String(u)===c&&u>=0&&r.parseArrays&&u<=r.arrayLimit?(o=[])[u]=i:"__proto__"!==c&&(o[c]=i):o={0:i}}i=o}return i}(u,t,r,n)}};e.exports=function(e,t){var r=function(e){if(!e)return o;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?o.charset:e.charset;return{allowDots:void 0===e.allowDots?o.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:o.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:o.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:o.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:o.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:o.comma,decoder:"function"==typeof e.decoder?e.decoder:o.decoder,delimiter:"string"==typeof e.delimiter||n.isRegExp(e.delimiter)?e.delimiter:o.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:o.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:o.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:o.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:o.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:o.strictNullHandling}}(t);if(""===e||null==e)return r.plainObjects?Object.create(null):{};for(var u="string"==typeof e?function(e,t){var r,c={__proto__:null},u=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,p=t.parameterLimit===1/0?void 0:t.parameterLimit,d=u.split(t.delimiter,p),h=-1,f=t.charset;if(t.charsetSentinel)for(r=0;r<d.length;++r)0===d[r].indexOf("utf8=")&&("utf8=%E2%9C%93"===d[r]?f="utf-8":"utf8=%26%2310003%3B"===d[r]&&(f="iso-8859-1"),h=r,r=d.length);for(r=0;r<d.length;++r)if(r!==h){var m,g,y=d[r],_=y.indexOf("]="),b=-1===_?y.indexOf("="):_+1;-1===b?(m=t.decoder(y,o.decoder,f,"key"),g=t.strictNullHandling?null:""):(m=t.decoder(y.slice(0,b),o.decoder,f,"key"),g=n.maybeMap(l(y.slice(b+1),t),(function(e){return t.decoder(e,o.decoder,f,"value")}))),g&&t.interpretNumericEntities&&"iso-8859-1"===f&&(g=s(g)),y.indexOf("[]=")>-1&&(g=a(g)?[g]:g),i.call(c,m)?c[m]=n.combine(c[m],g):c[m]=g}return c}(e,r):e,p=r.plainObjects?Object.create(null):{},d=Object.keys(u),h=0;h<d.length;++h){var f=d[h],m=c(f,u[f],r,"string"==typeof e);p=n.merge(p,m,r)}return!0===r.allowSparse?p:n.compact(p)}},8261:(e,t,r)=>{"use strict";var n=r(7478),i=r(2769),a=r(5798),o=Object.prototype.hasOwnProperty,s={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},l=Array.isArray,c=Array.prototype.push,u=function(e,t){c.apply(e,l(t)?t:[t])},p=Date.prototype.toISOString,d=a.default,h={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:i.encode,encodeValuesOnly:!1,format:d,formatter:a.formatters[d],indices:!1,serializeDate:function(e){return p.call(e)},skipNulls:!1,strictNullHandling:!1},f={},m=function e(t,r,a,o,s,c,p,d,m,g,y,_,b,v,w,S){for(var E,x=t,k=S,A=0,I=!1;void 0!==(k=k.get(f))&&!I;){var j=k.get(t);if(A+=1,void 0!==j){if(j===A)throw new RangeError("Cyclic object value");I=!0}void 0===k.get(f)&&(A=0)}if("function"==typeof d?x=d(r,x):x instanceof Date?x=y(x):"comma"===a&&l(x)&&(x=i.maybeMap(x,(function(e){return e instanceof Date?y(e):e}))),null===x){if(s)return p&&!v?p(r,h.encoder,w,"key",_):r;x=""}if("string"==typeof(E=x)||"number"==typeof E||"boolean"==typeof E||"symbol"==typeof E||"bigint"==typeof E||i.isBuffer(x))return p?[b(v?r:p(r,h.encoder,w,"key",_))+"="+b(p(x,h.encoder,w,"value",_))]:[b(r)+"="+b(String(x))];var O,P=[];if(void 0===x)return P;if("comma"===a&&l(x))v&&p&&(x=i.maybeMap(x,p)),O=[{value:x.length>0?x.join(",")||null:void 0}];else if(l(d))O=d;else{var T=Object.keys(x);O=m?T.sort(m):T}for(var C=o&&l(x)&&1===x.length?r+"[]":r,N=0;N<O.length;++N){var L=O[N],M="object"==typeof L&&void 0!==L.value?L.value:x[L];if(!c||null!==M){var F=l(x)?"function"==typeof a?a(C,L):C:C+(g?"."+L:"["+L+"]");S.set(t,A);var R=n();R.set(f,S),u(P,e(M,F,a,o,s,c,"comma"===a&&v&&l(x)?null:p,d,m,g,y,_,b,v,w,R))}}return P};e.exports=function(e,t){var r,i=e,c=function(e){if(!e)return h;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||h.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=a.default;if(void 0!==e.format){if(!o.call(a.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var n=a.formatters[r],i=h.filter;return("function"==typeof e.filter||l(e.filter))&&(i=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:h.addQueryPrefix,allowDots:void 0===e.allowDots?h.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:h.charsetSentinel,delimiter:void 0===e.delimiter?h.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:h.encode,encoder:"function"==typeof e.encoder?e.encoder:h.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:h.encodeValuesOnly,filter:i,format:r,formatter:n,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:h.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:h.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:h.strictNullHandling}}(t);"function"==typeof c.filter?i=(0,c.filter)("",i):l(c.filter)&&(r=c.filter);var p,d=[];if("object"!=typeof i||null===i)return"";p=t&&t.arrayFormat in s?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var f=s[p];if(t&&"commaRoundTrip"in t&&"boolean"!=typeof t.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var g="comma"===f&&t&&t.commaRoundTrip;r||(r=Object.keys(i)),c.sort&&r.sort(c.sort);for(var y=n(),_=0;_<r.length;++_){var b=r[_];c.skipNulls&&null===i[b]||u(d,m(i[b],b,f,g,c.strictNullHandling,c.skipNulls,c.encode?c.encoder:null,c.filter,c.sort,c.allowDots,c.serializeDate,c.format,c.formatter,c.encodeValuesOnly,c.charset,y))}var v=d.join(c.delimiter),w=!0===c.addQueryPrefix?"?":"";return c.charsetSentinel&&("iso-8859-1"===c.charset?w+="utf8=%26%2310003%3B&":w+="utf8=%E2%9C%93&"),v.length>0?w+v:""}},2769:(e,t,r)=>{"use strict";var n=r(5798),i=Object.prototype.hasOwnProperty,a=Array.isArray,o=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),s=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},n=0;n<e.length;++n)void 0!==e[n]&&(r[n]=e[n]);return r};e.exports={arrayToObject:s,assign:function(e,t){return Object.keys(t).reduce((function(e,r){return e[r]=t[r],e}),e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],n=0;n<t.length;++n)for(var i=t[n],o=i.obj[i.prop],s=Object.keys(o),l=0;l<s.length;++l){var c=s[l],u=o[c];"object"==typeof u&&null!==u&&-1===r.indexOf(u)&&(t.push({obj:o,prop:c}),r.push(u))}return function(e){for(;e.length>1;){var t=e.pop(),r=t.obj[t.prop];if(a(r)){for(var n=[],i=0;i<r.length;++i)void 0!==r[i]&&n.push(r[i]);t.obj[t.prop]=n}}}(t),e},decode:function(e,t,r){var n=e.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(e){return n}},encode:function(e,t,r,i,a){if(0===e.length)return e;var s=e;if("symbol"==typeof e?s=Symbol.prototype.toString.call(e):"string"!=typeof e&&(s=String(e)),"iso-8859-1"===r)return escape(s).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var l="",c=0;c<s.length;++c){var u=s.charCodeAt(c);45===u||46===u||95===u||126===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||a===n.RFC1738&&(40===u||41===u)?l+=s.charAt(c):u<128?l+=o[u]:u<2048?l+=o[192|u>>6]+o[128|63&u]:u<55296||u>=57344?l+=o[224|u>>12]+o[128|u>>6&63]+o[128|63&u]:(c+=1,u=65536+((1023&u)<<10|1023&s.charCodeAt(c)),l+=o[240|u>>18]+o[128|u>>12&63]+o[128|u>>6&63]+o[128|63&u])}return l},isBuffer:function(e){return!(!e||"object"!=typeof e||!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e)))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(a(e)){for(var r=[],n=0;n<e.length;n+=1)r.push(t(e[n]));return r}return t(e)},merge:function e(t,r,n){if(!r)return t;if("object"!=typeof r){if(a(t))t.push(r);else{if(!t||"object"!=typeof t)return[t,r];(n&&(n.plainObjects||n.allowPrototypes)||!i.call(Object.prototype,r))&&(t[r]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(r);var o=t;return a(t)&&!a(r)&&(o=s(t,n)),a(t)&&a(r)?(r.forEach((function(r,a){if(i.call(t,a)){var o=t[a];o&&"object"==typeof o&&r&&"object"==typeof r?t[a]=e(o,r,n):t.push(r)}else t[a]=r})),t):Object.keys(r).reduce((function(t,a){var o=r[a];return i.call(t,a)?t[a]=e(t[a],o,n):t[a]=o,t}),o)}}},5666:e=>{var t=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function u(e,t,r,n){var a=t&&t.prototype instanceof y?t:y,o=Object.create(a.prototype),s=new P(n||[]);return i(o,"_invoke",{value:A(e,r,s)}),o}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var d="suspendedStart",h="suspendedYield",f="executing",m="completed",g={};function y(){}function _(){}function b(){}var v={};c(v,o,(function(){return this}));var w=Object.getPrototypeOf,S=w&&w(w(T([])));S&&S!==r&&n.call(S,o)&&(v=S);var E=b.prototype=y.prototype=Object.create(v);function x(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function r(i,a,o,s){var l=p(e[i],e,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==typeof u&&n.call(u,"__await")?t.resolve(u.__await).then((function(e){r("next",e,o,s)}),(function(e){r("throw",e,o,s)})):t.resolve(u).then((function(e){c.value=e,o(c)}),(function(e){return r("throw",e,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,i){r(e,n,t,i)}))}return a=a?a.then(i,i):i()}})}function A(e,t,r){var n=d;return function(i,a){if(n===f)throw new Error("Generator is already running");if(n===m){if("throw"===i)throw a;return C()}for(r.method=i,r.arg=a;;){var o=r.delegate;if(o){var s=I(o,r);if(s){if(s===g)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===d)throw n=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=f;var l=p(e,t,r);if("normal"===l.type){if(n=r.done?m:h,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n=m,r.method="throw",r.arg=l.arg)}}}function I(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,I(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=p(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,g;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function T(e){if(e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}return{next:C}}function C(){return{value:t,done:!0}}return _.prototype=b,i(E,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:_,configurable:!0}),_.displayName=c(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===_||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,c(e,l,"GeneratorFunction")),e.prototype=Object.create(E),e},e.awrap=function(e){return{__await:e}},x(k.prototype),c(k.prototype,s,(function(){return this})),e.AsyncIterator=k,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new k(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},x(E),c(E,l,"Generator"),c(E,o,(function(){return this})),c(E,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=T,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(O),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;O(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},7771:(e,t,r)=>{"use strict";var n=r(210),i=r(2296),a=r(1044)(),o=r(7296),s=r(4453),l=n("%Math.floor%");e.exports=function(e,t){if("function"!=typeof e)throw new s("`fn` is not a function");if("number"!=typeof t||t<0||t>4294967295||l(t)!==t)throw new s("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,c=!0;if("length"in e&&o){var u=o(e,"length");u&&!u.configurable&&(n=!1),u&&!u.writable&&(c=!1)}return(n||c||!r)&&(a?i(e,"length",t,!0,!0):i(e,"length",t)),e}},7478:(e,t,r)=>{"use strict";var n=r(210),i=r(1924),a=r(631),o=r(4453),s=n("%WeakMap%",!0),l=n("%Map%",!0),c=i("WeakMap.prototype.get",!0),u=i("WeakMap.prototype.set",!0),p=i("WeakMap.prototype.has",!0),d=i("Map.prototype.get",!0),h=i("Map.prototype.set",!0),f=i("Map.prototype.has",!0),m=function(e,t){for(var r,n=e;null!==(r=n.next);n=r)if(r.key===t)return n.next=r.next,r.next=e.next,e.next=r,r};e.exports=function(){var e,t,r,n={assert:function(e){if(!n.has(e))throw new o("Side channel does not contain "+a(e))},get:function(n){if(s&&n&&("object"==typeof n||"function"==typeof n)){if(e)return c(e,n)}else if(l){if(t)return d(t,n)}else if(r)return function(e,t){var r=m(e,t);return r&&r.value}(r,n)},has:function(n){if(s&&n&&("object"==typeof n||"function"==typeof n)){if(e)return p(e,n)}else if(l){if(t)return f(t,n)}else if(r)return function(e,t){return!!m(e,t)}(r,n);return!1},set:function(n,i){s&&n&&("object"==typeof n||"function"==typeof n)?(e||(e=new s),u(e,n,i)):l?(t||(t=new l),h(t,n,i)):(r||(r={key:{},next:null}),function(e,t,r){var n=m(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}}(r,n,i))}};return n}},7026:e=>{"use strict";e.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},4654:()=>{},4836:e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},8698:e=>{function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},960:(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>createAngularModuleInstance});var axios__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(9669),_consts_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(738);let $q={when:function(e){return new Promise((t=>{t(e)}))}},factoryReturns={},angular={module:()=>angular,directive:()=>angular,factory(e,t){try{factoryReturns[e]="object"==typeof t?t[t.length-1]($q):t($q)}catch(t){console.log("Errror in data type: ",e),console.log(t)}return angular},service:()=>angular,run:()=>angular,filter:()=>angular,controller:()=>angular,value:()=>angular,element:()=>angular,injector:()=>angular,invoke:()=>angular};async function createAngularModuleInstance(gudhub,module_id,module_url,angularInjector,nodeWindow){try{let angularModule,importedClass;if(_consts_js__WEBPACK_IMPORTED_MODULE_1__.P)if(window.angular){angularInjector.has(module_id)||await angularInjector.get("$ocLazyLoad").load(module_url),angularModule=await angularInjector.get(module_id);let module=await axios__WEBPACK_IMPORTED_MODULE_0__.get(module_url);module=module.data;try{eval(module)}catch(e){console.error(`ERROR WHILE EVAL() IN GHCONSTRUCTOR. MODULE ID: ${module_id}`),console.log(e)}importedClass=factoryReturns[module_id]}else{let module=await axios__WEBPACK_IMPORTED_MODULE_0__.get(module_url);module=module.data;try{eval(module)}catch(e){console.log(`Error while importing module: ${module_id}`),console.log(e)}importedClass=factoryReturns[module_id]}else{const e=new Proxy(nodeWindow,{get:(e,t)=>e[t],set:(e,t,r)=>(e[t]=r,global[t]=r,!0)});global.hasOwnProperty("window")||(global.window=e,global.document=nodeWindow.document,global.Element=nodeWindow.Element,global.CharacterData=nodeWindow.CharacterData,global.this=e,global.self=e,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=e=>!1,global.angular=angular);let t=await axios__WEBPACK_IMPORTED_MODULE_0__.get(module_url),r=t.data,n=encodeURIComponent(r),i;n="data:text/javascript;charset=utf-8,"+n;try{i=await import(n)}catch(e){console.log(`Error while importing module: ${module_id}`),console.log(e)}importedClass=new i.default}let result={type:module_id,getTemplate:function(e,t,r,n,i,a){let o="false"!==r;return importedClass.getTemplate(e,t,o,n,i,a)},getDefaultValue:function(e,t,r,n){return new Promise((async i=>{let a=importedClass.getDefaultValue;i(a?await a(e,t,r,n):null)}))},getSettings:function(e,t,r){return importedClass.getSettings(e,t,r)},filter:{getSearchOptions:function(e){let t=importedClass;return t.filter&&t.filter.getSearchOptions?importedClass.filter.getSearchOptions(e)||null:[]},getDropdownValues:function(){let e=importedClass;return e.filter&&e.filter.getDropdownValues?e.filter.getDropdownValues()||null:[]}},getInterpretation:function(e,t,r,n,i,a){return new Promise((async o=>{let s=importedClass;try{let l=await s.getInterpretation(gudhub,e,a,i,n,r),c=l.find((e=>e.id==t))||l.find((e=>"default"==e.id));o({html:await c.content()})}catch(e){console.log(`ERROR IN ${module_id}`,e),o({html:"<span>no interpretation</span>"})}}))},getInterpretationsList:function(e,t,r,n){return importedClass.getInterpretation(e,t,r,n)},getInterpretatedValue:function(e,t,r,n){return new Promise((async i=>{let a=importedClass.getInterpretatedValue;i(a?await a(e,t,r,n):e)}))},onMessage:function(e,t,r){return new Promise((async n=>{const i=importedClass.onMessage;i&&n(await i(e,t,r)),n(null)}))}};return _consts_js__WEBPACK_IMPORTED_MODULE_1__.P&&(result.extendController=function(e){angularModule.getActionScope(e)},result.runAction=function(e){try{angularModule.runAction(e)}catch(e){}},result.getWindowScope=function(e){return angularModule.getWindowScope(e)},result.getWindowHTML=function(e){return angularModule.getWindowHTML(e)}),result}catch(e){console.log(e),console.log(`Failed in createAngularModuleInstance (ghconstructor). Module id: ${module_id}.`)}}},738:(e,t,r)=>{"use strict";r.d(t,{P:()=>n});const n=![typeof window,typeof document].includes("undefined")},8593:e=>{"use strict";e.exports=JSON.parse('{"name":"axios","version":"0.21.4","description":"Promise based HTTP client for the browser and node.js","main":"index.js","scripts":{"test":"grunt test","start":"node ./sandbox/server.js","build":"NODE_ENV=production grunt build","preversion":"npm test","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json","postversion":"git push && git push --tags","examples":"node ./examples/server.js","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","fix":"eslint --fix lib/**/*.js"},"repository":{"type":"git","url":"https://github.com/axios/axios.git"},"keywords":["xhr","http","ajax","promise","node"],"author":"Matt Zabriskie","license":"MIT","bugs":{"url":"https://github.com/axios/axios/issues"},"homepage":"https://axios-http.com","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"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"jsdelivr":"dist/axios.min.js","unpkg":"dist/axios.min.js","typings":"./index.d.ts","dependencies":{"follow-redirects":"^1.14.0"},"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}]}')}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](r,r.exports,__webpack_require__),r.exports}__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};return(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{GudHub:()=>dt,default:()=>ht}),__webpack_require__(5666);var e=__webpack_require__(9669);function t(e=[]){return e.filter((e=>null!=e.field_value))}var r=__webpack_require__(129);class n{constructor(e){this.root=e,this.requestPromises=[]}init(e){this.getToken=e}async get(t){const r=await this.getToken(),n=this.getHashCode(t);if(this.requestPromises[n])return this.requestPromises[n].promise;const i=new Promise(((n,i)=>{let a;t.externalResource?a=t.url:(a=this.root+t.url,a=`${a}${/\?/.test(a)?"&":"?"}token=${r}${function(e={}){const t=Object.entries(e);return t.length?`&${t.map((([e,t])=>`${e}=${t}`)).join("&")}`:""}(t.params)}`),e.get(a,{validateStatus:function(e){return e<400}}).then((function(e){200!=e.status&&console.error(`GUDHUB HTTP SERVICE: GET ERROR: ${e.status}`,e),n(e.data)})).catch((function(e){console.error(`GUDHUB HTTP SERVICE: GET ERROR: ${e.response.status}\n`,e),console.log("Request message: ",t),e.response&&e.response.data&&console.log("Error response data: ",e.response.data),i(e)}))}));return this.pushPromise(i,n),i}async post(t){const n=this.getHashCode(t);if(t.form.token=await this.getToken(),this.requestPromises[n])return this.requestPromises[n].promise;const i=new Promise(((n,i)=>{e.post(this.root+t.url,r.stringify(t.form),{maxBodyLength:1/0,headers:t.headers||{"Content-Type":"application/x-www-form-urlencoded"},validateStatus:function(e){return e<400}}).then((function(e){200!=e.status&&console.error(`GUDHUB HTTP SERVICE: POST ERROR: ${e.status}`,e),n(e.data)})).catch((function(e){console.error(`GUDHUB HTTP SERVICE: POST ERROR: ${e.response.status}\n`,e),console.log("Request message: ",t),i(e)}))}));return this.pushPromise(i,n),i}axiosRequest(t){const n=this.getHashCode(t);if(this.requestPromises[n])return this.requestPromises[n].promise;let i=t.method?t.method.toLowerCase():"get",a=t.url,o=t.headers||{};t.form&&(o["Content-Type"]="application/x-www-form-urlencoded");const s=new Promise((async(n,s)=>{try{const{data:s}=await e[i](a,"post"===i?r.stringify(t.form)||t.body:{headers:o},"post"===i?{headers:o}:{});n(s)}catch(e){console.log("ERROR -> GUDHUB HTTP SERVICE -> SIMPLE POST :",e.message),console.log("Request message: ",t),s(e)}}));return this.pushPromise(s,n),s}pushPromise(e,t){this.requestPromises[t]={promise:e,hesh:t,callback:e.then((()=>{this.destroyPromise(t)})).catch((e=>{this.destroyPromise(t)}))}}destroyPromise(e){this.requestPromises=this.requestPromises.filter((t=>t.hesh!==e))}getHashCode(e){let t=0,n=r.stringify(e);if(0==n.length)return t;for(let e=0;e<n.length;e++)t=(t<<5)-t+n.charCodeAt(e),t&=t;return"h"+t}}function i(e){let t="";for(let r in e)e.hasOwnProperty(r)&&e[r]&&(t+="."+e[r]);return t?t.substring(1):"any"}class a{constructor(){this.subscribers={},this.messageBox={}}on(e,t,r){return function(e,t,r){return null==e||"string"!=typeof e?(console.log("Listener type is \"undefined\" or not have actual 'type' for subscribe"),!1):null==t||"object"!=typeof t?(console.log("Listener destination is \"undefined\" or not have actual 'type' for subscribe"),!1):"function"==typeof r||(console.log("Listener is not a function for subscribe!"),!1)}(e,t,r)&&e.split(" ").map((e=>e+":"+i(t))).forEach((e=>{this.subscribers[e]||(this.subscribers[e]=new Set),this.subscribers[e].add(r),this.checkMessageBox(e)})),this}emit(e,t,r,n){return e.split(" ").forEach((a=>{const o=a+":"+i(t);if(this.subscribers[o]){if(0==this.subscribers[o].size)return this.messageBox[o]=[e,t,r,n,!1],this;this.subscribers[o].forEach((function(e){e(null,r,n)}))}else this.messageBox[o]=[e,t,r,n,!1]})),this}onRoot(e,t,r){return this.on(e,t,r)}destroy(e,t,r){return e.split(" ").forEach((e=>{const n=e+":"+i(t);this.subscribers[n]&&r&&this.subscribers[n].delete(r),this.subscribers[n]&&!r&&delete this.subscribers[n]})),this}checkMessageBox(e){this.cleanMesssageBox(),this.messageBox[e]&&setTimeout((()=>{this.messageBox[e]&&(this.emit(...this.messageBox[e]),this.messageBox[e][4]=!0)}),0)}cleanMesssageBox(){for(let e in this.messageBox)this.messageBox[e][4]&&delete this.messageBox[e]}}class o{constructor(e,t,r){this.apps_list=[],this.users_list=[],this.user={},this.modulesList=function(e,t,r){return[{data_type:"text",name:"Text",icon:"text_icon",url:t+"/"+e+"text_data.js",type:"gh_element",technology:"angular"},{data_type:"text_opt",name:"Options",icon:"option_gh_element",url:t+"/"+e+"text_options_data.js",type:"gh_element",technology:"angular"},{data_type:"number",name:"Number",icon:"number",url:t+"/"+e+"number_data.js",type:"gh_element",technology:"angular"},{data_type:"task_board",name:"Task Board",icon:"task_board",url:t+"/"+e+"task_board_data.js",type:"gh_element",technology:"angular"},{data_type:"visualizer",name:"visualizer",icon:"visualizer",url:t+"/"+e+"visualizer_data.js",type:"gh_element",technology:"angular"},{data_type:"enterprice_visualizer",name:"Enterprice Visualizer",icon:"visualizer",private:!0,url:t+"/"+e+"enterprice_visualizer_data.js",type:"gh_element",technology:"angular"},{data_type:"email",name:"Email",icon:"email",url:t+"/"+e+"email_data.js",type:"gh_element",technology:"angular"},{data_type:"date",name:"Date",icon:"date_gh_element",url:t+"/"+e+"date_data.js",type:"gh_element",technology:"angular"},{data_type:"radio_button",name:"Radio Button",icon:"radio_button_gh_element",url:t+"/"+e+"radio_button_data.js",type:"gh_element",technology:"angular"},{data_type:"radio_icon",name:"Radio icon",icon:"radio_icon_gh_element",url:t+"/"+e+"radio_icon_data.js",type:"gh_element",technology:"angular"},{data_type:"twilio_phone",name:"Twilio Phone",icon:"phone_twilio_gh_element",url:t+"/"+e+"twilio_phone_data.js",type:"gh_element",technology:"angular"},{data_type:"twilio_autodialer",name:"Twilio Auto Dialer",icon:"twilio_dialer",url:t+"/"+e+"twillio_autodialer_data.js",type:"gh_element",technology:"angular"},{data_type:"color",name:"Color",icon:"paint_gh_element",url:t+"/"+e+"color_data.js",type:"gh_element",technology:"angular"},{data_type:"charts",name:"Charts",icon:"graph_gh_element",url:t+"/"+e+"charts_data.js",type:"gh_element",technology:"angular"},{data_type:"funnel_chart",name:"Funnel chart",icon:"funnel_chart_gh_element",url:t+"/"+e+"funnel_chart_data.js",type:"gh_element",technology:"angular"},{data_type:"add_items_from_template",name:"Add items from template",icon:"contact_second",url:t+"/"+e+"add_items_from_template_data.js",type:"gh_element",technology:"angular"},{data_type:"item_ref",name:"Reference",icon:"reference",url:t+"/"+e+"itemRef_data.js",type:"gh_element",technology:"angular"},{data_type:"calendar",name:"Calendar",icon:"calendar",js:"https://gudhub.com/modules/FullCalendar-Gh-Element/dist/main.js?t=4",css:"https://gudhub.com/modules/FullCalendar-Gh-Element/dist/style.css?t=1",type:"gh_element",technology:"class"},{data_type:"data_ref",name:"Data Reference",icon:"data_reference",url:t+"/"+e+"data_ref_data.js",type:"gh_element",technology:"angular"},{data_type:"table",name:"Table",icon:"table",url:t+"/"+e+"table_data.js",type:"gh_element",technology:"angular"},{data_type:"tile",name:"Tile table",icon:"tile_table",url:t+"/"+e+"tile_data.js",type:"gh_element",technology:"angular"},{data_type:"file",name:"File",icon:"box",url:t+"/"+e+"file_data.js",type:"gh_element",technology:"angular"},{data_type:"image",name:"Image",icon:"image",url:t+"/"+e+"image_data.js",type:"gh_element",technology:"angular"},{data_type:"text_editor",name:"Text Editor",icon:"square",url:t+"/"+e+"text_editor_data.js",type:"gh_element",technology:"angular"},{data_type:"tinymse",name:"Text editor MSE",icon:"tag",url:t+"/"+e+"tinymse_data.js",type:"gh_element",technology:"angular"},{data_type:"duration",name:"Duration",icon:"number_gh_element",url:t+"/"+e+"duration_data.js",type:"gh_element",technology:"angular"},{data_type:"user",name:"User",icon:"user_gh_element",url:t+"/"+e+"user_data.js",type:"gh_element",technology:"angular"},{data_type:"app",name:"App",icon:"app",url:t+"/"+e+"application_data.js",type:"gh_element",technology:"angular"},{data_type:"field",name:"Field",icon:"field_gh_element",url:t+"/"+e+"field_data.js",type:"gh_element",technology:"angular"},{data_type:"available",name:"Available",icon:"availible_gh_element",url:t+"/"+e+"available_data.js",type:"gh_element",technology:"angular"},{data_type:"view_list",name:"View List",icon:"view_list",url:t+"/"+e+"view_list_data.js",type:"gh_element",technology:"angular"},{data_type:"calculator",name:"Calculator",icon:"calculator",url:t+"/"+e+"calculator_data.js",type:"gh_element",technology:"angular"},{data_type:"string_join",name:"String Joiner",icon:"string_join_gh_element",url:t+"/"+e+"string_joiner_data.js",type:"gh_element",technology:"angular"},{data_type:"signature",name:"Signature",icon:"signature",url:t+"/"+e+"signature_data.js",type:"gh_element",technology:"angular"},{data_type:"sendEmail",name:"Send Email",icon:"send_email_gh_element",url:t+"/"+e+"send_email_data.js",type:"gh_element",technology:"angular"},{data_type:"boolean",name:"Yes/No",icon:"boolen_gh_element",url:t+"/"+e+"boolean_data.js",type:"gh_element",technology:"angular"},{data_type:"product_gallery",name:"Product gallery",icon:"product_gallery",url:t+"/"+e+"product_gallery_data.js",type:"gh_element",technology:"angular"},{data_type:"online_inventory",name:"Online inventory",icon:"slab",url:t+"/"+e+"online_inventory_data.js",type:"gh_element",technology:"angular"},{data_type:"3d_edges",name:"3D Edges",icon:"3d_edges_gh_element",url:t+"/"+e+"3d_edges_data.js",type:"gh_element",technology:"angular"},{data_type:"color_list",name:"Color list",icon:"circular_gh_element",url:t+"/"+e+"color_list_data.js",type:"gh_element",technology:"angular"},{data_type:"go_to_link",name:"Go to Link",icon:"go_to_link",url:t+"/"+e+"go_to_link_data.js",type:"gh_element",technology:"angular"},{data_type:"go_to_view",name:"Go to View",icon:"go_to_view",url:t+"/"+e+"go_to_view_data.js",type:"gh_element",technology:"angular"},{data_type:"range",name:"Range",icon:"range_gh_element",url:t+"/"+e+"range_data.js",type:"gh_element",technology:"angular"},{data_type:"barcode",name:"Barcode",icon:"barcode_gh_element",url:t+"/"+e+"barcode_data.js",type:"gh_element",technology:"angular"},{data_type:"item_remote_add",name:"Item remote add",icon:"remote_add_gh_element",url:t+"/"+e+"item_remote_add_data.js",type:"gh_element",technology:"angular"},{data_type:"item_remote_update",name:"Item remote update",icon:"remote_update_gh_element",url:t+"/"+e+"item_remote_update_data.js",type:"gh_element",technology:"angular"},{data_type:"timeline",name:"Timeline",icon:"timeline",url:t+"/"+e+"timeline_data.js",type:"gh_element",technology:"angular"},{data_type:"delete_item",name:"Delete Item",icon:"rubbish",url:t+"/"+e+"delete_action.js",type:"gh_element",technology:"angular"},{data_type:"print_doc",name:"Print document",icon:"print",url:t+"/"+e+"print_doc_action.js",type:"gh_element",technology:"angular"},{data_type:"open_item",name:"Open Item",icon:"delete",private:!0,url:t+"/"+e+"open_item_action.js",type:"gh_element",technology:"angular"},{data_type:"edit_template",name:"Edit template",icon:"delete",private:!0,url:t+"/"+e+"edit_template_action.js",type:"gh_element",technology:"angular"},{data_type:"open_app",private:!0,name:"Open App",icon:"delete",url:t+"/"+e+"open_app_action.js",type:"gh_element",technology:"angular"},{data_type:"user_settings",private:!0,name:"User Settings",icon:"delete",url:t+"/"+e+"user_settings_action.js",type:"gh_element",technology:"angular"},{data_type:"app_sharing",name:"Sharing",icon:"sharing",url:t+"/"+e+"sharing_action.js",type:"gh_element",technology:"angular"},{data_type:"app_constructor",private:!0,name:"App constructor",icon:"app_constructor",url:t+"/"+e+"app_constructor_action.js",type:"gh_element",technology:"angular"},{data_type:"app_settings",name:"App Settings",icon:"configuration",url:t+"/"+e+"app_settings_action.js",type:"gh_element",technology:"angular"},{data_type:"export_csv",name:"Export CSV",icon:"export_csv",url:t+"/"+e+"export_csv.js",type:"gh_element",technology:"angular"},{data_type:"import_csv",name:"Import CSV",icon:"import_csv",url:t+"/"+e+"import_csv.js",type:"gh_element",technology:"angular"},{data_type:"add_items",name:"Add Items",icon:"plus",url:t+"/"+e+"add_items_action.js",type:"gh_element",technology:"angular"},{data_type:"update_items",name:"Update Items",icon:"update",url:t+"/"+e+"update_items_action.js",type:"gh_element",technology:"angular"},{data_type:"install_app",name:"Install",icon:"install",url:t+"/"+e+"install_app_action.js",type:"gh_element",technology:"angular"},{data_type:"search_action",name:"Search",icon:"search",url:t+"/"+e+"search_action.js",type:"gh_element",technology:"angular"},{data_type:"filter_table",name:"Table filter",icon:"filter",url:t+"/"+e+"filter_table_action.js",type:"gh_element",technology:"angular"},{data_type:"slider",name:"Slider",icon:"slider",url:t+"/"+e+"slider_data.js",type:"gh_element",technology:"angular"},{data_type:"clone_item",name:"Clone Item",icon:"double_plus",url:t+"/"+e+"clone_item_action.js",type:"gh_element",technology:"angular"},{data_type:"close",name:"Close",icon:"cross",url:t+"/"+e+"close_action.js",type:"gh_element",technology:"angular"},{data_type:"phone",name:"Phone",icon:"phone_thin",url:t+"/"+e+"phone_data.js",type:"gh_element",technology:"angular"},{data_type:"link",name:"Link",icon:"link_gh_element",url:t+"/"+e+"link_data.js",type:"gh_element",technology:"angular"},{data_type:"sheduling",name:"Sheduling",icon:"scheduling",url:t+"/"+e+"sheduling_data.js",type:"gh_element",technology:"angular"},{data_type:"qrcode",name:"QR Code",icon:"qr_code",url:t+"/"+e+"qrcode_data.js",type:"gh_element",technology:"angular"},{data_type:"graph2d",name:"Graph",icon:"graph",url:t+"/"+e+"graph2d_data.js",type:"gh_element",technology:"angular"},{data_type:"quote_tool",name:"Quote tool",icon:"quoters",url:t+"/"+e+"quote_tool_data.js",type:"gh_element",technology:"angular"},{data_type:"cards",name:"Cards",icon:"cards",url:t+"/"+e+"cards_data.js",type:"gh_element",technology:"angular"},{data_type:"jsonConstructor",name:"Json Constructor",icon:"button",url:t+"/"+e+"json_constructor_data.js",type:"gh_element",technology:"angular"},{data_type:"button",name:"Button",icon:"button",js:"https://gudhub.com/modules/button_action/button_action.js?t=1",type:"gh_element",technology:"class"},{data_type:"editorjs",name:"EditorJS",icon:"code_editor",js:"https://gudhub.com/modules/Editor-Js/dist/main.js?t=2",css:"https://gudhub.com/modules/Editor-Js/dist/style.css?t=2",type:"gh_element",technology:"class"},{data_type:"filter_advanced",name:"Filter Advanced",icon:"filter_advanced",url:t+"/"+e+"filter_advanced_data.js",type:"gh_element",technology:"angular"},{data_type:"code_editor",name:"Code Editor",icon:"code_editor",url:t+"/"+e+"code_editor_data.js",type:"gh_element",technology:"angular"},{data_type:"icon",name:"Icon",icon:"icon_gh_element",url:t+"/"+e+"icon_data.js",type:"gh_element",technology:"angular"},{data_type:"quoteRequest",name:"Quote Request",icon:"invoices",url:t+"/"+e+"quote_request_data.js",type:"gh_element",technology:"angular"},{data_type:"view_container",name:"View Container",icon:"pencil",url:t+"/"+e+"view_container_data.js",type:"gh_element",technology:"angular"},{data_type:"element_ref",name:"Element Reference",icon:"cloudSync_gh_element",url:t+"/"+e+"element_ref_data.js",type:"gh_element",technology:"angular"},{data_type:"quote_tool_objects_renderer",name:"Quote Tool Renderer",icon:"l_counter",url:t+"/"+e+"quote_tool_objects_renderer_data.js",type:"gh_element",technology:"angular"},{data_type:"quote_tool_objects_renderer_generator",name:"Quote Tool Parts Generator",icon:"l_counter_arrow",url:t+"/"+e+"quote_tool_objects_renderer_generator_data.js",type:"gh_element",technology:"angular"},{data_type:"trigger",name:"Trigger",icon:"job",url:t+"/"+e+"trigger_data.js",type:"gh_element",technology:"angular"},{data_type:"voting",name:"Voting",icon:"like_gh_element",url:t+"/"+e+"voting_data.js",type:"gh_element",technology:"angular"},{data_type:"view_tabs",name:"View Tab",icon:"tabs",url:t+"/"+e+"view_tabs.js",type:"gh_element",technology:"angular"},{data_type:"filter_tabs",name:"Filter Tabs",icon:"filter_tabs_gh_element",url:t+"/"+e+"filter_tabs.js",type:"gh_element",technology:"angular"},{data_type:"gps_coords",name:"GPS Coords",icon:"location_gh_element",url:t+"/"+e+"gps_coords.js",type:"gh_element",technology:"angular"},{data_type:"google_map",name:"Google Map",icon:"location",url:t+"/"+e+"google_map_data.js",type:"gh_element",technology:"angular"},{data_type:"data_migrations",name:"Data migrations",icon:"view_list_gh_element",url:t+"/"+e+"data_migrations.js",type:"gh_element",technology:"angular"},{data_type:"additional_settings",name:"Additional Settings",icon:"",private:!0,url:t+"/"+e+"gh_additional_settings_data.js",type:"gh_element",technology:"angular"},{data_type:"send_request",name:"Send Request",icon:"send_request_gh_element",url:t+"/"+e+"send_request_data.js",type:"gh_element",technology:"angular"},{data_type:"webcam",name:"Web camera",icon:"webcam_gh_element",url:t+"/"+e+"webcam_data.js",type:"gh_element",technology:"angular"},{data_type:"json_viewer",name:"JSON viewer",icon:"json_gh_element",url:t+"/"+e+"json_viewer_data.js",type:"gh_element",technology:"angular"},{data_type:"notifications",name:"Notifications",icon:"full_gh_element",url:t+"/"+e+"notifications_data.js",type:"gh_element",technology:"angular"},{data_type:"api",name:"API",icon:"job",url:t+"/"+e+"api_data.js",type:"gh_element",technology:"angular"},{data_type:"smart_input",name:"Smart Input",icon:"roket",url:t+"/"+e+"smart_input_data.js",type:"gh_element",technology:"angular"},{data_type:"json_editor",name:"JSON Editor",icon:"code",url:t+"/"+e+"json_editor_data.js",type:"gh_element",technology:"angular"},{data_type:"grapes_html_editor",name:"Grapes Html Editor",icon:"code_editor",url:t+"/"+e+"grapes_html_editor_data.js",type:"gh_element",technology:"angular"},{data_type:"quiz",name:"Quiz",icon:"quiz_gh_element",url:t+"/"+e+"quiz_data.js",type:"gh_element",technology:"angular"},{data_type:"password_input",name:"Password",icon:"lock_gh_element",url:t+"/"+e+"password_input_data.js",type:"gh_element",technology:"angular"},{data_type:"vs_code",name:"VS Code",icon:"code_editor",url:t+"/"+e+"vs_code_data.js",type:"gh_element",technology:"angular"},{data_type:"nested_list",name:"Nested List",icon:"scheduling",js:"https://gudhub.com/modules/Nested-List/dist/main.js?t=2",css:"https://gudhub.com/modules/Nested-List/dist/style.css?t=2",type:"gh_element",technology:"class"},{data_type:"countertop_smart_quote",name:"Countertop Smart Quote",icon:"quoters",url:t+"/"+e+"countertop_smart_quote_data.js",type:"gh_element",technology:"angular"},{data_type:"markdown_viewer",name:"Markdown viewer",icon:"code_editor",js:"https://gudhub.com/modules/markdown-it-gh-element/dist/main.js?t=1",css:"https://gudhub.com/modules/markdown-it-gh-element/dist/style.css?t=1",type:"gh_element",technology:"class"},{data_type:"html_viewer",name:"HTML Viewer",icon:"code_editor",js:"https://gudhub.com/modules/HTML-Viewer/dist/main.js?t=1",css:"https://gudhub.com/modules/HTML-Viewer/dist/style.css?t=1",type:"gh_element",technology:"class"},{data_type:"element_customizer",name:"Element Customizer",icon:"pencil",url:t+"/"+e+"element_customizer_data.js",type:"gh_element",technology:"angular"},{data_type:"task",name:"Task",icon:"table",url:t+"/"+e+"task_data.js",type:"gh_element",technology:"angular"},{data_type:"cron_picker",name:"Cron Picker",icon:"table",js:"https://gudhub.com/modules/Cron-Picker/dist/main.js?t=2",css:"https://gudhub.com/modules/Cron-Picker/dist/style.css?t=2",type:"gh_element",technology:"class"},{data_type:"balance_sheet",name:"Balance Sheet",icon:"table",js:"https://gudhub.com/modules/balance-sheet/dist/main.js?t=2",css:"https://gudhub.com/modules/balance-sheet/dist/style.css?t=2",type:"gh_element",technology:"class"},{data_type:"quote_form",name:"Quote Form",icon:"table",js:"https://gudhub.com/modules/countertop-quote-form/dist/main.js",css:"https://gudhub.com/modules/countertop-quote-form/dist/style.css",type:"gh_element",technology:"class"},{data_type:"static_nested_list",name:"Nested Filter",icon:"scheduling",js:"https://gudhub.com/modules/nested-filter/dist/main.js?t=1",css:"https://gudhub.com/modules/nested-filter/dist/style.css?t=1",type:"gh_element",technology:"class"},{data_type:"conversations",name:"Conversations",icon:"timeline",js:"https://gudhub.com/modules/conversation/dist/main.js?t=1",css:"https://gudhub.com/modules/conversation/dist/style.css?t=1",type:"gh_element",technology:"class"},{data_type:"study_journal",name:"Study Journal",icon:"timeline",js:"https://gudhub.com/modules/Study-Journal/dist/main.js",css:"https://gudhub.com/modules/Study-Journal/dist/style.css",type:"gh_element",technology:"class"},{data_type:"study_schedule",name:"Study Schedule",icon:"timeline",js:"https://gudhub.com/modules/Study-Schedule/dist/main.js?t=1",css:"https://gudhub.com/modules/Study-Schedule/dist/style.css?t=1",type:"gh_element",technology:"class"},{data_type:"avatar",name:"Avatar",icon:"user",js:"https://gudhub.com/modules/Gh-Avatar/dist/main.js?t=1",css:"https://gudhub.com/modules/Gh-Avatar/dist/style.css?t=1",type:"gh_element",technology:"class"},{data_type:"text_area",name:"Text Area",icon:"text_icon",js:"https://gudhub.com/modules/text-area-ghe/dist/main.js?t=1",css:"https://gudhub.com/modules/text-area-ghe/dist/style.css",type:"gh_element",technology:"class"},{data_type:"API",name:"API",url:t+"/"+r+"api_node.js",type:"automation",icon:"automation_api",private:!0},{data_type:"Calculator",name:"Calculator",url:t+"/"+r+"calculator.js",type:"automation",icon:"automation_calculator"},{data_type:"CompareItems",name:"Compare Items",url:t+"/"+r+"compare_items.js",type:"automation",icon:"automation_compare_items"},{data_type:"Constants",name:"Constants",url:t+"/"+r+"constants.js",type:"automation",icon:"automation_constants"},{data_type:"CreateFiles",name:"Create Files",url:t+"/"+r+"create_files.js",type:"automation",icon:"automation_create_files"},{data_type:"CreateItemsApi",name:"Create Items Api",url:t+"/"+r+"create_item_api.js",type:"automation",icon:"automation_create_items_api"},{data_type:"FileDuplicate",name:"File Duplicate",url:t+"/"+r+"file_duplicate.js",type:"automation",icon:"automation_file_duplicate"},{data_type:"Filter",name:"Filter",url:t+"/"+r+"filter_node.js",type:"automation",icon:"filter"},{data_type:"GetItemByItemRef",name:"Get Item By Item Ref",url:t+"/"+r+"get_item_by_item_ref.js",type:"automation",icon:"automation_get_item_by_item_ref"},{data_type:"GetItems",name:"Get Items",url:t+"/"+r+"get_items.js",type:"automation",icon:"automation_get_items"},{data_type:"GhElementNode",name:"Gh Element Node",url:t+"/"+r+"gh_element_node.js",type:"automation",icon:"automation_gh_element_node",private:!0,created_for:["GhElement"]},{data_type:"IfCondition",name:"If Condition",url:t+"/"+r+"if_condition.js",type:"automation",icon:"automation_if_condition"},{data_type:"ItemConstructor",name:"Item Constructor",url:t+"/"+r+"item_constructor.js",type:"automation",icon:"automation_item_constructor"},{data_type:"ItemDestructor",name:"Item Destructor",url:t+"/"+r+"item_destructor.js",type:"automation",icon:"automation_item_destructor"},{data_type:"JSONScheme",name:"JSON Scheme",url:t+"/"+r+"json_scheme.js",type:"automation",icon:"automation_json_scheme"},{data_type:"MergeItems",name:"Merge Items",url:t+"/"+r+"merge_items.js",type:"automation",icon:"automation_merge_items"},{data_type:"MessageConstructor",name:"Message Constructor",url:t+"/"+r+"message_constructor.js",type:"automation",icon:"automation_message_constructor"},{data_type:"ObjectToItem",name:"Object To Item",url:t+"/"+r+"obj_to_item.js",type:"automation",icon:"automation_object_to_item"},{data_type:"ObjectConstructor",name:"Object Constructor",url:t+"/"+r+"object_constructor.js",type:"automation",icon:"automation_object_constructor"},{data_type:"ObjectDestructor",name:"Object Destructor",url:t+"/"+r+"object_destructor.js",type:"automation",icon:"automation_object_destructor"},{data_type:"PopulateElement",name:"Populate Element",url:t+"/"+r+"populate_element.js",type:"automation",icon:"automation_populate_element",private:!0,created_for:["GhElement"]},{data_type:"PopulateItems",name:"Populate Items",url:t+"/"+r+"populate_items.js",type:"automation",icon:"automation_populate_items"},{data_type:"PopulateWithDate",name:"Populate With Date",url:t+"/"+r+"populate_with_date.js",type:"automation",icon:"automation_populate_with_date"},{data_type:"PopulateWithItemRef",name:"Populate with Item Ref",url:t+"/"+r+"populate_with_item_ref.js",type:"automation",icon:"automation_populate_with_item_ref"},{data_type:"PopUpForm",name:"Pop Up Form",url:t+"/"+r+"popup_form.js",type:"automation",icon:"automation_pop_up_form",private:!0,created_for:["Quiz","GhElement","SmartInput","Iterator"]},{data_type:"QuizForm",name:"Quiz Form",url:t+"/"+r+"quiz_form.js",type:"automation",icon:"automation_quiz_form",private:!0,created_for:["Quiz"]},{data_type:"QuizNode",name:"Quiz Node",url:t+"/"+r+"quiz_node.js",type:"automation",icon:"automation_quiz_node",private:!0},{data_type:"Request",name:"Request",url:t+"/"+r+"request_node.js",type:"automation",icon:"automation_request"},{data_type:"Response",name:"Response",url:t+"/"+r+"response_node.js",type:"automation",icon:"automation_response",private:!0,created_for:["API"]},{data_type:"SmartInput",name:"Smart Input",url:t+"/"+r+"smart_input.js",type:"automation",icon:"automation_smart_input",private:!0},{data_type:"Trigger",name:"Trigger",url:t+"/"+r+"trigger_node.js",type:"automation",icon:"automation_trigger",private:!0},{data_type:"TwilioSMS",name:"Twilio SMS",url:t+"/"+r+"twilio_sms.js",type:"automation",icon:"automation_twilio"},{data_type:"TwilioAuth",name:"Twilio Auth",url:t+"/"+r+"twilio_auth.js",type:"automation",icon:"table"},{data_type:"TwilioDevice",name:"Twilio Device",url:t+"/"+r+"twilio_device.js",type:"automation",icon:"table"},{data_type:"UpdateItemsApi",name:"Update Items Api",url:t+"/"+r+"update_items_api.js",type:"automation",icon:"automation_update_items_api"},{data_type:"GoogleCalendar",name:"Google Calendar",url:t+"/"+r+"google_calendar.js",type:"automation",icon:"calendar"},{data_type:"VerifyEmail",name:"Verify email",url:t+"/"+r+"verify_email.js",type:"automation",icon:"check_in_circle"},{data_type:"Iterator",name:"Iterator",url:t+"/"+r+"iterator.js",type:"automation",icon:"update"},{data_type:"IteratorInput",name:"Iterator Input",url:t+"/"+r+"iterator_input.js",type:"automation",icon:"arrow_right",private:!0},{data_type:"IteratorOutput",name:"Iterator Output",url:t+"/"+r+"iterator_output.js",type:"automation",icon:"arrow_right",private:!0},{data_type:"SendEmail",name:"Send email",url:t+"/"+r+"send_email.js",type:"automation",icon:"email"},{data_type:"FileReader",name:"File Reader",url:t+"/"+r+"file_reader.js",type:"automation",icon:"file"},{data_type:"WebsitesChecker",name:"Websites Checker",url:t+"/"+r+"websites_checker.js",type:"automation",icon:"world"},{data_type:"VoiceMachineDetection",name:"Voice Machine Detection",url:t+"/"+r+"voice_machine_detection.js",type:"automation",icon:"automation_calculator"},{data_type:"Task",name:"Task",url:t+"/"+r+"task.js",type:"automation",icon:"automation_calculator",private:!0},{data_type:"DeleteItems",name:"Delete Items",url:t+"/"+r+"delete_items.js",type:"automation",icon:"rubbish"},{data_type:"GoToItem",name:"Go To Item",url:t+"/"+r+"go_to_item.js",type:"automation",icon:"cursor_point"},{data_type:"FireWorks",name:"Fire Works",url:t+"/"+r+"fireworks_node.js",type:"automation",icon:"weeding_party"},{data_type:"SendMessage",name:"Send Message",url:t+"/"+r+"send_message.js",type:"automation",icon:"speech_bubble"},{data_type:"TurboSMS",name:"Turbo SMS",url:t+"/"+r+"turbo_sms.js",type:"automation",icon:"email"}]}(e,t,r),this.ghComponentsPromises=[]}getMainStorage(){return this}getAppsList(){return this.apps_list}getUser(){return this.user}getUsersList(){return this.users_list}getModulesList(e,t,r){return void 0===e?this.modulesList:0==t?this.modulesList.filter((t=>t.created_for?t.type===e&&t.private&&t.created_for.includes(r):t.type===e&&!t.private)):this.modulesList.filter((t=>t.type===e))}getModuleUrl(e){return this.modulesList.find((t=>t.data_type==e))}setUser(e){this.user=e,this.users_list.push(e)}updateUser(e={}){e.avatar_128&&(e.avatar_128=e.avatar_128+"?"+(new Date).getTime()),e.avatar_512&&(e.avatar_512=e.avatar_512+"?"+(new Date).getTime()),this.user={...this.user,...e},this.users_list=this.users_list.filter((t=>t.user_id!=e.user_id)),this.users_list.push(this.user)}unsetUser(){this.user={}}getApp(e){for(let t=0;t<this.apps_list.length;t++)if(this.apps_list[t].app_id==e)return this.apps_list[t]}unsetApps(){this.apps_list=[]}updateApp(e){return this.apps_list=this.apps_list.map((t=>t.app_id==e.app_id?e:t)),this.apps_list}deleteApp(e){return this.apps_list=this.apps_list.filter((t=>t.app_id!=e)),this.apps_list}async updateItemsInApp(e,t){const r=await this.getApp(t);return r&&(r.items_list=updateItems(e,r.items_list,this.pipeService.emit.bind(this.pipeService),t),this.updateApp(r)),r}async addItemsToApp(e,t){const r=await this.getApp(t);return r&&(r.items_list.push(...e),this.updateApp(r),this.pipeService.emit("gh_items_update",{app_id:t},e)),r}async deleteItemsInApp(e,t){const r=await this.getApp(t);return r&&(r.items_list=r.items_list.filter((t=>!e.find((e=>e.item_id==t.item_id)))),this.updateApp(r)),r}}var s=__webpack_require__(7026);class l{constructor(e,t){this.websocket=null,this.connected=!1,this.queue=[],this.url=e,this.auth=t,this.heartBeatTimeStemp=1e13,this.ALLOWED_HEART_BEAT_DELEY=12e3,this.firstHeartBeat=!0,this.reload=!0,this.isBrowser=![typeof window,typeof document].includes("undefined")}async addSubscription(e){const t=`token=${await this.auth.getToken()}/~/app_id=${e}`;this.connected&&this.websocket.send(t),this.queue.push(e)}async onOpen(){this.reload=!0,console.log("websocket opened"),this.connected=!0;const e=await this.auth.getToken();this.queue.forEach((t=>{const r=`token=${e}/~/app_id=${t}`;this.websocket.send(r)}))}onError(e){console.log("websocket error: ",e),this.websocket.close()}onClose(){console.log("websocket close"),this.connected=!1;try{this.initWebSocket(this.onMassageHandler,this.refreshAppsHandler)}catch(e){console.log(e)}}async onMessage(e){const t=this.isBrowser?e.data:e;if(t.match(/HeartBeat/)){const e=(new Date).getTime()-this.heartBeatTimeStemp;this.ALLOWED_HEART_BEAT_DELEY<e?await this.onConnectionLost():(this.websocket.send("HeartBeat"),this.heartBeatTimeStemp=(new Date).getTime())}if(this.firstHeartBeat&&(this.connectionChecker(),this.firstHeartBeat=!1),t.match(/[{}]/)){let e=JSON.parse(t);const r=await this.auth.getToken();e.token!=r&&this.onMassageHandler(e)}}initWebSocket(e,t){this.onMassageHandler=e,this.refreshAppsHandler=t,this.isBrowser?(this.websocket=new WebSocket(this.url),this.websocket.onopen=this.onOpen.bind(this),this.websocket.onerror=this.onError.bind(this),this.websocket.onclose=this.onClose.bind(this),this.websocket.onmessage=this.onMessage.bind(this)):(this.websocket=new s(this.url),this.websocket.on("open",this.onOpen),this.websocket.on("error",this.onError),this.websocket.on("close",this.onClose),this.websocket.on("message",this.onMessage)),console.log("websocket initialized")}connectionChecker(){setInterval((async()=>{let e=(new Date).getTime()-this.heartBeatTimeStemp;this.ALLOWED_HEART_BEAT_DELEY<e&&await this.onConnectionLost()}),1e3)}async onConnectionLost(){try{await this.auth.getVersion(),this.reload&&(this.reload=!1,console.log("Connected"),this.heartBeatTimeStemp=1e13,this.websocket.close())}catch(e){console.log(e)}}}function c(e){return Array.isArray?Array.isArray(e):"[object Array]"===m(e)}function u(e){return"string"==typeof e}function p(e){return"number"==typeof e}function d(e){return"object"==typeof e}function h(e){return null!=e}function f(e){return!e.trim().length}function m(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const g=e=>`Missing ${e} property in key`,y=e=>`Property 'weight' in key '${e}' must be a positive integer`,_=Object.prototype.hasOwnProperty;class b{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach((e=>{let r=v(e);t+=r.weight,this._keys.push(r),this._keyMap[r.id]=r,t+=r.weight})),this._keys.forEach((e=>{e.weight/=t}))}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function v(e){let t=null,r=null,n=null,i=1,a=null;if(u(e)||c(e))n=e,t=w(e),r=S(e);else{if(!_.call(e,"name"))throw new Error(g("name"));const o=e.name;if(n=o,_.call(e,"weight")&&(i=e.weight,i<=0))throw new Error(y(o));t=w(o),r=S(o),a=e.getFn}return{path:t,id:r,weight:i,src:n,getFn:a}}function w(e){return c(e)?e:e.split(".")}function S(e){return c(e)?e.join("."):e}var E={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,useExtendedSearch:!1,getFn:function(e,t){let r=[],n=!1;const i=(e,t,a)=>{if(h(e))if(t[a]){const o=e[t[a]];if(!h(o))return;if(a===t.length-1&&(u(o)||p(o)||function(e){return!0===e||!1===e||function(e){return d(e)&&null!==e}(e)&&"[object Boolean]"==m(e)}(o)))r.push(function(e){return null==e?"":function(e){if("string"==typeof e)return e;let t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}(o));else if(c(o)){n=!0;for(let e=0,r=o.length;e<r;e+=1)i(o[e],t,a+1)}else t.length&&i(o,t,a+1)}else r.push(e)};return i(e,u(t)?t.split("."):t,0),n?r:r[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};const x=/[^ ]+/g;class k{constructor({getFn:e=E.getFn,fieldNormWeight:t=E.fieldNormWeight}={}){this.norm=function(e=1,t=3){const r=new Map,n=Math.pow(10,t);return{get(t){const i=t.match(x).length;if(r.has(i))return r.get(i);const a=1/Math.pow(i,.5*e),o=parseFloat(Math.round(a*n)/n);return r.set(i,o),o},clear(){r.clear()}}}(t,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach(((e,t)=>{this._keysMap[e.id]=t}))}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,u(this.docs[0])?this.docs.forEach(((e,t)=>{this._addString(e,t)})):this.docs.forEach(((e,t)=>{this._addObject(e,t)})),this.norm.clear())}add(e){const t=this.size();u(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,r=this.size();t<r;t+=1)this.records[t].i-=1}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_addString(e,t){if(!h(e)||f(e))return;let r={v:e,i:t,n:this.norm.get(e)};this.records.push(r)}_addObject(e,t){let r={i:t,$:{}};this.keys.forEach(((t,n)=>{let i=t.getFn?t.getFn(e):this.getFn(e,t.path);if(h(i))if(c(i)){let e=[];const t=[{nestedArrIndex:-1,value:i}];for(;t.length;){const{nestedArrIndex:r,value:n}=t.pop();if(h(n))if(u(n)&&!f(n)){let t={v:n,i:r,n:this.norm.get(n)};e.push(t)}else c(n)&&n.forEach(((e,r)=>{t.push({nestedArrIndex:r,value:e})}))}r.$[n]=e}else if(u(i)&&!f(i)){let e={v:i,n:this.norm.get(i)};r.$[n]=e}})),this.records.push(r)}toJSON(){return{keys:this.keys,records:this.records}}}function A(e,t,{getFn:r=E.getFn,fieldNormWeight:n=E.fieldNormWeight}={}){const i=new k({getFn:r,fieldNormWeight:n});return i.setKeys(e.map(v)),i.setSources(t),i.create(),i}function I(e,{errors:t=0,currentLocation:r=0,expectedLocation:n=0,distance:i=E.distance,ignoreLocation:a=E.ignoreLocation}={}){const o=t/e.length;if(a)return o;const s=Math.abs(n-r);return i?o+s/i:s?1:o}const j=32;function O(e){let t={};for(let r=0,n=e.length;r<n;r+=1){const i=e.charAt(r);t[i]=(t[i]||0)|1<<n-r-1}return t}class P{constructor(e,{location:t=E.location,threshold:r=E.threshold,distance:n=E.distance,includeMatches:i=E.includeMatches,findAllMatches:a=E.findAllMatches,minMatchCharLength:o=E.minMatchCharLength,isCaseSensitive:s=E.isCaseSensitive,ignoreLocation:l=E.ignoreLocation}={}){if(this.options={location:t,threshold:r,distance:n,includeMatches:i,findAllMatches:a,minMatchCharLength:o,isCaseSensitive:s,ignoreLocation:l},this.pattern=s?e:e.toLowerCase(),this.chunks=[],!this.pattern.length)return;const c=(e,t)=>{this.chunks.push({pattern:e,alphabet:O(e),startIndex:t})},u=this.pattern.length;if(u>j){let e=0;const t=u%j,r=u-t;for(;e<r;)c(this.pattern.substr(e,j),e),e+=j;if(t){const e=u-j;c(this.pattern.substr(e),e)}}else c(this.pattern,0)}searchIn(e){const{isCaseSensitive:t,includeMatches:r}=this.options;if(t||(e=e.toLowerCase()),this.pattern===e){let t={isMatch:!0,score:0};return r&&(t.indices=[[0,e.length-1]]),t}const{location:n,distance:i,threshold:a,findAllMatches:o,minMatchCharLength:s,ignoreLocation:l}=this.options;let c=[],u=0,p=!1;this.chunks.forEach((({pattern:t,alphabet:d,startIndex:h})=>{const{isMatch:f,score:m,indices:g}=function(e,t,r,{location:n=E.location,distance:i=E.distance,threshold:a=E.threshold,findAllMatches:o=E.findAllMatches,minMatchCharLength:s=E.minMatchCharLength,includeMatches:l=E.includeMatches,ignoreLocation:c=E.ignoreLocation}={}){if(t.length>j)throw new Error("Pattern length exceeds max of 32.");const u=t.length,p=e.length,d=Math.max(0,Math.min(n,p));let h=a,f=d;const m=s>1||l,g=m?Array(p):[];let y;for(;(y=e.indexOf(t,f))>-1;){let e=I(t,{currentLocation:y,expectedLocation:d,distance:i,ignoreLocation:c});if(h=Math.min(e,h),f=y+u,m){let e=0;for(;e<u;)g[y+e]=1,e+=1}}f=-1;let _=[],b=1,v=u+p;const w=1<<u-1;for(let n=0;n<u;n+=1){let a=0,s=v;for(;a<s;)I(t,{errors:n,currentLocation:d+s,expectedLocation:d,distance:i,ignoreLocation:c})<=h?a=s:v=s,s=Math.floor((v-a)/2+a);v=s;let l=Math.max(1,d-s+1),y=o?p:Math.min(d+s,p)+u,S=Array(y+2);S[y+1]=(1<<n)-1;for(let a=y;a>=l;a-=1){let o=a-1,s=r[e.charAt(o)];if(m&&(g[o]=+!!s),S[a]=(S[a+1]<<1|1)&s,n&&(S[a]|=(_[a+1]|_[a])<<1|1|_[a+1]),S[a]&w&&(b=I(t,{errors:n,currentLocation:o,expectedLocation:d,distance:i,ignoreLocation:c}),b<=h)){if(h=b,f=o,f<=d)break;l=Math.max(1,2*d-f)}}if(I(t,{errors:n+1,currentLocation:d,expectedLocation:d,distance:i,ignoreLocation:c})>h)break;_=S}const S={isMatch:f>=0,score:Math.max(.001,b)};if(m){const e=function(e=[],t=E.minMatchCharLength){let r=[],n=-1,i=-1,a=0;for(let o=e.length;a<o;a+=1){let o=e[a];o&&-1===n?n=a:o||-1===n||(i=a-1,i-n+1>=t&&r.push([n,i]),n=-1)}return e[a-1]&&a-n>=t&&r.push([n,a-1]),r}(g,s);e.length?l&&(S.indices=e):S.isMatch=!1}return S}(e,t,d,{location:n+h,distance:i,threshold:a,findAllMatches:o,minMatchCharLength:s,includeMatches:r,ignoreLocation:l});f&&(p=!0),u+=m,f&&g&&(c=[...c,...g])}));let d={isMatch:p,score:p?u/this.chunks.length:1};return p&&r&&(d.indices=c),d}}class T{constructor(e){this.pattern=e}static isMultiMatch(e){return C(e,this.multiRegex)}static isSingleMatch(e){return C(e,this.singleRegex)}search(){}}function C(e,t){const r=e.match(t);return r?r[1]:null}class N extends T{constructor(e,{location:t=E.location,threshold:r=E.threshold,distance:n=E.distance,includeMatches:i=E.includeMatches,findAllMatches:a=E.findAllMatches,minMatchCharLength:o=E.minMatchCharLength,isCaseSensitive:s=E.isCaseSensitive,ignoreLocation:l=E.ignoreLocation}={}){super(e),this._bitapSearch=new P(e,{location:t,threshold:r,distance:n,includeMatches:i,findAllMatches:a,minMatchCharLength:o,isCaseSensitive:s,ignoreLocation:l})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class L extends T{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t,r=0;const n=[],i=this.pattern.length;for(;(t=e.indexOf(this.pattern,r))>-1;)r=t+i,n.push([t,r-1]);const a=!!n.length;return{isMatch:a,score:a?0:1,indices:n}}}const M=[class extends T{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},L,class extends T{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},class extends T{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},class extends T{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},class extends T{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}},class extends T{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const t=-1===e.indexOf(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},N],F=M.length,R=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,D=new Set([N.type,L.type]);const q=[];function U(e,t){for(let r=0,n=q.length;r<n;r+=1){let n=q[r];if(n.condition(e,t))return new n(e,t)}return new P(e,t)}const B="$and",$="$path",G=e=>!(!e[B]&&!e.$or),W=e=>({[B]:Object.keys(e).map((t=>({[t]:e[t]})))});function H(e,t,{auto:r=!0}={}){const n=e=>{let i=Object.keys(e);const a=(e=>!!e[$])(e);if(!a&&i.length>1&&!G(e))return n(W(e));if((e=>!c(e)&&d(e)&&!G(e))(e)){const n=a?e[$]:i[0],o=a?e.$val:e[n];if(!u(o))throw new Error((e=>`Invalid value for key ${e}`)(n));const s={keyId:S(n),pattern:o};return r&&(s.searcher=U(o,t)),s}let o={children:[],operator:i[0]};return i.forEach((t=>{const r=e[t];c(r)&&r.forEach((e=>{o.children.push(n(e))}))})),o};return G(e)||(e=W(e)),n(e)}function V(e,t){const r=e.matches;t.matches=[],h(r)&&r.forEach((e=>{if(!h(e.indices)||!e.indices.length)return;const{indices:r,value:n}=e;let i={indices:r,value:n};e.key&&(i.key=e.key.src),e.idx>-1&&(i.refIndex=e.idx),t.matches.push(i)}))}function z(e,t){t.score=e.score}class J{constructor(e,t={},r){this.options={...E,...t},this.options.useExtendedSearch,this._keyStore=new b(this.options.keys),this.setCollection(e,r)}setCollection(e,t){if(this._docs=e,t&&!(t instanceof k))throw new Error("Incorrect 'index' type");this._myIndex=t||A(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){h(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=(()=>!1)){const t=[];for(let r=0,n=this._docs.length;r<n;r+=1){const i=this._docs[r];e(i,r)&&(this.removeAt(r),r-=1,n-=1,t.push(i))}return t}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:t=-1}={}){const{includeMatches:r,includeScore:n,shouldSort:i,sortFn:a,ignoreFieldNorm:o}=this.options;let s=u(e)?u(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return function(e,{ignoreFieldNorm:t=E.ignoreFieldNorm}){e.forEach((e=>{let r=1;e.matches.forEach((({key:e,norm:n,score:i})=>{const a=e?e.weight:null;r*=Math.pow(0===i&&a?Number.EPSILON:i,(a||1)*(t?1:n))})),e.score=r}))}(s,{ignoreFieldNorm:o}),i&&s.sort(a),p(t)&&t>-1&&(s=s.slice(0,t)),function(e,t,{includeMatches:r=E.includeMatches,includeScore:n=E.includeScore}={}){const i=[];return r&&i.push(V),n&&i.push(z),e.map((e=>{const{idx:r}=e,n={item:t[r],refIndex:r};return i.length&&i.forEach((t=>{t(e,n)})),n}))}(s,this._docs,{includeMatches:r,includeScore:n})}_searchStringList(e){const t=U(e,this.options),{records:r}=this._myIndex,n=[];return r.forEach((({v:e,i:r,n:i})=>{if(!h(e))return;const{isMatch:a,score:o,indices:s}=t.searchIn(e);a&&n.push({item:e,idx:r,matches:[{score:o,value:e,norm:i,indices:s}]})})),n}_searchLogical(e){const t=H(e,this.options),r=(e,t,n)=>{if(!e.children){const{keyId:r,searcher:i}=e,a=this._findMatches({key:this._keyStore.get(r),value:this._myIndex.getValueForItemAtKeyId(t,r),searcher:i});return a&&a.length?[{idx:n,item:t,matches:a}]:[]}const i=[];for(let a=0,o=e.children.length;a<o;a+=1){const o=e.children[a],s=r(o,t,n);if(s.length)i.push(...s);else if(e.operator===B)return[]}return i},n=this._myIndex.records,i={},a=[];return n.forEach((({$:e,i:n})=>{if(h(e)){let o=r(t,e,n);o.length&&(i[n]||(i[n]={idx:n,item:e,matches:[]},a.push(i[n])),o.forEach((({matches:e})=>{i[n].matches.push(...e)})))}})),a}_searchObjectList(e){const t=U(e,this.options),{keys:r,records:n}=this._myIndex,i=[];return n.forEach((({$:e,i:n})=>{if(!h(e))return;let a=[];r.forEach(((r,n)=>{a.push(...this._findMatches({key:r,value:e[n],searcher:t}))})),a.length&&i.push({idx:n,item:e,matches:a})})),i}_findMatches({key:e,value:t,searcher:r}){if(!h(t))return[];let n=[];if(c(t))t.forEach((({v:t,i,n:a})=>{if(!h(t))return;const{isMatch:o,score:s,indices:l}=r.searchIn(t);o&&n.push({score:s,key:e,value:t,idx:i,norm:a,indices:l})}));else{const{v:i,n:a}=t,{isMatch:o,score:s,indices:l}=r.searchIn(i);o&&n.push({score:s,key:e,value:i,norm:a,indices:l})}return n}}function X(e){return e*(Math.PI/180)}function Q(e=0){const t=new Date;return new Date(t.getFullYear(),t.getMonth(),t.getDate()+e).valueOf()}function Y(e,t){if(e&&e.length)return t?e.filter((e=>e.fields.find((e=>e.index_value&&-1!==e.index_value.toLowerCase().indexOf(t.toLowerCase()))))):e}J.version="6.6.2",J.createIndex=A,J.parseIndex=function(e,{getFn:t=E.getFn,fieldNormWeight:r=E.fieldNormWeight}={}){const{keys:n,records:i}=e,a=new k({getFn:t,fieldNormWeight:r});return a.setKeys(n),a.setIndexRecords(i),a},J.config=E,J.parseQuery=H,function(...e){q.push(...e)}(class{constructor(e,{isCaseSensitive:t=E.isCaseSensitive,includeMatches:r=E.includeMatches,minMatchCharLength:n=E.minMatchCharLength,ignoreLocation:i=E.ignoreLocation,findAllMatches:a=E.findAllMatches,location:o=E.location,threshold:s=E.threshold,distance:l=E.distance}={}){this.query=null,this.options={isCaseSensitive:t,includeMatches:r,minMatchCharLength:n,findAllMatches:a,ignoreLocation:i,location:o,threshold:s,distance:l},this.pattern=t?e:e.toLowerCase(),this.query=function(e,t={}){return e.split("|").map((e=>{let r=e.trim().split(R).filter((e=>e&&!!e.trim())),n=[];for(let e=0,i=r.length;e<i;e+=1){const i=r[e];let a=!1,o=-1;for(;!a&&++o<F;){const e=M[o];let r=e.isMultiMatch(i);r&&(n.push(new e(r,t)),a=!0)}if(!a)for(o=-1;++o<F;){const e=M[o];let r=e.isSingleMatch(i);if(r){n.push(new e(r,t));break}}}return n}))}(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){const t=this.query;if(!t)return{isMatch:!1,score:1};const{includeMatches:r,isCaseSensitive:n}=this.options;e=n?e:e.toLowerCase();let i=0,a=[],o=0;for(let n=0,s=t.length;n<s;n+=1){const s=t[n];a.length=0,i=0;for(let t=0,n=s.length;t<n;t+=1){const n=s[t],{isMatch:l,indices:c,score:u}=n.search(e);if(!l){o=0,i=0,a.length=0;break}if(i+=1,o+=u,r){const e=n.constructor.type;D.has(e)?a=[...a,...c]:a.push(c)}}if(i){let e={isMatch:!0,score:o/i};return r&&(e.indices=a),e}}return{isMatch:!1,score:1}}});const K=new J([]);class Z{changeBehavior(e){switch(e){case"contain_or":this._checkFn=function(e,t){return t.some((t=>e.some((e=>-1!==e.indexOf(t)))))};break;case"contain_and":this._checkFn=function(e,t){return t.every((t=>e.some((e=>-1!==e.indexOf(t)))))};break;case"not_contain_or":this._checkFn=function(e,t){return t.some((t=>e.every((e=>-1===e.indexOf(t)))))};break;case"not_contain_and":this._checkFn=function(e,t){return t.every((t=>e.every((e=>-1===e.indexOf(t)))))};break;case"equal_or":this._checkFn=function(e,t){return!!e.length&&e.some((e=>t.some((t=>e==t))))};break;case"equal_and":this._checkFn=function(e,t){if(!e.length)return!1;let r=new Set(t);for(;e.length&&r.size;){let t=e.pop();r.has(t)&&r.delete(t)}return!r.size};break;case"not_equal_or":this._checkFn=function(e,t){if(!e.length)return!0;let r=new Set(t);for(;e.length&&r.size;){let t=e.pop();if(!r.has(t))return!0}return!1};break;case"not_equal_and":this._checkFn=function(e,t){let r=new Set(t);for(;e.length&&r.size;){let t=e.pop();if(r.has(t))return!1}return!0};break;case"bigger":this._checkFn=function(e,t){return t.some((t=>e.every((e=>e>t))))};break;case"lower":this._checkFn=function(e,t){return t.some((t=>e.every((e=>e<t))))};break;case"range":this._checkFn=function(e,t){return t.some((t=>e.every((e=>t.start<=e&&e<t.end))))};break;case"value":this._checkFn=function(e,t){return t.some((t=>e.some((e=>e==t))))};break;case"search":this._checkFn=function(e,t){return t.some((t=>{return r=t,n=e,K.setCollection(n),Boolean(K.search(r).length);var r,n}))};break;case"phone_equal_or":this._checkFn=function(e,t){return!!e.length&&t.some((t=>e.some((e=>-1!==e.replace(/[^0-9]/g,"").indexOf(t.replace(/[^0-9]/g,""))))))};break;case"distance":this._checkFn=function(e,t){return t.some((t=>e.some((e=>function(e,t){const[r,n,i]=e.split(":"),[a,o]=t.split(":"),s=X(a-r),l=X(o-n),c=Math.sin(s/2)*Math.sin(s/2)+Math.cos(X(r))*Math.cos(X(a))*Math.sin(l/2)*Math.sin(l/2),u=2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c))*6371;return Number(i)>=u}(t,e)))))};break;case"date_in":case"date_out":this._checkFn=function(e,t){return t.some((t=>e.some((e=>function({type:e,date:t=0,match:r=!0}={},n){if(!n&&e)return!1;const i=new Date;let a=!0;switch(e){case"day":const e=Q(t),r=Q(t+1);a=e<=n&&n<r;break;case"days":if(t<0){const e=Q(1);a=Q(-6)<=n&&n<e}else{const e=Q(),t=Q(7);a=e<=n&&n<t}break;case"day_week":a=t===new Date(n).getDay();break;case"week":const s=i.getDate()-i.getDay(),l=s+(-2==t?13:6),c=i.setDate(s+7*t),u=(new Date).setDate(l+7*t),[p,d]=(o=u,[new Date(c),new Date(o)]);a=p<=n&&n<=d;break;case"month":if(i.getFullYear()!==new Date(n).getFullYear())return!1;a=i.getMonth()+t===new Date(n).getMonth();break;case"year":a=i.getFullYear()+t===new Date(n).getFullYear();break;default:return!0}var o;return r?a:!a}(t,e)))))};break;case"recurring_date":this._checkFn=function(e,t){return t.some((t=>e.some((e=>gudhub.checkRecurringDate(e,t)))))}}return this}check(e){return this.changeBehavior(e.getCheckOption())._checkFn(e.getEntity(),e.getFilterValues())}}class ee{convert(e){return[Number(e)]}convertFilterValue(e){return Number(e)}}class te extends ee{convertFilterValue(e){return{start:Number(e.split(":")[0]),end:Number(e.split(":")[1])}}}class re{convert(e){return String(null!=e?e:"").toLowerCase().split(",")}convertFilterValue(e){return 0===e?"0":String(e||"").toLowerCase()}}class ne extends ee{convertFilterValue(e){const[t,r,n]=e.split(":");return{type:t,date:Number(r),match:!!Number(n)}}}class ie{convert(e){return[String(Boolean(e))]}convertFilterValue(e){return String(e)}}class ae{convert(e){return[Number(e)]}convertFilterValue(e){return String(e)}}class oe{constructor(){this._strategies={stringStrategy:new re,numberStrategy:new ee,booleanStrategy:new ie,rangeStrategy:new te,dateStrategy:new ne,recurringDateStrategy:new ae}}setStrategy(e){switch(this._checkOption=e,e){case"contain_or":case"contain_and":case"not_contain_or":case"not_contain_and":case"equal_or":case"equal_and":case"not_equal_or":case"not_equal_and":case"phone_equal_or":case"distance":case"search":this._currentStrategy=this._strategies.stringStrategy;break;case"bigger":case"lower":this._currentStrategy=this._strategies.numberStrategy;break;case"range":this._currentStrategy=this._strategies.rangeStrategy;break;case"date_in":case"date_out":this._currentStrategy=this._strategies.dateStrategy;break;case"value":this._currentStrategy=this._strategies.booleanStrategy;break;case"recurring_date":this._currentStrategy=this._strategies.recurringDateStrategy}return this}setEntity(e){return this._entity=this._currentStrategy.convert(e),this}getEntity(){return this._entity}setFilterValues(e){let t=Array.isArray(e)?e:[e];return this._filterValues=t.map((e=>this._currentStrategy.convertFilterValue(e))),this}getFilterValues(){return this._filterValues}getCheckOption(){return this._checkOption}}class se{constructor(){}filter(e,t){const r=this.checkIfAllFiltersHaveAndStrategy(e),n=[],i=e.filter((function(e){return e.valuesArray.length}));for(let e of t){let t=!0;for(let n=0;n<i.length;n++){const a=i[n],o=e.fields.find((function(e){return a.field_id==e.field_id})),s=new oe,l=new Z;switch(s.setStrategy(a.search_type).setEntity(o&&null!=o.field_value?o.field_value:null).setFilterValues(a.valuesArray),a.boolean_strategy){case"and":default:t=t&&l.check(s);break;case"or":t=t||l.check(s)}if(!t&&r)break}t&&n.push(e)}return n.length||e.length&&!n.length?n:t}checkIfAllFiltersHaveAndStrategy(e){return e.every((e=>!e.boolean_strategy||"and"==e.boolean_strategy))}}var le=__webpack_require__(9832);function ce(e,t){let r=[];return t.forEach((e=>{r.push({path_to_compare:e,match_coefficient:0})})),e.forEach(((e,t)=>{for(var n=0;n<r.length;n++)r[n].path_to_compare[t]==e&&(r[n].match_coefficient+=1/(t+1))})),r.sort(((e,t)=>t.match_coefficient-e.match_coefficient)),r[0].path_to_compare}function ue(e,t,r,n,i,a){e.forEach((e=>{let o=!0,s=he(e,r).field_value;t.forEach((t=>{let a=he(t,r).field_value;s==a&&(o=!1,de(e,t,n,i))})),o&&a(e)}))}function pe(e,t,r,n,i,a){let o=new fe(t);if(e.forEach((e=>{let a=o.pullItemIndex(e.item_id);null!=a?de(e,t[a],r,n):i(e)})),a)for(const[e,r]of Object.entries(o.itemsMap))a(t[r])}function de(e,t,r,n){let i=!0;for(let r=0;r<e.fields.length;r++){let n=he(t,e.fields[r].field_id);n?n.field_value!=e.fields[r].field_value&&(i=i&&!1):i=i&&!1}i?n(e,t):r(e,t)}function he(e,t){let r=null;for(let n=0;n<e.fields.length;n++)t==e.fields[n].field_id&&(r=e.fields[n]);return r}class fe{constructor(e){this._itemsMap={},e.forEach(((e,t)=>{this._itemsMap[e.item_id]=t}))}pullItemIndex(e){let t=this._itemsMap[e];return delete this._itemsMap[e],t}getItemIndex(e){return this._itemsMap[e]}get itemsMap(){return this._itemsMap}}var me=__webpack_require__(5430),ge=__webpack_require__(8933),ye=__webpack_require__(5276);function _e(e){var t=new Date;let r=Math.floor(t.getMonth()/3),n=t.getFullYear();switch(e){case"next_day":case"tomorrow,future":return me(t,{days:1}).getTime();case"two_days_after":return me(t,{days:2}).getTime();case"three_days_after":return me(t,{days:3}).getTime();case"four_days_after":return me(t,{days:4}).getTime();case"next_week":return me(t,{weeks:1}).getTime();case"two_weeks_after":return me(t,{weeks:2}).getTime();case"three_weeks_after":return me(t,{weeks:3}).getTime();case"this_sunday":return ge(t,0,{weekStartsOn:1});case"this_monday":return ge(t,1,{weekStartsOn:1});case"this_tuesday":return ge(t,2,{weekStartsOn:1});case"this_wednesday":return ge(t,3,{weekStartsOn:1});case"this_thursday":return ge(t,4,{weekStartsOn:1});case"this_friday":return ge(t,5,{weekStartsOn:1});case"this_saturday":return ge(t,6,{weekStartsOn:1});case"today_current,current":case"7_days_past,past":case"10_days_past,past":case"14_days_past,past":case"30_days_past,past":case"year_past,past":return me(t,{days:0}).getTime();case"7_days_future,future":return me(t,{days:7}).getTime();case"10_days_future,future":return me(t,{days:10}).getTime();case"14_days_future,future":return me(t,{days:14}).getTime();case"30_days_future,future":return me(t,{days:30}).getTime();case"yesterday,past":return me(t,{days:-1}).getTime();case"year_future,future,calendar":return me(new Date(t.getFullYear()+1,0,0),{years:1}).getTime();case"year_past,past,calendar":return me(new Date(t.getFullYear(),0,0),{years:0}).getTime();case"week_current,current":return(i=new Date,a=(i=new Date(i)).getDay(),o=i.getDate()-a+6+(0==a?6:1),new Date(i.setDate(o))).getTime();case"month_current,current":return new Date(t.getFullYear(),t.getMonth()+1,0).getTime();case"quarter_current,current":return new Date(n,3*(r+1),0).getTime();case"year_current,current":return me(new Date(t.getFullYear()+1,0,0),{years:0}).getTime();case"week_next,future":return function(e){var t=(e=new Date(e)).getDay(),r=e.getDate()-t+13+(0==t?-6:1);return new Date(e.setDate(r))}(new Date).getTime();case"month_next,future":return new Date(t.getFullYear(),t.getMonth()+2,0).getTime();case"quarter_next,future":return new Date(n,3*(r+1)+3,0).getTime();case"year_next,future":return me(t,{years:1}).getTime();case"week_past,past":return function(e){var t=(e=new Date(e)).getDay(),r=e.getDate()-t-1+(0==t?-6:1);return new Date(e.setDate(r))}(new Date).getTime();case"month_past,past":return new Date(t.getFullYear(),t.getMonth(),0,0).getTime();case"quarter_past,past":return new Date(n,3*(r+1)-3,0).getTime();default:return t.getTime()}var i,a,o}function be(e){return e&&"object"==typeof e&&"[object RegExp]"!==Object.prototype.toString.call(e)&&"[object Date]"!==Object.prototype.toString.call(e)}function ve(e,t){var r;return t&&!0===t.clone&&be(e)?Se((r=e,Array.isArray(r)?[]:{}),e,t):e}function we(e,t,r){var n=e.slice();return t.forEach((function(t,i){void 0===n[i]?n[i]=ve(t,r):be(t)?n[i]=Se(e[i],t,r):-1===e.indexOf(t)&&n.push(ve(t,r))})),n}function Se(e,t,r){e=void 0!==e?e:{},t=void 0!==t?t:{};var n=Array.isArray(t),i=(r||{arrayMerge:we}).arrayMerge||we;return n?Array.isArray(e)?i(e,t,r):ve(t,r):function(e,t,r){var n={};return be(e)&&Object.keys(e).forEach((function(t){n[t]=ve(e[t],r)})),Object.keys(t).forEach((function(i){be(t[i])&&e[i]?n[i]=Se(e[i],t[i],r):n[i]=ve(t[i],r)})),n}(e,t,r)}Se.all=function(e,t){if(!Array.isArray(e)||e.length<2)throw new Error("first argument should be an array with at least two elements");return e.reduce((function(e,r){return Se(e,r,t)}))};class Ee{constructor(e){this.gudhub=e}mergeFieldLists(e,t){let r=JSON.parse(JSON.stringify(e)),n=JSON.parse(JSON.stringify(t)),i=n.map((e=>e.field_id));return n.length?n.reduce(((e,t)=>{let r=null;if(e.find(((e,n)=>t.field_id==e.field_id&&(r=n,!0))))e[r]=this.gudhub.util.mergeObjects(e[r],t);else{let r=t.data_model&&t.data_model.interpretation&&t.data_model.interpretation.find((e=>"table"==e.src))||{settings:{show_field:1}};if(r.settings.show_field){let n=this.gudhub.util.mergeObjects({show:1},r),i=this.gudhub.util.mergeObjects(n,t);e.push(i)}}return e}),r).filter((function(e){return e.show&&-1!=i.indexOf(e.field_id)})):[]}createFieldsListToView(e,t){const r=this;return new Promise((async n=>{let i=await this.gudhub.getFieldModels(e);if(0!==t.length){let e=[];t.forEach(((r,n)=>{let o=i.find((e=>r.field_id==e.field_id));if(o){let t=o.data_model.interpretation.find((e=>"table"==e.src));t||(t={settings:{show_field:1}}),e.push({field_id:o.field_id,show:r.show,width:r.width?r.width:"150px"})}n+1==t.length&&a(e)}))}else a(t);function a(e){let t=0;i.forEach(((a,o)=>{e.find((e=>a.field_id==e.field_id))?(t==i.length-1&&n(e),t++):r.gudhub.ghconstructor.getInstance(a.data_type).then((r=>{if(r){let o=r.getTemplate().model.data_model.interpretation.find((e=>"table"==e.src));o||(o={settings:{show_field:1}}),e.push({field_id:a.field_id,show:o.settings.show_field}),t==i.length-1&&n(e)}t++}),(function(e){t++}))}))}}))}createFieldsListToViewWithDataType(e,t){return new Promise((async r=>{let n=[],i=await this.gudhub.getFieldModels(e),a=i.map((e=>+e.field_id));const o=[];n=i.reduce(((e,t)=>(e.find(((e,r)=>t.field_id==e.field_id))||(e.push({field_id:t.field_id,data_type:t.data_type}),o.push(new Promise((async r=>{const n=(await this.gudhub.ghconstructor.getInstance(t.data_type)).getTemplate().model.data_model.interpretation.find((e=>"table"==e.src))||{settings:{show_field:1}};e.find((e=>e.field_id==t.field_id)).show=n.settings.show_field,r(!0)})))),e)),t),Promise.all(o).then((()=>{n=n.filter((e=>-1!=a.indexOf(e.field_id))),r(n)}))}))}}class xe{constructor(e){this.gudhub=e,this.selectedItems={}}async selectItems(e,t){if(!this.selectedItems.hasOwnProperty(e)){this.selectedItems[e]={items:[],app:[]};let t=await this.gudhub.getApp(e);this.selectedItems[e].app=t}let r=this.selectedItems[e],n=r.items.map((e=>e.item_id));t.forEach((e=>{-1!=n.indexOf(e.item_id)?r.items.splice(n.indexOf(e.item_id),1):r.items[r.items.length]=e}))}getSelectedItems(e){return this.selectedItems[e]?this.selectedItems[e]:{items:[],app:[]}}clearSelectedItems(e){this.selectedItems[e]&&(this.selectedItems[e].items=[])}isItemSelected(e,t){let r=this.getSelectedItems(e);return null!==r&&(r=r.items.map((e=>e.item_id)),-1!=r.indexOf(t))}}class ke{constructor(e){this.gudhub=e,this.appsConnectingMap={apps:[],fields:[],items:[],views:[]}}createAppsFromTemplate(e,t,r,n){const i=this;return new Promise((a=>{const o=100/(6*e.apps.length);let s=0;i.createApps(e,(e=>{s+=1,r&&r.call(this,{percent:s*o,status:e})}),n).then((e=>{i.createItems(e,t,(e=>{"string"==typeof e?(s+=1,r&&r.call(this,{percent:s*o,status:e})):"object"==typeof e&&(r&&r.call(this,{status:"Done",apps:e}),a())}),n)}))}))}createItems(e,t,r,n){return new Promise((async i=>{const a=t||1e5,o=this;let s=[],l=[];const{accesstoken:c}=await o.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((e=>{l.push(new Promise((async t=>{let i;i=n?await o.gudhub.req.axiosRequest({url:`https://gudhub.com/GudHub_Test/api/app/get?token=${c}&app_id=${o._searchOldAppId(e.app_id,o.appsConnectingMap.apps)}`,method:"GET"}):await o.gudhub.getApp(o._searchOldAppId(e.app_id,o.appsConnectingMap.apps)),r&&r.call(this,`GET APP: ${i.app_name} (Items steps)`);let l=JSON.parse(JSON.stringify(i)),u=l.items_list.map((e=>({index_number:e.index_number,item_id:0,fields:[]}))).filter(((e,t)=>t<=a));o.gudhub.addNewItems(e.app_id,u).then((n=>{r&&r.call(this,`ADD NEW ITEMS: ${i.app_name} (Items steps)`),e.items_list=n,o._updateMap(e.items_list,l.items_list),o._addFieldValue(l.items_list,e.items_list,o.appsConnectingMap),s.push(e),t()}))})))})),Promise.all(l).then((()=>{s.forEach((e=>{e.items_list.forEach((e=>{e.fields.forEach((e=>{o.appsConnectingMap.fields.forEach((t=>{e.field_id===t.old_field_id&&(e.field_id=t.new_field_id,e.element_id=t.new_field_id)}))}))}))})),o.deleteField(s),o.replaceValue(s,o.appsConnectingMap).then((()=>{const e=[];s.forEach((t=>{e.push(new Promise((e=>{let n=t.items_list.map((e=>(e.fields.forEach((e=>{delete e.data_id})),e)));o.gudhub.updateItems(t.app_id,n).then((()=>{r&&r.call(this,`REPLACE VALUE: ${t.app_name} (Items steps)`),e()}))})))})),Promise.all(e).then((()=>{r.call(this,s),i()}))}))}))}))}deleteField(e){e.forEach((e=>{e.items_list.forEach((t=>{t.fields=t.fields.filter((t=>e.field_list.findIndex((e=>e.field_id==t.field_id))>-1))}))}))}replaceValue(e,t){return new Promise((async r=>{const n=[],i=this;e.forEach((e=>{e.field_list.forEach((r=>{"item_ref"===r.data_type&&i._replaceValueItemRef(e,r,t),n.push(new Promise((t=>{i.gudhub.ghconstructor.getInstance(r.data_type).then((n=>void 0===n?(console.log("ERROR WHILE GETTING INSTANCE OF ",r.data_type),void t({type:r.data_type})):"file"==n.getTemplate().constructor?i.gudhub.util.fileInstallerHelper(e.app_id,e.items_list,r.field_id).then((e=>{t(e)})):void("document"==n.getTemplate().constructor?i.documentInstallerHelper(e.app_id,e.items_list,r.field_id).then((e=>{t(n)})):t(n))))})))}))})),n.length>0?Promise.all(n).then((e=>{r(e)})):r(result)}))}documentInstallerHelper(e,t,r){const n=this;return new Promise((async i=>{for(const i of t){const t=i.item_id,a=i.fields.find((e=>e.element_id===r));if(a&&a.field_value&&a.field_value.length>0){const i=await n.gudhub.getDocument({_id:a.field_value});if(i&&i.data){const o=await n.gudhub.createDocument({app_id:e,item_id:t,element_id:r,data:i.data});a.field_value=o._id}}}i()}))}_replaceValueItemRef(e,t,r){e.items_list.forEach((e=>{e.fields.forEach((e=>{if(e.field_id===t.field_id&&e.field_value){let t=e.field_value.split(",");t.forEach(((e,n)=>{let i=e.split(".");r.apps.forEach((e=>{i[0]==e.old_app_id&&(i[0]=e.new_app_id)})),r.items.forEach((e=>{i[1]==e.old_item_id&&(i[1]=e.new_item_id)})),t[n]=i.join(".")})),e.field_value=t.join(",")}}))}))}_addFieldValue(e,t,r){t.forEach((t=>{r.items.forEach((r=>{t.item_id===r.new_item_id&&e.forEach((e=>{r.old_item_id===e.item_id&&(t.fields=e.fields)}))}))}))}_updateMap(e,t){t.forEach((t=>{e.forEach((e=>{t.index_number===e.index_number&&this.appsConnectingMap.items.push({old_item_id:t.item_id,new_item_id:e.item_id})}))}))}_searchOldAppId(e,t){let r=0;return t.forEach((t=>{t.new_app_id===e&&(r=t.old_app_id)})),r}createApps(e,t,r){const n=this;let i={step_size:100/(3*e.apps.length),apps:[]};return new Promise((async a=>{let o={},s=[],l=[];const{accesstoken:c}=await n.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 u of e.apps){let p;p=r?await n.gudhub.req.axiosRequest({url:`https://gudhub.com/GudHub_Test/api/app/get?token=${c}&app_id=${u}`,method:"GET"}):await n.gudhub.getApp(u),t&&t.call(this,`GET APP: ${p.app_name} (App steps)`);let d=JSON.parse(JSON.stringify(p));o[d.app_id]=d,i.apps.push(d.icon);let h=n.prepareAppTemplate(d);h.app_name=h.app_name+" New",h.privacy=1,e.data_to_change&&(e.data_to_change.name&&(h.app_name=e.data_to_change.name),e.data_to_change.icon&&(h.icon=e.data_to_change.icon)),n.resetViewsIds(h),n.gudhub.createNewApp(h).then((r=>{t&&t.call(this,`CREATE NEW APP: ${p.app_name} (App steps)`),s.push(r),n.mapApp(d,r,n.appsConnectingMap),e.apps.length==s.length&&(n.connectApps(s,n.appsConnectingMap,o),s.forEach((r=>{n.gudhub.updateApp(r).then((r=>{t&&t.call(this,`UPDATE APP: ${p.app_name} (App steps)`),l.push(r),e.apps.length==l.length&&a(l)}))})))}))}}))}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((e=>{t.field_list.forEach((t=>{e.name_space==t.name_space&&r.fields.push({name_space:e.name_space,old_field_id:e.field_id,new_field_id:t.field_id})}))})),e.views_list.forEach((e=>{t.views_list.forEach((t=>{e.name==t.name&&r.views.push({name:e.name,old_view_id:e.view_id,new_view_id:t.view_id})}))}))}crawling(e,t){let r=null===e?[]:Object.keys(e);const n=this;r.length>0&&r.forEach((r=>{let i=e[r];void 0!==i&&"string"!=typeof e&&(t(r,i,e),n.crawling(i,t))}))}resetViewsIds(e){e.view_init=0,this.crawling(e.views_list,(function(e,t,r){"view_id"!=e&&"container_id"!=e||(r[e]=0)}))}connectApps(e,t,r){const n=this;return e.forEach((e=>{t.apps.forEach((r=>{e.view_init===r.new_view_init&&t.views.forEach((t=>{r.old_view_init===t.old_view_id&&(e.view_init=t.new_view_id)}))})),n.crawling(e.field_list,(function(i,a,o){if(-1!==i.indexOf("field_id")||-1!==i.indexOf("FieldId")||-1!==i.indexOf("destination_field")){let e=String(a).split(","),r=[];t.fields.forEach((t=>{e.forEach((e=>{e==t.old_field_id&&r.push(t.new_field_id)}))})),r.length&&(o[i]=r.join(","))}if(-1==i.indexOf("app_id")&&-1==i.indexOf("AppId")&&-1==i.indexOf("destination_app")||t.apps.forEach((e=>{a==e.old_app_id&&(o[i]=e.new_app_id)})),-1!==i.indexOf("view_id")&&t.views.forEach((e=>{a==e.old_view_id&&(o[i]=e.new_view_id)})),-1!==i.indexOf("src")&&isFinite(a)){const s="container_id",l=t.apps.find((t=>t.new_app_id===e.app_id)).old_app_id,c=n.findPath(r[l].views_list,s,a);o[i]=`${n.getValueByPath(e.views_list,c,s)}`}}))})),e}getValueByPath(e,t,r){let n=e;return t.split(".").forEach((e=>{n=n[e]})),n[r]}findPath(e,t,r){let n=!1,i=!1,a=[];return this.crawling(e,(function(e,o,s){i&&a.reverse().forEach((e=>{i&&(e.delete=!0,e.parent===s&&(i=!1,a=a.filter((e=>!e.delete)),a.reverse()))})),n||("object"==typeof s[e]&&a.push({prop:e,parent:s}),o==r&&t===e?n=!0:Object.keys(s).pop()===e&&"object"!=typeof s[e]&&(i=!0))})),a.map((e=>e.prop)).join(".")}prepareAppTemplate(e){let t=JSON.parse(JSON.stringify(e));return this.crawling(t.views_list,(function(e,t,r){"element_id"==e&&(r.element_id=-Number(t),r.create_element=-Number(t))})),t.field_list.forEach((e=>{e.create_field=-Number(e.field_id),e.element_id=-Number(e.field_id),e.field_id=-Number(e.field_id),e.field_value=""})),t.items_list=[],delete t.app_id,delete t.icon.id,delete t.group_id,delete t.trash,delete t.last_update,delete t.file_list,t}}class Ae{constructor(e){this.gudhub=e}fileInstallerHelper(e,t,r){const n=this;return new Promise((i=>{const a=[[]];let o=Promise.resolve(),s=[];t.forEach((t=>{const n=t.item_id,i=t.fields.find((e=>e.element_id===r));i&&i.field_value&&i.field_value.split(".").forEach((t=>{const i={source:t,destination:{app_id:e,item_id:n,element_id:r}};10!==a[a.length-1].length?a[a.length-1].push(i):a.push([i])}))})),a.forEach((e=>{o=o.then((()=>n.gudhub.duplicateFile(e))).then((e=>{s=[...s,...e]}))})),o.then((()=>{t.forEach((e=>{const t=e.item_id,n=e.fields.find((e=>e.element_id===r));n&&n.field_value&&(n.field_value="",s.forEach((e=>{e.item_id===t&&(n.field_value=n.field_value.split(",").filter((e=>e)).concat(e.file_id).join(","))})))})),i()}))}))}}async function Ie(e){await Promise.all(e);let t=!0;for(const r of e){const e=await je(r);if("pending"===e.state){t=!1;break}if("rejected"===e.state)throw e.reason}return!!t||Ie(e)}function je(e){const t={state:"pending"};return Promise.race([e,t]).then((e=>e===t?e:{state:"resolved",value:e}),(e=>({state:"rejected",reason:e})))}class Oe{constructor(e){this.gudhub=e,this.MergeFields=new Ee(e),this.ItemsSelection=new xe(e),this.AppsTemplateService=new ke(e),this.FileHelper=new Ae(e)}prefilter(e,t={}){return async function(e,t,r,n={}){const i=[],a={variableMethodcurrent_app:()=>[n.current_app_id||n.app_id],variableMethodelement_app:()=>[n.element_app_id],variableMethodcurrent_item:()=>[`${n.current_app_id||n.app_id}.${n.item_id}`],variableMethoduser_id:()=>[t.getUser().user_id],variableMethoduser_email:e=>[t.getUser().username],variableMethodtoday(e){const t=new Date,r=new Date(t.getFullYear(),t.getMonth(),t.getDate()),n=new Date(t.getFullYear(),t.getMonth(),t.getDate()+1);return[r.valueOf().toString()+":"+n.valueOf().toString()]},variableMethodvariable:e=>[n[e]]};if(e)for(const t of e)if(t)switch(t.input_type){case"variable":t.valuesArray=[];for(const e of t?.input_value.split(",")){const r=a[t.input_type+"Method"+e];"function"==typeof r?t.valuesArray?t.valuesArray.push(...r()):t.valuesArray=r():t.valuesArray?t.valuesArray.push(...a.variableMethodvariable(e)):t.valuesArray=a.variableMethodvariable(e)}i.push(t);break;case"field":const e=await o({app_id:n.current_app_id||n.app_id,item_id:n.item_id,field_id:t.input_value});null!=e&&t.valuesArray.push(e),i.push(t);break;default:i.push(t)}else i.push(t);function o(e){return new Promise((t=>{r.on("gh_value_get",e,(function n(i,a){r.destroy("gh_value_get",e,n),t(a)})).emit("gh_value_get",{},e)}))}return i}(e,this.gudhub.storage,this.gudhub.pipeService,t)}filter(e,t){return function(e,t){const r=new se;return e&&e.length?r.filter(t,e):[]}(e,t)}mergeFilters(e,t){return function(e,t){const r=[];let n=[];if(e.length>0?e.forEach((e=>{n.push(e)})):n=t,n.length>0){n.forEach(((e,i)=>{for(let a=0;a<t.length;a++)e.field_id==t[a].field_id&&(r.push(e.field_id),n[i]=gudhub.mergeObjects(t[a],e))}));for(let e=0;e<t.length;e++)r.includes(t[e].field_id)||n.push(t[e])}return n}(e,t)}group(e,t){return function(e,t){let r,n=[];e?r=e.split(","):n=t;let i=new Set;return e&&t.forEach((e=>{let t="";r.forEach(((a,o)=>{const s=e.fields.find((e=>e.field_id==a));s&&(t+=s.field_value),r.length-1==o&&function(e){const t=!i.has(e);return t&&i.add(e),t}(t)&&n.push(e)}))})),n}(e,t)}async getFilteredItems(e=[],t=[],r,n,i,a="",o,s){const l=await this.prefilter(t,{element_app_id:r,app_id:n,item_id:i}),c=this.filter(e,l);return this.group(a,c).filter((e=>!o||1===Y([e],o).length)).filter((e=>!s||1===Y([e],s).length))}jsonToItems(e,t){return function(e,t){let r=[];t.forEach((t=>{let n=[];try{n=le.paths(e,t.json_path),r.push({field_id:t.field_id,json_paths:n,json_paths_length:n.length})}catch(e){console.log(e)}})),r.sort(((e,t)=>t.json_paths_length-e.json_paths_length));let n=function(e){let t=[];return e.length&&e[0].json_paths.forEach((r=>{let n={fields:[]};e.forEach((e=>{n.fields.push({field_id:e.field_id,json_path:ce(r,e.json_paths)})})),t.push(n)})),t}(r).map((t=>({fields:t.fields.map((t=>({field_id:t.field_id,field_value:le.value(e,t.json_path)})))})));return n}(e,t)}getDate(e){return _e(e)}checkRecurringDate(e,t){return function(e,t){e=new Date(e);let r=new Date;switch(t){case"day":return e.getDate()+"."+e.getMonth()==r.getDate()+"."+r.getMonth();case"week":let t=(new Date).getFullYear(),n=new Date(t,e.getMonth(),e.getDate());return ye(n,r);case"month":return e.getMonth()===r.getMonth();default:return!0}}(e,t)}populateItems(e,t,r){return function(e,t,r){var n=JSON.parse(JSON.stringify(e));return r?function(e,t){return e.forEach((e=>{t.forEach((t=>{let r=e.fields.find((e=>e.element_id==t.element_id));r?r.field_value=t.field_value:(t.field_id=t.element_id,e.fields.push(t))}))})),e}(n,t):function(e,t){return e.forEach((e=>{e.fields=[].concat(t)})),e}(n,t)}(e,t,r)}populateWithDate(e,t){return function(e,t){return e.forEach((e=>{t.forEach((t=>{let r=e.fields.find((e=>e.element_id==t.element_id));r?t.data_range?(t.date_type.includes("calendar"),r.field_value=`${function(e){let t=new Date;switch(e){case"week_current,current":case"week_next,future":case"week_past,past":return function(t){var r=t.getDay();let n;e.includes("week_current,current")&&(n=0),e.includes("week_next,future")&&(n=7),e.includes("week_past,past")&&(n=-7);let i=t.getDate()-r+n+(0==r?-6:1);return new Date(t.setDate(i))}(new Date).getTime();case"month_current,current":return new Date(t.getFullYear(),t.getMonth(),1).getTime();case"quarter_current,current":case"quarter_next,future":case"quarter_past,past":return function(t){let r,n,i=Math.floor(t.getMonth()/3),a=t.getFullYear();return e.includes("quarter_current,current")&&(r=0,n=0),e.includes("quarter_next,future")&&(r=3,n=0),e.includes("quarter_past,past")&&(r=-3,n=0),new Date(a,3*i+r,1+n)}(new Date).getTime();case"year_current,current":return me(new Date(t.getFullYear(),0,1),{years:0}).getTime();case"month_next,future":return new Date(t.getFullYear(),t.getMonth()+1,1).getTime();case"year_next,future":case"today_current,current":case"7_days_future,future":case"10_days_future,future":case"14_days_future,future":case"30_days_future,future":return me(t,{days:0}).getTime();case"month_past,past":return new Date(t.getFullYear(),t.getMonth()-1,1).getTime();case"year_past,past":return me(t,{years:-1}).getTime();case"year_past,past,calendar":return me(new Date(t.getFullYear(),0,1),{years:-1}).getTime();case"year_future,future,calendar":return me(new Date(t.getFullYear()+1,0,1),{years:0}).getTime();case"tomorrow,future":return me(t,{days:1}).getTime();case"yesterday,past":return me(t,{days:-1}).getTime();case"7_days_past,past":return me(t,{days:-7}).getTime();case"10_days_past,past":return me(t,{days:-10}).getTime();case"14_days_past,past":return me(t,{days:-14}).getTime();case"30_days_past,past":return me(t,{days:-30}).getTime()}}(t.date_type)}:${_e(t.date_type)}`):r.field_value=_e(t.date_type):e.fields.push({field_id:t.element_id,element_id:t.element_id,field_value:_e(t.date_type)})}))})),e}(e,t)}populateWithItemRef(e,t,r,n,i,a){return function(e,t,r,n,i,a){let o=[];const s=function(e,t){let r=he(t,i);r&&(r.field_value=a+"."+e.item_id,o.push(t))};return r.forEach((r=>{e.forEach((e=>{!function(e,t,r,n,i){he(e,r).field_value==he(t,n).field_value&&i(e,t)}(e,r,t,n,s)}))})),o}(e,t,r,n,i,a)}compareItems(e,t,r){return function(e,t,r){const n=JSON.parse(JSON.stringify(e)),i=JSON.parse(JSON.stringify(t));let a={is_items_diff:!1,new_src_items:[],diff_src_items:[],same_items:[]};const o=function(e){a.diff_src_items.push(e)},s=function(e){a.same_items.push(e)},l=function(e){a.new_src_items.push(e)};return r?ue(n,i,r,o,s,l):pe(n,i,o,s,l),a.is_items_diff=a.new_src_items.length>0||a.diff_src_items.length>0,a}(e,t,r)}mergeItems(e,t,r){return function(e,t,r){let n=JSON.parse(JSON.stringify(e)),i=JSON.parse(JSON.stringify(t)),a=[];const o=function(e,t){a.push(function(e,t){return e.fields.forEach((e=>{let r=he(t,e.field_id);r?(r.field_value=e.field_value,e.history&&r.history&&(r.history=e.history.concat(r.history))):t.fields.push(e)})),t}(e,t))},s=function(e){a.push(e)},l=function(e){a.push(e)};return r?ue(n,i,r,o,s,l):pe(n,i,o,s,l,(function(e){a.push(e)})),a}(e,t,r)}mergeObjects(e,t,r){return function(e,t,r){return Se(e,t,r)}(e,t,r)}makeNestedList(e,t,r,n,i){return function(e,t,r,n,i){let a,o=JSON.parse(JSON.stringify(e)),s=Boolean(n)?n:"children",l=!!Boolean(i)&&i;for(a=0;a<o.length;a++)o[a][r]&&0!==o[a][r]&&o.forEach((e=>{o[a][r]==e[t]?(e[s]||(e[s]=[]),e[s].push(o[a]),o.splice(a,1),0==a?a=0:a--):e[s]&&c(e)}));function c(e){e[s].forEach((e=>{e[t]==o[a][r]?(e[s]||(e[s]=[]),e[s].push(o[a]),o.splice(a,1),0==a?a=0:a--):e[s]&&c(e)}))}return l&&function e(t){t.sort(((e,t)=>e[l]-t[l])),t.forEach((t=>{t[s]&&e(t[s])}))}(o),o}(e,t,r,n,i)}mergeChunks(e){return function(e){const t={};return e.forEach((e=>{e.items_list.forEach((e=>{const r=t[e.item_id];return r?(r.trash=e.trash,e.fields.forEach((e=>{let t=!0;r.fields=r.fields.map((r=>Number(r.field_id)===Number(e.field_id)?(t=!1,r.field_value!=e.field_value?{...e,history:e.history.concat(r.history)}:r):r)),t&&r.fields.push(e)}))):t[e.item_id]=e}))})),Object.values(t)}(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,n){return function(e,t,r,n,i){async function a(e,t,i){let s=null;if("array"===e.type&&(s=Number(e.is_static)?new Array(await o(e.childs,t,i)):await async function(e,t,i){const a=await r.gudhub.getApp(Number(e.app_id));let s=await async function(e=[],t=[],i="",a={}){return e.length?async function(e,t,i,a,o){const s=await r.gudhub.prefilter(JSON.parse(JSON.stringify(e)),{element_app_id:t,app_id:i,item_id:a,...n});return r.gudhub.filter(o,[...s,...e])}(e,i,i,a.item_id,t):[...t]}(e.filter,a.items_list,i,t);if(e.isSortable&&e.field_id_to_sort&&""!==e.field_id_to_sort){let t=s.flatMap((t=>{let r=t.fields.find((t=>t.field_id==e.field_id_to_sort));return r&&""!=r.field_value?t:[]})),r=s.filter((e=>{if(!t.includes(e))return e}));t=t.sort(((t,r)=>"desc"==e.sortType?r.fields.find((t=>t.field_id==e.field_id_to_sort)).field_value-t.fields.find((t=>t.field_id==e.field_id_to_sort)).field_value:t.fields.find((t=>t.field_id==e.field_id_to_sort)).field_value-r.fields.find((t=>t.field_id==e.field_id_to_sort)).field_value)),s=[...t,...r]}if(e.offset){let t;t=e.use_variables_for_limit_and_offset&&n?n[e.offset]:/^[0-9]+$/.test(e.offset)?e.offset:0,s=s.slice(t)}if(e.limit){let t;t=e.use_variables_for_limit_and_offset&&n?n[e.limit]:/^[0-9]+$/.test(e.limit)||0,0!==t&&(s=s.slice(0,t))}const l=s.map((async t=>o(e.childs,t,a.app_id)));return Promise.all(l)}(e,t,i)),"object"===e.type&&(s=Number(e.current_item)?await async function(e,t){const n=await r.gudhub.getApp(e.app_id),i=n.items_list||[];return o(e.childs,t||i[0],n.app_id)}(e,t):await o(e.childs,t,i)),"property"===e.type&&(s=await async function(e,t,n){switch(e.property_type){case"static":return e.static_field_value;case"variable":return"app_id"===e.variable_type?n:`${n}.${t.item_id}`;case"field_id":return e.field_id;case"function":if("function"==typeof e.function)return e.function(t,n,r.gudhub,...e.args);{const i=new Function("item, appId, gudhub","return (async "+e.function+")(item, appId, gudhub)");return await i(t,n,r.gudhub)}default:return!e.field_id&&e.name_space&&(e.field_id=await r.gudhub.getFieldIdByNameSpace(n,e.name_space)),Boolean(Number(e.interpretation))?await r.gudhub.getInterpretationById(Number(n),Number(t.item_id),Number(e.field_id),"value"):await r.gudhub.getFieldValue(Number(n),Number(t.item_id),Number(e.field_id))}}(e,t,i)),"object"==typeof e&&void 0===e.type){const r={};for(const n in e)if(e.hasOwnProperty(n)){const o=e[n],s=await a(o,t,i);r[n]=s[o.property_name]}return r}return{[e.property_name]:s}}async function o(e,t,r){const n=await e.map((async e=>a(e,t,r)));return(await Promise.all(n)).reduce(((e,t)=>({...e,...t})),{})}return a(e,t,i)}(e,t,this,r,n)}fileInstallerHelper(e,t,r){return this.FileHelper.fileInstallerHelper(e,t,r)}createAppsFromTemplate(e,t,r,n){return this.AppsTemplateService.createAppsFromTemplate(e,t,r,n)}createApps(e){return this.AppsTemplateService.createApps(e)}createItems(e,t){return this.AppsTemplateService.createItems(e,t)}compareObjects(e,t){return r=e,n=t,JSON.stringify(r)===JSON.stringify(n);var r,n}compareAppsItemsLists(e,t,r){const n=new Blob(['function createList(items) {\n return items.reduce(\n (acc, item) => {\n acc.list[item.item_id] = item;\n acc.ids.push(item.item_id);\n return acc;\n },\n { ids: [], list: {} }\n );\n };\n function compareItemsLists(oldItems, newItems) {\n const { ids: oldIds, list: oldList } = createList(oldItems);\n const { ids: newIds, list: newList } = createList(newItems);\n\n const deletedItemsIds = oldIds.filter((id) => !newIds.includes(id));\n const recentItemsIds = oldIds.filter((id) => !deletedItemsIds.includes(id));\n const newItemsIds = newIds.filter((id) => !oldIds.includes(id));\n\n const diff_fields_items = {};\n const diff_fields_items_Ids = [];\n \n recentItemsIds.forEach((id) => {\n const newItem = newList[id];\n const oldItem = oldList[id];\n\n oldItem.fields.forEach((field1) => {\n const sameField = newItem.fields.find(\n (field2) => Number(field2.field_id) === Number(field1.field_id)\n );\n\n if (!sameField) {\n if (!diff_fields_items[newItem.item_id]) {\n diff_fields_items[newItem.item_id] = [];\n diff_fields_items_Ids.push(newItem.item_id);\n }\n\n return diff_fields_items[newItem.item_id].push(field1);\n }\n\n if (field1.field_value != sameField.field_value) {\n if (!diff_fields_items[newItem.item_id]) {\n diff_fields_items[newItem.item_id] = [];\n diff_fields_items_Ids.push(newItem.item_id);\n }\n return diff_fields_items[newItem.item_id].push(field1);\n }\n });\n });\n\n return {\n newItems: newItemsIds.reduce((acc, id) => {\n acc.push(newList[id]);\n return acc;\n }, []),\n deletedItems: deletedItemsIds.reduce((acc, id) => {\n acc.push(oldList[id]);\n return acc;\n }, []),\n diff_fields_items_Ids,\n diff_fields_items,\n diff_items: diff_fields_items_Ids.reduce((acc, id) => {\n acc.push(oldList[id]);\n return acc;\n }, []),\n };\n }\n\n self.addEventListener("message", (event) => {\n const { items_list1, items_list2 } = event.data;\n\n const diff = compareItemsLists(items_list1, items_list2);\n self.postMessage({ diff });\n });'],{type:"application/javascript"});this.worker=new Worker(URL.createObjectURL(n)),this.worker.postMessage({items_list1:e,items_list2:t}),this.worker.addEventListener("message",(e=>{const{diff:t}=e.data;r(t)}))}dynamicPromiseAll(e){return Ie(e)}sortItems(e,t){return function(e,t){if(!e||!e.length)return[];if(!e[0].fields.length)return e;var r=t&&t.sort_field_id||e[0].fields[0].field_id;function n(e){for(var t=null,n=0;n<e.fields.length;n++)if(e.fields[n].field_id==r){t=e.fields[n].field_value;break}return t}return e.sort((function(e,t){var r=n(e),i=n(t);return null===r?-1:null===i?1:/^\d+$/.test(r)&&/^\d+$/.test(i)?Number(r)<Number(i)?-1:1:/^\d+$/.test(r)||/^\d+$/.test(i)?/^\d+$/.test(r)?-1:1:r.toLowerCase()>i.toLowerCase()?1:-1})),t&&t.descending?e.reverse():e}(e,t)}debounce(e,t){let r;return function(...n){clearTimeout(r),r=setTimeout((()=>{e.apply(this,n)}),t)}}}class Pe{constructor(e,t){this.req=e,this.storage=t}async login({username:e,password:t}={}){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:`${this.req.root}/auth/login`,form:{username:e,password:t}})}catch(e){console.log(e)}}async loginWithTokenApi(e){try{return await this.req.axiosRequest({method:"POST",url:`${this.req.root}/auth/login?accesstoken=${e}`})}catch(e){console.log(e)}}async updateTokenApi(e){try{return await this.req.axiosRequest({method:"POST",url:`${this.req.root}/auth/login`,form:{auth_key:e}})}catch(e){console.log(e)}}logoutApi(e){return this.req.post({url:"/auth/logout",form:{token:e}})}signupApi(e){return this.req.axiosRequest({method:"POST",url:`${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();return t.find((t=>t.user_id==e.user_id))||(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 e=await this.updateToken(this.storage.getUser().auth_key);this.storage.updateUser(e),r=e.accesstoken}return r}}var Te=__webpack_require__(960),Ce=__webpack_require__(738);class Ne{constructor(e){this.gudhub=e,this.cache={},this.modulesQueue={},this.angularInjector,this.nodeWindow}async getInstance(e){return this.getCached(e)||(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(t){let r,n=this.gudhub.storage.getModuleUrl(t);if(n)return"gh_element"===n.type&&("angular"===n.technology?r=await(0,Te.Z)(this.gudhub,t,n.url,this.angularInjector,this.nodeWindow):"class"===n.technology&&(r=await async function(t,r,n,i,a){try{n||console.error(`JS link must be provided for this data type - ${r}`);let o,s=t=>(Ce.P||global.hasOwnProperty("window")||(global.window=proxy,global.document=a.document,global.Element=a.Element,global.CharacterData=a.CharacterData,global.this=proxy,global.self=proxy,global.Blob=a.Blob,global.Node=a.Node,global.navigator=a.navigator,global.HTMLElement=a.HTMLElement,global.XMLHttpRequest=a.XMLHttpRequest,global.WebSocket=a.WebSocket,global.crypto=a.crypto,global.DOMParser=a.DOMParser,global.Symbol=a.Symbol,global.document.queryCommandSupported=e=>(console.log("QUERY COMMAND SUPPORTED: ",e),!1),global.angular=angular),new Promise((async n=>{let i=await e.get(t).catch((e=>{console.log(`Failed to fetch: ${t} in ghconstructor. Module id: ${r}`)}));n("data:text/javascript;charset=utf-8,"+encodeURIComponent(i.data))}))),l=await s(n);try{o=await import(l)}catch(e){console.log(`Error while importing module: ${r}`),console.log(e)}let c=new o.default(r);if(i&&Ce.P){const e=document.createElement("link");e.href=i,e.setAttribute("data-module",r),e.setAttribute("rel","stylesheet"),document.getElementsByTagName("head")[0].appendChild(e)}return{type:r,getTemplate:function(e,t,r,n,i,a){let o="false"!==r;return c.getTemplate(e,t,o,n,i,a)},getDefaultValue:function(e,t,r,n){return new Promise((async i=>{let a=c.getDefaultValue;i(a?await a(e,t,r,n):null)}))},getSettings:function(e,t,r){return c.getSettings(e,t,r)},filter:{getSearchOptions:function(e){let t=c;return t.filter&&t.filter.getSearchOptions?c.filter.getSearchOptions(e):[]},getDropdownValues:function(){let e=c;return e.filter&&e.filter.getDropdownValues?e.filter.getDropdownValues():[]}},getInterpretation:function(e,n,i,a,o,s){return new Promise((async l=>{let u=c;try{let r=await u.getInterpretation(t,e,s,o,a,i),c=r.find((e=>e.id==n))||r.find((e=>"default"==e.id));l({html:await c.content()})}catch(e){console.log(`ERROR IN ${r}`,e),l({html:"<span>no interpretation</span>"})}}))},getInterpretationsList:function(e,t,r,n){return c.getInterpretation(e,t,r,n)},getInterpretatedValue:function(e,t,r,n){return new Promise((async i=>{let a=c.getInterpretatedValue;i(a?await a(e,t,r,n):e)}))},onMessage:function(e,t,r){return new Promise((async n=>{const i=c.onMessage;i&&n(await i(e,t,r)),n(null)}))},extendController:function(e){c.getActionScope(e)},runAction:function(e){try{c.runAction(e)}catch(e){}},getWindowScope:function(e){return c.getWindowScope(e)},getWindowHTML:function(e){return c.getWindowHTML(e)}}}catch(e){console.log(e),console.log(`Failed in createClassInstance (ghconstructor). Module id: ${r}. JS url: ${n}`)}}(this.gudhub,t,n.js,n.css,this.nodeWindow))),r&&this.pupToCache(t,r),r;console.log(`Cannot find module: ${t}`)}}class Le{constructor(e,t,r,n,i,a,o,s){this.storage=e,this.pipeService=t,this.req=r,this.ws=n,this.applistReceived=!1,this.activateSW=o,this.chunksManager=i,this.util=a,this.appListeners(),this.dataService=s}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(e){return console.log(e),null}}async updateAppApi(e){try{return await this.req.post({url:"/api/app/update",form:{app:JSON.stringify(e)}})}catch(e){return console.log(e),null}}async deleteAppApi(e){try{return await this.req.post({url:"/api/app/delete",form:{app_id:e}})}catch(e){return console.log(e),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){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 t=0;t<e.items_list.length;t++){e.items_object[e.items_list[t].item_id]={};for(let r=0;r<e.items_list[t].fields.length;r++)e.items_object[e.items_list[t].item_id][e.items_list[t].fields[r].field_id]=e.items_list[t].fields[r]}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((t=>{this.pipeService.emit("gh_model_update",{app_id:e.app_id,field_id:t.field_id},t)}))}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,n)=>{r.app_id==e&&t.splice(n)})),t}updateAppsListInStorage(e=[]){for(const t of e){const e=this.storage.getApp(t.app_id);e?(e.from_apps_list=t.from_apps_list,e.permission=t.permission):this.addNewAppToStorage(t)}}async refreshApps(e=[]){for(const t of e)if(null!=t)try{const e=await this.dataService.getApp(t);if(e){e.items_object={};for(let t=0;t<e.items_list.length;t++){e.items_object[e.items_list[t].item_id]={};for(let r=0;r<e.items_list[t].fields.length;r++)e.items_object[e.items_list[t].item_id][e.items_list[t].fields[r].field_id]=e.items_list[t].fields[r]}this.updateAppInStorage(e),this.pipeService.emit("gh_app_views_update",{app_id:e.app_id},e.views_list)}}catch(e){console.log(e)}console.log("Apps refreshed: ",JSON.stringify(e))}async refreshAppsList(){let e=this.getAppListFromStorage(),t=(await this.getAppListApi()).map((t=>({...t,...e.find((e=>e.app_id===t.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,this.getApp(this.storage.getUser().app_init)}return e}async getAppInfo(e){const t=await this.getAppsList();return t?t.find((t=>t.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;let n=await this.dataService.getApp(e);if(n){if(n.chunks&&n.chunks.length){let t=await this.chunksManager.getChunks(e,n.chunks);n.items_list=this.util.mergeChunks([...t,n])}return this.saveAppInStorage(n),this.ws.addSubscription(e),n}}async updateApp(e){if(!e.views_list||!e.views_list.length||!e.show){const t=await this.getApp(e.app_id);e.views_list&&e.views_list.length||(e.views_list=t.views_list),void 0===e.show&&(e.show=t.show)}const 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){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}handleAppChange(e,t){}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 e=await this.getApp(t.app_id);this.pipeService.emit("gh_app_get",t,e)}})),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 n=await this.getAppsList();this.pipeService.emit("gh_apps_list_update",{recipient:"all"},n),r.field_list.forEach((e=>{this.pipeService.emit("gh_model_update",{app_id:r.app_id,field_id:e.field_id},e)}))})),this.pipeService.onRoot("gh_app_view_get",{},(async(e,t)=>{if(t&&t.app_id){const e=await this.getApp(t.app_id);e.views_list.forEach(((r,n)=>{r.view_id==t.view_id&&this.pipeService.emit("gh_app_view_get",t,e.views_list[n])}))}})),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 e=await this.updateAppInfo(t.app);this.pipeService.emit("gh_app_info_update",{app_id:t.app.app_id},e)}})),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)})),Ce.P&&this.activateSW&&navigator.serviceWorker.addEventListener("message",(async e=>{if("refresh app"===e.data.type){const t=await this.getApp(e.data.payload.app_id);t&&this.util.compareAppsItemsLists(t.items_list,e.data.payload.items_list.filter((e=>!e.trash)),(({diff_fields_items:t,diff_fields_items_Ids:r,diff_items:n,newItems:i,deletedItems:a})=>{(n.length||i.length||a.length)&&(this.pipeService.emit("gh_items_update",{app_id:e.data.payload.app_id},e.data.payload.items_list.filter((e=>!e.trash))),n.forEach((t=>this.pipeService.emit("gh_item_update",{app_id:e.data.payload.app_id,item_id:t.item_id},t)))),r.forEach((r=>{const n=t[r];n&&n.forEach((t=>{this.pipeService.emit("gh_value_update",{app_id:e.data.payload.app_id,item_id:r,field_id:t.field_id},t.field_value)}))}))})),e.data.payload.items_list=this.util.mergeChunks([t,e.data.payload]),this.saveAppInStorage(e.data.payload)}}))}}class Me{constructor(e,t,r,n,i){this.storage=e,this.pipeService=t,this.req=r,this.appProcessor=n,this.util=i,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(e){return console.log(e),null}}async updateItemsApi(e,t){try{return await this.req.post({url:"/api/items/update",form:{items:JSON.stringify(t),app_id:e}})}catch(e){return console.log(e),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(e){return console.log(e),null}}async addItemsToStorage(e,t){const r=await this.appProcessor.getApp(e);return r&&(t.forEach((t=>{r.items_list.push(t),r.items_object[t.item_id]={};for(let e=0;e<t.fields.length;e++)r.items_object[t.item_id][t.fields[e].field_id]=t.fields[e];this.pipeService.emit("gh_item_update",{app_id:e},[t])})),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((t=>{const n={app_id:e};this.pipeService.emit("gh_item_update",n,[t]),n.item_id=t.item_id,this.pipeService.emit("gh_item_update",n,t);const i=r.items_list.find((e=>e.item_id==t.item_id));i&&t.fields.forEach((e=>{const t=i.fields.find((t=>t.field_id==e.field_id));n.field_id=e.field_id,t?t.field_value!=e.field_value&&(t.field_value=e.field_value,r.items_object[i.item_id][t.field_id]=t,this.pipeService.emit("gh_value_update",n,e.field_value)):(i.fields.push(e),r.items_object[i.item_id][e.field_id]=e,this.pipeService.emit("gh_value_update",n,e.field_value))}))})),t}handleItemsChange(e,t){let r=this.util.compareItems(e.items_list,t.items_list);this.updateItemsInStorage(e.app_id,r.diff_src_items),this.addItemsToStorage(e.app_id,r.new_src_items)}async deleteItemsFromStorage(e,t=[]){const r=await this.appProcessor.getApp(e);r&&(r.items_list=r.items_list.filter((e=>!t.find((t=>e.item_id==t.item_id))||(delete r.items_object[e.item_id],!1))),this.pipeService.emit("gh_items_update",{app_id:e},r.items_list),this.storage.updateApp(r))}async getItems(e,t=!1){const r=await this.appProcessor.getApp(e,t);return r?r.items_list:null}async addNewItems(e,r){const n=r.map((e=>({...e,fields:t(e.fields)}))),i=await this.addItemsApi(e,n);return await this.addItemsToStorage(e,i),this.pipeService.emit("gh_items_add",{app_id:e},i),i}async updateItems(e,r){const n=r.map((e=>({...e,fields:t(e.fields)}))),i=await this.updateItemsApi(e,n);return await this.updateItemsInStorage(e,i)}async deleteItems(e,t){return this.deleteItemsApi(t).then((async t=>await this.deleteItemsFromStorage(e,t)))}itemListeners(){this.pipeService.onRoot("gh_items_get",{},(async(e,t)=>{if(t&&t.app_id){const e=await this.getItems(t.app_id);e?this.pipeService.emit("gh_items_get",t,e):this.pipeService.emit("gh_items_get",t,[])}})),this.pipeService.onRoot("gh_items_add",{},(async(e,t)=>{if(t&&t.app_id&&t.items){const e=await this.addNewItems(t.app_id,t.items);e?this.pipeService.emit("gh_items_add",t,e):this.pipeService.emit("gh_items_add",t,[])}})),this.pipeService.onRoot("gh_items_update",{},(async(e,t)=>{if(t&&t.app_id&&t.items){const e=await this.updateItems(t.app_id,t.items);e?this.pipeService.emit("gh_items_update",t,e):this.pipeService.emit("gh_items_update",t,[])}})),this.pipeService.onRoot("gh_item_get",{},(async(e,t)=>{if(t&&t.app_id){const e=(await this.getItems(t.app_id)).find((e=>e.item_id==t.item_id));this.pipeService.emit("gh_item_get",t,e)}})),this.pipeService.onRoot("gh_filtered_items_get",{},(async(e,t)=>{if(t&&t.element_app_id){const e=await this.getItems(t.element_app_id),r=await this.util.getFilteredItems(e,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,r)}})),this.pipeService.onRoot("gh_filter_items",{},(async(e,t)=>{if(t&&t.items){const e=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,e)}}))}}class Fe{constructor(e,t,r,n,i){this.storage=e,this.req=t,this.appProcessor=r,this.itemProcessor=n,this.pipeService=i,this.fieldListeners()}deleteFieldApi(e){return this.req.post({url:"/api/app/delete-field",form:{field_id:e}})}async updatedFieldApi(e,t={}){const r=await this.appProcessor.getApp(e),n={app_id:e,app_name:r.app_name,group_id:r.group_id,icon:r.icon,field_list:r.field_list.map((e=>e.field_id==t.field_id?{...e,...t}:e)),views_list:r.views_list};return this.appProcessor.updateApp(n)}setFieldValueApi(e,t,r,n){const i=[{item_id:t,fields:[{field_id:r,field_value:n}]}];return this.itemProcessor.updateItems(e,i)}deleteFieldInStorage(e,t){const r=this.storage.getApp(e);return r.field_list=r.field_list.filter((e=>e.file_id!=t)),r.items_list=r.items_list.map((e=>(e.fields=e.fields.filter((e=>e.field_id!=t)),e))),this.storage.updateApp(r),!0}updateFieldInStorage(e,t){const r=this.storage.getApp(e);return r.field_list=r.field_list.map((e=>e.field_id==t.field_id?{...e,...t}:e)),this.storage.updateApp(r),t}updateFieldValue(e,t,r,n){const i=this.storage.getApp(e);return i.items_list.forEach((e=>{e.item_id==t&&e.fields.forEach((t=>{t.field_id==r&&(t.field_value=n,i.items_object[e.item_id][t.field_id]=t)}))})),this.storage.updateApp(i),n}async getField(e,t){const r=await this.appProcessor.getApp(e);if(!r)return null;for(let e=0;e<r.field_list.length;e++)if(r.field_list[e].field_id==t)return r.field_list[e];return null}async getFieldIdByNameSpace(e,t){const r=await this.appProcessor.getApp(e);if(!r)return null;for(let e=0;e<r.field_list.length;e++)if(r.field_list[e].name_space==t)return r.field_list[e].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 n=null;const i=await this.appProcessor.getApp(e);try{n=i.items_object[t][r].field_value}catch(e){}return n}async setFieldValue(e,t,r,n){if(e&&t&&r)return await this.setFieldValueApi(e,t,r,n),this.updateFieldValue(e,t,r,n)}fieldListeners(){this.pipeService.onRoot("gh_value_get",{},(async(e,t)=>{if(t.app_id&&t.item_id&&t.field_id){let e=await this.getFieldValue(t.app_id,t.item_id,t.field_id);this.pipeService.emit("gh_value_get",t,e)}})),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 e=await this.getField(t.app_id,t.field_id);this.pipeService.emit("gh_model_get",t,e)}catch(e){console.log("Field model: ",e)}})),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 Re{constructor(e,t,r,n){this.storage=e,this.pipeService=t,this.req=r,this.appProcessor=n}async uploadFileApi(e,t,r){try{const n={"file-0":e,app_id:t,item_id:r};return await this.req.post({url:"/file/formupload",form:n})}catch(e){return console.log(e),null}}async uploadFileFromStringApi(e){try{return await this.req.post({url:"/file/upload",form:{file:JSON.stringify(e)}})}catch(e){return console.log(e),null}}async updateFileFromStringApi(e,t,r,n,i){try{const a={file_name:r,extension:n,file_id:t,format:i,source:e};return await this.req.post({url:"/file/update",form:{file:JSON.stringify(a)}})}catch(e){return console.log(e),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);return{file:r,data:await this.req.get({url:r.url+"?timestamp="+r.last_update,externalResource:!0}),type:"file"}}return!1}async duplicateFile(e){let t=await this.duplicateFileApi(e);return t.forEach((e=>{this.addFileToStorage(e.app_id,e)})),t}async deleteFileApi(e){try{return await this.req.get({url:`/file/delete?file_id=${e}`})}catch(e){return console.log(e),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((t=>{this.pipeService.emit("gh_file_upload",{app_id:e,item_id:t.item_id,file_id:t.file_id},t)})))}deleteFileFromStorage(e,t){const r=this.storage.getApp(t);if(r){let t;r.file_list=r.file_list.filter((r=>r.file_id!=e||(t=r,!1))),this.storage.updateApp(r),this.pipeService.emit("gh_file_delete",{file_id:e},t)}}updateFileInStorage(e,t,r){const n=this.storage.getApp(t);n&&(n.file_list=n.file_list.map((t=>t.file_id==e?r:t)),this.storage.updateApp(n),this.pipeService.emit("gh_file_update",{file_id:e}))}async getFile(e,t){const r=await this.appProcessor.getApp(e);return new Promise(((e,n)=>{e(r.file_list.find((e=>e.file_id==t))||"")}))}async getFiles(e,t=[]){const r=await this.appProcessor.getApp(e);return new Promise(((e,n)=>{e(r.file_list.filter((e=>t.some((t=>t==e.file_id))))||"")}))}async uploadFile(e,t,r){const n=await this.uploadFileApi(e,t,r);return this.addFileToStorage(t,n),n}async uploadFileFromString(e){const t=await this.uploadFileFromStringApi(e);return this.addFileToStorage(t.app_id,t),t}async updateFileFromString(e,t,r,n,i){const a=await this.updateFileFromStringApi(e,t,r,n,i);return this.updateFileInStorage(t,a.app_id,a),a}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(Boolean(t)){let n=await this.getFile(e,t);return!!Boolean(n)&&r.test(n.url)}return!1}}class De{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 qe{constructor(e,t,r,n,i){this.storage=e,this.pipeService=t,this.req=r,this.util=n,this.dataService=i,this.chunkApi=new De(r),this.itemListeners()}async getChunk(e,t){try{return this.dataService.getChunk(e,t)}catch(e){return console.log(e),null}}async getLastChunk(e){try{return this.chunkApi.getLastChunk(e)}catch(e){return console.log(e),null}}async getChunks(e,t){let r=[];return t&&(r=await Promise.all(t.map((t=>this.getChunk(e,t))))),r}itemListeners(){}async getApp(e){if(!e)return null;let t=this.getAppFromStorage(e);if(!t){if(this.getAppPromises[e])return this.getAppPromises[e];if(this.getAppPromises[e]=this.getAppApi(e),t=await this.getAppPromises[e],!t)return null;this.saveAppInStorage(t),this.ws.addSubscription(e)}return t}}class Ue{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="string"==typeof e.data?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 Be{constructor(e){this.gudhub=e}async getInterpretationObj(e,t,r,n,i,a){var o=[],s=t.data_model.interpretation.find((function(e){return e.src==r}))||t.data_model.interpretation.find((function(e){return"table"==e.src}))||{id:"default"};if(e.data_model&&e.data_model.interpretation){for(var l=0;l<e.data_model.interpretation.length;l++)e.data_model.interpretation[l].src!=r&&e.data_model.interpretation[l].src!=n||o.push(e.data_model.interpretation[l]);for(l=0;l<o.length;l++)if(o[l].settings&&o[l].settings.condition_filter&&o[l].settings.filters_list.length>0){const e=await gudhub.getItem(a,i);if(e&&gudhub.filter([e],o[l].settings.filters_list).length>0){s=o[l];break}}else s=gudhub.mergeObjects(s,o[l])}return s}getInterpretation(e,t,r,n,i,a,o){const s=this;return new Promise((async(l,c)=>{var u=t&&t.data_type?t.data_type:r;u?gudhub.ghconstructor.getInstance(u).then((async function(r){if(r){var p=await s.getInterpretationObj(t,r.getTemplate().model,n,o,i,a);r.getInterpretation(e,p.id,u,t,i,a).then((function(e){l(gudhub.mergeObjects(e,p))}),(function(e){c()}))}}),(function(e){})):console.error("Get Interpretation: data_type is undefined",r,t)}))}async getInterpretationById(e,t,r,n,i=null,a=null){let o=null==i?await this.gudhub.getFieldValue(e,t,r):i,s=null==a?await this.gudhub.getField(e,r):a;if(null==s)return"";const l=await this.gudhub.ghconstructor.getInstance(s.data_type),c=await l.getInterpretation(o,n,s.data_type,s,t,e);return"<span>no interpretation</span>"==c.html?o:c.html}}function $e(e,t){switch(t.api){case"/items/update":console.log("/items/update - ",t),e.itemProcessor.updateItemsInStorage(t.app_id,t.response);break;case"/items/add":console.log("/items/add - ",t),e.itemProcessor.addItemsToStorage(t.app_id,t.response);break;case"/items/delete":console.log("/items/delete - ",t),e.itemProcessor.deleteItemsFromStorage(t.app_id,t.response);break;case"/app/update":console.log("/app/update - ",t),e.appProcessor.updateAppFieldsAndViews(t.response);break;case"/file/delete":console.log("file/delete - ",t),e.fileManager.deleteFileFromStorage(t.response.file_id,t.app_id);break;case"/file/upload":console.log("file/upload - ",t),e.fileManager.addFileToStorage(t.app_id,t.response);break;case"/file/formupload":console.log("file/formupload - ",t);break;case"/file/update":e.fileManager.updateFileInStorage(t.response.file_id,t.response.app_id,t.response),console.log("file/update - ",t);break;case"/new/file/duplicate":e.fileManager.addFilesToStorage(t.app_id,t.response),console.log("new/file/duplicate - ",t);break;case"/api/new/document/insert-one":e.documentManager.emitDocumentInsert(t.response),console.log("/api/new/document/insert-one - ",t);break;case"/ws/emit-to-user":console.log("/ws/emit-to-user - ",t);break;case"/ws/broadcast-to-app-subscribers":console.log("/ws/broadcast-to-app-subscribers - ",t);const r=JSON.parse(t.response);if(!r.data_type)return;e.ghconstructor.getInstance(r.data_type).then((e=>{e.onMessage(t.app_id,t.user_id,r)}));break;default:console.warn("WEBSOCKETS is not process this API:",t.api)}}class Ge{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(e){return console.log(e),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(e){return console.log(e),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(e){return console.log(e),null}}async addUserToGroupApi(e,t,r){try{const n={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:n})}catch(e){return console.log(e),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(e){return console.log(e),null}}async updateUserInGroupApi(e,t,r){try{const n={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:n})}catch(e){return console.log(e),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(e){return console.log(e),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(e){return console.log(e),null}}}class We{constructor(e,t){this.req=t,this.gudhub=e}async addAppToGroupApi(e,t,r){try{const n={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:n})}catch(e){return console.log(e),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(e){return console.log(e),null}}async updateAppInGroupApi(e,t,r){try{const n={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:n})}catch(e){return console.log(e),null}}async deleteAppFromGroupApi(e,t,r){try{const n={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:n})}catch(e){return console.log(e),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(e){return console.log(e),null}}}class He{constructor(e,t,r){this.req=t,this.gudhub=e,this.pipeService=r,this.groupManager=new Ge(e,t),this.appGroupSharing=new We(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 n=await this.groupManager.addUserToGroupApi(e,t,r);return this.pipeService.emit("group_members_add",{app_id:"group_sharing"},n),n}getUsersByGroup(e){return this.groupManager.getUsersByGroupApi(e)}async updateUserInGroup(e,t,r){let n=await this.groupManager.updateUserInGroupApi(e,t,r);return this.pipeService.emit("group_members_update",{app_id:"group_sharing"},n),n}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 Ve{constructor(e,t){this.req=t,this.gudhub=e}async add(e,t,r){try{const n={token:await this.gudhub.auth.getToken(),app_id:e,user_id:t,sharing_permission:r};return await this.req.post({url:"/sharing/add",form:n})}catch(e){return console.log(e),null}}async update(e,t,r){try{const n={token:await this.gudhub.auth.getToken(),app_id:e,user_id:t,sharing_permission:r};return await this.req.post({url:"/sharing/update",form:n})}catch(e){return console.log(e),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(e){return console.log(e),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(e){return console.log(e),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(e){return console.log(e),null}}}class ze{constructor(e){this.gudhub=e}async emitToUser(e,t){const r={user_id:e,data:"object"==typeof t?JSON.stringify(t):t};return await this.gudhub.req.post({url:"/ws/emit-to-user",form:r})}async broadcastToAppSubscribers(e,t,r){const n={app_id:e,data:JSON.stringify({data_type:t,data:r})};return await this.gudhub.req.post({url:"/ws/broadcast-to-app-subscribers",form:n})}}class Je{}class Xe extends Je{}class Qe{constructor(e){this.req=e}async getApp(e){return this.req.get({url:"/api/app/get",params:{app_id:e}})}}let Ye=(e,...t)=>{for(let r of t)if(r)for(let t of Object.keys(r)){const n=Object.getOwnPropertyDescriptor(r,t);n.enumerable&&Object.defineProperty(e,t,n)}};class Ke{}class Ze extends Xe{constructor(e,t,r){super(),this.appApi=new Qe(e);let n=new Ke(t);Ye(this,n)}async getApp(e){return this.appApi.getApp(e)}async putApp(e,t){}static[Symbol.hasInstance](e){try{return e instanceof Ze||e instanceof Ke}catch(e){return!1}}}class et{constructor(e){this.store=e.store,this.dbName=e.dbName,this.dbVersion=e.dbVersion,this.requestCache=new Map}}class tt extends Xe{constructor(e,t,r){super(e,t),this.dataService=new Ze(e);let n=new et(t);this.gudhub=r,Ye(this,n)}static[Symbol.hasInstance](e){try{return e instanceof tt||e instanceof et}catch(e){return!1}}async getApp(e){if(this.requestCache.has(e))return this.requestCache.get(e);let t=this,r=this.dataService.getApp(e),n=new Promise((async(n,i)=>{try{const a=(await t.openDatabase()).transaction(t.store,"readonly").objectStore(t.store).get(e);a.onsuccess=a=>{let o=a.target.result;o||(r.then(n,i),r.then((r=>t.putApp(e,r)))),o&&(n(o),r.then((r=>{t.gudhub.processAppUpd(r,o),t.putApp(e,r)})))},a.onerror=()=>{r.then(n,i),r.then((r=>t.putApp(e,r)))}}catch(a){r.then(n,i),r.then((r=>t.putApp(e,r)))}}));return t.requestCache.set(e,n),n}async putApp(e,t){try{(await this.openDatabase()).transaction(this.store,"readwrite").objectStore(this.store).put(t,e)}catch(e){}}async openDatabase(){return new Promise(((e,t)=>{const r=indexedDB.open(this.dbName,this.dbVersion);r.onsuccess=t=>{e(t.target.result)},r.onerror=e=>{t(e.target.error)}}))}}class rt extends Je{}class nt extends rt{constructor(e,t){super(),this.chunkApi=new De(e);let r=new Ke(t);Ye(this,r)}async getChunk(e,t){return this.chunkApi.getChunk(e,t)}putChunk(){}static[Symbol.hasInstance](e){try{return e instanceof nt||e instanceof Ke}catch(e){return!1}}}class it extends rt{constructor(e,t){super(e,t),this.dataService=new nt(e);let r=new et(t);Ye(this,r)}static[Symbol.hasInstance](e){try{return e instanceof it||e instanceof et}catch(e){return!1}}async putChunk(e,t){try{(await this.openDatabase()).transaction(this.store,"readwrite").objectStore(this.store).put(t,e)}catch(e){}}async getChunk(e,t){if(this.requestCache.has(t))return this.requestCache.get(t);try{let e=this,r=new Promise((async(r,n)=>{try{const i=(await e.openDatabase()).transaction(e.store,"readonly").objectStore(e.store).get(t);i.onsuccess=e=>{let t=e.target.result;t||n(),t&&r(t)},i.onerror=n}catch(e){n()}}));return e.requestCache.set(t,r),await r,r}catch(r){let n=this.dataService.getChunk(e,t);this.requestCache.set(t,n);let i=await n;return this.putChunk(t,i),n}}async openDatabase(){return new Promise(((e,t)=>{const r=indexedDB.open(this.dbName,this.dbVersion);r.onsuccess=t=>{e(t.target.result)},r.onerror=e=>{t(e.target.error)}}))}}const at="gudhub",ot={dbName:at,dbVersion:7,store:"apps"},st={dbName:at,dbVersion:7,store:"chunks"};let lt,ct,ut,pt;Ce.P&&(indexedDB.open(at,7).onupgradeneeded=e=>{const t=e.target.result;for(let e of[ot.store,st.store])t.objectStoreNames.contains(e)||t.createObjectStore(e)}),Ce.P?(ct=it,pt=st):ct=nt,Ce.P?(lt=tt,ut=ot):lt=Ze;class dt{constructor(e,t={server_url:"https://gudhub.com/GudHub_Test",wss_url:"wss://gudhub.com/GudHub/ws/app/",node_server_url:"https://gudhub.com/api/services/prod",initWebsocket:!1,activateSW:!1,swLink:"",async_modules_path:"build/latest/async_modules_node/",file_server_url:"https://gudhub.com",automation_modules_path:"build/latest/automation_modules/",accesstoken:this.accesstoken,expirydate:this.expirydate}){if(this.config=t,this.ghconstructor=new Ne(this),this.interpritate=new Be(this),this.pipeService=new a,this.storage=new o(t.async_modules_path,t.file_server_url,t.automation_modules_path),this.util=new Oe(this),this.req=new n(t.server_url),this.auth=new Pe(this.req,this.storage),this.sharing=new Ve(this,this.req),this.groupSharing=new He(this,this.req,this.pipeService),e?this.storage.setUser({auth_key:e}):t.accesstoken&&t.expirydate&&this.storage.setUser({accesstoken:t.accesstoken,expirydate:t.expirydate}),this.req.init(this.auth.getToken.bind(this.auth)),this.ws=new l(t.wss_url,this.auth),this.chunksManager=new qe(this.storage,this.pipeService,this.req,this.util,new ct(this.req,pt)),this.appProcessor=new Le(this.storage,this.pipeService,this.req,this.ws,this.chunksManager,this.util,t.activateSW,new lt(this.req,ut,this)),this.itemProcessor=new Me(this.storage,this.pipeService,this.req,this.appProcessor,this.util),this.fieldProcessor=new Fe(this.storage,this.req,this.appProcessor,this.itemProcessor,this.pipeService),this.fileManager=new Re(this.storage,this.pipeService,this.req,this.appProcessor),this.documentManager=new Ue(this.req,this.pipeService),this.websocketsemitter=new ze(this),t.initWebsocket){const e=this;this.ws.initWebSocket($e.bind(this,e),this.appProcessor.refreshApps.bind(this.appProcessor))}t.activateSW&&this.activateSW(t.swLink)}async activateSW(e){if(Ce.P&&"serviceWorker"in window.navigator)try{const t=await window.navigator.serviceWorker.register(e);t.update().then((()=>console.log("%cSW ->>> Service worker successful updated","display: inline-block ; background-color: #689f38 ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;"))).catch((()=>console.warn("SW ->>> Service worker is not updated"))),console.log("%cSW ->>> Service worker is registered","display: inline-block ; background-color: #689f38 ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;",t)}catch(e){console.warn("%cSW ->>> Service worker is not registered","display: inline-block ; background-color: #d32f2f ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;",e)}else console.log("%cSW ->>> ServiceWorkers not supported","display: inline-block ; background-color: #d32f2f ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;")}on(e,t,r){return this.pipeService.on(e,t,r),this}emit(e,t,r,n){return this.pipeService.emit(e,t,r,n),this}destroy(e,t,r){return this.pipeService.destroy(e,t,r),this}prefilter(e,t){return this.util.prefilter(e,t)}debounce(e,t){return this.util.debounce(e,t)}emitToUser(e,t){return this.websocketsemitter.emitToUser(e,t)}broadcastToAppSubscribers(e,t,r){return this.websocketsemitter.broadcastToAppSubscribers(e,t,r)}getInterpretation(e,t,r,n,i,a,o){return this.interpritate.getInterpretation(e,t,r,n,i,a,o)}getInterpretationById(e,t,r,n,i,a){return this.interpritate.getInterpretationById(e,t,r,n,i,a)}filter(e,t){return this.util.filter(e,t)}mergeFilters(e,t){return this.util.mergeFilters(e,t)}group(e,t){return this.util.group(e,t)}getFilteredItems(e,t,r={}){return this.util.getFilteredItems(e,t,r.element_app_id,r.app_id,r.item_id,r.field_group,r.search,r.search_params)}sortItems(e,t){return this.util.sortItems(e,t)}processAppUpd(e,t){this.itemProcessor.handleItemsChange(e,t),this.appProcessor.handleAppChange(e,t)}jsonToItems(e,t){return this.util.jsonToItems(e,t)}getDate(e){return this.util.getDate(e)}populateWithDate(e,t){return this.util.populateWithDate(e,t)}checkRecurringDate(e,t){return this.util.checkRecurringDate(e,t)}populateItems(e,t,r){return this.util.populateItems(e,t,r)}populateWithItemRef(e,t,r,n,i,a){return this.util.populateWithItemRef(e,t,r,n,i,a)}compareItems(e,t,r){return this.util.compareItems(e,t,r)}mergeItems(e,t,r){return this.util.mergeItems(e,t,r)}mergeObjects(e,t){return this.util.mergeObjects(e,t)}makeNestedList(e,t,r,n,i){return this.util.makeNestedList(e,t,r,n,i)}jsonConstructor(e,t,r,n){return this.util.jsonConstructor(e,t,r,n)}getAppsList(){return this.appProcessor.getAppsList()}getAppInfo(e){return this.appProcessor.getAppInfo(e)}deleteApp(e){return this.appProcessor.deleteApp(e)}getApp(e){return this.appProcessor.getApp(e)}updateApp(e){return this.appProcessor.updateApp(e)}updateAppInfo(e){return this.appProcessor.updateAppInfo(e)}createNewApp(e){return this.appProcessor.createNewApp(e)}getItems(e){return this.itemProcessor.getItems(e)}async getItem(e,t){const r=await this.getItems(e);if(r)return r.find((e=>e.item_id==t))}addNewItems(e,t){return this.itemProcessor.addNewItems(e,t)}updateItems(e,t){return this.itemProcessor.updateItems(e,t)}deleteItems(e,t){return this.itemProcessor.deleteItems(e,t)}getField(e,t){return this.fieldProcessor.getField(e,t)}getFieldIdByNameSpace(e,t){return this.fieldProcessor.getFieldIdByNameSpace(e,t)}getFieldModels(e){return this.fieldProcessor.getFieldModels(e)}updateField(e,t){return this.fieldProcessor.updateField(e,t)}deleteField(e,t){return this.fieldProcessor.deleteField(e,t)}getFieldValue(e,t,r){return this.fieldProcessor.getFieldValue(e,t,r)}setFieldValue(e,t,r,n){return this.fieldProcessor.setFieldValue(e,t,r,n)}getFile(e,t){return this.fileManager.getFile(e,t)}getFiles(e,t){return this.fileManager.getFiles(e,t)}uploadFile(e,t,r){return this.fileManager.uploadFile(e,t,r)}uploadFileFromString(e,t,r,n,i,a,o){return this.fileManager.uploadFileFromString(e,t,r,n,i,a,o)}updateFileFromString(e,t,r,n,i){return this.fileManager.updateFileFromString(e,t,r,n,i)}deleteFile(e,t){return this.fileManager.deleteFile(e,t)}duplicateFile(e){return this.fileManager.duplicateFile(e)}downloadFileFromString(e,t){return this.fileManager.downloadFileFromString(e,t)}createDocument(e){return this.documentManager.createDocument(e)}getDocument(e){return this.documentManager.getDocument(e)}getDocuments(e){return this.documentManager.getDocuments(e)}deleteDocument(e){return this.documentManager.deleteDocument(e)}login(e){return this.auth.login(e)}loginWithToken(e){return this.auth.loginWithToken(e)}logout(e){return this.appProcessor.clearAppProcessor(),this.auth.logout(e)}signup(e){return this.auth.signup(e)}getUsersList(e){return this.auth.getUsersList(e)}updateToken(e){return this.auth.updateToken(e)}avatarUploadApi(e){return this.auth.avatarUploadApi(e)}getVersion(){return this.auth.getVersion()}getUserById(e){return this.auth.getUserById(e)}getToken(){return this.auth.getToken()}updateUser(e){return this.auth.updateUser(e)}updateAvatar(e){return this.auth.updateAvatar(e)}}const ht=dt})(),__webpack_exports__})()));
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.GudHubLibrary=t():e.GudHubLibrary=t()}(this,(()=>(()=>{var __webpack_modules__={9669:(e,t,r)=>{e.exports=r(1609)},5448:(e,t,r)=>{"use strict";var n=r(4867),i=r(6026),a=r(4372),o=r(5327),s=r(4097),l=r(4109),c=r(7985),u=r(5061);e.exports=function(e){return new Promise((function(t,r){var p=e.data,d=e.headers,h=e.responseType;n.isFormData(p)&&delete d["Content-Type"];var f=new XMLHttpRequest;if(e.auth){var m=e.auth.username||"",g=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";d.Authorization="Basic "+btoa(m+":"+g)}var y=s(e.baseURL,e.url);function _(){if(f){var n="getAllResponseHeaders"in f?l(f.getAllResponseHeaders()):null,a={data:h&&"text"!==h&&"json"!==h?f.response:f.responseText,status:f.status,statusText:f.statusText,headers:n,config:e,request:f};i(t,r,a),f=null}}if(f.open(e.method.toUpperCase(),o(y,e.params,e.paramsSerializer),!0),f.timeout=e.timeout,"onloadend"in f?f.onloadend=_:f.onreadystatechange=function(){f&&4===f.readyState&&(0!==f.status||f.responseURL&&0===f.responseURL.indexOf("file:"))&&setTimeout(_)},f.onabort=function(){f&&(r(u("Request aborted",e,"ECONNABORTED",f)),f=null)},f.onerror=function(){r(u("Network Error",e,null,f)),f=null},f.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(u(t,e,e.transitional&&e.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",f)),f=null},n.isStandardBrowserEnv()){var b=(e.withCredentials||c(y))&&e.xsrfCookieName?a.read(e.xsrfCookieName):void 0;b&&(d[e.xsrfHeaderName]=b)}"setRequestHeader"in f&&n.forEach(d,(function(e,t){void 0===p&&"content-type"===t.toLowerCase()?delete d[t]:f.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(f.withCredentials=!!e.withCredentials),h&&"json"!==h&&(f.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&f.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&f.upload&&f.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){f&&(f.abort(),r(e),f=null)})),p||(p=null),f.send(p)}))}},1609:(e,t,r)=>{"use strict";var n=r(4867),i=r(1849),a=r(321),o=r(7185);function s(e){var t=new a(e),r=i(a.prototype.request,t);return n.extend(r,a.prototype,t),n.extend(r,t),r}var l=s(r(5655));l.Axios=a,l.create=function(e){return s(o(l.defaults,e))},l.Cancel=r(5263),l.CancelToken=r(4972),l.isCancel=r(6502),l.all=function(e){return Promise.all(e)},l.spread=r(8713),l.isAxiosError=r(6268),e.exports=l,e.exports.default=l},5263:e=>{"use strict";function t(e){this.message=e}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t},4972:(e,t,r)=>{"use strict";var n=r(5263);function i(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.source=function(){var e;return{token:new i((function(t){e=t})),cancel:e}},e.exports=i},6502:e=>{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},321:(e,t,r)=>{"use strict";var n=r(4867),i=r(5327),a=r(782),o=r(3572),s=r(7185),l=r(4875),c=l.validators;function u(e){this.defaults=e,this.interceptors={request:new a,response:new a}}u.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=s(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=e.transitional;void 0!==t&&l.assertOptions(t,{silentJSONParsing:c.transitional(c.boolean,"1.0.0"),forcedJSONParsing:c.transitional(c.boolean,"1.0.0"),clarifyTimeoutError:c.transitional(c.boolean,"1.0.0")},!1);var r=[],n=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(n=n&&t.synchronous,r.unshift(t.fulfilled,t.rejected))}));var i,a=[];if(this.interceptors.response.forEach((function(e){a.push(e.fulfilled,e.rejected)})),!n){var u=[o,void 0];for(Array.prototype.unshift.apply(u,r),u=u.concat(a),i=Promise.resolve(e);u.length;)i=i.then(u.shift(),u.shift());return i}for(var p=e;r.length;){var d=r.shift(),h=r.shift();try{p=d(p)}catch(e){h(e);break}}try{i=o(p)}catch(e){return Promise.reject(e)}for(;a.length;)i=i.then(a.shift(),a.shift());return i},u.prototype.getUri=function(e){return e=s(this.defaults,e),i(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function(e){u.prototype[e]=function(t,r){return this.request(s(r||{},{method:e,url:t,data:(r||{}).data}))}})),n.forEach(["post","put","patch"],(function(e){u.prototype[e]=function(t,r,n){return this.request(s(n||{},{method:e,url:t,data:r}))}})),e.exports=u},782:(e,t,r)=>{"use strict";var n=r(4867);function i(){this.handlers=[]}i.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},i.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},i.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=i},4097:(e,t,r)=>{"use strict";var n=r(1793),i=r(7303);e.exports=function(e,t){return e&&!n(t)?i(e,t):t}},5061:(e,t,r)=>{"use strict";var n=r(481);e.exports=function(e,t,r,i,a){var o=new Error(e);return n(o,t,r,i,a)}},3572:(e,t,r)=>{"use strict";var n=r(4867),i=r(8527),a=r(6502),o=r(5655);function s(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return s(e),e.headers=e.headers||{},e.data=i.call(e,e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||o.adapter)(e).then((function(t){return s(e),t.data=i.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return a(t)||(s(e),t&&t.response&&(t.response.data=i.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},481:e=>{"use strict";e.exports=function(e,t,r,n,i){return e.config=t,r&&(e.code=r),e.request=n,e.response=i,e.isAxiosError=!0,e.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}},e}},7185:(e,t,r)=>{"use strict";var n=r(4867);e.exports=function(e,t){t=t||{};var r={},i=["url","method","data"],a=["headers","auth","proxy","params"],o=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],s=["validateStatus"];function l(e,t){return n.isPlainObject(e)&&n.isPlainObject(t)?n.merge(e,t):n.isPlainObject(t)?n.merge({},t):n.isArray(t)?t.slice():t}function c(i){n.isUndefined(t[i])?n.isUndefined(e[i])||(r[i]=l(void 0,e[i])):r[i]=l(e[i],t[i])}n.forEach(i,(function(e){n.isUndefined(t[e])||(r[e]=l(void 0,t[e]))})),n.forEach(a,c),n.forEach(o,(function(i){n.isUndefined(t[i])?n.isUndefined(e[i])||(r[i]=l(void 0,e[i])):r[i]=l(void 0,t[i])})),n.forEach(s,(function(n){n in t?r[n]=l(e[n],t[n]):n in e&&(r[n]=l(void 0,e[n]))}));var u=i.concat(a).concat(o).concat(s),p=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===u.indexOf(e)}));return n.forEach(p,c),r}},6026:(e,t,r)=>{"use strict";var n=r(5061);e.exports=function(e,t,r){var i=r.config.validateStatus;r.status&&i&&!i(r.status)?t(n("Request failed with status code "+r.status,r.config,null,r.request,r)):e(r)}},8527:(e,t,r)=>{"use strict";var n=r(4867),i=r(5655);e.exports=function(e,t,r){var a=this||i;return n.forEach(r,(function(r){e=r.call(a,e,t)})),e}},5655:(e,t,r)=>{"use strict";var n=r(4867),i=r(6016),a=r(481),o={"Content-Type":"application/x-www-form-urlencoded"};function s(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var l,c={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(l=r(5448)),l),transformRequest:[function(e,t){return i(t,"Accept"),i(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e)?e:n.isArrayBufferView(e)?e.buffer:n.isURLSearchParams(e)?(s(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):n.isObject(e)||t&&"application/json"===t["Content-Type"]?(s(t,"application/json"),function(e,t,r){if(n.isString(e))try{return(0,JSON.parse)(e),n.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional,r=t&&t.silentJSONParsing,i=t&&t.forcedJSONParsing,o=!r&&"json"===this.responseType;if(o||i&&n.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(o){if("SyntaxError"===e.name)throw a(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){c.headers[e]=n.merge(o)})),e.exports=c},1849:e=>{"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}}},5327:(e,t,r)=>{"use strict";var n=r(4867);function i(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,r){if(!t)return e;var a;if(r)a=r(t);else if(n.isURLSearchParams(t))a=t.toString();else{var o=[];n.forEach(t,(function(e,t){null!=e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,(function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),o.push(i(t)+"="+i(e))})))})),a=o.join("&")}if(a){var s=e.indexOf("#");-1!==s&&(e=e.slice(0,s)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}},7303:e=>{"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},4372:(e,t,r)=>{"use strict";var n=r(4867);e.exports=n.isStandardBrowserEnv()?{write:function(e,t,r,i,a,o){var s=[];s.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),n.isString(i)&&s.push("path="+i),n.isString(a)&&s.push("domain="+a),!0===o&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},1793:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},6268:e=>{"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},7985:(e,t,r)=>{"use strict";var n=r(4867);e.exports=n.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function i(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=i(window.location.href),function(t){var r=n.isString(t)?i(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0}},6016:(e,t,r)=>{"use strict";var n=r(4867);e.exports=function(e,t){n.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},4109:(e,t,r)=>{"use strict";var n=r(4867),i=["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"];e.exports=function(e){var t,r,a,o={};return e?(n.forEach(e.split("\n"),(function(e){if(a=e.indexOf(":"),t=n.trim(e.substr(0,a)).toLowerCase(),r=n.trim(e.substr(a+1)),t){if(o[t]&&i.indexOf(t)>=0)return;o[t]="set-cookie"===t?(o[t]?o[t]:[]).concat([r]):o[t]?o[t]+", "+r:r}})),o):o}},8713:e=>{"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},4875:(e,t,r)=>{"use strict";var n=r(8593),i={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){i[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var a={},o=n.version.split(".");function s(e,t){for(var r=t?t.split("."):o,n=e.split("."),i=0;i<3;i++){if(r[i]>n[i])return!0;if(r[i]<n[i])return!1}return!1}i.transitional=function(e,t,r){var i=t&&s(t);function o(e,t){return"[Axios v"+n.version+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,n,s){if(!1===e)throw new Error(o(n," has been removed in "+t));return i&&!a[n]&&(a[n]=!0,console.warn(o(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,n,s)}},e.exports={isOlderVersion:s,assertOptions:function(e,t,r){if("object"!=typeof e)throw new TypeError("options must be an object");for(var n=Object.keys(e),i=n.length;i-- >0;){var a=n[i],o=t[a];if(o){var s=e[a],l=void 0===s||o(s,a,e);if(!0!==l)throw new TypeError("option "+a+" must be "+l)}else if(!0!==r)throw Error("Unknown option "+a)}},validators:i}},4867:(e,t,r)=>{"use strict";var n=r(1849),i=Object.prototype.toString;function a(e){return"[object Array]"===i.call(e)}function o(e){return void 0===e}function s(e){return null!==e&&"object"==typeof e}function l(e){if("[object Object]"!==i.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function c(e){return"[object Function]"===i.call(e)}function u(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),a(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}e.exports={isArray:a,isArrayBuffer:function(e){return"[object ArrayBuffer]"===i.call(e)},isBuffer:function(e){return null!==e&&!o(e)&&null!==e.constructor&&!o(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:s,isPlainObject:l,isUndefined:o,isDate:function(e){return"[object Date]"===i.call(e)},isFile:function(e){return"[object File]"===i.call(e)},isBlob:function(e){return"[object Blob]"===i.call(e)},isFunction:c,isStream:function(e){return s(e)&&c(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:u,merge:function e(){var t={};function r(r,n){l(t[n])&&l(r)?t[n]=e(t[n],r):l(r)?t[n]=e({},r):a(r)?t[n]=r.slice():t[n]=r}for(var n=0,i=arguments.length;n<i;n++)u(arguments[n],r);return t},extend:function(e,t,r){return u(t,(function(t,i){e[i]=r&&"function"==typeof t?n(t,r):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},1924:(e,t,r)=>{"use strict";var n=r(210),i=r(5559),a=i(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&a(e,".prototype.")>-1?i(r):r}},5559:(e,t,r)=>{"use strict";var n=r(8612),i=r(210),a=r(7771),o=r(4453),s=i("%Function.prototype.apply%"),l=i("%Function.prototype.call%"),c=i("%Reflect.apply%",!0)||n.call(l,s),u=r(4429),p=i("%Math.max%");e.exports=function(e){if("function"!=typeof e)throw new o("a function is required");var t=c(n,l,arguments);return a(t,1+p(0,e.length-(arguments.length-1)),!0)};var d=function(){return c(n,s,arguments)};u?u(e.exports,"apply",{value:d}):e.exports.apply=d},8729:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDefaultOptions=function(){return r},t.setDefaultOptions=function(e){r=e};var r={}},8734:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")},e.exports=t.default},2084:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)},e.exports=t.default},5430:(e,t,r)=>{"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if((0,l.default)(2,arguments),!t||"object"!==(0,i.default)(t))return new Date(NaN);var r=t.years?(0,c.default)(t.years):0,n=t.months?(0,c.default)(t.months):0,u=t.weeks?(0,c.default)(t.weeks):0,p=t.days?(0,c.default)(t.days):0,d=t.hours?(0,c.default)(t.hours):0,h=t.minutes?(0,c.default)(t.minutes):0,f=t.seconds?(0,c.default)(t.seconds):0,m=(0,s.default)(e),g=n||r?(0,o.default)(m,n+12*r):m,y=p||u?(0,a.default)(g,p+7*u):g,_=1e3*(f+60*(h+60*d));return new Date(y.getTime()+_)};var i=n(r(8698)),a=n(r(7262)),o=n(r(6581)),s=n(r(1171)),l=n(r(8734)),c=n(r(2084));e.exports=t.default},7262:(e,t,r)=>{"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,o.default)(2,arguments);var r=(0,a.default)(e),n=(0,i.default)(t);return isNaN(n)?new Date(NaN):n?(r.setDate(r.getDate()+n),r):r};var i=n(r(2084)),a=n(r(1171)),o=n(r(8734));e.exports=t.default},6581:(e,t,r)=>{"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,o.default)(2,arguments);var r=(0,a.default)(e),n=(0,i.default)(t);if(isNaN(n))return new Date(NaN);if(!n)return r;var s=r.getDate(),l=new Date(r.getTime());return l.setMonth(r.getMonth()+n+1,0),s>=l.getDate()?l:(r.setFullYear(l.getFullYear(),l.getMonth(),s),r)};var i=n(r(2084)),a=n(r(1171)),o=n(r(8734));e.exports=t.default},5276:(e,t,r)=>{"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){(0,a.default)(2,arguments);var n=(0,i.default)(e,r),o=(0,i.default)(t,r);return n.getTime()===o.getTime()};var i=n(r(2466)),a=n(r(8734));e.exports=t.default},8933:(e,t,r)=>{"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){var n,c,u,p,d,h,f,m;(0,s.default)(2,arguments);var g=(0,l.getDefaultOptions)(),y=(0,o.default)(null!==(n=null!==(c=null!==(u=null!==(p=null==r?void 0:r.weekStartsOn)&&void 0!==p?p:null==r||null===(d=r.locale)||void 0===d||null===(h=d.options)||void 0===h?void 0:h.weekStartsOn)&&void 0!==u?u:g.weekStartsOn)&&void 0!==c?c:null===(f=g.locale)||void 0===f||null===(m=f.options)||void 0===m?void 0:m.weekStartsOn)&&void 0!==n?n:0);if(!(y>=0&&y<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var _=(0,a.default)(e),b=(0,o.default)(t),v=_.getDay(),w=7-y,S=b<0||b>6?b-(v+w)%7:((b%7+7)%7+w)%7-(v+w)%7;return(0,i.default)(_,S)};var i=n(r(7262)),a=n(r(1171)),o=n(r(2084)),s=n(r(8734)),l=r(8729);e.exports=t.default},2466:(e,t,r)=>{"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r,n,l,c,u,p,d,h;(0,o.default)(1,arguments);var f=(0,s.getDefaultOptions)(),m=(0,a.default)(null!==(r=null!==(n=null!==(l=null!==(c=null==t?void 0:t.weekStartsOn)&&void 0!==c?c:null==t||null===(u=t.locale)||void 0===u||null===(p=u.options)||void 0===p?void 0:p.weekStartsOn)&&void 0!==l?l:f.weekStartsOn)&&void 0!==n?n:null===(d=f.locale)||void 0===d||null===(h=d.options)||void 0===h?void 0:h.weekStartsOn)&&void 0!==r?r:0);if(!(m>=0&&m<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var g=(0,i.default)(e),y=g.getDay(),_=(y<m?7:0)+y-m;return g.setDate(g.getDate()-_),g.setHours(0,0,0,0),g};var i=n(r(1171)),a=n(r(2084)),o=n(r(8734)),s=r(8729);e.exports=t.default},1171:(e,t,r)=>{"use strict";var n=r(4836).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){(0,a.default)(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===(0,i.default)(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(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((new Error).stack)),new Date(NaN))};var i=n(r(8698)),a=n(r(8734));e.exports=t.default},2296:(e,t,r)=>{"use strict";var n=r(4429),i=r(3464),a=r(4453),o=r(7296);e.exports=function(e,t,r){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new a("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new a("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new a("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new a("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new a("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new a("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,u=arguments.length>6&&arguments[6],p=!!o&&o(e,t);if(n)n(e,t,{configurable:null===c&&p?p.configurable:!c,enumerable:null===s&&p?p.enumerable:!s,value:r,writable:null===l&&p?p.writable:!l});else{if(!u&&(s||l||c))throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=r}}},4429:(e,t,r)=>{"use strict";var n=r(210)("%Object.defineProperty%",!0)||!1;if(n)try{n({},"a",{value:1})}catch(e){n=!1}e.exports=n},3981:e=>{"use strict";e.exports=EvalError},1648:e=>{"use strict";e.exports=Error},4726:e=>{"use strict";e.exports=RangeError},6712:e=>{"use strict";e.exports=ReferenceError},3464:e=>{"use strict";e.exports=SyntaxError},4453:e=>{"use strict";e.exports=TypeError},3915:e=>{"use strict";e.exports=URIError},7648:e=>{"use strict";var t=Object.prototype.toString,r=Math.max,n=function(e,t){for(var r=[],n=0;n<e.length;n+=1)r[n]=e[n];for(var i=0;i<t.length;i+=1)r[i+e.length]=t[i];return r};e.exports=function(e){var i=this;if("function"!=typeof i||"[object Function]"!==t.apply(i))throw new TypeError("Function.prototype.bind called on incompatible "+i);for(var a,o=function(e,t){for(var r=[],n=1,i=0;n<e.length;n+=1,i+=1)r[i]=e[n];return r}(arguments),s=r(0,i.length-o.length),l=[],c=0;c<s;c++)l[c]="$"+c;if(a=Function("binder","return function ("+function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=",");return r}(l)+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof a){var t=i.apply(this,n(o,arguments));return Object(t)===t?t:this}return i.apply(e,n(o,arguments))})),i.prototype){var u=function(){};u.prototype=i.prototype,a.prototype=new u,u.prototype=null}return a}},8612:(e,t,r)=>{"use strict";var n=r(7648);e.exports=Function.prototype.bind||n},210:(e,t,r)=>{"use strict";var n,i=r(1648),a=r(3981),o=r(4726),s=r(6712),l=r(3464),c=r(4453),u=r(3915),p=Function,d=function(e){try{return p('"use strict"; return ('+e+").constructor;")()}catch(e){}},h=Object.getOwnPropertyDescriptor;if(h)try{h({},"")}catch(e){h=null}var f=function(){throw new c},m=h?function(){try{return f}catch(e){try{return h(arguments,"callee").get}catch(e){return f}}}():f,g=r(1405)(),y=r(8185)(),_=Object.getPrototypeOf||(y?function(e){return e.__proto__}:null),b={},v="undefined"!=typeof Uint8Array&&_?_(Uint8Array):n,w={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":g&&_?_([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":b,"%AsyncGenerator%":b,"%AsyncGeneratorFunction%":b,"%AsyncIteratorPrototype%":b,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":a,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":p,"%GeneratorFunction%":b,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":g&&_?_(_([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&g&&_?_((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":o,"%ReferenceError%":s,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&g&&_?_((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g&&_?_(""[Symbol.iterator]()):n,"%Symbol%":g?Symbol:n,"%SyntaxError%":l,"%ThrowTypeError%":m,"%TypedArray%":v,"%TypeError%":c,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":u,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};if(_)try{null.error}catch(e){var S=_(_(e));w["%Error.prototype%"]=S}var E=function e(t){var r;if("%AsyncFunction%"===t)r=d("async function () {}");else if("%GeneratorFunction%"===t)r=d("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=d("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&_&&(r=_(i.prototype))}return w[t]=r,r},x={__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"]},k=r(8612),A=r(8824),I=k.call(Function.call,Array.prototype.concat),j=k.call(Function.apply,Array.prototype.splice),O=k.call(Function.call,String.prototype.replace),P=k.call(Function.call,String.prototype.slice),T=k.call(Function.call,RegExp.prototype.exec),C=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,N=/\\(\\)?/g,L=function(e,t){var r,n=e;if(A(x,n)&&(n="%"+(r=x[n])[0]+"%"),A(w,n)){var i=w[n];if(i===b&&(i=E(n)),void 0===i&&!t)throw new c("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new l("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new c('"allowMissing" argument must be a boolean');if(null===T(/^%?[^%]*%?$/,e))throw new l("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=P(e,0,1),r=P(e,-1);if("%"===t&&"%"!==r)throw new l("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new l("invalid intrinsic syntax, expected opening `%`");var n=[];return O(e,C,(function(e,t,r,i){n[n.length]=r?O(i,N,"$1"):t||e})),n}(e),n=r.length>0?r[0]:"",i=L("%"+n+"%",t),a=i.name,o=i.value,s=!1,u=i.alias;u&&(n=u[0],j(r,I([0,1],u)));for(var p=1,d=!0;p<r.length;p+=1){var f=r[p],m=P(f,0,1),g=P(f,-1);if(('"'===m||"'"===m||"`"===m||'"'===g||"'"===g||"`"===g)&&m!==g)throw new l("property names with quotes must have matching quotes");if("constructor"!==f&&d||(s=!0),A(w,a="%"+(n+="."+f)+"%"))o=w[a];else if(null!=o){if(!(f in o)){if(!t)throw new c("base intrinsic for "+e+" exists, but the property is not available.");return}if(h&&p+1>=r.length){var y=h(o,f);o=(d=!!y)&&"get"in y&&!("originalValue"in y.get)?y.get:o[f]}else d=A(o,f),o=o[f];d&&!s&&(w[a]=o)}}return o}},7296:(e,t,r)=>{"use strict";var n=r(210)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},1044:(e,t,r)=>{"use strict";var n=r(4429),i=function(){return!!n};i.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(e){return!0}},e.exports=i},8185:e=>{"use strict";var t={__proto__:null,foo:{}},r=Object;e.exports=function(){return{__proto__:t}.foo===t.foo&&!(t instanceof r)}},1405:(e,t,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(5419);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},5419:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},8824:(e,t,r)=>{"use strict";var n=Function.prototype.call,i=Object.prototype.hasOwnProperty,a=r(8612);e.exports=a.call(n,i)},9832:(e,t,r)=>{e.exports=function e(t,r,n){function i(o,s){if(!r[o]){if(!t[o]){if(a)return a(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[o]={exports:{}};t[o][0].call(c.exports,(function(e){return i(t[o][1][e]||e)}),c,c.exports,e,t,r,n)}return r[o].exports}for(var a=void 0,o=0;o<n.length;o++)i(n[o]);return i}({"./aesprim":[function(e,t,r){!function(e,t){"use strict";t(void 0!==r?r:e.esprima={})}(this,(function(e){"use strict";var t,r,n,i,a,o,s,l,c,u,p,d,h,f,m,g,y,_;function b(e,t){if(!e)throw new Error("ASSERT: "+t)}function v(e){return e>=48&&e<=57}function w(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function S(e){return"01234567".indexOf(e)>=0}function E(e){return 32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(e)>=0}function x(e){return 10===e||13===e||8232===e||8233===e}function k(e){return 64==e||36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||92===e||e>=128&&s.NonAsciiIdentifierStart.test(String.fromCharCode(e))}function A(e){return 36===e||95===e||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||92===e||e>=128&&s.NonAsciiIdentifierPart.test(String.fromCharCode(e))}function I(e){switch(e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}}function j(e){return"eval"===e||"arguments"===e}function O(e){if(u&&I(e))return!0;switch(e.length){case 2:return"if"===e||"in"===e||"do"===e;case 3:return"var"===e||"for"===e||"new"===e||"try"===e||"let"===e;case 4:return"this"===e||"else"===e||"case"===e||"void"===e||"with"===e||"enum"===e;case 5:return"while"===e||"break"===e||"catch"===e||"throw"===e||"const"===e||"yield"===e||"class"===e||"super"===e;case 6:return"return"===e||"typeof"===e||"delete"===e||"switch"===e||"export"===e||"import"===e;case 7:return"default"===e||"finally"===e||"extends"===e;case 8:return"function"===e||"continue"===e||"debugger"===e;case 10:return"instanceof"===e;default:return!1}}function P(e,t,r,n,i){var a;b("number"==typeof r,"Comment must have valid position"),y.lastCommentStart>=r||(y.lastCommentStart=r,a={type:e,value:t},_.range&&(a.range=[r,n]),_.loc&&(a.loc=i),_.comments.push(a),_.attachComment&&(_.leadingComments.push(a),_.trailingComments.push(a)))}function T(e){var t,r,n,i;for(t=p-e,r={start:{line:d,column:p-h-e}};p<f;)if(n=c.charCodeAt(p),++p,x(n))return _.comments&&(i=c.slice(t+e,p-1),r.end={line:d,column:p-h-1},P("Line",i,t,p-1,r)),13===n&&10===c.charCodeAt(p)&&++p,++d,void(h=p);_.comments&&(i=c.slice(t+e,p),r.end={line:d,column:p-h},P("Line",i,t,p,r))}function C(){var e,t,r,n;for(_.comments&&(e=p-2,t={start:{line:d,column:p-h-2}});p<f;)if(x(r=c.charCodeAt(p)))13===r&&10===c.charCodeAt(p+1)&&++p,++d,++p,h=p,p>=f&&J({},o.UnexpectedToken,"ILLEGAL");else if(42===r){if(47===c.charCodeAt(p+1))return++p,++p,void(_.comments&&(n=c.slice(e+2,p-2),t.end={line:d,column:p-h},P("Block",n,e,p,t)));++p}else++p;J({},o.UnexpectedToken,"ILLEGAL")}function N(){var e,t;for(t=0===p;p<f;)if(E(e=c.charCodeAt(p)))++p;else if(x(e))++p,13===e&&10===c.charCodeAt(p)&&++p,++d,h=p,t=!0;else if(47===e)if(47===(e=c.charCodeAt(p+1)))++p,++p,T(2),t=!0;else{if(42!==e)break;++p,++p,C()}else if(t&&45===e){if(45!==c.charCodeAt(p+1)||62!==c.charCodeAt(p+2))break;p+=3,T(3)}else{if(60!==e)break;if("!--"!==c.slice(p+1,p+4))break;++p,++p,++p,++p,T(4)}}function L(e){var t,r,n,i=0;for(r="u"===e?4:2,t=0;t<r;++t){if(!(p<f&&w(c[p])))return"";n=c[p++],i=16*i+"0123456789abcdef".indexOf(n.toLowerCase())}return String.fromCharCode(i)}function M(){var e,t;for(e=c.charCodeAt(p++),t=String.fromCharCode(e),92===e&&(117!==c.charCodeAt(p)&&J({},o.UnexpectedToken,"ILLEGAL"),++p,(e=L("u"))&&"\\"!==e&&k(e.charCodeAt(0))||J({},o.UnexpectedToken,"ILLEGAL"),t=e);p<f&&A(e=c.charCodeAt(p));)++p,t+=String.fromCharCode(e),92===e&&(t=t.substr(0,t.length-1),117!==c.charCodeAt(p)&&J({},o.UnexpectedToken,"ILLEGAL"),++p,(e=L("u"))&&"\\"!==e&&A(e.charCodeAt(0))||J({},o.UnexpectedToken,"ILLEGAL"),t+=e);return t}function F(){var e,t;for(e=p++;p<f;){if(92===(t=c.charCodeAt(p)))return p=e,M();if(!A(t))break;++p}return c.slice(e,p)}function R(){var e,r,n,i,a=p,s=c.charCodeAt(p),l=c[p];switch(s){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++p,_.tokenize&&(40===s?_.openParenToken=_.tokens.length:123===s&&(_.openCurlyToken=_.tokens.length)),{type:t.Punctuator,value:String.fromCharCode(s),lineNumber:d,lineStart:h,start:a,end:p};default:if(61===(e=c.charCodeAt(p+1)))switch(s){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return p+=2,{type:t.Punctuator,value:String.fromCharCode(s)+String.fromCharCode(e),lineNumber:d,lineStart:h,start:a,end:p};case 33:case 61:return p+=2,61===c.charCodeAt(p)&&++p,{type:t.Punctuator,value:c.slice(a,p),lineNumber:d,lineStart:h,start:a,end:p}}}return">>>="===(i=c.substr(p,4))?(p+=4,{type:t.Punctuator,value:i,lineNumber:d,lineStart:h,start:a,end:p}):">>>"===(n=i.substr(0,3))||"<<="===n||">>="===n?(p+=3,{type:t.Punctuator,value:n,lineNumber:d,lineStart:h,start:a,end:p}):l===(r=n.substr(0,2))[1]&&"+-<>&|".indexOf(l)>=0||"=>"===r?(p+=2,{type:t.Punctuator,value:r,lineNumber:d,lineStart:h,start:a,end:p}):"<>=!+-*%&|^/".indexOf(l)>=0?(++p,{type:t.Punctuator,value:l,lineNumber:d,lineStart:h,start:a,end:p}):void J({},o.UnexpectedToken,"ILLEGAL")}function D(){var e,r,n;if(b(v((n=c[p]).charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),r=p,e="","."!==n){if(e=c[p++],n=c[p],"0"===e){if("x"===n||"X"===n)return++p,function(e){for(var r="";p<f&&w(c[p]);)r+=c[p++];return 0===r.length&&J({},o.UnexpectedToken,"ILLEGAL"),k(c.charCodeAt(p))&&J({},o.UnexpectedToken,"ILLEGAL"),{type:t.NumericLiteral,value:parseInt("0x"+r,16),lineNumber:d,lineStart:h,start:e,end:p}}(r);if(S(n))return function(e){for(var r="0"+c[p++];p<f&&S(c[p]);)r+=c[p++];return(k(c.charCodeAt(p))||v(c.charCodeAt(p)))&&J({},o.UnexpectedToken,"ILLEGAL"),{type:t.NumericLiteral,value:parseInt(r,8),octal:!0,lineNumber:d,lineStart:h,start:e,end:p}}(r);n&&v(n.charCodeAt(0))&&J({},o.UnexpectedToken,"ILLEGAL")}for(;v(c.charCodeAt(p));)e+=c[p++];n=c[p]}if("."===n){for(e+=c[p++];v(c.charCodeAt(p));)e+=c[p++];n=c[p]}if("e"===n||"E"===n)if(e+=c[p++],"+"!==(n=c[p])&&"-"!==n||(e+=c[p++]),v(c.charCodeAt(p)))for(;v(c.charCodeAt(p));)e+=c[p++];else J({},o.UnexpectedToken,"ILLEGAL");return k(c.charCodeAt(p))&&J({},o.UnexpectedToken,"ILLEGAL"),{type:t.NumericLiteral,value:parseFloat(e),lineNumber:d,lineStart:h,start:r,end:p}}function q(){var e,r,n,i;return g=null,N(),e=p,r=function(){var e,t,r,n;for(b("/"===(e=c[p]),"Regular expression literal must start with a slash"),t=c[p++],r=!1,n=!1;p<f;)if(t+=e=c[p++],"\\"===e)x((e=c[p++]).charCodeAt(0))&&J({},o.UnterminatedRegExp),t+=e;else if(x(e.charCodeAt(0)))J({},o.UnterminatedRegExp);else if(r)"]"===e&&(r=!1);else{if("/"===e){n=!0;break}"["===e&&(r=!0)}return n||J({},o.UnterminatedRegExp),{value:t.substr(1,t.length-2),literal:t}}(),n=function(){var e,t,r,n;for(t="",r="";p<f&&A((e=c[p]).charCodeAt(0));)if(++p,"\\"===e&&p<f)if("u"===(e=c[p])){if(n=++p,e=L("u"))for(r+=e,t+="\\u";n<p;++n)t+=c[n];else p=n,r+="u",t+="\\u";X({},o.UnexpectedToken,"ILLEGAL")}else t+="\\",X({},o.UnexpectedToken,"ILLEGAL");else r+=e,t+=e;return{value:r,literal:t}}(),i=function(e,t){var r;try{r=new RegExp(e,t)}catch(e){J({},o.InvalidRegExp)}return r}(r.value,n.value),_.tokenize?{type:t.RegularExpression,value:i,lineNumber:d,lineStart:h,start:e,end:p}:{literal:r.literal+n.literal,value:i,start:e,end:p}}function U(){var e,t,r,n;return N(),e=p,t={start:{line:d,column:p-h}},r=q(),t.end={line:d,column:p-h},_.tokenize||(_.tokens.length>0&&(n=_.tokens[_.tokens.length-1]).range[0]===e&&"Punctuator"===n.type&&("/"!==n.value&&"/="!==n.value||_.tokens.pop()),_.tokens.push({type:"RegularExpression",value:r.literal,range:[e,p],loc:t})),r}function B(){var e,r,i;return N(),p>=f?{type:t.EOF,lineNumber:d,lineStart:h,start:p,end:p}:k(e=c.charCodeAt(p))?(r=p,{type:1===(i=92===c.charCodeAt(p)?M():F()).length?t.Identifier:O(i)?t.Keyword:"null"===i?t.NullLiteral:"true"===i||"false"===i?t.BooleanLiteral:t.Identifier,value:i,lineNumber:d,lineStart:h,start:r,end:p}):40===e||41===e||59===e?R():39===e||34===e?function(){var e,r,n,i,a,s,l,u,m="",g=!1;for(l=d,u=h,b("'"===(e=c[p])||'"'===e,"String literal must starts with a quote"),r=p,++p;p<f;){if((n=c[p++])===e){e="";break}if("\\"===n)if((n=c[p++])&&x(n.charCodeAt(0)))++d,"\r"===n&&"\n"===c[p]&&++p,h=p;else switch(n){case"u":case"x":s=p,(a=L(n))?m+=a:(p=s,m+=n);break;case"n":m+="\n";break;case"r":m+="\r";break;case"t":m+="\t";break;case"b":m+="\b";break;case"f":m+="\f";break;case"v":m+="\v";break;default:S(n)?(0!==(i="01234567".indexOf(n))&&(g=!0),p<f&&S(c[p])&&(g=!0,i=8*i+"01234567".indexOf(c[p++]),"0123".indexOf(n)>=0&&p<f&&S(c[p])&&(i=8*i+"01234567".indexOf(c[p++]))),m+=String.fromCharCode(i)):m+=n}else{if(x(n.charCodeAt(0)))break;m+=n}}return""!==e&&J({},o.UnexpectedToken,"ILLEGAL"),{type:t.StringLiteral,value:m,octal:g,startLineNumber:l,startLineStart:u,lineNumber:d,lineStart:h,start:r,end:p}}():46===e?v(c.charCodeAt(p+1))?D():R():v(e)?D():_.tokenize&&47===e?function(){var e,t;if(!(e=_.tokens[_.tokens.length-1]))return U();if("Punctuator"===e.type){if("]"===e.value)return R();if(")"===e.value)return!(t=_.tokens[_.openParenToken-1])||"Keyword"!==t.type||"if"!==t.value&&"while"!==t.value&&"for"!==t.value&&"with"!==t.value?R():U();if("}"===e.value){if(_.tokens[_.openCurlyToken-3]&&"Keyword"===_.tokens[_.openCurlyToken-3].type){if(!(t=_.tokens[_.openCurlyToken-4]))return R()}else{if(!_.tokens[_.openCurlyToken-4]||"Keyword"!==_.tokens[_.openCurlyToken-4].type)return R();if(!(t=_.tokens[_.openCurlyToken-5]))return U()}return n.indexOf(t.value)>=0?R():U()}return U()}return"Keyword"===e.type?U():R()}():R()}function $(){var e,n,i;return N(),e={start:{line:d,column:p-h}},n=B(),e.end={line:d,column:p-h},n.type!==t.EOF&&(i=c.slice(n.start,n.end),_.tokens.push({type:r[n.type],value:i,range:[n.start,n.end],loc:e})),n}function G(){var e;return p=(e=g).end,d=e.lineNumber,h=e.lineStart,g=void 0!==_.tokens?$():B(),p=e.end,d=e.lineNumber,h=e.lineStart,e}function W(){var e,t,r;e=p,t=d,r=h,g=void 0!==_.tokens?$():B(),p=e,d=t,h=r}function H(e,t){this.line=e,this.column=t}function V(e,t,r,n){this.start=new H(e,t),this.end=new H(r,n)}function z(){var e,t,r,n;return e=p,t=d,r=h,N(),n=d!==t,p=e,d=t,h=r,n}function J(e,t){var r,n=Array.prototype.slice.call(arguments,2),i=t.replace(/%(\d)/g,(function(e,t){return b(t<n.length,"Message reference must be in range"),n[t]}));throw"number"==typeof e.lineNumber?((r=new Error("Line "+e.lineNumber+": "+i)).index=e.start,r.lineNumber=e.lineNumber,r.column=e.start-h+1):((r=new Error("Line "+d+": "+i)).index=p,r.lineNumber=d,r.column=p-h+1),r.description=i,r}function X(){try{J.apply(null,arguments)}catch(e){if(!_.errors)throw e;_.errors.push(e)}}function Q(e){if(e.type===t.EOF&&J(e,o.UnexpectedEOS),e.type===t.NumericLiteral&&J(e,o.UnexpectedNumber),e.type===t.StringLiteral&&J(e,o.UnexpectedString),e.type===t.Identifier&&J(e,o.UnexpectedIdentifier),e.type===t.Keyword){if(function(e){switch(e){case"class":case"enum":case"export":case"extends":case"import":case"super":return!0;default:return!1}}(e.value))J(e,o.UnexpectedReserved);else if(u&&I(e.value))return void X(e,o.StrictReservedWord);J(e,o.UnexpectedToken,e.value)}J(e,o.UnexpectedToken,e.value)}function Y(e){var r=G();r.type===t.Punctuator&&r.value===e||Q(r)}function K(e){var r=G();r.type===t.Keyword&&r.value===e||Q(r)}function Z(e){return g.type===t.Punctuator&&g.value===e}function ee(e){return g.type===t.Keyword&&g.value===e}function te(){var e;59===c.charCodeAt(p)||Z(";")?G():(e=d,N(),d===e&&(g.type===t.EOF||Z("}")||Q(g)))}function re(e){return e.type===i.Identifier||e.type===i.MemberExpression}function ne(e,t){var r,n,i;return r=u,i=g,n=Ae(),t&&u&&j(e[0].name)&&X(t,o.StrictParamName),u=r,m.markEnd(m.createFunctionExpression(null,e,[],n),i)}function ie(){var e,r;return r=g,(e=G()).type===t.StringLiteral||e.type===t.NumericLiteral?(u&&e.octal&&X(e,o.StrictOctalLiteral),m.markEnd(m.createLiteral(e),r)):m.markEnd(m.createIdentifier(e.value),r)}function ae(){var e,r,n,i,a,s;return s=g,(e=g).type===t.Identifier?(n=ie(),"get"!==e.value||Z(":")?"set"!==e.value||Z(":")?(Y(":"),i=ge(),m.markEnd(m.createProperty("init",n,i),s)):(r=ie(),Y("("),(e=g).type!==t.Identifier?(Y(")"),X(e,o.UnexpectedToken,e.value),i=ne([])):(a=[be()],Y(")"),i=ne(a,e)),m.markEnd(m.createProperty("set",r,i),s)):(r=ie(),Y("("),Y(")"),i=ne([]),m.markEnd(m.createProperty("get",r,i),s))):e.type!==t.EOF&&e.type!==t.Punctuator?(r=ie(),Y(":"),i=ge(),m.markEnd(m.createProperty("init",r,i),s)):void Q(e)}function oe(){var e,r,n,s;if(Z("("))return function(){var e;return Y("("),e=ye(),Y(")"),e}();if(Z("["))return function(){var e,t=[];for(e=g,Y("[");!Z("]");)Z(",")?(G(),t.push(null)):(t.push(ge()),Z("]")||Y(","));return G(),m.markEnd(m.createArrayExpression(t),e)}();if(Z("{"))return function(){var e,t,r,n,s,l=[],c={},p=String;for(s=g,Y("{");!Z("}");)t=(e=ae()).key.type===i.Identifier?e.key.name:p(e.key.value),n="init"===e.kind?a.Data:"get"===e.kind?a.Get:a.Set,r="$"+t,Object.prototype.hasOwnProperty.call(c,r)?(c[r]===a.Data?u&&n===a.Data?X({},o.StrictDuplicateProperty):n!==a.Data&&X({},o.AccessorDataProperty):n===a.Data?X({},o.AccessorDataProperty):c[r]&n&&X({},o.AccessorGetSet),c[r]|=n):c[r]=n,l.push(e),Z("}")||Y(",");return Y("}"),m.markEnd(m.createObjectExpression(l),s)}();if(e=g.type,s=g,e===t.Identifier)n=m.createIdentifier(G().value);else if(e===t.StringLiteral||e===t.NumericLiteral)u&&g.octal&&X(g,o.StrictOctalLiteral),n=m.createLiteral(G());else if(e===t.Keyword){if(ee("function"))return function(){var e,t,r,n,i,a,s,l,c=null,p=[];return l=g,K("function"),Z("(")||(e=g,c=be(),u?j(e.value)&&X(e,o.StrictFunctionName):j(e.value)?(r=e,n=o.StrictFunctionName):I(e.value)&&(r=e,n=o.StrictReservedWord)),p=(i=Ie(r)).params,t=i.stricted,r=i.firstRestricted,i.message&&(n=i.message),s=u,a=Ae(),u&&r&&J(r,n),u&&t&&X(t,n),u=s,m.markEnd(m.createFunctionExpression(c,p,[],a),l)}();ee("this")?(G(),n=m.createThisExpression()):Q(G())}else e===t.BooleanLiteral?((r=G()).value="true"===r.value,n=m.createLiteral(r)):e===t.NullLiteral?((r=G()).value=null,n=m.createLiteral(r)):Z("/")||Z("/=")?(n=void 0!==_.tokens?m.createLiteral(U()):m.createLiteral(q()),W()):Q(G());return m.markEnd(n,s)}function se(){var e=[];if(Y("("),!Z(")"))for(;p<f&&(e.push(ge()),!Z(")"));)Y(",");return Y(")"),e}function le(){var e,r;return r=g,function(e){return e.type===t.Identifier||e.type===t.Keyword||e.type===t.BooleanLiteral||e.type===t.NullLiteral}(e=G())||Q(e),m.markEnd(m.createIdentifier(e.value),r)}function ce(){return Y("."),le()}function ue(){var e;return Y("["),e=ye(),Y("]"),e}function pe(){var e,t,r;return r=g,K("new"),e=function(){var e,t,r,n;for(n=g,e=y.allowIn,t=ee("new")?pe():oe(),y.allowIn=e;Z(".")||Z("[");)Z("[")?(r=ue(),t=m.createMemberExpression("[",t,r)):(r=ce(),t=m.createMemberExpression(".",t,r)),m.markEnd(t,n);return t}(),t=Z("(")?se():[],m.markEnd(m.createNewExpression(e,t),r)}function de(){var e,r,n=g;return e=function(){var e,t,r,n,i;for(i=g,e=y.allowIn,y.allowIn=!0,t=ee("new")?pe():oe(),y.allowIn=e;;){if(Z("."))n=ce(),t=m.createMemberExpression(".",t,n);else if(Z("("))r=se(),t=m.createCallExpression(t,r);else{if(!Z("["))break;n=ue(),t=m.createMemberExpression("[",t,n)}m.markEnd(t,i)}return t}(),g.type===t.Punctuator&&(!Z("++")&&!Z("--")||z()||(u&&e.type===i.Identifier&&j(e.name)&&X({},o.StrictLHSPostfix),re(e)||X({},o.InvalidLHSInAssignment),r=G(),e=m.markEnd(m.createPostfixExpression(r.value,e),n))),e}function he(){var e,r,n;return g.type!==t.Punctuator&&g.type!==t.Keyword?r=de():Z("++")||Z("--")?(n=g,e=G(),r=he(),u&&r.type===i.Identifier&&j(r.name)&&X({},o.StrictLHSPrefix),re(r)||X({},o.InvalidLHSInAssignment),r=m.createUnaryExpression(e.value,r),r=m.markEnd(r,n)):Z("+")||Z("-")||Z("~")||Z("!")?(n=g,e=G(),r=he(),r=m.createUnaryExpression(e.value,r),r=m.markEnd(r,n)):ee("delete")||ee("void")||ee("typeof")?(n=g,e=G(),r=he(),r=m.createUnaryExpression(e.value,r),r=m.markEnd(r,n),u&&"delete"===r.operator&&r.argument.type===i.Identifier&&X({},o.StrictDelete)):r=de(),r}function fe(e,r){var n=0;if(e.type!==t.Punctuator&&e.type!==t.Keyword)return 0;switch(e.value){case"||":n=1;break;case"&&":n=2;break;case"|":n=3;break;case"^":n=4;break;case"&":n=5;break;case"==":case"!=":case"===":case"!==":n=6;break;case"<":case">":case"<=":case">=":case"instanceof":n=7;break;case"in":n=r?7:0;break;case"<<":case">>":case">>>":n=8;break;case"+":case"-":n=9;break;case"*":case"/":case"%":n=11}return n}function me(){var e,t,r,n,i;return i=g,e=function(){var e,t,r,n,i,a,o,s,l,c;if(e=g,l=he(),0===(i=fe(n=g,y.allowIn)))return l;for(n.prec=i,G(),t=[e,g],a=[l,n,o=he()];(i=fe(g,y.allowIn))>0;){for(;a.length>2&&i<=a[a.length-2].prec;)o=a.pop(),s=a.pop().value,l=a.pop(),r=m.createBinaryExpression(s,l,o),t.pop(),e=t[t.length-1],m.markEnd(r,e),a.push(r);(n=G()).prec=i,a.push(n),t.push(g),r=he(),a.push(r)}for(r=a[c=a.length-1],t.pop();c>1;)r=m.createBinaryExpression(a[c-1].value,a[c-2],r),c-=2,e=t.pop(),m.markEnd(r,e);return r}(),Z("?")&&(G(),t=y.allowIn,y.allowIn=!0,r=ge(),y.allowIn=t,Y(":"),n=ge(),e=m.createConditionalExpression(e,r,n),m.markEnd(e,i)),e}function ge(){var e,r,n,a,s,l;return e=g,s=g,a=r=me(),g.type===t.Punctuator&&("="===(l=g.value)||"*="===l||"/="===l||"%="===l||"+="===l||"-="===l||"<<="===l||">>="===l||">>>="===l||"&="===l||"^="===l||"|="===l)&&(re(r)||X({},o.InvalidLHSInAssignment),u&&r.type===i.Identifier&&j(r.name)&&X(e,o.StrictLHSAssignment),e=G(),n=ge(),a=m.markEnd(m.createAssignmentExpression(e.value,r,n),s)),a}function ye(){var e,t=g;if(e=ge(),Z(",")){for(e=m.createSequenceExpression([e]);p<f&&Z(",");)G(),e.expressions.push(ge());m.markEnd(e,t)}return e}function _e(){var e,t;return t=g,Y("{"),e=function(){for(var e,t=[];p<f&&!Z("}")&&void 0!==(e=Oe());)t.push(e);return t}(),Y("}"),m.markEnd(m.createBlockStatement(e),t)}function be(){var e,r;return r=g,(e=G()).type!==t.Identifier&&Q(e),m.markEnd(m.createIdentifier(e.value),r)}function ve(e){var t,r,n=null;return r=g,t=be(),u&&j(t.name)&&X({},o.StrictVarName),"const"===e?(Y("="),n=ge()):Z("=")&&(G(),n=ge()),m.markEnd(m.createVariableDeclarator(t,n),r)}function we(e){var t=[];do{if(t.push(ve(e)),!Z(","))break;G()}while(p<f);return t}function Se(){var e,t,r,n,i,a,s,l,c,u;return e=t=r=null,K("for"),Y("("),Z(";")?G():(ee("var")||ee("let")?(y.allowIn=!1,u=g,l=G(),c=we(),e=m.markEnd(m.createVariableDeclaration(c,l.value),u),y.allowIn=!0,1===e.declarations.length&&ee("in")&&(G(),n=e,i=ye(),e=null)):(y.allowIn=!1,e=ye(),y.allowIn=!0,ee("in")&&(re(e)||X({},o.InvalidLHSInForIn),G(),n=e,i=ye(),e=null)),void 0===n&&Y(";")),void 0===n&&(Z(";")||(t=ye()),Y(";"),Z(")")||(r=ye())),Y(")"),s=y.inIteration,y.inIteration=!0,a=ke(),y.inIteration=s,void 0===n?m.createForStatement(e,t,r,a):m.createForInStatement(n,i,a)}function Ee(){var e,t,r,n=[];for(r=g,ee("default")?(G(),e=null):(K("case"),e=ye()),Y(":");p<f&&!(Z("}")||ee("default")||ee("case"));)t=ke(),n.push(t);return m.markEnd(m.createSwitchCase(e,n),r)}function xe(){var e,t,r,n,i=[],a=null;return K("try"),e=_e(),ee("catch")&&i.push((n=g,K("catch"),Y("("),Z(")")&&Q(g),t=be(),u&&j(t.name)&&X({},o.StrictCatchVariable),Y(")"),r=_e(),m.markEnd(m.createCatchClause(t,r),n))),ee("finally")&&(G(),a=_e()),0!==i.length||a||J({},o.NoCatchOrFinally),m.createTryStatement(e,[],i,a)}function ke(){var e,r,n,a,s,l,d,h,_,b=g.type;if(b===t.EOF&&Q(g),b===t.Punctuator&&"{"===g.value)return _e();if(a=g,b===t.Punctuator)switch(g.value){case";":return m.markEnd((Y(";"),m.createEmptyStatement()),a);case"(":return m.markEnd(function(){var e=ye();return te(),m.createExpressionStatement(e)}(),a)}if(b===t.Keyword)switch(g.value){case"break":return m.markEnd(function(){var e,r=null;return K("break"),59===c.charCodeAt(p)?(G(),y.inIteration||y.inSwitch||J({},o.IllegalBreak),m.createBreakStatement(null)):z()?(y.inIteration||y.inSwitch||J({},o.IllegalBreak),m.createBreakStatement(null)):(g.type===t.Identifier&&(e="$"+(r=be()).name,Object.prototype.hasOwnProperty.call(y.labelSet,e)||J({},o.UnknownLabel,r.name)),te(),null!==r||y.inIteration||y.inSwitch||J({},o.IllegalBreak),m.createBreakStatement(r))}(),a);case"continue":return m.markEnd(function(){var e,r=null;return K("continue"),59===c.charCodeAt(p)?(G(),y.inIteration||J({},o.IllegalContinue),m.createContinueStatement(null)):z()?(y.inIteration||J({},o.IllegalContinue),m.createContinueStatement(null)):(g.type===t.Identifier&&(e="$"+(r=be()).name,Object.prototype.hasOwnProperty.call(y.labelSet,e)||J({},o.UnknownLabel,r.name)),te(),null!==r||y.inIteration||J({},o.IllegalContinue),m.createContinueStatement(r))}(),a);case"debugger":return m.markEnd((K("debugger"),te(),m.createDebuggerStatement()),a);case"do":return m.markEnd((K("do"),_=y.inIteration,y.inIteration=!0,d=ke(),y.inIteration=_,K("while"),Y("("),h=ye(),Y(")"),Z(";")&&G(),m.createDoWhileStatement(d,h)),a);case"for":return m.markEnd(Se(),a);case"function":return m.markEnd(je(),a);case"if":return m.markEnd(function(){var e,t,r;return K("if"),Y("("),e=ye(),Y(")"),t=ke(),ee("else")?(G(),r=ke()):r=null,m.createIfStatement(e,t,r)}(),a);case"return":return m.markEnd((l=null,K("return"),y.inFunctionBody||X({},o.IllegalReturn),32===c.charCodeAt(p)&&k(c.charCodeAt(p+1))?(l=ye(),te(),m.createReturnStatement(l)):z()?m.createReturnStatement(null):(Z(";")||Z("}")||g.type===t.EOF||(l=ye()),te(),m.createReturnStatement(l))),a);case"switch":return m.markEnd(function(){var e,t,r,n,i;if(K("switch"),Y("("),e=ye(),Y(")"),Y("{"),t=[],Z("}"))return G(),m.createSwitchStatement(e,t);for(n=y.inSwitch,y.inSwitch=!0,i=!1;p<f&&!Z("}");)null===(r=Ee()).test&&(i&&J({},o.MultipleDefaultsInSwitch),i=!0),t.push(r);return y.inSwitch=n,Y("}"),m.createSwitchStatement(e,t)}(),a);case"throw":return m.markEnd(function(){var e;return K("throw"),z()&&J({},o.NewlineAfterThrow),e=ye(),te(),m.createThrowStatement(e)}(),a);case"try":return m.markEnd(xe(),a);case"var":return m.markEnd((K("var"),s=we(),te(),m.createVariableDeclaration(s,"var")),a);case"while":return m.markEnd(function(){var e,t,r;return K("while"),Y("("),e=ye(),Y(")"),r=y.inIteration,y.inIteration=!0,t=ke(),y.inIteration=r,m.createWhileStatement(e,t)}(),a);case"with":return m.markEnd(function(){var e,t;return u&&(N(),X({},o.StrictModeWith)),K("with"),Y("("),e=ye(),Y(")"),t=ke(),m.createWithStatement(e,t)}(),a)}return(e=ye()).type===i.Identifier&&Z(":")?(G(),n="$"+e.name,Object.prototype.hasOwnProperty.call(y.labelSet,n)&&J({},o.Redeclaration,"Label",e.name),y.labelSet[n]=!0,r=ke(),delete y.labelSet[n],m.markEnd(m.createLabeledStatement(e,r),a)):(te(),m.markEnd(m.createExpressionStatement(e),a))}function Ae(){var e,r,n,a,s,l,d,h,_=[];for(h=g,Y("{");p<f&&g.type===t.StringLiteral&&(r=g,e=Oe(),_.push(e),e.expression.type===i.Literal);)"use strict"===c.slice(r.start+1,r.end-1)?(u=!0,n&&X(n,o.StrictOctalLiteral)):!n&&r.octal&&(n=r);for(a=y.labelSet,s=y.inIteration,l=y.inSwitch,d=y.inFunctionBody,y.labelSet={},y.inIteration=!1,y.inSwitch=!1,y.inFunctionBody=!0;p<f&&!Z("}")&&void 0!==(e=Oe());)_.push(e);return Y("}"),y.labelSet=a,y.inIteration=s,y.inSwitch=l,y.inFunctionBody=d,m.markEnd(m.createBlockStatement(_),h)}function Ie(e){var t,r,n,i,a,s,l=[];if(Y("("),!Z(")"))for(i={};p<f&&(r=g,t=be(),a="$"+r.value,u?(j(r.value)&&(n=r,s=o.StrictParamName),Object.prototype.hasOwnProperty.call(i,a)&&(n=r,s=o.StrictParamDupe)):e||(j(r.value)?(e=r,s=o.StrictParamName):I(r.value)?(e=r,s=o.StrictReservedWord):Object.prototype.hasOwnProperty.call(i,a)&&(e=r,s=o.StrictParamDupe)),l.push(t),i[a]=!0,!Z(")"));)Y(",");return Y(")"),{params:l,stricted:n,firstRestricted:e,message:s}}function je(){var e,t,r,n,i,a,s,l,c,p;return c=g,K("function"),r=g,e=be(),u?j(r.value)&&X(r,o.StrictFunctionName):j(r.value)?(a=r,s=o.StrictFunctionName):I(r.value)&&(a=r,s=o.StrictReservedWord),p=(i=Ie(a)).params,n=i.stricted,a=i.firstRestricted,i.message&&(s=i.message),l=u,t=Ae(),u&&a&&J(a,s),u&&n&&X(n,s),u=l,m.markEnd(m.createFunctionDeclaration(e,p,[],t),c)}function Oe(){if(g.type===t.Keyword)switch(g.value){case"const":case"let":return e=g.value,n=g,K(e),r=we(e),te(),m.markEnd(m.createVariableDeclaration(r,e),n);case"function":return je();default:return ke()}var e,r,n;if(g.type!==t.EOF)return ke()}function Pe(){var e,r;return N(),W(),r=g,u=!1,e=function(){for(var e,r,n,a=[];p<f&&(r=g).type===t.StringLiteral&&(e=Oe(),a.push(e),e.expression.type===i.Literal);)"use strict"===c.slice(r.start+1,r.end-1)?(u=!0,n&&X(n,o.StrictOctalLiteral)):!n&&r.octal&&(n=r);for(;p<f&&void 0!==(e=Oe());)a.push(e);return a}(),m.markEnd(m.createProgram(e),r)}function Te(){var e,t,r,n=[];for(e=0;e<_.tokens.length;++e)r={type:(t=_.tokens[e]).type,value:t.value},_.range&&(r.range=t.range),_.loc&&(r.loc=t.loc),n.push(r);_.tokens=n}(r={})[(t={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8,RegularExpression:9}).BooleanLiteral]="Boolean",r[t.EOF]="<end>",r[t.Identifier]="Identifier",r[t.Keyword]="Keyword",r[t.NullLiteral]="Null",r[t.NumericLiteral]="Numeric",r[t.Punctuator]="Punctuator",r[t.StringLiteral]="String",r[t.RegularExpression]="RegularExpression",n=["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="],i={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement"},a={Data:1,Get:2,Set:4},o={UnexpectedToken:"Unexpected token %0",UnexpectedNumber:"Unexpected number",UnexpectedString:"Unexpected string",UnexpectedIdentifier:"Unexpected identifier",UnexpectedReserved:"Unexpected reserved word",UnexpectedEOS:"Unexpected end of input",NewlineAfterThrow:"Illegal newline after throw",InvalidRegExp:"Invalid regular expression",UnterminatedRegExp:"Invalid regular expression: missing /",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NoCatchOrFinally:"Missing catch or finally after try",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared",IllegalContinue:"Illegal continue statement",IllegalBreak:"Illegal break statement",IllegalReturn:"Illegal return statement",StrictModeWith:"Strict mode code may not include a with statement",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictDuplicateProperty:"Duplicate data property in object literal not allowed in strict mode",AccessorDataProperty:"Object literal may not have data and accessor property with the same name",AccessorGetSet:"Object literal may not have multiple get/set accessors with the same name",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode"},s={NonAsciiIdentifierStart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:new RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԧԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠࢢ-ࢬࣤ-ࣾऀ-ॣ०-९ॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶᴀ-ᷦ᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‌‍‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺꩻꪀ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︦︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]")},l={name:"SyntaxTree",processComment:function(e){var t,r;if(!(e.type===i.Program&&e.body.length>0)){for(_.trailingComments.length>0?_.trailingComments[0].range[0]>=e.range[1]?(r=_.trailingComments,_.trailingComments=[]):_.trailingComments.length=0:_.bottomRightStack.length>0&&_.bottomRightStack[_.bottomRightStack.length-1].trailingComments&&_.bottomRightStack[_.bottomRightStack.length-1].trailingComments[0].range[0]>=e.range[1]&&(r=_.bottomRightStack[_.bottomRightStack.length-1].trailingComments,delete _.bottomRightStack[_.bottomRightStack.length-1].trailingComments);_.bottomRightStack.length>0&&_.bottomRightStack[_.bottomRightStack.length-1].range[0]>=e.range[0];)t=_.bottomRightStack.pop();t?t.leadingComments&&t.leadingComments[t.leadingComments.length-1].range[1]<=e.range[0]&&(e.leadingComments=t.leadingComments,delete t.leadingComments):_.leadingComments.length>0&&_.leadingComments[_.leadingComments.length-1].range[1]<=e.range[0]&&(e.leadingComments=_.leadingComments,_.leadingComments=[]),r&&(e.trailingComments=r),_.bottomRightStack.push(e)}},markEnd:function(e,t){return _.range&&(e.range=[t.start,p]),_.loc&&(e.loc=new V(void 0===t.startLineNumber?t.lineNumber:t.startLineNumber,t.start-(void 0===t.startLineStart?t.lineStart:t.startLineStart),d,p-h),this.postProcess(e)),_.attachComment&&this.processComment(e),e},postProcess:function(e){return _.source&&(e.loc.source=_.source),e},createArrayExpression:function(e){return{type:i.ArrayExpression,elements:e}},createAssignmentExpression:function(e,t,r){return{type:i.AssignmentExpression,operator:e,left:t,right:r}},createBinaryExpression:function(e,t,r){return{type:"||"===e||"&&"===e?i.LogicalExpression:i.BinaryExpression,operator:e,left:t,right:r}},createBlockStatement:function(e){return{type:i.BlockStatement,body:e}},createBreakStatement:function(e){return{type:i.BreakStatement,label:e}},createCallExpression:function(e,t){return{type:i.CallExpression,callee:e,arguments:t}},createCatchClause:function(e,t){return{type:i.CatchClause,param:e,body:t}},createConditionalExpression:function(e,t,r){return{type:i.ConditionalExpression,test:e,consequent:t,alternate:r}},createContinueStatement:function(e){return{type:i.ContinueStatement,label:e}},createDebuggerStatement:function(){return{type:i.DebuggerStatement}},createDoWhileStatement:function(e,t){return{type:i.DoWhileStatement,body:e,test:t}},createEmptyStatement:function(){return{type:i.EmptyStatement}},createExpressionStatement:function(e){return{type:i.ExpressionStatement,expression:e}},createForStatement:function(e,t,r,n){return{type:i.ForStatement,init:e,test:t,update:r,body:n}},createForInStatement:function(e,t,r){return{type:i.ForInStatement,left:e,right:t,body:r,each:!1}},createFunctionDeclaration:function(e,t,r,n){return{type:i.FunctionDeclaration,id:e,params:t,defaults:r,body:n,rest:null,generator:!1,expression:!1}},createFunctionExpression:function(e,t,r,n){return{type:i.FunctionExpression,id:e,params:t,defaults:r,body:n,rest:null,generator:!1,expression:!1}},createIdentifier:function(e){return{type:i.Identifier,name:e}},createIfStatement:function(e,t,r){return{type:i.IfStatement,test:e,consequent:t,alternate:r}},createLabeledStatement:function(e,t){return{type:i.LabeledStatement,label:e,body:t}},createLiteral:function(e){return{type:i.Literal,value:e.value,raw:c.slice(e.start,e.end)}},createMemberExpression:function(e,t,r){return{type:i.MemberExpression,computed:"["===e,object:t,property:r}},createNewExpression:function(e,t){return{type:i.NewExpression,callee:e,arguments:t}},createObjectExpression:function(e){return{type:i.ObjectExpression,properties:e}},createPostfixExpression:function(e,t){return{type:i.UpdateExpression,operator:e,argument:t,prefix:!1}},createProgram:function(e){return{type:i.Program,body:e}},createProperty:function(e,t,r){return{type:i.Property,key:t,value:r,kind:e}},createReturnStatement:function(e){return{type:i.ReturnStatement,argument:e}},createSequenceExpression:function(e){return{type:i.SequenceExpression,expressions:e}},createSwitchCase:function(e,t){return{type:i.SwitchCase,test:e,consequent:t}},createSwitchStatement:function(e,t){return{type:i.SwitchStatement,discriminant:e,cases:t}},createThisExpression:function(){return{type:i.ThisExpression}},createThrowStatement:function(e){return{type:i.ThrowStatement,argument:e}},createTryStatement:function(e,t,r,n){return{type:i.TryStatement,block:e,guardedHandlers:t,handlers:r,finalizer:n}},createUnaryExpression:function(e,t){return"++"===e||"--"===e?{type:i.UpdateExpression,operator:e,argument:t,prefix:!0}:{type:i.UnaryExpression,operator:e,argument:t,prefix:!0}},createVariableDeclaration:function(e,t){return{type:i.VariableDeclaration,declarations:e,kind:t}},createVariableDeclarator:function(e,t){return{type:i.VariableDeclarator,id:e,init:t}},createWhileStatement:function(e,t){return{type:i.WhileStatement,test:e,body:t}},createWithStatement:function(e,t){return{type:i.WithStatement,object:e,body:t}}},e.version="1.2.2",e.tokenize=function(e,r){var n;"string"==typeof e||e instanceof String||(e=String(e)),m=l,p=0,d=(c=e).length>0?1:0,h=0,f=c.length,g=null,y={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1},_={},(r=r||{}).tokens=!0,_.tokens=[],_.tokenize=!0,_.openParenToken=-1,_.openCurlyToken=-1,_.range="boolean"==typeof r.range&&r.range,_.loc="boolean"==typeof r.loc&&r.loc,"boolean"==typeof r.comment&&r.comment&&(_.comments=[]),"boolean"==typeof r.tolerant&&r.tolerant&&(_.errors=[]);try{if(W(),g.type===t.EOF)return _.tokens;for(G();g.type!==t.EOF;)try{G()}catch(e){if(_.errors){_.errors.push(e);break}throw e}Te(),n=_.tokens,void 0!==_.comments&&(n.comments=_.comments),void 0!==_.errors&&(n.errors=_.errors)}catch(e){throw e}finally{_={}}return n},e.parse=function(e,t){var r,n;n=String,"string"==typeof e||e instanceof String||(e=n(e)),m=l,p=0,d=(c=e).length>0?1:0,h=0,f=c.length,g=null,y={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1},_={},void 0!==t&&(_.range="boolean"==typeof t.range&&t.range,_.loc="boolean"==typeof t.loc&&t.loc,_.attachComment="boolean"==typeof t.attachComment&&t.attachComment,_.loc&&null!==t.source&&void 0!==t.source&&(_.source=n(t.source)),"boolean"==typeof t.tokens&&t.tokens&&(_.tokens=[]),"boolean"==typeof t.comment&&t.comment&&(_.comments=[]),"boolean"==typeof t.tolerant&&t.tolerant&&(_.errors=[]),_.attachComment&&(_.range=!0,_.comments=[],_.bottomRightStack=[],_.trailingComments=[],_.leadingComments=[]));try{r=Pe(),void 0!==_.comments&&(r.comments=_.comments),void 0!==_.tokens&&(Te(),r.tokens=_.tokens),void 0!==_.errors&&(r.errors=_.errors)}catch(e){throw e}finally{_={}}return r},e.Syntax=function(){var e,t={};for(e in"function"==typeof Object.create&&(t=Object.create(null)),i)i.hasOwnProperty(e)&&(t[e]=i[e]);return"function"==typeof Object.freeze&&Object.freeze(t),t}()}))},{}],1:[function(e,t,r){(function(n){var i=function(){var e={trace:function(){},yy:{},symbols_:{error:2,JSON_PATH:3,DOLLAR:4,PATH_COMPONENTS:5,LEADING_CHILD_MEMBER_EXPRESSION:6,PATH_COMPONENT:7,MEMBER_COMPONENT:8,SUBSCRIPT_COMPONENT:9,CHILD_MEMBER_COMPONENT:10,DESCENDANT_MEMBER_COMPONENT:11,DOT:12,MEMBER_EXPRESSION:13,DOT_DOT:14,STAR:15,IDENTIFIER:16,SCRIPT_EXPRESSION:17,INTEGER:18,END:19,CHILD_SUBSCRIPT_COMPONENT:20,DESCENDANT_SUBSCRIPT_COMPONENT:21,"[":22,SUBSCRIPT:23,"]":24,SUBSCRIPT_EXPRESSION:25,SUBSCRIPT_EXPRESSION_LIST:26,SUBSCRIPT_EXPRESSION_LISTABLE:27,",":28,STRING_LITERAL:29,ARRAY_SLICE:30,FILTER_EXPRESSION:31,QQ_STRING:32,Q_STRING:33,$accept:0,$end:1},terminals_:{2:"error",4:"DOLLAR",12:"DOT",14:"DOT_DOT",15:"STAR",16:"IDENTIFIER",17:"SCRIPT_EXPRESSION",18:"INTEGER",19:"END",22:"[",24:"]",28:",",30:"ARRAY_SLICE",31:"FILTER_EXPRESSION",32:"QQ_STRING",33:"Q_STRING"},productions_:[0,[3,1],[3,2],[3,1],[3,2],[5,1],[5,2],[7,1],[7,1],[8,1],[8,1],[10,2],[6,1],[11,2],[13,1],[13,1],[13,1],[13,1],[13,1],[9,1],[9,1],[20,3],[21,4],[23,1],[23,1],[26,1],[26,3],[27,1],[27,1],[27,1],[25,1],[25,1],[25,1],[29,1],[29,1]],performAction:function(e,r,n,i,a,o,s){i.ast||(i.ast=t,t.initialize());var l=o.length-1;switch(a){case 1:return i.ast.set({expression:{type:"root",value:o[l]}}),i.ast.unshift(),i.ast.yield();case 2:return i.ast.set({expression:{type:"root",value:o[l-1]}}),i.ast.unshift(),i.ast.yield();case 3:return i.ast.unshift(),i.ast.yield();case 4:return i.ast.set({operation:"member",scope:"child",expression:{type:"identifier",value:o[l-1]}}),i.ast.unshift(),i.ast.yield();case 5:case 6:case 11:case 13:case 18:case 21:case 22:case 23:break;case 7:i.ast.set({operation:"member"}),i.ast.push();break;case 8:i.ast.set({operation:"subscript"}),i.ast.push();break;case 9:case 19:i.ast.set({scope:"child"});break;case 10:case 20:i.ast.set({scope:"descendant"});break;case 12:i.ast.set({scope:"child",operation:"member"});break;case 14:i.ast.set({expression:{type:"wildcard",value:o[l]}});break;case 15:i.ast.set({expression:{type:"identifier",value:o[l]}});break;case 16:i.ast.set({expression:{type:"script_expression",value:o[l]}});break;case 17:i.ast.set({expression:{type:"numeric_literal",value:parseInt(o[l])}});break;case 24:o[l].length>1?i.ast.set({expression:{type:"union",value:o[l]}}):this.$=o[l];break;case 25:this.$=[o[l]];break;case 26:this.$=o[l-2].concat(o[l]);break;case 27:this.$={expression:{type:"numeric_literal",value:parseInt(o[l])}},i.ast.set(this.$);break;case 28:this.$={expression:{type:"string_literal",value:o[l]}},i.ast.set(this.$);break;case 29:this.$={expression:{type:"slice",value:o[l]}},i.ast.set(this.$);break;case 30:this.$={expression:{type:"wildcard",value:o[l]}},i.ast.set(this.$);break;case 31:this.$={expression:{type:"script_expression",value:o[l]}},i.ast.set(this.$);break;case 32:this.$={expression:{type:"filter_expression",value:o[l]}},i.ast.set(this.$);break;case 33:case 34:this.$=o[l]}},table:[{3:1,4:[1,2],6:3,13:4,15:[1,5],16:[1,6],17:[1,7],18:[1,8],19:[1,9]},{1:[3]},{1:[2,1],5:10,7:11,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,3],5:21,7:11,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,12],12:[2,12],14:[2,12],22:[2,12]},{1:[2,14],12:[2,14],14:[2,14],22:[2,14]},{1:[2,15],12:[2,15],14:[2,15],22:[2,15]},{1:[2,16],12:[2,16],14:[2,16],22:[2,16]},{1:[2,17],12:[2,17],14:[2,17],22:[2,17]},{1:[2,18],12:[2,18],14:[2,18],22:[2,18]},{1:[2,2],7:22,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,5],12:[2,5],14:[2,5],22:[2,5]},{1:[2,7],12:[2,7],14:[2,7],22:[2,7]},{1:[2,8],12:[2,8],14:[2,8],22:[2,8]},{1:[2,9],12:[2,9],14:[2,9],22:[2,9]},{1:[2,10],12:[2,10],14:[2,10],22:[2,10]},{1:[2,19],12:[2,19],14:[2,19],22:[2,19]},{1:[2,20],12:[2,20],14:[2,20],22:[2,20]},{13:23,15:[1,5],16:[1,6],17:[1,7],18:[1,8],19:[1,9]},{13:24,15:[1,5],16:[1,6],17:[1,7],18:[1,8],19:[1,9],22:[1,25]},{15:[1,29],17:[1,30],18:[1,33],23:26,25:27,26:28,27:32,29:34,30:[1,35],31:[1,31],32:[1,36],33:[1,37]},{1:[2,4],7:22,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,6],12:[2,6],14:[2,6],22:[2,6]},{1:[2,11],12:[2,11],14:[2,11],22:[2,11]},{1:[2,13],12:[2,13],14:[2,13],22:[2,13]},{15:[1,29],17:[1,30],18:[1,33],23:38,25:27,26:28,27:32,29:34,30:[1,35],31:[1,31],32:[1,36],33:[1,37]},{24:[1,39]},{24:[2,23]},{24:[2,24],28:[1,40]},{24:[2,30]},{24:[2,31]},{24:[2,32]},{24:[2,25],28:[2,25]},{24:[2,27],28:[2,27]},{24:[2,28],28:[2,28]},{24:[2,29],28:[2,29]},{24:[2,33],28:[2,33]},{24:[2,34],28:[2,34]},{24:[1,41]},{1:[2,21],12:[2,21],14:[2,21],22:[2,21]},{18:[1,33],27:42,29:34,30:[1,35],32:[1,36],33:[1,37]},{1:[2,22],12:[2,22],14:[2,22],22:[2,22]},{24:[2,26],28:[2,26]}],defaultActions:{27:[2,23],29:[2,30],30:[2,31],31:[2,32]},parseError:function(e,t){if(!t.recoverable)throw new Error(e);this.trace(e)},parse:function(e){var t=this,r=[0],n=[null],i=[],a=this.table,o="",s=0,l=0,c=0,u=i.slice.call(arguments,1);this.lexer.setInput(e),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,void 0===this.lexer.yylloc&&(this.lexer.yylloc={});var p=this.lexer.yylloc;i.push(p);var d,h=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError?this.parseError=this.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var f,m,g,y,_,b,v,w,S,E={};;){if(g=r[r.length-1],this.defaultActions[g]?y=this.defaultActions[g]:(null==f&&(d=void 0,"number"!=typeof(d=t.lexer.lex()||1)&&(d=t.symbols_[d]||d),f=d),y=a[g]&&a[g][f]),void 0===y||!y.length||!y[0]){var x;for(b in S=[],a[g])this.terminals_[b]&&b>2&&S.push("'"+this.terminals_[b]+"'");x=this.lexer.showPosition?"Parse error on line "+(s+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+S.join(", ")+", got '"+(this.terminals_[f]||f)+"'":"Parse error on line "+(s+1)+": Unexpected "+(1==f?"end of input":"'"+(this.terminals_[f]||f)+"'"),this.parseError(x,{text:this.lexer.match,token:this.terminals_[f]||f,line:this.lexer.yylineno,loc:p,expected:S})}if(y[0]instanceof Array&&y.length>1)throw new Error("Parse Error: multiple actions possible at state: "+g+", token: "+f);switch(y[0]){case 1:r.push(f),n.push(this.lexer.yytext),i.push(this.lexer.yylloc),r.push(y[1]),f=null,m?(f=m,m=null):(l=this.lexer.yyleng,o=this.lexer.yytext,s=this.lexer.yylineno,p=this.lexer.yylloc,c>0&&c--);break;case 2:if(v=this.productions_[y[1]][1],E.$=n[n.length-v],E._$={first_line:i[i.length-(v||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(v||1)].first_column,last_column:i[i.length-1].last_column},h&&(E._$.range=[i[i.length-(v||1)].range[0],i[i.length-1].range[1]]),void 0!==(_=this.performAction.apply(E,[o,l,s,this.yy,y[1],n,i].concat(u))))return _;v&&(r=r.slice(0,-1*v*2),n=n.slice(0,-1*v),i=i.slice(0,-1*v)),r.push(this.productions_[y[1]][0]),n.push(E.$),i.push(E._$),w=a[r[r.length-2]][r[r.length-1]],r.push(w);break;case 3:return!0}}return!0}},t={initialize:function(){this._nodes=[],this._node={},this._stash=[]},set:function(e){for(var t in e)this._node[t]=e[t];return this._node},node:function(e){return arguments.length&&(this._node=e),this._node},push:function(){this._nodes.push(this._node),this._node={}},unshift:function(){this._nodes.unshift(this._node),this._node={}},yield:function(){var e=this._nodes;return this.initialize(),e}},r={EOF:1,parseError:function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},setInput:function(e){return this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},unput:function(e){var t=e.length,r=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t-1),this.offset-=t;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(e){this.unput(this.match.slice(e))},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},test_match:function(e,t){var r,n,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(n=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],r=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var a in i)this[a]=i[a];return!1}return!1},next:function(){if(this.done)return this.EOF;var e,t,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),a=0;a<i.length;a++)if((r=this._input.match(this.rules[i[a]]))&&(!t||r[0].length>t[0].length)){if(t=r,n=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(r,i[a])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,i[n]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){return this.next()||this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},pushState:function(e){this.begin(e)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(e,t,r,n){switch(r){case 0:return 4;case 1:return 14;case 2:return 12;case 3:return 15;case 4:return 16;case 5:return 22;case 6:return 24;case 7:return 28;case 8:return 30;case 9:return 18;case 10:return t.yytext=t.yytext.substr(1,t.yyleng-2),32;case 11:return t.yytext=t.yytext.substr(1,t.yyleng-2),33;case 12:return 17;case 13:return 31}},rules:[/^(?:\$)/,/^(?:\.\.)/,/^(?:\.)/,/^(?:\*)/,/^(?:[a-zA-Z_]+[a-zA-Z0-9_]*)/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?:((-?(?:0|[1-9][0-9]*)))?\:((-?(?:0|[1-9][0-9]*)))?(\:((-?(?:0|[1-9][0-9]*)))?)?)/,/^(?:(-?(?:0|[1-9][0-9]*)))/,/^(?:"(?:\\["bfnrt/\\]|\\u[a-fA-F0-9]{4}|[^"\\])*")/,/^(?:'(?:\\['bfnrt/\\]|\\u[a-fA-F0-9]{4}|[^'\\])*')/,/^(?:\(.+?\)(?=\]))/,/^(?:\?\(.+?\)(?=\]))/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}};function n(){this.yy={}}return e.lexer=r,n.prototype=e,e.Parser=n,new n}();void 0!==e&&void 0!==r&&(r.parser=i,r.Parser=i.Parser,r.parse=function(){return i.parse.apply(i,arguments)},r.main=function(t){t[1]||(console.log("Usage: "+t[0]+" FILE"),n.exit(1));var i=e("fs").readFileSync(e("path").normalize(t[1]),"utf8");return r.parser.parse(i)},void 0!==t&&e.main===t&&r.main(n.argv.slice(1)))}).call(this,e("_process"))},{_process:14,fs:12,path:13}],2:[function(e,t,r){t.exports={identifier:"[a-zA-Z_]+[a-zA-Z0-9_]*",integer:"-?(?:0|[1-9][0-9]*)",qq_string:'"(?:\\\\["bfnrt/\\\\]|\\\\u[a-fA-F0-9]{4}|[^"\\\\])*"',q_string:"'(?:\\\\['bfnrt/\\\\]|\\\\u[a-fA-F0-9]{4}|[^'\\\\])*'"}},{}],3:[function(e,t,r){var n=e("./dict"),i=e("fs"),a={lex:{macros:{esc:"\\\\",int:n.integer},rules:[["\\$","return 'DOLLAR'"],["\\.\\.","return 'DOT_DOT'"],["\\.","return 'DOT'"],["\\*","return 'STAR'"],[n.identifier,"return 'IDENTIFIER'"],["\\[","return '['"],["\\]","return ']'"],[",","return ','"],["({int})?\\:({int})?(\\:({int})?)?","return 'ARRAY_SLICE'"],["{int}","return 'INTEGER'"],[n.qq_string,"yytext = yytext.substr(1,yyleng-2); return 'QQ_STRING';"],[n.q_string,"yytext = yytext.substr(1,yyleng-2); return 'Q_STRING';"],["\\(.+?\\)(?=\\])","return 'SCRIPT_EXPRESSION'"],["\\?\\(.+?\\)(?=\\])","return 'FILTER_EXPRESSION'"]]},start:"JSON_PATH",bnf:{JSON_PATH:[["DOLLAR",'yy.ast.set({ expression: { type: "root", value: $1 } }); yy.ast.unshift(); return yy.ast.yield()'],["DOLLAR PATH_COMPONENTS",'yy.ast.set({ expression: { type: "root", value: $1 } }); yy.ast.unshift(); return yy.ast.yield()'],["LEADING_CHILD_MEMBER_EXPRESSION","yy.ast.unshift(); return yy.ast.yield()"],["LEADING_CHILD_MEMBER_EXPRESSION PATH_COMPONENTS",'yy.ast.set({ operation: "member", scope: "child", expression: { type: "identifier", value: $1 }}); yy.ast.unshift(); return yy.ast.yield()']],PATH_COMPONENTS:[["PATH_COMPONENT",""],["PATH_COMPONENTS PATH_COMPONENT",""]],PATH_COMPONENT:[["MEMBER_COMPONENT",'yy.ast.set({ operation: "member" }); yy.ast.push()'],["SUBSCRIPT_COMPONENT",'yy.ast.set({ operation: "subscript" }); yy.ast.push() ']],MEMBER_COMPONENT:[["CHILD_MEMBER_COMPONENT",'yy.ast.set({ scope: "child" })'],["DESCENDANT_MEMBER_COMPONENT",'yy.ast.set({ scope: "descendant" })']],CHILD_MEMBER_COMPONENT:[["DOT MEMBER_EXPRESSION",""]],LEADING_CHILD_MEMBER_EXPRESSION:[["MEMBER_EXPRESSION",'yy.ast.set({ scope: "child", operation: "member" })']],DESCENDANT_MEMBER_COMPONENT:[["DOT_DOT MEMBER_EXPRESSION",""]],MEMBER_EXPRESSION:[["STAR",'yy.ast.set({ expression: { type: "wildcard", value: $1 } })'],["IDENTIFIER",'yy.ast.set({ expression: { type: "identifier", value: $1 } })'],["SCRIPT_EXPRESSION",'yy.ast.set({ expression: { type: "script_expression", value: $1 } })'],["INTEGER",'yy.ast.set({ expression: { type: "numeric_literal", value: parseInt($1) } })'],["END",""]],SUBSCRIPT_COMPONENT:[["CHILD_SUBSCRIPT_COMPONENT",'yy.ast.set({ scope: "child" })'],["DESCENDANT_SUBSCRIPT_COMPONENT",'yy.ast.set({ scope: "descendant" })']],CHILD_SUBSCRIPT_COMPONENT:[["[ SUBSCRIPT ]",""]],DESCENDANT_SUBSCRIPT_COMPONENT:[["DOT_DOT [ SUBSCRIPT ]",""]],SUBSCRIPT:[["SUBSCRIPT_EXPRESSION",""],["SUBSCRIPT_EXPRESSION_LIST",'$1.length > 1? yy.ast.set({ expression: { type: "union", value: $1 } }) : $$ = $1']],SUBSCRIPT_EXPRESSION_LIST:[["SUBSCRIPT_EXPRESSION_LISTABLE","$$ = [$1]"],["SUBSCRIPT_EXPRESSION_LIST , SUBSCRIPT_EXPRESSION_LISTABLE","$$ = $1.concat($3)"]],SUBSCRIPT_EXPRESSION_LISTABLE:[["INTEGER",'$$ = { expression: { type: "numeric_literal", value: parseInt($1) } }; yy.ast.set($$)'],["STRING_LITERAL",'$$ = { expression: { type: "string_literal", value: $1 } }; yy.ast.set($$)'],["ARRAY_SLICE",'$$ = { expression: { type: "slice", value: $1 } }; yy.ast.set($$)']],SUBSCRIPT_EXPRESSION:[["STAR",'$$ = { expression: { type: "wildcard", value: $1 } }; yy.ast.set($$)'],["SCRIPT_EXPRESSION",'$$ = { expression: { type: "script_expression", value: $1 } }; yy.ast.set($$)'],["FILTER_EXPRESSION",'$$ = { expression: { type: "filter_expression", value: $1 } }; yy.ast.set($$)']],STRING_LITERAL:[["QQ_STRING","$$ = $1"],["Q_STRING","$$ = $1"]]}};i.readFileSync&&(a.moduleInclude=i.readFileSync(e.resolve("../include/module.js")),a.actionInclude=i.readFileSync(e.resolve("../include/action.js"))),t.exports=a},{"./dict":2,fs:12}],4:[function(e,t,r){var n=e("./aesprim"),i=e("./slice"),a=e("static-eval"),o=e("underscore").uniq,s=function(){return this.initialize.apply(this,arguments)};function l(t,r,i){var a=e("./index"),o=h(n.parse(r).body[0].expression,{"@":t.value}),s=i.replace(/\{\{\s*value\s*\}\}/g,o),l=a.nodes(t.value,s);return l.forEach((function(e){e.path=t.path.concat(e.path.slice(1))})),l}function c(e){return Array.isArray(e)}function u(e){return function(t,r,n,i){var a=t.value,o=t.path,s=[],l=function(t,a){var o;c(t)?(t.forEach((function(e,t){s.length>=i||n(t,e,r)&&s.push({path:a.concat(t),value:e})})),t.forEach((function(t,r){s.length>=i||e&&l(t,a.concat(r))}))):(o=t)&&!(o instanceof Array)&&o instanceof Object&&(this.keys(t).forEach((function(e){s.length>=i||n(e,t[e],r)&&s.push({path:a.concat(e),value:t[e]})})),this.keys(t).forEach((function(r){s.length>=i||e&&l(t[r],a.concat(r))})))}.bind(this);return l(a,o),s}}function p(e){return function(t,r,n){return this.descend(r,t.expression.value,e,n)}}function d(e){return function(t,r,n){return this.traverse(r,t.expression.value,e,n)}}function h(){try{return a.apply(this,arguments)}catch(e){}}function f(e){return e=e.filter((function(e){return e})),o(e,(function(e){return e.path.map((function(e){return String(e).replace("-","--")})).join("-")}))}function m(e){var t=String(e);return t.match(/^-?[0-9]+$/)?parseInt(t):null}s.prototype.initialize=function(){this.traverse=u(!0),this.descend=u()},s.prototype.keys=Object.keys,s.prototype.resolve=function(e){var t=[e.operation,e.scope,e.expression.type].join("-"),r=this._fns[t];if(!r)throw new Error("couldn't resolve key: "+t);return r.bind(this)},s.prototype.register=function(e,t){if(!t instanceof Function)throw new Error("handler must be a function");this._fns[e]=t},s.prototype._fns={"member-child-identifier":function(e,t){var r=e.expression.value,n=t.value;if(n instanceof Object&&r in n)return[{value:n[r],path:t.path.concat(r)}]},"member-descendant-identifier":d((function(e,t,r){return e==r})),"subscript-child-numeric_literal":p((function(e,t,r){return e===r})),"member-child-numeric_literal":p((function(e,t,r){return String(e)===String(r)})),"subscript-descendant-numeric_literal":d((function(e,t,r){return e===r})),"member-child-wildcard":p((function(){return!0})),"member-descendant-wildcard":d((function(){return!0})),"subscript-descendant-wildcard":d((function(){return!0})),"subscript-child-wildcard":p((function(){return!0})),"subscript-child-slice":function(e,t){if(c(t.value)){var r=e.expression.value.split(":").map(m),n=t.value.map((function(e,r){return{value:e,path:t.path.concat(r)}}));return i.apply(null,[n].concat(r))}},"subscript-child-union":function(e,t){var r=[];return e.expression.value.forEach((function(e){var n={operation:"subscript",scope:"child",expression:e.expression},i=this.resolve(n)(n,t);i&&(r=r.concat(i))}),this),f(r)},"subscript-descendant-union":function(t,r,n){var i=e(".."),a=this,o=[];return i.nodes(r,"$..*").slice(1).forEach((function(e){o.length>=n||t.expression.value.forEach((function(t){var r={operation:"subscript",scope:"child",expression:t.expression},n=a.resolve(r)(r,e);o=o.concat(n)}))})),f(o)},"subscript-child-filter_expression":function(e,t,r){var i=e.expression.value.slice(2,-1),a=n.parse(i).body[0].expression;return this.descend(t,null,(function(e,t){return h(a,{"@":t})}),r)},"subscript-descendant-filter_expression":function(e,t,r){var i=e.expression.value.slice(2,-1),a=n.parse(i).body[0].expression;return this.traverse(t,null,(function(e,t){return h(a,{"@":t})}),r)},"subscript-child-script_expression":function(e,t){return l(t,e.expression.value.slice(1,-1),"$[{{value}}]")},"member-child-script_expression":function(e,t){return l(t,e.expression.value.slice(1,-1),"$.{{value}}")},"member-descendant-script_expression":function(e,t){return l(t,e.expression.value.slice(1,-1),"$..value")}},s.prototype._fns["subscript-child-string_literal"]=s.prototype._fns["member-child-identifier"],s.prototype._fns["member-descendant-numeric_literal"]=s.prototype._fns["subscript-descendant-string_literal"]=s.prototype._fns["member-descendant-identifier"],t.exports=s},{"..":"jsonpath","./aesprim":"./aesprim","./index":5,"./slice":7,"static-eval":15,underscore:12}],5:[function(e,t,r){var n=e("assert"),i=e("./dict"),a=e("./parser"),o=e("./handlers"),s=function(){this.initialize.apply(this,arguments)};function l(e){return"[object String]"==Object.prototype.toString.call(e)}s.prototype.initialize=function(){this.parser=new a,this.handlers=new o},s.prototype.parse=function(e){return n.ok(l(e),"we need a path"),this.parser.parse(e)},s.prototype.parent=function(e,t){n.ok(e instanceof Object,"obj needs to be an object"),n.ok(t,"we need a path");var r=this.nodes(e,t)[0];return r.path.pop(),this.value(e,r.path)},s.prototype.apply=function(e,t,r){n.ok(e instanceof Object,"obj needs to be an object"),n.ok(t,"we need a path"),n.equal(typeof r,"function","fn needs to be function");var i=this.nodes(e,t).sort((function(e,t){return t.path.length-e.path.length}));return i.forEach((function(t){var n=t.path.pop(),i=this.value(e,this.stringify(t.path)),a=t.value=r.call(e,i[n]);i[n]=a}),this),i},s.prototype.value=function(e,t,r){if(n.ok(e instanceof Object,"obj needs to be an object"),n.ok(t,"we need a path"),arguments.length>=3){var i=this.nodes(e,t).shift();if(!i)return this._vivify(e,t,r);var a=i.path.slice(-1).shift();this.parent(e,this.stringify(i.path))[a]=r}return this.query(e,this.stringify(t),1).shift()},s.prototype._vivify=function(e,t,r){var i=this;n.ok(e instanceof Object,"obj needs to be an object"),n.ok(t,"we need a path");var a=this.parser.parse(t).map((function(e){return e.expression.value})),o=function(t,r){var n=t.pop(),a=i.value(e,t);a||(o(t.concat(),"string"==typeof n?{}:[]),a=i.value(e,t)),a[n]=r};return o(a,r),this.query(e,t)[0]},s.prototype.query=function(e,t,r){return n.ok(e instanceof Object,"obj needs to be an object"),n.ok(l(t),"we need a path"),this.nodes(e,t,r).map((function(e){return e.value}))},s.prototype.paths=function(e,t,r){return n.ok(e instanceof Object,"obj needs to be an object"),n.ok(t,"we need a path"),this.nodes(e,t,r).map((function(e){return e.path}))},s.prototype.nodes=function(e,t,r){if(n.ok(e instanceof Object,"obj needs to be an object"),n.ok(t,"we need a path"),0===r)return[];var i=this.parser.parse(t),a=this.handlers,o=[{path:["$"],value:e}],s=[];return i.length&&"root"==i[0].expression.type&&i.shift(),i.length?(i.forEach((function(e,t){if(!(s.length>=r)){var n=a.resolve(e),l=[];o.forEach((function(a){if(!(s.length>=r)){var o=n(e,a,r);t==i.length-1?s=s.concat(o||[]):l=l.concat(o||[])}})),o=l}})),r?s.slice(0,r):s):o},s.prototype.stringify=function(e){n.ok(e,"we need a path");var t="$",r={"descendant-member":"..{{value}}","child-member":".{{value}}","descendant-subscript":"..[{{value}}]","child-subscript":"[{{value}}]"};return(e=this._normalize(e)).forEach((function(e){if("root"!=e.expression.type){var n,i=[e.scope,e.operation].join("-"),a=r[i];if(n="string_literal"==e.expression.type?JSON.stringify(e.expression.value):e.expression.value,!a)throw new Error("couldn't find template "+i);t+=a.replace(/{{value}}/,n)}})),t},s.prototype._normalize=function(e){if(n.ok(e,"we need a path"),"string"==typeof e)return this.parser.parse(e);if(Array.isArray(e)&&"string"==typeof e[0]){var t=[{expression:{type:"root",value:"$"}}];return e.forEach((function(e,r){if("$"!=e||0!==r)if("string"==typeof e&&e.match("^"+i.identifier+"$"))t.push({operation:"member",scope:"child",expression:{value:e,type:"identifier"}});else{var n="number"==typeof e?"numeric_literal":"string_literal";t.push({operation:"subscript",scope:"child",expression:{value:e,type:n}})}})),t}if(Array.isArray(e)&&"object"==typeof e[0])return e;throw new Error("couldn't understand path "+e)},s.Handlers=o,s.Parser=a;var c=new s;c.JSONPath=s,t.exports=c},{"./dict":2,"./handlers":4,"./parser":6,assert:8}],6:[function(e,t,r){var n=e("./grammar"),i=e("../generated/parser"),a=function(){var e=new i.Parser,t=e.parseError;return e.yy.parseError=function(){e.yy.ast&&e.yy.ast.initialize(),t.apply(e,arguments)},e};a.grammar=n,t.exports=a},{"../generated/parser":1,"./grammar":3}],7:[function(e,t,r){function n(e){return String(e).match(/^[0-9]+$/)?parseInt(e):Number.isFinite(e)?parseInt(e,10):0}t.exports=function(e,t,r,i){if("string"==typeof t)throw new Error("start cannot be a string");if("string"==typeof r)throw new Error("end cannot be a string");if("string"==typeof i)throw new Error("step cannot be a string");var a=e.length;if(0===i)throw new Error("step cannot be zero");if(i=i?n(i):1,r=r<0?a+r:r,t=n(0===(t=t<0?a+t:t)?0:t||(i>0?0:a-1)),r=n(0===r?0:r||(i>0?a:-1)),t=i>0?Math.max(0,t):Math.min(a,t),r=i>0?Math.min(r,a):Math.max(-1,r),i>0&&r<=t)return[];if(i<0&&t<=r)return[];for(var o=[],s=t;s!=r&&!(i<0&&s<=r||i>0&&s>=r);s+=i)o.push(e[s]);return o}},{}],8:[function(e,t,r){var n=e("util/"),i=Array.prototype.slice,a=Object.prototype.hasOwnProperty,o=t.exports=u;function s(e,t){return n.isUndefined(t)?""+t:n.isNumber(t)&&!isFinite(t)||n.isFunction(t)||n.isRegExp(t)?t.toString():t}function l(e,t){return n.isString(e)?e.length<t?e:e.slice(0,t):e}function c(e,t,r,n,i){throw new o.AssertionError({message:r,actual:e,expected:t,operator:n,stackStartFunction:i})}function u(e,t){e||c(e,!0,t,"==",o.ok)}function p(e,t){if(e===t)return!0;if(n.isBuffer(e)&&n.isBuffer(t)){if(e.length!=t.length)return!1;for(var r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}return n.isDate(e)&&n.isDate(t)?e.getTime()===t.getTime():n.isRegExp(e)&&n.isRegExp(t)?e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase:n.isObject(e)||n.isObject(t)?function(e,t){if(n.isNullOrUndefined(e)||n.isNullOrUndefined(t))return!1;if(e.prototype!==t.prototype)return!1;if(n.isPrimitive(e)||n.isPrimitive(t))return e===t;var r=d(e),a=d(t);if(r&&!a||!r&&a)return!1;if(r)return p(e=i.call(e),t=i.call(t));var o,s,l=m(e),c=m(t);if(l.length!=c.length)return!1;for(l.sort(),c.sort(),s=l.length-1;s>=0;s--)if(l[s]!=c[s])return!1;for(s=l.length-1;s>=0;s--)if(!p(e[o=l[s]],t[o]))return!1;return!0}(e,t):e==t}function d(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function h(e,t){return!(!e||!t)&&("[object RegExp]"==Object.prototype.toString.call(t)?t.test(e):e instanceof t||!0===t.call({},e))}function f(e,t,r,i){var a;n.isString(r)&&(i=r,r=null);try{t()}catch(e){a=e}if(i=(r&&r.name?" ("+r.name+").":".")+(i?" "+i:"."),e&&!a&&c(a,r,"Missing expected exception"+i),!e&&h(a,r)&&c(a,r,"Got unwanted exception"+i),e&&a&&r&&!h(a,r)||!e&&a)throw a}o.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return l(JSON.stringify(e.actual,s),128)+" "+e.operator+" "+l(JSON.stringify(e.expected,s),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||c;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var n=r.stack,i=t.name,a=n.indexOf("\n"+i);if(a>=0){var o=n.indexOf("\n",a+1);n=n.substring(o+1)}this.stack=n}}},n.inherits(o.AssertionError,Error),o.fail=c,o.ok=u,o.equal=function(e,t,r){e!=t&&c(e,t,r,"==",o.equal)},o.notEqual=function(e,t,r){e==t&&c(e,t,r,"!=",o.notEqual)},o.deepEqual=function(e,t,r){p(e,t)||c(e,t,r,"deepEqual",o.deepEqual)},o.notDeepEqual=function(e,t,r){p(e,t)&&c(e,t,r,"notDeepEqual",o.notDeepEqual)},o.strictEqual=function(e,t,r){e!==t&&c(e,t,r,"===",o.strictEqual)},o.notStrictEqual=function(e,t,r){e===t&&c(e,t,r,"!==",o.notStrictEqual)},o.throws=function(e,t,r){f.apply(this,[!0].concat(i.call(arguments)))},o.doesNotThrow=function(e,t){f.apply(this,[!1].concat(i.call(arguments)))},o.ifError=function(e){if(e)throw e};var m=Object.keys||function(e){var t=[];for(var r in e)a.call(e,r)&&t.push(r);return t}},{"util/":11}],9:[function(e,t,r){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},{}],10:[function(e,t,r){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],11:[function(e,t,n){(function(t,r){var i=/%[sdj%]/g;n.format=function(e){if(!y(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(s(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,a=n.length,o=String(e).replace(i,(function(e){if("%%"===e)return"%";if(r>=a)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),l=n[r];r<a;l=n[++r])m(l)||!v(l)?o+=" "+l:o+=" "+s(l);return o},n.deprecate=function(e,i){if(_(r.process))return function(){return n.deprecate(e,i).apply(this,arguments)};if(!0===t.noDeprecation)return e;var a=!1;return function(){if(!a){if(t.throwDeprecation)throw new Error(i);t.traceDeprecation?console.trace(i):console.error(i),a=!0}return e.apply(this,arguments)}};var a,o={};function s(e,t){var r={seen:[],stylize:c};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),f(t)?r.showHidden=t:t&&n._extend(r,t),_(r.showHidden)&&(r.showHidden=!1),_(r.depth)&&(r.depth=2),_(r.colors)&&(r.colors=!1),_(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=l),u(r,e,r.depth)}function l(e,t){var r=s.styles[t];return r?"["+s.colors[r][0]+"m"+e+"["+s.colors[r][1]+"m":e}function c(e,t){return e}function u(e,t,r){if(e.customInspect&&t&&E(t.inspect)&&t.inspect!==n.inspect&&(!t.constructor||t.constructor.prototype!==t)){var i=t.inspect(r,e);return y(i)||(i=u(e,i,r)),i}var a=function(e,t){if(_(t))return e.stylize("undefined","undefined");if(y(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return g(t)?e.stylize(""+t,"number"):f(t)?e.stylize(""+t,"boolean"):m(t)?e.stylize("null","null"):void 0}(e,t);if(a)return a;var o=Object.keys(t),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),S(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return p(t);if(0===o.length){if(E(t)){var l=t.name?": "+t.name:"";return e.stylize("[Function"+l+"]","special")}if(b(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(w(t))return e.stylize(Date.prototype.toString.call(t),"date");if(S(t))return p(t)}var c,v="",x=!1,k=["{","}"];return h(t)&&(x=!0,k=["[","]"]),E(t)&&(v=" [Function"+(t.name?": "+t.name:"")+"]"),b(t)&&(v=" "+RegExp.prototype.toString.call(t)),w(t)&&(v=" "+Date.prototype.toUTCString.call(t)),S(t)&&(v=" "+p(t)),0!==o.length||x&&0!=t.length?r<0?b(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),c=x?function(e,t,r,n,i){for(var a=[],o=0,s=t.length;o<s;++o)I(t,String(o))?a.push(d(e,t,r,n,String(o),!0)):a.push("");return i.forEach((function(i){i.match(/^\d+$/)||a.push(d(e,t,r,n,i,!0))})),a}(e,t,r,s,o):o.map((function(n){return d(e,t,r,s,n,x)})),e.seen.pop(),function(e,t,r){return e.reduce((function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(c,v,k)):k[0]+v+k[1]}function p(e){return"["+Error.prototype.toString.call(e)+"]"}function d(e,t,r,n,i,a){var o,s,l;if((l=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(s=e.stylize("[Setter]","special")),I(n,i)||(o="["+i+"]"),s||(e.seen.indexOf(l.value)<0?(s=m(r)?u(e,l.value,null):u(e,l.value,r-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),_(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function h(e){return Array.isArray(e)}function f(e){return"boolean"==typeof e}function m(e){return null===e}function g(e){return"number"==typeof e}function y(e){return"string"==typeof e}function _(e){return void 0===e}function b(e){return v(e)&&"[object RegExp]"===x(e)}function v(e){return"object"==typeof e&&null!==e}function w(e){return v(e)&&"[object Date]"===x(e)}function S(e){return v(e)&&("[object Error]"===x(e)||e instanceof Error)}function E(e){return"function"==typeof e}function x(e){return Object.prototype.toString.call(e)}function k(e){return e<10?"0"+e.toString(10):e.toString(10)}n.debuglog=function(e){if(_(a)&&(a=t.env.NODE_DEBUG||""),e=e.toUpperCase(),!o[e])if(new RegExp("\\b"+e+"\\b","i").test(a)){var r=t.pid;o[e]=function(){var t=n.format.apply(n,arguments);console.error("%s %d: %s",e,r,t)}}else o[e]=function(){};return o[e]},n.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},n.isArray=h,n.isBoolean=f,n.isNull=m,n.isNullOrUndefined=function(e){return null==e},n.isNumber=g,n.isString=y,n.isSymbol=function(e){return"symbol"==typeof e},n.isUndefined=_,n.isRegExp=b,n.isObject=v,n.isDate=w,n.isError=S,n.isFunction=E,n.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},n.isBuffer=e("./support/isBuffer");var A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function I(e,t){return Object.prototype.hasOwnProperty.call(e,t)}n.log=function(){var e,t;console.log("%s - %s",(e=new Date,t=[k(e.getHours()),k(e.getMinutes()),k(e.getSeconds())].join(":"),[e.getDate(),A[e.getMonth()],t].join(" ")),n.format.apply(n,arguments))},n.inherits=e("inherits"),n._extend=function(e,t){if(!t||!v(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}}).call(this,e("_process"),void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":10,_process:14,inherits:9}],12:[function(e,t,r){},{}],13:[function(e,t,r){(function(e){function t(e,t){for(var r=0,n=e.length-1;n>=0;n--){var i=e[n];"."===i?e.splice(n,1):".."===i?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function n(e,t){if(e.filter)return e.filter(t);for(var r=[],n=0;n<e.length;n++)t(e[n],n,e)&&r.push(e[n]);return r}r.resolve=function(){for(var r="",i=!1,a=arguments.length-1;a>=-1&&!i;a--){var o=a>=0?arguments[a]:e.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(r=o+"/"+r,i="/"===o.charAt(0))}return(i?"/":"")+(r=t(n(r.split("/"),(function(e){return!!e})),!i).join("/"))||"."},r.normalize=function(e){var a=r.isAbsolute(e),o="/"===i(e,-1);return(e=t(n(e.split("/"),(function(e){return!!e})),!a).join("/"))||a||(e="."),e&&o&&(e+="/"),(a?"/":"")+e},r.isAbsolute=function(e){return"/"===e.charAt(0)},r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(n(e,(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},r.relative=function(e,t){function n(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=r.resolve(e).substr(1),t=r.resolve(t).substr(1);for(var i=n(e.split("/")),a=n(t.split("/")),o=Math.min(i.length,a.length),s=o,l=0;l<o;l++)if(i[l]!==a[l]){s=l;break}var c=[];for(l=s;l<i.length;l++)c.push("..");return(c=c.concat(a.slice(s))).join("/")},r.sep="/",r.delimiter=":",r.dirname=function(e){if("string"!=typeof e&&(e+=""),0===e.length)return".";for(var t=e.charCodeAt(0),r=47===t,n=-1,i=!0,a=e.length-1;a>=1;--a)if(47===(t=e.charCodeAt(a))){if(!i){n=a;break}}else i=!1;return-1===n?r?"/":".":r&&1===n?"/":e.slice(0,n)},r.basename=function(e,t){var r=function(e){"string"!=typeof e&&(e+="");var t,r=0,n=-1,i=!0;for(t=e.length-1;t>=0;--t)if(47===e.charCodeAt(t)){if(!i){r=t+1;break}}else-1===n&&(i=!1,n=t+1);return-1===n?"":e.slice(r,n)}(e);return t&&r.substr(-1*t.length)===t&&(r=r.substr(0,r.length-t.length)),r},r.extname=function(e){"string"!=typeof e&&(e+="");for(var t=-1,r=0,n=-1,i=!0,a=0,o=e.length-1;o>=0;--o){var s=e.charCodeAt(o);if(47!==s)-1===n&&(i=!1,n=o+1),46===s?-1===t?t=o:1!==a&&(a=1):-1!==t&&(a=-1);else if(!i){r=o+1;break}}return-1===t||-1===n||0===a||1===a&&t===n-1&&t===r+1?"":e.slice(t,n)};var i=function(e,t,r){return e.substr(t,r)}}).call(this,e("_process"))},{_process:14}],14:[function(e,t,r){var n,i,a=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function l(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(e){i=s}}();var c,u=[],p=!1,d=-1;function h(){p&&c&&(p=!1,c.length?u=c.concat(u):d=-1,u.length&&f())}function f(){if(!p){var e=l(h);p=!0;for(var t=u.length;t;){for(c=u,u=[];++d<t;)c&&c[d].run();d=-1,t=u.length}c=null,p=!1,function(e){if(i===clearTimeout)return clearTimeout(e);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{return i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function g(){}a.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new m(e,t)),1!==u.length||p||l(f)},m.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=g,a.addListener=g,a.once=g,a.off=g,a.removeListener=g,a.removeAllListeners=g,a.emit=g,a.prependListener=g,a.prependOnceListener=g,a.listeners=function(e){return[]},a.binding=function(e){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(e){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},{}],15:[function(e,t,r){var n=e("escodegen").generate;t.exports=function(e,t){t||(t={});var r={},i=function e(i,a){if("Literal"===i.type)return i.value;if("UnaryExpression"===i.type){var o=e(i.argument);return"+"===i.operator?+o:"-"===i.operator?-o:"~"===i.operator?~o:"!"===i.operator?!o:r}if("ArrayExpression"===i.type){for(var s=[],l=0,c=i.elements.length;l<c;l++){if((y=e(i.elements[l]))===r)return r;s.push(y)}return s}if("ObjectExpression"===i.type){var u={};for(l=0;l<i.properties.length;l++){var p=null===(_=i.properties[l]).value?_.value:e(_.value);if(p===r)return r;u[_.key.value||_.key.name]=p}return u}if("BinaryExpression"===i.type||"LogicalExpression"===i.type){if((c=e(i.left))===r)return r;var d=e(i.right);if(d===r)return r;var h=i.operator;return"=="===h?c==d:"==="===h?c===d:"!="===h?c!=d:"!=="===h?c!==d:"+"===h?c+d:"-"===h?c-d:"*"===h?c*d:"/"===h?c/d:"%"===h?c%d:"<"===h?c<d:"<="===h?c<=d:">"===h?c>d:">="===h?c>=d:"|"===h?c|d:"&"===h?c&d:"^"===h?c^d:"&&"===h?c&&d:"||"===h?c||d:r}if("Identifier"===i.type)return{}.hasOwnProperty.call(t,i.name)?t[i.name]:r;if("ThisExpression"===i.type)return{}.hasOwnProperty.call(t,"this")?t.this:r;if("CallExpression"===i.type){var f=e(i.callee);if(f===r)return r;if("function"!=typeof f)return r;var m=i.callee.object?e(i.callee.object):r;m===r&&(m=null);var g=[];for(l=0,c=i.arguments.length;l<c;l++){var y;if((y=e(i.arguments[l]))===r)return r;g.push(y)}return f.apply(m,g)}var _;if("MemberExpression"===i.type)return(u=e(i.object))===r||"function"==typeof u?r:"Identifier"===i.property.type?u[i.property.name]:(_=e(i.property))===r?r:u[_];if("ConditionalExpression"===i.type)return(o=e(i.test))===r?r:e(o?i.consequent:i.alternate);if("ExpressionStatement"===i.type)return(o=e(i.expression))===r?r:o;if("ReturnStatement"===i.type)return e(i.argument);if("FunctionExpression"===i.type){var b=i.body.body,v={};for(Object.keys(t).forEach((function(e){v[e]=t[e]})),l=0;l<i.params.length;l++){var w=i.params[l];if("Identifier"!=w.type)return r;t[w.name]=null}for(var l in b)if(e(b[l])===r)return r;t=v;var S=Object.keys(t),E=S.map((function(e){return t[e]}));return Function(S.join(", "),"return "+n(i)).apply(null,E)}if("TemplateLiteral"===i.type){var x="";for(l=0;l<i.expressions.length;l++)x+=e(i.quasis[l]),x+=e(i.expressions[l]);return x+e(i.quasis[l])}if("TaggedTemplateExpression"===i.type){var k=e(i.tag),A=i.quasi,I=A.quasis.map(e),j=A.expressions.map(e);return k.apply(null,[I].concat(j))}return"TemplateElement"===i.type?i.value.cooked:r}(e);return i===r?void 0:i}},{escodegen:12}],jsonpath:[function(e,t,r){t.exports=e("./lib/index")},{"./lib/index":5}]},{},["jsonpath"])("jsonpath")},631:(e,t,r)=>{var n="function"==typeof Map&&Map.prototype,i=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,a=n&&i&&"function"==typeof i.get?i.get:null,o=n&&Map.prototype.forEach,s="function"==typeof Set&&Set.prototype,l=Object.getOwnPropertyDescriptor&&s?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,c=s&&l&&"function"==typeof l.get?l.get:null,u=s&&Set.prototype.forEach,p="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,d="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,h="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,f=Boolean.prototype.valueOf,m=Object.prototype.toString,g=Function.prototype.toString,y=String.prototype.match,_=String.prototype.slice,b=String.prototype.replace,v=String.prototype.toUpperCase,w=String.prototype.toLowerCase,S=RegExp.prototype.test,E=Array.prototype.concat,x=Array.prototype.join,k=Array.prototype.slice,A=Math.floor,I="function"==typeof BigInt?BigInt.prototype.valueOf:null,j=Object.getOwnPropertySymbols,O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,P="function"==typeof Symbol&&"object"==typeof Symbol.iterator,T="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,C=Object.prototype.propertyIsEnumerable,N=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function L(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||S.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var n=e<0?-A(-e):A(e);if(n!==e){var i=String(n),a=_.call(t,i.length+1);return b.call(i,r,"$&_")+"."+b.call(b.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return b.call(t,r,"$&_")}var M=r(4654),F=M.custom,R=$(F)?F:null;function D(e,t,r){var n="double"===(r.quoteStyle||t)?'"':"'";return n+e+n}function q(e){return b.call(String(e),/"/g,"&quot;")}function U(e){return!("[object Array]"!==H(e)||T&&"object"==typeof e&&T in e)}function B(e){return!("[object RegExp]"!==H(e)||T&&"object"==typeof e&&T in e)}function $(e){if(P)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!O)return!1;try{return O.call(e),!0}catch(e){}return!1}e.exports=function e(t,n,i,s){var l=n||{};if(W(l,"quoteStyle")&&"single"!==l.quoteStyle&&"double"!==l.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(W(l,"maxStringLength")&&("number"==typeof l.maxStringLength?l.maxStringLength<0&&l.maxStringLength!==1/0:null!==l.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var m=!W(l,"customInspect")||l.customInspect;if("boolean"!=typeof m&&"symbol"!==m)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(W(l,"indent")&&null!==l.indent&&"\t"!==l.indent&&!(parseInt(l.indent,10)===l.indent&&l.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(W(l,"numericSeparator")&&"boolean"!=typeof l.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var v=l.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return z(t,l);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var S=String(t);return v?L(t,S):S}if("bigint"==typeof t){var A=String(t)+"n";return v?L(t,A):A}var j=void 0===l.depth?5:l.depth;if(void 0===i&&(i=0),i>=j&&j>0&&"object"==typeof t)return U(t)?"[Array]":"[Object]";var F,G=function(e,t){var r;if("\t"===e.indent)r="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;r=x.call(Array(e.indent+1)," ")}return{base:r,prev:x.call(Array(t+1),r)}}(l,i);if(void 0===s)s=[];else if(V(s,t)>=0)return"[Circular]";function J(t,r,n){if(r&&(s=k.call(s)).push(r),n){var a={depth:l.depth};return W(l,"quoteStyle")&&(a.quoteStyle=l.quoteStyle),e(t,a,i+1,s)}return e(t,l,i+1,s)}if("function"==typeof t&&!B(t)){var ee=function(e){if(e.name)return e.name;var t=y.call(g.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}(t),te=Z(t,J);return"[Function"+(ee?": "+ee:" (anonymous)")+"]"+(te.length>0?" { "+x.call(te,", ")+" }":"")}if($(t)){var re=P?b.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):O.call(t);return"object"!=typeof t||P?re:X(re)}if((F=t)&&"object"==typeof F&&("undefined"!=typeof HTMLElement&&F instanceof HTMLElement||"string"==typeof F.nodeName&&"function"==typeof F.getAttribute)){for(var ne="<"+w.call(String(t.nodeName)),ie=t.attributes||[],ae=0;ae<ie.length;ae++)ne+=" "+ie[ae].name+"="+D(q(ie[ae].value),"double",l);return ne+=">",t.childNodes&&t.childNodes.length&&(ne+="..."),ne+"</"+w.call(String(t.nodeName))+">"}if(U(t)){if(0===t.length)return"[]";var oe=Z(t,J);return G&&!function(e){for(var t=0;t<e.length;t++)if(V(e[t],"\n")>=0)return!1;return!0}(oe)?"["+K(oe,G)+"]":"[ "+x.call(oe,", ")+" ]"}if(function(e){return!("[object Error]"!==H(e)||T&&"object"==typeof e&&T in e)}(t)){var se=Z(t,J);return"cause"in Error.prototype||!("cause"in t)||C.call(t,"cause")?0===se.length?"["+String(t)+"]":"{ ["+String(t)+"] "+x.call(se,", ")+" }":"{ ["+String(t)+"] "+x.call(E.call("[cause]: "+J(t.cause),se),", ")+" }"}if("object"==typeof t&&m){if(R&&"function"==typeof t[R]&&M)return M(t,{depth:j-i});if("symbol"!==m&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!a||!e||"object"!=typeof e)return!1;try{a.call(e);try{c.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var le=[];return o&&o.call(t,(function(e,r){le.push(J(r,t,!0)+" => "+J(e,t))})),Y("Map",a.call(t),le,G)}if(function(e){if(!c||!e||"object"!=typeof e)return!1;try{c.call(e);try{a.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var ce=[];return u&&u.call(t,(function(e){ce.push(J(e,t))})),Y("Set",c.call(t),ce,G)}if(function(e){if(!p||!e||"object"!=typeof e)return!1;try{p.call(e,p);try{d.call(e,d)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return Q("WeakMap");if(function(e){if(!d||!e||"object"!=typeof e)return!1;try{d.call(e,d);try{p.call(e,p)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return Q("WeakSet");if(function(e){if(!h||!e||"object"!=typeof e)return!1;try{return h.call(e),!0}catch(e){}return!1}(t))return Q("WeakRef");if(function(e){return!("[object Number]"!==H(e)||T&&"object"==typeof e&&T in e)}(t))return X(J(Number(t)));if(function(e){if(!e||"object"!=typeof e||!I)return!1;try{return I.call(e),!0}catch(e){}return!1}(t))return X(J(I.call(t)));if(function(e){return!("[object Boolean]"!==H(e)||T&&"object"==typeof e&&T in e)}(t))return X(f.call(t));if(function(e){return!("[object String]"!==H(e)||T&&"object"==typeof e&&T in e)}(t))return X(J(String(t)));if("undefined"!=typeof window&&t===window)return"{ [object Window] }";if(t===r.g)return"{ [object globalThis] }";if(!function(e){return!("[object Date]"!==H(e)||T&&"object"==typeof e&&T in e)}(t)&&!B(t)){var ue=Z(t,J),pe=N?N(t)===Object.prototype:t instanceof Object||t.constructor===Object,de=t instanceof Object?"":"null prototype",he=!pe&&T&&Object(t)===t&&T in t?_.call(H(t),8,-1):de?"Object":"",fe=(pe||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(he||de?"["+x.call(E.call([],he||[],de||[]),": ")+"] ":"");return 0===ue.length?fe+"{}":G?fe+"{"+K(ue,G)+"}":fe+"{ "+x.call(ue,", ")+" }"}return String(t)};var G=Object.prototype.hasOwnProperty||function(e){return e in this};function W(e,t){return G.call(e,t)}function H(e){return m.call(e)}function V(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function z(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return z(_.call(e,0,t.maxStringLength),t)+n}return D(b.call(b.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,J),"single",t)}function J(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+v.call(t.toString(16))}function X(e){return"Object("+e+")"}function Q(e){return e+" { ? }"}function Y(e,t,r,n){return e+" ("+t+") {"+(n?K(r,n):x.call(r,", "))+"}"}function K(e,t){if(0===e.length)return"";var r="\n"+t.prev+t.base;return r+x.call(e,","+r)+"\n"+t.prev}function Z(e,t){var r=U(e),n=[];if(r){n.length=e.length;for(var i=0;i<e.length;i++)n[i]=W(e,i)?t(e[i],e):""}var a,o="function"==typeof j?j(e):[];if(P){a={};for(var s=0;s<o.length;s++)a["$"+o[s]]=o[s]}for(var l in e)W(e,l)&&(r&&String(Number(l))===l&&l<e.length||P&&a["$"+l]instanceof Symbol||(S.call(/[^\w$]/,l)?n.push(t(l,e)+": "+t(e[l],e)):n.push(l+": "+t(e[l],e))));if("function"==typeof j)for(var c=0;c<o.length;c++)C.call(e,o[c])&&n.push("["+t(o[c])+"]: "+t(e[o[c]],e));return n}},5798:e=>{"use strict";var t=String.prototype.replace,r=/%20/g,n="RFC3986";e.exports={default:n,formatters:{RFC1738:function(e){return t.call(e,r,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:n}},129:(e,t,r)=>{"use strict";var n=r(8261),i=r(5235),a=r(5798);e.exports={formats:a,parse:i,stringify:n}},5235:(e,t,r)=>{"use strict";var n=r(2769),i=Object.prototype.hasOwnProperty,a=Array.isArray,o={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:n.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},s=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},l=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},c=function(e,t,r,n){if(e){var a=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/g,s=r.depth>0&&/(\[[^[\]]*])/.exec(a),c=s?a.slice(0,s.index):a,u=[];if(c){if(!r.plainObjects&&i.call(Object.prototype,c)&&!r.allowPrototypes)return;u.push(c)}for(var p=0;r.depth>0&&null!==(s=o.exec(a))&&p<r.depth;){if(p+=1,!r.plainObjects&&i.call(Object.prototype,s[1].slice(1,-1))&&!r.allowPrototypes)return;u.push(s[1])}return s&&u.push("["+a.slice(s.index)+"]"),function(e,t,r,n){for(var i=n?t:l(t,r),a=e.length-1;a>=0;--a){var o,s=e[a];if("[]"===s&&r.parseArrays)o=[].concat(i);else{o=r.plainObjects?Object.create(null):{};var c="["===s.charAt(0)&&"]"===s.charAt(s.length-1)?s.slice(1,-1):s,u=parseInt(c,10);r.parseArrays||""!==c?!isNaN(u)&&s!==c&&String(u)===c&&u>=0&&r.parseArrays&&u<=r.arrayLimit?(o=[])[u]=i:"__proto__"!==c&&(o[c]=i):o={0:i}}i=o}return i}(u,t,r,n)}};e.exports=function(e,t){var r=function(e){if(!e)return o;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?o.charset:e.charset;return{allowDots:void 0===e.allowDots?o.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:o.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:o.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:o.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:o.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:o.comma,decoder:"function"==typeof e.decoder?e.decoder:o.decoder,delimiter:"string"==typeof e.delimiter||n.isRegExp(e.delimiter)?e.delimiter:o.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:o.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:o.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:o.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:o.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:o.strictNullHandling}}(t);if(""===e||null==e)return r.plainObjects?Object.create(null):{};for(var u="string"==typeof e?function(e,t){var r,c={__proto__:null},u=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,p=t.parameterLimit===1/0?void 0:t.parameterLimit,d=u.split(t.delimiter,p),h=-1,f=t.charset;if(t.charsetSentinel)for(r=0;r<d.length;++r)0===d[r].indexOf("utf8=")&&("utf8=%E2%9C%93"===d[r]?f="utf-8":"utf8=%26%2310003%3B"===d[r]&&(f="iso-8859-1"),h=r,r=d.length);for(r=0;r<d.length;++r)if(r!==h){var m,g,y=d[r],_=y.indexOf("]="),b=-1===_?y.indexOf("="):_+1;-1===b?(m=t.decoder(y,o.decoder,f,"key"),g=t.strictNullHandling?null:""):(m=t.decoder(y.slice(0,b),o.decoder,f,"key"),g=n.maybeMap(l(y.slice(b+1),t),(function(e){return t.decoder(e,o.decoder,f,"value")}))),g&&t.interpretNumericEntities&&"iso-8859-1"===f&&(g=s(g)),y.indexOf("[]=")>-1&&(g=a(g)?[g]:g),i.call(c,m)?c[m]=n.combine(c[m],g):c[m]=g}return c}(e,r):e,p=r.plainObjects?Object.create(null):{},d=Object.keys(u),h=0;h<d.length;++h){var f=d[h],m=c(f,u[f],r,"string"==typeof e);p=n.merge(p,m,r)}return!0===r.allowSparse?p:n.compact(p)}},8261:(e,t,r)=>{"use strict";var n=r(7478),i=r(2769),a=r(5798),o=Object.prototype.hasOwnProperty,s={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},l=Array.isArray,c=Array.prototype.push,u=function(e,t){c.apply(e,l(t)?t:[t])},p=Date.prototype.toISOString,d=a.default,h={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:i.encode,encodeValuesOnly:!1,format:d,formatter:a.formatters[d],indices:!1,serializeDate:function(e){return p.call(e)},skipNulls:!1,strictNullHandling:!1},f={},m=function e(t,r,a,o,s,c,p,d,m,g,y,_,b,v,w,S){for(var E,x=t,k=S,A=0,I=!1;void 0!==(k=k.get(f))&&!I;){var j=k.get(t);if(A+=1,void 0!==j){if(j===A)throw new RangeError("Cyclic object value");I=!0}void 0===k.get(f)&&(A=0)}if("function"==typeof d?x=d(r,x):x instanceof Date?x=y(x):"comma"===a&&l(x)&&(x=i.maybeMap(x,(function(e){return e instanceof Date?y(e):e}))),null===x){if(s)return p&&!v?p(r,h.encoder,w,"key",_):r;x=""}if("string"==typeof(E=x)||"number"==typeof E||"boolean"==typeof E||"symbol"==typeof E||"bigint"==typeof E||i.isBuffer(x))return p?[b(v?r:p(r,h.encoder,w,"key",_))+"="+b(p(x,h.encoder,w,"value",_))]:[b(r)+"="+b(String(x))];var O,P=[];if(void 0===x)return P;if("comma"===a&&l(x))v&&p&&(x=i.maybeMap(x,p)),O=[{value:x.length>0?x.join(",")||null:void 0}];else if(l(d))O=d;else{var T=Object.keys(x);O=m?T.sort(m):T}for(var C=o&&l(x)&&1===x.length?r+"[]":r,N=0;N<O.length;++N){var L=O[N],M="object"==typeof L&&void 0!==L.value?L.value:x[L];if(!c||null!==M){var F=l(x)?"function"==typeof a?a(C,L):C:C+(g?"."+L:"["+L+"]");S.set(t,A);var R=n();R.set(f,S),u(P,e(M,F,a,o,s,c,"comma"===a&&v&&l(x)?null:p,d,m,g,y,_,b,v,w,R))}}return P};e.exports=function(e,t){var r,i=e,c=function(e){if(!e)return h;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||h.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=a.default;if(void 0!==e.format){if(!o.call(a.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var n=a.formatters[r],i=h.filter;return("function"==typeof e.filter||l(e.filter))&&(i=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:h.addQueryPrefix,allowDots:void 0===e.allowDots?h.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:h.charsetSentinel,delimiter:void 0===e.delimiter?h.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:h.encode,encoder:"function"==typeof e.encoder?e.encoder:h.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:h.encodeValuesOnly,filter:i,format:r,formatter:n,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:h.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:h.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:h.strictNullHandling}}(t);"function"==typeof c.filter?i=(0,c.filter)("",i):l(c.filter)&&(r=c.filter);var p,d=[];if("object"!=typeof i||null===i)return"";p=t&&t.arrayFormat in s?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var f=s[p];if(t&&"commaRoundTrip"in t&&"boolean"!=typeof t.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var g="comma"===f&&t&&t.commaRoundTrip;r||(r=Object.keys(i)),c.sort&&r.sort(c.sort);for(var y=n(),_=0;_<r.length;++_){var b=r[_];c.skipNulls&&null===i[b]||u(d,m(i[b],b,f,g,c.strictNullHandling,c.skipNulls,c.encode?c.encoder:null,c.filter,c.sort,c.allowDots,c.serializeDate,c.format,c.formatter,c.encodeValuesOnly,c.charset,y))}var v=d.join(c.delimiter),w=!0===c.addQueryPrefix?"?":"";return c.charsetSentinel&&("iso-8859-1"===c.charset?w+="utf8=%26%2310003%3B&":w+="utf8=%E2%9C%93&"),v.length>0?w+v:""}},2769:(e,t,r)=>{"use strict";var n=r(5798),i=Object.prototype.hasOwnProperty,a=Array.isArray,o=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),s=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},n=0;n<e.length;++n)void 0!==e[n]&&(r[n]=e[n]);return r};e.exports={arrayToObject:s,assign:function(e,t){return Object.keys(t).reduce((function(e,r){return e[r]=t[r],e}),e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],n=0;n<t.length;++n)for(var i=t[n],o=i.obj[i.prop],s=Object.keys(o),l=0;l<s.length;++l){var c=s[l],u=o[c];"object"==typeof u&&null!==u&&-1===r.indexOf(u)&&(t.push({obj:o,prop:c}),r.push(u))}return function(e){for(;e.length>1;){var t=e.pop(),r=t.obj[t.prop];if(a(r)){for(var n=[],i=0;i<r.length;++i)void 0!==r[i]&&n.push(r[i]);t.obj[t.prop]=n}}}(t),e},decode:function(e,t,r){var n=e.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(e){return n}},encode:function(e,t,r,i,a){if(0===e.length)return e;var s=e;if("symbol"==typeof e?s=Symbol.prototype.toString.call(e):"string"!=typeof e&&(s=String(e)),"iso-8859-1"===r)return escape(s).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var l="",c=0;c<s.length;++c){var u=s.charCodeAt(c);45===u||46===u||95===u||126===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||a===n.RFC1738&&(40===u||41===u)?l+=s.charAt(c):u<128?l+=o[u]:u<2048?l+=o[192|u>>6]+o[128|63&u]:u<55296||u>=57344?l+=o[224|u>>12]+o[128|u>>6&63]+o[128|63&u]:(c+=1,u=65536+((1023&u)<<10|1023&s.charCodeAt(c)),l+=o[240|u>>18]+o[128|u>>12&63]+o[128|u>>6&63]+o[128|63&u])}return l},isBuffer:function(e){return!(!e||"object"!=typeof e||!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e)))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(a(e)){for(var r=[],n=0;n<e.length;n+=1)r.push(t(e[n]));return r}return t(e)},merge:function e(t,r,n){if(!r)return t;if("object"!=typeof r){if(a(t))t.push(r);else{if(!t||"object"!=typeof t)return[t,r];(n&&(n.plainObjects||n.allowPrototypes)||!i.call(Object.prototype,r))&&(t[r]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(r);var o=t;return a(t)&&!a(r)&&(o=s(t,n)),a(t)&&a(r)?(r.forEach((function(r,a){if(i.call(t,a)){var o=t[a];o&&"object"==typeof o&&r&&"object"==typeof r?t[a]=e(o,r,n):t.push(r)}else t[a]=r})),t):Object.keys(r).reduce((function(t,a){var o=r[a];return i.call(t,a)?t[a]=e(t[a],o,n):t[a]=o,t}),o)}}},5666:e=>{var t=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function u(e,t,r,n){var a=t&&t.prototype instanceof y?t:y,o=Object.create(a.prototype),s=new P(n||[]);return i(o,"_invoke",{value:A(e,r,s)}),o}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var d="suspendedStart",h="suspendedYield",f="executing",m="completed",g={};function y(){}function _(){}function b(){}var v={};c(v,o,(function(){return this}));var w=Object.getPrototypeOf,S=w&&w(w(T([])));S&&S!==r&&n.call(S,o)&&(v=S);var E=b.prototype=y.prototype=Object.create(v);function x(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function r(i,a,o,s){var l=p(e[i],e,a);if("throw"!==l.type){var c=l.arg,u=c.value;return u&&"object"==typeof u&&n.call(u,"__await")?t.resolve(u.__await).then((function(e){r("next",e,o,s)}),(function(e){r("throw",e,o,s)})):t.resolve(u).then((function(e){c.value=e,o(c)}),(function(e){return r("throw",e,o,s)}))}s(l.arg)}var a;i(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,i){r(e,n,t,i)}))}return a=a?a.then(i,i):i()}})}function A(e,t,r){var n=d;return function(i,a){if(n===f)throw new Error("Generator is already running");if(n===m){if("throw"===i)throw a;return C()}for(r.method=i,r.arg=a;;){var o=r.delegate;if(o){var s=I(o,r);if(s){if(s===g)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===d)throw n=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=f;var l=p(e,t,r);if("normal"===l.type){if(n=r.done?m:h,l.arg===g)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n=m,r.method="throw",r.arg=l.arg)}}}function I(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,I(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=p(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,g;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function T(e){if(e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}return{next:C}}function C(){return{value:t,done:!0}}return _.prototype=b,i(E,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:_,configurable:!0}),_.displayName=c(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===_||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,c(e,l,"GeneratorFunction")),e.prototype=Object.create(E),e},e.awrap=function(e){return{__await:e}},x(k.prototype),c(k.prototype,s,(function(){return this})),e.AsyncIterator=k,e.async=function(t,r,n,i,a){void 0===a&&(a=Promise);var o=new k(u(t,r,n,i),a);return e.isGeneratorFunction(r)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},x(E),c(E,l,"Generator"),c(E,o,(function(){return this})),c(E,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=T,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(O),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var l=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(l&&c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;O(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},7771:(e,t,r)=>{"use strict";var n=r(210),i=r(2296),a=r(1044)(),o=r(7296),s=r(4453),l=n("%Math.floor%");e.exports=function(e,t){if("function"!=typeof e)throw new s("`fn` is not a function");if("number"!=typeof t||t<0||t>4294967295||l(t)!==t)throw new s("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,c=!0;if("length"in e&&o){var u=o(e,"length");u&&!u.configurable&&(n=!1),u&&!u.writable&&(c=!1)}return(n||c||!r)&&(a?i(e,"length",t,!0,!0):i(e,"length",t)),e}},7478:(e,t,r)=>{"use strict";var n=r(210),i=r(1924),a=r(631),o=r(4453),s=n("%WeakMap%",!0),l=n("%Map%",!0),c=i("WeakMap.prototype.get",!0),u=i("WeakMap.prototype.set",!0),p=i("WeakMap.prototype.has",!0),d=i("Map.prototype.get",!0),h=i("Map.prototype.set",!0),f=i("Map.prototype.has",!0),m=function(e,t){for(var r,n=e;null!==(r=n.next);n=r)if(r.key===t)return n.next=r.next,r.next=e.next,e.next=r,r};e.exports=function(){var e,t,r,n={assert:function(e){if(!n.has(e))throw new o("Side channel does not contain "+a(e))},get:function(n){if(s&&n&&("object"==typeof n||"function"==typeof n)){if(e)return c(e,n)}else if(l){if(t)return d(t,n)}else if(r)return function(e,t){var r=m(e,t);return r&&r.value}(r,n)},has:function(n){if(s&&n&&("object"==typeof n||"function"==typeof n)){if(e)return p(e,n)}else if(l){if(t)return f(t,n)}else if(r)return function(e,t){return!!m(e,t)}(r,n);return!1},set:function(n,i){s&&n&&("object"==typeof n||"function"==typeof n)?(e||(e=new s),u(e,n,i)):l?(t||(t=new l),h(t,n,i)):(r||(r={key:{},next:null}),function(e,t,r){var n=m(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}}(r,n,i))}};return n}},7026:e=>{"use strict";e.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},4654:()=>{},4836:e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},8698:e=>{function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},960:(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>createAngularModuleInstance});var axios__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(9669),_consts_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(738);let $q={when:function(e){return new Promise((t=>{t(e)}))}},factoryReturns={},angular={module:()=>angular,directive:()=>angular,factory(e,t){try{factoryReturns[e]="object"==typeof t?t[t.length-1]($q):t($q)}catch(t){console.log("Errror in data type: ",e),console.log(t)}return angular},service:()=>angular,run:()=>angular,filter:()=>angular,controller:()=>angular,value:()=>angular,element:()=>angular,injector:()=>angular,invoke:()=>angular};async function createAngularModuleInstance(gudhub,module_id,module_url,angularInjector,nodeWindow){try{let angularModule,importedClass;if(_consts_js__WEBPACK_IMPORTED_MODULE_1__.P)if(window.angular){angularInjector.has(module_id)||await angularInjector.get("$ocLazyLoad").load(module_url),angularModule=await angularInjector.get(module_id);let module=await axios__WEBPACK_IMPORTED_MODULE_0__.get(module_url);module=module.data;try{eval(module)}catch(e){console.error(`ERROR WHILE EVAL() IN GHCONSTRUCTOR. MODULE ID: ${module_id}`),console.log(e)}importedClass=factoryReturns[module_id]}else{let module=await axios__WEBPACK_IMPORTED_MODULE_0__.get(module_url);module=module.data;try{eval(module)}catch(e){console.log(`Error while importing module: ${module_id}`),console.log(e)}importedClass=factoryReturns[module_id]}else{const e=new Proxy(nodeWindow,{get:(e,t)=>e[t],set:(e,t,r)=>(e[t]=r,global[t]=r,!0)});global.hasOwnProperty("window")||(global.window=e,global.document=nodeWindow.document,global.Element=nodeWindow.Element,global.CharacterData=nodeWindow.CharacterData,global.this=e,global.self=e,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=e=>!1,global.angular=angular);let t=await axios__WEBPACK_IMPORTED_MODULE_0__.get(module_url),r=t.data,n=encodeURIComponent(r),i;n="data:text/javascript;charset=utf-8,"+n;try{i=await import(n)}catch(e){console.log(`Error while importing module: ${module_id}`),console.log(e)}importedClass=new i.default}let result={type:module_id,getTemplate:function(e,t,r,n,i,a){let o="false"!==r;return importedClass.getTemplate(e,t,o,n,i,a)},getDefaultValue:function(e,t,r,n){return new Promise((async i=>{let a=importedClass.getDefaultValue;i(a?await a(e,t,r,n):null)}))},getSettings:function(e,t,r){return importedClass.getSettings(e,t,r)},filter:{getSearchOptions:function(e){let t=importedClass;return t.filter&&t.filter.getSearchOptions?importedClass.filter.getSearchOptions(e)||null:[]},getDropdownValues:function(){let e=importedClass;return e.filter&&e.filter.getDropdownValues?e.filter.getDropdownValues()||null:[]}},getInterpretation:function(e,t,r,n,i,a){return new Promise((async o=>{let s=importedClass;try{let l=await s.getInterpretation(gudhub,e,a,i,n,r),c=l.find((e=>e.id==t))||l.find((e=>"default"==e.id));o({html:await c.content()})}catch(e){console.log(`ERROR IN ${module_id}`,e),o({html:"<span>no interpretation</span>"})}}))},getInterpretationsList:function(e,t,r,n){return importedClass.getInterpretation(e,t,r,n)},getInterpretatedValue:function(e,t,r,n){return new Promise((async i=>{let a=importedClass.getInterpretatedValue;i(a?await a(e,t,r,n):e)}))},onMessage:function(e,t,r){return new Promise((async n=>{const i=importedClass.onMessage;i&&n(await i(e,t,r)),n(null)}))}};return _consts_js__WEBPACK_IMPORTED_MODULE_1__.P&&(result.extendController=function(e){angularModule.getActionScope(e)},result.runAction=function(e){try{angularModule.runAction(e)}catch(e){}},result.getWindowScope=function(e){return angularModule.getWindowScope(e)},result.getWindowHTML=function(e){return angularModule.getWindowHTML(e)}),result}catch(e){console.log(e),console.log(`Failed in createAngularModuleInstance (ghconstructor). Module id: ${module_id}.`)}}},738:(e,t,r)=>{"use strict";r.d(t,{P:()=>n});const n=![typeof window,typeof document].includes("undefined")},8593:e=>{"use strict";e.exports=JSON.parse('{"name":"axios","version":"0.21.4","description":"Promise based HTTP client for the browser and node.js","main":"index.js","scripts":{"test":"grunt test","start":"node ./sandbox/server.js","build":"NODE_ENV=production grunt build","preversion":"npm test","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json","postversion":"git push && git push --tags","examples":"node ./examples/server.js","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","fix":"eslint --fix lib/**/*.js"},"repository":{"type":"git","url":"https://github.com/axios/axios.git"},"keywords":["xhr","http","ajax","promise","node"],"author":"Matt Zabriskie","license":"MIT","bugs":{"url":"https://github.com/axios/axios/issues"},"homepage":"https://axios-http.com","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"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"jsdelivr":"dist/axios.min.js","unpkg":"dist/axios.min.js","typings":"./index.d.ts","dependencies":{"follow-redirects":"^1.14.0"},"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}]}')}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](r,r.exports,__webpack_require__),r.exports}__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};return(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{GudHub:()=>dt,default:()=>ht}),__webpack_require__(5666);var e=__webpack_require__(9669);function t(e=[]){return e.filter((e=>null!=e.field_value))}var r=__webpack_require__(129);class n{constructor(e){this.root=e,this.requestPromises=[]}init(e){this.getToken=e}async get(t){const r=await this.getToken(),n=this.getHashCode(t);if(this.requestPromises[n])return this.requestPromises[n].promise;const i=new Promise(((n,i)=>{let a;t.externalResource?a=t.url:(a=this.root+t.url,a=`${a}${/\?/.test(a)?"&":"?"}token=${r}${function(e={}){const t=Object.entries(e);return t.length?`&${t.map((([e,t])=>`${e}=${t}`)).join("&")}`:""}(t.params)}`),e.get(a,{validateStatus:function(e){return e<400}}).then((function(e){200!=e.status&&console.error(`GUDHUB HTTP SERVICE: GET ERROR: ${e.status}`,e),n(e.data)})).catch((function(e){console.error(`GUDHUB HTTP SERVICE: GET ERROR: ${e.response.status}\n`,e),console.log("Request message: ",t),e.response&&e.response.data&&console.log("Error response data: ",e.response.data),i(e)}))}));return this.pushPromise(i,n),i}async post(t){const n=this.getHashCode(t);if(t.form.token=await this.getToken(),this.requestPromises[n])return this.requestPromises[n].promise;const i=new Promise(((n,i)=>{e.post(this.root+t.url,r.stringify(t.form),{maxBodyLength:1/0,headers:t.headers||{"Content-Type":"application/x-www-form-urlencoded"},validateStatus:function(e){return e<400}}).then((function(e){200!=e.status&&console.error(`GUDHUB HTTP SERVICE: POST ERROR: ${e.status}`,e),n(e.data)})).catch((function(e){console.error(`GUDHUB HTTP SERVICE: POST ERROR: ${e.response.status}\n`,e),console.log("Request message: ",t),i(e)}))}));return this.pushPromise(i,n),i}axiosRequest(t){const n=this.getHashCode(t);if(this.requestPromises[n])return this.requestPromises[n].promise;let i=t.method?t.method.toLowerCase():"get",a=t.url,o=t.headers||{};t.form&&(o["Content-Type"]="application/x-www-form-urlencoded");const s=new Promise((async(n,s)=>{try{const{data:s}=await e[i](a,"post"===i?r.stringify(t.form)||t.body:{headers:o},"post"===i?{headers:o}:{});n(s)}catch(e){console.log("ERROR -> GUDHUB HTTP SERVICE -> SIMPLE POST :",e.message),console.log("Request message: ",t),s(e)}}));return this.pushPromise(s,n),s}pushPromise(e,t){this.requestPromises[t]={promise:e,hesh:t,callback:e.then((()=>{this.destroyPromise(t)})).catch((e=>{this.destroyPromise(t)}))}}destroyPromise(e){this.requestPromises=this.requestPromises.filter((t=>t.hesh!==e))}getHashCode(e){let t=0,n=r.stringify(e);if(0==n.length)return t;for(let e=0;e<n.length;e++)t=(t<<5)-t+n.charCodeAt(e),t&=t;return"h"+t}}function i(e){let t="";for(let r in e)e.hasOwnProperty(r)&&e[r]&&(t+="."+e[r]);return t?t.substring(1):"any"}class a{constructor(){this.subscribers={},this.messageBox={}}on(e,t,r){return function(e,t,r){return null==e||"string"!=typeof e?(console.log("Listener type is \"undefined\" or not have actual 'type' for subscribe"),!1):null==t||"object"!=typeof t?(console.log("Listener destination is \"undefined\" or not have actual 'type' for subscribe"),!1):"function"==typeof r||(console.log("Listener is not a function for subscribe!"),!1)}(e,t,r)&&e.split(" ").map((e=>e+":"+i(t))).forEach((e=>{this.subscribers[e]||(this.subscribers[e]=new Set),this.subscribers[e].add(r),this.checkMessageBox(e)})),this}emit(e,t,r,n){return e.split(" ").forEach((a=>{const o=a+":"+i(t);if(this.subscribers[o]){if(0==this.subscribers[o].size)return this.messageBox[o]=[e,t,r,n,!1],this;this.subscribers[o].forEach((function(e){e(null,r,n)}))}else this.messageBox[o]=[e,t,r,n,!1]})),this}onRoot(e,t,r){return this.on(e,t,r)}destroy(e,t,r){return e.split(" ").forEach((e=>{const n=e+":"+i(t);this.subscribers[n]&&r&&this.subscribers[n].delete(r),this.subscribers[n]&&!r&&delete this.subscribers[n]})),this}checkMessageBox(e){this.cleanMesssageBox(),this.messageBox[e]&&setTimeout((()=>{this.messageBox[e]&&(this.emit(...this.messageBox[e]),this.messageBox[e][4]=!0)}),0)}cleanMesssageBox(){for(let e in this.messageBox)this.messageBox[e][4]&&delete this.messageBox[e]}}class o{constructor(e,t,r){this.apps_list=[],this.users_list=[],this.user={},this.modulesList=function(e,t,r){return[{data_type:"text",name:"Text",icon:"text_icon",url:t+"/"+e+"text_data.js",type:"gh_element",technology:"angular"},{data_type:"text_opt",name:"Options",icon:"option_gh_element",url:t+"/"+e+"text_options_data.js",type:"gh_element",technology:"angular"},{data_type:"number",name:"Number",icon:"number",url:t+"/"+e+"number_data.js",type:"gh_element",technology:"angular"},{data_type:"task_board",name:"Task Board",icon:"task_board",url:t+"/"+e+"task_board_data.js",type:"gh_element",technology:"angular"},{data_type:"visualizer",name:"visualizer",icon:"visualizer",url:t+"/"+e+"visualizer_data.js",type:"gh_element",technology:"angular"},{data_type:"enterprice_visualizer",name:"Enterprice Visualizer",icon:"visualizer",private:!0,url:t+"/"+e+"enterprice_visualizer_data.js",type:"gh_element",technology:"angular"},{data_type:"email",name:"Email",icon:"email",url:t+"/"+e+"email_data.js",type:"gh_element",technology:"angular"},{data_type:"date",name:"Date",icon:"date_gh_element",url:t+"/"+e+"date_data.js",type:"gh_element",technology:"angular"},{data_type:"radio_button",name:"Radio Button",icon:"radio_button_gh_element",url:t+"/"+e+"radio_button_data.js",type:"gh_element",technology:"angular"},{data_type:"radio_icon",name:"Radio icon",icon:"radio_icon_gh_element",url:t+"/"+e+"radio_icon_data.js",type:"gh_element",technology:"angular"},{data_type:"twilio_phone",name:"Twilio Phone",icon:"phone_twilio_gh_element",url:t+"/"+e+"twilio_phone_data.js",type:"gh_element",technology:"angular"},{data_type:"twilio_autodialer",name:"Twilio Auto Dialer",icon:"twilio_dialer",url:t+"/"+e+"twillio_autodialer_data.js",type:"gh_element",technology:"angular"},{data_type:"color",name:"Color",icon:"paint_gh_element",url:t+"/"+e+"color_data.js",type:"gh_element",technology:"angular"},{data_type:"charts",name:"Charts",icon:"graph_gh_element",url:t+"/"+e+"charts_data.js",type:"gh_element",technology:"angular"},{data_type:"funnel_chart",name:"Funnel chart",icon:"funnel_chart_gh_element",url:t+"/"+e+"funnel_chart_data.js",type:"gh_element",technology:"angular"},{data_type:"add_items_from_template",name:"Add items from template",icon:"contact_second",url:t+"/"+e+"add_items_from_template_data.js",type:"gh_element",technology:"angular"},{data_type:"item_ref",name:"Reference",icon:"reference",url:t+"/"+e+"itemRef_data.js",type:"gh_element",technology:"angular"},{data_type:"calendar",name:"Calendar",icon:"calendar",js:"https://gudhub.com/modules/FullCalendar-Gh-Element/dist/main.js?t=4",css:"https://gudhub.com/modules/FullCalendar-Gh-Element/dist/style.css?t=1",type:"gh_element",technology:"class"},{data_type:"data_ref",name:"Data Reference",icon:"data_reference",url:t+"/"+e+"data_ref_data.js",type:"gh_element",technology:"angular"},{data_type:"table",name:"Table",icon:"table",url:t+"/"+e+"table_data.js",type:"gh_element",technology:"angular"},{data_type:"tile",name:"Tile table",icon:"tile_table",url:t+"/"+e+"tile_data.js",type:"gh_element",technology:"angular"},{data_type:"file",name:"File",icon:"box",url:t+"/"+e+"file_data.js",type:"gh_element",technology:"angular"},{data_type:"image",name:"Image",icon:"image",url:t+"/"+e+"image_data.js",type:"gh_element",technology:"angular"},{data_type:"text_editor",name:"Text Editor",icon:"square",url:t+"/"+e+"text_editor_data.js",type:"gh_element",technology:"angular"},{data_type:"tinymse",name:"Text editor MSE",icon:"tag",url:t+"/"+e+"tinymse_data.js",type:"gh_element",technology:"angular"},{data_type:"duration",name:"Duration",icon:"number_gh_element",url:t+"/"+e+"duration_data.js",type:"gh_element",technology:"angular"},{data_type:"user",name:"User",icon:"user_gh_element",url:t+"/"+e+"user_data.js",type:"gh_element",technology:"angular"},{data_type:"app",name:"App",icon:"app",url:t+"/"+e+"application_data.js",type:"gh_element",technology:"angular"},{data_type:"field",name:"Field",icon:"field_gh_element",url:t+"/"+e+"field_data.js",type:"gh_element",technology:"angular"},{data_type:"available",name:"Available",icon:"availible_gh_element",url:t+"/"+e+"available_data.js",type:"gh_element",technology:"angular"},{data_type:"view_list",name:"View List",icon:"view_list",url:t+"/"+e+"view_list_data.js",type:"gh_element",technology:"angular"},{data_type:"calculator",name:"Calculator",icon:"calculator",url:t+"/"+e+"calculator_data.js",type:"gh_element",technology:"angular"},{data_type:"string_join",name:"String Joiner",icon:"string_join_gh_element",url:t+"/"+e+"string_joiner_data.js",type:"gh_element",technology:"angular"},{data_type:"signature",name:"Signature",icon:"signature",url:t+"/"+e+"signature_data.js",type:"gh_element",technology:"angular"},{data_type:"sendEmail",name:"Send Email",icon:"send_email_gh_element",url:t+"/"+e+"send_email_data.js",type:"gh_element",technology:"angular"},{data_type:"boolean",name:"Yes/No",icon:"boolen_gh_element",url:t+"/"+e+"boolean_data.js",type:"gh_element",technology:"angular"},{data_type:"product_gallery",name:"Product gallery",icon:"product_gallery",url:t+"/"+e+"product_gallery_data.js",type:"gh_element",technology:"angular"},{data_type:"online_inventory",name:"Online inventory",icon:"slab",url:t+"/"+e+"online_inventory_data.js",type:"gh_element",technology:"angular"},{data_type:"3d_edges",name:"3D Edges",icon:"3d_edges_gh_element",url:t+"/"+e+"3d_edges_data.js",type:"gh_element",technology:"angular"},{data_type:"color_list",name:"Color list",icon:"circular_gh_element",url:t+"/"+e+"color_list_data.js",type:"gh_element",technology:"angular"},{data_type:"go_to_link",name:"Go to Link",icon:"go_to_link",url:t+"/"+e+"go_to_link_data.js",type:"gh_element",technology:"angular"},{data_type:"go_to_view",name:"Go to View",icon:"go_to_view",url:t+"/"+e+"go_to_view_data.js",type:"gh_element",technology:"angular"},{data_type:"range",name:"Range",icon:"range_gh_element",url:t+"/"+e+"range_data.js",type:"gh_element",technology:"angular"},{data_type:"barcode",name:"Barcode",icon:"barcode_gh_element",url:t+"/"+e+"barcode_data.js",type:"gh_element",technology:"angular"},{data_type:"item_remote_add",name:"Item remote add",icon:"remote_add_gh_element",url:t+"/"+e+"item_remote_add_data.js",type:"gh_element",technology:"angular"},{data_type:"item_remote_update",name:"Item remote update",icon:"remote_update_gh_element",url:t+"/"+e+"item_remote_update_data.js",type:"gh_element",technology:"angular"},{data_type:"timeline",name:"Timeline",icon:"timeline",url:t+"/"+e+"timeline_data.js",type:"gh_element",technology:"angular"},{data_type:"delete_item",name:"Delete Item",icon:"rubbish",url:t+"/"+e+"delete_action.js",type:"gh_element",technology:"angular"},{data_type:"print_doc",name:"Print document",icon:"print",url:t+"/"+e+"print_doc_action.js",type:"gh_element",technology:"angular"},{data_type:"open_item",name:"Open Item",icon:"delete",private:!0,url:t+"/"+e+"open_item_action.js",type:"gh_element",technology:"angular"},{data_type:"edit_template",name:"Edit template",icon:"delete",private:!0,url:t+"/"+e+"edit_template_action.js",type:"gh_element",technology:"angular"},{data_type:"open_app",private:!0,name:"Open App",icon:"delete",url:t+"/"+e+"open_app_action.js",type:"gh_element",technology:"angular"},{data_type:"user_settings",private:!0,name:"User Settings",icon:"delete",url:t+"/"+e+"user_settings_action.js",type:"gh_element",technology:"angular"},{data_type:"app_sharing",name:"Sharing",icon:"sharing",url:t+"/"+e+"sharing_action.js",type:"gh_element",technology:"angular"},{data_type:"app_constructor",private:!0,name:"App constructor",icon:"app_constructor",url:t+"/"+e+"app_constructor_action.js",type:"gh_element",technology:"angular"},{data_type:"app_settings",name:"App Settings",icon:"configuration",url:t+"/"+e+"app_settings_action.js",type:"gh_element",technology:"angular"},{data_type:"export_csv",name:"Export CSV",icon:"export_csv",url:t+"/"+e+"export_csv.js",type:"gh_element",technology:"angular"},{data_type:"import_csv",name:"Import CSV",icon:"import_csv",url:t+"/"+e+"import_csv.js",type:"gh_element",technology:"angular"},{data_type:"add_items",name:"Add Items",icon:"plus",url:t+"/"+e+"add_items_action.js",type:"gh_element",technology:"angular"},{data_type:"update_items",name:"Update Items",icon:"update",url:t+"/"+e+"update_items_action.js",type:"gh_element",technology:"angular"},{data_type:"install_app",name:"Install",icon:"install",url:t+"/"+e+"install_app_action.js",type:"gh_element",technology:"angular"},{data_type:"search_action",name:"Search",icon:"search",url:t+"/"+e+"search_action.js",type:"gh_element",technology:"angular"},{data_type:"filter_table",name:"Table filter",icon:"filter",url:t+"/"+e+"filter_table_action.js",type:"gh_element",technology:"angular"},{data_type:"slider",name:"Slider",icon:"slider",url:t+"/"+e+"slider_data.js",type:"gh_element",technology:"angular"},{data_type:"clone_item",name:"Clone Item",icon:"double_plus",url:t+"/"+e+"clone_item_action.js",type:"gh_element",technology:"angular"},{data_type:"close",name:"Close",icon:"cross",url:t+"/"+e+"close_action.js",type:"gh_element",technology:"angular"},{data_type:"phone",name:"Phone",icon:"phone_thin",url:t+"/"+e+"phone_data.js",type:"gh_element",technology:"angular"},{data_type:"link",name:"Link",icon:"link_gh_element",url:t+"/"+e+"link_data.js",type:"gh_element",technology:"angular"},{data_type:"sheduling",name:"Sheduling",icon:"scheduling",url:t+"/"+e+"sheduling_data.js",type:"gh_element",technology:"angular"},{data_type:"qrcode",name:"QR Code",icon:"qr_code",url:t+"/"+e+"qrcode_data.js",type:"gh_element",technology:"angular"},{data_type:"graph2d",name:"Graph",icon:"graph",url:t+"/"+e+"graph2d_data.js",type:"gh_element",technology:"angular"},{data_type:"quote_tool",name:"Quote tool",icon:"quoters",url:t+"/"+e+"quote_tool_data.js",type:"gh_element",technology:"angular"},{data_type:"cards",name:"Cards",icon:"cards",url:t+"/"+e+"cards_data.js",type:"gh_element",technology:"angular"},{data_type:"jsonConstructor",name:"Json Constructor",icon:"button",url:t+"/"+e+"json_constructor_data.js",type:"gh_element",technology:"angular"},{data_type:"button",name:"Button",icon:"button",js:"https://gudhub.com/modules/button_action/button_action.js?t=1",type:"gh_element",technology:"class"},{data_type:"editorjs",name:"EditorJS",icon:"code_editor",js:"https://gudhub.com/modules/Editor-Js/dist/main.js?t=2",css:"https://gudhub.com/modules/Editor-Js/dist/style.css?t=2",type:"gh_element",technology:"class"},{data_type:"filter_advanced",name:"Filter Advanced",icon:"filter_advanced",url:t+"/"+e+"filter_advanced_data.js",type:"gh_element",technology:"angular"},{data_type:"code_editor",name:"Code Editor",icon:"code_editor",url:t+"/"+e+"code_editor_data.js",type:"gh_element",technology:"angular"},{data_type:"icon",name:"Icon",icon:"icon_gh_element",url:t+"/"+e+"icon_data.js",type:"gh_element",technology:"angular"},{data_type:"quoteRequest",name:"Quote Request",icon:"invoices",url:t+"/"+e+"quote_request_data.js",type:"gh_element",technology:"angular"},{data_type:"view_container",name:"View Container",icon:"pencil",url:t+"/"+e+"view_container_data.js",type:"gh_element",technology:"angular"},{data_type:"element_ref",name:"Element Reference",icon:"cloudSync_gh_element",url:t+"/"+e+"element_ref_data.js",type:"gh_element",technology:"angular"},{data_type:"quote_tool_objects_renderer",name:"Quote Tool Renderer",icon:"l_counter",url:t+"/"+e+"quote_tool_objects_renderer_data.js",type:"gh_element",technology:"angular"},{data_type:"quote_tool_objects_renderer_generator",name:"Quote Tool Parts Generator",icon:"l_counter_arrow",url:t+"/"+e+"quote_tool_objects_renderer_generator_data.js",type:"gh_element",technology:"angular"},{data_type:"trigger",name:"Trigger",icon:"job",url:t+"/"+e+"trigger_data.js",type:"gh_element",technology:"angular"},{data_type:"voting",name:"Voting",icon:"like_gh_element",url:t+"/"+e+"voting_data.js",type:"gh_element",technology:"angular"},{data_type:"view_tabs",name:"View Tab",icon:"tabs",url:t+"/"+e+"view_tabs.js",type:"gh_element",technology:"angular"},{data_type:"filter_tabs",name:"Filter Tabs",icon:"filter_tabs_gh_element",url:t+"/"+e+"filter_tabs.js",type:"gh_element",technology:"angular"},{data_type:"gps_coords",name:"GPS Coords",icon:"location_gh_element",url:t+"/"+e+"gps_coords.js",type:"gh_element",technology:"angular"},{data_type:"google_map",name:"Google Map",icon:"location",url:t+"/"+e+"google_map_data.js",type:"gh_element",technology:"angular"},{data_type:"data_migrations",name:"Data migrations",icon:"view_list_gh_element",url:t+"/"+e+"data_migrations.js",type:"gh_element",technology:"angular"},{data_type:"additional_settings",name:"Additional Settings",icon:"",private:!0,url:t+"/"+e+"gh_additional_settings_data.js",type:"gh_element",technology:"angular"},{data_type:"send_request",name:"Send Request",icon:"send_request_gh_element",url:t+"/"+e+"send_request_data.js",type:"gh_element",technology:"angular"},{data_type:"webcam",name:"Web camera",icon:"webcam_gh_element",url:t+"/"+e+"webcam_data.js",type:"gh_element",technology:"angular"},{data_type:"json_viewer",name:"JSON viewer",icon:"json_gh_element",url:t+"/"+e+"json_viewer_data.js",type:"gh_element",technology:"angular"},{data_type:"notifications",name:"Notifications",icon:"full_gh_element",url:t+"/"+e+"notifications_data.js",type:"gh_element",technology:"angular"},{data_type:"api",name:"API",icon:"job",url:t+"/"+e+"api_data.js",type:"gh_element",technology:"angular"},{data_type:"smart_input",name:"Smart Input",icon:"roket",url:t+"/"+e+"smart_input_data.js",type:"gh_element",technology:"angular"},{data_type:"json_editor",name:"JSON Editor",icon:"code",url:t+"/"+e+"json_editor_data.js",type:"gh_element",technology:"angular"},{data_type:"grapes_html_editor",name:"Grapes Html Editor",icon:"code_editor",url:t+"/"+e+"grapes_html_editor_data.js",type:"gh_element",technology:"angular"},{data_type:"quiz",name:"Quiz",icon:"quiz_gh_element",url:t+"/"+e+"quiz_data.js",type:"gh_element",technology:"angular"},{data_type:"password_input",name:"Password",icon:"lock_gh_element",url:t+"/"+e+"password_input_data.js",type:"gh_element",technology:"angular"},{data_type:"vs_code",name:"VS Code",icon:"code_editor",url:t+"/"+e+"vs_code_data.js",type:"gh_element",technology:"angular"},{data_type:"nested_list",name:"Nested List",icon:"scheduling",js:"https://gudhub.com/modules/Nested-List/dist/main.js?t=2",css:"https://gudhub.com/modules/Nested-List/dist/style.css?t=2",type:"gh_element",technology:"class"},{data_type:"countertop_smart_quote",name:"Countertop Smart Quote",icon:"quoters",url:t+"/"+e+"countertop_smart_quote_data.js",type:"gh_element",technology:"angular"},{data_type:"markdown_viewer",name:"Markdown viewer",icon:"code_editor",js:"https://gudhub.com/modules/markdown-it-gh-element/dist/main.js?t=1",css:"https://gudhub.com/modules/markdown-it-gh-element/dist/style.css?t=1",type:"gh_element",technology:"class"},{data_type:"html_viewer",name:"HTML Viewer",icon:"code_editor",js:"https://gudhub.com/modules/HTML-Viewer/dist/main.js?t=1",css:"https://gudhub.com/modules/HTML-Viewer/dist/style.css?t=1",type:"gh_element",technology:"class"},{data_type:"element_customizer",name:"Element Customizer",icon:"pencil",url:t+"/"+e+"element_customizer_data.js",type:"gh_element",technology:"angular"},{data_type:"task",name:"Task",icon:"table",url:t+"/"+e+"task_data.js",type:"gh_element",technology:"angular"},{data_type:"cron_picker",name:"Cron Picker",icon:"table",js:"https://gudhub.com/modules/Cron-Picker/dist/main.js?t=2",css:"https://gudhub.com/modules/Cron-Picker/dist/style.css?t=2",type:"gh_element",technology:"class"},{data_type:"balance_sheet",name:"Balance Sheet",icon:"table",js:"https://gudhub.com/modules/balance-sheet/dist/main.js?t=2",css:"https://gudhub.com/modules/balance-sheet/dist/style.css?t=2",type:"gh_element",technology:"class"},{data_type:"quote_form",name:"Quote Form",icon:"table",js:"https://gudhub.com/modules/countertop-quote-form/dist/main.js",css:"https://gudhub.com/modules/countertop-quote-form/dist/style.css",type:"gh_element",technology:"class"},{data_type:"static_nested_list",name:"Nested Filter",icon:"scheduling",js:"https://gudhub.com/modules/nested-filter/dist/main.js?t=1",css:"https://gudhub.com/modules/nested-filter/dist/style.css?t=1",type:"gh_element",technology:"class"},{data_type:"conversations",name:"Conversations",icon:"timeline",js:"https://gudhub.com/modules/conversation/dist/main.js?t=1",css:"https://gudhub.com/modules/conversation/dist/style.css?t=1",type:"gh_element",technology:"class"},{data_type:"study_journal",name:"Study Journal",icon:"timeline",js:"https://gudhub.com/modules/Study-Journal/dist/main.js",css:"https://gudhub.com/modules/Study-Journal/dist/style.css",type:"gh_element",technology:"class"},{data_type:"study_schedule",name:"Study Schedule",icon:"timeline",js:"https://gudhub.com/modules/Study-Schedule/dist/main.js?t=1",css:"https://gudhub.com/modules/Study-Schedule/dist/style.css?t=1",type:"gh_element",technology:"class"},{data_type:"avatar",name:"Avatar",icon:"user",js:"https://gudhub.com/modules/Gh-Avatar/dist/main.js?t=1",css:"https://gudhub.com/modules/Gh-Avatar/dist/style.css?t=1",type:"gh_element",technology:"class"},{data_type:"text_area",name:"Text Area",icon:"text_icon",js:"https://gudhub.com/modules/text-area-ghe/dist/main.js?t=1",css:"https://gudhub.com/modules/text-area-ghe/dist/style.css",type:"gh_element",technology:"class"},{data_type:"API",name:"API",url:t+"/"+r+"api_node.js",type:"automation",icon:"automation_api",private:!0},{data_type:"Calculator",name:"Calculator",url:t+"/"+r+"calculator.js",type:"automation",icon:"automation_calculator"},{data_type:"CompareItems",name:"Compare Items",url:t+"/"+r+"compare_items.js",type:"automation",icon:"automation_compare_items"},{data_type:"Constants",name:"Constants",url:t+"/"+r+"constants.js",type:"automation",icon:"automation_constants"},{data_type:"CreateFiles",name:"Create Files",url:t+"/"+r+"create_files.js",type:"automation",icon:"automation_create_files"},{data_type:"CreateItemsApi",name:"Create Items Api",url:t+"/"+r+"create_item_api.js",type:"automation",icon:"automation_create_items_api"},{data_type:"FileDuplicate",name:"File Duplicate",url:t+"/"+r+"file_duplicate.js",type:"automation",icon:"automation_file_duplicate"},{data_type:"Filter",name:"Filter",url:t+"/"+r+"filter_node.js",type:"automation",icon:"filter"},{data_type:"GetItemByItemRef",name:"Get Item By Item Ref",url:t+"/"+r+"get_item_by_item_ref.js",type:"automation",icon:"automation_get_item_by_item_ref"},{data_type:"GetItems",name:"Get Items",url:t+"/"+r+"get_items.js",type:"automation",icon:"automation_get_items"},{data_type:"GhElementNode",name:"Gh Element Node",url:t+"/"+r+"gh_element_node.js",type:"automation",icon:"automation_gh_element_node",private:!0,created_for:["GhElement"]},{data_type:"IfCondition",name:"If Condition",url:t+"/"+r+"if_condition.js",type:"automation",icon:"automation_if_condition"},{data_type:"ItemConstructor",name:"Item Constructor",url:t+"/"+r+"item_constructor.js",type:"automation",icon:"automation_item_constructor"},{data_type:"ItemDestructor",name:"Item Destructor",url:t+"/"+r+"item_destructor.js",type:"automation",icon:"automation_item_destructor"},{data_type:"JSONScheme",name:"JSON Scheme",url:t+"/"+r+"json_scheme.js",type:"automation",icon:"automation_json_scheme"},{data_type:"MergeItems",name:"Merge Items",url:t+"/"+r+"merge_items.js",type:"automation",icon:"automation_merge_items"},{data_type:"MessageConstructor",name:"Message Constructor",url:t+"/"+r+"message_constructor.js",type:"automation",icon:"automation_message_constructor"},{data_type:"ObjectToItem",name:"Object To Item",url:t+"/"+r+"obj_to_item.js",type:"automation",icon:"automation_object_to_item"},{data_type:"ObjectConstructor",name:"Object Constructor",url:t+"/"+r+"object_constructor.js",type:"automation",icon:"automation_object_constructor"},{data_type:"ObjectDestructor",name:"Object Destructor",url:t+"/"+r+"object_destructor.js",type:"automation",icon:"automation_object_destructor"},{data_type:"PopulateElement",name:"Populate Element",url:t+"/"+r+"populate_element.js",type:"automation",icon:"automation_populate_element",private:!0,created_for:["GhElement"]},{data_type:"PopulateItems",name:"Populate Items",url:t+"/"+r+"populate_items.js",type:"automation",icon:"automation_populate_items"},{data_type:"PopulateWithDate",name:"Populate With Date",url:t+"/"+r+"populate_with_date.js",type:"automation",icon:"automation_populate_with_date"},{data_type:"PopulateWithItemRef",name:"Populate with Item Ref",url:t+"/"+r+"populate_with_item_ref.js",type:"automation",icon:"automation_populate_with_item_ref"},{data_type:"PopUpForm",name:"Pop Up Form",url:t+"/"+r+"popup_form.js",type:"automation",icon:"automation_pop_up_form",private:!0,created_for:["Quiz","GhElement","SmartInput","Iterator"]},{data_type:"QuizForm",name:"Quiz Form",url:t+"/"+r+"quiz_form.js",type:"automation",icon:"automation_quiz_form",private:!0,created_for:["Quiz"]},{data_type:"QuizNode",name:"Quiz Node",url:t+"/"+r+"quiz_node.js",type:"automation",icon:"automation_quiz_node",private:!0},{data_type:"Request",name:"Request",url:t+"/"+r+"request_node.js",type:"automation",icon:"automation_request"},{data_type:"Response",name:"Response",url:t+"/"+r+"response_node.js",type:"automation",icon:"automation_response",private:!0,created_for:["API"]},{data_type:"SmartInput",name:"Smart Input",url:t+"/"+r+"smart_input.js",type:"automation",icon:"automation_smart_input",private:!0},{data_type:"Trigger",name:"Trigger",url:t+"/"+r+"trigger_node.js",type:"automation",icon:"automation_trigger",private:!0},{data_type:"TwilioSMS",name:"Twilio SMS",url:t+"/"+r+"twilio_sms.js",type:"automation",icon:"automation_twilio"},{data_type:"TwilioAuth",name:"Twilio Auth",url:t+"/"+r+"twilio_auth.js",type:"automation",icon:"table"},{data_type:"TwilioDevice",name:"Twilio Device",url:t+"/"+r+"twilio_device.js",type:"automation",icon:"table"},{data_type:"UpdateItemsApi",name:"Update Items Api",url:t+"/"+r+"update_items_api.js",type:"automation",icon:"automation_update_items_api"},{data_type:"GoogleCalendar",name:"Google Calendar",url:t+"/"+r+"google_calendar.js",type:"automation",icon:"calendar"},{data_type:"VerifyEmail",name:"Verify email",url:t+"/"+r+"verify_email.js",type:"automation",icon:"check_in_circle"},{data_type:"Iterator",name:"Iterator",url:t+"/"+r+"iterator.js",type:"automation",icon:"update"},{data_type:"IteratorInput",name:"Iterator Input",url:t+"/"+r+"iterator_input.js",type:"automation",icon:"arrow_right",private:!0},{data_type:"IteratorOutput",name:"Iterator Output",url:t+"/"+r+"iterator_output.js",type:"automation",icon:"arrow_right",private:!0},{data_type:"SendEmail",name:"Send email",url:t+"/"+r+"send_email.js",type:"automation",icon:"email"},{data_type:"FileReader",name:"File Reader",url:t+"/"+r+"file_reader.js",type:"automation",icon:"file"},{data_type:"WebsitesChecker",name:"Websites Checker",url:t+"/"+r+"websites_checker.js",type:"automation",icon:"world"},{data_type:"VoiceMachineDetection",name:"Voice Machine Detection",url:t+"/"+r+"voice_machine_detection.js",type:"automation",icon:"automation_calculator"},{data_type:"Task",name:"Task",url:t+"/"+r+"task.js",type:"automation",icon:"automation_calculator",private:!0},{data_type:"DeleteItems",name:"Delete Items",url:t+"/"+r+"delete_items.js",type:"automation",icon:"rubbish"},{data_type:"GoToItem",name:"Go To Item",url:t+"/"+r+"go_to_item.js",type:"automation",icon:"cursor_point"},{data_type:"FireWorks",name:"Fire Works",url:t+"/"+r+"fireworks_node.js",type:"automation",icon:"weeding_party"},{data_type:"SendMessage",name:"Send Message",url:t+"/"+r+"send_message.js",type:"automation",icon:"speech_bubble"},{data_type:"TurboSMS",name:"Turbo SMS",url:t+"/"+r+"turbo_sms.js",type:"automation",icon:"email"}]}(e,t,r),this.ghComponentsPromises=[]}getMainStorage(){return this}getAppsList(){return this.apps_list}getUser(){return this.user}getUsersList(){return this.users_list}getModulesList(e,t,r){return void 0===e?this.modulesList:0==t?this.modulesList.filter((t=>t.created_for?t.type===e&&t.private&&t.created_for.includes(r):t.type===e&&!t.private)):this.modulesList.filter((t=>t.type===e))}getModuleUrl(e){return this.modulesList.find((t=>t.data_type==e))}setUser(e){this.user=e,this.users_list.push(e)}updateUser(e={}){e.avatar_128&&(e.avatar_128=e.avatar_128+"?"+(new Date).getTime()),e.avatar_512&&(e.avatar_512=e.avatar_512+"?"+(new Date).getTime()),this.user={...this.user,...e},this.users_list=this.users_list.filter((t=>t.user_id!=e.user_id)),this.users_list.push(this.user)}unsetUser(){this.user={}}getApp(e){for(let t=0;t<this.apps_list.length;t++)if(this.apps_list[t].app_id==e)return this.apps_list[t]}unsetApps(){this.apps_list=[]}updateApp(e){return this.apps_list=this.apps_list.map((t=>t.app_id==e.app_id?e:t)),this.apps_list}deleteApp(e){return this.apps_list=this.apps_list.filter((t=>t.app_id!=e)),this.apps_list}async updateItemsInApp(e,t){const r=await this.getApp(t);return r&&(r.items_list=updateItems(e,r.items_list,this.pipeService.emit.bind(this.pipeService),t),this.updateApp(r)),r}async addItemsToApp(e,t){const r=await this.getApp(t);return r&&(r.items_list.push(...e),this.updateApp(r),this.pipeService.emit("gh_items_update",{app_id:t},e)),r}async deleteItemsInApp(e,t){const r=await this.getApp(t);return r&&(r.items_list=r.items_list.filter((t=>!e.find((e=>e.item_id==t.item_id)))),this.updateApp(r)),r}}var s=__webpack_require__(7026);class l{constructor(e,t){this.websocket=null,this.connected=!1,this.queue=[],this.url=e,this.auth=t,this.heartBeatTimeStemp=1e13,this.ALLOWED_HEART_BEAT_DELEY=12e3,this.firstHeartBeat=!0,this.reload=!0,this.isBrowser=![typeof window,typeof document].includes("undefined")}async addSubscription(e){const t=`token=${await this.auth.getToken()}/~/app_id=${e}`;this.connected&&this.websocket.send(t),this.queue.push(e)}async onOpen(){this.reload=!0,console.log("websocket opened"),this.connected=!0;const e=await this.auth.getToken();this.queue.forEach((t=>{const r=`token=${e}/~/app_id=${t}`;this.websocket.send(r)}))}onError(e){console.log("websocket error: ",e),this.websocket.close()}onClose(){console.log("websocket close"),this.connected=!1;try{this.initWebSocket(this.onMassageHandler,this.refreshAppsHandler)}catch(e){console.log(e)}}async onMessage(e){const t=this.isBrowser?e.data:e;if(t.match(/HeartBeat/)){const e=(new Date).getTime()-this.heartBeatTimeStemp;this.ALLOWED_HEART_BEAT_DELEY<e?await this.onConnectionLost():(this.websocket.send("HeartBeat"),this.heartBeatTimeStemp=(new Date).getTime())}if(this.firstHeartBeat&&(this.connectionChecker(),this.firstHeartBeat=!1),t.match(/[{}]/)){let e=JSON.parse(t);const r=await this.auth.getToken();e.token!=r&&this.onMassageHandler(e)}}initWebSocket(e,t){this.onMassageHandler=e,this.refreshAppsHandler=t,this.isBrowser?(this.websocket=new WebSocket(this.url),this.websocket.onopen=this.onOpen.bind(this),this.websocket.onerror=this.onError.bind(this),this.websocket.onclose=this.onClose.bind(this),this.websocket.onmessage=this.onMessage.bind(this)):(this.websocket=new s(this.url),this.websocket.on("open",this.onOpen),this.websocket.on("error",this.onError),this.websocket.on("close",this.onClose),this.websocket.on("message",this.onMessage)),console.log("websocket initialized")}connectionChecker(){setInterval((async()=>{let e=(new Date).getTime()-this.heartBeatTimeStemp;this.ALLOWED_HEART_BEAT_DELEY<e&&await this.onConnectionLost()}),1e3)}async onConnectionLost(){try{await this.auth.getVersion(),this.reload&&(this.reload=!1,console.log("Connected"),this.heartBeatTimeStemp=1e13,this.websocket.close())}catch(e){console.log(e)}}}function c(e){return Array.isArray?Array.isArray(e):"[object Array]"===m(e)}function u(e){return"string"==typeof e}function p(e){return"number"==typeof e}function d(e){return"object"==typeof e}function h(e){return null!=e}function f(e){return!e.trim().length}function m(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const g=e=>`Missing ${e} property in key`,y=e=>`Property 'weight' in key '${e}' must be a positive integer`,_=Object.prototype.hasOwnProperty;class b{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach((e=>{let r=v(e);t+=r.weight,this._keys.push(r),this._keyMap[r.id]=r,t+=r.weight})),this._keys.forEach((e=>{e.weight/=t}))}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function v(e){let t=null,r=null,n=null,i=1,a=null;if(u(e)||c(e))n=e,t=w(e),r=S(e);else{if(!_.call(e,"name"))throw new Error(g("name"));const o=e.name;if(n=o,_.call(e,"weight")&&(i=e.weight,i<=0))throw new Error(y(o));t=w(o),r=S(o),a=e.getFn}return{path:t,id:r,weight:i,src:n,getFn:a}}function w(e){return c(e)?e:e.split(".")}function S(e){return c(e)?e.join("."):e}var E={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,useExtendedSearch:!1,getFn:function(e,t){let r=[],n=!1;const i=(e,t,a)=>{if(h(e))if(t[a]){const o=e[t[a]];if(!h(o))return;if(a===t.length-1&&(u(o)||p(o)||function(e){return!0===e||!1===e||function(e){return d(e)&&null!==e}(e)&&"[object Boolean]"==m(e)}(o)))r.push(function(e){return null==e?"":function(e){if("string"==typeof e)return e;let t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}(o));else if(c(o)){n=!0;for(let e=0,r=o.length;e<r;e+=1)i(o[e],t,a+1)}else t.length&&i(o,t,a+1)}else r.push(e)};return i(e,u(t)?t.split("."):t,0),n?r:r[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};const x=/[^ ]+/g;class k{constructor({getFn:e=E.getFn,fieldNormWeight:t=E.fieldNormWeight}={}){this.norm=function(e=1,t=3){const r=new Map,n=Math.pow(10,t);return{get(t){const i=t.match(x).length;if(r.has(i))return r.get(i);const a=1/Math.pow(i,.5*e),o=parseFloat(Math.round(a*n)/n);return r.set(i,o),o},clear(){r.clear()}}}(t,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach(((e,t)=>{this._keysMap[e.id]=t}))}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,u(this.docs[0])?this.docs.forEach(((e,t)=>{this._addString(e,t)})):this.docs.forEach(((e,t)=>{this._addObject(e,t)})),this.norm.clear())}add(e){const t=this.size();u(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,r=this.size();t<r;t+=1)this.records[t].i-=1}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_addString(e,t){if(!h(e)||f(e))return;let r={v:e,i:t,n:this.norm.get(e)};this.records.push(r)}_addObject(e,t){let r={i:t,$:{}};this.keys.forEach(((t,n)=>{let i=t.getFn?t.getFn(e):this.getFn(e,t.path);if(h(i))if(c(i)){let e=[];const t=[{nestedArrIndex:-1,value:i}];for(;t.length;){const{nestedArrIndex:r,value:n}=t.pop();if(h(n))if(u(n)&&!f(n)){let t={v:n,i:r,n:this.norm.get(n)};e.push(t)}else c(n)&&n.forEach(((e,r)=>{t.push({nestedArrIndex:r,value:e})}))}r.$[n]=e}else if(u(i)&&!f(i)){let e={v:i,n:this.norm.get(i)};r.$[n]=e}})),this.records.push(r)}toJSON(){return{keys:this.keys,records:this.records}}}function A(e,t,{getFn:r=E.getFn,fieldNormWeight:n=E.fieldNormWeight}={}){const i=new k({getFn:r,fieldNormWeight:n});return i.setKeys(e.map(v)),i.setSources(t),i.create(),i}function I(e,{errors:t=0,currentLocation:r=0,expectedLocation:n=0,distance:i=E.distance,ignoreLocation:a=E.ignoreLocation}={}){const o=t/e.length;if(a)return o;const s=Math.abs(n-r);return i?o+s/i:s?1:o}const j=32;function O(e){let t={};for(let r=0,n=e.length;r<n;r+=1){const i=e.charAt(r);t[i]=(t[i]||0)|1<<n-r-1}return t}class P{constructor(e,{location:t=E.location,threshold:r=E.threshold,distance:n=E.distance,includeMatches:i=E.includeMatches,findAllMatches:a=E.findAllMatches,minMatchCharLength:o=E.minMatchCharLength,isCaseSensitive:s=E.isCaseSensitive,ignoreLocation:l=E.ignoreLocation}={}){if(this.options={location:t,threshold:r,distance:n,includeMatches:i,findAllMatches:a,minMatchCharLength:o,isCaseSensitive:s,ignoreLocation:l},this.pattern=s?e:e.toLowerCase(),this.chunks=[],!this.pattern.length)return;const c=(e,t)=>{this.chunks.push({pattern:e,alphabet:O(e),startIndex:t})},u=this.pattern.length;if(u>j){let e=0;const t=u%j,r=u-t;for(;e<r;)c(this.pattern.substr(e,j),e),e+=j;if(t){const e=u-j;c(this.pattern.substr(e),e)}}else c(this.pattern,0)}searchIn(e){const{isCaseSensitive:t,includeMatches:r}=this.options;if(t||(e=e.toLowerCase()),this.pattern===e){let t={isMatch:!0,score:0};return r&&(t.indices=[[0,e.length-1]]),t}const{location:n,distance:i,threshold:a,findAllMatches:o,minMatchCharLength:s,ignoreLocation:l}=this.options;let c=[],u=0,p=!1;this.chunks.forEach((({pattern:t,alphabet:d,startIndex:h})=>{const{isMatch:f,score:m,indices:g}=function(e,t,r,{location:n=E.location,distance:i=E.distance,threshold:a=E.threshold,findAllMatches:o=E.findAllMatches,minMatchCharLength:s=E.minMatchCharLength,includeMatches:l=E.includeMatches,ignoreLocation:c=E.ignoreLocation}={}){if(t.length>j)throw new Error("Pattern length exceeds max of 32.");const u=t.length,p=e.length,d=Math.max(0,Math.min(n,p));let h=a,f=d;const m=s>1||l,g=m?Array(p):[];let y;for(;(y=e.indexOf(t,f))>-1;){let e=I(t,{currentLocation:y,expectedLocation:d,distance:i,ignoreLocation:c});if(h=Math.min(e,h),f=y+u,m){let e=0;for(;e<u;)g[y+e]=1,e+=1}}f=-1;let _=[],b=1,v=u+p;const w=1<<u-1;for(let n=0;n<u;n+=1){let a=0,s=v;for(;a<s;)I(t,{errors:n,currentLocation:d+s,expectedLocation:d,distance:i,ignoreLocation:c})<=h?a=s:v=s,s=Math.floor((v-a)/2+a);v=s;let l=Math.max(1,d-s+1),y=o?p:Math.min(d+s,p)+u,S=Array(y+2);S[y+1]=(1<<n)-1;for(let a=y;a>=l;a-=1){let o=a-1,s=r[e.charAt(o)];if(m&&(g[o]=+!!s),S[a]=(S[a+1]<<1|1)&s,n&&(S[a]|=(_[a+1]|_[a])<<1|1|_[a+1]),S[a]&w&&(b=I(t,{errors:n,currentLocation:o,expectedLocation:d,distance:i,ignoreLocation:c}),b<=h)){if(h=b,f=o,f<=d)break;l=Math.max(1,2*d-f)}}if(I(t,{errors:n+1,currentLocation:d,expectedLocation:d,distance:i,ignoreLocation:c})>h)break;_=S}const S={isMatch:f>=0,score:Math.max(.001,b)};if(m){const e=function(e=[],t=E.minMatchCharLength){let r=[],n=-1,i=-1,a=0;for(let o=e.length;a<o;a+=1){let o=e[a];o&&-1===n?n=a:o||-1===n||(i=a-1,i-n+1>=t&&r.push([n,i]),n=-1)}return e[a-1]&&a-n>=t&&r.push([n,a-1]),r}(g,s);e.length?l&&(S.indices=e):S.isMatch=!1}return S}(e,t,d,{location:n+h,distance:i,threshold:a,findAllMatches:o,minMatchCharLength:s,includeMatches:r,ignoreLocation:l});f&&(p=!0),u+=m,f&&g&&(c=[...c,...g])}));let d={isMatch:p,score:p?u/this.chunks.length:1};return p&&r&&(d.indices=c),d}}class T{constructor(e){this.pattern=e}static isMultiMatch(e){return C(e,this.multiRegex)}static isSingleMatch(e){return C(e,this.singleRegex)}search(){}}function C(e,t){const r=e.match(t);return r?r[1]:null}class N extends T{constructor(e,{location:t=E.location,threshold:r=E.threshold,distance:n=E.distance,includeMatches:i=E.includeMatches,findAllMatches:a=E.findAllMatches,minMatchCharLength:o=E.minMatchCharLength,isCaseSensitive:s=E.isCaseSensitive,ignoreLocation:l=E.ignoreLocation}={}){super(e),this._bitapSearch=new P(e,{location:t,threshold:r,distance:n,includeMatches:i,findAllMatches:a,minMatchCharLength:o,isCaseSensitive:s,ignoreLocation:l})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class L extends T{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t,r=0;const n=[],i=this.pattern.length;for(;(t=e.indexOf(this.pattern,r))>-1;)r=t+i,n.push([t,r-1]);const a=!!n.length;return{isMatch:a,score:a?0:1,indices:n}}}const M=[class extends T{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},L,class extends T{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},class extends T{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},class extends T{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},class extends T{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}},class extends T{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const t=-1===e.indexOf(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}},N],F=M.length,R=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,D=new Set([N.type,L.type]);const q=[];function U(e,t){for(let r=0,n=q.length;r<n;r+=1){let n=q[r];if(n.condition(e,t))return new n(e,t)}return new P(e,t)}const B="$and",$="$path",G=e=>!(!e[B]&&!e.$or),W=e=>({[B]:Object.keys(e).map((t=>({[t]:e[t]})))});function H(e,t,{auto:r=!0}={}){const n=e=>{let i=Object.keys(e);const a=(e=>!!e[$])(e);if(!a&&i.length>1&&!G(e))return n(W(e));if((e=>!c(e)&&d(e)&&!G(e))(e)){const n=a?e[$]:i[0],o=a?e.$val:e[n];if(!u(o))throw new Error((e=>`Invalid value for key ${e}`)(n));const s={keyId:S(n),pattern:o};return r&&(s.searcher=U(o,t)),s}let o={children:[],operator:i[0]};return i.forEach((t=>{const r=e[t];c(r)&&r.forEach((e=>{o.children.push(n(e))}))})),o};return G(e)||(e=W(e)),n(e)}function V(e,t){const r=e.matches;t.matches=[],h(r)&&r.forEach((e=>{if(!h(e.indices)||!e.indices.length)return;const{indices:r,value:n}=e;let i={indices:r,value:n};e.key&&(i.key=e.key.src),e.idx>-1&&(i.refIndex=e.idx),t.matches.push(i)}))}function z(e,t){t.score=e.score}class J{constructor(e,t={},r){this.options={...E,...t},this.options.useExtendedSearch,this._keyStore=new b(this.options.keys),this.setCollection(e,r)}setCollection(e,t){if(this._docs=e,t&&!(t instanceof k))throw new Error("Incorrect 'index' type");this._myIndex=t||A(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){h(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=(()=>!1)){const t=[];for(let r=0,n=this._docs.length;r<n;r+=1){const i=this._docs[r];e(i,r)&&(this.removeAt(r),r-=1,n-=1,t.push(i))}return t}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:t=-1}={}){const{includeMatches:r,includeScore:n,shouldSort:i,sortFn:a,ignoreFieldNorm:o}=this.options;let s=u(e)?u(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return function(e,{ignoreFieldNorm:t=E.ignoreFieldNorm}){e.forEach((e=>{let r=1;e.matches.forEach((({key:e,norm:n,score:i})=>{const a=e?e.weight:null;r*=Math.pow(0===i&&a?Number.EPSILON:i,(a||1)*(t?1:n))})),e.score=r}))}(s,{ignoreFieldNorm:o}),i&&s.sort(a),p(t)&&t>-1&&(s=s.slice(0,t)),function(e,t,{includeMatches:r=E.includeMatches,includeScore:n=E.includeScore}={}){const i=[];return r&&i.push(V),n&&i.push(z),e.map((e=>{const{idx:r}=e,n={item:t[r],refIndex:r};return i.length&&i.forEach((t=>{t(e,n)})),n}))}(s,this._docs,{includeMatches:r,includeScore:n})}_searchStringList(e){const t=U(e,this.options),{records:r}=this._myIndex,n=[];return r.forEach((({v:e,i:r,n:i})=>{if(!h(e))return;const{isMatch:a,score:o,indices:s}=t.searchIn(e);a&&n.push({item:e,idx:r,matches:[{score:o,value:e,norm:i,indices:s}]})})),n}_searchLogical(e){const t=H(e,this.options),r=(e,t,n)=>{if(!e.children){const{keyId:r,searcher:i}=e,a=this._findMatches({key:this._keyStore.get(r),value:this._myIndex.getValueForItemAtKeyId(t,r),searcher:i});return a&&a.length?[{idx:n,item:t,matches:a}]:[]}const i=[];for(let a=0,o=e.children.length;a<o;a+=1){const o=e.children[a],s=r(o,t,n);if(s.length)i.push(...s);else if(e.operator===B)return[]}return i},n=this._myIndex.records,i={},a=[];return n.forEach((({$:e,i:n})=>{if(h(e)){let o=r(t,e,n);o.length&&(i[n]||(i[n]={idx:n,item:e,matches:[]},a.push(i[n])),o.forEach((({matches:e})=>{i[n].matches.push(...e)})))}})),a}_searchObjectList(e){const t=U(e,this.options),{keys:r,records:n}=this._myIndex,i=[];return n.forEach((({$:e,i:n})=>{if(!h(e))return;let a=[];r.forEach(((r,n)=>{a.push(...this._findMatches({key:r,value:e[n],searcher:t}))})),a.length&&i.push({idx:n,item:e,matches:a})})),i}_findMatches({key:e,value:t,searcher:r}){if(!h(t))return[];let n=[];if(c(t))t.forEach((({v:t,i,n:a})=>{if(!h(t))return;const{isMatch:o,score:s,indices:l}=r.searchIn(t);o&&n.push({score:s,key:e,value:t,idx:i,norm:a,indices:l})}));else{const{v:i,n:a}=t,{isMatch:o,score:s,indices:l}=r.searchIn(i);o&&n.push({score:s,key:e,value:i,norm:a,indices:l})}return n}}function X(e){return e*(Math.PI/180)}function Q(e=0){const t=new Date;return new Date(t.getFullYear(),t.getMonth(),t.getDate()+e).valueOf()}function Y(e,t){if(e&&e.length)return t?e.filter((e=>e.fields.find((e=>e.index_value&&-1!==e.index_value.toLowerCase().indexOf(t.toLowerCase()))))):e}J.version="6.6.2",J.createIndex=A,J.parseIndex=function(e,{getFn:t=E.getFn,fieldNormWeight:r=E.fieldNormWeight}={}){const{keys:n,records:i}=e,a=new k({getFn:t,fieldNormWeight:r});return a.setKeys(n),a.setIndexRecords(i),a},J.config=E,J.parseQuery=H,function(...e){q.push(...e)}(class{constructor(e,{isCaseSensitive:t=E.isCaseSensitive,includeMatches:r=E.includeMatches,minMatchCharLength:n=E.minMatchCharLength,ignoreLocation:i=E.ignoreLocation,findAllMatches:a=E.findAllMatches,location:o=E.location,threshold:s=E.threshold,distance:l=E.distance}={}){this.query=null,this.options={isCaseSensitive:t,includeMatches:r,minMatchCharLength:n,findAllMatches:a,ignoreLocation:i,location:o,threshold:s,distance:l},this.pattern=t?e:e.toLowerCase(),this.query=function(e,t={}){return e.split("|").map((e=>{let r=e.trim().split(R).filter((e=>e&&!!e.trim())),n=[];for(let e=0,i=r.length;e<i;e+=1){const i=r[e];let a=!1,o=-1;for(;!a&&++o<F;){const e=M[o];let r=e.isMultiMatch(i);r&&(n.push(new e(r,t)),a=!0)}if(!a)for(o=-1;++o<F;){const e=M[o];let r=e.isSingleMatch(i);if(r){n.push(new e(r,t));break}}}return n}))}(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){const t=this.query;if(!t)return{isMatch:!1,score:1};const{includeMatches:r,isCaseSensitive:n}=this.options;e=n?e:e.toLowerCase();let i=0,a=[],o=0;for(let n=0,s=t.length;n<s;n+=1){const s=t[n];a.length=0,i=0;for(let t=0,n=s.length;t<n;t+=1){const n=s[t],{isMatch:l,indices:c,score:u}=n.search(e);if(!l){o=0,i=0,a.length=0;break}if(i+=1,o+=u,r){const e=n.constructor.type;D.has(e)?a=[...a,...c]:a.push(c)}}if(i){let e={isMatch:!0,score:o/i};return r&&(e.indices=a),e}}return{isMatch:!1,score:1}}});const K=new J([]);class Z{changeBehavior(e){switch(e){case"contain_or":this._checkFn=function(e,t){return t.some((t=>e.some((e=>-1!==e.indexOf(t)))))};break;case"contain_and":this._checkFn=function(e,t){return t.every((t=>e.some((e=>-1!==e.indexOf(t)))))};break;case"not_contain_or":this._checkFn=function(e,t){return t.some((t=>e.every((e=>-1===e.indexOf(t)))))};break;case"not_contain_and":this._checkFn=function(e,t){return t.every((t=>e.every((e=>-1===e.indexOf(t)))))};break;case"equal_or":this._checkFn=function(e,t){return!!e.length&&e.some((e=>t.some((t=>e==t))))};break;case"equal_and":this._checkFn=function(e,t){if(!e.length)return!1;let r=new Set(t);for(;e.length&&r.size;){let t=e.pop();r.has(t)&&r.delete(t)}return!r.size};break;case"not_equal_or":this._checkFn=function(e,t){if(!e.length)return!0;let r=new Set(t);for(;e.length&&r.size;){let t=e.pop();if(!r.has(t))return!0}return!1};break;case"not_equal_and":this._checkFn=function(e,t){let r=new Set(t);for(;e.length&&r.size;){let t=e.pop();if(r.has(t))return!1}return!0};break;case"bigger":this._checkFn=function(e,t){return t.some((t=>e.every((e=>e>t))))};break;case"lower":this._checkFn=function(e,t){return t.some((t=>e.every((e=>e<t))))};break;case"range":this._checkFn=function(e,t){return t.some((t=>e.every((e=>t.start<=e&&e<t.end))))};break;case"value":this._checkFn=function(e,t){return t.some((t=>e.some((e=>e==t))))};break;case"search":this._checkFn=function(e,t){return t.some((t=>{return r=t,n=e,K.setCollection(n),Boolean(K.search(r).length);var r,n}))};break;case"phone_equal_or":this._checkFn=function(e,t){return!!e.length&&t.some((t=>e.some((e=>-1!==e.replace(/[^0-9]/g,"").indexOf(t.replace(/[^0-9]/g,""))))))};break;case"distance":this._checkFn=function(e,t){return t.some((t=>e.some((e=>function(e,t){const[r,n,i]=e.split(":"),[a,o]=t.split(":"),s=X(a-r),l=X(o-n),c=Math.sin(s/2)*Math.sin(s/2)+Math.cos(X(r))*Math.cos(X(a))*Math.sin(l/2)*Math.sin(l/2),u=2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c))*6371;return Number(i)>=u}(t,e)))))};break;case"date_in":case"date_out":this._checkFn=function(e,t){return t.some((t=>e.some((e=>function({type:e,date:t=0,match:r=!0}={},n){if(!n&&e)return!1;const i=new Date;let a=!0;switch(e){case"day":const e=Q(t),r=Q(t+1);a=e<=n&&n<r;break;case"days":if(t<0){const e=Q(1);a=Q(-6)<=n&&n<e}else{const e=Q(),t=Q(7);a=e<=n&&n<t}break;case"day_week":a=t===new Date(n).getDay();break;case"week":const s=i.getDate()-i.getDay(),l=s+(-2==t?13:6),c=i.setDate(s+7*t),u=(new Date).setDate(l+7*t),[p,d]=(o=u,[new Date(c),new Date(o)]);a=p<=n&&n<=d;break;case"month":if(i.getFullYear()!==new Date(n).getFullYear())return!1;a=i.getMonth()+t===new Date(n).getMonth();break;case"year":a=i.getFullYear()+t===new Date(n).getFullYear();break;default:return!0}var o;return r?a:!a}(t,e)))))};break;case"recurring_date":this._checkFn=function(e,t){return t.some((t=>e.some((e=>gudhub.checkRecurringDate(e,t)))))}}return this}check(e){return this.changeBehavior(e.getCheckOption())._checkFn(e.getEntity(),e.getFilterValues())}}class ee{convert(e){return[Number(e)]}convertFilterValue(e){return Number(e)}}class te extends ee{convertFilterValue(e){return{start:Number(e.split(":")[0]),end:Number(e.split(":")[1])}}}class re{convert(e){return String(null!=e?e:"").toLowerCase().split(",")}convertFilterValue(e){return 0===e?"0":String(e||"").toLowerCase()}}class ne extends ee{convertFilterValue(e){const[t,r,n]=e.split(":");return{type:t,date:Number(r),match:!!Number(n)}}}class ie{convert(e){return[String(Boolean(e))]}convertFilterValue(e){return String(e)}}class ae{convert(e){return[Number(e)]}convertFilterValue(e){return String(e)}}class oe{constructor(){this._strategies={stringStrategy:new re,numberStrategy:new ee,booleanStrategy:new ie,rangeStrategy:new te,dateStrategy:new ne,recurringDateStrategy:new ae}}setStrategy(e){switch(this._checkOption=e,e){case"contain_or":case"contain_and":case"not_contain_or":case"not_contain_and":case"equal_or":case"equal_and":case"not_equal_or":case"not_equal_and":case"phone_equal_or":case"distance":case"search":this._currentStrategy=this._strategies.stringStrategy;break;case"bigger":case"lower":this._currentStrategy=this._strategies.numberStrategy;break;case"range":this._currentStrategy=this._strategies.rangeStrategy;break;case"date_in":case"date_out":this._currentStrategy=this._strategies.dateStrategy;break;case"value":this._currentStrategy=this._strategies.booleanStrategy;break;case"recurring_date":this._currentStrategy=this._strategies.recurringDateStrategy}return this}setEntity(e){return this._entity=this._currentStrategy.convert(e),this}getEntity(){return this._entity}setFilterValues(e){let t=Array.isArray(e)?e:[e];return this._filterValues=t.map((e=>this._currentStrategy.convertFilterValue(e))),this}getFilterValues(){return this._filterValues}getCheckOption(){return this._checkOption}}class se{constructor(){}filter(e,t){const r=this.checkIfAllFiltersHaveAndStrategy(e),n=[],i=e.filter((function(e){return e.valuesArray.length}));for(let e of t){let t=!0;for(let n=0;n<i.length;n++){const a=i[n],o=e.fields.find((function(e){return a.field_id==e.field_id})),s=new oe,l=new Z;switch(s.setStrategy(a.search_type).setEntity(o&&null!=o.field_value?o.field_value:null).setFilterValues(a.valuesArray),a.boolean_strategy){case"and":default:t=t&&l.check(s);break;case"or":t=t||l.check(s)}if(!t&&r)break}t&&n.push(e)}return n.length||e.length&&!n.length?n:t}checkIfAllFiltersHaveAndStrategy(e){return e.every((e=>!e.boolean_strategy||"and"==e.boolean_strategy))}}var le=__webpack_require__(9832);function ce(e,t){let r=[];return t.forEach((e=>{r.push({path_to_compare:e,match_coefficient:0})})),e.forEach(((e,t)=>{for(var n=0;n<r.length;n++)r[n].path_to_compare[t]==e&&(r[n].match_coefficient+=1/(t+1))})),r.sort(((e,t)=>t.match_coefficient-e.match_coefficient)),r[0].path_to_compare}function ue(e,t,r,n,i,a){e.forEach((e=>{let o=!0,s=he(e,r).field_value;t.forEach((t=>{let a=he(t,r).field_value;s==a&&(o=!1,de(e,t,n,i))})),o&&a(e)}))}function pe(e,t,r,n,i,a){let o=new fe(t);if(e.forEach((e=>{let a=o.pullItemIndex(e.item_id);null!=a?de(e,t[a],r,n):i(e)})),a)for(const[e,r]of Object.entries(o.itemsMap))a(t[r])}function de(e,t,r,n){let i=!0;for(let r=0;r<e.fields.length;r++){let n=he(t,e.fields[r].field_id);n?n.field_value!=e.fields[r].field_value&&(i=i&&!1):i=i&&!1}i?n(e,t):r(e,t)}function he(e,t){let r=null;for(let n=0;n<e.fields.length;n++)t==e.fields[n].field_id&&(r=e.fields[n]);return r}class fe{constructor(e){this._itemsMap={},e.forEach(((e,t)=>{this._itemsMap[e.item_id]=t}))}pullItemIndex(e){let t=this._itemsMap[e];return delete this._itemsMap[e],t}getItemIndex(e){return this._itemsMap[e]}get itemsMap(){return this._itemsMap}}var me=__webpack_require__(5430),ge=__webpack_require__(8933),ye=__webpack_require__(5276);function _e(e){var t=new Date;let r=Math.floor(t.getMonth()/3),n=t.getFullYear();switch(e){case"next_day":case"tomorrow,future":return me(t,{days:1}).getTime();case"two_days_after":return me(t,{days:2}).getTime();case"three_days_after":return me(t,{days:3}).getTime();case"four_days_after":return me(t,{days:4}).getTime();case"next_week":return me(t,{weeks:1}).getTime();case"two_weeks_after":return me(t,{weeks:2}).getTime();case"three_weeks_after":return me(t,{weeks:3}).getTime();case"this_sunday":return ge(t,0,{weekStartsOn:1});case"this_monday":return ge(t,1,{weekStartsOn:1});case"this_tuesday":return ge(t,2,{weekStartsOn:1});case"this_wednesday":return ge(t,3,{weekStartsOn:1});case"this_thursday":return ge(t,4,{weekStartsOn:1});case"this_friday":return ge(t,5,{weekStartsOn:1});case"this_saturday":return ge(t,6,{weekStartsOn:1});case"today_current,current":case"7_days_past,past":case"10_days_past,past":case"14_days_past,past":case"30_days_past,past":case"year_past,past":return me(t,{days:0}).getTime();case"7_days_future,future":return me(t,{days:7}).getTime();case"10_days_future,future":return me(t,{days:10}).getTime();case"14_days_future,future":return me(t,{days:14}).getTime();case"30_days_future,future":return me(t,{days:30}).getTime();case"yesterday,past":return me(t,{days:-1}).getTime();case"year_future,future,calendar":return me(new Date(t.getFullYear()+1,0,0),{years:1}).getTime();case"year_past,past,calendar":return me(new Date(t.getFullYear(),0,0),{years:0}).getTime();case"week_current,current":return(i=new Date,a=(i=new Date(i)).getDay(),o=i.getDate()-a+6+(0==a?6:1),new Date(i.setDate(o))).getTime();case"month_current,current":return new Date(t.getFullYear(),t.getMonth()+1,0).getTime();case"quarter_current,current":return new Date(n,3*(r+1),0).getTime();case"year_current,current":return me(new Date(t.getFullYear()+1,0,0),{years:0}).getTime();case"week_next,future":return function(e){var t=(e=new Date(e)).getDay(),r=e.getDate()-t+13+(0==t?-6:1);return new Date(e.setDate(r))}(new Date).getTime();case"month_next,future":return new Date(t.getFullYear(),t.getMonth()+2,0).getTime();case"quarter_next,future":return new Date(n,3*(r+1)+3,0).getTime();case"year_next,future":return me(t,{years:1}).getTime();case"week_past,past":return function(e){var t=(e=new Date(e)).getDay(),r=e.getDate()-t-1+(0==t?-6:1);return new Date(e.setDate(r))}(new Date).getTime();case"month_past,past":return new Date(t.getFullYear(),t.getMonth(),0,0).getTime();case"quarter_past,past":return new Date(n,3*(r+1)-3,0).getTime();default:return t.getTime()}var i,a,o}function be(e){return e&&"object"==typeof e&&"[object RegExp]"!==Object.prototype.toString.call(e)&&"[object Date]"!==Object.prototype.toString.call(e)}function ve(e,t){var r;return t&&!0===t.clone&&be(e)?Se((r=e,Array.isArray(r)?[]:{}),e,t):e}function we(e,t,r){var n=e.slice();return t.forEach((function(t,i){void 0===n[i]?n[i]=ve(t,r):be(t)?n[i]=Se(e[i],t,r):-1===e.indexOf(t)&&n.push(ve(t,r))})),n}function Se(e,t,r){e=void 0!==e?e:{},t=void 0!==t?t:{};var n=Array.isArray(t),i=(r||{arrayMerge:we}).arrayMerge||we;return n?Array.isArray(e)?i(e,t,r):ve(t,r):function(e,t,r){var n={};return be(e)&&Object.keys(e).forEach((function(t){n[t]=ve(e[t],r)})),Object.keys(t).forEach((function(i){be(t[i])&&e[i]?n[i]=Se(e[i],t[i],r):n[i]=ve(t[i],r)})),n}(e,t,r)}Se.all=function(e,t){if(!Array.isArray(e)||e.length<2)throw new Error("first argument should be an array with at least two elements");return e.reduce((function(e,r){return Se(e,r,t)}))};class Ee{constructor(e){this.gudhub=e}mergeFieldLists(e,t){let r=JSON.parse(JSON.stringify(e)),n=JSON.parse(JSON.stringify(t)),i=n.map((e=>e.field_id));return n.length?n.reduce(((e,t)=>{let r=null;if(e.find(((e,n)=>t.field_id==e.field_id&&(r=n,!0))))e[r]=this.gudhub.util.mergeObjects(e[r],t);else{let r=t.data_model&&t.data_model.interpretation&&t.data_model.interpretation.find((e=>"table"==e.src))||{settings:{show_field:1}};if(r.settings.show_field){let n=this.gudhub.util.mergeObjects({show:1},r),i=this.gudhub.util.mergeObjects(n,t);e.push(i)}}return e}),r).filter((function(e){return e.show&&-1!=i.indexOf(e.field_id)})):[]}createFieldsListToView(e,t){const r=this;return new Promise((async n=>{let i=await this.gudhub.getFieldModels(e);if(0!==t.length){let e=[];t.forEach(((r,n)=>{let o=i.find((e=>r.field_id==e.field_id));if(o){let t=o.data_model.interpretation.find((e=>"table"==e.src));t||(t={settings:{show_field:1}}),e.push({field_id:o.field_id,show:r.show,width:r.width?r.width:"150px"})}n+1==t.length&&a(e)}))}else a(t);function a(e){let t=0;i.forEach(((a,o)=>{e.find((e=>a.field_id==e.field_id))?(t==i.length-1&&n(e),t++):r.gudhub.ghconstructor.getInstance(a.data_type).then((r=>{if(r){let o=r.getTemplate().model.data_model.interpretation.find((e=>"table"==e.src));o||(o={settings:{show_field:1}}),e.push({field_id:a.field_id,show:o.settings.show_field}),t==i.length-1&&n(e)}t++}),(function(e){t++}))}))}}))}createFieldsListToViewWithDataType(e,t){return new Promise((async r=>{let n=[],i=await this.gudhub.getFieldModels(e),a=i.map((e=>+e.field_id));const o=[];n=i.reduce(((e,t)=>(e.find(((e,r)=>t.field_id==e.field_id))||(e.push({field_id:t.field_id,data_type:t.data_type}),o.push(new Promise((async r=>{const n=(await this.gudhub.ghconstructor.getInstance(t.data_type)).getTemplate().model.data_model.interpretation.find((e=>"table"==e.src))||{settings:{show_field:1}};e.find((e=>e.field_id==t.field_id)).show=n.settings.show_field,r(!0)})))),e)),t),Promise.all(o).then((()=>{n=n.filter((e=>-1!=a.indexOf(e.field_id))),r(n)}))}))}}class xe{constructor(e){this.gudhub=e,this.selectedItems={}}async selectItems(e,t){if(!this.selectedItems.hasOwnProperty(e)){this.selectedItems[e]={items:[],app:[]};let t=await this.gudhub.getApp(e);this.selectedItems[e].app=t}let r=this.selectedItems[e],n=r.items.map((e=>e.item_id));t.forEach((e=>{-1!=n.indexOf(e.item_id)?r.items.splice(n.indexOf(e.item_id),1):r.items[r.items.length]=e}))}getSelectedItems(e){return this.selectedItems[e]?this.selectedItems[e]:{items:[],app:[]}}clearSelectedItems(e){this.selectedItems[e]&&(this.selectedItems[e].items=[])}isItemSelected(e,t){let r=this.getSelectedItems(e);return null!==r&&(r=r.items.map((e=>e.item_id)),-1!=r.indexOf(t))}}class ke{constructor(e){this.gudhub=e,this.appsConnectingMap={apps:[],fields:[],items:[],views:[]}}createAppsFromTemplate(e,t,r,n){const i=this;return new Promise((a=>{const o=100/(6*e.apps.length);let s=0;i.createApps(e,(e=>{s+=1,r&&r.call(this,{percent:s*o,status:e})}),n).then((e=>{i.createItems(e,t,(e=>{"string"==typeof e?(s+=1,r&&r.call(this,{percent:s*o,status:e})):"object"==typeof e&&(r&&r.call(this,{status:"Done",apps:e}),a())}),n)}))}))}createItems(e,t,r,n){return new Promise((async i=>{const a=t||1e5,o=this;let s=[],l=[];const{accesstoken:c}=await o.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((e=>{l.push(new Promise((async t=>{let i;i=n?await o.gudhub.req.axiosRequest({url:`https://gudhub.com/GudHub_Test/api/app/get?token=${c}&app_id=${o._searchOldAppId(e.app_id,o.appsConnectingMap.apps)}`,method:"GET"}):await o.gudhub.getApp(o._searchOldAppId(e.app_id,o.appsConnectingMap.apps)),r&&r.call(this,`GET APP: ${i.app_name} (Items steps)`);let l=JSON.parse(JSON.stringify(i)),u=l.items_list.map((e=>({index_number:e.index_number,item_id:0,fields:[]}))).filter(((e,t)=>t<=a));o.gudhub.addNewItems(e.app_id,u).then((n=>{r&&r.call(this,`ADD NEW ITEMS: ${i.app_name} (Items steps)`),e.items_list=n,o._updateMap(e.items_list,l.items_list),o._addFieldValue(l.items_list,e.items_list,o.appsConnectingMap),s.push(e),t()}))})))})),Promise.all(l).then((()=>{s.forEach((e=>{e.items_list.forEach((e=>{e.fields.forEach((e=>{o.appsConnectingMap.fields.forEach((t=>{e.field_id===t.old_field_id&&(e.field_id=t.new_field_id,e.element_id=t.new_field_id)}))}))}))})),o.deleteField(s),o.replaceValue(s,o.appsConnectingMap).then((()=>{const e=[];s.forEach((t=>{e.push(new Promise((e=>{let n=t.items_list.map((e=>(e.fields.forEach((e=>{delete e.data_id})),e)));o.gudhub.updateItems(t.app_id,n).then((()=>{r&&r.call(this,`REPLACE VALUE: ${t.app_name} (Items steps)`),e()}))})))})),Promise.all(e).then((()=>{r.call(this,s),i()}))}))}))}))}deleteField(e){e.forEach((e=>{e.items_list.forEach((t=>{t.fields=t.fields.filter((t=>e.field_list.findIndex((e=>e.field_id==t.field_id))>-1))}))}))}replaceValue(e,t){return new Promise((async r=>{const n=[],i=this;e.forEach((e=>{e.field_list.forEach((r=>{"item_ref"===r.data_type&&i._replaceValueItemRef(e,r,t),n.push(new Promise((t=>{i.gudhub.ghconstructor.getInstance(r.data_type).then((n=>void 0===n?(console.log("ERROR WHILE GETTING INSTANCE OF ",r.data_type),void t({type:r.data_type})):"file"==n.getTemplate().constructor?i.gudhub.util.fileInstallerHelper(e.app_id,e.items_list,r.field_id).then((e=>{t(e)})):void("document"==n.getTemplate().constructor?i.documentInstallerHelper(e.app_id,e.items_list,r.field_id).then((e=>{t(n)})):t(n))))})))}))})),n.length>0?Promise.all(n).then((e=>{r(e)})):r(result)}))}documentInstallerHelper(e,t,r){const n=this;return new Promise((async i=>{for(const i of t){const t=i.item_id,a=i.fields.find((e=>e.element_id===r));if(a&&a.field_value&&a.field_value.length>0){const i=await n.gudhub.getDocument({_id:a.field_value});if(i&&i.data){const o=await n.gudhub.createDocument({app_id:e,item_id:t,element_id:r,data:i.data});a.field_value=o._id}}}i()}))}_replaceValueItemRef(e,t,r){e.items_list.forEach((e=>{e.fields.forEach((e=>{if(e.field_id===t.field_id&&e.field_value){let t=e.field_value.split(",");t.forEach(((e,n)=>{let i=e.split(".");r.apps.forEach((e=>{i[0]==e.old_app_id&&(i[0]=e.new_app_id)})),r.items.forEach((e=>{i[1]==e.old_item_id&&(i[1]=e.new_item_id)})),t[n]=i.join(".")})),e.field_value=t.join(",")}}))}))}_addFieldValue(e,t,r){t.forEach((t=>{r.items.forEach((r=>{t.item_id===r.new_item_id&&e.forEach((e=>{r.old_item_id===e.item_id&&(t.fields=e.fields)}))}))}))}_updateMap(e,t){t.forEach((t=>{e.forEach((e=>{t.index_number===e.index_number&&this.appsConnectingMap.items.push({old_item_id:t.item_id,new_item_id:e.item_id})}))}))}_searchOldAppId(e,t){let r=0;return t.forEach((t=>{t.new_app_id===e&&(r=t.old_app_id)})),r}createApps(e,t,r){const n=this;let i={step_size:100/(3*e.apps.length),apps:[]};return new Promise((async a=>{let o={},s=[],l=[];const{accesstoken:c}=await n.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 u of e.apps){let p;p=r?await n.gudhub.req.axiosRequest({url:`https://gudhub.com/GudHub_Test/api/app/get?token=${c}&app_id=${u}`,method:"GET"}):await n.gudhub.getApp(u),t&&t.call(this,`GET APP: ${p.app_name} (App steps)`);let d=JSON.parse(JSON.stringify(p));o[d.app_id]=d,i.apps.push(d.icon);let h=n.prepareAppTemplate(d);h.app_name=h.app_name+" New",h.privacy=1,e.data_to_change&&(e.data_to_change.name&&(h.app_name=e.data_to_change.name),e.data_to_change.icon&&(h.icon=e.data_to_change.icon)),n.resetViewsIds(h),n.gudhub.createNewApp(h).then((r=>{t&&t.call(this,`CREATE NEW APP: ${p.app_name} (App steps)`),s.push(r),n.mapApp(d,r,n.appsConnectingMap),e.apps.length==s.length&&(n.connectApps(s,n.appsConnectingMap,o),s.forEach((r=>{n.gudhub.updateApp(r).then((r=>{t&&t.call(this,`UPDATE APP: ${p.app_name} (App steps)`),l.push(r),e.apps.length==l.length&&a(l)}))})))}))}}))}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((e=>{t.field_list.forEach((t=>{e.name_space==t.name_space&&r.fields.push({name_space:e.name_space,old_field_id:e.field_id,new_field_id:t.field_id})}))})),e.views_list.forEach((e=>{t.views_list.forEach((t=>{e.name==t.name&&r.views.push({name:e.name,old_view_id:e.view_id,new_view_id:t.view_id})}))}))}crawling(e,t){let r=null===e?[]:Object.keys(e);const n=this;r.length>0&&r.forEach((r=>{let i=e[r];void 0!==i&&"string"!=typeof e&&(t(r,i,e),n.crawling(i,t))}))}resetViewsIds(e){e.view_init=0,this.crawling(e.views_list,(function(e,t,r){"view_id"!=e&&"container_id"!=e||(r[e]=0)}))}connectApps(e,t,r){const n=this;return e.forEach((e=>{t.apps.forEach((r=>{e.view_init===r.new_view_init&&t.views.forEach((t=>{r.old_view_init===t.old_view_id&&(e.view_init=t.new_view_id)}))})),n.crawling(e.field_list,(function(i,a,o){if(-1!==i.indexOf("field_id")||-1!==i.indexOf("FieldId")||-1!==i.indexOf("destination_field")){let e=String(a).split(","),r=[];t.fields.forEach((t=>{e.forEach((e=>{e==t.old_field_id&&r.push(t.new_field_id)}))})),r.length&&(o[i]=r.join(","))}if(-1==i.indexOf("app_id")&&-1==i.indexOf("AppId")&&-1==i.indexOf("destination_app")||t.apps.forEach((e=>{a==e.old_app_id&&(o[i]=e.new_app_id)})),-1!==i.indexOf("view_id")&&t.views.forEach((e=>{a==e.old_view_id&&(o[i]=e.new_view_id)})),-1!==i.indexOf("src")&&isFinite(a)){const s="container_id",l=t.apps.find((t=>t.new_app_id===e.app_id)).old_app_id,c=n.findPath(r[l].views_list,s,a);o[i]=`${n.getValueByPath(e.views_list,c,s)}`}}))})),e}getValueByPath(e,t,r){let n=e;return t.split(".").forEach((e=>{n=n[e]})),n[r]}findPath(e,t,r){let n=!1,i=!1,a=[];return this.crawling(e,(function(e,o,s){i&&a.reverse().forEach((e=>{i&&(e.delete=!0,e.parent===s&&(i=!1,a=a.filter((e=>!e.delete)),a.reverse()))})),n||("object"==typeof s[e]&&a.push({prop:e,parent:s}),o==r&&t===e?n=!0:Object.keys(s).pop()===e&&"object"!=typeof s[e]&&(i=!0))})),a.map((e=>e.prop)).join(".")}prepareAppTemplate(e){let t=JSON.parse(JSON.stringify(e));return this.crawling(t.views_list,(function(e,t,r){"element_id"==e&&(r.element_id=-Number(t),r.create_element=-Number(t))})),t.field_list.forEach((e=>{e.create_field=-Number(e.field_id),e.element_id=-Number(e.field_id),e.field_id=-Number(e.field_id),e.field_value=""})),t.items_list=[],delete t.app_id,delete t.icon.id,delete t.group_id,delete t.trash,delete t.last_update,delete t.file_list,t}}class Ae{constructor(e){this.gudhub=e}fileInstallerHelper(e,t,r){const n=this;return new Promise((i=>{const a=[[]];let o=Promise.resolve(),s=[];t.forEach((t=>{const n=t.item_id,i=t.fields.find((e=>e.element_id===r));i&&i.field_value&&i.field_value.split(".").forEach((t=>{const i={source:t,destination:{app_id:e,item_id:n,element_id:r}};10!==a[a.length-1].length?a[a.length-1].push(i):a.push([i])}))})),a.forEach((e=>{o=o.then((()=>n.gudhub.duplicateFile(e))).then((e=>{s=[...s,...e]}))})),o.then((()=>{t.forEach((e=>{const t=e.item_id,n=e.fields.find((e=>e.element_id===r));n&&n.field_value&&(n.field_value="",s.forEach((e=>{e.item_id===t&&(n.field_value=n.field_value.split(",").filter((e=>e)).concat(e.file_id).join(","))})))})),i()}))}))}}async function Ie(e){await Promise.all(e);let t=!0;for(const r of e){const e=await je(r);if("pending"===e.state){t=!1;break}if("rejected"===e.state)throw e.reason}return!!t||Ie(e)}function je(e){const t={state:"pending"};return Promise.race([e,t]).then((e=>e===t?e:{state:"resolved",value:e}),(e=>({state:"rejected",reason:e})))}class Oe{constructor(e){this.gudhub=e,this.MergeFields=new Ee(e),this.ItemsSelection=new xe(e),this.AppsTemplateService=new ke(e),this.FileHelper=new Ae(e)}prefilter(e,t={}){return async function(e,t,r,n={}){const i=[],a={variableMethodcurrent_app:()=>[n.current_app_id||n.app_id],variableMethodelement_app:()=>[n.element_app_id],variableMethodcurrent_item:()=>[`${n.current_app_id||n.app_id}.${n.item_id}`],variableMethoduser_id:()=>[t.getUser().user_id],variableMethoduser_email:e=>[t.getUser().username],variableMethodtoday(e){const t=new Date,r=new Date(t.getFullYear(),t.getMonth(),t.getDate()),n=new Date(t.getFullYear(),t.getMonth(),t.getDate()+1);return[r.valueOf().toString()+":"+n.valueOf().toString()]},variableMethodvariable:e=>[n[e]]};if(e)for(const t of e)if(t)switch(t.input_type){case"variable":t.valuesArray=[];for(const e of t?.input_value.split(",")){const r=a[t.input_type+"Method"+e];"function"==typeof r?t.valuesArray?t.valuesArray.push(...r()):t.valuesArray=r():t.valuesArray?t.valuesArray.push(...a.variableMethodvariable(e)):t.valuesArray=a.variableMethodvariable(e)}i.push(t);break;case"field":const e=await o({app_id:n.current_app_id||n.app_id,item_id:n.item_id,field_id:t.input_value});null!=e&&t.valuesArray.push(e),i.push(t);break;default:i.push(t)}else i.push(t);function o(e){return new Promise((t=>{r.on("gh_value_get",e,(function n(i,a){r.destroy("gh_value_get",e,n),t(a)})).emit("gh_value_get",{},e)}))}return i}(e,this.gudhub.storage,this.gudhub.pipeService,t)}filter(e,t){return function(e,t){const r=new se;return e&&e.length?r.filter(t,e):[]}(e,t)}mergeFilters(e,t){return function(e,t){const r=[];let n=[];if(e.length>0?e.forEach((e=>{n.push(e)})):n=t,n.length>0){n.forEach(((e,i)=>{for(let a=0;a<t.length;a++)e.field_id==t[a].field_id&&(r.push(e.field_id),n[i]=gudhub.mergeObjects(t[a],e))}));for(let e=0;e<t.length;e++)r.includes(t[e].field_id)||n.push(t[e])}return n}(e,t)}group(e,t){return function(e,t){let r,n=[];e?r=e.split(","):n=t;let i=new Set;return e&&t.forEach((e=>{let t="";r.forEach(((a,o)=>{const s=e.fields.find((e=>e.field_id==a));s&&(t+=s.field_value),r.length-1==o&&function(e){const t=!i.has(e);return t&&i.add(e),t}(t)&&n.push(e)}))})),n}(e,t)}async getFilteredItems(e=[],t=[],r,n,i,a="",o,s){const l=await this.prefilter(t,{element_app_id:r,app_id:n,item_id:i}),c=this.filter(e,l);return this.group(a,c).filter((e=>!o||1===Y([e],o).length)).filter((e=>!s||1===Y([e],s).length))}jsonToItems(e,t){return function(e,t){let r=[];t.forEach((t=>{let n=[];try{n=le.paths(e,t.json_path),r.push({field_id:t.field_id,json_paths:n,json_paths_length:n.length})}catch(e){console.log(e)}})),r.sort(((e,t)=>t.json_paths_length-e.json_paths_length));let n=function(e){let t=[];return e.length&&e[0].json_paths.forEach((r=>{let n={fields:[]};e.forEach((e=>{n.fields.push({field_id:e.field_id,json_path:ce(r,e.json_paths)})})),t.push(n)})),t}(r).map((t=>({fields:t.fields.map((t=>({field_id:t.field_id,field_value:le.value(e,t.json_path)})))})));return n}(e,t)}getDate(e){return _e(e)}checkRecurringDate(e,t){return function(e,t){e=new Date(e);let r=new Date;switch(t){case"day":return e.getDate()+"."+e.getMonth()==r.getDate()+"."+r.getMonth();case"week":let t=(new Date).getFullYear(),n=new Date(t,e.getMonth(),e.getDate());return ye(n,r);case"month":return e.getMonth()===r.getMonth();default:return!0}}(e,t)}populateItems(e,t,r){return function(e,t,r){var n=JSON.parse(JSON.stringify(e));return r?function(e,t){return e.forEach((e=>{t.forEach((t=>{let r=e.fields.find((e=>e.element_id==t.element_id));r?r.field_value=t.field_value:(t.field_id=t.element_id,e.fields.push(t))}))})),e}(n,t):function(e,t){return e.forEach((e=>{e.fields=[].concat(t)})),e}(n,t)}(e,t,r)}populateWithDate(e,t){return function(e,t){return e.forEach((e=>{t.forEach((t=>{let r=e.fields.find((e=>e.element_id==t.element_id));r?t.data_range?(t.date_type.includes("calendar"),r.field_value=`${function(e){let t=new Date;switch(e){case"week_current,current":case"week_next,future":case"week_past,past":return function(t){var r=t.getDay();let n;e.includes("week_current,current")&&(n=0),e.includes("week_next,future")&&(n=7),e.includes("week_past,past")&&(n=-7);let i=t.getDate()-r+n+(0==r?-6:1);return new Date(t.setDate(i))}(new Date).getTime();case"month_current,current":return new Date(t.getFullYear(),t.getMonth(),1).getTime();case"quarter_current,current":case"quarter_next,future":case"quarter_past,past":return function(t){let r,n,i=Math.floor(t.getMonth()/3),a=t.getFullYear();return e.includes("quarter_current,current")&&(r=0,n=0),e.includes("quarter_next,future")&&(r=3,n=0),e.includes("quarter_past,past")&&(r=-3,n=0),new Date(a,3*i+r,1+n)}(new Date).getTime();case"year_current,current":return me(new Date(t.getFullYear(),0,1),{years:0}).getTime();case"month_next,future":return new Date(t.getFullYear(),t.getMonth()+1,1).getTime();case"year_next,future":case"today_current,current":case"7_days_future,future":case"10_days_future,future":case"14_days_future,future":case"30_days_future,future":return me(t,{days:0}).getTime();case"month_past,past":return new Date(t.getFullYear(),t.getMonth()-1,1).getTime();case"year_past,past":return me(t,{years:-1}).getTime();case"year_past,past,calendar":return me(new Date(t.getFullYear(),0,1),{years:-1}).getTime();case"year_future,future,calendar":return me(new Date(t.getFullYear()+1,0,1),{years:0}).getTime();case"tomorrow,future":return me(t,{days:1}).getTime();case"yesterday,past":return me(t,{days:-1}).getTime();case"7_days_past,past":return me(t,{days:-7}).getTime();case"10_days_past,past":return me(t,{days:-10}).getTime();case"14_days_past,past":return me(t,{days:-14}).getTime();case"30_days_past,past":return me(t,{days:-30}).getTime()}}(t.date_type)}:${_e(t.date_type)}`):r.field_value=_e(t.date_type):e.fields.push({field_id:t.element_id,element_id:t.element_id,field_value:_e(t.date_type)})}))})),e}(e,t)}populateWithItemRef(e,t,r,n,i,a){return function(e,t,r,n,i,a){let o=[];const s=function(e,t){let r=he(t,i);r&&(r.field_value=a+"."+e.item_id,o.push(t))};return r.forEach((r=>{e.forEach((e=>{!function(e,t,r,n,i){he(e,r).field_value==he(t,n).field_value&&i(e,t)}(e,r,t,n,s)}))})),o}(e,t,r,n,i,a)}compareItems(e,t,r){return function(e,t,r){const n=JSON.parse(JSON.stringify(e)),i=JSON.parse(JSON.stringify(t));let a={is_items_diff:!1,new_src_items:[],diff_src_items:[],same_items:[]};const o=function(e){a.diff_src_items.push(e)},s=function(e){a.same_items.push(e)},l=function(e){a.new_src_items.push(e)};return r?ue(n,i,r,o,s,l):pe(n,i,o,s,l),a.is_items_diff=a.new_src_items.length>0||a.diff_src_items.length>0,a}(e,t,r)}mergeItems(e,t,r){return function(e,t,r){let n=JSON.parse(JSON.stringify(e)),i=JSON.parse(JSON.stringify(t)),a=[];const o=function(e,t){a.push(function(e,t){return e.fields.forEach((e=>{let r=he(t,e.field_id);r?(r.field_value=e.field_value,e.history&&r.history&&(r.history=e.history.concat(r.history))):t.fields.push(e)})),t}(e,t))},s=function(e){a.push(e)},l=function(e){a.push(e)};return r?ue(n,i,r,o,s,l):pe(n,i,o,s,l,(function(e){a.push(e)})),a}(e,t,r)}mergeObjects(e,t,r){return function(e,t,r){return Se(e,t,r)}(e,t,r)}makeNestedList(e,t,r,n,i){return function(e,t,r,n,i){let a,o=JSON.parse(JSON.stringify(e)),s=Boolean(n)?n:"children",l=!!Boolean(i)&&i;for(a=0;a<o.length;a++)o[a][r]&&0!==o[a][r]&&o.forEach((e=>{o[a][r]==e[t]?(e[s]||(e[s]=[]),e[s].push(o[a]),o.splice(a,1),0==a?a=0:a--):e[s]&&c(e)}));function c(e){e[s].forEach((e=>{e[t]==o[a][r]?(e[s]||(e[s]=[]),e[s].push(o[a]),o.splice(a,1),0==a?a=0:a--):e[s]&&c(e)}))}return l&&function e(t){t.sort(((e,t)=>e[l]-t[l])),t.forEach((t=>{t[s]&&e(t[s])}))}(o),o}(e,t,r,n,i)}mergeChunks(e){return function(e){const t={};return e.forEach((e=>{e.items_list.forEach((e=>{const r=t[e.item_id];return r?(r.trash=e.trash,e.fields.forEach((e=>{let t=!0;r.fields=r.fields.map((r=>Number(r.field_id)===Number(e.field_id)?(t=!1,r.field_value!=e.field_value?{...e,history:e.history.concat(r.history)}:r):r)),t&&r.fields.push(e)}))):t[e.item_id]=e}))})),Object.values(t)}(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,n){return function(e,t,r,n,i){async function a(e,t,i){let s=null;if("array"===e.type&&(s=Number(e.is_static)?new Array(await o(e.childs,t,i)):await async function(e,t,i){const a=await r.gudhub.getApp(Number(e.app_id));let s=await async function(e=[],t=[],i="",a={}){return e.length?async function(e,t,i,a,o){const s=await r.gudhub.prefilter(JSON.parse(JSON.stringify(e)),{element_app_id:t,app_id:i,item_id:a,...n});return r.gudhub.filter(o,[...s,...e])}(e,i,i,a.item_id,t):[...t]}(e.filter,a.items_list,i,t);if(e.isSortable&&e.field_id_to_sort&&""!==e.field_id_to_sort){let t=s.flatMap((t=>{let r=t.fields.find((t=>t.field_id==e.field_id_to_sort));return r&&""!=r.field_value?t:[]})),r=s.filter((e=>{if(!t.includes(e))return e}));t=t.sort(((t,r)=>"desc"==e.sortType?r.fields.find((t=>t.field_id==e.field_id_to_sort)).field_value-t.fields.find((t=>t.field_id==e.field_id_to_sort)).field_value:t.fields.find((t=>t.field_id==e.field_id_to_sort)).field_value-r.fields.find((t=>t.field_id==e.field_id_to_sort)).field_value)),s=[...t,...r]}if(e.offset){let t;t=e.use_variables_for_limit_and_offset&&n?n[e.offset]:/^[0-9]+$/.test(e.offset)?e.offset:0,s=s.slice(t)}if(e.limit){let t;t=e.use_variables_for_limit_and_offset&&n?n[e.limit]:/^[0-9]+$/.test(e.limit)||0,0!==t&&(s=s.slice(0,t))}const l=s.map((async t=>o(e.childs,t,a.app_id)));return Promise.all(l)}(e,t,i)),"object"===e.type&&(s=Number(e.current_item)?await async function(e,t){const n=await r.gudhub.getApp(e.app_id),i=n.items_list||[];return o(e.childs,t||i[0],n.app_id)}(e,t):await o(e.childs,t,i)),"property"===e.type&&(s=await async function(e,t,n){switch(e.property_type){case"static":return e.static_field_value;case"variable":return"app_id"===e.variable_type?n:`${n}.${t.item_id}`;case"field_id":return e.field_id;case"function":if("function"==typeof e.function)return e.function(t,n,r.gudhub,...e.args);{const i=new Function("item, appId, gudhub","return (async "+e.function+")(item, appId, gudhub)");return await i(t,n,r.gudhub)}default:return!e.field_id&&e.name_space&&(e.field_id=await r.gudhub.getFieldIdByNameSpace(n,e.name_space)),Boolean(Number(e.interpretation))?await r.gudhub.getInterpretationById(Number(n),Number(t.item_id),Number(e.field_id),"value"):await r.gudhub.getFieldValue(Number(n),Number(t.item_id),Number(e.field_id))}}(e,t,i)),"object"==typeof e&&void 0===e.type){const r={};for(const n in e)if(e.hasOwnProperty(n)){const o=e[n],s=await a(o,t,i);r[n]=s[o.property_name]}return r}return{[e.property_name]:s}}async function o(e,t,r){const n=await e.map((async e=>a(e,t,r)));return(await Promise.all(n)).reduce(((e,t)=>({...e,...t})),{})}return a(e,t,i)}(e,t,this,r,n)}fileInstallerHelper(e,t,r){return this.FileHelper.fileInstallerHelper(e,t,r)}createAppsFromTemplate(e,t,r,n){return this.AppsTemplateService.createAppsFromTemplate(e,t,r,n)}createApps(e){return this.AppsTemplateService.createApps(e)}createItems(e,t){return this.AppsTemplateService.createItems(e,t)}compareObjects(e,t){return r=e,n=t,JSON.stringify(r)===JSON.stringify(n);var r,n}compareAppsItemsLists(e,t,r){const n=new Blob(['function createList(items) {\n return items.reduce(\n (acc, item) => {\n acc.list[item.item_id] = item;\n acc.ids.push(item.item_id);\n return acc;\n },\n { ids: [], list: {} }\n );\n };\n function compareItemsLists(oldItems, newItems) {\n const { ids: oldIds, list: oldList } = createList(oldItems);\n const { ids: newIds, list: newList } = createList(newItems);\n\n const deletedItemsIds = oldIds.filter((id) => !newIds.includes(id));\n const recentItemsIds = oldIds.filter((id) => !deletedItemsIds.includes(id));\n const newItemsIds = newIds.filter((id) => !oldIds.includes(id));\n\n const diff_fields_items = {};\n const diff_fields_items_Ids = [];\n \n recentItemsIds.forEach((id) => {\n const newItem = newList[id];\n const oldItem = oldList[id];\n\n oldItem.fields.forEach((field1) => {\n const sameField = newItem.fields.find(\n (field2) => Number(field2.field_id) === Number(field1.field_id)\n );\n\n if (!sameField) {\n if (!diff_fields_items[newItem.item_id]) {\n diff_fields_items[newItem.item_id] = [];\n diff_fields_items_Ids.push(newItem.item_id);\n }\n\n return diff_fields_items[newItem.item_id].push(field1);\n }\n\n if (field1.field_value != sameField.field_value) {\n if (!diff_fields_items[newItem.item_id]) {\n diff_fields_items[newItem.item_id] = [];\n diff_fields_items_Ids.push(newItem.item_id);\n }\n return diff_fields_items[newItem.item_id].push(field1);\n }\n });\n });\n\n return {\n newItems: newItemsIds.reduce((acc, id) => {\n acc.push(newList[id]);\n return acc;\n }, []),\n deletedItems: deletedItemsIds.reduce((acc, id) => {\n acc.push(oldList[id]);\n return acc;\n }, []),\n diff_fields_items_Ids,\n diff_fields_items,\n diff_items: diff_fields_items_Ids.reduce((acc, id) => {\n acc.push(oldList[id]);\n return acc;\n }, []),\n };\n }\n\n self.addEventListener("message", (event) => {\n const { items_list1, items_list2 } = event.data;\n\n const diff = compareItemsLists(items_list1, items_list2);\n self.postMessage({ diff });\n });'],{type:"application/javascript"});this.worker=new Worker(URL.createObjectURL(n)),this.worker.postMessage({items_list1:e,items_list2:t}),this.worker.addEventListener("message",(e=>{const{diff:t}=e.data;r(t)}))}dynamicPromiseAll(e){return Ie(e)}sortItems(e,t){return function(e,t){if(!e||!e.length)return[];if(!e[0].fields.length)return e;var r=t&&t.sort_field_id||e[0].fields[0].field_id;function n(e){for(var t=null,n=0;n<e.fields.length;n++)if(e.fields[n].field_id==r){t=e.fields[n].field_value;break}return t}return e.sort((function(e,t){var r=n(e),i=n(t);return null===r?-1:null===i?1:/^\d+$/.test(r)&&/^\d+$/.test(i)?Number(r)<Number(i)?-1:1:/^\d+$/.test(r)||/^\d+$/.test(i)?/^\d+$/.test(r)?-1:1:r.toLowerCase()>i.toLowerCase()?1:-1})),t&&t.descending?e.reverse():e}(e,t)}debounce(e,t){let r;return function(...n){clearTimeout(r),r=setTimeout((()=>{e.apply(this,n)}),t)}}}class Pe{constructor(e,t){this.req=e,this.storage=t}async login({username:e,password:t}={}){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:`${this.req.root}/auth/login`,form:{username:e,password:t}})}catch(e){console.log(e)}}async loginWithTokenApi(e){try{return await this.req.axiosRequest({method:"POST",url:`${this.req.root}/auth/login?accesstoken=${e}`})}catch(e){console.log(e)}}async updateTokenApi(e){try{return await this.req.axiosRequest({method:"POST",url:`${this.req.root}/auth/login`,form:{auth_key:e}})}catch(e){console.log(e)}}logoutApi(e){return this.req.post({url:"/auth/logout",form:{token:e}})}signupApi(e){return this.req.axiosRequest({method:"POST",url:`${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();return t.find((t=>t.user_id==e.user_id))||(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 e=await this.updateToken(this.storage.getUser().auth_key);this.storage.updateUser(e),r=e.accesstoken}return r}}var Te=__webpack_require__(960),Ce=__webpack_require__(738);class Ne{constructor(e){this.gudhub=e,this.cache={},this.modulesQueue={},this.angularInjector,this.nodeWindow}async getInstance(e){return this.getCached(e)||(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(t){let r,n=this.gudhub.storage.getModuleUrl(t);if(n)return"gh_element"===n.type&&("angular"===n.technology?r=await(0,Te.Z)(this.gudhub,t,n.url,this.angularInjector,this.nodeWindow):"class"===n.technology&&(r=await async function(t,r,n,i,a){try{n||console.error(`JS link must be provided for this data type - ${r}`);let o,s=t=>(Ce.P||global.hasOwnProperty("window")||(global.window=proxy,global.document=a.document,global.Element=a.Element,global.CharacterData=a.CharacterData,global.this=proxy,global.self=proxy,global.Blob=a.Blob,global.Node=a.Node,global.navigator=a.navigator,global.HTMLElement=a.HTMLElement,global.XMLHttpRequest=a.XMLHttpRequest,global.WebSocket=a.WebSocket,global.crypto=a.crypto,global.DOMParser=a.DOMParser,global.Symbol=a.Symbol,global.document.queryCommandSupported=e=>(console.log("QUERY COMMAND SUPPORTED: ",e),!1),global.angular=angular),new Promise((async n=>{let i=await e.get(t).catch((e=>{console.log(`Failed to fetch: ${t} in ghconstructor. Module id: ${r}`)}));n("data:text/javascript;charset=utf-8,"+encodeURIComponent(i.data))}))),l=await s(n);try{o=await import(l)}catch(e){console.log(`Error while importing module: ${r}`),console.log(e)}let c=new o.default(r);if(i&&Ce.P){const e=document.createElement("link");e.href=i,e.setAttribute("data-module",r),e.setAttribute("rel","stylesheet"),document.getElementsByTagName("head")[0].appendChild(e)}return{type:r,getTemplate:function(e,t,r,n,i,a){let o="false"!==r;return c.getTemplate(e,t,o,n,i,a)},getDefaultValue:function(e,t,r,n){return new Promise((async i=>{let a=c.getDefaultValue;i(a?await a(e,t,r,n):null)}))},getSettings:function(e,t,r){return c.getSettings(e,t,r)},filter:{getSearchOptions:function(e){let t=c;return t.filter&&t.filter.getSearchOptions?c.filter.getSearchOptions(e):[]},getDropdownValues:function(){let e=c;return e.filter&&e.filter.getDropdownValues?e.filter.getDropdownValues():[]}},getInterpretation:function(e,n,i,a,o,s){return new Promise((async l=>{let u=c;try{let r=await u.getInterpretation(t,e,s,o,a,i),c=r.find((e=>e.id==n))||r.find((e=>"default"==e.id));l({html:await c.content()})}catch(e){console.log(`ERROR IN ${r}`,e),l({html:"<span>no interpretation</span>"})}}))},getInterpretationsList:function(e,t,r,n){return c.getInterpretation(e,t,r,n)},getInterpretatedValue:function(e,t,r,n){return new Promise((async i=>{let a=c.getInterpretatedValue;i(a?await a(e,t,r,n):e)}))},onMessage:function(e,t,r){return new Promise((async n=>{const i=c.onMessage;i&&n(await i(e,t,r)),n(null)}))},extendController:function(e){c.getActionScope(e)},runAction:function(e){try{c.runAction(e)}catch(e){}},getWindowScope:function(e){return c.getWindowScope(e)},getWindowHTML:function(e){return c.getWindowHTML(e)}}}catch(e){console.log(e),console.log(`Failed in createClassInstance (ghconstructor). Module id: ${r}. JS url: ${n}`)}}(this.gudhub,t,n.js,n.css,this.nodeWindow))),r&&this.pupToCache(t,r),r;console.log(`Cannot find module: ${t}`)}}class Le{constructor(e,t,r,n,i,a,o,s){this.storage=e,this.pipeService=t,this.req=r,this.ws=n,this.applistReceived=!1,this.activateSW=o,this.chunksManager=i,this.util=a,this.appListeners(),this.dataService=s,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(e){return console.log(e),null}}async updateAppApi(e){try{return await this.req.post({url:"/api/app/update",form:{app:JSON.stringify(e)}})}catch(e){return console.log(e),null}}async deleteAppApi(e){try{return await this.req.post({url:"/api/app/delete",form:{app_id:e}})}catch(e){return console.log(e),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){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 t=0;t<e.items_list.length;t++){e.items_object[e.items_list[t].item_id]={};for(let r=0;r<e.items_list[t].fields.length;r++)e.items_object[e.items_list[t].item_id][e.items_list[t].fields[r].field_id]=e.items_list[t].fields[r]}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((t=>{this.pipeService.emit("gh_model_update",{app_id:e.app_id,field_id:t.field_id},t)}))}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,n)=>{r.app_id==e&&t.splice(n)})),t}updateAppsListInStorage(e=[]){for(const t of e){const e=this.storage.getApp(t.app_id);e?(e.from_apps_list=t.from_apps_list,e.permission=t.permission):this.addNewAppToStorage(t)}}async refreshApps(e=[]){for(const t of e)if(null!=t)try{const e=await this.dataService.getApp(t);if(e){e.items_object={};for(let t=0;t<e.items_list.length;t++){e.items_object[e.items_list[t].item_id]={};for(let r=0;r<e.items_list[t].fields.length;r++)e.items_object[e.items_list[t].item_id][e.items_list[t].fields[r].field_id]=e.items_list[t].fields[r]}this.updateAppInStorage(e),this.pipeService.emit("gh_app_views_update",{app_id:e.app_id},e.views_list)}}catch(e){console.log(e)}console.log("Apps refreshed: ",JSON.stringify(e))}async refreshAppsList(){let e=this.getAppListFromStorage(),t=(await this.getAppListApi()).map((t=>({...t,...e.find((e=>e.app_id===t.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,this.getApp(this.storage.getUser().app_init)}return e}async getAppInfo(e){const t=await this.getAppsList();return t?t.find((t=>t.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 n=this,i=new Promise((async(t,r)=>{try{let i=await n.dataService.getApp(e);if(i||r(),i.chunks&&i.chunks.length){let t=await n.chunksManager.getChunks(e,i.chunks);i.items_list=n.util.mergeChunks([...t,i])}t(i),n.saveAppInStorage(i),n.ws.addSubscription(e)}catch(e){r()}}));return n.appRequestCache.set(e,i),i}async updateApp(e){if(!e.views_list||!e.views_list.length||!e.show){const t=await this.getApp(e.app_id);e.views_list&&e.views_list.length||(e.views_list=t.views_list),void 0===e.show&&(e.show=t.show)}const 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){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}handleAppChange(e,t){}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 e=await this.getApp(t.app_id);this.pipeService.emit("gh_app_get",t,e)}})),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 n=await this.getAppsList();this.pipeService.emit("gh_apps_list_update",{recipient:"all"},n),r.field_list.forEach((e=>{this.pipeService.emit("gh_model_update",{app_id:r.app_id,field_id:e.field_id},e)}))})),this.pipeService.onRoot("gh_app_view_get",{},(async(e,t)=>{if(t&&t.app_id){const e=await this.getApp(t.app_id);e.views_list.forEach(((r,n)=>{r.view_id==t.view_id&&this.pipeService.emit("gh_app_view_get",t,e.views_list[n])}))}})),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 e=await this.updateAppInfo(t.app);this.pipeService.emit("gh_app_info_update",{app_id:t.app.app_id},e)}})),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)})),Ce.P&&this.activateSW&&navigator.serviceWorker.addEventListener("message",(async e=>{if("refresh app"===e.data.type){const t=await this.getApp(e.data.payload.app_id);t&&this.util.compareAppsItemsLists(t.items_list,e.data.payload.items_list.filter((e=>!e.trash)),(({diff_fields_items:t,diff_fields_items_Ids:r,diff_items:n,newItems:i,deletedItems:a})=>{(n.length||i.length||a.length)&&(this.pipeService.emit("gh_items_update",{app_id:e.data.payload.app_id},e.data.payload.items_list.filter((e=>!e.trash))),n.forEach((t=>this.pipeService.emit("gh_item_update",{app_id:e.data.payload.app_id,item_id:t.item_id},t)))),r.forEach((r=>{const n=t[r];n&&n.forEach((t=>{this.pipeService.emit("gh_value_update",{app_id:e.data.payload.app_id,item_id:r,field_id:t.field_id},t.field_value)}))}))})),e.data.payload.items_list=this.util.mergeChunks([t,e.data.payload]),this.saveAppInStorage(e.data.payload)}}))}}class Me{constructor(e,t,r,n,i){this.storage=e,this.pipeService=t,this.req=r,this.appProcessor=n,this.util=i,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(e){return console.log(e),null}}async updateItemsApi(e,t){try{return await this.req.post({url:"/api/items/update",form:{items:JSON.stringify(t),app_id:e}})}catch(e){return console.log(e),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(e){return console.log(e),null}}async addItemsToStorage(e,t){const r=await this.appProcessor.getApp(e);return r&&(t.forEach((t=>{r.items_list.push(t),r.items_object[t.item_id]={};for(let e=0;e<t.fields.length;e++)r.items_object[t.item_id][t.fields[e].field_id]=t.fields[e];this.pipeService.emit("gh_item_update",{app_id:e},[t])})),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((t=>{const n={app_id:e};this.pipeService.emit("gh_item_update",n,[t]),n.item_id=t.item_id,this.pipeService.emit("gh_item_update",n,t);const i=r.items_list.find((e=>e.item_id==t.item_id));i&&t.fields.forEach((e=>{const t=i.fields.find((t=>t.field_id==e.field_id));n.field_id=e.field_id,t?t.field_value!=e.field_value&&(t.field_value=e.field_value,r.items_object[i.item_id][t.field_id]=t,this.pipeService.emit("gh_value_update",n,e.field_value)):(i.fields.push(e),r.items_object[i.item_id][e.field_id]=e,this.pipeService.emit("gh_value_update",n,e.field_value))}))})),t}handleItemsChange(e,t){let r=this.util.compareItems(e.items_list,t.items_list);this.updateItemsInStorage(e.app_id,r.diff_src_items),this.addItemsToStorage(e.app_id,r.new_src_items)}async deleteItemsFromStorage(e,t=[]){const r=await this.appProcessor.getApp(e);r&&(r.items_list=r.items_list.filter((e=>!t.find((t=>e.item_id==t.item_id))||(delete r.items_object[e.item_id],!1))),this.pipeService.emit("gh_items_update",{app_id:e},r.items_list),this.storage.updateApp(r))}async getItems(e,t=!1){const r=await this.appProcessor.getApp(e,t);return r?r.items_list:null}async addNewItems(e,r){const n=r.map((e=>({...e,fields:t(e.fields)}))),i=await this.addItemsApi(e,n);return await this.addItemsToStorage(e,i),this.pipeService.emit("gh_items_add",{app_id:e},i),i}async updateItems(e,r){const n=r.map((e=>({...e,fields:t(e.fields)}))),i=await this.updateItemsApi(e,n);return await this.updateItemsInStorage(e,i)}async deleteItems(e,t){return this.deleteItemsApi(t).then((async t=>await this.deleteItemsFromStorage(e,t)))}itemListeners(){this.pipeService.onRoot("gh_items_get",{},(async(e,t)=>{if(t&&t.app_id){const e=await this.getItems(t.app_id);e?this.pipeService.emit("gh_items_get",t,e):this.pipeService.emit("gh_items_get",t,[])}})),this.pipeService.onRoot("gh_items_add",{},(async(e,t)=>{if(t&&t.app_id&&t.items){const e=await this.addNewItems(t.app_id,t.items);e?this.pipeService.emit("gh_items_add",t,e):this.pipeService.emit("gh_items_add",t,[])}})),this.pipeService.onRoot("gh_items_update",{},(async(e,t)=>{if(t&&t.app_id&&t.items){const e=await this.updateItems(t.app_id,t.items);e?this.pipeService.emit("gh_items_update",t,e):this.pipeService.emit("gh_items_update",t,[])}})),this.pipeService.onRoot("gh_item_get",{},(async(e,t)=>{if(t&&t.app_id){const e=(await this.getItems(t.app_id)).find((e=>e.item_id==t.item_id));this.pipeService.emit("gh_item_get",t,e)}})),this.pipeService.onRoot("gh_filtered_items_get",{},(async(e,t)=>{if(t&&t.element_app_id){const e=await this.getItems(t.element_app_id),r=await this.util.getFilteredItems(e,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,r)}})),this.pipeService.onRoot("gh_filter_items",{},(async(e,t)=>{if(t&&t.items){const e=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,e)}}))}}class Fe{constructor(e,t,r,n,i){this.storage=e,this.req=t,this.appProcessor=r,this.itemProcessor=n,this.pipeService=i,this.fieldListeners()}deleteFieldApi(e){return this.req.post({url:"/api/app/delete-field",form:{field_id:e}})}async updatedFieldApi(e,t={}){const r=await this.appProcessor.getApp(e),n={app_id:e,app_name:r.app_name,group_id:r.group_id,icon:r.icon,field_list:r.field_list.map((e=>e.field_id==t.field_id?{...e,...t}:e)),views_list:r.views_list};return this.appProcessor.updateApp(n)}setFieldValueApi(e,t,r,n){const i=[{item_id:t,fields:[{field_id:r,field_value:n}]}];return this.itemProcessor.updateItems(e,i)}deleteFieldInStorage(e,t){const r=this.storage.getApp(e);return r.field_list=r.field_list.filter((e=>e.file_id!=t)),r.items_list=r.items_list.map((e=>(e.fields=e.fields.filter((e=>e.field_id!=t)),e))),this.storage.updateApp(r),!0}updateFieldInStorage(e,t){const r=this.storage.getApp(e);return r.field_list=r.field_list.map((e=>e.field_id==t.field_id?{...e,...t}:e)),this.storage.updateApp(r),t}updateFieldValue(e,t,r,n){const i=this.storage.getApp(e);return i.items_list.forEach((e=>{e.item_id==t&&e.fields.forEach((t=>{t.field_id==r&&(t.field_value=n,i.items_object[e.item_id][t.field_id]=t)}))})),this.storage.updateApp(i),n}async getField(e,t){const r=await this.appProcessor.getApp(e);if(!r)return null;for(let e=0;e<r.field_list.length;e++)if(r.field_list[e].field_id==t)return r.field_list[e];return null}async getFieldIdByNameSpace(e,t){const r=await this.appProcessor.getApp(e);if(!r)return null;for(let e=0;e<r.field_list.length;e++)if(r.field_list[e].name_space==t)return r.field_list[e].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 n=null;const i=await this.appProcessor.getApp(e);try{n=i.items_object[t][r].field_value}catch(e){}return n}async setFieldValue(e,t,r,n){if(e&&t&&r)return await this.setFieldValueApi(e,t,r,n),this.updateFieldValue(e,t,r,n)}fieldListeners(){this.pipeService.onRoot("gh_value_get",{},(async(e,t)=>{if(t.app_id&&t.item_id&&t.field_id){let e=await this.getFieldValue(t.app_id,t.item_id,t.field_id);this.pipeService.emit("gh_value_get",t,e)}})),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 e=await this.getField(t.app_id,t.field_id);this.pipeService.emit("gh_model_get",t,e)}catch(e){console.log("Field model: ",e)}})),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 Re{constructor(e,t,r,n){this.storage=e,this.pipeService=t,this.req=r,this.appProcessor=n}async uploadFileApi(e,t,r){try{const n={"file-0":e,app_id:t,item_id:r};return await this.req.post({url:"/file/formupload",form:n})}catch(e){return console.log(e),null}}async uploadFileFromStringApi(e){try{return await this.req.post({url:"/file/upload",form:{file:JSON.stringify(e)}})}catch(e){return console.log(e),null}}async updateFileFromStringApi(e,t,r,n,i){try{const a={file_name:r,extension:n,file_id:t,format:i,source:e};return await this.req.post({url:"/file/update",form:{file:JSON.stringify(a)}})}catch(e){return console.log(e),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);return{file:r,data:await this.req.get({url:r.url+"?timestamp="+r.last_update,externalResource:!0}),type:"file"}}return!1}async duplicateFile(e){let t=await this.duplicateFileApi(e);return t.forEach((e=>{this.addFileToStorage(e.app_id,e)})),t}async deleteFileApi(e){try{return await this.req.get({url:`/file/delete?file_id=${e}`})}catch(e){return console.log(e),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((t=>{this.pipeService.emit("gh_file_upload",{app_id:e,item_id:t.item_id,file_id:t.file_id},t)})))}deleteFileFromStorage(e,t){const r=this.storage.getApp(t);if(r){let t;r.file_list=r.file_list.filter((r=>r.file_id!=e||(t=r,!1))),this.storage.updateApp(r),this.pipeService.emit("gh_file_delete",{file_id:e},t)}}updateFileInStorage(e,t,r){const n=this.storage.getApp(t);n&&(n.file_list=n.file_list.map((t=>t.file_id==e?r:t)),this.storage.updateApp(n),this.pipeService.emit("gh_file_update",{file_id:e}))}async getFile(e,t){const r=await this.appProcessor.getApp(e);return new Promise(((e,n)=>{e(r.file_list.find((e=>e.file_id==t))||"")}))}async getFiles(e,t=[]){const r=await this.appProcessor.getApp(e);return new Promise(((e,n)=>{e(r.file_list.filter((e=>t.some((t=>t==e.file_id))))||"")}))}async uploadFile(e,t,r){const n=await this.uploadFileApi(e,t,r);return this.addFileToStorage(t,n),n}async uploadFileFromString(e){const t=await this.uploadFileFromStringApi(e);return this.addFileToStorage(t.app_id,t),t}async updateFileFromString(e,t,r,n,i){const a=await this.updateFileFromStringApi(e,t,r,n,i);return this.updateFileInStorage(t,a.app_id,a),a}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(Boolean(t)){let n=await this.getFile(e,t);return!!Boolean(n)&&r.test(n.url)}return!1}}class De{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 qe{constructor(e,t,r,n,i){this.storage=e,this.pipeService=t,this.req=r,this.util=n,this.dataService=i,this.chunkApi=new De(r),this.itemListeners()}async getChunk(e,t){try{return this.dataService.getChunk(e,t)}catch(e){return console.log(e),null}}async getLastChunk(e){try{return this.chunkApi.getLastChunk(e)}catch(e){return console.log(e),null}}async getChunks(e,t){let r=[];return t&&(r=await Promise.all(t.map((t=>this.getChunk(e,t))))),r}itemListeners(){}async getApp(e){if(!e)return null;let t=this.getAppFromStorage(e);if(!t){if(this.getAppPromises[e])return this.getAppPromises[e];if(this.getAppPromises[e]=this.getAppApi(e),t=await this.getAppPromises[e],!t)return null;this.saveAppInStorage(t),this.ws.addSubscription(e)}return t}}class Ue{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="string"==typeof e.data?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 Be{constructor(e){this.gudhub=e}async getInterpretationObj(e,t,r,n,i,a){var o=[],s=t.data_model.interpretation.find((function(e){return e.src==r}))||t.data_model.interpretation.find((function(e){return"table"==e.src}))||{id:"default"};if(e.data_model&&e.data_model.interpretation){for(var l=0;l<e.data_model.interpretation.length;l++)e.data_model.interpretation[l].src!=r&&e.data_model.interpretation[l].src!=n||o.push(e.data_model.interpretation[l]);for(l=0;l<o.length;l++)if(o[l].settings&&o[l].settings.condition_filter&&o[l].settings.filters_list.length>0){const e=await gudhub.getItem(a,i);if(e&&gudhub.filter([e],o[l].settings.filters_list).length>0){s=o[l];break}}else s=gudhub.mergeObjects(s,o[l])}return s}getInterpretation(e,t,r,n,i,a,o){const s=this;return new Promise((async(l,c)=>{var u=t&&t.data_type?t.data_type:r;u?gudhub.ghconstructor.getInstance(u).then((async function(r){if(r){var p=await s.getInterpretationObj(t,r.getTemplate().model,n,o,i,a);r.getInterpretation(e,p.id,u,t,i,a).then((function(e){l(gudhub.mergeObjects(e,p))}),(function(e){c()}))}}),(function(e){})):console.error("Get Interpretation: data_type is undefined",r,t)}))}async getInterpretationById(e,t,r,n,i=null,a=null){let o=null==i?await this.gudhub.getFieldValue(e,t,r):i,s=null==a?await this.gudhub.getField(e,r):a;if(null==s)return"";const l=await this.gudhub.ghconstructor.getInstance(s.data_type),c=await l.getInterpretation(o,n,s.data_type,s,t,e);return"<span>no interpretation</span>"==c.html?o:c.html}}function $e(e,t){switch(t.api){case"/items/update":console.log("/items/update - ",t),e.itemProcessor.updateItemsInStorage(t.app_id,t.response);break;case"/items/add":console.log("/items/add - ",t),e.itemProcessor.addItemsToStorage(t.app_id,t.response);break;case"/items/delete":console.log("/items/delete - ",t),e.itemProcessor.deleteItemsFromStorage(t.app_id,t.response);break;case"/app/update":console.log("/app/update - ",t),e.appProcessor.updateAppFieldsAndViews(t.response);break;case"/file/delete":console.log("file/delete - ",t),e.fileManager.deleteFileFromStorage(t.response.file_id,t.app_id);break;case"/file/upload":console.log("file/upload - ",t),e.fileManager.addFileToStorage(t.app_id,t.response);break;case"/file/formupload":console.log("file/formupload - ",t);break;case"/file/update":e.fileManager.updateFileInStorage(t.response.file_id,t.response.app_id,t.response),console.log("file/update - ",t);break;case"/new/file/duplicate":e.fileManager.addFilesToStorage(t.app_id,t.response),console.log("new/file/duplicate - ",t);break;case"/api/new/document/insert-one":e.documentManager.emitDocumentInsert(t.response),console.log("/api/new/document/insert-one - ",t);break;case"/ws/emit-to-user":console.log("/ws/emit-to-user - ",t);break;case"/ws/broadcast-to-app-subscribers":console.log("/ws/broadcast-to-app-subscribers - ",t);const r=JSON.parse(t.response);if(!r.data_type)return;e.ghconstructor.getInstance(r.data_type).then((e=>{e.onMessage(t.app_id,t.user_id,r)}));break;default:console.warn("WEBSOCKETS is not process this API:",t.api)}}class Ge{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(e){return console.log(e),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(e){return console.log(e),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(e){return console.log(e),null}}async addUserToGroupApi(e,t,r){try{const n={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:n})}catch(e){return console.log(e),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(e){return console.log(e),null}}async updateUserInGroupApi(e,t,r){try{const n={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:n})}catch(e){return console.log(e),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(e){return console.log(e),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(e){return console.log(e),null}}}class We{constructor(e,t){this.req=t,this.gudhub=e}async addAppToGroupApi(e,t,r){try{const n={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:n})}catch(e){return console.log(e),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(e){return console.log(e),null}}async updateAppInGroupApi(e,t,r){try{const n={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:n})}catch(e){return console.log(e),null}}async deleteAppFromGroupApi(e,t,r){try{const n={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:n})}catch(e){return console.log(e),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(e){return console.log(e),null}}}class He{constructor(e,t,r){this.req=t,this.gudhub=e,this.pipeService=r,this.groupManager=new Ge(e,t),this.appGroupSharing=new We(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 n=await this.groupManager.addUserToGroupApi(e,t,r);return this.pipeService.emit("group_members_add",{app_id:"group_sharing"},n),n}getUsersByGroup(e){return this.groupManager.getUsersByGroupApi(e)}async updateUserInGroup(e,t,r){let n=await this.groupManager.updateUserInGroupApi(e,t,r);return this.pipeService.emit("group_members_update",{app_id:"group_sharing"},n),n}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 Ve{constructor(e,t){this.req=t,this.gudhub=e}async add(e,t,r){try{const n={token:await this.gudhub.auth.getToken(),app_id:e,user_id:t,sharing_permission:r};return await this.req.post({url:"/sharing/add",form:n})}catch(e){return console.log(e),null}}async update(e,t,r){try{const n={token:await this.gudhub.auth.getToken(),app_id:e,user_id:t,sharing_permission:r};return await this.req.post({url:"/sharing/update",form:n})}catch(e){return console.log(e),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(e){return console.log(e),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(e){return console.log(e),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(e){return console.log(e),null}}}class ze{constructor(e){this.gudhub=e}async emitToUser(e,t){const r={user_id:e,data:"object"==typeof t?JSON.stringify(t):t};return await this.gudhub.req.post({url:"/ws/emit-to-user",form:r})}async broadcastToAppSubscribers(e,t,r){const n={app_id:e,data:JSON.stringify({data_type:t,data:r})};return await this.gudhub.req.post({url:"/ws/broadcast-to-app-subscribers",form:n})}}class Je{}class Xe extends Je{}class Qe{constructor(e){this.req=e}async getApp(e){return this.req.get({url:"/api/app/get",params:{app_id:e}})}}let Ye=(e,...t)=>{for(let r of t)if(r)for(let t of Object.keys(r)){const n=Object.getOwnPropertyDescriptor(r,t);n.enumerable&&Object.defineProperty(e,t,n)}};class Ke{}class Ze extends Xe{constructor(e,t,r){super(),this.appApi=new Qe(e);let n=new Ke(t);Ye(this,n)}async getApp(e){return this.appApi.getApp(e)}async putApp(e,t){}static[Symbol.hasInstance](e){try{return e instanceof Ze||e instanceof Ke}catch(e){return!1}}}class et{constructor(e){this.store=e.store,this.dbName=e.dbName,this.dbVersion=e.dbVersion,this.requestCache=new Map}}class tt extends Xe{constructor(e,t,r){super(e,t),this.dataService=new Ze(e);let n=new et(t);this.gudhub=r,Ye(this,n)}static[Symbol.hasInstance](e){try{return e instanceof tt||e instanceof et}catch(e){return!1}}async getApp(e){if(this.requestCache.has(e))return this.requestCache.get(e);let t=this,r=this.dataService.getApp(e),n=new Promise((async(n,i)=>{try{const a=(await t.openDatabase()).transaction(t.store,"readonly").objectStore(t.store).get(e);a.onsuccess=a=>{let o=a.target.result;o||(r.then(n,i),r.then((r=>t.putApp(e,r)))),o&&(n(o),r.then((r=>{t.gudhub.processAppUpd(r,o),t.putApp(e,r)})))},a.onerror=()=>{r.then(n,i),r.then((r=>t.putApp(e,r)))}}catch(a){r.then(n,i),r.then((r=>t.putApp(e,r)))}}));return t.requestCache.set(e,n),n}async putApp(e,t){try{(await this.openDatabase()).transaction(this.store,"readwrite").objectStore(this.store).put(t,e)}catch(e){}}async openDatabase(){return new Promise(((e,t)=>{const r=indexedDB.open(this.dbName,this.dbVersion);r.onsuccess=t=>{e(t.target.result)},r.onerror=e=>{t(e.target.error)}}))}}class rt extends Je{}class nt extends rt{constructor(e,t){super(),this.chunkApi=new De(e);let r=new Ke(t);Ye(this,r)}async getChunk(e,t){return this.chunkApi.getChunk(e,t)}putChunk(){}static[Symbol.hasInstance](e){try{return e instanceof nt||e instanceof Ke}catch(e){return!1}}}class it extends rt{constructor(e,t){super(e,t),this.dataService=new nt(e);let r=new et(t);Ye(this,r)}static[Symbol.hasInstance](e){try{return e instanceof it||e instanceof et}catch(e){return!1}}async putChunk(e,t){try{(await this.openDatabase()).transaction(this.store,"readwrite").objectStore(this.store).put(t,e)}catch(e){}}async getChunk(e,t){if(this.requestCache.has(t))return this.requestCache.get(t);try{let e=this,r=new Promise((async(r,n)=>{try{const i=(await e.openDatabase()).transaction(e.store,"readonly").objectStore(e.store).get(t);i.onsuccess=e=>{let t=e.target.result;t||n(),t&&r(t)},i.onerror=n}catch(e){n()}}));return e.requestCache.set(t,r),await r,r}catch(r){let n=this.dataService.getChunk(e,t);this.requestCache.set(t,n);let i=await n;return this.putChunk(t,i),n}}async openDatabase(){return new Promise(((e,t)=>{const r=indexedDB.open(this.dbName,this.dbVersion);r.onsuccess=t=>{e(t.target.result)},r.onerror=e=>{t(e.target.error)}}))}}const at="gudhub",ot={dbName:at,dbVersion:7,store:"apps"},st={dbName:at,dbVersion:7,store:"chunks"};let lt,ct,ut,pt;Ce.P&&(indexedDB.open(at,7).onupgradeneeded=e=>{const t=e.target.result;for(let e of[ot.store,st.store])t.objectStoreNames.contains(e)||t.createObjectStore(e)}),Ce.P?(ct=it,pt=st):ct=nt,Ce.P?(lt=tt,ut=ot):lt=Ze;class dt{constructor(e,t={server_url:"https://gudhub.com/GudHub_Test",wss_url:"wss://gudhub.com/GudHub/ws/app/",node_server_url:"https://gudhub.com/api/services/prod",initWebsocket:!1,activateSW:!1,swLink:"",async_modules_path:"build/latest/async_modules_node/",file_server_url:"https://gudhub.com",automation_modules_path:"build/latest/automation_modules/",accesstoken:this.accesstoken,expirydate:this.expirydate}){if(this.config=t,this.ghconstructor=new Ne(this),this.interpritate=new Be(this),this.pipeService=new a,this.storage=new o(t.async_modules_path,t.file_server_url,t.automation_modules_path),this.util=new Oe(this),this.req=new n(t.server_url),this.auth=new Pe(this.req,this.storage),this.sharing=new Ve(this,this.req),this.groupSharing=new He(this,this.req,this.pipeService),e?this.storage.setUser({auth_key:e}):t.accesstoken&&t.expirydate&&this.storage.setUser({accesstoken:t.accesstoken,expirydate:t.expirydate}),this.req.init(this.auth.getToken.bind(this.auth)),this.ws=new l(t.wss_url,this.auth),this.chunksManager=new qe(this.storage,this.pipeService,this.req,this.util,new ct(this.req,pt)),this.appProcessor=new Le(this.storage,this.pipeService,this.req,this.ws,this.chunksManager,this.util,t.activateSW,new lt(this.req,ut,this)),this.itemProcessor=new Me(this.storage,this.pipeService,this.req,this.appProcessor,this.util),this.fieldProcessor=new Fe(this.storage,this.req,this.appProcessor,this.itemProcessor,this.pipeService),this.fileManager=new Re(this.storage,this.pipeService,this.req,this.appProcessor),this.documentManager=new Ue(this.req,this.pipeService),this.websocketsemitter=new ze(this),t.initWebsocket){const e=this;this.ws.initWebSocket($e.bind(this,e),this.appProcessor.refreshApps.bind(this.appProcessor))}t.activateSW&&this.activateSW(t.swLink)}async activateSW(e){if(Ce.P&&"serviceWorker"in window.navigator)try{const t=await window.navigator.serviceWorker.register(e);t.update().then((()=>console.log("%cSW ->>> Service worker successful updated","display: inline-block ; background-color: #689f38 ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;"))).catch((()=>console.warn("SW ->>> Service worker is not updated"))),console.log("%cSW ->>> Service worker is registered","display: inline-block ; background-color: #689f38 ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;",t)}catch(e){console.warn("%cSW ->>> Service worker is not registered","display: inline-block ; background-color: #d32f2f ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;",e)}else console.log("%cSW ->>> ServiceWorkers not supported","display: inline-block ; background-color: #d32f2f ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;")}on(e,t,r){return this.pipeService.on(e,t,r),this}emit(e,t,r,n){return this.pipeService.emit(e,t,r,n),this}destroy(e,t,r){return this.pipeService.destroy(e,t,r),this}prefilter(e,t){return this.util.prefilter(e,t)}debounce(e,t){return this.util.debounce(e,t)}emitToUser(e,t){return this.websocketsemitter.emitToUser(e,t)}broadcastToAppSubscribers(e,t,r){return this.websocketsemitter.broadcastToAppSubscribers(e,t,r)}getInterpretation(e,t,r,n,i,a,o){return this.interpritate.getInterpretation(e,t,r,n,i,a,o)}getInterpretationById(e,t,r,n,i,a){return this.interpritate.getInterpretationById(e,t,r,n,i,a)}filter(e,t){return this.util.filter(e,t)}mergeFilters(e,t){return this.util.mergeFilters(e,t)}group(e,t){return this.util.group(e,t)}getFilteredItems(e,t,r={}){return this.util.getFilteredItems(e,t,r.element_app_id,r.app_id,r.item_id,r.field_group,r.search,r.search_params)}sortItems(e,t){return this.util.sortItems(e,t)}processAppUpd(e,t){this.itemProcessor.handleItemsChange(e,t),this.appProcessor.handleAppChange(e,t)}jsonToItems(e,t){return this.util.jsonToItems(e,t)}getDate(e){return this.util.getDate(e)}populateWithDate(e,t){return this.util.populateWithDate(e,t)}checkRecurringDate(e,t){return this.util.checkRecurringDate(e,t)}populateItems(e,t,r){return this.util.populateItems(e,t,r)}populateWithItemRef(e,t,r,n,i,a){return this.util.populateWithItemRef(e,t,r,n,i,a)}compareItems(e,t,r){return this.util.compareItems(e,t,r)}mergeItems(e,t,r){return this.util.mergeItems(e,t,r)}mergeObjects(e,t){return this.util.mergeObjects(e,t)}makeNestedList(e,t,r,n,i){return this.util.makeNestedList(e,t,r,n,i)}jsonConstructor(e,t,r,n){return this.util.jsonConstructor(e,t,r,n)}getAppsList(){return this.appProcessor.getAppsList()}getAppInfo(e){return this.appProcessor.getAppInfo(e)}deleteApp(e){return this.appProcessor.deleteApp(e)}getApp(e){return this.appProcessor.getApp(e)}updateApp(e){return this.appProcessor.updateApp(e)}updateAppInfo(e){return this.appProcessor.updateAppInfo(e)}createNewApp(e){return this.appProcessor.createNewApp(e)}getItems(e){return this.itemProcessor.getItems(e)}async getItem(e,t){const r=await this.getItems(e);if(r)return r.find((e=>e.item_id==t))}addNewItems(e,t){return this.itemProcessor.addNewItems(e,t)}updateItems(e,t){return this.itemProcessor.updateItems(e,t)}deleteItems(e,t){return this.itemProcessor.deleteItems(e,t)}getField(e,t){return this.fieldProcessor.getField(e,t)}getFieldIdByNameSpace(e,t){return this.fieldProcessor.getFieldIdByNameSpace(e,t)}getFieldModels(e){return this.fieldProcessor.getFieldModels(e)}updateField(e,t){return this.fieldProcessor.updateField(e,t)}deleteField(e,t){return this.fieldProcessor.deleteField(e,t)}getFieldValue(e,t,r){return this.fieldProcessor.getFieldValue(e,t,r)}setFieldValue(e,t,r,n){return this.fieldProcessor.setFieldValue(e,t,r,n)}getFile(e,t){return this.fileManager.getFile(e,t)}getFiles(e,t){return this.fileManager.getFiles(e,t)}uploadFile(e,t,r){return this.fileManager.uploadFile(e,t,r)}uploadFileFromString(e,t,r,n,i,a,o){return this.fileManager.uploadFileFromString(e,t,r,n,i,a,o)}updateFileFromString(e,t,r,n,i){return this.fileManager.updateFileFromString(e,t,r,n,i)}deleteFile(e,t){return this.fileManager.deleteFile(e,t)}duplicateFile(e){return this.fileManager.duplicateFile(e)}downloadFileFromString(e,t){return this.fileManager.downloadFileFromString(e,t)}createDocument(e){return this.documentManager.createDocument(e)}getDocument(e){return this.documentManager.getDocument(e)}getDocuments(e){return this.documentManager.getDocuments(e)}deleteDocument(e){return this.documentManager.deleteDocument(e)}login(e){return this.auth.login(e)}loginWithToken(e){return this.auth.loginWithToken(e)}logout(e){return this.appProcessor.clearAppProcessor(),this.auth.logout(e)}signup(e){return this.auth.signup(e)}getUsersList(e){return this.auth.getUsersList(e)}updateToken(e){return this.auth.updateToken(e)}avatarUploadApi(e){return this.auth.avatarUploadApi(e)}getVersion(){return this.auth.getVersion()}getUserById(e){return this.auth.getUserById(e)}getToken(){return this.auth.getToken()}updateUser(e){return this.auth.updateUser(e)}updateAvatar(e){return this.auth.updateAvatar(e)}}const ht=dt})(),__webpack_exports__})()));