OwlCyberSecurity - MANAGER
Edit File: donationFormApp.js
(()=>{var e={32485:(e,t)=>{var r;!function(){"use strict";var n={}.hasOwnProperty;function s(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var o=typeof r;if("string"===o||"number"===o)e.push(r);else if(Array.isArray(r)){if(r.length){var i=s.apply(null,r);i&&e.push(i)}}else if("object"===o){if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]")){e.push(r.toString());continue}for(var a in r)n.call(r,a)&&r[a]&&e.push(a)}}}return e.join(" ")}e.exports?(s.default=s,e.exports=s):void 0===(r=function(){return s}.apply(t,[]))||(e.exports=r)}()},16075:e=>{var t;self,t=()=>{return e={7629:(e,t,r)=>{"use strict";const n=r(375),s=r(8571),o=r(9474),i=r(1687),a=r(8652),l=r(8160),c=r(3292),u=r(6354),f=r(8901),d=r(9708),m=r(6914),p=r(2294),h=r(6133),g=r(1152),y=r(8863),b=r(2036),v={Base:class{constructor(e){this.type=e,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new p.Ids,this._preferences=null,this._refs=new h.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 d.describe,"Manifest functionality disabled"),d.describe(this)}allow(...e){return l.verifyFlat(e,"allow"),this._values(e,"_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 s=e[r];n("function"==typeof s,"Alteration adjuster for",r,"must be a function"),t.$_terms.alterations.push({target:r,adjuster:s})}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,t={}){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(...e){return this._values(e,"_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(...e){n(e.length,"Missing notes");for(const t of e)n(t&&"string"==typeof t,"Notes must be non-empty strings");return this._inner("notes",e)}only(e=!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(e=!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(e=!0){return this.$_setFlag("result",e?"strip":void 0)}tag(...e){n(e.length,"Missing tags");for(const t of e)n(t&&"string"==typeof t,"Tags must be non-empty strings");return this._inner("tags",e)}unit(e){return n(e&&"string"==typeof e,"Unit name must be a non-empty string"),this.$_setFlag("unit",e)}valid(...e){l.verifyFlat(e,"valid");const t=this.allow(...e);return t.$_setFlag("only",!!t._valids,{clone:!1}),t}when(e,t){const r=this.clone();r.$_terms.whens||(r.$_terms.whens=[]);const s=c.when(r,e,t);if(!["any","link"].includes(r.type)){const e=s.is?[s]:s.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(s),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||a.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,h.toSibling),t._preferences=t._preferences?l.preferences(t._preferences,e._preferences):e._preferences,t._valids=b.merge(t._valids,e._valids,e._invalids),t._invalids=b.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,i(t._flags,r)}else if(e._flags.empty){t._flags.empty=e._flags.empty;const r=Object.assign({},e._flags);delete r.empty,i(t._flags,r)}else i(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"),f.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 i=r;i<o._rules.length;++i){const r=o._rules[i],a=s(r);for(const s in e)t.modifiers[s](a,e[s]),n(a.name===r.name,"Cannot change rule name");o._rules[i]=a,o._singleRules.get(a.name)===r&&o._singleRules.set(a.name,a)}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:s}of this.$_terms.alterations)e.includes(r)&&(t=s(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],s=t.args;n(r,"Unknown rule",t.method);const o=this.clone();if(s){n(1===Object.keys(s).length||Object.keys(s).length===this._definition.rules[t.name].args.length,"Invalid rule definition for",this.type,t.name);for(const e in s){let i=s[e];if(r.argsByName){const a=r.argsByName.get(e);if(a.ref&&l.isResolvable(i))t._resolve.push(e),o.$_mutateRegister(i);else if(a.normalize&&(i=a.normalize(i),s[e]=i),a.assert){const t=l.validateArg(i,e,a);n(!t,t,"or reference")}}void 0!==i?s[e]=i:delete s[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 c.schema(this.$_root,e,t)}$_createError(e,t,r,n,s,o={}){const i=!1!==o.flags?this._flags:{},a=o.messages?m.merge(this._definition.messages,o.messages):this._definition.messages;return new u.Report(e,t,r,i,a,n,s)}$_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 s=!y.validate(e,this,t,r,n).errors;return t.restore(),s}$_modify(e){return l.assertOptions(e,["each","once","ref","schema"]),p.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,{source:t,name:r,path:n,key:s})=>{const o=this._definition[t][r]&&this._definition[t][r].register;!1!==o&&this.$_mutateRegister(e,{family:o,key:s})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(e,{family:t,key:r}={}){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,r={}){n("_"===e[0]||!this._inRuleset(),"Cannot set flag inside a ruleset");const s=this._definition.flags[e]||{};if(o(t,s.default)&&(t=void 0),o(t,this._flags[e]))return this;const i=!1!==r.clone?this.clone():this;return void 0!==t?(i._flags[e]=t,i.$_mutateRegister(t)):delete i._flags[e],"_"!==e[0]&&(i.$_temp.ruleset=!1),i}$_parent(e,...t){return this[e][l.symbols.parent].call(this,...t)}$_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=s(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,r={}){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=[],s=[];for(let o=0;o<this.$_terms.whens.length;++o){const i=this.$_terms.whens[o];if(i.concat){n.push(i.concat),s.push(`${o}.concat`);continue}const a=i.ref?i.ref.resolve(e,t,r):e,l=i.is?[i]:i.switch,c=s.length;for(let c=0;c<l.length;++c){const{is:u,then:f,otherwise:d}=l[c],m=`${o}${i.switch?"."+c:""}`;if(u.$_match(a,t.nest(u,`${m}.is`),r)){if(f){const o=t.localize([...t.path,`${m}.then`],t.ancestors,t.schemas),{schema:i,id:a}=f._generate(e,o,r);n.push(i),s.push(`${m}.then${a?`(${a})`:""}`);break}}else if(d){const o=t.localize([...t.path,`${m}.otherwise`],t.ancestors,t.schemas),{schema:i,id:a}=d._generate(e,o,r);n.push(i),s.push(`${m}.otherwise${a?`(${a})`:""}`);break}}if(i.break&&s.length>c)break}const o=s.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 i=this;this._definition.generate&&(i=this._definition.generate(this,e,t,r));for(const e of n)i=i.concat(e);return this.$_root._tracer&&this.$_root._tracer._combine(i,[this,...n]),this.$_temp.whens[o]=i,{schema:i,id:o}}_inner(e,t,r={}){n(!this._inRuleset(),`Cannot set ${e} inside a ruleset`);const s=this.clone();return s.$_terms[e]&&!r.override||(s.$_terms[e]=[]),r.single?s.$_terms[e].push(t):s.$_terms[e].push(...t),s.$_temp.ruleset=!1,s}_inRuleset(){return null!==this.$_temp.ruleset&&!1!==this.$_temp.ruleset}_ruleRemove(e,t={}){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 s=r._rules[t];s.name!==e||s.keep?n.push(s):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(),s=e[0]===l.symbols.override;if(s&&(e=e.slice(1)),!r[t]&&e.length?r[t]=new b:s&&(r[t]=e.length?new b:null,r.$_mutateRebuild()),!r[t])return r;s&&r[t].override();for(const s of e){n(void 0!==s,"Cannot call allow/valid/invalid with undefined"),n(s!==l.symbols.override,"Override must be the first value");const e="_invalids"===t?"_valids":"_invalids";r[e]&&(r[e].remove(s),r[e].length||(n("_valids"===t||!r._flags.only,"Setting invalid value",s,"leaves schema rejecting all values due to previous valid rule"),r[e]=null)),r[t].add(s,r._refs)}return r}}};v.Base.prototype[l.symbols.any]={version:l.version,compile:c.compile,root:"$_root"},v.Base.prototype.isImmutable=!0,v.Base.prototype.deny=v.Base.prototype.invalid,v.Base.prototype.disallow=v.Base.prototype.invalid,v.Base.prototype.equal=v.Base.prototype.valid,v.Base.prototype.exist=v.Base.prototype.required,v.Base.prototype.not=v.Base.prototype.invalid,v.Base.prototype.options=v.Base.prototype.prefs,v.Base.prototype.preferences=v.Base.prototype.prefs,e.exports=new v.Base},8652:(e,t,r)=>{"use strict";const n=r(375),s=r(8571),o=r(8160),i={max:1e3,supported:new Set(["undefined","boolean","number","string"])};t.provider={provision:e=>new i.Cache(e)},i.Cache=class{constructor(e={}){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||i.max,this._map=new Map,this._list=new i.List}get length(){return this._map.size}set(e,t){if(null!==e&&!i.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),s(t.value)}_compact(){if(this._map.size>this._max){const e=this._list.pop();this._map.delete(e.key)}}},i.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)=>{"use strict";const n=r(375),s=r(7916),o=r(5934);let i,a;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,r="Options"){n(e&&"object"==typeof e&&!Array.isArray(e),"Options must be of type object");const s=Object.keys(e).filter((e=>!t.includes(e)));n(0===s.length,`${r} contain unknown keys: ${s}`)},t.checkPreferences=function(e){a=a||r(3378);const t=a.preferences.validate(e);if(t.error)throw new s([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,r={}){const s=e&&e[t.symbols.any];return!!s&&(n(r.legacy||s.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){i=i||r(6914),e=e||{},n=n||{};const s=Object.assign({},e,n);return n.errors&&e.errors&&(s.errors=Object.assign({},e.errors,n.errors),s.errors.wrap=Object.assign({},e.errors.wrap,n.errors.wrap)),n.messages&&(s.messages=i.compile(n.messages,e.messages)),delete s[t.symbols.prefs],s},t.tryWithPath=function(e,t,r={}){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,{assert:n,message:s}){if(t.isSchema(n)){const t=n.validate(e);if(!t.error)return;return t.error.message}if(!n(e))return r?`${r} ${s}`:s},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)=>{"use strict";const n=r(375),s=r(8160),o=r(6133),i={};t.schema=function(e,t,r={}){s.assertOptions(r,["appendPath","override"]);try{return i.schema(e,t,r)}catch(e){throw r.appendPath&&void 0!==e.path&&(e.message=`${e.message} (${e.path})`),e}},i.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=(t,...n)=>!1!==r.override?t.valid(e.override,...n):t.valid(...n);if(i.simple(t))return o(e,t);if("function"==typeof t)return e.custom(t);if(n("object"==typeof t,"Invalid schema content:",typeof t),s.isResolvable(t))return o(e,t);if(s.isSchema(t))return t;if(Array.isArray(t)){for(const r of t)if(!i.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,o={}){s.assertOptions(o,["legacy"]);const a=r&&r[s.symbols.any];if(a)return n(o.legacy||a.version===s.version,"Cannot mix different versions of joi schemas:",a.version,s.version),r;if("object"!=typeof r||!o.legacy)return t.schema(e,r,{appendPath:!0});const l=i.walk(r);return l?l.compile(l.root,r):t.schema(e,r,{appendPath:!0})},i.walk=function(e){if("object"!=typeof e)return null;if(Array.isArray(e)){for(const t of e){const e=i.walk(t);if(e)return e}return null}const t=e[s.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=i.walk(e[t]);if(r)return r}return null},i.simple=function(e){return null===e||["boolean","string","number"].includes(typeof e)},t.when=function(e,r,a){if(void 0===a&&(n(r&&"object"==typeof r,"Missing options"),a=r,r=o.create(".")),Array.isArray(a)&&(a={switch:a}),s.assertOptions(a,["is","not","then","otherwise","switch","break"]),s.isSchema(r))return n(void 0===a.is,'"is" can not be used with a schema condition'),n(void 0===a.not,'"not" can not be used with a schema condition'),n(void 0===a.switch,'"switch" can not be used with a schema condition'),i.condition(e,{is:r,then:a.then,otherwise:a.otherwise,break:a.break});if(n(o.isRef(r)||"string"==typeof r,"Invalid condition:",r),n(void 0===a.not||void 0===a.is,'Cannot combine "is" with "not"'),void 0===a.switch){let l=a;void 0!==a.not&&(l={is:a.not,then:a.otherwise,otherwise:a.then,break:a.break});let c=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===a.is||o.isRef(a.is)||s.isSchema(a.is)||(c=c.required()),i.condition(e,{ref:t.ref(r),is:c,then:l.then,otherwise:l.otherwise,break:l.break})}n(Array.isArray(a.switch),'"switch" must be an array'),n(void 0===a.is,'Cannot combine "switch" with "is"'),n(void 0===a.not,'Cannot combine "switch" with "not"'),n(void 0===a.then,'Cannot combine "switch" with "then"');const l={ref:t.ref(r),switch:[],break:a.break};for(let t=0;t<a.switch.length;++t){const r=a.switch[t],i=t===a.switch.length-1;s.assertOptions(r,i?["is","then","otherwise"]:["is","then"]),n(void 0!==r.is,'Switch statement missing "is"'),n(void 0!==r.then,'Switch statement missing "then"');const c={is:e.$_compile(r.is),then:e.$_compile(r.then)};if(o.isRef(r.is)||s.isSchema(r.is)||(c.is=c.is.required()),i){n(void 0===a.otherwise||void 0===r.otherwise,'Cannot specify "otherwise" inside and outside a "switch"');const t=void 0!==a.otherwise?a.otherwise:r.otherwise;void 0!==t&&(n(void 0===l.break,"Cannot specify both otherwise and break"),c.otherwise=e.$_compile(t))}l.switch.push(c)}return l},i.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)=>{"use strict";const n=r(5688),s=r(8160),o=r(3328);t.Report=class{constructor(e,r,n,s,o,i,a){if(this.code=e,this.flags=s,this.messages=o,this.path=i.path,this.prefs=a,this.state=i,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,i){if(!t)return;if(o.isTemplate(t))return"root"!==r?t:null;let a=i.errors.language;if(s.isResolvable(a)&&(a=a.resolve(e,n,i)),a&&t[a]){if(void 0!==t[a][r])return t[a][r];if(void 0!==t[a]["*"])return t[a]["*"]}return t[r]?t[r]:t["*"]},t.label=function(e,r,n,s){if(!n.errors.label)return"";if(e.label)return e.label;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)||s&&t.template(null,s,"root",r,n)||"value"},t.process=function(e,r,n){if(!e)return null;const{override:s,message:o,details:i}=t.details(e);if(s)return s;if(n.errors.stack)return new t.ValidationError(o,i,r);const a=Error.stackTraceLimit;Error.stackTraceLimit=0;const l=new t.ValidationError(o,i,r);return Error.stackTraceLimit=a,l},t.details=function(e,t={}){let r=[];const n=[];for(const s of e){if(s instanceof Error){if(!1!==t.override)return{override:s};const e=s.toString();r.push(e),n.push({message:e,type:"override",context:{error:s}});continue}const e=s.toString();r.push(e),n.push({message:e,path:s.path.filter((e=>"object"!=typeof e)),type:s.code,context:s.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)=>{"use strict";const n=r(375),s=r(8571),o=r(8160),i=r(6914),a={};t.type=function(e,t){const r=Object.getPrototypeOf(e),l=s(r),c=e._assign(Object.create(l)),u=Object.assign({},t);delete u.base,l._definition=u;const f=r._definition||{};u.messages=i.merge(f.messages,u.messages),u.properties=Object.assign({},f.properties,u.properties),c.type=u.type,u.flags=Object.assign({},f.flags,u.flags);const d=Object.assign({},f.terms);if(u.terms)for(const e in u.terms){const t=u.terms[e];n(void 0===c.$_terms[e],"Invalid term override for",u.type,e),c.$_terms[e]=t.init,d[e]=t}u.terms=d,u.args||(u.args=f.args),u.prepare=a.prepare(u.prepare,f.prepare),u.coerce&&("function"==typeof u.coerce&&(u.coerce={method:u.coerce}),u.coerce.from&&!Array.isArray(u.coerce.from)&&(u.coerce={method:u.coerce.method,from:[].concat(u.coerce.from)})),u.coerce=a.coerce(u.coerce,f.coerce),u.validate=a.validate(u.validate,f.validate);const m=Object.assign({},f.rules);if(u.rules)for(const e in u.rules){const t=u.rules[e];n("object"==typeof t,"Invalid rule definition for",u.type,e);let r=t.method;if(void 0===r&&(r=function(){return this.$_addRule(e)}),r&&(n(!l[e],"Rule conflict in",u.type,e),l[e]=r),n(!m[e],"Rule conflict in",u.type,e),m[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))))}u.rules=m;const p=Object.assign({},f.modifiers);if(u.modifiers)for(const e in u.modifiers){n(!l[e],"Rule conflict in",u.type,e);const t=u.modifiers[e];n("function"==typeof t,"Invalid modifier definition for",u.type,e);const r=function(t){return this.rule({[e]:t})};l[e]=r,p[e]=t}if(u.modifiers=p,u.overrides){l._super=r,c.$_super={};for(const e in u.overrides)n(r[e],"Cannot override missing",e),u.overrides[e][o.symbols.parent]=r[e],c.$_super[e]=r[e].bind(c);Object.assign(l,u.overrides)}u.cast=Object.assign({},f.cast,u.cast);const h=Object.assign({},f.manifest,u.manifest);return h.build=a.build(u.manifest&&u.manifest.build,f.manifest&&f.manifest.build),u.manifest=h,u.rebuild=a.rebuild(u.rebuild,f.rebuild),c},a.build=function(e,t){return e&&t?function(r,n){return t(e(r,n),n)}:e||t},a.coerce=function(e,t){return e&&t?{from:e.from&&t.from?[...new Set([...e.from,...t.from])]:null,method(r,n){let s;if((!t.from||t.from.includes(typeof r))&&(s=t.method(r,n),s)){if(s.errors||void 0===s.value)return s;r=s.value}if(!e.from||e.from.includes(typeof r)){const t=e.method(r,n);if(t)return t}return s}}:e||t},a.prepare=function(e,t){return e&&t?function(r,n){const s=e(r,n);if(s){if(s.errors||void 0===s.value)return s;r=s.value}return t(r,n)||s}:e||t},a.rebuild=function(e,t){return e&&t?function(r){t(r),e(r)}:e||t},a.validate=function(e,t){return e&&t?function(r,n){const s=t(r,n);if(s){if(s.errors&&(!Array.isArray(s.errors)||s.errors.length))return s;r=s.value}return e(r,n)||s}:e||t}},5107:(e,t,r)=>{"use strict";const n=r(375),s=r(8571),o=r(8652),i=r(8160),a=r(3292),l=r(6354),c=r(8901),u=r(9708),f=r(6133),d=r(3328),m=r(1152);let p;const h={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(h.types))};for(const t of e._types)e[t]=function(...e){return n(!e.length||["alternatives","link","object"].includes(t),"The",t,"type does not allow arguments"),h.generate(this,h.types[t],e)};for(const t of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])e[t]=function(...e){return this.any()[t](...e)};Object.assign(e,h.methods);for(const t in h.aliases){const r=h.aliases[t];e[t]=e[r]}return e.x=e.expression,m.setup&&m.setup(e),e}};h.methods={ValidationError:l.ValidationError,version:i.version,cache:o.provider,assert(e,t,...r){h.assert(e,t,!0,r)},attempt:(e,t,...r)=>h.assert(e,t,!1,r),build(e){return n("function"==typeof u.build,"Manifest functionality disabled"),u.build(this,e)},checkPreferences(e){i.checkPreferences(e)},compile(e,t){return a.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 s=e(t[r]());n(i.isSchema(s),"modifier must return a valid schema object"),t[r]=function(...e){return h.generate(this,s,e)}}return t},expression:(...e)=>new d(...e),extend(...e){i.verifyFlat(e,"extend"),p=p||r(3378),n(e.length,"You need to provide at least one extension"),this.assert(e,p.extensions);const t=Object.assign({},this);t._types=new Set(t._types);for(let r of e){"function"==typeof r&&(r=r(t)),this.assert(r,p.extension);const e=h.expandExtension(r,t);for(const r of e){n(void 0===t[r.type]||t._types.has(r.type),"Cannot override name",r.type);const e=r.base||this.any(),s=c.type(e,r);t._types.add(r.type),t[r.type]=function(...e){return h.generate(this,s,e)}}}return t},isError:l.ValidationError.isError,isExpression:d.isTemplate,isRef:f.isRef,isSchema:i.isSchema,in:(...e)=>f.in(...e),override:i.symbols.override,ref:(...e)=>f.create(...e),types(){const e={};for(const t of this._types)e[t]=this[t]();for(const t in h.aliases)e[t]=this[t]();return e}},h.assert=function(e,t,r,n){const o=n[0]instanceof Error||"string"==typeof n[0]?n[0]:null,a=null!==o?n[1]:n[0],c=t.validate(e,i.preferences({errors:{stack:!0}},a||{}));let u=c.error;if(!u)return c.value;if(o instanceof Error)throw o;const f=r&&"function"==typeof u.annotate?u.annotate():u.message;throw u instanceof l.ValidationError==0&&(u=s(u)),u.message=o?`${o} ${f}`:f,u},h.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},h.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 s=Object.assign({},e);s.type=n,s.base=t[n](),r.push(s)}return r},e.exports=h.root()},6914:(e,t,r)=>{"use strict";const n=r(375),s=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?s(t):{};for(let r in e){const s=e[r];if("root"===r||o.isTemplate(s)){t[r]=s;continue}if("string"==typeof s){t[r]=new o(s);continue}n("object"==typeof s&&!Array.isArray(s),"Invalid message for",r);const i=r;for(r in t[i]=t[i]||{},s){const e=s[r];"root"===r||o.isTemplate(e)?t[i][r]=e:(n("string"==typeof e,"Invalid message for",r,"in",i),t[i][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 s=r;for(r in t[s]={},n){const e=n[r];"root"!==r?t[s][r]=e.describe({compact:!0}):t[s].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 i=s(e);for(let e in r){const t=r[e];if("root"===e||o.isTemplate(t)){i[e]=t;continue}if("string"==typeof t){i[e]=new o(t);continue}n("object"==typeof t&&!Array.isArray(t),"Invalid message for",e);const s=e;for(e in i[s]=i[s]||{},t){const r=t[e];"root"===e||o.isTemplate(r)?i[s][e]=r:(n("string"==typeof r,"Invalid message for",e,"in",s),i[s][e]=new o(r))}}return i}},2294:(e,t,r)=>{"use strict";const n=r(375),s=r(8160),o=r(6133),i={};t.Ids=i.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){const e=new i.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 a=o.shift();let l={id:a.id,schema:t(a.schema)};n(s.isSchema(l.schema),"adjuster function failed to return a joi schema type");for(const e of o)l={id:e.id,schema:i.fork(e.schema,l.id,l.schema)};return l.schema}labels(e,t=[]){const r=e[0],n=this._get(r);if(!n)return[...t,...e].join(".");const s=e.slice(1);return t=[...t,n.schema._flags.label||r],s.length?n.schema._ids.labels(s,t):t.join(".")}reach(e,t=[]){const r=e[0],s=this._get(r);n(s,"Schema does not contain path",[...t,...e].join("."));const o=e.slice(1);return o.length?s.schema._ids.reach(o,[...t,r]):s.schema}register(e,{key:t}={}){if(!e||!s.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,t=[],r=[]){const s=e[0],o=this._get(s);n(o,"Schema does not contain path",[...t,...e].join(".")),r=[o,...r];const i=e.slice(1);return i.length?o.schema._ids._collect(i,[...t,s],r):r}_get(e){return this._byId.get(e)||this._byKey.get(e)}},i.fork=function(e,r,n){const s=t.schema(e,{each:(e,{key:t})=>{if(r===(e._flags.id||t))return n},ref:!1});return s?s.$_mutateRebuild():e},t.schema=function(e,t){let r;for(const n in e._flags){if("_"===n[0])continue;const s=i.scan(e._flags[n],{source:"flags",name:n},t);void 0!==s&&(r=r||e.clone(),r._flags[n]=s)}for(let n=0;n<e._rules.length;++n){const s=e._rules[n],o=i.scan(s.args,{source:"rules",name:s.name},t);if(void 0!==o){r=r||e.clone();const t=Object.assign({},s);t.args=o,r._rules[n]=t,r._singleRules.get(s.name)===s&&r._singleRules.set(s.name,t)}}for(const n in e.$_terms){if("_"===n[0])continue;const s=i.scan(e.$_terms[n],{source:"terms",name:n},t);void 0!==s&&(r=r||e.clone(),r.$_terms[n]=s)}return r},i.scan=function(e,t,r,n,a){const l=n||[];if(null===e||"object"!=typeof e)return;let c;if(Array.isArray(e)){for(let n=0;n<e.length;++n){const s="terms"===t.source&&"keys"===t.name&&e[n].key,o=i.scan(e[n],t,r,[n,...l],s);void 0!==o&&(c=c||e.slice(),c[n]=o)}return c}if(!1!==r.schema&&s.isSchema(e)||!1!==r.ref&&o.isRef(e)){const n=r.each(e,{...t,path:l,key:a});if(n===e)return;return n}for(const n in e){if("_"===n[0])continue;const s=i.scan(e[n],t,r,[n,...l],a);void 0!==s&&(c=c||Object.assign({},e),c[n]=s)}return c}},6133:(e,t,r)=>{"use strict";const n=r(375),s=r(8571),o=r(9621),i=r(8160);let a;const l={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};t.create=function(e,t={}){n("string"==typeof e,"Invalid reference key:",e),i.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 s=r.separator,o=l.context(e,s,t.prefix);if(r.type=o.type,e=o.key,"value"===r.type)if(o.root&&(n(!s||e[0]!==s,"Cannot specify relative path with root prefix"),r.ancestor="root",e||(e=null)),s&&s===e)e=null,r.ancestor=0;else if(void 0!==r.ancestor)n(!s||!e||e[0]!==s,"Cannot combine prefix with ancestor option");else{const[t,n]=l.ancestor(e,s);n&&""===(e=e.slice(n))&&(e=null),r.ancestor=t}return r.path=s?null===e?[]:e.split(s):[e],new l.Ref(r)},t.in=function(e,r={}){return t.create(e,{...r,in:!0})},t.isRef=function(e){return!!e&&!!e[i.symbols.ref]},l.Ref=class{constructor(e){n("object"==typeof e,"Invalid reference construction"),i.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,s,o={}){return n(!this.in||o.in,"Invalid in() reference usage"),"global"===this.type?this._resolve(r.context,t,o):"local"===this.type?this._resolve(s,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[i.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,r={}){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 s=void 0===r.local?"#":r.local;if(s!==t&&e.startsWith(s))return{key:e.slice(s.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(i.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}),a=a||r(3328),a.isTemplate(e)&&this.register(e.refs(),n)}get length(){return this.refs.length}clone(){const e=new t.Manager;return e.refs=s(this.refs),e}reset(){this.refs=[]}roots(){return this.refs.filter((e=>!e.ancestor)).map((e=>e.root))}}},3378:(e,t,r)=>{"use strict";const n=r(5107),s={};s.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:s.wrap,array:s.wrap,string:s.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(),s.nameRx=/^[a-zA-Z0-9]\w*$/,s.rule=n.object({alias:n.array().items(n.string().pattern(s.nameRx)).single(),args:n.array().items(n.string(),n.object({name:n.string().pattern(s.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(s.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(s.nameRx,n.object({setter:n.string(),default:n.any()})),manifest:{build:n.function().arity(2)},messages:[n.object(),n.string()],modifiers:n.object().pattern(s.nameRx,n.function().minArity(1).maxArity(2)),overrides:n.object().pattern(s.nameRx,n.function()),prepare:n.function().maxArity(3),rebuild:n.function().arity(1),rules:n.object().pattern(s.nameRx,s.rule),terms:n.object().pattern(s.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(),s.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()})},s.desc.entity=n.alternatives([n.array().items(n.link("...")),n.boolean(),n.function(),n.number(),n.string(),s.desc.buffer,s.desc.func,s.desc.ref,s.desc.regex,s.desc.special,s.desc.template,s.desc.value,n.link("/")]),s.desc.values=n.array().items(null,n.boolean(),n.function(),n.number().allow(1/0,-1/0),n.string().allow(""),n.symbol(),s.desc.buffer,s.desc.func,s.desc.override,s.desc.ref,s.desc.regex,s.desc.template,s.desc.value),s.desc.messages=n.object().pattern(/.+/,[n.string(),s.desc.template,n.object().pattern(/.+/,[n.string(),s.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:s.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(),s.desc.ref],wrap:{label:s.wrap,array:s.wrap}},externals:n.boolean(),messages:s.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:s.desc.values,invalid:s.desc.values,rules:n.array().min(1).items({name:n.string().required(),args:n.object().min(1),keep:n.boolean(),message:[n.string(),s.desc.messages],warn:n.boolean()}),keys:n.object().pattern(/.*/,n.link("/")),link:s.desc.ref}).pattern(/^[a-z]\w*$/,n.any())},493:(e,t,r)=>{"use strict";const n=r(8571),s=r(9621),o=r(8160),i={value:Symbol("value")};e.exports=i.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,t=null,r=null){const n=new i.State(e,t,this);return r&&n.schemas&&(n.schemas=[i.schemas(r),...n.schemas]),n}nest(e,t){const r=new i.State(this.path,this.ancestors,this);return r.schemas=r.schemas&&[i.schemas(e),...r.schemas],r.debug=t,r}shadow(e,t){this.mainstay.shadow=this.mainstay.shadow||new i.Shadow,this.mainstay.shadow.set(this.path,e,t)}snapshot(){this.mainstay.shadow&&(this._snapshot=n(this.mainstay.shadow.node(this.path))),this.mainstay.snapshot()}restore(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.restore()}commit(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.commit()}},i.schemas=function(e){return o.isSchema(e)?{schema:e}:e},i.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 s=n.get(r);s||(s=new Map,n.set(r,s)),n=s}n[i.value]=t}get(e){const t=this.node(e);if(t)return t[i.value]}node(e){if(this._values)return s(this._values,e,{iterables:!0})}override(e,t){if(!this._values)return;const r=e.slice(0,-1),n=e[e.length-1],o=s(this._values,r,{iterables:!0});t?o.set(n,t):o&&o.delete(n)}}},3328:(e,t,r)=>{"use strict";const n=r(375),s=r(8571),o=r(5277),i=r(1447),a=r(8160),l=r(6354),c=r(6133),u={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=u.Template=class{constructor(e,t){if(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,t){const{functions:e,...r}=t;this._settings=Object.keys(r).length?s(r):void 0,this._functions=e,this._functions&&(n(Object.keys(this._functions).every((e=>"string"==typeof e)),"Functions keys must be strings"),n(Object.values(this._functions).every((e=>"function"==typeof e)),"Functions values must be functions"))}else this._settings=void 0,this._functions=void 0;this._parse()}_parse(){if(!this.source.includes("{"))return;const e=u.encode(this.source),t=u.split(e);let r=!1;const n=[],s=t.shift();s&&n.push(s);for(const e of t){const t="{"!==e[0],s=t?"}":"}}",o=e.indexOf(s);if(-1===o||"{"===e[1]){n.push(`{${u.decode(e)}`);continue}let i=e.slice(t?0:1,o);const a=":"===i[0];a&&(i=i.slice(1));const l=this._ref(u.decode(i),{raw:t,wrapped:a});n.push(l),"string"!=typeof l&&(r=!0);const c=e.slice(o+s.length);c&&n.push(u.decode(c))}r?this._template=n:this.rendered=n.join("")}static date(e,t){return u.dateFormat[t.dateFormat].call(e)}describe(e={}){if(!this._settings&&e.compact)return this.source;const t={template:this.source};return this._settings&&(t.options=this._settings),this._functions&&(t.functions=this._functions),t}static build(e){return new u.Template(e.template,e.options||e.functions?{...e.options,functions:e.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(e){return!!e&&!!e[a.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,...t){return e.ref?e.ref.resolve(...t):e.formula.evaluate(t)}render(e,t,r,n,s={}){if(!this.isDynamic())return this.rendered;const i=[];for(const a of this._template)if("string"==typeof a)i.push(a);else{const l=this._part(a,e,t,r,n,s),c=u.stringify(l,e,t,r,n,s);if(void 0!==c){const e=a.raw||!1===(s.errors&&s.errors.escapeHtml)?c:o(c);i.push(u.wrap(e,a.wrapped&&r.errors.wrap.label))}}return i.join("")}_ref(e,{raw:t,wrapped:r}){const n=[],s=e=>{const t=c.create(e,this._settings);return n.push(t),e=>{const r=t.resolve(...e);return void 0!==r?r:null}};try{const t=this._functions?{...u.functions,...this._functions}:u.functions;var o=new i.Parser(e,{reference:s,functions:t,constants:u.constants})}catch(t){throw t.message=`Invalid template variable "${e}" fails due to: ${t.message}`,t}if(o.single){if("reference"===o.single.type){const e=n[0];return{ref:e,raw:t,refs:n,wrapped:r||"local"===e.type&&"label"===e.key}}return u.stringify(o.single.value)}return{formula:o,raw:t,refs:n}}toString(){return this.source}},u.Template.prototype[a.symbols.template]=!0,u.Template.prototype.isImmutable=!0,u.encode=function(e){return e.replace(/\\(\{+)/g,((e,t)=>u.opens.slice(0,t.length))).replace(/\\(\}+)/g,((e,t)=>u.closes.slice(0,t.length)))},u.decode=function(e){return e.replace(/\u0000/g,"{").replace(/\u0001/g,"}")},u.split=function(e){const t=[];let r="";for(let n=0;n<e.length;++n){const s=e[n];if("{"===s){let s="";for(;n+1<e.length&&"{"===e[n+1];)s+="{",++n;t.push(r),r=s}else r+=s}return t.push(r),t},u.wrap=function(e,t){return t?1===t.length?`${t}${e}${t}`:`${t[0]}${e}${t[1]}`:e},u.stringify=function(e,t,r,n,s,o={}){const i=typeof e,a=n&&n.errors&&n.errors.wrap||{};let l=!1;if(c.isRef(e)&&e.render&&(l=e.in,e=e.resolve(t,r,n,s,{in:e.in,...o})),null===e)return"null";if("string"===i)return u.wrap(e,o.arrayItems&&a.string);if("number"===i||"function"===i||"symbol"===i)return e.toString();if("object"!==i)return JSON.stringify(e);if(e instanceof Date)return u.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 f=[];for(const i of e)f.push(u.stringify(i,t,r,n,s,{arrayItems:!0,...o}));return u.wrap(f.join(", "),!l&&a.array)},u.constants={true:!0,false:!1,null:null,second:1e3,minute:6e4,hour:36e5,day:864e5},u.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,s,o]=this,i=o.messages;if(!i)return"";const a=l.template(t,i[0],e,r,n)||l.template(t,i[1],e,r,n);return a?a.render(t,r,n,s,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)=>{"use strict";const n=r(375),s=r(1687),o=r(8068),i=r(8160),a=r(3292),l=r(6354),c=r(6133),u={};e.exports=o.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:c.toSibling}},args:(e,...t)=>1===t.length&&Array.isArray(t[0])?e.try(...t[0]):e.try(...t),validate(e,t){const{schema:r,error:n,state:o,prefs:i}=t;if(r._flags.match){const t=[],a=[];for(let n=0;n<r.$_terms.matches.length;++n){const s=r.$_terms.matches[n],l=o.nest(s.schema,`match.${n}`);l.snapshot();const c=s.schema.$_validate(e,l,i);c.errors?(a.push(c.errors),l.restore()):(t.push(c.value),l.commit())}if(0===t.length)return{errors:n("alternatives.any",{details:a.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:a.map((e=>l.details(e,{override:!1})))})};const c=e=>e.$_terms.matches.some((e=>"object"===e.schema.type||"alternatives"===e.schema.type&&c(e.schema)));return c(r)?{value:t.reduce(((e,t)=>s(e,t,{mergeArrays:!1})))}:{value:t[t.length-1]}}const a=[];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 s=n.schema.$_validate(e,r,i);if(!s.errors)return r.commit(),s;r.restore(),a.push({schema:n.schema,reports:s.errors});continue}const s=n.ref?n.ref.resolve(e,o,i):e,l=n.is?[n]:n.switch;for(let r=0;r<l.length;++r){const a=l[r],{is:c,then:u,otherwise:f}=a,d=`match.${t}${n.switch?"."+r:""}`;if(c.$_match(s,o.nest(c,`${d}.is`),i)){if(u)return u.$_validate(e,o.nest(u,`${d}.then`),i)}else if(f)return f.$_validate(e,o.nest(f,`${d}.otherwise`),i)}}return u.errors(a,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(),s=a.when(r,e,t),o=s.is?[s]:s.switch;for(const e of o)if(e.then&&e.otherwise){r.$_setFlag("_endedSwitch",!0,{clone:!1});break}return r.$_terms.matches.push(s),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(...e){n(e.length,"Missing alternative schemas"),i.verifyFlat(e,"try"),n(!this._flags._endedSwitch,"Unreachable condition");const t=this.clone();for(const r of e)t.$_terms.matches.push({schema:t.$_compile(r)});return t.$_mutateRebuild()}}},overrides:{label(e){return this.$_parent("label",e).$_modify({each:(t,r)=>"is"!==r.path[0]&&"string"!=typeof t._flags.label?t.label(e):void 0,ref:!1})}},rebuild(e){e.$_modify({each:t=>{i.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:s,not:o,then:i,otherwise:a}=r;e=t?e.try(t):n?e.conditional(n,{is:s,then:i,not:o,otherwise:a,switch:r.switch}):e.conditional(s,{then:i,otherwise:a})}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}}"}}),u.errors=function(e,{error:t,state:r}){if(!e.length)return{errors:t("alternatives.any")};if(1===e.length)return{errors:e[0].reports};const n=new Set,s=[];for(const{reports:o,schema:i}of e){if(o.length>1)return u.unmatched(e,t);const a=o[0];if(a instanceof l.Report==0)return u.unmatched(e,t);if(a.state.path.length!==r.path.length){s.push({type:i.type,report:a});continue}if("any.only"===a.code){for(const e of a.local.valids)n.add(e);continue}const[c,f]=a.code.split(".");"base"!==f?s.push({type:i.type,report:a}):"object.base"===a.code?n.add(a.local.type):n.add(c)}return s.length?1===s.length?{errors:s[0].report}:u.unmatched(e,t):{errors:t("alternatives.types",{types:[...n]})}},u.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)=>{"use strict";const n=r(375),s=r(7629),o=r(8160),i=r(6914);e.exports=s.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,{method:r}){try{return r(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,{code:r,local:n})=>t.error(r,n),args:["code","local"],multi:!0}},modifiers:{keep(e,t=!0){e.keep=t},message(e,t){e.message=i.compile(t)},warn(e,t=!0){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:s,then:o,otherwise:i,concat:a}=t;e=a?e.concat(a):r?e.when(r,{is:n,not:s,then:o,otherwise:i,switch:t.switch,break:t.break}):e.when(n,{then:o,otherwise:i,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)=>{"use strict";const n=r(375),s=r(9474),o=r(9621),i=r(8068),a=r(8160),l=r(3292),c={};e.exports=i.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,{schema:t,state:r,prefs:n}){if(!Array.isArray(e))return;const s=t.$_getRule("sort");return s?c.sort(t,e,s.args.options,r,n):void 0}},validate(e,{schema:t,error:r}){if(!Array.isArray(e)){if(t._flags.single){const t=[e];return t[a.symbols.arraySingle]=!0,{value:t}}return{errors:r("array.base")}}if(t.$_getRule("items")||t.$_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,{state:t,prefs:r,error:n},{schema:s}){const o=[e,...t.ancestors];for(let n=0;n<e.length;++n){const i=t.localize([...t.path,n],o,s);if(s.$_match(e[n],i,r))return e}const i=s._flags.label;return i?n("array.hasKnown",{patternLabel:i}):n("array.hasUnknown",null)},multi:!0},items:{method(...e){a.verifyFlat(e,"items");const t=this.$_addRule("items");for(let r=0;r<e.length;++r){const n=a.tryWithPath((()=>this.$_compile(e[r])),r,{append:!0});t.$_terms.items.push(n)}return t.$_mutateRebuild()},validate(e,{schema:t,error:r,state:n,prefs:s,errorsArray:o}){const i=t.$_terms._requireds.slice(),l=t.$_terms.ordered.slice(),u=[...t.$_terms._inclusions,...i],f=!e[a.symbols.arraySingle];delete e[a.symbols.arraySingle];const d=o();let m=e.length;for(let o=0;o<m;++o){const a=e[o];let p=!1,h=!1;const g=f?o:new Number(o),y=[...n.path,g];if(!t._flags.sparse&&void 0===a){if(d.push(r("array.sparse",{key:g,path:y,pos:o,value:void 0},n.localize(y))),s.abortEarly)return d;l.shift();continue}const b=[e,...n.ancestors];for(const e of t.$_terms._exclusions)if(e.$_match(a,n.localize(y,b,e),s,{presence:"ignore"})){if(d.push(r("array.excludes",{pos:o,value:a},n.localize(y))),s.abortEarly)return d;p=!0,l.shift();break}if(p)continue;if(t.$_terms.ordered.length){if(l.length){const i=l.shift(),u=i.$_validate(a,n.localize(y,b,i),s);if(u.errors){if(d.push(...u.errors),s.abortEarly)return d}else if("strip"===i._flags.result)c.fastSplice(e,o),--o,--m;else{if(!t._flags.sparse&&void 0===u.value){if(d.push(r("array.sparse",{key:g,path:y,pos:o,value:void 0},n.localize(y))),s.abortEarly)return d;continue}e[o]=u.value}continue}if(!t.$_terms.items.length){if(d.push(r("array.orderedLength",{pos:o,limit:t.$_terms.ordered.length})),s.abortEarly)return d;break}}const v=[];let _=i.length;for(let l=0;l<_;++l){const u=n.localize(y,b,i[l]);u.snapshot();const f=i[l].$_validate(a,u,s);if(v[l]=f,!f.errors){if(u.commit(),e[o]=f.value,h=!0,c.fastSplice(i,l),--l,--_,!t._flags.sparse&&void 0===f.value&&(d.push(r("array.sparse",{key:g,path:y,pos:o,value:void 0},n.localize(y))),s.abortEarly))return d;break}u.restore()}if(h)continue;const w=s.stripUnknown&&!!s.stripUnknown.arrays||!1;_=u.length;for(const l of u){let u;const f=i.indexOf(l);if(-1!==f)u=v[f];else{const i=n.localize(y,b,l);if(i.snapshot(),u=l.$_validate(a,i,s),!u.errors){i.commit(),"strip"===l._flags.result?(c.fastSplice(e,o),--o,--m):t._flags.sparse||void 0!==u.value?e[o]=u.value:(d.push(r("array.sparse",{key:g,path:y,pos:o,value:void 0},n.localize(y))),p=!0),h=!0;break}i.restore()}if(1===_){if(w){c.fastSplice(e,o),--o,--m,h=!0;break}if(d.push(...u.errors),s.abortEarly)return d;p=!0;break}}if(!p&&(t.$_terms._inclusions.length||t.$_terms._requireds.length)&&!h){if(w){c.fastSplice(e,o),--o,--m;continue}if(d.push(r("array.includes",{pos:o,value:a},n.localize(y))),s.abortEarly)return d}}return i.length&&c.fillMissedErrors(t,d,i,e,n,s),l.length&&(c.fillOrderedErrors(t,d,l,e,n,s),d.length||c.fillDefault(l,e,n,s)),d.length?d:e},priority:!0,manifest:!1},length:{method(e){return this.$_addRule({name:"length",args:{limit:e},operator:"="})},validate:(e,t,{limit:r},{name:n,operator:s,args:o})=>a.compare(e.length,r,s)?e:t.error("array."+n,{limit:o.limit,value:e}),args:[{name:"limit",ref:!0,assert:a.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(...e){a.verifyFlat(e,"ordered");const t=this.$_addRule("items");for(let r=0;r<e.length;++r){const n=a.tryWithPath((()=>this.$_compile(e[r])),r,{append:!0});c.validateSingle(n,t),t.$_mutateRegister(n),t.$_terms.ordered.push(n)}return t.$_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(e={}){a.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,{error:t,state:r,prefs:n,schema:s},{options:o}){const{value:i,errors:a}=c.sort(s,e,o,r,n);if(a)return a;for(let r=0;r<e.length;++r)if(e[r]!==i[r])return t("array.sort",{order:o.order,by:o.by?o.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,t={}){n(!e||"function"==typeof e||"string"==typeof e,"comparator must be a function or a string"),a.assertOptions(t,["ignoreUndefined","separator"]);const r={name:"unique",args:{options:t,comparator:e}};if(e)if("string"==typeof e){const n=a.default(t.separator,".");r.path=n?e.split(n):[e]}else r.comparator=e;return this.$_addRule(r)},validate(e,{state:t,error:r,schema:i},{comparator:a,options:l},{comparator:c,path:u}){const f={string:Object.create(null),number:Object.create(null),undefined:Object.create(null),boolean:Object.create(null),bigint:Object.create(null),object:new Map,function:new Map,custom:new Map},d=c||s,m=l.ignoreUndefined;for(let s=0;s<e.length;++s){const i=u?o(e[s],u):e[s],l=c?f.custom:f[typeof i];if(n(l,"Failed to find unique map container for type",typeof i),l instanceof Map){const n=l.entries();let o;for(;!(o=n.next()).done;)if(d(o.value[0],i)){const n=t.localize([...t.path,s],[e,...t.ancestors]),i={pos:s,value:e[s],dupePos:o.value[1],dupeValue:e[o.value[1]]};return u&&(i.path=a),r("array.unique",i,n)}l.set(i,s)}else{if((!m||void 0!==i)&&void 0!==l[i]){const n={pos:s,value:e[s],dupePos:l[i],dupeValue:e[l[i]]};return u&&(n.path=a),r("array.unique",n,t.localize([...t.path,s],[e,...t.ancestors]))}l[i]=s}}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)c.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)c.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"}}),c.fillMissedErrors=function(e,t,r,n,s,o){const i=[];let a=0;for(const e of r){const t=e._flags.label;t?i.push(t):++a}i.length?a?t.push(e.$_createError("array.includesRequiredBoth",n,{knownMisses:i,unknownMisses:a},s,o)):t.push(e.$_createError("array.includesRequiredKnowns",n,{knownMisses:i},s,o)):t.push(e.$_createError("array.includesRequiredUnknowns",n,{unknownMisses:a},s,o))},c.fillOrderedErrors=function(e,t,r,n,s,o){const i=[];for(const e of r)"required"===e._flags.presence&&i.push(e);i.length&&c.fillMissedErrors(e,t,i,n,s,o)},c.fillDefault=function(e,t,r,n){const s=[];let o=!0;for(let i=e.length-1;i>=0;--i){const a=e[i],l=[t,...r.ancestors],c=a.$_validate(void 0,r.localize(r.path,l,a),n).value;if(o){if(void 0===c)continue;o=!1}s.unshift(c)}s.length&&t.push(...s)},c.fastSplice=function(e,t){let r=t;for(;r<e.length;)e[r++]=e[r];--e.length},c.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}))},c.sort=function(e,t,r,n,s){const o="ascending"===r.order?1:-1,i=-1*o,a=o,l=(l,u)=>{let f=c.compare(l,u,i,a);if(null!==f)return f;if(r.by&&(l=r.by.resolve(l,n,s),u=r.by.resolve(u,n,s)),f=c.compare(l,u,i,a),null!==f)return f;const d=typeof l;if(d!==typeof u)throw e.$_createError("array.sort.mismatching",t,null,n,s);if("number"!==d&&"string"!==d)throw e.$_createError("array.sort.unsupported",t,{type:d},n,s);return"number"===d?(l-u)*o:l<u?i:a};try{return{value:t.slice().sort(l)}}catch(e){return{errors:e}}},c.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)=>{"use strict";const n=r(375),s=r(8068),o=r(8160),i=r(2036),a={isBool:function(e){return"boolean"==typeof e}};e.exports=s.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(e,{schema:t}){if("boolean"!=typeof e){if("string"==typeof e){const r=t._flags.sensitive?e:e.toLowerCase();e="true"===r||"false"!==r&&e}return"boolean"!=typeof e&&(e=t.$_terms.truthy&&t.$_terms.truthy.has(e,null,null,!t._flags.sensitive)||(!t.$_terms.falsy||!t.$_terms.falsy.has(e,null,null,!t._flags.sensitive))&&e),{value:e}}},validate(e,{error:t}){if("boolean"!=typeof e)return{value:e,errors:t("boolean.base")}},rules:{truthy:{method(...e){o.verifyFlat(e,"truthy");const t=this.clone();t.$_terms.truthy=t.$_terms.truthy||new i;for(let r=0;r<e.length;++r){const s=e[r];n(void 0!==s,"Cannot call truthy with undefined"),t.$_terms.truthy.add(s)}return t}},falsy:{method(...e){o.verifyFlat(e,"falsy");const t=this.clone();t.$_terms.falsy=t.$_terms.falsy||new i;for(let r=0;r<e.length;++r){const s=e[r];n(void 0!==s,"Cannot call falsy with undefined"),t.$_terms.falsy.add(s)}return t}},sensitive:{method(e=!0){return this.$_setFlag("sensitive",e)}}},cast:{number:{from:a.isBool,to:(e,t)=>e?1:0},string:{from:a.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)=>{"use strict";const n=r(375),s=r(8068),o=r(8160),i=r(3328),a={isDate:function(e){return e instanceof Date}};e.exports=s.extend({type:"date",coerce:{from:["number","string"],method:(e,{schema:t})=>({value:a.parse(e,t._flags.format)||e})},validate(e,{schema:t,error:r,prefs:n}){if(e instanceof Date&&!isNaN(e.getTime()))return;const s=t._flags.format;return n.convert&&s&&"string"==typeof e?{value:e,errors:r("date.format",{format:s})}:{value:e,errors:r("date.base")}},rules:{compare:{method:!1,validate(e,t,{date:r},{name:n,operator:s,args:i}){const a="now"===r?Date.now():r.getTime();return o.compare(e.getTime(),a,s)?e:t.error("date."+n,{limit:i.date,value:e})},args:[{name:"date",ref:!0,normalize:e=>"now"===e?e:a.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(e="javascript"){return n(["javascript","unix"].includes(e),'"type" must be one of "javascript, unix"'),this.format(e)}}},cast:{number:{from:a.isDate,to:(e,t)=>e.getTime()},string:{from:a.isDate,to:(e,{prefs:t})=>i.date(e,t)}},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"}}),a.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)?a.date(e.toString()):null;const r=e;if("string"==typeof e&&/^[+-]?\d+(\.\d+)?$/.test(e)&&(e=parseFloat(e)),t){if("javascript"===t)return a.date(1*e);if("unix"===t)return a.date(1e3*e);if("string"==typeof r)return null}return a.date(e)},a.date=function(e){const t=new Date(e);return isNaN(t.getTime())?null:t}},390:(e,t,r)=>{"use strict";const n=r(375),s=r(7824);e.exports=s.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,{n:r})=>e.length===r?e:t.error("function.arity",{n:r})},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,{n:r})=>e.length>=r?e:t.error("function.minArity",{n:r})},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,{n:r})=>e.length<=r?e:t.error("function.maxArity",{n:r})}},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)=>{"use strict";const n=r(978),s=r(375),o=r(8571),i=r(3652),a=r(8068),l=r(8160),c=r(3292),u=r(6354),f=r(6133),d=r(3328),m={renameDefaults:{alias:!1,multiple:!1,override:!1}};e.exports=a.extend({type:"_keys",properties:{typeof:"object"},flags:{unknown:{default:void 0}},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,{schema:t,error:r,state:n,prefs:s}){if(!e||typeof e!==t.$_property("typeof")||Array.isArray(e))return{value:e,errors:r("object.base",{type:t.$_property("typeof")})};if(!(t.$_terms.renames||t.$_terms.dependencies||t.$_terms.keys||t.$_terms.patterns||t.$_terms.externals))return;e=m.clone(e,s);const o=[];if(t.$_terms.renames&&!m.rename(t,e,n,s,o))return{value:e,errors:o};if(!t.$_terms.keys&&!t.$_terms.patterns&&!t.$_terms.dependencies)return{value:e,errors:o};const i=new Set(Object.keys(e));if(t.$_terms.keys){const r=[e,...n.ancestors];for(const a of t.$_terms.keys){const t=a.key,l=e[t];i.delete(t);const c=n.localize([...n.path,t],r,a),u=a.schema.$_validate(l,c,s);if(u.errors){if(s.abortEarly)return{value:e,errors:u.errors};void 0!==u.value&&(e[t]=u.value),o.push(...u.errors)}else"strip"===a.schema._flags.result||void 0===u.value&&void 0!==l?delete e[t]:void 0!==u.value&&(e[t]=u.value)}}if(i.size||t._flags._hasPatternMatch){const r=m.unknown(t,e,i,o,n,s);if(r)return r}if(t.$_terms.dependencies)for(const r of t.$_terms.dependencies){if(null!==r.key&&!1===m.isPresent(r.options)(r.key.resolve(e,n,s,null,{shadow:!1})))continue;const i=m.dependencies[r.rel](t,r,e,n,s);if(i){const r=t.$_createError(i.code,e,i.context,n,s);if(s.abortEarly)return{value:e,errors:r};o.push(r)}}return{value:e,errors:o}},rules:{and:{method(...e){return l.verifyFlat(e,"and"),m.dependency(this,"and",null,e)}},append:{method(e){return null==e||0===Object.keys(e).length?this:this.keys(e)}},assert:{method(e,t,r){d.isTemplate(e)||(e=c.ref(e)),s(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,{error:t,prefs:r,state:n},{subject:s,schema:o,message:i}){const a=s.resolve(e,n,r),l=f.isRef(s)?s.absolute(n):[];return o.$_match(a,n.localize(l,[e,...n.ancestors],o),r)?e:t("object.assert",{subject:s,message:i})},args:["subject","schema","message"],multi:!0},instance:{method(e,t){return s("function"==typeof e,"constructor must be a function"),t=t||e.name,this.$_addRule({name:"instance",args:{constructor:e,name:t}})},validate:(e,t,{constructor:r,name:n})=>e instanceof r?e:t.error("object.instance",{type:n,value:e}),args:["constructor","name"]},keys:{method(e){s(void 0===e||"object"==typeof e,"Object schema must be a valid object"),s(!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 m.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 m.Keys;else t.$_terms.keys=null;return t.$_mutateRebuild()}},length:{method(e){return this.$_addRule({name:"length",args:{limit:e},operator:"="})},validate:(e,t,{limit:r},{name:n,operator:s,args:o})=>l.compare(Object.keys(e).length,r,s)?e:t.error("object."+n,{limit:o.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(...e){return l.verifyFlat(e,"nand"),m.dependency(this,"nand",null,e)}},or:{method(...e){return l.verifyFlat(e,"or"),m.dependency(this,"or",null,e)}},oxor:{method(...e){return m.dependency(this,"oxor",null,e)}},pattern:{method(e,t,r={}){const n=e instanceof RegExp;n||(e=this.$_compile(e,{appendPath:!0})),s(void 0!==t,"Invalid rule"),l.assertOptions(r,["fallthrough","matches"]),n&&s(!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 i={[n?"regex":"schema"]:e,rule:t};return r.matches&&(i.matches=this.$_compile(r.matches),"array"!==i.matches.type&&(i.matches=i.matches.$_root.array().items(i.matches)),o.$_mutateRegister(i.matches),o.$_setFlag("_hasPatternMatch",!0,{clone:!1})),r.fallthrough&&(i.fallthrough=!0),o.$_terms.patterns.push(i),o.$_mutateRegister(t),o}},ref:{method(){return this.$_addRule("ref")},validate:(e,t)=>f.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,r={}){s("string"==typeof e||e instanceof RegExp,"Rename missing the from argument"),s("string"==typeof t||t instanceof d,"Invalid rename to argument"),s(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)s(t.from!==e,"Cannot rename the same key multiple times");return t instanceof d&&o.$_mutateRegister(t),o.$_terms.renames.push({from:e,to:t,options:n(m.renameDefaults,r)}),o}},schema:{method(e="any"){return this.$_addRule({name:"schema",args:{type:e}})},validate:(e,t,{type:r})=>!l.isSchema(e)||"any"!==r&&e.type!==r?t.error("object.schema",{type:r}):e},unknown:{method(e){return this.$_setFlag("unknown",!1!==e)}},with:{method(e,t,r={}){return m.dependency(this,"with",e,t,r)}},without:{method(e,t,r={}){return m.dependency(this,"without",e,t,r)}},xor:{method(...e){return l.verifyFlat(e,"xor"),m.dependency(this,"xor",null,e)}}},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 i.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 m.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:s,options:o}of t.dependencies)e=m.dependency(e,r,n,s,o);if(t.patterns)for(const{regex:r,schema:n,rule:s,fallthrough:o,matches:i}of t.patterns)e=e.pattern(r||n,s,{fallthrough:o,matches:i});if(t.renames)for(const{from:r,to:n,options:s}of t.renames)e=e.rename(r,n,s);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}}"}}),m.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(...t){return e.apply(this,t)};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},m.dependency=function(e,t,r,n,o){s(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 i=l.default(o.separator,"."),a=[];for(const e of n)s("string"==typeof e,t,"peers must be strings"),a.push(c.ref(e,{separator:i,ancestor:0,prefix:!1}));null!==r&&(r=c.ref(r,{separator:i,ancestor:0,prefix:!1}));const u=e.clone();return u.$_terms.dependencies=u.$_terms.dependencies||[],u.$_terms.dependencies.push(new m.Dependency(t,r,a,n,o)),u},m.dependencies={and(e,t,r,n,s){const o=[],i=[],a=t.peers.length,l=m.isPresent(t.options);for(const e of t.peers)!1===l(e.resolve(r,n,s,null,{shadow:!1}))?o.push(e.key):i.push(e.key);if(o.length!==a&&i.length!==a)return{code:"object.and",context:{present:i,presentWithLabels:m.keysToLabels(e,i),missing:o,missingWithLabels:m.keysToLabels(e,o)}}},nand(e,t,r,n,s){const o=[],i=m.isPresent(t.options);for(const e of t.peers)i(e.resolve(r,n,s,null,{shadow:!1}))&&o.push(e.key);if(o.length!==t.peers.length)return;const a=t.paths[0],l=t.paths.slice(1);return{code:"object.nand",context:{main:a,mainWithLabel:m.keysToLabels(e,a),peers:l,peersWithLabels:m.keysToLabels(e,l)}}},or(e,t,r,n,s){const o=m.isPresent(t.options);for(const e of t.peers)if(o(e.resolve(r,n,s,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:t.paths,peersWithLabels:m.keysToLabels(e,t.paths)}}},oxor(e,t,r,n,s){const o=[],i=m.isPresent(t.options);for(const e of t.peers)i(e.resolve(r,n,s,null,{shadow:!1}))&&o.push(e.key);if(!o.length||1===o.length)return;const a={peers:t.paths,peersWithLabels:m.keysToLabels(e,t.paths)};return a.present=o,a.presentWithLabels=m.keysToLabels(e,o),{code:"object.oxor",context:a}},with(e,t,r,n,s){const o=m.isPresent(t.options);for(const i of t.peers)if(!1===o(i.resolve(r,n,s,null,{shadow:!1})))return{code:"object.with",context:{main:t.key.key,mainWithLabel:m.keysToLabels(e,t.key.key),peer:i.key,peerWithLabel:m.keysToLabels(e,i.key)}}},without(e,t,r,n,s){const o=m.isPresent(t.options);for(const i of t.peers)if(o(i.resolve(r,n,s,null,{shadow:!1})))return{code:"object.without",context:{main:t.key.key,mainWithLabel:m.keysToLabels(e,t.key.key),peer:i.key,peerWithLabel:m.keysToLabels(e,i.key)}}},xor(e,t,r,n,s){const o=[],i=m.isPresent(t.options);for(const e of t.peers)i(e.resolve(r,n,s,null,{shadow:!1}))&&o.push(e.key);if(1===o.length)return;const a={peers:t.paths,peersWithLabels:m.keysToLabels(e,t.paths)};return 0===o.length?{code:"object.missing",context:a}:(a.present=o,a.presentWithLabels=m.keysToLabels(e,o),{code:"object.xor",context:a})}},m.keysToLabels=function(e,t){return Array.isArray(t)?t.map((t=>e.$_mapLabels(t))):e.$_mapLabels(t)},m.isPresent=function(e){return"function"==typeof e.isPresent?e.isPresent:e=>void 0!==e},m.rename=function(e,t,r,n,s){const o={};for(const i of e.$_terms.renames){const a=[],l="string"!=typeof i.from;if(l)for(const e in t){if(void 0===t[e]&&i.options.ignoreUndefined)continue;if(e===i.to)continue;const r=i.from.exec(e);r&&a.push({from:e,to:i.to,match:r})}else!Object.prototype.hasOwnProperty.call(t,i.from)||void 0===t[i.from]&&i.options.ignoreUndefined||a.push(i);for(const c of a){const a=c.from;let u=c.to;if(u instanceof d&&(u=u.render(t,r,n,c.match)),a!==u){if(!i.options.multiple&&o[u]&&(s.push(e.$_createError("object.rename.multiple",t,{from:a,to:u,pattern:l},r,n)),n.abortEarly))return!1;if(Object.prototype.hasOwnProperty.call(t,u)&&!i.options.override&&!o[u]&&(s.push(e.$_createError("object.rename.override",t,{from:a,to:u,pattern:l},r,n)),n.abortEarly))return!1;void 0===t[a]?delete t[u]:t[u]=t[a],o[u]=!0,i.options.alias||delete t[a]}}}return!0},m.unknown=function(e,t,r,n,s,o){if(e.$_terms.patterns){let i=!1;const a=e.$_terms.patterns.map((e=>{if(e.matches)return i=!0,[]})),l=[t,...s.ancestors];for(const i of r){const c=t[i],u=[...s.path,i];for(let f=0;f<e.$_terms.patterns.length;++f){const d=e.$_terms.patterns[f];if(d.regex){const e=d.regex.test(i);if(s.mainstay.tracer.debug(s,"rule",`pattern.${f}`,e?"pass":"error"),!e)continue}else if(!d.schema.$_match(i,s.nest(d.schema,`pattern.${f}`),o))continue;r.delete(i);const m=s.localize(u,l,{schema:d.rule,key:i}),p=d.rule.$_validate(c,m,o);if(p.errors){if(o.abortEarly)return{value:t,errors:p.errors};n.push(...p.errors)}if(d.matches&&a[f].push(i),t[i]=p.value,!d.fallthrough)break}}if(i)for(let r=0;r<a.length;++r){const i=a[r];if(!i)continue;const c=e.$_terms.patterns[r].matches,f=s.localize(s.path,l,c),d=c.$_validate(i,f,o);if(d.errors){const r=u.details(d.errors,{override:!1});r.matches=i;const a=e.$_createError("object.pattern.match",t,r,s,o);if(o.abortEarly)return{value:t,errors:a};n.push(a)}}}if(r.size&&(e.$_terms.keys||e.$_terms.patterns)){if(o.stripUnknown&&void 0===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 i of r){const r=s.localize([...s.path,i],[]),a=e.$_createError("object.unknown",t[i],{child:i},r,o,{flags:!1});if(o.abortEarly)return{value:t,errors:a};n.push(a)}}},m.Dependency=class{constructor(e,t,r,n,s){this.rel=e,this.key=t,this.peers=r,this.paths=n,this.options=s}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}},m.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,s=r.get(e);void 0!==s?t[s]={key:e,schema:t[s].schema.concat(n.schema)}:t.push(n)}return t}}},8785:(e,t,r)=>{"use strict";const n=r(375),s=r(8068),o=r(8160),i=r(3292),a=r(6354),l={};e.exports=s.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args:(e,t)=>e.ref(t),validate(e,{schema:t,state:r,prefs:s}){n(t.$_terms.link,"Uninitialized link schema");const o=l.generate(t,e,r,s),i=t.$_terms.link[0].ref;return o.$_validate(e,r.nest(o,`link:${i.display}:${o.type}`),s)},generate:(e,t,r,n)=>l.generate(e,t,r,n),rules:{ref:{method(e){n(!this.$_terms.link,"Cannot reinitialize schema"),e=i.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(e=!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 s=r.mainstay.links.get(e);if(s)return s._generate(t,r,n).schema;const o=e.$_terms.link[0].ref,{perspective:i,path:a}=l.perspective(o,r);l.assert(i,"which is outside of schema boundaries",o,e,r,n);try{s=a.length?i.$_reach(a):i}catch(t){l.assert(!1,"to non-existing schema",o,e,r,n)}return l.assert("link"!==s.type,"which is another link",o,e,r,n),e._flags.relative||r.mainstay.links.set(e,s),s._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,s,o,i){e||n(!1,`"${a.label(s._flags,o,i)}" contains link reference "${r.display}" ${t}`)}},3832:(e,t,r)=>{"use strict";const n=r(375),s=r(8068),o=r(8160),i={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,exponentialPartRegex:/[eE][+-]?\d+$/,leadingSignAndZerosRegex:/^[+-]?(0*)?/,dotRegex:/\./,trailingZerosRegex:/0+$/,decimalPlaces(e){const t=e.toString(),r=t.indexOf("."),n=t.indexOf("e");return(r<0?0:(n<0?t.length:n)-r-1)+(n<0?0:Math.max(0,-parseInt(t.slice(n+1))))}};e.exports=s.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(e,{schema:t,error:r}){if(!e.match(i.numberRx))return;e=e.trim();const n={value:parseFloat(e)};if(0===n.value&&(n.value=0),!t._flags.unsafe)if(e.match(/e/i)){if(i.extractSignificantDigits(e)!==i.extractSignificantDigits(String(n.value)))return n.errors=r("number.unsafe"),n}else{const t=n.value.toString();if(t.match(/e/i))return n;if(t!==i.normalizeDecimal(e))return n.errors=r("number.unsafe"),n}return n}},validate(e,{schema:t,error:r,prefs:n}){if(e===1/0||e===-1/0)return{value:e,errors:r("number.infinity")};if(!o.isNumber(e))return{value:e,errors:r("number.base")};const s={value:e};if(n.convert){const e=t.$_getRule("precision");if(e){const t=Math.pow(10,e.args.limit);s.value=Math.round(s.value*t)/t}}return 0===s.value&&(s.value=0),!t._flags.unsafe&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&(s.errors=r("number.unsafe")),s},rules:{compare:{method:!1,validate:(e,t,{limit:r},{name:n,operator:s,args:i})=>o.compare(e,r,s)?e:t.error("number."+n,{limit:i.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){const t="number"==typeof e?i.decimalPlaces(e):null,r=Math.pow(10,t);return this.$_addRule({name:"multiple",args:{base:e,baseDecimalPlace:t,pfactor:r}})},validate:(e,t,{base:r,baseDecimalPlace:n,pfactor:s},o)=>i.decimalPlaces(e)>n?t.error("number.multiple",{multiple:o.args.base,value:e}):Math.round(s*e)%Math.round(s*r)==0?e:t.error("number.multiple",{multiple:o.args.base,value:e}),args:[{name:"base",ref:!0,assert:e=>"number"==typeof e&&isFinite(e)&&e>0,message:"must be a positive number"},"baseDecimalPlace","pfactor"],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,{limit:r}){const n=e.toString().match(i.precisionRx);return Math.max((n[1]?n[1].length:0)-(n[2]?parseInt(n[2],10):0),0)<=r?e:t.error("number.precision",{limit:r,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,{sign:r})=>"negative"===r&&e<0||"positive"===r&&e>0?e:t.error(`number.${r}`)},unsafe:{method(e=!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"}}),i.extractSignificantDigits=function(e){return e.replace(i.exponentialPartRegex,"").replace(i.dotRegex,"").replace(i.trailingZerosRegex,"").replace(i.leadingSignAndZerosRegex,"")},i.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)=>{"use strict";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)=>{"use strict";const n=r(375),s=r(5380),o=r(1745),i=r(9959),a=r(6064),l=r(9926),c=r(5752),u=r(8068),f=r(8160),d={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:{withPrefix:/^0x[0-9a-f]+$/i,withOptionalPrefix:/^(?:0x)?[0-9a-f]+$/i,withoutPrefix:/^[0-9a-f]+$/i},ipRegex:i.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",uuidv6:"6",uuidv7:"7",uuidv8:"8"},guidSeparators:new Set([void 0,!0,!1,"-",":"]),normalizationForms:["NFC","NFD","NFKC","NFKD"]};e.exports=u.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(e,{schema:t,state:r,prefs:n}){const s=t.$_getRule("normalize");s&&(e=e.normalize(s.args.form));const o=t.$_getRule("case");o&&(e="upper"===o.args.direction?e.toLocaleUpperCase():e.toLocaleLowerCase());const i=t.$_getRule("trim");if(i&&i.args.enabled&&(e=e.trim()),t.$_terms.replacements)for(const r of t.$_terms.replacements)e=e.replace(r.pattern,r.replacement);const a=t.$_getRule("hex");if(a&&a.args.options.byteAligned&&e.length%2!=0&&(e=`0${e}`),t.$_getRule("isoDate")){const t=d.isoDate(e);t&&(e=t)}if(t._flags.truncate){const s=t.$_getRule("max");if(s){let o=s.args.limit;if(f.isResolvable(o)&&(o=o.resolve(e,r,n),!f.limit(o)))return{value:e,errors:t.$_createError("any.ref",o,{ref:s.args.limit,arg:"limit",reason:"must be a positive integer"},r,n)};e=e.slice(0,o)}}return{value:e}}},validate(e,{schema:t,error:r}){if("string"!=typeof e)return{value:e,errors:r("string.base")};if(""===e){const n=t.$_getRule("min");if(n&&0===n.args.limit)return;return{value:e,errors:r("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(e={}){return f.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,{options:r})=>d.base64Regex[r.paddingRequired][r.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,{direction:r})=>"lower"===r&&e===e.toLocaleLowerCase()||"upper"===r&&e===e.toLocaleUpperCase()?e:t.error(`string.${r}case`),convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(e,t){let r=e.length,n=0,s=1;for(;r--;){const t=e.charAt(r)*s;n+=t-9*(t>9),s^=3}return n>0&&n%10==0?e:t.error("string.creditCard")}},dataUri:{method(e={}){return f.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,{options:r}){const n=e.match(d.dataUriRegex);if(n){if(!n[2])return e;if("base64"!==n[2])return e;if(d.base64Regex[r.paddingRequired].false.test(n[3]))return e}return t.error("string.dataUri")}},domain:{method(e){e&&f.assertOptions(e,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const t=d.addressOptions(e);return this.$_addRule({name:"domain",args:{options:e},address:t})},validate:(e,t,r,{address:n})=>s.isValid(e,n)?e:t.error("string.domain")},email:{method(e={}){f.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=d.addressOptions(e),r=new RegExp(`\\s*[${e.separator?a(e.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:e},regex:r,address:t})},validate(e,t,{options:r},{regex:n,address:s}){const i=r.multiple?e.split(n):[e],a=[];for(const e of i)o.isValid(e,s)||a.push(e);return a.length?t.error("string.email",{value:e,invalids:a}):e}},guid:{alias:"uuid",method(e={}){f.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 s=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 i=d.guidVersions[o.toLowerCase()];n(i,"version at position "+e+" must be one of "+Object.keys(d.guidVersions).join(", ")),n(!s.has(i),"version at position "+e+" must not be a duplicate"),t+=i,s.add(i)}}n(d.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}`,s=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:s})},validate(e,t,r,{regex:n}){const s=n.exec(e);return s?d.guidBrackets[s[1]]!==s[s.length-1]?t.error("string.guid"):e:t.error("string.guid")}},hex:{method(e={}){return f.assertOptions(e,["byteAligned","prefix"]),e={byteAligned:!1,prefix:!1,...e},n("boolean"==typeof e.byteAligned,"byteAligned must be boolean"),n("boolean"==typeof e.prefix||"optional"===e.prefix,'prefix must be boolean or "optional"'),this.$_addRule({name:"hex",args:{options:e}})},validate:(e,t,{options:r})=>("optional"===r.prefix?d.hexRegex.withOptionalPrefix:!0===r.prefix?d.hexRegex.withPrefix:d.hexRegex.withoutPrefix).test(e)?r.byteAligned&&e.length%2!=0?t.error("string.hexAlign"):e:t.error("string.hex")},hostname:{method(){return this.$_addRule("hostname")},validate:(e,t)=>s.isValid(e,{minDomainSegments:1})||d.ipRegex.test(e)?e:t.error("string.hostname")},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(e={}){f.assertOptions(e,["cidr","version"]);const{cidr:t,versions:r,regex:n}=i.regex(e),s=e.version?r:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:t,version:s}},regex:n})},validate:(e,t,{options:r},{regex:n})=>n.test(e)?e:r.version?t.error("string.ipVersion",{value:e,cidr:r.cidr,version:r.version}):t.error("string.ip",{value:e,cidr:r.cidr})},isoDate:{method(){return this.$_addRule("isoDate")},validate:(e,{error:t})=>d.isoDate(e)?e:t("string.isoDate")},isoDuration:{method(){return this.$_addRule("isoDuration")},validate:(e,t)=>d.isoDurationRegex.test(e)?e:t.error("string.isoDuration")},length:{method(e,t){return d.length(this,"length",e,"=",t)},validate(e,t,{limit:r,encoding:n},{name:s,operator:o,args:i}){const a=!n&&e.length;return f.compare(a,r,o)?e:t.error("string."+s,{limit:i.limit,value:e,encoding:n})},args:[{name:"limit",ref:!0,assert:f.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(e,t){return d.length(this,"max",e,"<=",t)},args:["limit","encoding"]},min:{method(e,t){return d.length(this,"min",e,">=",t)},args:["limit","encoding"]},normalize:{method(e="NFC"){return n(d.normalizationForms.includes(e),"normalization form must be one of "+d.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:e}})},validate:(e,{error:t},{form:r})=>e===e.normalize(r)?e:t("string.normalize",{value:e,form:r}),convert:!0},pattern:{alias:"regex",method(e,t={}){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}),f.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,{regex:r,options:n},{errorCode:s})=>r.test(e)^n.invert?e:t.error(s,{name:n.name,regex:r,value:e}),args:["regex","options"],multi:!0},replace:{method(e,t){"string"==typeof e&&(e=new RegExp(a(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(e=!0){return n("boolean"==typeof e,"enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:e}})},validate:(e,t,{enabled:r})=>r&&e!==e.trim()?t.error("string.trim"):e,convert:!0},truncate:{method(e=!0){return n("boolean"==typeof e,"enabled must be a boolean"),this.$_setFlag("truncate",e)}},uppercase:{method(){return this.case("upper")}},uri:{method(e={}){f.assertOptions(e,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme","encodeUri"]),e.domain&&f.assertOptions(e.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const{regex:t,scheme:r}=c.regex(e),n=e.domain?d.addressOptions(e.domain):null;return this.$_addRule({name:"uri",args:{options:e},regex:t,domain:n,scheme:r})},validate(e,t,{options:r},{regex:n,domain:o,scheme:i}){if(["http:/","https:/"].includes(e))return t.error("string.uri");let a=n.exec(e);if(!a&&t.prefs.convert&&r.encodeUri){const t=encodeURI(e);a=n.exec(t),a&&(e=t)}if(a){const n=a[1]||a[2];return!o||r.allowRelative&&!n||s.isValid(n,o)?e:t.error("string.domain",{value:n})}return r.relativeOnly?t.error("string.uriRelativeOnly"):r.scheme?t.error("string.uriCustomScheme",{scheme:i,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"}}),d.addressOptions=function(e){if(!e)return d.tlds||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(d.tlds,"Built-in TLD list disabled"),Object.assign({},e,d.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"),d.validateTlds(e.tlds.deny,"tlds.deny"),e;const r=e.tlds.allow;return r?!0===r?(n(d.tlds,"Built-in TLD list disabled"),Object.assign({},e,d.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"),d.validateTlds(e.tlds.allow,"tlds.allow"),e):e},d.validateTlds=function(e,t){for(const r of e)n(s.isValid(r,{minDomainSegments:1,maxDomainSegments:1}),`${t} must contain valid top level domain names`)},d.isoDate=function(e){if(!f.isIsoDate(e))return null;/.*T.*[+-]\d\d$/.test(e)&&(e+="00");const t=new Date(e);return isNaN(t.getTime())?null:t.toISOString()},d.length=function(e,t,r,s,o){return n(!o||!1,"Invalid encoding:",o),e.$_addRule({name:t,method:"length",args:{limit:r,encoding:o},operator:s})}},8826:(e,t,r)=>{"use strict";const n=r(375),s=r(8068),o={};o.Map=class extends Map{slice(){return new o.Map(this)}},e.exports=s.extend({type:"symbol",terms:{map:{init:new o.Map}},coerce:{method(e,{schema:t,error:r}){const n=t.$_terms.map.get(e);return n&&(e=n),t._flags.only&&"symbol"!=typeof e?{value:e,errors:r("symbol.map",{map:t.$_terms.map})}:{value:e}}},validate(e,{error:t}){if("symbol"!=typeof e)return{value:e,errors:t("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 s of e){n(s&&s[Symbol.iterator],"Entry must be an iterable");const[e,o]=s;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)=>{"use strict";const n=r(375),s=r(8571),o=r(738),i=r(9621),a=r(8160),l=r(6354),c=r(493),u={result:Symbol("result")};t.entry=function(e,t,r){let s=a.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"),s=a.preferences(a.defaults,r));const o=u.entry(e,t,s);n(!o.mainstay.externals.length,"Schema with external rules must use validateAsync()");const i={value:o.value};return o.error&&(i.error=o.error),o.mainstay.warnings.length&&(i.warning=l.details(o.mainstay.warnings)),o.mainstay.debug&&(i.debug=o.mainstay.debug),o.mainstay.artifacts&&(i.artifacts=o.mainstay.artifacts),i},t.entryAsync=async function(e,t,r){let n=a.defaults;r&&(n=a.preferences(a.defaults,r));const s=u.entry(e,t,n),o=s.mainstay;if(s.error)throw o.debug&&(s.error.debug=o.debug),s.error;if(o.externals.length){let t=s.value;const c=[];for(const s of o.externals){const f=s.state.path,d="link"===s.schema.type?o.links.get(s.schema):null;let m,p,h=t;const g=f.length?[t]:[],y=f.length?i(e,f):e;if(f.length){m=f[f.length-1];let e=t;for(const t of f.slice(0,-1))e=e[t],g.unshift(e);p=g[0],h=p[m]}try{const e=(e,t)=>(d||s.schema).$_createError(e,h,t,s.state,n),i=await s.method(h,{schema:s.schema,linked:d,state:s.state,prefs:r,original:y,error:e,errorsArray:u.errorsArray,warn:(e,t)=>o.warnings.push((d||s.schema).$_createError(e,h,t,s.state,n)),message:(e,t)=>(d||s.schema).$_createError("external",h,t,s.state,n,{messages:e})});if(void 0===i||i===h)continue;if(i instanceof l.Report){if(o.tracer.log(s.schema,s.state,"rule","external","error"),c.push(i),n.abortEarly)break;continue}if(Array.isArray(i)&&i[a.symbols.errors]){if(o.tracer.log(s.schema,s.state,"rule","external","error"),c.push(...i),n.abortEarly)break;continue}p?(o.tracer.value(s.state,"rule",h,i,"external"),p[m]=i):(o.tracer.value(s.state,"rule",t,i,"external"),t=i)}catch(e){throw n.errors.label&&(e.message+=` (${s.label})`),e}}if(s.value=t,c.length)throw s.error=l.process(c,e,n),o.debug&&(s.error.debug=o.debug),s.error}if(!n.warnings&&!n.debug&&!n.artifacts)return s.value;const c={value:s.value};return o.warnings.length&&(c.warning=l.details(o.warnings)),o.debug&&(c.debug=o.debug),o.artifacts&&(c.artifacts=o.artifacts),c},u.Mainstay=class{constructor(e,t,r){this.externals=[],this.warnings=[],this.tracer=e,this.debug=t,this.links=r,this.shadow=null,this.artifacts=null,this._snapshots=[]}snapshot(){this._snapshots.push({externals:this.externals.slice(),warnings:this.warnings.slice()})}restore(){const e=this._snapshots.pop();this.externals=e.externals,this.warnings=e.warnings}commit(){this._snapshots.pop()}},u.entry=function(e,r,n){const{tracer:s,cleanup:o}=u.tracer(r,n),i=n.debug?[]:null,a=r._ids._schemaChain?new Map:null,f=new u.Mainstay(s,i,a),d=r._ids._schemaChain?[{schema:r}]:null,m=new c([],[],{mainstay:f,schemas:d}),p=t.validate(e,r,m,n);o&&r.$_root.untrace();const h=l.process(p.errors,e,n);return{value:p.value,error:h,mainstay:f}},u.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:u.ignore}},t.validate=function(e,t,r,n,s={}){if(t.$_terms.whens&&(t=t._generate(e,r,n).schema),t._preferences&&(n=u.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=(s,o,i)=>t.$_createError(s,e,o,i||r,n),i={original:e,prefs:n,schema:t,state:r,error:o,errorsArray:u.errorsArray,warn:(e,t,n)=>r.mainstay.warnings.push(o(e,t,n)),message:(s,o)=>t.$_createError("custom",e,o,r,n,{messages:s})};r.mainstay.tracer.entry(t,r);const l=t._definition;if(l.prepare&&void 0!==e&&n.convert){const t=l.prepare(e,i);if(t){if(r.mainstay.tracer.value(r,"prepare",e,t.value),t.errors)return u.finalize(t.value,[].concat(t.errors),i);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,i);if(t){if(r.mainstay.tracer.value(r,"coerced",e,t.value),t.errors)return u.finalize(t.value,[].concat(t.errors),i);e=t.value}}const c=t._flags.empty;c&&c.$_match(u.trim(e,t),r.nest(c),a.defaults)&&(r.mainstay.tracer.value(r,"empty",e,void 0),e=void 0);const f=s.presence||t._flags.presence||(t._flags._endedSwitch?null:n.presence);if(void 0===e){if("forbidden"===f)return u.finalize(e,null,i);if("required"===f)return u.finalize(e,[t.$_createError("any.required",e,null,r,n)],i);if("optional"===f){if(t._flags.default!==a.symbols.deepDefault)return u.finalize(e,null,i);r.mainstay.tracer.value(r,"default",e,{}),e={}}}else if("forbidden"===f)return u.finalize(e,[t.$_createError("any.unknown",e,null,r,n)],i);const d=[];if(t._valids){const s=t._valids.get(e,r,n,t._flags.insensitive);if(s)return n.convert&&(r.mainstay.tracer.value(r,"valids",e,s.value),e=s.value),r.mainstay.tracer.filter(t,r,"valid",s),u.finalize(e,null,i);if(t._flags.only){const s=t.$_createError("any.only",e,{valids:t._valids.values({display:!0})},r,n);if(n.abortEarly)return u.finalize(e,[s],i);d.push(s)}}if(t._invalids){const s=t._invalids.get(e,r,n,t._flags.insensitive);if(s){r.mainstay.tracer.filter(t,r,"invalid",s);const o=t.$_createError("any.invalid",e,{invalids:t._invalids.values({display:!0})},r,n);if(n.abortEarly)return u.finalize(e,[o],i);d.push(o)}}if(l.validate){const t=l.validate(e,i);if(t&&(r.mainstay.tracer.value(r,"base",e,t.value),e=t.value,t.errors)){if(!Array.isArray(t.errors))return d.push(t.errors),u.finalize(e,d,i);if(t.errors.length)return d.push(...t.errors),u.finalize(e,d,i)}}return t._rules.length?u.rules(e,d,i):u.finalize(e,d,i)},u.rules=function(e,t,r){const{schema:n,state:s,prefs:o}=r;for(const i of n._rules){const l=n._definition.rules[i.method];if(l.convert&&o.convert){s.mainstay.tracer.log(n,s,"rule",i.name,"full");continue}let c,f=i.args;if(i._resolve.length){f=Object.assign({},f);for(const t of i._resolve){const r=l.argsByName.get(t),i=f[t].resolve(e,s,o),u=r.normalize?r.normalize(i):i,d=a.validateArg(u,null,r);if(d){c=n.$_createError("any.ref",i,{arg:t,ref:f[t],reason:d},s,o);break}f[t]=u}}c=c||l.validate(e,r,f,i);const d=u.rule(c,i);if(d.errors){if(s.mainstay.tracer.log(n,s,"rule",i.name,"error"),i.warn){s.mainstay.warnings.push(...d.errors);continue}if(o.abortEarly)return u.finalize(e,d.errors,r);t.push(...d.errors)}else s.mainstay.tracer.log(n,s,"rule",i.name,"pass"),s.mainstay.tracer.value(s,"rule",e,d.value,i.name),e=d.value}return u.finalize(e,t,r)},u.rule=function(e,t){return e instanceof l.Report?(u.error(e,t),{errors:[e],value:null}):Array.isArray(e)&&e[a.symbols.errors]?(e.forEach((e=>u.error(e,t))),{errors:e,value:null}):{errors:null,value:e}},u.error=function(e,t){return t.message&&e._setTemplate(t.message),e},u.finalize=function(e,t,r){t=t||[];const{schema:s,state:o,prefs:i}=r;if(t.length){const n=u.default("failover",void 0,t,r);void 0!==n&&(o.mainstay.tracer.value(o,"failover",e,n),e=n,t=[])}if(t.length&&s._flags.error)if("function"==typeof s._flags.error){t=s._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=[s._flags.error];if(void 0===e){const n=u.default("default",e,t,r);o.mainstay.tracer.value(o,"default",e,n),e=n}if(s._flags.cast&&void 0!==e){const t=s._definition.cast[s._flags.cast];if(t.from(e)){const n=t.to(e,r);o.mainstay.tracer.value(o,"cast",e,n,s._flags.cast),e=n}}if(s.$_terms.externals&&i.externals&&!1!==i._externals)for(const{method:e}of s.$_terms.externals)o.mainstay.externals.push({method:e,schema:s,state:o,label:l.label(s._flags,o,i)});const a={value:e,errors:t.length?t:null};return s._flags.result&&(a.value="strip"===s._flags.result?void 0:r.original,o.mainstay.tracer.value(o,s._flags.result,e,a.value),o.shadow(e,s._flags.result)),s._cache&&!1!==i.cache&&!s._refs.length&&s._cache.set(r.original,a),void 0===e||a.errors||void 0===s._flags.artifact||(o.mainstay.artifacts=o.mainstay.artifacts||new Map,o.mainstay.artifacts.has(s._flags.artifact)||o.mainstay.artifacts.set(s._flags.artifact,[]),o.mainstay.artifacts.get(s._flags.artifact).push(o.path)),a},u.prefs=function(e,t){const r=t===a.defaults;return r&&e._preferences[a.symbols.prefs]?e._preferences[a.symbols.prefs]:(t=a.preferences(t,e._preferences),r&&(e._preferences[a.symbols.prefs]=t),t)},u.default=function(e,t,r,n){const{schema:o,state:i,prefs:l}=n,c=o._flags[e];if(l.noDefaults||void 0===c)return t;if(i.mainstay.tracer.log(o,i,"rule",e,"full"),!c)return c;if("function"==typeof c){const a=c.length?[s(i.ancestors[0]),n]:[];try{return c(...a)}catch(t){return void r.push(o.$_createError(`any.${e}`,null,{error:t},i,l))}}return"object"!=typeof c?c:c[a.symbols.literal]?c.literal:a.isResolvable(c)?c.resolve(t,i,l):s(c)},u.trim=function(e,t){if("string"!=typeof e)return e;const r=t.$_getRule("trim");return r&&r.args.enabled?e.trim():e},u.ignore={active:!1,debug:o,entry:o,filter:o,log:o,resolve:o,value:o},u.errorsArray=function(){const e=[];return e[a.symbols.errors]=!0,e}},2036:(e,t,r)=>{"use strict";const n=r(375),s=r(9474),o=r(8160),i={};e.exports=i.Values=class{constructor(e,t){this._values=new Set(e),this._refs=new Set(t),this._lowercase=i.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 i.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(s(t,e))return{value:t};if(t)for(const o of this._refs){const i=o.resolve(e,t,r,null,{in:!0});if(void 0===i)continue;const a=o.in&&"object"==typeof i?Array.isArray(i)?i:Object.keys(i):[i];for(const t of a)if(typeof t==typeof e)if(n&&e&&"string"==typeof e){if(t.toLowerCase()===e.toLowerCase())return{value:t,ref:o}}else if(s(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 i.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 i.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}},i.Values.prototype[o.symbols.values]=!0,i.Values.prototype.slice=i.Values.prototype.clone,i.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)=>{"use strict";const n=r(375),s=r(8571),o=r(1687),i=r(9621),a={};e.exports=function(e,t,r={}){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 a.applyToDefaultsWithShallow(e,t,r);const i=s(e);if(!0===t)return i;const l=void 0!==r.nullOverride&&r.nullOverride;return o(i,t,{nullOverride:l,mergeArrays:!1})},a.applyToDefaultsWithShallow=function(e,t,r){const l=r.shallow;n(Array.isArray(l),"Invalid keys");const c=new Map,u=!0===t?null:new Set;for(let r of l){r=Array.isArray(r)?r:r.split(".");const n=i(e,r);n&&"object"==typeof n?c.set(n,u&&i(t,r)||n):u&&u.add(r)}const f=s(e,{},c);if(!u)return f;for(const e of u)a.reachCopy(f,t,e);const d=void 0!==r.nullOverride&&r.nullOverride;return o(f,t,{nullOverride:d,mergeArrays:!1})},a.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 s=e;for(let e=0;e<r.length-1;++e){const t=r[e];"object"!=typeof s[t]&&(s[t]={}),s=s[t]}s[r[r.length-1]]=n}},375:(e,t,r)=>{"use strict";const n=r(7916);e.exports=function(e,...t){if(!e){if(1===t.length&&t[0]instanceof Error)throw t[0];throw new n(t)}}},8571:(e,t,r)=>{"use strict";const n=r(9621),s=r(4277),o=r(7043),i={needsProtoHack:new Set([s.set,s.map,s.weakSet,s.weakMap])};e.exports=i.clone=function(e,t={},r=null){if("object"!=typeof e||null===e)return e;let n=i.clone,a=r;if(t.shallow){if(!0!==t.shallow)return i.cloneWithShallow(e,t);n=e=>e}else if(a){const t=a.get(e);if(t)return t}else a=new Map;const l=s.getInternalProto(e);if(l===s.buffer)return!1;if(l===s.date)return new Date(e.getTime());if(l===s.regex)return new RegExp(e);const c=i.base(e,l,t);if(c===e)return e;if(a&&a.set(e,c),l===s.set)for(const r of e)c.add(n(r,t,a));else if(l===s.map)for(const[r,s]of e)c.set(r,n(s,t,a));const u=o.keys(e,t);for(const r of u){if("__proto__"===r)continue;if(l===s.array&&"length"===r){c.length=e.length;continue}const o=Object.getOwnPropertyDescriptor(e,r);o?o.get||o.set?Object.defineProperty(c,r,o):o.enumerable?c[r]=n(e[r],t,a):Object.defineProperty(c,r,{enumerable:!1,writable:!0,configurable:!0,value:n(e[r],t,a)}):Object.defineProperty(c,r,{enumerable:!0,writable:!0,configurable:!0,value:n(e[r],t,a)})}return c},i.cloneWithShallow=function(e,t){const r=t.shallow;(t=Object.assign({},t)).shallow=!1;const s=new Map;for(const t of r){const r=n(e,t);"object"!=typeof r&&"function"!=typeof r||s.set(r,r)}return i.clone(e,t,s)},i.base=function(e,t,r){if(!1===r.prototype)return i.needsProtoHack.has(t)?new t.constructor:t===s.array?[]:{};const n=Object.getPrototypeOf(e);if(n&&n.isImmutable)return e;if(t===s.array){const e=[];return n!==t&&Object.setPrototypeOf(e,n),e}if(i.needsProtoHack.has(t)){const e=new n.constructor;return n!==t&&Object.setPrototypeOf(e,n),e}return Object.create(n)}},9474:(e,t,r)=>{"use strict";const n=r(4277),s={mismatched:null};e.exports=function(e,t,r){return r=Object.assign({prototype:!0},r),!!s.isDeepEqual(e,t,r,[])},s.isDeepEqual=function(e,t,r,o){if(e===t)return 0!==e||1/e==1/t;const i=typeof e;if(i!==typeof t)return!1;if(null===e||null===t)return!1;if("function"===i){if(!r.deepFunction||e.toString()!==t.toString())return!1}else if("object"!==i)return e!=e&&t!=t;const a=s.getSharedType(e,t,!!r.prototype);switch(a){case n.buffer:return!1;case n.promise:return e===t;case n.regex:return e.toString()===t.toString();case s.mismatched:return!1}for(let r=o.length-1;r>=0;--r)if(o[r].isSame(e,t))return!0;o.push(new s.SeenEntry(e,t));try{return!!s.isDeepEqualObj(a,e,t,r,o)}finally{o.pop()}},s.getSharedType=function(e,t,r){if(r)return Object.getPrototypeOf(e)!==Object.getPrototypeOf(t)?s.mismatched:n.getInternalProto(e);const o=n.getInternalProto(e);return o!==n.getInternalProto(t)?s.mismatched:o},s.valueOf=function(e){const t=e.valueOf;if(void 0===t)return e;try{return t.call(e)}catch(e){return e}},s.hasOwnEnumerableProperty=function(e,t){return Object.prototype.propertyIsEnumerable.call(e,t)},s.isSetSimpleEqual=function(e,t){for(const r of Set.prototype.values.call(e))if(!Set.prototype.has.call(t,r))return!1;return!0},s.isDeepEqualObj=function(e,t,r,o,i){const{isDeepEqual:a,valueOf:l,hasOwnEnumerableProperty:c}=s,{keys:u,getOwnPropertySymbols:f}=Object;if(e===n.array){if(!o.part){if(t.length!==r.length)return!1;for(let e=0;e<t.length;++e)if(!a(t[e],r[e],o,i))return!1;return!0}for(const e of t)for(const t of r)if(a(e,t,o,i))return!0}else if(e===n.set){if(t.size!==r.size)return!1;if(!s.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(a(r,n,o,i)){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(!a(n,Map.prototype.get.call(r,e),o,i))return!1}}else if(e===n.error&&(t.name!==r.name||t.message!==r.message))return!1;const d=l(t),m=l(r);if((t!==d||r!==m)&&!a(d,m,o,i))return!1;const p=u(t);if(!o.part&&p.length!==u(r).length&&!o.skip)return!1;let h=0;for(const e of p)if(o.skip&&o.skip.includes(e))void 0===r[e]&&++h;else{if(!c(r,e))return!1;if(!a(t[e],r[e],o,i))return!1}if(!o.part&&p.length-h!==u(r).length)return!1;if(!1!==o.symbols){const e=f(t),n=new Set(f(r));for(const s of e){if(!o.skip||!o.skip.includes(s))if(c(t,s)){if(!c(r,s))return!1;if(!a(t[s],r[s],o,i))return!1}else if(c(r,s))return!1;n.delete(s)}for(const e of n)if(c(r,e))return!1}return!0},s.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)=>{"use strict";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=>{"use strict";const t={};e.exports=function(e){if(!e)return"";let r="";for(let n=0;n<e.length;++n){const s=e.charCodeAt(n);t.isSafe(s)?r+=e[n]:r+=t.escapeHtmlChar(s)}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=>{"use strict";e.exports=function(e){return e.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}},738:e=>{"use strict";e.exports=function(){}},1687:(e,t,r)=>{"use strict";const n=r(375),s=r(8571),o=r(7043),i={};e.exports=i.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(s(t[n],{symbols:r.symbols}));return e}const a=o.keys(t,r);for(let n=0;n<a.length;++n){const o=a[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]=s(l,{symbols:r.symbols}):i.merge(e[o],l,r)}else(null!=l||r.nullOverride)&&(e[o]=l)}return e}},9621:(e,t,r)=>{"use strict";const n=r(375),s={};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 i=o?t:t.split(r.separator||".");let a=e;for(let e=0;e<i.length;++e){let o=i[e];const l=r.iterables&&s.iterables(a);if(Array.isArray(a)||"set"===l){const e=Number(o);Number.isInteger(e)&&(o=e<0?a.length+e:e)}if(!a||"function"==typeof a&&!1===r.functions||!l&&void 0===a[o]){n(!r.strict||e+1===i.length,"Missing segment",o,"in reach path ",t),n("object"==typeof a||!0===r.functions||"function"!=typeof a,"Invalid segment",o,"in reach path ",t),a=r.default;break}a=l?"set"===l?[...a][o]:a.get(o):a[o]}return a},s.iterables=function(e){return e instanceof Set?"set":e instanceof Map?"map":void 0}},8761:e=>{"use strict";e.exports=function(...e){try{return JSON.stringify(...e)}catch(e){return"[Cannot display object: "+e.message+"]"}}},4277:(e,t)=>{"use strict";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)=>{"use strict";t.keys=function(e,t={}){return!1!==t.symbols?Reflect.ownKeys(e):Object.getOwnPropertyNames(e)}},3652:(e,t,r)=>{"use strict";const n=r(375),s={};t.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(e,t){const r=[].concat((t=t||{}).before||[]),s=[].concat(t.after||[]),o=t.group||"?",i=t.sort||0;n(!r.includes(o),`Item cannot come before itself: ${o}`),n(!r.includes("?"),"Item cannot come before unassociated items"),n(!s.includes(o),`Item cannot come after itself: ${o}`),n(!s.includes("?"),"Item cannot come after unassociated items"),Array.isArray(e)||(e=[e]);for(const t of e){const e={seq:this._items.length,sort:i,before:r,after:s,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(s.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 s=n.seq,o=n.group;r[o]=r[o]||[],r[o].push(s),e[s]=n.before;for(const e of n.after)t[e]=t[e]||[],t[e].push(s)}for(const t in e){const n=[];for(const s in e[t]){const o=e[t][s];r[o]=r[o]||[],n.push(...r[o])}e[t]=n}for(const n in t)if(r[n])for(const s of r[n])e[s].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 s={},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===s[e])continue;n[e]||(n[e]=[]);const r=n[e].length;let o=0;for(let t=0;t<r;++t)s[n[e][t]]&&++o;if(o===r){t=e;break}}}null!==t&&(s[t]=!0,o.push(t))}if(o.length!==this._items.length)return!1;const i={};for(const e of this._items)i[e.seq]=e;this._items=[],this.nodes=[];for(const e of o){const t=i[e];this.nodes.push(t.node),this._items.push(t)}return!0}},s.mergeSort=(e,t)=>e.sort===t.sort?0:e.sort<t.sort?-1:1},5380:(e,t,r)=>{"use strict";const n=r(443),s=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,t={}){if(!e)return s.code("DOMAIN_NON_EMPTY_STRING");if("string"!=typeof e)throw new Error("Invalid input: domain must be a string");if(e.length>256)return s.code("DOMAIN_TOO_LONG");if(o.nonAsciiRx.test(e)){if(!1===t.allowUnicode)return s.code("DOMAIN_INVALID_UNICODE_CHARS");e=e.normalize("NFC")}if(o.domainControlRx.test(e))return s.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 s.code("DOMAIN_SEGMENTS_COUNT");if(t.maxDomainSegments&&n.length>t.maxDomainSegments)return s.code("DOMAIN_SEGMENTS_COUNT_MAX");const i=t.tlds;if(i){const e=n[n.length-1].toLowerCase();if(i.deny&&i.deny.has(e)||i.allow&&!i.allow.has(e))return s.code("DOMAIN_FORBIDDEN_TLDS")}for(let e=0;e<n.length;++e){const t=n[e];if(!t.length)return s.code("DOMAIN_EMPTY_SEGMENT");if(t.length>63)return s.code("DOMAIN_LONG_SEGMENT");if(e<n.length-1){if(!o.domainSegmentRx.test(t))return s.code("DOMAIN_INVALID_CHARS")}else if(!o.tldSegmentRx.test(t))return s.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)=>{"use strict";const n=r(9848),s=r(5380),o=r(2178),i={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(n.TextEncoder||TextEncoder)};t.analyze=function(e,t){return i.email(e,t)},t.isValid=function(e,t){return!i.email(e,t)},i.email=function(e,t={}){if("string"!=typeof e)throw new Error("Invalid input: email must be a string");if(!e)return o.code("EMPTY_STRING");const r=!i.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[a,l]=n;if(!a)return o.code("EMPTY_LOCAL");if(!t.ignoreLength){if(e.length>254)return o.code("ADDRESS_TOO_LONG");if(i.encoder.encode(a).length>64)return o.code("LOCAL_TOO_LONG")}return i.local(a,r)||s.analyze(l,t)},i.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(!i.atextRx.test(e))return o.code("INVALID_LOCAL_CHARS")}else for(const t of e){if(i.atextRx.test(t))continue;const e=i.binary(t);if(!i.atomRx.test(e))return o.code("INVALID_LOCAL_CHARS")}}},i.binary=function(e){return Array.from(i.encoder.encode(e)).map((e=>String.fromCharCode(e))).join("")},i.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/,i.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)=>{"use strict";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)=>{"use strict";const n=r(375),s=r(5752);t.regex=function(e={}){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 s.ip[e];const r=`\\/${"ipv4"===e?s.ip.v4Cidr:s.ip.v6Cidr}`;return"required"===t?`${s.ip[e]}${r}`:`${s.ip[e]}(?:${r})?`})).join("|")})`,i=new RegExp(`^${o}$`);return{cidr:t,versions:r,regex:i,raw:o}}},5752:(e,t,r)=>{"use strict";const n=r(375),s=r(6064),o={generate:function(){const e={},t="\\dA-Fa-f",r="["+t+"]",n="\\w-\\.~",s="!\\$&'\\(\\)\\*\\+,;=",o="%"+t,i=n+o+s+":@",a="["+i+"]",l="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";e.ipv4address="(?:"+l+"\\.){3}"+l;const c=r+"{1,4}",u="(?:"+c+":"+c+"|"+e.ipv4address+")",f="(?:"+c+":){6}"+u,d="::(?:"+c+":){5}"+u,m="(?:"+c+")?::(?:"+c+":){4}"+u,p="(?:(?:"+c+":){0,1}"+c+")?::(?:"+c+":){3}"+u,h="(?:(?:"+c+":){0,2}"+c+")?::(?:"+c+":){2}"+u,g="(?:(?:"+c+":){0,3}"+c+")?::"+c+":"+u,y="(?:(?:"+c+":){0,4}"+c+")?::"+u,b="(?:(?:"+c+":){0,5}"+c+")?::"+c,v="(?:(?:"+c+":){0,6}"+c+")?::";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="(?:"+f+"|"+d+"|"+m+"|"+p+"|"+h+"|"+g+"|"+y+"|"+b+"|"+v+")",e.ipvFuture="v"+r+"+\\.["+n+s+":]+",e.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",e.schemeRegex=new RegExp(e.scheme);const _="["+n+o+s+":]*",w="["+n+o+s+"]{1,255}",x="(?:\\[(?:"+e.ipv6address+"|"+e.ipvFuture+")\\]|"+e.ipv4address+"|"+w+")",S="(?:"+_+"@)?"+x+"(?::\\d*)?",$="(?:"+_+"@)?("+x+")(?::\\d*)?",k=a+"*",O=a+"+",R="(?:\\/"+k+")*",E="\\/(?:"+O+R+")?",j=O+R,A="["+n+o+s+"@]+"+R,C="(?:\\/\\/\\/"+k+R+")";return e.hierPart="(?:(?:\\/\\/"+S+R+")|"+E+"|"+j+"|"+C+")",e.hierPartCapture="(?:(?:\\/\\/"+$+R+")|"+E+"|"+j+")",e.relativeRef="(?:(?:\\/\\/"+S+R+")|"+E+"|"+A+"|)",e.relativeRefCapture="(?:(?:\\/\\/"+$+R+")|"+E+"|"+A+"|)",e.query="["+i+"\\/\\?]*(?=#|$)",e.queryWithSquareBrackets="["+i+"\\[\\]\\/\\?]*(?=#|$)",e.fragment="["+i+"\\/\\?]*",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+")?",i=e.domain?t.relativeRefCapture:t.relativeRef;if(e.relativeOnly)return o.wrap(i+r);let a="";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 i=r[e];n(i instanceof RegExp||"string"==typeof i,"scheme at position "+e+" must be a RegExp or String"),i instanceof RegExp?o.push(i.source.toString()):(n(t.schemeRegex.test(i),"scheme at position "+e+" must be a valid scheme"),o.push(s(i)))}a=o.join("|")}const l="(?:"+(a?"(?:"+a+")":t.scheme)+":"+(e.domain?t.hierPartCapture:t.hierPart)+")",c=e.allowRelative?"(?:"+l+"|"+i+")":l;return o.wrap(c+r,a)},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(e={}){return e.scheme||e.allowRelative||e.relativeOnly||e.allowQuerySquareBrackets||e.domain?o.createRegex(e):o.uriRegex}},1447:(e,t)=>{"use strict";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,t={}){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=[],s="",o=0,i=!1;const a=e=>{if(o)throw new Error("Formula missing closing parenthesis");const a=n.length?n[n.length-1]:null;if(i||s||e){if(a&&"reference"===a.type&&")"===e)return a.type="function",a.value=this._subFormula(s,a.value),void(s="");if(")"===e){const e=new t.Parser(s,this.settings);n.push({type:"segment",value:e})}else if(i){if("]"===i)return n.push({type:"reference",value:s}),void(s="");n.push({type:"literal",value:s})}else if(r.operatorCharacters.includes(s))a&&"operator"===a.type&&r.operators.includes(a.value+s)?a.value+=s:n.push({type:"operator",value:s});else if(s.match(r.numberRx))n.push({type:"constant",value:parseFloat(s)});else if(void 0!==this.settings.constants[s])n.push({type:"constant",value:this.settings.constants[s]});else{if(!s.match(r.tokenRx))throw new Error(`Formula contains invalid token: ${s}`);n.push({type:"reference",value:s})}s=""}};for(const t of e)i?t===i?(a(),i=!1):s+=t:o?"("===t?(s+=t,++o):")"===t?(--o,o?s+=t:a(t)):s+=t:t in r.literals?i=r.literals[t]:"("===t?(a(),++o):r.operatorCharacters.includes(t)?(a(),s=t,a()):" "!==t?s+=t:a();a(),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 s=this.settings.functions[n];if("function"!=typeof s)throw new Error(`Formula contains unknown function ${n}`);let o=[];if(e){let t="",s=0,i=!1;const a=()=>{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];i?(t+=o,o===i&&(i=!1)):o in r.literals&&!s?(t+=o,i=r.literals[o]):","!==o||s?(t+=o,"("===o?++s:")"===o&&--s):a()}a()}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 s.call(e,...t)}}evaluate(e){const t=this._parts.slice();for(let n=t.length-2;n>=0;--n){const s=t[n];if(s&&"operator"===s.type){const o=t[n+1];t.splice(n+1,1);const i=r.evaluate(o,e);t[n]=r.single(s.value,i)}}return r.operatorsOrder.forEach((n=>{for(let s=1;s<t.length-1;)if(n.includes(t[s])){const n=t[s],o=r.evaluate(t[s-1],e),i=r.evaluate(t[s+1],e);t.splice(s,2);const a=r.calculate(n,o,i);t[s-1]=0===a?0:a}else s+=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=>{"use strict";e.exports=JSON.parse('{"version":"17.13.3"}')}},t={},function r(n){var s=t[n];if(void 0!==s)return s.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,r),o.exports}(5107);var e,t},e.exports=t()},2694:(e,t,r)=>{"use strict";var n=r(6925);function s(){}function o(){}o.resetWarningCache=s,e.exports=function(){function e(e,t,r,s,o,i){if(i!==n){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:s};return r.PropTypes=r,r}},5556:(e,t,r)=>{e.exports=r(2694)()},6925:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},24740:function(e,t,r){!function(e,t){"use strict";function r(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var n=r(t);function s(e,t){return s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},s(e,t)}var o={error:null},i=function(e){function t(){for(var t,r=arguments.length,n=new Array(r),s=0;s<r;s++)n[s]=arguments[s];return(t=e.call.apply(e,[this].concat(n))||this).state=o,t.resetErrorBoundary=function(){for(var e,r=arguments.length,n=new Array(r),s=0;s<r;s++)n[s]=arguments[s];null==t.props.onReset||(e=t.props).onReset.apply(e,n),t.reset()},t}var r,i;i=e,(r=t).prototype=Object.create(i.prototype),r.prototype.constructor=r,s(r,i),t.getDerivedStateFromError=function(e){return{error:e}};var a=t.prototype;return a.reset=function(){this.setState(o)},a.componentDidCatch=function(e,t){var r,n;null==(r=(n=this.props).onError)||r.call(n,e,t)},a.componentDidUpdate=function(e,t){var r,n,s,o,i=this.state.error,a=this.props.resetKeys;null!==i&&null!==t.error&&(void 0===(s=e.resetKeys)&&(s=[]),void 0===(o=a)&&(o=[]),s.length!==o.length||s.some((function(e,t){return!Object.is(e,o[t])})))&&(null==(r=(n=this.props).onResetKeysChange)||r.call(n,e.resetKeys,a),this.reset())},a.render=function(){var e=this.state.error,t=this.props,r=t.fallbackRender,s=t.FallbackComponent,o=t.fallback;if(null!==e){var i={error:e,resetErrorBoundary:this.resetErrorBoundary};if(n.isValidElement(o))return o;if("function"==typeof r)return r(i);if(s)return n.createElement(s,i);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},t}(n.Component);e.ErrorBoundary=i,e.useErrorHandler=function(e){var t=n.useState(null),r=t[0],s=t[1];if(null!=e)throw e;if(null!=r)throw r;return s},e.withErrorBoundary=function(e,t){var r=function(r){return n.createElement(i,t,n.createElement(e,r))},s=e.displayName||e.name||"Unknown";return r.displayName="withErrorBoundary("+s+")",r},Object.defineProperty(e,"__esModule",{value:!0})}(t,r(51609))},51609:e=>{"use strict";e.exports=window.React}},t={};function r(n){var s=t[n];if(void 0!==s)return s.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,r),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.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e=r(51609),t=r.n(e);const n=window.wp.element;function s(e){return"field"===e.nodeType}function o(e){return"group"===e.nodeType}function i(e){return"validation_error"===e.type||null!=e.data?.errors}function a(e){return"gateway_error"===e.type}function l(e,t,r){e.forEach((e=>{r&&!r(e)||t(e),o(e)&&l(e.nodes,t,r)}))}function c(e,t,r,n){let s=r;return l(e,(e=>{s=t(s,e)}),n),s}var u=e=>"checkbox"===e.type,f=e=>e instanceof Date,d=e=>null==e;const m=e=>"object"==typeof e;var p=e=>!d(e)&&!Array.isArray(e)&&m(e)&&!f(e),h="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function g(e){let t;const r=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else{if(h&&(e instanceof Blob||e instanceof FileList)||!r&&!p(e))return e;if(t=r?[]:{},r||(e=>{const t=e.constructor&&e.constructor.prototype;return p(t)&&t.hasOwnProperty("isPrototypeOf")})(e))for(const r in e)e.hasOwnProperty(r)&&(t[r]=g(e[r]));else t=e}return t}var y=e=>Array.isArray(e)?e.filter(Boolean):[],b=e=>void 0===e,v=(e,t,r)=>{if(!t||!p(e))return r;const n=y(t.split(/[,[\].]+?/)).reduce(((e,t)=>d(e)?e:e[t]),e);return b(n)||n===e?b(e[t])?r:e[t]:n};const _="onChange",w="onSubmit",x="all",S="pattern",$="required",k=e.createContext(null),O=()=>e.useContext(k),R=t=>{const{children:r,...n}=t;return e.createElement(k.Provider,{value:n},r)};var E=(e,t,r,n=!0)=>{const s={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(s,o,{get:()=>{const s=o;return t._proxyFormState[s]!==x&&(t._proxyFormState[s]=!n||x),r&&(r[s]=!0),e[s]}});return s},j=e=>p(e)&&!Object.keys(e).length,A=(e,t,r,n)=>{r(e);const{name:s,...o}=e;return j(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find((e=>t[e]===(!n||x)))},C=e=>Array.isArray(e)?e:[e],F=(e,t,r)=>r&&t?e===t:!e||!t||e===t||C(e).some((e=>e&&(e.startsWith(t)||t.startsWith(e))));function D(t){const r=e.useRef(t);r.current=t,e.useEffect((()=>{const e=!t.disabled&&r.current.subject&&r.current.subject.subscribe({next:r.current.next});return()=>{e&&e.unsubscribe()}}),[t.disabled])}function I(t){const r=O(),{control:n=r.control,disabled:s,name:o,exact:i}=t||{},[a,l]=e.useState(n._formState),c=e.useRef(!0),u=e.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1}),f=e.useRef(o);return f.current=o,D({disabled:s,next:e=>c.current&&F(f.current,e.name,i)&&A(e,u.current,n._updateFormState)&&l({...n._formState,...e}),subject:n._subjects.state}),e.useEffect((()=>(c.current=!0,u.current.isValid&&n._updateValid(!0),()=>{c.current=!1})),[n]),E(a,n,u.current,!1)}var M=e=>"string"==typeof e,P=(e,t,r,n,s)=>M(e)?(n&&t.watch.add(e),v(r,e,s)):Array.isArray(e)?e.map((e=>(n&&t.watch.add(e),v(r,e)))):(n&&(t.watchAll=!0),r);function T(t){const r=O(),{control:n=r.control,name:s,defaultValue:o,disabled:i,exact:a}=t||{},l=e.useRef(s);l.current=s,D({disabled:i,subject:n._subjects.values,next:e=>{F(l.current,e.name,a)&&u(g(P(l.current,n._names,e.values||n._formValues,!1,o)))}});const[c,u]=e.useState(n._getWatch(s,o));return e.useEffect((()=>n._removeUnmounted())),c}var N=e=>/^\w*$/.test(e),L=e=>y(e.replace(/["|']|\]/g,"").split(/\.|\[/));function z(e,t,r){let n=-1;const s=N(t)?[t]:L(t),o=s.length,i=o-1;for(;++n<o;){const t=s[n];let o=r;if(n!==i){const r=e[t];o=p(r)||Array.isArray(r)?r:isNaN(+s[n+1])?{}:[]}e[t]=o,e=e[t]}return e}var V=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{};const q=(e,t,r)=>{for(const n of r||Object.keys(e)){const r=v(e,n);if(r){const{_f:e,...n}=r;if(e&&t(e.name)){if(e.ref.focus){e.ref.focus();break}if(e.refs&&e.refs[0].focus){e.refs[0].focus();break}}else p(n)&&q(n,t)}}};var U=e=>({isOnSubmit:!e||e===w,isOnBlur:"onBlur"===e,isOnChange:e===_,isOnAll:e===x,isOnTouch:"onTouched"===e}),W=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some((t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))))),B=(e,t,r)=>{const n=y(v(e,r));return z(n,"root",t[r]),z(e,r,n),e},H=e=>"boolean"==typeof e,G=e=>"file"===e.type,K=e=>"function"==typeof e,Z=e=>{if(!h)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Y=e=>M(e),J=e=>"radio"===e.type,X=e=>e instanceof RegExp;const Q={value:!1,isValid:!1},ee={value:!0,isValid:!0};var te=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter((e=>e&&e.checked&&!e.disabled)).map((e=>e.value));return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!b(e[0].attributes.value)?b(e[0].value)||""===e[0].value?ee:{value:e[0].value,isValid:!0}:ee:Q}return Q};const re={isValid:!1,value:null};var ne=e=>Array.isArray(e)?e.reduce(((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e),re):re;function se(e,t,r="validate"){if(Y(e)||Array.isArray(e)&&e.every(Y)||H(e)&&!e)return{type:r,message:Y(e)?e:"",ref:t}}var oe=e=>p(e)&&!X(e)?e:{value:e,message:""},ie=async(e,t,r,n,s)=>{const{ref:o,refs:i,required:a,maxLength:l,minLength:c,min:f,max:m,pattern:h,validate:g,name:y,valueAsNumber:_,mount:w,disabled:x}=e._f,k=v(t,y);if(!w||x)return{};const O=i?i[0]:o,R=e=>{n&&O.reportValidity&&(O.setCustomValidity(H(e)?"":e||""),O.reportValidity())},E={},A=J(o),C=u(o),F=A||C,D=(_||G(o))&&b(o.value)&&b(k)||Z(o)&&""===o.value||""===k||Array.isArray(k)&&!k.length,I=V.bind(null,y,r,E),P=(e,t,r,n="maxLength",s="minLength")=>{const i=e?t:r;E[y]={type:e?n:s,message:i,ref:o,...I(e?n:s,i)}};if(s?!Array.isArray(k)||!k.length:a&&(!F&&(D||d(k))||H(k)&&!k||C&&!te(i).isValid||A&&!ne(i).isValid)){const{value:e,message:t}=Y(a)?{value:!!a,message:a}:oe(a);if(e&&(E[y]={type:$,message:t,ref:O,...I($,t)},!r))return R(t),E}if(!(D||d(f)&&d(m))){let e,t;const n=oe(m),s=oe(f);if(d(k)||isNaN(k)){const r=o.valueAsDate||new Date(k),i=e=>new Date((new Date).toDateString()+" "+e),a="time"==o.type,l="week"==o.type;M(n.value)&&k&&(e=a?i(k)>i(n.value):l?k>n.value:r>new Date(n.value)),M(s.value)&&k&&(t=a?i(k)<i(s.value):l?k<s.value:r<new Date(s.value))}else{const r=o.valueAsNumber||(k?+k:k);d(n.value)||(e=r>n.value),d(s.value)||(t=r<s.value)}if((e||t)&&(P(!!e,n.message,s.message,"max","min"),!r))return R(E[y].message),E}if((l||c)&&!D&&(M(k)||s&&Array.isArray(k))){const e=oe(l),t=oe(c),n=!d(e.value)&&k.length>+e.value,s=!d(t.value)&&k.length<+t.value;if((n||s)&&(P(n,e.message,t.message),!r))return R(E[y].message),E}if(h&&!D&&M(k)){const{value:e,message:t}=oe(h);if(X(e)&&!k.match(e)&&(E[y]={type:S,message:t,ref:o,...I(S,t)},!r))return R(t),E}if(g)if(K(g)){const e=se(await g(k,t),O);if(e&&(E[y]={...e,...I("validate",e.message)},!r))return R(e.message),E}else if(p(g)){let e={};for(const n in g){if(!j(e)&&!r)break;const s=se(await g[n](k,t),O,n);s&&(e={...s,...I(n,s.message)},R(s.message),r&&(E[y]=e))}if(!j(e)&&(E[y]={ref:O,...e},!r))return E}return R(!0),E};function ae(e,t){const r=Array.isArray(t)?t:N(t)?[t]:L(t),n=1===r.length?e:function(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=b(e)?n++:e[t[n++]];return e}(e,r),s=r.length-1,o=r[s];return n&&delete n[o],0!==s&&(p(n)&&j(n)||Array.isArray(n)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!b(e[t]))return!1;return!0}(n))&&ae(e,r.slice(0,-1)),e}function le(){let e=[];return{get observers(){return e},next:t=>{for(const r of e)r.next&&r.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter((e=>e!==t))}}),unsubscribe:()=>{e=[]}}}var ce=e=>d(e)||!m(e);function ue(e,t){if(ce(e)||ce(t))return e===t;if(f(e)&&f(t))return e.getTime()===t.getTime();const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const s of r){const r=e[s];if(!n.includes(s))return!1;if("ref"!==s){const e=t[s];if(f(r)&&f(e)||p(r)&&p(e)||Array.isArray(r)&&Array.isArray(e)?!ue(r,e):r!==e)return!1}}return!0}var fe=e=>"select-multiple"===e.type,de=e=>Z(e)&&e.isConnected,me=e=>{for(const t in e)if(K(e[t]))return!0;return!1};function pe(e,t={}){const r=Array.isArray(e);if(p(e)||r)for(const r in e)Array.isArray(e[r])||p(e[r])&&!me(e[r])?(t[r]=Array.isArray(e[r])?[]:{},pe(e[r],t[r])):d(e[r])||(t[r]=!0);return t}function he(e,t,r){const n=Array.isArray(e);if(p(e)||n)for(const n in e)Array.isArray(e[n])||p(e[n])&&!me(e[n])?b(t)||ce(r[n])?r[n]=Array.isArray(e[n])?pe(e[n],[]):{...pe(e[n])}:he(e[n],d(t)?{}:t[n],r[n]):r[n]=!ue(e[n],t[n]);return r}var ge=(e,t)=>he(e,t,pe(t)),ye=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>b(e)?e:t?""===e?NaN:e?+e:e:r&&M(e)?new Date(e):n?n(e):e;function be(e){const t=e.ref;if(!(e.refs?e.refs.every((e=>e.disabled)):t.disabled))return G(t)?t.files:J(t)?ne(e.refs).value:fe(t)?[...t.selectedOptions].map((({value:e})=>e)):u(t)?te(e.refs).value:ye(b(t.value)?e.ref.value:t.value,e)}var ve=e=>b(e)?e:X(e)?e.source:p(e)?X(e.value)?e.value.source:e.value:e;function _e(e,t,r){const n=v(e,r);if(n||N(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const n=s.join("."),o=v(t,n),i=v(e,n);if(o&&!Array.isArray(o)&&r!==n)return{name:r};if(i&&i.type)return{name:n,error:i};s.pop()}return{name:r}}const we={mode:w,reValidateMode:_,shouldFocusError:!0};function xe(e={},t){let r,n={...we,...e},s={submitCount:0,isDirty:!1,isLoading:K(n.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{}},o={},i=(p(n.defaultValues)||p(n.values))&&g(n.defaultValues||n.values)||{},a=n.shouldUnregister?{}:g(i),l={action:!1,mount:!1,watch:!1},c={mount:new Set,unMount:new Set,array:new Set,watch:new Set},m=0;const _={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},w={values:le(),array:le(),state:le()},S=e.resetOptions&&e.resetOptions.keepDirtyValues,$=U(n.mode),k=U(n.reValidateMode),O=n.criteriaMode===x,R=async e=>{if(_.isValid||e){const e=n.resolver?j((await D()).errors):await I(o,!0);e!==s.isValid&&w.state.next({isValid:e})}},E=e=>_.isValidating&&w.state.next({isValidating:e}),A=(e,t,r,n)=>{const s=v(o,e);if(s){const o=v(a,e,b(r)?v(i,e):r);b(o)||n&&n.defaultChecked||t?z(a,e,t?o:be(s._f)):L(e,o),l.mount&&R()}},F=(e,t,r,n,o)=>{let a=!1,l=!1;const c={name:e};if(!r||n){_.isDirty&&(l=s.isDirty,s.isDirty=c.isDirty=T(),a=l!==c.isDirty);const r=ue(v(i,e),t);l=v(s.dirtyFields,e),r?ae(s.dirtyFields,e):z(s.dirtyFields,e,!0),c.dirtyFields=s.dirtyFields,a=a||_.dirtyFields&&l!==!r}if(r){const t=v(s.touchedFields,e);t||(z(s.touchedFields,e,r),c.touchedFields=s.touchedFields,a=a||_.touchedFields&&t!==r)}return a&&o&&w.state.next(c),a?c:{}},D=async e=>n.resolver(a,n.context,((e,t,r,n)=>{const s={};for(const r of e){const e=v(t,r);e&&z(s,r,e._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}})(e||c.mount,o,n.criteriaMode,n.shouldUseNativeValidation)),I=async(e,t,r={valid:!0})=>{for(const o in e){const i=e[o];if(i){const{_f:e,...o}=i;if(e){const o=c.array.has(e.name),l=await ie(i,a,O,n.shouldUseNativeValidation&&!t,o);if(l[e.name]&&(r.valid=!1,t))break;!t&&(v(l,e.name)?o?B(s.errors,l,e.name):z(s.errors,e.name,l[e.name]):ae(s.errors,e.name))}o&&await I(o,t,r)}}return r.valid},T=(e,t)=>(e&&t&&z(a,e,t),!ue(ee(),i)),N=(e,t,r)=>P(e,c,{...l.mount?a:b(t)?i:M(e)?{[e]:t}:t},r,t),L=(e,t,r={})=>{const n=v(o,e);let s=t;if(n){const r=n._f;r&&(!r.disabled&&z(a,e,ye(t,r)),s=Z(r.ref)&&d(t)?"":t,fe(r.ref)?[...r.ref.options].forEach((e=>e.selected=s.includes(e.value))):r.refs?u(r.ref)?r.refs.length>1?r.refs.forEach((e=>(!e.defaultChecked||!e.disabled)&&(e.checked=Array.isArray(s)?!!s.find((t=>t===e.value)):s===e.value))):r.refs[0]&&(r.refs[0].checked=!!s):r.refs.forEach((e=>e.checked=e.value===s)):G(r.ref)?r.ref.value="":(r.ref.value=s,r.ref.type||w.values.next({name:e,values:{...a}})))}(r.shouldDirty||r.shouldTouch)&&F(e,s,r.shouldTouch,r.shouldDirty,!0),r.shouldValidate&&Q(e)},V=(e,t,r)=>{for(const n in t){const s=t[n],i=`${e}.${n}`,a=v(o,i);!c.array.has(e)&&ce(s)&&(!a||a._f)||f(s)?L(i,s,r):V(i,s,r)}},Y=(e,r,n={})=>{const u=v(o,e),f=c.array.has(e),m=g(r);z(a,e,m),f?(w.array.next({name:e,values:{...a}}),(_.isDirty||_.dirtyFields)&&n.shouldDirty&&w.state.next({name:e,dirtyFields:ge(i,a),isDirty:T(e,m)})):!u||u._f||d(m)?L(e,m,n):V(e,m,n),W(e,c)&&w.state.next({...s}),w.values.next({name:e,values:{...a}}),!l.mount&&t()},X=async t=>{const i=t.target;let l=i.name,f=!0;const d=v(o,l);if(d){let g,y;const b=i.type?be(d._f):(e=>p(e)&&e.target?u(e.target)?e.target.checked:e.target.value:e)(t),x="blur"===t.type||"focusout"===t.type,S=!((h=d._f).mount&&(h.required||h.min||h.max||h.maxLength||h.minLength||h.pattern||h.validate)||n.resolver||v(s.errors,l)||d._f.deps)||((e,t,r,n,s)=>!s.isOnAll&&(!r&&s.isOnTouch?!(t||e):(r?n.isOnBlur:s.isOnBlur)?!e:!(r?n.isOnChange:s.isOnChange)||e))(x,v(s.touchedFields,l),s.isSubmitted,k,$),A=W(l,c,x);z(a,l,b),x?(d._f.onBlur&&d._f.onBlur(t),r&&r(0)):d._f.onChange&&d._f.onChange(t);const C=F(l,b,x,!1),M=!j(C)||A;if(!x&&w.values.next({name:l,type:t.type,values:{...a}}),S)return _.isValid&&R(),M&&w.state.next({name:l,...A?{}:C});if(!x&&A&&w.state.next({...s}),E(!0),n.resolver){const{errors:e}=await D([l]),t=_e(s.errors,o,l),r=_e(e,o,t.name||l);g=r.error,l=r.name,y=j(e)}else g=(await ie(d,a,O,n.shouldUseNativeValidation))[l],f=isNaN(b)||b===v(a,l,b),f&&(g?y=!1:_.isValid&&(y=await I(o,!0)));f&&(d._f.deps&&Q(d._f.deps),((t,n,o,i)=>{const a=v(s.errors,t),l=_.isValid&&H(n)&&s.isValid!==n;var c;if(e.delayError&&o?(c=()=>((e,t)=>{z(s.errors,e,t),w.state.next({errors:s.errors})})(t,o),r=e=>{clearTimeout(m),m=setTimeout(c,e)},r(e.delayError)):(clearTimeout(m),r=null,o?z(s.errors,t,o):ae(s.errors,t)),(o?!ue(a,o):a)||!j(i)||l){const e={...i,...l&&H(n)?{isValid:n}:{},errors:s.errors,name:t};s={...s,...e},w.state.next(e)}E(!1)})(l,y,g,C))}var h},Q=async(e,t={})=>{let r,i;const a=C(e);if(E(!0),n.resolver){const t=await(async e=>{const{errors:t}=await D();if(e)for(const r of e){const e=v(t,r);e?z(s.errors,r,e):ae(s.errors,r)}else s.errors=t;return t})(b(e)?e:a);r=j(t),i=e?!a.some((e=>v(t,e))):r}else e?(i=(await Promise.all(a.map((async e=>{const t=v(o,e);return await I(t&&t._f?{[e]:t}:t)})))).every(Boolean),(i||s.isValid)&&R()):i=r=await I(o);return w.state.next({...!M(e)||_.isValid&&r!==s.isValid?{}:{name:e},...n.resolver||!e?{isValid:r}:{},errors:s.errors,isValidating:!1}),t.shouldFocus&&!i&&q(o,(e=>e&&v(s.errors,e)),e?a:c.mount),i},ee=e=>{const t={...i,...l.mount?a:{}};return b(e)?t:M(e)?v(t,e):e.map((e=>v(t,e)))},te=(e,t)=>({invalid:!!v((t||s).errors,e),isDirty:!!v((t||s).dirtyFields,e),isTouched:!!v((t||s).touchedFields,e),error:v((t||s).errors,e)}),re=(e,t,r)=>{const n=(v(o,e,{_f:{}})._f||{}).ref;z(s.errors,e,{...t,ref:n}),w.state.next({name:e,errors:s.errors,isValid:!1}),r&&r.shouldFocus&&n&&n.focus&&n.focus()},ne=(e,t={})=>{for(const r of e?C(e):c.mount)c.mount.delete(r),c.array.delete(r),t.keepValue||(ae(o,r),ae(a,r)),!t.keepError&&ae(s.errors,r),!t.keepDirty&&ae(s.dirtyFields,r),!t.keepTouched&&ae(s.touchedFields,r),!n.shouldUnregister&&!t.keepDefaultValue&&ae(i,r);w.values.next({values:{...a}}),w.state.next({...s,...t.keepDirty?{isDirty:T()}:{}}),!t.keepIsValid&&R()},se=(e,t={})=>{let r=v(o,e);const s=H(t.disabled);return z(o,e,{...r||{},_f:{...r&&r._f?r._f:{ref:{name:e}},name:e,mount:!0,...t}}),c.mount.add(e),r?s&&z(a,e,t.disabled?void 0:v(a,e,be(r._f))):A(e,!0,t.value),{...s?{disabled:t.disabled}:{},...n.progressive?{required:!!t.required,min:ve(t.min),max:ve(t.max),minLength:ve(t.minLength),maxLength:ve(t.maxLength),pattern:ve(t.pattern)}:{},name:e,onChange:X,onBlur:X,ref:s=>{if(s){se(e,t),r=v(o,e);const n=b(s.value)&&s.querySelectorAll&&s.querySelectorAll("input,select,textarea")[0]||s,a=(e=>J(e)||u(e))(n),l=r._f.refs||[];if(a?l.find((e=>e===n)):n===r._f.ref)return;z(o,e,{_f:{...r._f,...a?{refs:[...l.filter(de),n,...Array.isArray(v(i,e))?[{}]:[]],ref:{type:n.type,name:e}}:{ref:n}}}),A(e,!1,void 0,n)}else r=v(o,e,{}),r._f&&(r._f.mount=!1),(n.shouldUnregister||t.shouldUnregister)&&(!((e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)))(c.array,e)||!l.action)&&c.unMount.add(e)}}},oe=()=>n.shouldFocusError&&q(o,(e=>e&&v(s.errors,e)),c.mount),me=(e,t)=>async r=>{r&&(r.preventDefault&&r.preventDefault(),r.persist&&r.persist());let i=g(a);if(w.state.next({isSubmitting:!0}),n.resolver){const{errors:e,values:t}=await D();s.errors=e,i=t}else await I(o);ae(s.errors,"root"),j(s.errors)?(w.state.next({errors:{}}),await e(i,r)):(t&&await t({...s.errors},r),oe(),setTimeout(oe)),w.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:j(s.errors),submitCount:s.submitCount+1,errors:s.errors})},pe=(r,n={})=>{const u=r||i,f=g(u),d=r&&!j(r)?f:i;if(n.keepDefaultValues||(i=u),!n.keepValues){if(n.keepDirtyValues||S)for(const e of c.mount)v(s.dirtyFields,e)?z(d,e,v(a,e)):Y(e,v(d,e));else{if(h&&b(r))for(const e of c.mount){const t=v(o,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(Z(e)){const t=e.closest("form");if(t){t.reset();break}}}}o={}}a=e.shouldUnregister?n.keepDefaultValues?g(i):{}:g(d),w.array.next({values:{...d}}),w.values.next({values:{...d}})}c={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!l.mount&&t(),l.mount=!_.isValid||!!n.keepIsValid,l.watch=!!e.shouldUnregister,w.state.next({submitCount:n.keepSubmitCount?s.submitCount:0,isDirty:n.keepDirty?s.isDirty:!(!n.keepDefaultValues||ue(r,i)),isSubmitted:!!n.keepIsSubmitted&&s.isSubmitted,dirtyFields:n.keepDirtyValues?s.dirtyFields:n.keepDefaultValues&&r?ge(i,r):{},touchedFields:n.keepTouched?s.touchedFields:{},errors:n.keepErrors?s.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})},he=(e,t)=>pe(K(e)?e(a):e,t);return{control:{register:se,unregister:ne,getFieldState:te,handleSubmit:me,setError:re,_executeSchema:D,_getWatch:N,_getDirty:T,_updateValid:R,_removeUnmounted:()=>{for(const e of c.unMount){const t=v(o,e);t&&(t._f.refs?t._f.refs.every((e=>!de(e))):!de(t._f.ref))&&ne(e)}c.unMount=new Set},_updateFieldArray:(e,t=[],r,n,c=!0,u=!0)=>{if(n&&r){if(l.action=!0,u&&Array.isArray(v(o,e))){const t=r(v(o,e),n.argA,n.argB);c&&z(o,e,t)}if(u&&Array.isArray(v(s.errors,e))){const t=r(v(s.errors,e),n.argA,n.argB);c&&z(s.errors,e,t),((e,t)=>{!y(v(e,t)).length&&ae(e,t)})(s.errors,e)}if(_.touchedFields&&u&&Array.isArray(v(s.touchedFields,e))){const t=r(v(s.touchedFields,e),n.argA,n.argB);c&&z(s.touchedFields,e,t)}_.dirtyFields&&(s.dirtyFields=ge(i,a)),w.state.next({name:e,isDirty:T(e,t),dirtyFields:s.dirtyFields,errors:s.errors,isValid:s.isValid})}else z(a,e,t)},_getFieldArray:t=>y(v(l.mount?a:i,t,e.shouldUnregister?v(i,t,[]):[])),_reset:pe,_resetDefaultValues:()=>K(n.defaultValues)&&n.defaultValues().then((e=>{he(e,n.resetOptions),w.state.next({isLoading:!1})})),_updateFormState:e=>{s={...s,...e}},_subjects:w,_proxyFormState:_,get _fields(){return o},get _formValues(){return a},get _state(){return l},set _state(e){l=e},get _defaultValues(){return i},get _names(){return c},set _names(e){c=e},get _formState(){return s},set _formState(e){s=e},get _options(){return n},set _options(e){n={...n,...e}}},trigger:Q,register:se,handleSubmit:me,watch:(e,t)=>K(e)?w.values.subscribe({next:r=>e(N(void 0,t),r)}):N(e,t,!0),setValue:Y,getValues:ee,reset:he,resetField:(e,t={})=>{v(o,e)&&(b(t.defaultValue)?Y(e,v(i,e)):(Y(e,t.defaultValue),z(i,e,t.defaultValue)),t.keepTouched||ae(s.touchedFields,e),t.keepDirty||(ae(s.dirtyFields,e),s.isDirty=t.defaultValue?T(e,v(i,e)):T()),t.keepError||(ae(s.errors,e),_.isValid&&R()),w.state.next({...s}))},clearErrors:e=>{e&&C(e).forEach((e=>ae(s.errors,e))),w.state.next({errors:e?s.errors:{}})},unregister:ne,setError:re,setFocus:(e,t={})=>{const r=v(o,e),n=r&&r._f;if(n){const e=n.refs?n.refs[0]:n.ref;e.focus&&(e.focus(),t.shouldSelect&&e.select())}},getFieldState:te}}function Se(t={}){const r=e.useRef(),n=e.useRef(),[s,o]=e.useState({isDirty:!1,isValidating:!1,isLoading:K(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},defaultValues:K(t.defaultValues)?void 0:t.defaultValues});r.current||(r.current={...xe(t,(()=>o((e=>({...e}))))),formState:s});const i=r.current.control;return i._options=t,D({subject:i._subjects.state,next:e=>{A(e,i._proxyFormState,i._updateFormState,!0)&&o({...i._formState})}}),e.useEffect((()=>{t.values&&!ue(t.values,n.current)?(i._reset(t.values,i._options.resetOptions),n.current=t.values):i._resetDefaultValues()}),[t.values,i]),e.useEffect((()=>{i._state.mount||(i._updateValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()})),r.current.formState=E(s,i),r.current}var $e=function(e,t,r){if(e&&"reportValidity"in e){var n=v(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},ke=function(e,t){var r=function(r){var n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?$e(n.ref,r,e):n.refs&&n.refs.forEach((function(t){return $e(t,r,e)}))};for(var n in t.fields)r(n)},Oe=function(e,t){t.shouldUseNativeValidation&&ke(e,t);var r={};for(var n in e){var s=v(t.fields,n);z(r,n,Object.assign(e[n],{ref:s&&s.ref}))}return r},Re=function(e,t,r){return void 0===t&&(t={abortEarly:!1}),void 0===r&&(r={}),function(n,s,o){try{var i=function(){return l.error?{values:{},errors:Oe((e=l.error,t=!o.shouldUseNativeValidation&&"all"===o.criteriaMode,e.details.length?e.details.reduce((function(e,r){var n=r.path.join(".");if(e[n]||(e[n]={message:r.message,type:r.type}),t){var s=e[n].types,o=s&&s[r.type];e[n]=V(n,t,e,r.type,o?[].concat(o,r.message):r.message)}return e}),{}):{}),o)}:(o.shouldUseNativeValidation&&ke({},o),{errors:{},values:l.value});var e,t},a=Object.assign({},t,{context:s}),l={},c=function(){if("sync"===r.mode)l=e.validate(n,a);else{var t=function(t,r){try{var s=Promise.resolve(e.validateAsync(n,a)).then((function(e){l.value=e}))}catch(t){return r(t)}return s&&s.then?s.then(void 0,r):s}((function(){return Promise.resolve(e.validateAsync(n,a)).then((function(e){l.value=e}))}),(function(e){l.error=e}));if(t&&t.then)return t.then((function(){}))}}();return Promise.resolve(c&&c.then?c.then(i):i())}catch(e){return Promise.reject(e)}}};function Ee(){return window.givewpDonationFormExports}const je="update_default_values";function Ae(e,t){return t.type===je?{...e,defaultValues:{...e.values,...t.values}}:e}const Ce=(0,e.createContext)(null);Ce.displayName="DonationFormState";const Fe=(0,e.createContext)(null);Fe.displayName="DonationFormStateDispatch";const De=({initialState:t,children:r})=>{const[n,s]=(0,e.useReducer)(Ae,t);return(0,e.createElement)(Ce.Provider,{value:n},(0,e.createElement)(Fe.Provider,{value:s},r))},Ie=()=>(0,e.useContext)(Ce),Me=window.givewp.form.templates,Pe=Me.layouts.wrapper;function Te(t,r="div",n){const{nodeType:s,type:o}=function(e){let t=null,r=null;return Object.entries(Me).forEach((n=>{if("object"==typeof n[1]){const s=n[0],o=Object.keys(n[1]).find((t=>n[1][t]===e));o&&(r=o,t=s)}})),{nodeType:t,type:r}}(t);return i=>(0,e.createElement)(Pe,{nodeType:s,type:o,htmlTag:r,name:n},(0,e.createElement)(t,{...i}))}function Ne(t,r="div",n){return(0,e.useMemo)((()=>Te(t,r,n)),[t])}const Le=window.givewp.form.templates,ze=Le.layouts.fieldLabel,Ve=Le.layouts.fieldError;function qe(t,r,n){const s=function(e,t){return e.hasOwnProperty(t)?e[t].message:null}(n,t.name);return{...t,inputProps:r(t.name,(o=t.validationRules,["required","maxLength","minLength"].reduce(((e,t)=>(o.hasOwnProperty(t)&&(e[t]=o[t]),e)),{}))),fieldError:s,Label:()=>(0,e.createElement)(ze,{label:t.label,required:t.validationRules.required}),ErrorMessage:()=>(0,e.createElement)(Ve,{error:s,name:t.name})};var o}function Ue(e){return(0,n.memo)(e,We)}function We(e,t){return e.node.name===t.node.name}const Be=window.givewp.form.templates,He=["hidden","honeypot"],Ge=Ue((function({node:t}){const{register:r}=window.givewp.form.hooks.useFormContext(),{errors:n}=window.givewp.form.hooks.useFormState(),s=He.includes(t.type)?Be.fields[t.type]:Ne(Be.fields[t.type],"div",t.name),o=qe(t,r,n);return(0,e.createElement)(s,{key:t.name,...o})})),Ke=window.givewp.form.templates,Ze=Ue((function({node:t}){const r=Ne(Ke.elements[t.type],"div",t.name);return(0,e.createElement)(r,{key:t.name,...t})})),Ye=window.givewp.form.templates,Je=Ue((function({node:t}){const r=Ne(Ye.groups[t.type],"div",t.name),n=t.reduceNodes(((t,r)=>(t[r.name]=t=>(0,e.createElement)(ot,{node:{...r,...t}}),t)),{}),s=t.reduceNodes(((e,t)=>(e[t.name]=t,e)),{});return(0,e.createElement)(r,{key:t.name,nodeComponents:n,nodeProps:s,...t})})),Xe=Te(window.givewp.form.templates.fields.gateways),Qe=Ue((function({node:t}){const{register:r}=window.givewp.form.hooks.useFormContext(),{errors:n}=window.givewp.form.hooks.useFormState(),s=qe(t,r,n),{gateways:o}=Ie();return(0,e.createElement)(Xe,{key:t.name,...s,gateways:o})})),et={"=":(e,t)=>e==t,"!=":(e,t)=>e!=t,">":(e,t)=>e>t,">=":(e,t)=>e>=t,"<":(e,t)=>e<t,"<=":(e,t)=>e<=t,contains:(e,t)=>String(e).includes(t),not_contains:(e,t)=>!String(e).includes(t)};function tt(t){const r=(0,e.useMemo)((()=>t.length?[...t.reduce(nt,new Set).values()]:[]),[t]),n=T({name:r}),s=(0,e.useMemo)((()=>r.reduce(((e,t,r)=>(e.set(t,n[r]),e)),new Map)),[r,n]);return(0,e.useMemo)((()=>!t.length||rt(t,s)),[s])}function rt(e,t){return!e.length||e.reduce((function e(r,n){if("basic"===n.type){const e=t.get(n.field),s=et[n.comparisonOperator](e,n.value);return"and"===n.logicalOperator?(null==r||r)&&s:null!=r&&r||s}return"and"===n.boolean?(null==r||r)&&n.conditions.reduce(e,null):null!=r&&r||n.conditions.reduce(e,null)}),null)}function nt(e,t){return"basic"===t.type?e.add(t.field):t.conditions.reduce(nt,e)}const st=window.givewp.form.templates,ot=Ue((function({node:t}){const r=tt(t.visibilityConditions),{unregister:i}=window.givewp.form.hooks.useFormContext();return(0,n.useEffect)((()=>{r||(s(t)&&i(t.name,{keepDefaultValue:!0}),o(t)&&t.walkNodes((e=>{i(e.name,{keepDefaultValue:!0})}),s))}),[r,i]),r?s(t)&&(c=t,Me.fields.hasOwnProperty(c.type))?"gateways"===t.type?(0,e.createElement)(Qe,{node:t}):(0,e.createElement)(Ge,{node:t}):function(e){return"element"===e.nodeType}(t)&&(l=t,Me.elements.hasOwnProperty(l.type))?(0,e.createElement)(Ze,{node:t}):o(t)&&(a=t,Me.groups.hasOwnProperty(a.type))?(0,e.createElement)(Je,{node:t}):(console.error(`Node: ${JSON.stringify(t)} does not exist in Form Design: ${JSON.stringify(st)}`),null):null;var a,l,c}));var it=r(24740);const at=window.wp.i18n;function lt({error:t,resetErrorBoundary:r}){const{useFormState:n,useFormContext:s}=window.givewp.form.hooks,{errors:o}=n(),{getValues:i}=s();return console.info({donationFormErrors:o,donationFormValues:i()}),(0,e.createElement)("div",{role:"alert"},(0,e.createElement)("p",null,(0,at.__)("An error occurred in the form. Please notify the site administrator. The error message is:","give")),(0,e.createElement)("pre",{style:{padding:"0.5rem"}},t.message),(0,e.createElement)("button",{type:"button",onClick:r},(0,at.__)("Reload form","give")))}function ct({children:t}){return(0,e.createElement)(it.ErrorBoundary,{FallbackComponent:lt,onReset:()=>{window.location.reload()}},t)}const ut=Te(window.givewp.form.templates.layouts.section,"section");function ft({section:t}){const r=tt(t.visibilityConditions),{unregister:o}=window.givewp.form.hooks.useFormContext();return(0,n.useEffect)((()=>{r||t.walkNodes((e=>{o(e.name)}),s)}),[r]),r?(0,e.createElement)(ut,{section:t},t.nodes.map((t=>(0,e.createElement)(ct,{key:t.name},(0,e.createElement)(ot,{node:t}))))):null}const dt=(e,t,r)=>{Object.entries(t).forEach((([t,n])=>{if(Object.keys(e).includes(t)){const e=document.querySelector('input[name="'+t+'"]'),s=e&&"hidden"!==e.type;if(r(t,{message:Array.isArray(n)?n[0]:n},{shouldFocus:s}),!s)if(e)e.parentElement.scrollIntoView({behavior:"smooth"});else{const e=document.querySelector(".givewp-fields-"+t);e?.scrollIntoView({behavior:"smooth"})}}else r("FORM_ERROR","gateway_error"===t?{message:Array.isArray(n)?n[0]:n}:{message:(0,at.__)("Something went wrong, please try again or contact support.","give")})}))};class mt extends Error{constructor(e,...t){super(...t),Error.captureStackTrace&&Error.captureStackTrace(this,mt),this.name="FormRequestError",this.errors=e}}const pt=mt;function ht(){const e=window.top.location.href,t=null!==window.frameElement;return{originUrl:e,isEmbed:t,embedId:t?window.frameElement.hasAttribute("data-givewp-embed-id")?window.frameElement.getAttribute("data-givewp-embed-id"):window.frameElement.id:null,locale:(()=>{if(!t)return null;if(window.frameElement.hasAttribute("data-form-locale"))return window.frameElement.getAttribute("data-form-locale");let e="";return window.frameElement.src&&(e=new URL(window.frameElement.src).searchParams.get("locale")||""),e})()}}async function gt(e,t){const r=new URL(e),n=(o=new URLSearchParams(r.search),i=t,o.has("givewp-route")&&i.includes(o.get("givewp-route"))),{locale:s}=ht();var o,i;s&&r.searchParams.set("locale",s),n?window.location.assign(r):window.top.location.assign(r)}async function yt(e,t){return{response:await fetch(e,{method:"POST",mode:"cors",cache:"default",credentials:"same-origin",redirect:"follow",referrerPolicy:"no-referrer-when-downgrade",headers:{accept:"application/json"},body:t})}}function bt(e){const t=new FormData;for(const r in e){const n=e[r];if(null===n||"object"!=typeof n||n instanceof File)t.append(r,n);else for(const e in n)t.append(`${r}[${e}]`,n[e])}return t}async function vt(e,t,r,n,s){if("subscription"===e?.donationType&&!r.supportsSubscriptions)return t("FORM_ERROR",{message:(0,at.__)("This payment gateway does not support recurring payments, please try selecting another payment gateway.","give")});try{const{originUrl:t,isEmbed:o,embedId:l,locale:c}=ht(),u=bt({...e,originUrl:t,isEmbed:o,embedId:l,locale:c});let f={};if(r.beforeCreatePayment){f=await r.beforeCreatePayment(e);for(const e in f)u.append(`gatewayData[${e}]`,f[e])}const{response:d}=await yt(n,u);(function(e){return!0===e.redirected})(d)&&await gt(d.url,s);const m=await d.json();if(function(e){return"redirect"===e.type}(m)&&await gt(m.data.redirectUrl,s),a(m)||i(m))throw new pt(m.data.errors.errors);r.afterCreatePayment&&await r.afterCreatePayment(m)}catch(r){var o;return r instanceof pt?dt(e,r.errors,t):t("FORM_ERROR",{message:null!==(o=r?.message)&&void 0!==o?o:(0,at.__)("Something went wrong, please try again or contact support.","give")})}}var _t=Symbol.for("immer-nothing"),wt=Symbol.for("immer-draftable"),xt=Symbol.for("immer-state");function St(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var $t=Object.getPrototypeOf;function kt(e){return!!e&&!!e[xt]}function Ot(e){return!!e&&(Et(e)||Array.isArray(e)||!!e[wt]||!!e.constructor?.[wt]||Dt(e)||It(e))}var Rt=Object.prototype.constructor.toString();function Et(e){if(!e||"object"!=typeof e)return!1;const t=$t(e);if(null===t)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object||"function"==typeof r&&Function.toString.call(r)===Rt}function jt(e,t){0===At(e)?Object.entries(e).forEach((([r,n])=>{t(r,n,e)})):e.forEach(((r,n)=>t(n,r,e)))}function At(e){const t=e[xt];return t?t.type_:Array.isArray(e)?1:Dt(e)?2:It(e)?3:0}function Ct(e,t){return 2===At(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Ft(e,t,r){const n=At(e);2===n?e.set(t,r):3===n?e.add(r):e[t]=r}function Dt(e){return e instanceof Map}function It(e){return e instanceof Set}function Mt(e){return e.copy_||e.base_}function Pt(e,t){if(Dt(e))return new Map(e);if(It(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&Et(e)){if(!$t(e)){const t=Object.create(null);return Object.assign(t,e)}return{...e}}const r=Object.getOwnPropertyDescriptors(e);delete r[xt];let n=Reflect.ownKeys(r);for(let t=0;t<n.length;t++){const s=n[t],o=r[s];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(r[s]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[s]})}return Object.create($t(e),r)}function Tt(e,t=!1){return Lt(e)||kt(e)||!Ot(e)||(At(e)>1&&(e.set=e.add=e.clear=e.delete=Nt),Object.freeze(e),t&&jt(e,((e,t)=>Tt(t,!0)))),e}function Nt(){St(2)}function Lt(e){return Object.isFrozen(e)}var zt,Vt={};function qt(e){const t=Vt[e];return t||St(0),t}function Ut(){return zt}function Wt(e,t){t&&(qt("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Bt(e){Ht(e),e.drafts_.forEach(Kt),e.drafts_=null}function Ht(e){e===zt&&(zt=e.parent_)}function Gt(e){return zt={drafts_:[],parent_:zt,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Kt(e){const t=e[xt];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Zt(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return void 0!==e&&e!==r?(r[xt].modified_&&(Bt(t),St(4)),Ot(e)&&(e=Yt(t,e),t.parent_||Xt(t,e)),t.patches_&&qt("Patches").generateReplacementPatches_(r[xt].base_,e,t.patches_,t.inversePatches_)):e=Yt(t,r,[]),Bt(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==_t?e:void 0}function Yt(e,t,r){if(Lt(t))return t;const n=t[xt];if(!n)return jt(t,((s,o)=>Jt(e,n,t,s,o,r))),t;if(n.scope_!==e)return t;if(!n.modified_)return Xt(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;const t=n.copy_;let s=t,o=!1;3===n.type_&&(s=new Set(t),t.clear(),o=!0),jt(s,((s,i)=>Jt(e,n,t,s,i,r,o))),Xt(e,t,!1),r&&e.patches_&&qt("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function Jt(e,t,r,n,s,o,i){if(kt(s)){const i=Yt(e,s,o&&t&&3!==t.type_&&!Ct(t.assigned_,n)?o.concat(n):void 0);if(Ft(r,n,i),!kt(i))return;e.canAutoFreeze_=!1}else i&&r.add(s);if(Ot(s)&&!Lt(s)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Yt(e,s),t&&t.scope_.parent_||Xt(e,s)}}function Xt(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Tt(t,r)}var Qt={get(e,t){if(t===xt)return e;const r=Mt(e);if(!Ct(r,t))return function(e,t,r){const n=rr(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}(e,r,t);const n=r[t];return e.finalized_||!Ot(n)?n:n===tr(e.base_,t)?(sr(e),e.copy_[t]=or(n,e)):n},has:(e,t)=>t in Mt(e),ownKeys:e=>Reflect.ownKeys(Mt(e)),set(e,t,r){const n=rr(Mt(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const n=tr(Mt(e),t),i=n?.[xt];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(((s=r)===(o=n)?0!==s||1/s==1/o:s!=s&&o!=o)&&(void 0!==r||Ct(e.base_,t)))return!0;sr(e),nr(e)}var s,o;return e.copy_[t]===r&&(void 0!==r||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==tr(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,sr(e),nr(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const r=Mt(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:n.enumerable,value:r[t]}:n},defineProperty(){St(11)},getPrototypeOf:e=>$t(e.base_),setPrototypeOf(){St(12)}},er={};function tr(e,t){const r=e[xt];return(r?Mt(r):e)[t]}function rr(e,t){if(!(t in e))return;let r=$t(e);for(;r;){const e=Object.getOwnPropertyDescriptor(r,t);if(e)return e;r=$t(r)}}function nr(e){e.modified_||(e.modified_=!0,e.parent_&&nr(e.parent_))}function sr(e){e.copy_||(e.copy_=Pt(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function or(e,t){const r=Dt(e)?qt("MapSet").proxyMap_(e,t):It(e)?qt("MapSet").proxySet_(e,t):function(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:Ut(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let s=n,o=Qt;r&&(s=[n],o=er);const{revoke:i,proxy:a}=Proxy.revocable(s,o);return n.draft_=a,n.revoke_=i,a}(e,t);return(t?t.scope_:Ut()).drafts_.push(r),r}function ir(e){if(!Ot(e)||Lt(e))return e;const t=e[xt];let r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Pt(e,t.scope_.immer_.useStrictShallowCopy_)}else r=Pt(e,!0);return jt(r,((e,t)=>{Ft(r,e,ir(t))})),t&&(t.finalized_=!1),r}jt(Qt,((e,t)=>{er[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),er.deleteProperty=function(e,t){return er.set.call(this,e,t,void 0)},er.set=function(e,t,r){return Qt.set.call(this,e[0],t,r,e[0])};var ar=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,r)=>{if("function"==typeof e&&"function"!=typeof t){const r=t;t=e;const n=this;return function(e=r,...s){return n.produce(e,(e=>t.call(this,e,...s)))}}let n;if("function"!=typeof t&&St(6),void 0!==r&&"function"!=typeof r&&St(7),Ot(e)){const s=Gt(this),o=or(e,void 0);let i=!0;try{n=t(o),i=!1}finally{i?Bt(s):Ht(s)}return Wt(s,r),Zt(n,s)}if(!e||"object"!=typeof e){if(n=t(e),void 0===n&&(n=e),n===_t&&(n=void 0),this.autoFreeze_&&Tt(n,!0),r){const t=[],s=[];qt("Patches").generateReplacementPatches_(e,n,t,s),r(t,s)}return n}St(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...r)=>this.produceWithPatches(t,(t=>e(t,...r)));let r,n;return[this.produce(e,t,((e,t)=>{r=e,n=t})),r,n]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){var t;Ot(e)||St(8),kt(e)&&(kt(t=e)||St(10),e=ir(t));const r=Gt(this),n=or(e,void 0);return n[xt].isManual_=!0,Ht(r),n}finishDraft(e,t){const r=e&&e[xt];r&&r.isManual_||St(9);const{scope_:n}=r;return Wt(n,t),Zt(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const n=t[r];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}r>-1&&(t=t.slice(r+1));const n=qt("Patches").applyPatches_;return kt(e)?n(e,t):this.produce(e,(e=>n(e,t)))}},lr=ar.produce;ar.produceWithPatches.bind(ar),ar.setAutoFreeze.bind(ar),ar.setUseStrictShallowCopy.bind(ar),ar.applyPatches.bind(ar),ar.createDraft.bind(ar),ar.finishDraft.bind(ar);const cr="add_item",ur="remove_item",fr="add_amount_to_total",dr="remove_amount_from_total";function mr(e,t){switch(t.type){case cr:e.items[t.item.id]=t.item;break;case ur:delete e.items[t.itemId];break;case fr:e.totals[t.itemId]=t.amount;break;case dr:delete e.totals[t.itemId]}}const pr=(0,e.createContext)(null);pr.displayName="DonationSummaryProvider";const hr=(0,e.createContext)(null);hr.displayName="DonationSummaryDispatch";const gr=({initialState:t={items:{},totals:{}},children:r})=>{const[n,s]=(o=mr,i=t,a=(0,e.useMemo)((function(){return lr(o)}),[o]),(0,e.useReducer)(a,i,void 0));var o,i,a;return(0,e.createElement)(pr.Provider,{value:n},(0,e.createElement)(hr.Provider,{value:s},r))},yr=()=>(0,e.useContext)(pr),{donateUrl:br,inlineRedirectRoutes:vr}=Ee(),_r=Te(window.givewp.form.templates.layouts.form);function wr({defaultValues:t,sections:r,validationSchema:n}){const{gateways:s}=Ie(),o=(0,e.useCallback)((e=>s.find((({id:t})=>t===e))),[]),i=Se({defaultValues:t,resolver:Re(n),reValidateMode:"onBlur"}),{handleSubmit:a,setError:l,control:c}=i,{errors:u,isSubmitting:f,isSubmitSuccessful:d}=I({control:c}),m=u.hasOwnProperty("FORM_ERROR")?u.FORM_ERROR.message:null;return(0,e.createElement)(R,{...i},(0,e.createElement)(ct,null,(0,e.createElement)(gr,null,(0,e.createElement)(_r,{formProps:{id:"give-next-gen",onSubmit:a((e=>vt(e,l,o(e.gatewayId),br,vr)))},isSubmitting:f||d,formError:m},(0,e.createElement)(e.Fragment,null,r.map((t=>(0,e.createElement)(ct,{key:t.name},(0,e.createElement)(ft,{key:t.name,section:t})))))))))}function xr(e,t){!function(e,t,r){l(e.nodes,t,r)}(this,e,t)}function Sr(e,t){return function(e,t,r){return function(e,t,r){let n=[];return l(e,(e=>{n.push(t(e))}),r),n}(e.nodes,t,r)}(this,e,t)}function $r(e,t,r){return function(e,t,r,n){return c(e.nodes,t,r,n)}(this,e,t,r)}var kr=r(16075),Or=r.n(kr);const Rr=(0,at.sprintf)(/* translators: base error message */ /* translators: base error message */ (0,at.__)("This is a required field","give"),"{#label}");function Er(e,t){return new Intl.NumberFormat(navigator.language,{style:"currency",currency:e,...t})}const jr=window.givewp.form.templates,Ar=Te(jr.layouts.header),Cr=Te(jr.layouts.headerTitle),Fr=Te(jr.layouts.headerDescription),Dr=Te(jr.layouts.goal),Ir=Te(jr.layouts.headerImage);function Mr({form:t}){const r=(0,e.useCallback)((e=>Er(t.currency,{maximumFractionDigits:0}).format(e)),[]);return(0,e.createElement)(ct,null,(0,e.createElement)(Ar,{isMultiStep:t.design?.isMultiStep,HeaderImage:()=>t.settings?.designSettingsImageUrl&&(0,e.createElement)(Ir,{url:t.settings?.designSettingsImageUrl,alt:t.settings?.designSettingsImageAlt||t.settings?.formTitle,color:t.settings?.designSettingsImageColor,opacity:t.settings?.designSettingsImageOpacity}),Title:()=>t.settings?.showHeading&&(0,e.createElement)(Cr,{text:t.settings.heading}),Description:()=>t.settings?.showDescription&&(0,e.createElement)(Fr,{text:t.settings.description}),Goal:()=>t.goal?.show&&(0,e.createElement)(Dr,{currency:t.currency,type:t.goal.type,goalLabel:t.goal.label,progressPercentage:Math.round(t.goal.currentAmount/t.goal.targetAmount*100),currentAmount:t.goal.currentAmount,currentAmountFormatted:t.goal.typeIsMoney?r(t.goal.currentAmount):t.goal.currentAmount.toString(),targetAmount:t.goal.targetAmount,targetAmountFormatted:t.goal.typeIsMoney?r(t.goal.targetAmount):t.goal.targetAmount.toString(),totalRevenue:t.stats.totalRevenue,totalRevenueFormatted:r(t.stats.totalRevenue),totalCountValue:t.stats.totalCountValue,totalCountLabel:t.stats.totalCountLabel})}))}const Pr=(0,e.createContext)(null);Pr.displayName="DonationFormSettings";const Tr=({value:t,children:r})=>(0,e.createElement)(Pr.Provider,{value:t},r),Nr=()=>(0,e.useContext)(Pr);const Lr=["BIF","CLP","DJF","GNF","JPY","KMF","KRW","MGA","PYG","RWF","UGX","VND","VUV","XAF","XOF","XPF"],zr=(e,t)=>Lr.includes(t)?Math.round(parseFloat(e)):Math.round(100*parseFloat(e)),Vr=e=>Math.round(100*e)/100;const qr="set_current_step",Ur="set_next_step";function Wr(e,t){switch(t.type){case qr:return{...e,currentStep:t.step};case Ur:const r=e.steps.map((e=>{const r=!e.visibilityConditions.length||rt(e.visibilityConditions,new Map(Object.entries(t.formValues)));return{...e,isVisible:r}}));return{...e,steps:r,currentStep:r.findIndex(((t,r)=>t.isVisible&&r>e.currentStep))};default:return e}}function Br(e){return{type:qr,step:e}}const Hr=(0,e.createContext)(null);Hr.displayName="DonationFormMultiStepState";const Gr=(0,e.createContext)(null);Gr.displayName="DonationFormMultiStepStateDispatch";const Kr=({initialState:t,children:r})=>{const[n,s]=(0,e.useReducer)(Wr,t);return(0,e.createElement)(Hr.Provider,{value:n},(0,e.createElement)(Gr.Provider,{value:s},r))},Zr=()=>(0,e.useContext)(Hr),Yr=()=>(0,e.useContext)(Gr);function Jr({isSubmitting:t,submittingText:r=(0,at.__)("Submitting…","give")}){const{donateButtonCaption:n}=window.givewp.form.hooks.useDonationFormSettings();return(0,e.createElement)("button",{type:"submit",disabled:t,"aria-busy":t},t?r:n)}function Xr(){const{gateways:t}=Ie();return(0,e.useCallback)((e=>t?.find((({id:t})=>t===e))),[t])}const{validateUrl:Qr}=Ee();function en({buttonText:t=(0,at.__)("Continue")}){const{steps:r,currentStep:n}=Zr(),s=Xr(),o=(0,e.useMemo)((()=>{var e;return null!==(e=r.find((({id:e})=>e===n))?.fields)&&void 0!==e?e:[]}),[r,n]),{trigger:l,getValues:c,setError:u}=O(),f=function(){const t=(0,e.useContext)(Fe),r=Yr();return(0,e.useCallback)(((e,n)=>{t({type:je,values:n}),r(function(e){return{type:Ur,formValues:e}}(n))}),[t,r])}(),d=n===r.length-1,[m,p]=(0,e.useState)(!1);return!d&&(0,e.createElement)("button",{className:"givewp-donation-form__steps-button-next",type:"button",disabled:m,"aria-busy":m,onClick:async()=>{if(p(!0),!await l(o))return void p(!1);const e=c(),t=await async function(e,t,r,n){if(void 0!==n&&"subscription"===t?.donationType&&!n.supportsSubscriptions)return r("FORM_ERROR",{message:(0,at.__)("This payment gateway does not support recurring payments, please try selecting another payment gateway.","give")});try{const r=bt(t),{response:n}=await yt(e,r),s=await n.json();if(a(s)||i(s))throw new pt(s.data.errors.errors);return!0}catch(e){var s;return e instanceof pt?dt(t,e.errors,r):r("FORM_ERROR",{message:null!==(s=e?.message)&&void 0!==s?s:(0,at.__)("Something went wrong, please try again or contact support.","give")})}}(Qr,e,u,s(e?.gatewayId));p(!1),t&&f(n,e)}},t)}const{donateUrl:tn,inlineRedirectRoutes:rn}=Ee(),nn=Te(window.givewp.form.templates.layouts.multiStepForm);function sn({currentStep:t,isFirstStep:r,isLastStep:n,children:s}){const{defaultValues:o,validationSchema:i}=Ie(),{multiStepNextButtonText:a,multiStepFirstButtonText:l}=Nr(),c=Xr(),u=Se({defaultValues:o,resolver:Re(i),reValidateMode:"onBlur"}),{handleSubmit:f,setError:d,control:m,getValues:p,trigger:h}=u,{errors:g,isSubmitting:y,isSubmitSuccessful:b}=I({control:m}),v=g.hasOwnProperty("FORM_ERROR")?g.FORM_ERROR.message:null;return(0,e.createElement)(R,{...u},(0,e.createElement)(ct,null,(0,e.createElement)(nn,{formProps:{id:"give-next-gen",className:"givewp-layouts-multiStepForm__form",onSubmit:f((e=>vt(e,d,c(e.gatewayId),tn,rn)))},isSubmitting:y||b,formError:v,previousButton:null,nextButton:!n&&(0,e.createElement)(en,{buttonText:r?l:a}),submitButton:n&&(0,e.createElement)(Jr,{isSubmitting:y||b})},s)))}var on=r(32485),an=r.n(on);function ln({children:t}){const{currentStep:r}=Zr(),n=function(){const t=Yr();return(0,e.useCallback)((e=>{const r=e-1;t(Br(r<=0?0:r))}),[t])}();return r>0&&(0,e.createElement)("button",{className:"givewp-donation-form__steps-header-previous-button",type:"button",onClick:()=>n(r)},t)}function cn({steps:t,children:r}){const{currentStep:n}=Zr(),{showHeader:s}=Nr(),o=function(e,t){return e?.find((({id:e})=>e===t))}(t,n),i=s?t.length:t.length-1,a=!s||null!==o.title;return(0,e.createElement)("div",{className:"givewp-donation-form__steps"},a&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"givewp-donation-form__steps-header"},(0,e.createElement)("div",{className:"givewp-donation-form__steps-header-previous"},(0,e.createElement)(ln,null,(0,at.__)("Previous","give"))),(0,e.createElement)("div",{className:"givewp-donation-form__steps-header-title"},(0,e.createElement)("p",{className:"givewp-donation-form__steps-header-title-text"},o.title))),(0,e.createElement)("progress",{className:"givewp-donation-form__steps-progress",value:n,max:i})),(0,e.createElement)("div",{className:"givewp-donation-form__steps-body"},r),(0,e.createElement)("div",{className:"givewp-donation-form__steps-footer"},(0,e.createElement)("div",{className:"givewp-donation-form__steps-footer-secure"},(0,e.createElement)("i",{className:"fas fa-lock givewp-donation-form__steps-footer-secure-icon"}),(0,e.createElement)("span",{className:"givewp-donation-form__steps-footer-secure-text"},(0,at.__)("100% Secure Donation","give")))))}function un({steps:t}){const{currentStep:r}=Zr(),s=function(e){const t=(0,n.useRef)();return(0,n.useEffect)((()=>{t.current=e}),[e]),t.current}(r);(0,e.useEffect)((()=>{r>0&&window.parent.document.getElementById(window.parentIFrame?.getId())?.scrollIntoView()}),[r]);const o=t?.map((({id:t,element:n})=>{const o=r>=t,i=0===t,a=t===r,l=r>s,c=r<s,u=an()("givewp-donation-form__step",{"givewp-donation-form__step--start":i,"givewp-donation-form__step--visible":a,"givewp-donation-form__step--hidden":!a,"givewp-donation-form__step--ascending":a&&l,"givewp-donation-form__step--descending":a&&c});return(0,e.createElement)("div",{key:t,id:`givewp-donation-form-step-${t}`,className:u},o&&n)}));return(0,e.createElement)(cn,{steps:t},o)}function fn({form:t}){const r=Yr(),{multiStepFirstButtonText:n}=Nr();return(0,e.createElement)("div",null,(0,e.createElement)(Mr,{form:t}),(0,e.createElement)("button",{type:"button",className:"givewp-donation-form__steps-button-next",onClick:()=>{r(Br(1))}},null!=n?n:(0,at.__)("Donate","give")))}const dn=Te(window.givewp.form.templates.layouts.section,"section");function mn({form:t}){const r=t.design?.includeHeaderInMultiStep&&t.settings?.showHeader,n=((t,r)=>{const n=r?t.length+1:t.length;return t.map(((t,o)=>{const i=r?o+1:o,a=0===i,l=i===n-1,c=function(e){return e.reduceNodes(((e,t)=>e.concat(t.name)),[],s)}(t),u=t?.label,f=t?.description;return{id:i,title:u,description:f,element:(0,e.createElement)(sn,{key:i,currentStep:i,isFirstStep:a,isLastStep:l},(0,e.createElement)(ct,{key:t.name},(0,e.createElement)(dn,{key:t.name,section:t,hideLabel:!0},t.nodes.map((t=>(0,e.createElement)(ct,{key:t.name},(0,e.createElement)(ot,{key:t.name,node:t}))))))),fields:c,visibilityConditions:t.visibilityConditions,isVisible:!t.visibilityConditions.length}}))})(t.nodes,r);return r&&n.unshift({id:0,title:null,description:null,element:(0,e.createElement)(fn,{form:t}),fields:[],visibilityConditions:[],isVisible:!0}),(0,e.createElement)(Kr,{initialState:{steps:n,currentStep:0}},(0,e.createElement)(gr,null,(0,e.createElement)(un,{steps:n})))}window.giveStorageData,window.jQuery;var pn=r(5556),hn=r.n(pn);function gn(){return gn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gn.apply(this,arguments)}function yn(e,t){if(null==e)return{};var r,n,s={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(s[r]=e[r]);return s}var bn,vn,wn=(bn=function(e){!function(t){if("undefined"!=typeof window){var r,n=0,s=!1,o=!1,i="[iFrameSizer]",a=null,l=window.requestAnimationFrame,c={max:1,scroll:1,bodyScroll:1,documentElementScroll:1},u={},f=null,d={autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){_("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}},m={};window.jQuery&&((r=window.jQuery).fn?r.fn.iFrameResize||(r.fn.iFrameResize=function(e){return this.filter("iframe").each((function(t,r){I(r,e)})).end()}):v("","Unable to bind to jQuery, it is not fully loaded.")),e.exports=N(),window.iFrameResize=window.iFrameResize||N()}function p(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function h(e,t,r){e.addEventListener(t,r,!1)}function g(e,t,r){e.removeEventListener(t,r,!1)}function y(e){return u[e]?u[e].log:s}function b(e,t){w("log",e,t,y(e))}function v(e,t){w("info",e,t,y(e))}function _(e,t){w("warn",e,t,!0)}function w(e,t,r,n){!0===n&&"object"==typeof window.console&&console[e](function(e){return i+"["+function(e){var t="Host page: "+e;return window.top!==window.self&&(t=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+e:"Nested host page: "+e),t}(e)+"]"}(t),r)}function x(e){function t(){r("Height"),r("Width"),C((function(){A(P),R(T),d("onResized",P)}),P,"init")}function r(e){var t=Number(u[T]["max"+e]),r=Number(u[T]["min"+e]),n=e.toLowerCase(),s=Number(P[n]);b(T,"Checking "+n+" is in range "+r+"-"+t),s<r&&(s=r,b(T,"Set "+n+" to min value")),s>t&&(s=t,b(T,"Set "+n+" to max value")),P[n]=""+s}function n(e){return M.substr(M.indexOf(":")+7+e)}function s(e,t){var r,n;r=function(){var r,n;F("Send Page Info","pageInfo:"+(r=document.body.getBoundingClientRect(),n=P.iframe.getBoundingClientRect(),JSON.stringify({iframeHeight:n.height,iframeWidth:n.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(n.top-r.top,10),offsetLeft:parseInt(n.left-r.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})),e,t)},m[n=t]||(m[n]=setTimeout((function(){m[n]=null,r()}),32))}function o(e){var t=e.getBoundingClientRect();return O(T),{x:Math.floor(Number(t.left)+Number(a.x)),y:Math.floor(Number(t.top)+Number(a.y))}}function l(e){var t=e?o(P.iframe):{x:0,y:0},r={x:Number(P.width)+t.x,y:Number(P.height)+t.y};b(T,"Reposition requested from iFrame (offset x:"+t.x+" y:"+t.y+")"),window.top!==window.self?window.parentIFrame?window.parentIFrame["scrollTo"+(e?"Offset":"")](r.x,r.y):_(T,"Unable to scroll to requested position, window.parentIFrame not found"):(a=r,c(),b(T,"--"))}function c(){!1!==d("onScroll",a)?R(T):E()}function f(e){d(e,{iframe:P.iframe,screenX:P.width,screenY:P.height,type:P.type})}function d(e,t){return S(T,e,t)}var p,y,w,x,$,I,M=e.data,P={},T=null;"[iFrameResizerChild]Ready"===M?function(){for(var e in u)F("iFrame requested init",D(e),u[e].iframe,e)}():i===(""+M).substr(0,13)&&M.substr(13).split(":")[0]in u?(x=(w=M.substr(13).split(":"))[1]?parseInt(w[1],10):0,$=u[w[0]]&&u[w[0]].iframe,I=getComputedStyle($),P={iframe:$,id:w[0],height:x+function(e){return"border-box"!==e.boxSizing?0:(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}(I)+function(e){return"border-box"!==e.boxSizing?0:(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}(I),width:w[2],type:w[3]},T=P.id,u[T]&&(u[T].loaded=!0),(y=P.type in{true:1,false:1,undefined:1})&&b(T,"Ignoring init message from meta parent page"),!y&&function(e){var t=!0;return u[e]||(t=!1,_(P.type+" No settings for "+e+". Message was: "+M)),t}(T)&&(b(T,"Received: "+M),p=!0,null===P.iframe&&(_(T,"IFrame ("+P.id+") not found"),p=!1),p&&function(){var t,r=e.origin,n=u[T]&&u[T].checkOrigin;if(n&&""+r!="null"&&!(n.constructor===Array?function(){var e=0,t=!1;for(b(T,"Checking connection is from allowed list of origins: "+n);e<n.length;e++)if(n[e]===r){t=!0;break}return t}():(t=u[T]&&u[T].remoteHost,b(T,"Checking connection is from: "+t),r===t)))throw new Error("Unexpected message received from: "+r+" for "+P.iframe.id+". Message was: "+e.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}()&&function(){switch(u[T]&&u[T].firstRun&&u[T]&&(u[T].firstRun=!1),P.type){case"close":k(P.iframe);break;case"message":p=n(6),b(T,"onMessage passed: {iframe: "+P.iframe.id+", message: "+p+"}"),d("onMessage",{iframe:P.iframe,message:JSON.parse(p)}),b(T,"--");break;case"mouseenter":f("onMouseEnter");break;case"mouseleave":f("onMouseLeave");break;case"autoResize":u[T].autoResize=JSON.parse(n(9));break;case"scrollTo":l(!1);break;case"scrollToOffset":l(!0);break;case"pageInfo":s(u[T]&&u[T].iframe,T),function(){function e(e,n){function o(){u[r]?s(u[r].iframe,r):t()}["scroll","resize"].forEach((function(t){b(r,e+t+" listener for sendPageInfo"),n(window,t,o)}))}function t(){e("Remove ",g)}var r=T;e("Add ",h),u[r]&&(u[r].stopPageInfo=t)}();break;case"pageInfoStop":u[T]&&u[T].stopPageInfo&&(u[T].stopPageInfo(),delete u[T].stopPageInfo);break;case"inPageLink":r=n(9).split("#")[1]||"",i=decodeURIComponent(r),(m=document.getElementById(i)||document.getElementsByName(i)[0])?(e=o(m),b(T,"Moving to in page link (#"+r+") at x: "+e.x+" y: "+e.y),a={x:e.x,y:e.y},c(),b(T,"--")):window.top!==window.self?window.parentIFrame?window.parentIFrame.moveToAnchor(r):b(T,"In page link #"+r+" not found and window.parentIFrame not found"):b(T,"In page link #"+r+" not found");break;case"reset":j(P);break;case"init":t(),d("onInit",P.iframe);break;default:t()}var e,r,i,m,p}())):v(T,"Ignored: "+M)}function S(e,t,r){var n=null,s=null;if(u[e]){if("function"!=typeof(n=u[e][t]))throw new TypeError(t+" on iFrame["+e+"] is not a function");s=n(r)}return s}function $(e){var t=e.id;delete u[t]}function k(e){var t=e.id;if(!1!==S(t,"onClose",t)){b(t,"Removing iFrame: "+t);try{e.parentNode&&e.parentNode.removeChild(e)}catch(e){_(e)}S(t,"onClosed",t),b(t,"--"),$(e)}else b(t,"Close iframe cancelled by onClose event")}function O(e){null===a&&b(e,"Get page position: "+(a={x:window.pageXOffset!==t?window.pageXOffset:document.documentElement.scrollLeft,y:window.pageYOffset!==t?window.pageYOffset:document.documentElement.scrollTop}).x+","+a.y)}function R(e){null!==a&&(window.scrollTo(a.x,a.y),b(e,"Set page position: "+a.x+","+a.y),E())}function E(){a=null}function j(e){b(e.id,"Size reset requested by "+("init"===e.type?"host page":"iFrame")),O(e.id),C((function(){A(e),F("reset","reset",e.iframe,e.id)}),e,"reset")}function A(e){function t(t){o||"0"!==e[t]||(o=!0,b(n,"Hidden iFrame detected, creating visibility listener"),function(){function e(){Object.keys(u).forEach((function(e){!function(e){function t(t){return"0px"===(u[e]&&u[e].iframe.style[t])}u[e]&&null!==u[e].iframe.offsetParent&&(t("height")||t("width"))&&F("Visibility change","resize",u[e].iframe,e)}(e)}))}function t(t){b("window","Mutation observed: "+t[0].target+" "+t[0].type),M(e,16)}var r,n=p();n&&(r=document.querySelector("body"),new n(t).observe(r,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}))}())}function r(r){!function(t){e.id?(e.iframe.style[t]=e[t]+"px",b(e.id,"IFrame ("+n+") "+t+" set to "+e[t]+"px")):b("undefined","messageData id not set")}(r),t(r)}var n=e.iframe.id;u[n]&&(u[n].sizeHeight&&r("height"),u[n].sizeWidth&&r("width"))}function C(e,t,r){r!==t.type&&l&&!window.jasmine?(b(t.id,"Requesting animation frame"),l(e)):e()}function F(e,t,r,n,s){var o,a=!1;n=n||r.id,u[n]&&(r&&"contentWindow"in r&&null!==r.contentWindow?(o=u[n]&&u[n].targetOrigin,b(n,"["+e+"] Sending msg to iframe["+n+"] ("+t+") targetOrigin: "+o),r.contentWindow.postMessage(i+t,o)):_(n,"["+e+"] IFrame("+n+") not found"),s&&u[n]&&u[n].warningTimeout&&(u[n].msgTimeout=setTimeout((function(){!u[n]||u[n].loaded||a||(a=!0,_(n,"IFrame has not responded within "+u[n].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))}),u[n].warningTimeout)))}function D(e){return e+":"+u[e].bodyMarginV1+":"+u[e].sizeWidth+":"+u[e].log+":"+u[e].interval+":"+u[e].enablePublicMethods+":"+u[e].autoResize+":"+u[e].bodyMargin+":"+u[e].heightCalculationMethod+":"+u[e].bodyBackground+":"+u[e].bodyPadding+":"+u[e].tolerance+":"+u[e].inPageLinks+":"+u[e].resizeFrom+":"+u[e].widthCalculationMethod}function I(e,r){function o(e){var t=e.split("Callback");if(2===t.length){var r="on"+t[0].charAt(0).toUpperCase()+t[0].slice(1);this[r]=this[e],delete this[e],_(l,"Deprecated: '"+e+"' has been renamed '"+r+"'. The old method will be removed in the next major version.")}}var i,a,l=function(t){var o;return""===t&&(e.id=(o=r&&r.id||d.id+n++,null!==document.getElementById(o)&&(o+=n++),t=o),s=(r||{}).log,b(t,"Added missing iframe ID: "+t+" ("+e.src+")")),t}(e.id);l in u&&"iFrameResizer"in e?_(l,"Ignored iFrame, already setup."):(function(t){var r;t=t||{},u[l]={firstRun:!0,iframe:e,remoteHost:e.src&&e.src.split("/").slice(0,3).join("/")},function(e){if("object"!=typeof e)throw new TypeError("Options is not an object")}(t),Object.keys(t).forEach(o,t),function(e){for(var t in d)Object.prototype.hasOwnProperty.call(d,t)&&(u[l][t]=Object.prototype.hasOwnProperty.call(e,t)?e[t]:d[t])}(t),u[l]&&(u[l].targetOrigin=!0===u[l].checkOrigin?""===(r=u[l].remoteHost)||null!==r.match(/^(about:blank|javascript:|file:\/\/)/)?"*":r:"*")}(r),function(){switch(b(l,"IFrame scrolling "+(u[l]&&u[l].scrolling?"enabled":"disabled")+" for "+l),e.style.overflow=!1===(u[l]&&u[l].scrolling)?"hidden":"auto",u[l]&&u[l].scrolling){case"omit":break;case!0:e.scrolling="yes";break;case!1:e.scrolling="no";break;default:e.scrolling=u[l]?u[l].scrolling:"no"}}(),function(){function t(t){1/0!==u[l][t]&&0!==u[l][t]&&(e.style[t]=u[l][t]+"px",b(l,"Set "+t+" = "+u[l][t]+"px"))}function r(e){if(u[l]["min"+e]>u[l]["max"+e])throw new Error("Value for min"+e+" can not be greater than max"+e)}r("Height"),r("Width"),t("maxHeight"),t("minHeight"),t("maxWidth"),t("minWidth")}(),"number"!=typeof(u[l]&&u[l].bodyMargin)&&"0"!==(u[l]&&u[l].bodyMargin)||(u[l].bodyMarginV1=u[l].bodyMargin,u[l].bodyMargin=u[l].bodyMargin+"px"),i=D(l),(a=p())&&function(t){e.parentNode&&new t((function(t){t.forEach((function(t){Array.prototype.slice.call(t.removedNodes).forEach((function(t){t===e&&k(e)}))}))})).observe(e.parentNode,{childList:!0})}(a),h(e,"load",(function(){var r,n;F("iFrame.onload",i,e,t,!0),r=u[l]&&u[l].firstRun,n=u[l]&&u[l].heightCalculationMethod in c,!r&&n&&j({iframe:e,height:0,width:0,type:"init"})})),F("init",i,e,t,!0),u[l]&&(u[l].iframe.iFrameResizer={close:k.bind(null,u[l].iframe),removeListeners:$.bind(null,u[l].iframe),resize:F.bind(null,"Window resize","resize",u[l].iframe),moveToAnchor:function(e){F("Move to anchor","moveToAnchor:"+e,u[l].iframe,l)},sendMessage:function(e){F("Send Message","message:"+(e=JSON.stringify(e)),u[l].iframe,l)}}))}function M(e,t){null===f&&(f=setTimeout((function(){f=null,e()}),t))}function P(){"hidden"!==document.visibilityState&&(b("document","Trigger event: Visiblity change"),M((function(){T("Tab Visable","resize")}),16))}function T(e,t){Object.keys(u).forEach((function(r){(function(e){return u[e]&&"parent"===u[e].resizeFrom&&u[e].autoResize&&!u[e].firstRun})(r)&&F(e,t,u[r].iframe,r)}))}function N(){function e(e,t){t&&(function(){if(!t.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==t.tagName.toUpperCase())throw new TypeError("Expected <IFRAME> tag, found <"+t.tagName+">")}(),I(t,e),r.push(t))}var r;return function(){var e,t=["moz","webkit","o","ms"];for(e=0;e<t.length&&!l;e+=1)l=window[t[e]+"RequestAnimationFrame"];l?l=l.bind(window):b("setup","RequestAnimationFrame not supported")}(),h(window,"message",x),h(window,"resize",(function(){b("window","Trigger event: resize"),M((function(){T("Window resize","resize")}),16)})),h(document,"visibilitychange",P),h(document,"-webkit-visibilitychange",P),function(n,s){switch(r=[],function(e){e&&e.enablePublicMethods&&_("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}(n),typeof s){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(s||"iframe"),e.bind(t,n));break;case"object":e(n,s);break;default:throw new TypeError("Unexpected data type ("+typeof s+")")}return r}}}()},bn(vn={exports:{}}),vn.exports),xn=function(){},Sn=function(r){var n=r.title,s=r.forwardRef,o=yn(r,["title","forwardRef"]),i=function(e){return e.autoResize,e.bodyBackground,e.bodyMargin,e.bodyPadding,e.checkOrigin,e.inPageLinks,e.heightCalculationMethod,e.interval,e.log,e.maxHeight,e.maxWidth,e.minHeight,e.minWidth,e.resizeFrom,e.scrolling,e.sizeHeight,e.sizeWidth,e.warningTimeout,e.tolerance,e.widthCalculationMethod,e.onClosed,e.onInit,e.onMessage,e.onMouseEnter,e.onMouseLeave,e.onResized,yn(e,["autoResize","bodyBackground","bodyMargin","bodyPadding","checkOrigin","inPageLinks","heightCalculationMethod","interval","log","maxHeight","maxWidth","minHeight","minWidth","resizeFrom","scrolling","sizeHeight","sizeWidth","warningTimeout","tolerance","widthCalculationMethod","onClosed","onInit","onMessage","onMouseEnter","onMouseLeave","onResized"])}(o),a=(0,e.useRef)(null),l=function(){return xn(!a.current,"[iframeSizerReact]["+(a&&a.current&&a.current.id)+"] Close event ignored, to remove the iframe update your React component"),!a.current};return(0,e.useEffect)((function(){var e=a.current;return wn(gn({},o,{onClose:l}),e),function(){return e.iFrameResizer&&e.iFrameResizer.removeListeners()}}),[]),(0,e.useImperativeHandle)(s,(function(){return{resize:function(){return a.current.iFrameResizer.resize()},moveToAnchor:function(e){return a.current.iFrameResizer.moveToAnchor(e)},sendMessage:function(e,t){a.current.iFrameResizer.sendMessage(e,t)}}})),t().createElement("iframe",gn({title:n},i,{ref:a}))};Sn.defaultProps={title:"iframe"},Sn.propTypes={title:hn().string};(0,e.createContext)(null).displayName="FormState";(0,e.createContext)(null).displayName="FormStateDispatch",window.wp.components;const $n=(0,e.createRef)(),kn={SETTINGS:"preview:settings",GOAL:"preview:goal",GOAL_SOURCE:"preview:goal_source",COLORS:"preview:colors",CSS:"preview:css",DESIGN_SETTINGS:"preview:design-settings"};const On=Te(window.givewp.form.templates.layouts.goalAchieved),{form:Rn,previewMode:En}=Ee(),jn=function(e){const{nodes:t,...r}=e;return r}(Rn);var An;(An=Rn).walkNodes=xr.bind(An),An.mapNodes=Sr.bind(An),An.reduceNodes=$r.bind(An),An.walkNodes((e=>{e.walkNodes=xr.bind(e),e.mapNodes=Sr.bind(e),e.reduceNodes=$r.bind(e)}),o),window.givewp.form.hooks={useFormContext:O,useWatch:T,useFormState:I,useCurrencyFormatter:function(t,r){return(0,e.useMemo)((()=>Er(t,r)),[t,navigator.language])},useDonationSummary:function(){const{items:t,totals:r}=yr(),s=(0,e.useContext)(hr);return{items:t,totals:r,addItem:(0,n.useCallback)((e=>s(function(e){return{type:cr,item:e}}(e))),[s]),removeItem:(0,n.useCallback)((e=>s(function(e){return{type:ur,itemId:e}}(e))),[s]),addToTotal:(0,n.useCallback)(((e,t)=>s(function(e,t){return{type:fr,itemId:e,amount:t}}(e,t))),[s]),removeFromTotal:(0,n.useCallback)((e=>s(function(e){return{type:dr,itemId:e}}(e))),[s]),getTotalSum:(0,n.useCallback)((e=>Number(Object.values({...r,amount:e}).reduce(((e,t)=>e+t),0))),[r])}},useDonationFormSettings:Nr,useFormSubmitButton:function(){const e=Array.from(document.forms).pop(),t=e?.querySelector('[type="submit"]');if(t)return t;const r=e?.querySelector('.givewp-donation-form__steps-button-next[type="button"]');return r||null},useFormData:function(){const{totals:e}=yr(),{useWatch:t}=window.givewp.form.hooks,r=t({name:"firstName"}),n=t({name:"lastName"}),s=t({name:"email"}),o=t({name:"phone"}),i={addressLine1:t({name:"address1"}),addressLine2:t({name:"address2"}),city:t({name:"city"}),state:t({name:"state"}),postalCode:t({name:"zip"}),country:t({name:"country"})},a=t({name:"amount"}),l=t({name:"currency"}),c=t({name:"subscriptionPeriod"}),u=t({name:"subscriptionFrequency"}),f=t({name:"subscriptionInstallments"}),d=t({name:"donationType"}),m=((e,t)=>Vr(Number(Object.values({...e,amount:t}).reduce(((e,t)=>e+t),0))))(e,Number(a)),p=zr(m.toString(),l),h=((e,t)=>{let r=0;const n=["feeRecovery"];for(const[t,s]of Object.entries(e))n.includes(t)&&(r+=s);return Vr(Number(r+t))})(e,Number(a)),g=zr(h.toString(),l),y=(Number(a),zr(a,l),"single"===d);return{firstName:r,lastName:n,email:s,phone:o,currency:l,billingAddress:i,amount:y?m:h,amountInMinorUnits:y?p:g,isOneTime:y,isRecurring:"subscription"===d,subscriptionPeriod:c,subscriptionFrequency:u,subscriptionInstallments:f}}};const Cn=c(Rn.nodes,((e,t)=>{const r=t.defaultValue;return null!==r&&""!==r&&(e[t.name]=r),e}),{},s),Fn=function(e){const t=e.reduceNodes(((e,t)=>(e[t.name]=function(e){let t=function(e){let t;return 0===Object.keys(e).length?Or().any():(e.hasOwnProperty("numeric")||e.hasOwnProperty("integer")?(t=Or().number(),e.hasOwnProperty("integer")&&(t=t.integer())):e.hasOwnProperty("boolean")?t=Or().boolean():e.hasOwnProperty("array")?t=Or().array():e.hasOwnProperty("file")?t=Or().object():e.hasOwnProperty("dateTime")?t=Or().date():(t=Or().string(),e.hasOwnProperty("email")&&(t=t.email({tlds:!1})),e.hasOwnProperty("alpha")&&(t=t.alpha()),e.hasOwnProperty("alphanum")&&(t=t.alphanum())),!e.hasOwnProperty("number")&&e.hasOwnProperty("boolean")||(e.hasOwnProperty("min")&&(t=t.min(e.min)),e.hasOwnProperty("max")&&(t=t.max(e.max))),t=e.required?e.hasOwnProperty("excludeUnless")?t.custom(((t,r)=>{const n=r.state.ancestors[0],s=e.excludeUnless.every((e=>et[e.comparisonOperator](n[e.field],e.value)));return!s||""!==t&&null!==t?s?t:void 0:r.error("required")}),"exclude unless validation"):t.required():t.optional().allow("",null),t=function(e,t){return e.hasOwnProperty("donationType")&&(t=Or().allow("single","subscription").only().required()),e.hasOwnProperty("subscriptionPeriod")&&(t=Or().when("donationType",{is:"subscription",then:Or().allow("day","week","quarter","month","year").only().required(),otherwise:Or().optional()})),e.hasOwnProperty("subscriptionFrequency")&&(t=Or().when("donationType",{is:"subscription",then:Or().number().integer().required(),otherwise:Or().optional()})),e.hasOwnProperty("subscriptionInstallments")&&(t=Or().when("donationType",{is:"subscription",then:Or().number().integer().required(),otherwise:Or().optional()})),t}(e,t),t)}(e.validationRules);return e.label&&(t=t.label(e.label)),t}(t),e)),{},s);return Or().object(t).messages({"string.base":Rr,"string.empty":Rr,"any.required":Rr,"number.base":Rr,"object.base":Rr})}(Rn),Dn={defaultValues:Cn,gateways:window.givewp.gateways.getAll(),validationSchema:Fn};function In({form:t}){return t.goal.isAchieved?(0,e.createElement)(ct,null,(0,e.createElement)(On,{goalAchievedMessage:t.settings.goalAchievedMessage})):t.design?.isMultiStep?(0,e.createElement)(Tr,{value:{...t.settings,...jn}},(0,e.createElement)(De,{initialState:Dn},!t.design?.includeHeaderInMultiStep&&t.settings.showHeader&&(0,e.createElement)(Mr,{form:t}),(0,e.createElement)(mn,{form:t}))):(0,e.createElement)(Tr,{value:{...t.settings,...jn}},(0,e.createElement)(De,{initialState:Dn},t.settings?.showHeader&&(0,e.createElement)(Mr,{form:t}),(0,e.createElement)(wr,{defaultValues:Cn,sections:t.nodes,validationSchema:Fn})))}const Mn=document.getElementById("root-givewp-donation-form"),Pn=document.getElementById("root-givewp-donation-form-style");(0,n.createRoot)(Mn).render(En?(0,e.createElement)((function(){const{subscribeToGoal:t,subscribeToGoalSource:r,subscribeToColors:n,subscribeToSettings:s,subscribeToCss:o,unsubscribeAll:i}=function(){const t={};(0,e.useEffect)((()=>(addEventListener("message",r,!1),()=>removeEventListener("message",r))),[]);const r=e=>{const{event:r,data:n}=(e=>"string"==typeof e.data&&e.data.includes("[iFrameSizer]message:")?JSON.parse(e.data.replace("[iFrameSizer]message:","")):e.data)(e);if(t[r]){const e={};Object.entries(n).forEach((([t,r])=>{"function"!=typeof r&&"object"!=typeof r&&(e[t]=r)})),t[r].forEach((t=>{t(e)}))}},n=(e,r)=>{t[e]||(t[e]=[]),t[e].push(r)},s=(e,t,r)=>{r.current?.sendMessage&&r.current.sendMessage({event:e,data:t})};return{unsubscribe:e=>{t[e]&&delete t[e]},unsubscribeAll:()=>{for(const e in kn)delete t[e]},publishGoal:e=>{s(kn.GOAL,e,$n)},publishGoalSource:e=>{s(kn.GOAL_SOURCE,e,$n)},publishGoalType:e=>{const t=["amount","amountFromSubscriptions"].includes(e);s(kn.GOAL,{type:e,label:e,typeIsCount:!t,typeIsMoney:t},$n)},publishColors:e=>{s(kn.COLORS,e,$n)},publishCss:e=>{s(kn.CSS,e,$n)},publishSettings:e=>{s(kn.SETTINGS,e,$n)},publishDesignSettings:e=>{s(kn.DESIGN_SETTINGS,e,$n)},subscribeToGoal:e=>{n(kn.GOAL,e)},subscribeToGoalSource:e=>{n(kn.GOAL,e)},subscribeToColors:e=>{n(kn.COLORS,e)},subscribeToSettings:e=>{n(kn.SETTINGS,e)},subscribeToCss:e=>{n(kn.CSS,e)},subscribeToDesignSettings:e=>{n(kn.DESIGN_SETTINGS,e)}}}(),[a,l]=(0,e.useState)(Rn);return(0,e.useEffect)((()=>(s((e=>{l((t=>({...t,settings:{...t.settings,...e}})))})),t((e=>{l((t=>({...t,goal:{...t.goal,...e}})))})),r((e=>{l((t=>({...t,goalSource:e})))})),n((e=>{e.primaryColor&&Mn.style.setProperty("--givewp-primary-color",e.primaryColor),e.secondaryColor&&Mn.style.setProperty("--givewp-secondary-color",e.secondaryColor)})),o((({customCss:e})=>{let t="";const r=new CSSStyleSheet;r.replaceSync(e);for(let e=0;e<r.cssRules.length;e++)t+=r.cssRules[e].cssText+"\n";Pn.innerText=t})),()=>i())),[]),(0,e.createElement)(In,{form:a})}),null):(0,e.createElement)(In,{form:Rn}))})()})();