@vizzly/services 0.7.0-rc.0.10 → 0.7.0-rc.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
var e={307:(e,t,r)=>{r(168),e.exports=self.fetch.bind(self)},903:e=>{var t;self,t=()=>{return e={7629:(e,t,r)=>{const n=r(375),i=r(8571),o=r(9474),a=r(1687),s=r(8652),l=r(8160),u=r(3292),c=r(6354),d=r(8901),f=r(9708),p=r(6914),h=r(2294),m=r(6133),g=r(1152),y=r(8863),v=r(2036),b={Base:class{constructor(e){this.type=e,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new h.Ids,this._preferences=null,this._refs=new m.Manager,this._cache=null,this._valids=null,this._invalids=null,this._flags={},this._rules=[],this._singleRules=new Map,this.$_terms={},this.$_temp={ruleset:null,whens:{}}}describe(){return n("function"==typeof f.describe,"Manifest functionality disabled"),f.describe(this)}allow(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return l.verifyFlat(t,"allow"),this._values(t,"_valids")}alter(e){n(e&&"object"==typeof e&&!Array.isArray(e),"Invalid targets argument"),n(!this._inRuleset(),"Cannot set alterations inside a ruleset");const t=this.clone();t.$_terms.alterations=t.$_terms.alterations||[];for(const r in e){const i=e[r];n("function"==typeof i,"Alteration adjuster for",r,"must be a function"),t.$_terms.alterations.push({target:r,adjuster:i})}return t.$_temp.ruleset=!1,t}artifact(e){return n(void 0!==e,"Artifact cannot be undefined"),n(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",e)}cast(e){return n(!1===e||"string"==typeof e,"Invalid to value"),n(!1===e||this._definition.cast[e],"Type",this.type,"does not support casting to",e),this.$_setFlag("cast",!1===e?void 0:e)}default(e,t){return this._default("default",e,t)}description(e){return n(e&&"string"==typeof e,"Description must be a non-empty string"),this.$_setFlag("description",e)}empty(e){const t=this.clone();return void 0!==e&&(e=t.$_compile(e,{override:!1})),t.$_setFlag("empty",e,{clone:!1})}error(e){return n(e,"Missing error"),n(e instanceof Error||"function"==typeof e,"Must provide a valid Error object or a function"),this.$_setFlag("error",e)}example(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n(void 0!==e,"Missing example"),l.assertOptions(t,["override"]),this._inner("examples",e,{single:!0,override:t.override})}external(e,t){return"object"==typeof e&&(n(!t,"Cannot combine options with description"),t=e.description,e=e.method),n("function"==typeof e,"Method must be a function"),n(void 0===t||t&&"string"==typeof t,"Description must be a non-empty string"),this._inner("externals",{method:e,description:t},{single:!0})}failover(e,t){return this._default("failover",e,t)}forbidden(){return this.presence("forbidden")}id(e){return e?(n("string"==typeof e,"id must be a non-empty string"),n(/^[^\.]+$/.test(e),"id cannot contain period character"),this.$_setFlag("id",e)):this.$_setFlag("id",void 0)}invalid(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this._values(t,"_invalids")}label(e){return n(e&&"string"==typeof e,"Label name must be a non-empty string"),this.$_setFlag("label",e)}meta(e){return n(void 0!==e,"Meta cannot be undefined"),this._inner("metas",e,{single:!0})}note(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];n(t.length,"Missing notes");for(const e of t)n(e&&"string"==typeof e,"Notes must be non-empty strings");return this._inner("notes",t)}only(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return n("boolean"==typeof e,"Invalid mode:",e),this.$_setFlag("only",e)}optional(){return this.presence("optional")}prefs(e){n(e,"Missing preferences"),n(void 0===e.context,"Cannot override context"),n(void 0===e.externals,"Cannot override externals"),n(void 0===e.warnings,"Cannot override warnings"),n(void 0===e.debug,"Cannot override debug"),l.checkPreferences(e);const t=this.clone();return t._preferences=l.preferences(t._preferences,e),t}presence(e){return n(["optional","required","forbidden"].includes(e),"Unknown presence mode",e),this.$_setFlag("presence",e)}raw(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.$_setFlag("result",e?"raw":void 0)}result(e){return n(["raw","strip"].includes(e),"Unknown result mode",e),this.$_setFlag("result",e)}required(){return this.presence("required")}strict(e){const t=this.clone(),r=void 0!==e&&!e;return t._preferences=l.preferences(t._preferences,{convert:r}),t}strip(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.$_setFlag("result",e?"strip":void 0)}tag(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];n(t.length,"Missing tags");for(const e of t)n(e&&"string"==typeof e,"Tags must be non-empty strings");return this._inner("tags",t)}unit(e){return n(e&&"string"==typeof e,"Unit name must be a non-empty string"),this.$_setFlag("unit",e)}valid(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];l.verifyFlat(t,"valid");const n=this.allow(...t);return n.$_setFlag("only",!!n._valids,{clone:!1}),n}when(e,t){const r=this.clone();r.$_terms.whens||(r.$_terms.whens=[]);const i=u.when(r,e,t);if(!["any","link"].includes(r.type)){const e=i.is?[i]:i.switch;for(const t of e)n(!t.then||"any"===t.then.type||t.then.type===r.type,"Cannot combine",r.type,"with",t.then&&t.then.type),n(!t.otherwise||"any"===t.otherwise.type||t.otherwise.type===r.type,"Cannot combine",r.type,"with",t.otherwise&&t.otherwise.type)}return r.$_terms.whens.push(i),r.$_mutateRebuild()}cache(e){n(!this._inRuleset(),"Cannot set caching inside a ruleset"),n(!this._cache,"Cannot override schema cache"),n(void 0===this._flags.artifact,"Cannot cache a rule with an artifact");const t=this.clone();return t._cache=e||s.provider.provision(),t.$_temp.ruleset=!1,t}clone(){const e=Object.create(Object.getPrototypeOf(this));return this._assign(e)}concat(e){n(l.isSchema(e),"Invalid schema object"),n("any"===this.type||"any"===e.type||e.type===this.type,"Cannot merge type",this.type,"with another type:",e.type),n(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),n(!e._inRuleset(),"Cannot concatenate a schema with open ruleset");let t=this.clone();if("any"===this.type&&"any"!==e.type){const r=e.clone();for(const e of Object.keys(t))"type"!==e&&(r[e]=t[e]);t=r}t._ids.concat(e._ids),t._refs.register(e,m.toSibling),t._preferences=t._preferences?l.preferences(t._preferences,e._preferences):e._preferences,t._valids=v.merge(t._valids,e._valids,e._invalids),t._invalids=v.merge(t._invalids,e._invalids,e._valids);for(const r of e._singleRules.keys())t._singleRules.has(r)&&(t._rules=t._rules.filter((e=>e.keep||e.name!==r)),t._singleRules.delete(r));for(const r of e._rules)e._definition.rules[r.method].multi||t._singleRules.set(r.name,r),t._rules.push(r);if(t._flags.empty&&e._flags.empty){t._flags.empty=t._flags.empty.concat(e._flags.empty);const r=Object.assign({},e._flags);delete r.empty,a(t._flags,r)}else if(e._flags.empty){t._flags.empty=e._flags.empty;const r=Object.assign({},e._flags);delete r.empty,a(t._flags,r)}else a(t._flags,e._flags);for(const r in e.$_terms){const n=e.$_terms[r];n?t.$_terms[r]?t.$_terms[r]=t.$_terms[r].concat(n):t.$_terms[r]=n.slice():t.$_terms[r]||(t.$_terms[r]=n)}return this.$_root._tracer&&this.$_root._tracer._combine(t,[this,e]),t.$_mutateRebuild()}extend(e){return n(!e.base,"Cannot extend type with another base"),d.type(this,e)}extract(e){return e=Array.isArray(e)?e:e.split("."),this._ids.reach(e)}fork(e,t){n(!this._inRuleset(),"Cannot fork inside a ruleset");let r=this;for(let n of[].concat(e))n=Array.isArray(n)?n:n.split("."),r=r._ids.fork(n,t,r);return r.$_temp.ruleset=!1,r}rule(e){const t=this._definition;l.assertOptions(e,Object.keys(t.modifiers)),n(!1!==this.$_temp.ruleset,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");const r=null===this.$_temp.ruleset?this._rules.length-1:this.$_temp.ruleset;n(r>=0&&r<this._rules.length,"Cannot apply rules to empty ruleset");const o=this.clone();for(let a=r;a<o._rules.length;++a){const r=o._rules[a],s=i(r);for(const i in e)t.modifiers[i](s,e[i]),n(s.name===r.name,"Cannot change rule name");o._rules[a]=s,o._singleRules.get(s.name)===r&&o._singleRules.set(s.name,s)}return o.$_temp.ruleset=!1,o.$_mutateRebuild()}get ruleset(){n(!this._inRuleset(),"Cannot start a new ruleset without closing the previous one");const e=this.clone();return e.$_temp.ruleset=e._rules.length,e}get $(){return this.ruleset}tailor(e){e=[].concat(e),n(!this._inRuleset(),"Cannot tailor inside a ruleset");let t=this;if(this.$_terms.alterations)for(const{target:r,adjuster:i}of this.$_terms.alterations)e.includes(r)&&(t=i(t),n(l.isSchema(t),"Alteration adjuster for",r,"failed to return a schema object"));return t=t.$_modify({each:t=>t.tailor(e),ref:!1}),t.$_temp.ruleset=!1,t.$_mutateRebuild()}tracer(){return g.location?g.location(this):this}validate(e,t){return y.entry(e,this,t)}validateAsync(e,t){return y.entryAsync(e,this,t)}$_addRule(e){"string"==typeof e&&(e={name:e}),n(e&&"object"==typeof e,"Invalid options"),n(e.name&&"string"==typeof e.name,"Invalid rule name");for(const t in e)n("_"!==t[0],"Cannot set private rule properties");const t=Object.assign({},e);t._resolve=[],t.method=t.method||t.name;const r=this._definition.rules[t.method],i=t.args;n(r,"Unknown rule",t.method);const o=this.clone();if(i){n(1===Object.keys(i).length||Object.keys(i).length===this._definition.rules[t.name].args.length,"Invalid rule definition for",this.type,t.name);for(const e in i){let a=i[e];if(r.argsByName){const s=r.argsByName.get(e);if(s.ref&&l.isResolvable(a))t._resolve.push(e),o.$_mutateRegister(a);else if(s.normalize&&(a=s.normalize(a),i[e]=a),s.assert){const t=l.validateArg(a,e,s);n(!t,t,"or reference")}}void 0!==a?i[e]=a:delete i[e]}}return r.multi||(o._ruleRemove(t.name,{clone:!1}),o._singleRules.set(t.name,t)),!1===o.$_temp.ruleset&&(o.$_temp.ruleset=null),r.priority?o._rules.unshift(t):o._rules.push(t),o}$_compile(e,t){return u.schema(this.$_root,e,t)}$_createError(e,t,r,n,i){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};const a=!1!==o.flags?this._flags:{},s=o.messages?p.merge(this._definition.messages,o.messages):this._definition.messages;return new c.Report(e,t,r,a,s,n,i)}$_getFlag(e){return this._flags[e]}$_getRule(e){return this._singleRules.get(e)}$_mapLabels(e){return e=Array.isArray(e)?e:e.split("."),this._ids.labels(e)}$_match(e,t,r,n){(r=Object.assign({},r)).abortEarly=!0,r._externals=!1,t.snapshot();const i=!y.validate(e,this,t,r,n).errors;return t.restore(),i}$_modify(e){return l.assertOptions(e,["each","once","ref","schema"]),h.schema(this,e)||this}$_mutateRebuild(){return n(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset(),this.$_modify({each:(e,t)=>{let{source:r,name:n,path:i,key:o}=t;const a=this._definition[r][n]&&this._definition[r][n].register;!1!==a&&this.$_mutateRegister(e,{family:a,key:o})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(e){let{family:t,key:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._refs.register(e,t),this._ids.register(e,{key:r})}$_property(e){return this._definition.properties[e]}$_reach(e){return this._ids.reach(e)}$_rootReferences(){return this._refs.roots()}$_setFlag(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n("_"===e[0]||!this._inRuleset(),"Cannot set flag inside a ruleset");const i=this._definition.flags[e]||{};if(o(t,i.default)&&(t=void 0),o(t,this._flags[e]))return this;const a=!1!==r.clone?this.clone():this;return void 0!==t?(a._flags[e]=t,a.$_mutateRegister(t)):delete a._flags[e],"_"!==e[0]&&(a.$_temp.ruleset=!1),a}$_parent(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return this[e][l.symbols.parent].call(this,...r)}$_validate(e,t,r){return y.validate(e,this,t,r)}_assign(e){e.type=this.type,e.$_root=this.$_root,e.$_temp=Object.assign({},this.$_temp),e.$_temp.whens={},e._ids=this._ids.clone(),e._preferences=this._preferences,e._valids=this._valids&&this._valids.clone(),e._invalids=this._invalids&&this._invalids.clone(),e._rules=this._rules.slice(),e._singleRules=i(this._singleRules,{shallow:!0}),e._refs=this._refs.clone(),e._flags=Object.assign({},this._flags),e._cache=null,e.$_terms={};for(const t in this.$_terms)e.$_terms[t]=this.$_terms[t]?this.$_terms[t].slice():null;e.$_super={};for(const t in this.$_super)e.$_super[t]=this._super[t].bind(e);return e}_bare(){const e=this.clone();e._reset();const t=e._definition.terms;for(const r in t){const n=t[r];e.$_terms[r]=n.init}return e.$_mutateRebuild()}_default(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return l.assertOptions(r,"literal"),n(void 0!==t,"Missing",e,"value"),n("function"==typeof t||!r.literal,"Only function value supports literal option"),"function"==typeof t&&r.literal&&(t={[l.symbols.literal]:!0,literal:t}),this.$_setFlag(e,t)}_generate(e,t,r){if(!this.$_terms.whens)return{schema:this};const n=[],i=[];for(let o=0;o<this.$_terms.whens.length;++o){const a=this.$_terms.whens[o];if(a.concat){n.push(a.concat),i.push(`${o}.concat`);continue}const s=a.ref?a.ref.resolve(e,t,r):e,l=a.is?[a]:a.switch,u=i.length;for(let u=0;u<l.length;++u){const{is:c,then:d,otherwise:f}=l[u],p=`${o}${a.switch?"."+u:""}`;if(c.$_match(s,t.nest(c,`${p}.is`),r)){if(d){const o=t.localize([...t.path,`${p}.then`],t.ancestors,t.schemas),{schema:a,id:s}=d._generate(e,o,r);n.push(a),i.push(`${p}.then${s?`(${s})`:""}`);break}}else if(f){const o=t.localize([...t.path,`${p}.otherwise`],t.ancestors,t.schemas),{schema:a,id:s}=f._generate(e,o,r);n.push(a),i.push(`${p}.otherwise${s?`(${s})`:""}`);break}}if(a.break&&i.length>u)break}const o=i.join(", ");if(t.mainstay.tracer.debug(t,"rule","when",o),!o)return{schema:this};if(!t.mainstay.tracer.active&&this.$_temp.whens[o])return{schema:this.$_temp.whens[o],id:o};let a=this;this._definition.generate&&(a=this._definition.generate(this,e,t,r));for(const e of n)a=a.concat(e);return this.$_root._tracer&&this.$_root._tracer._combine(a,[this,...n]),this.$_temp.whens[o]=a,{schema:a,id:o}}_inner(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n(!this._inRuleset(),`Cannot set ${e} inside a ruleset`);const i=this.clone();return i.$_terms[e]&&!r.override||(i.$_terms[e]=[]),r.single?i.$_terms[e].push(t):i.$_terms[e].push(...t),i.$_temp.ruleset=!1,i}_inRuleset(){return null!==this.$_temp.ruleset&&!1!==this.$_temp.ruleset}_ruleRemove(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this._singleRules.has(e))return this;const r=!1!==t.clone?this.clone():this;r._singleRules.delete(e);const n=[];for(let t=0;t<r._rules.length;++t){const i=r._rules[t];i.name!==e||i.keep?n.push(i):r._inRuleset()&&t<r.$_temp.ruleset&&--r.$_temp.ruleset}return r._rules=n,r}_values(e,t){l.verifyFlat(e,t.slice(1,-1));const r=this.clone(),i=e[0]===l.symbols.override;if(i&&(e=e.slice(1)),!r[t]&&e.length?r[t]=new v:i&&(r[t]=e.length?new v:null,r.$_mutateRebuild()),!r[t])return r;i&&r[t].override();for(const i of e){n(void 0!==i,"Cannot call allow/valid/invalid with undefined"),n(i!==l.symbols.override,"Override must be the first value");const e="_invalids"===t?"_valids":"_invalids";r[e]&&(r[e].remove(i),r[e].length||(n("_valids"===t||!r._flags.only,"Setting invalid value",i,"leaves schema rejecting all values due to previous valid rule"),r[e]=null)),r[t].add(i,r._refs)}return r}}};b.Base.prototype[l.symbols.any]={version:l.version,compile:u.compile,root:"$_root"},b.Base.prototype.isImmutable=!0,b.Base.prototype.deny=b.Base.prototype.invalid,b.Base.prototype.disallow=b.Base.prototype.invalid,b.Base.prototype.equal=b.Base.prototype.valid,b.Base.prototype.exist=b.Base.prototype.required,b.Base.prototype.not=b.Base.prototype.invalid,b.Base.prototype.options=b.Base.prototype.prefs,b.Base.prototype.preferences=b.Base.prototype.prefs,e.exports=new b.Base},8652:(e,t,r)=>{const n=r(375),i=r(8571),o=r(8160),a={max:1e3,supported:new Set(["undefined","boolean","number","string"])};t.provider={provision:e=>new a.Cache(e)},a.Cache=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o.assertOptions(e,["max"]),n(void 0===e.max||e.max&&e.max>0&&isFinite(e.max),"Invalid max cache size"),this._max=e.max||a.max,this._map=new Map,this._list=new a.List}get length(){return this._map.size}set(e,t){if(null!==e&&!a.supported.has(typeof e))return;let r=this._map.get(e);if(r)return r.value=t,void this._list.first(r);r=this._list.unshift({key:e,value:t}),this._map.set(e,r),this._compact()}get(e){const t=this._map.get(e);if(t)return this._list.first(t),i(t.value)}_compact(){if(this._map.size>this._max){const e=this._list.pop();this._map.delete(e.key)}}},a.List=class{constructor(){this.tail=null,this.head=null}unshift(e){return e.next=null,e.prev=this.head,this.head&&(this.head.next=e),this.head=e,this.tail||(this.tail=e),e}first(e){e!==this.head&&(this._remove(e),this.unshift(e))}pop(){return this._remove(this.tail)}_remove(e){const{next:t,prev:r}=e;return t.prev=r,r&&(r.next=t),e===this.tail&&(this.tail=t),e.prev=null,e.next=null,e}}},8160:(e,t,r)=>{const n=r(375),i=r(7916),o=r(5934);let a,s;const l={isoDate:/^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$/};t.version=o.version,t.defaults={abortEarly:!0,allowUnknown:!1,artifacts:!1,cache:!0,context:null,convert:!0,dateFormat:"iso",errors:{escapeHtml:!1,label:"path",language:null,render:!0,stack:!1,wrap:{label:'"',array:"[]"}},externals:!0,messages:{},nonEnumerables:!1,noDefaults:!1,presence:"optional",skipFunctions:!1,stripUnknown:!1,warnings:!1},t.symbols={any:Symbol.for("@hapi/joi/schema"),arraySingle:Symbol("arraySingle"),deepDefault:Symbol("deepDefault"),errors:Symbol("errors"),literal:Symbol("literal"),override:Symbol("override"),parent:Symbol("parent"),prefs:Symbol("prefs"),ref:Symbol("ref"),template:Symbol("template"),values:Symbol("values")},t.assertOptions=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Options";n(e&&"object"==typeof e&&!Array.isArray(e),"Options must be of type object");const i=Object.keys(e).filter((e=>!t.includes(e)));n(0===i.length,`${r} contain unknown keys: ${i}`)},t.checkPreferences=function(e){s=s||r(3378);const t=s.preferences.validate(e);if(t.error)throw new i([t.error.details[0].message])},t.compare=function(e,t,r){switch(r){case"=":return e===t;case">":return e>t;case"<":return e<t;case">=":return e>=t;case"<=":return e<=t}},t.default=function(e,t){return void 0===e?t:e},t.isIsoDate=function(e){return l.isoDate.test(e)},t.isNumber=function(e){return"number"==typeof e&&!isNaN(e)},t.isResolvable=function(e){return!!e&&(e[t.symbols.ref]||e[t.symbols.template])},t.isSchema=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=e&&e[t.symbols.any];return!!i&&(n(r.legacy||i.version===t.version,"Cannot mix different versions of joi schemas"),!0)},t.isValues=function(e){return e[t.symbols.values]},t.limit=function(e){return Number.isSafeInteger(e)&&e>=0},t.preferences=function(e,n){a=a||r(6914),e=e||{},n=n||{};const i=Object.assign({},e,n);return n.errors&&e.errors&&(i.errors=Object.assign({},e.errors,n.errors),i.errors.wrap=Object.assign({},e.errors.wrap,n.errors.wrap)),n.messages&&(i.messages=a.compile(n.messages,e.messages)),delete i[t.symbols.prefs],i},t.tryWithPath=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{return e()}catch(e){throw void 0!==e.path?e.path=t+"."+e.path:e.path=t,r.append&&(e.message=`${e.message} (${e.path})`),e}},t.validateArg=function(e,r,n){let{assert:i,message:o}=n;if(t.isSchema(i)){const t=i.validate(e);if(!t.error)return;return t.error.message}if(!i(e))return r?`${r} ${o}`:o},t.verifyFlat=function(e,t){for(const r of e)n(!Array.isArray(r),"Method no longer accepts array arguments:",t)}},3292:(e,t,r)=>{const n=r(375),i=r(8160),o=r(6133),a={};t.schema=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};i.assertOptions(r,["appendPath","override"]);try{return a.schema(e,t,r)}catch(e){throw r.appendPath&&void 0!==e.path&&(e.message=`${e.message} (${e.path})`),e}},a.schema=function(e,t,r){n(void 0!==t,"Invalid undefined schema"),Array.isArray(t)&&(n(t.length,"Invalid empty array schema"),1===t.length&&(t=t[0]));const o=function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return!1!==r.override?t.valid(e.override,...i):t.valid(...i)};if(a.simple(t))return o(e,t);if("function"==typeof t)return e.custom(t);if(n("object"==typeof t,"Invalid schema content:",typeof t),i.isResolvable(t))return o(e,t);if(i.isSchema(t))return t;if(Array.isArray(t)){for(const r of t)if(!a.simple(r))return e.alternatives().try(...t);return o(e,...t)}return t instanceof RegExp?e.string().regex(t):t instanceof Date?o(e.date(),t):(n(Object.getPrototypeOf(t)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),e.object().keys(t))},t.ref=function(e,t){return o.isRef(e)?e:o.create(e,t)},t.compile=function(e,r){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};i.assertOptions(o,["legacy"]);const s=r&&r[i.symbols.any];if(s)return n(o.legacy||s.version===i.version,"Cannot mix different versions of joi schemas:",s.version,i.version),r;if("object"!=typeof r||!o.legacy)return t.schema(e,r,{appendPath:!0});const l=a.walk(r);return l?l.compile(l.root,r):t.schema(e,r,{appendPath:!0})},a.walk=function(e){if("object"!=typeof e)return null;if(Array.isArray(e)){for(const t of e){const e=a.walk(t);if(e)return e}return null}const t=e[i.symbols.any];if(t)return{root:e[t.root],compile:t.compile};n(Object.getPrototypeOf(e)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(const t in e){const r=a.walk(e[t]);if(r)return r}return null},a.simple=function(e){return null===e||["boolean","string","number"].includes(typeof e)},t.when=function(e,r,s){if(void 0===s&&(n(r&&"object"==typeof r,"Missing options"),s=r,r=o.create(".")),Array.isArray(s)&&(s={switch:s}),i.assertOptions(s,["is","not","then","otherwise","switch","break"]),i.isSchema(r))return n(void 0===s.is,'"is" can not be used with a schema condition'),n(void 0===s.not,'"not" can not be used with a schema condition'),n(void 0===s.switch,'"switch" can not be used with a schema condition'),a.condition(e,{is:r,then:s.then,otherwise:s.otherwise,break:s.break});if(n(o.isRef(r)||"string"==typeof r,"Invalid condition:",r),n(void 0===s.not||void 0===s.is,'Cannot combine "is" with "not"'),void 0===s.switch){let l=s;void 0!==s.not&&(l={is:s.not,then:s.otherwise,otherwise:s.then,break:s.break});let u=void 0!==l.is?e.$_compile(l.is):e.$_root.invalid(null,!1,0,"").required();return n(void 0!==l.then||void 0!==l.otherwise,'options must have at least one of "then", "otherwise", or "switch"'),n(void 0===l.break||void 0===l.then||void 0===l.otherwise,"Cannot specify then, otherwise, and break all together"),void 0===s.is||o.isRef(s.is)||i.isSchema(s.is)||(u=u.required()),a.condition(e,{ref:t.ref(r),is:u,then:l.then,otherwise:l.otherwise,break:l.break})}n(Array.isArray(s.switch),'"switch" must be an array'),n(void 0===s.is,'Cannot combine "switch" with "is"'),n(void 0===s.not,'Cannot combine "switch" with "not"'),n(void 0===s.then,'Cannot combine "switch" with "then"');const l={ref:t.ref(r),switch:[],break:s.break};for(let t=0;t<s.switch.length;++t){const r=s.switch[t],a=t===s.switch.length-1;i.assertOptions(r,a?["is","then","otherwise"]:["is","then"]),n(void 0!==r.is,'Switch statement missing "is"'),n(void 0!==r.then,'Switch statement missing "then"');const u={is:e.$_compile(r.is),then:e.$_compile(r.then)};if(o.isRef(r.is)||i.isSchema(r.is)||(u.is=u.is.required()),a){n(void 0===s.otherwise||void 0===r.otherwise,'Cannot specify "otherwise" inside and outside a "switch"');const t=void 0!==s.otherwise?s.otherwise:r.otherwise;void 0!==t&&(n(void 0===l.break,"Cannot specify both otherwise and break"),u.otherwise=e.$_compile(t))}l.switch.push(u)}return l},a.condition=function(e,t){for(const r of["then","otherwise"])void 0===t[r]?delete t[r]:t[r]=e.$_compile(t[r]);return t}},6354:(e,t,r)=>{const n=r(5688),i=r(8160),o=r(3328);t.Report=class{constructor(e,r,n,i,o,a,s){if(this.code=e,this.flags=i,this.messages=o,this.path=a.path,this.prefs=s,this.state=a,this.value=r,this.message=null,this.template=null,this.local=n||{},this.local.label=t.label(this.flags,this.state,this.prefs,this.messages),void 0===this.value||this.local.hasOwnProperty("value")||(this.local.value=this.value),this.path.length){const e=this.path[this.path.length-1];"object"!=typeof e&&(this.local.key=e)}}_setTemplate(e){if(this.template=e,!this.flags.label&&0===this.path.length){const e=this._template(this.template,"root");e&&(this.local.label=e)}}toString(){if(this.message)return this.message;const e=this.code;if(!this.prefs.errors.render)return this.code;const t=this._template(this.template)||this._template(this.prefs.messages)||this._template(this.messages);return void 0===t?`Error code "${e}" is not defined, your custom type is missing the correct messages definition`:(this.message=t.render(this.value,this.state,this.prefs,this.local,{errors:this.prefs.errors,messages:[this.prefs.messages,this.messages]}),this.prefs.errors.label||(this.message=this.message.replace(/^"" /,"").trim()),this.message)}_template(e,r){return t.template(this.value,e,r||this.code,this.state,this.prefs)}},t.path=function(e){let t="";for(const r of e)"object"!=typeof r&&("string"==typeof r?(t&&(t+="."),t+=r):t+=`[${r}]`);return t},t.template=function(e,t,r,n,a){if(!t)return;if(o.isTemplate(t))return"root"!==r?t:null;let s=a.errors.language;if(i.isResolvable(s)&&(s=s.resolve(e,n,a)),s&&t[s]){if(void 0!==t[s][r])return t[s][r];if(void 0!==t[s]["*"])return t[s]["*"]}return t[r]?t[r]:t["*"]},t.label=function(e,r,n,i){if(e.label)return e.label;if(!n.errors.label)return"";let o=r.path;return"key"===n.errors.label&&r.path.length>1&&(o=r.path.slice(-1)),t.path(o)||t.template(null,n.messages,"root",r,n)||i&&t.template(null,i,"root",r,n)||"value"},t.process=function(e,r,n){if(!e)return null;const{override:i,message:o,details:a}=t.details(e);if(i)return i;if(n.errors.stack)return new t.ValidationError(o,a,r);const s=Error.stackTraceLimit;Error.stackTraceLimit=0;const l=new t.ValidationError(o,a,r);return Error.stackTraceLimit=s,l},t.details=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=[];const n=[];for(const i of e){if(i instanceof Error){if(!1!==t.override)return{override:i};const e=i.toString();r.push(e),n.push({message:e,type:"override",context:{error:i}});continue}const e=i.toString();r.push(e),n.push({message:e,path:i.path.filter((e=>"object"!=typeof e)),type:i.code,context:i.local})}return r.length>1&&(r=[...new Set(r)]),{message:r.join(". "),details:n}},t.ValidationError=class extends Error{constructor(e,t,r){super(e),this._original=r,this.details=t}static isError(e){return e instanceof t.ValidationError}},t.ValidationError.prototype.isJoi=!0,t.ValidationError.prototype.name="ValidationError",t.ValidationError.prototype.annotate=n.error},8901:(e,t,r)=>{const n=r(375),i=r(8571),o=r(8160),a=r(6914),s={};t.type=function(e,t){const r=Object.getPrototypeOf(e),l=i(r),u=e._assign(Object.create(l)),c=Object.assign({},t);delete c.base,l._definition=c;const d=r._definition||{};c.messages=a.merge(d.messages,c.messages),c.properties=Object.assign({},d.properties,c.properties),u.type=c.type,c.flags=Object.assign({},d.flags,c.flags);const f=Object.assign({},d.terms);if(c.terms)for(const e in c.terms){const t=c.terms[e];n(void 0===u.$_terms[e],"Invalid term override for",c.type,e),u.$_terms[e]=t.init,f[e]=t}c.terms=f,c.args||(c.args=d.args),c.prepare=s.prepare(c.prepare,d.prepare),c.coerce&&("function"==typeof c.coerce&&(c.coerce={method:c.coerce}),c.coerce.from&&!Array.isArray(c.coerce.from)&&(c.coerce={method:c.coerce.method,from:[].concat(c.coerce.from)})),c.coerce=s.coerce(c.coerce,d.coerce),c.validate=s.validate(c.validate,d.validate);const p=Object.assign({},d.rules);if(c.rules)for(const e in c.rules){const t=c.rules[e];n("object"==typeof t,"Invalid rule definition for",c.type,e);let r=t.method;if(void 0===r&&(r=function(){return this.$_addRule(e)}),r&&(n(!l[e],"Rule conflict in",c.type,e),l[e]=r),n(!p[e],"Rule conflict in",c.type,e),p[e]=t,t.alias){const e=[].concat(t.alias);for(const r of e)l[r]=t.method}t.args&&(t.argsByName=new Map,t.args=t.args.map((e=>("string"==typeof e&&(e={name:e}),n(!t.argsByName.has(e.name),"Duplicated argument name",e.name),o.isSchema(e.assert)&&(e.assert=e.assert.strict().label(e.name)),t.argsByName.set(e.name,e),e))))}c.rules=p;const h=Object.assign({},d.modifiers);if(c.modifiers)for(const e in c.modifiers){n(!l[e],"Rule conflict in",c.type,e);const t=c.modifiers[e];n("function"==typeof t,"Invalid modifier definition for",c.type,e);const r=function(t){return this.rule({[e]:t})};l[e]=r,h[e]=t}if(c.modifiers=h,c.overrides){l._super=r,u.$_super={};for(const e in c.overrides)n(r[e],"Cannot override missing",e),c.overrides[e][o.symbols.parent]=r[e],u.$_super[e]=r[e].bind(u);Object.assign(l,c.overrides)}c.cast=Object.assign({},d.cast,c.cast);const m=Object.assign({},d.manifest,c.manifest);return m.build=s.build(c.manifest&&c.manifest.build,d.manifest&&d.manifest.build),c.manifest=m,c.rebuild=s.rebuild(c.rebuild,d.rebuild),u},s.build=function(e,t){return e&&t?function(r,n){return t(e(r,n),n)}:e||t},s.coerce=function(e,t){return e&&t?{from:e.from&&t.from?[...new Set([...e.from,...t.from])]:null,method(r,n){let i;if((!t.from||t.from.includes(typeof r))&&(i=t.method(r,n),i)){if(i.errors||void 0===i.value)return i;r=i.value}if(!e.from||e.from.includes(typeof r)){const t=e.method(r,n);if(t)return t}return i}}:e||t},s.prepare=function(e,t){return e&&t?function(r,n){const i=e(r,n);if(i){if(i.errors||void 0===i.value)return i;r=i.value}return t(r,n)||i}:e||t},s.rebuild=function(e,t){return e&&t?function(r){t(r),e(r)}:e||t},s.validate=function(e,t){return e&&t?function(r,n){const i=t(r,n);if(i){if(i.errors&&(!Array.isArray(i.errors)||i.errors.length))return i;r=i.value}return e(r,n)||i}:e||t}},5107:(e,t,r)=>{const n=r(375),i=r(8571),o=r(8652),a=r(8160),s=r(3292),l=r(6354),u=r(8901),c=r(9708),d=r(6133),f=r(3328),p=r(1152);let h;const m={types:{alternatives:r(4946),any:r(8068),array:r(546),boolean:r(4937),date:r(7500),function:r(390),link:r(8785),number:r(3832),object:r(8966),string:r(7417),symbol:r(8826)},aliases:{alt:"alternatives",bool:"boolean",func:"function"},root:function(){const e={_types:new Set(Object.keys(m.types))};for(const t of e._types)e[t]=function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return n(!r.length||["alternatives","link","object"].includes(t),"The",t,"type does not allow arguments"),m.generate(this,m.types[t],r)};for(const t of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])e[t]=function(){return this.any()[t](...arguments)};Object.assign(e,m.methods);for(const t in m.aliases){const r=m.aliases[t];e[t]=e[r]}return e.x=e.expression,p.setup&&p.setup(e),e}};m.methods={ValidationError:l.ValidationError,version:a.version,cache:o.provider,assert(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),i=2;i<r;i++)n[i-2]=arguments[i];m.assert(e,t,!0,n)},attempt(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),i=2;i<r;i++)n[i-2]=arguments[i];return m.assert(e,t,!1,n)},build(e){return n("function"==typeof c.build,"Manifest functionality disabled"),c.build(this,e)},checkPreferences(e){a.checkPreferences(e)},compile(e,t){return s.compile(this,e,t)},defaults(e){n("function"==typeof e,"modifier must be a function");const t=Object.assign({},this);for(const r of t._types){const i=e(t[r]());n(a.isSchema(i),"modifier must return a valid schema object"),t[r]=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return m.generate(this,i,t)}}return t},expression(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return new f(...t)},extend(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];a.verifyFlat(t,"extend"),h=h||r(3378),n(t.length,"You need to provide at least one extension"),this.assert(t,h.extensions);const o=Object.assign({},this);o._types=new Set(o._types);for(let e of t){"function"==typeof e&&(e=e(o)),this.assert(e,h.extension);const t=m.expandExtension(e,o);for(const e of t){n(void 0===o[e.type]||o._types.has(e.type),"Cannot override name",e.type);const t=e.base||this.any(),r=u.type(t,e);o._types.add(e.type),o[e.type]=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return m.generate(this,r,t)}}}return o},isError:l.ValidationError.isError,isExpression:f.isTemplate,isRef:d.isRef,isSchema:a.isSchema,in(){return d.in(...arguments)},override:a.symbols.override,ref(){return d.create(...arguments)},types(){const e={};for(const t of this._types)e[t]=this[t]();for(const t in m.aliases)e[t]=this[t]();return e}},m.assert=function(e,t,r,n){const o=n[0]instanceof Error||"string"==typeof n[0]?n[0]:null,s=null!==o?n[1]:n[0],u=t.validate(e,a.preferences({errors:{stack:!0}},s||{}));let c=u.error;if(!c)return u.value;if(o instanceof Error)throw o;const d=r&&"function"==typeof c.annotate?c.annotate():c.message;throw c instanceof l.ValidationError==0&&(c=i(c)),c.message=o?`${o} ${d}`:d,c},m.generate=function(e,t,r){return n(e,"Must be invoked on a Joi instance."),t.$_root=e,t._definition.args&&r.length?t._definition.args(t,...r):t},m.expandExtension=function(e,t){if("string"==typeof e.type)return[e];const r=[];for(const n of t._types)if(e.type.test(n)){const i=Object.assign({},e);i.type=n,i.base=t[n](),r.push(i)}return r},e.exports=m.root()},6914:(e,t,r)=>{const n=r(375),i=r(8571),o=r(3328);t.compile=function(e,t){if("string"==typeof e)return n(!t,"Cannot set single message string"),new o(e);if(o.isTemplate(e))return n(!t,"Cannot set single message template"),e;n("object"==typeof e&&!Array.isArray(e),"Invalid message options"),t=t?i(t):{};for(let r in e){const i=e[r];if("root"===r||o.isTemplate(i)){t[r]=i;continue}if("string"==typeof i){t[r]=new o(i);continue}n("object"==typeof i&&!Array.isArray(i),"Invalid message for",r);const a=r;for(r in t[a]=t[a]||{},i){const e=i[r];"root"===r||o.isTemplate(e)?t[a][r]=e:(n("string"==typeof e,"Invalid message for",r,"in",a),t[a][r]=new o(e))}}return t},t.decompile=function(e){const t={};for(let r in e){const n=e[r];if("root"===r){t.root=n;continue}if(o.isTemplate(n)){t[r]=n.describe({compact:!0});continue}const i=r;for(r in t[i]={},n){const e=n[r];"root"!==r?t[i][r]=e.describe({compact:!0}):t[i].root=e}}return t},t.merge=function(e,r){if(!e)return t.compile(r);if(!r)return e;if("string"==typeof r)return new o(r);if(o.isTemplate(r))return r;const a=i(e);for(let e in r){const t=r[e];if("root"===e||o.isTemplate(t)){a[e]=t;continue}if("string"==typeof t){a[e]=new o(t);continue}n("object"==typeof t&&!Array.isArray(t),"Invalid message for",e);const i=e;for(e in a[i]=a[i]||{},t){const r=t[e];"root"===e||o.isTemplate(r)?a[i][e]=r:(n("string"==typeof r,"Invalid message for",e,"in",i),a[i][e]=new o(r))}}return a}},2294:(e,t,r)=>{const n=r(375),i=r(8160),o=r(6133),a={};t.Ids=a.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){const e=new a.Ids;return e._byId=new Map(this._byId),e._byKey=new Map(this._byKey),e._schemaChain=this._schemaChain,e}concat(e){e._schemaChain&&(this._schemaChain=!0);for(const[t,r]of e._byId.entries())n(!this._byKey.has(t),"Schema id conflicts with existing key:",t),this._byId.set(t,r);for(const[t,r]of e._byKey.entries())n(!this._byId.has(t),"Schema key conflicts with existing id:",t),this._byKey.set(t,r)}fork(e,t,r){const o=this._collect(e);o.push({schema:r});const s=o.shift();let l={id:s.id,schema:t(s.schema)};n(i.isSchema(l.schema),"adjuster function failed to return a joi schema type");for(const e of o)l={id:e.id,schema:a.fork(e.schema,l.id,l.schema)};return l.schema}labels(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=e[0],n=this._get(r);if(!n)return[...t,...e].join(".");const i=e.slice(1);return t=[...t,n.schema._flags.label||r],i.length?n.schema._ids.labels(i,t):t.join(".")}reach(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=e[0],i=this._get(r);n(i,"Schema does not contain path",[...t,...e].join("."));const o=e.slice(1);return o.length?i.schema._ids.reach(o,[...t,r]):i.schema}register(e){let{key:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e||!i.isSchema(e))return;(e.$_property("schemaChain")||e._ids._schemaChain)&&(this._schemaChain=!0);const r=e._flags.id;if(r){const t=this._byId.get(r);n(!t||t.schema===e,"Cannot add different schemas with the same id:",r),n(!this._byKey.has(r),"Schema id conflicts with existing key:",r),this._byId.set(r,{schema:e,id:r})}t&&(n(!this._byKey.has(t),"Schema already contains key:",t),n(!this._byId.has(t),"Schema key conflicts with existing id:",t),this._byKey.set(t,{schema:e,id:t}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const i=e[0],o=this._get(i);n(o,"Schema does not contain path",[...t,...e].join(".")),r=[o,...r];const a=e.slice(1);return a.length?o.schema._ids._collect(a,[...t,i],r):r}_get(e){return this._byId.get(e)||this._byKey.get(e)}},a.fork=function(e,r,n){const i=t.schema(e,{each:(e,t)=>{let{key:i}=t;if(r===(e._flags.id||i))return n},ref:!1});return i?i.$_mutateRebuild():e},t.schema=function(e,t){let r;for(const n in e._flags){if("_"===n[0])continue;const i=a.scan(e._flags[n],{source:"flags",name:n},t);void 0!==i&&(r=r||e.clone(),r._flags[n]=i)}for(let n=0;n<e._rules.length;++n){const i=e._rules[n],o=a.scan(i.args,{source:"rules",name:i.name},t);if(void 0!==o){r=r||e.clone();const t=Object.assign({},i);t.args=o,r._rules[n]=t,r._singleRules.get(i.name)===i&&r._singleRules.set(i.name,t)}}for(const n in e.$_terms){if("_"===n[0])continue;const i=a.scan(e.$_terms[n],{source:"terms",name:n},t);void 0!==i&&(r=r||e.clone(),r.$_terms[n]=i)}return r},a.scan=function(e,t,r,n,s){const l=n||[];if(null===e||"object"!=typeof e)return;let u;if(Array.isArray(e)){for(let n=0;n<e.length;++n){const i="terms"===t.source&&"keys"===t.name&&e[n].key,o=a.scan(e[n],t,r,[n,...l],i);void 0!==o&&(u=u||e.slice(),u[n]=o)}return u}if(!1!==r.schema&&i.isSchema(e)||!1!==r.ref&&o.isRef(e)){const n=r.each(e,{...t,path:l,key:s});if(n===e)return;return n}for(const n in e){if("_"===n[0])continue;const i=a.scan(e[n],t,r,[n,...l],s);void 0!==i&&(u=u||Object.assign({},e),u[n]=i)}return u}},6133:(e,t,r)=>{const n=r(375),i=r(8571),o=r(9621),a=r(8160);let s;const l={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};t.create=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("string"==typeof e,"Invalid reference key:",e),a.assertOptions(t,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),n(!t.prefix||"object"==typeof t.prefix,"options.prefix must be of type object");const r=Object.assign({},l.defaults,t);delete r.prefix;const i=r.separator,o=l.context(e,i,t.prefix);if(r.type=o.type,e=o.key,"value"===r.type)if(o.root&&(n(!i||e[0]!==i,"Cannot specify relative path with root prefix"),r.ancestor="root",e||(e=null)),i&&i===e)e=null,r.ancestor=0;else if(void 0!==r.ancestor)n(!i||!e||e[0]!==i,"Cannot combine prefix with ancestor option");else{const[t,n]=l.ancestor(e,i);n&&""===(e=e.slice(n))&&(e=null),r.ancestor=t}return r.path=i?null===e?[]:e.split(i):[e],new l.Ref(r)},t.in=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.create(e,{...r,in:!0})},t.isRef=function(e){return!!e&&!!e[a.symbols.ref]},l.Ref=class{constructor(e){n("object"==typeof e,"Invalid reference construction"),a.assertOptions(e,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),n([!1,void 0].includes(e.separator)||"string"==typeof e.separator&&1===e.separator.length,"Invalid separator"),n(!e.adjust||"function"==typeof e.adjust,"options.adjust must be a function"),n(!e.map||Array.isArray(e.map),"options.map must be an array"),n(!e.map||!e.adjust,"Cannot set both map and adjust options"),Object.assign(this,l.defaults,e),n("value"===this.type||void 0===this.ancestor,"Non-value references cannot reference ancestors"),Array.isArray(this.map)&&(this.map=new Map(this.map)),this.depth=this.path.length,this.key=this.path.length?this.path.join(this.separator):null,this.root=this.path[0],this.updateDisplay()}resolve(e,t,r,i){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return n(!this.in||o.in,"Invalid in() reference usage"),"global"===this.type?this._resolve(r.context,t,o):"local"===this.type?this._resolve(i,t,o):this.ancestor?"root"===this.ancestor?this._resolve(t.ancestors[t.ancestors.length-1],t,o):(n(this.ancestor<=t.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(t.ancestors[this.ancestor-1],t,o)):this._resolve(e,t,o)}_resolve(e,t,r){let n;if("value"===this.type&&t.mainstay.shadow&&!1!==r.shadow&&(n=t.mainstay.shadow.get(this.absolute(t))),void 0===n&&(n=o(e,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(n=this.adjust(n)),this.map){const e=this.map.get(n);void 0!==e&&(n=e)}return t.mainstay&&t.mainstay.tracer.resolve(t,this,n),n}toString(){return this.display}absolute(e){return[...e.path.slice(0,-this.ancestor),...this.path]}clone(){return new l.Ref(this)}describe(){const e={path:this.path};"value"!==this.type&&(e.type=this.type),"."!==this.separator&&(e.separator=this.separator),"value"===this.type&&1!==this.ancestor&&(e.ancestor=this.ancestor),this.map&&(e.map=[...this.map]);for(const t of["adjust","iterables","render"])null!==this[t]&&void 0!==this[t]&&(e[t]=this[t]);return!1!==this.in&&(e.in=!0),{ref:e}}updateDisplay(){const e=null!==this.key?this.key:"";if("value"!==this.type)return void(this.display=`ref:${this.type}:${e}`);if(!this.separator)return void(this.display=`ref:${e}`);if(!this.ancestor)return void(this.display=`ref:${this.separator}${e}`);if("root"===this.ancestor)return void(this.display=`ref:root:${e}`);if(1===this.ancestor)return void(this.display=`ref:${e||".."}`);const t=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${t}${e||""}`}},l.Ref.prototype[a.symbols.ref]=!0,t.build=function(e){return"value"===(e=Object.assign({},l.defaults,e)).type&&void 0===e.ancestor&&(e.ancestor=1),new l.Ref(e)},l.context=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e=e.trim(),r){const n=void 0===r.global?"$":r.global;if(n!==t&&e.startsWith(n))return{key:e.slice(n.length),type:"global"};const i=void 0===r.local?"#":r.local;if(i!==t&&e.startsWith(i))return{key:e.slice(i.length),type:"local"};const o=void 0===r.root?"/":r.root;if(o!==t&&e.startsWith(o))return{key:e.slice(o.length),type:"value",root:!0}}return{key:e,type:"value"}},l.ancestor=function(e,t){if(!t)return[1,0];if(e[0]!==t)return[1,0];if(e[1]!==t)return[0,1];let r=2;for(;e[r]===t;)++r;return[r-1,r]},t.toSibling=0,t.toParent=1,t.Manager=class{constructor(){this.refs=[]}register(e,n){if(e)if(n=void 0===n?t.toParent:n,Array.isArray(e))for(const t of e)this.register(t,n);else if(a.isSchema(e))for(const t of e._refs.refs)t.ancestor-n>=0&&this.refs.push({ancestor:t.ancestor-n,root:t.root});else t.isRef(e)&&"value"===e.type&&e.ancestor-n>=0&&this.refs.push({ancestor:e.ancestor-n,root:e.root}),s=s||r(3328),s.isTemplate(e)&&this.register(e.refs(),n)}get length(){return this.refs.length}clone(){const e=new t.Manager;return e.refs=i(this.refs),e}reset(){this.refs=[]}roots(){return this.refs.filter((e=>!e.ancestor)).map((e=>e.root))}}},3378:(e,t,r)=>{const n=r(5107),i={};i.wrap=n.string().min(1).max(2).allow(!1),t.preferences=n.object({allowUnknown:n.boolean(),abortEarly:n.boolean(),artifacts:n.boolean(),cache:n.boolean(),context:n.object(),convert:n.boolean(),dateFormat:n.valid("date","iso","string","time","utc"),debug:n.boolean(),errors:{escapeHtml:n.boolean(),label:n.valid("path","key",!1),language:[n.string(),n.object().ref()],render:n.boolean(),stack:n.boolean(),wrap:{label:i.wrap,array:i.wrap,string:i.wrap}},externals:n.boolean(),messages:n.object(),noDefaults:n.boolean(),nonEnumerables:n.boolean(),presence:n.valid("required","optional","forbidden"),skipFunctions:n.boolean(),stripUnknown:n.object({arrays:n.boolean(),objects:n.boolean()}).or("arrays","objects").allow(!0,!1),warnings:n.boolean()}).strict(),i.nameRx=/^[a-zA-Z0-9]\w*$/,i.rule=n.object({alias:n.array().items(n.string().pattern(i.nameRx)).single(),args:n.array().items(n.string(),n.object({name:n.string().pattern(i.nameRx).required(),ref:n.boolean(),assert:n.alternatives([n.function(),n.object().schema()]).conditional("ref",{is:!0,then:n.required()}),normalize:n.function(),message:n.string().when("assert",{is:n.function(),then:n.required()})})),convert:n.boolean(),manifest:n.boolean(),method:n.function().allow(!1),multi:n.boolean(),validate:n.function()}),t.extension=n.object({type:n.alternatives([n.string(),n.object().regex()]).required(),args:n.function(),cast:n.object().pattern(i.nameRx,n.object({from:n.function().maxArity(1).required(),to:n.function().minArity(1).maxArity(2).required()})),base:n.object().schema().when("type",{is:n.object().regex(),then:n.forbidden()}),coerce:[n.function().maxArity(3),n.object({method:n.function().maxArity(3).required(),from:n.array().items(n.string()).single()})],flags:n.object().pattern(i.nameRx,n.object({setter:n.string(),default:n.any()})),manifest:{build:n.function().arity(2)},messages:[n.object(),n.string()],modifiers:n.object().pattern(i.nameRx,n.function().minArity(1).maxArity(2)),overrides:n.object().pattern(i.nameRx,n.function()),prepare:n.function().maxArity(3),rebuild:n.function().arity(1),rules:n.object().pattern(i.nameRx,i.rule),terms:n.object().pattern(i.nameRx,n.object({init:n.array().allow(null).required(),manifest:n.object().pattern(/.+/,[n.valid("schema","single"),n.object({mapped:n.object({from:n.string().required(),to:n.string().required()}).required()})])})),validate:n.function().maxArity(3)}).strict(),t.extensions=n.array().items(n.object(),n.function().arity(1)).strict(),i.desc={buffer:n.object({buffer:n.string()}),func:n.object({function:n.function().required(),options:{literal:!0}}),override:n.object({override:!0}),ref:n.object({ref:n.object({type:n.valid("value","global","local"),path:n.array().required(),separator:n.string().length(1).allow(!1),ancestor:n.number().min(0).integer().allow("root"),map:n.array().items(n.array().length(2)).min(1),adjust:n.function(),iterables:n.boolean(),in:n.boolean(),render:n.boolean()}).required()}),regex:n.object({regex:n.string().min(3)}),special:n.object({special:n.valid("deep").required()}),template:n.object({template:n.string().required(),options:n.object()}),value:n.object({value:n.alternatives([n.object(),n.array()]).required()})},i.desc.entity=n.alternatives([n.array().items(n.link("...")),n.boolean(),n.function(),n.number(),n.string(),i.desc.buffer,i.desc.func,i.desc.ref,i.desc.regex,i.desc.special,i.desc.template,i.desc.value,n.link("/")]),i.desc.values=n.array().items(null,n.boolean(),n.function(),n.number().allow(1/0,-1/0),n.string().allow(""),n.symbol(),i.desc.buffer,i.desc.func,i.desc.override,i.desc.ref,i.desc.regex,i.desc.template,i.desc.value),i.desc.messages=n.object().pattern(/.+/,[n.string(),i.desc.template,n.object().pattern(/.+/,[n.string(),i.desc.template])]),t.description=n.object({type:n.string().required(),flags:n.object({cast:n.string(),default:n.any(),description:n.string(),empty:n.link("/"),failover:i.desc.entity,id:n.string(),label:n.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:n.boolean(),unit:n.string()}).unknown(),preferences:{allowUnknown:n.boolean(),abortEarly:n.boolean(),artifacts:n.boolean(),cache:n.boolean(),convert:n.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:n.boolean(),label:["path","key"],language:[n.string(),i.desc.ref],wrap:{label:i.wrap,array:i.wrap}},externals:n.boolean(),messages:i.desc.messages,noDefaults:n.boolean(),nonEnumerables:n.boolean(),presence:["required","optional","forbidden"],skipFunctions:n.boolean(),stripUnknown:n.object({arrays:n.boolean(),objects:n.boolean()}).or("arrays","objects").allow(!0,!1),warnings:n.boolean()},allow:i.desc.values,invalid:i.desc.values,rules:n.array().min(1).items({name:n.string().required(),args:n.object().min(1),keep:n.boolean(),message:[n.string(),i.desc.messages],warn:n.boolean()}),keys:n.object().pattern(/.*/,n.link("/")),link:i.desc.ref}).pattern(/^[a-z]\w*$/,n.any())},493:(e,t,r)=>{const n=r(8571),i=r(9621),o=r(8160),a={value:Symbol("value")};e.exports=a.State=class{constructor(e,t,r){this.path=e,this.ancestors=t,this.mainstay=r.mainstay,this.schemas=r.schemas,this.debug=null}localize(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=new a.State(e,t,this);return r&&n.schemas&&(n.schemas=[a.schemas(r),...n.schemas]),n}nest(e,t){const r=new a.State(this.path,this.ancestors,this);return r.schemas=r.schemas&&[a.schemas(e),...r.schemas],r.debug=t,r}shadow(e,t){this.mainstay.shadow=this.mainstay.shadow||new a.Shadow,this.mainstay.shadow.set(this.path,e,t)}snapshot(){this.mainstay.shadow&&(this._snapshot=n(this.mainstay.shadow.node(this.path)))}restore(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0)}},a.schemas=function(e){return o.isSchema(e)?{schema:e}:e},a.Shadow=class{constructor(){this._values=null}set(e,t,r){if(!e.length)return;if("strip"===r&&"number"==typeof e[e.length-1])return;this._values=this._values||new Map;let n=this._values;for(let t=0;t<e.length;++t){const r=e[t];let i=n.get(r);i||(i=new Map,n.set(r,i)),n=i}n[a.value]=t}get(e){const t=this.node(e);if(t)return t[a.value]}node(e){if(this._values)return i(this._values,e,{iterables:!0})}override(e,t){if(!this._values)return;const r=e.slice(0,-1),n=e[e.length-1],o=i(this._values,r,{iterables:!0});t?o.set(n,t):o&&o.delete(n)}}},3328:(e,t,r)=>{const n=r(375),i=r(8571),o=r(5277),a=r(1447),s=r(8160),l=r(6354),u=r(6133),c={symbol:Symbol("template"),opens:new Array(1e3).join("\0"),closes:new Array(1e3).join(""),dateFormat:{date:Date.prototype.toDateString,iso:Date.prototype.toISOString,string:Date.prototype.toString,time:Date.prototype.toTimeString,utc:Date.prototype.toUTCString}};e.exports=c.Template=class{constructor(e,t){n("string"==typeof e,"Template source must be a string"),n(!e.includes("\0")&&!e.includes(""),"Template source cannot contain reserved control characters"),this.source=e,this.rendered=e,this._template=null,this._settings=i(t),this._parse()}_parse(){if(!this.source.includes("{"))return;const e=c.encode(this.source),t=c.split(e);let r=!1;const n=[],i=t.shift();i&&n.push(i);for(const e of t){const t="{"!==e[0],i=t?"}":"}}",o=e.indexOf(i);if(-1===o||"{"===e[1]){n.push(`{${c.decode(e)}`);continue}let a=e.slice(t?0:1,o);const s=":"===a[0];s&&(a=a.slice(1));const l=this._ref(c.decode(a),{raw:t,wrapped:s});n.push(l),"string"!=typeof l&&(r=!0);const u=e.slice(o+i.length);u&&n.push(c.decode(u))}r?this._template=n:this.rendered=n.join("")}static date(e,t){return c.dateFormat[t.dateFormat].call(e)}describe(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this._settings&&e.compact)return this.source;const t={template:this.source};return this._settings&&(t.options=this._settings),t}static build(e){return new c.Template(e.template,e.options)}isDynamic(){return!!this._template}static isTemplate(e){return!!e&&!!e[s.symbols.template]}refs(){if(!this._template)return;const e=[];for(const t of this._template)"string"!=typeof t&&e.push(...t.refs);return e}resolve(e,t,r,n){return this._template&&1===this._template.length?this._part(this._template[0],e,t,r,n,{}):this.render(e,t,r,n)}_part(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return e.ref?e.ref.resolve(...r):e.formula.evaluate(r)}render(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};if(!this.isDynamic())return this.rendered;const a=[];for(const s of this._template)if("string"==typeof s)a.push(s);else{const l=this._part(s,e,t,r,n,i),u=c.stringify(l,e,t,r,n,i);if(void 0!==u){const e=s.raw||!1===(i.errors&&i.errors.escapeHtml)?u:o(u);a.push(c.wrap(e,s.wrapped&&r.errors.wrap.label))}}return a.join("")}_ref(e,t){let{raw:r,wrapped:n}=t;const i=[],o=e=>{const t=u.create(e,this._settings);return i.push(t),e=>t.resolve(...e)};try{var s=new a.Parser(e,{reference:o,functions:c.functions,constants:c.constants})}catch(t){throw t.message=`Invalid template variable "${e}" fails due to: ${t.message}`,t}if(s.single){if("reference"===s.single.type){const e=i[0];return{ref:e,raw:r,refs:i,wrapped:n||"local"===e.type&&"label"===e.key}}return c.stringify(s.single.value)}return{formula:s,raw:r,refs:i}}toString(){return this.source}},c.Template.prototype[s.symbols.template]=!0,c.Template.prototype.isImmutable=!0,c.encode=function(e){return e.replace(/\\(\{+)/g,((e,t)=>c.opens.slice(0,t.length))).replace(/\\(\}+)/g,((e,t)=>c.closes.slice(0,t.length)))},c.decode=function(e){return e.replace(/\u0000/g,"{").replace(/\u0001/g,"}")},c.split=function(e){const t=[];let r="";for(let n=0;n<e.length;++n){const i=e[n];if("{"===i){let i="";for(;n+1<e.length&&"{"===e[n+1];)i+="{",++n;t.push(r),r=i}else r+=i}return t.push(r),t},c.wrap=function(e,t){return t?1===t.length?`${t}${e}${t}`:`${t[0]}${e}${t[1]}`:e},c.stringify=function(e,t,r,n,i){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};const a=typeof e,s=n&&n.errors&&n.errors.wrap||{};let l=!1;if(u.isRef(e)&&e.render&&(l=e.in,e=e.resolve(t,r,n,i,{in:e.in,...o})),null===e)return"null";if("string"===a)return c.wrap(e,o.arrayItems&&s.string);if("number"===a||"function"===a||"symbol"===a)return e.toString();if("object"!==a)return JSON.stringify(e);if(e instanceof Date)return c.Template.date(e,n);if(e instanceof Map){const t=[];for(const[r,n]of e.entries())t.push(`${r.toString()} -> ${n.toString()}`);e=t}if(!Array.isArray(e))return e.toString();const d=[];for(const a of e)d.push(c.stringify(a,t,r,n,i,{arrayItems:!0,...o}));return c.wrap(d.join(", "),!l&&s.array)},c.constants={true:!0,false:!1,null:null,second:1e3,minute:6e4,hour:36e5,day:864e5},c.functions={if:(e,t,r)=>e?t:r,length:e=>"string"==typeof e?e.length:e&&"object"==typeof e?Array.isArray(e)?e.length:Object.keys(e).length:null,msg(e){const[t,r,n,i,o]=this,a=o.messages;if(!a)return"";const s=l.template(t,a[0],e,r,n)||l.template(t,a[1],e,r,n);return s?s.render(t,r,n,i,o):""},number:e=>"number"==typeof e?e:"string"==typeof e?parseFloat(e):"boolean"==typeof e?e?1:0:e instanceof Date?e.getTime():null}},4946:(e,t,r)=>{const n=r(375),i=r(1687),o=r(8068),a=r(8160),s=r(3292),l=r(6354),u=r(6133),c={};e.exports=o.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:u.toSibling}},args(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return 1===r.length&&Array.isArray(r[0])?e.try(...r[0]):e.try(...r)},validate(e,t){const{schema:r,error:n,state:o,prefs:a}=t;if(r._flags.match){const t=[],s=[];for(let n=0;n<r.$_terms.matches.length;++n){const i=r.$_terms.matches[n],l=o.nest(i.schema,`match.${n}`);l.snapshot();const u=i.schema.$_validate(e,l,a);u.errors?(s.push(u.errors),l.restore()):t.push(u.value)}if(0===t.length)return{errors:n("alternatives.any",{details:s.map((e=>l.details(e,{override:!1})))})};if("one"===r._flags.match)return 1===t.length?{value:t[0]}:{errors:n("alternatives.one")};if(t.length!==r.$_terms.matches.length)return{errors:n("alternatives.all",{details:s.map((e=>l.details(e,{override:!1})))})};const u=e=>e.$_terms.matches.some((e=>"object"===e.schema.type||"alternatives"===e.schema.type&&u(e.schema)));return u(r)?{value:t.reduce(((e,t)=>i(e,t,{mergeArrays:!1})))}:{value:t[t.length-1]}}const s=[];for(let t=0;t<r.$_terms.matches.length;++t){const n=r.$_terms.matches[t];if(n.schema){const r=o.nest(n.schema,`match.${t}`);r.snapshot();const i=n.schema.$_validate(e,r,a);if(!i.errors)return i;r.restore(),s.push({schema:n.schema,reports:i.errors});continue}const i=n.ref?n.ref.resolve(e,o,a):e,l=n.is?[n]:n.switch;for(let r=0;r<l.length;++r){const s=l[r],{is:u,then:c,otherwise:d}=s,f=`match.${t}${n.switch?"."+r:""}`;if(u.$_match(i,o.nest(u,`${f}.is`),a)){if(c)return c.$_validate(e,o.nest(c,`${f}.then`),a)}else if(d)return d.$_validate(e,o.nest(d,`${f}.otherwise`),a)}}return c.errors(s,t)},rules:{conditional:{method(e,t){n(!this._flags._endedSwitch,"Unreachable condition"),n(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),n(void 0===t.break,"Cannot use break option with alternatives conditional");const r=this.clone(),i=s.when(r,e,t),o=i.is?[i]:i.switch;for(const e of o)if(e.then&&e.otherwise){r.$_setFlag("_endedSwitch",!0,{clone:!1});break}return r.$_terms.matches.push(i),r.$_mutateRebuild()}},match:{method(e){if(n(["any","one","all"].includes(e),"Invalid alternatives match mode",e),"any"!==e)for(const t of this.$_terms.matches)n(t.schema,"Cannot combine match mode",e,"with conditional rules");return this.$_setFlag("match",e)}},try:{method(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];n(t.length,"Missing alternative schemas"),a.verifyFlat(t,"try"),n(!this._flags._endedSwitch,"Unreachable condition");const i=this.clone();for(const e of t)i.$_terms.matches.push({schema:i.$_compile(e)});return i.$_mutateRebuild()}}},overrides:{label(e){return this.$_parent("label",e).$_modify({each:(t,r)=>"is"!==r.path[0]?t.label(e):void 0,ref:!1})}},rebuild(e){e.$_modify({each:t=>{a.isSchema(t)&&"array"===t.type&&e.$_setFlag("_arrayItems",!0,{clone:!1})}})},manifest:{build(e,t){if(t.matches)for(const r of t.matches){const{schema:t,ref:n,is:i,not:o,then:a,otherwise:s}=r;e=t?e.try(t):n?e.conditional(n,{is:i,then:a,not:o,otherwise:s,switch:r.switch}):e.conditional(i,{then:a,otherwise:s})}return e}},messages:{"alternatives.all":"{{#label}} does not match all of the required types","alternatives.any":"{{#label}} does not match any of the allowed types","alternatives.match":"{{#label}} does not match any of the allowed types","alternatives.one":"{{#label}} matches more than one allowed type","alternatives.types":"{{#label}} must be one of {{#types}}"}}),c.errors=function(e,t){let{error:r,state:n}=t;if(!e.length)return{errors:r("alternatives.any")};if(1===e.length)return{errors:e[0].reports};const i=new Set,o=[];for(const{reports:t,schema:a}of e){if(t.length>1)return c.unmatched(e,r);const s=t[0];if(s instanceof l.Report==0)return c.unmatched(e,r);if(s.state.path.length!==n.path.length){o.push({type:a.type,report:s});continue}if("any.only"===s.code){for(const e of s.local.valids)i.add(e);continue}const[u,d]=s.code.split(".");"base"===d?i.add(u):o.push({type:a.type,report:s})}return o.length?1===o.length?{errors:o[0].report}:c.unmatched(e,r):{errors:r("alternatives.types",{types:[...i]})}},c.unmatched=function(e,t){const r=[];for(const t of e)r.push(...t.reports);return{errors:t("alternatives.match",l.details(r,{override:!1}))}}},8068:(e,t,r)=>{const n=r(375),i=r(7629),o=r(8160),a=r(6914);e.exports=i.extend({type:"any",flags:{only:{default:!1}},terms:{alterations:{init:null},examples:{init:null},externals:{init:null},metas:{init:[]},notes:{init:[]},shared:{init:null},tags:{init:[]},whens:{init:null}},rules:{custom:{method(e,t){return n("function"==typeof e,"Method must be a function"),n(void 0===t||t&&"string"==typeof t,"Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:e,description:t}})},validate(e,t,r){let{method:n}=r;try{return n(e,t)}catch(e){return t.error("any.custom",{error:e})}},args:["method","description"],multi:!0},messages:{method(e){return this.prefs({messages:e})}},shared:{method(e){n(o.isSchema(e)&&e._flags.id,"Schema must be a schema with an id");const t=this.clone();return t.$_terms.shared=t.$_terms.shared||[],t.$_terms.shared.push(e),t.$_mutateRegister(e),t}},warning:{method(e,t){return n(e&&"string"==typeof e,"Invalid warning code"),this.$_addRule({name:"warning",args:{code:e,local:t},warn:!0})},validate(e,t,r){let{code:n,local:i}=r;return t.error(n,i)},args:["code","local"],multi:!0}},modifiers:{keep(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e.keep=t},message(e,t){e.message=a.compile(t)},warn(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e.warn=t}},manifest:{build(e,t){for(const r in t){const n=t[r];if(["examples","externals","metas","notes","tags"].includes(r))for(const t of n)e=e[r.slice(0,-1)](t);else if("alterations"!==r)if("whens"!==r){if("shared"===r)for(const t of n)e=e.shared(t)}else for(const t of n){const{ref:r,is:n,not:i,then:o,otherwise:a,concat:s}=t;e=s?e.concat(s):r?e.when(r,{is:n,not:i,then:o,otherwise:a,switch:t.switch,break:t.break}):e.when(n,{then:o,otherwise:a,break:t.break})}else{const t={};for(const{target:e,adjuster:r}of n)t[e]=r;e=e.alter(t)}}return e}},messages:{"any.custom":"{{#label}} failed custom validation because {{#error.message}}","any.default":"{{#label}} threw an error when running default method","any.failover":"{{#label}} threw an error when running failover method","any.invalid":"{{#label}} contains an invalid value","any.only":'{{#label}} must be {if(#valids.length == 1, "", "one of ")}{{#valids}}',"any.ref":"{{#label}} {{#arg}} references {{:#ref}} which {{#reason}}","any.required":"{{#label}} is required","any.unknown":"{{#label}} is not allowed"}})},546:(e,t,r)=>{const n=r(375),i=r(9474),o=r(9621),a=r(8068),s=r(8160),l=r(3292),u={};e.exports=a.extend({type:"array",flags:{single:{default:!1},sparse:{default:!1}},terms:{items:{init:[],manifest:"schema"},ordered:{init:[],manifest:"schema"},_exclusions:{init:[]},_inclusions:{init:[]},_requireds:{init:[]}},coerce:{from:"object",method(e,t){let{schema:r,state:n,prefs:i}=t;if(!Array.isArray(e))return;const o=r.$_getRule("sort");return o?u.sort(r,e,o.args.options,n,i):void 0}},validate(e,t){let{schema:r,error:n}=t;if(!Array.isArray(e)){if(r._flags.single){const t=[e];return t[s.symbols.arraySingle]=!0,{value:t}}return{errors:n("array.base")}}if(r.$_getRule("items")||r.$_terms.externals)return{value:e.slice()}},rules:{has:{method(e){e=this.$_compile(e,{appendPath:!0});const t=this.$_addRule({name:"has",args:{schema:e}});return t.$_mutateRegister(e),t},validate(e,t,r){let{state:n,prefs:i,error:o}=t,{schema:a}=r;const s=[e,...n.ancestors];for(let t=0;t<e.length;++t){const r=n.localize([...n.path,t],s,a);if(a.$_match(e[t],r,i))return e}const l=a._flags.label;return l?o("array.hasKnown",{patternLabel:l}):o("array.hasUnknown",null)},multi:!0},items:{method(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];s.verifyFlat(t,"items");const n=this.$_addRule("items");for(let e=0;e<t.length;++e){const r=s.tryWithPath((()=>this.$_compile(t[e])),e,{append:!0});n.$_terms.items.push(r)}return n.$_mutateRebuild()},validate(e,t){let{schema:r,error:n,state:i,prefs:o,errorsArray:a}=t;const l=r.$_terms._requireds.slice(),c=r.$_terms.ordered.slice(),d=[...r.$_terms._inclusions,...l],f=!e[s.symbols.arraySingle];delete e[s.symbols.arraySingle];const p=a();let h=e.length;for(let t=0;t<h;++t){const a=e[t];let s=!1,m=!1;const g=f?t:new Number(t),y=[...i.path,g];if(!r._flags.sparse&&void 0===a){if(p.push(n("array.sparse",{key:g,path:y,pos:t,value:void 0},i.localize(y))),o.abortEarly)return p;c.shift();continue}const v=[e,...i.ancestors];for(const e of r.$_terms._exclusions)if(e.$_match(a,i.localize(y,v,e),o,{presence:"ignore"})){if(p.push(n("array.excludes",{pos:t,value:a},i.localize(y))),o.abortEarly)return p;s=!0,c.shift();break}if(s)continue;if(r.$_terms.ordered.length){if(c.length){const s=c.shift(),l=s.$_validate(a,i.localize(y,v,s),o);if(l.errors){if(p.push(...l.errors),o.abortEarly)return p}else if("strip"===s._flags.result)u.fastSplice(e,t),--t,--h;else{if(!r._flags.sparse&&void 0===l.value){if(p.push(n("array.sparse",{key:g,path:y,pos:t,value:void 0},i.localize(y))),o.abortEarly)return p;continue}e[t]=l.value}continue}if(!r.$_terms.items.length){if(p.push(n("array.orderedLength",{pos:t,limit:r.$_terms.ordered.length})),o.abortEarly)return p;break}}const b=[];let _=l.length;for(let s=0;s<_;++s){const c=i.localize(y,v,l[s]);c.snapshot();const d=l[s].$_validate(a,c,o);if(b[s]=d,!d.errors){if(e[t]=d.value,m=!0,u.fastSplice(l,s),--s,--_,!r._flags.sparse&&void 0===d.value&&(p.push(n("array.sparse",{key:g,path:y,pos:t,value:void 0},i.localize(y))),o.abortEarly))return p;break}c.restore()}if(m)continue;const w=o.stripUnknown&&!!o.stripUnknown.arrays||!1;_=d.length;for(const c of d){let d;const f=l.indexOf(c);if(-1!==f)d=b[f];else{const l=i.localize(y,v,c);if(l.snapshot(),d=c.$_validate(a,l,o),!d.errors){"strip"===c._flags.result?(u.fastSplice(e,t),--t,--h):r._flags.sparse||void 0!==d.value?e[t]=d.value:(p.push(n("array.sparse",{key:g,path:y,pos:t,value:void 0},i.localize(y))),s=!0),m=!0;break}l.restore()}if(1===_){if(w){u.fastSplice(e,t),--t,--h,m=!0;break}if(p.push(...d.errors),o.abortEarly)return p;s=!0;break}}if(!s&&(r.$_terms._inclusions.length||r.$_terms._requireds.length)&&!m){if(w){u.fastSplice(e,t),--t,--h;continue}if(p.push(n("array.includes",{pos:t,value:a},i.localize(y))),o.abortEarly)return p}}return l.length&&u.fillMissedErrors(r,p,l,e,i,o),c.length&&(u.fillOrderedErrors(r,p,c,e,i,o),p.length||u.fillDefault(c,e,i,o)),p.length?p:e},priority:!0,manifest:!1},length:{method(e){return this.$_addRule({name:"length",args:{limit:e},operator:"="})},validate(e,t,r,n){let{limit:i}=r,{name:o,operator:a,args:l}=n;return s.compare(e.length,i,a)?e:t.error("array."+o,{limit:l.limit,value:e})},args:[{name:"limit",ref:!0,assert:s.limit,message:"must be a positive integer"}]},max:{method(e){return this.$_addRule({name:"max",method:"length",args:{limit:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"length",args:{limit:e},operator:">="})}},ordered:{method(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];s.verifyFlat(t,"ordered");const n=this.$_addRule("items");for(let e=0;e<t.length;++e){const r=s.tryWithPath((()=>this.$_compile(t[e])),e,{append:!0});u.validateSingle(r,n),n.$_mutateRegister(r),n.$_terms.ordered.push(r)}return n.$_mutateRebuild()}},single:{method(e){const t=void 0===e||!!e;return n(!t||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",t)}},sort:{method(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s.assertOptions(e,["by","order"]);const t={order:e.order||"ascending"};return e.by&&(t.by=l.ref(e.by,{ancestor:0}),n(!t.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:t}})},validate(e,t,r){let{error:n,state:i,prefs:o,schema:a}=t,{options:s}=r;const{value:l,errors:c}=u.sort(a,e,s,i,o);if(c)return c;for(let t=0;t<e.length;++t)if(e[t]!==l[t])return n("array.sort",{order:s.order,by:s.by?s.by.key:"value"});return e},convert:!0},sparse:{method(e){const t=void 0===e||!!e;return this._flags.sparse===t?this:(t?this.clone():this.$_addRule("items")).$_setFlag("sparse",t,{clone:!1})}},unique:{method(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n(!e||"function"==typeof e||"string"==typeof e,"comparator must be a function or a string"),s.assertOptions(t,["ignoreUndefined","separator"]);const r={name:"unique",args:{options:t,comparator:e}};if(e)if("string"==typeof e){const n=s.default(t.separator,".");r.path=n?e.split(n):[e]}else r.comparator=e;return this.$_addRule(r)},validate(e,t,r,a){let{state:s,error:l,schema:u}=t,{comparator:c,options:d}=r,{comparator:f,path:p}=a;const h={string:Object.create(null),number:Object.create(null),undefined:Object.create(null),boolean:Object.create(null),object:new Map,function:new Map,custom:new Map},m=f||i,g=d.ignoreUndefined;for(let t=0;t<e.length;++t){const r=p?o(e[t],p):e[t],i=f?h.custom:h[typeof r];if(n(i,"Failed to find unique map container for type",typeof r),i instanceof Map){const n=i.entries();let o;for(;!(o=n.next()).done;)if(m(o.value[0],r)){const r=s.localize([...s.path,t],[e,...s.ancestors]),n={pos:t,value:e[t],dupePos:o.value[1],dupeValue:e[o.value[1]]};return p&&(n.path=c),l("array.unique",n,r)}i.set(r,t)}else{if((!g||void 0!==r)&&void 0!==i[r]){const n={pos:t,value:e[t],dupePos:i[r],dupeValue:e[i[r]]};return p&&(n.path=c),l("array.unique",n,s.localize([...s.path,t],[e,...s.ancestors]))}i[r]=t}}return e},args:["comparator","options"],multi:!0}},cast:{set:{from:Array.isArray,to:(e,t)=>new Set(e)}},rebuild(e){e.$_terms._inclusions=[],e.$_terms._exclusions=[],e.$_terms._requireds=[];for(const t of e.$_terms.items)u.validateSingle(t,e),"required"===t._flags.presence?e.$_terms._requireds.push(t):"forbidden"===t._flags.presence?e.$_terms._exclusions.push(t):e.$_terms._inclusions.push(t);for(const t of e.$_terms.ordered)u.validateSingle(t,e)},manifest:{build:(e,t)=>(t.items&&(e=e.items(...t.items)),t.ordered&&(e=e.ordered(...t.ordered)),e)},messages:{"array.base":"{{#label}} must be an array","array.excludes":"{{#label}} contains an excluded value","array.hasKnown":"{{#label}} does not contain at least one required match for type {:#patternLabel}","array.hasUnknown":"{{#label}} does not contain at least one required match","array.includes":"{{#label}} does not match any of the allowed types","array.includesRequiredBoth":"{{#label}} does not contain {{#knownMisses}} and {{#unknownMisses}} other required value(s)","array.includesRequiredKnowns":"{{#label}} does not contain {{#knownMisses}}","array.includesRequiredUnknowns":"{{#label}} does not contain {{#unknownMisses}} required value(s)","array.length":"{{#label}} must contain {{#limit}} items","array.max":"{{#label}} must contain less than or equal to {{#limit}} items","array.min":"{{#label}} must contain at least {{#limit}} items","array.orderedLength":"{{#label}} must contain at most {{#limit}} items","array.sort":"{{#label}} must be sorted in {#order} order by {{#by}}","array.sort.mismatching":"{{#label}} cannot be sorted due to mismatching types","array.sort.unsupported":"{{#label}} cannot be sorted due to unsupported type {#type}","array.sparse":"{{#label}} must not be a sparse array item","array.unique":"{{#label}} contains a duplicate value"}}),u.fillMissedErrors=function(e,t,r,n,i,o){const a=[];let s=0;for(const e of r){const t=e._flags.label;t?a.push(t):++s}a.length?s?t.push(e.$_createError("array.includesRequiredBoth",n,{knownMisses:a,unknownMisses:s},i,o)):t.push(e.$_createError("array.includesRequiredKnowns",n,{knownMisses:a},i,o)):t.push(e.$_createError("array.includesRequiredUnknowns",n,{unknownMisses:s},i,o))},u.fillOrderedErrors=function(e,t,r,n,i,o){const a=[];for(const e of r)"required"===e._flags.presence&&a.push(e);a.length&&u.fillMissedErrors(e,t,a,n,i,o)},u.fillDefault=function(e,t,r,n){const i=[];let o=!0;for(let a=e.length-1;a>=0;--a){const s=e[a],l=[t,...r.ancestors],u=s.$_validate(void 0,r.localize(r.path,l,s),n).value;if(o){if(void 0===u)continue;o=!1}i.unshift(u)}i.length&&t.push(...i)},u.fastSplice=function(e,t){let r=t;for(;r<e.length;)e[r++]=e[r];--e.length},u.validateSingle=function(e,t){("array"===e.type||e._flags._arrayItems)&&(n(!t._flags.single,"Cannot specify array item with single rule enabled"),t.$_setFlag("_arrayItems",!0,{clone:!1}))},u.sort=function(e,t,r,n,i){const o="ascending"===r.order?1:-1,a=-1*o,s=o,l=(l,c)=>{let d=u.compare(l,c,a,s);if(null!==d)return d;if(r.by&&(l=r.by.resolve(l,n,i),c=r.by.resolve(c,n,i)),d=u.compare(l,c,a,s),null!==d)return d;const f=typeof l;if(f!==typeof c)throw e.$_createError("array.sort.mismatching",t,null,n,i);if("number"!==f&&"string"!==f)throw e.$_createError("array.sort.unsupported",t,{type:f},n,i);return"number"===f?(l-c)*o:l<c?a:s};try{return{value:t.slice().sort(l)}}catch(e){return{errors:e}}},u.compare=function(e,t,r,n){return e===t?0:void 0===e?1:void 0===t?-1:null===e?n:null===t?r:null}},4937:(e,t,r)=>{const n=r(375),i=r(8068),o=r(8160),a=r(2036),s={isBool:function(e){return"boolean"==typeof e}};e.exports=i.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(e,t){let{schema:r}=t;if("boolean"!=typeof e){if("string"==typeof e){const t=r._flags.sensitive?e:e.toLowerCase();e="true"===t||"false"!==t&&e}return"boolean"!=typeof e&&(e=r.$_terms.truthy&&r.$_terms.truthy.has(e,null,null,!r._flags.sensitive)||(!r.$_terms.falsy||!r.$_terms.falsy.has(e,null,null,!r._flags.sensitive))&&e),{value:e}}},validate(e,t){let{error:r}=t;if("boolean"!=typeof e)return{value:e,errors:r("boolean.base")}},rules:{truthy:{method(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];o.verifyFlat(t,"truthy");const i=this.clone();i.$_terms.truthy=i.$_terms.truthy||new a;for(let e=0;e<t.length;++e){const r=t[e];n(void 0!==r,"Cannot call truthy with undefined"),i.$_terms.truthy.add(r)}return i}},falsy:{method(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];o.verifyFlat(t,"falsy");const i=this.clone();i.$_terms.falsy=i.$_terms.falsy||new a;for(let e=0;e<t.length;++e){const r=t[e];n(void 0!==r,"Cannot call falsy with undefined"),i.$_terms.falsy.add(r)}return i}},sensitive:{method(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.$_setFlag("sensitive",e)}}},cast:{number:{from:s.isBool,to:(e,t)=>e?1:0},string:{from:s.isBool,to:(e,t)=>e?"true":"false"}},manifest:{build:(e,t)=>(t.truthy&&(e=e.truthy(...t.truthy)),t.falsy&&(e=e.falsy(...t.falsy)),e)},messages:{"boolean.base":"{{#label}} must be a boolean"}})},7500:(e,t,r)=>{const n=r(375),i=r(8068),o=r(8160),a=r(3328),s={isDate:function(e){return e instanceof Date}};e.exports=i.extend({type:"date",coerce:{from:["number","string"],method(e,t){let{schema:r}=t;return{value:s.parse(e,r._flags.format)||e}}},validate(e,t){let{schema:r,error:n,prefs:i}=t;if(e instanceof Date&&!isNaN(e.getTime()))return;const o=r._flags.format;return i.convert&&o&&"string"==typeof e?{value:e,errors:n("date.format",{format:o})}:{value:e,errors:n("date.base")}},rules:{compare:{method:!1,validate(e,t,r,n){let{date:i}=r,{name:a,operator:s,args:l}=n;const u="now"===i?Date.now():i.getTime();return o.compare(e.getTime(),u,s)?e:t.error("date."+a,{limit:l.date,value:e})},args:[{name:"date",ref:!0,normalize:e=>"now"===e?e:s.parse(e),assert:e=>null!==e,message:"must have a valid date format"}]},format:{method(e){return n(["iso","javascript","unix"].includes(e),"Unknown date format",e),this.$_setFlag("format",e)}},greater:{method(e){return this.$_addRule({name:"greater",method:"compare",args:{date:e},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(e){return this.$_addRule({name:"less",method:"compare",args:{date:e},operator:"<"})}},max:{method(e){return this.$_addRule({name:"max",method:"compare",args:{date:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"compare",args:{date:e},operator:">="})}},timestamp:{method(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"javascript";return n(["javascript","unix"].includes(e),'"type" must be one of "javascript, unix"'),this.format(e)}}},cast:{number:{from:s.isDate,to:(e,t)=>e.getTime()},string:{from:s.isDate,to(e,t){let{prefs:r}=t;return a.date(e,r)}}},messages:{"date.base":"{{#label}} must be a valid date","date.format":'{{#label}} must be in {msg("date.format." + #format) || #format} format',"date.greater":"{{#label}} must be greater than {{:#limit}}","date.less":"{{#label}} must be less than {{:#limit}}","date.max":"{{#label}} must be less than or equal to {{:#limit}}","date.min":"{{#label}} must be greater than or equal to {{:#limit}}","date.format.iso":"ISO 8601 date","date.format.javascript":"timestamp or number of milliseconds","date.format.unix":"timestamp or number of seconds"}}),s.parse=function(e,t){if(e instanceof Date)return e;if("string"!=typeof e&&(isNaN(e)||!isFinite(e)))return null;if(/^\s*$/.test(e))return null;if("iso"===t)return o.isIsoDate(e)?s.date(e.toString()):null;const r=e;if("string"==typeof e&&/^[+-]?\d+(\.\d+)?$/.test(e)&&(e=parseFloat(e)),t){if("javascript"===t)return s.date(1*e);if("unix"===t)return s.date(1e3*e);if("string"==typeof r)return null}return s.date(e)},s.date=function(e){const t=new Date(e);return isNaN(t.getTime())?null:t}},390:(e,t,r)=>{const n=r(375),i=r(7824);e.exports=i.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(e){return n(Number.isSafeInteger(e)&&e>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:e}})},validate(e,t,r){let{n}=r;return e.length===n?e:t.error("function.arity",{n})}},class:{method(){return this.$_addRule("class")},validate:(e,t)=>/^\s*class\s/.test(e.toString())?e:t.error("function.class",{value:e})},minArity:{method(e){return n(Number.isSafeInteger(e)&&e>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:e}})},validate(e,t,r){let{n}=r;return e.length>=n?e:t.error("function.minArity",{n})}},maxArity:{method(e){return n(Number.isSafeInteger(e)&&e>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:e}})},validate(e,t,r){let{n}=r;return e.length<=n?e:t.error("function.maxArity",{n})}}},messages:{"function.arity":"{{#label}} must have an arity of {{#n}}","function.class":"{{#label}} must be a class","function.maxArity":"{{#label}} must have an arity lesser or equal to {{#n}}","function.minArity":"{{#label}} must have an arity greater or equal to {{#n}}"}})},7824:(e,t,r)=>{const n=r(978),i=r(375),o=r(8571),a=r(3652),s=r(8068),l=r(8160),u=r(3292),c=r(6354),d=r(6133),f=r(3328),p={renameDefaults:{alias:!1,multiple:!1,override:!1}};e.exports=s.extend({type:"_keys",properties:{typeof:"object"},flags:{unknown:{default:!1}},terms:{dependencies:{init:null},keys:{init:null,manifest:{mapped:{from:"schema",to:"key"}}},patterns:{init:null},renames:{init:null}},args:(e,t)=>e.keys(t),validate(e,t){let{schema:r,error:n,state:i,prefs:o}=t;if(!e||typeof e!==r.$_property("typeof")||Array.isArray(e))return{value:e,errors:n("object.base",{type:r.$_property("typeof")})};if(!(r.$_terms.renames||r.$_terms.dependencies||r.$_terms.keys||r.$_terms.patterns||r.$_terms.externals))return;e=p.clone(e,o);const a=[];if(r.$_terms.renames&&!p.rename(r,e,i,o,a))return{value:e,errors:a};if(!r.$_terms.keys&&!r.$_terms.patterns&&!r.$_terms.dependencies)return{value:e,errors:a};const s=new Set(Object.keys(e));if(r.$_terms.keys){const t=[e,...i.ancestors];for(const n of r.$_terms.keys){const r=n.key,l=e[r];s.delete(r);const u=i.localize([...i.path,r],t,n),c=n.schema.$_validate(l,u,o);if(c.errors){if(o.abortEarly)return{value:e,errors:c.errors};void 0!==c.value&&(e[r]=c.value),a.push(...c.errors)}else"strip"===n.schema._flags.result||void 0===c.value&&void 0!==l?delete e[r]:void 0!==c.value&&(e[r]=c.value)}}if(s.size||r._flags._hasPatternMatch){const t=p.unknown(r,e,s,a,i,o);if(t)return t}if(r.$_terms.dependencies)for(const t of r.$_terms.dependencies){if(null!==t.key&&!1===p.isPresent(t.options)(t.key.resolve(e,i,o,null,{shadow:!1})))continue;const n=p.dependencies[t.rel](r,t,e,i,o);if(n){const t=r.$_createError(n.code,e,n.context,i,o);if(o.abortEarly)return{value:e,errors:t};a.push(t)}}return{value:e,errors:a}},rules:{and:{method(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return l.verifyFlat(t,"and"),p.dependency(this,"and",null,t)}},append:{method(e){return null==e||0===Object.keys(e).length?this:this.keys(e)}},assert:{method(e,t,r){f.isTemplate(e)||(e=u.ref(e)),i(void 0===r||"string"==typeof r,"Message must be a string"),t=this.$_compile(t,{appendPath:!0});const n=this.$_addRule({name:"assert",args:{subject:e,schema:t,message:r}});return n.$_mutateRegister(e),n.$_mutateRegister(t),n},validate(e,t,r){let{error:n,prefs:i,state:o}=t,{subject:a,schema:s,message:l}=r;const u=a.resolve(e,o,i),c=d.isRef(a)?a.absolute(o):[];return s.$_match(u,o.localize(c,[e,...o.ancestors],s),i)?e:n("object.assert",{subject:a,message:l})},args:["subject","schema","message"],multi:!0},instance:{method(e,t){return i("function"==typeof e,"constructor must be a function"),t=t||e.name,this.$_addRule({name:"instance",args:{constructor:e,name:t}})},validate(e,t,r){let{constructor:n,name:i}=r;return e instanceof n?e:t.error("object.instance",{type:i,value:e})},args:["constructor","name"]},keys:{method(e){i(void 0===e||"object"==typeof e,"Object schema must be a valid object"),i(!l.isSchema(e),"Object schema cannot be a joi schema");const t=this.clone();if(e)if(Object.keys(e).length){t.$_terms.keys=t.$_terms.keys?t.$_terms.keys.filter((t=>!e.hasOwnProperty(t.key))):new p.Keys;for(const r in e)l.tryWithPath((()=>t.$_terms.keys.push({key:r,schema:this.$_compile(e[r])})),r)}else t.$_terms.keys=new p.Keys;else t.$_terms.keys=null;return t.$_mutateRebuild()}},length:{method(e){return this.$_addRule({name:"length",args:{limit:e},operator:"="})},validate(e,t,r,n){let{limit:i}=r,{name:o,operator:a,args:s}=n;return l.compare(Object.keys(e).length,i,a)?e:t.error("object."+o,{limit:s.limit,value:e})},args:[{name:"limit",ref:!0,assert:l.limit,message:"must be a positive integer"}]},max:{method(e){return this.$_addRule({name:"max",method:"length",args:{limit:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"length",args:{limit:e},operator:">="})}},nand:{method(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return l.verifyFlat(t,"nand"),p.dependency(this,"nand",null,t)}},or:{method(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return l.verifyFlat(t,"or"),p.dependency(this,"or",null,t)}},oxor:{method(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return p.dependency(this,"oxor",null,t)}},pattern:{method(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=e instanceof RegExp;n||(e=this.$_compile(e,{appendPath:!0})),i(void 0!==t,"Invalid rule"),l.assertOptions(r,["fallthrough","matches"]),n&&i(!e.flags.includes("g")&&!e.flags.includes("y"),"pattern should not use global or sticky mode"),t=this.$_compile(t,{appendPath:!0});const o=this.clone();o.$_terms.patterns=o.$_terms.patterns||[];const a={[n?"regex":"schema"]:e,rule:t};return r.matches&&(a.matches=this.$_compile(r.matches),"array"!==a.matches.type&&(a.matches=a.matches.$_root.array().items(a.matches)),o.$_mutateRegister(a.matches),o.$_setFlag("_hasPatternMatch",!0,{clone:!1})),r.fallthrough&&(a.fallthrough=!0),o.$_terms.patterns.push(a),o.$_mutateRegister(t),o}},ref:{method(){return this.$_addRule("ref")},validate:(e,t)=>d.isRef(e)?e:t.error("object.refType",{value:e})},regex:{method(){return this.$_addRule("regex")},validate:(e,t)=>e instanceof RegExp?e:t.error("object.regex",{value:e})},rename:{method(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};i("string"==typeof e||e instanceof RegExp,"Rename missing the from argument"),i("string"==typeof t||t instanceof f,"Invalid rename to argument"),i(t!==e,"Cannot rename key to same name:",e),l.assertOptions(r,["alias","ignoreUndefined","override","multiple"]);const o=this.clone();o.$_terms.renames=o.$_terms.renames||[];for(const t of o.$_terms.renames)i(t.from!==e,"Cannot rename the same key multiple times");return t instanceof f&&o.$_mutateRegister(t),o.$_terms.renames.push({from:e,to:t,options:n(p.renameDefaults,r)}),o}},schema:{method(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"any";return this.$_addRule({name:"schema",args:{type:e}})},validate(e,t,r){let{type:n}=r;return!l.isSchema(e)||"any"!==n&&e.type!==n?t.error("object.schema",{type:n}):e}},unknown:{method(e){return this.$_setFlag("unknown",!1!==e)}},with:{method(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return p.dependency(this,"with",e,t,r)}},without:{method(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return p.dependency(this,"without",e,t,r)}},xor:{method(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return l.verifyFlat(t,"xor"),p.dependency(this,"xor",null,t)}}},overrides:{default(e,t){return void 0===e&&(e=l.symbols.deepDefault),this.$_parent("default",e,t)}},rebuild(e){if(e.$_terms.keys){const t=new a.Sorter;for(const r of e.$_terms.keys)l.tryWithPath((()=>t.add(r,{after:r.schema.$_rootReferences(),group:r.key})),r.key);e.$_terms.keys=new p.Keys(...t.nodes)}},manifest:{build(e,t){if(t.keys&&(e=e.keys(t.keys)),t.dependencies)for(const{rel:r,key:n=null,peers:i,options:o}of t.dependencies)e=p.dependency(e,r,n,i,o);if(t.patterns)for(const{regex:r,schema:n,rule:i,fallthrough:o,matches:a}of t.patterns)e=e.pattern(r||n,i,{fallthrough:o,matches:a});if(t.renames)for(const{from:r,to:n,options:i}of t.renames)e=e.rename(r,n,i);return e}},messages:{"object.and":"{{#label}} contains {{#presentWithLabels}} without its required peers {{#missingWithLabels}}","object.assert":'{{#label}} is invalid because {if(#subject.key, `"` + #subject.key + `" failed to ` + (#message || "pass the assertion test"), #message || "the assertion failed")}',"object.base":"{{#label}} must be of type {{#type}}","object.instance":"{{#label}} must be an instance of {{:#type}}","object.length":'{{#label}} must have {{#limit}} key{if(#limit == 1, "", "s")}',"object.max":'{{#label}} must have less than or equal to {{#limit}} key{if(#limit == 1, "", "s")}',"object.min":'{{#label}} must have at least {{#limit}} key{if(#limit == 1, "", "s")}',"object.missing":"{{#label}} must contain at least one of {{#peersWithLabels}}","object.nand":"{{:#mainWithLabel}} must not exist simultaneously with {{#peersWithLabels}}","object.oxor":"{{#label}} contains a conflict between optional exclusive peers {{#peersWithLabels}}","object.pattern.match":"{{#label}} keys failed to match pattern requirements","object.refType":"{{#label}} must be a Joi reference","object.regex":"{{#label}} must be a RegExp object","object.rename.multiple":"{{#label}} cannot rename {{:#from}} because multiple renames are disabled and another key was already renamed to {{:#to}}","object.rename.override":"{{#label}} cannot rename {{:#from}} because override is disabled and target {{:#to}} exists","object.schema":"{{#label}} must be a Joi schema of {{#type}} type","object.unknown":"{{#label}} is not allowed","object.with":"{{:#mainWithLabel}} missing required peer {{:#peerWithLabel}}","object.without":"{{:#mainWithLabel}} conflict with forbidden peer {{:#peerWithLabel}}","object.xor":"{{#label}} contains a conflict between exclusive peers {{#peersWithLabels}}"}}),p.clone=function(e,t){if("object"==typeof e){if(t.nonEnumerables)return o(e,{shallow:!0});const r=Object.create(Object.getPrototypeOf(e));return Object.assign(r,e),r}const r=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return e.apply(this,r)};return r.prototype=o(e.prototype),Object.defineProperty(r,"name",{value:e.name,writable:!1}),Object.defineProperty(r,"length",{value:e.length,writable:!1}),Object.assign(r,e),r},p.dependency=function(e,t,r,n,o){i(null===r||"string"==typeof r,t,"key must be a strings"),o||(o=n.length>1&&"object"==typeof n[n.length-1]?n.pop():{}),l.assertOptions(o,["separator","isPresent"]),n=[].concat(n);const a=l.default(o.separator,"."),s=[];for(const e of n)i("string"==typeof e,t,"peers must be strings"),s.push(u.ref(e,{separator:a,ancestor:0,prefix:!1}));null!==r&&(r=u.ref(r,{separator:a,ancestor:0,prefix:!1}));const c=e.clone();return c.$_terms.dependencies=c.$_terms.dependencies||[],c.$_terms.dependencies.push(new p.Dependency(t,r,s,n,o)),c},p.dependencies={and(e,t,r,n,i){const o=[],a=[],s=t.peers.length,l=p.isPresent(t.options);for(const e of t.peers)!1===l(e.resolve(r,n,i,null,{shadow:!1}))?o.push(e.key):a.push(e.key);if(o.length!==s&&a.length!==s)return{code:"object.and",context:{present:a,presentWithLabels:p.keysToLabels(e,a),missing:o,missingWithLabels:p.keysToLabels(e,o)}}},nand(e,t,r,n,i){const o=[],a=p.isPresent(t.options);for(const e of t.peers)a(e.resolve(r,n,i,null,{shadow:!1}))&&o.push(e.key);if(o.length!==t.peers.length)return;const s=t.paths[0],l=t.paths.slice(1);return{code:"object.nand",context:{main:s,mainWithLabel:p.keysToLabels(e,s),peers:l,peersWithLabels:p.keysToLabels(e,l)}}},or(e,t,r,n,i){const o=p.isPresent(t.options);for(const e of t.peers)if(o(e.resolve(r,n,i,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:t.paths,peersWithLabels:p.keysToLabels(e,t.paths)}}},oxor(e,t,r,n,i){const o=[],a=p.isPresent(t.options);for(const e of t.peers)a(e.resolve(r,n,i,null,{shadow:!1}))&&o.push(e.key);if(!o.length||1===o.length)return;const s={peers:t.paths,peersWithLabels:p.keysToLabels(e,t.paths)};return s.present=o,s.presentWithLabels=p.keysToLabels(e,o),{code:"object.oxor",context:s}},with(e,t,r,n,i){const o=p.isPresent(t.options);for(const a of t.peers)if(!1===o(a.resolve(r,n,i,null,{shadow:!1})))return{code:"object.with",context:{main:t.key.key,mainWithLabel:p.keysToLabels(e,t.key.key),peer:a.key,peerWithLabel:p.keysToLabels(e,a.key)}}},without(e,t,r,n,i){const o=p.isPresent(t.options);for(const a of t.peers)if(o(a.resolve(r,n,i,null,{shadow:!1})))return{code:"object.without",context:{main:t.key.key,mainWithLabel:p.keysToLabels(e,t.key.key),peer:a.key,peerWithLabel:p.keysToLabels(e,a.key)}}},xor(e,t,r,n,i){const o=[],a=p.isPresent(t.options);for(const e of t.peers)a(e.resolve(r,n,i,null,{shadow:!1}))&&o.push(e.key);if(1===o.length)return;const s={peers:t.paths,peersWithLabels:p.keysToLabels(e,t.paths)};return 0===o.length?{code:"object.missing",context:s}:(s.present=o,s.presentWithLabels=p.keysToLabels(e,o),{code:"object.xor",context:s})}},p.keysToLabels=function(e,t){return Array.isArray(t)?t.map((t=>e.$_mapLabels(t))):e.$_mapLabels(t)},p.isPresent=function(e){return"function"==typeof e.isPresent?e.isPresent:e=>void 0!==e},p.rename=function(e,t,r,n,i){const o={};for(const a of e.$_terms.renames){const s=[],l="string"!=typeof a.from;if(l)for(const e in t){if(void 0===t[e]&&a.options.ignoreUndefined)continue;if(e===a.to)continue;const r=a.from.exec(e);r&&s.push({from:e,to:a.to,match:r})}else!Object.prototype.hasOwnProperty.call(t,a.from)||void 0===t[a.from]&&a.options.ignoreUndefined||s.push(a);for(const u of s){const s=u.from;let c=u.to;if(c instanceof f&&(c=c.render(t,r,n,u.match)),s!==c){if(!a.options.multiple&&o[c]&&(i.push(e.$_createError("object.rename.multiple",t,{from:s,to:c,pattern:l},r,n)),n.abortEarly))return!1;if(Object.prototype.hasOwnProperty.call(t,c)&&!a.options.override&&!o[c]&&(i.push(e.$_createError("object.rename.override",t,{from:s,to:c,pattern:l},r,n)),n.abortEarly))return!1;void 0===t[s]?delete t[c]:t[c]=t[s],o[c]=!0,a.options.alias||delete t[s]}}}return!0},p.unknown=function(e,t,r,n,i,o){if(e.$_terms.patterns){let a=!1;const s=e.$_terms.patterns.map((e=>{if(e.matches)return a=!0,[]})),l=[t,...i.ancestors];for(const a of r){const u=t[a],c=[...i.path,a];for(let d=0;d<e.$_terms.patterns.length;++d){const f=e.$_terms.patterns[d];if(f.regex){const e=f.regex.test(a);if(i.mainstay.tracer.debug(i,"rule",`pattern.${d}`,e?"pass":"error"),!e)continue}else if(!f.schema.$_match(a,i.nest(f.schema,`pattern.${d}`),o))continue;r.delete(a);const p=i.localize(c,l,{schema:f.rule,key:a}),h=f.rule.$_validate(u,p,o);if(h.errors){if(o.abortEarly)return{value:t,errors:h.errors};n.push(...h.errors)}if(f.matches&&s[d].push(a),t[a]=h.value,!f.fallthrough)break}}if(a)for(let r=0;r<s.length;++r){const a=s[r];if(!a)continue;const u=e.$_terms.patterns[r].matches,d=i.localize(i.path,l,u),f=u.$_validate(a,d,o);if(f.errors){const r=c.details(f.errors,{override:!1});r.matches=a;const s=e.$_createError("object.pattern.match",t,r,i,o);if(o.abortEarly)return{value:t,errors:s};n.push(s)}}}if(r.size&&(e.$_terms.keys||e.$_terms.patterns)){if(o.stripUnknown&&!e._flags.unknown||o.skipFunctions){const e=!(!o.stripUnknown||!0!==o.stripUnknown&&!o.stripUnknown.objects);for(const n of r)e?(delete t[n],r.delete(n)):"function"==typeof t[n]&&r.delete(n)}if(!l.default(e._flags.unknown,o.allowUnknown))for(const a of r){const r=i.localize([...i.path,a],[]),s=e.$_createError("object.unknown",t[a],{child:a},r,o,{flags:!1});if(o.abortEarly)return{value:t,errors:s};n.push(s)}}},p.Dependency=class{constructor(e,t,r,n,i){this.rel=e,this.key=t,this.peers=r,this.paths=n,this.options=i}describe(){const e={rel:this.rel,peers:this.paths};return null!==this.key&&(e.key=this.key.key),"."!==this.peers[0].separator&&(e.options={...e.options,separator:this.peers[0].separator}),this.options.isPresent&&(e.options={...e.options,isPresent:this.options.isPresent}),e}},p.Keys=class extends Array{concat(e){const t=this.slice(),r=new Map;for(let e=0;e<t.length;++e)r.set(t[e].key,e);for(const n of e){const e=n.key,i=r.get(e);void 0!==i?t[i]={key:e,schema:t[i].schema.concat(n.schema)}:t.push(n)}return t}}},8785:(e,t,r)=>{const n=r(375),i=r(8068),o=r(8160),a=r(3292),s=r(6354),l={};e.exports=i.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args:(e,t)=>e.ref(t),validate(e,t){let{schema:r,state:i,prefs:o}=t;n(r.$_terms.link,"Uninitialized link schema");const a=l.generate(r,e,i,o),s=r.$_terms.link[0].ref;return a.$_validate(e,i.nest(a,`link:${s.display}:${a.type}`),o)},generate:(e,t,r,n)=>l.generate(e,t,r,n),rules:{ref:{method(e){n(!this.$_terms.link,"Cannot reinitialize schema"),e=a.ref(e),n("value"===e.type||"local"===e.type,"Invalid reference type:",e.type),n("local"===e.type||"root"===e.ancestor||e.ancestor>0,"Link cannot reference itself");const t=this.clone();return t.$_terms.link=[{ref:e}],t}},relative:{method(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.$_setFlag("relative",e)}}},overrides:{concat(e){n(this.$_terms.link,"Uninitialized link schema"),n(o.isSchema(e),"Invalid schema object"),n("link"!==e.type,"Cannot merge type link with another link");const t=this.clone();return t.$_terms.whens||(t.$_terms.whens=[]),t.$_terms.whens.push({concat:e}),t.$_mutateRebuild()}},manifest:{build:(e,t)=>(n(t.link,"Invalid link description missing link"),e.ref(t.link))}}),l.generate=function(e,t,r,n){let i=r.mainstay.links.get(e);if(i)return i._generate(t,r,n).schema;const o=e.$_terms.link[0].ref,{perspective:a,path:s}=l.perspective(o,r);l.assert(a,"which is outside of schema boundaries",o,e,r,n);try{i=s.length?a.$_reach(s):a}catch(t){l.assert(!1,"to non-existing schema",o,e,r,n)}return l.assert("link"!==i.type,"which is another link",o,e,r,n),e._flags.relative||r.mainstay.links.set(e,i),i._generate(t,r,n).schema},l.perspective=function(e,t){if("local"===e.type){for(const{schema:r,key:n}of t.schemas){if((r._flags.id||n)===e.path[0])return{perspective:r,path:e.path.slice(1)};if(r.$_terms.shared)for(const t of r.$_terms.shared)if(t._flags.id===e.path[0])return{perspective:t,path:e.path.slice(1)}}return{perspective:null,path:null}}return"root"===e.ancestor?{perspective:t.schemas[t.schemas.length-1].schema,path:e.path}:{perspective:t.schemas[e.ancestor]&&t.schemas[e.ancestor].schema,path:e.path}},l.assert=function(e,t,r,i,o,a){e||n(!1,`"${s.label(i._flags,o,a)}" contains link reference "${r.display}" ${t}`)}},3832:(e,t,r)=>{const n=r(375),i=r(8068),o=r(8160),a={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,exponentialPartRegex:/[eE][+-]?\d+$/,leadingSignAndZerosRegex:/^[+-]?(0*)?/,dotRegex:/\./,trailingZerosRegex:/0+$/};e.exports=i.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(e,t){let{schema:r,error:n}=t;if(!e.match(a.numberRx))return;e=e.trim();const i={value:parseFloat(e)};if(0===i.value&&(i.value=0),!r._flags.unsafe)if(e.match(/e/i)){if(a.extractSignificantDigits(e)!==a.extractSignificantDigits(String(i.value)))return i.errors=n("number.unsafe"),i}else{const t=i.value.toString();if(t.match(/e/i))return i;if(t!==a.normalizeDecimal(e))return i.errors=n("number.unsafe"),i}return i}},validate(e,t){let{schema:r,error:n,prefs:i}=t;if(e===1/0||e===-1/0)return{value:e,errors:n("number.infinity")};if(!o.isNumber(e))return{value:e,errors:n("number.base")};const a={value:e};if(i.convert){const e=r.$_getRule("precision");if(e){const t=Math.pow(10,e.args.limit);a.value=Math.round(a.value*t)/t}}return 0===a.value&&(a.value=0),!r._flags.unsafe&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&(a.errors=n("number.unsafe")),a},rules:{compare:{method:!1,validate(e,t,r,n){let{limit:i}=r,{name:a,operator:s,args:l}=n;return o.compare(e,i,s)?e:t.error("number."+a,{limit:l.limit,value:e})},args:[{name:"limit",ref:!0,assert:o.isNumber,message:"must be a number"}]},greater:{method(e){return this.$_addRule({name:"greater",method:"compare",args:{limit:e},operator:">"})}},integer:{method(){return this.$_addRule("integer")},validate:(e,t)=>Math.trunc(e)-e==0?e:t.error("number.integer")},less:{method(e){return this.$_addRule({name:"less",method:"compare",args:{limit:e},operator:"<"})}},max:{method(e){return this.$_addRule({name:"max",method:"compare",args:{limit:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"compare",args:{limit:e},operator:">="})}},multiple:{method(e){return this.$_addRule({name:"multiple",args:{base:e}})},validate(e,t,r,n){let{base:i}=r;return e*(1/i)%1==0?e:t.error("number.multiple",{multiple:n.args.base,value:e})},args:[{name:"base",ref:!0,assert:e=>"number"==typeof e&&isFinite(e)&&e>0,message:"must be a positive number"}],multi:!0},negative:{method(){return this.sign("negative")}},port:{method(){return this.$_addRule("port")},validate:(e,t)=>Number.isSafeInteger(e)&&e>=0&&e<=65535?e:t.error("number.port")},positive:{method(){return this.sign("positive")}},precision:{method(e){return n(Number.isSafeInteger(e),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:e}})},validate(e,t,r){let{limit:n}=r;const i=e.toString().match(a.precisionRx);return Math.max((i[1]?i[1].length:0)-(i[2]?parseInt(i[2],10):0),0)<=n?e:t.error("number.precision",{limit:n,value:e})},convert:!0},sign:{method(e){return n(["negative","positive"].includes(e),"Invalid sign",e),this.$_addRule({name:"sign",args:{sign:e}})},validate(e,t,r){let{sign:n}=r;return"negative"===n&&e<0||"positive"===n&&e>0?e:t.error(`number.${n}`)}},unsafe:{method(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return n("boolean"==typeof e,"enabled must be a boolean"),this.$_setFlag("unsafe",e)}}},cast:{string:{from:e=>"number"==typeof e,to:(e,t)=>e.toString()}},messages:{"number.base":"{{#label}} must be a number","number.greater":"{{#label}} must be greater than {{#limit}}","number.infinity":"{{#label}} cannot be infinity","number.integer":"{{#label}} must be an integer","number.less":"{{#label}} must be less than {{#limit}}","number.max":"{{#label}} must be less than or equal to {{#limit}}","number.min":"{{#label}} must be greater than or equal to {{#limit}}","number.multiple":"{{#label}} must be a multiple of {{#multiple}}","number.negative":"{{#label}} must be a negative number","number.port":"{{#label}} must be a valid port","number.positive":"{{#label}} must be a positive number","number.precision":"{{#label}} must have no more than {{#limit}} decimal places","number.unsafe":"{{#label}} must be a safe number"}}),a.extractSignificantDigits=function(e){return e.replace(a.exponentialPartRegex,"").replace(a.dotRegex,"").replace(a.trailingZerosRegex,"").replace(a.leadingSignAndZerosRegex,"")},a.normalizeDecimal=function(e){return(e=e.replace(/^\+/,"").replace(/\.0*$/,"").replace(/^(-?)\.([^\.]*)$/,"$10.$2").replace(/^(-?)0+([0-9])/,"$1$2")).includes(".")&&e.endsWith("0")&&(e=e.replace(/0+$/,"")),"-0"===e?"0":e}},8966:(e,t,r)=>{const n=r(7824);e.exports=n.extend({type:"object",cast:{map:{from:e=>e&&"object"==typeof e,to:(e,t)=>new Map(Object.entries(e))}}})},7417:(e,t,r)=>{const n=r(375),i=r(5380),o=r(1745),a=r(9959),s=r(6064),l=r(9926),u=r(5752),c=r(8068),d=r(8160),f={tlds:l instanceof Set&&{tlds:{allow:l,deny:null}},base64Regex:{true:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}==|[\w\-]{3}=)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/},false:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}(==)?|[\w\-]{3}=?)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}(==)?|[A-Za-z0-9+\/]{3}=?)?$/}},dataUriRegex:/^data:[\w+.-]+\/[\w+.-]+;((charset=[\w-]+|base64),)?(.*)$/,hexRegex:/^[a-f0-9]+$/i,ipRegex:a.regex({cidr:"forbidden"}).regex,isoDurationRegex:/^P(?!$)(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?$/,guidBrackets:{"{":"}","[":"]","(":")","":""},guidVersions:{uuidv1:"1",uuidv2:"2",uuidv3:"3",uuidv4:"4",uuidv5:"5"},guidSeparators:new Set([void 0,!0,!1,"-",":"]),normalizationForms:["NFC","NFD","NFKC","NFKD"]};e.exports=c.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(e,t){let{schema:r,state:n,prefs:i}=t;const o=r.$_getRule("normalize");o&&(e=e.normalize(o.args.form));const a=r.$_getRule("case");a&&(e="upper"===a.args.direction?e.toLocaleUpperCase():e.toLocaleLowerCase());const s=r.$_getRule("trim");if(s&&s.args.enabled&&(e=e.trim()),r.$_terms.replacements)for(const t of r.$_terms.replacements)e=e.replace(t.pattern,t.replacement);const l=r.$_getRule("hex");if(l&&l.args.options.byteAligned&&e.length%2!=0&&(e=`0${e}`),r.$_getRule("isoDate")){const t=f.isoDate(e);t&&(e=t)}if(r._flags.truncate){const t=r.$_getRule("max");if(t){let o=t.args.limit;if(d.isResolvable(o)&&(o=o.resolve(e,n,i),!d.limit(o)))return{value:e,errors:r.$_createError("any.ref",o,{ref:t.args.limit,arg:"limit",reason:"must be a positive integer"},n,i)};e=e.slice(0,o)}}return{value:e}}},validate(e,t){let{schema:r,error:n}=t;if("string"!=typeof e)return{value:e,errors:n("string.base")};if(""===e){const t=r.$_getRule("min");if(t&&0===t.args.limit)return;return{value:e,errors:n("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate:(e,t)=>/^[a-zA-Z0-9]+$/.test(e)?e:t.error("string.alphanum")},base64:{method(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return d.assertOptions(e,["paddingRequired","urlSafe"]),e={urlSafe:!1,paddingRequired:!0,...e},n("boolean"==typeof e.paddingRequired,"paddingRequired must be boolean"),n("boolean"==typeof e.urlSafe,"urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:e}})},validate(e,t,r){let{options:n}=r;return f.base64Regex[n.paddingRequired][n.urlSafe].test(e)?e:t.error("string.base64")}},case:{method(e){return n(["lower","upper"].includes(e),"Invalid case:",e),this.$_addRule({name:"case",args:{direction:e}})},validate(e,t,r){let{direction:n}=r;return"lower"===n&&e===e.toLocaleLowerCase()||"upper"===n&&e===e.toLocaleUpperCase()?e:t.error(`string.${n}case`)},convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(e,t){let r=e.length,n=0,i=1;for(;r--;){const t=e.charAt(r)*i;n+=t-9*(t>9),i^=3}return n>0&&n%10==0?e:t.error("string.creditCard")}},dataUri:{method(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return d.assertOptions(e,["paddingRequired"]),e={paddingRequired:!0,...e},n("boolean"==typeof e.paddingRequired,"paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:e}})},validate(e,t,r){let{options:n}=r;const i=e.match(f.dataUriRegex);if(i){if(!i[2])return e;if("base64"!==i[2])return e;if(f.base64Regex[n.paddingRequired].false.test(i[3]))return e}return t.error("string.dataUri")}},domain:{method(e){e&&d.assertOptions(e,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const t=f.addressOptions(e);return this.$_addRule({name:"domain",args:{options:e},address:t})},validate(e,t,r,n){let{address:o}=n;return i.isValid(e,o)?e:t.error("string.domain")}},email:{method(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};d.assertOptions(e,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),n(void 0===e.multiple||"boolean"==typeof e.multiple,"multiple option must be an boolean");const t=f.addressOptions(e),r=new RegExp(`\\s*[${e.separator?s(e.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:e},regex:r,address:t})},validate(e,t,r,n){let{options:i}=r,{regex:a,address:s}=n;const l=i.multiple?e.split(a):[e],u=[];for(const e of l)o.isValid(e,s)||u.push(e);return u.length?t.error("string.email",{value:e,invalids:u}):e}},guid:{alias:"uuid",method(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};d.assertOptions(e,["version","separator"]);let t="";if(e.version){const r=[].concat(e.version);n(r.length>=1,"version must have at least 1 valid version specified");const i=new Set;for(let e=0;e<r.length;++e){const o=r[e];n("string"==typeof o,"version at position "+e+" must be a string");const a=f.guidVersions[o.toLowerCase()];n(a,"version at position "+e+" must be one of "+Object.keys(f.guidVersions).join(", ")),n(!i.has(a),"version at position "+e+" must not be a duplicate"),t+=a,i.add(a)}}n(f.guidSeparators.has(e.separator),'separator must be one of true, false, "-", or ":"');const r=void 0===e.separator?"[:-]?":!0===e.separator?"[:-]":!1===e.separator?"[]?":`\\${e.separator}`,i=new RegExp(`^([\\[{\\(]?)[0-9A-F]{8}(${r})[0-9A-F]{4}\\2?[${t||"0-9A-F"}][0-9A-F]{3}\\2?[${t?"89AB":"0-9A-F"}][0-9A-F]{3}\\2?[0-9A-F]{12}([\\]}\\)]?)$`,"i");return this.$_addRule({name:"guid",args:{options:e},regex:i})},validate(e,t,r,n){let{regex:i}=n;const o=i.exec(e);return o?f.guidBrackets[o[1]]!==o[o.length-1]?t.error("string.guid"):e:t.error("string.guid")}},hex:{method(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return d.assertOptions(e,["byteAligned"]),e={byteAligned:!1,...e},n("boolean"==typeof e.byteAligned,"byteAligned must be boolean"),this.$_addRule({name:"hex",args:{options:e}})},validate(e,t,r){let{options:n}=r;return f.hexRegex.test(e)?n.byteAligned&&e.length%2!=0?t.error("string.hexAlign"):e:t.error("string.hex")}},hostname:{method(){return this.$_addRule("hostname")},validate:(e,t)=>i.isValid(e,{minDomainSegments:1})||f.ipRegex.test(e)?e:t.error("string.hostname")},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};d.assertOptions(e,["cidr","version"]);const{cidr:t,versions:r,regex:n}=a.regex(e),i=e.version?r:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:t,version:i}},regex:n})},validate(e,t,r,n){let{options:i}=r,{regex:o}=n;return o.test(e)?e:i.version?t.error("string.ipVersion",{value:e,cidr:i.cidr,version:i.version}):t.error("string.ip",{value:e,cidr:i.cidr})}},isoDate:{method(){return this.$_addRule("isoDate")},validate(e,t){let{error:r}=t;return f.isoDate(e)?e:r("string.isoDate")}},isoDuration:{method(){return this.$_addRule("isoDuration")},validate:(e,t)=>f.isoDurationRegex.test(e)?e:t.error("string.isoDuration")},length:{method(e,t){return f.length(this,"length",e,"=",t)},validate(e,t,r,n){let{limit:i,encoding:o}=r,{name:a,operator:s,args:l}=n;const u=!o&&e.length;return d.compare(u,i,s)?e:t.error("string."+a,{limit:l.limit,value:e,encoding:o})},args:[{name:"limit",ref:!0,assert:d.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(e,t){return f.length(this,"max",e,"<=",t)},args:["limit","encoding"]},min:{method(e,t){return f.length(this,"min",e,">=",t)},args:["limit","encoding"]},normalize:{method(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"NFC";return n(f.normalizationForms.includes(e),"normalization form must be one of "+f.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:e}})},validate(e,t,r){let{error:n}=t,{form:i}=r;return e===e.normalize(i)?e:n("string.normalize",{value:e,form:i})},convert:!0},pattern:{alias:"regex",method(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n(e instanceof RegExp,"regex must be a RegExp"),n(!e.flags.includes("g")&&!e.flags.includes("y"),"regex should not use global or sticky mode"),"string"==typeof t&&(t={name:t}),d.assertOptions(t,["invert","name"]);const r=["string.pattern",t.invert?".invert":"",t.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:e,options:t},errorCode:r})},validate(e,t,r,n){let{regex:i,options:o}=r,{errorCode:a}=n;return i.test(e)^o.invert?e:t.error(a,{name:o.name,regex:i,value:e})},args:["regex","options"],multi:!0},replace:{method(e,t){"string"==typeof e&&(e=new RegExp(s(e),"g")),n(e instanceof RegExp,"pattern must be a RegExp"),n("string"==typeof t,"replacement must be a String");const r=this.clone();return r.$_terms.replacements||(r.$_terms.replacements=[]),r.$_terms.replacements.push({pattern:e,replacement:t}),r}},token:{method(){return this.$_addRule("token")},validate:(e,t)=>/^\w+$/.test(e)?e:t.error("string.token")},trim:{method(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return n("boolean"==typeof e,"enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:e}})},validate(e,t,r){let{enabled:n}=r;return n&&e!==e.trim()?t.error("string.trim"):e},convert:!0},truncate:{method(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return n("boolean"==typeof e,"enabled must be a boolean"),this.$_setFlag("truncate",e)}},uppercase:{method(){return this.case("upper")}},uri:{method(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};d.assertOptions(e,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme"]),e.domain&&d.assertOptions(e.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const{regex:t,scheme:r}=u.regex(e),n=e.domain?f.addressOptions(e.domain):null;return this.$_addRule({name:"uri",args:{options:e},regex:t,domain:n,scheme:r})},validate(e,t,r,n){let{options:o}=r,{regex:a,domain:s,scheme:l}=n;if(["http:/","https:/"].includes(e))return t.error("string.uri");const u=a.exec(e);if(u){const r=u[1]||u[2];return!s||o.allowRelative&&!r||i.isValid(r,s)?e:t.error("string.domain",{value:r})}return o.relativeOnly?t.error("string.uriRelativeOnly"):o.scheme?t.error("string.uriCustomScheme",{scheme:l,value:e}):t.error("string.uri")}}},manifest:{build(e,t){if(t.replacements)for(const{pattern:r,replacement:n}of t.replacements)e=e.replace(r,n);return e}},messages:{"string.alphanum":"{{#label}} must only contain alpha-numeric characters","string.base":"{{#label}} must be a string","string.base64":"{{#label}} must be a valid base64 string","string.creditCard":"{{#label}} must be a credit card","string.dataUri":"{{#label}} must be a valid dataUri string","string.domain":"{{#label}} must contain a valid domain name","string.email":"{{#label}} must be a valid email","string.empty":"{{#label}} is not allowed to be empty","string.guid":"{{#label}} must be a valid GUID","string.hex":"{{#label}} must only contain hexadecimal characters","string.hexAlign":"{{#label}} hex decoded representation must be byte aligned","string.hostname":"{{#label}} must be a valid hostname","string.ip":"{{#label}} must be a valid ip address with a {{#cidr}} CIDR","string.ipVersion":"{{#label}} must be a valid ip address of one of the following versions {{#version}} with a {{#cidr}} CIDR","string.isoDate":"{{#label}} must be in iso format","string.isoDuration":"{{#label}} must be a valid ISO 8601 duration","string.length":"{{#label}} length must be {{#limit}} characters long","string.lowercase":"{{#label}} must only contain lowercase characters","string.max":"{{#label}} length must be less than or equal to {{#limit}} characters long","string.min":"{{#label}} length must be at least {{#limit}} characters long","string.normalize":"{{#label}} must be unicode normalized in the {{#form}} form","string.token":"{{#label}} must only contain alpha-numeric and underscore characters","string.pattern.base":"{{#label}} with value {:[.]} fails to match the required pattern: {{#regex}}","string.pattern.name":"{{#label}} with value {:[.]} fails to match the {{#name}} pattern","string.pattern.invert.base":"{{#label}} with value {:[.]} matches the inverted pattern: {{#regex}}","string.pattern.invert.name":"{{#label}} with value {:[.]} matches the inverted {{#name}} pattern","string.trim":"{{#label}} must not have leading or trailing whitespace","string.uri":"{{#label}} must be a valid uri","string.uriCustomScheme":"{{#label}} must be a valid uri with a scheme matching the {{#scheme}} pattern","string.uriRelativeOnly":"{{#label}} must be a valid relative uri","string.uppercase":"{{#label}} must only contain uppercase characters"}}),f.addressOptions=function(e){if(!e)return e;if(n(void 0===e.minDomainSegments||Number.isSafeInteger(e.minDomainSegments)&&e.minDomainSegments>0,"minDomainSegments must be a positive integer"),n(void 0===e.maxDomainSegments||Number.isSafeInteger(e.maxDomainSegments)&&e.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),!1===e.tlds)return e;if(!0===e.tlds||void 0===e.tlds)return n(f.tlds,"Built-in TLD list disabled"),Object.assign({},e,f.tlds);n("object"==typeof e.tlds,"tlds must be true, false, or an object");const t=e.tlds.deny;if(t)return Array.isArray(t)&&(e=Object.assign({},e,{tlds:{deny:new Set(t)}})),n(e.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),n(!e.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),f.validateTlds(e.tlds.deny,"tlds.deny"),e;const r=e.tlds.allow;return r?!0===r?(n(f.tlds,"Built-in TLD list disabled"),Object.assign({},e,f.tlds)):(Array.isArray(r)&&(e=Object.assign({},e,{tlds:{allow:new Set(r)}})),n(e.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),f.validateTlds(e.tlds.allow,"tlds.allow"),e):e},f.validateTlds=function(e,t){for(const r of e)n(i.isValid(r,{minDomainSegments:1,maxDomainSegments:1}),`${t} must contain valid top level domain names`)},f.isoDate=function(e){if(!d.isIsoDate(e))return null;/.*T.*[+-]\d\d$/.test(e)&&(e+="00");const t=new Date(e);return isNaN(t.getTime())?null:t.toISOString()},f.length=function(e,t,r,i,o){return n(!o||!1,"Invalid encoding:",o),e.$_addRule({name:t,method:"length",args:{limit:r,encoding:o},operator:i})}},8826:(e,t,r)=>{const n=r(375),i=r(8068),o={};o.Map=class extends Map{slice(){return new o.Map(this)}},e.exports=i.extend({type:"symbol",terms:{map:{init:new o.Map}},coerce:{method(e,t){let{schema:r,error:n}=t;const i=r.$_terms.map.get(e);return i&&(e=i),r._flags.only&&"symbol"!=typeof e?{value:e,errors:n("symbol.map",{map:r.$_terms.map})}:{value:e}}},validate(e,t){let{error:r}=t;if("symbol"!=typeof e)return{value:e,errors:r("symbol.base")}},rules:{map:{method(e){e&&!e[Symbol.iterator]&&"object"==typeof e&&(e=Object.entries(e)),n(e&&e[Symbol.iterator],"Iterable must be an iterable or object");const t=this.clone(),r=[];for(const i of e){n(i&&i[Symbol.iterator],"Entry must be an iterable");const[e,o]=i;n("object"!=typeof e&&"function"!=typeof e&&"symbol"!=typeof e,"Key must not be of type object, function, or Symbol"),n("symbol"==typeof o,"Value must be a Symbol"),t.$_terms.map.set(e,o),r.push(o)}return t.valid(...r)}}},manifest:{build:(e,t)=>(t.map&&(e=e.map(t.map)),e)},messages:{"symbol.base":"{{#label}} must be a symbol","symbol.map":"{{#label}} must be one of {{#map}}"}})},8863:(e,t,r)=>{const n=r(375),i=r(8571),o=r(738),a=r(9621),s=r(8160),l=r(6354),u=r(493),c={result:Symbol("result")};t.entry=function(e,t,r){let i=s.defaults;r&&(n(void 0===r.warnings,"Cannot override warnings preference in synchronous validation"),n(void 0===r.artifacts,"Cannot override artifacts preference in synchronous validation"),i=s.preferences(s.defaults,r));const o=c.entry(e,t,i);n(!o.mainstay.externals.length,"Schema with external rules must use validateAsync()");const a={value:o.value};return o.error&&(a.error=o.error),o.mainstay.warnings.length&&(a.warning=l.details(o.mainstay.warnings)),o.mainstay.debug&&(a.debug=o.mainstay.debug),o.mainstay.artifacts&&(a.artifacts=o.mainstay.artifacts),a},t.entryAsync=async function(e,t,r){let n=s.defaults;r&&(n=s.preferences(s.defaults,r));const i=c.entry(e,t,n),o=i.mainstay;if(i.error)throw o.debug&&(i.error.debug=o.debug),i.error;if(o.externals.length){let t=i.value;for(const{method:i,path:s,label:l}of o.externals){let o,u,c=t;s.length&&(o=s[s.length-1],u=a(t,s.slice(0,-1)),c=u[o]);try{const e=await i(c,{prefs:r});if(void 0===e||e===c)continue;u?u[o]=e:t=e}catch(e){throw n.errors.label&&(e.message+=` (${l})`),e}}i.value=t}if(!n.warnings&&!n.debug&&!n.artifacts)return i.value;const u={value:i.value};return o.warnings.length&&(u.warning=l.details(o.warnings)),o.debug&&(u.debug=o.debug),o.artifacts&&(u.artifacts=o.artifacts),u},c.entry=function(e,r,n){const{tracer:i,cleanup:o}=c.tracer(r,n),a={externals:[],warnings:[],tracer:i,debug:n.debug?[]:null,links:r._ids._schemaChain?new Map:null},s=r._ids._schemaChain?[{schema:r}]:null,d=new u([],[],{mainstay:a,schemas:s}),f=t.validate(e,r,d,n);o&&r.$_root.untrace();const p=l.process(f.errors,e,n);return{value:f.value,error:p,mainstay:a}},c.tracer=function(e,t){return e.$_root._tracer?{tracer:e.$_root._tracer._register(e)}:t.debug?(n(e.$_root.trace,"Debug mode not supported"),{tracer:e.$_root.trace()._register(e),cleanup:!0}):{tracer:c.ignore}},t.validate=function(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};if(t.$_terms.whens&&(t=t._generate(e,r,n).schema),t._preferences&&(n=c.prefs(t,n)),t._cache&&n.cache){const n=t._cache.get(e);if(r.mainstay.tracer.debug(r,"validate","cached",!!n),n)return n}const o=(i,o,a)=>t.$_createError(i,e,o,a||r,n),a={original:e,prefs:n,schema:t,state:r,error:o,errorsArray:c.errorsArray,warn:(e,t,n)=>r.mainstay.warnings.push(o(e,t,n)),message:(i,o)=>t.$_createError("custom",e,o,r,n,{messages:i})};r.mainstay.tracer.entry(t,r);const l=t._definition;if(l.prepare&&void 0!==e&&n.convert){const t=l.prepare(e,a);if(t){if(r.mainstay.tracer.value(r,"prepare",e,t.value),t.errors)return c.finalize(t.value,[].concat(t.errors),a);e=t.value}}if(l.coerce&&void 0!==e&&n.convert&&(!l.coerce.from||l.coerce.from.includes(typeof e))){const t=l.coerce.method(e,a);if(t){if(r.mainstay.tracer.value(r,"coerced",e,t.value),t.errors)return c.finalize(t.value,[].concat(t.errors),a);e=t.value}}const u=t._flags.empty;u&&u.$_match(c.trim(e,t),r.nest(u),s.defaults)&&(r.mainstay.tracer.value(r,"empty",e,void 0),e=void 0);const d=i.presence||t._flags.presence||(t._flags._endedSwitch?null:n.presence);if(void 0===e){if("forbidden"===d)return c.finalize(e,null,a);if("required"===d)return c.finalize(e,[t.$_createError("any.required",e,null,r,n)],a);if("optional"===d){if(t._flags.default!==s.symbols.deepDefault)return c.finalize(e,null,a);r.mainstay.tracer.value(r,"default",e,{}),e={}}}else if("forbidden"===d)return c.finalize(e,[t.$_createError("any.unknown",e,null,r,n)],a);const f=[];if(t._valids){const i=t._valids.get(e,r,n,t._flags.insensitive);if(i)return n.convert&&(r.mainstay.tracer.value(r,"valids",e,i.value),e=i.value),r.mainstay.tracer.filter(t,r,"valid",i),c.finalize(e,null,a);if(t._flags.only){const i=t.$_createError("any.only",e,{valids:t._valids.values({display:!0})},r,n);if(n.abortEarly)return c.finalize(e,[i],a);f.push(i)}}if(t._invalids){const i=t._invalids.get(e,r,n,t._flags.insensitive);if(i){r.mainstay.tracer.filter(t,r,"invalid",i);const o=t.$_createError("any.invalid",e,{invalids:t._invalids.values({display:!0})},r,n);if(n.abortEarly)return c.finalize(e,[o],a);f.push(o)}}if(l.validate){const t=l.validate(e,a);if(t&&(r.mainstay.tracer.value(r,"base",e,t.value),e=t.value,t.errors)){if(!Array.isArray(t.errors))return f.push(t.errors),c.finalize(e,f,a);if(t.errors.length)return f.push(...t.errors),c.finalize(e,f,a)}}return t._rules.length?c.rules(e,f,a):c.finalize(e,f,a)},c.rules=function(e,t,r){const{schema:n,state:i,prefs:o}=r;for(const a of n._rules){const l=n._definition.rules[a.method];if(l.convert&&o.convert){i.mainstay.tracer.log(n,i,"rule",a.name,"full");continue}let u,d=a.args;if(a._resolve.length){d=Object.assign({},d);for(const t of a._resolve){const r=l.argsByName.get(t),a=d[t].resolve(e,i,o),c=r.normalize?r.normalize(a):a,f=s.validateArg(c,null,r);if(f){u=n.$_createError("any.ref",a,{arg:t,ref:d[t],reason:f},i,o);break}d[t]=c}}u=u||l.validate(e,r,d,a);const f=c.rule(u,a);if(f.errors){if(i.mainstay.tracer.log(n,i,"rule",a.name,"error"),a.warn){i.mainstay.warnings.push(...f.errors);continue}if(o.abortEarly)return c.finalize(e,f.errors,r);t.push(...f.errors)}else i.mainstay.tracer.log(n,i,"rule",a.name,"pass"),i.mainstay.tracer.value(i,"rule",e,f.value,a.name),e=f.value}return c.finalize(e,t,r)},c.rule=function(e,t){return e instanceof l.Report?(c.error(e,t),{errors:[e],value:null}):Array.isArray(e)&&e[s.symbols.errors]?(e.forEach((e=>c.error(e,t))),{errors:e,value:null}):{errors:null,value:e}},c.error=function(e,t){return t.message&&e._setTemplate(t.message),e},c.finalize=function(e,t,r){t=t||[];const{schema:i,state:o,prefs:a}=r;if(t.length){const n=c.default("failover",void 0,t,r);void 0!==n&&(o.mainstay.tracer.value(o,"failover",e,n),e=n,t=[])}if(t.length&&i._flags.error)if("function"==typeof i._flags.error){t=i._flags.error(t),Array.isArray(t)||(t=[t]);for(const e of t)n(e instanceof Error||e instanceof l.Report,"error() must return an Error object")}else t=[i._flags.error];if(void 0===e){const n=c.default("default",e,t,r);o.mainstay.tracer.value(o,"default",e,n),e=n}if(i._flags.cast&&void 0!==e){const t=i._definition.cast[i._flags.cast];if(t.from(e)){const n=t.to(e,r);o.mainstay.tracer.value(o,"cast",e,n,i._flags.cast),e=n}}if(i.$_terms.externals&&a.externals&&!1!==a._externals)for(const{method:e}of i.$_terms.externals)o.mainstay.externals.push({method:e,path:o.path,label:l.label(i._flags,o,a)});const s={value:e,errors:t.length?t:null};return i._flags.result&&(s.value="strip"===i._flags.result?void 0:r.original,o.mainstay.tracer.value(o,i._flags.result,e,s.value),o.shadow(e,i._flags.result)),i._cache&&!1!==a.cache&&!i._refs.length&&i._cache.set(r.original,s),void 0===e||s.errors||void 0===i._flags.artifact||(o.mainstay.artifacts=o.mainstay.artifacts||new Map,o.mainstay.artifacts.has(i._flags.artifact)||o.mainstay.artifacts.set(i._flags.artifact,[]),o.mainstay.artifacts.get(i._flags.artifact).push(o.path)),s},c.prefs=function(e,t){const r=t===s.defaults;return r&&e._preferences[s.symbols.prefs]?e._preferences[s.symbols.prefs]:(t=s.preferences(t,e._preferences),r&&(e._preferences[s.symbols.prefs]=t),t)},c.default=function(e,t,r,n){const{schema:o,state:a,prefs:l}=n,u=o._flags[e];if(l.noDefaults||void 0===u)return t;if(a.mainstay.tracer.log(o,a,"rule",e,"full"),!u)return u;if("function"==typeof u){const s=u.length?[i(a.ancestors[0]),n]:[];try{return u(...s)}catch(t){return void r.push(o.$_createError(`any.${e}`,null,{error:t},a,l))}}return"object"!=typeof u?u:u[s.symbols.literal]?u.literal:s.isResolvable(u)?u.resolve(t,a,l):i(u)},c.trim=function(e,t){if("string"!=typeof e)return e;const r=t.$_getRule("trim");return r&&r.args.enabled?e.trim():e},c.ignore={active:!1,debug:o,entry:o,filter:o,log:o,resolve:o,value:o},c.errorsArray=function(){const e=[];return e[s.symbols.errors]=!0,e}},2036:(e,t,r)=>{const n=r(375),i=r(9474),o=r(8160),a={};e.exports=a.Values=class{constructor(e,t){this._values=new Set(e),this._refs=new Set(t),this._lowercase=a.lowercases(e),this._override=!1}get length(){return this._values.size+this._refs.size}add(e,t){o.isResolvable(e)?this._refs.has(e)||(this._refs.add(e),t&&t.register(e)):this.has(e,null,null,!1)||(this._values.add(e),"string"==typeof e&&this._lowercase.set(e.toLowerCase(),e))}static merge(e,t,r){if(e=e||new a.Values,t){if(t._override)return t.clone();for(const r of[...t._values,...t._refs])e.add(r)}if(r)for(const t of[...r._values,...r._refs])e.remove(t);return e.length?e:null}remove(e){o.isResolvable(e)?this._refs.delete(e):(this._values.delete(e),"string"==typeof e&&this._lowercase.delete(e.toLowerCase()))}has(e,t,r,n){return!!this.get(e,t,r,n)}get(e,t,r,n){if(!this.length)return!1;if(this._values.has(e))return{value:e};if("string"==typeof e&&e&&n){const t=this._lowercase.get(e.toLowerCase());if(t)return{value:t}}if(!this._refs.size&&"object"!=typeof e)return!1;if("object"==typeof e)for(const t of this._values)if(i(t,e))return{value:t};if(t)for(const o of this._refs){const a=o.resolve(e,t,r,null,{in:!0});if(void 0===a)continue;const s=o.in&&"object"==typeof a?Array.isArray(a)?a:Object.keys(a):[a];for(const t of s)if(typeof t==typeof e)if(n&&e&&"string"==typeof e){if(t.toLowerCase()===e.toLowerCase())return{value:t,ref:o}}else if(i(t,e))return{value:t,ref:o}}return!1}override(){this._override=!0}values(e){if(e&&e.display){const e=[];for(const t of[...this._values,...this._refs])void 0!==t&&e.push(t);return e}return Array.from([...this._values,...this._refs])}clone(){const e=new a.Values(this._values,this._refs);return e._override=this._override,e}concat(e){n(!e._override,"Cannot concat override set of values");const t=new a.Values([...this._values,...e._values],[...this._refs,...e._refs]);return t._override=this._override,t}describe(){const e=[];this._override&&e.push({override:!0});for(const t of this._values.values())e.push(t&&"object"==typeof t?{value:t}:t);for(const t of this._refs.values())e.push(t.describe());return e}},a.Values.prototype[o.symbols.values]=!0,a.Values.prototype.slice=a.Values.prototype.clone,a.lowercases=function(e){const t=new Map;if(e)for(const r of e)"string"==typeof r&&t.set(r.toLowerCase(),r);return t}},978:(e,t,r)=>{const n=r(375),i=r(8571),o=r(1687),a=r(9621),s={};e.exports=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(n(e&&"object"==typeof e,"Invalid defaults value: must be an object"),n(!t||!0===t||"object"==typeof t,"Invalid source value: must be true, falsy or an object"),n("object"==typeof r,"Invalid options: must be an object"),!t)return null;if(r.shallow)return s.applyToDefaultsWithShallow(e,t,r);const a=i(e);if(!0===t)return a;const l=void 0!==r.nullOverride&&r.nullOverride;return o(a,t,{nullOverride:l,mergeArrays:!1})},s.applyToDefaultsWithShallow=function(e,t,r){const l=r.shallow;n(Array.isArray(l),"Invalid keys");const u=new Map,c=!0===t?null:new Set;for(let r of l){r=Array.isArray(r)?r:r.split(".");const n=a(e,r);n&&"object"==typeof n?u.set(n,c&&a(t,r)||n):c&&c.add(r)}const d=i(e,{},u);if(!c)return d;for(const e of c)s.reachCopy(d,t,e);const f=void 0!==r.nullOverride&&r.nullOverride;return o(d,t,{nullOverride:f,mergeArrays:!1})},s.reachCopy=function(e,t,r){for(const e of r){if(!(e in t))return;const r=t[e];if("object"!=typeof r||null===r)return;t=r}const n=t;let i=e;for(let e=0;e<r.length-1;++e){const t=r[e];"object"!=typeof i[t]&&(i[t]={}),i=i[t]}i[r[r.length-1]]=n}},375:(e,t,r)=>{const n=r(7916);e.exports=function(e){if(!e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];if(1===r.length&&r[0]instanceof Error)throw r[0];throw new n(r)}}},8571:(e,t,r)=>{const n=r(9621),i=r(4277),o=r(7043),a={needsProtoHack:new Set([i.set,i.map,i.weakSet,i.weakMap])};e.exports=a.clone=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if("object"!=typeof e||null===e)return e;let n=a.clone,s=r;if(t.shallow){if(!0!==t.shallow)return a.cloneWithShallow(e,t);n=e=>e}else if(s){const t=s.get(e);if(t)return t}else s=new Map;const l=i.getInternalProto(e);if(l===i.buffer)return!1;if(l===i.date)return new Date(e.getTime());if(l===i.regex)return new RegExp(e);const u=a.base(e,l,t);if(u===e)return e;if(s&&s.set(e,u),l===i.set)for(const r of e)u.add(n(r,t,s));else if(l===i.map)for(const[r,i]of e)u.set(r,n(i,t,s));const c=o.keys(e,t);for(const r of c){if("__proto__"===r)continue;if(l===i.array&&"length"===r){u.length=e.length;continue}const o=Object.getOwnPropertyDescriptor(e,r);o?o.get||o.set?Object.defineProperty(u,r,o):o.enumerable?u[r]=n(e[r],t,s):Object.defineProperty(u,r,{enumerable:!1,writable:!0,configurable:!0,value:n(e[r],t,s)}):Object.defineProperty(u,r,{enumerable:!0,writable:!0,configurable:!0,value:n(e[r],t,s)})}return u},a.cloneWithShallow=function(e,t){const r=t.shallow;(t=Object.assign({},t)).shallow=!1;const i=new Map;for(const t of r){const r=n(e,t);"object"!=typeof r&&"function"!=typeof r||i.set(r,r)}return a.clone(e,t,i)},a.base=function(e,t,r){if(!1===r.prototype)return a.needsProtoHack.has(t)?new t.constructor:t===i.array?[]:{};const n=Object.getPrototypeOf(e);if(n&&n.isImmutable)return e;if(t===i.array){const e=[];return n!==t&&Object.setPrototypeOf(e,n),e}if(a.needsProtoHack.has(t)){const e=new n.constructor;return n!==t&&Object.setPrototypeOf(e,n),e}return Object.create(n)}},9474:(e,t,r)=>{const n=r(4277),i={mismatched:null};e.exports=function(e,t,r){return r=Object.assign({prototype:!0},r),!!i.isDeepEqual(e,t,r,[])},i.isDeepEqual=function(e,t,r,o){if(e===t)return 0!==e||1/e==1/t;const a=typeof e;if(a!==typeof t)return!1;if(null===e||null===t)return!1;if("function"===a){if(!r.deepFunction||e.toString()!==t.toString())return!1}else if("object"!==a)return e!=e&&t!=t;const s=i.getSharedType(e,t,!!r.prototype);switch(s){case n.buffer:return!1;case n.promise:return e===t;case n.regex:return e.toString()===t.toString();case i.mismatched:return!1}for(let r=o.length-1;r>=0;--r)if(o[r].isSame(e,t))return!0;o.push(new i.SeenEntry(e,t));try{return!!i.isDeepEqualObj(s,e,t,r,o)}finally{o.pop()}},i.getSharedType=function(e,t,r){if(r)return Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?i.mismatched:n.getInternalProto(e);const o=n.getInternalProto(e);return o!==n.getInternalProto(t)?i.mismatched:o},i.valueOf=function(e){const t=e.valueOf;if(void 0===t)return e;try{return t.call(e)}catch(e){return e}},i.hasOwnEnumerableProperty=function(e,t){return Object.prototype.propertyIsEnumerable.call(e,t)},i.isSetSimpleEqual=function(e,t){for(const r of Set.prototype.values.call(e))if(!Set.prototype.has.call(t,r))return!1;return!0},i.isDeepEqualObj=function(e,t,r,o,a){const{isDeepEqual:s,valueOf:l,hasOwnEnumerableProperty:u}=i,{keys:c,getOwnPropertySymbols:d}=Object;if(e===n.array){if(!o.part){if(t.length!==r.length)return!1;for(let e=0;e<t.length;++e)if(!s(t[e],r[e],o,a))return!1;return!0}for(const e of t)for(const t of r)if(s(e,t,o,a))return!0}else if(e===n.set){if(t.size!==r.size)return!1;if(!i.isSetSimpleEqual(t,r)){const e=new Set(Set.prototype.values.call(r));for(const r of Set.prototype.values.call(t)){if(e.delete(r))continue;let t=!1;for(const n of e)if(s(r,n,o,a)){e.delete(n),t=!0;break}if(!t)return!1}}}else if(e===n.map){if(t.size!==r.size)return!1;for(const[e,n]of Map.prototype.entries.call(t)){if(void 0===n&&!Map.prototype.has.call(r,e))return!1;if(!s(n,Map.prototype.get.call(r,e),o,a))return!1}}else if(e===n.error&&(t.name!==r.name||t.message!==r.message))return!1;const f=l(t),p=l(r);if((t!==f||r!==p)&&!s(f,p,o,a))return!1;const h=c(t);if(!o.part&&h.length!==c(r).length&&!o.skip)return!1;let m=0;for(const e of h)if(o.skip&&o.skip.includes(e))void 0===r[e]&&++m;else{if(!u(r,e))return!1;if(!s(t[e],r[e],o,a))return!1}if(!o.part&&h.length-m!==c(r).length)return!1;if(!1!==o.symbols){const e=d(t),n=new Set(d(r));for(const i of e){if(!o.skip||!o.skip.includes(i))if(u(t,i)){if(!u(r,i))return!1;if(!s(t[i],r[i],o,a))return!1}else if(u(r,i))return!1;n.delete(i)}for(const e of n)if(u(r,e))return!1}return!0},i.SeenEntry=class{constructor(e,t){this.obj=e,this.ref=t}isSame(e,t){return this.obj===e&&this.ref===t}}},7916:(e,t,r)=>{const n=r(8761);e.exports=class extends Error{constructor(e){super(e.filter((e=>""!==e)).map((e=>"string"==typeof e?e:e instanceof Error?e.message:n(e))).join(" ")||"Unknown error"),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,t.assert)}}},5277:e=>{const t={};e.exports=function(e){if(!e)return"";let r="";for(let n=0;n<e.length;++n){const i=e.charCodeAt(n);t.isSafe(i)?r+=e[n]:r+=t.escapeHtmlChar(i)}return r},t.escapeHtmlChar=function(e){return t.namedHtml.get(e)||(e>=256?"&#"+e+";":`&#x${e.toString(16).padStart(2,"0")};`)},t.isSafe=function(e){return t.safeCharCodes.has(e)},t.namedHtml=new Map([[38,"&"],[60,"<"],[62,">"],[34,"""],[160," "],[162,"¢"],[163,"£"],[164,"¤"],[169,"©"],[174,"®"]]),t.safeCharCodes=function(){const e=new Set;for(let t=32;t<123;++t)(t>=97||t>=65&&t<=90||t>=48&&t<=57||32===t||46===t||44===t||45===t||58===t||95===t)&&e.add(t);return e}()},6064:e=>{e.exports=function(e){return e.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}},738:e=>{e.exports=function(){}},1687:(e,t,r)=>{const n=r(375),i=r(8571),o=r(7043),a={};e.exports=a.merge=function(e,t,r){if(n(e&&"object"==typeof e,"Invalid target value: must be an object"),n(null==t||"object"==typeof t,"Invalid source value: must be null, undefined, or an object"),!t)return e;if(r=Object.assign({nullOverride:!0,mergeArrays:!0},r),Array.isArray(t)){n(Array.isArray(e),"Cannot merge array onto an object"),r.mergeArrays||(e.length=0);for(let n=0;n<t.length;++n)e.push(i(t[n],{symbols:r.symbols}));return e}const s=o.keys(t,r);for(let n=0;n<s.length;++n){const o=s[n];if("__proto__"===o||!Object.prototype.propertyIsEnumerable.call(t,o))continue;const l=t[o];if(l&&"object"==typeof l){if(e[o]===l)continue;!e[o]||"object"!=typeof e[o]||Array.isArray(e[o])!==Array.isArray(l)||l instanceof Date||l instanceof RegExp?e[o]=i(l,{symbols:r.symbols}):a.merge(e[o],l,r)}else(null!=l||r.nullOverride)&&(e[o]=l)}return e}},9621:(e,t,r)=>{const n=r(375),i={};e.exports=function(e,t,r){if(!1===t||null==t)return e;"string"==typeof(r=r||{})&&(r={separator:r});const o=Array.isArray(t);n(!o||!r.separator,"Separator option is not valid for array-based chain");const a=o?t:t.split(r.separator||".");let s=e;for(let e=0;e<a.length;++e){let o=a[e];const l=r.iterables&&i.iterables(s);if(Array.isArray(s)||"set"===l){const e=Number(o);Number.isInteger(e)&&(o=e<0?s.length+e:e)}if(!s||"function"==typeof s&&!1===r.functions||!l&&void 0===s[o]){n(!r.strict||e+1===a.length,"Missing segment",o,"in reach path ",t),n("object"==typeof s||!0===r.functions||"function"!=typeof s,"Invalid segment",o,"in reach path ",t),s=r.default;break}s=l?"set"===l?[...s][o]:s.get(o):s[o]}return s},i.iterables=function(e){return e instanceof Set?"set":e instanceof Map?"map":void 0}},8761:e=>{e.exports=function(){try{return JSON.stringify(...arguments)}catch(e){return"[Cannot display object: "+e.message+"]"}}},4277:(e,t)=>{const r={};t=e.exports={array:Array.prototype,buffer:!1,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype},r.typeMap=new Map([["[object Error]",t.error],["[object Map]",t.map],["[object Promise]",t.promise],["[object Set]",t.set],["[object WeakMap]",t.weakMap],["[object WeakSet]",t.weakSet]]),t.getInternalProto=function(e){if(Array.isArray(e))return t.array;if(e instanceof Date)return t.date;if(e instanceof RegExp)return t.regex;if(e instanceof Error)return t.error;const n=Object.prototype.toString.call(e);return r.typeMap.get(n)||t.generic}},7043:(e,t)=>{t.keys=function(e){return!1!==(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).symbols?Reflect.ownKeys(e):Object.getOwnPropertyNames(e)}},3652:(e,t,r)=>{const n=r(375),i={};t.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(e,t){const r=[].concat((t=t||{}).before||[]),i=[].concat(t.after||[]),o=t.group||"?",a=t.sort||0;n(!r.includes(o),`Item cannot come before itself: ${o}`),n(!r.includes("?"),"Item cannot come before unassociated items"),n(!i.includes(o),`Item cannot come after itself: ${o}`),n(!i.includes("?"),"Item cannot come after unassociated items"),Array.isArray(e)||(e=[e]);for(const t of e){const e={seq:this._items.length,sort:a,before:r,after:i,group:o,node:t};this._items.push(e)}if(!t.manual){const e=this._sort();n(e,"item","?"!==o?`added into group ${o}`:"","created a dependencies error")}return this.nodes}merge(e){Array.isArray(e)||(e=[e]);for(const t of e)if(t)for(const e of t._items)this._items.push(Object.assign({},e));this._items.sort(i.mergeSort);for(let e=0;e<this._items.length;++e)this._items[e].seq=e;const t=this._sort();return n(t,"merge created a dependencies error"),this.nodes}sort(){const e=this._sort();return n(e,"sort created a dependencies error"),this.nodes}_sort(){const e={},t=Object.create(null),r=Object.create(null);for(const n of this._items){const i=n.seq,o=n.group;r[o]=r[o]||[],r[o].push(i),e[i]=n.before;for(const e of n.after)t[e]=t[e]||[],t[e].push(i)}for(const t in e){const n=[];for(const i in e[t]){const o=e[t][i];r[o]=r[o]||[],n.push(...r[o])}e[t]=n}for(const n in t)if(r[n])for(const i of r[n])e[i].push(...t[n]);const n={};for(const t in e){const r=e[t];for(const e of r)n[e]=n[e]||[],n[e].push(t)}const i={},o=[];for(let e=0;e<this._items.length;++e){let t=e;if(n[e]){t=null;for(let e=0;e<this._items.length;++e){if(!0===i[e])continue;n[e]||(n[e]=[]);const r=n[e].length;let o=0;for(let t=0;t<r;++t)i[n[e][t]]&&++o;if(o===r){t=e;break}}}null!==t&&(i[t]=!0,o.push(t))}if(o.length!==this._items.length)return!1;const a={};for(const e of this._items)a[e.seq]=e;this._items=[],this.nodes=[];for(const e of o){const t=a[e];this.nodes.push(t.node),this._items.push(t)}return!0}},i.mergeSort=(e,t)=>e.sort===t.sort?0:e.sort<t.sort?-1:1},5380:(e,t,r)=>{const n=r(443),i=r(2178),o={minDomainSegments:2,nonAsciiRx:/[^\x00-\x7f]/,domainControlRx:/[\x00-\x20@\:\/\\#!\$&\'\(\)\*\+,;=\?]/,tldSegmentRx:/^[a-zA-Z](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,domainSegmentRx:/^[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,URL:n.URL||URL};t.analyze=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return i.code("DOMAIN_NON_EMPTY_STRING");if("string"!=typeof e)throw new Error("Invalid input: domain must be a string");if(e.length>256)return i.code("DOMAIN_TOO_LONG");if(o.nonAsciiRx.test(e)){if(!1===t.allowUnicode)return i.code("DOMAIN_INVALID_UNICODE_CHARS");e=e.normalize("NFC")}if(o.domainControlRx.test(e))return i.code("DOMAIN_INVALID_CHARS");e=o.punycode(e),t.allowFullyQualified&&"."===e[e.length-1]&&(e=e.slice(0,-1));const r=t.minDomainSegments||o.minDomainSegments,n=e.split(".");if(n.length<r)return i.code("DOMAIN_SEGMENTS_COUNT");if(t.maxDomainSegments&&n.length>t.maxDomainSegments)return i.code("DOMAIN_SEGMENTS_COUNT_MAX");const a=t.tlds;if(a){const e=n[n.length-1].toLowerCase();if(a.deny&&a.deny.has(e)||a.allow&&!a.allow.has(e))return i.code("DOMAIN_FORBIDDEN_TLDS")}for(let e=0;e<n.length;++e){const t=n[e];if(!t.length)return i.code("DOMAIN_EMPTY_SEGMENT");if(t.length>63)return i.code("DOMAIN_LONG_SEGMENT");if(e<n.length-1){if(!o.domainSegmentRx.test(t))return i.code("DOMAIN_INVALID_CHARS")}else if(!o.tldSegmentRx.test(t))return i.code("DOMAIN_INVALID_TLDS_CHARS")}return null},t.isValid=function(e,r){return!t.analyze(e,r)},o.punycode=function(e){e.includes("%")&&(e=e.replace(/%/g,"%25"));try{return new o.URL(`http://${e}`).host}catch(t){return e}}},1745:(e,t,r)=>{const n=r(9848),i=r(5380),o=r(2178),a={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(n.TextEncoder||TextEncoder)};t.analyze=function(e,t){return a.email(e,t)},t.isValid=function(e,t){return!a.email(e,t)},a.email=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"!=typeof e)throw new Error("Invalid input: email must be a string");if(!e)return o.code("EMPTY_STRING");const r=!a.nonAsciiRx.test(e);if(!r){if(!1===t.allowUnicode)return o.code("FORBIDDEN_UNICODE");e=e.normalize("NFC")}const n=e.split("@");if(2!==n.length)return n.length>2?o.code("MULTIPLE_AT_CHAR"):o.code("MISSING_AT_CHAR");const[s,l]=n;if(!s)return o.code("EMPTY_LOCAL");if(!t.ignoreLength){if(e.length>254)return o.code("ADDRESS_TOO_LONG");if(a.encoder.encode(s).length>64)return o.code("LOCAL_TOO_LONG")}return a.local(s,r)||i.analyze(l,t)},a.local=function(e,t){const r=e.split(".");for(const e of r){if(!e.length)return o.code("EMPTY_LOCAL_SEGMENT");if(t){if(!a.atextRx.test(e))return o.code("INVALID_LOCAL_CHARS")}else for(const t of e){if(a.atextRx.test(t))continue;const e=a.binary(t);if(!a.atomRx.test(e))return o.code("INVALID_LOCAL_CHARS")}}},a.binary=function(e){return Array.from(a.encoder.encode(e)).map((e=>String.fromCharCode(e))).join("")},a.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/,a.atomRx=new RegExp(["(?:[\\xc2-\\xdf][\\x80-\\xbf])","(?:\\xe0[\\xa0-\\xbf][\\x80-\\xbf])|(?:[\\xe1-\\xec][\\x80-\\xbf]{2})|(?:\\xed[\\x80-\\x9f][\\x80-\\xbf])|(?:[\\xee-\\xef][\\x80-\\xbf]{2})","(?:\\xf0[\\x90-\\xbf][\\x80-\\xbf]{2})|(?:[\\xf1-\\xf3][\\x80-\\xbf]{3})|(?:\\xf4[\\x80-\\x8f][\\x80-\\xbf]{2})"].join("|"))},2178:(e,t)=>{t.codes={EMPTY_STRING:"Address must be a non-empty string",FORBIDDEN_UNICODE:"Address contains forbidden Unicode characters",MULTIPLE_AT_CHAR:"Address cannot contain more than one @ character",MISSING_AT_CHAR:"Address must contain one @ character",EMPTY_LOCAL:"Address local part cannot be empty",ADDRESS_TOO_LONG:"Address too long",LOCAL_TOO_LONG:"Address local part too long",EMPTY_LOCAL_SEGMENT:"Address local part contains empty dot-separated segment",INVALID_LOCAL_CHARS:"Address local part contains invalid character",DOMAIN_NON_EMPTY_STRING:"Domain must be a non-empty string",DOMAIN_TOO_LONG:"Domain too long",DOMAIN_INVALID_UNICODE_CHARS:"Domain contains forbidden Unicode characters",DOMAIN_INVALID_CHARS:"Domain contains invalid character",DOMAIN_INVALID_TLDS_CHARS:"Domain contains invalid tld character",DOMAIN_SEGMENTS_COUNT:"Domain lacks the minimum required number of segments",DOMAIN_SEGMENTS_COUNT_MAX:"Domain contains too many segments",DOMAIN_FORBIDDEN_TLDS:"Domain uses forbidden TLD",DOMAIN_EMPTY_SEGMENT:"Domain contains empty dot-separated segment",DOMAIN_LONG_SEGMENT:"Domain contains dot-separated segment that is too long"},t.code=function(e){return{code:e,error:t.codes[e]}}},9959:(e,t,r)=>{const n=r(375),i=r(5752);t.regex=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n(void 0===e.cidr||"string"==typeof e.cidr,"options.cidr must be a string");const t=e.cidr?e.cidr.toLowerCase():"optional";n(["required","optional","forbidden"].includes(t),"options.cidr must be one of required, optional, forbidden"),n(void 0===e.version||"string"==typeof e.version||Array.isArray(e.version),"options.version must be a string or an array of string");let r=e.version||["ipv4","ipv6","ipvfuture"];Array.isArray(r)||(r=[r]),n(r.length>=1,"options.version must have at least 1 version specified");for(let e=0;e<r.length;++e)n("string"==typeof r[e],"options.version must only contain strings"),r[e]=r[e].toLowerCase(),n(["ipv4","ipv6","ipvfuture"].includes(r[e]),"options.version contains unknown version "+r[e]+" - must be one of ipv4, ipv6, ipvfuture");r=Array.from(new Set(r));const o=r.map((e=>{if("forbidden"===t)return i.ip[e];const r=`\\/${"ipv4"===e?i.ip.v4Cidr:i.ip.v6Cidr}`;return"required"===t?`${i.ip[e]}${r}`:`${i.ip[e]}(?:${r})?`})),a=`(?:${o.join("|")})`,s=new RegExp(`^${a}$`);return{cidr:t,versions:r,regex:s,raw:a}}},5752:(e,t,r)=>{const n=r(375),i=r(6064),o={generate:function(){const e={},t="!\\$&'\\(\\)\\*\\+,;=",r="\\w-\\.~%\\dA-Fa-f"+t+":@",n="["+r+"]",i="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";e.ipv4address="(?:"+i+"\\.){3}"+i;const o="[\\dA-Fa-f]{1,4}",a="(?:"+o+":"+o+"|"+e.ipv4address+")",s="(?:"+o+":){6}"+a,l="::(?:"+o+":){5}"+a,u="(?:"+o+")?::(?:"+o+":){4}"+a,c="(?:(?:"+o+":){0,1}"+o+")?::(?:"+o+":){3}"+a,d="(?:(?:"+o+":){0,2}"+o+")?::(?:"+o+":){2}"+a,f="(?:(?:"+o+":){0,3}"+o+")?::"+o+":"+a,p="(?:(?:"+o+":){0,4}"+o+")?::"+a;e.ipv4Cidr="(?:\\d|[1-2]\\d|3[0-2])",e.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])",e.ipv6address="(?:"+s+"|"+l+"|"+u+"|"+c+"|"+d+"|"+f+"|"+p+"|(?:(?:[\\dA-Fa-f]{1,4}:){0,5}[\\dA-Fa-f]{1,4})?::[\\dA-Fa-f]{1,4}|(?:(?:[\\dA-Fa-f]{1,4}:){0,6}[\\dA-Fa-f]{1,4})?::)",e.ipvFuture="v[\\dA-Fa-f]+\\.[\\w-\\.~"+t+":]+",e.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",e.schemeRegex=new RegExp(e.scheme);const h="[\\w-\\.~%\\dA-Fa-f"+t+":]*",m="(?:\\[(?:"+e.ipv6address+"|"+e.ipvFuture+")\\]|"+e.ipv4address+"|[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=]{1,255})",g="(?:"+h+"@)?"+m+"(?::\\d*)?",y="(?:"+h+"@)?("+m+")(?::\\d*)?",v=n+"+",b="(?:\\/[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]*)*",_="\\/(?:"+v+b+")?",w=v+b,x="[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=@]+"+b;return e.hierPart="(?:(?:\\/\\/"+g+b+")|"+_+"|"+w+"|(?:\\/\\/\\/[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]*(?:\\/[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]*)*))",e.hierPartCapture="(?:(?:\\/\\/"+y+b+")|"+_+"|"+w+")",e.relativeRef="(?:(?:\\/\\/"+g+b+")|"+_+"|"+x+"|)",e.relativeRefCapture="(?:(?:\\/\\/"+y+b+")|"+_+"|"+x+"|)",e.query="["+r+"\\/\\?]*(?=#|$)",e.queryWithSquareBrackets="["+r+"\\[\\]\\/\\?]*(?=#|$)",e.fragment="["+r+"\\/\\?]*",e}};o.rfc3986=o.generate(),t.ip={v4Cidr:o.rfc3986.ipv4Cidr,v6Cidr:o.rfc3986.ipv6Cidr,ipv4:o.rfc3986.ipv4address,ipv6:o.rfc3986.ipv6address,ipvfuture:o.rfc3986.ipvFuture},o.createRegex=function(e){const t=o.rfc3986,r="(?:\\?"+(e.allowQuerySquareBrackets?t.queryWithSquareBrackets:t.query)+")?(?:#"+t.fragment+")?",a=e.domain?t.relativeRefCapture:t.relativeRef;if(e.relativeOnly)return o.wrap(a+r);let s="";if(e.scheme){n(e.scheme instanceof RegExp||"string"==typeof e.scheme||Array.isArray(e.scheme),"scheme must be a RegExp, String, or Array");const r=[].concat(e.scheme);n(r.length>=1,"scheme must have at least 1 scheme specified");const o=[];for(let e=0;e<r.length;++e){const a=r[e];n(a instanceof RegExp||"string"==typeof a,"scheme at position "+e+" must be a RegExp or String"),a instanceof RegExp?o.push(a.source.toString()):(n(t.schemeRegex.test(a),"scheme at position "+e+" must be a valid scheme"),o.push(i(a)))}s=o.join("|")}const l="(?:"+(s?"(?:"+s+")":t.scheme)+":"+(e.domain?t.hierPartCapture:t.hierPart)+")",u=e.allowRelative?"(?:"+l+"|"+a+")":l;return o.wrap(u+r,s)},o.wrap=function(e,t){return{raw:e=`(?=.)(?!https?:/(?:$|[^/]))(?!https?:///)(?!https?:[^/])${e}`,regex:new RegExp(`^${e}$`),scheme:t}},o.uriRegex=o.createRegex({}),t.regex=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.scheme||e.allowRelative||e.relativeOnly||e.allowQuerySquareBrackets||e.domain?o.createRegex(e):o.uriRegex}},1447:(e,t)=>{const r={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*\.?[0-9]*){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};t.Parser=class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t[r.settings]&&t.constants)for(const e in t.constants){const r=t.constants[e];if(null!==r&&!["boolean","number","string"].includes(typeof r))throw new Error(`Formula constant ${e} contains invalid ${typeof r} value type`)}this.settings=t[r.settings]?t:Object.assign({[r.settings]:!0,constants:{},functions:{}},t),this.single=null,this._parts=null,this._parse(e)}_parse(e){let n=[],i="",o=0,a=!1;const s=e=>{if(o)throw new Error("Formula missing closing parenthesis");const s=n.length?n[n.length-1]:null;if(a||i||e){if(s&&"reference"===s.type&&")"===e)return s.type="function",s.value=this._subFormula(i,s.value),void(i="");if(")"===e){const e=new t.Parser(i,this.settings);n.push({type:"segment",value:e})}else if(a){if("]"===a)return n.push({type:"reference",value:i}),void(i="");n.push({type:"literal",value:i})}else if(r.operatorCharacters.includes(i))s&&"operator"===s.type&&r.operators.includes(s.value+i)?s.value+=i:n.push({type:"operator",value:i});else if(i.match(r.numberRx))n.push({type:"constant",value:parseFloat(i)});else if(void 0!==this.settings.constants[i])n.push({type:"constant",value:this.settings.constants[i]});else{if(!i.match(r.tokenRx))throw new Error(`Formula contains invalid token: ${i}`);n.push({type:"reference",value:i})}i=""}};for(const t of e)a?t===a?(s(),a=!1):i+=t:o?"("===t?(i+=t,++o):")"===t?(--o,o?i+=t:s(t)):i+=t:t in r.literals?a=r.literals[t]:"("===t?(s(),++o):r.operatorCharacters.includes(t)?(s(),i=t,s()):" "!==t?i+=t:s();s(),n=n.map(((e,t)=>"operator"!==e.type||"-"!==e.value||t&&"operator"!==n[t-1].type?e:{type:"operator",value:"n"}));let l=!1;for(const e of n){if("operator"===e.type){if(r.operatorsPrefix.includes(e.value))continue;if(!l)throw new Error("Formula contains an operator in invalid position");if(!r.operators.includes(e.value))throw new Error(`Formula contains an unknown operator ${e.value}`)}else if(l)throw new Error("Formula missing expected operator");l=!l}if(!l)throw new Error("Formula contains invalid trailing operator");1===n.length&&["reference","literal","constant"].includes(n[0].type)&&(this.single={type:"reference"===n[0].type?"reference":"value",value:n[0].value}),this._parts=n.map((e=>{if("operator"===e.type)return r.operatorsPrefix.includes(e.value)?e:e.value;if("reference"!==e.type)return e.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(e.value))throw new Error(`Formula contains invalid reference ${e.value}`);return this.settings.reference?this.settings.reference(e.value):r.reference(e.value)}))}_subFormula(e,n){const i=this.settings.functions[n];if("function"!=typeof i)throw new Error(`Formula contains unknown function ${n}`);let o=[];if(e){let t="",i=0,a=!1;const s=()=>{if(!t)throw new Error(`Formula contains function ${n} with invalid arguments ${e}`);o.push(t),t=""};for(let n=0;n<e.length;++n){const o=e[n];a?(t+=o,o===a&&(a=!1)):o in r.literals&&!i?(t+=o,a=r.literals[o]):","!==o||i?(t+=o,"("===o?++i:")"===o&&--i):s()}s()}return o=o.map((e=>new t.Parser(e,this.settings))),function(e){const t=[];for(const r of o)t.push(r.evaluate(e));return i.call(e,...t)}}evaluate(e){const t=this._parts.slice();for(let n=t.length-2;n>=0;--n){const i=t[n];if(i&&"operator"===i.type){const o=t[n+1];t.splice(n+1,1);const a=r.evaluate(o,e);t[n]=r.single(i.value,a)}}return r.operatorsOrder.forEach((n=>{for(let i=1;i<t.length-1;)if(n.includes(t[i])){const n=t[i],o=r.evaluate(t[i-1],e),a=r.evaluate(t[i+1],e);t.splice(i,2);const s=r.calculate(n,o,a);t[i-1]=0===s?0:s}else i+=2})),r.evaluate(t[0],e)}},t.Parser.prototype[r.symbol]=!0,r.reference=function(e){return function(t){return t&&void 0!==t[e]?t[e]:null}},r.evaluate=function(e,t){return null===e?null:"function"==typeof e?e(t):e[r.symbol]?e.evaluate(t):e},r.single=function(e,t){if("!"===e)return!t;const r=-t;return 0===r?0:r},r.calculate=function(e,t,n){if("??"===e)return r.exists(t)?t:n;if("string"==typeof t||"string"==typeof n){if("+"===e)return(t=r.exists(t)?t:"")+(r.exists(n)?n:"")}else switch(e){case"^":return Math.pow(t,n);case"*":return t*n;case"/":return t/n;case"%":return t%n;case"+":return t+n;case"-":return t-n}switch(e){case"<":return t<n;case"<=":return t<=n;case">":return t>n;case">=":return t>=n;case"==":return t===n;case"!=":return t!==n;case"&&":return t&&n;case"||":return t||n}return null},r.exists=function(e){return null!=e}},9926:()=>{},5688:()=>{},9708:()=>{},1152:()=>{},443:()=>{},9848:()=>{},5934:e=>{e.exports={version:"17.7.0"}}},t={},function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,r),o.exports}(5107);var e,t},e.exports=t()},515:(e,t,r)=>{var n=r(761)(r(772),"DataView");e.exports=n},326:(e,t,r)=>{var n=r(761)(r(772),"Map");e.exports=n},760:(e,t,r)=>{var n=r(761)(r(772),"Promise");e.exports=n},143:(e,t,r)=>{var n=r(761)(r(772),"Set");e.exports=n},857:(e,t,r)=>{var n=r(772).Symbol;e.exports=n},215:(e,t,r)=>{var n=r(761)(r(772),"WeakMap");e.exports=n},366:(e,t,r)=>{var n=r(857),i=r(107),o=r(157),a=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?i(e):o(e)}},183:(e,t,r)=>{var n=r(366),i=r(125);e.exports=function(e){return i(e)&&"[object Arguments]"==n(e)}},840:(e,t,r)=>{var n=r(49),i=r(394),o=r(259),a=r(35),s=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,c=l.toString,d=u.hasOwnProperty,f=RegExp("^"+c.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(n(e)?f:s).test(a(e))}},522:(e,t,r)=>{var n=r(366),i=r(158),o=r(125),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return o(e)&&i(e.length)&&!!a[n(e)]}},411:(e,t,r)=>{var n=r(1),i=r(248),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return i(e);var t=[];for(var r in Object(e))o.call(e,r)&&"constructor"!=r&&t.push(r);return t}},826:e=>{e.exports=function(e){return function(t){return e(t)}}},19:(e,t,r)=>{var n=r(772)["__core-js_shared__"];e.exports=n},242:(e,t,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},761:(e,t,r)=>{var n=r(840),i=r(109);e.exports=function(e,t){var r=i(e,t);return n(r)?r:void 0}},107:(e,t,r)=>{var n=r(857),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=n?n.toStringTag:void 0;e.exports=function(e){var t=o.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var i=a.call(e);return n&&(t?e[s]=r:delete e[s]),i}},940:(e,t,r)=>{var n=r(515),i=r(326),o=r(760),a=r(143),s=r(215),l=r(366),u=r(35),c="[object Map]",d="[object Promise]",f="[object Set]",p="[object WeakMap]",h="[object DataView]",m=u(n),g=u(i),y=u(o),v=u(a),b=u(s),_=l;(n&&_(new n(new ArrayBuffer(1)))!=h||i&&_(new i)!=c||o&&_(o.resolve())!=d||a&&_(new a)!=f||s&&_(new s)!=p)&&(_=function(e){var t=l(e),r="[object Object]"==t?e.constructor:void 0,n=r?u(r):"";if(n)switch(n){case m:return h;case g:return c;case y:return d;case v:return f;case b:return p}return t}),e.exports=_},109:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},394:(e,t,r)=>{var n,i=r(19),o=(n=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!o&&o in e}},1:e=>{var t=Object.prototype;e.exports=function(e){var r=e&&e.constructor;return e===("function"==typeof r&&r.prototype||t)}},248:(e,t,r)=>{var n=r(241)(Object.keys,Object);e.exports=n},146:(e,t,r)=>{e=r.nmd(e);var n=r(242),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i&&n.process,s=function(){try{return o&&o.require&&o.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s},157:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},241:e=>{e.exports=function(e,t){return function(r){return e(t(r))}}},772:(e,t,r)=>{var n=r(242),i="object"==typeof self&&self&&self.Object===Object&&self,o=n||i||Function("return this")();e.exports=o},35:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},631:(e,t,r)=>{var n=r(183),i=r(125),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,l=n(function(){return arguments}())?n:function(e){return i(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},152:e=>{var t=Array.isArray;e.exports=t},878:(e,t,r)=>{var n=r(49),i=r(158);e.exports=function(e){return null!=e&&i(e.length)&&!n(e)}},226:(e,t,r)=>{e=r.nmd(e);var n=r(772),i=r(330),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,s=a&&a.exports===o?n.Buffer:void 0,l=(s?s.isBuffer:void 0)||i;e.exports=l},455:(e,t,r)=>{var n=r(411),i=r(940),o=r(631),a=r(152),s=r(878),l=r(226),u=r(1),c=r(598),d=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(s(e)&&(a(e)||"string"==typeof e||"function"==typeof e.splice||l(e)||c(e)||o(e)))return!e.length;var t=i(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(u(e))return!n(e).length;for(var r in e)if(d.call(e,r))return!1;return!0}},49:(e,t,r)=>{var n=r(366),i=r(259);e.exports=function(e){if(!i(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},158:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},259:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},125:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},598:(e,t,r)=>{var n=r(522),i=r(826),o=r(146),a=o&&o.isTypedArray,s=a?i(a):n;e.exports=s},635:function(e,t,r){var n;e=r.nmd(e),function(){var i,o="Expected a function",a="__lodash_hash_undefined__",s="__lodash_placeholder__",l=32,u=128,c=1/0,d=9007199254740991,f=NaN,p=4294967295,h=[["ary",u],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",l],["partialRight",64],["rearg",256]],m="[object Arguments]",g="[object Array]",y="[object Boolean]",v="[object Date]",b="[object Error]",_="[object Function]",w="[object GeneratorFunction]",x="[object Map]",A="[object Number]",j="[object Object]",S="[object Promise]",k="[object RegExp]",C="[object Set]",$="[object String]",O="[object Symbol]",F="[object WeakMap]",T="[object ArrayBuffer]",D="[object DataView]",E="[object Float32Array]",P="[object Float64Array]",R="[object Int8Array]",I="[object Int16Array]",M="[object Int32Array]",q="[object Uint8Array]",L="[object Uint8ClampedArray]",N="[object Uint16Array]",z="[object Uint32Array]",B=/\b__p \+= '';/g,U=/\b(__p \+=) '' \+/g,V=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,G=/[&<>"']/g,Y=RegExp(W.source),H=RegExp(G.source),K=/<%-([\s\S]+?)%>/g,X=/<%([\s\S]+?)%>/g,Z=/<%=([\s\S]+?)%>/g,Q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,J=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,re=RegExp(te.source),ne=/^\s+/,ie=/\s/,oe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ae=/\{\n\/\* \[wrapped with (.+)\] \*/,se=/,? & /,le=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ue=/[()=,{}\[\]\/\s]/,ce=/\\(\\)?/g,de=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,fe=/\w*$/,pe=/^[-+]0x[0-9a-f]+$/i,he=/^0b[01]+$/i,me=/^\[object .+?Constructor\]$/,ge=/^0o[0-7]+$/i,ye=/^(?:0|[1-9]\d*)$/,ve=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,be=/($^)/,_e=/['\n\r\u2028\u2029\\]/g,we="\\ud800-\\udfff",xe="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ae="\\u2700-\\u27bf",je="a-z\\xdf-\\xf6\\xf8-\\xff",Se="A-Z\\xc0-\\xd6\\xd8-\\xde",ke="\\ufe0e\\ufe0f",Ce="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",$e="["+we+"]",Oe="["+Ce+"]",Fe="["+xe+"]",Te="\\d+",De="["+Ae+"]",Ee="["+je+"]",Pe="[^"+we+Ce+Te+Ae+je+Se+"]",Re="\\ud83c[\\udffb-\\udfff]",Ie="[^"+we+"]",Me="(?:\\ud83c[\\udde6-\\uddff]){2}",qe="[\\ud800-\\udbff][\\udc00-\\udfff]",Le="["+Se+"]",Ne="\\u200d",ze="(?:"+Ee+"|"+Pe+")",Be="(?:"+Le+"|"+Pe+")",Ue="(?:['’](?:d|ll|m|re|s|t|ve))?",Ve="(?:['’](?:D|LL|M|RE|S|T|VE))?",We="(?:"+Fe+"|"+Re+")?",Ge="["+ke+"]?",Ye=Ge+We+"(?:"+Ne+"(?:"+[Ie,Me,qe].join("|")+")"+Ge+We+")*",He="(?:"+[De,Me,qe].join("|")+")"+Ye,Ke="(?:"+[Ie+Fe+"?",Fe,Me,qe,$e].join("|")+")",Xe=RegExp("['’]","g"),Ze=RegExp(Fe,"g"),Qe=RegExp(Re+"(?="+Re+")|"+Ke+Ye,"g"),Je=RegExp([Le+"?"+Ee+"+"+Ue+"(?="+[Oe,Le,"$"].join("|")+")",Be+"+"+Ve+"(?="+[Oe,Le+ze,"$"].join("|")+")",Le+"?"+ze+"+"+Ue,Le+"+"+Ve,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Te,He].join("|"),"g"),et=RegExp("["+Ne+we+xe+ke+"]"),tt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,rt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],nt=-1,it={};it[E]=it[P]=it[R]=it[I]=it[M]=it[q]=it[L]=it[N]=it[z]=!0,it[m]=it[g]=it[T]=it[y]=it[D]=it[v]=it[b]=it[_]=it[x]=it[A]=it[j]=it[k]=it[C]=it[$]=it[F]=!1;var ot={};ot[m]=ot[g]=ot[T]=ot[D]=ot[y]=ot[v]=ot[E]=ot[P]=ot[R]=ot[I]=ot[M]=ot[x]=ot[A]=ot[j]=ot[k]=ot[C]=ot[$]=ot[O]=ot[q]=ot[L]=ot[N]=ot[z]=!0,ot[b]=ot[_]=ot[F]=!1;var at={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},st=parseFloat,lt=parseInt,ut="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,ct="object"==typeof self&&self&&self.Object===Object&&self,dt=ut||ct||Function("return this")(),ft=t&&!t.nodeType&&t,pt=ft&&e&&!e.nodeType&&e,ht=pt&&pt.exports===ft,mt=ht&&ut.process,gt=function(){try{return pt&&pt.require&&pt.require("util").types||mt&&mt.binding&&mt.binding("util")}catch(e){}}(),yt=gt&>.isArrayBuffer,vt=gt&>.isDate,bt=gt&>.isMap,_t=gt&>.isRegExp,wt=gt&>.isSet,xt=gt&>.isTypedArray;function At(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function jt(e,t,r,n){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(n,a,r(a),e)}return n}function St(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}function kt(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}function Ct(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}function $t(e,t){for(var r=-1,n=null==e?0:e.length,i=0,o=[];++r<n;){var a=e[r];t(a,r,e)&&(o[i++]=a)}return o}function Ot(e,t){return!(null==e||!e.length)&&Lt(e,t,0)>-1}function Ft(e,t,r){for(var n=-1,i=null==e?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}function Tt(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}function Dt(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function Et(e,t,r,n){var i=-1,o=null==e?0:e.length;for(n&&o&&(r=e[++i]);++i<o;)r=t(r,e[i],i,e);return r}function Pt(e,t,r,n){var i=null==e?0:e.length;for(n&&i&&(r=e[--i]);i--;)r=t(r,e[i],i,e);return r}function Rt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var It=Ut("length");function Mt(e,t,r){var n;return r(e,(function(e,r,i){if(t(e,r,i))return n=r,!1})),n}function qt(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function Lt(e,t,r){return t==t?function(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}(e,t,r):qt(e,zt,r)}function Nt(e,t,r,n){for(var i=r-1,o=e.length;++i<o;)if(n(e[i],t))return i;return-1}function zt(e){return e!=e}function Bt(e,t){var r=null==e?0:e.length;return r?Gt(e,t)/r:f}function Ut(e){return function(t){return null==t?i:t[e]}}function Vt(e){return function(t){return null==e?i:e[t]}}function Wt(e,t,r,n,i){return i(e,(function(e,i,o){r=n?(n=!1,e):t(r,e,i,o)})),r}function Gt(e,t){for(var r,n=-1,o=e.length;++n<o;){var a=t(e[n]);a!==i&&(r=r===i?a:r+a)}return r}function Yt(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Ht(e){return e?e.slice(0,dr(e)+1).replace(ne,""):e}function Kt(e){return function(t){return e(t)}}function Xt(e,t){return Tt(t,(function(t){return e[t]}))}function Zt(e,t){return e.has(t)}function Qt(e,t){for(var r=-1,n=e.length;++r<n&&Lt(t,e[r],0)>-1;);return r}function Jt(e,t){for(var r=e.length;r--&&Lt(t,e[r],0)>-1;);return r}var er=Vt({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),tr=Vt({"&":"&","<":"<",">":">",'"':""","'":"'"});function rr(e){return"\\"+at[e]}function nr(e){return et.test(e)}function ir(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function or(e,t){return function(r){return e(t(r))}}function ar(e,t){for(var r=-1,n=e.length,i=0,o=[];++r<n;){var a=e[r];a!==t&&a!==s||(e[r]=s,o[i++]=r)}return o}function sr(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}function lr(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=[e,e]})),r}function ur(e){return nr(e)?function(e){for(var t=Qe.lastIndex=0;Qe.test(e);)++t;return t}(e):It(e)}function cr(e){return nr(e)?function(e){return e.match(Qe)||[]}(e):function(e){return e.split("")}(e)}function dr(e){for(var t=e.length;t--&&ie.test(e.charAt(t)););return t}var fr=Vt({"&":"&","<":"<",">":">",""":'"',"'":"'"}),pr=function e(t){var r,n=(t=null==t?dt:pr.defaults(dt.Object(),t,pr.pick(dt,rt))).Array,ie=t.Date,we=t.Error,xe=t.Function,Ae=t.Math,je=t.Object,Se=t.RegExp,ke=t.String,Ce=t.TypeError,$e=n.prototype,Oe=xe.prototype,Fe=je.prototype,Te=t["__core-js_shared__"],De=Oe.toString,Ee=Fe.hasOwnProperty,Pe=0,Re=(r=/[^.]+$/.exec(Te&&Te.keys&&Te.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",Ie=Fe.toString,Me=De.call(je),qe=dt._,Le=Se("^"+De.call(Ee).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ne=ht?t.Buffer:i,ze=t.Symbol,Be=t.Uint8Array,Ue=Ne?Ne.allocUnsafe:i,Ve=or(je.getPrototypeOf,je),We=je.create,Ge=Fe.propertyIsEnumerable,Ye=$e.splice,He=ze?ze.isConcatSpreadable:i,Ke=ze?ze.iterator:i,Qe=ze?ze.toStringTag:i,et=function(){try{var e=lo(je,"defineProperty");return e({},"",{}),e}catch(e){}}(),at=t.clearTimeout!==dt.clearTimeout&&t.clearTimeout,ut=ie&&ie.now!==dt.Date.now&&ie.now,ct=t.setTimeout!==dt.setTimeout&&t.setTimeout,ft=Ae.ceil,pt=Ae.floor,mt=je.getOwnPropertySymbols,gt=Ne?Ne.isBuffer:i,It=t.isFinite,Vt=$e.join,hr=or(je.keys,je),mr=Ae.max,gr=Ae.min,yr=ie.now,vr=t.parseInt,br=Ae.random,_r=$e.reverse,wr=lo(t,"DataView"),xr=lo(t,"Map"),Ar=lo(t,"Promise"),jr=lo(t,"Set"),Sr=lo(t,"WeakMap"),kr=lo(je,"create"),Cr=Sr&&new Sr,$r={},Or=Mo(wr),Fr=Mo(xr),Tr=Mo(Ar),Dr=Mo(jr),Er=Mo(Sr),Pr=ze?ze.prototype:i,Rr=Pr?Pr.valueOf:i,Ir=Pr?Pr.toString:i;function Mr(e){if(es(e)&&!Ua(e)&&!(e instanceof zr)){if(e instanceof Nr)return e;if(Ee.call(e,"__wrapped__"))return qo(e)}return new Nr(e)}var qr=function(){function e(){}return function(t){if(!Ja(t))return{};if(We)return We(t);e.prototype=t;var r=new e;return e.prototype=i,r}}();function Lr(){}function Nr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function zr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=p,this.__views__=[]}function Br(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Ur(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Vr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Wr(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new Vr;++t<r;)this.add(e[t])}function Gr(e){var t=this.__data__=new Ur(e);this.size=t.size}function Yr(e,t){var r=Ua(e),n=!r&&Ba(e),i=!r&&!n&&Ya(e),o=!r&&!n&&!i&&ls(e),a=r||n||i||o,s=a?Yt(e.length,ke):[],l=s.length;for(var u in e)!t&&!Ee.call(e,u)||a&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||go(u,l))||s.push(u);return s}function Hr(e){var t=e.length;return t?e[Wn(0,t-1)]:i}function Kr(e,t){return Do(ki(e),on(t,0,e.length))}function Xr(e){return Do(ki(e))}function Zr(e,t,r){(r!==i&&!La(e[t],r)||r===i&&!(t in e))&&rn(e,t,r)}function Qr(e,t,r){var n=e[t];Ee.call(e,t)&&La(n,r)&&(r!==i||t in e)||rn(e,t,r)}function Jr(e,t){for(var r=e.length;r--;)if(La(e[r][0],t))return r;return-1}function en(e,t,r,n){return cn(e,(function(e,i,o){t(n,e,r(e),o)})),n}function tn(e,t){return e&&Ci(t,Fs(t),e)}function rn(e,t,r){"__proto__"==t&&et?et(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function nn(e,t){for(var r=-1,o=t.length,a=n(o),s=null==e;++r<o;)a[r]=s?i:Ss(e,t[r]);return a}function on(e,t,r){return e==e&&(r!==i&&(e=e<=r?e:r),t!==i&&(e=e>=t?e:t)),e}function an(e,t,r,n,o,a){var s,l=1&t,u=2&t,c=4&t;if(r&&(s=o?r(e,n,o,a):r(e)),s!==i)return s;if(!Ja(e))return e;var d=Ua(e);if(d){if(s=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&Ee.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e),!l)return ki(e,s)}else{var f=fo(e),p=f==_||f==w;if(Ya(e))return _i(e,l);if(f==j||f==m||p&&!o){if(s=u||p?{}:ho(e),!l)return u?function(e,t){return Ci(e,co(e),t)}(e,function(e,t){return e&&Ci(t,Ts(t),e)}(s,e)):function(e,t){return Ci(e,uo(e),t)}(e,tn(s,e))}else{if(!ot[f])return o?e:{};s=function(e,t,r){var n,i=e.constructor;switch(t){case T:return wi(e);case y:case v:return new i(+e);case D:return function(e,t){var r=t?wi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case E:case P:case R:case I:case M:case q:case L:case N:case z:return xi(e,r);case x:return new i;case A:case $:return new i(e);case k:return function(e){var t=new e.constructor(e.source,fe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case C:return new i;case O:return n=e,Rr?je(Rr.call(n)):{}}}(e,f,l)}}a||(a=new Gr);var h=a.get(e);if(h)return h;a.set(e,s),os(e)?e.forEach((function(n){s.add(an(n,t,r,n,e,a))})):ts(e)&&e.forEach((function(n,i){s.set(i,an(n,t,r,i,e,a))}));var g=d?i:(c?u?to:eo:u?Ts:Fs)(e);return St(g||e,(function(n,i){g&&(n=e[i=n]),Qr(s,i,an(n,t,r,i,e,a))})),s}function sn(e,t,r){var n=r.length;if(null==e)return!n;for(e=je(e);n--;){var o=r[n],a=t[o],s=e[o];if(s===i&&!(o in e)||!a(s))return!1}return!0}function ln(e,t,r){if("function"!=typeof e)throw new Ce(o);return $o((function(){e.apply(i,r)}),t)}function un(e,t,r,n){var i=-1,o=Ot,a=!0,s=e.length,l=[],u=t.length;if(!s)return l;r&&(t=Tt(t,Kt(r))),n?(o=Ft,a=!1):t.length>=200&&(o=Zt,a=!1,t=new Wr(t));e:for(;++i<s;){var c=e[i],d=null==r?c:r(c);if(c=n||0!==c?c:0,a&&d==d){for(var f=u;f--;)if(t[f]===d)continue e;l.push(c)}else o(t,d,n)||l.push(c)}return l}Mr.templateSettings={escape:K,evaluate:X,interpolate:Z,variable:"",imports:{_:Mr}},Mr.prototype=Lr.prototype,Mr.prototype.constructor=Mr,Nr.prototype=qr(Lr.prototype),Nr.prototype.constructor=Nr,zr.prototype=qr(Lr.prototype),zr.prototype.constructor=zr,Br.prototype.clear=function(){this.__data__=kr?kr(null):{},this.size=0},Br.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Br.prototype.get=function(e){var t=this.__data__;if(kr){var r=t[e];return r===a?i:r}return Ee.call(t,e)?t[e]:i},Br.prototype.has=function(e){var t=this.__data__;return kr?t[e]!==i:Ee.call(t,e)},Br.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=kr&&t===i?a:t,this},Ur.prototype.clear=function(){this.__data__=[],this.size=0},Ur.prototype.delete=function(e){var t=this.__data__,r=Jr(t,e);return!(r<0||(r==t.length-1?t.pop():Ye.call(t,r,1),--this.size,0))},Ur.prototype.get=function(e){var t=this.__data__,r=Jr(t,e);return r<0?i:t[r][1]},Ur.prototype.has=function(e){return Jr(this.__data__,e)>-1},Ur.prototype.set=function(e,t){var r=this.__data__,n=Jr(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},Vr.prototype.clear=function(){this.size=0,this.__data__={hash:new Br,map:new(xr||Ur),string:new Br}},Vr.prototype.delete=function(e){var t=ao(this,e).delete(e);return this.size-=t?1:0,t},Vr.prototype.get=function(e){return ao(this,e).get(e)},Vr.prototype.has=function(e){return ao(this,e).has(e)},Vr.prototype.set=function(e,t){var r=ao(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Wr.prototype.add=Wr.prototype.push=function(e){return this.__data__.set(e,a),this},Wr.prototype.has=function(e){return this.__data__.has(e)},Gr.prototype.clear=function(){this.__data__=new Ur,this.size=0},Gr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Gr.prototype.get=function(e){return this.__data__.get(e)},Gr.prototype.has=function(e){return this.__data__.has(e)},Gr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Ur){var n=r.__data__;if(!xr||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Vr(n)}return r.set(e,t),this.size=r.size,this};var cn=Fi(vn),dn=Fi(bn,!0);function fn(e,t){var r=!0;return cn(e,(function(e,n,i){return r=!!t(e,n,i)})),r}function pn(e,t,r){for(var n=-1,o=e.length;++n<o;){var a=e[n],s=t(a);if(null!=s&&(l===i?s==s&&!ss(s):r(s,l)))var l=s,u=a}return u}function hn(e,t){var r=[];return cn(e,(function(e,n,i){t(e,n,i)&&r.push(e)})),r}function mn(e,t,r,n,i){var o=-1,a=e.length;for(r||(r=mo),i||(i=[]);++o<a;){var s=e[o];t>0&&r(s)?t>1?mn(s,t-1,r,n,i):Dt(i,s):n||(i[i.length]=s)}return i}var gn=Ti(),yn=Ti(!0);function vn(e,t){return e&&gn(e,t,Fs)}function bn(e,t){return e&&yn(e,t,Fs)}function _n(e,t){return $t(t,(function(t){return Xa(e[t])}))}function wn(e,t){for(var r=0,n=(t=gi(t,e)).length;null!=e&&r<n;)e=e[Io(t[r++])];return r&&r==n?e:i}function xn(e,t,r){var n=t(e);return Ua(e)?n:Dt(n,r(e))}function An(e){return null==e?e===i?"[object Undefined]":"[object Null]":Qe&&Qe in je(e)?function(e){var t=Ee.call(e,Qe),r=e[Qe];try{e[Qe]=i;var n=!0}catch(e){}var o=Ie.call(e);return n&&(t?e[Qe]=r:delete e[Qe]),o}(e):function(e){return Ie.call(e)}(e)}function jn(e,t){return e>t}function Sn(e,t){return null!=e&&Ee.call(e,t)}function kn(e,t){return null!=e&&t in je(e)}function Cn(e,t,r){for(var o=r?Ft:Ot,a=e[0].length,s=e.length,l=s,u=n(s),c=1/0,d=[];l--;){var f=e[l];l&&t&&(f=Tt(f,Kt(t))),c=gr(f.length,c),u[l]=!r&&(t||a>=120&&f.length>=120)?new Wr(l&&f):i}f=e[0];var p=-1,h=u[0];e:for(;++p<a&&d.length<c;){var m=f[p],g=t?t(m):m;if(m=r||0!==m?m:0,!(h?Zt(h,g):o(d,g,r))){for(l=s;--l;){var y=u[l];if(!(y?Zt(y,g):o(e[l],g,r)))continue e}h&&h.push(g),d.push(m)}}return d}function $n(e,t,r){var n=null==(e=So(e,t=gi(t,e)))?e:e[Io(Ko(t))];return null==n?i:At(n,e,r)}function On(e){return es(e)&&An(e)==m}function Fn(e,t,r,n,o){return e===t||(null==e||null==t||!es(e)&&!es(t)?e!=e&&t!=t:function(e,t,r,n,o,a){var s=Ua(e),l=Ua(t),u=s?g:fo(e),c=l?g:fo(t),d=(u=u==m?j:u)==j,f=(c=c==m?j:c)==j,p=u==c;if(p&&Ya(e)){if(!Ya(t))return!1;s=!0,d=!1}if(p&&!d)return a||(a=new Gr),s||ls(e)?Qi(e,t,r,n,o,a):function(e,t,r,n,i,o,a){switch(r){case D:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case T:return!(e.byteLength!=t.byteLength||!o(new Be(e),new Be(t)));case y:case v:case A:return La(+e,+t);case b:return e.name==t.name&&e.message==t.message;case k:case $:return e==t+"";case x:var s=ir;case C:var l=1&n;if(s||(s=sr),e.size!=t.size&&!l)return!1;var u=a.get(e);if(u)return u==t;n|=2,a.set(e,t);var c=Qi(s(e),s(t),n,i,o,a);return a.delete(e),c;case O:if(Rr)return Rr.call(e)==Rr.call(t)}return!1}(e,t,u,r,n,o,a);if(!(1&r)){var h=d&&Ee.call(e,"__wrapped__"),_=f&&Ee.call(t,"__wrapped__");if(h||_){var w=h?e.value():e,S=_?t.value():t;return a||(a=new Gr),o(w,S,r,n,a)}}return!!p&&(a||(a=new Gr),function(e,t,r,n,o,a){var s=1&r,l=eo(e),u=l.length;if(u!=eo(t).length&&!s)return!1;for(var c=u;c--;){var d=l[c];if(!(s?d in t:Ee.call(t,d)))return!1}var f=a.get(e),p=a.get(t);if(f&&p)return f==t&&p==e;var h=!0;a.set(e,t),a.set(t,e);for(var m=s;++c<u;){var g=e[d=l[c]],y=t[d];if(n)var v=s?n(y,g,d,t,e,a):n(g,y,d,e,t,a);if(!(v===i?g===y||o(g,y,r,n,a):v)){h=!1;break}m||(m="constructor"==d)}if(h&&!m){var b=e.constructor,_=t.constructor;b==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof _&&_ instanceof _||(h=!1)}return a.delete(e),a.delete(t),h}(e,t,r,n,o,a))}(e,t,r,n,Fn,o))}function Tn(e,t,r,n){var o=r.length,a=o,s=!n;if(null==e)return!a;for(e=je(e);o--;){var l=r[o];if(s&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++o<a;){var u=(l=r[o])[0],c=e[u],d=l[1];if(s&&l[2]){if(c===i&&!(u in e))return!1}else{var f=new Gr;if(n)var p=n(c,d,u,e,t,f);if(!(p===i?Fn(d,c,3,n,f):p))return!1}}return!0}function Dn(e){return!(!Ja(e)||(t=e,Re&&Re in t))&&(Xa(e)?Le:me).test(Mo(e));var t}function En(e){return"function"==typeof e?e:null==e?rl:"object"==typeof e?Ua(e)?qn(e[0],e[1]):Mn(e):dl(e)}function Pn(e){if(!wo(e))return hr(e);var t=[];for(var r in je(e))Ee.call(e,r)&&"constructor"!=r&&t.push(r);return t}function Rn(e,t){return e<t}function In(e,t){var r=-1,i=Wa(e)?n(e.length):[];return cn(e,(function(e,n,o){i[++r]=t(e,n,o)})),i}function Mn(e){var t=so(e);return 1==t.length&&t[0][2]?Ao(t[0][0],t[0][1]):function(r){return r===e||Tn(r,e,t)}}function qn(e,t){return vo(e)&&xo(t)?Ao(Io(e),t):function(r){var n=Ss(r,e);return n===i&&n===t?ks(r,e):Fn(t,n,3)}}function Ln(e,t,r,n,o){e!==t&&gn(t,(function(a,s){if(o||(o=new Gr),Ja(a))!function(e,t,r,n,o,a,s){var l=ko(e,r),u=ko(t,r),c=s.get(u);if(c)Zr(e,r,c);else{var d=a?a(l,u,r+"",e,t,s):i,f=d===i;if(f){var p=Ua(u),h=!p&&Ya(u),m=!p&&!h&&ls(u);d=u,p||h||m?Ua(l)?d=l:Ga(l)?d=ki(l):h?(f=!1,d=_i(u,!0)):m?(f=!1,d=xi(u,!0)):d=[]:ns(u)||Ba(u)?(d=l,Ba(l)?d=gs(l):Ja(l)&&!Xa(l)||(d=ho(u))):f=!1}f&&(s.set(u,d),o(d,u,n,a,s),s.delete(u)),Zr(e,r,d)}}(e,t,s,r,Ln,n,o);else{var l=n?n(ko(e,s),a,s+"",e,t,o):i;l===i&&(l=a),Zr(e,s,l)}}),Ts)}function Nn(e,t){var r=e.length;if(r)return go(t+=t<0?r:0,r)?e[t]:i}function zn(e,t,r){t=t.length?Tt(t,(function(e){return Ua(e)?function(t){return wn(t,1===e.length?e[0]:e)}:e})):[rl];var n=-1;t=Tt(t,Kt(oo()));var i=In(e,(function(e,r,i){var o=Tt(t,(function(t){return t(e)}));return{criteria:o,index:++n,value:e}}));return function(e,t){var n=e.length;for(e.sort((function(e,t){return function(e,t,r){for(var n=-1,i=e.criteria,o=t.criteria,a=i.length,s=r.length;++n<a;){var l=Ai(i[n],o[n]);if(l)return n>=s?l:l*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)}));n--;)e[n]=e[n].value;return e}(i)}function Bn(e,t,r){for(var n=-1,i=t.length,o={};++n<i;){var a=t[n],s=wn(e,a);r(s,a)&&Xn(o,gi(a,e),s)}return o}function Un(e,t,r,n){var i=n?Nt:Lt,o=-1,a=t.length,s=e;for(e===t&&(t=ki(t)),r&&(s=Tt(e,Kt(r)));++o<a;)for(var l=0,u=t[o],c=r?r(u):u;(l=i(s,c,l,n))>-1;)s!==e&&Ye.call(s,l,1),Ye.call(e,l,1);return e}function Vn(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==o){var o=i;go(i)?Ye.call(e,i,1):li(e,i)}}return e}function Wn(e,t){return e+pt(br()*(t-e+1))}function Gn(e,t){var r="";if(!e||t<1||t>d)return r;do{t%2&&(r+=e),(t=pt(t/2))&&(e+=e)}while(t);return r}function Yn(e,t){return Oo(jo(e,t,rl),e+"")}function Hn(e){return Hr(Ls(e))}function Kn(e,t){var r=Ls(e);return Do(r,on(t,0,r.length))}function Xn(e,t,r,n){if(!Ja(e))return e;for(var o=-1,a=(t=gi(t,e)).length,s=a-1,l=e;null!=l&&++o<a;){var u=Io(t[o]),c=r;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(o!=s){var d=l[u];(c=n?n(d,u,l):i)===i&&(c=Ja(d)?d:go(t[o+1])?[]:{})}Qr(l,u,c),l=l[u]}return e}var Zn=Cr?function(e,t){return Cr.set(e,t),e}:rl,Qn=et?function(e,t){return et(e,"toString",{configurable:!0,enumerable:!1,value:Js(t),writable:!0})}:rl;function Jn(e){return Do(Ls(e))}function ei(e,t,r){var i=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var a=n(o);++i<o;)a[i]=e[i+t];return a}function ti(e,t){var r;return cn(e,(function(e,n,i){return!(r=t(e,n,i))})),!!r}function ri(e,t,r){var n=0,i=null==e?n:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;n<i;){var o=n+i>>>1,a=e[o];null!==a&&!ss(a)&&(r?a<=t:a<t)?n=o+1:i=o}return i}return ni(e,t,rl,r)}function ni(e,t,r,n){var o=0,a=null==e?0:e.length;if(0===a)return 0;for(var s=(t=r(t))!=t,l=null===t,u=ss(t),c=t===i;o<a;){var d=pt((o+a)/2),f=r(e[d]),p=f!==i,h=null===f,m=f==f,g=ss(f);if(s)var y=n||m;else y=c?m&&(n||p):l?m&&p&&(n||!h):u?m&&p&&!h&&(n||!g):!h&&!g&&(n?f<=t:f<t);y?o=d+1:a=d}return gr(a,4294967294)}function ii(e,t){for(var r=-1,n=e.length,i=0,o=[];++r<n;){var a=e[r],s=t?t(a):a;if(!r||!La(s,l)){var l=s;o[i++]=0===a?0:a}}return o}function oi(e){return"number"==typeof e?e:ss(e)?f:+e}function ai(e){if("string"==typeof e)return e;if(Ua(e))return Tt(e,ai)+"";if(ss(e))return Ir?Ir.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function si(e,t,r){var n=-1,i=Ot,o=e.length,a=!0,s=[],l=s;if(r)a=!1,i=Ft;else if(o>=200){var u=t?null:Gi(e);if(u)return sr(u);a=!1,i=Zt,l=new Wr}else l=t?[]:s;e:for(;++n<o;){var c=e[n],d=t?t(c):c;if(c=r||0!==c?c:0,a&&d==d){for(var f=l.length;f--;)if(l[f]===d)continue e;t&&l.push(d),s.push(c)}else i(l,d,r)||(l!==s&&l.push(d),s.push(c))}return s}function li(e,t){return null==(e=So(e,t=gi(t,e)))||delete e[Io(Ko(t))]}function ui(e,t,r,n){return Xn(e,t,r(wn(e,t)),n)}function ci(e,t,r,n){for(var i=e.length,o=n?i:-1;(n?o--:++o<i)&&t(e[o],o,e););return r?ei(e,n?0:o,n?o+1:i):ei(e,n?o+1:0,n?i:o)}function di(e,t){var r=e;return r instanceof zr&&(r=r.value()),Et(t,(function(e,t){return t.func.apply(t.thisArg,Dt([e],t.args))}),r)}function fi(e,t,r){var i=e.length;if(i<2)return i?si(e[0]):[];for(var o=-1,a=n(i);++o<i;)for(var s=e[o],l=-1;++l<i;)l!=o&&(a[o]=un(a[o]||s,e[l],t,r));return si(mn(a,1),t,r)}function pi(e,t,r){for(var n=-1,o=e.length,a=t.length,s={};++n<o;){var l=n<a?t[n]:i;r(s,e[n],l)}return s}function hi(e){return Ga(e)?e:[]}function mi(e){return"function"==typeof e?e:rl}function gi(e,t){return Ua(e)?e:vo(e,t)?[e]:Ro(ys(e))}var yi=Yn;function vi(e,t,r){var n=e.length;return r=r===i?n:r,!t&&r>=n?e:ei(e,t,r)}var bi=at||function(e){return dt.clearTimeout(e)};function _i(e,t){if(t)return e.slice();var r=e.length,n=Ue?Ue(r):new e.constructor(r);return e.copy(n),n}function wi(e){var t=new e.constructor(e.byteLength);return new Be(t).set(new Be(e)),t}function xi(e,t){var r=t?wi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Ai(e,t){if(e!==t){var r=e!==i,n=null===e,o=e==e,a=ss(e),s=t!==i,l=null===t,u=t==t,c=ss(t);if(!l&&!c&&!a&&e>t||a&&s&&u&&!l&&!c||n&&s&&u||!r&&u||!o)return 1;if(!n&&!a&&!c&&e<t||c&&r&&o&&!n&&!a||l&&r&&o||!s&&o||!u)return-1}return 0}function ji(e,t,r,i){for(var o=-1,a=e.length,s=r.length,l=-1,u=t.length,c=mr(a-s,0),d=n(u+c),f=!i;++l<u;)d[l]=t[l];for(;++o<s;)(f||o<a)&&(d[r[o]]=e[o]);for(;c--;)d[l++]=e[o++];return d}function Si(e,t,r,i){for(var o=-1,a=e.length,s=-1,l=r.length,u=-1,c=t.length,d=mr(a-l,0),f=n(d+c),p=!i;++o<d;)f[o]=e[o];for(var h=o;++u<c;)f[h+u]=t[u];for(;++s<l;)(p||o<a)&&(f[h+r[s]]=e[o++]);return f}function ki(e,t){var r=-1,i=e.length;for(t||(t=n(i));++r<i;)t[r]=e[r];return t}function Ci(e,t,r,n){var o=!r;r||(r={});for(var a=-1,s=t.length;++a<s;){var l=t[a],u=n?n(r[l],e[l],l,r,e):i;u===i&&(u=e[l]),o?rn(r,l,u):Qr(r,l,u)}return r}function $i(e,t){return function(r,n){var i=Ua(r)?jt:en,o=t?t():{};return i(r,e,oo(n,2),o)}}function Oi(e){return Yn((function(t,r){var n=-1,o=r.length,a=o>1?r[o-1]:i,s=o>2?r[2]:i;for(a=e.length>3&&"function"==typeof a?(o--,a):i,s&&yo(r[0],r[1],s)&&(a=o<3?i:a,o=1),t=je(t);++n<o;){var l=r[n];l&&e(t,l,n,a)}return t}))}function Fi(e,t){return function(r,n){if(null==r)return r;if(!Wa(r))return e(r,n);for(var i=r.length,o=t?i:-1,a=je(r);(t?o--:++o<i)&&!1!==n(a[o],o,a););return r}}function Ti(e){return function(t,r,n){for(var i=-1,o=je(t),a=n(t),s=a.length;s--;){var l=a[e?s:++i];if(!1===r(o[l],l,o))break}return t}}function Di(e){return function(t){var r=nr(t=ys(t))?cr(t):i,n=r?r[0]:t.charAt(0),o=r?vi(r,1).join(""):t.slice(1);return n[e]()+o}}function Ei(e){return function(t){return Et(Xs(Bs(t).replace(Xe,"")),e,"")}}function Pi(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=qr(e.prototype),n=e.apply(r,t);return Ja(n)?n:r}}function Ri(e){return function(t,r,n){var o=je(t);if(!Wa(t)){var a=oo(r,3);t=Fs(t),r=function(e){return a(o[e],e,o)}}var s=e(t,r,n);return s>-1?o[a?t[s]:s]:i}}function Ii(e){return Ji((function(t){var r=t.length,n=r,a=Nr.prototype.thru;for(e&&t.reverse();n--;){var s=t[n];if("function"!=typeof s)throw new Ce(o);if(a&&!l&&"wrapper"==no(s))var l=new Nr([],!0)}for(n=l?n:r;++n<r;){var u=no(s=t[n]),c="wrapper"==u?ro(s):i;l=c&&bo(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?l[no(c[0])].apply(l,c[3]):1==s.length&&bo(s)?l[u]():l.thru(s)}return function(){var e=arguments,n=e[0];if(l&&1==e.length&&Ua(n))return l.plant(n).value();for(var i=0,o=r?t[i].apply(this,e):n;++i<r;)o=t[i].call(this,o);return o}}))}function Mi(e,t,r,o,a,s,l,c,d,f){var p=t&u,h=1&t,m=2&t,g=24&t,y=512&t,v=m?i:Pi(e);return function u(){for(var b=arguments.length,_=n(b),w=b;w--;)_[w]=arguments[w];if(g)var x=io(u),A=function(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}(_,x);if(o&&(_=ji(_,o,a,g)),s&&(_=Si(_,s,l,g)),b-=A,g&&b<f){var j=ar(_,x);return Vi(e,t,Mi,u.placeholder,r,_,j,c,d,f-b)}var S=h?r:this,k=m?S[e]:e;return b=_.length,c?_=function(e,t){for(var r=e.length,n=gr(t.length,r),o=ki(e);n--;){var a=t[n];e[n]=go(a,r)?o[a]:i}return e}(_,c):y&&b>1&&_.reverse(),p&&d<b&&(_.length=d),this&&this!==dt&&this instanceof u&&(k=v||Pi(k)),k.apply(S,_)}}function qi(e,t){return function(r,n){return function(e,t,r,n){return vn(e,(function(e,i,o){t(n,r(e),i,o)})),n}(r,e,t(n),{})}}function Li(e,t){return function(r,n){var o;if(r===i&&n===i)return t;if(r!==i&&(o=r),n!==i){if(o===i)return n;"string"==typeof r||"string"==typeof n?(r=ai(r),n=ai(n)):(r=oi(r),n=oi(n)),o=e(r,n)}return o}}function Ni(e){return Ji((function(t){return t=Tt(t,Kt(oo())),Yn((function(r){var n=this;return e(t,(function(e){return At(e,n,r)}))}))}))}function zi(e,t){var r=(t=t===i?" ":ai(t)).length;if(r<2)return r?Gn(t,e):t;var n=Gn(t,ft(e/ur(t)));return nr(t)?vi(cr(n),0,e).join(""):n.slice(0,e)}function Bi(e){return function(t,r,o){return o&&"number"!=typeof o&&yo(t,r,o)&&(r=o=i),t=fs(t),r===i?(r=t,t=0):r=fs(r),function(e,t,r,i){for(var o=-1,a=mr(ft((t-e)/(r||1)),0),s=n(a);a--;)s[i?a:++o]=e,e+=r;return s}(t,r,o=o===i?t<r?1:-1:fs(o),e)}}function Ui(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=ms(t),r=ms(r)),e(t,r)}}function Vi(e,t,r,n,o,a,s,u,c,d){var f=8&t;t|=f?l:64,4&(t&=~(f?64:l))||(t&=-4);var p=[e,t,o,f?a:i,f?s:i,f?i:a,f?i:s,u,c,d],h=r.apply(i,p);return bo(e)&&Co(h,p),h.placeholder=n,Fo(h,e,t)}function Wi(e){var t=Ae[e];return function(e,r){if(e=ms(e),(r=null==r?0:gr(ps(r),292))&&It(e)){var n=(ys(e)+"e").split("e");return+((n=(ys(t(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return t(e)}}var Gi=jr&&1/sr(new jr([,-0]))[1]==c?function(e){return new jr(e)}:sl;function Yi(e){return function(t){var r=fo(t);return r==x?ir(t):r==C?lr(t):function(e,t){return Tt(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Hi(e,t,r,a,c,d,f,p){var h=2&t;if(!h&&"function"!=typeof e)throw new Ce(o);var m=a?a.length:0;if(m||(t&=-97,a=c=i),f=f===i?f:mr(ps(f),0),p=p===i?p:ps(p),m-=c?c.length:0,64&t){var g=a,y=c;a=c=i}var v=h?i:ro(e),b=[e,t,r,a,c,g,y,d,f,p];if(v&&function(e,t){var r=e[1],n=t[1],i=r|n,o=i<131,a=n==u&&8==r||n==u&&256==r&&e[7].length<=t[8]||384==n&&t[7].length<=t[8]&&8==r;if(!o&&!a)return e;1&n&&(e[2]=t[2],i|=1&r?0:4);var l=t[3];if(l){var c=e[3];e[3]=c?ji(c,l,t[4]):l,e[4]=c?ar(e[3],s):t[4]}(l=t[5])&&(c=e[5],e[5]=c?Si(c,l,t[6]):l,e[6]=c?ar(e[5],s):t[6]),(l=t[7])&&(e[7]=l),n&u&&(e[8]=null==e[8]?t[8]:gr(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(b,v),e=b[0],t=b[1],r=b[2],a=b[3],c=b[4],!(p=b[9]=b[9]===i?h?0:e.length:mr(b[9]-m,0))&&24&t&&(t&=-25),t&&1!=t)_=8==t||16==t?function(e,t,r){var o=Pi(e);return function a(){for(var s=arguments.length,l=n(s),u=s,c=io(a);u--;)l[u]=arguments[u];var d=s<3&&l[0]!==c&&l[s-1]!==c?[]:ar(l,c);return(s-=d.length)<r?Vi(e,t,Mi,a.placeholder,i,l,d,i,i,r-s):At(this&&this!==dt&&this instanceof a?o:e,this,l)}}(e,t,p):t!=l&&33!=t||c.length?Mi.apply(i,b):function(e,t,r,i){var o=1&t,a=Pi(e);return function t(){for(var s=-1,l=arguments.length,u=-1,c=i.length,d=n(c+l),f=this&&this!==dt&&this instanceof t?a:e;++u<c;)d[u]=i[u];for(;l--;)d[u++]=arguments[++s];return At(f,o?r:this,d)}}(e,t,r,a);else var _=function(e,t,r){var n=1&t,i=Pi(e);return function t(){return(this&&this!==dt&&this instanceof t?i:e).apply(n?r:this,arguments)}}(e,t,r);return Fo((v?Zn:Co)(_,b),e,t)}function Ki(e,t,r,n){return e===i||La(e,Fe[r])&&!Ee.call(n,r)?t:e}function Xi(e,t,r,n,o,a){return Ja(e)&&Ja(t)&&(a.set(t,e),Ln(e,t,i,Xi,a),a.delete(t)),e}function Zi(e){return ns(e)?i:e}function Qi(e,t,r,n,o,a){var s=1&r,l=e.length,u=t.length;if(l!=u&&!(s&&u>l))return!1;var c=a.get(e),d=a.get(t);if(c&&d)return c==t&&d==e;var f=-1,p=!0,h=2&r?new Wr:i;for(a.set(e,t),a.set(t,e);++f<l;){var m=e[f],g=t[f];if(n)var y=s?n(g,m,f,t,e,a):n(m,g,f,e,t,a);if(y!==i){if(y)continue;p=!1;break}if(h){if(!Rt(t,(function(e,t){if(!Zt(h,t)&&(m===e||o(m,e,r,n,a)))return h.push(t)}))){p=!1;break}}else if(m!==g&&!o(m,g,r,n,a)){p=!1;break}}return a.delete(e),a.delete(t),p}function Ji(e){return Oo(jo(e,i,Vo),e+"")}function eo(e){return xn(e,Fs,uo)}function to(e){return xn(e,Ts,co)}var ro=Cr?function(e){return Cr.get(e)}:sl;function no(e){for(var t=e.name+"",r=$r[t],n=Ee.call($r,t)?r.length:0;n--;){var i=r[n],o=i.func;if(null==o||o==e)return i.name}return t}function io(e){return(Ee.call(Mr,"placeholder")?Mr:e).placeholder}function oo(){var e=Mr.iteratee||nl;return e=e===nl?En:e,arguments.length?e(arguments[0],arguments[1]):e}function ao(e,t){var r,n,i=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof t?"string":"hash"]:i.map}function so(e){for(var t=Fs(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,xo(i)]}return t}function lo(e,t){var r=function(e,t){return null==e?i:e[t]}(e,t);return Dn(r)?r:i}var uo=mt?function(e){return null==e?[]:(e=je(e),$t(mt(e),(function(t){return Ge.call(e,t)})))}:hl,co=mt?function(e){for(var t=[];e;)Dt(t,uo(e)),e=Ve(e);return t}:hl,fo=An;function po(e,t,r){for(var n=-1,i=(t=gi(t,e)).length,o=!1;++n<i;){var a=Io(t[n]);if(!(o=null!=e&&r(e,a)))break;e=e[a]}return o||++n!=i?o:!!(i=null==e?0:e.length)&&Qa(i)&&go(a,i)&&(Ua(e)||Ba(e))}function ho(e){return"function"!=typeof e.constructor||wo(e)?{}:qr(Ve(e))}function mo(e){return Ua(e)||Ba(e)||!!(He&&e&&e[He])}function go(e,t){var r=typeof e;return!!(t=null==t?d:t)&&("number"==r||"symbol"!=r&&ye.test(e))&&e>-1&&e%1==0&&e<t}function yo(e,t,r){if(!Ja(r))return!1;var n=typeof t;return!!("number"==n?Wa(r)&&go(t,r.length):"string"==n&&t in r)&&La(r[t],e)}function vo(e,t){if(Ua(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!ss(e))||J.test(e)||!Q.test(e)||null!=t&&e in je(t)}function bo(e){var t=no(e),r=Mr[t];if("function"!=typeof r||!(t in zr.prototype))return!1;if(e===r)return!0;var n=ro(r);return!!n&&e===n[0]}(wr&&fo(new wr(new ArrayBuffer(1)))!=D||xr&&fo(new xr)!=x||Ar&&fo(Ar.resolve())!=S||jr&&fo(new jr)!=C||Sr&&fo(new Sr)!=F)&&(fo=function(e){var t=An(e),r=t==j?e.constructor:i,n=r?Mo(r):"";if(n)switch(n){case Or:return D;case Fr:return x;case Tr:return S;case Dr:return C;case Er:return F}return t});var _o=Te?Xa:ml;function wo(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Fe)}function xo(e){return e==e&&!Ja(e)}function Ao(e,t){return function(r){return null!=r&&r[e]===t&&(t!==i||e in je(r))}}function jo(e,t,r){return t=mr(t===i?e.length-1:t,0),function(){for(var i=arguments,o=-1,a=mr(i.length-t,0),s=n(a);++o<a;)s[o]=i[t+o];o=-1;for(var l=n(t+1);++o<t;)l[o]=i[o];return l[t]=r(s),At(e,this,l)}}function So(e,t){return t.length<2?e:wn(e,ei(t,0,-1))}function ko(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Co=To(Zn),$o=ct||function(e,t){return dt.setTimeout(e,t)},Oo=To(Qn);function Fo(e,t,r){var n=t+"";return Oo(e,function(e,t){var r=t.length;if(!r)return e;var n=r-1;return t[n]=(r>1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(oe,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return St(h,(function(r){var n="_."+r[0];t&r[1]&&!Ot(e,n)&&e.push(n)})),e.sort()}(function(e){var t=e.match(ae);return t?t[1].split(se):[]}(n),r)))}function To(e){var t=0,r=0;return function(){var n=yr(),o=16-(n-r);if(r=n,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Do(e,t){var r=-1,n=e.length,o=n-1;for(t=t===i?n:t;++r<t;){var a=Wn(r,o),s=e[a];e[a]=e[r],e[r]=s}return e.length=t,e}var Eo,Po,Ro=(Eo=Ea((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ee,(function(e,r,n,i){t.push(n?i.replace(ce,"$1"):r||e)})),t}),(function(e){return 500===Po.size&&Po.clear(),e})),Po=Eo.cache,Eo);function Io(e){if("string"==typeof e||ss(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Mo(e){if(null!=e){try{return De.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function qo(e){if(e instanceof zr)return e.clone();var t=new Nr(e.__wrapped__,e.__chain__);return t.__actions__=ki(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Lo=Yn((function(e,t){return Ga(e)?un(e,mn(t,1,Ga,!0)):[]})),No=Yn((function(e,t){var r=Ko(t);return Ga(r)&&(r=i),Ga(e)?un(e,mn(t,1,Ga,!0),oo(r,2)):[]})),zo=Yn((function(e,t){var r=Ko(t);return Ga(r)&&(r=i),Ga(e)?un(e,mn(t,1,Ga,!0),i,r):[]}));function Bo(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:ps(r);return i<0&&(i=mr(n+i,0)),qt(e,oo(t,3),i)}function Uo(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var o=n-1;return r!==i&&(o=ps(r),o=r<0?mr(n+o,0):gr(o,n-1)),qt(e,oo(t,3),o,!0)}function Vo(e){return null!=e&&e.length?mn(e,1):[]}function Wo(e){return e&&e.length?e[0]:i}var Go=Yn((function(e){var t=Tt(e,hi);return t.length&&t[0]===e[0]?Cn(t):[]})),Yo=Yn((function(e){var t=Ko(e),r=Tt(e,hi);return t===Ko(r)?t=i:r.pop(),r.length&&r[0]===e[0]?Cn(r,oo(t,2)):[]})),Ho=Yn((function(e){var t=Ko(e),r=Tt(e,hi);return(t="function"==typeof t?t:i)&&r.pop(),r.length&&r[0]===e[0]?Cn(r,i,t):[]}));function Ko(e){var t=null==e?0:e.length;return t?e[t-1]:i}var Xo=Yn(Zo);function Zo(e,t){return e&&e.length&&t&&t.length?Un(e,t):e}var Qo=Ji((function(e,t){var r=null==e?0:e.length,n=nn(e,t);return Vn(e,Tt(t,(function(e){return go(e,r)?+e:e})).sort(Ai)),n}));function Jo(e){return null==e?e:_r.call(e)}var ea=Yn((function(e){return si(mn(e,1,Ga,!0))})),ta=Yn((function(e){var t=Ko(e);return Ga(t)&&(t=i),si(mn(e,1,Ga,!0),oo(t,2))})),ra=Yn((function(e){var t=Ko(e);return t="function"==typeof t?t:i,si(mn(e,1,Ga,!0),i,t)}));function na(e){if(!e||!e.length)return[];var t=0;return e=$t(e,(function(e){if(Ga(e))return t=mr(e.length,t),!0})),Yt(t,(function(t){return Tt(e,Ut(t))}))}function ia(e,t){if(!e||!e.length)return[];var r=na(e);return null==t?r:Tt(r,(function(e){return At(t,i,e)}))}var oa=Yn((function(e,t){return Ga(e)?un(e,t):[]})),aa=Yn((function(e){return fi($t(e,Ga))})),sa=Yn((function(e){var t=Ko(e);return Ga(t)&&(t=i),fi($t(e,Ga),oo(t,2))})),la=Yn((function(e){var t=Ko(e);return t="function"==typeof t?t:i,fi($t(e,Ga),i,t)})),ua=Yn(na),ca=Yn((function(e){var t=e.length,r=t>1?e[t-1]:i;return r="function"==typeof r?(e.pop(),r):i,ia(e,r)}));function da(e){var t=Mr(e);return t.__chain__=!0,t}function fa(e,t){return t(e)}var pa=Ji((function(e){var t=e.length,r=t?e[0]:0,n=this.__wrapped__,o=function(t){return nn(t,e)};return!(t>1||this.__actions__.length)&&n instanceof zr&&go(r)?((n=n.slice(r,+r+(t?1:0))).__actions__.push({func:fa,args:[o],thisArg:i}),new Nr(n,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(o)})),ha=$i((function(e,t,r){Ee.call(e,r)?++e[r]:rn(e,r,1)})),ma=Ri(Bo),ga=Ri(Uo);function ya(e,t){return(Ua(e)?St:cn)(e,oo(t,3))}function va(e,t){return(Ua(e)?kt:dn)(e,oo(t,3))}var ba=$i((function(e,t,r){Ee.call(e,r)?e[r].push(t):rn(e,r,[t])})),_a=Yn((function(e,t,r){var i=-1,o="function"==typeof t,a=Wa(e)?n(e.length):[];return cn(e,(function(e){a[++i]=o?At(t,e,r):$n(e,t,r)})),a})),wa=$i((function(e,t,r){rn(e,r,t)}));function xa(e,t){return(Ua(e)?Tt:In)(e,oo(t,3))}var Aa=$i((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]})),ja=Yn((function(e,t){if(null==e)return[];var r=t.length;return r>1&&yo(e,t[0],t[1])?t=[]:r>2&&yo(t[0],t[1],t[2])&&(t=[t[0]]),zn(e,mn(t,1),[])})),Sa=ut||function(){return dt.Date.now()};function ka(e,t,r){return t=r?i:t,t=e&&null==t?e.length:t,Hi(e,u,i,i,i,i,t)}function Ca(e,t){var r;if("function"!=typeof t)throw new Ce(o);return e=ps(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=i),r}}var $a=Yn((function(e,t,r){var n=1;if(r.length){var i=ar(r,io($a));n|=l}return Hi(e,n,t,r,i)})),Oa=Yn((function(e,t,r){var n=3;if(r.length){var i=ar(r,io(Oa));n|=l}return Hi(t,n,e,r,i)}));function Fa(e,t,r){var n,a,s,l,u,c,d=0,f=!1,p=!1,h=!0;if("function"!=typeof e)throw new Ce(o);function m(t){var r=n,o=a;return n=a=i,d=t,l=e.apply(o,r)}function g(e){var r=e-c;return c===i||r>=t||r<0||p&&e-d>=s}function y(){var e=Sa();if(g(e))return v(e);u=$o(y,function(e){var r=t-(e-c);return p?gr(r,s-(e-d)):r}(e))}function v(e){return u=i,h&&n?m(e):(n=a=i,l)}function b(){var e=Sa(),r=g(e);if(n=arguments,a=this,c=e,r){if(u===i)return function(e){return d=e,u=$o(y,t),f?m(e):l}(c);if(p)return bi(u),u=$o(y,t),m(c)}return u===i&&(u=$o(y,t)),l}return t=ms(t)||0,Ja(r)&&(f=!!r.leading,s=(p="maxWait"in r)?mr(ms(r.maxWait)||0,t):s,h="trailing"in r?!!r.trailing:h),b.cancel=function(){u!==i&&bi(u),d=0,n=c=a=u=i},b.flush=function(){return u===i?l:v(Sa())},b}var Ta=Yn((function(e,t){return ln(e,1,t)})),Da=Yn((function(e,t,r){return ln(e,ms(t)||0,r)}));function Ea(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ce(o);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(Ea.Cache||Vr),r}function Pa(e){if("function"!=typeof e)throw new Ce(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Ea.Cache=Vr;var Ra=yi((function(e,t){var r=(t=1==t.length&&Ua(t[0])?Tt(t[0],Kt(oo())):Tt(mn(t,1),Kt(oo()))).length;return Yn((function(n){for(var i=-1,o=gr(n.length,r);++i<o;)n[i]=t[i].call(this,n[i]);return At(e,this,n)}))})),Ia=Yn((function(e,t){var r=ar(t,io(Ia));return Hi(e,l,i,t,r)})),Ma=Yn((function(e,t){var r=ar(t,io(Ma));return Hi(e,64,i,t,r)})),qa=Ji((function(e,t){return Hi(e,256,i,i,i,t)}));function La(e,t){return e===t||e!=e&&t!=t}var Na=Ui(jn),za=Ui((function(e,t){return e>=t})),Ba=On(function(){return arguments}())?On:function(e){return es(e)&&Ee.call(e,"callee")&&!Ge.call(e,"callee")},Ua=n.isArray,Va=yt?Kt(yt):function(e){return es(e)&&An(e)==T};function Wa(e){return null!=e&&Qa(e.length)&&!Xa(e)}function Ga(e){return es(e)&&Wa(e)}var Ya=gt||ml,Ha=vt?Kt(vt):function(e){return es(e)&&An(e)==v};function Ka(e){if(!es(e))return!1;var t=An(e);return t==b||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ns(e)}function Xa(e){if(!Ja(e))return!1;var t=An(e);return t==_||t==w||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Za(e){return"number"==typeof e&&e==ps(e)}function Qa(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=d}function Ja(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function es(e){return null!=e&&"object"==typeof e}var ts=bt?Kt(bt):function(e){return es(e)&&fo(e)==x};function rs(e){return"number"==typeof e||es(e)&&An(e)==A}function ns(e){if(!es(e)||An(e)!=j)return!1;var t=Ve(e);if(null===t)return!0;var r=Ee.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&De.call(r)==Me}var is=_t?Kt(_t):function(e){return es(e)&&An(e)==k},os=wt?Kt(wt):function(e){return es(e)&&fo(e)==C};function as(e){return"string"==typeof e||!Ua(e)&&es(e)&&An(e)==$}function ss(e){return"symbol"==typeof e||es(e)&&An(e)==O}var ls=xt?Kt(xt):function(e){return es(e)&&Qa(e.length)&&!!it[An(e)]},us=Ui(Rn),cs=Ui((function(e,t){return e<=t}));function ds(e){if(!e)return[];if(Wa(e))return as(e)?cr(e):ki(e);if(Ke&&e[Ke])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[Ke]());var t=fo(e);return(t==x?ir:t==C?sr:Ls)(e)}function fs(e){return e?(e=ms(e))===c||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ps(e){var t=fs(e),r=t%1;return t==t?r?t-r:t:0}function hs(e){return e?on(ps(e),0,p):0}function ms(e){if("number"==typeof e)return e;if(ss(e))return f;if(Ja(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ja(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Ht(e);var r=he.test(e);return r||ge.test(e)?lt(e.slice(2),r?2:8):pe.test(e)?f:+e}function gs(e){return Ci(e,Ts(e))}function ys(e){return null==e?"":ai(e)}var vs=Oi((function(e,t){if(wo(t)||Wa(t))Ci(t,Fs(t),e);else for(var r in t)Ee.call(t,r)&&Qr(e,r,t[r])})),bs=Oi((function(e,t){Ci(t,Ts(t),e)})),_s=Oi((function(e,t,r,n){Ci(t,Ts(t),e,n)})),ws=Oi((function(e,t,r,n){Ci(t,Fs(t),e,n)})),xs=Ji(nn),As=Yn((function(e,t){e=je(e);var r=-1,n=t.length,o=n>2?t[2]:i;for(o&&yo(t[0],t[1],o)&&(n=1);++r<n;)for(var a=t[r],s=Ts(a),l=-1,u=s.length;++l<u;){var c=s[l],d=e[c];(d===i||La(d,Fe[c])&&!Ee.call(e,c))&&(e[c]=a[c])}return e})),js=Yn((function(e){return e.push(i,Xi),At(Es,i,e)}));function Ss(e,t,r){var n=null==e?i:wn(e,t);return n===i?r:n}function ks(e,t){return null!=e&&po(e,t,kn)}var Cs=qi((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=Ie.call(t)),e[t]=r}),Js(rl)),$s=qi((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=Ie.call(t)),Ee.call(e,t)?e[t].push(r):e[t]=[r]}),oo),Os=Yn($n);function Fs(e){return Wa(e)?Yr(e):Pn(e)}function Ts(e){return Wa(e)?Yr(e,!0):function(e){if(!Ja(e))return function(e){var t=[];if(null!=e)for(var r in je(e))t.push(r);return t}(e);var t=wo(e),r=[];for(var n in e)("constructor"!=n||!t&&Ee.call(e,n))&&r.push(n);return r}(e)}var Ds=Oi((function(e,t,r){Ln(e,t,r)})),Es=Oi((function(e,t,r,n){Ln(e,t,r,n)})),Ps=Ji((function(e,t){var r={};if(null==e)return r;var n=!1;t=Tt(t,(function(t){return t=gi(t,e),n||(n=t.length>1),t})),Ci(e,to(e),r),n&&(r=an(r,7,Zi));for(var i=t.length;i--;)li(r,t[i]);return r})),Rs=Ji((function(e,t){return null==e?{}:function(e,t){return Bn(e,t,(function(t,r){return ks(e,r)}))}(e,t)}));function Is(e,t){if(null==e)return{};var r=Tt(to(e),(function(e){return[e]}));return t=oo(t),Bn(e,r,(function(e,r){return t(e,r[0])}))}var Ms=Yi(Fs),qs=Yi(Ts);function Ls(e){return null==e?[]:Xt(e,Fs(e))}var Ns=Ei((function(e,t,r){return t=t.toLowerCase(),e+(r?zs(t):t)}));function zs(e){return Ks(ys(e).toLowerCase())}function Bs(e){return(e=ys(e))&&e.replace(ve,er).replace(Ze,"")}var Us=Ei((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),Vs=Ei((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),Ws=Di("toLowerCase"),Gs=Ei((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()})),Ys=Ei((function(e,t,r){return e+(r?" ":"")+Ks(t)})),Hs=Ei((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),Ks=Di("toUpperCase");function Xs(e,t,r){return e=ys(e),(t=r?i:t)===i?function(e){return tt.test(e)}(e)?function(e){return e.match(Je)||[]}(e):function(e){return e.match(le)||[]}(e):e.match(t)||[]}var Zs=Yn((function(e,t){try{return At(e,i,t)}catch(e){return Ka(e)?e:new we(e)}})),Qs=Ji((function(e,t){return St(t,(function(t){t=Io(t),rn(e,t,$a(e[t],e))})),e}));function Js(e){return function(){return e}}var el=Ii(),tl=Ii(!0);function rl(e){return e}function nl(e){return En("function"==typeof e?e:an(e,1))}var il=Yn((function(e,t){return function(r){return $n(r,e,t)}})),ol=Yn((function(e,t){return function(r){return $n(e,r,t)}}));function al(e,t,r){var n=Fs(t),i=_n(t,n);null!=r||Ja(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=_n(t,Fs(t)));var o=!(Ja(r)&&"chain"in r&&!r.chain),a=Xa(e);return St(i,(function(r){var n=t[r];e[r]=n,a&&(e.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=e(this.__wrapped__);return(r.__actions__=ki(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,Dt([this.value()],arguments))})})),e}function sl(){}var ll=Ni(Tt),ul=Ni(Ct),cl=Ni(Rt);function dl(e){return vo(e)?Ut(Io(e)):function(e){return function(t){return wn(t,e)}}(e)}var fl=Bi(),pl=Bi(!0);function hl(){return[]}function ml(){return!1}var gl,yl=Li((function(e,t){return e+t}),0),vl=Wi("ceil"),bl=Li((function(e,t){return e/t}),1),_l=Wi("floor"),wl=Li((function(e,t){return e*t}),1),xl=Wi("round"),Al=Li((function(e,t){return e-t}),0);return Mr.after=function(e,t){if("function"!=typeof t)throw new Ce(o);return e=ps(e),function(){if(--e<1)return t.apply(this,arguments)}},Mr.ary=ka,Mr.assign=vs,Mr.assignIn=bs,Mr.assignInWith=_s,Mr.assignWith=ws,Mr.at=xs,Mr.before=Ca,Mr.bind=$a,Mr.bindAll=Qs,Mr.bindKey=Oa,Mr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ua(e)?e:[e]},Mr.chain=da,Mr.chunk=function(e,t,r){t=(r?yo(e,t,r):t===i)?1:mr(ps(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var a=0,s=0,l=n(ft(o/t));a<o;)l[s++]=ei(e,a,a+=t);return l},Mr.compact=function(e){for(var t=-1,r=null==e?0:e.length,n=0,i=[];++t<r;){var o=e[t];o&&(i[n++]=o)}return i},Mr.concat=function(){var e=arguments.length;if(!e)return[];for(var t=n(e-1),r=arguments[0],i=e;i--;)t[i-1]=arguments[i];return Dt(Ua(r)?ki(r):[r],mn(t,1))},Mr.cond=function(e){var t=null==e?0:e.length,r=oo();return e=t?Tt(e,(function(e){if("function"!=typeof e[1])throw new Ce(o);return[r(e[0]),e[1]]})):[],Yn((function(r){for(var n=-1;++n<t;){var i=e[n];if(At(i[0],this,r))return At(i[1],this,r)}}))},Mr.conforms=function(e){return function(e){var t=Fs(e);return function(r){return sn(r,e,t)}}(an(e,1))},Mr.constant=Js,Mr.countBy=ha,Mr.create=function(e,t){var r=qr(e);return null==t?r:tn(r,t)},Mr.curry=function e(t,r,n){var o=Hi(t,8,i,i,i,i,i,r=n?i:r);return o.placeholder=e.placeholder,o},Mr.curryRight=function e(t,r,n){var o=Hi(t,16,i,i,i,i,i,r=n?i:r);return o.placeholder=e.placeholder,o},Mr.debounce=Fa,Mr.defaults=As,Mr.defaultsDeep=js,Mr.defer=Ta,Mr.delay=Da,Mr.difference=Lo,Mr.differenceBy=No,Mr.differenceWith=zo,Mr.drop=function(e,t,r){var n=null==e?0:e.length;return n?ei(e,(t=r||t===i?1:ps(t))<0?0:t,n):[]},Mr.dropRight=function(e,t,r){var n=null==e?0:e.length;return n?ei(e,0,(t=n-(t=r||t===i?1:ps(t)))<0?0:t):[]},Mr.dropRightWhile=function(e,t){return e&&e.length?ci(e,oo(t,3),!0,!0):[]},Mr.dropWhile=function(e,t){return e&&e.length?ci(e,oo(t,3),!0):[]},Mr.fill=function(e,t,r,n){var o=null==e?0:e.length;return o?(r&&"number"!=typeof r&&yo(e,t,r)&&(r=0,n=o),function(e,t,r,n){var o=e.length;for((r=ps(r))<0&&(r=-r>o?0:o+r),(n=n===i||n>o?o:ps(n))<0&&(n+=o),n=r>n?0:hs(n);r<n;)e[r++]=t;return e}(e,t,r,n)):[]},Mr.filter=function(e,t){return(Ua(e)?$t:hn)(e,oo(t,3))},Mr.flatMap=function(e,t){return mn(xa(e,t),1)},Mr.flatMapDeep=function(e,t){return mn(xa(e,t),c)},Mr.flatMapDepth=function(e,t,r){return r=r===i?1:ps(r),mn(xa(e,t),r)},Mr.flatten=Vo,Mr.flattenDeep=function(e){return null!=e&&e.length?mn(e,c):[]},Mr.flattenDepth=function(e,t){return null!=e&&e.length?mn(e,t=t===i?1:ps(t)):[]},Mr.flip=function(e){return Hi(e,512)},Mr.flow=el,Mr.flowRight=tl,Mr.fromPairs=function(e){for(var t=-1,r=null==e?0:e.length,n={};++t<r;){var i=e[t];n[i[0]]=i[1]}return n},Mr.functions=function(e){return null==e?[]:_n(e,Fs(e))},Mr.functionsIn=function(e){return null==e?[]:_n(e,Ts(e))},Mr.groupBy=ba,Mr.initial=function(e){return null!=e&&e.length?ei(e,0,-1):[]},Mr.intersection=Go,Mr.intersectionBy=Yo,Mr.intersectionWith=Ho,Mr.invert=Cs,Mr.invertBy=$s,Mr.invokeMap=_a,Mr.iteratee=nl,Mr.keyBy=wa,Mr.keys=Fs,Mr.keysIn=Ts,Mr.map=xa,Mr.mapKeys=function(e,t){var r={};return t=oo(t,3),vn(e,(function(e,n,i){rn(r,t(e,n,i),e)})),r},Mr.mapValues=function(e,t){var r={};return t=oo(t,3),vn(e,(function(e,n,i){rn(r,n,t(e,n,i))})),r},Mr.matches=function(e){return Mn(an(e,1))},Mr.matchesProperty=function(e,t){return qn(e,an(t,1))},Mr.memoize=Ea,Mr.merge=Ds,Mr.mergeWith=Es,Mr.method=il,Mr.methodOf=ol,Mr.mixin=al,Mr.negate=Pa,Mr.nthArg=function(e){return e=ps(e),Yn((function(t){return Nn(t,e)}))},Mr.omit=Ps,Mr.omitBy=function(e,t){return Is(e,Pa(oo(t)))},Mr.once=function(e){return Ca(2,e)},Mr.orderBy=function(e,t,r,n){return null==e?[]:(Ua(t)||(t=null==t?[]:[t]),Ua(r=n?i:r)||(r=null==r?[]:[r]),zn(e,t,r))},Mr.over=ll,Mr.overArgs=Ra,Mr.overEvery=ul,Mr.overSome=cl,Mr.partial=Ia,Mr.partialRight=Ma,Mr.partition=Aa,Mr.pick=Rs,Mr.pickBy=Is,Mr.property=dl,Mr.propertyOf=function(e){return function(t){return null==e?i:wn(e,t)}},Mr.pull=Xo,Mr.pullAll=Zo,Mr.pullAllBy=function(e,t,r){return e&&e.length&&t&&t.length?Un(e,t,oo(r,2)):e},Mr.pullAllWith=function(e,t,r){return e&&e.length&&t&&t.length?Un(e,t,i,r):e},Mr.pullAt=Qo,Mr.range=fl,Mr.rangeRight=pl,Mr.rearg=qa,Mr.reject=function(e,t){return(Ua(e)?$t:hn)(e,Pa(oo(t,3)))},Mr.remove=function(e,t){var r=[];if(!e||!e.length)return r;var n=-1,i=[],o=e.length;for(t=oo(t,3);++n<o;){var a=e[n];t(a,n,e)&&(r.push(a),i.push(n))}return Vn(e,i),r},Mr.rest=function(e,t){if("function"!=typeof e)throw new Ce(o);return Yn(e,t=t===i?t:ps(t))},Mr.reverse=Jo,Mr.sampleSize=function(e,t,r){return t=(r?yo(e,t,r):t===i)?1:ps(t),(Ua(e)?Kr:Kn)(e,t)},Mr.set=function(e,t,r){return null==e?e:Xn(e,t,r)},Mr.setWith=function(e,t,r,n){return n="function"==typeof n?n:i,null==e?e:Xn(e,t,r,n)},Mr.shuffle=function(e){return(Ua(e)?Xr:Jn)(e)},Mr.slice=function(e,t,r){var n=null==e?0:e.length;return n?(r&&"number"!=typeof r&&yo(e,t,r)?(t=0,r=n):(t=null==t?0:ps(t),r=r===i?n:ps(r)),ei(e,t,r)):[]},Mr.sortBy=ja,Mr.sortedUniq=function(e){return e&&e.length?ii(e):[]},Mr.sortedUniqBy=function(e,t){return e&&e.length?ii(e,oo(t,2)):[]},Mr.split=function(e,t,r){return r&&"number"!=typeof r&&yo(e,t,r)&&(t=r=i),(r=r===i?p:r>>>0)?(e=ys(e))&&("string"==typeof t||null!=t&&!is(t))&&!(t=ai(t))&&nr(e)?vi(cr(e),0,r):e.split(t,r):[]},Mr.spread=function(e,t){if("function"!=typeof e)throw new Ce(o);return t=null==t?0:mr(ps(t),0),Yn((function(r){var n=r[t],i=vi(r,0,t);return n&&Dt(i,n),At(e,this,i)}))},Mr.tail=function(e){var t=null==e?0:e.length;return t?ei(e,1,t):[]},Mr.take=function(e,t,r){return e&&e.length?ei(e,0,(t=r||t===i?1:ps(t))<0?0:t):[]},Mr.takeRight=function(e,t,r){var n=null==e?0:e.length;return n?ei(e,(t=n-(t=r||t===i?1:ps(t)))<0?0:t,n):[]},Mr.takeRightWhile=function(e,t){return e&&e.length?ci(e,oo(t,3),!1,!0):[]},Mr.takeWhile=function(e,t){return e&&e.length?ci(e,oo(t,3)):[]},Mr.tap=function(e,t){return t(e),e},Mr.throttle=function(e,t,r){var n=!0,i=!0;if("function"!=typeof e)throw new Ce(o);return Ja(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),Fa(e,t,{leading:n,maxWait:t,trailing:i})},Mr.thru=fa,Mr.toArray=ds,Mr.toPairs=Ms,Mr.toPairsIn=qs,Mr.toPath=function(e){return Ua(e)?Tt(e,Io):ss(e)?[e]:ki(Ro(ys(e)))},Mr.toPlainObject=gs,Mr.transform=function(e,t,r){var n=Ua(e),i=n||Ya(e)||ls(e);if(t=oo(t,4),null==r){var o=e&&e.constructor;r=i?n?new o:[]:Ja(e)&&Xa(o)?qr(Ve(e)):{}}return(i?St:vn)(e,(function(e,n,i){return t(r,e,n,i)})),r},Mr.unary=function(e){return ka(e,1)},Mr.union=ea,Mr.unionBy=ta,Mr.unionWith=ra,Mr.uniq=function(e){return e&&e.length?si(e):[]},Mr.uniqBy=function(e,t){return e&&e.length?si(e,oo(t,2)):[]},Mr.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?si(e,i,t):[]},Mr.unset=function(e,t){return null==e||li(e,t)},Mr.unzip=na,Mr.unzipWith=ia,Mr.update=function(e,t,r){return null==e?e:ui(e,t,mi(r))},Mr.updateWith=function(e,t,r,n){return n="function"==typeof n?n:i,null==e?e:ui(e,t,mi(r),n)},Mr.values=Ls,Mr.valuesIn=function(e){return null==e?[]:Xt(e,Ts(e))},Mr.without=oa,Mr.words=Xs,Mr.wrap=function(e,t){return Ia(mi(t),e)},Mr.xor=aa,Mr.xorBy=sa,Mr.xorWith=la,Mr.zip=ua,Mr.zipObject=function(e,t){return pi(e||[],t||[],Qr)},Mr.zipObjectDeep=function(e,t){return pi(e||[],t||[],Xn)},Mr.zipWith=ca,Mr.entries=Ms,Mr.entriesIn=qs,Mr.extend=bs,Mr.extendWith=_s,al(Mr,Mr),Mr.add=yl,Mr.attempt=Zs,Mr.camelCase=Ns,Mr.capitalize=zs,Mr.ceil=vl,Mr.clamp=function(e,t,r){return r===i&&(r=t,t=i),r!==i&&(r=(r=ms(r))==r?r:0),t!==i&&(t=(t=ms(t))==t?t:0),on(ms(e),t,r)},Mr.clone=function(e){return an(e,4)},Mr.cloneDeep=function(e){return an(e,5)},Mr.cloneDeepWith=function(e,t){return an(e,5,t="function"==typeof t?t:i)},Mr.cloneWith=function(e,t){return an(e,4,t="function"==typeof t?t:i)},Mr.conformsTo=function(e,t){return null==t||sn(e,t,Fs(t))},Mr.deburr=Bs,Mr.defaultTo=function(e,t){return null==e||e!=e?t:e},Mr.divide=bl,Mr.endsWith=function(e,t,r){e=ys(e),t=ai(t);var n=e.length,o=r=r===i?n:on(ps(r),0,n);return(r-=t.length)>=0&&e.slice(r,o)==t},Mr.eq=La,Mr.escape=function(e){return(e=ys(e))&&H.test(e)?e.replace(G,tr):e},Mr.escapeRegExp=function(e){return(e=ys(e))&&re.test(e)?e.replace(te,"\\$&"):e},Mr.every=function(e,t,r){var n=Ua(e)?Ct:fn;return r&&yo(e,t,r)&&(t=i),n(e,oo(t,3))},Mr.find=ma,Mr.findIndex=Bo,Mr.findKey=function(e,t){return Mt(e,oo(t,3),vn)},Mr.findLast=ga,Mr.findLastIndex=Uo,Mr.findLastKey=function(e,t){return Mt(e,oo(t,3),bn)},Mr.floor=_l,Mr.forEach=ya,Mr.forEachRight=va,Mr.forIn=function(e,t){return null==e?e:gn(e,oo(t,3),Ts)},Mr.forInRight=function(e,t){return null==e?e:yn(e,oo(t,3),Ts)},Mr.forOwn=function(e,t){return e&&vn(e,oo(t,3))},Mr.forOwnRight=function(e,t){return e&&bn(e,oo(t,3))},Mr.get=Ss,Mr.gt=Na,Mr.gte=za,Mr.has=function(e,t){return null!=e&&po(e,t,Sn)},Mr.hasIn=ks,Mr.head=Wo,Mr.identity=rl,Mr.includes=function(e,t,r,n){e=Wa(e)?e:Ls(e),r=r&&!n?ps(r):0;var i=e.length;return r<0&&(r=mr(i+r,0)),as(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&Lt(e,t,r)>-1},Mr.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:ps(r);return i<0&&(i=mr(n+i,0)),Lt(e,t,i)},Mr.inRange=function(e,t,r){return t=fs(t),r===i?(r=t,t=0):r=fs(r),function(e,t,r){return e>=gr(t,r)&&e<mr(t,r)}(e=ms(e),t,r)},Mr.invoke=Os,Mr.isArguments=Ba,Mr.isArray=Ua,Mr.isArrayBuffer=Va,Mr.isArrayLike=Wa,Mr.isArrayLikeObject=Ga,Mr.isBoolean=function(e){return!0===e||!1===e||es(e)&&An(e)==y},Mr.isBuffer=Ya,Mr.isDate=Ha,Mr.isElement=function(e){return es(e)&&1===e.nodeType&&!ns(e)},Mr.isEmpty=function(e){if(null==e)return!0;if(Wa(e)&&(Ua(e)||"string"==typeof e||"function"==typeof e.splice||Ya(e)||ls(e)||Ba(e)))return!e.length;var t=fo(e);if(t==x||t==C)return!e.size;if(wo(e))return!Pn(e).length;for(var r in e)if(Ee.call(e,r))return!1;return!0},Mr.isEqual=function(e,t){return Fn(e,t)},Mr.isEqualWith=function(e,t,r){var n=(r="function"==typeof r?r:i)?r(e,t):i;return n===i?Fn(e,t,i,r):!!n},Mr.isError=Ka,Mr.isFinite=function(e){return"number"==typeof e&&It(e)},Mr.isFunction=Xa,Mr.isInteger=Za,Mr.isLength=Qa,Mr.isMap=ts,Mr.isMatch=function(e,t){return e===t||Tn(e,t,so(t))},Mr.isMatchWith=function(e,t,r){return r="function"==typeof r?r:i,Tn(e,t,so(t),r)},Mr.isNaN=function(e){return rs(e)&&e!=+e},Mr.isNative=function(e){if(_o(e))throw new we("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Dn(e)},Mr.isNil=function(e){return null==e},Mr.isNull=function(e){return null===e},Mr.isNumber=rs,Mr.isObject=Ja,Mr.isObjectLike=es,Mr.isPlainObject=ns,Mr.isRegExp=is,Mr.isSafeInteger=function(e){return Za(e)&&e>=-9007199254740991&&e<=d},Mr.isSet=os,Mr.isString=as,Mr.isSymbol=ss,Mr.isTypedArray=ls,Mr.isUndefined=function(e){return e===i},Mr.isWeakMap=function(e){return es(e)&&fo(e)==F},Mr.isWeakSet=function(e){return es(e)&&"[object WeakSet]"==An(e)},Mr.join=function(e,t){return null==e?"":Vt.call(e,t)},Mr.kebabCase=Us,Mr.last=Ko,Mr.lastIndexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var o=n;return r!==i&&(o=(o=ps(r))<0?mr(n+o,0):gr(o,n-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,o):qt(e,zt,o,!0)},Mr.lowerCase=Vs,Mr.lowerFirst=Ws,Mr.lt=us,Mr.lte=cs,Mr.max=function(e){return e&&e.length?pn(e,rl,jn):i},Mr.maxBy=function(e,t){return e&&e.length?pn(e,oo(t,2),jn):i},Mr.mean=function(e){return Bt(e,rl)},Mr.meanBy=function(e,t){return Bt(e,oo(t,2))},Mr.min=function(e){return e&&e.length?pn(e,rl,Rn):i},Mr.minBy=function(e,t){return e&&e.length?pn(e,oo(t,2),Rn):i},Mr.stubArray=hl,Mr.stubFalse=ml,Mr.stubObject=function(){return{}},Mr.stubString=function(){return""},Mr.stubTrue=function(){return!0},Mr.multiply=wl,Mr.nth=function(e,t){return e&&e.length?Nn(e,ps(t)):i},Mr.noConflict=function(){return dt._===this&&(dt._=qe),this},Mr.noop=sl,Mr.now=Sa,Mr.pad=function(e,t,r){e=ys(e);var n=(t=ps(t))?ur(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return zi(pt(i),r)+e+zi(ft(i),r)},Mr.padEnd=function(e,t,r){e=ys(e);var n=(t=ps(t))?ur(e):0;return t&&n<t?e+zi(t-n,r):e},Mr.padStart=function(e,t,r){e=ys(e);var n=(t=ps(t))?ur(e):0;return t&&n<t?zi(t-n,r)+e:e},Mr.parseInt=function(e,t,r){return r||null==t?t=0:t&&(t=+t),vr(ys(e).replace(ne,""),t||0)},Mr.random=function(e,t,r){if(r&&"boolean"!=typeof r&&yo(e,t,r)&&(t=r=i),r===i&&("boolean"==typeof t?(r=t,t=i):"boolean"==typeof e&&(r=e,e=i)),e===i&&t===i?(e=0,t=1):(e=fs(e),t===i?(t=e,e=0):t=fs(t)),e>t){var n=e;e=t,t=n}if(r||e%1||t%1){var o=br();return gr(e+o*(t-e+st("1e-"+((o+"").length-1))),t)}return Wn(e,t)},Mr.reduce=function(e,t,r){var n=Ua(e)?Et:Wt,i=arguments.length<3;return n(e,oo(t,4),r,i,cn)},Mr.reduceRight=function(e,t,r){var n=Ua(e)?Pt:Wt,i=arguments.length<3;return n(e,oo(t,4),r,i,dn)},Mr.repeat=function(e,t,r){return t=(r?yo(e,t,r):t===i)?1:ps(t),Gn(ys(e),t)},Mr.replace=function(){var e=arguments,t=ys(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Mr.result=function(e,t,r){var n=-1,o=(t=gi(t,e)).length;for(o||(o=1,e=i);++n<o;){var a=null==e?i:e[Io(t[n])];a===i&&(n=o,a=r),e=Xa(a)?a.call(e):a}return e},Mr.round=xl,Mr.runInContext=e,Mr.sample=function(e){return(Ua(e)?Hr:Hn)(e)},Mr.size=function(e){if(null==e)return 0;if(Wa(e))return as(e)?ur(e):e.length;var t=fo(e);return t==x||t==C?e.size:Pn(e).length},Mr.snakeCase=Gs,Mr.some=function(e,t,r){var n=Ua(e)?Rt:ti;return r&&yo(e,t,r)&&(t=i),n(e,oo(t,3))},Mr.sortedIndex=function(e,t){return ri(e,t)},Mr.sortedIndexBy=function(e,t,r){return ni(e,t,oo(r,2))},Mr.sortedIndexOf=function(e,t){var r=null==e?0:e.length;if(r){var n=ri(e,t);if(n<r&&La(e[n],t))return n}return-1},Mr.sortedLastIndex=function(e,t){return ri(e,t,!0)},Mr.sortedLastIndexBy=function(e,t,r){return ni(e,t,oo(r,2),!0)},Mr.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var r=ri(e,t,!0)-1;if(La(e[r],t))return r}return-1},Mr.startCase=Ys,Mr.startsWith=function(e,t,r){return e=ys(e),r=null==r?0:on(ps(r),0,e.length),t=ai(t),e.slice(r,r+t.length)==t},Mr.subtract=Al,Mr.sum=function(e){return e&&e.length?Gt(e,rl):0},Mr.sumBy=function(e,t){return e&&e.length?Gt(e,oo(t,2)):0},Mr.template=function(e,t,r){var n=Mr.templateSettings;r&&yo(e,t,r)&&(t=i),e=ys(e),t=_s({},t,n,Ki);var o,a,s=_s({},t.imports,n.imports,Ki),l=Fs(s),u=Xt(s,l),c=0,d=t.interpolate||be,f="__p += '",p=Se((t.escape||be).source+"|"+d.source+"|"+(d===Z?de:be).source+"|"+(t.evaluate||be).source+"|$","g"),h="//# sourceURL="+(Ee.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++nt+"]")+"\n";e.replace(p,(function(t,r,n,i,s,l){return n||(n=i),f+=e.slice(c,l).replace(_e,rr),r&&(o=!0,f+="' +\n__e("+r+") +\n'"),s&&(a=!0,f+="';\n"+s+";\n__p += '"),n&&(f+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),c=l+t.length,t})),f+="';\n";var m=Ee.call(t,"variable")&&t.variable;if(m){if(ue.test(m))throw new we("Invalid `variable` option passed into `_.template`")}else f="with (obj) {\n"+f+"\n}\n";f=(a?f.replace(B,""):f).replace(U,"$1").replace(V,"$1;"),f="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+f+"return __p\n}";var g=Zs((function(){return xe(l,h+"return "+f).apply(i,u)}));if(g.source=f,Ka(g))throw g;return g},Mr.times=function(e,t){if((e=ps(e))<1||e>d)return[];var r=p,n=gr(e,p);t=oo(t),e-=p;for(var i=Yt(n,t);++r<e;)t(r);return i},Mr.toFinite=fs,Mr.toInteger=ps,Mr.toLength=hs,Mr.toLower=function(e){return ys(e).toLowerCase()},Mr.toNumber=ms,Mr.toSafeInteger=function(e){return e?on(ps(e),-9007199254740991,d):0===e?e:0},Mr.toString=ys,Mr.toUpper=function(e){return ys(e).toUpperCase()},Mr.trim=function(e,t,r){if((e=ys(e))&&(r||t===i))return Ht(e);if(!e||!(t=ai(t)))return e;var n=cr(e),o=cr(t);return vi(n,Qt(n,o),Jt(n,o)+1).join("")},Mr.trimEnd=function(e,t,r){if((e=ys(e))&&(r||t===i))return e.slice(0,dr(e)+1);if(!e||!(t=ai(t)))return e;var n=cr(e);return vi(n,0,Jt(n,cr(t))+1).join("")},Mr.trimStart=function(e,t,r){if((e=ys(e))&&(r||t===i))return e.replace(ne,"");if(!e||!(t=ai(t)))return e;var n=cr(e);return vi(n,Qt(n,cr(t))).join("")},Mr.truncate=function(e,t){var r=30,n="...";if(Ja(t)){var o="separator"in t?t.separator:o;r="length"in t?ps(t.length):r,n="omission"in t?ai(t.omission):n}var a=(e=ys(e)).length;if(nr(e)){var s=cr(e);a=s.length}if(r>=a)return e;var l=r-ur(n);if(l<1)return n;var u=s?vi(s,0,l).join(""):e.slice(0,l);if(o===i)return u+n;if(s&&(l+=u.length-l),is(o)){if(e.slice(l).search(o)){var c,d=u;for(o.global||(o=Se(o.source,ys(fe.exec(o))+"g")),o.lastIndex=0;c=o.exec(d);)var f=c.index;u=u.slice(0,f===i?l:f)}}else if(e.indexOf(ai(o),l)!=l){var p=u.lastIndexOf(o);p>-1&&(u=u.slice(0,p))}return u+n},Mr.unescape=function(e){return(e=ys(e))&&Y.test(e)?e.replace(W,fr):e},Mr.uniqueId=function(e){var t=++Pe;return ys(e)+t},Mr.upperCase=Hs,Mr.upperFirst=Ks,Mr.each=ya,Mr.eachRight=va,Mr.first=Wo,al(Mr,(gl={},vn(Mr,(function(e,t){Ee.call(Mr.prototype,t)||(gl[t]=e)})),gl),{chain:!1}),Mr.VERSION="4.17.21",St(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Mr[e].placeholder=Mr})),St(["drop","take"],(function(e,t){zr.prototype[e]=function(r){r=r===i?1:mr(ps(r),0);var n=this.__filtered__&&!t?new zr(this):this.clone();return n.__filtered__?n.__takeCount__=gr(r,n.__takeCount__):n.__views__.push({size:gr(r,p),type:e+(n.__dir__<0?"Right":"")}),n},zr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),St(["filter","map","takeWhile"],(function(e,t){var r=t+1,n=1==r||3==r;zr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:oo(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}})),St(["head","last"],(function(e,t){var r="take"+(t?"Right":"");zr.prototype[e]=function(){return this[r](1).value()[0]}})),St(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");zr.prototype[e]=function(){return this.__filtered__?new zr(this):this[r](1)}})),zr.prototype.compact=function(){return this.filter(rl)},zr.prototype.find=function(e){return this.filter(e).head()},zr.prototype.findLast=function(e){return this.reverse().find(e)},zr.prototype.invokeMap=Yn((function(e,t){return"function"==typeof e?new zr(this):this.map((function(r){return $n(r,e,t)}))})),zr.prototype.reject=function(e){return this.filter(Pa(oo(e)))},zr.prototype.slice=function(e,t){e=ps(e);var r=this;return r.__filtered__&&(e>0||t<0)?new zr(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==i&&(r=(t=ps(t))<0?r.dropRight(-t):r.take(t-e)),r)},zr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},zr.prototype.toArray=function(){return this.take(p)},vn(zr.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),o=Mr[n?"take"+("last"==t?"Right":""):t],a=n||/^find/.test(t);o&&(Mr.prototype[t]=function(){var t=this.__wrapped__,s=n?[1]:arguments,l=t instanceof zr,u=s[0],c=l||Ua(t),d=function(e){var t=o.apply(Mr,Dt([e],s));return n&&f?t[0]:t};c&&r&&"function"==typeof u&&1!=u.length&&(l=c=!1);var f=this.__chain__,p=!!this.__actions__.length,h=a&&!f,m=l&&!p;if(!a&&c){t=m?t:new zr(this);var g=e.apply(t,s);return g.__actions__.push({func:fa,args:[d],thisArg:i}),new Nr(g,f)}return h&&m?e.apply(this,s):(g=this.thru(d),h?n?g.value()[0]:g.value():g)})})),St(["pop","push","shift","sort","splice","unshift"],(function(e){var t=$e[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Mr.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(Ua(i)?i:[],e)}return this[r]((function(r){return t.apply(Ua(r)?r:[],e)}))}})),vn(zr.prototype,(function(e,t){var r=Mr[t];if(r){var n=r.name+"";Ee.call($r,n)||($r[n]=[]),$r[n].push({name:t,func:r})}})),$r[Mi(i,2).name]=[{name:"wrapper",func:i}],zr.prototype.clone=function(){var e=new zr(this.__wrapped__);return e.__actions__=ki(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=ki(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=ki(this.__views__),e},zr.prototype.reverse=function(){if(this.__filtered__){var e=new zr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},zr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=Ua(e),n=t<0,i=r?e.length:0,o=function(e,t,r){for(var n=-1,i=r.length;++n<i;){var o=r[n],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=gr(t,e+a);break;case"takeRight":e=mr(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,s=o.end,l=s-a,u=n?s:a-1,c=this.__iteratees__,d=c.length,f=0,p=gr(l,this.__takeCount__);if(!r||!n&&i==l&&p==l)return di(e,this.__actions__);var h=[];e:for(;l--&&f<p;){for(var m=-1,g=e[u+=t];++m<d;){var y=c[m],v=y.iteratee,b=y.type,_=v(g);if(2==b)g=_;else if(!_){if(1==b)continue e;break e}}h[f++]=g}return h},Mr.prototype.at=pa,Mr.prototype.chain=function(){return da(this)},Mr.prototype.commit=function(){return new Nr(this.value(),this.__chain__)},Mr.prototype.next=function(){this.__values__===i&&(this.__values__=ds(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},Mr.prototype.plant=function(e){for(var t,r=this;r instanceof Lr;){var n=qo(r);n.__index__=0,n.__values__=i,t?o.__wrapped__=n:t=n;var o=n;r=r.__wrapped__}return o.__wrapped__=e,t},Mr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof zr){var t=e;return this.__actions__.length&&(t=new zr(this)),(t=t.reverse()).__actions__.push({func:fa,args:[Jo],thisArg:i}),new Nr(t,this.__chain__)}return this.thru(Jo)},Mr.prototype.toJSON=Mr.prototype.valueOf=Mr.prototype.value=function(){return di(this.__wrapped__,this.__actions__)},Mr.prototype.first=Mr.prototype.head,Ke&&(Mr.prototype[Ke]=function(){return this}),Mr}();dt._=pr,(n=function(){return pr}.call(t,r,t,e))===i||(e.exports=n)}.call(this)},330:e=>{e.exports=function(){return!1}},168:(e,t,r)=>{r.r(t),r.d(t,{DOMException:()=>w,Headers:()=>c,Request:()=>y,Response:()=>b,fetch:()=>x});var n="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==n&&n,i={searchParams:"URLSearchParams"in n,iterable:"Symbol"in n&&"iterator"in Symbol,blob:"FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in n,arrayBuffer:"ArrayBuffer"in n};if(i.arrayBuffer)var o=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],a=ArrayBuffer.isView||function(e){return e&&o.indexOf(Object.prototype.toString.call(e))>-1};function s(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function u(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return i.iterable&&(t[Symbol.iterator]=function(){return t}),t}function c(e){this.map={},e instanceof c?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function d(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function f(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function p(e){var t=new FileReader,r=f(t);return t.readAsArrayBuffer(e),r}function h(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:i.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:i.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():i.arrayBuffer&&i.blob&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=h(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):i.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||a(e))?this._bodyArrayBuffer=h(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):i.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i.blob&&(this.blob=function(){var e=d(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?d(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer)):this.blob().then(p)}),this.text=function(){var e,t,r,n=d(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,r=f(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i.formData&&(this.formData=function(){return this.text().then(v)}),this.json=function(){return this.text().then(JSON.parse)},this}c.prototype.append=function(e,t){e=s(e),t=l(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},c.prototype.delete=function(e){delete this.map[s(e)]},c.prototype.get=function(e){return e=s(e),this.has(e)?this.map[e]:null},c.prototype.has=function(e){return this.map.hasOwnProperty(s(e))},c.prototype.set=function(e,t){this.map[s(e)]=l(t)},c.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},c.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),u(e)},c.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),u(e)},c.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),u(e)},i.iterable&&(c.prototype[Symbol.iterator]=c.prototype.entries);var g=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function y(e,t){if(!(this instanceof y))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var r,n,i=(t=t||{}).body;if(e instanceof y){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new c(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new c(t.headers)),this.method=(n=(r=t.method||this.method||"GET").toUpperCase(),g.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(i),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var o=/([?&])_=[^&]*/;o.test(this.url)?this.url=this.url.replace(o,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function v(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}})),t}function b(e,t){if(!(this instanceof b))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new c(t.headers),this.url=t.url||"",this._initBody(e)}y.prototype.clone=function(){return new y(this,{body:this._bodyInit})},m.call(y.prototype),m.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new c(this.headers),url:this.url})},b.error=function(){var e=new b(null,{status:0,statusText:""});return e.type="error",e};var _=[301,302,303,307,308];b.redirect=function(e,t){if(-1===_.indexOf(t))throw new RangeError("Invalid status code");return new b(null,{status:t,headers:{location:e}})};var w=n.DOMException;try{new w}catch(e){(w=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack}).prototype=Object.create(Error.prototype),w.prototype.constructor=w}function x(e,t){return new Promise((function(r,o){var a=new y(e,t);if(a.signal&&a.signal.aborted)return o(new w("Aborted","AbortError"));var s=new XMLHttpRequest;function u(){s.abort()}s.onload=function(){var e,t,n={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new c,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}})),t)};n.url="responseURL"in s?s.responseURL:n.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;setTimeout((function(){r(new b(i,n))}),0)},s.onerror=function(){setTimeout((function(){o(new TypeError("Network request failed"))}),0)},s.ontimeout=function(){setTimeout((function(){o(new TypeError("Network request failed"))}),0)},s.onabort=function(){setTimeout((function(){o(new w("Aborted","AbortError"))}),0)},s.open(a.method,function(e){try{return""===e&&n.location.href?n.location.href:e}catch(t){return e}}(a.url),!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&(i.blob?s.responseType="blob":i.arrayBuffer&&a.headers.get("Content-Type")&&-1!==a.headers.get("Content-Type").indexOf("application/octet-stream")&&(s.responseType="arraybuffer")),!t||"object"!=typeof t.headers||t.headers instanceof c?a.headers.forEach((function(e,t){s.setRequestHeader(t,e)})):Object.getOwnPropertyNames(t.headers).forEach((function(e){s.setRequestHeader(e,l(t.headers[e]))})),a.signal&&(a.signal.addEventListener("abort",u),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",u)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}x.polyfill=!0,n.fetch||(n.fetch=x,n.Headers=c,n.Request=y,n.Response=b)},392:function(e){e.exports=function(){for(var e=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=1),e<t?t:e>r?r:e},t=e,r={},n=0,i=["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"];n<i.length;n+=1){var o=i[n];r["[object "+o+"]"]=o.toLowerCase()}var a=function(e){return r[Object.prototype.toString.call(e)]||"object"},s=a,l=a,u=Math.PI,c={clip_rgb:function(e){e._clipped=!1,e._unclipped=e.slice(0);for(var r=0;r<=3;r++)r<3?((e[r]<0||e[r]>255)&&(e._clipped=!0),e[r]=t(e[r],0,255)):3===r&&(e[r]=t(e[r],0,1));return e},limit:e,type:a,unpack:function(e,t){return void 0===t&&(t=null),e.length>=3?Array.prototype.slice.call(e):"object"==s(e[0])&&t?t.split("").filter((function(t){return void 0!==e[0][t]})).map((function(t){return e[0][t]})):e[0]},last:function(e){if(e.length<2)return null;var t=e.length-1;return"string"==l(e[t])?e[t].toLowerCase():null},PI:u,TWOPI:2*u,PITHIRD:u/3,DEG2RAD:u/180,RAD2DEG:180/u},d={format:{},autodetect:[]},f=c.last,p=c.clip_rgb,h=c.type,m=d,g=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=this;if("object"===h(e[0])&&e[0].constructor&&e[0].constructor===this.constructor)return e[0];var n=f(e),i=!1;if(!n){i=!0,m.sorted||(m.autodetect=m.autodetect.sort((function(e,t){return t.p-e.p})),m.sorted=!0);for(var o=0,a=m.autodetect;o<a.length;o+=1){var s=a[o];if(n=s.test.apply(s,e))break}}if(!m.format[n])throw new Error("unknown format: "+e);var l=m.format[n].apply(null,i?e:e.slice(0,-1));r._rgb=p(l),3===r._rgb.length&&r._rgb.push(1)};g.prototype.toString=function(){return"function"==h(this.hex)?this.hex():"["+this._rgb.join(",")+"]"};var y=g,v=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v.Color,[null].concat(e)))};v.Color=y,v.version="2.4.2";var b=v,_=c.unpack,w=Math.max,x=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=_(e,"rgb"),n=r[0],i=r[1],o=r[2],a=1-w(n/=255,w(i/=255,o/=255)),s=a<1?1/(1-a):0;return[(1-n-a)*s,(1-i-a)*s,(1-o-a)*s,a]},A=c.unpack,j=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=(e=A(e,"cmyk"))[0],n=e[1],i=e[2],o=e[3],a=e.length>4?e[4]:1;return 1===o?[0,0,0,a]:[r>=1?0:255*(1-r)*(1-o),n>=1?0:255*(1-n)*(1-o),i>=1?0:255*(1-i)*(1-o),a]},S=b,k=y,C=d,$=c.unpack,O=c.type,F=x;k.prototype.cmyk=function(){return F(this._rgb)},S.cmyk=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(k,[null].concat(e,["cmyk"])))},C.format.cmyk=j,C.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=$(e,"cmyk"),"array"===O(e)&&4===e.length)return"cmyk"}});var T=c.unpack,D=c.last,E=function(e){return Math.round(100*e)/100},P=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=T(e,"hsla"),n=D(e)||"lsa";return r[0]=E(r[0]||0),r[1]=E(100*r[1])+"%",r[2]=E(100*r[2])+"%","hsla"===n||r.length>3&&r[3]<1?(r[3]=r.length>3?r[3]:1,n="hsla"):r.length=3,n+"("+r.join(",")+")"},R=c.unpack,I=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=(e=R(e,"rgba"))[0],n=e[1],i=e[2];r/=255,n/=255,i/=255;var o,a,s=Math.min(r,n,i),l=Math.max(r,n,i),u=(l+s)/2;return l===s?(o=0,a=Number.NaN):o=u<.5?(l-s)/(l+s):(l-s)/(2-l-s),r==l?a=(n-i)/(l-s):n==l?a=2+(i-r)/(l-s):i==l&&(a=4+(r-n)/(l-s)),(a*=60)<0&&(a+=360),e.length>3&&void 0!==e[3]?[a,o,u,e[3]]:[a,o,u]},M=c.unpack,q=c.last,L=P,N=I,z=Math.round,B=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=M(e,"rgba"),n=q(e)||"rgb";return"hsl"==n.substr(0,3)?L(N(r),n):(r[0]=z(r[0]),r[1]=z(r[1]),r[2]=z(r[2]),("rgba"===n||r.length>3&&r[3]<1)&&(r[3]=r.length>3?r[3]:1,n="rgba"),n+"("+r.slice(0,"rgb"===n?3:4).join(",")+")")},U=c.unpack,V=Math.round,W=function(){for(var e,t=[],r=arguments.length;r--;)t[r]=arguments[r];var n,i,o,a=(t=U(t,"hsl"))[0],s=t[1],l=t[2];if(0===s)n=i=o=255*l;else{var u=[0,0,0],c=[0,0,0],d=l<.5?l*(1+s):l+s-l*s,f=2*l-d,p=a/360;u[0]=p+1/3,u[1]=p,u[2]=p-1/3;for(var h=0;h<3;h++)u[h]<0&&(u[h]+=1),u[h]>1&&(u[h]-=1),6*u[h]<1?c[h]=f+6*(d-f)*u[h]:2*u[h]<1?c[h]=d:3*u[h]<2?c[h]=f+(d-f)*(2/3-u[h])*6:c[h]=f;n=(e=[V(255*c[0]),V(255*c[1]),V(255*c[2])])[0],i=e[1],o=e[2]}return t.length>3?[n,i,o,t[3]]:[n,i,o,1]},G=W,Y=d,H=/^rgb\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*\)$/,K=/^rgba\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*,\s*([01]|[01]?\.\d+)\)$/,X=/^rgb\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,Z=/^rgba\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,Q=/^hsl\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,J=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,ee=Math.round,te=function(e){var t;if(e=e.toLowerCase().trim(),Y.format.named)try{return Y.format.named(e)}catch(e){}if(t=e.match(H)){for(var r=t.slice(1,4),n=0;n<3;n++)r[n]=+r[n];return r[3]=1,r}if(t=e.match(K)){for(var i=t.slice(1,5),o=0;o<4;o++)i[o]=+i[o];return i}if(t=e.match(X)){for(var a=t.slice(1,4),s=0;s<3;s++)a[s]=ee(2.55*a[s]);return a[3]=1,a}if(t=e.match(Z)){for(var l=t.slice(1,5),u=0;u<3;u++)l[u]=ee(2.55*l[u]);return l[3]=+l[3],l}if(t=e.match(Q)){var c=t.slice(1,4);c[1]*=.01,c[2]*=.01;var d=G(c);return d[3]=1,d}if(t=e.match(J)){var f=t.slice(1,4);f[1]*=.01,f[2]*=.01;var p=G(f);return p[3]=+t[4],p}};te.test=function(e){return H.test(e)||K.test(e)||X.test(e)||Z.test(e)||Q.test(e)||J.test(e)};var re=b,ne=y,ie=d,oe=c.type,ae=B,se=te;ne.prototype.css=function(e){return ae(this._rgb,e)},re.css=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(ne,[null].concat(e,["css"])))},ie.format.css=se,ie.autodetect.push({p:5,test:function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];if(!t.length&&"string"===oe(e)&&se.test(e))return"css"}});var le=y,ue=b,ce=c.unpack;d.format.gl=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=ce(e,"rgba");return r[0]*=255,r[1]*=255,r[2]*=255,r},ue.gl=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(le,[null].concat(e,["gl"])))},le.prototype.gl=function(){var e=this._rgb;return[e[0]/255,e[1]/255,e[2]/255,e[3]]};var de=c.unpack,fe=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r,n=de(e,"rgb"),i=n[0],o=n[1],a=n[2],s=Math.min(i,o,a),l=Math.max(i,o,a),u=l-s,c=100*u/255,d=s/(255-u)*100;return 0===u?r=Number.NaN:(i===l&&(r=(o-a)/u),o===l&&(r=2+(a-i)/u),a===l&&(r=4+(i-o)/u),(r*=60)<0&&(r+=360)),[r,c,d]},pe=c.unpack,he=Math.floor,me=function(){for(var e,t,r,n,i,o,a=[],s=arguments.length;s--;)a[s]=arguments[s];var l,u,c,d=(a=pe(a,"hcg"))[0],f=a[1],p=a[2];p*=255;var h=255*f;if(0===f)l=u=c=p;else{360===d&&(d=0),d>360&&(d-=360),d<0&&(d+=360);var m=he(d/=60),g=d-m,y=p*(1-f),v=y+h*(1-g),b=y+h*g,_=y+h;switch(m){case 0:l=(e=[_,b,y])[0],u=e[1],c=e[2];break;case 1:l=(t=[v,_,y])[0],u=t[1],c=t[2];break;case 2:l=(r=[y,_,b])[0],u=r[1],c=r[2];break;case 3:l=(n=[y,v,_])[0],u=n[1],c=n[2];break;case 4:l=(i=[b,y,_])[0],u=i[1],c=i[2];break;case 5:l=(o=[_,y,v])[0],u=o[1],c=o[2]}}return[l,u,c,a.length>3?a[3]:1]},ge=c.unpack,ye=c.type,ve=b,be=y,_e=d,we=fe;be.prototype.hcg=function(){return we(this._rgb)},ve.hcg=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(be,[null].concat(e,["hcg"])))},_e.format.hcg=me,_e.autodetect.push({p:1,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=ge(e,"hcg"),"array"===ye(e)&&3===e.length)return"hcg"}});var xe=c.unpack,Ae=c.last,je=Math.round,Se=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=xe(e,"rgba"),n=r[0],i=r[1],o=r[2],a=r[3],s=Ae(e)||"auto";void 0===a&&(a=1),"auto"===s&&(s=a<1?"rgba":"rgb");var l="000000"+((n=je(n))<<16|(i=je(i))<<8|(o=je(o))).toString(16);l=l.substr(l.length-6);var u="0"+je(255*a).toString(16);switch(u=u.substr(u.length-2),s.toLowerCase()){case"rgba":return"#"+l+u;case"argb":return"#"+u+l;default:return"#"+l}},ke=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,Ce=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,$e=function(e){if(e.match(ke)){4!==e.length&&7!==e.length||(e=e.substr(1)),3===e.length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]);var t=parseInt(e,16);return[t>>16,t>>8&255,255&t,1]}if(e.match(Ce)){5!==e.length&&9!==e.length||(e=e.substr(1)),4===e.length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);var r=parseInt(e,16);return[r>>24&255,r>>16&255,r>>8&255,Math.round((255&r)/255*100)/100]}throw new Error("unknown hex color: "+e)},Oe=b,Fe=y,Te=c.type,De=d,Ee=Se;Fe.prototype.hex=function(e){return Ee(this._rgb,e)},Oe.hex=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(Fe,[null].concat(e,["hex"])))},De.format.hex=$e,De.autodetect.push({p:4,test:function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];if(!t.length&&"string"===Te(e)&&[3,4,5,6,7,8,9].indexOf(e.length)>=0)return"hex"}});var Pe=c.unpack,Re=c.TWOPI,Ie=Math.min,Me=Math.sqrt,qe=Math.acos,Le=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r,n=Pe(e,"rgb"),i=n[0],o=n[1],a=n[2],s=Ie(i/=255,o/=255,a/=255),l=(i+o+a)/3,u=l>0?1-s/l:0;return 0===u?r=NaN:(r=(i-o+(i-a))/2,r/=Me((i-o)*(i-o)+(i-a)*(o-a)),r=qe(r),a>o&&(r=Re-r),r/=Re),[360*r,u,l]},Ne=c.unpack,ze=c.limit,Be=c.TWOPI,Ue=c.PITHIRD,Ve=Math.cos,We=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r,n,i,o=(e=Ne(e,"hsi"))[0],a=e[1],s=e[2];return isNaN(o)&&(o=0),isNaN(a)&&(a=0),o>360&&(o-=360),o<0&&(o+=360),(o/=360)<1/3?n=1-((i=(1-a)/3)+(r=(1+a*Ve(Be*o)/Ve(Ue-Be*o))/3)):o<2/3?i=1-((r=(1-a)/3)+(n=(1+a*Ve(Be*(o-=1/3))/Ve(Ue-Be*o))/3)):r=1-((n=(1-a)/3)+(i=(1+a*Ve(Be*(o-=2/3))/Ve(Ue-Be*o))/3)),[255*(r=ze(s*r*3)),255*(n=ze(s*n*3)),255*(i=ze(s*i*3)),e.length>3?e[3]:1]},Ge=c.unpack,Ye=c.type,He=b,Ke=y,Xe=d,Ze=Le;Ke.prototype.hsi=function(){return Ze(this._rgb)},He.hsi=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(Ke,[null].concat(e,["hsi"])))},Xe.format.hsi=We,Xe.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=Ge(e,"hsi"),"array"===Ye(e)&&3===e.length)return"hsi"}});var Qe=c.unpack,Je=c.type,et=b,tt=y,rt=d,nt=I;tt.prototype.hsl=function(){return nt(this._rgb)},et.hsl=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(tt,[null].concat(e,["hsl"])))},rt.format.hsl=W,rt.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=Qe(e,"hsl"),"array"===Je(e)&&3===e.length)return"hsl"}});var it=c.unpack,ot=Math.min,at=Math.max,st=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r,n,i,o=(e=it(e,"rgb"))[0],a=e[1],s=e[2],l=ot(o,a,s),u=at(o,a,s),c=u-l;return i=u/255,0===u?(r=Number.NaN,n=0):(n=c/u,o===u&&(r=(a-s)/c),a===u&&(r=2+(s-o)/c),s===u&&(r=4+(o-a)/c),(r*=60)<0&&(r+=360)),[r,n,i]},lt=c.unpack,ut=Math.floor,ct=function(){for(var e,t,r,n,i,o,a=[],s=arguments.length;s--;)a[s]=arguments[s];var l,u,c,d=(a=lt(a,"hsv"))[0],f=a[1],p=a[2];if(p*=255,0===f)l=u=c=p;else{360===d&&(d=0),d>360&&(d-=360),d<0&&(d+=360);var h=ut(d/=60),m=d-h,g=p*(1-f),y=p*(1-f*m),v=p*(1-f*(1-m));switch(h){case 0:l=(e=[p,v,g])[0],u=e[1],c=e[2];break;case 1:l=(t=[y,p,g])[0],u=t[1],c=t[2];break;case 2:l=(r=[g,p,v])[0],u=r[1],c=r[2];break;case 3:l=(n=[g,y,p])[0],u=n[1],c=n[2];break;case 4:l=(i=[v,g,p])[0],u=i[1],c=i[2];break;case 5:l=(o=[p,g,y])[0],u=o[1],c=o[2]}}return[l,u,c,a.length>3?a[3]:1]},dt=c.unpack,ft=c.type,pt=b,ht=y,mt=d,gt=st;ht.prototype.hsv=function(){return gt(this._rgb)},pt.hsv=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(ht,[null].concat(e,["hsv"])))},mt.format.hsv=ct,mt.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=dt(e,"hsv"),"array"===ft(e)&&3===e.length)return"hsv"}});var yt={Kn:18,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452},vt=yt,bt=c.unpack,_t=Math.pow,wt=function(e){return(e/=255)<=.04045?e/12.92:_t((e+.055)/1.055,2.4)},xt=function(e){return e>vt.t3?_t(e,1/3):e/vt.t2+vt.t0},At=function(e,t,r){return e=wt(e),t=wt(t),r=wt(r),[xt((.4124564*e+.3575761*t+.1804375*r)/vt.Xn),xt((.2126729*e+.7151522*t+.072175*r)/vt.Yn),xt((.0193339*e+.119192*t+.9503041*r)/vt.Zn)]},jt=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=bt(e,"rgb"),n=r[0],i=r[1],o=r[2],a=At(n,i,o),s=a[0],l=a[1],u=116*l-16;return[u<0?0:u,500*(s-l),200*(l-a[2])]},St=yt,kt=c.unpack,Ct=Math.pow,$t=function(e){return 255*(e<=.00304?12.92*e:1.055*Ct(e,1/2.4)-.055)},Ot=function(e){return e>St.t1?e*e*e:St.t2*(e-St.t0)},Ft=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r,n,i,o=(e=kt(e,"lab"))[0],a=e[1],s=e[2];return n=(o+16)/116,r=isNaN(a)?n:n+a/500,i=isNaN(s)?n:n-s/200,n=St.Yn*Ot(n),r=St.Xn*Ot(r),i=St.Zn*Ot(i),[$t(3.2404542*r-1.5371385*n-.4985314*i),$t(-.969266*r+1.8760108*n+.041556*i),$t(.0556434*r-.2040259*n+1.0572252*i),e.length>3?e[3]:1]},Tt=c.unpack,Dt=c.type,Et=b,Pt=y,Rt=d,It=jt;Pt.prototype.lab=function(){return It(this._rgb)},Et.lab=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(Pt,[null].concat(e,["lab"])))},Rt.format.lab=Ft,Rt.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=Tt(e,"lab"),"array"===Dt(e)&&3===e.length)return"lab"}});var Mt=c.unpack,qt=c.RAD2DEG,Lt=Math.sqrt,Nt=Math.atan2,zt=Math.round,Bt=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=Mt(e,"lab"),n=r[0],i=r[1],o=r[2],a=Lt(i*i+o*o),s=(Nt(o,i)*qt+360)%360;return 0===zt(1e4*a)&&(s=Number.NaN),[n,a,s]},Ut=c.unpack,Vt=jt,Wt=Bt,Gt=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=Ut(e,"rgb"),n=r[0],i=r[1],o=r[2],a=Vt(n,i,o),s=a[0],l=a[1],u=a[2];return Wt(s,l,u)},Yt=c.unpack,Ht=c.DEG2RAD,Kt=Math.sin,Xt=Math.cos,Zt=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=Yt(e,"lch"),n=r[0],i=r[1],o=r[2];return isNaN(o)&&(o=0),[n,Xt(o*=Ht)*i,Kt(o)*i]},Qt=c.unpack,Jt=Zt,er=Ft,tr=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=(e=Qt(e,"lch"))[0],n=e[1],i=e[2],o=Jt(r,n,i),a=o[0],s=o[1],l=o[2],u=er(a,s,l);return[u[0],u[1],u[2],e.length>3?e[3]:1]},rr=c.unpack,nr=tr,ir=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=rr(e,"hcl").reverse();return nr.apply(void 0,r)},or=c.unpack,ar=c.type,sr=b,lr=y,ur=d,cr=Gt;lr.prototype.lch=function(){return cr(this._rgb)},lr.prototype.hcl=function(){return cr(this._rgb).reverse()},sr.lch=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(lr,[null].concat(e,["lch"])))},sr.hcl=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(lr,[null].concat(e,["hcl"])))},ur.format.lch=tr,ur.format.hcl=ir,["lch","hcl"].forEach((function(e){return ur.autodetect.push({p:2,test:function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(t=or(t,e),"array"===ar(t)&&3===t.length)return e}})}));var dr={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflower:"#6495ed",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},fr=d,pr=c.type,hr=dr,mr=$e,gr=Se;y.prototype.name=function(){for(var e=gr(this._rgb,"rgb"),t=0,r=Object.keys(hr);t<r.length;t+=1){var n=r[t];if(hr[n]===e)return n.toLowerCase()}return e},fr.format.named=function(e){if(e=e.toLowerCase(),hr[e])return mr(hr[e]);throw new Error("unknown color name: "+e)},fr.autodetect.push({p:5,test:function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];if(!t.length&&"string"===pr(e)&&hr[e.toLowerCase()])return"named"}});var yr=c.unpack,vr=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=yr(e,"rgb");return(r[0]<<16)+(r[1]<<8)+r[2]},br=c.type,_r=b,wr=y,xr=d,Ar=c.type,jr=vr;wr.prototype.num=function(){return jr(this._rgb)},_r.num=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(wr,[null].concat(e,["num"])))},xr.format.num=function(e){if("number"==br(e)&&e>=0&&e<=16777215)return[e>>16,e>>8&255,255&e,1];throw new Error("unknown num color: "+e)},xr.autodetect.push({p:5,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(1===e.length&&"number"===Ar(e[0])&&e[0]>=0&&e[0]<=16777215)return"num"}});var Sr=b,kr=y,Cr=d,$r=c.unpack,Or=c.type,Fr=Math.round;kr.prototype.rgb=function(e){return void 0===e&&(e=!0),!1===e?this._rgb.slice(0,3):this._rgb.slice(0,3).map(Fr)},kr.prototype.rgba=function(e){return void 0===e&&(e=!0),this._rgb.slice(0,4).map((function(t,r){return r<3?!1===e?t:Fr(t):t}))},Sr.rgb=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(kr,[null].concat(e,["rgb"])))},Cr.format.rgb=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=$r(e,"rgba");return void 0===r[3]&&(r[3]=1),r},Cr.autodetect.push({p:3,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=$r(e,"rgba"),"array"===Or(e)&&(3===e.length||4===e.length&&"number"==Or(e[3])&&e[3]>=0&&e[3]<=1))return"rgb"}});var Tr=Math.log,Dr=function(e){var t,r,n,i=e/100;return i<66?(t=255,r=i<6?0:-155.25485562709179-.44596950469579133*(r=i-2)+104.49216199393888*Tr(r),n=i<20?0:.8274096064007395*(n=i-10)-254.76935184120902+115.67994401066147*Tr(n)):(t=351.97690566805693+.114206453784165*(t=i-55)-40.25366309332127*Tr(t),r=325.4494125711974+.07943456536662342*(r=i-50)-28.0852963507957*Tr(r),n=255),[t,r,n,1]},Er=Dr,Pr=c.unpack,Rr=Math.round,Ir=b,Mr=y,qr=d,Lr=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var r,n=Pr(e,"rgb"),i=n[0],o=n[2],a=1e3,s=4e4;s-a>.4;){var l=Er(r=.5*(s+a));l[2]/l[0]>=o/i?s=r:a=r}return Rr(r)};Mr.prototype.temp=Mr.prototype.kelvin=Mr.prototype.temperature=function(){return Lr(this._rgb)},Ir.temp=Ir.kelvin=Ir.temperature=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(Mr,[null].concat(e,["temp"])))},qr.format.temp=qr.format.kelvin=qr.format.temperature=Dr;var Nr=c.unpack,zr=Math.cbrt,Br=Math.pow,Ur=Math.sign,Vr=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=Nr(e,"rgb"),n=r[0],i=r[1],o=r[2],a=[Wr(n/255),Wr(i/255),Wr(o/255)],s=a[0],l=a[1],u=a[2],c=zr(.4122214708*s+.5363325363*l+.0514459929*u),d=zr(.2119034982*s+.6806995451*l+.1073969566*u),f=zr(.0883024619*s+.2817188376*l+.6299787005*u);return[.2104542553*c+.793617785*d-.0040720468*f,1.9779984951*c-2.428592205*d+.4505937099*f,.0259040371*c+.7827717662*d-.808675766*f]};function Wr(e){var t=Math.abs(e);return t<.04045?e/12.92:(Ur(e)||1)*Br((t+.055)/1.055,2.4)}var Gr=c.unpack,Yr=Math.pow,Hr=Math.sign,Kr=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=(e=Gr(e,"lab"))[0],n=e[1],i=e[2],o=Yr(r+.3963377774*n+.2158037573*i,3),a=Yr(r-.1055613458*n-.0638541728*i,3),s=Yr(r-.0894841775*n-1.291485548*i,3);return[255*Xr(4.0767416621*o-3.3077115913*a+.2309699292*s),255*Xr(-1.2684380046*o+2.6097574011*a-.3413193965*s),255*Xr(-.0041960863*o-.7034186147*a+1.707614701*s),e.length>3?e[3]:1]};function Xr(e){var t=Math.abs(e);return t>.0031308?(Hr(e)||1)*(1.055*Yr(t,1/2.4)-.055):12.92*e}var Zr=c.unpack,Qr=c.type,Jr=b,en=y,tn=d,rn=Vr;en.prototype.oklab=function(){return rn(this._rgb)},Jr.oklab=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(en,[null].concat(e,["oklab"])))},tn.format.oklab=Kr,tn.autodetect.push({p:3,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=Zr(e,"oklab"),"array"===Qr(e)&&3===e.length)return"oklab"}});var nn=c.unpack,on=Vr,an=Bt,sn=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=nn(e,"rgb"),n=r[0],i=r[1],o=r[2],a=on(n,i,o),s=a[0],l=a[1],u=a[2];return an(s,l,u)},ln=c.unpack,un=Zt,cn=Kr,dn=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=(e=ln(e,"lch"))[0],n=e[1],i=e[2],o=un(r,n,i),a=o[0],s=o[1],l=o[2],u=cn(a,s,l);return[u[0],u[1],u[2],e.length>3?e[3]:1]},fn=c.unpack,pn=c.type,hn=b,mn=y,gn=d,yn=sn;mn.prototype.oklch=function(){return yn(this._rgb)},hn.oklch=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(mn,[null].concat(e,["oklch"])))},gn.format.oklch=dn,gn.autodetect.push({p:3,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=fn(e,"oklch"),"array"===pn(e)&&3===e.length)return"oklch"}});var vn=y,bn=c.type;vn.prototype.alpha=function(e,t){return void 0===t&&(t=!1),void 0!==e&&"number"===bn(e)?t?(this._rgb[3]=e,this):new vn([this._rgb[0],this._rgb[1],this._rgb[2],e],"rgb"):this._rgb[3]},y.prototype.clipped=function(){return this._rgb._clipped||!1};var _n=y,wn=yt;_n.prototype.darken=function(e){void 0===e&&(e=1);var t=this.lab();return t[0]-=wn.Kn*e,new _n(t,"lab").alpha(this.alpha(),!0)},_n.prototype.brighten=function(e){return void 0===e&&(e=1),this.darken(-e)},_n.prototype.darker=_n.prototype.darken,_n.prototype.brighter=_n.prototype.brighten,y.prototype.get=function(e){var t=e.split("."),r=t[0],n=t[1],i=this[r]();if(n){var o=r.indexOf(n)-("ok"===r.substr(0,2)?2:0);if(o>-1)return i[o];throw new Error("unknown channel "+n+" in mode "+r)}return i};var xn=y,An=c.type,jn=Math.pow;xn.prototype.luminance=function(e){if(void 0!==e&&"number"===An(e)){if(0===e)return new xn([0,0,0,this._rgb[3]],"rgb");if(1===e)return new xn([255,255,255,this._rgb[3]],"rgb");var t=this.luminance(),r=20,n=function(t,i){var o=t.interpolate(i,.5,"rgb"),a=o.luminance();return Math.abs(e-a)<1e-7||!r--?o:a>e?n(t,o):n(o,i)},i=(t>e?n(new xn([0,0,0]),this):n(this,new xn([255,255,255]))).rgb();return new xn(i.concat([this._rgb[3]]))}return Sn.apply(void 0,this._rgb.slice(0,3))};var Sn=function(e,t,r){return.2126*(e=kn(e))+.7152*(t=kn(t))+.0722*kn(r)},kn=function(e){return(e/=255)<=.03928?e/12.92:jn((e+.055)/1.055,2.4)},Cn={},$n=y,On=c.type,Fn=Cn,Tn=function(e,t,r){void 0===r&&(r=.5);for(var n=[],i=arguments.length-3;i-- >0;)n[i]=arguments[i+3];var o=n[0]||"lrgb";if(Fn[o]||n.length||(o=Object.keys(Fn)[0]),!Fn[o])throw new Error("interpolation mode "+o+" is not defined");return"object"!==On(e)&&(e=new $n(e)),"object"!==On(t)&&(t=new $n(t)),Fn[o](e,t,r).alpha(e.alpha()+r*(t.alpha()-e.alpha()))},Dn=y,En=Tn;Dn.prototype.mix=Dn.prototype.interpolate=function(e,t){void 0===t&&(t=.5);for(var r=[],n=arguments.length-2;n-- >0;)r[n]=arguments[n+2];return En.apply(void 0,[this,e,t].concat(r))};var Pn=y;Pn.prototype.premultiply=function(e){void 0===e&&(e=!1);var t=this._rgb,r=t[3];return e?(this._rgb=[t[0]*r,t[1]*r,t[2]*r,r],this):new Pn([t[0]*r,t[1]*r,t[2]*r,r],"rgb")};var Rn=y,In=yt;Rn.prototype.saturate=function(e){void 0===e&&(e=1);var t=this.lch();return t[1]+=In.Kn*e,t[1]<0&&(t[1]=0),new Rn(t,"lch").alpha(this.alpha(),!0)},Rn.prototype.desaturate=function(e){return void 0===e&&(e=1),this.saturate(-e)};var Mn=y,qn=c.type;Mn.prototype.set=function(e,t,r){void 0===r&&(r=!1);var n=e.split("."),i=n[0],o=n[1],a=this[i]();if(o){var s=i.indexOf(o)-("ok"===i.substr(0,2)?2:0);if(s>-1){if("string"==qn(t))switch(t.charAt(0)){case"+":case"-":a[s]+=+t;break;case"*":a[s]*=+t.substr(1);break;case"/":a[s]/=+t.substr(1);break;default:a[s]=+t}else{if("number"!==qn(t))throw new Error("unsupported value for Color.set");a[s]=t}var l=new Mn(a,i);return r?(this._rgb=l._rgb,this):l}throw new Error("unknown channel "+o+" in mode "+i)}return a};var Ln=y;Cn.rgb=function(e,t,r){var n=e._rgb,i=t._rgb;return new Ln(n[0]+r*(i[0]-n[0]),n[1]+r*(i[1]-n[1]),n[2]+r*(i[2]-n[2]),"rgb")};var Nn=y,zn=Math.sqrt,Bn=Math.pow;Cn.lrgb=function(e,t,r){var n=e._rgb,i=n[0],o=n[1],a=n[2],s=t._rgb,l=s[0],u=s[1],c=s[2];return new Nn(zn(Bn(i,2)*(1-r)+Bn(l,2)*r),zn(Bn(o,2)*(1-r)+Bn(u,2)*r),zn(Bn(a,2)*(1-r)+Bn(c,2)*r),"rgb")};var Un=y;Cn.lab=function(e,t,r){var n=e.lab(),i=t.lab();return new Un(n[0]+r*(i[0]-n[0]),n[1]+r*(i[1]-n[1]),n[2]+r*(i[2]-n[2]),"lab")};var Vn=y,Wn=function(e,t,r,n){var i,o,a,s,l,u,c,d,f,p,h,m,g;return"hsl"===n?(a=e.hsl(),s=t.hsl()):"hsv"===n?(a=e.hsv(),s=t.hsv()):"hcg"===n?(a=e.hcg(),s=t.hcg()):"hsi"===n?(a=e.hsi(),s=t.hsi()):"lch"===n||"hcl"===n?(n="hcl",a=e.hcl(),s=t.hcl()):"oklch"===n&&(a=e.oklch().reverse(),s=t.oklch().reverse()),"h"!==n.substr(0,1)&&"oklch"!==n||(l=(i=a)[0],c=i[1],f=i[2],u=(o=s)[0],d=o[1],p=o[2]),isNaN(l)||isNaN(u)?isNaN(l)?isNaN(u)?m=Number.NaN:(m=u,1!=f&&0!=f||"hsv"==n||(h=d)):(m=l,1!=p&&0!=p||"hsv"==n||(h=c)):m=l+r*(u>l&&u-l>180?u-(l+360):u<l&&l-u>180?u+360-l:u-l),void 0===h&&(h=c+r*(d-c)),g=f+r*(p-f),new Vn("oklch"===n?[g,h,m]:[m,h,g],n)},Gn=Wn,Yn=function(e,t,r){return Gn(e,t,r,"lch")};Cn.lch=Yn,Cn.hcl=Yn;var Hn=y;Cn.num=function(e,t,r){var n=e.num(),i=t.num();return new Hn(n+r*(i-n),"num")};var Kn=Wn;Cn.hcg=function(e,t,r){return Kn(e,t,r,"hcg")};var Xn=Wn;Cn.hsi=function(e,t,r){return Xn(e,t,r,"hsi")};var Zn=Wn;Cn.hsl=function(e,t,r){return Zn(e,t,r,"hsl")};var Qn=Wn;Cn.hsv=function(e,t,r){return Qn(e,t,r,"hsv")};var Jn=y;Cn.oklab=function(e,t,r){var n=e.oklab(),i=t.oklab();return new Jn(n[0]+r*(i[0]-n[0]),n[1]+r*(i[1]-n[1]),n[2]+r*(i[2]-n[2]),"oklab")};var ei=Wn;Cn.oklch=function(e,t,r){return ei(e,t,r,"oklch")};var ti=y,ri=c.clip_rgb,ni=Math.pow,ii=Math.sqrt,oi=Math.PI,ai=Math.cos,si=Math.sin,li=Math.atan2,ui=function(e,t){for(var r=e.length,n=[0,0,0,0],i=0;i<e.length;i++){var o=e[i],a=t[i]/r,s=o._rgb;n[0]+=ni(s[0],2)*a,n[1]+=ni(s[1],2)*a,n[2]+=ni(s[2],2)*a,n[3]+=s[3]*a}return n[0]=ii(n[0]),n[1]=ii(n[1]),n[2]=ii(n[2]),n[3]>.9999999&&(n[3]=1),new ti(ri(n))},ci=b,di=c.type,fi=Math.pow,pi=function(e){var t="rgb",r=ci("#ccc"),n=0,i=[0,1],o=[],a=[0,0],s=!1,l=[],u=!1,c=0,d=1,f=!1,p={},h=!0,m=1,g=function(e){if((e=e||["#fff","#000"])&&"string"===di(e)&&ci.brewer&&ci.brewer[e.toLowerCase()]&&(e=ci.brewer[e.toLowerCase()]),"array"===di(e)){1===e.length&&(e=[e[0],e[0]]),e=e.slice(0);for(var t=0;t<e.length;t++)e[t]=ci(e[t]);o.length=0;for(var r=0;r<e.length;r++)o.push(r/(e.length-1))}return _(),l=e},y=function(e){return e},v=function(e){return e},b=function(e,n){var i,u;if(null==n&&(n=!1),isNaN(e)||null===e)return r;u=n?e:s&&s.length>2?function(e){if(null!=s){for(var t=s.length-1,r=0;r<t&&e>=s[r];)r++;return r-1}return 0}(e)/(s.length-2):d!==c?(e-c)/(d-c):1,u=v(u),n||(u=y(u)),1!==m&&(u=fi(u,m)),u=a[0]+u*(1-a[0]-a[1]),u=Math.min(1,Math.max(0,u));var f=Math.floor(1e4*u);if(h&&p[f])i=p[f];else{if("array"===di(l))for(var g=0;g<o.length;g++){var b=o[g];if(u<=b){i=l[g];break}if(u>=b&&g===o.length-1){i=l[g];break}if(u>b&&u<o[g+1]){u=(u-b)/(o[g+1]-b),i=ci.interpolate(l[g],l[g+1],u,t);break}}else"function"===di(l)&&(i=l(u));h&&(p[f]=i)}return i},_=function(){return p={}};g(e);var w=function(e){var t=ci(b(e));return u&&t[u]?t[u]():t};return w.classes=function(e){if(null!=e){if("array"===di(e))s=e,i=[e[0],e[e.length-1]];else{var t=ci.analyze(i);s=0===e?[t.min,t.max]:ci.limits(t,"e",e)}return w}return s},w.domain=function(e){if(!arguments.length)return i;c=e[0],d=e[e.length-1],o=[];var t=l.length;if(e.length===t&&c!==d)for(var r=0,n=Array.from(e);r<n.length;r+=1){var a=n[r];o.push((a-c)/(d-c))}else{for(var s=0;s<t;s++)o.push(s/(t-1));if(e.length>2){var u=e.map((function(t,r){return r/(e.length-1)})),f=e.map((function(e){return(e-c)/(d-c)}));f.every((function(e,t){return u[t]===e}))||(v=function(e){if(e<=0||e>=1)return e;for(var t=0;e>=f[t+1];)t++;var r=(e-f[t])/(f[t+1]-f[t]);return u[t]+r*(u[t+1]-u[t])})}}return i=[c,d],w},w.mode=function(e){return arguments.length?(t=e,_(),w):t},w.range=function(e,t){return g(e),w},w.out=function(e){return u=e,w},w.spread=function(e){return arguments.length?(n=e,w):n},w.correctLightness=function(e){return null==e&&(e=!0),f=e,_(),y=f?function(e){for(var t=b(0,!0).lab()[0],r=b(1,!0).lab()[0],n=t>r,i=b(e,!0).lab()[0],o=t+(r-t)*e,a=i-o,s=0,l=1,u=20;Math.abs(a)>.01&&u-- >0;)n&&(a*=-1),a<0?(s=e,e+=.5*(l-e)):(l=e,e+=.5*(s-e)),a=(i=b(e,!0).lab()[0])-o;return e}:function(e){return e},w},w.padding=function(e){return null!=e?("number"===di(e)&&(e=[e,e]),a=e,w):a},w.colors=function(t,r){arguments.length<2&&(r="hex");var n=[];if(0===arguments.length)n=l.slice(0);else if(1===t)n=[w(.5)];else if(t>1){var o=i[0],a=i[1]-o;n=function(e,t,r){for(var n=[],i=e<t,o=r?i?t+1:t-1:t,a=e;i?a<o:a>o;i?a++:a--)n.push(a);return n}(0,t,!1).map((function(e){return w(o+e/(t-1)*a)}))}else{e=[];var u=[];if(s&&s.length>2)for(var c=1,d=s.length,f=1<=d;f?c<d:c>d;f?c++:c--)u.push(.5*(s[c-1]+s[c]));else u=i;n=u.map((function(e){return w(e)}))}return ci[r]&&(n=n.map((function(e){return e[r]()}))),n},w.cache=function(e){return null!=e?(h=e,w):h},w.gamma=function(e){return null!=e?(m=e,w):m},w.nodata=function(e){return null!=e?(r=ci(e),w):r},w};var hi=y,mi=pi,gi=b,yi=function(e,t,r){if(!yi[r])throw new Error("unknown blend mode "+r);return yi[r](e,t)},vi=function(e){return function(t,r){var n=gi(r).rgb(),i=gi(t).rgb();return gi.rgb(e(n,i))}},bi=function(e){return function(t,r){var n=[];return n[0]=e(t[0],r[0]),n[1]=e(t[1],r[1]),n[2]=e(t[2],r[2]),n}};yi.normal=vi(bi((function(e){return e}))),yi.multiply=vi(bi((function(e,t){return e*t/255}))),yi.screen=vi(bi((function(e,t){return 255*(1-(1-e/255)*(1-t/255))}))),yi.overlay=vi(bi((function(e,t){return t<128?2*e*t/255:255*(1-2*(1-e/255)*(1-t/255))}))),yi.darken=vi(bi((function(e,t){return e>t?t:e}))),yi.lighten=vi(bi((function(e,t){return e>t?e:t}))),yi.dodge=vi(bi((function(e,t){return 255===e||(e=t/255*255/(1-e/255))>255?255:e}))),yi.burn=vi(bi((function(e,t){return 255*(1-(1-t/255)/(e/255))})));for(var _i=yi,wi=c.type,xi=c.clip_rgb,Ai=c.TWOPI,ji=Math.pow,Si=Math.sin,ki=Math.cos,Ci=b,$i=y,Oi=Math.floor,Fi=Math.random,Ti=a,Di=Math.log,Ei=Math.pow,Pi=Math.floor,Ri=Math.abs,Ii=function(e,t){void 0===t&&(t=null);var r={min:Number.MAX_VALUE,max:-1*Number.MAX_VALUE,sum:0,values:[],count:0};return"object"===Ti(e)&&(e=Object.values(e)),e.forEach((function(e){t&&"object"===Ti(e)&&(e=e[t]),null==e||isNaN(e)||(r.values.push(e),r.sum+=e,e<r.min&&(r.min=e),e>r.max&&(r.max=e),r.count+=1)})),r.domain=[r.min,r.max],r.limits=function(e,t){return Mi(r,e,t)},r},Mi=function(e,t,r){void 0===t&&(t="equal"),void 0===r&&(r=7),"array"==Ti(e)&&(e=Ii(e));var n=e.min,i=e.max,o=e.values.sort((function(e,t){return e-t}));if(1===r)return[n,i];var a=[];if("c"===t.substr(0,1)&&(a.push(n),a.push(i)),"e"===t.substr(0,1)){a.push(n);for(var s=1;s<r;s++)a.push(n+s/r*(i-n));a.push(i)}else if("l"===t.substr(0,1)){if(n<=0)throw new Error("Logarithmic scales are only possible for values > 0");var l=Math.LOG10E*Di(n),u=Math.LOG10E*Di(i);a.push(n);for(var c=1;c<r;c++)a.push(Ei(10,l+c/r*(u-l)));a.push(i)}else if("q"===t.substr(0,1)){a.push(n);for(var d=1;d<r;d++){var f=(o.length-1)*d/r,p=Pi(f);if(p===f)a.push(o[p]);else{var h=f-p;a.push(o[p]*(1-h)+o[p+1]*h)}}a.push(i)}else if("k"===t.substr(0,1)){var m,g=o.length,y=new Array(g),v=new Array(r),b=!0,_=0,w=null;(w=[]).push(n);for(var x=1;x<r;x++)w.push(n+x/r*(i-n));for(w.push(i);b;){for(var A=0;A<r;A++)v[A]=0;for(var j=0;j<g;j++)for(var S=o[j],k=Number.MAX_VALUE,C=void 0,$=0;$<r;$++){var O=Ri(w[$]-S);O<k&&(k=O,C=$),v[C]++,y[j]=C}for(var F=new Array(r),T=0;T<r;T++)F[T]=null;for(var D=0;D<g;D++)null===F[m=y[D]]?F[m]=o[D]:F[m]+=o[D];for(var E=0;E<r;E++)F[E]*=1/v[E];b=!1;for(var P=0;P<r;P++)if(F[P]!==w[P]){b=!0;break}w=F,++_>200&&(b=!1)}for(var R={},I=0;I<r;I++)R[I]=[];for(var M=0;M<g;M++)R[m=y[M]].push(o[M]);for(var q=[],L=0;L<r;L++)q.push(R[L][0]),q.push(R[L][R[L].length-1]);q=q.sort((function(e,t){return e-t})),a.push(q[0]);for(var N=1;N<q.length;N+=2){var z=q[N];isNaN(z)||-1!==a.indexOf(z)||a.push(z)}}return a},qi={analyze:Ii,limits:Mi},Li=y,Ni=y,zi=Math.sqrt,Bi=Math.pow,Ui=Math.min,Vi=Math.max,Wi=Math.atan2,Gi=Math.abs,Yi=Math.cos,Hi=Math.sin,Ki=Math.exp,Xi=Math.PI,Zi=y,Qi=y,Ji=b,eo=pi,to={cool:function(){return eo([Ji.hsl(180,1,.9),Ji.hsl(250,.7,.4)])},hot:function(){return eo(["#000","#f00","#ff0","#fff"]).mode("rgb")}},ro={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},no=0,io=Object.keys(ro);no<io.length;no+=1){var oo=io[no];ro[oo.toLowerCase()]=ro[oo]}var ao=ro,so=b;return so.average=function(e,t,r){void 0===t&&(t="lrgb"),void 0===r&&(r=null);var n=e.length;r||(r=Array.from(new Array(n)).map((function(){return 1})));var i=n/r.reduce((function(e,t){return e+t}));if(r.forEach((function(e,t){r[t]*=i})),e=e.map((function(e){return new ti(e)})),"lrgb"===t)return ui(e,r);for(var o=e.shift(),a=o.get(t),s=[],l=0,u=0,c=0;c<a.length;c++)if(a[c]=(a[c]||0)*r[0],s.push(isNaN(a[c])?0:r[0]),"h"===t.charAt(c)&&!isNaN(a[c])){var d=a[c]/180*oi;l+=ai(d)*r[0],u+=si(d)*r[0]}var f=o.alpha()*r[0];e.forEach((function(e,n){var i=e.get(t);f+=e.alpha()*r[n+1];for(var o=0;o<a.length;o++)if(!isNaN(i[o]))if(s[o]+=r[n+1],"h"===t.charAt(o)){var c=i[o]/180*oi;l+=ai(c)*r[n+1],u+=si(c)*r[n+1]}else a[o]+=i[o]*r[n+1]}));for(var p=0;p<a.length;p++)if("h"===t.charAt(p)){for(var h=li(u/s[p],l/s[p])/oi*180;h<0;)h+=360;for(;h>=360;)h-=360;a[p]=h}else a[p]=a[p]/s[p];return f/=n,new ti(a,t).alpha(f>.99999?1:f,!0)},so.bezier=function(e){var t=function(e){var t,r,n,i,o,a,s;if(2===(e=e.map((function(e){return new hi(e)}))).length)t=e.map((function(e){return e.lab()})),o=t[0],a=t[1],i=function(e){var t=[0,1,2].map((function(t){return o[t]+e*(a[t]-o[t])}));return new hi(t,"lab")};else if(3===e.length)r=e.map((function(e){return e.lab()})),o=r[0],a=r[1],s=r[2],i=function(e){var t=[0,1,2].map((function(t){return(1-e)*(1-e)*o[t]+2*(1-e)*e*a[t]+e*e*s[t]}));return new hi(t,"lab")};else if(4===e.length){var l;n=e.map((function(e){return e.lab()})),o=n[0],a=n[1],s=n[2],l=n[3],i=function(e){var t=[0,1,2].map((function(t){return(1-e)*(1-e)*(1-e)*o[t]+3*(1-e)*(1-e)*e*a[t]+3*(1-e)*e*e*s[t]+e*e*e*l[t]}));return new hi(t,"lab")}}else{if(!(e.length>=5))throw new RangeError("No point in running bezier with only one color.");var u,c,d;u=e.map((function(e){return e.lab()})),d=e.length-1,c=function(e){for(var t=[1,1],r=1;r<e;r++){for(var n=[1],i=1;i<=t.length;i++)n[i]=(t[i]||0)+t[i-1];t=n}return t}(d),i=function(e){var t=1-e,r=[0,1,2].map((function(r){return u.reduce((function(n,i,o){return n+c[o]*Math.pow(t,d-o)*Math.pow(e,o)*i[r]}),0)}));return new hi(r,"lab")}}return i}(e);return t.scale=function(){return mi(t)},t},so.blend=_i,so.cubehelix=function(e,t,r,n,i){void 0===e&&(e=300),void 0===t&&(t=-1.5),void 0===r&&(r=1),void 0===n&&(n=1),void 0===i&&(i=[0,1]);var o,a=0;"array"===wi(i)?o=i[1]-i[0]:(o=0,i=[i,i]);var s=function(s){var l=Ai*((e+120)/360+t*s),u=ji(i[0]+o*s,n),c=(0!==a?r[0]+s*a:r)*u*(1-u)/2,d=ki(l),f=Si(l);return Ci(xi([255*(u+c*(-.14861*d+1.78277*f)),255*(u+c*(-.29227*d-.90649*f)),255*(u+c*(1.97294*d)),1]))};return s.start=function(t){return null==t?e:(e=t,s)},s.rotations=function(e){return null==e?t:(t=e,s)},s.gamma=function(e){return null==e?n:(n=e,s)},s.hue=function(e){return null==e?r:("array"===wi(r=e)?0==(a=r[1]-r[0])&&(r=r[1]):a=0,s)},s.lightness=function(e){return null==e?i:("array"===wi(e)?(i=e,o=e[1]-e[0]):(i=[e,e],o=0),s)},s.scale=function(){return Ci.scale(s)},s.hue(r),s},so.mix=so.interpolate=Tn,so.random=function(){for(var e="#",t=0;t<6;t++)e+="0123456789abcdef".charAt(Oi(16*Fi()));return new $i(e,"hex")},so.scale=pi,so.analyze=qi.analyze,so.contrast=function(e,t){e=new Li(e),t=new Li(t);var r=e.luminance(),n=t.luminance();return r>n?(r+.05)/(n+.05):(n+.05)/(r+.05)},so.deltaE=function(e,t,r,n,i){void 0===r&&(r=1),void 0===n&&(n=1),void 0===i&&(i=1);var o=function(e){return 360*e/(2*Xi)},a=function(e){return 2*Xi*e/360};e=new Ni(e),t=new Ni(t);var s=Array.from(e.lab()),l=s[0],u=s[1],c=s[2],d=Array.from(t.lab()),f=d[0],p=d[1],h=d[2],m=(l+f)/2,g=(zi(Bi(u,2)+Bi(c,2))+zi(Bi(p,2)+Bi(h,2)))/2,y=.5*(1-zi(Bi(g,7)/(Bi(g,7)+Bi(25,7)))),v=u*(1+y),b=p*(1+y),_=zi(Bi(v,2)+Bi(c,2)),w=zi(Bi(b,2)+Bi(h,2)),x=(_+w)/2,A=o(Wi(c,v)),j=o(Wi(h,b)),S=A>=0?A:A+360,k=j>=0?j:j+360,C=Gi(S-k)>180?(S+k+360)/2:(S+k)/2,$=1-.17*Yi(a(C-30))+.24*Yi(a(2*C))+.32*Yi(a(3*C+6))-.2*Yi(a(4*C-63)),O=k-S;O=Gi(O)<=180?O:k<=S?O+360:O-360,O=2*zi(_*w)*Hi(a(O)/2);var F=f-l,T=w-_,D=1+.015*Bi(m-50,2)/zi(20+Bi(m-50,2)),E=1+.045*x,P=1+.015*x*$,R=30*Ki(-Bi((C-275)/25,2)),I=-2*zi(Bi(x,7)/(Bi(x,7)+Bi(25,7)))*Hi(2*a(R)),M=zi(Bi(F/(r*D),2)+Bi(T/(n*E),2)+Bi(O/(i*P),2)+I*(T/(n*E))*(O/(i*P)));return Vi(0,Ui(100,M))},so.distance=function(e,t,r){void 0===r&&(r="lab"),e=new Zi(e),t=new Zi(t);var n=e.get(r),i=t.get(r),o=0;for(var a in n){var s=(n[a]||0)-(i[a]||0);o+=s*s}return Math.sqrt(o)},so.limits=qi.limits,so.valid=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];try{return new(Function.prototype.bind.apply(Qi,[null].concat(e))),!0}catch(e){return!1}},so.scales=to,so.colors=dr,so.brewer=ao,so}()}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n={};(()=>{r.d(n,{D:()=>bn});var e=r(635);const t=(r,n)=>(0,e.mergeWith)({},r,n,((r,n)=>(0,e.isArray)(n)?n:(0,e.isObject)(r)&&(0,e.isObject)(n)?t(r,n):n)),i={month:{publicName:"Monthly",dateFormat:"MMMM YYYY"},year:{publicName:"Yearly",dateFormat:"YYYY"},quarter:{publicName:"Per quarter",dateFormat:"quarter"},week:{publicName:"Weekly",dateFormat:"week"},day:{publicName:"Daily",dateFormat:"DD-MM-YYYY"},second:{publicName:"Per second",dateFormat:"hh:mm:ss"},hour:{publicName:"Hourly",dateFormat:"hh:mm"},minute:{publicName:"Per minute",dateFormat:"hh:mm"}},o=t=>{const r=(0,e.cloneDeep)(i);if(!t)return r;let n={};return t.forEach((e=>{if(!i[e])throw`Time trunc function ${e} not managed by Vizzly`;n[e]=i[e]})),n},a={">":{publicName:"Greater than",validDataTypes:["number","date_time"]},"<":{publicName:"Less than",validDataTypes:["number","date_time"]},"<=":{publicName:"Less than or equal to",validDataTypes:["number","date_time"]},">=":{publicName:"Greater than or equal to",validDataTypes:["number","date_time"]},"!=":{publicName:"Not equal to",validDataTypes:["number","date_time","boolean","string"]},is_one_of:{publicName:"Is one of",validDataTypes:["number","date_time","boolean","string"]},"=":{publicName:"Equal to",validDataTypes:["number","date_time","boolean","string"]},is_not_one_of:{publicName:"Is not one of",validDataTypes:["number","date_time","boolean","string"]},starts_with:{publicName:"Starts with",validDataTypes:["string"]},ends_with:{publicName:"Ends with",validDataTypes:["string"]},contains_substring:{publicName:"Contains text",validDataTypes:["string"]},does_not_contain_substring:{publicName:"Does not contain text",validDataTypes:["string"]},array_contains:{publicName:"Contains",validDataTypes:["string[]"]}},s=t=>{const r=(0,e.cloneDeep)(a);if(!t)return r;let n={};return t.forEach((e=>{if(!a[e])throw`Operator ${e} not managed by Vizzly`;n[e]=a[e]})),n},l=t=>t.map((t=>t.map((t=>"is_one_of"!=t.op&&"is_not_one_of"!=t.op||(0,e.isArray)(t.value)?t:Object.assign(Object.assign({},t),{value:[t.value]}))))),u=(e,t)=>e.map((e=>{let r=Object.assign(Object.assign({},e),{aggregate:void 0,function:e.function||e.aggregate});return delete r.aggregate,t&&r.field==t.field&&"none"==r.function&&(r.function=t.truncate),r})),c=e=>e.map((e=>{let t=Object.assign(Object.assign({},e),{aggregate:void 0,function:e.function||e.aggregate});return delete t.aggregate,t})),d=e=>"auto"===e||0===e||2===e?e:"auto",f=t=>{if(!t)return{};let r={};return t.measure&&Object.entries(t.measure).forEach((([e,t])=>{r&&(r[e]=c(t))})),{measure:(0,e.isEmpty)(r)?void 0:r,group:t.group}},p={mean:{publicName:"Mean",validDataTypes:["number"]},sum:{publicName:"Sum",validDataTypes:["number"]},min:{publicName:"Min",validDataTypes:["number"]},max:{publicName:"Max",validDataTypes:["number"]},count:{publicName:"Count",validDataTypes:["string","number","boolean","date_time","string[]"]},countDistinct:{publicName:"Unique",validDataTypes:["string","number","boolean","date_time"]}},h=t=>{const r=(0,e.cloneDeep)(p);if(!t)return r;let n={};return t.forEach((e=>{if(!p[e])throw`Aggregate ${e} not managed by Vizzly`;n[e]=p[e]})),n},m=["debug","info","warning","error"];const g=e=>m.findIndex((e=>"error"==e))<=m.findIndex((t=>e==t)),y=t=>t instanceof Error?t:(0,e.isObject)(t)||(0,e.isArray)(t)?JSON.stringify(t):t,v=(...e)=>{g("debug")&&console.info("[VIZZLY DEBUG]",...e.map(y))},b=(...e)=>{g("error")&&console.error("[VIZZLY ERROR]",...e.map(y))},_=(Object.keys(h()),(e,t)=>w(e,t)[0]),w=(e,t)=>{var r;let n=null!==(r=e.supportedAggregateOptions)&&void 0!==r?r:[],i=n.filter((r=>Object.keys(t).includes(r)&&t[r].validDataTypes.includes(e.dataType)));return 0===i.length?i=Object.keys(t).filter((r=>t[r].validDataTypes.includes(e.dataType))):i.sort(((e,t)=>n.indexOf(e)-n.indexOf(t))),i},x=(e,t)=>{const r=e.split("_"),n=r.pop();return[void 0,...Object.keys(t.supportedAggregates||{}),...Object.keys(t.supportedTimeTruncFunctions||{}),...Object.keys(t.supportedTransformationFunctions||{})].includes(n)?{field:r.join("_"),function:null!=n?n:""}:{field:e,function:"none"}},A=e=>e.map((e=>"string"==typeof e?{field:e,function:"none"}:e)),j={round_to_0_dp:{publicName:"Round to 0dp",validDataTypes:["number"]},round_to_2_dp:{publicName:"Round to 2dp",validDataTypes:["number"]}},S=t=>{const r=(0,e.cloneDeep)(j);if(!t)return r;let n={};return t.forEach((e=>{if(!j[e])throw`Transformation function ${e} is not managed by Vizzly`;n[e]=j[e]})),n},k=e=>(null==e?void 0:e.function)&&"none"!=(null==e?void 0:e.function)?`${e.field}_${e.function}`:null==e?void 0:e.field,C=x,$=(e,t,r)=>{if("measure"in e&&e.measure){const n=function(e,t){return Object.keys(e).map((e=>{const r=C(e,t);return(null==r?void 0:r.function)?r:null})).find((e=>null!==e))}(e.measure,r);if((null==n?void 0:n.function)&&n.field===t){const t=k(n);delete e.measure[t]}e.measure=O(e.measure,t)}if("group"in e&&e.group){const i=function(e,t){return Object.keys(e).map((e=>{const r=((e,t)=>{const r=e.split("_"),n=r.pop();return n&&(i=t,o=n,![...Object.keys(i),"none"].includes(o))?null:{field:r.join("_"),truncate:null!=n?n:""};var i,o})(e,t.supportedTimeTruncFunctions);return(null==r?void 0:r.truncate)?r:null})).find((e=>null!==e))}(e.group,r);if((null==i?void 0:i.truncate)&&i.field===t){const t=(null==(n=i)?void 0:n.truncate)&&"none"!=(null==n?void 0:n.truncate)?`${n.field}_${n.truncate}`:null==n?void 0:n.field;delete e.group[t]}else e.group.hasOwnProperty(t)&&delete e.group[t];e.group=O(e.group,t)}var n;return e};function O(e,t){const r={};for(const[n,i]of Object.entries(e))r[n]=i.filter((e=>(null==e?void 0:e.field)!==t));return r}const F=(t,r)=>{let n=(0,e.remove)(t.order,(t=>(0,e.some)(r,(e=>{const r=e.function==t.function,n=e.field==t.field;return r&&n}))));return Object.assign(Object.assign({},t),{order:n})},T=(t,r,n)=>{var i,o,a;let s=Object.assign({},t);if("measure"in s&&(0,e.remove)(s.measure,(e=>e.field==r)),"barMeasure"in s&&(0,e.remove)(s.barMeasure,(e=>e.field==r)),"lineMeasure"in s&&(0,e.remove)(s.lineMeasure,(e=>e.field==r)),"xMeasure"in s&&(null===(i=s.yMeasure)||void 0===i?void 0:i.field)==r&&(s.xMeasure=null),"yMeasure"in s&&(null===(o=s.yMeasure)||void 0===o?void 0:o.field)==r&&(s.yMeasure=null),"order"in s&&(0,e.remove)(s.order,(e=>e.field==r)),"dimension"in s&&(0,e.remove)(s.dimension,(e=>e.field==r)),"barDimension"in s&&(0,e.remove)(s.barDimension,(e=>e.field==r)),"lineDimension"in s&&(0,e.remove)(s.lineDimension,(e=>e.field==r)),"filter"in s&&s.filter.forEach((t=>{(0,e.remove)(t,(e=>e.field==r))})),"parameters"in s&&s.parameters&&n){const e=$(s.parameters,r,n);s.parameters=e}return"timeDimension"in s&&(null===(a=s.timeDimension)||void 0===a?void 0:a.field)==r&&(s.timeDimension=null),s},D=e=>{let t=[...e.measure];return e.dimension.forEach((e=>{t.push({field:e.field,function:e.function})})),e.timeDimension&&t.push({field:e.timeDimension.field,function:e.timeDimension.truncate}),F(e,t)},E=(e,r,n)=>{let i=t(e,r);const{value:o,error:a}=n.validate(i);if(a)throw a;return o};var P=r(903),R=r.n(P);R().object({fieldId:R().string().required(),dataSetId:R().string().required()});const I=e=>R().object({field:R().string().required(),function:R().valid(...Object.keys(e),"none")}),M=e=>R().object({field:R().string().required(),direction:R().string().valid("asc","desc").required(),function:R().string().valid(...Object.keys(e.supportedAggregates),...Object.keys(e.supportedTimeTruncFunctions),"none")}),q=e=>R().object({field:R().string().required(),truncate:R().valid(...Object.keys(e)),bucketFill:R().boolean()}),L=e=>R().array().items(R().object({field:R().string(),pivot:R().allow("x","y").optional(),function:R().valid("none",...Object.keys(e))})),N=e=>R().object({field:R().string().required(),op:R().string().valid(...Object.keys(e.supportedOperators)),value:R().any().required(),function:R().string()}),z=e=>R().array().items(R().array().items(N(e))),B=()=>R().number(),U={viewId:R().string().allow("").optional(),displayTitle:R().string().allow(""),displaySubject:R().string().allow(""),dataSetId:R().string(),protectedByOrganisation:R().boolean().optional()},V=R().valid("auto",2,0),W=e=>({measure:R().array().items(I(e.supportedAggregates)).required(),dimension:L(e.supportedTimeTruncFunctions).required(),drilldown:R().alternatives(L(e.supportedTimeTruncFunctions).required(),R().string()),order:R().array().items(M(e)),timeDimension:R().alternatives(q(e.supportedTimeTruncFunctions),R().valid(null)).required(),limit:B(),offset:R().number().min(0),filter:R().array().items(R().array().items(N(e))),xAxisPrefix:R().string().allow(""),yAxisPrefix:R().string().allow(""),xAxisPostfix:R().string().allow(""),yAxisPostfix:R().string().allow(""),yAxisFormat:R().alternatives(R().string(),R().valid(null)),xAxisFormat:R().alternatives(R().string(),R().valid(null)),approxYAxisLabelCount:V,approxXAxisLabelCount:V}),G=R().string().valid("natural","straight","step","stepBefore","stepAfter"),Y=()=>R().array().items(R().object({function:R().string().required(),field:R().string().required()})),H=()=>R().array().items(R().object({function:R().string(),truncate:R().string(),field:R().string().required(),bucketFill:R().boolean().optional(),pivot:R().string().valid("x","y").optional()})),K=e=>R().object().pattern(R().string(),R().alternatives().try(R().array().items(q(e.supportedTimeTruncFunctions)).min(1),L(e.supportedTimeTruncFunctions))).unknown(!0),X=e=>R().object().pattern(R().string(),R().array().items(I(e.supportedAggregates)).min(1)).unknown(!0),Z=e=>R().object({measure:X(e),group:K(e)}),Q=()=>R().array().items(R().object({color:R().string().required(),value:R().number().required(),strokeWidth:R().number().required(),strokeStyle:R().string().valid("dashed","solid").required(),label:R().boolean().optional()})),J=()=>R().object({x:R().string().allow(""),y:R().string().allow("")}),ee=R().object().pattern(R().string(),R().object({width:R().number().min(0),height:R().number().min(0)})),te=e=>R().object({filters:R().array().items(R().array().items(N(e)).required().max(1)).required().max(1),ruleValue:R().string().allow("").required(),ruleValueEnd:R().string().allow(""),ruleType:R().valid("backgroundColor","fontColor","lineColor","areaColor").required()}),re=R().object({field:R().string().required(),prefix:R().string().required()}),ne=e=>R().object(Object.assign(Object.assign(Object.assign({},U),W(e.queryEngineConfig)),{stacked:R().valid(!0,!1,"100%"),legend:R().valid(!0,!1),type:R().valid("barChart","horizontalBarChart"),conditionalFormattingRules:R().array().items(te(e.queryEngineConfig)),protectedFields:R().object({dimension:H(),measure:Y()}).unknown(!0),parameters:Z(e.queryEngineConfig),goalLines:Q(),axisTitles:J()})),ie=e=>(t,r)=>{let n=E(t,r,ne(e));return n=D(n),n};class oe extends Error{constructor(e){super(e),this.name="ValidationError"}}const ae=oe;class se extends ae{constructor(e){super(`Corrupt view. ${e.message}.\n\n ${JSON.stringify(e)}\n `),this.name="CorruptedView"}}r(455);const le=e=>"numeratorFilter"in e,ue=e=>"leftFieldId"in e&&"operator"in e&&"rightFieldId"in e,ce=e=>"roundToDecimalPlaces"in e,de=e=>"leftFieldId"in e&&"leftFunction"in e&&"operator"in e&&"rightFieldId"in e&&"rightFunction"in e,fe=e=>"denominatorFieldId"in e&&"denominatorAggregate"in e&&"numeratorFieldId"in e&&"numeratorAggregate"in e,pe=e=>"rules"in e,he=e=>{if("numeratorFilter"in e&&"numeratorFieldId"in e)return{id:e.id,canBeDimension:e.canBeDimension,canBeMeasure:e.canBeMeasure,denominatorAggregate:e.numeratorAggregate,denominatorFieldId:e.numeratorFieldId,publicName:e.publicName,dataType:e.dataType,allowedOperators:e.allowedOperators,numeratorFilter:e.numeratorFilter};if("leftAggregate"in e||"rightAggregate"in e){let t=Object.assign(Object.assign({},e),{rightFunction:e.rightFunction||e.rightAggregate,leftFunction:e.leftFunction||e.leftAggregate,leftNested:e.leftNested?Object.assign(Object.assign({},e.leftNested),{aggregate:void 0,function:e.leftNested.function||e.leftNested.aggregate}):void 0,rightNested:e.rightNested?Object.assign(Object.assign({},e.rightNested),{aggregate:void 0,function:e.rightNested.function||e.rightNested.aggregate}):void 0});return delete t.leftAggregate,delete t.rightAggregate,t.rightNested&&delete t.rightNested.aggregate,t.leftNested&&delete t.leftNested.aggregate,t}return e},me=e=>R().alternatives((e=>R().object({type:R().valid("function").required(),value:R().link("#Measure"),function:R().valid("none",...Object.keys(e.supportedAggregates))}))(e),R().object({type:R().valid("maths").required(),left:R().link("#Measure"),right:R().link("#Measure").required(),op:R().string().valid("+","*","/","-").required()}),R().object({type:R().valid("subquery").required(),value:R().object({measure:R().array().items(R().link("#Measure")),filter:R().array().items(R().array().items(R().link("#Filter")))})}),(e=>R().object({type:R().valid("field").required(),value:R().string().required(),function:R().valid("none",...Object.keys(e.supportedAggregates),...Object.keys(e.supportedTimeTruncFunctions),...Object.keys(e.supportedTransformationFunctions)).required()}))(e),R().object({type:"number",value:R().number()}),R().object({type:R().valid("switchField").required(),value:R().object({cases:R().array().items(R().object({returns:R().object({type:R().valid("string").required(),value:R().string().allow("").required()}),filter:R().array().items(R().array().items(R().link("#Filter")))}))})})).id("Measure"),ge=R().object({index:R().number().required()}),ye=R().object({index:R().number().required(),direction:R().string().valid("asc","desc").required()}),ve=(e,t)=>{let r=[R().valid(null)];return t.forEach((e=>{"boolean"==e&&(r=[...r,R().boolean()]),"string"!=e&&"string[]"!=e||(r=[...r,R().string()]),"number"==e&&(r=[...r,R().number()]),"date_time"==e&&(r=[...r,R().date().iso()])})),"is_one_of"==e||"is_not_one_of"==e?R().array().items(R().alternatives(r)):R().alternatives(r)},be=e=>R().object({field:me(e),op:R().string().valid(...Object.keys(e.supportedOperators)),value:R().alternatives().conditional("op",Object.keys(e.supportedOperators).map((t=>({is:t,then:ve(t,e.supportedOperators[t].validDataTypes)}))))}).id("Filter"),_e=e=>{const t=be(e);return R().object({type:R().valid("preparedQuery").required(),preparedQueryType:R().valid("uniqueArrayValues").required(),dataSetId:R().string().required(),fieldId:R().string().required(),filter:R().array().items(R().array().items(t))})},we=e=>{const t=be(e),r=me(e);return R().alternatives().conditional(".type",{is:"query",then:R().object({type:R().valid("query"),dataSetId:R().string().required(),measure:R().array().items(r).min(1).required(),group:R().array().items(ge).required(),filter:R().array().items(R().array().items(t)).required(),order:R().array().items(ye).required(),limit:B(),offset:R().number().optional()}).shared(t).shared(r)}).conditional(".type",{is:"preparedQuery",then:_e(e)})};we({origin:"query-engine",supportedFeatures:["simpleMaths","aggregateMaths","subquery","configManagerUi","switchField","roundedNumbers","sqlDefinedDataSet","encryptedDashboards"],supportedTimeTruncFunctions:o(["month","year","quarter","week","day","hour","minute","second"]),supportedAggregates:h(["sum","mean","min","max","count","countDistinct"]),supportedOperators:s([">","<","=","!=",">=","<=","is_one_of","is_not_one_of","starts_with","ends_with","contains_substring","does_not_contain_substring"]),supportedTransformationFunctions:S(["round_to_0_dp","round_to_2_dp"])}),we({origin:"query-engine",supportedFeatures:["simpleMaths","aggregateMaths","subquery","configManagerUi","sqlDefinedDataSet","roundedNumbers","switchField","encryptedDashboards"],supportedTimeTruncFunctions:o(["month","year","quarter","week","day","hour","minute","second"]),supportedAggregates:h(["sum","mean","min","max","count","countDistinct"]),supportedOperators:s([">","<","=","!=",">=","<=","is_one_of","is_not_one_of","starts_with","ends_with","contains_substring","does_not_contain_substring"]),supportedTransformationFunctions:S(["round_to_0_dp","round_to_2_dp"])}),we({origin:"query-engine",supportedFeatures:["simpleMaths","subquery","configManagerUi","switchField","sqlDefinedDataSet","roundedNumbers","aggregateMaths","encryptedDashboards"],supportedTimeTruncFunctions:o(["month","year","day","hour","minute","second"]),supportedAggregates:h(["sum","mean","min","max","count","countDistinct"]),supportedOperators:s([">","<","=","!=",">=","<=","is_one_of","is_not_one_of","starts_with","ends_with","contains_substring","does_not_contain_substring"]),supportedTransformationFunctions:S(["round_to_0_dp","round_to_2_dp"])}),we({origin:"query-engine",supportedFeatures:["simpleMaths","subquery","configManagerUi","roundedNumbers","aggregateMaths","encryptedDashboards"],supportedTimeTruncFunctions:o(["month","year","day","hour","minute","second"]),supportedAggregates:h(["sum","mean","min","max","count","countDistinct"]),supportedOperators:s([">","<","=","!=",">=","<=","is_one_of","is_not_one_of","starts_with","ends_with","contains_substring","does_not_contain_substring"]),supportedTransformationFunctions:S(["round_to_0_dp","round_to_2_dp"])}),we({origin:"query-engine",supportedFeatures:["simpleMaths","aggregateMaths","subquery","configManagerUi","sqlDefinedDataSet","roundedNumbers","switchField","encryptedDashboards"],supportedTimeTruncFunctions:o(["month","year","quarter","week","day","hour","minute","second"]),supportedAggregates:h(["sum","mean","min","max","count","countDistinct"]),supportedOperators:s([">","<","=","!=",">=","<=","is_one_of","is_not_one_of","starts_with","ends_with","contains_substring","does_not_contain_substring","array_contains"]),supportedTransformationFunctions:S(["round_to_0_dp","round_to_2_dp"])});class xe extends ae{constructor(e,t){super(`\n An expected field is missing from a dataSet.\n\n Missing '${t}'. Got;\n ${JSON.stringify(e)}\n `),this.name="FieldNotFoundInDataSet",this.missingFieldId=t}getMissingFieldId(){return this.missingFieldId}}function Ae(t,r){let n=[...t];return(null==r?void 0:r.onlyFieldTypes)&&!(0,e.isEmpty)(r.onlyFieldTypes)&&(n=[...n].filter((e=>{var t;return null===(t=null==r?void 0:r.onlyFieldTypes)||void 0===t?void 0:t.includes(e.dataType)}))),(null==r?void 0:r.forComponent)&&(n=((e,t)=>{const r=Ct(t);return[...e].filter((e=>{let t=!0;return le(e)&&!r.supportedCustomFields.conditionalPercentage&&(t=!1),fe(e)&&!r.supportedCustomFields.simplePercentage&&(t=!1),ue(e)&&!r.supportedCustomFields.simpleMaths&&(t=!1),pe(e)&&!r.supportedCustomFields.rules&&(t=!1),ce(e)&&!r.supportedCustomFields.roundedNumbers&&(t=!1),t}))})(n,r.forComponent)),(null==r?void 0:r.removeConditionalPercentage)&&(n=n.filter((e=>!le(e)))),(null==r?void 0:r.removeSimplePercentage)&&(n=n.filter((e=>!fe(e)))),(null==r?void 0:r.removeRuleGrouping)&&(n=n.filter((e=>!pe(e)))),(null==r?void 0:r.removeSimpleMaths)&&(n=n.filter((e=>!ue(e)))),(null==r?void 0:r.removeAggregateMaths)&&(n=n.filter((e=>!de(e)))),(null==r?void 0:r.onlyDimensions)&&(n=n.filter((e=>e.canBeDimension))),(null==r?void 0:r.onlyMeasures)&&(n=n.filter((e=>e.canBeMeasure))),n}const je=(e,t)=>{let r=[...e.fields].find((e=>e.id==t));if(r)return r;throw new xe(e,t)},Se=(e,t)=>[...Ae(e.fields,{onlyFieldTypes:["number","string","boolean"],onlyMeasures:!0,forComponent:t})],ke=e=>Object.assign(Object.assign({},e),{fields:[...e.fields].filter((e=>!(e=>le(e)||ue(e)||de(e)||fe(e)||pe(e)||ce(e))(e)))}),Ce=(e,t,r)=>{const n="horizontalBarChart"===r?void 0:"x",i=(e=>[...Ae(e.fields,{onlyFieldTypes:["boolean","number","string"],onlyDimensions:!0,removeConditionalPercentage:!0,removeSimplePercentage:!0,removeSimpleMaths:!0,removeAggregateMaths:!0})])(e)[0],o=[...Se(e,r)].map((e=>{const r=_(e,t.supportedAggregates);return{field:e.id,function:r}}));return{dataSetId:e.id,measure:o,order:[],timeDimension:null,filter:[],dimension:[{field:i.id,function:"none",pivot:n}]}},$e=(e,t)=>t?(e=e.map(ke),[...[...e].map((e=>{const r=(t[e.id]||[]).map(he);return Object.assign(Object.assign({},e),{fields:[...e.fields,...r]})}))]):e;class Oe extends ae{constructor(e,t){super(`\n An expected data set is missing from the dashboard.\n\n Missing '${t}'. Got;\n ${JSON.stringify([...e].map((e=>e.id)))}\n `),this.name="DataSetNotFound"}}const Fe={allowUnknown:!0,stripUnknown:!0},Te=(e,t,r)=>{const{error:n}=Ct(e.type,{queryEngineConfig:r}).schema.validate(e,Fe);if(n)return[new se(n)];const i=((e,t)=>e.find((e=>e.id==t))||null)(t,e.dataSetId);if(!i)return[new Oe(t,e.dataSetId)];const o=(e=>{let t=[];return(e=>{let t=[];return"measure"in e&&e.measure&&(t=[...t,...e.measure]),"xMeasure"in e&&e.xMeasure&&(t=[...t,e.xMeasure]),"yMeasure"in e&&e.yMeasure&&(t=[...t,e.yMeasure]),t})(e).forEach((e=>{t=[...t,e.field]})),(e=>{let t=[];return"dimension"in e&&e.dimension&&(t=[...t,...e.dimension]),"lineDimension"in e&&e.lineDimension&&(t=[...t,...e.lineDimension]),"barDimension"in e&&e.barDimension&&(t=[...t,...e.barDimension]),t})(e).forEach((e=>{t=[...t,e.field]})),"order"in e&&e.order&&(t=[...t,...[...e.order].map((e=>e.field))]),"timeDimension"in e&&e.timeDimension&&(t=[...t,e.timeDimension.field]),t})(e);try{o.forEach((e=>{je(i,e)}))}catch(e){if(e instanceof xe)return[e];throw e}return[]},De=e=>{return!!(e=>{var t;return"comboChart"===e.type?!!e.timeDimension||!!(e.barDimension.length>0&&e.lineDimension.length>0):"barChart"!==e.type&&"lineChart"!==e.type&&"areaChart"!==e.type&&"horizontalBarChart"!==e.type&&"scatterChart"!==e.type&&"pieChart"!==e.type||!!e.timeDimension||!(null==e?void 0:e.dimension)||0!==(null===(t=null==e?void 0:e.dimension)||void 0===t?void 0:t.length)})(e)||("barChart"===(t=e).type?"The Column Chart needs to have a grouping or a time to display correctly.":"lineChart"===t.type?"The Line Chart needs to have a grouping or a time to display correctly.":"areaChart"===t.type?"The Area Chart needs to have a grouping or a time to display correctly.":"horizontalBarChart"===t.type?"The Horizontal Bar Chart needs to have a grouping or a time to display correctly.":"comboChart"===t.type?"The Combo Chart needs to have a grouping (Bar and Line), or have time set to display correctly.":"scatterChart"===t.type?"The Scatter Chart needs to have a grouping to display correctly.":"pieChart"===t.type?"The Pie Chart needs to have a grouping to display correctly.":null);var t};var Ee,Pe=new Uint8Array(16);function Re(){if(!Ee&&!(Ee="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ee(Pe)}const Ie=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var Me=[],qe=0;qe<256;++qe)Me.push((qe+256).toString(16).substr(1));const Le=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(Me[e[t+0]]+Me[e[t+1]]+Me[e[t+2]]+Me[e[t+3]]+"-"+Me[e[t+4]]+Me[e[t+5]]+"-"+Me[e[t+6]]+Me[e[t+7]]+"-"+Me[e[t+8]]+Me[e[t+9]]+"-"+Me[e[t+10]]+Me[e[t+11]]+Me[e[t+12]]+Me[e[t+13]]+Me[e[t+14]]+Me[e[t+15]]).toLowerCase();if(!function(e){return"string"==typeof e&&Ie.test(e)}(r))throw TypeError("Stringified UUID is invalid");return r},Ne=function(e,t,r){var n=(e=e||{}).random||(e.rng||Re)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var i=0;i<16;++i)t[r+i]=n[i];return t}return Le(n)};const ze=e=>e||`view_${Ne()}`;function Be(e){const t=e,{parentDimension:r}=t;return function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}(t,["parentDimension"])}const Ue=(t,r,n)=>{let i=(0,e.cloneDeep)(Ae(r.fields,{onlyFieldTypes:["boolean","string"]})),o=(0,e.cloneDeep)(Ae(r.fields,{onlyFieldTypes:["date_time"]})),a=(0,e.cloneDeep)(Ae(r.fields,{onlyFieldTypes:["number"]})),s=null;return o[0]&&(s={field:o[0].id,truncate:"allowedGranularities"in o[0]?o[0].allowedGranularities[0]:"none"}),n(t,{protectedByOrganisation:!0,dimension:i.map((e=>({field:e.id,function:"none"}))),measure:[...a].map((e=>({function:"none",field:e.id}))),order:[],timeDimension:s})},Ve=(t,r)=>{let n=null,i=(0,e.cloneDeep)(t);return i.forEach((e=>{const t=je(r,e.field);"date_time"==t.dataType&&(n={field:t.id,truncate:e.function})})),i=i.filter((e=>"date_time"!=je(r,e.field).dataType)),{timeDimension:n,dimension:i}},We=e=>{let t=[...e.dimension];return"timeDimension"in e&&e.timeDimension&&(t=[{field:e.timeDimension.field,function:e.timeDimension.truncate},...t]),t},Ge=t=>{if(!t)return;let r=(0,e.cloneDeep)(t);return r.measure=c(t.measure||[]),r},Ye=(t,r)=>{let n=[];return(0,e.isEmpty)(r)||void 0===r?[]:(null==r||r.map((e=>{if((null==e?void 0:e.ruleType)&&(null==e?void 0:e.ruleValue)){let r=[];const i="field"in e&&"string"==typeof e.field&&"operator"in e&&"string"==typeof e.operator&&"value"in e;if(null==e?void 0:e.filters){const n=e.filters.map((e=>e.map((e=>He(e,t)))));r.push(...n)}else i&&r.push([He({field:e.field,op:e.operator,value:e.value},t)]);n.push({filters:r,ruleValueEnd:null==e?void 0:e.ruleValueEnd,ruleValue:e.ruleValue,ruleType:e.ruleType})}})),n)},He=(e,t)=>{if(e.function)return e;const r=x(e.field,t);return{field:r.field,op:e.op,value:e.value,function:r.function}},Ke=e=>({title:"Column chart",dump:e=>e,load:t=>Object.assign(Object.assign({},t),{measure:c(t.measure),order:u(t.order,t.timeDimension),filter:l(t.filter),protectedFields:Ge(t.protectedFields),viewId:ze(t.viewId),dimension:A(t.dimension),approxXAxisLabelCount:d(t.approxXAxisLabelCount),approxYAxisLabelCount:d(t.approxYAxisLabelCount),parameters:f(t.parameters),conditionalFormattingRules:Ye(e.queryEngineConfig,t.conditionalFormattingRules)}),setAttributes:ie(e),validate:(t,r)=>Te(t,r,e.queryEngineConfig),init:(e,t)=>Object.assign({type:"barChart",measure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",viewId:ze(null==t?void 0:t.viewId),filter:[],order:[],stacked:void 0,dataSetId:e,limit:5e3,conditionalFormattingRules:[],protectedByOrganisation:void 0,protectedFields:void 0,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,drilldown:[],legend:!0,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",parameters:{},goalLines:void 0,axisTitles:void 0},t),createFeedback:De,schema:ne(e),removeField:(t,r)=>T(t,r,e.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(t){const{measure:r,dimension:n}=Ce(t,e.queryEngineConfig,"barChart");return this.init(t.id,{measure:[r[0]],dimension:n})},dataPanelConfig:()=>[{type:"dataSet",title:"Data set",description:"What data do you want to use in this bar chart?"},{type:"views",title:"View",description:""},{type:"fieldCollector",title:"Metric - Y Axis",description:"What do you want each bar to measure?",fieldFilterOptions:{forComponent:"barChart",onlyMeasures:!0},callToAction:"Add metric",preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},{type:"drilldown",title:"Drilldown",description:"After clicking on a segment of this bar chart, what information do you want to see next?"},{type:"fieldCollector",title:"Grouping - X Axis",description:"What do you want each bar to represent? An example might be a `product category` field to represent each category as a bar.",fieldFilterOptions:{forComponent:"barChart",onlyDimensions:!0},preventDuplicates:!0,callToAction:"Add grouping",preSetPartialAttributes:(e,t)=>Ve(e,t),getValues:e=>We(e),maxAllowed:2,testId:"add-dimension"},{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},{type:"filter",title:"Filters",description:"Only include the information you want to use in this bar chart."},{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this bar chart."}],formatPanelConfig:()=>[{type:"heading",title:"Heading",description:"",subSection:[{type:"title",title:"Title",description:""},{type:"subject",title:"Subject",description:""}]},{type:"chartStyles",title:"Chart Settings",description:"",subSection:[{type:"stacked",title:"Layout",description:""},{type:"legend",title:"Show Legend",description:""}]},{type:"axisLabels",title:"Axis Preferences",description:"",y:{title:"Y Axis",description:"",prefix:{title:"Prefix",description:""},postfix:{title:"Postfix",description:""},format:{title:"Format",description:""},count:{title:"Label count",description:""},axisTitle:{title:"Title",description:""}},x:{title:"X Axis",description:"",prefix:{title:"Prefix",description:""},postfix:{title:"Postfix",description:""},format:{title:"Format",description:""},count:{title:"Label count",description:""},axisTitle:{title:"Title",description:""}}},{type:"conditionalFormatting",title:"Conditional Formatting",description:"",ruleType:"backgroundColor"},{type:"goalLine",title:"Goal Lines",description:""}],supportedCustomFields:{simplePercentage:!0,conditionalPercentage:!1,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0},supportedFeatures:{parameters:!0,colorGradient:!1},setDataAttributesFromPreAggregatedDataSet(e,t){return Ue(e,t,this.setAttributes)}}),Xe=e=>R().object(Object.assign(Object.assign(Object.assign({},U),W(e.queryEngineConfig)),{stacked:R().valid(!0,!1,"100%"),legend:R().valid(!0,!1),type:R().valid("lineChart"),parameters:Z(e.queryEngineConfig),lineCurve:G,conditionalFormattingRules:R().array().items(te(e.queryEngineConfig)),goalLines:Q(),axisTitles:J()})),Ze=e=>(t,r)=>{let n=E(t,r,Xe(e));return n=D(n),n},Qe=e=>({title:"Line chart",dump:e=>e,load:t=>({type:t.type,measure:c(t.measure),order:u(t.order,t.timeDimension),dimension:A(t.dimension),timeDimension:t.timeDimension,displayTitle:t.displayTitle,displaySubject:t.displaySubject,protectedByOrganisation:t.protectedByOrganisation,viewId:ze(t.viewId),filter:l(t.filter),dataSetId:t.dataSetId,limit:t.limit,xAxisPostfix:t.xAxisPostfix,xAxisPrefix:t.xAxisPrefix,yAxisPostfix:t.yAxisPostfix,yAxisPrefix:t.yAxisPrefix,yAxisFormat:t.yAxisFormat,xAxisFormat:t.xAxisFormat,lineCurve:t.lineCurve,conditionalFormattingRules:Ye(e.queryEngineConfig,t.conditionalFormattingRules),drilldown:t.drilldown,legend:t.legend,goalLines:t.goalLines,parameters:f(t.parameters),approxXAxisLabelCount:d(t.approxXAxisLabelCount),approxYAxisLabelCount:d(t.approxYAxisLabelCount),axisTitles:t.axisTitles}),setAttributes:Ze(e),validate:(t,r)=>Te(t,r,e.queryEngineConfig),init:(e,t)=>Object.assign({type:"lineChart",measure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",protectedByOrganisation:void 0,viewId:ze(null==t?void 0:t.viewId),filter:[],order:[],dataSetId:e,limit:5e3,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,lineCurve:"natural",conditionalFormattingRules:[],drilldown:[],legend:!0,goalLines:void 0,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",parameters:{},axisTitles:void 0},t),createFeedback:De,schema:Xe(e),removeField:(t,r)=>T(t,r,e.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(t){const{measure:r,dimension:n}=Ce(t,e.queryEngineConfig,"lineChart");return this.init(t.id,{measure:[r[0]],dimension:n})},dataPanelConfig:()=>[{type:"dataSet",title:"Data set",description:"What data do you want to use in this line chart?"},{type:"views",title:"View",description:""},{type:"fieldCollector",title:"Metric - Y Axis",description:"What do you want each line to measure?",fieldFilterOptions:{forComponent:"lineChart"},callToAction:"Add metric",preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},{type:"fieldCollector",title:"Grouping - X Axis",description:"What do you want each line to represent? An example might be a `product category` field to represent each category as a line.",fieldFilterOptions:{forComponent:"lineChart",onlyDimensions:!0},preventDuplicates:!0,callToAction:"Add grouping",preSetPartialAttributes:(e,t)=>Ve(e,t),getValues:e=>We(e),maxAllowed:2,testId:"add-dimension"},{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},{type:"filter",title:"Filters",description:"Only include the information you want to use in this line chart."},{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this line chart."}],formatPanelConfig:()=>[{type:"heading",title:"Heading",description:"",subSection:[{type:"title",title:"Title",description:""},{type:"subject",title:"Subject",description:""}]},{type:"chartStyles",title:"Chart Settings",description:"",subSection:[{type:"curve",title:"Line Curve",description:""},{type:"legend",title:"Show Legend",description:""}]},{type:"axisLabels",title:"Axis Preferences",description:"",y:{title:"Y Axis",description:"",prefix:{title:"Prefix",description:""},postfix:{title:"Postfix",description:""},format:{title:"Format",description:""},count:{title:"Label count",description:""},axisTitle:{title:"Title",description:""}},x:{title:"X Axis",description:"",prefix:{title:"Prefix",description:""},postfix:{title:"Postfix",description:""},format:{title:"Format",description:""},count:{title:"Label count",description:""},axisTitle:{title:"Title",description:""}}},{type:"goalLine",title:"Goal Lines",description:""}],supportedCustomFields:{simplePercentage:!0,conditionalPercentage:!1,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0},supportedFeatures:{parameters:!0,colorGradient:!1},setDataAttributesFromPreAggregatedDataSet(e,t){return Ue(e,t,this.setAttributes)}}),Je=e=>R().object(Object.assign(Object.assign({},U),{measure:R().array().items(I(e.queryEngineConfig.supportedAggregates)),dimension:L(e.queryEngineConfig.supportedTimeTruncFunctions),filter:z(e.queryEngineConfig),timeDimension:R().valid(null),order:R().array().items(M(e.queryEngineConfig)),type:R().valid("pieChart"),legend:R().valid(!0,!1),limit:B(),labelsAsPercentage:R().boolean(),conditionalFormattingRules:R().array().items(te(e.queryEngineConfig)),labelFormat:R().alternatives(R().string(),R().valid(null)),parameters:Z(e.queryEngineConfig)})),et=e=>({title:"Pie chart",dump:e=>e,load:t=>({type:t.type,measure:c(t.measure),order:u(t.order,t.timeDimension),dimension:A(t.dimension),viewId:ze(t.viewId),timeDimension:t.timeDimension,displayTitle:t.displayTitle,displaySubject:t.displaySubject,protectedByOrganisation:t.protectedByOrganisation,filter:l(t.filter),dataSetId:t.dataSetId,limit:t.limit,conditionalFormattingRules:Ye(e.queryEngineConfig,t.conditionalFormattingRules),labelsAsPercentage:t.labelsAsPercentage,legend:t.legend,labelFormat:t.labelFormat,parameters:f(t.parameters)}),setAttributes:(t,r)=>E(t,r,Je(e)),validate:(t,r)=>Te(t,r,e.queryEngineConfig),init:(e,t)=>Object.assign({type:"pieChart",measure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",protectedByOrganisation:void 0,viewId:ze(null==t?void 0:t.viewId),filter:[],order:[],dataSetId:e,limit:5e3,conditionalFormattingRules:[],labelsAsPercentage:!1,legend:!0,labelFormat:null,parameters:{}},t),createFeedback:De,schema:Je(e),removeField:(t,r)=>T(t,r,e.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(t){const{measure:r,dimension:n}=Ce(t,e.queryEngineConfig,"pieChart");return this.init(t.id,{measure:[r[0]],dimension:n})},dataPanelConfig:()=>[{type:"dataSet",title:"Data set",description:"What data do you want to use in this pie chart?"},{type:"views",title:"View",description:""},{type:"fieldCollector",title:"Metric",description:"What do you want each segment to measure?",fieldFilterOptions:{forComponent:"pieChart"},callToAction:"Add metric",maxAllowed:1,preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},{type:"fieldCollector",title:"Grouping",description:"How do you want to split each section of the pie chart?",fieldFilterOptions:{onlyFieldTypes:["boolean","number","string"],onlyDimensions:!0,removeConditionalPercentage:!0,removeSimplePercentage:!0,removeSimpleMaths:!0,removeAggregateMaths:!0},maxAllowed:1,callToAction:"Add comparison",preSetPartialAttributes:e=>({dimension:e}),getValues:e=>e.dimension,testId:"add-dimension"},{type:"sort",title:"Sort",description:"Choose the order of segments in the pie chart"},{type:"filter",title:"Filters",description:"Only include the information you want in this pie chart"},{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},{type:"limit",title:"Limit",description:"Limit the number of segments shown on this pie chart"}],formatPanelConfig:()=>[{type:"heading",title:"Heading",description:"",subSection:[{type:"title",title:"Title",description:""},{type:"subject",title:"Subject",description:""}]},{type:"conditionalFormatting",title:"Conditional Formatting",description:"",ruleType:"backgroundColor"},{type:"chartStyles",title:"Chart Settings",description:"",subSection:[{type:"legend",title:"Show Legend",description:""},{type:"numberFormat",title:"Format",description:""}]}],supportedCustomFields:{simplePercentage:!0,conditionalPercentage:!1,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0},supportedFeatures:{parameters:!0,colorGradient:!1}}),tt=e=>R().object(Object.assign(Object.assign({},U),{xMeasure:I(e.queryEngineConfig.supportedAggregates).allow(null),yMeasure:I(e.queryEngineConfig.supportedAggregates).allow(null),dimension:L(e.queryEngineConfig.supportedTimeTruncFunctions),order:R().array().items(M(e.queryEngineConfig)),limit:B(),legend:R().valid(!0,!1),offset:R().number().min(0),filter:z(e.queryEngineConfig),type:R().valid("scatterChart"),timeDimension:R().valid(null),xAxisPrefix:R().string().allow(""),yAxisPrefix:R().string().allow(""),xAxisPostfix:R().string().allow(""),yAxisPostfix:R().string().allow(""),yAxisFormat:R().alternatives(R().string(),R().valid(null)),xAxisFormat:R().alternatives(R().string(),R().valid(null)),approxYAxisLabelCount:V,approxXAxisLabelCount:V,goalLines:Q(),axisTitles:J()})),rt=e=>(t,r)=>{let n=E(t,r,tt(e)),i=[];return n.xMeasure&&i.push(n.xMeasure),n.yMeasure&&i.push(n.yMeasure),n.dimension.forEach((e=>{i.push({field:e.field,function:e.function})})),n=F(n,i),n},nt=e=>({title:"Scatter chart",dump:e=>e,load:e=>({type:e.type,xMeasure:c(e.xMeasure?[e.xMeasure]:[])[0]||null,yMeasure:c(e.yMeasure?[e.yMeasure]:[])[0]||null,dimension:A(e.dimension),viewId:ze(e.viewId),timeDimension:e.timeDimension,displayTitle:e.displayTitle,displaySubject:e.displaySubject,protectedByOrganisation:e.protectedByOrganisation,filter:l(e.filter),order:u(e.order,e.timeDimension),dataSetId:e.dataSetId,limit:e.limit,legend:e.legend,xAxisFormat:e.xAxisFormat,yAxisFormat:e.yAxisFormat,yAxisPostfix:e.yAxisPostfix,yAxisPrefix:e.yAxisPrefix,xAxisPostfix:e.xAxisPostfix,xAxisPrefix:e.xAxisPrefix,approxXAxisLabelCount:d(e.approxXAxisLabelCount),approxYAxisLabelCount:d(e.approxYAxisLabelCount),goalLines:e.goalLines,axisTitles:e.axisTitles}),setAttributes:rt(e),validate:(t,r)=>Te(t,r,e.queryEngineConfig),init:(e,t)=>Object.assign({type:"scatterChart",xMeasure:null,yMeasure:null,dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",protectedByOrganisation:void 0,viewId:ze(null==t?void 0:t.viewId),filter:[],order:[],dataSetId:e,limit:5e3,legend:!0,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",goalLines:void 0,axisTitles:void 0},t),createFeedback:De,schema:tt(e),removeField:(t,r)=>T(t,r,e.queryEngineConfig),isRunnable:e=>!!e.xMeasure&&!!e.yMeasure&&e.dimension.length>0,autoGenerate(t){const{measure:r,dimension:n}=Ce(t,e.queryEngineConfig,"scatterChart");return this.init(t.id,{xMeasure:r[0],yMeasure:r[1],dimension:n})},dataPanelConfig:()=>[{type:"dataSet",title:"Data set",description:"What data do you want to use in this scatter chart?"},{type:"views",title:"View",description:""},{type:"labelledMetrics",title:"Metrics",description:"",metrics:[{title:"X axis",propKey:"xMeasure",allowsMultiple:!1},{title:"Y axis",propKey:"yMeasure",allowsMultiple:!1}]},{type:"fieldCollector",title:"Grouping",description:"What do you want each dot to represent?",fieldFilterOptions:{onlyDimensions:!0,onlyFieldTypes:["boolean","number","string"],removeConditionalPercentage:!0,removeSimplePercentage:!0,removeSimpleMaths:!0,removeAggregateMaths:!0},maxAllowed:1,callToAction:"Add comparison",preSetPartialAttributes:e=>({dimension:e}),getValues:e=>e.dimension,testId:"add-dimension"},{type:"filter",title:"Filters",description:"Only include the information you want in this scatter chart"},{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},{type:"limit",title:"Limit",description:"Limit the number of data points shown on this scatter chart"}],formatPanelConfig:()=>[{type:"heading",title:"Heading",description:"",subSection:[{type:"title",title:"Title",description:""},{type:"subject",title:"Subject",description:""}]},{type:"chartStyles",title:"Chart Settings",description:"",subSection:[{type:"legend",title:"Show Legend",description:""}]},{type:"axisLabels",title:"Axis Preferences",description:"",y:{title:"Y Axis",description:"",prefix:{title:"Prefix",description:""},postfix:{title:"Postfix",description:""},format:{title:"Format",description:""},count:{title:"Label count",description:""},axisTitle:{title:"Title",description:""}},x:{title:"X Axis",description:"",prefix:{title:"Prefix",description:""},postfix:{title:"Postfix",description:""},format:{title:"Format",description:""},count:{title:"Label count",description:""},axisTitle:{title:"Title",description:""}}},{type:"goalLine",title:"Goal Lines",description:""}],supportedCustomFields:{simplePercentage:!0,conditionalPercentage:!1,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0},supportedFeatures:{parameters:!1,colorGradient:!1}}),it=e=>R().object(Object.assign(Object.assign({},U),{stacked:R().valid(!0,!1,"100%"),legend:R().valid(!0,!1),barMeasure:R().array().items(I(e.queryEngineConfig.supportedAggregates)),lineMeasure:R().array().items(I(e.queryEngineConfig.supportedAggregates)),barDimension:L(e.queryEngineConfig.supportedTimeTruncFunctions),lineDimension:L(e.queryEngineConfig.supportedTimeTruncFunctions),order:R().array().items(M(e.queryEngineConfig)),timeDimension:R().alternatives(q(e.queryEngineConfig.supportedTimeTruncFunctions),R().valid(null)),limit:B(),offset:R().number().min(0),filter:z(e.queryEngineConfig),type:R().valid("comboChart"),xAxisPrefix:R().string().allow(""),yAxisPrefix:R().string().allow(""),xAxisPostfix:R().string().allow(""),yAxisPostfix:R().string().allow(""),yAxisFormat:R().alternatives(R().string(),R().valid(null)),xAxisFormat:R().alternatives(R().string(),R().valid(null)),approxYAxisLabelCount:V,approxXAxisLabelCount:V,goalLines:Q(),conditionalFormattingRules:R().object({bar:R().array().items(te(e.queryEngineConfig))}),axisTitles:J()})),ot=e=>(t,r)=>{let n=E(t,r,it(e)),i=[...n.lineMeasure,...n.barMeasure];return[...n.lineDimension,...n.barDimension].forEach((e=>{i.push({field:e.field,function:e.function})})),n.timeDimension&&i.push({field:n.timeDimension.field,function:n.timeDimension.truncate}),n=F(n,i),n},at=e=>({title:"Combo chart",dump:e=>e,load:t=>{return r=t,n=e.queryEngineConfig,Object.assign(Object.assign({},r),{lineMeasure:c(r.lineMeasure),barMeasure:c(r.barMeasure),order:u(r.order,r.timeDimension||null),filter:l(r.filter),lineDimension:A(r.lineDimension||r.dimension||[]),barDimension:A(r.barDimension||r.dimension||[]),viewId:ze(r.viewId),approxXAxisLabelCount:d(r.approxXAxisLabelCount),approxYAxisLabelCount:d(r.approxYAxisLabelCount),conditionalFormattingRules:{bar:Ye(n,null===(i=r.conditionalFormattingRules)||void 0===i?void 0:i.bar)}});var r,n,i},setAttributes:ot(e),validate:(t,r)=>Te(t,r,e.queryEngineConfig),init:(e,t)=>Object.assign({type:"comboChart",barMeasure:[],lineMeasure:[],lineDimension:[],barDimension:[],timeDimension:null,displayTitle:"",displaySubject:"",viewId:ze(null==t?void 0:t.viewId),filter:[],order:[],dataSetId:e,limit:5e3,xAxisPostfix:"",protectedByOrganisation:void 0,xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,legend:!0,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",goalLines:void 0,conditionalFormattingRules:void 0,axisTitles:void 0},t),createFeedback:De,schema:it(e),removeField:(t,r)=>T(t,r,e.queryEngineConfig),isRunnable:e=>e.lineMeasure.length>0||e.barMeasure.length>0,autoGenerate(t){const{measure:r,dimension:n}=Ce(t,e.queryEngineConfig,"comboChart");return this.init(t.id,{barMeasure:[r[0]],lineMeasure:[r[1]||r[0]],barDimension:n,lineDimension:n})},dataPanelConfig:()=>[{type:"dataSet",title:"Data set",description:"What data do you want to use in this combo chart?"},{type:"views",title:"View",description:""},{type:"labelledMetrics",title:"Metric - Y Axis",description:"What do you want each line and bar to measure?",metrics:[{title:"Line",propKey:"lineMeasure",allowsMultiple:!0},{title:"Bar",propKey:"barMeasure",allowsMultiple:!0}]},{type:"comboChartDimension",title:"Grouping - X Axis",description:""},{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},{type:"filter",title:"Filters",description:"Only include the information you want to use in this combo chart."},{type:"customMetrics",title:"Custom metrics",description:""},{type:"limit",title:"Limit",description:"Set the maximum number of data points to show on this combo chart."}],formatPanelConfig:()=>[{type:"heading",title:"Heading",description:"",subSection:[{type:"title",title:"Title",description:""},{type:"subject",title:"Subject",description:""}]},{type:"chartStyles",title:"Chart Settings",description:"",subSection:[{type:"stacked",title:"Layout",description:""},{type:"legend",title:"Show Legend",description:""}]},{type:"axisLabels",title:"Axis Preferences",description:"",y:{title:"Y Axis",description:"",prefix:{title:"Prefix",description:""},postfix:{title:"Postfix",description:""},format:{title:"Format",description:""},count:{title:"Label count",description:""},axisTitle:{title:"Title",description:""}},x:{title:"X Axis",description:"",prefix:{title:"Prefix",description:""},postfix:{title:"Postfix",description:""},format:{title:"Format",description:""},count:{title:"Label count",description:""},axisTitle:{title:"Title",description:""}}},{type:"conditionalFormatting",title:"Conditional Formatting",description:"",ruleType:"backgroundColor",subSection:[{title:"Bar",propKey:"bar"}]},{type:"goalLine",title:"Goal Lines",description:""}],supportedCustomFields:{simplePercentage:!0,conditionalPercentage:!1,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0},supportedFeatures:{parameters:!1,colorGradient:!1}}),st=e=>R().object(Object.assign(Object.assign({},U),{type:R().valid("dataTable"),measure:R().array().items(I(e.queryEngineConfig.supportedAggregates)),dimension:L(e.queryEngineConfig.supportedTimeTruncFunctions),order:R().array().items(M(e.queryEngineConfig)),timeDimension:R().alternatives(q(e.queryEngineConfig.supportedTimeTruncFunctions),R().valid(null)),limit:B(),offset:R().number().min(0),filter:z(e.queryEngineConfig),prefixes:R().array().items(re),exportNames:R().object(),numberFormat:R().object(),conditionalFormattingRules:R().array().items(te(e.queryEngineConfig)),dateTimeFormat:R().string(),protectedFields:R().object({dimension:H(),measure:Y()}).unknown(!0),sizing:ee,tableDrilldown:R().array().items(R().object({subsetDimension:R().string().required()}))})),lt=e=>(t,r)=>{let n=E(t,r,st(e));return n=D(n),n},ut=(e,t)=>e.filter((e=>e.pivot==t)),ct=e=>({title:"Pivot table",dump:e=>e,load:t=>{return{type:t.type,measure:c(t.measure),order:u(t.order,t.timeDimension||null),displayTitle:t.displayTitle,dimension:(n=We({timeDimension:t.timeDimension,dimension:A(t.dimension)}),n.map((e=>Object.assign(Object.assign({},e),{pivot:e.pivot?e.pivot:"x"})))),displaySubject:t.displaySubject,protectedByOrganisation:t.protectedByOrganisation,protectedFields:Ge(t.protectedFields),viewId:ze(t.viewId),filter:l(t.filter),dataSetId:t.dataSetId,limit:t.limit,offset:t.offset,conditionalFormattingRules:Ye(e.queryEngineConfig,t.conditionalFormattingRules),dateTimeFormat:t.dateTimeFormat,prefixes:t.prefixes,exportNames:t.exportNames,numberFormat:t.numberFormat,sizing:t.sizing,tableDrilldown:(r=t.tableDrilldown,r&&r.length>0?r.map(Be):r||[])};var r,n},setAttributes:lt(e),validate:(t,r)=>Te(t,r,e.queryEngineConfig),init:(e,t)=>Object.assign({type:"dataTable",measure:[],displayTitle:"",dimension:[],protectedByOrganisation:void 0,displaySubject:"",viewId:ze(null==t?void 0:t.viewId),filter:[],order:[],dataSetId:e,limit:50,offset:0,conditionalFormattingRules:[],protectedFields:void 0,prefixes:[],dateTimeFormat:"DD MMMM YYYY, hh:mm",exportNames:{},numberFormat:{},sizing:{},tableDrilldown:[]},t),schema:st(e),removeField:(t,r)=>T(t,r,e.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(t){const{measure:r,dimension:n}=Ce(t,e.queryEngineConfig,"dataTable");return this.init(t.id,{measure:r.slice(0,5),dimension:n})},dataPanelConfig:()=>[{type:"dataSet",title:"Data set",description:"What data do you want to use in this data table?"},{type:"views",title:"View",description:""},{type:"fieldCollector",title:"Group columns",description:"",fieldFilterOptions:{onlyFieldTypes:["boolean","number","string","date_time"],onlyDimensions:!0,removeConditionalPercentage:!0,removeSimplePercentage:!0,removeSimpleMaths:!0,removeAggregateMaths:!0},preventDuplicates:!0,callToAction:"Add group column",preSetPartialAttributes:(e,t,r)=>({dimension:[...e.map((e=>Object.assign(Object.assign({},e),{pivot:"y"}))),...ut(r.dimension,"x")]}),getValues:e=>ut(e.dimension,"y"),testId:"add-pivot-dimension"},{type:"fieldCollector",title:"Group rows",description:"Which field do you want to group each row by? An example might be an employee ID or geographical location",fieldFilterOptions:{onlyFieldTypes:["boolean","number","string","date_time"],onlyDimensions:!0,removeConditionalPercentage:!0,removeSimplePercentage:!0,removeSimpleMaths:!0,removeAggregateMaths:!0},preventDuplicates:!0,callToAction:"Add group row",preSetPartialAttributes:(e,t,r)=>({dimension:[...e.map((e=>Object.assign(Object.assign({},e),{pivot:"x"}))),...ut(r.dimension,"y")]}),getValues:e=>ut(e.dimension,"x"),testId:"add-dimension"},{type:"drilldown",title:"Drilldown",description:"Drilldowns in a pivot table reveals underlying data contributing to summarized figures upon clicking."},{type:"fieldCollector",title:"Metrics",description:"Select the columns to show in the data table",fieldFilterOptions:{forComponent:"dataTable"},callToAction:"Add metric",preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},{type:"sort",title:"Sort",description:""},{type:"pagination",title:"Pagination",description:""},{type:"filter",title:"Filters",description:"Only include the information you want to use in this data table."},{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."}],formatPanelConfig:()=>[{title:"Heading",type:"heading",description:"",subSection:[{type:"title",title:"Title",description:""},{type:"subject",title:"Subject",description:""}]},{type:"format",title:"Format",description:"",subSection:[{type:"time",title:"Time",description:""}]},{type:"prefixes",title:"Prefixes",description:""},{type:"conditionalFormatting",title:"Conditional Formatting",description:"",ruleType:"backgroundColor"}],supportedCustomFields:{simplePercentage:!0,conditionalPercentage:!1,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0},supportedFeatures:{parameters:!1,colorGradient:!0}}),dt=R().object({field:R().string().required(),function:R().valid("none").required()}),ft=e=>R().object(Object.assign(Object.assign({},U),{type:R().valid("basicTable"),measure:R().array().items(dt),dimension:R().array().max(0),order:R().array().items(M(e.queryEngineConfig)),timeDimension:R().valid(null),limit:B(),offset:R().number().min(0),filter:z(e.queryEngineConfig),prefixes:R().array().items(re),exportNames:R().object(),numberFormat:R().object(),conditionalFormattingRules:R().array().items(te(e.queryEngineConfig)),dateTimeFormat:R().string(),protectedFields:R().object({measure:Y()}).unknown(!0),sizing:ee})),pt=e=>(t,r)=>{let n=E(t,r,ft(e));return n=F(n,[...n.measure]),n},ht=e=>({title:"Basic table",dump:e=>({type:e.type,measure:e.measure,displayTitle:e.displayTitle,dimension:e.dimension,timeDimension:e.timeDimension,displaySubject:e.displaySubject,protectedFields:e.protectedFields,filter:e.filter,order:e.order,dataSetId:e.dataSetId,viewId:null==e?void 0:e.viewId,limit:e.limit,offset:e.offset,conditionalFormattingRules:e.conditionalFormattingRules,protectedByOrganisation:e.protectedByOrganisation,dateTimeFormat:e.dateTimeFormat,prefixes:e.prefixes,exportNames:e.exportNames,numberFormat:e.numberFormat,sizing:e.sizing}),load:t=>Object.assign(Object.assign({},t),{measure:c(t.measure),order:u(t.order,t.timeDimension),filter:l(t.filter),dimension:A(t.dimension),viewId:ze(t.viewId),protectedFields:Ge(t.protectedFields),conditionalFormattingRules:Ye(e.queryEngineConfig,t.conditionalFormattingRules)}),setAttributes:pt(e),validate:(t,r)=>Te(t,r,e.queryEngineConfig),init:function(t,r){const n={type:"basicTable",measure:[],displayTitle:"",dimension:[],timeDimension:null,displaySubject:"",filter:[],order:[],dataSetId:t,viewId:ze(null==r?void 0:r.viewId),protectedFields:void 0,limit:50,offset:0,conditionalFormattingRules:[],prefixes:[],dateTimeFormat:"DD MMMM YYYY, hh:mm",exportNames:{},numberFormat:{},sizing:{}};return pt(e)(n,r||{})},schema:ft(e),removeField:(t,r)=>T(t,r,e.queryEngineConfig),setFields:function(t,r){const n=[...r].map((e=>({field:e,function:"none"})));return pt(e)(t,{measure:n})},setDateTimeFormat:function(e,t){return this.setAttributes(e,{dateTimeFormat:t})},isRunnable:e=>e.measure.length>0,autoGenerate(e){const t=[...Ae(e.fields,{forComponent:"basicTable",onlyMeasures:!0,removeAggregateMaths:!0,removeConditionalPercentage:!0,removeSimplePercentage:!0})].map((e=>({field:e.id,function:"none"})));return this.init(e.id,{measure:t.slice(0,5)})},dataPanelConfig:()=>[{type:"dataSet",title:"Data set",description:"What data do you want to use in this basic table?"},{type:"views",title:"View",description:""},{type:"fields",title:"Columns",description:"Select which values you want to see in this table"},{type:"sort",title:"Sort",description:"Select how the columns are ordered in this table"},{type:"pagination",title:"Pagination",description:"Define the size for each page in the table"},{type:"filter",title:"Filters",description:"Only include the information you want to use in this table."},{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."}],formatPanelConfig:()=>[{type:"heading",title:"Heading",description:"",subSection:[{type:"title",title:"Title",description:""},{type:"subject",title:"Subject",description:""}]},{type:"format",title:"Format",description:"",subSection:[{type:"time",title:"Time",description:""}]},{type:"prefixes",title:"Prefixes",description:""},{type:"conditionalFormatting",title:"Conditional Formatting",description:"",ruleType:"backgroundColor"}],supportedCustomFields:{simplePercentage:!1,conditionalPercentage:!1,simpleMaths:!0,rules:!0,aggregateMaths:!1,roundedNumbers:!0},supportedFeatures:{parameters:!1,colorGradient:!0}}),mt=e=>(t,r)=>{let n=E(t,r,ne(e));return n=D(n),n},gt=e=>({title:"Horizontal bar chart",dump:e=>e,load:e=>Object.assign(Object.assign({},e),{measure:c(e.measure),order:u(e.order,e.timeDimension),dimension:A(e.dimension),viewId:ze(e.viewId),filter:l(e.filter),approxXAxisLabelCount:d(e.approxXAxisLabelCount),approxYAxisLabelCount:d(e.approxYAxisLabelCount),protectedFields:Ge(e.protectedFields)}),setAttributes:mt(e),validate:(t,r)=>Te(t,r,e.queryEngineConfig),init:(e,t)=>Object.assign({type:"horizontalBarChart",measure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",viewId:ze(null==t?void 0:t.viewId),filter:[],order:[],dataSetId:e,limit:5e3,conditionalFormattingRules:[],protectedByOrganisation:void 0,protectedFields:void 0,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,legend:!0,drilldown:[],approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",axisTitles:void 0},t),createFeedback:De,schema:ne(e),removeField:(t,r)=>T(t,r,e.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(t){const{measure:r,dimension:n}=Ce(t,e.queryEngineConfig,"horizontalBarChart");return this.init(t.id,{measure:[r[0]],dimension:n})},dataPanelConfig:()=>[{type:"dataSet",title:"Data set",description:"What data do you want to use in this horizontal bar chart?"},{type:"views",title:"View",description:""},{type:"fieldCollector",title:"Metric - X Axis",description:"What do you want each bar to measure?",fieldFilterOptions:{forComponent:"horizontalBarChart"},callToAction:"Add metric",preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},{type:"drilldown",title:"Drilldown",description:""},{type:"fieldCollector",title:"Grouping - X Axis",description:"What do you want each bar to represent? An example might be a `product category` field to represent each category as a bar.",fieldFilterOptions:{forComponent:"horizontalBarChart",onlyDimensions:!0},preventDuplicates:!0,callToAction:"Add grouping",preSetPartialAttributes:(e,t)=>Ve(e,t),getValues:e=>We(e),maxAllowed:2,testId:"add-dimension"},{type:"sort",title:"Sort",description:""},{type:"limit",title:"Limit",description:"Set the maximum number of data points to show on this horizontal bar chart."},{type:"filter",title:"Filters",description:"Only include the information you want to use in this horizontal bar chart."},{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."}],formatPanelConfig:()=>[{type:"heading",title:"Heading",description:"",subSection:[{type:"title",title:"Title",description:""},{type:"subject",title:"Subject",description:""}]},{type:"chartStyles",title:"Chart Settings",description:"",subSection:[{type:"stacked",title:"Layout",description:""},{type:"legend",title:"Show Legend",description:""}]},{type:"axisLabels",title:"Axis Preferences",description:"",y:{title:"Y Axis",description:"",prefix:{title:"Prefix",description:""},postfix:{title:"Postfix",description:""},format:{title:"Format",description:""},count:{title:"Label count",description:""},axisTitle:{title:"Title",description:""}},x:{title:"X Axis",description:"",prefix:{title:"Prefix",description:""},postfix:{title:"Postfix",description:""},format:{title:"Format",description:""},count:{title:"Label count",description:""},axisTitle:{title:"Title",description:""}}},{type:"conditionalFormatting",title:"Conditional Formatting",description:"",ruleType:"backgroundColor"}],supportedCustomFields:{simplePercentage:!0,conditionalPercentage:!1,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0},supportedFeatures:{parameters:!0,colorGradient:!1},setDataAttributesFromPreAggregatedDataSet(e,t){return Ue(e,t,this.setAttributes)}}),yt=e=>R().object(Object.assign(Object.assign(Object.assign({},U),W(e.queryEngineConfig)),{stacked:R().valid(!0,!1,"100%"),legend:R().valid(!0,!1),type:R().valid("areaChart"),lineCurve:G,conditionalFormattingRules:R().array().items(te(e.queryEngineConfig)),parameters:Z(e.queryEngineConfig),goalLines:Q(),axisTitles:J()})),vt=e=>(t,r)=>{let n=E(t,r,yt(e));return n=D(n),n},bt=e=>({title:"Area chart",dump:e=>e,load:t=>({type:t.type,measure:c(t.measure),displayTitle:t.displayTitle,dimension:A(t.dimension),timeDimension:t.timeDimension,displaySubject:t.displaySubject,viewId:ze(t.viewId),filter:l(t.filter),order:u(t.order,t.timeDimension),dataSetId:t.dataSetId,limit:t.limit,offset:t.offset,xAxisPostfix:t.xAxisPostfix,xAxisPrefix:t.xAxisPrefix,yAxisPostfix:t.yAxisPostfix,yAxisPrefix:t.yAxisPrefix,lineCurve:t.lineCurve,conditionalFormattingRules:Ye(e.queryEngineConfig,t.conditionalFormattingRules),protectedByOrganisation:t.protectedByOrganisation,stacked:t.stacked,drilldown:t.drilldown,legend:t.legend,yAxisFormat:t.yAxisFormat,xAxisFormat:t.xAxisFormat,goalLines:t.goalLines,parameters:f(t.parameters),approxXAxisLabelCount:d(t.approxXAxisLabelCount),approxYAxisLabelCount:d(t.approxYAxisLabelCount)}),setAttributes:vt(e),validate:(t,r)=>Te(t,r,e.queryEngineConfig),init:(e,t)=>Object.assign({type:"areaChart",measure:[],displayTitle:"",dimension:[],timeDimension:null,displaySubject:"",viewId:ze(null==t?void 0:t.viewId),filter:[],order:[],dataSetId:e,limit:5e3,offset:0,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,lineCurve:"natural",conditionalFormattingRules:[],drilldown:[],legend:!0,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",parameters:{},goalLines:void 0,axisTitles:void 0},t),createFeedback:De,schema:yt(e),removeField:(t,r)=>T(t,r,e.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(t){const{measure:r,dimension:n}=Ce(t,e.queryEngineConfig,"areaChart");return this.init(t.id,{measure:[r[0]],dimension:n})},dataPanelConfig:()=>[{type:"dataSet",title:"Data set",description:"What data do you want to use in this area chart?"},{type:"views",title:"View",description:""},{type:"fieldCollector",title:"Metric - Y Axis",description:"What do you want each area to measure?",fieldFilterOptions:{forComponent:"areaChart"},callToAction:"Add metric",preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},{type:"fieldCollector",title:"Grouping - X Axis",description:"What do you want each area to represent? An example might be an employee ID to represent each employee.",fieldFilterOptions:{forComponent:"areaChart",onlyDimensions:!0},preventDuplicates:!0,callToAction:"Add grouping",preSetPartialAttributes:(e,t)=>Ve(e,t),getValues:e=>We(e),maxAllowed:2,testId:"add-dimension"},{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},{type:"filter",title:"Filters",description:"Only include the information you want to use in this area chart."},{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this area chart."}],formatPanelConfig:()=>[{type:"heading",title:"Heading",description:"",subSection:[{type:"title",title:"Title",description:""},{type:"subject",title:"Subject",description:""}]},{type:"chartStyles",title:"Chart Settings",description:"",subSection:[{type:"stacked",title:"Layout",description:""},{type:"curve",title:"Line Curve",description:""},{type:"legend",title:"Show Legend",description:""}]},{type:"axisLabels",title:"Axis Preferences",description:"",y:{title:"Y Axis",description:"",prefix:{title:"Prefix",description:""},postfix:{title:"Postfix",description:""},format:{title:"Format",description:""},count:{title:"Label count",description:""},axisTitle:{title:"Title",description:""}},x:{title:"X Axis",description:"",prefix:{title:"Prefix",description:""},postfix:{title:"Postfix",description:""},format:{title:"Format",description:""},count:{title:"Label count",description:""},axisTitle:{title:"Title",description:""}}},{type:"goalLine",title:"Goal Lines",description:""}],supportedCustomFields:{simplePercentage:!0,conditionalPercentage:!1,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0},supportedFeatures:{parameters:!0,colorGradient:!1}}),_t=e=>R().object(Object.assign(Object.assign({},U),{fontSize:R().string().allow(""),formatter:R().object(),measure:R().array().items(I(e.queryEngineConfig.supportedAggregates)),filter:z(e.queryEngineConfig),prefixes:R().object(),postfixes:R().object(),type:R().valid("singleStat"),limit:B(),conditionalFormattingRules:R().array().items(te(e.queryEngineConfig)),deltaTimeDimension:R().alternatives(q(e.queryEngineConfig.supportedTimeTruncFunctions),R().valid(null)),parameters:Z(e.queryEngineConfig)})),wt=e=>({title:"Single stat",dump:e=>e,load:e=>{const t=(e=>{if("singleMeasure"in e){let t={},r={},n=[],i={};return e.singleMeasure&&(n=[e.singleMeasure],t[k(e.singleMeasure)]=e.prefix,r[k(e.singleMeasure)]=e.postfix,i[k(e.singleMeasure)]=e.formatter),{type:"singleStat",prefixes:t,postfixes:r,measure:n,formatter:i,fontSize:e.fontSize,displayTitle:e.displayTitle,displaySubject:e.displaySubject,filter:l(e.filter),dataSetId:e.dataSetId,limit:e.limit,conditionalFormattingRules:e.conditionalFormattingRules,deltaTimeDimension:e.deltaTimeDimension,parameters:f(e.parameters)}}return Object.assign(Object.assign({},e),{filter:l(e.filter)})})(e);return{type:"singleStat",prefixes:t.prefixes,postfixes:t.postfixes,fontSize:t.fontSize,formatter:t.formatter,measure:c(t.measure),displayTitle:t.displayTitle,displaySubject:t.displaySubject,protectedByOrganisation:e.protectedByOrganisation,viewId:ze(e.viewId),filter:t.filter,dataSetId:t.dataSetId,limit:t.limit,conditionalFormattingRules:t.conditionalFormattingRules,deltaTimeDimension:t.deltaTimeDimension,parameters:f(t.parameters)}},setAttributes:(t,r)=>E(t,r,_t(e)),validate:(t,r)=>Te(t,r,e.queryEngineConfig),init:(e,t)=>Object.assign({type:"singleStat",postfixes:{},prefixes:{},measure:[],displayTitle:"",formatter:{},fontSize:"2rem",protectedByOrganisation:void 0,displaySubject:"",viewId:ze(null==t?void 0:t.viewId),filter:[],dataSetId:e,limit:5e3,conditionalFormattingRules:[],deltaTimeDimension:null,parameters:{}},t),schema:_t(e),removeField:(t,r)=>T(t,r,e.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(t){const{measure:r,dimension:n}=Ce(t,e.queryEngineConfig,"singleStat");return this.init(t.id,{measure:[r[0]]})},dataPanelConfig:()=>[{type:"dataSet",title:"Data set",description:"What data do you want to use in this single stat?"},{type:"views",title:"View",description:""},{type:"fieldCollector",title:"Metrics",description:"What do you want to show?",fieldFilterOptions:{forComponent:"singleStat"},callToAction:"Add metric",preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},{type:"filter",title:"Filters",description:"Only include the information you want in this single stat"},{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},{type:"comparison",title:"Comparison",description:""}],formatPanelConfig:()=>[{type:"heading",title:"Heading",description:"",subSection:[{type:"title",title:"Title",description:""},{type:"subject",title:"Subject",description:""}]},{type:"statsLabels",title:"Labels",description:"",prefix:{title:"Prefix",description:""},postfix:{title:"Postfix",description:""},format:{title:"Format",description:""},count:{title:"Label count",description:""}},{type:"format",title:"Format",description:"",subSection:[{title:"Font Size",type:"fontSize",description:""}]},{type:"conditionalFormatting",title:"Conditional Formatting",description:"",ruleType:"fontColor"}],supportedCustomFields:{simplePercentage:!0,conditionalPercentage:!0,simpleMaths:!0,aggregateMaths:!0,rules:!0,roundedNumbers:!0},supportedFeatures:{parameters:!0,colorGradient:!1}}),xt={title:"Custom",dump:e=>e,load:e=>e,setAttributes:(e,t)=>{throw"Not implemented."},validate:()=>[],init:(e,t)=>({type:"custom",id:t&&t.id||"",dataSetId:e,displaySubject:"",displayTitle:"",protectedByOrganisation:void 0}),schema:R().object(),removeField:(e,t)=>e,isRunnable:()=>!0,autoGenerate(e){return this.init(e.id)},dataPanelConfig:()=>[],formatPanelConfig:()=>[],supportedCustomFields:{simplePercentage:!0,conditionalPercentage:!1,simpleMaths:!0,rules:!1,aggregateMaths:!0,roundedNumbers:!0},supportedFeatures:{colorGradient:!1,parameters:!1}},At=e=>R().object(Object.assign(Object.assign({},U),{type:R().valid("mercatorMap"),measure:R().array().items(I(e.queryEngineConfig.supportedAggregates)),filter:z(e.queryEngineConfig),limit:B(),dimension:L({}),labelFormat:R().alternatives(R().string(),R().valid(null)),noDataColor:R().string().required(),backgroundColor:R().string().required(),maxValueColor:R().string().required(),minValueColor:R().string().required(),position:R().object({scale:R().number(),centerX:R().number(),centerY:R().number()})})),jt=e=>(t,r)=>E(t,r,At(e)),St=e=>({title:"Country map",dump:e=>e,load:e=>({dataSetId:e.dataSetId,displaySubject:e.displaySubject,displayTitle:e.displayTitle,protectedByOrganisation:e.protectedByOrganisation,viewId:ze(e.viewId),type:"mercatorMap",dimension:e.dimension,limit:e.limit,measure:c(e.measure),labelFormat:e.labelFormat,position:e.position,filter:l(e.filter),noDataColor:e.noDataColor||"#ffffff",backgroundColor:e.backgroundColor||"#EFF5F6",maxValueColor:e.maxValueColor||"#000000",minValueColor:e.minValueColor||"#e0e0e0"}),setAttributes:jt(e),validate:()=>[],init:(e,t)=>Object.assign({type:"mercatorMap",dataSetId:e,dimension:[],measure:[],displaySubject:"",displayTitle:"",limit:5e3,filter:[],viewId:ze(null==t?void 0:t.viewId),labelFormat:null,noDataColor:"#ffffff",backgroundColor:"#EFF5F6",maxValueColor:"#000000",minValueColor:"#e0e0e0"},t),schema:At(e),removeField:(e,t)=>e,isRunnable:e=>!!(e.dimension&&e.dimension[0]&&e.measure&&e.measure[0]),autoGenerate(e){return this.init(e.id)},dataPanelConfig:()=>[{type:"dataSet",title:"Data set",description:"What data do you want to use for this map?"},{type:"views",title:"View",description:""},{type:"fieldCollector",title:"Metric",description:"What do you want to show?",fieldFilterOptions:{forComponent:"pieChart"},callToAction:"Add metric",maxAllowed:1,preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},{type:"fieldCollector",title:"Country",description:"Which field contains the country code required to group results on?",fieldFilterOptions:{onlyDimensions:!0,onlyFieldTypes:["string"],removeConditionalPercentage:!0,removeRuleGrouping:!1,removeSimpleMaths:!0,removeSimplePercentage:!0,removeAggregateMaths:!0},maxAllowed:1,callToAction:"Set country",preSetPartialAttributes:e=>({dimension:e}),getValues:e=>e.dimension,testId:"add-dimension"},{type:"filter",title:"Filters",description:"Only include the information you want to use on this map."},{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this bar chart."}],formatPanelConfig:()=>[{type:"heading",title:"Heading",description:"",subSection:[{type:"title",title:"Title",description:""},{type:"subject",title:"Subject",description:""}]},{type:"chartStyles",title:"Map Settings",description:"",subSection:[{type:"numberFormat",title:"Value format",description:""}]},{type:"mapColors",title:"Map colors",description:""}],supportedCustomFields:{simplePercentage:!0,conditionalPercentage:!1,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0},supportedFeatures:{parameters:!1,colorGradient:!1}}),kt={queryEngineConfig:{supportedFeatures:[],supportedAggregates:{},supportedTimeTruncFunctions:{},supportedOperators:{},supportedTransformationFunctions:{}}},Ct=function(e,t){if("custom"==e)return xt;if("barChart"==e)return Ke(t||kt);if("areaChart"==e)return bt(t||kt);if("lineChart"==e)return Qe(t||kt);if("pieChart"==e)return et(t||kt);if("scatterChart"==e)return nt(t||kt);if("comboChart"==e)return at(t||kt);if("dataTable"==e)return ct(t||kt);if("basicTable"==e)return ht(t||kt);if("singleStat"==e)return wt(t||kt);if("mercatorMap"==e)return St(t||kt);if("horizontalBarChart"==e)return gt(t||kt);throw`Cannot get interface for ${e}. Please implement it.`};class $t{constructor(e,t,r){this.componentType=e,this.dataSet=null;const{init:n}=Ct(this.componentType,{queryEngineConfig:bn.queryEngineConfig});this.attributes=n(t.id,r)}updateAttributes(e){const{setAttributes:t}=Ct(this.componentType,{queryEngineConfig:bn.queryEngineConfig});if(!this.attributes)throw new Error("Attributes have not been initialized yet");this.attributes=t(this.attributes,e)}}class Ot extends Error{constructor(e){super(e),this.name="FailedToLoadQueryEngineConfig"}}const Ft=Ot;class Tt extends Error{constructor(e){super(`The queryEngineEndpoint value '${e}' is not valid.`),this.name="InvalidQueryEngineEndpoint",this.invalidEndpoint=e}}const Dt=Tt;class Et extends Error{constructor(){super("The queryEngineEndpoint value is not of the correct type. It must be a string or a function."),this.name="InvalidQueryEngineEndpointType"}}const Pt=Et;var Rt=r(307),It=r.n(Rt);const Mt=e=>e.startsWith("/")?Mt(e.slice(1)):e.endsWith("/")?Mt(e.slice(0,-1)):e;const qt=e=>(t,r,n)=>{return i=void 0,o=void 0,s=function*(){let i={};r&&(i.auth=`Bearer ${r}`);let o="";n&&(o=`filter=${n.join(",")}`);const{status:a,body:s}=yield e({path:`/api/v2/auth/project/${t}/access_token?${o}`,method:"get",headers:i});if(200==a)return s.token.token},new((a=void 0)||(a=Promise))((function(e,t){function r(e){try{l(s.next(e))}catch(e){t(e)}}function n(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(r,n)}l((s=s.apply(i,o||[])).next())}));var i,o,a,s};var Lt=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((n=n.apply(e,t||[])).next())}))};const Nt=e=>t=>Lt(void 0,void 0,void 0,(function*(){var r;try{const r=yield((e,t)=>Lt(void 0,void 0,void 0,(function*(){if(e.dashboardAccessToken)return v("Using dashboard access token for auth header"),{auth:`Bearer ${e.dashboardAccessToken}`};if(e.projectAccessToken)return v("Using project access token for auth header"),{auth:`Bearer ${e.projectAccessToken}`};if(e.apiKey)return v("Using API Key for auth header"),{auth:`Api-Key ${e.apiKey}`};if(t.preFetchProjectAccessTokens&&(e.useCookieAuth||e.appSessionAuthToken)){v("Fetching project access token from the Vizzly API",t.preFetchProjectAccessTokens.projectId,"Filtering by",t.preFetchProjectAccessTokens.resourceFilters);const r=yield qt(Nt(e))(t.preFetchProjectAccessTokens.projectId,e.appSessionAuthToken,t.preFetchProjectAccessTokens.resourceFilters);if(r)return v("Project access token received."),{auth:`Bearer ${r}`};v("Failed to receive project access token.")}else v("Not pre-fetching project access token.");return{}})))(e,t),n=t.headers||{},i=((e,t)=>{const r=Mt(e),n=Mt(t),i=(o=e).startsWith("https://")||o.startsWith("http://")||o.startsWith(".")?"":"/";var o;return""==r&&""==n?"/":""==n?`${i}${r}`:""!=r&&""!=n?`${i}${r}/${n}`:`${i}${n}`})(e.host,t.path),o=yield It()(i,{method:t.method,headers:Object.assign(Object.assign({"Content-Type":"application/json",Accept:"application/json"},r),n),redirect:"follow",referrerPolicy:"no-referrer",body:t.body?JSON.stringify(t.body):null,signal:t.abortSignal,mode:t.mode||void 0});let a=yield o.json();return v("HTTP Client Response",{host:e.host,path:t.path,status:o.status,responseId:o.headers.get("X-Request-Id")}),{body:a,status:o.status}}catch(e){if(null===(r=t.abortSignal)||void 0===r?void 0:r.aborted)return console.log("Aborted a request."),{status:500,body:{reason:"Aborted"}};throw e}}));const zt=e=>"string"==typeof e?{}:e.customHeaders?e.customHeaders():{},Bt=e=>t=>{return r=void 0,n=void 0,o=function*(){const r={host:Gt(e)},n=Object.assign(Object.assign({},t),{headers:Object.assign(Object.assign({},t.headers),zt(e))});return Nt(r)(n)},new((i=void 0)||(i=Promise))((function(e,t){function a(e){try{l(o.next(e))}catch(e){t(e)}}function s(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(a,s)}l((o=o.apply(r,n||[])).next())}));var r,n,i,o};const Ut=e=>{return t=void 0,r=void 0,i=function*(){const t=Bt(e),r=yield t({method:"post",mode:"cors",path:"/api/v1/support",body:{}});return 200==r.status?"supportedFeatures"in(n=r.body)?n:Object.assign(Object.assign({},n),{supportedFeatures:["subquery"]}):null;var n},new((n=void 0)||(n=Promise))((function(e,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof n?r:new n((function(e){e(r)}))).then(a,s)}l((i=i.apply(t,r||[])).next())}));var t,r,n,i},Vt={origin:"in-browser",supportedFeatures:["simpleMaths","aggregateMaths","subquery","encryptedDashboards"],supportedTimeTruncFunctions:o(["month","year","quarter","week","day","hour","minute","second"]),supportedAggregates:h(["sum","mean","min","max","count","countDistinct"]),supportedOperators:s([">","<","=","!=",">=","<=","is_one_of","is_not_one_of","starts_with","ends_with","contains_substring","does_not_contain_substring"]),supportedTransformationFunctions:{}};const Wt=e=>{return t=void 0,r=void 0,i=function*(){try{if("in-browser"===e)return Vt;if("string"==typeof e||"object"==typeof e&&"endpoint"in e){if(!(e=>{let t="string"==typeof e?e:e.endpoint;return!!t.startsWith("http://")||!!t.startsWith("https://")||!!t.startsWith("/")})(e))throw new Dt(e);const t=yield Ut(e);if(!t)throw new Ft("Failed to load query engine config.");return t}if("function"==typeof e){let t=yield e();if(!t)throw new Ft("Failed to load query engine config.");return Object.assign({},t)}throw new Pt}catch(e){if(e instanceof Dt)throw e;if(e instanceof Pt)throw e;throw new Ft("Failed to load query engine config.")}},new((n=void 0)||(n=Promise))((function(e,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof n?r:new n((function(e){e(r)}))).then(a,s)}l((i=i.apply(t,r||[])).next())}));var t,r,n,i},Gt=e=>"string"==typeof e?e:e.endpoint;r(392);const Yt=350,Ht={colors:["#feae4a","#5fbaff","#e15e9d"],detail:"minimal",fontFamily:"Inter, sans-serif",rowLimit:6,fontSize:"0.65rem"},Kt=(["barChart","horizontalBarChart","areaChart","lineChart","scatterChart","pieChart","singleStat","dataTable","basicTable","comboChart","mercatorMap","custom"].filter((e=>"custom"!=e)),e=>"fields"in e?(e=>{if("globalSelectFilter"==e.type)return{type:"singleSelectFilter",title:e.title,value:null,requiresValue:!1,managedByConfiguration:!1,appliesToFields:e.fields.map((e=>({fieldId:e.field,dataSetId:e.dataSetId})))};if("globalDateTimeFilter"==e.type)return{type:"dateFilter",value:null,requiresValue:!1,managedByConfiguration:!1,title:e.title,appliesToFields:e.fields.map((e=>({fieldId:e.field,dataSetId:e.dataSetId})))};throw`Unrecognised global filter. ${JSON.stringify(e)}`})(e):Object.assign(Object.assign({},e),{type:Xt(e.type)})),Xt=e=>"dateTimeFilter"===e?"dateFilter":e,Zt=t=>{if("isEmpty"in t||Jt(t))return t;const{load:r}=Ct(t.attributes.type),n=r(t.attributes);let i=[];return(0,e.isArray)(t.localFilters)&&(i=[...t.localFilters?t.localFilters:[]].map((e=>Kt(e)))),"addOns"in t.attributes&&(0,e.isEmpty)(i)&&t.attributes.addOns.forEach((e=>{i=[...i,{type:"dateFilter"==e.type?"dateFilter":"singleSelectFilter",value:null,requiresValue:!1,managedByConfiguration:!1,appliesToFields:[{fieldId:e.field,dataSetId:n.dataSetId}]}]})),delete t.addOns,delete n.addOns,Object.assign(Object.assign({},t),{localFilters:i,attributes:n,results:[]})},Qt=e=>({colSpan:e,isEmpty:!0}),Jt=e=>"displayTitle"in e,er=t=>{const r=[...t],n=(0,e.sumBy)(r,(e=>e.colSpan));return 12==n||(r[r.length-1].colSpan=r[r.length-1].colSpan+12-n),r};class tr{constructor(e){var t,r;if(this.component=void 0,this.localFilters=void 0,this.isEmpty=void 0,null==e?void 0:e.component)this.component=null==e?void 0:e.component,this.colSpan=null!==(t=null==e?void 0:e.colSpan)&&void 0!==t?t:12;else{const t=Qt(null!==(r=null==e?void 0:e.colSpan)&&void 0!==r?r:12);this.colSpan=t.colSpan,this.isEmpty=t.isEmpty}(null==e?void 0:e.localFilters)&&(this.localFilters=null==e?void 0:e.localFilters)}set(e){var t;this.component=e.component,this.colSpan=null!==(t=e.colSpan)&&void 0!==t?t:12,this.isEmpty=!e.component||void 0,this.localFilters=e.localFilters}setColSpan(e){this.colSpan=e}setComponent(e){this.component=e,this.isEmpty=void 0}emptyCell(e){const t=Qt(null!=e?e:12);this.colSpan=t.colSpan,this.isEmpty=t.isEmpty,this.component=void 0}}class rr{constructor(e,t){this.components=[],this.height=Yt,this.components=null!=e?e:[],this.height=null!=t?t:Yt,this.validateTotalColSpan()}addCell(e,t){void 0===t?this.components.push(e):this.components.splice(t,0,e),this.validateTotalColSpan()}setHeight(e){this.height=e}setRow(e){this.components=e,this.validateTotalColSpan()}set(e,t){this.components=e,this.height=null!=t?t:Yt,this.validateTotalColSpan()}validateTotalColSpan(){if(this.components.reduce(((e,t)=>e+t.colSpan),0)>12)throw new Error("Total column span of cells exceeds the allowed limit of 12.")}}const nr=t=>{return{id:t.id,parentDashboardId:t.parent_dashboard_id,isPlayground:!1,globalFilters:[...t.definition.globalFilters||[]].map(Kt),componentLibrary:[...t.definition.componentLibrary].map((e=>Zt(Object.assign(Object.assign({},e),{colSpan:e.colSpan||1})))),theme:Object.assign(Object.assign({},Ht),t.theme),display:(r=t.definition.display,r.map((t=>(t=>{const r=(e=>"components"in e?e:{components:e,height:Yt})(t),n=(0,e.sumBy)(r.components,(e=>null==e?1:0)),i=12-(0,e.sumBy)(r.components,(e=>null==e?0:e.colSpan)),o=Math.floor(i/n),a=[...r.components].map((e=>null===e?{isEmpty:!0,colSpan:o}:"isEmpty"in e||Jt(e)?e:Zt(Object.assign(Object.assign({},e),{colSpan:e.colSpan}))));return{components:er(a),height:r.height||Yt}})(t)))),webhookId:t.webhook_id||null,createdAt:new Date(t.created_at),updatedAt:new Date(t.updated_at),metadata:t.metadata||{}};var r},ir=(e,t,r)=>Object.assign(Object.assign({},e),{dataSets:$e(t,r)}),or=(e,t)=>e.find((e=>e.id==t))||null;class ar{constructor(e){this.component=void 0;let t={displayTitle:"New Header",colSpan:12};e&&(t=Object.assign(Object.assign({},t),{displayTitle:e}));const r={components:[t],height:null!=(n=52)?n:Yt};var n;this.component=[r]}setTitle(e){if(!this.component)throw new Error("Header is undefined");Jt(this.component[0].components[0])&&(this.component[0].components[0].displayTitle=e)}}class sr{constructor(e,t){if(this.dashboard=void 0,this.build=()=>{var e,t;if(!this.dashboard)throw new Error("Dashboard is undefined");return Object.assign(Object.assign({},this.dashboard),{display:null===(e=this.dashboard)||void 0===e?void 0:e.display,componentLibrary:null===(t=this.dashboard)||void 0===t?void 0:t.componentLibrary})},!e)throw new Error("Dashboard id is undefined");let r={id:e};(null==t?void 0:t.display)&&(r=Object.assign(Object.assign({},r),{display:lr(null==t?void 0:t.display)})),(null==t?void 0:t.customFields)&&(r=Object.assign(Object.assign({},r),{customFields:t.customFields})),(null==t?void 0:t.library)&&(r=Object.assign(Object.assign({},r),{componentLibrary:ur(null==t?void 0:t.library)})),this.dashboard=(e=>Object.assign({isPlayground:!1,display:[{components:[Qt(8),Qt(4)],height:Yt},{components:[Qt(4),Qt(4),Qt(4)],height:Yt}],componentLibrary:[],globalFilters:[],customFields:{}},e))(r)}setDisplay(e){let t=lr(e);if(!this.dashboard)throw new Error("Dashboard is undefined");this.dashboard.display=t}setCustomFields(e){if(!this.dashboard)throw new Error("Dashboard is undefined");this.dashboard.customFields=e}setLibrary(e){if(!this.dashboard)throw new Error("Dashboard is undefined");this.dashboard.componentLibrary=ur(e)}}function lr(e){let t=[];return e.forEach((e=>{var r,n;if(e instanceof rr){const n=null==e?void 0:e.components.map((e=>{var t;return e.component&&!e.isEmpty?{attributes:e.component.attributes,localFilters:null!==(t=e.localFilters)&&void 0!==t?t:[],updatesFromParameters:{},results:[],colSpan:e.colSpan,reports:[]}:(e.isEmpty,{colSpan:e.colSpan,isEmpty:!0})}));t.push({height:null!==(r=e.height)&&void 0!==r?r:Yt,components:n})}e instanceof ar&&(null===(n=e.component)||void 0===n||n.forEach((e=>{t.push({height:e.height,components:e.components})})))})),t}const ur=e=>{var t;let r=[];return null===(t=null==e?void 0:e.library)||void 0===t||t.forEach((e=>{var t;e.component&&e.component.attributes&&r.push({attributes:e.component.attributes,localFilters:null!==(t=e.localFilters)&&void 0!==t?t:[],updatesFromParameters:{},results:[],colSpan:1,reports:[]})})),r};class cr{constructor(e){this.library=void 0,this.library=[],(null==e?void 0:e.components)&&(null==e||e.components.forEach((e=>{var t;const r=new tr({component:e,colSpan:1});null===(t=this.library)||void 0===t||t.push(r)})))}addComponent(e,t){var r,n;const i=new tr({component:e,colSpan:1,localFilters:null==t?void 0:t.localFilters});void 0===(null==t?void 0:t.position)?null===(r=this.library)||void 0===r||r.push(i):null===(n=this.library)||void 0===n||n.splice(t.position,0,i)}addComponents(e){e.forEach((e=>{var t;const r=new tr({component:e,colSpan:1});null===(t=this.library)||void 0===t||t.push(r)}))}}const dr=e=>()=>{return t=void 0,r=void 0,i=function*(){const{status:t,body:r}=yield e({path:"/api/v2/parent-dashboards",method:"get"});if(200==t)return r.dashboards.map((e=>({id:e.id,created_at:e.created_at,updated_at:e.updated_at,webhook_id:e.webhook_id})))},new((n=void 0)||(n=Promise))((function(e,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof n?r:new n((function(e){e(r)}))).then(a,s)}l((i=i.apply(t,r||[])).next())}));var t,r,n,i};const fr=e=>t=>{return r=void 0,n=void 0,o=function*(){const{status:r}=yield e({path:"/api/scheduled-report",method:"post",body:{cronSchedule:t.cronSchedule,dashboardAccessToken:t.dashboardAccessToken,scheduledReportId:t.scheduledReportId}});return 200==r},new((i=void 0)||(i=Promise))((function(e,t){function a(e){try{l(o.next(e))}catch(e){t(e)}}function s(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(a,s)}l((o=o.apply(r,n||[])).next())}));var r,n,i,o};class pr extends Error{constructor(e){super(e),this.name="FailedToCreateDashboardAccess"}}const hr=pr;const mr=e=>(t,r,n)=>{return i=void 0,o=void 0,s=function*(){const{body:i,status:o}=yield e({path:"/api/v2/auth/dashboards/access",method:"post",body:{dashboardAccessToken:t,dashboardAdminOverrideToken:r},abortSignal:n});if(200==o)return{permissions:i.permissions.map((e=>({dashboardId:e.dashboard_id,scope:e.scope,token:e.token,userReference:e.user_reference})))};throw new hr("Failed to fetch dashboard access")},new((a=void 0)||(a=Promise))((function(e,t){function r(e){try{l(s.next(e))}catch(e){t(e)}}function n(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(r,n)}l((s=s.apply(i,o||[])).next())}));var i,o,a,s};class gr extends Error{constructor(e){super(e),this.name="FailedToGetDashboard"}}const yr=gr;const vr=e=>(t,r)=>{return n=void 0,i=void 0,a=function*(){const{body:n,status:i}=yield e({path:"/api/v2/multi-get-dashboard",method:"post",body:{dashboardAccessTokens:t},abortSignal:r});if(200==i)return n;throw new yr("Failed to get dashboard from POST /api/v2/multi-get-dashboard.")},new((o=void 0)||(o=Promise))((function(e,t){function r(e){try{l(a.next(e))}catch(e){t(e)}}function s(e){try{l(a.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(r,s)}l((a=a.apply(n,i||[])).next())}));var n,i,o,a};const br=e=>t=>{return r=void 0,n=void 0,o=function*(){const{body:r,status:n}=yield e({path:"/api/v2/multi-get-dashboard",method:"post",body:{dashboardAccessTokens:t}});if(200==n)return r;throw new yr("Failed to get potentially encrypted dashboard from POST /api/v2/multi-get-dashboard.")},new((i=void 0)||(i=Promise))((function(e,t){function a(e){try{l(o.next(e))}catch(e){t(e)}}function s(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(a,s)}l((o=o.apply(r,n||[])).next())}));var r,n,i,o};class _r extends Error{constructor(e){super(e),this.name="FailedToCreateDashboard"}}const wr=_r;class xr extends Error{constructor(e){super(e),this.name="DashboardQuotaReached"}}const Ar=xr;const jr=e=>t=>{return r=void 0,n=void 0,o=function*(){const{body:r,status:n}=yield e({path:"/api/v2/dashboard",method:"post",body:{dashboardAccessToken:t.dashboardAccessToken,definition:t.definition,meta:t.meta||{},parentDashboardId:t.parentDashboardId,permissions:t.permissions}});if(200==n)return{dashboard:r.dashboard,permissions:r.permissions};if(422==n)throw new Ar(`Dashboard quota reached; ${JSON.stringify(r)}`);throw new wr("Failed to update the dashboard from POST /api/v2/dashboard")},new((i=void 0)||(i=Promise))((function(e,t){function a(e){try{l(o.next(e))}catch(e){t(e)}}function s(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(a,s)}l((o=o.apply(r,n||[])).next())}));var r,n,i,o};class Sr extends Error{constructor(e){super(e),this.name="FailedToUpdateDashboard"}}const kr=Sr;const Cr=e=>t=>{return r=void 0,n=void 0,o=function*(){const{body:r,status:n}=yield e({path:"/api/v2/dashboard",method:"put",body:Object.assign({},t)});if(200==n)return r;throw new kr("Failed to update dashboard from PUT /api/v2/dashboard.")},new((i=void 0)||(i=Promise))((function(e,t){function a(e){try{l(o.next(e))}catch(e){t(e)}}function s(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(a,s)}l((o=o.apply(r,n||[])).next())}));var r,n,i,o};class $r extends Error{constructor(){super("AI usage limit has been reached.")}}const Or=$r;const Fr=t=>(r,n,i,o)=>{return a=void 0,s=void 0,u=function*(){const{body:a,status:s}=yield t({path:"/api/ai",method:"post",body:{question:r,supported_aggregates:Object.keys(o.supportedAggregates),data_set_fields:[...i.fields].map((e=>({id:e.id,name:e.publicName}))),dashboard_access_token:n}});if(200==s)return((t,r,n)=>{var i,o;let a={},s=(null===(i=t.measure)||void 0===i?void 0:i.filter((e=>{try{return je(r,e.field).canBeMeasure}catch(e){return!1}})))||[];s=s.map((e=>{const t=je(r,e.field),i=_(t,n.supportedAggregates);return w(t,n.supportedAggregates).includes(e.function)?e:{field:e.field,function:i}}));let l=(null===(o=t.dimension)||void 0===o?void 0:o.filter((e=>{try{return je(r,e).canBeDimension}catch(e){return!1}})).map((e=>({field:e,function:"none"}))))||[];return(0,e.isEmpty)(s)||(a.measure=s),(0,e.isEmpty)(l)||(a.dimension=l),a})(a,i,o);if(422==s||429==s)throw new Or;throw"Failed to fetch query attributes from AI."},new((l=void 0)||(l=Promise))((function(e,t){function r(e){try{i(u.next(e))}catch(e){t(e)}}function n(e){try{i(u.throw(e))}catch(e){t(e)}}function i(t){var i;t.done?e(t.value):(i=t.value,i instanceof l?i:new l((function(e){e(i)}))).then(r,n)}i((u=u.apply(a,s||[])).next())}));var a,s,l,u};class Tr extends Error{constructor(e){super(`Failed to save Vizzly config. Received status code ${e}.`),this.name="FailedToSaveVizzlyConfigVersion"}}var Dr;!function(e){e.ConfigStore="cnf_",e.Project="prj_",e.KeyPair="kyp_",e.Dashboard="dsh_",e.ProjectApiKey="vizzly_project_api_key_"}(Dr||(Dr={}));const Er=e=>(t,r)=>{return n=void 0,i=void 0,a=function*(){const{status:n}=yield e({path:`/api/v3/project/${t}/config`,method:"post",body:{projectId:t,encryptedConfig:r},preFetchProjectAccessTokens:t?{projectId:t,resourceFilters:[Dr.Project,Dr.ConfigStore]}:void 0});if(200!=n)throw new Tr(n);return 200==n},new((o=void 0)||(o=Promise))((function(e,t){function r(e){try{l(a.next(e))}catch(e){t(e)}}function s(e){try{l(a.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(r,s)}l((a=a.apply(n,i||[])).next())}));var n,i,o,a};class Pr extends Error{constructor(e){super(`Failed to setup project by saving an encrypted connection and config on the Vizzly API. Received status code ${e}.`),this.name="VizzlyApiCallErrorFailedToSetupProject",this.statusCode=e}}const Rr=e=>(t,r,n)=>{return i=void 0,o=void 0,s=function*(){const{status:i}=yield e({path:"/api/v3/project/connection",method:"post",body:{projectId:t,encryptedConfig:n,encryptedConnection:r},preFetchProjectAccessTokens:{projectId:t,resourceFilters:[Dr.Project]}});if(200!=i)throw new Pr(i);return 200==i},new((a=void 0)||(a=Promise))((function(e,t){function r(e){try{l(s.next(e))}catch(e){t(e)}}function n(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(r,n)}l((s=s.apply(i,o||[])).next())}));var i,o,a,s};const Ir=e=>t=>{return r=void 0,n=void 0,o=function*(){const r=`/api/v3/project/${t}/config`,{status:n,body:i}=yield e({path:r,method:"get",preFetchProjectAccessTokens:{projectId:t,resourceFilters:[Dr.ConfigStore]}});if(200==n)return{encryptedConfig:i.encrypted_config};v("HTTP request to fetch Config returned non-200.",r,n,i)},new((i=void 0)||(i=Promise))((function(e,t){function a(e){try{l(o.next(e))}catch(e){t(e)}}function s(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(a,s)}l((o=o.apply(r,n||[])).next())}));var r,n,i,o};const Mr=e=>t=>{return r=void 0,n=void 0,o=function*(){const{status:r,body:n}=yield e({path:`/api/v2/project/${t}/connection`,method:"get",preFetchProjectAccessTokens:{projectId:t,resourceFilters:[Dr.Project]}});return 200==r?{status:r,encryptedCredentials:n.encrypted_credentials}:{status:r}},new((i=void 0)||(i=Promise))((function(e,t){function a(e){try{l(o.next(e))}catch(e){t(e)}}function s(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(a,s)}l((o=o.apply(r,n||[])).next())}));var r,n,i,o};const qr=e=>t=>{return r=void 0,n=void 0,o=function*(){const{body:r}=yield e({path:`/api/v3/project/${t}/api-key`,method:"post",body:{},preFetchProjectAccessTokens:{projectId:t,resourceFilters:[Dr.Project]}});return r.api_key},new((i=void 0)||(i=Promise))((function(e,t){function a(e){try{l(o.next(e))}catch(e){t(e)}}function s(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(a,s)}l((o=o.apply(r,n||[])).next())}));var r,n,i,o};const Lr=e=>(t,r,n)=>{return i=void 0,o=void 0,s=function*(){const{body:i}=yield e({path:`/api/v3/project/${t}/api-key/${r}`,method:"put",body:Object.assign({},n),preFetchProjectAccessTokens:{projectId:t,resourceFilters:[Dr.Project,Dr.ProjectApiKey]}});return i.api_key},new((a=void 0)||(a=Promise))((function(e,t){function r(e){try{l(s.next(e))}catch(e){t(e)}}function n(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(r,n)}l((s=s.apply(i,o||[])).next())}));var i,o,a,s};const Nr=e=>t=>{return r=void 0,n=void 0,o=function*(){const{status:r,body:n}=yield e({path:`/api/v3/project/${t}`,method:"get",preFetchProjectAccessTokens:{projectId:t,resourceFilters:[Dr.Project]}});return 200==r?n.project:null},new((i=void 0)||(i=Promise))((function(e,t){function a(e){try{l(o.next(e))}catch(e){t(e)}}function s(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(a,s)}l((o=o.apply(r,n||[])).next())}));var r,n,i,o};const zr=e=>(t,r,n)=>{return i=void 0,o=void 0,s=function*(){const{status:i,body:o}=yield e({path:`/api/v3/project/${t}/query-engine-user`,method:"post",body:{email:r,password:n},preFetchProjectAccessTokens:{projectId:t,resourceFilters:[Dr.Project]}});return 200==i},new((a=void 0)||(a=Promise))((function(e,t){function r(e){try{l(s.next(e))}catch(e){t(e)}}function n(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(r,n)}l((s=s.apply(i,o||[])).next())}));var i,o,a,s};const Br=e=>(t,r)=>{return n=void 0,i=void 0,a=function*(){const{status:n,body:i}=yield e({path:`/api/v3/project/${t}/query-engine-user?email=${encodeURIComponent(r)}`,method:"get",preFetchProjectAccessTokens:{projectId:t,resourceFilters:[Dr.Project]}});if(200==n)return i.query_engine_user},new((o=void 0)||(o=Promise))((function(e,t){function r(e){try{l(a.next(e))}catch(e){t(e)}}function s(e){try{l(a.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(r,s)}l((a=a.apply(n,i||[])).next())}));var n,i,o,a};const Ur=e=>t=>{return r=void 0,n=void 0,o=function*(){const{status:r,body:n}=yield e({path:`/api/v3/project/${t}/organisation-team-members`,method:"get",preFetchProjectAccessTokens:{projectId:t,resourceFilters:["prj_"]}});if(200==r)return n.team_members},new((i=void 0)||(i=Promise))((function(e,t){function a(e){try{l(o.next(e))}catch(e){t(e)}}function s(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(a,s)}l((o=o.apply(r,n||[])).next())}));var r,n,i,o};const Vr=e=>t=>{return r=void 0,n=void 0,o=function*(){let r={};t&&(r={auth:`Bearer ${t}`});const{body:n,status:i}=yield e({path:"/api/v2/project/self-hosted-query-engine",method:"post",body:{},headers:r});return 200==i?n.project:void 0},new((i=void 0)||(i=Promise))((function(e,t){function a(e){try{l(o.next(e))}catch(e){t(e)}}function s(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(a,s)}l((o=o.apply(r,n||[])).next())}));var r,n,i,o};const Wr=e=>t=>{return r=void 0,n=void 0,o=function*(){let r={};t&&(r={auth:`Bearer ${t}`});const{body:n,status:i}=yield e({path:"/api/v2/project/self-hosted-dynamic-query-engine",method:"post",body:{},headers:r});return 200==i?n.project:void 0},new((i=void 0)||(i=Promise))((function(e,t){function a(e){try{l(o.next(e))}catch(e){t(e)}}function s(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(a,s)}l((o=o.apply(r,n||[])).next())}));var r,n,i,o};const Gr=e=>t=>{return r=void 0,n=void 0,o=function*(){let r={};t&&(r={auth:`Bearer ${t}`});const{body:n,status:i}=yield e({path:"/api/v2/project/self-hosted-in-browser",method:"post",body:{},headers:r});return 200==i?n.project:void 0},new((i=void 0)||(i=Promise))((function(e,t){function a(e){try{l(o.next(e))}catch(e){t(e)}}function s(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(a,s)}l((o=o.apply(r,n||[])).next())}));var r,n,i,o};const Yr=e=>(t,r,n)=>{return i=void 0,o=void 0,s=function*(){let i={};n&&(i={auth:`Bearer ${n}`});const{status:o,body:a}=yield e({path:`/api/v2/project/managed-query-engine/${t}/key-pairs/${r}`,method:"get",headers:i});if(200==o)return{privateKey:a.keys.private_key,publicKey:a.keys.public_key}},new((a=void 0)||(a=Promise))((function(e,t){function r(e){try{l(s.next(e))}catch(e){t(e)}}function n(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(r,n)}l((s=s.apply(i,o||[])).next())}));var i,o,a,s};class Hr extends ae{constructor(e){super(`Failed to save an encrypted secret for ${e}`),this.name="FailedToSaveProjectEncryptedEncryptionSecret"}}class Kr extends ae{constructor(e){super(`An encrypted secret has already been saved for ${e}`),this.name="ProjectEncryptedSecretAlreadySaved"}}const Xr=e=>(t,r,n=!1)=>{return i=void 0,o=void 0,s=function*(){const{status:i}=yield e({path:`/api/v3/project/${t}/encrypted-encryption-secret`,method:"post",body:{projectId:t,encryptedEncryptionSecret:r,allowRotation:n},preFetchProjectAccessTokens:{projectId:t,resourceFilters:[Dr.Project]}});if(400==i&&n)throw new Hr(t);if(400==i&&!n)throw new Kr(t);return 200==i},new((a=void 0)||(a=Promise))((function(e,t){function r(e){try{l(s.next(e))}catch(e){t(e)}}function n(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(r,n)}l((s=s.apply(i,o||[])).next())}));var i,o,a,s};class Zr extends Error{constructor(e){super(e),this.name="ReadPermissionNotFound"}}const Qr=Zr;class Jr extends Error{constructor(e){super(e),this.name="WritePermissionNotFound"}}const en=Jr,tn=(e,t)=>{const r=t.find((t=>t.dashboardId==e&&"read_write"==t.scope));if(!r)throw new en(`Cannot find write permission for dashboard ${e}`);return r};function rn(e,t,r,n){return i=this,o=void 0,s=function*(){let i;const o=Object.assign(Object.assign({},e),{dashboardAccessToken:t.dashboardAccess.signature});if("vizzlyApi"===r.strategy)i=yield n.createDashboard(o);else{if("queryEngine"!==r.strategy)throw`Unsupported strategy for creating dashboard ${JSON.stringify(r)}`;{const e=(a=r.endpoint,e=>{return t=void 0,r=void 0,i=function*(){let t=Bt(a);const{body:r,status:n}=yield t({path:"/api/v1/dashboard",method:"post",body:{dashboardAccessToken:e.dashboardAccessToken,definition:e.definition,meta:e.meta||{},parentDashboardId:e.parentDashboardId,permissions:e.permissions}});if(200==n)return{dashboard:r.dashboard,permissions:r.permissions};if(422==n)throw new Ar(`Dashboard quota reached; ${JSON.stringify(r)}`);throw new wr("Failed to update the dashboard from POST /api/v2/dashboard")},new((n=void 0)||(n=Promise))((function(e,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof n?r:new n((function(e){e(r)}))).then(a,s)}l((i=i.apply(t,r||[])).next())}));var t,r,n,i});i=yield e(o)}}var a;return i},new((a=void 0)||(a=Promise))((function(e,t){function r(e){try{l(s.next(e))}catch(e){t(e)}}function n(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(r,n)}l((s=s.apply(i,o||[])).next())}));var i,o,a,s}function nn(e,t,r){return n=this,i=void 0,a=function*(){let n;if("vizzlyApi"===e.strategy)n=yield t.updateDashboard(r);else{if("queryEngine"!==e.strategy)throw`Unsupported strategy for updating dashboard ${JSON.stringify(e)}`;{const t=(i=e.endpoint,e=>{return t=void 0,r=void 0,o=function*(){let t=Bt(i);const{body:r,status:n}=yield t({path:"/api/v1/dashboard",method:"put",body:Object.assign({},e)});if(200==n)return r;throw new kr("Failed to update dashboard from PUT /api/v1/dashboard.")},new((n=void 0)||(n=Promise))((function(e,i){function a(e){try{l(o.next(e))}catch(e){i(e)}}function s(e){try{l(o.throw(e))}catch(e){i(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof n?r:new n((function(e){e(r)}))).then(a,s)}l((o=o.apply(t,r||[])).next())}));var t,r,n,o});n=yield t(r)}}var i;return n},new((o=void 0)||(o=Promise))((function(e,t){function r(e){try{l(a.next(e))}catch(e){t(e)}}function s(e){try{l(a.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(r,s)}l((a=a.apply(n,i||[])).next())}));var n,i,o,a}function on(e,t,r,n){const i=nr(e.dashboard),o=ir(i,t,e.dashboard.definition.customFields||{});return{newDashboards:[...r].flatMap((e=>e.id==o.id?n.deleted?[]:[o]:[e])),updatedDashboard:o}}function an(e,t,r,n){return i=this,o=void 0,s=function*(){let i;if("vizzlyApi"==e.strategy)i=yield t.multiGetDashboards(r,n.signal);else{if("queryEngine"!==e.strategy)throw`Unsupported strategy for fetching dashboards ${JSON.stringify(e)}`;{const t=(o=e.endpoint,(e,t)=>{return r=void 0,n=void 0,a=function*(){let r=Bt(o);const{body:n,status:i}=yield r({path:"/api/v1/get-dashboards",method:"post",body:{dashboardAccessTokens:e},abortSignal:t});if(200==i)return n;throw new yr("Failed to get dashboard from POST /api/v1/get-dashboards")},new((i=void 0)||(i=Promise))((function(e,t){function o(e){try{l(a.next(e))}catch(e){t(e)}}function s(e){try{l(a.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(o,s)}l((a=a.apply(r,n||[])).next())}));var r,n,i,a});i=yield t(r,n.signal)}}var o;return i},new((a=void 0)||(a=Promise))((function(e,t){function r(e){try{l(s.next(e))}catch(e){t(e)}}function n(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(r,n)}l((s=s.apply(i,o||[])).next())}));var i,o,a,s}const sn={strategy:"vizzlyApi"};function ln(t){return function(e,t){return[...e].map((e=>((e,t)=>{const r=t.find((t=>t.dashboardId==e));if(!r)throw new Qr(`Cannot find read permission for dashboard ${e}`);return r})(e,t).token))}((t=>{let r=[...t].map((e=>e.dashboardId));return(0,e.uniq)(r)})(t),t)}function un(e){if(Array.isArray(e))return[...e].map((e=>({id:e.id,parentDashboardId:e.parentDashboardId,display:e.display,componentLibrary:e.componentLibrary,createdAt:e.createdAt,updatedAt:e.updatedAt,metadata:e.metadata})));throw new Error("dashboards must be an array")}const cn=(t,r)=>{const n=(0,e.cloneDeep)(r).filter((e=>e.parentDashboardId==t));return(0,e.sortBy)(n,(e=>e.updatedAt)).reverse()};class dn extends Error{constructor(e){super(e),this.name="FailedToLoadIdentity"}}const fn=dn;class pn extends Error{constructor(e){super(e),this.name="InvalidIdentityReturn"}}const hn=pn,mn=e=>{const t=(e=>{var t;const r=null===(t=e.split("."))||void 0===t?void 0:t[1];return JSON.parse((n=r,"object"==typeof window&&window&&window.atob?window.atob(n):Buffer.from(n,"base64").toString()).toString());var n})(e);return Object.assign(Object.assign({},t),{signature:e})};const gn=e=>{return t=void 0,r=void 0,i=function*(){let t=yield e();if(t=(e=>{if(!e)throw new hn("Failed to load identity.");const{error:t}=R().object({dashboardAccessToken:R().string().required(),dataAccessToken:R().string(),queryEngineAccessToken:R().string(),projectAccessToken:R().string().optional()}).validate(e);if(t)throw new hn(t.message);return e})(t),!t)throw new fn("Failed to fetch identity config.");const r=(n=window.location.href).split("#vizzly_")[1]||new URLSearchParams(new URL(n).search).get("_vizzlyDashboardAdmin")||null;var n;return{identityConfig:((e,t,r,n)=>{let i=mn(e);"scope"in i||(i.scope="read_write");const o={dashboardAccess:i,dataAccess:t?mn(t):void 0,queryEngineAccessConfig:r?mn(r):void 0,dashboardAdminOverride:n?mn(n):void 0};return(e=>{const t=new Date,r=new Date(e.dashboardAccess.expires),n=!!e.dataAccess&&new Date(e.dataAccess.expires);!1!==n&&n<t&&console.warn("Vizzly data access token expired at;",n),r<t&&console.warn("Vizzly dashboard access token expired at;",r)})(o),o})(t.dashboardAccessToken,t.dataAccessToken,t.queryEngineAccessToken,r),tokens:t}},new((n=void 0)||(n=Promise))((function(e,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof n?r:new n((function(e){e(r)}))).then(a,s)}l((i=i.apply(t,r||[])).next())}));var t,r,n,i};var yn=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((n=n.apply(e,t||[])).next())}))};class vn{constructor(e,t,r){this.abortController=new AbortController,this.identityTokens=null,this.permissions=null,this.identityConfig=null,this.dashboardStorageStrategy=sn,this.dashboards=void 0,this.parentDashboardId=void 0,this.loading=!1,this.parentDashboardId=null==r?void 0:r.parentDashboardId,this.identity=e,this.permissions=[],this.loadQueryEngineConfig=t,this.vizzlyAPI=(e=>{const t=Nt(e);return{config:e,getParentDashboards:dr(t),saveScheduledReport:fr(t),createDashboardAccess:mr(t),multiGetDashboards:vr(t),multiGetEncryptedDashboards:br(t),createDashboard:jr(t),updateDashboard:Cr(t),askAi:Fr(t),createVizzlyConfigVersion:Er(t),getVizzlyConfig:Ir(t),saveConnection:Rr(t),getConnection:Mr(t),createProjectApiKey:qr(t),updateProjectApiKey:Lr(t),getProjectAccessToken:qt(t),getProject:Nr(t),createQueryEngineUser:zr(t),getQueryEngineUser:Br(t),getProjectTeamMembers:Ur(t),createSelfHostedQueryEngineProject:Vr(t),createSelfHostedDynamicQueryEngineProject:Wr(t),createSelfHostedInBrowserQueryEngineProject:Gr(t),getManagedQueryEngineKeyPair:Yr(t),saveEncryptedProjectEncryptionSecret:Xr(t)}})((null==r?void 0:r.vizzlyApiHost)||{host:"https://api.vizzly.co"})}getDashboards(){var e;return yn(this,void 0,void 0,(function*(){this.loading=!0;try{this.identityTokens&&this.identityConfig||(yield this.fetchIdentityConfig()),null!==this.permissions&&0!==this.permissions.length||(yield this.getPermissions());const n=ln(null!==(e=this.permissions)&&void 0!==e?e:[]),i=(t=yield an(this.dashboardStorageStrategy,this.vizzlyAPI,n,this.abortController),r=[],t.found.map((e=>{const t=nr(e);return ir(t,r,e.definition.customFields||{})})));return this.dashboards=i,this.loading=!1,cn(this.getDefaultParentDashboardIdBase(),un(i))}catch(e){this.loading=!1,b(e)}var t,r}))}getAllChildDashboards(){return yn(this,void 0,void 0,(function*(){this.loading=!0;try{return yield this.checkEverythingIsDefined(),this.loading=!1,t=un(this.dashboards),(0,e.cloneDeep)(t).filter((e=>null!=e.parentDashboardId))}catch(e){this.loading=!1,b(e)}var t}))}getParentDashboards(){return yn(this,void 0,void 0,(function*(){this.loading=!0;try{yield this.checkEverythingIsDefined();const r=(t=un(this.dashboards),(0,e.cloneDeep)(t).filter((e=>null==e.parentDashboardId)));return this.loading=!1,r}catch(e){this.loading=!1,b(e)}var t}))}getChildDashboards(e){return yn(this,void 0,void 0,(function*(){this.loading=!0;try{return yield this.checkEverythingIsDefined(),this.loading=!1,cn(e,un(this.dashboards))}catch(e){this.loading=!1,b(e)}}))}createDashboard(e){var t,r;return yn(this,void 0,void 0,(function*(){this.loading=!0;try{yield this.checkEverythingIsDefined();const n=null!==(t=e.parentDashboardId)&&void 0!==t?t:this.parentDashboardId;if(!n)throw"Cannot create a child dashboard from an undefined parent dashboard which does not exist.";const i=or(this.dashboards||[],n);if(!i)throw"Cannot create a child dashboard from a parent dashboard which does not exist.";if(null!==this.identityConfig){const t=Object.assign(Object.assign({},function(e,t){return{definition:{display:e.definition.display,componentLibrary:e.definition.componentLibrary,isPlayground:!1,globalFilters:[],customFields:{}},meta:e.meta,parentDashboardId:t.id,permissions:[{scope:"read_write"}]}}(e,i)),{dashboardAccessToken:this.identityConfig.dashboardAccess.signature}),n=yield rn(t,this.identityConfig,this.dashboardStorageStrategy,this.vizzlyAPI);if(n){const{createdDashboard:e,formattedPermissions:t}=function(e,t){const r=nr(e.dashboard);return{createdDashboard:ir(r,[],e.dashboard.definition.customFields||{}),formattedPermissions:e.permissions.map((e=>({dashboardId:e.dashboard_id,scope:e.scope,token:e.token,userReference:e.user_reference})))}}(n);return null===(r=this.dashboards)||void 0===r||r.push(e),this.permissions=null===this.permissions?[...t]:[...this.permissions,...t],this.loading=!1,e}}}catch(e){this.loading=!1,b(e)}}))}updateDashboard(e,t){return yn(this,void 0,void 0,(function*(){this.loading=!0;try{yield this.checkEverythingIsDefined();const r=function(e){return{meta:e.metadata}}(t),n=tn(e,this.permissions),i=Object.assign(Object.assign({},r),{dashboardSessionToken:n.token}),o=yield nn(this.dashboardStorageStrategy,this.vizzlyAPI,i),{newDashboards:a,updatedDashboard:s}=on(o,[],this.dashboards||[],r);return this.dashboards=a,this.loading=!1,s}catch(e){this.loading=!1,b(e)}}))}deleteDashboard(e){return yn(this,void 0,void 0,(function*(){this.loading=!0;try{yield this.checkEverythingIsDefined();const t={},r=tn(e,this.permissions),n=yield nn(this.dashboardStorageStrategy,this.vizzlyAPI,{deleted:!0,dashboardSessionToken:r.token}),{newDashboards:i,updatedDashboard:o}=on(n,[],this.dashboards||[],t);return this.dashboards=i,this.loading=!1,o}catch(e){this.loading=!1,b(e)}}))}isAdmin(){var e,t;return yn(this,void 0,void 0,(function*(){return this.identityTokens&&this.identityConfig||(yield this.fetchIdentityConfig()),(null===(e=this.identityConfig)||void 0===e?void 0:e.dashboardAdminOverride)?"admin":null===(t=this.identityConfig)||void 0===t?void 0:t.dashboardAccess.accessType}))}getDefaultParentDashboardId(){return yn(this,void 0,void 0,(function*(){return yield this.checkEverythingIsDefined(),this.getDefaultParentDashboardIdBase()}))}checkEverythingIsDefined(){return yn(this,void 0,void 0,(function*(){if(this.identityTokens&&this.identityConfig||(yield this.fetchIdentityConfig()),null===this.permissions||0===this.permissions.length){const e=yield this.getPermissions();this.permissions=null!=e?e:this.permissions}void 0===this.dashboards&&(yield this.getDashboards())}))}fetchIdentityConfig(){return yn(this,void 0,void 0,(function*(){const[e,{identityConfig:t,tokens:r}]=yield Promise.all([Wt(this.loadQueryEngineConfig),gn(this.identity)]);return this.identityConfig=t,this.identityTokens=r,this.dashboardStorageStrategy=((e,t)=>"function"!=typeof e&&e&&t&&t.supportedFeatures.includes("encryptedDashboards")?{strategy:"queryEngine",endpoint:e}:sn)(this.loadQueryEngineConfig,e),{identityConfig:t,tokens:r}}))}getPermissions(){var e,t;return yn(this,void 0,void 0,(function*(){try{if(null!==this.identityConfig){const{permissions:r}=yield this.vizzlyAPI.createDashboardAccess(this.identityConfig.dashboardAccess.signature,null===(t=null===(e=this.identityConfig)||void 0===e?void 0:e.dashboardAdminOverride)||void 0===t?void 0:t.signature,this.abortController.signal);return this.permissions=r,r}}catch(e){b(e)}}))}getDefaultParentDashboardIdBase(){if(this.identityConfig&&Array.isArray(this.dashboards))return((e,t,r)=>{if(e){const t=or(r,e);if(null==t?void 0:t.parentDashboardId)throw"[Vizzly] `parentDashboardId` value must specify an ID for a parent dashboard.";return e}const n=(e=>[...e].filter((e=>null==e.parentDashboardId)))(r);return(e=>{const t=e.filter((e=>e.isProgrammatic));if(0!==t.length){if(t.length>1)throw new Error("There should only be one programmatic dashboard");return t[0].id}})(n)||t||(e=>{if(0==e.length)throw"Cannot get first created dashboard from empty list of dashboards.";return[...e].sort(((e,t)=>{var r=new Date(e.createdAt),n=new Date(t.createdAt);return r.getTime()-n.getTime()}))[0]})(n).id})(this.parentDashboardId,this.identityConfig.dashboardAccess.dashboardId,this.dashboards);throw"Cannot get default parent dashboard id without identity config."}}class bn{static load(e){return t=this,r=void 0,i=function*(){try{return this.queryEngineEndpoint=e,this.queryEngineConfig=yield Wt(e),this.queryEngineConfig}catch(e){return console.error("Error loading vizzly configuration:",e),null}},new((n=void 0)||(n=Promise))((function(e,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof n?r:new n((function(e){e(r)}))).then(a,s)}l((i=i.apply(t,r||[])).next())}));var t,r,n,i}static get Dashboard(){return sr}static get Library(){return cr}static get Cell(){return tr}static get Row(){return rr}static get Header(){return ar}static get API(){return vn}}bn.queryEngineConfig=void 0,bn.queryEngineEndpoint=void 0,bn.AreaChart=class extends $t{constructor(e,t){super("areaChart",e,t)}},bn.LineChart=class extends $t{constructor(e,t){super("lineChart",e,t)}},bn.BarChart=class extends $t{constructor(e,t){super("barChart",e,t)}},bn.PieChart=class extends $t{constructor(e,t){super("pieChart",e,t)}},bn.ScatterChart=class extends $t{constructor(e,t){super("scatterChart",e,t)}},bn.ComboChart=class extends $t{constructor(e,t){super("comboChart",e,t)}},bn.PivotTable=class extends $t{constructor(e,t){super("dataTable",e,t)}},bn.BasicTable=class extends $t{constructor(e,t){super("basicTable",e,t)}},bn.HorizontalBarChart=class extends $t{constructor(e,t){super("horizontalBarChart",e,t)}},bn.MercatorMap=class extends $t{constructor(e,t){super("mercatorMap",e,t)}},bn.SingleStat=class extends $t{constructor(e,t){super("singleStat",e,t)}}})();var i=n.D;export{i as Vizzly};
|
|
2
|
+
var e={307:(e,t,r)=>{r(168),e.exports=self.fetch.bind(self)},903:e=>{var t;self,t=()=>{return e={7629:(e,t,r)=>{const n=r(375),i=r(8571),o=r(9474),a=r(1687),s=r(8652),l=r(8160),u=r(3292),c=r(6354),d=r(8901),f=r(9708),p=r(6914),h=r(2294),m=r(6133),g=r(1152),y=r(8863),v=r(2036),b={Base:class{constructor(e){this.type=e,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new h.Ids,this._preferences=null,this._refs=new m.Manager,this._cache=null,this._valids=null,this._invalids=null,this._flags={},this._rules=[],this._singleRules=new Map,this.$_terms={},this.$_temp={ruleset:null,whens:{}}}describe(){return n("function"==typeof f.describe,"Manifest functionality disabled"),f.describe(this)}allow(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return l.verifyFlat(t,"allow"),this._values(t,"_valids")}alter(e){n(e&&"object"==typeof e&&!Array.isArray(e),"Invalid targets argument"),n(!this._inRuleset(),"Cannot set alterations inside a ruleset");const t=this.clone();t.$_terms.alterations=t.$_terms.alterations||[];for(const r in e){const i=e[r];n("function"==typeof i,"Alteration adjuster for",r,"must be a function"),t.$_terms.alterations.push({target:r,adjuster:i})}return t.$_temp.ruleset=!1,t}artifact(e){return n(void 0!==e,"Artifact cannot be undefined"),n(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",e)}cast(e){return n(!1===e||"string"==typeof e,"Invalid to value"),n(!1===e||this._definition.cast[e],"Type",this.type,"does not support casting to",e),this.$_setFlag("cast",!1===e?void 0:e)}default(e,t){return this._default("default",e,t)}description(e){return n(e&&"string"==typeof e,"Description must be a non-empty string"),this.$_setFlag("description",e)}empty(e){const t=this.clone();return void 0!==e&&(e=t.$_compile(e,{override:!1})),t.$_setFlag("empty",e,{clone:!1})}error(e){return n(e,"Missing error"),n(e instanceof Error||"function"==typeof e,"Must provide a valid Error object or a function"),this.$_setFlag("error",e)}example(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n(void 0!==e,"Missing example"),l.assertOptions(t,["override"]),this._inner("examples",e,{single:!0,override:t.override})}external(e,t){return"object"==typeof e&&(n(!t,"Cannot combine options with description"),t=e.description,e=e.method),n("function"==typeof e,"Method must be a function"),n(void 0===t||t&&"string"==typeof t,"Description must be a non-empty string"),this._inner("externals",{method:e,description:t},{single:!0})}failover(e,t){return this._default("failover",e,t)}forbidden(){return this.presence("forbidden")}id(e){return e?(n("string"==typeof e,"id must be a non-empty string"),n(/^[^\.]+$/.test(e),"id cannot contain period character"),this.$_setFlag("id",e)):this.$_setFlag("id",void 0)}invalid(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return this._values(t,"_invalids")}label(e){return n(e&&"string"==typeof e,"Label name must be a non-empty string"),this.$_setFlag("label",e)}meta(e){return n(void 0!==e,"Meta cannot be undefined"),this._inner("metas",e,{single:!0})}note(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];n(t.length,"Missing notes");for(const e of t)n(e&&"string"==typeof e,"Notes must be non-empty strings");return this._inner("notes",t)}only(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return n("boolean"==typeof e,"Invalid mode:",e),this.$_setFlag("only",e)}optional(){return this.presence("optional")}prefs(e){n(e,"Missing preferences"),n(void 0===e.context,"Cannot override context"),n(void 0===e.externals,"Cannot override externals"),n(void 0===e.warnings,"Cannot override warnings"),n(void 0===e.debug,"Cannot override debug"),l.checkPreferences(e);const t=this.clone();return t._preferences=l.preferences(t._preferences,e),t}presence(e){return n(["optional","required","forbidden"].includes(e),"Unknown presence mode",e),this.$_setFlag("presence",e)}raw(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.$_setFlag("result",e?"raw":void 0)}result(e){return n(["raw","strip"].includes(e),"Unknown result mode",e),this.$_setFlag("result",e)}required(){return this.presence("required")}strict(e){const t=this.clone(),r=void 0!==e&&!e;return t._preferences=l.preferences(t._preferences,{convert:r}),t}strip(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.$_setFlag("result",e?"strip":void 0)}tag(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];n(t.length,"Missing tags");for(const e of t)n(e&&"string"==typeof e,"Tags must be non-empty strings");return this._inner("tags",t)}unit(e){return n(e&&"string"==typeof e,"Unit name must be a non-empty string"),this.$_setFlag("unit",e)}valid(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];l.verifyFlat(t,"valid");const n=this.allow(...t);return n.$_setFlag("only",!!n._valids,{clone:!1}),n}when(e,t){const r=this.clone();r.$_terms.whens||(r.$_terms.whens=[]);const i=u.when(r,e,t);if(!["any","link"].includes(r.type)){const e=i.is?[i]:i.switch;for(const t of e)n(!t.then||"any"===t.then.type||t.then.type===r.type,"Cannot combine",r.type,"with",t.then&&t.then.type),n(!t.otherwise||"any"===t.otherwise.type||t.otherwise.type===r.type,"Cannot combine",r.type,"with",t.otherwise&&t.otherwise.type)}return r.$_terms.whens.push(i),r.$_mutateRebuild()}cache(e){n(!this._inRuleset(),"Cannot set caching inside a ruleset"),n(!this._cache,"Cannot override schema cache"),n(void 0===this._flags.artifact,"Cannot cache a rule with an artifact");const t=this.clone();return t._cache=e||s.provider.provision(),t.$_temp.ruleset=!1,t}clone(){const e=Object.create(Object.getPrototypeOf(this));return this._assign(e)}concat(e){n(l.isSchema(e),"Invalid schema object"),n("any"===this.type||"any"===e.type||e.type===this.type,"Cannot merge type",this.type,"with another type:",e.type),n(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),n(!e._inRuleset(),"Cannot concatenate a schema with open ruleset");let t=this.clone();if("any"===this.type&&"any"!==e.type){const r=e.clone();for(const e of Object.keys(t))"type"!==e&&(r[e]=t[e]);t=r}t._ids.concat(e._ids),t._refs.register(e,m.toSibling),t._preferences=t._preferences?l.preferences(t._preferences,e._preferences):e._preferences,t._valids=v.merge(t._valids,e._valids,e._invalids),t._invalids=v.merge(t._invalids,e._invalids,e._valids);for(const r of e._singleRules.keys())t._singleRules.has(r)&&(t._rules=t._rules.filter((e=>e.keep||e.name!==r)),t._singleRules.delete(r));for(const r of e._rules)e._definition.rules[r.method].multi||t._singleRules.set(r.name,r),t._rules.push(r);if(t._flags.empty&&e._flags.empty){t._flags.empty=t._flags.empty.concat(e._flags.empty);const r=Object.assign({},e._flags);delete r.empty,a(t._flags,r)}else if(e._flags.empty){t._flags.empty=e._flags.empty;const r=Object.assign({},e._flags);delete r.empty,a(t._flags,r)}else a(t._flags,e._flags);for(const r in e.$_terms){const n=e.$_terms[r];n?t.$_terms[r]?t.$_terms[r]=t.$_terms[r].concat(n):t.$_terms[r]=n.slice():t.$_terms[r]||(t.$_terms[r]=n)}return this.$_root._tracer&&this.$_root._tracer._combine(t,[this,e]),t.$_mutateRebuild()}extend(e){return n(!e.base,"Cannot extend type with another base"),d.type(this,e)}extract(e){return e=Array.isArray(e)?e:e.split("."),this._ids.reach(e)}fork(e,t){n(!this._inRuleset(),"Cannot fork inside a ruleset");let r=this;for(let n of[].concat(e))n=Array.isArray(n)?n:n.split("."),r=r._ids.fork(n,t,r);return r.$_temp.ruleset=!1,r}rule(e){const t=this._definition;l.assertOptions(e,Object.keys(t.modifiers)),n(!1!==this.$_temp.ruleset,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");const r=null===this.$_temp.ruleset?this._rules.length-1:this.$_temp.ruleset;n(r>=0&&r<this._rules.length,"Cannot apply rules to empty ruleset");const o=this.clone();for(let a=r;a<o._rules.length;++a){const r=o._rules[a],s=i(r);for(const i in e)t.modifiers[i](s,e[i]),n(s.name===r.name,"Cannot change rule name");o._rules[a]=s,o._singleRules.get(s.name)===r&&o._singleRules.set(s.name,s)}return o.$_temp.ruleset=!1,o.$_mutateRebuild()}get ruleset(){n(!this._inRuleset(),"Cannot start a new ruleset without closing the previous one");const e=this.clone();return e.$_temp.ruleset=e._rules.length,e}get $(){return this.ruleset}tailor(e){e=[].concat(e),n(!this._inRuleset(),"Cannot tailor inside a ruleset");let t=this;if(this.$_terms.alterations)for(const{target:r,adjuster:i}of this.$_terms.alterations)e.includes(r)&&(t=i(t),n(l.isSchema(t),"Alteration adjuster for",r,"failed to return a schema object"));return t=t.$_modify({each:t=>t.tailor(e),ref:!1}),t.$_temp.ruleset=!1,t.$_mutateRebuild()}tracer(){return g.location?g.location(this):this}validate(e,t){return y.entry(e,this,t)}validateAsync(e,t){return y.entryAsync(e,this,t)}$_addRule(e){"string"==typeof e&&(e={name:e}),n(e&&"object"==typeof e,"Invalid options"),n(e.name&&"string"==typeof e.name,"Invalid rule name");for(const t in e)n("_"!==t[0],"Cannot set private rule properties");const t=Object.assign({},e);t._resolve=[],t.method=t.method||t.name;const r=this._definition.rules[t.method],i=t.args;n(r,"Unknown rule",t.method);const o=this.clone();if(i){n(1===Object.keys(i).length||Object.keys(i).length===this._definition.rules[t.name].args.length,"Invalid rule definition for",this.type,t.name);for(const e in i){let a=i[e];if(r.argsByName){const s=r.argsByName.get(e);if(s.ref&&l.isResolvable(a))t._resolve.push(e),o.$_mutateRegister(a);else if(s.normalize&&(a=s.normalize(a),i[e]=a),s.assert){const t=l.validateArg(a,e,s);n(!t,t,"or reference")}}void 0!==a?i[e]=a:delete i[e]}}return r.multi||(o._ruleRemove(t.name,{clone:!1}),o._singleRules.set(t.name,t)),!1===o.$_temp.ruleset&&(o.$_temp.ruleset=null),r.priority?o._rules.unshift(t):o._rules.push(t),o}$_compile(e,t){return u.schema(this.$_root,e,t)}$_createError(e,t,r,n,i){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};const a=!1!==o.flags?this._flags:{},s=o.messages?p.merge(this._definition.messages,o.messages):this._definition.messages;return new c.Report(e,t,r,a,s,n,i)}$_getFlag(e){return this._flags[e]}$_getRule(e){return this._singleRules.get(e)}$_mapLabels(e){return e=Array.isArray(e)?e:e.split("."),this._ids.labels(e)}$_match(e,t,r,n){(r=Object.assign({},r)).abortEarly=!0,r._externals=!1,t.snapshot();const i=!y.validate(e,this,t,r,n).errors;return t.restore(),i}$_modify(e){return l.assertOptions(e,["each","once","ref","schema"]),h.schema(this,e)||this}$_mutateRebuild(){return n(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset(),this.$_modify({each:(e,t)=>{let{source:r,name:n,path:i,key:o}=t;const a=this._definition[r][n]&&this._definition[r][n].register;!1!==a&&this.$_mutateRegister(e,{family:a,key:o})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(e){let{family:t,key:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._refs.register(e,t),this._ids.register(e,{key:r})}$_property(e){return this._definition.properties[e]}$_reach(e){return this._ids.reach(e)}$_rootReferences(){return this._refs.roots()}$_setFlag(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n("_"===e[0]||!this._inRuleset(),"Cannot set flag inside a ruleset");const i=this._definition.flags[e]||{};if(o(t,i.default)&&(t=void 0),o(t,this._flags[e]))return this;const a=!1!==r.clone?this.clone():this;return void 0!==t?(a._flags[e]=t,a.$_mutateRegister(t)):delete a._flags[e],"_"!==e[0]&&(a.$_temp.ruleset=!1),a}$_parent(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return this[e][l.symbols.parent].call(this,...r)}$_validate(e,t,r){return y.validate(e,this,t,r)}_assign(e){e.type=this.type,e.$_root=this.$_root,e.$_temp=Object.assign({},this.$_temp),e.$_temp.whens={},e._ids=this._ids.clone(),e._preferences=this._preferences,e._valids=this._valids&&this._valids.clone(),e._invalids=this._invalids&&this._invalids.clone(),e._rules=this._rules.slice(),e._singleRules=i(this._singleRules,{shallow:!0}),e._refs=this._refs.clone(),e._flags=Object.assign({},this._flags),e._cache=null,e.$_terms={};for(const t in this.$_terms)e.$_terms[t]=this.$_terms[t]?this.$_terms[t].slice():null;e.$_super={};for(const t in this.$_super)e.$_super[t]=this._super[t].bind(e);return e}_bare(){const e=this.clone();e._reset();const t=e._definition.terms;for(const r in t){const n=t[r];e.$_terms[r]=n.init}return e.$_mutateRebuild()}_default(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return l.assertOptions(r,"literal"),n(void 0!==t,"Missing",e,"value"),n("function"==typeof t||!r.literal,"Only function value supports literal option"),"function"==typeof t&&r.literal&&(t={[l.symbols.literal]:!0,literal:t}),this.$_setFlag(e,t)}_generate(e,t,r){if(!this.$_terms.whens)return{schema:this};const n=[],i=[];for(let o=0;o<this.$_terms.whens.length;++o){const a=this.$_terms.whens[o];if(a.concat){n.push(a.concat),i.push(`${o}.concat`);continue}const s=a.ref?a.ref.resolve(e,t,r):e,l=a.is?[a]:a.switch,u=i.length;for(let u=0;u<l.length;++u){const{is:c,then:d,otherwise:f}=l[u],p=`${o}${a.switch?"."+u:""}`;if(c.$_match(s,t.nest(c,`${p}.is`),r)){if(d){const o=t.localize([...t.path,`${p}.then`],t.ancestors,t.schemas),{schema:a,id:s}=d._generate(e,o,r);n.push(a),i.push(`${p}.then${s?`(${s})`:""}`);break}}else if(f){const o=t.localize([...t.path,`${p}.otherwise`],t.ancestors,t.schemas),{schema:a,id:s}=f._generate(e,o,r);n.push(a),i.push(`${p}.otherwise${s?`(${s})`:""}`);break}}if(a.break&&i.length>u)break}const o=i.join(", ");if(t.mainstay.tracer.debug(t,"rule","when",o),!o)return{schema:this};if(!t.mainstay.tracer.active&&this.$_temp.whens[o])return{schema:this.$_temp.whens[o],id:o};let a=this;this._definition.generate&&(a=this._definition.generate(this,e,t,r));for(const e of n)a=a.concat(e);return this.$_root._tracer&&this.$_root._tracer._combine(a,[this,...n]),this.$_temp.whens[o]=a,{schema:a,id:o}}_inner(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n(!this._inRuleset(),`Cannot set ${e} inside a ruleset`);const i=this.clone();return i.$_terms[e]&&!r.override||(i.$_terms[e]=[]),r.single?i.$_terms[e].push(t):i.$_terms[e].push(...t),i.$_temp.ruleset=!1,i}_inRuleset(){return null!==this.$_temp.ruleset&&!1!==this.$_temp.ruleset}_ruleRemove(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this._singleRules.has(e))return this;const r=!1!==t.clone?this.clone():this;r._singleRules.delete(e);const n=[];for(let t=0;t<r._rules.length;++t){const i=r._rules[t];i.name!==e||i.keep?n.push(i):r._inRuleset()&&t<r.$_temp.ruleset&&--r.$_temp.ruleset}return r._rules=n,r}_values(e,t){l.verifyFlat(e,t.slice(1,-1));const r=this.clone(),i=e[0]===l.symbols.override;if(i&&(e=e.slice(1)),!r[t]&&e.length?r[t]=new v:i&&(r[t]=e.length?new v:null,r.$_mutateRebuild()),!r[t])return r;i&&r[t].override();for(const i of e){n(void 0!==i,"Cannot call allow/valid/invalid with undefined"),n(i!==l.symbols.override,"Override must be the first value");const e="_invalids"===t?"_valids":"_invalids";r[e]&&(r[e].remove(i),r[e].length||(n("_valids"===t||!r._flags.only,"Setting invalid value",i,"leaves schema rejecting all values due to previous valid rule"),r[e]=null)),r[t].add(i,r._refs)}return r}}};b.Base.prototype[l.symbols.any]={version:l.version,compile:u.compile,root:"$_root"},b.Base.prototype.isImmutable=!0,b.Base.prototype.deny=b.Base.prototype.invalid,b.Base.prototype.disallow=b.Base.prototype.invalid,b.Base.prototype.equal=b.Base.prototype.valid,b.Base.prototype.exist=b.Base.prototype.required,b.Base.prototype.not=b.Base.prototype.invalid,b.Base.prototype.options=b.Base.prototype.prefs,b.Base.prototype.preferences=b.Base.prototype.prefs,e.exports=new b.Base},8652:(e,t,r)=>{const n=r(375),i=r(8571),o=r(8160),a={max:1e3,supported:new Set(["undefined","boolean","number","string"])};t.provider={provision:e=>new a.Cache(e)},a.Cache=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};o.assertOptions(e,["max"]),n(void 0===e.max||e.max&&e.max>0&&isFinite(e.max),"Invalid max cache size"),this._max=e.max||a.max,this._map=new Map,this._list=new a.List}get length(){return this._map.size}set(e,t){if(null!==e&&!a.supported.has(typeof e))return;let r=this._map.get(e);if(r)return r.value=t,void this._list.first(r);r=this._list.unshift({key:e,value:t}),this._map.set(e,r),this._compact()}get(e){const t=this._map.get(e);if(t)return this._list.first(t),i(t.value)}_compact(){if(this._map.size>this._max){const e=this._list.pop();this._map.delete(e.key)}}},a.List=class{constructor(){this.tail=null,this.head=null}unshift(e){return e.next=null,e.prev=this.head,this.head&&(this.head.next=e),this.head=e,this.tail||(this.tail=e),e}first(e){e!==this.head&&(this._remove(e),this.unshift(e))}pop(){return this._remove(this.tail)}_remove(e){const{next:t,prev:r}=e;return t.prev=r,r&&(r.next=t),e===this.tail&&(this.tail=t),e.prev=null,e.next=null,e}}},8160:(e,t,r)=>{const n=r(375),i=r(7916),o=r(5934);let a,s;const l={isoDate:/^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$/};t.version=o.version,t.defaults={abortEarly:!0,allowUnknown:!1,artifacts:!1,cache:!0,context:null,convert:!0,dateFormat:"iso",errors:{escapeHtml:!1,label:"path",language:null,render:!0,stack:!1,wrap:{label:'"',array:"[]"}},externals:!0,messages:{},nonEnumerables:!1,noDefaults:!1,presence:"optional",skipFunctions:!1,stripUnknown:!1,warnings:!1},t.symbols={any:Symbol.for("@hapi/joi/schema"),arraySingle:Symbol("arraySingle"),deepDefault:Symbol("deepDefault"),errors:Symbol("errors"),literal:Symbol("literal"),override:Symbol("override"),parent:Symbol("parent"),prefs:Symbol("prefs"),ref:Symbol("ref"),template:Symbol("template"),values:Symbol("values")},t.assertOptions=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Options";n(e&&"object"==typeof e&&!Array.isArray(e),"Options must be of type object");const i=Object.keys(e).filter((e=>!t.includes(e)));n(0===i.length,`${r} contain unknown keys: ${i}`)},t.checkPreferences=function(e){s=s||r(3378);const t=s.preferences.validate(e);if(t.error)throw new i([t.error.details[0].message])},t.compare=function(e,t,r){switch(r){case"=":return e===t;case">":return e>t;case"<":return e<t;case">=":return e>=t;case"<=":return e<=t}},t.default=function(e,t){return void 0===e?t:e},t.isIsoDate=function(e){return l.isoDate.test(e)},t.isNumber=function(e){return"number"==typeof e&&!isNaN(e)},t.isResolvable=function(e){return!!e&&(e[t.symbols.ref]||e[t.symbols.template])},t.isSchema=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=e&&e[t.symbols.any];return!!i&&(n(r.legacy||i.version===t.version,"Cannot mix different versions of joi schemas"),!0)},t.isValues=function(e){return e[t.symbols.values]},t.limit=function(e){return Number.isSafeInteger(e)&&e>=0},t.preferences=function(e,n){a=a||r(6914),e=e||{},n=n||{};const i=Object.assign({},e,n);return n.errors&&e.errors&&(i.errors=Object.assign({},e.errors,n.errors),i.errors.wrap=Object.assign({},e.errors.wrap,n.errors.wrap)),n.messages&&(i.messages=a.compile(n.messages,e.messages)),delete i[t.symbols.prefs],i},t.tryWithPath=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{return e()}catch(e){throw void 0!==e.path?e.path=t+"."+e.path:e.path=t,r.append&&(e.message=`${e.message} (${e.path})`),e}},t.validateArg=function(e,r,n){let{assert:i,message:o}=n;if(t.isSchema(i)){const t=i.validate(e);if(!t.error)return;return t.error.message}if(!i(e))return r?`${r} ${o}`:o},t.verifyFlat=function(e,t){for(const r of e)n(!Array.isArray(r),"Method no longer accepts array arguments:",t)}},3292:(e,t,r)=>{const n=r(375),i=r(8160),o=r(6133),a={};t.schema=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};i.assertOptions(r,["appendPath","override"]);try{return a.schema(e,t,r)}catch(e){throw r.appendPath&&void 0!==e.path&&(e.message=`${e.message} (${e.path})`),e}},a.schema=function(e,t,r){n(void 0!==t,"Invalid undefined schema"),Array.isArray(t)&&(n(t.length,"Invalid empty array schema"),1===t.length&&(t=t[0]));const o=function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return!1!==r.override?t.valid(e.override,...i):t.valid(...i)};if(a.simple(t))return o(e,t);if("function"==typeof t)return e.custom(t);if(n("object"==typeof t,"Invalid schema content:",typeof t),i.isResolvable(t))return o(e,t);if(i.isSchema(t))return t;if(Array.isArray(t)){for(const r of t)if(!a.simple(r))return e.alternatives().try(...t);return o(e,...t)}return t instanceof RegExp?e.string().regex(t):t instanceof Date?o(e.date(),t):(n(Object.getPrototypeOf(t)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),e.object().keys(t))},t.ref=function(e,t){return o.isRef(e)?e:o.create(e,t)},t.compile=function(e,r){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};i.assertOptions(o,["legacy"]);const s=r&&r[i.symbols.any];if(s)return n(o.legacy||s.version===i.version,"Cannot mix different versions of joi schemas:",s.version,i.version),r;if("object"!=typeof r||!o.legacy)return t.schema(e,r,{appendPath:!0});const l=a.walk(r);return l?l.compile(l.root,r):t.schema(e,r,{appendPath:!0})},a.walk=function(e){if("object"!=typeof e)return null;if(Array.isArray(e)){for(const t of e){const e=a.walk(t);if(e)return e}return null}const t=e[i.symbols.any];if(t)return{root:e[t.root],compile:t.compile};n(Object.getPrototypeOf(e)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(const t in e){const r=a.walk(e[t]);if(r)return r}return null},a.simple=function(e){return null===e||["boolean","string","number"].includes(typeof e)},t.when=function(e,r,s){if(void 0===s&&(n(r&&"object"==typeof r,"Missing options"),s=r,r=o.create(".")),Array.isArray(s)&&(s={switch:s}),i.assertOptions(s,["is","not","then","otherwise","switch","break"]),i.isSchema(r))return n(void 0===s.is,'"is" can not be used with a schema condition'),n(void 0===s.not,'"not" can not be used with a schema condition'),n(void 0===s.switch,'"switch" can not be used with a schema condition'),a.condition(e,{is:r,then:s.then,otherwise:s.otherwise,break:s.break});if(n(o.isRef(r)||"string"==typeof r,"Invalid condition:",r),n(void 0===s.not||void 0===s.is,'Cannot combine "is" with "not"'),void 0===s.switch){let l=s;void 0!==s.not&&(l={is:s.not,then:s.otherwise,otherwise:s.then,break:s.break});let u=void 0!==l.is?e.$_compile(l.is):e.$_root.invalid(null,!1,0,"").required();return n(void 0!==l.then||void 0!==l.otherwise,'options must have at least one of "then", "otherwise", or "switch"'),n(void 0===l.break||void 0===l.then||void 0===l.otherwise,"Cannot specify then, otherwise, and break all together"),void 0===s.is||o.isRef(s.is)||i.isSchema(s.is)||(u=u.required()),a.condition(e,{ref:t.ref(r),is:u,then:l.then,otherwise:l.otherwise,break:l.break})}n(Array.isArray(s.switch),'"switch" must be an array'),n(void 0===s.is,'Cannot combine "switch" with "is"'),n(void 0===s.not,'Cannot combine "switch" with "not"'),n(void 0===s.then,'Cannot combine "switch" with "then"');const l={ref:t.ref(r),switch:[],break:s.break};for(let t=0;t<s.switch.length;++t){const r=s.switch[t],a=t===s.switch.length-1;i.assertOptions(r,a?["is","then","otherwise"]:["is","then"]),n(void 0!==r.is,'Switch statement missing "is"'),n(void 0!==r.then,'Switch statement missing "then"');const u={is:e.$_compile(r.is),then:e.$_compile(r.then)};if(o.isRef(r.is)||i.isSchema(r.is)||(u.is=u.is.required()),a){n(void 0===s.otherwise||void 0===r.otherwise,'Cannot specify "otherwise" inside and outside a "switch"');const t=void 0!==s.otherwise?s.otherwise:r.otherwise;void 0!==t&&(n(void 0===l.break,"Cannot specify both otherwise and break"),u.otherwise=e.$_compile(t))}l.switch.push(u)}return l},a.condition=function(e,t){for(const r of["then","otherwise"])void 0===t[r]?delete t[r]:t[r]=e.$_compile(t[r]);return t}},6354:(e,t,r)=>{const n=r(5688),i=r(8160),o=r(3328);t.Report=class{constructor(e,r,n,i,o,a,s){if(this.code=e,this.flags=i,this.messages=o,this.path=a.path,this.prefs=s,this.state=a,this.value=r,this.message=null,this.template=null,this.local=n||{},this.local.label=t.label(this.flags,this.state,this.prefs,this.messages),void 0===this.value||this.local.hasOwnProperty("value")||(this.local.value=this.value),this.path.length){const e=this.path[this.path.length-1];"object"!=typeof e&&(this.local.key=e)}}_setTemplate(e){if(this.template=e,!this.flags.label&&0===this.path.length){const e=this._template(this.template,"root");e&&(this.local.label=e)}}toString(){if(this.message)return this.message;const e=this.code;if(!this.prefs.errors.render)return this.code;const t=this._template(this.template)||this._template(this.prefs.messages)||this._template(this.messages);return void 0===t?`Error code "${e}" is not defined, your custom type is missing the correct messages definition`:(this.message=t.render(this.value,this.state,this.prefs,this.local,{errors:this.prefs.errors,messages:[this.prefs.messages,this.messages]}),this.prefs.errors.label||(this.message=this.message.replace(/^"" /,"").trim()),this.message)}_template(e,r){return t.template(this.value,e,r||this.code,this.state,this.prefs)}},t.path=function(e){let t="";for(const r of e)"object"!=typeof r&&("string"==typeof r?(t&&(t+="."),t+=r):t+=`[${r}]`);return t},t.template=function(e,t,r,n,a){if(!t)return;if(o.isTemplate(t))return"root"!==r?t:null;let s=a.errors.language;if(i.isResolvable(s)&&(s=s.resolve(e,n,a)),s&&t[s]){if(void 0!==t[s][r])return t[s][r];if(void 0!==t[s]["*"])return t[s]["*"]}return t[r]?t[r]:t["*"]},t.label=function(e,r,n,i){if(e.label)return e.label;if(!n.errors.label)return"";let o=r.path;return"key"===n.errors.label&&r.path.length>1&&(o=r.path.slice(-1)),t.path(o)||t.template(null,n.messages,"root",r,n)||i&&t.template(null,i,"root",r,n)||"value"},t.process=function(e,r,n){if(!e)return null;const{override:i,message:o,details:a}=t.details(e);if(i)return i;if(n.errors.stack)return new t.ValidationError(o,a,r);const s=Error.stackTraceLimit;Error.stackTraceLimit=0;const l=new t.ValidationError(o,a,r);return Error.stackTraceLimit=s,l},t.details=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=[];const n=[];for(const i of e){if(i instanceof Error){if(!1!==t.override)return{override:i};const e=i.toString();r.push(e),n.push({message:e,type:"override",context:{error:i}});continue}const e=i.toString();r.push(e),n.push({message:e,path:i.path.filter((e=>"object"!=typeof e)),type:i.code,context:i.local})}return r.length>1&&(r=[...new Set(r)]),{message:r.join(". "),details:n}},t.ValidationError=class extends Error{constructor(e,t,r){super(e),this._original=r,this.details=t}static isError(e){return e instanceof t.ValidationError}},t.ValidationError.prototype.isJoi=!0,t.ValidationError.prototype.name="ValidationError",t.ValidationError.prototype.annotate=n.error},8901:(e,t,r)=>{const n=r(375),i=r(8571),o=r(8160),a=r(6914),s={};t.type=function(e,t){const r=Object.getPrototypeOf(e),l=i(r),u=e._assign(Object.create(l)),c=Object.assign({},t);delete c.base,l._definition=c;const d=r._definition||{};c.messages=a.merge(d.messages,c.messages),c.properties=Object.assign({},d.properties,c.properties),u.type=c.type,c.flags=Object.assign({},d.flags,c.flags);const f=Object.assign({},d.terms);if(c.terms)for(const e in c.terms){const t=c.terms[e];n(void 0===u.$_terms[e],"Invalid term override for",c.type,e),u.$_terms[e]=t.init,f[e]=t}c.terms=f,c.args||(c.args=d.args),c.prepare=s.prepare(c.prepare,d.prepare),c.coerce&&("function"==typeof c.coerce&&(c.coerce={method:c.coerce}),c.coerce.from&&!Array.isArray(c.coerce.from)&&(c.coerce={method:c.coerce.method,from:[].concat(c.coerce.from)})),c.coerce=s.coerce(c.coerce,d.coerce),c.validate=s.validate(c.validate,d.validate);const p=Object.assign({},d.rules);if(c.rules)for(const e in c.rules){const t=c.rules[e];n("object"==typeof t,"Invalid rule definition for",c.type,e);let r=t.method;if(void 0===r&&(r=function(){return this.$_addRule(e)}),r&&(n(!l[e],"Rule conflict in",c.type,e),l[e]=r),n(!p[e],"Rule conflict in",c.type,e),p[e]=t,t.alias){const e=[].concat(t.alias);for(const r of e)l[r]=t.method}t.args&&(t.argsByName=new Map,t.args=t.args.map((e=>("string"==typeof e&&(e={name:e}),n(!t.argsByName.has(e.name),"Duplicated argument name",e.name),o.isSchema(e.assert)&&(e.assert=e.assert.strict().label(e.name)),t.argsByName.set(e.name,e),e))))}c.rules=p;const h=Object.assign({},d.modifiers);if(c.modifiers)for(const e in c.modifiers){n(!l[e],"Rule conflict in",c.type,e);const t=c.modifiers[e];n("function"==typeof t,"Invalid modifier definition for",c.type,e);const r=function(t){return this.rule({[e]:t})};l[e]=r,h[e]=t}if(c.modifiers=h,c.overrides){l._super=r,u.$_super={};for(const e in c.overrides)n(r[e],"Cannot override missing",e),c.overrides[e][o.symbols.parent]=r[e],u.$_super[e]=r[e].bind(u);Object.assign(l,c.overrides)}c.cast=Object.assign({},d.cast,c.cast);const m=Object.assign({},d.manifest,c.manifest);return m.build=s.build(c.manifest&&c.manifest.build,d.manifest&&d.manifest.build),c.manifest=m,c.rebuild=s.rebuild(c.rebuild,d.rebuild),u},s.build=function(e,t){return e&&t?function(r,n){return t(e(r,n),n)}:e||t},s.coerce=function(e,t){return e&&t?{from:e.from&&t.from?[...new Set([...e.from,...t.from])]:null,method(r,n){let i;if((!t.from||t.from.includes(typeof r))&&(i=t.method(r,n),i)){if(i.errors||void 0===i.value)return i;r=i.value}if(!e.from||e.from.includes(typeof r)){const t=e.method(r,n);if(t)return t}return i}}:e||t},s.prepare=function(e,t){return e&&t?function(r,n){const i=e(r,n);if(i){if(i.errors||void 0===i.value)return i;r=i.value}return t(r,n)||i}:e||t},s.rebuild=function(e,t){return e&&t?function(r){t(r),e(r)}:e||t},s.validate=function(e,t){return e&&t?function(r,n){const i=t(r,n);if(i){if(i.errors&&(!Array.isArray(i.errors)||i.errors.length))return i;r=i.value}return e(r,n)||i}:e||t}},5107:(e,t,r)=>{const n=r(375),i=r(8571),o=r(8652),a=r(8160),s=r(3292),l=r(6354),u=r(8901),c=r(9708),d=r(6133),f=r(3328),p=r(1152);let h;const m={types:{alternatives:r(4946),any:r(8068),array:r(546),boolean:r(4937),date:r(7500),function:r(390),link:r(8785),number:r(3832),object:r(8966),string:r(7417),symbol:r(8826)},aliases:{alt:"alternatives",bool:"boolean",func:"function"},root:function(){const e={_types:new Set(Object.keys(m.types))};for(const t of e._types)e[t]=function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];return n(!r.length||["alternatives","link","object"].includes(t),"The",t,"type does not allow arguments"),m.generate(this,m.types[t],r)};for(const t of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])e[t]=function(){return this.any()[t](...arguments)};Object.assign(e,m.methods);for(const t in m.aliases){const r=m.aliases[t];e[t]=e[r]}return e.x=e.expression,p.setup&&p.setup(e),e}};m.methods={ValidationError:l.ValidationError,version:a.version,cache:o.provider,assert(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),i=2;i<r;i++)n[i-2]=arguments[i];m.assert(e,t,!0,n)},attempt(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),i=2;i<r;i++)n[i-2]=arguments[i];return m.assert(e,t,!1,n)},build(e){return n("function"==typeof c.build,"Manifest functionality disabled"),c.build(this,e)},checkPreferences(e){a.checkPreferences(e)},compile(e,t){return s.compile(this,e,t)},defaults(e){n("function"==typeof e,"modifier must be a function");const t=Object.assign({},this);for(const r of t._types){const i=e(t[r]());n(a.isSchema(i),"modifier must return a valid schema object"),t[r]=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return m.generate(this,i,t)}}return t},expression(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return new f(...t)},extend(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];a.verifyFlat(t,"extend"),h=h||r(3378),n(t.length,"You need to provide at least one extension"),this.assert(t,h.extensions);const o=Object.assign({},this);o._types=new Set(o._types);for(let e of t){"function"==typeof e&&(e=e(o)),this.assert(e,h.extension);const t=m.expandExtension(e,o);for(const e of t){n(void 0===o[e.type]||o._types.has(e.type),"Cannot override name",e.type);const t=e.base||this.any(),r=u.type(t,e);o._types.add(e.type),o[e.type]=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return m.generate(this,r,t)}}}return o},isError:l.ValidationError.isError,isExpression:f.isTemplate,isRef:d.isRef,isSchema:a.isSchema,in(){return d.in(...arguments)},override:a.symbols.override,ref(){return d.create(...arguments)},types(){const e={};for(const t of this._types)e[t]=this[t]();for(const t in m.aliases)e[t]=this[t]();return e}},m.assert=function(e,t,r,n){const o=n[0]instanceof Error||"string"==typeof n[0]?n[0]:null,s=null!==o?n[1]:n[0],u=t.validate(e,a.preferences({errors:{stack:!0}},s||{}));let c=u.error;if(!c)return u.value;if(o instanceof Error)throw o;const d=r&&"function"==typeof c.annotate?c.annotate():c.message;throw c instanceof l.ValidationError==0&&(c=i(c)),c.message=o?`${o} ${d}`:d,c},m.generate=function(e,t,r){return n(e,"Must be invoked on a Joi instance."),t.$_root=e,t._definition.args&&r.length?t._definition.args(t,...r):t},m.expandExtension=function(e,t){if("string"==typeof e.type)return[e];const r=[];for(const n of t._types)if(e.type.test(n)){const i=Object.assign({},e);i.type=n,i.base=t[n](),r.push(i)}return r},e.exports=m.root()},6914:(e,t,r)=>{const n=r(375),i=r(8571),o=r(3328);t.compile=function(e,t){if("string"==typeof e)return n(!t,"Cannot set single message string"),new o(e);if(o.isTemplate(e))return n(!t,"Cannot set single message template"),e;n("object"==typeof e&&!Array.isArray(e),"Invalid message options"),t=t?i(t):{};for(let r in e){const i=e[r];if("root"===r||o.isTemplate(i)){t[r]=i;continue}if("string"==typeof i){t[r]=new o(i);continue}n("object"==typeof i&&!Array.isArray(i),"Invalid message for",r);const a=r;for(r in t[a]=t[a]||{},i){const e=i[r];"root"===r||o.isTemplate(e)?t[a][r]=e:(n("string"==typeof e,"Invalid message for",r,"in",a),t[a][r]=new o(e))}}return t},t.decompile=function(e){const t={};for(let r in e){const n=e[r];if("root"===r){t.root=n;continue}if(o.isTemplate(n)){t[r]=n.describe({compact:!0});continue}const i=r;for(r in t[i]={},n){const e=n[r];"root"!==r?t[i][r]=e.describe({compact:!0}):t[i].root=e}}return t},t.merge=function(e,r){if(!e)return t.compile(r);if(!r)return e;if("string"==typeof r)return new o(r);if(o.isTemplate(r))return r;const a=i(e);for(let e in r){const t=r[e];if("root"===e||o.isTemplate(t)){a[e]=t;continue}if("string"==typeof t){a[e]=new o(t);continue}n("object"==typeof t&&!Array.isArray(t),"Invalid message for",e);const i=e;for(e in a[i]=a[i]||{},t){const r=t[e];"root"===e||o.isTemplate(r)?a[i][e]=r:(n("string"==typeof r,"Invalid message for",e,"in",i),a[i][e]=new o(r))}}return a}},2294:(e,t,r)=>{const n=r(375),i=r(8160),o=r(6133),a={};t.Ids=a.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){const e=new a.Ids;return e._byId=new Map(this._byId),e._byKey=new Map(this._byKey),e._schemaChain=this._schemaChain,e}concat(e){e._schemaChain&&(this._schemaChain=!0);for(const[t,r]of e._byId.entries())n(!this._byKey.has(t),"Schema id conflicts with existing key:",t),this._byId.set(t,r);for(const[t,r]of e._byKey.entries())n(!this._byId.has(t),"Schema key conflicts with existing id:",t),this._byKey.set(t,r)}fork(e,t,r){const o=this._collect(e);o.push({schema:r});const s=o.shift();let l={id:s.id,schema:t(s.schema)};n(i.isSchema(l.schema),"adjuster function failed to return a joi schema type");for(const e of o)l={id:e.id,schema:a.fork(e.schema,l.id,l.schema)};return l.schema}labels(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=e[0],n=this._get(r);if(!n)return[...t,...e].join(".");const i=e.slice(1);return t=[...t,n.schema._flags.label||r],i.length?n.schema._ids.labels(i,t):t.join(".")}reach(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=e[0],i=this._get(r);n(i,"Schema does not contain path",[...t,...e].join("."));const o=e.slice(1);return o.length?i.schema._ids.reach(o,[...t,r]):i.schema}register(e){let{key:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e||!i.isSchema(e))return;(e.$_property("schemaChain")||e._ids._schemaChain)&&(this._schemaChain=!0);const r=e._flags.id;if(r){const t=this._byId.get(r);n(!t||t.schema===e,"Cannot add different schemas with the same id:",r),n(!this._byKey.has(r),"Schema id conflicts with existing key:",r),this._byId.set(r,{schema:e,id:r})}t&&(n(!this._byKey.has(t),"Schema already contains key:",t),n(!this._byId.has(t),"Schema key conflicts with existing id:",t),this._byKey.set(t,{schema:e,id:t}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const i=e[0],o=this._get(i);n(o,"Schema does not contain path",[...t,...e].join(".")),r=[o,...r];const a=e.slice(1);return a.length?o.schema._ids._collect(a,[...t,i],r):r}_get(e){return this._byId.get(e)||this._byKey.get(e)}},a.fork=function(e,r,n){const i=t.schema(e,{each:(e,t)=>{let{key:i}=t;if(r===(e._flags.id||i))return n},ref:!1});return i?i.$_mutateRebuild():e},t.schema=function(e,t){let r;for(const n in e._flags){if("_"===n[0])continue;const i=a.scan(e._flags[n],{source:"flags",name:n},t);void 0!==i&&(r=r||e.clone(),r._flags[n]=i)}for(let n=0;n<e._rules.length;++n){const i=e._rules[n],o=a.scan(i.args,{source:"rules",name:i.name},t);if(void 0!==o){r=r||e.clone();const t=Object.assign({},i);t.args=o,r._rules[n]=t,r._singleRules.get(i.name)===i&&r._singleRules.set(i.name,t)}}for(const n in e.$_terms){if("_"===n[0])continue;const i=a.scan(e.$_terms[n],{source:"terms",name:n},t);void 0!==i&&(r=r||e.clone(),r.$_terms[n]=i)}return r},a.scan=function(e,t,r,n,s){const l=n||[];if(null===e||"object"!=typeof e)return;let u;if(Array.isArray(e)){for(let n=0;n<e.length;++n){const i="terms"===t.source&&"keys"===t.name&&e[n].key,o=a.scan(e[n],t,r,[n,...l],i);void 0!==o&&(u=u||e.slice(),u[n]=o)}return u}if(!1!==r.schema&&i.isSchema(e)||!1!==r.ref&&o.isRef(e)){const n=r.each(e,{...t,path:l,key:s});if(n===e)return;return n}for(const n in e){if("_"===n[0])continue;const i=a.scan(e[n],t,r,[n,...l],s);void 0!==i&&(u=u||Object.assign({},e),u[n]=i)}return u}},6133:(e,t,r)=>{const n=r(375),i=r(8571),o=r(9621),a=r(8160);let s;const l={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};t.create=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("string"==typeof e,"Invalid reference key:",e),a.assertOptions(t,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),n(!t.prefix||"object"==typeof t.prefix,"options.prefix must be of type object");const r=Object.assign({},l.defaults,t);delete r.prefix;const i=r.separator,o=l.context(e,i,t.prefix);if(r.type=o.type,e=o.key,"value"===r.type)if(o.root&&(n(!i||e[0]!==i,"Cannot specify relative path with root prefix"),r.ancestor="root",e||(e=null)),i&&i===e)e=null,r.ancestor=0;else if(void 0!==r.ancestor)n(!i||!e||e[0]!==i,"Cannot combine prefix with ancestor option");else{const[t,n]=l.ancestor(e,i);n&&""===(e=e.slice(n))&&(e=null),r.ancestor=t}return r.path=i?null===e?[]:e.split(i):[e],new l.Ref(r)},t.in=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.create(e,{...r,in:!0})},t.isRef=function(e){return!!e&&!!e[a.symbols.ref]},l.Ref=class{constructor(e){n("object"==typeof e,"Invalid reference construction"),a.assertOptions(e,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),n([!1,void 0].includes(e.separator)||"string"==typeof e.separator&&1===e.separator.length,"Invalid separator"),n(!e.adjust||"function"==typeof e.adjust,"options.adjust must be a function"),n(!e.map||Array.isArray(e.map),"options.map must be an array"),n(!e.map||!e.adjust,"Cannot set both map and adjust options"),Object.assign(this,l.defaults,e),n("value"===this.type||void 0===this.ancestor,"Non-value references cannot reference ancestors"),Array.isArray(this.map)&&(this.map=new Map(this.map)),this.depth=this.path.length,this.key=this.path.length?this.path.join(this.separator):null,this.root=this.path[0],this.updateDisplay()}resolve(e,t,r,i){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return n(!this.in||o.in,"Invalid in() reference usage"),"global"===this.type?this._resolve(r.context,t,o):"local"===this.type?this._resolve(i,t,o):this.ancestor?"root"===this.ancestor?this._resolve(t.ancestors[t.ancestors.length-1],t,o):(n(this.ancestor<=t.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(t.ancestors[this.ancestor-1],t,o)):this._resolve(e,t,o)}_resolve(e,t,r){let n;if("value"===this.type&&t.mainstay.shadow&&!1!==r.shadow&&(n=t.mainstay.shadow.get(this.absolute(t))),void 0===n&&(n=o(e,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(n=this.adjust(n)),this.map){const e=this.map.get(n);void 0!==e&&(n=e)}return t.mainstay&&t.mainstay.tracer.resolve(t,this,n),n}toString(){return this.display}absolute(e){return[...e.path.slice(0,-this.ancestor),...this.path]}clone(){return new l.Ref(this)}describe(){const e={path:this.path};"value"!==this.type&&(e.type=this.type),"."!==this.separator&&(e.separator=this.separator),"value"===this.type&&1!==this.ancestor&&(e.ancestor=this.ancestor),this.map&&(e.map=[...this.map]);for(const t of["adjust","iterables","render"])null!==this[t]&&void 0!==this[t]&&(e[t]=this[t]);return!1!==this.in&&(e.in=!0),{ref:e}}updateDisplay(){const e=null!==this.key?this.key:"";if("value"!==this.type)return void(this.display=`ref:${this.type}:${e}`);if(!this.separator)return void(this.display=`ref:${e}`);if(!this.ancestor)return void(this.display=`ref:${this.separator}${e}`);if("root"===this.ancestor)return void(this.display=`ref:root:${e}`);if(1===this.ancestor)return void(this.display=`ref:${e||".."}`);const t=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${t}${e||""}`}},l.Ref.prototype[a.symbols.ref]=!0,t.build=function(e){return"value"===(e=Object.assign({},l.defaults,e)).type&&void 0===e.ancestor&&(e.ancestor=1),new l.Ref(e)},l.context=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e=e.trim(),r){const n=void 0===r.global?"$":r.global;if(n!==t&&e.startsWith(n))return{key:e.slice(n.length),type:"global"};const i=void 0===r.local?"#":r.local;if(i!==t&&e.startsWith(i))return{key:e.slice(i.length),type:"local"};const o=void 0===r.root?"/":r.root;if(o!==t&&e.startsWith(o))return{key:e.slice(o.length),type:"value",root:!0}}return{key:e,type:"value"}},l.ancestor=function(e,t){if(!t)return[1,0];if(e[0]!==t)return[1,0];if(e[1]!==t)return[0,1];let r=2;for(;e[r]===t;)++r;return[r-1,r]},t.toSibling=0,t.toParent=1,t.Manager=class{constructor(){this.refs=[]}register(e,n){if(e)if(n=void 0===n?t.toParent:n,Array.isArray(e))for(const t of e)this.register(t,n);else if(a.isSchema(e))for(const t of e._refs.refs)t.ancestor-n>=0&&this.refs.push({ancestor:t.ancestor-n,root:t.root});else t.isRef(e)&&"value"===e.type&&e.ancestor-n>=0&&this.refs.push({ancestor:e.ancestor-n,root:e.root}),s=s||r(3328),s.isTemplate(e)&&this.register(e.refs(),n)}get length(){return this.refs.length}clone(){const e=new t.Manager;return e.refs=i(this.refs),e}reset(){this.refs=[]}roots(){return this.refs.filter((e=>!e.ancestor)).map((e=>e.root))}}},3378:(e,t,r)=>{const n=r(5107),i={};i.wrap=n.string().min(1).max(2).allow(!1),t.preferences=n.object({allowUnknown:n.boolean(),abortEarly:n.boolean(),artifacts:n.boolean(),cache:n.boolean(),context:n.object(),convert:n.boolean(),dateFormat:n.valid("date","iso","string","time","utc"),debug:n.boolean(),errors:{escapeHtml:n.boolean(),label:n.valid("path","key",!1),language:[n.string(),n.object().ref()],render:n.boolean(),stack:n.boolean(),wrap:{label:i.wrap,array:i.wrap,string:i.wrap}},externals:n.boolean(),messages:n.object(),noDefaults:n.boolean(),nonEnumerables:n.boolean(),presence:n.valid("required","optional","forbidden"),skipFunctions:n.boolean(),stripUnknown:n.object({arrays:n.boolean(),objects:n.boolean()}).or("arrays","objects").allow(!0,!1),warnings:n.boolean()}).strict(),i.nameRx=/^[a-zA-Z0-9]\w*$/,i.rule=n.object({alias:n.array().items(n.string().pattern(i.nameRx)).single(),args:n.array().items(n.string(),n.object({name:n.string().pattern(i.nameRx).required(),ref:n.boolean(),assert:n.alternatives([n.function(),n.object().schema()]).conditional("ref",{is:!0,then:n.required()}),normalize:n.function(),message:n.string().when("assert",{is:n.function(),then:n.required()})})),convert:n.boolean(),manifest:n.boolean(),method:n.function().allow(!1),multi:n.boolean(),validate:n.function()}),t.extension=n.object({type:n.alternatives([n.string(),n.object().regex()]).required(),args:n.function(),cast:n.object().pattern(i.nameRx,n.object({from:n.function().maxArity(1).required(),to:n.function().minArity(1).maxArity(2).required()})),base:n.object().schema().when("type",{is:n.object().regex(),then:n.forbidden()}),coerce:[n.function().maxArity(3),n.object({method:n.function().maxArity(3).required(),from:n.array().items(n.string()).single()})],flags:n.object().pattern(i.nameRx,n.object({setter:n.string(),default:n.any()})),manifest:{build:n.function().arity(2)},messages:[n.object(),n.string()],modifiers:n.object().pattern(i.nameRx,n.function().minArity(1).maxArity(2)),overrides:n.object().pattern(i.nameRx,n.function()),prepare:n.function().maxArity(3),rebuild:n.function().arity(1),rules:n.object().pattern(i.nameRx,i.rule),terms:n.object().pattern(i.nameRx,n.object({init:n.array().allow(null).required(),manifest:n.object().pattern(/.+/,[n.valid("schema","single"),n.object({mapped:n.object({from:n.string().required(),to:n.string().required()}).required()})])})),validate:n.function().maxArity(3)}).strict(),t.extensions=n.array().items(n.object(),n.function().arity(1)).strict(),i.desc={buffer:n.object({buffer:n.string()}),func:n.object({function:n.function().required(),options:{literal:!0}}),override:n.object({override:!0}),ref:n.object({ref:n.object({type:n.valid("value","global","local"),path:n.array().required(),separator:n.string().length(1).allow(!1),ancestor:n.number().min(0).integer().allow("root"),map:n.array().items(n.array().length(2)).min(1),adjust:n.function(),iterables:n.boolean(),in:n.boolean(),render:n.boolean()}).required()}),regex:n.object({regex:n.string().min(3)}),special:n.object({special:n.valid("deep").required()}),template:n.object({template:n.string().required(),options:n.object()}),value:n.object({value:n.alternatives([n.object(),n.array()]).required()})},i.desc.entity=n.alternatives([n.array().items(n.link("...")),n.boolean(),n.function(),n.number(),n.string(),i.desc.buffer,i.desc.func,i.desc.ref,i.desc.regex,i.desc.special,i.desc.template,i.desc.value,n.link("/")]),i.desc.values=n.array().items(null,n.boolean(),n.function(),n.number().allow(1/0,-1/0),n.string().allow(""),n.symbol(),i.desc.buffer,i.desc.func,i.desc.override,i.desc.ref,i.desc.regex,i.desc.template,i.desc.value),i.desc.messages=n.object().pattern(/.+/,[n.string(),i.desc.template,n.object().pattern(/.+/,[n.string(),i.desc.template])]),t.description=n.object({type:n.string().required(),flags:n.object({cast:n.string(),default:n.any(),description:n.string(),empty:n.link("/"),failover:i.desc.entity,id:n.string(),label:n.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:n.boolean(),unit:n.string()}).unknown(),preferences:{allowUnknown:n.boolean(),abortEarly:n.boolean(),artifacts:n.boolean(),cache:n.boolean(),convert:n.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:n.boolean(),label:["path","key"],language:[n.string(),i.desc.ref],wrap:{label:i.wrap,array:i.wrap}},externals:n.boolean(),messages:i.desc.messages,noDefaults:n.boolean(),nonEnumerables:n.boolean(),presence:["required","optional","forbidden"],skipFunctions:n.boolean(),stripUnknown:n.object({arrays:n.boolean(),objects:n.boolean()}).or("arrays","objects").allow(!0,!1),warnings:n.boolean()},allow:i.desc.values,invalid:i.desc.values,rules:n.array().min(1).items({name:n.string().required(),args:n.object().min(1),keep:n.boolean(),message:[n.string(),i.desc.messages],warn:n.boolean()}),keys:n.object().pattern(/.*/,n.link("/")),link:i.desc.ref}).pattern(/^[a-z]\w*$/,n.any())},493:(e,t,r)=>{const n=r(8571),i=r(9621),o=r(8160),a={value:Symbol("value")};e.exports=a.State=class{constructor(e,t,r){this.path=e,this.ancestors=t,this.mainstay=r.mainstay,this.schemas=r.schemas,this.debug=null}localize(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=new a.State(e,t,this);return r&&n.schemas&&(n.schemas=[a.schemas(r),...n.schemas]),n}nest(e,t){const r=new a.State(this.path,this.ancestors,this);return r.schemas=r.schemas&&[a.schemas(e),...r.schemas],r.debug=t,r}shadow(e,t){this.mainstay.shadow=this.mainstay.shadow||new a.Shadow,this.mainstay.shadow.set(this.path,e,t)}snapshot(){this.mainstay.shadow&&(this._snapshot=n(this.mainstay.shadow.node(this.path)))}restore(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0)}},a.schemas=function(e){return o.isSchema(e)?{schema:e}:e},a.Shadow=class{constructor(){this._values=null}set(e,t,r){if(!e.length)return;if("strip"===r&&"number"==typeof e[e.length-1])return;this._values=this._values||new Map;let n=this._values;for(let t=0;t<e.length;++t){const r=e[t];let i=n.get(r);i||(i=new Map,n.set(r,i)),n=i}n[a.value]=t}get(e){const t=this.node(e);if(t)return t[a.value]}node(e){if(this._values)return i(this._values,e,{iterables:!0})}override(e,t){if(!this._values)return;const r=e.slice(0,-1),n=e[e.length-1],o=i(this._values,r,{iterables:!0});t?o.set(n,t):o&&o.delete(n)}}},3328:(e,t,r)=>{const n=r(375),i=r(8571),o=r(5277),a=r(1447),s=r(8160),l=r(6354),u=r(6133),c={symbol:Symbol("template"),opens:new Array(1e3).join("\0"),closes:new Array(1e3).join(""),dateFormat:{date:Date.prototype.toDateString,iso:Date.prototype.toISOString,string:Date.prototype.toString,time:Date.prototype.toTimeString,utc:Date.prototype.toUTCString}};e.exports=c.Template=class{constructor(e,t){n("string"==typeof e,"Template source must be a string"),n(!e.includes("\0")&&!e.includes(""),"Template source cannot contain reserved control characters"),this.source=e,this.rendered=e,this._template=null,this._settings=i(t),this._parse()}_parse(){if(!this.source.includes("{"))return;const e=c.encode(this.source),t=c.split(e);let r=!1;const n=[],i=t.shift();i&&n.push(i);for(const e of t){const t="{"!==e[0],i=t?"}":"}}",o=e.indexOf(i);if(-1===o||"{"===e[1]){n.push(`{${c.decode(e)}`);continue}let a=e.slice(t?0:1,o);const s=":"===a[0];s&&(a=a.slice(1));const l=this._ref(c.decode(a),{raw:t,wrapped:s});n.push(l),"string"!=typeof l&&(r=!0);const u=e.slice(o+i.length);u&&n.push(c.decode(u))}r?this._template=n:this.rendered=n.join("")}static date(e,t){return c.dateFormat[t.dateFormat].call(e)}describe(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this._settings&&e.compact)return this.source;const t={template:this.source};return this._settings&&(t.options=this._settings),t}static build(e){return new c.Template(e.template,e.options)}isDynamic(){return!!this._template}static isTemplate(e){return!!e&&!!e[s.symbols.template]}refs(){if(!this._template)return;const e=[];for(const t of this._template)"string"!=typeof t&&e.push(...t.refs);return e}resolve(e,t,r,n){return this._template&&1===this._template.length?this._part(this._template[0],e,t,r,n,{}):this.render(e,t,r,n)}_part(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return e.ref?e.ref.resolve(...r):e.formula.evaluate(r)}render(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};if(!this.isDynamic())return this.rendered;const a=[];for(const s of this._template)if("string"==typeof s)a.push(s);else{const l=this._part(s,e,t,r,n,i),u=c.stringify(l,e,t,r,n,i);if(void 0!==u){const e=s.raw||!1===(i.errors&&i.errors.escapeHtml)?u:o(u);a.push(c.wrap(e,s.wrapped&&r.errors.wrap.label))}}return a.join("")}_ref(e,t){let{raw:r,wrapped:n}=t;const i=[],o=e=>{const t=u.create(e,this._settings);return i.push(t),e=>t.resolve(...e)};try{var s=new a.Parser(e,{reference:o,functions:c.functions,constants:c.constants})}catch(t){throw t.message=`Invalid template variable "${e}" fails due to: ${t.message}`,t}if(s.single){if("reference"===s.single.type){const e=i[0];return{ref:e,raw:r,refs:i,wrapped:n||"local"===e.type&&"label"===e.key}}return c.stringify(s.single.value)}return{formula:s,raw:r,refs:i}}toString(){return this.source}},c.Template.prototype[s.symbols.template]=!0,c.Template.prototype.isImmutable=!0,c.encode=function(e){return e.replace(/\\(\{+)/g,((e,t)=>c.opens.slice(0,t.length))).replace(/\\(\}+)/g,((e,t)=>c.closes.slice(0,t.length)))},c.decode=function(e){return e.replace(/\u0000/g,"{").replace(/\u0001/g,"}")},c.split=function(e){const t=[];let r="";for(let n=0;n<e.length;++n){const i=e[n];if("{"===i){let i="";for(;n+1<e.length&&"{"===e[n+1];)i+="{",++n;t.push(r),r=i}else r+=i}return t.push(r),t},c.wrap=function(e,t){return t?1===t.length?`${t}${e}${t}`:`${t[0]}${e}${t[1]}`:e},c.stringify=function(e,t,r,n,i){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};const a=typeof e,s=n&&n.errors&&n.errors.wrap||{};let l=!1;if(u.isRef(e)&&e.render&&(l=e.in,e=e.resolve(t,r,n,i,{in:e.in,...o})),null===e)return"null";if("string"===a)return c.wrap(e,o.arrayItems&&s.string);if("number"===a||"function"===a||"symbol"===a)return e.toString();if("object"!==a)return JSON.stringify(e);if(e instanceof Date)return c.Template.date(e,n);if(e instanceof Map){const t=[];for(const[r,n]of e.entries())t.push(`${r.toString()} -> ${n.toString()}`);e=t}if(!Array.isArray(e))return e.toString();const d=[];for(const a of e)d.push(c.stringify(a,t,r,n,i,{arrayItems:!0,...o}));return c.wrap(d.join(", "),!l&&s.array)},c.constants={true:!0,false:!1,null:null,second:1e3,minute:6e4,hour:36e5,day:864e5},c.functions={if:(e,t,r)=>e?t:r,length:e=>"string"==typeof e?e.length:e&&"object"==typeof e?Array.isArray(e)?e.length:Object.keys(e).length:null,msg(e){const[t,r,n,i,o]=this,a=o.messages;if(!a)return"";const s=l.template(t,a[0],e,r,n)||l.template(t,a[1],e,r,n);return s?s.render(t,r,n,i,o):""},number:e=>"number"==typeof e?e:"string"==typeof e?parseFloat(e):"boolean"==typeof e?e?1:0:e instanceof Date?e.getTime():null}},4946:(e,t,r)=>{const n=r(375),i=r(1687),o=r(8068),a=r(8160),s=r(3292),l=r(6354),u=r(6133),c={};e.exports=o.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:u.toSibling}},args(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return 1===r.length&&Array.isArray(r[0])?e.try(...r[0]):e.try(...r)},validate(e,t){const{schema:r,error:n,state:o,prefs:a}=t;if(r._flags.match){const t=[],s=[];for(let n=0;n<r.$_terms.matches.length;++n){const i=r.$_terms.matches[n],l=o.nest(i.schema,`match.${n}`);l.snapshot();const u=i.schema.$_validate(e,l,a);u.errors?(s.push(u.errors),l.restore()):t.push(u.value)}if(0===t.length)return{errors:n("alternatives.any",{details:s.map((e=>l.details(e,{override:!1})))})};if("one"===r._flags.match)return 1===t.length?{value:t[0]}:{errors:n("alternatives.one")};if(t.length!==r.$_terms.matches.length)return{errors:n("alternatives.all",{details:s.map((e=>l.details(e,{override:!1})))})};const u=e=>e.$_terms.matches.some((e=>"object"===e.schema.type||"alternatives"===e.schema.type&&u(e.schema)));return u(r)?{value:t.reduce(((e,t)=>i(e,t,{mergeArrays:!1})))}:{value:t[t.length-1]}}const s=[];for(let t=0;t<r.$_terms.matches.length;++t){const n=r.$_terms.matches[t];if(n.schema){const r=o.nest(n.schema,`match.${t}`);r.snapshot();const i=n.schema.$_validate(e,r,a);if(!i.errors)return i;r.restore(),s.push({schema:n.schema,reports:i.errors});continue}const i=n.ref?n.ref.resolve(e,o,a):e,l=n.is?[n]:n.switch;for(let r=0;r<l.length;++r){const s=l[r],{is:u,then:c,otherwise:d}=s,f=`match.${t}${n.switch?"."+r:""}`;if(u.$_match(i,o.nest(u,`${f}.is`),a)){if(c)return c.$_validate(e,o.nest(c,`${f}.then`),a)}else if(d)return d.$_validate(e,o.nest(d,`${f}.otherwise`),a)}}return c.errors(s,t)},rules:{conditional:{method(e,t){n(!this._flags._endedSwitch,"Unreachable condition"),n(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),n(void 0===t.break,"Cannot use break option with alternatives conditional");const r=this.clone(),i=s.when(r,e,t),o=i.is?[i]:i.switch;for(const e of o)if(e.then&&e.otherwise){r.$_setFlag("_endedSwitch",!0,{clone:!1});break}return r.$_terms.matches.push(i),r.$_mutateRebuild()}},match:{method(e){if(n(["any","one","all"].includes(e),"Invalid alternatives match mode",e),"any"!==e)for(const t of this.$_terms.matches)n(t.schema,"Cannot combine match mode",e,"with conditional rules");return this.$_setFlag("match",e)}},try:{method(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];n(t.length,"Missing alternative schemas"),a.verifyFlat(t,"try"),n(!this._flags._endedSwitch,"Unreachable condition");const i=this.clone();for(const e of t)i.$_terms.matches.push({schema:i.$_compile(e)});return i.$_mutateRebuild()}}},overrides:{label(e){return this.$_parent("label",e).$_modify({each:(t,r)=>"is"!==r.path[0]?t.label(e):void 0,ref:!1})}},rebuild(e){e.$_modify({each:t=>{a.isSchema(t)&&"array"===t.type&&e.$_setFlag("_arrayItems",!0,{clone:!1})}})},manifest:{build(e,t){if(t.matches)for(const r of t.matches){const{schema:t,ref:n,is:i,not:o,then:a,otherwise:s}=r;e=t?e.try(t):n?e.conditional(n,{is:i,then:a,not:o,otherwise:s,switch:r.switch}):e.conditional(i,{then:a,otherwise:s})}return e}},messages:{"alternatives.all":"{{#label}} does not match all of the required types","alternatives.any":"{{#label}} does not match any of the allowed types","alternatives.match":"{{#label}} does not match any of the allowed types","alternatives.one":"{{#label}} matches more than one allowed type","alternatives.types":"{{#label}} must be one of {{#types}}"}}),c.errors=function(e,t){let{error:r,state:n}=t;if(!e.length)return{errors:r("alternatives.any")};if(1===e.length)return{errors:e[0].reports};const i=new Set,o=[];for(const{reports:t,schema:a}of e){if(t.length>1)return c.unmatched(e,r);const s=t[0];if(s instanceof l.Report==0)return c.unmatched(e,r);if(s.state.path.length!==n.path.length){o.push({type:a.type,report:s});continue}if("any.only"===s.code){for(const e of s.local.valids)i.add(e);continue}const[u,d]=s.code.split(".");"base"===d?i.add(u):o.push({type:a.type,report:s})}return o.length?1===o.length?{errors:o[0].report}:c.unmatched(e,r):{errors:r("alternatives.types",{types:[...i]})}},c.unmatched=function(e,t){const r=[];for(const t of e)r.push(...t.reports);return{errors:t("alternatives.match",l.details(r,{override:!1}))}}},8068:(e,t,r)=>{const n=r(375),i=r(7629),o=r(8160),a=r(6914);e.exports=i.extend({type:"any",flags:{only:{default:!1}},terms:{alterations:{init:null},examples:{init:null},externals:{init:null},metas:{init:[]},notes:{init:[]},shared:{init:null},tags:{init:[]},whens:{init:null}},rules:{custom:{method(e,t){return n("function"==typeof e,"Method must be a function"),n(void 0===t||t&&"string"==typeof t,"Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:e,description:t}})},validate(e,t,r){let{method:n}=r;try{return n(e,t)}catch(e){return t.error("any.custom",{error:e})}},args:["method","description"],multi:!0},messages:{method(e){return this.prefs({messages:e})}},shared:{method(e){n(o.isSchema(e)&&e._flags.id,"Schema must be a schema with an id");const t=this.clone();return t.$_terms.shared=t.$_terms.shared||[],t.$_terms.shared.push(e),t.$_mutateRegister(e),t}},warning:{method(e,t){return n(e&&"string"==typeof e,"Invalid warning code"),this.$_addRule({name:"warning",args:{code:e,local:t},warn:!0})},validate(e,t,r){let{code:n,local:i}=r;return t.error(n,i)},args:["code","local"],multi:!0}},modifiers:{keep(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e.keep=t},message(e,t){e.message=a.compile(t)},warn(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e.warn=t}},manifest:{build(e,t){for(const r in t){const n=t[r];if(["examples","externals","metas","notes","tags"].includes(r))for(const t of n)e=e[r.slice(0,-1)](t);else if("alterations"!==r)if("whens"!==r){if("shared"===r)for(const t of n)e=e.shared(t)}else for(const t of n){const{ref:r,is:n,not:i,then:o,otherwise:a,concat:s}=t;e=s?e.concat(s):r?e.when(r,{is:n,not:i,then:o,otherwise:a,switch:t.switch,break:t.break}):e.when(n,{then:o,otherwise:a,break:t.break})}else{const t={};for(const{target:e,adjuster:r}of n)t[e]=r;e=e.alter(t)}}return e}},messages:{"any.custom":"{{#label}} failed custom validation because {{#error.message}}","any.default":"{{#label}} threw an error when running default method","any.failover":"{{#label}} threw an error when running failover method","any.invalid":"{{#label}} contains an invalid value","any.only":'{{#label}} must be {if(#valids.length == 1, "", "one of ")}{{#valids}}',"any.ref":"{{#label}} {{#arg}} references {{:#ref}} which {{#reason}}","any.required":"{{#label}} is required","any.unknown":"{{#label}} is not allowed"}})},546:(e,t,r)=>{const n=r(375),i=r(9474),o=r(9621),a=r(8068),s=r(8160),l=r(3292),u={};e.exports=a.extend({type:"array",flags:{single:{default:!1},sparse:{default:!1}},terms:{items:{init:[],manifest:"schema"},ordered:{init:[],manifest:"schema"},_exclusions:{init:[]},_inclusions:{init:[]},_requireds:{init:[]}},coerce:{from:"object",method(e,t){let{schema:r,state:n,prefs:i}=t;if(!Array.isArray(e))return;const o=r.$_getRule("sort");return o?u.sort(r,e,o.args.options,n,i):void 0}},validate(e,t){let{schema:r,error:n}=t;if(!Array.isArray(e)){if(r._flags.single){const t=[e];return t[s.symbols.arraySingle]=!0,{value:t}}return{errors:n("array.base")}}if(r.$_getRule("items")||r.$_terms.externals)return{value:e.slice()}},rules:{has:{method(e){e=this.$_compile(e,{appendPath:!0});const t=this.$_addRule({name:"has",args:{schema:e}});return t.$_mutateRegister(e),t},validate(e,t,r){let{state:n,prefs:i,error:o}=t,{schema:a}=r;const s=[e,...n.ancestors];for(let t=0;t<e.length;++t){const r=n.localize([...n.path,t],s,a);if(a.$_match(e[t],r,i))return e}const l=a._flags.label;return l?o("array.hasKnown",{patternLabel:l}):o("array.hasUnknown",null)},multi:!0},items:{method(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];s.verifyFlat(t,"items");const n=this.$_addRule("items");for(let e=0;e<t.length;++e){const r=s.tryWithPath((()=>this.$_compile(t[e])),e,{append:!0});n.$_terms.items.push(r)}return n.$_mutateRebuild()},validate(e,t){let{schema:r,error:n,state:i,prefs:o,errorsArray:a}=t;const l=r.$_terms._requireds.slice(),c=r.$_terms.ordered.slice(),d=[...r.$_terms._inclusions,...l],f=!e[s.symbols.arraySingle];delete e[s.symbols.arraySingle];const p=a();let h=e.length;for(let t=0;t<h;++t){const a=e[t];let s=!1,m=!1;const g=f?t:new Number(t),y=[...i.path,g];if(!r._flags.sparse&&void 0===a){if(p.push(n("array.sparse",{key:g,path:y,pos:t,value:void 0},i.localize(y))),o.abortEarly)return p;c.shift();continue}const v=[e,...i.ancestors];for(const e of r.$_terms._exclusions)if(e.$_match(a,i.localize(y,v,e),o,{presence:"ignore"})){if(p.push(n("array.excludes",{pos:t,value:a},i.localize(y))),o.abortEarly)return p;s=!0,c.shift();break}if(s)continue;if(r.$_terms.ordered.length){if(c.length){const s=c.shift(),l=s.$_validate(a,i.localize(y,v,s),o);if(l.errors){if(p.push(...l.errors),o.abortEarly)return p}else if("strip"===s._flags.result)u.fastSplice(e,t),--t,--h;else{if(!r._flags.sparse&&void 0===l.value){if(p.push(n("array.sparse",{key:g,path:y,pos:t,value:void 0},i.localize(y))),o.abortEarly)return p;continue}e[t]=l.value}continue}if(!r.$_terms.items.length){if(p.push(n("array.orderedLength",{pos:t,limit:r.$_terms.ordered.length})),o.abortEarly)return p;break}}const b=[];let _=l.length;for(let s=0;s<_;++s){const c=i.localize(y,v,l[s]);c.snapshot();const d=l[s].$_validate(a,c,o);if(b[s]=d,!d.errors){if(e[t]=d.value,m=!0,u.fastSplice(l,s),--s,--_,!r._flags.sparse&&void 0===d.value&&(p.push(n("array.sparse",{key:g,path:y,pos:t,value:void 0},i.localize(y))),o.abortEarly))return p;break}c.restore()}if(m)continue;const w=o.stripUnknown&&!!o.stripUnknown.arrays||!1;_=d.length;for(const c of d){let d;const f=l.indexOf(c);if(-1!==f)d=b[f];else{const l=i.localize(y,v,c);if(l.snapshot(),d=c.$_validate(a,l,o),!d.errors){"strip"===c._flags.result?(u.fastSplice(e,t),--t,--h):r._flags.sparse||void 0!==d.value?e[t]=d.value:(p.push(n("array.sparse",{key:g,path:y,pos:t,value:void 0},i.localize(y))),s=!0),m=!0;break}l.restore()}if(1===_){if(w){u.fastSplice(e,t),--t,--h,m=!0;break}if(p.push(...d.errors),o.abortEarly)return p;s=!0;break}}if(!s&&(r.$_terms._inclusions.length||r.$_terms._requireds.length)&&!m){if(w){u.fastSplice(e,t),--t,--h;continue}if(p.push(n("array.includes",{pos:t,value:a},i.localize(y))),o.abortEarly)return p}}return l.length&&u.fillMissedErrors(r,p,l,e,i,o),c.length&&(u.fillOrderedErrors(r,p,c,e,i,o),p.length||u.fillDefault(c,e,i,o)),p.length?p:e},priority:!0,manifest:!1},length:{method(e){return this.$_addRule({name:"length",args:{limit:e},operator:"="})},validate(e,t,r,n){let{limit:i}=r,{name:o,operator:a,args:l}=n;return s.compare(e.length,i,a)?e:t.error("array."+o,{limit:l.limit,value:e})},args:[{name:"limit",ref:!0,assert:s.limit,message:"must be a positive integer"}]},max:{method(e){return this.$_addRule({name:"max",method:"length",args:{limit:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"length",args:{limit:e},operator:">="})}},ordered:{method(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];s.verifyFlat(t,"ordered");const n=this.$_addRule("items");for(let e=0;e<t.length;++e){const r=s.tryWithPath((()=>this.$_compile(t[e])),e,{append:!0});u.validateSingle(r,n),n.$_mutateRegister(r),n.$_terms.ordered.push(r)}return n.$_mutateRebuild()}},single:{method(e){const t=void 0===e||!!e;return n(!t||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",t)}},sort:{method(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s.assertOptions(e,["by","order"]);const t={order:e.order||"ascending"};return e.by&&(t.by=l.ref(e.by,{ancestor:0}),n(!t.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:t}})},validate(e,t,r){let{error:n,state:i,prefs:o,schema:a}=t,{options:s}=r;const{value:l,errors:c}=u.sort(a,e,s,i,o);if(c)return c;for(let t=0;t<e.length;++t)if(e[t]!==l[t])return n("array.sort",{order:s.order,by:s.by?s.by.key:"value"});return e},convert:!0},sparse:{method(e){const t=void 0===e||!!e;return this._flags.sparse===t?this:(t?this.clone():this.$_addRule("items")).$_setFlag("sparse",t,{clone:!1})}},unique:{method(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n(!e||"function"==typeof e||"string"==typeof e,"comparator must be a function or a string"),s.assertOptions(t,["ignoreUndefined","separator"]);const r={name:"unique",args:{options:t,comparator:e}};if(e)if("string"==typeof e){const n=s.default(t.separator,".");r.path=n?e.split(n):[e]}else r.comparator=e;return this.$_addRule(r)},validate(e,t,r,a){let{state:s,error:l,schema:u}=t,{comparator:c,options:d}=r,{comparator:f,path:p}=a;const h={string:Object.create(null),number:Object.create(null),undefined:Object.create(null),boolean:Object.create(null),object:new Map,function:new Map,custom:new Map},m=f||i,g=d.ignoreUndefined;for(let t=0;t<e.length;++t){const r=p?o(e[t],p):e[t],i=f?h.custom:h[typeof r];if(n(i,"Failed to find unique map container for type",typeof r),i instanceof Map){const n=i.entries();let o;for(;!(o=n.next()).done;)if(m(o.value[0],r)){const r=s.localize([...s.path,t],[e,...s.ancestors]),n={pos:t,value:e[t],dupePos:o.value[1],dupeValue:e[o.value[1]]};return p&&(n.path=c),l("array.unique",n,r)}i.set(r,t)}else{if((!g||void 0!==r)&&void 0!==i[r]){const n={pos:t,value:e[t],dupePos:i[r],dupeValue:e[i[r]]};return p&&(n.path=c),l("array.unique",n,s.localize([...s.path,t],[e,...s.ancestors]))}i[r]=t}}return e},args:["comparator","options"],multi:!0}},cast:{set:{from:Array.isArray,to:(e,t)=>new Set(e)}},rebuild(e){e.$_terms._inclusions=[],e.$_terms._exclusions=[],e.$_terms._requireds=[];for(const t of e.$_terms.items)u.validateSingle(t,e),"required"===t._flags.presence?e.$_terms._requireds.push(t):"forbidden"===t._flags.presence?e.$_terms._exclusions.push(t):e.$_terms._inclusions.push(t);for(const t of e.$_terms.ordered)u.validateSingle(t,e)},manifest:{build:(e,t)=>(t.items&&(e=e.items(...t.items)),t.ordered&&(e=e.ordered(...t.ordered)),e)},messages:{"array.base":"{{#label}} must be an array","array.excludes":"{{#label}} contains an excluded value","array.hasKnown":"{{#label}} does not contain at least one required match for type {:#patternLabel}","array.hasUnknown":"{{#label}} does not contain at least one required match","array.includes":"{{#label}} does not match any of the allowed types","array.includesRequiredBoth":"{{#label}} does not contain {{#knownMisses}} and {{#unknownMisses}} other required value(s)","array.includesRequiredKnowns":"{{#label}} does not contain {{#knownMisses}}","array.includesRequiredUnknowns":"{{#label}} does not contain {{#unknownMisses}} required value(s)","array.length":"{{#label}} must contain {{#limit}} items","array.max":"{{#label}} must contain less than or equal to {{#limit}} items","array.min":"{{#label}} must contain at least {{#limit}} items","array.orderedLength":"{{#label}} must contain at most {{#limit}} items","array.sort":"{{#label}} must be sorted in {#order} order by {{#by}}","array.sort.mismatching":"{{#label}} cannot be sorted due to mismatching types","array.sort.unsupported":"{{#label}} cannot be sorted due to unsupported type {#type}","array.sparse":"{{#label}} must not be a sparse array item","array.unique":"{{#label}} contains a duplicate value"}}),u.fillMissedErrors=function(e,t,r,n,i,o){const a=[];let s=0;for(const e of r){const t=e._flags.label;t?a.push(t):++s}a.length?s?t.push(e.$_createError("array.includesRequiredBoth",n,{knownMisses:a,unknownMisses:s},i,o)):t.push(e.$_createError("array.includesRequiredKnowns",n,{knownMisses:a},i,o)):t.push(e.$_createError("array.includesRequiredUnknowns",n,{unknownMisses:s},i,o))},u.fillOrderedErrors=function(e,t,r,n,i,o){const a=[];for(const e of r)"required"===e._flags.presence&&a.push(e);a.length&&u.fillMissedErrors(e,t,a,n,i,o)},u.fillDefault=function(e,t,r,n){const i=[];let o=!0;for(let a=e.length-1;a>=0;--a){const s=e[a],l=[t,...r.ancestors],u=s.$_validate(void 0,r.localize(r.path,l,s),n).value;if(o){if(void 0===u)continue;o=!1}i.unshift(u)}i.length&&t.push(...i)},u.fastSplice=function(e,t){let r=t;for(;r<e.length;)e[r++]=e[r];--e.length},u.validateSingle=function(e,t){("array"===e.type||e._flags._arrayItems)&&(n(!t._flags.single,"Cannot specify array item with single rule enabled"),t.$_setFlag("_arrayItems",!0,{clone:!1}))},u.sort=function(e,t,r,n,i){const o="ascending"===r.order?1:-1,a=-1*o,s=o,l=(l,c)=>{let d=u.compare(l,c,a,s);if(null!==d)return d;if(r.by&&(l=r.by.resolve(l,n,i),c=r.by.resolve(c,n,i)),d=u.compare(l,c,a,s),null!==d)return d;const f=typeof l;if(f!==typeof c)throw e.$_createError("array.sort.mismatching",t,null,n,i);if("number"!==f&&"string"!==f)throw e.$_createError("array.sort.unsupported",t,{type:f},n,i);return"number"===f?(l-c)*o:l<c?a:s};try{return{value:t.slice().sort(l)}}catch(e){return{errors:e}}},u.compare=function(e,t,r,n){return e===t?0:void 0===e?1:void 0===t?-1:null===e?n:null===t?r:null}},4937:(e,t,r)=>{const n=r(375),i=r(8068),o=r(8160),a=r(2036),s={isBool:function(e){return"boolean"==typeof e}};e.exports=i.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(e,t){let{schema:r}=t;if("boolean"!=typeof e){if("string"==typeof e){const t=r._flags.sensitive?e:e.toLowerCase();e="true"===t||"false"!==t&&e}return"boolean"!=typeof e&&(e=r.$_terms.truthy&&r.$_terms.truthy.has(e,null,null,!r._flags.sensitive)||(!r.$_terms.falsy||!r.$_terms.falsy.has(e,null,null,!r._flags.sensitive))&&e),{value:e}}},validate(e,t){let{error:r}=t;if("boolean"!=typeof e)return{value:e,errors:r("boolean.base")}},rules:{truthy:{method(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];o.verifyFlat(t,"truthy");const i=this.clone();i.$_terms.truthy=i.$_terms.truthy||new a;for(let e=0;e<t.length;++e){const r=t[e];n(void 0!==r,"Cannot call truthy with undefined"),i.$_terms.truthy.add(r)}return i}},falsy:{method(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];o.verifyFlat(t,"falsy");const i=this.clone();i.$_terms.falsy=i.$_terms.falsy||new a;for(let e=0;e<t.length;++e){const r=t[e];n(void 0!==r,"Cannot call falsy with undefined"),i.$_terms.falsy.add(r)}return i}},sensitive:{method(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.$_setFlag("sensitive",e)}}},cast:{number:{from:s.isBool,to:(e,t)=>e?1:0},string:{from:s.isBool,to:(e,t)=>e?"true":"false"}},manifest:{build:(e,t)=>(t.truthy&&(e=e.truthy(...t.truthy)),t.falsy&&(e=e.falsy(...t.falsy)),e)},messages:{"boolean.base":"{{#label}} must be a boolean"}})},7500:(e,t,r)=>{const n=r(375),i=r(8068),o=r(8160),a=r(3328),s={isDate:function(e){return e instanceof Date}};e.exports=i.extend({type:"date",coerce:{from:["number","string"],method(e,t){let{schema:r}=t;return{value:s.parse(e,r._flags.format)||e}}},validate(e,t){let{schema:r,error:n,prefs:i}=t;if(e instanceof Date&&!isNaN(e.getTime()))return;const o=r._flags.format;return i.convert&&o&&"string"==typeof e?{value:e,errors:n("date.format",{format:o})}:{value:e,errors:n("date.base")}},rules:{compare:{method:!1,validate(e,t,r,n){let{date:i}=r,{name:a,operator:s,args:l}=n;const u="now"===i?Date.now():i.getTime();return o.compare(e.getTime(),u,s)?e:t.error("date."+a,{limit:l.date,value:e})},args:[{name:"date",ref:!0,normalize:e=>"now"===e?e:s.parse(e),assert:e=>null!==e,message:"must have a valid date format"}]},format:{method(e){return n(["iso","javascript","unix"].includes(e),"Unknown date format",e),this.$_setFlag("format",e)}},greater:{method(e){return this.$_addRule({name:"greater",method:"compare",args:{date:e},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(e){return this.$_addRule({name:"less",method:"compare",args:{date:e},operator:"<"})}},max:{method(e){return this.$_addRule({name:"max",method:"compare",args:{date:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"compare",args:{date:e},operator:">="})}},timestamp:{method(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"javascript";return n(["javascript","unix"].includes(e),'"type" must be one of "javascript, unix"'),this.format(e)}}},cast:{number:{from:s.isDate,to:(e,t)=>e.getTime()},string:{from:s.isDate,to(e,t){let{prefs:r}=t;return a.date(e,r)}}},messages:{"date.base":"{{#label}} must be a valid date","date.format":'{{#label}} must be in {msg("date.format." + #format) || #format} format',"date.greater":"{{#label}} must be greater than {{:#limit}}","date.less":"{{#label}} must be less than {{:#limit}}","date.max":"{{#label}} must be less than or equal to {{:#limit}}","date.min":"{{#label}} must be greater than or equal to {{:#limit}}","date.format.iso":"ISO 8601 date","date.format.javascript":"timestamp or number of milliseconds","date.format.unix":"timestamp or number of seconds"}}),s.parse=function(e,t){if(e instanceof Date)return e;if("string"!=typeof e&&(isNaN(e)||!isFinite(e)))return null;if(/^\s*$/.test(e))return null;if("iso"===t)return o.isIsoDate(e)?s.date(e.toString()):null;const r=e;if("string"==typeof e&&/^[+-]?\d+(\.\d+)?$/.test(e)&&(e=parseFloat(e)),t){if("javascript"===t)return s.date(1*e);if("unix"===t)return s.date(1e3*e);if("string"==typeof r)return null}return s.date(e)},s.date=function(e){const t=new Date(e);return isNaN(t.getTime())?null:t}},390:(e,t,r)=>{const n=r(375),i=r(7824);e.exports=i.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(e){return n(Number.isSafeInteger(e)&&e>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:e}})},validate(e,t,r){let{n}=r;return e.length===n?e:t.error("function.arity",{n})}},class:{method(){return this.$_addRule("class")},validate:(e,t)=>/^\s*class\s/.test(e.toString())?e:t.error("function.class",{value:e})},minArity:{method(e){return n(Number.isSafeInteger(e)&&e>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:e}})},validate(e,t,r){let{n}=r;return e.length>=n?e:t.error("function.minArity",{n})}},maxArity:{method(e){return n(Number.isSafeInteger(e)&&e>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:e}})},validate(e,t,r){let{n}=r;return e.length<=n?e:t.error("function.maxArity",{n})}}},messages:{"function.arity":"{{#label}} must have an arity of {{#n}}","function.class":"{{#label}} must be a class","function.maxArity":"{{#label}} must have an arity lesser or equal to {{#n}}","function.minArity":"{{#label}} must have an arity greater or equal to {{#n}}"}})},7824:(e,t,r)=>{const n=r(978),i=r(375),o=r(8571),a=r(3652),s=r(8068),l=r(8160),u=r(3292),c=r(6354),d=r(6133),f=r(3328),p={renameDefaults:{alias:!1,multiple:!1,override:!1}};e.exports=s.extend({type:"_keys",properties:{typeof:"object"},flags:{unknown:{default:!1}},terms:{dependencies:{init:null},keys:{init:null,manifest:{mapped:{from:"schema",to:"key"}}},patterns:{init:null},renames:{init:null}},args:(e,t)=>e.keys(t),validate(e,t){let{schema:r,error:n,state:i,prefs:o}=t;if(!e||typeof e!==r.$_property("typeof")||Array.isArray(e))return{value:e,errors:n("object.base",{type:r.$_property("typeof")})};if(!(r.$_terms.renames||r.$_terms.dependencies||r.$_terms.keys||r.$_terms.patterns||r.$_terms.externals))return;e=p.clone(e,o);const a=[];if(r.$_terms.renames&&!p.rename(r,e,i,o,a))return{value:e,errors:a};if(!r.$_terms.keys&&!r.$_terms.patterns&&!r.$_terms.dependencies)return{value:e,errors:a};const s=new Set(Object.keys(e));if(r.$_terms.keys){const t=[e,...i.ancestors];for(const n of r.$_terms.keys){const r=n.key,l=e[r];s.delete(r);const u=i.localize([...i.path,r],t,n),c=n.schema.$_validate(l,u,o);if(c.errors){if(o.abortEarly)return{value:e,errors:c.errors};void 0!==c.value&&(e[r]=c.value),a.push(...c.errors)}else"strip"===n.schema._flags.result||void 0===c.value&&void 0!==l?delete e[r]:void 0!==c.value&&(e[r]=c.value)}}if(s.size||r._flags._hasPatternMatch){const t=p.unknown(r,e,s,a,i,o);if(t)return t}if(r.$_terms.dependencies)for(const t of r.$_terms.dependencies){if(null!==t.key&&!1===p.isPresent(t.options)(t.key.resolve(e,i,o,null,{shadow:!1})))continue;const n=p.dependencies[t.rel](r,t,e,i,o);if(n){const t=r.$_createError(n.code,e,n.context,i,o);if(o.abortEarly)return{value:e,errors:t};a.push(t)}}return{value:e,errors:a}},rules:{and:{method(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return l.verifyFlat(t,"and"),p.dependency(this,"and",null,t)}},append:{method(e){return null==e||0===Object.keys(e).length?this:this.keys(e)}},assert:{method(e,t,r){f.isTemplate(e)||(e=u.ref(e)),i(void 0===r||"string"==typeof r,"Message must be a string"),t=this.$_compile(t,{appendPath:!0});const n=this.$_addRule({name:"assert",args:{subject:e,schema:t,message:r}});return n.$_mutateRegister(e),n.$_mutateRegister(t),n},validate(e,t,r){let{error:n,prefs:i,state:o}=t,{subject:a,schema:s,message:l}=r;const u=a.resolve(e,o,i),c=d.isRef(a)?a.absolute(o):[];return s.$_match(u,o.localize(c,[e,...o.ancestors],s),i)?e:n("object.assert",{subject:a,message:l})},args:["subject","schema","message"],multi:!0},instance:{method(e,t){return i("function"==typeof e,"constructor must be a function"),t=t||e.name,this.$_addRule({name:"instance",args:{constructor:e,name:t}})},validate(e,t,r){let{constructor:n,name:i}=r;return e instanceof n?e:t.error("object.instance",{type:i,value:e})},args:["constructor","name"]},keys:{method(e){i(void 0===e||"object"==typeof e,"Object schema must be a valid object"),i(!l.isSchema(e),"Object schema cannot be a joi schema");const t=this.clone();if(e)if(Object.keys(e).length){t.$_terms.keys=t.$_terms.keys?t.$_terms.keys.filter((t=>!e.hasOwnProperty(t.key))):new p.Keys;for(const r in e)l.tryWithPath((()=>t.$_terms.keys.push({key:r,schema:this.$_compile(e[r])})),r)}else t.$_terms.keys=new p.Keys;else t.$_terms.keys=null;return t.$_mutateRebuild()}},length:{method(e){return this.$_addRule({name:"length",args:{limit:e},operator:"="})},validate(e,t,r,n){let{limit:i}=r,{name:o,operator:a,args:s}=n;return l.compare(Object.keys(e).length,i,a)?e:t.error("object."+o,{limit:s.limit,value:e})},args:[{name:"limit",ref:!0,assert:l.limit,message:"must be a positive integer"}]},max:{method(e){return this.$_addRule({name:"max",method:"length",args:{limit:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"length",args:{limit:e},operator:">="})}},nand:{method(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return l.verifyFlat(t,"nand"),p.dependency(this,"nand",null,t)}},or:{method(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return l.verifyFlat(t,"or"),p.dependency(this,"or",null,t)}},oxor:{method(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return p.dependency(this,"oxor",null,t)}},pattern:{method(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=e instanceof RegExp;n||(e=this.$_compile(e,{appendPath:!0})),i(void 0!==t,"Invalid rule"),l.assertOptions(r,["fallthrough","matches"]),n&&i(!e.flags.includes("g")&&!e.flags.includes("y"),"pattern should not use global or sticky mode"),t=this.$_compile(t,{appendPath:!0});const o=this.clone();o.$_terms.patterns=o.$_terms.patterns||[];const a={[n?"regex":"schema"]:e,rule:t};return r.matches&&(a.matches=this.$_compile(r.matches),"array"!==a.matches.type&&(a.matches=a.matches.$_root.array().items(a.matches)),o.$_mutateRegister(a.matches),o.$_setFlag("_hasPatternMatch",!0,{clone:!1})),r.fallthrough&&(a.fallthrough=!0),o.$_terms.patterns.push(a),o.$_mutateRegister(t),o}},ref:{method(){return this.$_addRule("ref")},validate:(e,t)=>d.isRef(e)?e:t.error("object.refType",{value:e})},regex:{method(){return this.$_addRule("regex")},validate:(e,t)=>e instanceof RegExp?e:t.error("object.regex",{value:e})},rename:{method(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};i("string"==typeof e||e instanceof RegExp,"Rename missing the from argument"),i("string"==typeof t||t instanceof f,"Invalid rename to argument"),i(t!==e,"Cannot rename key to same name:",e),l.assertOptions(r,["alias","ignoreUndefined","override","multiple"]);const o=this.clone();o.$_terms.renames=o.$_terms.renames||[];for(const t of o.$_terms.renames)i(t.from!==e,"Cannot rename the same key multiple times");return t instanceof f&&o.$_mutateRegister(t),o.$_terms.renames.push({from:e,to:t,options:n(p.renameDefaults,r)}),o}},schema:{method(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"any";return this.$_addRule({name:"schema",args:{type:e}})},validate(e,t,r){let{type:n}=r;return!l.isSchema(e)||"any"!==n&&e.type!==n?t.error("object.schema",{type:n}):e}},unknown:{method(e){return this.$_setFlag("unknown",!1!==e)}},with:{method(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return p.dependency(this,"with",e,t,r)}},without:{method(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return p.dependency(this,"without",e,t,r)}},xor:{method(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return l.verifyFlat(t,"xor"),p.dependency(this,"xor",null,t)}}},overrides:{default(e,t){return void 0===e&&(e=l.symbols.deepDefault),this.$_parent("default",e,t)}},rebuild(e){if(e.$_terms.keys){const t=new a.Sorter;for(const r of e.$_terms.keys)l.tryWithPath((()=>t.add(r,{after:r.schema.$_rootReferences(),group:r.key})),r.key);e.$_terms.keys=new p.Keys(...t.nodes)}},manifest:{build(e,t){if(t.keys&&(e=e.keys(t.keys)),t.dependencies)for(const{rel:r,key:n=null,peers:i,options:o}of t.dependencies)e=p.dependency(e,r,n,i,o);if(t.patterns)for(const{regex:r,schema:n,rule:i,fallthrough:o,matches:a}of t.patterns)e=e.pattern(r||n,i,{fallthrough:o,matches:a});if(t.renames)for(const{from:r,to:n,options:i}of t.renames)e=e.rename(r,n,i);return e}},messages:{"object.and":"{{#label}} contains {{#presentWithLabels}} without its required peers {{#missingWithLabels}}","object.assert":'{{#label}} is invalid because {if(#subject.key, `"` + #subject.key + `" failed to ` + (#message || "pass the assertion test"), #message || "the assertion failed")}',"object.base":"{{#label}} must be of type {{#type}}","object.instance":"{{#label}} must be an instance of {{:#type}}","object.length":'{{#label}} must have {{#limit}} key{if(#limit == 1, "", "s")}',"object.max":'{{#label}} must have less than or equal to {{#limit}} key{if(#limit == 1, "", "s")}',"object.min":'{{#label}} must have at least {{#limit}} key{if(#limit == 1, "", "s")}',"object.missing":"{{#label}} must contain at least one of {{#peersWithLabels}}","object.nand":"{{:#mainWithLabel}} must not exist simultaneously with {{#peersWithLabels}}","object.oxor":"{{#label}} contains a conflict between optional exclusive peers {{#peersWithLabels}}","object.pattern.match":"{{#label}} keys failed to match pattern requirements","object.refType":"{{#label}} must be a Joi reference","object.regex":"{{#label}} must be a RegExp object","object.rename.multiple":"{{#label}} cannot rename {{:#from}} because multiple renames are disabled and another key was already renamed to {{:#to}}","object.rename.override":"{{#label}} cannot rename {{:#from}} because override is disabled and target {{:#to}} exists","object.schema":"{{#label}} must be a Joi schema of {{#type}} type","object.unknown":"{{#label}} is not allowed","object.with":"{{:#mainWithLabel}} missing required peer {{:#peerWithLabel}}","object.without":"{{:#mainWithLabel}} conflict with forbidden peer {{:#peerWithLabel}}","object.xor":"{{#label}} contains a conflict between exclusive peers {{#peersWithLabels}}"}}),p.clone=function(e,t){if("object"==typeof e){if(t.nonEnumerables)return o(e,{shallow:!0});const r=Object.create(Object.getPrototypeOf(e));return Object.assign(r,e),r}const r=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return e.apply(this,r)};return r.prototype=o(e.prototype),Object.defineProperty(r,"name",{value:e.name,writable:!1}),Object.defineProperty(r,"length",{value:e.length,writable:!1}),Object.assign(r,e),r},p.dependency=function(e,t,r,n,o){i(null===r||"string"==typeof r,t,"key must be a strings"),o||(o=n.length>1&&"object"==typeof n[n.length-1]?n.pop():{}),l.assertOptions(o,["separator","isPresent"]),n=[].concat(n);const a=l.default(o.separator,"."),s=[];for(const e of n)i("string"==typeof e,t,"peers must be strings"),s.push(u.ref(e,{separator:a,ancestor:0,prefix:!1}));null!==r&&(r=u.ref(r,{separator:a,ancestor:0,prefix:!1}));const c=e.clone();return c.$_terms.dependencies=c.$_terms.dependencies||[],c.$_terms.dependencies.push(new p.Dependency(t,r,s,n,o)),c},p.dependencies={and(e,t,r,n,i){const o=[],a=[],s=t.peers.length,l=p.isPresent(t.options);for(const e of t.peers)!1===l(e.resolve(r,n,i,null,{shadow:!1}))?o.push(e.key):a.push(e.key);if(o.length!==s&&a.length!==s)return{code:"object.and",context:{present:a,presentWithLabels:p.keysToLabels(e,a),missing:o,missingWithLabels:p.keysToLabels(e,o)}}},nand(e,t,r,n,i){const o=[],a=p.isPresent(t.options);for(const e of t.peers)a(e.resolve(r,n,i,null,{shadow:!1}))&&o.push(e.key);if(o.length!==t.peers.length)return;const s=t.paths[0],l=t.paths.slice(1);return{code:"object.nand",context:{main:s,mainWithLabel:p.keysToLabels(e,s),peers:l,peersWithLabels:p.keysToLabels(e,l)}}},or(e,t,r,n,i){const o=p.isPresent(t.options);for(const e of t.peers)if(o(e.resolve(r,n,i,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:t.paths,peersWithLabels:p.keysToLabels(e,t.paths)}}},oxor(e,t,r,n,i){const o=[],a=p.isPresent(t.options);for(const e of t.peers)a(e.resolve(r,n,i,null,{shadow:!1}))&&o.push(e.key);if(!o.length||1===o.length)return;const s={peers:t.paths,peersWithLabels:p.keysToLabels(e,t.paths)};return s.present=o,s.presentWithLabels=p.keysToLabels(e,o),{code:"object.oxor",context:s}},with(e,t,r,n,i){const o=p.isPresent(t.options);for(const a of t.peers)if(!1===o(a.resolve(r,n,i,null,{shadow:!1})))return{code:"object.with",context:{main:t.key.key,mainWithLabel:p.keysToLabels(e,t.key.key),peer:a.key,peerWithLabel:p.keysToLabels(e,a.key)}}},without(e,t,r,n,i){const o=p.isPresent(t.options);for(const a of t.peers)if(o(a.resolve(r,n,i,null,{shadow:!1})))return{code:"object.without",context:{main:t.key.key,mainWithLabel:p.keysToLabels(e,t.key.key),peer:a.key,peerWithLabel:p.keysToLabels(e,a.key)}}},xor(e,t,r,n,i){const o=[],a=p.isPresent(t.options);for(const e of t.peers)a(e.resolve(r,n,i,null,{shadow:!1}))&&o.push(e.key);if(1===o.length)return;const s={peers:t.paths,peersWithLabels:p.keysToLabels(e,t.paths)};return 0===o.length?{code:"object.missing",context:s}:(s.present=o,s.presentWithLabels=p.keysToLabels(e,o),{code:"object.xor",context:s})}},p.keysToLabels=function(e,t){return Array.isArray(t)?t.map((t=>e.$_mapLabels(t))):e.$_mapLabels(t)},p.isPresent=function(e){return"function"==typeof e.isPresent?e.isPresent:e=>void 0!==e},p.rename=function(e,t,r,n,i){const o={};for(const a of e.$_terms.renames){const s=[],l="string"!=typeof a.from;if(l)for(const e in t){if(void 0===t[e]&&a.options.ignoreUndefined)continue;if(e===a.to)continue;const r=a.from.exec(e);r&&s.push({from:e,to:a.to,match:r})}else!Object.prototype.hasOwnProperty.call(t,a.from)||void 0===t[a.from]&&a.options.ignoreUndefined||s.push(a);for(const u of s){const s=u.from;let c=u.to;if(c instanceof f&&(c=c.render(t,r,n,u.match)),s!==c){if(!a.options.multiple&&o[c]&&(i.push(e.$_createError("object.rename.multiple",t,{from:s,to:c,pattern:l},r,n)),n.abortEarly))return!1;if(Object.prototype.hasOwnProperty.call(t,c)&&!a.options.override&&!o[c]&&(i.push(e.$_createError("object.rename.override",t,{from:s,to:c,pattern:l},r,n)),n.abortEarly))return!1;void 0===t[s]?delete t[c]:t[c]=t[s],o[c]=!0,a.options.alias||delete t[s]}}}return!0},p.unknown=function(e,t,r,n,i,o){if(e.$_terms.patterns){let a=!1;const s=e.$_terms.patterns.map((e=>{if(e.matches)return a=!0,[]})),l=[t,...i.ancestors];for(const a of r){const u=t[a],c=[...i.path,a];for(let d=0;d<e.$_terms.patterns.length;++d){const f=e.$_terms.patterns[d];if(f.regex){const e=f.regex.test(a);if(i.mainstay.tracer.debug(i,"rule",`pattern.${d}`,e?"pass":"error"),!e)continue}else if(!f.schema.$_match(a,i.nest(f.schema,`pattern.${d}`),o))continue;r.delete(a);const p=i.localize(c,l,{schema:f.rule,key:a}),h=f.rule.$_validate(u,p,o);if(h.errors){if(o.abortEarly)return{value:t,errors:h.errors};n.push(...h.errors)}if(f.matches&&s[d].push(a),t[a]=h.value,!f.fallthrough)break}}if(a)for(let r=0;r<s.length;++r){const a=s[r];if(!a)continue;const u=e.$_terms.patterns[r].matches,d=i.localize(i.path,l,u),f=u.$_validate(a,d,o);if(f.errors){const r=c.details(f.errors,{override:!1});r.matches=a;const s=e.$_createError("object.pattern.match",t,r,i,o);if(o.abortEarly)return{value:t,errors:s};n.push(s)}}}if(r.size&&(e.$_terms.keys||e.$_terms.patterns)){if(o.stripUnknown&&!e._flags.unknown||o.skipFunctions){const e=!(!o.stripUnknown||!0!==o.stripUnknown&&!o.stripUnknown.objects);for(const n of r)e?(delete t[n],r.delete(n)):"function"==typeof t[n]&&r.delete(n)}if(!l.default(e._flags.unknown,o.allowUnknown))for(const a of r){const r=i.localize([...i.path,a],[]),s=e.$_createError("object.unknown",t[a],{child:a},r,o,{flags:!1});if(o.abortEarly)return{value:t,errors:s};n.push(s)}}},p.Dependency=class{constructor(e,t,r,n,i){this.rel=e,this.key=t,this.peers=r,this.paths=n,this.options=i}describe(){const e={rel:this.rel,peers:this.paths};return null!==this.key&&(e.key=this.key.key),"."!==this.peers[0].separator&&(e.options={...e.options,separator:this.peers[0].separator}),this.options.isPresent&&(e.options={...e.options,isPresent:this.options.isPresent}),e}},p.Keys=class extends Array{concat(e){const t=this.slice(),r=new Map;for(let e=0;e<t.length;++e)r.set(t[e].key,e);for(const n of e){const e=n.key,i=r.get(e);void 0!==i?t[i]={key:e,schema:t[i].schema.concat(n.schema)}:t.push(n)}return t}}},8785:(e,t,r)=>{const n=r(375),i=r(8068),o=r(8160),a=r(3292),s=r(6354),l={};e.exports=i.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args:(e,t)=>e.ref(t),validate(e,t){let{schema:r,state:i,prefs:o}=t;n(r.$_terms.link,"Uninitialized link schema");const a=l.generate(r,e,i,o),s=r.$_terms.link[0].ref;return a.$_validate(e,i.nest(a,`link:${s.display}:${a.type}`),o)},generate:(e,t,r,n)=>l.generate(e,t,r,n),rules:{ref:{method(e){n(!this.$_terms.link,"Cannot reinitialize schema"),e=a.ref(e),n("value"===e.type||"local"===e.type,"Invalid reference type:",e.type),n("local"===e.type||"root"===e.ancestor||e.ancestor>0,"Link cannot reference itself");const t=this.clone();return t.$_terms.link=[{ref:e}],t}},relative:{method(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.$_setFlag("relative",e)}}},overrides:{concat(e){n(this.$_terms.link,"Uninitialized link schema"),n(o.isSchema(e),"Invalid schema object"),n("link"!==e.type,"Cannot merge type link with another link");const t=this.clone();return t.$_terms.whens||(t.$_terms.whens=[]),t.$_terms.whens.push({concat:e}),t.$_mutateRebuild()}},manifest:{build:(e,t)=>(n(t.link,"Invalid link description missing link"),e.ref(t.link))}}),l.generate=function(e,t,r,n){let i=r.mainstay.links.get(e);if(i)return i._generate(t,r,n).schema;const o=e.$_terms.link[0].ref,{perspective:a,path:s}=l.perspective(o,r);l.assert(a,"which is outside of schema boundaries",o,e,r,n);try{i=s.length?a.$_reach(s):a}catch(t){l.assert(!1,"to non-existing schema",o,e,r,n)}return l.assert("link"!==i.type,"which is another link",o,e,r,n),e._flags.relative||r.mainstay.links.set(e,i),i._generate(t,r,n).schema},l.perspective=function(e,t){if("local"===e.type){for(const{schema:r,key:n}of t.schemas){if((r._flags.id||n)===e.path[0])return{perspective:r,path:e.path.slice(1)};if(r.$_terms.shared)for(const t of r.$_terms.shared)if(t._flags.id===e.path[0])return{perspective:t,path:e.path.slice(1)}}return{perspective:null,path:null}}return"root"===e.ancestor?{perspective:t.schemas[t.schemas.length-1].schema,path:e.path}:{perspective:t.schemas[e.ancestor]&&t.schemas[e.ancestor].schema,path:e.path}},l.assert=function(e,t,r,i,o,a){e||n(!1,`"${s.label(i._flags,o,a)}" contains link reference "${r.display}" ${t}`)}},3832:(e,t,r)=>{const n=r(375),i=r(8068),o=r(8160),a={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,exponentialPartRegex:/[eE][+-]?\d+$/,leadingSignAndZerosRegex:/^[+-]?(0*)?/,dotRegex:/\./,trailingZerosRegex:/0+$/};e.exports=i.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(e,t){let{schema:r,error:n}=t;if(!e.match(a.numberRx))return;e=e.trim();const i={value:parseFloat(e)};if(0===i.value&&(i.value=0),!r._flags.unsafe)if(e.match(/e/i)){if(a.extractSignificantDigits(e)!==a.extractSignificantDigits(String(i.value)))return i.errors=n("number.unsafe"),i}else{const t=i.value.toString();if(t.match(/e/i))return i;if(t!==a.normalizeDecimal(e))return i.errors=n("number.unsafe"),i}return i}},validate(e,t){let{schema:r,error:n,prefs:i}=t;if(e===1/0||e===-1/0)return{value:e,errors:n("number.infinity")};if(!o.isNumber(e))return{value:e,errors:n("number.base")};const a={value:e};if(i.convert){const e=r.$_getRule("precision");if(e){const t=Math.pow(10,e.args.limit);a.value=Math.round(a.value*t)/t}}return 0===a.value&&(a.value=0),!r._flags.unsafe&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&(a.errors=n("number.unsafe")),a},rules:{compare:{method:!1,validate(e,t,r,n){let{limit:i}=r,{name:a,operator:s,args:l}=n;return o.compare(e,i,s)?e:t.error("number."+a,{limit:l.limit,value:e})},args:[{name:"limit",ref:!0,assert:o.isNumber,message:"must be a number"}]},greater:{method(e){return this.$_addRule({name:"greater",method:"compare",args:{limit:e},operator:">"})}},integer:{method(){return this.$_addRule("integer")},validate:(e,t)=>Math.trunc(e)-e==0?e:t.error("number.integer")},less:{method(e){return this.$_addRule({name:"less",method:"compare",args:{limit:e},operator:"<"})}},max:{method(e){return this.$_addRule({name:"max",method:"compare",args:{limit:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"compare",args:{limit:e},operator:">="})}},multiple:{method(e){return this.$_addRule({name:"multiple",args:{base:e}})},validate(e,t,r,n){let{base:i}=r;return e*(1/i)%1==0?e:t.error("number.multiple",{multiple:n.args.base,value:e})},args:[{name:"base",ref:!0,assert:e=>"number"==typeof e&&isFinite(e)&&e>0,message:"must be a positive number"}],multi:!0},negative:{method(){return this.sign("negative")}},port:{method(){return this.$_addRule("port")},validate:(e,t)=>Number.isSafeInteger(e)&&e>=0&&e<=65535?e:t.error("number.port")},positive:{method(){return this.sign("positive")}},precision:{method(e){return n(Number.isSafeInteger(e),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:e}})},validate(e,t,r){let{limit:n}=r;const i=e.toString().match(a.precisionRx);return Math.max((i[1]?i[1].length:0)-(i[2]?parseInt(i[2],10):0),0)<=n?e:t.error("number.precision",{limit:n,value:e})},convert:!0},sign:{method(e){return n(["negative","positive"].includes(e),"Invalid sign",e),this.$_addRule({name:"sign",args:{sign:e}})},validate(e,t,r){let{sign:n}=r;return"negative"===n&&e<0||"positive"===n&&e>0?e:t.error(`number.${n}`)}},unsafe:{method(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return n("boolean"==typeof e,"enabled must be a boolean"),this.$_setFlag("unsafe",e)}}},cast:{string:{from:e=>"number"==typeof e,to:(e,t)=>e.toString()}},messages:{"number.base":"{{#label}} must be a number","number.greater":"{{#label}} must be greater than {{#limit}}","number.infinity":"{{#label}} cannot be infinity","number.integer":"{{#label}} must be an integer","number.less":"{{#label}} must be less than {{#limit}}","number.max":"{{#label}} must be less than or equal to {{#limit}}","number.min":"{{#label}} must be greater than or equal to {{#limit}}","number.multiple":"{{#label}} must be a multiple of {{#multiple}}","number.negative":"{{#label}} must be a negative number","number.port":"{{#label}} must be a valid port","number.positive":"{{#label}} must be a positive number","number.precision":"{{#label}} must have no more than {{#limit}} decimal places","number.unsafe":"{{#label}} must be a safe number"}}),a.extractSignificantDigits=function(e){return e.replace(a.exponentialPartRegex,"").replace(a.dotRegex,"").replace(a.trailingZerosRegex,"").replace(a.leadingSignAndZerosRegex,"")},a.normalizeDecimal=function(e){return(e=e.replace(/^\+/,"").replace(/\.0*$/,"").replace(/^(-?)\.([^\.]*)$/,"$10.$2").replace(/^(-?)0+([0-9])/,"$1$2")).includes(".")&&e.endsWith("0")&&(e=e.replace(/0+$/,"")),"-0"===e?"0":e}},8966:(e,t,r)=>{const n=r(7824);e.exports=n.extend({type:"object",cast:{map:{from:e=>e&&"object"==typeof e,to:(e,t)=>new Map(Object.entries(e))}}})},7417:(e,t,r)=>{const n=r(375),i=r(5380),o=r(1745),a=r(9959),s=r(6064),l=r(9926),u=r(5752),c=r(8068),d=r(8160),f={tlds:l instanceof Set&&{tlds:{allow:l,deny:null}},base64Regex:{true:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}==|[\w\-]{3}=)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/},false:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}(==)?|[\w\-]{3}=?)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}(==)?|[A-Za-z0-9+\/]{3}=?)?$/}},dataUriRegex:/^data:[\w+.-]+\/[\w+.-]+;((charset=[\w-]+|base64),)?(.*)$/,hexRegex:/^[a-f0-9]+$/i,ipRegex:a.regex({cidr:"forbidden"}).regex,isoDurationRegex:/^P(?!$)(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?$/,guidBrackets:{"{":"}","[":"]","(":")","":""},guidVersions:{uuidv1:"1",uuidv2:"2",uuidv3:"3",uuidv4:"4",uuidv5:"5"},guidSeparators:new Set([void 0,!0,!1,"-",":"]),normalizationForms:["NFC","NFD","NFKC","NFKD"]};e.exports=c.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(e,t){let{schema:r,state:n,prefs:i}=t;const o=r.$_getRule("normalize");o&&(e=e.normalize(o.args.form));const a=r.$_getRule("case");a&&(e="upper"===a.args.direction?e.toLocaleUpperCase():e.toLocaleLowerCase());const s=r.$_getRule("trim");if(s&&s.args.enabled&&(e=e.trim()),r.$_terms.replacements)for(const t of r.$_terms.replacements)e=e.replace(t.pattern,t.replacement);const l=r.$_getRule("hex");if(l&&l.args.options.byteAligned&&e.length%2!=0&&(e=`0${e}`),r.$_getRule("isoDate")){const t=f.isoDate(e);t&&(e=t)}if(r._flags.truncate){const t=r.$_getRule("max");if(t){let o=t.args.limit;if(d.isResolvable(o)&&(o=o.resolve(e,n,i),!d.limit(o)))return{value:e,errors:r.$_createError("any.ref",o,{ref:t.args.limit,arg:"limit",reason:"must be a positive integer"},n,i)};e=e.slice(0,o)}}return{value:e}}},validate(e,t){let{schema:r,error:n}=t;if("string"!=typeof e)return{value:e,errors:n("string.base")};if(""===e){const t=r.$_getRule("min");if(t&&0===t.args.limit)return;return{value:e,errors:n("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate:(e,t)=>/^[a-zA-Z0-9]+$/.test(e)?e:t.error("string.alphanum")},base64:{method(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return d.assertOptions(e,["paddingRequired","urlSafe"]),e={urlSafe:!1,paddingRequired:!0,...e},n("boolean"==typeof e.paddingRequired,"paddingRequired must be boolean"),n("boolean"==typeof e.urlSafe,"urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:e}})},validate(e,t,r){let{options:n}=r;return f.base64Regex[n.paddingRequired][n.urlSafe].test(e)?e:t.error("string.base64")}},case:{method(e){return n(["lower","upper"].includes(e),"Invalid case:",e),this.$_addRule({name:"case",args:{direction:e}})},validate(e,t,r){let{direction:n}=r;return"lower"===n&&e===e.toLocaleLowerCase()||"upper"===n&&e===e.toLocaleUpperCase()?e:t.error(`string.${n}case`)},convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(e,t){let r=e.length,n=0,i=1;for(;r--;){const t=e.charAt(r)*i;n+=t-9*(t>9),i^=3}return n>0&&n%10==0?e:t.error("string.creditCard")}},dataUri:{method(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return d.assertOptions(e,["paddingRequired"]),e={paddingRequired:!0,...e},n("boolean"==typeof e.paddingRequired,"paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:e}})},validate(e,t,r){let{options:n}=r;const i=e.match(f.dataUriRegex);if(i){if(!i[2])return e;if("base64"!==i[2])return e;if(f.base64Regex[n.paddingRequired].false.test(i[3]))return e}return t.error("string.dataUri")}},domain:{method(e){e&&d.assertOptions(e,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const t=f.addressOptions(e);return this.$_addRule({name:"domain",args:{options:e},address:t})},validate(e,t,r,n){let{address:o}=n;return i.isValid(e,o)?e:t.error("string.domain")}},email:{method(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};d.assertOptions(e,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),n(void 0===e.multiple||"boolean"==typeof e.multiple,"multiple option must be an boolean");const t=f.addressOptions(e),r=new RegExp(`\\s*[${e.separator?s(e.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:e},regex:r,address:t})},validate(e,t,r,n){let{options:i}=r,{regex:a,address:s}=n;const l=i.multiple?e.split(a):[e],u=[];for(const e of l)o.isValid(e,s)||u.push(e);return u.length?t.error("string.email",{value:e,invalids:u}):e}},guid:{alias:"uuid",method(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};d.assertOptions(e,["version","separator"]);let t="";if(e.version){const r=[].concat(e.version);n(r.length>=1,"version must have at least 1 valid version specified");const i=new Set;for(let e=0;e<r.length;++e){const o=r[e];n("string"==typeof o,"version at position "+e+" must be a string");const a=f.guidVersions[o.toLowerCase()];n(a,"version at position "+e+" must be one of "+Object.keys(f.guidVersions).join(", ")),n(!i.has(a),"version at position "+e+" must not be a duplicate"),t+=a,i.add(a)}}n(f.guidSeparators.has(e.separator),'separator must be one of true, false, "-", or ":"');const r=void 0===e.separator?"[:-]?":!0===e.separator?"[:-]":!1===e.separator?"[]?":`\\${e.separator}`,i=new RegExp(`^([\\[{\\(]?)[0-9A-F]{8}(${r})[0-9A-F]{4}\\2?[${t||"0-9A-F"}][0-9A-F]{3}\\2?[${t?"89AB":"0-9A-F"}][0-9A-F]{3}\\2?[0-9A-F]{12}([\\]}\\)]?)$`,"i");return this.$_addRule({name:"guid",args:{options:e},regex:i})},validate(e,t,r,n){let{regex:i}=n;const o=i.exec(e);return o?f.guidBrackets[o[1]]!==o[o.length-1]?t.error("string.guid"):e:t.error("string.guid")}},hex:{method(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return d.assertOptions(e,["byteAligned"]),e={byteAligned:!1,...e},n("boolean"==typeof e.byteAligned,"byteAligned must be boolean"),this.$_addRule({name:"hex",args:{options:e}})},validate(e,t,r){let{options:n}=r;return f.hexRegex.test(e)?n.byteAligned&&e.length%2!=0?t.error("string.hexAlign"):e:t.error("string.hex")}},hostname:{method(){return this.$_addRule("hostname")},validate:(e,t)=>i.isValid(e,{minDomainSegments:1})||f.ipRegex.test(e)?e:t.error("string.hostname")},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};d.assertOptions(e,["cidr","version"]);const{cidr:t,versions:r,regex:n}=a.regex(e),i=e.version?r:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:t,version:i}},regex:n})},validate(e,t,r,n){let{options:i}=r,{regex:o}=n;return o.test(e)?e:i.version?t.error("string.ipVersion",{value:e,cidr:i.cidr,version:i.version}):t.error("string.ip",{value:e,cidr:i.cidr})}},isoDate:{method(){return this.$_addRule("isoDate")},validate(e,t){let{error:r}=t;return f.isoDate(e)?e:r("string.isoDate")}},isoDuration:{method(){return this.$_addRule("isoDuration")},validate:(e,t)=>f.isoDurationRegex.test(e)?e:t.error("string.isoDuration")},length:{method(e,t){return f.length(this,"length",e,"=",t)},validate(e,t,r,n){let{limit:i,encoding:o}=r,{name:a,operator:s,args:l}=n;const u=!o&&e.length;return d.compare(u,i,s)?e:t.error("string."+a,{limit:l.limit,value:e,encoding:o})},args:[{name:"limit",ref:!0,assert:d.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(e,t){return f.length(this,"max",e,"<=",t)},args:["limit","encoding"]},min:{method(e,t){return f.length(this,"min",e,">=",t)},args:["limit","encoding"]},normalize:{method(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"NFC";return n(f.normalizationForms.includes(e),"normalization form must be one of "+f.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:e}})},validate(e,t,r){let{error:n}=t,{form:i}=r;return e===e.normalize(i)?e:n("string.normalize",{value:e,form:i})},convert:!0},pattern:{alias:"regex",method(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n(e instanceof RegExp,"regex must be a RegExp"),n(!e.flags.includes("g")&&!e.flags.includes("y"),"regex should not use global or sticky mode"),"string"==typeof t&&(t={name:t}),d.assertOptions(t,["invert","name"]);const r=["string.pattern",t.invert?".invert":"",t.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:e,options:t},errorCode:r})},validate(e,t,r,n){let{regex:i,options:o}=r,{errorCode:a}=n;return i.test(e)^o.invert?e:t.error(a,{name:o.name,regex:i,value:e})},args:["regex","options"],multi:!0},replace:{method(e,t){"string"==typeof e&&(e=new RegExp(s(e),"g")),n(e instanceof RegExp,"pattern must be a RegExp"),n("string"==typeof t,"replacement must be a String");const r=this.clone();return r.$_terms.replacements||(r.$_terms.replacements=[]),r.$_terms.replacements.push({pattern:e,replacement:t}),r}},token:{method(){return this.$_addRule("token")},validate:(e,t)=>/^\w+$/.test(e)?e:t.error("string.token")},trim:{method(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return n("boolean"==typeof e,"enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:e}})},validate(e,t,r){let{enabled:n}=r;return n&&e!==e.trim()?t.error("string.trim"):e},convert:!0},truncate:{method(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return n("boolean"==typeof e,"enabled must be a boolean"),this.$_setFlag("truncate",e)}},uppercase:{method(){return this.case("upper")}},uri:{method(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};d.assertOptions(e,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme"]),e.domain&&d.assertOptions(e.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const{regex:t,scheme:r}=u.regex(e),n=e.domain?f.addressOptions(e.domain):null;return this.$_addRule({name:"uri",args:{options:e},regex:t,domain:n,scheme:r})},validate(e,t,r,n){let{options:o}=r,{regex:a,domain:s,scheme:l}=n;if(["http:/","https:/"].includes(e))return t.error("string.uri");const u=a.exec(e);if(u){const r=u[1]||u[2];return!s||o.allowRelative&&!r||i.isValid(r,s)?e:t.error("string.domain",{value:r})}return o.relativeOnly?t.error("string.uriRelativeOnly"):o.scheme?t.error("string.uriCustomScheme",{scheme:l,value:e}):t.error("string.uri")}}},manifest:{build(e,t){if(t.replacements)for(const{pattern:r,replacement:n}of t.replacements)e=e.replace(r,n);return e}},messages:{"string.alphanum":"{{#label}} must only contain alpha-numeric characters","string.base":"{{#label}} must be a string","string.base64":"{{#label}} must be a valid base64 string","string.creditCard":"{{#label}} must be a credit card","string.dataUri":"{{#label}} must be a valid dataUri string","string.domain":"{{#label}} must contain a valid domain name","string.email":"{{#label}} must be a valid email","string.empty":"{{#label}} is not allowed to be empty","string.guid":"{{#label}} must be a valid GUID","string.hex":"{{#label}} must only contain hexadecimal characters","string.hexAlign":"{{#label}} hex decoded representation must be byte aligned","string.hostname":"{{#label}} must be a valid hostname","string.ip":"{{#label}} must be a valid ip address with a {{#cidr}} CIDR","string.ipVersion":"{{#label}} must be a valid ip address of one of the following versions {{#version}} with a {{#cidr}} CIDR","string.isoDate":"{{#label}} must be in iso format","string.isoDuration":"{{#label}} must be a valid ISO 8601 duration","string.length":"{{#label}} length must be {{#limit}} characters long","string.lowercase":"{{#label}} must only contain lowercase characters","string.max":"{{#label}} length must be less than or equal to {{#limit}} characters long","string.min":"{{#label}} length must be at least {{#limit}} characters long","string.normalize":"{{#label}} must be unicode normalized in the {{#form}} form","string.token":"{{#label}} must only contain alpha-numeric and underscore characters","string.pattern.base":"{{#label}} with value {:[.]} fails to match the required pattern: {{#regex}}","string.pattern.name":"{{#label}} with value {:[.]} fails to match the {{#name}} pattern","string.pattern.invert.base":"{{#label}} with value {:[.]} matches the inverted pattern: {{#regex}}","string.pattern.invert.name":"{{#label}} with value {:[.]} matches the inverted {{#name}} pattern","string.trim":"{{#label}} must not have leading or trailing whitespace","string.uri":"{{#label}} must be a valid uri","string.uriCustomScheme":"{{#label}} must be a valid uri with a scheme matching the {{#scheme}} pattern","string.uriRelativeOnly":"{{#label}} must be a valid relative uri","string.uppercase":"{{#label}} must only contain uppercase characters"}}),f.addressOptions=function(e){if(!e)return e;if(n(void 0===e.minDomainSegments||Number.isSafeInteger(e.minDomainSegments)&&e.minDomainSegments>0,"minDomainSegments must be a positive integer"),n(void 0===e.maxDomainSegments||Number.isSafeInteger(e.maxDomainSegments)&&e.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),!1===e.tlds)return e;if(!0===e.tlds||void 0===e.tlds)return n(f.tlds,"Built-in TLD list disabled"),Object.assign({},e,f.tlds);n("object"==typeof e.tlds,"tlds must be true, false, or an object");const t=e.tlds.deny;if(t)return Array.isArray(t)&&(e=Object.assign({},e,{tlds:{deny:new Set(t)}})),n(e.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),n(!e.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),f.validateTlds(e.tlds.deny,"tlds.deny"),e;const r=e.tlds.allow;return r?!0===r?(n(f.tlds,"Built-in TLD list disabled"),Object.assign({},e,f.tlds)):(Array.isArray(r)&&(e=Object.assign({},e,{tlds:{allow:new Set(r)}})),n(e.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),f.validateTlds(e.tlds.allow,"tlds.allow"),e):e},f.validateTlds=function(e,t){for(const r of e)n(i.isValid(r,{minDomainSegments:1,maxDomainSegments:1}),`${t} must contain valid top level domain names`)},f.isoDate=function(e){if(!d.isIsoDate(e))return null;/.*T.*[+-]\d\d$/.test(e)&&(e+="00");const t=new Date(e);return isNaN(t.getTime())?null:t.toISOString()},f.length=function(e,t,r,i,o){return n(!o||!1,"Invalid encoding:",o),e.$_addRule({name:t,method:"length",args:{limit:r,encoding:o},operator:i})}},8826:(e,t,r)=>{const n=r(375),i=r(8068),o={};o.Map=class extends Map{slice(){return new o.Map(this)}},e.exports=i.extend({type:"symbol",terms:{map:{init:new o.Map}},coerce:{method(e,t){let{schema:r,error:n}=t;const i=r.$_terms.map.get(e);return i&&(e=i),r._flags.only&&"symbol"!=typeof e?{value:e,errors:n("symbol.map",{map:r.$_terms.map})}:{value:e}}},validate(e,t){let{error:r}=t;if("symbol"!=typeof e)return{value:e,errors:r("symbol.base")}},rules:{map:{method(e){e&&!e[Symbol.iterator]&&"object"==typeof e&&(e=Object.entries(e)),n(e&&e[Symbol.iterator],"Iterable must be an iterable or object");const t=this.clone(),r=[];for(const i of e){n(i&&i[Symbol.iterator],"Entry must be an iterable");const[e,o]=i;n("object"!=typeof e&&"function"!=typeof e&&"symbol"!=typeof e,"Key must not be of type object, function, or Symbol"),n("symbol"==typeof o,"Value must be a Symbol"),t.$_terms.map.set(e,o),r.push(o)}return t.valid(...r)}}},manifest:{build:(e,t)=>(t.map&&(e=e.map(t.map)),e)},messages:{"symbol.base":"{{#label}} must be a symbol","symbol.map":"{{#label}} must be one of {{#map}}"}})},8863:(e,t,r)=>{const n=r(375),i=r(8571),o=r(738),a=r(9621),s=r(8160),l=r(6354),u=r(493),c={result:Symbol("result")};t.entry=function(e,t,r){let i=s.defaults;r&&(n(void 0===r.warnings,"Cannot override warnings preference in synchronous validation"),n(void 0===r.artifacts,"Cannot override artifacts preference in synchronous validation"),i=s.preferences(s.defaults,r));const o=c.entry(e,t,i);n(!o.mainstay.externals.length,"Schema with external rules must use validateAsync()");const a={value:o.value};return o.error&&(a.error=o.error),o.mainstay.warnings.length&&(a.warning=l.details(o.mainstay.warnings)),o.mainstay.debug&&(a.debug=o.mainstay.debug),o.mainstay.artifacts&&(a.artifacts=o.mainstay.artifacts),a},t.entryAsync=async function(e,t,r){let n=s.defaults;r&&(n=s.preferences(s.defaults,r));const i=c.entry(e,t,n),o=i.mainstay;if(i.error)throw o.debug&&(i.error.debug=o.debug),i.error;if(o.externals.length){let t=i.value;for(const{method:i,path:s,label:l}of o.externals){let o,u,c=t;s.length&&(o=s[s.length-1],u=a(t,s.slice(0,-1)),c=u[o]);try{const e=await i(c,{prefs:r});if(void 0===e||e===c)continue;u?u[o]=e:t=e}catch(e){throw n.errors.label&&(e.message+=` (${l})`),e}}i.value=t}if(!n.warnings&&!n.debug&&!n.artifacts)return i.value;const u={value:i.value};return o.warnings.length&&(u.warning=l.details(o.warnings)),o.debug&&(u.debug=o.debug),o.artifacts&&(u.artifacts=o.artifacts),u},c.entry=function(e,r,n){const{tracer:i,cleanup:o}=c.tracer(r,n),a={externals:[],warnings:[],tracer:i,debug:n.debug?[]:null,links:r._ids._schemaChain?new Map:null},s=r._ids._schemaChain?[{schema:r}]:null,d=new u([],[],{mainstay:a,schemas:s}),f=t.validate(e,r,d,n);o&&r.$_root.untrace();const p=l.process(f.errors,e,n);return{value:f.value,error:p,mainstay:a}},c.tracer=function(e,t){return e.$_root._tracer?{tracer:e.$_root._tracer._register(e)}:t.debug?(n(e.$_root.trace,"Debug mode not supported"),{tracer:e.$_root.trace()._register(e),cleanup:!0}):{tracer:c.ignore}},t.validate=function(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};if(t.$_terms.whens&&(t=t._generate(e,r,n).schema),t._preferences&&(n=c.prefs(t,n)),t._cache&&n.cache){const n=t._cache.get(e);if(r.mainstay.tracer.debug(r,"validate","cached",!!n),n)return n}const o=(i,o,a)=>t.$_createError(i,e,o,a||r,n),a={original:e,prefs:n,schema:t,state:r,error:o,errorsArray:c.errorsArray,warn:(e,t,n)=>r.mainstay.warnings.push(o(e,t,n)),message:(i,o)=>t.$_createError("custom",e,o,r,n,{messages:i})};r.mainstay.tracer.entry(t,r);const l=t._definition;if(l.prepare&&void 0!==e&&n.convert){const t=l.prepare(e,a);if(t){if(r.mainstay.tracer.value(r,"prepare",e,t.value),t.errors)return c.finalize(t.value,[].concat(t.errors),a);e=t.value}}if(l.coerce&&void 0!==e&&n.convert&&(!l.coerce.from||l.coerce.from.includes(typeof e))){const t=l.coerce.method(e,a);if(t){if(r.mainstay.tracer.value(r,"coerced",e,t.value),t.errors)return c.finalize(t.value,[].concat(t.errors),a);e=t.value}}const u=t._flags.empty;u&&u.$_match(c.trim(e,t),r.nest(u),s.defaults)&&(r.mainstay.tracer.value(r,"empty",e,void 0),e=void 0);const d=i.presence||t._flags.presence||(t._flags._endedSwitch?null:n.presence);if(void 0===e){if("forbidden"===d)return c.finalize(e,null,a);if("required"===d)return c.finalize(e,[t.$_createError("any.required",e,null,r,n)],a);if("optional"===d){if(t._flags.default!==s.symbols.deepDefault)return c.finalize(e,null,a);r.mainstay.tracer.value(r,"default",e,{}),e={}}}else if("forbidden"===d)return c.finalize(e,[t.$_createError("any.unknown",e,null,r,n)],a);const f=[];if(t._valids){const i=t._valids.get(e,r,n,t._flags.insensitive);if(i)return n.convert&&(r.mainstay.tracer.value(r,"valids",e,i.value),e=i.value),r.mainstay.tracer.filter(t,r,"valid",i),c.finalize(e,null,a);if(t._flags.only){const i=t.$_createError("any.only",e,{valids:t._valids.values({display:!0})},r,n);if(n.abortEarly)return c.finalize(e,[i],a);f.push(i)}}if(t._invalids){const i=t._invalids.get(e,r,n,t._flags.insensitive);if(i){r.mainstay.tracer.filter(t,r,"invalid",i);const o=t.$_createError("any.invalid",e,{invalids:t._invalids.values({display:!0})},r,n);if(n.abortEarly)return c.finalize(e,[o],a);f.push(o)}}if(l.validate){const t=l.validate(e,a);if(t&&(r.mainstay.tracer.value(r,"base",e,t.value),e=t.value,t.errors)){if(!Array.isArray(t.errors))return f.push(t.errors),c.finalize(e,f,a);if(t.errors.length)return f.push(...t.errors),c.finalize(e,f,a)}}return t._rules.length?c.rules(e,f,a):c.finalize(e,f,a)},c.rules=function(e,t,r){const{schema:n,state:i,prefs:o}=r;for(const a of n._rules){const l=n._definition.rules[a.method];if(l.convert&&o.convert){i.mainstay.tracer.log(n,i,"rule",a.name,"full");continue}let u,d=a.args;if(a._resolve.length){d=Object.assign({},d);for(const t of a._resolve){const r=l.argsByName.get(t),a=d[t].resolve(e,i,o),c=r.normalize?r.normalize(a):a,f=s.validateArg(c,null,r);if(f){u=n.$_createError("any.ref",a,{arg:t,ref:d[t],reason:f},i,o);break}d[t]=c}}u=u||l.validate(e,r,d,a);const f=c.rule(u,a);if(f.errors){if(i.mainstay.tracer.log(n,i,"rule",a.name,"error"),a.warn){i.mainstay.warnings.push(...f.errors);continue}if(o.abortEarly)return c.finalize(e,f.errors,r);t.push(...f.errors)}else i.mainstay.tracer.log(n,i,"rule",a.name,"pass"),i.mainstay.tracer.value(i,"rule",e,f.value,a.name),e=f.value}return c.finalize(e,t,r)},c.rule=function(e,t){return e instanceof l.Report?(c.error(e,t),{errors:[e],value:null}):Array.isArray(e)&&e[s.symbols.errors]?(e.forEach((e=>c.error(e,t))),{errors:e,value:null}):{errors:null,value:e}},c.error=function(e,t){return t.message&&e._setTemplate(t.message),e},c.finalize=function(e,t,r){t=t||[];const{schema:i,state:o,prefs:a}=r;if(t.length){const n=c.default("failover",void 0,t,r);void 0!==n&&(o.mainstay.tracer.value(o,"failover",e,n),e=n,t=[])}if(t.length&&i._flags.error)if("function"==typeof i._flags.error){t=i._flags.error(t),Array.isArray(t)||(t=[t]);for(const e of t)n(e instanceof Error||e instanceof l.Report,"error() must return an Error object")}else t=[i._flags.error];if(void 0===e){const n=c.default("default",e,t,r);o.mainstay.tracer.value(o,"default",e,n),e=n}if(i._flags.cast&&void 0!==e){const t=i._definition.cast[i._flags.cast];if(t.from(e)){const n=t.to(e,r);o.mainstay.tracer.value(o,"cast",e,n,i._flags.cast),e=n}}if(i.$_terms.externals&&a.externals&&!1!==a._externals)for(const{method:e}of i.$_terms.externals)o.mainstay.externals.push({method:e,path:o.path,label:l.label(i._flags,o,a)});const s={value:e,errors:t.length?t:null};return i._flags.result&&(s.value="strip"===i._flags.result?void 0:r.original,o.mainstay.tracer.value(o,i._flags.result,e,s.value),o.shadow(e,i._flags.result)),i._cache&&!1!==a.cache&&!i._refs.length&&i._cache.set(r.original,s),void 0===e||s.errors||void 0===i._flags.artifact||(o.mainstay.artifacts=o.mainstay.artifacts||new Map,o.mainstay.artifacts.has(i._flags.artifact)||o.mainstay.artifacts.set(i._flags.artifact,[]),o.mainstay.artifacts.get(i._flags.artifact).push(o.path)),s},c.prefs=function(e,t){const r=t===s.defaults;return r&&e._preferences[s.symbols.prefs]?e._preferences[s.symbols.prefs]:(t=s.preferences(t,e._preferences),r&&(e._preferences[s.symbols.prefs]=t),t)},c.default=function(e,t,r,n){const{schema:o,state:a,prefs:l}=n,u=o._flags[e];if(l.noDefaults||void 0===u)return t;if(a.mainstay.tracer.log(o,a,"rule",e,"full"),!u)return u;if("function"==typeof u){const s=u.length?[i(a.ancestors[0]),n]:[];try{return u(...s)}catch(t){return void r.push(o.$_createError(`any.${e}`,null,{error:t},a,l))}}return"object"!=typeof u?u:u[s.symbols.literal]?u.literal:s.isResolvable(u)?u.resolve(t,a,l):i(u)},c.trim=function(e,t){if("string"!=typeof e)return e;const r=t.$_getRule("trim");return r&&r.args.enabled?e.trim():e},c.ignore={active:!1,debug:o,entry:o,filter:o,log:o,resolve:o,value:o},c.errorsArray=function(){const e=[];return e[s.symbols.errors]=!0,e}},2036:(e,t,r)=>{const n=r(375),i=r(9474),o=r(8160),a={};e.exports=a.Values=class{constructor(e,t){this._values=new Set(e),this._refs=new Set(t),this._lowercase=a.lowercases(e),this._override=!1}get length(){return this._values.size+this._refs.size}add(e,t){o.isResolvable(e)?this._refs.has(e)||(this._refs.add(e),t&&t.register(e)):this.has(e,null,null,!1)||(this._values.add(e),"string"==typeof e&&this._lowercase.set(e.toLowerCase(),e))}static merge(e,t,r){if(e=e||new a.Values,t){if(t._override)return t.clone();for(const r of[...t._values,...t._refs])e.add(r)}if(r)for(const t of[...r._values,...r._refs])e.remove(t);return e.length?e:null}remove(e){o.isResolvable(e)?this._refs.delete(e):(this._values.delete(e),"string"==typeof e&&this._lowercase.delete(e.toLowerCase()))}has(e,t,r,n){return!!this.get(e,t,r,n)}get(e,t,r,n){if(!this.length)return!1;if(this._values.has(e))return{value:e};if("string"==typeof e&&e&&n){const t=this._lowercase.get(e.toLowerCase());if(t)return{value:t}}if(!this._refs.size&&"object"!=typeof e)return!1;if("object"==typeof e)for(const t of this._values)if(i(t,e))return{value:t};if(t)for(const o of this._refs){const a=o.resolve(e,t,r,null,{in:!0});if(void 0===a)continue;const s=o.in&&"object"==typeof a?Array.isArray(a)?a:Object.keys(a):[a];for(const t of s)if(typeof t==typeof e)if(n&&e&&"string"==typeof e){if(t.toLowerCase()===e.toLowerCase())return{value:t,ref:o}}else if(i(t,e))return{value:t,ref:o}}return!1}override(){this._override=!0}values(e){if(e&&e.display){const e=[];for(const t of[...this._values,...this._refs])void 0!==t&&e.push(t);return e}return Array.from([...this._values,...this._refs])}clone(){const e=new a.Values(this._values,this._refs);return e._override=this._override,e}concat(e){n(!e._override,"Cannot concat override set of values");const t=new a.Values([...this._values,...e._values],[...this._refs,...e._refs]);return t._override=this._override,t}describe(){const e=[];this._override&&e.push({override:!0});for(const t of this._values.values())e.push(t&&"object"==typeof t?{value:t}:t);for(const t of this._refs.values())e.push(t.describe());return e}},a.Values.prototype[o.symbols.values]=!0,a.Values.prototype.slice=a.Values.prototype.clone,a.lowercases=function(e){const t=new Map;if(e)for(const r of e)"string"==typeof r&&t.set(r.toLowerCase(),r);return t}},978:(e,t,r)=>{const n=r(375),i=r(8571),o=r(1687),a=r(9621),s={};e.exports=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(n(e&&"object"==typeof e,"Invalid defaults value: must be an object"),n(!t||!0===t||"object"==typeof t,"Invalid source value: must be true, falsy or an object"),n("object"==typeof r,"Invalid options: must be an object"),!t)return null;if(r.shallow)return s.applyToDefaultsWithShallow(e,t,r);const a=i(e);if(!0===t)return a;const l=void 0!==r.nullOverride&&r.nullOverride;return o(a,t,{nullOverride:l,mergeArrays:!1})},s.applyToDefaultsWithShallow=function(e,t,r){const l=r.shallow;n(Array.isArray(l),"Invalid keys");const u=new Map,c=!0===t?null:new Set;for(let r of l){r=Array.isArray(r)?r:r.split(".");const n=a(e,r);n&&"object"==typeof n?u.set(n,c&&a(t,r)||n):c&&c.add(r)}const d=i(e,{},u);if(!c)return d;for(const e of c)s.reachCopy(d,t,e);const f=void 0!==r.nullOverride&&r.nullOverride;return o(d,t,{nullOverride:f,mergeArrays:!1})},s.reachCopy=function(e,t,r){for(const e of r){if(!(e in t))return;const r=t[e];if("object"!=typeof r||null===r)return;t=r}const n=t;let i=e;for(let e=0;e<r.length-1;++e){const t=r[e];"object"!=typeof i[t]&&(i[t]={}),i=i[t]}i[r[r.length-1]]=n}},375:(e,t,r)=>{const n=r(7916);e.exports=function(e){if(!e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];if(1===r.length&&r[0]instanceof Error)throw r[0];throw new n(r)}}},8571:(e,t,r)=>{const n=r(9621),i=r(4277),o=r(7043),a={needsProtoHack:new Set([i.set,i.map,i.weakSet,i.weakMap])};e.exports=a.clone=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if("object"!=typeof e||null===e)return e;let n=a.clone,s=r;if(t.shallow){if(!0!==t.shallow)return a.cloneWithShallow(e,t);n=e=>e}else if(s){const t=s.get(e);if(t)return t}else s=new Map;const l=i.getInternalProto(e);if(l===i.buffer)return!1;if(l===i.date)return new Date(e.getTime());if(l===i.regex)return new RegExp(e);const u=a.base(e,l,t);if(u===e)return e;if(s&&s.set(e,u),l===i.set)for(const r of e)u.add(n(r,t,s));else if(l===i.map)for(const[r,i]of e)u.set(r,n(i,t,s));const c=o.keys(e,t);for(const r of c){if("__proto__"===r)continue;if(l===i.array&&"length"===r){u.length=e.length;continue}const o=Object.getOwnPropertyDescriptor(e,r);o?o.get||o.set?Object.defineProperty(u,r,o):o.enumerable?u[r]=n(e[r],t,s):Object.defineProperty(u,r,{enumerable:!1,writable:!0,configurable:!0,value:n(e[r],t,s)}):Object.defineProperty(u,r,{enumerable:!0,writable:!0,configurable:!0,value:n(e[r],t,s)})}return u},a.cloneWithShallow=function(e,t){const r=t.shallow;(t=Object.assign({},t)).shallow=!1;const i=new Map;for(const t of r){const r=n(e,t);"object"!=typeof r&&"function"!=typeof r||i.set(r,r)}return a.clone(e,t,i)},a.base=function(e,t,r){if(!1===r.prototype)return a.needsProtoHack.has(t)?new t.constructor:t===i.array?[]:{};const n=Object.getPrototypeOf(e);if(n&&n.isImmutable)return e;if(t===i.array){const e=[];return n!==t&&Object.setPrototypeOf(e,n),e}if(a.needsProtoHack.has(t)){const e=new n.constructor;return n!==t&&Object.setPrototypeOf(e,n),e}return Object.create(n)}},9474:(e,t,r)=>{const n=r(4277),i={mismatched:null};e.exports=function(e,t,r){return r=Object.assign({prototype:!0},r),!!i.isDeepEqual(e,t,r,[])},i.isDeepEqual=function(e,t,r,o){if(e===t)return 0!==e||1/e==1/t;const a=typeof e;if(a!==typeof t)return!1;if(null===e||null===t)return!1;if("function"===a){if(!r.deepFunction||e.toString()!==t.toString())return!1}else if("object"!==a)return e!=e&&t!=t;const s=i.getSharedType(e,t,!!r.prototype);switch(s){case n.buffer:return!1;case n.promise:return e===t;case n.regex:return e.toString()===t.toString();case i.mismatched:return!1}for(let r=o.length-1;r>=0;--r)if(o[r].isSame(e,t))return!0;o.push(new i.SeenEntry(e,t));try{return!!i.isDeepEqualObj(s,e,t,r,o)}finally{o.pop()}},i.getSharedType=function(e,t,r){if(r)return Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?i.mismatched:n.getInternalProto(e);const o=n.getInternalProto(e);return o!==n.getInternalProto(t)?i.mismatched:o},i.valueOf=function(e){const t=e.valueOf;if(void 0===t)return e;try{return t.call(e)}catch(e){return e}},i.hasOwnEnumerableProperty=function(e,t){return Object.prototype.propertyIsEnumerable.call(e,t)},i.isSetSimpleEqual=function(e,t){for(const r of Set.prototype.values.call(e))if(!Set.prototype.has.call(t,r))return!1;return!0},i.isDeepEqualObj=function(e,t,r,o,a){const{isDeepEqual:s,valueOf:l,hasOwnEnumerableProperty:u}=i,{keys:c,getOwnPropertySymbols:d}=Object;if(e===n.array){if(!o.part){if(t.length!==r.length)return!1;for(let e=0;e<t.length;++e)if(!s(t[e],r[e],o,a))return!1;return!0}for(const e of t)for(const t of r)if(s(e,t,o,a))return!0}else if(e===n.set){if(t.size!==r.size)return!1;if(!i.isSetSimpleEqual(t,r)){const e=new Set(Set.prototype.values.call(r));for(const r of Set.prototype.values.call(t)){if(e.delete(r))continue;let t=!1;for(const n of e)if(s(r,n,o,a)){e.delete(n),t=!0;break}if(!t)return!1}}}else if(e===n.map){if(t.size!==r.size)return!1;for(const[e,n]of Map.prototype.entries.call(t)){if(void 0===n&&!Map.prototype.has.call(r,e))return!1;if(!s(n,Map.prototype.get.call(r,e),o,a))return!1}}else if(e===n.error&&(t.name!==r.name||t.message!==r.message))return!1;const f=l(t),p=l(r);if((t!==f||r!==p)&&!s(f,p,o,a))return!1;const h=c(t);if(!o.part&&h.length!==c(r).length&&!o.skip)return!1;let m=0;for(const e of h)if(o.skip&&o.skip.includes(e))void 0===r[e]&&++m;else{if(!u(r,e))return!1;if(!s(t[e],r[e],o,a))return!1}if(!o.part&&h.length-m!==c(r).length)return!1;if(!1!==o.symbols){const e=d(t),n=new Set(d(r));for(const i of e){if(!o.skip||!o.skip.includes(i))if(u(t,i)){if(!u(r,i))return!1;if(!s(t[i],r[i],o,a))return!1}else if(u(r,i))return!1;n.delete(i)}for(const e of n)if(u(r,e))return!1}return!0},i.SeenEntry=class{constructor(e,t){this.obj=e,this.ref=t}isSame(e,t){return this.obj===e&&this.ref===t}}},7916:(e,t,r)=>{const n=r(8761);e.exports=class extends Error{constructor(e){super(e.filter((e=>""!==e)).map((e=>"string"==typeof e?e:e instanceof Error?e.message:n(e))).join(" ")||"Unknown error"),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,t.assert)}}},5277:e=>{const t={};e.exports=function(e){if(!e)return"";let r="";for(let n=0;n<e.length;++n){const i=e.charCodeAt(n);t.isSafe(i)?r+=e[n]:r+=t.escapeHtmlChar(i)}return r},t.escapeHtmlChar=function(e){return t.namedHtml.get(e)||(e>=256?"&#"+e+";":`&#x${e.toString(16).padStart(2,"0")};`)},t.isSafe=function(e){return t.safeCharCodes.has(e)},t.namedHtml=new Map([[38,"&"],[60,"<"],[62,">"],[34,"""],[160," "],[162,"¢"],[163,"£"],[164,"¤"],[169,"©"],[174,"®"]]),t.safeCharCodes=function(){const e=new Set;for(let t=32;t<123;++t)(t>=97||t>=65&&t<=90||t>=48&&t<=57||32===t||46===t||44===t||45===t||58===t||95===t)&&e.add(t);return e}()},6064:e=>{e.exports=function(e){return e.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}},738:e=>{e.exports=function(){}},1687:(e,t,r)=>{const n=r(375),i=r(8571),o=r(7043),a={};e.exports=a.merge=function(e,t,r){if(n(e&&"object"==typeof e,"Invalid target value: must be an object"),n(null==t||"object"==typeof t,"Invalid source value: must be null, undefined, or an object"),!t)return e;if(r=Object.assign({nullOverride:!0,mergeArrays:!0},r),Array.isArray(t)){n(Array.isArray(e),"Cannot merge array onto an object"),r.mergeArrays||(e.length=0);for(let n=0;n<t.length;++n)e.push(i(t[n],{symbols:r.symbols}));return e}const s=o.keys(t,r);for(let n=0;n<s.length;++n){const o=s[n];if("__proto__"===o||!Object.prototype.propertyIsEnumerable.call(t,o))continue;const l=t[o];if(l&&"object"==typeof l){if(e[o]===l)continue;!e[o]||"object"!=typeof e[o]||Array.isArray(e[o])!==Array.isArray(l)||l instanceof Date||l instanceof RegExp?e[o]=i(l,{symbols:r.symbols}):a.merge(e[o],l,r)}else(null!=l||r.nullOverride)&&(e[o]=l)}return e}},9621:(e,t,r)=>{const n=r(375),i={};e.exports=function(e,t,r){if(!1===t||null==t)return e;"string"==typeof(r=r||{})&&(r={separator:r});const o=Array.isArray(t);n(!o||!r.separator,"Separator option is not valid for array-based chain");const a=o?t:t.split(r.separator||".");let s=e;for(let e=0;e<a.length;++e){let o=a[e];const l=r.iterables&&i.iterables(s);if(Array.isArray(s)||"set"===l){const e=Number(o);Number.isInteger(e)&&(o=e<0?s.length+e:e)}if(!s||"function"==typeof s&&!1===r.functions||!l&&void 0===s[o]){n(!r.strict||e+1===a.length,"Missing segment",o,"in reach path ",t),n("object"==typeof s||!0===r.functions||"function"!=typeof s,"Invalid segment",o,"in reach path ",t),s=r.default;break}s=l?"set"===l?[...s][o]:s.get(o):s[o]}return s},i.iterables=function(e){return e instanceof Set?"set":e instanceof Map?"map":void 0}},8761:e=>{e.exports=function(){try{return JSON.stringify(...arguments)}catch(e){return"[Cannot display object: "+e.message+"]"}}},4277:(e,t)=>{const r={};t=e.exports={array:Array.prototype,buffer:!1,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype},r.typeMap=new Map([["[object Error]",t.error],["[object Map]",t.map],["[object Promise]",t.promise],["[object Set]",t.set],["[object WeakMap]",t.weakMap],["[object WeakSet]",t.weakSet]]),t.getInternalProto=function(e){if(Array.isArray(e))return t.array;if(e instanceof Date)return t.date;if(e instanceof RegExp)return t.regex;if(e instanceof Error)return t.error;const n=Object.prototype.toString.call(e);return r.typeMap.get(n)||t.generic}},7043:(e,t)=>{t.keys=function(e){return!1!==(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).symbols?Reflect.ownKeys(e):Object.getOwnPropertyNames(e)}},3652:(e,t,r)=>{const n=r(375),i={};t.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(e,t){const r=[].concat((t=t||{}).before||[]),i=[].concat(t.after||[]),o=t.group||"?",a=t.sort||0;n(!r.includes(o),`Item cannot come before itself: ${o}`),n(!r.includes("?"),"Item cannot come before unassociated items"),n(!i.includes(o),`Item cannot come after itself: ${o}`),n(!i.includes("?"),"Item cannot come after unassociated items"),Array.isArray(e)||(e=[e]);for(const t of e){const e={seq:this._items.length,sort:a,before:r,after:i,group:o,node:t};this._items.push(e)}if(!t.manual){const e=this._sort();n(e,"item","?"!==o?`added into group ${o}`:"","created a dependencies error")}return this.nodes}merge(e){Array.isArray(e)||(e=[e]);for(const t of e)if(t)for(const e of t._items)this._items.push(Object.assign({},e));this._items.sort(i.mergeSort);for(let e=0;e<this._items.length;++e)this._items[e].seq=e;const t=this._sort();return n(t,"merge created a dependencies error"),this.nodes}sort(){const e=this._sort();return n(e,"sort created a dependencies error"),this.nodes}_sort(){const e={},t=Object.create(null),r=Object.create(null);for(const n of this._items){const i=n.seq,o=n.group;r[o]=r[o]||[],r[o].push(i),e[i]=n.before;for(const e of n.after)t[e]=t[e]||[],t[e].push(i)}for(const t in e){const n=[];for(const i in e[t]){const o=e[t][i];r[o]=r[o]||[],n.push(...r[o])}e[t]=n}for(const n in t)if(r[n])for(const i of r[n])e[i].push(...t[n]);const n={};for(const t in e){const r=e[t];for(const e of r)n[e]=n[e]||[],n[e].push(t)}const i={},o=[];for(let e=0;e<this._items.length;++e){let t=e;if(n[e]){t=null;for(let e=0;e<this._items.length;++e){if(!0===i[e])continue;n[e]||(n[e]=[]);const r=n[e].length;let o=0;for(let t=0;t<r;++t)i[n[e][t]]&&++o;if(o===r){t=e;break}}}null!==t&&(i[t]=!0,o.push(t))}if(o.length!==this._items.length)return!1;const a={};for(const e of this._items)a[e.seq]=e;this._items=[],this.nodes=[];for(const e of o){const t=a[e];this.nodes.push(t.node),this._items.push(t)}return!0}},i.mergeSort=(e,t)=>e.sort===t.sort?0:e.sort<t.sort?-1:1},5380:(e,t,r)=>{const n=r(443),i=r(2178),o={minDomainSegments:2,nonAsciiRx:/[^\x00-\x7f]/,domainControlRx:/[\x00-\x20@\:\/\\#!\$&\'\(\)\*\+,;=\?]/,tldSegmentRx:/^[a-zA-Z](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,domainSegmentRx:/^[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,URL:n.URL||URL};t.analyze=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return i.code("DOMAIN_NON_EMPTY_STRING");if("string"!=typeof e)throw new Error("Invalid input: domain must be a string");if(e.length>256)return i.code("DOMAIN_TOO_LONG");if(o.nonAsciiRx.test(e)){if(!1===t.allowUnicode)return i.code("DOMAIN_INVALID_UNICODE_CHARS");e=e.normalize("NFC")}if(o.domainControlRx.test(e))return i.code("DOMAIN_INVALID_CHARS");e=o.punycode(e),t.allowFullyQualified&&"."===e[e.length-1]&&(e=e.slice(0,-1));const r=t.minDomainSegments||o.minDomainSegments,n=e.split(".");if(n.length<r)return i.code("DOMAIN_SEGMENTS_COUNT");if(t.maxDomainSegments&&n.length>t.maxDomainSegments)return i.code("DOMAIN_SEGMENTS_COUNT_MAX");const a=t.tlds;if(a){const e=n[n.length-1].toLowerCase();if(a.deny&&a.deny.has(e)||a.allow&&!a.allow.has(e))return i.code("DOMAIN_FORBIDDEN_TLDS")}for(let e=0;e<n.length;++e){const t=n[e];if(!t.length)return i.code("DOMAIN_EMPTY_SEGMENT");if(t.length>63)return i.code("DOMAIN_LONG_SEGMENT");if(e<n.length-1){if(!o.domainSegmentRx.test(t))return i.code("DOMAIN_INVALID_CHARS")}else if(!o.tldSegmentRx.test(t))return i.code("DOMAIN_INVALID_TLDS_CHARS")}return null},t.isValid=function(e,r){return!t.analyze(e,r)},o.punycode=function(e){e.includes("%")&&(e=e.replace(/%/g,"%25"));try{return new o.URL(`http://${e}`).host}catch(t){return e}}},1745:(e,t,r)=>{const n=r(9848),i=r(5380),o=r(2178),a={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(n.TextEncoder||TextEncoder)};t.analyze=function(e,t){return a.email(e,t)},t.isValid=function(e,t){return!a.email(e,t)},a.email=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"!=typeof e)throw new Error("Invalid input: email must be a string");if(!e)return o.code("EMPTY_STRING");const r=!a.nonAsciiRx.test(e);if(!r){if(!1===t.allowUnicode)return o.code("FORBIDDEN_UNICODE");e=e.normalize("NFC")}const n=e.split("@");if(2!==n.length)return n.length>2?o.code("MULTIPLE_AT_CHAR"):o.code("MISSING_AT_CHAR");const[s,l]=n;if(!s)return o.code("EMPTY_LOCAL");if(!t.ignoreLength){if(e.length>254)return o.code("ADDRESS_TOO_LONG");if(a.encoder.encode(s).length>64)return o.code("LOCAL_TOO_LONG")}return a.local(s,r)||i.analyze(l,t)},a.local=function(e,t){const r=e.split(".");for(const e of r){if(!e.length)return o.code("EMPTY_LOCAL_SEGMENT");if(t){if(!a.atextRx.test(e))return o.code("INVALID_LOCAL_CHARS")}else for(const t of e){if(a.atextRx.test(t))continue;const e=a.binary(t);if(!a.atomRx.test(e))return o.code("INVALID_LOCAL_CHARS")}}},a.binary=function(e){return Array.from(a.encoder.encode(e)).map((e=>String.fromCharCode(e))).join("")},a.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/,a.atomRx=new RegExp(["(?:[\\xc2-\\xdf][\\x80-\\xbf])","(?:\\xe0[\\xa0-\\xbf][\\x80-\\xbf])|(?:[\\xe1-\\xec][\\x80-\\xbf]{2})|(?:\\xed[\\x80-\\x9f][\\x80-\\xbf])|(?:[\\xee-\\xef][\\x80-\\xbf]{2})","(?:\\xf0[\\x90-\\xbf][\\x80-\\xbf]{2})|(?:[\\xf1-\\xf3][\\x80-\\xbf]{3})|(?:\\xf4[\\x80-\\x8f][\\x80-\\xbf]{2})"].join("|"))},2178:(e,t)=>{t.codes={EMPTY_STRING:"Address must be a non-empty string",FORBIDDEN_UNICODE:"Address contains forbidden Unicode characters",MULTIPLE_AT_CHAR:"Address cannot contain more than one @ character",MISSING_AT_CHAR:"Address must contain one @ character",EMPTY_LOCAL:"Address local part cannot be empty",ADDRESS_TOO_LONG:"Address too long",LOCAL_TOO_LONG:"Address local part too long",EMPTY_LOCAL_SEGMENT:"Address local part contains empty dot-separated segment",INVALID_LOCAL_CHARS:"Address local part contains invalid character",DOMAIN_NON_EMPTY_STRING:"Domain must be a non-empty string",DOMAIN_TOO_LONG:"Domain too long",DOMAIN_INVALID_UNICODE_CHARS:"Domain contains forbidden Unicode characters",DOMAIN_INVALID_CHARS:"Domain contains invalid character",DOMAIN_INVALID_TLDS_CHARS:"Domain contains invalid tld character",DOMAIN_SEGMENTS_COUNT:"Domain lacks the minimum required number of segments",DOMAIN_SEGMENTS_COUNT_MAX:"Domain contains too many segments",DOMAIN_FORBIDDEN_TLDS:"Domain uses forbidden TLD",DOMAIN_EMPTY_SEGMENT:"Domain contains empty dot-separated segment",DOMAIN_LONG_SEGMENT:"Domain contains dot-separated segment that is too long"},t.code=function(e){return{code:e,error:t.codes[e]}}},9959:(e,t,r)=>{const n=r(375),i=r(5752);t.regex=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n(void 0===e.cidr||"string"==typeof e.cidr,"options.cidr must be a string");const t=e.cidr?e.cidr.toLowerCase():"optional";n(["required","optional","forbidden"].includes(t),"options.cidr must be one of required, optional, forbidden"),n(void 0===e.version||"string"==typeof e.version||Array.isArray(e.version),"options.version must be a string or an array of string");let r=e.version||["ipv4","ipv6","ipvfuture"];Array.isArray(r)||(r=[r]),n(r.length>=1,"options.version must have at least 1 version specified");for(let e=0;e<r.length;++e)n("string"==typeof r[e],"options.version must only contain strings"),r[e]=r[e].toLowerCase(),n(["ipv4","ipv6","ipvfuture"].includes(r[e]),"options.version contains unknown version "+r[e]+" - must be one of ipv4, ipv6, ipvfuture");r=Array.from(new Set(r));const o=r.map((e=>{if("forbidden"===t)return i.ip[e];const r=`\\/${"ipv4"===e?i.ip.v4Cidr:i.ip.v6Cidr}`;return"required"===t?`${i.ip[e]}${r}`:`${i.ip[e]}(?:${r})?`})),a=`(?:${o.join("|")})`,s=new RegExp(`^${a}$`);return{cidr:t,versions:r,regex:s,raw:a}}},5752:(e,t,r)=>{const n=r(375),i=r(6064),o={generate:function(){const e={},t="!\\$&'\\(\\)\\*\\+,;=",r="\\w-\\.~%\\dA-Fa-f"+t+":@",n="["+r+"]",i="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";e.ipv4address="(?:"+i+"\\.){3}"+i;const o="[\\dA-Fa-f]{1,4}",a="(?:"+o+":"+o+"|"+e.ipv4address+")",s="(?:"+o+":){6}"+a,l="::(?:"+o+":){5}"+a,u="(?:"+o+")?::(?:"+o+":){4}"+a,c="(?:(?:"+o+":){0,1}"+o+")?::(?:"+o+":){3}"+a,d="(?:(?:"+o+":){0,2}"+o+")?::(?:"+o+":){2}"+a,f="(?:(?:"+o+":){0,3}"+o+")?::"+o+":"+a,p="(?:(?:"+o+":){0,4}"+o+")?::"+a;e.ipv4Cidr="(?:\\d|[1-2]\\d|3[0-2])",e.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])",e.ipv6address="(?:"+s+"|"+l+"|"+u+"|"+c+"|"+d+"|"+f+"|"+p+"|(?:(?:[\\dA-Fa-f]{1,4}:){0,5}[\\dA-Fa-f]{1,4})?::[\\dA-Fa-f]{1,4}|(?:(?:[\\dA-Fa-f]{1,4}:){0,6}[\\dA-Fa-f]{1,4})?::)",e.ipvFuture="v[\\dA-Fa-f]+\\.[\\w-\\.~"+t+":]+",e.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",e.schemeRegex=new RegExp(e.scheme);const h="[\\w-\\.~%\\dA-Fa-f"+t+":]*",m="(?:\\[(?:"+e.ipv6address+"|"+e.ipvFuture+")\\]|"+e.ipv4address+"|[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=]{1,255})",g="(?:"+h+"@)?"+m+"(?::\\d*)?",y="(?:"+h+"@)?("+m+")(?::\\d*)?",v=n+"+",b="(?:\\/[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]*)*",_="\\/(?:"+v+b+")?",w=v+b,x="[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=@]+"+b;return e.hierPart="(?:(?:\\/\\/"+g+b+")|"+_+"|"+w+"|(?:\\/\\/\\/[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]*(?:\\/[\\w-\\.~%\\dA-Fa-f!\\$&'\\(\\)\\*\\+,;=:@]*)*))",e.hierPartCapture="(?:(?:\\/\\/"+y+b+")|"+_+"|"+w+")",e.relativeRef="(?:(?:\\/\\/"+g+b+")|"+_+"|"+x+"|)",e.relativeRefCapture="(?:(?:\\/\\/"+y+b+")|"+_+"|"+x+"|)",e.query="["+r+"\\/\\?]*(?=#|$)",e.queryWithSquareBrackets="["+r+"\\[\\]\\/\\?]*(?=#|$)",e.fragment="["+r+"\\/\\?]*",e}};o.rfc3986=o.generate(),t.ip={v4Cidr:o.rfc3986.ipv4Cidr,v6Cidr:o.rfc3986.ipv6Cidr,ipv4:o.rfc3986.ipv4address,ipv6:o.rfc3986.ipv6address,ipvfuture:o.rfc3986.ipvFuture},o.createRegex=function(e){const t=o.rfc3986,r="(?:\\?"+(e.allowQuerySquareBrackets?t.queryWithSquareBrackets:t.query)+")?(?:#"+t.fragment+")?",a=e.domain?t.relativeRefCapture:t.relativeRef;if(e.relativeOnly)return o.wrap(a+r);let s="";if(e.scheme){n(e.scheme instanceof RegExp||"string"==typeof e.scheme||Array.isArray(e.scheme),"scheme must be a RegExp, String, or Array");const r=[].concat(e.scheme);n(r.length>=1,"scheme must have at least 1 scheme specified");const o=[];for(let e=0;e<r.length;++e){const a=r[e];n(a instanceof RegExp||"string"==typeof a,"scheme at position "+e+" must be a RegExp or String"),a instanceof RegExp?o.push(a.source.toString()):(n(t.schemeRegex.test(a),"scheme at position "+e+" must be a valid scheme"),o.push(i(a)))}s=o.join("|")}const l="(?:"+(s?"(?:"+s+")":t.scheme)+":"+(e.domain?t.hierPartCapture:t.hierPart)+")",u=e.allowRelative?"(?:"+l+"|"+a+")":l;return o.wrap(u+r,s)},o.wrap=function(e,t){return{raw:e=`(?=.)(?!https?:/(?:$|[^/]))(?!https?:///)(?!https?:[^/])${e}`,regex:new RegExp(`^${e}$`),scheme:t}},o.uriRegex=o.createRegex({}),t.regex=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.scheme||e.allowRelative||e.relativeOnly||e.allowQuerySquareBrackets||e.domain?o.createRegex(e):o.uriRegex}},1447:(e,t)=>{const r={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*\.?[0-9]*){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};t.Parser=class{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t[r.settings]&&t.constants)for(const e in t.constants){const r=t.constants[e];if(null!==r&&!["boolean","number","string"].includes(typeof r))throw new Error(`Formula constant ${e} contains invalid ${typeof r} value type`)}this.settings=t[r.settings]?t:Object.assign({[r.settings]:!0,constants:{},functions:{}},t),this.single=null,this._parts=null,this._parse(e)}_parse(e){let n=[],i="",o=0,a=!1;const s=e=>{if(o)throw new Error("Formula missing closing parenthesis");const s=n.length?n[n.length-1]:null;if(a||i||e){if(s&&"reference"===s.type&&")"===e)return s.type="function",s.value=this._subFormula(i,s.value),void(i="");if(")"===e){const e=new t.Parser(i,this.settings);n.push({type:"segment",value:e})}else if(a){if("]"===a)return n.push({type:"reference",value:i}),void(i="");n.push({type:"literal",value:i})}else if(r.operatorCharacters.includes(i))s&&"operator"===s.type&&r.operators.includes(s.value+i)?s.value+=i:n.push({type:"operator",value:i});else if(i.match(r.numberRx))n.push({type:"constant",value:parseFloat(i)});else if(void 0!==this.settings.constants[i])n.push({type:"constant",value:this.settings.constants[i]});else{if(!i.match(r.tokenRx))throw new Error(`Formula contains invalid token: ${i}`);n.push({type:"reference",value:i})}i=""}};for(const t of e)a?t===a?(s(),a=!1):i+=t:o?"("===t?(i+=t,++o):")"===t?(--o,o?i+=t:s(t)):i+=t:t in r.literals?a=r.literals[t]:"("===t?(s(),++o):r.operatorCharacters.includes(t)?(s(),i=t,s()):" "!==t?i+=t:s();s(),n=n.map(((e,t)=>"operator"!==e.type||"-"!==e.value||t&&"operator"!==n[t-1].type?e:{type:"operator",value:"n"}));let l=!1;for(const e of n){if("operator"===e.type){if(r.operatorsPrefix.includes(e.value))continue;if(!l)throw new Error("Formula contains an operator in invalid position");if(!r.operators.includes(e.value))throw new Error(`Formula contains an unknown operator ${e.value}`)}else if(l)throw new Error("Formula missing expected operator");l=!l}if(!l)throw new Error("Formula contains invalid trailing operator");1===n.length&&["reference","literal","constant"].includes(n[0].type)&&(this.single={type:"reference"===n[0].type?"reference":"value",value:n[0].value}),this._parts=n.map((e=>{if("operator"===e.type)return r.operatorsPrefix.includes(e.value)?e:e.value;if("reference"!==e.type)return e.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(e.value))throw new Error(`Formula contains invalid reference ${e.value}`);return this.settings.reference?this.settings.reference(e.value):r.reference(e.value)}))}_subFormula(e,n){const i=this.settings.functions[n];if("function"!=typeof i)throw new Error(`Formula contains unknown function ${n}`);let o=[];if(e){let t="",i=0,a=!1;const s=()=>{if(!t)throw new Error(`Formula contains function ${n} with invalid arguments ${e}`);o.push(t),t=""};for(let n=0;n<e.length;++n){const o=e[n];a?(t+=o,o===a&&(a=!1)):o in r.literals&&!i?(t+=o,a=r.literals[o]):","!==o||i?(t+=o,"("===o?++i:")"===o&&--i):s()}s()}return o=o.map((e=>new t.Parser(e,this.settings))),function(e){const t=[];for(const r of o)t.push(r.evaluate(e));return i.call(e,...t)}}evaluate(e){const t=this._parts.slice();for(let n=t.length-2;n>=0;--n){const i=t[n];if(i&&"operator"===i.type){const o=t[n+1];t.splice(n+1,1);const a=r.evaluate(o,e);t[n]=r.single(i.value,a)}}return r.operatorsOrder.forEach((n=>{for(let i=1;i<t.length-1;)if(n.includes(t[i])){const n=t[i],o=r.evaluate(t[i-1],e),a=r.evaluate(t[i+1],e);t.splice(i,2);const s=r.calculate(n,o,a);t[i-1]=0===s?0:s}else i+=2})),r.evaluate(t[0],e)}},t.Parser.prototype[r.symbol]=!0,r.reference=function(e){return function(t){return t&&void 0!==t[e]?t[e]:null}},r.evaluate=function(e,t){return null===e?null:"function"==typeof e?e(t):e[r.symbol]?e.evaluate(t):e},r.single=function(e,t){if("!"===e)return!t;const r=-t;return 0===r?0:r},r.calculate=function(e,t,n){if("??"===e)return r.exists(t)?t:n;if("string"==typeof t||"string"==typeof n){if("+"===e)return(t=r.exists(t)?t:"")+(r.exists(n)?n:"")}else switch(e){case"^":return Math.pow(t,n);case"*":return t*n;case"/":return t/n;case"%":return t%n;case"+":return t+n;case"-":return t-n}switch(e){case"<":return t<n;case"<=":return t<=n;case">":return t>n;case">=":return t>=n;case"==":return t===n;case"!=":return t!==n;case"&&":return t&&n;case"||":return t||n}return null},r.exists=function(e){return null!=e}},9926:()=>{},5688:()=>{},9708:()=>{},1152:()=>{},443:()=>{},9848:()=>{},5934:e=>{e.exports={version:"17.7.0"}}},t={},function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,r),o.exports}(5107);var e,t},e.exports=t()},515:(e,t,r)=>{var n=r(761)(r(772),"DataView");e.exports=n},326:(e,t,r)=>{var n=r(761)(r(772),"Map");e.exports=n},760:(e,t,r)=>{var n=r(761)(r(772),"Promise");e.exports=n},143:(e,t,r)=>{var n=r(761)(r(772),"Set");e.exports=n},857:(e,t,r)=>{var n=r(772).Symbol;e.exports=n},215:(e,t,r)=>{var n=r(761)(r(772),"WeakMap");e.exports=n},366:(e,t,r)=>{var n=r(857),i=r(107),o=r(157),a=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?i(e):o(e)}},183:(e,t,r)=>{var n=r(366),i=r(125);e.exports=function(e){return i(e)&&"[object Arguments]"==n(e)}},840:(e,t,r)=>{var n=r(49),i=r(394),o=r(259),a=r(35),s=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,c=l.toString,d=u.hasOwnProperty,f=RegExp("^"+c.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(n(e)?f:s).test(a(e))}},522:(e,t,r)=>{var n=r(366),i=r(158),o=r(125),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return o(e)&&i(e.length)&&!!a[n(e)]}},411:(e,t,r)=>{var n=r(1),i=r(248),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return i(e);var t=[];for(var r in Object(e))o.call(e,r)&&"constructor"!=r&&t.push(r);return t}},826:e=>{e.exports=function(e){return function(t){return e(t)}}},19:(e,t,r)=>{var n=r(772)["__core-js_shared__"];e.exports=n},242:(e,t,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},761:(e,t,r)=>{var n=r(840),i=r(109);e.exports=function(e,t){var r=i(e,t);return n(r)?r:void 0}},107:(e,t,r)=>{var n=r(857),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=n?n.toStringTag:void 0;e.exports=function(e){var t=o.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var i=a.call(e);return n&&(t?e[s]=r:delete e[s]),i}},940:(e,t,r)=>{var n=r(515),i=r(326),o=r(760),a=r(143),s=r(215),l=r(366),u=r(35),c="[object Map]",d="[object Promise]",f="[object Set]",p="[object WeakMap]",h="[object DataView]",m=u(n),g=u(i),y=u(o),v=u(a),b=u(s),_=l;(n&&_(new n(new ArrayBuffer(1)))!=h||i&&_(new i)!=c||o&&_(o.resolve())!=d||a&&_(new a)!=f||s&&_(new s)!=p)&&(_=function(e){var t=l(e),r="[object Object]"==t?e.constructor:void 0,n=r?u(r):"";if(n)switch(n){case m:return h;case g:return c;case y:return d;case v:return f;case b:return p}return t}),e.exports=_},109:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},394:(e,t,r)=>{var n,i=r(19),o=(n=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!o&&o in e}},1:e=>{var t=Object.prototype;e.exports=function(e){var r=e&&e.constructor;return e===("function"==typeof r&&r.prototype||t)}},248:(e,t,r)=>{var n=r(241)(Object.keys,Object);e.exports=n},146:(e,t,r)=>{e=r.nmd(e);var n=r(242),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i&&n.process,s=function(){try{return o&&o.require&&o.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s},157:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},241:e=>{e.exports=function(e,t){return function(r){return e(t(r))}}},772:(e,t,r)=>{var n=r(242),i="object"==typeof self&&self&&self.Object===Object&&self,o=n||i||Function("return this")();e.exports=o},35:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},631:(e,t,r)=>{var n=r(183),i=r(125),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,l=n(function(){return arguments}())?n:function(e){return i(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},152:e=>{var t=Array.isArray;e.exports=t},878:(e,t,r)=>{var n=r(49),i=r(158);e.exports=function(e){return null!=e&&i(e.length)&&!n(e)}},226:(e,t,r)=>{e=r.nmd(e);var n=r(772),i=r(330),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,s=a&&a.exports===o?n.Buffer:void 0,l=(s?s.isBuffer:void 0)||i;e.exports=l},455:(e,t,r)=>{var n=r(411),i=r(940),o=r(631),a=r(152),s=r(878),l=r(226),u=r(1),c=r(598),d=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(s(e)&&(a(e)||"string"==typeof e||"function"==typeof e.splice||l(e)||c(e)||o(e)))return!e.length;var t=i(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(u(e))return!n(e).length;for(var r in e)if(d.call(e,r))return!1;return!0}},49:(e,t,r)=>{var n=r(366),i=r(259);e.exports=function(e){if(!i(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},158:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},259:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},125:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},598:(e,t,r)=>{var n=r(522),i=r(826),o=r(146),a=o&&o.isTypedArray,s=a?i(a):n;e.exports=s},635:function(e,t,r){var n;e=r.nmd(e),function(){var i,o="Expected a function",a="__lodash_hash_undefined__",s="__lodash_placeholder__",l=32,u=128,c=1/0,d=9007199254740991,f=NaN,p=4294967295,h=[["ary",u],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",l],["partialRight",64],["rearg",256]],m="[object Arguments]",g="[object Array]",y="[object Boolean]",v="[object Date]",b="[object Error]",_="[object Function]",w="[object GeneratorFunction]",x="[object Map]",A="[object Number]",j="[object Object]",S="[object Promise]",k="[object RegExp]",C="[object Set]",$="[object String]",O="[object Symbol]",F="[object WeakMap]",T="[object ArrayBuffer]",D="[object DataView]",E="[object Float32Array]",P="[object Float64Array]",R="[object Int8Array]",I="[object Int16Array]",M="[object Int32Array]",q="[object Uint8Array]",L="[object Uint8ClampedArray]",N="[object Uint16Array]",z="[object Uint32Array]",B=/\b__p \+= '';/g,U=/\b(__p \+=) '' \+/g,V=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,G=/[&<>"']/g,Y=RegExp(W.source),H=RegExp(G.source),K=/<%-([\s\S]+?)%>/g,X=/<%([\s\S]+?)%>/g,Z=/<%=([\s\S]+?)%>/g,J=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,re=RegExp(te.source),ne=/^\s+/,ie=/\s/,oe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ae=/\{\n\/\* \[wrapped with (.+)\] \*/,se=/,? & /,le=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ue=/[()=,{}\[\]\/\s]/,ce=/\\(\\)?/g,de=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,fe=/\w*$/,pe=/^[-+]0x[0-9a-f]+$/i,he=/^0b[01]+$/i,me=/^\[object .+?Constructor\]$/,ge=/^0o[0-7]+$/i,ye=/^(?:0|[1-9]\d*)$/,ve=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,be=/($^)/,_e=/['\n\r\u2028\u2029\\]/g,we="\\ud800-\\udfff",xe="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ae="\\u2700-\\u27bf",je="a-z\\xdf-\\xf6\\xf8-\\xff",Se="A-Z\\xc0-\\xd6\\xd8-\\xde",ke="\\ufe0e\\ufe0f",Ce="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",$e="["+we+"]",Oe="["+Ce+"]",Fe="["+xe+"]",Te="\\d+",De="["+Ae+"]",Ee="["+je+"]",Pe="[^"+we+Ce+Te+Ae+je+Se+"]",Re="\\ud83c[\\udffb-\\udfff]",Ie="[^"+we+"]",Me="(?:\\ud83c[\\udde6-\\uddff]){2}",qe="[\\ud800-\\udbff][\\udc00-\\udfff]",Le="["+Se+"]",Ne="\\u200d",ze="(?:"+Ee+"|"+Pe+")",Be="(?:"+Le+"|"+Pe+")",Ue="(?:['’](?:d|ll|m|re|s|t|ve))?",Ve="(?:['’](?:D|LL|M|RE|S|T|VE))?",We="(?:"+Fe+"|"+Re+")?",Ge="["+ke+"]?",Ye=Ge+We+"(?:"+Ne+"(?:"+[Ie,Me,qe].join("|")+")"+Ge+We+")*",He="(?:"+[De,Me,qe].join("|")+")"+Ye,Ke="(?:"+[Ie+Fe+"?",Fe,Me,qe,$e].join("|")+")",Xe=RegExp("['’]","g"),Ze=RegExp(Fe,"g"),Je=RegExp(Re+"(?="+Re+")|"+Ke+Ye,"g"),Qe=RegExp([Le+"?"+Ee+"+"+Ue+"(?="+[Oe,Le,"$"].join("|")+")",Be+"+"+Ve+"(?="+[Oe,Le+ze,"$"].join("|")+")",Le+"?"+ze+"+"+Ue,Le+"+"+Ve,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Te,He].join("|"),"g"),et=RegExp("["+Ne+we+xe+ke+"]"),tt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,rt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],nt=-1,it={};it[E]=it[P]=it[R]=it[I]=it[M]=it[q]=it[L]=it[N]=it[z]=!0,it[m]=it[g]=it[T]=it[y]=it[D]=it[v]=it[b]=it[_]=it[x]=it[A]=it[j]=it[k]=it[C]=it[$]=it[F]=!1;var ot={};ot[m]=ot[g]=ot[T]=ot[D]=ot[y]=ot[v]=ot[E]=ot[P]=ot[R]=ot[I]=ot[M]=ot[x]=ot[A]=ot[j]=ot[k]=ot[C]=ot[$]=ot[O]=ot[q]=ot[L]=ot[N]=ot[z]=!0,ot[b]=ot[_]=ot[F]=!1;var at={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},st=parseFloat,lt=parseInt,ut="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,ct="object"==typeof self&&self&&self.Object===Object&&self,dt=ut||ct||Function("return this")(),ft=t&&!t.nodeType&&t,pt=ft&&e&&!e.nodeType&&e,ht=pt&&pt.exports===ft,mt=ht&&ut.process,gt=function(){try{return pt&&pt.require&&pt.require("util").types||mt&&mt.binding&&mt.binding("util")}catch(e){}}(),yt=gt&>.isArrayBuffer,vt=gt&>.isDate,bt=gt&>.isMap,_t=gt&>.isRegExp,wt=gt&>.isSet,xt=gt&>.isTypedArray;function At(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function jt(e,t,r,n){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(n,a,r(a),e)}return n}function St(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}function kt(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}function Ct(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}function $t(e,t){for(var r=-1,n=null==e?0:e.length,i=0,o=[];++r<n;){var a=e[r];t(a,r,e)&&(o[i++]=a)}return o}function Ot(e,t){return!(null==e||!e.length)&&Lt(e,t,0)>-1}function Ft(e,t,r){for(var n=-1,i=null==e?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}function Tt(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}function Dt(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function Et(e,t,r,n){var i=-1,o=null==e?0:e.length;for(n&&o&&(r=e[++i]);++i<o;)r=t(r,e[i],i,e);return r}function Pt(e,t,r,n){var i=null==e?0:e.length;for(n&&i&&(r=e[--i]);i--;)r=t(r,e[i],i,e);return r}function Rt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var It=Ut("length");function Mt(e,t,r){var n;return r(e,(function(e,r,i){if(t(e,r,i))return n=r,!1})),n}function qt(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function Lt(e,t,r){return t==t?function(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}(e,t,r):qt(e,zt,r)}function Nt(e,t,r,n){for(var i=r-1,o=e.length;++i<o;)if(n(e[i],t))return i;return-1}function zt(e){return e!=e}function Bt(e,t){var r=null==e?0:e.length;return r?Gt(e,t)/r:f}function Ut(e){return function(t){return null==t?i:t[e]}}function Vt(e){return function(t){return null==e?i:e[t]}}function Wt(e,t,r,n,i){return i(e,(function(e,i,o){r=n?(n=!1,e):t(r,e,i,o)})),r}function Gt(e,t){for(var r,n=-1,o=e.length;++n<o;){var a=t(e[n]);a!==i&&(r=r===i?a:r+a)}return r}function Yt(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Ht(e){return e?e.slice(0,dr(e)+1).replace(ne,""):e}function Kt(e){return function(t){return e(t)}}function Xt(e,t){return Tt(t,(function(t){return e[t]}))}function Zt(e,t){return e.has(t)}function Jt(e,t){for(var r=-1,n=e.length;++r<n&&Lt(t,e[r],0)>-1;);return r}function Qt(e,t){for(var r=e.length;r--&&Lt(t,e[r],0)>-1;);return r}var er=Vt({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),tr=Vt({"&":"&","<":"<",">":">",'"':""","'":"'"});function rr(e){return"\\"+at[e]}function nr(e){return et.test(e)}function ir(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function or(e,t){return function(r){return e(t(r))}}function ar(e,t){for(var r=-1,n=e.length,i=0,o=[];++r<n;){var a=e[r];a!==t&&a!==s||(e[r]=s,o[i++]=r)}return o}function sr(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}function lr(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=[e,e]})),r}function ur(e){return nr(e)?function(e){for(var t=Je.lastIndex=0;Je.test(e);)++t;return t}(e):It(e)}function cr(e){return nr(e)?function(e){return e.match(Je)||[]}(e):function(e){return e.split("")}(e)}function dr(e){for(var t=e.length;t--&&ie.test(e.charAt(t)););return t}var fr=Vt({"&":"&","<":"<",">":">",""":'"',"'":"'"}),pr=function e(t){var r,n=(t=null==t?dt:pr.defaults(dt.Object(),t,pr.pick(dt,rt))).Array,ie=t.Date,we=t.Error,xe=t.Function,Ae=t.Math,je=t.Object,Se=t.RegExp,ke=t.String,Ce=t.TypeError,$e=n.prototype,Oe=xe.prototype,Fe=je.prototype,Te=t["__core-js_shared__"],De=Oe.toString,Ee=Fe.hasOwnProperty,Pe=0,Re=(r=/[^.]+$/.exec(Te&&Te.keys&&Te.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",Ie=Fe.toString,Me=De.call(je),qe=dt._,Le=Se("^"+De.call(Ee).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ne=ht?t.Buffer:i,ze=t.Symbol,Be=t.Uint8Array,Ue=Ne?Ne.allocUnsafe:i,Ve=or(je.getPrototypeOf,je),We=je.create,Ge=Fe.propertyIsEnumerable,Ye=$e.splice,He=ze?ze.isConcatSpreadable:i,Ke=ze?ze.iterator:i,Je=ze?ze.toStringTag:i,et=function(){try{var e=lo(je,"defineProperty");return e({},"",{}),e}catch(e){}}(),at=t.clearTimeout!==dt.clearTimeout&&t.clearTimeout,ut=ie&&ie.now!==dt.Date.now&&ie.now,ct=t.setTimeout!==dt.setTimeout&&t.setTimeout,ft=Ae.ceil,pt=Ae.floor,mt=je.getOwnPropertySymbols,gt=Ne?Ne.isBuffer:i,It=t.isFinite,Vt=$e.join,hr=or(je.keys,je),mr=Ae.max,gr=Ae.min,yr=ie.now,vr=t.parseInt,br=Ae.random,_r=$e.reverse,wr=lo(t,"DataView"),xr=lo(t,"Map"),Ar=lo(t,"Promise"),jr=lo(t,"Set"),Sr=lo(t,"WeakMap"),kr=lo(je,"create"),Cr=Sr&&new Sr,$r={},Or=Mo(wr),Fr=Mo(xr),Tr=Mo(Ar),Dr=Mo(jr),Er=Mo(Sr),Pr=ze?ze.prototype:i,Rr=Pr?Pr.valueOf:i,Ir=Pr?Pr.toString:i;function Mr(e){if(es(e)&&!Ua(e)&&!(e instanceof zr)){if(e instanceof Nr)return e;if(Ee.call(e,"__wrapped__"))return qo(e)}return new Nr(e)}var qr=function(){function e(){}return function(t){if(!Qa(t))return{};if(We)return We(t);e.prototype=t;var r=new e;return e.prototype=i,r}}();function Lr(){}function Nr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function zr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=p,this.__views__=[]}function Br(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Ur(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Vr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Wr(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new Vr;++t<r;)this.add(e[t])}function Gr(e){var t=this.__data__=new Ur(e);this.size=t.size}function Yr(e,t){var r=Ua(e),n=!r&&Ba(e),i=!r&&!n&&Ya(e),o=!r&&!n&&!i&&ls(e),a=r||n||i||o,s=a?Yt(e.length,ke):[],l=s.length;for(var u in e)!t&&!Ee.call(e,u)||a&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||go(u,l))||s.push(u);return s}function Hr(e){var t=e.length;return t?e[Wn(0,t-1)]:i}function Kr(e,t){return Do(ki(e),on(t,0,e.length))}function Xr(e){return Do(ki(e))}function Zr(e,t,r){(r!==i&&!La(e[t],r)||r===i&&!(t in e))&&rn(e,t,r)}function Jr(e,t,r){var n=e[t];Ee.call(e,t)&&La(n,r)&&(r!==i||t in e)||rn(e,t,r)}function Qr(e,t){for(var r=e.length;r--;)if(La(e[r][0],t))return r;return-1}function en(e,t,r,n){return cn(e,(function(e,i,o){t(n,e,r(e),o)})),n}function tn(e,t){return e&&Ci(t,Fs(t),e)}function rn(e,t,r){"__proto__"==t&&et?et(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function nn(e,t){for(var r=-1,o=t.length,a=n(o),s=null==e;++r<o;)a[r]=s?i:Ss(e,t[r]);return a}function on(e,t,r){return e==e&&(r!==i&&(e=e<=r?e:r),t!==i&&(e=e>=t?e:t)),e}function an(e,t,r,n,o,a){var s,l=1&t,u=2&t,c=4&t;if(r&&(s=o?r(e,n,o,a):r(e)),s!==i)return s;if(!Qa(e))return e;var d=Ua(e);if(d){if(s=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&Ee.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e),!l)return ki(e,s)}else{var f=fo(e),p=f==_||f==w;if(Ya(e))return _i(e,l);if(f==j||f==m||p&&!o){if(s=u||p?{}:ho(e),!l)return u?function(e,t){return Ci(e,co(e),t)}(e,function(e,t){return e&&Ci(t,Ts(t),e)}(s,e)):function(e,t){return Ci(e,uo(e),t)}(e,tn(s,e))}else{if(!ot[f])return o?e:{};s=function(e,t,r){var n,i=e.constructor;switch(t){case T:return wi(e);case y:case v:return new i(+e);case D:return function(e,t){var r=t?wi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case E:case P:case R:case I:case M:case q:case L:case N:case z:return xi(e,r);case x:return new i;case A:case $:return new i(e);case k:return function(e){var t=new e.constructor(e.source,fe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case C:return new i;case O:return n=e,Rr?je(Rr.call(n)):{}}}(e,f,l)}}a||(a=new Gr);var h=a.get(e);if(h)return h;a.set(e,s),os(e)?e.forEach((function(n){s.add(an(n,t,r,n,e,a))})):ts(e)&&e.forEach((function(n,i){s.set(i,an(n,t,r,i,e,a))}));var g=d?i:(c?u?to:eo:u?Ts:Fs)(e);return St(g||e,(function(n,i){g&&(n=e[i=n]),Jr(s,i,an(n,t,r,i,e,a))})),s}function sn(e,t,r){var n=r.length;if(null==e)return!n;for(e=je(e);n--;){var o=r[n],a=t[o],s=e[o];if(s===i&&!(o in e)||!a(s))return!1}return!0}function ln(e,t,r){if("function"!=typeof e)throw new Ce(o);return $o((function(){e.apply(i,r)}),t)}function un(e,t,r,n){var i=-1,o=Ot,a=!0,s=e.length,l=[],u=t.length;if(!s)return l;r&&(t=Tt(t,Kt(r))),n?(o=Ft,a=!1):t.length>=200&&(o=Zt,a=!1,t=new Wr(t));e:for(;++i<s;){var c=e[i],d=null==r?c:r(c);if(c=n||0!==c?c:0,a&&d==d){for(var f=u;f--;)if(t[f]===d)continue e;l.push(c)}else o(t,d,n)||l.push(c)}return l}Mr.templateSettings={escape:K,evaluate:X,interpolate:Z,variable:"",imports:{_:Mr}},Mr.prototype=Lr.prototype,Mr.prototype.constructor=Mr,Nr.prototype=qr(Lr.prototype),Nr.prototype.constructor=Nr,zr.prototype=qr(Lr.prototype),zr.prototype.constructor=zr,Br.prototype.clear=function(){this.__data__=kr?kr(null):{},this.size=0},Br.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Br.prototype.get=function(e){var t=this.__data__;if(kr){var r=t[e];return r===a?i:r}return Ee.call(t,e)?t[e]:i},Br.prototype.has=function(e){var t=this.__data__;return kr?t[e]!==i:Ee.call(t,e)},Br.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=kr&&t===i?a:t,this},Ur.prototype.clear=function(){this.__data__=[],this.size=0},Ur.prototype.delete=function(e){var t=this.__data__,r=Qr(t,e);return!(r<0||(r==t.length-1?t.pop():Ye.call(t,r,1),--this.size,0))},Ur.prototype.get=function(e){var t=this.__data__,r=Qr(t,e);return r<0?i:t[r][1]},Ur.prototype.has=function(e){return Qr(this.__data__,e)>-1},Ur.prototype.set=function(e,t){var r=this.__data__,n=Qr(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},Vr.prototype.clear=function(){this.size=0,this.__data__={hash:new Br,map:new(xr||Ur),string:new Br}},Vr.prototype.delete=function(e){var t=ao(this,e).delete(e);return this.size-=t?1:0,t},Vr.prototype.get=function(e){return ao(this,e).get(e)},Vr.prototype.has=function(e){return ao(this,e).has(e)},Vr.prototype.set=function(e,t){var r=ao(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Wr.prototype.add=Wr.prototype.push=function(e){return this.__data__.set(e,a),this},Wr.prototype.has=function(e){return this.__data__.has(e)},Gr.prototype.clear=function(){this.__data__=new Ur,this.size=0},Gr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Gr.prototype.get=function(e){return this.__data__.get(e)},Gr.prototype.has=function(e){return this.__data__.has(e)},Gr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Ur){var n=r.__data__;if(!xr||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Vr(n)}return r.set(e,t),this.size=r.size,this};var cn=Fi(vn),dn=Fi(bn,!0);function fn(e,t){var r=!0;return cn(e,(function(e,n,i){return r=!!t(e,n,i)})),r}function pn(e,t,r){for(var n=-1,o=e.length;++n<o;){var a=e[n],s=t(a);if(null!=s&&(l===i?s==s&&!ss(s):r(s,l)))var l=s,u=a}return u}function hn(e,t){var r=[];return cn(e,(function(e,n,i){t(e,n,i)&&r.push(e)})),r}function mn(e,t,r,n,i){var o=-1,a=e.length;for(r||(r=mo),i||(i=[]);++o<a;){var s=e[o];t>0&&r(s)?t>1?mn(s,t-1,r,n,i):Dt(i,s):n||(i[i.length]=s)}return i}var gn=Ti(),yn=Ti(!0);function vn(e,t){return e&&gn(e,t,Fs)}function bn(e,t){return e&&yn(e,t,Fs)}function _n(e,t){return $t(t,(function(t){return Xa(e[t])}))}function wn(e,t){for(var r=0,n=(t=gi(t,e)).length;null!=e&&r<n;)e=e[Io(t[r++])];return r&&r==n?e:i}function xn(e,t,r){var n=t(e);return Ua(e)?n:Dt(n,r(e))}function An(e){return null==e?e===i?"[object Undefined]":"[object Null]":Je&&Je in je(e)?function(e){var t=Ee.call(e,Je),r=e[Je];try{e[Je]=i;var n=!0}catch(e){}var o=Ie.call(e);return n&&(t?e[Je]=r:delete e[Je]),o}(e):function(e){return Ie.call(e)}(e)}function jn(e,t){return e>t}function Sn(e,t){return null!=e&&Ee.call(e,t)}function kn(e,t){return null!=e&&t in je(e)}function Cn(e,t,r){for(var o=r?Ft:Ot,a=e[0].length,s=e.length,l=s,u=n(s),c=1/0,d=[];l--;){var f=e[l];l&&t&&(f=Tt(f,Kt(t))),c=gr(f.length,c),u[l]=!r&&(t||a>=120&&f.length>=120)?new Wr(l&&f):i}f=e[0];var p=-1,h=u[0];e:for(;++p<a&&d.length<c;){var m=f[p],g=t?t(m):m;if(m=r||0!==m?m:0,!(h?Zt(h,g):o(d,g,r))){for(l=s;--l;){var y=u[l];if(!(y?Zt(y,g):o(e[l],g,r)))continue e}h&&h.push(g),d.push(m)}}return d}function $n(e,t,r){var n=null==(e=So(e,t=gi(t,e)))?e:e[Io(Ko(t))];return null==n?i:At(n,e,r)}function On(e){return es(e)&&An(e)==m}function Fn(e,t,r,n,o){return e===t||(null==e||null==t||!es(e)&&!es(t)?e!=e&&t!=t:function(e,t,r,n,o,a){var s=Ua(e),l=Ua(t),u=s?g:fo(e),c=l?g:fo(t),d=(u=u==m?j:u)==j,f=(c=c==m?j:c)==j,p=u==c;if(p&&Ya(e)){if(!Ya(t))return!1;s=!0,d=!1}if(p&&!d)return a||(a=new Gr),s||ls(e)?Ji(e,t,r,n,o,a):function(e,t,r,n,i,o,a){switch(r){case D:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case T:return!(e.byteLength!=t.byteLength||!o(new Be(e),new Be(t)));case y:case v:case A:return La(+e,+t);case b:return e.name==t.name&&e.message==t.message;case k:case $:return e==t+"";case x:var s=ir;case C:var l=1&n;if(s||(s=sr),e.size!=t.size&&!l)return!1;var u=a.get(e);if(u)return u==t;n|=2,a.set(e,t);var c=Ji(s(e),s(t),n,i,o,a);return a.delete(e),c;case O:if(Rr)return Rr.call(e)==Rr.call(t)}return!1}(e,t,u,r,n,o,a);if(!(1&r)){var h=d&&Ee.call(e,"__wrapped__"),_=f&&Ee.call(t,"__wrapped__");if(h||_){var w=h?e.value():e,S=_?t.value():t;return a||(a=new Gr),o(w,S,r,n,a)}}return!!p&&(a||(a=new Gr),function(e,t,r,n,o,a){var s=1&r,l=eo(e),u=l.length;if(u!=eo(t).length&&!s)return!1;for(var c=u;c--;){var d=l[c];if(!(s?d in t:Ee.call(t,d)))return!1}var f=a.get(e),p=a.get(t);if(f&&p)return f==t&&p==e;var h=!0;a.set(e,t),a.set(t,e);for(var m=s;++c<u;){var g=e[d=l[c]],y=t[d];if(n)var v=s?n(y,g,d,t,e,a):n(g,y,d,e,t,a);if(!(v===i?g===y||o(g,y,r,n,a):v)){h=!1;break}m||(m="constructor"==d)}if(h&&!m){var b=e.constructor,_=t.constructor;b==_||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof _&&_ instanceof _||(h=!1)}return a.delete(e),a.delete(t),h}(e,t,r,n,o,a))}(e,t,r,n,Fn,o))}function Tn(e,t,r,n){var o=r.length,a=o,s=!n;if(null==e)return!a;for(e=je(e);o--;){var l=r[o];if(s&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++o<a;){var u=(l=r[o])[0],c=e[u],d=l[1];if(s&&l[2]){if(c===i&&!(u in e))return!1}else{var f=new Gr;if(n)var p=n(c,d,u,e,t,f);if(!(p===i?Fn(d,c,3,n,f):p))return!1}}return!0}function Dn(e){return!(!Qa(e)||(t=e,Re&&Re in t))&&(Xa(e)?Le:me).test(Mo(e));var t}function En(e){return"function"==typeof e?e:null==e?rl:"object"==typeof e?Ua(e)?qn(e[0],e[1]):Mn(e):dl(e)}function Pn(e){if(!wo(e))return hr(e);var t=[];for(var r in je(e))Ee.call(e,r)&&"constructor"!=r&&t.push(r);return t}function Rn(e,t){return e<t}function In(e,t){var r=-1,i=Wa(e)?n(e.length):[];return cn(e,(function(e,n,o){i[++r]=t(e,n,o)})),i}function Mn(e){var t=so(e);return 1==t.length&&t[0][2]?Ao(t[0][0],t[0][1]):function(r){return r===e||Tn(r,e,t)}}function qn(e,t){return vo(e)&&xo(t)?Ao(Io(e),t):function(r){var n=Ss(r,e);return n===i&&n===t?ks(r,e):Fn(t,n,3)}}function Ln(e,t,r,n,o){e!==t&&gn(t,(function(a,s){if(o||(o=new Gr),Qa(a))!function(e,t,r,n,o,a,s){var l=ko(e,r),u=ko(t,r),c=s.get(u);if(c)Zr(e,r,c);else{var d=a?a(l,u,r+"",e,t,s):i,f=d===i;if(f){var p=Ua(u),h=!p&&Ya(u),m=!p&&!h&&ls(u);d=u,p||h||m?Ua(l)?d=l:Ga(l)?d=ki(l):h?(f=!1,d=_i(u,!0)):m?(f=!1,d=xi(u,!0)):d=[]:ns(u)||Ba(u)?(d=l,Ba(l)?d=gs(l):Qa(l)&&!Xa(l)||(d=ho(u))):f=!1}f&&(s.set(u,d),o(d,u,n,a,s),s.delete(u)),Zr(e,r,d)}}(e,t,s,r,Ln,n,o);else{var l=n?n(ko(e,s),a,s+"",e,t,o):i;l===i&&(l=a),Zr(e,s,l)}}),Ts)}function Nn(e,t){var r=e.length;if(r)return go(t+=t<0?r:0,r)?e[t]:i}function zn(e,t,r){t=t.length?Tt(t,(function(e){return Ua(e)?function(t){return wn(t,1===e.length?e[0]:e)}:e})):[rl];var n=-1;t=Tt(t,Kt(oo()));var i=In(e,(function(e,r,i){var o=Tt(t,(function(t){return t(e)}));return{criteria:o,index:++n,value:e}}));return function(e,t){var n=e.length;for(e.sort((function(e,t){return function(e,t,r){for(var n=-1,i=e.criteria,o=t.criteria,a=i.length,s=r.length;++n<a;){var l=Ai(i[n],o[n]);if(l)return n>=s?l:l*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)}));n--;)e[n]=e[n].value;return e}(i)}function Bn(e,t,r){for(var n=-1,i=t.length,o={};++n<i;){var a=t[n],s=wn(e,a);r(s,a)&&Xn(o,gi(a,e),s)}return o}function Un(e,t,r,n){var i=n?Nt:Lt,o=-1,a=t.length,s=e;for(e===t&&(t=ki(t)),r&&(s=Tt(e,Kt(r)));++o<a;)for(var l=0,u=t[o],c=r?r(u):u;(l=i(s,c,l,n))>-1;)s!==e&&Ye.call(s,l,1),Ye.call(e,l,1);return e}function Vn(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==o){var o=i;go(i)?Ye.call(e,i,1):li(e,i)}}return e}function Wn(e,t){return e+pt(br()*(t-e+1))}function Gn(e,t){var r="";if(!e||t<1||t>d)return r;do{t%2&&(r+=e),(t=pt(t/2))&&(e+=e)}while(t);return r}function Yn(e,t){return Oo(jo(e,t,rl),e+"")}function Hn(e){return Hr(Ls(e))}function Kn(e,t){var r=Ls(e);return Do(r,on(t,0,r.length))}function Xn(e,t,r,n){if(!Qa(e))return e;for(var o=-1,a=(t=gi(t,e)).length,s=a-1,l=e;null!=l&&++o<a;){var u=Io(t[o]),c=r;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(o!=s){var d=l[u];(c=n?n(d,u,l):i)===i&&(c=Qa(d)?d:go(t[o+1])?[]:{})}Jr(l,u,c),l=l[u]}return e}var Zn=Cr?function(e,t){return Cr.set(e,t),e}:rl,Jn=et?function(e,t){return et(e,"toString",{configurable:!0,enumerable:!1,value:Qs(t),writable:!0})}:rl;function Qn(e){return Do(Ls(e))}function ei(e,t,r){var i=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var a=n(o);++i<o;)a[i]=e[i+t];return a}function ti(e,t){var r;return cn(e,(function(e,n,i){return!(r=t(e,n,i))})),!!r}function ri(e,t,r){var n=0,i=null==e?n:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;n<i;){var o=n+i>>>1,a=e[o];null!==a&&!ss(a)&&(r?a<=t:a<t)?n=o+1:i=o}return i}return ni(e,t,rl,r)}function ni(e,t,r,n){var o=0,a=null==e?0:e.length;if(0===a)return 0;for(var s=(t=r(t))!=t,l=null===t,u=ss(t),c=t===i;o<a;){var d=pt((o+a)/2),f=r(e[d]),p=f!==i,h=null===f,m=f==f,g=ss(f);if(s)var y=n||m;else y=c?m&&(n||p):l?m&&p&&(n||!h):u?m&&p&&!h&&(n||!g):!h&&!g&&(n?f<=t:f<t);y?o=d+1:a=d}return gr(a,4294967294)}function ii(e,t){for(var r=-1,n=e.length,i=0,o=[];++r<n;){var a=e[r],s=t?t(a):a;if(!r||!La(s,l)){var l=s;o[i++]=0===a?0:a}}return o}function oi(e){return"number"==typeof e?e:ss(e)?f:+e}function ai(e){if("string"==typeof e)return e;if(Ua(e))return Tt(e,ai)+"";if(ss(e))return Ir?Ir.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function si(e,t,r){var n=-1,i=Ot,o=e.length,a=!0,s=[],l=s;if(r)a=!1,i=Ft;else if(o>=200){var u=t?null:Gi(e);if(u)return sr(u);a=!1,i=Zt,l=new Wr}else l=t?[]:s;e:for(;++n<o;){var c=e[n],d=t?t(c):c;if(c=r||0!==c?c:0,a&&d==d){for(var f=l.length;f--;)if(l[f]===d)continue e;t&&l.push(d),s.push(c)}else i(l,d,r)||(l!==s&&l.push(d),s.push(c))}return s}function li(e,t){return null==(e=So(e,t=gi(t,e)))||delete e[Io(Ko(t))]}function ui(e,t,r,n){return Xn(e,t,r(wn(e,t)),n)}function ci(e,t,r,n){for(var i=e.length,o=n?i:-1;(n?o--:++o<i)&&t(e[o],o,e););return r?ei(e,n?0:o,n?o+1:i):ei(e,n?o+1:0,n?i:o)}function di(e,t){var r=e;return r instanceof zr&&(r=r.value()),Et(t,(function(e,t){return t.func.apply(t.thisArg,Dt([e],t.args))}),r)}function fi(e,t,r){var i=e.length;if(i<2)return i?si(e[0]):[];for(var o=-1,a=n(i);++o<i;)for(var s=e[o],l=-1;++l<i;)l!=o&&(a[o]=un(a[o]||s,e[l],t,r));return si(mn(a,1),t,r)}function pi(e,t,r){for(var n=-1,o=e.length,a=t.length,s={};++n<o;){var l=n<a?t[n]:i;r(s,e[n],l)}return s}function hi(e){return Ga(e)?e:[]}function mi(e){return"function"==typeof e?e:rl}function gi(e,t){return Ua(e)?e:vo(e,t)?[e]:Ro(ys(e))}var yi=Yn;function vi(e,t,r){var n=e.length;return r=r===i?n:r,!t&&r>=n?e:ei(e,t,r)}var bi=at||function(e){return dt.clearTimeout(e)};function _i(e,t){if(t)return e.slice();var r=e.length,n=Ue?Ue(r):new e.constructor(r);return e.copy(n),n}function wi(e){var t=new e.constructor(e.byteLength);return new Be(t).set(new Be(e)),t}function xi(e,t){var r=t?wi(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Ai(e,t){if(e!==t){var r=e!==i,n=null===e,o=e==e,a=ss(e),s=t!==i,l=null===t,u=t==t,c=ss(t);if(!l&&!c&&!a&&e>t||a&&s&&u&&!l&&!c||n&&s&&u||!r&&u||!o)return 1;if(!n&&!a&&!c&&e<t||c&&r&&o&&!n&&!a||l&&r&&o||!s&&o||!u)return-1}return 0}function ji(e,t,r,i){for(var o=-1,a=e.length,s=r.length,l=-1,u=t.length,c=mr(a-s,0),d=n(u+c),f=!i;++l<u;)d[l]=t[l];for(;++o<s;)(f||o<a)&&(d[r[o]]=e[o]);for(;c--;)d[l++]=e[o++];return d}function Si(e,t,r,i){for(var o=-1,a=e.length,s=-1,l=r.length,u=-1,c=t.length,d=mr(a-l,0),f=n(d+c),p=!i;++o<d;)f[o]=e[o];for(var h=o;++u<c;)f[h+u]=t[u];for(;++s<l;)(p||o<a)&&(f[h+r[s]]=e[o++]);return f}function ki(e,t){var r=-1,i=e.length;for(t||(t=n(i));++r<i;)t[r]=e[r];return t}function Ci(e,t,r,n){var o=!r;r||(r={});for(var a=-1,s=t.length;++a<s;){var l=t[a],u=n?n(r[l],e[l],l,r,e):i;u===i&&(u=e[l]),o?rn(r,l,u):Jr(r,l,u)}return r}function $i(e,t){return function(r,n){var i=Ua(r)?jt:en,o=t?t():{};return i(r,e,oo(n,2),o)}}function Oi(e){return Yn((function(t,r){var n=-1,o=r.length,a=o>1?r[o-1]:i,s=o>2?r[2]:i;for(a=e.length>3&&"function"==typeof a?(o--,a):i,s&&yo(r[0],r[1],s)&&(a=o<3?i:a,o=1),t=je(t);++n<o;){var l=r[n];l&&e(t,l,n,a)}return t}))}function Fi(e,t){return function(r,n){if(null==r)return r;if(!Wa(r))return e(r,n);for(var i=r.length,o=t?i:-1,a=je(r);(t?o--:++o<i)&&!1!==n(a[o],o,a););return r}}function Ti(e){return function(t,r,n){for(var i=-1,o=je(t),a=n(t),s=a.length;s--;){var l=a[e?s:++i];if(!1===r(o[l],l,o))break}return t}}function Di(e){return function(t){var r=nr(t=ys(t))?cr(t):i,n=r?r[0]:t.charAt(0),o=r?vi(r,1).join(""):t.slice(1);return n[e]()+o}}function Ei(e){return function(t){return Et(Xs(Bs(t).replace(Xe,"")),e,"")}}function Pi(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=qr(e.prototype),n=e.apply(r,t);return Qa(n)?n:r}}function Ri(e){return function(t,r,n){var o=je(t);if(!Wa(t)){var a=oo(r,3);t=Fs(t),r=function(e){return a(o[e],e,o)}}var s=e(t,r,n);return s>-1?o[a?t[s]:s]:i}}function Ii(e){return Qi((function(t){var r=t.length,n=r,a=Nr.prototype.thru;for(e&&t.reverse();n--;){var s=t[n];if("function"!=typeof s)throw new Ce(o);if(a&&!l&&"wrapper"==no(s))var l=new Nr([],!0)}for(n=l?n:r;++n<r;){var u=no(s=t[n]),c="wrapper"==u?ro(s):i;l=c&&bo(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?l[no(c[0])].apply(l,c[3]):1==s.length&&bo(s)?l[u]():l.thru(s)}return function(){var e=arguments,n=e[0];if(l&&1==e.length&&Ua(n))return l.plant(n).value();for(var i=0,o=r?t[i].apply(this,e):n;++i<r;)o=t[i].call(this,o);return o}}))}function Mi(e,t,r,o,a,s,l,c,d,f){var p=t&u,h=1&t,m=2&t,g=24&t,y=512&t,v=m?i:Pi(e);return function u(){for(var b=arguments.length,_=n(b),w=b;w--;)_[w]=arguments[w];if(g)var x=io(u),A=function(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}(_,x);if(o&&(_=ji(_,o,a,g)),s&&(_=Si(_,s,l,g)),b-=A,g&&b<f){var j=ar(_,x);return Vi(e,t,Mi,u.placeholder,r,_,j,c,d,f-b)}var S=h?r:this,k=m?S[e]:e;return b=_.length,c?_=function(e,t){for(var r=e.length,n=gr(t.length,r),o=ki(e);n--;){var a=t[n];e[n]=go(a,r)?o[a]:i}return e}(_,c):y&&b>1&&_.reverse(),p&&d<b&&(_.length=d),this&&this!==dt&&this instanceof u&&(k=v||Pi(k)),k.apply(S,_)}}function qi(e,t){return function(r,n){return function(e,t,r,n){return vn(e,(function(e,i,o){t(n,r(e),i,o)})),n}(r,e,t(n),{})}}function Li(e,t){return function(r,n){var o;if(r===i&&n===i)return t;if(r!==i&&(o=r),n!==i){if(o===i)return n;"string"==typeof r||"string"==typeof n?(r=ai(r),n=ai(n)):(r=oi(r),n=oi(n)),o=e(r,n)}return o}}function Ni(e){return Qi((function(t){return t=Tt(t,Kt(oo())),Yn((function(r){var n=this;return e(t,(function(e){return At(e,n,r)}))}))}))}function zi(e,t){var r=(t=t===i?" ":ai(t)).length;if(r<2)return r?Gn(t,e):t;var n=Gn(t,ft(e/ur(t)));return nr(t)?vi(cr(n),0,e).join(""):n.slice(0,e)}function Bi(e){return function(t,r,o){return o&&"number"!=typeof o&&yo(t,r,o)&&(r=o=i),t=fs(t),r===i?(r=t,t=0):r=fs(r),function(e,t,r,i){for(var o=-1,a=mr(ft((t-e)/(r||1)),0),s=n(a);a--;)s[i?a:++o]=e,e+=r;return s}(t,r,o=o===i?t<r?1:-1:fs(o),e)}}function Ui(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=ms(t),r=ms(r)),e(t,r)}}function Vi(e,t,r,n,o,a,s,u,c,d){var f=8&t;t|=f?l:64,4&(t&=~(f?64:l))||(t&=-4);var p=[e,t,o,f?a:i,f?s:i,f?i:a,f?i:s,u,c,d],h=r.apply(i,p);return bo(e)&&Co(h,p),h.placeholder=n,Fo(h,e,t)}function Wi(e){var t=Ae[e];return function(e,r){if(e=ms(e),(r=null==r?0:gr(ps(r),292))&&It(e)){var n=(ys(e)+"e").split("e");return+((n=(ys(t(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return t(e)}}var Gi=jr&&1/sr(new jr([,-0]))[1]==c?function(e){return new jr(e)}:sl;function Yi(e){return function(t){var r=fo(t);return r==x?ir(t):r==C?lr(t):function(e,t){return Tt(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Hi(e,t,r,a,c,d,f,p){var h=2&t;if(!h&&"function"!=typeof e)throw new Ce(o);var m=a?a.length:0;if(m||(t&=-97,a=c=i),f=f===i?f:mr(ps(f),0),p=p===i?p:ps(p),m-=c?c.length:0,64&t){var g=a,y=c;a=c=i}var v=h?i:ro(e),b=[e,t,r,a,c,g,y,d,f,p];if(v&&function(e,t){var r=e[1],n=t[1],i=r|n,o=i<131,a=n==u&&8==r||n==u&&256==r&&e[7].length<=t[8]||384==n&&t[7].length<=t[8]&&8==r;if(!o&&!a)return e;1&n&&(e[2]=t[2],i|=1&r?0:4);var l=t[3];if(l){var c=e[3];e[3]=c?ji(c,l,t[4]):l,e[4]=c?ar(e[3],s):t[4]}(l=t[5])&&(c=e[5],e[5]=c?Si(c,l,t[6]):l,e[6]=c?ar(e[5],s):t[6]),(l=t[7])&&(e[7]=l),n&u&&(e[8]=null==e[8]?t[8]:gr(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(b,v),e=b[0],t=b[1],r=b[2],a=b[3],c=b[4],!(p=b[9]=b[9]===i?h?0:e.length:mr(b[9]-m,0))&&24&t&&(t&=-25),t&&1!=t)_=8==t||16==t?function(e,t,r){var o=Pi(e);return function a(){for(var s=arguments.length,l=n(s),u=s,c=io(a);u--;)l[u]=arguments[u];var d=s<3&&l[0]!==c&&l[s-1]!==c?[]:ar(l,c);return(s-=d.length)<r?Vi(e,t,Mi,a.placeholder,i,l,d,i,i,r-s):At(this&&this!==dt&&this instanceof a?o:e,this,l)}}(e,t,p):t!=l&&33!=t||c.length?Mi.apply(i,b):function(e,t,r,i){var o=1&t,a=Pi(e);return function t(){for(var s=-1,l=arguments.length,u=-1,c=i.length,d=n(c+l),f=this&&this!==dt&&this instanceof t?a:e;++u<c;)d[u]=i[u];for(;l--;)d[u++]=arguments[++s];return At(f,o?r:this,d)}}(e,t,r,a);else var _=function(e,t,r){var n=1&t,i=Pi(e);return function t(){return(this&&this!==dt&&this instanceof t?i:e).apply(n?r:this,arguments)}}(e,t,r);return Fo((v?Zn:Co)(_,b),e,t)}function Ki(e,t,r,n){return e===i||La(e,Fe[r])&&!Ee.call(n,r)?t:e}function Xi(e,t,r,n,o,a){return Qa(e)&&Qa(t)&&(a.set(t,e),Ln(e,t,i,Xi,a),a.delete(t)),e}function Zi(e){return ns(e)?i:e}function Ji(e,t,r,n,o,a){var s=1&r,l=e.length,u=t.length;if(l!=u&&!(s&&u>l))return!1;var c=a.get(e),d=a.get(t);if(c&&d)return c==t&&d==e;var f=-1,p=!0,h=2&r?new Wr:i;for(a.set(e,t),a.set(t,e);++f<l;){var m=e[f],g=t[f];if(n)var y=s?n(g,m,f,t,e,a):n(m,g,f,e,t,a);if(y!==i){if(y)continue;p=!1;break}if(h){if(!Rt(t,(function(e,t){if(!Zt(h,t)&&(m===e||o(m,e,r,n,a)))return h.push(t)}))){p=!1;break}}else if(m!==g&&!o(m,g,r,n,a)){p=!1;break}}return a.delete(e),a.delete(t),p}function Qi(e){return Oo(jo(e,i,Vo),e+"")}function eo(e){return xn(e,Fs,uo)}function to(e){return xn(e,Ts,co)}var ro=Cr?function(e){return Cr.get(e)}:sl;function no(e){for(var t=e.name+"",r=$r[t],n=Ee.call($r,t)?r.length:0;n--;){var i=r[n],o=i.func;if(null==o||o==e)return i.name}return t}function io(e){return(Ee.call(Mr,"placeholder")?Mr:e).placeholder}function oo(){var e=Mr.iteratee||nl;return e=e===nl?En:e,arguments.length?e(arguments[0],arguments[1]):e}function ao(e,t){var r,n,i=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof t?"string":"hash"]:i.map}function so(e){for(var t=Fs(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,xo(i)]}return t}function lo(e,t){var r=function(e,t){return null==e?i:e[t]}(e,t);return Dn(r)?r:i}var uo=mt?function(e){return null==e?[]:(e=je(e),$t(mt(e),(function(t){return Ge.call(e,t)})))}:hl,co=mt?function(e){for(var t=[];e;)Dt(t,uo(e)),e=Ve(e);return t}:hl,fo=An;function po(e,t,r){for(var n=-1,i=(t=gi(t,e)).length,o=!1;++n<i;){var a=Io(t[n]);if(!(o=null!=e&&r(e,a)))break;e=e[a]}return o||++n!=i?o:!!(i=null==e?0:e.length)&&Ja(i)&&go(a,i)&&(Ua(e)||Ba(e))}function ho(e){return"function"!=typeof e.constructor||wo(e)?{}:qr(Ve(e))}function mo(e){return Ua(e)||Ba(e)||!!(He&&e&&e[He])}function go(e,t){var r=typeof e;return!!(t=null==t?d:t)&&("number"==r||"symbol"!=r&&ye.test(e))&&e>-1&&e%1==0&&e<t}function yo(e,t,r){if(!Qa(r))return!1;var n=typeof t;return!!("number"==n?Wa(r)&&go(t,r.length):"string"==n&&t in r)&&La(r[t],e)}function vo(e,t){if(Ua(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!ss(e))||Q.test(e)||!J.test(e)||null!=t&&e in je(t)}function bo(e){var t=no(e),r=Mr[t];if("function"!=typeof r||!(t in zr.prototype))return!1;if(e===r)return!0;var n=ro(r);return!!n&&e===n[0]}(wr&&fo(new wr(new ArrayBuffer(1)))!=D||xr&&fo(new xr)!=x||Ar&&fo(Ar.resolve())!=S||jr&&fo(new jr)!=C||Sr&&fo(new Sr)!=F)&&(fo=function(e){var t=An(e),r=t==j?e.constructor:i,n=r?Mo(r):"";if(n)switch(n){case Or:return D;case Fr:return x;case Tr:return S;case Dr:return C;case Er:return F}return t});var _o=Te?Xa:ml;function wo(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Fe)}function xo(e){return e==e&&!Qa(e)}function Ao(e,t){return function(r){return null!=r&&r[e]===t&&(t!==i||e in je(r))}}function jo(e,t,r){return t=mr(t===i?e.length-1:t,0),function(){for(var i=arguments,o=-1,a=mr(i.length-t,0),s=n(a);++o<a;)s[o]=i[t+o];o=-1;for(var l=n(t+1);++o<t;)l[o]=i[o];return l[t]=r(s),At(e,this,l)}}function So(e,t){return t.length<2?e:wn(e,ei(t,0,-1))}function ko(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Co=To(Zn),$o=ct||function(e,t){return dt.setTimeout(e,t)},Oo=To(Jn);function Fo(e,t,r){var n=t+"";return Oo(e,function(e,t){var r=t.length;if(!r)return e;var n=r-1;return t[n]=(r>1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(oe,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return St(h,(function(r){var n="_."+r[0];t&r[1]&&!Ot(e,n)&&e.push(n)})),e.sort()}(function(e){var t=e.match(ae);return t?t[1].split(se):[]}(n),r)))}function To(e){var t=0,r=0;return function(){var n=yr(),o=16-(n-r);if(r=n,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Do(e,t){var r=-1,n=e.length,o=n-1;for(t=t===i?n:t;++r<t;){var a=Wn(r,o),s=e[a];e[a]=e[r],e[r]=s}return e.length=t,e}var Eo,Po,Ro=(Eo=Ea((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ee,(function(e,r,n,i){t.push(n?i.replace(ce,"$1"):r||e)})),t}),(function(e){return 500===Po.size&&Po.clear(),e})),Po=Eo.cache,Eo);function Io(e){if("string"==typeof e||ss(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Mo(e){if(null!=e){try{return De.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function qo(e){if(e instanceof zr)return e.clone();var t=new Nr(e.__wrapped__,e.__chain__);return t.__actions__=ki(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Lo=Yn((function(e,t){return Ga(e)?un(e,mn(t,1,Ga,!0)):[]})),No=Yn((function(e,t){var r=Ko(t);return Ga(r)&&(r=i),Ga(e)?un(e,mn(t,1,Ga,!0),oo(r,2)):[]})),zo=Yn((function(e,t){var r=Ko(t);return Ga(r)&&(r=i),Ga(e)?un(e,mn(t,1,Ga,!0),i,r):[]}));function Bo(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:ps(r);return i<0&&(i=mr(n+i,0)),qt(e,oo(t,3),i)}function Uo(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var o=n-1;return r!==i&&(o=ps(r),o=r<0?mr(n+o,0):gr(o,n-1)),qt(e,oo(t,3),o,!0)}function Vo(e){return null!=e&&e.length?mn(e,1):[]}function Wo(e){return e&&e.length?e[0]:i}var Go=Yn((function(e){var t=Tt(e,hi);return t.length&&t[0]===e[0]?Cn(t):[]})),Yo=Yn((function(e){var t=Ko(e),r=Tt(e,hi);return t===Ko(r)?t=i:r.pop(),r.length&&r[0]===e[0]?Cn(r,oo(t,2)):[]})),Ho=Yn((function(e){var t=Ko(e),r=Tt(e,hi);return(t="function"==typeof t?t:i)&&r.pop(),r.length&&r[0]===e[0]?Cn(r,i,t):[]}));function Ko(e){var t=null==e?0:e.length;return t?e[t-1]:i}var Xo=Yn(Zo);function Zo(e,t){return e&&e.length&&t&&t.length?Un(e,t):e}var Jo=Qi((function(e,t){var r=null==e?0:e.length,n=nn(e,t);return Vn(e,Tt(t,(function(e){return go(e,r)?+e:e})).sort(Ai)),n}));function Qo(e){return null==e?e:_r.call(e)}var ea=Yn((function(e){return si(mn(e,1,Ga,!0))})),ta=Yn((function(e){var t=Ko(e);return Ga(t)&&(t=i),si(mn(e,1,Ga,!0),oo(t,2))})),ra=Yn((function(e){var t=Ko(e);return t="function"==typeof t?t:i,si(mn(e,1,Ga,!0),i,t)}));function na(e){if(!e||!e.length)return[];var t=0;return e=$t(e,(function(e){if(Ga(e))return t=mr(e.length,t),!0})),Yt(t,(function(t){return Tt(e,Ut(t))}))}function ia(e,t){if(!e||!e.length)return[];var r=na(e);return null==t?r:Tt(r,(function(e){return At(t,i,e)}))}var oa=Yn((function(e,t){return Ga(e)?un(e,t):[]})),aa=Yn((function(e){return fi($t(e,Ga))})),sa=Yn((function(e){var t=Ko(e);return Ga(t)&&(t=i),fi($t(e,Ga),oo(t,2))})),la=Yn((function(e){var t=Ko(e);return t="function"==typeof t?t:i,fi($t(e,Ga),i,t)})),ua=Yn(na),ca=Yn((function(e){var t=e.length,r=t>1?e[t-1]:i;return r="function"==typeof r?(e.pop(),r):i,ia(e,r)}));function da(e){var t=Mr(e);return t.__chain__=!0,t}function fa(e,t){return t(e)}var pa=Qi((function(e){var t=e.length,r=t?e[0]:0,n=this.__wrapped__,o=function(t){return nn(t,e)};return!(t>1||this.__actions__.length)&&n instanceof zr&&go(r)?((n=n.slice(r,+r+(t?1:0))).__actions__.push({func:fa,args:[o],thisArg:i}),new Nr(n,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(o)})),ha=$i((function(e,t,r){Ee.call(e,r)?++e[r]:rn(e,r,1)})),ma=Ri(Bo),ga=Ri(Uo);function ya(e,t){return(Ua(e)?St:cn)(e,oo(t,3))}function va(e,t){return(Ua(e)?kt:dn)(e,oo(t,3))}var ba=$i((function(e,t,r){Ee.call(e,r)?e[r].push(t):rn(e,r,[t])})),_a=Yn((function(e,t,r){var i=-1,o="function"==typeof t,a=Wa(e)?n(e.length):[];return cn(e,(function(e){a[++i]=o?At(t,e,r):$n(e,t,r)})),a})),wa=$i((function(e,t,r){rn(e,r,t)}));function xa(e,t){return(Ua(e)?Tt:In)(e,oo(t,3))}var Aa=$i((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]})),ja=Yn((function(e,t){if(null==e)return[];var r=t.length;return r>1&&yo(e,t[0],t[1])?t=[]:r>2&&yo(t[0],t[1],t[2])&&(t=[t[0]]),zn(e,mn(t,1),[])})),Sa=ut||function(){return dt.Date.now()};function ka(e,t,r){return t=r?i:t,t=e&&null==t?e.length:t,Hi(e,u,i,i,i,i,t)}function Ca(e,t){var r;if("function"!=typeof t)throw new Ce(o);return e=ps(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=i),r}}var $a=Yn((function(e,t,r){var n=1;if(r.length){var i=ar(r,io($a));n|=l}return Hi(e,n,t,r,i)})),Oa=Yn((function(e,t,r){var n=3;if(r.length){var i=ar(r,io(Oa));n|=l}return Hi(t,n,e,r,i)}));function Fa(e,t,r){var n,a,s,l,u,c,d=0,f=!1,p=!1,h=!0;if("function"!=typeof e)throw new Ce(o);function m(t){var r=n,o=a;return n=a=i,d=t,l=e.apply(o,r)}function g(e){var r=e-c;return c===i||r>=t||r<0||p&&e-d>=s}function y(){var e=Sa();if(g(e))return v(e);u=$o(y,function(e){var r=t-(e-c);return p?gr(r,s-(e-d)):r}(e))}function v(e){return u=i,h&&n?m(e):(n=a=i,l)}function b(){var e=Sa(),r=g(e);if(n=arguments,a=this,c=e,r){if(u===i)return function(e){return d=e,u=$o(y,t),f?m(e):l}(c);if(p)return bi(u),u=$o(y,t),m(c)}return u===i&&(u=$o(y,t)),l}return t=ms(t)||0,Qa(r)&&(f=!!r.leading,s=(p="maxWait"in r)?mr(ms(r.maxWait)||0,t):s,h="trailing"in r?!!r.trailing:h),b.cancel=function(){u!==i&&bi(u),d=0,n=c=a=u=i},b.flush=function(){return u===i?l:v(Sa())},b}var Ta=Yn((function(e,t){return ln(e,1,t)})),Da=Yn((function(e,t,r){return ln(e,ms(t)||0,r)}));function Ea(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ce(o);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(Ea.Cache||Vr),r}function Pa(e){if("function"!=typeof e)throw new Ce(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Ea.Cache=Vr;var Ra=yi((function(e,t){var r=(t=1==t.length&&Ua(t[0])?Tt(t[0],Kt(oo())):Tt(mn(t,1),Kt(oo()))).length;return Yn((function(n){for(var i=-1,o=gr(n.length,r);++i<o;)n[i]=t[i].call(this,n[i]);return At(e,this,n)}))})),Ia=Yn((function(e,t){var r=ar(t,io(Ia));return Hi(e,l,i,t,r)})),Ma=Yn((function(e,t){var r=ar(t,io(Ma));return Hi(e,64,i,t,r)})),qa=Qi((function(e,t){return Hi(e,256,i,i,i,t)}));function La(e,t){return e===t||e!=e&&t!=t}var Na=Ui(jn),za=Ui((function(e,t){return e>=t})),Ba=On(function(){return arguments}())?On:function(e){return es(e)&&Ee.call(e,"callee")&&!Ge.call(e,"callee")},Ua=n.isArray,Va=yt?Kt(yt):function(e){return es(e)&&An(e)==T};function Wa(e){return null!=e&&Ja(e.length)&&!Xa(e)}function Ga(e){return es(e)&&Wa(e)}var Ya=gt||ml,Ha=vt?Kt(vt):function(e){return es(e)&&An(e)==v};function Ka(e){if(!es(e))return!1;var t=An(e);return t==b||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ns(e)}function Xa(e){if(!Qa(e))return!1;var t=An(e);return t==_||t==w||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Za(e){return"number"==typeof e&&e==ps(e)}function Ja(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=d}function Qa(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function es(e){return null!=e&&"object"==typeof e}var ts=bt?Kt(bt):function(e){return es(e)&&fo(e)==x};function rs(e){return"number"==typeof e||es(e)&&An(e)==A}function ns(e){if(!es(e)||An(e)!=j)return!1;var t=Ve(e);if(null===t)return!0;var r=Ee.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&De.call(r)==Me}var is=_t?Kt(_t):function(e){return es(e)&&An(e)==k},os=wt?Kt(wt):function(e){return es(e)&&fo(e)==C};function as(e){return"string"==typeof e||!Ua(e)&&es(e)&&An(e)==$}function ss(e){return"symbol"==typeof e||es(e)&&An(e)==O}var ls=xt?Kt(xt):function(e){return es(e)&&Ja(e.length)&&!!it[An(e)]},us=Ui(Rn),cs=Ui((function(e,t){return e<=t}));function ds(e){if(!e)return[];if(Wa(e))return as(e)?cr(e):ki(e);if(Ke&&e[Ke])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[Ke]());var t=fo(e);return(t==x?ir:t==C?sr:Ls)(e)}function fs(e){return e?(e=ms(e))===c||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ps(e){var t=fs(e),r=t%1;return t==t?r?t-r:t:0}function hs(e){return e?on(ps(e),0,p):0}function ms(e){if("number"==typeof e)return e;if(ss(e))return f;if(Qa(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Qa(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Ht(e);var r=he.test(e);return r||ge.test(e)?lt(e.slice(2),r?2:8):pe.test(e)?f:+e}function gs(e){return Ci(e,Ts(e))}function ys(e){return null==e?"":ai(e)}var vs=Oi((function(e,t){if(wo(t)||Wa(t))Ci(t,Fs(t),e);else for(var r in t)Ee.call(t,r)&&Jr(e,r,t[r])})),bs=Oi((function(e,t){Ci(t,Ts(t),e)})),_s=Oi((function(e,t,r,n){Ci(t,Ts(t),e,n)})),ws=Oi((function(e,t,r,n){Ci(t,Fs(t),e,n)})),xs=Qi(nn),As=Yn((function(e,t){e=je(e);var r=-1,n=t.length,o=n>2?t[2]:i;for(o&&yo(t[0],t[1],o)&&(n=1);++r<n;)for(var a=t[r],s=Ts(a),l=-1,u=s.length;++l<u;){var c=s[l],d=e[c];(d===i||La(d,Fe[c])&&!Ee.call(e,c))&&(e[c]=a[c])}return e})),js=Yn((function(e){return e.push(i,Xi),At(Es,i,e)}));function Ss(e,t,r){var n=null==e?i:wn(e,t);return n===i?r:n}function ks(e,t){return null!=e&&po(e,t,kn)}var Cs=qi((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=Ie.call(t)),e[t]=r}),Qs(rl)),$s=qi((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=Ie.call(t)),Ee.call(e,t)?e[t].push(r):e[t]=[r]}),oo),Os=Yn($n);function Fs(e){return Wa(e)?Yr(e):Pn(e)}function Ts(e){return Wa(e)?Yr(e,!0):function(e){if(!Qa(e))return function(e){var t=[];if(null!=e)for(var r in je(e))t.push(r);return t}(e);var t=wo(e),r=[];for(var n in e)("constructor"!=n||!t&&Ee.call(e,n))&&r.push(n);return r}(e)}var Ds=Oi((function(e,t,r){Ln(e,t,r)})),Es=Oi((function(e,t,r,n){Ln(e,t,r,n)})),Ps=Qi((function(e,t){var r={};if(null==e)return r;var n=!1;t=Tt(t,(function(t){return t=gi(t,e),n||(n=t.length>1),t})),Ci(e,to(e),r),n&&(r=an(r,7,Zi));for(var i=t.length;i--;)li(r,t[i]);return r})),Rs=Qi((function(e,t){return null==e?{}:function(e,t){return Bn(e,t,(function(t,r){return ks(e,r)}))}(e,t)}));function Is(e,t){if(null==e)return{};var r=Tt(to(e),(function(e){return[e]}));return t=oo(t),Bn(e,r,(function(e,r){return t(e,r[0])}))}var Ms=Yi(Fs),qs=Yi(Ts);function Ls(e){return null==e?[]:Xt(e,Fs(e))}var Ns=Ei((function(e,t,r){return t=t.toLowerCase(),e+(r?zs(t):t)}));function zs(e){return Ks(ys(e).toLowerCase())}function Bs(e){return(e=ys(e))&&e.replace(ve,er).replace(Ze,"")}var Us=Ei((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),Vs=Ei((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),Ws=Di("toLowerCase"),Gs=Ei((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()})),Ys=Ei((function(e,t,r){return e+(r?" ":"")+Ks(t)})),Hs=Ei((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),Ks=Di("toUpperCase");function Xs(e,t,r){return e=ys(e),(t=r?i:t)===i?function(e){return tt.test(e)}(e)?function(e){return e.match(Qe)||[]}(e):function(e){return e.match(le)||[]}(e):e.match(t)||[]}var Zs=Yn((function(e,t){try{return At(e,i,t)}catch(e){return Ka(e)?e:new we(e)}})),Js=Qi((function(e,t){return St(t,(function(t){t=Io(t),rn(e,t,$a(e[t],e))})),e}));function Qs(e){return function(){return e}}var el=Ii(),tl=Ii(!0);function rl(e){return e}function nl(e){return En("function"==typeof e?e:an(e,1))}var il=Yn((function(e,t){return function(r){return $n(r,e,t)}})),ol=Yn((function(e,t){return function(r){return $n(e,r,t)}}));function al(e,t,r){var n=Fs(t),i=_n(t,n);null!=r||Qa(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=_n(t,Fs(t)));var o=!(Qa(r)&&"chain"in r&&!r.chain),a=Xa(e);return St(i,(function(r){var n=t[r];e[r]=n,a&&(e.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=e(this.__wrapped__);return(r.__actions__=ki(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,Dt([this.value()],arguments))})})),e}function sl(){}var ll=Ni(Tt),ul=Ni(Ct),cl=Ni(Rt);function dl(e){return vo(e)?Ut(Io(e)):function(e){return function(t){return wn(t,e)}}(e)}var fl=Bi(),pl=Bi(!0);function hl(){return[]}function ml(){return!1}var gl,yl=Li((function(e,t){return e+t}),0),vl=Wi("ceil"),bl=Li((function(e,t){return e/t}),1),_l=Wi("floor"),wl=Li((function(e,t){return e*t}),1),xl=Wi("round"),Al=Li((function(e,t){return e-t}),0);return Mr.after=function(e,t){if("function"!=typeof t)throw new Ce(o);return e=ps(e),function(){if(--e<1)return t.apply(this,arguments)}},Mr.ary=ka,Mr.assign=vs,Mr.assignIn=bs,Mr.assignInWith=_s,Mr.assignWith=ws,Mr.at=xs,Mr.before=Ca,Mr.bind=$a,Mr.bindAll=Js,Mr.bindKey=Oa,Mr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ua(e)?e:[e]},Mr.chain=da,Mr.chunk=function(e,t,r){t=(r?yo(e,t,r):t===i)?1:mr(ps(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var a=0,s=0,l=n(ft(o/t));a<o;)l[s++]=ei(e,a,a+=t);return l},Mr.compact=function(e){for(var t=-1,r=null==e?0:e.length,n=0,i=[];++t<r;){var o=e[t];o&&(i[n++]=o)}return i},Mr.concat=function(){var e=arguments.length;if(!e)return[];for(var t=n(e-1),r=arguments[0],i=e;i--;)t[i-1]=arguments[i];return Dt(Ua(r)?ki(r):[r],mn(t,1))},Mr.cond=function(e){var t=null==e?0:e.length,r=oo();return e=t?Tt(e,(function(e){if("function"!=typeof e[1])throw new Ce(o);return[r(e[0]),e[1]]})):[],Yn((function(r){for(var n=-1;++n<t;){var i=e[n];if(At(i[0],this,r))return At(i[1],this,r)}}))},Mr.conforms=function(e){return function(e){var t=Fs(e);return function(r){return sn(r,e,t)}}(an(e,1))},Mr.constant=Qs,Mr.countBy=ha,Mr.create=function(e,t){var r=qr(e);return null==t?r:tn(r,t)},Mr.curry=function e(t,r,n){var o=Hi(t,8,i,i,i,i,i,r=n?i:r);return o.placeholder=e.placeholder,o},Mr.curryRight=function e(t,r,n){var o=Hi(t,16,i,i,i,i,i,r=n?i:r);return o.placeholder=e.placeholder,o},Mr.debounce=Fa,Mr.defaults=As,Mr.defaultsDeep=js,Mr.defer=Ta,Mr.delay=Da,Mr.difference=Lo,Mr.differenceBy=No,Mr.differenceWith=zo,Mr.drop=function(e,t,r){var n=null==e?0:e.length;return n?ei(e,(t=r||t===i?1:ps(t))<0?0:t,n):[]},Mr.dropRight=function(e,t,r){var n=null==e?0:e.length;return n?ei(e,0,(t=n-(t=r||t===i?1:ps(t)))<0?0:t):[]},Mr.dropRightWhile=function(e,t){return e&&e.length?ci(e,oo(t,3),!0,!0):[]},Mr.dropWhile=function(e,t){return e&&e.length?ci(e,oo(t,3),!0):[]},Mr.fill=function(e,t,r,n){var o=null==e?0:e.length;return o?(r&&"number"!=typeof r&&yo(e,t,r)&&(r=0,n=o),function(e,t,r,n){var o=e.length;for((r=ps(r))<0&&(r=-r>o?0:o+r),(n=n===i||n>o?o:ps(n))<0&&(n+=o),n=r>n?0:hs(n);r<n;)e[r++]=t;return e}(e,t,r,n)):[]},Mr.filter=function(e,t){return(Ua(e)?$t:hn)(e,oo(t,3))},Mr.flatMap=function(e,t){return mn(xa(e,t),1)},Mr.flatMapDeep=function(e,t){return mn(xa(e,t),c)},Mr.flatMapDepth=function(e,t,r){return r=r===i?1:ps(r),mn(xa(e,t),r)},Mr.flatten=Vo,Mr.flattenDeep=function(e){return null!=e&&e.length?mn(e,c):[]},Mr.flattenDepth=function(e,t){return null!=e&&e.length?mn(e,t=t===i?1:ps(t)):[]},Mr.flip=function(e){return Hi(e,512)},Mr.flow=el,Mr.flowRight=tl,Mr.fromPairs=function(e){for(var t=-1,r=null==e?0:e.length,n={};++t<r;){var i=e[t];n[i[0]]=i[1]}return n},Mr.functions=function(e){return null==e?[]:_n(e,Fs(e))},Mr.functionsIn=function(e){return null==e?[]:_n(e,Ts(e))},Mr.groupBy=ba,Mr.initial=function(e){return null!=e&&e.length?ei(e,0,-1):[]},Mr.intersection=Go,Mr.intersectionBy=Yo,Mr.intersectionWith=Ho,Mr.invert=Cs,Mr.invertBy=$s,Mr.invokeMap=_a,Mr.iteratee=nl,Mr.keyBy=wa,Mr.keys=Fs,Mr.keysIn=Ts,Mr.map=xa,Mr.mapKeys=function(e,t){var r={};return t=oo(t,3),vn(e,(function(e,n,i){rn(r,t(e,n,i),e)})),r},Mr.mapValues=function(e,t){var r={};return t=oo(t,3),vn(e,(function(e,n,i){rn(r,n,t(e,n,i))})),r},Mr.matches=function(e){return Mn(an(e,1))},Mr.matchesProperty=function(e,t){return qn(e,an(t,1))},Mr.memoize=Ea,Mr.merge=Ds,Mr.mergeWith=Es,Mr.method=il,Mr.methodOf=ol,Mr.mixin=al,Mr.negate=Pa,Mr.nthArg=function(e){return e=ps(e),Yn((function(t){return Nn(t,e)}))},Mr.omit=Ps,Mr.omitBy=function(e,t){return Is(e,Pa(oo(t)))},Mr.once=function(e){return Ca(2,e)},Mr.orderBy=function(e,t,r,n){return null==e?[]:(Ua(t)||(t=null==t?[]:[t]),Ua(r=n?i:r)||(r=null==r?[]:[r]),zn(e,t,r))},Mr.over=ll,Mr.overArgs=Ra,Mr.overEvery=ul,Mr.overSome=cl,Mr.partial=Ia,Mr.partialRight=Ma,Mr.partition=Aa,Mr.pick=Rs,Mr.pickBy=Is,Mr.property=dl,Mr.propertyOf=function(e){return function(t){return null==e?i:wn(e,t)}},Mr.pull=Xo,Mr.pullAll=Zo,Mr.pullAllBy=function(e,t,r){return e&&e.length&&t&&t.length?Un(e,t,oo(r,2)):e},Mr.pullAllWith=function(e,t,r){return e&&e.length&&t&&t.length?Un(e,t,i,r):e},Mr.pullAt=Jo,Mr.range=fl,Mr.rangeRight=pl,Mr.rearg=qa,Mr.reject=function(e,t){return(Ua(e)?$t:hn)(e,Pa(oo(t,3)))},Mr.remove=function(e,t){var r=[];if(!e||!e.length)return r;var n=-1,i=[],o=e.length;for(t=oo(t,3);++n<o;){var a=e[n];t(a,n,e)&&(r.push(a),i.push(n))}return Vn(e,i),r},Mr.rest=function(e,t){if("function"!=typeof e)throw new Ce(o);return Yn(e,t=t===i?t:ps(t))},Mr.reverse=Qo,Mr.sampleSize=function(e,t,r){return t=(r?yo(e,t,r):t===i)?1:ps(t),(Ua(e)?Kr:Kn)(e,t)},Mr.set=function(e,t,r){return null==e?e:Xn(e,t,r)},Mr.setWith=function(e,t,r,n){return n="function"==typeof n?n:i,null==e?e:Xn(e,t,r,n)},Mr.shuffle=function(e){return(Ua(e)?Xr:Qn)(e)},Mr.slice=function(e,t,r){var n=null==e?0:e.length;return n?(r&&"number"!=typeof r&&yo(e,t,r)?(t=0,r=n):(t=null==t?0:ps(t),r=r===i?n:ps(r)),ei(e,t,r)):[]},Mr.sortBy=ja,Mr.sortedUniq=function(e){return e&&e.length?ii(e):[]},Mr.sortedUniqBy=function(e,t){return e&&e.length?ii(e,oo(t,2)):[]},Mr.split=function(e,t,r){return r&&"number"!=typeof r&&yo(e,t,r)&&(t=r=i),(r=r===i?p:r>>>0)?(e=ys(e))&&("string"==typeof t||null!=t&&!is(t))&&!(t=ai(t))&&nr(e)?vi(cr(e),0,r):e.split(t,r):[]},Mr.spread=function(e,t){if("function"!=typeof e)throw new Ce(o);return t=null==t?0:mr(ps(t),0),Yn((function(r){var n=r[t],i=vi(r,0,t);return n&&Dt(i,n),At(e,this,i)}))},Mr.tail=function(e){var t=null==e?0:e.length;return t?ei(e,1,t):[]},Mr.take=function(e,t,r){return e&&e.length?ei(e,0,(t=r||t===i?1:ps(t))<0?0:t):[]},Mr.takeRight=function(e,t,r){var n=null==e?0:e.length;return n?ei(e,(t=n-(t=r||t===i?1:ps(t)))<0?0:t,n):[]},Mr.takeRightWhile=function(e,t){return e&&e.length?ci(e,oo(t,3),!1,!0):[]},Mr.takeWhile=function(e,t){return e&&e.length?ci(e,oo(t,3)):[]},Mr.tap=function(e,t){return t(e),e},Mr.throttle=function(e,t,r){var n=!0,i=!0;if("function"!=typeof e)throw new Ce(o);return Qa(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),Fa(e,t,{leading:n,maxWait:t,trailing:i})},Mr.thru=fa,Mr.toArray=ds,Mr.toPairs=Ms,Mr.toPairsIn=qs,Mr.toPath=function(e){return Ua(e)?Tt(e,Io):ss(e)?[e]:ki(Ro(ys(e)))},Mr.toPlainObject=gs,Mr.transform=function(e,t,r){var n=Ua(e),i=n||Ya(e)||ls(e);if(t=oo(t,4),null==r){var o=e&&e.constructor;r=i?n?new o:[]:Qa(e)&&Xa(o)?qr(Ve(e)):{}}return(i?St:vn)(e,(function(e,n,i){return t(r,e,n,i)})),r},Mr.unary=function(e){return ka(e,1)},Mr.union=ea,Mr.unionBy=ta,Mr.unionWith=ra,Mr.uniq=function(e){return e&&e.length?si(e):[]},Mr.uniqBy=function(e,t){return e&&e.length?si(e,oo(t,2)):[]},Mr.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?si(e,i,t):[]},Mr.unset=function(e,t){return null==e||li(e,t)},Mr.unzip=na,Mr.unzipWith=ia,Mr.update=function(e,t,r){return null==e?e:ui(e,t,mi(r))},Mr.updateWith=function(e,t,r,n){return n="function"==typeof n?n:i,null==e?e:ui(e,t,mi(r),n)},Mr.values=Ls,Mr.valuesIn=function(e){return null==e?[]:Xt(e,Ts(e))},Mr.without=oa,Mr.words=Xs,Mr.wrap=function(e,t){return Ia(mi(t),e)},Mr.xor=aa,Mr.xorBy=sa,Mr.xorWith=la,Mr.zip=ua,Mr.zipObject=function(e,t){return pi(e||[],t||[],Jr)},Mr.zipObjectDeep=function(e,t){return pi(e||[],t||[],Xn)},Mr.zipWith=ca,Mr.entries=Ms,Mr.entriesIn=qs,Mr.extend=bs,Mr.extendWith=_s,al(Mr,Mr),Mr.add=yl,Mr.attempt=Zs,Mr.camelCase=Ns,Mr.capitalize=zs,Mr.ceil=vl,Mr.clamp=function(e,t,r){return r===i&&(r=t,t=i),r!==i&&(r=(r=ms(r))==r?r:0),t!==i&&(t=(t=ms(t))==t?t:0),on(ms(e),t,r)},Mr.clone=function(e){return an(e,4)},Mr.cloneDeep=function(e){return an(e,5)},Mr.cloneDeepWith=function(e,t){return an(e,5,t="function"==typeof t?t:i)},Mr.cloneWith=function(e,t){return an(e,4,t="function"==typeof t?t:i)},Mr.conformsTo=function(e,t){return null==t||sn(e,t,Fs(t))},Mr.deburr=Bs,Mr.defaultTo=function(e,t){return null==e||e!=e?t:e},Mr.divide=bl,Mr.endsWith=function(e,t,r){e=ys(e),t=ai(t);var n=e.length,o=r=r===i?n:on(ps(r),0,n);return(r-=t.length)>=0&&e.slice(r,o)==t},Mr.eq=La,Mr.escape=function(e){return(e=ys(e))&&H.test(e)?e.replace(G,tr):e},Mr.escapeRegExp=function(e){return(e=ys(e))&&re.test(e)?e.replace(te,"\\$&"):e},Mr.every=function(e,t,r){var n=Ua(e)?Ct:fn;return r&&yo(e,t,r)&&(t=i),n(e,oo(t,3))},Mr.find=ma,Mr.findIndex=Bo,Mr.findKey=function(e,t){return Mt(e,oo(t,3),vn)},Mr.findLast=ga,Mr.findLastIndex=Uo,Mr.findLastKey=function(e,t){return Mt(e,oo(t,3),bn)},Mr.floor=_l,Mr.forEach=ya,Mr.forEachRight=va,Mr.forIn=function(e,t){return null==e?e:gn(e,oo(t,3),Ts)},Mr.forInRight=function(e,t){return null==e?e:yn(e,oo(t,3),Ts)},Mr.forOwn=function(e,t){return e&&vn(e,oo(t,3))},Mr.forOwnRight=function(e,t){return e&&bn(e,oo(t,3))},Mr.get=Ss,Mr.gt=Na,Mr.gte=za,Mr.has=function(e,t){return null!=e&&po(e,t,Sn)},Mr.hasIn=ks,Mr.head=Wo,Mr.identity=rl,Mr.includes=function(e,t,r,n){e=Wa(e)?e:Ls(e),r=r&&!n?ps(r):0;var i=e.length;return r<0&&(r=mr(i+r,0)),as(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&Lt(e,t,r)>-1},Mr.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:ps(r);return i<0&&(i=mr(n+i,0)),Lt(e,t,i)},Mr.inRange=function(e,t,r){return t=fs(t),r===i?(r=t,t=0):r=fs(r),function(e,t,r){return e>=gr(t,r)&&e<mr(t,r)}(e=ms(e),t,r)},Mr.invoke=Os,Mr.isArguments=Ba,Mr.isArray=Ua,Mr.isArrayBuffer=Va,Mr.isArrayLike=Wa,Mr.isArrayLikeObject=Ga,Mr.isBoolean=function(e){return!0===e||!1===e||es(e)&&An(e)==y},Mr.isBuffer=Ya,Mr.isDate=Ha,Mr.isElement=function(e){return es(e)&&1===e.nodeType&&!ns(e)},Mr.isEmpty=function(e){if(null==e)return!0;if(Wa(e)&&(Ua(e)||"string"==typeof e||"function"==typeof e.splice||Ya(e)||ls(e)||Ba(e)))return!e.length;var t=fo(e);if(t==x||t==C)return!e.size;if(wo(e))return!Pn(e).length;for(var r in e)if(Ee.call(e,r))return!1;return!0},Mr.isEqual=function(e,t){return Fn(e,t)},Mr.isEqualWith=function(e,t,r){var n=(r="function"==typeof r?r:i)?r(e,t):i;return n===i?Fn(e,t,i,r):!!n},Mr.isError=Ka,Mr.isFinite=function(e){return"number"==typeof e&&It(e)},Mr.isFunction=Xa,Mr.isInteger=Za,Mr.isLength=Ja,Mr.isMap=ts,Mr.isMatch=function(e,t){return e===t||Tn(e,t,so(t))},Mr.isMatchWith=function(e,t,r){return r="function"==typeof r?r:i,Tn(e,t,so(t),r)},Mr.isNaN=function(e){return rs(e)&&e!=+e},Mr.isNative=function(e){if(_o(e))throw new we("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Dn(e)},Mr.isNil=function(e){return null==e},Mr.isNull=function(e){return null===e},Mr.isNumber=rs,Mr.isObject=Qa,Mr.isObjectLike=es,Mr.isPlainObject=ns,Mr.isRegExp=is,Mr.isSafeInteger=function(e){return Za(e)&&e>=-9007199254740991&&e<=d},Mr.isSet=os,Mr.isString=as,Mr.isSymbol=ss,Mr.isTypedArray=ls,Mr.isUndefined=function(e){return e===i},Mr.isWeakMap=function(e){return es(e)&&fo(e)==F},Mr.isWeakSet=function(e){return es(e)&&"[object WeakSet]"==An(e)},Mr.join=function(e,t){return null==e?"":Vt.call(e,t)},Mr.kebabCase=Us,Mr.last=Ko,Mr.lastIndexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var o=n;return r!==i&&(o=(o=ps(r))<0?mr(n+o,0):gr(o,n-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,o):qt(e,zt,o,!0)},Mr.lowerCase=Vs,Mr.lowerFirst=Ws,Mr.lt=us,Mr.lte=cs,Mr.max=function(e){return e&&e.length?pn(e,rl,jn):i},Mr.maxBy=function(e,t){return e&&e.length?pn(e,oo(t,2),jn):i},Mr.mean=function(e){return Bt(e,rl)},Mr.meanBy=function(e,t){return Bt(e,oo(t,2))},Mr.min=function(e){return e&&e.length?pn(e,rl,Rn):i},Mr.minBy=function(e,t){return e&&e.length?pn(e,oo(t,2),Rn):i},Mr.stubArray=hl,Mr.stubFalse=ml,Mr.stubObject=function(){return{}},Mr.stubString=function(){return""},Mr.stubTrue=function(){return!0},Mr.multiply=wl,Mr.nth=function(e,t){return e&&e.length?Nn(e,ps(t)):i},Mr.noConflict=function(){return dt._===this&&(dt._=qe),this},Mr.noop=sl,Mr.now=Sa,Mr.pad=function(e,t,r){e=ys(e);var n=(t=ps(t))?ur(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return zi(pt(i),r)+e+zi(ft(i),r)},Mr.padEnd=function(e,t,r){e=ys(e);var n=(t=ps(t))?ur(e):0;return t&&n<t?e+zi(t-n,r):e},Mr.padStart=function(e,t,r){e=ys(e);var n=(t=ps(t))?ur(e):0;return t&&n<t?zi(t-n,r)+e:e},Mr.parseInt=function(e,t,r){return r||null==t?t=0:t&&(t=+t),vr(ys(e).replace(ne,""),t||0)},Mr.random=function(e,t,r){if(r&&"boolean"!=typeof r&&yo(e,t,r)&&(t=r=i),r===i&&("boolean"==typeof t?(r=t,t=i):"boolean"==typeof e&&(r=e,e=i)),e===i&&t===i?(e=0,t=1):(e=fs(e),t===i?(t=e,e=0):t=fs(t)),e>t){var n=e;e=t,t=n}if(r||e%1||t%1){var o=br();return gr(e+o*(t-e+st("1e-"+((o+"").length-1))),t)}return Wn(e,t)},Mr.reduce=function(e,t,r){var n=Ua(e)?Et:Wt,i=arguments.length<3;return n(e,oo(t,4),r,i,cn)},Mr.reduceRight=function(e,t,r){var n=Ua(e)?Pt:Wt,i=arguments.length<3;return n(e,oo(t,4),r,i,dn)},Mr.repeat=function(e,t,r){return t=(r?yo(e,t,r):t===i)?1:ps(t),Gn(ys(e),t)},Mr.replace=function(){var e=arguments,t=ys(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Mr.result=function(e,t,r){var n=-1,o=(t=gi(t,e)).length;for(o||(o=1,e=i);++n<o;){var a=null==e?i:e[Io(t[n])];a===i&&(n=o,a=r),e=Xa(a)?a.call(e):a}return e},Mr.round=xl,Mr.runInContext=e,Mr.sample=function(e){return(Ua(e)?Hr:Hn)(e)},Mr.size=function(e){if(null==e)return 0;if(Wa(e))return as(e)?ur(e):e.length;var t=fo(e);return t==x||t==C?e.size:Pn(e).length},Mr.snakeCase=Gs,Mr.some=function(e,t,r){var n=Ua(e)?Rt:ti;return r&&yo(e,t,r)&&(t=i),n(e,oo(t,3))},Mr.sortedIndex=function(e,t){return ri(e,t)},Mr.sortedIndexBy=function(e,t,r){return ni(e,t,oo(r,2))},Mr.sortedIndexOf=function(e,t){var r=null==e?0:e.length;if(r){var n=ri(e,t);if(n<r&&La(e[n],t))return n}return-1},Mr.sortedLastIndex=function(e,t){return ri(e,t,!0)},Mr.sortedLastIndexBy=function(e,t,r){return ni(e,t,oo(r,2),!0)},Mr.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var r=ri(e,t,!0)-1;if(La(e[r],t))return r}return-1},Mr.startCase=Ys,Mr.startsWith=function(e,t,r){return e=ys(e),r=null==r?0:on(ps(r),0,e.length),t=ai(t),e.slice(r,r+t.length)==t},Mr.subtract=Al,Mr.sum=function(e){return e&&e.length?Gt(e,rl):0},Mr.sumBy=function(e,t){return e&&e.length?Gt(e,oo(t,2)):0},Mr.template=function(e,t,r){var n=Mr.templateSettings;r&&yo(e,t,r)&&(t=i),e=ys(e),t=_s({},t,n,Ki);var o,a,s=_s({},t.imports,n.imports,Ki),l=Fs(s),u=Xt(s,l),c=0,d=t.interpolate||be,f="__p += '",p=Se((t.escape||be).source+"|"+d.source+"|"+(d===Z?de:be).source+"|"+(t.evaluate||be).source+"|$","g"),h="//# sourceURL="+(Ee.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++nt+"]")+"\n";e.replace(p,(function(t,r,n,i,s,l){return n||(n=i),f+=e.slice(c,l).replace(_e,rr),r&&(o=!0,f+="' +\n__e("+r+") +\n'"),s&&(a=!0,f+="';\n"+s+";\n__p += '"),n&&(f+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),c=l+t.length,t})),f+="';\n";var m=Ee.call(t,"variable")&&t.variable;if(m){if(ue.test(m))throw new we("Invalid `variable` option passed into `_.template`")}else f="with (obj) {\n"+f+"\n}\n";f=(a?f.replace(B,""):f).replace(U,"$1").replace(V,"$1;"),f="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+f+"return __p\n}";var g=Zs((function(){return xe(l,h+"return "+f).apply(i,u)}));if(g.source=f,Ka(g))throw g;return g},Mr.times=function(e,t){if((e=ps(e))<1||e>d)return[];var r=p,n=gr(e,p);t=oo(t),e-=p;for(var i=Yt(n,t);++r<e;)t(r);return i},Mr.toFinite=fs,Mr.toInteger=ps,Mr.toLength=hs,Mr.toLower=function(e){return ys(e).toLowerCase()},Mr.toNumber=ms,Mr.toSafeInteger=function(e){return e?on(ps(e),-9007199254740991,d):0===e?e:0},Mr.toString=ys,Mr.toUpper=function(e){return ys(e).toUpperCase()},Mr.trim=function(e,t,r){if((e=ys(e))&&(r||t===i))return Ht(e);if(!e||!(t=ai(t)))return e;var n=cr(e),o=cr(t);return vi(n,Jt(n,o),Qt(n,o)+1).join("")},Mr.trimEnd=function(e,t,r){if((e=ys(e))&&(r||t===i))return e.slice(0,dr(e)+1);if(!e||!(t=ai(t)))return e;var n=cr(e);return vi(n,0,Qt(n,cr(t))+1).join("")},Mr.trimStart=function(e,t,r){if((e=ys(e))&&(r||t===i))return e.replace(ne,"");if(!e||!(t=ai(t)))return e;var n=cr(e);return vi(n,Jt(n,cr(t))).join("")},Mr.truncate=function(e,t){var r=30,n="...";if(Qa(t)){var o="separator"in t?t.separator:o;r="length"in t?ps(t.length):r,n="omission"in t?ai(t.omission):n}var a=(e=ys(e)).length;if(nr(e)){var s=cr(e);a=s.length}if(r>=a)return e;var l=r-ur(n);if(l<1)return n;var u=s?vi(s,0,l).join(""):e.slice(0,l);if(o===i)return u+n;if(s&&(l+=u.length-l),is(o)){if(e.slice(l).search(o)){var c,d=u;for(o.global||(o=Se(o.source,ys(fe.exec(o))+"g")),o.lastIndex=0;c=o.exec(d);)var f=c.index;u=u.slice(0,f===i?l:f)}}else if(e.indexOf(ai(o),l)!=l){var p=u.lastIndexOf(o);p>-1&&(u=u.slice(0,p))}return u+n},Mr.unescape=function(e){return(e=ys(e))&&Y.test(e)?e.replace(W,fr):e},Mr.uniqueId=function(e){var t=++Pe;return ys(e)+t},Mr.upperCase=Hs,Mr.upperFirst=Ks,Mr.each=ya,Mr.eachRight=va,Mr.first=Wo,al(Mr,(gl={},vn(Mr,(function(e,t){Ee.call(Mr.prototype,t)||(gl[t]=e)})),gl),{chain:!1}),Mr.VERSION="4.17.21",St(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Mr[e].placeholder=Mr})),St(["drop","take"],(function(e,t){zr.prototype[e]=function(r){r=r===i?1:mr(ps(r),0);var n=this.__filtered__&&!t?new zr(this):this.clone();return n.__filtered__?n.__takeCount__=gr(r,n.__takeCount__):n.__views__.push({size:gr(r,p),type:e+(n.__dir__<0?"Right":"")}),n},zr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),St(["filter","map","takeWhile"],(function(e,t){var r=t+1,n=1==r||3==r;zr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:oo(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}})),St(["head","last"],(function(e,t){var r="take"+(t?"Right":"");zr.prototype[e]=function(){return this[r](1).value()[0]}})),St(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");zr.prototype[e]=function(){return this.__filtered__?new zr(this):this[r](1)}})),zr.prototype.compact=function(){return this.filter(rl)},zr.prototype.find=function(e){return this.filter(e).head()},zr.prototype.findLast=function(e){return this.reverse().find(e)},zr.prototype.invokeMap=Yn((function(e,t){return"function"==typeof e?new zr(this):this.map((function(r){return $n(r,e,t)}))})),zr.prototype.reject=function(e){return this.filter(Pa(oo(e)))},zr.prototype.slice=function(e,t){e=ps(e);var r=this;return r.__filtered__&&(e>0||t<0)?new zr(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==i&&(r=(t=ps(t))<0?r.dropRight(-t):r.take(t-e)),r)},zr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},zr.prototype.toArray=function(){return this.take(p)},vn(zr.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),o=Mr[n?"take"+("last"==t?"Right":""):t],a=n||/^find/.test(t);o&&(Mr.prototype[t]=function(){var t=this.__wrapped__,s=n?[1]:arguments,l=t instanceof zr,u=s[0],c=l||Ua(t),d=function(e){var t=o.apply(Mr,Dt([e],s));return n&&f?t[0]:t};c&&r&&"function"==typeof u&&1!=u.length&&(l=c=!1);var f=this.__chain__,p=!!this.__actions__.length,h=a&&!f,m=l&&!p;if(!a&&c){t=m?t:new zr(this);var g=e.apply(t,s);return g.__actions__.push({func:fa,args:[d],thisArg:i}),new Nr(g,f)}return h&&m?e.apply(this,s):(g=this.thru(d),h?n?g.value()[0]:g.value():g)})})),St(["pop","push","shift","sort","splice","unshift"],(function(e){var t=$e[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Mr.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(Ua(i)?i:[],e)}return this[r]((function(r){return t.apply(Ua(r)?r:[],e)}))}})),vn(zr.prototype,(function(e,t){var r=Mr[t];if(r){var n=r.name+"";Ee.call($r,n)||($r[n]=[]),$r[n].push({name:t,func:r})}})),$r[Mi(i,2).name]=[{name:"wrapper",func:i}],zr.prototype.clone=function(){var e=new zr(this.__wrapped__);return e.__actions__=ki(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=ki(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=ki(this.__views__),e},zr.prototype.reverse=function(){if(this.__filtered__){var e=new zr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},zr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=Ua(e),n=t<0,i=r?e.length:0,o=function(e,t,r){for(var n=-1,i=r.length;++n<i;){var o=r[n],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=gr(t,e+a);break;case"takeRight":e=mr(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,s=o.end,l=s-a,u=n?s:a-1,c=this.__iteratees__,d=c.length,f=0,p=gr(l,this.__takeCount__);if(!r||!n&&i==l&&p==l)return di(e,this.__actions__);var h=[];e:for(;l--&&f<p;){for(var m=-1,g=e[u+=t];++m<d;){var y=c[m],v=y.iteratee,b=y.type,_=v(g);if(2==b)g=_;else if(!_){if(1==b)continue e;break e}}h[f++]=g}return h},Mr.prototype.at=pa,Mr.prototype.chain=function(){return da(this)},Mr.prototype.commit=function(){return new Nr(this.value(),this.__chain__)},Mr.prototype.next=function(){this.__values__===i&&(this.__values__=ds(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},Mr.prototype.plant=function(e){for(var t,r=this;r instanceof Lr;){var n=qo(r);n.__index__=0,n.__values__=i,t?o.__wrapped__=n:t=n;var o=n;r=r.__wrapped__}return o.__wrapped__=e,t},Mr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof zr){var t=e;return this.__actions__.length&&(t=new zr(this)),(t=t.reverse()).__actions__.push({func:fa,args:[Qo],thisArg:i}),new Nr(t,this.__chain__)}return this.thru(Qo)},Mr.prototype.toJSON=Mr.prototype.valueOf=Mr.prototype.value=function(){return di(this.__wrapped__,this.__actions__)},Mr.prototype.first=Mr.prototype.head,Ke&&(Mr.prototype[Ke]=function(){return this}),Mr}();dt._=pr,(n=function(){return pr}.call(t,r,t,e))===i||(e.exports=n)}.call(this)},330:e=>{e.exports=function(){return!1}},168:(e,t,r)=>{r.r(t),r.d(t,{DOMException:()=>w,Headers:()=>c,Request:()=>y,Response:()=>b,fetch:()=>x});var n="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==n&&n,i={searchParams:"URLSearchParams"in n,iterable:"Symbol"in n&&"iterator"in Symbol,blob:"FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in n,arrayBuffer:"ArrayBuffer"in n};if(i.arrayBuffer)var o=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],a=ArrayBuffer.isView||function(e){return e&&o.indexOf(Object.prototype.toString.call(e))>-1};function s(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function u(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return i.iterable&&(t[Symbol.iterator]=function(){return t}),t}function c(e){this.map={},e instanceof c?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function d(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function f(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function p(e){var t=new FileReader,r=f(t);return t.readAsArrayBuffer(e),r}function h(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:i.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:i.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():i.arrayBuffer&&i.blob&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=h(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):i.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||a(e))?this._bodyArrayBuffer=h(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):i.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i.blob&&(this.blob=function(){var e=d(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?d(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer)):this.blob().then(p)}),this.text=function(){var e,t,r,n=d(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,r=f(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i.formData&&(this.formData=function(){return this.text().then(v)}),this.json=function(){return this.text().then(JSON.parse)},this}c.prototype.append=function(e,t){e=s(e),t=l(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},c.prototype.delete=function(e){delete this.map[s(e)]},c.prototype.get=function(e){return e=s(e),this.has(e)?this.map[e]:null},c.prototype.has=function(e){return this.map.hasOwnProperty(s(e))},c.prototype.set=function(e,t){this.map[s(e)]=l(t)},c.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},c.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),u(e)},c.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),u(e)},c.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),u(e)},i.iterable&&(c.prototype[Symbol.iterator]=c.prototype.entries);var g=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function y(e,t){if(!(this instanceof y))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var r,n,i=(t=t||{}).body;if(e instanceof y){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new c(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new c(t.headers)),this.method=(n=(r=t.method||this.method||"GET").toUpperCase(),g.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(i),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var o=/([?&])_=[^&]*/;o.test(this.url)?this.url=this.url.replace(o,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function v(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}})),t}function b(e,t){if(!(this instanceof b))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new c(t.headers),this.url=t.url||"",this._initBody(e)}y.prototype.clone=function(){return new y(this,{body:this._bodyInit})},m.call(y.prototype),m.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new c(this.headers),url:this.url})},b.error=function(){var e=new b(null,{status:0,statusText:""});return e.type="error",e};var _=[301,302,303,307,308];b.redirect=function(e,t){if(-1===_.indexOf(t))throw new RangeError("Invalid status code");return new b(null,{status:t,headers:{location:e}})};var w=n.DOMException;try{new w}catch(e){(w=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack}).prototype=Object.create(Error.prototype),w.prototype.constructor=w}function x(e,t){return new Promise((function(r,o){var a=new y(e,t);if(a.signal&&a.signal.aborted)return o(new w("Aborted","AbortError"));var s=new XMLHttpRequest;function u(){s.abort()}s.onload=function(){var e,t,n={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new c,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}})),t)};n.url="responseURL"in s?s.responseURL:n.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;setTimeout((function(){r(new b(i,n))}),0)},s.onerror=function(){setTimeout((function(){o(new TypeError("Network request failed"))}),0)},s.ontimeout=function(){setTimeout((function(){o(new TypeError("Network request failed"))}),0)},s.onabort=function(){setTimeout((function(){o(new w("Aborted","AbortError"))}),0)},s.open(a.method,function(e){try{return""===e&&n.location.href?n.location.href:e}catch(t){return e}}(a.url),!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&(i.blob?s.responseType="blob":i.arrayBuffer&&a.headers.get("Content-Type")&&-1!==a.headers.get("Content-Type").indexOf("application/octet-stream")&&(s.responseType="arraybuffer")),!t||"object"!=typeof t.headers||t.headers instanceof c?a.headers.forEach((function(e,t){s.setRequestHeader(t,e)})):Object.getOwnPropertyNames(t.headers).forEach((function(e){s.setRequestHeader(e,l(t.headers[e]))})),a.signal&&(a.signal.addEventListener("abort",u),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",u)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}x.polyfill=!0,n.fetch||(n.fetch=x,n.Headers=c,n.Request=y,n.Response=b)},392:function(e){e.exports=function(){for(var e=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=1),e<t?t:e>r?r:e},t=e,r={},n=0,i=["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"];n<i.length;n+=1){var o=i[n];r["[object "+o+"]"]=o.toLowerCase()}var a=function(e){return r[Object.prototype.toString.call(e)]||"object"},s=a,l=a,u=Math.PI,c={clip_rgb:function(e){e._clipped=!1,e._unclipped=e.slice(0);for(var r=0;r<=3;r++)r<3?((e[r]<0||e[r]>255)&&(e._clipped=!0),e[r]=t(e[r],0,255)):3===r&&(e[r]=t(e[r],0,1));return e},limit:e,type:a,unpack:function(e,t){return void 0===t&&(t=null),e.length>=3?Array.prototype.slice.call(e):"object"==s(e[0])&&t?t.split("").filter((function(t){return void 0!==e[0][t]})).map((function(t){return e[0][t]})):e[0]},last:function(e){if(e.length<2)return null;var t=e.length-1;return"string"==l(e[t])?e[t].toLowerCase():null},PI:u,TWOPI:2*u,PITHIRD:u/3,DEG2RAD:u/180,RAD2DEG:180/u},d={format:{},autodetect:[]},f=c.last,p=c.clip_rgb,h=c.type,m=d,g=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=this;if("object"===h(e[0])&&e[0].constructor&&e[0].constructor===this.constructor)return e[0];var n=f(e),i=!1;if(!n){i=!0,m.sorted||(m.autodetect=m.autodetect.sort((function(e,t){return t.p-e.p})),m.sorted=!0);for(var o=0,a=m.autodetect;o<a.length;o+=1){var s=a[o];if(n=s.test.apply(s,e))break}}if(!m.format[n])throw new Error("unknown format: "+e);var l=m.format[n].apply(null,i?e:e.slice(0,-1));r._rgb=p(l),3===r._rgb.length&&r._rgb.push(1)};g.prototype.toString=function(){return"function"==h(this.hex)?this.hex():"["+this._rgb.join(",")+"]"};var y=g,v=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(v.Color,[null].concat(e)))};v.Color=y,v.version="2.4.2";var b=v,_=c.unpack,w=Math.max,x=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=_(e,"rgb"),n=r[0],i=r[1],o=r[2],a=1-w(n/=255,w(i/=255,o/=255)),s=a<1?1/(1-a):0;return[(1-n-a)*s,(1-i-a)*s,(1-o-a)*s,a]},A=c.unpack,j=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=(e=A(e,"cmyk"))[0],n=e[1],i=e[2],o=e[3],a=e.length>4?e[4]:1;return 1===o?[0,0,0,a]:[r>=1?0:255*(1-r)*(1-o),n>=1?0:255*(1-n)*(1-o),i>=1?0:255*(1-i)*(1-o),a]},S=b,k=y,C=d,$=c.unpack,O=c.type,F=x;k.prototype.cmyk=function(){return F(this._rgb)},S.cmyk=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(k,[null].concat(e,["cmyk"])))},C.format.cmyk=j,C.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=$(e,"cmyk"),"array"===O(e)&&4===e.length)return"cmyk"}});var T=c.unpack,D=c.last,E=function(e){return Math.round(100*e)/100},P=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=T(e,"hsla"),n=D(e)||"lsa";return r[0]=E(r[0]||0),r[1]=E(100*r[1])+"%",r[2]=E(100*r[2])+"%","hsla"===n||r.length>3&&r[3]<1?(r[3]=r.length>3?r[3]:1,n="hsla"):r.length=3,n+"("+r.join(",")+")"},R=c.unpack,I=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=(e=R(e,"rgba"))[0],n=e[1],i=e[2];r/=255,n/=255,i/=255;var o,a,s=Math.min(r,n,i),l=Math.max(r,n,i),u=(l+s)/2;return l===s?(o=0,a=Number.NaN):o=u<.5?(l-s)/(l+s):(l-s)/(2-l-s),r==l?a=(n-i)/(l-s):n==l?a=2+(i-r)/(l-s):i==l&&(a=4+(r-n)/(l-s)),(a*=60)<0&&(a+=360),e.length>3&&void 0!==e[3]?[a,o,u,e[3]]:[a,o,u]},M=c.unpack,q=c.last,L=P,N=I,z=Math.round,B=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=M(e,"rgba"),n=q(e)||"rgb";return"hsl"==n.substr(0,3)?L(N(r),n):(r[0]=z(r[0]),r[1]=z(r[1]),r[2]=z(r[2]),("rgba"===n||r.length>3&&r[3]<1)&&(r[3]=r.length>3?r[3]:1,n="rgba"),n+"("+r.slice(0,"rgb"===n?3:4).join(",")+")")},U=c.unpack,V=Math.round,W=function(){for(var e,t=[],r=arguments.length;r--;)t[r]=arguments[r];var n,i,o,a=(t=U(t,"hsl"))[0],s=t[1],l=t[2];if(0===s)n=i=o=255*l;else{var u=[0,0,0],c=[0,0,0],d=l<.5?l*(1+s):l+s-l*s,f=2*l-d,p=a/360;u[0]=p+1/3,u[1]=p,u[2]=p-1/3;for(var h=0;h<3;h++)u[h]<0&&(u[h]+=1),u[h]>1&&(u[h]-=1),6*u[h]<1?c[h]=f+6*(d-f)*u[h]:2*u[h]<1?c[h]=d:3*u[h]<2?c[h]=f+(d-f)*(2/3-u[h])*6:c[h]=f;n=(e=[V(255*c[0]),V(255*c[1]),V(255*c[2])])[0],i=e[1],o=e[2]}return t.length>3?[n,i,o,t[3]]:[n,i,o,1]},G=W,Y=d,H=/^rgb\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*\)$/,K=/^rgba\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*,\s*([01]|[01]?\.\d+)\)$/,X=/^rgb\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,Z=/^rgba\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,J=/^hsl\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,Q=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,ee=Math.round,te=function(e){var t;if(e=e.toLowerCase().trim(),Y.format.named)try{return Y.format.named(e)}catch(e){}if(t=e.match(H)){for(var r=t.slice(1,4),n=0;n<3;n++)r[n]=+r[n];return r[3]=1,r}if(t=e.match(K)){for(var i=t.slice(1,5),o=0;o<4;o++)i[o]=+i[o];return i}if(t=e.match(X)){for(var a=t.slice(1,4),s=0;s<3;s++)a[s]=ee(2.55*a[s]);return a[3]=1,a}if(t=e.match(Z)){for(var l=t.slice(1,5),u=0;u<3;u++)l[u]=ee(2.55*l[u]);return l[3]=+l[3],l}if(t=e.match(J)){var c=t.slice(1,4);c[1]*=.01,c[2]*=.01;var d=G(c);return d[3]=1,d}if(t=e.match(Q)){var f=t.slice(1,4);f[1]*=.01,f[2]*=.01;var p=G(f);return p[3]=+t[4],p}};te.test=function(e){return H.test(e)||K.test(e)||X.test(e)||Z.test(e)||J.test(e)||Q.test(e)};var re=b,ne=y,ie=d,oe=c.type,ae=B,se=te;ne.prototype.css=function(e){return ae(this._rgb,e)},re.css=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(ne,[null].concat(e,["css"])))},ie.format.css=se,ie.autodetect.push({p:5,test:function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];if(!t.length&&"string"===oe(e)&&se.test(e))return"css"}});var le=y,ue=b,ce=c.unpack;d.format.gl=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=ce(e,"rgba");return r[0]*=255,r[1]*=255,r[2]*=255,r},ue.gl=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(le,[null].concat(e,["gl"])))},le.prototype.gl=function(){var e=this._rgb;return[e[0]/255,e[1]/255,e[2]/255,e[3]]};var de=c.unpack,fe=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r,n=de(e,"rgb"),i=n[0],o=n[1],a=n[2],s=Math.min(i,o,a),l=Math.max(i,o,a),u=l-s,c=100*u/255,d=s/(255-u)*100;return 0===u?r=Number.NaN:(i===l&&(r=(o-a)/u),o===l&&(r=2+(a-i)/u),a===l&&(r=4+(i-o)/u),(r*=60)<0&&(r+=360)),[r,c,d]},pe=c.unpack,he=Math.floor,me=function(){for(var e,t,r,n,i,o,a=[],s=arguments.length;s--;)a[s]=arguments[s];var l,u,c,d=(a=pe(a,"hcg"))[0],f=a[1],p=a[2];p*=255;var h=255*f;if(0===f)l=u=c=p;else{360===d&&(d=0),d>360&&(d-=360),d<0&&(d+=360);var m=he(d/=60),g=d-m,y=p*(1-f),v=y+h*(1-g),b=y+h*g,_=y+h;switch(m){case 0:l=(e=[_,b,y])[0],u=e[1],c=e[2];break;case 1:l=(t=[v,_,y])[0],u=t[1],c=t[2];break;case 2:l=(r=[y,_,b])[0],u=r[1],c=r[2];break;case 3:l=(n=[y,v,_])[0],u=n[1],c=n[2];break;case 4:l=(i=[b,y,_])[0],u=i[1],c=i[2];break;case 5:l=(o=[_,y,v])[0],u=o[1],c=o[2]}}return[l,u,c,a.length>3?a[3]:1]},ge=c.unpack,ye=c.type,ve=b,be=y,_e=d,we=fe;be.prototype.hcg=function(){return we(this._rgb)},ve.hcg=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(be,[null].concat(e,["hcg"])))},_e.format.hcg=me,_e.autodetect.push({p:1,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=ge(e,"hcg"),"array"===ye(e)&&3===e.length)return"hcg"}});var xe=c.unpack,Ae=c.last,je=Math.round,Se=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=xe(e,"rgba"),n=r[0],i=r[1],o=r[2],a=r[3],s=Ae(e)||"auto";void 0===a&&(a=1),"auto"===s&&(s=a<1?"rgba":"rgb");var l="000000"+((n=je(n))<<16|(i=je(i))<<8|(o=je(o))).toString(16);l=l.substr(l.length-6);var u="0"+je(255*a).toString(16);switch(u=u.substr(u.length-2),s.toLowerCase()){case"rgba":return"#"+l+u;case"argb":return"#"+u+l;default:return"#"+l}},ke=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,Ce=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,$e=function(e){if(e.match(ke)){4!==e.length&&7!==e.length||(e=e.substr(1)),3===e.length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]);var t=parseInt(e,16);return[t>>16,t>>8&255,255&t,1]}if(e.match(Ce)){5!==e.length&&9!==e.length||(e=e.substr(1)),4===e.length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);var r=parseInt(e,16);return[r>>24&255,r>>16&255,r>>8&255,Math.round((255&r)/255*100)/100]}throw new Error("unknown hex color: "+e)},Oe=b,Fe=y,Te=c.type,De=d,Ee=Se;Fe.prototype.hex=function(e){return Ee(this._rgb,e)},Oe.hex=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(Fe,[null].concat(e,["hex"])))},De.format.hex=$e,De.autodetect.push({p:4,test:function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];if(!t.length&&"string"===Te(e)&&[3,4,5,6,7,8,9].indexOf(e.length)>=0)return"hex"}});var Pe=c.unpack,Re=c.TWOPI,Ie=Math.min,Me=Math.sqrt,qe=Math.acos,Le=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r,n=Pe(e,"rgb"),i=n[0],o=n[1],a=n[2],s=Ie(i/=255,o/=255,a/=255),l=(i+o+a)/3,u=l>0?1-s/l:0;return 0===u?r=NaN:(r=(i-o+(i-a))/2,r/=Me((i-o)*(i-o)+(i-a)*(o-a)),r=qe(r),a>o&&(r=Re-r),r/=Re),[360*r,u,l]},Ne=c.unpack,ze=c.limit,Be=c.TWOPI,Ue=c.PITHIRD,Ve=Math.cos,We=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r,n,i,o=(e=Ne(e,"hsi"))[0],a=e[1],s=e[2];return isNaN(o)&&(o=0),isNaN(a)&&(a=0),o>360&&(o-=360),o<0&&(o+=360),(o/=360)<1/3?n=1-((i=(1-a)/3)+(r=(1+a*Ve(Be*o)/Ve(Ue-Be*o))/3)):o<2/3?i=1-((r=(1-a)/3)+(n=(1+a*Ve(Be*(o-=1/3))/Ve(Ue-Be*o))/3)):r=1-((n=(1-a)/3)+(i=(1+a*Ve(Be*(o-=2/3))/Ve(Ue-Be*o))/3)),[255*(r=ze(s*r*3)),255*(n=ze(s*n*3)),255*(i=ze(s*i*3)),e.length>3?e[3]:1]},Ge=c.unpack,Ye=c.type,He=b,Ke=y,Xe=d,Ze=Le;Ke.prototype.hsi=function(){return Ze(this._rgb)},He.hsi=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(Ke,[null].concat(e,["hsi"])))},Xe.format.hsi=We,Xe.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=Ge(e,"hsi"),"array"===Ye(e)&&3===e.length)return"hsi"}});var Je=c.unpack,Qe=c.type,et=b,tt=y,rt=d,nt=I;tt.prototype.hsl=function(){return nt(this._rgb)},et.hsl=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(tt,[null].concat(e,["hsl"])))},rt.format.hsl=W,rt.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=Je(e,"hsl"),"array"===Qe(e)&&3===e.length)return"hsl"}});var it=c.unpack,ot=Math.min,at=Math.max,st=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r,n,i,o=(e=it(e,"rgb"))[0],a=e[1],s=e[2],l=ot(o,a,s),u=at(o,a,s),c=u-l;return i=u/255,0===u?(r=Number.NaN,n=0):(n=c/u,o===u&&(r=(a-s)/c),a===u&&(r=2+(s-o)/c),s===u&&(r=4+(o-a)/c),(r*=60)<0&&(r+=360)),[r,n,i]},lt=c.unpack,ut=Math.floor,ct=function(){for(var e,t,r,n,i,o,a=[],s=arguments.length;s--;)a[s]=arguments[s];var l,u,c,d=(a=lt(a,"hsv"))[0],f=a[1],p=a[2];if(p*=255,0===f)l=u=c=p;else{360===d&&(d=0),d>360&&(d-=360),d<0&&(d+=360);var h=ut(d/=60),m=d-h,g=p*(1-f),y=p*(1-f*m),v=p*(1-f*(1-m));switch(h){case 0:l=(e=[p,v,g])[0],u=e[1],c=e[2];break;case 1:l=(t=[y,p,g])[0],u=t[1],c=t[2];break;case 2:l=(r=[g,p,v])[0],u=r[1],c=r[2];break;case 3:l=(n=[g,y,p])[0],u=n[1],c=n[2];break;case 4:l=(i=[v,g,p])[0],u=i[1],c=i[2];break;case 5:l=(o=[p,g,y])[0],u=o[1],c=o[2]}}return[l,u,c,a.length>3?a[3]:1]},dt=c.unpack,ft=c.type,pt=b,ht=y,mt=d,gt=st;ht.prototype.hsv=function(){return gt(this._rgb)},pt.hsv=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(ht,[null].concat(e,["hsv"])))},mt.format.hsv=ct,mt.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=dt(e,"hsv"),"array"===ft(e)&&3===e.length)return"hsv"}});var yt={Kn:18,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452},vt=yt,bt=c.unpack,_t=Math.pow,wt=function(e){return(e/=255)<=.04045?e/12.92:_t((e+.055)/1.055,2.4)},xt=function(e){return e>vt.t3?_t(e,1/3):e/vt.t2+vt.t0},At=function(e,t,r){return e=wt(e),t=wt(t),r=wt(r),[xt((.4124564*e+.3575761*t+.1804375*r)/vt.Xn),xt((.2126729*e+.7151522*t+.072175*r)/vt.Yn),xt((.0193339*e+.119192*t+.9503041*r)/vt.Zn)]},jt=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=bt(e,"rgb"),n=r[0],i=r[1],o=r[2],a=At(n,i,o),s=a[0],l=a[1],u=116*l-16;return[u<0?0:u,500*(s-l),200*(l-a[2])]},St=yt,kt=c.unpack,Ct=Math.pow,$t=function(e){return 255*(e<=.00304?12.92*e:1.055*Ct(e,1/2.4)-.055)},Ot=function(e){return e>St.t1?e*e*e:St.t2*(e-St.t0)},Ft=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r,n,i,o=(e=kt(e,"lab"))[0],a=e[1],s=e[2];return n=(o+16)/116,r=isNaN(a)?n:n+a/500,i=isNaN(s)?n:n-s/200,n=St.Yn*Ot(n),r=St.Xn*Ot(r),i=St.Zn*Ot(i),[$t(3.2404542*r-1.5371385*n-.4985314*i),$t(-.969266*r+1.8760108*n+.041556*i),$t(.0556434*r-.2040259*n+1.0572252*i),e.length>3?e[3]:1]},Tt=c.unpack,Dt=c.type,Et=b,Pt=y,Rt=d,It=jt;Pt.prototype.lab=function(){return It(this._rgb)},Et.lab=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(Pt,[null].concat(e,["lab"])))},Rt.format.lab=Ft,Rt.autodetect.push({p:2,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=Tt(e,"lab"),"array"===Dt(e)&&3===e.length)return"lab"}});var Mt=c.unpack,qt=c.RAD2DEG,Lt=Math.sqrt,Nt=Math.atan2,zt=Math.round,Bt=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=Mt(e,"lab"),n=r[0],i=r[1],o=r[2],a=Lt(i*i+o*o),s=(Nt(o,i)*qt+360)%360;return 0===zt(1e4*a)&&(s=Number.NaN),[n,a,s]},Ut=c.unpack,Vt=jt,Wt=Bt,Gt=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=Ut(e,"rgb"),n=r[0],i=r[1],o=r[2],a=Vt(n,i,o),s=a[0],l=a[1],u=a[2];return Wt(s,l,u)},Yt=c.unpack,Ht=c.DEG2RAD,Kt=Math.sin,Xt=Math.cos,Zt=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=Yt(e,"lch"),n=r[0],i=r[1],o=r[2];return isNaN(o)&&(o=0),[n,Xt(o*=Ht)*i,Kt(o)*i]},Jt=c.unpack,Qt=Zt,er=Ft,tr=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=(e=Jt(e,"lch"))[0],n=e[1],i=e[2],o=Qt(r,n,i),a=o[0],s=o[1],l=o[2],u=er(a,s,l);return[u[0],u[1],u[2],e.length>3?e[3]:1]},rr=c.unpack,nr=tr,ir=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=rr(e,"hcl").reverse();return nr.apply(void 0,r)},or=c.unpack,ar=c.type,sr=b,lr=y,ur=d,cr=Gt;lr.prototype.lch=function(){return cr(this._rgb)},lr.prototype.hcl=function(){return cr(this._rgb).reverse()},sr.lch=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(lr,[null].concat(e,["lch"])))},sr.hcl=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(lr,[null].concat(e,["hcl"])))},ur.format.lch=tr,ur.format.hcl=ir,["lch","hcl"].forEach((function(e){return ur.autodetect.push({p:2,test:function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(t=or(t,e),"array"===ar(t)&&3===t.length)return e}})}));var dr={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflower:"#6495ed",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},fr=d,pr=c.type,hr=dr,mr=$e,gr=Se;y.prototype.name=function(){for(var e=gr(this._rgb,"rgb"),t=0,r=Object.keys(hr);t<r.length;t+=1){var n=r[t];if(hr[n]===e)return n.toLowerCase()}return e},fr.format.named=function(e){if(e=e.toLowerCase(),hr[e])return mr(hr[e]);throw new Error("unknown color name: "+e)},fr.autodetect.push({p:5,test:function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];if(!t.length&&"string"===pr(e)&&hr[e.toLowerCase()])return"named"}});var yr=c.unpack,vr=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=yr(e,"rgb");return(r[0]<<16)+(r[1]<<8)+r[2]},br=c.type,_r=b,wr=y,xr=d,Ar=c.type,jr=vr;wr.prototype.num=function(){return jr(this._rgb)},_r.num=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(wr,[null].concat(e,["num"])))},xr.format.num=function(e){if("number"==br(e)&&e>=0&&e<=16777215)return[e>>16,e>>8&255,255&e,1];throw new Error("unknown num color: "+e)},xr.autodetect.push({p:5,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(1===e.length&&"number"===Ar(e[0])&&e[0]>=0&&e[0]<=16777215)return"num"}});var Sr=b,kr=y,Cr=d,$r=c.unpack,Or=c.type,Fr=Math.round;kr.prototype.rgb=function(e){return void 0===e&&(e=!0),!1===e?this._rgb.slice(0,3):this._rgb.slice(0,3).map(Fr)},kr.prototype.rgba=function(e){return void 0===e&&(e=!0),this._rgb.slice(0,4).map((function(t,r){return r<3?!1===e?t:Fr(t):t}))},Sr.rgb=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(kr,[null].concat(e,["rgb"])))},Cr.format.rgb=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=$r(e,"rgba");return void 0===r[3]&&(r[3]=1),r},Cr.autodetect.push({p:3,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=$r(e,"rgba"),"array"===Or(e)&&(3===e.length||4===e.length&&"number"==Or(e[3])&&e[3]>=0&&e[3]<=1))return"rgb"}});var Tr=Math.log,Dr=function(e){var t,r,n,i=e/100;return i<66?(t=255,r=i<6?0:-155.25485562709179-.44596950469579133*(r=i-2)+104.49216199393888*Tr(r),n=i<20?0:.8274096064007395*(n=i-10)-254.76935184120902+115.67994401066147*Tr(n)):(t=351.97690566805693+.114206453784165*(t=i-55)-40.25366309332127*Tr(t),r=325.4494125711974+.07943456536662342*(r=i-50)-28.0852963507957*Tr(r),n=255),[t,r,n,1]},Er=Dr,Pr=c.unpack,Rr=Math.round,Ir=b,Mr=y,qr=d,Lr=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var r,n=Pr(e,"rgb"),i=n[0],o=n[2],a=1e3,s=4e4;s-a>.4;){var l=Er(r=.5*(s+a));l[2]/l[0]>=o/i?s=r:a=r}return Rr(r)};Mr.prototype.temp=Mr.prototype.kelvin=Mr.prototype.temperature=function(){return Lr(this._rgb)},Ir.temp=Ir.kelvin=Ir.temperature=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(Mr,[null].concat(e,["temp"])))},qr.format.temp=qr.format.kelvin=qr.format.temperature=Dr;var Nr=c.unpack,zr=Math.cbrt,Br=Math.pow,Ur=Math.sign,Vr=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=Nr(e,"rgb"),n=r[0],i=r[1],o=r[2],a=[Wr(n/255),Wr(i/255),Wr(o/255)],s=a[0],l=a[1],u=a[2],c=zr(.4122214708*s+.5363325363*l+.0514459929*u),d=zr(.2119034982*s+.6806995451*l+.1073969566*u),f=zr(.0883024619*s+.2817188376*l+.6299787005*u);return[.2104542553*c+.793617785*d-.0040720468*f,1.9779984951*c-2.428592205*d+.4505937099*f,.0259040371*c+.7827717662*d-.808675766*f]};function Wr(e){var t=Math.abs(e);return t<.04045?e/12.92:(Ur(e)||1)*Br((t+.055)/1.055,2.4)}var Gr=c.unpack,Yr=Math.pow,Hr=Math.sign,Kr=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=(e=Gr(e,"lab"))[0],n=e[1],i=e[2],o=Yr(r+.3963377774*n+.2158037573*i,3),a=Yr(r-.1055613458*n-.0638541728*i,3),s=Yr(r-.0894841775*n-1.291485548*i,3);return[255*Xr(4.0767416621*o-3.3077115913*a+.2309699292*s),255*Xr(-1.2684380046*o+2.6097574011*a-.3413193965*s),255*Xr(-.0041960863*o-.7034186147*a+1.707614701*s),e.length>3?e[3]:1]};function Xr(e){var t=Math.abs(e);return t>.0031308?(Hr(e)||1)*(1.055*Yr(t,1/2.4)-.055):12.92*e}var Zr=c.unpack,Jr=c.type,Qr=b,en=y,tn=d,rn=Vr;en.prototype.oklab=function(){return rn(this._rgb)},Qr.oklab=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(en,[null].concat(e,["oklab"])))},tn.format.oklab=Kr,tn.autodetect.push({p:3,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=Zr(e,"oklab"),"array"===Jr(e)&&3===e.length)return"oklab"}});var nn=c.unpack,on=Vr,an=Bt,sn=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=nn(e,"rgb"),n=r[0],i=r[1],o=r[2],a=on(n,i,o),s=a[0],l=a[1],u=a[2];return an(s,l,u)},ln=c.unpack,un=Zt,cn=Kr,dn=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=(e=ln(e,"lch"))[0],n=e[1],i=e[2],o=un(r,n,i),a=o[0],s=o[1],l=o[2],u=cn(a,s,l);return[u[0],u[1],u[2],e.length>3?e[3]:1]},fn=c.unpack,pn=c.type,hn=b,mn=y,gn=d,yn=sn;mn.prototype.oklch=function(){return yn(this._rgb)},hn.oklch=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return new(Function.prototype.bind.apply(mn,[null].concat(e,["oklch"])))},gn.format.oklch=dn,gn.autodetect.push({p:3,test:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];if(e=fn(e,"oklch"),"array"===pn(e)&&3===e.length)return"oklch"}});var vn=y,bn=c.type;vn.prototype.alpha=function(e,t){return void 0===t&&(t=!1),void 0!==e&&"number"===bn(e)?t?(this._rgb[3]=e,this):new vn([this._rgb[0],this._rgb[1],this._rgb[2],e],"rgb"):this._rgb[3]},y.prototype.clipped=function(){return this._rgb._clipped||!1};var _n=y,wn=yt;_n.prototype.darken=function(e){void 0===e&&(e=1);var t=this.lab();return t[0]-=wn.Kn*e,new _n(t,"lab").alpha(this.alpha(),!0)},_n.prototype.brighten=function(e){return void 0===e&&(e=1),this.darken(-e)},_n.prototype.darker=_n.prototype.darken,_n.prototype.brighter=_n.prototype.brighten,y.prototype.get=function(e){var t=e.split("."),r=t[0],n=t[1],i=this[r]();if(n){var o=r.indexOf(n)-("ok"===r.substr(0,2)?2:0);if(o>-1)return i[o];throw new Error("unknown channel "+n+" in mode "+r)}return i};var xn=y,An=c.type,jn=Math.pow;xn.prototype.luminance=function(e){if(void 0!==e&&"number"===An(e)){if(0===e)return new xn([0,0,0,this._rgb[3]],"rgb");if(1===e)return new xn([255,255,255,this._rgb[3]],"rgb");var t=this.luminance(),r=20,n=function(t,i){var o=t.interpolate(i,.5,"rgb"),a=o.luminance();return Math.abs(e-a)<1e-7||!r--?o:a>e?n(t,o):n(o,i)},i=(t>e?n(new xn([0,0,0]),this):n(this,new xn([255,255,255]))).rgb();return new xn(i.concat([this._rgb[3]]))}return Sn.apply(void 0,this._rgb.slice(0,3))};var Sn=function(e,t,r){return.2126*(e=kn(e))+.7152*(t=kn(t))+.0722*kn(r)},kn=function(e){return(e/=255)<=.03928?e/12.92:jn((e+.055)/1.055,2.4)},Cn={},$n=y,On=c.type,Fn=Cn,Tn=function(e,t,r){void 0===r&&(r=.5);for(var n=[],i=arguments.length-3;i-- >0;)n[i]=arguments[i+3];var o=n[0]||"lrgb";if(Fn[o]||n.length||(o=Object.keys(Fn)[0]),!Fn[o])throw new Error("interpolation mode "+o+" is not defined");return"object"!==On(e)&&(e=new $n(e)),"object"!==On(t)&&(t=new $n(t)),Fn[o](e,t,r).alpha(e.alpha()+r*(t.alpha()-e.alpha()))},Dn=y,En=Tn;Dn.prototype.mix=Dn.prototype.interpolate=function(e,t){void 0===t&&(t=.5);for(var r=[],n=arguments.length-2;n-- >0;)r[n]=arguments[n+2];return En.apply(void 0,[this,e,t].concat(r))};var Pn=y;Pn.prototype.premultiply=function(e){void 0===e&&(e=!1);var t=this._rgb,r=t[3];return e?(this._rgb=[t[0]*r,t[1]*r,t[2]*r,r],this):new Pn([t[0]*r,t[1]*r,t[2]*r,r],"rgb")};var Rn=y,In=yt;Rn.prototype.saturate=function(e){void 0===e&&(e=1);var t=this.lch();return t[1]+=In.Kn*e,t[1]<0&&(t[1]=0),new Rn(t,"lch").alpha(this.alpha(),!0)},Rn.prototype.desaturate=function(e){return void 0===e&&(e=1),this.saturate(-e)};var Mn=y,qn=c.type;Mn.prototype.set=function(e,t,r){void 0===r&&(r=!1);var n=e.split("."),i=n[0],o=n[1],a=this[i]();if(o){var s=i.indexOf(o)-("ok"===i.substr(0,2)?2:0);if(s>-1){if("string"==qn(t))switch(t.charAt(0)){case"+":case"-":a[s]+=+t;break;case"*":a[s]*=+t.substr(1);break;case"/":a[s]/=+t.substr(1);break;default:a[s]=+t}else{if("number"!==qn(t))throw new Error("unsupported value for Color.set");a[s]=t}var l=new Mn(a,i);return r?(this._rgb=l._rgb,this):l}throw new Error("unknown channel "+o+" in mode "+i)}return a};var Ln=y;Cn.rgb=function(e,t,r){var n=e._rgb,i=t._rgb;return new Ln(n[0]+r*(i[0]-n[0]),n[1]+r*(i[1]-n[1]),n[2]+r*(i[2]-n[2]),"rgb")};var Nn=y,zn=Math.sqrt,Bn=Math.pow;Cn.lrgb=function(e,t,r){var n=e._rgb,i=n[0],o=n[1],a=n[2],s=t._rgb,l=s[0],u=s[1],c=s[2];return new Nn(zn(Bn(i,2)*(1-r)+Bn(l,2)*r),zn(Bn(o,2)*(1-r)+Bn(u,2)*r),zn(Bn(a,2)*(1-r)+Bn(c,2)*r),"rgb")};var Un=y;Cn.lab=function(e,t,r){var n=e.lab(),i=t.lab();return new Un(n[0]+r*(i[0]-n[0]),n[1]+r*(i[1]-n[1]),n[2]+r*(i[2]-n[2]),"lab")};var Vn=y,Wn=function(e,t,r,n){var i,o,a,s,l,u,c,d,f,p,h,m,g;return"hsl"===n?(a=e.hsl(),s=t.hsl()):"hsv"===n?(a=e.hsv(),s=t.hsv()):"hcg"===n?(a=e.hcg(),s=t.hcg()):"hsi"===n?(a=e.hsi(),s=t.hsi()):"lch"===n||"hcl"===n?(n="hcl",a=e.hcl(),s=t.hcl()):"oklch"===n&&(a=e.oklch().reverse(),s=t.oklch().reverse()),"h"!==n.substr(0,1)&&"oklch"!==n||(l=(i=a)[0],c=i[1],f=i[2],u=(o=s)[0],d=o[1],p=o[2]),isNaN(l)||isNaN(u)?isNaN(l)?isNaN(u)?m=Number.NaN:(m=u,1!=f&&0!=f||"hsv"==n||(h=d)):(m=l,1!=p&&0!=p||"hsv"==n||(h=c)):m=l+r*(u>l&&u-l>180?u-(l+360):u<l&&l-u>180?u+360-l:u-l),void 0===h&&(h=c+r*(d-c)),g=f+r*(p-f),new Vn("oklch"===n?[g,h,m]:[m,h,g],n)},Gn=Wn,Yn=function(e,t,r){return Gn(e,t,r,"lch")};Cn.lch=Yn,Cn.hcl=Yn;var Hn=y;Cn.num=function(e,t,r){var n=e.num(),i=t.num();return new Hn(n+r*(i-n),"num")};var Kn=Wn;Cn.hcg=function(e,t,r){return Kn(e,t,r,"hcg")};var Xn=Wn;Cn.hsi=function(e,t,r){return Xn(e,t,r,"hsi")};var Zn=Wn;Cn.hsl=function(e,t,r){return Zn(e,t,r,"hsl")};var Jn=Wn;Cn.hsv=function(e,t,r){return Jn(e,t,r,"hsv")};var Qn=y;Cn.oklab=function(e,t,r){var n=e.oklab(),i=t.oklab();return new Qn(n[0]+r*(i[0]-n[0]),n[1]+r*(i[1]-n[1]),n[2]+r*(i[2]-n[2]),"oklab")};var ei=Wn;Cn.oklch=function(e,t,r){return ei(e,t,r,"oklch")};var ti=y,ri=c.clip_rgb,ni=Math.pow,ii=Math.sqrt,oi=Math.PI,ai=Math.cos,si=Math.sin,li=Math.atan2,ui=function(e,t){for(var r=e.length,n=[0,0,0,0],i=0;i<e.length;i++){var o=e[i],a=t[i]/r,s=o._rgb;n[0]+=ni(s[0],2)*a,n[1]+=ni(s[1],2)*a,n[2]+=ni(s[2],2)*a,n[3]+=s[3]*a}return n[0]=ii(n[0]),n[1]=ii(n[1]),n[2]=ii(n[2]),n[3]>.9999999&&(n[3]=1),new ti(ri(n))},ci=b,di=c.type,fi=Math.pow,pi=function(e){var t="rgb",r=ci("#ccc"),n=0,i=[0,1],o=[],a=[0,0],s=!1,l=[],u=!1,c=0,d=1,f=!1,p={},h=!0,m=1,g=function(e){if((e=e||["#fff","#000"])&&"string"===di(e)&&ci.brewer&&ci.brewer[e.toLowerCase()]&&(e=ci.brewer[e.toLowerCase()]),"array"===di(e)){1===e.length&&(e=[e[0],e[0]]),e=e.slice(0);for(var t=0;t<e.length;t++)e[t]=ci(e[t]);o.length=0;for(var r=0;r<e.length;r++)o.push(r/(e.length-1))}return _(),l=e},y=function(e){return e},v=function(e){return e},b=function(e,n){var i,u;if(null==n&&(n=!1),isNaN(e)||null===e)return r;u=n?e:s&&s.length>2?function(e){if(null!=s){for(var t=s.length-1,r=0;r<t&&e>=s[r];)r++;return r-1}return 0}(e)/(s.length-2):d!==c?(e-c)/(d-c):1,u=v(u),n||(u=y(u)),1!==m&&(u=fi(u,m)),u=a[0]+u*(1-a[0]-a[1]),u=Math.min(1,Math.max(0,u));var f=Math.floor(1e4*u);if(h&&p[f])i=p[f];else{if("array"===di(l))for(var g=0;g<o.length;g++){var b=o[g];if(u<=b){i=l[g];break}if(u>=b&&g===o.length-1){i=l[g];break}if(u>b&&u<o[g+1]){u=(u-b)/(o[g+1]-b),i=ci.interpolate(l[g],l[g+1],u,t);break}}else"function"===di(l)&&(i=l(u));h&&(p[f]=i)}return i},_=function(){return p={}};g(e);var w=function(e){var t=ci(b(e));return u&&t[u]?t[u]():t};return w.classes=function(e){if(null!=e){if("array"===di(e))s=e,i=[e[0],e[e.length-1]];else{var t=ci.analyze(i);s=0===e?[t.min,t.max]:ci.limits(t,"e",e)}return w}return s},w.domain=function(e){if(!arguments.length)return i;c=e[0],d=e[e.length-1],o=[];var t=l.length;if(e.length===t&&c!==d)for(var r=0,n=Array.from(e);r<n.length;r+=1){var a=n[r];o.push((a-c)/(d-c))}else{for(var s=0;s<t;s++)o.push(s/(t-1));if(e.length>2){var u=e.map((function(t,r){return r/(e.length-1)})),f=e.map((function(e){return(e-c)/(d-c)}));f.every((function(e,t){return u[t]===e}))||(v=function(e){if(e<=0||e>=1)return e;for(var t=0;e>=f[t+1];)t++;var r=(e-f[t])/(f[t+1]-f[t]);return u[t]+r*(u[t+1]-u[t])})}}return i=[c,d],w},w.mode=function(e){return arguments.length?(t=e,_(),w):t},w.range=function(e,t){return g(e),w},w.out=function(e){return u=e,w},w.spread=function(e){return arguments.length?(n=e,w):n},w.correctLightness=function(e){return null==e&&(e=!0),f=e,_(),y=f?function(e){for(var t=b(0,!0).lab()[0],r=b(1,!0).lab()[0],n=t>r,i=b(e,!0).lab()[0],o=t+(r-t)*e,a=i-o,s=0,l=1,u=20;Math.abs(a)>.01&&u-- >0;)n&&(a*=-1),a<0?(s=e,e+=.5*(l-e)):(l=e,e+=.5*(s-e)),a=(i=b(e,!0).lab()[0])-o;return e}:function(e){return e},w},w.padding=function(e){return null!=e?("number"===di(e)&&(e=[e,e]),a=e,w):a},w.colors=function(t,r){arguments.length<2&&(r="hex");var n=[];if(0===arguments.length)n=l.slice(0);else if(1===t)n=[w(.5)];else if(t>1){var o=i[0],a=i[1]-o;n=function(e,t,r){for(var n=[],i=e<t,o=r?i?t+1:t-1:t,a=e;i?a<o:a>o;i?a++:a--)n.push(a);return n}(0,t,!1).map((function(e){return w(o+e/(t-1)*a)}))}else{e=[];var u=[];if(s&&s.length>2)for(var c=1,d=s.length,f=1<=d;f?c<d:c>d;f?c++:c--)u.push(.5*(s[c-1]+s[c]));else u=i;n=u.map((function(e){return w(e)}))}return ci[r]&&(n=n.map((function(e){return e[r]()}))),n},w.cache=function(e){return null!=e?(h=e,w):h},w.gamma=function(e){return null!=e?(m=e,w):m},w.nodata=function(e){return null!=e?(r=ci(e),w):r},w};var hi=y,mi=pi,gi=b,yi=function(e,t,r){if(!yi[r])throw new Error("unknown blend mode "+r);return yi[r](e,t)},vi=function(e){return function(t,r){var n=gi(r).rgb(),i=gi(t).rgb();return gi.rgb(e(n,i))}},bi=function(e){return function(t,r){var n=[];return n[0]=e(t[0],r[0]),n[1]=e(t[1],r[1]),n[2]=e(t[2],r[2]),n}};yi.normal=vi(bi((function(e){return e}))),yi.multiply=vi(bi((function(e,t){return e*t/255}))),yi.screen=vi(bi((function(e,t){return 255*(1-(1-e/255)*(1-t/255))}))),yi.overlay=vi(bi((function(e,t){return t<128?2*e*t/255:255*(1-2*(1-e/255)*(1-t/255))}))),yi.darken=vi(bi((function(e,t){return e>t?t:e}))),yi.lighten=vi(bi((function(e,t){return e>t?e:t}))),yi.dodge=vi(bi((function(e,t){return 255===e||(e=t/255*255/(1-e/255))>255?255:e}))),yi.burn=vi(bi((function(e,t){return 255*(1-(1-t/255)/(e/255))})));for(var _i=yi,wi=c.type,xi=c.clip_rgb,Ai=c.TWOPI,ji=Math.pow,Si=Math.sin,ki=Math.cos,Ci=b,$i=y,Oi=Math.floor,Fi=Math.random,Ti=a,Di=Math.log,Ei=Math.pow,Pi=Math.floor,Ri=Math.abs,Ii=function(e,t){void 0===t&&(t=null);var r={min:Number.MAX_VALUE,max:-1*Number.MAX_VALUE,sum:0,values:[],count:0};return"object"===Ti(e)&&(e=Object.values(e)),e.forEach((function(e){t&&"object"===Ti(e)&&(e=e[t]),null==e||isNaN(e)||(r.values.push(e),r.sum+=e,e<r.min&&(r.min=e),e>r.max&&(r.max=e),r.count+=1)})),r.domain=[r.min,r.max],r.limits=function(e,t){return Mi(r,e,t)},r},Mi=function(e,t,r){void 0===t&&(t="equal"),void 0===r&&(r=7),"array"==Ti(e)&&(e=Ii(e));var n=e.min,i=e.max,o=e.values.sort((function(e,t){return e-t}));if(1===r)return[n,i];var a=[];if("c"===t.substr(0,1)&&(a.push(n),a.push(i)),"e"===t.substr(0,1)){a.push(n);for(var s=1;s<r;s++)a.push(n+s/r*(i-n));a.push(i)}else if("l"===t.substr(0,1)){if(n<=0)throw new Error("Logarithmic scales are only possible for values > 0");var l=Math.LOG10E*Di(n),u=Math.LOG10E*Di(i);a.push(n);for(var c=1;c<r;c++)a.push(Ei(10,l+c/r*(u-l)));a.push(i)}else if("q"===t.substr(0,1)){a.push(n);for(var d=1;d<r;d++){var f=(o.length-1)*d/r,p=Pi(f);if(p===f)a.push(o[p]);else{var h=f-p;a.push(o[p]*(1-h)+o[p+1]*h)}}a.push(i)}else if("k"===t.substr(0,1)){var m,g=o.length,y=new Array(g),v=new Array(r),b=!0,_=0,w=null;(w=[]).push(n);for(var x=1;x<r;x++)w.push(n+x/r*(i-n));for(w.push(i);b;){for(var A=0;A<r;A++)v[A]=0;for(var j=0;j<g;j++)for(var S=o[j],k=Number.MAX_VALUE,C=void 0,$=0;$<r;$++){var O=Ri(w[$]-S);O<k&&(k=O,C=$),v[C]++,y[j]=C}for(var F=new Array(r),T=0;T<r;T++)F[T]=null;for(var D=0;D<g;D++)null===F[m=y[D]]?F[m]=o[D]:F[m]+=o[D];for(var E=0;E<r;E++)F[E]*=1/v[E];b=!1;for(var P=0;P<r;P++)if(F[P]!==w[P]){b=!0;break}w=F,++_>200&&(b=!1)}for(var R={},I=0;I<r;I++)R[I]=[];for(var M=0;M<g;M++)R[m=y[M]].push(o[M]);for(var q=[],L=0;L<r;L++)q.push(R[L][0]),q.push(R[L][R[L].length-1]);q=q.sort((function(e,t){return e-t})),a.push(q[0]);for(var N=1;N<q.length;N+=2){var z=q[N];isNaN(z)||-1!==a.indexOf(z)||a.push(z)}}return a},qi={analyze:Ii,limits:Mi},Li=y,Ni=y,zi=Math.sqrt,Bi=Math.pow,Ui=Math.min,Vi=Math.max,Wi=Math.atan2,Gi=Math.abs,Yi=Math.cos,Hi=Math.sin,Ki=Math.exp,Xi=Math.PI,Zi=y,Ji=y,Qi=b,eo=pi,to={cool:function(){return eo([Qi.hsl(180,1,.9),Qi.hsl(250,.7,.4)])},hot:function(){return eo(["#000","#f00","#ff0","#fff"]).mode("rgb")}},ro={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},no=0,io=Object.keys(ro);no<io.length;no+=1){var oo=io[no];ro[oo.toLowerCase()]=ro[oo]}var ao=ro,so=b;return so.average=function(e,t,r){void 0===t&&(t="lrgb"),void 0===r&&(r=null);var n=e.length;r||(r=Array.from(new Array(n)).map((function(){return 1})));var i=n/r.reduce((function(e,t){return e+t}));if(r.forEach((function(e,t){r[t]*=i})),e=e.map((function(e){return new ti(e)})),"lrgb"===t)return ui(e,r);for(var o=e.shift(),a=o.get(t),s=[],l=0,u=0,c=0;c<a.length;c++)if(a[c]=(a[c]||0)*r[0],s.push(isNaN(a[c])?0:r[0]),"h"===t.charAt(c)&&!isNaN(a[c])){var d=a[c]/180*oi;l+=ai(d)*r[0],u+=si(d)*r[0]}var f=o.alpha()*r[0];e.forEach((function(e,n){var i=e.get(t);f+=e.alpha()*r[n+1];for(var o=0;o<a.length;o++)if(!isNaN(i[o]))if(s[o]+=r[n+1],"h"===t.charAt(o)){var c=i[o]/180*oi;l+=ai(c)*r[n+1],u+=si(c)*r[n+1]}else a[o]+=i[o]*r[n+1]}));for(var p=0;p<a.length;p++)if("h"===t.charAt(p)){for(var h=li(u/s[p],l/s[p])/oi*180;h<0;)h+=360;for(;h>=360;)h-=360;a[p]=h}else a[p]=a[p]/s[p];return f/=n,new ti(a,t).alpha(f>.99999?1:f,!0)},so.bezier=function(e){var t=function(e){var t,r,n,i,o,a,s;if(2===(e=e.map((function(e){return new hi(e)}))).length)t=e.map((function(e){return e.lab()})),o=t[0],a=t[1],i=function(e){var t=[0,1,2].map((function(t){return o[t]+e*(a[t]-o[t])}));return new hi(t,"lab")};else if(3===e.length)r=e.map((function(e){return e.lab()})),o=r[0],a=r[1],s=r[2],i=function(e){var t=[0,1,2].map((function(t){return(1-e)*(1-e)*o[t]+2*(1-e)*e*a[t]+e*e*s[t]}));return new hi(t,"lab")};else if(4===e.length){var l;n=e.map((function(e){return e.lab()})),o=n[0],a=n[1],s=n[2],l=n[3],i=function(e){var t=[0,1,2].map((function(t){return(1-e)*(1-e)*(1-e)*o[t]+3*(1-e)*(1-e)*e*a[t]+3*(1-e)*e*e*s[t]+e*e*e*l[t]}));return new hi(t,"lab")}}else{if(!(e.length>=5))throw new RangeError("No point in running bezier with only one color.");var u,c,d;u=e.map((function(e){return e.lab()})),d=e.length-1,c=function(e){for(var t=[1,1],r=1;r<e;r++){for(var n=[1],i=1;i<=t.length;i++)n[i]=(t[i]||0)+t[i-1];t=n}return t}(d),i=function(e){var t=1-e,r=[0,1,2].map((function(r){return u.reduce((function(n,i,o){return n+c[o]*Math.pow(t,d-o)*Math.pow(e,o)*i[r]}),0)}));return new hi(r,"lab")}}return i}(e);return t.scale=function(){return mi(t)},t},so.blend=_i,so.cubehelix=function(e,t,r,n,i){void 0===e&&(e=300),void 0===t&&(t=-1.5),void 0===r&&(r=1),void 0===n&&(n=1),void 0===i&&(i=[0,1]);var o,a=0;"array"===wi(i)?o=i[1]-i[0]:(o=0,i=[i,i]);var s=function(s){var l=Ai*((e+120)/360+t*s),u=ji(i[0]+o*s,n),c=(0!==a?r[0]+s*a:r)*u*(1-u)/2,d=ki(l),f=Si(l);return Ci(xi([255*(u+c*(-.14861*d+1.78277*f)),255*(u+c*(-.29227*d-.90649*f)),255*(u+c*(1.97294*d)),1]))};return s.start=function(t){return null==t?e:(e=t,s)},s.rotations=function(e){return null==e?t:(t=e,s)},s.gamma=function(e){return null==e?n:(n=e,s)},s.hue=function(e){return null==e?r:("array"===wi(r=e)?0==(a=r[1]-r[0])&&(r=r[1]):a=0,s)},s.lightness=function(e){return null==e?i:("array"===wi(e)?(i=e,o=e[1]-e[0]):(i=[e,e],o=0),s)},s.scale=function(){return Ci.scale(s)},s.hue(r),s},so.mix=so.interpolate=Tn,so.random=function(){for(var e="#",t=0;t<6;t++)e+="0123456789abcdef".charAt(Oi(16*Fi()));return new $i(e,"hex")},so.scale=pi,so.analyze=qi.analyze,so.contrast=function(e,t){e=new Li(e),t=new Li(t);var r=e.luminance(),n=t.luminance();return r>n?(r+.05)/(n+.05):(n+.05)/(r+.05)},so.deltaE=function(e,t,r,n,i){void 0===r&&(r=1),void 0===n&&(n=1),void 0===i&&(i=1);var o=function(e){return 360*e/(2*Xi)},a=function(e){return 2*Xi*e/360};e=new Ni(e),t=new Ni(t);var s=Array.from(e.lab()),l=s[0],u=s[1],c=s[2],d=Array.from(t.lab()),f=d[0],p=d[1],h=d[2],m=(l+f)/2,g=(zi(Bi(u,2)+Bi(c,2))+zi(Bi(p,2)+Bi(h,2)))/2,y=.5*(1-zi(Bi(g,7)/(Bi(g,7)+Bi(25,7)))),v=u*(1+y),b=p*(1+y),_=zi(Bi(v,2)+Bi(c,2)),w=zi(Bi(b,2)+Bi(h,2)),x=(_+w)/2,A=o(Wi(c,v)),j=o(Wi(h,b)),S=A>=0?A:A+360,k=j>=0?j:j+360,C=Gi(S-k)>180?(S+k+360)/2:(S+k)/2,$=1-.17*Yi(a(C-30))+.24*Yi(a(2*C))+.32*Yi(a(3*C+6))-.2*Yi(a(4*C-63)),O=k-S;O=Gi(O)<=180?O:k<=S?O+360:O-360,O=2*zi(_*w)*Hi(a(O)/2);var F=f-l,T=w-_,D=1+.015*Bi(m-50,2)/zi(20+Bi(m-50,2)),E=1+.045*x,P=1+.015*x*$,R=30*Ki(-Bi((C-275)/25,2)),I=-2*zi(Bi(x,7)/(Bi(x,7)+Bi(25,7)))*Hi(2*a(R)),M=zi(Bi(F/(r*D),2)+Bi(T/(n*E),2)+Bi(O/(i*P),2)+I*(T/(n*E))*(O/(i*P)));return Vi(0,Ui(100,M))},so.distance=function(e,t,r){void 0===r&&(r="lab"),e=new Zi(e),t=new Zi(t);var n=e.get(r),i=t.get(r),o=0;for(var a in n){var s=(n[a]||0)-(i[a]||0);o+=s*s}return Math.sqrt(o)},so.limits=qi.limits,so.valid=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];try{return new(Function.prototype.bind.apply(Ji,[null].concat(e))),!0}catch(e){return!1}},so.scales=to,so.colors=dr,so.brewer=ao,so}()}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n={};(()=>{r.d(n,{D:()=>vn});var e=r(635);const t=(r,n)=>(0,e.mergeWith)({},r,n,((r,n)=>(0,e.isArray)(n)?n:(0,e.isObject)(r)&&(0,e.isObject)(n)?t(r,n):n)),i={month:{publicName:"Monthly",dateFormat:"MMMM YYYY"},year:{publicName:"Yearly",dateFormat:"YYYY"},quarter:{publicName:"Per quarter",dateFormat:"quarter"},week:{publicName:"Weekly",dateFormat:"week"},day:{publicName:"Daily",dateFormat:"DD-MM-YYYY"},second:{publicName:"Per second",dateFormat:"hh:mm:ss"},hour:{publicName:"Hourly",dateFormat:"hh:mm"},minute:{publicName:"Per minute",dateFormat:"hh:mm"}},o=t=>{const r=(0,e.cloneDeep)(i);if(!t)return r;let n={};return t.forEach((e=>{if(!i[e])throw`Time trunc function ${e} not managed by Vizzly`;n[e]=i[e]})),n},a={">":{publicName:"Greater than",validDataTypes:["number","date_time"]},"<":{publicName:"Less than",validDataTypes:["number","date_time"]},"<=":{publicName:"Less than or equal to",validDataTypes:["number","date_time"]},">=":{publicName:"Greater than or equal to",validDataTypes:["number","date_time"]},"!=":{publicName:"Not equal to",validDataTypes:["number","date_time","boolean","string"]},is_one_of:{publicName:"Is one of",validDataTypes:["number","date_time","boolean","string"]},"=":{publicName:"Equal to",validDataTypes:["number","date_time","boolean","string"]},is_not_one_of:{publicName:"Is not one of",validDataTypes:["number","date_time","boolean","string"]},starts_with:{publicName:"Starts with",validDataTypes:["string"]},ends_with:{publicName:"Ends with",validDataTypes:["string"]},contains_substring:{publicName:"Contains text",validDataTypes:["string"]},does_not_contain_substring:{publicName:"Does not contain text",validDataTypes:["string"]},array_contains:{publicName:"Contains",validDataTypes:["string[]"]}},s=t=>{const r=(0,e.cloneDeep)(a);if(!t)return r;let n={};return t.forEach((e=>{if(!a[e])throw`Operator ${e} not managed by Vizzly`;n[e]=a[e]})),n},l=t=>t.map((t=>t.map((t=>"is_one_of"!=t.op&&"is_not_one_of"!=t.op||(0,e.isArray)(t.value)?t:Object.assign(Object.assign({},t),{value:[t.value]}))))),u=(e,t)=>e.map((e=>{let r=Object.assign(Object.assign({},e),{aggregate:void 0,function:e.function||e.aggregate});return delete r.aggregate,t&&r.field==t.field&&"none"==r.function&&(r.function=t.truncate),r})),c=e=>e.map((e=>{let t=Object.assign(Object.assign({},e),{aggregate:void 0,function:e.function||e.aggregate});return delete t.aggregate,t})),d=e=>"auto"===e||0===e||2===e?e:"auto",f=t=>{if(!t)return{};let r={};return t.measure&&Object.entries(t.measure).forEach((([e,t])=>{r&&(r[e]=c(t))})),{measure:(0,e.isEmpty)(r)?void 0:r,group:t.group}},p={mean:{publicName:"Mean",validDataTypes:["number"]},sum:{publicName:"Sum",validDataTypes:["number"]},min:{publicName:"Min",validDataTypes:["number"]},max:{publicName:"Max",validDataTypes:["number"]},count:{publicName:"Count",validDataTypes:["string","number","boolean","date_time","string[]"]},countDistinct:{publicName:"Unique",validDataTypes:["string","number","boolean","date_time"]}},h=t=>{const r=(0,e.cloneDeep)(p);if(!t)return r;let n={};return t.forEach((e=>{if(!p[e])throw`Aggregate ${e} not managed by Vizzly`;n[e]=p[e]})),n},m=["debug","info","warning","error"];const g=e=>m.findIndex((e=>"error"==e))<=m.findIndex((t=>e==t)),y=t=>t instanceof Error?t:(0,e.isObject)(t)||(0,e.isArray)(t)?JSON.stringify(t):t,v=(...e)=>{g("debug")&&console.info("[VIZZLY DEBUG]",...e.map(y))},b=(...e)=>{g("error")&&console.error("[VIZZLY ERROR]",...e.map(y))},_=(Object.keys(h()),(e,t)=>w(e,t)[0]),w=(e,t)=>{var r;let n=null!==(r=e.supportedAggregateOptions)&&void 0!==r?r:[],i=n.filter((r=>Object.keys(t).includes(r)&&t[r].validDataTypes.includes(e.dataType)));return 0===i.length?i=Object.keys(t).filter((r=>t[r].validDataTypes.includes(e.dataType))):i.sort(((e,t)=>n.indexOf(e)-n.indexOf(t))),i},x=(e,t)=>{const r=e.split("_"),n=r.pop();return[void 0,...Object.keys(t.supportedAggregates||{}),...Object.keys(t.supportedTimeTruncFunctions||{}),...Object.keys(t.supportedTransformationFunctions||{})].includes(n)?{field:r.join("_"),function:null!=n?n:""}:{field:e,function:"none"}},A=e=>e.map((e=>"string"==typeof e?{field:e,function:"none"}:e)),j={round_to_0_dp:{publicName:"Round to 0dp",validDataTypes:["number"]},round_to_2_dp:{publicName:"Round to 2dp",validDataTypes:["number"]}},S=t=>{const r=(0,e.cloneDeep)(j);if(!t)return r;let n={};return t.forEach((e=>{if(!j[e])throw`Transformation function ${e} is not managed by Vizzly`;n[e]=j[e]})),n},k=e=>(null==e?void 0:e.function)&&"none"!=(null==e?void 0:e.function)?`${e.field}_${e.function}`:null==e?void 0:e.field,C=x,$=(e,t,r)=>{if("measure"in e&&e.measure){const n=function(e,t){return Object.keys(e).map((e=>{const r=C(e,t);return(null==r?void 0:r.function)?r:null})).find((e=>null!==e))}(e.measure,r);if((null==n?void 0:n.function)&&n.field===t){const t=k(n);delete e.measure[t]}e.measure=O(e.measure,t)}if("group"in e&&e.group){const i=function(e,t){return Object.keys(e).map((e=>{const r=((e,t)=>{const r=e.split("_"),n=r.pop();return n&&(i=t,o=n,![...Object.keys(i),"none"].includes(o))?null:{field:r.join("_"),truncate:null!=n?n:""};var i,o})(e,t.supportedTimeTruncFunctions);return(null==r?void 0:r.truncate)?r:null})).find((e=>null!==e))}(e.group,r);if((null==i?void 0:i.truncate)&&i.field===t){const t=(null==(n=i)?void 0:n.truncate)&&"none"!=(null==n?void 0:n.truncate)?`${n.field}_${n.truncate}`:null==n?void 0:n.field;delete e.group[t]}else e.group.hasOwnProperty(t)&&delete e.group[t];e.group=O(e.group,t)}var n;return e};function O(e,t){const r={};for(const[n,i]of Object.entries(e))r[n]=i.filter((e=>(null==e?void 0:e.field)!==t));return r}const F=(t,r)=>{let n=(0,e.remove)(t.order,(t=>(0,e.some)(r,(e=>{const r=e.function==t.function,n=e.field==t.field;return r&&n}))));return Object.assign(Object.assign({},t),{order:n})},T=(t,r,n)=>{var i,o,a;let s=Object.assign({},t);if("measure"in s&&(0,e.remove)(s.measure,(e=>e.field==r)),"barMeasure"in s&&(0,e.remove)(s.barMeasure,(e=>e.field==r)),"lineMeasure"in s&&(0,e.remove)(s.lineMeasure,(e=>e.field==r)),"xMeasure"in s&&(null===(i=s.yMeasure)||void 0===i?void 0:i.field)==r&&(s.xMeasure=null),"yMeasure"in s&&(null===(o=s.yMeasure)||void 0===o?void 0:o.field)==r&&(s.yMeasure=null),"order"in s&&(0,e.remove)(s.order,(e=>e.field==r)),"dimension"in s&&(0,e.remove)(s.dimension,(e=>e.field==r)),"barDimension"in s&&(0,e.remove)(s.barDimension,(e=>e.field==r)),"lineDimension"in s&&(0,e.remove)(s.lineDimension,(e=>e.field==r)),"filter"in s&&s.filter.forEach((t=>{(0,e.remove)(t,(e=>e.field==r))})),"parameters"in s&&s.parameters&&n){const e=$(s.parameters,r,n);s.parameters=e}return"timeDimension"in s&&(null===(a=s.timeDimension)||void 0===a?void 0:a.field)==r&&(s.timeDimension=null),s},D=e=>{let t=[...e.measure];return e.dimension.forEach((e=>{t.push({field:e.field,function:e.function})})),e.timeDimension&&t.push({field:e.timeDimension.field,function:e.timeDimension.truncate}),F(e,t)},E=(e,r,n)=>{let i=t(e,r);const{value:o,error:a}=n.validate(i);if(a)throw a;return o};var P=r(903),R=r.n(P);R().object({fieldId:R().string().required(),dataSetId:R().string().required()});const I=e=>R().object({field:R().string().required(),function:R().valid(...Object.keys(e),"none")}),M=e=>R().object({field:R().string().required(),direction:R().string().valid("asc","desc").required(),function:R().string().valid(...Object.keys(e.supportedAggregates),...Object.keys(e.supportedTimeTruncFunctions),"none")}),q=e=>R().object({field:R().string().required(),truncate:R().valid(...Object.keys(e)),bucketFill:R().boolean()}),L=e=>R().array().items(R().object({field:R().string(),pivot:R().allow("x","y").optional(),function:R().valid("none",...Object.keys(e))})),N=e=>R().object({field:R().string().required(),op:R().string().valid(...Object.keys(e.supportedOperators)),value:R().any().required(),function:R().string()}),z=e=>R().array().items(R().array().items(N(e))),B=()=>R().number(),U={viewId:R().string().allow("").optional(),displayTitle:R().string().allow(""),displaySubject:R().string().allow(""),dataSetId:R().string(),protectedByOrganisation:R().boolean().optional()},V=R().valid("auto",2,0),W=e=>({measure:R().array().items(I(e.supportedAggregates)).required(),dimension:L(e.supportedTimeTruncFunctions).required(),drilldown:R().alternatives(L(e.supportedTimeTruncFunctions).required(),R().string()),order:R().array().items(M(e)),timeDimension:R().alternatives(q(e.supportedTimeTruncFunctions),R().valid(null)).required(),limit:B(),offset:R().number().min(0),filter:R().array().items(R().array().items(N(e))),xAxisPrefix:R().string().allow(""),yAxisPrefix:R().string().allow(""),xAxisPostfix:R().string().allow(""),yAxisPostfix:R().string().allow(""),yAxisFormat:R().alternatives(R().string(),R().valid(null)),xAxisFormat:R().alternatives(R().string(),R().valid(null)),approxYAxisLabelCount:V,approxXAxisLabelCount:V}),G=R().string().valid("natural","straight","step","stepBefore","stepAfter"),Y=()=>R().array().items(R().object({function:R().string().required(),field:R().string().required()})),H=()=>R().array().items(R().object({function:R().string(),truncate:R().string(),field:R().string().required(),bucketFill:R().boolean().optional(),pivot:R().string().valid("x","y").optional()})),K=e=>R().object().pattern(R().string(),R().alternatives().try(R().array().items(q(e.supportedTimeTruncFunctions)).min(1),L(e.supportedTimeTruncFunctions))).unknown(!0),X=e=>R().object().pattern(R().string(),R().array().items(I(e.supportedAggregates)).min(1)).unknown(!0),Z=e=>R().object({measure:X(e),group:K(e)}),J=()=>R().array().items(R().object({color:R().string().required(),value:R().number().required(),strokeWidth:R().number().required(),strokeStyle:R().string().valid("dashed","solid").required(),label:R().boolean().optional()})),Q=()=>R().object({x:R().string().allow(""),y:R().string().allow("")}),ee=R().object().pattern(R().string(),R().object({width:R().number().min(0),height:R().number().min(0)})),te=e=>R().object({filters:R().array().items(R().array().items(N(e)).required().max(1)).required().max(1),ruleValue:R().string().allow("").required(),ruleValueEnd:R().string().allow(""),ruleType:R().valid("backgroundColor","fontColor","lineColor","areaColor").required()}),re=R().object({field:R().string().required(),prefix:R().string().required()}),ne=e=>R().object(Object.assign(Object.assign(Object.assign({},U),W(e.queryEngineConfig)),{stacked:R().valid(!0,!1,"100%"),legend:R().valid(!0,!1),type:R().valid("barChart","horizontalBarChart"),conditionalFormattingRules:R().array().items(te(e.queryEngineConfig)),protectedFields:R().object({dimension:H(),measure:Y()}).unknown(!0),parameters:Z(e.queryEngineConfig),goalLines:J(),axisTitles:Q()})),ie=e=>(t,r)=>{let n=E(t,r,ne(e));return n=D(n),n};class oe extends Error{constructor(e){super(e),this.name="ValidationError"}}const ae=oe;class se extends ae{constructor(e){super(`Corrupt view. ${e.message}.\n\n ${JSON.stringify(e)}\n `),this.name="CorruptedView"}}r(455);const le=e=>"numeratorFilter"in e,ue=e=>"leftFieldId"in e&&"operator"in e&&"rightFieldId"in e,ce=e=>"roundToDecimalPlaces"in e,de=e=>"leftFieldId"in e&&"leftFunction"in e&&"operator"in e&&"rightFieldId"in e&&"rightFunction"in e,fe=e=>"denominatorFieldId"in e&&"denominatorAggregate"in e&&"numeratorFieldId"in e&&"numeratorAggregate"in e,pe=e=>"rules"in e,he=e=>{if("numeratorFilter"in e&&"numeratorFieldId"in e)return{id:e.id,canBeDimension:e.canBeDimension,canBeMeasure:e.canBeMeasure,denominatorAggregate:e.numeratorAggregate,denominatorFieldId:e.numeratorFieldId,publicName:e.publicName,dataType:e.dataType,allowedOperators:e.allowedOperators,numeratorFilter:e.numeratorFilter};if("leftAggregate"in e||"rightAggregate"in e){let t=Object.assign(Object.assign({},e),{rightFunction:e.rightFunction||e.rightAggregate,leftFunction:e.leftFunction||e.leftAggregate,leftNested:e.leftNested?Object.assign(Object.assign({},e.leftNested),{aggregate:void 0,function:e.leftNested.function||e.leftNested.aggregate}):void 0,rightNested:e.rightNested?Object.assign(Object.assign({},e.rightNested),{aggregate:void 0,function:e.rightNested.function||e.rightNested.aggregate}):void 0});return delete t.leftAggregate,delete t.rightAggregate,t.rightNested&&delete t.rightNested.aggregate,t.leftNested&&delete t.leftNested.aggregate,t}return e},me=e=>R().alternatives((e=>R().object({type:R().valid("function").required(),value:R().link("#Measure"),function:R().valid("none",...Object.keys(e.supportedAggregates))}))(e),R().object({type:R().valid("maths").required(),left:R().link("#Measure"),right:R().link("#Measure").required(),op:R().string().valid("+","*","/","-").required()}),R().object({type:R().valid("subquery").required(),value:R().object({measure:R().array().items(R().link("#Measure")),filter:R().array().items(R().array().items(R().link("#Filter")))})}),(e=>R().object({type:R().valid("field").required(),value:R().string().required(),function:R().valid("none",...Object.keys(e.supportedAggregates),...Object.keys(e.supportedTimeTruncFunctions),...Object.keys(e.supportedTransformationFunctions)).required()}))(e),R().object({type:"number",value:R().number()}),R().object({type:R().valid("switchField").required(),value:R().object({cases:R().array().items(R().object({returns:R().object({type:R().valid("string").required(),value:R().string().allow("").required()}),filter:R().array().items(R().array().items(R().link("#Filter")))}))})})).id("Measure"),ge=R().object({index:R().number().required()}),ye=R().object({index:R().number().required(),direction:R().string().valid("asc","desc").required()}),ve=(e,t)=>{let r=[R().valid(null)];return t.forEach((e=>{"boolean"==e&&(r=[...r,R().boolean()]),"string"!=e&&"string[]"!=e||(r=[...r,R().string()]),"number"==e&&(r=[...r,R().number()]),"date_time"==e&&(r=[...r,R().date().iso()])})),"is_one_of"==e||"is_not_one_of"==e?R().array().items(R().alternatives(r)):R().alternatives(r)},be=e=>R().object({field:me(e),op:R().string().valid(...Object.keys(e.supportedOperators)),value:R().alternatives().conditional("op",Object.keys(e.supportedOperators).map((t=>({is:t,then:ve(t,e.supportedOperators[t].validDataTypes)}))))}).id("Filter"),_e=e=>{const t=be(e);return R().object({type:R().valid("preparedQuery").required(),preparedQueryType:R().valid("uniqueArrayValues").required(),dataSetId:R().string().required(),fieldId:R().string().required(),filter:R().array().items(R().array().items(t))})},we=e=>{const t=be(e),r=me(e);return R().alternatives().conditional(".type",{is:"query",then:R().object({type:R().valid("query"),dataSetId:R().string().required(),measure:R().array().items(r).min(1).required(),group:R().array().items(ge).required(),filter:R().array().items(R().array().items(t)).required(),order:R().array().items(ye).required(),limit:B(),offset:R().number().optional()}).shared(t).shared(r)}).conditional(".type",{is:"preparedQuery",then:_e(e)})};we({origin:"query-engine",supportedFeatures:["simpleMaths","aggregateMaths","subquery","configManagerUi","switchField","roundedNumbers","sqlDefinedDataSet","encryptedDashboards"],supportedTimeTruncFunctions:o(["month","year","quarter","week","day","hour","minute","second"]),supportedAggregates:h(["sum","mean","min","max","count","countDistinct"]),supportedOperators:s([">","<","=","!=",">=","<=","is_one_of","is_not_one_of","starts_with","ends_with","contains_substring","does_not_contain_substring"]),supportedTransformationFunctions:S(["round_to_0_dp","round_to_2_dp"])}),we({origin:"query-engine",supportedFeatures:["simpleMaths","aggregateMaths","subquery","configManagerUi","sqlDefinedDataSet","roundedNumbers","switchField","encryptedDashboards"],supportedTimeTruncFunctions:o(["month","year","quarter","week","day","hour","minute","second"]),supportedAggregates:h(["sum","mean","min","max","count","countDistinct"]),supportedOperators:s([">","<","=","!=",">=","<=","is_one_of","is_not_one_of","starts_with","ends_with","contains_substring","does_not_contain_substring"]),supportedTransformationFunctions:S(["round_to_0_dp","round_to_2_dp"])}),we({origin:"query-engine",supportedFeatures:["simpleMaths","subquery","configManagerUi","switchField","sqlDefinedDataSet","roundedNumbers","aggregateMaths","encryptedDashboards"],supportedTimeTruncFunctions:o(["month","year","day","hour","minute","second"]),supportedAggregates:h(["sum","mean","min","max","count","countDistinct"]),supportedOperators:s([">","<","=","!=",">=","<=","is_one_of","is_not_one_of","starts_with","ends_with","contains_substring","does_not_contain_substring"]),supportedTransformationFunctions:S(["round_to_0_dp","round_to_2_dp"])}),we({origin:"query-engine",supportedFeatures:["simpleMaths","subquery","configManagerUi","roundedNumbers","aggregateMaths","encryptedDashboards"],supportedTimeTruncFunctions:o(["month","year","day","hour","minute","second"]),supportedAggregates:h(["sum","mean","min","max","count","countDistinct"]),supportedOperators:s([">","<","=","!=",">=","<=","is_one_of","is_not_one_of","starts_with","ends_with","contains_substring","does_not_contain_substring"]),supportedTransformationFunctions:S(["round_to_0_dp","round_to_2_dp"])}),we({origin:"query-engine",supportedFeatures:["simpleMaths","aggregateMaths","subquery","configManagerUi","sqlDefinedDataSet","roundedNumbers","switchField","encryptedDashboards"],supportedTimeTruncFunctions:o(["month","year","quarter","week","day","hour","minute","second"]),supportedAggregates:h(["sum","mean","min","max","count","countDistinct"]),supportedOperators:s([">","<","=","!=",">=","<=","is_one_of","is_not_one_of","starts_with","ends_with","contains_substring","does_not_contain_substring","array_contains"]),supportedTransformationFunctions:S(["round_to_0_dp","round_to_2_dp"])});class xe extends ae{constructor(e,t){super(`\n An expected field is missing from a dataSet.\n\n Missing '${t}'. Got;\n ${JSON.stringify(e)}\n `),this.name="FieldNotFoundInDataSet",this.missingFieldId=t}getMissingFieldId(){return this.missingFieldId}}function Ae(t,r){let n=[...t];return(null==r?void 0:r.onlyFieldTypes)&&!(0,e.isEmpty)(r.onlyFieldTypes)&&(n=[...n].filter((e=>{var t;return null===(t=null==r?void 0:r.onlyFieldTypes)||void 0===t?void 0:t.includes(e.dataType)}))),(null==r?void 0:r.forComponent)&&(n=((e,t)=>{const r=Ct(t);return[...e].filter((e=>{let t=!0;return le(e)&&!r.supportedCustomFields.conditionalPercentage&&(t=!1),fe(e)&&!r.supportedCustomFields.simplePercentage&&(t=!1),ue(e)&&!r.supportedCustomFields.simpleMaths&&(t=!1),pe(e)&&!r.supportedCustomFields.rules&&(t=!1),ce(e)&&!r.supportedCustomFields.roundedNumbers&&(t=!1),t}))})(n,r.forComponent)),(null==r?void 0:r.removeConditionalPercentage)&&(n=n.filter((e=>!le(e)))),(null==r?void 0:r.removeSimplePercentage)&&(n=n.filter((e=>!fe(e)))),(null==r?void 0:r.removeRuleGrouping)&&(n=n.filter((e=>!pe(e)))),(null==r?void 0:r.removeSimpleMaths)&&(n=n.filter((e=>!ue(e)))),(null==r?void 0:r.removeAggregateMaths)&&(n=n.filter((e=>!de(e)))),(null==r?void 0:r.onlyDimensions)&&(n=n.filter((e=>e.canBeDimension))),(null==r?void 0:r.onlyMeasures)&&(n=n.filter((e=>e.canBeMeasure))),n}const je=(e,t)=>{let r=[...e.fields].find((e=>e.id==t));if(r)return r;throw new xe(e,t)},Se=(e,t)=>[...Ae(e.fields,{onlyFieldTypes:["number","string","boolean"],onlyMeasures:!0,forComponent:t})],ke=e=>Object.assign(Object.assign({},e),{fields:[...e.fields].filter((e=>!(e=>le(e)||ue(e)||de(e)||fe(e)||pe(e)||ce(e))(e)))}),Ce=(e,t,r)=>{const n="horizontalBarChart"===r?void 0:"x",i=(e=>[...Ae(e.fields,{onlyFieldTypes:["boolean","number","string"],onlyDimensions:!0,removeConditionalPercentage:!0,removeSimplePercentage:!0,removeSimpleMaths:!0,removeAggregateMaths:!0})])(e)[0],o=[...Se(e,r)].map((e=>{const r=_(e,t.supportedAggregates);return{field:e.id,function:r}}));return{dataSetId:e.id,measure:o,order:[],timeDimension:null,filter:[],dimension:[{field:i.id,function:"none",pivot:n}]}},$e=(e,t)=>t?(e=e.map(ke),[...[...e].map((e=>{const r=(t[e.id]||[]).map(he);return Object.assign(Object.assign({},e),{fields:[...e.fields,...r]})}))]):e;class Oe extends ae{constructor(e,t){super(`\n An expected data set is missing from the dashboard.\n\n Missing '${t}'. Got;\n ${JSON.stringify([...e].map((e=>e.id)))}\n `),this.name="DataSetNotFound"}}const Fe={allowUnknown:!0,stripUnknown:!0},Te=(e,t,r)=>{const{error:n}=Ct(e.type,{queryEngineConfig:r}).schema.validate(e,Fe);if(n)return[new se(n)];const i=((e,t)=>e.find((e=>e.id==t))||null)(t,e.dataSetId);if(!i)return[new Oe(t,e.dataSetId)];const o=(e=>{let t=[];return(e=>{let t=[];return"measure"in e&&e.measure&&(t=[...t,...e.measure]),"xMeasure"in e&&e.xMeasure&&(t=[...t,e.xMeasure]),"yMeasure"in e&&e.yMeasure&&(t=[...t,e.yMeasure]),t})(e).forEach((e=>{t=[...t,e.field]})),(e=>{let t=[];return"dimension"in e&&e.dimension&&(t=[...t,...e.dimension]),"lineDimension"in e&&e.lineDimension&&(t=[...t,...e.lineDimension]),"barDimension"in e&&e.barDimension&&(t=[...t,...e.barDimension]),t})(e).forEach((e=>{t=[...t,e.field]})),"order"in e&&e.order&&(t=[...t,...[...e.order].map((e=>e.field))]),"timeDimension"in e&&e.timeDimension&&(t=[...t,e.timeDimension.field]),t})(e);try{o.forEach((e=>{je(i,e)}))}catch(e){if(e instanceof xe)return[e];throw e}return[]},De=e=>{return!!(e=>{var t;return"comboChart"===e.type?!!e.timeDimension||!!(e.barDimension.length>0&&e.lineDimension.length>0):"barChart"!==e.type&&"lineChart"!==e.type&&"areaChart"!==e.type&&"horizontalBarChart"!==e.type&&"scatterChart"!==e.type&&"pieChart"!==e.type||!!e.timeDimension||!(null==e?void 0:e.dimension)||0!==(null===(t=null==e?void 0:e.dimension)||void 0===t?void 0:t.length)})(e)||("barChart"===(t=e).type?"The Column Chart needs to have a grouping or a time to display correctly.":"lineChart"===t.type?"The Line Chart needs to have a grouping or a time to display correctly.":"areaChart"===t.type?"The Area Chart needs to have a grouping or a time to display correctly.":"horizontalBarChart"===t.type?"The Horizontal Bar Chart needs to have a grouping or a time to display correctly.":"comboChart"===t.type?"The Combo Chart needs to have a grouping (Bar and Line), or have time set to display correctly.":"scatterChart"===t.type?"The Scatter Chart needs to have a grouping to display correctly.":"pieChart"===t.type?"The Pie Chart needs to have a grouping to display correctly.":null);var t};var Ee,Pe=new Uint8Array(16);function Re(){if(!Ee&&!(Ee="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ee(Pe)}const Ie=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var Me=[],qe=0;qe<256;++qe)Me.push((qe+256).toString(16).substr(1));const Le=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(Me[e[t+0]]+Me[e[t+1]]+Me[e[t+2]]+Me[e[t+3]]+"-"+Me[e[t+4]]+Me[e[t+5]]+"-"+Me[e[t+6]]+Me[e[t+7]]+"-"+Me[e[t+8]]+Me[e[t+9]]+"-"+Me[e[t+10]]+Me[e[t+11]]+Me[e[t+12]]+Me[e[t+13]]+Me[e[t+14]]+Me[e[t+15]]).toLowerCase();if(!function(e){return"string"==typeof e&&Ie.test(e)}(r))throw TypeError("Stringified UUID is invalid");return r},Ne=function(e,t,r){var n=(e=e||{}).random||(e.rng||Re)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var i=0;i<16;++i)t[r+i]=n[i];return t}return Le(n)};const ze=e=>e||`view_${Ne()}`;function Be(e){const t=e,{parentDimension:r}=t;return function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}(t,["parentDimension"])}const Ue=(t,r,n)=>{let i=(0,e.cloneDeep)(Ae(r.fields,{onlyFieldTypes:["boolean","string"]})),o=(0,e.cloneDeep)(Ae(r.fields,{onlyFieldTypes:["date_time"]})),a=(0,e.cloneDeep)(Ae(r.fields,{onlyFieldTypes:["number"]})),s=null;return o[0]&&(s={field:o[0].id,truncate:"allowedGranularities"in o[0]?o[0].allowedGranularities[0]:"none"}),n(t,{protectedByOrganisation:!0,dimension:i.map((e=>({field:e.id,function:"none"}))),measure:[...a].map((e=>({function:"none",field:e.id}))),order:[],timeDimension:s})},Ve=(t,r)=>{let n=null,i=(0,e.cloneDeep)(t);return i.forEach((e=>{const t=je(r,e.field);"date_time"==t.dataType&&(n={field:t.id,truncate:e.function})})),i=i.filter((e=>"date_time"!=je(r,e.field).dataType)),{timeDimension:n,dimension:i}},We=e=>{let t=[...e.dimension];return"timeDimension"in e&&e.timeDimension&&(t=[{field:e.timeDimension.field,function:e.timeDimension.truncate},...t]),t},Ge=t=>{if(!t)return;let r=(0,e.cloneDeep)(t);return r.measure=c(t.measure||[]),r},Ye=(t,r)=>{let n=[];return(0,e.isEmpty)(r)||void 0===r?[]:(null==r||r.map((e=>{if((null==e?void 0:e.ruleType)&&(null==e?void 0:e.ruleValue)){let r=[];const i="field"in e&&"string"==typeof e.field&&"operator"in e&&"string"==typeof e.operator&&"value"in e;if(null==e?void 0:e.filters){const n=e.filters.map((e=>e.map((e=>He(e,t)))));r.push(...n)}else i&&r.push([He({field:e.field,op:e.operator,value:e.value},t)]);n.push({filters:r,ruleValueEnd:null==e?void 0:e.ruleValueEnd,ruleValue:e.ruleValue,ruleType:e.ruleType})}})),n)},He=(e,t)=>{if(e.function)return e;const r=x(e.field,t);return{field:r.field,op:e.op,value:e.value,function:r.function}},Ke=e=>({title:"Column chart",dump:e=>e,load:t=>Object.assign(Object.assign({},t),{measure:c(t.measure),order:u(t.order,t.timeDimension),filter:l(t.filter),protectedFields:Ge(t.protectedFields),viewId:ze(t.viewId),dimension:A(t.dimension),approxXAxisLabelCount:d(t.approxXAxisLabelCount),approxYAxisLabelCount:d(t.approxYAxisLabelCount),parameters:f(t.parameters),conditionalFormattingRules:Ye(e.queryEngineConfig,t.conditionalFormattingRules)}),setAttributes:ie(e),validate:(t,r)=>Te(t,r,e.queryEngineConfig),init:(e,t)=>Object.assign({type:"barChart",measure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",viewId:ze(null==t?void 0:t.viewId),filter:[],order:[],stacked:void 0,dataSetId:e,limit:5e3,conditionalFormattingRules:[],protectedByOrganisation:void 0,protectedFields:void 0,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,drilldown:[],legend:!0,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",parameters:{},goalLines:void 0,axisTitles:void 0},t),createFeedback:De,schema:ne(e),removeField:(t,r)=>T(t,r,e.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(t){const{measure:r,dimension:n}=Ce(t,e.queryEngineConfig,"barChart");return this.init(t.id,{measure:[r[0]],dimension:n})},dataPanelConfig:()=>[{type:"dataSet",title:"Data set",description:"What data do you want to use in this bar chart?"},{type:"views",title:"View",description:""},{type:"fieldCollector",title:"Metric - Y Axis",description:"What do you want each bar to measure?",fieldFilterOptions:{forComponent:"barChart",onlyMeasures:!0},callToAction:"Add metric",preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},{type:"drilldown",title:"Drilldown",description:"After clicking on a segment of this bar chart, what information do you want to see next?"},{type:"fieldCollector",title:"Grouping - X Axis",description:"What do you want each bar to represent? An example might be a `product category` field to represent each category as a bar.",fieldFilterOptions:{forComponent:"barChart",onlyDimensions:!0},preventDuplicates:!0,callToAction:"Add grouping",preSetPartialAttributes:(e,t)=>Ve(e,t),getValues:e=>We(e),maxAllowed:2,testId:"add-dimension"},{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},{type:"filter",title:"Filters",description:"Only include the information you want to use in this bar chart."},{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this bar chart."}],formatPanelConfig:()=>[{type:"heading",title:"Heading",description:"",subSection:[{type:"title",title:"Title",description:""},{type:"subject",title:"Subject",description:""}]},{type:"chartStyles",title:"Chart Settings",description:"",subSection:[{type:"stacked",title:"Layout",description:""},{type:"legend",title:"Show Legend",description:""}]},{type:"axisLabels",title:"Axis Preferences",description:"",y:{title:"Y Axis",description:"",prefix:{title:"Prefix",description:""},postfix:{title:"Postfix",description:""},format:{title:"Format",description:""},count:{title:"Label count",description:""},axisTitle:{title:"Title",description:""}},x:{title:"X Axis",description:"",prefix:{title:"Prefix",description:""},postfix:{title:"Postfix",description:""},format:{title:"Format",description:""},count:{title:"Label count",description:""},axisTitle:{title:"Title",description:""}}},{type:"conditionalFormatting",title:"Conditional Formatting",description:"",ruleType:"backgroundColor"},{type:"goalLine",title:"Goal Lines",description:""}],supportedCustomFields:{simplePercentage:!0,conditionalPercentage:!1,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0},supportedFeatures:{parameters:!0,colorGradient:!1},setDataAttributesFromPreAggregatedDataSet(e,t){return Ue(e,t,this.setAttributes)}}),Xe=e=>R().object(Object.assign(Object.assign(Object.assign({},U),W(e.queryEngineConfig)),{stacked:R().valid(!0,!1,"100%"),legend:R().valid(!0,!1),type:R().valid("lineChart"),parameters:Z(e.queryEngineConfig),lineCurve:G,conditionalFormattingRules:R().array().items(te(e.queryEngineConfig)),goalLines:J(),axisTitles:Q()})),Ze=e=>(t,r)=>{let n=E(t,r,Xe(e));return n=D(n),n},Je=e=>({title:"Line chart",dump:e=>e,load:t=>({type:t.type,measure:c(t.measure),order:u(t.order,t.timeDimension),dimension:A(t.dimension),timeDimension:t.timeDimension,displayTitle:t.displayTitle,displaySubject:t.displaySubject,protectedByOrganisation:t.protectedByOrganisation,viewId:ze(t.viewId),filter:l(t.filter),dataSetId:t.dataSetId,limit:t.limit,xAxisPostfix:t.xAxisPostfix,xAxisPrefix:t.xAxisPrefix,yAxisPostfix:t.yAxisPostfix,yAxisPrefix:t.yAxisPrefix,yAxisFormat:t.yAxisFormat,xAxisFormat:t.xAxisFormat,lineCurve:t.lineCurve,conditionalFormattingRules:Ye(e.queryEngineConfig,t.conditionalFormattingRules),drilldown:t.drilldown,legend:t.legend,goalLines:t.goalLines,parameters:f(t.parameters),approxXAxisLabelCount:d(t.approxXAxisLabelCount),approxYAxisLabelCount:d(t.approxYAxisLabelCount),axisTitles:t.axisTitles}),setAttributes:Ze(e),validate:(t,r)=>Te(t,r,e.queryEngineConfig),init:(e,t)=>Object.assign({type:"lineChart",measure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",protectedByOrganisation:void 0,viewId:ze(null==t?void 0:t.viewId),filter:[],order:[],dataSetId:e,limit:5e3,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,lineCurve:"natural",conditionalFormattingRules:[],drilldown:[],legend:!0,goalLines:void 0,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",parameters:{},axisTitles:void 0},t),createFeedback:De,schema:Xe(e),removeField:(t,r)=>T(t,r,e.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(t){const{measure:r,dimension:n}=Ce(t,e.queryEngineConfig,"lineChart");return this.init(t.id,{measure:[r[0]],dimension:n})},dataPanelConfig:()=>[{type:"dataSet",title:"Data set",description:"What data do you want to use in this line chart?"},{type:"views",title:"View",description:""},{type:"fieldCollector",title:"Metric - Y Axis",description:"What do you want each line to measure?",fieldFilterOptions:{forComponent:"lineChart"},callToAction:"Add metric",preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},{type:"fieldCollector",title:"Grouping - X Axis",description:"What do you want each line to represent? An example might be a `product category` field to represent each category as a line.",fieldFilterOptions:{forComponent:"lineChart",onlyDimensions:!0},preventDuplicates:!0,callToAction:"Add grouping",preSetPartialAttributes:(e,t)=>Ve(e,t),getValues:e=>We(e),maxAllowed:2,testId:"add-dimension"},{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},{type:"filter",title:"Filters",description:"Only include the information you want to use in this line chart."},{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this line chart."}],formatPanelConfig:()=>[{type:"heading",title:"Heading",description:"",subSection:[{type:"title",title:"Title",description:""},{type:"subject",title:"Subject",description:""}]},{type:"chartStyles",title:"Chart Settings",description:"",subSection:[{type:"curve",title:"Line Curve",description:""},{type:"legend",title:"Show Legend",description:""}]},{type:"axisLabels",title:"Axis Preferences",description:"",y:{title:"Y Axis",description:"",prefix:{title:"Prefix",description:""},postfix:{title:"Postfix",description:""},format:{title:"Format",description:""},count:{title:"Label count",description:""},axisTitle:{title:"Title",description:""}},x:{title:"X Axis",description:"",prefix:{title:"Prefix",description:""},postfix:{title:"Postfix",description:""},format:{title:"Format",description:""},count:{title:"Label count",description:""},axisTitle:{title:"Title",description:""}}},{type:"goalLine",title:"Goal Lines",description:""}],supportedCustomFields:{simplePercentage:!0,conditionalPercentage:!1,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0},supportedFeatures:{parameters:!0,colorGradient:!1},setDataAttributesFromPreAggregatedDataSet(e,t){return Ue(e,t,this.setAttributes)}}),Qe=e=>R().object(Object.assign(Object.assign({},U),{measure:R().array().items(I(e.queryEngineConfig.supportedAggregates)),dimension:L(e.queryEngineConfig.supportedTimeTruncFunctions),filter:z(e.queryEngineConfig),timeDimension:R().valid(null),order:R().array().items(M(e.queryEngineConfig)),type:R().valid("pieChart"),legend:R().valid(!0,!1),limit:B(),labelsAsPercentage:R().boolean(),conditionalFormattingRules:R().array().items(te(e.queryEngineConfig)),labelFormat:R().alternatives(R().string(),R().valid(null)),parameters:Z(e.queryEngineConfig)})),et=e=>({title:"Pie chart",dump:e=>e,load:t=>({type:t.type,measure:c(t.measure),order:u(t.order,t.timeDimension),dimension:A(t.dimension),viewId:ze(t.viewId),timeDimension:t.timeDimension,displayTitle:t.displayTitle,displaySubject:t.displaySubject,protectedByOrganisation:t.protectedByOrganisation,filter:l(t.filter),dataSetId:t.dataSetId,limit:t.limit,conditionalFormattingRules:Ye(e.queryEngineConfig,t.conditionalFormattingRules),labelsAsPercentage:t.labelsAsPercentage,legend:t.legend,labelFormat:t.labelFormat,parameters:f(t.parameters)}),setAttributes:(t,r)=>E(t,r,Qe(e)),validate:(t,r)=>Te(t,r,e.queryEngineConfig),init:(e,t)=>Object.assign({type:"pieChart",measure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",protectedByOrganisation:void 0,viewId:ze(null==t?void 0:t.viewId),filter:[],order:[],dataSetId:e,limit:5e3,conditionalFormattingRules:[],labelsAsPercentage:!1,legend:!0,labelFormat:null,parameters:{}},t),createFeedback:De,schema:Qe(e),removeField:(t,r)=>T(t,r,e.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(t){const{measure:r,dimension:n}=Ce(t,e.queryEngineConfig,"pieChart");return this.init(t.id,{measure:[r[0]],dimension:n})},dataPanelConfig:()=>[{type:"dataSet",title:"Data set",description:"What data do you want to use in this pie chart?"},{type:"views",title:"View",description:""},{type:"fieldCollector",title:"Metric",description:"What do you want each segment to measure?",fieldFilterOptions:{forComponent:"pieChart"},callToAction:"Add metric",maxAllowed:1,preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},{type:"fieldCollector",title:"Grouping",description:"How do you want to split each section of the pie chart?",fieldFilterOptions:{onlyFieldTypes:["boolean","number","string"],onlyDimensions:!0,removeConditionalPercentage:!0,removeSimplePercentage:!0,removeSimpleMaths:!0,removeAggregateMaths:!0},maxAllowed:1,callToAction:"Add comparison",preSetPartialAttributes:e=>({dimension:e}),getValues:e=>e.dimension,testId:"add-dimension"},{type:"sort",title:"Sort",description:"Choose the order of segments in the pie chart"},{type:"filter",title:"Filters",description:"Only include the information you want in this pie chart"},{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},{type:"limit",title:"Limit",description:"Limit the number of segments shown on this pie chart"}],formatPanelConfig:()=>[{type:"heading",title:"Heading",description:"",subSection:[{type:"title",title:"Title",description:""},{type:"subject",title:"Subject",description:""}]},{type:"conditionalFormatting",title:"Conditional Formatting",description:"",ruleType:"backgroundColor"},{type:"chartStyles",title:"Chart Settings",description:"",subSection:[{type:"legend",title:"Show Legend",description:""},{type:"numberFormat",title:"Format",description:""}]}],supportedCustomFields:{simplePercentage:!0,conditionalPercentage:!1,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0},supportedFeatures:{parameters:!0,colorGradient:!1}}),tt=e=>R().object(Object.assign(Object.assign({},U),{xMeasure:I(e.queryEngineConfig.supportedAggregates).allow(null),yMeasure:I(e.queryEngineConfig.supportedAggregates).allow(null),dimension:L(e.queryEngineConfig.supportedTimeTruncFunctions),order:R().array().items(M(e.queryEngineConfig)),limit:B(),legend:R().valid(!0,!1),offset:R().number().min(0),filter:z(e.queryEngineConfig),type:R().valid("scatterChart"),timeDimension:R().valid(null),xAxisPrefix:R().string().allow(""),yAxisPrefix:R().string().allow(""),xAxisPostfix:R().string().allow(""),yAxisPostfix:R().string().allow(""),yAxisFormat:R().alternatives(R().string(),R().valid(null)),xAxisFormat:R().alternatives(R().string(),R().valid(null)),approxYAxisLabelCount:V,approxXAxisLabelCount:V,goalLines:J(),axisTitles:Q()})),rt=e=>(t,r)=>{let n=E(t,r,tt(e)),i=[];return n.xMeasure&&i.push(n.xMeasure),n.yMeasure&&i.push(n.yMeasure),n.dimension.forEach((e=>{i.push({field:e.field,function:e.function})})),n=F(n,i),n},nt=e=>({title:"Scatter chart",dump:e=>e,load:e=>({type:e.type,xMeasure:c(e.xMeasure?[e.xMeasure]:[])[0]||null,yMeasure:c(e.yMeasure?[e.yMeasure]:[])[0]||null,dimension:A(e.dimension),viewId:ze(e.viewId),timeDimension:e.timeDimension,displayTitle:e.displayTitle,displaySubject:e.displaySubject,protectedByOrganisation:e.protectedByOrganisation,filter:l(e.filter),order:u(e.order,e.timeDimension),dataSetId:e.dataSetId,limit:e.limit,legend:e.legend,xAxisFormat:e.xAxisFormat,yAxisFormat:e.yAxisFormat,yAxisPostfix:e.yAxisPostfix,yAxisPrefix:e.yAxisPrefix,xAxisPostfix:e.xAxisPostfix,xAxisPrefix:e.xAxisPrefix,approxXAxisLabelCount:d(e.approxXAxisLabelCount),approxYAxisLabelCount:d(e.approxYAxisLabelCount),goalLines:e.goalLines,axisTitles:e.axisTitles}),setAttributes:rt(e),validate:(t,r)=>Te(t,r,e.queryEngineConfig),init:(e,t)=>Object.assign({type:"scatterChart",xMeasure:null,yMeasure:null,dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",protectedByOrganisation:void 0,viewId:ze(null==t?void 0:t.viewId),filter:[],order:[],dataSetId:e,limit:5e3,legend:!0,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",goalLines:void 0,axisTitles:void 0},t),createFeedback:De,schema:tt(e),removeField:(t,r)=>T(t,r,e.queryEngineConfig),isRunnable:e=>!!e.xMeasure&&!!e.yMeasure&&e.dimension.length>0,autoGenerate(t){const{measure:r,dimension:n}=Ce(t,e.queryEngineConfig,"scatterChart");return this.init(t.id,{xMeasure:r[0],yMeasure:r[1],dimension:n})},dataPanelConfig:()=>[{type:"dataSet",title:"Data set",description:"What data do you want to use in this scatter chart?"},{type:"views",title:"View",description:""},{type:"labelledMetrics",title:"Metrics",description:"",metrics:[{title:"X axis",propKey:"xMeasure",allowsMultiple:!1},{title:"Y axis",propKey:"yMeasure",allowsMultiple:!1}]},{type:"fieldCollector",title:"Grouping",description:"What do you want each dot to represent?",fieldFilterOptions:{onlyDimensions:!0,onlyFieldTypes:["boolean","number","string"],removeConditionalPercentage:!0,removeSimplePercentage:!0,removeSimpleMaths:!0,removeAggregateMaths:!0},maxAllowed:1,callToAction:"Add comparison",preSetPartialAttributes:e=>({dimension:e}),getValues:e=>e.dimension,testId:"add-dimension"},{type:"filter",title:"Filters",description:"Only include the information you want in this scatter chart"},{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},{type:"limit",title:"Limit",description:"Limit the number of data points shown on this scatter chart"}],formatPanelConfig:()=>[{type:"heading",title:"Heading",description:"",subSection:[{type:"title",title:"Title",description:""},{type:"subject",title:"Subject",description:""}]},{type:"chartStyles",title:"Chart Settings",description:"",subSection:[{type:"legend",title:"Show Legend",description:""}]},{type:"axisLabels",title:"Axis Preferences",description:"",y:{title:"Y Axis",description:"",prefix:{title:"Prefix",description:""},postfix:{title:"Postfix",description:""},format:{title:"Format",description:""},count:{title:"Label count",description:""},axisTitle:{title:"Title",description:""}},x:{title:"X Axis",description:"",prefix:{title:"Prefix",description:""},postfix:{title:"Postfix",description:""},format:{title:"Format",description:""},count:{title:"Label count",description:""},axisTitle:{title:"Title",description:""}}},{type:"goalLine",title:"Goal Lines",description:""}],supportedCustomFields:{simplePercentage:!0,conditionalPercentage:!1,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0},supportedFeatures:{parameters:!1,colorGradient:!1}}),it=e=>R().object(Object.assign(Object.assign({},U),{stacked:R().valid(!0,!1,"100%"),legend:R().valid(!0,!1),barMeasure:R().array().items(I(e.queryEngineConfig.supportedAggregates)),lineMeasure:R().array().items(I(e.queryEngineConfig.supportedAggregates)),barDimension:L(e.queryEngineConfig.supportedTimeTruncFunctions),lineDimension:L(e.queryEngineConfig.supportedTimeTruncFunctions),order:R().array().items(M(e.queryEngineConfig)),timeDimension:R().alternatives(q(e.queryEngineConfig.supportedTimeTruncFunctions),R().valid(null)),limit:B(),offset:R().number().min(0),filter:z(e.queryEngineConfig),type:R().valid("comboChart"),xAxisPrefix:R().string().allow(""),yAxisPrefix:R().string().allow(""),xAxisPostfix:R().string().allow(""),yAxisPostfix:R().string().allow(""),yAxisFormat:R().alternatives(R().string(),R().valid(null)),xAxisFormat:R().alternatives(R().string(),R().valid(null)),approxYAxisLabelCount:V,approxXAxisLabelCount:V,goalLines:J(),conditionalFormattingRules:R().object({bar:R().array().items(te(e.queryEngineConfig))}),axisTitles:Q()})),ot=e=>(t,r)=>{let n=E(t,r,it(e)),i=[...n.lineMeasure,...n.barMeasure];return[...n.lineDimension,...n.barDimension].forEach((e=>{i.push({field:e.field,function:e.function})})),n.timeDimension&&i.push({field:n.timeDimension.field,function:n.timeDimension.truncate}),n=F(n,i),n},at=e=>({title:"Combo chart",dump:e=>e,load:t=>{return r=t,n=e.queryEngineConfig,Object.assign(Object.assign({},r),{lineMeasure:c(r.lineMeasure),barMeasure:c(r.barMeasure),order:u(r.order,r.timeDimension||null),filter:l(r.filter),lineDimension:A(r.lineDimension||r.dimension||[]),barDimension:A(r.barDimension||r.dimension||[]),viewId:ze(r.viewId),approxXAxisLabelCount:d(r.approxXAxisLabelCount),approxYAxisLabelCount:d(r.approxYAxisLabelCount),conditionalFormattingRules:{bar:Ye(n,null===(i=r.conditionalFormattingRules)||void 0===i?void 0:i.bar)}});var r,n,i},setAttributes:ot(e),validate:(t,r)=>Te(t,r,e.queryEngineConfig),init:(e,t)=>Object.assign({type:"comboChart",barMeasure:[],lineMeasure:[],lineDimension:[],barDimension:[],timeDimension:null,displayTitle:"",displaySubject:"",viewId:ze(null==t?void 0:t.viewId),filter:[],order:[],dataSetId:e,limit:5e3,xAxisPostfix:"",protectedByOrganisation:void 0,xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,legend:!0,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",goalLines:void 0,conditionalFormattingRules:void 0,axisTitles:void 0},t),createFeedback:De,schema:it(e),removeField:(t,r)=>T(t,r,e.queryEngineConfig),isRunnable:e=>e.lineMeasure.length>0||e.barMeasure.length>0,autoGenerate(t){const{measure:r,dimension:n}=Ce(t,e.queryEngineConfig,"comboChart");return this.init(t.id,{barMeasure:[r[0]],lineMeasure:[r[1]||r[0]],barDimension:n,lineDimension:n})},dataPanelConfig:()=>[{type:"dataSet",title:"Data set",description:"What data do you want to use in this combo chart?"},{type:"views",title:"View",description:""},{type:"labelledMetrics",title:"Metric - Y Axis",description:"What do you want each line and bar to measure?",metrics:[{title:"Line",propKey:"lineMeasure",allowsMultiple:!0},{title:"Bar",propKey:"barMeasure",allowsMultiple:!0}]},{type:"comboChartDimension",title:"Grouping - X Axis",description:""},{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},{type:"filter",title:"Filters",description:"Only include the information you want to use in this combo chart."},{type:"customMetrics",title:"Custom metrics",description:""},{type:"limit",title:"Limit",description:"Set the maximum number of data points to show on this combo chart."}],formatPanelConfig:()=>[{type:"heading",title:"Heading",description:"",subSection:[{type:"title",title:"Title",description:""},{type:"subject",title:"Subject",description:""}]},{type:"chartStyles",title:"Chart Settings",description:"",subSection:[{type:"stacked",title:"Layout",description:""},{type:"legend",title:"Show Legend",description:""}]},{type:"axisLabels",title:"Axis Preferences",description:"",y:{title:"Y Axis",description:"",prefix:{title:"Prefix",description:""},postfix:{title:"Postfix",description:""},format:{title:"Format",description:""},count:{title:"Label count",description:""},axisTitle:{title:"Title",description:""}},x:{title:"X Axis",description:"",prefix:{title:"Prefix",description:""},postfix:{title:"Postfix",description:""},format:{title:"Format",description:""},count:{title:"Label count",description:""},axisTitle:{title:"Title",description:""}}},{type:"conditionalFormatting",title:"Conditional Formatting",description:"",ruleType:"backgroundColor",subSection:[{title:"Bar",propKey:"bar"}]},{type:"goalLine",title:"Goal Lines",description:""}],supportedCustomFields:{simplePercentage:!0,conditionalPercentage:!1,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0},supportedFeatures:{parameters:!1,colorGradient:!1}}),st=e=>R().object(Object.assign(Object.assign({},U),{type:R().valid("dataTable"),measure:R().array().items(I(e.queryEngineConfig.supportedAggregates)),dimension:L(e.queryEngineConfig.supportedTimeTruncFunctions),order:R().array().items(M(e.queryEngineConfig)),timeDimension:R().alternatives(q(e.queryEngineConfig.supportedTimeTruncFunctions),R().valid(null)),limit:B(),offset:R().number().min(0),filter:z(e.queryEngineConfig),prefixes:R().array().items(re),exportNames:R().object(),numberFormat:R().object(),conditionalFormattingRules:R().array().items(te(e.queryEngineConfig)),dateTimeFormat:R().string(),protectedFields:R().object({dimension:H(),measure:Y()}).unknown(!0),sizing:ee,tableDrilldown:R().array().items(R().object({subsetDimension:R().string().required()}))})),lt=e=>(t,r)=>{let n=E(t,r,st(e));return n=D(n),n},ut=(e,t)=>e.filter((e=>e.pivot==t)),ct=e=>({title:"Pivot table",dump:e=>e,load:t=>{return{type:t.type,measure:c(t.measure),order:u(t.order,t.timeDimension||null),displayTitle:t.displayTitle,dimension:(n=We({timeDimension:t.timeDimension,dimension:A(t.dimension)}),n.map((e=>Object.assign(Object.assign({},e),{pivot:e.pivot?e.pivot:"x"})))),displaySubject:t.displaySubject,protectedByOrganisation:t.protectedByOrganisation,protectedFields:Ge(t.protectedFields),viewId:ze(t.viewId),filter:l(t.filter),dataSetId:t.dataSetId,limit:t.limit,offset:t.offset,conditionalFormattingRules:Ye(e.queryEngineConfig,t.conditionalFormattingRules),dateTimeFormat:t.dateTimeFormat,prefixes:t.prefixes,exportNames:t.exportNames,numberFormat:t.numberFormat,sizing:t.sizing,tableDrilldown:(r=t.tableDrilldown,r&&r.length>0?r.map(Be):r||[])};var r,n},setAttributes:lt(e),validate:(t,r)=>Te(t,r,e.queryEngineConfig),init:(e,t)=>Object.assign({type:"dataTable",measure:[],displayTitle:"",dimension:[],protectedByOrganisation:void 0,displaySubject:"",viewId:ze(null==t?void 0:t.viewId),filter:[],order:[],dataSetId:e,limit:50,offset:0,conditionalFormattingRules:[],protectedFields:void 0,prefixes:[],dateTimeFormat:"DD MMMM YYYY, hh:mm",exportNames:{},numberFormat:{},sizing:{},tableDrilldown:[]},t),schema:st(e),removeField:(t,r)=>T(t,r,e.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(t){const{measure:r,dimension:n}=Ce(t,e.queryEngineConfig,"dataTable");return this.init(t.id,{measure:r.slice(0,5),dimension:n})},dataPanelConfig:()=>[{type:"dataSet",title:"Data set",description:"What data do you want to use in this data table?"},{type:"views",title:"View",description:""},{type:"fieldCollector",title:"Group columns",description:"",fieldFilterOptions:{onlyFieldTypes:["boolean","number","string","date_time"],onlyDimensions:!0,removeConditionalPercentage:!0,removeSimplePercentage:!0,removeSimpleMaths:!0,removeAggregateMaths:!0},preventDuplicates:!0,callToAction:"Add group column",preSetPartialAttributes:(e,t,r)=>({dimension:[...e.map((e=>Object.assign(Object.assign({},e),{pivot:"y"}))),...ut(r.dimension,"x")]}),getValues:e=>ut(e.dimension,"y"),testId:"add-pivot-dimension"},{type:"fieldCollector",title:"Group rows",description:"Which field do you want to group each row by? An example might be an employee ID or geographical location",fieldFilterOptions:{onlyFieldTypes:["boolean","number","string","date_time"],onlyDimensions:!0,removeConditionalPercentage:!0,removeSimplePercentage:!0,removeSimpleMaths:!0,removeAggregateMaths:!0},preventDuplicates:!0,callToAction:"Add group row",preSetPartialAttributes:(e,t,r)=>({dimension:[...e.map((e=>Object.assign(Object.assign({},e),{pivot:"x"}))),...ut(r.dimension,"y")]}),getValues:e=>ut(e.dimension,"x"),testId:"add-dimension"},{type:"drilldown",title:"Drilldown",description:"Drilldowns in a pivot table reveals underlying data contributing to summarized figures upon clicking."},{type:"fieldCollector",title:"Metrics",description:"Select the columns to show in the data table",fieldFilterOptions:{forComponent:"dataTable"},callToAction:"Add metric",preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},{type:"sort",title:"Sort",description:""},{type:"pagination",title:"Pagination",description:""},{type:"filter",title:"Filters",description:"Only include the information you want to use in this data table."},{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."}],formatPanelConfig:()=>[{title:"Heading",type:"heading",description:"",subSection:[{type:"title",title:"Title",description:""},{type:"subject",title:"Subject",description:""}]},{type:"format",title:"Format",description:"",subSection:[{type:"time",title:"Time",description:""}]},{type:"prefixes",title:"Prefixes",description:""},{type:"conditionalFormatting",title:"Conditional Formatting",description:"",ruleType:"backgroundColor"}],supportedCustomFields:{simplePercentage:!0,conditionalPercentage:!1,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0},supportedFeatures:{parameters:!1,colorGradient:!0}}),dt=R().object({field:R().string().required(),function:R().valid("none").required()}),ft=e=>R().object(Object.assign(Object.assign({},U),{type:R().valid("basicTable"),measure:R().array().items(dt),dimension:R().array().max(0),order:R().array().items(M(e.queryEngineConfig)),timeDimension:R().valid(null),limit:B(),offset:R().number().min(0),filter:z(e.queryEngineConfig),prefixes:R().array().items(re),exportNames:R().object(),numberFormat:R().object(),conditionalFormattingRules:R().array().items(te(e.queryEngineConfig)),dateTimeFormat:R().string(),protectedFields:R().object({measure:Y()}).unknown(!0),sizing:ee})),pt=e=>(t,r)=>{let n=E(t,r,ft(e));return n=F(n,[...n.measure]),n},ht=e=>({title:"Basic table",dump:e=>({type:e.type,measure:e.measure,displayTitle:e.displayTitle,dimension:e.dimension,timeDimension:e.timeDimension,displaySubject:e.displaySubject,protectedFields:e.protectedFields,filter:e.filter,order:e.order,dataSetId:e.dataSetId,viewId:null==e?void 0:e.viewId,limit:e.limit,offset:e.offset,conditionalFormattingRules:e.conditionalFormattingRules,protectedByOrganisation:e.protectedByOrganisation,dateTimeFormat:e.dateTimeFormat,prefixes:e.prefixes,exportNames:e.exportNames,numberFormat:e.numberFormat,sizing:e.sizing}),load:t=>Object.assign(Object.assign({},t),{measure:c(t.measure),order:u(t.order,t.timeDimension),filter:l(t.filter),dimension:A(t.dimension),viewId:ze(t.viewId),protectedFields:Ge(t.protectedFields),conditionalFormattingRules:Ye(e.queryEngineConfig,t.conditionalFormattingRules)}),setAttributes:pt(e),validate:(t,r)=>Te(t,r,e.queryEngineConfig),init:function(t,r){const n={type:"basicTable",measure:[],displayTitle:"",dimension:[],timeDimension:null,displaySubject:"",filter:[],order:[],dataSetId:t,viewId:ze(null==r?void 0:r.viewId),protectedFields:void 0,limit:50,offset:0,conditionalFormattingRules:[],prefixes:[],dateTimeFormat:"DD MMMM YYYY, hh:mm",exportNames:{},numberFormat:{},sizing:{}};return pt(e)(n,r||{})},schema:ft(e),removeField:(t,r)=>T(t,r,e.queryEngineConfig),setFields:function(t,r){const n=[...r].map((e=>({field:e,function:"none"})));return pt(e)(t,{measure:n})},setDateTimeFormat:function(e,t){return this.setAttributes(e,{dateTimeFormat:t})},isRunnable:e=>e.measure.length>0,autoGenerate(e){const t=[...Ae(e.fields,{forComponent:"basicTable",onlyMeasures:!0,removeAggregateMaths:!0,removeConditionalPercentage:!0,removeSimplePercentage:!0})].map((e=>({field:e.id,function:"none"})));return this.init(e.id,{measure:t.slice(0,5)})},dataPanelConfig:()=>[{type:"dataSet",title:"Data set",description:"What data do you want to use in this basic table?"},{type:"views",title:"View",description:""},{type:"fields",title:"Columns",description:"Select which values you want to see in this table"},{type:"sort",title:"Sort",description:"Select how the columns are ordered in this table"},{type:"pagination",title:"Pagination",description:"Define the size for each page in the table"},{type:"filter",title:"Filters",description:"Only include the information you want to use in this table."},{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."}],formatPanelConfig:()=>[{type:"heading",title:"Heading",description:"",subSection:[{type:"title",title:"Title",description:""},{type:"subject",title:"Subject",description:""}]},{type:"format",title:"Format",description:"",subSection:[{type:"time",title:"Time",description:""}]},{type:"prefixes",title:"Prefixes",description:""},{type:"conditionalFormatting",title:"Conditional Formatting",description:"",ruleType:"backgroundColor"}],supportedCustomFields:{simplePercentage:!1,conditionalPercentage:!1,simpleMaths:!0,rules:!0,aggregateMaths:!1,roundedNumbers:!0},supportedFeatures:{parameters:!1,colorGradient:!0}}),mt=e=>(t,r)=>{let n=E(t,r,ne(e));return n=D(n),n},gt=e=>({title:"Horizontal bar chart",dump:e=>e,load:e=>Object.assign(Object.assign({},e),{measure:c(e.measure),order:u(e.order,e.timeDimension),dimension:A(e.dimension),viewId:ze(e.viewId),filter:l(e.filter),approxXAxisLabelCount:d(e.approxXAxisLabelCount),approxYAxisLabelCount:d(e.approxYAxisLabelCount),protectedFields:Ge(e.protectedFields)}),setAttributes:mt(e),validate:(t,r)=>Te(t,r,e.queryEngineConfig),init:(e,t)=>Object.assign({type:"horizontalBarChart",measure:[],dimension:[],timeDimension:null,displayTitle:"",displaySubject:"",viewId:ze(null==t?void 0:t.viewId),filter:[],order:[],dataSetId:e,limit:5e3,conditionalFormattingRules:[],protectedByOrganisation:void 0,protectedFields:void 0,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,legend:!0,drilldown:[],approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",axisTitles:void 0},t),createFeedback:De,schema:ne(e),removeField:(t,r)=>T(t,r,e.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(t){const{measure:r,dimension:n}=Ce(t,e.queryEngineConfig,"horizontalBarChart");return this.init(t.id,{measure:[r[0]],dimension:n})},dataPanelConfig:()=>[{type:"dataSet",title:"Data set",description:"What data do you want to use in this horizontal bar chart?"},{type:"views",title:"View",description:""},{type:"fieldCollector",title:"Metric - X Axis",description:"What do you want each bar to measure?",fieldFilterOptions:{forComponent:"horizontalBarChart"},callToAction:"Add metric",preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},{type:"drilldown",title:"Drilldown",description:""},{type:"fieldCollector",title:"Grouping - X Axis",description:"What do you want each bar to represent? An example might be a `product category` field to represent each category as a bar.",fieldFilterOptions:{forComponent:"horizontalBarChart",onlyDimensions:!0},preventDuplicates:!0,callToAction:"Add grouping",preSetPartialAttributes:(e,t)=>Ve(e,t),getValues:e=>We(e),maxAllowed:2,testId:"add-dimension"},{type:"sort",title:"Sort",description:""},{type:"limit",title:"Limit",description:"Set the maximum number of data points to show on this horizontal bar chart."},{type:"filter",title:"Filters",description:"Only include the information you want to use in this horizontal bar chart."},{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."}],formatPanelConfig:()=>[{type:"heading",title:"Heading",description:"",subSection:[{type:"title",title:"Title",description:""},{type:"subject",title:"Subject",description:""}]},{type:"chartStyles",title:"Chart Settings",description:"",subSection:[{type:"stacked",title:"Layout",description:""},{type:"legend",title:"Show Legend",description:""}]},{type:"axisLabels",title:"Axis Preferences",description:"",y:{title:"Y Axis",description:"",prefix:{title:"Prefix",description:""},postfix:{title:"Postfix",description:""},format:{title:"Format",description:""},count:{title:"Label count",description:""},axisTitle:{title:"Title",description:""}},x:{title:"X Axis",description:"",prefix:{title:"Prefix",description:""},postfix:{title:"Postfix",description:""},format:{title:"Format",description:""},count:{title:"Label count",description:""},axisTitle:{title:"Title",description:""}}},{type:"conditionalFormatting",title:"Conditional Formatting",description:"",ruleType:"backgroundColor"}],supportedCustomFields:{simplePercentage:!0,conditionalPercentage:!1,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0},supportedFeatures:{parameters:!0,colorGradient:!1},setDataAttributesFromPreAggregatedDataSet(e,t){return Ue(e,t,this.setAttributes)}}),yt=e=>R().object(Object.assign(Object.assign(Object.assign({},U),W(e.queryEngineConfig)),{stacked:R().valid(!0,!1,"100%"),legend:R().valid(!0,!1),type:R().valid("areaChart"),lineCurve:G,conditionalFormattingRules:R().array().items(te(e.queryEngineConfig)),parameters:Z(e.queryEngineConfig),goalLines:J(),axisTitles:Q()})),vt=e=>(t,r)=>{let n=E(t,r,yt(e));return n=D(n),n},bt=e=>({title:"Area chart",dump:e=>e,load:t=>({type:t.type,measure:c(t.measure),displayTitle:t.displayTitle,dimension:A(t.dimension),timeDimension:t.timeDimension,displaySubject:t.displaySubject,viewId:ze(t.viewId),filter:l(t.filter),order:u(t.order,t.timeDimension),dataSetId:t.dataSetId,limit:t.limit,offset:t.offset,xAxisPostfix:t.xAxisPostfix,xAxisPrefix:t.xAxisPrefix,yAxisPostfix:t.yAxisPostfix,yAxisPrefix:t.yAxisPrefix,lineCurve:t.lineCurve,conditionalFormattingRules:Ye(e.queryEngineConfig,t.conditionalFormattingRules),protectedByOrganisation:t.protectedByOrganisation,stacked:t.stacked,drilldown:t.drilldown,legend:t.legend,yAxisFormat:t.yAxisFormat,xAxisFormat:t.xAxisFormat,goalLines:t.goalLines,parameters:f(t.parameters),approxXAxisLabelCount:d(t.approxXAxisLabelCount),approxYAxisLabelCount:d(t.approxYAxisLabelCount)}),setAttributes:vt(e),validate:(t,r)=>Te(t,r,e.queryEngineConfig),init:(e,t)=>Object.assign({type:"areaChart",measure:[],displayTitle:"",dimension:[],timeDimension:null,displaySubject:"",viewId:ze(null==t?void 0:t.viewId),filter:[],order:[],dataSetId:e,limit:5e3,offset:0,xAxisPostfix:"",xAxisPrefix:"",yAxisPostfix:"",yAxisPrefix:"",yAxisFormat:null,xAxisFormat:null,lineCurve:"natural",conditionalFormattingRules:[],drilldown:[],legend:!0,approxXAxisLabelCount:"auto",approxYAxisLabelCount:"auto",parameters:{},goalLines:void 0,axisTitles:void 0},t),createFeedback:De,schema:yt(e),removeField:(t,r)=>T(t,r,e.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(t){const{measure:r,dimension:n}=Ce(t,e.queryEngineConfig,"areaChart");return this.init(t.id,{measure:[r[0]],dimension:n})},dataPanelConfig:()=>[{type:"dataSet",title:"Data set",description:"What data do you want to use in this area chart?"},{type:"views",title:"View",description:""},{type:"fieldCollector",title:"Metric - Y Axis",description:"What do you want each area to measure?",fieldFilterOptions:{forComponent:"areaChart"},callToAction:"Add metric",preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},{type:"fieldCollector",title:"Grouping - X Axis",description:"What do you want each area to represent? An example might be an employee ID to represent each employee.",fieldFilterOptions:{forComponent:"areaChart",onlyDimensions:!0},preventDuplicates:!0,callToAction:"Add grouping",preSetPartialAttributes:(e,t)=>Ve(e,t),getValues:e=>We(e),maxAllowed:2,testId:"add-dimension"},{type:"sort",title:"Sort",description:"Select the order of categories or time on the x Axis."},{type:"filter",title:"Filters",description:"Only include the information you want to use in this area chart."},{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this area chart."}],formatPanelConfig:()=>[{type:"heading",title:"Heading",description:"",subSection:[{type:"title",title:"Title",description:""},{type:"subject",title:"Subject",description:""}]},{type:"chartStyles",title:"Chart Settings",description:"",subSection:[{type:"stacked",title:"Layout",description:""},{type:"curve",title:"Line Curve",description:""},{type:"legend",title:"Show Legend",description:""}]},{type:"axisLabels",title:"Axis Preferences",description:"",y:{title:"Y Axis",description:"",prefix:{title:"Prefix",description:""},postfix:{title:"Postfix",description:""},format:{title:"Format",description:""},count:{title:"Label count",description:""},axisTitle:{title:"Title",description:""}},x:{title:"X Axis",description:"",prefix:{title:"Prefix",description:""},postfix:{title:"Postfix",description:""},format:{title:"Format",description:""},count:{title:"Label count",description:""},axisTitle:{title:"Title",description:""}}},{type:"goalLine",title:"Goal Lines",description:""}],supportedCustomFields:{simplePercentage:!0,conditionalPercentage:!1,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0},supportedFeatures:{parameters:!0,colorGradient:!1}}),_t=e=>R().object(Object.assign(Object.assign({},U),{fontSize:R().string().allow(""),formatter:R().object(),measure:R().array().items(I(e.queryEngineConfig.supportedAggregates)),filter:z(e.queryEngineConfig),prefixes:R().object(),postfixes:R().object(),type:R().valid("singleStat"),limit:B(),conditionalFormattingRules:R().array().items(te(e.queryEngineConfig)),deltaTimeDimension:R().alternatives(q(e.queryEngineConfig.supportedTimeTruncFunctions),R().valid(null)),parameters:Z(e.queryEngineConfig)})),wt=e=>({title:"Single stat",dump:e=>e,load:e=>{const t=(e=>{if("singleMeasure"in e){let t={},r={},n=[],i={};return e.singleMeasure&&(n=[e.singleMeasure],t[k(e.singleMeasure)]=e.prefix,r[k(e.singleMeasure)]=e.postfix,i[k(e.singleMeasure)]=e.formatter),{type:"singleStat",prefixes:t,postfixes:r,measure:n,formatter:i,fontSize:e.fontSize,displayTitle:e.displayTitle,displaySubject:e.displaySubject,filter:l(e.filter),dataSetId:e.dataSetId,limit:e.limit,conditionalFormattingRules:e.conditionalFormattingRules,deltaTimeDimension:e.deltaTimeDimension,parameters:f(e.parameters)}}return Object.assign(Object.assign({},e),{filter:l(e.filter)})})(e);return{type:"singleStat",prefixes:t.prefixes,postfixes:t.postfixes,fontSize:t.fontSize,formatter:t.formatter,measure:c(t.measure),displayTitle:t.displayTitle,displaySubject:t.displaySubject,protectedByOrganisation:e.protectedByOrganisation,viewId:ze(e.viewId),filter:t.filter,dataSetId:t.dataSetId,limit:t.limit,conditionalFormattingRules:t.conditionalFormattingRules,deltaTimeDimension:t.deltaTimeDimension,parameters:f(t.parameters)}},setAttributes:(t,r)=>E(t,r,_t(e)),validate:(t,r)=>Te(t,r,e.queryEngineConfig),init:(e,t)=>Object.assign({type:"singleStat",postfixes:{},prefixes:{},measure:[],displayTitle:"",formatter:{},fontSize:"2rem",protectedByOrganisation:void 0,displaySubject:"",viewId:ze(null==t?void 0:t.viewId),filter:[],dataSetId:e,limit:5e3,conditionalFormattingRules:[],deltaTimeDimension:null,parameters:{}},t),schema:_t(e),removeField:(t,r)=>T(t,r,e.queryEngineConfig),isRunnable:e=>e.measure.length>0,autoGenerate(t){const{measure:r,dimension:n}=Ce(t,e.queryEngineConfig,"singleStat");return this.init(t.id,{measure:[r[0]]})},dataPanelConfig:()=>[{type:"dataSet",title:"Data set",description:"What data do you want to use in this single stat?"},{type:"views",title:"View",description:""},{type:"fieldCollector",title:"Metrics",description:"What do you want to show?",fieldFilterOptions:{forComponent:"singleStat"},callToAction:"Add metric",preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},{type:"filter",title:"Filters",description:"Only include the information you want in this single stat"},{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},{type:"comparison",title:"Comparison",description:""}],formatPanelConfig:()=>[{type:"heading",title:"Heading",description:"",subSection:[{type:"title",title:"Title",description:""},{type:"subject",title:"Subject",description:""}]},{type:"statsLabels",title:"Labels",description:"",prefix:{title:"Prefix",description:""},postfix:{title:"Postfix",description:""},format:{title:"Format",description:""},count:{title:"Label count",description:""}},{type:"format",title:"Format",description:"",subSection:[{title:"Font Size",type:"fontSize",description:""}]},{type:"conditionalFormatting",title:"Conditional Formatting",description:"",ruleType:"fontColor"}],supportedCustomFields:{simplePercentage:!0,conditionalPercentage:!0,simpleMaths:!0,aggregateMaths:!0,rules:!0,roundedNumbers:!0},supportedFeatures:{parameters:!0,colorGradient:!1}}),xt={title:"Custom",dump:e=>e,load:e=>e,setAttributes:(e,t)=>{throw"Not implemented."},validate:()=>[],init:(e,t)=>({type:"custom",id:t&&t.id||"",dataSetId:e,displaySubject:"",displayTitle:"",protectedByOrganisation:void 0}),schema:R().object(),removeField:(e,t)=>e,isRunnable:()=>!0,autoGenerate(e){return this.init(e.id)},dataPanelConfig:()=>[],formatPanelConfig:()=>[],supportedCustomFields:{simplePercentage:!0,conditionalPercentage:!1,simpleMaths:!0,rules:!1,aggregateMaths:!0,roundedNumbers:!0},supportedFeatures:{colorGradient:!1,parameters:!1}},At=e=>R().object(Object.assign(Object.assign({},U),{type:R().valid("mercatorMap"),measure:R().array().items(I(e.queryEngineConfig.supportedAggregates)),filter:z(e.queryEngineConfig),limit:B(),dimension:L({}),labelFormat:R().alternatives(R().string(),R().valid(null)),noDataColor:R().string().required(),backgroundColor:R().string().required(),maxValueColor:R().string().required(),minValueColor:R().string().required(),position:R().object({scale:R().number(),centerX:R().number(),centerY:R().number()})})),jt=e=>(t,r)=>E(t,r,At(e)),St=e=>({title:"Country map",dump:e=>e,load:e=>({dataSetId:e.dataSetId,displaySubject:e.displaySubject,displayTitle:e.displayTitle,protectedByOrganisation:e.protectedByOrganisation,viewId:ze(e.viewId),type:"mercatorMap",dimension:e.dimension,limit:e.limit,measure:c(e.measure),labelFormat:e.labelFormat,position:e.position,filter:l(e.filter),noDataColor:e.noDataColor||"#ffffff",backgroundColor:e.backgroundColor||"#EFF5F6",maxValueColor:e.maxValueColor||"#000000",minValueColor:e.minValueColor||"#e0e0e0"}),setAttributes:jt(e),validate:()=>[],init:(e,t)=>Object.assign({type:"mercatorMap",dataSetId:e,dimension:[],measure:[],displaySubject:"",displayTitle:"",limit:5e3,filter:[],viewId:ze(null==t?void 0:t.viewId),labelFormat:null,noDataColor:"#ffffff",backgroundColor:"#EFF5F6",maxValueColor:"#000000",minValueColor:"#e0e0e0"},t),schema:At(e),removeField:(e,t)=>e,isRunnable:e=>!!(e.dimension&&e.dimension[0]&&e.measure&&e.measure[0]),autoGenerate(e){return this.init(e.id)},dataPanelConfig:()=>[{type:"dataSet",title:"Data set",description:"What data do you want to use for this map?"},{type:"views",title:"View",description:""},{type:"fieldCollector",title:"Metric",description:"What do you want to show?",fieldFilterOptions:{forComponent:"pieChart"},callToAction:"Add metric",maxAllowed:1,preSetPartialAttributes:e=>({measure:e}),getValues:e=>e.measure,testId:"metric-input"},{type:"fieldCollector",title:"Country",description:"Which field contains the country code required to group results on?",fieldFilterOptions:{onlyDimensions:!0,onlyFieldTypes:["string"],removeConditionalPercentage:!0,removeRuleGrouping:!1,removeSimpleMaths:!0,removeSimplePercentage:!0,removeAggregateMaths:!0},maxAllowed:1,callToAction:"Set country",preSetPartialAttributes:e=>({dimension:e}),getValues:e=>e.dimension,testId:"add-dimension"},{type:"filter",title:"Filters",description:"Only include the information you want to use on this map."},{type:"customMetrics",title:"Custom metrics",description:"Build your own metrics, such as a percentage."},{type:"limit",title:"Limit",description:"Set the maximum number of records to show on this bar chart."}],formatPanelConfig:()=>[{type:"heading",title:"Heading",description:"",subSection:[{type:"title",title:"Title",description:""},{type:"subject",title:"Subject",description:""}]},{type:"chartStyles",title:"Map Settings",description:"",subSection:[{type:"numberFormat",title:"Value format",description:""}]},{type:"mapColors",title:"Map colors",description:""}],supportedCustomFields:{simplePercentage:!0,conditionalPercentage:!1,simpleMaths:!0,rules:!0,aggregateMaths:!0,roundedNumbers:!0},supportedFeatures:{parameters:!1,colorGradient:!1}}),kt={queryEngineConfig:{supportedFeatures:[],supportedAggregates:{},supportedTimeTruncFunctions:{},supportedOperators:{},supportedTransformationFunctions:{}}},Ct=function(e,t){if("custom"==e)return xt;if("barChart"==e)return Ke(t||kt);if("areaChart"==e)return bt(t||kt);if("lineChart"==e)return Je(t||kt);if("pieChart"==e)return et(t||kt);if("scatterChart"==e)return nt(t||kt);if("comboChart"==e)return at(t||kt);if("dataTable"==e)return ct(t||kt);if("basicTable"==e)return ht(t||kt);if("singleStat"==e)return wt(t||kt);if("mercatorMap"==e)return St(t||kt);if("horizontalBarChart"==e)return gt(t||kt);throw`Cannot get interface for ${e}. Please implement it.`};class $t{constructor(e,t,r){this.componentType=e,this.dataSet=null;const{init:n}=Ct(this.componentType,{queryEngineConfig:vn.queryEngineConfig});this.attributes=n(t.id,r)}updateAttributes(e){const{setAttributes:t}=Ct(this.componentType,{queryEngineConfig:vn.queryEngineConfig});if(!this.attributes)throw new Error("Attributes have not been initialized yet");this.attributes=t(this.attributes,e)}}class Ot extends Error{constructor(e){super(e),this.name="FailedToLoadQueryEngineConfig"}}const Ft=Ot;class Tt extends Error{constructor(e){super(`The queryEngineEndpoint value '${e}' is not valid.`),this.name="InvalidQueryEngineEndpoint",this.invalidEndpoint=e}}const Dt=Tt;class Et extends Error{constructor(){super("The queryEngineEndpoint value is not of the correct type. It must be a string or a function."),this.name="InvalidQueryEngineEndpointType"}}const Pt=Et;var Rt=r(307),It=r.n(Rt);const Mt=e=>e.startsWith("/")?Mt(e.slice(1)):e.endsWith("/")?Mt(e.slice(0,-1)):e;const qt=e=>(t,r,n)=>{return i=void 0,o=void 0,s=function*(){let i={};r&&(i.auth=`Bearer ${r}`);let o="";n&&(o=`filter=${n.join(",")}`);const{status:a,body:s}=yield e({path:`/api/v2/auth/project/${t}/access_token?${o}`,method:"get",headers:i});if(200==a)return s.token.token},new((a=void 0)||(a=Promise))((function(e,t){function r(e){try{l(s.next(e))}catch(e){t(e)}}function n(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(r,n)}l((s=s.apply(i,o||[])).next())}));var i,o,a,s};var Lt=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((n=n.apply(e,t||[])).next())}))};const Nt=e=>t=>Lt(void 0,void 0,void 0,(function*(){var r;try{const r=yield((e,t)=>Lt(void 0,void 0,void 0,(function*(){if(e.dashboardAccessToken)return v("Using dashboard access token for auth header"),{auth:`Bearer ${e.dashboardAccessToken}`};if(e.projectAccessToken)return v("Using project access token for auth header"),{auth:`Bearer ${e.projectAccessToken}`};if(e.apiKey)return v("Using API Key for auth header"),{auth:`Api-Key ${e.apiKey}`};if(t.preFetchProjectAccessTokens&&(e.useCookieAuth||e.appSessionAuthToken)){v("Fetching project access token from the Vizzly API",t.preFetchProjectAccessTokens.projectId,"Filtering by",t.preFetchProjectAccessTokens.resourceFilters);const r=yield qt(Nt(e))(t.preFetchProjectAccessTokens.projectId,e.appSessionAuthToken,t.preFetchProjectAccessTokens.resourceFilters);if(r)return v("Project access token received."),{auth:`Bearer ${r}`};v("Failed to receive project access token.")}else v("Not pre-fetching project access token.");return{}})))(e,t),n=t.headers||{},i=((e,t)=>{const r=Mt(e),n=Mt(t),i=(o=e).startsWith("https://")||o.startsWith("http://")||o.startsWith(".")?"":"/";var o;return""==r&&""==n?"/":""==n?`${i}${r}`:""!=r&&""!=n?`${i}${r}/${n}`:`${i}${n}`})(e.host,t.path),o=yield It()(i,{method:t.method,headers:Object.assign(Object.assign({"Content-Type":"application/json",Accept:"application/json"},r),n),redirect:"follow",referrerPolicy:"no-referrer",body:t.body?JSON.stringify(t.body):null,signal:t.abortSignal,mode:t.mode||void 0});let a=yield o.json();return v("HTTP Client Response",{host:e.host,path:t.path,status:o.status,responseId:o.headers.get("X-Request-Id")}),{body:a,status:o.status}}catch(e){if(null===(r=t.abortSignal)||void 0===r?void 0:r.aborted)return console.log("Aborted a request."),{status:500,body:{reason:"Aborted"}};throw e}}));const zt=e=>"string"==typeof e?{}:e.customHeaders?e.customHeaders():{},Bt=e=>t=>{return r=void 0,n=void 0,o=function*(){const r={host:Wt(e)},n=Object.assign(Object.assign({},t),{headers:Object.assign(Object.assign({},t.headers),zt(e))});return Nt(r)(n)},new((i=void 0)||(i=Promise))((function(e,t){function a(e){try{l(o.next(e))}catch(e){t(e)}}function s(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(a,s)}l((o=o.apply(r,n||[])).next())}));var r,n,i,o};const Ut=e=>{return t=void 0,r=void 0,i=function*(){const t=Bt(e),r=yield t({method:"post",mode:"cors",path:"/api/v1/support",body:{}});return 200==r.status?"supportedFeatures"in(n=r.body)?n:Object.assign(Object.assign({},n),{supportedFeatures:["subquery"]}):null;var n},new((n=void 0)||(n=Promise))((function(e,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof n?r:new n((function(e){e(r)}))).then(a,s)}l((i=i.apply(t,r||[])).next())}));var t,r,n,i},Vt={origin:"in-browser",supportedFeatures:["simpleMaths","aggregateMaths","subquery","encryptedDashboards"],supportedTimeTruncFunctions:o(["month","year","quarter","week","day","hour","minute","second"]),supportedAggregates:h(["sum","mean","min","max","count","countDistinct"]),supportedOperators:s([">","<","=","!=",">=","<=","is_one_of","is_not_one_of","starts_with","ends_with","contains_substring","does_not_contain_substring"]),supportedTransformationFunctions:{}};const Wt=e=>"string"==typeof e?e:e.endpoint;r(392);const Gt=350,Yt={colors:["#feae4a","#5fbaff","#e15e9d"],detail:"minimal",fontFamily:"Inter, sans-serif",rowLimit:6,fontSize:"0.65rem"},Ht=(["barChart","horizontalBarChart","areaChart","lineChart","scatterChart","pieChart","singleStat","dataTable","basicTable","comboChart","mercatorMap","custom"].filter((e=>"custom"!=e)),e=>"fields"in e?(e=>{if("globalSelectFilter"==e.type)return{type:"singleSelectFilter",title:e.title,value:null,requiresValue:!1,managedByConfiguration:!1,appliesToFields:e.fields.map((e=>({fieldId:e.field,dataSetId:e.dataSetId})))};if("globalDateTimeFilter"==e.type)return{type:"dateFilter",value:null,requiresValue:!1,managedByConfiguration:!1,title:e.title,appliesToFields:e.fields.map((e=>({fieldId:e.field,dataSetId:e.dataSetId})))};throw`Unrecognised global filter. ${JSON.stringify(e)}`})(e):Object.assign(Object.assign({},e),{type:Kt(e.type)})),Kt=e=>"dateTimeFilter"===e?"dateFilter":e,Xt=t=>{if("isEmpty"in t||Jt(t))return t;const{load:r}=Ct(t.attributes.type),n=r(t.attributes);let i=[];return(0,e.isArray)(t.localFilters)&&(i=[...t.localFilters?t.localFilters:[]].map((e=>Ht(e)))),"addOns"in t.attributes&&(0,e.isEmpty)(i)&&t.attributes.addOns.forEach((e=>{i=[...i,{type:"dateFilter"==e.type?"dateFilter":"singleSelectFilter",value:null,requiresValue:!1,managedByConfiguration:!1,appliesToFields:[{fieldId:e.field,dataSetId:n.dataSetId}]}]})),delete t.addOns,delete n.addOns,Object.assign(Object.assign({},t),{localFilters:i,attributes:n,results:[]})},Zt=e=>({colSpan:e,isEmpty:!0}),Jt=e=>"displayTitle"in e,Qt=t=>{const r=[...t],n=(0,e.sumBy)(r,(e=>e.colSpan));return 12==n||(r[r.length-1].colSpan=r[r.length-1].colSpan+12-n),r};class er{constructor(e){var t,r;if(this.component=void 0,this.localFilters=void 0,this.isEmpty=void 0,null==e?void 0:e.component)this.component=null==e?void 0:e.component,this.colSpan=null!==(t=null==e?void 0:e.colSpan)&&void 0!==t?t:12;else{const t=Zt(null!==(r=null==e?void 0:e.colSpan)&&void 0!==r?r:12);this.colSpan=t.colSpan,this.isEmpty=t.isEmpty}(null==e?void 0:e.localFilters)&&(this.localFilters=null==e?void 0:e.localFilters)}set(e){var t;this.component=e.component,this.colSpan=null!==(t=e.colSpan)&&void 0!==t?t:12,this.isEmpty=!e.component||void 0,this.localFilters=e.localFilters}setColSpan(e){this.colSpan=e}setComponent(e){this.component=e,this.isEmpty=void 0}emptyCell(e){const t=Zt(null!=e?e:12);this.colSpan=t.colSpan,this.isEmpty=t.isEmpty,this.component=void 0}}class tr{constructor(e,t){this.components=[],this.height=Gt,this.components=null!=e?e:[],this.height=null!=t?t:Gt,this.validateTotalColSpan()}addCell(e,t){void 0===t?this.components.push(e):this.components.splice(t,0,e),this.validateTotalColSpan()}setHeight(e){this.height=e}setRow(e){this.components=e,this.validateTotalColSpan()}set(e,t){this.components=e,this.height=null!=t?t:Gt,this.validateTotalColSpan()}validateTotalColSpan(){if(this.components.reduce(((e,t)=>e+t.colSpan),0)>12)throw new Error("Total column span of cells exceeds the allowed limit of 12.")}}const rr=t=>{return{id:t.id,parentDashboardId:t.parent_dashboard_id,isPlayground:!1,globalFilters:[...t.definition.globalFilters||[]].map(Ht),componentLibrary:[...t.definition.componentLibrary].map((e=>Xt(Object.assign(Object.assign({},e),{colSpan:e.colSpan||1})))),theme:Object.assign(Object.assign({},Yt),t.theme),display:(r=t.definition.display,r.map((t=>(t=>{const r=(e=>"components"in e?e:{components:e,height:Gt})(t),n=(0,e.sumBy)(r.components,(e=>null==e?1:0)),i=12-(0,e.sumBy)(r.components,(e=>null==e?0:e.colSpan)),o=Math.floor(i/n),a=[...r.components].map((e=>null===e?{isEmpty:!0,colSpan:o}:"isEmpty"in e||Jt(e)?e:Xt(Object.assign(Object.assign({},e),{colSpan:e.colSpan}))));return{components:Qt(a),height:r.height||Gt}})(t)))),webhookId:t.webhook_id||null,createdAt:new Date(t.created_at),updatedAt:new Date(t.updated_at),metadata:t.metadata||{}};var r},nr=(e,t,r)=>Object.assign(Object.assign({},e),{dataSets:$e(t,r)}),ir=(e,t)=>e.find((e=>e.id==t))||null;class or{constructor(e){this.component=void 0;let t={displayTitle:"New Header",colSpan:12};e&&(t=Object.assign(Object.assign({},t),{displayTitle:e}));const r={components:[t],height:null!=(n=52)?n:Gt};var n;this.component=[r]}setTitle(e){if(!this.component)throw new Error("Header is undefined");Jt(this.component[0].components[0])&&(this.component[0].components[0].displayTitle=e)}}class ar{constructor(e,t){if(this.dashboard=void 0,this.build=()=>{var e,t;if(!this.dashboard)throw new Error("Dashboard is undefined");return Object.assign(Object.assign({},this.dashboard),{display:null===(e=this.dashboard)||void 0===e?void 0:e.display,componentLibrary:null===(t=this.dashboard)||void 0===t?void 0:t.componentLibrary})},!e)throw new Error("Dashboard id is undefined");let r={id:e};(null==t?void 0:t.display)&&(r=Object.assign(Object.assign({},r),{display:sr(null==t?void 0:t.display)})),(null==t?void 0:t.customFields)&&(r=Object.assign(Object.assign({},r),{customFields:t.customFields})),(null==t?void 0:t.library)&&(r=Object.assign(Object.assign({},r),{componentLibrary:lr(null==t?void 0:t.library)})),this.dashboard=(e=>Object.assign({isPlayground:!1,display:[{components:[Zt(8),Zt(4)],height:Gt},{components:[Zt(4),Zt(4),Zt(4)],height:Gt}],componentLibrary:[],globalFilters:[],customFields:{}},e))(r)}setDisplay(e){let t=sr(e);if(!this.dashboard)throw new Error("Dashboard is undefined");this.dashboard.display=t}setCustomFields(e){if(!this.dashboard)throw new Error("Dashboard is undefined");this.dashboard.customFields=e}setLibrary(e){if(!this.dashboard)throw new Error("Dashboard is undefined");this.dashboard.componentLibrary=lr(e)}}function sr(e){let t=[];return e.forEach((e=>{var r,n;if(e instanceof tr){const n=null==e?void 0:e.components.map((e=>{var t;return e.component&&!e.isEmpty?{attributes:e.component.attributes,localFilters:null!==(t=e.localFilters)&&void 0!==t?t:[],updatesFromParameters:{},results:[],colSpan:e.colSpan,reports:[]}:(e.isEmpty,{colSpan:e.colSpan,isEmpty:!0})}));t.push({height:null!==(r=e.height)&&void 0!==r?r:Gt,components:n})}e instanceof or&&(null===(n=e.component)||void 0===n||n.forEach((e=>{t.push({height:e.height,components:e.components})})))})),t}const lr=e=>{var t;let r=[];return null===(t=null==e?void 0:e.library)||void 0===t||t.forEach((e=>{var t;e.component&&e.component.attributes&&r.push({attributes:e.component.attributes,localFilters:null!==(t=e.localFilters)&&void 0!==t?t:[],updatesFromParameters:{},results:[],colSpan:1,reports:[]})})),r};class ur{constructor(e){this.library=void 0,this.library=[],(null==e?void 0:e.components)&&(null==e||e.components.forEach((e=>{var t;const r=new er({component:e,colSpan:1});null===(t=this.library)||void 0===t||t.push(r)})))}addComponent(e,t){var r,n;const i=new er({component:e,colSpan:1,localFilters:null==t?void 0:t.localFilters});void 0===(null==t?void 0:t.position)?null===(r=this.library)||void 0===r||r.push(i):null===(n=this.library)||void 0===n||n.splice(t.position,0,i)}addComponents(e){e.forEach((e=>{var t;const r=new er({component:e,colSpan:1});null===(t=this.library)||void 0===t||t.push(r)}))}}const cr=e=>()=>{return t=void 0,r=void 0,i=function*(){const{status:t,body:r}=yield e({path:"/api/v2/parent-dashboards",method:"get"});if(200==t)return r.dashboards.map((e=>({id:e.id,created_at:e.created_at,updated_at:e.updated_at,webhook_id:e.webhook_id})))},new((n=void 0)||(n=Promise))((function(e,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof n?r:new n((function(e){e(r)}))).then(a,s)}l((i=i.apply(t,r||[])).next())}));var t,r,n,i};const dr=e=>t=>{return r=void 0,n=void 0,o=function*(){const{status:r}=yield e({path:"/api/scheduled-report",method:"post",body:{cronSchedule:t.cronSchedule,dashboardAccessToken:t.dashboardAccessToken,scheduledReportId:t.scheduledReportId}});return 200==r},new((i=void 0)||(i=Promise))((function(e,t){function a(e){try{l(o.next(e))}catch(e){t(e)}}function s(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(a,s)}l((o=o.apply(r,n||[])).next())}));var r,n,i,o};class fr extends Error{constructor(e){super(e),this.name="FailedToCreateDashboardAccess"}}const pr=fr;const hr=e=>(t,r,n)=>{return i=void 0,o=void 0,s=function*(){const{body:i,status:o}=yield e({path:"/api/v2/auth/dashboards/access",method:"post",body:{dashboardAccessToken:t,dashboardAdminOverrideToken:r},abortSignal:n});if(200==o)return{permissions:i.permissions.map((e=>({dashboardId:e.dashboard_id,scope:e.scope,token:e.token,userReference:e.user_reference})))};throw new pr("Failed to fetch dashboard access")},new((a=void 0)||(a=Promise))((function(e,t){function r(e){try{l(s.next(e))}catch(e){t(e)}}function n(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(r,n)}l((s=s.apply(i,o||[])).next())}));var i,o,a,s};class mr extends Error{constructor(e){super(e),this.name="FailedToGetDashboard"}}const gr=mr;const yr=e=>(t,r)=>{return n=void 0,i=void 0,a=function*(){const{body:n,status:i}=yield e({path:"/api/v2/multi-get-dashboard",method:"post",body:{dashboardAccessTokens:t},abortSignal:r});if(200==i)return n;throw new gr("Failed to get dashboard from POST /api/v2/multi-get-dashboard.")},new((o=void 0)||(o=Promise))((function(e,t){function r(e){try{l(a.next(e))}catch(e){t(e)}}function s(e){try{l(a.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(r,s)}l((a=a.apply(n,i||[])).next())}));var n,i,o,a};const vr=e=>t=>{return r=void 0,n=void 0,o=function*(){const{body:r,status:n}=yield e({path:"/api/v2/multi-get-dashboard",method:"post",body:{dashboardAccessTokens:t}});if(200==n)return r;throw new gr("Failed to get potentially encrypted dashboard from POST /api/v2/multi-get-dashboard.")},new((i=void 0)||(i=Promise))((function(e,t){function a(e){try{l(o.next(e))}catch(e){t(e)}}function s(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(a,s)}l((o=o.apply(r,n||[])).next())}));var r,n,i,o};class br extends Error{constructor(e){super(e),this.name="FailedToCreateDashboard"}}const _r=br;class wr extends Error{constructor(e){super(e),this.name="DashboardQuotaReached"}}const xr=wr;const Ar=e=>t=>{return r=void 0,n=void 0,o=function*(){const{body:r,status:n}=yield e({path:"/api/v2/dashboard",method:"post",body:{dashboardAccessToken:t.dashboardAccessToken,definition:t.definition,meta:t.meta||{},parentDashboardId:t.parentDashboardId,permissions:t.permissions}});if(200==n)return{dashboard:r.dashboard,permissions:r.permissions};if(422==n)throw new xr(`Dashboard quota reached; ${JSON.stringify(r)}`);throw new _r("Failed to update the dashboard from POST /api/v2/dashboard")},new((i=void 0)||(i=Promise))((function(e,t){function a(e){try{l(o.next(e))}catch(e){t(e)}}function s(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(a,s)}l((o=o.apply(r,n||[])).next())}));var r,n,i,o};class jr extends Error{constructor(e){super(e),this.name="FailedToUpdateDashboard"}}const Sr=jr;const kr=e=>t=>{return r=void 0,n=void 0,o=function*(){const{body:r,status:n}=yield e({path:"/api/v2/dashboard",method:"put",body:Object.assign({},t)});if(200==n)return r;throw new Sr("Failed to update dashboard from PUT /api/v2/dashboard.")},new((i=void 0)||(i=Promise))((function(e,t){function a(e){try{l(o.next(e))}catch(e){t(e)}}function s(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(a,s)}l((o=o.apply(r,n||[])).next())}));var r,n,i,o};class Cr extends Error{constructor(){super("AI usage limit has been reached.")}}const $r=Cr;const Or=t=>(r,n,i,o)=>{return a=void 0,s=void 0,u=function*(){const{body:a,status:s}=yield t({path:"/api/ai",method:"post",body:{question:r,supported_aggregates:Object.keys(o.supportedAggregates),data_set_fields:[...i.fields].map((e=>({id:e.id,name:e.publicName}))),dashboard_access_token:n}});if(200==s)return((t,r,n)=>{var i,o;let a={},s=(null===(i=t.measure)||void 0===i?void 0:i.filter((e=>{try{return je(r,e.field).canBeMeasure}catch(e){return!1}})))||[];s=s.map((e=>{const t=je(r,e.field),i=_(t,n.supportedAggregates);return w(t,n.supportedAggregates).includes(e.function)?e:{field:e.field,function:i}}));let l=(null===(o=t.dimension)||void 0===o?void 0:o.filter((e=>{try{return je(r,e).canBeDimension}catch(e){return!1}})).map((e=>({field:e,function:"none"}))))||[];return(0,e.isEmpty)(s)||(a.measure=s),(0,e.isEmpty)(l)||(a.dimension=l),a})(a,i,o);if(422==s||429==s)throw new $r;throw"Failed to fetch query attributes from AI."},new((l=void 0)||(l=Promise))((function(e,t){function r(e){try{i(u.next(e))}catch(e){t(e)}}function n(e){try{i(u.throw(e))}catch(e){t(e)}}function i(t){var i;t.done?e(t.value):(i=t.value,i instanceof l?i:new l((function(e){e(i)}))).then(r,n)}i((u=u.apply(a,s||[])).next())}));var a,s,l,u};class Fr extends Error{constructor(e){super(`Failed to save Vizzly config. Received status code ${e}.`),this.name="FailedToSaveVizzlyConfigVersion"}}var Tr;!function(e){e.ConfigStore="cnf_",e.Project="prj_",e.KeyPair="kyp_",e.Dashboard="dsh_",e.ProjectApiKey="vizzly_project_api_key_"}(Tr||(Tr={}));const Dr=e=>(t,r)=>{return n=void 0,i=void 0,a=function*(){const{status:n}=yield e({path:`/api/v3/project/${t}/config`,method:"post",body:{projectId:t,encryptedConfig:r},preFetchProjectAccessTokens:t?{projectId:t,resourceFilters:[Tr.Project,Tr.ConfigStore]}:void 0});if(200!=n)throw new Fr(n);return 200==n},new((o=void 0)||(o=Promise))((function(e,t){function r(e){try{l(a.next(e))}catch(e){t(e)}}function s(e){try{l(a.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(r,s)}l((a=a.apply(n,i||[])).next())}));var n,i,o,a};class Er extends Error{constructor(e){super(`Failed to setup project by saving an encrypted connection and config on the Vizzly API. Received status code ${e}.`),this.name="VizzlyApiCallErrorFailedToSetupProject",this.statusCode=e}}const Pr=e=>(t,r,n)=>{return i=void 0,o=void 0,s=function*(){const{status:i}=yield e({path:"/api/v3/project/connection",method:"post",body:{projectId:t,encryptedConfig:n,encryptedConnection:r},preFetchProjectAccessTokens:{projectId:t,resourceFilters:[Tr.Project]}});if(200!=i)throw new Er(i);return 200==i},new((a=void 0)||(a=Promise))((function(e,t){function r(e){try{l(s.next(e))}catch(e){t(e)}}function n(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(r,n)}l((s=s.apply(i,o||[])).next())}));var i,o,a,s};const Rr=e=>t=>{return r=void 0,n=void 0,o=function*(){const r=`/api/v3/project/${t}/config`,{status:n,body:i}=yield e({path:r,method:"get",preFetchProjectAccessTokens:{projectId:t,resourceFilters:[Tr.ConfigStore]}});if(200==n)return{encryptedConfig:i.encrypted_config};v("HTTP request to fetch Config returned non-200.",r,n,i)},new((i=void 0)||(i=Promise))((function(e,t){function a(e){try{l(o.next(e))}catch(e){t(e)}}function s(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(a,s)}l((o=o.apply(r,n||[])).next())}));var r,n,i,o};const Ir=e=>t=>{return r=void 0,n=void 0,o=function*(){const{status:r,body:n}=yield e({path:`/api/v2/project/${t}/connection`,method:"get",preFetchProjectAccessTokens:{projectId:t,resourceFilters:[Tr.Project]}});return 200==r?{status:r,encryptedCredentials:n.encrypted_credentials}:{status:r}},new((i=void 0)||(i=Promise))((function(e,t){function a(e){try{l(o.next(e))}catch(e){t(e)}}function s(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(a,s)}l((o=o.apply(r,n||[])).next())}));var r,n,i,o};const Mr=e=>t=>{return r=void 0,n=void 0,o=function*(){const{body:r}=yield e({path:`/api/v3/project/${t}/api-key`,method:"post",body:{},preFetchProjectAccessTokens:{projectId:t,resourceFilters:[Tr.Project]}});return r.api_key},new((i=void 0)||(i=Promise))((function(e,t){function a(e){try{l(o.next(e))}catch(e){t(e)}}function s(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(a,s)}l((o=o.apply(r,n||[])).next())}));var r,n,i,o};const qr=e=>(t,r,n)=>{return i=void 0,o=void 0,s=function*(){const{body:i}=yield e({path:`/api/v3/project/${t}/api-key/${r}`,method:"put",body:Object.assign({},n),preFetchProjectAccessTokens:{projectId:t,resourceFilters:[Tr.Project,Tr.ProjectApiKey]}});return i.api_key},new((a=void 0)||(a=Promise))((function(e,t){function r(e){try{l(s.next(e))}catch(e){t(e)}}function n(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(r,n)}l((s=s.apply(i,o||[])).next())}));var i,o,a,s};const Lr=e=>t=>{return r=void 0,n=void 0,o=function*(){const{status:r,body:n}=yield e({path:`/api/v3/project/${t}`,method:"get",preFetchProjectAccessTokens:{projectId:t,resourceFilters:[Tr.Project]}});return 200==r?n.project:null},new((i=void 0)||(i=Promise))((function(e,t){function a(e){try{l(o.next(e))}catch(e){t(e)}}function s(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(a,s)}l((o=o.apply(r,n||[])).next())}));var r,n,i,o};const Nr=e=>(t,r,n)=>{return i=void 0,o=void 0,s=function*(){const{status:i,body:o}=yield e({path:`/api/v3/project/${t}/query-engine-user`,method:"post",body:{email:r,password:n},preFetchProjectAccessTokens:{projectId:t,resourceFilters:[Tr.Project]}});return 200==i},new((a=void 0)||(a=Promise))((function(e,t){function r(e){try{l(s.next(e))}catch(e){t(e)}}function n(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(r,n)}l((s=s.apply(i,o||[])).next())}));var i,o,a,s};const zr=e=>(t,r)=>{return n=void 0,i=void 0,a=function*(){const{status:n,body:i}=yield e({path:`/api/v3/project/${t}/query-engine-user?email=${encodeURIComponent(r)}`,method:"get",preFetchProjectAccessTokens:{projectId:t,resourceFilters:[Tr.Project]}});if(200==n)return i.query_engine_user},new((o=void 0)||(o=Promise))((function(e,t){function r(e){try{l(a.next(e))}catch(e){t(e)}}function s(e){try{l(a.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(r,s)}l((a=a.apply(n,i||[])).next())}));var n,i,o,a};const Br=e=>t=>{return r=void 0,n=void 0,o=function*(){const{status:r,body:n}=yield e({path:`/api/v3/project/${t}/organisation-team-members`,method:"get",preFetchProjectAccessTokens:{projectId:t,resourceFilters:["prj_"]}});if(200==r)return n.team_members},new((i=void 0)||(i=Promise))((function(e,t){function a(e){try{l(o.next(e))}catch(e){t(e)}}function s(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(a,s)}l((o=o.apply(r,n||[])).next())}));var r,n,i,o};const Ur=e=>t=>{return r=void 0,n=void 0,o=function*(){let r={};t&&(r={auth:`Bearer ${t}`});const{body:n,status:i}=yield e({path:"/api/v2/project/self-hosted-query-engine",method:"post",body:{},headers:r});return 200==i?n.project:void 0},new((i=void 0)||(i=Promise))((function(e,t){function a(e){try{l(o.next(e))}catch(e){t(e)}}function s(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(a,s)}l((o=o.apply(r,n||[])).next())}));var r,n,i,o};const Vr=e=>t=>{return r=void 0,n=void 0,o=function*(){let r={};t&&(r={auth:`Bearer ${t}`});const{body:n,status:i}=yield e({path:"/api/v2/project/self-hosted-dynamic-query-engine",method:"post",body:{},headers:r});return 200==i?n.project:void 0},new((i=void 0)||(i=Promise))((function(e,t){function a(e){try{l(o.next(e))}catch(e){t(e)}}function s(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(a,s)}l((o=o.apply(r,n||[])).next())}));var r,n,i,o};const Wr=e=>t=>{return r=void 0,n=void 0,o=function*(){let r={};t&&(r={auth:`Bearer ${t}`});const{body:n,status:i}=yield e({path:"/api/v2/project/self-hosted-in-browser",method:"post",body:{},headers:r});return 200==i?n.project:void 0},new((i=void 0)||(i=Promise))((function(e,t){function a(e){try{l(o.next(e))}catch(e){t(e)}}function s(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(a,s)}l((o=o.apply(r,n||[])).next())}));var r,n,i,o};const Gr=e=>(t,r,n)=>{return i=void 0,o=void 0,s=function*(){let i={};n&&(i={auth:`Bearer ${n}`});const{status:o,body:a}=yield e({path:`/api/v2/project/managed-query-engine/${t}/key-pairs/${r}`,method:"get",headers:i});if(200==o)return{privateKey:a.keys.private_key,publicKey:a.keys.public_key}},new((a=void 0)||(a=Promise))((function(e,t){function r(e){try{l(s.next(e))}catch(e){t(e)}}function n(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(r,n)}l((s=s.apply(i,o||[])).next())}));var i,o,a,s};class Yr extends ae{constructor(e){super(`Failed to save an encrypted secret for ${e}`),this.name="FailedToSaveProjectEncryptedEncryptionSecret"}}class Hr extends ae{constructor(e){super(`An encrypted secret has already been saved for ${e}`),this.name="ProjectEncryptedSecretAlreadySaved"}}const Kr=e=>(t,r,n=!1)=>{return i=void 0,o=void 0,s=function*(){const{status:i}=yield e({path:`/api/v3/project/${t}/encrypted-encryption-secret`,method:"post",body:{projectId:t,encryptedEncryptionSecret:r,allowRotation:n},preFetchProjectAccessTokens:{projectId:t,resourceFilters:[Tr.Project]}});if(400==i&&n)throw new Yr(t);if(400==i&&!n)throw new Hr(t);return 200==i},new((a=void 0)||(a=Promise))((function(e,t){function r(e){try{l(s.next(e))}catch(e){t(e)}}function n(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(r,n)}l((s=s.apply(i,o||[])).next())}));var i,o,a,s};class Xr extends Error{constructor(e){super(e),this.name="ReadPermissionNotFound"}}const Zr=Xr;class Jr extends Error{constructor(e){super(e),this.name="WritePermissionNotFound"}}const Qr=Jr,en=(e,t)=>{const r=t.find((t=>t.dashboardId==e&&"read_write"==t.scope));if(!r)throw new Qr(`Cannot find write permission for dashboard ${e}`);return r};function tn(e,t,r,n){return i=this,o=void 0,s=function*(){let i;const o=Object.assign(Object.assign({},e),{dashboardAccessToken:t.dashboardAccess.signature});if("vizzlyApi"===r.strategy)i=yield n.createDashboard(o);else{if("queryEngine"!==r.strategy)throw`Unsupported strategy for creating dashboard ${JSON.stringify(r)}`;{const e=(a=r.endpoint,e=>{return t=void 0,r=void 0,i=function*(){let t=Bt(a);const{body:r,status:n}=yield t({path:"/api/v1/dashboard",method:"post",body:{dashboardAccessToken:e.dashboardAccessToken,definition:e.definition,meta:e.meta||{},parentDashboardId:e.parentDashboardId,permissions:e.permissions}});if(200==n)return{dashboard:r.dashboard,permissions:r.permissions};if(422==n)throw new xr(`Dashboard quota reached; ${JSON.stringify(r)}`);throw new _r("Failed to update the dashboard from POST /api/v2/dashboard")},new((n=void 0)||(n=Promise))((function(e,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof n?r:new n((function(e){e(r)}))).then(a,s)}l((i=i.apply(t,r||[])).next())}));var t,r,n,i});i=yield e(o)}}var a;return i},new((a=void 0)||(a=Promise))((function(e,t){function r(e){try{l(s.next(e))}catch(e){t(e)}}function n(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(r,n)}l((s=s.apply(i,o||[])).next())}));var i,o,a,s}function rn(e,t,r){return n=this,i=void 0,a=function*(){let n;if("vizzlyApi"===e.strategy)n=yield t.updateDashboard(r);else{if("queryEngine"!==e.strategy)throw`Unsupported strategy for updating dashboard ${JSON.stringify(e)}`;{const t=(i=e.endpoint,e=>{return t=void 0,r=void 0,o=function*(){let t=Bt(i);const{body:r,status:n}=yield t({path:"/api/v1/dashboard",method:"put",body:Object.assign({},e)});if(200==n)return r;throw new Sr("Failed to update dashboard from PUT /api/v1/dashboard.")},new((n=void 0)||(n=Promise))((function(e,i){function a(e){try{l(o.next(e))}catch(e){i(e)}}function s(e){try{l(o.throw(e))}catch(e){i(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof n?r:new n((function(e){e(r)}))).then(a,s)}l((o=o.apply(t,r||[])).next())}));var t,r,n,o});n=yield t(r)}}var i;return n},new((o=void 0)||(o=Promise))((function(e,t){function r(e){try{l(a.next(e))}catch(e){t(e)}}function s(e){try{l(a.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(r,s)}l((a=a.apply(n,i||[])).next())}));var n,i,o,a}function nn(e,t,r,n){const i=rr(e.dashboard),o=nr(i,t,e.dashboard.definition.customFields||{});return{newDashboards:[...r].flatMap((e=>e.id==o.id?n.deleted?[]:[o]:[e])),updatedDashboard:o}}function on(e,t,r,n){return i=this,o=void 0,s=function*(){let i;if("vizzlyApi"==e.strategy)i=yield t.multiGetDashboards(r,n.signal);else{if("queryEngine"!==e.strategy)throw`Unsupported strategy for fetching dashboards ${JSON.stringify(e)}`;{const t=(o=e.endpoint,(e,t)=>{return r=void 0,n=void 0,a=function*(){let r=Bt(o);const{body:n,status:i}=yield r({path:"/api/v1/get-dashboards",method:"post",body:{dashboardAccessTokens:e},abortSignal:t});if(200==i)return n;throw new gr("Failed to get dashboard from POST /api/v1/get-dashboards")},new((i=void 0)||(i=Promise))((function(e,t){function o(e){try{l(a.next(e))}catch(e){t(e)}}function s(e){try{l(a.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(o,s)}l((a=a.apply(r,n||[])).next())}));var r,n,i,a});i=yield t(r,n.signal)}}var o;return i},new((a=void 0)||(a=Promise))((function(e,t){function r(e){try{l(s.next(e))}catch(e){t(e)}}function n(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(r,n)}l((s=s.apply(i,o||[])).next())}));var i,o,a,s}const an={strategy:"vizzlyApi"};function sn(t){return function(e,t){return[...e].map((e=>((e,t)=>{const r=t.find((t=>t.dashboardId==e));if(!r)throw new Zr(`Cannot find read permission for dashboard ${e}`);return r})(e,t).token))}((t=>{let r=[...t].map((e=>e.dashboardId));return(0,e.uniq)(r)})(t),t)}function ln(e){if(Array.isArray(e))return[...e].map((e=>({id:e.id,parentDashboardId:e.parentDashboardId,display:e.display,componentLibrary:e.componentLibrary,createdAt:e.createdAt,updatedAt:e.updatedAt,metadata:e.metadata})));throw new Error("dashboards must be an array")}const un=(t,r)=>{const n=(0,e.cloneDeep)(r).filter((e=>e.parentDashboardId==t));return(0,e.sortBy)(n,(e=>e.updatedAt)).reverse()};class cn extends Error{constructor(e){super(e),this.name="FailedToLoadIdentity"}}const dn=cn;class fn extends Error{constructor(e){super(e),this.name="InvalidIdentityReturn"}}const pn=fn,hn=e=>{const t=(e=>{var t;const r=null===(t=e.split("."))||void 0===t?void 0:t[1];return JSON.parse((n=r,"object"==typeof window&&window&&window.atob?window.atob(n):Buffer.from(n,"base64").toString()).toString());var n})(e);return Object.assign(Object.assign({},t),{signature:e})};const mn=e=>{return t=void 0,r=void 0,i=function*(){let t=yield e();if(t=(e=>{if(!e)throw new pn("Failed to load identity.");const{error:t}=R().object({dashboardAccessToken:R().string().required(),dataAccessToken:R().string(),queryEngineAccessToken:R().string(),projectAccessToken:R().string().optional()}).validate(e);if(t)throw new pn(t.message);return e})(t),!t)throw new dn("Failed to fetch identity config.");const r=(n=window.location.href).split("#vizzly_")[1]||new URLSearchParams(new URL(n).search).get("_vizzlyDashboardAdmin")||null;var n;return{identityConfig:((e,t,r,n)=>{let i=hn(e);"scope"in i||(i.scope="read_write");const o={dashboardAccess:i,dataAccess:t?hn(t):void 0,queryEngineAccessConfig:r?hn(r):void 0,dashboardAdminOverride:n?hn(n):void 0};return(e=>{const t=new Date,r=new Date(e.dashboardAccess.expires),n=!!e.dataAccess&&new Date(e.dataAccess.expires);!1!==n&&n<t&&console.warn("Vizzly data access token expired at;",n),r<t&&console.warn("Vizzly dashboard access token expired at;",r)})(o),o})(t.dashboardAccessToken,t.dataAccessToken,t.queryEngineAccessToken,r),tokens:t}},new((n=void 0)||(n=Promise))((function(e,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof n?r:new n((function(e){e(r)}))).then(a,s)}l((i=i.apply(t,r||[])).next())}));var t,r,n,i};var gn=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((n=n.apply(e,t||[])).next())}))};class yn{constructor(e,t){var r,n;this.abortController=new AbortController,this.identityTokens=null,this.permissions=null,this.identityConfig=null,this.dashboardStorageStrategy=an,this.dashboards=void 0,this.parentDashboardId=void 0,this.loading=!1,this.parentDashboardId=null==t?void 0:t.parentDashboardId,this.identity=e,this.permissions=[],this.dashboardStorageStrategy=(r=vn.queryEngineEndpoint,n=vn.queryEngineConfig,"function"!=typeof r&&r&&n&&n.supportedFeatures.includes("encryptedDashboards")&&"in-browser"!==r?{strategy:"queryEngine",endpoint:r}:an),this.vizzlyAPI=(e=>{const t=Nt(e);return{config:e,getParentDashboards:cr(t),saveScheduledReport:dr(t),createDashboardAccess:hr(t),multiGetDashboards:yr(t),multiGetEncryptedDashboards:vr(t),createDashboard:Ar(t),updateDashboard:kr(t),askAi:Or(t),createVizzlyConfigVersion:Dr(t),getVizzlyConfig:Rr(t),saveConnection:Pr(t),getConnection:Ir(t),createProjectApiKey:Mr(t),updateProjectApiKey:qr(t),getProjectAccessToken:qt(t),getProject:Lr(t),createQueryEngineUser:Nr(t),getQueryEngineUser:zr(t),getProjectTeamMembers:Br(t),createSelfHostedQueryEngineProject:Ur(t),createSelfHostedDynamicQueryEngineProject:Vr(t),createSelfHostedInBrowserQueryEngineProject:Wr(t),getManagedQueryEngineKeyPair:Gr(t),saveEncryptedProjectEncryptionSecret:Kr(t)}})((null==t?void 0:t.vizzlyAPIConfig)||{host:"https://api.vizzly.co"})}getDashboards(){var e;return gn(this,void 0,void 0,(function*(){this.loading=!0;try{this.identityTokens&&this.identityConfig||(yield this.fetchIdentityConfig()),null!==this.permissions&&0!==this.permissions.length||(yield this.setPermissions());const n=sn(null!==(e=this.permissions)&&void 0!==e?e:[]),i=(t=yield on(this.dashboardStorageStrategy,this.vizzlyAPI,n,this.abortController),r=[],t.found.map((e=>{const t=rr(e);return nr(t,r,e.definition.customFields||{})})));return this.dashboards=i,this.loading=!1,un(this.getDefaultParentDashboardIdBase(),ln(i))}catch(e){this.loading=!1,b(e)}var t,r}))}getAllChildDashboards(){return gn(this,void 0,void 0,(function*(){this.loading=!0;try{return yield this.checkEverythingIsDefined(),this.loading=!1,t=ln(this.dashboards),(0,e.cloneDeep)(t).filter((e=>null!=e.parentDashboardId))}catch(e){this.loading=!1,b(e)}var t}))}getParentDashboards(){return gn(this,void 0,void 0,(function*(){this.loading=!0;try{yield this.checkEverythingIsDefined();const r=(t=ln(this.dashboards),(0,e.cloneDeep)(t).filter((e=>null==e.parentDashboardId)));return this.loading=!1,r}catch(e){this.loading=!1,b(e)}var t}))}getChildDashboards(e){return gn(this,void 0,void 0,(function*(){this.loading=!0;try{return yield this.checkEverythingIsDefined(),this.loading=!1,un(e,ln(this.dashboards))}catch(e){this.loading=!1,b(e)}}))}createDashboard(e){var t,r;return gn(this,void 0,void 0,(function*(){this.loading=!0;try{yield this.checkEverythingIsDefined();const n=null!==(t=e.parentDashboardId)&&void 0!==t?t:this.parentDashboardId;if(!n)throw"Cannot create a child dashboard from an undefined parent dashboard which does not exist.";const i=ir(this.dashboards||[],n);if(!i)throw"Cannot create a child dashboard from a parent dashboard which does not exist.";if(null!==this.identityConfig){const t=Object.assign(Object.assign({},function(e,t){return{definition:{display:e.definition.display,componentLibrary:e.definition.componentLibrary,isPlayground:!1,globalFilters:[],customFields:{}},meta:e.meta,parentDashboardId:t.id,permissions:[{scope:"read_write"}]}}(e,i)),{dashboardAccessToken:this.identityConfig.dashboardAccess.signature}),n=yield tn(t,this.identityConfig,this.dashboardStorageStrategy,this.vizzlyAPI);if(n){const{createdDashboard:e,formattedPermissions:t}=function(e,t){const r=rr(e.dashboard);return{createdDashboard:nr(r,[],e.dashboard.definition.customFields||{}),formattedPermissions:e.permissions.map((e=>({dashboardId:e.dashboard_id,scope:e.scope,token:e.token,userReference:e.user_reference})))}}(n);return null===(r=this.dashboards)||void 0===r||r.push(e),this.permissions=null===this.permissions?[...t]:[...this.permissions,...t],this.loading=!1,e}}}catch(e){this.loading=!1,b(e)}}))}updateDashboard(e,t){return gn(this,void 0,void 0,(function*(){this.loading=!0;try{yield this.checkEverythingIsDefined();const r=function(e){return{meta:e.metadata}}(t),n=en(e,this.permissions),i=Object.assign(Object.assign({},r),{dashboardSessionToken:n.token}),o=yield rn(this.dashboardStorageStrategy,this.vizzlyAPI,i),{newDashboards:a,updatedDashboard:s}=nn(o,[],this.dashboards||[],r);return this.dashboards=a,this.loading=!1,s}catch(e){this.loading=!1,b(e)}}))}deleteDashboard(e){return gn(this,void 0,void 0,(function*(){this.loading=!0;try{yield this.checkEverythingIsDefined();const t={},r=en(e,this.permissions),n=yield rn(this.dashboardStorageStrategy,this.vizzlyAPI,{deleted:!0,dashboardSessionToken:r.token}),{newDashboards:i,updatedDashboard:o}=nn(n,[],this.dashboards||[],t);return this.dashboards=i,this.loading=!1,o}catch(e){this.loading=!1,b(e)}}))}isAdmin(){var e,t;return gn(this,void 0,void 0,(function*(){return this.identityTokens&&this.identityConfig||(yield this.fetchIdentityConfig()),(null===(e=this.identityConfig)||void 0===e?void 0:e.dashboardAdminOverride)?"admin":null===(t=this.identityConfig)||void 0===t?void 0:t.dashboardAccess.accessType}))}getDefaultParentDashboardId(){return gn(this,void 0,void 0,(function*(){return yield this.checkEverythingIsDefined(),this.getDefaultParentDashboardIdBase()}))}checkEverythingIsDefined(){return gn(this,void 0,void 0,(function*(){this.identityTokens&&this.identityConfig||(yield this.fetchIdentityConfig()),null!==this.permissions&&0!==this.permissions.length||(yield this.setPermissions()),void 0===this.dashboards&&(yield this.getDashboards())}))}fetchIdentityConfig(){return gn(this,void 0,void 0,(function*(){const{identityConfig:e,tokens:t}=yield mn(this.identity);return this.identityConfig=e,this.identityTokens=t,{identityConfig:e,tokens:t}}))}setPermissions(){var e,t;return gn(this,void 0,void 0,(function*(){try{if(null!==this.identityConfig){const{permissions:r}=yield this.vizzlyAPI.createDashboardAccess(this.identityConfig.dashboardAccess.signature,null===(t=null===(e=this.identityConfig)||void 0===e?void 0:e.dashboardAdminOverride)||void 0===t?void 0:t.signature,this.abortController.signal);return this.permissions=r,r}}catch(e){b(e)}}))}getDefaultParentDashboardIdBase(){if(this.identityConfig&&Array.isArray(this.dashboards))return((e,t,r)=>{if(e){const t=ir(r,e);if(null==t?void 0:t.parentDashboardId)throw"[Vizzly] `parentDashboardId` value must specify an ID for a parent dashboard.";return e}const n=(e=>[...e].filter((e=>null==e.parentDashboardId)))(r);return(e=>{const t=e.filter((e=>e.isProgrammatic));if(0!==t.length){if(t.length>1)throw new Error("There should only be one programmatic dashboard");return t[0].id}})(n)||t||(e=>{if(0==e.length)throw"Cannot get first created dashboard from empty list of dashboards.";return[...e].sort(((e,t)=>{var r=new Date(e.createdAt),n=new Date(t.createdAt);return r.getTime()-n.getTime()}))[0]})(n).id})(this.parentDashboardId,this.identityConfig.dashboardAccess.dashboardId,this.dashboards);throw"Cannot get default parent dashboard id without identity config."}}class vn{static load(e){return t=this,r=void 0,i=function*(){try{return this.queryEngineEndpoint=e,this.queryEngineConfig=yield(t=e,r=void 0,n=void 0,o=function*(){try{if("in-browser"===t)return Vt;if("string"==typeof t||"object"==typeof t&&"endpoint"in t){if(!(e=>{let t="string"==typeof e?e:e.endpoint;return!!t.startsWith("http://")||!!t.startsWith("https://")||!!t.startsWith("/")})(t))throw new Dt(t);const e=yield Ut(t);if(!e)throw new Ft("Failed to load query engine config.");return e}if("function"==typeof t){let e=yield t();if(!e)throw new Ft("Failed to load query engine config.");return Object.assign({},e)}throw new Pt}catch(e){if(e instanceof Dt)throw e;if(e instanceof Pt)throw e;throw new Ft("Failed to load query engine config.")}},new((i=void 0)||(i=Promise))((function(e,t){function a(e){try{l(o.next(e))}catch(e){t(e)}}function s(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof i?r:new i((function(e){e(r)}))).then(a,s)}l((o=o.apply(r,n||[])).next())}))),this.queryEngineConfig}catch(e){return console.error("Error loading vizzly configuration:",e),null}var t,r,n,i,o},new((n=void 0)||(n=Promise))((function(e,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof n?r:new n((function(e){e(r)}))).then(a,s)}l((i=i.apply(t,r||[])).next())}));var t,r,n,i}static get Dashboard(){return ar}static get Library(){return ur}static get Cell(){return er}static get Row(){return tr}static get Header(){return or}static get API(){return yn}}vn.queryEngineConfig=void 0,vn.queryEngineEndpoint=void 0,vn.AreaChart=class extends $t{constructor(e,t){super("areaChart",e,t)}},vn.LineChart=class extends $t{constructor(e,t){super("lineChart",e,t)}},vn.BarChart=class extends $t{constructor(e,t){super("barChart",e,t)}},vn.PieChart=class extends $t{constructor(e,t){super("pieChart",e,t)}},vn.ScatterChart=class extends $t{constructor(e,t){super("scatterChart",e,t)}},vn.ComboChart=class extends $t{constructor(e,t){super("comboChart",e,t)}},vn.PivotTable=class extends $t{constructor(e,t){super("dataTable",e,t)}},vn.BasicTable=class extends $t{constructor(e,t){super("basicTable",e,t)}},vn.HorizontalBarChart=class extends $t{constructor(e,t){super("horizontalBarChart",e,t)}},vn.MercatorMap=class extends $t{constructor(e,t){super("mercatorMap",e,t)}},vn.SingleStat=class extends $t{constructor(e,t){super("singleStat",e,t)}}})();var i=n.D;export{i as Vizzly};
|